diff --git a/dev-docs/upgrade-dependencies.md b/dev-docs/upgrade-dependencies.md index bc37d38756..cf45e605da 100644 --- a/dev-docs/upgrade-dependencies.md +++ b/dev-docs/upgrade-dependencies.md @@ -11,3 +11,17 @@ Contact JJ so he uploads the binaries to the S3 bucket. - In `src/import_map.json`, change the version number of the imports like `https://deno.land/std@0.204.0/archive` to the new version number (e.g. `0.205.0`). - run `./package/scripts/vendoring/vendor.sh` + +## Upgrade mermaidjs + +Apparently mermaidjs doesn't actually build mermaid in their releases :shrug:. +They also don't appear to offer any clear documentation on how to do it, and `npm install` from their `packages/mermaidjs` directory just fails. + +So, we grab the published javascript bundles from unpkg.com. + +For version 11.2.0, for example, these are: + +- https://unpkg.com/mermaid@11.2.0/dist/mermaid.js +- https://unpkg.com/mermaid@11.2.0/dist/mermaid.min.js + +Copy these files to `src/resources/formats/html/mermaid`. diff --git a/news/changelog-1.6.md b/news/changelog-1.6.md index 27551eeb19..1d325a1f8c 100644 --- a/news/changelog-1.6.md +++ b/news/changelog-1.6.md @@ -71,6 +71,7 @@ All changes included in 1.6: ## Other Fixes and Improvements +- Dependency update: `mermaidjs` to 11.2.0. - ([#10608](https://github.com/quarto-dev/quarto-cli/issues/10608)): Don't overwrite the built-in CSS function `contrast` in Quarto's SCSS. - ([#10162](https://github.com/quarto-dev/quarto-cli/issues/10162)): Use Edge on `macOS` as a Chromium browser when available. - ([#10235](https://github.com/quarto-dev/quarto-cli/issues/10235)): Configure the CI schedule trigger to activate exclusively for the upstream repository. diff --git a/src/resources/formats/html/mermaid/mermaid.js b/src/resources/formats/html/mermaid/mermaid.js index 5c750276e5..cd95d1c5d1 100644 --- a/src/resources/formats/html/mermaid/mermaid.js +++ b/src/resources/formats/html/mermaid/mermaid.js @@ -1,163303 +1,130833 @@ -(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() { - "use strict"; - function dedent(templ) { - var values2 = []; - 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 _a, _b; - return (_b = (_a = match.match(/[\t ]/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; - })); - } - return arr; - }, []); - if (indentLengths.length) { - var pattern_1 = new RegExp("\n[ ]{" + Math.min.apply(Math, indentLengths) + "}", "g"); - strings = strings.map(function(str2) { - return str2.replace(pattern_1, "\n"); +"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/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js + var require_dayjs_min = __commonJS({ + "../../node_modules/.pnpm/dayjs@1.11.13/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]); + }; + }), 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; }); } - strings[0] = strings[0].replace(/^\r?\n/, ""); - var string = strings[0]; - values2.forEach(function(value, i2) { - var endentations = string.match(/(?:^|\n)( *)$/); - var endentation = endentations ? endentations[1] : ""; - var indentedValue = value; - if (typeof value === "string" && value.includes("\n")) { - indentedValue = String(value).split("\n").map(function(str2, i3) { - return i3 === 0 ? str2 : "" + endentation + str2; - }).join("\n"); - } - string += indentedValue + strings[i2 + 1]; - }); - return string; - } - var SECONDS_A_MINUTE = 60; - var SECONDS_A_HOUR = SECONDS_A_MINUTE * 60; - var SECONDS_A_DAY = SECONDS_A_HOUR * 24; - var SECONDS_A_WEEK = SECONDS_A_DAY * 7; - var MILLISECONDS_A_SECOND = 1e3; - var MILLISECONDS_A_MINUTE = SECONDS_A_MINUTE * MILLISECONDS_A_SECOND; - var MILLISECONDS_A_HOUR = SECONDS_A_HOUR * MILLISECONDS_A_SECOND; - var MILLISECONDS_A_DAY = SECONDS_A_DAY * MILLISECONDS_A_SECOND; - var MILLISECONDS_A_WEEK = SECONDS_A_WEEK * MILLISECONDS_A_SECOND; - var MS = "millisecond"; - var S = "second"; - var MIN = "minute"; - var H = "hour"; - var D = "day"; - var W = "week"; - var M = "month"; - var Q = "quarter"; - var Y = "year"; - var DATE = "date"; - var FORMAT_DEFAULT = "YYYY-MM-DDTHH:mm:ssZ"; - var INVALID_DATE_STRING = "Invalid Date"; - var REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/; - var REGEX_FORMAT = /\[([^\]]+)]|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; - const en = { - 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 ordinal2(n) { - var s = ["th", "st", "nd", "rd"]; - var v = n % 100; - return "[" + n + (s[(v - 20) % 10] || s[v] || s[0]) + "]"; - } - }; - var padStart$1 = function padStart2(string, length2, pad2) { - var s = String(string); - if (!s || s.length >= length2) - return string; - return "" + Array(length2 + 1 - s.length).join(pad2) + string; - }; - var padZoneStr = function padZoneStr2(instance2) { - var negMinutes = -instance2.utcOffset(); - var minutes = Math.abs(negMinutes); - var hourOffset = Math.floor(minutes / 60); - var minuteOffset = minutes % 60; - return (negMinutes <= 0 ? "+" : "-") + padStart$1(hourOffset, 2, "0") + ":" + padStart$1(minuteOffset, 2, "0"); - }; - var monthDiff = function monthDiff2(a, b) { - if (a.date() < b.date()) - return -monthDiff2(b, a); - var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()); - var anchor = a.clone().add(wholeMonthDiff, M); - var c2 = b - anchor < 0; - var anchor2 = a.clone().add(wholeMonthDiff + (c2 ? -1 : 1), M); - return +(-(wholeMonthDiff + (b - anchor) / (c2 ? anchor - anchor2 : anchor2 - anchor)) || 0); - }; - var absFloor = function absFloor2(n) { - return n < 0 ? Math.ceil(n) || 0 : Math.floor(n); - }; - var prettyUnit = function prettyUnit2(u2) { - var special = { - M, - y: Y, - w: W, - d: D, - D: DATE, - h: H, - m: MIN, - s: S, - ms: MS, - Q - }; - return special[u2] || String(u2 || "").toLowerCase().replace(/s$/, ""); - }; - var isUndefined$1 = function isUndefined2(s) { - return s === void 0; - }; - const U = { - s: padStart$1, - z: padZoneStr, - m: monthDiff, - a: absFloor, - p: prettyUnit, - u: isUndefined$1 - }; - var L = "en"; - var Ls = {}; - Ls[L] = en; - var isDayjs = function isDayjs2(d) { - return d instanceof Dayjs; - }; - var parseLocale = function parseLocale2(preset, object2, isLocal) { - var l; - if (!preset) - return L; - if (typeof preset === "string") { - var presetLower = preset.toLowerCase(); - if (Ls[presetLower]) { - l = presetLower; - } - if (object2) { - Ls[presetLower] = object2; - l = presetLower; - } - var presetSplit = preset.split("-"); - if (!l && presetSplit.length > 1) { - return parseLocale2(presetSplit[0]); - } - } else { - var name2 = preset.name; - Ls[name2] = preset; - l = name2; - } - if (!isLocal && l) - L = l; - return l || !isLocal && L; - }; - var dayjs = function dayjs2(date2, c2) { - if (isDayjs(date2)) { - return date2.clone(); - } - var cfg = typeof c2 === "object" ? c2 : {}; - cfg.date = date2; - cfg.args = arguments; - return new Dayjs(cfg); - }; - var wrapper = function wrapper2(date2, instance2) { - return dayjs(date2, { - locale: instance2.$L, - utc: instance2.$u, - x: instance2.$x, - $offset: instance2.$offset - // todo: refactor; do not use this.$offset in you code - }); - }; - var Utils$1 = U; - Utils$1.l = parseLocale; - Utils$1.i = isDayjs; - Utils$1.w = wrapper; - var parseDate = function parseDate2(cfg) { - var date2 = cfg.date, utc = cfg.utc; - if (date2 === null) - return /* @__PURE__ */ new Date(NaN); - if (Utils$1.u(date2)) - return /* @__PURE__ */ new Date(); - if (date2 instanceof Date) - return new Date(date2); - if (typeof date2 === "string" && !/Z$/i.test(date2)) { - var d = date2.match(REGEX_PARSE); - if (d) { - var m = d[2] - 1 || 0; - var ms = (d[7] || "0").substring(0, 3); - if (utc) { - return new Date(Date.UTC(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms)); - } - return new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms); - } - } - return new Date(date2); - }; - var Dayjs = /* @__PURE__ */ function() { - function Dayjs2(cfg) { - this.$L = parseLocale(cfg.locale, null, true); - this.parse(cfg); - } - var _proto = Dayjs2.prototype; - _proto.parse = function parse2(cfg) { - this.$d = parseDate(cfg); - this.$x = cfg.x || {}; - this.init(); - }; - _proto.init = function init2() { - var $d = this.$d; - this.$y = $d.getFullYear(); - this.$M = $d.getMonth(); - this.$D = $d.getDate(); - this.$W = $d.getDay(); - this.$H = $d.getHours(); - this.$m = $d.getMinutes(); - this.$s = $d.getSeconds(); - this.$ms = $d.getMilliseconds(); - }; - _proto.$utils = function $utils() { - return Utils$1; - }; - _proto.isValid = function isValid() { - return !(this.$d.toString() === INVALID_DATE_STRING); - }; - _proto.isSame = function isSame(that, units) { - var other = dayjs(that); - return this.startOf(units) <= other && other <= this.endOf(units); - }; - _proto.isAfter = function isAfter(that, units) { - return dayjs(that) < this.startOf(units); - }; - _proto.isBefore = function isBefore(that, units) { - return this.endOf(units) < dayjs(that); - }; - _proto.$g = function $g(input, get2, set2) { - if (Utils$1.u(input)) - return this[get2]; - return this.set(set2, input); - }; - _proto.unix = function unix() { - return Math.floor(this.valueOf() / 1e3); - }; - _proto.valueOf = function valueOf() { - return this.$d.getTime(); - }; - _proto.startOf = function startOf(units, _startOf) { - var _this = this; - var isStartOf = !Utils$1.u(_startOf) ? _startOf : true; - var unit2 = Utils$1.p(units); - var instanceFactory = function instanceFactory2(d, m) { - var ins = Utils$1.w(_this.$u ? Date.UTC(_this.$y, m, d) : new Date(_this.$y, m, d), _this); - return isStartOf ? ins : ins.endOf(D); - }; - var instanceFactorySet = function instanceFactorySet2(method, slice2) { - var argumentStart = [0, 0, 0, 0]; - var argumentEnd = [23, 59, 59, 999]; - return Utils$1.w(_this.toDate()[method].apply( - // eslint-disable-line prefer-spread - _this.toDate("s"), - (isStartOf ? argumentStart : argumentEnd).slice(slice2) - ), _this); - }; - var $W = this.$W, $M = this.$M, $D = this.$D; - var utcPad = "set" + (this.$u ? "UTC" : ""); - switch (unit2) { - case Y: - return isStartOf ? instanceFactory(1, 0) : instanceFactory(31, 11); - case M: - return isStartOf ? instanceFactory(1, $M) : instanceFactory(0, $M + 1); - case W: { - var weekStart = this.$locale().weekStart || 0; - var gap = ($W < weekStart ? $W + 7 : $W) - weekStart; - return instanceFactory(isStartOf ? $D - gap : $D + (6 - gap), $M); - } - case D: - case DATE: - return instanceFactorySet(utcPad + "Hours", 0); - case H: - return instanceFactorySet(utcPad + "Minutes", 1); - case MIN: - return instanceFactorySet(utcPad + "Seconds", 2); - case S: - return instanceFactorySet(utcPad + "Milliseconds", 3); - default: - return this.clone(); - } - }; - _proto.endOf = function endOf(arg) { - return this.startOf(arg, false); - }; - _proto.$set = function $set(units, _int) { - var _C$D$C$DATE$C$M$C$Y$C; - var unit2 = Utils$1.p(units); - var utcPad = "set" + (this.$u ? "UTC" : ""); - var name2 = (_C$D$C$DATE$C$M$C$Y$C = {}, _C$D$C$DATE$C$M$C$Y$C[D] = utcPad + "Date", _C$D$C$DATE$C$M$C$Y$C[DATE] = utcPad + "Date", _C$D$C$DATE$C$M$C$Y$C[M] = utcPad + "Month", _C$D$C$DATE$C$M$C$Y$C[Y] = utcPad + "FullYear", _C$D$C$DATE$C$M$C$Y$C[H] = utcPad + "Hours", _C$D$C$DATE$C$M$C$Y$C[MIN] = utcPad + "Minutes", _C$D$C$DATE$C$M$C$Y$C[S] = utcPad + "Seconds", _C$D$C$DATE$C$M$C$Y$C[MS] = utcPad + "Milliseconds", _C$D$C$DATE$C$M$C$Y$C)[unit2]; - var arg = unit2 === D ? this.$D + (_int - this.$W) : _int; - if (unit2 === M || unit2 === Y) { - var date2 = this.clone().set(DATE, 1); - date2.$d[name2](arg); - date2.init(); - this.$d = date2.set(DATE, Math.min(this.$D, date2.daysInMonth())).$d; - } else if (name2) - this.$d[name2](arg); - this.init(); - return this; - }; - _proto.set = function set2(string, _int2) { - return this.clone().$set(string, _int2); - }; - _proto.get = function get2(unit2) { - return this[Utils$1.p(unit2)](); - }; - _proto.add = function add(number2, units) { - var _this2 = this, _C$MIN$C$H$C$S$unit; - number2 = Number(number2); - var unit2 = Utils$1.p(units); - var instanceFactorySet = function instanceFactorySet2(n) { - var d = dayjs(_this2); - return Utils$1.w(d.date(d.date() + Math.round(n * number2)), _this2); - }; - if (unit2 === M) { - return this.set(M, this.$M + number2); - } - if (unit2 === Y) { - return this.set(Y, this.$y + number2); - } - if (unit2 === D) { - return instanceFactorySet(1); - } - if (unit2 === W) { - return instanceFactorySet(7); - } - var step = (_C$MIN$C$H$C$S$unit = {}, _C$MIN$C$H$C$S$unit[MIN] = MILLISECONDS_A_MINUTE, _C$MIN$C$H$C$S$unit[H] = MILLISECONDS_A_HOUR, _C$MIN$C$H$C$S$unit[S] = MILLISECONDS_A_SECOND, _C$MIN$C$H$C$S$unit)[unit2] || 1; - var nextTimeStamp = this.$d.getTime() + number2 * step; - return Utils$1.w(nextTimeStamp, this); - }; - _proto.subtract = function subtract(number2, string) { - return this.add(number2 * -1, string); - }; - _proto.format = function format2(formatStr) { - var _this3 = this; - var locale2 = this.$locale(); - if (!this.isValid()) - return locale2.invalidDate || INVALID_DATE_STRING; - var str2 = formatStr || FORMAT_DEFAULT; - var zoneStr = Utils$1.z(this); - var $H = this.$H, $m = this.$m, $M = this.$M; - var weekdays = locale2.weekdays, months = locale2.months, meridiem = locale2.meridiem; - var getShort = function getShort2(arr, index, full, length2) { - return arr && (arr[index] || arr(_this3, str2)) || full[index].slice(0, length2); - }; - var get$H = function get$H2(num) { - return Utils$1.s($H % 12 || 12, num, "0"); - }; - var meridiemFunc = meridiem || function(hour2, minute2, isLowercase) { - var m = hour2 < 12 ? "AM" : "PM"; - return isLowercase ? m.toLowerCase() : m; - }; - var matches = { - YY: String(this.$y).slice(-2), - YYYY: this.$y, - M: $M + 1, - MM: Utils$1.s($M + 1, 2, "0"), - MMM: getShort(locale2.monthsShort, $M, months, 3), - MMMM: getShort(months, $M), - D: this.$D, - DD: Utils$1.s(this.$D, 2, "0"), - d: String(this.$W), - dd: getShort(locale2.weekdaysMin, this.$W, weekdays, 2), - ddd: getShort(locale2.weekdaysShort, this.$W, weekdays, 3), - dddd: weekdays[this.$W], - H: String($H), - HH: Utils$1.s($H, 2, "0"), - h: get$H(1), - hh: get$H(2), - a: meridiemFunc($H, $m, true), - A: meridiemFunc($H, $m, false), - m: String($m), - mm: Utils$1.s($m, 2, "0"), - s: String(this.$s), - ss: Utils$1.s(this.$s, 2, "0"), - SSS: Utils$1.s(this.$ms, 3, "0"), - Z: zoneStr - // 'ZZ' logic below - }; - return str2.replace(REGEX_FORMAT, function(match, $1) { - return $1 || matches[match] || zoneStr.replace(":", ""); - }); - }; - _proto.utcOffset = function utcOffset() { - return -Math.round(this.$d.getTimezoneOffset() / 15) * 15; - }; - _proto.diff = function diff(input, units, _float) { - var _C$Y$C$M$C$Q$C$W$C$D$; - var unit2 = Utils$1.p(units); - var that = dayjs(input); - var zoneDelta = (that.utcOffset() - this.utcOffset()) * MILLISECONDS_A_MINUTE; - var diff2 = this - that; - var result = Utils$1.m(this, that); - result = (_C$Y$C$M$C$Q$C$W$C$D$ = {}, _C$Y$C$M$C$Q$C$W$C$D$[Y] = result / 12, _C$Y$C$M$C$Q$C$W$C$D$[M] = result, _C$Y$C$M$C$Q$C$W$C$D$[Q] = result / 3, _C$Y$C$M$C$Q$C$W$C$D$[W] = (diff2 - zoneDelta) / MILLISECONDS_A_WEEK, _C$Y$C$M$C$Q$C$W$C$D$[D] = (diff2 - zoneDelta) / MILLISECONDS_A_DAY, _C$Y$C$M$C$Q$C$W$C$D$[H] = diff2 / MILLISECONDS_A_HOUR, _C$Y$C$M$C$Q$C$W$C$D$[MIN] = diff2 / MILLISECONDS_A_MINUTE, _C$Y$C$M$C$Q$C$W$C$D$[S] = diff2 / MILLISECONDS_A_SECOND, _C$Y$C$M$C$Q$C$W$C$D$)[unit2] || diff2; - return _float ? result : Utils$1.a(result); - }; - _proto.daysInMonth = function daysInMonth() { - return this.endOf(M).$D; - }; - _proto.$locale = function $locale() { - return Ls[this.$L]; - }; - _proto.locale = function locale2(preset, object2) { - if (!preset) - return this.$L; - var that = this.clone(); - var nextLocaleName = parseLocale(preset, object2, true); - if (nextLocaleName) - that.$L = nextLocaleName; - return that; - }; - _proto.clone = function clone2() { - return Utils$1.w(this.$d, this); - }; - _proto.toDate = function toDate() { - return new Date(this.valueOf()); - }; - _proto.toJSON = function toJSON() { - return this.isValid() ? this.toISOString() : null; - }; - _proto.toISOString = function toISOString() { - return this.$d.toISOString(); - }; - _proto.toString = function toString2() { - return this.$d.toUTCString(); - }; - return Dayjs2; - }(); - var proto = Dayjs.prototype; - dayjs.prototype = proto; - [["$ms", MS], ["$s", S], ["$m", MIN], ["$H", H], ["$W", D], ["$M", M], ["$y", Y], ["$D", DATE]].forEach(function(g) { - proto[g[1]] = function(input) { - return this.$g(input, g[0], g[1]); - }; }); - dayjs.extend = function(plugin2, option) { - if (!plugin2.$i) { - plugin2(option, Dayjs, dayjs); - plugin2.$i = true; - } - return dayjs; - }; - dayjs.locale = parseLocale; - dayjs.isDayjs = isDayjs; - dayjs.unix = function(timestamp2) { - return dayjs(timestamp2 * 1e3); - }; - dayjs.en = Ls[L]; - dayjs.Ls = Ls; - dayjs.p = {}; - 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) => { - } - }; - 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; - } - 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")); - } - 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")); - } - 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")); - } - 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")); + + // 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"); } - 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/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/defaults.mjs + var defaultIconDimensions, defaultIconTransformations, defaultIconProps, defaultExtendedIconProps; + var init_defaults = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/defaults.mjs"() { + "use strict"; + defaultIconDimensions = Object.freeze( + { + left: 0, + top: 0, + width: 16, + height: 16 + } + ); + defaultIconTransformations = Object.freeze({ + rotate: 0, + vFlip: false, + hFlip: false + }); + defaultIconProps = Object.freeze({ + ...defaultIconDimensions, + ...defaultIconTransformations + }); + defaultExtendedIconProps = Object.freeze({ + ...defaultIconProps, + body: "", + hidden: false + }); } - 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/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/customisations/defaults.mjs + var defaultIconSizeCustomisations, defaultIconCustomisations; + var init_defaults2 = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/customisations/defaults.mjs"() { + "use strict"; + init_defaults(); + defaultIconSizeCustomisations = Object.freeze({ + width: null, + height: null + }); + defaultIconCustomisations = Object.freeze({ + // Dimensions + ...defaultIconSizeCustomisations, + // Transformations + ...defaultIconTransformations + }); } - }; - const format$1 = (level) => { - const time2 = dayjs().format("ss.SSS"); - return `%c${time2} : ${level} : `; - }; - 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 dist = {}; - Object.defineProperty(dist, "__esModule", { value: true }); - var sanitizeUrl_1 = dist.sanitizeUrl = 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 = [".", "/"]; - function isRelativeUrlWithoutProtocol(url) { - return relativeFirstCharacters.indexOf(url[0]) > -1; - } - function decodeHtmlCharacters(str2) { - return str2.replace(htmlEntitiesRegex, function(match, dec) { - return String.fromCharCode(dec); - }); - } - function sanitizeUrl$1(url) { - var sanitizedUrl = decodeHtmlCharacters(url || "").replace(htmlCtrlEntityRegex, "").replace(ctrlCharactersRegex, "").trim(); - if (!sanitizedUrl) { - return "about:blank"; + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/name.mjs + var matchIconName, stringToIcon, validateIconName; + var init_name = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/name.mjs"() { + "use strict"; + matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/; + stringToIcon = /* @__PURE__ */ __name((value2, validate2, allowSimpleName, provider = "") => { + const colonSeparated = value2.split(":"); + if (value2.slice(0, 1) === "@") { + if (colonSeparated.length < 2 || colonSeparated.length > 3) { + return null; + } + provider = colonSeparated.shift().slice(1); + } + if (colonSeparated.length > 3 || !colonSeparated.length) { + return null; + } + if (colonSeparated.length > 1) { + const name2 = colonSeparated.pop(); + const prefix = colonSeparated.pop(); + const result = { + // Allow provider without '@': "provider:prefix:name" + provider: colonSeparated.length > 0 ? colonSeparated[0] : provider, + prefix, + name: name2 + }; + return validate2 && !validateIconName(result) ? null : result; + } + const name = colonSeparated[0]; + const dashSeparated = name.split("-"); + if (dashSeparated.length > 1) { + const result = { + provider, + prefix: dashSeparated.shift(), + name: dashSeparated.join("-") + }; + return validate2 && !validateIconName(result) ? null : result; + } + if (allowSimpleName && provider === "") { + const result = { + provider, + prefix: "", + name + }; + return validate2 && !validateIconName(result, allowSimpleName) ? null : result; + } + return null; + }, "stringToIcon"); + validateIconName = /* @__PURE__ */ __name((icon, allowSimpleName) => { + if (!icon) { + return false; + } + return !!((icon.provider === "" || icon.provider.match(matchIconName)) && (allowSimpleName && icon.prefix === "" || icon.prefix.match(matchIconName)) && icon.name.match(matchIconName)); + }, "validateIconName"); } - if (isRelativeUrlWithoutProtocol(sanitizedUrl)) { - return sanitizedUrl; + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/transformations.mjs + function mergeIconTransformations(obj1, obj2) { + const result = {}; + if (!obj1.hFlip !== !obj2.hFlip) { + result.hFlip = true; } - var urlSchemeParseResults = sanitizedUrl.match(urlSchemeRegex); - if (!urlSchemeParseResults) { - return sanitizedUrl; + if (!obj1.vFlip !== !obj2.vFlip) { + result.vFlip = true; } - var urlScheme = urlSchemeParseResults[0]; - if (invalidProtocolRegex.test(urlScheme)) { - return "about:blank"; + const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4; + if (rotate) { + result.rotate = rotate; } - return sanitizedUrl; - } - sanitizeUrl_1 = dist.sanitizeUrl = sanitizeUrl$1; - 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; + return result; } - 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; - } - 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; + var init_transformations = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/transformations.mjs"() { + "use strict"; + __name(mergeIconTransformations, "mergeIconTransformations"); } - 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); + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/merge.mjs + function mergeIconData(parent4, child) { + const result = mergeIconTransformations(parent4, child); + for (const key in defaultExtendedIconProps) { + if (key in defaultIconTransformations) { + if (key in parent4 && !(key in result)) { + result[key] = defaultIconTransformations[key]; + } + } else if (key in child) { + result[key] = child[key]; + } else if (key in parent4) { + result[key] = parent4[key]; } - return lo; - } - 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; } - return { left: left2, center: center2, right: right2 }; - } - function zero$1() { - return 0; - } - function number$3(x2) { - return x2 === null ? NaN : +x2; + return result; } - 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, value] of entries2) - this.set(key2, value); - } - get(key) { - return super.get(intern_get(this, key)); - } - has(key) { - return super.has(intern_get(this, key)); + var init_merge = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/merge.mjs"() { + "use strict"; + init_defaults(); + init_transformations(); + __name(mergeIconData, "mergeIconData"); } - set(key, value) { - return super.set(intern_set(this, key), value); + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon-set/tree.mjs + function getIconsTree(data5, names) { + const icons = data5.icons; + const aliases = data5.aliases || /* @__PURE__ */ Object.create(null); + const resolved = /* @__PURE__ */ Object.create(null); + function resolve3(name) { + if (icons[name]) { + return resolved[name] = []; + } + if (!(name in resolved)) { + resolved[name] = null; + const parent4 = aliases[name] && aliases[name].parent; + const value2 = parent4 && resolve3(parent4); + if (value2) { + resolved[name] = [parent4].concat(value2); + } + } + return resolved[name]; + } + __name(resolve3, "resolve"); + (names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve3); + return resolved; + } + var init_tree = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon-set/tree.mjs"() { + "use strict"; + __name(getIconsTree, "getIconsTree"); } - delete(key) { - return super.delete(intern_delete(this, key)); + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon-set/get-icon.mjs + function internalGetIconData(data5, name, tree) { + const icons = data5.icons; + const aliases = data5.aliases || /* @__PURE__ */ Object.create(null); + let currentProps = {}; + function parse8(name2) { + currentProps = mergeIconData( + icons[name2] || aliases[name2], + currentProps + ); } + __name(parse8, "parse"); + parse8(name); + tree.forEach(parse8); + return mergeIconData(data5, currentProps); } - function intern_get({ _intern, _key }, value) { - const key = _key(value); - return _intern.has(key) ? _intern.get(key) : value; - } - function intern_set({ _intern, _key }, value) { - const key = _key(value); - if (_intern.has(key)) - return _intern.get(key); - _intern.set(key, value); - return value; - } - function intern_delete({ _intern, _key }, value) { - const key = _key(value); - if (_intern.has(key)) { - value = _intern.get(key); - _intern.delete(key); + function getIconData(data5, name) { + if (data5.icons[name]) { + return internalGetIconData(data5, name, []); } - return value; - } - function keyof(value) { - return value !== null && typeof value === "object" ? value.valueOf() : value; - } - var e10 = Math.sqrt(50), e5 = Math.sqrt(10), e2 = Math.sqrt(2); - function ticks(start2, stop, count) { - var reverse, i2 = -1, n, ticks2, step; - stop = +stop, start2 = +start2, count = +count; - if (start2 === stop && count > 0) - return [start2]; - if (reverse = stop < start2) - n = start2, start2 = stop, stop = n; - if ((step = tickIncrement(start2, stop, count)) === 0 || !isFinite(step)) - return []; - if (step > 0) { - let r0 = Math.round(start2 / step), r1 = Math.round(stop / step); - if (r0 * step < start2) - ++r0; - if (r1 * step > stop) - --r1; - ticks2 = new Array(n = r1 - r0 + 1); - while (++i2 < n) - ticks2[i2] = (r0 + i2) * step; - } else { - step = -step; - let r0 = Math.round(start2 * step), r1 = Math.round(stop * step); - if (r0 / step < start2) - ++r0; - if (r1 / step > stop) - --r1; - ticks2 = new Array(n = r1 - r0 + 1); - while (++i2 < n) - ticks2[i2] = (r0 + i2) / step; - } - if (reverse) - ticks2.reverse(); - return ticks2; + const tree = getIconsTree(data5, [name])[name]; + return tree ? internalGetIconData(data5, name, tree) : null; } - function tickIncrement(start2, stop, count) { - var step = (stop - start2) / Math.max(0, count), power = Math.floor(Math.log(step) / Math.LN10), error = step / Math.pow(10, power); - return power >= 0 ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power) : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1); - } - function tickStep(start2, stop, count) { - var step0 = Math.abs(stop - start2) / Math.max(0, count), step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)), error = step0 / step1; - if (error >= e10) - step1 *= 10; - else if (error >= e5) - step1 *= 5; - else if (error >= e2) - step1 *= 2; - return stop < start2 ? -step1 : step1; - } - function max$2(values2, valueof) { - let max2; - if (valueof === void 0) { - for (const value of values2) { - if (value != null && (max2 < value || max2 === void 0 && value >= value)) { - max2 = value; - } - } - } else { - let index = -1; - for (let value of values2) { - if ((value = valueof(value, ++index, values2)) != null && (max2 < value || max2 === void 0 && value >= value)) { - max2 = value; - } - } + var init_get_icon = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon-set/get-icon.mjs"() { + "use strict"; + init_merge(); + init_tree(); + __name(internalGetIconData, "internalGetIconData"); + __name(getIconData, "getIconData"); } - return max2; - } - function min$2(values2, valueof) { - let min2; - if (valueof === void 0) { - for (const value of values2) { - if (value != null && (min2 > value || min2 === void 0 && value >= value)) { - min2 = value; - } - } - } else { - let index = -1; - for (let value of values2) { - if ((value = valueof(value, ++index, values2)) != null && (min2 > value || min2 === void 0 && value >= value)) { - min2 = value; + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/size.mjs + function calculateSize(size5, ratio, precision) { + if (ratio === 1) { + return size5; + } + precision = precision || 100; + if (typeof size5 === "number") { + return Math.ceil(size5 * ratio * precision) / precision; + } + if (typeof size5 !== "string") { + return size5; + } + const oldParts = size5.split(unitsSplit); + if (oldParts === null || !oldParts.length) { + return size5; + } + const newParts = []; + let code = oldParts.shift(); + let isNumber = unitsTest.test(code); + while (true) { + if (isNumber) { + const num = parseFloat(code); + if (isNaN(num)) { + newParts.push(code); + } else { + newParts.push(Math.ceil(num * ratio * precision) / precision); } + } else { + newParts.push(code); } - } - return min2; - } - function identity$5(x2) { - return x2; - } - var top = 1, right = 2, bottom = 3, left = 4, epsilon$2 = 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(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, x2 = orient === left || orient === right ? "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, spacing = Math.max(tickSizeInner, 0) + tickPadding, range2 = scale.range(), range0 = +range2[0] + offset, range1 = +range2[range2.length - 1] + offset, position2 = (scale.bandwidth ? center : 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 * spacing).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$2).attr("transform", function(d) { - return isFinite(d = position2(d)) ? transform(d + offset) : this.getAttribute("transform"); - }); - tickEnter.attr("opacity", epsilon$2).attr("transform", function(d) { - var p = this.parentNode.__axis; - return transform((p && isFinite(p = p(d)) ? p : position2(d)) + offset); - }); + code = oldParts.shift(); + if (code === void 0) { + return newParts.join(""); } - tickExit.remove(); - path2.attr("d", orient === left || orient === right ? 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 * spacing).text(format2); - 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 = position2; - }); - } - 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 = {}, t4; i2 < n; ++i2) { - if (!(t4 = arguments[i2] + "") || t4 in _2 || /[\s.]/.test(t4)) - throw new Error("illegal type: " + t4); - _2[t4] = []; + isNumber = !isNumber; } - return new Dispatch(_2); - } - function Dispatch(_2) { - this._ = _2; - } - function parseTypenames$1(typenames, types) { - return typenames.trim().split(/^|\s+/).map(function(t4) { - var name2 = "", i2 = t4.indexOf("."); - if (i2 >= 0) - name2 = t4.slice(i2 + 1), t4 = t4.slice(0, i2); - if (t4 && !types.hasOwnProperty(t4)) - throw new Error("unknown type: " + t4); - return { type: t4, name: name2 }; - }); } - Dispatch.prototype = dispatch.prototype = { - constructor: Dispatch, - on: function(typename, callback) { - var _2 = this._, T = parseTypenames$1(typename + "", _2), t4, i2 = -1, n = T.length; - if (arguments.length < 2) { - while (++i2 < n) - if ((t4 = (typename = T[i2]).type) && (t4 = get$3(_2[t4], typename.name))) - return t4; - return; - } - if (callback != null && typeof callback !== "function") - throw new Error("invalid callback: " + callback); - while (++i2 < n) { - if (t4 = (typename = T[i2]).type) - _2[t4] = set$3(_2[t4], typename.name, callback); - else if (callback == null) - for (t4 in _2) - _2[t4] = set$3(_2[t4], typename.name, null); - } - return this; - }, - copy: function() { - var copy2 = {}, _2 = this._; - for (var t4 in _2) - copy2[t4] = _2[t4].slice(); - return new Dispatch(copy2); - }, - call: function(type2, that) { - if ((n = arguments.length - 2) > 0) - for (var args = new Array(n), i2 = 0, n, t4; i2 < n; ++i2) - args[i2] = arguments[i2 + 2]; - if (!this._.hasOwnProperty(type2)) - throw new Error("unknown type: " + type2); - for (t4 = this._[type2], i2 = 0, n = t4.length; i2 < n; ++i2) - t4[i2].value.apply(that, args); - }, - apply: function(type2, that, args) { - if (!this._.hasOwnProperty(type2)) - throw new Error("unknown type: " + type2); - for (var t4 = this._[type2], i2 = 0, n = t4.length; i2 < n; ++i2) - t4[i2].value.apply(that, args); + var unitsSplit, unitsTest; + var init_size = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/size.mjs"() { + "use strict"; + unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g; + unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g; + __name(calculateSize, "calculateSize"); } - }; - function get$3(type2, name2) { - for (var i2 = 0, n = type2.length, c2; i2 < n; ++i2) { - if ((c2 = type2[i2]).name === name2) { - return c2.value; + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/defs.mjs + function splitSVGDefs(content, tag2 = "defs") { + let defs2 = ""; + const index = content.indexOf("<" + tag2); + while (index >= 0) { + const start3 = content.indexOf(">", index); + const end2 = content.indexOf("", end2); + if (endEnd === -1) { break; } + defs2 += content.slice(start3 + 1, end2).trim(); + content = content.slice(0, index).trim() + content.slice(endEnd + 1); } - if (callback != null) - type2.push({ name: name2, value: callback }); - return type2; - } - var xhtml = "http://www.w3.org/1999/xhtml"; - const namespaces = { - 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(name2) { - var prefix = name2 += "", i2 = prefix.indexOf(":"); - if (i2 >= 0 && (prefix = name2.slice(0, i2)) !== "xmlns") - name2 = name2.slice(i2 + 1); - return namespaces.hasOwnProperty(prefix) ? { space: namespaces[prefix], local: name2 } : name2; - } - function creatorInherit(name2) { - return function() { - var document2 = this.ownerDocument, uri = this.namespaceURI; - return uri === xhtml && document2.documentElement.namespaceURI === xhtml ? document2.createElement(name2) : document2.createElementNS(uri, name2); - }; - } - function creatorFixed(fullname) { - return function() { - return this.ownerDocument.createElementNS(fullname.space, fullname.local); - }; - } - function creator(name2) { - var fullname = namespace(name2); - return (fullname.local ? creatorFixed : creatorInherit)(fullname); - } - function none() { - } - function selector(selector2) { - return selector2 == null ? none : function() { - return this.querySelector(selector2); + return { + defs: defs2, + content }; } - function selection_select(select2) { - if (typeof select2 !== "function") - select2 = selector(select2); - 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 = select2.call(node2, node2.__data__, i2, group))) { - if ("__data__" in node2) - subnode.__data__ = node2.__data__; - subgroup[i2] = subnode; - } - } - } - 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 mergeDefsAndContent(defs2, content) { + return defs2 ? "" + defs2 + "" + content : content; } - function arrayAll(select2) { - return function() { - return array$1(select2.apply(this, arguments)); - }; + function wrapSVGContent(body, start3, end2) { + const split = splitSVGDefs(body); + return mergeDefsAndContent(split.defs, start3 + split.content + end2); } - function selection_selectAll(select2) { - if (typeof select2 === "function") - select2 = arrayAll(select2); - else - select2 = selectorAll(select2); - 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(select2.call(node2, node2.__data__, i2, group)); - parents2.push(node2); - } - } + var init_defs = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/defs.mjs"() { + "use strict"; + __name(splitSVGDefs, "splitSVGDefs"); + __name(mergeDefsAndContent, "mergeDefsAndContent"); + __name(wrapSVGContent, "wrapSVGContent"); } - 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); + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/build.mjs + function iconToSVG(icon, customisations) { + const fullIcon = { + ...defaultIconProps, + ...icon }; - } - var find$2 = Array.prototype.find; - function childFind(match) { - return function() { - return find$2.call(this.children, match); + const fullCustomisations = { + ...defaultIconCustomisations, + ...customisations }; - } - 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); + const box = { + left: fullIcon.left, + top: fullIcon.top, + width: fullIcon.width, + height: fullIcon.height }; - } - 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); + let body = fullIcon.body; + [fullIcon, fullCustomisations].forEach((props) => { + const transformations = []; + const hFlip = props.hFlip; + const vFlip = props.vFlip; + let rotation = props.rotate; + if (hFlip) { + if (vFlip) { + rotation += 2; + } else { + transformations.push( + "translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")" + ); + transformations.push("scale(-1 1)"); + box.top = box.left = 0; } + } else if (vFlip) { + transformations.push( + "translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")" + ); + transformations.push("scale(1 -1)"); + box.top = box.left = 0; } - } - 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$3(x2) { - return function() { - return x2; - }; - } - function bindIndex(parent, group, enter2, update2, exit2, data) { - var i2 = 0, node2, groupLength = 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]); + let tempValue; + if (rotation < 0) { + rotation -= Math.floor(rotation / 4) * 4; } - } - for (; i2 < groupLength; ++i2) { - if (node2 = group[i2]) { - exit2[i2] = node2; + rotation = rotation % 4; + switch (rotation) { + case 1: + tempValue = box.height / 2 + box.top; + transformations.unshift( + "rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")" + ); + break; + case 2: + transformations.unshift( + "rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")" + ); + break; + case 3: + tempValue = box.width / 2 + box.left; + transformations.unshift( + "rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")" + ); + break; } - } - } - function bindKey(parent, group, enter2, update2, exit2, data, key) { - var i2, node2, nodeByKeyValue = /* @__PURE__ */ new Map(), groupLength = group.length, dataLength = data.length, keyValues = new Array(groupLength), keyValue; - for (i2 = 0; i2 < groupLength; ++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); + if (rotation % 2 === 1) { + if (box.left !== box.top) { + tempValue = box.left; + box.left = box.top; + box.top = tempValue; + } + if (box.width !== box.height) { + tempValue = box.width; + box.width = box.height; + box.height = tempValue; } } - } - 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 < groupLength; ++i2) { - if ((node2 = group[i2]) && nodeByKeyValue.get(keyValues[i2]) === node2) { - exit2[i2] = node2; + if (transformations.length) { + body = wrapSVGContent( + body, + '', + "" + ); } - } - } - function datum(node2) { - return node2.__data__; + }); + const customisationsWidth = fullCustomisations.width; + const customisationsHeight = fullCustomisations.height; + const boxWidth = box.width; + const boxHeight = box.height; + let width3; + let height2; + if (customisationsWidth === null) { + height2 = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight; + width3 = calculateSize(height2, boxWidth / boxHeight); + } else { + width3 = customisationsWidth === "auto" ? boxWidth : customisationsWidth; + height2 = customisationsHeight === null ? calculateSize(width3, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight; + } + const attributes = {}; + const setAttr = /* @__PURE__ */ __name((prop, value2) => { + if (!isUnsetKeyword(value2)) { + attributes[prop] = value2.toString(); + } + }, "setAttr"); + setAttr("width", width3); + setAttr("height", height2); + const viewBox = [box.left, box.top, boxWidth, boxHeight]; + attributes.viewBox = viewBox.join(" "); + return { + attributes, + viewBox, + body + }; } - function selection_data(value, key) { - if (!arguments.length) - return Array.from(this, datum); - var bind = key ? bindKey : bindIndex, parents2 = this._parents, groups = this._groups; - if (typeof value !== "function") - value = constant$3(value); - 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], groupLength = group.length, data = arraylike(value.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(groupLength); - bind(parent, group, enterGroup, updateGroup, exitGroup, data, key); - for (var i0 = 0, i1 = 0, previous, next2; i0 < dataLength; ++i0) { - if (previous = enterGroup[i0]) { - if (i0 >= i1) - i1 = i0 + 1; - while (!(next2 = updateGroup[i1]) && ++i1 < dataLength) - ; - previous._next = next2 || null; - } - } + var isUnsetKeyword; + var init_build = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/build.mjs"() { + "use strict"; + init_defaults(); + init_defaults2(); + init_size(); + init_defs(); + isUnsetKeyword = /* @__PURE__ */ __name((value2) => value2 === "unset" || value2 === "undefined" || value2 === "none", "isUnsetKeyword"); + __name(iconToSVG, "iconToSVG"); } - 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); + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/id.mjs + function replaceIDs(body, prefix = randomPrefix) { + const ids = []; + let match2; + while (match2 = regex.exec(body)) { + ids.push(match2[1]); + } + if (!ids.length) { + return body; + } + const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16); + ids.forEach((id27) => { + const newID = typeof prefix === "function" ? prefix(id27) : prefix + (counter++).toString(); + const escapedID = id27.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + body = body.replace( + // Allowed characters before id: [#;"] + // Allowed characters after id: [)"], .[a-z] + new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"), + "$1" + newID + suffix + "$3" + ); + }); + body = body.replace(new RegExp(suffix, "g"), ""); + return body; } - 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 + ""); + var regex, randomPrefix, counter; + var init_id = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/id.mjs"() { + "use strict"; + regex = /\sid="(\S+)"/g; + randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16); + counter = 0; + __name(replaceIDs, "replaceIDs"); } - if (onupdate != null) { - update2 = onupdate(update2); - if (update2) - update2 = update2.selection(); + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/html.mjs + function iconToHTML(body, attributes) { + let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"'; + for (const attr in attributes) { + renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"'; } - if (onexit == null) - exit2.remove(); - else - onexit(exit2); - return enter2 && update2 ? enter2.merge(update2).order() : update2; + return '" + body + ""; } - 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; + var init_html = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/html.mjs"() { + "use strict"; + __name(iconToHTML, "iconToHTML"); + } + }); + + // ../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js + var require_ms = __commonJS({ + "../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js"(exports2, module2) { + "use strict"; + var s2 = 1e3; + var m2 = s2 * 60; + var h2 = m2 * 60; + var d2 = h2 * 24; + var w3 = d2 * 7; + var y5 = d2 * 365.25; + module2.exports = function(val, options3) { + options3 = options3 || {}; + var type3 = typeof val; + if (type3 === "string" && val.length > 0) { + return parse8(val); + } else if (type3 === "number" && isFinite(val)) { + return options3.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) + ); + }; + function parse8(str2) { + str2 = String(str2); + if (str2.length > 100) { + return; + } + var match2 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str2 + ); + if (!match2) { + return; + } + var n2 = parseFloat(match2[1]); + var type3 = (match2[2] || "ms").toLowerCase(); + switch (type3) { + case "years": + case "year": + case "yrs": + case "yr": + case "y": + return n2 * y5; + case "weeks": + case "week": + case "w": + return n2 * w3; + case "days": + case "day": + case "d": + return n2 * d2; + case "hours": + case "hour": + case "hrs": + case "hr": + case "h": + return n2 * h2; + case "minutes": + case "minute": + case "mins": + case "min": + case "m": + return n2 * m2; + case "seconds": + case "second": + case "secs": + case "sec": + case "s": + return n2 * s2; + case "milliseconds": + case "millisecond": + case "msecs": + case "msec": + case "ms": + return n2; + default: + return void 0; } } - } - for (; j < m0; ++j) { - merges[j] = groups0[j]; - } - 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; + __name(parse8, "parse"); + function fmtShort(ms3) { + var msAbs = Math.abs(ms3); + if (msAbs >= d2) { + return Math.round(ms3 / d2) + "d"; + } + if (msAbs >= h2) { + return Math.round(ms3 / h2) + "h"; } + if (msAbs >= m2) { + return Math.round(ms3 / m2) + "m"; + } + if (msAbs >= s2) { + return Math.round(ms3 / s2) + "s"; + } + return ms3 + "ms"; } - } - return this; - } - function selection_sort(compare) { - if (!compare) - compare = ascending; - function compareNode(a, b) { - return a && b ? compare(a.__data__, b.__data__) : !a - !b; - } - 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; + __name(fmtShort, "fmtShort"); + function fmtLong(ms3) { + var msAbs = Math.abs(ms3); + if (msAbs >= d2) { + return plural(ms3, msAbs, d2, "day"); + } + if (msAbs >= h2) { + return plural(ms3, msAbs, h2, "hour"); } + if (msAbs >= m2) { + return plural(ms3, msAbs, m2, "minute"); + } + if (msAbs >= s2) { + return plural(ms3, msAbs, s2, "second"); + } + return ms3 + " ms"; } - sortgroup.sort(compareNode); + __name(fmtLong, "fmtLong"); + function plural(ms3, msAbs, n2, name) { + var isPlural = msAbs >= n2 * 1.5; + return Math.round(ms3 / n2) + " " + name + (isPlural ? "s" : ""); + } + __name(plural, "plural"); } - 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; + }); + + // ../../node_modules/.pnpm/debug@4.3.6_supports-color@8.1.1/node_modules/debug/src/common.js + var require_common = __commonJS({ + "../../node_modules/.pnpm/debug@4.3.6_supports-color@8.1.1/node_modules/debug/src/common.js"(exports2, module2) { + "use strict"; + function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = require_ms(); + createDebug.destroy = destroy2; + Object.keys(env).forEach((key) => { + createDebug[key] = env[key]; + }); + createDebug.names = []; + createDebug.skips = []; + createDebug.formatters = {}; + function selectColor(namespace) { + let hash = 0; + for (let i2 = 0; i2 < namespace.length; i2++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i2); + hash |= 0; + } + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + __name(selectColor, "selectColor"); + createDebug.selectColor = selectColor; + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + function debug(...args) { + if (!debug.enabled) { + return; + } + const self2 = debug; + const curr = Number(/* @__PURE__ */ new Date()); + const ms3 = curr - (prevTime || curr); + self2.diff = ms3; + self2.prev = prevTime; + self2.curr = curr; + prevTime = curr; + args[0] = createDebug.coerce(args[0]); + if (typeof args[0] !== "string") { + args.unshift("%O"); + } + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match2, format3) => { + if (match2 === "%%") { + return "%"; + } + index++; + const formatter = createDebug.formatters[format3]; + if (typeof formatter === "function") { + const val = args[index]; + match2 = formatter.call(self2, val); + args.splice(index, 1); + index--; + } + return match2; + }); + createDebug.formatArgs.call(self2, args); + const logFn = self2.log || createDebug.log; + logFn.apply(self2, args); + } + __name(debug, "debug"); + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend5; + debug.destroy = createDebug.destroy; + Object.defineProperty(debug, "enabled", { + enumerable: true, + configurable: false, + get: /* @__PURE__ */ __name(() => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + return enabledCache; + }, "get"), + set: /* @__PURE__ */ __name((v3) => { + enableOverride = v3; + }, "set") + }); + if (typeof createDebug.init === "function") { + createDebug.init(debug); + } + return debug; + } + __name(createDebug, "createDebug"); + function extend5(namespace, delimiter3) { + const newDebug = createDebug(this.namespace + (typeof delimiter3 === "undefined" ? ":" : delimiter3) + namespace); + newDebug.log = this.log; + return newDebug; + } + __name(extend5, "extend"); + function enable(namespaces2) { + createDebug.save(namespaces2); + createDebug.namespaces = namespaces2; + createDebug.names = []; + createDebug.skips = []; + let i2; + const split = (typeof namespaces2 === "string" ? namespaces2 : "").split(/[\s,]+/); + const len = split.length; + for (i2 = 0; i2 < len; i2++) { + if (!split[i2]) { + continue; + } + namespaces2 = split[i2].replace(/\*/g, ".*?"); + if (namespaces2[0] === "-") { + createDebug.skips.push(new RegExp("^" + namespaces2.slice(1) + "$")); + } else { + createDebug.names.push(new RegExp("^" + namespaces2 + "$")); + } + } + } + __name(enable, "enable"); + function disable() { + const namespaces2 = [ + ...createDebug.names.map(toNamespace), + ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace) + ].join(","); + createDebug.enable(""); + return namespaces2; + } + __name(disable, "disable"); + function enabled(name) { + if (name[name.length - 1] === "*") { + return true; + } + let i2; + let len; + for (i2 = 0, len = createDebug.skips.length; i2 < len; i2++) { + if (createDebug.skips[i2].test(name)) { + return false; + } + } + for (i2 = 0, len = createDebug.names.length; i2 < len; i2++) { + if (createDebug.names[i2].test(name)) { + return true; + } + } + return false; + } + __name(enabled, "enabled"); + function toNamespace(regexp) { + return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*"); + } + __name(toNamespace, "toNamespace"); + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + __name(coerce, "coerce"); + function destroy2() { + console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); + } + __name(destroy2, "destroy"); + createDebug.enable(createDebug.load()); + return createDebug; } + __name(setup, "setup"); + module2.exports = setup; } - 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); - } - } - return this; - } - function attrRemove$1(name2) { - return function() { - this.removeAttribute(name2); - }; - } - function attrRemoveNS$1(fullname) { - return function() { - this.removeAttributeNS(fullname.space, fullname.local); - }; - } - function attrConstant$1(name2, value) { - return function() { - this.setAttribute(name2, value); - }; - } - function attrConstantNS$1(fullname, value) { - return function() { - this.setAttributeNS(fullname.space, fullname.local, value); - }; - } - function attrFunction$1(name2, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) - this.removeAttribute(name2); - else - this.setAttribute(name2, v); - }; - } - function attrFunctionNS$1(fullname, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) - this.removeAttributeNS(fullname.space, fullname.local); - else - this.setAttributeNS(fullname.space, fullname.local, v); - }; - } - function selection_attr(name2, value) { - var fullname = namespace(name2); - if (arguments.length < 2) { - var node2 = this.node(); - return fullname.local ? node2.getAttributeNS(fullname.space, fullname.local) : node2.getAttribute(fullname); - } - return this.each((value == null ? fullname.local ? attrRemoveNS$1 : attrRemove$1 : typeof value === "function" ? fullname.local ? attrFunctionNS$1 : attrFunction$1 : fullname.local ? attrConstantNS$1 : attrConstant$1)(fullname, value)); - } - function defaultView(node2) { - return node2.ownerDocument && node2.ownerDocument.defaultView || node2.document && node2 || node2.defaultView; - } - function styleRemove$1(name2) { - return function() { - this.style.removeProperty(name2); - }; - } - function styleConstant$1(name2, value, priority) { - return function() { - this.style.setProperty(name2, value, priority); - }; - } - function styleFunction$1(name2, value, priority) { - return function() { - var v = value.apply(this, arguments); - if (v == null) - this.style.removeProperty(name2); - else - this.style.setProperty(name2, v, priority); - }; - } - function selection_style(name2, value, priority) { - return arguments.length > 1 ? this.each((value == null ? styleRemove$1 : typeof value === "function" ? styleFunction$1 : styleConstant$1)(name2, value, priority == null ? "" : priority)) : styleValue(this.node(), name2); - } - function styleValue(node2, name2) { - return node2.style.getPropertyValue(name2) || defaultView(node2).getComputedStyle(node2, null).getPropertyValue(name2); - } - function propertyRemove(name2) { - return function() { - delete this[name2]; - }; - } - function propertyConstant(name2, value) { - return function() { - this[name2] = value; - }; - } - function propertyFunction(name2, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) - delete this[name2]; - else - this[name2] = v; - }; - } - function selection_property(name2, value) { - return arguments.length > 1 ? this.each((value == null ? propertyRemove : typeof value === "function" ? propertyFunction : propertyConstant)(name2, value)) : this.node()[name2]; - } - function classArray(string) { - return string.trim().split(/^|\s+/); - } - function classList(node2) { - return node2.classList || new ClassList(node2); - } - function ClassList(node2) { - this._node = node2; - this._names = classArray(node2.getAttribute("class") || ""); - } - ClassList.prototype = { - add: function(name2) { - var i2 = this._names.indexOf(name2); - if (i2 < 0) { - this._names.push(name2); - this._node.setAttribute("class", this._names.join(" ")); - } - }, - remove: function(name2) { - var i2 = this._names.indexOf(name2); - if (i2 >= 0) { - this._names.splice(i2, 1); - this._node.setAttribute("class", this._names.join(" ")); - } - }, - contains: function(name2) { - return this._names.indexOf(name2) >= 0; - } - }; - function classedAdd(node2, names) { - var list = classList(node2), i2 = -1, n = names.length; - while (++i2 < n) - list.add(names[i2]); - } - function classedRemove(node2, names) { - var list = classList(node2), i2 = -1, n = names.length; - while (++i2 < n) - list.remove(names[i2]); - } - function classedTrue(names) { - return function() { - classedAdd(this, names); - }; - } - function classedFalse(names) { - return function() { - classedRemove(this, names); - }; - } - function classedFunction(names, value) { - return function() { - (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names); - }; - } - function selection_classed(name2, value) { - var names = classArray(name2 + ""); - if (arguments.length < 2) { - var list = classList(this.node()), i2 = -1, n = names.length; - while (++i2 < n) - if (!list.contains(names[i2])) + }); + + // ../../node_modules/.pnpm/debug@4.3.6_supports-color@8.1.1/node_modules/debug/src/browser.js + var require_browser = __commonJS({ + "../../node_modules/.pnpm/debug@4.3.6_supports-color@8.1.1/node_modules/debug/src/browser.js"(exports2, module2) { + "use strict"; + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load2; + exports2.useColors = useColors; + exports2.storage = localstorage(); + exports2.destroy = /* @__PURE__ */ (() => { + let warned = false; + return () => { + if (!warned) { + warned = true; + console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); + } + }; + })(); + exports2.colors = [ + "#0000CC", + "#0000FF", + "#0033CC", + "#0033FF", + "#0066CC", + "#0066FF", + "#0099CC", + "#0099FF", + "#00CC00", + "#00CC33", + "#00CC66", + "#00CC99", + "#00CCCC", + "#00CCFF", + "#3300CC", + "#3300FF", + "#3333CC", + "#3333FF", + "#3366CC", + "#3366FF", + "#3399CC", + "#3399FF", + "#33CC00", + "#33CC33", + "#33CC66", + "#33CC99", + "#33CCCC", + "#33CCFF", + "#6600CC", + "#6600FF", + "#6633CC", + "#6633FF", + "#66CC00", + "#66CC33", + "#9900CC", + "#9900FF", + "#9933CC", + "#9933FF", + "#99CC00", + "#99CC33", + "#CC0000", + "#CC0033", + "#CC0066", + "#CC0099", + "#CC00CC", + "#CC00FF", + "#CC3300", + "#CC3333", + "#CC3366", + "#CC3399", + "#CC33CC", + "#CC33FF", + "#CC6600", + "#CC6633", + "#CC9900", + "#CC9933", + "#CCCC00", + "#CCCC33", + "#FF0000", + "#FF0033", + "#FF0066", + "#FF0099", + "#FF00CC", + "#FF00FF", + "#FF3300", + "#FF3333", + "#FF3366", + "#FF3399", + "#FF33CC", + "#FF33FF", + "#FF6600", + "#FF6633", + "#FF9900", + "#FF9933", + "#FFCC00", + "#FFCC33" + ]; + function useColors() { + if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { + return true; + } + if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; - return true; - } - return this.each((typeof value === "function" ? classedFunction : value ? classedTrue : classedFalse)(names, value)); - } - function textRemove() { - this.textContent = ""; - } - function textConstant$1(value) { - return function() { - this.textContent = value; - }; - } - function textFunction$1(value) { - return function() { - var v = value.apply(this, arguments); - this.textContent = v == null ? "" : v; - }; - } - function selection_text(value) { - return arguments.length ? this.each(value == null ? textRemove : (typeof value === "function" ? textFunction$1 : textConstant$1)(value)) : this.node().textContent; - } - function htmlRemove() { - this.innerHTML = ""; - } - function htmlConstant(value) { - return function() { - this.innerHTML = value; - }; - } - function htmlFunction(value) { - return function() { - var v = value.apply(this, arguments); - this.innerHTML = v == null ? "" : v; - }; - } - function selection_html(value) { - return arguments.length ? this.each(value == null ? htmlRemove : (typeof value === "function" ? htmlFunction : htmlConstant)(value)) : 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(name2) { - var create2 = typeof name2 === "function" ? name2 : creator(name2); - return this.select(function() { - return this.appendChild(create2.apply(this, arguments)); - }); - } - function constantNull() { - return null; - } - function selection_insert(name2, before) { - var create2 = typeof name2 === "function" ? name2 : creator(name2), select2 = before == null ? constantNull : typeof before === "function" ? before : selector(before); - return this.select(function() { - return this.insertBefore(create2.apply(this, arguments), select2.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(value) { - return arguments.length ? this.property("__data__", value) : this.node().__data__; - } - function contextListener(listener) { - return function(event) { - listener.call(this, event, this.__data__); - }; - } - function parseTypenames(typenames) { - return typenames.trim().split(/^|\s+/).map(function(t4) { - var name2 = "", i2 = t4.indexOf("."); - if (i2 >= 0) - name2 = t4.slice(i2 + 1), t4 = t4.slice(0, i2); - return { type: t4, name: name2 }; - }); - } - 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 onAdd(typename, value, options2) { - return function() { - var on = this.__on, o, listener = contextListener(value); - 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 = value; + let m2; + return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 + typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + typeof navigator !== "undefined" && navigator.userAgent && (m2 = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m2[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker + typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); + } + __name(useColors, "useColors"); + function formatArgs(args) { + args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); + if (!this.useColors) { + return; + } + const c3 = "color: " + this.color; + args.splice(1, 0, c3, "color: inherit"); + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, (match2) => { + if (match2 === "%%") { return; } - } - this.addEventListener(typename.type, listener, options2); - o = { type: typename.type, name: typename.name, value, listener, options: options2 }; - if (!on) - this.__on = [o]; - else - on.push(o); - }; - } - function selection_on(typename, value, options2) { - var typenames = parseTypenames(typename + ""), i2, n = typenames.length, t4; - 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 ((t4 = typenames[i2]).type === o.type && t4.name === o.name) { - return o.value; - } + index++; + if (match2 === "%c") { + lastC = index; } - } - return; - } - on = value ? onAdd : onRemove; - for (i2 = 0; i2 < n; ++i2) - this.each(on(typenames[i2], value, options2)); - return this; - } - function dispatchEvent(node2, type2, params) { - var window2 = defaultView(node2), event = window2.CustomEvent; - if (typeof event === "function") { - event = new event(type2, params); - } 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); - } - node2.dispatchEvent(event); - } - function dispatchConstant(type2, params) { - return function() { - return dispatchEvent(this, type2, params); - }; - } - function dispatchFunction(type2, params) { - return function() { - return dispatchEvent(this, type2, params.apply(this, arguments)); - }; - } - function selection_dispatch(type2, params) { - return this.each((typeof params === "function" ? dispatchFunction : dispatchConstant)(type2, params)); - } - 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; + }); + args.splice(lastC, 0, c3); } - } - } - 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 select(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, definition) { - var prototype = Object.create(parent.prototype); - for (var key in definition) - prototype[key] = definition[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; - } - 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(value) { - return Math.max(0, Math.min(255, Math.round(value) || 0)); - } - function hex(value) { - value = clampi(value); - return (value < 16 ? "0" : "") + value.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; - } 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(value) { - value = (value || 0) % 360; - return value < 0 ? value + 360 : value; - } - function clampt(value) { - return Math.max(0, Math.min(1, value || 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); - } - 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; - } - 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 xyz2lab(t4) { - return t4 > t3 ? Math.pow(t4, 1 / 3) : t4 / t2 + t0$1; - } - function lab2xyz(t4) { - return t4 > t1$1 ? t4 * t4 * t4 : t2 * (t4 - 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$2 = (x2) => () => x2; - function linear$1(a, d) { - return function(t4) { - return a + t4 * d; - }; - } - function exponential(a, b, y2) { - return a = Math.pow(a, y2), b = Math.pow(b, y2) - a, y2 = 1 / y2, function(t4) { - return Math.pow(a + t4 * 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$2(isNaN(a) ? b : a); - } - function gamma(y2) { - return (y2 = +y2) === 1 ? nogamma : function(a, b) { - return b - a ? exponential(a, b, y2) : constant$2(isNaN(a) ? b : a); - }; - } - function nogamma(a, b) { - var d = b - a; - return d ? linear$1(a, d) : constant$2(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(t4) { - start2.r = r(t4); - start2.g = g(t4); - start2.b = b(t4); - start2.opacity = opacity(t4); - 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(t4) { - for (i2 = 0; i2 < n; ++i2) - c2[i2] = a[i2] * (1 - t4) + b[i2] * t4; - 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(t4) { - for (i2 = 0; i2 < na; ++i2) - c2[i2] = x2[i2](t4); - return c2; - }; - } - function date$1(a, b) { - var d = /* @__PURE__ */ new Date(); - return a = +a, b = +b, function(t4) { - return d.setTime(a * (1 - t4) + b * t4), d; - }; - } - function interpolateNumber(a, b) { - return a = +a, b = +b, function(t4) { - return a * (1 - t4) + b * t4; - }; - } - 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]); - } else { - c2[k] = b[k]; + __name(formatArgs, "formatArgs"); + exports2.log = console.debug || console.log || (() => { + }); + function save(namespaces2) { + try { + if (namespaces2) { + exports2.storage.setItem("debug", namespaces2); + } else { + exports2.storage.removeItem("debug"); + } + } catch (error3) { + } } - } - return function(t4) { - for (k in i2) - c2[k] = i2[k](t4); - 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(b) { - return function(t4) { - return b(t4) + ""; - }; - } - 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; + __name(save, "save"); + function load2() { + let r2; + try { + r2 = exports2.storage.getItem("debug"); + } catch (error3) { + } + if (!r2 && typeof process !== "undefined" && "env" in process) { + r2 = process.env.DEBUG; + } + return r2; } - if ((am = am[0]) === (bm = bm[0])) { - if (s[i2]) - s[i2] += bm; - else - s[++i2] = bm; - } else { - s[++i2] = null; - q.push({ i: i2, x: interpolateNumber(am, bm) }); + __name(load2, "load"); + function localstorage() { + try { + return localStorage; + } catch (error3) { + } } - bi = reB.lastIndex; - } - if (bi < b.length) { - bs = b.slice(bi); - if (s[i2]) - s[i2] += bs; - else - s[++i2] = bs; + __name(localstorage, "localstorage"); + module2.exports = require_common()(exports2); + var { formatters } = module2.exports; + formatters.j = function(v3) { + try { + return JSON.stringify(v3); + } catch (error3) { + return "[UnexpectedJSONParseError]: " + error3.message; + } + }; } - return s.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function(t4) { - for (var i3 = 0, o; i3 < b; ++i3) - s[(o = q[i3]).i] = o.x(t4); - return s.join(""); - }); - } - function interpolate$1(a, b) { - var t4 = typeof b, c2; - return b == null || t4 === "boolean" ? constant$2(b) : (t4 === "number" ? interpolateNumber : t4 === "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(t4) { - return Math.round(a * (1 - t4) + b * t4); - }; - } - 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 - }; - } - var svgNode; - function parseCss(value) { - const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + ""); - return m.isIdentity ? identity$4 : decompose(m.a, m.b, m.c, m.d, m.e, m.f); - } - function parseSvg(value) { - if (value == null) - return identity$4; - if (!svgNode) - svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g"); - svgNode.setAttribute("transform", value); - if (!(value = svgNode.transform.baseVal.consolidate())) - return identity$4; - value = value.matrix; - return decompose(value.a, value.b, value.c, value.d, value.e, value.f); - } - function interpolateTransform(parse2, pxComma, pxParen, degParen) { - function pop(s) { - return s.length ? s.pop() + " " : ""; - } - 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); - } + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/index.mjs + var import_debug; + var init_lib = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/index.mjs"() { + "use strict"; + init_name(); + init_get_icon(); + init_build(); + init_id(); + init_html(); + import_debug = __toESM(require_browser(), 1); } - 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); - } + }); + + // src/rendering-util/icons.ts + var unknownIcon, iconsStore, loaderStore, registerIconPacks, getRegisteredIconData, getIconSVG; + var init_icons = __esm({ + "src/rendering-util/icons.ts"() { + "use strict"; + init_logger(); + init_lib(); + unknownIcon = { + body: '?', + height: 80, + width: 80 + }; + iconsStore = /* @__PURE__ */ new Map(); + loaderStore = /* @__PURE__ */ new Map(); + registerIconPacks = /* @__PURE__ */ __name((iconLoaders) => { + for (const iconLoader of iconLoaders) { + if (!iconLoader.name) { + throw new Error( + 'Invalid icon loader. Must have a "name" property with non-empty string value.' + ); + } + log.debug("Registering icon pack:", iconLoader.name); + if ("loader" in iconLoader) { + loaderStore.set(iconLoader.name, iconLoader.loader); + } else if ("icons" in iconLoader) { + iconsStore.set(iconLoader.name, iconLoader.icons); + } else { + log.error("Invalid icon loader:", iconLoader); + throw new Error('Invalid icon loader. Must have either "icons" or "loader" property.'); + } + } + }, "registerIconPacks"); + getRegisteredIconData = /* @__PURE__ */ __name(async (iconName, fallbackPrefix) => { + const data5 = stringToIcon(iconName, true, fallbackPrefix !== void 0); + if (!data5) { + throw new Error(`Invalid icon name: ${iconName}`); + } + const prefix = data5.prefix || fallbackPrefix; + if (!prefix) { + throw new Error(`Icon name must contain a prefix: ${iconName}`); + } + let icons = iconsStore.get(prefix); + if (!icons) { + const loader26 = loaderStore.get(prefix); + if (!loader26) { + throw new Error(`Icon set not found: ${data5.prefix}`); + } + try { + const loaded = await loader26(); + icons = { ...loaded, prefix }; + iconsStore.set(prefix, icons); + } catch (e3) { + log.error(e3); + throw new Error(`Failed to load icon set: ${data5.prefix}`); + } + } + const iconData = getIconData(icons, data5.name); + if (!iconData) { + throw new Error(`Icon not found: ${iconName}`); + } + return iconData; + }, "getRegisteredIconData"); + getIconSVG = /* @__PURE__ */ __name(async (iconName, customisations) => { + let iconData; + try { + iconData = await getRegisteredIconData(iconName, customisations?.fallbackPrefix); + } catch (e3) { + log.error(e3); + iconData = unknownIcon; + } + const renderData = iconToSVG(iconData, customisations); + const svg = iconToHTML(replaceIDs(renderData.body), renderData.attributes); + return svg; + }, "getIconSVG"); } - 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); - } + }); + + // ../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js + function dedent(templ) { + var values2 = []; + for (var _i = 1; _i < arguments.length; _i++) { + values2[_i - 1] = arguments[_i]; } - 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 + ")"); + 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 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; + }, []); + if (indentLengths.length) { + var pattern_1 = new RegExp("\n[ ]{" + Math.min.apply(Math, indentLengths) + "}", "g"); + strings = strings.map(function(str2) { + return str2.replace(pattern_1, "\n"); + }); } - 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(t4) { - var i2 = -1, n = q.length, o; - while (++i2 < n) - s[(o = q[i2]).i] = o.x(t4); - 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(t4) { - start2.h = h(t4); - start2.c = c2(t4); - start2.l = l(t4); - start2.opacity = opacity(t4); - 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; - } - 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(); + strings[0] = strings[0].replace(/^\r?\n/, ""); + var string3 = strings[0]; + values2.forEach(function(value2, i2) { + var endentations = string3.match(/(?:^|\n)( *)$/); + var endentation = endentations ? endentations[1] : ""; + var indentedValue = value2; + if (typeof value2 === "string" && value2.includes("\n")) { + indentedValue = String(value2).split("\n").map(function(str2, i3) { + return i3 === 0 ? str2 : "" + endentation + str2; + }).join("\n"); } - } - }; - function timer(callback, delay, time2) { - var t4 = new Timer(); - t4.restart(callback, delay, time2); - return t4; - } - function timerFlush() { - now$2(); - ++frame; - var t4 = taskHead, e; - while (t4) { - if ((e = clockNow - t4._time) >= 0) - t4._call.call(void 0, e); - t4 = t4._next; - } - --frame; - } - function wake() { - clockNow = (clockLast = clock.now()) + clockSkew; - frame = timeout$1 = 0; - try { - timerFlush(); - } finally { - frame = 0; - nap(); - clockNow = 0; - } - } - function poke() { - var now2 = clock.now(), delay = now2 - clockLast; - if (delay > pokeDelay) - clockSkew -= delay, clockLast = now2; + string3 += indentedValue + strings[i2 + 1]; + }); + return string3; } - 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; - } else { - t22 = t12._next, t12._next = null; - t12 = t02 ? t02._next = t22 : taskHead = t22; - } + var init_esm = __esm({ + "../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js"() { + "use strict"; + __name(dedent, "dedent"); } - 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); + }); + + // 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; } - } - function timeout(callback, delay, time2) { - var t4 = new Timer(); - delay = delay == null ? 0 : +delay; - t4.restart((elapsed) => { - t4.stop(); - callback(elapsed + delay); - }, delay, time2); - return t4; - } - 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, name2, id2, index, group, timing) { - var schedules = node2.__transition; - if (!schedules) - node2.__transition = {}; - else if (id2 in schedules) - return; - create$1(node2, id2, { - name: name2, - index, - // 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]; - } - } - timeout(function() { - if (self2.state === STARTED) { - self2.state = RUNNING; - self2.timer.restart(tick, self2.delay, self2.time); - tick(elapsed); + }); + + // src/errors.ts + var UnknownDiagramError; + var init_errors = __esm({ + "src/errors.ts"() { + "use strict"; + UnknownDiagramError = class extends Error { + static { + __name(this, "UnknownDiagramError"); } - }); - 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; + constructor(message) { + super(message); + this.name = "UnknownDiagramError"; } - } - tween.length = j + 1; - } - function tick(elapsed) { - var t4 = 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, t4); - } - if (self2.state === ENDING) { - self2.on.call("end", node2, node2.__data__, self2.index, self2.group); - stop(); - } - } - function stop() { - self2.state = ENDED; - self2.timer.stop(); - delete schedules[id2]; - for (var i2 in schedules) - return; - delete node2.__transition; + }; } - } - function interrupt(node2, name2) { - var schedules = node2.__transition, schedule2, active, empty2 = true, i2; - if (!schedules) - return; - name2 = name2 == null ? null : name2 + ""; - for (i2 in schedules) { - if ((schedule2 = schedules[i2]).name !== name2) { - empty2 = false; - continue; - } - 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]; + }); + + // 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: detector25 }] of Object.entries(detectors)) { + const diagram24 = detector25(text2, config6); + if (diagram24) { + return key; + } + } + throw new UnknownDiagramError( + `No diagram type detected matching given configuration for text: ${text2}` + ); + }, "detectType"); + registerLazyLoadedDiagrams = /* @__PURE__ */ __name((...diagrams2) => { + for (const { id: id27, detector: detector25, loader: loader26 } of diagrams2) { + addDetector(id27, detector25, loader26); + } + }, "registerLazyLoadedDiagrams"); + addDetector = /* @__PURE__ */ __name((key, detector25, loader26) => { + if (detectors[key]) { + log.warn(`Detector with key ${key} already exists. Overwriting.`); + } + detectors[key] = { detector: detector25, loader: loader26 }; + log.debug(`Detector with key ${key} added${loader26 ? " with loader" : ""}`); + }, "addDetector"); + getDiagramLoader = /* @__PURE__ */ __name((key) => { + return detectors[key].loader; + }, "getDiagramLoader"); } - if (empty2) - delete node2.__transition; - } - function selection_interrupt(name2) { - return this.each(function() { - interrupt(this, name2); - }); - } - function tweenRemove(id2, name2) { - 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 === name2) { - tween1 = tween1.slice(); - tween1.splice(i2, 1); - break; - } + }); + + // 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 parser22 = { + 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, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state5] && table[state5][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state5]) { + 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: " + state5 + ", 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 lexer3; + }(); + parser22.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser22; + parser22.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; } - } - schedule2.tween = tween1; - }; - } - function tweenFunction(id2, name2, value) { - var tween0, tween1; - if (typeof value !== "function") - throw new Error(); - return function() { - var schedule2 = set$2(this, id2), tween = schedule2.tween; - if (tween !== tween0) { - tween1 = (tween0 = tween).slice(); - for (var t4 = { name: name2, value }, i2 = 0, n = tween1.length; i2 < n; ++i2) { - if (tween1[i2].name === name2) { - tween1[i2] = t4; - break; + 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 (i2 === n) - tween1.push(t4); - } - schedule2.tween = tween1; - }; - } - function transition_tween(name2, value) { - var id2 = this._id; - name2 += ""; - if (arguments.length < 2) { - var tween = get$2(this.node(), id2).tween; - for (var i2 = 0, n = tween.length, t4; i2 < n; ++i2) { - if ((t4 = tween[i2]).name === name2) { - return t4.value; + 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]) ? [] : {}; + } + 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 null; + return dst; + }, "assignWithDepth"); + assignWithDepth_default = assignWithDepth; } - return this.each((value == null ? tweenRemove : tweenFunction)(id2, name2, value)); - } - function tweenValue(transition, name2, value) { - var id2 = transition._id; - transition.each(function() { - var schedule2 = set$2(this, id2); - (schedule2.value || (schedule2.value = {}))[name2] = value.apply(this, arguments); - }); - return function(node2) { - return get$2(node2, id2).value[name2]; - }; - } - 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(name2) { - return function() { - this.removeAttribute(name2); - }; - } - function attrRemoveNS(fullname) { - return function() { - this.removeAttributeNS(fullname.space, fullname.local); - }; - } - function attrConstant(name2, interpolate2, value1) { - var string00, string1 = value1 + "", interpolate0; - return function() { - var string0 = this.getAttribute(name2); - 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(name2, interpolate2, value) { - var string00, string10, interpolate0; - return function() { - var string0, value1 = value(this), string1; - if (value1 == null) - return void this.removeAttribute(name2); - string0 = this.getAttribute(name2); - string1 = value1 + ""; - return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate2(string00 = string0, value1)); - }; - } - function attrFunctionNS(fullname, interpolate2, value) { - var string00, string10, interpolate0; - return function() { - var string0, value1 = value(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(name2, value) { - var fullname = namespace(name2), i2 = fullname === "transform" ? interpolateTransformSvg : interpolate; - return this.attrTween(name2, typeof value === "function" ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i2, tweenValue(this, "attr." + name2, value)) : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname) : (fullname.local ? attrConstantNS : attrConstant)(fullname, i2, value)); - } - function attrInterpolate(name2, i2) { - return function(t4) { - this.setAttribute(name2, i2.call(this, t4)); - }; - } - function attrInterpolateNS(fullname, i2) { - return function(t4) { - this.setAttributeNS(fullname.space, fullname.local, i2.call(this, t4)); - }; - } - function attrTweenNS(fullname, value) { - var t02, i0; - function tween() { - var i2 = value.apply(this, arguments); - if (i2 !== i0) - t02 = (i0 = i2) && attrInterpolateNS(fullname, i2); - return t02; + }); + + // ../../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: + return -1; + } + }, "rgb2hsl") + }; + channel_default = Channel; } - tween._value = value; - return tween; - } - function attrTween(name2, value) { - var t02, i0; - function tween() { - var i2 = value.apply(this, arguments); - if (i2 !== i0) - t02 = (i0 = i2) && attrInterpolate(name2, i2); - return t02; + }); + + // ../../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; } - tween._value = value; - return tween; - } - function transition_attrTween(name2, value) { - var key = "attr." + name2; - if (arguments.length < 2) - return (key = this.tween(key)) && key._value; - if (value == null) - return this.tween(key, null); - if (typeof value !== "function") - throw new Error(); - var fullname = namespace(name2); - return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value)); - } - function delayFunction(id2, value) { - return function() { - init$1(this, id2).delay = +value.apply(this, arguments); - }; - } - function delayConstant(id2, value) { - return value = +value, function() { - init$1(this, id2).delay = value; - }; - } - function transition_delay(value) { - var id2 = this._id; - return arguments.length ? this.each((typeof value === "function" ? delayFunction : delayConstant)(id2, value)) : get$2(this.node(), id2).delay; - } - function durationFunction(id2, value) { - return function() { - set$2(this, id2).duration = +value.apply(this, arguments); - }; - } - function durationConstant(id2, value) { - return value = +value, function() { - set$2(this, id2).duration = value; - }; - } - function transition_duration(value) { - var id2 = this._id; - return arguments.length ? this.each((typeof value === "function" ? durationFunction : durationConstant)(id2, value)) : get$2(this.node(), id2).duration; - } - function easeConstant(id2, value) { - if (typeof value !== "function") - throw new Error(); - return function() { - set$2(this, id2).ease = value; - }; - } - function transition_ease(value) { - var id2 = this._id; - return arguments.length ? this.each(easeConstant(id2, value)) : get$2(this.node(), id2).ease; - } - function easeVarying(id2, value) { - return function() { - var v = value.apply(this, arguments); - if (typeof v !== "function") - throw new Error(); - set$2(this, id2).ease = v; - }; - } - function transition_easeVarying(value) { - if (typeof value !== "function") - throw new Error(); - return this.each(easeVarying(this._id, value)); - } - 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); + }); + + // ../../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; + } + }); + + // ../../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; + } + }); + + // ../../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 + }; + } + }); + + // ../../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; } - 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; + }); + + // ../../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; } - for (; j < m0; ++j) { - merges[j] = groups0[j]; + }); + + // ../../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; } - return new Transition(merges, this._parents, this._name, this._id); - } - function start$1(name2) { - return (name2 + "").trim().split(/^|\s+/).every(function(t4) { - var i2 = t4.indexOf("."); - if (i2 >= 0) - t4 = t4.slice(0, i2); - return !t4 || t4 === "start"; - }); - } - function onFunction(id2, name2, listener) { - var on0, on1, sit = start$1(name2) ? init$1 : set$2; - return function() { - var schedule2 = sit(this, id2), on = schedule2.on; - if (on !== on0) - (on1 = (on0 = on).copy()).on(name2, listener); - schedule2.on = on1; - }; - } - function transition_on(name2, listener) { - var id2 = this._id; - return arguments.length < 2 ? get$2(this.node(), id2).on.on(name2) : this.each(onFunction(id2, name2, listener)); - } - function removeFunction(id2) { - return function() { - var parent = this.parentNode; - for (var i2 in this.__transition) - if (+i2 !== id2) + }); + + // ../../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; + } + }); + + // ../../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; + } + }); + + // ../../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; - if (parent) - parent.removeChild(this); - }; - } - function transition_remove() { - return this.on("end.remove", removeFunction(this._id)); - } - function transition_select(select2) { - var name2 = this._name, id2 = this._id; - if (typeof select2 !== "function") - select2 = selector(select2); - 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 = select2.call(node2, node2.__data__, i2, group))) { - if ("__data__" in node2) - subnode.__data__ = node2.__data__; - subgroup[i2] = subnode; - schedule(subgroup[i2], name2, id2, i2, subgroup, get$2(node2, id2)); - } - } + }, "stringify") + }; + keyword_default = Keyword; } - return new Transition(subgroups, this._parents, name2, id2); - } - function transition_selectAll(select2) { - var name2 = this._name, id2 = this._id; - if (typeof select2 !== "function") - select2 = selectorAll(select2); - 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 = select2.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, name2, id2, k, children2, inherit2); - } + }); + + // ../../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)})`; } - subgroups.push(children2); - parents2.push(node2); - } - } + }, "stringify") + }; + rgb_default = RGB; } - return new Transition(subgroups, parents2, name2, id2); - } - var Selection = selection.prototype.constructor; - function transition_selection() { - return new Selection(this._groups, this._parents); - } - function styleNull(name2, interpolate2) { - var string00, string10, interpolate0; - return function() { - var string0 = styleValue(this, name2), string1 = (this.style.removeProperty(name2), styleValue(this, name2)); - return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, string10 = string1); - }; - } - function styleRemove(name2) { - return function() { - this.style.removeProperty(name2); - }; - } - function styleConstant(name2, interpolate2, value1) { - var string00, string1 = value1 + "", interpolate0; - return function() { - var string0 = styleValue(this, name2); - return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, value1); - }; - } - function styleFunction(name2, interpolate2, value) { - var string00, string10, interpolate0; - return function() { - var string0 = styleValue(this, name2), value1 = value(this), string1 = value1 + ""; - if (value1 == null) - string1 = value1 = (this.style.removeProperty(name2), styleValue(this, name2)); - return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate2(string00 = string0, value1)); - }; - } - function styleMaybeRemove(id2, name2) { - var on0, on1, listener0, key = "style." + name2, event = "end." + key, remove2; - return function() { - var schedule2 = set$2(this, id2), on = schedule2.on, listener = schedule2.value[key] == null ? remove2 || (remove2 = styleRemove(name2)) : void 0; - if (on !== on0 || listener0 !== listener) - (on1 = (on0 = on).copy()).on(event, listener0 = listener); - schedule2.on = on1; - }; - } - function transition_style(name2, value, priority) { - var i2 = (name2 += "") === "transform" ? interpolateTransformCss : interpolate; - return value == null ? this.styleTween(name2, styleNull(name2, i2)).on("end.style." + name2, styleRemove(name2)) : typeof value === "function" ? this.styleTween(name2, styleFunction(name2, i2, tweenValue(this, "style." + name2, value))).each(styleMaybeRemove(this._id, name2)) : this.styleTween(name2, styleConstant(name2, i2, value), priority).on("end.style." + name2, null); - } - function styleInterpolate(name2, i2, priority) { - return function(t4) { - this.style.setProperty(name2, i2.call(this, t4), priority); - }; - } - function styleTween(name2, value, priority) { - var t4, i0; - function tween() { - var i2 = value.apply(this, arguments); - if (i2 !== i0) - t4 = (i0 = i2) && styleInterpolate(name2, i2, priority); - return t4; - } - tween._value = value; - return tween; - } - function transition_styleTween(name2, value, priority) { - var key = "style." + (name2 += ""); - if (arguments.length < 2) - return (key = this.tween(key)) && key._value; - if (value == null) - return this.tween(key, null); - if (typeof value !== "function") - throw new Error(); - return this.tween(key, styleTween(name2, value, priority == null ? "" : priority)); - } - function textConstant(value) { - return function() { - this.textContent = value; - }; - } - function textFunction(value) { - return function() { - var value1 = value(this); - this.textContent = value1 == null ? "" : value1; - }; - } - function transition_text(value) { - return this.tween("text", typeof value === "function" ? textFunction(tweenValue(this, "text", value)) : textConstant(value == null ? "" : value + "")); - } - function textInterpolate(i2) { - return function(t4) { - this.textContent = i2.call(this, t4); - }; - } - function textTween(value) { - var t02, i0; - function tween() { - var i2 = value.apply(this, arguments); - if (i2 !== i0) - t02 = (i0 = i2) && textInterpolate(i2); - return t02; + }); + + // ../../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; } - tween._value = value; - return tween; - } - function transition_textTween(value) { - var key = "text"; - if (arguments.length < 1) - return (key = this.tween(key)) && key._value; - if (value == null) - return this.tween(key, null); - if (typeof value !== "function") - throw new Error(); - return this.tween(key, textTween(value)); - } - function transition_transition() { - var name2 = 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, name2, id1, i2, group, { - time: inherit2.time + inherit2.delay + inherit2.duration, - delay: 0, - duration: inherit2.duration, - ease: inherit2.ease - }); - } - } + }); + + // ../../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 new Transition(groups, this._parents, name2, 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); - } - schedule2.on = on1; - }); - if (size2 === 0) - resolve(); - }); - } - var id$i = 0; - function Transition(groups, parents2, name2, id2) { - this._groups = groups; - this._parents = parents2; - this._name = name2; - this._id = id2; - } - function newId() { - return ++id$i; - } - 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(t4) { - return ((t4 *= 2) <= 1 ? t4 * t4 * t4 : (t4 -= 2) * t4 * t4 + 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`); - } + }); + + // ../../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; } - return timing; - } - function selection_transition(name2) { - var id2, timing; - if (name2 instanceof Transition) { - id2 = name2._id, name2 = name2._name; - } else { - id2 = newId(), (timing = defaultTiming).time = now$2(), name2 = name2 == null ? null : name2 + ""; + }); + + // ../../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; } - 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, name2, id2, i2, group, timing || inherit(node2, id2)); - } - } + }); + + // ../../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; } - return new Transition(groups, this._parents, name2, id2); - } - selection.prototype.interrupt = selection_interrupt; - selection.prototype.transition = selection_transition; - const pi$1 = Math.PI, tau$1 = 2 * pi$1, epsilon$1 = 1e-6, tauEpsilon = tau$1 - epsilon$1; - function Path() { - this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null; - this._ = ""; - } - function path() { - return new Path(); - } - 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"; - } - }, - 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$1)) - ; - else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon$1) || !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$1 - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l / l01, t21 = l / l21; - if (Math.abs(t01 - 1) > epsilon$1) { - this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01); - } - 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$1 || Math.abs(this._y1 - y0) > epsilon$1) { - this._ += "L" + x0 + "," + y0; - } - if (!r) - return; - if (da < 0) - da = da % tau$1 + tau$1; - 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$1) { - this._ += "A" + r + "," + r + ",0," + +(da >= pi$1) + "," + cw + "," + (this._x1 = x2 + r * Math.cos(a1)) + "," + (this._y1 = y2 + r * Math.sin(a1)); - } - }, - 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._; + }); + + // ../../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; } - }; - function responseText(response) { - if (!response.ok) - throw new Error(response.status + " " + response.statusText); - return response.text(); - } - function text$1(input, init2) { - return fetch(input, init2).then(responseText); - } - function parser$n(type2) { - return (input, init2) => text$1(input, init2).then((text2) => new DOMParser().parseFromString(text2, type2)); - } - var svg$2 = parser$n("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(value, width2) { - var i2 = value.length, t4 = [], j = 0, g = grouping[0], length2 = 0; - while (i2 > 0 && g > 0) { - if (length2 + g + 1 > width2) - g = Math.max(1, width2 - length2); - t4.push(value.substring(i2 -= g, i2 + g)); - if ((length2 += g + 1) > width2) - break; - g = grouping[j = (j + 1) % grouping.length]; - } - return t4.reverse().join(thousands); - }; - } - function formatNumerals(numerals) { - return function(value) { - return value.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; - } - } - 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(value) { - var valuePrefix = prefix, valueSuffix = suffix, i2, n, c2; - if (type2 === "c") { - valueSuffix = formatType(value) + valueSuffix; - value = ""; - } else { - value = +value; - var valueNegative = value < 0 || 1 / value < 0; - value = isNaN(value) ? nan : formatType(Math.abs(value), precision); - if (trim2) - value = formatTrim(value); - if (valueNegative && +value === 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 = value.length; - while (++i2 < n) { - if (c2 = value.charCodeAt(i2), 48 > c2 || c2 > 57) { - valueSuffix = (c2 === 46 ? decimal + value.slice(i2 + 1) : value.slice(i2)) + valueSuffix; - value = value.slice(0, i2); - break; - } - } - } - } - if (comma && !zero2) - value = group(value, Infinity); - var length2 = valuePrefix.length + value.length + valueSuffix.length, padding2 = length2 < width2 ? new Array(width2 - length2 + 1).join(fill) : ""; - if (comma && zero2) - value = group(padding2 + value, padding2.length ? width2 - valueSuffix.length : Infinity), padding2 = ""; - switch (align) { - case "<": - value = valuePrefix + value + valueSuffix + padding2; - break; - case "=": - value = valuePrefix + padding2 + value + valueSuffix; - break; - case "^": - value = padding2.slice(0, length2 = padding2.length >> 1) + valuePrefix + value + valueSuffix + padding2.slice(length2); - break; - default: - value = padding2 + valuePrefix + value + valueSuffix; - break; - } - return numerals(value); - } - format2.toString = function() { - return specifier + ""; - }; - return format2; + }); + + // ../../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 formatPrefix2(specifier, value) { - var f2 = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3, k = Math.pow(10, -e), prefix = prefixes[8 + e / 3]; - return function(value2) { - return f2(k * value2) + prefix; - }; + }); + + // ../../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 { - format: newFormat, - formatPrefix: formatPrefix2 - }; - } - var locale$2; - var format; - var formatPrefix; - defaultLocale$1({ - thousands: ",", - grouping: [3], - currency: ["$", ""] }); - function defaultLocale$1(definition) { - locale$2 = formatLocale$1(definition); - format = locale$2.format; - formatPrefix = locale$2.formatPrefix; - return locale$2; - } - function precisionFixed(step) { - return Math.max(0, -exponent(Math.abs(step))); - } - function precisionPrefix(step, value) { - return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step))); - } - function precisionRound(step, max2) { - step = Math.abs(step), max2 = Math.abs(max2) - step; - return Math.max(0, exponent(max2) - exponent(step)) + 1; - } - function initRange(domain, range2) { - switch (arguments.length) { - case 0: - break; - case 1: - this.range(domain); - break; - default: - this.range(range2).domain(domain); - break; + + // ../../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 this; - } - const implicit = Symbol("implicit"); - function ordinal() { - var index = new InternMap(), domain = [], range2 = [], unknown = implicit; - function scale(d) { - let i2 = index.get(d); - if (i2 === void 0) { - if (unknown !== implicit) - return unknown; - index.set(d, i2 = domain.push(d) - 1); - } - return range2[i2 % range2.length]; + }); + + // ../../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; } - scale.domain = function(_2) { - if (!arguments.length) - return domain.slice(); - domain = [], index = new InternMap(); - for (const value of _2) { - if (index.has(value)) - continue; - index.set(value, domain.push(value) - 1); - } - return scale; - }; - scale.range = function(_2) { - return arguments.length ? (range2 = Array.from(_2), scale) : range2.slice(); - }; - scale.unknown = function(_2) { - return arguments.length ? (unknown = _2, scale) : unknown; - }; - scale.copy = function() { - return ordinal(domain, range2).unknown(unknown); - }; - initRange.apply(scale, arguments); - return scale; - } - function constants(x2) { - return function() { - return x2; - }; - } - function number$1(x2) { - return +x2; - } - var unit$1 = [0, 1]; - function identity$2(x2) { - return x2; - } - function normalize(a, b) { - return (b -= a = +a) ? function(x2) { - return (x2 - a) / b; - } : constants(isNaN(b) ? NaN : 0.5); - } - function clamper(a, b) { - var t4; - if (a > b) - t4 = a, a = b, b = t4; - 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(); + }); + + // ../../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; } - while (++i2 < j) { - d[i2] = normalize(domain[i2], domain[i2 + 1]); - r[i2] = interpolate2(range2[i2], range2[i2 + 1]); + }); + + // ../../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 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; + }); + + // ../../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; } - function scale(x2) { - return x2 == null || isNaN(x2 = +x2) ? unknown : (output || (output = piecewise(domain.map(transform), range2, interpolate2)))(transform(clamp(x2))); + }); + + // ../../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(); } - 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(t4, u2) { - transform = t4, untransform = u2; - 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 value = Math.max(Math.abs(start2), Math.abs(stop)); - if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) - specifier.precision = precision; - return formatPrefix(specifier, value); - } - 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; - } + }); + + // ../../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(); } - 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; - } else { - break; - } - 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], t4; - if (x1 < x0) { - t4 = i0, i0 = i1, i1 = t4; - t4 = x0, x0 = x1, x1 = t4; + }); + + // src/themes/erDiagram-oldHardcodedValues.ts + var oldAttributeBackgroundColorOdd, oldAttributeBackgroundColorEven; + var init_erDiagram_oldHardcodedValues = __esm({ + "src/themes/erDiagram-oldHardcodedValues.ts"() { + "use strict"; + oldAttributeBackgroundColorOdd = "#ffffff"; + oldAttributeBackgroundColorEven = "#f2f2f2"; } - domain[i0] = interval2.floor(x0); - domain[i1] = interval2.ceil(x1); - return domain; - } - var t0 = /* @__PURE__ */ new Date(), t1 = /* @__PURE__ */ new Date(); - function newInterval(floori, offseti, count, field) { - function interval2(date2) { - return floori(date2 = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+date2)), date2; + }); + + // 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"); } - interval2.floor = function(date2) { - return floori(date2 = /* @__PURE__ */ new Date(+date2)), date2; - }; - interval2.ceil = function(date2) { - return floori(date2 = new Date(date2 - 1)), offseti(date2, 1), floori(date2), date2; - }; - interval2.round = function(date2) { - var d0 = interval2(date2), d1 = interval2.ceil(date2); - return date2 - d0 < d1 - date2 ? d0 : d1; - }; - interval2.offset = function(date2, step) { - return offseti(date2 = /* @__PURE__ */ new Date(+date2), step == null ? 1 : Math.floor(step)), date2; - }; - interval2.range = function(start2, stop, step) { - var range2 = [], previous; - start2 = interval2.ceil(start2); - step = step == null ? 1 : Math.floor(step); - if (!(start2 < stop) || !(step > 0)) - return range2; - do - range2.push(previous = /* @__PURE__ */ new Date(+start2)), offseti(start2, step), floori(start2); - while (previous < start2 && start2 < stop); - return range2; - }; - interval2.filter = function(test) { - return newInterval(function(date2) { - if (date2 >= date2) - while (floori(date2), !test(date2)) - date2.setTime(date2 - 1); - }, function(date2, step) { - if (date2 >= date2) { - if (step < 0) - while (++step <= 0) { - while (offseti(date2, -1), !test(date2)) { - } + }); + + // 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 - while (--step >= 0) { - while (offseti(date2, 1), !test(date2)) { - } + } 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.archEdgeColor = this.archEdgeColor || "#777"; + this.archEdgeArrowColor = this.archEdgeArrowColor || "#777"; + this.archEdgeWidth = this.archEdgeWidth || "3"; + this.archGroupBorderColor = this.archGroupBorderColor || "#000"; + this.archGroupBorderWidth = this.archGroupBorderWidth || "2px"; + 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]; + }); } - }); - }; - if (count) { - interval2.count = function(start2, end2) { - t0.setTime(+start2), t1.setTime(+end2); - floori(t0), floori(t1); - return Math.floor(count(t0, t1)); - }; - interval2.every = function(step) { - step = Math.floor(step); - return !isFinite(step) || !(step > 0) ? null : !(step > 1) ? interval2 : interval2.filter(field ? function(d) { - return field(d) % step === 0; - } : function(d) { - return interval2.count(0, d) % step === 0; - }); }; + getThemeVariables = /* @__PURE__ */ __name((userOverrides) => { + const theme = new Theme(); + theme.calculate(userOverrides); + return theme; + }, "getThemeVariables"); } - return interval2; - } - var millisecond = newInterval(function() { - }, function(date2, step) { - date2.setTime(+date2 + step); - }, function(start2, end2) { - return end2 - start2; }); - millisecond.every = function(k) { - k = Math.floor(k); - if (!isFinite(k) || !(k > 0)) - return null; - if (!(k > 1)) - return millisecond; - return newInterval(function(date2) { - date2.setTime(Math.floor(date2 / k) * k); - }, function(date2, step) { - date2.setTime(+date2 + step * k); - }, function(start2, end2) { - return (end2 - start2) / k; - }); - }; - const millisecond$1 = millisecond; - 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; - var second = newInterval(function(date2) { - date2.setTime(date2 - date2.getMilliseconds()); - }, function(date2, step) { - date2.setTime(+date2 + step * durationSecond); - }, function(start2, end2) { - return (end2 - start2) / durationSecond; - }, function(date2) { - return date2.getUTCSeconds(); - }); - const utcSecond = second; - second.range; - var minute = newInterval(function(date2) { - date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond); - }, function(date2, step) { - date2.setTime(+date2 + step * durationMinute); - }, function(start2, end2) { - return (end2 - start2) / durationMinute; - }, function(date2) { - return date2.getMinutes(); - }); - const timeMinute = minute; - minute.range; - var hour = newInterval(function(date2) { - date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond - date2.getMinutes() * durationMinute); - }, function(date2, step) { - date2.setTime(+date2 + step * durationHour); - }, function(start2, end2) { - return (end2 - start2) / durationHour; - }, function(date2) { - return date2.getHours(); - }); - const timeHour = hour; - hour.range; - var day = newInterval( - (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 - ); - const timeDay = day; - day.range; - function weekday(i2) { - return newInterval(function(date2) { - date2.setDate(date2.getDate() - (date2.getDay() + 7 - i2) % 7); - date2.setHours(0, 0, 0, 0); - }, function(date2, step) { - date2.setDate(date2.getDate() + step * 7); - }, function(start2, end2) { - return (end2 - start2 - (end2.getTimezoneOffset() - start2.getTimezoneOffset()) * durationMinute) / durationWeek; - }); - } - var sunday = weekday(0); - var monday = weekday(1); - var tuesday = weekday(2); - var wednesday = weekday(3); - var thursday = weekday(4); - var friday = weekday(5); - var saturday = weekday(6); - sunday.range; - monday.range; - tuesday.range; - wednesday.range; - thursday.range; - friday.range; - saturday.range; - var month = newInterval(function(date2) { - date2.setDate(1); - date2.setHours(0, 0, 0, 0); - }, function(date2, step) { - date2.setMonth(date2.getMonth() + step); - }, function(start2, end2) { - return end2.getMonth() - start2.getMonth() + (end2.getFullYear() - start2.getFullYear()) * 12; - }, function(date2) { - return date2.getMonth(); - }); - const timeMonth = month; - month.range; - var year = newInterval(function(date2) { - date2.setMonth(0, 1); - date2.setHours(0, 0, 0, 0); - }, function(date2, step) { - date2.setFullYear(date2.getFullYear() + step); - }, function(start2, end2) { - return end2.getFullYear() - start2.getFullYear(); - }, function(date2) { - return date2.getFullYear(); - }); - year.every = function(k) { - return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date2) { - date2.setFullYear(Math.floor(date2.getFullYear() / k) * k); - date2.setMonth(0, 1); - date2.setHours(0, 0, 0, 0); - }, function(date2, step) { - date2.setFullYear(date2.getFullYear() + step * k); - }); - }; - const timeYear = year; - year.range; - var utcDay = newInterval(function(date2) { - date2.setUTCHours(0, 0, 0, 0); - }, function(date2, step) { - date2.setUTCDate(date2.getUTCDate() + step); - }, function(start2, end2) { - return (end2 - start2) / durationDay; - }, function(date2) { - return date2.getUTCDate() - 1; - }); - const utcDay$1 = utcDay; - utcDay.range; - function utcWeekday(i2) { - return newInterval(function(date2) { - date2.setUTCDate(date2.getUTCDate() - (date2.getUTCDay() + 7 - i2) % 7); - date2.setUTCHours(0, 0, 0, 0); - }, function(date2, step) { - date2.setUTCDate(date2.getUTCDate() + step * 7); - }, function(start2, end2) { - return (end2 - start2) / durationWeek; - }); - } - var utcSunday = utcWeekday(0); - var utcMonday = utcWeekday(1); - var utcTuesday = utcWeekday(2); - var utcWednesday = utcWeekday(3); - var utcThursday = utcWeekday(4); - var utcFriday = utcWeekday(5); - var utcSaturday = utcWeekday(6); - utcSunday.range; - utcMonday.range; - utcTuesday.range; - utcWednesday.range; - utcThursday.range; - utcFriday.range; - utcSaturday.range; - var utcYear = newInterval(function(date2) { - date2.setUTCMonth(0, 1); - date2.setUTCHours(0, 0, 0, 0); - }, function(date2, step) { - date2.setUTCFullYear(date2.getUTCFullYear() + step); - }, function(start2, end2) { - return end2.getUTCFullYear() - start2.getUTCFullYear(); - }, function(date2) { - return date2.getUTCFullYear(); - }); - utcYear.every = function(k) { - return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date2) { - date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / k) * k); - date2.setUTCMonth(0, 1); - date2.setUTCHours(0, 0, 0, 0); - }, function(date2, step) { - date2.setUTCFullYear(date2.getUTCFullYear() + step * k); - }); - }; - const utcYear$1 = utcYear; - utcYear.range; - function ticker(year2, month2, week, day2, hour2, minute2) { - const tickIntervals = [ - [utcSecond, 1, durationSecond], - [utcSecond, 5, 5 * durationSecond], - [utcSecond, 15, 15 * durationSecond], - [utcSecond, 30, 30 * durationSecond], - [minute2, 1, durationMinute], - [minute2, 5, 5 * durationMinute], - [minute2, 15, 15 * durationMinute], - [minute2, 30, 30 * durationMinute], - [hour2, 1, durationHour], - [hour2, 3, 3 * durationHour], - [hour2, 6, 6 * durationHour], - [hour2, 12, 12 * durationHour], - [day2, 1, durationDay], - [day2, 2, 2 * durationDay], - [week, 1, durationWeek], - [month2, 1, durationMonth], - [month2, 3, 3 * durationMonth], - [year2, 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 year2.every(tickStep(start2 / durationYear, stop / durationYear, count)); - if (i2 === 0) - return millisecond$1.every(Math.max(tickStep(start2, stop, count), 1)); - const [t4, step] = tickIntervals[target / tickIntervals[i2 - 1][2] < tickIntervals[i2][2] / target ? i2 - 1 : i2]; - return t4.every(step); - } - return [ticks2, tickInterval2]; - } - const [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, sunday, 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 string = [], 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) { - string.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); - string.push(c2); - j = i2 + 1; + + // 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.archEdgeColor = "calculated"; + this.archEdgeArrowColor = "calculated"; + this.archEdgeWidth = "3"; + this.archGroupBorderColor = this.primaryBorderColor; + this.archGroupBorderWidth = "2px"; + 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.archEdgeColor = this.lineColor; + this.archEdgeArrowColor = this.lineColor; + 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]; + }); } - string.push(specifier.slice(j, i2)); - return string.join(""); }; + getThemeVariables2 = /* @__PURE__ */ __name((userOverrides) => { + const theme = new Theme2(); + theme.calculate(userOverrides); + return theme; + }, "getThemeVariables"); } - function newParse(specifier, Z) { - return function(string) { - var d = newDate(1900, void 0, 1), i2 = parseSpecifier(d, specifier, string += "", 0), week, day2; - if (i2 != string.length) - 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)), day2 = week.getUTCDay(); - week = day2 > 4 || day2 === 0 ? utcMonday.ceil(week) : utcMonday(week); - week = utcDay$1.offset(week, (d.V - 1) * 7); - d.y = week.getUTCFullYear(); - d.m = week.getUTCMonth(); - d.d = week.getUTCDate() + (d.w + 6) % 7; + }); + + // 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.archEdgeColor = "calculated"; + this.archEdgeArrowColor = "calculated"; + this.archEdgeWidth = "3"; + this.archGroupBorderColor = this.primaryBorderColor; + this.archGroupBorderWidth = "2px"; + 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.archEdgeColor = this.lineColor; + this.archEdgeArrowColor = this.lineColor; + 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 { - week = localDate(newDate(d.y, 0, 1)), day2 = week.getDay(); - week = day2 > 4 || day2 === 0 ? monday.ceil(week) : monday(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; - day2 = "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 - (day2 + 5) % 7 : d.w + d.U * 7 - (day2 + 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, string, j) { - var i2 = 0, n = specifier.length, m = string.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, string, j)) < 0) - return -1; - } else if (c2 != string.charCodeAt(j++)) { - return -1; + 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 j; - } - function parsePeriod(d, string, i2) { - var n = periodRe.exec(string.slice(i2)); - return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i2 + n[0].length) : -1; - } - function parseShortWeekday(d, string, i2) { - var n = shortWeekdayRe.exec(string.slice(i2)); - return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i2 + n[0].length) : -1; + }; + getThemeVariables3 = /* @__PURE__ */ __name((userOverrides) => { + const theme = new Theme3(); + theme.calculate(userOverrides); + return theme; + }, "getThemeVariables"); } - function parseWeekday(d, string, i2) { - var n = weekdayRe.exec(string.slice(i2)); - return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i2 + n[0].length) : -1; + }); + + // 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.archEdgeColor = "calculated"; + this.archEdgeArrowColor = "calculated"; + this.archEdgeWidth = "3"; + this.archGroupBorderColor = this.primaryBorderColor; + this.archGroupBorderWidth = "2px"; + 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.archEdgeColor = this.lineColor; + this.archEdgeArrowColor = this.lineColor; + 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]; + }); + } + }; + getThemeVariables4 = /* @__PURE__ */ __name((userOverrides) => { + const theme = new Theme4(); + theme.calculate(userOverrides); + return theme; + }, "getThemeVariables"); } - function parseShortMonth(d, string, i2) { - var n = shortMonthRe.exec(string.slice(i2)); - return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i2 + n[0].length) : -1; + }); + + // 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.archEdgeColor = "calculated"; + this.archEdgeArrowColor = "calculated"; + this.archEdgeWidth = "3"; + this.archGroupBorderColor = this.primaryBorderColor; + this.archGroupBorderWidth = "2px"; + 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.archEdgeColor = this.lineColor; + this.archEdgeArrowColor = this.lineColor; + 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]; + }); + } + }; + getThemeVariables5 = /* @__PURE__ */ __name((userOverrides) => { + const theme = new Theme5(); + theme.calculate(userOverrides); + return theme; + }, "getThemeVariables"); } - function parseMonth(d, string, i2) { - var n = monthRe.exec(string.slice(i2)); - return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i2 + n[0].length) : -1; + }); + + // 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 + } + }; } - function parseLocaleDateTime(d, string, i2) { - return parseSpecifier(d, locale_dateTime, string, i2); + }); + + // 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 + }, + "architecture": { + "useMaxWidth": true, + "padding": 40, + "iconSize": 80, + "fontSize": 16 + }, + "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 + }; } - function parseLocaleDate(d, string, i2) { - return parseSpecifier(d, locale_date, string, i2); + }); + + // 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 + } + }; + 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; } - function parseLocaleTime(d, string, i2) { - return parseSpecifier(d, locale_time, string, i2); + }); + + // 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"); } - function formatShortWeekday(d) { - return locale_shortWeekdays[d.getDay()]; + }); + + // 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"); } - function formatWeekday(d) { - return locale_weekdays[d.getDay()]; + }); + + // ../../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; + }); } - function formatShortMonth(d) { - return locale_shortMonths[d.getMonth()]; + }); + + // ../../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 getDefaultValue(schema2) { + if (schema2.default) { + return schema2.default; } - function formatMonth(d) { - return locale_months[d.getMonth()]; + var type3 = schema2.type; + var defaultType = Array.isArray(type3) ? type3[0] : type3; + if (typeof defaultType !== "string") { + return defaultType.enum[0]; } - function formatPeriod(d) { - return locale_periods[+(d.getHours() >= 12)]; + switch (defaultType) { + case "boolean": + return false; + case "string": + return ""; + case "number": + return 0; + case "object": + return {}; } - function formatQuarter(d) { - return 1 + ~~(d.getMonth() / 3); + } + 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; + } + } } - function formatUTCShortWeekday(d) { - return locale_shortWeekdays[d.getUTCDay()]; + return null; + } + function supportedCodepoint(codepoint) { + for (var i2 = 0; i2 < allBlocks.length; i2 += 2) { + if (codepoint >= allBlocks[i2] && codepoint <= allBlocks[i2 + 1]) { + return true; + } } - function formatUTCWeekday(d) { - return locale_weekdays[d.getUTCDay()]; + return false; + } + function setFontMetrics(fontName, metrics) { + fontMetricsData[fontName] = metrics; + } + function getCharacterMetrics(character2, font, mode) { + if (!fontMetricsData[font]) { + throw new Error("Font metrics not found for font: " + font + "."); } - function formatUTCShortMonth(d) { - return locale_shortMonths[d.getUTCMonth()]; + 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]; } - function formatUTCMonth(d) { - return locale_months[d.getUTCMonth()]; + if (!metrics && mode === "text") { + if (supportedCodepoint(ch)) { + metrics = fontMetricsData[font][77]; + } } - function formatUTCPeriod(d) { - return locale_periods[+(d.getUTCHours() >= 12)]; + if (metrics) { + return { + depth: metrics[0], + height: metrics[1], + italic: metrics[2], + skew: metrics[3], + width: metrics[4] + }; } - function formatUTCQuarter(d) { - return 1 + ~~(d.getUTCMonth() / 3); + } + function getGlobalMetrics(size5) { + var sizeIndex; + if (size5 >= 5) { + sizeIndex = 0; + } else if (size5 >= 3) { + sizeIndex = 1; + } else { + sizeIndex = 2; } - 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; + 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]; + } } - }; - } - var pads = { "-": "", "_": " ", "0": "0" }, numberRe = /^\s*\d+/, percentRe = /^%/, requoteRe = /[\\^$*+?|[\]().{}]/g; - function pad(value, fill, width2) { - var sign2 = value < 0 ? "-" : "", string = (sign2 ? -value : value) + "", length2 = string.length; - return sign2 + (length2 < width2 ? new Array(width2 - length2 + 1).join(fill) + string : string); - } - 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((name2, i2) => [name2.toLowerCase(), i2])); - } - function parseWeekdayNumberSunday(d, string, i2) { - var n = numberRe.exec(string.slice(i2, i2 + 1)); - return n ? (d.w = +n[0], i2 + n[0].length) : -1; - } - function parseWeekdayNumberMonday(d, string, i2) { - var n = numberRe.exec(string.slice(i2, i2 + 1)); - return n ? (d.u = +n[0], i2 + n[0].length) : -1; - } - function parseWeekNumberSunday(d, string, i2) { - var n = numberRe.exec(string.slice(i2, i2 + 2)); - return n ? (d.U = +n[0], i2 + n[0].length) : -1; - } - function parseWeekNumberISO(d, string, i2) { - var n = numberRe.exec(string.slice(i2, i2 + 2)); - return n ? (d.V = +n[0], i2 + n[0].length) : -1; - } - function parseWeekNumberMonday(d, string, i2) { - var n = numberRe.exec(string.slice(i2, i2 + 2)); - return n ? (d.W = +n[0], i2 + n[0].length) : -1; - } - function parseFullYear(d, string, i2) { - var n = numberRe.exec(string.slice(i2, i2 + 4)); - return n ? (d.y = +n[0], i2 + n[0].length) : -1; - } - function parseYear(d, string, i2) { - var n = numberRe.exec(string.slice(i2, i2 + 2)); - return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2e3), i2 + n[0].length) : -1; - } - function parseZone(d, string, i2) { - var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i2, i2 + 6)); - return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i2 + n[0].length) : -1; - } - function parseQuarter(d, string, i2) { - var n = numberRe.exec(string.slice(i2, i2 + 1)); - return n ? (d.q = n[0] * 3 - 3, i2 + n[0].length) : -1; - } - function parseMonthNumber(d, string, i2) { - var n = numberRe.exec(string.slice(i2, i2 + 2)); - return n ? (d.m = n[0] - 1, i2 + n[0].length) : -1; - } - function parseDayOfMonth(d, string, i2) { - var n = numberRe.exec(string.slice(i2, i2 + 2)); - return n ? (d.d = +n[0], i2 + n[0].length) : -1; + } + return fontMetricsBySizeIndex[sizeIndex]; } - function parseDayOfYear(d, string, i2) { - var n = numberRe.exec(string.slice(i2, i2 + 3)); - return n ? (d.m = 0, d.d = +n[0], i2 + n[0].length) : -1; + function assertSymbolDomNode(group2) { + if (group2 instanceof SymbolNode) { + return group2; + } else { + throw new Error("Expected symbolNode but got " + String(group2) + "."); + } } - function parseHour24(d, string, i2) { - var n = numberRe.exec(string.slice(i2, i2 + 2)); - return n ? (d.H = +n[0], i2 + n[0].length) : -1; + function assertSpan(group2) { + if (group2 instanceof Span) { + return group2; + } else { + throw new Error("Expected span but got " + String(group2) + "."); + } } - function parseMinutes(d, string, i2) { - var n = numberRe.exec(string.slice(i2, i2 + 2)); - return n ? (d.M = +n[0], i2 + n[0].length) : -1; + 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 parseSeconds(d, string, i2) { - var n = numberRe.exec(string.slice(i2, i2 + 2)); - return n ? (d.S = +n[0], i2 + n[0].length) : -1; + 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 parseMilliseconds(d, string, i2) { - var n = numberRe.exec(string.slice(i2, i2 + 3)); - return n ? (d.L = +n[0], i2 + n[0].length) : -1; + 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 parseMicroseconds(d, string, i2) { - var n = numberRe.exec(string.slice(i2, i2 + 6)); - return n ? (d.L = Math.floor(n[0] / 1e3), i2 + n[0].length) : -1; + 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 parseLiteralPercent(d, string, i2) { - var n = percentRe.exec(string.slice(i2, i2 + 1)); - return n ? i2 + n[0].length : -1; + 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; + } + } + if (!nobreak) { + children2.push(buildHTMLUnbreakable(parts, options3)); + parts = []; + } + } else if (expression[i2].hasClass("newline")) { + parts.pop(); + if (parts.length > 0) { + children2.push(buildHTMLUnbreakable(parts, options3)); + parts = []; + } + children2.push(expression[i2]); + } + } + 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 parseUnixTimestamp(d, string, i2) { - var n = numberRe.exec(string.slice(i2)); - return n ? (d.Q = +n[0], i2 + n[0].length) : -1; + function newDocumentFragment(children2) { + return new DocumentFragment(children2); } - function parseUnixTimestampSeconds(d, string, i2) { - var n = numberRe.exec(string.slice(i2)); - return n ? (d.s = +n[0], i2 + n[0].length) : -1; + 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 { + wrapper = new mathMLTree.MathNode("mrow", expression); + } + 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 formatDayOfMonth(d, p) { - return pad(d.getDate(), p, 2); + 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 formatHour24(d, p) { - return pad(d.getHours(), p, 2); + 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 formatHour12(d, p) { - return pad(d.getHours() % 12 || 12, p, 2); + function checkSymbolNodeType(node2) { + if (node2 && (node2.type === "atom" || NON_ATOMS.hasOwnProperty(node2.type))) { + return node2; + } + return null; } - function formatDayOfYear(d, p) { - return pad(1 + timeDay.count(timeYear(d), d), p, 3); + function htmlBuilder$9(group2, options3) { + var elements3 = buildExpression$1(group2.body, options3, true); + return makeSpan2([group2.mclass], elements3, options3); + } + 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 { + 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 node2; } - function formatMilliseconds(d, p) { - return pad(d.getMilliseconds(), p, 3); + function cdArrow(arrowChar, labels, parser22) { + var funcName = cdArrowFunctionName[arrowChar]; + switch (funcName) { + case "\\\\cdrightarrow": + case "\\\\cdleftarrow": + return parser22.callFunction(funcName, [labels[0]], [labels[1]]); + case "\\uparrow": + case "\\downarrow": { + var leftLabel = parser22.callFunction("\\\\cdleft", [labels[0]], []); + var bareArrow = { + type: "atom", + text: funcName, + mode: "math", + family: "rel" + }; + var sizedArrow = parser22.callFunction("\\Big", [bareArrow], []); + var rightLabel = parser22.callFunction("\\\\cdright", [labels[1]], []); + var arrowGroup = { + type: "ordgroup", + mode: "math", + body: [leftLabel, sizedArrow, rightLabel] + }; + return parser22.callFunction("\\\\cdparent", [arrowGroup], []); + } + case "\\\\cdlongequal": + return parser22.callFunction("\\\\cdlongequal", [], []); + case "\\Vert": { + var arrow = { + type: "textord", + text: "\\Vert", + mode: "math" + }; + return parser22.callFunction("\\Big", [arrow], []); + } + default: + return { + type: "textord", + text: " ", + mode: "math" + }; + } } - function formatMicroseconds(d, p) { - return formatMilliseconds(d, p) + "000"; + function parseCD(parser22) { + var parsedRows = []; + parser22.gullet.beginGroup(); + parser22.gullet.macros.set("\\cr", "\\\\\\relax"); + parser22.gullet.beginGroup(); + while (true) { + parsedRows.push(parser22.parseExpression(false, "\\\\")); + parser22.gullet.endGroup(); + parser22.gullet.beginGroup(); + var next3 = parser22.fetch().text; + if (next3 === "&" || next3 === "\\\\") { + parser22.consume(); + } else if (next3 === "\\end") { + if (parsedRows[parsedRows.length - 1].length === 0) { + parsedRows.pop(); + } + break; + } else { + throw new ParseError("Expected \\\\ or \\cr or \\end", parser22.nextToken); + } + } + 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, parser22); + var wrappedArrow = { + type: "styling", + body: [arrow], + mode: "math", + style: "display" + // CD is always displaystyle. + }; + row.push(wrappedArrow); + cell = newCell(); + } + } + if (i2 % 2 === 0) { + row.push(cell); + } else { + row.shift(); + } + row = []; + body.push(row); + } + parser22.gullet.endGroup(); + parser22.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([]) + }; } - function formatMonthNumber(d, p) { - return pad(d.getMonth() + 1, p, 2); + 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 formatMinutes(d, p) { - return pad(d.getMinutes(), p, 2); + function assertParsed(group2) { + if (!group2.body) { + throw new Error("Bug: The leftright ParseNode wasn't fully parsed."); + } } - function formatSeconds(d, p) { - return pad(d.getSeconds(), p, 2); + 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; + } + if (htmlBuilder3) { + _htmlGroupBuilders[type3] = htmlBuilder3; + } + if (mathmlBuilder3) { + _mathmlGroupBuilders[type3] = mathmlBuilder3; + } + } + function defineMacro(name, body) { + _macros[name] = body; + } + function getHLines(parser22) { + var hlineInfo = []; + parser22.consumeSpaces(); + var nxt = parser22.fetch().text; + if (nxt === "\\relax") { + parser22.consume(); + parser22.consumeSpaces(); + nxt = parser22.fetch().text; + } + while (nxt === "\\hline" || nxt === "\\hdashline") { + parser22.consume(); + hlineInfo.push(nxt === "\\hdashline"); + parser22.consumeSpaces(); + nxt = parser22.fetch().text; + } + return hlineInfo; + } + function getAutoTag(name) { + if (name.indexOf("ed") === -1) { + return name.indexOf("*") === -1; + } + } + function parseArray(parser22, _ref, style3) { + var { + hskipBeforeAndAfter, + addJot, + cols, + arraystretch, + colSeparationType, + autoTag, + singleRow, + emptySingleRow, + maxNumCols, + leqno + } = _ref; + parser22.gullet.beginGroup(); + if (!singleRow) { + parser22.gullet.macros.set("\\cr", "\\\\\\relax"); + } + if (!arraystretch) { + var stretch = parser22.gullet.expandMacroAsText("\\arraystretch"); + if (stretch == null) { + arraystretch = 1; + } else { + arraystretch = parseFloat(stretch); + if (!arraystretch || arraystretch < 0) { + throw new ParseError("Invalid \\arraystretch: " + stretch); + } + } + } + parser22.gullet.beginGroup(); + var row = []; + var body = [row]; + var rowGaps = []; + var hLinesBeforeRow = []; + var tags2 = autoTag != null ? [] : void 0; + function beginRow() { + if (autoTag) { + parser22.gullet.macros.set("\\@eqnsw", "1", true); + } + } + __name(beginRow, "beginRow"); + function endRow() { + if (tags2) { + if (parser22.gullet.macros.get("\\df@tag")) { + tags2.push(parser22.subparse([new Token("\\df@tag")])); + parser22.gullet.macros.set("\\df@tag", void 0, true); + } else { + tags2.push(Boolean(autoTag) && parser22.gullet.macros.get("\\@eqnsw") === "1"); + } + } + } + __name(endRow, "endRow"); + beginRow(); + hLinesBeforeRow.push(getHLines(parser22)); + while (true) { + var cell = parser22.parseExpression(false, singleRow ? "\\end" : "\\\\"); + parser22.gullet.endGroup(); + parser22.gullet.beginGroup(); + cell = { + type: "ordgroup", + mode: parser22.mode, + body: cell + }; + if (style3) { + cell = { + type: "styling", + mode: parser22.mode, + style: style3, + body: [cell] + }; + } + row.push(cell); + var next3 = parser22.fetch().text; + if (next3 === "&") { + if (maxNumCols && row.length === maxNumCols) { + if (singleRow || colSeparationType) { + throw new ParseError("Too many tab characters: &", parser22.nextToken); + } else { + parser22.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument."); + } + } + parser22.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 === "\\\\") { + parser22.consume(); + var size5 = void 0; + if (parser22.gullet.future().text !== " ") { + size5 = parser22.parseSizeGroup(true); + } + rowGaps.push(size5 ? size5.value : null); + endRow(); + hLinesBeforeRow.push(getHLines(parser22)); + row = []; + body.push(row); + beginRow(); + } else { + throw new ParseError("Expected & or \\\\ or \\cr or \\end", parser22.nextToken); + } + } + parser22.gullet.endGroup(); + parser22.gullet.endGroup(); + return { + type: "array", + mode: parser22.mode, + addJot, + arraystretch, + body, + cols, + rowGaps, + hskipBeforeAndAfter, + hLinesBeforeRow, + colSeparationType, + tags: tags2, + leqno + }; } - function formatWeekdayNumberMonday(d) { - var day2 = d.getDay(); - return day2 === 0 ? 7 : day2; - } - function formatWeekNumberSunday(d, p) { - return pad(sunday.count(timeYear(d) - 1, d), p, 2); - } - function dISO(d) { - var day2 = d.getDay(); - return day2 >= 4 || day2 === 0 ? thursday(d) : thursday.ceil(d); - } - function formatWeekNumberISO(d, p) { - d = dISO(d); - return pad(thursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2); - } - function formatWeekdayNumberSunday(d) { - return d.getDay(); - } - function formatWeekNumberMonday(d, p) { - return pad(monday.count(timeYear(d) - 1, d), p, 2); - } - function formatYear(d, p) { - return pad(d.getFullYear() % 100, p, 2); - } - function formatYearISO(d, p) { - d = dISO(d); - return pad(d.getFullYear() % 100, p, 2); - } - function formatFullYear(d, p) { - return pad(d.getFullYear() % 1e4, p, 4); - } - function formatFullYearISO(d, p) { - var day2 = d.getDay(); - d = day2 >= 4 || day2 === 0 ? thursday(d) : thursday.ceil(d); - return pad(d.getFullYear() % 1e4, p, 4); - } - function formatZone(d) { - var z = d.getTimezoneOffset(); - return (z > 0 ? "-" : (z *= -1, "+")) + pad(z / 60 | 0, "0", 2) + pad(z % 60, "0", 2); - } - function formatUTCDayOfMonth(d, p) { - return pad(d.getUTCDate(), p, 2); - } - function formatUTCHour24(d, p) { - return pad(d.getUTCHours(), p, 2); - } - function formatUTCHour12(d, p) { - return pad(d.getUTCHours() % 12 || 12, p, 2); - } - function formatUTCDayOfYear(d, p) { - return pad(1 + utcDay$1.count(utcYear$1(d), d), p, 3); - } - function formatUTCMilliseconds(d, p) { - return pad(d.getUTCMilliseconds(), p, 3); - } - function formatUTCMicroseconds(d, p) { - return formatUTCMilliseconds(d, p) + "000"; - } - function formatUTCMonthNumber(d, p) { - return pad(d.getUTCMonth() + 1, p, 2); - } - function formatUTCMinutes(d, p) { - return pad(d.getUTCMinutes(), p, 2); - } - function formatUTCSeconds(d, p) { - return pad(d.getUTCSeconds(), p, 2); - } - function formatUTCWeekdayNumberMonday(d) { - var dow = d.getUTCDay(); - return dow === 0 ? 7 : dow; - } - function formatUTCWeekNumberSunday(d, p) { - return pad(utcSunday.count(utcYear$1(d) - 1, d), p, 2); - } - function UTCdISO(d) { - var day2 = d.getUTCDay(); - return day2 >= 4 || day2 === 0 ? utcThursday(d) : utcThursday.ceil(d); - } - function formatUTCWeekNumberISO(d, p) { - d = UTCdISO(d); - return pad(utcThursday.count(utcYear$1(d), d) + (utcYear$1(d).getUTCDay() === 4), p, 2); - } - function formatUTCWeekdayNumberSunday(d) { - return d.getUTCDay(); - } - function formatUTCWeekNumberMonday(d, p) { - return pad(utcMonday.count(utcYear$1(d) - 1, d), p, 2); - } - function formatUTCYear(d, p) { - return pad(d.getUTCFullYear() % 100, p, 2); - } - function formatUTCYearISO(d, p) { - d = UTCdISO(d); - return pad(d.getUTCFullYear() % 100, p, 2); - } - function formatUTCFullYear(d, p) { - return pad(d.getUTCFullYear() % 1e4, p, 4); - } - function formatUTCFullYearISO(d, p) { - var day2 = d.getUTCDay(); - d = day2 >= 4 || day2 === 0 ? utcThursday(d) : utcThursday.ceil(d); - return pad(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$1; - 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(definition) { - locale$1 = formatLocale(definition); - timeFormat = locale$1.format; - locale$1.parse; - locale$1.utcFormat; - locale$1.utcParse; - return locale$1; - } - function date(t4) { - return new Date(t4); - } - function number(t4) { - return t4 instanceof Date ? +t4 : +/* @__PURE__ */ new Date(+t4); - } - function calendar(ticks2, tickInterval2, year2, month2, week, day2, hour2, minute2, 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 : minute2(date2) < date2 ? formatSecond : hour2(date2) < date2 ? formatMinute : day2(date2) < date2 ? formatHour : month2(date2) < date2 ? week(date2) < date2 ? formatDay : formatWeek : year2(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, year2, month2, week, day2, hour2, minute2, second2, format2)); - }; - return scale; - } - function time$1() { - return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, sunday, timeDay, timeHour, timeMinute, utcSecond, timeFormat).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments); - } - function constant$1(x2) { - return function constant2() { - return x2; - }; - } - const abs$1 = Math.abs; - const atan2 = Math.atan2; - const cos = Math.cos; - const max$1 = Math.max; - const min$1 = Math.min; - const sin = Math.sin; - const sqrt = Math.sqrt; - const epsilon = 1e-12; - const pi = Math.PI; - const halfPi = pi / 2; - const tau = 2 * pi; - function acos(x2) { - return x2 > 1 ? 0 : x2 < -1 ? pi : Math.acos(x2); - } - function asin(x2) { - return x2 >= 1 ? halfPi : x2 <= -1 ? -halfPi : Math.asin(x2); - } - 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, t4 = y32 * x10 - x32 * y10; - if (t4 * t4 < epsilon) - return; - t4 = (x32 * (y0 - y2) - y32 * (x0 - x2)) / 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, r = r1 - rc, D2 = x11 * y10 - x10 * y11, d = (dy < 0 ? -1 : 1) * sqrt(max$1(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$1(0), padRadius = null, startAngle = arcStartAngle, endAngle = arcEndAngle, padAngle = arcPadAngle, context = null; - 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 = path(); - if (r1 < r0) - r = r1, r1 = r0, r0 = r; - if (!(r1 > epsilon)) - context.moveTo(0, 0); - else if (da > tau - epsilon) { - context.moveTo(r1 * cos(a0), r1 * sin(a0)); - context.arc(0, 0, r1, a0, a1, !cw); - if (r0 > epsilon) { - context.moveTo(r0 * cos(a1), r0 * sin(a1)); - context.arc(0, 0, r0, a1, a0, cw); + function dCellStyle(envName) { + if (envName.slice(0, 1) === "d") { + return "display"; + } else { + return "text"; + } + } + 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; + } + inner2[i2].height *= multiplier; + inner2[i2].depth *= multiplier; + } + return buildCommon.makeFragment(inner2); + } + 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, calculateSize2, 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; } - } else { - var a01 = a0, a11 = a1, a00 = a0, a10 = a1, da0 = da, da1 = da, ap = padAngle.apply(this, arguments) / 2, rp = ap > epsilon && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)), rc = min$1(abs$1(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), rc0 = rc, rc1 = rc, t02, t12; - if (rp > epsilon) { - var p0 = asin(rp / r0 * sin(ap)), p1 = asin(rp / r1 * sin(ap)); - if ((da0 -= p0 * 2) > epsilon) - p0 *= cw ? 1 : -1, a00 += p0, a10 -= p0; - else - da0 = 0, a00 = a10 = (a0 + a1) / 2; - if ((da1 -= p1 * 2) > epsilon) - p1 *= cw ? 1 : -1, a01 += p1, a11 -= p1; - else - da1 = 0, a01 = a11 = (a0 + a1) / 2; + }; + 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; + } + }, "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 value2; + }, "assert"); + protocolFromUrl = /* @__PURE__ */ __name(function protocolFromUrl2(url) { + var protocol = /^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(url); + if (!protocol) { + return "_relative"; + } + if (protocol[2] !== ":") { + return null; } - var x01 = r1 * cos(a01), y01 = r1 * sin(a01), x10 = r0 * cos(a10), y10 = r0 * sin(a10); - if (rc > epsilon) { - var x11 = r1 * cos(a11), y11 = r1 * sin(a11), x00 = r0 * cos(a00), y00 = r0 * sin(a00), oc; - if (da < pi && (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$1(rc, (r0 - lc) / (kc - 1)); - rc1 = min$1(rc, (r1 - lc) / (kc + 1)); - } - } - if (!(da1 > epsilon)) - context.moveTo(x01, y01); - else if (rc1 > epsilon) { - 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) || !(da0 > epsilon)) - context.lineTo(x10, y10); - else if (rc0 > epsilon) { - 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); + if (!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(protocol[1])) { + return null; + } + 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"; + } + } + 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; } - } 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 / 2; - return [cos(a) * r, sin(a) * r]; - }; - arc.innerRadius = function(_2) { - return arguments.length ? (innerRadius = typeof _2 === "function" ? _2 : constant$1(+_2), arc) : innerRadius; - }; - arc.outerRadius = function(_2) { - return arguments.length ? (outerRadius = typeof _2 === "function" ? _2 : constant$1(+_2), arc) : outerRadius; - }; - arc.cornerRadius = function(_2) { - return arguments.length ? (cornerRadius = typeof _2 === "function" ? _2 : constant$1(+_2), arc) : cornerRadius; - }; - arc.padRadius = function(_2) { - return arguments.length ? (padRadius = _2 == null ? null : typeof _2 === "function" ? _2 : constant$1(+_2), arc) : padRadius; - }; - arc.startAngle = function(_2) { - return arguments.length ? (startAngle = typeof _2 === "function" ? _2 : constant$1(+_2), arc) : startAngle; - }; - arc.endAngle = function(_2) { - return arguments.length ? (endAngle = typeof _2 === "function" ? _2 : constant$1(+_2), arc) : endAngle; - }; - arc.padAngle = function(_2) { - return arguments.length ? (padAngle = typeof _2 === "function" ? _2 : constant$1(+_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(p) { - return p[0]; - } - function y(p) { - return p[1]; - } - function line$1(x$1, y$1) { - var defined = constant$1(true), context = null, curve = curveLinear, output = null; - x$1 = typeof x$1 === "function" ? x$1 : x$1 === void 0 ? x : constant$1(x$1); - y$1 = typeof y$1 === "function" ? y$1 : y$1 === void 0 ? y : constant$1(y$1); - function line2(data) { - var i2, n = (data = array(data)).length, d, defined0 = false, buffer; - if (context == null) - output = curve(buffer = path()); - 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(+x$1(d, i2, data), +y$1(d, i2, data)); - } - if (buffer) - return output = null, buffer + "" || null; - } - line2.x = function(_2) { - return arguments.length ? (x$1 = typeof _2 === "function" ? _2 : constant$1(+_2), line2) : x$1; - }; - line2.y = function(_2) { - return arguments.length ? (y$1 = typeof _2 === "function" ? _2 : constant$1(+_2), line2) : y$1; - }; - line2.defined = function(_2) { - return arguments.length ? (defined = typeof _2 === "function" ? _2 : constant$1(!!_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 value = identity$1, sortValues = descending, sort2 = null, startAngle = constant$1(0), endAngle = constant$1(tau), padAngle = constant$1(0); - function pie2(data) { - var i2, n = (data = array(data)).length, j, k, sum = 0, index = new Array(n), arcs = new Array(n), a0 = +startAngle.apply(this, arguments), da = Math.min(tau, Math.max(-tau, 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[index[i2] = i2] = +value(data[i2], i2, data)) > 0) { - sum += v; } - } - if (sortValues != null) - index.sort(function(i3, j2) { - return sortValues(arcs[i3], arcs[j2]); - }); - else if (sort2 != null) - index.sort(function(i3, j2) { - return sort2(data[i3], data[j2]); - }); - for (i2 = 0, k = sum ? (da - n * pa) / sum : 0; i2 < n; ++i2, a0 = a1) { - j = index[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 - }; - } - return arcs; - } - pie2.value = function(_2) { - return arguments.length ? (value = typeof _2 === "function" ? _2 : constant$1(+_2), pie2) : value; - }; - 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$1(+_2), pie2) : startAngle; - }; - pie2.endAngle = function(_2) { - return arguments.length ? (endAngle = typeof _2 === "function" ? _2 : constant$1(+_2), pie2) : endAngle; - }; - pie2.padAngle = function(_2) { - return arguments.length ? (padAngle = typeof _2 === "function" ? _2 : constant$1(+_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; + /** + * 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(id27, size5, cramped) { + this.id = void 0; + this.size = void 0; + this.cramped = void 0; + this.id = id27; + 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 ""; } - 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; + }, "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); } - } - 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$4(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$4(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$4(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; + /** + * 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) + }); + } } - 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; + /** + * 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()); } - case 3: { - this.point(this._x2, this._y2); - this.point(this._x3, this._y3); - this.point(this._x4, this._y4); - break; + /** + * 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] + }); + } } - } - }, - 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$4(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$4(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, t4; - while (++i2 <= j) { - t4 = i2 / j; - this._basis.point( - this._beta * x2[i2] + (1 - this._beta) * (x0 + t4 * dx), - this._beta * y2[i2] + (1 - this._beta) * (y0 + t4 * dy) - ); + /** + * 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 + }); + } } - } - 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$3(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$3(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$3(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; + /** + * 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 + }); } - case 2: { - this._context.lineTo(this._x3, this._y3); - this._context.closePath(); - break; + /** + * Create a new options object with the given color. + */ + withColor(color2) { + return this.extend({ + color: color2 + }); } - case 3: { - this.point(this._x3, this._y3); - this.point(this._x4, this._y4); - this.point(this._x5, this._y5); - break; + /** + * Create a new options object with "phantom" set to true. + */ + withPhantom() { + return this.extend({ + phantom: true + }); } - } - }, - 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$3(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$3(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$2(that, x2, y2) { - var x1 = that._x1, y1 = that._y1, x22 = that._x2, y22 = that._y2; - if (that._l01_a > epsilon) { - 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) { - 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$2(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; + /** + * Creates a new options object with the given math font or old text font. + * @type {[type]} + */ + withFont(font) { + return this.extend({ + font + }); } - case 2: { - this._context.lineTo(this._x3, this._y3); - this._context.closePath(); - break; + /** + * Create a new options objects with the given fontFamily. + */ + withTextFontFamily(fontFamily) { + return this.extend({ + fontFamily, + font: "" + }); } - case 3: { - this.point(this._x3, this._y3); - this.point(this._x4, this._y4); - this.point(this._x5, this._y5); - break; + /** + * Creates a new options object with the given font weight + */ + withTextFontWeight(fontWeight) { + return this.extend({ + fontWeight, + font: "" + }); } - } - }, - 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$2(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$2(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, t4) { - var h = that._x1 - that._x0; - return h ? (3 * (that._y1 - that._y0) / h - t4) / 2 : t4; - } - function point$1(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$1(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$1(this, slope2(this, t12 = slope3(this, x2, y2)), t12); - break; - default: - point$1(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]); + /** + * 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"); + calculateSize2 = /* @__PURE__ */ __name(function calculateSize3(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 { - 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]); + 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 (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, t4) { - this._context = context; - this._t = t4; - } - 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); + 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 { - var x1 = this._x * (1 - this._t) + x2 * this._t; - this._context.lineTo(x1, this._y); - this._context.lineTo(x1, y2); + 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; } - 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.2 | (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.2/LICENSE */ - const { - entries, - setPrototypeOf, - isFrozen, - getPrototypeOf, - getOwnPropertyDescriptor - } = Object; - let { - freeze, - seal, - create - } = Object; - let { - apply: apply$2, - construct - } = typeof Reflect !== "undefined" && Reflect; - if (!apply$2) { - apply$2 = function apply2(fun, thisValue, args) { - return fun.apply(thisValue, args); - }; - } - if (!freeze) { - freeze = function freeze2(x2) { - return x2; - }; - } - if (!seal) { - seal = function seal2(x2) { - return x2; - }; - } - 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 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, transformCaseFunc) { - transformCaseFunc = transformCaseFunc ? transformCaseFunc : stringToLowerCase; - if (setPrototypeOf) { - setPrototypeOf(set2, null); - } - let l = array2.length; - while (l--) { - let element = array2[l]; - if (typeof element === "string") { - const lcElement = transformCaseFunc(element); - if (lcElement !== element) { - if (!isFrozen(array2)) { - array2[l] = lcElement; + }; + 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()); } - element = lcElement; + return node2; } - } - set2[element] = true; - } - return set2; - } - function clone$2(object2) { - const newObject = create(null); - for (const [property2, value] of entries(object2)) { - newObject[property2] = value; - } - return newObject; - } - function lookupGetter(object2, prop) { - while (object2 !== null) { - const desc = getOwnPropertyDescriptor(object2, prop); - if (desc) { - if (desc.get) { - return unapply(desc.get); + toMarkup() { + var markup = '/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 = () => typeof window === "undefined" ? null : window; - const _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTypes, document2) { - if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") { - return null; - } - let suffix = null; - const ATTR_NAME = "data-tt-policy-suffix"; - if (document2.currentScript && document2.currentScript.hasAttribute(ATTR_NAME)) { - suffix = document2.currentScript.getAttribute(ATTR_NAME); - } - const policyName = "dompurify" + (suffix ? "#" + suffix : ""); - try { - return trustedTypes.createPolicy(policyName, { - createHTML(html2) { - return html2; - }, - createScriptURL(scriptUrl) { - return scriptUrl; + constructor(pathName, alternate) { + this.pathName = void 0; + this.alternate = void 0; + this.pathName = pathName; + this.alternate = alternate; } - }); - } 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.2"; - DOMPurify.removed = []; - if (!window2 || !window2.document || window2.document.nodeType !== 9) { - DOMPurify.isSupported = false; - return DOMPurify; - } - const originalDocument = window2.document; - let { - document: document2 - } = window2; - const { - DocumentFragment, - 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; - } - } - const trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument); - const emptyHTML = trustedTypesPolicy ? trustedTypesPolicy.createHTML("") : ""; - const { - implementation, - createNodeIterator, - createDocumentFragment, - getElementsByTagName - } = document2; - const { - importNode - } = originalDocument; - let hooks = {}; - DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && typeof implementation.createHTMLDocument !== "undefined"; - 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]); - let ALLOWED_ATTR = null; - const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]); - let CUSTOM_ELEMENT_HANDLING = Object.seal(Object.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; - const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"]; - const DEFAULT_PARSER_MEDIA_TYPE = "text/html"; - let transformCaseFunc; - let CONFIG = null; - const formElement = document2.createElement("form"); - const isRegexOrFunction = function isRegexOrFunction2(testValue) { - return testValue instanceof RegExp || testValue instanceof Function; - }; - const _parseConfig = function _parseConfig2(cfg) { - 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 ? PARSER_MEDIA_TYPE = DEFAULT_PARSER_MEDIA_TYPE : PARSER_MEDIA_TYPE = cfg.PARSER_MEDIA_TYPE; - transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase; - ALLOWED_TAGS = "ALLOWED_TAGS" in cfg ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS; - ALLOWED_ATTR = "ALLOWED_ATTR" in cfg ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR; - ALLOWED_NAMESPACES = "ALLOWED_NAMESPACES" in cfg ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES; - URI_SAFE_ATTRIBUTES = "ADD_URI_SAFE_ATTR" in cfg ? 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 = "ADD_DATA_URI_TAGS" in cfg ? 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 = "FORBID_CONTENTS" in cfg ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS; - FORBID_TAGS = "FORBID_TAGS" in cfg ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {}; - FORBID_ATTR = "FORBID_ATTR" in cfg ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {}; - USE_PROFILES = "USE_PROFILES" in cfg ? 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]); - 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 (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); - addToSet(ALL_SVG_TAGS, svgFilters); - addToSet(ALL_SVG_TAGS, svgDisallowed); - const ALL_MATHML_TAGS = addToSet({}, mathMl$1); - addToSet(ALL_MATHML_TAGS, mathMlDisallowed); - const _checkValidNamespace = function _checkValidNamespace2(element) { - let parent = getParentNode(element); - if (!parent || !parent.tagName) { - parent = { - namespaceURI: NAMESPACE, - tagName: "template" + 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 { + throw new ParseError("Unsupported character: " + wideChar2); + } + }, "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) }; - } - const tagName = stringToLowerCase(element.tagName); - const parentTagName = stringToLowerCase(parent.tagName); - if (!ALLOWED_NAMESPACES[element.namespaceURI]) { - return false; - } - if (element.namespaceURI === SVG_NAMESPACE) { - if (parent.namespaceURI === HTML_NAMESPACE) { - return tagName === "svg"; + }, "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 (parent.namespaceURI === MATHML_NAMESPACE) { - return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]); + 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 Boolean(ALL_SVG_TAGS[tagName]); - } - if (element.namespaceURI === MATHML_NAMESPACE) { - if (parent.namespaceURI === HTML_NAMESPACE) { - return tagName === "math"; + return symbolNode; + }, "makeSymbol"); + mathsym = /* @__PURE__ */ __name(function mathsym2(value2, mode, options3, classes6) { + if (classes6 === void 0) { + classes6 = []; } - if (parent.namespaceURI === SVG_NAMESPACE) { - return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName]; + 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"])); } - return Boolean(ALL_MATHML_TAGS[tagName]); - } - if (element.namespaceURI === HTML_NAMESPACE) { - if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) { - return false; + }, "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"); } - if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) { + }, "makeOrd"); + canCombine = /* @__PURE__ */ __name((prev2, next3) => { + if (createClass(prev2.classes) !== createClass(next3.classes) || prev2.skew !== next3.skew || prev2.maxFontSize !== next3.maxFontSize) { 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[element.namespaceURI]) { + 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; - } - 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(name2, node2) { - try { - arrayPush$1(DOMPurify.removed, { - attribute: node2.getAttributeNode(name2), - from: node2 - }); - } catch (_2) { - arrayPush$1(DOMPurify.removed, { - attribute: null, - from: node2 - }); - } - node2.removeAttribute(name2); - if (name2 === "is" && !ALLOWED_ATTR[name2]) { - if (RETURN_DOM || RETURN_DOM_FRAGMENT) { - try { - _forceRemove(node2); - } catch (_2) { + }, "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 { - try { - node2.setAttribute(name2, ""); - } catch (_2) { + 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 + "."); } } - } - }; - const _initDocument = function _initDocument2(dirty) { - let doc; - let leadingWhitespace; - 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) { + 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 = calculateSize2(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); + } } - } - if (!doc || !doc.documentElement) { - doc = implementation.createDocument(NAMESPACE, "template", null); - try { - doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload; - } catch (_2) { + buildCommon.tryCombineChars(groups); + if (!isRealGroup) { + return groups; } - } - 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 _createIterator = function _createIterator2(root2) { - return createNodeIterator.call( - root2.ownerDocument || root2, - root2, - // eslint-disable-next-line no-bitwise - NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, - null, - false - ); - }; - 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 === "object" ? object2 instanceof Node : object2 && typeof object2 === "object" && typeof object2.nodeType === "number" && typeof object2.nodeName === "string"; - }; - 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 content; - _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) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.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] && _basicCustomElementTest(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; + 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]); + } } - 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)); - } + 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); } - _forceRemove(currentNode); - return true; - } - if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) { - _forceRemove(currentNode); - return true; - } - if ((tagName === "noscript" || tagName === "noembed") && regExpTest(/<\/no(script|embed)/i, currentNode.innerHTML)) { - _forceRemove(currentNode); - return true; - } - if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) { - content = currentNode.textContent; - content = stringReplace(content, MUSTACHE_EXPR2, " "); - content = stringReplace(content, ERB_EXPR2, " "); - content = stringReplace(content, TMPLIT_EXPR2, " "); - if (currentNode.textContent !== content) { - arrayPush$1(DOMPurify.removed, { - element: currentNode.cloneNode() - }); - currentNode.textContent = content; + 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++; + } + } + } + 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); } - } - _executeHook("afterSanitizeElements", currentNode, null); - return false; - }; - const _isValidAttribute = function _isValidAttribute2(lcTag, lcName, value) { - if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document2 || value 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 - _basicCustomElementTest(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, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value)) - ) - ; - else { - return false; + if (next3) { + nodes6.pop(); } - } else if (URI_SAFE_ATTRIBUTES[lcName]) - ; - else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE2, ""))) - ; - else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag]) - ; - else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA2, stringReplace(value, ATTR_WHITESPACE2, ""))) - ; - else if (!value) - ; - else { - return false; - } - return true; - }; - const _basicCustomElementTest = function _basicCustomElementTest2(tagName) { - return tagName.indexOf("-") > 0; - }; - const _sanitizeAttributes = function _sanitizeAttributes2(currentNode) { - let attr; - let value; - let lcName; - let l; - _executeHook("beforeSanitizeAttributes", currentNode, null); - const { - attributes - } = currentNode; - if (!attributes) { - return; - } - const hookEvent = { - attrName: "", - attrValue: "", - keepAttr: true, - allowedAttributes: ALLOWED_ATTR - }; - l = attributes.length; - while (l--) { - attr = attributes[l]; - const { - name: name2, - namespaceURI - } = attr; - value = name2 === "value" ? attr.value : stringTrim(attr.value); - lcName = transformCaseFunc(name2); - hookEvent.attrName = lcName; - hookEvent.attrValue = value; - hookEvent.keepAttr = true; - hookEvent.forceKeepAttr = void 0; - _executeHook("uponSanitizeAttribute", currentNode, hookEvent); - value = hookEvent.attrValue; - if (hookEvent.forceKeepAttr) { - continue; + }, "traverseNonSpaceNodes"); + checkPartialGroup = /* @__PURE__ */ __name(function checkPartialGroup2(node2) { + if (node2 instanceof DocumentFragment || node2 instanceof Anchor || node2 instanceof Span && node2.hasClass("enclosing")) { + return node2; } - _removeAttribute(name2, currentNode); - if (!hookEvent.keepAttr) { - continue; + 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 (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) { - _removeAttribute(name2, currentNode); - continue; + 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; } - if (SAFE_FOR_TEMPLATES) { - value = stringReplace(value, MUSTACHE_EXPR2, " "); - value = stringReplace(value, ERB_EXPR2, " "); - value = stringReplace(value, TMPLIT_EXPR2, " "); + /** + * 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; + } } - const lcTag = transformCaseFunc(currentNode.nodeName); - if (!_isValidAttribute(lcTag, lcName, value)) { - continue; + /** + * 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; + } } - if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) { - _removeAttribute(name2, currentNode); - value = SANITIZE_NAMED_PROPS_PREFIX + value; + /** + * Converts the math node into an HTML markup string. + */ + toMarkup() { + if (this.character) { + return "" + this.character + ""; + } else { + return ''; + } } - if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") { - if (namespaceURI) - ; - else { - switch (trustedTypes.getAttributeType(lcTag, lcName)) { - case "TrustedHTML": - value = trustedTypesPolicy.createHTML(value); - break; - case "TrustedScriptURL": - value = trustedTypesPolicy.createScriptURL(value); - break; - } + /** + * Converts the math node into a string, similar to innerText. + */ + toText() { + if (this.character) { + return this.character; + } else { + return " "; } } - try { - if (namespaceURI) { - currentNode.setAttributeNS(namespaceURI, name2, value); + }; + mathMLTree = { + MathNode, + TextNode, + SpaceNode, + newDocumentFragment + }; + 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 { - currentNode.setAttribute(name2, value); + return "sans-serif"; } - arrayPop(DOMPurify.removed); - } catch (_2) { + } 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"; } - } - _executeHook("afterSanitizeAttributes", currentNode, null); - }; - const _sanitizeShadowDOM = function _sanitizeShadowDOM2(fragment) { - let shadowNode; - const shadowIterator = _createIterator(fragment); - _executeHook("beforeSanitizeShadowDOM", fragment, null); - while (shadowNode = shadowIterator.nextNode()) { - _executeHook("uponSanitizeShadowNode", shadowNode, null); - if (_sanitizeElements(shadowNode)) { - continue; + var font = options3.font; + if (!font || font === "mathnormal") { + return null; } - if (shadowNode.content instanceof DocumentFragment) { - _sanitizeShadowDOM2(shadowNode.content); + 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; } - _sanitizeAttributes(shadowNode); - } - _executeHook("afterSanitizeShadowDOM", fragment, null); - }; - DOMPurify.sanitize = function(dirty) { - let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - let body; - let importedNode; - let currentNode; - let returnNode; - IS_EMPTY_INPUT = !dirty; - if (IS_EMPTY_INPUT) { - dirty = ""; - } - if (typeof dirty !== "string" && !_isNode(dirty)) { - if (typeof dirty.toString !== "function") { - throw typeErrorCreate("toString is not a function"); + 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 { - dirty = dirty.toString(); - if (typeof dirty !== "string") { - throw typeErrorCreate("dirty is not a string, aborting"); + 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 { + 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 + }; } } - } - 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"); + __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); + } + 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; + } + }, "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: parser22, + funcName + } = _ref; + var base = args[0]; + return { + type: "accentUnder", + mode: parser22.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: parser22, + funcName + } = _ref; + return { + type: "xArrow", + mode: parser22.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 { + 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; } - } 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; + }); + 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: parser22, + funcName + } = _ref; + var body = args[0]; + return { + type: "mclass", + mode: parser22.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 { - body.appendChild(importedNode); + return "mord"; + } + }, "binrelClass"); + defineFunction({ + type: "mclass", + names: ["\\@binrel"], + props: { + numArgs: 2 + }, + handler(_ref2, args) { + var { + parser: parser22 + } = _ref2; + return { + type: "mclass", + mode: parser22.mode, + mclass: binrelClass(args[0]), + body: ordargument(args[1]), + isCharacterBox: utils.isCharacterBox(args[1]) + }; } - } 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; + }); + defineFunction({ + type: "mclass", + names: ["\\stackrel", "\\overset", "\\underset"], + props: { + numArgs: 2 + }, + handler(_ref3, args) { + var { + parser: parser22, + 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: parser22.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: parser22 + } = _ref; + return { + type: "pmb", + mode: parser22.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; } - body = _initDocument(dirty); - if (!body) { - return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : ""; + }); + cdArrowFunctionName = { + ">": "\\\\cdrightarrow", + "<": "\\\\cdleftarrow", + "=": "\\\\cdlongequal", + "A": "\\uparrow", + "V": "\\downarrow", + "|": "\\Vert", + ".": "no arrow" + }; + newCell = /* @__PURE__ */ __name(() => { + return { + type: "styling", + body: [], + mode: "math", + style: "display" + }; + }, "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: parser22, + funcName + } = _ref; + return { + type: "cdlabel", + mode: parser22.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; } - } - if (body && FORCE_BODY) { - _forceRemove(body.firstChild); - } - const nodeIterator = _createIterator(IN_PLACE ? dirty : body); - while (currentNode = nodeIterator.nextNode()) { - if (_sanitizeElements(currentNode)) { - continue; + }); + defineFunction({ + type: "cdlabelparent", + names: ["\\\\cdparent"], + props: { + numArgs: 1 + }, + handler(_ref2, args) { + var { + parser: parser22 + } = _ref2; + return { + type: "cdlabelparent", + mode: parser22.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)]); } - if (currentNode.content instanceof DocumentFragment) { - _sanitizeShadowDOM(currentNode.content); + }); + defineFunction({ + type: "textord", + names: ["\\@char"], + props: { + numArgs: 1, + allowedInText: true + }, + handler(_ref, args) { + var { + parser: parser22 + } = _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: parser22.mode, + text: text2 + }; } - _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); + }); + 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: parser22 + } = _ref; + var color2 = assertNodeType(args[0], "color-token").color; + var body = args[1]; + return { + type: "color", + mode: parser22.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: parser22, + breakOnTokenText + } = _ref2; + var color2 = assertNodeType(args[0], "color-token").color; + parser22.gullet.macros.set("\\current@color", color2); + var body = parser22.parseExpression(true, breakOnTokenText); + return { + type: "color", + mode: parser22.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: parser22 + } = _ref; + var size5 = parser22.gullet.future().text === "[" ? parser22.parseSizeGroup(true) : null; + var newLine = !parser22.settings.displayMode || !parser22.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline does nothing in display mode"); + return { + type: "cr", + mode: parser22.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(calculateSize2(group2.size, options3)); + } } - } else { - returnNode = body; + 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(calculateSize2(group2.size, options3))); + } + } + return node2; } - if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmod) { - returnNode = importNode.call(originalDocument, returnNode, true); + }); + 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((parser22) => { + var tok = parser22.gullet.popToken(); + if (tok.text === "=") { + tok = parser22.gullet.popToken(); + if (tok.text === " ") { + tok = parser22.gullet.popToken(); + } + } + return tok; + }, "getRHS"); + letCommand = /* @__PURE__ */ __name((parser22, name, tok, global2) => { + var macro = parser22.gullet.macros.get(tok.text); + if (macro == null) { + tok.noexpand = true; + macro = { + tokens: [tok], + numArgs: 0, + // reproduce the same behavior in expansion + unexpandable: !parser22.gullet.isExpandable(tok.text) + }; } - 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) { - serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR2, " "); - serializedHTML = stringReplace(serializedHTML, ERB_EXPR2, " "); - serializedHTML = stringReplace(serializedHTML, TMPLIT_EXPR2, " "); - } - return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML; - }; - DOMPurify.setConfig = function(cfg) { - _parseConfig(cfg); - SET_CONFIG = true; - }; - DOMPurify.clearConfig = function() { - CONFIG = null; - SET_CONFIG = false; - }; - DOMPurify.isValidAttribute = function(tag, attr, value) { - if (!CONFIG) { - _parseConfig({}); - } - const lcTag = transformCaseFunc(tag); - const lcName = transformCaseFunc(attr); - return _isValidAttribute(lcTag, lcName, value); - }; - 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 removeScript = (txt) => { - return purify.sanitize(txt); - }; - const sanitizeMore = (text2, config2) => { - var _a; - if (((_a = config2.flowchart) == null ? void 0 : _a.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$7 = (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$7(a, config2); - } - return a.flat().map((x2) => sanitizeText$7(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 parseGenericTypes = function(text2) { - let cleanedText = text2; - if (text2.split("~").length - 1 >= 2) { - let newCleanedText = cleanedText; - do { - cleanedText = newCleanedText; - newCleanedText = cleanedText.replace(/~([^\s,:;]+)~/, "<$1>"); - } while (newCleanedText != cleanedText); - return parseGenericTypes(newCleanedText); - } else { - return cleanedText; - } - }; - const common$1 = { - getRows, - sanitizeText: sanitizeText$7, - sanitizeTextOrArray, - hasBreaks, - splitBreaks, - lineBreakRegex, - removeScript, - getUrl, - evaluate - }; - 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, t4) => { - if (t4 < 0) - t4 += 1; - if (t4 > 1) - t4 -= 1; - if (t4 < 1 / 6) - return p + (q - p) * 6 * t4; - if (t4 < 1 / 2) - return q; - if (t4 < 2 / 3) - return p + (q - p) * (2 / 3 - t4) * 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 = 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, - 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 name2 in Keyword.colors) { - if (Keyword.colors[name2] === hex2) - return name2; - } - 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 ch = Color$1.parse(color2); - for (const c2 in channels2) { - ch[c2] = _.channel.clamp[c2](channels2[c2]); - } - return Color$1.stringify(ch); - }; - 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 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 ch = Color$1.parse(color2); - const changes = {}; - for (const c2 in channels2) { - if (!channels2[c2]) - continue; - changes[c2] = ch[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() { - 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); + parser22.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: parser22, + funcName + } = _ref; + parser22.consumeSpaces(); + var token2 = parser22.fetch(); + if (globalMap[token2.text]) { + if (funcName === "\\global" || funcName === "\\\\globallong") { + token2.text = globalMap[token2.text]; + } + return assertNodeType(parser22.parseFunction(), "internal"); + } + throw new ParseError("Invalid token after macro prefix", token2); } - } - 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.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.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]; - }); - this.updateColors(); - keys2.forEach((k) => { - this[k] = overrides[k]; - }); - } - }; - 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() { - 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.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]; - }); - this.updateColors(); - keys2.forEach((k) => { - this[k] = overrides[k]; - }); - } - }; - 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() { - 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.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]; }); - this.updateColors(); - keys2.forEach((k) => { - this[k] = overrides[k]; + defineFunction({ + type: "internal", + names: ["\\def", "\\gdef", "\\edef", "\\xdef"], + props: { + numArgs: 0, + allowedInText: true, + primitive: true + }, + handler(_ref2) { + var { + parser: parser22, + funcName + } = _ref2; + var tok = parser22.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 (parser22.gullet.future().text !== "{") { + tok = parser22.gullet.popToken(); + if (tok.text === "#") { + if (parser22.gullet.future().text === "{") { + insert = parser22.gullet.future(); + delimiters2[numArgs].push("{"); + break; + } + tok = parser22.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 + } = parser22.gullet.consumeArg(); + if (insert) { + tokens2.unshift(insert); + } + if (funcName === "\\edef" || funcName === "\\xdef") { + tokens2 = parser22.gullet.expandTokens(tokens2); + tokens2.reverse(); + } + parser22.gullet.macros.set(name, { + tokens: tokens2, + numArgs, + delimiters: delimiters2 + }, funcName === globalMap[funcName]); + return { + type: "internal", + mode: parser22.mode + }; + } }); - } - }; - 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() { - 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.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]; + defineFunction({ + type: "internal", + names: [ + "\\let", + "\\\\globallet" + // can’t be entered directly + ], + props: { + numArgs: 0, + allowedInText: true, + primitive: true + }, + handler(_ref3) { + var { + parser: parser22, + funcName + } = _ref3; + var name = checkControlSequence(parser22.gullet.popToken()); + parser22.gullet.consumeSpaces(); + var tok = getRHS(parser22); + letCommand(parser22, name, tok, funcName === "\\\\globallet"); + return { + type: "internal", + mode: parser22.mode + }; + } }); - this.updateColors(); - keys2.forEach((k) => { - this[k] = overrides[k]; + defineFunction({ + type: "internal", + names: [ + "\\futurelet", + "\\\\globalfuture" + // can’t be entered directly + ], + props: { + numArgs: 0, + allowedInText: true, + primitive: true + }, + handler(_ref4) { + var { + parser: parser22, + funcName + } = _ref4; + var name = checkControlSequence(parser22.gullet.popToken()); + var middle = parser22.gullet.popToken(); + var tok = parser22.gullet.popToken(); + letCommand(parser22, name, tok, funcName === "\\\\globalfuture"); + parser22.gullet.pushToken(tok); + parser22.gullet.pushToken(middle); + return { + type: "internal", + mode: parser22.mode + }; + } }); - } - }; - 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() { - 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); + 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); + } + 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); + } + return span; + }, "makeLargeDelim"); + makeGlyphSpan = /* @__PURE__ */ __name(function makeGlyphSpan2(symbol, font, mode) { + var sizeClass; + if (font === "Size1-Regular") { + sizeClass = "delim-size1"; } 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.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]; - }); - this.updateColors(); - keys2.forEach((k) => { - this[k] = overrides[k]; - }); - } - } - 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 config$1 = { - /** - * Theme , the CSS style sheet - * - * | Parameter | Description | Type | Required | Values | - * | --------- | --------------- | ------ | -------- | ---------------------------------------------- | - * | theme | Built in Themes | string | Optional | 'default', 'forest', 'dark', 'neutral', 'null' | - * - * **Notes:** To disable any pre-defined mermaid theme, use "null". - * - * @example - * - * ```js - * { - * "theme": "forest", - * "themeCSS": ".node rect { fill: red; }" - * } - * ``` - */ - theme: "default", - themeVariables: theme["default"].getThemeVariables(), - themeCSS: void 0, - /* **maxTextSize** - The maximum allowed size of the users text diagram */ - maxTextSize: 5e4, - darkMode: false, - /** - * | Parameter | Description | Type | Required | Values | - * | ---------- | ------------------------------------------------------ | ------ | -------- | --------------------------- | - * | fontFamily | specifies the font to be used in the rendered diagrams | string | Required | Any Possible CSS FontFamily | - * - * **Notes:** Default value: '"trebuchet ms", verdana, arial, sans-serif;'. - */ - fontFamily: '"trebuchet ms", verdana, arial, sans-serif;', - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | ----------------------------------------------------- | ---------------- | -------- | --------------------------------------------- | - * | logLevel | This option decides the amount of logging to be used. | string \| number | Required | 'trace','debug','info','warn','error','fatal' | - * - * **Notes:** - * - * - Trace: 0 - * - Debug: 1 - * - Info: 2 - * - Warn: 3 - * - Error: 4 - * - Fatal: 5 (default) - */ - logLevel: 5, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------- | --------------------------------- | ------ | -------- | ------------------------------------------ | - * | securityLevel | Level of trust for parsed diagram | string | Required | 'sandbox', 'strict', 'loose', 'antiscript' | - * - * **Notes**: - * - * - **strict**: (**default**) tags in text are encoded, click functionality is disabled - * - **loose**: tags in text are allowed, click functionality is enabled - * - **antiscript**: html tags in text are allowed, (only script element is removed), click - * functionality is enabled - * - **sandbox**: With this security level all rendering takes place in a sandboxed iframe. This - * prevent any JavaScript from running in the context. This may hinder interactive functionality - * of the diagram like scripts, popups in sequence diagram or links to other tabs/targets etc. - */ - securityLevel: "strict", - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | -------------------------------------------- | ------- | -------- | ----------- | - * | startOnLoad | Dictates whether mermaid starts on Page load | boolean | Required | true, false | - * - * **Notes:** Default value: true - */ - startOnLoad: true, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------------- | ---------------------------------------------------------------------------- | ------- | -------- | ----------- | - * | arrowMarkerAbsolute | Controls whether or arrow markers in html code are absolute paths or anchors | boolean | Required | true, false | - * - * **Notes**: - * - * This matters if you are using base tag settings. - * - * Default value: false - */ - arrowMarkerAbsolute: false, - /** - * This option controls which currentConfig keys are considered _secure_ and can only be changed - * via call to mermaidAPI.initialize. Calls to mermaidAPI.reinitialize cannot make changes to the - * `secure` keys in the current currentConfig. This prevents malicious graph directives from - * overriding a site's default security. - * - * **Notes**: - * - * Default value: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'] - */ - secure: ["secure", "securityLevel", "startOnLoad", "maxTextSize"], - /** - * This option controls if the generated ids of nodes in the SVG are generated randomly or based - * on a seed. If set to false, the IDs are generated based on the current date and thus are not - * deterministic. This is the default behavior. - * - * **Notes**: - * - * This matters if your files are checked into source control e.g. git and should not change unless - * content is changed. - * - * Default value: false - */ - deterministicIds: false, - /** - * This option is the optional seed for deterministic ids. if set to undefined but - * deterministicIds is true, a simple number iterator is used. You can set this attribute to base - * the seed on a static string. - */ - deterministicIDSeed: void 0, - /** The object containing configurations specific for flowcharts */ - flowchart: { - /** - * ### titleTopMargin - * - * | Parameter | Description | Type | Required | Values | - * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ | - * | titleTopMargin | Margin top for the text over the flowchart | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 25 - */ - titleTopMargin: 25, - /** - * | Parameter | Description | Type | Required | Values | - * | -------------- | ----------------------------------------------- | ------- | -------- | ------------------ | - * | diagramPadding | Amount of padding around the diagram as a whole | Integer | Required | Any Positive Value | - * - * **Notes:** - * - * The amount of padding around the diagram as a whole so that embedded diagrams have margins, - * expressed in pixels - * - * Default value: 8 - */ - diagramPadding: 8, - /** - * | Parameter | Description | Type | Required | Values | - * | ---------- | -------------------------------------------------------------------------------------------- | ------- | -------- | ----------- | - * | htmlLabels | Flag for setting whether or not a html tag should be used for rendering labels on the edges. | boolean | Required | true, false | - * - * **Notes:** Default value: true. - */ - htmlLabels: true, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | --------------------------------------------------- | ------- | -------- | ------------------- | - * | nodeSpacing | Defines the spacing between nodes on the same level | Integer | Required | Any positive Number | - * - * **Notes:** - * - * Pertains to horizontal spacing for TB (top to bottom) or BT (bottom to top) graphs, and the - * vertical spacing for LR as well as RL graphs.** - * - * Default value: 50 - */ - nodeSpacing: 50, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | ----------------------------------------------------- | ------- | -------- | ------------------- | - * | rankSpacing | Defines the spacing between nodes on different levels | Integer | Required | Any Positive Number | - * - * **Notes**: - * - * Pertains to vertical spacing for TB (top to bottom) or BT (bottom to top), and the horizontal - * spacing for LR as well as RL graphs. - * - * Default value 50 - */ - rankSpacing: 50, - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | -------------------------------------------------- | ------ | -------- | ----------------------------- | - * | curve | Defines how mermaid renders curves for flowcharts. | string | Required | 'basis', 'linear', 'cardinal' | - * - * **Notes:** - * - * Default Value: 'basis' - */ - curve: "basis", - // Only used in new experimental rendering - // represents the padding between the labels and the shape - padding: 15, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | ----------- | ------- | -------- | ----------- | - * | useMaxWidth | See notes | boolean | 4 | true, false | - * - * **Notes:** - * - * When this flag is set the height and width is set to 100% and is then scaling with the - * available space if not the absolute space required is used. - * - * Default value: true - */ - useMaxWidth: true, - /** - * | Parameter | Description | Type | Required | Values | - * | --------------- | ----------- | ------- | -------- | ----------------------- | - * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper, elk | - * - * **Notes:** - * - * Decides which rendering engine that is to be used for the rendering. Legal values are: - * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid, elk for layout using - * elkjs - * - * Default value: 'dagre-wrapper' - */ - defaultRenderer: "dagre-wrapper", - /** - * | Parameter | Description | Type | Required | Values | - * | --------------- | ----------- | ------- | -------- | ----------------------- | - * | wrappingWidth | See notes | number | 4 | width of nodes where text is wrapped | - * - * **Notes:** - * - * When using markdown strings the text ius wrapped automatically, this - * value sets the max width of a text before it continues on a new line. - * Default value: 'dagre-wrapper' - */ - wrappingWidth: 200 - }, - /** The object containing configurations specific for sequence diagrams */ - sequence: { - hideUnusedParticipants: false, - /** - * | Parameter | Description | Type | Required | Values | - * | --------------- | ---------------------------- | ------- | -------- | ------------------ | - * | activationWidth | Width of the activation rect | Integer | Required | Any Positive Value | - * - * **Notes:** Default value :10 - */ - activationWidth: 10, - /** - * | Parameter | Description | Type | Required | Values | - * | -------------- | ---------------------------------------------------- | ------- | -------- | ------------------ | - * | diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 50 - */ - diagramMarginX: 50, - /** - * | Parameter | Description | Type | Required | Values | - * | -------------- | ------------------------------------------------- | ------- | -------- | ------------------ | - * | diagramMarginY | Margin to the over and under the sequence diagram | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 10 - */ - diagramMarginY: 10, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | --------------------- | ------- | -------- | ------------------ | - * | actorMargin | Margin between actors | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 50 - */ - actorMargin: 50, - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | -------------------- | ------- | -------- | ------------------ | - * | width | Width of actor boxes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 150 - */ - width: 150, - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | --------------------- | ------- | -------- | ------------------ | - * | height | Height of actor boxes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 65 - */ - height: 65, - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | ------------------------ | ------- | -------- | ------------------ | - * | boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 10 - */ - boxMargin: 10, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------- | -------------------------------------------- | ------- | -------- | ------------------ | - * | boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 5 - */ - boxTextMargin: 5, - /** - * | Parameter | Description | Type | Required | Values | - * | ---------- | ------------------- | ------- | -------- | ------------------ | - * | noteMargin | margin around notes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 10 - */ - noteMargin: 10, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------- | ---------------------- | ------- | -------- | ------------------ | - * | messageMargin | Space between messages | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 35 - */ - messageMargin: 35, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------ | --------------------------- | ------ | -------- | ------------------------- | - * | messageAlign | Multiline message alignment | string | Required | 'left', 'center', 'right' | - * - * **Notes:** Default value: 'center' - */ - messageAlign: "center", - /** - * | Parameter | Description | Type | Required | Values | - * | ------------ | --------------------------- | ------- | -------- | ----------- | - * | mirrorActors | Mirror actors under diagram | boolean | Required | true, false | - * - * **Notes:** Default value: true - */ - mirrorActors: true, - /** - * | Parameter | Description | Type | Required | Values | - * | ---------- | ----------------------------------------------------------------------- | ------- | -------- | ----------- | - * | forceMenus | forces actor popup menus to always be visible (to support E2E testing). | Boolean | Required | True, False | - * - * **Notes:** - * - * Default value: false. - */ - forceMenus: false, - /** - * | Parameter | Description | Type | Required | Values | - * | --------------- | ------------------------------------------ | ------- | -------- | ------------------ | - * | bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | Required | Any Positive Value | - * - * **Notes:** - * - * Depending on css styling this might need adjustment. - * - * Default value: 1 - */ - bottomMarginAdj: 1, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | ----------- | ------- | -------- | ----------- | - * | useMaxWidth | See Notes | boolean | Required | true, false | - * - * **Notes:** When this flag is set to true, the height and width is set to 100% and is then - * scaling with the available space. If set to false, the absolute space required is used. - * - * Default value: true - */ - useMaxWidth: true, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | ------------------------------------ | ------- | -------- | ----------- | - * | rightAngles | display curve arrows as right angles | boolean | Required | true, false | - * - * **Notes:** - * - * This will display arrows that start and begin at the same node as right angles, rather than a - * curve - * - * Default value: false - */ - rightAngles: false, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------------- | ------------------------------- | ------- | -------- | ----------- | - * | showSequenceNumbers | This will show the node numbers | boolean | Required | true, false | - * - * **Notes:** Default value: false - */ - showSequenceNumbers: false, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------- | -------------------------------------------------- | ------- | -------- | ------------------ | - * | actorFontSize | This sets the font size of the actor's description | Integer | Require | Any Positive Value | - * - * **Notes:** **Default value 14**.. - */ - actorFontSize: 14, - /** - * | Parameter | Description | Type | Required | Values | - * | --------------- | ---------------------------------------------------- | ------ | -------- | --------------------------- | - * | actorFontFamily | This sets the font family of the actor's description | string | Required | Any Possible CSS FontFamily | - * - * **Notes:** Default value: "'Open Sans", sans-serif' - */ - actorFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of the actor's description - * - * **Notes:** Default value: 400. - */ - actorFontWeight: 400, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------ | ----------------------------------------------- | ------- | -------- | ------------------ | - * | noteFontSize | This sets the font size of actor-attached notes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 14 - */ - noteFontSize: 14, - /** - * | Parameter | Description | Type | Required | Values | - * | -------------- | -------------------------------------------------- | ------ | -------- | --------------------------- | - * | noteFontFamily | This sets the font family of actor-attached notes. | string | Required | Any Possible CSS FontFamily | - * - * **Notes:** Default value: ''"trebuchet ms", verdana, arial, sans-serif' - */ - noteFontFamily: '"trebuchet ms", verdana, arial, sans-serif', - /** - * This sets the font weight of the note's description - * - * **Notes:** Default value: 400 - */ - noteFontWeight: 400, - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | ---------------------------------------------------- | ------ | -------- | ------------------------- | - * | noteAlign | This sets the text alignment of actor-attached notes | string | required | 'left', 'center', 'right' | - * - * **Notes:** Default value: 'center' - */ - noteAlign: "center", - /** - * | Parameter | Description | Type | Required | Values | - * | --------------- | ----------------------------------------- | ------- | -------- | ------------------- | - * | messageFontSize | This sets the font size of actor messages | Integer | Required | Any Positive Number | - * - * **Notes:** Default value: 16 - */ - messageFontSize: 16, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------------- | ------------------------------------------- | ------ | -------- | --------------------------- | - * | messageFontFamily | This sets the font family of actor messages | string | Required | Any Possible CSS FontFamily | - * - * **Notes:** Default value: '"trebuchet ms", verdana, arial, sans-serif' - */ - messageFontFamily: '"trebuchet ms", verdana, arial, sans-serif', - /** - * This sets the font weight of the message's description - * - * **Notes:** Default value: 400. - */ - messageFontWeight: 400, - /** - * This sets the auto-wrap state for the diagram - * - * **Notes:** Default value: false. - */ - wrap: false, - /** - * This sets the auto-wrap padding for the diagram (sides only) - * - * **Notes:** Default value: 0. - */ - wrapPadding: 10, - /** - * This sets the width of the loop-box (loop, alt, opt, par) - * - * **Notes:** Default value: 50. - */ - labelBoxWidth: 50, - /** - * This sets the height of the loop-box (loop, alt, opt, par) - * - * **Notes:** Default value: 20. - */ - labelBoxHeight: 20, - 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 - }; - } - }, - /** The object containing configurations specific for gantt diagrams */ - gantt: { - /** - * ### titleTopMargin - * - * | Parameter | Description | Type | Required | Values | - * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ | - * | titleTopMargin | Margin top for the text over the gantt diagram | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 25 - */ - titleTopMargin: 25, - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | ----------------------------------- | ------- | -------- | ------------------ | - * | barHeight | The height of the bars in the graph | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 20 - */ - barHeight: 20, - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | ---------------------------------------------------------------- | ------- | -------- | ------------------ | - * | barGap | The margin between the different activities in the gantt diagram | Integer | Optional | Any Positive Value | - * - * **Notes:** Default value: 4 - */ - barGap: 4, - /** - * | Parameter | Description | Type | Required | Values | - * | ---------- | -------------------------------------------------------------------------- | ------- | -------- | ------------------ | - * | topPadding | Margin between title and gantt diagram and between axis and gantt diagram. | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 50 - */ - topPadding: 50, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------ | ----------------------------------------------------------------------- | ------- | -------- | ------------------ | - * | rightPadding | The space allocated for the section name to the right of the activities | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 75 - */ - rightPadding: 75, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | ---------------------------------------------------------------------- | ------- | -------- | ------------------ | - * | leftPadding | The space allocated for the section name to the left of the activities | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 75 - */ - leftPadding: 75, - /** - * | Parameter | Description | Type | Required | Values | - * | -------------------- | -------------------------------------------- | ------- | -------- | ------------------ | - * | gridLineStartPadding | Vertical starting position of the grid lines | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 35 - */ - gridLineStartPadding: 35, - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | ----------- | ------- | -------- | ------------------ | - * | fontSize | Font size | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 11 - */ - fontSize: 11, - /** - * | Parameter | Description | Type | Required | Values | - * | --------------- | ---------------------- | ------- | -------- | ------------------ | - * | sectionFontSize | Font size for sections | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 11 - */ - sectionFontSize: 11, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------------- | ---------------------------------------- | ------- | -------- | ------------------ | - * | numberSectionStyles | The number of alternating section styles | Integer | 4 | Any Positive Value | - * - * **Notes:** Default value: 4 - */ - numberSectionStyles: 4, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | ------------------------- | ------ | -------- | --------- | - * | displayMode | Controls the display mode | string | 4 | 'compact' | - * - * **Notes**: - * - * - **compact**: Enables displaying multiple tasks on the same row. - */ - displayMode: "", - /** - * | Parameter | Description | Type | Required | Values | - * | ---------- | ---------------------------- | ---- | -------- | ---------------- | - * | axisFormat | Date/time format of the axis | 3 | Required | Date in yy-mm-dd | - * - * **Notes:** - * - * This might need adjustment to match your locale and preferences - * - * Default value: '%Y-%m-%d'. - */ - axisFormat: "%Y-%m-%d", - /** - * | Parameter | Description | Type | Required | Values | - * | ------------ | ------------| ------ | -------- | ------- | - * | tickInterval | axis ticks | string | Optional | string | - * - * **Notes:** - * - * Pattern is /^([1-9][0-9]*)(minute|hour|day|week|month)$/ - * - * Default value: undefined - */ - tickInterval: void 0, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | ----------- | ------- | -------- | ----------- | - * | useMaxWidth | See notes | boolean | 4 | true, false | - * - * **Notes:** - * - * When this flag is set the height and width is set to 100% and is then scaling with the - * available space if not the absolute space required is used. - * - * Default value: true - */ - useMaxWidth: true, - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | ----------- | ------- | -------- | ----------- | - * | topAxis | See notes | Boolean | 4 | True, False | - * - * **Notes:** when this flag is set date labels will be added to the top of the chart - * - * **Default value false**. - */ - topAxis: false, - useWidth: void 0 - }, - /** The object containing configurations specific for journey diagrams */ - journey: { - /** - * | Parameter | Description | Type | Required | Values | - * | -------------- | ---------------------------------------------------- | ------- | -------- | ------------------ | - * | diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 50 - */ - diagramMarginX: 50, - /** - * | Parameter | Description | Type | Required | Values | - * | -------------- | -------------------------------------------------- | ------- | -------- | ------------------ | - * | diagramMarginY | Margin to the over and under the sequence diagram. | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 10 - */ - diagramMarginY: 10, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | --------------------- | ------- | -------- | ------------------ | - * | actorMargin | Margin between actors | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 50 - */ - leftMargin: 150, - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | -------------------- | ------- | -------- | ------------------ | - * | width | Width of actor boxes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 150 - */ - width: 150, - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | --------------------- | ------- | -------- | ------------------ | - * | height | Height of actor boxes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 65 - */ - height: 50, - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | ------------------------ | ------- | -------- | ------------------ | - * | boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 10 - */ - boxMargin: 10, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------- | -------------------------------------------- | ------- | -------- | ------------------ | - * | boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 5 - */ - boxTextMargin: 5, - /** - * | Parameter | Description | Type | Required | Values | - * | ---------- | ------------------- | ------- | -------- | ------------------ | - * | noteMargin | Margin around notes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 10 - */ - noteMargin: 10, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------- | ----------------------- | ------- | -------- | ------------------ | - * | messageMargin | Space between messages. | Integer | Required | Any Positive Value | - * - * **Notes:** - * - * Space between messages. - * - * Default value: 35 - */ - messageMargin: 35, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------ | --------------------------- | ---- | -------- | ------------------------- | - * | messageAlign | Multiline message alignment | 3 | 4 | 'left', 'center', 'right' | - * - * **Notes:** Default value: 'center' - */ - messageAlign: "center", - /** - * | Parameter | Description | Type | Required | Values | - * | --------------- | ------------------------------------------ | ------- | -------- | ------------------ | - * | bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | 4 | Any Positive Value | - * - * **Notes:** - * - * Depending on css styling this might need adjustment. - * - * Default value: 1 - */ - bottomMarginAdj: 1, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | ----------- | ------- | -------- | ----------- | - * | useMaxWidth | See notes | boolean | 4 | true, false | - * - * **Notes:** - * - * When this flag is set the height and width is set to 100% and is then scaling with the - * available space if not the absolute space required is used. - * - * Default value: true - */ - useMaxWidth: true, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | --------------------------------- | ---- | -------- | ----------- | - * | rightAngles | Curved Arrows become Right Angles | 3 | 4 | true, false | - * - * **Notes:** - * - * This will display arrows that start and begin at the same node as right angles, rather than a - * curves - * - * Default value: false - */ - rightAngles: false, - taskFontSize: 14, - taskFontFamily: '"Open Sans", sans-serif', - taskMargin: 50, - // width of activation box - activationWidth: 10, - // text placement as: tspan | fo | old only text as before - textPlacement: "fo", - actorColours: ["#8FBC8F", "#7CFC00", "#00FFFF", "#20B2AA", "#B0E0E6", "#FFFFE0"], - sectionFills: ["#191970", "#8B008B", "#4B0082", "#2F4F4F", "#800000", "#8B4513", "#00008B"], - sectionColours: ["#fff"] - }, - /** The object containing configurations specific for timeline diagrams */ - timeline: { - /** - * | Parameter | Description | Type | Required | Values | - * | -------------- | ---------------------------------------------------- | ------- | -------- | ------------------ | - * | diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 50 - */ - diagramMarginX: 50, - /** - * | Parameter | Description | Type | Required | Values | - * | -------------- | -------------------------------------------------- | ------- | -------- | ------------------ | - * | diagramMarginY | Margin to the over and under the sequence diagram. | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 10 - */ - diagramMarginY: 10, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | --------------------- | ------- | -------- | ------------------ | - * | actorMargin | Margin between actors | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 50 - */ - leftMargin: 150, - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | -------------------- | ------- | -------- | ------------------ | - * | width | Width of actor boxes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 150 - */ - width: 150, - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | --------------------- | ------- | -------- | ------------------ | - * | height | Height of actor boxes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 65 - */ - height: 50, - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | ------------------------ | ------- | -------- | ------------------ | - * | boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 10 - */ - boxMargin: 10, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------- | -------------------------------------------- | ------- | -------- | ------------------ | - * | boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 5 - */ - boxTextMargin: 5, - /** - * | Parameter | Description | Type | Required | Values | - * | ---------- | ------------------- | ------- | -------- | ------------------ | - * | noteMargin | Margin around notes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 10 - */ - noteMargin: 10, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------- | ----------------------- | ------- | -------- | ------------------ | - * | messageMargin | Space between messages. | Integer | Required | Any Positive Value | - * - * **Notes:** - * - * Space between messages. - * - * Default value: 35 - */ - messageMargin: 35, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------ | --------------------------- | ---- | -------- | ------------------------- | - * | messageAlign | Multiline message alignment | 3 | 4 | 'left', 'center', 'right' | - * - * **Notes:** Default value: 'center' - */ - messageAlign: "center", - /** - * | Parameter | Description | Type | Required | Values | - * | --------------- | ------------------------------------------ | ------- | -------- | ------------------ | - * | bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | 4 | Any Positive Value | - * - * **Notes:** - * - * Depending on css styling this might need adjustment. - * - * Default value: 1 - */ - bottomMarginAdj: 1, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | ----------- | ------- | -------- | ----------- | - * | useMaxWidth | See notes | boolean | 4 | true, false | - * - * **Notes:** - * - * When this flag is set the height and width is set to 100% and is then scaling with the - * available space if not the absolute space required is used. - * - * Default value: true - */ - useMaxWidth: true, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | --------------------------------- | ---- | -------- | ----------- | - * | rightAngles | Curved Arrows become Right Angles | 3 | 4 | true, false | - * - * **Notes:** - * - * This will display arrows that start and begin at the same node as right angles, rather than a - * curves - * - * Default value: false - */ - rightAngles: false, - taskFontSize: 14, - taskFontFamily: '"Open Sans", sans-serif', - taskMargin: 50, - // width of activation box - activationWidth: 10, - // text placement as: tspan | fo | old only text as before - textPlacement: "fo", - actorColours: ["#8FBC8F", "#7CFC00", "#00FFFF", "#20B2AA", "#B0E0E6", "#FFFFE0"], - sectionFills: ["#191970", "#8B008B", "#4B0082", "#2F4F4F", "#800000", "#8B4513", "#00008B"], - sectionColours: ["#fff"], - disableMulticolor: false - }, - class: { - /** - * ### titleTopMargin - * - * | Parameter | Description | Type | Required | Values | - * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ | - * | titleTopMargin | Margin top for the text over the class diagram | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 25 - */ - titleTopMargin: 25, - arrowMarkerAbsolute: false, - dividerMargin: 10, - padding: 5, - textHeight: 10, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | ----------- | ------- | -------- | ----------- | - * | useMaxWidth | See notes | boolean | 4 | true, false | - * - * **Notes:** - * - * When this flag is set the height and width is set to 100% and is then scaling with the - * available space if not the absolute space required is used. - * - * Default value: true - */ - useMaxWidth: true, - /** - * | Parameter | Description | Type | Required | Values | - * | --------------- | ----------- | ------- | -------- | ----------------------- | - * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper | - * - * **Notes**: - * - * Decides which rendering engine that is to be used for the rendering. Legal values are: - * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid - * - * Default value: 'dagre-d3' - */ - defaultRenderer: "dagre-wrapper" - }, - state: { - /** - * ### titleTopMargin - * - * | Parameter | Description | Type | Required | Values | - * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ | - * | titleTopMargin | Margin top for the text over the state diagram | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 25 - */ - titleTopMargin: 25, - dividerMargin: 10, - sizeUnit: 5, - padding: 8, - textHeight: 10, - titleShift: -15, - noteMargin: 10, - forkWidth: 70, - forkHeight: 7, - // Used - miniPadding: 2, - // Font size factor, this is used to guess the width of the edges labels before rendering by dagre - // layout. This might need updating if/when switching font - fontSizeFactor: 5.02, - fontSize: 24, - labelHeight: 16, - edgeLengthFactor: "20", - compositTitleSize: 35, - radius: 5, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | ----------- | ------- | -------- | ----------- | - * | useMaxWidth | See notes | boolean | 4 | true, false | - * - * **Notes:** - * - * When this flag is set the height and width is set to 100% and is then scaling with the - * available space if not the absolute space required is used. - * - * Default value: true - */ - useMaxWidth: true, - /** - * | Parameter | Description | Type | Required | Values | - * | --------------- | ----------- | ------- | -------- | ----------------------- | - * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper | - * - * **Notes:** - * - * Decides which rendering engine that is to be used for the rendering. Legal values are: - * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid - * - * Default value: 'dagre-d3' - */ - defaultRenderer: "dagre-wrapper" - }, - /** The object containing configurations specific for entity relationship diagrams */ - er: { - /** - * ### titleTopMargin - * - * | Parameter | Description | Type | Required | Values | - * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ | - * | titleTopMargin | Margin top for the text over the diagram | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 25 - */ - titleTopMargin: 25, - /** - * | Parameter | Description | Type | Required | Values | - * | -------------- | ----------------------------------------------- | ------- | -------- | ------------------ | - * | diagramPadding | Amount of padding around the diagram as a whole | Integer | Required | Any Positive Value | - * - * **Notes:** - * - * The amount of padding around the diagram as a whole so that embedded diagrams have margins, - * expressed in pixels - * - * Default value: 20 - */ - diagramPadding: 20, - /** - * | Parameter | Description | Type | Required | Values | - * | --------------- | ---------------------------------------- | ------ | -------- | ---------------------- | - * | layoutDirection | Directional bias for layout of entities. | string | Required | "TB", "BT", "LR", "RL" | - * - * **Notes:** - * - * 'TB' for Top-Bottom, 'BT'for Bottom-Top, 'LR' for Left-Right, or 'RL' for Right to Left. - * - * T = top, B = bottom, L = left, and R = right. - * - * Default value: 'TB' - */ - layoutDirection: "TB", - /** - * | Parameter | Description | Type | Required | Values | - * | -------------- | ---------------------------------- | ------- | -------- | ------------------ | - * | minEntityWidth | The minimum width of an entity box | Integer | Required | Any Positive Value | - * - * **Notes:** Expressed in pixels. Default value: 100 - */ - minEntityWidth: 100, - /** - * | Parameter | Description | Type | Required | Values | - * | --------------- | ----------------------------------- | ------- | -------- | ------------------ | - * | minEntityHeight | The minimum height of an entity box | Integer | 4 | Any Positive Value | - * - * **Notes:** Expressed in pixels Default value: 75 - */ - minEntityHeight: 75, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------- | ------------------------------------------------------------ | ------- | -------- | ------------------ | - * | entityPadding | Minimum internal padding between text in box and box borders | Integer | 4 | Any Positive Value | - * - * **Notes:** - * - * The minimum internal padding between text in an entity box and the enclosing box borders, - * expressed in pixels. - * - * Default value: 15 - */ - entityPadding: 15, - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | ----------------------------------- | ------ | -------- | -------------------- | - * | stroke | Stroke color of box edges and lines | string | 4 | Any recognized color | - * - * **Notes:** Default value: 'gray' - */ - stroke: "gray", - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | -------------------------- | ------ | -------- | -------------------- | - * | fill | Fill color of entity boxes | string | 4 | Any recognized color | - * - * **Notes:** Default value: 'honeydew' - */ - fill: "honeydew", - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | ------------------- | ------- | -------- | ------------------ | - * | fontSize | Font Size in pixels | Integer | | Any Positive Value | - * - * **Notes:** - * - * Font size (expressed as an integer representing a number of pixels) Default value: 12 - */ - fontSize: 12, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | ----------- | ------- | -------- | ----------- | - * | useMaxWidth | See Notes | boolean | Required | true, false | - * - * **Notes:** - * - * When this flag is set to true, the diagram width is locked to 100% and scaled based on - * available space. If set to false, the diagram reserves its absolute width. - * - * Default value: true - */ - useMaxWidth: true - }, - /** The object containing configurations specific for pie diagrams */ - pie: { - useWidth: void 0, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | ----------- | ------- | -------- | ----------- | - * | useMaxWidth | See Notes | boolean | Required | true, false | - * - * **Notes:** - * - * When this flag is set to true, the diagram width is locked to 100% and scaled based on - * available space. If set to false, the diagram reserves its absolute width. - * - * Default value: true - */ - useMaxWidth: true, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------ | -------------------------------------------------------------------------------- | ------- | -------- | ------------------- | - * | textPosition | Axial position of slice's label from zero at the center to 1 at the outside edge | Number | Optional | Decimal from 0 to 1 | - * - * **Notes:** Default value: 0.75 - */ - textPosition: 0.75 - }, - /** The object containing configurations specific for req diagrams */ - requirement: { - useWidth: void 0, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | ----------- | ------- | -------- | ----------- | - * | useMaxWidth | See Notes | boolean | Required | true, false | - * - * **Notes:** - * - * When this flag is set to true, the diagram width is locked to 100% and scaled based on - * available space. If set to false, the diagram reserves its absolute width. - * - * Default value: true - */ - 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 - }, - gitGraph: { - /** - * ### titleTopMargin - * - * | Parameter | Description | Type | Required | Values | - * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ | - * | titleTopMargin | Margin top for the text over the Git diagram | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 25 - */ - titleTopMargin: 25, - diagramPadding: 8, - nodeLabel: { - width: 75, - height: 100, - x: -25, - y: 0 - }, - mainBranchName: "main", - mainBranchOrder: 0, - showCommitLabel: true, - showBranches: true, - rotateCommitLabel: true - }, - /** The object containing configurations specific for c4 diagrams */ - c4: { - useWidth: void 0, - /** - * | Parameter | Description | Type | Required | Values | - * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ | - * | diagramMarginX | Margin to the right and left of the c4 diagram | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 50 - */ - diagramMarginX: 50, - /** - * | Parameter | Description | Type | Required | Values | - * | -------------- | ------------------------------------------- | ------- | -------- | ------------------ | - * | diagramMarginY | Margin to the over and under the c4 diagram | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 10 - */ - diagramMarginY: 10, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------- | --------------------- | ------- | -------- | ------------------ | - * | c4ShapeMargin | Margin between shapes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 50 - */ - c4ShapeMargin: 50, - /** - * | Parameter | Description | Type | Required | Values | - * | -------------- | ---------------------- | ------- | -------- | ------------------ | - * | c4ShapePadding | Padding between shapes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 20 - */ - c4ShapePadding: 20, - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | --------------------- | ------- | -------- | ------------------ | - * | width | Width of person boxes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 216 - */ - width: 216, - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | ---------------------- | ------- | -------- | ------------------ | - * | height | Height of person boxes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 60 - */ - height: 60, - /** - * | Parameter | Description | Type | Required | Values | - * | --------- | ------------------- | ------- | -------- | ------------------ | - * | boxMargin | Margin around boxes | Integer | Required | Any Positive Value | - * - * **Notes:** Default value: 10 - */ - boxMargin: 10, - /** - * | Parameter | Description | Type | Required | Values | - * | ----------- | ----------- | ------- | -------- | ----------- | - * | useMaxWidth | See Notes | boolean | Required | true, false | - * - * **Notes:** When this flag is set to true, the height and width is set to 100% and is then - * scaling with the available space. If set to false, the absolute space required is used. - * - * Default value: true - */ - useMaxWidth: true, - /** - * | Parameter | Description | Type | Required | Values | - * | ------------ | ----------- | ------- | -------- | ------------------ | - * | c4ShapeInRow | See Notes | Integer | Required | Any Positive Value | - * - * **Notes:** How many shapes to place in each row. - * - * Default value: 4 - */ - c4ShapeInRow: 4, - nextLinePaddingX: 0, - /** - * | Parameter | Description | Type | Required | Values | - * | --------------- | ----------- | ------- | -------- | ------------------ | - * | c4BoundaryInRow | See Notes | Integer | Required | Any Positive Value | - * - * **Notes:** How many boundaries to place in each row. - * - * Default value: 2 - */ - c4BoundaryInRow: 2, - /** - * This sets the font size of Person shape for the diagram - * - * **Notes:** Default value: 14. - */ - personFontSize: 14, - /** - * This sets the font family of Person shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - personFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of Person shape for the diagram - * - * **Notes:** Default value: normal. - */ - personFontWeight: "normal", - /** - * This sets the font size of External Person shape for the diagram - * - * **Notes:** Default value: 14. - */ - external_personFontSize: 14, - /** - * This sets the font family of External Person shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - external_personFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of External Person shape for the diagram - * - * **Notes:** Default value: normal. - */ - external_personFontWeight: "normal", - /** - * This sets the font size of System shape for the diagram - * - * **Notes:** Default value: 14. - */ - systemFontSize: 14, - /** - * This sets the font family of System shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - systemFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of System shape for the diagram - * - * **Notes:** Default value: normal. - */ - systemFontWeight: "normal", - /** - * This sets the font size of External System shape for the diagram - * - * **Notes:** Default value: 14. - */ - external_systemFontSize: 14, - /** - * This sets the font family of External System shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - external_systemFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of External System shape for the diagram - * - * **Notes:** Default value: normal. - */ - external_systemFontWeight: "normal", - /** - * This sets the font size of System DB shape for the diagram - * - * **Notes:** Default value: 14. - */ - system_dbFontSize: 14, - /** - * This sets the font family of System DB shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - system_dbFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of System DB shape for the diagram - * - * **Notes:** Default value: normal. - */ - system_dbFontWeight: "normal", - /** - * This sets the font size of External System DB shape for the diagram - * - * **Notes:** Default value: 14. - */ - external_system_dbFontSize: 14, - /** - * This sets the font family of External System DB shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - external_system_dbFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of External System DB shape for the diagram - * - * **Notes:** Default value: normal. - */ - external_system_dbFontWeight: "normal", - /** - * This sets the font size of System Queue shape for the diagram - * - * **Notes:** Default value: 14. - */ - system_queueFontSize: 14, - /** - * This sets the font family of System Queue shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - system_queueFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of System Queue shape for the diagram - * - * **Notes:** Default value: normal. - */ - system_queueFontWeight: "normal", - /** - * This sets the font size of External System Queue shape for the diagram - * - * **Notes:** Default value: 14. - */ - external_system_queueFontSize: 14, - /** - * This sets the font family of External System Queue shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - external_system_queueFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of External System Queue shape for the diagram - * - * **Notes:** Default value: normal. - */ - external_system_queueFontWeight: "normal", - /** - * This sets the font size of Boundary shape for the diagram - * - * **Notes:** Default value: 14. - */ - boundaryFontSize: 14, - /** - * This sets the font family of Boundary shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - boundaryFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of Boundary shape for the diagram - * - * **Notes:** Default value: normal. - */ - boundaryFontWeight: "normal", - /** - * This sets the font size of Message shape for the diagram - * - * **Notes:** Default value: 12. - */ - messageFontSize: 12, - /** - * This sets the font family of Message shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - messageFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of Message shape for the diagram - * - * **Notes:** Default value: normal. - */ - messageFontWeight: "normal", - /** - * This sets the font size of Container shape for the diagram - * - * **Notes:** Default value: 14. - */ - containerFontSize: 14, - /** - * This sets the font family of Container shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - containerFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of Container shape for the diagram - * - * **Notes:** Default value: normal. - */ - containerFontWeight: "normal", - /** - * This sets the font size of External Container shape for the diagram - * - * **Notes:** Default value: 14. - */ - external_containerFontSize: 14, - /** - * This sets the font family of External Container shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - external_containerFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of External Container shape for the diagram - * - * **Notes:** Default value: normal. - */ - external_containerFontWeight: "normal", - /** - * This sets the font size of Container DB shape for the diagram - * - * **Notes:** Default value: 14. - */ - container_dbFontSize: 14, - /** - * This sets the font family of Container DB shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - container_dbFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of Container DB shape for the diagram - * - * **Notes:** Default value: normal. - */ - container_dbFontWeight: "normal", - /** - * This sets the font size of External Container DB shape for the diagram - * - * **Notes:** Default value: 14. - */ - external_container_dbFontSize: 14, - /** - * This sets the font family of External Container DB shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - external_container_dbFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of External Container DB shape for the diagram - * - * **Notes:** Default value: normal. - */ - external_container_dbFontWeight: "normal", - /** - * This sets the font size of Container Queue shape for the diagram - * - * **Notes:** Default value: 14. - */ - container_queueFontSize: 14, - /** - * This sets the font family of Container Queue shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - container_queueFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of Container Queue shape for the diagram - * - * **Notes:** Default value: normal. - */ - container_queueFontWeight: "normal", - /** - * This sets the font size of External Container Queue shape for the diagram - * - * **Notes:** Default value: 14. - */ - external_container_queueFontSize: 14, - /** - * This sets the font family of External Container Queue shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - external_container_queueFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of External Container Queue shape for the diagram - * - * **Notes:** Default value: normal. - */ - external_container_queueFontWeight: "normal", - /** - * This sets the font size of Component shape for the diagram - * - * **Notes:** Default value: 14. - */ - componentFontSize: 14, - /** - * This sets the font family of Component shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - componentFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of Component shape for the diagram - * - * **Notes:** Default value: normal. - */ - componentFontWeight: "normal", - /** - * This sets the font size of External Component shape for the diagram - * - * **Notes:** Default value: 14. - */ - external_componentFontSize: 14, - /** - * This sets the font family of External Component shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - external_componentFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of External Component shape for the diagram - * - * **Notes:** Default value: normal. - */ - external_componentFontWeight: "normal", - /** - * This sets the font size of Component DB shape for the diagram - * - * **Notes:** Default value: 14. - */ - component_dbFontSize: 14, - /** - * This sets the font family of Component DB shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - component_dbFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of Component DB shape for the diagram - * - * **Notes:** Default value: normal. - */ - component_dbFontWeight: "normal", - /** - * This sets the font size of External Component DB shape for the diagram - * - * **Notes:** Default value: 14. - */ - external_component_dbFontSize: 14, - /** - * This sets the font family of External Component DB shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - external_component_dbFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of External Component DB shape for the diagram - * - * **Notes:** Default value: normal. - */ - external_component_dbFontWeight: "normal", - /** - * This sets the font size of Component Queue shape for the diagram - * - * **Notes:** Default value: 14. - */ - component_queueFontSize: 14, - /** - * This sets the font family of Component Queue shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - component_queueFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of Component Queue shape for the diagram - * - * **Notes:** Default value: normal. - */ - component_queueFontWeight: "normal", - /** - * This sets the font size of External Component Queue shape for the diagram - * - * **Notes:** Default value: 14. - */ - external_component_queueFontSize: 14, - /** - * This sets the font family of External Component Queue shape for the diagram - * - * **Notes:** Default value: "Open Sans", sans-serif. - */ - external_component_queueFontFamily: '"Open Sans", sans-serif', - /** - * This sets the font weight of External Component Queue shape for the diagram - * - * **Notes:** Default value: normal. - */ - external_component_queueFontWeight: "normal", - /** - * This sets the auto-wrap state for the diagram - * - * **Notes:** Default value: true. - */ - wrap: true, - /** - * This sets the auto-wrap padding for the diagram (sides only) - * - * **Notes:** Default value: 0. - */ - wrapPadding: 10, - 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() { + sizeClass = "delim-size4"; + } + var corner = buildCommon.makeSpan(["delimsizinginner", sizeClass], [buildCommon.makeSpan([], [buildCommon.makeSymbol(symbol, font, mode)])]); return { - fontFamily: this.external_component_queueFontFamily, - fontSize: this.external_component_queueFontSize, - fontWeight: this.external_component_queueFontWeight + type: "elem", + elem: corner }; - }, - boundaryFont: function() { + }, "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 { - fontFamily: this.boundaryFontFamily, - fontSize: this.boundaryFontSize, - fontWeight: this.boundaryFontWeight + type: "elem", + elem: span }; - }, - messageFont: function() { + }, "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 _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 { + 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 { - fontFamily: this.messageFontFamily, - fontSize: this.messageFontSize, - fontWeight: this.messageFontWeight + 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 }; - }, - // ' Colors - // ' ################################## - 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" - }, - mindmap: { - useMaxWidth: true, - padding: 10, - maxNodeWidth: 200 - }, - fontSize: 16 - }; - if (config$1.class) { - config$1.class.arrowMarkerAbsolute = config$1.arrowMarkerAbsolute; - } - if (config$1.gitGraph) { - config$1.gitGraph.arrowMarkerAbsolute = config$1.arrowMarkerAbsolute; - } - 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 = keyify(config$1, ""); - const config$2 = config$1; - /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ - function isNothing(subject) { - return typeof subject === "undefined" || subject === null; - } - function isObject$1(subject) { - return typeof subject === "object" && subject !== null; - } - function toArray(sequence2) { - if (Array.isArray(sequence2)) - return sequence2; - else if (isNothing(sequence2)) - return []; - return [sequence2]; - } - function extend(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; - } - function repeat(string, count) { - var result = "", cycle; - for (cycle = 0; cycle < count; cycle += 1) { - result += string; - } - return result; - } - function isNegativeZero(number2) { - return number2 === 0 && Number.NEGATIVE_INFINITY === 1 / number2; - } - var isNothing_1 = isNothing; - var isObject_1 = isObject$1; - 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 = "", message2 = exception2.reason || "(unknown reason)"; - if (!exception2.mark) - return message2; - if (exception2.mark.name) { - where += 'in "' + exception2.mark.name + '" '; - } - where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")"; - if (!compact && exception2.mark.snippet) { - where += "\n\n" + exception2.mark.snippet; - } - return message2 + " " + 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 || ""; - } - } - 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 padStart(string, max2) { - return common.repeat(" ", max2 - string.length) + string; - } - 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; - } - } - 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) - 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"; - } - 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; - }); + }, "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 + "'"); + } + }, "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; + } + 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 { + 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)); + } + var node2 = new mathMLTree.MathNode("mo", children2); + if (group2.mclass === "mopen" || group2.mclass === "mclose") { + node2.setAttribute("fence", "true"); + } else { + node2.setAttribute("fence", "false"); + } + node2.setAttribute("stretchy", "true"); + var size5 = makeEm(delimiter.sizeToMaxHeight[group2.size]); + node2.setAttribute("minsize", size5); + node2.setAttribute("maxsize", size5); + return node2; + }, "mathmlBuilder") }); - } - return result; - } - function Type$1(tag, options2) { - options2 = options2 || {}; - Object.keys(options2).forEach(function(name2) { - if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name2) === -1) { - throw new exception('Unknown option "' + name2 + '" 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; - }; - this.construct = options2["construct"] || function(data) { - return data; - }; - 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, name2) { - var result = []; - schema2[name2].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; + __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"); + } + 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 parser22 = context.parser; + ++parser22.leftrightDepth; + var body = parser22.parseExpression(false); + --parser22.leftrightDepth; + parser22.expect("\\right", false); + var right3 = assertNodeType(parser22.parseFunction(), "leftright-right"); + return { + type: "leftright", + mode: parser22.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); + } + } + 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, []); + } + } + } + var rightDelim; + if (group2.right === ".") { + rightDelim = makeNullDelimiter(options3, ["mclose"]); + } else { + 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 = calculateSize2({ + number: 0.6, + unit: "pt" + }, options3); + var clearance = calculateSize2({ + 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 { + 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 (/cancel/.test(label)) { + vlist.height = inner2.height; + vlist.depth = inner2.depth; + } + if (/cancel/.test(label) && !isSingleChar) { + return buildCommon.makeSpan(["mord", "cancel-lap"], [vlist], options3); + } else { + 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; } + if (group2.backgroundColor) { + node2.setAttribute("mathbackground", group2.backgroundColor); + } + return node2; + }, "mathmlBuilder$6"); + defineFunction({ + type: "enclose", + names: ["\\colorbox"], + props: { + numArgs: 2, + allowedInText: true, + argTypes: ["color", "text"] + }, + handler(_ref, args, optArgs) { + var { + parser: parser22, + funcName + } = _ref; + var color2 = assertNodeType(args[0], "color-token").color; + var body = args[1]; + return { + type: "enclose", + mode: parser22.mode, + label: funcName, + backgroundColor: color2, + body + }; + }, + htmlBuilder: htmlBuilder$7, + mathmlBuilder: mathmlBuilder$6 }); - result[newIndex] = currentType; - }); - return result; - } - function compileMap() { - var result = { - scalar: {}, - sequence: {}, - mapping: {}, - fallback: {}, - multi: { - scalar: [], - sequence: [], - mapping: [], - fallback: [] - } - }, index, 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 (index = 0, length2 = arguments.length; index < length2; index += 1) { - arguments[index].forEach(collectType); - } - return result; - } - function Schema$1(definition) { - return this.extend(definition); - } - Schema$1.prototype.extend = function extend2(definition) { - var implicit2 = []; - var explicit = []; - if (definition instanceof type) { - 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 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."); - } - }); - 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 : []; - } - }); - var map$1 = new type("tag:yaml.org,2002:map", { - kind: "mapping", - construct: function(data) { - return data !== null ? data : {}; - } - }); - 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"); - } - function constructYamlNull() { - return null; - } - function isNull(object2) { - return object2 === null; - } - 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 ""; - } - }, - defaultStyle: "lowercase" - }); - 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"); - } - function constructYamlBoolean(data) { - return data === "true" || data === "True" || data === "TRUE"; - } - function isBoolean(object2) { - return Object.prototype.toString.call(object2) === "[object Boolean]"; - } - 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 isHexCode(c2) { - return 48 <= c2 && c2 <= 57 || 65 <= c2 && c2 <= 70 || 97 <= c2 && c2 <= 102; - } - function isOctCode(c2) { - return 48 <= c2 && c2 <= 55; - } - function isDecCode(c2) { - return 48 <= c2 && c2 <= 57; - } - function resolveYamlInteger(data) { - if (data === null) - return false; - var max2 = data.length, index = 0, hasDigits = false, ch; - if (!max2) - return false; - ch = data[index]; - if (ch === "-" || ch === "+") { - ch = data[++index]; - } - if (ch === "0") { - if (index + 1 === max2) - return true; - ch = data[++index]; - if (ch === "b") { - index++; - for (; index < max2; index++) { - ch = data[index]; - if (ch === "_") - continue; - if (ch !== "0" && ch !== "1") - return false; - hasDigits = true; - } - return hasDigits && ch !== "_"; - } - if (ch === "x") { - index++; - for (; index < max2; index++) { - ch = data[index]; - if (ch === "_") - continue; - if (!isHexCode(data.charCodeAt(index))) - return false; - hasDigits = true; + defineFunction({ + type: "enclose", + names: ["\\fcolorbox"], + props: { + numArgs: 3, + allowedInText: true, + argTypes: ["color", "color", "text"] + }, + handler(_ref2, args, optArgs) { + var { + parser: parser22, + 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: parser22.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: parser22 + } = _ref3; + return { + type: "enclose", + mode: parser22.mode, + label: "\\fbox", + body: args[0] + }; } - return hasDigits && ch !== "_"; - } - if (ch === "o") { - index++; - for (; index < max2; index++) { - ch = data[index]; - if (ch === "_") - continue; - if (!isOctCode(data.charCodeAt(index))) - return false; - hasDigits = true; + }); + defineFunction({ + type: "enclose", + names: ["\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\phase"], + props: { + numArgs: 1 + }, + handler(_ref4, args) { + var { + parser: parser22, + funcName + } = _ref4; + var body = args[0]; + return { + type: "enclose", + mode: parser22.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: parser22 + } = _ref5; + return { + type: "enclose", + mode: parser22.mode, + label: "\\angl", + body: args[0] + }; } - return hasDigits && ch !== "_"; - } - } - if (ch === "_") - return false; - for (; index < max2; index++) { - ch = data[index]; - if (ch === "_") - continue; - if (!isDecCode(data.charCodeAt(index))) { - return false; - } - hasDigits = true; - } - if (!hasDigits || ch === "_") - return false; - return true; - } - function constructYamlInteger(data) { - var value = data, sign2 = 1, ch; - if (value.indexOf("_") !== -1) { - value = value.replace(/_/g, ""); - } - ch = value[0]; - if (ch === "-" || ch === "+") { - if (ch === "-") - sign2 = -1; - value = value.slice(1); - ch = value[0]; - } - if (value === "0") - return 0; - if (ch === "0") { - if (value[1] === "b") - return sign2 * parseInt(value.slice(2), 2); - if (value[1] === "x") - return sign2 * parseInt(value.slice(2), 16); - if (value[1] === "o") - return sign2 * parseInt(value.slice(2), 8); - } - return sign2 * parseInt(value, 10); - } - function isInteger(object2) { - return Object.prototype.toString.call(object2) === "[object Number]" && (object2 % 1 === 0 && !common.isNegativeZero(object2)); - } - 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 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; - } - function constructYamlFloat(data) { - var value, sign2; - value = data.replace(/_/g, "").toLowerCase(); - sign2 = value[0] === "-" ? -1 : 1; - if ("+-".indexOf(value[0]) >= 0) { - value = value.slice(1); - } - if (value === ".inf") { - return sign2 === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - } else if (value === ".nan") { - return NaN; - } - return sign2 * parseFloat(value, 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"; - } - } else if (Number.POSITIVE_INFINITY === object2) { - switch (style) { - case "lowercase": - return ".inf"; - case "uppercase": - return ".INF"; - case "camelcase": - return ".Inf"; - } - } else if (Number.NEGATIVE_INFINITY === object2) { - switch (style) { - case "lowercase": - return "-.inf"; - case "uppercase": - return "-.INF"; - case "camelcase": - return "-.Inf"; - } - } 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 constructYamlTimestamp(data) { - var match, year2, month2, day2, hour2, minute2, 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"); - year2 = +match[1]; - month2 = +match[2] - 1; - day2 = +match[3]; - if (!match[4]) { - return new Date(Date.UTC(year2, month2, day2)); - } - hour2 = +match[4]; - minute2 = +match[5]; - second2 = +match[6]; - if (match[7]) { - fraction = match[7].slice(0, 3); - while (fraction.length < 3) { - fraction += "0"; - } - 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(year2, month2, day2, hour2, minute2, second2, fraction)); - if (delta) - date2.setTime(date2.getTime() - delta); - return date2; - } - function representYamlTimestamp(object2) { - return object2.toISOString(); - } - var timestamp = new type("tag:yaml.org,2002:timestamp", { - kind: "scalar", - resolve: resolveYamlTimestamp, - construct: constructYamlTimestamp, - instanceOf: Date, - represent: representYamlTimestamp - }); - function resolveYamlMerge(data) { - return data === "<<" || data === null; - } - var merge$3 = new type("tag:yaml.org,2002:merge", { - kind: "scalar", - resolve: resolveYamlMerge - }); - 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; - } - return bitlen % 8 === 0; - } - 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); - } - 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); - } - return new Uint8Array(result); - } - 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]; - } - 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]; - } - return result; - } - function isBinary(obj) { - return Object.prototype.toString.call(obj) === "[object Uint8Array]"; - } - var binary = new type("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(data) { - if (data === null) - return true; - var objectKeys = [], index, length2, pair, pairKey, pairHasKey, object2 = data; - for (index = 0, length2 = object2.length; index < length2; index += 1) { - pair = object2[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; + }); + _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" ? calculateSize2({ + 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] + }); + } } - } - if (!pairHasKey) - return false; - if (objectKeys.indexOf(pairKey) === -1) - objectKeys.push(pairKey); - else - return false; - } - return true; - } - function constructYamlOmap(data) { - return data !== null ? data : []; - } - 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 index, length2, pair, keys2, result, object2 = data; - result = new Array(object2.length); - for (index = 0, length2 = object2.length; index < length2; index += 1) { - pair = object2[index]; - if (_toString$1.call(pair) !== "[object Object]") - return false; - keys2 = Object.keys(pair); - if (keys2.length !== 1) - return false; - result[index] = [keys2[0], pair[keys2[0]]]; - } - return true; - } - function constructYamlPairs(data) { - if (data === null) - return []; - var index, length2, pair, keys2, result, object2 = data; - result = new Array(object2.length); - for (index = 0, length2 = object2.length; index < length2; index += 1) { - pair = object2[index]; - keys2 = Object.keys(pair); - result[index] = [keys2[0], pair[keys2[0]]]; - } - return result; - } - var pairs = new type("tag:yaml.org,2002:pairs", { - kind: "sequence", - resolve: resolveYamlPairs, - construct: constructYamlPairs - }); - 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; - } - } - return true; - } - function constructYamlSet(data) { - return data !== null ? data : {}; - } - var set$1 = new type("tag:yaml.org,2002:set", { - kind: "mapping", - resolve: resolveYamlSet, - construct: constructYamlSet - }); - var _default = core.extend({ - implicit: [ - timestamp, - merge$3 - ], - explicit: [ - binary, - omap, - pairs, - set$1 - ] - }); - 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; - } - 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; - } - return -1; - } - function escapedHexLen(c2) { - if (c2 === 120) { - return 2; - } - if (c2 === 117) { - return 4; - } - if (c2 === 85) { - return 8; - } - return 0; - } - function fromDecimalCode(c2) { - if (48 <= c2 && c2 <= 57) { - return c2 - 48; - } - 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" : ""; - } - function charFromCodepoint(c2) { - if (c2 <= 65535) { - return String.fromCharCode(c2); - } - return String.fromCharCode( - (c2 - 65536 >> 10) + 55296, - (c2 - 65536 & 1023) + 56320 - ); - } - var simpleEscapeCheck = new Array(256); - var simpleEscapeMap = new Array(256); - for (var i = 0; i < 256; i++) { - simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; - simpleEscapeMap[i] = simpleEscapeSequence(i); - } - 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 generateError(state2, message2) { - 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 - }; - mark.snippet = snippet(mark); - return new exception(message2, mark); - } - function throwError(state2, message2) { - throw generateError(state2, message2); - } - function throwWarning(state2, message2) { - if (state2.onWarning) { - state2.onWarning.call(null, generateError(state2, message2)); - } - } - var directiveHandlers = { - YAML: function handleYamlDirective(state2, name2, 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, name2, 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; - } - }; - 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"); + __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 = calculateSize2(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 + }); } } - } else if (PATTERN_NON_PRINTABLE.test(_result)) { - throwError(state2, "the stream contains non-printable characters"); - } - state2.result += _result; - } - } - function mergeMappings(state2, destination, source, overridableKeys) { - var sourceKeys, key, index, quantity; - if (!common.isObject(source)) { - throwError(state2, "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; - } - } - } - function storeMappingPair(state2, _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(state2, "nested arrays are not supported inside keys"); + 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); } - if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") { - keyNode[index] = "[object Object]"; + if (tagSpans.length === 0) { + return buildCommon.makeSpan(["mord"], [body], options3); + } else { + 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 + }; } - } - } - if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") { - keyNode = "[object Object]"; - } - keyNode = String(keyNode); - if (_result === null) { - _result = {}; - } - if (keyTag === "tag:yaml.org,2002:merge") { - if (Array.isArray(valueNode)) { - for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { - mergeMappings(state2, _result, valueNode[index], 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]; - } - return _result; - } - function readLineBreak(state2) { - var ch; - ch = state2.input.charCodeAt(state2.position); - if (ch === 10) { - state2.position++; - } else if (ch === 13) { - state2.position++; - if (state2.input.charCodeAt(state2.position) === 10) { - state2.position++; - } - } else { - throwError(state2, "a line break is expected"); - } - state2.line += 1; - state2.lineStart = state2.position; - state2.firstTabInLine = -1; - } - function skipSeparationSpace(state2, allowComments, checkIndent) { - var lineBreaks = 0, ch = state2.input.charCodeAt(state2.position); - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - if (ch === 9 && state2.firstTabInLine === -1) { - state2.firstTabInLine = state2.position; - } - ch = state2.input.charCodeAt(++state2.position); - } - if (allowComments && ch === 35) { - do { - ch = state2.input.charCodeAt(++state2.position); - } while (ch !== 10 && ch !== 13 && ch !== 0); - } - if (is_EOL(ch)) { - readLineBreak(state2); - ch = state2.input.charCodeAt(state2.position); - lineBreaks++; - state2.lineIndent = 0; - while (ch === 32) { - state2.lineIndent++; - ch = state2.input.charCodeAt(++state2.position); + 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 + }); + 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 parser22 = context.parser; + parser22.consumeSpaces(); + if (parser22.fetch().text === "[") { + parser22.consume(); + parser22.consumeSpaces(); + colAlign = parser22.fetch().text; + if ("lcr".indexOf(colAlign) === -1) { + throw new ParseError("Expected l or c or r", parser22.nextToken); + } + parser22.consume(); + parser22.consumeSpaces(); + parser22.expect("]"); + parser22.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"); } - } else { - break; - } - } - if (checkIndent !== -1 && lineBreaks !== 0 && state2.lineIndent < checkIndent) { - throwWarning(state2, "deficient indentation"); - } - return lineBreaks; - } - function testDocumentSeparator(state2) { - var _position = state2.position, ch; - ch = state2.input.charCodeAt(_position); - if ((ch === 45 || ch === 46) && ch === state2.input.charCodeAt(_position + 1) && ch === state2.input.charCodeAt(_position + 2)) { - _position += 3; - ch = state2.input.charCodeAt(_position); - if (ch === 0 || is_WS_OR_EOL(ch)) { - return true; - } - } - return false; - } - function writeFoldedLines(state2, count) { - if (count === 1) { - state2.result += " "; - } else if (count > 1) { - state2.result += common.repeat("\n", count - 1); - } - } - function readPlainScalar(state2, nodeIndent, withinFlowCollection) { - var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state2.kind, _result = state2.result, ch; - ch = state2.input.charCodeAt(state2.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 = state2.input.charCodeAt(state2.position + 1); - if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { - return false; - } - } - state2.kind = "scalar"; - state2.result = ""; - captureStart = captureEnd = state2.position; - hasPendingContent = false; - while (ch !== 0) { - if (ch === 58) { - following = state2.input.charCodeAt(state2.position + 1); - if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { - break; + }); + environments = _environments; + defineFunction({ + type: "environment", + names: ["\\begin", "\\end"], + props: { + numArgs: 1, + argTypes: ["text"] + }, + handler(_ref, args) { + var { + parser: parser22, + 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 + } = parser22.parseArguments("\\begin{" + envName + "}", env); + var context = { + mode: parser22.mode, + envName, + parser: parser22 + }; + var result = env.handler(context, _args, optArgs); + parser22.expect("\\end", false); + var endNameToken = parser22.nextToken; + var end2 = assertNodeType(parser22.parseFunction(), "environment"); + if (end2.name !== envName) { + throw new ParseError("Mismatch: \\begin{" + envName + "} matched by \\end{" + end2.name + "}", endNameToken); + } + return result; + } + return { + type: "environment", + mode: parser22.mode, + name: envName, + nameGroup + }; } - } else if (ch === 35) { - preceding = state2.input.charCodeAt(state2.position - 1); - if (is_WS_OR_EOL(preceding)) { - break; + }); + 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: parser22, + funcName + } = _ref; + var body = normalizeArgument(args[0]); + var func = funcName; + if (func in fontAliases) { + func = fontAliases[func]; + } + return { + type: "font", + mode: parser22.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: parser22 + } = _ref2; + var body = args[0]; + var isCharacterBox3 = utils.isCharacterBox(body); + return { + type: "mclass", + mode: parser22.mode, + mclass: binrelClass(body), + body: [{ + type: "font", + mode: parser22.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: parser22, + funcName, + breakOnTokenText + } = _ref3; + var { + mode + } = parser22; + var body = parser22.parseExpression(true, breakOnTokenText); + var style3 = "math" + funcName.slice(1); + return { + type: "font", + mode, + font: style3, + body: { + type: "ordgroup", + mode: parser22.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 = calculateSize2(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; } - } else if (state2.position === state2.lineStart && testDocumentSeparator(state2) || withinFlowCollection && is_FLOW_INDICATOR(ch)) { - break; - } else if (is_EOL(ch)) { - _line = state2.line; - _lineStart = state2.lineStart; - _lineIndent = state2.lineIndent; - skipSeparationSpace(state2, false, -1); - if (state2.lineIndent >= nodeIndent) { - hasPendingContent = true; - ch = state2.input.charCodeAt(state2.position); - continue; + var leftDelim; + var rightDelim; + if (group2.leftDelim == null) { + leftDelim = makeNullDelimiter(options3, ["mopen"]); } else { - state2.position = captureEnd; - state2.line = _line; - state2.lineStart = _lineStart; - state2.lineIndent = _lineIndent; - break; + leftDelim = delimiter.customSizedDelim(group2.leftDelim, delimSize, true, options3.havingStyle(style3), group2.mode, ["mopen"]); } - } - if (hasPendingContent) { - captureSegment(state2, captureStart, captureEnd, false); - writeFoldedLines(state2, state2.line - _line); - captureStart = captureEnd = state2.position; - hasPendingContent = false; - } - if (!is_WHITE_SPACE(ch)) { - captureEnd = state2.position + 1; - } - ch = state2.input.charCodeAt(++state2.position); - } - captureSegment(state2, captureStart, captureEnd, false); - if (state2.result) { - return true; - } - state2.kind = _kind; - state2.result = _result; - return false; - } - function readSingleQuotedScalar(state2, nodeIndent) { - var ch, captureStart, captureEnd; - ch = state2.input.charCodeAt(state2.position); - if (ch !== 39) { - return false; - } - state2.kind = "scalar"; - state2.result = ""; - state2.position++; - captureStart = captureEnd = state2.position; - while ((ch = state2.input.charCodeAt(state2.position)) !== 0) { - if (ch === 39) { - captureSegment(state2, captureStart, state2.position, true); - ch = state2.input.charCodeAt(++state2.position); - if (ch === 39) { - captureStart = state2.position; - state2.position++; - captureEnd = state2.position; + if (group2.continued) { + rightDelim = buildCommon.makeSpan([]); + } else if (group2.rightDelim == null) { + rightDelim = makeNullDelimiter(options3, ["mclose"]); } else { - return true; + 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 = calculateSize2(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: parser22, + 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: parser22.mode, + continued: false, + numer, + denom, + hasBarLine, + leftDelim, + rightDelim, + size: size5, + barSize: null + }; + }, "handler"), + htmlBuilder: htmlBuilder$4, + mathmlBuilder: mathmlBuilder$3 + }); + defineFunction({ + type: "genfrac", + names: ["\\cfrac"], + props: { + numArgs: 2 + }, + handler: /* @__PURE__ */ __name((_ref2, args) => { + var { + parser: parser22, + funcName + } = _ref2; + var numer = args[0]; + var denom = args[1]; + return { + type: "genfrac", + mode: parser22.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: parser22, + 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"); + } + return { + type: "infix", + mode: parser22.mode, + replaceWith, + token: token2 + }; } - } else if (is_EOL(ch)) { - 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"); - } - function readDoubleQuotedScalar(state2, nodeIndent) { - var captureStart, captureEnd, hexLength, hexResult, tmp, ch; - ch = state2.input.charCodeAt(state2.position); - if (ch !== 34) { - return false; - } - state2.kind = "scalar"; - state2.result = ""; - state2.position++; - captureStart = captureEnd = state2.position; - while ((ch = state2.input.charCodeAt(state2.position)) !== 0) { - if (ch === 34) { - captureSegment(state2, captureStart, state2.position, true); - state2.position++; - return true; - } else if (ch === 92) { - captureSegment(state2, captureStart, state2.position, true); - ch = state2.input.charCodeAt(++state2.position); - if (is_EOL(ch)) { - skipSeparationSpace(state2, false, nodeIndent); - } else if (ch < 256 && simpleEscapeCheck[ch]) { - state2.result += simpleEscapeMap[ch]; - state2.position++; - } else if ((tmp = escapedHexLen(ch)) > 0) { - hexLength = tmp; - hexResult = 0; - for (; hexLength > 0; hexLength--) { - ch = state2.input.charCodeAt(++state2.position); - if ((tmp = fromHexCode(ch)) >= 0) { - hexResult = (hexResult << 4) + tmp; - } else { - throwError(state2, "expected hexadecimal character"); + }); + 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: parser22 + } = _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)]; } - state2.result += charFromCodepoint(hexResult); - state2.position++; - } else { - throwError(state2, "unknown escape sequence"); + return { + type: "genfrac", + mode: parser22.mode, + numer, + denom, + continued: false, + hasBarLine, + barSize, + leftDelim, + rightDelim, + size: size5 + }; + }, + htmlBuilder: htmlBuilder$4, + mathmlBuilder: mathmlBuilder$3 + }); + defineFunction({ + type: "infix", + names: ["\\above"], + props: { + numArgs: 1, + argTypes: ["size"], + infix: true + }, + handler(_ref5, args) { + var { + parser: parser22, + funcName, + token: token2 + } = _ref5; + return { + type: "infix", + mode: parser22.mode, + replaceWith: "\\\\abovefrac", + size: assertNodeType(args[0], "size").value, + token: token2 + }; } - captureStart = captureEnd = state2.position; - } else if (is_EOL(ch)) { - 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; - } - } - throwError(state2, "unexpected end of the stream within a double quoted scalar"); - } - 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, ch; - ch = state2.input.charCodeAt(state2.position); - if (ch === 91) { - terminator = 93; - isMapping = false; - _result = []; - } else if (ch === 123) { - terminator = 125; - isMapping = true; - _result = {}; - } else { - return false; - } - if (state2.anchor !== null) { - state2.anchorMap[state2.anchor] = _result; - } - ch = state2.input.charCodeAt(++state2.position); - while (ch !== 0) { - skipSeparationSpace(state2, true, nodeIndent); - ch = state2.input.charCodeAt(state2.position); - if (ch === 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 (ch === 44) { - throwError(state2, "expected the node content, but found ','"); - } - keyTag = keyNode = valueNode = null; - isPair = isExplicitPair = false; - if (ch === 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); - ch = state2.input.charCodeAt(state2.position); - if ((isExplicitPair || state2.line === _line) && ch === 58) { - isPair = true; - ch = 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); - ch = state2.input.charCodeAt(state2.position); - if (ch === 44) { - readNext = true; - ch = state2.input.charCodeAt(++state2.position); - } else { - readNext = false; - } - } - 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, ch; - ch = state2.input.charCodeAt(state2.position); - if (ch === 124) { - folding = false; - } else if (ch === 62) { - folding = true; - } else { - return false; - } - state2.kind = "scalar"; - state2.result = ""; - while (ch !== 0) { - ch = state2.input.charCodeAt(++state2.position); - if (ch === 43 || ch === 45) { - if (CHOMPING_CLIP === chomping) { - chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP; + }); + defineFunction({ + type: "genfrac", + names: ["\\\\abovefrac"], + props: { + numArgs: 3, + argTypes: ["math", "size", "math"] + }, + handler: /* @__PURE__ */ __name((_ref6, args) => { + var { + parser: parser22, + 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: parser22.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 { - throwError(state2, "repeat of a chomping mode identifier"); - } - } else if ((tmp = fromDecimalCode(ch)) >= 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; + 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 { - throwError(state2, "repeat of an indentation width identifier"); - } - } else { - break; - } - } - if (is_WHITE_SPACE(ch)) { - do { - ch = state2.input.charCodeAt(++state2.position); - } while (is_WHITE_SPACE(ch)); - if (ch === 35) { - do { - ch = state2.input.charCodeAt(++state2.position); - } while (!is_EOL(ch) && ch !== 0); - } - } - while (ch !== 0) { - readLineBreak(state2); - state2.lineIndent = 0; - ch = state2.input.charCodeAt(state2.position); - while ((!detectedIndent || state2.lineIndent < textIndent) && ch === 32) { - state2.lineIndent++; - ch = state2.input.charCodeAt(++state2.position); - } - if (!detectedIndent && state2.lineIndent > textIndent) { - textIndent = state2.lineIndent; - } - if (is_EOL(ch)) { - 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"; + 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: parser22, + funcName + } = _ref; + return { + type: "horizBrace", + mode: parser22.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: parser22 + } = _ref; + var body = args[1]; + var href = assertNodeType(args[0], "url").url; + if (!parser22.settings.isTrusted({ + command: "\\href", + url: href + })) { + return parser22.formatUnsupportedCmd("\\href"); + } + return { + type: "href", + mode: parser22.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: parser22 + } = _ref2; + var href = assertNodeType(args[0], "url").url; + if (!parser22.settings.isTrusted({ + command: "\\url", + url: href + })) { + return parser22.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: parser22.mode, + font: "\\texttt", + body: chars + }; + return { + type: "href", + mode: parser22.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: parser22 + } = _ref; + return { + type: "hbox", + mode: parser22.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)); } - break; - } - if (folding) { - if (is_WHITE_SPACE(ch)) { - 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 += " "; + }); + defineFunction({ + type: "html", + names: ["\\htmlClass", "\\htmlId", "\\htmlStyle", "\\htmlData"], + props: { + numArgs: 2, + argTypes: ["raw", "original"], + allowedInText: true + }, + handler: /* @__PURE__ */ __name((_ref, args) => { + var { + parser: parser22, + funcName, + token: token2 + } = _ref; + var value2 = assertNodeType(args[0], "raw").string; + var body = args[1]; + if (parser22.settings.strict) { + parser22.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 (!parser22.settings.isTrusted(trustContext)) { + return parser22.formatUnsupportedCmd(funcName); } + return { + type: "html", + mode: parser22.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: parser22 + } = _ref; + return { + type: "htmlmathml", + mode: parser22.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 { - state2.result += common.repeat("\n", emptyLines); + 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; + } + }, "sizeData"); + defineFunction({ + type: "includegraphics", + names: ["\\includegraphics"], + props: { + numArgs: 1, + numOptionalArgs: 1, + argTypes: ["raw", "url"], + allowedInText: false + }, + handler: /* @__PURE__ */ __name((_ref, args, optArgs) => { + var { + parser: parser22 + } = _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 (!parser22.settings.isTrusted({ + command: "\\includegraphics", + url: src + })) { + return parser22.formatUnsupportedCmd("\\includegraphics"); + } + return { + type: "includegraphics", + mode: parser22.mode, + alt, + width: width3, + height: height2, + totalheight, + src + }; + }, "handler"), + htmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var height2 = calculateSize2(group2.height, options3); + var depth = 0; + if (group2.totalheight.number > 0) { + depth = calculateSize2(group2.totalheight, options3) - height2; + } + var width3 = 0; + if (group2.width.number > 0) { + width3 = calculateSize2(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 = calculateSize2(group2.height, options3); + var depth = 0; + if (group2.totalheight.number > 0) { + depth = calculateSize2(group2.totalheight, options3) - height2; + node2.setAttribute("valign", makeEm(-depth)); + } + node2.setAttribute("height", makeEm(height2 + depth)); + if (group2.width.number > 0) { + var width3 = calculateSize2(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: parser22, + funcName + } = _ref; + var size5 = assertNodeType(args[0], "size"); + if (parser22.settings.strict) { + var mathFunction = funcName[1] === "m"; + var muUnit = size5.value.unit === "mu"; + if (mathFunction) { + if (!muUnit) { + parser22.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " supports only mu units, " + ("not " + size5.value.unit + " units")); + } + if (parser22.mode !== "math") { + parser22.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " works only in math mode"); + } + } else { + if (muUnit) { + parser22.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " doesn't support mu units"); + } + } + } + return { + type: "kern", + mode: parser22.mode, + dimension: size5.value + }; + }, + htmlBuilder(group2, options3) { + return buildCommon.makeGlue(group2.dimension, options3); + }, + mathmlBuilder(group2, options3) { + var dimension = calculateSize2(group2.dimension, options3); + return new mathMLTree.SpaceNode(dimension); } - } else { - state2.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); - } - didReadContent = true; - detectedIndent = true; - emptyLines = 0; - captureStart = state2.position; - while (!is_EOL(ch) && ch !== 0) { - ch = state2.input.charCodeAt(++state2.position); - } - captureSegment(state2, captureStart, state2.position, false); - } - return true; - } - function readBlockSequence(state2, nodeIndent) { - var _line, _tag = state2.tag, _anchor = state2.anchor, _result = [], following, detected = false, ch; - if (state2.firstTabInLine !== -1) - return false; - if (state2.anchor !== null) { - state2.anchorMap[state2.anchor] = _result; - } - ch = state2.input.charCodeAt(state2.position); - while (ch !== 0) { - if (state2.firstTabInLine !== -1) { - state2.position = state2.firstTabInLine; - throwError(state2, "tab characters must not be used in indentation"); - } - if (ch !== 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); - ch = state2.input.charCodeAt(state2.position); - continue; + }); + defineFunction({ + type: "lap", + names: ["\\mathllap", "\\mathrlap", "\\mathclap"], + props: { + numArgs: 1, + allowedInText: true + }, + handler: /* @__PURE__ */ __name((_ref, args) => { + var { + parser: parser22, + funcName + } = _ref; + var body = args[0]; + return { + type: "lap", + mode: parser22.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: parser22 + } = _ref; + var outerMode = parser22.mode; + parser22.switchMode("math"); + var close2 = funcName === "\\(" ? "\\)" : "$"; + var body = parser22.parseExpression(false, close2); + parser22.expect(close2); + parser22.switchMode(outerMode); + return { + type: "styling", + mode: parser22.mode, + style: "text", + body + }; } - } - _line = state2.line; - composeNode(state2, nodeIndent, CONTEXT_BLOCK_IN, false, true); - _result.push(state2.result); - skipSeparationSpace(state2, true, -1); - ch = state2.input.charCodeAt(state2.position); - if ((state2.line === _line || state2.lineIndent > nodeIndent) && ch !== 0) { - throwError(state2, "bad indentation of a sequence entry"); - } else if (state2.lineIndent < nodeIndent) { - break; - } - } - if (detected) { - state2.tag = _tag; - state2.anchor = _anchor; - state2.kind = "sequence"; - state2.result = _result; - return true; - } - return false; - } - 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, ch; - if (state2.firstTabInLine !== -1) - return false; - if (state2.anchor !== null) { - state2.anchorMap[state2.anchor] = _result; - } - ch = state2.input.charCodeAt(state2.position); - while (ch !== 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 ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) { - if (ch === 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"); + }); + 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); } - state2.position += 1; - ch = following; - } else { - _keyLine = state2.line; - _keyLineStart = state2.lineStart; - _keyPos = state2.position; - if (!composeNode(state2, flowIndent, CONTEXT_FLOW_OUT, false, true)) { - break; + }); + 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; + } + }, "chooseMathStyle"); + defineFunction({ + type: "mathchoice", + names: ["\\mathchoice"], + props: { + numArgs: 4, + primitive: true + }, + handler: /* @__PURE__ */ __name((_ref, args) => { + var { + parser: parser22 + } = _ref; + return { + type: "mathchoice", + mode: parser22.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 (state2.line === _line) { - ch = state2.input.charCodeAt(state2.position); - while (is_WHITE_SPACE(ch)) { - ch = state2.input.charCodeAt(++state2.position); - } - if (ch === 58) { - ch = state2.input.charCodeAt(++state2.position); - if (!is_WS_OR_EOL(ch)) { - 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"); + 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 { + 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 { - state2.tag = _tag; - state2.anchor = _anchor; - return true; + base = buildCommon.makeSpan(["mop"], inner2, options3); } - } 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; + var output2 = []; + for (var i2 = 1; i2 < group2.name.length; i2++) { + output2.push(buildCommon.mathsym(group2.name[i2], group2.mode, options3)); + } + base = buildCommon.makeSpan(["mop"], output2, options3); } - } - if (state2.line === _line || state2.lineIndent > nodeIndent) { - if (atExplicitKey) { - _keyLine = state2.line; - _keyLineStart = state2.lineStart; - _keyPos = state2.position; + 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 (composeNode(state2, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { - if (atExplicitKey) { - keyNode = state2.result; - } else { - valueNode = state2.result; + 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; + } + }, "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 { + 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 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: parser22, + funcName + } = _ref; + var fName = funcName; + if (fName.length === 1) { + fName = singleCharBigOps[fName]; + } + return { + type: "op", + mode: parser22.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: parser22 + } = _ref2; + var body = args[0]; + return { + type: "op", + mode: parser22.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: parser22, + funcName + } = _ref3; + return { + type: "op", + mode: parser22.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: parser22, + funcName + } = _ref4; + return { + type: "op", + mode: parser22.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: parser22, + funcName + } = _ref5; + var fName = funcName; + if (fName.length === 1) { + fName = singleCharIntegrals[fName]; } + return { + type: "op", + mode: parser22.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"); } - if (!atExplicitKey) { - storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos); - keyTag = keyNode = valueNode = null; + 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 { + base = buildCommon.makeSpan(["mop"], [], options3); } - skipSeparationSpace(state2, true, -1); - ch = state2.input.charCodeAt(state2.position); - } - if ((state2.line === _line || state2.lineIndent > nodeIndent) && ch !== 0) { - throwError(state2, "bad indentation of a mapping entry"); - } else if (state2.lineIndent < nodeIndent) { - break; - } - } - if (atExplicitKey) { - storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); - } - if (detected) { - state2.tag = _tag; - state2.anchor = _anchor; - state2.kind = "mapping"; - state2.result = _result; - } - return detected; - } - function readTagProperty(state2) { - var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch; - ch = state2.input.charCodeAt(state2.position); - if (ch !== 33) - return false; - if (state2.tag !== null) { - throwError(state2, "duplication of a tag property"); - } - ch = state2.input.charCodeAt(++state2.position); - if (ch === 60) { - isVerbatim = true; - ch = state2.input.charCodeAt(++state2.position); - } else if (ch === 33) { - isNamed = true; - tagHandle = "!!"; - ch = state2.input.charCodeAt(++state2.position); - } else { - tagHandle = "!"; - } - _position = state2.position; - if (isVerbatim) { - do { - ch = state2.input.charCodeAt(++state2.position); - } while (ch !== 0 && ch !== 62); - if (state2.position < state2.length) { - tagName = state2.input.slice(_position, state2.position); - ch = state2.input.charCodeAt(++state2.position); - } else { - throwError(state2, "unexpected end of the stream within a verbatim tag"); - } - } else { - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - if (ch === 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"); + 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; } - isNamed = true; - _position = state2.position + 1; } else { - throwError(state2, "tag suffix cannot contain exclamation marks"); + isAllString = false; } } - ch = 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"); - } - } - if (tagName && !PATTERN_TAG_URI.test(tagName)) { - throwError(state2, "tag name cannot contain such characters: " + tagName); - } - try { - tagName = decodeURIComponent(tagName); - } catch (err) { - throwError(state2, "tag name is malformed: " + tagName); - } - 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 + '"'); - } - return true; - } - function readAnchorProperty(state2) { - var _position, ch; - ch = state2.input.charCodeAt(state2.position); - if (ch !== 38) - return false; - if (state2.anchor !== null) { - throwError(state2, "duplication of an anchor property"); - } - ch = state2.input.charCodeAt(++state2.position); - _position = state2.position; - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state2.input.charCodeAt(++state2.position); - } - if (state2.position === _position) { - throwError(state2, "name of an anchor node must contain at least one character"); - } - state2.anchor = state2.input.slice(_position, state2.position); - return true; - } - function readAlias(state2) { - var _position, alias, ch; - ch = state2.input.charCodeAt(state2.position); - if (ch !== 42) - return false; - ch = state2.input.charCodeAt(++state2.position); - _position = state2.position; - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state2.input.charCodeAt(++state2.position); - } - if (state2.position === _position) { - throwError(state2, "name of an alias node must contain at least one character"); - } - alias = state2.input.slice(_position, state2.position); - if (!_hasOwnProperty$1.call(state2.anchorMap, alias)) { - throwError(state2, 'unidentified alias "' + alias + '"'); - } - state2.result = state2.anchorMap[alias]; - skipSeparationSpace(state2, true, -1); - return true; - } - 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); - } - 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; + if (isAllString) { + var word = expression.map((node3) => node3.toText()).join(""); + expression = [new mathMLTree.TextNode(word)]; } - } - } - 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; - } + 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 { - allowBlockCollections = false; + return mathMLTree.newDocumentFragment([identifier2, operator]); + } + }, "mathmlBuilder"); + defineFunction({ + type: "operatorname", + names: ["\\operatorname@", "\\operatornamewithlimits"], + props: { + numArgs: 1 + }, + handler: /* @__PURE__ */ __name((_ref, args) => { + var { + parser: parser22, + funcName + } = _ref; + var body = args[0]; + return { + type: "operatorname", + mode: parser22.mode, + body: ordargument(body), + alwaysHandleSupSub: funcName === "\\operatornamewithlimits", + limits: false, + parentIsSupSub: false + }; + }, "handler"), + htmlBuilder: htmlBuilder$1, + mathmlBuilder: mathmlBuilder2 + }); + 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); } - } - } - 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 = state2.position - state2.lineStart; - if (indentStatus === 1) { - if (allowBlockCollections && (readBlockSequence(state2, blockIndent) || readBlockMapping(state2, blockIndent, flowIndent)) || readFlowCollection(state2, flowIndent)) { - hasContent = true; + }); + defineFunction({ + type: "overline", + names: ["\\overline"], + props: { + numArgs: 1 + }, + handler(_ref, args) { + var { + parser: parser22 + } = _ref; + var body = args[0]; + return { + type: "overline", + mode: parser22.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: parser22 + } = _ref; + var body = args[0]; + return { + type: "phantom", + mode: parser22.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: parser22 + } = _ref2; + var body = args[0]; + return { + type: "hphantom", + mode: parser22.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: parser22 + } = _ref3; + var body = args[0]; + return { + type: "vphantom", + mode: parser22.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: parser22 + } = _ref; + var amount = assertNodeType(args[0], "size").value; + var body = args[1]; + return { + type: "raisebox", + mode: parser22.mode, + dy: amount, + body + }; + }, + htmlBuilder(group2, options3) { + var body = buildGroup$1(group2.body, options3); + var dy = calculateSize2(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: parser22 + } = _ref; + return { + type: "internal", + mode: parser22.mode + }; + } + }); + defineFunction({ + type: "rule", + names: ["\\rule"], + props: { + numArgs: 2, + numOptionalArgs: 1, + argTypes: ["size", "size", "size"] + }, + handler(_ref, args, optArgs) { + var { + parser: parser22 + } = _ref; + var shift2 = optArgs[0]; + var width3 = assertNodeType(args[0], "size"); + var height2 = assertNodeType(args[1], "size"); + return { + type: "rule", + mode: parser22.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 = calculateSize2(group2.width, options3); + var height2 = calculateSize2(group2.height, options3); + var shift2 = group2.shift ? calculateSize2(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 = calculateSize2(group2.width, options3); + var height2 = calculateSize2(group2.height, options3); + var shift2 = group2.shift ? calculateSize2(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: parser22 + } = _ref; + var body = parser22.parseExpression(false, breakOnTokenText); + return { + type: "sizing", + mode: parser22.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: parser22 + } = _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: parser22.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: parser22 + } = _ref; + var index = optArgs[0]; + var body = args[0]; + return { + type: "sqrt", + mode: parser22.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: parser22 + } = _ref; + var body = parser22.parseExpression(true, breakOnTokenText); + var style3 = funcName.slice(1, funcName.length - 5); + return { + type: "styling", + mode: parser22.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 { - 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"); + 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 if (readPlainScalar(state2, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { - hasContent = true; - if (state2.tag === null) { - state2.tag = "?"; + } 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"; } } - if (state2.anchor !== null) { - state2.anchorMap[state2.anchor] = state2.result; + return new mathMLTree.MathNode(nodeType2, children2); + } + }); + 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"); } + return node2; } - } else if (indentStatus === 0) { - hasContent = allowBlockCollections && readBlockSequence(state2, blockIndent); - } - } - 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; + }); + 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; + return node2; } - } - } 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; + }); + 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]); } + if (variant !== defaultVariant[node2.type]) { + node2.setAttribute("mathvariant", variant); + } + return node2; } - } - 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"); - } else { - state2.result = type2.construct(state2.result, state2.tag); - if (state2.anchor !== null) { - state2.anchorMap[state2.anchor] = state2.result; + }); + 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 + '"'); + } + }, + 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; } - } - } - if (state2.listener !== null) { - state2.listener("close", state2); - } - return state2.tag !== null || state2.anchor !== null || hasContent; - } - function readDocument(state2) { - var documentStart = state2.position, _position, directiveName, directiveArgs, hasDirectives = false, ch; - state2.version = null; - state2.checkLineBreaks = state2.legacy; - state2.tagMap = /* @__PURE__ */ Object.create(null); - state2.anchorMap = /* @__PURE__ */ Object.create(null); - while ((ch = state2.input.charCodeAt(state2.position)) !== 0) { - skipSeparationSpace(state2, true, -1); - ch = state2.input.charCodeAt(state2.position); - if (state2.lineIndent > 0 || ch !== 37) { - break; - } - hasDirectives = true; - ch = state2.input.charCodeAt(++state2.position); - _position = state2.position; - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = 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 (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - ch = state2.input.charCodeAt(++state2.position); + }); + 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; } - if (ch === 35) { - do { - ch = state2.input.charCodeAt(++state2.position); - } while (ch !== 0 && !is_EOL(ch)); - break; + }); + 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: parser22, + funcName + } = _ref; + var body = args[0]; + return { + type: "text", + mode: parser22.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); } - if (is_EOL(ch)) - break; - _position = state2.position; - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = state2.input.charCodeAt(++state2.position); + }); + defineFunction({ + type: "underline", + names: ["\\underline"], + props: { + numArgs: 1, + allowedInText: true + }, + handler(_ref, args) { + var { + parser: parser22 + } = _ref; + return { + type: "underline", + mode: parser22.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; } - directiveArgs.push(state2.input.slice(_position, state2.position)); - } - if (ch !== 0) - readLineBreak(state2); - if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) { - directiveHandlers[directiveName](state2, directiveName, directiveArgs); - } else { - throwWarning(state2, 'unknown document directive "' + directiveName + '"'); - } - } - 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"); - } - 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; - } - if (state2.position < state2.length - 1) { - throwError(state2, "end of the stream or a document separator is expected"); - } else { - return; - } - } - 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 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"); - } - state2.input += "\0"; - while (state2.input.charCodeAt(state2.position) === 32) { - state2.lineIndent += 1; - state2.position += 1; - } - while (state2.position < state2.length - 1) { - readDocument(state2); - } - return state2.documents; - } - function loadAll$1(input, iterator, options2) { - if (iterator !== null && typeof iterator === "object" && typeof options2 === "undefined") { - options2 = iterator; - iterator = null; - } - var documents2 = loadDocuments(input, options2); - if (typeof iterator !== "function") { - return documents2; - } - for (var index = 0, length2 = documents2.length; index < length2; index += 1) { - iterator(documents2[index]); - } - } - 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]; - } - 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$i = { - loadAll: loadAll_1, - load: load_1 - }; - var FAILSAFE_SCHEMA = failsafe; - var load = loader$i.load; - const frontMatterRegex = /^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s; - function extractFrontMatter(text2, db2) { - var _a, _b; - const matches = text2.match(frontMatterRegex); - if (matches) { - const parsed = load(matches[1], { - // To keep things simple, only allow strings, arrays, and plain objects. - // https://www.yaml.org/spec/1.2/spec.html#id2802346 - schema: FAILSAFE_SCHEMA }); - if (parsed == null ? void 0 : parsed.title) { - (_a = db2.setDiagramTitle) == null ? void 0 : _a.call(db2, parsed.title); - } - if (parsed == null ? void 0 : parsed.displayMode) { - (_b = db2.setDisplayMode) == null ? void 0 : _b.call(db2, parsed.displayMode); - } - return text2.slice(matches[0].length); - } else { - return text2; - } - } - const assignWithDepth = function(dst, src, config2) { - const { depth, clobber } = Object.assign({ depth: 2, clobber: false }, config2); - 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); + 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: parser22 + } = _ref; + return { + type: "vcenter", + mode: parser22.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"]); } }); - 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]) ? [] : {}; - } - 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]; + 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; } }); - } - return dst; - }; - const assignWithDepth$1 = assignWithDepth; - const defaultConfig = Object.freeze(config$2); - let siteConfig = assignWithDepth$1({}, defaultConfig); - let configFromInitialize; - let directives = []; - let currentConfig = assignWithDepth$1({}, defaultConfig); - 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); - 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 = (conf2) => { - checkConfig(conf2); - assignWithDepth$1(currentConfig, conf2); - return getConfig$1(); - }; - const getConfig$1 = () => { - return assignWithDepth$1({}, currentConfig); - }; - const sanitize = (options2) => { - ["secure", ...siteConfig.secure ?? []].forEach((key) => { - if (options2[key] !== void 0) { - log$1.debug(`Denied attempt to modify a secure key ${key}`, options2[key]); - delete options2[key]; - } - }); - Object.keys(options2).forEach((key) => { - if (key.indexOf("__") === 0) { - 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 = (directive2) => { - if (directive2.fontFamily) { - if (!directive2.themeVariables) { - directive2.themeVariables = { fontFamily: directive2.fontFamily }; - } else { - if (!directive2.themeVariables.fontFamily) { - directive2.themeVariables = { fontFamily: directive2.fontFamily }; + 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 + }; } - } - } - directives.push(directive2); - updateCurrentConfig(siteConfig, directives); - }; - const reset = (config2 = siteConfig) => { - directives = []; - updateCurrentConfig(config2, directives); - }; - var ConfigWarning = /* @__PURE__ */ ((ConfigWarning2) => { - ConfigWarning2["LAZY_LOAD_DEPRECATED"] = "The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."; - return ConfigWarning2; - })(ConfigWarning || {}); - 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 d3Attrs = function(d3Elem, attrs) { - for (let attr of attrs) { - d3Elem.attr(attr[0], attr[1]); - } - }; - const calculateSvgSizeAttrs = function(height2, width2, useMaxWidth) { - let attrs = /* @__PURE__ */ new Map(); - if (useMaxWidth) { - attrs.set("width", "100%"); - attrs.set("style", `max-width: ${width2}px;`); - } else { - attrs.set("height", height2); - attrs.set("width", width2); - } - return attrs; - }; - const configureSvgSize = function(svgElem, height2, width2, useMaxWidth) { - const attrs = calculateSvgSizeAttrs(height2, 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 height2 = 0; - log$1.info(`Graph bounds: ${width2}x${height2}`, graph); - width2 = sWidth + padding2 * 2; - height2 = sHeight + padding2 * 2; - log$1.info(`Calculated bounds: ${width2}x${height2}`); - configureSvgSize(svgElem, height2, 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$g = (type2, userStyles, options2) => { - let diagramStyles = ""; - if (type2 in themes && themes[type2]) { - diagramStyles = themes[type2](options2); - } else { - log$1.warn(`No theme found for ${type2}`); - } - return ` & { - font-family: ${options2.fontFamily}; - font-size: ${options2.fontSize}; - fill: ${options2.textColor} - } - - /* Classes common for multiple diagrams */ - - & .error-icon { - fill: ${options2.errorBkgColor}; - } - & .error-text { - fill: ${options2.errorTextColor}; - stroke: ${options2.errorTextColor}; - } - - & .edge-thickness-normal { - stroke-width: 2px; - } - & .edge-thickness-thick { - stroke-width: 3.5px - } - & .edge-pattern-solid { - stroke-dasharray: 0; - } - - & .edge-pattern-dashed{ - stroke-dasharray: 3; - } - .edge-pattern-dotted { - stroke-dasharray: 2; - } - - & .marker { - fill: ${options2.lineColor}; - stroke: ${options2.lineColor}; - } - & .marker.cross { - stroke: ${options2.lineColor}; - } - - & svg { - font-family: ${options2.fontFamily}; - font-size: ${options2.fontSize}; - } - - ${diagramStyles} - - ${userStyles} -`; - }; - const addStylesForDiagram = (type2, diagramTheme) => { - themes[type2] = diagramTheme; - }; - const getStyles$h = getStyles$g; - let title$1 = ""; - let diagramTitle = ""; - let description = ""; - const sanitizeText$6 = (txt) => sanitizeText$7(txt, getConfig$1()); - const clear$i = function() { - title$1 = ""; - description = ""; - diagramTitle = ""; - }; - const setAccTitle = function(txt) { - title$1 = sanitizeText$6(txt).replace(/^\s+/g, ""); - }; - const getAccTitle = function() { - return title$1 || diagramTitle; - }; - const setAccDescription = function(txt) { - description = sanitizeText$6(txt).replace(/\n\s+/g, "\n"); - }; - const getAccDescription = function() { - return description; - }; - const setDiagramTitle = function(txt) { - diagramTitle = sanitizeText$6(txt); - }; - const getDiagramTitle = function() { - return diagramTitle; - }; - const commonDb = { - getAccTitle, - setAccTitle, - getDiagramTitle, - setDiagramTitle, - getAccDescription, - setAccDescription, - clear: clear$i - }; - const commonDb$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - clear: clear$i, - default: commonDb, - getAccDescription, - getAccTitle, - getDiagramTitle, - setAccDescription, - setAccTitle, - setDiagramTitle - }, Symbol.toStringTag, { value: "Module" })); - let currentDirective = {}; - const parseDirective$d = function(p, statement, context, type2) { - log$1.debug("parseDirective is being called", statement, context, type2); - try { - if (statement !== void 0) { - statement = statement.trim(); - switch (context) { - case "open_directive": - currentDirective = {}; - break; - case "type_directive": - if (!currentDirective) { - throw new Error("currentDirective is undefined"); - } - currentDirective.type = statement.toLowerCase(); - break; - case "arg_directive": - if (!currentDirective) { - throw new Error("currentDirective is undefined"); + 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; } - currentDirective.args = JSON.parse(statement); - break; - case "close_directive": - handleDirective(p, currentDirective, type2); - currentDirective = void 0; - break; - } - } - } catch (error) { - log$1.error( - `Error while rendering sequenceDiagram directive: ${statement} jison context: ${context}` - ); - log$1.error(error.message); - } - }; - const handleDirective = function(p, directive2, type2) { - log$1.info(`Directive type=${directive2.type} with args:`, directive2.args); - switch (directive2.type) { - case "init": - case "initialize": { - ["config"].forEach((prop) => { - if (directive2.args[prop] !== void 0) { - if (type2 === "flowchart-v2") { - type2 = "flowchart"; - } - directive2.args[type2] = directive2.args[prop]; - delete directive2.args[prop]; + 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]; } - }); - log$1.info("sanitize in handleDirective", directive2.args); - directiveSanitizer(directive2.args); - log$1.info("sanitize in handleDirective (done)", directive2.args); - addDirective(directive2.args); - break; - } - case "wrap": - case "nowrap": - if (p && p["setWrap"]) { - p.setWrap(directive2.type === "wrap"); } - break; - case "themeCss": - log$1.warn("themeCss encountered"); - break; - default: - log$1.warn( - `Unhandled directive: source: '%%{${directive2.type}: ${JSON.stringify( - directive2.args ? directive2.args : {} - )}}%%`, - directive2 - ); - break; - } - }; - const log = log$1; - const setLogLevel = setLogLevel$1; - const getConfig = getConfig$1; - const sanitizeText$5 = (text2) => sanitizeText$7(text2, getConfig()); - const setupGraphViewbox = setupGraphViewbox$1; - const getCommonDb$1 = () => { - return commonDb$1; - }; - const parseDirective$c = (p, statement, context, type2) => parseDirective$d(p, statement, context, type2); - const diagrams = {}; - const registerDiagram = (id2, diagram2, detector2) => { - if (diagrams[id2]) { - throw new Error(`Diagram ${id2} already registered.`); - } - diagrams[id2] = diagram2; - if (detector2) { - addDetector(id2, detector2); - } - addStylesForDiagram(id2, diagram2.styles); - if (diagram2.injectUtils) { - diagram2.injectUtils( - log, - setLogLevel, - getConfig, - sanitizeText$5, - setupGraphViewbox, - getCommonDb$1(), - parseDirective$c - ); - } - }; - const getDiagram = (name2) => { - if (name2 in diagrams) { - return diagrams[name2]; - } - throw new Error(`Diagram ${name2} not found.`); - }; - class UnknownDiagramError extends Error { - constructor(message2) { - super(message2); - this.name = "UnknownDiagramError"; - } - } - const directive$1 = /%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi; - const anyComment = /\s*%%.*\n/gm; - const detectors = {}; - const detectType = function(text2, config2) { - text2 = text2.replace(frontMatterRegex, "").replace(directive$1, "").replace(anyComment, "\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 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; + /** + * 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; + } } - }) - ); - 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 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; - }; - 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$f = objectProto$i.hasOwnProperty; - var nativeObjectToString$1 = objectProto$i.toString; - var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0; - function getRawTag(value) { - var isOwn = hasOwnProperty$f.call(value, symToStringTag$1), tag = value[symToStringTag$1]; - try { - value[symToStringTag$1] = void 0; - var unmasked = true; - } catch (e) { - } - var result = nativeObjectToString$1.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag$1] = tag; - } else { - delete value[symToStringTag$1]; - } - } - return result; - } - var objectProto$h = Object.prototype; - var nativeObjectToString = objectProto$h.toString; - function objectToString(value) { - return nativeObjectToString.call(value); - } - var nullTag = "[object Null]", undefinedTag = "[object Undefined]"; - var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0; - function baseGetTag(value) { - if (value == null) { - return value === void 0 ? undefinedTag : nullTag; - } - return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); - } - function isObject(value) { - var type2 = typeof value; - return value != null && (type2 == "object" || type2 == "function"); - } - var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]"; - function isFunction(value) { - if (!isObject(value)) { - return false; - } - var tag = baseGetTag(value); - 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$e = objectProto$g.hasOwnProperty; - var reIsNative = RegExp( - "^" + funcToString$1.call(hasOwnProperty$e).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" - ); - function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); - } - function getValue(object2, key) { - return object2 == null ? void 0 : object2[key]; - } - function getNative(object2, key) { - var value = getValue(object2, key); - return baseIsNative(value) ? value : 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$d = 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$d.call(data, key) ? data[key] : void 0; - } - var objectProto$e = Object.prototype; - var hasOwnProperty$c = objectProto$e.hasOwnProperty; - function hashHas(key) { - var data = this.__data__; - return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$c.call(data, key); - } - var HASH_UNDEFINED$1 = "__lodash_hash_undefined__"; - function hashSet(key, value) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = nativeCreate$1 && value === void 0 ? HASH_UNDEFINED$1 : value; - return this; - } - function Hash(entries2) { - var index = -1, length2 = entries2 == null ? 0 : entries2.length; - this.clear(); - while (++index < length2) { - var entry = entries2[index]; - 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(value, other) { - return value === other || value !== value && 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 = arrayProto.splice; - function listCacheDelete(key) { - var data = this.__data__, index = assocIndexOf(data, key); - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - --this.size; - return true; - } - function listCacheGet(key) { - var data = this.__data__, index = assocIndexOf(data, key); - return index < 0 ? void 0 : data[index][1]; - } - function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; - } - function listCacheSet(key, value) { - var data = this.__data__, index = assocIndexOf(data, key); - if (index < 0) { - ++this.size; - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; - } - function ListCache(entries2) { - var index = -1, length2 = entries2 == null ? 0 : entries2.length; - this.clear(); - while (++index < length2) { - var entry = entries2[index]; - 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(value) { - var type2 = typeof value; - return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value !== "__proto__" : value === 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, value) { - var data = getMapData(this, key), size2 = data.size; - data.set(key, value); - this.size += data.size == size2 ? 0 : 1; - return this; - } - function MapCache(entries2) { - var index = -1, length2 = entries2 == null ? 0 : entries2.length; - this.clear(); - while (++index < length2) { - var entry = entries2[index]; - 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, resolver) { - if (typeof func != "function" || resolver != null && typeof resolver != "function") { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, key = resolver ? resolver.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; - 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 directive = /%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi; - 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); - directiveSanitizer(args); - results = assignWithDepth$1(results, [...args]); - } else { - results = inits.args; - } - if (results) { - let type2 = detectType(text2, config2); - ["config"].forEach((prop) => { - if (results[prop] !== void 0) { - if (type2 === "flowchart-v2") { - type2 = "flowchart"; - } - results[type2] = results[prop]; - delete results[prop]; + }; + 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 + }; }); - } - 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 = directive.exec(text2)) !== null) { - if (match.index === directive.lastIndex) { - directive.lastIndex++; - } - 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 }); - } - } - if (result.length === 0) { - result.push({ type: text2, args: null }); - } - return result.length === 1 ? result[0] : result; - } catch (error) { - log$1.error( - `ERROR: ${error.message} - Unable to parse directive - ${type2 !== null ? " type:" + type2 : ""} based on the text:${text2}` - ); - return { type: null, args: null }; - } - }; - const isSubstringInArray = function(str2, arr) { - for (const [i2, element] of arr.entries()) { - if (element.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) { - if (config2.securityLevel !== "loose") { - return sanitizeUrl_1(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) { - return; - } - } - obj[fnName](...params); - }; - function distance(p1, p2) { - return p1 && p2 ? Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)) : 0; - } - function traverseEdge(points) { - let prevPoint; - let totalDistance = 0; - points.forEach((point2) => { - totalDistance += distance(point2, prevPoint); - prevPoint = point2; - }); - let remainingDistance = totalDistance / 2; - let center2 = void 0; - prevPoint = void 0; - points.forEach((point2) => { - if (prevPoint && !center2) { - const vectorDistance = distance(point2, prevPoint); - if (vectorDistance < remainingDistance) { - remainingDistance -= vectorDistance; + 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 { - const distanceRatio = remainingDistance / vectorDistance; - if (distanceRatio <= 0) { - center2 = prevPoint; + 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); } - if (distanceRatio >= 1) { - center2 = { x: point2.x, y: point2.y }; + } else { + base = 10; + } + if (base) { + number7 = digitToNumber[token2.text]; + if (number7 == null || number7 >= base) { + throw new ParseError("Invalid base-" + base + " digit " + token2.text); } - if (distanceRatio > 0 && distanceRatio < 1) { - center2 = { - x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point2.x, - y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point2.y - }; + var digit; + while ((digit = digitToNumber[context.future().text]) != null && digit < base) { + number7 *= base; + number7 += digit; + context.popToken(); } } - } - prevPoint = point2; - }); - return center2; - } - function calcLabelPosition(points) { - if (points.length === 1) { - return points[0]; - } - return traverseEdge(points); - } - const calcCardinalityPosition = (isRelationTypePresent, points, initialPosition) => { - let prevPoint; - log$1.info(`our points ${JSON.stringify(points)}`); - if (points[0] !== initialPosition) { - points = points.reverse(); - } - const distanceToCardinalityPoint = 25; - let remainingDistance = distanceToCardinalityPoint; - let center2; - prevPoint = void 0; - points.forEach((point2) => { - if (prevPoint && !center2) { - const vectorDistance = distance(point2, prevPoint); - if (vectorDistance < remainingDistance) { - remainingDistance -= vectorDistance; + 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 { - const distanceRatio = remainingDistance / vectorDistance; - if (distanceRatio <= 0) { - center2 = prevPoint; + 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; + } } - if (distanceRatio >= 1) { - center2 = { x: point2.x, y: point2.y }; + } + /** + * 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(); } - if (distanceRatio > 0 && distanceRatio < 1) { - center2 = { - x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point2.x, - y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point2.y - }; + 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 + }; } - } - prevPoint = point2; - }); - 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) { - let points = JSON.parse(JSON.stringify(_points)); - let prevPoint; - log$1.info("our points", points); - if (position2 !== "start_left" && position2 !== "start_right") { - points = points.reverse(); - } - points.forEach((point2) => { - prevPoint = point2; - }); - const distanceToCardinalityPoint = 25 + terminalMarkerSize; - let remainingDistance = distanceToCardinalityPoint; - let center2; - prevPoint = void 0; - points.forEach((point2) => { - if (prevPoint && !center2) { - const vectorDistance = distance(point2, prevPoint); - if (vectorDistance < remainingDistance) { - remainingDistance -= vectorDistance; - } else { - const distanceRatio = remainingDistance / vectorDistance; - if (distanceRatio <= 0) { - center2 = prevPoint; + /** + * 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] + }); } - if (distanceRatio >= 1) { - center2 = { x: point2.x, y: point2.y }; + 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 (distanceRatio > 0 && distanceRatio < 1) { - center2 = { - x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point2.x, - y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point2.y + if (superscript || subscript) { + return { + type: "supsub", + mode: this.mode, + base, + sup: superscript, + sub: subscript }; + } else { + return base; } } - } - prevPoint = point2; - }); - 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 }; - cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center2.x) / 2; - cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center2.y) / 2; - 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; - } - 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; - } - 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; - } - return cardinalityPosition; - } - function getStylesFromArray(arr) { - let style = ""; - let labelStyle = ""; - for (const element of arr) { - if (element !== void 0) { - if (element.startsWith("color:") || element.startsWith("text-align:")) { - labelStyle = labelStyle + element + ";"; - } else { - style = style + element + ";"; + /** + * 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); + } } - } - } - return { style, labelStyle }; - } - let cnt$1 = 0; - const generateId$1 = () => { - cnt$1++; - return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt$1; - }; - function makeid(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 makeid(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 - }; - }; - 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, index) => { - 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; - } else { - nextLine = [nextLine, word].filter(Boolean).join(" "); + /** + * 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 + }; } - const currentWord = index + 1; - const isLastWord = currentWord === words.length; - if (isLastWord) { - completedLines.push(nextLine); + /** + * 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()); + } } - }); - 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, index) => { - const nextLine = `${currentLine}${character2}`; - const lineWidth = calculateTextWidth(nextLine, config2); - 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; + /** + * Discard any space tokens, fetching the next non-space token. + */ + consumeSpaces() { + while (this.fetch().text === " ") { + this.consume(); + } } - }); - return { hyphenatedStrings: lines, remainingWord: currentLine }; - }, - (word, maxWidth, hyphenCharacter = "-", config2) => `${word}${maxWidth}${hyphenCharacter}${config2.fontSize}${config2.fontWeight}${config2.fontFamily}` - ); - function calculateTextHeight(text2, config2) { - config2 = Object.assign( - { fontSize: 12, fontWeight: 400, fontFamily: "Arial", margin: 15 }, - config2 - ); - return calculateTextDimensions(text2, config2).height; - } - function calculateTextWidth(text2, config2) { - config2 = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: "Arial" }, config2); - return calculateTextDimensions(text2, config2).width; - } - const calculateTextDimensions = memoize( - (text2, config2) => { - config2 = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: "Arial" }, config2); - const { fontSize, fontFamily, fontWeight } = 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 = select("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; - 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 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, config2) => `${text2}${config2.fontSize}${config2.fontWeight}${config2.fontFamily}` - ); - const initIdGenerator = class iterator { - constructor(deterministic, seed) { - this.deterministic = deterministic; - this.seed = seed; - this.count = seed ? seed.length : 0; - } - next() { - if (!this.deterministic) { - return Date.now(); - } - return this.count++; - } - }; - 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); - }; - const directiveSanitizer = (args) => { - log$1.debug("directiveSanitizer called with", args); - if (typeof args === "object") { - if (args.length) { - args.forEach((arg) => directiveSanitizer(arg)); - } else { - Object.keys(args).forEach((key) => { - log$1.debug("Checking key", key); - if (key.startsWith("__")) { - log$1.debug("sanitize deleting __ option", key); - delete args[key]; + /** + * 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; } - if (key.includes("proto")) { - log$1.debug("sanitize deleting proto option", key); - delete args[key]; + 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(regex2, modeName) { + var firstToken = this.fetch(); + var lastToken = firstToken; + var str2 = ""; + var nextToken; + while ((nextToken = this.fetch()).text !== "EOF" && regex2.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; } - if (key.includes("constr")) { - log$1.debug("sanitize deleting constr option", key); - delete args[key]; + 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; } - if (key.includes("themeCSS")) { - log$1.debug("sanitizing themeCss option"); - args[key] = sanitizeCss(args[key]); + 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 (key.includes("fontFamily")) { - log$1.debug("sanitizing fontFamily option"); - args[key] = sanitizeCss(args[key]); + if (!res) { + return null; } - if (key.includes("altFontFamily")) { - log$1.debug("sanitizing altFontFamily option"); - args[key] = sanitizeCss(args[key]); + if (!optional2 && res.text.length === 0) { + res.text = "0pt"; + isBlank = true; } - if (!configKeys.includes(key)) { - log$1.debug("sanitize deleting option", key); - delete args[key]; + 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 { - if (typeof args[key] === "object") { - log$1.debug("sanitize deleting object", key); - directiveSanitizer(args[key]); + 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(); } } - }); - } - } - if (args.themeVariables) { - const kArr = Object.keys(args.themeVariables); - for (const k of kArr) { - const val = args.themeVariables[k]; - if (val && val.match && !val.match(/^[\d "#%(),.;A-Za-z]+$/)) { - args.themeVariables[k] = ""; + 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 parser22 = new Parser(toParse, settings); + delete parser22.gullet.macros.current["\\df@tag"]; + var tree = parser22.parse(); + delete parser22.gullet.macros.current["\\current@color"]; + delete parser22.gullet.macros.current["\\color"]; + if (parser22.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: parser22.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 + } + }; } - log$1.debug("After sanitization", args); - }; - const sanitizeCss = (str2) => { - let startCnt = 0; - let endCnt = 0; - for (const element of str2) { - if (startCnt < endCnt) { - return "{ /* ERROR: Unbalanced CSS */ }"; + }); + + // 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") ?? ""); } - if (element === "{") { - startCnt++; - } else if (element === "}") { - endCnt++; + }); + 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"); + } } - } - if (startCnt !== endCnt) { - return "{ /* ERROR: Unbalanced CSS */ }"; - } - return str2; - }; - function isDetailedError(error) { - return "str" in error; - } - function getErrorMessage(error) { - if (error instanceof Error) { - return error.message; - } - return String(error); + }); } - const insertTitle = (parent, cssClass, titleTopMargin, title2) => { - if (!title2) { - return; + 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 + }; } - const bounds2 = parent.node().getBBox(); - 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]; + }); + + // 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"); } - }; - const utils = { - assignWithDepth: assignWithDepth$1, - wrapLabel, - calculateTextHeight, - calculateTextWidth, - calculateTextDimensions, - detectInit, - detectDirective, - isSubstringInArray, - interpolateToCurve, - calcLabelPosition, - calcCardinalityPosition, - calcTerminalLabelPosition, - formatUrl, - getStylesFromArray, - generateId: generateId$1, - random, - runFunc, - entityDecode, - initIdGenerator, - directiveSanitizer, - sanitizeCss, - insertTitle, - parseFontSize - }; - var COMMENT = "comm"; - var RULESET = "rule"; - var DECLARATION = "decl"; - var IMPORT = "@import"; - var KEYFRAMES = "@keyframes"; - var abs = Math.abs; - var from = String.fromCharCode; - function trim(value) { - return value.trim(); - } - function replace(value, pattern, replacement) { - return value.replace(pattern, replacement); - } - function indexof(value, search) { - return value.indexOf(search); + }); + + // 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} } - function charat(value, index) { - return value.charCodeAt(index) | 0; + + /* Classes common for multiple diagrams */ + + & .error-icon { + fill: ${options3.errorBkgColor}; } - function substr(value, begin, end2) { - return value.slice(begin, end2); + & .error-text { + fill: ${options3.errorTextColor}; + stroke: ${options3.errorTextColor}; } - function strlen(value) { - return value.length; - } - function sizeof(value) { - return value.length; + + & .edge-thickness-normal { + stroke-width: 1px; } - function append(value, array2) { - return array2.push(value), value; + & .edge-thickness-thick { + stroke-width: 3.5px } - var line = 1; - var column = 1; - var length = 0; - var position$1 = 0; - var character = 0; - var characters = ""; - function node(value, root2, parent, type2, props, children2, length2) { - return { value, root: root2, parent, type: type2, props, children: children2, line, column, length: length2, return: "" }; + & .edge-pattern-solid { + stroke-dasharray: 0; } - function char() { - return character; + & .edge-thickness-invisible { + stroke-width: 0; + fill: none; } - function prev() { - character = position$1 > 0 ? charat(characters, --position$1) : 0; - if (column--, character === 10) - column = 1, line--; - return character; + & .edge-pattern-dashed{ + stroke-dasharray: 3; } - function next$1() { - character = position$1 < length ? charat(characters, position$1++) : 0; - if (column++, character === 10) - column = 1, line++; - return character; + .edge-pattern-dotted { + stroke-dasharray: 2; } - function peek() { - return charat(characters, position$1); + + & .marker { + fill: ${options3.lineColor}; + stroke: ${options3.lineColor}; } - function caret() { - return position$1; + & .marker.cross { + stroke: ${options3.lineColor}; } - function slice(begin, end2) { - return substr(characters, begin, end2); + + & svg { + font-family: ${options3.fontFamily}; + font-size: ${options3.fontSize}; } - 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; + & p { + margin: 0 + } + + ${diagramStyles} + + ${userStyles} +`; + }, "getStyles"); + addStylesForDiagram = /* @__PURE__ */ __name((type3, diagramTheme) => { + if (diagramTheme !== void 0) { + themes[type3] = diagramTheme; + } + }, "addStylesForDiagram"); + styles_default = getStyles; } - return 0; - } - function alloc(value) { - return line = column = 1, length = strlen(characters = value), position$1 = 0, []; - } - function dealloc(value) { - return characters = "", value; - } - function delimit(type2) { - return trim(slice(position$1 - 1, delimiter(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(index, count) { - while (--count && next$1()) - if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97) - break; - return slice(index, caret() + (count < 6 && peek() == 32 && next$1() == 32)); - } - function delimiter(type2) { - while (next$1()) - switch (character) { - case type2: - return position$1; - case 34: - case 39: - if (type2 !== 34 && type2 !== 39) - delimiter(character); - break; - case 40: - if (type2 === 41) - delimiter(type2); - break; - case 92: - next$1(); - break; - } - return position$1; - } - function commenter(type2, index) { - while (next$1()) - if (type2 + character === 47 + 10) - break; - else if (type2 + character === 42 + 42 && peek() === 47) - break; - return "/*" + slice(index, position$1 - 1) + "*" + from(type2 === 47 ? type2 : next$1()); - } - function identifier(index) { - while (!token(peek())) - next$1(); - return slice(index, position$1); - } - function compile(value) { - return dealloc(parse$3("", null, null, null, [""], value = alloc(value), 0, [0], value)); - } - function parse$3(value, root2, parent, 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 type2 = ""; - var props = rules; - var children2 = rulesets; - var reference = rule; - var characters2 = type2; - while (scanning) - switch (previous = character2, character2 = next$1()) { - case 40: - if (previous != 108 && charat(characters2, length2 - 1) == 58) { - if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f") != -1) - ampersand = -1; - break; + }); + + // 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"); + } + }); + + // 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((id27, diagram24, detector25) => { + if (diagrams[id27]) { + log2.warn(`Diagram with id ${id27} already registered. Overwriting.`); + } + diagrams[id27] = diagram24; + if (detector25) { + addDetector(id27, detector25); + } + addStylesForDiagram(id27, diagram24.styles); + diagram24.injectUtils?.( + log2, + setLogLevel2, + getConfig2, + sanitizeText3, + setupGraphViewbox2, + getCommonDb(), + () => { } - 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(caret() - 1, 7); - continue; - case 47: - switch (peek()) { - case 42: - case 47: - append(comment(commenter(next$1(), caret()), root2, parent), declarations); - break; - default: - characters2 += "/"; + ); + }, "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.`); + } + }; + } + }); + + // 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 }; } - 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 (property2 > 0 && strlen(characters2) - length2) - append(property2 > 32 ? declaration(characters2 + ";", rule, parent, length2 - 1) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2), declarations); - break; - case 59: - characters2 += ";"; - default: - append(reference = ruleset(characters2, root2, parent, index, offset, rules, points, type2, props = [], children2 = [], length2), rulesets); - if (character2 === 123) - if (offset === 0) - parse$3(characters2, root2, reference, reference, props, rulesets, length2, points, children2); - else - switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) { - case 100: - case 109: - case 115: - parse$3(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type2, rules, props = [], length2), children2), rules, children2, length2, points, rule ? props : children2); - break; - default: - parse$3(characters2, reference, reference, reference, [""], children2, 0, points, children2); - } + } + 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 }; } - index = offset = property2 = 0, variable = ampersand = 1, type2 = 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; + } + 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 }; } - 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(next$1()); - atrule = peek(), offset = length2 = strlen(type2 = characters2 += identifier(caret())), character2++; - break; - case 45: - if (previous === 45 && strlen(characters2) == 2) - variable = 0; + } + 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 }; } - } - return rulesets; - } - function ruleset(value, root2, parent, index, offset, rules, points, type2, props, children2, length2) { - var post = offset - 1; - var rule = offset === 0 ? rules : [""]; - var size2 = sizeof(rule); - for (var i2 = 0, j = 0, k = 0; i2 < index; ++i2) - for (var x2 = 0, y2 = substr(value, post + 1, post = abs(j = points[i2])), z = value; x2 < size2; ++x2) - if (z = trim(j > 0 ? rule[x2] + " " + y2 : replace(y2, /&\f/g, rule[x2]))) - props[k++] = z; - return node(value, root2, parent, offset === 0 ? RULESET : type2, props, children2, length2); - } - function comment(value, root2, parent) { - return node(value, root2, parent, COMMENT, from(char()), substr(value, 2, -2), 0); - } - function declaration(value, root2, parent, length2) { - return node(value, root2, parent, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2); + } + 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; } - function serialize(children2, callback) { - var output = ""; - var length2 = sizeof(children2); - for (var i2 = 0; i2 < length2; i2++) - output += callback(children2[i2], i2, children2, callback) || ""; - return output; - } - function stringify(element, index, children2, callback) { - switch (element.type) { - case IMPORT: - case DECLARATION: - return element.return = element.return || element.value; - case COMMENT: - return ""; - case KEYFRAMES: - return element.return = element.value + "{" + serialize(element.children, callback) + "}"; - case RULESET: - element.value = element.props.join(","); + var init_ascending = __esm({ + "../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/ascending.js"() { + "use strict"; + __name(ascending, "ascending"); } - return strlen(children2 = serialize(element.children, callback)) ? element.return = element.value + "{" + children2 + "}" : ""; + }); + + // ../../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; } - const version$1 = "10.2.0-rc.2"; - const id$h = "c4"; - const detector$h = (txt) => { - return txt.match(/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/) !== null; - }; - const loader$h = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => c4Diagram); - return { id: id$h, diagram: diagram2 }; - }; - const plugin$h = { - id: id$h, - detector: detector$h, - loader: loader$h - }; - const c4 = plugin$h; - const id$g = "flowchart"; - const detector$g = (txt, config2) => { - var _a, _b; - if (((_a = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper" || ((_b = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _b.defaultRenderer) === "elk") { - return false; + var init_descending = __esm({ + "../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/descending.js"() { + "use strict"; + __name(descending, "descending"); } - return txt.match(/^\s*graph/) !== null; - }; - const loader$g = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => flowDiagram); - return { id: id$g, diagram: diagram2 }; - }; - const plugin$g = { - id: id$g, - detector: detector$g, - loader: loader$g - }; - const flowchart = plugin$g; - const id$f = "flowchart-v2"; - const detector$f = (txt, config2) => { - var _a, _b, _c; - if (((_a = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _a.defaultRenderer) === "dagre-d3" || ((_b = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _b.defaultRenderer) === "elk") { - return false; + }); + + // ../../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; } - if (txt.match(/^\s*graph/) !== null && ((_c = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _c.defaultRenderer) === "dagre-wrapper") { - return true; + 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); + } + return lo; } - return txt.match(/^\s*flowchart/) !== null; - }; - const loader$f = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => flowDiagramV2); - return { id: id$f, diagram: diagram2 }; - }; - const plugin$f = { - id: id$f, - detector: detector$f, - loader: loader$f - }; - const flowchartV2 = plugin$f; - const id$e = "er"; - const detector$e = (txt) => { - return txt.match(/^\s*erDiagram/) !== null; - }; - const loader$e = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => erDiagram); - return { id: id$e, diagram: diagram2 }; - }; - const plugin$e = { - id: id$e, - detector: detector$e, - loader: loader$e - }; - const er = plugin$e; - const id$d = "gitGraph"; - const detector$d = (txt) => { - return txt.match(/^\s*gitGraph/) !== null; - }; - const loader$d = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => gitGraphDiagram); - return { id: id$d, diagram: diagram2 }; - }; - const plugin$d = { - id: id$d, - detector: detector$d, - loader: loader$d - }; - const git = plugin$d; - const id$c = "gantt"; - const detector$c = (txt) => { - return txt.match(/^\s*gantt/) !== null; - }; - const loader$c = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => ganttDiagram); - return { id: id$c, diagram: diagram2 }; - }; - const plugin$c = { - id: id$c, - detector: detector$c, - loader: loader$c - }; - const gantt = plugin$c; - const id$b = "info"; - const detector$b = (txt) => { - return txt.match(/^\s*info/) !== null; - }; - const loader$b = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => infoDiagram); - return { id: id$b, diagram: diagram2 }; - }; - const plugin$b = { - id: id$b, - detector: detector$b, - loader: loader$b - }; - const info$1 = plugin$b; - const id$a = "pie"; - const detector$a = (txt) => { - return txt.match(/^\s*pie/) !== null; - }; - const loader$a = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => pieDiagram); - return { id: id$a, diagram: diagram2 }; - }; - const plugin$a = { - id: id$a, - detector: detector$a, - loader: loader$a - }; - const pie = plugin$a; - const id$9 = "requirement"; - const detector$9 = (txt) => { - return txt.match(/^\s*requirement(Diagram)?/) !== null; - }; - const loader$9 = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => requirementDiagram); - return { id: id$9, diagram: diagram2 }; - }; - const plugin$9 = { - id: id$9, - detector: detector$9, - loader: loader$9 - }; - const requirement = plugin$9; - const id$8 = "sequence"; - const detector$8 = (txt) => { - return txt.match(/^\s*sequenceDiagram/) !== null; - }; - const loader$8 = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => sequenceDiagram); - return { id: id$8, diagram: diagram2 }; - }; - const plugin$8 = { - id: id$8, - detector: detector$8, - loader: loader$8 - }; - const sequence = plugin$8; - const id$7 = "class"; - const detector$7 = (txt, config2) => { - var _a; - if (((_a = config2 == null ? void 0 : config2.class) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper") { - return false; + __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; } - return txt.match(/^\s*classDiagram/) !== null; - }; - const loader$7 = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => classDiagram); - return { id: id$7, diagram: diagram2 }; - }; - const plugin$7 = { - id: id$7, - detector: detector$7, - loader: loader$7 - }; - const classDiagram$1 = plugin$7; - const id$6 = "classDiagram"; - const detector$6 = (txt, config2) => { - var _a; - if (txt.match(/^\s*classDiagram/) !== null && ((_a = config2 == null ? void 0 : config2.class) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper") { - return true; + __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; } - return txt.match(/^\s*classDiagram-v2/) !== null; - }; - const loader$6 = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => classDiagramV2); - return { id: id$6, diagram: diagram2 }; - }; - const plugin$6 = { - id: id$6, - detector: detector$6, - loader: loader$6 - }; - const classDiagramV2$1 = plugin$6; - const id$5 = "state"; - const detector$5 = (txt, config2) => { - var _a; - if (((_a = config2 == null ? void 0 : config2.state) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper") { - return false; + __name(center4, "center"); + return { left: left3, center: center4, right: right3 }; + } + 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 txt.match(/^\s*stateDiagram/) !== null; - }; - const loader$5 = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => stateDiagram); - return { id: id$5, diagram: diagram2 }; - }; - const plugin$5 = { - id: id$5, - detector: detector$5, - loader: loader$5 - }; - const state = plugin$5; - const id$4 = "stateDiagram"; - const detector$4 = (text2, config2) => { - var _a, _b; - if (text2.match(/^\s*stateDiagram-v2/) !== null) { - return true; + }); + + // ../../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"); } - if (text2.match(/^\s*stateDiagram/) && ((_a = config2 == null ? void 0 : config2.state) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper") { - return true; + }); + + // ../../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; } - if (text2.match(/^\s*stateDiagram/) && ((_b = config2 == null ? void 0 : config2.state) == null ? void 0 : _b.defaultRenderer) === "dagre-wrapper") { - return true; + }); + + // ../../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 false; - }; - const loader$4 = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => stateDiagramV2); - return { id: id$4, diagram: diagram2 }; - }; - const plugin$4 = { - id: id$4, - detector: detector$4, - loader: loader$4 - }; - const stateV2 = plugin$4; - const id$3 = "journey"; - const detector$3 = (txt) => { - return txt.match(/^\s*journey/) !== null; - }; - const loader$3 = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => journeyDiagram); - return { id: id$3, diagram: diagram2 }; - }; - const plugin$3 = { - id: id$3, - detector: detector$3, - loader: loader$3 - }; - const journey = plugin$3; - const getStyles$f = () => ``; - const styles$9 = getStyles$f; - const setConf$a = function() { - }; - const draw$i = (_text, id2, mermaidVersion) => { - try { - log$1.debug("Renering svg for syntax error\n"); - const svg2 = select("#" + id2); - const g = svg2.append("g"); - 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 " + mermaidVersion); - svg2.attr("height", 100); - svg2.attr("width", 500); - svg2.attr("viewBox", "768 0 912 512"); - } catch (e) { - log$1.error("Error while rendering info diagram"); - log$1.error(getErrorMessage(e)); + return value2; + } + function keyof(value2) { + return value2 !== null && typeof value2 === "object" ? value2.valueOf() : value2; + } + 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"); + } + 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"); } - }; - const errorRenderer = { - setConf: setConf$a, - draw: draw$i - }; - const diagram$i = { - db: { - clear: () => { + }); + + // ../../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]; + } + 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; + } + 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"); + } + }); + + // ../../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; + } } - }, - styles: styles$9, - renderer: errorRenderer, - parser: { - parser: { yy: {} }, - parse: () => { + } 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; + } } - }, - init: () => { } - }; - const errorDiagram = diagram$i; - const id$2 = "flowchart-elk"; - const detector$2 = (txt, config2) => { - var _a; - if ( - // If diagram explicitly states flowchart-elk - txt.match(/^\s*flowchart-elk/) || // If a flowchart/graph diagram has their default renderer set to elk - txt.match(/^\s*flowchart|graph/) && ((_a = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _a.defaultRenderer) === "elk" - ) { - return true; - } - return false; - }; - const loader$2 = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => flowchartElkDefinition); - return { id: id$2, diagram: diagram2 }; - }; - const plugin$2 = { - id: id$2, - detector: detector$2, - loader: loader$2 - }; - const flowchartElk = plugin$2; - const id$1 = "timeline"; - const detector$1 = (txt) => { - return txt.match(/^\s*timeline/) !== null; - }; - const loader$1 = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => timelineDefinition); - return { id: id$1, diagram: diagram2 }; - }; - const plugin$1 = { - id: id$1, - detector: detector$1, - loader: loader$1 - }; - const timeline = plugin$1; - const id = "mindmap"; - const detector = (txt) => { - return txt.match(/^\s*mindmap/) !== null; - }; - const loader = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => mindmapDefinition); - return { id, diagram: diagram2 }; - }; - const plugin = { - id, - detector, - loader - }; - const mindmap = plugin; - let hasLoadedDiagrams = false; - const addDiagrams = () => { - if (hasLoadedDiagrams) { - return; + 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"); } - 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: () => { - } - }, - styles: {}, - // should never be used - renderer: {}, - // should never be used - 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" - ); - } - }, - init: () => null - // no op - }, - (text2) => { - return text2.toLowerCase().trimStart().startsWith("---"); + }); + + // ../../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; + } } - ); - registerLazyLoadedDiagrams( - c4, - classDiagramV2$1, - classDiagram$1, - er, - gantt, - info$1, - pie, - requirement, - sequence, - flowchartElk, - flowchartV2, - flowchart, - mindmap, - timeline, - git, - stateV2, - state, - journey - ); - }; - const cleanupComments = (text2) => { - return text2.trimStart().replace(/^\s*%%(?!{)[^\n]+\n?/gm, ""); - }; - class Diagram { - constructor(text2) { - var _a, _b; - this.text = text2; - this.type = "graph"; - this.text += "\n"; - const cnf = getConfig$1(); - 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; - (_b = (_a = this.db).clear) == null ? void 0 : _b.call(_a); - this.renderer = diagram2.renderer; - this.parser = diagram2.parser; - const originalParse = this.parser.parse.bind(this.parser); - this.parser.parse = (text22) => originalParse(cleanupComments(extractFrontMatter(text22, this.db))); - this.parser.parser.yy = this.db; - if (diagram2.init) { - diagram2.init(cnf); - log$1.info("Initialized diagram " + this.type, cnf); - } - this.parse(); - } - parse() { - var _a, _b; - if (this.detectError) { - throw this.detectError; - } - (_b = (_a = this.db).clear) == null ? void 0 : _b.call(_a); - this.parser.parse(this.text); - } - async render(id2, version2) { - await this.renderer.draw(this.text, id2, version2, this); } - getParser() { - return this.parser; + return min9; + } + var init_min = __esm({ + "../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/min.js"() { + "use strict"; + __name(min, "min"); } - getType() { - return this.type; + }); + + // ../../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; } - const getDiagramFromText = async (text2) => { - const type2 = detectType(text2, getConfig$1()); - 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); + var init_range = __esm({ + "../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/range.js"() { + "use strict"; + __name(range, "range"); } - return new Diagram(text2); - }; - let interactionFunctions = []; - const addFunction = (func) => { - interactionFunctions.push(func); - }; - const attachFunctions = () => { - interactionFunctions.forEach((f2) => { - f2(); - }); - interactionFunctions = []; - }; - var objectProto$d = Object.prototype; - function isPrototype(value) { - var Ctor = value && value.constructor, proto2 = typeof Ctor == "function" && Ctor.prototype || objectProto$d; - return value === proto2; + }); + + // ../../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(); + } + }); + + // ../../node_modules/.pnpm/d3-axis@3.0.0/node_modules/d3-axis/src/identity.js + function identity_default(x5) { + return x5; } - function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); + 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)"; + } + function translateY(y5) { + return "translate(0," + y5 + ")"; + } + function number2(scale) { + return (d2) => +scale(d2); + } + 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 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; + }); + } + __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 axisTop(scale) { + return axis(top, scale); } - var nativeKeys = overArg(Object.keys, Object); - const nativeKeys$1 = nativeKeys; - var objectProto$c = Object.prototype; - var hasOwnProperty$b = objectProto$c.hasOwnProperty; - function baseKeys(object2) { - if (!isPrototype(object2)) { - return nativeKeys$1(object2); + function axisBottom(scale) { + return axis(bottom, scale); + } + 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"); } - var result = []; - for (var key in Object(object2)) { - if (hasOwnProperty$b.call(object2, key) && key != "constructor") { - result.push(key); + }); + + // ../../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(); + } + }); + + // ../../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); + } + function Dispatch(_2) { + this._ = _2; + } + 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 get(type3, name) { + for (var i2 = 0, n2 = type3.length, c3; i2 < n2; ++i2) { + if ((c3 = type3[i2]).name === name) { + return c3.value; } } - return result; } - 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$6 = "[object Map]", objectTag$4 = "[object Object]", promiseTag = "[object Promise]", setTag$6 = "[object Set]", weakMapTag$2 = "[object WeakMap]"; - var dataViewTag$4 = "[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$4 || Map$2 && getTag(new Map$2()) != mapTag$6 || Promise$2 && getTag(Promise$2.resolve()) != promiseTag || Set$2 && getTag(new Set$2()) != setTag$6 || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag$2) { - getTag = function(value) { - var result = baseGetTag(value), Ctor = result == objectTag$4 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : ""; - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: - return dataViewTag$4; - case mapCtorString: - return mapTag$6; - case promiseCtorString: - return promiseTag; - case setCtorString: - return setTag$6; - case weakMapCtorString: - return weakMapTag$2; - } + 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; } - return result; + } + 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; + } + }); + + // ../../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(); + } + }); + + // ../../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; + } + 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); }; } - const getTag$1 = getTag; - function isObjectLike(value) { - return value != null && typeof value == "object"; - } - var argsTag$3 = "[object Arguments]"; - function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag$3; - } - var objectProto$b = Object.prototype; - var hasOwnProperty$a = objectProto$b.hasOwnProperty; - var propertyIsEnumerable$1 = objectProto$b.propertyIsEnumerable; - var isArguments = baseIsArguments(function() { - return arguments; - }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty$a.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee"); - }; - const isArguments$1 = isArguments; - var isArray = Array.isArray; - const isArray$1 = isArray; - var MAX_SAFE_INTEGER$1 = 9007199254740991; - function isLength(value) { - return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1; - } - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); + function creatorFixed(fullname) { + return function() { + return this.ownerDocument.createElementNS(fullname.space, fullname.local); + }; } - function stubFalse() { - return false; + function creator_default(name) { + var fullname = namespace_default(name); + return (fullname.local ? creatorFixed : creatorInherit)(fullname); } - 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; - var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : void 0; - var isBuffer = nativeIsBuffer || stubFalse; - const isBuffer$1 = isBuffer; - 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$5 = "[object Map]", numberTag$3 = "[object Number]", objectTag$3 = "[object Object]", regexpTag$3 = "[object RegExp]", setTag$5 = "[object Set]", stringTag$3 = "[object String]", weakMapTag$1 = "[object WeakMap]"; - var arrayBufferTag$3 = "[object ArrayBuffer]", dataViewTag$3 = "[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$3] = typedArrayTags[dateTag$3] = typedArrayTags[errorTag$2] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$5] = typedArrayTags[numberTag$3] = typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$3] = typedArrayTags[setTag$5] = typedArrayTags[stringTag$3] = typedArrayTags[weakMapTag$1] = false; - function baseIsTypedArray(value) { - return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + 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"); + } + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selector.js + function none() { } - function baseUnary(func) { - return function(value) { - return func(value); + function selector_default(selector) { + return selector == null ? none : function() { + return this.querySelector(selector); }; } - 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 freeProcess = moduleExports$1 && freeGlobal$1.process; - var nodeUtil = function() { - try { - var types = freeModule$1 && freeModule$1.require && freeModule$1.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; - var mapTag$4 = "[object Map]", setTag$4 = "[object Set]"; - var objectProto$a = Object.prototype; - var hasOwnProperty$9 = objectProto$a.hasOwnProperty; - function isEmpty(value) { - if (value == null) { - return true; - } - if (isArrayLike(value) && (isArray$1(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer$1(value) || isTypedArray$1(value) || isArguments$1(value))) { - return !value.length; - } - var tag = getTag$1(value); - if (tag == mapTag$4 || tag == setTag$4) { - return !value.size; - } - if (isPrototype(value)) { - return !baseKeys(value).length; + 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"); } - for (var key in value) { - if (hasOwnProperty$9.call(value, key)) { - return false; + }); + + // ../../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; + } } } - return true; + return new Selection(subgroups, this._parents); } - const SVG_ROLE = "graphics-document document"; - function setA11yDiagramInfo(svg2, diagramType) { - svg2.attr("role", SVG_ROLE); - if (!isEmpty(diagramType)) { - svg2.attr("aria-roledescription", diagramType); + 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"); } + }); + + // ../../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); } - function addSVGa11yTitleDescription(svg2, a11yTitle, a11yDesc, baseId) { - if (svg2.insert === void 0) { - return; + var init_array = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/array.js"() { + "use strict"; + __name(array, "array"); } - if (a11yTitle || a11yDesc) { - if (a11yDesc) { - const descId = "chart-desc-" + baseId; - svg2.attr("aria-describedby", descId); - svg2.insert("desc", ":first-child").attr("id", descId).text(a11yDesc); - } - if (a11yTitle) { - const titleId = "chart-title-" + baseId; - svg2.attr("aria-labelledby", titleId); - svg2.insert("title", ":first-child").attr("id", titleId).text(a11yTitle); - } - } else { - return; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selectorAll.js + function empty() { + return []; + } + function selectorAll_default(selector) { + return selector == null ? empty : function() { + return this.querySelectorAll(selector); + }; + } + 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)); + }; } - const CLASSDEF_DIAGRAMS = [ - "graph", - "flowchart", - "flowchart-v2", - "flowchart-elk", - "stateDiagram", - "stateDiagram-v2" - ]; - 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"]; - async function parse$2(text2, parseOptions) { - addDiagrams(); - try { - const diagram2 = await getDiagramFromText(text2); - diagram2.parse(); - } catch (error) { - if (parseOptions == null ? void 0 : parseOptions.suppressErrors) { - return false; + 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); + } } - throw error; } - return true; + return new Selection(subgroups, parents4); } - 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) { - let txt = text2; - txt = txt.replace(/fl°°/g, "&#"); - txt = txt.replace(/fl°/g, "&"); - txt = txt.replace(/¶ß/g, ";"); - return txt; - }; - const cssImportantStyles = (cssClass, element, cssClasses = []) => { - return ` -.${cssClass} ${element} { ${cssClasses.join(" !important; ")} !important; }`; - }; - const createCssStyles = (config2, graphType, classDefs = {}) => { - var _a; - let cssStyles = ""; - if (config2.themeCSS !== void 0) { - cssStyles += ` -${config2.themeCSS}`; + 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"); } - if (config2.fontFamily !== void 0) { - cssStyles += ` -:root { --mermaid-font-family: ${config2.fontFamily}}`; + }); + + // ../../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 childMatcher(selector) { + return function(node2) { + return node2.matches(selector); + }; + } + 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"); } - if (config2.altFontFamily !== void 0) { - cssStyles += ` -:root { --mermaid-alt-font-family: ${config2.altFontFamily}}`; + }); + + // ../../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); + }; + } + 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"); } - if (!isEmpty(classDefs) && CLASSDEF_DIAGRAMS.includes(graphType)) { - const htmlLabels = config2.htmlLabels || ((_a = config2.flowchart) == null ? void 0 : _a.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); - }); - } - if (!isEmpty(styleClassDef.textStyles)) { - cssStyles += cssImportantStyles(styleClassDef.id, "tspan", styleClassDef.textStyles); + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChildren.js + function children() { + return Array.from(this.children); + } + function childrenFilter(match2) { + return function() { + return filter.call(this.children, match2); + }; + } + function selectChildren_default(match2) { + return this.selectAll(match2 == null ? children : childrenFilter(typeof match2 === "function" ? match2 : childMatcher(match2))); + } + 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"); + } + }); + + // ../../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 cssStyles; - }; - const createUserStyles = (config2, graphType, classDefs, svgId) => { - const userCSSstyles = createCssStyles(config2, graphType, classDefs); - const allStyles = getStyles$h(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\(.*?#/g, 'marker-end="url(#'); + return new Selection(subgroups, this._parents); + } + 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"); } - cleanedUpSvg = decodeEntities(cleanedUpSvg); - cleanedUpSvg = cleanedUpSvg.replace(/
/g, "
"); - return cleanedUpSvg; - }; - const putIntoIFrame = (svgCode = "", svgElement) => { - const height2 = svgElement ? 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); + }); + + // ../../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"); } - const svgNode2 = enclosingDiv.append("svg").attr("id", id2).attr("width", "100%").attr("xmlns", XMLNS_SVG_STD); - if (svgXlink) { - svgNode2.attr("xmlns:xlink", svgXlink); + }); + + // ../../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 EnterNode(parent4, datum2) { + this.ownerDocument = parent4.ownerDocument; + this.namespaceURI = parent4.namespaceURI; + this._next = null; + this._parent = parent4; + this.__data__ = datum2; + } + 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") + }; } - svgNode2.append("g"); - return parentRoot; - }; - function sandboxedIframe(parentNode, iFrameId) { - return parentNode.append("iframe").attr("id", iFrameId).attr("style", "width: 100%; height: 100%;").attr("sandbox", ""); + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/constant.js + function constant_default(x5) { + return function() { + return x5; + }; } - const removeExistingElements = (doc, id2, divId, iFrameId) => { - var _a, _b, _c; - (_a = doc.getElementById(id2)) == null ? void 0 : _a.remove(); - (_b = doc.getElementById(divId)) == null ? void 0 : _b.remove(); - (_c = doc.getElementById(iFrameId)) == null ? void 0 : _c.remove(); - }; - const render$3 = async function(id2, text2, svgContainingElement) { - var _a, _b, _c, _d; - addDiagrams(); - reset(); - const graphInit = utils.detectInit(text2); - if (graphInit) { - directiveSanitizer(graphInit); - addDirective(graphInit); - } - const config2 = getConfig$1(); - log$1.debug(config2); - if (text2.length > ((config2 == null ? void 0 : config2.maxTextSize) ?? MAX_TEXTLENGTH)) { - text2 = MAX_TEXTLENGTH_EXCEEDED_MSG; + 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"); } - text2 = text2.replace(/\r\n?/g, "\n"); - text2 = text2.replace( - /<(\w+)([^>]*)>/g, - (match, tag, attributes) => "<" + tag + attributes.replace(/="([^"]*)"/g, "='$1'") + ">" - ); - const idSelector = "#" + id2; - const iFrameID = "i" + id2; - const iFrameID_selector = "#" + iFrameID; - const enclosingDivID = "d" + id2; - const enclosingDivID_selector = "#" + enclosingDivID; - let root2 = select("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(select(svgContainingElement), iFrameID); - root2 = select(iframe.nodes()[0].contentDocument.body); - root2.node().style.margin = 0; - } else { - root2 = select(svgContainingElement); - } - appendDivSvgG(root2, id2, enclosingDivID, `font-family: ${fontFamily}`, XMLNS_XLINK_STD); - } else { - removeExistingElements(document, id2, enclosingDivID, iFrameID); - if (isSandboxed) { - const iframe = sandboxedIframe(select("body"), iFrameID); - root2 = select(iframe.nodes()[0].contentDocument.body); - root2.node().style.margin = 0; + }); + + // ../../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 { - root2 = select("body"); + enter[i2] = new EnterNode(parent4, data5[i2]); } - appendDivSvgG(root2, id2, enclosingDivID); } - text2 = encodeEntities(text2); - let diag; - let parseEncounteredException; - try { - diag = await getDiagramFromText(text2); - } catch (error) { - diag = new Diagram("error"); - parseEncounteredException = error; - } - const element = root2.select(enclosingDivID_selector).node(); - const graphType = diag.type; - const svg2 = element.firstChild; - const firstChild = svg2.firstChild; - const diagramClassDefs = CLASSDEF_DIAGRAMS.includes(graphType) ? diag.renderer.getClasses(text2, diag) : {}; - const rules = createUserStyles( - config2, - graphType, - // @ts-ignore convert renderer to TS. - 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 = (_b = (_a = diag.db).getAccTitle) == null ? void 0 : _b.call(_a); - const a11yDescr = (_d = (_c = diag.db).getAccDescription) == null ? void 0 : _d.call(_c); - addA11yInfo(graphType, 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 - }); + for (; i2 < groupLength3; ++i2) { + if (node2 = group2[i2]) { + exit[i2] = node2; + } } - attachFunctions(); - if (parseEncounteredException) { - throw parseEncounteredException; + } + 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); + } + } } - const tmpElementSelector = isSandboxed ? iFrameID_selector : enclosingDivID_selector; - const node2 = select(tmpElementSelector).node(); - if (node2 && "remove" in node2) { - node2.remove(); + 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]); + } } - return { - svg: svgCode, - bindFunctions: diag.db.bindFunctions - }; - }; - function initialize$1(options2 = {}) { - var _a; - if ((options2 == null ? void 0 : options2.fontFamily) && !((_a = options2.themeVariables) == null ? void 0 : _a.fontFamily)) { - if (!options2.themeVariables) { - options2.themeVariables = {}; + for (i2 = 0; i2 < groupLength3; ++i2) { + if ((node2 = group2[i2]) && nodeByKeyValue.get(keyValues[i2]) === node2) { + exit[i2] = node2; } - 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); + } + function datum(node2) { + return node2.__data__; + } + 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; + } + } } - const config2 = typeof options2 === "object" ? setSiteConfig(options2) : getSiteConfig(); - setLogLevel$1(config2.logLevel); - addDiagrams(); + update2 = new Selection(update2, parents4); + update2._enter = enter; + update2._exit = exit; + return update2; } - function addA11yInfo(graphType, svgNode2, a11yTitle, a11yDescr) { - setA11yDiagramInfo(svgNode2, graphType); - addSVGa11yTitleDescription(svgNode2, a11yTitle, a11yDescr, svgNode2.attr("id")); + 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"); + } + }); + + // ../../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); } - const mermaidAPI = Object.freeze({ - render: render$3, - parse: parse$2, - parseDirective: parseDirective$d, - getDiagramFromText, - initialize: initialize$1, - getConfig: getConfig$1, - setConfig, - getSiteConfig, - updateSiteConfig, - reset: () => { - reset(); - }, - globalReset: () => { - reset(defaultConfig); - }, - defaultConfig + 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"); + } }); - setLogLevel$1(getConfig$1().logLevel); - reset(getConfig$1()); - const handleError = (error, errors, parseError2) => { - log$1.warn(error); - if (isDetailedError(error)) { - if (parseError2) { - parseError2(error.str, error.hash); - } - errors.push({ ...error, message: error.str, error }); + + // ../../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 { - if (parseError2) { - parseError2(error); - } - if (error instanceof Error) { - errors.push({ - str: error.message, - message: error.message, - hash: error.name, - error - }); - } + enter = enter.append(onenter + ""); } - }; - 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; + 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; + } + 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; + } } } - }; - 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"); + for (; j2 < m0; ++j2) { + merges[j2] = groups0[j2]; } - 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 }); + return new Selection(merges, this._parents); + } + var init_merge2 = __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"); } - const idGenerator = new utils.initIdGenerator(conf2.deterministicIds, conf2.deterministicIDSeed); - let txt; - const errors = []; - for (const element of Array.from(nodesToProcess)) { - log$1.info("Rendering diagram: " + element.id); - /*! Check if previously processed */ - if (element.getAttribute("data-processed")) { - continue; - } - element.setAttribute("data-processed", "true"); - const id2 = `mermaid-${idGenerator.next()}`; - txt = element.innerHTML; - txt = dedent(utils.entityDecode(txt)).trim().replace(//gi, "
"); - const init2 = utils.detectInit(txt); - if (init2) { - log$1.debug("Detected early reinit: ", init2); - } - try { - const { svg: svg2, bindFunctions: bindFunctions2 } = await render$2(id2, txt, element); - element.innerHTML = svg2; - if (postRenderCallback) { - await postRenderCallback(id2); + }); + + // ../../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; } - if (bindFunctions2) { - bindFunctions2(element); + } + } + return this; + } + 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"); + } + }); + + // ../../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; } - } catch (error) { - handleError(error, errors, mermaid.parseError); } + sortgroup.sort(compareNode); } - if (errors.length > 0) { - throw errors[0]; + return new Selection(sortgroups, this._parents).order(); + } + function ascending2(a2, b2) { + return a2 < b2 ? -1 : a2 > b2 ? 1 : a2 >= b2 ? 0 : NaN; + } + 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"); } - }; - 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-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; + } + 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"); } - 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-selection@3.0.0/node_modules/d3-selection/src/selection/nodes.js + function nodes_default() { + return Array.from(this); + } + 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"); + } + }); + + // ../../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; } } - await run$3(runOptions); - }; - const registerExternalDiagrams = async (diagrams2, { - lazyLoad = true - } = {}) => { - registerLazyLoadedDiagrams(...diagrams2); - if (lazyLoad === false) { - await loadRegisteredDiagrams(); + return null; + } + 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"); } - }; - const contentLoaded = function() { - if (mermaid.startOnLoad) { - const { startOnLoad } = mermaidAPI.getConfig(); - if (startOnLoad) { - mermaid.run().catch((err) => log$1.error("Mermaid failed to initialize", err)); - } + }); + + // ../../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; + } + var init_size2 = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/size.js"() { + "use strict"; + __name(size_default, "default"); } - }; - if (typeof document !== "undefined") { - /*! - * Wait for document loaded before starting the execution - */ - window.addEventListener("load", contentLoaded, false); + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/empty.js + function empty_default() { + return !this.node(); } - const setParseErrorHandler = function(parseErrorHandler) { - mermaid.parseError = parseErrorHandler; - }; - const executionQueue = []; - let executionQueueRunning = false; - const executeQueue = async () => { - if (executionQueueRunning) { - return; + 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"); } - 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-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); } } - executionQueueRunning = false; - }; - const parse$1 = 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 _a; - log$1.error("Error parsing", e); - (_a = mermaid.parseError) == null ? void 0 : _a.call(mermaid, e); - rej(e); - reject(e); - } - ); - }); - executionQueue.push(performCall); - executeQueue().catch(reject); - }); - }; - const render$2 = (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 _a; - log$1.error("Error parsing", e); - (_a = mermaid.parseError) == null ? void 0 : _a.call(mermaid, e); - rej(e); - reject(e); - } - ); - }); - executionQueue.push(performCall); - executeQueue().catch(reject); - }); - }; - const mermaid = { - startOnLoad: true, - mermaidAPI, - parse: parse$1, - render: render$2, - init, - run: run$3, - registerExternalDiagrams, - initialize, - parseError: void 0, - contentLoaded, - setParseErrorHandler, - detectType - }; - 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, 6], $V1 = [1, 7], $V2 = [1, 8], $V3 = [1, 9], $V4 = [1, 16], $V5 = [1, 11], $V6 = [1, 12], $V7 = [1, 13], $V8 = [1, 14], $V9 = [1, 15], $Va = [1, 27], $Vb = [1, 33], $Vc = [1, 34], $Vd = [1, 35], $Ve = [1, 36], $Vf = [1, 37], $Vg = [1, 72], $Vh = [1, 73], $Vi = [1, 74], $Vj = [1, 75], $Vk = [1, 76], $Vl = [1, 77], $Vm = [1, 78], $Vn = [1, 38], $Vo = [1, 39], $Vp = [1, 40], $Vq = [1, 41], $Vr = [1, 42], $Vs = [1, 43], $Vt = [1, 44], $Vu = [1, 45], $Vv = [1, 46], $Vw = [1, 47], $Vx = [1, 48], $Vy = [1, 49], $Vz = [1, 50], $VA = [1, 51], $VB = [1, 52], $VC = [1, 53], $VD = [1, 54], $VE = [1, 55], $VF = [1, 56], $VG = [1, 57], $VH = [1, 59], $VI = [1, 60], $VJ = [1, 61], $VK = [1, 62], $VL = [1, 63], $VM = [1, 64], $VN = [1, 65], $VO = [1, 66], $VP = [1, 67], $VQ = [1, 68], $VR = [1, 69], $VS = [24, 52], $VT = [24, 44, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84], $VU = [15, 24, 44, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84], $VV = [1, 94], $VW = [1, 95], $VX = [1, 96], $VY = [1, 97], $VZ = [15, 24, 52], $V_ = [7, 8, 9, 10, 18, 22, 25, 26, 27, 28], $V$ = [15, 24, 43, 52], $V01 = [15, 24, 43, 52, 86, 87, 89, 90], $V11 = [15, 43], $V21 = [44, 46, 47, 48, 49, 50, 51, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "mermaidDoc": 4, "direction": 5, "directive": 6, "direction_tb": 7, "direction_bt": 8, "direction_rl": 9, "direction_lr": 10, "graphConfig": 11, "openDirective": 12, "typeDirective": 13, "closeDirective": 14, "NEWLINE": 15, ":": 16, "argDirective": 17, "open_directive": 18, "type_directive": 19, "arg_directive": 20, "close_directive": 21, "C4_CONTEXT": 22, "statements": 23, "EOF": 24, "C4_CONTAINER": 25, "C4_COMPONENT": 26, "C4_DYNAMIC": 27, "C4_DEPLOYMENT": 28, "otherStatements": 29, "diagramStatements": 30, "otherStatement": 31, "title": 32, "accDescription": 33, "acc_title": 34, "acc_title_value": 35, "acc_descr": 36, "acc_descr_value": 37, "acc_descr_multiline_value": 38, "boundaryStatement": 39, "boundaryStartStatement": 40, "boundaryStopStatement": 41, "boundaryStart": 42, "LBRACE": 43, "ENTERPRISE_BOUNDARY": 44, "attributes": 45, "SYSTEM_BOUNDARY": 46, "BOUNDARY": 47, "CONTAINER_BOUNDARY": 48, "NODE": 49, "NODE_L": 50, "NODE_R": 51, "RBRACE": 52, "diagramStatement": 53, "PERSON": 54, "PERSON_EXT": 55, "SYSTEM": 56, "SYSTEM_DB": 57, "SYSTEM_QUEUE": 58, "SYSTEM_EXT": 59, "SYSTEM_EXT_DB": 60, "SYSTEM_EXT_QUEUE": 61, "CONTAINER": 62, "CONTAINER_DB": 63, "CONTAINER_QUEUE": 64, "CONTAINER_EXT": 65, "CONTAINER_EXT_DB": 66, "CONTAINER_EXT_QUEUE": 67, "COMPONENT": 68, "COMPONENT_DB": 69, "COMPONENT_QUEUE": 70, "COMPONENT_EXT": 71, "COMPONENT_EXT_DB": 72, "COMPONENT_EXT_QUEUE": 73, "REL": 74, "BIREL": 75, "REL_U": 76, "REL_D": 77, "REL_L": 78, "REL_R": 79, "REL_B": 80, "REL_INDEX": 81, "UPDATE_EL_STYLE": 82, "UPDATE_REL_STYLE": 83, "UPDATE_LAYOUT_CONFIG": 84, "attribute": 85, "STR": 86, "STR_KEY": 87, "STR_VALUE": 88, "ATTRIBUTE": 89, "ATTRIBUTE_EMPTY": 90, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 7: "direction_tb", 8: "direction_bt", 9: "direction_rl", 10: "direction_lr", 15: "NEWLINE", 16: ":", 18: "open_directive", 19: "type_directive", 20: "arg_directive", 21: "close_directive", 22: "C4_CONTEXT", 24: "EOF", 25: "C4_CONTAINER", 26: "C4_COMPONENT", 27: "C4_DYNAMIC", 28: "C4_DEPLOYMENT", 32: "title", 33: "accDescription", 34: "acc_title", 35: "acc_title_value", 36: "acc_descr", 37: "acc_descr_value", 38: "acc_descr_multiline_value", 43: "LBRACE", 44: "ENTERPRISE_BOUNDARY", 46: "SYSTEM_BOUNDARY", 47: "BOUNDARY", 48: "CONTAINER_BOUNDARY", 49: "NODE", 50: "NODE_L", 51: "NODE_R", 52: "RBRACE", 54: "PERSON", 55: "PERSON_EXT", 56: "SYSTEM", 57: "SYSTEM_DB", 58: "SYSTEM_QUEUE", 59: "SYSTEM_EXT", 60: "SYSTEM_EXT_DB", 61: "SYSTEM_EXT_QUEUE", 62: "CONTAINER", 63: "CONTAINER_DB", 64: "CONTAINER_QUEUE", 65: "CONTAINER_EXT", 66: "CONTAINER_EXT_DB", 67: "CONTAINER_EXT_QUEUE", 68: "COMPONENT", 69: "COMPONENT_DB", 70: "COMPONENT_QUEUE", 71: "COMPONENT_EXT", 72: "COMPONENT_EXT_DB", 73: "COMPONENT_EXT_QUEUE", 74: "REL", 75: "BIREL", 76: "REL_U", 77: "REL_D", 78: "REL_L", 79: "REL_R", 80: "REL_B", 81: "REL_INDEX", 82: "UPDATE_EL_STYLE", 83: "UPDATE_REL_STYLE", 84: "UPDATE_LAYOUT_CONFIG", 86: "STR", 87: "STR_KEY", 88: "STR_VALUE", 89: "ATTRIBUTE", 90: "ATTRIBUTE_EMPTY" }, - productions_: [0, [3, 1], [3, 1], [3, 2], [5, 1], [5, 1], [5, 1], [5, 1], [4, 1], [6, 4], [6, 6], [12, 1], [13, 1], [17, 1], [14, 1], [11, 4], [11, 4], [11, 4], [11, 4], [11, 4], [23, 1], [23, 1], [23, 2], [29, 1], [29, 2], [29, 3], [31, 1], [31, 1], [31, 2], [31, 2], [31, 1], [39, 3], [40, 3], [40, 3], [40, 4], [42, 2], [42, 2], [42, 2], [42, 2], [42, 2], [42, 2], [42, 2], [41, 1], [30, 1], [30, 2], [30, 3], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 1], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [45, 1], [45, 2], [85, 1], [85, 2], [85, 1], [85, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 4: - yy.setDirection("TB"); - break; - case 5: - yy.setDirection("BT"); - break; - case 6: - yy.setDirection("RL"); - break; - case 7: - yy.setDirection("LR"); - break; - case 11: - yy.parseDirective("%%{", "open_directive"); - break; - case 12: - break; - case 13: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); - yy.parseDirective($$[$0], "arg_directive"); - break; - case 14: - yy.parseDirective("}%%", "close_directive", "c4Context"); - break; - case 15: - case 16: - case 17: - case 18: - case 19: - yy.setC4Type($$[$0 - 3]); - break; - case 26: - yy.setTitle($$[$0].substring(6)); - this.$ = $$[$0].substring(6); - break; - case 27: - yy.setAccDescription($$[$0].substring(15)); - this.$ = $$[$0].substring(15); - break; - case 28: - this.$ = $$[$0].trim(); - yy.setTitle(this.$); - break; - case 29: - case 30: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 35: - case 36: - $$[$0].splice(2, 0, "ENTERPRISE"); - yy.addPersonOrSystemBoundary(...$$[$0]); - this.$ = $$[$0]; - break; - case 37: - yy.addPersonOrSystemBoundary(...$$[$0]); - this.$ = $$[$0]; - break; - case 38: - $$[$0].splice(2, 0, "CONTAINER"); - yy.addContainerBoundary(...$$[$0]); - this.$ = $$[$0]; - break; - case 39: - yy.addDeploymentNode("node", ...$$[$0]); - this.$ = $$[$0]; - break; - case 40: - yy.addDeploymentNode("nodeL", ...$$[$0]); - this.$ = $$[$0]; - break; - case 41: - yy.addDeploymentNode("nodeR", ...$$[$0]); - this.$ = $$[$0]; - break; - case 42: - yy.popBoundaryParseStack(); - break; - case 46: - yy.addPersonOrSystem("person", ...$$[$0]); - this.$ = $$[$0]; - break; - case 47: - yy.addPersonOrSystem("external_person", ...$$[$0]); - this.$ = $$[$0]; - break; - case 48: - yy.addPersonOrSystem("system", ...$$[$0]); - this.$ = $$[$0]; - break; - case 49: - yy.addPersonOrSystem("system_db", ...$$[$0]); - this.$ = $$[$0]; - break; - case 50: - yy.addPersonOrSystem("system_queue", ...$$[$0]); - this.$ = $$[$0]; - break; - case 51: - yy.addPersonOrSystem("external_system", ...$$[$0]); - this.$ = $$[$0]; - break; - case 52: - yy.addPersonOrSystem("external_system_db", ...$$[$0]); - this.$ = $$[$0]; - break; - case 53: - yy.addPersonOrSystem("external_system_queue", ...$$[$0]); - this.$ = $$[$0]; - break; - case 54: - yy.addContainer("container", ...$$[$0]); - this.$ = $$[$0]; - break; - case 55: - yy.addContainer("container_db", ...$$[$0]); - this.$ = $$[$0]; - break; - case 56: - yy.addContainer("container_queue", ...$$[$0]); - this.$ = $$[$0]; - break; - case 57: - yy.addContainer("external_container", ...$$[$0]); - this.$ = $$[$0]; - break; - case 58: - yy.addContainer("external_container_db", ...$$[$0]); - this.$ = $$[$0]; - break; - case 59: - yy.addContainer("external_container_queue", ...$$[$0]); - this.$ = $$[$0]; - break; - case 60: - yy.addComponent("component", ...$$[$0]); - this.$ = $$[$0]; - break; - case 61: - yy.addComponent("component_db", ...$$[$0]); - this.$ = $$[$0]; - break; - case 62: - yy.addComponent("component_queue", ...$$[$0]); - this.$ = $$[$0]; - break; - case 63: - yy.addComponent("external_component", ...$$[$0]); - this.$ = $$[$0]; - break; - case 64: - yy.addComponent("external_component_db", ...$$[$0]); - this.$ = $$[$0]; - break; - case 65: - yy.addComponent("external_component_queue", ...$$[$0]); - this.$ = $$[$0]; - break; - case 67: - yy.addRel("rel", ...$$[$0]); - this.$ = $$[$0]; - break; - case 68: - yy.addRel("birel", ...$$[$0]); - this.$ = $$[$0]; - break; - case 69: - yy.addRel("rel_u", ...$$[$0]); - this.$ = $$[$0]; - break; - case 70: - yy.addRel("rel_d", ...$$[$0]); - this.$ = $$[$0]; - break; - case 71: - yy.addRel("rel_l", ...$$[$0]); - this.$ = $$[$0]; - break; - case 72: - yy.addRel("rel_r", ...$$[$0]); - this.$ = $$[$0]; - break; - case 73: - yy.addRel("rel_b", ...$$[$0]); - this.$ = $$[$0]; - break; - case 74: - $$[$0].splice(0, 1); - yy.addRel("rel", ...$$[$0]); - this.$ = $$[$0]; - break; - case 75: - yy.updateElStyle("update_el_style", ...$$[$0]); - this.$ = $$[$0]; - break; - case 76: - yy.updateRelStyle("update_rel_style", ...$$[$0]); - this.$ = $$[$0]; - break; - case 77: - yy.updateLayoutConfig("update_layout_config", ...$$[$0]); - this.$ = $$[$0]; - break; - case 78: - this.$ = [$$[$0]]; - break; - case 79: - $$[$0].unshift($$[$0 - 1]); - this.$ = $$[$0]; - break; - case 80: - case 82: - this.$ = $$[$0].trim(); - break; - case 81: - let kv = {}; - kv[$$[$0 - 1].trim()] = $$[$0].trim(); - this.$ = kv; - break; - case 83: - this.$ = ""; - break; - } - }, - table: [{ 3: 1, 4: 2, 5: 3, 6: 4, 7: $V0, 8: $V1, 9: $V2, 10: $V3, 11: 5, 12: 10, 18: $V4, 22: $V5, 25: $V6, 26: $V7, 27: $V8, 28: $V9 }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 3: 17, 4: 2, 5: 3, 6: 4, 7: $V0, 8: $V1, 9: $V2, 10: $V3, 11: 5, 12: 10, 18: $V4, 22: $V5, 25: $V6, 26: $V7, 27: $V8, 28: $V9 }, { 1: [2, 8] }, { 1: [2, 4] }, { 1: [2, 5] }, { 1: [2, 6] }, { 1: [2, 7] }, { 13: 18, 19: [1, 19] }, { 15: [1, 20] }, { 15: [1, 21] }, { 15: [1, 22] }, { 15: [1, 23] }, { 15: [1, 24] }, { 19: [2, 11] }, { 1: [2, 3] }, { 14: 25, 16: [1, 26], 21: $Va }, o([16, 21], [2, 12]), { 23: 28, 29: 29, 30: 30, 31: 31, 32: $Vb, 33: $Vc, 34: $Vd, 36: $Ve, 38: $Vf, 39: 58, 40: 70, 42: 71, 44: $Vg, 46: $Vh, 47: $Vi, 48: $Vj, 49: $Vk, 50: $Vl, 51: $Vm, 53: 32, 54: $Vn, 55: $Vo, 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 63: $Vw, 64: $Vx, 65: $Vy, 66: $Vz, 67: $VA, 68: $VB, 69: $VC, 70: $VD, 71: $VE, 72: $VF, 73: $VG, 74: $VH, 75: $VI, 76: $VJ, 77: $VK, 78: $VL, 79: $VM, 80: $VN, 81: $VO, 82: $VP, 83: $VQ, 84: $VR }, { 23: 79, 29: 29, 30: 30, 31: 31, 32: $Vb, 33: $Vc, 34: $Vd, 36: $Ve, 38: $Vf, 39: 58, 40: 70, 42: 71, 44: $Vg, 46: $Vh, 47: $Vi, 48: $Vj, 49: $Vk, 50: $Vl, 51: $Vm, 53: 32, 54: $Vn, 55: $Vo, 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 63: $Vw, 64: $Vx, 65: $Vy, 66: $Vz, 67: $VA, 68: $VB, 69: $VC, 70: $VD, 71: $VE, 72: $VF, 73: $VG, 74: $VH, 75: $VI, 76: $VJ, 77: $VK, 78: $VL, 79: $VM, 80: $VN, 81: $VO, 82: $VP, 83: $VQ, 84: $VR }, { 23: 80, 29: 29, 30: 30, 31: 31, 32: $Vb, 33: $Vc, 34: $Vd, 36: $Ve, 38: $Vf, 39: 58, 40: 70, 42: 71, 44: $Vg, 46: $Vh, 47: $Vi, 48: $Vj, 49: $Vk, 50: $Vl, 51: $Vm, 53: 32, 54: $Vn, 55: $Vo, 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 63: $Vw, 64: $Vx, 65: $Vy, 66: $Vz, 67: $VA, 68: $VB, 69: $VC, 70: $VD, 71: $VE, 72: $VF, 73: $VG, 74: $VH, 75: $VI, 76: $VJ, 77: $VK, 78: $VL, 79: $VM, 80: $VN, 81: $VO, 82: $VP, 83: $VQ, 84: $VR }, { 23: 81, 29: 29, 30: 30, 31: 31, 32: $Vb, 33: $Vc, 34: $Vd, 36: $Ve, 38: $Vf, 39: 58, 40: 70, 42: 71, 44: $Vg, 46: $Vh, 47: $Vi, 48: $Vj, 49: $Vk, 50: $Vl, 51: $Vm, 53: 32, 54: $Vn, 55: $Vo, 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 63: $Vw, 64: $Vx, 65: $Vy, 66: $Vz, 67: $VA, 68: $VB, 69: $VC, 70: $VD, 71: $VE, 72: $VF, 73: $VG, 74: $VH, 75: $VI, 76: $VJ, 77: $VK, 78: $VL, 79: $VM, 80: $VN, 81: $VO, 82: $VP, 83: $VQ, 84: $VR }, { 23: 82, 29: 29, 30: 30, 31: 31, 32: $Vb, 33: $Vc, 34: $Vd, 36: $Ve, 38: $Vf, 39: 58, 40: 70, 42: 71, 44: $Vg, 46: $Vh, 47: $Vi, 48: $Vj, 49: $Vk, 50: $Vl, 51: $Vm, 53: 32, 54: $Vn, 55: $Vo, 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 63: $Vw, 64: $Vx, 65: $Vy, 66: $Vz, 67: $VA, 68: $VB, 69: $VC, 70: $VD, 71: $VE, 72: $VF, 73: $VG, 74: $VH, 75: $VI, 76: $VJ, 77: $VK, 78: $VL, 79: $VM, 80: $VN, 81: $VO, 82: $VP, 83: $VQ, 84: $VR }, { 15: [1, 83] }, { 17: 84, 20: [1, 85] }, { 15: [2, 14] }, { 24: [1, 86] }, o($VS, [2, 20], { 53: 32, 39: 58, 40: 70, 42: 71, 30: 87, 44: $Vg, 46: $Vh, 47: $Vi, 48: $Vj, 49: $Vk, 50: $Vl, 51: $Vm, 54: $Vn, 55: $Vo, 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 63: $Vw, 64: $Vx, 65: $Vy, 66: $Vz, 67: $VA, 68: $VB, 69: $VC, 70: $VD, 71: $VE, 72: $VF, 73: $VG, 74: $VH, 75: $VI, 76: $VJ, 77: $VK, 78: $VL, 79: $VM, 80: $VN, 81: $VO, 82: $VP, 83: $VQ, 84: $VR }), o($VS, [2, 21]), o($VT, [2, 23], { 15: [1, 88] }), o($VS, [2, 43], { 15: [1, 89] }), o($VU, [2, 26]), o($VU, [2, 27]), { 35: [1, 90] }, { 37: [1, 91] }, o($VU, [2, 30]), { 45: 92, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 98, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 99, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 100, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 101, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 102, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 103, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 104, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 105, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 106, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 107, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 108, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 109, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 110, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 111, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 112, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 113, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 114, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 115, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 116, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, o($VZ, [2, 66]), { 45: 117, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 118, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 119, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 120, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 121, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 122, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 123, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 124, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 125, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 126, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 127, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 30: 128, 39: 58, 40: 70, 42: 71, 44: $Vg, 46: $Vh, 47: $Vi, 48: $Vj, 49: $Vk, 50: $Vl, 51: $Vm, 53: 32, 54: $Vn, 55: $Vo, 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 63: $Vw, 64: $Vx, 65: $Vy, 66: $Vz, 67: $VA, 68: $VB, 69: $VC, 70: $VD, 71: $VE, 72: $VF, 73: $VG, 74: $VH, 75: $VI, 76: $VJ, 77: $VK, 78: $VL, 79: $VM, 80: $VN, 81: $VO, 82: $VP, 83: $VQ, 84: $VR }, { 15: [1, 130], 43: [1, 129] }, { 45: 131, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 132, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 133, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 134, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 135, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 136, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 137, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 24: [1, 138] }, { 24: [1, 139] }, { 24: [1, 140] }, { 24: [1, 141] }, o($V_, [2, 9]), { 14: 142, 21: $Va }, { 21: [2, 13] }, { 1: [2, 15] }, o($VS, [2, 22]), o($VT, [2, 24], { 31: 31, 29: 143, 32: $Vb, 33: $Vc, 34: $Vd, 36: $Ve, 38: $Vf }), o($VS, [2, 44], { 29: 29, 30: 30, 31: 31, 53: 32, 39: 58, 40: 70, 42: 71, 23: 144, 32: $Vb, 33: $Vc, 34: $Vd, 36: $Ve, 38: $Vf, 44: $Vg, 46: $Vh, 47: $Vi, 48: $Vj, 49: $Vk, 50: $Vl, 51: $Vm, 54: $Vn, 55: $Vo, 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 63: $Vw, 64: $Vx, 65: $Vy, 66: $Vz, 67: $VA, 68: $VB, 69: $VC, 70: $VD, 71: $VE, 72: $VF, 73: $VG, 74: $VH, 75: $VI, 76: $VJ, 77: $VK, 78: $VL, 79: $VM, 80: $VN, 81: $VO, 82: $VP, 83: $VQ, 84: $VR }), o($VU, [2, 28]), o($VU, [2, 29]), o($VZ, [2, 46]), o($V$, [2, 78], { 85: 93, 45: 145, 86: $VV, 87: $VW, 89: $VX, 90: $VY }), o($V01, [2, 80]), { 88: [1, 146] }, o($V01, [2, 82]), o($V01, [2, 83]), o($VZ, [2, 47]), o($VZ, [2, 48]), o($VZ, [2, 49]), o($VZ, [2, 50]), o($VZ, [2, 51]), o($VZ, [2, 52]), o($VZ, [2, 53]), o($VZ, [2, 54]), o($VZ, [2, 55]), o($VZ, [2, 56]), o($VZ, [2, 57]), o($VZ, [2, 58]), o($VZ, [2, 59]), o($VZ, [2, 60]), o($VZ, [2, 61]), o($VZ, [2, 62]), o($VZ, [2, 63]), o($VZ, [2, 64]), o($VZ, [2, 65]), o($VZ, [2, 67]), o($VZ, [2, 68]), o($VZ, [2, 69]), o($VZ, [2, 70]), o($VZ, [2, 71]), o($VZ, [2, 72]), o($VZ, [2, 73]), o($VZ, [2, 74]), o($VZ, [2, 75]), o($VZ, [2, 76]), o($VZ, [2, 77]), { 41: 147, 52: [1, 148] }, { 15: [1, 149] }, { 43: [1, 150] }, o($V11, [2, 35]), o($V11, [2, 36]), o($V11, [2, 37]), o($V11, [2, 38]), o($V11, [2, 39]), o($V11, [2, 40]), o($V11, [2, 41]), { 1: [2, 16] }, { 1: [2, 17] }, { 1: [2, 18] }, { 1: [2, 19] }, { 15: [1, 151] }, o($VT, [2, 25]), o($VS, [2, 45]), o($V$, [2, 79]), o($V01, [2, 81]), o($VZ, [2, 31]), o($VZ, [2, 42]), o($V21, [2, 32]), o($V21, [2, 33], { 15: [1, 152] }), o($V_, [2, 10]), o($V21, [2, 34])], - defaultActions: { 2: [2, 1], 3: [2, 2], 5: [2, 8], 6: [2, 4], 7: [2, 5], 8: [2, 6], 9: [2, 7], 16: [2, 11], 17: [2, 3], 27: [2, 14], 85: [2, 13], 86: [2, 15], 138: [2, 16], 139: [2, 17], 140: [2, 18], 141: [2, 19] }, - parseError: function parseError2(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 parseError2(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 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; - }, - // unshifts one char (or a string) into the input - unput: 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 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, 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 && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = 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[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 - }); - } - }, - // 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: - this.begin("open_directive"); - return 18; - case 1: - return 7; - case 2: - return 8; - case 3: - return 9; - case 4: - return 10; - case 5: - this.begin("type_directive"); - return 19; - case 6: - this.popState(); - this.begin("arg_directive"); - return 16; - case 7: - this.popState(); - this.popState(); - return 21; - case 8: - return 20; - case 9: - return 32; - case 10: - return 33; - case 11: - this.begin("acc_title"); - return 34; - case 12: - this.popState(); - return "acc_title_value"; - case 13: - this.begin("acc_descr"); - return 36; - case 14: - this.popState(); - return "acc_descr_value"; - case 15: - this.begin("acc_descr_multiline"); - break; - case 16: - this.popState(); - break; - case 17: - return "acc_descr_multiline_value"; - case 18: - break; - case 19: - c; - break; - case 20: - return 15; - case 21: - break; - case 22: - return 22; - case 23: - return 25; - case 24: - return 26; - case 25: - return 27; - case 26: - return 28; - case 27: - this.begin("person_ext"); - return 55; - case 28: - this.begin("person"); - return 54; - case 29: - this.begin("system_ext_queue"); - return 61; - case 30: - this.begin("system_ext_db"); - return 60; - case 31: - this.begin("system_ext"); - return 59; - case 32: - this.begin("system_queue"); - return 58; - case 33: - this.begin("system_db"); - return 57; - case 34: - this.begin("system"); - return 56; - case 35: - this.begin("boundary"); - return 47; - case 36: - this.begin("enterprise_boundary"); - return 44; - case 37: - this.begin("system_boundary"); - return 46; - case 38: - this.begin("container_ext_queue"); - return 67; - case 39: - this.begin("container_ext_db"); - return 66; - case 40: - this.begin("container_ext"); - return 65; - case 41: - this.begin("container_queue"); - return 64; - case 42: - this.begin("container_db"); - return 63; - case 43: - this.begin("container"); - return 62; - case 44: - this.begin("container_boundary"); - return 48; - case 45: - this.begin("component_ext_queue"); - return 73; - case 46: - this.begin("component_ext_db"); - return 72; - case 47: - this.begin("component_ext"); - return 71; - case 48: - this.begin("component_queue"); - return 70; - case 49: - this.begin("component_db"); - return 69; - case 50: - this.begin("component"); - return 68; - case 51: - this.begin("node"); - return 49; - case 52: - this.begin("node"); - return 49; - case 53: - this.begin("node_l"); - return 50; - case 54: - this.begin("node_r"); - return 51; - case 55: - this.begin("rel"); - return 74; - case 56: - this.begin("birel"); - return 75; - case 57: - this.begin("rel_u"); - return 76; - case 58: - this.begin("rel_u"); - return 76; - case 59: - this.begin("rel_d"); - return 77; - case 60: - this.begin("rel_d"); - return 77; - case 61: - this.begin("rel_l"); - return 78; - case 62: - this.begin("rel_l"); - return 78; - case 63: - this.begin("rel_r"); - return 79; - case 64: - this.begin("rel_r"); - return 79; - case 65: - this.begin("rel_b"); - return 80; - case 66: - this.begin("rel_index"); - return 81; - case 67: - this.begin("update_el_style"); - return 82; - case 68: - this.begin("update_rel_style"); - return 83; - case 69: - this.begin("update_layout_config"); - return 84; - case 70: - return "EOF_IN_STRUCT"; - case 71: - this.begin("attribute"); - return "ATTRIBUTE_EMPTY"; - case 72: - this.begin("attribute"); - break; - case 73: - this.popState(); - this.popState(); - break; - case 74: - return 90; - case 75: - break; - case 76: - return 90; - case 77: - this.begin("string"); - break; - case 78: - this.popState(); - break; - case 79: - return "STR"; - case 80: - this.begin("string_kv"); - break; - case 81: - this.begin("string_kv_key"); - return "STR_KEY"; - case 82: - this.popState(); - this.begin("string_kv_value"); - break; - case 83: - return "STR_VALUE"; - case 84: - this.popState(); - this.popState(); - break; - case 85: - return "STR"; - case 86: - return "LBRACE"; - case 87: - return "RBRACE"; - case 88: - return "SPACE"; - case 89: - return "EOL"; - case 90: - return 24; - } - }, - rules: [/^(?:%%\{)/, /^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:((?:(?!\}%%)[^:.])*))/, /^(?::)/, /^(?:\}%%)/, /^(?:((?:(?!\}%%).|\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": [16, 17], "inclusive": false }, "acc_descr": { "rules": [14], "inclusive": false }, "acc_title": { "rules": [12], "inclusive": false }, "close_directive": { "rules": [], "inclusive": false }, "arg_directive": { "rules": [7, 8], "inclusive": false }, "type_directive": { "rules": [6, 7], "inclusive": false }, "open_directive": { "rules": [5], "inclusive": false }, "string_kv_value": { "rules": [83, 84], "inclusive": false }, "string_kv_key": { "rules": [82], "inclusive": false }, "string_kv": { "rules": [81], "inclusive": false }, "string": { "rules": [78, 79], "inclusive": false }, "attribute": { "rules": [73, 74, 75, 76, 77, 80, 85], "inclusive": false }, "update_layout_config": { "rules": [70, 71, 72, 73], "inclusive": false }, "update_rel_style": { "rules": [70, 71, 72, 73], "inclusive": false }, "update_el_style": { "rules": [70, 71, 72, 73], "inclusive": false }, "rel_b": { "rules": [70, 71, 72, 73], "inclusive": false }, "rel_r": { "rules": [70, 71, 72, 73], "inclusive": false }, "rel_l": { "rules": [70, 71, 72, 73], "inclusive": false }, "rel_d": { "rules": [70, 71, 72, 73], "inclusive": false }, "rel_u": { "rules": [70, 71, 72, 73], "inclusive": false }, "rel_bi": { "rules": [], "inclusive": false }, "rel": { "rules": [70, 71, 72, 73], "inclusive": false }, "node_r": { "rules": [70, 71, 72, 73], "inclusive": false }, "node_l": { "rules": [70, 71, 72, 73], "inclusive": false }, "node": { "rules": [70, 71, 72, 73], "inclusive": false }, "index": { "rules": [], "inclusive": false }, "rel_index": { "rules": [70, 71, 72, 73], "inclusive": false }, "component_ext_queue": { "rules": [], "inclusive": false }, "component_ext_db": { "rules": [70, 71, 72, 73], "inclusive": false }, "component_ext": { "rules": [70, 71, 72, 73], "inclusive": false }, "component_queue": { "rules": [70, 71, 72, 73], "inclusive": false }, "component_db": { "rules": [70, 71, 72, 73], "inclusive": false }, "component": { "rules": [70, 71, 72, 73], "inclusive": false }, "container_boundary": { "rules": [70, 71, 72, 73], "inclusive": false }, "container_ext_queue": { "rules": [], "inclusive": false }, "container_ext_db": { "rules": [70, 71, 72, 73], "inclusive": false }, "container_ext": { "rules": [70, 71, 72, 73], "inclusive": false }, "container_queue": { "rules": [70, 71, 72, 73], "inclusive": false }, "container_db": { "rules": [70, 71, 72, 73], "inclusive": false }, "container": { "rules": [70, 71, 72, 73], "inclusive": false }, "birel": { "rules": [70, 71, 72, 73], "inclusive": false }, "system_boundary": { "rules": [70, 71, 72, 73], "inclusive": false }, "enterprise_boundary": { "rules": [70, 71, 72, 73], "inclusive": false }, "boundary": { "rules": [70, 71, 72, 73], "inclusive": false }, "system_ext_queue": { "rules": [70, 71, 72, 73], "inclusive": false }, "system_ext_db": { "rules": [70, 71, 72, 73], "inclusive": false }, "system_ext": { "rules": [70, 71, 72, 73], "inclusive": false }, "system_queue": { "rules": [70, 71, 72, 73], "inclusive": false }, "system_db": { "rules": [70, 71, 72, 73], "inclusive": false }, "system": { "rules": [70, 71, 72, 73], "inclusive": false }, "person_ext": { "rules": [70, 71, 72, 73], "inclusive": false }, "person": { "rules": [70, 71, 72, 73], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 9, 10, 11, 13, 15, 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, 65, 66, 67, 68, 69, 86, 87, 88, 89, 90], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser() { - this.yy = {}; - } - Parser.prototype = parser2; - parser2.Parser = Parser; - return new Parser(); - }(); - parser$m.parser = parser$m; - const c4Parser = parser$m; - let c4ShapeArray = []; - let boundaryParseStack = [""]; - let currentBoundaryParse = "global"; - let parentBoundaryParse = ""; - let boundarys = [ - { - alias: "global", - label: { text: "global" }, - type: { text: "global" }, - tags: null, - link: null, - parentBoundary: "" + return this; + } + 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"); } - ]; - let rels = []; - let title = ""; - let wrapEnabled$1 = false; - let c4ShapeInRow$1 = 4; - let c4BoundaryInRow$1 = 2; - var c4Type; - const getC4Type = function() { - return c4Type; - }; - const setC4Type = function(c4TypeParam) { - let sanitizedText = sanitizeText$7(c4TypeParam, getConfig$1()); - c4Type = sanitizedText; - }; - const parseDirective$b = function(statement, context, type2) { - mermaidAPI.parseDirective(this, statement, context, type2); - }; - const addRel = function(type2, from2, to, label, techn, descr, sprite, tags2, link) { - if (type2 === void 0 || type2 === null || from2 === void 0 || from2 === null || to === void 0 || to === null || label === void 0 || label === null) { - return; + }); + + // ../../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 attrRemoveNS(fullname) { + return function() { + this.removeAttributeNS(fullname.space, fullname.local); + }; + } + function attrConstant(name, value2) { + return function() { + this.setAttribute(name, value2); + }; + } + function attrConstantNS(fullname, value2) { + return function() { + this.setAttributeNS(fullname.space, fullname.local, value2); + }; + } + function attrFunction(name, value2) { + return function() { + var v3 = value2.apply(this, arguments); + if (v3 == null) this.removeAttribute(name); + else this.setAttribute(name, v3); + }; + } + 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 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); } - let rel = {}; - const old = rels.find((rel2) => rel2.from === from2 && rel2.to === to); - if (old) { - rel = old; - } else { - rels.push(rel); - } - rel.type = type2; - rel.from = from2; - rel.to = to; - rel.label = { text: label }; - if (techn === void 0 || techn === null) { - rel.techn = { text: "" }; - } else { - if (typeof techn === "object") { - let [key, value] = Object.entries(techn)[0]; - rel[key] = { text: value }; - } else { - rel.techn = { text: techn }; - } + return this.each((value2 == null ? fullname.local ? attrRemoveNS : attrRemove : typeof value2 === "function" ? fullname.local ? attrFunctionNS : attrFunction : fullname.local ? attrConstantNS : attrConstant)(fullname, value2)); + } + 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"); } - if (descr === void 0 || descr === null) { - rel.descr = { text: "" }; - } else { - if (typeof descr === "object") { - let [key, value] = Object.entries(descr)[0]; - rel[key] = { text: value }; - } else { - rel.descr = { text: descr }; - } + }); + + // ../../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"); } - if (typeof sprite === "object") { - let [key, value] = Object.entries(sprite)[0]; - rel[key] = value; - } else { - rel.sprite = sprite; + }); + + // ../../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 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"); } - if (typeof tags2 === "object") { - let [key, value] = Object.entries(tags2)[0]; - rel[key] = value; - } else { - rel.tags = tags2; + }); + + // ../../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"); } - if (typeof link === "object") { - let [key, value] = Object.entries(link)[0]; - rel[key] = value; - } else { - rel.link = link; + }); + + // ../../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 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; } - rel.wrap = autoWrap$1(); - }; - const addPersonOrSystem = function(typeC4Shape, alias, label, descr, sprite, tags2, link) { - if (alias === null || label === null) { - return; + 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"); } - let personOrSystem = {}; - const old = c4ShapeArray.find((personOrSystem2) => personOrSystem2.alias === alias); - if (old && alias === old.alias) { - personOrSystem = old; - } else { - personOrSystem.alias = alias; - c4ShapeArray.push(personOrSystem); + }); + + // ../../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 (label === void 0 || label === null) { - personOrSystem.label = { text: "" }; - } else { - personOrSystem.label = { text: label }; + }); + + // ../../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_html2 = __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"); } - if (descr === void 0 || descr === null) { - personOrSystem.descr = { text: "" }; - } else { - if (typeof descr === "object") { - let [key, value] = Object.entries(descr)[0]; - personOrSystem[key] = { text: value }; - } else { - personOrSystem.descr = { text: descr }; - } + }); + + // ../../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 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"); } - if (typeof sprite === "object") { - let [key, value] = Object.entries(sprite)[0]; - personOrSystem[key] = value; - } else { - personOrSystem.sprite = sprite; + }); + + // ../../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 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 (typeof tags2 === "object") { - let [key, value] = Object.entries(tags2)[0]; - personOrSystem[key] = value; - } else { - personOrSystem.tags = tags2; + }); + + // ../../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"); } - if (typeof link === "object") { - let [key, value] = Object.entries(link)[0]; - personOrSystem[key] = value; - } else { - personOrSystem.link = link; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/insert.js + function constantNull() { + return null; + } + 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"); } - personOrSystem.typeC4Shape = { text: typeC4Shape }; - personOrSystem.parentBoundary = currentBoundaryParse; - personOrSystem.wrap = autoWrap$1(); - }; - const addContainer = function(typeC4Shape, alias, label, techn, descr, sprite, tags2, link) { - if (alias === null || label === null) { - return; + }); + + // ../../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 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"); } - let container = {}; - const old = c4ShapeArray.find((container2) => container2.alias === alias); - if (old && alias === old.alias) { - container = old; - } else { - container.alias = alias; - c4ShapeArray.push(container); + }); + + // ../../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 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 (label === void 0 || label === null) { - container.label = { text: "" }; - } else { - container.label = { text: label }; + }); + + // ../../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"); } - if (techn === void 0 || techn === null) { - container.techn = { text: "" }; - } else { - if (typeof techn === "object") { - let [key, value] = Object.entries(techn)[0]; - container[key] = { text: value }; - } else { - container.techn = { text: techn }; + }); + + // ../../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 { + on3[++i2] = o2; + } } - } - if (descr === void 0 || descr === null) { - container.descr = { text: "" }; - } else { - if (typeof descr === "object") { - let [key, value] = Object.entries(descr)[0]; - container[key] = { text: value }; - } else { - container.descr = { text: descr }; + if (++i2) on3.length = i2; + else delete this.__on; + }; + } + 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; + } + } + 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 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; + } + } } - } - if (typeof sprite === "object") { - let [key, value] = Object.entries(sprite)[0]; - container[key] = value; - } else { - container.sprite = sprite; - } - if (typeof tags2 === "object") { - let [key, value] = Object.entries(tags2)[0]; - container[key] = value; - } else { - container.tags = tags2; - } - if (typeof link === "object") { - let [key, value] = Object.entries(link)[0]; - container[key] = value; - } else { - container.link = link; - } - container.wrap = autoWrap$1(); - container.typeC4Shape = { text: typeC4Shape }; - container.parentBoundary = currentBoundaryParse; - }; - const addComponent = function(typeC4Shape, alias, label, techn, descr, sprite, tags2, link) { - 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); + on3 = value2 ? onAdd : onRemove; + for (i2 = 0; i2 < n2; ++i2) this.each(on3(typenames[i2], value2, options3)); + return this; + } + 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"); } - if (label === void 0 || label === null) { - component.label = { text: "" }; + }); + + // ../../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 { - component.label = { text: label }; + 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 (techn === void 0 || techn === null) { - component.techn = { text: "" }; - } else { - if (typeof techn === "object") { - let [key, value] = Object.entries(techn)[0]; - component[key] = { text: value }; - } else { - component.techn = { text: techn }; - } + 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"); } - if (descr === void 0 || descr === null) { - component.descr = { text: "" }; - } else { - if (typeof descr === "object") { - let [key, value] = Object.entries(descr)[0]; - component[key] = { text: value }; - } else { - component.descr = { text: descr }; + }); + + // ../../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; } } - if (typeof sprite === "object") { - let [key, value] = Object.entries(sprite)[0]; - component[key] = value; - } else { - component.sprite = sprite; - } - if (typeof tags2 === "object") { - let [key, value] = Object.entries(tags2)[0]; - component[key] = value; - } else { - component.tags = tags2; - } - if (typeof link === "object") { - let [key, value] = Object.entries(link)[0]; - component[key] = value; - } else { - component.link = link; - } - component.wrap = autoWrap$1(); - component.typeC4Shape = { text: typeC4Shape }; - component.parentBoundary = currentBoundaryParse; - }; - const addPersonOrSystemBoundary = function(alias, label, type2, tags2, link) { - if (alias === null || label === null) { - return; - } - let boundary = {}; - const old = boundarys.find((boundary2) => boundary2.alias === alias); - if (old && alias === old.alias) { - boundary = old; - } else { - boundary.alias = alias; - boundarys.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, value] = Object.entries(type2)[0]; - boundary[key] = { text: value }; - } else { - boundary.type = { text: type2 }; - } + } + 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 (typeof tags2 === "object") { - let [key, value] = Object.entries(tags2)[0]; - boundary[key] = value; - } else { - boundary.tags = tags2; + }); + + // ../../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_merge2(); + init_order(); + init_sort(); + init_call(); + init_nodes(); + init_node(); + init_size2(); + init_empty(); + init_each(); + init_attr(); + init_style(); + init_property(); + init_classed(); + init_text(); + init_html2(); + 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; } - if (typeof link === "object") { - let [key, value] = Object.entries(link)[0]; - boundary[key] = value; - } else { - boundary.link = link; + }); + + // ../../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); + } + 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"); } - boundary.parentBoundary = currentBoundaryParse; - boundary.wrap = autoWrap$1(); - parentBoundaryParse = currentBoundaryParse; - currentBoundaryParse = alias; - boundaryParseStack.push(parentBoundaryParse); - }; - const addContainerBoundary = function(alias, label, type2, tags2, link) { - if (alias === null || label === null) { - return; + }); + + // ../../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(); } - let boundary = {}; - const old = boundarys.find((boundary2) => boundary2.alias === alias); - if (old && alias === old.alias) { - boundary = old; - } else { - boundary.alias = alias; - boundarys.push(boundary); + }); + + // ../../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"; } - if (label === void 0 || label === null) { - boundary.label = { text: "" }; - } else { - boundary.label = { text: label }; + }); + + // ../../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 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"); } - if (type2 === void 0 || type2 === null) { - boundary.type = { text: "container" }; - } else { - if (typeof type2 === "object") { - let [key, value] = Object.entries(type2)[0]; - boundary[key] = { text: value }; - } else { - boundary.type = { text: type2 }; - } - } - if (typeof tags2 === "object") { - let [key, value] = Object.entries(tags2)[0]; - boundary[key] = value; + }); + + // ../../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 { - boundary.tags = tags2; + s2 = l2 > 0 && l2 < 1 ? 0 : h2; } - if (typeof link === "object") { - let [key, value] = Object.entries(link)[0]; - boundary[key] = value; - } else { - boundary.link = link; + 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"); } - boundary.parentBoundary = currentBoundaryParse; - boundary.wrap = autoWrap$1(); - parentBoundaryParse = currentBoundaryParse; - currentBoundaryParse = alias; - boundaryParseStack.push(parentBoundaryParse); - }; - const addDeploymentNode = function(nodeType2, alias, label, type2, descr, sprite, tags2, link) { - if (alias === null || label === null) { - return; + }); + + // ../../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; } - let boundary = {}; - const old = boundarys.find((boundary2) => boundary2.alias === alias); - if (old && alias === old.alias) { - boundary = old; - } else { - boundary.alias = alias; - boundarys.push(boundary); + }); + + // ../../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); } - if (label === void 0 || label === null) { - boundary.label = { text: "" }; - } else { - boundary.label = { text: label }; + return new Lab(116 * y5 - 16, 500 * (x5 - y5), 200 * (y5 - z2), o2.opacity); + } + 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 (type2 === void 0 || type2 === null) { - boundary.type = { text: "node" }; - } else { - if (typeof type2 === "object") { - let [key, value] = Object.entries(type2)[0]; - boundary[key] = { text: value }; - } else { - boundary.type = { text: type2 }; - } + }); + + // ../../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(); } - if (descr === void 0 || descr === null) { - boundary.descr = { text: "" }; - } else { - if (typeof descr === "object") { - let [key, value] = Object.entries(descr)[0]; - boundary[key] = { text: value }; - } else { - boundary.descr = { text: descr }; - } + }); + + // ../../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); + }; + } + 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 (typeof tags2 === "object") { - let [key, value] = Object.entries(tags2)[0]; - boundary[key] = value; - } else { - boundary.tags = tags2; + }); + + // ../../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"); } - if (typeof link === "object") { - let [key, value] = Object.entries(link)[0]; - boundary[key] = value; - } else { - boundary.link = link; - } - 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((element) => element.alias === elementName); - if (old === void 0) { - old = boundarys.find((element) => element.alias === elementName); - if (old === void 0) { - return; - } + }); + + // ../../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"); } - if (bgColor !== void 0 && bgColor !== null) { - if (typeof bgColor === "object") { - let [key, value] = Object.entries(bgColor)[0]; - old[key] = value; - } else { - old.bgColor = bgColor; - } + }); + + // ../../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 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"); } - if (fontColor !== void 0 && fontColor !== null) { - if (typeof fontColor === "object") { - let [key, value] = Object.entries(fontColor)[0]; - old[key] = value; - } else { - old.fontColor = fontColor; - } + }); + + // ../../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 (borderColor !== void 0 && borderColor !== null) { - if (typeof borderColor === "object") { - let [key, value] = Object.entries(borderColor)[0]; - old[key] = value; - } else { - old.borderColor = borderColor; - } + }); + + // ../../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 (shadowing !== void 0 && shadowing !== null) { - if (typeof shadowing === "object") { - let [key, value] = Object.entries(shadowing)[0]; - old[key] = value; - } else { - old.shadowing = shadowing; - } + }); + + // ../../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 (shape !== void 0 && shape !== null) { - if (typeof shape === "object") { - let [key, value] = Object.entries(shape)[0]; - old[key] = value; - } else { - old.shape = shape; - } + }); + + // ../../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 (sprite !== void 0 && sprite !== null) { - if (typeof sprite === "object") { - let [key, value] = Object.entries(sprite)[0]; - old[key] = value; - } else { - old.sprite = sprite; - } + }); + + // ../../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"); } - if (techn !== void 0 && techn !== null) { - if (typeof techn === "object") { - let [key, value] = Object.entries(techn)[0]; - old[key] = value; + }); + + // ../../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 { - old.techn = techn; + c3[k2] = b2[k2]; } } - if (legendText !== void 0 && legendText !== null) { - if (typeof legendText === "object") { - let [key, value] = Object.entries(legendText)[0]; - old[key] = value; - } else { - old.legendText = legendText; - } + 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"); } - if (legendSprite !== void 0 && legendSprite !== null) { - if (typeof legendSprite === "object") { - let [key, value] = Object.entries(legendSprite)[0]; - old[key] = value; + }); + + // ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/string.js + function zero2(b2) { + return function() { + return b2; + }; + } + 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 ((am = am[0]) === (bm = bm[0])) { + if (s2[i2]) s2[i2] += bm; + else s2[++i2] = bm; } else { - old.legendSprite = legendSprite; + s2[++i2] = null; + q2.push({ i: i2, x: number_default(am, bm) }); } + bi = reB.lastIndex; } - }; - const updateRelStyle = function(typeC4Shape, from2, to, textColor, lineColor, offsetX, offsetY) { - const old = rels.find((rel) => rel.from === from2 && rel.to === to); - if (old === void 0) { - return; + if (bi < b2.length) { + bs = b2.slice(bi); + if (s2[i2]) s2[i2] += bs; + else s2[++i2] = bs; } - if (textColor !== void 0 && textColor !== null) { - if (typeof textColor === "object") { - let [key, value] = Object.entries(textColor)[0]; - old[key] = value; - } else { - old.textColor = textColor; + 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"); + } + }); + + // ../../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); + }; + } + 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"); + } + }); + + // ../../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"); + } + }); + + // ../../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"); + } + }); + + // ../../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() + " " : ""; + } + __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); } } - if (lineColor !== void 0 && lineColor !== null) { - if (typeof lineColor === "object") { - let [key, value] = Object.entries(lineColor)[0]; - old[key] = value; - } else { - old.lineColor = lineColor; + __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); } } - if (offsetX !== void 0 && offsetX !== null) { - if (typeof offsetX === "object") { - let [key, value] = Object.entries(offsetX)[0]; - old[key] = parseInt(value); - } else { - old.offsetX = parseInt(offsetX); + __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); } } - if (offsetY !== void 0 && offsetY !== null) { - if (typeof offsetY === "object") { - let [key, value] = Object.entries(offsetY)[0]; - old[key] = parseInt(value); + __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(""); + }; + }; + } + 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, ", ", ")", ")"); + } + }); + + // ../../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 + ""; + }; + }; + } + 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); + } + }); + + // ../../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(); + } + }); + + // ../../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); + } + function clearNow() { + clockNow = 0; + } + 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 { + 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 { - old.offsetY = parseInt(offsetY); + t22 = t13._next, t13._next = null; + t13 = t03 ? t03._next = t22 : taskHead = t22; } } - }; - const updateLayoutConfig = function(typeC4Shape, c4ShapeInRowParam, c4BoundaryInRowParam) { - let c4ShapeInRowValue = c4ShapeInRow$1; - let c4BoundaryInRowValue = c4BoundaryInRow$1; - if (typeof c4ShapeInRowParam === "object") { - const value = Object.values(c4ShapeInRowParam)[0]; - c4ShapeInRowValue = parseInt(value); - } else { - c4ShapeInRowValue = parseInt(c4ShapeInRowParam); - } - if (typeof c4BoundaryInRowParam === "object") { - const value = Object.values(c4BoundaryInRowParam)[0]; - c4BoundaryInRowValue = parseInt(value); + taskTail = t03; + sleep(time4); + } + 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 { - c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam); + if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay); + frame = 1, setFrame(wake); } - if (c4ShapeInRowValue >= 1) { - c4ShapeInRow$1 = c4ShapeInRowValue; + } + 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 (c4BoundaryInRowValue >= 1) { - c4BoundaryInRow$1 = c4BoundaryInRowValue; + }); + + // ../../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"); } - }; - 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; - }); + }); + + // ../../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(); } - }; - const getC4Shape = function(alias) { - return c4ShapeArray.find((personOrSystem) => personOrSystem.alias === alias); - }; - const getC4ShapeKeys = function(parentBoundary) { - return Object.keys(getC4ShapeArray(parentBoundary)); - }; - const getBoundarys = function(parentBoundary) { - if (parentBoundary === void 0 || parentBoundary === null) { - return boundarys; - } else { - return boundarys.filter((boundary) => boundary.parentBoundary === parentBoundary); + }); + + // ../../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, id27, index, group2, timing) { + var schedules = node2.__transition; + if (!schedules) node2.__transition = {}; + else if (id27 in schedules) return; + create(node2, id27, { + 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, id27) { + var schedule = get2(node2, id27); + if (schedule.state > CREATED) throw new Error("too late; already scheduled"); + return schedule; + } + function set2(node2, id27) { + var schedule = get2(node2, id27); + if (schedule.state > STARTED) throw new Error("too late; already running"); + return schedule; + } + function get2(node2, id27) { + var schedule = node2.__transition; + if (!schedule || !(schedule = schedule[id27])) throw new Error("transition not found"); + return schedule; + } + function create(node2, id27, self2) { + var schedules = node2.__transition, tween; + schedules[id27] = 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); } - }; - const getRels = function() { - return rels; - }; - const getTitle = function() { - return title; - }; - const setWrap$1 = function(wrapSetting) { - wrapEnabled$1 = wrapSetting; - }; - const autoWrap$1 = function() { - return wrapEnabled$1; - }; - const clear$h = function() { - c4ShapeArray = []; - boundarys = [ - { - alias: "global", - label: { text: "global" }, - type: { text: "global" }, - tags: null, - link: null, - parentBoundary: "" - } - ]; - parentBoundaryParse = ""; - currentBoundaryParse = "global"; - boundaryParseStack = [""]; - rels = []; - boundaryParseStack = [""]; - title = ""; - wrapEnabled$1 = 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$7(txt, getConfig$1()); - title = sanitizedText; - }; - const c4Db = { - addPersonOrSystem, - addPersonOrSystemBoundary, - addContainer, - addContainerBoundary, - addComponent, - addDeploymentNode, - popBoundaryParseStack, - addRel, - updateElStyle, - updateRelStyle, - updateLayoutConfig, - autoWrap: autoWrap$1, - setWrap: setWrap$1, - getC4ShapeArray, - getC4Shape, - getC4ShapeKeys, - getBoundarys, - getCurrentBoundaryParse, - getParentBoundaryParse, - getRels, - getTitle, - getC4Type, - getC4ShapeInRow, - getC4BoundaryInRow, - setAccTitle, - getAccTitle, - getAccDescription, - setAccDescription, - parseDirective: parseDirective$b, - getConfig: () => getConfig$1().c4, - clear: clear$h, - LINETYPE: LINETYPE$1, - ARROWTYPE: ARROWTYPE$1, - PLACEMENT: PLACEMENT$1, - setTitle, - setC4Type - // apply, - }; - const drawRect$3 = 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.attrs !== "undefined" && rectData.attrs !== null) { - for (let attrKey in rectData.attrs) { - rectElem.attr(attrKey, rectData.attrs[attrKey]); - } - } - if (rectData.class !== "undefined") { - rectElem.attr("class", rectData.class); - } - return rectElem; - }; - const drawImage$1 = function(elem, width2, height2, x2, y2, link) { - const imageElem = elem.append("image"); - imageElem.attr("width", width2); - imageElem.attr("height", height2); - imageElem.attr("x", x2); - imageElem.attr("y", y2); - let sanitizedLink = link.startsWith("data:image/png;base64") ? link : sanitizeUrl_1(link); - imageElem.attr("xlink:href", sanitizedLink); - }; - const drawRels$1 = (elem, rels2, conf2) => { - const relsElem = elem.append("g"); - let i2 = 0; - for (let rel of rels2) { - let textColor = rel.textColor ? rel.textColor : "#444444"; - let strokeColor = rel.lineColor ? rel.lineColor : "#444444"; - let offsetX = rel.offsetX ? parseInt(rel.offsetX) : 0; - let offsetY = rel.offsetY ? parseInt(rel.offsetY) : 0; - let url = ""; - if (i2 === 0) { - let line2 = relsElem.append("line"); - line2.attr("x1", rel.startPoint.x); - line2.attr("y1", rel.startPoint.y); - line2.attr("x2", rel.endPoint.x); - line2.attr("y2", rel.endPoint.y); - line2.attr("stroke-width", "1"); - line2.attr("stroke", strokeColor); - line2.style("fill", "none"); - if (rel.type !== "rel_b") { - line2.attr("marker-end", "url(" + url + "#arrowhead)"); - } - if (rel.type === "birel" || rel.type === "rel_b") { - line2.attr("marker-start", "url(" + url + "#arrowend)"); + __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 < id27) { + o2.state = ENDED; + o2.timer.stop(); + o2.on.call("cancel", node2, node2.__data__, o2.index, o2.group); + delete schedules[i2]; } - 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", rel.startPoint.x).replaceAll("starty", rel.startPoint.y).replaceAll( - "controlx", - rel.startPoint.x + (rel.endPoint.x - rel.startPoint.x) / 2 - (rel.endPoint.x - rel.startPoint.x) / 4 - ).replaceAll("controly", rel.startPoint.y + (rel.endPoint.y - rel.startPoint.y) / 2).replaceAll("stopx", rel.endPoint.x).replaceAll("stopy", rel.endPoint.y) - ); - if (rel.type !== "rel_b") { - line2.attr("marker-end", "url(" + url + "#arrowhead)"); + } + timeout_default(function() { + if (self2.state === STARTED) { + self2.state = RUNNING; + self2.timer.restart(tick, self2.delay, self2.time); + tick(elapsed); } - if (rel.type === "birel" || rel.type === "rel_b") { - line2.attr("marker-start", "url(" + url + "#arrowend)"); + }); + 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; } } - let messageConf = conf2.messageFont(); - _drawTextCandidateFunc$3(conf2)( - rel.label.text, - relsElem, - Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX, - Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + offsetY, - rel.label.width, - rel.label.height, - { fill: textColor }, - messageConf - ); - if (rel.techn && rel.techn.text !== "") { - messageConf = conf2.messageFont(); - _drawTextCandidateFunc$3(conf2)( - "[" + rel.techn.text + "]", - relsElem, - Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX, - Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + conf2.messageFontSize + 5 + offsetY, - Math.max(rel.label.width, rel.techn.width), - rel.techn.height, - { fill: textColor, "font-style": "italic" }, - messageConf - ); + tween.length = j2 + 1; + } + __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 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 - ); + __name(tick, "tick"); + function stop5() { + self2.state = ENDED; + self2.timer.stop(); + delete schedules[id27]; + for (var i2 in schedules) return; + delete node2.__transition; } - 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 - ); + __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 drawC4Shape = function(elem, c4Shape, conf2) { - var _a; - 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; + }); + + // ../../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; + } + 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]; } - const c4ShapeElem = elem.append("g"); - c4ShapeElem.attr("class", "person-man"); - const rect2 = getNoteRect$3(); - 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; + 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"); } - 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$1( - c4ShapeElem, - 48, - 48, - c4Shape.x + c4Shape.width / 2 - 24, - c4Shape.y + c4Shape.image.Y, - personImg - ); - break; + }); + + // ../../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); + }); + } + 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"); } - 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 && ((_a = c4Shape.techn) == null ? void 0 : _a.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 - ); + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/tween.js + function tweenRemove(id27, name) { + var tween0, tween1; + return function() { + var schedule = set2(this, id27), 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; + } + } + } + schedule.tween = tween1; + }; + } + function tweenFunction(id27, name, value2) { + var tween0, tween1; + if (typeof value2 !== "function") throw new Error(); + return function() { + var schedule = set2(this, id27), 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 (i2 === n2) tween1.push(t4); + } + schedule.tween = tween1; + }; + } + function tween_default(name, value2) { + var id27 = this._id; + name += ""; + if (arguments.length < 2) { + var tween = get2(this.node(), id27).tween; + for (var i2 = 0, n2 = tween.length, t4; i2 < n2; ++i2) { + if ((t4 = tween[i2]).name === name) { + return t4.value; + } + } + return null; } - 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 this.each((value2 == null ? tweenRemove : tweenFunction)(id27, name, value2)); + } + function tweenValue(transition2, name, value2) { + var id27 = transition2._id; + transition2.each(function() { + var schedule = set2(this, id27); + (schedule.value || (schedule.value = {}))[name] = value2.apply(this, arguments); + }); + return function(node2) { + return get2(node2, id27).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"); } - 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 getNoteRect$3 = function() { - return { - x: 0, - y: 0, - fill: "#EDF2AE", - stroke: "#666", - width: 100, - anchor: "start", - height: 100, - rx: 0, - ry: 0 + }); + + // ../../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"); + } + }); + + // ../../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); }; - }; - const getC4ShapeFont = (cnf, typeC4Shape) => { - return { - fontFamily: cnf[typeC4Shape + "FontFamily"], - fontSize: cnf[typeC4Shape + "FontSize"], - fontWeight: cnf[typeC4Shape + "FontWeight"] + } + function attrRemoveNS2(fullname) { + return function() { + this.removeAttributeNS(fullname.space, fullname.local); }; - }; - const _drawTextCandidateFunc$3 = function() { - function byText(content, g, x2, y2, width2, height2, textAttrs) { - const text2 = g.append("text").attr("x", x2 + width2 / 2).attr("y", y2 + height2 / 2 + 5).style("text-anchor", "middle").text(content); - _setTextAttrs(text2, textAttrs); - } - function byTspan(content, g, x2, y2, width2, height2, textAttrs, conf2) { - const { fontSize, fontFamily, fontWeight } = conf2; - const lines = content.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(content, g, x2, y2, width2, height2, textAttrs, conf2) { - const s = g.append("switch"); - const f2 = s.append("foreignObject").attr("x", x2).attr("y", y2).attr("width", width2).attr("height", height2); - 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(content); - byTspan(content, s, x2, y2, width2, height2, 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; + } + 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); }; - }(); - const svgDraw$5 = { - drawRect: drawRect$3, - drawBoundary: drawBoundary$1, - drawC4Shape, - drawRels: drawRels$1, - drawImage: drawImage$1, - insertArrowHead: insertArrowHead$1, - insertArrowEnd, - insertArrowFilledHead: insertArrowFilledHead$1, - insertDynamicNumber, - insertArrowCrossHead: insertArrowCrossHead$1, - insertDatabaseIcon: insertDatabaseIcon$1, - insertComputerIcon: insertComputerIcon$1, - insertClockIcon: insertClockIcon$1, - getNoteRect: getNoteRect$3, - sanitizeUrl: sanitizeUrl_1 - // TODO why is this exported? - }; - let globalBoundaryMaxX = 0, globalBoundaryMaxY = 0; - let c4ShapeInRow = 4; - let c4BoundaryInRow = 2; - parser$m.yy = c4Db; - let conf$a = {}; - 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$a.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$a, cnf); - if (cnf.fontFamily) { - conf$a.personFontFamily = conf$a.systemFontFamily = conf$a.messageFontFamily = cnf.fontFamily; - } - if (cnf.fontSize) { - conf$a.personFontSize = conf$a.systemFontSize = conf$a.messageFontSize = cnf.fontSize; - } - if (cnf.fontWeight) { - conf$a.personFontWeight = conf$a.systemFontWeight = conf$a.messageFontWeight = cnf.fontWeight; - } - }; - const c4ShapeFont = (cnf, typeC4Shape) => { - return { - fontFamily: cnf[typeC4Shape + "FontFamily"], - fontSize: cnf[typeC4Shape + "FontSize"], - fontWeight: cnf[typeC4Shape + "FontWeight"] + } + 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); }; - }; - const boundaryFont = (cnf) => { - return { - fontFamily: cnf.boundaryFontFamily, - fontSize: cnf.boundaryFontSize, - fontWeight: cnf.boundaryFontWeight + } + 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)); }; - }; - const messageFont$1 = (cnf) => { - return { - fontFamily: cnf.messageFontFamily, - fontSize: cnf.messageFontSize, - fontWeight: cnf.messageFontWeight + } + 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 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; - } - } + } + 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"); } + }); + + // ../../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)); + }; } - 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$a.c4ShapeMargin - 35; - let boundaryTextWrap = boundary.wrap && conf$a.wrap; - let boundaryLabelConf = boundaryFont(conf$a); - boundaryLabelConf.fontSize = boundaryLabelConf.fontSize + 2; - boundaryLabelConf.fontWeight = "bold"; - let textLimitWidth = calculateTextWidth(boundary.label.text, boundaryLabelConf); - calcC4ShapeTextWH("label", boundary, boundaryTextWrap, boundaryLabelConf, textLimitWidth); - svgDraw$5.drawBoundary(diagram2, boundary, conf$a); - }; - const drawC4ShapeArray = function(currentBounds, diagram2, c4ShapeArray2, c4ShapeKeys) { - let Y2 = 0; - for (const c4ShapeKey of c4ShapeKeys) { - Y2 = 0; - const c4Shape = c4ShapeArray2[c4ShapeKey]; - let c4ShapeTypeConf = c4ShapeFont(conf$a, 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$a.c4ShapePadding; - Y2 = 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 = Y2; - Y2 = c4Shape.image.Y + c4Shape.image.height; - break; - } - if (c4Shape.sprite) { - c4Shape.image.width = 48; - c4Shape.image.height = 48; - c4Shape.image.Y = Y2; - Y2 = c4Shape.image.Y + c4Shape.image.height; - } - let c4ShapeTextWrap = c4Shape.wrap && conf$a.wrap; - let textLimitWidth = conf$a.width - conf$a.c4ShapePadding * 2; - let c4ShapeLabelConf = c4ShapeFont(conf$a, c4Shape.typeC4Shape.text); - c4ShapeLabelConf.fontSize = c4ShapeLabelConf.fontSize + 2; - c4ShapeLabelConf.fontWeight = "bold"; - calcC4ShapeTextWH("label", c4Shape, c4ShapeTextWrap, c4ShapeLabelConf, textLimitWidth); - c4Shape["label"].Y = Y2 + 8; - Y2 = c4Shape["label"].Y + c4Shape["label"].height; - if (c4Shape.type && c4Shape.type.text !== "") { - c4Shape.type.text = "[" + c4Shape.type.text + "]"; - let c4ShapeTypeConf2 = c4ShapeFont(conf$a, c4Shape.typeC4Shape.text); - calcC4ShapeTextWH("type", c4Shape, c4ShapeTextWrap, c4ShapeTypeConf2, textLimitWidth); - c4Shape["type"].Y = Y2 + 5; - Y2 = c4Shape["type"].Y + c4Shape["type"].height; - } else if (c4Shape.techn && c4Shape.techn.text !== "") { - c4Shape.techn.text = "[" + c4Shape.techn.text + "]"; - let c4ShapeTechnConf = c4ShapeFont(conf$a, c4Shape.techn.text); - calcC4ShapeTextWH("techn", c4Shape, c4ShapeTextWrap, c4ShapeTechnConf, textLimitWidth); - c4Shape["techn"].Y = Y2 + 5; - Y2 = c4Shape["techn"].Y + c4Shape["techn"].height; - } - let rectHeight = Y2; - let rectWidth = c4Shape.label.width; - if (c4Shape.descr && c4Shape.descr.text !== "") { - let c4ShapeDescrConf = c4ShapeFont(conf$a, c4Shape.typeC4Shape.text); - calcC4ShapeTextWH("descr", c4Shape, c4ShapeTextWrap, c4ShapeDescrConf, textLimitWidth); - c4Shape["descr"].Y = Y2 + 20; - Y2 = c4Shape["descr"].Y + c4Shape["descr"].height; - rectWidth = Math.max(c4Shape.label.width, c4Shape.descr.width); - rectHeight = Y2 - c4Shape["descr"].textLines * 5; - } - rectWidth = rectWidth + conf$a.c4ShapePadding; - c4Shape.width = Math.max(c4Shape.width || conf$a.width, rectWidth, conf$a.width); - c4Shape.height = Math.max(c4Shape.height || conf$a.height, rectHeight, conf$a.height); - c4Shape.margin = c4Shape.margin || conf$a.c4ShapeMargin; - currentBounds.insert(c4Shape); - svgDraw$5.drawC4Shape(diagram2, c4Shape, conf$a); - } - currentBounds.bumpLastMargin(conf$a.c4ShapeMargin); - }; - let Point$1 = class Point { - constructor(x2, y2) { - this.x = x2; - this.y = y2; + 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; } - }; - 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); - } + __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; } - 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 rel of rels2) { - i2 = i2 + 1; - let relTextWrap = rel.wrap && conf$a.wrap; - let relConf = messageFont$1(conf$a); - let diagramType = diagObj.db.getC4Type(); - if (diagramType === "C4Dynamic") { - rel.label.text = i2 + ": " + rel.label.text; - } - let textLimitWidth = calculateTextWidth(rel.label.text, relConf); - calcC4ShapeTextWH("label", rel, relTextWrap, relConf, textLimitWidth); - if (rel.techn && rel.techn.text !== "") { - textLimitWidth = calculateTextWidth(rel.techn.text, relConf); - calcC4ShapeTextWH("techn", rel, relTextWrap, relConf, textLimitWidth); - } - if (rel.descr && rel.descr.text !== "") { - textLimitWidth = calculateTextWidth(rel.descr.text, relConf); - calcC4ShapeTextWH("descr", rel, relTextWrap, relConf, textLimitWidth); - } - let fromNode = getC4ShapeObj(rel.from); - let endNode = getC4ShapeObj(rel.to); - let points = getIntersectPoints(fromNode, endNode); - rel.startPoint = points.startPoint; - rel.endPoint = points.endPoint; - } - svgDraw$5.drawRels(diagram2, rels2, conf$a); - }; - 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 Y2 = 0; - currentBoundary.image = { width: 0, height: 0, Y: 0 }; - if (currentBoundary.sprite) { - currentBoundary.image.width = 48; - currentBoundary.image.height = 48; - currentBoundary.image.Y = Y2; - Y2 = currentBoundary.image.Y + currentBoundary.image.height; - } - let currentBoundaryTextWrap = currentBoundary.wrap && conf$a.wrap; - let currentBoundaryLabelConf = boundaryFont(conf$a); - currentBoundaryLabelConf.fontSize = currentBoundaryLabelConf.fontSize + 2; - currentBoundaryLabelConf.fontWeight = "bold"; - calcC4ShapeTextWH( - "label", - currentBoundary, - currentBoundaryTextWrap, - currentBoundaryLabelConf, - currentBounds.data.widthLimit - ); - currentBoundary["label"].Y = Y2 + 8; - Y2 = currentBoundary["label"].Y + currentBoundary["label"].height; - if (currentBoundary.type && currentBoundary.type.text !== "") { - currentBoundary.type.text = "[" + currentBoundary.type.text + "]"; - let currentBoundaryTypeConf = boundaryFont(conf$a); - calcC4ShapeTextWH( - "type", - currentBoundary, - currentBoundaryTextWrap, - currentBoundaryTypeConf, - currentBounds.data.widthLimit - ); - currentBoundary["type"].Y = Y2 + 5; - Y2 = currentBoundary["type"].Y + currentBoundary["type"].height; - } - if (currentBoundary.descr && currentBoundary.descr.text !== "") { - let currentBoundaryDescrConf = boundaryFont(conf$a); - currentBoundaryDescrConf.fontSize = currentBoundaryDescrConf.fontSize - 2; - calcC4ShapeTextWH( - "descr", - currentBoundary, - currentBoundaryTextWrap, - currentBoundaryDescrConf, - currentBounds.data.widthLimit - ); - currentBoundary["descr"].Y = Y2 + 20; - Y2 = currentBoundary["descr"].Y + currentBoundary["descr"].height; - } - if (i2 == 0 || i2 % c4BoundaryInRow === 0) { - let _x = parentBounds.data.startx + conf$a.diagramMarginX; - let _y = parentBounds.data.stopy + conf$a.diagramMarginY + Y2; - currentBounds.setData(_x, _x, _y, _y); - } else { - let _x = currentBounds.data.stopx !== currentBounds.data.startx ? currentBounds.data.stopx + conf$a.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 nextCurrentBoundarys = diagObj.db.getBoundarys(parentBoundaryAlias); - if (nextCurrentBoundarys.length > 0) { - drawInsideBoundary( - diagram2, - parentBoundaryAlias, - currentBounds, - nextCurrentBoundarys, - diagObj - ); - } - if (currentBoundary.alias !== "global") { - drawBoundary(diagram2, currentBoundary, currentBounds); - } - parentBounds.data.stopy = Math.max( - currentBounds.data.stopy + conf$a.c4ShapeMargin, - parentBounds.data.stopy - ); - parentBounds.data.stopx = Math.max( - currentBounds.data.stopx + conf$a.c4ShapeMargin, - parentBounds.data.stopx - ); - globalBoundaryMaxX = Math.max(globalBoundaryMaxX, parentBounds.data.stopx); - globalBoundaryMaxY = Math.max(globalBoundaryMaxY, parentBounds.data.stopy); + __name(tween, "tween"); + tween._value = value2; + return tween; + } + 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"); } + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js + function delayFunction(id27, value2) { + return function() { + init(this, id27).delay = +value2.apply(this, arguments); + }; } - const draw$h = function(_text, id2, _version, diagObj) { - conf$a = getConfig$1().c4; - const securityLevel = getConfig$1().securityLevel; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); - let db2 = diagObj.db; - diagObj.db.setWrap(conf$a.wrap); - c4ShapeInRow = db2.getC4ShapeInRow(); - c4BoundaryInRow = db2.getC4BoundaryInRow(); - log$1.debug(`C:${JSON.stringify(conf$a, null, 2)}`); - const diagram2 = securityLevel === "sandbox" ? root2.select(`[id="${id2}"]`) : select(`[id="${id2}"]`); - svgDraw$5.insertComputerIcon(diagram2); - svgDraw$5.insertDatabaseIcon(diagram2); - svgDraw$5.insertClockIcon(diagram2); - let screenBounds = new Bounds(diagObj); - screenBounds.setData( - conf$a.diagramMarginX, - conf$a.diagramMarginX, - conf$a.diagramMarginY, - conf$a.diagramMarginY - ); - screenBounds.data.widthLimit = screen.availWidth; - globalBoundaryMaxX = conf$a.diagramMarginX; - globalBoundaryMaxY = conf$a.diagramMarginY; - const title2 = diagObj.db.getTitle(); - let currentBoundaries = diagObj.db.getBoundarys(""); - drawInsideBoundary(diagram2, "", screenBounds, currentBoundaries, diagObj); - svgDraw$5.insertArrowHead(diagram2); - svgDraw$5.insertArrowEnd(diagram2); - svgDraw$5.insertArrowCrossHead(diagram2); - svgDraw$5.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 height2 = boxHeight + 2 * conf$a.diagramMarginY; - let boxWidth = box.stopx - box.startx; - const width2 = boxWidth + 2 * conf$a.diagramMarginX; - if (title2) { - diagram2.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 4 * conf$a.diagramMarginX).attr("y", box.starty + conf$a.diagramMarginY); - } - configureSvgSize(diagram2, height2, width2, conf$a.useMaxWidth); - const extraVertForTitle = title2 ? 60 : 0; - diagram2.attr( - "viewBox", - box.startx - conf$a.diagramMarginX + " -" + (conf$a.diagramMarginY + extraVertForTitle) + " " + width2 + " " + (height2 + extraVertForTitle) - ); - log$1.debug(`models:`, box); - }; - const c4Renderer = { - drawPersonOrSystemArray: drawC4ShapeArray, - drawBoundary, - setConf: setConf$9, - draw: draw$h - }; - const getStyles$e = (options2) => `.person { - stroke: ${options2.personBorder}; - fill: ${options2.personBkg}; + function delayConstant(id27, value2) { + return value2 = +value2, function() { + init(this, id27).delay = value2; + }; } -`; - const c4Styles = getStyles$e; - const diagram$h = { - parser: c4Parser, - db: c4Db, - renderer: c4Renderer, - styles: c4Styles, - init: (cnf) => { - c4Renderer.setConf(cnf.c4); + function delay_default(value2) { + var id27 = this._id; + return arguments.length ? this.each((typeof value2 === "function" ? delayFunction : delayConstant)(id27, value2)) : get2(this.node(), id27).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"); } - }; - const c4Diagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$h - }, 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, 9], $V1 = [1, 7], $V2 = [1, 6], $V3 = [1, 8], $V4 = [1, 20, 21, 22, 23, 38, 44, 46, 48, 52, 66, 67, 87, 88, 89, 90, 91, 92, 96, 106, 107, 110, 112, 113, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128], $V5 = [2, 10], $V6 = [1, 20], $V7 = [1, 21], $V8 = [1, 22], $V9 = [1, 23], $Va = [1, 30], $Vb = [1, 32], $Vc = [1, 33], $Vd = [1, 34], $Ve = [1, 62], $Vf = [1, 48], $Vg = [1, 52], $Vh = [1, 36], $Vi = [1, 37], $Vj = [1, 38], $Vk = [1, 39], $Vl = [1, 40], $Vm = [1, 56], $Vn = [1, 63], $Vo = [1, 51], $Vp = [1, 53], $Vq = [1, 55], $Vr = [1, 59], $Vs = [1, 60], $Vt = [1, 41], $Vu = [1, 42], $Vv = [1, 43], $Vw = [1, 44], $Vx = [1, 61], $Vy = [1, 50], $Vz = [1, 54], $VA = [1, 57], $VB = [1, 58], $VC = [1, 49], $VD = [1, 66], $VE = [1, 71], $VF = [1, 20, 21, 22, 23, 38, 42, 44, 46, 48, 52, 66, 67, 87, 88, 89, 90, 91, 92, 96, 106, 107, 110, 112, 113, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128], $VG = [1, 75], $VH = [1, 74], $VI = [1, 76], $VJ = [20, 21, 23, 81, 82], $VK = [1, 99], $VL = [1, 104], $VM = [1, 107], $VN = [1, 108], $VO = [1, 101], $VP = [1, 106], $VQ = [1, 109], $VR = [1, 102], $VS = [1, 114], $VT = [1, 113], $VU = [1, 103], $VV = [1, 105], $VW = [1, 110], $VX = [1, 111], $VY = [1, 112], $VZ = [1, 115], $V_ = [20, 21, 22, 23, 81, 82], $V$ = [20, 21, 22, 23, 53, 81, 82], $V01 = [20, 21, 22, 23, 40, 52, 53, 55, 57, 59, 61, 63, 65, 66, 67, 69, 71, 73, 74, 76, 81, 82, 92, 96, 106, 107, 110, 112, 113, 123, 124, 125, 126, 127, 128], $V11 = [20, 21, 23], $V21 = [20, 21, 23, 52, 66, 67, 81, 82, 92, 96, 106, 107, 110, 112, 113, 123, 124, 125, 126, 127, 128], $V31 = [1, 12, 20, 21, 22, 23, 24, 38, 42, 44, 46, 48, 52, 66, 67, 87, 88, 89, 90, 91, 92, 96, 106, 107, 110, 112, 113, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128], $V41 = [52, 66, 67, 92, 96, 106, 107, 110, 112, 113, 123, 124, 125, 126, 127, 128], $V51 = [1, 150], $V61 = [1, 158], $V71 = [1, 159], $V81 = [1, 160], $V91 = [1, 161], $Va1 = [1, 145], $Vb1 = [1, 146], $Vc1 = [1, 141], $Vd1 = [1, 142], $Ve1 = [1, 153], $Vf1 = [1, 154], $Vg1 = [1, 155], $Vh1 = [1, 156], $Vi1 = [1, 157], $Vj1 = [1, 162], $Vk1 = [1, 163], $Vl1 = [1, 148], $Vm1 = [1, 151], $Vn1 = [1, 147], $Vo1 = [1, 144], $Vp1 = [20, 21, 22, 23, 38, 42, 44, 46, 48, 52, 66, 67, 87, 88, 89, 90, 91, 92, 96, 106, 107, 110, 112, 113, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128], $Vq1 = [1, 166], $Vr1 = [20, 21, 22, 23, 26, 52, 66, 67, 92, 106, 107, 110, 112, 113, 123, 124, 125, 126, 127, 128], $Vs1 = [20, 21, 22, 23, 24, 26, 38, 40, 41, 42, 52, 56, 58, 60, 62, 64, 66, 67, 68, 70, 72, 73, 75, 77, 81, 82, 87, 88, 89, 90, 91, 92, 93, 96, 106, 107, 110, 112, 113, 114, 115, 123, 124, 125, 126, 127, 128], $Vt1 = [12, 21, 22, 24], $Vu1 = [22, 107], $Vv1 = [1, 251], $Vw1 = [1, 246], $Vx1 = [1, 247], $Vy1 = [1, 255], $Vz1 = [1, 252], $VA1 = [1, 249], $VB1 = [1, 248], $VC1 = [1, 250], $VD1 = [1, 253], $VE1 = [1, 254], $VF1 = [1, 256], $VG1 = [1, 274], $VH1 = [20, 21, 23, 107], $VI1 = [20, 21, 22, 23, 66, 67, 87, 103, 106, 107, 110, 111, 112, 113, 114]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "mermaidDoc": 4, "directive": 5, "openDirective": 6, "typeDirective": 7, "closeDirective": 8, "separator": 9, ":": 10, "argDirective": 11, "open_directive": 12, "type_directive": 13, "arg_directive": 14, "close_directive": 15, "graphConfig": 16, "document": 17, "line": 18, "statement": 19, "SEMI": 20, "NEWLINE": 21, "SPACE": 22, "EOF": 23, "GRAPH": 24, "NODIR": 25, "DIR": 26, "FirstStmtSeperator": 27, "ending": 28, "endToken": 29, "spaceList": 30, "spaceListNewline": 31, "verticeStatement": 32, "styleStatement": 33, "linkStyleStatement": 34, "classDefStatement": 35, "classStatement": 36, "clickStatement": 37, "subgraph": 38, "text": 39, "SQS": 40, "SQE": 41, "end": 42, "direction": 43, "acc_title": 44, "acc_title_value": 45, "acc_descr": 46, "acc_descr_value": 47, "acc_descr_multiline_value": 48, "link": 49, "node": 50, "vertex": 51, "AMP": 52, "STYLE_SEPARATOR": 53, "idString": 54, "DOUBLECIRCLESTART": 55, "DOUBLECIRCLEEND": 56, "PS": 57, "PE": 58, "(-": 59, "-)": 60, "STADIUMSTART": 61, "STADIUMEND": 62, "SUBROUTINESTART": 63, "SUBROUTINEEND": 64, "VERTEX_WITH_PROPS_START": 65, "ALPHA": 66, "COLON": 67, "PIPE": 68, "CYLINDERSTART": 69, "CYLINDEREND": 70, "DIAMOND_START": 71, "DIAMOND_STOP": 72, "TAGEND": 73, "TRAPSTART": 74, "TRAPEND": 75, "INVTRAPSTART": 76, "INVTRAPEND": 77, "linkStatement": 78, "arrowText": 79, "TESTSTR": 80, "START_LINK": 81, "LINK": 82, "textToken": 83, "STR": 84, "MD_STR": 85, "keywords": 86, "STYLE": 87, "LINKSTYLE": 88, "CLASSDEF": 89, "CLASS": 90, "CLICK": 91, "DOWN": 92, "UP": 93, "textNoTags": 94, "textNoTagsToken": 95, "DEFAULT": 96, "stylesOpt": 97, "alphaNum": 98, "CALLBACKNAME": 99, "CALLBACKARGS": 100, "HREF": 101, "LINK_TARGET": 102, "HEX": 103, "numList": 104, "INTERPOLATE": 105, "NUM": 106, "COMMA": 107, "style": 108, "styleComponent": 109, "MINUS": 110, "UNIT": 111, "BRKT": 112, "DOT": 113, "PCT": 114, "TAGSTART": 115, "alphaNumToken": 116, "idStringToken": 117, "alphaNumStatement": 118, "direction_tb": 119, "direction_bt": 120, "direction_rl": 121, "direction_lr": 122, "PUNCTUATION": 123, "UNICODE_TEXT": 124, "PLUS": 125, "EQUALS": 126, "MULT": 127, "UNDERSCORE": 128, "graphCodeTokens": 129, "ARROW_CROSS": 130, "ARROW_POINT": 131, "ARROW_CIRCLE": 132, "ARROW_OPEN": 133, "QUOTE": 134, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 10: ":", 12: "open_directive", 13: "type_directive", 14: "arg_directive", 15: "close_directive", 20: "SEMI", 21: "NEWLINE", 22: "SPACE", 23: "EOF", 24: "GRAPH", 25: "NODIR", 26: "DIR", 38: "subgraph", 40: "SQS", 41: "SQE", 42: "end", 44: "acc_title", 45: "acc_title_value", 46: "acc_descr", 47: "acc_descr_value", 48: "acc_descr_multiline_value", 52: "AMP", 53: "STYLE_SEPARATOR", 55: "DOUBLECIRCLESTART", 56: "DOUBLECIRCLEEND", 57: "PS", 58: "PE", 59: "(-", 60: "-)", 61: "STADIUMSTART", 62: "STADIUMEND", 63: "SUBROUTINESTART", 64: "SUBROUTINEEND", 65: "VERTEX_WITH_PROPS_START", 66: "ALPHA", 67: "COLON", 68: "PIPE", 69: "CYLINDERSTART", 70: "CYLINDEREND", 71: "DIAMOND_START", 72: "DIAMOND_STOP", 73: "TAGEND", 74: "TRAPSTART", 75: "TRAPEND", 76: "INVTRAPSTART", 77: "INVTRAPEND", 80: "TESTSTR", 81: "START_LINK", 82: "LINK", 84: "STR", 85: "MD_STR", 87: "STYLE", 88: "LINKSTYLE", 89: "CLASSDEF", 90: "CLASS", 91: "CLICK", 92: "DOWN", 93: "UP", 96: "DEFAULT", 99: "CALLBACKNAME", 100: "CALLBACKARGS", 101: "HREF", 102: "LINK_TARGET", 103: "HEX", 105: "INTERPOLATE", 106: "NUM", 107: "COMMA", 110: "MINUS", 111: "UNIT", 112: "BRKT", 113: "DOT", 114: "PCT", 115: "TAGSTART", 119: "direction_tb", 120: "direction_bt", 121: "direction_rl", 122: "direction_lr", 123: "PUNCTUATION", 124: "UNICODE_TEXT", 125: "PLUS", 126: "EQUALS", 127: "MULT", 128: "UNDERSCORE", 130: "ARROW_CROSS", 131: "ARROW_POINT", 132: "ARROW_CIRCLE", 133: "ARROW_OPEN", 134: "QUOTE" }, - productions_: [0, [3, 1], [3, 2], [5, 4], [5, 6], [6, 1], [7, 1], [11, 1], [8, 1], [4, 2], [17, 0], [17, 2], [18, 1], [18, 1], [18, 1], [18, 1], [18, 1], [16, 2], [16, 2], [16, 2], [16, 3], [28, 2], [28, 1], [29, 1], [29, 1], [29, 1], [27, 1], [27, 1], [27, 2], [31, 2], [31, 2], [31, 1], [31, 1], [30, 2], [30, 1], [19, 2], [19, 2], [19, 2], [19, 2], [19, 2], [19, 2], [19, 9], [19, 6], [19, 4], [19, 1], [19, 2], [19, 2], [19, 1], [9, 1], [9, 1], [9, 1], [32, 3], [32, 4], [32, 2], [32, 1], [50, 1], [50, 5], [50, 3], [51, 4], [51, 4], [51, 6], [51, 4], [51, 4], [51, 4], [51, 8], [51, 4], [51, 4], [51, 4], [51, 6], [51, 4], [51, 4], [51, 4], [51, 4], [51, 4], [51, 1], [49, 2], [49, 3], [49, 3], [49, 1], [49, 3], [78, 1], [79, 3], [39, 1], [39, 2], [39, 1], [39, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [94, 1], [94, 2], [35, 5], [35, 5], [36, 5], [37, 2], [37, 4], [37, 3], [37, 5], [37, 2], [37, 4], [37, 4], [37, 6], [37, 2], [37, 4], [37, 2], [37, 4], [37, 4], [37, 6], [33, 5], [33, 5], [34, 5], [34, 5], [34, 9], [34, 9], [34, 7], [34, 7], [104, 1], [104, 3], [97, 1], [97, 3], [108, 1], [108, 2], [109, 1], [109, 1], [109, 1], [109, 1], [109, 1], [109, 1], [109, 1], [109, 1], [109, 1], [109, 1], [109, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [95, 1], [95, 1], [95, 1], [95, 1], [54, 1], [54, 2], [98, 1], [98, 2], [118, 1], [118, 1], [118, 1], [118, 1], [43, 1], [43, 1], [43, 1], [43, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1], [129, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 5: - yy.parseDirective("%%{", "open_directive"); - break; - case 6: - yy.parseDirective($$[$0], "type_directive"); - break; - case 7: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); - yy.parseDirective($$[$0], "arg_directive"); - break; - case 8: - yy.parseDirective("}%%", "close_directive", "flowchart"); - break; - case 10: - this.$ = []; - break; - case 11: - if (!Array.isArray($$[$0]) || $$[$0].length > 0) { - $$[$0 - 1].push($$[$0]); - } - this.$ = $$[$0 - 1]; - break; - case 12: - case 97: - case 153: - case 155: - case 156: - this.$ = $$[$0]; - break; - case 19: - yy.setDirection("TB"); - this.$ = "TB"; - break; - case 20: - yy.setDirection($$[$0 - 1]); - this.$ = $$[$0 - 1]; - break; - case 35: - this.$ = $$[$0 - 1].nodes; - break; - case 36: - case 37: - case 38: - case 39: - case 40: - this.$ = []; - break; - case 41: - this.$ = yy.addSubGraph($$[$0 - 6], $$[$0 - 1], $$[$0 - 4]); - break; - case 42: - this.$ = yy.addSubGraph($$[$0 - 3], $$[$0 - 1], $$[$0 - 3]); - break; - case 43: - this.$ = yy.addSubGraph(void 0, $$[$0 - 1], void 0); - break; - case 45: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 46: - case 47: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 51: - yy.addLink($$[$0 - 2].stmt, $$[$0], $$[$0 - 1]); - this.$ = { stmt: $$[$0], nodes: $$[$0].concat($$[$0 - 2].nodes) }; - break; - case 52: - yy.addLink($$[$0 - 3].stmt, $$[$0 - 1], $$[$0 - 2]); - this.$ = { stmt: $$[$0 - 1], nodes: $$[$0 - 1].concat($$[$0 - 3].nodes) }; - break; - case 53: - this.$ = { stmt: $$[$0 - 1], nodes: $$[$0 - 1] }; - break; - case 54: - this.$ = { stmt: $$[$0], nodes: $$[$0] }; - break; - case 55: - this.$ = [$$[$0]]; - break; - case 56: - this.$ = $$[$0 - 4].concat($$[$0]); - break; - case 57: - this.$ = [$$[$0 - 2]]; - yy.setClass($$[$0 - 2], $$[$0]); - break; - case 58: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "square"); - break; - case 59: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "doublecircle"); - break; - case 60: - this.$ = $$[$0 - 5]; - yy.addVertex($$[$0 - 5], $$[$0 - 2], "circle"); - break; - case 61: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "ellipse"); - break; - case 62: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "stadium"); - break; - case 63: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "subroutine"); - break; - case 64: - this.$ = $$[$0 - 7]; - yy.addVertex($$[$0 - 7], $$[$0 - 1], "rect", void 0, void 0, void 0, Object.fromEntries([[$$[$0 - 5], $$[$0 - 3]]])); - break; - case 65: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "cylinder"); - break; - case 66: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "round"); - break; - case 67: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "diamond"); - break; - case 68: - this.$ = $$[$0 - 5]; - yy.addVertex($$[$0 - 5], $$[$0 - 2], "hexagon"); - break; - case 69: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "odd"); - break; - case 70: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "trapezoid"); - break; - case 71: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "inv_trapezoid"); - break; - case 72: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "lean_right"); - break; - case 73: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "lean_left"); - break; - case 74: - this.$ = $$[$0]; - yy.addVertex($$[$0]); - break; - case 75: - $$[$0 - 1].text = $$[$0]; - this.$ = $$[$0 - 1]; - break; - case 76: - case 77: - $$[$0 - 2].text = $$[$0 - 1]; - this.$ = $$[$0 - 2]; - break; - case 78: - this.$ = $$[$0]; - break; - case 79: - var inf = yy.destructLink($$[$0], $$[$0 - 2]); - this.$ = { "type": inf.type, "stroke": inf.stroke, "length": inf.length, "text": $$[$0 - 1] }; - break; - case 80: - var inf = yy.destructLink($$[$0]); - this.$ = { "type": inf.type, "stroke": inf.stroke, "length": inf.length }; - break; - case 81: - this.$ = $$[$0 - 1]; - break; - case 82: - this.$ = { text: $$[$0], type: "text" }; - break; - case 83: - this.$ = { text: $$[$0 - 1].text + "" + $$[$0], type: $$[$0 - 1].type }; - break; - case 84: - this.$ = { text: $$[$0], type: "text" }; - break; - case 85: - this.$ = { text: $$[$0], type: "markdown" }; - break; - case 98: - case 154: - this.$ = $$[$0 - 1] + "" + $$[$0]; - break; - case 99: - case 100: - this.$ = $$[$0 - 4]; - yy.addClass($$[$0 - 2], $$[$0]); - break; - case 101: - this.$ = $$[$0 - 4]; - yy.setClass($$[$0 - 2], $$[$0]); - break; - case 102: - case 110: - this.$ = $$[$0 - 1]; - yy.setClickEvent($$[$0 - 1], $$[$0]); - break; - case 103: - case 111: - this.$ = $$[$0 - 3]; - yy.setClickEvent($$[$0 - 3], $$[$0 - 2]); - yy.setTooltip($$[$0 - 3], $$[$0]); - break; - case 104: - this.$ = $$[$0 - 2]; - yy.setClickEvent($$[$0 - 2], $$[$0 - 1], $$[$0]); - break; - case 105: - this.$ = $$[$0 - 4]; - yy.setClickEvent($$[$0 - 4], $$[$0 - 3], $$[$0 - 2]); - yy.setTooltip($$[$0 - 4], $$[$0]); - break; - case 106: - case 112: - this.$ = $$[$0 - 1]; - yy.setLink($$[$0 - 1], $$[$0]); - break; - case 107: - case 113: - this.$ = $$[$0 - 3]; - yy.setLink($$[$0 - 3], $$[$0 - 2]); - yy.setTooltip($$[$0 - 3], $$[$0]); - break; - case 108: - case 114: - this.$ = $$[$0 - 3]; - yy.setLink($$[$0 - 3], $$[$0 - 2], $$[$0]); - break; - case 109: - case 115: - this.$ = $$[$0 - 5]; - yy.setLink($$[$0 - 5], $$[$0 - 4], $$[$0]); - yy.setTooltip($$[$0 - 5], $$[$0 - 2]); - break; - case 116: - this.$ = $$[$0 - 4]; - yy.addVertex($$[$0 - 2], void 0, void 0, $$[$0]); - break; - case 117: - case 119: - this.$ = $$[$0 - 4]; - yy.updateLink($$[$0 - 2], $$[$0]); - break; - case 118: - this.$ = $$[$0 - 4]; - yy.updateLink([$$[$0 - 2]], $$[$0]); - break; - case 120: - this.$ = $$[$0 - 8]; - yy.updateLinkInterpolate([$$[$0 - 6]], $$[$0 - 2]); - yy.updateLink([$$[$0 - 6]], $$[$0]); - break; - case 121: - this.$ = $$[$0 - 8]; - yy.updateLinkInterpolate($$[$0 - 6], $$[$0 - 2]); - yy.updateLink($$[$0 - 6], $$[$0]); - break; - case 122: - this.$ = $$[$0 - 6]; - yy.updateLinkInterpolate([$$[$0 - 4]], $$[$0]); - break; - case 123: - this.$ = $$[$0 - 6]; - yy.updateLinkInterpolate($$[$0 - 4], $$[$0]); - break; - case 124: - case 126: - this.$ = [$$[$0]]; - break; - case 125: - case 127: - $$[$0 - 2].push($$[$0]); - this.$ = $$[$0 - 2]; - break; - case 129: - this.$ = $$[$0 - 1] + $$[$0]; - break; - case 151: - this.$ = $$[$0]; - break; - case 152: - this.$ = $$[$0 - 1] + "" + $$[$0]; - break; - case 157: - this.$ = "v"; - break; - case 158: - this.$ = "-"; - break; - case 159: - this.$ = { stmt: "dir", value: "TB" }; - break; - case 160: - this.$ = { stmt: "dir", value: "BT" }; - break; - case 161: - this.$ = { stmt: "dir", value: "RL" }; - break; - case 162: - this.$ = { stmt: "dir", value: "LR" }; - break; - } - }, - table: [{ 3: 1, 4: 2, 5: 3, 6: 5, 12: $V0, 16: 4, 21: $V1, 22: $V2, 24: $V3 }, { 1: [3] }, { 1: [2, 1] }, { 3: 10, 4: 2, 5: 3, 6: 5, 12: $V0, 16: 4, 21: $V1, 22: $V2, 24: $V3 }, o($V4, $V5, { 17: 11 }), { 7: 12, 13: [1, 13] }, { 16: 14, 21: $V1, 22: $V2, 24: $V3 }, { 16: 15, 21: $V1, 22: $V2, 24: $V3 }, { 25: [1, 16], 26: [1, 17] }, { 13: [2, 5] }, { 1: [2, 2] }, { 1: [2, 9], 18: 18, 19: 19, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 32: 24, 33: 25, 34: 26, 35: 27, 36: 28, 37: 29, 38: $Va, 43: 31, 44: $Vb, 46: $Vc, 48: $Vd, 50: 35, 51: 45, 52: $Ve, 54: 46, 66: $Vf, 67: $Vg, 87: $Vh, 88: $Vi, 89: $Vj, 90: $Vk, 91: $Vl, 92: $Vm, 96: $Vn, 106: $Vo, 107: $Vp, 110: $Vq, 112: $Vr, 113: $Vs, 117: 47, 119: $Vt, 120: $Vu, 121: $Vv, 122: $Vw, 123: $Vx, 124: $Vy, 125: $Vz, 126: $VA, 127: $VB, 128: $VC }, { 8: 64, 10: [1, 65], 15: $VD }, o([10, 15], [2, 6]), o($V4, [2, 17]), o($V4, [2, 18]), o($V4, [2, 19]), { 20: [1, 68], 21: [1, 69], 22: $VE, 27: 67, 30: 70 }, o($VF, [2, 11]), o($VF, [2, 12]), o($VF, [2, 13]), o($VF, [2, 14]), o($VF, [2, 15]), o($VF, [2, 16]), { 9: 72, 20: $VG, 21: $VH, 23: $VI, 49: 73, 78: 77, 81: [1, 78], 82: [1, 79] }, { 9: 80, 20: $VG, 21: $VH, 23: $VI }, { 9: 81, 20: $VG, 21: $VH, 23: $VI }, { 9: 82, 20: $VG, 21: $VH, 23: $VI }, { 9: 83, 20: $VG, 21: $VH, 23: $VI }, { 9: 84, 20: $VG, 21: $VH, 23: $VI }, { 9: 86, 20: $VG, 21: $VH, 22: [1, 85], 23: $VI }, o($VF, [2, 44]), { 45: [1, 87] }, { 47: [1, 88] }, o($VF, [2, 47]), o($VJ, [2, 54], { 30: 89, 22: $VE }), { 22: [1, 90] }, { 22: [1, 91] }, { 22: [1, 92] }, { 22: [1, 93] }, { 26: $VK, 52: $VL, 66: $VM, 67: $VN, 84: [1, 97], 92: $VO, 98: 96, 99: [1, 94], 101: [1, 95], 106: $VP, 107: $VQ, 110: $VR, 112: $VS, 113: $VT, 116: 100, 118: 98, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, o($VF, [2, 159]), o($VF, [2, 160]), o($VF, [2, 161]), o($VF, [2, 162]), o($V_, [2, 55], { 53: [1, 116] }), o($V$, [2, 74], { 117: 129, 40: [1, 117], 52: $Ve, 55: [1, 118], 57: [1, 119], 59: [1, 120], 61: [1, 121], 63: [1, 122], 65: [1, 123], 66: $Vf, 67: $Vg, 69: [1, 124], 71: [1, 125], 73: [1, 126], 74: [1, 127], 76: [1, 128], 92: $Vm, 96: $Vn, 106: $Vo, 107: $Vp, 110: $Vq, 112: $Vr, 113: $Vs, 123: $Vx, 124: $Vy, 125: $Vz, 126: $VA, 127: $VB, 128: $VC }), o($V01, [2, 151]), o($V01, [2, 176]), o($V01, [2, 177]), o($V01, [2, 178]), o($V01, [2, 179]), o($V01, [2, 180]), o($V01, [2, 181]), o($V01, [2, 182]), o($V01, [2, 183]), o($V01, [2, 184]), o($V01, [2, 185]), o($V01, [2, 186]), o($V01, [2, 187]), o($V01, [2, 188]), o($V01, [2, 189]), o($V01, [2, 190]), o($V01, [2, 191]), { 9: 130, 20: $VG, 21: $VH, 23: $VI }, { 11: 131, 14: [1, 132] }, o($V11, [2, 8]), o($V4, [2, 20]), o($V4, [2, 26]), o($V4, [2, 27]), { 21: [1, 133] }, o($V21, [2, 34], { 30: 134, 22: $VE }), o($VF, [2, 35]), { 50: 135, 51: 45, 52: $Ve, 54: 46, 66: $Vf, 67: $Vg, 92: $Vm, 96: $Vn, 106: $Vo, 107: $Vp, 110: $Vq, 112: $Vr, 113: $Vs, 117: 47, 123: $Vx, 124: $Vy, 125: $Vz, 126: $VA, 127: $VB, 128: $VC }, o($V31, [2, 48]), o($V31, [2, 49]), o($V31, [2, 50]), o($V41, [2, 78], { 79: 136, 68: [1, 138], 80: [1, 137] }), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 139, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: $Vd1, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, o([52, 66, 67, 68, 80, 92, 96, 106, 107, 110, 112, 113, 123, 124, 125, 126, 127, 128], [2, 80]), o($VF, [2, 36]), o($VF, [2, 37]), o($VF, [2, 38]), o($VF, [2, 39]), o($VF, [2, 40]), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 164, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: $Vd1, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, o($Vp1, $V5, { 17: 165 }), o($VF, [2, 45]), o($VF, [2, 46]), o($VJ, [2, 53], { 52: $Vq1 }), { 26: $VK, 52: $VL, 66: $VM, 67: $VN, 92: $VO, 98: 167, 103: [1, 168], 106: $VP, 107: $VQ, 110: $VR, 112: $VS, 113: $VT, 116: 100, 118: 98, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 96: [1, 169], 104: 170, 106: [1, 171] }, { 26: $VK, 52: $VL, 66: $VM, 67: $VN, 92: $VO, 96: [1, 172], 98: 173, 106: $VP, 107: $VQ, 110: $VR, 112: $VS, 113: $VT, 116: 100, 118: 98, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 26: $VK, 52: $VL, 66: $VM, 67: $VN, 92: $VO, 98: 174, 106: $VP, 107: $VQ, 110: $VR, 112: $VS, 113: $VT, 116: 100, 118: 98, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, o($V11, [2, 102], { 22: [1, 175], 100: [1, 176] }), o($V11, [2, 106], { 22: [1, 177] }), o($V11, [2, 110], { 116: 100, 118: 179, 22: [1, 178], 26: $VK, 52: $VL, 66: $VM, 67: $VN, 92: $VO, 106: $VP, 107: $VQ, 110: $VR, 112: $VS, 113: $VT, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }), o($V11, [2, 112], { 22: [1, 180] }), o($Vr1, [2, 153]), o($Vr1, [2, 155]), o($Vr1, [2, 156]), o($Vr1, [2, 157]), o($Vr1, [2, 158]), o($Vs1, [2, 163]), o($Vs1, [2, 164]), o($Vs1, [2, 165]), o($Vs1, [2, 166]), o($Vs1, [2, 167]), o($Vs1, [2, 168]), o($Vs1, [2, 169]), o($Vs1, [2, 170]), o($Vs1, [2, 171]), o($Vs1, [2, 172]), o($Vs1, [2, 173]), o($Vs1, [2, 174]), o($Vs1, [2, 175]), { 52: $Ve, 54: 181, 66: $Vf, 67: $Vg, 92: $Vm, 96: $Vn, 106: $Vo, 107: $Vp, 110: $Vq, 112: $Vr, 113: $Vs, 117: 47, 123: $Vx, 124: $Vy, 125: $Vz, 126: $VA, 127: $VB, 128: $VC }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 182, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: $Vd1, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 183, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: $Vd1, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 185, 42: $V91, 52: $VL, 57: [1, 184], 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: $Vd1, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 186, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: $Vd1, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 187, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: $Vd1, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 188, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: $Vd1, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 66: [1, 189] }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 190, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: $Vd1, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 191, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 71: [1, 192], 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: $Vd1, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 193, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: $Vd1, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 194, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: $Vd1, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 195, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: $Vd1, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, o($V01, [2, 152]), o($Vt1, [2, 3]), { 8: 196, 15: $VD }, { 15: [2, 7] }, o($V4, [2, 28]), o($V21, [2, 33]), o($VJ, [2, 51], { 30: 197, 22: $VE }), o($V41, [2, 75], { 22: [1, 198] }), { 22: [1, 199] }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 200, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: $Vd1, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 82: [1, 201], 83: 202, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, o($Vs1, [2, 82]), o($Vs1, [2, 84]), o($Vs1, [2, 85]), o($Vs1, [2, 141]), o($Vs1, [2, 142]), o($Vs1, [2, 143]), o($Vs1, [2, 144]), o($Vs1, [2, 145]), o($Vs1, [2, 146]), o($Vs1, [2, 147]), o($Vs1, [2, 148]), o($Vs1, [2, 149]), o($Vs1, [2, 150]), o($Vs1, [2, 86]), o($Vs1, [2, 87]), o($Vs1, [2, 88]), o($Vs1, [2, 89]), o($Vs1, [2, 90]), o($Vs1, [2, 91]), o($Vs1, [2, 92]), o($Vs1, [2, 93]), o($Vs1, [2, 94]), o($Vs1, [2, 95]), o($Vs1, [2, 96]), { 9: 204, 20: $VG, 21: $VH, 22: $V51, 23: $VI, 24: $V61, 26: $V71, 38: $V81, 40: [1, 203], 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 202, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 18: 18, 19: 19, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 32: 24, 33: 25, 34: 26, 35: 27, 36: 28, 37: 29, 38: $Va, 42: [1, 205], 43: 31, 44: $Vb, 46: $Vc, 48: $Vd, 50: 35, 51: 45, 52: $Ve, 54: 46, 66: $Vf, 67: $Vg, 87: $Vh, 88: $Vi, 89: $Vj, 90: $Vk, 91: $Vl, 92: $Vm, 96: $Vn, 106: $Vo, 107: $Vp, 110: $Vq, 112: $Vr, 113: $Vs, 117: 47, 119: $Vt, 120: $Vu, 121: $Vv, 122: $Vw, 123: $Vx, 124: $Vy, 125: $Vz, 126: $VA, 127: $VB, 128: $VC }, { 22: $VE, 30: 206 }, { 22: [1, 207], 26: $VK, 52: $VL, 66: $VM, 67: $VN, 92: $VO, 106: $VP, 107: $VQ, 110: $VR, 112: $VS, 113: $VT, 116: 100, 118: 179, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: [1, 208] }, { 22: [1, 209] }, { 22: [1, 210], 107: [1, 211] }, o($Vu1, [2, 124]), { 22: [1, 212] }, { 22: [1, 213], 26: $VK, 52: $VL, 66: $VM, 67: $VN, 92: $VO, 106: $VP, 107: $VQ, 110: $VR, 112: $VS, 113: $VT, 116: 100, 118: 179, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: [1, 214], 26: $VK, 52: $VL, 66: $VM, 67: $VN, 92: $VO, 106: $VP, 107: $VQ, 110: $VR, 112: $VS, 113: $VT, 116: 100, 118: 179, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 84: [1, 215] }, o($V11, [2, 104], { 22: [1, 216] }), { 84: [1, 217], 102: [1, 218] }, { 84: [1, 219] }, o($Vr1, [2, 154]), { 84: [1, 220], 102: [1, 221] }, o($V_, [2, 57], { 117: 129, 52: $Ve, 66: $Vf, 67: $Vg, 92: $Vm, 96: $Vn, 106: $Vo, 107: $Vp, 110: $Vq, 112: $Vr, 113: $Vs, 123: $Vx, 124: $Vy, 125: $Vz, 126: $VA, 127: $VB, 128: $VC }), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 41: [1, 222], 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 202, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 56: [1, 223], 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 202, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 224, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: $Vd1, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 58: [1, 225], 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 202, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 60: [1, 226], 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 202, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 62: [1, 227], 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 202, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 64: [1, 228], 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 202, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 67: [1, 229] }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 70: [1, 230], 73: $Va1, 81: $Vb1, 83: 202, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 72: [1, 231], 73: $Va1, 81: $Vb1, 83: 202, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 232, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: $Vd1, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 41: [1, 233], 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 202, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 75: [1, 234], 77: [1, 235], 81: $Vb1, 83: 202, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 75: [1, 237], 77: [1, 236], 81: $Vb1, 83: 202, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 9: 238, 20: $VG, 21: $VH, 23: $VI }, o($VJ, [2, 52], { 52: $Vq1 }), o($V41, [2, 77]), o($V41, [2, 76]), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 68: [1, 239], 73: $Va1, 81: $Vb1, 83: 202, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, o($V41, [2, 79]), o($Vs1, [2, 83]), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 240, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: $Vd1, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, o($Vp1, $V5, { 17: 241 }), o($VF, [2, 43]), { 51: 242, 52: $Ve, 54: 46, 66: $Vf, 67: $Vg, 92: $Vm, 96: $Vn, 106: $Vo, 107: $Vp, 110: $Vq, 112: $Vr, 113: $Vs, 117: 47, 123: $Vx, 124: $Vy, 125: $Vz, 126: $VA, 127: $VB, 128: $VC }, { 22: $Vv1, 66: $Vw1, 67: $Vx1, 87: $Vy1, 97: 243, 103: $Vz1, 106: $VA1, 108: 244, 109: 245, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1, 114: $VF1 }, { 22: $Vv1, 66: $Vw1, 67: $Vx1, 87: $Vy1, 97: 257, 103: $Vz1, 106: $VA1, 108: 244, 109: 245, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1, 114: $VF1 }, { 22: $Vv1, 66: $Vw1, 67: $Vx1, 87: $Vy1, 97: 258, 103: $Vz1, 105: [1, 259], 106: $VA1, 108: 244, 109: 245, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1, 114: $VF1 }, { 22: $Vv1, 66: $Vw1, 67: $Vx1, 87: $Vy1, 97: 260, 103: $Vz1, 105: [1, 261], 106: $VA1, 108: 244, 109: 245, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1, 114: $VF1 }, { 106: [1, 262] }, { 22: $Vv1, 66: $Vw1, 67: $Vx1, 87: $Vy1, 97: 263, 103: $Vz1, 106: $VA1, 108: 244, 109: 245, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1, 114: $VF1 }, { 22: $Vv1, 66: $Vw1, 67: $Vx1, 87: $Vy1, 97: 264, 103: $Vz1, 106: $VA1, 108: 244, 109: 245, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1, 114: $VF1 }, { 26: $VK, 52: $VL, 66: $VM, 67: $VN, 92: $VO, 98: 265, 106: $VP, 107: $VQ, 110: $VR, 112: $VS, 113: $VT, 116: 100, 118: 98, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, o($V11, [2, 103]), { 84: [1, 266] }, o($V11, [2, 107], { 22: [1, 267] }), o($V11, [2, 108]), o($V11, [2, 111]), o($V11, [2, 113], { 22: [1, 268] }), o($V11, [2, 114]), o($V$, [2, 58]), o($V$, [2, 59]), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 58: [1, 269], 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 202, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, o($V$, [2, 66]), o($V$, [2, 61]), o($V$, [2, 62]), o($V$, [2, 63]), { 66: [1, 270] }, o($V$, [2, 65]), o($V$, [2, 67]), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 72: [1, 271], 73: $Va1, 81: $Vb1, 83: 202, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, o($V$, [2, 69]), o($V$, [2, 70]), o($V$, [2, 72]), o($V$, [2, 71]), o($V$, [2, 73]), o($Vt1, [2, 4]), o([22, 52, 66, 67, 92, 96, 106, 107, 110, 112, 113, 123, 124, 125, 126, 127, 128], [2, 81]), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 41: [1, 272], 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 202, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 18: 18, 19: 19, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 32: 24, 33: 25, 34: 26, 35: 27, 36: 28, 37: 29, 38: $Va, 42: [1, 273], 43: 31, 44: $Vb, 46: $Vc, 48: $Vd, 50: 35, 51: 45, 52: $Ve, 54: 46, 66: $Vf, 67: $Vg, 87: $Vh, 88: $Vi, 89: $Vj, 90: $Vk, 91: $Vl, 92: $Vm, 96: $Vn, 106: $Vo, 107: $Vp, 110: $Vq, 112: $Vr, 113: $Vs, 117: 47, 119: $Vt, 120: $Vu, 121: $Vv, 122: $Vw, 123: $Vx, 124: $Vy, 125: $Vz, 126: $VA, 127: $VB, 128: $VC }, o($V_, [2, 56]), o($V11, [2, 116], { 107: $VG1 }), o($VH1, [2, 126], { 109: 275, 22: $Vv1, 66: $Vw1, 67: $Vx1, 87: $Vy1, 103: $Vz1, 106: $VA1, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1, 114: $VF1 }), o($VI1, [2, 128]), o($VI1, [2, 130]), o($VI1, [2, 131]), o($VI1, [2, 132]), o($VI1, [2, 133]), o($VI1, [2, 134]), o($VI1, [2, 135]), o($VI1, [2, 136]), o($VI1, [2, 137]), o($VI1, [2, 138]), o($VI1, [2, 139]), o($VI1, [2, 140]), o($V11, [2, 117], { 107: $VG1 }), o($V11, [2, 118], { 107: $VG1 }), { 22: [1, 276] }, o($V11, [2, 119], { 107: $VG1 }), { 22: [1, 277] }, o($Vu1, [2, 125]), o($V11, [2, 99], { 107: $VG1 }), o($V11, [2, 100], { 107: $VG1 }), o($V11, [2, 101], { 116: 100, 118: 179, 26: $VK, 52: $VL, 66: $VM, 67: $VN, 92: $VO, 106: $VP, 107: $VQ, 110: $VR, 112: $VS, 113: $VT, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }), o($V11, [2, 105]), { 102: [1, 278] }, { 102: [1, 279] }, { 58: [1, 280] }, { 68: [1, 281] }, { 72: [1, 282] }, { 9: 283, 20: $VG, 21: $VH, 23: $VI }, o($VF, [2, 42]), { 22: $Vv1, 66: $Vw1, 67: $Vx1, 87: $Vy1, 103: $Vz1, 106: $VA1, 108: 284, 109: 245, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1, 114: $VF1 }, o($VI1, [2, 129]), { 26: $VK, 52: $VL, 66: $VM, 67: $VN, 92: $VO, 98: 285, 106: $VP, 107: $VQ, 110: $VR, 112: $VS, 113: $VT, 116: 100, 118: 98, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 26: $VK, 52: $VL, 66: $VM, 67: $VN, 92: $VO, 98: 286, 106: $VP, 107: $VQ, 110: $VR, 112: $VS, 113: $VT, 116: 100, 118: 98, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, o($V11, [2, 109]), o($V11, [2, 115]), o($V$, [2, 60]), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 287, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: $Vd1, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, o($V$, [2, 68]), o($Vp1, $V5, { 17: 288 }), o($VH1, [2, 127], { 109: 275, 22: $Vv1, 66: $Vw1, 67: $Vx1, 87: $Vy1, 103: $Vz1, 106: $VA1, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1, 114: $VF1 }), o($V11, [2, 122], { 116: 100, 118: 179, 22: [1, 289], 26: $VK, 52: $VL, 66: $VM, 67: $VN, 92: $VO, 106: $VP, 107: $VQ, 110: $VR, 112: $VS, 113: $VT, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }), o($V11, [2, 123], { 116: 100, 118: 179, 22: [1, 290], 26: $VK, 52: $VL, 66: $VM, 67: $VN, 92: $VO, 106: $VP, 107: $VQ, 110: $VR, 112: $VS, 113: $VT, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 41: [1, 291], 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 202, 86: 152, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 93: $Vk1, 95: 143, 96: $Vl1, 106: $VP, 107: $VQ, 110: $Vm1, 112: $VS, 113: $VT, 114: $Vn1, 115: $Vo1, 116: 149, 123: $VU, 124: $VV, 125: $VW, 126: $VX, 127: $VY, 128: $VZ }, { 18: 18, 19: 19, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 32: 24, 33: 25, 34: 26, 35: 27, 36: 28, 37: 29, 38: $Va, 42: [1, 292], 43: 31, 44: $Vb, 46: $Vc, 48: $Vd, 50: 35, 51: 45, 52: $Ve, 54: 46, 66: $Vf, 67: $Vg, 87: $Vh, 88: $Vi, 89: $Vj, 90: $Vk, 91: $Vl, 92: $Vm, 96: $Vn, 106: $Vo, 107: $Vp, 110: $Vq, 112: $Vr, 113: $Vs, 117: 47, 119: $Vt, 120: $Vu, 121: $Vv, 122: $Vw, 123: $Vx, 124: $Vy, 125: $Vz, 126: $VA, 127: $VB, 128: $VC }, { 22: $Vv1, 66: $Vw1, 67: $Vx1, 87: $Vy1, 97: 293, 103: $Vz1, 106: $VA1, 108: 244, 109: 245, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1, 114: $VF1 }, { 22: $Vv1, 66: $Vw1, 67: $Vx1, 87: $Vy1, 97: 294, 103: $Vz1, 106: $VA1, 108: 244, 109: 245, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1, 114: $VF1 }, o($V$, [2, 64]), o($VF, [2, 41]), o($V11, [2, 120], { 107: $VG1 }), o($V11, [2, 121], { 107: $VG1 })], - defaultActions: { 2: [2, 1], 9: [2, 5], 10: [2, 2], 132: [2, 7] }, - parseError: function parseError2(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; - } + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js + function durationFunction(id27, value2) { + return function() { + set2(this, id27).duration = +value2.apply(this, arguments); }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError2(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 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; - }, - // unshifts one char (or a string) into the input - unput: 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 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, 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 && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = 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[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 - }); - } - }, - // 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: - this.begin("open_directive"); - return 12; - case 1: - this.begin("type_directive"); - return 13; - case 2: - this.popState(); - this.begin("arg_directive"); - return 10; - case 3: - this.popState(); - this.popState(); - return 15; - case 4: - return 14; - case 5: - this.begin("acc_title"); - return 44; - case 6: - this.popState(); - return "acc_title_value"; - case 7: - this.begin("acc_descr"); - return 46; - case 8: - this.popState(); - return "acc_descr_value"; - case 9: - this.begin("acc_descr_multiline"); - break; - case 10: - this.popState(); - break; - case 11: - return "acc_descr_multiline_value"; - case 12: - this.begin("md_string"); - break; - case 13: - return "MD_STR"; - case 14: - this.popState(); - break; - case 15: - this.begin("string"); - break; - case 16: - this.popState(); - break; - case 17: - return "STR"; - case 18: - return 87; - case 19: - return 96; - case 20: - return 88; - case 21: - return 105; - case 22: - return 89; - case 23: - return 90; - case 24: - this.begin("href"); - break; - case 25: - this.popState(); - break; - case 26: - return 101; - case 27: - this.begin("callbackname"); - break; - case 28: - this.popState(); - break; - case 29: - this.popState(); - this.begin("callbackargs"); - break; - case 30: - return 99; - case 31: - this.popState(); - break; - case 32: - return 100; - case 33: - this.begin("click"); - break; - case 34: - this.popState(); - break; - case 35: - return 91; - case 36: - if (yy.lex.firstGraph()) { - this.begin("dir"); - } - return 24; - case 37: - if (yy.lex.firstGraph()) { - this.begin("dir"); - } - return 24; - case 38: - if (yy.lex.firstGraph()) { - this.begin("dir"); - } - return 24; - case 39: - return 38; - case 40: - return 42; - case 41: - return 102; - case 42: - return 102; - case 43: - return 102; - case 44: - return 102; - case 45: - this.popState(); - return 25; - case 46: - this.popState(); - return 26; - case 47: - this.popState(); - return 26; - case 48: - this.popState(); - return 26; - case 49: - this.popState(); - return 26; - case 50: - this.popState(); - return 26; - case 51: - this.popState(); - return 26; - case 52: - this.popState(); - return 26; - case 53: - this.popState(); - return 26; - case 54: - this.popState(); - return 26; - case 55: - this.popState(); - return 26; - case 56: - return 119; - case 57: - return 120; - case 58: - return 121; - case 59: - return 122; - case 60: - return 106; - case 61: - return 112; - case 62: - return 53; - case 63: - return 67; - case 64: - return 52; - case 65: - return 20; - case 66: - return 107; - case 67: - return 127; - case 68: - return 82; - case 69: - return 82; - case 70: - return 82; - case 71: - return 82; - case 72: - return 81; - case 73: - return 81; - case 74: - return 81; - case 75: - return 59; - case 76: - return 60; - case 77: - return 61; - case 78: - return 62; - case 79: - return 63; - case 80: - return 64; - case 81: - return 65; - case 82: - return 69; - case 83: - return 70; - case 84: - return 55; - case 85: - return 56; - case 86: - return 110; - case 87: - return 113; - case 88: - return 128; - case 89: - return 125; - case 90: - return 114; - case 91: - return 126; - case 92: - return 126; - case 93: - return 115; - case 94: - return 73; - case 95: - return 93; - case 96: - return "SEP"; - case 97: - return 92; - case 98: - return 66; - case 99: - return 75; - case 100: - return 74; - case 101: - return 77; - case 102: - return 76; - case 103: - return 123; - case 104: - return 124; - case 105: - return 68; - case 106: - return 57; - case 107: - return 58; - case 108: - return 40; - case 109: - return 41; - case 110: - return 71; - case 111: - return 72; - case 112: - return 134; - case 113: - return 21; - case 114: - return 22; - case 115: - return 23; - } - }, - rules: [/^(?:%%\{)/, /^(?:((?:(?!\}%%)[^:.])*))/, /^(?::)/, /^(?:\}%%)/, /^(?:((?:(?!\}%%).|\n)*))/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:style\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\b)/, /^(?:class\b)/, /^(?:href[\s]+["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:call[\s]+)/, /^(?:\([\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<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\[)/, /^(?:\]\))/, /^(?:\[\[)/, /^(?:\]\])/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\])/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:-)/, /^(?:\.)/, /^(?:[\_])/, /^(?:\+)/, /^(?:%)/, /^(?:=)/, /^(?:=)/, /^(?:<)/, /^(?:>)/, /^(?:\^)/, /^(?:\\\|)/, /^(?:v\b)/, /^(?:[A-Za-z]+)/, /^(?:\\\])/, /^(?:\[\/)/, /^(?:\/\])/, /^(?:\[\\)/, /^(?:[!"#$%&'*+,-.`?\\_/])/, /^(?:[\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: { "close_directive": { "rules": [], "inclusive": false }, "arg_directive": { "rules": [3, 4], "inclusive": false }, "type_directive": { "rules": [2, 3], "inclusive": false }, "open_directive": { "rules": [1], "inclusive": false }, "callbackargs": { "rules": [31, 32], "inclusive": false }, "callbackname": { "rules": [28, 29, 30], "inclusive": false }, "href": { "rules": [25, 26], "inclusive": false }, "click": { "rules": [34, 35], "inclusive": false }, "vertex": { "rules": [], "inclusive": false }, "dir": { "rules": [45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55], "inclusive": false }, "acc_descr_multiline": { "rules": [10, 11], "inclusive": false }, "acc_descr": { "rules": [8], "inclusive": false }, "acc_title": { "rules": [6], "inclusive": false }, "md_string": { "rules": [13, 14], "inclusive": false }, "string": { "rules": [16, 17], "inclusive": false }, "INITIAL": { "rules": [0, 5, 7, 9, 12, 15, 18, 19, 20, 21, 22, 23, 24, 27, 33, 36, 37, 38, 39, 40, 41, 42, 43, 44, 56, 57, 58, 59, 60, 61, 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, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser() { - this.yy = {}; - } - Parser.prototype = parser2; - parser2.Parser = Parser; - return new Parser(); - }(); - parser$k.parser = parser$k; - const parser$l = parser$k; - const MERMAID_DOM_ID_PREFIX$1 = "flowchart-"; - let vertexCounter = 0; - let config = getConfig$1(); - let vertices = {}; - let edges = []; - let classes$2 = {}; - let subGraphs = []; - let subGraphLookup = {}; - let tooltips = {}; - let subCount = 0; - let firstGraphFlag = true; - let direction$3; - let version; - let funs$1 = []; - const sanitizeText$4 = (txt) => common$1.sanitizeText(txt, config); - const parseDirective$a = function(statement, context, type2) { - mermaidAPI.parseDirective(this, statement, context, type2); - }; - const lookUpDomId$1 = function(id2) { - const veritceKeys = Object.keys(vertices); - for (const veritceKey of veritceKeys) { - if (vertices[veritceKey].id === id2) { - return vertices[veritceKey].domId; - } - } - return id2; - }; - const addVertex = function(_id, textObj, type2, style, classes2, dir, props = {}) { - let txt; - let id2 = _id; - if (id2 === void 0) { - return; + } + function durationConstant(id27, value2) { + return value2 = +value2, function() { + set2(this, id27).duration = value2; + }; + } + function duration_default(value2) { + var id27 = this._id; + return arguments.length ? this.each((typeof value2 === "function" ? durationFunction : durationConstant)(id27, value2)) : get2(this.node(), id27).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"); } - if (id2.trim().length === 0) { - return; + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js + function easeConstant(id27, value2) { + if (typeof value2 !== "function") throw new Error(); + return function() { + set2(this, id27).ease = value2; + }; + } + function ease_default(value2) { + var id27 = this._id; + return arguments.length ? this.each(easeConstant(id27, value2)) : get2(this.node(), id27).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"); } - if (vertices[id2] === void 0) { - vertices[id2] = { - id: id2, - labelType: "text", - domId: MERMAID_DOM_ID_PREFIX$1 + id2 + "-" + vertexCounter, - styles: [], - classes: [] - }; + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/easeVarying.js + function easeVarying(id27, value2) { + return function() { + var v3 = value2.apply(this, arguments); + if (typeof v3 !== "function") throw new Error(); + set2(this, id27).ease = v3; + }; + } + 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"); } - vertexCounter++; - if (textObj !== void 0) { - config = getConfig$1(); - txt = sanitizeText$4(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; + }); + + // ../../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); + } } } - if (type2 !== void 0) { - vertices[id2].type = type2; + 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"); + } + }); + + // ../../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; + } + } } - if (style !== void 0 && style !== null) { - style.forEach(function(s) { - vertices[id2].styles.push(s); - }); + for (; j2 < m0; ++j2) { + merges[j2] = groups0[j2]; } - if (classes2 !== void 0 && classes2 !== null) { - classes2.forEach(function(s) { - vertices[id2].classes.push(s); - }); + return new Transition(merges, this._parents, this._name, this._id); + } + var init_merge3 = __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"); } - if (dir !== void 0) { - vertices[id2].dir = dir; + }); + + // ../../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(id27, name, listener) { + var on0, on1, sit = start(name) ? init : set2; + return function() { + var schedule = sit(this, id27), on3 = schedule.on; + if (on3 !== on0) (on1 = (on0 = on3).copy()).on(name, listener); + schedule.on = on1; + }; + } + function on_default2(name, listener) { + var id27 = this._id; + return arguments.length < 2 ? get2(this.node(), id27).on.on(name) : this.each(onFunction(id27, 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"); } - if (vertices[id2].props === void 0) { - vertices[id2].props = props; - } else if (props !== void 0) { - Object.assign(vertices[id2].props, props); + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/remove.js + function removeFunction(id27) { + return function() { + var parent4 = this.parentNode; + for (var i2 in this.__transition) if (+i2 !== id27) return; + if (parent4) parent4.removeChild(this); + }; + } + 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"); } - }; - 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$4(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; - } - edges.push(edge); - }; - const addLink = 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); + }); + + // ../../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, id27 = 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, id27, i2, subgroup, get2(node2, id27)); + } } } - }; - 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 === "default") { - edges.defaultStyle = style; - } else { - if (utils.isSubstringInArray("fill", style) === -1) { - style.push("fill:none"); + return new Transition(subgroups, this._parents, name, id27); + } + 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, id27 = 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, id27), k2 = 0, l2 = children2.length; k2 < l2; ++k2) { + if (child = children2[k2]) { + schedule_default(child, name, id27, k2, children2, inherit2); + } + } + subgroups.push(children2); + parents4.push(node2); } - edges[pos].style = style; } - }); - }; - const addClass$1 = function(id2, style) { - if (classes$2[id2] === void 0) { - classes$2[id2] = { id: id2, styles: [], textStyles: [] }; - } - if (style !== void 0 && style !== null) { - style.forEach(function(s) { - if (s.match("color")) { - const newStyle1 = s.replace("fill", "bgFill"); - const newStyle2 = newStyle1.replace("color", "fill"); - classes$2[id2].textStyles.push(newStyle2); - } - classes$2[id2].styles.push(s); - }); } - }; - const setDirection$3 = function(dir) { - direction$3 = dir; - if (direction$3.match(/.*/)) { - direction$3 = "LR"; + }); + + // ../../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 (direction$3.match(/.*v/)) { - direction$3 = "TB"; + }); + + // ../../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; } - if (direction$3 === "TD") { - direction$3 = "TB"; + __name(tween, "tween"); + tween._value = value2; + return tween; + } + 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"); } - }; - 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$4(tooltip); + }); + + // ../../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 + }); + } } - }); - }; - const setClickFun$1 = function(id2, functionName, functionArgs) { - let domId = lookUpDomId$1(id2); - if (getConfig$1().securityLevel !== "loose") { - return; } - if (functionName === void 0) { - return; + return new Transition(groups, this._parents, name, id1); + } + 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"); } - 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.runFunc(functionName, ...argList); - }, - false - ); + }); + + // ../../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, id27 = 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, id27), 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; }); - } - }; - const setLink$2 = function(ids, linkStr, target) { - ids.split(",").forEach(function(id2) { - if (vertices[id2] !== void 0) { - vertices[id2].link = utils.formatUrl(linkStr, config); - vertices[id2].linkTarget = target; - } - }); - setClass$1(ids, "clickable"); - }; - const getTooltip$1 = function(id2) { - return tooltips[id2]; - }; - 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(element) { - funs$1.forEach(function(fun) { - fun(element); + if (size5 === 0) resolve3(); }); - }; - const getDirection$3 = function() { - return direction$3.trim(); - }; - const getVertices = function() { - return vertices; - }; - const getEdges = function() { - return edges; - }; - const getClasses$6 = function() { - return classes$2; - }; - const setupToolTips$1 = function(element) { - let tooltipElem = select(".mermaidTooltip"); - if ((tooltipElem._groups || tooltipElem)[0][0] === null) { - tooltipElem = select("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0); - } - const svg2 = select(element).select("svg"); - const nodes2 = svg2.selectAll("g.node"); - nodes2.on("mouseover", function() { - const el = select(this); - const title2 = el.attr("title"); - if (title2 === null) { - return; + } + 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"); + } + }); + + // ../../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, id27) { + this._groups = groups; + this._parents = parents4; + this._name = name; + this._id = id27; + } + 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_merge3(); + 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] + }; + } + }); + + // ../../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"); + } + }); + + // ../../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, id27) { + var timing; + while (!(timing = node2.__transition) || !(timing = timing[id27])) { + if (!(node2 = node2.parentNode)) { + throw new Error(`transition ${id27} not found`); } - 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 = select(this); - el.classed("hover", false); - }); - }; - funs$1.push(setupToolTips$1); - const clear$g = function(ver = "gen-1") { - vertices = {}; - classes$2 = {}; - edges = []; - funs$1 = [setupToolTips$1]; - subGraphs = []; - subGraphLookup = {}; - subCount = 0; - tooltips = []; - firstGraphFlag = true; - version = ver; - clear$i(); - }; - 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, list, _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 dir2; - const nodeList2 = a.filter(function(item) { - const type2 = typeof item; - if (item.stmt && item.stmt === "dir") { - dir2 = item.value; - return false; - } - if (item.trim() === "") { - return false; - } - if (type2 in prims) { - return prims[type2].hasOwnProperty(item) ? false : prims[type2][item] = true; - } else { - return objs.includes(item) ? false : objs.push(item); + } + return timing; + } + function transition_default2(name) { + var id27, timing; + if (name instanceof Transition) { + id27 = name._id, name = name._name; + } else { + id27 = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + ""; + } + 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, id27, i2, group2, timing || inherit(node2, id27)); } - }); - return { nodeList: nodeList2, dir: dir2 }; - } - let nodeList = []; - const { nodeList: nl, dir } = uniq(nodeList.concat.apply(nodeList, list)); - 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$4(title2); - subCount = subCount + 1; - const subGraph = { - id: id2, - nodes: nodeList, - title: title2.trim(), - classes: [], - dir, - 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 + return new Transition(groups, this._parents, name, id27); + } + 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"); } - 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; - } - } - count = count + 1; + }); + + // ../../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; } - 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); + }); + + // ../../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(); } - }; - const getSubGraphs = function() { - return subGraphs; - }; - const firstGraph = () => { - if (firstGraphFlag) { - firstGraphFlag = false; - return true; + }); + + // ../../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 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; + }); + + // ../../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"; + } + }); + + // ../../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"; } - let stroke = "normal"; - if (str2.includes("=")) { - stroke = "thick"; + }); + + // ../../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"); } - if (str2.includes(".")) { - stroke = "dotted"; + }); + + // ../../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 { 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; + }); + + // ../../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]; + } + } + 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]; } - } - 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); + }; + } + 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}`; + } } - break; - case ">": - type2 = "arrow_point"; - if (str2[0] === "<") { - type2 = "double_" + type2; - line2 = line2.slice(1); + 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)}`; + } } - break; - case "o": - type2 = "arrow_circle"; - if (str2[0] === "o") { - type2 = "double_" + type2; - line2 = line2.slice(1); + 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`; } - break; - } - let stroke = "normal"; - let length2 = line2.length - 1; - if (line2[0] === "=") { - stroke = "thick"; + toString() { + return this._; + } + }; + __name(path2, "path"); + path2.prototype = Path.prototype; } - if (line2[0] === "~") { - stroke = "invisible"; + }); + + // ../../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(); } - let dots = countChar(".", line2); - if (dots) { - stroke = "dotted"; - length2 = dots; + }); + + // ../../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"; } - 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"; - } - startInfo.length = info2.length; - return startInfo; + }); + + // ../../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 info2; - }; - const exists = (allSgs, _id) => { - let res = false; - allSgs.forEach((sg) => { - const pos = sg.nodes.indexOf(_id); - if (pos >= 0) { - res = true; - } - }); - return res; - }; - const makeUniq = (sg, allSubgraphs) => { - const res = []; - sg.nodes.forEach((_id, pos) => { - if (!exists(allSubgraphs, _id)) { - res.push(sg.nodes[pos]); - } - }); - return { nodes: res }; - }; - const lex = { - firstGraph - }; - const flowDb = { - parseDirective: parseDirective$a, - defaultConfig: () => defaultConfig.flowchart, - setAccTitle, - getAccTitle, - getAccDescription, - setAccDescription, - addVertex, - lookUpDomId: lookUpDomId$1, - addLink, - 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, - getClasses: getClasses$6, - clear: clear$g, - setGen, - defaultStyle, - addSubGraph, - getDepthFirstPos, - indexNodes, - getSubGraphs, - destructLink, - lex, - exists, - makeUniq, - setDiagramTitle, - getDiagramTitle - }; - const db$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - addClass: addClass$1, - addLink, - addSingleLink, - addSubGraph, - addVertex, - bindFunctions: bindFunctions$2, - clear: clear$g, - default: flowDb, - defaultStyle, - destructLink, - firstGraph, - getClasses: getClasses$6, - getDepthFirstPos, - getDirection: getDirection$3, - getEdges, - getSubGraphs, - getTooltip: getTooltip$1, - getVertices, - indexNodes, - lex, - lookUpDomId: lookUpDomId$1, - parseDirective: parseDirective$a, - 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(value) { - return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$3; - } - function arrayMap(array2, iteratee) { - var index = -1, length2 = array2 == null ? 0 : array2.length, result = Array(length2); - while (++index < length2) { - result[index] = iteratee(array2[index], index, array2); + }); + + // ../../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"; } - return result; - } - 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(value) { - if (typeof value == "string") { - return value; + }); + + // ../../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 (isArray$1(value)) { - return arrayMap(value, baseToString) + ""; + }); + + // ../../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"; } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ""; + }); + + // ../../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"; } - var result = value + ""; - return result == "0" && 1 / value == -INFINITY$3 ? "-0" : result; - } - var reWhitespace = /\s/; - function trimmedEndIndex(string) { - var index = string.length; - while (index-- && reWhitespace.test(string.charAt(index))) { + }); + + // ../../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"; } - return index; + }); + + // ../../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); } - var reTrimStart = /^\s+/; - function baseTrim(string) { - return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string; + 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 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(value) { - if (typeof value == "number") { - return value; - } - if (isSymbol(value)) { - return NAN; + 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"); } - if (isObject(value)) { - var other = typeof value.valueOf == "function" ? value.valueOf() : value; - value = isObject(other) ? other + "" : other; - } - if (typeof value != "string") { - return value === 0 ? value : +value; - } - value = baseTrim(value); - var isBinary2 = reIsBinary.test(value); - return isBinary2 || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary2 ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; + }); + + // ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/exponent.js + function exponent_default(x5) { + return x5 = formatDecimalParts(Math.abs(x5)), x5 ? x5[1] : NaN; } - var INFINITY$2 = 1 / 0, MAX_INTEGER = 17976931348623157e292; - function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; + var init_exponent = __esm({ + "../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/exponent.js"() { + "use strict"; + init_formatDecimal(); + __name(exponent_default, "default"); } - value = toNumber(value); - if (value === INFINITY$2 || value === -INFINITY$2) { - var sign2 = value < 0 ? -1 : 1; - return sign2 * MAX_INTEGER; + }); + + // ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatGroup.js + function formatGroup_default(grouping, thousands) { + return function(value2, width3) { + var i2 = value2.length, t4 = [], j2 = 0, g2 = grouping[0], length2 = 0; + while (i2 > 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 init_formatGroup = __esm({ + "../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatGroup.js"() { + "use strict"; + __name(formatGroup_default, "default"); } - return value === value ? value : 0; + }); + + // ../../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]; + }); + }; } - function toInteger(value) { - var result = toFinite(value), remainder = result % 1; - return result === result ? remainder ? result - remainder : result : 0; + 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 identity(value) { - return value; + 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 + ""; } - var objectCreate = Object.create; - var baseCreate = function() { - function object2() { + 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; + }; } - return function(proto2) { - if (!isObject(proto2)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto2); + }); + + // ../../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; } - object2.prototype = proto2; - var result = new object2(); - object2.prototype = void 0; - return result; - }; - }(); - const baseCreate$1 = baseCreate; - 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); + return i0 > 0 ? s2.slice(0, i0) + s2.slice(i1 + 1) : s2; } - function noop() { + 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]; } - function copyArray(source, array2) { - var index = -1, length2 = source.length; - array2 || (array2 = Array(length2)); - while (++index < length2) { - array2[index] = source[index]; + 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"); + } + }); + + // ../../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"); + } + }); + + // ../../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") + }; } - return array2; + }); + + // ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/identity.js + function identity_default2(x5) { + return x5; } - 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]; + 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"); + } + }); + + // ../../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; + } + } + } } - } else { - count = 0; - } - return func.apply(void 0, arguments); - }; - } - function constant(value) { - return function() { - return value; - }; - } - var defineProperty = function() { - try { - var func = getNative(Object, "defineProperty"); - func({}, "", {}); - return func; - } catch (e) { - } - }(); - const defineProperty$1 = defineProperty; - var baseSetToString = !defineProperty$1 ? identity : function(func, string) { - return defineProperty$1(func, "toString", { - "configurable": true, - "enumerable": false, - "value": constant(string), - "writable": true - }); - }; - const baseSetToString$1 = baseSetToString; - var setToString = shortOut(baseSetToString$1); - const setToString$1 = setToString; - function arrayEach(array2, iteratee) { - var index = -1, length2 = array2 == null ? 0 : array2.length; - while (++index < length2) { - if (iteratee(array2[index], index, array2) === false) { - break; + if (comma && !zero3) value2 = group2(value2, Infinity); + var length2 = valuePrefix.length + value2.length + valueSuffix.length, padding3 = length2 < width3 ? new Array(width3 - length2 + 1).join(fill) : ""; + if (comma && zero3) value2 = group2(padding3 + value2, padding3.length ? width3 - valueSuffix.length : Infinity), padding3 = ""; + switch (align) { + case "<": + value2 = valuePrefix + value2 + valueSuffix + padding3; + break; + case "=": + value2 = valuePrefix + padding3 + value2 + valueSuffix; + break; + case "^": + value2 = padding3.slice(0, length2 = padding3.length >> 1) + valuePrefix + value2 + valueSuffix + padding3.slice(length2); + break; + default: + value2 = padding3 + valuePrefix + value2 + valueSuffix; + break; + } + return numerals(value2); } + __name(format3, "format"); + format3.toString = function() { + return specifier + ""; + }; + return format3; } - return array2; - } - function baseFindIndex(array2, predicate, fromIndex, fromRight) { - var length2 = array2.length, index = fromIndex + (fromRight ? 1 : -1); - while (fromRight ? index-- : ++index < length2) { - if (predicate(array2[index], index, array2)) { - return index; - } + __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; + }; } - return -1; - } - function baseIsNaN(value) { - return value !== value; + __name(formatPrefix2, "formatPrefix"); + return { + format: newFormat, + formatPrefix: formatPrefix2 + }; } - function strictIndexOf(array2, value, fromIndex) { - var index = fromIndex - 1, length2 = array2.length; - while (++index < length2) { - if (array2[index] === value) { - return index; - } + 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"); } - return -1; - } - function baseIndexOf(array2, value, fromIndex) { - return value === value ? strictIndexOf(array2, value, fromIndex) : baseFindIndex(array2, baseIsNaN, fromIndex); - } - function arrayIncludes(array2, value) { - var length2 = array2 == null ? 0 : array2.length; - return !!length2 && baseIndexOf(array2, value, 0) > -1; - } - var MAX_SAFE_INTEGER = 9007199254740991; - var reIsUint = /^(?:0|[1-9]\d*)$/; - function isIndex(value, length2) { - var type2 = typeof value; - length2 = length2 == null ? MAX_SAFE_INTEGER : length2; - return !!length2 && (type2 == "number" || type2 != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length2); - } - function baseAssignValue(object2, key, value) { - if (key == "__proto__" && defineProperty$1) { - defineProperty$1(object2, key, { - "configurable": true, - "enumerable": true, - "value": value, - "writable": true + }); + + // ../../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; + } + 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: ["$", ""] }); - } else { - object2[key] = value; + __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 objectProto$9 = Object.prototype; - var hasOwnProperty$8 = objectProto$9.hasOwnProperty; - function assignValue(object2, key, value) { - var objValue = object2[key]; - if (!(hasOwnProperty$8.call(object2, key) && eq(objValue, value)) || value === void 0 && !(key in object2)) { - baseAssignValue(object2, key, value); + 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))); } - function copyObject(source, props, object2, customizer) { - var isNew = !object2; - object2 || (object2 = {}); - var index = -1, length2 = props.length; - while (++index < length2) { - var key = props[index]; - 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); - } + 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"); } - return object2; - } - 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, index = -1, length2 = nativeMax$2(args.length - start2, 0), array2 = Array(length2); - while (++index < length2) { - array2[index] = args[start2 + index]; - } - index = -1; - var otherArgs = Array(start2 + 1); - while (++index < start2) { - otherArgs[index] = args[index]; - } - otherArgs[start2] = transform(array2); - return apply$1(func, this, otherArgs); - }; - } - function baseRest(func, start2) { - return setToString$1(overRest(func, start2, identity), func + ""); + }); + + // ../../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; } - function isIterateeCall(value, index, object2) { - if (!isObject(object2)) { - return false; + 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"); } - var type2 = typeof index; - if (type2 == "number" ? isArrayLike(object2) && isIndex(index, object2.length) : type2 == "string" && index in object2) { - return eq(object2[index], value); + }); + + // ../../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(); } - return false; - } - function createAssigner(assigner) { - return baseRest(function(object2, 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(sources[0], sources[1], guard)) { - customizer = length2 < 3 ? void 0 : customizer; - length2 = 1; - } - object2 = Object(object2); - while (++index < length2) { - var source = sources[index]; - if (source) { - assigner(object2, source, index, customizer); - } - } - return object2; - }); - } - function baseTimes(n, iteratee) { - var index = -1, result = Array(n); - while (++index < n) { - result[index] = iteratee(index); + }); + + // ../../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 result; - } - var objectProto$8 = Object.prototype; - var hasOwnProperty$7 = objectProto$8.hasOwnProperty; - function arrayLikeKeys(value, inherited) { - var isArr = isArray$1(value), isArg = !isArr && isArguments$1(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray$1(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length2 = result.length; - for (var key in value) { - if ((inherited || hasOwnProperty$7.call(value, 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); - } + }); + + // ../../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"; } - return result; - } - function keys$1(object2) { - return isArrayLike(object2) ? arrayLikeKeys(object2) : baseKeys(object2); - } - function nativeKeysIn(object2) { - var result = []; - if (object2 != null) { - for (var key in Object(object2)) { - result.push(key); - } + }); + + // ../../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"; } - return result; - } - var objectProto$7 = Object.prototype; - var hasOwnProperty$6 = objectProto$7.hasOwnProperty; - function baseKeysIn(object2) { - if (!isObject(object2)) { - return nativeKeysIn(object2); + }); + + // ../../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 isProto = isPrototype(object2), result = []; - for (var key in object2) { - if (!(key == "constructor" && (isProto || !hasOwnProperty$6.call(object2, key)))) { - result.push(key); - } + }); + + // ../../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; } - return result; - } - function keysIn(object2) { - return isArrayLike(object2) ? arrayLikeKeys(object2, true) : baseKeysIn(object2); + return this; } - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/; - function isKey(value, object2) { - if (isArray$1(value)) { - return false; + var init_init = __esm({ + "../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/init.js"() { + "use strict"; + __name(initRange, "initRange"); } - var type2 = typeof value; - if (type2 == "number" || type2 == "symbol" || type2 == "boolean" || value == null || isSymbol(value)) { - return true; + }); + + // ../../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]; } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object2 != null && value 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(); + __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 key; - }); - var cache = result.cache; - return result; + 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 rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - var reEscapeChar = /\\(\\)?/g; - var stringToPath = memoizeCapped(function(string) { - var result = []; - if (string.charCodeAt(0) === 46) { - result.push(""); + 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"); } - string.replace(rePropName, function(match, number2, quote, subString) { - result.push(quote ? subString.replace(reEscapeChar, "$1") : number2 || match); - }); - return result; }); - const stringToPath$1 = stringToPath; - function toString(value) { - return value == null ? "" : baseToString(value); - } - function castPath(value, object2) { - if (isArray$1(value)) { - return value; + + // ../../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); } - return isKey(value, object2) ? [value] : stringToPath$1(toString(value)); + __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 INFINITY$1 = 1 / 0; - function toKey(value) { - if (typeof value == "string" || isSymbol(value)) { - return value; + 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"); } - var result = value + ""; - return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result; + }); + + // ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/constant.js + function constants(x5) { + return function() { + return x5; + }; } - function baseGet(object2, path2) { - path2 = castPath(path2, object2); - var index = 0, length2 = path2.length; - while (object2 != null && index < length2) { - object2 = object2[toKey(path2[index++])]; + var init_constant4 = __esm({ + "../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/constant.js"() { + "use strict"; + __name(constants, "constants"); } - return index && index == 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; + }); + + // ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/number.js + function number3(x5) { + return +x5; } - function arrayPush(array2, values2) { - var index = -1, length2 = values2.length, offset = array2.length; - while (++index < length2) { - array2[offset + index] = values2[index]; + 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 array2; + }); + + // ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/continuous.js + function identity2(x5) { + return x5; } - var spreadableSymbol = Symbol$2 ? Symbol$2.isConcatSpreadable : void 0; - function isFlattenable(value) { - return isArray$1(value) || isArguments$1(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); + function normalize(a2, b2) { + return (b2 -= a2 = +a2) ? function(x5) { + return (x5 - a2) / b2; + } : constants(isNaN(b2) ? NaN : 0.5); } - function baseFlatten(array2, depth, predicate, isStrict, result) { - var index = -1, length2 = array2.length; - predicate || (predicate = isFlattenable); - result || (result = []); - while (++index < length2) { - var value = array2[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; + 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)); + }; } - function flatten(array2) { - var length2 = array2 == null ? 0 : array2.length; - return length2 ? baseFlatten(array2, 1) : []; + 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 flatRest(func) { - return setToString$1(overRest(func, void 0, flatten), func + ""); - } - var getPrototype = overArg(Object.getPrototypeOf, Object); - const getPrototype$1 = getPrototype; - var objectTag$2 = "[object Object]"; - var funcProto = Function.prototype, objectProto$6 = Object.prototype; - var funcToString = funcProto.toString; - var hasOwnProperty$5 = objectProto$6.hasOwnProperty; - var objectCtorString = funcToString.call(Object); - function isPlainObject(value) { - if (!isObjectLike(value) || baseGetTag(value) != objectTag$2) { - return false; + 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 proto2 = getPrototype$1(value); - if (proto2 === null) { - return true; + while (++i2 < j2) { + d2[i2] = normalize(domain[i2], domain[i2 + 1]); + r2[i2] = interpolate(range3[i2], range3[i2 + 1]); } - var Ctor = hasOwnProperty$5.call(proto2, "constructor") && proto2.constructor; - return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; + return function(x5) { + var i3 = bisect_default(domain, x5, 1, j2) - 1; + return r2[i3](d2[i3](x5)); + }; } - function arrayReduce(array2, iteratee, accumulator, initAccum) { - var index = -1, length2 = array2 == null ? 0 : array2.length; - if (initAccum && length2) { - accumulator = array2[++index]; + 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; } - while (++index < length2) { - accumulator = iteratee(accumulator, array2[index], index, array2); + __name(rescale, "rescale"); + function scale(x5) { + return x5 == null || isNaN(x5 = +x5) ? unknown : (output2 || (output2 = piecewise(domain.map(transform8), range3, interpolate)))(transform8(clamp(x5))); } - return accumulator; - } - 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); + __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(); + }; } - var LARGE_ARRAY_SIZE$1 = 200; - function stackSet(key, value) { - 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, value]); - this.size = ++data.size; - return this; - } - data = this.__data__ = new MapCache(pairs2); + 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"); } - data.set(key, value); - 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; - function baseAssign(object2, source) { - return object2 && copyObject(source, keys$1(source), object2); - } - function baseAssignIn(object2, source) { - return object2 && copyObject(source, keysIn(source), object2); - } - 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 Buffer = moduleExports ? root$1.Buffer : void 0, allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0; - function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); + }); + + // ../../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 "f": + case "%": { + if (specifier.precision == null && !isNaN(precision = precisionFixed_default(step3))) specifier.precision = precision - (specifier.type === "%") * 2; + break; + } } - var length2 = buffer.length, result = allocUnsafe ? allocUnsafe(length2) : new buffer.constructor(length2); - buffer.copy(result); - return result; + return format2(specifier); } - function arrayFilter(array2, predicate) { - var index = -1, length2 = array2 == null ? 0 : array2.length, resIndex = 0, result = []; - while (++index < length2) { - var value = array2[index]; - if (predicate(value, index, array2)) { - result[resIndex++] = value; - } + 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"); } - return result; + }); + + // ../../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); + }; + 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; + } + 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 stubArray() { - return []; + function linear2() { + var scale = continuous(); + scale.copy = function() { + return copy(scale, linear2()); + }; + initRange.apply(scale, arguments); + return linearish(scale); } - 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 []; + 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"); } - 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); + }); + + // ../../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; } - 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); + domain[i0] = interval2.floor(x0); + domain[i1] = interval2.ceil(x1); + return domain; } - var objectProto$4 = Object.prototype; - var hasOwnProperty$4 = objectProto$4.hasOwnProperty; - function initCloneArray(array2) { - var length2 = array2.length, result = new array2.constructor(length2); - if (length2 && typeof array2[0] == "string" && hasOwnProperty$4.call(array2, "index")) { - result.index = array2.index; - result.input = array2.input; + var init_nice = __esm({ + "../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/nice.js"() { + "use strict"; + __name(nice, "nice"); } - 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 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)) : {}; - } - function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + }); + + // ../../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; + } + __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 interval2; } - 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); - } - } - function initCloneObject(object2) { - return typeof object2.constructor == "function" && !isPrototype(object2) ? baseCreate$1(getPrototype$1(object2)) : {}; - } - var mapTag$2 = "[object Map]"; - function baseIsMap(value) { - return isObjectLike(value) && getTag$1(value) == mapTag$2; - } - var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap; - var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; - const isMap$1 = isMap; - var setTag$2 = "[object Set]"; - function baseIsSet(value) { - return isObjectLike(value) && getTag$1(value) == 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(value, 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(value, key, object2, stack) : customizer(value); + 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 (result !== void 0) { - return result; + }); + + // ../../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; } - if (!isObject(value)) { - return value; + }); + + // ../../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; } - var isArr = isArray$1(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag$1(value), isFunc = tag == funcTag || tag == genTag; - if (isBuffer$1(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag$1 || tag == argsTag$1 || isFunc && !object2) { - result = isFlat || isFunc ? {} : initCloneObject(value); - if (!isDeep) { - return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object2 ? value : {}; - } - result = initCloneByTag(value, tag, isDeep); - } + }); + + // ../../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; } - stack || (stack = new Stack()); - var stacked = stack.get(value); - if (stacked) { - return stacked; + }); + + // ../../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; + } + }); + + // ../../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; } - stack.set(value, result); - if (isSet$1(value)) { - value.forEach(function(subValue) { - result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + + // ../../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; }); - } else if (isMap$1(value)) { - value.forEach(function(subValue, key2) { - result.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack)); + 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; } - var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys$1; - var props = isArr ? void 0 : keysFunc(value); - arrayEach(props || value, function(subValue, key2) { - if (props) { - key2 = subValue; - subValue = value[key2]; - } - assignValue(result, key2, baseClone(subValue, bitmask, customizer, key2, value, stack)); + }); + + // ../../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; }); - return result; - } - var CLONE_SYMBOLS_FLAG$1 = 4; - function clone$1(value) { - return baseClone(value, CLONE_SYMBOLS_FLAG$1); - } - var CLONE_DEEP_FLAG = 1, CLONE_SYMBOLS_FLAG = 4; - function cloneDeep(value) { - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); } - var HASH_UNDEFINED = "__lodash_hash_undefined__"; - function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; - } - function setCacheHas(value) { - return this.__data__.has(value); + 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; + }); } - function SetCache(values2) { - var index = -1, length2 = values2 == null ? 0 : values2.length; - this.__data__ = new MapCache(); - while (++index < length2) { - this.add(values2[index]); + 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; } - } - SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; - SetCache.prototype.has = setCacheHas; - function arraySome(array2, predicate) { - var index = -1, length2 = array2 == null ? 0 : array2.length; - while (++index < length2) { - if (predicate(array2[index], index, array2)) { - return true; - } + }); + + // ../../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; } - return false; - } - function cacheHas(cache, key) { - return cache.has(key); + }); + + // ../../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; + } + }); + + // ../../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]; } - 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 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); } - var arrStacked = stack.get(array2); - var othStacked = stack.get(other); - if (arrStacked && othStacked) { - return arrStacked == other && othStacked == array2; + }); + + // ../../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(); } - var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : void 0; - stack.set(array2, other); - stack.set(other, array2); - while (++index < arrLength) { - var arrValue = array2[index], othValue = other[index]; - if (customizer) { - var compared = isPartial ? customizer(othValue, arrValue, index, other, array2, stack) : customizer(arrValue, othValue, index, 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); - } - })) { - result = false; - break; - } - } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { - result = false; - break; - } + }); + + // ../../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; } - stack["delete"](array2); - stack["delete"](other); - return result; + return new Date(d2.y, d2.m, d2.d, d2.H, d2.M, d2.S, d2.L); } - function mapToArray(map2) { - var index = -1, result = Array(map2.size); - map2.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; + 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; + } + return new Date(Date.UTC(d2.y, d2.m, d2.d, d2.H, d2.M, d2.S, d2.L)); } - function setToArray(set2) { - var index = -1, result = Array(set2.size); - set2.forEach(function(value) { - result[++index] = value; - }); - return result; + function newDate(y5, m2, d2) { + return { y: y5, m: m2, d: d2, H: 0, M: 0, S: 0, L: 0 }; } - 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; - } - object2 = object2.buffer; - other = other.buffer; - case arrayBufferTag: - if (object2.byteLength != other.byteLength || !equalFunc(new Uint8Array$2(object2), new Uint8Array$2(other))) { - return false; - } - 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; - } - var stacked = stack.get(object2); - if (stacked) { - return stacked == other; - } - 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); + 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; } - return false; - } - var COMPARE_PARTIAL_FLAG$3 = 1; - var objectProto$3 = Object.prototype; - var hasOwnProperty$3 = 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; + __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; } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : hasOwnProperty$3.call(other, key))) { - return false; - } + __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; } - var objStacked = stack.get(object2); - var othStacked = stack.get(other); - if (objStacked && othStacked) { - return objStacked == other && othStacked == object2; + __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 result = true; - stack.set(object2, other); - stack.set(other, object2); - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - 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"); + __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; } - 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; - } + __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; } - 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$2 = 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; + __name(parseMonth, "parseMonth"); + function parseLocaleDateTime(d2, string3, i2) { + return parseSpecifier(d2, locale_dateTime, string3, i2); } - 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); + __name(parseLocaleDateTime, "parseLocaleDateTime"); + function parseLocaleDate(d2, string3, i2) { + return parseSpecifier(d2, locale_date, string3, i2); } - if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) { - var objIsWrapped = objIsObj && hasOwnProperty$2.call(object2, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$2.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); - } + __name(parseLocaleDate, "parseLocaleDate"); + function parseLocaleTime(d2, string3, i2) { + return parseSpecifier(d2, locale_time, string3, i2); } - if (!isSameTag) { - return false; + __name(parseLocaleTime, "parseLocaleTime"); + function formatShortWeekday(d2) { + return locale_shortWeekdays[d2.getDay()]; } - stack || (stack = new Stack()); - return equalObjects(object2, other, bitmask, customizer, equalFunc, stack); - } - function baseIsEqual(value, other, bitmask, customizer, stack) { - if (value === other) { - return true; + __name(formatShortWeekday, "formatShortWeekday"); + function formatWeekday(d2) { + return locale_weekdays[d2.getDay()]; } - if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) { - return value !== value && other !== other; + __name(formatWeekday, "formatWeekday"); + function formatShortMonth(d2) { + return locale_shortMonths[d2.getMonth()]; } - return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); - } - var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2; - function baseIsMatch(object2, source, matchData, customizer) { - var index = matchData.length, length2 = index, noCustomizer = !customizer; - if (object2 == null) { - return !length2; + __name(formatShortMonth, "formatShortMonth"); + function formatMonth(d2) { + return locale_months[d2.getMonth()]; } - object2 = Object(object2); - while (index--) { - var data = matchData[index]; - if (noCustomizer && data[2] ? data[1] !== object2[data[0]] : !(data[0] in object2)) { - return false; - } + __name(formatMonth, "formatMonth"); + function formatPeriod(d2) { + return locale_periods[+(d2.getHours() >= 12)]; } - while (++index < length2) { - data = matchData[index]; - var key = data[0], objValue = object2[key], srcValue = data[1]; - if (noCustomizer && data[2]) { - if (objValue === void 0 && !(key in object2)) { - return false; - } - } else { - var stack = new Stack(); - if (customizer) { - var result = customizer(objValue, srcValue, key, object2, source, stack); - } - if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) { - return false; - } - } + __name(formatPeriod, "formatPeriod"); + function formatQuarter(d2) { + return 1 + ~~(d2.getMonth() / 3); } - return true; + __name(formatQuarter, "formatQuarter"); + function formatUTCShortWeekday(d2) { + return locale_shortWeekdays[d2.getUTCDay()]; + } + __name(formatUTCShortWeekday, "formatUTCShortWeekday"); + function formatUTCWeekday(d2) { + return locale_weekdays[d2.getUTCDay()]; + } + __name(formatUTCWeekday, "formatUTCWeekday"); + function formatUTCShortMonth(d2) { + return locale_shortMonths[d2.getUTCMonth()]; + } + __name(formatUTCShortMonth, "formatUTCShortMonth"); + function formatUTCMonth(d2) { + return locale_months[d2.getUTCMonth()]; + } + __name(formatUTCMonth, "formatUTCMonth"); + function formatUTCPeriod(d2) { + return locale_periods[+(d2.getUTCHours() >= 12)]; + } + __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; + }; + return f3; + }, "format"), + parse: /* @__PURE__ */ __name(function(specifier) { + var p3 = newParse(specifier += "", false); + p3.toString = function() { + return specifier; + }; + 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 isStrictComparable(value) { - return value === value && !isObject(value); + 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 getMatchData(object2) { - var result = keys$1(object2), length2 = result.length; - while (length2--) { - var key = result[length2], value = object2[key]; - result[length2] = [key, value, isStrictComparable(value)]; - } - return result; + function requote(s2) { + return s2.replace(requoteRe, "\\$&"); } - function matchesStrictComparable(key, srcValue) { - return function(object2) { - if (object2 == null) { - return false; - } - return object2[key] === srcValue && (srcValue !== void 0 || key in Object(object2)); - }; + function formatRe(names) { + return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i"); } - function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - return matchesStrictComparable(matchData[0][0], matchData[0][1]); - } - return function(object2) { - return object2 === source || baseIsMatch(object2, source, matchData); - }; + function formatLookup(names) { + return new Map(names.map((name, i2) => [name.toLowerCase(), i2])); } - function baseHasIn(object2, key) { - return object2 != null && key in Object(object2); + 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 hasPath(object2, path2, hasFunc) { - path2 = castPath(path2, object2); - var index = -1, length2 = path2.length, result = false; - while (++index < length2) { - var key = toKey(path2[index]); - if (!(result = object2 != null && hasFunc(object2, key))) { - break; - } - object2 = object2[key]; - } - if (result || ++index != length2) { - return result; - } - length2 = object2 == null ? 0 : object2.length; - return !!length2 && isLength(length2) && isIndex(key, length2) && (isArray$1(object2) || isArguments$1(object2)); + 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 hasIn(object2, path2) { - return object2 != null && hasPath(object2, path2, baseHasIn); + 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; } - var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; - function baseMatchesProperty(path2, srcValue) { - if (isKey(path2) && isStrictComparable(srcValue)) { - return matchesStrictComparable(toKey(path2), srcValue); - } - 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 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 baseProperty(key) { - return function(object2) { - return object2 == null ? void 0 : object2[key]; - }; + 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 basePropertyDeep(path2) { - return function(object2) { - return baseGet(object2, path2); - }; + 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 property(path2) { - return isKey(path2) ? baseProperty(toKey(path2)) : basePropertyDeep(path2); + 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 baseIteratee(value) { - if (typeof value == "function") { - return value; - } - if (value == null) { - return identity; - } - if (typeof value == "object") { - return isArray$1(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); - } - return property(value); + 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 createBaseFor(fromRight) { - return function(object2, iteratee, keysFunc) { - var index = -1, iterable = Object(object2), props = keysFunc(object2), length2 = props.length; - while (length2--) { - var key = props[fromRight ? length2 : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object2; - }; + 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; } - var baseFor = createBaseFor(); - const baseFor$1 = baseFor; - function baseForOwn(object2, iteratee) { - return object2 && baseFor$1(object2, iteratee, keys$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 createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length2 = collection.length, index = fromRight ? length2 : -1, iterable = Object(collection); - while (fromRight ? index-- : ++index < length2) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; + 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; } - 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$1 = objectProto$1.hasOwnProperty; - var defaults = baseRest(function(object2, sources) { - object2 = Object(object2); - var index = -1; - var length2 = sources.length; - var guard = length2 > 2 ? sources[2] : void 0; - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - length2 = 1; - } - while (++index < length2) { - var source = sources[index]; - var props = keysIn(source); - var propsIndex = -1; - var propsLength = props.length; - while (++propsIndex < propsLength) { - var key = props[propsIndex]; - var value = object2[key]; - if (value === void 0 || eq(value, objectProto$1[key]) && !hasOwnProperty$1.call(object2, key)) { - object2[key] = source[key]; - } - } - } - return object2; - }); - const defaults$1 = defaults; - function assignMergeValue(object2, key, value) { - if (value !== void 0 && !eq(object2[key], value) || value === void 0 && !(key in object2)) { - baseAssignValue(object2, key, value); - } + 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 isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); + 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 safeGet(object2, key) { - if (key === "constructor" && typeof object2[key] === "function") { - return; - } - if (key == "__proto__") { - return; - } - return object2[key]; + 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 toPlainObject(value) { - return copyObject(value, keysIn(value)); + 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 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); - } else { - newValue = []; - } - } else if (isPlainObject(srcValue) || isArguments$1(srcValue)) { - newValue = objValue; - if (isArguments$1(objValue)) { - newValue = toPlainObject(objValue); - } else if (!isObject(objValue) || isFunction(objValue)) { - newValue = initCloneObject(srcValue); - } - } else { - isCommon = false; - } - } - if (isCommon) { - stack.set(srcValue, newValue); - mergeFunc(newValue, srcValue, srcIndex, customizer, stack); - stack["delete"](srcValue); - } - assignMergeValue(object2, key, newValue); + 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 baseMerge(object2, source, srcIndex, customizer, stack) { - if (object2 === source) { - return; - } - baseFor$1(source, function(srcValue, key) { - stack || (stack = new Stack()); - if (isObject(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; - } - assignMergeValue(object2, key, newValue); - } - }, keysIn); + 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 arrayIncludesWith(array2, value, comparator) { - var index = -1, length2 = array2 == null ? 0 : array2.length; - while (++index < length2) { - if (comparator(value, array2[index])) { - return true; - } - } - return false; + function parseLiteralPercent(d2, string3, i2) { + var n2 = percentRe.exec(string3.slice(i2, i2 + 1)); + return n2 ? i2 + n2[0].length : -1; } - function last(array2) { - var length2 = array2 == null ? 0 : array2.length; - return length2 ? array2[length2 - 1] : void 0; + function parseUnixTimestamp(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2)); + return n2 ? (d2.Q = +n2[0], i2 + n2[0].length) : -1; } - function castFunction(value) { - return typeof value == "function" ? value : identity; + function parseUnixTimestampSeconds(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2)); + return n2 ? (d2.s = +n2[0], i2 + n2[0].length) : -1; } - function forEach(collection, iteratee) { - var func = isArray$1(collection) ? arrayEach : baseEach$1; - return func(collection, castFunction(iteratee)); + function formatDayOfMonth(d2, p3) { + return pad2(d2.getDate(), p3, 2); } - function baseFilter(collection, predicate) { - var result = []; - baseEach$1(collection, function(value, index, collection2) { - if (predicate(value, index, collection2)) { - result.push(value); - } - }); - return result; + function formatHour24(d2, p3) { + return pad2(d2.getHours(), p3, 2); } - function filter(collection, predicate) { - var func = isArray$1(collection) ? arrayFilter : baseFilter; - return func(collection, baseIteratee(predicate)); + function formatHour12(d2, p3) { + return pad2(d2.getHours() % 12 || 12, p3, 2); } - 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 index = findIndexFunc(collection, predicate, fromIndex); - return index > -1 ? iterable[iteratee ? collection[index] : index] : void 0; - }; + function formatDayOfYear(d2, p3) { + return pad2(1 + timeDay.count(timeYear(d2), d2), p3, 3); } - var nativeMax$1 = Math.max; - function findIndex(array2, predicate, fromIndex) { - var length2 = array2 == null ? 0 : array2.length; - if (!length2) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax$1(length2 + index, 0); - } - return baseFindIndex(array2, baseIteratee(predicate), index); + function formatMilliseconds(d2, p3) { + return pad2(d2.getMilliseconds(), p3, 3); } - var find = createFind(findIndex); - const find$1 = find; - function baseMap(collection, iteratee) { - var index = -1, result = isArrayLike(collection) ? Array(collection.length) : []; - baseEach$1(collection, function(value, key, collection2) { - result[++index] = iteratee(value, key, collection2); - }); - return result; + function formatMicroseconds(d2, p3) { + return formatMilliseconds(d2, p3) + "000"; } - function map(collection, iteratee) { - var func = isArray$1(collection) ? arrayMap : baseMap; - return func(collection, baseIteratee(iteratee)); + function formatMonthNumber(d2, p3) { + return pad2(d2.getMonth() + 1, p3, 2); } - function forIn(object2, iteratee) { - return object2 == null ? object2 : baseFor$1(object2, castFunction(iteratee), keysIn); + function formatMinutes(d2, p3) { + return pad2(d2.getMinutes(), p3, 2); } - function forOwn(object2, iteratee) { - return object2 && baseForOwn(object2, castFunction(iteratee)); + function formatSeconds(d2, p3) { + return pad2(d2.getSeconds(), p3, 2); } - function baseGt(value, other) { - return value > other; + function formatWeekdayNumberMonday(d2) { + var day = d2.getDay(); + return day === 0 ? 7 : day; } - var objectProto = Object.prototype; - var hasOwnProperty = objectProto.hasOwnProperty; - function baseHas(object2, key) { - return object2 != null && hasOwnProperty.call(object2, key); + function formatWeekNumberSunday(d2, p3) { + return pad2(timeSunday.count(timeYear(d2) - 1, d2), p3, 2); } - function has(object2, path2) { - return object2 != null && hasPath(object2, path2, baseHas); + function dISO(d2) { + var day = d2.getDay(); + return day >= 4 || day === 0 ? timeThursday(d2) : timeThursday.ceil(d2); } - function baseValues(object2, props) { - return arrayMap(props, function(key) { - return object2[key]; - }); + function formatWeekNumberISO(d2, p3) { + d2 = dISO(d2); + return pad2(timeThursday.count(timeYear(d2), d2) + (timeYear(d2).getDay() === 4), p3, 2); } - function values(object2) { - return object2 == null ? [] : baseValues(object2, keys$1(object2)); + function formatWeekdayNumberSunday(d2) { + return d2.getDay(); } - function isUndefined(value) { - return value === void 0; + function formatWeekNumberMonday(d2, p3) { + return pad2(timeMonday.count(timeYear(d2) - 1, d2), p3, 2); } - function baseLt(value, other) { - return value < other; + function formatYear(d2, p3) { + return pad2(d2.getFullYear() % 100, p3, 2); } - function mapValues(object2, iteratee) { - var result = {}; - iteratee = baseIteratee(iteratee); - baseForOwn(object2, function(value, key, object3) { - baseAssignValue(result, key, iteratee(value, key, object3)); - }); - return result; + function formatYearISO(d2, p3) { + d2 = dISO(d2); + return pad2(d2.getFullYear() % 100, p3, 2); } - function baseExtremum(array2, iteratee, comparator) { - var index = -1, length2 = array2.length; - while (++index < length2) { - var value = array2[index], current = iteratee(value); - if (current != null && (computed === void 0 ? current === current && !isSymbol(current) : comparator(current, computed))) { - var computed = current, result = value; - } - } - return result; + function formatFullYear(d2, p3) { + return pad2(d2.getFullYear() % 1e4, p3, 4); } - function max(array2) { - return array2 && array2.length ? baseExtremum(array2, identity, baseGt) : void 0; + 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); } - var merge$1 = createAssigner(function(object2, source, srcIndex) { - baseMerge(object2, source, srcIndex); - }); - const merge$2 = merge$1; - function min(array2) { - return array2 && array2.length ? baseExtremum(array2, identity, baseLt) : void 0; + function formatZone(d2) { + var z2 = d2.getTimezoneOffset(); + return (z2 > 0 ? "-" : (z2 *= -1, "+")) + pad2(z2 / 60 | 0, "0", 2) + pad2(z2 % 60, "0", 2); } - function minBy(array2, iteratee) { - return array2 && array2.length ? baseExtremum(array2, baseIteratee(iteratee), baseLt) : void 0; + function formatUTCDayOfMonth(d2, p3) { + return pad2(d2.getUTCDate(), p3, 2); } - function baseSet(object2, path2, value, customizer) { - if (!isObject(object2)) { - return object2; - } - path2 = castPath(path2, object2); - var index = -1, length2 = path2.length, lastIndex = length2 - 1, nested = object2; - while (nested != null && ++index < length2) { - var key = toKey(path2[index]), newValue = value; - if (key === "__proto__" || key === "constructor" || key === "prototype") { - return object2; - } - if (index != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : void 0; - if (newValue === void 0) { - newValue = isObject(objValue) ? objValue : isIndex(path2[index + 1]) ? [] : {}; - } - } - assignValue(nested, key, newValue); - nested = nested[key]; - } - return object2; + function formatUTCHour24(d2, p3) { + return pad2(d2.getUTCHours(), p3, 2); } - function basePickBy(object2, paths, predicate) { - var index = -1, length2 = paths.length, result = {}; - while (++index < length2) { - var path2 = paths[index], value = baseGet(object2, path2); - if (predicate(value, path2)) { - baseSet(result, castPath(path2, object2), value); - } - } - return result; + function formatUTCHour12(d2, p3) { + return pad2(d2.getUTCHours() % 12 || 12, p3, 2); } - function baseSortBy(array2, comparer) { - var length2 = array2.length; - array2.sort(comparer); - while (length2--) { - array2[length2] = array2[length2].value; - } - return array2; + function formatUTCDayOfYear(d2, p3) { + return pad2(1 + utcDay.count(utcYear(d2), d2), p3, 3); } - function compareAscending(value, other) { - if (value !== other) { - var valIsDefined = value !== void 0, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value); - var othIsDefined = other !== void 0, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other); - if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) { - return 1; - } - if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) { - return -1; - } - } - return 0; + function formatUTCMilliseconds(d2, p3) { + return pad2(d2.getUTCMilliseconds(), p3, 3); } - function compareMultiple(object2, other, orders) { - var index = -1, objCriteria = object2.criteria, othCriteria = other.criteria, length2 = objCriteria.length, ordersLength = orders.length; - while (++index < length2) { - var result = compareAscending(objCriteria[index], othCriteria[index]); - if (result) { - if (index >= ordersLength) { - return result; - } - var order2 = orders[index]; - return result * (order2 == "desc" ? -1 : 1); - } - } - return object2.index - other.index; + function formatUTCMicroseconds(d2, p3) { + return formatUTCMilliseconds(d2, p3) + "000"; } - function baseOrderBy(collection, iteratees, orders) { - if (iteratees.length) { - iteratees = arrayMap(iteratees, function(iteratee) { - if (isArray$1(iteratee)) { - return function(value) { - return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); - }; - } - return iteratee; - }); - } else { - iteratees = [identity]; - } - var index = -1; - iteratees = arrayMap(iteratees, baseUnary(baseIteratee)); - var result = baseMap(collection, function(value, key, collection2) { - var criteria = arrayMap(iteratees, function(iteratee) { - return iteratee(value); - }); - return { "criteria": criteria, "index": ++index, "value": value }; - }); - return baseSortBy(result, function(object2, other) { - return compareMultiple(object2, other, orders); - }); + function formatUTCMonthNumber(d2, p3) { + return pad2(d2.getUTCMonth() + 1, p3, 2); } - function basePick(object2, paths) { - return basePickBy(object2, paths, function(value, path2) { - return hasIn(object2, path2); - }); + function formatUTCMinutes(d2, p3) { + return pad2(d2.getUTCMinutes(), p3, 2); } - 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 index = -1, length2 = nativeMax(nativeCeil((end2 - start2) / (step || 1)), 0), result = Array(length2); - while (length2--) { - result[fromRight ? length2 : ++index] = start2; - start2 += step; - } - return result; + function formatUTCSeconds(d2, p3) { + return pad2(d2.getUTCSeconds(), p3, 2); } - 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); - } - step = step === void 0 ? start2 < end2 ? 1 : -1 : toFinite(step); - return baseRange(start2, end2, step, fromRight); - }; + function formatUTCWeekdayNumberMonday(d2) { + var dow = d2.getUTCDay(); + return dow === 0 ? 7 : dow; } - var range = createRange(); - const range$1 = range; - function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value, index, collection2) { - accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection2); - }); - return accumulator; + function formatUTCWeekNumberSunday(d2, p3) { + return pad2(utcSunday.count(utcYear(d2) - 1, d2), p3, 2); } - 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); + function UTCdISO(d2) { + var day = d2.getUTCDay(); + return day >= 4 || day === 0 ? utcThursday(d2) : utcThursday.ceil(d2); } - var sortBy = baseRest(function(collection, iteratees) { - if (collection == null) { - return []; + 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 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]]; + }); + + // ../../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"); } - 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 index = -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; + + // ../../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(); } - outer: - while (++index < length2) { - var value = array2[index], computed = iteratee ? iteratee(value) : value; - value = comparator || value !== 0 ? value : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } else if (!includes2(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - var union = baseRest(function(arrays) { - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); - const union$1 = union; - var idCounter = 0; - function uniqueId(prefix) { - var id2 = ++idCounter; - return toString(prefix) + id2; + + // ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/time.js + function date(t4) { + return new Date(t4); } - function baseZipObject(props, values2, assignFunc) { - var index = -1, length2 = props.length, valsLength = values2.length, result = {}; - while (++index < length2) { - var value = index < valsLength ? values2[index] : void 0; - assignFunc(result, props[index], value); - } - return result; + function number4(t4) { + return t4 instanceof Date ? +t4 : +/* @__PURE__ */ new Date(+t4); } - 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(void 0); - this._defaultEdgeLabelFn = constant(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; + 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); } - graph() { - return this._label; + __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; + } + 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"); } - /* === Node functions ========== */ - setDefaultNodeLabel(newDefault) { - if (!isFunction(newDefault)) { - newDefault = constant(newDefault); - } - this._defaultNodeLabelFn = newDefault; - return this; + }); + + // ../../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(); } - nodeCount() { - return this._nodeCount; + }); + + // ../../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"); } - nodes() { - return keys$1(this._nodes); + }); + + // ../../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"); } - sources() { - var self2 = this; - return filter(this.nodes(), function(v) { - return isEmpty(self2._in[v]); - }); + }); + + // ../../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(); } - sinks() { - var self2 = this; - return filter(this.nodes(), function(v) { - return isEmpty(self2._out[v]); - }); + }); + + // ../../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"); } - setNodes(vs, value) { - var args = arguments; - var self2 = this; - forEach(vs, function(v) { - if (args.length > 1) { - self2.setNode(v, value); - } else { - self2.setNode(v); - } - }); - return this; + }); + + // ../../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"); } - setNode(v, value) { - if (has(this._nodes, v)) { - if (arguments.length > 1) { - this._nodes[v] = value; - } - return this; + }); + + // ../../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 { + const d2 = Math.floor(_2); + if (!(d2 >= 0)) throw new RangeError(`invalid digits: ${_2}`); + digits = d2; } - this._nodes[v] = arguments.length > 1 ? value : 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); + 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"); } - 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]; + }); + + // ../../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 { + cx: cx0, + cy: cy0, + x01: -ox, + y01: -oy, + x11: cx0 * (r1 / r2 - 1), + y11: cy0 * (r1 / r2 - 1) + }; + } + 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); } - 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; - } - 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"); + 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; + } } } - this.setNode(parent); + 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); } - this.setNode(v); - this._removeFromParentsChildList(v); - this._parent[v] = parent; - this._children[parent][v] = true; - return this; + context.closePath(); + if (buffer) return context = null, buffer + "" || null; } - _removeFromParentsChildList(v) { - delete this._children[this._parent[v]][v]; + __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; + } + 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"); } - parent(v) { - if (this._isCompound) { - var parent = this._parent[v]; - if (parent !== GRAPH_NODE) { - return parent; - } - } + }); + + // ../../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"); } - 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 []; - } + }); + + // ../../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; + } + }, "point") + }; + __name(linear_default, "default"); } - predecessors(v) { - var predsV = this._preds[v]; - if (predsV) { - return keys$1(predsV); - } + }); + + // ../../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"); } - successors(v) { - var sucsV = this._sucs[v]; - if (sucsV) { - return keys$1(sucsV); - } + }); + + // ../../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"); } - neighbors(v) { - var preds = this.predecessors(v); - if (preds) { - return union$1(preds, this.successors(v)); - } + }); + + // ../../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"); } - isLeaf(v) { - var neighbors; - if (this.isDirected()) { - neighbors = this.successors(v); - } else { - neighbors = this.neighbors(v); - } - return neighbors.length === 0; + }); + + // ../../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"); } - 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(value, v) { - if (filter2(v)) { - copy2.setNode(v, value); - } - }); - forEach(this._edgeObjs, function(e) { - if (copy2.hasNode(e.v) && copy2.hasNode(e.w)) { - copy2.setEdge(e, self2.edge(e)); - } + }); + + // ../../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]); }); - 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 (this._isCompound) { - forEach(copy2.nodes(), function(v) { - copy2.setParent(v, findParent(v)); - }); - } - return copy2; - } - /* === Edge functions ========== */ - setDefaultEdgeLabel(newDefault) { - if (!isFunction(newDefault)) { - newDefault = constant(newDefault); - } - this._defaultEdgeLabelFn = newDefault; - return this; - } - edgeCount() { - return this._edgeCount; - } - edges() { - return values(this._edgeObjs); - } - setPath(vs, value) { - var self2 = this; - var args = arguments; - reduce(vs, function(v, w2) { - if (args.length > 1) { - self2.setEdge(v, w2, value); - } else { - self2.setEdge(v, w2); - } - return w2; + else if (sort3 != null) index.sort(function(i3, j3) { + return sort3(data5[i3], data5[j3]); }); - return this; - } - /* - * setEdge(v, w, [value, [name]]) - * setEdge({ v, w, [name] }, [value]) - */ - setEdge() { - var v, w2, name2, value; - var valueSpecified = false; - var arg0 = arguments[0]; - if (typeof arg0 === "object" && arg0 !== null && "v" in arg0) { - v = arg0.v; - w2 = arg0.w; - name2 = arg0.name; - if (arguments.length === 2) { - value = arguments[1]; - valueSpecified = true; - } - } else { - v = arg0; - w2 = arguments[1]; - name2 = arguments[3]; - if (arguments.length > 2) { - value = arguments[2]; - valueSpecified = true; - } - } - v = "" + v; - w2 = "" + w2; - if (!isUndefined(name2)) { - name2 = "" + name2; - } - var e = edgeArgsToId(this._isDirected, v, w2, name2); - if (has(this._edgeLabels, e)) { - if (valueSpecified) { - this._edgeLabels[e] = value; - } - return this; - } - if (!isUndefined(name2) && !this._isMultigraph) { - throw new Error("Cannot set a named edge when isMultigraph = false"); - } - this.setNode(v); - this.setNode(w2); - this._edgeLabels[e] = valueSpecified ? value : this._defaultEdgeLabelFn(v, w2, name2); - var edgeObj = edgeArgsToObj(this._isDirected, v, w2, name2); - 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; - } - edge(v, w2, name2) { - var e = arguments.length === 1 ? edgeObjToId(this._isDirected, arguments[0]) : edgeArgsToId(this._isDirected, v, w2, name2); - return this._edgeLabels[e]; - } - hasEdge(v, w2, name2) { - var e = arguments.length === 1 ? edgeObjToId(this._isDirected, arguments[0]) : edgeArgsToId(this._isDirected, v, w2, name2); - return has(this._edgeLabels, e); - } - removeEdge(v, w2, name2) { - var e = arguments.length === 1 ? edgeObjToId(this._isDirected, arguments[0]) : edgeArgsToId(this._isDirected, v, w2, name2); - 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--; + 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 this; + return arcs; } - inEdges(v, u2) { - var inV = this._in[v]; - if (inV) { - var edges2 = values(inV); - if (!u2) { - return edges2; - } - return filter(edges2, function(edge) { - return edge.v === u2; - }); - } + __name(pie2, "pie"); + pie2.value = function(_2) { + return arguments.length ? (value2 = typeof _2 === "function" ? _2 : constant_default4(+_2), pie2) : value2; + }; + pie2.sortValues = function(_2) { + return arguments.length ? (sortValues = _2, sort3 = null, pie2) : sortValues; + }; + pie2.sort = function(_2) { + return arguments.length ? (sort3 = _2, sortValues = null, pie2) : sort3; + }; + 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"); } - outEdges(v, w2) { - var outV = this._out[v]; - if (outV) { - var edges2 = values(outV); - if (!w2) { - return edges2; + }); + + // ../../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; } - return filter(edges2, function(edge) { - return edge.w === w2; - }); - } - } - nodeEdges(v, w2) { - var inEdges = this.inEdges(v, w2); - if (inEdges) { - return inEdges.concat(this.outEdges(v, w2)); - } + }; + __name(bumpX, "bumpX"); + __name(bumpY, "bumpY"); } + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/noop.js + function noop_default() { } - Graph.prototype._nodeCount = 0; - Graph.prototype._edgeCount = 0; - function incrementOrInitEntry(map2, k) { - if (map2[k]) { - map2[k]++; - } else { - map2[k] = 1; + 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"); } + }); + + // ../../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 + ); } - function decrementOrRemoveEntry(map2, k) { - if (!--map2[k]) { - delete map2[k]; - } + function Basis(context) { + this._context = context; } - function edgeArgsToId(isDirected, v_, w_, name2) { - var v = "" + v_; - var w2 = "" + w_; - if (!isDirected && v > w2) { - var tmp = v; - v = w2; - w2 = tmp; - } - return v + EDGE_KEY_DELIM + w2 + EDGE_KEY_DELIM + (isUndefined(name2) ? DEFAULT_EDGE_NAME : name2); + function basis_default2(context) { + return new Basis(context); } - function edgeArgsToObj(isDirected, v_, w_, name2) { - var v = "" + v_; - var w2 = "" + w_; - if (!isDirected && v > w2) { - var tmp = v; - v = w2; - w2 = tmp; - } - var edgeObj = { v, w: w2 }; - if (name2) { - edgeObj.name = name2; + 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") + }; + __name(basis_default2, "default"); } - return edgeObj; + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/basisClosed.js + function BasisClosed(context) { + this._context = context; } - function edgeObjToId(isDirected, edgeObj) { - return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name); + function basisClosed_default2(context) { + return new BasisClosed(context); } - class 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(", ") + "]"; + 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; } - function unlink(entry) { - entry._prev._next = entry._next; - entry._next._prev = entry._prev; - delete entry._next; - delete entry._prev; + function basisOpen_default(context) { + return new BasisOpen(context); } - function filterOutLinks(k, v) { - if (k !== "_next" && k !== "_prev") { - return v; + 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"); } + }); + + // ../../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 DEFAULT_WEIGHT_FN = constant(1); - function greedyFAS(g, weightFn) { - if (g.nodeCount() <= 1) { - return []; + 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") + }; + bundle_default = (/* @__PURE__ */ __name(function custom(beta) { + function bundle(context) { + return beta === 1 ? new Basis(context) : new Bundle(context, beta); + } + __name(bundle, "bundle"); + bundle.beta = function(beta2) { + return custom(+beta2); + }; + return bundle; + }, "custom"))(0.85); } - 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); - }) + }); + + // ../../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 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; + 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; + } + 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") + }; + cardinal_default = (/* @__PURE__ */ __name(function custom2(tension) { + function cardinal(context) { + return new Cardinal(context, tension); } - } + __name(cardinal, "cardinal"); + cardinal.tension = function(tension2) { + return custom2(+tension2); + }; + return cardinal; + }, "custom"))(0); } - return results; + }); + + // ../../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; } - 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 }); - } - 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); - } - } - 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 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; + } + } + }, "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; + } + 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); } + }); + + // ../../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; } - 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); + 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); } - }); - delete stack[v]; + __name(cardinal, "cardinal"); + cardinal.tension = function(tension2) { + return custom4(+tension2); + }; + return cardinal; + }, "custom"))(0); } - forEach(g.nodes(), dfs2); - return fas; - } - 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); - } - }); - } - function addDummyNode(g, type2, attrs, name2) { - var v; - do { - v = uniqueId(name2); - } 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) - }); - }); - 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"); + }); + + // ../../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; } - 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; + 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; } - 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; - } - function normalizeRanks(g) { - var min$12 = min( - 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 -= min$12; - } - }); + that._context.bezierCurveTo(x1, y1, x22, y22, that._x2, that._y2); } - function removeEmptyRanks(g) { - var offset = min( - 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; - }); - } - }); + function CatmullRom(context, alpha) { + this._context = context; + this._alpha = alpha; } - function addBorderNode$1(g, prefix, rank2, order2) { - var node2 = { - width: 0, - height: 0 - }; - if (arguments.length >= 4) { - node2.rank = rank2; - node2.order = order2; + 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); } - return addDummyNode(g, "border", node2, prefix); + }); + + // ../../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; } - function maxRank(g) { - return max( - map(g.nodes(), function(v) { - var rank2 = g.node(v).rank; - if (!isUndefined(rank2)) { - return rank2; + 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") + }; + catmullRomClosed_default = (/* @__PURE__ */ __name(function custom6(alpha) { + function catmullRom(context) { + return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0); } - }) - ); - } - function partition(collection, fn) { - var result = { lhs: [], rhs: [] }; - forEach(collection, function(value) { - if (fn(value)) { - result.lhs.push(value); - } else { - result.rhs.push(value); - } - }); - return result; - } - function time(name2, fn) { - var start2 = now$1(); - try { - return fn(); - } finally { - console.log(name2 + " time: " + (now$1() - start2) + "ms"); + __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; } - function notime(name2, 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); + 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); } - forEach(g.children(), dfs2); + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/linearClosed.js + function LinearClosed(context) { + this._context = context; } - 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 }); - } + function linearClosed_default(context) { + return new LinearClosed(context); } - function adjust(g) { - var rankDir = g.graph().rankdir.toLowerCase(); - if (rankDir === "lr" || rankDir === "rl") { - swapWidthHeight(g); + 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"); } + }); + + // ../../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 undo$1(g) { - var rankDir = g.graph().rankdir.toLowerCase(); - if (rankDir === "bt" || rankDir === "rl") { - reverseY(g); - } - if (rankDir === "lr" || rankDir === "rl") { - swapXY(g); - swapWidthHeight(g); - } + 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 swapWidthHeight(g) { - forEach(g.nodes(), function(v) { - swapWidthHeightOne(g.node(v)); - }); - forEach(g.edges(), function(e) { - swapWidthHeightOne(g.edge(e)); - }); + function slope2(that, t4) { + var h2 = that._x1 - that._x0; + return h2 ? (3 * (that._y1 - that._y0) / h2 - t4) / 2 : t4; } - function swapWidthHeightOne(attrs) { - var w2 = attrs.width; - attrs.width = attrs.height; - attrs.height = w2; + 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 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); - } - }); + function MonotoneX(context) { + this._context = context; } - function reverseYOne(attrs) { - attrs.y = -attrs.y; + function MonotoneY(context) { + this._context = new ReflectContext(context); } - 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); - } - }); + function ReflectContext(context) { + this._context = context; } - function swapXYOne(attrs) { - var x2 = attrs.x; - attrs.x = attrs.y; - attrs.y = x2; + function monotoneX(context) { + return new MonotoneX(context); } - function run$1(g) { - g.graph().dummyChains = []; - forEach(g.edges(), function(edge) { - normalizeEdge(g, edge); - }); + function monotoneY(context) { + return new MonotoneY(context); } - 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 name2 = 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 + 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") }; - 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; - } - g.setEdge(v, dummy, { weight: edgeLabel.weight }, name2); - if (i2 === 0) { - g.graph().dummyChains.push(dummy); - } - v = dummy; - } - g.setEdge(v, w2, { weight: edgeLabel.weight }, name2); - } - 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; - } - v = w2; - node2 = g.node(v); - } - }); - } - 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( - 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; - } - return label.rank = rank2; + __name(monotoneX, "monotoneX"); + __name(monotoneY, "monotoneY"); } - forEach(g.sources(), dfs2); - } - function slack(g, e) { - return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen; + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/natural.js + function Natural(context) { + this._context = context; } - function feasibleTree(g) { - var t4 = new Graph({ directed: false }); - var start2 = g.nodes()[0]; - var size2 = g.nodeCount(); - t4.setNode(start2, {}); - var edge, delta; - while (tightTree(t4, g) < size2) { - edge = findMinSlackEdge(t4, g); - delta = t4.hasNode(edge.v) ? slack(g, edge) : -slack(g, edge); - shiftRanks(t4, g, delta); - } - return t4; + 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); } - function tightTree(t4, g) { - function dfs2(v) { - forEach(g.nodeEdges(v), function(e) { - var edgeV = e.v, w2 = v === edgeV ? e.w : edgeV; - if (!t4.hasNode(w2) && !slack(g, e)) { - t4.setNode(w2, {}); - t4.setEdge(v, w2, {}); - dfs2(w2); - } - }); + 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"); } - forEach(t4.nodes(), dfs2); - return t4.nodeCount(); - } - function findMinSlackEdge(t4, g) { - return minBy(g.edges(), function(e) { - if (t4.hasNode(e.v) !== t4.hasNode(e.w)) { - return slack(g, e); - } - }); + }); + + // ../../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; } - function shiftRanks(t4, g, delta) { - forEach(t4.nodes(), function(v) { - g.node(v).rank += delta; - }); + function step_default(context) { + return new Step(context, 0.5); } - function CycleException() { + function stepBefore(context) { + return new Step(context, 0); } - CycleException.prototype = new Error(); - function dfs$1(g, vs, order2) { - if (!isArray$1(vs)) { - vs = [vs]; - } - 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); - } - doDfs(g, v, order2 === "post", visited, navigation, acc); - }); - return acc; + function stepAfter(context) { + return new Step(context, 1); } - function doDfs(g, v, postorder2, visited, navigation, acc) { - if (!has(visited, v)) { - visited[v] = true; - if (!postorder2) { - acc.push(v); - } - forEach(navigation(v), function(w2) { - doDfs(g, w2, postorder2, visited, navigation, acc); - }); - if (postorder2) { - acc.push(v); - } + 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"); } - } - 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 t4 = feasibleTree(g); - initLowLimValues(t4); - initCutValues(t4, g); - var e, f2; - while (e = leaveEdge(t4)) { - f2 = enterEdge(t4, g, e); - exchangeEdges(t4, g, e, f2); + }); + + // ../../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(); } - } - function initCutValues(t4, g) { - var vs = postorder$1(t4, t4.nodes()); - vs = vs.slice(0, vs.length - 1); - forEach(vs, function(v) { - assignCutValue(t4, g, v); - }); - } - function assignCutValue(t4, g, child) { - var childLab = t4.node(child); - var parent = childLab.parent; - t4.edge(child, parent).cutvalue = calcCutValue(t4, g, child); - } - function calcCutValue(t4, g, child) { - var childLab = t4.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); + }); + + // ../../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"; } - 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(t4, child, other)) { - var otherCutValue = t4.edge(child, other).cutvalue; - cutValue += pointsToHead ? -otherCutValue : otherCutValue; - } - } - }); - return cutValue; - } - function initLowLimValues(tree, root2) { - if (arguments.length < 2) { - root2 = tree.nodes()[0]; + }); + + // ../../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"; } - dfsAssignLowLim(tree, {}, 1, root2); - } - 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); - } - }); - label.low = low; - label.lim = nextLim++; - if (parent) { - label.parent = parent; - } else { - delete label.parent; + }); + + // ../../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"); } - return nextLim; - } - function leaveEdge(tree) { - return find$1(tree.edges(), function(e) { - return tree.edge(e).cutvalue < 0; - }); - } - function enterEdge(t4, g, edge) { - var v = edge.v; - var w2 = edge.w; - if (!g.hasEdge(v, w2)) { - v = edge.w; - w2 = edge.v; + }); + + // ../../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"; } - var vLabel = t4.node(v); - var wLabel = t4.node(w2); - var tailLabel = vLabel; - var flip = false; - if (vLabel.lim > wLabel.lim) { - tailLabel = wLabel; - flip = 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(); } - var candidates = filter(g.edges(), function(edge2) { - return flip === isDescendant$1(t4, t4.node(edge2.v), tailLabel) && flip !== isDescendant$1(t4, t4.node(edge2.w), tailLabel); - }); - return minBy(candidates, function(edge2) { - return slack(g, edge2); - }); - } - function exchangeEdges(t4, g, e, f2) { - var v = e.v; - var w2 = e.w; - t4.removeEdge(v, w2); - t4.setEdge(f2.v, f2.w, {}); - initLowLimValues(t4); - initCutValues(t4, g); - updateRanks(t4, g); - } - function updateRanks(t4, g) { - var root2 = find$1(t4.nodes(), function(v) { - return !g.node(v).parent; - }); - var vs = preorder(t4, root2); - vs = vs.slice(1); - forEach(vs, function(v) { - var parent = t4.node(v).parent, edge = g.edge(v, parent), flipped = false; - if (!edge) { - edge = g.edge(parent, v); - flipped = true; - } - g.node(v).rank = g.node(parent).rank + (flipped ? edge.minlen : -edge.minlen); - }); - } - function isTreeEdge(tree, u2, v) { - return tree.hasEdge(u2, v); - } - function isDescendant$1(tree, vLabel, rootLabel) { - return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim; - } - function rank(g) { - switch (g.graph().ranker) { - case "network-simplex": - networkSimplexRanker(g); - break; - case "tight-tree": - tightTreeRanker(g); - break; - case "longest-path": - longestPathRanker(g); - break; - default: - networkSimplexRanker(g); + }); + + // ../../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(); } - } - var longestPathRanker = longestPath; - function tightTreeRanker(g) { - longestPath(g); - feasibleTree(g); - } - function networkSimplexRanker(g) { - networkSimplex(g); - } - function run(g) { - var root2 = addDummyNode(g, "root", {}, "_root"); - var depths = treeDepths(g); - var height2 = max(values(depths)) - 1; - var nodeSep = 2 * height2 + 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, height2, depths, child); - }); - g.graph().nodeRankFactor = nodeSep; - } - function dfs(g, root2, nodeSep, weight, height2, depths, v) { - var children2 = g.children(v); - if (!children2.length) { - if (v !== root2) { - g.setEdge(root2, v, { weight: 0, minlen: nodeSep }); - } - return; + }); + + // ../../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(); } - 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, height2, 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 : height2 - 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: height2 + depths[v] }); + }); + + // ../../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"; } - } - 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); + }); + + // ../../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); }); } - depths[v] = depth; - } - forEach(g.children(), function(v) { - dfs2(v, 1); - }); - return depths; - } - function sumWeights(g) { - return reduce( - g.edges(), - function(acc, e) { - return acc + g.edge(e).weight; - }, - 0 - ); - } - 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); + __name(decodeHtmlCharacters, "decodeHtmlCharacters"); + function isValidUrl(url) { + return URL.canParse(url); } - }); - } - 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; + __name(isValidUrl, "isValidUrl"); + function decodeURI(uri) { + try { + return decodeURIComponent(uri); + } catch (e3) { + return uri; } - child = parent; } - }); - } - 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 u2 = e.v === v ? e.w : e.v, edge = result.edge(u2, v), weight = !isUndefined(edge) ? edge.weight : 0; - result.setEdge(u2, v, { weight: g.edge(e).weight + weight }); - }); - if (has(node2, "minRank")) { - result.setNode(v, { - borderLeft: node2.borderLeft[rank2], - borderRight: node2.borderRight[rank2] - }); + __name(decodeURI, "decodeURI"); + function sanitizeUrl6(url) { + if (!url) { + return constants_1.BLANK_URL; + } + 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; } + if (isRelativeUrlWithoutProtocol(sanitizedUrl)) { + return sanitizedUrl; + } + 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; } - }); - 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]); + __name(sanitizeUrl6, "sanitizeUrl"); + exports2.sanitizeUrl = sanitizeUrl6; } - 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 index = entry.pos + firstIndex; - tree[index] += entry.weight; - var weightSum = 0; - while (index > 0) { - if (index % 2) { - weightSum += tree[index + 1]; + }); + + // 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"); + } + }); + + // 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 + ); } - index = index - 1 >> 1; - tree[index] += entry.weight; } - cc += entry.weight * weightSum; - }) - ); - return cc; - } - function initOrder(g) { - var visited = {}; - var simpleNodes = filter(g.nodes(), function(v) { - return !g.children(v).length; - }); - var maxRank2 = max( - map(simpleNodes, function(v) { - return g.node(v).rank; - }) - ); - var layers = map(range$1(maxRank2 + 1), function() { - 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; - } - 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 } + }, "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 + ); + } + 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 + ); + } + }, "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; + } + 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; + } + 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 { - v, - barycenter: result.sum / result.weight, - weight: result.weight + 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 + }; + } + }); + + // ../../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; + } + }); + + // ../../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; + } + }); + + // ../../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; + } + }); + + // ../../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) { + } + var result = nativeObjectToString.call(value2); + if (unmasked) { + if (isOwn) { + value2[symToStringTag] = tag2; + } else { + delete value2[symToStringTag]; } - }); + } + 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 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; + } + }); + + // ../../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; + } + }); + + // ../../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; + } + }); + + // ../../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; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isFunction.js + function isFunction(value2) { + if (!isObject_default(value2)) { + return false; + } + 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; + } + }); + + // ../../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; + } + }); + + // ../../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; + } + }); + + // ../../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) { } - }); - 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]); + try { + return func + ""; + } catch (e3) { } - }); - var sourceSet = filter(mappedEntries, function(entry) { - return !entry.indegree; - }); - return doResolveConflicts(sourceSet); + } + return ""; } - 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 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; } - 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/_baseIsNative.js + function baseIsNative(value2) { + if (!isObject_default(value2) || isMasked_default(value2)) { + return false; } - while (sourceSet.length) { - var entry = sourceSet.pop(); - entries2.push(entry); - forEach(entry["in"].reverse(), handleIn(entry)); - forEach(entry.out, handleOut(entry)); + 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; } - 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/_getValue.js + function getValue(object3, key) { + return object3 == null ? void 0 : object3[key]; } - function mergeEntries(target, source) { - var sum = 0; - var weight = 0; - if (target.weight) { - sum += target.barycenter * target.weight; - weight += target.weight; + 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; } - if (source.weight) { - sum += source.barycenter * source.weight; - weight += source.weight; + }); + + // ../../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; } - target.vs = source.vs.concat(target.vs); - target.barycenter = sum / 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/_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; + } + }); + + // ../../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; } - 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 = [], sum = 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); - sum += entry.barycenter * entry.weight; - weight += entry.weight; - vsIndex = consumeUnsortable(vs, unsortable, vsIndex); - }); - var result = { vs: flatten(vs) }; - if (weight) { - result.barycenter = sum / weight; - result.weight = weight; + 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; } + }); + + // ../../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; } - function consumeUnsortable(vs, unsortable, index) { - var last$1; - while (unsortable.length && (last$1 = last(unsortable)).i <= index) { - unsortable.pop(); - vs.push(last$1.vs); - index++; + 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; } - return index; - } - function compareWithBias(bias) { - return function(entryV, entryW) { - if (entryV.barycenter < entryW.barycenter) { - return -1; - } else if (entryV.barycenter > entryW.barycenter) { - return 1; - } - return !bias ? entryV.i - entryW.i : entryW.i - entryV.i; - }; + }); + + // ../../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; + } + }); + + // ../../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; + } + }); + + // ../../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; } - 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 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; } - 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); - } - } - }); - 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; - } - result.barycenter = (result.barycenter * result.weight + blPred.order + brPred.order) / (result.weight + 2); - result.weight += 2; - } + }); + + // ../../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]); } - 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; - }) - ); - }); + 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; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheClear.js + function listCacheClear() { + this.__data__ = []; + this.size = 0; } - 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 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; } + }); + + // ../../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; } - 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; + 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; + } + }); + + // ../../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; } } - assignOrder(g, best); + return -1; } - function buildLayerGraphs(g, ranks, relationship) { - return map(ranks, function(rank2) { - return buildLayerGraph(g, rank2, relationship); - }); + 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; + } + }); + + // ../../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 lastIndex = data5.length - 1; + if (index == lastIndex) { + data5.pop(); + } else { + splice.call(data5, index, 1); + } + --this.size; + return true; } - 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); - }); + 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; + } + }); + + // ../../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]; } - function assignOrder(g, layering) { - forEach(layering, function(layer) { - forEach(layer, function(v, i2) { - g.node(v).order = i2; - }); - }); + 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; } - 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 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; + } + }); + + // ../../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 { + data5[index][1] = value2; + } + return this; } - 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); + 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; + } + }); + + // ../../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]); } - return { path: vPath.concat(wPath.reverse()), lca }; } - 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 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; + } + }); + + // ../../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; + } + }); + + // ../../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; + } + }); + + // ../../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; + } + }); + + // ../../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; } - forEach(g.children(), dfs2); + }); + + // ../../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; } - 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(u2) { - var uLabel = g.node(u2), uPos = uLabel.order; - if ((uPos < k0 || k1 < uPos) && !(uLabel.dummy && g.node(scanNode).dummy)) { - addConflict(conflicts, u2, scanNode); - } - }); - }); - scanPos = i2 + 1; - k0 = k1; - } - }); - return layer; + 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; } - reduce(layering, visitLayer); - return conflicts; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheGet.js + function mapCacheGet(key) { + return getMapData_default(this, key).get(key); } - 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(u2) { - var uNode = g.node(u2); - if (uNode.dummy && (uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) { - addConflict(conflicts, u2, v); - } - }); - } - }); + 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; } - 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; - } - } - scan(south, southPos, south.length, nextNorthPos, north.length); - }); - return south; + }); + + // ../../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; } - reduce(layering, visitLayer); - return conflicts; + }); + + // ../../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; } - function findOtherInnerSegmentNode(g, v) { - if (g.node(v).dummy) { - return find$1(g.predecessors(v), function(u2) { - return g.node(u2).dummy; - }); + 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; + } + }); + + // ../../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]); } } - function addConflict(conflicts, v, w2) { - if (v > w2) { - var tmp = v; - v = w2; - w2 = tmp; + 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; } - var conflictsV = conflicts[v]; - if (!conflictsV) { - conflicts[v] = conflictsV = {}; + }); + + // ../../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); } - conflictsV[w2] = true; + 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 (memoize.Cache || MapCache_default)(); + return memoized; } - function hasConflict(conflicts, v, w2) { - if (v > w2) { - var tmp = v; - v = w2; - w2 = tmp; + 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; } - return has(conflicts[v], w2); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackClear.js + function stackClear() { + this.__data__ = new ListCache_default(); + this.size = 0; } - 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]; - } - } - } - }); - }); - return { root: root2, align }; + 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; + } + }); + + // ../../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; } - 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 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; } - 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/_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; } - 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/_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; + } + }); + + // ../../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; } + data5 = this.__data__ = new MapCache_default(pairs2); } - iterate(pass1, blockG.predecessors.bind(blockG)); - iterate(pass2, blockG.successors.bind(blockG)); - forEach(align, function(v) { - xs[v] = xs[root2[v]]; - }); - return xs; - } - 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 u2; - forEach(layer, function(v) { - var vRoot = root2[v]; - blockGraph.setNode(vRoot); - if (u2) { - var uRoot = root2[u2], prevMax = blockGraph.edge(uRoot, vRoot); - blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u2), prevMax || 0)); - } - u2 = v; - }); - }); - return blockGraph; - } - 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$1(g, v) / 2; - max2 = Math.max(x2 + halfWidth, max2); - min2 = Math.min(x2 - halfWidth, min2); - }); - return max2 - min2; - }); + data5.set(key, value2); + this.size = data5.size; + return this; } - function alignCoordinates(xss, alignTo) { - var alignToVals = values(alignTo), alignToMin = min(alignToVals), alignToMax = max(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(xsVals) : alignToMax - max(xsVals); - if (delta) { - xss[alignment] = mapValues(xs, function(x2) { - return x2 + delta; - }); + 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; + } + }); + + // ../../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; + } + }); + + // ../../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) { } + }(); + defineProperty_default = defineProperty; + } + }); + + // ../../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 }); - }); - } - 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; - } - }); + } else { + object3[key] = value2; + } } - function positionX(g) { - var layering = buildLayerMatrix(g); - var conflicts = merge$2(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(inner) { - return values(inner).reverse(); - }); - } - 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; - }); - } - xss[vert + horiz] = xs; - }); - }); - var smallestWidth = findSmallestWidthAlignment(g, xss); - alignCoordinates(xss, smallestWidth); - return balance(xss, g.graph().align); + 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; + } + }); + + // ../../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); + } } - function sep(nodeSep, edgeSep, reverseSep) { - return function(g, v, w2) { - var vLabel = g.node(v); - var wLabel = g.node(w2); - var sum = 0; - var delta; - sum += 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; - } - } - if (delta) { - sum += reverseSep ? delta : -delta; - } - delta = 0; - sum += (vLabel.dummy ? edgeSep : nodeSep) / 2; - sum += (wLabel.dummy ? edgeSep : nodeSep) / 2; - sum += wLabel.width / 2; - if (has(wLabel, "labelpos")) { - switch (wLabel.labelpos.toLowerCase()) { - case "l": - delta = wLabel.width / 2; - break; - case "r": - delta = -wLabel.width / 2; - break; + 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; + } + }); + + // ../../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 (delta) { - sum += reverseSep ? delta : -delta; - } - delta = 0; - return sum; + return object3; }; } - function width$1(g, v) { - return g.node(v).width; - } - function position(g) { - g = asNonCompoundGraph(g); - positionY(g); - forOwn(positionX(g), function(x2, v) { - g.node(v).x = x2; - }); - } - function positionY(g) { - var layering = buildLayerMatrix(g); - var rankSep = g.graph().ranksep; - var prevY = 0; - forEach(layering, function(layer) { - var maxHeight = max( - map(layer, function(v) { - return g.node(v).height; - }) - ); - forEach(layer, function(v) { - g.node(v).y = prevY + maxHeight / 2; - }); - prevY += maxHeight + rankSep; - }); - } - function layout(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); - }); - }); - } - 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(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); - }); - time2(" assignNodeIntersects", function() { - assignNodeIntersects(g); - }); - time2(" reversePoints", function() { - reversePointsForReversedEdges(g); - }); - time2(" acyclic.undo", function() { - undo$2(g); - }); - } - 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; - } - 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$2({}, 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$2({}, edgeDefaults, selectNumberAttrs(edge, edgeNumAttrs), pick$1(edge, edgeAttrs)) - ); - }); - return g; - } - 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; - } else { - edge.height += edge.labeloffset; - } - } - }); - } - 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 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(maxRank2, node2.maxRank); - } - }); - 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); - } - }); - } - 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); - } - }); - minX -= marginX; - minY -= marginY; - forEach(g.nodes(), function(v) { - var node2 = g.node(v); - node2.x -= minX; - node2.y -= minY; - }); - 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; - } - if (has(edge, "y")) { - edge.y -= minY; - } - }); - graphLabel.width = maxX - minX + marginX; - graphLabel.height = maxY - minY + marginY; - } - 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 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; - } - } - }); - } - function reversePointsForReversedEdges(g) { - forEach(g.edges(), function(e) { - var edge = g.edge(e); - if (edge.reversed) { - edge.points.reverse(); - } - }); - } - function removeBorderNodes(g) { - forEach(g.nodes(), function(v) { - if (g.children(v).length) { - var node2 = g.node(v); - var t4 = 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 - t4.y); - node2.x = l.x + node2.width / 2; - node2.y = t4.y + node2.height / 2; - } - }); - forEach(g.nodes(), function(v) { - if (g.node(v).dummy === "border") { - g.removeNode(v); - } - }); - } - function removeSelfEdges(g) { - forEach(g.edges(), function(e) { - if (e.v === e.w) { - var node2 = g.node(e.v); - if (!node2.selfEdges) { - node2.selfEdges = []; - } - node2.selfEdges.push({ e, label: g.edge(e) }); - g.removeEdge(e); - } - }); - } - 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 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 selectNumberAttrs(obj, attrs) { - return mapValues(pick$1(obj, attrs), Number); - } - function canonicalize(attrs) { - var newAttrs = {}; - forEach(attrs, function(v, k) { - newAttrs[k.toLowerCase()] = v; - }); - return newAttrs; - } - function isSubgraph(g, v) { - return !!g.children(v).length; - } - function edgeToId(e) { - return escapeId(e.v) + ":" + escapeId(e.w) + ":" + escapeId(e.name); - } - var ID_DELIM = /:/g; - function escapeId(str2) { - return str2 ? String(str2).replace(ID_DELIM, "\\:") : ""; - } - function applyStyle$2(dom, styleFn) { - if (styleFn) { - dom.attr("style", styleFn); + 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; } - } - function applyClass(dom, classFn, otherClasses) { - if (classFn) { - dom.attr("class", classFn).attr("class", otherClasses + " " + dom.attr("class")); + }); + + // ../../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; } - } - function applyTransition(selection2, g) { - var graph = g.graph(); - if (isPlainObject(graph)) { - var transition = graph.transition; - if (isFunction(transition)) { - return transition(selection2); - } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneBuffer.js + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); } - return selection2; - } - var arrows = { - normal, - vee, - undirected - }; - function setArrows(value) { - arrows = value; + var length2 = buffer.length, result = allocUnsafe ? allocUnsafe(length2) : new buffer.constructor(length2); + buffer.copy(result); + return result; } - 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 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; } - } - 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/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; } - 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"]); + 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); } - 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); + 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; } - 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 ch; - for (var i2 = 0; i2 < text2.length; ++i2) { - ch = text2[i2]; - if (escaped) { - switch (ch) { - case "n": - newText += "\n"; - break; - default: - newText += ch; - } - escaped = false; - } else if (ch === "\\") { - escaped = true; - } else { - newText += ch; - } + }); + + // ../../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 newText; + return array4; } - 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); + 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; } - 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/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; } - labelSvg.attr("transform", "translate(" + -labelBBox.width / 2 + "," + y2 + ")"); - return labelSvg; + }); + + // ../../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 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 = select(this); - select(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 = select(this); - applyStyle$2(domCluster, node2.style); - }); - return svgClusters; - }; - function setCreateClusters(value) { - createClusters = value; - } - 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 = select(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; - } - if (!has(edge, "height")) { - edge.height = bbox.height; - } - }); - var exitSelection; - if (svgEdgeLabels.exit) { - exitSelection = svgEdgeLabels.exit(); - } else { - exitSelection = svgEdgeLabels.selectAll(null); + 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; } - applyTransition(exitSelection, g).style("opacity", 0).remove(); - return svgEdgeLabels; - }; - function setCreateEdgeLabels(value) { - createEdgeLabels = value; - } - 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(previousPaths, g); - var svgPaths = previousPaths.merge !== void 0 ? previousPaths.merge(newPaths) : previousPaths; - applyTransition(svgPaths, g).style("opacity", 1); - svgPaths.each(function(e) { - var domEdge = select(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 = select(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(select(this), edge.arrowheadId, edge, "arrowhead"); - }); - return svgPaths; - }; - function setCreateEdgePaths(value) { - createEdgePaths = value; - } - 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(svgPaths, g) { - var svgPathExit = svgPaths.exit(); - applyTransition(svgPathExit, g).style("opacity", 0).remove(); - } - 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 = select(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 = select(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); + }); + + // ../../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; } - applyTransition(exitSelection, g).style("opacity", 0).remove(); - return svgNodes; - }; - function setCreateNodes(value) { - createNodes = value; - } - function positionClusters(selection2, g) { - var created = selection2.filter(function() { - return !select(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; - }); - } - function positionEdgeLabels(selection2, g) { - var created = selection2.filter(function() { - return !select(this).classed("update"); - }); - function translate(e) { - var edge = g.edge(e); - return has(edge, "x") ? "translate(" + edge.x + "," + edge.y + ")" : ""; + }); + + // ../../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; } - created.attr("transform", translate); - applyTransition(selection2, g).style("opacity", 1).attr("transform", translate); - } - function positionNodes$1(selection2, g) { - var created = selection2.filter(function() { - return !select(this).classed("update"); - }); - function translate(v) { - var node2 = g.node(v); - return "translate(" + node2.x + "," + node2.y + ")"; + }); + + // ../../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; } - created.attr("transform", translate); - applyTransition(selection2, g).style("opacity", 1).attr("transform", translate); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js + function isObjectLike(value2) { + return value2 != null && typeof value2 == "object"; } - 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; + 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; } - var dy = Math.abs(rx * ry * py / det); - if (point2.y < cy) { - dy = -dy; + }); + + // ../../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; } - return { x: cx + dx, y: cy + dy }; + }); + + // ../../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; + } + }); + + // ../../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; + } + }); + + // ../../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; + } + }); + + // ../../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; + } + }); + + // ../../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; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubFalse.js + function stubFalse() { + return false; } - function intersectCircle$1(node2, rx, point2) { - return intersectEllipse$1(node2, rx, rx, point2); + 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; + } + }); + + // ../../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; + } + }); + + // ../../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); + }; } - 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; + 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; } - 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)) { + }); + + // ../../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) { + } + }(); + nodeUtil_default = nodeUtil; + } + }); + + // ../../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; + } + }); + + // ../../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; } - denom = a1 * b2 - a2 * b1; - if (denom === 0) { + if (key == "__proto__") { return; } - 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 }; + return object3[key]; } - function sameSign$1(r1, r2) { - return r1 * r2 > 0; - } - 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); - }); - 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); - } - } - if (!intersections.length) { - console.log("NO INTERSECTION FOUND, RETURN NODE CENTER", node2); - return node2; + 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; } - 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; - }); + }); + + // ../../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; } - 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; + }); + + // ../../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]; } - sx = dy === 0 ? 0 : h * dx / dy; - sy = h; - } else { - if (dx < 0) { - w2 = -w2; + if (isNew) { + baseAssignValue_default(object3, key, newValue); + } else { + assignValue_default(object3, key, newValue); } - sx = w2; - sy = dx === 0 ? 0 : w2 * dy / dx; } - return { x: x2 + sx, y: y2 + sy }; + return object3; } - var shapes$2 = { - rect: rect$2, - ellipse, - circle: circle$2, - diamond - }; - function setShapes(value) { - shapes$2 = value; + 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; + } + }); + + // ../../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); + } + return result; } - 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; - } - 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(" ") - ); - 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(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(value) { - if (!arguments.length) - return createNodes; - setCreateNodes(value); - return fn; - }; - fn.createClusters = function(value) { - if (!arguments.length) - return createClusters; - setCreateClusters(value); - return fn; - }; - fn.createEdgeLabels = function(value) { - if (!arguments.length) - return createEdgeLabels; - setCreateEdgeLabels(value); - return fn; - }; - fn.createEdgePaths = function(value) { - if (!arguments.length) - return createEdgePaths; - setCreateEdgePaths(value); - return fn; - }; - fn.shapes = function(value) { - if (!arguments.length) - return shapes$2; - setShapes(value); - return fn; - }; - fn.arrows = function(value) { - if (!arguments.length) - return arrows; - setArrows(value); - 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; - } - }); - g.edges().forEach(function(e) { - var edge = g.edge(e); - if (!has(edge, "label")) { - edge.label = ""; + 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; + } + }); + + // ../../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; + } + }); + + // ../../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); } - defaults$1(edge, EDGE_DEFAULT_ATTRS); - }); + } + return result; } - 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 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); } - delete node2._prevWidth; - delete node2._prevHeight; - }); + } + return result; } - function createOrSelectGroup(root2, name2) { - var selection2 = root2.select("g." + name2); - if (selection2.empty()) { - selection2 = root2.append("g").attr("class", name2); - } - 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 + ")"); + 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); + } + } + return result; } - const flowChartShapes = { - addToRender, - addToRenderV2 - }; - const conf$9 = {}; - const setConf$8 = function(cnf) { - const keys2 = Object.keys(cnf); - for (const key of keys2) { - conf$9[key] = cnf[key]; + 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; } - }; - const addVertices$2 = function(vert, g, svgId, root2, _doc, diagObj) { - const svg2 = !root2 ? select(`[id="${svgId}"]`) : root2.select(`[id="${svgId}"]`); - const doc = !_doc ? document : _doc; - const keys2 = Object.keys(vert); - keys2.forEach(function(id2) { - 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: vertexText.replace( - /fa[blrs]?:fa-[\w-]+/g, - (s) => `` - ) - }; - 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); + }); + + // ../../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 { + newValue = []; } - vertexNode = svgLabel; - } - let radious = 0; - let _shape = ""; - switch (vertex.type) { - case "round": - radious = 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: radious, - ry: radious, - class: classStr, - style: styles2.style, - id: diagObj.db.lookUpDomId(vertex.id) - }); - }); - }; - const addEdges$2 = 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; - } - edges2.forEach(function(edge) { - cnt2++; - var linkId = "L-" + edge.start + "-" + edge.end; - var linkNameStart = "LS-" + edge.start; - var 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; + } 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); } - } - 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$9.curve, curveLinear); + isCommon2 = false; } - if (edge.text === void 0) { - if (edge.style !== void 0) { - edgeData.arrowheadStyle = "fill: #333"; - } + } + 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 { - edgeData.arrowheadStyle = "fill: #333"; - edgeData.labelpos = "c"; - if (evaluate(getConfig$1().flowchart.htmlLabels)) { - edgeData.labelType = "html"; - edgeData.label = `${edge.text.replace( - /fa[blrs]?:fa-[\w-]+/g, - (s) => `` - )}`; - } 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"; - } - edgeData.labelStyle = edgeData.labelStyle.replace("color:", "fill:"); + 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); } - 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); - }); - }; - const getClasses$5 = function(text2, diagObj) { - log$1.info("Extracting classes"); - diagObj.db.clear(); - try { - diagObj.parse(text2); - return diagObj.db.getClasses(); - } catch (e) { - log$1.error(e); - return {}; + }, 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; } - }; - const draw$g = function(text2, id2, _version, diagObj) { - log$1.info("Drawing flowchart"); - diagObj.db.clear(); - const { securityLevel, flowchart: conf2 } = getConfig$1(); - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); - const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; - try { - diagObj.parser.parse(text2); - } catch (err) { - log$1.debug("Parsing failed"); + }); + + // ../../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; } - let dir = diagObj.db.getDirection(); - if (dir === void 0) { - dir = "TD"; + }); + + // ../../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]); } - const nodeSpacing = conf2.nodeSpacing || 50; - const rankSpacing = conf2.rankSpacing || 50; - const g = new Graph({ - multigraph: true, - compound: true - }).setGraph({ - rankdir: dir, - nodesep: nodeSpacing, - ranksep: rankSpacing, - marginx: 8, - marginy: 8 - }).setDefaultEdgeLabel(function() { - return {}; - }); - 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)); - } + return func.apply(thisArg, args); + } + 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; } - addVertices$2(vert, g, id2, root2, doc, diagObj); - 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"]); + }); + + // ../../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]; + } + index = -1; + var otherArgs = Array(start3 + 1); + while (++index < start3) { + otherArgs[index] = args[index]; + } + otherArgs[start3] = transform8(array4); + return apply_default(func, this, otherArgs); }; - 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"); + } + 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; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/constant.js + function constant(value2) { + return function() { + return value2; }; - const svg2 = root2.select(`[id="${id2}"]`); - const element = root2.select("#" + id2 + " g"); - render2(element, g); - element.selectAll("g.node").attr("title", function() { - return diagObj.db.getTooltip(this.id); - }); - 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 = select(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 link = doc.createElementNS("http://www.w3.org/2000/svg", "a"); - link.setAttributeNS("http://www.w3.org/2000/svg", "class", vertex.classes.join(" ")); - link.setAttributeNS("http://www.w3.org/2000/svg", "href", vertex.link); - link.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"); - if (securityLevel === "sandbox") { - link.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top"); - } else if (vertex.linkTarget) { - link.setAttributeNS("http://www.w3.org/2000/svg", "target", vertex.linkTarget); - } - const linkNode = node2.insert(function() { - return link; - }, ":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(); - }); - } + } + 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; } - }); - }; - const flowRenderer = { - setConf: setConf$8, - addVertices: addVertices$2, - addEdges: addEdges$2, - getClasses: getClasses$5, - draw: draw$g - }; - function write(g) { - var json2 = { - options: { - directed: g.isDirected(), - multigraph: g.isMultigraph(), - compound: g.isCompound() - }, - nodes: writeNodes(g), - edges: writeEdges(g) + return func.apply(void 0, arguments); }; - if (!isUndefined(g.graph())) { - json2.value = clone$1(g.graph()); + } + 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; + } + }); + + // ../../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; + } + }); + + // ../../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; + } + }); + + // ../../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; } - return json2; + 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; } - 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; + 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; } - if (!isUndefined(parent)) { - node2.parent = parent; + object3 = Object(object3); + while (++index < length2) { + var source = sources[index]; + if (source) { + assigner(object3, source, index, customizer); + } } - return node2; + return object3; }); } - 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; - } - if (!isUndefined(edgeValue)) { - edge.value = edgeValue; - } - return edge; - }); + 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_merge4 = __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; } - const insertMarkers$3 = (elem, markerArray, type2, id2) => { - markerArray.forEach((markerName) => { - markers$1[markerName](elem, type2, id2); - }); - }; - const extension = (elem, type2, id2) => { - log$1.trace("Making markers for ", id2); - elem.append("defs").append("marker").attr("id", type2 + "-extensionStart").attr("class", "marker extension " + type2).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", type2 + "-extensionEnd").attr("class", "marker extension " + type2).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"); - }; - const composition = (elem, type2) => { - elem.append("defs").append("marker").attr("id", type2 + "-compositionStart").attr("class", "marker composition " + type2).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", type2 + "-compositionEnd").attr("class", "marker composition " + type2).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"); - }; - const aggregation = (elem, type2) => { - elem.append("defs").append("marker").attr("id", type2 + "-aggregationStart").attr("class", "marker aggregation " + type2).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", type2 + "-aggregationEnd").attr("class", "marker aggregation " + type2).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"); - }; - const dependency = (elem, type2) => { - elem.append("defs").append("marker").attr("id", type2 + "-dependencyStart").attr("class", "marker dependency " + type2).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", type2 + "-dependencyEnd").attr("class", "marker dependency " + type2).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 lollipop = (elem, type2) => { - elem.append("defs").append("marker").attr("id", type2 + "-lollipopStart").attr("class", "marker lollipop " + type2).attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "white").attr("cx", 6).attr("cy", 7).attr("r", 6); - }; - const point = (elem, type2) => { - elem.append("marker").attr("id", type2 + "-pointEnd").attr("class", "marker " + type2).attr("viewBox", "0 0 10 10").attr("refX", 10).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", type2 + "-pointStart").attr("class", "marker " + type2).attr("viewBox", "0 0 10 10").attr("refX", 0).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) => { - elem.append("marker").attr("id", 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", 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) => { - elem.append("marker").attr("id", 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", 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) => { - elem.append("defs").append("marker").attr("id", 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, - composition, - aggregation, - dependency, - lollipop, - point, - circle: circle$1, - cross, - barb - }; - const insertMarkers$4 = insertMarkers$3; - function applyStyle$1(dom, styleFn) { - if (styleFn) { - dom.attr("style", styleFn); + 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 addHtmlLabel(node2) { - const fo = select(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(); + 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); } - 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.info("vertexText" + vertexText); - const node2 = { - isNode, - label: decodeEntities(vertexText).replace( - /fa[blrs]?:fa-[\w-]+/g, - (s) => `` - ), - labelStyle: style.replace("fill:", "color:") - }; - let vertexNode = addHtmlLabel(node2); - return vertexNode; + 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 { - 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"); + 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 { - tspan.setAttribute("class", "row"); + style3 = style3 + element3 + ";"; } - tspan.textContent = row.trim(); - svgLabel.appendChild(tspan); } - return svgLabel; } - }; - const createLabel$1 = createLabel; - var CR_NEWLINE_R = /\r\n?/g; - var TAB_R = /\t/g; - var FORMFEED_R = /\f/g; - var preprocess = function preprocess2(source) { - return source.replace(CR_NEWLINE_R, "\n").replace(FORMFEED_R, "").replace(TAB_R, " "); - }; - var populateInitialState = function populateInitialState2(givenState, defaultState) { - var state2 = givenState || {}; - if (defaultState != null) { - for (var prop in defaultState) { - if (Object.prototype.hasOwnProperty.call(defaultState, prop)) { - state2[prop] = defaultState[prop]; - } - } + 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 state2; - }; - var parserFor = function parserFor2(rules, defaultState) { - var ruleList = Object.keys(rules).filter(function(type2) { - var rule = rules[type2]; - if (rule == null || rule.match == null) { - return false; - } - var order2 = rule.order; - if ((typeof order2 !== "number" || !isFinite(order2)) && typeof console !== "undefined") { - console.warn("simple-markdown: Invalid order for rule `" + type2 + "`: " + String(order2)); - } - return true; - }); - ruleList.sort(function(typeA, typeB) { - var ruleA = rules[typeA]; - var ruleB = rules[typeB]; - var orderA = ruleA.order; - var orderB = ruleB.order; - if (orderA !== orderB) { - return orderA - orderB; - } - var secondaryOrderA = ruleA.quality ? 0 : 1; - var secondaryOrderB = ruleB.quality ? 0 : 1; - if (secondaryOrderA !== secondaryOrderB) { - return secondaryOrderA - secondaryOrderB; - } else if (typeA < typeB) { - return -1; - } else if (typeA > typeB) { - return 1; - } else { - return 0; - } - }); - var latestState; - var nestedParse = function nestedParse2(source, state2) { - var result = []; - state2 = state2 || latestState; - latestState = state2; - while (source) { - var ruleType = null; - var rule = null; - var capture = null; - var quality = NaN; - var i2 = 0; - var currRuleType = ruleList[0]; - var currRule = rules[currRuleType]; - do { - var currOrder2 = currRule.order; - var prevCaptureStr = state2.prevCapture == null ? "" : state2.prevCapture[0]; - var currCapture = currRule.match(source, state2, prevCaptureStr); - if (currCapture) { - var currQuality = currRule.quality ? currRule.quality(currCapture, state2, prevCaptureStr) : 0; - if (!(currQuality <= quality)) { - ruleType = currRuleType; - rule = currRule; - capture = currCapture; - quality = currQuality; - } - } - i2++; - currRuleType = ruleList[i2]; - currRule = rules[currRuleType]; - } while ( - // keep looping while we're still within the ruleList - currRule && // if we don't have a match yet, continue - (!capture || // or if we have a match, but the next rule is - // at the same order, and has a quality measurement - // functions, then this rule must have a quality - // measurement function (since they are sorted before - // those without), and we need to check if there is - // a better quality match - currRule.order === currOrder2 && currRule.quality) - ); - if (rule == null || capture == null) { - throw new Error("Could not find a matching rule for the below content. The rule with highest `order` should always match content provided to it. Check the definition of `match` for '" + ruleList[ruleList.length - 1] + "'. It seems to not match the following source:\n" + source); + 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_merge4(); + 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 { + results = inits.args; } - if (capture.index) { - throw new Error("`match` must return a capture starting at index 0 (the current parse index). Did you forget a ^ at the start of the RegExp?"); + if (!results) { + return; } - var parsed = rule.parse(capture, nestedParse2, state2); - if (Array.isArray(parsed)) { - Array.prototype.push.apply(result, parsed); - } else { - if (parsed == null || typeof parsed !== "object") { - throw new Error(`parse() function returned invalid parse result: '${parsed}'`); - } - if (parsed.type == null) { - parsed.type = ruleType; + let type3 = detectType(text2, config6); + const prop = "config"; + if (results[prop] !== void 0) { + if (type3 === "flowchart-v2") { + type3 = "flowchart"; } - result.push(parsed); + results[type3] = results[prop]; + delete results[prop]; } - state2.prevCapture = capture; - source = source.substring(state2.prevCapture[0].length); - } - return result; - }; - var outerParse = function outerParse2(source, state2) { - latestState = populateInitialState(state2, defaultState); - if (!latestState.inline && !latestState.disableAutoBlockNewlines) { - source = source + "\n\n"; - } - latestState.prevCapture = null; - return nestedParse(preprocess(source), latestState); - }; - return outerParse; - }; - var inlineRegex = function inlineRegex2(regex) { - var match = function match5(source, state2, prevCapture) { - if (state2.inline) { - return regex.exec(source); - } else { - return null; - } - }; - match.regex = regex; - return match; - }; - var blockRegex = function blockRegex2(regex) { - var match = function match5(source, state2) { - if (state2.inline) { - return null; - } else { - return regex.exec(source); - } - }; - match.regex = regex; - return match; - }; - var anyScopeRegex = function anyScopeRegex2(regex) { - var match = function match5(source, state2) { - return regex.exec(source); - }; - match.regex = regex; - return match; - }; - var TYPE_SYMBOL = typeof Symbol === "function" && Symbol.for && Symbol.for("react.element") || 60103; - var reactElement = function reactElement2(type2, key, props) { - var element = { - $$typeof: TYPE_SYMBOL, - type: type2, - key: key == null ? void 0 : key, - ref: null, - props, - _owner: null - }; - return element; - }; - var htmlTag = function htmlTag2(tagName, content, attributes, isClosed) { - attributes = attributes || {}; - isClosed = typeof isClosed !== "undefined" ? isClosed : true; - var attributeString = ""; - for (var attr in attributes) { - var attribute = attributes[attr]; - if (Object.prototype.hasOwnProperty.call(attributes, attr) && attribute) { - attributeString += " " + sanitizeText$3(attr) + '="' + sanitizeText$3(attribute) + '"'; - } - } - var unclosedTag = "<" + tagName + attributeString + ">"; - if (isClosed) { - return unclosedTag + content + ""; - } else { - return unclosedTag; - } - }; - var EMPTY_PROPS = {}; - var sanitizeUrl = function sanitizeUrl2(url) { - if (url == null) { - return null; - } - try { - var prot = new URL(url, "https://localhost").protocol; - if (prot.indexOf("javascript:") === 0 || prot.indexOf("vbscript:") === 0 || prot.indexOf("data:") === 0) { - return null; - } - } catch (e) { - return null; - } - return url; - }; - var SANITIZE_TEXT_R = /[<>&"']/g; - var SANITIZE_TEXT_CODES = { - "<": "<", - ">": ">", - "&": "&", - '"': """, - "'": "'", - "/": "/", - "`": "`" - }; - var sanitizeText$3 = function sanitizeText2(text2) { - return String(text2).replace(SANITIZE_TEXT_R, function(chr) { - return SANITIZE_TEXT_CODES[chr]; - }); - }; - var UNESCAPE_URL_R = /\\([^0-9A-Za-z\s])/g; - var unescapeUrl = function unescapeUrl2(rawUrlString) { - return rawUrlString.replace(UNESCAPE_URL_R, "$1"); - }; - var parseInline = function parseInline2(parse2, content, state2) { - var isCurrentlyInline = state2.inline || false; - state2.inline = true; - var result = parse2(content, state2); - state2.inline = isCurrentlyInline; - return result; - }; - var parseBlock = function parseBlock2(parse2, content, state2) { - var isCurrentlyInline = state2.inline || false; - state2.inline = false; - var result = parse2(content + "\n\n", state2); - state2.inline = isCurrentlyInline; - return result; - }; - var parseCaptureInline = function parseCaptureInline2(capture, parse2, state2) { - return { - content: parseInline(parse2, capture[1], state2) - }; - }; - var ignoreCapture = function ignoreCapture2() { - return {}; - }; - var LIST_BULLET = "(?:[*+-]|\\d+\\.)"; - var LIST_ITEM_PREFIX = "( *)(" + LIST_BULLET + ") +"; - var LIST_ITEM_PREFIX_R = new RegExp("^" + LIST_ITEM_PREFIX); - var LIST_ITEM_R = new RegExp(LIST_ITEM_PREFIX + "[^\\n]*(?:\\n(?!\\1" + LIST_BULLET + " )[^\\n]*)*(\n|$)", "gm"); - var BLOCK_END_R = /\n{2,}$/; - var INLINE_CODE_ESCAPE_BACKTICKS_R = /^ (?= *`)|(` *) $/g; - var LIST_BLOCK_END_R = BLOCK_END_R; - var LIST_ITEM_END_R = / *\n+$/; - var LIST_R = new RegExp("^( *)(" + LIST_BULLET + ") [\\s\\S]+?(?:\n{2,}(?! )(?!\\1" + LIST_BULLET + " )\\n*|\\s*\n*$)"); - var LIST_LOOKBEHIND_R = /(?:^|\n)( *)$/; - var TABLES = function() { - var TABLE_ROW_SEPARATOR_TRIM = /^ *\| *| *\| *$/g; - var TABLE_CELL_END_TRIM = / *$/; - var TABLE_RIGHT_ALIGN = /^ *-+: *$/; - var TABLE_CENTER_ALIGN = /^ *:-+: *$/; - var TABLE_LEFT_ALIGN = /^ *:-+ *$/; - var parseTableAlignCapture = function parseTableAlignCapture2(alignCapture) { - if (TABLE_RIGHT_ALIGN.test(alignCapture)) { - return "right"; - } else if (TABLE_CENTER_ALIGN.test(alignCapture)) { - return "center"; - } else if (TABLE_LEFT_ALIGN.test(alignCapture)) { - return "left"; - } else { - return null; - } - }; - var parseTableAlign = function parseTableAlign2(source, parse2, state2, trimEndSeparators) { - if (trimEndSeparators) { - source = source.replace(TABLE_ROW_SEPARATOR_TRIM, ""); - } - var alignText = source.trim().split("|"); - return alignText.map(parseTableAlignCapture); - }; - var parseTableRow = function parseTableRow2(source, parse2, state2, trimEndSeparators) { - var prevInTable = state2.inTable; - state2.inTable = true; - var tableRow = parse2(source.trim(), state2); - state2.inTable = prevInTable; - var cells = [[]]; - tableRow.forEach(function(node2, i2) { - if (node2.type === "tableSeparator") { - if (!trimEndSeparators || i2 !== 0 && i2 !== tableRow.length - 1) { - cells.push([]); + 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++; + } + 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 }); + } } - } else { - if (node2.type === "text" && (tableRow[i2 + 1] == null || tableRow[i2 + 1].type === "tableSeparator")) { - node2.content = node2.content.replace(TABLE_CELL_END_TRIM, ""); + if (result.length === 0) { + return { type: text2, args: null }; } - cells[cells.length - 1].push(node2); + 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 }; } - }); - return cells; - }; - var parseTableCells = function parseTableCells2(source, parse2, state2, trimEndSeparators) { - var rowsText = source.trim().split("\n"); - return rowsText.map(function(rowText) { - return parseTableRow(rowText, parse2, state2, trimEndSeparators); - }); - }; - var parseTable = function parseTable2(trimEndSeparators) { - return function(capture, parse2, state2) { - state2.inline = true; - var header = parseTableRow(capture[1], parse2, state2, trimEndSeparators); - var align = parseTableAlign(capture[2], parse2, state2, trimEndSeparators); - var cells = parseTableCells(capture[3], parse2, state2, trimEndSeparators); - state2.inline = false; - return { - type: "table", - header, - align, - cells - }; - }; - }; - return { - parseTable: parseTable(true), - parseNpTable: parseTable(false), - TABLE_REGEX: /^ *(\|.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/, - NPTABLE_REGEX: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/ - }; - }(); - var LINK_INSIDE = "(?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*"; - var LINK_HREF_AND_TITLE = `\\s*?(?:\\s+['"]([\\s\\S]*?)['"])?\\s*`; - var AUTOLINK_MAILTO_CHECK_R = /mailto:/i; - var parseRef = function parseRef2(capture, state2, refNode) { - var ref = (capture[2] || capture[1]).replace(/\s+/g, " ").toLowerCase(); - if (state2._defs && state2._defs[ref]) { - var def = state2._defs[ref]; - refNode.target = def.target; - refNode.title = def.title; - } - state2._refs = state2._refs || {}; - state2._refs[ref] = state2._refs[ref] || []; - state2._refs[ref].push(refNode); - return refNode; - }; - var currOrder = 0; - var defaultRules = { - Array: { - react: function(arr, output, state2) { - var oldKey = state2.key; - var result = []; - for (var i2 = 0, key = 0; i2 < arr.length; i2++, key++) { - state2.key = "" + i2; - var node2 = arr[i2]; - if (node2.type === "text") { - node2 = { - type: "text", - content: node2.content - }; - for (; i2 + 1 < arr.length && arr[i2 + 1].type === "text"; i2++) { - node2.content += arr[i2 + 1].content; - } + }, "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; } - result.push(output(node2, state2)); } - state2.key = oldKey; - return result; - }, - html: function(arr, output, state2) { - var result = ""; - for (var i2 = 0; i2 < arr.length; i2++) { - var node2 = arr[i2]; - if (node2.type === "text") { - node2 = { - type: "text", - content: node2.content - }; - for (; i2 + 1 < arr.length && arr[i2 + 1].type === "text"; i2++) { - node2.content += arr[i2 + 1].content; - } + 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; } - result += output(node2, state2); } - return result; - } - }, - heading: { - order: currOrder++, - match: blockRegex(/^ *(#{1,6})([^\n]+?)#* *(?:\n *)+\n/), - parse: function(capture, parse2, state2) { + 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; + } + if (distanceRatio >= 1) { + return { x: point8.x, y: point8.y }; + } + 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 { - level: capture[1].length, - content: parseInline(parse2, capture[2].trim(), state2) + 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: "" }; - }, - react: function(node2, output, state2) { - return reactElement("h" + node2.level, state2.key, { - children: output(node2.content, state2) + }, "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); + } + 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); }); - }, - html: function(node2, output, state2) { - return htmlTag("h" + node2.level, output(node2.content, state2)); - } - }, - nptable: { - order: currOrder++, - match: blockRegex(TABLES.NPTABLE_REGEX), - parse: TABLES.parseNpTable, - react: null, - html: null - }, - lheading: { - order: currOrder++, - match: blockRegex(/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/), - parse: function(capture, parse2, state2) { - return { - type: "heading", - level: capture[2] === "=" ? 1 : 2, - content: parseInline(parse2, capture[1], state2) - }; - }, - react: null, - html: null - }, - hr: { - order: currOrder++, - match: blockRegex(/^( *[-*_]){3,} *(?:\n *)+\n/), - parse: ignoreCapture, - react: function(node2, output, state2) { - return reactElement("hr", state2.key, EMPTY_PROPS); - }, - html: function(node2, output, state2) { - return "
"; - } - }, - codeBlock: { - order: currOrder++, - match: blockRegex(/^(?: [^\n]+\n*)+(?:\n *)+\n/), - parse: function(capture, parse2, state2) { - var content = capture[0].replace(/^ /gm, "").replace(/\n+$/, ""); - return { - lang: void 0, - content - }; - }, - react: function(node2, output, state2) { - var className = node2.lang ? "markdown-code-" + node2.lang : void 0; - return reactElement("pre", state2.key, { - children: reactElement("code", null, { - className, - children: node2.content - }) + txt = txt.replace(/classDef.*:\S*#.*;/g, function(s2) { + return s2.substring(0, s2.length - 1); }); - }, - html: function(node2, output, state2) { - var className = node2.lang ? "markdown-code-" + node2.lang : void 0; - var codeBlock = htmlTag("code", sanitizeText$3(node2.content), { - class: className + 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 { + return "\uFB02\xB0" + innerTxt + "\xB6\xDF"; + } }); - return htmlTag("pre", codeBlock); - } - }, - fence: { - order: currOrder++, - match: blockRegex(/^ *(`{3,}|~{3,}) *(?:(\S+) *)?\n([\s\S]+?)\n?\1 *(?:\n *)+\n/), - parse: function(capture, parse2, state2) { - return { - type: "codeBlock", - lang: capture[2] || void 0, - content: capture[3] - }; - }, - react: null, - html: null - }, - blockQuote: { - order: currOrder++, - match: blockRegex(/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/), - parse: function(capture, parse2, state2) { - var content = capture[0].replace(/^ *> ?/gm, ""); - return { - content: parse2(content, state2) - }; - }, - react: function(node2, output, state2) { - return reactElement("blockquote", state2.key, { - children: output(node2.content, state2) - }); - }, - html: function(node2, output, state2) { - return htmlTag("blockquote", output(node2.content, state2)); - } - }, - list: { - order: currOrder++, - match: function(source, state2) { - var prevCaptureStr = state2.prevCapture == null ? "" : state2.prevCapture[0]; - var isStartOfLineCapture = LIST_LOOKBEHIND_R.exec(prevCaptureStr); - var isListBlock = state2._list || !state2.inline; - if (isStartOfLineCapture && isListBlock) { - source = isStartOfLineCapture[1] + source; - return LIST_R.exec(source); - } else { - return null; + 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: counter2 = 0, + prefix, + suffix + }) => { + return `${prefix ? `${prefix}_` : ""}${from2}_${to}_${counter2}${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; } - }, - parse: function(capture, parse2, state2) { - var bullet = capture[2]; - var ordered = bullet.length > 1; - var start2 = ordered ? +bullet : void 0; - var items = capture[0].replace(LIST_BLOCK_END_R, "\n").match(LIST_ITEM_R); - var lastItemWasAParagraph = false; - var itemContent = items.map(function(item, i2) { - var prefixCapture = LIST_ITEM_PREFIX_R.exec(item); - var space = prefixCapture ? prefixCapture[0].length : 0; - var spaceRegex = new RegExp("^ {1," + space + "}", "gm"); - var content = item.replace(spaceRegex, "").replace(LIST_ITEM_PREFIX_R, ""); - var isLastItem = i2 === items.length - 1; - var containsBlocks = content.indexOf("\n\n") !== -1; - var thisItemIsAParagraph = containsBlocks || isLastItem && lastItemWasAParagraph; - lastItemWasAParagraph = thisItemIsAParagraph; - var oldStateInline = state2.inline; - var oldStateList = state2._list; - state2._list = true; - var adjustedContent; - if (thisItemIsAParagraph) { - state2.inline = false; - adjustedContent = content.replace(LIST_ITEM_END_R, "\n\n"); + } + } + } + function drawInsideBoundary(diagram24, 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, + diagram24, + currentPersonOrSystemArray, + currentPersonOrSystemKeys + ); + } + parentBoundaryAlias = currentBoundary.alias; + let nextCurrentBoundaries = diagObj.db.getBoundarys(parentBoundaryAlias); + if (nextCurrentBoundaries.length > 0) { + drawInsideBoundary( + diagram24, + parentBoundaryAlias, + currentBounds, + nextCurrentBoundaries, + diagObj + ); + } + if (currentBoundary.alias !== "global") { + drawBoundary2(diagram24, 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 { - state2.inline = true; - adjustedContent = content.replace(LIST_ITEM_END_R, ""); - } - var result = parse2(adjustedContent, state2); - state2.inline = oldStateInline; - state2._list = oldStateList; - return result; - }); + 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 + }; + 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 { - ordered, - start: start2, - items: itemContent - }; - }, - react: function(node2, output, state2) { - var ListWrapper = node2.ordered ? "ol" : "ul"; - return reactElement(ListWrapper, state2.key, { - start: node2.start, - children: node2.items.map(function(item, i2) { - return reactElement("li", "" + i2, { - children: output(item, state2) - }); - }) - }); - }, - html: function(node2, output, state2) { - var listItems = node2.items.map(function(item) { - return htmlTag("li", output(item, state2)); - }).join(""); - var listTag = node2.ordered ? "ol" : "ul"; - var attributes = { - start: node2.start + fontFamily: cnf[typeC4Shape + "FontFamily"], + fontSize: cnf[typeC4Shape + "FontSize"], + fontWeight: cnf[typeC4Shape + "FontWeight"] }; - return htmlTag(listTag, listItems, attributes); - } - }, - def: { - order: currOrder++, - // TODO(aria): This will match without a blank line before the next - // block element, which is inconsistent with most of the rest of - // simple-markdown. - match: blockRegex(/^ *\[([^\]]+)\]: *]*)>?(?: +["(]([^\n]+)[")])? *\n(?: *\n)*/), - parse: function(capture, parse2, state2) { - var def = capture[1].replace(/\s+/g, " ").toLowerCase(); - var target = capture[2]; - var title2 = capture[3]; - if (state2._refs && state2._refs[def]) { - state2._refs[def].forEach(function(refNode) { - refNode.target = target; - refNode.title = title2; - }); - } - state2._defs = state2._defs || {}; - state2._defs[def] = { - target, - title: title2 + }, "c4ShapeFont"); + boundaryFont = /* @__PURE__ */ __name((cnf) => { + return { + fontFamily: cnf.boundaryFontFamily, + fontSize: cnf.boundaryFontSize, + fontWeight: cnf.boundaryFontWeight }; + }, "boundaryFont"); + messageFont = /* @__PURE__ */ __name((cnf) => { return { - def, - target, - title: title2 + fontFamily: cnf.messageFontFamily, + fontSize: cnf.messageFontSize, + fontWeight: cnf.messageFontWeight }; - }, - react: function() { - return null; - }, - html: function() { - return ""; - } - }, - table: { - order: currOrder++, - match: blockRegex(TABLES.TABLE_REGEX), - parse: TABLES.parseTable, - react: function(node2, output, state2) { - var getStyle = function getStyle2(colIndex) { - return node2.align[colIndex] == null ? {} : { - textAlign: node2.align[colIndex] + }, "messageFont"); + __name(calcC4ShapeTextWH, "calcC4ShapeTextWH"); + drawBoundary2 = /* @__PURE__ */ __name(function(diagram24, 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(diagram24, boundary, conf); + }, "drawBoundary"); + drawC4ShapeArray = /* @__PURE__ */ __name(function(currentBounds, diagram24, 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; + } + 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(diagram24, 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 { + 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 { + returnPoint = new Point2(fromCenterX + fromNode.height / 2 * dx / dy, y1); + } + } 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(diagram24, 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(diagram24, rels2, conf); + }, "drawRels"); + __name(drawInsideBoundary, "drawInsideBoundary"); + draw = /* @__PURE__ */ __name(function(_text, id27, _version, diagObj) { + conf = getConfig2().c4; + const securityLevel = getConfig2().securityLevel; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id27); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + let db8 = diagObj.db; + diagObj.db.setWrap(conf.wrap); + c4ShapeInRow2 = db8.getC4ShapeInRow(); + c4BoundaryInRow2 = db8.getC4BoundaryInRow(); + log.debug(`C:${JSON.stringify(conf, null, 2)}`); + const diagram24 = securityLevel === "sandbox" ? root4.select(`[id="${id27}"]`) : select_default2(`[id="${id27}"]`); + svgDraw_default.insertComputerIcon(diagram24); + svgDraw_default.insertDatabaseIcon(diagram24); + svgDraw_default.insertClockIcon(diagram24); + 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(diagram24, "", screenBounds, currentBoundaries, diagObj); + svgDraw_default.insertArrowHead(diagram24); + svgDraw_default.insertArrowEnd(diagram24); + svgDraw_default.insertArrowCrossHead(diagram24); + svgDraw_default.insertArrowFilledHead(diagram24); + drawRels2(diagram24, 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) { + diagram24.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 4 * conf.diagramMarginX).attr("y", box.starty + conf.diagramMarginY); + } + configureSvgSize(diagram24, height2, width3, conf.useMaxWidth); + const extraVertForTitle = title2 ? 60 : 0; + diagram24.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(id27) { + for (const vertex of vertices.values()) { + if (vertex.id === id27) { + return vertex.domId; + } + } + return id27; + }, "lookUpDomId"); + addVertex = /* @__PURE__ */ __name(function(id27, textObj, type3, style3, classes6, dir2, props = {}) { + if (!id27 || id27.trim().length === 0) { + return; + } + let txt; + let vertex = vertices.get(id27); + if (vertex === void 0) { + vertex = { + id: id27, + labelType: "text", + domId: MERMAID_DOM_ID_PREFIX + id27 + "-" + vertexCounter, + styles: [], + classes: [] }; - }; - var headers = node2.header.map(function(content, i2) { - return reactElement("th", "" + i2, { - style: getStyle(i2), - scope: "col", - children: output(content, state2) + vertices.set(id27, 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); + } + vertex.text = txt; + } else { + if (vertex.text === void 0) { + vertex.text = id27; + } + } + if (type3 !== void 0) { + vertex.type = type3; + } + if (style3 !== void 0 && style3 !== null) { + style3.forEach(function(s2) { + vertex.styles.push(s2); }); - }); - var rows = node2.cells.map(function(row, r) { - return reactElement("tr", "" + r, { - children: row.map(function(content, c2) { - return reactElement("td", "" + c2, { - style: getStyle(c2), - children: output(content, state2) - }); - }) + } + 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 { + edges[pos].interpolate = interpolate; + } }); - return reactElement("table", state2.key, { - children: [reactElement("thead", "thead", { - children: reactElement("tr", null, { - children: headers - }) - }), reactElement("tbody", "tbody", { - children: rows - })] + }, "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.)` + ); + } + 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"); + } + } }); - }, - html: function(node2, output, state2) { - var getStyle = function getStyle2(colIndex) { - return node2.align[colIndex] == null ? "" : "text-align:" + node2.align[colIndex] + ";"; - }; - var headers = node2.header.map(function(content, i2) { - return htmlTag("th", output(content, state2), { - style: getStyle(i2), - scope: "col" - }); - }).join(""); - var rows = node2.cells.map(function(row) { - var cols = row.map(function(content, c2) { - return htmlTag("td", output(content, state2), { - style: getStyle(c2) + }, "updateLink"); + addClass = /* @__PURE__ */ __name(function(ids, style3) { + ids.split(",").forEach(function(id27) { + let classNode = classes.get(id27); + if (classNode === void 0) { + classNode = { id: id27, styles: [], textStyles: [] }; + classes.set(id27, 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); }); - }).join(""); - return htmlTag("tr", cols); - }).join(""); - var thead = htmlTag("thead", htmlTag("tr", headers)); - var tbody = htmlTag("tbody", rows); - return htmlTag("table", thead + tbody); - } - }, - newline: { - order: currOrder++, - match: blockRegex(/^(?:\n *)*\n/), - parse: ignoreCapture, - react: function(node2, output, state2) { - return "\n"; - }, - html: function(node2, output, state2) { - return "\n"; - } - }, - paragraph: { - order: currOrder++, - match: blockRegex(/^((?:[^\n]|\n(?! *\n))+)(?:\n *)+\n/), - parse: parseCaptureInline, - react: function(node2, output, state2) { - return reactElement("div", state2.key, { - className: "paragraph", - children: output(node2.content, state2) + } }); - }, - html: function(node2, output, state2) { - var attributes = { - class: "paragraph" - }; - return htmlTag("div", output(node2.content, state2), attributes); - } - }, - escape: { - order: currOrder++, - // We don't allow escaping numbers, letters, or spaces here so that - // backslashes used in plain text still get rendered. But allowing - // escaping anything else provides a very flexible escape mechanism, - // regardless of how this grammar is extended. - match: inlineRegex(/^\\([^0-9A-Za-z\s])/), - parse: function(capture, parse2, state2) { - return { - type: "text", - content: capture[1] - }; - }, - react: null, - html: null - }, - tableSeparator: { - order: currOrder++, - match: function(source, state2) { - if (!state2.inTable) { - return null; + }, "addClass"); + setDirection = /* @__PURE__ */ __name(function(dir2) { + direction = dir2; + if (/.*]+:\/[^ >]+)>/), - parse: function(capture, parse2, state2) { - return { - type: "link", - content: [{ - type: "text", - content: capture[1] - }], - target: capture[1] - }; - }, - react: null, - html: null - }, - mailto: { - order: currOrder++, - match: inlineRegex(/^<([^ >]+@[^ >]+)>/), - parse: function(capture, parse2, state2) { - var address = capture[1]; - var target = capture[1]; - if (!AUTOLINK_MAILTO_CHECK_R.test(target)) { - target = "mailto:" + target; + if (/.*\^/.exec(direction)) { + direction = "BT"; } - return { - type: "link", - content: [{ - type: "text", - content: address - }], - target - }; - }, - react: null, - html: null - }, - url: { - order: currOrder++, - match: inlineRegex(/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/), - parse: function(capture, parse2, state2) { - return { - type: "link", - content: [{ - type: "text", - content: capture[1] - }], - target: capture[1], - title: void 0 - }; - }, - react: null, - html: null - }, - link: { - order: currOrder++, - match: inlineRegex(new RegExp("^\\[(" + LINK_INSIDE + ")\\]\\(" + LINK_HREF_AND_TITLE + "\\)")), - parse: function(capture, parse2, state2) { - var link = { - content: parse2(capture[1], state2), - target: unescapeUrl(capture[2]), - title: capture[3] - }; - return link; - }, - react: function(node2, output, state2) { - return reactElement("a", state2.key, { - href: sanitizeUrl(node2.target), - title: node2.title, - children: output(node2.content, state2) + 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 id27 of ids.split(",")) { + const vertex = vertices.get(id27); + if (vertex) { + vertex.classes.push(className); + } + const subGraph = subGraphLookup.get(id27); + if (subGraph) { + subGraph.classes.push(className); + } + } + }, "setClass"); + setTooltip = /* @__PURE__ */ __name(function(ids, tooltip) { + if (tooltip === void 0) { + return; + } + tooltip = sanitizeText4(tooltip); + for (const id27 of ids.split(",")) { + tooltips.set(version === "gen-1" ? lookUpDomId(id27) : id27, tooltip); + } + }, "setTooltip"); + setClickFun = /* @__PURE__ */ __name(function(id27, functionName, functionArgs) { + const domId = lookUpDomId(id27); + 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(id27); + } + const vertex = vertices.get(id27); + 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 + ); + } + }); + } + }, "setClickFun"); + setLink = /* @__PURE__ */ __name(function(ids, linkStr, target) { + ids.split(",").forEach(function(id27) { + const vertex = vertices.get(id27); + if (vertex !== void 0) { + vertex.link = utils_default2.formatUrl(linkStr, config2); + vertex.linkTarget = target; + } }); - }, - html: function(node2, output, state2) { - var attributes = { - href: sanitizeUrl(node2.target), - title: node2.title - }; - return htmlTag("a", output(node2.content, state2), attributes); - } - }, - image: { - order: currOrder++, - match: inlineRegex(new RegExp("^!\\[(" + LINK_INSIDE + ")\\]\\(" + LINK_HREF_AND_TITLE + "\\)")), - parse: function(capture, parse2, state2) { - var image = { - alt: capture[1], - target: unescapeUrl(capture[2]), - title: capture[3] - }; - return image; - }, - react: function(node2, output, state2) { - return reactElement("img", state2.key, { - src: sanitizeUrl(node2.target), - alt: node2.alt, - title: node2.title + setClass(ids, "clickable"); + }, "setLink"); + getTooltip = /* @__PURE__ */ __name(function(id27) { + return tooltips.get(id27); + }, "getTooltip"); + setClickEvent = /* @__PURE__ */ __name(function(ids, functionName, functionArgs) { + ids.split(",").forEach(function(id27) { + setClickFun(id27, functionName, functionArgs); }); - }, - html: function(node2, output, state2) { - var attributes = { - src: sanitizeUrl(node2.target), - alt: node2.alt, - title: node2.title - }; - return htmlTag("img", "", attributes, false); - } - }, - reflink: { - order: currOrder++, - match: inlineRegex(new RegExp( - // The first [part] of the link - "^\\[(" + LINK_INSIDE + ")\\]\\s*\\[([^\\]]*)\\]" - )), - parse: function(capture, parse2, state2) { - return parseRef(capture, state2, { - type: "link", - content: parse2(capture[1], state2) + setClass(ids, "clickable"); + }, "setClickEvent"); + bindFunctions = /* @__PURE__ */ __name(function(element3) { + funs.forEach(function(fun) { + fun(element3); }); - }, - react: null, - html: null - }, - refimage: { - order: currOrder++, - match: inlineRegex(new RegExp( - // The first [part] of the link - "^!\\[(" + LINK_INSIDE + ")\\]\\s*\\[([^\\]]*)\\]" - )), - parse: function(capture, parse2, state2) { - return parseRef(capture, state2, { - type: "image", - alt: capture[1] + }, "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); }); - }, - react: null, - html: null - }, - em: { - order: currOrder, - match: inlineRegex(new RegExp( - // only match _s surrounding words. - "^\\b_((?:__|\\\\[\\s\\S]|[^\\\\_])+?)_\\b|^\\*(?=\\S)((?:\\*\\*|\\\\[\\s\\S]|\\s+(?:\\\\[\\s\\S]|[^\\s\\*\\\\]|\\*\\*)|[^\\s\\*\\\\])+?)\\*(?!\\*)" - )), - quality: function(capture) { - return capture[0].length + 0.2; - }, - parse: function(capture, parse2, state2) { + }, "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 id27 = _id.text.trim(); + let title2 = _title.text; + if (_id === _title && /\s/.exec(_title.text)) { + id27 = 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]); + } + } + id27 = id27 ?? "subGraph" + subCount; + title2 = title2 || ""; + title2 = sanitizeText4(title2); + subCount = subCount + 1; + const subGraph = { + id: id27, + 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(id27, subGraph); + return id27; + }, "addSubGraph"); + getPosForId = /* @__PURE__ */ __name(function(id27) { + for (const [i2, subGraph] of subGraphs.entries()) { + if (subGraph.id === id27) { + return i2; + } + } + return -1; + }, "getPosForId"); + secCount = -1; + posCrossRef = []; + indexNodes2 = /* @__PURE__ */ __name(function(id27, pos) { + const nodes6 = subGraphs[pos].nodes; + secCount = secCount + 1; + if (secCount > 2e3) { + return { + result: false, + count: 0 + }; + } + posCrossRef[secCount] = pos; + if (subGraphs[pos].id === id27) { + 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(id27, childPos); + if (res.result) { + return { + result: true, + count: posCount + res.count + }; + } else { + posCount = posCount + res.count; + } + } + count = count + 1; + } return { - content: parse2(capture[2] || capture[1], state2) + result: false, + count: posCount }; - }, - react: function(node2, output, state2) { - return reactElement("em", state2.key, { - children: output(node2.content, state2) - }); - }, - html: function(node2, output, state2) { - return htmlTag("em", output(node2.content, state2)); - } - }, - strong: { - order: currOrder, - match: inlineRegex(/^\*\*((?:\\[\s\S]|[^\\])+?)\*\*(?!\*)/), - quality: function(capture) { - return capture[0].length + 0.1; - }, - parse: parseCaptureInline, - react: function(node2, output, state2) { - return reactElement("strong", state2.key, { - children: output(node2.content, state2) - }); - }, - html: function(node2, output, state2) { - return htmlTag("strong", output(node2.content, state2)); - } - }, - u: { - order: currOrder++, - match: inlineRegex(/^__((?:\\[\s\S]|[^\\])+?)__(?!_)/), - quality: function(capture) { - return capture[0].length; - }, - parse: parseCaptureInline, - react: function(node2, output, state2) { - return reactElement("u", state2.key, { - children: output(node2.content, state2) + }, "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 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" }; + } + 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"; + } + 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; + } + } + return false; + }, "exists"); + makeUniq = /* @__PURE__ */ __name((sg, allSubgraphs) => { + const res = []; + sg.nodes.forEach((_id, pos) => { + if (!exists(allSubgraphs, _id)) { + res.push(sg.nodes[pos]); + } }); - }, - html: function(node2, output, state2) { - return htmlTag("u", output(node2.content, state2)); - } - }, - del: { - order: currOrder++, - match: inlineRegex(/^~~(?=\S)((?:\\[\s\S]|~(?!~)|[^\s~\\]|\s(?!~~))+?)~~/), - parse: parseCaptureInline, - react: function(node2, output, state2) { - return reactElement("del", state2.key, { - children: output(node2.content, state2) + 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, id27) => nodes6.find((node2) => node2.id === id27), "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 id27 of subGraph.nodes) { + parentDB.set(id27, 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"); }); - }, - html: function(node2, output, state2) { - return htmlTag("del", output(node2.content, state2)); - } - }, - inlineCode: { - order: currOrder++, - match: inlineRegex(/^(`+)([\s\S]*?[^`])\1(?!`)/), - parse: function(capture, parse2, state2) { - return { - content: capture[2].replace(INLINE_CODE_ESCAPE_BACKTICKS_R, "$1") - }; - }, - react: function(node2, output, state2) { - return reactElement("code", state2.key, { - children: node2.content + 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); }); - }, - html: function(node2, output, state2) { - return htmlTag("code", sanitizeText$3(node2.content)); - } - }, - br: { - order: currOrder++, - match: anyScopeRegex(/^ {2,}\n/), - parse: ignoreCapture, - react: function(node2, output, state2) { - return reactElement("br", state2.key, EMPTY_PROPS); - }, - html: function(node2, output, state2) { - return "
"; - } - }, - text: { - order: currOrder++, - // Here we look for anything followed by non-symbols, - // double newlines, or double-space-newlines - // We break on any symbol characters so that this grammar - // is easy to extend without needing to modify this regex - match: anyScopeRegex(/^[\s\S]+?(?=[^0-9A-Za-z\s\u00c0-\uffff]|\n\n| {2,}\n|\w+:\S|$)/), - parse: function(capture, parse2, state2) { - return { - content: capture[0] - }; - }, - react: function(node2, output, state2) { - return node2.content; - }, - html: function(node2, output, state2) { - return sanitizeText$3(node2.content); - } - } - }; - var ruleOutput = function ruleOutput2(rules, property2) { - if (!property2 && typeof console !== "undefined") { - console.warn("simple-markdown ruleOutput should take 'react' or 'html' as the second argument."); + 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 + }; } - var nestedRuleOutput = function nestedRuleOutput2(ast, outputFunc, state2) { - return rules[ast.type][property2](ast, outputFunc, state2); - }; - return nestedRuleOutput; - }; - var reactFor = function reactFor2(outputFunc) { - var nestedOutput = function nestedOutput2(ast, state2) { - state2 = state2 || {}; - if (Array.isArray(ast)) { - var oldKey = state2.key; - var result = []; - var lastResult = null; - for (var i2 = 0; i2 < ast.length; i2++) { - state2.key = "" + i2; - var nodeOut = nestedOutput2(ast[i2], state2); - if (typeof nodeOut === "string" && typeof lastResult === "string") { - lastResult = lastResult + nodeOut; - result[result.length - 1] = lastResult; - } else { - result.push(nodeOut); - lastResult = nodeOut; + }); + + // 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 "y": + uniqueDirections.add("up"); + uniqueDirections.add("down"); + break; + default: + uniqueDirections.add(direction4); + break; } } - state2.key = oldKey; - return result; - } else { - return outputFunc(ast, nestedOutput2, state2); - } - }; - return nestedOutput; - }; - var htmlFor = function htmlFor2(outputFunc) { - var nestedOutput = function nestedOutput2(ast, state2) { - state2 = state2 || {}; - if (Array.isArray(ast)) { - return ast.map(function(node2) { - return nestedOutput2(node2, state2); - }).join(""); - } else { - return outputFunc(ast, nestedOutput2, state2); - } + 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"); + } + }); + + // ../../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 }; - return nestedOutput; - }; - var outputFor = function outputFor2(rules, property2, defaultState = {}) { - if (!property2) { - throw new Error("simple-markdown: outputFor: `property` must be defined. if you just upgraded, you probably need to replace `outputFor` with `reactFor`"); - } - var latestState; - var arrayRule = rules.Array || defaultRules.Array; - var arrayRuleCheck = arrayRule[property2]; - if (!arrayRuleCheck) { - throw new Error("simple-markdown: outputFor: to join nodes of type `" + // @ts-expect-error [FEI-5003] - TS2469 - The '+' operator cannot be applied to type 'symbol'. - property2 + "` you must provide an `Array:` joiner rule with that type, Please see the docs for details on specifying an Array rule."); - } - var arrayRuleOutput = arrayRuleCheck; - var nestedOutput = function nestedOutput2(ast, state2) { - state2 = state2 || latestState; - latestState = state2; - if (Array.isArray(ast)) { - return arrayRuleOutput(ast, nestedOutput2, state2); - } else { - return rules[ast.type][property2](ast, nestedOutput2, state2); + } + function changeDefaults(newDefaults) { + _defaults = newDefaults; + } + function escape$1(html2, encode) { + if (encode) { + if (escapeTest.test(html2)) { + return html2.replace(escapeReplace, getEscapeReplacement); } - }; - var outerOutput = function outerOutput2(ast, state2) { - latestState = populateInitialState(state2, defaultState); - return nestedOutput(ast, latestState); - }; - return outerOutput; - }; - var defaultRawParse = parserFor(defaultRules); - var defaultBlockParse = function defaultBlockParse2(source, state2) { - state2 = state2 || {}; - state2.inline = false; - return defaultRawParse(source, state2); - }; - var defaultInlineParse = function defaultInlineParse2(source, state2) { - state2 = state2 || {}; - state2.inline = true; - return defaultRawParse(source, state2); - }; - var defaultImplicitParse = function defaultImplicitParse2(source, state2) { - var isBlock = BLOCK_END_R.test(source); - state2 = state2 || {}; - state2.inline = !isBlock; - return defaultRawParse(source, state2); - }; - var defaultReactOutput = outputFor(defaultRules, "react"); - var defaultHtmlOutput = outputFor(defaultRules, "html"); - var markdownToReact = function markdownToReact2(source, state2) { - return defaultReactOutput(defaultBlockParse(source, state2), state2); - }; - var markdownToHtml = function markdownToHtml2(source, state2) { - return defaultHtmlOutput(defaultBlockParse(source, state2), state2); - }; - var ReactMarkdown = function ReactMarkdown2(props) { - var divProps = {}; - for (var prop in props) { - if (prop !== "source" && Object.prototype.hasOwnProperty.call(props, prop)) { - divProps[prop] = props[prop]; + } else { + if (escapeTestNoEncode.test(html2)) { + return html2.replace(escapeReplaceNoEncode, getEscapeReplacement); } } - divProps.children = markdownToReact(props.source); - return reactElement("div", null, divProps); - }; - var SimpleMarkdown = { - defaultRules, - parserFor, - outputFor, - inlineRegex, - blockRegex, - anyScopeRegex, - parseInline, - parseBlock, - // default wrappers: - markdownToReact, - markdownToHtml, - // @ts-expect-error [FEI-5003] - TS2322 - Type 'FC' is not assignable to type '(props: { [key: string]: any; source: string; }) => ReactElement'. - ReactMarkdown, - defaultBlockParse, - defaultInlineParse, - defaultImplicitParse, - defaultReactOutput, - defaultHtmlOutput, - preprocess, - sanitizeText: sanitizeText$3, - sanitizeUrl, - unescapeUrl, - htmlTag, - reactElement, - // deprecated: - defaultRawParse, - ruleOutput, - reactFor, - htmlFor, - defaultParse: function(...args) { - if (typeof console !== "undefined") { - console.warn("defaultParse is deprecated, please use `defaultImplicitParse`"); - } - return defaultImplicitParse.apply(null, args); - }, - defaultOutput: function(...args) { - if (typeof console !== "undefined") { - console.warn("defaultOutput is deprecated, please use `defaultReactOutput`"); + 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 defaultReactOutput.apply(null, args); + return ""; + }); + } + function edit(regex2, opt) { + let source = typeof regex2 === "string" ? regex2 : regex2.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; } - }; - function preprocessMarkdown(markdown) { - const withoutMultipleNewlines = markdown.replace(/\n{2,}/g, "\n"); - const withoutExtraSpaces = withoutMultipleNewlines.replace(/^\s+/gm, ""); - return withoutExtraSpaces; + return href; } - function markdownToLines(markdown) { - const preprocessedMarkdown = preprocessMarkdown(markdown); - const mdParse = SimpleMarkdown.defaultBlockParse; - const syntaxTree = mdParse(preprocessedMarkdown); - let lines = [[]]; - let currentLine = 0; - function processNode(node2, parentType) { - if (node2.type === "text") { - const textLines = node2.content.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 || "normal" }); - } - }); - }); - } else if (node2.type === "strong" || node2.type === "em") { - node2.content.forEach((contentNode) => { - processNode(contentNode, node2.type); - }); + 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 { + return " |"; } + }), cells = row.split(/ \|/); + let i2 = 0; + if (!cells[0].trim()) { + cells.shift(); } - syntaxTree.forEach((treeNode) => { - if (treeNode.type === "paragraph") { - treeNode.content.forEach((contentNode) => { - processNode(contentNode); - }); - } - }); - return lines; - } - function markdownToHTML(markdown) { - const mdParse = SimpleMarkdown.defaultBlockParse; - const syntaxTree = mdParse(markdown); - function output(node2) { - if (node2.type === "text") { - return node2.content.replace(/\n/g, "
"); - } else if (node2.type === "strong") { - return `${node2.content.map(output).join("")}`; - } else if (node2.type === "em") { - return `${node2.content.map(output).join("")}`; - } else if (node2.type === "paragraph") { - return `

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

`; + if (cells.length > 0 && !cells[cells.length - 1].trim()) { + cells.pop(); + } + if (count) { + if (cells.length > count) { + cells.splice(count); } else { - return ""; + while (cells.length < count) + cells.push(""); } } - return syntaxTree.map(output).join(""); - } - function applyStyle(dom, styleFn) { - if (styleFn) { - dom.attr("style", styleFn); + for (; i2 < cells.length; i2++) { + cells[i2] = cells[i2].trim().replace(/\\\|/g, "|"); } + return cells; } - function addHtmlSpan(element, node2, width2, classes2) { - const fo = element.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"); - 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(); + function rtrim(str2, c3, invert2) { + const l2 = str2.length; + if (l2 === 0) { + return ""; } - fo.style("width", bbox.width); - fo.style("height", bbox.height); - return fo.node(); - } - 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 createFormattedText(width2, g, structuredText, addBackground = false) { - const lineHeight = 1.1; - const labelGroup = g.append("g"); - let bkg = labelGroup.insert("rect").attr("class", "background"); - const textElement = labelGroup.append("text").attr("y", "-10.1"); - let lineIndex = -1; - structuredText.forEach((line2) => { - lineIndex++; - let tspan = createTspan(textElement, lineIndex, lineHeight); - let words = [...line2].reverse(); - let currentWord; - let wrappedLine = []; - while (words.length) { - currentWord = words.pop(); - wrappedLine.push(currentWord); - updateTextContentAndStyles(tspan, wrappedLine); - if (tspan.node().getComputedTextLength() > width2) { - wrappedLine.pop(); - words.push(currentWord); - updateTextContentAndStyles(tspan, wrappedLine); - wrappedLine = []; - lineIndex++; - tspan = createTspan(textElement, lineIndex, lineHeight); - } + 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 { + break; } - }); - 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(); } + return str2.slice(0, l2 - suffLen); } - 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); + function findClosingBracket(str2, b2) { + if (str2.indexOf(b2[1]) === -1) { + return -1; + } + 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; + } } - }); - } - const createText = (el, text2 = "", { - style = "", - isTitle = false, - classes: classes2 = "", - useHtmlLabels = true, - isNode = true, - width: width2, - addSvgBackground = false - } = {}) => { - log$1.info("createText", text2, style, isTitle, classes2, useHtmlLabels, isNode, addSvgBackground); - if (useHtmlLabels) { - const htmlText = markdownToHTML(text2); - const node2 = { - isNode, - label: decodeEntities(htmlText).replace( - /fa[blrs]?:fa-[\w-]+/g, - (s) => `` - ), - labelStyle: style.replace("fill:", "color:") - }; - let vertexNode = addHtmlSpan(el, node2, width2, classes2); - return vertexNode; - } else { - const structuredText = markdownToLines(text2); - const special = ['"', "'", ".", ",", ":", ";", "!", "?", "(", ")", "[", "]", "{", "}"]; - let lastWord; - structuredText.forEach((line2) => { - line2.forEach((word) => { - if (special.includes(word.content) && lastWord) { - lastWord.content += word.content; - word.content = ""; - } - lastWord = word; - }); - }); - 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; + 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 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$7(decodeEntities(labelText), getConfig$1()), { - useHtmlLabels, - width: node2.width || getConfig$1().flowchart.wrappingWidth, - classes: "markdown-node-label" - }); - } else { - text2 = textNode.appendChild( - createLabel$1( - sanitizeText$7(decodeEntities(labelText), getConfig$1()), - node2.labelStyle, - false, - isNode - ) - ); + return { + type: "image", + raw, + href, + title: title2, + text: escape$1(text2) + }; + } + function indentCodeCompensation(raw, text2) { + const matchIndentToCode = raw.match(/^(\s+)(?:```)/); + if (matchIndentToCode === null) { + return text2; } - let bbox = text2.getBBox(); - const halfPadding = node2.padding / 2; - if (evaluate(getConfig$1().flowchart.htmlLabels)) { - const div = text2.children[0]; - const dv = select(text2); - const images = div.getElementsByTagName("img"); - if (images) { - const noImgText = labelText.replace(/]*>/g, "").trim() === ""; - await Promise.all( - [...images].map( - (img) => new Promise( - (res) => img.addEventListener("load", function() { - 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; - img.style.width = parseInt(bodyFontSize, 10) * enlargingFactor + "px"; - } else { - img.style.width = "100%"; - } - res(img); - }) - ) - ) - ); + const indentToCode = matchIndentToCode[1]; + return text2.split("\n").map((node2) => { + const matchIndentInNode = node2.match(/^\s+/); + if (matchIndentInNode === null) { + return node2; } - 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, element) => { - const bbox = element.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$f = () => { - descendants = {}; - parents = {}; - clusterDb = {}; - }; - const isDescendant = (id2, ancenstorId) => { - log$1.trace("In isDecendant", ancenstorId, " ", id2, " = ", descendants[ancenstorId].includes(id2)); - if (descendants[ancenstorId].includes(id2)) { - return true; - } - return false; - }; - const edgeInCluster = (edge, clusterId) => { - log$1.info("Decendants 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 decendants"); - 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 [indentInNode] = matchIndentInNode; + if (indentInNode.length >= indentToCode.length) { + return node2.slice(indentToCode.length); + } + 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] + }; + } } - 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 - ); + 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(); + } } - } catch (e) { - log$1.error(e); + return { + type: "heading", + raw: cap[0], + depth: cap[1].length, + text: text2, + tokens: this.lexer.inline(text2) + }; } - }); - } - 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; - } - } - }; - const getAnchorId = (id2) => { - if (!clusterDb[id2]) { - return id2; - } - if (!clusterDb[id2].externalConnections) { - return id2; - } - if (clusterDb[id2]) { - return clusterDb[id2].id; - } - 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) }; - } - }); - 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("Decendants of XXX ", id2, ": ", descendants[id2]); - clusterDb[id2].externalConnections = true; + } + 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; + } + } + 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; + } + 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; + } + } + if (list2.loose) { + for (let i2 = 0; i2 < list2.items.length; i2++) { + list2.items[i2].loose = true; + } } + return list2; } - }); - } else { - log$1.debug("Not a cluster ", id2, descendants); - } - }); - 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 = JSON.parse(JSON.stringify(edge)); - const edge2 = JSON.parse(JSON.stringify(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) { - edge.fromCluster = e.v; - } - if (w2 !== e.w) { - edge.toCluster = e.w; - } - log$1.warn("Fix Replacing with XXX", v, w2, e.name); - graph.setEdge(v, w2, edge, e.name); - } - }); - 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 nodes2 = graph.nodes(); - let hasChildren = false; - for (const node2 of nodes2) { - const children2 = graph.children(node2); - hasChildren = hasChildren || children2.length > 0; - } - if (!hasChildren) { - log$1.debug("Done, no node has children", graph.nodes()); - return; - } - 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 dir = graphSettings.rankdir === "TB" ? "LR" : "TB"; - if (clusterDb[node2] && clusterDb[node2].clusterData && clusterDb[node2].clusterData.dir) { - dir = clusterDb[node2].clusterData.dir; - log$1.warn("Fixing dir", clusterDb[node2].clusterData.dir, dir); } - const clusterGraph = new Graph({ - multigraph: true, - compound: true - }).setGraph({ - rankdir: dir, - // Todo: set proper spacing - nodesep: 50, - ranksep: 50, - marginx: 8, - marginy: 8 - }).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 - }); - 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); - } - } - 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); - } - } - }; - 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; - } - return { x: cx + dx, y: cy + dy }; - } - function intersectCircle(node2, rx, point2) { - return intersectEllipse(node2, rx, rx, point2); - } - 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; - } - denom = a1 * b2 - a2 * b1; - if (denom === 0) { - return; - } - 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(r1, r2) { - return r1 * r2 > 0; - } - 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); - } - 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); - } - } - if (!intersections.length) { - 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; - }); - } - return intersections[0]; - } - 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; - } - sx = dy === 0 ? 0 : h * dx / dy; - sy = h; - } else { - if (dx < 0) { - w2 = -w2; - } - 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; - let edgeCount$1 = 0; - const drawEdge$2 = 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$1).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)" - ); - } - let x2, y2; - const l = path2.points.length; - let labelPosition = utils.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.calcCardinalityPosition( - relation.relation.type1 !== "none", - path2.points, - path2.points[0] - ); - let cardinality_2_point = utils.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$1++; - }; - 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); - } else { - title2 = g.append("text").attr("y", conf2.textHeight + conf2.padding).attr("x", 0); - } - let isFirst = true; - classDef.annotations.forEach(function(member) { - const titleText2 = title2.append("tspan").text("«" + member + "»"); - if (!isFirst) { - titleText2.attr("dy", conf2.textHeight); - } - 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; - const 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; - }); - const membersBox = members.node().getBBox(); - const 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); - } - membersLine.attr("x2", rectWidth); - methodsLine.attr("x2", rectWidth); - 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 += "<" + classDef.type + ">"; - } - return classTitleString; - }; - const drawNote$2 = 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 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 parseMember = function(text2) { - const fieldRegEx = /^([#+~-])?(\w+)(~\w+~|\[])?\s+(\w+) *([$*])?$/; - const methodRegEx = /^([#+|~-])?(\w+) *\( *(.*)\) *([$*])? *(\w*[[\]|~]*\s*\w*~?)$/; - let fieldMatch = text2.match(fieldRegEx); - let methodMatch = text2.match(methodRegEx); - if (fieldMatch && !methodMatch) { - return buildFieldDisplay(fieldMatch); - } else if (methodMatch) { - return buildMethodDisplay(methodMatch); - } else { - return buildLegacyDisplay(text2); - } - }; - const buildFieldDisplay = function(parsedText) { - let cssStyle = ""; - let displayText = ""; - try { - let visibility = parsedText[1] ? parsedText[1].trim() : ""; - let fieldType = parsedText[2] ? parsedText[2].trim() : ""; - let genericType = parsedText[3] ? parseGenericTypes(parsedText[3].trim()) : ""; - let fieldName = parsedText[4] ? parsedText[4].trim() : ""; - let classifier = parsedText[5] ? parsedText[5].trim() : ""; - displayText = visibility + fieldType + genericType + " " + fieldName; - cssStyle = parseClassifier(classifier); - } catch (err) { - displayText = parsedText; - } - return { - displayText, - cssStyle - }; - }; - const buildMethodDisplay = function(parsedText) { - let cssStyle = ""; - let displayText = ""; - try { - let visibility = parsedText[1] ? parsedText[1].trim() : ""; - let methodName = parsedText[2] ? parsedText[2].trim() : ""; - let parameters = parsedText[3] ? parseGenericTypes(parsedText[3].trim()) : ""; - let classifier = parsedText[4] ? parsedText[4].trim() : ""; - let returnType = parsedText[5] ? " : " + parseGenericTypes(parsedText[5]).trim() : ""; - displayText = visibility + methodName + "(" + parameters + ")" + returnType; - cssStyle = parseClassifier(classifier); - } catch (err) { - displayText = parsedText; - } - return { - displayText, - cssStyle - }; - }; - const buildLegacyDisplay = function(text2) { - let displayText = ""; - let cssStyle = ""; - let returnType = ""; - let visibility = ""; - let firstChar = text2.substring(0, 1); - let lastChar = text2.substring(text2.length - 1, text2.length); - if (firstChar.match(/[#+~-]/)) { - visibility = firstChar; - } - let noClassifierRe = /[\s\w)~]/; - if (!lastChar.match(noClassifierRe)) { - cssStyle = parseClassifier(lastChar); - } - let startIndex = visibility === "" ? 0 : 1; - let endIndex = cssStyle === "" ? text2.length : text2.length - 1; - text2 = text2.substring(startIndex, endIndex); - let methodStart = text2.indexOf("("); - let methodEnd = text2.indexOf(")"); - if (methodStart > 1 && methodEnd > methodStart && methodEnd <= text2.length) { - let methodName = text2.substring(0, methodStart).trim(); - const parameters = text2.substring(methodStart + 1, methodEnd); - displayText = visibility + methodName + "(" + parseGenericTypes(parameters.trim()) + ")"; - if (methodEnd < text2.length) { - let potentialClassifier = text2.substring(methodEnd + 1, methodEnd + 2); - if (cssStyle === "" && !potentialClassifier.match(noClassifierRe)) { - cssStyle = parseClassifier(potentialClassifier); - returnType = text2.substring(methodEnd + 2).trim(); - } else { - returnType = text2.substring(methodEnd + 1).trim(); + 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; + } } - if (returnType !== "") { - if (returnType.charAt(0) === ":") { - returnType = returnType.substring(1).trim(); + 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 + }; } - returnType = " : " + parseGenericTypes(returnType); - displayText += returnType; } - } - } else { - displayText = parseGenericTypes(text2); - } - return { - displayText, - cssStyle - }; - }; - const addTspan = function(textEl, txt, isFirst, conf2) { - let member = parseMember(txt); - const tSpan = textEl.append("tspan").attr("x", conf2.padding).text(member.displayText); - if (member.cssStyle !== "") { - tSpan.attr("style", member.cssStyle); - } - if (!isFirst) { - tSpan.attr("dy", conf2.textHeight); - } - }; - const parseClassifier = function(classifier) { - switch (classifier) { - case "*": - return "font-style:italic;"; - case "$": - return "text-decoration:underline;"; - default: - return ""; - } - }; - const svgDraw$4 = { - getClassTitleString, - drawClass, - drawEdge: drawEdge$2, - drawNote: drawNote$2, - parseMember - }; - const question = async (parent, node2) => { - const { shapeSvg, bbox } = await labelHelper(parent, 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, 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 rect_left_inv_arrow = async (parent, node2) => { - const { shapeSvg, bbox } = await labelHelper(parent, 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, 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 lean_left = async (parent, node2) => { - const { shapeSvg, bbox } = await labelHelper(parent, 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, 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, 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, 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, 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, - true - ); - const rect2 = shapeSvg.insert("rect", ":first-child"); - const totalWidth = bbox.width + node2.padding; - const totalHeight = bbox.height + node2.padding; - rect2.attr("class", "basic label-container").attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).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.classes); - 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 = select(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 = select(descr); - bbox = div.getBoundingClientRect(); - dv.attr("width", bbox.width); - dv.attr("height", bbox.height); - } - const halfPadding = node2.padding / 2; - select(descr).attr( - "transform", - "translate( " + // (titleBox.width - bbox.width) / 2 + - (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + ", " + (titleBox.height + halfPadding + 5) + ")" - ); - select(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, 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, 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, void 0, true); - const gap = 5; - const circleGroup = shapeSvg.insert("g", ":first-child"); - const outerCircle = circleGroup.insert("circle"); - const innerCircle = circleGroup.insert("circle"); - 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, 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, dir) => { - const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id); - let width2 = 70; - let height2 = 10; - if (dir === "LR") { - width2 = 10; - height2 = 70; - } - const shape = shapeSvg.append("rect").attr("x", -1 * width2 / 2).attr("y", -1 * height2 / 2).attr("width", width2).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(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; - } - 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 = select(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 + ">"; - } else { - classTitleString += "<" + node2.classData.type + ">"; - } - } - const classTitleLabel = labelContainer.node().appendChild(createLabel$1(classTitleString, node2.labelStyle, true, true)); - select(classTitleLabel).attr("class", "classTitle"); - let classTitleBBox = classTitleLabel.getBBox(); - if (evaluate(getConfig$1().flowchart.htmlLabels)) { - const div = classTitleLabel.children[0]; - const dv = select(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((str2) => { - const parsedInfo = parseMember(str2); - 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 = select(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((str2) => { - const parsedInfo = parseMember(str2); - 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 = select(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(interfaceLabel).attr( - "transform", - "translate( " + (-1 * maxWidth / 2 + diffX2) + ", " + -1 * maxHeight / 2 + ")" - ); - verticalPos = interfaceBBox.height + rowPadding; - } - let diffX = (maxWidth - classTitleBBox.width) / 2; - select(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(lbl).attr( - "transform", - "translate( " + -maxWidth / 2 + ", " + (-1 * maxHeight / 2 + verticalPos + lineHeight / 2) + ")" - ); - verticalPos += classTitleBBox.height + 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(lbl).attr( - "transform", - "translate( " + -maxWidth / 2 + ", " + (-1 * maxHeight / 2 + verticalPos) + ")" - ); - verticalPos += classTitleBBox.height + rowPadding; - }); - rect2.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, - question, - rect: rect$1, - labelRect, - rectWithTitle, - choice, - circle, - doublecircle, - stadium, - hexagon, - 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, dir) => { - 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, dir); - } else { - el = await shapes$1[node2.shape](elem, node2, dir); - 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; - }; - const setNodeElem = (elem, node2) => { - nodeElems[node2.id] = elem; - }; - const clear$e = () => { - 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 rect = (parent, node2) => { - log$1.info("Creating subgraph rect for ", node2.id, node2); - 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(getConfig$1().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(getConfig$1().flowchart.htmlLabels)) { - const div = text2.children[0]; - const dv = select(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); - if (useHtmlLabels) { - label.attr( - "transform", - // This puts the labal on top of the box instead of inside it - "translate(" + (node2.x - bbox.width / 2) + ", " + (node2.y - node2.height / 2) + ")" - ); - } else { - label.attr( - "transform", - // This puts the labal on top of the box instead of inside it - "translate(" + node2.x + ", " + (node2.y - node2.height / 2) + ")" - ); - } - 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); - }; - return shapeSvg; - }; - const roundedWithTitle = (parent, node2) => { - 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(getConfig$1().flowchart.htmlLabels)) { - const div = text2.children[0]; - const dv = select(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; - } 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); - label.attr( - "transform", - "translate(" + (node2.x - bbox.width / 2) + ", " + (node2.y - node2.height / 2 - node2.padding / 3 + (evaluate(getConfig$1().flowchart.htmlLabels) ? 5 : 3)) + ")" - ); - 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$d = () => { - clusterElems = {}; - }; - let edgeLabels = {}; - let terminalLabels = {}; - const clear$c = () => { - 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); - log$1.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(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 inner = startEdgeLabelLeft.insert("g").attr("class", "inner"); - fo = inner.node().appendChild(startLabelElement); - const slBox = startLabelElement.getBBox(); - inner.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 inner = startEdgeLabelRight.insert("g").attr("class", "inner"); - fo = startEdgeLabelRight.node().appendChild(startLabelElement); - inner.node().appendChild(startLabelElement); - const slBox = startLabelElement.getBBox(); - inner.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 inner = endEdgeLabelLeft.insert("g").attr("class", "inner"); - fo = inner.node().appendChild(endLabelElement); - const slBox = endLabelElement.getBBox(); - inner.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 inner = endEdgeLabelRight.insert("g").attr("class", "inner"); - fo = inner.node().appendChild(endLabelElement); - const slBox = endLabelElement.getBBox(); - inner.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, value) { - if (getConfig$1().flowchart.htmlLabels && fo) { - fo.style.width = value.length * 9 + "px"; - fo.style.height = "12px"; - } - } - const positionEdgeLabel = (edge, paths) => { - log$1.info("Moving label abc78 ", edge.id, edge.label, edgeLabels[edge.id]); - let path2 = paths.updatedPath ? paths.updatedPath : paths.originalPath; - if (edge.label) { - const el = edgeLabels[edge.id]; - let x2 = edge.x; - let y2 = edge.y; - if (path2) { - const pos = utils.calcLabelPosition(path2); - log$1.info( - "Moving label " + edge.label + " from (", - x2, - ",", - y2, - ") to (", - pos.x, - ",", - pos.y, - ") abc78" - ); - if (paths.updatedPath) { - x2 = pos.x; - y2 = pos.y; - } - } - el.attr("transform", "translate(" + x2 + ", " + y2 + ")"); - } - if (edge.startLabelLeft) { - const el = terminalLabels[edge.id].startLeft; - let x2 = edge.x; - let y2 = edge.y; - if (path2) { - const pos = utils.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.calcTerminalLabelPosition( - edge.arrowTypeStart ? 10 : 0, - "start_right", - path2 - ); - x2 = pos.x; - y2 = pos.y; - } - 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.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_left", path2); - x2 = pos.x; - y2 = pos.y; - } - 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.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_right", path2); - x2 = pos.x; - y2 = pos.y; - } - 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.warn(`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 Q2 = 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 / Q2; - const res = { - x: insidePoint.x < outsidePoint.x ? insidePoint.x + r : insidePoint.x - R + r, - y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q2 - q : insidePoint.y - Q2 + q - }; - if (r === 0) { - res.x = outsidePoint.x; - res.y = outsidePoint.y; - } - if (R === 0) { - res.x = outsidePoint.x; - } - if (Q2 === 0) { - res.y = outsidePoint.y; - } - log$1.warn(`abc89 topp/bott calc, Q ${Q2}, q ${q}, R ${R}, r ${r}`, res); - return res; - } else { - if (insidePoint.x < outsidePoint.x) { - r = outsidePoint.x - w2 - x2; - } else { - r = x2 - w2 - outsidePoint.x; - } - let q = Q2 * 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.warn(`sides calc abc89, Q ${Q2}, q ${q}, R ${R}, r ${r}`, { _x, _y }); - if (r === 0) { - _x = outsidePoint.x; - _y = outsidePoint.y; - } - if (R === 0) { - _x = outsidePoint.x; - } - if (Q2 === 0) { - _y = outsidePoint.y; - } - return { x: _x, y: _y }; - } - }; - const cutPathAtIntersect = (_points, boundryNode) => { - log$1.warn("abc88 cutPathAtIntersect", _points, boundryNode); - let points = []; - let lastPointOutside = _points[0]; - let isInside = false; - _points.forEach((point2) => { - log$1.info("abc88 checking point", point2, boundryNode); - if (!outsideNode(boundryNode, point2) && !isInside) { - const inter = intersection(boundryNode, lastPointOutside, point2); - log$1.warn("abc88 inside", point2, lastPointOutside, inter); - log$1.warn("abc88 intersection", inter); - 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); - } else { - log$1.warn("abc88 no intersect", inter, points); + table(src) { + const cap = this.rules.block.table.exec(src); + if (!cap) { + return; + } + if (!/[:|]/.test(cap[2])) { + return; + } + 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 (headers.length !== aligns.length) { + return; + } + 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] + }); + } + 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 item; } - isInside = true; - } else { - log$1.warn("abc88 outside", point2, lastPointOutside); - lastPointOutside = point2; - if (!isInside) { - points.push(point2); + 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]) + }; + } } - } - }); - log$1.warn("abc88 returning points", points); - return points; - }; - const insertEdge$1 = function(elem, e, edge, clusterDb2, diagramType, graph) { - let points = edge.points; - let pointsHasChanged = false; - const tail = graph.node(e.v); - var head2 = graph.node(e.w); - log$1.info("abc88 InsertEdge: ", edge); - if (head2.intersect && tail.intersect) { - points = points.slice(1, edge.points.length - 1); - points.unshift(tail.intersect(points[0])); - log$1.info( - "Last point", - points[points.length - 1], - head2, - head2.intersect(points[points.length - 1]) - ); - points.push(head2.intersect(points[points.length - 1])); - } - if (edge.toCluster) { - log$1.info("to cluster abc88", clusterDb2[edge.toCluster]); - points = cutPathAtIntersect(edge.points, clusterDb2[edge.toCluster].node); - pointsHasChanged = true; - } - if (edge.fromCluster) { - log$1.info("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; - if (diagramType === "graph" || diagramType === "flowchart") { - curve = edge.curve || curveBasis; - } else { - curve = curveBasis; - } - const lineFunction = line$1().x(function(d) { - return d.x; - }).y(function(d) { - return d.y; - }).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 (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, "\\)"); - } - log$1.info("arrowTypeStart", edge.arrowTypeStart); - log$1.info("arrowTypeEnd", edge.arrowTypeEnd); - switch (edge.arrowTypeStart) { - case "arrow_cross": - svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-crossStart)"); - break; - case "arrow_point": - svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-pointStart)"); - break; - case "arrow_barb": - svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-barbStart)"); - break; - case "arrow_circle": - svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-circleStart)"); - break; - case "aggregation": - svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-aggregationStart)"); - break; - case "extension": - svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-extensionStart)"); - break; - case "composition": - svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-compositionStart)"); - break; - case "dependency": - svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-dependencyStart)"); - break; - case "lollipop": - svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-lollipopStart)"); - break; - } - switch (edge.arrowTypeEnd) { - case "arrow_cross": - svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-crossEnd)"); - break; - case "arrow_point": - svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-pointEnd)"); - break; - case "arrow_barb": - svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-barbEnd)"); - break; - case "arrow_circle": - svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-circleEnd)"); - break; - case "aggregation": - svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-aggregationEnd)"); - break; - case "extension": - svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-extensionEnd)"); - break; - case "composition": - svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-compositionEnd)"); - break; - case "dependency": - svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-dependencyEnd)"); - break; - case "lollipop": - svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-lollipopEnd)"); - break; - } - let paths = {}; - if (pointsHasChanged) { - paths.updatedPath = points; - } - paths.originalPath = edge.points; - return paths; - }; - const recursiveRender = async (_elem, graph, diagramtype, parentCluster) => { - log$1.info("Graph in recursive render: XXX", write(graph), parentCluster); - const dir = graph.graph().rankdir; - log$1.trace("Dir in recursive render - dir:", dir); - 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, graph.node(v)); - 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), dir); - } - } - }) - ); - 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, "Translateing: ", 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(graph); - log$1.info("Graph after layout:", write(graph)); - let diff = 0; - 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) { - positionNode$1(node2); - } else { - if (graph.children(v).length > 0) { - insertCluster(clusters, node2); - clusterDb[node2.id].node = node2; - } else { - positionNode$1(node2); - } - } - }); - graph.edges().forEach(function(e) { - const edge = graph.edge(e); - log$1.info("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(edge), edge); - const paths = insertEdge$1(edgePaths, e, edge, clusterDb, diagramtype, graph); - 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; - } - }); - return { elem, diff }; - }; - const render = async (elem, graph, markers2, diagramtype, id2) => { - insertMarkers$4(elem, markers2, diagramtype, id2); - clear$e(); - clear$c(); - clear$d(); - clear$f(); - log$1.warn("Graph at first:", write(graph)); - adjustClustersAndEdges(graph); - log$1.warn("Graph after:", write(graph)); - await recursiveRender(elem, graph, diagramtype); - }; - const conf$8 = {}; - const setConf$7 = function(cnf) { - const keys2 = Object.keys(cnf); - for (const key of keys2) { - conf$8[key] = cnf[key]; - } - }; - const addVertices$1 = function(vert, g, svgId, root2, doc, diagObj) { - const svg2 = root2.select(`[id="${svgId}"]`); - const keys2 = Object.keys(vert); - keys2.forEach(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; - let vertexNode; - log$1.info("vertex", vertex, vertex.labelType); - if (vertex.labelType === "markdown") { - log$1.info("vertex", vertex, vertex.labelType); - } else { - if (evaluate(getConfig$1().flowchart.htmlLabels)) { - const node2 = { - label: vertexText.replace( - /fa[blrs]?:fa-[\w-]+/g, - (s) => `` - ) - }; - 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); + 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) + }; } - vertexNode = svgLabel; } - } - let radious = 0; - let _shape = ""; - switch (vertex.type) { - case "round": - radious = 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"; - } - g.setNode(vertex.id, { - labelStyle: styles2.labelStyle, - shape: _shape, - labelText: vertexText, - labelType: vertex.labelType, - rx: radious, - ry: radious, - 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: vertexText, - rx: radious, - ry: radious, - 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 - }); - }); - }; - const addEdges$1 = 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; - } - edges2.forEach(function(edge) { - cnt2++; - var 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]); - var linkNameStart = "LS-" + edge.start; - var 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; + 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]) + }; } - 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$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"; - } - 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; - g.setEdge(edge.start, edge.end, edgeData, cnt2); - }); - }; - const getClasses$4 = function(text2, diagObj) { - log$1.info("Extracting classes"); - diagObj.db.clear(); - try { - diagObj.parse(text2); - return diagObj.db.getClasses(); - } catch (e) { - return; - } - }; - const draw$f = async function(text2, id2, _version, diagObj) { - log$1.info("Drawing flowchart"); - diagObj.db.clear(); - flowDb.setGen("gen-2"); - diagObj.parser.parse(text2); - let dir = diagObj.db.getDirection(); - if (dir === void 0) { - dir = "TD"; - } - const { securityLevel, flowchart: conf2 } = getConfig$1(); - const nodeSpacing = conf2.nodeSpacing || 50; - const rankSpacing = conf2.rankSpacing || 50; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); - const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; - const g = new Graph({ - multigraph: true, - compound: true - }).setGraph({ - rankdir: dir, - 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 - ); - } - 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); - } - } - addVertices$1(vert, g, id2, root2, doc, diagObj); - addEdges$1(edges2, g); - const svg2 = root2.select(`[id="${id2}"]`); - const element = root2.select("#" + id2 + " g"); - await render(element, g, ["point", "circle", "cross"], "flowchart", id2); - utils.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 = select("#" + id2 + ' [id="' + key + '"]'); - if (node2) { - const link = doc.createElementNS("http://www.w3.org/2000/svg", "a"); - link.setAttributeNS("http://www.w3.org/2000/svg", "class", vertex.classes.join(" ")); - link.setAttributeNS("http://www.w3.org/2000/svg", "href", vertex.link); - link.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"); - if (securityLevel === "sandbox") { - link.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top"); - } else if (vertex.linkTarget) { - link.setAttributeNS("http://www.w3.org/2000/svg", "target", vertex.linkTarget); - } - const linkNode = node2.insert(function() { - return link; - }, ":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(); - }); + escape(src) { + const cap = this.rules.inline.escape.exec(src); + if (cap) { + return { + type: "escape", + raw: cap[0], + text: escape$1(cap[1]) + }; } } - } - }); - }; - const flowRendererV2 = { - setConf: setConf$7, - addVertices: addVertices$1, - addEdges: addEdges$1, - getClasses: getClasses$4, - draw: draw$f - }; - const getStyles$d = (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}; - } - text-align: center; - } - - .cluster rect { - fill: ${options2.clusterBkg}; - stroke: ${options2.clusterBorder}; - stroke-width: 1px; - } - - .cluster text { - fill: ${options2.titleColor}; - } - - .cluster span,p { - 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}; - } -`; - const flowStyles = getStyles$d; - const diagram$g = { - parser: parser$l, - db: flowDb, - renderer: flowRendererV2, - styles: flowStyles, - 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$g - }, Symbol.toStringTag, { value: "Module" })); - const diagram$f = { - parser: parser$l, - db: flowDb, - renderer: flowRendererV2, - styles: flowStyles, - 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$f - }, Symbol.toStringTag, { value: "Module" })); - var parser$j = 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, 5], $V2 = [6, 9, 11, 23, 25, 27, 29, 30, 31, 51], $V3 = [1, 17], $V4 = [1, 18], $V5 = [1, 19], $V6 = [1, 20], $V7 = [1, 21], $V8 = [1, 22], $V9 = [1, 25], $Va = [1, 30], $Vb = [1, 31], $Vc = [1, 32], $Vd = [1, 33], $Ve = [6, 9, 11, 15, 20, 23, 25, 27, 29, 30, 31, 44, 45, 46, 47, 51], $Vf = [1, 45], $Vg = [30, 31, 48, 49], $Vh = [4, 6, 9, 11, 23, 25, 27, 29, 30, 31, 51], $Vi = [44, 45, 46, 47], $Vj = [22, 37], $Vk = [1, 65], $Vl = [1, 64], $Vm = [22, 37, 39, 41]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "ER_DIAGRAM": 4, "document": 5, "EOF": 6, "directive": 7, "line": 8, "SPACE": 9, "statement": 10, "NEWLINE": 11, "openDirective": 12, "typeDirective": 13, "closeDirective": 14, ":": 15, "argDirective": 16, "entityName": 17, "relSpec": 18, "role": 19, "BLOCK_START": 20, "attributes": 21, "BLOCK_STOP": 22, "title": 23, "title_value": 24, "acc_title": 25, "acc_title_value": 26, "acc_descr": 27, "acc_descr_value": 28, "acc_descr_multiline_value": 29, "ALPHANUM": 30, "ENTITY_NAME": 31, "attribute": 32, "attributeType": 33, "attributeName": 34, "attributeKeyTypeList": 35, "attributeComment": 36, "ATTRIBUTE_WORD": 37, "attributeKeyType": 38, "COMMA": 39, "ATTRIBUTE_KEY": 40, "COMMENT": 41, "cardinality": 42, "relType": 43, "ZERO_OR_ONE": 44, "ZERO_OR_MORE": 45, "ONE_OR_MORE": 46, "ONLY_ONE": 47, "NON_IDENTIFYING": 48, "IDENTIFYING": 49, "WORD": 50, "open_directive": 51, "type_directive": 52, "arg_directive": 53, "close_directive": 54, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 4: "ER_DIAGRAM", 6: "EOF", 9: "SPACE", 11: "NEWLINE", 15: ":", 20: "BLOCK_START", 22: "BLOCK_STOP", 23: "title", 24: "title_value", 25: "acc_title", 26: "acc_title_value", 27: "acc_descr", 28: "acc_descr_value", 29: "acc_descr_multiline_value", 30: "ALPHANUM", 31: "ENTITY_NAME", 37: "ATTRIBUTE_WORD", 39: "COMMA", 40: "ATTRIBUTE_KEY", 41: "COMMENT", 44: "ZERO_OR_ONE", 45: "ZERO_OR_MORE", 46: "ONE_OR_MORE", 47: "ONLY_ONE", 48: "NON_IDENTIFYING", 49: "IDENTIFYING", 50: "WORD", 51: "open_directive", 52: "type_directive", 53: "arg_directive", 54: "close_directive" }, - productions_: [0, [3, 3], [3, 2], [5, 0], [5, 2], [8, 2], [8, 1], [8, 1], [8, 1], [7, 4], [7, 6], [10, 1], [10, 5], [10, 4], [10, 3], [10, 1], [10, 2], [10, 2], [10, 2], [10, 1], [17, 1], [17, 1], [21, 1], [21, 2], [32, 2], [32, 3], [32, 3], [32, 4], [33, 1], [34, 1], [35, 1], [35, 3], [38, 1], [36, 1], [18, 3], [42, 1], [42, 1], [42, 1], [42, 1], [43, 1], [43, 1], [19, 1], [19, 1], [19, 1], [12, 1], [13, 1], [16, 1], [14, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 1: - break; - case 3: - this.$ = []; - break; - case 4: - $$[$0 - 1].push($$[$0]); - this.$ = $$[$0 - 1]; - break; - case 5: - case 6: - this.$ = $$[$0]; - break; - case 7: - case 8: - this.$ = []; - break; - case 12: - yy.addEntity($$[$0 - 4]); - yy.addEntity($$[$0 - 2]); - yy.addRelationship($$[$0 - 4], $$[$0], $$[$0 - 2], $$[$0 - 3]); - break; - case 13: - yy.addEntity($$[$0 - 3]); - yy.addAttributes($$[$0 - 3], $$[$0 - 1]); - break; - case 14: - yy.addEntity($$[$0 - 2]); - break; - case 15: - yy.addEntity($$[$0]); - break; - case 16: - case 17: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 18: - case 19: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 20: - case 43: - this.$ = $$[$0]; - break; - case 21: - case 41: - case 42: - this.$ = $$[$0].replace(/"/g, ""); - break; - case 22: - case 30: - this.$ = [$$[$0]]; - break; - case 23: - $$[$0].push($$[$0 - 1]); - this.$ = $$[$0]; - break; - case 24: - this.$ = { attributeType: $$[$0 - 1], attributeName: $$[$0] }; - break; - case 25: - this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeKeyTypeList: $$[$0] }; - break; - case 26: - this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeComment: $$[$0] }; - break; - case 27: - this.$ = { attributeType: $$[$0 - 3], attributeName: $$[$0 - 2], attributeKeyTypeList: $$[$0 - 1], attributeComment: $$[$0] }; - break; - case 28: - case 29: - case 32: - this.$ = $$[$0]; - break; - case 31: - $$[$0 - 2].push($$[$0]); - this.$ = $$[$0 - 2]; - break; - case 33: - this.$ = $$[$0].replace(/"/g, ""); - break; - case 34: - this.$ = { cardA: $$[$0], relType: $$[$0 - 1], cardB: $$[$0 - 2] }; - break; - case 35: - this.$ = yy.Cardinality.ZERO_OR_ONE; - break; - case 36: - this.$ = yy.Cardinality.ZERO_OR_MORE; - break; - case 37: - this.$ = yy.Cardinality.ONE_OR_MORE; - break; - case 38: - this.$ = yy.Cardinality.ONLY_ONE; - break; - case 39: - this.$ = yy.Identification.NON_IDENTIFYING; - break; - case 40: - this.$ = yy.Identification.IDENTIFYING; - break; - case 44: - yy.parseDirective("%%{", "open_directive"); - break; - case 45: - yy.parseDirective($$[$0], "type_directive"); - break; - case 46: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); - yy.parseDirective($$[$0], "arg_directive"); - break; - case 47: - yy.parseDirective("}%%", "close_directive", "er"); - break; - } - }, - table: [{ 3: 1, 4: $V0, 7: 3, 12: 4, 51: $V1 }, { 1: [3] }, o($V2, [2, 3], { 5: 6 }), { 3: 7, 4: $V0, 7: 3, 12: 4, 51: $V1 }, { 13: 8, 52: [1, 9] }, { 52: [2, 44] }, { 6: [1, 10], 7: 15, 8: 11, 9: [1, 12], 10: 13, 11: [1, 14], 12: 4, 17: 16, 23: $V3, 25: $V4, 27: $V5, 29: $V6, 30: $V7, 31: $V8, 51: $V1 }, { 1: [2, 2] }, { 14: 23, 15: [1, 24], 54: $V9 }, o([15, 54], [2, 45]), o($V2, [2, 8], { 1: [2, 1] }), o($V2, [2, 4]), { 7: 15, 10: 26, 12: 4, 17: 16, 23: $V3, 25: $V4, 27: $V5, 29: $V6, 30: $V7, 31: $V8, 51: $V1 }, o($V2, [2, 6]), o($V2, [2, 7]), o($V2, [2, 11]), o($V2, [2, 15], { 18: 27, 42: 29, 20: [1, 28], 44: $Va, 45: $Vb, 46: $Vc, 47: $Vd }), { 24: [1, 34] }, { 26: [1, 35] }, { 28: [1, 36] }, o($V2, [2, 19]), o($Ve, [2, 20]), o($Ve, [2, 21]), { 11: [1, 37] }, { 16: 38, 53: [1, 39] }, { 11: [2, 47] }, o($V2, [2, 5]), { 17: 40, 30: $V7, 31: $V8 }, { 21: 41, 22: [1, 42], 32: 43, 33: 44, 37: $Vf }, { 43: 46, 48: [1, 47], 49: [1, 48] }, o($Vg, [2, 35]), o($Vg, [2, 36]), o($Vg, [2, 37]), o($Vg, [2, 38]), o($V2, [2, 16]), o($V2, [2, 17]), o($V2, [2, 18]), o($Vh, [2, 9]), { 14: 49, 54: $V9 }, { 54: [2, 46] }, { 15: [1, 50] }, { 22: [1, 51] }, o($V2, [2, 14]), { 21: 52, 22: [2, 22], 32: 43, 33: 44, 37: $Vf }, { 34: 53, 37: [1, 54] }, { 37: [2, 28] }, { 42: 55, 44: $Va, 45: $Vb, 46: $Vc, 47: $Vd }, o($Vi, [2, 39]), o($Vi, [2, 40]), { 11: [1, 56] }, { 19: 57, 30: [1, 60], 31: [1, 59], 50: [1, 58] }, o($V2, [2, 13]), { 22: [2, 23] }, o($Vj, [2, 24], { 35: 61, 36: 62, 38: 63, 40: $Vk, 41: $Vl }), o([22, 37, 40, 41], [2, 29]), o([30, 31], [2, 34]), o($Vh, [2, 10]), o($V2, [2, 12]), o($V2, [2, 41]), o($V2, [2, 42]), o($V2, [2, 43]), o($Vj, [2, 25], { 36: 66, 39: [1, 67], 41: $Vl }), o($Vj, [2, 26]), o($Vm, [2, 30]), o($Vj, [2, 33]), o($Vm, [2, 32]), o($Vj, [2, 27]), { 38: 68, 40: $Vk }, o($Vm, [2, 31])], - defaultActions: { 5: [2, 44], 7: [2, 2], 25: [2, 47], 39: [2, 46], 45: [2, 28], 52: [2, 23] }, - parseError: function parseError2(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(); + 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; } - token2 = self2.symbols_[token2] || token2; + return { + type: "html", + raw: cap[0], + inLink: this.lexer.state.inLink, + inRawBlock: this.lexer.state.inRawBlock, + block: false, + text: cap[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(); + 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) : ""; } - 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] + "'"); + href = href.trim(); + if (/^$/.test(trimmedUrl)) { + href = href.slice(1); + } else { + href = href.slice(1, -1); } } - 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 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); } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol); + } + 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 outputLink(cap, link3, cap[0], this.lexer); } - 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; + } + 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; + } } - 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] - ]; + 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) + }; } - 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; + const text2 = raw.slice(2, -2); + return { + type: "strong", + raw, + text: text2, + tokens: this.lexer.inlineTokens(text2) + }; + } } } - return true; - } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError2(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]; + 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 + }; } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: 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++; + } + br(src) { + const cap = this.rules.inline.br.exec(src); + if (cap) { + return { + type: "br", + raw: cap[0] + }; } - if (this.options.ranges) { - this.yylloc.range[1]++; + } + 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]) + }; } - this._input = this._input.slice(1); - return ch; - }, - // unshifts one char (or a string) into the input - unput: 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 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 + } + 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 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); + 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; } - } - 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]; + 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; } - 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, 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 && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = 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; + 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); } - } else if (!this.options.flex) { + }); + 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); } } } - if (match) { - token2 = this.test_match(match, rules[index]); - if (token2 !== false) { - return token2; + 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); + } + } } - 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 - }); + 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 next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); + while ((match2 = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) { + maskedSrc = maskedSrc.slice(0, match2.index) + "++" + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex); } - }, - // 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]; + 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); + } + } } - }, - // 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 tokens2; + } + }; + _Renderer = class { + static { + __name(this, "_Renderer"); + } + options; + parser; + // set by the parser + constructor(options3) { + this.options = options3 || _defaults; + } + space(token2) { + return ""; + } + 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 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"; + return '
' + (escaped ? code : escape$1(code, true)) + "
\n"; + } + blockquote({ tokens: tokens2 }) { + const body = this.parser.parse(tokens2); + return `
+${body}
+`; + } + html({ text: text2 }) { + return text2; + } + heading({ tokens: tokens2, depth }) { + return `${this.parser.parseInline(tokens2)} +`; + } + 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 + " "; + } } - }, - // 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 25; - case 1: - this.popState(); - return "acc_title_value"; - case 2: - this.begin("acc_descr"); - return 27; - 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("open_directive"); - return 51; - case 8: - this.begin("type_directive"); - return 52; - case 9: - this.popState(); - this.begin("arg_directive"); - return 15; - case 10: - this.popState(); - this.popState(); - return 54; - case 11: - return 53; - case 12: - return 11; - case 13: - break; - case 14: - return 9; - case 15: - return 31; - case 16: - return 50; - case 17: - return 4; - case 18: - this.begin("block"); - return 20; - case 19: - return 39; - case 20: - break; - case 21: - return 40; - case 22: - return 37; - case 23: - return 37; - case 24: - return 41; - case 25: - break; - case 26: - this.popState(); - return 22; - case 27: - return yy_.yytext[0]; - case 28: - return 44; - case 29: - return 46; - case 30: - return 46; - case 31: - return 46; - case 32: - return 44; - case 33: - return 44; - case 34: - return 45; - case 35: - return 45; - case 36: - return 45; - case 37: - return 45; - case 38: - return 45; - case 39: - return 46; - case 40: - return 45; - case 41: - return 46; - case 42: - return 47; - case 43: - return 47; - case 44: - return 47; - case 45: - return 47; - case 46: - return 44; - case 47: - return 45; - case 48: - return 46; - case 49: - return 48; - case 50: - return 49; - case 51: - return 49; - case 52: - return 48; - case 53: - return 48; - case 54: - return 48; - case 55: - return 30; - case 56: - return yy_.yytext[0]; - case 57: - return 6; + itemBody += this.parser.parse(item.tokens, !!item.loose); + return `
  • ${itemBody}
  • +`; + } + checkbox({ checked }) { + return "'; + } + 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; } - }, - rules: [/^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/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, /^(?: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, /^(?:\.\.)/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 }, "open_directive": { "rules": [8], "inclusive": false }, "type_directive": { "rules": [9, 10], "inclusive": false }, "arg_directive": { "rules": [10, 11], "inclusive": false }, "block": { "rules": [19, 20, 21, 22, 23, 24, 25, 26, 27], "inclusive": false }, "INITIAL": { "rules": [0, 2, 4, 7, 12, 13, 14, 15, 16, 17, 18, 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], "inclusive": true } } + 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 renderer8 = this.defaults.renderer || new _Renderer(this.defaults); + for (const prop in pack.renderer) { + if (!(prop in renderer8)) { + 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, renderer8); + } + const prevRenderer = renderer8[rendererProp]; + renderer8[rendererProp] = (...args2) => { + let ret = rendererFunc.apply(renderer8, args2); + if (ret === false) { + ret = prevRenderer.apply(renderer8, args2); + } + return ret || ""; + }; + } + opts.renderer = renderer8; + } + 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, renderer8) { + switch (prop) { + case "heading": + return function(token2) { + if (!token2.type || token2.type !== prop) { + return func.apply(this, arguments); + } + return func.call(this, renderer8.parser.parseInline(token2.tokens), token2.depth, unescape2(renderer8.parser.parseInline(token2.tokens, renderer8.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, parser22) { + 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) => parser22(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 = parser22(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; } - return entities[name2]; - }; - 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); + }); + + // 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, " "); } - }; - const addRelationship$1 = function(entA, rolA, entB, rSpec) { - let rel = { - entityA: entA, - roleA: rolA, - entityB: entB, - relSpec: rSpec - }; - relationships.push(rel); - log$1.debug("Added new relationship :", rel); - }; - const getRelationships$1 = () => relationships; - const clear$b = function() { - entities = {}; - relationships = []; - clear$i(); - }; - const erDb = { - Cardinality, - Identification, - parseDirective: parseDirective$9, - getConfig: () => getConfig$1().er, - addEntity, - addAttributes, - getEntities, - addRelationship: addRelationship$1, - getRelationships: getRelationships$1, - clear: clear$b, - 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" - }; - const insertMarkers$2 = function(elem, conf2) { - let marker; - 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); + return withoutExtraSpaces; } - const byteToHex = []; - for (let i2 = 0; i2 < 256; ++i2) { - byteToHex.push((i2 + 256).toString(16).slice(1)); + 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" }); + } + } + __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 lines; } - 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]]).toLowerCase(); + 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 `Unsupported markdown: ${node2.type}`; + } + __name(output2, "output"); + return nodes6.map(output2).join(""); } - function parse(uuid) { - if (!validate(uuid)) { - throw TypeError("Invalid UUID"); + 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"); } - 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; + }); + + // src/rendering-util/splitText.ts + function splitTextToChars(text2) { + if (Intl.Segmenter) { + return [...new Intl.Segmenter().segment(text2)].map((s2) => s2.segment); + } + return [...text2]; + } + 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 } + ]; + } + const [nextChar, ...rest] = remainingChars; + const newWord = [...usedChars, nextChar]; + if (checkFit([{ content: newWord.join(""), type: type3 }])) { + return splitWordToFitWidthRecursion(checkFit, newWord, rest, type3); + } + if (usedChars.length === 0 && nextChar) { + usedChars.push(nextChar); + remainingChars.shift(); + } + return [ + { content: usedChars.join(""), type: type3 }, + { content: remainingChars.join(""), type: type3 } + ]; } - function stringToBytes(str2) { - str2 = unescape(encodeURIComponent(str2)); - const bytes = []; - for (let i2 = 0; i2 < str2.length; ++i2) { - bytes.push(str2.charCodeAt(i2)); + function splitLineToFitWidth(line2, checkFit) { + if (line2.some(({ content }) => content.includes("\n"))) { + throw new Error("splitLineToFitWidth does not support newlines in the line"); } - return bytes; + return splitLineToFitWidthRecursion(line2, checkFit); } - const DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; - const URL$1 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; - function v35(name2, version2, hashfunc) { - function generateUUID(value, namespace2, buf, offset) { - var _namespace; - if (typeof value === "string") { - value = stringToBytes(value); - } - 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)"); + function splitLineToFitWidthRecursion(words, checkFit, lines = [], newLine = []) { + if (words.length === 0) { + if (newLine.length > 0) { + lines.push(newLine); } - let bytes = new Uint8Array(16 + value.length); - bytes.set(namespace2); - bytes.set(value, 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]; - } - return buf; + 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); } - return unsafeStringify(bytes); } - try { - generateUUID.name = name2; - } catch (err) { + return splitLineToFitWidthRecursion(words, checkFit, lines); + } + 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"); + } + }); + + // src/rendering-util/createText.ts + function applyStyle(dom, styleFn) { + if (styleFn) { + dom.attr("style", styleFn); } - generateUUID.DNS = DNS; - generateUUID.URL = URL$1; - return generateUUID; } - 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; + 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()); + } + 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"); + } + 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 fo.node(); } - function ROTL(x2, n) { - return x2 << n | x2 >>> 32 - n; + 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 sha1(bytes) { - const K2 = [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 l = bytes.length / 4 + 2; - const N = Math.ceil(l / 16); - const M2 = 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]; + 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 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; + } + 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++; } - M2[i2] = arr; } - M2[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32); - M2[N - 1][14] = Math.floor(M2[N - 1][14]); - M2[N - 1][15] = (bytes.length - 1) * 8 & 4294967295; - for (let i2 = 0; i2 < N; ++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 a = H2[0]; - let b = H2[1]; - let c2 = H2[2]; - let d = H2[3]; - let e = H2[4]; - for (let t4 = 0; t4 < 80; ++t4) { - const s = Math.floor(t4 / 20); - const T = ROTL(a, 5) + f(s, b, c2, d) + e + K2[s] + W2[t4] >>> 0; - e = d; - d = c2; - c2 = ROTL(b, 30) >>> 0; - b = a; - a = T; - } - H2[0] = H2[0] + a >>> 0; - H2[1] = H2[1] + b >>> 0; - H2[2] = H2[2] + c2 >>> 0; - H2[3] = H2[3] + d >>> 0; - H2[4] = H2[4] + e >>> 0; + 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 [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]; } - const v5 = v35("v5", 80, sha1); - const uuid5 = v5; - const BAD_ID_CHARS_REGEXP = /[^\dA-Za-z](\W)*/g; - let conf$7 = {}; - let entityNameIds = /* @__PURE__ */ new Map(); - const setConf$6 = function(cnf) { - const keys2 = Object.keys(cnf); - for (const key of keys2) { - conf$7[key] = cnf[key]; - } - }; - const drawAttributes = (groupNode, entityTextNode, attributes) => { - const heightPadding = conf$7.entityPadding / 3; - const widthPadding = conf$7.entityPadding / 3; - const attrFontSize = conf$7.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; + 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); } }); - 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$7.minEntityWidth, - Math.max( - labelBBox.width + conf$7.entityPadding * 2, - maxWidth + widthPadding * widthPaddingFactor - ) - ), - height: attributes.length > 0 ? cumulativeHeight : Math.max(conf$7.minEntityHeight, labelBBox.height + conf$7.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 + ")" + } + 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 ); - 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 + ")" + 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 ); - 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); + 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; } - heightOffset += attributeNode.height + heightPadding * 2; - attribStyle = attribStyle === "attributeBoxOdd" ? "attributeBoxEven" : "attributeBoxOdd"; - }); - } else { - bBox.height = Math.max(conf$7.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(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$7.fontSize + "px").text(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) + " )" - ); - } - }); - }; - const getEdgeName = function(rel) { - return (rel.entityA + rel.roleA + rel.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, rel, g, insert, diagObj) { - relCnt$1++; - const edge = g.edge( - entityNameIds.get(rel.entityA), - entityNameIds.get(rel.entityB), - getEdgeName(rel) - ); - 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$7.stroke).style("fill", "none"); - if (rel.relSpec.relType === diagObj.db.Identification.NON_IDENTIFYING) { - svgPath.attr("stroke-dasharray", "8,8"); - } - let url = ""; - if (conf$7.arrowMarkerAbsolute) { - url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; - url = url.replace(/\(/g, "\\("); - url = url.replace(/\)/g, "\\)"); - } - switch (rel.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; + }, "createText"); } - switch (rel.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; + }); + + // src/dagre-wrapper/createLabel.js + function applyStyle2(dom, styleFn) { + if (styleFn) { + dom.attr("style", styleFn); } - 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$7.fontSize + "px").text(rel.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$e = function(text2, id2, _version, diagObj) { - conf$7 = getConfig$1().er; - log$1.info("Drawing ER diagram"); - const securityLevel = getConfig$1().securityLevel; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); - const svg2 = root2.select(`[id='${id2}']`); - erMarkers.insertMarkers(svg2, conf$7); - let g; - g = new Graph({ - multigraph: true, - directed: true, - compound: false - }).setGraph({ - rankdir: conf$7.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(g); - adjustEntities$1(svg2, g); - relationships2.forEach(function(rel) { - drawRelationshipFromLayout$1(svg2, rel, g, firstEntity, diagObj); - }); - const padding2 = conf$7.diagramPadding; - utils.insertTitle(svg2, "entityTitleText", conf$7.titleTopMargin, diagObj.db.getDiagramTitle()); - const svgBounds = svg2.node().getBBox(); - const width2 = svgBounds.width + padding2 * 2; - const height2 = svgBounds.height + padding2 * 2; - configureSvgSize(svg2, height2, width2, conf$7.useMaxWidth); - svg2.attr("viewBox", `${svgBounds.x - padding2} ${svgBounds.y - padding2} ${width2} ${height2}`); - }; - const MERMAID_ERDIAGRAM_UUID = "28e9f9db-3c8d-5aa5-9faf-44286ae5937c"; - function generateId(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}-` : ""; } - const erRenderer = { - setConf: setConf$6, - draw: draw$e - }; - const getStyles$c = (options2) => ` - .entityBox { - fill: ${options2.mainBkg}; - stroke: ${options2.nodeBorder}; - } - - .attributeBoxOdd { - fill: ${options2.attributeBackgroundColorOdd}; - stroke: ${options2.nodeBorder}; + 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(); } + 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; + } + }); - .attributeBoxEven { - fill: ${options2.attributeBackgroundColorEven}; - stroke: ${options2.nodeBorder}; + // src/dagre-wrapper/intersect/intersect-node.js + function intersectNode(node2, point8) { + return node2.intersect(point8); } + 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; + } + }); - .relationshipLabelBox { - fill: ${options2.tertiaryColor}; - opacity: 0.7; - background-color: ${options2.tertiaryColor}; - rect { - opacity: 0.5; - } + // 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; + } + var dy = Math.abs(rx * ry * py / det); + if (point8.y < cy) { + dy = -dy; + } + return { x: cx + dx, y: cy + dy }; } + 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; + } + }); - .relationshipLine { - stroke: ${options2.lineColor}; + // 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; } + }); - .entityTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${options2.textColor}; - } -`; - const erStyles = getStyles$c; - const diagram$e = { - parser: erParser, - db: erDb, - renderer: erRenderer, - styles: erStyles - }; - const erDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$e - }, 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, 4], $V1 = [1, 7], $V2 = [1, 5], $V3 = [1, 9], $V4 = [1, 6], $V5 = [2, 6], $V6 = [1, 16], $V7 = [6, 8, 14, 20, 22, 24, 25, 27, 29, 32, 37, 40, 50, 55], $V8 = [8, 14, 20, 22, 24, 25, 27, 29, 32, 37, 40], $V9 = [8, 13, 14, 20, 22, 24, 25, 27, 29, 32, 37, 40], $Va = [1, 26], $Vb = [6, 8, 14, 50, 55], $Vc = [8, 14, 55], $Vd = [1, 53], $Ve = [1, 52], $Vf = [8, 14, 30, 33, 35, 38, 55], $Vg = [1, 67], $Vh = [1, 68], $Vi = [1, 69], $Vj = [8, 14, 33, 35, 42, 55]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "eol": 4, "directive": 5, "GG": 6, "document": 7, "EOF": 8, ":": 9, "DIR": 10, "options": 11, "body": 12, "OPT": 13, "NL": 14, "line": 15, "statement": 16, "commitStatement": 17, "mergeStatement": 18, "cherryPickStatement": 19, "acc_title": 20, "acc_title_value": 21, "acc_descr": 22, "acc_descr_value": 23, "acc_descr_multiline_value": 24, "section": 25, "branchStatement": 26, "CHECKOUT": 27, "ref": 28, "BRANCH": 29, "ORDER": 30, "NUM": 31, "CHERRY_PICK": 32, "COMMIT_ID": 33, "STR": 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, "openDirective": 46, "typeDirective": 47, "closeDirective": 48, "argDirective": 49, "open_directive": 50, "type_directive": 51, "arg_directive": 52, "close_directive": 53, "ID": 54, ";": 55, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 6: "GG", 8: "EOF", 9: ":", 10: "DIR", 13: "OPT", 14: "NL", 20: "acc_title", 21: "acc_title_value", 22: "acc_descr", 23: "acc_descr_value", 24: "acc_descr_multiline_value", 25: "section", 27: "CHECKOUT", 29: "BRANCH", 30: "ORDER", 31: "NUM", 32: "CHERRY_PICK", 33: "COMMIT_ID", 34: "STR", 35: "COMMIT_TAG", 36: "EMPTYSTR", 37: "MERGE", 38: "COMMIT_TYPE", 40: "COMMIT", 42: "COMMIT_MSG", 43: "NORMAL", 44: "REVERSE", 45: "HIGHLIGHT", 50: "open_directive", 51: "type_directive", 52: "arg_directive", 53: "close_directive", 54: "ID", 55: ";" }, - productions_: [0, [3, 2], [3, 2], [3, 3], [3, 4], [3, 5], [7, 0], [7, 2], [11, 2], [11, 1], [12, 0], [12, 2], [15, 2], [15, 1], [16, 1], [16, 1], [16, 1], [16, 2], [16, 2], [16, 1], [16, 1], [16, 1], [16, 2], [26, 2], [26, 4], [19, 3], [19, 5], [19, 5], [19, 5], [19, 5], [18, 2], [18, 4], [18, 4], [18, 4], [18, 6], [18, 6], [18, 6], [18, 6], [18, 6], [18, 6], [18, 8], [18, 8], [18, 8], [18, 8], [18, 8], [18, 8], [17, 2], [17, 3], [17, 3], [17, 5], [17, 5], [17, 3], [17, 5], [17, 5], [17, 5], [17, 5], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 3], [17, 5], [17, 5], [17, 5], [17, 5], [17, 5], [17, 5], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [41, 0], [41, 1], [39, 1], [39, 1], [39, 1], [5, 3], [5, 5], [46, 1], [47, 1], [49, 1], [48, 1], [28, 1], [28, 1], [4, 1], [4, 1], [4, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 3: - return $$[$0]; - case 4: - return $$[$0 - 1]; - case 5: - yy.setDirection($$[$0 - 3]); - return $$[$0 - 1]; - case 7: - yy.setOptions($$[$0 - 1]); - this.$ = $$[$0]; - break; - case 8: - $$[$0 - 1] += $$[$0]; - this.$ = $$[$0 - 1]; - break; - case 10: - this.$ = []; - break; - case 11: - $$[$0 - 1].push($$[$0]); - this.$ = $$[$0 - 1]; - break; - case 12: - this.$ = $$[$0 - 1]; - break; - case 17: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 18: - case 19: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 20: - yy.addSection($$[$0].substr(8)); - this.$ = $$[$0].substr(8); - break; - case 22: - yy.checkout($$[$0]); - break; - case 23: - yy.branch($$[$0]); - break; - case 24: - yy.branch($$[$0 - 2], $$[$0]); - break; - case 25: - yy.cherryPick($$[$0], "", void 0); - break; - case 26: - yy.cherryPick($$[$0 - 2], "", $$[$0]); - break; - case 27: - case 29: - yy.cherryPick($$[$0 - 2], "", ""); - break; - case 28: - yy.cherryPick($$[$0], "", $$[$0 - 2]); - break; - case 30: - yy.merge($$[$0], "", "", ""); - break; - case 31: - yy.merge($$[$0 - 2], $$[$0], "", ""); - break; - case 32: - yy.merge($$[$0 - 2], "", $$[$0], ""); - break; - case 33: - yy.merge($$[$0 - 2], "", "", $$[$0]); - break; - case 34: - yy.merge($$[$0 - 4], $$[$0], "", $$[$0 - 2]); - break; - case 35: - yy.merge($$[$0 - 4], "", $$[$0], $$[$0 - 2]); - break; - case 36: - yy.merge($$[$0 - 4], "", $$[$0 - 2], $$[$0]); - break; - case 37: - yy.merge($$[$0 - 4], $$[$0 - 2], $$[$0], ""); - break; - case 38: - yy.merge($$[$0 - 4], $$[$0 - 2], "", $$[$0]); - break; - case 39: - yy.merge($$[$0 - 4], $$[$0], $$[$0 - 2], ""); - break; - case 40: - yy.merge($$[$0 - 6], $$[$0 - 4], $$[$0 - 2], $$[$0]); - break; - case 41: - yy.merge($$[$0 - 6], $$[$0], $$[$0 - 4], $$[$0 - 2]); - break; - case 42: - yy.merge($$[$0 - 6], $$[$0 - 4], $$[$0], $$[$0 - 2]); - break; - case 43: - yy.merge($$[$0 - 6], $$[$0 - 2], $$[$0 - 4], $$[$0]); - break; - case 44: - yy.merge($$[$0 - 6], $$[$0], $$[$0 - 2], $$[$0 - 4]); - break; - case 45: - yy.merge($$[$0 - 6], $$[$0 - 2], $$[$0], $$[$0 - 4]); - break; - case 46: - yy.commit($$[$0]); - break; - case 47: - yy.commit("", "", yy.commitType.NORMAL, $$[$0]); - break; - case 48: - yy.commit("", "", $$[$0], ""); - break; - case 49: - yy.commit("", "", $$[$0], $$[$0 - 2]); - break; - case 50: - yy.commit("", "", $$[$0 - 2], $$[$0]); - break; - case 51: - yy.commit("", $$[$0], yy.commitType.NORMAL, ""); - break; - case 52: - yy.commit("", $$[$0 - 2], yy.commitType.NORMAL, $$[$0]); - break; - case 53: - yy.commit("", $$[$0], yy.commitType.NORMAL, $$[$0 - 2]); - break; - case 54: - yy.commit("", $$[$0 - 2], $$[$0], ""); - break; - case 55: - yy.commit("", $$[$0], $$[$0 - 2], ""); - break; - case 56: - yy.commit("", $$[$0 - 4], $$[$0 - 2], $$[$0]); - break; - case 57: - yy.commit("", $$[$0 - 4], $$[$0], $$[$0 - 2]); - break; - case 58: - yy.commit("", $$[$0 - 2], $$[$0 - 4], $$[$0]); - break; - case 59: - yy.commit("", $$[$0], $$[$0 - 4], $$[$0 - 2]); - break; - case 60: - yy.commit("", $$[$0], $$[$0 - 2], $$[$0 - 4]); - break; - case 61: - yy.commit("", $$[$0 - 2], $$[$0], $$[$0 - 4]); - break; - case 62: - yy.commit($$[$0], "", yy.commitType.NORMAL, ""); - break; - case 63: - yy.commit($$[$0], "", yy.commitType.NORMAL, $$[$0 - 2]); - break; - case 64: - yy.commit($$[$0 - 2], "", yy.commitType.NORMAL, $$[$0]); - break; - case 65: - yy.commit($$[$0 - 2], "", $$[$0], ""); - break; - case 66: - yy.commit($$[$0], "", $$[$0 - 2], ""); - break; - case 67: - yy.commit($$[$0], $$[$0 - 2], yy.commitType.NORMAL, ""); - break; - case 68: - yy.commit($$[$0 - 2], $$[$0], yy.commitType.NORMAL, ""); - break; - case 69: - yy.commit($$[$0 - 4], "", $$[$0 - 2], $$[$0]); - break; - case 70: - yy.commit($$[$0 - 4], "", $$[$0], $$[$0 - 2]); - break; - case 71: - yy.commit($$[$0 - 2], "", $$[$0 - 4], $$[$0]); - break; - case 72: - yy.commit($$[$0], "", $$[$0 - 4], $$[$0 - 2]); - break; - case 73: - yy.commit($$[$0], "", $$[$0 - 2], $$[$0 - 4]); - break; - case 74: - yy.commit($$[$0 - 2], "", $$[$0], $$[$0 - 4]); - break; - case 75: - yy.commit($$[$0 - 4], $$[$0], $$[$0 - 2], ""); - break; - case 76: - yy.commit($$[$0 - 4], $$[$0 - 2], $$[$0], ""); - break; - case 77: - yy.commit($$[$0 - 2], $$[$0], $$[$0 - 4], ""); - break; - case 78: - yy.commit($$[$0], $$[$0 - 2], $$[$0 - 4], ""); - break; - case 79: - yy.commit($$[$0], $$[$0 - 4], $$[$0 - 2], ""); - break; - case 80: - yy.commit($$[$0 - 2], $$[$0 - 4], $$[$0], ""); - break; - case 81: - yy.commit($$[$0 - 4], $$[$0], yy.commitType.NORMAL, $$[$0 - 2]); - break; - case 82: - yy.commit($$[$0 - 4], $$[$0 - 2], yy.commitType.NORMAL, $$[$0]); - break; - case 83: - yy.commit($$[$0 - 2], $$[$0], yy.commitType.NORMAL, $$[$0 - 4]); - break; - case 84: - yy.commit($$[$0], $$[$0 - 2], yy.commitType.NORMAL, $$[$0 - 4]); - break; - case 85: - yy.commit($$[$0], $$[$0 - 4], yy.commitType.NORMAL, $$[$0 - 2]); - break; - case 86: - yy.commit($$[$0 - 2], $$[$0 - 4], yy.commitType.NORMAL, $$[$0]); - break; - case 87: - yy.commit($$[$0 - 6], $$[$0 - 4], $$[$0 - 2], $$[$0]); - break; - case 88: - yy.commit($$[$0 - 6], $$[$0 - 4], $$[$0], $$[$0 - 2]); - break; - case 89: - yy.commit($$[$0 - 6], $$[$0 - 2], $$[$0 - 4], $$[$0]); - break; - case 90: - yy.commit($$[$0 - 6], $$[$0], $$[$0 - 4], $$[$0 - 2]); - break; - case 91: - yy.commit($$[$0 - 6], $$[$0 - 2], $$[$0], $$[$0 - 4]); - break; - case 92: - yy.commit($$[$0 - 6], $$[$0], $$[$0 - 2], $$[$0 - 4]); - break; - case 93: - yy.commit($$[$0 - 4], $$[$0 - 6], $$[$0 - 2], $$[$0]); - break; - case 94: - yy.commit($$[$0 - 4], $$[$0 - 6], $$[$0], $$[$0 - 2]); - break; - case 95: - yy.commit($$[$0 - 2], $$[$0 - 6], $$[$0 - 4], $$[$0]); - break; - case 96: - yy.commit($$[$0], $$[$0 - 6], $$[$0 - 4], $$[$0 - 2]); - break; - case 97: - yy.commit($$[$0 - 2], $$[$0 - 6], $$[$0], $$[$0 - 4]); - break; - case 98: - yy.commit($$[$0], $$[$0 - 6], $$[$0 - 2], $$[$0 - 4]); - break; - case 99: - yy.commit($$[$0], $$[$0 - 4], $$[$0 - 2], $$[$0 - 6]); - break; - case 100: - yy.commit($$[$0 - 2], $$[$0 - 4], $$[$0], $$[$0 - 6]); - break; - case 101: - yy.commit($$[$0], $$[$0 - 2], $$[$0 - 4], $$[$0 - 6]); - break; - case 102: - yy.commit($$[$0 - 2], $$[$0], $$[$0 - 4], $$[$0 - 6]); - break; - case 103: - yy.commit($$[$0 - 4], $$[$0 - 2], $$[$0], $$[$0 - 6]); - break; - case 104: - yy.commit($$[$0 - 4], $$[$0], $$[$0 - 2], $$[$0 - 6]); - break; - case 105: - yy.commit($$[$0 - 2], $$[$0 - 4], $$[$0 - 6], $$[$0]); - break; - case 106: - yy.commit($$[$0], $$[$0 - 4], $$[$0 - 6], $$[$0 - 2]); - break; - case 107: - yy.commit($$[$0 - 2], $$[$0], $$[$0 - 6], $$[$0 - 4]); - break; - case 108: - yy.commit($$[$0], $$[$0 - 2], $$[$0 - 6], $$[$0 - 4]); - break; - case 109: - yy.commit($$[$0 - 4], $$[$0 - 2], $$[$0 - 6], $$[$0]); - break; - case 110: - yy.commit($$[$0 - 4], $$[$0], $$[$0 - 6], $$[$0 - 2]); - break; - case 111: - this.$ = ""; - break; - case 112: - this.$ = $$[$0]; - break; - case 113: - this.$ = yy.commitType.NORMAL; - break; - case 114: - this.$ = yy.commitType.REVERSE; - break; - case 115: - this.$ = yy.commitType.HIGHLIGHT; - break; - case 118: - yy.parseDirective("%%{", "open_directive"); - break; - case 119: - yy.parseDirective($$[$0], "type_directive"); - break; - case 120: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); - yy.parseDirective($$[$0], "arg_directive"); - break; - case 121: - yy.parseDirective("}%%", "close_directive", "gitGraph"); - break; - } - }, - table: [{ 3: 1, 4: 2, 5: 3, 6: $V0, 8: $V1, 14: $V2, 46: 8, 50: $V3, 55: $V4 }, { 1: [3] }, { 3: 10, 4: 2, 5: 3, 6: $V0, 8: $V1, 14: $V2, 46: 8, 50: $V3, 55: $V4 }, { 3: 11, 4: 2, 5: 3, 6: $V0, 8: $V1, 14: $V2, 46: 8, 50: $V3, 55: $V4 }, { 7: 12, 8: $V5, 9: [1, 13], 10: [1, 14], 11: 15, 14: $V6 }, o($V7, [2, 124]), o($V7, [2, 125]), o($V7, [2, 126]), { 47: 17, 51: [1, 18] }, { 51: [2, 118] }, { 1: [2, 1] }, { 1: [2, 2] }, { 8: [1, 19] }, { 7: 20, 8: $V5, 11: 15, 14: $V6 }, { 9: [1, 21] }, o($V8, [2, 10], { 12: 22, 13: [1, 23] }), o($V9, [2, 9]), { 9: [1, 25], 48: 24, 53: $Va }, o([9, 53], [2, 119]), { 1: [2, 3] }, { 8: [1, 27] }, { 7: 28, 8: $V5, 11: 15, 14: $V6 }, { 8: [2, 7], 14: [1, 31], 15: 29, 16: 30, 17: 32, 18: 33, 19: 34, 20: [1, 35], 22: [1, 36], 24: [1, 37], 25: [1, 38], 26: 39, 27: [1, 40], 29: [1, 44], 32: [1, 43], 37: [1, 42], 40: [1, 41] }, o($V9, [2, 8]), o($Vb, [2, 116]), { 49: 45, 52: [1, 46] }, o($Vb, [2, 121]), { 1: [2, 4] }, { 8: [1, 47] }, o($V8, [2, 11]), { 4: 48, 8: $V1, 14: $V2, 55: $V4 }, o($V8, [2, 13]), o($Vc, [2, 14]), o($Vc, [2, 15]), o($Vc, [2, 16]), { 21: [1, 49] }, { 23: [1, 50] }, o($Vc, [2, 19]), o($Vc, [2, 20]), o($Vc, [2, 21]), { 28: 51, 34: $Vd, 54: $Ve }, o($Vc, [2, 111], { 41: 54, 33: [1, 57], 34: [1, 59], 35: [1, 55], 38: [1, 56], 42: [1, 58] }), { 28: 60, 34: $Vd, 54: $Ve }, { 33: [1, 61], 35: [1, 62] }, { 28: 63, 34: $Vd, 54: $Ve }, { 48: 64, 53: $Va }, { 53: [2, 120] }, { 1: [2, 5] }, o($V8, [2, 12]), o($Vc, [2, 17]), o($Vc, [2, 18]), o($Vc, [2, 22]), o($Vf, [2, 122]), o($Vf, [2, 123]), o($Vc, [2, 46]), { 34: [1, 65] }, { 39: 66, 43: $Vg, 44: $Vh, 45: $Vi }, { 34: [1, 70] }, { 34: [1, 71] }, o($Vc, [2, 112]), o($Vc, [2, 30], { 33: [1, 72], 35: [1, 74], 38: [1, 73] }), { 34: [1, 75] }, { 34: [1, 76], 36: [1, 77] }, o($Vc, [2, 23], { 30: [1, 78] }), o($Vb, [2, 117]), o($Vc, [2, 47], { 33: [1, 80], 38: [1, 79], 42: [1, 81] }), o($Vc, [2, 48], { 33: [1, 83], 35: [1, 82], 42: [1, 84] }), o($Vj, [2, 113]), o($Vj, [2, 114]), o($Vj, [2, 115]), o($Vc, [2, 51], { 35: [1, 85], 38: [1, 86], 42: [1, 87] }), o($Vc, [2, 62], { 33: [1, 90], 35: [1, 88], 38: [1, 89] }), { 34: [1, 91] }, { 39: 92, 43: $Vg, 44: $Vh, 45: $Vi }, { 34: [1, 93] }, o($Vc, [2, 25], { 35: [1, 94] }), { 33: [1, 95] }, { 33: [1, 96] }, { 31: [1, 97] }, { 39: 98, 43: $Vg, 44: $Vh, 45: $Vi }, { 34: [1, 99] }, { 34: [1, 100] }, { 34: [1, 101] }, { 34: [1, 102] }, { 34: [1, 103] }, { 34: [1, 104] }, { 39: 105, 43: $Vg, 44: $Vh, 45: $Vi }, { 34: [1, 106] }, { 34: [1, 107] }, { 39: 108, 43: $Vg, 44: $Vh, 45: $Vi }, { 34: [1, 109] }, o($Vc, [2, 31], { 35: [1, 111], 38: [1, 110] }), o($Vc, [2, 32], { 33: [1, 113], 35: [1, 112] }), o($Vc, [2, 33], { 33: [1, 114], 38: [1, 115] }), { 34: [1, 116], 36: [1, 117] }, { 34: [1, 118] }, { 34: [1, 119] }, o($Vc, [2, 24]), o($Vc, [2, 49], { 33: [1, 120], 42: [1, 121] }), o($Vc, [2, 53], { 38: [1, 122], 42: [1, 123] }), o($Vc, [2, 63], { 33: [1, 125], 38: [1, 124] }), o($Vc, [2, 50], { 33: [1, 126], 42: [1, 127] }), o($Vc, [2, 55], { 35: [1, 128], 42: [1, 129] }), o($Vc, [2, 66], { 33: [1, 131], 35: [1, 130] }), o($Vc, [2, 52], { 38: [1, 132], 42: [1, 133] }), o($Vc, [2, 54], { 35: [1, 134], 42: [1, 135] }), o($Vc, [2, 67], { 35: [1, 137], 38: [1, 136] }), o($Vc, [2, 64], { 33: [1, 139], 38: [1, 138] }), o($Vc, [2, 65], { 33: [1, 141], 35: [1, 140] }), o($Vc, [2, 68], { 35: [1, 143], 38: [1, 142] }), { 39: 144, 43: $Vg, 44: $Vh, 45: $Vi }, { 34: [1, 145] }, { 34: [1, 146] }, { 34: [1, 147] }, { 34: [1, 148] }, { 39: 149, 43: $Vg, 44: $Vh, 45: $Vi }, o($Vc, [2, 26]), o($Vc, [2, 27]), o($Vc, [2, 28]), o($Vc, [2, 29]), { 34: [1, 150] }, { 34: [1, 151] }, { 39: 152, 43: $Vg, 44: $Vh, 45: $Vi }, { 34: [1, 153] }, { 39: 154, 43: $Vg, 44: $Vh, 45: $Vi }, { 34: [1, 155] }, { 34: [1, 156] }, { 34: [1, 157] }, { 34: [1, 158] }, { 34: [1, 159] }, { 34: [1, 160] }, { 34: [1, 161] }, { 39: 162, 43: $Vg, 44: $Vh, 45: $Vi }, { 34: [1, 163] }, { 34: [1, 164] }, { 34: [1, 165] }, { 39: 166, 43: $Vg, 44: $Vh, 45: $Vi }, { 34: [1, 167] }, { 39: 168, 43: $Vg, 44: $Vh, 45: $Vi }, { 34: [1, 169] }, { 34: [1, 170] }, { 34: [1, 171] }, { 39: 172, 43: $Vg, 44: $Vh, 45: $Vi }, { 34: [1, 173] }, o($Vc, [2, 37], { 35: [1, 174] }), o($Vc, [2, 38], { 38: [1, 175] }), o($Vc, [2, 36], { 33: [1, 176] }), o($Vc, [2, 39], { 35: [1, 177] }), o($Vc, [2, 34], { 38: [1, 178] }), o($Vc, [2, 35], { 33: [1, 179] }), o($Vc, [2, 60], { 42: [1, 180] }), o($Vc, [2, 73], { 33: [1, 181] }), o($Vc, [2, 61], { 42: [1, 182] }), o($Vc, [2, 84], { 38: [1, 183] }), o($Vc, [2, 74], { 33: [1, 184] }), o($Vc, [2, 83], { 38: [1, 185] }), o($Vc, [2, 59], { 42: [1, 186] }), o($Vc, [2, 72], { 33: [1, 187] }), o($Vc, [2, 58], { 42: [1, 188] }), o($Vc, [2, 78], { 35: [1, 189] }), o($Vc, [2, 71], { 33: [1, 190] }), o($Vc, [2, 77], { 35: [1, 191] }), o($Vc, [2, 57], { 42: [1, 192] }), o($Vc, [2, 85], { 38: [1, 193] }), o($Vc, [2, 56], { 42: [1, 194] }), o($Vc, [2, 79], { 35: [1, 195] }), o($Vc, [2, 80], { 35: [1, 196] }), o($Vc, [2, 86], { 38: [1, 197] }), o($Vc, [2, 70], { 33: [1, 198] }), o($Vc, [2, 81], { 38: [1, 199] }), o($Vc, [2, 69], { 33: [1, 200] }), o($Vc, [2, 75], { 35: [1, 201] }), o($Vc, [2, 76], { 35: [1, 202] }), o($Vc, [2, 82], { 38: [1, 203] }), { 34: [1, 204] }, { 39: 205, 43: $Vg, 44: $Vh, 45: $Vi }, { 34: [1, 206] }, { 34: [1, 207] }, { 39: 208, 43: $Vg, 44: $Vh, 45: $Vi }, { 34: [1, 209] }, { 34: [1, 210] }, { 34: [1, 211] }, { 34: [1, 212] }, { 39: 213, 43: $Vg, 44: $Vh, 45: $Vi }, { 34: [1, 214] }, { 39: 215, 43: $Vg, 44: $Vh, 45: $Vi }, { 34: [1, 216] }, { 34: [1, 217] }, { 34: [1, 218] }, { 34: [1, 219] }, { 34: [1, 220] }, { 34: [1, 221] }, { 34: [1, 222] }, { 39: 223, 43: $Vg, 44: $Vh, 45: $Vi }, { 34: [1, 224] }, { 34: [1, 225] }, { 34: [1, 226] }, { 39: 227, 43: $Vg, 44: $Vh, 45: $Vi }, { 34: [1, 228] }, { 39: 229, 43: $Vg, 44: $Vh, 45: $Vi }, { 34: [1, 230] }, { 34: [1, 231] }, { 34: [1, 232] }, { 39: 233, 43: $Vg, 44: $Vh, 45: $Vi }, o($Vc, [2, 40]), o($Vc, [2, 42]), o($Vc, [2, 41]), o($Vc, [2, 43]), o($Vc, [2, 45]), o($Vc, [2, 44]), o($Vc, [2, 101]), o($Vc, [2, 102]), o($Vc, [2, 99]), o($Vc, [2, 100]), o($Vc, [2, 104]), o($Vc, [2, 103]), o($Vc, [2, 108]), o($Vc, [2, 107]), o($Vc, [2, 106]), o($Vc, [2, 105]), o($Vc, [2, 110]), o($Vc, [2, 109]), o($Vc, [2, 98]), o($Vc, [2, 97]), o($Vc, [2, 96]), o($Vc, [2, 95]), o($Vc, [2, 93]), o($Vc, [2, 94]), o($Vc, [2, 92]), o($Vc, [2, 91]), o($Vc, [2, 90]), o($Vc, [2, 89]), o($Vc, [2, 87]), o($Vc, [2, 88])], - defaultActions: { 9: [2, 118], 10: [2, 1], 11: [2, 2], 19: [2, 3], 27: [2, 4], 46: [2, 120], 47: [2, 5] }, - parseError: function parseError2(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 parseError2(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 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; - }, - // unshifts one char (or a string) into the input - unput: 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 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, 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 && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = 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[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 - }); - } - }, - // 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 50; - case 1: - this.begin("type_directive"); - return 51; - case 2: - this.popState(); - this.begin("arg_directive"); - return 9; - case 3: - this.popState(); - this.popState(); - return 53; - case 4: - return 52; - case 5: - this.begin("acc_title"); - return 20; - case 6: - this.popState(); - return "acc_title_value"; - case 7: - this.begin("acc_descr"); - return 22; - case 8: - this.popState(); - return "acc_descr_value"; - case 9: - this.begin("acc_descr_multiline"); - break; - case 10: - this.popState(); - break; - case 11: - return "acc_descr_multiline_value"; - case 12: - return 14; - case 13: - break; - case 14: - break; - case 15: - return 6; - case 16: - return 40; - case 17: - return 33; - case 18: - return 38; - case 19: - return 42; - case 20: - return 43; - case 21: - return 44; - case 22: - return 45; - case 23: - return 35; - case 24: - return 29; - case 25: - return 30; - case 26: - return 37; - case 27: - return 32; - case 28: - return 27; - case 29: - return 10; - case 30: - return 10; - case 31: - return 9; - case 32: - return "CARET"; - case 33: - this.begin("options"); - break; - case 34: - this.popState(); - break; - case 35: - return 13; - case 36: - return 36; - case 37: - this.begin("string"); - break; - case 38: - this.popState(); - break; - case 39: - return 34; - case 40: - return 31; - case 41: - return 54; - case 42: - return 8; - } - }, - rules: [/^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\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, /^(?:#[^\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, /^(?:checkout(?=\s|$))/i, /^(?:LR\b)/i, /^(?:BT\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": [10, 11], "inclusive": false }, "acc_descr": { "rules": [8], "inclusive": false }, "acc_title": { "rules": [6], "inclusive": false }, "close_directive": { "rules": [], "inclusive": false }, "arg_directive": { "rules": [3, 4], "inclusive": false }, "type_directive": { "rules": [2, 3], "inclusive": false }, "open_directive": { "rules": [1], "inclusive": false }, "options": { "rules": [34, 35], "inclusive": false }, "string": { "rules": [38, 39], "inclusive": false }, "INITIAL": { "rules": [0, 5, 7, 9, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 36, 37, 40, 41, 42, 43], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser() { - this.yy = {}; - } - Parser.prototype = parser2; - parser2.Parser = Parser; - return new Parser(); - }(); - parser$i.parser = parser$i; - const gitGraphParser = parser$i; - 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 }); + // 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; + } + 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; + } + 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 }; } - const parseDirective$8 = function(statement, context, type2) { - mermaidAPI.parseDirective(this, statement, context, type2); - }; - function uniqBy(list, fn) { - const recordMap = /* @__PURE__ */ Object.create(null); - return list.reduce((out, item) => { - const key = fn(item); - if (!recordMap[key]) { - recordMap[key] = true; - out.push(item); - } - return out; - }, []); + function sameSign(r1, r2) { + return r1 * r2 > 0; } - const setDirection$2 = function(dir) { - direction$2 = dir; - }; - 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); + 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; } - }; - 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(name2, order2) { - name2 = common$1.sanitizeText(name2, getConfig$1()); - if (branches[name2] === void 0) { - branches[name2] = head != null ? head.id : null; - branchesConfig[name2] = { name: name2, order: order2 ? parseInt(order2, 10) : null }; - checkout(name2); - log$1.debug("in createBranch"); + }); + + // 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 { - 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 ' + name2 + '")' - ); - error.hash = { - text: "branch " + name2, - token: "branch " + name2, - line: "1", - loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, - expected: ['"checkout ' + name2 + '"'] - }; - throw error; + minX = Math.min(minX, polyPoints.x); + minY = Math.min(minY, polyPoints.y); } - }; - 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 - ] - }; - 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) { - 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()); - 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 (sourceCommit.type === commitType$1.MERGE) { - let error = new Error( - 'Incorrect usage of "cherryPick". Source commit should not be a merge commit' + 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 } ); - 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; - } - 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; + if (intersect3) { + intersections.push(intersect3); } - 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 - }; - 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]; + if (!intersections.length) { + return node2; } - }; - function upsert(arr, key, newVal) { - const index = arr.indexOf(key); - if (index === -1) { - arr.push(newVal); - } else { - arr.splice(index, 1, newVal); + 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; + }); } + return intersections[0]; } - 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); - } + 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"); } - 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); + }); + + // 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; + } + sx = w3; + sy = dx === 0 ? 0 : w3 * dy / dx; + } + return { x: x5 + sx, y: y5 + sy }; + }, "intersectRect"); + intersect_rect_default = intersectRect; } - commitArr = uniqBy(commitArr, (c2) => c2.id); - prettyPrintCommitHistory(commitArr); - } - const prettyPrint = function() { - log$1.debug(commits); - const node2 = getCommitsArray()[0]; - prettyPrintCommitHistory([node2]); - }; - const clear$a = 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$i(); - }; - const getBranchesAsObjArray = function() { - const branchesArray = Object.values(branchesConfig).map((branchConfig, i2) => { - if (branchConfig.order !== null) { - return branchConfig; - } - return { - ...branchConfig, - order: parseFloat(`0.${i2}`, 10) + }); + + // 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 }; - }).sort((a, b) => a.order - b.order).map(({ name: name2 }) => ({ name: name2 })); - 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 = { - parseDirective: parseDirective$8, - getConfig: () => getConfig$1().gitGraph, - setDirection: setDirection$2, - setOptions, - getOptions, - commit, - branch, - merge, - cherryPick, - checkout, - //reset, - prettyPrint, - clear: clear$a, - 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; - const clear$9 = () => { - branchPos = {}; - commitPos = {}; - allCommitsDict = {}; - maxPos = 0; - lanes = []; - }; - 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 drawCommits = (svg2, commits2, modifyGraph) => { - const gitGraphConfig = getConfig().gitGraph; - const gBullets = svg2.append("g").attr("class", "commit-bullets"); - const gLabels = svg2.append("g").attr("class", "commit-labels"); - let pos = 0; - const keys2 = Object.keys(commits2); - const sortedKeys = keys2.sort((a, b) => { - return commits2[a].seq - commits2[b].seq; - }); - sortedKeys.forEach((key) => { - const commit2 = commits2[key]; - const y2 = branchPos[commit2.branch].pos; - const x2 = pos + 10; - 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"; - break; - case commitType.HIGHLIGHT: - typeClass = "commit-highlight"; - break; - case commitType.MERGE: - typeClass = "commit-merge"; - break; - case commitType.CHERRY_PICK: - typeClass = "commit-cherry-pick"; - break; - default: - typeClass = "commit-normal"; + } + }); + + // 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; } - 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` + 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 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}` + text2 = textNode.appendChild( + createLabel_default(sanitizeText(decodeEntities(labelText), config6), node2.labelStyle, false, isNode2) ); - 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}` - ); - } } - } - commitPos[commit2.id] = { x: pos + 10, 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 wrapper2 = gLabels.append("g"); - const labelBkg = wrapper2.insert("rect").attr("class", "commit-label-bkg"); - const text2 = wrapper2.append("text").attr("x", pos).attr("y", y2 + 25).attr("class", "commit-label").text(commit2.id); - let bbox = text2.node().getBBox(); - labelBkg.attr("x", pos + 10 - bbox.width / 2 - py).attr("y", y2 + 13.5).attr("width", bbox.width + 2 * py).attr("height", bbox.height + 2 * py); - text2.attr("x", pos + 10 - bbox.width / 2); - if (gitGraphConfig.rotateCommitLabel) { - let r_x = -7.5 - (bbox.width + 10) / 25 * 9.5; - let r_y = 10 + bbox.width / 25 * 8.5; - wrapper2.attr( - "transform", - "translate(" + r_x + ", " + r_y + ") rotate(-45, " + pos + ", " + y2 + ")" + 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); } - 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", pos + 10 - 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} - ${pos + 10 - tagBbox.width / 2 - px},${ly - h2 - py} - ${pos + 10 + tagBbox.width / 2 + px},${ly - h2 - py} - ${pos + 10 + tagBbox.width / 2 + px},${ly + h2 + py} - ${pos + 10 - 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 (useHtmlLabels) { + label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")"); + } else { + label.attr("transform", "translate(0, " + -bbox.height / 2 + ")"); } - } - pos += 50; - if (pos > maxPos) { - maxPos = pos; - } - }); - }; - const hasOverlappingCommits = (commit1, commit2, allCommits) => { - const keys2 = Object.keys(allCommits); - const overlappingComits = keys2.filter((key) => { - return allCommits[key].branch === commit2.branch && allCommits[key].seq > commit1.seq && allCommits[key].seq < commit2.seq; - }); - return overlappingComits.length > 0; - }; - 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, commit1, commit2, allCommits) => { - const p1 = commitPos[commit1.id]; - const p2 = commitPos[commit2.id]; - const overlappingCommits = hasOverlappingCommits(commit1, commit2, allCommits); - let arc = ""; - let arc2 = ""; - let radius = 0; - let offset = 0; - let colorClassNum = branchPos[commit2.branch].index; - let lineDef; - if (overlappingCommits) { - arc = "A 10 10, 0, 0, 0,"; - arc2 = "A 10 10, 0, 0, 1,"; - radius = 10; - offset = 10; - colorClassNum = branchPos[commit2.branch].index; - const lineY = p1.y < p2.y ? findLane(p1.y, p2.y) : findLane(p2.y, p1.y); - 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}`; - } else { - 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}`; - } - } else { - if (p1.y < p2.y) { - arc = "A 20 20, 0, 0, 0,"; - radius = 20; - offset = 20; - colorClassNum = branchPos[commit2.branch].index; - 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) { - arc = "A 20 20, 0, 0, 0,"; - radius = 20; - offset = 20; - colorClassNum = branchPos[commit1.branch].index; - lineDef = `M ${p1.x} ${p1.y} L ${p2.x - radius} ${p1.y} ${arc} ${p2.x} ${p1.y - offset} L ${p2.x} ${p2.y}`; - } - if (p1.y === p2.y) { - colorClassNum = branchPos[commit1.branch].index; - lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${p2.y - radius} ${arc} ${p1.x + offset} ${p2.y} L ${p2.x} ${p2.y}`; - } - } - 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); - }); - } - }); - }; - const drawBranches = (svg2, branches2) => { - const gitGraphConfig = getConfig().gitGraph; - const g = svg2.append("g"); - branches2.forEach((branch2, index) => { - const adjustIndexForTheme = index % 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); - lanes.push(pos); - let name2 = branch2.name; - const labelElement = drawText$3(name2); - 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) + ")" - ); - bkg.attr("transform", "translate(-19, " + (pos - bbox.height / 2) + ")"); - }); - }; - const draw$d = function(txt, id2, ver, diagObj) { - clear$9(); - const conf2 = getConfig(); - const gitGraphConfig = conf2.gitGraph; - log$1.debug("in gitgraph renderer", txt + "\n", "id:", id2, ver); - allCommitsDict = diagObj.db.getCommits(); - const branches2 = diagObj.db.getBranchesAsObjArray(); - let pos = 0; - branches2.forEach((branch2, index) => { - branchPos[branch2.name] = { pos, index }; - pos += 50 + (gitGraphConfig.rotateCommitLabel ? 40 : 0); - }); - const diagram2 = select(`[id="${id2}"]`); - drawCommits(diagram2, allCommitsDict, false); - if (gitGraphConfig.showBranches) { - drawBranches(diagram2, branches2); - } - drawArrows(diagram2, allCommitsDict); - drawCommits(diagram2, allCommitsDict, true); - utils.insertTitle( - diagram2, - "gitTitleText", - gitGraphConfig.titleTopMargin, - diagObj.db.getDiagramTitle() - ); - setupGraphViewbox( - void 0, - diagram2, - gitGraphConfig.diagramPadding, - gitGraphConfig.useMaxWidth ?? conf2.useMaxWidth - ); - }; - const gitGraphRenderer = { - draw: draw$d - }; - 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")} - - .branch { - stroke-width: 1; - stroke: ${options2.lineColor}; - stroke-dasharray: 2; - } - .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}; } + 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"); + } + }); - .commit-merge { - stroke: ${options2.primaryColor}; - fill: ${options2.primaryColor}; - } - .commit-reverse { - stroke: ${options2.primaryColor}; - fill: ${options2.primaryColor}; - stroke-width: 3; - } - .commit-highlight-outer { - } - .commit-highlight-inner { - stroke: ${options2.primaryColor}; - fill: ${options2.primaryColor}; - } + // 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; + } + }); - .arrow { stroke-width: 8; stroke-linecap: round; fill: none} - .gitTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${options2.textColor}; - } -`; - const gitGraphStyles = getStyles$b; - const diagram$d = { - parser: gitGraphParser, - db: gitGraphDb, - renderer: gitGraphRenderer, - styles: gitGraphStyles - }; - const gitGraphDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$d - }, Symbol.toStringTag, { value: "Module" })); - var parser$h = 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, 5], $V2 = [7, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 25, 26, 28, 35, 40], $V3 = [1, 15], $V4 = [1, 16], $V5 = [1, 17], $V6 = [1, 18], $V7 = [1, 19], $V8 = [1, 20], $V9 = [1, 21], $Va = [1, 22], $Vb = [1, 23], $Vc = [1, 24], $Vd = [1, 25], $Ve = [1, 26], $Vf = [1, 27], $Vg = [1, 29], $Vh = [1, 31], $Vi = [1, 34], $Vj = [5, 7, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 25, 26, 28, 35, 40]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "directive": 4, "gantt": 5, "document": 6, "EOF": 7, "line": 8, "SPACE": 9, "statement": 10, "NL": 11, "dateFormat": 12, "inclusiveEndDates": 13, "topAxis": 14, "axisFormat": 15, "tickInterval": 16, "excludes": 17, "includes": 18, "todayMarker": 19, "title": 20, "acc_title": 21, "acc_title_value": 22, "acc_descr": 23, "acc_descr_value": 24, "acc_descr_multiline_value": 25, "section": 26, "clickStatement": 27, "taskTxt": 28, "taskData": 29, "openDirective": 30, "typeDirective": 31, "closeDirective": 32, ":": 33, "argDirective": 34, "click": 35, "callbackname": 36, "callbackargs": 37, "href": 38, "clickStatementDebug": 39, "open_directive": 40, "type_directive": 41, "arg_directive": 42, "close_directive": 43, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 5: "gantt", 7: "EOF", 9: "SPACE", 11: "NL", 12: "dateFormat", 13: "inclusiveEndDates", 14: "topAxis", 15: "axisFormat", 16: "tickInterval", 17: "excludes", 18: "includes", 19: "todayMarker", 20: "title", 21: "acc_title", 22: "acc_title_value", 23: "acc_descr", 24: "acc_descr_value", 25: "acc_descr_multiline_value", 26: "section", 28: "taskTxt", 29: "taskData", 33: ":", 35: "click", 36: "callbackname", 37: "callbackargs", 38: "href", 40: "open_directive", 41: "type_directive", 42: "arg_directive", 43: "close_directive" }, - productions_: [0, [3, 2], [3, 3], [6, 0], [6, 2], [8, 2], [8, 1], [8, 1], [8, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [10, 1], [10, 1], [10, 1], [10, 2], [10, 1], [4, 4], [4, 6], [27, 2], [27, 3], [27, 3], [27, 4], [27, 3], [27, 4], [27, 2], [39, 2], [39, 3], [39, 3], [39, 4], [39, 3], [39, 4], [39, 2], [30, 1], [31, 1], [34, 1], [32, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 2: - return $$[$0 - 1]; - case 3: - this.$ = []; - break; - case 4: - $$[$0 - 1].push($$[$0]); - this.$ = $$[$0 - 1]; - break; - case 5: - case 6: - this.$ = $$[$0]; - break; - case 7: - case 8: - this.$ = []; - break; - case 9: - yy.setDateFormat($$[$0].substr(11)); - this.$ = $$[$0].substr(11); - break; - case 10: - yy.enableInclusiveEndDates(); - this.$ = $$[$0].substr(18); - break; - case 11: - yy.TopAxis(); - this.$ = $$[$0].substr(8); - break; - case 12: - yy.setAxisFormat($$[$0].substr(11)); - this.$ = $$[$0].substr(11); - break; - case 13: - yy.setTickInterval($$[$0].substr(13)); - this.$ = $$[$0].substr(13); - break; - case 14: - yy.setExcludes($$[$0].substr(9)); - this.$ = $$[$0].substr(9); - break; - case 15: - yy.setIncludes($$[$0].substr(9)); - this.$ = $$[$0].substr(9); - break; - case 16: - yy.setTodayMarker($$[$0].substr(12)); - this.$ = $$[$0].substr(12); - break; - case 17: - yy.setDiagramTitle($$[$0].substr(6)); - this.$ = $$[$0].substr(6); - break; - case 18: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 19: - case 20: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 21: - yy.addSection($$[$0].substr(8)); - this.$ = $$[$0].substr(8); - break; - case 23: - yy.addTask($$[$0 - 1], $$[$0]); - this.$ = "task"; - break; - case 27: - this.$ = $$[$0 - 1]; - yy.setClickEvent($$[$0 - 1], $$[$0], null); - break; - case 28: - this.$ = $$[$0 - 2]; - yy.setClickEvent($$[$0 - 2], $$[$0 - 1], $$[$0]); - break; - case 29: - this.$ = $$[$0 - 2]; - yy.setClickEvent($$[$0 - 2], $$[$0 - 1], null); - yy.setLink($$[$0 - 2], $$[$0]); - break; - case 30: - this.$ = $$[$0 - 3]; - yy.setClickEvent($$[$0 - 3], $$[$0 - 2], $$[$0 - 1]); - yy.setLink($$[$0 - 3], $$[$0]); - break; - case 31: - this.$ = $$[$0 - 2]; - yy.setClickEvent($$[$0 - 2], $$[$0], null); - yy.setLink($$[$0 - 2], $$[$0 - 1]); - break; - case 32: - this.$ = $$[$0 - 3]; - yy.setClickEvent($$[$0 - 3], $$[$0 - 1], $$[$0]); - yy.setLink($$[$0 - 3], $$[$0 - 2]); - break; - case 33: - this.$ = $$[$0 - 1]; - yy.setLink($$[$0 - 1], $$[$0]); - break; - case 34: - case 40: - this.$ = $$[$0 - 1] + " " + $$[$0]; - break; - case 35: - case 36: - case 38: - this.$ = $$[$0 - 2] + " " + $$[$0 - 1] + " " + $$[$0]; - break; - case 37: - case 39: - this.$ = $$[$0 - 3] + " " + $$[$0 - 2] + " " + $$[$0 - 1] + " " + $$[$0]; - break; - case 41: - yy.parseDirective("%%{", "open_directive"); - break; - case 42: - yy.parseDirective($$[$0], "type_directive"); - break; - case 43: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); - yy.parseDirective($$[$0], "arg_directive"); - break; - case 44: - yy.parseDirective("}%%", "close_directive", "gantt"); - break; - } - }, - table: [{ 3: 1, 4: 2, 5: $V0, 30: 4, 40: $V1 }, { 1: [3] }, { 3: 6, 4: 2, 5: $V0, 30: 4, 40: $V1 }, o($V2, [2, 3], { 6: 7 }), { 31: 8, 41: [1, 9] }, { 41: [2, 41] }, { 1: [2, 1] }, { 4: 30, 7: [1, 10], 8: 11, 9: [1, 12], 10: 13, 11: [1, 14], 12: $V3, 13: $V4, 14: $V5, 15: $V6, 16: $V7, 17: $V8, 18: $V9, 19: $Va, 20: $Vb, 21: $Vc, 23: $Vd, 25: $Ve, 26: $Vf, 27: 28, 28: $Vg, 30: 4, 35: $Vh, 40: $V1 }, { 32: 32, 33: [1, 33], 43: $Vi }, o([33, 43], [2, 42]), o($V2, [2, 8], { 1: [2, 2] }), o($V2, [2, 4]), { 4: 30, 10: 35, 12: $V3, 13: $V4, 14: $V5, 15: $V6, 16: $V7, 17: $V8, 18: $V9, 19: $Va, 20: $Vb, 21: $Vc, 23: $Vd, 25: $Ve, 26: $Vf, 27: 28, 28: $Vg, 30: 4, 35: $Vh, 40: $V1 }, o($V2, [2, 6]), o($V2, [2, 7]), o($V2, [2, 9]), o($V2, [2, 10]), o($V2, [2, 11]), o($V2, [2, 12]), o($V2, [2, 13]), o($V2, [2, 14]), o($V2, [2, 15]), o($V2, [2, 16]), o($V2, [2, 17]), { 22: [1, 36] }, { 24: [1, 37] }, o($V2, [2, 20]), o($V2, [2, 21]), o($V2, [2, 22]), { 29: [1, 38] }, o($V2, [2, 24]), { 36: [1, 39], 38: [1, 40] }, { 11: [1, 41] }, { 34: 42, 42: [1, 43] }, { 11: [2, 44] }, o($V2, [2, 5]), o($V2, [2, 18]), o($V2, [2, 19]), o($V2, [2, 23]), o($V2, [2, 27], { 37: [1, 44], 38: [1, 45] }), o($V2, [2, 33], { 36: [1, 46] }), o($Vj, [2, 25]), { 32: 47, 43: $Vi }, { 43: [2, 43] }, o($V2, [2, 28], { 38: [1, 48] }), o($V2, [2, 29]), o($V2, [2, 31], { 37: [1, 49] }), { 11: [1, 50] }, o($V2, [2, 30]), o($V2, [2, 32]), o($Vj, [2, 26])], - defaultActions: { 5: [2, 41], 6: [2, 1], 34: [2, 44], 43: [2, 43] }, - parseError: function parseError2(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; + // 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 (borders.includes("r")) { + log.debug("add right border"); + addBorder(totalHeight); + } else { + skipBorder(totalHeight); + } + if (borders.includes("b")) { + log.debug("add bottom border"); + addBorder(totalWidth); + } else { + skipBorder(totalWidth); + } + if (borders.includes("l")) { + log.debug("add left border"); + addBorder(totalHeight); + } else { + skipBorder(totalHeight); + } + 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; } - 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 ""; + }, "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 token2; + 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}`); + }); } - 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; - } + 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}`); + }); } - return true; - } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError2(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 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; - }, - // unshifts one char (or a string) into the input - unput: 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 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, 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 && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = 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[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 - }); - } - }, - // 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 40; - case 1: - this.begin("type_directive"); - return 41; - case 2: - this.popState(); - this.begin("arg_directive"); - return 33; - case 3: - this.popState(); - this.popState(); - return 43; - case 4: - return 42; - case 5: - this.begin("acc_title"); - return 21; - case 6: - this.popState(); - return "acc_title_value"; - case 7: - this.begin("acc_descr"); - return 23; - case 8: - this.popState(); - return "acc_descr_value"; - case 9: - this.begin("acc_descr_multiline"); - break; - case 10: - this.popState(); - break; - case 11: - return "acc_descr_multiline_value"; - case 12: - break; - case 13: - break; - case 14: - break; - case 15: - return 11; - case 16: - break; - case 17: - break; - case 18: - break; - case 19: - this.begin("href"); - break; - case 20: - this.popState(); - break; - case 21: - return 38; - case 22: - this.begin("callbackname"); - break; - case 23: - this.popState(); - break; - case 24: - this.popState(); - this.begin("callbackargs"); - break; - case 25: - return 36; - case 26: - this.popState(); - break; - case 27: - return 37; - case 28: - this.begin("click"); - break; - case 29: - this.popState(); - break; - case 30: - return 35; - case 31: - return 5; - case 32: - return 12; - case 33: - return 13; - case 34: - return 14; - case 35: - return 15; - case 36: - return 16; - case 37: - return 18; - case 38: - return 17; - case 39: - return 19; - case 40: - return "date"; - case 41: - return 20; - case 42: - return "accDescription"; - case 43: - return 26; - case 44: - return 28; - case 45: - return 29; - case 46: - return 33; - case 47: - return 7; - case 48: - return "INVALID"; - } - }, - rules: [/^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/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, /^(?:%[^\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, /^(?:\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": [10, 11], "inclusive": false }, "acc_descr": { "rules": [8], "inclusive": false }, "acc_title": { "rules": [6], "inclusive": false }, "close_directive": { "rules": [], "inclusive": false }, "arg_directive": { "rules": [3, 4], "inclusive": false }, "type_directive": { "rules": [2, 3], "inclusive": false }, "open_directive": { "rules": [1], "inclusive": false }, "callbackargs": { "rules": [26, 27], "inclusive": false }, "callbackname": { "rules": [23, 24, 25], "inclusive": false }, "href": { "rules": [20, 21], "inclusive": false }, "click": { "rules": [29, 30], "inclusive": false }, "INITIAL": { "rules": [0, 5, 7, 9, 12, 13, 14, 15, 16, 17, 18, 19, 22, 28, 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 Parser() { - this.yy = {}; - } - Parser.prototype = parser2; - parser2.Parser = Parser; - return new Parser(); - }(); - parser$h.parser = parser$h; - const ganttParser = parser$h; - var isoWeekPrettyUnit = "isoweek"; - const dayjsIsoWeek = function(o, c2, d) { - var getYearFirstThursday = function getYearFirstThursday2(year2, isUtc) { - var yearFirstDay = (isUtc ? d.utc : d)().year(year2).startOf(Y); - var addDiffDays = 4 - yearFirstDay.isoWeekday(); - if (yearFirstDay.isoWeekday() > 4) { - addDiffDays += 7; - } - return yearFirstDay.add(addDiffDays, D); - }; - var getCurrentWeekThursday = function getCurrentWeekThursday2(ins) { - return ins.add(4 - ins.isoWeekday(), D); - }; - var proto2 = c2.prototype; - proto2.isoWeekYear = function() { - var nowWeekThursday = getCurrentWeekThursday(this); - return nowWeekThursday.year(); - }; - proto2.isoWeek = function(week) { - if (!this.$utils().u(week)) { - return this.add((week - this.isoWeek()) * 7, D); - } - var nowWeekThursday = getCurrentWeekThursday(this); - var diffWeekThursday = getYearFirstThursday(this.isoWeekYear(), this.$u); - return nowWeekThursday.diff(diffWeekThursday, W) + 1; - }; - proto2.isoWeekday = function(week) { - if (!this.$utils().u(week)) { - return this.day(this.day() % 7 ? week : week - 7); - } - return this.day() || 7; - }; - var oldStartOf = proto2.startOf; - proto2.startOf = function(units, startOf) { - var utils2 = this.$utils(); - var isStartOf = !utils2.u(startOf) ? startOf : true; - var unit2 = utils2.p(units); - if (unit2 === isoWeekPrettyUnit) { - return isStartOf ? this.date(this.date() - (this.isoWeekday() - 1)).startOf("day") : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf("day"); - } - return oldStartOf.bind(this)(units, startOf); - }; - }; - var t = function t4(format2) { - return format2.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(_2, a, b) { - return a || b.slice(1); - }); - }; - var englishFormats = { - 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" - }; - var u = function u2(formatStr, formats) { - return formatStr.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(_2, a, b) { - var B = b && b.toUpperCase(); - return a || formats[b] || englishFormats[b] || t(formats[B]); - }); - }; - var formattingTokens = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g; - var match1 = /\d/; - var match2 = /\d\d/; - var match3 = /\d{3}/; - var match4 = /\d{4}/; - var match1to2 = /\d\d?/; - var matchSigned = /[+-]?\d+/; - var matchOffset = /[+-]\d\d:?(\d\d)?|Z/; - var matchWord = /\d*[^-_:/,()\s\d]+/; - var locale = {}; - var parseTwoDigitYear = function parseTwoDigitYear2(input) { - input = +input; - return input + (input > 68 ? 1900 : 2e3); - }; - function offsetFromString(string) { - if (!string) - return 0; - if (string === "Z") - return 0; - var parts = string.match(/([+-]|\d\d)/g); - var minutes = +(parts[1] * 60) + (+parts[2] || 0); - return minutes === 0 ? 0 : parts[0] === "+" ? -minutes : minutes; - } - var addInput = function addInput2(property2) { - return function(input) { - this[property2] = +input; - }; - }; - var zoneExpressions = [matchOffset, function(input) { - var zone = this.zone || (this.zone = {}); - zone.offset = offsetFromString(input); - }]; - var getLocalePart = function getLocalePart2(name2) { - var part = locale[name2]; - return part && (part.indexOf ? part : part.s.concat(part.f)); - }; - var meridiemMatch = function meridiemMatch2(input, isLowerCase) { - var isAfternoon; - var _locale = locale, meridiem = _locale.meridiem; - if (!meridiem) { - isAfternoon = input === (isLowerCase ? "pm" : "PM"); - } else { - for (var i2 = 1; i2 <= 24; i2 += 1) { - if (input.indexOf(meridiem(i2, 0, isLowerCase)) > -1) { - isAfternoon = i2 > 12; - break; + 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}`); + }); } - } - } - return isAfternoon; - }; - var expressions = { - A: [matchWord, function(input) { - this.afternoon = meridiemMatch(input, false); - }], - a: [matchWord, function(input) { - this.afternoon = meridiemMatch(input, true); - }], - S: [match1, function(input) { - this.milliseconds = +input * 100; - }], - SS: [match2, function(input) { - this.milliseconds = +input * 10; - }], - SSS: [match3, function(input) { - this.milliseconds = +input; - }], - s: [match1to2, addInput("seconds")], - ss: [match1to2, addInput("seconds")], - m: [match1to2, addInput("minutes")], - mm: [match1to2, addInput("minutes")], - H: [match1to2, addInput("hours")], - h: [match1to2, addInput("hours")], - HH: [match1to2, addInput("hours")], - hh: [match1to2, addInput("hours")], - D: [match1to2, addInput("day")], - DD: [match2, addInput("day")], - Do: [matchWord, function(input) { - var _locale2 = locale, ordinal2 = _locale2.ordinal; - var _input$match = input.match(/\d+/); - this.day = _input$match[0]; - if (!ordinal2) - return; - for (var i2 = 1; i2 <= 31; i2 += 1) { - if (ordinal2(i2).replace(/\[|\]/g, "") === input) { - this.day = i2; - } - } - }], - M: [match1to2, addInput("month")], - MM: [match2, addInput("month")], - MMM: [matchWord, function(input) { - var months = getLocalePart("months"); - var monthsShort = getLocalePart("monthsShort"); - var matchIndex = (monthsShort || months.map(function(_2) { - return _2.slice(0, 3); - })).indexOf(input) + 1; - if (matchIndex < 1) { - throw new Error(); - } - this.month = matchIndex % 12 || matchIndex; - }], - MMMM: [matchWord, function(input) { - var months = getLocalePart("months"); - var matchIndex = months.indexOf(input) + 1; - if (matchIndex < 1) { - throw new Error(); - } - this.month = matchIndex % 12 || matchIndex; - }], - Y: [matchSigned, addInput("year")], - YY: [match2, function(input) { - this.year = parseTwoDigitYear(input); - }], - YYYY: [match4, addInput("year")], - Z: zoneExpressions, - ZZ: zoneExpressions - }; - function correctHours(time2) { - var afternoon = time2.afternoon; - if (afternoon !== void 0) { - var hours = time2.hours; - if (afternoon) { - if (hours < 12) { - time2.hours += 12; - } - } else if (hours === 12) { - time2.hours = 0; - } - delete time2.afternoon; - } - } - function makeParser(format2) { - format2 = u(format2, locale && locale.formats); - var array2 = format2.match(formattingTokens); - var length2 = array2.length; - for (var i2 = 0; i2 < length2; i2 += 1) { - var token2 = array2[i2]; - var parseTo = expressions[token2]; - var regex = parseTo && parseTo[0]; - var parser2 = parseTo && parseTo[1]; - if (parser2) { - array2[i2] = { - regex, - parser: parser2 + updateNodeBounds(node2, rect4); + node2.intersect = function(point8) { + return intersect_default.rect(node2, point8); }; - } else { - array2[i2] = token2.replace(/^\[|\]$/g, ""); - } - } - return function(input) { - var time2 = {}; - for (var _i = 0, start2 = 0; _i < length2; _i += 1) { - var _token = array2[_i]; - if (typeof _token === "string") { - start2 += _token.length; + return shapeSvg; + }, "labelRect"); + __name(applyNodePropertyBorders, "applyNodePropertyBorders"); + rectWithTitle = /* @__PURE__ */ __name((parent4, node2) => { + let classes6; + if (!node2.classes) { + classes6 = "node default"; } else { - var _regex = _token.regex, _parser = _token.parser; - var part = input.slice(start2); - var match = _regex.exec(part); - var value = match[0]; - _parser.call(time2, value); - input = input.replace(value, ""); - } - } - correctHours(time2); - return time2; - }; - } - var parseFormattedInput = function parseFormattedInput2(input, format2, utc) { - try { - if (["x", "X"].indexOf(format2) > -1) - return new Date((format2 === "X" ? 1e3 : 1) * input); - var parser2 = makeParser(format2); - var _parser2 = parser2(input), year2 = _parser2.year, month2 = _parser2.month, day2 = _parser2.day, hours = _parser2.hours, minutes = _parser2.minutes, seconds = _parser2.seconds, milliseconds = _parser2.milliseconds, zone = _parser2.zone; - var now2 = /* @__PURE__ */ new Date(); - var d = day2 || (!year2 && !month2 ? now2.getDate() : 1); - var y2 = year2 || now2.getFullYear(); - var M2 = 0; - if (!(year2 && !month2)) { - M2 = month2 > 0 ? month2 - 1 : now2.getMonth(); - } - var h = hours || 0; - var m = minutes || 0; - var s = seconds || 0; - var ms = milliseconds || 0; - if (zone) { - return new Date(Date.UTC(y2, M2, d, h, m, s, ms + zone.offset * 60 * 1e3)); - } - if (utc) { - return new Date(Date.UTC(y2, M2, d, h, m, s, ms)); - } - return new Date(y2, M2, d, h, m, s, ms); - } catch (e) { - return /* @__PURE__ */ new Date(""); - } - }; - const dayjsCustomParseFormat = function(o, C, d) { - d.p.customParseFormat = true; - if (o && o.parseTwoDigitYear) { - parseTwoDigitYear = o.parseTwoDigitYear; - } - var proto2 = C.prototype; - var oldParse = proto2.parse; - proto2.parse = function(cfg) { - var date2 = cfg.date, utc = cfg.utc, args = cfg.args; - this.$u = utc; - var format2 = args[1]; - if (typeof format2 === "string") { - var isStrictWithoutLocale = args[2] === true; - var isStrictWithLocale = args[3] === true; - var isStrict = isStrictWithoutLocale || isStrictWithLocale; - var pl = args[2]; - if (isStrictWithLocale) { - pl = args[2]; - } - locale = this.$locale(); - if (!isStrictWithoutLocale && pl) { - locale = d.Ls[pl]; - } - this.$d = parseFormattedInput(date2, format2, utc); - this.init(); - if (pl && pl !== true) - this.$L = this.locale(pl).$L; - if (isStrict && date2 != this.format(format2)) { - this.$d = /* @__PURE__ */ new Date(""); - } - locale = {}; - } else if (format2 instanceof Array) { - var len = format2.length; - for (var i2 = 1; i2 <= len; i2 += 1) { - args[1] = format2[i2 - 1]; - var result = d.apply(this, args); - if (result.isValid()) { - this.$d = result.$d; - this.$L = result.$L; - this.init(); - break; - } - if (i2 === len) - this.$d = /* @__PURE__ */ new Date(""); + 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; } - } else { - oldParse.call(this, cfg); - } - }; - }; - const dayjsAdvancedFormat = function(o, c2) { - var proto2 = c2.prototype; - var oldFormat = proto2.format; - proto2.format = function(formatStr) { - var _this = this; - var locale2 = this.$locale(); - if (!this.isValid()) { - return oldFormat.bind(this)(formatStr); - } - var utils2 = this.$utils(); - var str2 = formatStr || FORMAT_DEFAULT; - var result = str2.replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, function(match) { - switch (match) { - case "Q": - return Math.ceil((_this.$M + 1) / 3); - case "Do": - return locale2.ordinal(_this.$D); - case "gggg": - return _this.weekYear(); - case "GGGG": - return _this.isoWeekYear(); - case "wo": - return locale2.ordinal(_this.week(), "W"); - case "w": - case "ww": - return utils2.s(_this.week(), match === "w" ? 1 : 2, "0"); - case "W": - case "WW": - return utils2.s(_this.isoWeek(), match === "W" ? 1 : 2, "0"); - case "k": - case "kk": - return utils2.s(String(_this.$H === 0 ? 24 : _this.$H), match === "k" ? 1 : 2, "0"); - case "X": - return Math.floor(_this.$d.getTime() / 1e3); - case "x": - return _this.$d.getTime(); - case "z": - return "[" + _this.offsetName() + "]"; - case "zzz": - return "[" + _this.offsetName("long") + "]"; - default: - return match; + 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 oldFormat.bind(this)(result); - }; - }; - 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 = {}; - 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 lastOrder = 0; - const parseDirective$7 = function(statement, context, type2) { - mermaidAPI.parseDirective(this, statement, context, type2); - }; - const clear$8 = 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 = {}; - clear$i(); - }; - 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 = function() { - return links; - }; - 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 checkTaskDates = function(task, dateFormat2, excludes2, includes2) { - if (!excludes2.length || task.manualEndTime) { - return; + return diff2; + }, "positionNode"); } - let startTime; - if (task.startTime instanceof Date) { - startTime = dayjs(task.startTime); - } else { - startTime = dayjs(task.startTime, dateFormat2, true); + }); + + // 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((id27, securityLevel) => { + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id27); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const svg = root4.select(`[id="${id27}"]`); + return svg; + }, "getDiagramElement"); } - startTime = startTime.add(1, "d"); - let originalEndTime; - if (task.endTime instanceof Date) { - originalEndTime = dayjs(task.endTime); - } 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"); + }); + + // 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"); } - return [endTime, renderEndTime]; - }; - const getStartDate = function(prevTime, dateFormat2, str2) { - str2 = str2.trim(); - const re2 = /^after\s+([\d\w- ]+)/; - const afterStatement = re2.exec(str2.trim()); - if (afterStatement !== null) { - let latestEndingTask = null; - afterStatement[1].split(" ").forEach(function(id2) { - let task = findTaskById(id2); - if (task !== void 0) { - if (!latestEndingTask) { - latestEndingTask = task; - } else { - if (task.endTime > latestEndingTask.endTime) { - latestEndingTask = task; - } - } + }); + + // ../../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 (!latestEndingTask) { - const dt = /* @__PURE__ */ new Date(); - dt.setHours(0, 0, 0, 0); - return dt; - } else { - return latestEndingTask.endTime; - } - } - 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())) { - throw new Error("Invalid date:" + str2); + 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 d; - } - }; - const parseDuration = function(str2) { - const statement = /^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(str2.trim()); - if (statement !== null) { - return [Number.parseFloat(statement[1]), statement[2]]; } - return [NaN, "ms"]; - }; - const getEndDate = function(prevTime, dateFormat2, str2, inclusive = false) { - str2 = str2.trim(); - let mDate = dayjs(str2, dateFormat2.trim(), true); - if (mDate.isValid()) { - if (inclusive) { - mDate = mDate.add(1, "d"); + return e3; + } + 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; } - return mDate.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; + 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; } - } - 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]; + case "A": + a2.push({ key: "A", data: [...r2] }), e3 = r2[5], s2 = r2[6]; break; - case 2: - task.id = parseId(); - task.startTime = getStartDate(void 0, dateFormat, data[0]); - endTimeData = data[1]; + 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 3: - task.id = parseId(data[0]); - task.startTime = getStartDate(void 0, dateFormat, data[1]); - endTimeData = data[2]; + case "H": + a2.push({ key: "H", data: [...r2] }), e3 = r2[0]; 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] - }; + case "h": + e3 += r2[0], a2.push({ key: "H", data: [e3] }); break; - case 2: - task.id = parseId(); - task.startTime = { - type: "getStartDate", - startData: data[0] - }; - task.endTime = { - data: data[1] - }; + case "V": + a2.push({ key: "V", data: [...r2] }), s2 = r2[0]; break; - case 3: - task.id = parseId(data[0]); - task.startTime = { - type: "getStartDate", - startData: data[1] - }; - task.endTime = { - data: data[2] - }; + case "v": + s2 += r2[0], a2.push({ key: "V", data: [s2] }); 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; + 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; + } + 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; } - case "getStartDate": - startTime = getStartDate(void 0, dateFormat, rawTasks$2[pos].raw.startTime.startData); - if (startTime) { - rawTasks$2[pos].startTime = startTime; + 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; - } - 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); } + case "Z": + e3.push({ key: "Z", data: [] }), n2 = a2, o2 = h2; } - return rawTasks$2[pos].processed; - }; - let allProcessed = true; - for (const [i2, rawTask] of rawTasks$2.entries()) { - compileTask(i2); - allProcessed = allProcessed && rawTask.processed; + s2 = c3; } - return allProcessed; - }; - const setLink$1 = function(ids, _linkStr) { - let linkStr = _linkStr; - if (getConfig$1().securityLevel !== "loose") { - linkStr = sanitizeUrl_1(_linkStr); - } - ids.split(",").forEach(function(id2) { - let rawTask = findTaskById(id2); - if (rawTask !== void 0) { - pushFun(id2, () => { - window.open(linkStr, "_self"); - }); - links[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); + return e3; + } + function w(t4, e3, s2) { + return [t4 * Math.cos(s2) - e3 * Math.sin(s2), t4 * Math.sin(s2) + e3 * Math.cos(s2)]; + } + 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; } - }); - }; - const setClickFun = function(id2, functionName, functionArgs) { - if (getConfig$1().securityLevel !== "loose") { - return; - } - if (functionName === void 0) { - return; + case "Z": + n2.push(...$(a2[0], a2[1], o2[0], o2[1], e3)), a2 = [o2[0], o2[1]]; } - 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; + return { type: "path", ops: n2 }; + } + 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)] }); } } - if (argList.length === 0) { - argList.push(id2); + return { type: "fillPath", ops: s2 }; + } + 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); } - let rawTask = findTaskById(id2); - if (rawTask !== void 0) { - pushFun(id2, () => { - utils.runFunc(functionName, ...argList); - }); + var a2, h2; + return o2; + } + function U(t4, e3) { + return X2(t4, 0, t4.length, e3); + } + 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); } - }; - const pushFun = function(id2, callbackFunction) { - funs.push( - function() { - const elem = document.querySelector(`[id="${id2}"]`); - if (elem !== null) { - elem.addEventListener("click", function() { - callbackFunction(); - }); + 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 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"); } - }, - function() { - const elem = document.querySelector(`[id="${id2}-text"]`); - if (elem !== null) { - elem.addEventListener("click", function() { - callbackFunction(); - }); + constructor(t4) { + this.helper = t4; } - } - ); - }; - const setClickEvent$1 = function(ids, functionName, functionArgs) { - ids.split(",").forEach(function(id2) { - setClickFun(id2, functionName, functionArgs); - }); - setClass(ids, "clickable"); - }; - const bindFunctions$1 = function(element) { - funs.forEach(function(fun) { - fun(element); - }); - }; - const ganttDb = { - parseDirective: parseDirective$7, - getConfig: () => getConfig$1().gantt, - clear: clear$8, - 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, - bindFunctions: bindFunctions$1, - parseDuration, - isInvalidDate - }; - function getTaskTags(data, task, tags2) { - let matchFound = true; - while (matchFound) { - matchFound = false; - tags2.forEach(function(t4) { - const pattern = "^\\s*" + t4 + "\\s*$"; - const regex = new RegExp(pattern); - if (data[0].match(regex)) { - task[t4] = true; - data.shift(1); - matchFound = true; + fillPolygons(t4, e3) { + return this._fillPolygons(t4, e3); } - }); - } - } - const setConf$5 = function() { - log$1.debug("Something is calling, setConf, remove the call"); - }; - 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 element of sorted) { - for (let j = 0; j < timeline2.length; j++) { - if (element.startTime >= timeline2[j]) { - timeline2[j] = element.endTime; - element.order = j + orderOffset; - if (j > maxIntersections) { - maxIntersections = j; - } - break; + _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"); } - } - } - return maxIntersections; - }; - let w; - const draw$c = function(text2, id2, version2, diagObj) { - const conf2 = getConfig$1().gantt; - const securityLevel = getConfig$1().securityLevel; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("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 element of taskArray) { - categories.push(element.type); - } - categories = checkUnique(categories); - const categoryHeights = {}; - let h = 2 * conf2.topPadding; - if (diagObj.db.getDisplayMode() === "compact" || conf2.displayMode === "compact") { - const categoryElements = {}; - for (const element of taskArray) { - if (categoryElements[element.section] === void 0) { - categoryElements[element.section] = [element]; - } else { - categoryElements[element.section].push(element); + 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) }; } - } - 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; - } - } else { - h += taskArray.length * (conf2.barHeight + conf2.barGap); - for (const category of categories) { - categoryHeights[category] = taskArray.filter((task) => task.type === category).length; - } - } - elem.setAttribute("viewBox", "0 0 " + w + " " + h); - const svg2 = root2.select(`[id="${id2}"]`); - const timeScale = time$1().domain([ - min$2(taskArray, function(d) { - return d.startTime; - }), - max$2(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; - } - return result; - } - taskArray.sort(taskCompare); - makeGant(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 makeGant(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"; + }; + 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 { - taskClass = " active"; + 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]} `; + } } - } else if (d.done) { - if (d.crit) { - taskClass = " doneCrit"; - } else { - taskClass = " done"; + 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); } - } else { - if (d.crit) { - taskClass += " crit"; + 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(); } - if (taskClass.length === 0) { - taskClass = " task"; + get generator() { + return this.gen; } - if (d.milestone) { - taskClass = " milestone " + taskClass; + getDefaultOptions() { + return this.gen.defaultOptions; } - 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; + 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") }; + } + }); + + // 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 { - 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; + if (dx < 0) { + w3 = -w3; } + sx = w3; + sy = dx === 0 ? 0 : w3 * dy / dx; } - if (d.done) { - if (d.crit) { - taskType = taskType + " doneCritText" + secNum; + return { x: x5 + sx, y: y5 + sy }; + }, "intersectRect"); + intersect_rect_default2 = intersectRect2; + } + }); + + // src/rendering-util/rendering-elements/createLabel.js + function applyStyle3(dom, styleFn) { + if (styleFn) { + dom.attr("style", styleFn); + } + } + 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()); + } + 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(); + } + 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 { - taskType = taskType + " doneText" + secNum; + rows = []; } - } else { - if (d.crit) { - taskType = taskType + " critText" + secNum; + 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; } - if (d.milestone) { - taskType += " milestoneText"; - } - if (textWidth > endX - startX) { - if (endX + textWidth + 1.5 * conf2.leftPadding > w2) { - return classStr + " taskTextOutsideLeft taskTextOutside" + secNum + " " + taskType; + }, "createLabel"); + createLabel_default2 = createLabel2; + } + }); + + // 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"); + } + }); + + // 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 { - return classStr + " taskTextOutsideRight taskTextOutside" + secNum + " " + taskType + " width-" + textWidth; + 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"); + } + }); + + // 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 { - return classStr + " taskText taskText" + secNum + " " + taskType + " width-" + textWidth; + 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); } - }); - const securityLevel2 = getConfig$1().securityLevel; - if (securityLevel2 === "sandbox") { - let sandboxElement2; - sandboxElement2 = select("#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); + 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); + } + 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"); + } + }); + + // src/utils/lineWithOffset.ts + function calculateDeltaAndAngle(point1, point22) { + if (point1 === void 0 || point22 === void 0) { + return { angle: 0, deltaX: 0, deltaY: 0 }; + } + 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 }; + } + 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 + }); + }); }); } } - function drawExcludeDays(theGap, theTopPad, theSidePad, w2, h2, tasks2, excludes2, includes2) { - const minTime = tasks2.reduce( - (min2, { startTime }) => min2 ? Math.min(min2, startTime) : startTime, - 0 - ); - const maxTime = tasks2.reduce((max2, { endTime }) => max2 ? Math.max(max2, endTime) : endTime, 0); - const dateFormat2 = diagObj.db.getDateFormat(); - if (!minTime || !maxTime) { - return; - } - 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 - }; - } else { - range2.end = d; + }); + + // 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, id27, diagramType) => { + if (edge.arrowTypeStart) { + addEdgeMarker(svgPath, "start", edge.arrowTypeStart, url, id27, diagramType); + } + if (edge.arrowTypeEnd) { + addEdgeMarker(svgPath, "end", edge.arrowTypeEnd, url, id27, 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, id27, 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}#${id27}_${diagramType}-${endMarkerType}${suffix})`); + }, "addEdgeMarker"); + } + }); + + // 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"; + } + } + 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 (R2 === 0) { + res.x = outsidePoint.x; } + if (Q2 === 0) { + res.y = outsidePoint.y; + } + log.debug(`abc89 top/bottom calc, Q ${Q2}, q ${q2}, R ${R2}, r ${r2}`, res); + return res; } 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*)(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]; - switch (interval2) { - case "minute": - bottomXAxis.ticks(timeMinute.every(every)); + 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, id27) { + 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 "hour": - bottomXAxis.ticks(timeHour.every(every)); + case "thick": + strokeClasses = "edge-thickness-thick"; break; - case "day": - bottomXAxis.ticks(timeDay.every(every)); + case "invisible": + strokeClasses = "edge-thickness-invisible"; break; - case "week": - bottomXAxis.ticks(sunday.every(every)); + default: + strokeClasses = "edge-thickness-normal"; + } + switch (edge.pattern) { + case "solid": + strokeClasses += " edge-pattern-solid"; + break; + case "dotted": + strokeClasses += " edge-pattern-dotted"; break; - case "month": - bottomXAxis.ticks(timeMonth.every(every)); + 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, "") : ""); } - } - 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]; - switch (interval2) { - 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(sunday.every(every)); - break; - case "month": - topXAxis.ticks(timeMonth.every(every)); - break; - } + 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, "\\)"); } - 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 numOccurances = Object.keys(categoryHeights).map((d) => [d, categoryHeights[d]]); - svg2.append("g").selectAll("text").data(numOccurances).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); + log.info("arrowTypeStart", edge.arrowTypeStart); + log.info("arrowTypeEnd", edge.arrowTypeEnd); + addEdgeMarkers(svgPath, edge, url, id27, diagramType); + let paths = {}; + if (pointsHasChanged) { + paths.updatedPath = points; } - return svgLabel; - }).attr("x", 10).attr("y", function(d, i2) { - if (i2 > 0) { - for (let j = 0; j < i2; j++) { - prevGap += numOccurances[i2 - 1][1]; - return d[1] * theGap / 2 + prevGap * theGap + theTopPad; - } + paths.originalPath = edge.points; + return paths; + }, "insertEdge"); + } + }); + + // 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, id27) => { + markerArray.forEach((markerName) => { + markers[markerName](elem, type3, id27); + }); + }, "insertMarkers"); + extension = /* @__PURE__ */ __name((elem, type3, id27) => { + log.trace("Making markers for ", id27); + elem.append("defs").append("marker").attr("id", id27 + "_" + 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", id27 + "_" + 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, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + 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", id27 + "_" + 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, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + 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", id27 + "_" + 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, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + 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", id27 + "_" + 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, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + 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", id27 + "_" + 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, id27) => { + elem.append("marker").attr("id", id27 + "_" + 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", id27 + "_" + 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, id27) => { + elem.append("marker").attr("id", id27 + "_" + 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", id27 + "_" + 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, id27) => { + elem.append("marker").attr("id", id27 + "_" + 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", id27 + "_" + 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, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + 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; + } + }); + + // 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 { - return d[1] * theGap / 2 + theTopPad; + cssClasses = _classes; } - }).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; + 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); } - return "sectionTitle"; - }); - } - function drawToday(theSidePad, theTopPad, w2, h2) { - const todayMarker2 = diagObj.db.getTodayMarker(); - if (todayMarker2 === "off") { - return; - } - 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, ";")); - } - } - 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]); + if (useHtmlLabels) { + labelEl.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")"); + } else { + labelEl.attr("transform", "translate(0, " + -bbox.height / 2 + ")"); } - } - return result; + 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"); } - }; - const ganttRenderer = { - setConf: setConf$5, - draw: draw$c - }; - const getStyles$a = (options2) => ` - .mermaid-main-font { - font-family: "trebuchet ms", verdana, arial, sans-serif; - font-family: var(--mermaid-font-family); - } - .exclude-range { - fill: ${options2.excludeBkgColor}; - } - - .section { - stroke: none; - opacity: 0.2; - } - - .section0 { - fill: ${options2.sectionBkgColor}; - } + }); - .section2 { - fill: ${options2.sectionBkgColor2}; + // src/rendering-util/rendering-elements/intersect/intersect-node.js + function intersectNode2(node2, point8) { + return node2.intersect(point8); } + 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; + } + }); - .section1, - .section3 { - fill: ${options2.altSectionBkgColor}; - opacity: 0.2; + // 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; + } + var dy = Math.abs(rx * ry * py / det); + if (point8.y < cy) { + dy = -dy; + } + 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; + } + }); - .sectionTitle0 { - fill: ${options2.titleColor}; - } + // 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; + } + }); - .sectionTitle1 { - fill: ${options2.titleColor}; + // 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; + } + 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; + } + 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 }; } - - .sectionTitle2 { - fill: ${options2.titleColor}; + 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; + } + }); - .sectionTitle3 { - fill: ${options2.titleColor}; + // 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); + }); + } else { + minX = Math.min(minX, polyPoints.x); + minY = Math.min(minY, polyPoints.y); + } + 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); + } + } + if (!intersections.length) { + return node2; + } + 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; + }); + } + 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; + } + }); - .sectionTitle { - text-anchor: start; - // font-size: ${options2.ganttFontSize}; - // text-height: 14px; - font-family: 'trebuchet ms', verdana, arial, sans-serif; - font-family: var(--mermaid-font-family); + // 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 + }; + } + }); - } + // 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"); + } + }); + // 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"); + } + }); - /* Grid and axis */ + // 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"); + } + }); - .grid .tick { - stroke: ${options2.gridColor}; - opacity: 0.8; - shape-rendering: crispEdges; - text { - font-family: ${options2.fontFamily}; - fill: ${options2.textColor}; + // 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"); } - } + }); - .grid path { - stroke-width: 0; - } + // 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"); + } + }); + // 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"); + } + }); - /* Today line */ + // 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"); + } + updateNodeBounds2(node2, shape); + let nodeHeight = 0; + let nodeWidth = 0; + let nodePadding = 10; + if (node2.height) { + nodeHeight = node2.height; + } + if (node2.width) { + nodeWidth = node2.width; + } + 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"); + } + }); - .today { - fill: none; - stroke: ${options2.todayLineColor}; - stroke-width: 2px; - } + // 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"); + } + }); + // 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"); + } + }); - /* Task styling */ + // 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"); + } + }); - /* Default task */ + // 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 { + 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"); + } + }); - .task { - stroke-width: 2; + // 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"); + } + }); - .taskText { - text-anchor: middle; - font-family: 'trebuchet ms', verdana, arial, sans-serif; - font-family: var(--mermaid-font-family); - } + // 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); + } + node2.intersect = function(point8) { + return intersect_default2.polygon(node2, points, point8); + }; + return shapeSvg; + }, "subroutine"); + } + }); - // .taskText:not([font-size]) { - // font-size: ${options2.ganttFontSize}; - // } + // 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"); + } + }); - .taskTextOutsideRight { - fill: ${options2.taskTextDarkColor}; - text-anchor: start; - // font-size: ${options2.ganttFontSize}; - font-family: 'trebuchet ms', verdana, arial, sans-serif; - font-family: var(--mermaid-font-family); + // 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); + } + 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"); + } + }); - .taskTextOutsideLeft { - fill: ${options2.taskTextDarkColor}; - text-anchor: end; - // font-size: ${options2.ganttFontSize}; - } + // 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); + } + if (nodeStyles) { + polygon2.attr("style", nodeStyles); + } + 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"); + } + }); - /* Special case clickable */ - .task.clickable { - cursor: pointer; + // 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"); + } + }); + + // 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); + } + 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"); + } + }); + + // 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); + } + 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"); + } + }); + + // 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; } - .taskText.clickable { - cursor: pointer; - fill: ${options2.taskTextClickableColor} !important; - font-weight: bold; + 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; } + 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; + } + }); - .taskTextOutsideLeft.clickable { - cursor: pointer; - fill: ${options2.taskTextClickableColor} !important; - font-weight: bold; + // ../../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; + } + 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; + } + value2 = toNumber_default(value2); + if (value2 === INFINITY2 || value2 === -INFINITY2) { + var sign2 = value2 < 0 ? -1 : 1; + return sign2 * MAX_INTEGER; + } + return value2 === value2 ? value2 : 0; } + 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; + } + }); - .taskTextOutsideRight.clickable { - cursor: pointer; - fill: ${options2.taskTextClickableColor} !important; - font-weight: bold; + // ../../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; } + 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; + } + }); - /* Specific task settings for the sections*/ + // ../../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; + } + }); - .taskText0, - .taskText1, - .taskText2, - .taskText3 { - fill: ${options2.taskTextColor}; + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/noop.js + function noop2() { } + 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; + } + }); - .task0, - .task1, - .task2, - .task3 { - fill: ${options2.taskBkgColor}; - stroke: ${options2.taskBorderColor}; + // ../../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; + } + } + 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; + } + }); - .taskTextOutside0, - .taskTextOutside2 - { - fill: ${options2.taskTextOutsideColor}; + // ../../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 -1; } + 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; + } + }); - .taskTextOutside1, - .taskTextOutside3 { - fill: ${options2.taskTextOutsideColor}; + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNaN.js + function baseIsNaN(value2) { + return value2 !== value2; } + 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; + } + }); + // ../../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 -1; + } + 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; + } + }); - /* Active task */ + // ../../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; + } + }); - .active0, - .active1, - .active2, - .active3 { - fill: ${options2.activeTaskBkgColor}; - stroke: ${options2.activeTaskBorderColor}; - } + // ../../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; + } + }); - .activeText0, - .activeText1, - .activeText2, - .activeText3 { - fill: ${options2.taskTextDarkColor} !important; + // ../../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); + } + } + return result; } + 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; + } + }); + // ../../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; + } + }); - /* Completed task */ + // ../../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]); + } + } + }); + assign_default = assign; + } + }); - .done0, - .done1, - .done2, - .done3 { - stroke: ${options2.doneTaskBorderColor}; - fill: ${options2.doneTaskBkgColor}; - stroke-width: 2; + // ../../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); } + 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; + } + }); - .doneText0, - .doneText1, - .doneText2, - .doneText3 { - fill: ${options2.taskTextDarkColor} !important; + // ../../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; } + 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; + }); + stringToPath_default = stringToPath; + } + }); - /* Tasks on the critical line */ + // ../../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; + } + }); - .crit0, - .crit1, - .crit2, - .crit3 { - stroke: ${options2.critBorderColor}; - fill: ${options2.critBkgColor}; - stroke-width: 2; - } + // ../../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)); + } + 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; + } + }); - .activeCrit0, - .activeCrit1, - .activeCrit2, - .activeCrit3 { - stroke: ${options2.critBorderColor}; - fill: ${options2.activeTaskBkgColor}; - stroke-width: 2; + // ../../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; + } + 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; } + 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; + } + }); - .doneCrit0, - .doneCrit1, - .doneCrit2, - .doneCrit3 { - stroke: ${options2.critBorderColor}; - fill: ${options2.doneTaskBkgColor}; - stroke-width: 2; - cursor: pointer; - shape-rendering: crispEdges; + // ../../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 array4; } + 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; + } + }); - .milestone { - transform: rotate(45deg) scale(0.8,0.8); + // ../../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); + } + } else if (!isStrict) { + result[result.length] = value2; + } + } + return result; } + 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; + } + }); - .milestoneText { - font-style: italic; + // ../../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; + } + }); + + // ../../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; + } + }); + + // ../../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; } - .doneCritText0, - .doneCritText1, - .doneCritText2, - .doneCritText3 { - fill: ${options2.taskTextDarkColor} !important; + 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; + } + }); + + // ../../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; } + 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; + } + }); - .activeCritText0, - .activeCritText1, - .activeCritText2, - .activeCritText3 { - fill: ${options2.taskTextDarkColor} !important; + // ../../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; } + 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; + } + }); - .titleText { - text-anchor: middle; - font-size: 18px; - fill: ${options2.textColor} ; - font-family: 'trebuchet ms', verdana, arial, sans-serif; - font-family: var(--mermaid-font-family); + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubArray.js + function stubArray() { + return []; } -`; - const ganttStyles = getStyles$a; - const diagram$c = { - parser: ganttParser, - db: ganttDb, - renderer: ganttRenderer, - styles: ganttStyles - }; - const ganttDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$c - }, Symbol.toStringTag, { value: "Module" })); - var parser$f = 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 parseError2(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; + 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 []; } - }, - 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; + 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); } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); + 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; } - token2 = self2.symbols_[token2] || token2; } - return token2; + 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; + } + 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); + } + 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; + } + 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); + } + } else { + var tag2 = getTag_default(value2), isFunc = tag2 == funcTag3 || tag2 == genTag2; + if (isBuffer_default(value2)) { + return cloneBuffer_default(value2, isDeep); + } + 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)); } - 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 { + if (!cloneableTags[tag2]) { + return object3 ? value2 : {}; } - return true; + result = initCloneByTag_default(value2, tag2, isDeep); } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError2(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 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; - }, - // unshifts one char (or a string) into the input - unput: 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 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, 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 && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = 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[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 - }); - } - }, - // 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: - return 4; - case 1: - return 9; - case 2: - return "space"; - case 3: - return 10; - case 4: - return 6; - case 5: - return "TXT"; - } - }, - 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 Parser() { - this.yy = {}; - } - Parser.prototype = parser2; - parser2.Parser = Parser; - return new Parser(); - }(); - parser$f.parser = parser$f; - const parser$g = parser$f; - var message = ""; - var info = false; - const setMessage = (txt) => { - log$1.debug("Setting message to: " + txt); - message = txt; - }; - const getMessage = () => { - return message; - }; - const setInfo = (inf) => { - info = inf; - }; - const getInfo = () => { - return info; - }; - const db$7 = { - setMessage, - getMessage, - setInfo, - getInfo, - clear: clear$i - // parseError - }; - const getStyles$9 = () => ``; - const styles$8 = getStyles$9; - const draw$b = (text2, id2, version2) => { - try { - log$1.debug("Rendering info diagram\n" + text2); - const securityLevel = getConfig$1().securityLevel; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); - const svg2 = root2.select("#" + id2); - const g = svg2.append("g"); - g.append("text").attr("x", 100).attr("y", 40).attr("class", "version").attr("font-size", "32px").style("text-anchor", "middle").text("v " + version2); - svg2.attr("height", 100); - svg2.attr("width", 400); - } catch (e) { - log$1.error("Error while rendering info diagram"); - log$1.error(e.message); - } - }; - const renderer$a = { - draw: draw$b - }; - const diagram$b = { - parser: parser$g, - db: db$7, - renderer: renderer$a, - styles: styles$8 - }; - const infoDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$b - }, Symbol.toStringTag, { value: "Module" })); - var parser$d = 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, 5], $V2 = [1, 6], $V3 = [1, 7], $V4 = [1, 9], $V5 = [1, 11, 13, 15, 17, 19, 20, 26, 27, 28, 29], $V6 = [2, 5], $V7 = [1, 6, 11, 13, 15, 17, 19, 20, 26, 27, 28, 29], $V8 = [26, 27, 28], $V9 = [2, 8], $Va = [1, 18], $Vb = [1, 19], $Vc = [1, 20], $Vd = [1, 21], $Ve = [1, 22], $Vf = [1, 23], $Vg = [1, 28], $Vh = [6, 26, 27, 28, 29]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "eol": 4, "directive": 5, "PIE": 6, "document": 7, "showData": 8, "line": 9, "statement": 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, "openDirective": 21, "typeDirective": 22, "closeDirective": 23, ":": 24, "argDirective": 25, "NEWLINE": 26, ";": 27, "EOF": 28, "open_directive": 29, "type_directive": 30, "arg_directive": 31, "close_directive": 32, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 6: "PIE", 8: "showData", 11: "txt", 12: "value", 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", 24: ":", 26: "NEWLINE", 27: ";", 28: "EOF", 29: "open_directive", 30: "type_directive", 31: "arg_directive", 32: "close_directive" }, - productions_: [0, [3, 2], [3, 2], [3, 2], [3, 3], [7, 0], [7, 2], [9, 2], [10, 0], [10, 2], [10, 2], [10, 2], [10, 2], [10, 1], [10, 1], [10, 1], [5, 3], [5, 5], [4, 1], [4, 1], [4, 1], [21, 1], [22, 1], [25, 1], [23, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 4: - yy.setShowData(true); - break; - case 7: - this.$ = $$[$0 - 1]; - break; - case 9: - yy.addSection($$[$0 - 1], yy.cleanupValue($$[$0])); - break; - case 10: - this.$ = $$[$0].trim(); - yy.setDiagramTitle(this.$); - break; - case 11: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 12: - case 13: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 14: - yy.addSection($$[$0].substr(8)); - this.$ = $$[$0].substr(8); - break; - case 21: - yy.parseDirective("%%{", "open_directive"); - break; - case 22: - yy.parseDirective($$[$0], "type_directive"); - break; - case 23: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); - yy.parseDirective($$[$0], "arg_directive"); - break; - case 24: - yy.parseDirective("}%%", "close_directive", "pie"); - break; - } - }, - table: [{ 3: 1, 4: 2, 5: 3, 6: $V0, 21: 8, 26: $V1, 27: $V2, 28: $V3, 29: $V4 }, { 1: [3] }, { 3: 10, 4: 2, 5: 3, 6: $V0, 21: 8, 26: $V1, 27: $V2, 28: $V3, 29: $V4 }, { 3: 11, 4: 2, 5: 3, 6: $V0, 21: 8, 26: $V1, 27: $V2, 28: $V3, 29: $V4 }, o($V5, $V6, { 7: 12, 8: [1, 13] }), o($V7, [2, 18]), o($V7, [2, 19]), o($V7, [2, 20]), { 22: 14, 30: [1, 15] }, { 30: [2, 21] }, { 1: [2, 1] }, { 1: [2, 2] }, o($V8, $V9, { 21: 8, 9: 16, 10: 17, 5: 24, 1: [2, 3], 11: $Va, 13: $Vb, 15: $Vc, 17: $Vd, 19: $Ve, 20: $Vf, 29: $V4 }), o($V5, $V6, { 7: 25 }), { 23: 26, 24: [1, 27], 32: $Vg }, o([24, 32], [2, 22]), o($V5, [2, 6]), { 4: 29, 26: $V1, 27: $V2, 28: $V3 }, { 12: [1, 30] }, { 14: [1, 31] }, { 16: [1, 32] }, { 18: [1, 33] }, o($V8, [2, 13]), o($V8, [2, 14]), o($V8, [2, 15]), o($V8, $V9, { 21: 8, 9: 16, 10: 17, 5: 24, 1: [2, 4], 11: $Va, 13: $Vb, 15: $Vc, 17: $Vd, 19: $Ve, 20: $Vf, 29: $V4 }), o($Vh, [2, 16]), { 25: 34, 31: [1, 35] }, o($Vh, [2, 24]), o($V5, [2, 7]), o($V8, [2, 9]), o($V8, [2, 10]), o($V8, [2, 11]), o($V8, [2, 12]), { 23: 36, 32: $Vg }, { 32: [2, 23] }, o($Vh, [2, 17])], - defaultActions: { 9: [2, 21], 10: [2, 1], 11: [2, 2], 35: [2, 23] }, - parseError: function parseError2(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 parseError2(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 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; - }, - // unshifts one char (or a string) into the input - unput: 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 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, 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 && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = 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[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 - }); - } - }, - // 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 29; - case 1: - this.begin("type_directive"); - return 30; - case 2: - this.popState(); - this.begin("arg_directive"); - return 24; - case 3: - this.popState(); - this.popState(); - return 32; - case 4: - return 31; - case 5: - break; - case 6: - break; - case 7: - return 26; - case 8: - break; - case 9: - break; - case 10: - this.begin("title"); - return 13; - case 11: - this.popState(); - return "title_value"; - case 12: - this.begin("acc_title"); - return 15; - case 13: - this.popState(); - return "acc_title_value"; - case 14: - this.begin("acc_descr"); - return 17; - case 15: - this.popState(); - return "acc_descr_value"; - case 16: - this.begin("acc_descr_multiline"); - break; - case 17: - this.popState(); - break; - case 18: - return "acc_descr_multiline_value"; - case 19: - this.begin("string"); - break; - case 20: - this.popState(); - break; - case 21: - return "txt"; - case 22: - return 6; - case 23: - return 8; - case 24: - return "value"; - case 25: - return 28; - } - }, - rules: [/^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:%%(?!\{)[^\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": [17, 18], "inclusive": false }, "acc_descr": { "rules": [15], "inclusive": false }, "acc_title": { "rules": [13], "inclusive": false }, "close_directive": { "rules": [], "inclusive": false }, "arg_directive": { "rules": [3, 4], "inclusive": false }, "type_directive": { "rules": [2, 3], "inclusive": false }, "open_directive": { "rules": [1], "inclusive": false }, "title": { "rules": [11], "inclusive": false }, "string": { "rules": [20, 21], "inclusive": false }, "INITIAL": { "rules": [0, 5, 6, 7, 8, 9, 10, 12, 14, 16, 19, 22, 23, 24, 25], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser() { - this.yy = {}; - } - Parser.prototype = parser2; - parser2.Parser = Parser; - return new Parser(); - }(); - parser$d.parser = parser$d; - const parser$e = parser$d; - let sections$2 = {}; - let showData = false; - const parseDirective$6 = function(statement, context, type2) { - mermaidAPI.parseDirective(this, statement, context, type2); - }; - const addSection$2 = function(id2, value) { - id2 = common$1.sanitizeText(id2, getConfig$1()); - if (sections$2[id2] === void 0) { - sections$2[id2] = value; - log$1.debug("Added new section :", id2); } - }; - const getSections$2 = () => sections$2; - const setShowData = function(toggle) { - showData = toggle; - }; - const getShowData = function() { - return showData; - }; - const cleanupValue = function(value) { - if (value.substring(0, 1) === ":") { - value = value.substring(1).trim(); - return Number(value.trim()); - } else { - return Number(value.trim()); + stack || (stack = new Stack_default()); + var stacked = stack.get(value2); + if (stacked) { + return stacked; } - }; - const clear$7 = function() { - sections$2 = {}; - showData = false; - clear$i(); - }; - const db$6 = { - parseDirective: parseDirective$6, - getConfig: () => getConfig$1().pie, - addSection: addSection$2, - getSections: getSections$2, - cleanupValue, - clear: clear$7, - setAccTitle, - getAccTitle, - setDiagramTitle, - getDiagramTitle, - setShowData, - getShowData, - getAccDescription, - setAccDescription - }; - const getStyles$8 = (options2) => ` - .pieCircle{ - stroke: ${options2.pieStrokeColor}; - stroke-width : ${options2.pieStrokeWidth}; - opacity : ${options2.pieOpacity}; - } - .pieOuterCircle{ - stroke: ${options2.pieOuterStrokeColor}; - stroke-width: ${options2.pieOuterStrokeWidth}; - fill: none; - } - .pieTitleText { - text-anchor: middle; - font-size: ${options2.pieTitleTextSize}; - fill: ${options2.pieTitleTextColor}; - font-family: ${options2.fontFamily}; - } - .slice { - font-family: ${options2.fontFamily}; - fill: ${options2.pieSectionTextColor}; - font-size:${options2.pieSectionTextSize}; - // fill: white; - } - .legend text { - fill: ${options2.pieLegendTextColor}; - font-family: ${options2.fontFamily}; - font-size: ${options2.pieLegendTextSize}; - } -`; - const styles$7 = getStyles$8; - let conf$6 = getConfig$1(); - let width; - const height = 450; - const draw$a = (txt, id2, _version, diagObj) => { - var _a; - try { - conf$6 = getConfig$1(); - log$1.debug("Rendering info diagram\n" + txt); - const securityLevel = getConfig$1().securityLevel; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); - const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; - diagObj.db.clear(); - diagObj.parser.parse(txt); - log$1.debug("Parsed info diagram"); - const elem = doc.getElementById(id2); - width = elem.parentElement.offsetWidth; - if (width === void 0) { - width = 1200; - } - if (conf$6.useWidth !== void 0) { - width = conf$6.useWidth; - } - if (conf$6.pie.useWidth !== void 0) { - width = conf$6.pie.useWidth; - } - const diagram2 = root2.select("#" + id2); - configureSvgSize(diagram2, height, width, conf$6.pie.useMaxWidth); - elem.setAttribute("viewBox", "0 0 " + width + " " + height); - var margin = 40; - var legendRectSize = 18; - var legendSpacing = 4; - var radius = Math.min(width, height) / 2 - margin; - var svg2 = diagram2.append("g").attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); - var data = diagObj.db.getSections(); - var sum = 0; - Object.keys(data).forEach(function(key) { - sum += data[key]; - }); - const themeVariables = conf$6.themeVariables; - var 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 textPosition = ((_a = conf$6.pie) == null ? void 0 : _a.textPosition) ?? 0.75; - let [outerStrokeWidth] = parseFontSize(themeVariables.pieOuterStrokeWidth); - outerStrokeWidth ?? (outerStrokeWidth = 2); - var color2 = ordinal().range(myGeneratedColors); - var pieData = Object.entries(data).map(function(el, idx) { - return { - order: idx, - name: el[0], - value: el[1] - }; - }); - var pie2 = d3pie().value(function(d) { - return d.value; - }).sort(function(a, b) { - return a.order - b.order; + stack.set(value2, result); + if (isSet_default(value2)) { + value2.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value2, stack)); }); - var dataReady = pie2(pieData); - var arcGenerator = d3arc().innerRadius(0).outerRadius(radius); - var labelArcGenerator = d3arc().innerRadius(radius * textPosition).outerRadius(radius * textPosition); - svg2.append("circle").attr("cx", 0).attr("cy", 0).attr("r", radius + outerStrokeWidth / 2).attr("class", "pieOuterCircle"); - svg2.selectAll("mySlices").data(dataReady).enter().append("path").attr("d", arcGenerator).attr("fill", function(d) { - return color2(d.data.name); - }).attr("class", "pieCircle"); - svg2.selectAll("mySlices").data(dataReady).enter().append("text").text(function(d) { - return (d.data.value / sum * 100).toFixed(0) + "%"; - }).attr("transform", function(d) { - return "translate(" + labelArcGenerator.centroid(d) + ")"; - }).style("text-anchor", "middle").attr("class", "slice"); - svg2.append("text").text(diagObj.db.getDiagramTitle()).attr("x", 0).attr("y", -(height - 50) / 2).attr("class", "pieTitleText"); - var legend = svg2.selectAll(".legend").data(color2.domain()).enter().append("g").attr("class", "legend").attr("transform", function(d, i2) { - const height2 = legendRectSize + legendSpacing; - const offset = height2 * color2.domain().length / 2; - const horizontal = 12 * legendRectSize; - const vertical = i2 * height2 - offset; - return "translate(" + horizontal + "," + vertical + ")"; - }); - legend.append("rect").attr("width", legendRectSize).attr("height", legendRectSize).style("fill", color2).style("stroke", color2); - legend.data(dataReady).append("text").attr("x", legendRectSize + legendSpacing).attr("y", legendRectSize - legendSpacing).text(function(d) { - if (diagObj.db.getShowData() || conf$6.showData || conf$6.pie.showData) { - return d.data.name + " [" + d.data.value + "]"; - } else { - return d.data.name; - } + } else if (isMap_default(value2)) { + value2.forEach(function(subValue, key2) { + result.set(key2, baseClone(subValue, bitmask, customizer, key2, value2, stack)); }); - } catch (e) { - log$1.error("Error while rendering info diagram"); - log$1.error(e); } - }; - const renderer$9 = { - draw: draw$a - }; - const diagram$a = { - parser: parser$e, - db: db$6, - renderer: renderer$9, - styles: styles$7 - }; - const pieDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$a - }, Symbol.toStringTag, { value: "Module" })); - var parser$b = 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, 5], $V2 = [1, 6], $V3 = [1, 7], $V4 = [1, 8], $V5 = [5, 6, 8, 14, 16, 18, 19, 40, 41, 42, 43, 44, 45, 53, 71, 72], $V6 = [1, 22], $V7 = [2, 13], $V8 = [1, 26], $V9 = [1, 27], $Va = [1, 28], $Vb = [1, 29], $Vc = [1, 30], $Vd = [1, 31], $Ve = [1, 24], $Vf = [1, 32], $Vg = [1, 33], $Vh = [1, 36], $Vi = [71, 72], $Vj = [5, 8, 14, 16, 18, 19, 40, 41, 42, 43, 44, 45, 53, 60, 62, 71, 72], $Vk = [1, 56], $Vl = [1, 57], $Vm = [1, 58], $Vn = [1, 59], $Vo = [1, 60], $Vp = [1, 61], $Vq = [1, 62], $Vr = [62, 63], $Vs = [1, 74], $Vt = [1, 70], $Vu = [1, 71], $Vv = [1, 72], $Vw = [1, 73], $Vx = [1, 75], $Vy = [1, 79], $Vz = [1, 80], $VA = [1, 77], $VB = [1, 78], $VC = [5, 8, 14, 16, 18, 19, 40, 41, 42, 43, 44, 45, 53, 71, 72]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "directive": 4, "NEWLINE": 5, "RD": 6, "diagram": 7, "EOF": 8, "openDirective": 9, "typeDirective": 10, "closeDirective": 11, ":": 12, "argDirective": 13, "acc_title": 14, "acc_title_value": 15, "acc_descr": 16, "acc_descr_value": 17, "acc_descr_multiline_value": 18, "open_directive": 19, "type_directive": 20, "arg_directive": 21, "close_directive": 22, "requirementDef": 23, "elementDef": 24, "relationshipDef": 25, "requirementType": 26, "requirementName": 27, "STRUCT_START": 28, "requirementBody": 29, "ID": 30, "COLONSEP": 31, "id": 32, "TEXT": 33, "text": 34, "RISK": 35, "riskLevel": 36, "VERIFYMTHD": 37, "verifyType": 38, "STRUCT_STOP": 39, "REQUIREMENT": 40, "FUNCTIONAL_REQUIREMENT": 41, "INTERFACE_REQUIREMENT": 42, "PERFORMANCE_REQUIREMENT": 43, "PHYSICAL_REQUIREMENT": 44, "DESIGN_CONSTRAINT": 45, "LOW_RISK": 46, "MED_RISK": 47, "HIGH_RISK": 48, "VERIFY_ANALYSIS": 49, "VERIFY_DEMONSTRATION": 50, "VERIFY_INSPECTION": 51, "VERIFY_TEST": 52, "ELEMENT": 53, "elementName": 54, "elementBody": 55, "TYPE": 56, "type": 57, "DOCREF": 58, "ref": 59, "END_ARROW_L": 60, "relationship": 61, "LINE": 62, "END_ARROW_R": 63, "CONTAINS": 64, "COPIES": 65, "DERIVES": 66, "SATISFIES": 67, "VERIFIES": 68, "REFINES": 69, "TRACES": 70, "unqString": 71, "qString": 72, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 5: "NEWLINE", 6: "RD", 8: "EOF", 12: ":", 14: "acc_title", 15: "acc_title_value", 16: "acc_descr", 17: "acc_descr_value", 18: "acc_descr_multiline_value", 19: "open_directive", 20: "type_directive", 21: "arg_directive", 22: "close_directive", 28: "STRUCT_START", 30: "ID", 31: "COLONSEP", 33: "TEXT", 35: "RISK", 37: "VERIFYMTHD", 39: "STRUCT_STOP", 40: "REQUIREMENT", 41: "FUNCTIONAL_REQUIREMENT", 42: "INTERFACE_REQUIREMENT", 43: "PERFORMANCE_REQUIREMENT", 44: "PHYSICAL_REQUIREMENT", 45: "DESIGN_CONSTRAINT", 46: "LOW_RISK", 47: "MED_RISK", 48: "HIGH_RISK", 49: "VERIFY_ANALYSIS", 50: "VERIFY_DEMONSTRATION", 51: "VERIFY_INSPECTION", 52: "VERIFY_TEST", 53: "ELEMENT", 56: "TYPE", 58: "DOCREF", 60: "END_ARROW_L", 62: "LINE", 63: "END_ARROW_R", 64: "CONTAINS", 65: "COPIES", 66: "DERIVES", 67: "SATISFIES", 68: "VERIFIES", 69: "REFINES", 70: "TRACES", 71: "unqString", 72: "qString" }, - productions_: [0, [3, 3], [3, 2], [3, 4], [4, 3], [4, 5], [4, 2], [4, 2], [4, 1], [9, 1], [10, 1], [13, 1], [11, 1], [7, 0], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [23, 5], [29, 5], [29, 5], [29, 5], [29, 5], [29, 2], [29, 1], [26, 1], [26, 1], [26, 1], [26, 1], [26, 1], [26, 1], [36, 1], [36, 1], [36, 1], [38, 1], [38, 1], [38, 1], [38, 1], [24, 5], [55, 5], [55, 5], [55, 2], [55, 1], [25, 5], [25, 5], [61, 1], [61, 1], [61, 1], [61, 1], [61, 1], [61, 1], [61, 1], [27, 1], [27, 1], [32, 1], [32, 1], [34, 1], [34, 1], [54, 1], [54, 1], [57, 1], [57, 1], [59, 1], [59, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 6: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 7: - case 8: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 9: - yy.parseDirective("%%{", "open_directive"); - break; - case 10: - yy.parseDirective($$[$0], "type_directive"); - break; - case 11: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); - yy.parseDirective($$[$0], "arg_directive"); - break; - case 12: - yy.parseDirective("}%%", "close_directive", "pie"); - break; - case 13: - this.$ = []; - break; - case 19: - yy.addRequirement($$[$0 - 3], $$[$0 - 4]); - break; - case 20: - yy.setNewReqId($$[$0 - 2]); - break; - case 21: - yy.setNewReqText($$[$0 - 2]); - break; - case 22: - yy.setNewReqRisk($$[$0 - 2]); - break; - case 23: - yy.setNewReqVerifyMethod($$[$0 - 2]); - break; - case 26: - this.$ = yy.RequirementType.REQUIREMENT; - break; - case 27: - this.$ = yy.RequirementType.FUNCTIONAL_REQUIREMENT; - break; - case 28: - this.$ = yy.RequirementType.INTERFACE_REQUIREMENT; - break; - case 29: - this.$ = yy.RequirementType.PERFORMANCE_REQUIREMENT; - break; - case 30: - this.$ = yy.RequirementType.PHYSICAL_REQUIREMENT; - break; - case 31: - this.$ = yy.RequirementType.DESIGN_CONSTRAINT; - break; - case 32: - this.$ = yy.RiskLevel.LOW_RISK; - break; - case 33: - this.$ = yy.RiskLevel.MED_RISK; - break; - case 34: - this.$ = yy.RiskLevel.HIGH_RISK; - break; - case 35: - this.$ = yy.VerifyType.VERIFY_ANALYSIS; - break; - case 36: - this.$ = yy.VerifyType.VERIFY_DEMONSTRATION; - break; - case 37: - this.$ = yy.VerifyType.VERIFY_INSPECTION; - break; - case 38: - this.$ = yy.VerifyType.VERIFY_TEST; - break; - case 39: - yy.addElement($$[$0 - 3]); - break; - case 40: - yy.setNewElementType($$[$0 - 2]); - break; - case 41: - yy.setNewElementDocRef($$[$0 - 2]); - break; - case 44: - yy.addRelationship($$[$0 - 2], $$[$0], $$[$0 - 4]); - break; - case 45: - yy.addRelationship($$[$0 - 2], $$[$0 - 4], $$[$0]); - break; - case 46: - this.$ = yy.Relationships.CONTAINS; - break; - case 47: - this.$ = yy.Relationships.COPIES; - break; - case 48: - this.$ = yy.Relationships.DERIVES; - break; - case 49: - this.$ = yy.Relationships.SATISFIES; - break; - case 50: - this.$ = yy.Relationships.VERIFIES; - break; - case 51: - this.$ = yy.Relationships.REFINES; - break; - case 52: - this.$ = yy.Relationships.TRACES; - break; - } - }, - table: [{ 3: 1, 4: 2, 6: $V0, 9: 4, 14: $V1, 16: $V2, 18: $V3, 19: $V4 }, { 1: [3] }, { 3: 10, 4: 2, 5: [1, 9], 6: $V0, 9: 4, 14: $V1, 16: $V2, 18: $V3, 19: $V4 }, { 5: [1, 11] }, { 10: 12, 20: [1, 13] }, { 15: [1, 14] }, { 17: [1, 15] }, o($V5, [2, 8]), { 20: [2, 9] }, { 3: 16, 4: 2, 6: $V0, 9: 4, 14: $V1, 16: $V2, 18: $V3, 19: $V4 }, { 1: [2, 2] }, { 4: 21, 5: $V6, 7: 17, 8: $V7, 9: 4, 14: $V1, 16: $V2, 18: $V3, 19: $V4, 23: 18, 24: 19, 25: 20, 26: 23, 32: 25, 40: $V8, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 53: $Ve, 71: $Vf, 72: $Vg }, { 11: 34, 12: [1, 35], 22: $Vh }, o([12, 22], [2, 10]), o($V5, [2, 6]), o($V5, [2, 7]), { 1: [2, 1] }, { 8: [1, 37] }, { 4: 21, 5: $V6, 7: 38, 8: $V7, 9: 4, 14: $V1, 16: $V2, 18: $V3, 19: $V4, 23: 18, 24: 19, 25: 20, 26: 23, 32: 25, 40: $V8, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 53: $Ve, 71: $Vf, 72: $Vg }, { 4: 21, 5: $V6, 7: 39, 8: $V7, 9: 4, 14: $V1, 16: $V2, 18: $V3, 19: $V4, 23: 18, 24: 19, 25: 20, 26: 23, 32: 25, 40: $V8, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 53: $Ve, 71: $Vf, 72: $Vg }, { 4: 21, 5: $V6, 7: 40, 8: $V7, 9: 4, 14: $V1, 16: $V2, 18: $V3, 19: $V4, 23: 18, 24: 19, 25: 20, 26: 23, 32: 25, 40: $V8, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 53: $Ve, 71: $Vf, 72: $Vg }, { 4: 21, 5: $V6, 7: 41, 8: $V7, 9: 4, 14: $V1, 16: $V2, 18: $V3, 19: $V4, 23: 18, 24: 19, 25: 20, 26: 23, 32: 25, 40: $V8, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 53: $Ve, 71: $Vf, 72: $Vg }, { 4: 21, 5: $V6, 7: 42, 8: $V7, 9: 4, 14: $V1, 16: $V2, 18: $V3, 19: $V4, 23: 18, 24: 19, 25: 20, 26: 23, 32: 25, 40: $V8, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 53: $Ve, 71: $Vf, 72: $Vg }, { 27: 43, 71: [1, 44], 72: [1, 45] }, { 54: 46, 71: [1, 47], 72: [1, 48] }, { 60: [1, 49], 62: [1, 50] }, o($Vi, [2, 26]), o($Vi, [2, 27]), o($Vi, [2, 28]), o($Vi, [2, 29]), o($Vi, [2, 30]), o($Vi, [2, 31]), o($Vj, [2, 55]), o($Vj, [2, 56]), o($V5, [2, 4]), { 13: 51, 21: [1, 52] }, o($V5, [2, 12]), { 1: [2, 3] }, { 8: [2, 14] }, { 8: [2, 15] }, { 8: [2, 16] }, { 8: [2, 17] }, { 8: [2, 18] }, { 28: [1, 53] }, { 28: [2, 53] }, { 28: [2, 54] }, { 28: [1, 54] }, { 28: [2, 59] }, { 28: [2, 60] }, { 61: 55, 64: $Vk, 65: $Vl, 66: $Vm, 67: $Vn, 68: $Vo, 69: $Vp, 70: $Vq }, { 61: 63, 64: $Vk, 65: $Vl, 66: $Vm, 67: $Vn, 68: $Vo, 69: $Vp, 70: $Vq }, { 11: 64, 22: $Vh }, { 22: [2, 11] }, { 5: [1, 65] }, { 5: [1, 66] }, { 62: [1, 67] }, o($Vr, [2, 46]), o($Vr, [2, 47]), o($Vr, [2, 48]), o($Vr, [2, 49]), o($Vr, [2, 50]), o($Vr, [2, 51]), o($Vr, [2, 52]), { 63: [1, 68] }, o($V5, [2, 5]), { 5: $Vs, 29: 69, 30: $Vt, 33: $Vu, 35: $Vv, 37: $Vw, 39: $Vx }, { 5: $Vy, 39: $Vz, 55: 76, 56: $VA, 58: $VB }, { 32: 81, 71: $Vf, 72: $Vg }, { 32: 82, 71: $Vf, 72: $Vg }, o($VC, [2, 19]), { 31: [1, 83] }, { 31: [1, 84] }, { 31: [1, 85] }, { 31: [1, 86] }, { 5: $Vs, 29: 87, 30: $Vt, 33: $Vu, 35: $Vv, 37: $Vw, 39: $Vx }, o($VC, [2, 25]), o($VC, [2, 39]), { 31: [1, 88] }, { 31: [1, 89] }, { 5: $Vy, 39: $Vz, 55: 90, 56: $VA, 58: $VB }, o($VC, [2, 43]), o($VC, [2, 44]), o($VC, [2, 45]), { 32: 91, 71: $Vf, 72: $Vg }, { 34: 92, 71: [1, 93], 72: [1, 94] }, { 36: 95, 46: [1, 96], 47: [1, 97], 48: [1, 98] }, { 38: 99, 49: [1, 100], 50: [1, 101], 51: [1, 102], 52: [1, 103] }, o($VC, [2, 24]), { 57: 104, 71: [1, 105], 72: [1, 106] }, { 59: 107, 71: [1, 108], 72: [1, 109] }, o($VC, [2, 42]), { 5: [1, 110] }, { 5: [1, 111] }, { 5: [2, 57] }, { 5: [2, 58] }, { 5: [1, 112] }, { 5: [2, 32] }, { 5: [2, 33] }, { 5: [2, 34] }, { 5: [1, 113] }, { 5: [2, 35] }, { 5: [2, 36] }, { 5: [2, 37] }, { 5: [2, 38] }, { 5: [1, 114] }, { 5: [2, 61] }, { 5: [2, 62] }, { 5: [1, 115] }, { 5: [2, 63] }, { 5: [2, 64] }, { 5: $Vs, 29: 116, 30: $Vt, 33: $Vu, 35: $Vv, 37: $Vw, 39: $Vx }, { 5: $Vs, 29: 117, 30: $Vt, 33: $Vu, 35: $Vv, 37: $Vw, 39: $Vx }, { 5: $Vs, 29: 118, 30: $Vt, 33: $Vu, 35: $Vv, 37: $Vw, 39: $Vx }, { 5: $Vs, 29: 119, 30: $Vt, 33: $Vu, 35: $Vv, 37: $Vw, 39: $Vx }, { 5: $Vy, 39: $Vz, 55: 120, 56: $VA, 58: $VB }, { 5: $Vy, 39: $Vz, 55: 121, 56: $VA, 58: $VB }, o($VC, [2, 20]), o($VC, [2, 21]), o($VC, [2, 22]), o($VC, [2, 23]), o($VC, [2, 40]), o($VC, [2, 41])], - defaultActions: { 8: [2, 9], 10: [2, 2], 16: [2, 1], 37: [2, 3], 38: [2, 14], 39: [2, 15], 40: [2, 16], 41: [2, 17], 42: [2, 18], 44: [2, 53], 45: [2, 54], 47: [2, 59], 48: [2, 60], 52: [2, 11], 93: [2, 57], 94: [2, 58], 96: [2, 32], 97: [2, 33], 98: [2, 34], 100: [2, 35], 101: [2, 36], 102: [2, 37], 103: [2, 38], 105: [2, 61], 106: [2, 62], 108: [2, 63], 109: [2, 64] }, - parseError: function parseError2(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 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]; } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError2(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 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; - }, - // unshifts one char (or a string) into the input - unput: 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 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, 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 && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = 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[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 - }); - } - }, - // 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 19; - case 1: - this.begin("type_directive"); - return 20; - case 2: - this.popState(); - this.begin("arg_directive"); - return 12; - case 3: - this.popState(); - this.popState(); - return 22; - case 4: - return 21; - case 5: - return "title"; - case 6: - this.begin("acc_title"); - return 14; - case 7: - this.popState(); - return "acc_title_value"; - case 8: - this.begin("acc_descr"); - return 16; - 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 5; - case 14: - break; - case 15: - break; - case 16: - break; - case 17: - return 8; - case 18: - return 6; - case 19: - return 28; - case 20: - return 39; - case 21: - return 31; - case 22: - return 30; - case 23: - return 33; - case 24: - return 35; - case 25: - return 37; - case 26: - return 40; - case 27: - return 41; - case 28: - return 42; - case 29: - return 43; - case 30: - return 44; - case 31: - return 45; - case 32: - return 46; - case 33: - return 47; - case 34: - return 48; - case 35: - return 49; - case 36: - return 50; - case 37: - return 51; - case 38: - return 52; - case 39: - return 53; - case 40: - return 64; - case 41: - return 65; - case 42: - return 66; - case 43: - return 67; - case 44: - return 68; - case 45: - return 69; - case 46: - return 70; - case 47: - return 56; - case 48: - return 58; - case 49: - return 60; - case 50: - return 63; - case 51: - return 62; - case 52: - this.begin("string"); - break; - case 53: - this.popState(); - break; - case 54: - return "qString"; - case 55: - yy_.yytext = yy_.yytext.trim(); - return 71; - } - }, - rules: [/^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\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, /^(?:(\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": [11, 12], "inclusive": false }, "acc_descr": { "rules": [9], "inclusive": false }, "acc_title": { "rules": [7], "inclusive": false }, "close_directive": { "rules": [], "inclusive": false }, "arg_directive": { "rules": [3, 4], "inclusive": false }, "type_directive": { "rules": [2, 3], "inclusive": false }, "open_directive": { "rules": [1], "inclusive": false }, "unqString": { "rules": [], "inclusive": false }, "token": { "rules": [], "inclusive": false }, "string": { "rules": [53, 54], "inclusive": false }, "INITIAL": { "rules": [0, 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, 55], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser() { - this.yy = {}; - } - Parser.prototype = parser2; - parser2.Parser = Parser; - return new Parser(); - }(); - parser$b.parser = parser$b; - const parser$c = parser$b; - 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 parseDirective$5 = function(statement, context, type2) { - mermaidAPI.parseDirective(this, statement, context, type2); - }; - const addRequirement = (name2, type2) => { - if (requirements[name2] === void 0) { - requirements[name2] = { - name: name2, - type: type2, - id: latestRequirement.id, - text: latestRequirement.text, - risk: latestRequirement.risk, - verifyMethod: latestRequirement.verifyMethod - }; - } - latestRequirement = {}; - return requirements[name2]; - }; - 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; + assignValue_default(result, key2, baseClone(subValue, bitmask, customizer, key2, value2, stack)); + }); + return result; + } + 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; } - }; - const setNewReqVerifyMethod = (verifyMethod) => { - if (latestRequirement !== void 0) { - latestRequirement.verifyMethod = verifyMethod; + }); + + // ../../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; } - }; - const addElement = (name2) => { - if (elements$1[name2] === void 0) { - elements$1[name2] = { - name: name2, - type: latestElement.type, - docRef: latestElement.docRef - }; - log$1.info("Added new requirement: ", name2); + }); + + // ../../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; } - latestElement = {}; - return elements$1[name2]; - }; - const getElements = () => elements$1; - const setNewElementType = (type2) => { - if (latestElement !== void 0) { - latestElement.type = type2; + }); + + // ../../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; + } } - }; - const setNewElementDocRef = (docRef) => { - if (latestElement !== void 0) { - latestElement.docRef = docRef; + return result; + } + 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; } - }; - const addRelationship = (type2, src, dst) => { - relations$1.push({ - type: type2, - src, - dst - }); - }; - const getRelationships = () => relations$1; - const clear$6 = () => { - relations$1 = []; - latestRequirement = {}; - requirements = {}; - latestElement = {}; - elements$1 = {}; - clear$i(); - }; - const db$5 = { - RequirementType, - RiskLevel, - VerifyType, - Relationships, - parseDirective: parseDirective$5, - getConfig: () => getConfig$1().req, - addRequirement, - getRequirements, - setNewReqId, - setNewReqText, - setNewReqRisk, - setNewReqVerifyMethod, - setAccTitle, - getAccTitle, - setAccDescription, - getAccDescription, - addElement, - getElements, - setNewElementType, - setNewElementDocRef, - addRelationship, - getRelationships, - clear: clear$6 - }; - const getStyles$7 = (options2) => ` + }); - marker { - fill: ${options2.relationColor}; - stroke: ${options2.relationColor}; + // ../../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; } + 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; + } + }); - marker.cross { - stroke: ${options2.lineColor}; + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheHas.js + function setCacheHas(value2) { + return this.__data__.has(value2); } + 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; + } + }); - svg { - font-family: ${options2.fontFamily}; - font-size: ${options2.fontSize}; + // ../../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; + } + }); - .reqBox { - fill: ${options2.requirementBackground}; - fill-opacity: 1.0; - stroke: ${options2.requirementBorderColor}; - stroke-width: ${options2.requirementBorderSize}; - } - - .reqTitle, .reqLabel{ - fill: ${options2.requirementTextColor}; - } - .reqLabelBox { - fill: ${options2.relationLabelBackground}; - fill-opacity: 1.0; + // ../../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; + } + } + return false; } + 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; + } + }); - .req-title-line { - stroke: ${options2.requirementBorderColor}; - stroke-width: ${options2.requirementBorderSize}; - } - .relationshipLine { - stroke: ${options2.relationColor}; - stroke-width: 1; - } - .relationshipLabel { - fill: ${options2.relationLabelColor}; + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cacheHas.js + function cacheHas(cache3, key) { + return cache3.has(key); } + 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; + } + }); -`; - const styles$6 = getStyles$7; - 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); - } 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); - } - 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) + "..."; - } else { - wrappedTxts[wrappedTxts.length] = textStr; + // ../../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); } - 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, rel, g, insert, diagObj) { - const edge = g.edge(elementString(rel.src), elementString(rel.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 (rel.type == diagObj.db.Relationships.CONTAINS) { - svgPath.attr( - "marker-start", - "url(" + common$1.getUrl(conf$5.arrowMarkerAbsolute) + "#" + rel.type + "_line_ending)" - ); - } else { - svgPath.attr("stroke-dasharray", "10,7"); - svgPath.attr( - "marker-end", - "url(" + common$1.getUrl(conf$5.arrowMarkerAbsolute) + "#" + markers.ReqMarkers.ARROW + "_line_ending)" - ); - } - addEdgeLabel(svg2, svgPath, conf$5, `<<${rel.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) + " )" - ); + if (compared !== void 0) { + if (compared) { + continue; + } + result = false; + break; } + 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; + } + 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; + } + }); + + // ../../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; - }; - const elementString = (str2) => { - return str2.replace(/\s/g, "").replace(/\./g, "_"); - }; - const draw$9 = (text2, id2, _version, diagObj) => { - conf$5 = getConfig$1().requirement; - diagObj.db.clear(); - diagObj.parser.parse(text2); - const securityLevel = conf$5.securityLevel; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("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(g); - adjustEntities(svg2, g); - relationships2.forEach(function(rel) { - drawRelationshipFromLayout(svg2, rel, g, id2, diagObj); + return result; + } + 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; }); - const padding2 = conf$5.rect_padding; - const svgBounds = svg2.node().getBBox(); - const width2 = svgBounds.width + padding2 * 2; - const height2 = svgBounds.height + padding2 * 2; - configureSvgSize(svg2, height2, width2, conf$5.useMaxWidth); - svg2.attr("viewBox", `${svgBounds.x - padding2} ${svgBounds.y - padding2} ${width2} ${height2}`); - }; - const renderer$8 = { - draw: draw$9 - }; - const diagram$9 = { - parser: parser$c, - db: db$5, - renderer: renderer$8, - styles: styles$6 - }; - const requirementDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$9 - }, Symbol.toStringTag, { value: "Module" })); - var parser$9 = 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, 5], $V3 = [1, 7], $V4 = [2, 5], $V5 = [1, 15], $V6 = [1, 17], $V7 = [1, 19], $V8 = [1, 21], $V9 = [1, 22], $Va = [1, 23], $Vb = [1, 29], $Vc = [1, 30], $Vd = [1, 31], $Ve = [1, 32], $Vf = [1, 33], $Vg = [1, 34], $Vh = [1, 35], $Vi = [1, 36], $Vj = [1, 37], $Vk = [1, 38], $Vl = [1, 39], $Vm = [1, 40], $Vn = [1, 42], $Vo = [1, 43], $Vp = [1, 45], $Vq = [1, 46], $Vr = [1, 47], $Vs = [1, 48], $Vt = [1, 49], $Vu = [1, 50], $Vv = [1, 53], $Vw = [1, 4, 5, 19, 21, 23, 26, 28, 34, 35, 36, 38, 40, 41, 42, 43, 44, 46, 48, 50, 51, 52, 53, 54, 56, 57, 62, 63, 64, 65, 73, 83], $Vx = [4, 5, 21, 54, 56], $Vy = [4, 5, 19, 21, 23, 26, 28, 34, 35, 36, 38, 40, 41, 42, 43, 44, 46, 48, 50, 54, 56, 57, 62, 63, 64, 65, 73, 83], $Vz = [4, 5, 19, 21, 23, 26, 28, 34, 35, 36, 38, 40, 41, 42, 43, 44, 46, 48, 50, 53, 54, 56, 57, 62, 63, 64, 65, 73, 83], $VA = [4, 5, 19, 21, 23, 26, 28, 34, 35, 36, 38, 40, 41, 42, 43, 44, 46, 48, 50, 52, 54, 56, 57, 62, 63, 64, 65, 73, 83], $VB = [4, 5, 19, 21, 23, 26, 28, 34, 35, 36, 38, 40, 41, 42, 43, 44, 46, 48, 50, 51, 54, 56, 57, 62, 63, 64, 65, 73, 83], $VC = [71, 72, 73], $VD = [1, 125], $VE = [1, 4, 5, 7, 19, 21, 23, 26, 28, 34, 35, 36, 38, 40, 41, 42, 43, 44, 46, 48, 50, 51, 52, 53, 54, 56, 57, 62, 63, 64, 65, 73, 83]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "SPACE": 4, "NEWLINE": 5, "directive": 6, "SD": 7, "document": 8, "line": 9, "statement": 10, "box_section": 11, "box_line": 12, "participant_statement": 13, "openDirective": 14, "typeDirective": 15, "closeDirective": 16, ":": 17, "argDirective": 18, "box": 19, "restOfLine": 20, "end": 21, "signal": 22, "autonumber": 23, "NUM": 24, "off": 25, "activate": 26, "actor": 27, "deactivate": 28, "note_statement": 29, "links_statement": 30, "link_statement": 31, "properties_statement": 32, "details_statement": 33, "title": 34, "legacy_title": 35, "acc_title": 36, "acc_title_value": 37, "acc_descr": 38, "acc_descr_value": 39, "acc_descr_multiline_value": 40, "loop": 41, "rect": 42, "opt": 43, "alt": 44, "else_sections": 45, "par": 46, "par_sections": 47, "critical": 48, "option_sections": 49, "break": 50, "option": 51, "and": 52, "else": 53, "participant": 54, "AS": 55, "participant_actor": 56, "note": 57, "placement": 58, "text2": 59, "over": 60, "actor_pair": 61, "links": 62, "link": 63, "properties": 64, "details": 65, "spaceList": 66, ",": 67, "left_of": 68, "right_of": 69, "signaltype": 70, "+": 71, "-": 72, "ACTOR": 73, "SOLID_OPEN_ARROW": 74, "DOTTED_OPEN_ARROW": 75, "SOLID_ARROW": 76, "DOTTED_ARROW": 77, "SOLID_CROSS": 78, "DOTTED_CROSS": 79, "SOLID_POINT": 80, "DOTTED_POINT": 81, "TXT": 82, "open_directive": 83, "type_directive": 84, "arg_directive": 85, "close_directive": 86, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 7: "SD", 17: ":", 19: "box", 20: "restOfLine", 21: "end", 23: "autonumber", 24: "NUM", 25: "off", 26: "activate", 28: "deactivate", 34: "title", 35: "legacy_title", 36: "acc_title", 37: "acc_title_value", 38: "acc_descr", 39: "acc_descr_value", 40: "acc_descr_multiline_value", 41: "loop", 42: "rect", 43: "opt", 44: "alt", 46: "par", 48: "critical", 50: "break", 51: "option", 52: "and", 53: "else", 54: "participant", 55: "AS", 56: "participant_actor", 57: "note", 60: "over", 62: "links", 63: "link", 64: "properties", 65: "details", 67: ",", 68: "left_of", 69: "right_of", 71: "+", 72: "-", 73: "ACTOR", 74: "SOLID_OPEN_ARROW", 75: "DOTTED_OPEN_ARROW", 76: "SOLID_ARROW", 77: "DOTTED_ARROW", 78: "SOLID_CROSS", 79: "DOTTED_CROSS", 80: "SOLID_POINT", 81: "DOTTED_POINT", 82: "TXT", 83: "open_directive", 84: "type_directive", 85: "arg_directive", 86: "close_directive" }, - productions_: [0, [3, 2], [3, 2], [3, 2], [3, 2], [8, 0], [8, 2], [9, 2], [9, 1], [9, 1], [11, 0], [11, 2], [12, 2], [12, 1], [12, 1], [6, 4], [6, 6], [10, 1], [10, 4], [10, 2], [10, 4], [10, 3], [10, 3], [10, 2], [10, 3], [10, 3], [10, 2], [10, 2], [10, 2], [10, 2], [10, 2], [10, 1], [10, 1], [10, 2], [10, 2], [10, 1], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [10, 1], [49, 1], [49, 4], [47, 1], [47, 4], [45, 1], [45, 4], [13, 5], [13, 3], [13, 5], [13, 3], [29, 4], [29, 4], [30, 3], [31, 3], [32, 3], [33, 3], [66, 2], [66, 1], [61, 3], [61, 1], [58, 1], [58, 1], [22, 5], [22, 5], [22, 4], [27, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [59, 1], [14, 1], [15, 1], [18, 1], [16, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 4: - yy.apply($$[$0]); - return $$[$0]; - case 5: - case 10: - this.$ = []; - break; - case 6: - case 11: - $$[$0 - 1].push($$[$0]); - this.$ = $$[$0 - 1]; - break; - case 7: - case 8: - case 12: - case 13: - this.$ = $$[$0]; - break; - case 9: - case 14: - this.$ = []; - break; - case 18: - $$[$0 - 1].unshift({ type: "boxStart", boxData: yy.parseBoxData($$[$0 - 2]) }); - $$[$0 - 1].push({ type: "boxEnd", boxText: $$[$0 - 2] }); - this.$ = $$[$0 - 1]; - break; - case 20: - this.$ = { type: "sequenceIndex", sequenceIndex: Number($$[$0 - 2]), sequenceIndexStep: Number($$[$0 - 1]), sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER }; - break; - case 21: - this.$ = { type: "sequenceIndex", sequenceIndex: Number($$[$0 - 1]), sequenceIndexStep: 1, sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER }; - break; - case 22: - this.$ = { type: "sequenceIndex", sequenceVisible: false, signalType: yy.LINETYPE.AUTONUMBER }; - break; - case 23: - this.$ = { type: "sequenceIndex", sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER }; - break; - case 24: - this.$ = { type: "activeStart", signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] }; - break; - case 25: - this.$ = { type: "activeEnd", signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 1] }; - break; - case 31: - yy.setDiagramTitle($$[$0].substring(6)); - this.$ = $$[$0].substring(6); - break; - case 32: - yy.setDiagramTitle($$[$0].substring(7)); - this.$ = $$[$0].substring(7); - break; - case 33: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 34: - case 35: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 36: - $$[$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 37: - $$[$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 38: - $$[$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 39: - $$[$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 40: - $$[$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 41: - $$[$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 42: - $$[$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 45: - this.$ = $$[$0 - 3].concat([{ type: "option", optionText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.CRITICAL_OPTION }, $$[$0]]); - break; - case 47: - this.$ = $$[$0 - 3].concat([{ type: "and", parText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.PAR_AND }, $$[$0]]); - break; - case 49: - this.$ = $$[$0 - 3].concat([{ type: "else", altText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.ALT_ELSE }, $$[$0]]); - break; - case 50: - $$[$0 - 3].type = "addParticipant"; - $$[$0 - 3].description = yy.parseMessage($$[$0 - 1]); - this.$ = $$[$0 - 3]; - break; - case 51: - $$[$0 - 1].type = "addParticipant"; - this.$ = $$[$0 - 1]; - break; - case 52: - $$[$0 - 3].type = "addActor"; - $$[$0 - 3].description = yy.parseMessage($$[$0 - 1]); - this.$ = $$[$0 - 3]; - break; - case 53: - $$[$0 - 1].type = "addActor"; - this.$ = $$[$0 - 1]; - break; - case 54: - this.$ = [$$[$0 - 1], { type: "addNote", placement: $$[$0 - 2], actor: $$[$0 - 1].actor, text: $$[$0] }]; - break; - case 55: - $$[$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 56: - this.$ = [$$[$0 - 1], { type: "addLinks", actor: $$[$0 - 1].actor, text: $$[$0] }]; - break; - case 57: - this.$ = [$$[$0 - 1], { type: "addALink", actor: $$[$0 - 1].actor, text: $$[$0] }]; - break; - case 58: - this.$ = [$$[$0 - 1], { type: "addProperties", actor: $$[$0 - 1].actor, text: $$[$0] }]; - break; - case 59: - this.$ = [$$[$0 - 1], { type: "addDetails", actor: $$[$0 - 1].actor, text: $$[$0] }]; - break; - case 62: - this.$ = [$$[$0 - 2], $$[$0]]; - break; - case 63: - this.$ = $$[$0]; - break; - case 64: - this.$ = yy.PLACEMENT.LEFTOF; - break; - case 65: - this.$ = yy.PLACEMENT.RIGHTOF; - break; - case 66: - this.$ = [ - $$[$0 - 4], - $$[$0 - 1], - { type: "addMessage", from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] }, - { type: "activeStart", signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] } - ]; - break; - case 67: - 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 68: - this.$ = [$$[$0 - 3], $$[$0 - 1], { type: "addMessage", from: $$[$0 - 3].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 2], msg: $$[$0] }]; - break; - case 69: - this.$ = { type: "addParticipant", actor: $$[$0] }; - break; - case 70: - this.$ = yy.LINETYPE.SOLID_OPEN; - break; - case 71: - this.$ = yy.LINETYPE.DOTTED_OPEN; - break; - case 72: - this.$ = yy.LINETYPE.SOLID; - break; - case 73: - this.$ = yy.LINETYPE.DOTTED; - break; - case 74: - this.$ = yy.LINETYPE.SOLID_CROSS; - break; - case 75: - this.$ = yy.LINETYPE.DOTTED_CROSS; - break; - case 76: - this.$ = yy.LINETYPE.SOLID_POINT; - break; - case 77: - this.$ = yy.LINETYPE.DOTTED_POINT; - break; - case 78: - this.$ = yy.parseMessage($$[$0].trim().substring(1)); - break; - case 79: - yy.parseDirective("%%{", "open_directive"); - break; - case 80: - yy.parseDirective($$[$0], "type_directive"); - break; - case 81: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); - yy.parseDirective($$[$0], "arg_directive"); - break; - case 82: - yy.parseDirective("}%%", "close_directive", "sequence"); - break; + return result; + } + 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; + } + }); + + // ../../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; } - }, - table: [{ 3: 1, 4: $V0, 5: $V1, 6: 4, 7: $V2, 14: 6, 83: $V3 }, { 1: [3] }, { 3: 8, 4: $V0, 5: $V1, 6: 4, 7: $V2, 14: 6, 83: $V3 }, { 3: 9, 4: $V0, 5: $V1, 6: 4, 7: $V2, 14: 6, 83: $V3 }, { 3: 10, 4: $V0, 5: $V1, 6: 4, 7: $V2, 14: 6, 83: $V3 }, o([1, 4, 5, 19, 23, 26, 28, 34, 35, 36, 38, 40, 41, 42, 43, 44, 46, 48, 50, 54, 56, 57, 62, 63, 64, 65, 73, 83], $V4, { 8: 11 }), { 15: 12, 84: [1, 13] }, { 84: [2, 79] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3] }, { 1: [2, 4], 4: $V5, 5: $V6, 6: 41, 9: 14, 10: 16, 13: 18, 14: 6, 19: $V7, 22: 20, 23: $V8, 26: $V9, 27: 44, 28: $Va, 29: 24, 30: 25, 31: 26, 32: 27, 33: 28, 34: $Vb, 35: $Vc, 36: $Vd, 38: $Ve, 40: $Vf, 41: $Vg, 42: $Vh, 43: $Vi, 44: $Vj, 46: $Vk, 48: $Vl, 50: $Vm, 54: $Vn, 56: $Vo, 57: $Vp, 62: $Vq, 63: $Vr, 64: $Vs, 65: $Vt, 73: $Vu, 83: $V3 }, { 16: 51, 17: [1, 52], 86: $Vv }, o([17, 86], [2, 80]), o($Vw, [2, 6]), { 6: 41, 10: 54, 13: 18, 14: 6, 19: $V7, 22: 20, 23: $V8, 26: $V9, 27: 44, 28: $Va, 29: 24, 30: 25, 31: 26, 32: 27, 33: 28, 34: $Vb, 35: $Vc, 36: $Vd, 38: $Ve, 40: $Vf, 41: $Vg, 42: $Vh, 43: $Vi, 44: $Vj, 46: $Vk, 48: $Vl, 50: $Vm, 54: $Vn, 56: $Vo, 57: $Vp, 62: $Vq, 63: $Vr, 64: $Vs, 65: $Vt, 73: $Vu, 83: $V3 }, o($Vw, [2, 8]), o($Vw, [2, 9]), o($Vw, [2, 17]), { 20: [1, 55] }, { 5: [1, 56] }, { 5: [1, 59], 24: [1, 57], 25: [1, 58] }, { 27: 60, 73: $Vu }, { 27: 61, 73: $Vu }, { 5: [1, 62] }, { 5: [1, 63] }, { 5: [1, 64] }, { 5: [1, 65] }, { 5: [1, 66] }, o($Vw, [2, 31]), o($Vw, [2, 32]), { 37: [1, 67] }, { 39: [1, 68] }, o($Vw, [2, 35]), { 20: [1, 69] }, { 20: [1, 70] }, { 20: [1, 71] }, { 20: [1, 72] }, { 20: [1, 73] }, { 20: [1, 74] }, { 20: [1, 75] }, o($Vw, [2, 43]), { 27: 76, 73: $Vu }, { 27: 77, 73: $Vu }, { 70: 78, 74: [1, 79], 75: [1, 80], 76: [1, 81], 77: [1, 82], 78: [1, 83], 79: [1, 84], 80: [1, 85], 81: [1, 86] }, { 58: 87, 60: [1, 88], 68: [1, 89], 69: [1, 90] }, { 27: 91, 73: $Vu }, { 27: 92, 73: $Vu }, { 27: 93, 73: $Vu }, { 27: 94, 73: $Vu }, o([5, 55, 67, 74, 75, 76, 77, 78, 79, 80, 81, 82], [2, 69]), { 5: [1, 95] }, { 18: 96, 85: [1, 97] }, { 5: [2, 82] }, o($Vw, [2, 7]), o($Vx, [2, 10], { 11: 98 }), o($Vw, [2, 19]), { 5: [1, 100], 24: [1, 99] }, { 5: [1, 101] }, o($Vw, [2, 23]), { 5: [1, 102] }, { 5: [1, 103] }, o($Vw, [2, 26]), o($Vw, [2, 27]), o($Vw, [2, 28]), o($Vw, [2, 29]), o($Vw, [2, 30]), o($Vw, [2, 33]), o($Vw, [2, 34]), o($Vy, $V4, { 8: 104 }), o($Vy, $V4, { 8: 105 }), o($Vy, $V4, { 8: 106 }), o($Vz, $V4, { 45: 107, 8: 108 }), o($VA, $V4, { 47: 109, 8: 110 }), o($VB, $V4, { 49: 111, 8: 112 }), o($Vy, $V4, { 8: 113 }), { 5: [1, 115], 55: [1, 114] }, { 5: [1, 117], 55: [1, 116] }, { 27: 120, 71: [1, 118], 72: [1, 119], 73: $Vu }, o($VC, [2, 70]), o($VC, [2, 71]), o($VC, [2, 72]), o($VC, [2, 73]), o($VC, [2, 74]), o($VC, [2, 75]), o($VC, [2, 76]), o($VC, [2, 77]), { 27: 121, 73: $Vu }, { 27: 123, 61: 122, 73: $Vu }, { 73: [2, 64] }, { 73: [2, 65] }, { 59: 124, 82: $VD }, { 59: 126, 82: $VD }, { 59: 127, 82: $VD }, { 59: 128, 82: $VD }, o($VE, [2, 15]), { 16: 129, 86: $Vv }, { 86: [2, 81] }, { 4: [1, 132], 5: [1, 134], 12: 131, 13: 133, 21: [1, 130], 54: $Vn, 56: $Vo }, { 5: [1, 135] }, o($Vw, [2, 21]), o($Vw, [2, 22]), o($Vw, [2, 24]), o($Vw, [2, 25]), { 4: $V5, 5: $V6, 6: 41, 9: 14, 10: 16, 13: 18, 14: 6, 19: $V7, 21: [1, 136], 22: 20, 23: $V8, 26: $V9, 27: 44, 28: $Va, 29: 24, 30: 25, 31: 26, 32: 27, 33: 28, 34: $Vb, 35: $Vc, 36: $Vd, 38: $Ve, 40: $Vf, 41: $Vg, 42: $Vh, 43: $Vi, 44: $Vj, 46: $Vk, 48: $Vl, 50: $Vm, 54: $Vn, 56: $Vo, 57: $Vp, 62: $Vq, 63: $Vr, 64: $Vs, 65: $Vt, 73: $Vu, 83: $V3 }, { 4: $V5, 5: $V6, 6: 41, 9: 14, 10: 16, 13: 18, 14: 6, 19: $V7, 21: [1, 137], 22: 20, 23: $V8, 26: $V9, 27: 44, 28: $Va, 29: 24, 30: 25, 31: 26, 32: 27, 33: 28, 34: $Vb, 35: $Vc, 36: $Vd, 38: $Ve, 40: $Vf, 41: $Vg, 42: $Vh, 43: $Vi, 44: $Vj, 46: $Vk, 48: $Vl, 50: $Vm, 54: $Vn, 56: $Vo, 57: $Vp, 62: $Vq, 63: $Vr, 64: $Vs, 65: $Vt, 73: $Vu, 83: $V3 }, { 4: $V5, 5: $V6, 6: 41, 9: 14, 10: 16, 13: 18, 14: 6, 19: $V7, 21: [1, 138], 22: 20, 23: $V8, 26: $V9, 27: 44, 28: $Va, 29: 24, 30: 25, 31: 26, 32: 27, 33: 28, 34: $Vb, 35: $Vc, 36: $Vd, 38: $Ve, 40: $Vf, 41: $Vg, 42: $Vh, 43: $Vi, 44: $Vj, 46: $Vk, 48: $Vl, 50: $Vm, 54: $Vn, 56: $Vo, 57: $Vp, 62: $Vq, 63: $Vr, 64: $Vs, 65: $Vt, 73: $Vu, 83: $V3 }, { 21: [1, 139] }, { 4: $V5, 5: $V6, 6: 41, 9: 14, 10: 16, 13: 18, 14: 6, 19: $V7, 21: [2, 48], 22: 20, 23: $V8, 26: $V9, 27: 44, 28: $Va, 29: 24, 30: 25, 31: 26, 32: 27, 33: 28, 34: $Vb, 35: $Vc, 36: $Vd, 38: $Ve, 40: $Vf, 41: $Vg, 42: $Vh, 43: $Vi, 44: $Vj, 46: $Vk, 48: $Vl, 50: $Vm, 53: [1, 140], 54: $Vn, 56: $Vo, 57: $Vp, 62: $Vq, 63: $Vr, 64: $Vs, 65: $Vt, 73: $Vu, 83: $V3 }, { 21: [1, 141] }, { 4: $V5, 5: $V6, 6: 41, 9: 14, 10: 16, 13: 18, 14: 6, 19: $V7, 21: [2, 46], 22: 20, 23: $V8, 26: $V9, 27: 44, 28: $Va, 29: 24, 30: 25, 31: 26, 32: 27, 33: 28, 34: $Vb, 35: $Vc, 36: $Vd, 38: $Ve, 40: $Vf, 41: $Vg, 42: $Vh, 43: $Vi, 44: $Vj, 46: $Vk, 48: $Vl, 50: $Vm, 52: [1, 142], 54: $Vn, 56: $Vo, 57: $Vp, 62: $Vq, 63: $Vr, 64: $Vs, 65: $Vt, 73: $Vu, 83: $V3 }, { 21: [1, 143] }, { 4: $V5, 5: $V6, 6: 41, 9: 14, 10: 16, 13: 18, 14: 6, 19: $V7, 21: [2, 44], 22: 20, 23: $V8, 26: $V9, 27: 44, 28: $Va, 29: 24, 30: 25, 31: 26, 32: 27, 33: 28, 34: $Vb, 35: $Vc, 36: $Vd, 38: $Ve, 40: $Vf, 41: $Vg, 42: $Vh, 43: $Vi, 44: $Vj, 46: $Vk, 48: $Vl, 50: $Vm, 51: [1, 144], 54: $Vn, 56: $Vo, 57: $Vp, 62: $Vq, 63: $Vr, 64: $Vs, 65: $Vt, 73: $Vu, 83: $V3 }, { 4: $V5, 5: $V6, 6: 41, 9: 14, 10: 16, 13: 18, 14: 6, 19: $V7, 21: [1, 145], 22: 20, 23: $V8, 26: $V9, 27: 44, 28: $Va, 29: 24, 30: 25, 31: 26, 32: 27, 33: 28, 34: $Vb, 35: $Vc, 36: $Vd, 38: $Ve, 40: $Vf, 41: $Vg, 42: $Vh, 43: $Vi, 44: $Vj, 46: $Vk, 48: $Vl, 50: $Vm, 54: $Vn, 56: $Vo, 57: $Vp, 62: $Vq, 63: $Vr, 64: $Vs, 65: $Vt, 73: $Vu, 83: $V3 }, { 20: [1, 146] }, o($Vw, [2, 51]), { 20: [1, 147] }, o($Vw, [2, 53]), { 27: 148, 73: $Vu }, { 27: 149, 73: $Vu }, { 59: 150, 82: $VD }, { 59: 151, 82: $VD }, { 59: 152, 82: $VD }, { 67: [1, 153], 82: [2, 63] }, { 5: [2, 56] }, { 5: [2, 78] }, { 5: [2, 57] }, { 5: [2, 58] }, { 5: [2, 59] }, { 5: [1, 154] }, o($Vw, [2, 18]), o($Vx, [2, 11]), { 13: 155, 54: $Vn, 56: $Vo }, o($Vx, [2, 13]), o($Vx, [2, 14]), o($Vw, [2, 20]), o($Vw, [2, 36]), o($Vw, [2, 37]), o($Vw, [2, 38]), o($Vw, [2, 39]), { 20: [1, 156] }, o($Vw, [2, 40]), { 20: [1, 157] }, o($Vw, [2, 41]), { 20: [1, 158] }, o($Vw, [2, 42]), { 5: [1, 159] }, { 5: [1, 160] }, { 59: 161, 82: $VD }, { 59: 162, 82: $VD }, { 5: [2, 68] }, { 5: [2, 54] }, { 5: [2, 55] }, { 27: 163, 73: $Vu }, o($VE, [2, 16]), o($Vx, [2, 12]), o($Vz, $V4, { 8: 108, 45: 164 }), o($VA, $V4, { 8: 110, 47: 165 }), o($VB, $V4, { 8: 112, 49: 166 }), o($Vw, [2, 50]), o($Vw, [2, 52]), { 5: [2, 66] }, { 5: [2, 67] }, { 82: [2, 62] }, { 21: [2, 49] }, { 21: [2, 47] }, { 21: [2, 45] }], - defaultActions: { 7: [2, 79], 8: [2, 1], 9: [2, 2], 10: [2, 3], 53: [2, 82], 89: [2, 64], 90: [2, 65], 97: [2, 81], 124: [2, 56], 125: [2, 78], 126: [2, 57], 127: [2, 58], 128: [2, 59], 150: [2, 68], 151: [2, 54], 152: [2, 55], 161: [2, 66], 162: [2, 67], 163: [2, 62], 164: [2, 49], 165: [2, 47], 166: [2, 45] }, - parseError: function parseError2(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; + object3 = object3.buffer; + other = other.buffer; + case arrayBufferTag4: + if (object3.byteLength != other.byteLength || !equalFunc(new Uint8Array_default(object3), new Uint8Array_default(other))) { + return false; } - }, - 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; + 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; } - 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 stacked = stack.get(object3); + if (stacked) { + return stacked == other; } - 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; - } + 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 true; - } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError2(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 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; - }, - // unshifts one char (or a string) into the input - unput: 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 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, 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 && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = 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[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 - }); - } - }, - // 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 83; - case 1: - this.begin("type_directive"); - return 84; - case 2: - this.popState(); - this.begin("arg_directive"); - return 17; - case 3: - this.popState(); - this.popState(); - return 86; - case 4: - return 85; - case 5: - return 5; - case 6: - break; - case 7: - break; - case 8: - break; - case 9: - break; - case 10: - break; - case 11: - return 24; - case 12: - this.begin("LINE"); - return 19; - case 13: - this.begin("ID"); - return 54; - case 14: - this.begin("ID"); - return 56; - case 15: - yy_.yytext = yy_.yytext.trim(); - this.begin("ALIAS"); - return 73; - case 16: - this.popState(); - this.popState(); - this.begin("LINE"); - return 55; - case 17: - this.popState(); - this.popState(); - return 5; - case 18: - this.begin("LINE"); - return 41; - case 19: - this.begin("LINE"); - return 42; - case 20: - this.begin("LINE"); - return 43; - case 21: - this.begin("LINE"); - return 44; - case 22: - this.begin("LINE"); - return 53; - case 23: - this.begin("LINE"); - return 46; - case 24: - this.begin("LINE"); - return 52; - case 25: - this.begin("LINE"); - return 48; - case 26: - this.begin("LINE"); - return 51; - case 27: - this.begin("LINE"); - return 50; - case 28: - this.popState(); - return 20; - case 29: - return 21; - case 30: - return 68; - case 31: - return 69; - case 32: - return 62; - case 33: - return 63; - case 34: - return 64; - case 35: - return 65; - case 36: - return 60; - case 37: - return 57; - case 38: - this.begin("ID"); - return 26; - case 39: - this.begin("ID"); - return 28; - case 40: - return 34; - case 41: - return 35; - case 42: - this.begin("acc_title"); - return 36; - case 43: - this.popState(); - return "acc_title_value"; - case 44: - this.begin("acc_descr"); - return 38; - case 45: - this.popState(); - return "acc_descr_value"; - case 46: - this.begin("acc_descr_multiline"); - break; - case 47: - this.popState(); - break; - case 48: - return "acc_descr_multiline_value"; - case 49: - return 7; - case 50: - return 23; - case 51: - return 25; - case 52: - return 67; - case 53: - return 5; - case 54: - yy_.yytext = yy_.yytext.trim(); - return 73; - case 55: - return 76; - case 56: - return 77; - case 57: - return 74; - case 58: - return 75; - case 59: - return 78; - case 60: - return 79; - case 61: - return 80; - case 62: - return 81; - case 63: - return 82; - case 64: - return 71; - case 65: - return 72; - case 66: - return 5; - case 67: - return "INVALID"; - } - }, - rules: [/^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:[\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, /^(?:[^\->:\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, /^(?: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": [47, 48], "inclusive": false }, "acc_descr": { "rules": [45], "inclusive": false }, "acc_title": { "rules": [43], "inclusive": false }, "open_directive": { "rules": [1, 8], "inclusive": false }, "type_directive": { "rules": [2, 3, 8], "inclusive": false }, "arg_directive": { "rules": [3, 4, 8], "inclusive": false }, "ID": { "rules": [7, 8, 15], "inclusive": false }, "ALIAS": { "rules": [7, 8, 16, 17], "inclusive": false }, "LINE": { "rules": [7, 8, 28], "inclusive": false }, "INITIAL": { "rules": [0, 5, 6, 8, 9, 10, 11, 12, 13, 14, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 46, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser() { - this.yy = {}; - } - Parser.prototype = parser2; - parser2.Parser = Parser; - return new Parser(); - }(); - parser$9.parser = parser$9; - const parser$a = parser$9; - let prevActor = void 0; - let actors$1 = {}; - let boxes = []; - let messages = []; - let sequenceNumbersEnabled = false; - let wrapEnabled; - let currentBox = void 0; - const parseDirective$4 = function(statement, context, type2) { - mermaidAPI.parseDirective(this, statement, context, type2); - }; - const addBox = function(data) { - boxes.push({ - name: data.text, - wrap: data.wrap === void 0 && autoWrap() || !!data.wrap, - fill: data.color, - actorKeys: [] - }); - currentBox = boxes.slice(-1)[0]; - }; - const addActor = function(id2, name2, description2, type2) { - let assignedBox = currentBox; - const old = actors$1[id2]; - if (old) { - if (currentBox && old.box && 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 '" + currentBox.name + "' at the same time." - ); - } - assignedBox = old.box ? old.box : currentBox; - old.box = assignedBox; - if (old && name2 === old.name && description2 == null) { - return; - } } - if (description2 == null || description2.text == null) { - description2 = { text: name2, wrap: null, type: type2 }; + 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; } - if (type2 == null || description2.text == null) { - description2 = { text: name2, wrap: null, type: type2 }; + }); + + // ../../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; } - actors$1[id2] = { - box: assignedBox, - name: name2, - description: description2.text, - wrap: description2.wrap === void 0 && autoWrap() || !!description2.wrap, - prevActor, - links: {}, - properties: {}, - actorCnt: null, - rectData: null, - type: type2 || "participant" - }; - if (prevActor && actors$1[prevActor]) { - actors$1[prevActor].nextActor = id2; + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty13.call(other, key))) { + return false; + } } - if (currentBox) { - currentBox.actorKeys.push(id2); + var objStacked = stack.get(object3); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object3; } - prevActor = id2; - }; - const activationCount = (part) => { - let i2; - let count = 0; - for (i2 = 0; i2 < messages.length; i2++) { - if (messages[i2].type === LINETYPE.ACTIVE_START && messages[i2].from.actor === part) { - count++; + 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 (messages[i2].type === LINETYPE.ACTIVE_END && messages[i2].from.actor === part) { - count--; + if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) { + result = false; + break; } + skipCtor || (skipCtor = key == "constructor"); } - return count; - }; - const addMessage = function(idFrom, idTo, message2, answer) { - messages.push({ - from: idFrom, - to: idTo, - message: message2.text, - wrap: message2.wrap === void 0 && autoWrap() || !!message2.wrap, - answer - }); - }; - const addSignal = function(idFrom, idTo, message2 = { text: void 0, wrap: void 0 }, messageType) { - 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; + 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; } } - messages.push({ - from: idFrom, - to: idTo, - message: message2.text, - wrap: message2.wrap === void 0 && autoWrap() || !!message2.wrap, - type: messageType - }); - return true; - }; - const hasAtLeastOneBox = function() { - return boxes.length > 0; - }; - const hasAtLeastOneBoxWithTitle = function() { - return boxes.some((b) => b.name); - }; - const getMessages = function() { - return messages; - }; - const getBoxes = function() { - return boxes; - }; - const getActors$1 = function() { - return actors$1; - }; - const getActor = function(id2) { - return actors$1[id2]; - }; - const getActorKeys = function() { - return Object.keys(actors$1); - }; - const enableSequenceNumbers = function() { - sequenceNumbersEnabled = true; - }; - const disableSequenceNumbers = function() { - sequenceNumbersEnabled = false; - }; - const showSequenceNumbers = () => sequenceNumbersEnabled; - const setWrap = function(wrapSetting) { - wrapEnabled = wrapSetting; - }; - const autoWrap = () => { - if (wrapEnabled !== void 0) { - return wrapEnabled; + stack["delete"](object3); + stack["delete"](other); + return result; + } + 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; } - return getConfig$1().sequence.wrap; - }; - const clear$5 = function() { - actors$1 = {}; - boxes = []; - messages = []; - sequenceNumbersEnabled = false; - clear$i(); - }; - const parseMessage = function(str2) { - const _str = str2.trim(); - const message2 = { - text: _str.replace(/^:?(?:no)?wrap:/, "").trim(), - wrap: _str.match(/^:?wrap:/) !== null ? true : _str.match(/^:?nowrap:/) !== null ? false : void 0 - }; - log$1.debug("parseMessage:", message2); - return message2; - }; - 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(); + }); + + // ../../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; } - } else { - const style = new Option().style; - style.color = color2; - if (style.color !== color2) { - color2 = "transparent"; - title2 = str2.trim(); + 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); } } - const boxData = { - color: color2, - text: title2 !== void 0 ? sanitizeText$7(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 - }; - return boxData; - }; - 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 - }; - const ARROWTYPE = { - FILLED: 0, - OPEN: 1 - }; - const PLACEMENT = { - LEFTOF: 0, - RIGHTOF: 1, - OVER: 2 - }; - const addNote$1 = function(actor, placement, message2) { - ({ - actor, - placement, - message: message2.text, - wrap: message2.wrap === void 0 && autoWrap() || !!message2.wrap - }); - const actors2 = [].concat(actor, actor); - messages.push({ - from: actors2[0], - to: actors2[1], - message: message2.text, - wrap: message2.wrap === void 0 && autoWrap() || !!message2.wrap, - type: LINETYPE.NOTE, - placement - }); - }; - const addLinks = function(actorId, text2) { - const actor = getActor(actorId); - try { - let sanitizedText = sanitizeText$7(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); + if (!isSameTag) { + return false; } - }; - const addALink = function(actorId, text2) { - const actor = getActor(actorId); - try { - const links2 = {}; - let sanitizedText = sanitizeText$7(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 link = sanitizedText.slice(sep2 + 1).trim(); - links2[label] = link; - insertLinks(actor, links2); - } catch (e) { - log$1.error("error while parsing actor link text", e); + 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; } - }; - function insertLinks(actor, links2) { - if (actor.links == null) { - actor.links = links2; - } else { - for (let key in links2) { - actor.links[key] = links2[key]; - } + }); + + // ../../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; } + return baseIsEqualDeep_default(value2, other, bitmask, customizer, baseIsEqual, stack); } - const addProperties = function(actorId, text2) { - const actor = getActor(actorId); - try { - let sanitizedText = sanitizeText$7(text2.text, getConfig$1()); - const properties = JSON.parse(sanitizedText); - insertProperties(actor, properties); - } catch (e) { - log$1.error("error while parsing actor properties text", e); + 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; } - }; - function insertProperties(actor, properties) { - if (actor.properties == null) { - actor.properties = properties; - } else { - for (let key in properties) { - actor.properties[key] = properties[key]; - } + }); + + // ../../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; } - } - function boxEnd() { - 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"]); + object3 = Object(object3); + while (index--) { + var data5 = matchData[index]; + if (noCustomizer && data5[2] ? data5[1] !== object3[data5[0]] : !(data5[0] in object3)) { + return false; } - } 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": - 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, "participant"); - break; - case "addActor": - addActor(param.actor, param.actor, param.description, "actor"); - 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": - addSignal(param.from, param.to, param.msg, param.signalType); - 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; + 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; + } } } - }; - const db$4 = { - addActor, - addMessage, - addSignal, - addLinks, - addDetails, - addProperties, - autoWrap, - setWrap, - enableSequenceNumbers, - disableSequenceNumbers, - showSequenceNumbers, - getMessages, - getActors: getActors$1, - getActor, - getActorKeys, - getActorProperty, - getAccTitle, - getBoxes, - getDiagramTitle, - setDiagramTitle, - parseDirective: parseDirective$4, - getConfig: () => getConfig$1().sequence, - clear: clear$5, - parseMessage, - parseBoxData, - LINETYPE, - ARROWTYPE, - PLACEMENT, - addNote: addNote$1, - setAccTitle, - apply, - setAccDescription, - getAccDescription, - hasAtLeastOneBox, - hasAtLeastOneBoxWithTitle - }; - const getStyles$6 = (options2) => `.actor { - stroke: ${options2.actorBorder}; - fill: ${options2.actorBkg}; + return true; } + 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; + } + }); - text.actor > tspan { - fill: ${options2.actorTextColor}; - stroke: none; - } + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isStrictComparable.js + function isStrictComparable(value2) { + return value2 === value2 && !isObject_default(value2); + } + 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; + } + }); - .actor-line { - stroke: ${options2.actorLineColor}; + // ../../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)]; + } + return result; } + 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; + } + }); - .messageLine0 { - stroke-width: 1.5; - stroke-dasharray: none; - stroke: ${options2.signalColor}; + // ../../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; + } + return object3[key] === srcValue && (srcValue !== void 0 || key in Object(object3)); + }; } + 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; + } + }); - .messageLine1 { - stroke-width: 1.5; - stroke-dasharray: 2, 2; - stroke: ${options2.signalColor}; + // ../../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); + }; } + 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; + } + }); - #arrowhead path { - fill: ${options2.signalColor}; - stroke: ${options2.signalColor}; + // ../../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); } + 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; + } + }); - .sequenceNumber { - fill: ${options2.sequenceNumberColor}; - } + // ../../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; + } + 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; + } + }); - #sequencenumber { - fill: ${options2.signalColor}; - } + // ../../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; + } + }); - #crosshead path { - fill: ${options2.signalColor}; - stroke: ${options2.signalColor}; + // ../../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 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; + } + }); - .messageText { - fill: ${options2.signalTextColor}; - stroke: none; + // ../../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]; + }; } + 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; + } + }); - .labelBox { - stroke: ${options2.labelBoxBorderColor}; - fill: ${options2.labelBoxBkgColor}; + // ../../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); + }; } + 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; + } + }); - .labelText, .labelText > tspan { - fill: ${options2.labelTextColor}; - stroke: none; - } + // ../../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; + } + }); - .loopText, .loopText > tspan { - fill: ${options2.loopTextColor}; - stroke: none; - } + // ../../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; + } + }); - .loopLine { - stroke-width: 2px; - stroke-dasharray: 2, 2; - stroke: ${options2.labelBoxBorderColor}; - fill: ${options2.labelBoxBorderColor}; + // ../../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; } + 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; + } + }); - .note { - //stroke: #decc93; - stroke: ${options2.noteBorderColor}; - fill: ${options2.noteBkgColor}; - } + // ../../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; + } + }); - .noteText, .noteText > tspan { - fill: ${options2.noteTextColor}; - stroke: none; - } + // ../../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; + } + } + 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; + } + }); - .activation0 { - fill: ${options2.activationBkgColor}; - stroke: ${options2.activationBorderColor}; + // ../../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; + } + }); + + // ../../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 accumulator; } + 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; + } + }); - .activation1 { - fill: ${options2.activationBkgColor}; - stroke: ${options2.activationBorderColor}; + // ../../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); + }; } + 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; + } + }); - .activation2 { - fill: ${options2.activationBkgColor}; - stroke: ${options2.activationBorderColor}; + // ../../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_defaults3 = __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]; + } + } + } + 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; } + 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; + } + }); - .actorPopupMenu { - position: absolute; + // ../../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; } + 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; + } + }); - .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}; + // ../../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); } - .actor-man circle, line { - stroke: ${options2.actorBorder}; - fill: ${options2.actorBkg}; - stroke-width: 2px; + 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 []; + } + n2 = guard || n2 === void 0 ? 1 : toInteger_default(n2); + n2 = length2 - n2; + return baseSlice_default(array4, 0, n2 < 0 ? 0 : n2); } -`; - const styles$5 = getStyles$6; - const drawRect$2 = 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 addPopupInteraction = (id2, actorCnt2) => { - addFunction(() => { - const arr = document.querySelectorAll(id2); - if (arr.length === 0) { - return; - } - arr[0].addEventListener("mouseover", function() { - popupMenuUpFunc("actor" + actorCnt2 + "_popup"); - }); - arr[0].addEventListener("mouseout", function() { - popupMenuDownFunc("actor" + actorCnt2 + "_popup"); - }); - }); - }; - 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); - addPopupInteraction("#actor" + actorCnt2 + "_popup", actorCnt2); - 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 = sanitizeUrl_1(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; - } + 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; } - rectElem.attr("height", linkY); - return { height: rectData.height + linkY, width: menuWidth }; - }; - const drawImage = function(elem, x2, y2, link) { - const imageElem = elem.append("image"); - imageElem.attr("x", x2); - imageElem.attr("y", y2); - var sanitizedLink = sanitizeUrl_1(link); - imageElem.attr("xlink:href", sanitizedLink); - }; - const drawEmbeddedImage = function(elem, x2, y2, link) { - const imageElem = elem.append("use"); - imageElem.attr("x", x2); - imageElem.attr("y", y2); - var sanitizedLink = sanitizeUrl_1(link); - imageElem.attr("xlink:href", "#" + sanitizedLink); - }; - const popupMenu = function(popid) { - return "var pu = document.getElementById('" + popid + "'); if (pu != null) { pu.style.display = 'block'; }"; - }; - const popdownMenu = function(popid) { - return "var pu = document.getElementById('" + popid + "'); if (pu != null) { pu.style.display = 'none'; }"; - }; - const popupMenuUpFunc = function(popupId) { - var pu = document.getElementById(popupId); - if (pu != null) { - pu.style.display = "block"; + }); + + // ../../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; } - }; - const popupMenuDownFunc = function(popupId) { - var pu = document.getElementById(popupId); - if (pu != null) { - pu.style.display = "none"; + }); + + // ../../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; } - }; - const drawText$2 = function(elem, textData) { - let prevTextHeight = 0, 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; - } + }); + + // ../../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(); } - 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/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; } } - 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); - } - if (textData.tspan) { - const span = textElem.append("tspan"); - span.attr("x", textData.x); - if (textData.fill !== void 0) { - span.attr("fill", textData.fill); - } - span.text(line2); - } else { - textElem.text(line2); + 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; + } + 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); } - if (textData.valign !== void 0 && textData.textMargin !== void 0 && textData.textMargin > 0) { - textHeight += (textElem._groups || textElem)[0][0].getBBox().height; - prevTextHeight = textHeight; + }); + 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"); } - textElems.push(textElem); + 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; } - return textElems; - }; - const drawLabel$2 = function(elem, txtObject) { - function genPoints(x2, y2, width2, height2, cut) { - return x2 + "," + y2 + " " + (x2 + width2) + "," + y2 + " " + (x2 + width2) + "," + (y2 + height2 - cut) + " " + (x2 + width2 - cut * 1.2) + "," + (y2 + height2) + " " + x2 + "," + (y2 + height2); - } - 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, bounds2) => { - if (!diagram2.selectAll) { - return; + }); + + // ../../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; } - diagram2.selectAll(".actor-line").attr("class", "200").attr("y2", bounds2 - 55); - }; - const drawActorTypeParticipant = function(elem, actor, conf2, isFooter) { - const center2 = actor.x + actor.width / 2; - const centerY = actor.y + 5; - const boxpluslineGroup = elem.append("g"); - var g = boxpluslineGroup; - if (!isFooter) { - actorCnt++; - g.append("line").attr("id", "actor" + actorCnt).attr("x1", center2).attr("y1", centerY).attr("x2", center2).attr("y2", 2e3).attr("class", "actor-line").attr("stroke-width", "0.5px").attr("stroke", "#999"); - g = boxpluslineGroup.append("g"); - actor.actorCnt = actorCnt; - if (actor.links != null) { - g.attr("id", "root-" + actorCnt); - addPopupInteraction("#root-" + actorCnt, actorCnt); - } - } - const rect2 = getNoteRect$2(); - var cssclass = "actor"; - if (actor.properties != null && actor.properties["class"]) { - cssclass = actor.properties["class"]; - } else { - rect2.fill = "#eaeaea"; - } - rect2.x = actor.x; - rect2.y = actor.y; - rect2.width = actor.width; - rect2.height = actor.height; - rect2.class = cssclass; - rect2.rx = 3; - rect2.ry = 3; - 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(g, rect2.x + rect2.width - 20, rect2.y + 10, iconSrc); - } - } - _drawTextCandidateFunc$2(conf2)( - actor.description, - g, - rect2.x, - rect2.y, - rect2.width, - rect2.height, - { class: "actor" }, - conf2 - ); - let height2 = actor.height; - if (rectElem.node) { - const bounds2 = rectElem.node().getBBox(); - actor.height = bounds2.height; - height2 = bounds2.height; + var index = fromIndex == null ? 0 : toInteger_default(fromIndex); + if (index < 0) { + index = nativeMax2(length2 + index, 0); } - return height2; - }; - const drawActorTypeActor = function(elem, actor, conf2, isFooter) { - const center2 = actor.x + actor.width / 2; - const centerY = actor.y + 80; - 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("stroke-width", "0.5px").attr("stroke", "#999"); - } - const actElem = elem.append("g"); - actElem.attr("class", "actor-man"); - const rect2 = getNoteRect$2(); - rect2.x = actor.x; - rect2.y = actor.y; - 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", actor.y + 25).attr("x2", center2).attr("y2", actor.y + 45); - actElem.append("line").attr("id", "actor-man-arms" + actorCnt).attr("x1", center2 - 18).attr("y1", actor.y + 33).attr("x2", center2 + 18).attr("y2", actor.y + 33); - actElem.append("line").attr("x1", center2 - 18).attr("y1", actor.y + 60).attr("x2", center2).attr("y2", actor.y + 45); - actElem.append("line").attr("x1", center2).attr("y1", actor.y + 45).attr("x2", center2 + 16).attr("y2", actor.y + 60); - const circle2 = actElem.append("circle"); - circle2.attr("cx", actor.x + actor.width / 2); - circle2.attr("cy", actor.y + 10); - circle2.attr("r", 15); - circle2.attr("width", actor.width); - circle2.attr("height", actor.height); - const bounds2 = actElem.node().getBBox(); - actor.height = bounds2.height; - _drawTextCandidateFunc$2(conf2)( - actor.description, - actElem, - rect2.x, - rect2.y + 35, - rect2.width, - rect2.height, - { class: "actor" }, - conf2 - ); - return actor.height; - }; - const drawActor = function(elem, actor, conf2, isFooter) { - switch (actor.type) { - case "actor": - return drawActorTypeActor(elem, actor, conf2, isFooter); - case "participant": - return drawActorTypeParticipant(elem, actor, conf2, isFooter); + 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; } - }; - const drawBox = function(elem, box, conf2) { - const boxplustextGroup = elem.append("g"); - const g = boxplustextGroup; - drawBackgroundRect$2(g, box); - if (box.name) { - _drawTextCandidateFunc$2(conf2)( - box.name, - g, - box.x, - box.y + (box.textMaxHeight || 0) / 2, - box.width, - 0, - { class: "text" }, - conf2 - ); + }); + + // ../../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; } - 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 = 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" - ); - }); + }); + + // ../../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; } - 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$2(); - 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 = drawText$2(g, txt); - if (loopModel.sectionTitles !== void 0) { - loopModel.sectionTitles.forEach(function(item, idx) { - 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; - textElem = drawText$2(g, 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); + }); + + // ../../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); + }); + return result; + } + 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; + } + }); + + // ../../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; } - loopModel.height = Math.round(loopModel.stopy - loopModel.starty); - return g; - }; - const drawBackgroundRect$2 = function(elem, bounds2) { - const rectElem = drawRect$2(elem, { - x: bounds2.startx, - y: bounds2.starty, - width: bounds2.stopx - bounds2.startx, - height: bounds2.stopy - bounds2.starty, - fill: bounds2.fill, - stroke: bounds2.stroke, - class: "rect" + }); + + // ../../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; + } + }); + + // ../../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]; }); - rectElem.lower(); - }; - 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", 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", 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 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", 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$2 = 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$2 = 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(content, g, x2, y2, width2, height2, textAttrs) { - const text2 = g.append("text").attr("x", x2 + width2 / 2).attr("y", y2 + height2 / 2 + 5).style("text-anchor", "middle").text(content); - _setTextAttrs(text2, textAttrs); - } - function byTspan(content, g, x2, y2, width2, height2, textAttrs, conf2) { - const { actorFontSize, actorFontFamily, actorFontWeight } = conf2; - const [_actorFontSize, _actorFontSizePx] = parseFontSize(actorFontSize); - const lines = content.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 + height2 / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"); - _setTextAttrs(text2, textAttrs); - } - } - function byFo(content, g, x2, y2, width2, height2, textAttrs, conf2) { - const s = g.append("switch"); - const f2 = s.append("foreignObject").attr("x", x2).attr("y", y2).attr("width", width2).attr("height", height2); - 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(content); - byTspan(content, s, x2, y2, width2, height2, 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 _drawMenuItemTextCandidateFunc = function() { - function byText(content, g, x2, y2, width2, height2, textAttrs) { - const text2 = g.append("text").attr("x", x2).attr("y", y2).style("text-anchor", "start").text(content); - _setTextAttrs(text2, textAttrs); - } - function byTspan(content, g, x2, y2, width2, height2, textAttrs, conf2) { - const { actorFontSize, actorFontFamily, actorFontWeight } = conf2; - const lines = content.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 + height2 / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"); - _setTextAttrs(text2, textAttrs); - } - } - function byFo(content, g, x2, y2, width2, height2, textAttrs, conf2) { - const s = g.append("switch"); - const f2 = s.append("foreignObject").attr("x", x2).attr("y", y2).attr("width", width2).attr("height", height2); - 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(content); - byTspan(content, s, x2, y2, width2, height2, 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, - drawImage, - drawEmbeddedImage, - anchorElement, - drawActivation, - drawLoop, - drawBackgroundRect: drawBackgroundRect$2, - insertArrowHead, - insertArrowFilledHead, - insertSequenceNumber, - insertArrowCrossHead, - insertDatabaseIcon, - insertComputerIcon, - insertClockIcon, - getTextObj: getTextObj$2, - getNoteRect: getNoteRect$2, - popupMenu, - popdownMenu, - fixLifeLineHeights, - sanitizeUrl: sanitizeUrl_1 - }; - 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]); + } + 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; } - }, - 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); - } - }; + } + return true; + } + 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; + } + }); + + // ../../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; + } + }); + + // ../../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; + } + 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; + } + 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; } - this.sequenceItems.forEach(updateFn()); - this.activations.forEach(updateFn("activation")); - }, - 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$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(message2, diagram2, actors2) { - const actorRect = actors2[message2.from.actor]; - const stackedSize = actorActivations(message2.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: message2.from.actor, - anchored: svgDraw$3.anchorElement(diagram2) - }); - }, - endActivation: function(message2) { - const lastActorActivationIdx = this.activations.map(function(activation) { - return activation.actor; - }).lastIndexOf(message2.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 - }; - }, - 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(); - }, - addSectionToLoop: function(message2) { - 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(message2); - this.sequenceItems.push(loop); - }, - bumpVerticalPos: function(bump) { - this.verticalPos = this.verticalPos + bump; - this.data.stopy = this.verticalPos; - }, - getVerticalPos: function() { - return this.verticalPos; - }, - getBounds: function() { - return { bounds: this.data, models: this.models }; } - }; - const drawNote$1 = function(elem, noteModel) { - bounds$1.bumpVerticalPos(conf$4.boxMargin); - noteModel.height = conf$4.boxMargin; - noteModel.starty = bounds$1.getVerticalPos(); - const rect2 = svgDraw$3.getNoteRect(); - 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 = svgDraw$3.getTextObj(); - 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 = 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 + return result; + } + 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 !predicate.apply(this, args); }; - }; - function boundMessage(_diagram, msgModel) { - bounds$1.bumpVerticalPos(10); - const { startx, stopx, message: message2 } = msgModel; - const lines = common$1.splitBreaks(message2).length; - const textDims = utils.calculateTextDimensions(message2, messageFont(conf$4)); - 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; + } + 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; + } + }); + + // ../../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; } - totalOffset += 30; - const dx = Math.max(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); + 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]) ? [] : {}; + } + } + assignValue_default(nested, key, newValue); + nested = nested[key]; } - 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; + return object3; } - const drawMessage = function(diagram2, msgModel, lineStartY, diagObj) { - const { startx, stopx, starty, message: message2, type: type2, sequenceIndex, sequenceVisible } = msgModel; - const textDims = utils.calculateTextDimensions(message2, messageFont(conf$4)); - const textObj = svgDraw$3.getTextObj(); - textObj.x = startx; - textObj.y = starty + 10; - textObj.width = stopx - startx; - textObj.class = "messageText"; - textObj.dy = "1em"; - textObj.text = message2; - 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; - 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 + Math.max(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"); + 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; } - 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, "\\)"); + }); + + // ../../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); + } } - 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)"); + return result; + } + 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; } - if (type2 === diagObj.db.LINETYPE.SOLID_POINT || type2 === diagObj.db.LINETYPE.DOTTED_POINT) { - line2.attr("marker-end", "url(" + url + "#filled-head)"); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/pickBy.js + function pickBy(object3, predicate) { + if (object3 == null) { + return {}; } - if (type2 === diagObj.db.LINETYPE.SOLID_CROSS || type2 === diagObj.db.LINETYPE.DOTTED_CROSS) { - line2.attr("marker-end", "url(" + url + "#crosshead)"); + var props = arrayMap_default(getAllKeysIn_default(object3), function(prop) { + return [prop]; + }); + predicate = baseIteratee_default(predicate); + return basePickBy_default(object3, props, function(value2, path4) { + return predicate(value2, path4[0]); + }); + } + 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; } - 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/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; } - }; - const drawActors = function(diagram2, actors2, actorKeys, verticalPos, configuration, messages2, isFooter) { - if (configuration.hideUnusedParticipants === true) { - const newActors = /* @__PURE__ */ new Set(); - messages2.forEach((message2) => { - newActors.add(message2.from); - newActors.add(message2.to); - }); - actorKeys = actorKeys.filter((actorKey) => newActors.has(actorKey)); + return array4; + } + 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; } - let prevWidth = 0; - let prevMargin = 0; - let maxHeight = 0; - let prevBox = void 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); - } - prevMargin += conf$4.boxMargin + prevBox.margin; + }); + + // ../../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 (box && box != prevBox) { - if (!isFooter) { - box.x = prevWidth + prevMargin; - box.y = verticalPos; - } - prevMargin += box.margin; - } - actor.width = actor.width || conf$4.width; - actor.height = Math.max(actor.height || conf$4.height, conf$4.height); - actor.margin = actor.margin || conf$4.actorMargin; - actor.x = prevWidth + prevMargin; - actor.y = bounds$1.getVerticalPos(); - const height2 = svgDraw$3.drawActor(diagram2, actor, conf$4, isFooter); - maxHeight = Math.max(maxHeight, height2); - 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); - } - bounds$1.bumpVerticalPos(maxHeight); - }; - 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 (!valIsNull && !valIsSymbol && !othIsSymbol && value2 < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) { + return -1; } - if (menuDimensions.width + actor.x > maxWidth) { - maxWidth = menuDimensions.width + actor.x; + } + return 0; + } + 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; + } + }); + + // ../../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; + } + var order2 = orders[index]; + return result * (order2 == "desc" ? -1 : 1); } } - 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; + return object3.index - other.index; + } + 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; + } + }); + + // ../../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); + }; + } + return iteratee; + }); + } else { + iteratees = [identity_default4]; } - if (cnf.fontSize) { - conf$4.actorFontSize = conf$4.noteFontSize = conf$4.messageFontSize = cnf.fontSize; + 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); + }); + } + 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; } - if (cnf.fontWeight) { - conf$4.actorFontWeight = conf$4.noteFontWeight = conf$4.messageFontWeight = cnf.fontWeight; + }); + + // ../../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; } - }; - const actorActivations = function(actor) { - return bounds$1.activations.filter(function(activation) { - return activation.actor === actor; + }); + + // ../../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 result; + } + 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); }); - }; - const activationBounds = function(actor, actors2) { - const actorObj = actors2[actor]; - const activations = actorActivations(actor); - const left2 = activations.reduce(function(acc, activation) { - return Math.min(acc, activation.startx); - }, actorObj.x + actorObj.width / 2); - const right2 = activations.reduce(function(acc, activation) { - return Math.max(acc, activation.stopx); - }, actorObj.x + actorObj.width / 2); - 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.wrapLabel(`[${msg.message}]`, loopWidth - 2 * conf$4.wrapPadding, textConf); - msg.width = loopWidth; - msg.wrap = true; - const textDims = utils.calculateTextDimensions(msg.message, textConf); - const totalOffset = Math.max(textDims.height, conf$4.labelBoxHeight); - heightAdjust = postMargin + totalOffset; - log$1.debug(`${totalOffset} - ${msg.message}`); + } + 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; } - addLoopFn(msg); - bounds$1.bumpVerticalPos(heightAdjust); - } - const draw$8 = function(_text, id2, _version, diagObj) { - const { securityLevel, sequence: sequence2 } = getConfig$1(); - conf$4 = sequence2; - diagObj.db.clear(); - diagObj.parser.parse(_text); - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("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}"]`) : select(`[id="${id2}"]`); - const actors2 = diagObj.db.getActors(); - const boxes2 = diagObj.db.getBoxes(); - const actorKeys = diagObj.db.getActorKeys(); - const messages2 = diagObj.db.getMessages(); - const title2 = diagObj.db.getDiagramTitle(); - const hasBoxes = diagObj.db.hasAtLeastOneBox(); - const hasBoxTitles = diagObj.db.hasAtLeastOneBoxWithTitle(); - const maxMessageWidthPerActor = getMaxMessageWidthPerActor(actors2, messages2, diagObj); - conf$4.height = calculateActorMargins(actors2, maxMessageWidthPerActor, boxes2); - 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(boxes2[0].textMaxHeight); - } - } - drawActors(diagram2, actors2, actorKeys, 0, conf$4, messages2, false); - const loopWidths = calculateLoopBounds(messages2, 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 = []; - messages2.forEach(function(msg) { - let loopModel, noteModel, msgModel; - switch (msg.type) { - case diagObj.db.LINETYPE.NOTE: - noteModel = msg.noteModel; - drawNote$1(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, - (message2) => bounds$1.newLoop(message2) - ); - break; - case diagObj.db.LINETYPE.LOOP_END: - loopModel = bounds$1.endLoop(); - 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, - (message2) => bounds$1.newLoop(void 0, message2.message) - ); - break; - case diagObj.db.LINETYPE.RECT_END: - loopModel = bounds$1.endLoop(); - svgDraw$3.drawBackgroundRect(diagram2, 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, - (message2) => bounds$1.newLoop(message2) - ); - break; - case diagObj.db.LINETYPE.OPT_END: - loopModel = bounds$1.endLoop(); - 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, - (message2) => bounds$1.newLoop(message2) - ); - break; - case diagObj.db.LINETYPE.ALT_ELSE: - adjustLoopHeightForWrap( - loopWidths, - msg, - conf$4.boxMargin + conf$4.boxTextMargin, - conf$4.boxMargin, - (message2) => bounds$1.addSectionToLoop(message2) - ); - break; - case diagObj.db.LINETYPE.ALT_END: - loopModel = bounds$1.endLoop(); - 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: - adjustLoopHeightForWrap( - loopWidths, - msg, - conf$4.boxMargin, - conf$4.boxMargin + conf$4.boxTextMargin, - (message2) => bounds$1.newLoop(message2) - ); - break; - case diagObj.db.LINETYPE.PAR_AND: - adjustLoopHeightForWrap( - loopWidths, - msg, - conf$4.boxMargin + conf$4.boxTextMargin, - conf$4.boxMargin, - (message2) => bounds$1.addSectionToLoop(message2) - ); - break; - case diagObj.db.LINETYPE.PAR_END: - loopModel = bounds$1.endLoop(); - 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(); - } else { - diagObj.db.disableSequenceNumbers(); - } - break; - case diagObj.db.LINETYPE.CRITICAL_START: - adjustLoopHeightForWrap( - loopWidths, - msg, - conf$4.boxMargin, - conf$4.boxMargin + conf$4.boxTextMargin, - (message2) => bounds$1.newLoop(message2) - ); - break; - case diagObj.db.LINETYPE.CRITICAL_OPTION: - adjustLoopHeightForWrap( - loopWidths, - msg, - conf$4.boxMargin + conf$4.boxTextMargin, - conf$4.boxMargin, - (message2) => bounds$1.addSectionToLoop(message2) - ); - break; - case diagObj.db.LINETYPE.CRITICAL_END: - loopModel = bounds$1.endLoop(); - 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, - (message2) => bounds$1.newLoop(message2) - ); - break; - case diagObj.db.LINETYPE.BREAK_END: - loopModel = bounds$1.endLoop(); - 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 = boundMessage(diagram2, msgModel); - 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; + }); + + // ../../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; + } + }); + + // ../../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; + } + }); + + // ../../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); }); - messagesToDraw.forEach((e) => drawMessage(diagram2, e.messageModel, e.lineStartY, diagObj)); - if (conf$4.mirrorActors) { - bounds$1.bumpVerticalPos(conf$4.boxMargin * 2); - drawActors(diagram2, actors2, actorKeys, bounds$1.getVerticalPos(), conf$4, messages2, true); - bounds$1.bumpVerticalPos(conf$4.boxMargin); - fixLifeLineHeights(diagram2, bounds$1.getVerticalPos()); - } - bounds$1.models.boxes.forEach(function(box2) { - 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)"; - svgDraw$3.drawBox(diagram2, box2, conf$4); + return accumulator; + } + 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_size3 = __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; }); - if (hasBoxes) { - bounds$1.bumpVerticalPos(conf$4.boxMargin); - } - const requiredBoxSize = drawActorsPopup(diagram2, actors2, actorKeys, doc); - const { bounds: box } = bounds$1.getBounds(); - log$1.debug("For line height fix Querying: #" + id2 + " .actor-line"); - const actorLines = selectAll("#" + id2 + " .actor-line"); - actorLines.attr("y2", box.stopy); - let boxHeight = box.stopy - box.starty; - if (boxHeight < requiredBoxSize.maxHeight) { - boxHeight = requiredBoxSize.maxHeight; - } - let height2 = boxHeight + 2 * conf$4.diagramMarginY; - if (conf$4.mirrorActors) { - height2 = height2 - 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, height2, width2, conf$4.useMaxWidth); - const extraVertForTitle = title2 ? 40 : 0; - diagram2.attr( - "viewBox", - box.startx - conf$4.diagramMarginX + " -" + (conf$4.diagramMarginY + extraVertForTitle) + " " + width2 + " " + (height2 + extraVertForTitle) - ); - log$1.debug(`models:`, bounds$1.models); - }; - function getMaxMessageWidthPerActor(actors2, messages2, diagObj) { - const maxMessageWidthPerActor = {}; - messages2.forEach(function(msg) { - if (actors2[msg.to] && actors2[msg.from]) { - const actor = actors2[msg.to]; - if (msg.placement === diagObj.db.PLACEMENT.LEFTOF && !actor.prevActor) { - return; + return !!result; + } + 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 []; } - if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF && !actor.nextActor) { - 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]]; } - const isNote = msg.placement !== void 0; - const isMessage = !isNote; - const textFont = isNote ? noteFont(conf$4) : messageFont(conf$4); - const wrappedMessage = msg.wrap ? utils.wrapLabel(msg.message, conf$4.width - 2 * conf$4.wrapPadding, textFont) : msg.message; - const messageDimensions = utils.calculateTextDimensions(wrappedMessage, textFont); - const messageWidth = messageDimensions.width + 2 * conf$4.wrapPadding; - if (isMessage && msg.from === actor.nextActor) { - maxMessageWidthPerActor[msg.to] = Math.max( - maxMessageWidthPerActor[msg.to] || 0, - messageWidth - ); - } else if (isMessage && msg.from === actor.prevActor) { - maxMessageWidthPerActor[msg.from] = Math.max( - maxMessageWidthPerActor[msg.from] || 0, - messageWidth - ); - } else if (isMessage && msg.from === msg.to) { - maxMessageWidthPerActor[msg.from] = Math.max( - maxMessageWidthPerActor[msg.from] || 0, - messageWidth / 2 - ); - maxMessageWidthPerActor[msg.to] = Math.max( - maxMessageWidthPerActor[msg.to] || 0, - messageWidth / 2 - ); - } else if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF) { - maxMessageWidthPerActor[msg.from] = Math.max( - maxMessageWidthPerActor[msg.from] || 0, - messageWidth - ); - } else if (msg.placement === diagObj.db.PLACEMENT.LEFTOF) { - maxMessageWidthPerActor[actor.prevActor] = Math.max( - maxMessageWidthPerActor[actor.prevActor] || 0, - messageWidth - ); - } else if (msg.placement === diagObj.db.PLACEMENT.OVER) { - if (actor.prevActor) { - maxMessageWidthPerActor[actor.prevActor] = Math.max( - maxMessageWidthPerActor[actor.prevActor] || 0, - messageWidth / 2 - ); + return baseOrderBy_default(collection4, baseFlatten_default(iteratees, 1), []); + }); + 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 (actor.nextActor) { - maxMessageWidthPerActor[msg.from] = Math.max( - maxMessageWidthPerActor[msg.from] || 0, - messageWidth / 2 - ); + if (iteratee) { + seen.push(computed); + } + result.push(value2); + } else if (!includes3(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); } + result.push(value2); } } - }); - log$1.debug("maxMessageWidthPerActor:", maxMessageWidthPerActor); - return maxMessageWidthPerActor; + return result; } - const getRequiredPopupWidth = function(actor) { - let requiredPopupWidth = 0; - const textFont = actorFont(conf$4); - for (const key in actor.links) { - const labelDimensions = utils.calculateTextDimensions(key, textFont); - const labelWidth = labelDimensions.width + 2 * conf$4.wrapPadding + 2 * conf$4.boxMargin; - if (requiredPopupWidth < labelWidth) { - requiredPopupWidth = labelWidth; - } + 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; } - return requiredPopupWidth; - }; - function calculateActorMargins(actors2, actorToMessageWidth, boxes2) { - let maxHeight = 0; - Object.keys(actors2).forEach((prop) => { - const actor = actors2[prop]; - if (actor.wrap) { - actor.description = utils.wrapLabel( - actor.description, - conf$4.width - 2 * conf$4.wrapPadding, - actorFont(conf$4) - ); - } - const actDims = utils.calculateTextDimensions(actor.description, actorFont(conf$4)); - actor.width = actor.wrap ? conf$4.width : Math.max(conf$4.width, actDims.width + 2 * conf$4.wrapPadding); - actor.height = actor.wrap ? Math.max(actDims.height, conf$4.height) : conf$4.height; - maxHeight = Math.max(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 = Math.max(actorWidth2, conf$4.actorMargin); - continue; - } - const messageWidth = actorToMessageWidth[actorKey]; - const actorWidth = messageWidth + conf$4.actorMargin - actor.width / 2 - nextActor.width / 2; - actor.margin = Math.max(actorWidth, conf$4.actorMargin); + }); + + // ../../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; } - let maxBoxHeight = 0; - boxes2.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.wrapLabel(box.name, totalWidth - 2 * conf$4.wrapPadding, textFont); - } - const boxMsgDimensions = utils.calculateTextDimensions(box.name, textFont); - maxBoxHeight = Math.max(boxMsgDimensions.height, maxBoxHeight); - const minWidth = Math.max(totalWidth, boxMsgDimensions.width + 2 * conf$4.wrapPadding); - box.margin = conf$4.boxTextMargin; - if (totalWidth < minWidth) { - const missing = (minWidth - totalWidth) / 2; - box.margin += missing; - } - }); - boxes2.forEach((box) => box.textMaxHeight = maxBoxHeight); - return Math.max(maxHeight, conf$4.height); - } - const buildNoteModel = function(msg, actors2, diagObj) { - const startx = actors2[msg.from].x; - const stopx = actors2[msg.to].x; - const shouldWrap = msg.wrap && msg.message; - let textDimensions = utils.calculateTextDimensions( - shouldWrap ? utils.wrapLabel(msg.message, conf$4.width, noteFont(conf$4)) : msg.message, - noteFont(conf$4) - ); - const noteModel = { - width: shouldWrap ? conf$4.width : Math.max(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 ? Math.max(conf$4.width, textDimensions.width) : Math.max( - 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 ? Math.max(conf$4.width, textDimensions.width + 2 * conf$4.noteMargin) : Math.max( - 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.calculateTextDimensions( - shouldWrap ? utils.wrapLabel(msg.message, Math.max(conf$4.width, actors2[msg.from].width), noteFont(conf$4)) : msg.message, - noteFont(conf$4) - ); - noteModel.width = shouldWrap ? Math.max(conf$4.width, actors2[msg.from].width) : Math.max(actors2[msg.from].width, conf$4.width, textDimensions.width + 2 * conf$4.noteMargin); - noteModel.startx = startx + (actors2[msg.from].width - noteModel.width) / 2; + }); + + // ../../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 id27 = ++idCounter; + return toString_default(prefix) + id27; + } + 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; + } + 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); + } + 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_defaults3(); + 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_merge4(); + init_min2(); + init_minBy(); + init_noop2(); + init_now(); + init_pick(); + init_pickBy(); + init_range2(); + init_reduce(); + init_reject(); + init_size3(); + 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 { - 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.wrapLabel( - msg.message, - noteModel.width - 2 * conf$4.wrapPadding, - noteFont(conf$4) - ); + map5[k2] = 1; } - 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) { - let process = false; - 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)) { - process = true; - } - if (!process) { - return {}; + } + function decrementOrRemoveEntry(map5, k2) { + if (!--map5[k2]) { + delete map5[k2]; } - const fromBounds = activationBounds(msg.from, actors2); - const toBounds = activationBounds(msg.to, actors2); - const fromIdx = fromBounds[0] <= toBounds[0] ? 1 : 0; - const toIdx = fromBounds[0] < toBounds[0] ? 0 : 1; - const allBounds = [...fromBounds, ...toBounds]; - const boundedWidth = Math.abs(toBounds[toIdx] - fromBounds[fromIdx]); - if (msg.wrap && msg.message) { - msg.message = utils.wrapLabel( - msg.message, - Math.max(boundedWidth + 2 * conf$4.wrapPadding, conf$4.width), - messageFont(conf$4) - ); + } + function edgeArgsToId(isDirected, v_, w_, name) { + var v3 = "" + v_; + var w3 = "" + w_; + if (!isDirected && v3 > w3) { + var tmp = v3; + v3 = w3; + w3 = tmp; } - const msgDims = utils.calculateTextDimensions(msg.message, messageFont(conf$4)); - return { - width: Math.max( - msg.wrap ? 0 : msgDims.width + 2 * conf$4.wrapPadding, - boundedWidth + 2 * conf$4.wrapPadding, - conf$4.width - ), - height: 0, - startx: fromBounds[fromIdx], - stopx: toBounds[toIdx], - 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 = function(messages2, actors2, _maxWidthPerActor, diagObj) { - const loops = {}; - const stack = []; - let current, noteModel, msgModel; - messages2.forEach(function(msg) { - msg.id = utils.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.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[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); - } - 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]; + 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); } - break; - } - const isNote = msg.placement !== void 0; - if (isNote) { - noteModel = buildNoteModel(msg, actors2, diagObj); - msg.noteModel = noteModel; - stack.forEach((stk) => { - current = stk; - current.from = Math.min(current.from, noteModel.startx); - current.to = Math.max(current.to, noteModel.startx + noteModel.width); - current.width = Math.max(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 = Math.min( - from2.x - msgModel.width / 2, - from2.x - from2.width / 2, - current.from - ); - current.to = Math.max(to.x + msgModel.width / 2, to.x + from2.width / 2, current.to); - current.width = Math.max(current.width, Math.abs(current.to - current.from)) - conf$4.labelBoxWidth; + 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]); + }); + } + sinks() { + var self2 = this; + return filter_default3(this.nodes(), function(v3) { + return isEmpty_default(self2._out[v3]); + }); + } + setNodes(vs, value2) { + var args = arguments; + var self2 = this; + forEach_default(vs, function(v3) { + if (args.length > 1) { + self2.setNode(v3, value2); } else { - current.from = Math.min(msgModel.startx, current.from); - current.to = Math.max(msgModel.stopx, current.to); - current.width = Math.max(current.width, msgModel.width) - conf$4.labelBoxWidth; + self2.setNode(v3); } }); + return this; } - } - }); - bounds$1.activations = []; - log$1.debug("Loop type widths:", loops); - return loops; - }; - const renderer$7 = { - bounds: bounds$1, - drawActors, - drawActorsPopup, - setConf: setConf$4, - draw: draw$8 - }; - const diagram$8 = { - parser: parser$a, - db: db$4, - renderer: renderer$7, - styles: styles$5 - }; - const sequenceDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$8 - }, Symbol.toStringTag, { value: "Module" })); - var parser$7 = function() { - var o = function(k, v, o2, l) { - for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) - ; - return o2; - }, $V0 = [1, 32], $V1 = [1, 33], $V2 = [1, 34], $V3 = [1, 35], $V4 = [1, 9], $V5 = [1, 8], $V6 = [1, 18], $V7 = [1, 19], $V8 = [1, 20], $V9 = [1, 38], $Va = [1, 25], $Vb = [1, 23], $Vc = [1, 24], $Vd = [1, 30], $Ve = [1, 31], $Vf = [1, 26], $Vg = [1, 27], $Vh = [1, 28], $Vi = [1, 29], $Vj = [1, 42], $Vk = [1, 39], $Vl = [1, 40], $Vm = [1, 41], $Vn = [1, 43], $Vo = [1, 16, 24], $Vp = [1, 57], $Vq = [1, 58], $Vr = [1, 59], $Vs = [1, 60], $Vt = [1, 61], $Vu = [1, 62], $Vv = [1, 63], $Vw = [1, 73], $Vx = [1, 16, 24, 27, 28, 35, 48, 49, 63, 64, 65, 66, 67, 68, 69, 74, 76], $Vy = [1, 16, 24, 27, 28, 33, 35, 48, 49, 54, 63, 64, 65, 66, 67, 68, 69, 74, 76, 89, 91, 92, 93, 94], $Vz = [1, 80], $VA = [28, 89, 91, 92, 93, 94], $VB = [28, 68, 69, 89, 91, 92, 93, 94], $VC = [28, 63, 64, 65, 66, 67, 89, 91, 92, 93, 94], $VD = [1, 90], $VE = [1, 16, 24, 48, 49], $VF = [1, 16, 24, 35], $VG = [8, 9, 10, 11, 19, 23, 42, 44, 46, 52, 53, 55, 56, 58, 60, 70, 71, 73, 77, 89, 91, 92, 93, 94]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "mermaidDoc": 4, "directive": 5, "statements": 6, "direction": 7, "direction_tb": 8, "direction_bt": 9, "direction_rl": 10, "direction_lr": 11, "graphConfig": 12, "openDirective": 13, "typeDirective": 14, "closeDirective": 15, "NEWLINE": 16, ":": 17, "argDirective": 18, "open_directive": 19, "type_directive": 20, "arg_directive": 21, "close_directive": 22, "CLASS_DIAGRAM": 23, "EOF": 24, "statement": 25, "classLabel": 26, "SQS": 27, "STR": 28, "SQE": 29, "className": 30, "alphaNumToken": 31, "classLiteralName": 32, "GENERICTYPE": 33, "relationStatement": 34, "LABEL": 35, "classStatement": 36, "methodStatement": 37, "annotationStatement": 38, "clickStatement": 39, "cssClassStatement": 40, "noteStatement": 41, "acc_title": 42, "acc_title_value": 43, "acc_descr": 44, "acc_descr_value": 45, "acc_descr_multiline_value": 46, "classIdentifier": 47, "STYLE_SEPARATOR": 48, "STRUCT_START": 49, "members": 50, "STRUCT_STOP": 51, "CLASS": 52, "ANNOTATION_START": 53, "ANNOTATION_END": 54, "MEMBER": 55, "SEPARATOR": 56, "relation": 57, "NOTE_FOR": 58, "noteText": 59, "NOTE": 60, "relationType": 61, "lineType": 62, "AGGREGATION": 63, "EXTENSION": 64, "COMPOSITION": 65, "DEPENDENCY": 66, "LOLLIPOP": 67, "LINE": 68, "DOTTED_LINE": 69, "CALLBACK": 70, "LINK": 71, "LINK_TARGET": 72, "CLICK": 73, "CALLBACK_NAME": 74, "CALLBACK_ARGS": 75, "HREF": 76, "CSSCLASS": 77, "commentToken": 78, "textToken": 79, "graphCodeTokens": 80, "textNoTagsToken": 81, "TAGSTART": 82, "TAGEND": 83, "==": 84, "--": 85, "PCT": 86, "DEFAULT": 87, "SPACE": 88, "MINUS": 89, "keywords": 90, "UNICODE_TEXT": 91, "NUM": 92, "ALPHA": 93, "BQUOTE_STR": 94, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 8: "direction_tb", 9: "direction_bt", 10: "direction_rl", 11: "direction_lr", 16: "NEWLINE", 17: ":", 19: "open_directive", 20: "type_directive", 21: "arg_directive", 22: "close_directive", 23: "CLASS_DIAGRAM", 24: "EOF", 27: "SQS", 28: "STR", 29: "SQE", 33: "GENERICTYPE", 35: "LABEL", 42: "acc_title", 43: "acc_title_value", 44: "acc_descr", 45: "acc_descr_value", 46: "acc_descr_multiline_value", 48: "STYLE_SEPARATOR", 49: "STRUCT_START", 51: "STRUCT_STOP", 52: "CLASS", 53: "ANNOTATION_START", 54: "ANNOTATION_END", 55: "MEMBER", 56: "SEPARATOR", 58: "NOTE_FOR", 60: "NOTE", 63: "AGGREGATION", 64: "EXTENSION", 65: "COMPOSITION", 66: "DEPENDENCY", 67: "LOLLIPOP", 68: "LINE", 69: "DOTTED_LINE", 70: "CALLBACK", 71: "LINK", 72: "LINK_TARGET", 73: "CLICK", 74: "CALLBACK_NAME", 75: "CALLBACK_ARGS", 76: "HREF", 77: "CSSCLASS", 80: "graphCodeTokens", 82: "TAGSTART", 83: "TAGEND", 84: "==", 85: "--", 86: "PCT", 87: "DEFAULT", 88: "SPACE", 89: "MINUS", 90: "keywords", 91: "UNICODE_TEXT", 92: "NUM", 93: "ALPHA", 94: "BQUOTE_STR" }, - productions_: [0, [3, 1], [3, 2], [3, 1], [7, 1], [7, 1], [7, 1], [7, 1], [4, 1], [5, 4], [5, 6], [13, 1], [14, 1], [18, 1], [15, 1], [12, 4], [6, 1], [6, 2], [6, 3], [26, 3], [30, 1], [30, 1], [30, 2], [30, 2], [30, 2], [25, 1], [25, 2], [25, 1], [25, 1], [25, 1], [25, 1], [25, 1], [25, 1], [25, 1], [25, 2], [25, 2], [25, 1], [36, 1], [36, 3], [36, 4], [36, 6], [47, 2], [47, 3], [38, 4], [50, 1], [50, 2], [37, 1], [37, 2], [37, 1], [37, 1], [34, 3], [34, 4], [34, 4], [34, 5], [41, 3], [41, 2], [57, 3], [57, 2], [57, 2], [57, 1], [61, 1], [61, 1], [61, 1], [61, 1], [61, 1], [62, 1], [62, 1], [39, 3], [39, 4], [39, 3], [39, 4], [39, 4], [39, 5], [39, 3], [39, 4], [39, 4], [39, 5], [39, 3], [39, 4], [39, 4], [39, 5], [40, 3], [78, 1], [78, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [81, 1], [81, 1], [81, 1], [81, 1], [31, 1], [31, 1], [31, 1], [31, 1], [32, 1], [59, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 4: - yy.setDirection("TB"); - break; - case 5: - yy.setDirection("BT"); - break; - case 6: - yy.setDirection("RL"); - break; - case 7: - yy.setDirection("LR"); - break; - case 11: - yy.parseDirective("%%{", "open_directive"); - break; - case 12: - yy.parseDirective($$[$0], "type_directive"); - break; - case 13: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); - yy.parseDirective($$[$0], "arg_directive"); - break; - case 14: - yy.parseDirective("}%%", "close_directive", "class"); - break; - case 19: - this.$ = $$[$0 - 1]; - break; - case 20: - case 21: - this.$ = $$[$0]; - break; - case 22: - this.$ = $$[$0 - 1] + $$[$0]; - break; - case 23: - case 24: - this.$ = $$[$0 - 1] + "~" + $$[$0] + "~"; - break; - case 25: - yy.addRelation($$[$0]); - break; - case 26: - $$[$0 - 1].title = yy.cleanupLabel($$[$0]); - yy.addRelation($$[$0 - 1]); - break; - case 34: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 35: - case 36: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 38: - yy.setCssClass($$[$0 - 2], $$[$0]); - break; - case 39: - yy.addMembers($$[$0 - 3], $$[$0 - 1]); - break; - case 40: - yy.setCssClass($$[$0 - 5], $$[$0 - 3]); - yy.addMembers($$[$0 - 5], $$[$0 - 1]); - break; - case 41: - this.$ = $$[$0]; - yy.addClass($$[$0]); - break; - case 42: - this.$ = $$[$0 - 1]; - yy.addClass($$[$0 - 1]); - yy.setClassLabel($$[$0 - 1], $$[$0]); - break; - case 43: - yy.addAnnotation($$[$0], $$[$0 - 2]); - break; - case 44: - this.$ = [$$[$0]]; - break; - case 45: - $$[$0].push($$[$0 - 1]); - this.$ = $$[$0]; - break; - case 46: - break; - case 47: - yy.addMember($$[$0 - 1], yy.cleanupLabel($$[$0])); - break; - case 48: - break; - case 49: - break; - case 50: - this.$ = { "id1": $$[$0 - 2], "id2": $$[$0], relation: $$[$0 - 1], relationTitle1: "none", relationTitle2: "none" }; - break; - case 51: - this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 1], relationTitle1: $$[$0 - 2], relationTitle2: "none" }; - break; - case 52: - this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: "none", relationTitle2: $$[$0 - 1] }; - break; - case 53: - this.$ = { id1: $$[$0 - 4], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: $$[$0 - 3], relationTitle2: $$[$0 - 1] }; - break; - case 54: - yy.addNote($$[$0], $$[$0 - 1]); - break; - case 55: - yy.addNote($$[$0]); - break; - case 56: - this.$ = { type1: $$[$0 - 2], type2: $$[$0], lineType: $$[$0 - 1] }; - break; - case 57: - this.$ = { type1: "none", type2: $$[$0], lineType: $$[$0 - 1] }; - break; - case 58: - this.$ = { type1: $$[$0 - 1], type2: "none", lineType: $$[$0] }; - break; - case 59: - this.$ = { type1: "none", type2: "none", lineType: $$[$0] }; - break; - case 60: - this.$ = yy.relationType.AGGREGATION; - break; - case 61: - this.$ = yy.relationType.EXTENSION; - break; - case 62: - this.$ = yy.relationType.COMPOSITION; - break; - case 63: - this.$ = yy.relationType.DEPENDENCY; - break; - case 64: - this.$ = yy.relationType.LOLLIPOP; - break; - case 65: - this.$ = yy.lineType.LINE; - break; - case 66: - this.$ = yy.lineType.DOTTED_LINE; - break; - case 67: - case 73: - this.$ = $$[$0 - 2]; - yy.setClickEvent($$[$0 - 1], $$[$0]); - break; - case 68: - case 74: - this.$ = $$[$0 - 3]; - yy.setClickEvent($$[$0 - 2], $$[$0 - 1]); - yy.setTooltip($$[$0 - 2], $$[$0]); - break; - case 69: - case 77: - this.$ = $$[$0 - 2]; - yy.setLink($$[$0 - 1], $$[$0]); - break; - case 70: - this.$ = $$[$0 - 3]; - yy.setLink($$[$0 - 2], $$[$0 - 1], $$[$0]); - break; - case 71: - case 79: - this.$ = $$[$0 - 3]; - yy.setLink($$[$0 - 2], $$[$0 - 1]); - yy.setTooltip($$[$0 - 2], $$[$0]); - break; - case 72: - case 80: - this.$ = $$[$0 - 4]; - yy.setLink($$[$0 - 3], $$[$0 - 2], $$[$0]); - yy.setTooltip($$[$0 - 3], $$[$0 - 1]); - break; - case 75: - this.$ = $$[$0 - 3]; - yy.setClickEvent($$[$0 - 2], $$[$0 - 1], $$[$0]); - break; - case 76: - this.$ = $$[$0 - 4]; - yy.setClickEvent($$[$0 - 3], $$[$0 - 2], $$[$0 - 1]); - yy.setTooltip($$[$0 - 3], $$[$0]); - break; - case 78: - this.$ = $$[$0 - 3]; - yy.setLink($$[$0 - 2], $$[$0 - 1], $$[$0]); - break; - case 81: - yy.setCssClass($$[$0 - 1], $$[$0]); - break; + 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; } - }, - table: [{ 3: 1, 4: 2, 5: 3, 6: 4, 7: 17, 8: $V0, 9: $V1, 10: $V2, 11: $V3, 12: 5, 13: 6, 19: $V4, 23: $V5, 25: 7, 30: 21, 31: 36, 32: 37, 34: 10, 36: 11, 37: 12, 38: 13, 39: 14, 40: 15, 41: 16, 42: $V6, 44: $V7, 46: $V8, 47: 22, 52: $V9, 53: $Va, 55: $Vb, 56: $Vc, 58: $Vd, 60: $Ve, 70: $Vf, 71: $Vg, 73: $Vh, 77: $Vi, 89: $Vj, 91: $Vk, 92: $Vl, 93: $Vm, 94: $Vn }, { 1: [3] }, { 1: [2, 1] }, { 3: 44, 4: 2, 5: 3, 6: 4, 7: 17, 8: $V0, 9: $V1, 10: $V2, 11: $V3, 12: 5, 13: 6, 19: $V4, 23: $V5, 25: 7, 30: 21, 31: 36, 32: 37, 34: 10, 36: 11, 37: 12, 38: 13, 39: 14, 40: 15, 41: 16, 42: $V6, 44: $V7, 46: $V8, 47: 22, 52: $V9, 53: $Va, 55: $Vb, 56: $Vc, 58: $Vd, 60: $Ve, 70: $Vf, 71: $Vg, 73: $Vh, 77: $Vi, 89: $Vj, 91: $Vk, 92: $Vl, 93: $Vm, 94: $Vn }, { 1: [2, 3] }, { 1: [2, 8] }, { 14: 45, 20: [1, 46] }, o($Vc, [2, 16], { 16: [1, 47] }), { 16: [1, 48] }, { 20: [2, 11] }, o($Vo, [2, 25], { 35: [1, 49] }), o($Vo, [2, 27]), o($Vo, [2, 28]), o($Vo, [2, 29]), o($Vo, [2, 30]), o($Vo, [2, 31]), o($Vo, [2, 32]), o($Vo, [2, 33]), { 43: [1, 50] }, { 45: [1, 51] }, o($Vo, [2, 36]), o($Vo, [2, 46], { 57: 52, 61: 55, 62: 56, 28: [1, 53], 35: [1, 54], 63: $Vp, 64: $Vq, 65: $Vr, 66: $Vs, 67: $Vt, 68: $Vu, 69: $Vv }), o($Vo, [2, 37], { 48: [1, 64], 49: [1, 65] }), o($Vo, [2, 48]), o($Vo, [2, 49]), { 31: 66, 89: $Vj, 91: $Vk, 92: $Vl, 93: $Vm }, { 30: 67, 31: 36, 32: 37, 89: $Vj, 91: $Vk, 92: $Vl, 93: $Vm, 94: $Vn }, { 30: 68, 31: 36, 32: 37, 89: $Vj, 91: $Vk, 92: $Vl, 93: $Vm, 94: $Vn }, { 30: 69, 31: 36, 32: 37, 89: $Vj, 91: $Vk, 92: $Vl, 93: $Vm, 94: $Vn }, { 28: [1, 70] }, { 30: 71, 31: 36, 32: 37, 89: $Vj, 91: $Vk, 92: $Vl, 93: $Vm, 94: $Vn }, { 28: $Vw, 59: 72 }, o($Vo, [2, 4]), o($Vo, [2, 5]), o($Vo, [2, 6]), o($Vo, [2, 7]), o($Vx, [2, 20], { 31: 36, 32: 37, 30: 74, 33: [1, 75], 89: $Vj, 91: $Vk, 92: $Vl, 93: $Vm, 94: $Vn }), o($Vx, [2, 21], { 33: [1, 76] }), { 30: 77, 31: 36, 32: 37, 89: $Vj, 91: $Vk, 92: $Vl, 93: $Vm, 94: $Vn }, o($Vy, [2, 95]), o($Vy, [2, 96]), o($Vy, [2, 97]), o($Vy, [2, 98]), o([1, 16, 24, 27, 28, 33, 35, 48, 49, 63, 64, 65, 66, 67, 68, 69, 74, 76], [2, 99]), { 1: [2, 2] }, { 15: 78, 17: [1, 79], 22: $Vz }, o([17, 22], [2, 12]), o($Vc, [2, 17], { 25: 7, 34: 10, 36: 11, 37: 12, 38: 13, 39: 14, 40: 15, 41: 16, 7: 17, 30: 21, 47: 22, 31: 36, 32: 37, 6: 81, 8: $V0, 9: $V1, 10: $V2, 11: $V3, 42: $V6, 44: $V7, 46: $V8, 52: $V9, 53: $Va, 55: $Vb, 56: $Vc, 58: $Vd, 60: $Ve, 70: $Vf, 71: $Vg, 73: $Vh, 77: $Vi, 89: $Vj, 91: $Vk, 92: $Vl, 93: $Vm, 94: $Vn }), { 6: 82, 7: 17, 8: $V0, 9: $V1, 10: $V2, 11: $V3, 25: 7, 30: 21, 31: 36, 32: 37, 34: 10, 36: 11, 37: 12, 38: 13, 39: 14, 40: 15, 41: 16, 42: $V6, 44: $V7, 46: $V8, 47: 22, 52: $V9, 53: $Va, 55: $Vb, 56: $Vc, 58: $Vd, 60: $Ve, 70: $Vf, 71: $Vg, 73: $Vh, 77: $Vi, 89: $Vj, 91: $Vk, 92: $Vl, 93: $Vm, 94: $Vn }, o($Vo, [2, 26]), o($Vo, [2, 34]), o($Vo, [2, 35]), { 28: [1, 84], 30: 83, 31: 36, 32: 37, 89: $Vj, 91: $Vk, 92: $Vl, 93: $Vm, 94: $Vn }, { 57: 85, 61: 55, 62: 56, 63: $Vp, 64: $Vq, 65: $Vr, 66: $Vs, 67: $Vt, 68: $Vu, 69: $Vv }, o($Vo, [2, 47]), { 62: 86, 68: $Vu, 69: $Vv }, o($VA, [2, 59], { 61: 87, 63: $Vp, 64: $Vq, 65: $Vr, 66: $Vs, 67: $Vt }), o($VB, [2, 60]), o($VB, [2, 61]), o($VB, [2, 62]), o($VB, [2, 63]), o($VB, [2, 64]), o($VC, [2, 65]), o($VC, [2, 66]), { 31: 88, 89: $Vj, 91: $Vk, 92: $Vl, 93: $Vm }, { 50: 89, 55: $VD }, { 54: [1, 91] }, { 28: [1, 92] }, { 28: [1, 93] }, { 74: [1, 94], 76: [1, 95] }, { 31: 96, 89: $Vj, 91: $Vk, 92: $Vl, 93: $Vm }, { 28: $Vw, 59: 97 }, o($Vo, [2, 55]), o($Vo, [2, 100]), o($Vx, [2, 22]), o($Vx, [2, 23]), o($Vx, [2, 24]), o($VE, [2, 41], { 26: 98, 27: [1, 99] }), { 16: [1, 100] }, { 18: 101, 21: [1, 102] }, { 16: [2, 14] }, o($Vc, [2, 18]), { 24: [1, 103] }, o($VF, [2, 50]), { 30: 104, 31: 36, 32: 37, 89: $Vj, 91: $Vk, 92: $Vl, 93: $Vm, 94: $Vn }, { 28: [1, 106], 30: 105, 31: 36, 32: 37, 89: $Vj, 91: $Vk, 92: $Vl, 93: $Vm, 94: $Vn }, o($VA, [2, 58], { 61: 107, 63: $Vp, 64: $Vq, 65: $Vr, 66: $Vs, 67: $Vt }), o($VA, [2, 57]), o($Vo, [2, 38], { 49: [1, 108] }), { 51: [1, 109] }, { 50: 110, 51: [2, 44], 55: $VD }, { 30: 111, 31: 36, 32: 37, 89: $Vj, 91: $Vk, 92: $Vl, 93: $Vm, 94: $Vn }, o($Vo, [2, 67], { 28: [1, 112] }), o($Vo, [2, 69], { 28: [1, 114], 72: [1, 113] }), o($Vo, [2, 73], { 28: [1, 115], 75: [1, 116] }), o($Vo, [2, 77], { 28: [1, 118], 72: [1, 117] }), o($Vo, [2, 81]), o($Vo, [2, 54]), o($VE, [2, 42]), { 28: [1, 119] }, o($VG, [2, 9]), { 15: 120, 22: $Vz }, { 22: [2, 13] }, { 1: [2, 15] }, o($VF, [2, 52]), o($VF, [2, 51]), { 30: 121, 31: 36, 32: 37, 89: $Vj, 91: $Vk, 92: $Vl, 93: $Vm, 94: $Vn }, o($VA, [2, 56]), { 50: 122, 55: $VD }, o($Vo, [2, 39]), { 51: [2, 45] }, o($Vo, [2, 43]), o($Vo, [2, 68]), o($Vo, [2, 70]), o($Vo, [2, 71], { 72: [1, 123] }), o($Vo, [2, 74]), o($Vo, [2, 75], { 28: [1, 124] }), o($Vo, [2, 78]), o($Vo, [2, 79], { 72: [1, 125] }), { 29: [1, 126] }, { 16: [1, 127] }, o($VF, [2, 53]), { 51: [1, 128] }, o($Vo, [2, 72]), o($Vo, [2, 76]), o($Vo, [2, 80]), o($VE, [2, 19]), o($VG, [2, 10]), o($Vo, [2, 40])], - defaultActions: { 2: [2, 1], 4: [2, 3], 5: [2, 8], 9: [2, 11], 44: [2, 2], 80: [2, 14], 102: [2, 13], 103: [2, 15], 110: [2, 45] }, - parseError: function parseError2(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; + node(v3) { + return this._nodes[v3]; } - }, - 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; + hasNode(v3) { + return has_default(this._nodes, v3); } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); + 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]; } - token2 = self2.symbols_[token2] || token2; + 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 token2; + return this; } - 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]; + 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 { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex2(); + 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"); + } } - action = table[state2] && table[state2][symbol]; + this.setNode(parent4); } - 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] + "'"); - } + 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; } - 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); + } + children(v3) { + if (isUndefined_default(v3)) { + v3 = GRAPH_NODE; } - 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._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 []; } } - return true; - } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError2(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); - } else { - throw new Error(str2); + predecessors(v3) { + var predsV = this._preds[v3]; + if (predsV) { + return keys_default(predsV); } - }, - // 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]; + } + successors(v3) { + var sucsV = this._sucs[v3]; + if (sucsV) { + return keys_default(sucsV); } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: 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++; + } + 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 { - this.yylloc.last_column++; + 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); + } } - if (this.options.ranges) { - this.yylloc.range[1]++; + __name(findParent, "findParent"); + if (this._isCompound) { + forEach_default(copy6.nodes(), function(v3) { + copy6.setParent(v3, findParent(v3)); + }); } - this._input = this._input.slice(1); - return ch; - }, - // unshifts one char (or a string) into the input - unput: 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 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]; + return copy6; + } + /* === Edge functions ========== */ + setDefaultEdgeLabel(newDefault) { + if (!isFunction_default(newDefault)) { + newDefault = constant_default6(newDefault); } - this.yyleng = this.yytext.length; + this._defaultEdgeLabelFn = newDefault; return this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - this._more = true; + } + 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; - }, - // 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; + } + /* + * 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 { - 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); + v3 = arg0; + w3 = arguments[1]; + name = arguments[3]; + if (arguments.length > 2) { + value2 = arguments[2]; + valueSpecified = true; } } - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; + v3 = "" + v3; + w3 = "" + w3; + if (!isUndefined_default(name)) { + name = "" + name; } - 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]; + var e3 = edgeArgsToId(this._isDirected, v3, w3, name); + if (has_default(this._edgeLabels, e3)) { + if (valueSpecified) { + this._edgeLabels[e3] = value2; } - return false; + return this; } - 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, 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 && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = 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 (!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--; } - if (match) { - token2 = this.test_match(match, rules[index]); - if (token2 !== false) { - return token2; + return this; + } + inEdges(v3, u2) { + var inV = this._in[v3]; + if (inV) { + var edges5 = values_default(inV); + if (!u2) { + return edges5; } - 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 filter_default3(edges5, function(edge) { + return edge.v === u2; }); } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); + } + 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; + }); } - }, - // 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]; + } + nodeEdges(v3, w3) { + var inEdges = this.inEdges(v3, w3); + if (inEdges) { + return inEdges.concat(this.outEdges(v3, w3)); } - }, - // 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; + } + }; + 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 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; } - }, - // 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"; + } + enqueue(entry) { + var sentinel = this._sentinel; + if (entry._prev && entry._next) { + unlink(entry); } - }, - // 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("open_directive"); - return 19; - case 1: - return 8; - case 2: - return 9; - case 3: - return 10; - case 4: - return 11; - case 5: - this.begin("type_directive"); - return 20; - case 6: - this.popState(); - this.begin("arg_directive"); - return 17; - case 7: - this.popState(); - this.popState(); - return 22; - case 8: - return 21; - case 9: - break; - case 10: - break; - case 11: - this.begin("acc_title"); - return 42; - case 12: - this.popState(); - return "acc_title_value"; - case 13: - this.begin("acc_descr"); - return 44; - case 14: - this.popState(); - return "acc_descr_value"; - case 15: - this.begin("acc_descr_multiline"); - break; - case 16: - this.popState(); - break; - case 17: - return "acc_descr_multiline_value"; - case 18: - return 16; - case 19: - break; - case 20: - return 23; - case 21: - return 23; - case 22: - this.begin("struct"); - return 49; - case 23: - return "EDGE_STATE"; - case 24: - return "EOF_IN_STRUCT"; - case 25: - return "OPEN_IN_STRUCT"; - case 26: - this.popState(); - return 51; - case 27: - break; - case 28: - return "MEMBER"; - case 29: - return 52; - case 30: - return 77; - case 31: - return 70; - case 32: - return 71; - case 33: - return 73; - case 34: - return 58; - case 35: - return 60; - case 36: - return 53; - case 37: - return 54; - case 38: - this.begin("generic"); - break; - case 39: - this.popState(); - break; - case 40: - return "GENERICTYPE"; - case 41: - this.begin("string"); - break; - case 42: - this.popState(); - break; - case 43: - return "STR"; - case 44: - this.begin("bqstring"); - break; - case 45: - this.popState(); - break; - case 46: - return "BQUOTE_STR"; - case 47: - this.begin("href"); - break; - case 48: - this.popState(); - break; - case 49: - return 76; - case 50: - this.begin("callback_name"); - break; - case 51: - this.popState(); - break; - case 52: - this.popState(); - this.begin("callback_args"); - break; - case 53: - return 74; - case 54: - this.popState(); - break; - case 55: - return 75; - case 56: - return 72; - case 57: - return 72; - case 58: - return 72; - case 59: - return 72; - case 60: - return 64; - case 61: - return 64; - case 62: - return 66; - case 63: - return 66; - case 64: - return 65; - case 65: - return 63; - case 66: - return 67; - case 67: - return 68; - case 68: - return 69; - case 69: - return 35; - case 70: - return 48; - case 71: - return 89; - case 72: - return "DOT"; - case 73: - return "PLUS"; - case 74: - return 86; - case 75: - return "EQUALS"; - case 76: - return "EQUALS"; - case 77: - return 93; - case 78: - return 27; - case 79: - return 29; - case 80: - return "PUNCTUATION"; - case 81: - return 92; - case 82: - return 91; - case 83: - return 88; - case 84: - return 24; + 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; } - }, - rules: [/^(?:%%\{)/, /^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:((?:(?!\}%%)[^:.])*))/, /^(?::)/, /^(?:\}%%)/, /^(?:((?:(?!\}%%).|\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)/, /^(?:[{])/, /^(?:\[\*\])/, /^(?:$)/, /^(?:[{])/, /^(?:[}])/, /^(?:[\n])/, /^(?:[^{}\n]*)/, /^(?:class\b)/, /^(?:cssClass\b)/, /^(?:callback\b)/, /^(?:link\b)/, /^(?:click\b)/, /^(?:note for\b)/, /^(?:note\b)/, /^(?:<<)/, /^(?:>>)/, /^(?:[~])/, /^(?:[~])/, /^(?:[^~]*)/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:[`])/, /^(?:[`])/, /^(?:[^`]+)/, /^(?:href[\s]+["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:call[\s]+)/, /^(?:\([\s]*\))/, /^(?:\()/, /^(?:[^(]*)/, /^(?:\))/, /^(?:[^)]*)/, /^(?:_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)/, /^(?:$)/], - conditions: { "acc_descr_multiline": { "rules": [16, 17], "inclusive": false }, "acc_descr": { "rules": [14], "inclusive": false }, "acc_title": { "rules": [12], "inclusive": false }, "arg_directive": { "rules": [7, 8], "inclusive": false }, "type_directive": { "rules": [6, 7], "inclusive": false }, "open_directive": { "rules": [5], "inclusive": false }, "callback_args": { "rules": [54, 55], "inclusive": false }, "callback_name": { "rules": [51, 52, 53], "inclusive": false }, "href": { "rules": [48, 49], "inclusive": false }, "struct": { "rules": [23, 24, 25, 26, 27, 28], "inclusive": false }, "generic": { "rules": [39, 40], "inclusive": false }, "bqstring": { "rules": [45, 46], "inclusive": false }, "string": { "rules": [42, 43], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 9, 10, 11, 13, 15, 18, 19, 20, 21, 22, 23, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 41, 44, 47, 50, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84], "inclusive": true } } + return "[" + strs.join(", ") + "]"; + } }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser() { - this.yy = {}; - } - Parser.prototype = parser2; - parser2.Parser = Parser; - return new Parser(); - }(); - parser$7.parser = parser$7; - const parser$8 = parser$7; - const MERMAID_DOM_ID_PREFIX = "classId-"; - let relations = []; - let classes$1 = {}; - let notes = []; - let classCounter = 0; - let functions = []; - const sanitizeText$2 = (txt) => common$1.sanitizeText(txt, getConfig$1()); - const parseDirective$3 = function(statement, context, type2) { - mermaidAPI.parseDirective(this, statement, context, type2); - }; - const splitClassNameAndType = function(id2) { - 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(id2, label) { - if (label) { - label = sanitizeText$2(label); - } - const { className } = splitClassNameAndType(id2); - classes$1[className].label = label; - }; - const addClass = function(id2) { - const classId = splitClassNameAndType(id2); - if (classes$1[classId.className] !== void 0) { - return; + __name(unlink, "unlink"); + __name(filterOutLinks, "filterOutLinks"); } - classes$1[classId.className] = { - id: classId.className, - type: classId.type, - label: classId.className, - cssClasses: [], - methods: [], - members: [], - annotations: [], - domId: MERMAID_DOM_ID_PREFIX + classId.className + "-" + classCounter - }; - classCounter++; - }; - const lookUpDomId = function(id2) { - if (id2 in classes$1) { - return classes$1[id2].domId; + }); + + // ../../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 []; } - throw new Error("Class not found: " + id2); - }; - const clear$4 = function() { - relations = []; - classes$1 = {}; - notes = []; - functions = []; - functions.push(setupToolTips); - clear$i(); - }; - const getClass = function(id2) { - return classes$1[id2]; - }; - const getClasses$3 = function() { - return classes$1; - }; - 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() + var state5 = buildState(g2, weightFn || DEFAULT_WEIGHT_FN); + var results = doGreedyFAS(state5.graph, state5.buckets, state5.zeroIdx); + return flatten_default( + map_default(results, function(e3) { + return g2.outEdges(e3.v, e3.w); + }) ); - relations.push(relation); - }; - const addAnnotation = function(className, annotation) { - const validatedClassName = splitClassNameAndType(className).className; - classes$1[validatedClassName].annotations.push(annotation); - }; - const addMember = function(className, member) { - const validatedClassName = splitClassNameAndType(className).className; - const theClass = classes$1[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(sanitizeText$2(memberString)); - } else if (memberString) { - theClass.members.push(sanitizeText$2(memberString)); + } + 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); + } + while (entry = sources.dequeue()) { + removeNode(g2, buckets, zeroIdx, entry); + } + 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; + } + } } } - }; - const addMembers = function(className, members) { - if (Array.isArray(members)) { - members.reverse(); - members.forEach((member) => addMember(className, member)); + return results; + } + 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); + }); + 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 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 }); + }); + 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); + }); + var buckets = range_default(maxOut + maxIn + 3).map(function() { + return new List(); + }); + var zeroIdx = maxIn + 1; + forEach_default(fasGraph.nodes(), function(v3) { + assignBucket(buckets, zeroIdx, fasGraph.node(v3)); + }); + 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); } - }; - 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); + } + 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"); } - return sanitizeText$2(label.trim()); - }; - const setCssClass$1 = function(ids, className) { - ids.split(",").forEach(function(_id) { - let id2 = _id; - if (_id[0].match(/\d/)) { - id2 = MERMAID_DOM_ID_PREFIX + id2; + }); + + // ../../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")); + }); + function weightFn(g3) { + return function(e3) { + return g3.edge(e3).weight; + }; + } + __name(weightFn, "weightFn"); + } + 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 { + dfs3(e3.w); + } + }); + delete stack[v3]; + } + __name(dfs3, "dfs"); + forEach_default(g2.nodes(), dfs3); + return fas; + } + 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); } - if (classes$1[id2] !== void 0) { - classes$1[id2].cssClasses.push(className); + }); + } + 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)); + }); + 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 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)); } }); - }; - const setTooltip = function(ids, tooltip) { - ids.split(",").forEach(function(id2) { - if (tooltip !== void 0) { - classes$1[id2].tooltip = sanitizeText$2(tooltip); + forEach_default(g2.edges(), function(e3) { + simplified.setEdge(e3, g2.edge(e3)); + }); + 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; + } + sx = h2 * dx / dy; + sy = h2; + } else { + if (dx < 0) { + w3 = -w3; } + sx = w3; + sy = w3 * dy / dx; + } + return { x: x5 + sx, y: y5 + sy }; + } + function buildLayerMatrix(g2) { + var layering = map_default(range_default(maxRank(g2) + 1), function() { + return []; }); - }; - const getTooltip = function(id2) { - return classes$1[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$1[id2] !== void 0) { - classes$1[id2].link = utils.formatUrl(linkStr, config2); - if (config2.securityLevel === "sandbox") { - classes$1[id2].linkTarget = "_top"; - } else if (typeof target === "string") { - classes$1[id2].linkTarget = sanitizeText$2(target); - } else { - classes$1[id2].linkTarget = "_blank"; - } + forEach_default(g2.nodes(), function(v3) { + var node2 = g2.node(v3); + var rank2 = node2.rank; + if (!isUndefined_default(rank2)) { + layering[rank2][node2.order] = v3; } }); - setCssClass$1(ids, "clickable"); - }; - const setClickEvent = function(ids, functionName, functionArgs) { - ids.split(",").forEach(function(id2) { - setClickFunc(id2, functionName, functionArgs); - classes$1[id2].haveCallback = true; + return layering; + } + 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; + } }); - setCssClass$1(ids, "clickable"); - }; - const setClickFunc = function(domId, functionName, functionArgs) { - const config2 = getConfig$1(); - if (config2.securityLevel !== "loose") { - return; + } + 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); + }); + 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 addBorderNode(g2, prefix, rank2, order2) { + var node2 = { + width: 0, + height: 0 + }; + if (arguments.length >= 4) { + node2.rank = rank2; + node2.order = order2; } - if (functionName === void 0) { - return; + 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; + } + }) + ); + } + 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 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"); } - const id2 = domId; - if (classes$1[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.runFunc(functionName, ...argList); - }, - false - ); + }); + + // ../../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); } - }); + } } - }; - const bindFunctions = function(element) { - functions.forEach(function(fun) { - fun(element); + __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)); }); - }; - const lineType$1 = { - LINE: 0, - DOTTED_LINE: 1 - }; - const relationType$1 = { - AGGREGATION: 0, - EXTENSION: 1, - COMPOSITION: 2, - DEPENDENCY: 3, - LOLLIPOP: 4 - }; - const setupToolTips = function(element) { - let tooltipElem = select(".mermaidTooltip"); - if ((tooltipElem._groups || tooltipElem)[0][0] === null) { - tooltipElem = select("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0); - } - const svg2 = select(element).select("svg"); - const nodes2 = svg2.selectAll("g.node"); - nodes2.on("mouseover", function() { - const el = select(this); - const title2 = el.attr("title"); - if (title2 === null) { - return; + forEach_default(g2.edges(), function(e3) { + swapWidthHeightOne(g2.edge(e3)); + }); + } + 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); } - 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 = select(this); - el.classed("hover", false); }); - }; - functions.push(setupToolTips); - let direction$1 = "TB"; - const getDirection$1 = () => direction$1; - const setDirection$1 = (dir) => { - direction$1 = dir; - }; - const db$3 = { - parseDirective: parseDirective$3, - setAccTitle, - getAccTitle, - getAccDescription, - setAccDescription, - getConfig: () => getConfig$1().class, - addClass, - bindFunctions, - clear: clear$4, - getClass, - getClasses: getClasses$3, - 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$1, - setLink, - getTooltip, - setTooltip, - lookUpDomId, - setDiagramTitle, - getDiagramTitle, - setClassLabel - }; - const getStyles$5 = (options2) => `g.classGroup text { - fill: ${options2.nodeBorder}; - fill: ${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; + function reverseYOne(attrs) { + attrs.y = -attrs.y; } + 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); + } + }); + } + 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 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); + } + 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); + } + }); + } + 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"); + } + }); -.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; -} + // ../../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 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"); + } + }); -.classLabel .label { - fill: ${options2.nodeBorder}; - font-size: 10px; -} + // ../../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 findMinSlackEdge(t4, g2) { + return minBy_default(g2.edges(), function(e3) { + if (t4.hasNode(e3.v) !== t4.hasNode(e3.w)) { + return slack(g2, e3); + } + }); + } + function shiftRanks(t4, g2, delta) { + forEach_default(t4.nodes(), function(v3) { + g2.node(v3).rank += delta; + }); + } + 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"); + } + }); -.relation { - stroke: ${options2.lineColor}; - stroke-width: 1; - fill: none; -} + // ../../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"; + } + }); -.dashed-line{ - stroke-dasharray: 3; -} + // ../../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"; + } + }); -.dotted-line{ - stroke-dasharray: 1 2; -} + // ../../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); + } + }); -#compositionStart, .composition { - fill: ${options2.lineColor} !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; -} + // ../../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(); + } + }); -#compositionEnd, .composition { - fill: ${options2.lineColor} !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; -} + // ../../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"; + } + }); -#dependencyStart, .dependency { - fill: ${options2.lineColor} !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; -} + // ../../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(); + } + }); -#dependencyStart, .dependency { - fill: ${options2.lineColor} !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; -} + // ../../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); + } + }); -#extensionStart, .extension { - fill: ${options2.mainBkg} !important; - stroke: ${options2.lineColor} !important; - stroke-width: 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); + } + } + __name(visit, "visit"); + forEach_default(g2.sinks(), visit); + if (size_default2(visited) !== g2.nodeCount()) { + throw new CycleException(); + } + return results; + } + 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(); + } + }); -#extensionEnd, .extension { - fill: ${options2.mainBkg} !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; -} + // ../../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(); + } + }); -#aggregationStart, .aggregation { - fill: ${options2.mainBkg} !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; -} + // ../../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 acc; + } + function doDfs(g2, v3, postorder3, visited, navigation, acc) { + if (!has_default(visited, v3)) { + visited[v3] = true; + if (!postorder3) { + acc.push(v3); + } + forEach_default(navigation(v3), function(w3) { + doDfs(g2, w3, postorder3, visited, navigation, acc); + }); + if (postorder3) { + acc.push(v3); + } + } + } + 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"); + } + }); -#aggregationEnd, .aggregation { - fill: ${options2.mainBkg} !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; -} + // ../../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 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"); + } + }); -#lollipopStart, .lollipop { - fill: ${options2.mainBkg} !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; -} + // ../../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"); + } + 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"); + } + }); -#lollipopEnd, .lollipop { - fill: ${options2.mainBkg} !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; -} + // ../../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(); + } + }); -.edgeTerminals { - font-size: 11px; -} + // ../../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(); + } + }); -.classTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${options2.textColor}; -} -`; - const styles$4 = getStyles$5; - let idCache$2 = {}; - const padding = 20; - const getGraphId = function(label) { - const foundEntry = Object.entries(idCache$2).find((entry) => entry[1].label === label); - if (foundEntry) { - return foundEntry[0]; + // ../../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); } - }; - 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$7 = 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 = select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("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$4.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( - "tjoho" + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation) - ); - g.setEdge( - getGraphId(relation.id1), - getGraphId(relation.id2), - { - relation - }, - relation.title || "DEFAULT" - ); + } + 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); }); - const notes2 = diagObj.db.getNotes(); - notes2.forEach(function(note2) { - log$1.debug(`Adding note: ${JSON.stringify(note2)}`); - const node2 = svgDraw$4.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 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; + } } }); - layout(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) + " )" - ); + return cutValue; + } + function initLowLimValues(tree, root4) { + if (arguments.length < 2) { + root4 = tree.nodes()[0]; + } + dfsAssignLowLim(tree, {}, 1, root4); + } + 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); } }); - 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$4.drawEdge(diagram2, g.edge(e), g.edge(e).relation, conf2, diagObj); - } + label.low = low; + label.lim = nextLim++; + if (parent4) { + label.parent = parent4; + } else { + delete label.parent; + } + return nextLim; + } + function leaveEdge(tree) { + return find_default(tree.edges(), function(e3) { + return tree.edge(e3).cutvalue < 0; }); - const svgBounds = diagram2.node().getBBox(); - const width2 = svgBounds.width + padding * 2; - const height2 = svgBounds.height + padding * 2; - configureSvgSize(diagram2, height2, width2, conf2.useMaxWidth); - const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width2} ${height2}`; - log$1.debug(`viewBox ${vBox}`); - diagram2.attr("viewBox", vBox); - }; - const renderer$6 = { - draw: draw$7 - }; - const diagram$7 = { - parser: parser$8, - db: db$3, - renderer: renderer$6, - styles: styles$4, - init: (cnf) => { - if (!cnf.class) { - cnf.class = {}; - } - cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - db$3.clear(); + } + function enterEdge(t4, g2, edge) { + var v3 = edge.v; + var w3 = edge.w; + if (!g2.hasEdge(v3, w3)) { + v3 = edge.w; + w3 = edge.v; } - }; - const classDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$7 - }, 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 addClasses = function(classes2, g, _id, diagObj) { - const keys2 = Object.keys(classes2); - log$1.info("keys:", keys2); - log$1.info(classes2); - keys2.forEach(function(id2) { - var _a, _b; - const vertex = classes2[id2]; - let cssClassStr = ""; - if (vertex.cssClasses.length > 0) { - cssClassStr = cssClassStr + " " + vertex.cssClasses.join(" "); - } - const styles2 = { labelStyle: "", style: "" }; - 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) || "", - 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: ((_a = getConfig$1().flowchart) == null ? void 0 : _a.padding) ?? ((_b = getConfig$1().class) == null ? void 0 : _b.padding) - }; - g.setNode(vertex.id, node2); - log$1.info("setNode", node2); + 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; + } + 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); }); - }; - const addNotes = function(notes2, g, startEdgeId, classes2) { - log$1.info(notes2); - notes2.forEach(function(note2, i2) { - var _a, _b; - 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: ((_a = getConfig$1().flowchart) == null ? void 0 : _a.padding) ?? ((_b = getConfig$1().class) == null ? void 0 : _b.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); + return minBy_default(candidates, function(edge2) { + return slack(g2, edge2); }); - }; - const addRelations = function(relations2, g) { - const conf2 = getConfig$1().flowchart; - let cnt2 = 0; - relations2.forEach(function(edge) { - var _a; - cnt2++; - const edgeData = { - //Set relationship style and line type - classes: "relation", - pattern: edge.relation.lineType == 1 ? "dashed" : "solid", - id: "id" + 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"; - } - } else { - edgeData.arrowheadStyle = "fill: #333"; - edgeData.labelpos = "c"; - if (((_a = getConfig$1().flowchart) == null ? void 0 : _a.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"; - } - edgeData.labelStyle = edgeData.labelStyle.replace("color:", "fill:"); - } - } - g.setEdge(edge.id1, edge.id2, edgeData, cnt2); + } + 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; }); - }; - const setConf$3 = function(cnf) { - conf$3 = { - ...conf$3, - ...cnf - }; - }; - const draw$6 = 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 {}; + 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); }); - const classes2 = diagObj.db.getClasses(); - const relations2 = diagObj.db.getRelations(); - const notes2 = diagObj.db.getNotes(); - log$1.info(relations2); - addClasses(classes2, g, id2, diagObj); - addRelations(relations2, g); - addNotes(notes2, g, relations2.length + 1, classes2); - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? ( - // @ts-ignore Ignore type error for now - select(sandboxElement.nodes()[0].contentDocument.body) - ) : select("body"); - const svg2 = root2.select(`[id="${id2}"]`); - const element = root2.select("#" + id2 + " g"); - await render( - element, - g, - ["aggregation", "extension", "composition", "dependency", "lollipop"], - "classDiagram", - id2 - ); - utils.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 isTreeEdge(tree, u2, v3) { + return tree.hasEdge(u2, v3); + } + 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"); } - }; - function getArrowMarker(type2) { - let marker; - switch (type2) { - case 0: - marker = "aggregation"; - break; - case 1: - marker = "extension"; - break; - case 2: - marker = "composition"; + }); + + // ../../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 3: - marker = "dependency"; + case "tight-tree": + tightTreeRanker(g2); break; - case 4: - marker = "lollipop"; + case "longest-path": + longestPathRanker(g2); break; default: - marker = "none"; + networkSimplexRanker(g2); } - return marker; } - const renderer$5 = { - setConf: setConf$3, - draw: draw$6 - }; - const diagram$6 = { - parser: parser$8, - db: db$3, - renderer: renderer$5, - styles: styles$4, - init: (cnf) => { - if (!cnf.class) { - cnf.class = {}; - } - cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - db$3.clear(); + function tightTreeRanker(g2) { + longestPath(g2); + feasibleTree(g2); + } + 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"); } - }; - const classDiagramV2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$6 - }, Symbol.toStringTag, { value: "Module" })); - var parser$5 = 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, 5], $V3 = [1, 7], $V4 = [2, 5], $V5 = [1, 15], $V6 = [1, 17], $V7 = [1, 21], $V8 = [1, 22], $V9 = [1, 23], $Va = [1, 24], $Vb = [1, 37], $Vc = [1, 25], $Vd = [1, 26], $Ve = [1, 27], $Vf = [1, 28], $Vg = [1, 29], $Vh = [1, 32], $Vi = [1, 33], $Vj = [1, 34], $Vk = [1, 35], $Vl = [1, 36], $Vm = [1, 39], $Vn = [1, 40], $Vo = [1, 41], $Vp = [1, 42], $Vq = [1, 38], $Vr = [1, 45], $Vs = [1, 4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60], $Vt = [1, 4, 5, 14, 15, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60], $Vu = [1, 4, 5, 7, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60], $Vv = [4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "SPACE": 4, "NL": 5, "directive": 6, "SD": 7, "document": 8, "line": 9, "statement": 10, "classDefStatement": 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, "class": 42, "CLASSENTITY_IDS": 43, "STYLECLASS": 44, "openDirective": 45, "typeDirective": 46, "closeDirective": 47, ":": 48, "argDirective": 49, "direction_tb": 50, "direction_bt": 51, "direction_rl": 52, "direction_lr": 53, "eol": 54, ";": 55, "EDGE_STATE": 56, "STYLE_SEPARATOR": 57, "left_of": 58, "right_of": 59, "open_directive": 60, "type_directive": 61, "arg_directive": 62, "close_directive": 63, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 4: "SPACE", 5: "NL", 7: "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: "class", 43: "CLASSENTITY_IDS", 44: "STYLECLASS", 48: ":", 50: "direction_tb", 51: "direction_bt", 52: "direction_rl", 53: "direction_lr", 55: ";", 56: "EDGE_STATE", 57: "STYLE_SEPARATOR", 58: "left_of", 59: "right_of", 60: "open_directive", 61: "type_directive", 62: "arg_directive", 63: "close_directive" }, - productions_: [0, [3, 2], [3, 2], [3, 2], [3, 2], [8, 0], [8, 2], [9, 2], [9, 1], [9, 1], [10, 1], [10, 1], [10, 1], [10, 2], [10, 3], [10, 4], [10, 1], [10, 2], [10, 1], [10, 4], [10, 3], [10, 6], [10, 1], [10, 1], [10, 1], [10, 1], [10, 4], [10, 4], [10, 1], [10, 1], [10, 2], [10, 2], [10, 1], [11, 3], [11, 3], [12, 3], [6, 3], [6, 5], [32, 1], [32, 1], [32, 1], [32, 1], [54, 1], [54, 1], [13, 1], [13, 1], [13, 3], [13, 3], [30, 1], [30, 1], [45, 1], [46, 1], [49, 1], [47, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 4: - yy.setRootDoc($$[$0]); - return $$[$0]; - case 5: - this.$ = []; - break; - case 6: - if ($$[$0] != "nl") { - $$[$0 - 1].push($$[$0]); - this.$ = $$[$0 - 1]; - } - break; - case 7: - case 8: - this.$ = $$[$0]; - break; - case 9: - 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 id2 = $$[$0]; - var description2 = $$[$0 - 2].trim(); - if ($$[$0].match(":")) { - var parts = $$[$0].split(":"); - id2 = parts[0]; - description2 = [description2, parts[1]]; - } - this.$ = { stmt: "state", id: id2, type: "default", description: description2 }; - 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 30: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 31: - case 32: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 33: - case 34: - this.$ = { stmt: "classDef", id: $$[$0 - 1].trim(), classes: $$[$0].trim() }; - break; - case 35: - this.$ = { stmt: "applyClass", id: $$[$0 - 1].trim(), styleClass: $$[$0].trim() }; - break; - case 38: - yy.setDirection("TB"); - this.$ = { stmt: "dir", value: "TB" }; - break; - case 39: - yy.setDirection("BT"); - this.$ = { stmt: "dir", value: "BT" }; - break; - case 40: - yy.setDirection("RL"); - this.$ = { stmt: "dir", value: "RL" }; - break; - case 41: - yy.setDirection("LR"); - this.$ = { stmt: "dir", value: "LR" }; - break; - case 44: - case 45: - this.$ = { stmt: "state", id: $$[$0].trim(), type: "default", description: "" }; - break; - case 46: - this.$ = { stmt: "state", id: $$[$0 - 2].trim(), classes: [$$[$0].trim()], type: "default", description: "" }; - break; - case 47: - this.$ = { stmt: "state", id: $$[$0 - 2].trim(), classes: [$$[$0].trim()], type: "default", description: "" }; - break; - case 50: - yy.parseDirective("%%{", "open_directive"); - break; - case 51: - yy.parseDirective($$[$0], "type_directive"); - break; - case 52: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); - yy.parseDirective($$[$0], "arg_directive"); - break; - case 53: - yy.parseDirective("}%%", "close_directive", "state"); - break; - } - }, - table: [{ 3: 1, 4: $V0, 5: $V1, 6: 4, 7: $V2, 45: 6, 60: $V3 }, { 1: [3] }, { 3: 8, 4: $V0, 5: $V1, 6: 4, 7: $V2, 45: 6, 60: $V3 }, { 3: 9, 4: $V0, 5: $V1, 6: 4, 7: $V2, 45: 6, 60: $V3 }, { 3: 10, 4: $V0, 5: $V1, 6: 4, 7: $V2, 45: 6, 60: $V3 }, o([1, 4, 5, 16, 17, 19, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60], $V4, { 8: 11 }), { 46: 12, 61: [1, 13] }, { 61: [2, 50] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3] }, { 1: [2, 4], 4: $V5, 5: $V6, 6: 30, 9: 14, 10: 16, 11: 18, 12: 19, 13: 20, 16: $V7, 17: $V8, 19: $V9, 22: $Va, 24: $Vb, 25: $Vc, 26: $Vd, 27: $Ve, 28: $Vf, 29: $Vg, 32: 31, 33: $Vh, 35: $Vi, 37: $Vj, 38: $Vk, 42: $Vl, 45: 6, 50: $Vm, 51: $Vn, 52: $Vo, 53: $Vp, 56: $Vq, 60: $V3 }, { 47: 43, 48: [1, 44], 63: $Vr }, o([48, 63], [2, 51]), o($Vs, [2, 6]), { 6: 30, 10: 46, 11: 18, 12: 19, 13: 20, 16: $V7, 17: $V8, 19: $V9, 22: $Va, 24: $Vb, 25: $Vc, 26: $Vd, 27: $Ve, 28: $Vf, 29: $Vg, 32: 31, 33: $Vh, 35: $Vi, 37: $Vj, 38: $Vk, 42: $Vl, 45: 6, 50: $Vm, 51: $Vn, 52: $Vo, 53: $Vp, 56: $Vq, 60: $V3 }, o($Vs, [2, 8]), o($Vs, [2, 9]), o($Vs, [2, 10]), o($Vs, [2, 11]), o($Vs, [2, 12], { 14: [1, 47], 15: [1, 48] }), o($Vs, [2, 16]), { 18: [1, 49] }, o($Vs, [2, 18], { 20: [1, 50] }), { 23: [1, 51] }, o($Vs, [2, 22]), o($Vs, [2, 23]), o($Vs, [2, 24]), o($Vs, [2, 25]), { 30: 52, 31: [1, 53], 58: [1, 54], 59: [1, 55] }, o($Vs, [2, 28]), o($Vs, [2, 29]), { 34: [1, 56] }, { 36: [1, 57] }, o($Vs, [2, 32]), { 39: [1, 58], 41: [1, 59] }, { 43: [1, 60] }, o($Vt, [2, 44], { 57: [1, 61] }), o($Vt, [2, 45], { 57: [1, 62] }), o($Vs, [2, 38]), o($Vs, [2, 39]), o($Vs, [2, 40]), o($Vs, [2, 41]), o($Vu, [2, 36]), { 49: 63, 62: [1, 64] }, o($Vu, [2, 53]), o($Vs, [2, 7]), o($Vs, [2, 13]), { 13: 65, 24: $Vb, 56: $Vq }, o($Vs, [2, 17]), o($Vv, $V4, { 8: 66 }), { 24: [1, 67] }, { 24: [1, 68] }, { 23: [1, 69] }, { 24: [2, 48] }, { 24: [2, 49] }, o($Vs, [2, 30]), o($Vs, [2, 31]), { 40: [1, 70] }, { 40: [1, 71] }, { 44: [1, 72] }, { 24: [1, 73] }, { 24: [1, 74] }, { 47: 75, 63: $Vr }, { 63: [2, 52] }, o($Vs, [2, 14], { 14: [1, 76] }), { 4: $V5, 5: $V6, 6: 30, 9: 14, 10: 16, 11: 18, 12: 19, 13: 20, 16: $V7, 17: $V8, 19: $V9, 21: [1, 77], 22: $Va, 24: $Vb, 25: $Vc, 26: $Vd, 27: $Ve, 28: $Vf, 29: $Vg, 32: 31, 33: $Vh, 35: $Vi, 37: $Vj, 38: $Vk, 42: $Vl, 45: 6, 50: $Vm, 51: $Vn, 52: $Vo, 53: $Vp, 56: $Vq, 60: $V3 }, o($Vs, [2, 20], { 20: [1, 78] }), { 31: [1, 79] }, { 24: [1, 80] }, o($Vs, [2, 33]), o($Vs, [2, 34]), o($Vs, [2, 35]), o($Vt, [2, 46]), o($Vt, [2, 47]), o($Vu, [2, 37]), o($Vs, [2, 15]), o($Vs, [2, 19]), o($Vv, $V4, { 8: 81 }), o($Vs, [2, 26]), o($Vs, [2, 27]), { 4: $V5, 5: $V6, 6: 30, 9: 14, 10: 16, 11: 18, 12: 19, 13: 20, 16: $V7, 17: $V8, 19: $V9, 21: [1, 82], 22: $Va, 24: $Vb, 25: $Vc, 26: $Vd, 27: $Ve, 28: $Vf, 29: $Vg, 32: 31, 33: $Vh, 35: $Vi, 37: $Vj, 38: $Vk, 42: $Vl, 45: 6, 50: $Vm, 51: $Vn, 52: $Vo, 53: $Vp, 56: $Vq, 60: $V3 }, o($Vs, [2, 21])], - defaultActions: { 7: [2, 50], 8: [2, 1], 9: [2, 2], 10: [2, 3], 54: [2, 48], 55: [2, 49], 64: [2, 52] }, - parseError: function parseError2(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; - } + }); + + // ../../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 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; + } + 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] }); + } + } + 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); + }); + } + depths[v3] = depth; + } + __name(dfs3, "dfs"); + forEach_default(g2.children(), function(v3) { + dfs3(v3, 1); + }); + return depths; + } + function sumWeights(g2) { + return reduce_default( + g2.edges(), + function(acc, e3) { + return acc + g2.edge(e3).weight; }, - 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; + 0 + ); + } + 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); + } + }); + } + 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 { - 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; + prevChild = rootPrev; + rootPrev = child; } - 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; - } + if (prevChild && prevChild !== child) { + cg.setEdge(prevChild, child); + return; } - return true; + child = parent4; } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError2(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 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; - }, - // unshifts one char (or a string) into the input - unput: 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 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, 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 && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = 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[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 - }); - } - }, - // 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: - return 41; - case 1: - return 50; - case 2: - return 51; - case 3: - return 52; - case 4: - return 53; - case 5: - this.begin("open_directive"); - return 60; - case 6: - this.begin("type_directive"); - return 61; - case 7: - this.popState(); - this.begin("arg_directive"); - return 48; - case 8: - this.popState(); - this.popState(); - return 63; - case 9: - return 62; - case 10: - break; - case 11: - break; - case 12: - return 5; - case 13: - break; - case 14: - break; - case 15: - break; - case 16: - break; - case 17: - this.pushState("SCALE"); - return 17; - case 18: - return 18; - case 19: - this.popState(); - break; - case 20: - this.begin("acc_title"); - return 33; - case 21: - this.popState(); - return "acc_title_value"; - case 22: - this.begin("acc_descr"); - return 35; - case 23: - this.popState(); - return "acc_descr_value"; - case 24: - this.begin("acc_descr_multiline"); - break; - case 25: - this.popState(); - break; - case 26: - return "acc_descr_multiline_value"; - case 27: - this.pushState("CLASSDEF"); - return 38; - case 28: - this.popState(); - this.pushState("CLASSDEFID"); - return "DEFAULT_CLASSDEF_ID"; - case 29: - this.popState(); - this.pushState("CLASSDEFID"); - return 39; - case 30: - this.popState(); - return 40; - case 31: - this.pushState("CLASS"); - return 42; - case 32: - this.popState(); - this.pushState("CLASS_STYLE"); - return 43; - case 33: - this.popState(); - return 44; - case 34: - this.pushState("SCALE"); - return 17; - case 35: - return 18; - case 36: - this.popState(); - break; - case 37: - this.pushState("STATE"); - break; - case 38: - this.popState(); - yy_.yytext = yy_.yytext.slice(0, -8).trim(); - return 25; - case 39: - this.popState(); - yy_.yytext = yy_.yytext.slice(0, -8).trim(); - return 26; - case 40: - this.popState(); - yy_.yytext = yy_.yytext.slice(0, -10).trim(); - return 27; - case 41: - this.popState(); - yy_.yytext = yy_.yytext.slice(0, -8).trim(); - return 25; - case 42: - this.popState(); - yy_.yytext = yy_.yytext.slice(0, -8).trim(); - return 26; - case 43: - this.popState(); - yy_.yytext = yy_.yytext.slice(0, -10).trim(); - return 27; - case 44: - return 50; - case 45: - return 51; - case 46: - return 52; - case 47: - return 53; - case 48: - this.pushState("STATE_STRING"); - break; - case 49: - this.pushState("STATE_ID"); - return "AS"; - case 50: - this.popState(); - return "ID"; - case 51: - this.popState(); - break; - case 52: - return "STATE_DESCR"; - case 53: - return 19; - case 54: - this.popState(); - break; - case 55: - this.popState(); - this.pushState("struct"); - return 20; - case 56: - break; - case 57: - this.popState(); - return 21; - case 58: - break; - case 59: - this.begin("NOTE"); - return 29; - case 60: - this.popState(); - this.pushState("NOTE_ID"); - return 58; - case 61: - this.popState(); - this.pushState("NOTE_ID"); - return 59; - case 62: - this.popState(); - this.pushState("FLOATING_NOTE"); - break; - case 63: - this.popState(); - this.pushState("FLOATING_NOTE_ID"); - return "AS"; - case 64: - break; - case 65: - return "NOTE_TEXT"; - case 66: - this.popState(); - return "ID"; - case 67: - this.popState(); - this.pushState("NOTE_TEXT"); - return 24; - case 68: - this.popState(); - yy_.yytext = yy_.yytext.substr(2).trim(); - return 31; - case 69: - this.popState(); - yy_.yytext = yy_.yytext.slice(0, -8).trim(); - return 31; - case 70: - return 7; - case 71: - return 7; - case 72: - return 16; - case 73: - return 56; - case 74: - return 24; - case 75: - yy_.yytext = yy_.yytext.trim(); - return 14; - case 76: - return 15; - case 77: - return 28; - case 78: - return 57; - case 79: - return 5; - case 80: - return "INVALID"; - } - }, - rules: [/^(?:default\b)/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\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": [14, 15], "inclusive": false }, "close_directive": { "rules": [14, 15], "inclusive": false }, "arg_directive": { "rules": [8, 9, 14, 15], "inclusive": false }, "type_directive": { "rules": [7, 8, 14, 15], "inclusive": false }, "open_directive": { "rules": [6, 14, 15], "inclusive": false }, "struct": { "rules": [14, 15, 27, 31, 37, 44, 45, 46, 47, 56, 57, 58, 59, 73, 74, 75, 76, 77], "inclusive": false }, "FLOATING_NOTE_ID": { "rules": [66], "inclusive": false }, "FLOATING_NOTE": { "rules": [63, 64, 65], "inclusive": false }, "NOTE_TEXT": { "rules": [68, 69], "inclusive": false }, "NOTE_ID": { "rules": [67], "inclusive": false }, "NOTE": { "rules": [60, 61, 62], "inclusive": false }, "CLASS_STYLE": { "rules": [33], "inclusive": false }, "CLASS": { "rules": [32], "inclusive": false }, "CLASSDEFID": { "rules": [30], "inclusive": false }, "CLASSDEF": { "rules": [28, 29], "inclusive": false }, "acc_descr_multiline": { "rules": [25, 26], "inclusive": false }, "acc_descr": { "rules": [23], "inclusive": false }, "acc_title": { "rules": [21], "inclusive": false }, "SCALE": { "rules": [18, 19, 35, 36], "inclusive": false }, "ALIAS": { "rules": [], "inclusive": false }, "STATE_ID": { "rules": [50], "inclusive": false }, "STATE_STRING": { "rules": [51, 52], "inclusive": false }, "FORK_STATE": { "rules": [], "inclusive": false }, "STATE": { "rules": [14, 15, 38, 39, 40, 41, 42, 43, 48, 49, 53, 54, 55], "inclusive": false }, "ID": { "rules": [14, 15], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 10, 11, 12, 13, 15, 16, 17, 20, 22, 24, 27, 31, 34, 37, 55, 59, 70, 71, 72, 73, 74, 75, 76, 78, 79, 80], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser() { - this.yy = {}; - } - Parser.prototype = parser2; - parser2.Parser = Parser; - return new Parser(); - }(); - parser$5.parser = parser$5; - const parser$6 = parser$5; - 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 = "color"; - const FILL_KEYWORD = "fill"; - const BG_FILL = "bgFill"; - const STYLECLASS_SEP = ","; - function newClassesList() { - return {}; + }); } - let direction = DEFAULT_DIAGRAM_DIRECTION; - let rootDoc = []; - let classes = 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 parseDirective$2 = function(statement, context, type2) { - mermaidAPI.parseDirective(this, statement, context, type2); - }; - 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(); + 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] + }); } } - 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 = []; - } else { - currentDoc.push(node2.doc[i2]); + }); + return result; + } + function createRootNode(g2) { + var v3; + while (g2.hasNode(v3 = uniqueId_default("_root"))) ; + return v3; + } + 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"); + } + }); + + // ../../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]); + } + 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]; } + index = index - 1 >> 1; + tree[index] += entry.weight; } - if (doc.length > 0 && currentDoc.length > 0) { - const newNode = { - stmt: STMT_STATE, - id: generateId$1(), - type: "divider", - doc: clone(currentDoc) - }; - doc.push(clone(newNode)); - node2.doc = doc; - } - node2.doc.forEach((docNode) => docTranslator(node2, docNode, true)); - } + 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 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$3(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(item.id.trim(), item.classes); - break; - case STMT_APPLYCLASS: - setCssClass(item.id.trim(), item.styleClass); - break; - } + }); + + // ../../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; }); - }; - 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; + var maxRank2 = max_default( + map_default(simpleNodes, function(v3) { + return g2.node(v3).rank; + }) + ); + var layers = map_default(range_default(maxRank2 + 1), function() { + return []; + }); + 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; + }); + forEach_default(orderedVs, dfs3); + return layers; + } + 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 + }; } + }); + } + 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"); } - if (descr) { - log$1.info("Setting state description", trimmedId, descr); - if (typeof descr === "string") { - addDescription(trimmedId, descr.trim()); + }); + + // ../../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 (typeof descr === "object") { - descr.forEach((des) => addDescription(trimmedId, des.trim())); + }); + 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]); } + }); + var sourceSet = filter_default3(mappedEntries, function(entry) { + return !entry.indegree; + }); + return doResolveConflicts(sourceSet); + } + function doResolveConflicts(sourceSet) { + var entries = []; + function handleIn(vEntry) { + return function(uEntry) { + if (uEntry.merged) { + return; + } + if (isUndefined_default(uEntry.barycenter) || isUndefined_default(vEntry.barycenter) || uEntry.barycenter >= vEntry.barycenter) { + mergeEntries(vEntry, uEntry); + } + }; } - if (note2) { - currentDocument.states[trimmedId].note = note2; - currentDocument.states[trimmedId].note.text = common$1.sanitizeText( - currentDocument.states[trimmedId].note.text, - getConfig$1() - ); + __name(handleIn, "handleIn"); + function handleOut(vEntry) { + return function(wEntry) { + wEntry["in"].push(vEntry); + if (--wEntry.indegree === 0) { + sourceSet.push(wEntry); + } + }; } - if (classes2) { - log$1.info("Setting state classes", trimmedId, classes2); - const classesList = typeof classes2 === "string" ? [classes2] : classes2; - classesList.forEach((klass) => setCssClass(trimmedId, klass.trim())); + __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)); } - if (styles2) { - log$1.info("Setting state styles", trimmedId, styles2); - const stylesList = typeof styles2 === "string" ? [styles2] : styles2; - stylesList.forEach((style) => setStyle(trimmedId, style.trim())); + return map_default( + filter_default3(entries, function(entry2) { + return !entry2.merged; + }), + function(entry2) { + return pick_default(entry2, ["vs", "i", "barycenter", "weight"]); + } + ); + } + function mergeEntries(target, source) { + var sum2 = 0; + var weight8 = 0; + if (target.weight) { + sum2 += target.barycenter * target.weight; + weight8 += target.weight; } - if (textStyles) { - log$1.info("Setting state styles", trimmedId, styles2); - const textStylesList = typeof textStyles === "string" ? [textStyles] : textStyles; - textStylesList.forEach((textStyle) => setTextStyle(trimmedId, textStyle.trim())); + if (source.weight) { + sum2 += source.barycenter * source.weight; + weight8 += source.weight; } - }; - const clear$3 = function(saveCommon) { - documents = { - root: newDoc() - }; - currentDocument = documents.root; - startEndCount = 0; - classes = newClassesList(); - if (!saveCommon) { - clear$i(); + 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; + } + 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"); } - }; - 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}`; + }); + + // ../../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 fixedId; - } - function startTypeIfNeeded(id2 = "", type2 = DEFAULT_STATE_TYPE) { - return id2 === START_NODE ? START_TYPE : type2; + return result; } - function endIdIfNeeded(id2 = "") { - let fixedId = id2; - if (id2 === END_NODE) { - startEndCount++; - fixedId = `${END_TYPE}${startEndCount}`; + function consumeUnsortable(vs, unsortable, index) { + var last3; + while (unsortable.length && (last3 = last_default(unsortable)).i <= index) { + unsortable.pop(); + vs.push(last3.vs); + index++; } - return fixedId; - } - function endTypeIfNeeded(id2 = "", type2 = DEFAULT_STATE_TYPE) { - return id2 === END_NODE ? END_TYPE : type2; + return index; } - 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()) - }); + function compareWithBias(bias) { + return function(entryV, entryW) { + if (entryV.barycenter < entryW.barycenter) { + return -1; + } else if (entryV.barycenter > entryW.barycenter) { + return 1; + } + return !bias ? entryV.i - entryW.i : entryW.i - entryV.i; + }; } - 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(); - } else { - return label.trim(); + 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"); } - }; - const getDividerId = () => { - dividerCnt++; - return "divider-id-" + dividerCnt; - }; - 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); + }); + + // ../../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; }); } - }; - const getClasses$2 = function() { - return classes; - }; - const setCssClass = 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); + 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); + } + } }); - }; - const setStyle = function(itemId, styleText) { - const item = getState(itemId); - if (item !== void 0) { - item.textStyles.push(styleText); - } - }; - const setTextStyle = function(itemId, cssClassName) { - const item = getState(itemId); - if (item !== void 0) { - item.textStyles.push(cssClassName); + 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; + } + result.barycenter = (result.barycenter * result.weight + blPred.order + brPred.order) / (result.weight + 2); + result.weight += 2; + } } - }; - const getDirection = () => direction; - const setDirection = (dir) => { - direction = dir; - }; - const trimColon = (str2) => str2 && str2[0] === ":" ? str2.substr(1).trim() : str2.trim(); - const db$2 = { - parseDirective: parseDirective$2, - getConfig: () => getConfig$1().state, - addState, - clear: clear$3, - getState, - getStates, - getRelations, - getClasses: getClasses$2, - getDirection, - addRelation, - getDividerId, - setDirection, - cleanupLabel, - lineType, - relationType, - logDocuments, - getRootDoc, - setRootDoc, - getRootDocV2, - extract, - trimColon, - getAccTitle, - setAccTitle, - getAccDescription, - setAccDescription, - addStyleClass, - setCssClass, - addDescription, - setDiagramTitle, - getDiagramTitle - }; - const getStyles$4 = (options2) => ` -defs #statediagram-barbEnd { - fill: ${options2.transitionColor}; - stroke: ${options2.transitionColor}; + return result; } -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}; -} - -g.stateGroup rect { - fill: ${options2.mainBkg}; - stroke: ${options2.nodeBorder}; -} - -g.stateGroup line { - stroke: ${options2.lineColor}; - stroke-width: 1; -} - -.transition { - stroke: ${options2.transitionColor}; - stroke-width: 1; - fill: none; -} - -.stateGroup .composit { - fill: ${options2.background}; - border-bottom: 1px -} - -.stateGroup .alt-composit { - fill: #e0e0e0; - border-bottom: 1px -} - -.state-note { - stroke: ${options2.noteBorderColor}; - fill: ${options2.noteBkgColor}; - - text { - fill: ${options2.noteTextColor}; - stroke: none; - font-size: 10px; + 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; + } + return v3; + }) + ); + }); } -} - -.stateLabel .box { - stroke: none; - stroke-width: 0; - fill: ${options2.mainBkg}; - opacity: 0.5; -} - -.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}; -} - -.stateLabel text { - fill: ${options2.stateLabelColor}; - font-size: 10px; - font-weight: bold; -} - -.node circle.state-start { - fill: ${options2.specialStateColor}; - stroke: ${options2.specialStateColor}; -} - -.node .fork-join { - fill: ${options2.specialStateColor}; - stroke: ${options2.specialStateColor}; -} - -.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}; -} - -.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"}; -} - -.statediagram-cluster .inner { - rx:0; - ry:0; -} - -.statediagram-state rect.basic { - rx: 5px; - ry: 5px; -} -.statediagram-state rect.divider { - stroke-dasharray: 10,10; - fill: ${options2.altBackground ? options2.altBackground : "#efefef"}; -} - -.note-edge { - stroke-dasharray: 5; -} - -.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; -} - -.statediagram-note text { - fill: ${options2.noteTextColor}; -} - -.statediagram-note .nodeLabel { - color: ${options2.noteTextColor}; -} -.statediagram .edgeLabel { - color: red; // ${options2.noteTextColor}; -} - -#dependencyStart, #dependencyEnd { - fill: ${options2.lineColor}; - stroke: ${options2.lineColor}; - stroke-width: 1; -} + 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; + } + } + 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"); + } + }); -.statediagramTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${options2.textColor}; -} -`; - const styles$3 = getStyles$4; - 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); + // ../../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; } - }; - 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 description2 = 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(description2, descr, isSecond); - isSecond = false; - } - isFirst = false; + } + assignOrder(g2, best); + } + function buildLayerGraphs(g2, ranks, relationship) { + return map_default(ranks, function(rank2) { + return buildLayerGraph(g2, rank2, relationship); }); - 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 = description2.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 height2 = getConfig$1().state.forkHeight; - if (stateDef.parentId) { - let tmp = width2; - width2 = height2; - height2 = tmp; - } - return g.append("rect").style("stroke", "black").style("fill", "black").attr("width", width2).attr("height", height2).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; + } + 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 assignOrder(g2, layering) { + forEach_default(layering, function(layer) { + forEach_default(layer, function(v3, i2) { + g2.node(v3).order = i2; + }); + }); + } + 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; + } + } + if (!ascending5) { + while (pathIdx < path4.length - 1 && g2.node(pathV = path4[pathIdx + 1]).minRank <= node2.rank) { + pathIdx++; + } + pathV = path4[pathIdx]; } - textHeight += tHeight; - span.attr("x", x2 + getConfig$1().state.noteMargin); - span.attr("y", y2 + textHeight + 1.25 * getConfig$1().state.noteMargin); + g2.setParent(v3, pathV); + v3 = g2.successors(v3)[0]; } + }); + } + 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 { 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); + return { path: vPath.concat(wPath.reverse()), lca }; + } + 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++ }; + } + __name(dfs3, "dfs"); + forEach_default(g2.children(), dfs3); + return result; + } + 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"); } - if (stateDef.type === "end") { - drawEndState(g); + }); + + // ../../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 layer; } - if (stateDef.type === "fork" || stateDef.type === "join") { - drawForkJoinState(g, stateDef); + __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); + } + }); + } + }); } - if (stateDef.type === "note") { - drawNote(stateDef.note.text, g); + __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; } - if (stateDef.type === "divider") { - drawDivider(g); + __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; + }); } - if (stateDef.type === "default" && stateDef.descriptions.length === 0) { - drawSimpleState(g, stateDef); + } + function addConflict(conflicts, v3, w3) { + if (v3 > w3) { + var tmp = v3; + v3 = w3; + w3 = tmp; } - if (stateDef.type === "default" && stateDef.descriptions.length > 0) { - drawDescrState(g, stateDef); + var conflictsV = conflicts[v3]; + if (!conflictsV) { + conflicts[v3] = conflictsV = {}; } - 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 = 0; - const drawEdge$1 = function(elem, path2, relation) { - const getRelationType = function(type2) { - switch (type2) { - case db$2.relationType.AGGREGATION: - return "aggregation"; - case db$2.relationType.EXTENSION: - return "extension"; - case db$2.relationType.COMPOSITION: - return "composition"; - case db$2.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).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$2.relationType.DEPENDENCY) + "End)" - ); - if (relation.title !== void 0) { - const label = elem.append("g").attr("class", "stateLabel"); - const { x: x2, y: y2 } = utils.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++; - }; - 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$5 = function(text2, id2, _version, diagObj) { - conf$2 = getConfig$1().state; - const securityLevel = getConfig$1().securityLevel; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("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 graph = new Graph({ - multigraph: true, - compound: true, - // acyclicer: 'greedy', - rankdir: "RL" - // ranksep: '20' - }); - graph.setDefaultEdgeLabel(function() { - return {}; - }); - 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 height2 = bounds2.height + padding2 * 2; - const svgWidth = width2 * 1.75; - configureSvgSize(diagram2, height2, svgWidth, conf$2.useMaxWidth); - diagram2.attr( - "viewBox", - `${bounds2.x - conf$2.padding} ${bounds2.y - conf$2.padding} ` + width2 + " " + height2 - ); - }; - 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; - } + conflictsV[w3] = true; + } + function hasConflict(conflicts, v3, w3) { + if (v3 > w3) { + var tmp = v3; + v3 = w3; + w3 = tmp; } - 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 - }); - } 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 + 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; }); - } - 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 sub = diagram2.append("g").attr("id", stateDef.id).attr("class", "stateGroup"); - node2 = renderDoc(stateDef.doc, sub, stateDef.id, !altBkg, root2, domDocument, diagObj); - { - sub = addTitleAndBox(sub, stateDef, altBkg); - let boxBounds = sub.node().getBBox(); - node2.width = boxBounds.width; - node2.height = boxBounds.height + conf$2.padding / 2; - transformationLog[stateDef.id] = { y: conf$2.compositTitleSize }; + 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]; + } + } } - } 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); + }); + }); + 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 { - graph.setNode(node2.id, node2); - graph.setNode(node2.id + "-note", note2); + visited[elem] = true; + stack.push(elem); + stack = stack.concat(nextNodesFunc(elem)); } - graph.setParent(node2.id, node2.id + "-group"); - graph.setParent(node2.id + "-note", node2.id + "-group"); - } else { - graph.setNode(node2.id, node2); + elem = stack.pop(); } } - 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(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); - }); - } else { - log$1.debug("No Node " + v + ": " + JSON.stringify(graph.node(v))); + __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); + } + __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); } + } + __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]]; }); - 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$1(diagram2, graph.edge(e), graph.edge(e).relation); - } + return xs; + } + 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; + }); }); - 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$4 = { - setConf: setConf$2, - draw: draw$5 - }; - const diagram$5 = { - parser: parser$6, - db: db$2, - renderer: renderer$4, - styles: styles$3, - init: (cnf) => { - if (!cnf.state) { - cnf.state = {}; - } - cnf.state.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - db$2.clear(); - } - }; - const stateDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$5 - }, 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$1 = function(text2, diagramObj) { - log$1.trace("Extracting classes"); - diagramObj.db.clear(); - try { - diagramObj.parser.parse(text2); - diagramObj.db.extract(diagramObj.db.getRootDocV2()); - return diagramObj.db.getClasses(); - } catch (e) { - return e; - } - }; - function getClassesFromDbInfo(dbInfoItem) { - if (dbInfoItem === void 0 || dbInfoItem === null) { - return ""; - } else { - if (dbInfoItem.classes) { - return dbInfoItem.classes.join(" "); + 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 max10 - min9; + }); + } + 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; + }); + } + }); + }); + } + function balance(xss, align) { + return mapValues_default(xss.ul, function(ignore, v3) { + if (align) { + return xss[align.toLowerCase()][v3]; } else { - return ""; + var xs = sortBy_default(map_default(xss, v3)); + return (xs[1] + xs[2]) / 2; } - } + }); } - 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}`; + 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); } - 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; + 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; + } } - if (parsedItem.type !== DEFAULT_STATE_TYPE) { - shape = parsedItem.type; + if (delta) { + sum2 += reverseSep ? delta : -delta; } - if (!nodeDb$1[itemId]) { - nodeDb$1[itemId] = { - id: itemId, - shape, - description: common$1.sanitizeText(itemId, getConfig$1()), - classes: `${classStr} ${CSS_DIAGRAM_STATE}` - }; + 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; + } } - 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 - }; - 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 - }; - 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 (delta) { + sum2 += reverseSep ? delta : -delta; } + delta = 0; + return sum2; + }; + } + 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"); } - 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); + }); + + // ../../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; + }); + } + 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"); } - }; - 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; + }); + + // ../../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; + } } }); - }; - const getDir = (parsedItem, defaultDir = DEFAULT_NESTED_DOC_DIR) => { - let dir = defaultDir; - if (parsedItem.doc) { - for (let i2 = 0; i2 < parsedItem.doc.length; i2++) { - const parsedItemDoc = parsedItem.doc[i2]; - if (parsedItemDoc.stmt === "dir") { - dir = parsedItemDoc.value; + 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; + } + }); + 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; } } - } - return dir; - }; - const draw$4 = 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 = select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); - const svg2 = root2.select(`[id="${id2}"]`); - const element = root2.select("#" + id2 + " g"); - await render(element, g, ["barb"], CSS_DIAGRAM, id2); - const padding2 = 8; - utils.insertTitle(svg2, "statediagramTitleText", conf2.titleTopMargin, diag.db.getDiagramTitle()); - const bounds2 = svg2.node().getBBox(); - const width2 = bounds2.width + padding2 * 2; - const height2 = bounds2.height + padding2 * 2; - svg2.attr("class", CSS_DIAGRAM); - const svgBounds = svg2.node().getBBox(); - configureSvgSize(svg2, height2, width2, conf2.useMaxWidth); - const vBox = `${svgBounds.x - padding2} ${svgBounds.y - padding2} ${width2} ${height2}`; - 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$3 = { - setConf: setConf$1, - getClasses: getClasses$1, - draw: draw$4 - }; - const diagram$4 = { - parser: parser$6, - db: db$2, - renderer: renderer$3, - styles: styles$3, - init: (cnf) => { - if (!cnf.state) { - cnf.state = {}; - } - cnf.state.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - db$2.clear(); - } - }; - const stateDiagramV2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$4 - }, Symbol.toStringTag, { value: "Module" })); - var parser$3 = 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, 5], $V2 = [6, 9, 11, 17, 18, 20, 22, 23, 24, 26], $V3 = [1, 15], $V4 = [1, 16], $V5 = [1, 17], $V6 = [1, 18], $V7 = [1, 19], $V8 = [1, 20], $V9 = [1, 24], $Va = [4, 6, 9, 11, 17, 18, 20, 22, 23, 24, 26]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "journey": 4, "document": 5, "EOF": 6, "directive": 7, "line": 8, "SPACE": 9, "statement": 10, "NEWLINE": 11, "openDirective": 12, "typeDirective": 13, "closeDirective": 14, ":": 15, "argDirective": 16, "title": 17, "acc_title": 18, "acc_title_value": 19, "acc_descr": 20, "acc_descr_value": 21, "acc_descr_multiline_value": 22, "section": 23, "taskName": 24, "taskData": 25, "open_directive": 26, "type_directive": 27, "arg_directive": 28, "close_directive": 29, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 4: "journey", 6: "EOF", 9: "SPACE", 11: "NEWLINE", 15: ":", 17: "title", 18: "acc_title", 19: "acc_title_value", 20: "acc_descr", 21: "acc_descr_value", 22: "acc_descr_multiline_value", 23: "section", 24: "taskName", 25: "taskData", 26: "open_directive", 27: "type_directive", 28: "arg_directive", 29: "close_directive" }, - productions_: [0, [3, 3], [3, 2], [5, 0], [5, 2], [8, 2], [8, 1], [8, 1], [8, 1], [7, 4], [7, 6], [10, 1], [10, 2], [10, 2], [10, 1], [10, 1], [10, 2], [10, 1], [12, 1], [13, 1], [16, 1], [14, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 1: - return $$[$0 - 1]; - case 3: - this.$ = []; - break; - case 4: - $$[$0 - 1].push($$[$0]); - this.$ = $$[$0 - 1]; - break; - case 5: - case 6: - this.$ = $$[$0]; - break; - case 7: - case 8: - this.$ = []; - break; - case 11: - yy.setDiagramTitle($$[$0].substr(6)); - this.$ = $$[$0].substr(6); - break; - case 12: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 13: - case 14: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 15: - yy.addSection($$[$0].substr(8)); - this.$ = $$[$0].substr(8); - break; - case 16: - yy.addTask($$[$0 - 1], $$[$0]); - this.$ = "task"; - break; - case 18: - yy.parseDirective("%%{", "open_directive"); - break; - case 19: - yy.parseDirective($$[$0], "type_directive"); - break; - case 20: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); - yy.parseDirective($$[$0], "arg_directive"); + } + 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"); + } + }); + } + 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); + } + }); + 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); + } + }); + } + 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); + } + }); + 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; + } + if (has_default(edge, "y")) { + edge.y -= minY; + } + }); + 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]; + } + edge.points.unshift(intersectRect3(nodeV, p1)); + edge.points.push(intersectRect3(nodeW, p22)); + }); + } + 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; + } + switch (edge.labelpos) { + case "l": + edge.x -= edge.width / 2 + edge.labeloffset; break; - case 21: - yy.parseDirective("}%%", "close_directive", "journey"); + case "r": + edge.x += edge.width / 2 + edge.labeloffset; break; } - }, - table: [{ 3: 1, 4: $V0, 7: 3, 12: 4, 26: $V1 }, { 1: [3] }, o($V2, [2, 3], { 5: 6 }), { 3: 7, 4: $V0, 7: 3, 12: 4, 26: $V1 }, { 13: 8, 27: [1, 9] }, { 27: [2, 18] }, { 6: [1, 10], 7: 21, 8: 11, 9: [1, 12], 10: 13, 11: [1, 14], 12: 4, 17: $V3, 18: $V4, 20: $V5, 22: $V6, 23: $V7, 24: $V8, 26: $V1 }, { 1: [2, 2] }, { 14: 22, 15: [1, 23], 29: $V9 }, o([15, 29], [2, 19]), o($V2, [2, 8], { 1: [2, 1] }), o($V2, [2, 4]), { 7: 21, 10: 25, 12: 4, 17: $V3, 18: $V4, 20: $V5, 22: $V6, 23: $V7, 24: $V8, 26: $V1 }, o($V2, [2, 6]), o($V2, [2, 7]), o($V2, [2, 11]), { 19: [1, 26] }, { 21: [1, 27] }, o($V2, [2, 14]), o($V2, [2, 15]), { 25: [1, 28] }, o($V2, [2, 17]), { 11: [1, 29] }, { 16: 30, 28: [1, 31] }, { 11: [2, 21] }, o($V2, [2, 5]), o($V2, [2, 12]), o($V2, [2, 13]), o($V2, [2, 16]), o($Va, [2, 9]), { 14: 32, 29: $V9 }, { 29: [2, 20] }, { 11: [1, 33] }, o($Va, [2, 10])], - defaultActions: { 5: [2, 18], 7: [2, 2], 24: [2, 21], 31: [2, 20] }, - parseError: function parseError2(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; + } + }); + } + function reversePointsForReversedEdges(g2) { + forEach_default(g2.edges(), function(e3) { + var edge = g2.edge(e3); + if (edge.reversed) { + edge.points.reverse(); + } + }); + } + 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; + } + }); + forEach_default(g2.nodes(), function(v3) { + if (g2.node(v3).dummy === "border") { + g2.removeNode(v3); + } + }); + } + 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); + } + }); + } + 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; + } + }); + } + function selectNumberAttrs(obj, attrs) { + return mapValues_default(pick_default(obj, attrs), Number); + } + function canonicalize(attrs) { + var newAttrs = {}; + forEach_default(attrs, function(v3, k2) { + newAttrs[k2.toLowerCase()] = v3; + }); + return newAttrs; + } + 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"); + } + }); + + // ../../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(); + } + }); + + // ../../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() }, - 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; + nodes: writeNodes(g2), + edges: writeEdges(g2) + }; + if (!isUndefined_default(g2.graph())) { + json3.value = clone_default2(g2.graph()); + } + return json3; + } + 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; + } + if (!isUndefined_default(parent4)) { + node2.parent = parent4; + } + return node2; + }); + } + 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; + } + if (!isUndefined_default(edgeValue)) { + edge.value = edgeValue; + } + return edge; + }); + } + 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((id27, ancestorId) => { + const ancestorDescendants = descendants.get(ancestorId) || []; + log.trace("In isDescendant", ancestorId, " ", id27, " = ", ancestorDescendants.includes(id27)); + return ancestorDescendants.includes(id27); + }, "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; } - 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; + if (!clusterDescendants) { + log.debug("Tilt, ", clusterId, ",not in descendants"); + return false; } - 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]; + 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 { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex2(); + 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 + ); } - 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] + "'"); + 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); } - } - 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; - } + log.debug("Removing node", node2); + graph.removeNode(node2); + }); + }, "copy"); + extractDescendants = /* @__PURE__ */ __name((id27, graph) => { + const children2 = graph.children(id27); + let res = [...children2]; + for (const child of children2) { + parents.set(child, id27); + res = [...res, ...extractDescendants(child, graph)]; } - return true; - } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError2(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); - } else { - throw new Error(str2); + return res; + }, "extractDescendants"); + findCommonEdges = /* @__PURE__ */ __name((graph, id1, id27) => { + const edges1 = graph.edges().filter((edge) => edge.v === id1 || edge.w === id1); + const edges22 = graph.edges().filter((edge) => edge.v === id27 || edge.w === id27); + const edges1Prim = edges1.map((edge) => { + return { v: edge.v === id1 ? id27 : 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((id27, graph, clusterId) => { + const children2 = graph.children(id27); + log.trace("Searching children of id ", id27, children2); + if (children2.length < 1) { + return id27; + } + 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; + } } - }, - // 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 reserve; + }, "findNonClusterChild"); + getAnchorId = /* @__PURE__ */ __name((id27) => { + if (!clusterDb.has(id27)) { + return id27; + } + if (!clusterDb.get(id27).externalConnections) { + return id27; + } + if (clusterDb.has(id27)) { + return clusterDb.get(id27).id; + } + return id27; + }, "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(id27) { + const children2 = graph.children(id27); + if (children2.length > 0) { + log.warn( + "Cluster identified", + id27, + " Replacement id in edges: ", + findNonClusterChild(id27, graph, id27) + ); + descendants.set(id27, extractDescendants(id27, graph)); + clusterDb.set(id27, { id: findNonClusterChild(id27, graph, id27), clusterData: graph.node(id27) }); } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: 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++; + }); + graph.nodes().forEach(function(id27) { + const children2 = graph.children(id27); + const edges5 = graph.edges(); + if (children2.length > 0) { + log.debug("Cluster identified", id27, descendants); + edges5.forEach((edge) => { + const d1 = isDescendant2(edge.v, id27); + const d2 = isDescendant2(edge.w, id27); + if (d1 ^ d2) { + log.warn("Edge: ", edge, " leaves cluster ", id27); + log.warn("Descendants of XXX ", id27, ": ", descendants.get(id27)); + clusterDb.get(id27).externalConnections = true; + } + }); } else { - this.yylloc.last_column++; + log.debug("Not a cluster ", id27, descendants); } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - this._input = this._input.slice(1); - return ch; - }, - // unshifts one char (or a string) into the input - unput: 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 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 (let id27 of clusterDb.keys()) { + const nonClusterChild = clusterDb.get(id27).id; + const parent4 = graph.parent(nonClusterChild); + if (parent4 !== id27 && clusterDb.has(parent4) && !clusterDb.get(parent4).externalConnections) { + clusterDb.get(id27).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)) { + 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); } - 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 + }); + 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; + } + 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 { + 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 + ); + log.debug(clusterDb); } - 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; + } + 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); } - 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]; + } + }, "extractor"); + sorter = /* @__PURE__ */ __name((graph, nodes6) => { + if (nodes6.length === 0) { + return []; + } + 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"); + } + }); + + // 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, id27, parentCluster, siteConfig2) => { + log.warn("Graph in recursive render:XAX", 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.info("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.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, + id27, + 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.trace( + "Cluster - the non recursive path XBX", + v3, + node2.id, + node2, + node2.width, + "Graph:", + graph + ); + log.trace(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, nodes6, graph.node(v3), dir2); + await insertNode2(nodes6, graph.node(v3), dir2); + } } - 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, 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 && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = 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; + }) + ); + 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); } } + }) + ); + 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, id27); + 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; } - if (match) { - token2 = this.test_match(match, rules[index]); - if (token2 !== false) { - return token2; - } - return false; + }); + 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); } - 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 + }); + log.debug("Edges:", data4Layout.edges); + data4Layout.edges.forEach((edge) => { + if (edge.start === edge.end) { + const nodeId = edge.start; + const specialId1 = nodeId + "---" + nodeId + "---1"; + const specialId2 = nodeId + "---" + nodeId + "---2"; + const node2 = graph.node(nodeId); + graph.setNode(specialId1, { + domId: specialId1, + id: specialId1, + parentId: node2.parentId, + labelStyle: "", + label: "", + padding: 0, + shape: "labelRect", + // shape: 'rect', + style: "", + width: 10, + height: 10 }); - } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; + graph.setParent(specialId1, node2.parentId); + graph.setNode(specialId2, { + domId: specialId2, + id: specialId2, + parentId: node2.parentId, + labelStyle: "", + padding: 0, + // shape: 'rect', + shape: "labelRect", + label: "", + style: "", + width: 10, + height: 10 + }); + graph.setParent(specialId2, node2.parentId); + const edge1 = structuredClone(edge); + const edgeMid = structuredClone(edge); + const edge2 = structuredClone(edge); + edge1.label = ""; + edge1.arrowTypeEnd = "none"; + edge1.id = nodeId + "-cyclic-special-1"; + edgeMid.arrowTypeEnd = "none"; + edgeMid.id = nodeId + "-cyclic-special-mid"; + edge2.label = ""; + if (node2.isGroup) { + edge1.fromCluster = nodeId; + edge2.toCluster = nodeId; + } + edge2.id = nodeId + "-cyclic-special-2"; + graph.setEdge(nodeId, specialId1, edge1, nodeId + "-cyclic-special-0"); + graph.setEdge(specialId1, specialId2, edgeMid, nodeId + "-cyclic-special-1"); + graph.setEdge(specialId2, nodeId, edge2, nodeId + "-cyc 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; + }); + log.warn("Graph at first:", JSON.stringify(write(graph))); + adjustClustersAndEdges(graph); + log.warn("Graph after XAX:", JSON.stringify(write(graph))); + const siteConfig2 = getConfig2(); + await recursiveRender( + element3, + graph, + data4Layout.type, + data4Layout.diagramId, + void 0, + siteConfig2 + ); + }, "render"); + } + }); + + // 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 loader26 of loaders) { + layoutAlgorithms[loader26.name] = loader26; + } + }, "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 (fallback in layoutAlgorithms) { + log.warn(`Layout algorithm ${algorithm} is not registered. Using ${fallback} as fallback.`); + return fallback; + } + throw new Error(`Both layout algorithms ${algorithm} and ${fallback} are not registered.`); + }, "getRegisteredLayoutAlgorithm"); + } + }); + + // 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"); + } + }); + + // 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, id27, _version, diag) { + log.info("REF0:"); + log.info("Drawing state diagram (v2)", id27); + const { securityLevel, flowchart: conf8, layout: layout6 } = getConfig2(); + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id27); + } + 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(id27, 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." + ); + } + data4Layout.direction = direction4; + data4Layout.nodeSpacing = conf8?.nodeSpacing || 50; + data4Layout.rankSpacing = conf8?.rankSpacing || 50; + data4Layout.markers = ["point", "circle", "cross"]; + data4Layout.diagramId = id27; + 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(`#${id27} [id="${vertex.id}"]`); + if (!node2 || !vertex.link) { + continue; } - }, - // 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 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); } - }, - // 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"; + const linkNode = node2.insert(function() { + return link3; + }, ":first-child"); + const shape = node2.select(".label-container"); + if (shape) { + linkNode.append(function() { + return shape.node(); + }); } - }, - // 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 26; - case 1: - this.begin("type_directive"); - return 27; - case 2: - this.popState(); - this.begin("arg_directive"); - return 15; - case 3: - this.popState(); - this.popState(); - return 29; - case 4: - return 28; - case 5: - break; - case 6: - break; - case 7: - return 11; - case 8: - break; - case 9: - break; - case 10: - return 4; - case 11: - return 17; - case 12: - this.begin("acc_title"); - return 18; - case 13: - this.popState(); - return "acc_title_value"; - case 14: - this.begin("acc_descr"); - return 20; - case 15: - this.popState(); - return "acc_descr_value"; - case 16: - this.begin("acc_descr_multiline"); - break; - case 17: - this.popState(); - break; - case 18: - return "acc_descr_multiline_value"; - case 19: - return 23; - case 20: - return 24; - case 21: - return 25; - case 22: - return 15; - case 23: - return 6; - case 24: - return "INVALID"; + const label = node2.select(".label"); + if (label) { + linkNode.append(function() { + return label.node(); + }); } - }, - rules: [/^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:%(?!\{)[^\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: { "open_directive": { "rules": [1], "inclusive": false }, "type_directive": { "rules": [2, 3], "inclusive": false }, "arg_directive": { "rules": [3, 4], "inclusive": false }, "acc_descr_multiline": { "rules": [17, 18], "inclusive": false }, "acc_descr": { "rules": [15], "inclusive": false }, "acc_title": { "rules": [13], "inclusive": false }, "INITIAL": { "rules": [0, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 19, 20, 21, 22, 23, 24], "inclusive": true } } + } + }, "draw"); + flowRenderer_v3_unified_default = { + getClasses: getClasses2, + draw: draw2 }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser() { - this.yy = {}; - } - Parser.prototype = parser2; - parser2.Parser = Parser; - return new Parser(); - }(); - parser$3.parser = parser$3; - const parser$4 = parser$3; - let currentSection$1 = ""; - const sections$1 = []; - const tasks$1 = []; - const rawTasks$1 = []; - const parseDirective$1 = function(statement, context, type2) { - mermaidAPI.parseDirective(this, statement, context, type2); - }; - const clear$2 = function() { - sections$1.length = 0; - tasks$1.length = 0; - currentSection$1 = ""; - rawTasks$1.length = 0; - clear$i(); - }; - 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); - } - }); - 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$1 = { - parseDirective: parseDirective$1, - getConfig: () => getConfig$1().journey, - clear: clear$2, - setDiagramTitle, - getDiagramTitle, - setAccTitle, - getAccTitle, - setAccDescription, - getAccDescription, - addSection: addSection$1, - getSections: getSections$1, - getTasks: getTasks$1, - addTask: addTask$1, - addTaskOrg: addTaskOrg$1, - getActors - }; - const getStyles$3 = (options2) => `.label { - 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; - } - - .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: 1.5px; - } - - .flowchart-link { - stroke: ${options2.lineColor}; - fill: none; - } - - .edgeLabel { - background-color: ${options2.edgeLabelBackground}; - rect { - opacity: 0.5; } - 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$2 = getStyles$3; - const drawRect$1 = 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$1 = function(element, faceData) { - const radius = 15; - const circleElement = element.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 = element.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(element, circleData) { - const circleElement = element.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) { - 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$1 = function(elem, txtObject) { - function genPoints(x2, y2, width2, height2, cut) { - return x2 + "," + y2 + " " + (x2 + width2) + "," + y2 + " " + (x2 + width2) + "," + (y2 + height2 - cut) + " " + (x2 + width2 - cut * 1.2) + "," + (y2 + height2) + " " + x2 + "," + (y2 + height2); - } - 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$1(); - 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$1(); - 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) { - const rectElem = drawRect$1(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$1 = function() { - return { - x: 0, - y: 0, - fill: void 0, - "text-anchor": "start", - width: 100, - height: 100, - textMargin: 0, - rx: 0, - ry: 0 - }; - }; - const getNoteRect$1 = function() { - return { - x: 0, - y: 0, - width: 100, - anchor: "start", - height: 100, - rx: 0, - ry: 0 - }; - }; - const _drawTextCandidateFunc$1 = function() { - function byText(content, g, x2, y2, width2, height2, textAttrs, colour) { - const text2 = g.append("text").attr("x", x2 + width2 / 2).attr("y", y2 + height2 / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content); - _setTextAttrs(text2, textAttrs); - } - function byTspan(content, g, x2, y2, width2, height2, textAttrs, conf2, colour) { - const { taskFontSize, taskFontFamily } = conf2; - const lines = content.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 + height2 / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"); - _setTextAttrs(text2, textAttrs); - } - } - function byFo(content, g, x2, y2, width2, height2, textAttrs, conf2) { - const body = g.append("switch"); - const f2 = body.append("foreignObject").attr("x", x2).attr("y", y2).attr("width", width2).attr("height", height2).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(content); - byTspan(content, body, x2, y2, width2, height2, 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$2 = { - drawRect: drawRect$1, - drawCircle: drawCircle$1, - drawSection: drawSection$1, - drawText: drawText$1, - drawLabel: drawLabel$1, - drawTask: drawTask$1, - drawBackgroundRect: drawBackgroundRect$1, - getTextObj: getTextObj$1, - getNoteRect: getNoteRect$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$2.drawCircle(diagram2, circleData); - const labelData = { - x: 40, - y: yPos + 7, - fill: "#666", - text: person, - textMargin: conf2.boxTextMargin | 5 - }; - svgDraw$2.drawText(diagram2, labelData); - yPos += 20; - }); - } - const conf$1 = getConfig$1().journey; - const LEFT_MARGIN = conf$1.leftMargin; - const draw$3 = function(text2, id2, version2, diagObj) { - const conf2 = getConfig$1().journey; - diagObj.db.clear(); - diagObj.parser.parse(text2 + "\n"); - const securityLevel = getConfig$1().securityLevel; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); - bounds.init(); - const diagram2 = root2.select("#" + id2); - svgDraw$2.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 height2 = box.stopy - box.starty + 2 * conf2.diagramMarginY; - const width2 = LEFT_MARGIN + box.stopx + 2 * conf2.diagramMarginX; - configureSvgSize(diagram2, height2, 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} ${height2 + extraVertForTitle}`); - diagram2.attr("preserveAspectRatio", "xMinYMin meet"); - diagram2.attr("height", height2 + 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$2.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$2.drawTask(diagram2, task, conf2); - bounds.insert(task.x, task.y, task.x + task.width + conf2.taskMargin, 300 + 5 * 30); - } - }; - const renderer$2 = { - setConf, - draw: draw$3 - }; - const diagram$3 = { - parser: parser$4, - db: db$1, - renderer: renderer$2, - styles: styles$2, - init: (cnf) => { - renderer$2.setConf(cnf.journey); - db$1.clear(); - } - }; - const journeyDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$3 - }, 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_bundledExports = {}; - var elk_bundled = { - get exports() { - return elk_bundledExports; - }, - set exports(v) { - elk_bundledExports = v; - } - }; - (function(module2, exports2) { - (function(f2) { - { - module2.exports = f2(); - } - })(function() { - return function() { - function r(e, n, t4) { - function o(i3, f2) { - if (!n[i3]) { - if (!e[i3]) { - var c2 = "function" == typeof commonjsRequire && commonjsRequire; - if (!f2 && c2) - return c2(i3, true); - if (u2) - return u2(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, t4); - } - return n[i3].exports; - } - for (var u2 = "function" == typeof commonjsRequire && commonjsRequire, i2 = 0; i2 < t4.length; i2++) - o(t4[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 + // 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 parser22 = { + 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]); } - }); - } - }, { - key: "knownLayoutAlgorithms", - value: function knownLayoutAlgorithms() { - return this.worker.postMessage({ cmd: "algorithms" }); + 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; } - }, { - key: "knownLayoutOptions", - value: function knownLayoutOptions() { - return this.worker.postMessage({ cmd: "options" }); + }, "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; } - }, { - 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); + __name(lex2, "lex"); + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state5] && table[state5][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state5]) { + 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: " + state5 + ", 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 { - resolve(res); + symbol = preErrorSymbol; + preErrorSymbol = null; } - }; - self2.worker.postMessage(msg); - }); + 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: "receive", - value: function receive(self2, answer) { - var json2 = answer.data; - var resolver = self2.resolvers[json2.id]; - if (resolver) { - delete self2.resolvers[json2.id]; - if (json2.error) { - resolver(json2.error); - } else { - resolver(null, json2.data); + 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); } } - } - }, { - key: "terminate", - value: function terminate() { - if (this.worker.terminate) { - this.worker.terminate(); + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; } - } - }, { - key: "convertGwtStyleError", - value: function convertGwtStyleError(err) { - if (!err) { - return; + 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; + } + } } - var javaException = err["__java$exception"]; - if (javaException) { - if (javaException.cause && javaException.cause.backingJsObject) { - err.cause = javaException.cause.backingJsObject; - this.convertGwtStyleError(err.cause); + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; } - delete err["__java$exception"]; + return false; } - } - }]); - return PromisedWorker2; + 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; }(); - }, {}], 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 $g() { - } - function _p() { - } - function yq() { - } - function Sq() { - } - function Es() { - } - function Jw() { - } - function Vw() { - } - function VA() { - } - function dA() { - } - function MA() { - } - function PA() { - } - function PB() { - } - function bx() { - } - function cx() { - } - function vy() { - } - function Nz() { - } - function Yz() { - } - function Ylb() { - } - function Ymb() { - } - function xmb() { - } - function Fmb() { - } - function Qmb() { - } - function gcb() { - } - function ccb() { - } - function jcb() { - } - function jtb() { - } - function otb() { - } - function qtb() { - } - function _fb() { - } - function bpb() { - } - function kpb() { - } - function ppb() { - } - function Gpb() { - } - function drb() { - } - function dzb() { - } - function fzb() { - } - function fxb() { - } - function Vxb() { - } - function Ovb() { - } - function byb() { - } - function zyb() { - } - function Zyb() { - } - function _yb() { - } - function hzb() { - } - function jzb() { - } - function lzb() { - } - function nzb() { - } - function rzb() { - } - function zzb() { - } - function Czb() { - } - function Ezb() { - } - function Gzb() { - } - function Izb() { - } - function Mzb() { - } - function bBb() { - } - function NBb() { - } - function PBb() { - } - function RBb() { - } - function iCb() { - } - function OCb() { - } - function SCb() { - } - function GDb() { - } - function JDb() { - } - function fEb() { - } - function xEb() { - } - function CEb() { - } - function GEb() { - } - function yFb() { - } - function KGb() { - } - function tIb() { - } - function vIb() { - } - function xIb() { - } - function zIb() { - } - function OIb() { - } - function SIb() { - } - function TJb() { - } - function VJb() { - } - function XJb() { - } - function XKb() { - } - function fKb() { - } - function VKb() { - } - function VLb() { - } - function jLb() { - } - function nLb() { - } - function GLb() { - } - function KLb() { - } - function MLb() { - } - function OLb() { - } - function RLb() { - } - function YLb() { - } - function bMb() { - } - function gMb() { - } - function lMb() { - } - function pMb() { - } - function wMb() { - } - function zMb() { - } - function CMb() { - } - function FMb() { - } - function LMb() { - } - function zNb() { - } - function PNb() { - } - function kOb() { - } - function pOb() { - } - function tOb() { - } - function yOb() { - } - function FOb() { - } - function GPb() { - } - function aQb() { - } - function cQb() { - } - function eQb() { + parser22.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser22; + parser22.Parser = Parser3; + return new Parser3(); + }(); + parser3.parser = parser3; + flow_default = parser3; + } + }); + + // 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}; + } + .cluster-label text { + fill: ${options3.titleColor}; + } + .cluster-label span { + color: ${options3.titleColor}; + } + .cluster-label span p { + background-color: transparent; + } + + .label text,span { + 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; + } + .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}; + } + rect { + opacity: 0.5; + background-color: ${options3.edgeLabelBackground}; + fill: ${options3.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${fade(options3.edgeLabelBackground, 0.5)}; + // background-color: + } + + .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; + } + }); + + // 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") + }; + } + }); + + // 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 parser22 = { + 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; } - function gQb() { + }, "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 iQb() { + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - function CQb() { + __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 MQb() { + __name(lex2, "lex"); + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state5] && table[state5][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state5]) { + 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: " + state5 + ", 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 OQb() { + 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; + }(); + parser22.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser22; + parser22.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"); + } + }); + + // ../../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"); + } + 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; + } + }); + + // ../../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 bytes; + } + function v35(name, version4, hashfunc) { + function generateUUID(value2, namespace, buf, offset) { + var _namespace; + if (typeof value2 === "string") { + value2 = stringToBytes(value2); + } + if (typeof namespace === "string") { + namespace = parse_default(namespace); + } + 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)"); + } + 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); + } + __name(generateUUID, "generateUUID"); + try { + generateUUID.name = name; + } catch (err) { + } + 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"); + } + }); + + // ../../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; + } + 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")); } - function ASb() { + 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 fTb() { - } - function kTb() { - } - function STb() { - } - function fUb() { - } - function DUb() { - } - function VUb() { - } - function YUb() { - } - function _Ub() { - } - function _Wb() { - } - function QWb() { - } - function XWb() { - } - function jVb() { - } - function DVb() { - } - function VVb() { - } - function $Vb() { - } - function dXb() { - } - function hXb() { - } - function lXb() { - } - function gYb() { - } - function HYb() { - } - function SYb() { - } - function VYb() { + 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 labelText = rel2.roleA.split(/
    /g); + 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"); + if (labelText.length == 1) { + labelNode.text(rel2.roleA); + } else { + const firstShift = -(labelText.length - 1) * 0.5; + labelText.forEach((txt, i2) => { + labelNode.append("tspan").attr("x", labelPoint.x).attr("dy", `${i2 === 0 ? firstShift : 1}em`).text(txt); + }); + } + 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, id27, _version, diagObj) { + conf2 = getConfig2().er; + log.info("Drawing ER diagram"); + const securityLevel = getConfig2().securityLevel; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id27); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const svg = root4.select(`[id='${id27}']`); + erMarkers_default.insertMarkers(svg, conf2); + let g2; + g2 = new Graph({ + multigraph: true, + directed: true, + compound: false + }).setGraph({ + rankdir: conf2.layoutDirection, + marginx: 20, + marginy: 20, + nodesep: 100, + edgesep: 100, + ranksep: 100 + }).setDefaultEdgeLabel(function() { + return {}; + }); + 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); + }); + 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 + }; + } + }); + + // 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; + } + } + + .relationshipLine { + stroke: ${options3.lineColor}; + } + + .entityTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${options3.textColor}; + } + #MD_PARENT_START { + fill: #f5f5f5 !important; + stroke: ${options3.lineColor} !important; + stroke-width: 1; + } + #MD_PARENT_END { + fill: #f5f5f5 !important; + stroke: ${options3.lineColor} !important; + stroke-width: 1; + } + +`, "getStyles"); + styles_default4 = getStyles4; + } + }); + + // 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 + }; + } + }); + + // ../../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 isReference(obj) { + return typeof obj === "object" && obj !== null && typeof obj.$refText === "string"; + } + 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); + } } - function dZb() { + this.allSubtypes[type3] = types; + return types; + } + } + }; + __name(isCompositeCstNode, "isCompositeCstNode"); + __name(isLeafCstNode, "isLeafCstNode"); + __name(isRootCstNode, "isRootCstNode"); + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/stream.js + function toString2(item) { + if (typeof item === "string") { + return item; + } + if (typeof item === "undefined") { + return "undefined"; + } + if (typeof item.toString === "function") { + return item.toString(); + } + return Object.prototype.toString.call(item); + } + 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; + } + if (isIterable(collection4)) { + return new StreamImpl(() => collection4[Symbol.iterator](), (iterator) => iterator.next()); + } + if (typeof collection4.length === "number") { + return new StreamImpl(() => ({ index: 0 }), (state5) => { + if (state5.index < collection4.length) { + return { done: false, value: collection4[state5.index++] }; + } else { + return DONE_RESULT; + } + }); + } + } + if (collections.length > 1) { + return new StreamImpl(() => ({ collIndex: 0, arrIndex: 0 }), (state5) => { + do { + if (state5.iterator) { + const next3 = state5.iterator.next(); + if (!next3.done) { + return next3; } - function P$b() { + state5.iterator = void 0; + } + if (state5.array) { + if (state5.arrIndex < state5.array.length) { + return { done: false, value: state5.array[state5.arrIndex++] }; } - function T$b() { + state5.array = void 0; + state5.arrIndex = 0; + } + if (state5.collIndex < collections.length) { + const collection4 = collections[state5.collIndex++]; + if (isIterable(collection4)) { + state5.iterator = collection4[Symbol.iterator](); + } else if (collection4 && typeof collection4.length === "number") { + state5.array = collection4; } - function h1b() { + } + } while (state5.iterator || state5.array || state5.collIndex < collections.length); + return DONE_RESULT; + }); + } + 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); } - function m1b() { + } 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 }), (state5) => { + let result; + if (!state5.firstDone) { + do { + result = this.nextFn(state5.first); + if (!result.done) { + return result; + } + } while (!result.done); + state5.firstDone = true; } - function q1b() { + 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); } - function u1b() { + 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; } - function y1b() { + 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; } - function C1b() { + next3 = iterator.next(); + } + return true; + } + some(predicate) { + const iterator = this.iterator(); + let next3 = iterator.next(); + while (!next3.done) { + if (predicate(next3.value)) { + return true; } - function e2b() { + 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, (state5) => { + const { done, value: value2 } = this.nextFn(state5); + if (done) { + return DONE_RESULT; + } else { + return { done: false, value: callbackfn(value2) }; } - function g2b() { + }); + } + filter(predicate) { + return new _StreamImpl(this.startFn, (state5) => { + let result; + do { + result = this.nextFn(state5); + 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); } - function m2b() { + 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; } - function q2b() { + 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; } - function u2b() { + 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; } - function S2b() { + next3 = iterator.next(); + } + return false; + } + flatMap(callbackfn) { + return new _StreamImpl(() => ({ this: this.startFn() }), (state5) => { + do { + if (state5.iterator) { + const next3 = state5.iterator.next(); + if (next3.done) { + state5.iterator = void 0; + } else { + return next3; + } + } + const { done, value: value2 } = this.nextFn(state5.this); + if (!done) { + const mapped = callbackfn(value2); + if (isIterable(mapped)) { + state5.iterator = mapped[Symbol.iterator](); + } else { + return { done: false, value: mapped }; + } + } + } while (state5.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() }), (state5) => { + do { + if (state5.iterator) { + const next3 = state5.iterator.next(); + if (next3.done) { + state5.iterator = void 0; + } else { + return next3; + } + } + const { done, value: value2 } = stream2.nextFn(state5.this); + if (!done) { + if (isIterable(value2)) { + state5.iterator = value2[Symbol.iterator](); + } else { + return { done: false, value: value2 }; + } + } + } while (state5.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 state5 = this.startFn(); + for (let i2 = 0; i2 < skipCount; i2++) { + const next3 = this.nextFn(state5); + if (next3.done) { + return state5; + } } - function U2b() { + return state5; + }, this.nextFn); + } + limit(maxSize) { + return new _StreamImpl(() => ({ size: 0, state: this.startFn() }), (state5) => { + state5.size++; + if (state5.size > maxSize) { + return DONE_RESULT; } - function W2b() { + return this.nextFn(state5.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; } - function _2b() { + }); + } + 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 + }), (state5) => { + if (state5.pruned) { + state5.iterators.pop(); + state5.pruned = false; + } + while (state5.iterators.length > 0) { + const iterator = state5.iterators[state5.iterators.length - 1]; + const next3 = iterator.next(); + if (next3.done) { + state5.iterators.pop(); + } else { + state5.iterators.push(children2(next3.value)[Symbol.iterator]()); + return next3; + } } - function e3b() { + 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 = {})); + } + }); + + // ../../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 { + return []; + } + }, { 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; + } + } + return false; + } + function tokenToRange(token2) { + return { + start: { + character: token2.startColumn - 1, + line: token2.startLine - 1 + }, + end: { + character: token2.endColumn, + line: token2.endLine - 1 + } + }; + } + function toDocumentSegment(node2) { + if (!node2) { + return void 0; + } + const { offset, end: end2, range: range3 } = node2; + return { + range: range3, + offset, + end: end2, + length: end2 - offset + }; + } + 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 { + return RangeComparison.OverlapFront; + } + } + 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 findLeafNodeAtOffset(cstNode, offset); + } + return void 0; + } + 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; + } + } + } + } + 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); + } + } + 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); + } + } + 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 { + right3 = middle - 1; + } + } + 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; + } + } + node2 = parent4; + } + 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; + } + return void 0; + } + function getStartlineNode(node2) { + if (node2.range.start.character === 0) { + return 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 { + index = selfIndex - 1; + node2 = parent4.content[index]; + } + if (node2.range.start.line !== line2) { + break; + } + last3 = node2; + } + 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 { + break; + } + } + 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"); + } + }); + + // ../../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"); + } + constructor(node2, message) { + super(node2 ? `${message} at ${node2.range.start.line}:${node2.range.start.character}` : message); + } + }; + __name(assertUnreachable, "assertUnreachable"); + } + }); + + // ../../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); + } + function isAbstractType(item) { + return reflection.isInstance(item, AbstractType); + } + function isCondition(item) { + return reflection.isInstance(item, Condition); + } + 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); + } + function isPrimitiveType(item) { + return item === "string" || item === "number" || item === "boolean" || item === "Date" || item === "bigint"; + } + function isTypeDefinition(item) { + return reflection.isInstance(item, TypeDefinition); + } + function isValueLiteral(item) { + return reflection.isInstance(item, ValueLiteral); + } + function isAbstractElement(item) { + return reflection.isInstance(item, AbstractElement); + } + function isArrayLiteral(item) { + return reflection.isInstance(item, ArrayLiteral); + } + function isArrayType(item) { + return reflection.isInstance(item, ArrayType); + } + function isBooleanLiteral(item) { + return reflection.isInstance(item, BooleanLiteral); + } + function isConjunction(item) { + return reflection.isInstance(item, Conjunction); + } + function isDisjunction(item) { + return reflection.isInstance(item, Disjunction); + } + function isGrammar(item) { + return reflection.isInstance(item, Grammar); + } + function isGrammarImport(item) { + return reflection.isInstance(item, GrammarImport); + } + function isInferredType(item) { + return reflection.isInstance(item, InferredType); + } + function isInterface(item) { + return reflection.isInstance(item, Interface); + } + function isNamedArgument(item) { + return reflection.isInstance(item, NamedArgument); + } + function isNegation(item) { + return reflection.isInstance(item, Negation); + } + 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; } - function h3b() { + } + } + 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; } - function p3b() { + case "Grammar:hiddenTokens": + case "ParserRule:hiddenTokens": + case "RuleCall:rule": { + return AbstractRule; } - function t3b() { + case "Grammar:usedGrammars": { + return Grammar; } - function w3b() { + case "NamedArgument:parameter": + case "ParameterReference:parameter": { + return Parameter; } - function y3b() { + case "TerminalRuleCall:rule": { + return TerminalRule; } - function A3b() { + default: { + throw new Error(`${referenceId} is not a valid reference id.`); } - function M3b() { + } + } + getTypeMetaData(type3) { + switch (type3) { + case "AbstractElement": { + return { + name: "AbstractElement", + properties: [ + { name: "cardinality" }, + { name: "lookahead" } + ] + }; } - function Q3b() { + case "ArrayLiteral": { + return { + name: "ArrayLiteral", + properties: [ + { name: "elements", defaultValue: [] } + ] + }; } - function U3b() { + case "ArrayType": { + return { + name: "ArrayType", + properties: [ + { name: "elementType" } + ] + }; } - function Y3b() { + case "BooleanLiteral": { + return { + name: "BooleanLiteral", + properties: [ + { name: "true", defaultValue: false } + ] + }; } - function l4b() { + case "Conjunction": { + return { + name: "Conjunction", + properties: [ + { name: "left" }, + { name: "right" } + ] + }; } - function q4b() { + case "Disjunction": { + return { + name: "Disjunction", + properties: [ + { name: "left" }, + { name: "right" } + ] + }; } - function s4b() { + 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: [] } + ] + }; } - function u4b() { + case "GrammarImport": { + return { + name: "GrammarImport", + properties: [ + { name: "path" } + ] + }; } - function w4b() { + case "InferredType": { + return { + name: "InferredType", + properties: [ + { name: "name" } + ] + }; } - function y4b() { + case "Interface": { + return { + name: "Interface", + properties: [ + { name: "attributes", defaultValue: [] }, + { name: "name" }, + { name: "superTypes", defaultValue: [] } + ] + }; } - function L4b() { + case "NamedArgument": { + return { + name: "NamedArgument", + properties: [ + { name: "calledByName", defaultValue: false }, + { name: "parameter" }, + { name: "value" } + ] + }; } - function N4b() { + case "Negation": { + return { + name: "Negation", + properties: [ + { name: "value" } + ] + }; } - function P4b() { + case "NumberLiteral": { + return { + name: "NumberLiteral", + properties: [ + { name: "value" } + ] + }; } - function R4b() { + case "Parameter": { + return { + name: "Parameter", + properties: [ + { name: "name" } + ] + }; } - function T4b() { + case "ParameterReference": { + return { + name: "ParameterReference", + properties: [ + { name: "parameter" } + ] + }; } - function X4b() { + 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 } + ] + }; } - function I5b() { + case "ReferenceType": { + return { + name: "ReferenceType", + properties: [ + { name: "referenceType" } + ] + }; } - function Q5b() { + case "ReturnType": { + return { + name: "ReturnType", + properties: [ + { name: "name" } + ] + }; } - function T5b() { + case "SimpleType": { + return { + name: "SimpleType", + properties: [ + { name: "primitiveType" }, + { name: "stringType" }, + { name: "typeRef" } + ] + }; } - function Z5b() { + case "StringLiteral": { + return { + name: "StringLiteral", + properties: [ + { name: "value" } + ] + }; } - function l6b() { + case "TerminalRule": { + return { + name: "TerminalRule", + properties: [ + { name: "definition" }, + { name: "fragment", defaultValue: false }, + { name: "hidden", defaultValue: false }, + { name: "name" }, + { name: "type" } + ] + }; } - function o6b() { + case "Type": { + return { + name: "Type", + properties: [ + { name: "name" }, + { name: "type" } + ] + }; } - function t6b() { + case "TypeAttribute": { + return { + name: "TypeAttribute", + properties: [ + { name: "defaultValue" }, + { name: "isOptional", defaultValue: false }, + { name: "name" }, + { name: "type" } + ] + }; } - function z6b() { + case "UnionType": { + return { + name: "UnionType", + properties: [ + { name: "types", defaultValue: [] } + ] + }; } - function L6b() { + case "Action": { + return { + name: "Action", + properties: [ + { name: "cardinality" }, + { name: "feature" }, + { name: "inferredType" }, + { name: "lookahead" }, + { name: "operator" }, + { name: "type" } + ] + }; } - function M6b() { + case "Alternatives": { + return { + name: "Alternatives", + properties: [ + { name: "cardinality" }, + { name: "elements", defaultValue: [] }, + { name: "lookahead" } + ] + }; } - function P6b() { + case "Assignment": { + return { + name: "Assignment", + properties: [ + { name: "cardinality" }, + { name: "feature" }, + { name: "lookahead" }, + { name: "operator" }, + { name: "terminal" } + ] + }; } - function X6b() { + case "CharacterRange": { + return { + name: "CharacterRange", + properties: [ + { name: "cardinality" }, + { name: "left" }, + { name: "lookahead" }, + { name: "right" } + ] + }; } - function $6b() { + case "CrossReference": { + return { + name: "CrossReference", + properties: [ + { name: "cardinality" }, + { name: "deprecatedSyntax", defaultValue: false }, + { name: "lookahead" }, + { name: "terminal" }, + { name: "type" } + ] + }; } - function a7b() { + case "EndOfFile": { + return { + name: "EndOfFile", + properties: [ + { name: "cardinality" }, + { name: "lookahead" } + ] + }; } - function c7b() { + case "Group": { + return { + name: "Group", + properties: [ + { name: "cardinality" }, + { name: "elements", defaultValue: [] }, + { name: "guardCondition" }, + { name: "lookahead" } + ] + }; } - function g7b() { + case "Keyword": { + return { + name: "Keyword", + properties: [ + { name: "cardinality" }, + { name: "lookahead" }, + { name: "value" } + ] + }; } - function j7b() { + case "NegatedToken": { + return { + name: "NegatedToken", + properties: [ + { name: "cardinality" }, + { name: "lookahead" }, + { name: "terminal" } + ] + }; } - function m7b() { + case "RegexToken": { + return { + name: "RegexToken", + properties: [ + { name: "cardinality" }, + { name: "lookahead" }, + { name: "regex" } + ] + }; } - function r7b() { + case "RuleCall": { + return { + name: "RuleCall", + properties: [ + { name: "arguments", defaultValue: [] }, + { name: "cardinality" }, + { name: "lookahead" }, + { name: "rule" } + ] + }; } - function x7b() { + case "TerminalAlternatives": { + return { + name: "TerminalAlternatives", + properties: [ + { name: "cardinality" }, + { name: "elements", defaultValue: [] }, + { name: "lookahead" } + ] + }; } - function D7b() { + case "TerminalGroup": { + return { + name: "TerminalGroup", + properties: [ + { name: "cardinality" }, + { name: "elements", defaultValue: [] }, + { name: "lookahead" } + ] + }; } - function D9b() { + case "TerminalRuleCall": { + return { + name: "TerminalRuleCall", + properties: [ + { name: "cardinality" }, + { name: "lookahead" }, + { name: "rule" } + ] + }; } - function b9b() { + case "UnorderedGroup": { + return { + name: "UnorderedGroup", + properties: [ + { name: "cardinality" }, + { name: "elements", defaultValue: [] }, + { name: "lookahead" } + ] + }; } - function h9b() { + case "UntilToken": { + return { + name: "UntilToken", + properties: [ + { name: "cardinality" }, + { name: "lookahead" }, + { name: "terminal" } + ] + }; } - function j9b() { + case "Wildcard": { + return { + name: "Wildcard", + properties: [ + { name: "cardinality" }, + { name: "lookahead" } + ] + }; } - function l9b() { + default: { + return { + name: type3, + properties: [] + }; } - function w9b() { + } + } + }; + 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; } - function F9b() { + }); + } else if (isAstNode(value2)) { + value2.$container = node2; + value2.$containerProperty = name; + } + } + } + } + function getContainerOfType(node2, typePredicate) { + let item = node2; + while (item) { + if (typePredicate(item)) { + return item; + } + item = item.$container; + } + return void 0; + } + function hasContainerOfType(node2, predicate) { + let item = node2; + while (item) { + if (predicate(item)) { + return true; + } + item = item.$container; + } + return false; + } + function getDocument(node2) { + const rootNode = findRootNode(node2); + const result = rootNode.$document; + if (!result) { + throw new Error("AST node has no document."); + } + return result; + } + function findRootNode(node2) { + while (node2.$container) { + node2 = node2.$container; + } + return node2; + } + 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 + }), (state5) => { + while (state5.keyIndex < state5.keys.length) { + const property2 = state5.keys[state5.keyIndex]; + if (!property2.startsWith("$")) { + const value2 = node2[property2]; + if (isAstNode(value2)) { + state5.keyIndex++; + if (isAstNodeInRange(value2, range3)) { + return { done: false, value: value2 }; } - function hac() { + } else if (Array.isArray(value2)) { + while (state5.arrayIndex < value2.length) { + const index = state5.arrayIndex++; + const element3 = value2[index]; + if (isAstNode(element3) && isAstNodeInRange(element3, range3)) { + return { done: false, value: element3 }; + } } - function jac() { + state5.arrayIndex = 0; + } + } + state5.keyIndex++; + } + return DONE_RESULT; + }); + } + function streamAllContents(root4, options3) { + if (!root4) { + throw new Error("Root node must be an AstNode."); + } + return new TreeStreamImpl(root4, (node2) => streamContents(node2, options3)); + } + 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 isAstNodeInRange(astNode, range3) { + var _a; + if (!range3) { + return true; + } + const nodeRange = (_a = astNode.$cstNode) === null || _a === void 0 ? void 0 : _a.range; + if (!nodeRange) { + return false; + } + return inRange(nodeRange, range3); + } + function streamReferences(node2) { + return new StreamImpl(() => ({ + keys: Object.keys(node2), + keyIndex: 0, + arrayIndex: 0 + }), (state5) => { + while (state5.keyIndex < state5.keys.length) { + const property2 = state5.keys[state5.keyIndex]; + if (!property2.startsWith("$")) { + const value2 = node2[property2]; + if (isReference(value2)) { + state5.keyIndex++; + return { done: false, value: { reference: value2, container: node2, property: property2 } }; + } else if (Array.isArray(value2)) { + while (state5.arrayIndex < value2.length) { + const index = state5.arrayIndex++; + const element3 = value2[index]; + if (isReference(element3)) { + return { done: false, value: { reference: element3, container: node2, property: property2, index } }; + } } - function pac() { + state5.arrayIndex = 0; + } + } + state5.keyIndex++; + } + return DONE_RESULT; + }); + } + 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); + } + }); + }); + 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); + } + } + } + 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); } - function uac() { - } - function Iac() { - } - function Kac() { - } - function Sac() { - } - function obc() { - } - function rbc() { - } - function vbc() { - } - function Fbc() { - } - function Jbc() { - } - function Xbc() { - } - function ccc() { - } - function fcc() { - } - function lcc() { - } - function occ() { - } - function tcc() { - } - function ycc() { - } - function Acc() { - } - function Ccc() { - } - function Ecc() { - } - function Gcc() { - } - function Zcc() { - } - function _cc() { - } - function bdc() { - } - function fdc() { - } - function jdc() { - } - function pdc() { - } - function sdc() { - } - function ydc() { - } - function Adc() { - } - function Cdc() { - } - function Edc() { - } - function Idc() { - } - function Ndc() { - } - function Qdc() { - } - function Sdc() { - } - function Udc() { - } - function Wdc() { - } - function Ydc() { - } - function aec() { - } - function hec() { - } - function jec() { - } - function lec() { - } - function nec() { - } - function uec() { - } - function wec() { - } - function yec() { - } - function Aec() { - } - function Fec() { - } - function Jec() { - } - function Lec() { - } - function Nec() { - } - function Rec() { - } - function Uec() { - } - function Zec() { - } - function Zfc() { - } - function lfc() { - } - function tfc() { - } - function xfc() { - } - function zfc() { - } - function Ffc() { - } - function Jfc() { - } - function Nfc() { - } - function Pfc() { - } - function Vfc() { - } - function _fc() { - } - function fgc() { - } - function jgc() { - } - function lgc() { - } - function Bgc() { - } - function ehc() { - } - function ghc() { - } - function ihc() { - } - function khc() { - } - function mhc() { - } - function ohc() { - } - function qhc() { - } - function yhc() { - } - function Ahc() { - } - function Ghc() { - } - function Ihc() { - } - function Khc() { - } - function Mhc() { - } - function Shc() { - } - function Uhc() { - } - function Whc() { - } - function dic() { - } - function dlc() { - } - function blc() { - } - function flc() { - } - function hlc() { - } - function jlc() { - } - function Glc() { - } - function Ilc() { - } - function Klc() { - } - function Mlc() { - } - function Mjc() { - } - function Qjc() { - } - function Qlc() { - } - function Ulc() { - } - function Ylc() { - } - function Lkc() { - } - function Nkc() { - } - function Pkc() { - } - function Rkc() { - } - function Xkc() { - } - function _kc() { - } - function gmc() { - } - function kmc() { - } - function zmc() { - } - function Fmc() { - } - function Wmc() { - } - function $mc() { - } - function anc() { - } - function mnc() { - } - function wnc() { - } - function Hnc() { - } - function Jnc() { - } - function Lnc() { - } - function Nnc() { - } - function Pnc() { - } - function Ync() { - } - function eoc() { - } - function Aoc() { - } - function Coc() { - } - function Eoc() { - } - function Joc() { - } - function Loc() { - } - function Zoc() { - } - function _oc() { - } - function bpc() { - } - function hpc() { - } - function kpc() { - } - function ppc() { - } - function pFc() { - } - function Ryc() { - } - function QCc() { - } - function PDc() { - } - function xGc() { - } - function HGc() { - } - function JGc() { - } - function NGc() { - } - function GIc() { - } - function iKc() { - } - function mKc() { - } - function wKc() { - } - function yKc() { - } - function AKc() { - } - function EKc() { - } - function KKc() { - } - function OKc() { - } - function QKc() { - } - function SKc() { - } - function UKc() { - } - function YKc() { - } - function aLc() { - } - function fLc() { - } - function hLc() { - } - function nLc() { - } - function pLc() { - } - function tLc() { - } - function vLc() { - } - function zLc() { - } - function BLc() { - } - function DLc() { - } - function FLc() { - } - function sMc() { - } - function JMc() { - } - function hNc() { - } - function RNc() { - } - function ZNc() { - } - function _Nc() { - } - function bOc() { - } - function dOc() { - } - function fOc() { - } - function hOc() { - } - function hRc() { - } - function jRc() { - } - function KRc() { - } - function NRc() { - } - function NQc() { - } - function LQc() { - } - function _Qc() { - } - function cPc() { - } - function iPc() { - } - function kPc() { - } - function mPc() { - } - function xPc() { - } - function zPc() { - } - function zSc() { - } - function BSc() { - } - function GSc() { - } - function ISc() { - } - function NSc() { - } - function TSc() { - } - function NTc() { - } - function NVc() { - } - function oVc() { - } - function SVc() { - } - function VVc() { - } - function XVc() { - } - function ZVc() { - } - function bWc() { - } - function bXc() { - } - function CXc() { - } - function FXc() { - } - function IXc() { - } - function MXc() { - } - function UXc() { - } - function bYc() { - } - function fYc() { - } - function oYc() { - } - function qYc() { - } - function uYc() { - } - function pZc() { - } - function G$c() { - } - function h0c() { - } - function N0c() { - } - function k1c() { - } - function I1c() { - } - function Q1c() { - } - function f2c() { - } - function i2c() { - } - function k2c() { - } - function w2c() { - } - function O2c() { - } - function S2c() { - } - function Z2c() { - } - function v3c() { - } - function x3c() { - } - function R3c() { - } - function U3c() { - } - function e4c() { - } - function w4c() { - } - function x4c() { - } - function z4c() { - } - function B4c() { - } - function D4c() { + } + 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); + } + } + function addFlag(flagObj, flagKey) { + if (flagObj[flagKey] === true) { + throw "duplicate flag " + flagKey; + } + const x5 = flagObj[flagKey]; + flagObj[flagKey] = true; + } + function ASSERT_EXISTS(obj) { + if (obj === void 0) { + throw Error("Internal Error - Should never get here!"); + } + return true; + } + function ASSERT_NEVER_REACH_HERE() { + throw Error("Internal Error - Should never get here!"); + } + 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"); + } + }); + + // ../../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") + ]; + } + }); + + // ../../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 + }; + } + 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; } - function F4c() { + } + 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) + }; + } + 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) }; + } + alternative() { + const terms = []; + const begin = this.idx; + while (this.isTerm()) { + terms.push(this.term()); + } + return { type: "Alternative", value: terms, loc: this.loc(begin) }; + } + term() { + if (this.isAssertion()) { + return this.assertion(); + } else { + return this.atom(); + } + } + 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) + }; + } + 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 "+": + range3 = { + atLeast: 1, + atMost: Infinity + }; + 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; + } + ASSERT_EXISTS(range3); + break; + } + if (isBacktracking === true && range3 === void 0) { + return void 0; + } + if (ASSERT_EXISTS(range3)) { + if (this.peekChar(0) === "?") { + this.consumeChar("?"); + range3.greedy = false; + } else { + range3.greedy = true; } - function H4c() { + range3.type = "Quantifier"; + range3.loc = this.loc(begin); + return range3; + } + } + 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 (atom2 === void 0 && this.isPatternCharacter()) { + atom2 = this.patternCharacter(); + } + if (ASSERT_EXISTS(atom2)) { + atom2.loc = this.loc(begin); + if (this.isQuantifier()) { + atom2.quantifier = this.quantifier(); } - function J4c() { + return atom2; + } + return ASSERT_NEVER_REACH_HERE(); + } + dotAll() { + this.consumeChar("."); + return { + type: "Set", + complement: true, + value: [cc("\n"), cc("\r"), cc("\u2028"), cc("\u2029")] + }; + } + 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(); + } + } + 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; + } + if (ASSERT_EXISTS(set6)) { + return { type: "Set", value: set6, complement }; + } + 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(); + } + } + group() { + let capturing = true; + this.consumeChar("("); + switch (this.peekChar(0)) { + case "?": + this.consumeChar("?"); + this.consumeChar(":"); + capturing = false; + break; + default: + this.groupIdx++; + break; + } + const value2 = this.disjunction(); + this.consumeChar(")"); + const groupAst = { + type: "Group", + capturing, + value: value2 + }; + 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) }; + } + } + 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; + } + case "(": + return this.peekChar(1) === "?" && (this.peekChar(2) === "=" || this.peekChar(2) === "!"); + default: + return false; + } + } + 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; + } + } + 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"); } - function L4c() { + hexString += hexChar; + } + 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); + } + if (this.idx >= this.input.length) { + throw Error("Unexpected end of input"); + } + 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 "Flags": + this.visitFlags(node2); + break; + case "Disjunction": + this.visitDisjunction(node2); + break; + case "Alternative": + this.visitAlternative(node2); + break; + case "StartAnchor": + this.visitStartAnchor(node2); + break; + case "EndAnchor": + this.visitEndAnchor(node2); + break; + case "WordBoundary": + this.visitWordBoundary(node2); + break; + 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; + } + 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) { + } + }; + } + }); + + // ../../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(); + } + }); + + // ../../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 + }); + } + return parts; + } catch (_a) { + return []; + } + } + 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; + } + } + 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(regex2, input) { + const partial = partialRegExp(regex2); + const match2 = input.match(partial); + return !!match2 && match2[0].length > 0; + } + function partialRegExp(regex2) { + if (typeof regex2 === "string") { + regex2 = new RegExp(regex2); + } + const re2 = regex2, source = regex2.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; } - function N4c() { + break; + case "[": + tmp = /\[(?:\\.|.)*?\]/g; + tmp.lastIndex = i2; + tmp = tmp.exec(source) || []; + appendOptional(tmp[0].length); + break; + 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); } - function P4c() { + break; + 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() + "|$)"; } - function R4c() { + break; + case ")": + ++i2; + return result; + default: + appendOptional(1); + break; + } + } + return result; + } + __name(process2, "process"); + return new RegExp(process2(), regex2.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(regex2) { + this.multiline = false; + this.regex = regex2; + 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; } - function T4c() { + } + } + visitSet(node2) { + if (!this.multiline) { + const set6 = this.regex.substring(node2.loc.begin, node2.loc.end); + const regex2 = new RegExp(set6); + this.multiline = Boolean("\n".match(regex2)); + } + 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; } - function V4c() { + } + } + visitChildren(node2) { + if (node2.type === "Group") { + const group2 = node2; + if (group2.quantifier) { + return; } - function X4c() { - } - function Z4c() { - } - function _4c() { - } - function _7c() { - } - function b5c() { - } - function d5c() { - } - function f5c() { - } - function h5c() { - } - function H5c() { - } - function Hfd() { - } - function Zfd() { - } - function Zed() { - } - function ged() { - } - function Jed() { - } - function Ned() { - } - function Red() { - } - function Ved() { - } - function bbd() { - } - function mdd() { - } - function _fd() { - } - function fgd() { - } - function kgd() { - } - function Mgd() { - } - function Ahd() { - } - function Ald() { - } - function Tld() { - } - function xkd() { - } - function rmd() { - } - function knd() { - } - function Jod() { - } - function JCd() { - } - function Bpd() { - } - function BFd() { - } - function oFd() { - } - function bqd() { - } - function bvd() { - } - function jvd() { - } - function yud() { - } - function Hxd() { - } - function EBd() { - } - function aDd() { - } - function MGd() { - } - function vHd() { - } - function RHd() { - } - function wNd() { - } - function zNd() { - } - function CNd() { - } - function KNd() { - } - function XNd() { - } - function $Nd() { - } - function HPd() { - } - function lUd() { - } - function XUd() { - } - function DWd() { - } - function GWd() { - } - function JWd() { - } - function MWd() { - } - function PWd() { - } - function SWd() { - } - function VWd() { - } - function YWd() { - } - function _Wd() { - } - function xYd() { - } - function BYd() { - } - function mZd() { - } - function EZd() { - } - function GZd() { - } - function JZd() { - } - function MZd() { - } - function PZd() { - } - function SZd() { - } - function VZd() { - } - function YZd() { - } - function _Zd() { - } - function c$d() { - } - function f$d() { + } + 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); + } + } + 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); + } + } + }); + } + 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 { + 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 { + 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 { + const action = streamAllContents(elements3[i2]).find(isAction); + if (action) { + return action; + } + } + } + } + if (isAbstractElement(parent4)) { + return getActionAtElement(parent4); + } else { + 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 (isParserRule(node2.rule.ref) && !isDataTypeRuleInternal(node2.rule.ref, visited)) { + return false; + } + } 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 { + return false; + } + } else { + return false; + } + } + 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 + }); + } + function terminalGroupToRegex(group2) { + return withCardinality(group2.elements.map((e3) => abstractElementToRegex(e3)).join(""), { + cardinality: group2.cardinality, + lookahead: group2.lookahead + }); + } + function untilTokenToRegex(until) { + return withCardinality(`${WILDCARD}*?${abstractElementToRegex(until.terminal)}`, { + cardinality: until.cardinality, + lookahead: until.lookahead + }); + } + 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(regex2, options3) { + var _a; + if (options3.wrap !== false || options3.lookahead) { + regex2 = `(${(_a = options3.lookahead) !== null && _a !== void 0 ? _a : ""}${regex2})`; + } + if (options3.cardinality) { + return `${regex2}${options3.cardinality}`; + } + return regex2; + } + 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"); + } + }); + + // ../../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 + }; + } + 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"); + } + }); + + // ../../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}`); + } + } + function PRINT_WARNING(msg) { + if (console && console.warn) { + console.warn(`Warning: ${msg}`); + } + } + 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; + } + } + function hasTokenLabel(obj) { + return isString_default(obj.LABEL) && obj.LABEL !== ""; + } + function serializeGrammar(topRules) { + return map_default(topRules, serializeProduction); + } + 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"); + } + get definition() { + return this._definition; + } + set definition(value2) { + this._definition = value2; + } + constructor(_definition) { + this._definition = _definition; + } + 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; + } + 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"); + } + } + /* 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); + } + return every_default(prod.definition, (subProd) => { + return isOptionalProd(subProd, alreadyVisited); + }); + } else { + return false; + } + } + 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 { + throw Error("non exhaustive match"); + } + } + 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"); + } + }); + + // ../../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(); + } + }); + + // ../../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"); } - function i$d() { + }); + } + walkTerminal(terminal, currRest, prevRest) { + } + walkProdRef(refProd, currRest, prevRest) { + } + 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"); + } + }); + + // ../../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); + }); + 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"); + } + }); + + // ../../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~_"; + } + }); + + // ../../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"); + } + }); + + // ../../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; + } + } + 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"); + } + }); + + // ../../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.`); + } + } 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); + } + } + return []; + } + 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; + default: + throw Error("non exhaustive match!"); + } + 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 { + const lowerChar = char2.toLowerCase(); + if (lowerChar !== char2) { + const optimizedCharIdx = charCodeToOptimizedIndex(lowerChar.charCodeAt(0)); + result[optimizedCharIdx] = optimizedCharIdx; + } + } + } + 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; + } + }); + } + function isWholeOptional(ast) { + const quantifier = ast.quantifier; + if (quantifier && quantifier.atLeast === 0) { + return true; + } + 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; + } + switch (node2.type) { + case "Lookahead": + this.visitLookahead(node2); + return; + case "NegativeLookahead": + this.visitNegativeLookahead(node2); + return; + } + super.visitChildren(node2); + } + visitCharacter(node2) { + if (includes_default(this.targetCharCodes, node2.value)) { + this.found = true; + } + } + visitSet(node2) { + if (node2.complement) { + if (findCode(node2, this.targetCharCodes) === void 0) { + this.found = true; } - function l$d() { + } else { + if (findCode(node2, this.targetCharCodes) !== void 0) { + this.found = true; } - function o$d() { + } + } + }; + __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 { + const escapedRegExpString = currPattern.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&"); + const wrappedRegExp = new RegExp(escapedRegExpString); + return options3.useSticky ? addStickyFlag(wrappedRegExp) : addStartOfInput(wrappedRegExp); + } + } else { + throw Error("non exhaustive match"); + } + }); + }); + 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"); + } + }); + 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; + } + }); + 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 { + return checkLineBreaksIssues(tokType, lineTerminatorCharCodes) === false && canMatchCharCode(lineTerminatorCharCodes, tokType.PATTERN); + } + }); + } + }); + 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] = []; + } + 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]); + }); } - function r$d() { + } 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`); } - function u$d() { - } - function x$d() { - } - function A$d() { - } - function D$d() { - } - function G$d() { - } - function J$d() { - } - function M$d() { - } - function P$d() { - } - function S$d() { - } - function V$d() { - } - function Y$d() { - } - function _$d() { - } - function c_d() { - } - function f_d() { - } - function i_d() { - } - function l_d() { - } - function o_d() { - } - function r_d() { - } - function u_d() { - } - function x_d() { - } - function A_d() { - } - function D_d() { - } - function G_d() { - } - function J_d() { + canBeOptimized = false; + } + return result; + }, []); + }); + } + 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"); + } + constructor() { + super(...arguments); + this.found = false; + } + visitEndAnchor(node2) { + this.found = true; + } + } + 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; + } + 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; + } + 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; + } + 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; + } + 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; + } + 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; + } + 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; + } + function addStartOfInput(pattern) { + const flags = pattern.ignoreCase ? "i" : ""; + return new RegExp(`^(?:${pattern.source})`, flags); + } + function addStickyFlag(pattern) { + const flags = pattern.ignoreCase ? "iy" : "y"; + return new RegExp(`${pattern.source}`, flags); + } + 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; } - function M_d() { + } else { + if (canMatchCharCode(terminatorCharCodes, tokType.PATTERN)) { + hasAnyLineBreak = true; } - function P_d() { + } + } + }); + } + 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; + } + 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; + } + 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"); + } + } + function isShortPattern(pattern) { + if (isString_default(pattern) && pattern.length === 1) { + return pattern.charCodeAt(0); + } else { + return false; + } + } + 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"); + } + } + } + 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"); + } + } + 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; } - function S_d() { + } + 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"); + } + }); + + // ../../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; + } + } + function tokenStructuredMatcherNoCategories(token2, tokType) { + return token2.tokenTypeIdx === tokType.tokenTypeIdx; + } + function augmentTokenTypes(tokenTypes) { + const tokenTypesAndParents = expandCategories(tokenTypes); + assignTokenDefaultProps(tokenTypesAndParents); + assignCategoriesMapProp(tokenTypesAndParents); + assignCategoriesTokensProp(tokenTypesAndParents); + forEach_default(tokenTypesAndParents, (tokType) => { + tokType.isParent = tokType.categoryMatches.length > 0; + }); + } + 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; + } + 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 = {}; + } + }); + } + function assignCategoriesTokensProp(tokenTypes) { + forEach_default(tokenTypes, (currTokType) => { + currTokType.categoryMatches = []; + forEach_default(currTokType.categoryMatchesMap, (val, key) => { + currTokType.categoryMatches.push(tokenIdxToClass[key].tokenTypeIdx); + }); + }); + } + function assignCategoriesMapProp(tokenTypes) { + forEach_default(tokenTypes, (currTokType) => { + singleAssignCategoriesToksMap([], currTokType); + }); + } + 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"); + } + }); + + // ../../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.`; + } + }; + } + }); + + // ../../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(); } - function V_d() { + }; + 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)); + }); } - function Y_d() { + actualDefinition.modes = actualDefinition.modes ? actualDefinition.modes : {}; + forEach_default(actualDefinition.modes, (currModeValue, currModeName) => { + actualDefinition.modes[currModeName] = reject_default(currModeValue, (currTokType) => isUndefined_default(currTokType)); + }); + 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); } - function h5d() { + 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; + } + if (hasOnlySingleMode) { + this.handleModes = noop_default2; + } + 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); + }); + }); + } + tokenize(text2, initialMode = this.defaultMode) { + if (!isEmpty_default(this.lexerDefinitionErrors)) { + const allErrMessages = map_default(this.lexerDefinitionErrors, (error3) => { + return error3.message; + }); + 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; + } } - function U6d() { + 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 { + 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; + } + } + } + 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; + } } - function U9d() { + } + 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); } - function _8d() { + } else if (config6.push !== void 0) { + push_mode.call(this, config6.push); + } + } + 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; } - function fae() { + } + } + 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; + } + } + matchWithTest(pattern, text2, offset) { + const found = pattern.test(text2); + if (found === true) { + return text2.substring(offset, pattern.lastIndex); + } + 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 { + 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 { + 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; + } + } + }; + 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; + } + }; + 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 ""; } - function hae() { + } + __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 { + ruleName = options3.topLevelRule; + } + 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; + } + } + }; + } + }); + + // ../../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(); + } + 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 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 { + this.nextProductionName = this.ruleStack.pop(); + this.nextProductionOccurrence = this.occurrenceStack.pop(); + } + } + }; + 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; + } + } + }; + 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; } - function kae() { + } else { + super.walkMany(manyProd, currRest, prevRest); + } + } + }; + 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; } - function nae() { + } else { + super.walkManySep(manySepProd, currRest, prevRest); + } + } + }; + 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; } - function qae() { + } else { + super.walkAtLeastOne(atLeastOneProd, currRest, prevRest); + } + } + }; + 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; } - function tae() { + } else { + super.walkAtLeastOneSep(atleastOneSepProd, currRest, prevRest); + } + } + }; + __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; + } + 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; + } } - function wae() { + return t4; + } + } + 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; + } + forEach_default(currTokType.categoryMatches, (currExtendingType) => { + if (!has_default(result, currExtendingType)) { + result[currExtendingType] = idx; } - function zae() { + }); + }); + 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; + } } - function Cae() { + return t4; + } + } + 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; } - function Fae() { - } - function Iae() { - } - function Lae() { - } - function Oae() { - } - function Rae() { - } - function Uae() { - } - function Xae() { - } - function $ae() { - } - function bbe() { - } - function ebe() { + } + 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; + } } - function hbe() { + } else { + 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 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; + } + return false; + } + walkOption(optionProd, currRest, prevRest) { + if (!this.checkIsTarget(optionProd, PROD_TYPE.OPTION, currRest, prevRest)) { + super.walkOption(optionProd, currRest, prevRest); + } + } + walkAtLeastOne(atLeastOneProd, currRest, prevRest) { + if (!this.checkIsTarget(atLeastOneProd, PROD_TYPE.REPETITION_MANDATORY, currRest, prevRest)) { + super.walkOption(atLeastOneProd, currRest, prevRest); + } + } + walkAtLeastOneSep(atLeastOneSepProd, currRest, prevRest) { + if (!this.checkIsTarget(atLeastOneSepProd, PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR, currRest, prevRest)) { + super.walkOption(atLeastOneSepProd, currRest, prevRest); + } + } + walkMany(manyProd, currRest, prevRest) { + if (!this.checkIsTarget(manyProd, PROD_TYPE.REPETITION, currRest, prevRest)) { + super.walkOption(manyProd, currRest, prevRest); + } + } + walkManySep(manySepProd, currRest, prevRest) { + if (!this.checkIsTarget(manySepProd, PROD_TYPE.REPETITION_WITH_SEPARATOR, currRest, prevRest)) { + super.walkOption(manySepProd, currRest, prevRest); + } + } + }; + 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"); + } + }); + + // ../../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 ""; + } + } + 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; + } + 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; + } + 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); + } + } + 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; + } + } + 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 { + message: currMessage, + type: ParserDefinitionErrorType.AMBIGUOUS_ALTS, + ruleName: rule.name, + occurrence: alternation2.idx, + alternatives: currAmbDescriptor.alts + }; + }); + 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 + }); + } + }); + 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 + }); + const topRulesTable = {}; + forEach_default(options3.rules, (rule) => { + topRulesTable[rule.name] = rule; + }); + 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"); + } + constructor(message, token2) { + super(message); + this.token = token2; + this.resyncedTokens = []; + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + } + }; + MismatchedTokenException = class extends RecognitionException { + static { + __name(this, "MismatchedTokenException"); + } + 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; + } + } + 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); } - function kbe() { + } + this.importLexerState(savedLexerState); + } + shouldInRepetitionRecoveryBeTried(expectTokAfterLastMatch, nextTokIdx, notStuck) { + if (notStuck === false) { + return false; + } + if (this.tokenMatcher(this.LA(1), expectTokAfterLastMatch)) { + return false; + } + if (this.isBackTracking()) { + return false; + } + if (this.canPerformInRuleRecovery(expectTokAfterLastMatch, this.getFollowsForInRuleRecovery(expectTokAfterLastMatch, nextTokIdx))) { + return false; + } + return true; + } + // 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; + } + if (this.canRecoverWithSingleTokenDeletion(expectedTokType)) { + const nextTok = this.SKIP_TOKEN(); + this.consumeToken(); + return nextTok; + } + 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 (isEmpty_default(follows)) { + return false; + } + 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; + } + 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; + }); + if (foundMatch !== void 0) { + return foundMatch; } - function nbe() { + nextToken = this.LA(k2); + k2++; + } + } + getCurrFollowKey() { + if (this.RULE_STACK.length === 1) { + return EOF_FOLLOW_KEY; + } + const currRuleShortName = this.getLastExplicitRuleShortName(); + const currRuleIdx = this.getLastExplicitRuleOccurrenceIndex(); + const prevRuleShortName = this.getPreviousExplicitRuleShortName(); + return { + ruleName: this.shortRuleNameToFullName(currRuleShortName), + idxInCallingRule: currRuleIdx, + inRule: this.shortRuleNameToFullName(prevRuleShortName) + }; + } + 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; } - function qbe() { + 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; + } + 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)); + }); + }); + }); + } + 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 { + 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}"`); } - function tbe() { + } + } + 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 { + loc.startOffset = NaN; + loc.startLine = NaN; + loc.startColumn = NaN; + } + } + cstPostRuleOnlyOffset(ruleCstNode) { + const prevToken = this.LA(0); + const loc = ruleCstNode.location; + if (loc.startOffset <= prevToken.startOffset === true) { + loc.endOffset = prevToken.endOffset; + } else { + loc.startOffset = NaN; + } + } + 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; + } + 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; + } + 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]; + } + }; + } + }); + + // ../../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; + } + } + // 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]; + } + } + 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(); + } + }; + } + }); + + // ../../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"); + } + ACTION(impl2) { + return impl2.call(this); + } + 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); + } + 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(); } - function wbe() { - } - function zbe() { - } - function Cbe() { - } - function Fbe() { - } - function Ibe() { + }; + } + // 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 { + 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(); + } + }, "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 { + throw recogError; } - function Lbe() { + } 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"); } - function Obe() { + } else { + action = actionORMethodDef; + } + if (lookAheadFunc.call(this) === true) { + return action.call(this); + } + return void 0; + } + 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"); } - function Rbe() { + } else { + action = actionORMethodDef; + } + if (lookAheadFunc.call(this) === true) { + let notStuck = this.doSingleRepetition(action); + while (lookAheadFunc.call(this) === true && notStuck === true) { + notStuck = this.doSingleRepetition(action); } - function Ube() { + } else { + 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); + } + } + 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"); } - function Xbe() { + } else { + 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)); + } + } + 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); + } + } + 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; + } + 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); } - function $be() { + } catch (eFromConsumption) { + consumedToken = this.consumeInternalRecovery(tokType, idx, eFromConsumption); + } + 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 { + msg = this.errorMessageProvider.buildMismatchTokenMessage({ + expected: tokType, + actual: nextToken, + previous: previousToken, + ruleName: this.getCurrRuleFullName() + }); + } + 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; + } } - function bce() { + } else { + throw eFromConsumption; + } + } + 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 { + 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.`); + } + 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); + }; } - function ece() { + 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; + } } - function hce() { + throw originalError; + } + } + // 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 { + this.traceInitMaxIdent = 0; + this.traceInitPerf = DEFAULT_PARSER_CONFIG.traceInitPerf; + } + 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}>`); } - function kce() { + 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`); } - function nce() { + this.traceInitIndent--; + return value2; + } else { + return phaseImpl(); + } + } + }; + } + }); + + // ../../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; + } + 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"); + } + }); + + // ../../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)); + }); } - function qce() { + 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")}`); } - function tce() { + }); + } + 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); + } + }; + } + }); + + // ../../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(); + } + }); + + // ../../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"; + } + }); + + // ../../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(); + } + }); + + // ../../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(); + } + }); + + // ../../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(); + } + }); + + // ../../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); + } + 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); + } + } + 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); + } + } + 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); + } + 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); + } + 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, state5) { + atn.decisionStates.push(state5); + state5.decision = atn.decisionStates.length - 1; + return state5.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); + } + } + 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 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 + }; + } + 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(state5, transition2) { + if (state5.transitions.length === 0) { + state5.epsilonOnlyTransitions = transition2.isEpsilon(); + } + state5.transitions.push(transition2); + } + function removeState(atn, state5) { + atn.states.splice(atn.states.indexOf(state5), 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; + } + }; + 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"); + } + }); + + // ../../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"); + } + }); + + // ../../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; } - function wce() { + } else { + fullSet.add(index); + altSet.add(index); + } + } + } + } + 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 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 + }; + } + function getExistingTargetState(state5, token2) { + return state5.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 (c3.state.type === ATN_RULE_STOP) { + skippedStopStates.push(c3); + continue; + } + 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 + }); + } + } + } + let reach; + if (skippedStopStates.length === 0 && intermediate.size === 1) { + reach = intermediate; + } + if (reach === void 0) { + reach = new ATNConfigSet(); + for (const c3 of intermediate.elements) { + closure(c3, reach); + } + } + 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; + } + 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, state5) { + if (state5 === DFA_ERROR) { + return state5; + } + const mapKey = state5.configs.key; + const existing = dfa.states[mapKey]; + if (existing !== void 0) { + return existing; + } + state5.configs.finalize(); + dfa.states[mapKey] = state5; + return state5; + } + 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; + } + if (!p3.epsilonOnlyTransitions) { + configs.add(config6); + } + 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); + } + } + } + function getEpsilonTarget(config6, transition2) { + if (transition2 instanceof EpsilonTransition) { + return { + 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 + }; + } + return void 0; + } + function hasConfigInRuleStopState(configs) { + for (const c3 of configs.elements) { + if (c3.state.type === ATN_RULE_STOP) { + return true; + } + } + return false; + } + function allConfigsInRuleStopStates(configs) { + for (const c3 of configs.elements) { + if (c3.state.type !== ATN_RULE_STOP) { + return false; + } + } + return true; + } + function hasConflictTerminatingPrediction(configs) { + if (allConfigsInRuleStopStates(configs)) { + return true; + } + 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; + } + return configToAlts; + } + function hasConflictingAltSet(altSets) { + for (const value2 of Array.from(altSets.values())) { + if (Object.keys(value2).length > 1) { + return true; + } + } + return false; + } + function hasStateAssociatedWithOneAlt(altSets) { + for (const value2 of Array.from(altSets.values())) { + if (Object.keys(value2).length === 1) { + return true; + } + } + return false; + } + 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; + } + }; + EMPTY_PREDICATES = new PredicateSet(); + LLStarLookaheadStrategy = class extends LLkLookaheadStrategy { + static { + __name(this, "LLStarLookaheadStrategy"); + } + 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 []; + } + 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]; + }; } - function zce() { + } 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; + }; } - function Cce() { + } + return function() { + const result = adaptivePredict.call(this, dfas, decisionIndex, EMPTY_PREDICATES, logging); + return typeof result === "object" ? false : result === 0; + }; + } + }; + __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_lib2 = __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 { + 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 (Is.defined(endCharacter)) { + result.endCharacter = endCharacter; + } + if (Is.defined(kind)) { + result.kind = kind; + } + if (Is.defined(collapsedText)) { + result.collapsedText = collapsedText; + } + return result; + } + __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; + } + 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 (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"); + 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); } - function Fce() { + })); + } + __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 { + result.parameters = []; + } + 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; + } + 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 (containerName) { + result.containerName = containerName; + } + 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 { + result.edit = kindOrCommandOrEdit; + } + if (checkKind && kind !== void 0) { + result.kind = kind; + } + 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; + } + 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; + } + 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++]; } - function Ice() { - } - function Lce() { - } - function Oce() { - } - function Rce() { - } - function Uce() { - } - function Xce() { - } - function ude() { - } - function Vge() { - } - function dhe() { - } - function ol() { - wb(); - } - function oPb() { - nPb(); - } - function EPb() { - CPb(); - } - function gFb() { - fFb(); - } - function TRb() { - SRb(); - } - function ySb() { - wSb(); - } - function PSb() { - OSb(); - } - function dTb() { - bTb(); - } - function i4b() { - b4b(); - } - function D2b() { - x2b(); - } - function J6b() { - D6b(); - } - function u9b() { - q9b(); - } - function $9b() { - I9b(); - } - function Umc() { - Imc(); - } - function abc() { - Vac(); - } - function ZCc() { - VCc(); - } - function kCc() { - hCc(); - } - function rCc() { - oCc(); - } - function Tcc() { - Occ(); - } - function xkc() { - gkc(); - } - function xDc() { - rDc(); - } - function iDc() { - cDc(); - } - function kwc() { - jwc(); - } - function tJc() { - jJc(); - } - function dJc() { - aJc(); - } - function Pyc() { - Nyc(); - } - function VBc() { - SBc(); - } - function CFc() { - yFc(); - } - function CUc() { - wUc(); - } - function lUc() { - fUc(); - } - function sUc() { - pUc(); - } - function IUc() { - GUc(); - } - function IWc() { - HWc(); - } - function _Wc() { - ZWc(); - } - function fHc() { - dHc(); - } - function f0c() { - d0c(); - } - function B0c() { - A0c(); - } - function L0c() { - J0c(); - } - function LTc() { - JTc(); - } - function sTc() { - rTc(); - } - function KLc() { - ILc(); + } + 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++; + } } - function wNc() { - tNc(); + if (isLineStart && text2.length > 0) { + lineOffsets.push(text2.length); } - function PYc() { - OYc(); + this._lineOffsets = lineOffsets; + } + 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; } - function nZc() { - lZc(); + } + 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; + } + 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; } - function q3c() { - p3c(); + } + 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 { start: Position.create(0, 0), end: Position.create(0, 0) }; + } + } + get firstNonHiddenNode() { + for (const child of this.content) { + if (!child.hidden) { + return child; } - function Z7c() { - X7c(); + } + 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; } - function Z9c() { - Y9c(); + } + 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_lib2(); + 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 = ""; + } } - function _ad() { - Zad(); + let result; + try { + result = implementation(args); + } catch (err) { + result = void 0; } - function kdd() { - idd(); + if (!this.isRecording() && result === void 0) { + result = this.construct(); } - function $md() { - Smd(); + 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 { + assignMandatoryProperties(this.astReflection, obj); + } + 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 { + item = value2; + } + switch (operator) { + case "=": { + obj[feature] = item; + break; } - function HGd() { - tGd(); + case "?=": { + obj[feature] = true; + break; } - function hLd() { - NKd(); + case "+=": { + if (!Array.isArray(obj[feature])) { + obj[feature] = []; + } + obj[feature].push(item); } - function J6d() { - Uge(); + } + } + 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; } - function Mvb(a) { - uCb(a); + } + return target; + } + get definitionErrors() { + return this.wrapper.definitionErrors; + } + }; + 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); } - function Yb(a) { - this.a = a; + }; + } + 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); } - function cc(a) { - this.a = a; + } + } + 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); + } + }; + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/parser-builder-base.js + function createParser(grammar, parser22, tokens2) { + const rules = /* @__PURE__ */ new Map(); + const parserContext = { + parser: parser22, + tokens: tokens2, + rules, + ruleNames: /* @__PURE__ */ new Map() + }; + buildRules(parserContext, grammar); + return parser22; + } + 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); + } + } + 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; + }; + } + 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; + })); + } + } + 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 parser22 = ctx.parser; + alt.ALT = () => { + method.ALT(args); + if (!parser22.isRecording()) { + const key = idFunc(orIdx, parser22); + if (!parser22.unorderedGroups.get(key)) { + parser22.unorderedGroups.set(key, []); + } + const groupState = parser22.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 = parser22.unorderedGroups.get(idFunc(orIdx, parser22)); + 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)); + } + }; + } + function buildGroup4(ctx, group2) { + const methods = group2.elements.map((e3) => buildElement(ctx, e3)); + return (args) => methods.forEach((method) => method(args)); + } + function getGuardCondition(element3) { + if (isGroup(element3)) { + return element3.guardCondition; + } + return void 0; + } + 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"); + } + } + 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); + } + 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 { + return method; + } + } + 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 { + return (args) => ctx.parser.atLeastOne(idx, { + DEF: /* @__PURE__ */ __name(() => method(args), "DEF") + }); + } + } 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 { + assertUnreachable(cardinality); + } + } + 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 parser22 = new LangiumCompletionParser(services); + createParser(grammar, parser22, lexer2.definition); + parser22.finalize(); + return parser22; + } + 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 parser22 = prepareLangiumParser(services); + parser22.finalize(); + return parser22; + } + function prepareLangiumParser(services) { + const grammar = services.Grammar; + const lexer2 = services.parser.Lexer; + const parser22 = new LangiumParser(services); + return createParser(grammar, parser22, 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); } - function cj(a) { - this.a = a; + }); + return tokens2; + } + buildTerminalTokens(rules) { + return rules.filter(isTerminalRule).filter((e3) => !e3.fragment).map((terminal) => this.buildTerminalToken(terminal)).toArray(); + } + buildTerminalToken(terminal) { + const regex2 = terminalRegex(terminal); + const pattern = this.requiresCustomPattern(regex2) ? this.regexPatternFunction(regex2) : regex2; + const tokenType = { + name: terminal.name, + PATTERN: pattern, + LINE_BREAKS: true + }; + if (terminal.hidden) { + tokenType.GROUP = isWhitespace(regex2) ? Lexer2.SKIPPED : "hidden"; + } + return tokenType; + } + requiresCustomPattern(regex2) { + if (regex2.flags.includes("u")) { + return true; + } else if (regex2.source.includes("?<=") || regex2.source.includes("? { + 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); } - function ij(a) { - this.a = a; + 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; + } + } + }; + (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; } - function Dj(a) { - this.a = a; + } + 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; + } + } + __name(convertEscapeCharacter, "convertEscapeCharacter"); + function convertID(input) { + if (input.charAt(0) === "^") { + return input.substring(1); + } else { + return input; + } + } + __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._callbacks.push(callback); + this._contexts.push(context); + if (Array.isArray(bucket)) { + bucket.push({ dispose: /* @__PURE__ */ __name(() => this.remove(callback, context), "dispose") }); + } + } + remove(callback, context = null) { + if (!this._callbacks) { + return; + } + 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; + } } - function df(a) { - this.a = a; + } + if (foundCallbackWithDifferentContext) { + throw new Error("When adding a listener with a context, you should remove it with the same context"); + } + } + invoke(...args) { + if (!this._callbacks) { + return []; + } + 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); } - function kf(a) { - this.a = a; + } + 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; + }; + } + 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); + } + } + dispose() { + if (this._callbacks) { + this._callbacks.dispose(); + this._callbacks = void 0; + } + } + }; + 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(); } - function ah(a) { - this.a = a; + } + } + get isCancellationRequested() { + return this._isCancelled; + } + get onCancellationRequested() { + if (this._isCancelled) { + return shortcutEvent; + } + if (!this._emitter) { + this._emitter = new events_1.Emitter(); + } + return this._emitter.event; + } + dispose() { + if (this._emitter) { + this._emitter.dispose(); + this._emitter = void 0; + } + } + }; + var CancellationTokenSource3 = class { + static { + __name(this, "CancellationTokenSource"); + } + get token() { + if (!this._token) { + this._token = new MutableToken(); + } + return this._token; + } + cancel() { + if (!this._token) { + this._token = CancellationToken11.Cancelled; + } else { + this._token.cancel(); + } + } + dispose() { + if (!this._token) { + this._token = CancellationToken11.None; + } else if (this._token instanceof MutableToken) { + this._token.dispose(); + } + } + }; + exports2.CancellationTokenSource = CancellationTokenSource3; + } + }); + + // ../../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)); + } + }); + + // ../../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); + } + }); + } + 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; + } + 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; + }; + }); + } + }; + } + }); + + // ../../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++]; + } + } + while (leftIdx < left3.length) { + data5[i2++] = left3[leftIdx++]; + } + while (rightIdx < right3.length) { + data5[i2++] = right3[rightIdx++]; + } + return data5; + } + 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 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 { + throw new Error("Unknown change event received"); } - function lh(a) { - this.a = a; + } + 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; } - function th(a) { - this.a = a; + } + 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; } - function Ph(a) { - this.a = a; + 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"); + } + }); + + // ../../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); } - function vi(a) { - this.a = a; + 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; + } } - function Ci(a) { - this.a = a; + 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; } - function Fk(a) { - this.a = a; + 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; } - function Ln(a) { - this.a = a; + 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; } - function ap(a) { - this.a = a; + } + const u2 = t5 ? 1 : void 0; + class l2 extends f3 { + static { + __name(this, "l"); } - function zp(a) { - this.a = a; + _formatted = null; + _fsPath = null; + get fsPath() { + return this._fsPath || (this._fsPath = m2(this, false)), this._fsPath; } - function Yp(a) { - this.a = a; + toString(t6 = false) { + return t6 ? y5(this, true) : (this._formatted || (this._formatted = y5(this, false)), this._formatted); } - function qq(a) { - this.a = a; + 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; } - function Dq(a) { - this.a = a; + } + 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); + } } - function wr(a) { - this.a = a; + 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]); } - function Ir(a) { - this.b = a; + 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)); } - function sj(a) { - this.c = a; + 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); } - function sw(a) { - this.a = a; + 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); + } + }); + + // ../../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; } - function fw(a) { - this.a = a; - } - function xw(a) { - this.a = a; - } - function Cw(a) { - this.a = a; - } - function Qw(a) { - this.a = a; - } - function Rw(a) { - this.a = a; - } - function Xw(a) { - this.a = a; - } - function Xv(a) { - this.a = a; - } - function Sv(a) { - this.a = a; - } - function eu(a) { - this.a = a; - } - function Zx(a) { - this.a = a; - } - function _x(a) { - this.a = a; - } - function xy(a) { - this.a = a; - } - function xB(a) { - this.a = a; - } - function HB(a) { - this.a = a; - } - function TB(a) { - this.a = a; - } - function fC(a) { - this.a = a; - } - function wB() { - this.a = []; - } - function MBb(a, b) { - a.a = b; - } - function w_b(a, b) { - a.a = b; - } - function x_b(a, b) { - a.b = b; - } - function YOb(a, b) { - a.b = b; - } - function $Ob(a, b) { - a.b = b; - } - function ZGb(a, b) { - a.j = b; - } - function qNb(a, b) { - a.g = b; - } - function rNb(a, b) { - a.i = b; - } - function dRb(a, b) { - a.c = b; - } - function eRb(a, b) { - a.d = b; - } - function z_b(a, b) { - a.d = b; - } - function y_b(a, b) { - a.c = b; - } - function __b(a, b) { - a.k = b; - } - function E0b(a, b) { - a.c = b; - } - function njc(a, b) { - a.c = b; - } - function mjc(a, b) { - a.a = b; - } - function dFc(a, b) { - a.a = b; - } - function eFc(a, b) { - a.f = b; - } - function nOc(a, b) { - a.a = b; - } - function oOc(a, b) { - a.b = b; - } - function pOc(a, b) { - a.d = b; - } - function qOc(a, b) { - a.i = b; - } - function rOc(a, b) { - a.o = b; - } - function sOc(a, b) { - a.r = b; - } - function $Pc(a, b) { - a.a = b; - } - function _Pc(a, b) { - a.b = b; - } - function DVc(a, b) { - a.e = b; - } - function EVc(a, b) { - a.f = b; - } - function FVc(a, b) { - a.g = b; - } - function SZc(a, b) { - a.e = b; - } - function TZc(a, b) { - a.f = b; - } - function c$c(a, b) { - a.f = b; - } - function bJd(a, b) { - a.n = b; - } - function A1d(a, b) { - a.a = b; - } - function J1d(a, b) { - a.a = b; - } - function B1d(a, b) { - a.c = b; - } - function K1d(a, b) { - a.c = b; - } - function L1d(a, b) { - a.d = b; - } - function M1d(a, b) { - a.e = b; - } - function N1d(a, b) { - a.g = b; - } - function d2d(a, b) { - a.a = b; - } - function e2d(a, b) { - a.c = b; + } + const backPart = "../".repeat(fromParts.length - i2); + const toPart = toParts.slice(i2).join("/"); + return backPart + toPart; + } + __name(relative, "relative"); + UriUtils2.relative = relative; + })(UriUtils || (UriUtils = {})); + } + }); + + // ../../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 { + return this.create(uri, textDocument); + } + } + fromString(text2, uri, cancellationToken) { + if (cancellationToken) { + return this.createAsync(uri, text2, cancellationToken); + } else { + return this.create(uri, text2); + } + } + 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; + } + }; + } + }); + + // ../../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; } - function f2d(a, b) { - a.d = b; + }; + return reference; + } + getLinkedNode(refInfo) { + try { + const description = this.getCandidate(refInfo); + if (isLinkingError(description)) { + return { error: description }; } - function g2d(a, b) { - a.e = b; + const linkedNode = this.loadAstNode(description); + if (linkedNode) { + return { node: linkedNode, descr: description }; + } else { + return { + descr: description, + error: this.createLinkingError(refInfo, description) + }; } - function h2d(a, b) { - a.f = b; + } 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 }); + } + }; + } + }); + + // ../../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; + } + getNameNode(node2) { + return findNodeForProperty(node2.$cstNode, "name"); + } + }; + } + }); + + // ../../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; + } } - function i2d(a, b) { - a.j = b; + } + 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); } - function Z8d(a, b) { - a.a = b; + } + 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; + } + }; + } + }); + + // ../../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; + } } - function $8d(a, b) { - a.b = b; + return false; + } + } + /** + * 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; } - function g9d(a, b) { - a.a = b; + 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; + } + }; + } + }); + + // ../../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)); } - function Cic(a) { - a.b = a.a; + } + } + }; + } + }); + + // ../../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 { + return this.elements; + } + } + 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; + } + }; + 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); + } + 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; + } + 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; + } + }; + } + }); + + // ../../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; + } + } + 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; + } + } + 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(); + } + } + 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); } - function Dg(a) { - a.c = a.d.d; + })); + } + }; + WorkspaceCache = class extends SimpleCache { + static { + __name(this, "WorkspaceCache"); + } + constructor(sharedServices) { + super(); + this.onDispose(sharedServices.workspace.DocumentBuilder.onUpdate(() => { + this.clear(); + })); + } + }; + } + }); + + // ../../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; + } + /** + * 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); } - function vib(a) { - this.d = a; + 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; + } + } + 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 + }; } - function eib(a) { - this.a = a; + } 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(); + } } - function Pib(a) { - this.a = a; + 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; } - function Vib(a) { - this.a = a; + 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, ""); + } } - function $ib(a) { - this.a = a; + return astNode !== null && astNode !== void 0 ? astNode : value2; + } else { + return value2; + } + } + 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; + } + 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); + } + return { + $refText: refText !== null && refText !== void 0 ? refText : "", + ref + }; + } else { + error3 = ref; } - function mcb(a) { - this.a = a; + } + if (error3) { + const ref = { + $refText: refText !== null && refText !== void 0 ? refText : "" + }; + ref.error = { + container: container2, + property: property2, + message: error3, + reference: ref + }; + return ref; + } else { + return void 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; } - function Mcb(a) { - this.a = a; + 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; } - function Xcb(a) { - this.a = a; + 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; } - function Ndb(a) { - this.a = a; + if (fragmentIndex === uri.length - 1) { + return document2.parseResult.value; } - function _db(a) { - this.a = a; + const node2 = this.astNodeLocator.getAstNode(document2.parseResult.value, uri.substring(fragmentIndex + 1)); + if (!node2) { + return "Could not resolve URI: " + uri; } - function teb(a) { - this.a = a; + return node2; + } catch (err) { + return String(err); + } + } + }; + } + }); + + // ../../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.map) { + this.map = {}; + if (this.singleton) { + for (const ext of this.singleton.LanguageMetaData.fileExtensions) { + this.map[ext] = this.singleton; + } + this.singleton = void 0; } - function Qeb(a) { - this.a = a; + } + 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}'.`); } - function djb(a) { - this.a = a; + this.map[ext] = language; + } + } + getServices(uri) { + if (this.singleton !== void 0) { + return this.singleton; + } + if (this.map === void 0) { + throw new Error("The service registry is empty. Use `register` to register the services of a language."); + } + 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}'.`); + } + return services; + } + get all() { + if (this.singleton !== void 0) { + return [this.singleton]; + } + if (this.map !== void 0) { + return Object.values(this.map); + } + 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); } - function Gjb(a) { - this.a = a; + } + } + 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 }); } - function Njb(a) { - this.a = a; + }; + } + addEntry(type3, entry) { + if (type3 === "AstNode") { + this.entries.add("AstNode", entry); + return; + } + for (const subtype of this.reflection.getAllSubTypes(type3)) { + this.entries.add(subtype, entry); + } + } + 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)); + } + 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; } - function Bjb(a) { - this.b = a; + } + try { + diagnostics.push(...await this.validateAst(parseResult.value, options3, cancelToken)); + } catch (err) { + if (isOperationCancelled(err)) { + throw err; } - function lnb(a) { - this.b = a; + console.error("An error occurred during validation:", err); + } + 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); } - function Dnb(a) { - this.b = a; + } + } + 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)); } - function anb(a) { - this.a = a; + } + } + 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); } - function Mob(a) { - this.a = a; + })); + 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; + } + 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) + }; + } + }; + } + }); + + // ../../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; } - function Rob(a) { - this.a = a; + 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]; } - function iob(a) { - this.c = a; + return previousValue[currentValue]; + }, node2); + } + }; + } + }); + + // ../../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)) + }); } - function olb(a) { - this.c = a; + 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]); + }); } - function qub(a) { - this.c = a; + } + 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}`; + } + }; + } + }); + + // ../../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 = {})); + } + }); + + // ../../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"] } - function Tub(a) { - this.a = a; + }; + 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); } - function Vub(a) { - this.a = a; + }); + } + /** + * 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 state5 = this.buildState.get(doc.uri.toString()); + if (state5) { + state5.completed = true; + } + } + } + prepareBuild(documents2, options3) { + for (const doc of documents2) { + const key = doc.uri.toString(); + const state5 = this.buildState.get(key); + if (!state5 || state5.completed) { + this.buildState.set(key, { + completed: false, + options: options3, + result: state5 === null || state5 === void 0 ? void 0 : state5.result + }); } - function Xub(a) { - this.a = a; + } + } + 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(state5, 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 > state5) { + return Promise.resolve(uri); + } + } + if (this.currentState >= state5) { + return Promise.resolve(void 0); + } else if (cancelToken.isCancellationRequested) { + return Promise.reject(OperationCancelled); + } + return new Promise((resolve3, reject3) => { + const buildDisposable = this.onBuildPhase(state5, () => { + 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, state5, cancelToken) { + if (documents2.length === 0) { + return; + } + const listeners = this.buildPhaseListeners.get(state5); + 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 state5 = this.buildState.get(document2.uri.toString()); + if (state5) { + (_a = state5.result) !== null && _a !== void 0 ? _a : state5.result = {}; + const newCategories = (_b = options3 === null || options3 === void 0 ? void 0 : options3.categories) !== null && _b !== void 0 ? _b : ValidationCategory.all; + if (state5.result.validationChecks) { + state5.result.validationChecks.push(...newCategories); + } else { + state5.result.validationChecks = [...newCategories]; } - function Zub(a) { - this.a = a; + } + } + 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 : {}; + } + }; + } + }); + + // ../../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())); + } + }; + } + }); + + // ../../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); + } } - function tpb(a) { - this.a = a; - } - function _pb(a) { - this.a = a; - } - function Wqb(a) { - this.a = a; - } - function nsb(a) { - this.a = a; - } - function Rxb(a) { - this.a = a; - } - function Txb(a) { - this.a = a; - } - function Xxb(a) { - this.a = a; - } - function bzb(a) { - this.a = a; - } - function tzb(a) { - this.a = a; - } - function vzb(a) { - this.a = a; - } - function xzb(a) { - this.a = a; - } - function Kzb(a) { - this.a = a; - } - function Ozb(a) { - this.a = a; - } - function iAb(a) { - this.a = a; - } - function kAb(a) { - this.a = a; - } - function mAb(a) { - this.a = a; - } - function BAb(a) { - this.a = a; - } - function hBb(a) { - this.a = a; - } - function jBb(a) { - this.a = a; - } - function nBb(a) { - this.a = a; - } - function TBb(a) { - this.a = a; - } - function XBb(a) { - this.a = a; - } - function QCb(a) { - this.a = a; - } - function WCb(a) { - this.a = a; - } - function _Cb(a) { - this.a = a; - } - function dEb(a) { - this.a = a; - } - function QGb(a) { - this.a = a; - } - function YGb(a) { - this.a = a; - } - function tKb(a) { - this.a = a; - } - function CLb(a) { - this.a = a; - } - function JMb(a) { - this.a = a; - } - function RNb(a) { - this.a = a; - } - function kQb(a) { - this.a = a; - } - function mQb(a) { - this.a = a; - } - function FQb(a) { - this.a = a; - } - function ETb(a) { - this.a = a; - } - function UTb(a) { - this.a = a; - } - function dUb(a) { - this.a = a; - } - function hUb(a) { - this.a = a; - } - function EZb(a) { - this.a = a; - } - function j$b(a) { - this.a = a; - } - function v$b(a) { - this.e = a; - } - function J0b(a) { - this.a = a; - } - function M0b(a) { - this.a = a; - } - function R0b(a) { - this.a = a; - } - function U0b(a) { - this.a = a; - } - function i2b(a) { - this.a = a; - } - function k2b(a) { - this.a = a; - } - function o2b(a) { - this.a = a; - } - function s2b(a) { - this.a = a; - } - function G2b(a) { - this.a = a; - } - function I2b(a) { - this.a = a; - } - function K2b(a) { - this.a = a; - } - function M2b(a) { - this.a = a; - } - function W3b(a) { - this.a = a; - } - function $3b(a) { - this.a = a; - } - function V4b(a) { - this.a = a; - } - function u5b(a) { - this.a = a; - } - function A7b(a) { - this.a = a; - } - function G7b(a) { - this.a = a; - } - function J7b(a) { - this.a = a; - } - function M7b(a) { - this.a = a; - } - function Mbc(a) { - this.a = a; - } - function Pbc(a) { - this.a = a; - } - function lac(a) { - this.a = a; - } - function nac(a) { - this.a = a; - } - function qcc(a) { - this.a = a; - } - function Gdc(a) { - this.a = a; - } - function $dc(a) { - this.a = a; - } - function cec(a) { - this.a = a; - } - function _ec(a) { - this.a = a; - } - function pfc(a) { - this.a = a; - } - function Bfc(a) { - this.a = a; - } - function Lfc(a) { - this.a = a; - } - function ygc(a) { - this.a = a; - } - function Dgc(a) { - this.a = a; - } - function shc(a) { - this.a = a; - } - function uhc(a) { - this.a = a; - } - function whc(a) { - this.a = a; - } - function Chc(a) { - this.a = a; - } - function Ehc(a) { - this.a = a; - } - function Ohc(a) { - this.a = a; - } - function Yhc(a) { - this.a = a; - } - function Tkc(a) { - this.a = a; - } - function Vkc(a) { - this.a = a; - } - function Olc(a) { - this.a = a; - } - function pnc(a) { - this.a = a; - } - function rnc(a) { - this.a = a; + })); + } + /** + * 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; + } + }; + } + }); + + // ../../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"); + } + }); + + // ../../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 + }); + return parseJSDocComment({ + index: 0, + tokens: tokens2, + position: position5 + }); + } + function isJSDoc(node2, options3) { + const normalizedOptions = normalizeOptions(options3); + const lines = getLines(node2); + if (lines.length === 0) { + return false; + } + 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; + } + } + 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 (tokens2.length > 0 && tokens2[tokens2.length - 1].type === "break") { + return tokens2.slice(0, -1); + } + 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) + }); + } 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)) + }); + } + } + return tokens2; + } + function skipWhitespace(line2, index) { + const match2 = line2.substring(index).match(nonWhitespaceRegex); + if (match2) { + return index + match2.index; + } else { + return line2.length; + } + } + function lastCharacter(line2) { + const match2 = line2.match(whitespaceEndRegex); + if (match2 && typeof match2.index === "number") { + return match2.index; + } + 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; + } + } + function appendEmptyLine(token2, element3) { + if (element3) { + const line2 = new JSDocLineImpl("", token2.range); + if ("inlines" in element3) { + element3.inlines.push(line2); + } else { + element3.content.inlines.push(line2); + } + } + } + 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]; + } + 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 { + return parseJSDocLine(context); + } + } + 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)); + } + } else { + const range3 = tagToken.range; + return new JSDocTagImpl(name, new JSDocTextImpl([], range3), inline2, range3); + } + } + 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: "*" + }); + } + const { start: start3, end: end2, line: line2 } = options3; + return { + start: normalizeOption(start3, true), + end: normalizeOption(end2, false), + line: normalizeOption(line2, true) + }; + } + 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*$`); + } + } 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); + } + if (tag2 === "linkcode" || tag2 === "link" && options3.link === "code") { + display = `\`${display}\``; + } + 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; + } + 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; } - function dpc(a) { - this.a = a; + } + return value2.trim(); + } + 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; } - function fpc(a) { - this.a = a; + } + return value2.trim(); + } + }; + JSDocTagImpl = class { + static { + __name(this, "JSDocTagImpl"); + } + constructor(name, content, inline2, range3) { + this.name = name; + this.content = content; + this.inline = inline2; + this.range = range3; + } + 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; + } + } + 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; + } + } + 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 { + 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"; } - function GCc(a) { - this.a = a; + } + 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"; } - function KCc(a) { - this.a = a; + } + 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") + }); + } + 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; + } + } + 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; } - function mDc(a) { - this.a = a; + currentNode = currentNode.$container; + } while (currentNode); + return void 0; + } + 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; + } + 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); + } + } + 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); + } + } + async acquireParserWorker(cancelToken) { + this.initializeWorkers(); + for (const worker of this.workerPool) { + if (worker.ready) { + worker.lock(); + return worker; } - function jEc(a) { - this.a = a; + } + const deferred = new Deferred(); + cancelToken.onCancellationRequested(() => { + const index = this.queue.indexOf(deferred); + if (index >= 0) { + this.queue.splice(index, 1); } - function HEc(a) { - this.a = a; + 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 + }; + queue.push(entry); + this.performNextOperation(); + return deferred.promise; + } + async performNextOperation() { + if (!this.done) { + return; + } + 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.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); + } } - function FEc(a) { - this.c = a; + })); + 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, {}); + } + if (node2.$cstNode) { + for (const cstNode of streamCst(node2.$cstNode)) { + cstNodes.set(cstNode, {}); } - function qoc(a) { - this.b = a; + } + return { + astNodes, + cstNodes + }; + } + 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); + } + for (const [name, value2] of Object.entries(node2)) { + if (name.startsWith("$")) { + continue; } - function bFc(a) { - this.a = a; + 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 { + arr.push(item); + } + } + } 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; } - function GFc(a) { - this.a = a; + } + return obj; + } + dehydrateReference(reference, context) { + const obj = {}; + obj.$refText = reference.$refText; + if (reference.$refNode) { + obj.$refNode = context.cstNodes.get(reference.$refNode); + } + return obj; + } + dehydrateCstNode(node2, context) { + const cstNode = context.cstNodes.get(node2); + if (isRootCstNode(node2)) { + cstNode.fullText = node2.fullText; + } else { + 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 { + 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, {}); + } + 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; + } } - function iGc(a) { - this.a = a; + } + 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); + } + for (const [name, value2] of Object.entries(node2)) { + if (name.startsWith("$")) { + continue; } - function kGc(a) { - this.a = a; + 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; } - function mGc(a) { - this.a = a; + } + 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 } - function $Gc(a) { - this.a = a; + }, tokenType, hidden); + return node2; + } + getTokenType(name) { + return this.lexer.definition[name]; + } + getGrammarElementId(node2) { + if (this.grammarElementIdMap.size === 0) { + this.createGrammarElementIdMap(); + } + return this.grammarElementIdMap.get(node2); + } + getGrammarElement(id27) { + if (this.grammarElementIdMap.size === 0) { + this.createGrammarElementIdMap(); + } + const element3 = this.grammarElementIdMap.getKey(id27); + if (element3) { + return element3; + } else { + throw new Error("Invalid grammar element id: " + id27); + } + } + createGrammarElementIdMap() { + let id27 = 0; + for (const element3 of streamAst(this.grammar)) { + if (isAbstractElement(element3)) { + this.grammarElementIdMap.set(element3, id27++); } - function hIc(a) { - this.a = a; + } + } + }; + } + }); + + // ../../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") + }; + } + 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") + } + }; + } + 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"); + } + }); + + // ../../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; + } + 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 void 0; + } + } + 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; + } + } + } + } + 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"); + } + }); + + // ../../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"; + } + }); + + // ../../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(); + } + }); + + // ../../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"; + } + }); + + // ../../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(); + } + }); + + // ../../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"; + } + }); + + // ../../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(); + } + }); + + // ../../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(); + } + }); + + // ../../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(); + } + }); + + // ../../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") + }; + } + }); + + // ../../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"); + } + }); + + // ../../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(); + } + }); + + // ../../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_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_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_lib3 = __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(); + } + }); + + // ../parser/dist/chunks/mermaid-parser.core/chunk-Y27MQZ3U.mjs + function isArchitecture(item) { + return reflection2.isInstance(item, Architecture); + } + 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, Architecture, Branch, Checkout, CherryPicking, Commit, Common, GitGraph, Info, Merge, Packet, PacketBlock, Pie, PieSection, Direction, MermaidAstReflection, reflection2, loadedInfoGrammar, InfoGrammar, loadedPacketGrammar, PacketGrammar, loadedPieGrammar, PieGrammar, loadedArchitectureGrammar, ArchitectureGrammar, loadedGitGraphGrammar, GitGraphGrammar, InfoLanguageMetaData, PacketLanguageMetaData, PieLanguageMetaData, ArchitectureLanguageMetaData, GitGraphLanguageMetaData, MermaidGeneratedSharedModule, InfoGeneratedModule, PacketGeneratedModule, PieGeneratedModule, ArchitectureGeneratedModule, GitGraphGeneratedModule, accessibilityDescrRegex, accessibilityTitleRegex, titleRegex, rulesRegexes, AbstractMermaidValueConverter, CommonValueConverter, AbstractMermaidTokenBuilder, CommonTokenBuilder; + var init_chunk_Y27MQZ3U = __esm({ + "../parser/dist/chunks/mermaid-parser.core/chunk-Y27MQZ3U.mjs"() { + "use strict"; + init_lib3(); + init_lib3(); + init_lib3(); + init_lib3(); + __defProp2 = Object.defineProperty; + __name2 = /* @__PURE__ */ __name((target, value2) => __defProp2(target, "name", { value: value2, configurable: true }), "__name"); + Statement = "Statement"; + Architecture = "Architecture"; + __name(isArchitecture, "isArchitecture"); + __name2(isArchitecture, "isArchitecture"); + 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 ["Architecture", "Branch", "Checkout", "CherryPicking", "Commit", "Common", "Direction", "Edge", "GitGraph", "Group", "Info", "Junction", "Merge", "Packet", "PacketBlock", "Pie", "PieSection", "Service", "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; } - function lIc(a) { - this.a = a; + } + } + getReferenceType(refInfo) { + const referenceId = `${refInfo.container.$type}:${refInfo.property}`; + switch (referenceId) { + default: { + throw new Error(`${referenceId} is not a valid reference id.`); } - function pIc(a) { - this.a = a; + } + } + getTypeMetaData(type3) { + switch (type3) { + case "Architecture": { + return { + name: "Architecture", + properties: [ + { name: "accDescr" }, + { name: "accTitle" }, + { name: "edges", defaultValue: [] }, + { name: "groups", defaultValue: [] }, + { name: "junctions", defaultValue: [] }, + { name: "services", defaultValue: [] }, + { name: "title" } + ] + }; } - function tIc(a) { - this.a = a; + case "Branch": { + return { + name: "Branch", + properties: [ + { name: "name" }, + { name: "order" } + ] + }; } - function xIc(a) { - this.a = a; + case "Checkout": { + return { + name: "Checkout", + properties: [ + { name: "branch" } + ] + }; } - function zIc(a) { - this.a = a; + case "CherryPicking": { + return { + name: "CherryPicking", + properties: [ + { name: "id" }, + { name: "parent" }, + { name: "tags", defaultValue: [] } + ] + }; } - function CIc(a) { - this.a = a; + case "Commit": { + return { + name: "Commit", + properties: [ + { name: "id" }, + { name: "message" }, + { name: "tags", defaultValue: [] }, + { name: "type" } + ] + }; } - function LIc(a) { - this.a = a; + case "Common": { + return { + name: "Common", + properties: [ + { name: "accDescr" }, + { name: "accTitle" }, + { name: "title" } + ] + }; } - function CKc(a) { - this.a = a; + case "Edge": { + return { + name: "Edge", + properties: [ + { name: "lhsDir" }, + { name: "lhsGroup", defaultValue: false }, + { name: "lhsId" }, + { name: "lhsInto", defaultValue: false }, + { name: "rhsDir" }, + { name: "rhsGroup", defaultValue: false }, + { name: "rhsId" }, + { name: "rhsInto", defaultValue: false }, + { name: "title" } + ] + }; } - function IKc(a) { - this.a = a; + case "GitGraph": { + return { + name: "GitGraph", + properties: [ + { name: "accDescr" }, + { name: "accTitle" }, + { name: "statements", defaultValue: [] }, + { name: "title" } + ] + }; } - function MKc(a) { - this.a = a; + case "Group": { + return { + name: "Group", + properties: [ + { name: "icon" }, + { name: "id" }, + { name: "in" }, + { name: "title" } + ] + }; } - function $Kc(a) { - this.a = a; + case "Info": { + return { + name: "Info", + properties: [ + { name: "accDescr" }, + { name: "accTitle" }, + { name: "title" } + ] + }; } - function cLc(a) { - this.a = a; + case "Junction": { + return { + name: "Junction", + properties: [ + { name: "id" }, + { name: "in" } + ] + }; } - function jLc(a) { - this.a = a; + case "Merge": { + return { + name: "Merge", + properties: [ + { name: "branch" }, + { name: "id" }, + { name: "tags", defaultValue: [] }, + { name: "type" } + ] + }; } - function rLc(a) { - this.a = a; + case "Packet": { + return { + name: "Packet", + properties: [ + { name: "accDescr" }, + { name: "accTitle" }, + { name: "blocks", defaultValue: [] }, + { name: "title" } + ] + }; } - function xLc(a) { - this.a = a; + case "PacketBlock": { + return { + name: "PacketBlock", + properties: [ + { name: "end" }, + { name: "label" }, + { name: "start" } + ] + }; } - function OMc(a) { - this.a = a; + case "Pie": { + return { + name: "Pie", + properties: [ + { name: "accDescr" }, + { name: "accTitle" }, + { name: "sections", defaultValue: [] }, + { name: "showData", defaultValue: false }, + { name: "title" } + ] + }; } - function ZOc(a) { - this.a = a; + case "PieSection": { + return { + name: "PieSection", + properties: [ + { name: "label" }, + { name: "value" } + ] + }; } - function ZRc(a) { - this.a = a; + case "Service": { + return { + name: "Service", + properties: [ + { name: "icon" }, + { name: "iconText" }, + { name: "id" }, + { name: "in" }, + { name: "title" } + ] + }; } - function aSc(a) { - this.a = a; + case "Direction": { + return { + name: "Direction", + properties: [ + { name: "accDescr" }, + { name: "accTitle" }, + { name: "dir" }, + { name: "statements", defaultValue: [] }, + { name: "title" } + ] + }; } - function I$c(a) { - this.a = a; + default: { + return { + name: type3, + properties: [] + }; } - function K$c(a) { - this.a = a; + } + } + }; + 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"); + ArchitectureGrammar = /* @__PURE__ */ __name2(() => loadedArchitectureGrammar ?? (loadedArchitectureGrammar = loadGrammarFromJson('{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","name":"Architecture","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","fragment":true,"definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LeftPort","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RightPort","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Arrow","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ID","definition":{"$type":"RegexToken","regex":"/[\\\\w]+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TEXT_ICON","definition":{"$type":"RegexToken","regex":"/\\\\(\\"[^\\"]+\\"\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","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@19"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"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@18"},"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":[]}')), "ArchitectureGrammar"); + 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 + }; + ArchitectureLanguageMetaData = { + languageId: "architecture", + 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: {} + }; + ArchitectureGeneratedModule = { + Grammar: /* @__PURE__ */ __name2(() => ArchitectureGrammar(), "Grammar"), + LanguageMetaData: /* @__PURE__ */ __name2(() => ArchitectureLanguageMetaData, "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 regex2 = rulesRegexes[rule.name]; + if (regex2 === void 0) { + return void 0; + } + const match2 = regex2.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))"); } - function M$c(a) { - this.a = a; - } - function O$c(a) { - this.a = a; - } - function U$c(a) { - this.a = a; - } - function n1c(a) { - this.a = a; - } - function z1c(a) { - this.a = a; - } - function B1c(a) { - this.a = a; - } - function Q2c(a) { - this.a = a; - } - function U2c(a) { - this.a = a; - } - function z3c(a) { - this.a = a; - } - function med(a) { - this.a = a; - } - function Xed(a) { - this.a = a; - } - function _ed(a) { - this.a = a; - } - function Qfd(a) { - this.a = a; - } - function Bgd(a) { - this.a = a; - } - function $gd(a) { - this.a = a; - } - function lrd(a) { - this.a = a; - } - function urd(a) { - this.a = a; - } - function vrd(a) { - this.a = a; - } - function wrd(a) { - this.a = a; - } - function xrd(a) { - this.a = a; + }); + return tokenTypes; + } + }; + CommonTokenBuilder = class extends AbstractMermaidTokenBuilder { + static { + __name(this, "CommonTokenBuilder"); + } + static { + __name2(this, "CommonTokenBuilder"); + } + }; + } + }); + + // ../parser/dist/chunks/mermaid-parser.core/chunk-NCMFTTUW.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_NCMFTTUW = __esm({ + "../parser/dist/chunks/mermaid-parser.core/chunk-NCMFTTUW.mjs"() { + "use strict"; + init_chunk_Y27MQZ3U(); + init_lib3(); + 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"); + } + }); + + // ../parser/dist/chunks/mermaid-parser.core/chunk-4YFB5VUC.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_4YFB5VUC = __esm({ + "../parser/dist/chunks/mermaid-parser.core/chunk-4YFB5VUC.mjs"() { + "use strict"; + init_chunk_Y27MQZ3U(); + init_lib3(); + 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"); + } + }); + + // ../parser/dist/chunks/mermaid-parser.core/chunk-EQFLFMNE.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_EQFLFMNE = __esm({ + "../parser/dist/chunks/mermaid-parser.core/chunk-EQFLFMNE.mjs"() { + "use strict"; + init_chunk_Y27MQZ3U(); + init_lib3(); + 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"); + } + }); + + // ../parser/dist/chunks/mermaid-parser.core/chunk-BI6EQKOQ.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_BI6EQKOQ = __esm({ + "../parser/dist/chunks/mermaid-parser.core/chunk-BI6EQKOQ.mjs"() { + "use strict"; + init_chunk_Y27MQZ3U(); + init_lib3(); + 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"); + } + }); + + // ../parser/dist/chunks/mermaid-parser.core/chunk-FF7BQXOH.mjs + function createArchitectureServices(context = EmptyFileSystem) { + const shared = inject( + createDefaultSharedCoreModule(context), + MermaidGeneratedSharedModule + ); + const Architecture2 = inject( + createDefaultCoreModule({ shared }), + ArchitectureGeneratedModule, + ArchitectureModule + ); + shared.ServiceRegistry.register(Architecture2); + return { shared, Architecture: Architecture2 }; + } + var ArchitectureTokenBuilder, ArchitectureValueConverter, ArchitectureModule; + var init_chunk_FF7BQXOH = __esm({ + "../parser/dist/chunks/mermaid-parser.core/chunk-FF7BQXOH.mjs"() { + "use strict"; + init_chunk_Y27MQZ3U(); + init_lib3(); + ArchitectureTokenBuilder = class extends AbstractMermaidTokenBuilder { + static { + __name(this, "ArchitectureTokenBuilder"); + } + static { + __name2(this, "ArchitectureTokenBuilder"); + } + constructor() { + super(["architecture"]); + } + }; + ArchitectureValueConverter = class extends AbstractMermaidValueConverter { + static { + __name(this, "ArchitectureValueConverter"); + } + static { + __name2(this, "ArchitectureValueConverter"); + } + runCustomConverter(rule, input, _cstNode) { + if (rule.name === "ARCH_ICON") { + return input.replace(/[()]/g, "").trim(); + } else if (rule.name === "ARCH_TEXT_ICON") { + return input.replace(/["()]/g, ""); + } else if (rule.name === "ARCH_TITLE") { + return input.replace(/[[\]]/g, "").trim(); + } + return void 0; + } + }; + ArchitectureModule = { + parser: { + TokenBuilder: /* @__PURE__ */ __name2(() => new ArchitectureTokenBuilder(), "TokenBuilder"), + ValueConverter: /* @__PURE__ */ __name2(() => new ArchitectureValueConverter(), "ValueConverter") + } + }; + __name(createArchitectureServices, "createArchitectureServices"); + __name2(createArchitectureServices, "createArchitectureServices"); + } + }); + + // ../parser/dist/chunks/mermaid-parser.core/info-46DW6VJ7.mjs + var info_46DW6VJ7_exports = {}; + __export(info_46DW6VJ7_exports, { + InfoModule: () => InfoModule, + createInfoServices: () => createInfoServices + }); + var init_info_46DW6VJ7 = __esm({ + "../parser/dist/chunks/mermaid-parser.core/info-46DW6VJ7.mjs"() { + "use strict"; + init_chunk_4YFB5VUC(); + init_chunk_Y27MQZ3U(); + } + }); + + // ../parser/dist/chunks/mermaid-parser.core/packet-W2GHVCYJ.mjs + var packet_W2GHVCYJ_exports = {}; + __export(packet_W2GHVCYJ_exports, { + PacketModule: () => PacketModule, + createPacketServices: () => createPacketServices + }); + var init_packet_W2GHVCYJ = __esm({ + "../parser/dist/chunks/mermaid-parser.core/packet-W2GHVCYJ.mjs"() { + "use strict"; + init_chunk_EQFLFMNE(); + init_chunk_Y27MQZ3U(); + } + }); + + // ../parser/dist/chunks/mermaid-parser.core/pie-BEWT4RHE.mjs + var pie_BEWT4RHE_exports = {}; + __export(pie_BEWT4RHE_exports, { + PieModule: () => PieModule, + createPieServices: () => createPieServices + }); + var init_pie_BEWT4RHE = __esm({ + "../parser/dist/chunks/mermaid-parser.core/pie-BEWT4RHE.mjs"() { + "use strict"; + init_chunk_BI6EQKOQ(); + init_chunk_Y27MQZ3U(); + } + }); + + // ../parser/dist/chunks/mermaid-parser.core/architecture-I3QFYML2.mjs + var architecture_I3QFYML2_exports = {}; + __export(architecture_I3QFYML2_exports, { + ArchitectureModule: () => ArchitectureModule, + createArchitectureServices: () => createArchitectureServices + }); + var init_architecture_I3QFYML2 = __esm({ + "../parser/dist/chunks/mermaid-parser.core/architecture-I3QFYML2.mjs"() { + "use strict"; + init_chunk_FF7BQXOH(); + init_chunk_Y27MQZ3U(); + } + }); + + // ../parser/dist/chunks/mermaid-parser.core/gitGraph-YCYPL57B.mjs + var gitGraph_YCYPL57B_exports = {}; + __export(gitGraph_YCYPL57B_exports, { + GitGraphModule: () => GitGraphModule, + createGitGraphServices: () => createGitGraphServices + }); + var init_gitGraph_YCYPL57B = __esm({ + "../parser/dist/chunks/mermaid-parser.core/gitGraph-YCYPL57B.mjs"() { + "use strict"; + init_chunk_NCMFTTUW(); + init_chunk_Y27MQZ3U(); + } + }); + + // ../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 parser22 = parsers[diagramType]; + const result = parser22.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_NCMFTTUW(); + init_chunk_4YFB5VUC(); + init_chunk_EQFLFMNE(); + init_chunk_BI6EQKOQ(); + init_chunk_FF7BQXOH(); + init_chunk_Y27MQZ3U(); + parsers = {}; + initializers = { + info: /* @__PURE__ */ __name2(async () => { + const { createInfoServices: createInfoServices2 } = await Promise.resolve().then(() => (init_info_46DW6VJ7(), info_46DW6VJ7_exports)); + const parser22 = createInfoServices2().Info.parser.LangiumParser; + parsers.info = parser22; + }, "info"), + packet: /* @__PURE__ */ __name2(async () => { + const { createPacketServices: createPacketServices2 } = await Promise.resolve().then(() => (init_packet_W2GHVCYJ(), packet_W2GHVCYJ_exports)); + const parser22 = createPacketServices2().Packet.parser.LangiumParser; + parsers.packet = parser22; + }, "packet"), + pie: /* @__PURE__ */ __name2(async () => { + const { createPieServices: createPieServices2 } = await Promise.resolve().then(() => (init_pie_BEWT4RHE(), pie_BEWT4RHE_exports)); + const parser22 = createPieServices2().Pie.parser.LangiumParser; + parsers.pie = parser22; + }, "pie"), + architecture: /* @__PURE__ */ __name2(async () => { + const { createArchitectureServices: createArchitectureServices2 } = await Promise.resolve().then(() => (init_architecture_I3QFYML2(), architecture_I3QFYML2_exports)); + const parser22 = createArchitectureServices2().Architecture.parser.LangiumParser; + parsers.architecture = parser22; + }, "architecture"), + gitGraph: /* @__PURE__ */ __name2(async () => { + const { createGitGraphServices: createGitGraphServices2 } = await Promise.resolve().then(() => (init_gitGraph_YCYPL57B(), gitGraph_YCYPL57B_exports)); + const parser22 = createGitGraphServices2().GitGraph.parser.LangiumParser; + parsers.gitGraph = parser22; + }, "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"); + } + }; + } + }); + + // src/diagrams/common/populateCommonDb.ts + function populateCommonDb(ast, db8) { + if (ast.accDescr) { + db8.setAccDescription?.(ast.accDescr); + } + if (ast.accTitle) { + db8.setAccTitle?.(ast.accTitle); + } + if (ast.title) { + db8.setDiagramTitle?.(ast.title); + } + } + var init_populateCommonDb = __esm({ + "src/diagrams/common/populateCommonDb.ts"() { + "use strict"; + __name(populateCommonDb, "populateCommonDb"); + } + }); + + // 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 + }; + } + }); + + // 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(); + } + }; + } + }); + + // 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); + } + return out; + }, []); + } + function upsert(arr, key, newVal) { + const index = arr.indexOf(key); + if (index === -1) { + arr.push(newVal); + } else { + arr.splice(index, 1, newVal); + } + } + 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(c3) { + if (c3 === commit2) { + line2 += " *"; + } else { + line2 += " |"; + } + }); + 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); + } + } + 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 (commit2.parents[0]) { + const newCommit = state2.records.commits.get(commit2.parents[0]); + upsert(commitArr, commit2, newCommit); + } + } + commitArr = uniqBy2(commitArr, (c3) => c3.id); + prettyPrintCommitHistory(commitArr); + } + 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: {} + }; + }); + __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 id27 = commitDB.id; + const type3 = commitDB.type; + let tags2 = commitDB.tags; + log.info("commit", msg, id27, type3, tags2); + log.debug("Entering commit:", msg, id27, type3, tags2); + const config6 = getConfig3(); + id27 = common_default.sanitizeText(id27, config6); + msg = common_default.sanitizeText(msg, config6); + tags2 = tags2?.map((tag2) => common_default.sanitizeText(tag2, config6)); + const newCommit = { + id: id27 ? id27 : 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 + }; + 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 ?? [] + }; + 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; + } + 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'); + } + 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; + } + 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; + } + 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; + } + 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 id27 = state2.records.branches.get(state2.records.currBranch); + if (id27 === void 0 || !id27) { + state2.records.head = null; + } else { + state2.records.head = state2.records.commits.get(id27) ?? 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; + } + 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, db8) => { + populateCommonDb(ast, db8); + if (ast.dir) { + db8.setDirection(ast.dir); + } + for (const statement of ast.statements) { + parseStatement(statement, db8); + } + }, "populate"); + parseStatement = /* @__PURE__ */ __name((statement, db8) => { + const parsers2 = { + Commit: /* @__PURE__ */ __name((stmt) => db8.commit(parseCommit(stmt)), "Commit"), + Branch: /* @__PURE__ */ __name((stmt) => db8.branch(parseBranch(stmt)), "Branch"), + Merge: /* @__PURE__ */ __name((stmt) => db8.merge(parseMerge(stmt)), "Merge"), + Checkout: /* @__PURE__ */ __name((stmt) => db8.checkout(parseCheckout(stmt)), "Checkout"), + CherryPicking: /* @__PURE__ */ __name((stmt) => db8.cherryPick(parseCherryPicking(stmt)), "CherryPicking") + }; + const parser22 = parsers2[statement.$type]; + if (parser22) { + parser22(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 + }); + }); + 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"); + }); + }); + } + } + }); + + // 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; + } + }); + 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; + } + }); + 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 { + roots.push(commit2); + } + 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 }); + } + }); + }, "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}` + ); + } + 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}`); + } + } + }, "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; + } + 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; } - function yrd(a) { - this.a = a; + } + } 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; + } + } + 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 }); + } + pos = dir === "BT" && isParallelCommits ? pos + COMMIT_STEP : pos + COMMIT_STEP + LAYOUT_OFFSET; + if (pos > maxPos) { + maxPos = pos; + } + }); + }, "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}`; } - function zrd(a) { - this.a = a; + } 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}`; } - function Ard(a) { - this.a = a; + } else { + 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}`; } - function Brd(a) { - this.a = a; + } + } 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}`; + } } - function Crd(a) { - this.a = a; + 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}`; + } } - function Ird(a) { - this.a = a; + if (p1.x === p22.x) { + lineDef = `M ${p1.x} ${p1.y} L ${p22.x} ${p22.y}`; } - function Krd(a) { - this.a = a; + } 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}`; + } } - function Lrd(a) { - this.a = a; + 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}`; + } } - function Mrd(a) { - this.a = a; + if (p1.x === p22.x) { + lineDef = `M ${p1.x} ${p1.y} L ${p22.x} ${p22.y}`; } - function Nrd(a) { - this.a = a; + } else { + 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}`; + } } - function Prd(a) { - this.a = a; + 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}`; + } } - function Srd(a) { - this.a = a; + if (p1.y === p22.y) { + lineDef = `M ${p1.x} ${p1.y} L ${p22.x} ${p22.y}`; } - function Yrd(a) { - this.a = a; + } + } + 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); + }); + } + }); + }, "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 { + bkg.attr("transform", "translate(-19, " + (pos - bbox.height / 2) + ")"); + } + }); + }, "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, id27, ver, diagObj) { + clear11(); + log.debug("in gitgraph renderer", txt + "\n", "id:", id27, ver); + if (!DEFAULT_GITGRAPH_CONFIG2) { + throw new Error("GitGraph config not found"); + } + const rotateCommitLabel = DEFAULT_GITGRAPH_CONFIG2.rotateCommitLabel ?? false; + const db8 = diagObj.db; + allCommitsDict = db8.getCommits(); + const branches = db8.getBranchesAsObjArray(); + dir = db8.getDirection(); + const diagram24 = select_default2(`[id="${id27}"]`); + let pos = 0; + branches.forEach((branch2, index) => { + const labelElement = drawText2(branch2.name); + const g2 = diagram24.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(diagram24, allCommitsDict, false); + if (DEFAULT_GITGRAPH_CONFIG2.showBranches) { + drawBranches(diagram24, branches); + } + drawArrows(diagram24, allCommitsDict); + drawCommits(diagram24, allCommitsDict, true); + utils_default2.insertTitle( + diagram24, + "gitTitleText", + DEFAULT_GITGRAPH_CONFIG2.titleTopMargin ?? 0, + db8.getDiagramTitle() + ); + setupGraphViewbox2( + void 0, + diagram24, + 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(); + }); + } + } + }); + + // 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); + } + ${[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")} + + .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}; } + + .commit-merge { + stroke: ${options3.primaryColor}; + fill: ${options3.primaryColor}; + } + .commit-reverse { + stroke: ${options3.primaryColor}; + fill: ${options3.primaryColor}; + stroke-width: 3; + } + .commit-highlight-outer { + } + .commit-highlight-inner { + stroke: ${options3.primaryColor}; + fill: ${options3.primaryColor}; + } + + .arrow { stroke-width: 8; stroke-linecap: round; fill: none} + .gitTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${options3.textColor}; + } +`, "getStyles"); + styles_default5 = getStyles5; + } + }); + + // 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 + }; + } + }); + + // 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 parser22 = { + 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; } - function Zrd(a) { - this.a = a; + }, "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; } - function _rd(a) { - this.a = a; + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - function asd(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 bsd(a) { - this.a = a; + __name(lex2, "lex"); + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state5] && table[state5][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state5]) { + 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: " + state5 + ", 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 csd(a) { - this.a = a; - } - function dsd(a) { - this.a = a; - } - function msd(a) { - this.a = a; - } - function osd(a) { - this.a = a; - } - function qsd(a) { - this.a = a; - } - function ssd(a) { - this.a = a; - } - function Wsd(a) { - this.a = a; - } - function Lsd(a) { - this.b = a; - } - function thd(a) { - this.f = a; - } - function qtd(a) { - this.a = a; - } - function yBd(a) { - this.a = a; - } - function GBd(a) { - this.a = a; - } - function MBd(a) { - this.a = a; - } - function SBd(a) { - this.a = a; - } - function iCd(a) { - this.a = a; - } - function YMd(a) { - this.a = a; - } - function GNd(a) { - this.a = a; - } - function EPd(a) { - this.a = a; - } - function EQd(a) { - this.a = a; - } - function NTd(a) { - this.a = a; - } - function qOd(a) { - this.b = a; - } - function lVd(a) { - this.c = a; - } - function VVd(a) { - this.e = a; - } - function iYd(a) { - this.a = a; - } - function RYd(a) { - this.a = a; - } - function ZYd(a) { - this.a = a; - } - function z0d(a) { - this.a = a; - } - function O0d(a) { - this.a = a; - } - function s0d(a) { - this.d = a; - } - function W5d(a) { - this.a = a; - } - function cge(a) { - this.a = a; - } - function xfe(a) { - this.e = a; - } - function Tfd() { - this.a = 0; - } - function jkb() { - Vjb(this); - } - function Rkb() { - Ckb(this); - } - function Lqb() { - Uhb(this); - } - function lEb() { - kEb(this); - } - function A_b() { - } - function UQd() { - this.c = FQd; - } - function v6d(a, b) { - b.Wb(a); - } - function moc(a, b) { - a.b += b; - } - function yXb(a) { - a.b = new Ji(); - } - function vbb(a) { - return a.e; - } - function DB(a) { - return a.a; - } - function LB(a) { - return a.a; - } - function ZB(a) { - return a.a; - } - function lC(a) { - return a.a; - } - function EC(a) { - return a.a; - } - function wC() { - return null; - } - function SB() { - return null; - } - function hcb() { - mvd(); - ovd(); - } - function zJb(a) { - a.b.tf(a.e); - } - function j5b(a, b) { - a.b = b - a.b; - } - function g5b(a, b) { - a.a = b - a.a; - } - function PXc(a, b) { - b.ad(a.a); - } - function plc(a, b) { - G0b(b, a); - } - function hp(a, b, c2) { - a.Od(c2, b); - } - function As(a, b) { - a.e = b; - b.b = a; - } - function Zl(a) { - Ql(); - this.a = a; - } - function jq(a) { - Ql(); - this.a = a; - } - function sq(a) { - Ql(); - this.a = a; - } - function Fq(a) { - im(); - this.a = a; - } - function Sz(a) { - Rz(); - Qz.be(a); - } - function gz() { - Xy.call(this); - } - function xcb() { - Xy.call(this); - } - function pcb() { - gz.call(this); - } - function tcb() { - gz.call(this); - } - function Bdb() { - gz.call(this); - } - function Vdb() { - gz.call(this); - } - function Ydb() { - gz.call(this); - } - function Geb() { - gz.call(this); - } - function bgb() { - gz.call(this); - } - function Apb() { - gz.call(this); - } - function Jpb() { - gz.call(this); - } - function utb() { - gz.call(this); - } - function x2c() { - gz.call(this); - } - function rQd() { - this.a = this; - } - function MPd() { - this.Bb |= 256; - } - function tTb() { - this.b = new mt(); - } - function fA() { - fA = ccb; - new Lqb(); - } - function rcb() { - pcb.call(this); - } - function dCb(a, b) { - a.length = b; - } - function Tvb(a, b) { - Ekb(a.a, b); - } - function sKb(a, b) { - UHb(a.c, b); - } - function SMc(a, b) { - Qqb(a.b, b); - } - function vBd(a, b) { - uAd(a.a, b); - } - function wBd(a, b) { - vAd(a.a, b); - } - function GLd(a, b) { - Uhd(a.e, b); - } - function d7d(a) { - D2d(a.c, a.b); - } - function mj(a, b) { - a.kc().Nb(b); - } - function Odb(a) { - this.a = Tdb(a); - } - function Tqb() { - this.a = new Lqb(); - } - function gyb() { - this.a = new Lqb(); - } - function Wvb() { - this.a = new Rkb(); - } - function KFb() { - this.a = new Rkb(); - } - function PFb() { - this.a = new Rkb(); - } - function FFb() { - this.a = new yFb(); - } - function pGb() { - this.a = new MFb(); - } - function ZQb() { - this.a = new MQb(); - } - function Gxb() { - this.a = new Pwb(); - } - function jUb() { - this.a = new PTb(); - } - function sDb() { - this.a = new oDb(); - } - function zDb() { - this.a = new tDb(); - } - function CWb() { - this.a = new Rkb(); - } - function HXb() { - this.a = new Rkb(); - } - function nYb() { - this.a = new Rkb(); - } - function BYb() { - this.a = new Rkb(); - } - function fLb() { - this.d = new Rkb(); - } - function vYb() { - this.a = new Tqb(); - } - function a2b() { - this.a = new Lqb(); - } - function wZb() { - this.b = new Lqb(); - } - function TCc() { - this.b = new Rkb(); - } - function zJc() { - this.e = new Rkb(); - } - function uMc() { - this.d = new Rkb(); - } - function wdc() { - this.a = new xkc(); - } - function vKc() { - Rkb.call(this); - } - function twb() { - Wvb.call(this); - } - function oHb() { - $Gb.call(this); - } - function LXb() { - HXb.call(this); - } - function L_b() { - H_b.call(this); - } - function H_b() { - A_b.call(this); - } - function p0b() { - A_b.call(this); - } - function s0b() { - p0b.call(this); - } - function WMc() { - VMc.call(this); - } - function bNc() { - VMc.call(this); - } - function EPc() { - CPc.call(this); - } - function JPc() { - CPc.call(this); - } - function OPc() { - CPc.call(this); - } - function w1c() { - s1c.call(this); - } - function s7c() { - Psb.call(this); - } - function apd() { - Ald.call(this); - } - function ppd() { - Ald.call(this); - } - function lDd() { - YCd.call(this); - } - function NDd() { - YCd.call(this); - } - function mFd() { - Lqb.call(this); - } - function vFd() { - Lqb.call(this); - } - function GFd() { - Lqb.call(this); - } - function KPd() { - Tqb.call(this); - } - function OJd() { - hJd.call(this); - } - function aQd() { - MPd.call(this); - } - function SSd() { - FId.call(this); - } - function rUd() { - FId.call(this); - } - function oUd() { - Lqb.call(this); - } - function NYd() { - Lqb.call(this); - } - function cZd() { - Lqb.call(this); - } - function R8d() { - MGd.call(this); - } - function o9d() { - MGd.call(this); - } - function i9d() { - R8d.call(this); - } - function hee() { - ude.call(this); - } - function Dd(a) { - yd.call(this, a); - } - function Hd(a) { - yd.call(this, a); - } - function ph(a) { - lh.call(this, a); - } - function Sh(a) { - Wc.call(this, a); - } - function oi(a) { - Sh.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: + 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; + }(); + parser22.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser22; + parser22.Parser = Parser3; + return new Parser3(); + }(); + parser6.parser = parser6; + gantt_default = parser6; + } + }); + + // ../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/isoWeek.js + var require_isoWeek = __commonJS({ + "../../node_modules/.pnpm/dayjs@1.11.13/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.13/node_modules/dayjs/plugin/customParseFormat.js + var require_customParseFormat = __commonJS({ + "../../node_modules/.pnpm/dayjs@1.11.13/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|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n2 = /\d/, r2 = /\d\d/, i2 = /\d\d?/, o2 = /\d*[^-_:/,()\s\d]+/, s2 = {}, a2 = /* @__PURE__ */ __name(function(e4) { + return (e4 = +e4) + (e4 > 68 ? 1900 : 2e3); + }, "a"); + var f3 = /* @__PURE__ */ __name(function(e4) { + return function(t5) { + this[e4] = +t5; + }; + }, "f"), h2 = [/[+-]\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); + }], u2 = /* @__PURE__ */ __name(function(e4) { + var t5 = s2[e4]; + return t5 && (t5.indexOf ? t5 : t5.s.concat(t5.f)); + }, "u"), d2 = /* @__PURE__ */ __name(function(e4, t5) { + var n3, r3 = s2.meridiem; + if (r3) { + for (var i3 = 1; i3 <= 24; i3 += 1) if (e4.indexOf(r3(i3, 0, t5)) > -1) { + n3 = i3 > 12; + break; } - function Ii(a) { - Wc.call(this, a); + } else n3 = e4 === (t5 ? "pm" : "PM"); + return n3; + }, "d"), c3 = { A: [o2, function(e4) { + this.afternoon = d2(e4, false); + }], a: [o2, function(e4) { + this.afternoon = d2(e4, true); + }], Q: [n2, function(e4) { + this.month = 3 * (e4 - 1) + 1; + }], S: [n2, function(e4) { + this.milliseconds = 100 * +e4; + }], SS: [r2, function(e4) { + this.milliseconds = 10 * +e4; + }], SSS: [/\d{3}/, function(e4) { + this.milliseconds = +e4; + }], s: [i2, f3("seconds")], ss: [i2, f3("seconds")], m: [i2, f3("minutes")], mm: [i2, f3("minutes")], H: [i2, f3("hours")], h: [i2, f3("hours")], HH: [i2, f3("hours")], hh: [i2, f3("hours")], D: [i2, f3("day")], DD: [r2, f3("day")], Do: [o2, function(e4) { + var t5 = s2.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); + }], w: [i2, f3("week")], ww: [r2, f3("week")], M: [i2, f3("month")], MM: [r2, f3("month")], MMM: [o2, function(e4) { + var t5 = u2("months"), n3 = (u2("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: [o2, function(e4) { + var t5 = u2("months").indexOf(e4) + 1; + if (t5 < 1) throw new Error(); + this.month = t5 % 12 || t5; + }], Y: [/[+-]?\d+/, f3("year")], YY: [r2, function(e4) { + this.year = a2(e4); + }], YYYY: [/\d{4}/, f3("year")], Z: h2, ZZ: h2 }; + function l2(n3) { + var r3, i3; + r3 = n3, i3 = s2 && s2.formats; + for (var o3 = (n3 = r3.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(t5, n4, r4) { + var o4 = r4 && r4.toUpperCase(); + return n4 || i3[r4] || e3[r4] || i3[o4].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(e4, t6, n5) { + return t6 || n5.slice(1); + }); + })).match(t4), a3 = o3.length, f4 = 0; f4 < a3; f4 += 1) { + var h3 = o3[f4], u3 = c3[h3], d3 = u3 && u3[0], l3 = u3 && u3[1]; + o3[f4] = l3 ? { regex: d3, parser: l3 } : h3.replace(/^\[|\]$/g, ""); + } + return function(e4) { + for (var t5 = {}, n4 = 0, r4 = 0; n4 < a3; n4 += 1) { + var i4 = o3[n4]; + if ("string" == typeof i4) r4 += i4.length; + else { + var s3 = i4.regex, f5 = i4.parser, h4 = e4.slice(r4), u4 = s3.exec(h4)[0]; + f5.call(t5, u4), e4 = e4.replace(u4, ""); + } + } + 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(l2, "l"); + return function(e4, t5, n3) { + n3.p.customParseFormat = true, e4 && e4.parseTwoDigitYear && (a2 = e4.parseTwoDigitYear); + var r3 = t5.prototype, i3 = r3.parse; + r3.parse = function(e6) { + var t6 = e6.date, r4 = e6.utc, o3 = e6.args; + this.$u = r4; + var a3 = o3[1]; + if ("string" == typeof a3) { + var f4 = true === o3[2], h3 = true === o3[3], u3 = f4 || h3, d3 = o3[2]; + h3 && (d3 = o3[2]), s2 = this.$locale(), !f4 && d3 && (s2 = n3.Ls[d3]), this.$d = function(e7, t7, n4, r5) { + try { + if (["x", "X"].indexOf(t7) > -1) return new Date(("X" === t7 ? 1e3 : 1) * e7); + var i4 = l2(t7)(e7), o4 = i4.year, s3 = i4.month, a4 = i4.day, f5 = i4.hours, h4 = i4.minutes, u4 = i4.seconds, d4 = i4.milliseconds, c5 = i4.zone, m3 = i4.week, M3 = /* @__PURE__ */ new Date(), Y3 = a4 || (o4 || s3 ? 1 : M3.getDate()), p3 = o4 || M3.getFullYear(), v3 = 0; + o4 && !s3 || (v3 = s3 > 0 ? s3 - 1 : M3.getMonth()); + var D3, w3 = f5 || 0, g2 = h4 || 0, y5 = u4 || 0, L2 = d4 || 0; + return c5 ? new Date(Date.UTC(p3, v3, Y3, w3, g2, y5, L2 + 60 * c5.offset * 1e3)) : n4 ? new Date(Date.UTC(p3, v3, Y3, w3, g2, y5, L2)) : (D3 = new Date(p3, v3, Y3, w3, g2, y5, L2), m3 && (D3 = r5(D3).week(m3).toDate()), D3); + } catch (e8) { + return /* @__PURE__ */ new Date(""); + } + }(t6, a3, r4, n3), this.init(), d3 && true !== d3 && (this.$L = this.locale(d3).$L), u3 && t6 != this.format(a3) && (this.$d = /* @__PURE__ */ new Date("")), s2 = {}; + } else if (a3 instanceof Array) for (var c4 = a3.length, m2 = 1; m2 <= c4; m2 += 1) { + o3[1] = a3[m2 - 1]; + var M2 = n3.apply(this, o3); + if (M2.isValid()) { + this.$d = M2.$d, this.$L = M2.$L, this.init(); + break; + } + m2 === c4 && (this.$d = /* @__PURE__ */ new Date("")); } - function Zdd() { - this.a = new Psb(); + else i3.call(this, e6); + }; + }; + }); + } + }); + + // ../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/advancedFormat.js + var require_advancedFormat = __commonJS({ + "../../node_modules/.pnpm/dayjs@1.11.13/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 regex2 = new RegExp(pattern); + if (data5[0].match(regex2)) { + 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 id27 of afterStatement.groups.ids.split(" ")) { + let task = findTaskById(id27); + 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 id27 of untilStatement.groups.ids.split(" ")) { + let task = findTaskById(id27); + 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(id27) { + const pos = taskDb[id27]; + 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 CPc() { - this.a = new Tqb(); + 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(id27) { + let rawTask = findTaskById(id27); + if (rawTask !== void 0) { + pushFun(id27, () => { + window.open(linkStr, "_self"); + }); + links.set(id27, linkStr); + } + }); + setClass2(ids, "clickable"); + }, "setLink"); + setClass2 = /* @__PURE__ */ __name(function(ids, className) { + ids.split(",").forEach(function(id27) { + let rawTask = findTaskById(id27); + if (rawTask !== void 0) { + rawTask.classes.push(className); + } + }); + }, "setClass"); + setClickFun2 = /* @__PURE__ */ __name(function(id27, 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 s1c() { - this.a = new Lqb(); + argList[i2] = item; + } + } + if (argList.length === 0) { + argList.push(id27); + } + let rawTask = findTaskById(id27); + if (rawTask !== void 0) { + pushFun(id27, () => { + utils_default2.runFunc(functionName, ...argList); + }); + } + }, "setClickFun"); + pushFun = /* @__PURE__ */ __name(function(id27, callbackFunction) { + funs2.push( + function() { + const elem = document.querySelector(`[id="${id27}"]`); + if (elem !== null) { + elem.addEventListener("click", function() { + callbackFunction(); + }); } - function QSc() { - this.a = new Rkb(); + }, + function() { + const elem = document.querySelector(`[id="${id27}-text"]`); + if (elem !== null) { + elem.addEventListener("click", function() { + callbackFunction(); + }); } - function D2c() { - this.j = new Rkb(); + } + ); + }, "pushFun"); + setClickEvent2 = /* @__PURE__ */ __name(function(ids, functionName, functionArgs) { + ids.split(",").forEach(function(id27) { + setClickFun2(id27, 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 QXc() { - this.a = new UXc(); + } + } + return maxIntersections; + }, "getMaxIntersections"); + draw5 = /* @__PURE__ */ __name(function(text2, id27, version4, diagObj) { + const conf8 = getConfig2().gantt; + const securityLevel = getConfig2().securityLevel; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id27); + } + 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(id27); + 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 e_c() { - this.a = new d_c(); + } + 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="${id27}"]`); + 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((id28) => theArray.find((item) => item.order === id28)); + 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 YCd() { - this.a = new aDd(); + if (taskClass.length === 0) { + taskClass = " task"; } - function _k() { - _k = ccb; - $k = new al(); + if (d2.milestone) { + taskClass = " milestone " + taskClass; } - function Lk() { - Lk = ccb; - Kk = new Mk(); + 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 wb() { - wb = ccb; - vb = new xb(); + if (d2.done) { + if (d2.crit) { + taskType = taskType + " doneCritText" + secNum; + } else { + taskType = taskType + " doneText" + secNum; + } + } else { + if (d2.crit) { + taskType = taskType + " critText" + secNum; + } } - function hs() { - hs = ccb; - gs = new is(); + if (d2.milestone) { + taskType += " milestoneText"; } - function rs(a) { - Sh.call(this, a); + 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 Gp(a) { - Sh.call(this, a); + }); + const securityLevel2 = getConfig2().securityLevel; + if (securityLevel2 === "sandbox") { + let sandboxElement2; + sandboxElement2 = select_default2("#i" + id27); + 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 xp(a) { - Lo.call(this, a); + if (maxTime === void 0 || endTime > maxTime) { + maxTime = endTime; } - function Ep(a) { - Lo.call(this, a); + } + 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 Tp(a) { - Wn.call(this, a); + } + 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 wx(a) { - un.call(this, a); + 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 ov(a) { - dv.call(this, a); + 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 Mv(a) { - Br.call(this, a); + }).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 Ov(a) { - Br.call(this, a); + 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 Lw(a) { - Br.call(this, a); - } - function hz(a) { - Yy.call(this, a); - } - function MB(a) { - hz.call(this, a); - } - function eC() { - fC.call(this, {}); - } - function Ftb(a) { - Atb(); - this.a = a; - } - function zwb(a) { - a.b = null; - a.c = 0; - } - function Vy(a, b) { - a.e = b; - Sy(a, b); - } - function LVb(a, b) { - a.a = b; - NVb(a); - } - function lIb(a, b, c2) { - a.a[b.g] = c2; - } - function vfd(a, b, c2) { - Dfd(c2, a, b); - } - function Odc(a, b) { - rjc(b.i, a.n); - } - function Wyc(a, b) { - Xyc(a).td(b); - } - function ERb(a, b) { - return a * a / b; - } - function Xr(a, b) { - return a.g - b.g; - } - function tC(a) { - return new TB(a); - } - function vC(a) { - return new yC(a); - } - function ocb(a) { - hz.call(this, a); - } - function qcb(a) { - hz.call(this, a); - } - function ucb(a) { - hz.call(this, a); - } - function vcb(a) { - Yy.call(this, a); - } - function fGc(a) { - LFc(); - this.a = a; - } - function c0d(a) { - kzd(); - this.a = a; - } - function bhd(a) { - Rgd(); - this.f = a; - } - function dhd(a) { - Rgd(); - this.f = a; - } - function Cdb(a) { - hz.call(this, a); - } - function Wdb(a) { - hz.call(this, a); - } - function Zdb(a) { - hz.call(this, a); - } - function Feb(a) { - hz.call(this, a); - } - function Heb(a) { - hz.call(this, a); - } - function Ccb(a) { - return uCb(a), a; - } - function Edb(a) { - return uCb(a), a; - } - function Gdb(a) { - return uCb(a), a; - } - function jfb(a) { - return uCb(a), a; - } - function tfb(a) { - return uCb(a), a; - } - function akb(a) { - return a.b == a.c; - } - function Hwb(a) { - return !!a && a.b; - } - function pIb(a) { - return !!a && a.k; - } - function qIb(a) { - return !!a && a.j; - } - function amb(a) { - uCb(a); - this.a = a; - } - function wVb(a) { - qVb(a); - return a; - } - function Blb(a) { - Glb(a, a.length); - } - function cgb(a) { - hz.call(this, a); - } - function cqd(a) { - hz.call(this, a); - } - function n8d(a) { - hz.call(this, a); - } - function y2c(a) { - hz.call(this, a); - } - function z2c(a) { - hz.call(this, a); - } - function mde(a) { - hz.call(this, a); - } - function pc(a) { - qc.call(this, a, 0); - } - function Ji() { - Ki.call(this, 12, 3); - } - function Kz() { - Kz = ccb; - Jz = new Nz(); - } - function jz() { - jz = ccb; - iz = new nb(); - } - function KA() { - KA = ccb; - JA = new MA(); - } - function OB() { - OB = ccb; - NB = new PB(); - } - function jc() { - throw vbb(new bgb()); - } - function zh() { - throw vbb(new bgb()); - } - function Pi() { - throw vbb(new bgb()); - } - function Pj() { - throw vbb(new bgb()); - } - function Qj() { - throw vbb(new bgb()); - } - function Ym() { - throw vbb(new bgb()); - } - function Gb() { - this.a = GD(Qb(She)); - } - function oy(a) { - Ql(); - this.a = Qb(a); - } - function Bs(a, b) { - a.Td(b); - b.Sd(a); - } - function iw(a, b) { - a.a.ec().Mc(b); - } - function CYb(a, b, c2) { - a.c.lf(b, c2); - } - function scb(a) { - qcb.call(this, a); - } - function Oeb(a) { - Wdb.call(this, a); - } - function Hfb() { - mcb.call(this, ""); - } - function Ifb() { - mcb.call(this, ""); - } - function Ufb() { - mcb.call(this, ""); - } - function Vfb() { - mcb.call(this, ""); - } - function Xfb(a) { - qcb.call(this, a); - } - function zob(a) { - lnb.call(this, a); - } - function Yob(a) { - Inb.call(this, a); - } - function Gob(a) { - zob.call(this, a); - } - function Mk() { - Fk.call(this, null); - } - function al() { - Fk.call(this, null); - } - function Az() { - Az = ccb; - !!(Rz(), Qz); - } - function wrb() { - wrb = ccb; - vrb = yrb(); - } - function Mtb(a) { - return a.a ? a.b : 0; - } - function Vtb(a) { - return a.a ? a.b : 0; - } - function Lcb(a, b) { - return a.a - b.a; - } - function Wcb(a, b) { - return a.a - b.a; - } - function Peb(a, b) { - return a.a - b.a; - } - function eCb(a, b) { - return PC(a, b); - } - function GC(a, b) { - return rdb(a, b); - } - function _B(b, a) { - return a in b.a; - } - function _Db(a, b) { - a.f = b; - return a; - } - function ZDb(a, b) { - a.b = b; - return a; - } - function $Db(a, b) { - a.c = b; - return a; - } - function aEb(a, b) { - a.g = b; - return a; - } - function HGb(a, b) { - a.a = b; - return a; - } - function IGb(a, b) { - a.f = b; - return a; - } - function JGb(a, b) { - a.k = b; - return a; - } - function dLb(a, b) { - a.a = b; - return a; - } - function eLb(a, b) { - a.e = b; - return a; - } - function zVb(a, b) { - a.e = b; - return a; - } - function AVb(a, b) { - a.f = b; - return a; - } - function KOb(a, b) { - a.b = true; - a.d = b; - } - function DHb(a, b) { - a.b = new g7c(b); - } - function uvb(a, b, c2) { - b.td(a.a[c2]); - } - function zvb(a, b, c2) { - b.we(a.a[c2]); - } - function wJc(a, b) { - return a.b - b.b; - } - function kOc(a, b) { - return a.g - b.g; - } - function WQc(a, b) { - return a.s - b.s; - } - function Lic(a, b) { - return a ? 0 : b - 1; - } - function SFc(a, b) { - return a ? 0 : b - 1; - } - function RFc(a, b) { - return a ? b - 1 : 0; - } - function M2c(a, b) { - return b.Yf(a); - } - function M3c(a, b) { - a.b = b; - return a; - } - function L3c(a, b) { - a.a = b; - return a; - } - function N3c(a, b) { - a.c = b; - return a; - } - function O3c(a, b) { - a.d = b; - return a; - } - function P3c(a, b) { - a.e = b; - return a; - } - function Q3c(a, b) { - a.f = b; - return a; - } - function b4c(a, b) { - a.a = b; - return a; - } - function c4c(a, b) { - a.b = b; - return a; - } - function d4c(a, b) { - a.c = b; - return a; - } - function z5c(a, b) { - a.c = b; - return a; - } - function y5c(a, b) { - a.b = b; - return a; - } - function A5c(a, b) { - a.d = b; - return a; - } - function B5c(a, b) { - a.e = b; - return a; - } - function C5c(a, b) { - a.f = b; - return a; - } - function D5c(a, b) { - a.g = b; - return a; - } - function E5c(a, b) { - a.a = b; - return a; - } - function F5c(a, b) { - a.i = b; - return a; - } - function G5c(a, b) { - a.j = b; - return a; - } - function Vdd(a, b) { - a.k = b; - return a; - } - function Wdd(a, b) { - a.j = b; - return a; - } - function ykc(a, b) { - gkc(); - F0b(b, a); - } - function T$c(a, b, c2) { - R$c(a.a, b, c2); - } - function RGc(a) { - cEc.call(this, a); - } - function iHc(a) { - cEc.call(this, a); - } - function t7c(a) { - Qsb.call(this, a); - } - function aPb(a) { - _Ob.call(this, a); - } - function Ixd(a) { - zud.call(this, a); - } - function dCd(a) { - ZBd.call(this, a); - } - function fCd(a) { - ZBd.call(this, a); - } - function p_b() { - q_b.call(this, ""); - } - function d7c() { - this.a = 0; - this.b = 0; - } - function aPc() { - this.b = 0; - this.a = 0; - } - function NJd(a, b) { - a.b = 0; - DId(a, b); - } - function X1d(a, b) { - a.c = b; - a.b = true; - } - function Oc(a, b) { - return a.c._b(b); - } - function gdb(a) { - return a.e && a.e(); - } - function Vd(a) { - return !a ? null : a.d; - } - function sn(a, b) { - return Gv(a.b, b); - } - function Fv(a) { - return !a ? null : a.g; - } - function Kv(a) { - return !a ? null : a.i; - } - function hdb(a) { - fdb(a); - return a.o; - } - function Fhd() { - Fhd = ccb; - Ehd = ond(); - } - function Hhd() { - Hhd = ccb; - Ghd = Cod(); - } - function LFd() { - LFd = ccb; - KFd = qZd(); - } - function p8d() { - p8d = ccb; - o8d = Y9d(); - } - function r8d() { - r8d = ccb; - q8d = dae(); - } - function mvd() { - mvd = ccb; - lvd = n4c(); - } - function Srb() { - throw vbb(new bgb()); - } - function enb() { - throw vbb(new bgb()); - } - function fnb() { - throw vbb(new bgb()); - } - function gnb() { - throw vbb(new bgb()); - } - function jnb() { - throw vbb(new bgb()); - } - function Cnb() { - throw vbb(new bgb()); - } - function Uqb(a) { - this.a = new Mqb(a); - } - function tgb(a) { - lgb(); - ngb(this, a); - } - function Hxb(a) { - this.a = new Qwb(a); - } - function _ub(a, b) { - while (a.ye(b)) - ; - } - function Sub(a, b) { - while (a.sd(b)) - ; - } - function Bfb(a, b) { - a.a += b; - return a; - } - function Cfb(a, b) { - a.a += b; - return a; + } + 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.2.0"; + } + }); + + // 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((id27) => { + const { securityLevel } = getConfig2(); + let root4 = select_default2("body"); + if (securityLevel === "sandbox") { + const sandboxElement = select_default2(`#i${id27}`); + const doc = sandboxElement.node()?.contentDocument ?? document; + root4 = select_default2(doc.body); + } + const svg = root4.select(`#${id27}`); + 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, id27, version4) => { + log.debug("rendering info diagram\n" + text2); + const svg = selectSvgElement(id27); + 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, db8) => { + populateCommonDb(ast, db8); + db8.setShowData(ast.showData); + ast.sections.map(db8.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, id27, _version, diagObj) => { + log.debug("rendering pie chart\n" + text2); + const db8 = diagObj.db; + const globalConfig = getConfig2(); + const pieConfig = cleanAndMerge(db8.getConfig(), globalConfig.pie); + const MARGIN = 40; + const LEGEND_RECT_SIZE = 18; + const LEGEND_SPACING = 4; + const height2 = 450; + const pieWidth = height2; + const svg = selectSvgElement(id27); + 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 = db8.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(db8.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 (db8.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 parser22 = { + 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 Ffb(a, b) { - a.a += b; - return a; + }, "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 Lfb(a, b) { - a.a += b; - return a; + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - function WAb(a) { - Tzb(a); - return 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 Wsb(a) { - return a.b != a.d.c; + __name(lex2, "lex"); + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state5] && table[state5][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state5]) { + 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: " + state5 + ", 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 pD(a) { - return a.l | a.m << 22; - } - function aIc(a, b) { - return a.d[b.p]; - } - function h2c(a, b) { - return c2c(a, b); - } - function cCb(a, b, c2) { - a.splice(b, c2); - } - function WHb(a) { - a.c ? VHb(a) : XHb(a); - } - function jVc(a) { - this.a = 0; - this.b = a; - } - function ZUc() { - this.a = new L2c(K$); - } - function tRc() { - this.b = new L2c(h$); - } - function Q$c() { - this.b = new L2c(J_); - } - function d_c() { - this.b = new L2c(J_); + 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; + }(); + parser22.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser22; + parser22.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 + } + ]; + 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 + } + ]; + 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, id27, _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" + id27); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const svg = root4.select(`[id="${id27}"]`); + 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 parser22 = { + 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 OCd() { - throw vbb(new bgb()); + }, "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 PCd() { - throw vbb(new bgb()); + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - function QCd() { - throw vbb(new bgb()); + __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 RCd() { - throw vbb(new bgb()); + __name(lex2, "lex"); + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state5] && table[state5][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state5]) { + 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: " + state5 + ", 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 SCd() { - throw vbb(new bgb()); + 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; + }(); + parser22.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser22; + parser22.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 TCd() { - throw vbb(new bgb()); - } - function UCd() { - throw vbb(new bgb()); - } - function VCd() { - throw vbb(new bgb()); - } - function WCd() { - throw vbb(new bgb()); - } - function XCd() { - throw vbb(new bgb()); - } - function ahe() { - throw vbb(new utb()); - } - function bhe() { - throw vbb(new utb()); - } - function Rge(a) { - this.a = new ege(a); - } - function ege(a) { - dge(this, a, Vee()); - } - function Fhe(a) { - return !a || Ehe(a); - } - function dde(a) { - return $ce[a] != -1; - } - function Iz() { - xz != 0 && (xz = 0); - zz = -1; - } - function Ybb() { - Wbb == null && (Wbb = []); - } - function ONd(a, b) { - Rxd(ZKd(a.a), b); - } - function TNd(a, b) { - Rxd(ZKd(a.a), b); - } - function Yf(a, b) { - zf.call(this, a, b); - } - function $f(a, b) { - Yf.call(this, a, b); - } - function Hf(a, b) { - this.b = a; - this.c = b; - } - function rk(a, b) { - this.b = a; - this.a = b; - } - function ek(a, b) { - this.a = a; - this.b = b; - } - function gk(a, b) { - this.a = a; - this.b = b; - } - function pk(a, b) { - this.a = a; - this.b = b; - } - function yk(a, b) { - this.a = a; - this.b = b; - } - function Ak(a, b) { - this.a = a; - this.b = b; - } - function Fj(a, b) { - this.a = a; - this.b = b; - } - function _j(a, b) { - this.a = a; - this.b = b; - } - function dr(a, b) { - this.a = a; - this.b = b; - } - function zr(a, b) { - this.b = a; - this.a = b; - } - function So(a, b) { - this.b = a; - this.a = b; - } - function qp(a, b) { - this.b = a; - this.a = b; - } - function $q(a, b) { - this.b = a; - this.a = b; - } - function $r(a, b) { - this.f = a; - this.g = b; - } - function ne(a, b) { - this.e = a; - this.d = b; - } - function Wo(a, b) { - this.g = a; - this.i = b; - } - function bu(a, b) { - this.a = a; - this.b = b; - } - function qu(a, b) { - this.a = a; - this.f = b; - } - function qv(a, b) { - this.b = a; - this.c = b; - } - function ox(a, b) { - this.a = a; - this.b = b; - } - function Px(a, b) { - this.a = a; - this.b = b; - } - function mC(a, b) { - this.a = a; - this.b = b; - } - function Wc(a) { - Lb(a.dc()); - this.c = a; - } - function rf(a) { - this.b = BD(Qb(a), 83); - } - function Zv(a) { - this.a = BD(Qb(a), 83); - } - function dv(a) { - this.a = BD(Qb(a), 15); - } - function $u(a) { - this.a = BD(Qb(a), 15); - } - function Br(a) { - this.b = BD(Qb(a), 47); - } - function eB() { - this.q = new $wnd.Date(); - } - function Zfb() { - Zfb = ccb; - Yfb = new jcb(); - } - function Emb() { - Emb = ccb; - Dmb = new Fmb(); - } - function Vhb(a) { - return a.f.c + a.g.c; - } - function hnb(a, b) { - return a.b.Hc(b); - } - function inb(a, b) { - return a.b.Ic(b); - } - function knb(a, b) { - return a.b.Qc(b); - } - function Dob(a, b) { - return a.b.Hc(b); - } - function dob(a, b) { - return a.c.uc(b); - } - function Rqb(a, b) { - return a.a._b(b); - } - function fob(a, b) { - return pb(a.c, b); - } - function jt(a, b) { - return Mhb(a.b, b); - } - function Lp(a, b) { - return a > b && b < Iie; - } - function Ryb(a, b) { - return a.Gc(b), a; - } - function Syb(a, b) { - return ye(a, b), a; - } - function sC(a) { - return GB(), a ? FB : EB; - } - function Mqb(a) { - Whb.call(this, a, 0); - } - function Pwb() { - Qwb.call(this, null); - } - function yAb() { - Vzb.call(this, null); - } - function Gqb(a) { - this.c = a; - Dqb(this); - } - function Psb() { - Csb(this); - Osb(this); - } - function MAb(a, b) { - Tzb(a); - a.a.Nb(b); - } - function Myb(a, b) { - a.Gc(b); - return a; - } - function qDb(a, b) { - a.a.f = b; - return a; - } - function wDb(a, b) { - a.a.d = b; - return a; - } - function xDb(a, b) { - a.a.g = b; - return a; - } - function yDb(a, b) { - a.a.j = b; - return a; - } - function BFb(a, b) { - a.a.a = b; - return a; - } - function CFb(a, b) { - a.a.d = b; - return a; - } - function DFb(a, b) { - a.a.e = b; - return a; - } - function EFb(a, b) { - a.a.g = b; - return a; - } - function oGb(a, b) { - a.a.f = b; - return a; - } - function TGb(a) { - a.b = false; - return a; - } - function Ltb() { - Ltb = ccb; - Ktb = new Otb(); - } - function Utb() { - Utb = ccb; - Ttb = new Wtb(); - } - function $xb() { - $xb = ccb; - Zxb = new byb(); - } - function $Yb() { - $Yb = ccb; - ZYb = new dZb(); - } - function cPb() { - cPb = ccb; - bPb = new dPb(); - } - function EAb() { - EAb = ccb; - DAb = new PBb(); - } - function a$b() { - a$b = ccb; - _Zb = new P$b(); - } - function FDb() { - FDb = ccb; - EDb = new GDb(); - } - function xUb() { - xUb = ccb; - wUb = new DUb(); - } - function x2b() { - x2b = ccb; - w2b = new d7c(); - } - function iVb() { - iVb = ccb; - hVb = new jVb(); - } - function nVb() { - nVb = ccb; - mVb = new OVb(); - } - function LWb() { - LWb = ccb; - KWb = new QWb(); - } - function b4b() { - b4b = ccb; - a4b = new l4b(); - } - function q9b() { - q9b = ccb; - p9b = new w9b(); - } - function qgc() { - qgc = ccb; - pgc = new dic(); - } - function Imc() { - Imc = ccb; - Hmc = new Wmc(); - } - function GUc() { - GUc = ccb; - FUc = new j3c(); - } - function i_c() { - i_c = ccb; - h_c = new k_c(); - } - function s_c() { - s_c = ccb; - r_c = new t_c(); - } - function R0c() { - R0c = ccb; - Q0c = new T0c(); - } - function Vyc() { - Vyc = ccb; - Uyc = new Ved(); - } - function DCc() { - vCc(); - this.c = new Ji(); - } - function k_c() { - $r.call(this, Une, 0); - } - function r4c(a, b) { - Xrb(a.c.b, b.c, b); - } - function s4c(a, b) { - Xrb(a.c.c, b.b, b); - } - function B3c(a, b, c2) { - Shb(a.d, b.f, c2); - } - function kKb(a, b, c2, d) { - jKb(a, d, b, c2); - } - function E3b(a, b, c2, d) { - J3b(d, a, b, c2); - } - function e9b(a, b, c2, d) { - f9b(d, a, b, c2); - } - function g3c(a, b) { - a.a = b.g; - return a; - } - function DQd(a, b) { - return qA(a.a, b); - } - function nQd(a) { - return a.b ? a.b : a.a; - } - function $Oc(a) { - return (a.c + a.a) / 2; - } - function Pgd() { - Pgd = ccb; - Ogd = new Ahd(); - } - function AFd() { - AFd = ccb; - zFd = new BFd(); - } - function tFd() { - tFd = ccb; - sFd = new vFd(); - } - function EFd() { - EFd = ccb; - DFd = new GFd(); - } - function yFd() { - yFd = ccb; - xFd = new oUd(); - } - function JFd() { - JFd = ccb; - IFd = new cZd(); - } - function nRd() { - nRd = ccb; - mRd = new u4d(); - } - function LRd() { - LRd = ccb; - KRd = new y4d(); - } - function g5d() { - g5d = ccb; - f5d = new h5d(); - } - function Q6d() { - Q6d = ccb; - P6d = new U6d(); - } - function pEd() { - pEd = ccb; - oEd = new Lqb(); - } - function tZd() { - tZd = ccb; - rZd = new Rkb(); - } - function Xge() { - Xge = ccb; - Wge = new dhe(); - } - function Hz(a) { - $wnd.clearTimeout(a); - } - function jw(a) { - this.a = BD(Qb(a), 224); - } - function Lv(a) { - return BD(a, 42).cd(); - } - function sib(a) { - return a.b < a.d.gc(); - } - function Lpb(a, b) { - return tqb(a.a, b); - } - function Dbb(a, b) { - return ybb(a, b) > 0; - } - function Gbb(a, b) { - return ybb(a, b) < 0; - } - function Crb(a, b) { - return a.a.get(b); - } - function icb(b, a) { - return a.split(b); - } - function Vrb(a, b) { - return Mhb(a.e, b); - } - function Nvb(a) { - return uCb(a), false; - } - function Rub(a) { - Kub.call(this, a, 21); - } - function wcb(a, b) { - Zy.call(this, a, b); - } - function mxb(a, b) { - $r.call(this, a, b); - } - function Gyb(a, b) { - $r.call(this, a, b); - } - function zx(a) { - yx(); - Wn.call(this, a); - } - function zlb(a, b) { - Dlb(a, a.length, b); - } - function Alb(a, b) { - Flb(a, a.length, b); - } - function ABb(a, b, c2) { - b.ud(a.a.Ge(c2)); - } - function uBb(a, b, c2) { - b.we(a.a.Fe(c2)); - } - function GBb(a, b, c2) { - b.td(a.a.Kb(c2)); - } - function Zq(a, b, c2) { - a.Mb(c2) && b.td(c2); - } - function aCb(a, b, c2) { - a.splice(b, 0, c2); - } - function lDb(a, b) { - return uqb(a.e, b); - } - function pjb(a, b) { - this.d = a; - this.e = b; - } - function kqb(a, b) { - this.b = a; - this.a = b; - } - function VBb(a, b) { - this.b = a; - this.a = b; - } - function BEb(a, b) { - this.b = a; - this.a = b; - } - function sBb(a, b) { - this.a = a; - this.b = b; - } - function yBb(a, b) { - this.a = a; - this.b = b; - } - function EBb(a, b) { - this.a = a; - this.b = b; - } - function KBb(a, b) { - this.a = a; - this.b = b; - } - function aDb(a, b) { - this.a = a; - this.b = b; - } - function tMb(a, b) { - this.b = a; - this.a = b; - } - function oOb(a, b) { - this.b = a; - this.a = b; - } - function SOb(a, b) { - $r.call(this, a, b); - } - function SMb(a, b) { - $r.call(this, a, b); - } - function NEb(a, b) { - $r.call(this, a, b); - } - function VEb(a, b) { - $r.call(this, a, b); - } - function sFb(a, b) { - $r.call(this, a, b); - } - function hHb(a, b) { - $r.call(this, a, b); - } - function OHb(a, b) { - $r.call(this, a, b); - } - function FIb(a, b) { - $r.call(this, a, b); - } - function wLb(a, b) { - $r.call(this, a, b); - } - function YRb(a, b) { - $r.call(this, a, b); - } - function zTb(a, b) { - $r.call(this, a, b); - } - function rUb(a, b) { - $r.call(this, a, b); - } - function oWb(a, b) { - $r.call(this, a, b); - } - function SXb(a, b) { - $r.call(this, a, b); - } - function k0b(a, b) { - $r.call(this, a, b); - } - function z5b(a, b) { - $r.call(this, a, b); - } - function T8b(a, b) { - $r.call(this, a, b); - } - function ibc(a, b) { - $r.call(this, a, b); - } - function Cec(a, b) { - this.a = a; - this.b = b; - } - function rfc(a, b) { - this.a = a; - this.b = b; - } - function Rfc(a, b) { - this.a = a; - this.b = b; - } - function Tfc(a, b) { - this.a = a; - this.b = b; - } - function bgc(a, b) { - this.a = a; - this.b = b; - } - function ngc(a, b) { - this.a = a; - this.b = b; - } - function Qhc(a, b) { - this.a = a; - this.b = b; - } - function $hc(a, b) { - this.a = a; - this.b = b; - } - function Z0b(a, b) { - this.a = a; - this.b = b; - } - function ZVb(a, b) { - this.b = a; - this.a = b; - } - function Dfc(a, b) { - this.b = a; - this.a = b; - } - function dgc(a, b) { - this.b = a; - this.a = b; - } - function Bmc(a, b) { - this.b = a; - this.a = b; - } - function cWb(a, b) { - this.c = a; - this.d = b; - } - function I$b(a, b) { - this.e = a; - this.d = b; - } - function Unc(a, b) { - this.a = a; - this.b = b; - } - function Oic(a, b) { - this.b = b; - this.c = a; - } - function Bjc(a, b) { - $r.call(this, a, b); - } - function Yjc(a, b) { - $r.call(this, a, b); - } - function Gkc(a, b) { - $r.call(this, a, b); - } - function Bpc(a, b) { - $r.call(this, a, b); - } - function Jpc(a, b) { - $r.call(this, a, b); - } - function Tpc(a, b) { - $r.call(this, a, b); - } - function cqc(a, b) { - $r.call(this, a, b); - } - function oqc(a, b) { - $r.call(this, a, b); - } - function yqc(a, b) { - $r.call(this, a, b); - } - function Hqc(a, b) { - $r.call(this, a, b); - } - function Uqc(a, b) { - $r.call(this, a, b); - } - function arc(a, b) { - $r.call(this, a, b); - } - function mrc(a, b) { - $r.call(this, a, b); - } - function zrc(a, b) { - $r.call(this, a, b); - } - function Prc(a, b) { - $r.call(this, a, b); - } - function Yrc(a, b) { - $r.call(this, a, b); - } - function fsc(a, b) { - $r.call(this, a, b); - } - function nsc(a, b) { - $r.call(this, a, b); - } - function nzc(a, b) { - $r.call(this, a, b); - } - function zzc(a, b) { - $r.call(this, a, b); - } - function Kzc(a, b) { - $r.call(this, a, b); - } - function Xzc(a, b) { - $r.call(this, a, b); - } - function Dtc(a, b) { - $r.call(this, a, b); - } - function lAc(a, b) { - $r.call(this, a, b); - } - function uAc(a, b) { - $r.call(this, a, b); - } - function CAc(a, b) { - $r.call(this, a, b); - } - function LAc(a, b) { - $r.call(this, a, b); - } - function UAc(a, b) { - $r.call(this, a, b); - } - function aBc(a, b) { - $r.call(this, a, b); - } - function uBc(a, b) { - $r.call(this, a, b); - } - function DBc(a, b) { - $r.call(this, a, b); - } - function MBc(a, b) { - $r.call(this, a, b); - } - function sGc(a, b) { - $r.call(this, a, b); - } - function VIc(a, b) { - $r.call(this, a, b); - } - function EIc(a, b) { - this.b = a; - this.a = b; - } - function qKc(a, b) { - this.a = a; - this.b = b; - } - function GKc(a, b) { - this.a = a; - this.b = b; - } - function lLc(a, b) { - this.a = a; - this.b = b; - } - function mMc(a, b) { - this.a = a; - this.b = b; - } - function fMc(a, b) { - $r.call(this, a, b); - } - function ZLc(a, b) { - $r.call(this, a, b); - } - function ZMc(a, b) { - this.b = a; - this.d = b; - } - function IOc(a, b) { - $r.call(this, a, b); - } - function GQc(a, b) { - $r.call(this, a, b); - } - function PQc(a, b) { - this.a = a; - this.b = b; + } + 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 RQc(a, b) { - this.a = a; - this.b = b; + ]; + } + }; + } + }); + + // 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 ARc(a, b) { - $r.call(this, a, b); + ]; + } + }; + } + }); + + // 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 rSc(a, b) { - $r.call(this, a, b); + } + 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, id27, _version, diagObj) => { + const db8 = diagObj.db; + const themeConfig = db8.getChartThemeConfig(); + const chartConfig = db8.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(id27); + 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); + db8.setTmpSVGG(svg.append("g").attr("class", "mermaid-tmp-group")); + const shapes5 = db8.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 parser22 = { + 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 TTc(a, b) { - $r.call(this, a, b); + }, "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 _Tc(a, b) { - $r.call(this, a, b); + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - function RUc(a, b) { - $r.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 uVc(a, b) { - $r.call(this, a, b); + __name(lex2, "lex"); + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state5] && table[state5][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state5]) { + 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: " + state5 + ", 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 hWc(a, b) { - $r.call(this, a, b); - } - function rWc(a, b) { - $r.call(this, a, b); - } - function kXc(a, b) { - $r.call(this, a, b); - } - function uXc(a, b) { - $r.call(this, a, b); - } - function AYc(a, b) { - $r.call(this, a, b); - } - function l$c(a, b) { - $r.call(this, a, b); - } - function Z$c(a, b) { - $r.call(this, a, b); - } - function D_c(a, b) { - $r.call(this, a, b); - } - function O_c(a, b) { - $r.call(this, a, b); - } - function c1c(a, b) { - $r.call(this, a, b); - } - function cVb(a, b) { - return uqb(a.c, b); - } - function nnc(a, b) { - return uqb(b.b, a); - } - function x1c(a, b) { - return -a.b.Je(b); - } - function D3c(a, b) { - return uqb(a.g, b); - } - function O5c(a, b) { - $r.call(this, a, b); - } - function a6c(a, b) { - $r.call(this, a, b); - } - function m2c(a, b) { - this.a = a; - this.b = b; - } - function W2c(a, b) { - this.a = a; - this.b = b; - } - function f7c(a, b) { - this.a = a; - this.b = b; - } - function G7c(a, b) { - $r.call(this, a, b); - } - function j8c(a, b) { - $r.call(this, a, b); - } - function iad(a, b) { - $r.call(this, a, b); - } - function rad(a, b) { - $r.call(this, a, b); - } - function Bad(a, b) { - $r.call(this, a, b); - } - function Nad(a, b) { - $r.call(this, a, b); - } - function ibd(a, b) { - $r.call(this, a, b); - } - function tbd(a, b) { - $r.call(this, a, b); - } - function Ibd(a, b) { - $r.call(this, a, b); - } - function Ubd(a, b) { - $r.call(this, a, b); - } - function gcd(a, b) { - $r.call(this, a, b); - } - function scd(a, b) { - $r.call(this, a, b); - } - function Ycd(a, b) { - $r.call(this, a, b); - } - function udd(a, b) { - $r.call(this, a, b); - } - function Jdd(a, b) { - $r.call(this, a, b); - } - function Eed(a, b) { - $r.call(this, a, b); - } - function bfd(a, b) { - this.a = a; - this.b = b; - } - function dfd(a, b) { - this.a = a; - this.b = b; - } - function ffd(a, b) { - this.a = a; - this.b = b; - } - function Kfd(a, b) { - this.a = a; - this.b = b; - } - function Mfd(a, b) { - this.a = a; - this.b = b; - } - function Ofd(a, b) { - this.a = a; - this.b = b; - } - function vgd(a, b) { - this.a = a; - this.b = b; - } - function qgd(a, b) { - $r.call(this, a, b); - } - function jrd(a, b) { - this.a = a; - this.b = b; - } - function krd(a, b) { - this.a = a; - this.b = b; - } - function mrd(a, b) { - this.a = a; - this.b = b; - } - function nrd(a, b) { - this.a = a; - this.b = b; - } - function qrd(a, b) { - this.a = a; - this.b = b; - } - function rrd(a, b) { - this.a = a; - this.b = b; - } - function srd(a, b) { - this.b = a; - this.a = b; - } - function trd(a, b) { - this.b = a; - this.a = b; - } - function Drd(a, b) { - this.b = a; - this.a = b; - } - function Frd(a, b) { - this.b = a; - this.a = b; - } - function Hrd(a, b) { - this.a = a; - this.b = b; - } - function Jrd(a, b) { - this.a = a; - this.b = b; - } - function Ord(a, b) { - Xqd(a.a, BD(b, 56)); - } - function BIc(a, b) { - gIc(a.a, BD(b, 11)); - } - function fIc(a, b) { - FHc(); - return b != a; - } - function Arb() { - wrb(); - return new vrb(); - } - function CMc() { - wMc(); - this.b = new Tqb(); - } - function NNc() { - FNc(); - this.a = new Tqb(); - } - function eCc() { - ZBc(); - aCc.call(this); - } - function Dsd(a, b) { - $r.call(this, a, b); - } - function Urd(a, b) { - this.a = a; - this.b = b; - } - function Wrd(a, b) { - this.a = a; - this.b = b; - } - function kGd(a, b) { - this.a = a; - this.b = b; - } - function nGd(a, b) { - this.a = a; - this.b = b; - } - function bUd(a, b) { - this.a = a; - this.b = b; - } - function zVd(a, b) { - this.a = a; - this.b = b; - } - function C1d(a, b) { - this.d = a; - this.b = b; - } - function MLd(a, b) { - this.d = a; - this.e = b; - } - function Wud(a, b) { - this.f = a; - this.c = b; - } - function f7d(a, b) { - this.b = a; - this.c = b; - } - function _zd(a, b) { - this.i = a; - this.g = b; - } - function Y1d(a, b) { - this.e = a; - this.a = b; - } - function c8d(a, b) { - this.a = a; - this.b = b; - } - function $Id(a, b) { - a.i = null; - _Id(a, b); - } - function ivd(a, b) { - !!a && Rhb(cvd, a, b); - } - function hCd(a, b) { - return qAd(a.a, b); - } - function e7d(a) { - return R2d(a.c, a.b); - } - function Wd(a) { - return !a ? null : a.dd(); - } - function PD(a) { - return a == null ? null : a; - } - function KD(a) { - return typeof a === Khe; - } - function LD(a) { - return typeof a === Lhe; - } - function ND(a) { - return typeof a === Mhe; - } - function Em(a, b) { - return a.Hd().Xb(b); - } - function Kq(a, b) { - return hr(a.Kc(), b); - } - function Bbb(a, b) { - return ybb(a, b) == 0; - } - function Ebb(a, b) { - return ybb(a, b) >= 0; - } - function Kbb(a, b) { - return ybb(a, b) != 0; - } - function Jdb(a) { - return "" + (uCb(a), a); - } - function pfb(a, b) { - return a.substr(b); - } - function cg(a) { - ag(a); - return a.d.gc(); - } - function oVb(a) { - pVb(a, a.c); - return a; - } - function RD(a) { - CCb(a == null); - return a; - } - function Dfb(a, b) { - a.a += "" + b; - return a; - } - function Efb(a, b) { - a.a += "" + b; - return a; - } - function Nfb(a, b) { - a.a += "" + b; - return a; - } - function Pfb(a, b) { - a.a += "" + b; - return a; - } - function Qfb(a, b) { - a.a += "" + b; - return a; - } - function Mfb(a, b) { - return a.a += "" + b, a; - } - function Esb(a, b) { - Gsb(a, b, a.a, a.a.a); - } - function Fsb(a, b) { - Gsb(a, b, a.c.b, a.c); - } - function Mqd(a, b, c2) { - Rpd(b, kqd(a, c2)); - } - function Nqd(a, b, c2) { - Rpd(b, kqd(a, c2)); - } - function Dhe(a, b) { - Hhe(new Fyd(a), b); - } - function cB(a, b) { - a.q.setTime(Sbb(b)); - } - function fvb(a, b) { - bvb.call(this, a, b); - } - function jvb(a, b) { - bvb.call(this, a, b); - } - function nvb(a, b) { - bvb.call(this, a, b); - } - function Nqb(a) { - Uhb(this); - Ld(this, a); - } - function wmb(a) { - tCb(a, 0); - return null; - } - function X6c(a) { - a.a = 0; - a.b = 0; - return a; - } - function f3c(a, b) { - a.a = b.g + 1; - return a; - } - function PJc(a, b) { - return a.j[b.p] == 2; - } - function _Pb(a) { - return VPb(BD(a, 79)); - } - function yJb() { - yJb = ccb; - xJb = as(wJb()); - } - function Y8b() { - Y8b = ccb; - X8b = as(W8b()); - } - function mt() { - this.b = new Mqb(Cv(12)); - } - function Otb() { - this.b = 0; - this.a = false; - } - function Wtb() { - this.b = 0; - this.a = false; - } - function sl(a) { - this.a = a; - ol.call(this); - } - function vl(a) { - this.a = a; - ol.call(this); - } - function Nsd(a, b) { - Msd.call(this, a, b); - } - function $zd(a, b) { - Cyd.call(this, a, b); - } - function nNd(a, b) { - _zd.call(this, a, b); - } - function s4d(a, b) { - p4d.call(this, a, b); - } - function w4d(a, b) { - qRd.call(this, a, b); - } - function rEd(a, b) { - pEd(); - Rhb(oEd, a, b); - } - function lcb(a, b) { - return qfb(a.a, 0, b); - } - function ww(a, b) { - return a.a.a.a.cc(b); - } - function mb(a, b) { - return PD(a) === PD(b); - } - function Mdb(a, b) { - return Kdb(a.a, b.a); - } - function $db(a, b) { - return beb(a.a, b.a); - } - function seb(a, b) { - return ueb(a.a, b.a); - } - function hfb(a, b) { - return a.indexOf(b); - } - function Ny(a, b) { - return a == b ? 0 : a ? 1 : -1; - } - function kB(a) { - return a < 10 ? "0" + a : "" + a; - } - function Mq(a) { - return Qb(a), new sl(a); - } - function SC(a) { - return TC(a.l, a.m, a.h); - } - function Hdb(a) { - return QD((uCb(a), a)); - } - function Idb(a) { - return QD((uCb(a), a)); - } - function NIb(a, b) { - return beb(a.g, b.g); - } - function Fbb(a) { - return typeof a === Lhe; - } - function mWb(a) { - return a == hWb || a == kWb; - } - function nWb(a) { - return a == hWb || a == iWb; - } - function G1b(a) { - return Jkb(a.b.b, a, 0); - } - function lrb(a) { - this.a = Arb(); - this.b = a; - } - function Frb(a) { - this.a = Arb(); - this.b = a; - } - function swb(a, b) { - Ekb(a.a, b); - return b; - } - function Z1c(a, b) { - Ekb(a.c, b); - return a; - } - function E2c(a, b) { - d3c(a.a, b); - return a; - } - function _gc(a, b) { - Hgc(); - return b.a += a; - } - function bhc(a, b) { - Hgc(); - return b.a += a; - } - function ahc(a, b) { - Hgc(); - return b.c += a; - } - function Nlb(a, b) { - Klb(a, 0, a.length, b); - } - function zsb() { - Wqb.call(this, new $rb()); - } - function I_b() { - B_b.call(this, 0, 0, 0, 0); - } - function I6c() { - J6c.call(this, 0, 0, 0, 0); - } - function g7c(a) { - this.a = a.a; - this.b = a.b; - } - function fad(a) { - return a == aad || a == bad; - } - function gad(a) { - return a == dad || a == _9c; - } - function Jzc(a) { - return a == Fzc || a == Ezc; - } - function fcd(a) { - return a != bcd && a != ccd; - } - function oid(a) { - return a.Lg() && a.Mg(); - } - function Gfd(a) { - return Kkd(BD(a, 118)); - } - function k3c(a) { - return d3c(new j3c(), a); - } - function y2d(a, b) { - return new p4d(b, a); - } - function z2d(a, b) { - return new p4d(b, a); - } - function ukd(a, b, c2) { - vkd(a, b); - wkd(a, c2); - } - function _kd(a, b, c2) { - cld(a, b); - ald(a, c2); - } - function bld(a, b, c2) { - dld(a, b); - eld(a, c2); - } - function gmd(a, b, c2) { - hmd(a, b); - imd(a, c2); - } - function nmd(a, b, c2) { - omd(a, b); - pmd(a, c2); - } - function iKd(a, b) { - $Jd(a, b); - _Jd(a, a.D); - } - function _ud(a) { - Wud.call(this, a, true); - } - function Xg(a, b, c2) { - Vg.call(this, a, b, c2); - } - function Ygb(a) { - Hgb(); - Zgb.call(this, a); - } - function rxb() { - mxb.call(this, "Head", 1); - } - function wxb() { - mxb.call(this, "Tail", 3); - } - function Ckb(a) { - a.c = KC(SI, Uhe, 1, 0, 5, 1); - } - function Vjb(a) { - a.a = KC(SI, Uhe, 1, 8, 5, 1); - } - function MGb(a) { - Hkb(a.xf(), new QGb(a)); - } - function xtb(a) { - return a != null ? tb(a) : 0; - } - function b2b(a, b) { - return ntd(b, mpd(a)); - } - function c2b(a, b) { - return ntd(b, mpd(a)); - } - function dAb(a, b) { - return a[a.length] = b; - } - function gAb(a, b) { - return a[a.length] = b; - } - function Vq(a) { - return lr(a.b.Kc(), a.a); - } - function dqd(a, b) { - return _o(qo(a.d), b); - } - function eqd(a, b) { - return _o(qo(a.g), b); - } - function fqd(a, b) { - return _o(qo(a.j), b); - } - function Osd(a, b) { - Msd.call(this, a.b, b); - } - function q0b(a) { - B_b.call(this, a, a, a, a); - } - function HOb(a) { - a.b && LOb(a); - return a.a; - } - function IOb(a) { - a.b && LOb(a); - return a.c; - } - function uyb(a, b) { - if (lyb) { - return; - } - a.b = b; - } - function lzd(a, b, c2) { - NC(a, b, c2); - return c2; - } - function mBc(a, b, c2) { - NC(a.c[b.g], b.g, c2); - } - function _Hd(a, b, c2) { - BD(a.c, 69).Xh(b, c2); - } - function wfd(a, b, c2) { - bld(c2, c2.i + a, c2.j + b); - } - function UOd(a, b) { - wtd(VKd(a.a), XOd(b)); - } - function bTd(a, b) { - wtd(QSd(a.a), eTd(b)); - } - function Lge(a) { - wfe(); - xfe.call(this, a); - } - function CAd(a) { - return a == null ? 0 : tb(a); - } - function fNc() { - fNc = ccb; - eNc = new Rpb(v1); - } - function h0d() { - h0d = ccb; - new i0d(); - new Rkb(); - } - function i0d() { - new Lqb(); - new Lqb(); - new Lqb(); - } - function GA() { - GA = ccb; - fA(); - FA = new Lqb(); - } - function Iy() { - Iy = ccb; - $wnd.Math.log(2); - } - function UVd() { - UVd = ccb; - TVd = (AFd(), zFd); - } - function _ge() { - throw vbb(new cgb(Cxe)); - } - function ohe() { - throw vbb(new cgb(Cxe)); - } - function che() { - throw vbb(new cgb(Dxe)); - } - function rhe() { - throw vbb(new cgb(Dxe)); - } - function Mg(a) { - this.a = a; - Gg.call(this, a); - } - function up(a) { - this.a = a; - rf.call(this, a); - } - function Bp(a) { - this.a = a; - rf.call(this, a); - } - function Okb(a, b) { - Mlb(a.c, a.c.length, b); - } - function llb(a) { - return a.a < a.c.c.length; - } - function Eqb(a) { - return a.a < a.c.a.length; - } - function Ntb(a, b) { - return a.a ? a.b : b.De(); - } - function beb(a, b) { - return a < b ? -1 : a > b ? 1 : 0; - } - function Deb(a, b) { - return ybb(a, b) > 0 ? a : b; - } - function TC(a, b, c2) { - return { l: a, m: b, h: c2 }; - } - function Ctb(a, b) { - a.a != null && BIc(b, a.a); - } - function Csb(a) { - a.a = new jtb(); - a.c = new jtb(); - } - function hDb(a) { - this.b = a; - this.a = new Rkb(); - } - function dOb(a) { - this.b = new pOb(); - this.a = a; - } - function q_b(a) { - n_b.call(this); - this.a = a; - } - function txb() { - mxb.call(this, "Range", 2); - } - function bUb() { - ZTb(); - this.a = new L2c(zP); - } - function Bh(a, b) { - Qb(b); - Ah(a).Jc(new Vw()); - } - function fKc(a, b) { - FJc(); - return b.n.b += a; - } - function Tgc(a, b, c2) { - return Rhb(a.g, c2, b); - } - function LJc(a, b, c2) { - return Rhb(a.k, c2, b); - } - function r1c(a, b) { - return Rhb(a.a, b.a, b); - } - function jBc(a, b, c2) { - return hBc(b, c2, a.c); - } - function E6c(a) { - return new f7c(a.c, a.d); - } - function F6c(a) { - return new f7c(a.c, a.d); - } - function R6c(a) { - return new f7c(a.a, a.b); - } - function CQd(a, b) { - return hA(a.a, b, null); - } - function fec(a) { - QZb(a, null); - RZb(a, null); - } - function AOc(a) { - BOc(a, null); - COc(a, null); - } - function u4d() { - qRd.call(this, null, null); - } - function y4d() { - RRd.call(this, null, null); - } - function a7d(a) { - this.a = a; - Lqb.call(this); - } - function Pp(a) { - this.b = (mmb(), new iob(a)); - } - function Py(a) { - a.j = KC(VI, nie, 310, 0, 0, 1); - } - function oAd(a, b, c2) { - a.c.Vc(b, BD(c2, 133)); - } - function GAd(a, b, c2) { - a.c.ji(b, BD(c2, 133)); - } - function JLd(a, b) { - Uxd(a); - a.Gc(BD(b, 15)); - } - function b7d(a, b) { - return t2d(a.c, a.b, b); - } - function Bv(a, b) { - return new Qv(a.Kc(), b); - } - function Lq(a, b) { - return rr(a.Kc(), b) != -1; - } - function Sqb(a, b) { - return a.a.Bc(b) != null; - } - function pr(a) { - return a.Ob() ? a.Pb() : null; - } - function yfb(a) { - return zfb(a, 0, a.length); - } - function JD(a, b) { - return a != null && AD(a, b); - } - function $A(a, b) { - a.q.setHours(b); - YA(a, b); - } - function Yrb(a, b) { - if (a.c) { - jsb(b); - isb(b); - } - } - function nk(a, b, c2) { - BD(a.Kb(c2), 164).Nb(b); - } - function RJc(a, b, c2) { - SJc(a, b, c2); - return c2; - } - function Eub(a, b, c2) { - a.a = b ^ 1502; - a.b = c2 ^ kke; - } - function xHb(a, b, c2) { - return a.a[b.g][c2.g]; - } - function REc(a, b) { - return a.a[b.c.p][b.p]; - } - function aEc(a, b) { - return a.e[b.c.p][b.p]; - } - function tEc(a, b) { - return a.c[b.c.p][b.p]; - } - function OJc(a, b) { - return a.j[b.p] = aKc(b); - } - function k5c(a, b) { - return cfb(a.f, b.tg()); - } - function Isd(a, b) { - return cfb(a.b, b.tg()); - } - function Sfd(a, b) { - return a.a < Kcb(b) ? -1 : 1; - } - function ZDc(a, b, c2) { - return c2 ? b != 0 : b != a - 1; - } - function _6c(a, b, c2) { - a.a = b; - a.b = c2; - return a; - } - function Y6c(a, b) { - a.a *= b; - a.b *= b; - return a; - } - function mud(a, b, c2) { - NC(a.g, b, c2); - return c2; - } - function CHb(a, b, c2, d) { - NC(a.a[b.g], c2.g, d); - } - function EQb(a, b) { - O6c(b, a.a.a.a, a.a.a.b); - } - function Ozd(a) { - a.a = BD(Ajd(a.b.a, 4), 126); - } - function Wzd(a) { - a.a = BD(Ajd(a.b.a, 4), 126); - } - function otd(a) { - ytb(a, hue2); - Rld(a, gtd(a)); - } - function Atb() { - Atb = ccb; - ztb = new Ftb(null); - } - function Ivb() { - Ivb = ccb; - Ivb(); - Hvb = new Ovb(); - } - function FId() { - this.Bb |= 256; - this.Bb |= 512; - } - function Fyd(a) { - this.i = a; - this.f = this.i.j; - } - function xMd(a, b, c2) { - pMd.call(this, a, b, c2); - } - function BMd(a, b, c2) { - xMd.call(this, a, b, c2); - } - function K4d(a, b, c2) { - xMd.call(this, a, b, c2); - } - function N4d(a, b, c2) { - BMd.call(this, a, b, c2); - } - function X4d(a, b, c2) { - pMd.call(this, a, b, c2); - } - function _4d(a, b, c2) { - pMd.call(this, a, b, c2); - } - function C4d(a, b, c2) { - k2d.call(this, a, b, c2); - } - function G4d(a, b, c2) { - k2d.call(this, a, b, c2); - } - function I4d(a, b, c2) { - C4d.call(this, a, b, c2); - } - function c5d(a, b, c2) { - X4d.call(this, a, b, c2); - } - function zf(a, b) { - this.a = a; - rf.call(this, b); - } - function aj(a, b) { - this.a = a; - pc.call(this, b); - } - function kj(a, b) { - this.a = a; - pc.call(this, b); - } - function Jj(a, b) { - this.a = a; - pc.call(this, b); - } - function Rj(a) { - this.a = a; - sj.call(this, a.d); - } - function she(a) { - this.c = a; - this.a = this.c.a; - } - function xl(a, b) { - this.a = b; - pc.call(this, a); - } - function Qo(a, b) { - this.a = b; - Lo.call(this, a); - } - function op(a, b) { - this.a = a; - Lo.call(this, b); - } - function rj(a, b) { - return Rl(Xm(a.c)).Xb(b); - } - function Eb(a, b) { - return Db(a, new Ufb(), b).a; - } - function ur(a, b) { - Qb(b); - return new Gr(a, b); - } - function Gr(a, b) { - this.a = b; - Br.call(this, a); - } - function Hs(a) { - this.b = a; - this.a = this.b.a.e; - } - function Eg(a) { - a.b.Qb(); - --a.d.f.d; - bg(a.d); - } - function Uk(a) { - Fk.call(this, BD(Qb(a), 35)); - } - function il(a) { - Fk.call(this, BD(Qb(a), 35)); - } - function is() { - $r.call(this, "INSTANCE", 0); - } - function Lb(a) { - if (!a) { - throw vbb(new Vdb()); + 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]; } - } - function Ub(a) { - if (!a) { - throw vbb(new Ydb()); + 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 ot(a) { - if (!a) { - throw vbb(new utb()); + 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 I6d() { - I6d = ccb; - g5d(); - H6d = new J6d(); - } - function Bcb() { - Bcb = ccb; - zcb = false; - Acb = true; - } - function Jfb(a) { - mcb.call(this, (uCb(a), a)); - } - function Wfb(a) { - mcb.call(this, (uCb(a), a)); - } - function Inb(a) { - lnb.call(this, a); - this.a = a; - } - function Xnb(a) { - Dnb.call(this, a); - this.a = a; - } - function Zob(a) { - zob.call(this, a); - this.a = a; - } - function Xy() { - Py(this); - Ry(this); - this._d(); - } - function Qv(a, b) { - this.a = b; - Br.call(this, a); - } - function au(a, b) { - return new xu(a.a, a.b, b); - } - function kfb(a, b) { - return a.lastIndexOf(b); - } - function ifb(a, b, c2) { - return a.indexOf(b, c2); - } - function xfb(a) { - return a == null ? Xhe : fcb(a); - } - function nz(a) { - return a == null ? null : a.name; - } - function Etb(a) { - return a.a != null ? a.a : null; - } - function or(a) { - return Wsb(a.a) ? nr(a) : null; - } - function Fxb(a, b) { - return Jwb(a.a, b) != null; - } - function uqb(a, b) { - return !!b && a.b[b.g] == b; - } - function FCb(a) { - return a.$H || (a.$H = ++ECb); - } - function aD(a) { - return a.l + a.m * Hje + a.h * Ije; - } - function pDb(a, b) { - Ekb(b.a, a.a); - return a.a; - } - function vDb(a, b) { - Ekb(b.b, a.a); - return a.a; - } - function nGb(a, b) { - Ekb(b.a, a.a); - return a.a; - } - function Btb(a) { - sCb(a.a != null); - return a.a; - } - function Asb(a) { - Wqb.call(this, new _rb(a)); - } - function GUb(a, b) { - HUb.call(this, a, b, null); - } - function cxb(a) { - this.a = a; - Bjb.call(this, a); - } - function CKb() { - CKb = ccb; - BKb = new Msd(tle, 0); - } - function NFb(a, b) { - ++a.b; - return Ekb(a.a, b); - } - function OFb(a, b) { - ++a.b; - return Lkb(a.a, b); - } - function n6b(a, b) { - return Kdb(a.n.a, b.n.a); - } - function WKb(a, b) { - return Kdb(a.c.d, b.c.d); - } - function gLb(a, b) { - return Kdb(a.c.c, b.c.c); - } - function zXb(a, b) { - return BD(Qc(a.b, b), 15); - } - function s7b(a, b) { - return a.n.b = (uCb(b), b); - } - function t7b(a, b) { - return a.n.b = (uCb(b), b); - } - function a1b(a) { - return llb(a.a) || llb(a.b); - } - function fBc(a, b, c2) { - return gBc(a, b, c2, a.b); - } - function iBc(a, b, c2) { - return gBc(a, b, c2, a.c); - } - function i3c(a, b, c2) { - BD(B2c(a, b), 21).Fc(c2); - } - function xBd(a, b, c2) { - vAd(a.a, c2); - uAd(a.a, b); - } - function qRd(a, b) { - nRd(); - this.a = a; - this.b = b; - } - function RRd(a, b) { - LRd(); - this.b = a; - this.c = b; - } - function hhd(a, b) { - Rgd(); - this.f = b; - this.d = a; - } - function qc(a, b) { - Sb(b, a); - this.d = a; - this.c = b; - } - function n5b(a) { - var b; - b = a.a; - a.a = a.b; - a.b = b; - } - function chc(a) { - Hgc(); - return !!a && !a.dc(); - } - function Afe(a) { - return new lge(3, a); - } - function jm(a, b) { - return new Vp(a, a.gc(), b); - } - function ns(a) { - hs(); - return es((qs(), ps), a); - } - function Oyd(a) { - this.d = a; - Fyd.call(this, a); - } - function $yd(a) { - this.c = a; - Fyd.call(this, a); - } - function bzd(a) { - this.c = a; - Oyd.call(this, a); - } - function sgc() { - qgc(); - this.b = new ygc(this); - } - function Pu(a) { - Xj(a, Jie); - return new Skb(a); - } - function Vz(a) { - Rz(); - return parseInt(a) || -1; - } - function qfb(a, b, c2) { - return a.substr(b, c2 - b); - } - function gfb(a, b, c2) { - return ifb(a, wfb(b), c2); - } - function Pkb(a) { - return ZBb(a.c, a.c.length); - } - function Yr(a) { - return a.f != null ? a.f : "" + a.g; - } - function Zr(a) { - return a.f != null ? a.f : "" + a.g; - } - function Hsb(a) { - sCb(a.b != 0); - return a.a.a.c; - } - function Isb(a) { - sCb(a.b != 0); - return a.c.b.c; - } - function Cmd(a) { - JD(a, 150) && BD(a, 150).Gh(); - } - function Wwb(a) { - return a.b = BD(tib(a.a), 42); - } - function Ptb(a) { - Ltb(); - this.b = a; - this.a = true; - } - function Xtb(a) { - Utb(); - this.b = a; - this.a = true; - } - function Trb(a) { - a.d = new ksb(a); - a.e = new Lqb(); - } - function mkb(a) { - if (!a) { - throw vbb(new Apb()); + 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 lCb(a) { - if (!a) { - throw vbb(new Vdb()); + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; } - } - function yCb(a) { - if (!a) { - throw vbb(new Ydb()); + 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; } - } - function qCb(a) { - if (!a) { - throw vbb(new tcb()); + 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; + } + } } - } - function sCb(a) { - if (!a) { - throw vbb(new utb()); + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; + } + return false; } - } - function ksb(a) { - lsb.call(this, a, null, null); - } - function dPb() { - $r.call(this, "POLYOMINO", 0); - } - function Cg(a, b, c2, d) { - qg.call(this, a, b, c2, d); - } - function zkc(a, b) { - gkc(); - return Rc(a, b.e, b); - } - function azc(a, b, c2) { - Vyc(); - return c2.qg(a, b); - } - function wNb(a, b) { - return !!a.q && Mhb(a.q, b); - } - function JRb(a, b) { - return a > 0 ? b * b / a : b * b * 100; - } - function CRb(a, b) { - return a > 0 ? b / (a * a) : b * 100; - } - function G2c(a, b, c2) { - return Ekb(b, I2c(a, c2)); - } - function t3c(a, b, c2) { - p3c(); - a.Xe(b) && c2.td(a); - } - function St(a, b, c2) { - var d; - d = a.Zc(b); - d.Rb(c2); - } - function O6c(a, b, c2) { - a.a += b; - a.b += c2; - return a; - } - function Z6c(a, b, c2) { - a.a *= b; - a.b *= c2; - return a; - } - function b7c(a, b, c2) { - a.a -= b; - a.b -= c2; - return a; - } - function a7c(a, b) { - a.a = b.a; - a.b = b.b; - return a; - } - function V6c(a) { - a.a = -a.a; - a.b = -a.b; - return a; - } - function Dic(a) { - this.c = a; - this.a = 1; - this.b = 1; - } - function xed(a) { - this.c = a; - dld(a, 0); - eld(a, 0); - } - function u7c(a) { - Psb.call(this); - n7c(this, a); - } - function AXb(a) { - xXb(); - yXb(this); - this.mf(a); - } - function GRd(a, b) { - nRd(); - qRd.call(this, a, b); - } - function dSd(a, b) { - LRd(); - RRd.call(this, a, b); - } - function hSd(a, b) { - LRd(); - RRd.call(this, a, b); - } - function fSd(a, b) { - LRd(); - dSd.call(this, a, b); - } - function sId(a, b, c2) { - dId.call(this, a, b, c2, 2); - } - function zXd(a, b) { - UVd(); - nXd.call(this, a, b); - } - function BXd(a, b) { - UVd(); - zXd.call(this, a, b); - } - function DXd(a, b) { - UVd(); - zXd.call(this, a, b); - } - function FXd(a, b) { - UVd(); - DXd.call(this, a, b); - } - function PXd(a, b) { - UVd(); - nXd.call(this, a, b); - } - function RXd(a, b) { - UVd(); - PXd.call(this, a, b); - } - function XXd(a, b) { - UVd(); - nXd.call(this, a, b); - } - function pAd(a, b) { - return a.c.Fc(BD(b, 133)); - } - function w1d(a, b, c2) { - return V1d(p1d(a, b), c2); - } - function N2d(a, b, c2) { - return b.Qk(a.e, a.c, c2); - } - function P2d(a, b, c2) { - return b.Rk(a.e, a.c, c2); - } - function a3d(a, b) { - return xid(a.e, BD(b, 49)); - } - function aTd(a, b, c2) { - vtd(QSd(a.a), b, eTd(c2)); - } - function TOd(a, b, c2) { - vtd(VKd(a.a), b, XOd(c2)); - } - function ypb(a, b) { - b.$modCount = a.$modCount; - } - function MUc() { - MUc = ccb; - LUc = new Lsd("root"); - } - function LCd() { - LCd = ccb; - KCd = new lDd(); - new NDd(); - } - function KVc() { - this.a = new Hp(); - this.b = new Hp(); - } - function FUd() { - hJd.call(this); - this.Bb |= Tje; - } - function t_c() { - $r.call(this, "GROW_TREE", 0); - } - function C9d(a) { - return a == null ? null : cde(a); - } - function G9d(a) { - return a == null ? null : jde(a); - } - function J9d(a) { - return a == null ? null : fcb(a); - } - function K9d(a) { - return a == null ? null : fcb(a); - } - function fdb(a) { - if (a.o != null) { - 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 + }); } - vdb(a); - } - function DD(a) { - CCb(a == null || KD(a)); - return a; - } - function ED(a) { - CCb(a == null || LD(a)); - return a; - } - function GD(a) { - CCb(a == null || ND(a)); - return a; - } - function gB(a) { - this.q = new $wnd.Date(Sbb(a)); - } - function Mf(a, b) { - this.c = a; - ne.call(this, a, b); - } - function Sf(a, b) { - this.a = a; - Mf.call(this, a, b); - } - function Hg(a, b) { - this.d = a; - Dg(this); - this.b = b; - } - function bAb(a, b) { - Vzb.call(this, a); - this.a = b; - } - function vAb(a, b) { - Vzb.call(this, a); - this.a = b; - } - function sNb(a) { - pNb.call(this, 0, 0); - this.f = a; - } - function Vg(a, b, c2) { - dg.call(this, a, b, c2, null); - } - function Yg(a, b, c2) { - dg.call(this, a, b, c2, null); - } - function Pxb(a, b, c2) { - return a.ue(b, c2) <= 0 ? c2 : b; - } - function Qxb(a, b, c2) { - return a.ue(b, c2) <= 0 ? b : c2; - } - function g4c(a, b) { - return BD(Wrb(a.b, b), 149); - } - function i4c(a, b) { - return BD(Wrb(a.c, b), 229); - } - function wic(a) { - return BD(Ikb(a.a, a.b), 287); - } - function B6c(a) { - return new f7c(a.c, a.d + a.a); - } - function eLc(a) { - return FJc(), Jzc(BD(a, 197)); - } - function $Jb() { - $Jb = ccb; - ZJb = pqb((tdd(), sdd)); - } - function fOb(a, b) { - b.a ? gOb(a, b) : Fxb(a.a, b.b); - } - function qyb(a, b) { - if (lyb) { - return; + }, "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]; } - Ekb(a.a, b); - } - function F2b(a, b) { - x2b(); - return f_b(b.d.i, a); - } - function _9b(a, b) { - I9b(); - return new gac(b, a); - } - function _Hb(a, b) { - ytb(b, lle); - a.f = b; - return a; - } - function Kld(a, b, c2) { - c2 = _hd(a, b, 3, c2); - return c2; - } - function bmd(a, b, c2) { - c2 = _hd(a, b, 6, c2); - return c2; - } - function kpd(a, b, c2) { - c2 = _hd(a, b, 9, c2); - return c2; - } - function Cvd(a, b, c2) { - ++a.j; - a.Ki(); - Atd(a, b, c2); - } - function Avd(a, b, c2) { - ++a.j; - a.Hi(b, a.oi(b, c2)); - } - function bRd(a, b, c2) { - var d; - d = a.Zc(b); - d.Rb(c2); - } - function c7d(a, b, c2) { - return C2d(a.c, a.b, b, c2); - } - function DAd(a, b) { - return (b & Ohe) % a.d.length; - } - function Msd(a, b) { - Lsd.call(this, a); - this.a = b; - } - function uVd(a, b) { - lVd.call(this, a); - this.a = b; - } - function sYd(a, b) { - lVd.call(this, a); - this.a = b; - } - function zyd(a, b) { - this.c = a; - zud.call(this, b); - } - function YOd(a, b) { - this.a = a; - qOd.call(this, b); - } - function fTd(a, b) { - this.a = a; - qOd.call(this, b); - } - function Xp(a) { - this.a = (Xj(a, Jie), new Skb(a)); - } - function cq(a) { - this.a = (Xj(a, Jie), new Skb(a)); - } - function LA(a) { - !a.a && (a.a = new VA()); - return a.a; - } - function XMb(a) { - if (a > 8) { - return 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; } - return a + 1; - } - function Ecb(a, b) { - Bcb(); - return a == b ? 0 : a ? 1 : -1; - } - function Opb(a, b, c2) { - return Npb(a, BD(b, 22), c2); - } - function Bz(a, b, c2) { - return a.apply(b, c2); - } - function Sfb(a, b, c2) { - a.a += zfb(b, 0, c2); - return a; - } - function ijb(a, b) { - var c2; - c2 = a.e; - a.e = b; - return c2; - } - function trb(a, b) { - var c2; - c2 = a[hke]; - c2.call(a, b); - } - function urb(a, b) { - var c2; - c2 = a[hke]; - c2.call(a, b); - } - function Aib(a, b) { - a.a.Vc(a.b, b); - ++a.b; - a.c = -1; - } - function Urb(a) { - Uhb(a.e); - a.d.b = a.d; - a.d.a = a.d; - } - function _f(a) { - a.b ? _f(a.b) : a.f.c.zc(a.e, a.d); - } - function _Ab(a, b, c2) { - EAb(); - MBb(a, b.Ce(a.a, c2)); - } - function Bxb(a, b) { - return Vd(Cwb(a.a, b, true)); - } - function Cxb(a, b) { - return Vd(Dwb(a.a, b, true)); - } - function _Bb(a, b) { - return eCb(new Array(b), a); - } - function HD(a) { - return String.fromCharCode(a); - } - function mz(a) { - return a == null ? null : a.message; - } - function gRb() { - this.a = new Rkb(); - this.b = new Rkb(); - } - function iTb() { - this.a = new MQb(); - this.b = new tTb(); - } - function tDb() { - this.b = new d7c(); - this.c = new Rkb(); - } - function _Qb() { - this.d = new d7c(); - this.e = new d7c(); - } - function n_b() { - this.n = new d7c(); - this.o = new d7c(); - } - function $Gb() { - this.n = new p0b(); - this.i = new I6c(); - } - function sec() { - this.a = new Umc(); - this.b = new mnc(); - } - function NIc() { - this.a = new Rkb(); - this.d = new Rkb(); - } - function LDc() { - this.b = new Tqb(); - this.a = new Tqb(); - } - function hSc() { - this.b = new Lqb(); - this.a = new Lqb(); - } - function HRc() { - this.b = new tRc(); - this.a = new hRc(); - } - function aHb() { - $Gb.call(this); - this.a = new d7c(); - } - function Ywb(a) { - Zwb.call(this, a, (lxb(), hxb)); - } - function J_b(a, b, c2, d) { - B_b.call(this, a, b, c2, d); - } - function sqd(a, b, c2) { - c2 != null && kmd(b, Wqd(a, c2)); - } - function tqd(a, b, c2) { - c2 != null && lmd(b, Wqd(a, c2)); - } - function Tod(a, b, c2) { - c2 = _hd(a, b, 11, c2); - return c2; - } - function P6c(a, b) { - a.a += b.a; - a.b += b.b; - return a; - } - function c7c(a, b) { - a.a -= b.a; - a.b -= b.b; - return a; - } - function u7b(a, b) { - return a.n.a = (uCb(b), b) + 10; - } - function v7b(a, b) { - return a.n.a = (uCb(b), b) + 10; - } - function dLd(a, b) { - return b == a || pud(UKd(b), a); - } - function PYd(a, b) { - return Rhb(a.a, b, "") == null; - } - function E2b(a, b) { - x2b(); - return !f_b(b.d.i, a); - } - function rjc(a, b) { - fad(a.f) ? sjc(a, b) : tjc(a, b); - } - function h1d(a, b) { - var c2; - c2 = b.Hh(a.a); - return c2; - } - function Cyd(a, b) { - qcb.call(this, gve + a + mue + b); - } - function gUd(a, b, c2, d) { - cUd.call(this, a, b, c2, d); - } - function Q4d(a, b, c2, d) { - cUd.call(this, a, b, c2, d); - } - function U4d(a, b, c2, d) { - Q4d.call(this, a, b, c2, d); - } - function n5d(a, b, c2, d) { - i5d.call(this, a, b, c2, d); - } - function p5d(a, b, c2, d) { - i5d.call(this, a, b, c2, d); - } - function v5d(a, b, c2, d) { - i5d.call(this, a, b, c2, d); - } - function t5d(a, b, c2, d) { - p5d.call(this, a, b, c2, d); - } - function A5d(a, b, c2, d) { - p5d.call(this, a, b, c2, d); - } - function y5d(a, b, c2, d) { - v5d.call(this, a, b, c2, d); - } - function D5d(a, b, c2, d) { - A5d.call(this, a, b, c2, d); - } - function d6d(a, b, c2, d) { - Y5d.call(this, a, b, c2, d); - } - function Vp(a, b, c2) { - this.a = a; - qc.call(this, b, c2); - } - function tk(a, b, c2) { - this.c = b; - this.b = c2; - this.a = a; - } - function ik(a, b, c2) { - return a.d = BD(b.Kb(c2), 164); - } - function j6d(a, b) { - return a.Aj().Nh().Kh(a, b); - } - function h6d(a, b) { - return a.Aj().Nh().Ih(a, b); - } - function Fdb(a, b) { - return uCb(a), PD(a) === PD(b); - } - function dfb(a, b) { - return uCb(a), PD(a) === PD(b); - } - function Dxb(a, b) { - return Vd(Cwb(a.a, b, false)); - } - function Exb(a, b) { - return Vd(Dwb(a.a, b, false)); - } - function vBb(a, b) { - return a.b.sd(new yBb(a, b)); - } - function BBb(a, b) { - return a.b.sd(new EBb(a, b)); - } - function HBb(a, b) { - return a.b.sd(new KBb(a, b)); - } - function lfb(a, b, c2) { - return a.lastIndexOf(b, c2); - } - function uTb(a, b, c2) { - return Kdb(a[b.b], a[c2.b]); - } - function RTb(a, b) { - return yNb(b, (Nyc(), Cwc), a); - } - function fmc(a, b) { - return beb(b.a.d.p, a.a.d.p); - } - function emc(a, b) { - return beb(a.a.d.p, b.a.d.p); - } - function _Oc(a, b) { - return Kdb(a.c - a.s, b.c - b.s); - } - function S_b(a) { - return !a.c ? -1 : Jkb(a.c.a, a, 0); - } - function Vxd(a) { - return a < 100 ? null : new Ixd(a); + }, "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; + }(); + parser22.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser22; + parser22.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((id27) => { + if (latestRequirement !== void 0) { + latestRequirement.id = id27; + } + }, "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, id27) => { + return parentNode.insert("rect", "#" + id27).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, id27, txts) => { + let x5 = conf3.rect_min_width / 2; + let title2 = parentNode.append("text").attr("class", "req reqLabel reqTitle").attr("id", id27).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, id27, txts, yStart) => { + let body = parentNode.append("text").attr("class", "req reqLabel").attr("id", id27).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 id27 = elementString(elName); + const groupNode = svgNode2.append("g").attr("id", id27); + const textId = "element-" + id27; + 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(id27, { + width: rectBBox.width, + height: rectBBox.height, + shape: "rect", + id: id27 + }); + }); + }, "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, id27, _version, diagObj) => { + conf3 = getConfig2().requirement; + const securityLevel = conf3.securityLevel; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id27); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const svg = root4.select(`[id='${id27}']`); + 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, id27, 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 parser22 = { + 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 ecd(a) { - return a == Zbd || a == _bd || a == $bd; + }, "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 zAd(a, b) { - return JD(b, 15) && Btd(a.c, b); + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - function vyb(a, b) { - if (lyb) { - 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; } - !!b && (a.d = b); - } - function ujb(a, b) { - var c2; - c2 = b; - return !!Awb(a, c2); - } - function czd(a, b) { - this.c = a; - Pyd.call(this, a, b); - } - function fBb(a) { - this.c = a; - nvb.call(this, rie, 0); - } - function Avb(a, b) { - Bvb.call(this, a, a.length, b); - } - function aId(a, b, c2) { - return BD(a.c, 69).lk(b, c2); - } - function bId(a, b, c2) { - return BD(a.c, 69).mk(b, c2); - } - function O2d(a, b, c2) { - return N2d(a, BD(b, 332), c2); - } - function Q2d(a, b, c2) { - return P2d(a, BD(b, 332), c2); - } - function i3d(a, b, c2) { - return h3d(a, BD(b, 332), c2); - } - function k3d(a, b, c2) { - return j3d(a, BD(b, 332), c2); - } - function tn(a, b) { - return b == null ? null : Hv(a.b, b); - } - function Kcb(a) { - return LD(a) ? (uCb(a), a) : a.ke(); - } - function Ldb(a) { - return !isNaN(a) && !isFinite(a); - } - function Wn(a) { - Ql(); - this.a = (mmb(), new zob(a)); - } - function dIc(a) { - FHc(); - this.d = a; - this.a = new jkb(); - } - function xqb(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function Nrb(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function $sb(a, b, c2) { - this.d = a; - this.b = c2; - this.a = b; - } - function Qsb(a) { - Csb(this); - Osb(this); - ye(this, a); - } - function Tkb(a) { - Ckb(this); - bCb(this.c, 0, a.Pc()); - } - function Xwb(a) { - uib(a.a); - Kwb(a.c, a.b); - a.b = null; - } - function iyb(a) { - this.a = a; - Zfb(); - Cbb(Date.now()); - } - function JCb() { - JCb = ccb; - GCb = new nb(); - ICb = new nb(); - } - function ntb() { - ntb = ccb; - ltb = new otb(); - mtb = new qtb(); - } - function kzd() { - kzd = ccb; - jzd = KC(SI, Uhe, 1, 0, 5, 1); - } - function tGd() { - tGd = ccb; - sGd = KC(SI, Uhe, 1, 0, 5, 1); - } - function $Gd() { - $Gd = ccb; - ZGd = KC(SI, Uhe, 1, 0, 5, 1); - } - function Ql() { - Ql = ccb; - new Zl((mmb(), mmb(), jmb)); - } - function pxb(a) { - lxb(); - return es((zxb(), yxb), a); - } - function Hyb(a) { - Fyb(); - return es((Kyb(), Jyb), a); - } - function OEb(a) { - MEb(); - return es((REb(), QEb), a); - } - function WEb(a) { - UEb(); - return es((ZEb(), YEb), a); - } - function tFb(a) { - rFb(); - return es((wFb(), vFb), a); - } - function iHb(a) { - gHb(); - return es((lHb(), kHb), a); - } - function PHb(a) { - NHb(); - return es((SHb(), RHb), a); - } - function GIb(a) { - EIb(); - return es((JIb(), IIb), a); - } - function vJb(a) { - qJb(); - return es((yJb(), xJb), a); - } - function xLb(a) { - vLb(); - return es((ALb(), zLb), a); - } - function TMb(a) { - RMb(); - return es((WMb(), VMb), a); - } - function TOb(a) { - ROb(); - return es((WOb(), VOb), a); - } - function ePb(a) { - cPb(); - return es((hPb(), gPb), a); - } - function ZRb(a) { - XRb(); - return es((aSb(), _Rb), a); - } - function ATb(a) { - yTb(); - return es((DTb(), CTb), a); - } - function sUb(a) { - qUb(); - return es((vUb(), uUb), a); - } - function rWb(a) { - lWb(); - return es((uWb(), tWb), a); - } - function TXb(a) { - RXb(); - return es((WXb(), VXb), a); - } - function Mb(a, b) { - if (!a) { - throw vbb(new Wdb(b)); - } - } - function l0b(a) { - j0b(); - return es((o0b(), n0b), a); - } - function r0b(a) { - B_b.call(this, a.d, a.c, a.a, a.b); - } - function K_b(a) { - B_b.call(this, a.d, a.c, a.a, a.b); - } - function mKb(a, b, c2) { - this.b = a; - this.c = b; - this.a = c2; - } - function BZb(a, b, c2) { - this.b = a; - this.a = b; - this.c = c2; - } - function TNb(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function uOb(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function S3b(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function Z6b(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function n9b(a, b, c2) { - this.b = a; - this.a = b; - this.c = c2; - } - function x$b(a, b, c2) { - this.e = b; - this.b = a; - this.d = c2; - } - function $Ab(a, b, c2) { - EAb(); - a.a.Od(b, c2); - return b; - } - function LGb(a) { - var b; - b = new KGb(); - b.e = a; - return b; - } - function iLb(a) { - var b; - b = new fLb(); - b.b = a; - return b; - } - function D6b() { - D6b = ccb; - B6b = new M6b(); - C6b = new P6b(); - } - function Hgc() { - Hgc = ccb; - Fgc = new ghc(); - Ggc = new ihc(); - } - function jbc(a) { - gbc(); - return es((mbc(), lbc), a); - } - function Cjc(a) { - Ajc(); - return es((Fjc(), Ejc), a); - } - function Clc(a) { - Alc(); - return es((Flc(), Elc), a); - } - function Cpc(a) { - Apc(); - return es((Fpc(), Epc), a); - } - function Kpc(a) { - Ipc(); - return es((Npc(), Mpc), a); - } - function Wpc(a) { - Rpc(); - return es((Zpc(), Ypc), a); - } - function $jc(a) { - Xjc(); - return es((bkc(), akc), a); - } - function Hkc(a) { - Fkc(); - return es((Kkc(), Jkc), a); - } - function dqc(a) { - bqc(); - return es((gqc(), fqc), a); - } - function rqc(a) { - mqc(); - return es((uqc(), tqc), a); - } - function zqc(a) { - xqc(); - return es((Cqc(), Bqc), a); - } - function Iqc(a) { - Gqc(); - return es((Lqc(), Kqc), a); - } - function Vqc(a) { - Sqc(); - return es((Yqc(), Xqc), a); - } - function brc(a) { - _qc(); - return es((erc(), drc), a); - } - function nrc(a) { - lrc(); - return es((qrc(), prc), a); - } - function Arc(a) { - yrc(); - return es((Drc(), Crc), a); - } - function Qrc(a) { - Orc(); - return es((Trc(), Src), a); - } - function Zrc(a) { - Xrc(); - return es((asc(), _rc), a); - } - function gsc(a) { - esc(); - return es((jsc(), isc), a); - } - function osc(a) { - msc(); - return es((rsc(), qsc), a); - } - function Etc(a) { - Ctc(); - return es((Htc(), Gtc), a); - } - function qzc(a) { - lzc(); - return es((tzc(), szc), a); - } - function Azc(a) { - xzc(); - return es((Dzc(), Czc), a); - } - function Mzc(a) { - Izc(); - return es((Pzc(), Ozc), a); - } - function MAc(a) { - KAc(); - return es((PAc(), OAc), a); - } - function mAc(a) { - kAc(); - return es((pAc(), oAc), a); - } - function vAc(a) { - tAc(); - return es((yAc(), xAc), a); - } - function DAc(a) { - BAc(); - return es((GAc(), FAc), a); - } - function VAc(a) { - TAc(); - return es((YAc(), XAc), a); - } - function $zc(a) { - Vzc(); - return es((bAc(), aAc), a); - } - function bBc(a) { - _Ac(); - return es((eBc(), dBc), a); - } - function vBc(a) { - tBc(); - return es((yBc(), xBc), a); - } - function EBc(a) { - CBc(); - return es((HBc(), GBc), a); - } - function NBc(a) { - LBc(); - return es((QBc(), PBc), a); - } - function tGc(a) { - rGc(); - return es((wGc(), vGc), a); - } - function WIc(a) { - UIc(); - return es((ZIc(), YIc), a); - } - function $Lc(a) { - YLc(); - return es((bMc(), aMc), a); - } - function gMc(a) { - eMc(); - return es((jMc(), iMc), a); - } - function JOc(a) { - HOc(); - return es((MOc(), LOc), a); - } - function HQc(a) { - FQc(); - return es((KQc(), JQc), a); - } - function DRc(a) { - yRc(); - return es((GRc(), FRc), a); - } - function tSc(a) { - qSc(); - return es((wSc(), vSc), a); - } - function UTc(a) { - STc(); - return es((XTc(), WTc), a); - } - function UUc(a) { - PUc(); - return es((XUc(), WUc), a); - } - function aUc(a) { - $Tc(); - return es((dUc(), cUc), a); - } - function wVc(a) { - tVc(); - return es((zVc(), yVc), a); - } - function iWc(a) { - fWc(); - return es((lWc(), kWc), a); - } - function sWc(a) { - pWc(); - return es((vWc(), uWc), a); - } - function lXc(a) { - iXc(); - return es((oXc(), nXc), a); - } - function vXc(a) { - sXc(); - return es((yXc(), xXc), a); - } - function BYc(a) { - zYc(); - return es((EYc(), DYc), a); - } - function m$c(a) { - k$c(); - return es((p$c(), o$c), a); - } - function $$c(a) { - Y$c(); - return es((b_c(), a_c), a); - } - function n_c(a) { - i_c(); - return es((q_c(), p_c), a); - } - function w_c(a) { - s_c(); - return es((z_c(), y_c), a); - } - function E_c(a) { - C_c(); - return es((H_c(), G_c), a); - } - function P_c(a) { - N_c(); - return es((S_c(), R_c), a); - } - function W0c(a) { - R0c(); - return es((Z0c(), Y0c), a); - } - function f1c(a) { - a1c(); - return es((i1c(), h1c), a); - } - function P5c(a) { - N5c(); - return es((S5c(), R5c), a); - } - function b6c(a) { - _5c(); - return es((e6c(), d6c), a); - } - function H7c(a) { - F7c(); - return es((K7c(), J7c), a); - } - function k8c(a) { - i8c(); - return es((n8c(), m8c), a); - } - function V8b(a) { - S8b(); - return es((Y8b(), X8b), a); - } - function A5b(a) { - y5b(); - return es((D5b(), C5b), a); - } - function jad(a) { - ead(); - return es((mad(), lad), a); - } - function sad(a) { - qad(); - return es((vad(), uad), a); - } - function Cad(a) { - Aad(); - return es((Fad(), Ead), a); - } - function Oad(a) { - Mad(); - return es((Rad(), Qad), a); - } - function jbd(a) { - hbd(); - return es((mbd(), lbd), a); - } - function ubd(a) { - rbd(); - return es((xbd(), wbd), a); - } - function Kbd(a) { - Hbd(); - return es((Nbd(), Mbd), a); - } - function Vbd(a) { - Tbd(); - return es((Ybd(), Xbd), a); - } - function hcd(a) { - dcd(); - return es((kcd(), jcd), a); - } - function vcd(a) { - rcd(); - return es((ycd(), xcd), a); - } - function vdd(a) { - tdd(); - return es((ydd(), xdd), a); - } - function Kdd(a) { - Idd(); - return es((Ndd(), Mdd), a); - } - function $cd(a) { - Ucd(); - return es((cdd(), bdd), a); - } - function Fed(a) { - Ded(); - return es((Ied(), Hed), a); - } - function rgd(a) { - pgd(); - return es((ugd(), tgd), a); - } - function Esd(a) { - Csd(); - return es((Hsd(), Gsd), a); - } - function Yoc(a, b) { - return (uCb(a), a) + (uCb(b), b); - } - function NNd(a, b) { - Zfb(); - return wtd(ZKd(a.a), b); - } - function SNd(a, b) { - Zfb(); - return wtd(ZKd(a.a), b); - } - function bPc(a, b) { - this.c = a; - this.a = b; - this.b = b - a; - } - function nYc(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function L1c(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function T1c(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function Rrd(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function zCd(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function IVd(a, b, c2) { - this.e = a; - this.a = b; - this.c = c2; - } - function kWd(a, b, c2) { - UVd(); - cWd.call(this, a, b, c2); - } - function HXd(a, b, c2) { - UVd(); - oXd.call(this, a, b, c2); - } - function TXd(a, b, c2) { - UVd(); - oXd.call(this, a, b, c2); - } - function ZXd(a, b, c2) { - UVd(); - oXd.call(this, a, b, c2); - } - function JXd(a, b, c2) { - UVd(); - HXd.call(this, a, b, c2); - } - function LXd(a, b, c2) { - UVd(); - HXd.call(this, a, b, c2); - } - function NXd(a, b, c2) { - UVd(); - LXd.call(this, a, b, c2); - } - function VXd(a, b, c2) { - UVd(); - TXd.call(this, a, b, c2); - } - function _Xd(a, b, c2) { - UVd(); - ZXd.call(this, a, b, c2); - } - function $j(a, b) { - Qb(a); - Qb(b); - return new _j(a, b); - } - function Nq(a, b) { - Qb(a); - Qb(b); - return new Wq(a, b); - } - function Rq(a, b) { - Qb(a); - Qb(b); - return new ar(a, b); - } - function lr(a, b) { - Qb(a); - Qb(b); - return new zr(a, b); - } - function BD(a, b) { - CCb(a == null || AD(a, b)); - return a; - } - function Nu(a) { - var b; - b = new Rkb(); - fr(b, a); - return b; - } - function Ex(a) { - var b; - b = new Tqb(); - fr(b, a); - return b; - } - function Hx(a) { - var b; - b = new Gxb(); - Jq(b, a); - return b; - } - function Ru(a) { - var b; - b = new Psb(); - Jq(b, a); - return b; - } - function YEc(a) { - !a.e && (a.e = new Rkb()); - return a.e; - } - function SMd(a) { - !a.c && (a.c = new xYd()); - return a.c; - } - function Ekb(a, b) { - a.c[a.c.length] = b; - return true; - } - function WA(a, b) { - this.c = a; - this.b = b; - this.a = false; - } - function Gg(a) { - this.d = a; - Dg(this); - this.b = ed(a.d); - } - function pzb() { - this.a = ";,;"; - this.b = ""; - this.c = ""; - } - function Bvb(a, b, c2) { - qvb.call(this, b, c2); - this.a = a; - } - function fAb(a, b, c2) { - this.b = a; - fvb.call(this, b, c2); - } - function lsb(a, b, c2) { - this.c = a; - pjb.call(this, b, c2); - } - function bCb(a, b, c2) { - $Bb(c2, 0, a, b, c2.length, false); - } - function HVb(a, b, c2, d, e) { - a.b = b; - a.c = c2; - a.d = d; - a.a = e; + return token2; } - function eBb(a, b) { - if (b) { - a.b = b; - a.a = (Tzb(b), b.a); + __name(lex2, "lex"); + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state5] && table[state5][symbol]; } - } - function v_b(a, b, c2, d, e) { - a.d = b; - a.c = c2; - a.a = d; - a.b = e; - } - function h5b(a) { - var b, c2; - b = a.b; - c2 = a.c; - a.b = c2; - a.c = b; - } - function k5b(a) { - var b, c2; - c2 = a.d; - b = a.a; - a.d = b; - a.a = c2; - } - function Lbb(a) { - return zbb(iD(Fbb(a) ? Rbb(a) : a)); - } - function rlc(a, b) { - return beb(D0b(a.d), D0b(b.d)); - } - function uic(a, b) { - return b == (Ucd(), Tcd) ? a.c : a.d; - } - function FHc() { - FHc = ccb; - DHc = (Ucd(), Tcd); - EHc = zcd; - } - function DRb() { - this.b = Edb(ED(Ksd((wSb(), vSb)))); - } - function aBb(a) { - return EAb(), KC(SI, Uhe, 1, a, 5, 1); - } - function C6c(a) { - return new f7c(a.c + a.b, a.d + a.a); - } - function Vmc(a, b) { - Imc(); - return beb(a.d.p, b.d.p); - } - function Lsb(a) { - sCb(a.b != 0); - return Nsb(a, a.a.a); - } - function Msb(a) { - sCb(a.b != 0); - return Nsb(a, a.c.b); - } - function rCb(a, b) { - if (!a) { - throw vbb(new ucb(b)); - } - } - function mCb(a, b) { - if (!a) { - throw vbb(new Wdb(b)); - } - } - function dWb(a, b, c2) { - cWb.call(this, a, b); - this.b = c2; - } - function pMd(a, b, c2) { - MLd.call(this, a, b); - this.c = c2; - } - function Dnc(a, b, c2) { - Cnc.call(this, b, c2); - this.d = a; - } - function _Gd(a) { - $Gd(); - MGd.call(this); - this.th(a); - } - function PNd(a, b, c2) { - this.a = a; - nNd.call(this, b, c2); - } - function UNd(a, b, c2) { - this.a = a; - nNd.call(this, b, c2); - } - function k2d(a, b, c2) { - MLd.call(this, a, b); - this.c = c2; - } - function y1d() { - T0d(); - z1d.call(this, (yFd(), xFd)); - } - function gFd(a) { - return a != null && !OEd(a, CEd, DEd); - } - function dFd(a, b) { - return (jFd(a) << 4 | jFd(b)) & aje; - } - function ln(a, b) { - return Vm(), Wj(a, b), new iy(a, b); - } - function Sdd(a, b) { - var c2; - if (a.n) { - c2 = b; - Ekb(a.f, c2); + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state5]) { + 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 Upd(a, b, c2) { - var d; - d = new yC(c2); - cC(a, b, d); - } - function WUd(a, b) { - var c2; - c2 = a.c; - VUd(a, b); - return c2; - } - function Ydd(a, b) { - b < 0 ? a.g = -1 : a.g = b; - return a; - } - function $6c(a, b) { - W6c(a); - a.a *= b; - a.b *= b; - return a; - } - function G6c(a, b, c2, d, e) { - a.c = b; - a.d = c2; - a.b = d; - a.a = e; - } - function Dsb(a, b) { - Gsb(a, b, a.c.b, a.c); - return true; - } - function jsb(a) { - a.a.b = a.b; - a.b.a = a.a; - a.a = a.b = null; - } - function Aq(a) { - this.b = a; - this.a = Wm(this.b.a).Ed(); - } - function Wq(a, b) { - this.b = a; - this.a = b; - ol.call(this); - } - function ar(a, b) { - this.a = a; - this.b = b; - ol.call(this); - } - function vvb(a, b) { - qvb.call(this, b, 1040); - this.a = a; - } - function Eeb(a) { - return a == 0 || isNaN(a) ? a : a < 0 ? -1 : 1; - } - function WPb(a) { - QPb(); - return jtd(a) == Xod(ltd(a)); - } - function XPb(a) { - QPb(); - return ltd(a) == Xod(jtd(a)); - } - function iYb(a, b) { - return hYb(a, new cWb(b.a, b.b)); - } - function NZb(a) { - return !OZb(a) && a.c.i.c == a.d.i.c; - } - function _Gb(a) { - var b; - b = a.n; - return a.a.b + b.d + b.a; - } - function YHb(a) { - var b; - b = a.n; - return a.e.b + b.d + b.a; - } - function ZHb(a) { - var b; - b = a.n; - return a.e.a + b.b + b.c; - } - function zfe(a) { - wfe(); - return new ige(0, a); - } - function o_b(a) { - if (a.a) { - return a.a; + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } - return JZb(a); - } - function CCb(a) { - if (!a) { - throw vbb(new Cdb(null)); + 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 X6d() { - X6d = ccb; - W6d = (mmb(), new anb(Fwe)); - } - function ex() { - ex = ccb; - new gx((_k(), $k), (Lk(), Kk)); - } - function oeb() { - oeb = ccb; - neb = KC(JI, nie, 19, 256, 0, 1); - } - function d$c(a, b, c2, d) { - e$c.call(this, a, b, c2, d, 0, 0); - } - function sQc(a, b, c2) { - return Rhb(a.b, BD(c2.b, 17), b); - } - function tQc(a, b, c2) { - return Rhb(a.b, BD(c2.b, 17), b); - } - function xfd(a, b) { - return Ekb(a, new f7c(b.a, b.b)); - } - function Bic(a, b) { - return a.c < b.c ? -1 : a.c == b.c ? 0 : 1; - } - function B0b(a) { - return a.e.c.length + a.g.c.length; - } - function D0b(a) { - return a.e.c.length - a.g.c.length; - } - function Ojc(a) { - return a.b.c.length - a.e.c.length; - } - function dKc(a) { - FJc(); - return (Ucd(), Ecd).Hc(a.j); - } - function lHd(a) { - $Gd(); - _Gd.call(this, a); - this.a = -1; - } - function R7d(a, b) { - f7d.call(this, a, b); - this.a = this; - } - function odb(a, b) { - var c2; - c2 = ldb(a, b); - c2.i = 2; - return c2; - } - function Evd(a, b) { - var c2; - ++a.j; - c2 = a.Ti(b); - return c2; - } - function e3c(a, b, c2) { - a.a = -1; - i3c(a, b.g, c2); - return a; - } - function Qrd(a, b, c2) { - Kqd(a.a, a.b, a.c, BD(b, 202), c2); - } - function OHd(a, b) { - PHd(a, b == null ? null : (uCb(b), b)); - } - function SUd(a, b) { - UUd(a, b == null ? null : (uCb(b), b)); - } - function TUd(a, b) { - UUd(a, b == null ? null : (uCb(b), b)); - } - function Zj(a, b, c2) { - return new tk(oAb(a).Ie(), c2, b); - } - function IC(a, b, c2, d, e, f2) { - return JC(a, b, c2, d, e, 0, f2); - } - function Ucb() { - Ucb = ccb; - Tcb = KC(xI, nie, 217, 256, 0, 1); - } - function Ceb() { - Ceb = ccb; - Beb = KC(MI, nie, 162, 256, 0, 1); - } - function Yeb() { - Yeb = ccb; - Xeb = KC(UI, nie, 184, 256, 0, 1); - } - function ddb() { - ddb = ccb; - cdb = KC(yI, nie, 172, 128, 0, 1); - } - function IVb() { - HVb(this, false, false, false, false); - } - function my(a) { - im(); - this.a = (mmb(), new anb(Qb(a))); - } - function ir(a) { - Qb(a); - while (a.Ob()) { - a.Pb(); - a.Qb(); - } - } - function Tw(a) { - a.a.cd(); - BD(a.a.dd(), 14).gc(); - zh(); - } - function mf(a) { - this.c = a; - this.b = this.c.d.vc().Kc(); - } - function fqb(a) { - this.c = a; - this.a = new Gqb(this.c.a); - } - function Vqb(a) { - this.a = new Mqb(a.gc()); - ye(this, a); - } - function Bsb(a) { - Wqb.call(this, new $rb()); - ye(this, a); - } - function Rfb(a, b) { - a.a += zfb(b, 0, b.length); - return a; - } - function Ikb(a, b) { - tCb(b, a.c.length); - return a.c[b]; - } - function $lb(a, b) { - tCb(b, a.a.length); - return a.a[b]; - } - function YAb(a, b) { - EAb(); - Vzb.call(this, a); - this.a = b; - } - function Qyb(a, b) { - return Aeb(wbb(Aeb(a.a).a, b.a)); - } - function jpb(a, b) { - return uCb(a), Fcb(a, (uCb(b), b)); - } - function opb(a, b) { - return uCb(b), Fcb(b, (uCb(a), a)); - } - function Oyb(a, b) { - return NC(b, 0, Bzb(b[0], Aeb(1))); - } - function Bzb(a, b) { - return Qyb(BD(a, 162), BD(b, 162)); - } - function vic(a) { - return a.c - BD(Ikb(a.a, a.b), 287).b; - } - function uNb(a) { - return !a.q ? (mmb(), mmb(), kmb) : a.q; - } - function Xi(a) { - return a.e.Hd().gc() * a.c.Hd().gc(); - } - function onc(a, b, c2) { - return beb(b.d[a.g], c2.d[a.g]); - } - function YHc(a, b, c2) { - return beb(a.d[b.p], a.d[c2.p]); - } - function ZHc(a, b, c2) { - return beb(a.d[b.p], a.d[c2.p]); - } - function $Hc(a, b, c2) { - return beb(a.d[b.p], a.d[c2.p]); - } - function _Hc(a, b, c2) { - return beb(a.d[b.p], a.d[c2.p]); - } - function q$c(a, b, c2) { - return $wnd.Math.min(c2 / a, 1 / b); - } - function sEc(a, b) { - return a ? 0 : $wnd.Math.max(0, b - 1); - } - function Elb(a, b) { - var c2; - for (c2 = 0; c2 < b; ++c2) { - a[c2] = -1; - } - } - function bVc(a) { - var b; - b = hVc(a); - return !b ? a : bVc(b); - } - function Voc(a, b) { - a.a == null && Toc(a); - return a.a[b]; - } - function qed(a) { - if (a.c) { - return a.c.f; - } - return a.e.b; - } - function red(a) { - if (a.c) { - return a.c.g; - } - return a.e.a; - } - function pFd(a) { - zud.call(this, a.gc()); - ytd(this, a); - } - function nXd(a, b) { - UVd(); - VVd.call(this, b); - this.a = a; - } - function KYd(a, b, c2) { - this.a = a; - xMd.call(this, b, c2, 2); - } - function B_b(a, b, c2, d) { - v_b(this, a, b, c2, d); - } - function ige(a, b) { - wfe(); - xfe.call(this, a); - this.a = b; - } - function jgd(a) { - this.b = new Psb(); - this.a = a; - this.c = -1; - } - function MOb() { - this.d = new f7c(0, 0); - this.e = new Tqb(); - } - function Nr(a) { - qc.call(this, 0, 0); - this.a = a; - this.b = 0; - } - function ejc(a) { - this.a = a; - this.c = new Lqb(); - $ic(this); - } - function ju(a) { - if (a.e.c != a.b) { - throw vbb(new Apb()); - } - } - function bt(a) { - if (a.c.e != a.a) { - throw vbb(new Apb()); - } - } - function Tbb(a) { - if (Fbb(a)) { - return a | 0; - } - return pD(a); - } - function Bfe(a, b) { - wfe(); - return new rge(a, b); - } - function SEd(a, b) { - return a == null ? b == null : dfb(a, b); - } - function TEd(a, b) { - return a == null ? b == null : efb(a, b); - } - function Npb(a, b, c2) { - rqb(a.a, b); - return Qpb(a, b.g, c2); - } - function Mlb(a, b, c2) { - oCb(0, b, a.length); - Klb(a, 0, b, c2); - } - function Dkb(a, b, c2) { - wCb(b, a.c.length); - aCb(a.c, b, c2); - } - function Dlb(a, b, c2) { - var d; - for (d = 0; d < b; ++d) { - a[d] = c2; - } - } - function qqb(a, b) { - var c2; - c2 = pqb(a); - nmb(c2, b); - return c2; - } - function Oz(a, b) { - !a && (a = []); - a[a.length] = b; - return a; - } - function Brb(a, b) { - return !(a.a.get(b) === void 0); - } - function Wyb(a, b) { - return Nyb(new rzb(), new bzb(a), b); - } - function Itb(a) { - return a == null ? ztb : new Ftb(uCb(a)); - } - function tqb(a, b) { - return JD(b, 22) && uqb(a, BD(b, 22)); - } - function vqb(a, b) { - return JD(b, 22) && wqb(a, BD(b, 22)); - } - function Aub(a) { - return Cub(a, 26) * ike + Cub(a, 27) * jke; - } - function MC(a) { - return Array.isArray(a) && a.im === gcb; - } - function bg(a) { - a.b ? bg(a.b) : a.d.dc() && a.f.c.Bc(a.e); - } - function $Nb(a, b) { - P6c(a.c, b); - a.b.c += b.a; - a.b.d += b.b; - } - function ZNb(a, b) { - $Nb(a, c7c(new f7c(b.a, b.b), a.c)); - } - function BLb(a, b) { - this.b = new Psb(); - this.a = a; - this.c = b; - } - function OVb() { - this.b = new $Vb(); - this.c = new SVb(this); - } - function oEb() { - this.d = new CEb(); - this.e = new uEb(this); - } - function aCc() { - ZBc(); - this.f = new Psb(); - this.e = new Psb(); - } - function $Jc() { - FJc(); - this.k = new Lqb(); - this.d = new Tqb(); - } - function Rgd() { - Rgd = ccb; - Qgd = new Osd((Y9c(), s9c), 0); - } - function Mr() { - Mr = ccb; - Lr = new Nr(KC(SI, Uhe, 1, 0, 5, 1)); - } - function gfc(a, b, c2) { - bfc(c2, a, 1); - Ekb(b, new Tfc(c2, a)); - } - function hfc(a, b, c2) { - cfc(c2, a, 1); - Ekb(b, new dgc(c2, a)); - } - function R$c(a, b, c2) { - return Qqb(a, new aDb(b.a, c2.a)); - } - function ACc(a, b, c2) { - return -beb(a.f[b.p], a.f[c2.p]); - } - function mHb(a, b, c2) { - var d; - if (a) { - d = a.i; - d.c = b; - d.b = c2; - } - } - function nHb(a, b, c2) { - var d; - if (a) { - d = a.i; - d.d = b; - d.a = c2; - } - } - function c3c(a, b, c2) { - a.a = -1; - i3c(a, b.g + 1, c2); - return a; - } - function Dod(a, b, c2) { - c2 = _hd(a, BD(b, 49), 7, c2); - return c2; - } - function JHd(a, b, c2) { - c2 = _hd(a, BD(b, 49), 3, c2); - return c2; - } - function JMd(a, b, c2) { - this.a = a; - BMd.call(this, b, c2, 22); - } - function UTd(a, b, c2) { - this.a = a; - BMd.call(this, b, c2, 14); - } - function eXd(a, b, c2, d) { - UVd(); - nWd.call(this, a, b, c2, d); - } - function lXd(a, b, c2, d) { - UVd(); - nWd.call(this, a, b, c2, d); - } - function FNd(a, b) { - (b.Bb & ote) != 0 && !a.a.o && (a.a.o = b); - } - function MD(a) { - return a != null && OD(a) && !(a.im === gcb); - } - function ID(a) { - return !Array.isArray(a) && a.im === gcb; - } - function ed(a) { - return JD(a, 15) ? BD(a, 15).Yc() : a.Kc(); - } - function De(a) { - return a.Qc(KC(SI, Uhe, 1, a.gc(), 5, 1)); - } - function u1d(a, b) { - return W1d(p1d(a, b)) ? b.Qh() : null; - } - function uvd(a) { - a ? Ty(a, (Zfb(), Yfb)) : (Zfb(), Yfb); - } - function Sr(a) { - this.a = (Mr(), Lr); - this.d = BD(Qb(a), 47); - } - function qg(a, b, c2, d) { - this.a = a; - dg.call(this, a, b, c2, d); - } - function Yge(a) { - Xge(); - this.a = 0; - this.b = a - 1; - this.c = 1; - } - function Yy(a) { - Py(this); - this.g = a; - Ry(this); - this._d(); - } - function Wm(a) { - if (a.c) { - return a.c; - } - return a.c = a.Id(); - } - function Xm(a) { - if (a.d) { - return a.d; - } - return a.d = a.Jd(); - } - function Rl(a) { - var b; - b = a.c; - return !b ? a.c = a.Dd() : b; - } - 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 Ffe(a) { - wfe(); - return new Hge(10, a, 0); - } - function Ubb(a) { - if (Fbb(a)) { - return "" + a; - } - return qD(a); - } - function a4d(a) { - if (a.e.j != a.d) { - throw vbb(new Apb()); - } - } - function Nbb(a, b) { - return zbb(kD(Fbb(a) ? Rbb(a) : a, b)); - } - function Obb(a, b) { - return zbb(lD(Fbb(a) ? Rbb(a) : a, b)); - } - function Pbb(a, b) { - return zbb(mD(Fbb(a) ? Rbb(a) : a, b)); - } - function Dcb(a, b) { - return Ecb((uCb(a), a), (uCb(b), b)); - } - function Ddb(a, b) { - return Kdb((uCb(a), a), (uCb(b), b)); - } - function fx(a, b) { - return Qb(b), a.a.Ad(b) && !a.b.Ad(b); - } - function dD(a, b) { - return TC(a.l & b.l, a.m & b.m, a.h & b.h); - } - function jD(a, b) { - return TC(a.l | b.l, a.m | b.m, a.h | b.h); - } - function rD(a, b) { - return TC(a.l ^ b.l, a.m ^ b.m, a.h ^ b.h); - } - function QAb(a, b) { - return TAb(a, (uCb(b), new Rxb(b))); - } - function RAb(a, b) { - return TAb(a, (uCb(b), new Txb(b))); - } - function g1b(a) { - return z0b(), BD(a, 11).e.c.length != 0; - } - function l1b(a) { - return z0b(), BD(a, 11).g.c.length != 0; - } - function bac(a, b) { - I9b(); - return Kdb(b.a.o.a, a.a.o.a); - } - function Rnc(a, b, c2) { - return Snc(a, BD(b, 11), BD(c2, 11)); - } - function koc(a) { - if (a.e) { - return poc(a.e); - } - return null; - } - function Iub(a) { - if (!a.d) { - a.d = a.b.Kc(); - a.c = a.b.gc(); - } - } - function pBb(a, b, c2) { - if (a.a.Mb(c2)) { - a.b = true; - b.td(c2); - } - } - function _vb(a, b) { - if (a < 0 || a >= b) { - throw vbb(new rcb()); - } - } - function Pyb(a, b, c2) { - NC(b, 0, Bzb(b[0], c2[0])); - return b; - } - function _yc(a, b, c2) { - b.Ye(c2, Edb(ED(Ohb(a.b, c2))) * a.a); - } - function n6c(a, b, c2) { - i6c(); - return m6c(a, b) && m6c(a, c2); - } - function tcd(a) { - rcd(); - return !a.Hc(ncd) && !a.Hc(pcd); - } - function D6c(a) { - return new f7c(a.c + a.b / 2, a.d + a.a / 2); - } - function oOd(a, b) { - return b.kh() ? xid(a.b, BD(b, 49)) : b; - } - function bvb(a, b) { - this.e = a; - this.d = (b & 64) != 0 ? b | oie : b; - } - function qvb(a, b) { - this.c = 0; - this.d = a; - this.b = b | 64 | oie; - } - function gub(a) { - this.b = new Skb(11); - this.a = (ipb(), a); - } - function Qwb(a) { - this.b = null; - this.a = (ipb(), !a ? fpb : a); - } - function nHc(a) { - this.a = lHc(a.a); - this.b = new Tkb(a.b); - } - function Pzd(a) { - this.b = a; - Oyd.call(this, a); - Ozd(this); - } - function Xzd(a) { - this.b = a; - bzd.call(this, a); - Wzd(this); - } - function jUd(a, b, c2) { - this.a = a; - gUd.call(this, b, c2, 5, 6); - } - function Y5d(a, b, c2, d) { - this.b = a; - xMd.call(this, b, c2, d); - } - function nSd(a, b, c2, d, e) { - oSd.call(this, a, b, c2, d, e, -1); - } - function DSd(a, b, c2, d, e) { - ESd.call(this, a, b, c2, d, e, -1); - } - function cUd(a, b, c2, d) { - xMd.call(this, a, b, c2); - this.b = d; - } - function i5d(a, b, c2, d) { - pMd.call(this, a, b, c2); - this.b = d; - } - function x0d(a) { - Wud.call(this, a, false); - this.a = false; - } - function Lj(a, b) { - this.b = a; - sj.call(this, a.b); - this.a = b; - } - function px(a, b) { - im(); - ox.call(this, a, Dm(new amb(b))); - } - function Cfe(a, b) { - wfe(); - return new Dge(a, b, 0); - } - function Efe(a, b) { - wfe(); - return new Dge(6, a, b); - } - function nfb(a, b) { - return dfb(a.substr(0, b.length), b); - } - function Mhb(a, b) { - return ND(b) ? Qhb(a, b) : !!irb(a.f, b); - } - function Rrb(a, b) { - uCb(b); - while (a.Ob()) { - b.td(a.Pb()); - } - } - function Vgb(a, b, c2) { - Hgb(); - this.e = a; - this.d = b; - this.a = c2; - } - function amc(a, b, c2, d) { - var e; - e = a.i; - e.i = b; - e.a = c2; - e.b = d; - } - function xJc(a) { - var b; - b = a; - while (b.f) { - b = b.f; - } - return b; - } - function fkb(a) { - var b; - b = bkb(a); - sCb(b != null); - return b; - } - function gkb(a) { - var b; - b = ckb(a); - sCb(b != null); - return b; - } - function cv(a, b) { - var c2; - c2 = a.a.gc(); - Sb(b, c2); - return c2 - b; - } - function Glb(a, b) { - var c2; - for (c2 = 0; c2 < b; ++c2) { - a[c2] = false; - } - } - function Clb(a, b, c2, d) { - var e; - for (e = b; e < c2; ++e) { - a[e] = d; - } - } - function ylb(a, b, c2, d) { - oCb(b, c2, a.length); - Clb(a, b, c2, d); - } - function Vvb(a, b, c2) { - _vb(c2, a.a.c.length); - Nkb(a.a, c2, b); - } - function Lyb(a, b, c2) { - this.c = a; - this.a = b; - mmb(); - this.b = c2; - } - function Qpb(a, b, c2) { - var d; - d = a.b[b]; - a.b[b] = c2; - return d; - } - function Qqb(a, b) { - var c2; - c2 = a.a.zc(b, a); - return c2 == null; - } - function zjb(a) { - if (!a) { - throw vbb(new utb()); - } - return a.d; - } - function vCb(a, b) { - if (a == null) { - throw vbb(new Heb(b)); - } - } - function Goc(a, b) { - if (!b) { - return false; - } - return ye(a, b); - } - function K2c(a, b, c2) { - C2c(a, b.g, c2); - rqb(a.c, b); - return a; - } - function vVb(a) { - tVb(a, (ead(), aad)); - a.d = true; - return a; - } - function c2d(a) { - !a.j && i2d(a, d1d(a.g, a.b)); - return a.j; - } - function nlb(a) { - yCb(a.b != -1); - Kkb(a.c, a.a = a.b); - a.b = -1; - } - function Uhb(a) { - a.f = new lrb(a); - a.g = new Frb(a); - zpb(a); - } - function Plb(a) { - return new YAb(null, Olb(a, a.length)); - } - function ul(a) { - return new Sr(new xl(a.a.length, a.a)); - } - function iD(a) { - return TC(~a.l & Eje, ~a.m & Eje, ~a.h & Fje); - } - function OD(a) { - return typeof a === Jhe || typeof a === Nhe; - } - function D9d(a) { - return a == Pje ? Nwe : a == Qje ? "-INF" : "" + a; - } - function F9d(a) { - return a == Pje ? Nwe : a == Qje ? "-INF" : "" + a; - } - function yRb(a, b) { - return a > 0 ? $wnd.Math.log(a / b) : -100; - } - function ueb(a, b) { - return ybb(a, b) < 0 ? -1 : ybb(a, b) > 0 ? 1 : 0; - } - function HMb(a, b, c2) { - return IMb(a, BD(b, 46), BD(c2, 167)); - } - function iq(a, b) { - return BD(Rl(Wm(a.a)).Xb(b), 42).cd(); - } - function Olb(a, b) { - return avb(b, a.length), new vvb(a, b); - } - function Pyd(a, b) { - this.d = a; - Fyd.call(this, a); - this.e = b; - } - function Lub(a) { - this.d = (uCb(a), a); - this.a = 0; - this.c = rie; - } - function rge(a, b) { - xfe.call(this, 1); - this.a = a; - this.b = b; - } - function Rzb(a, b) { - !a.c ? Ekb(a.b, b) : Rzb(a.c, b); - return a; - } - function uB(a, b, c2) { - var d; - d = tB(a, b); - vB(a, b, c2); - return d; - } - function ZBb(a, b) { - var c2; - c2 = a.slice(0, b); - return PC(c2, a); - } - function Flb(a, b, c2) { - var d; - for (d = 0; d < b; ++d) { - NC(a, d, c2); - } - } - function ffb(a, b, c2, d, e) { - while (b < c2) { - d[e++] = bfb(a, b++); - } - } - function hLb(a, b) { - return Kdb(a.c.c + a.c.b, b.c.c + b.c.b); - } - function Axb(a, b) { - return Iwb(a.a, b, (Bcb(), zcb)) == null; - } - function Vsb(a, b) { - Gsb(a.d, b, a.b.b, a.b); - ++a.a; - a.c = null; - } - function d3d(a, b) { - JLd(a, JD(b, 153) ? b : BD(b, 1937).gl()); - } - function hkc(a, b) { - MAb(NAb(a.Oc(), new Rkc()), new Tkc(b)); - } - function kkc(a, b, c2, d, e) { - jkc(a, BD(Qc(b.k, c2), 15), c2, d, e); - } - function lOc(a) { - a.s = NaN; - a.c = NaN; - mOc(a, a.e); - mOc(a, a.j); - } - function it(a) { - a.a = null; - a.e = null; - Uhb(a.b); - a.d = 0; - ++a.c; - } - function gKc(a) { - return $wnd.Math.abs(a.d.e - a.e.e) - a.a; - } - function MAd(a, b, c2) { - return BD(a.c._c(b, BD(c2, 133)), 42); - } - function os() { - hs(); - return OC(GC(yG, 1), Kie, 538, 0, [gs]); - } - function VPb(a) { - QPb(); - return Xod(jtd(a)) == Xod(ltd(a)); - } - function aRb(a) { - _Qb.call(this); - this.a = a; - Ekb(a.a, this); - } - function tPc(a, b) { - this.d = DPc(a); - this.c = b; - this.a = 0.5 * b; - } - function A6d() { - $rb.call(this); - this.a = true; - this.b = true; - } - function aLd(a) { - return (a.i == null && TKd(a), a.i).length; - } - function oRd(a) { - return JD(a, 99) && (BD(a, 18).Bb & ote) != 0; - } - function w2d(a, b) { - ++a.j; - t3d(a, a.i, b); - v2d(a, BD(b, 332)); - } - function vId(a, b) { - b = a.nk(null, b); - return uId(a, null, b); - } - function ytd(a, b) { - a.hi() && (b = Dtd(a, b)); - return a.Wh(b); - } - function mdb(a, b, c2) { - var d; - d = ldb(a, b); - zdb(c2, d); - return d; - } - function ldb(a, b) { - var c2; - c2 = new jdb(); - c2.j = a; - c2.d = b; - return c2; - } - function Qb(a) { - if (a == null) { - throw vbb(new Geb()); - } - return a; - } - function Fc(a) { - var b; - b = a.j; - return !b ? a.j = new Cw(a) : b; - } - function Vi(a) { - var b; - b = a.f; - return !b ? a.f = new Rj(a) : b; - } - function ci(a) { - var b; - return b = a.k, !b ? a.k = new th(a) : b; - } - function Uc(a) { - var b; - return b = a.k, !b ? a.k = new th(a) : b; - } - function Pc(a) { - var b; - return b = a.g, !b ? a.g = new lh(a) : b; - } - function Yi(a) { - var b; - return b = a.i, !b ? a.i = new Ci(a) : b; - } - function qo(a) { - var b; - b = a.d; - return !b ? a.d = new ap(a) : b; - } - function Fb(a) { - Qb(a); - return JD(a, 475) ? BD(a, 475) : fcb(a); - } - function Ix(a) { - if (JD(a, 607)) { - return a; - } - return new by(a); - } - function qj(a, b) { - Pb(b, a.c.b.c.gc()); - return new Fj(a, b); - } - function Dfe(a, b, c2) { - wfe(); - return new zge(a, b, c2); - } - function NC(a, b, c2) { - qCb(c2 == null || FC(a, c2)); - return a[b] = c2; - } - function bv(a, b) { - var c2; - c2 = a.a.gc(); - Pb(b, c2); - return c2 - 1 - b; - } - function Afb(a, b) { - a.a += String.fromCharCode(b); - return a; - } - function Kfb(a, b) { - a.a += String.fromCharCode(b); - return a; - } - function ovb(a, b) { - uCb(b); - while (a.c < a.d) { - a.ze(b, a.c++); - } - } - function Ohb(a, b) { - return ND(b) ? Phb(a, b) : Wd(irb(a.f, b)); - } - function ZPb(a, b) { - QPb(); - return a == jtd(b) ? ltd(b) : jtd(b); - } - function isd(a, b) { - Qpd(a, new yC(b.f != null ? b.f : "" + b.g)); - } - function ksd(a, b) { - Qpd(a, new yC(b.f != null ? b.f : "" + b.g)); - } - function dVb(a) { - this.b = new Rkb(); - this.a = new Rkb(); - this.c = a; - } - function H1b(a) { - this.c = new d7c(); - this.a = new Rkb(); - this.b = a; - } - function pRb(a) { - _Qb.call(this); - this.a = new d7c(); - this.c = a; - } - function yC(a) { - if (a == null) { - throw vbb(new Geb()); - } - this.a = a; - } - function HA(a) { - fA(); - this.b = new Rkb(); - this.a = a; - sA(this, a); - } - function v4c(a) { - this.c = a; - this.a = new Psb(); - this.b = new Psb(); - } - function GB() { - GB = ccb; - EB = new HB(false); - FB = new HB(true); - } - function im() { - im = ccb; - Ql(); - hm = new ux((mmb(), mmb(), jmb)); - } - function yx() { - yx = ccb; - Ql(); - xx = new zx((mmb(), mmb(), lmb)); - } - function NFd() { - NFd = ccb; - MFd = BZd(); - !!(jGd(), PFd) && DZd(); - } - function aac(a, b) { - I9b(); - return BD(Mpb(a, b.d), 15).Fc(b); - } - function pTb(a, b, c2, d) { - return c2 == 0 || (c2 - d) / c2 < a.e || b >= a.g; - } - function NHc(a, b, c2) { - var d; - d = THc(a, b, c2); - return MHc(a, d); - } - function Qpd(a, b) { - var c2; - c2 = a.a.length; - tB(a, c2); - vB(a, c2, b); - } - function gCb(a, b) { - var c2; - c2 = console[a]; - c2.call(console, b); - } - function Bvd(a, b) { - var c2; - ++a.j; - c2 = a.Vi(); - a.Ii(a.oi(c2, b)); - } - function E1c(a, b, c2) { - BD(b.b, 65); - Hkb(b.a, new L1c(a, c2, b)); - } - function oXd(a, b, c2) { - VVd.call(this, b); - this.a = a; - this.b = c2; - } - function Dge(a, b, c2) { - xfe.call(this, a); - this.a = b; - this.b = c2; - } - function dYd(a, b, c2) { - this.a = a; - lVd.call(this, b); - this.b = c2; - } - function f0d(a, b, c2) { - this.a = a; - mxd.call(this, 8, b, null, c2); - } - function z1d(a) { - this.a = (uCb(Rve), Rve); - this.b = a; - new oUd(); - } - function ct(a) { - this.c = a; - this.b = this.c.a; - this.a = this.c.e; - } - function usb(a) { - this.c = a; - this.b = a.a.d.a; - ypb(a.a.e, this); - } - function uib(a) { - yCb(a.c != -1); - a.d.$c(a.c); - a.b = a.c; - a.c = -1; - } - function U6c(a) { - return $wnd.Math.sqrt(a.a * a.a + a.b * a.b); - } - function Uvb(a, b) { - return _vb(b, a.a.c.length), Ikb(a.a, b); - } - function Hb(a, b) { - return PD(a) === PD(b) || a != null && pb(a, b); - } - function oAb(a) { - if (0 >= a) { - return new yAb(); - } - return pAb(a - 1); - } - function Nfe(a) { - if (!bfe) - return false; - return Qhb(bfe, a); - } - function Ehe(a) { - if (a) - return a.dc(); - return !a.Kc().Ob(); - } - function Q_b(a) { - if (!a.a && !!a.c) { - return a.c.b; - } - return a.a; - } - function LHd(a) { - !a.a && (a.a = new xMd(m5, a, 4)); - return a.a; - } - function LQd(a) { - !a.d && (a.d = new xMd(j5, a, 1)); - return a.d; - } - function uCb(a) { - if (a == null) { - throw vbb(new Geb()); - } - return a; - } - function Qzb(a) { - if (!a.c) { - a.d = true; - Szb(a); - } else { - a.c.He(); - } - } - function Tzb(a) { - if (!a.c) { - Uzb(a); - a.d = 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 { - Tzb(a.c); - } - } - function Kpb(a) { - Ae(a.a); - a.b = KC(SI, Uhe, 1, a.b.length, 5, 1); - } - function qlc(a, b) { - return beb(b.j.c.length, a.j.c.length); - } - function igd(a, b) { - a.c < 0 || a.b.b < a.c ? Fsb(a.b, b) : a.a._e(b); - } - function Did(a, b) { - var c2; - c2 = a.Yg(b); - c2 >= 0 ? a.Bh(c2) : vid(a, b); - } - function WHc(a) { - var b, c2; - b = a.c.i.c; - c2 = a.d.i.c; - return b == c2; - } - function Wwd(a) { - if (a.p != 4) - throw vbb(new Ydb()); - return a.e; - } - function Vwd(a) { - if (a.p != 3) - throw vbb(new Ydb()); - return a.e; - } - function Ywd(a) { - if (a.p != 6) - throw vbb(new Ydb()); - return a.f; - } - function fxd(a) { - if (a.p != 6) - throw vbb(new Ydb()); - return a.k; - } - function cxd(a) { - if (a.p != 3) - throw vbb(new Ydb()); - return a.j; - } - function dxd(a) { - if (a.p != 4) - throw vbb(new Ydb()); - return a.j; - } - function AYd(a) { - !a.b && (a.b = new RYd(new NYd())); - return a.b; - } - function $1d(a) { - a.c == -2 && e2d(a, X0d(a.g, a.b)); - return a.c; - } - function pdb(a, b) { - var c2; - c2 = ldb("", a); - c2.n = b; - c2.i = 1; - return c2; - } - function MNb(a, b) { - $Nb(BD(b.b, 65), a); - Hkb(b.a, new RNb(a)); - } - function Cnd(a, b) { - wtd((!a.a && (a.a = new fTd(a, a)), a.a), b); - } - function Qzd(a, b) { - this.b = a; - Pyd.call(this, a, b); - Ozd(this); - } - function Yzd(a, b) { - this.b = a; - czd.call(this, a, b); - Wzd(this); - } - function Ms(a, b, c2, d) { - Wo.call(this, a, b); - this.d = c2; - this.a = d; - } - function $o(a, b, c2, d) { - Wo.call(this, a, c2); - this.a = b; - this.f = d; - } - function iy(a, b) { - Pp.call(this, umb(Qb(a), Qb(b))); - this.a = b; - } - function cae() { - fod.call(this, Ewe, (p8d(), o8d)); - $9d(this); - } - function AZd() { - fod.call(this, _ve, (LFd(), KFd)); - uZd(this); - } - function T0c() { - $r.call(this, "DELAUNAY_TRIANGULATION", 0); - } - function vfb(a) { - return String.fromCharCode.apply(null, a); - } - function Rhb(a, b, c2) { - return ND(b) ? Shb(a, b, c2) : jrb(a.f, b, c2); - } - function tmb(a) { - mmb(); - return !a ? (ipb(), ipb(), hpb) : a.ve(); - } - function d2c(a, b, c2) { - Y1c(); - return c2.pg(a, BD(b.cd(), 146)); - } - function ix(a, b) { - ex(); - return new gx(new il(a), new Uk(b)); - } - function Iu(a) { - Xj(a, Mie); - return Oy(wbb(wbb(5, a), a / 10 | 0)); - } - function Vm() { - Vm = ccb; - Um = new wx(OC(GC(CK, 1), zie, 42, 0, [])); - } - function hob(a) { - !a.d && (a.d = new lnb(a.c.Cc())); - return a.d; - } - function eob(a) { - !a.a && (a.a = new Gob(a.c.vc())); - return a.a; - } - function gob(a) { - !a.b && (a.b = new zob(a.c.ec())); - return a.b; - } - function keb(a, b) { - while (b-- > 0) { - a = a << 1 | (a < 0 ? 1 : 0); - } - return a; - } - function wtb(a, b) { - return PD(a) === PD(b) || a != null && pb(a, b); - } - function Gbc(a, b) { - return Bcb(), BD(b.b, 19).a < a ? true : false; - } - function Hbc(a, b) { - return Bcb(), BD(b.a, 19).a < a ? true : false; - } - function Mpb(a, b) { - return tqb(a.a, b) ? a.b[BD(b, 22).g] : null; - } - function kcb(a, b, c2, d) { - a.a = qfb(a.a, 0, b) + ("" + d) + pfb(a.a, c2); - } - function OJb(a, b) { - a.u.Hc((rcd(), ncd)) && MJb(a, b); - QJb(a, b); - } - function bfb(a, b) { - BCb(b, a.length); - return a.charCodeAt(b); - } - function vtb() { - hz.call(this, "There is no more element."); - } - function xkb(a) { - this.d = a; - this.a = this.d.b; - this.b = this.d.c; - } - function kEb(a) { - a.b = false; - a.c = false; - a.d = false; - a.a = false; - } - function Znd(a, b, c2, d) { - Ynd(a, b, c2, false); - LPd(a, d); - return a; - } - function h3c(a) { - a.j.c = KC(SI, Uhe, 1, 0, 5, 1); - a.a = -1; - return a; - } - function Old(a) { - !a.c && (a.c = new y5d(z2, a, 5, 8)); - return a.c; - } - function Nld(a) { - !a.b && (a.b = new y5d(z2, a, 4, 7)); - return a.b; - } - function Kkd(a) { - !a.n && (a.n = new cUd(D2, a, 1, 7)); - return a.n; - } - function Yod(a) { - !a.c && (a.c = new cUd(F2, a, 9, 9)); - return a.c; - } - function a2d(a) { - a.e == Gwe && g2d(a, a1d(a.g, a.b)); - return a.e; - } - function b2d(a) { - a.f == Gwe && h2d(a, b1d(a.g, a.b)); - return a.f; - } - function Ah(a) { - var b; - b = a.b; - !b && (a.b = b = new Ph(a)); - return b; - } - function Ae(a) { - var b; - for (b = a.Kc(); b.Ob(); ) { - b.Pb(); - b.Qb(); - } - } - function Fg(a) { - ag(a.d); - if (a.d.d != a.c) { - throw vbb(new Apb()); - } - } - function Xx(a, b) { - this.b = a; - this.c = b; - this.a = new Gqb(this.b); - } - function Zeb(a, b, c2) { - this.a = Zie; - this.d = a; - this.b = b; - this.c = c2; - } - function Mub(a, b) { - this.d = (uCb(a), a); - this.a = 16449; - this.c = b; - } - function nqd(a, b) { - ctd(a, Edb(Xpd(b, "x")), Edb(Xpd(b, "y"))); - } - function Aqd(a, b) { - ctd(a, Edb(Xpd(b, "x")), Edb(Xpd(b, "y"))); - } - function JAb(a, b) { - Uzb(a); - return new YAb(a, new qBb(b, a.a)); - } - function NAb(a, b) { - Uzb(a); - return new YAb(a, new IBb(b, a.a)); - } - function OAb(a, b) { - Uzb(a); - return new bAb(a, new wBb(b, a.a)); - } - function PAb(a, b) { - Uzb(a); - return new vAb(a, new CBb(b, a.a)); - } - function Cy(a, b) { - return new Ay(BD(Qb(a), 62), BD(Qb(b), 62)); - } - function PWb(a, b) { - LWb(); - return Kdb((uCb(a), a), (uCb(b), b)); - } - function fPb() { - cPb(); - return OC(GC(GO, 1), Kie, 481, 0, [bPb]); - } - function o_c() { - i_c(); - return OC(GC(N_, 1), Kie, 482, 0, [h_c]); - } - function x_c() { - s_c(); - return OC(GC(O_, 1), Kie, 551, 0, [r_c]); - } - function X0c() { - R0c(); - return OC(GC(W_, 1), Kie, 530, 0, [Q0c]); - } - function cEc(a) { - this.a = new Rkb(); - this.e = KC(WD, nie, 48, a, 0, 2); - } - function l$b(a, b, c2, d) { - this.a = a; - this.e = b; - this.d = c2; - this.c = d; - } - function QIc(a, b, c2, d) { - this.a = a; - this.c = b; - this.b = c2; - this.d = d; - } - function rKc(a, b, c2, d) { - this.c = a; - this.b = b; - this.a = c2; - this.d = d; - } - function WKc(a, b, c2, d) { - this.c = a; - this.b = b; - this.d = c2; - this.a = d; - } - function J6c(a, b, c2, d) { - this.c = a; - this.d = b; - this.b = c2; - this.a = d; - } - function gPc(a, b, c2, d) { - this.a = a; - this.d = b; - this.c = c2; - this.b = d; - } - function Blc(a, b, c2, d) { - $r.call(this, a, b); - this.a = c2; - this.b = d; - } - function Ggd(a, b, c2, d) { - this.a = a; - this.c = b; - this.d = c2; - this.b = d; - } - function pec(a, b, c2) { - Pmc(a.a, c2); - dmc(c2); - enc(a.b, c2); - xmc(b, c2); - } - function Pid(a, b, c2) { - var d, e; - d = QEd(a); - e = b.Kh(c2, d); - return e; - } - function KPb(a, b) { - var c2, d; - c2 = a / b; - d = QD(c2); - c2 > d && ++d; - return d; - } - function Nnd(a) { - var b, c2; - c2 = (b = new UQd(), b); - NQd(c2, a); - return c2; - } - function Ond(a) { - var b, c2; - c2 = (b = new UQd(), b); - RQd(c2, a); - return c2; - } - function hqd(a, b) { - var c2; - c2 = Ohb(a.f, b); - Yqd(b, c2); - return null; - } - function JZb(a) { - var b; - b = P2b(a); - if (b) { - return b; - } - return null; - } - function Wod(a) { - !a.b && (a.b = new cUd(B2, a, 12, 3)); - return a.b; - } - function YEd(a) { - return a != null && hnb(GEd, a.toLowerCase()); - } - function ied(a, b) { - return Kdb(red(a) * qed(a), red(b) * qed(b)); - } - function jed(a, b) { - return Kdb(red(a) * qed(a), red(b) * qed(b)); - } - function wEb(a, b) { - return Kdb(a.d.c + a.d.b / 2, b.d.c + b.d.b / 2); - } - function UVb(a, b) { - return Kdb(a.g.c + a.g.b / 2, b.g.c + b.g.b / 2); - } - function pQb(a, b, c2) { - c2.a ? eld(a, b.b - a.f / 2) : dld(a, b.a - a.g / 2); - } - function prd(a, b, c2, d) { - this.a = a; - this.b = b; - this.c = c2; - this.d = d; - } - function ord(a, b, c2, d) { - this.a = a; - this.b = b; - this.c = c2; - this.d = d; - } - function JVd(a, b, c2, d) { - this.e = a; - this.a = b; - this.c = c2; - this.d = d; - } - function ZVd(a, b, c2, d) { - this.a = a; - this.c = b; - this.d = c2; - this.b = d; - } - function cXd(a, b, c2, d) { - UVd(); - mWd.call(this, b, c2, d); - this.a = a; - } - function jXd(a, b, c2, d) { - UVd(); - mWd.call(this, b, c2, d); - this.a = a; - } - function Ng(a, b) { - this.a = a; - Hg.call(this, a, BD(a.d, 15).Zc(b)); - } - function ZBd(a) { - this.f = a; - this.c = this.f.e; - a.f > 0 && YBd(this); - } - function lBb(a, b, c2, d) { - this.b = a; - this.c = d; - nvb.call(this, b, c2); - } - function tib(a) { - sCb(a.b < a.d.gc()); - return a.d.Xb(a.c = a.b++); - } - function Osb(a) { - a.a.a = a.c; - a.c.b = a.a; - a.a.b = a.c.a = null; - a.b = 0; - } - function u_b(a, b) { - a.b = b.b; - a.c = b.c; - a.d = b.d; - a.a = b.a; - return a; - } - function Ry(a) { - if (a.n) { - a.e !== Sie && a._d(); - a.j = null; - } - return a; - } - function FD(a) { - CCb(a == null || OD(a) && !(a.im === gcb)); - return a; - } - function p4b(a) { - this.b = new Rkb(); - Gkb(this.b, this.b); - this.a = a; - } - function QPb() { - QPb = ccb; - PPb = new Rkb(); - OPb = new Lqb(); - NPb = new Rkb(); - } - function mmb() { - mmb = ccb; - jmb = new xmb(); - kmb = new Qmb(); - lmb = new Ymb(); - } - function ipb() { - ipb = ccb; - fpb = new kpb(); - gpb = new kpb(); - hpb = new ppb(); - } - function ODb() { - ODb = ccb; - LDb = new JDb(); - NDb = new oEb(); - MDb = new fEb(); - } - function MCb() { - if (HCb == 256) { - GCb = ICb; - ICb = new nb(); - HCb = 0; - } - ++HCb; - } - function nd(a) { - var b; - return b = a.f, !b ? a.f = new ne(a, a.c) : b; - } - function d2b(a) { - return Qld(a) && Ccb(DD(hkd(a, (Nyc(), gxc)))); - } - function mcc(a, b) { - return Rc(a, BD(vNb(b, (Nyc(), Nxc)), 19), b); - } - function POc(a, b) { - return vPc(a.j, b.s, b.c) + vPc(b.e, a.s, a.c); - } - function ooc(a, b) { - if (!!a.e && !a.e.a) { - moc(a.e, b); - ooc(a.e, b); - } - } - function noc(a, b) { - if (!!a.d && !a.d.a) { - moc(a.d, b); - noc(a.d, b); - } - } - function hed(a, b) { - return -Kdb(red(a) * qed(a), red(b) * qed(b)); - } - function cgd(a) { - return BD(a.cd(), 146).tg() + ":" + fcb(a.dd()); - } - function Zgc(a) { - Hgc(); - var b; - b = BD(a.g, 10); - b.n.a = a.d.c + b.d.b; - } - function wgc(a, b, c2) { - qgc(); - return iEb(BD(Ohb(a.e, b), 522), c2); - } - function Y2c(a, b) { - rb(a); - rb(b); - return Xr(BD(a, 22), BD(b, 22)); - } - function oic(a, b, c2) { - a.i = 0; - a.e = 0; - if (b == c2) { - return; - } - kic(a, b, c2); - } - function pic(a, b, c2) { - a.i = 0; - a.e = 0; - if (b == c2) { - return; - } - lic(a, b, c2); - } - function Spd(a, b, c2) { - var d, e; - d = Kcb(c2); - e = new TB(d); - cC(a, b, e); - } - function FSd(a, b, c2, d, e, f2) { - ESd.call(this, a, b, c2, d, e, f2 ? -2 : -1); - } - function U5d(a, b, c2, d) { - MLd.call(this, b, c2); - this.b = a; - this.a = d; - } - function QRc(a, b) { - new Psb(); - this.a = new s7c(); - this.b = a; - this.c = b; - } - function Hec(a, b) { - BD(vNb(a, (wtc(), Qsc)), 15).Fc(b); - return b; - } - function Rb(a, b) { - if (a == null) { - throw vbb(new Heb(b)); - } - return a; - } - function WKd(a) { - !a.q && (a.q = new cUd(n5, a, 11, 10)); - return a.q; - } - function ZKd(a) { - !a.s && (a.s = new cUd(t5, a, 21, 17)); - return a.s; - } - function Vod(a) { - !a.a && (a.a = new cUd(E2, a, 10, 11)); - return a.a; - } - function Dx(a) { - return JD(a, 14) ? new Vqb(BD(a, 14)) : Ex(a.Kc()); - } - function Ni(a) { - return new aj(a, a.e.Hd().gc() * a.c.Hd().gc()); - } - function Zi(a) { - return new kj(a, a.e.Hd().gc() * a.c.Hd().gc()); - } - function rz(a) { - return !!a && !!a.hashCode ? a.hashCode() : FCb(a); - } - function Qhb(a, b) { - return b == null ? !!irb(a.f, null) : Brb(a.g, b); - } - function Oq(a) { - Qb(a); - return mr(new Sr(ur(a.a.Kc(), new Sq()))); - } - function vmb(a) { - mmb(); - return JD(a, 54) ? new Yob(a) : new Inb(a); - } - function VDb(a, b, c2) { - if (a.f) { - return a.f.Ne(b, c2); - } - return false; - } - function Gfb(a, b) { - a.a = qfb(a.a, 0, b) + "" + pfb(a.a, b + 1); - return a; - } - function fVb(a, b) { - var c2; - c2 = Sqb(a.a, b); - c2 && (b.d = null); - return c2; - } - function zpb(a) { - var b, c2; - c2 = a; - b = c2.$modCount | 0; - c2.$modCount = b + 1; - } - function pu(a) { - this.b = a; - this.c = a; - a.e = null; - a.c = null; - this.a = 1; - } - function hOb(a) { - this.b = a; - this.a = new Hxb(BD(Qb(new kOb()), 62)); - } - function uEb(a) { - this.c = a; - this.b = new Hxb(BD(Qb(new xEb()), 62)); - } - function SVb(a) { - this.c = a; - this.b = new Hxb(BD(Qb(new VVb()), 62)); - } - function FYb() { - this.a = new HXb(); - this.b = new LXb(); - this.d = new SYb(); - } - function UZb() { - this.a = new s7c(); - this.b = (Xj(3, Jie), new Skb(3)); - } - function VMc() { - this.b = new Tqb(); - this.d = new Psb(); - this.e = new twb(); - } - function K6c(a) { - this.c = a.c; - this.d = a.d; - this.b = a.b; - this.a = a.a; - } - function Ay(a, b) { - oi.call(this, new Qwb(a)); - this.a = a; - this.b = b; - } - function eod() { - bod(this, new $md()); - this.wb = (NFd(), MFd); - LFd(); - } - function eHc(a) { - Odd(a, "No crossing minimization", 1); - Qdd(a); - } - function Gz(a) { - Az(); - $wnd.setTimeout(function() { - throw a; - }, 0); - } - function _Kd(a) { - if (!a.u) { - $Kd(a); - a.u = new YOd(a, a); - } - return a.u; - } - function wjd(a) { - var b; - b = BD(Ajd(a, 16), 26); - return !b ? a.zh() : b; - } - function Jsd(a, b) { - return JD(b, 146) && dfb(a.b, BD(b, 146).tg()); - } - function t0d(a, b) { - return a.a ? b.Wg().Kc() : BD(b.Wg(), 69).Zh(); - } - function u3b(a) { - return a.k == (j0b(), h0b) && wNb(a, (wtc(), Csc)); - } - function ux(a) { - this.a = (mmb(), JD(a, 54) ? new Yob(a) : new Inb(a)); - } - function Rz() { - Rz = ccb; - var a, b; - b = !Xz(); - a = new dA(); - Qz = b ? new Yz() : a; - } - function Wy(a, b) { - var c2; - c2 = hdb(a.gm); - return b == null ? c2 : c2 + ": " + b; - } - function Eob(a, b) { - var c2; - c2 = a.b.Qc(b); - Fob(c2, a.b.gc()); - return c2; - } - function ytb(a, b) { - if (a == null) { - throw vbb(new Heb(b)); - } - return a; - } - function irb(a, b) { - return grb(a, b, hrb(a, b == null ? 0 : a.b.se(b))); - } - function ofb(a, b, c2) { - return c2 >= 0 && dfb(a.substr(c2, b.length), b); - } - function H2d(a, b, c2, d, e, f2, g) { - return new O7d(a.e, b, c2, d, e, f2, g); - } - function Cxd(a, b, c2, d, e, f2) { - this.a = a; - nxd.call(this, b, c2, d, e, f2); - } - function vyd(a, b, c2, d, e, f2) { - this.a = a; - nxd.call(this, b, c2, d, e, f2); - } - function $Ec(a, b) { - this.g = a; - this.d = OC(GC(OQ, 1), kne, 10, 0, [b]); - } - function KVd(a, b) { - this.e = a; - this.a = SI; - this.b = R5d(b); - this.c = b; - } - function cIb(a, b) { - $Gb.call(this); - THb(this); - this.a = a; - this.c = b; - } - function kBc(a, b, c2, d) { - NC(a.c[b.g], c2.g, d); - NC(a.c[c2.g], b.g, d); - } - function nBc(a, b, c2, d) { - NC(a.c[b.g], b.g, c2); - NC(a.b[b.g], b.g, d); - } - function cBc() { - _Ac(); - return OC(GC(fX, 1), Kie, 376, 0, [$Ac, ZAc]); - } - function crc() { - _qc(); - return OC(GC(MW, 1), Kie, 479, 0, [$qc, Zqc]); - } - function Aqc() { - xqc(); - return OC(GC(JW, 1), Kie, 419, 0, [vqc, wqc]); - } - function Lpc() { - Ipc(); - return OC(GC(FW, 1), Kie, 422, 0, [Gpc, Hpc]); - } - function psc() { - msc(); - return OC(GC(SW, 1), Kie, 420, 0, [ksc, lsc]); - } - function EAc() { - BAc(); - return OC(GC(cX, 1), Kie, 421, 0, [zAc, AAc]); - } - function XIc() { - UIc(); - return OC(GC(mY, 1), Kie, 523, 0, [TIc, SIc]); - } - function KOc() { - HOc(); - return OC(GC(DZ, 1), Kie, 520, 0, [GOc, FOc]); - } - function _Lc() { - YLc(); - return OC(GC(fZ, 1), Kie, 516, 0, [XLc, WLc]); - } - function hMc() { - eMc(); - return OC(GC(gZ, 1), Kie, 515, 0, [cMc, dMc]); - } - function IQc() { - FQc(); - return OC(GC(YZ, 1), Kie, 455, 0, [DQc, EQc]); - } - function bUc() { - $Tc(); - return OC(GC(F$, 1), Kie, 425, 0, [ZTc, YTc]); - } - function VTc() { - STc(); - return OC(GC(E$, 1), Kie, 480, 0, [QTc, RTc]); - } - function VUc() { - PUc(); - return OC(GC(K$, 1), Kie, 495, 0, [NUc, OUc]); - } - function jWc() { - fWc(); - return OC(GC(X$, 1), Kie, 426, 0, [dWc, eWc]); - } - function g1c() { - a1c(); - return OC(GC(X_, 1), Kie, 429, 0, [_0c, $0c]); - } - function F_c() { - C_c(); - return OC(GC(P_, 1), Kie, 430, 0, [B_c, A_c]); - } - function PEb() { - MEb(); - return OC(GC(aN, 1), Kie, 428, 0, [LEb, KEb]); - } - function XEb() { - UEb(); - return OC(GC(bN, 1), Kie, 427, 0, [SEb, TEb]); - } - function $Rb() { - XRb(); - return OC(GC(gP, 1), Kie, 424, 0, [VRb, WRb]); - } - function B5b() { - y5b(); - return OC(GC(ZR, 1), Kie, 511, 0, [x5b, w5b]); - } - function lid(a, b, c2, d) { - return c2 >= 0 ? a.jh(b, c2, d) : a.Sg(null, c2, d); - } - function hgd(a) { - if (a.b.b == 0) { - return a.a.$e(); - } - return Lsb(a.b); - } - function Xwd(a) { - if (a.p != 5) - throw vbb(new Ydb()); - return Tbb(a.f); - } - function exd(a) { - if (a.p != 5) - throw vbb(new Ydb()); - return Tbb(a.k); - } - function pNd(a) { - PD(a.a) === PD((NKd(), MKd)) && qNd(a); - return a.a; - } - function by(a) { - this.a = BD(Qb(a), 271); - this.b = (mmb(), new Zob(a)); - } - function bQc(a, b) { - $Pc(this, new f7c(a.a, a.b)); - _Pc(this, Ru(b)); - } - function FQc() { - FQc = ccb; - DQc = new GQc(jle, 0); - EQc = new GQc(kle, 1); - } - function YLc() { - YLc = ccb; - XLc = new ZLc(kle, 0); - WLc = new ZLc(jle, 1); - } - function Hp() { - Gp.call(this, new Mqb(Cv(12))); - Lb(true); - this.a = 2; - } - function Hge(a, b, c2) { - wfe(); - xfe.call(this, a); - this.b = b; - this.a = c2; - } - function cWd(a, b, c2) { - UVd(); - VVd.call(this, b); - this.a = a; - this.b = c2; - } - function aIb(a) { - $Gb.call(this); - THb(this); - this.a = a; - this.c = true; - } - function isb(a) { - var b; - b = a.c.d.b; - a.b = b; - a.a = a.c.d; - b.a = a.c.d.b = a; - } - function $Cb(a) { - var b; - NGb(a.a); - MGb(a.a); - b = new YGb(a.a); - UGb(b); - } - function iKb(a, b) { - hKb(a, true); - Hkb(a.e.wf(), new mKb(a, true, b)); - } - function tlb(a, b) { - pCb(b); - return vlb(a, KC(WD, oje, 25, b, 15, 1), b); - } - function YPb(a, b) { - QPb(); - return a == Xod(jtd(b)) || a == Xod(ltd(b)); - } - function Phb(a, b) { - return b == null ? Wd(irb(a.f, null)) : Crb(a.g, b); - } - function Ksb(a) { - return a.b == 0 ? null : (sCb(a.b != 0), Nsb(a, a.a.a)); - } - function QD(a) { - return Math.max(Math.min(a, Ohe), -2147483648) | 0; - } - function uz(a, b) { - var c2 = tz[a.charCodeAt(0)]; - return c2 == null ? a : c2; - } - function Cx(a, b) { - Rb(a, "set1"); - Rb(b, "set2"); - return new Px(a, b); - } - function QUb(a, b) { - var c2; - c2 = zUb(a.f, b); - return P6c(V6c(c2), a.f.d); - } - function Jwb(a, b) { - var c2, d; - c2 = b; - d = new fxb(); - Lwb(a, c2, d); - return d.d; - } - function NJb(a, b, c2, d) { - var e; - e = new aHb(); - b.a[c2.g] = e; - Npb(a.b, d, e); - } - function zid(a, b, c2) { - var d; - d = a.Yg(b); - d >= 0 ? a.sh(d, c2) : uid(a, b, c2); - } - function hvd(a, b, c2) { - evd(); - !!a && Rhb(dvd, a, b); - !!a && Rhb(cvd, a, c2); - } - function g_c(a, b, c2) { - this.i = new Rkb(); - this.b = a; - this.g = b; - this.a = c2; - } - function VZc(a, b, c2) { - this.c = new Rkb(); - this.e = a; - this.f = b; - this.b = c2; - } - function b$c(a, b, c2) { - this.a = new Rkb(); - this.e = a; - this.f = b; - this.c = c2; - } - function Zy(a, b) { - Py(this); - this.f = b; - this.g = a; - Ry(this); - this._d(); - } - function ZA(a, b) { - var c2; - c2 = a.q.getHours(); - a.q.setDate(b); - YA(a, c2); - } - function no(a, b) { - var c2; - Qb(b); - for (c2 = a.a; c2; c2 = c2.c) { - b.Od(c2.g, c2.i); - } - } - function Fx(a) { - var b; - b = new Uqb(Cv(a.length)); - nmb(b, a); - return b; - } - function ecb(a) { - function b() { - } - b.prototype = a || {}; - return new b(); - } - function dkb(a, b) { - if (Zjb(a, b)) { - wkb(a); - return true; - } - return false; - } - function aC(a, b) { - if (b == null) { - throw vbb(new Geb()); - } - return bC(a, b); - } - function tdb(a) { - if (a.qe()) { - return null; - } - var b = a.n; - return _bb[b]; - } - function Mld(a) { - if (a.Db >> 16 != 3) - return null; - return BD(a.Cb, 33); - } - function mpd(a) { - if (a.Db >> 16 != 9) - return null; - return BD(a.Cb, 33); - } - function fmd(a) { - if (a.Db >> 16 != 6) - return null; - return BD(a.Cb, 79); - } - function Ind(a) { - if (a.Db >> 16 != 7) - return null; - return BD(a.Cb, 235); - } - function Fod(a) { - if (a.Db >> 16 != 7) - return null; - return BD(a.Cb, 160); - } - function Xod(a) { - if (a.Db >> 16 != 11) - return null; - return BD(a.Cb, 33); - } - function nid(a, b) { - var c2; - c2 = a.Yg(b); - return c2 >= 0 ? a.lh(c2) : tid(a, b); - } - function Dtd(a, b) { - var c2; - c2 = new Bsb(b); - Ve(c2, a); - return new Tkb(c2); - } - function Uud(a) { - var b; - b = a.d; - b = a.si(a.f); - wtd(a, b); - return b.Ob(); - } - function t_b(a, b) { - a.b += b.b; - a.c += b.c; - a.d += b.d; - a.a += b.a; - return a; - } - function A4b(a, b) { - return $wnd.Math.abs(a) < $wnd.Math.abs(b) ? a : b; - } - function Zod(a) { - return !a.a && (a.a = new cUd(E2, a, 10, 11)), a.a.i > 0; - } - function oDb() { - this.a = new zsb(); - this.e = new Tqb(); - this.g = 0; - this.i = 0; - } - function BGc(a) { - this.a = a; - this.b = KC(SX, nie, 1944, a.e.length, 0, 2); - } - function RHc(a, b, c2) { - var d; - d = SHc(a, b, c2); - a.b = new BHc(d.c.length); - } - function eMc() { - eMc = ccb; - cMc = new fMc(vle, 0); - dMc = new fMc("UP", 1); - } - function STc() { - STc = ccb; - QTc = new TTc(Yqe, 0); - RTc = new TTc("FAN", 1); - } - function evd() { - evd = ccb; - dvd = new Lqb(); - cvd = new Lqb(); - ivd(hK, new jvd()); - } - function Swd(a) { - if (a.p != 0) - throw vbb(new Ydb()); - return Kbb(a.f, 0); - } - function _wd(a) { - if (a.p != 0) - throw vbb(new Ydb()); - return Kbb(a.k, 0); - } - function MHd(a) { - if (a.Db >> 16 != 3) - return null; - return BD(a.Cb, 147); - } - function ZJd(a) { - if (a.Db >> 16 != 6) - return null; - return BD(a.Cb, 235); - } - function WId(a) { - if (a.Db >> 16 != 17) - return null; - return BD(a.Cb, 26); - } - function rdb(a, b) { - var c2 = a.a = a.a || []; - return c2[b] || (c2[b] = a.le(b)); - } - function hrb(a, b) { - var c2; - c2 = a.a.get(b); - return c2 == null ? new Array() : c2; - } - function aB(a, b) { - var c2; - c2 = a.q.getHours(); - a.q.setMonth(b); - YA(a, c2); - } - function Shb(a, b, c2) { - return b == null ? jrb(a.f, null, c2) : Drb(a.g, b, c2); - } - function FLd(a, b, c2, d, e, f2) { - return new pSd(a.e, b, a.aj(), c2, d, e, f2); - } - function Tfb(a, b, c2) { - a.a = qfb(a.a, 0, b) + ("" + c2) + pfb(a.a, b); - return a; - } - function bq(a, b, c2) { - Ekb(a.a, (Vm(), Wj(b, c2), new Wo(b, c2))); - return a; - } - function uu(a) { - ot(a.c); - a.e = a.a = a.c; - a.c = a.c.c; - ++a.d; - return a.a.f; - } - function vu(a) { - ot(a.e); - a.c = a.a = a.e; - a.e = a.e.e; - --a.d; - return a.a.f; - } - function RZb(a, b) { - !!a.d && Lkb(a.d.e, a); - a.d = b; - !!a.d && Ekb(a.d.e, a); - } - function QZb(a, b) { - !!a.c && Lkb(a.c.g, a); - a.c = b; - !!a.c && Ekb(a.c.g, a); - } - function $_b(a, b) { - !!a.c && Lkb(a.c.a, a); - a.c = b; - !!a.c && Ekb(a.c.a, a); - } - function F0b(a, b) { - !!a.i && Lkb(a.i.j, a); - a.i = b; - !!a.i && Ekb(a.i.j, a); - } - function jDb(a, b, c2) { - this.a = b; - this.c = a; - this.b = (Qb(c2), new Tkb(c2)); - } - function qXb(a, b, c2) { - this.a = b; - this.c = a; - this.b = (Qb(c2), new Tkb(c2)); - } - function aOb(a, b) { - this.a = a; - this.c = R6c(this.a); - this.b = new K6c(b); - } - function IAb(a) { - var b; - Uzb(a); - b = new Tqb(); - return JAb(a, new jBb(b)); - } - function wCb(a, b) { - if (a < 0 || a > b) { - throw vbb(new qcb(Ake + a + Bke + b)); - } - } - function Ppb(a, b) { - return vqb(a.a, b) ? Qpb(a, BD(b, 22).g, null) : null; - } - function WUb(a) { - LUb(); - return Bcb(), BD(a.a, 81).d.e != 0 ? true : false; - } - function qs() { - qs = ccb; - ps = as((hs(), OC(GC(yG, 1), Kie, 538, 0, [gs]))); - } - function SBc() { - SBc = ccb; - RBc = c3c(new j3c(), (qUb(), pUb), (S8b(), J8b)); - } - function ZBc() { - ZBc = ccb; - YBc = c3c(new j3c(), (qUb(), pUb), (S8b(), J8b)); - } - function oCc() { - oCc = ccb; - nCc = c3c(new j3c(), (qUb(), pUb), (S8b(), J8b)); - } - function aJc() { - aJc = ccb; - _Ic = e3c(new j3c(), (qUb(), pUb), (S8b(), h8b)); - } - function FJc() { - FJc = ccb; - EJc = e3c(new j3c(), (qUb(), pUb), (S8b(), h8b)); - } - function ILc() { - ILc = ccb; - HLc = e3c(new j3c(), (qUb(), pUb), (S8b(), h8b)); - } - function wMc() { - wMc = ccb; - vMc = e3c(new j3c(), (qUb(), pUb), (S8b(), h8b)); - } - function fUc() { - fUc = ccb; - eUc = c3c(new j3c(), (yRc(), xRc), (qSc(), kSc)); - } - function DOc(a, b, c2, d) { - this.c = a; - this.d = d; - BOc(this, b); - COc(this, c2); - } - function W3c(a) { - this.c = new Psb(); - this.b = a.b; - this.d = a.c; - this.a = a.a; - } - function e7c(a) { - this.a = $wnd.Math.cos(a); - this.b = $wnd.Math.sin(a); - } - function BOc(a, b) { - !!a.a && Lkb(a.a.k, a); - a.a = b; - !!a.a && Ekb(a.a.k, a); - } - function COc(a, b) { - !!a.b && Lkb(a.b.f, a); - a.b = b; - !!a.b && Ekb(a.b.f, a); - } - function D1c(a, b) { - E1c(a, a.b, a.c); - BD(a.b.b, 65); - !!b && BD(b.b, 65).b; - } - function BUd(a, b) { - CUd(a, b); - JD(a.Cb, 88) && XMd($Kd(BD(a.Cb, 88)), 2); - } - function cJd(a, b) { - JD(a.Cb, 88) && XMd($Kd(BD(a.Cb, 88)), 4); - pnd(a, b); - } - function lKd(a, b) { - JD(a.Cb, 179) && (BD(a.Cb, 179).tb = null); - pnd(a, b); - } - function T2d(a, b) { - return Q6d(), YId(b) ? new R7d(b, a) : new f7d(b, a); - } - function jsd(a, b) { - var c2, d; - c2 = b.c; - d = c2 != null; - d && Qpd(a, new yC(b.c)); - } - function XOd(a) { - var b, c2; - c2 = (LFd(), b = new UQd(), b); - NQd(c2, a); - return c2; - } - function eTd(a) { - var b, c2; - c2 = (LFd(), b = new UQd(), b); - NQd(c2, a); - return c2; - } - function yCc(a, b) { - var c2; - c2 = new H1b(a); - b.c[b.c.length] = c2; - return c2; - } - function Aw(a, b) { - var c2; - c2 = BD(Hv(nd(a.a), b), 14); - return !c2 ? 0 : c2.gc(); - } - function UAb(a) { - var b; - Uzb(a); - b = (ipb(), ipb(), gpb); - return VAb(a, b); - } - function nr(a) { - var b; - while (true) { - b = a.Pb(); - if (!a.Ob()) { - return b; - } - } - } - function Ki(a, b) { - Ii.call(this, new Mqb(Cv(a))); - Xj(b, mie); - this.a = b; - } - function Jib(a, b, c2) { - xCb(b, c2, a.gc()); - this.c = a; - this.a = b; - this.b = c2 - b; - } - function Mkb(a, b, c2) { - var d; - xCb(b, c2, a.c.length); - d = c2 - b; - cCb(a.c, b, d); - } - function Fub(a, b) { - Eub(a, Tbb(xbb(Obb(b, 24), nke)), Tbb(xbb(b, nke))); - } - function tCb(a, b) { - if (a < 0 || a >= b) { - throw vbb(new qcb(Ake + a + Bke + b)); - } - } - function BCb(a, b) { - if (a < 0 || a >= b) { - throw vbb(new Xfb(Ake + a + Bke + b)); - } - } - function Kub(a, b) { - this.b = (uCb(a), a); - this.a = (b & Rje) == 0 ? b | 64 | oie : b; - } - function kkb(a) { - Vjb(this); - dCb(this.a, geb($wnd.Math.max(8, a)) << 1); - } - function A0b(a) { - return l7c(OC(GC(m1, 1), nie, 8, 0, [a.i.n, a.n, a.a])); - } - function Iyb() { - Fyb(); - return OC(GC(xL, 1), Kie, 132, 0, [Cyb, Dyb, Eyb]); - } - function jHb() { - gHb(); - return OC(GC(pN, 1), Kie, 232, 0, [dHb, eHb, fHb]); - } - function QHb() { - NHb(); - return OC(GC(sN, 1), Kie, 461, 0, [LHb, KHb, MHb]); - } - function HIb() { - EIb(); - return OC(GC(zN, 1), Kie, 462, 0, [DIb, CIb, BIb]); - } - function UXb() { - RXb(); - return OC(GC(hQ, 1), Kie, 423, 0, [QXb, PXb, OXb]); - } - function BTb() { - yTb(); - return OC(GC(oP, 1), Kie, 379, 0, [wTb, vTb, xTb]); - } - function Bzc() { - xzc(); - return OC(GC(ZW, 1), Kie, 378, 0, [uzc, vzc, wzc]); - } - function Xpc() { - Rpc(); - return OC(GC(GW, 1), Kie, 314, 0, [Ppc, Opc, Qpc]); - } - function eqc() { - bqc(); - return OC(GC(HW, 1), Kie, 337, 0, [$pc, aqc, _pc]); - } - function Jqc() { - Gqc(); - return OC(GC(KW, 1), Kie, 450, 0, [Eqc, Dqc, Fqc]); - } - function Ikc() { - Fkc(); - return OC(GC(vV, 1), Kie, 361, 0, [Ekc, Dkc, Ckc]); - } - function hsc() { - esc(); - return OC(GC(RW, 1), Kie, 303, 0, [csc, dsc, bsc]); - } - function $rc() { - Xrc(); - return OC(GC(QW, 1), Kie, 292, 0, [Vrc, Wrc, Urc]); - } - function NAc() { - KAc(); - return OC(GC(dX, 1), Kie, 452, 0, [JAc, HAc, IAc]); - } - function wAc() { - tAc(); - return OC(GC(bX, 1), Kie, 339, 0, [rAc, qAc, sAc]); - } - function WAc() { - TAc(); - return OC(GC(eX, 1), Kie, 375, 0, [QAc, RAc, SAc]); - } - function OBc() { - LBc(); - return OC(GC(jX, 1), Kie, 377, 0, [JBc, KBc, IBc]); - } - function wBc() { - tBc(); - return OC(GC(hX, 1), Kie, 336, 0, [qBc, rBc, sBc]); - } - function FBc() { - CBc(); - return OC(GC(iX, 1), Kie, 338, 0, [BBc, zBc, ABc]); - } - function uGc() { - rGc(); - return OC(GC(PX, 1), Kie, 454, 0, [oGc, pGc, qGc]); - } - function xVc() { - tVc(); - return OC(GC(O$, 1), Kie, 442, 0, [sVc, qVc, rVc]); - } - function tWc() { - pWc(); - return OC(GC(Y$, 1), Kie, 380, 0, [mWc, nWc, oWc]); - } - function CYc() { - zYc(); - return OC(GC(q_, 1), Kie, 381, 0, [xYc, yYc, wYc]); - } - function wXc() { - sXc(); - return OC(GC(b_, 1), Kie, 293, 0, [qXc, rXc, pXc]); - } - function _$c() { - Y$c(); - return OC(GC(J_, 1), Kie, 437, 0, [V$c, W$c, X$c]); - } - function kbd() { - hbd(); - return OC(GC(z1, 1), Kie, 334, 0, [fbd, ebd, gbd]); - } - function tad() { - qad(); - return OC(GC(u1, 1), Kie, 272, 0, [nad, oad, pad2]); - } - function o3d(a, b) { - return p3d(a, b, JD(b, 99) && (BD(b, 18).Bb & Tje) != 0); - } - function LZc(a, b, c2) { - var d; - d = MZc(a, b, false); - return d.b <= b && d.a <= c2; - } - function tMc(a, b, c2) { - var d; - d = new sMc(); - d.b = b; - d.a = c2; - ++b.b; - Ekb(a.d, d); - } - function fs(a, b) { - var c2; - c2 = (uCb(a), a).g; - lCb(!!c2); - uCb(b); - return c2(b); - } - function av(a, b) { - var c2, d; - d = cv(a, b); - c2 = a.a.Zc(d); - return new qv(a, c2); - } - function cKd(a) { - if (a.Db >> 16 != 6) - return null; - return BD(aid(a), 235); - } - function Uwd(a) { - if (a.p != 2) - throw vbb(new Ydb()); - return Tbb(a.f) & aje; - } - function bxd(a) { - if (a.p != 2) - throw vbb(new Ydb()); - return Tbb(a.k) & aje; - } - function Z1d(a) { - a.a == (T0d(), S0d) && d2d(a, U0d(a.g, a.b)); - return a.a; - } - function _1d(a) { - a.d == (T0d(), S0d) && f2d(a, Y0d(a.g, a.b)); - return a.d; - } - function mlb(a) { - sCb(a.a < a.c.c.length); - a.b = a.a++; - return a.c.c[a.b]; - } - function hEb(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 xbb(a, b) { - return zbb(dD(Fbb(a) ? Rbb(a) : a, Fbb(b) ? Rbb(b) : b)); - } - function Mbb(a, b) { - return zbb(jD(Fbb(a) ? Rbb(a) : a, Fbb(b) ? Rbb(b) : b)); - } - function Vbb(a, b) { - return zbb(rD(Fbb(a) ? Rbb(a) : a, Fbb(b) ? Rbb(b) : b)); - } - function Dub(a) { - return wbb(Nbb(Cbb(Cub(a, 32)), 32), Cbb(Cub(a, 32))); - } - function Mu(a) { - Qb(a); - return JD(a, 14) ? new Tkb(BD(a, 14)) : Nu(a.Kc()); - } - function EWb(a, b) { - AWb(); - return a.c == b.c ? Kdb(b.d, a.d) : Kdb(a.c, b.c); - } - function FWb(a, b) { - AWb(); - return a.c == b.c ? Kdb(a.d, b.d) : Kdb(a.c, b.c); - } - function HWb(a, b) { - AWb(); - return a.c == b.c ? Kdb(a.d, b.d) : Kdb(b.c, a.c); - } - function GWb(a, b) { - AWb(); - return a.c == b.c ? Kdb(b.d, a.d) : Kdb(b.c, a.c); - } - function WGb(a, b) { - var c2; - c2 = Edb(ED(a.a.We((Y9c(), Q9c)))); - XGb(a, b, c2); - } - function Rgc(a, b) { - var c2; - c2 = BD(Ohb(a.g, b), 57); - Hkb(b.d, new Qhc(a, c2)); - } - function GYb(a, b) { - var c2, d; - c2 = d_b(a); - d = d_b(b); - return c2 < d ? -1 : c2 > d ? 1 : 0; - } - function bjc(a, b) { - var c2, d; - c2 = ajc(b); - d = c2; - return BD(Ohb(a.c, d), 19).a; - } - function iSc(a, b) { - var c2; - c2 = a + ""; - while (c2.length < b) { - c2 = "0" + c2; - } - return c2; - } - function WRc(a) { - return a.c == null || a.c.length == 0 ? "n_" + a.g : "n_" + a.c; - } - function oRb(a) { - return a.c == null || a.c.length == 0 ? "n_" + a.b : "n_" + a.c; - } - function qz(a, b) { - return !!a && !!a.equals ? a.equals(b) : PD(a) === PD(b); - } - function dkd(a, b) { - if (b == 0) { - return !!a.o && a.o.f != 0; - } - return mid(a, b); - } - function Tdd(a, b, c2) { - var d; - if (a.n && !!b && !!c2) { - d = new kgd(); - Ekb(a.e, d); - } - } - function cIc(a, b, c2) { - var d; - d = a.d[b.p]; - a.d[b.p] = a.d[c2.p]; - a.d[c2.p] = d; - } - function kxd(a, b, c2) { - this.d = a; - this.j = b; - this.e = c2; - this.o = -1; - this.p = 3; - } - function lxd(a, b, c2) { - this.d = a; - this.k = b; - this.f = c2; - this.o = -1; - this.p = 5; - } - function zge(a, b, c2) { - xfe.call(this, 25); - this.b = a; - this.a = b; - this.c = c2; - } - function $fe(a) { - wfe(); - xfe.call(this, a); - this.c = false; - this.a = false; - } - function sSd(a, b, c2, d, e, f2) { - rSd.call(this, a, b, c2, d, e); - f2 && (this.o = -2); - } - function uSd(a, b, c2, d, e, f2) { - tSd.call(this, a, b, c2, d, e); - f2 && (this.o = -2); - } - function wSd(a, b, c2, d, e, f2) { - vSd.call(this, a, b, c2, d, e); - f2 && (this.o = -2); - } - function ySd(a, b, c2, d, e, f2) { - xSd.call(this, a, b, c2, d, e); - f2 && (this.o = -2); - } - function ASd(a, b, c2, d, e, f2) { - zSd.call(this, a, b, c2, d, e); - f2 && (this.o = -2); - } - function CSd(a, b, c2, d, e, f2) { - BSd.call(this, a, b, c2, d, e); - f2 && (this.o = -2); - } - function HSd(a, b, c2, d, e, f2) { - GSd.call(this, a, b, c2, d, e); - f2 && (this.o = -2); - } - function JSd(a, b, c2, d, e, f2) { - ISd.call(this, a, b, c2, d, e); - f2 && (this.o = -2); - } - function nWd(a, b, c2, d) { - VVd.call(this, c2); - this.b = a; - this.c = b; - this.d = d; - } - function x$c(a, b) { - this.a = new Rkb(); - this.d = new Rkb(); - this.f = a; - this.c = b; - } - function PTb() { - this.c = new bUb(); - this.a = new FYb(); - this.b = new wZb(); - $Yb(); - } - function b2c() { - Y1c(); - this.b = new Lqb(); - this.a = new Lqb(); - this.c = new Rkb(); - } - function j2d(a, b) { - this.g = a; - this.d = (T0d(), S0d); - this.a = S0d; - this.b = b; - } - function O1d(a, b) { - this.f = a; - this.a = (T0d(), R0d); - this.c = R0d; - this.b = b; - } - function h9d(a, b) { - !a.c && (a.c = new u3d(a, 0)); - f3d(a.c, (Q8d(), I8d), b); - } - function $Tc() { - $Tc = ccb; - ZTc = new _Tc("DFS", 0); - YTc = new _Tc("BFS", 1); - } - function Cc(a, b, c2) { - var d; - d = BD(a.Zb().xc(b), 14); - return !!d && d.Hc(c2); - } - function Gc(a, b, c2) { - var d; - d = BD(a.Zb().xc(b), 14); - return !!d && d.Mc(c2); - } - function Ofb(a, b, c2, d) { - a.a += "" + qfb(b == null ? Xhe : fcb(b), c2, d); - return a; - } - function Xnd(a, b, c2, d, e, f2) { - Ynd(a, b, c2, f2); - eLd(a, d); - fLd(a, e); - return a; - } - function Ysb(a) { - sCb(a.b.b != a.d.a); - a.c = a.b = a.b.b; - --a.a; - return a.c.c; - } - function Jgb(a) { - while (a.d > 0 && a.a[--a.d] == 0) - ; - a.a[a.d++] == 0 && (a.e = 0); - } - function wwb(a) { - return !a.a ? a.c : a.e.length == 0 ? a.a.a : a.a.a + ("" + a.e); - } - function RSd(a) { - return !!a.a && QSd(a.a.a).i != 0 && !(!!a.b && QTd(a.b)); - } - function cLd(a) { - return !!a.u && VKd(a.u.a).i != 0 && !(!!a.n && FMd(a.n)); - } - function $i(a) { - return Zj(a.e.Hd().gc() * a.c.Hd().gc(), 16, new ij(a)); - } - function XA(a, b) { - return ueb(Cbb(a.q.getTime()), Cbb(b.q.getTime())); - } - function k_b(a) { - return BD(Qkb(a, KC(AQ, jne, 17, a.c.length, 0, 1)), 474); - } - function l_b(a) { - return BD(Qkb(a, KC(OQ, kne, 10, a.c.length, 0, 1)), 193); - } - function cKc(a) { - FJc(); - return !OZb(a) && !(!OZb(a) && a.c.i.c == a.d.i.c); - } - function kDb(a, b, c2) { - var d; - d = (Qb(a), new Tkb(a)); - iDb(new jDb(d, b, c2)); - } - function rXb(a, b, c2) { - var d; - d = (Qb(a), new Tkb(a)); - pXb(new qXb(d, b, c2)); - } - function Nwb(a, b) { - var c2; - c2 = 1 - b; - a.a[c2] = Owb(a.a[c2], c2); - return Owb(a, b); - } - function YXc(a, b) { - var c2; - a.e = new QXc(); - c2 = gVc(b); - Okb(c2, a.c); - ZXc(a, c2, 0); - } - function o4c(a, b, c2, d) { - var e; - e = new w4c(); - e.a = b; - e.b = c2; - e.c = d; - Dsb(a.a, e); - } - function p4c(a, b, c2, d) { - var e; - e = new w4c(); - e.a = b; - e.b = c2; - e.c = d; - Dsb(a.b, e); - } - function i6d(a) { - var b, c2, d; - b = new A6d(); - c2 = s6d(b, a); - z6d(b); - d = c2; - return d; - } - function vZd() { - var a, b, c2; - b = (c2 = (a = new UQd(), a), c2); - Ekb(rZd, b); - return b; - } - function H2c(a) { - a.j.c = KC(SI, Uhe, 1, 0, 5, 1); - Ae(a.c); - h3c(a.a); - return a; - } - function tgc(a) { - qgc(); - if (JD(a.g, 10)) { - return BD(a.g, 10); - } - return null; - } - function Zw(a) { - if (Ah(a).dc()) { - return false; - } - Bh(a, new bx()); - return true; - } - function _y(b) { - if (!("stack" in b)) { - try { - throw b; - } catch (a) { - } - } - return b; - } - function Pb(a, b) { - if (a < 0 || a >= b) { - throw vbb(new qcb(Ib(a, b))); - } - return a; - } - function Tb(a, b, c2) { - if (a < 0 || b < a || b > c2) { - throw vbb(new qcb(Kb(a, b, c2))); - } - } - function eVb(a, b) { - Qqb(a.a, b); - if (b.d) { - throw vbb(new hz(Hke)); - } - b.d = a; - } - function xpb(a, b) { - if (b.$modCount != a.$modCount) { - throw vbb(new Apb()); - } - } - function $pb(a, b) { - if (JD(b, 42)) { - return Jd(a.a, BD(b, 42)); - } - return false; - } - function dib(a, b) { - if (JD(b, 42)) { - return Jd(a.a, BD(b, 42)); - } - return false; - } - function msb(a, b) { - if (JD(b, 42)) { - return Jd(a.a, BD(b, 42)); - } - return false; - } - function qAb(a, b) { - if (a.a <= a.b) { - b.ud(a.a++); - return true; - } - return false; - } - function Sbb(a) { - var b; - if (Fbb(a)) { - b = a; - return b == -0 ? 0 : b; - } - return oD(a); - } - function tAb(a) { - var b; - Tzb(a); - b = new drb(); - _ub(a.a, new BAb(b)); - return b; - } - function Yzb(a) { - var b; - Tzb(a); - b = new Gpb(); - _ub(a.a, new mAb(b)); - return b; - } - function Bib(a, b) { - this.a = a; - vib.call(this, a); - wCb(b, a.gc()); - this.b = b; - } - function orb(a) { - this.e = a; - this.b = this.e.a.entries(); - this.a = new Array(); - } - function Oi(a) { - return Zj(a.e.Hd().gc() * a.c.Hd().gc(), 273, new cj(a)); - } - function Qu(a) { - return new Skb((Xj(a, Mie), Oy(wbb(wbb(5, a), a / 10 | 0)))); - } - function m_b(a) { - return BD(Qkb(a, KC(aR, lne, 11, a.c.length, 0, 1)), 1943); - } - function sMb(a, b, c2) { - return c2.f.c.length > 0 ? HMb(a.a, b, c2) : HMb(a.b, b, c2); - } - function SZb(a, b, c2) { - !!a.d && Lkb(a.d.e, a); - a.d = b; - !!a.d && Dkb(a.d.e, c2, a); - } - function a5b(a, b) { - i5b(b, a); - k5b(a.d); - k5b(BD(vNb(a, (Nyc(), wxc)), 207)); - } - function _4b(a, b) { - f5b(b, a); - h5b(a.d); - h5b(BD(vNb(a, (Nyc(), wxc)), 207)); - } - function Ypd(a, b) { - var c2, d; - c2 = aC(a, b); - d = null; - !!c2 && (d = c2.fe()); - return d; - } - function Zpd(a, b) { - var c2, d; - c2 = tB(a, b); - d = null; - !!c2 && (d = c2.ie()); - return d; - } - function $pd(a, b) { - var c2, d; - c2 = aC(a, b); - d = null; - !!c2 && (d = c2.ie()); - return d; - } - function _pd(a, b) { - var c2, d; - c2 = aC(a, b); - d = null; - !!c2 && (d = aqd(c2)); - return d; - } - function Tqd(a, b, c2) { - var d; - d = Wpd(c2); - ro(a.g, d, b); - ro(a.i, b, c2); - return b; - } - function Ez(a, b, c2) { - var d; - d = Cz(); - try { - return Bz(a, b, c2); - } finally { - Fz(d); - } - } - function C6d(a) { - var b; - b = a.Wg(); - this.a = JD(b, 69) ? BD(b, 69).Zh() : b.Kc(); - } - function j3c() { - D2c.call(this); - this.j.c = KC(SI, Uhe, 1, 0, 5, 1); - this.a = -1; - } - function mxd(a, b, c2, d) { - this.d = a; - this.n = b; - this.g = c2; - this.o = d; - this.p = -1; - } - function jk(a, b, c2, d) { - this.e = d; - this.d = null; - this.c = a; - this.a = b; - this.b = c2; - } - function uEc(a, b, c2) { - this.d = new HEc(this); - this.e = a; - this.i = b; - this.f = c2; - } - function msc() { - msc = ccb; - ksc = new nsc(gle, 0); - lsc = new nsc("TOP_LEFT", 1); - } - function cDc() { - cDc = ccb; - bDc = ix(meb(1), meb(4)); - aDc = ix(meb(1), meb(2)); - } - function z_c() { - z_c = ccb; - y_c = as((s_c(), OC(GC(O_, 1), Kie, 551, 0, [r_c]))); - } - function q_c() { - q_c = ccb; - p_c = as((i_c(), OC(GC(N_, 1), Kie, 482, 0, [h_c]))); - } - function Z0c() { - Z0c = ccb; - Y0c = as((R0c(), OC(GC(W_, 1), Kie, 530, 0, [Q0c]))); - } - function hPb() { - hPb = ccb; - gPb = as((cPb(), OC(GC(GO, 1), Kie, 481, 0, [bPb]))); - } - function yLb() { - vLb(); - return OC(GC(PN, 1), Kie, 406, 0, [uLb, rLb, sLb, tLb]); - } - function qxb() { - lxb(); - return OC(GC(iL, 1), Kie, 297, 0, [hxb, ixb, jxb, kxb]); - } - function UOb() { - ROb(); - return OC(GC(CO, 1), Kie, 394, 0, [OOb, NOb, POb, QOb]); - } - function UMb() { - RMb(); - return OC(GC(jO, 1), Kie, 323, 0, [OMb, NMb, PMb, QMb]); - } - function sWb() { - lWb(); - return OC(GC(SP, 1), Kie, 405, 0, [hWb, kWb, iWb, jWb]); - } - function kbc() { - gbc(); - return OC(GC(VS, 1), Kie, 360, 0, [fbc, dbc, ebc, cbc]); - } - function Vc(a, b, c2, d) { - return JD(c2, 54) ? new Cg(a, b, c2, d) : new qg(a, b, c2, d); - } - function Djc() { - Ajc(); - return OC(GC(mV, 1), Kie, 411, 0, [wjc, xjc, yjc, zjc]); - } - function okc(a) { - var b; - return a.j == (Ucd(), Rcd) && (b = pkc(a), uqb(b, zcd)); - } - function Mdc(a, b) { - var c2; - c2 = b.a; - QZb(c2, b.c.d); - RZb(c2, b.d.d); - q7c(c2.a, a.n); - } - function Smc(a, b) { - return BD(Btb(QAb(BD(Qc(a.k, b), 15).Oc(), Hmc)), 113); - } - function Tmc(a, b) { - return BD(Btb(RAb(BD(Qc(a.k, b), 15).Oc(), Hmc)), 113); - } - function _w(a) { - return new Kub(rmb(BD(a.a.dd(), 14).gc(), a.a.cd()), 16); - } - function Qq(a) { - if (JD(a, 14)) { - return BD(a, 14).dc(); - } - return !a.Kc().Ob(); - } - function ugc(a) { - qgc(); - if (JD(a.g, 145)) { - return BD(a.g, 145); - } - return null; - } - function Ko(a) { - if (a.e.g != a.b) { - throw vbb(new Apb()); - } - return !!a.c && a.d > 0; - } - function Xsb(a) { - sCb(a.b != a.d.c); - a.c = a.b; - a.b = a.b.a; - ++a.a; - return a.c.c; - } - function Xjb(a, b) { - uCb(b); - NC(a.a, a.c, b); - a.c = a.c + 1 & a.a.length - 1; - _jb(a); - } - function Wjb(a, b) { - uCb(b); - a.b = a.b - 1 & a.a.length - 1; - NC(a.a, a.b, b); - _jb(a); - } - function A2c(a, b) { - var c2; - for (c2 = a.j.c.length; c2 < b; c2++) { - Ekb(a.j, a.rg()); - } - } - function gBc(a, b, c2, d) { - var e; - e = d[b.g][c2.g]; - return Edb(ED(vNb(a.a, e))); - } - function goc(a, b, c2, d, e) { - this.i = a; - this.a = b; - this.e = c2; - this.j = d; - this.f = e; - } - function DZc(a, b, c2, d, e) { - this.a = a; - this.e = b; - this.f = c2; - this.b = d; - this.g = e; - } - function Fz(a) { - a && Mz((Kz(), Jz)); - --xz; - if (a) { - if (zz != -1) { - Hz(zz); - zz = -1; - } - } - } - function Nzc() { - Izc(); - return OC(GC($W, 1), Kie, 197, 0, [Gzc, Hzc, Fzc, Ezc]); - } - function ERc() { - yRc(); - return OC(GC(h$, 1), Kie, 393, 0, [uRc, vRc, wRc, xRc]); - } - function mXc() { - iXc(); - return OC(GC(a_, 1), Kie, 340, 0, [hXc, fXc, gXc, eXc]); - } - function wdd() { - tdd(); - return OC(GC(I1, 1), Kie, 374, 0, [rdd, sdd, qdd, pdd]); - } - function vbd() { - rbd(); - return OC(GC(A1, 1), Kie, 285, 0, [qbd, nbd, obd, pbd]); - } - function Dad() { - Aad(); - return OC(GC(v1, 1), Kie, 218, 0, [zad, xad, wad, yad]); - } - function Ged() { - Ded(); - return OC(GC(O1, 1), Kie, 311, 0, [Ced, zed, Bed, Aed]); - } - function sgd() { - pgd(); - return OC(GC(k2, 1), Kie, 396, 0, [mgd, ngd, lgd, ogd]); - } - function gvd(a) { - evd(); - return Mhb(dvd, a) ? BD(Ohb(dvd, a), 331).ug() : null; - } - function cid(a, b, c2) { - return b < 0 ? tid(a, c2) : BD(c2, 66).Nj().Sj(a, a.yh(), b); - } - function Sqd(a, b, c2) { - var d; - d = Wpd(c2); - ro(a.d, d, b); - Rhb(a.e, b, c2); - return b; - } - function Uqd(a, b, c2) { - var d; - d = Wpd(c2); - ro(a.j, d, b); - Rhb(a.k, b, c2); - return b; - } - function dtd(a) { - var b, c2; - b = (Fhd(), c2 = new Tld(), c2); - !!a && Rld(b, a); - return b; - } - function wud(a) { - var b; - b = a.ri(a.i); - a.i > 0 && $fb(a.g, 0, b, 0, a.i); - return b; - } - function qEd(a, b) { - pEd(); - var c2; - c2 = BD(Ohb(oEd, a), 55); - return !c2 || c2.wj(b); - } - function Twd(a) { - if (a.p != 1) - throw vbb(new Ydb()); - return Tbb(a.f) << 24 >> 24; - } - function axd(a) { - if (a.p != 1) - throw vbb(new Ydb()); - return Tbb(a.k) << 24 >> 24; - } - function gxd(a) { - if (a.p != 7) - throw vbb(new Ydb()); - return Tbb(a.k) << 16 >> 16; - } - function Zwd(a) { - if (a.p != 7) - throw vbb(new Ydb()); - return Tbb(a.f) << 16 >> 16; - } - function sr(a) { - var b; - b = 0; - while (a.Ob()) { - a.Pb(); - b = wbb(b, 1); - } - return Oy(b); - } - function nx(a, b) { - var c2; - c2 = new Vfb(); - a.xd(c2); - c2.a += ".."; - b.yd(c2); - return c2.a; - } - function Sgc(a, b, c2) { - var d; - d = BD(Ohb(a.g, c2), 57); - Ekb(a.a.c, new vgd(b, d)); - } - function VCb(a, b, c2) { - return Ddb(ED(Wd(irb(a.f, b))), ED(Wd(irb(a.f, c2)))); - } - function E2d(a, b, c2) { - return F2d(a, b, c2, JD(b, 99) && (BD(b, 18).Bb & Tje) != 0); - } - function L2d(a, b, c2) { - return M2d(a, b, c2, JD(b, 99) && (BD(b, 18).Bb & Tje) != 0); - } - function q3d(a, b, c2) { - return r3d(a, b, c2, JD(b, 99) && (BD(b, 18).Bb & Tje) != 0); - } - function JJc(a, b) { - return a == (j0b(), h0b) && b == h0b ? 4 : a == h0b || b == h0b ? 8 : 32; - } - function Nd(a, b) { - return PD(b) === PD(a) ? "(this Map)" : b == null ? Xhe : fcb(b); - } - function kFd(a, b) { - return BD(b == null ? Wd(irb(a.f, null)) : Crb(a.g, b), 281); - } - function Rqd(a, b, c2) { - var d; - d = Wpd(c2); - Rhb(a.b, d, b); - Rhb(a.c, b, c2); - return b; - } - function Bfd(a, b) { - var c2; - c2 = b; - while (c2) { - O6c(a, c2.i, c2.j); - c2 = Xod(c2); - } - return a; - } - function kt(a, b) { - var c2; - c2 = vmb(Nu(new wu(a, b))); - ir(new wu(a, b)); - return c2; - } - function R6d(a, b) { - Q6d(); - var c2; - c2 = BD(a, 66).Mj(); - kVd(c2, b); - return c2.Ok(b); - } - function TOc(a, b, c2, d, e) { - var f2; - f2 = OOc(e, c2, d); - Ekb(b, tOc(e, f2)); - XOc(a, e, b); - } - function mic(a, b, c2) { - a.i = 0; - a.e = 0; - if (b == c2) { - return; + 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]; } - lic(a, b, c2); - kic(a, b, c2); - } - function dB(a, b) { - var c2; - c2 = a.q.getHours(); - a.q.setFullYear(b + nje); - YA(a, c2); - } - function dC(d, a, b) { - if (b) { - var c2 = b.ee(); - d.a[a] = c2(b); + 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 { - delete d.a[a]; + 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 vB(d, a, b) { - if (b) { - var c2 = b.ee(); - b = c2(b); + 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 { - b = void 0; - } - d.a[a] = b; - } - function pCb(a) { - if (a < 0) { - throw vbb(new Feb("Negative array size: " + a)); - } - } - function VKd(a) { - if (!a.n) { - $Kd(a); - a.n = new JMd(a, j5, a); - _Kd(a); - } - return a.n; - } - function Fqb(a) { - sCb(a.a < a.c.a.length); - a.b = a.a; - Dqb(a); - return a.c.b[a.b]; - } - function Yjb(a) { - if (a.b == a.c) { - return; - } - a.a = KC(SI, Uhe, 1, 8, 5, 1); - a.b = 0; - a.c = 0; - } - function AQb(a) { - this.b = new Lqb(); - this.c = new Lqb(); - this.d = new Lqb(); - this.a = a; - } - function lge(a, b) { - wfe(); - xfe.call(this, a); - this.a = b; - this.c = -1; - this.b = -1; - } - function lSd(a, b, c2, d) { - kxd.call(this, 1, c2, d); - this.c = a; - this.b = b; - } - function mSd(a, b, c2, d) { - lxd.call(this, 1, c2, d); - this.c = a; - this.b = b; - } - function O7d(a, b, c2, d, e, f2, g) { - nxd.call(this, b, d, e, f2, g); - this.c = a; - this.a = c2; - } - function LVd(a, b, c2) { - this.e = a; - this.a = SI; - this.b = R5d(b); - this.c = b; - this.d = c2; - } - function Lo(a) { - this.e = a; - this.c = this.e.a; - this.b = this.e.g; - this.d = this.e.i; - } - function nYd(a) { - this.c = a; - this.a = BD(wId(a), 148); - this.b = this.a.Aj().Nh(); - } - function Irb(a) { - this.d = a; - this.b = this.d.a.entries(); - this.a = this.b.next(); - } - function $rb() { - Lqb.call(this); - Trb(this); - this.d.b = this.d; - this.d.a = this.d; - } - function mRb(a, b) { - _Qb.call(this); - this.a = a; - this.b = b; - Ekb(this.a.b, this); - } - function uFd(a, b) { - var c2; - return c2 = b != null ? Phb(a, b) : Wd(irb(a.f, b)), RD(c2); - } - function FFd(a, b) { - var c2; - return c2 = b != null ? Phb(a, b) : Wd(irb(a.f, b)), RD(c2); - } - function Fob(a, b) { - var c2; - for (c2 = 0; c2 < b; ++c2) { - NC(a, c2, new Rob(BD(a[c2], 42))); - } - } - function Lgb(a, b) { - var c2; - for (c2 = a.d - 1; c2 >= 0 && a.a[c2] === b[c2]; c2--) - ; - return c2 < 0; - } - function Ucc(a, b) { - Occ(); - var c2; - c2 = a.j.g - b.j.g; - if (c2 != 0) { - return c2; + 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 0; - } - function Dtb(a, b) { - uCb(b); - if (a.a != null) { - return Itb(b.Kb(a.a)); + 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); + } } - return ztb; - } - function Gx(a) { - var b; - if (a) { - return new Bsb(a); + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; } - b = new zsb(); - Jq(b, a); - return b; - } - function GAb(a, b) { - var c2; - return b.b.Kb(SAb(a, b.c.Ee(), (c2 = new TBb(b), c2))); - } - function Hub(a) { - zub(); - Eub(this, Tbb(xbb(Obb(a, 24), nke)), Tbb(xbb(a, nke))); - } - function REb() { - REb = ccb; - QEb = as((MEb(), OC(GC(aN, 1), Kie, 428, 0, [LEb, KEb]))); - } - function ZEb() { - ZEb = ccb; - YEb = as((UEb(), OC(GC(bN, 1), Kie, 427, 0, [SEb, TEb]))); - } - function aSb() { - aSb = ccb; - _Rb = as((XRb(), OC(GC(gP, 1), Kie, 424, 0, [VRb, WRb]))); - } - function D5b() { - D5b = ccb; - C5b = as((y5b(), OC(GC(ZR, 1), Kie, 511, 0, [x5b, w5b]))); - } - function Cqc() { - Cqc = ccb; - Bqc = as((xqc(), OC(GC(JW, 1), Kie, 419, 0, [vqc, wqc]))); - } - function erc() { - erc = ccb; - drc = as((_qc(), OC(GC(MW, 1), Kie, 479, 0, [$qc, Zqc]))); - } - function eBc() { - eBc = ccb; - dBc = as((_Ac(), OC(GC(fX, 1), Kie, 376, 0, [$Ac, ZAc]))); - } - function GAc() { - GAc = ccb; - FAc = as((BAc(), OC(GC(cX, 1), Kie, 421, 0, [zAc, AAc]))); - } - function Npc() { - Npc = ccb; - Mpc = as((Ipc(), OC(GC(FW, 1), Kie, 422, 0, [Gpc, Hpc]))); - } - function rsc() { - rsc = ccb; - qsc = as((msc(), OC(GC(SW, 1), Kie, 420, 0, [ksc, lsc]))); - } - function MOc() { - MOc = ccb; - LOc = as((HOc(), OC(GC(DZ, 1), Kie, 520, 0, [GOc, FOc]))); - } - function ZIc() { - ZIc = ccb; - YIc = as((UIc(), OC(GC(mY, 1), Kie, 523, 0, [TIc, SIc]))); - } - function bMc() { - bMc = ccb; - aMc = as((YLc(), OC(GC(fZ, 1), Kie, 516, 0, [XLc, WLc]))); - } - function jMc() { - jMc = ccb; - iMc = as((eMc(), OC(GC(gZ, 1), Kie, 515, 0, [cMc, dMc]))); - } - function KQc() { - KQc = ccb; - JQc = as((FQc(), OC(GC(YZ, 1), Kie, 455, 0, [DQc, EQc]))); - } - function dUc() { - dUc = ccb; - cUc = as(($Tc(), OC(GC(F$, 1), Kie, 425, 0, [ZTc, YTc]))); - } - function XUc() { - XUc = ccb; - WUc = as((PUc(), OC(GC(K$, 1), Kie, 495, 0, [NUc, OUc]))); - } - function XTc() { - XTc = ccb; - WTc = as((STc(), OC(GC(E$, 1), Kie, 480, 0, [QTc, RTc]))); - } - function lWc() { - lWc = ccb; - kWc = as((fWc(), OC(GC(X$, 1), Kie, 426, 0, [dWc, eWc]))); - } - function i1c() { - i1c = ccb; - h1c = as((a1c(), OC(GC(X_, 1), Kie, 429, 0, [_0c, $0c]))); - } - function H_c() { - H_c = ccb; - G_c = as((C_c(), OC(GC(P_, 1), Kie, 430, 0, [B_c, A_c]))); - } - function UIc() { - UIc = ccb; - TIc = new VIc("UPPER", 0); - SIc = new VIc("LOWER", 1); - } - function Lqd(a, b) { - var c2; - c2 = new eC(); - Spd(c2, "x", b.a); - Spd(c2, "y", b.b); - Qpd(a, c2); - } - function Oqd(a, b) { - var c2; - c2 = new eC(); - Spd(c2, "x", b.a); - Spd(c2, "y", b.b); - Qpd(a, c2); - } - function Jic(a, b) { - var c2, d; - d = false; - do { - c2 = Mic(a, b); - d = d | c2; - } while (c2); - return d; - } - function zHc(a, b) { - var c2, d; - c2 = b; - d = 0; - while (c2 > 0) { - d += a.a[c2]; - c2 -= c2 & -c2; - } - return d; - } - function Cfd(a, b) { - var c2; - c2 = b; - while (c2) { - O6c(a, -c2.i, -c2.j); - c2 = Xod(c2); - } - return a; - } - function reb(a, b) { - var c2, d; - uCb(b); - for (d = a.Kc(); d.Ob(); ) { - c2 = d.Pb(); - b.td(c2); - } - } - function me(a, b) { - var c2; - c2 = b.cd(); - return new Wo(c2, a.e.pc(c2, BD(b.dd(), 14))); - } - function Gsb(a, b, c2, d) { - var e; - e = new jtb(); - e.c = b; - e.b = c2; - e.a = d; - d.b = c2.a = e; - ++a.b; - } - function Nkb(a, b, c2) { - var d; - d = (tCb(b, a.c.length), a.c[b]); - a.c[b] = c2; - return d; - } - function lFd(a, b, c2) { - return BD(b == null ? jrb(a.f, null, c2) : Drb(a.g, b, c2), 281); - } - function fRb(a) { - return !!a.c && !!a.d ? oRb(a.c) + "->" + oRb(a.d) : "e_" + FCb(a); - } - function FAb(a, b) { - return (Uzb(a), WAb(new YAb(a, new qBb(b, a.a)))).sd(DAb); - } - function tUb() { - qUb(); - return OC(GC(zP, 1), Kie, 356, 0, [lUb, mUb, nUb, oUb, pUb]); - } - function _cd() { - Ucd(); - return OC(GC(F1, 1), bne, 61, 0, [Scd, Acd, zcd, Rcd, Tcd]); - } - function Dz(b) { - Az(); - return function() { - return Ez(b, this, arguments); + 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 }; - } - function sz() { - if (Date.now) { - return Date.now(); - } - return (/* @__PURE__ */ new Date()).getTime(); - } - function OZb(a) { - if (!a.c || !a.d) { + 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.c.i && a.c.i == a.d.i; - } - function pv(a) { - if (!a.c.Sb()) { - throw vbb(new utb()); - } - a.a = true; - return a.c.Ub(); - } - function ko(a) { - a.i = 0; - Alb(a.b, null); - Alb(a.c, null); - a.a = null; - a.e = null; - ++a.g; - } - function ycb(a) { - wcb.call(this, a == null ? Xhe : fcb(a), JD(a, 78) ? BD(a, 78) : null); - } - function PYb(a) { - MYb(); - yXb(this); - this.a = new Psb(); - NYb(this, a); - Dsb(this.a, a); - } - function jYb() { - Ckb(this); - this.b = new f7c(Pje, Pje); - this.a = new f7c(Qje, Qje); - } - function rAb(a, b) { - this.c = 0; - this.b = b; - jvb.call(this, a, 17493); - this.a = this.c; - } - function wyb(a) { - oyb(); - if (lyb) { - return; - } - this.c = a; - this.e = true; - this.a = new Rkb(); - } - function oyb() { - oyb = ccb; - lyb = true; - jyb = false; - kyb = false; - nyb = false; - myb = false; - } - function C3c(a, b) { - if (JD(b, 149)) { - return dfb(a.c, BD(b, 149).c); - } - return false; - } - function zUc(a, b) { - var c2; - c2 = 0; - !!a && (c2 += a.f.a / 2); - !!b && (c2 += b.f.a / 2); - return c2; - } - function j4c(a, b) { - var c2; - c2 = BD(Wrb(a.d, b), 23); - return c2 ? c2 : BD(Wrb(a.e, b), 23); - } - function Lzd(a) { - this.b = a; - Fyd.call(this, a); - this.a = BD(Ajd(this.b.a, 4), 126); - } - function Uzd(a) { - this.b = a; - $yd.call(this, a); - this.a = BD(Ajd(this.b.a, 4), 126); - } - function $Kd(a) { - if (!a.t) { - a.t = new YMd(a); - vtd(new c0d(a), 0, a.t); - } - return a.t; - } - function kad() { - ead(); - return OC(GC(t12, 1), Kie, 103, 0, [cad, bad, aad, _9c, dad]); - } - function Wbd() { - Tbd(); - return OC(GC(C1, 1), Kie, 249, 0, [Qbd, Sbd, Obd, Pbd, Rbd]); - } - function Q5c() { - N5c(); - return OC(GC(e1, 1), Kie, 175, 0, [L5c, K5c, I5c, M5c, J5c]); - } - function Q_c() { - N_c(); - return OC(GC(Q_, 1), Kie, 316, 0, [I_c, J_c, M_c, K_c, L_c]); - } - function _zc() { - Vzc(); - return OC(GC(_W, 1), Kie, 315, 0, [Uzc, Rzc, Szc, Qzc, Tzc]); - } - function sqc() { - mqc(); - return OC(GC(IW, 1), Kie, 335, 0, [iqc, hqc, kqc, lqc, jqc]); - } - function n$c() { - k$c(); - return OC(GC(y_, 1), Kie, 355, 0, [g$c, f$c, i$c, h$c, j$c]); - } - function _jc() { - Xjc(); - return OC(GC(uV, 1), Kie, 363, 0, [Tjc, Vjc, Wjc, Ujc, Sjc]); - } - function Ftc() { - Ctc(); - return OC(GC(TW, 1), Kie, 163, 0, [Btc, xtc, ytc, ztc, Atc]); - } - function T0d() { - T0d = ccb; - var a, b; - R0d = (LFd(), b = new MPd(), b); - S0d = (a = new OJd(), a); - } - function yUd(a) { - var b; - if (!a.c) { - b = a.r; - JD(b, 88) && (a.c = BD(b, 26)); - } - return a.c; - } - function zc(a) { - a.e = 3; - a.d = a.Yb(); - if (a.e != 2) { - a.e = 0; - return true; - } return false; - } - function RC(a) { - var b, c2, d; - b = a & Eje; - c2 = a >> 22 & Eje; - d = a < 0 ? Fje : 0; - return TC(b, c2, d); - } - function uy(a) { - var b, c2, d, e; - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - Qzb(b); - } - } - function Tc(a, b) { - var c2, d; - c2 = BD(Iv(a.c, b), 14); - if (c2) { - d = c2.gc(); - c2.$b(); - a.d -= d; + }, "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; + } + } } - } - function tjb(a, b) { - var c2, d; - c2 = b.cd(); - d = Awb(a, c2); - return !!d && wtb(d.e, b.dd()); - } - function Qgb(a, b) { - if (b == 0 || a.e == 0) { - return a; + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; + } + return false; } - return b > 0 ? ihb(a, b) : lhb(a, -b); - } - function Rgb2(a, b) { - if (b == 0 || a.e == 0) { - return a; + 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 b > 0 ? lhb(a, b) : ihb(a, -b); - } - function Rr(a) { - if (Qr(a)) { - a.c = a.a; - return a.a.Pb(); + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; } else { - throw vbb(new utb()); - } - } - function Yac(a) { - var b, c2; - b = a.c.i; - c2 = a.d.i; - return b.k == (j0b(), e0b) && c2.k == e0b; - } - function kZb(a) { - var b; - b = new UZb(); - tNb(b, a); - yNb(b, (Nyc(), jxc), null); - return b; - } - function hid(a, b, c2) { - var d; - return d = a.Yg(b), d >= 0 ? a._g(d, c2, true) : sid(a, b, c2); - } - function uHb(a, b, c2, d) { - var e; - for (e = 0; e < rHb; e++) { - nHb(a.a[b.g][e], c2, d[b.g]); - } - } - function vHb(a, b, c2, d) { - var e; - for (e = 0; e < sHb; e++) { - mHb(a.a[e][b.g], c2, d[b.g]); - } - } - function vSd(a, b, c2, d, e) { - kxd.call(this, b, d, e); - this.c = a; - this.a = c2; - } - function zSd(a, b, c2, d, e) { - lxd.call(this, b, d, e); - this.c = a; - this.a = c2; - } - function ISd(a, b, c2, d, e) { - oxd.call(this, b, d, e); - this.c = a; - this.a = c2; - } - function qSd(a, b, c2, d, e) { - oxd.call(this, b, d, e); - this.c = a; - this.b = c2; - } - function mWd(a, b, c2) { - VVd.call(this, c2); - this.b = a; - this.c = b; - this.d = (CWd(), AWd); - } - function oxd(a, b, c2) { - this.d = a; - this.k = b ? 1 : 0; - this.f = c2 ? 1 : 0; - this.o = -1; - this.p = 0; - } - function _6d(a, b, c2) { - var d; - d = new a7d(a.a); - Ld(d, a.a.a); - jrb(d.f, b, c2); - a.a.a = d; - } - function lud(a, b) { - a.qi(a.i + 1); - mud(a, a.i, a.oi(a.i, b)); - a.bi(a.i++, b); - a.ci(); - } - function oud(a) { - var b, c2; - ++a.j; - b = a.g; - c2 = a.i; - a.g = null; - a.i = 0; - a.di(c2, b); - a.ci(); - } - function Ou(a) { - var b, c2; - Qb(a); - b = Iu(a.length); - c2 = new Skb(b); - nmb(c2, a); - return c2; - } - function km(a) { - var b; - b = (Qb(a), a ? new Tkb(a) : Nu(a.Kc())); - smb(b); - return Dm(b); - } - function Kkb(a, b) { - var c2; - c2 = (tCb(b, a.c.length), a.c[b]); - cCb(a.c, b, 1); - return c2; - } - function Qc(a, b) { - var c2; - c2 = BD(a.c.xc(b), 14); - !c2 && (c2 = a.ic(b)); - return a.pc(b, c2); - } - function cfb(a, b) { - var c2, d; - c2 = (uCb(a), a); - d = (uCb(b), b); - return c2 == d ? 0 : c2 < d ? -1 : 1; - } - function Fpb(a) { - var b; - b = a.e + a.f; - if (isNaN(b) && Ldb(a.d)) { - return a.d; - } - return b; - } - function uwb(a, b) { - !a.a ? a.a = new Wfb(a.d) : Qfb(a.a, a.b); - Nfb(a.a, b); - return a; - } - function Sb(a, b) { - if (a < 0 || a > b) { - throw vbb(new qcb(Jb(a, b, "index"))); - } - return a; - } - function zhb(a, b, c2, d) { - var e; - e = KC(WD, oje, 25, b, 15, 1); - Ahb(e, a, b, c2, d); - return e; - } - function _A(a, b) { - var c2; - c2 = a.q.getHours() + (b / 60 | 0); - a.q.setMinutes(b); - YA(a, c2); - } - function A$c(a, b) { - return $wnd.Math.min(S6c(b.a, a.d.d.c), S6c(b.b, a.d.d.c)); - } - function Thb(a, b) { - return ND(b) ? b == null ? krb(a.f, null) : Erb(a.g, b) : krb(a.f, b); - } - function b1b(a) { - this.c = a; - this.a = new olb(this.c.a); - this.b = new olb(this.c.b); - } - function kRb() { - this.e = new Rkb(); - this.c = new Rkb(); - this.d = new Rkb(); - this.b = new Rkb(); - } - function MFb() { - this.g = new PFb(); - this.b = new PFb(); - this.a = new Rkb(); - this.k = new Rkb(); - } - function Gjc(a, b, c2) { - this.a = a; - this.c = b; - this.d = c2; - Ekb(b.e, this); - Ekb(c2.b, this); - } - function wBb(a, b) { - fvb.call(this, b.rd(), b.qd() & -6); - uCb(a); - this.a = a; - this.b = b; - } - function CBb(a, b) { - jvb.call(this, b.rd(), b.qd() & -6); - uCb(a); - this.a = a; - this.b = b; - } - function IBb(a, b) { - nvb.call(this, b.rd(), b.qd() & -6); - uCb(a); - this.a = a; - this.b = b; - } - function BQc(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - Ekb(a.t, this); - Ekb(b.i, this); - } - function SRc() { - this.b = new Psb(); - this.a = new Psb(); - this.b = new Psb(); - this.a = new Psb(); - } - function g6c() { - g6c = ccb; - f6c = new Lsd("org.eclipse.elk.labels.labelManager"); - } - function Vac() { - Vac = ccb; - Uac = new Msd("separateLayerConnections", (gbc(), fbc)); - } - function HOc() { - HOc = ccb; - GOc = new IOc("REGULAR", 0); - FOc = new IOc("CRITICAL", 1); - } - function _Ac() { - _Ac = ccb; - $Ac = new aBc("STACKED", 0); - ZAc = new aBc("SEQUENCED", 1); - } - function C_c() { - C_c = ccb; - B_c = new D_c("FIXED", 0); - A_c = new D_c("CENTER_NODE", 1); - } - function PHc(a, b) { - var c2; - c2 = VHc(a, b); - a.b = new BHc(c2.c.length); - return OHc(a, c2); - } - function KAd(a, b, c2) { - var d; - ++a.e; - --a.f; - d = BD(a.d[b].$c(c2), 133); - return d.dd(); - } - function JJd(a) { - var b; - if (!a.a) { - b = a.r; - JD(b, 148) && (a.a = BD(b, 148)); - } - return a.a; - } - function poc(a) { - if (a.a) { - if (a.e) { - return poc(a.e); - } + 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 a; - } - return null; - } - function ODc(a, b) { - if (a.p < b.p) { - return 1; - } else if (a.p > b.p) { - return -1; - } - return 0; - } - function pvb(a, b) { - uCb(b); - if (a.c < a.d) { - a.ze(b, a.c++); - return true; + return this.conditionStack[0]; } - return false; - } - function QYd(a, b) { - if (Mhb(a.a, b)) { - Thb(a.a, b); - return true; + }, "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 false; - } - } - function fd(a) { - var b, c2; - b = a.cd(); - c2 = BD(a.dd(), 14); - return $j(c2.Nc(), new ah(b)); - } - function sqb(a) { - var b; - b = BD(ZBb(a.b, a.b.length), 9); - return new xqb(a.a, b, a.c); - } - function _zb(a) { - var b; - Uzb(a); - b = new fAb(a, a.a.e, a.a.d | 4); - return new bAb(a, b); - } - function HAb(a) { - var b; - Tzb(a); - b = 0; - while (a.a.sd(new RBb())) { - b = wbb(b, 1); - } - return b; - } - function UDc(a, b, c2) { - var d, e; - d = 0; - for (e = 0; e < b.length; e++) { - d += a.$f(b[e], d, c2); - } - } - function QJb(a, b) { - var c2; - if (a.C) { - c2 = BD(Mpb(a.b, b), 124).n; - c2.d = a.C.d; - c2.a = a.C.a; - } - } - function Mi(a, b, c2) { - Pb(b, a.e.Hd().gc()); - Pb(c2, a.c.Hd().gc()); - return a.a[b][c2]; - } - function Ugb(a, b) { - Hgb(); - this.e = a; - this.d = 1; - this.a = OC(GC(WD, 1), oje, 25, 15, [b]); - } - function dg(a, b, c2, d) { - this.f = a; - this.e = b; - this.d = c2; - this.b = d; - this.c = !d ? null : d.d; - } - function o5b(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 Y2d(a, b, c2, d) { - X2d(a, b, c2, M2d(a, b, d, JD(b, 99) && (BD(b, 18).Bb & Tje) != 0)); - } - function tac(a, b) { - Odd(b, "Label management", 1); - RD(vNb(a, (g6c(), f6c))); - Qdd(b); - } - function Skb(a) { - Ckb(this); - mCb(a >= 0, "Initial capacity must not be negative"); - } - function lHb() { - lHb = ccb; - kHb = as((gHb(), OC(GC(pN, 1), Kie, 232, 0, [dHb, eHb, fHb]))); - } - function SHb() { - SHb = ccb; - RHb = as((NHb(), OC(GC(sN, 1), Kie, 461, 0, [LHb, KHb, MHb]))); - } - function JIb() { - JIb = ccb; - IIb = as((EIb(), OC(GC(zN, 1), Kie, 462, 0, [DIb, CIb, BIb]))); - } - function Kyb() { - Kyb = ccb; - Jyb = as((Fyb(), OC(GC(xL, 1), Kie, 132, 0, [Cyb, Dyb, Eyb]))); - } - function DTb() { - DTb = ccb; - CTb = as((yTb(), OC(GC(oP, 1), Kie, 379, 0, [wTb, vTb, xTb]))); - } - function WXb() { - WXb = ccb; - VXb = as((RXb(), OC(GC(hQ, 1), Kie, 423, 0, [QXb, PXb, OXb]))); - } - function Zpc() { - Zpc = ccb; - Ypc = as((Rpc(), OC(GC(GW, 1), Kie, 314, 0, [Ppc, Opc, Qpc]))); - } - function gqc() { - gqc = ccb; - fqc = as((bqc(), OC(GC(HW, 1), Kie, 337, 0, [$pc, aqc, _pc]))); - } - function Lqc() { - Lqc = ccb; - Kqc = as((Gqc(), OC(GC(KW, 1), Kie, 450, 0, [Eqc, Dqc, Fqc]))); - } - function Kkc() { - Kkc = ccb; - Jkc = as((Fkc(), OC(GC(vV, 1), Kie, 361, 0, [Ekc, Dkc, Ckc]))); - } - function jsc() { - jsc = ccb; - isc = as((esc(), OC(GC(RW, 1), Kie, 303, 0, [csc, dsc, bsc]))); - } - function asc() { - asc = ccb; - _rc = as((Xrc(), OC(GC(QW, 1), Kie, 292, 0, [Vrc, Wrc, Urc]))); - } - function Dzc() { - Dzc = ccb; - Czc = as((xzc(), OC(GC(ZW, 1), Kie, 378, 0, [uzc, vzc, wzc]))); - } - function YAc() { - YAc = ccb; - XAc = as((TAc(), OC(GC(eX, 1), Kie, 375, 0, [QAc, RAc, SAc]))); - } - function yAc() { - yAc = ccb; - xAc = as((tAc(), OC(GC(bX, 1), Kie, 339, 0, [rAc, qAc, sAc]))); - } - function PAc() { - PAc = ccb; - OAc = as((KAc(), OC(GC(dX, 1), Kie, 452, 0, [JAc, HAc, IAc]))); - } - function QBc() { - QBc = ccb; - PBc = as((LBc(), OC(GC(jX, 1), Kie, 377, 0, [JBc, KBc, IBc]))); - } - function yBc() { - yBc = ccb; - xBc = as((tBc(), OC(GC(hX, 1), Kie, 336, 0, [qBc, rBc, sBc]))); - } - function HBc() { - HBc = ccb; - GBc = as((CBc(), OC(GC(iX, 1), Kie, 338, 0, [BBc, zBc, ABc]))); - } - function wGc() { - wGc = ccb; - vGc = as((rGc(), OC(GC(PX, 1), Kie, 454, 0, [oGc, pGc, qGc]))); - } - function zVc() { - zVc = ccb; - yVc = as((tVc(), OC(GC(O$, 1), Kie, 442, 0, [sVc, qVc, rVc]))); - } - function vWc() { - vWc = ccb; - uWc = as((pWc(), OC(GC(Y$, 1), Kie, 380, 0, [mWc, nWc, oWc]))); - } - function EYc() { - EYc = ccb; - DYc = as((zYc(), OC(GC(q_, 1), Kie, 381, 0, [xYc, yYc, wYc]))); - } - function yXc() { - yXc = ccb; - xXc = as((sXc(), OC(GC(b_, 1), Kie, 293, 0, [qXc, rXc, pXc]))); - } - function b_c() { - b_c = ccb; - a_c = as((Y$c(), OC(GC(J_, 1), Kie, 437, 0, [V$c, W$c, X$c]))); - } - function mbd() { - mbd = ccb; - lbd = as((hbd(), OC(GC(z1, 1), Kie, 334, 0, [fbd, ebd, gbd]))); - } - function vad() { - vad = ccb; - uad = as((qad(), OC(GC(u1, 1), Kie, 272, 0, [nad, oad, pad2]))); - } - function icd() { - dcd(); - return OC(GC(D1, 1), Kie, 98, 0, [ccd, bcd, acd, Zbd, _bd, $bd]); - } - function ikd(a, b) { - return !a.o && (a.o = new dId((Thd(), Qhd), S2, a, 0)), qAd(a.o, b); - } - function NAd(a) { - !a.g && (a.g = new JCd()); - !a.g.d && (a.g.d = new MBd(a)); - return a.g.d; - } - function yAd(a) { - !a.g && (a.g = new JCd()); - !a.g.a && (a.g.a = new SBd(a)); - return a.g.a; - } - function EAd(a) { - !a.g && (a.g = new JCd()); - !a.g.b && (a.g.b = new GBd(a)); - return a.g.b; - } - function FAd(a) { - !a.g && (a.g = new JCd()); - !a.g.c && (a.g.c = new iCd(a)); - return a.g.c; - } - function A2d(a, b, c2) { - var d, e; - e = new p4d(b, a); - for (d = 0; d < c2; ++d) { - d4d(e); - } - return e; - } - function Atd(a, b, c2) { - var d, e; - if (c2 != null) { - for (d = 0; d < b; ++d) { - e = c2[d]; - a.fi(d, e); - } - } - } - function uhb(a, b, c2, d) { - var e; - e = KC(WD, oje, 25, b + 1, 15, 1); - vhb(e, a, b, c2, d); - return e; - } - function KC(a, b, c2, d, e, f2) { - var g; - g = LC(e, d); - e != 10 && OC(GC(a, f2), b, c2, e, g); - return g; - } - function bYd(a, b, c2, d) { - !!c2 && (d = c2.gh(b, bLd(c2.Tg(), a.c.Lj()), null, d)); - return d; - } - function cYd(a, b, c2, d) { - !!c2 && (d = c2.ih(b, bLd(c2.Tg(), a.c.Lj()), null, d)); - return d; - } - function KNb(a, b, c2) { - BD(a.b, 65); - BD(a.b, 65); - BD(a.b, 65); - Hkb(a.a, new TNb(c2, b, a)); - } - function ACb(a, b, c2) { - if (a < 0 || b > c2 || b < a) { - throw vbb(new Xfb(xke + a + zke + b + oke + c2)); - } - } - function zCb(a) { - if (!a) { - throw vbb(new Zdb("Unable to add element to queue")); - } - } - function Vzb(a) { - if (!a) { - this.c = null; - this.b = new Rkb(); - } else { - this.c = a; - this.b = null; - } - } - function exb(a, b) { - pjb.call(this, a, b); - this.a = KC(dL, zie, 436, 2, 0, 1); - this.b = true; - } - function _rb(a) { - Whb.call(this, a, 0); - Trb(this); - this.d.b = this.d; - this.d.a = this.d; - } - function VRc(a) { - var b; - b = a.b; - if (b.b == 0) { - return null; - } - return BD(Ut(b, 0), 188).b; - } - function Kwb(a, b) { - var c2; - c2 = new fxb(); - c2.c = true; - c2.d = b.dd(); - return Lwb(a, b.cd(), c2); - } - function bB(a, b) { - var c2; - c2 = a.q.getHours() + (b / 3600 | 0); - a.q.setSeconds(b); - YA(a, c2); - } - function zGc(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 S6c(a, b) { - var c2, d; - c2 = a.a - b.a; - d = a.b - b.b; - return $wnd.Math.sqrt(c2 * c2 + d * d); - } - function Ipc() { - Ipc = ccb; - Gpc = new Jpc("QUADRATIC", 0); - Hpc = new Jpc("SCANLINE", 1); - } - function hCc() { - hCc = ccb; - gCc = c3c(e3c(new j3c(), (qUb(), lUb), (S8b(), n8b)), pUb, J8b); - } - function l8c() { - i8c(); - return OC(GC(r1, 1), Kie, 291, 0, [h8c, g8c, f8c, d8c, c8c, e8c]); - } - function I7c() { - F7c(); - return OC(GC(o1, 1), Kie, 248, 0, [z7c, C7c, D7c, E7c, A7c, B7c]); - } - function Dpc() { - Apc(); - return OC(GC(EW, 1), Kie, 227, 0, [wpc, ypc, vpc, xpc, zpc, upc]); - } - function Brc() { - yrc(); - return OC(GC(OW, 1), Kie, 275, 0, [wrc, trc, xrc, vrc, urc, rrc]); - } - function orc() { - lrc(); - return OC(GC(NW, 1), Kie, 274, 0, [irc, hrc, krc, grc, jrc, frc]); - } - function rzc() { - lzc(); - return OC(GC(YW, 1), Kie, 313, 0, [jzc, hzc, fzc, gzc, kzc, izc]); - } - function Wqc() { - Sqc(); - return OC(GC(LW, 1), Kie, 276, 0, [Nqc, Mqc, Pqc, Oqc, Rqc, Qqc]); - } - function uSc() { - qSc(); - return OC(GC(t$, 1), Kie, 327, 0, [pSc, lSc, nSc, mSc, oSc, kSc]); - } - function wcd() { - rcd(); - return OC(GC(E1, 1), Kie, 273, 0, [pcd, ncd, ocd, mcd, lcd, qcd]); - } - function Pad() { - Mad(); - return OC(GC(w1, 1), Kie, 312, 0, [Kad, Iad, Lad, Gad, Jad, Had]); - } - function m0b() { - j0b(); - return OC(GC(NQ, 1), Kie, 267, 0, [h0b, g0b, e0b, i0b, f0b, d0b]); - } - function mib(a) { - yCb(!!a.c); - xpb(a.e, a); - a.c.Qb(); - a.c = null; - a.b = kib(a); - ypb(a.e, a); - } - function tsb(a) { - xpb(a.c.a.e, a); - sCb(a.b != a.c.a.d); - a.a = a.b; - a.b = a.b.a; - return a.a; - } - function kSd(a) { - var b; - if (!a.a && a.b != -1) { - b = a.c.Tg(); - a.a = XKd(b, a.b); - } - return a.a; - } - function wtd(a, b) { - if (a.hi() && a.Hc(b)) { - return false; - } else { - a.Yh(b); - return true; - } - } - function $Hb(a, b) { - ytb(b, "Horizontal alignment cannot be null"); - a.b = b; - return a; - } - function Lfe(a, b, c2) { - wfe(); - var d; - d = Kfe(a, b); - c2 && !!d && Nfe(a) && (d = null); - return d; - } - function vXb(a, b, c2) { - var d, e; - for (e = a.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 37); - uXb(d, b, c2); - } - } - function tXb(a, b) { - var c2, d; - for (d = b.Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 37); - sXb(a, c2, 0, 0); - } - } - function ojc(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 KZc(a, b) { - var c2, d, e; - e = a.r; - d = a.d; - c2 = MZc(a, b, true); - return c2.b != e || c2.a != d; - } - function Jjc(a, b) { - Vrb(a.e, b) || Xrb(a.e, b, new Pjc(b)); - return BD(Wrb(a.e, b), 113); - } - function Byb(a, b, c2, d) { - uCb(a); - uCb(b); - uCb(c2); - uCb(d); - return new Lyb(a, b, new Vxb()); - } - function dId(a, b, c2, d) { - this.rj(); - this.a = b; - this.b = a; - this.c = new Y5d(this, b, c2, d); - } - function oSd(a, b, c2, d, e, f2) { - mxd.call(this, b, d, e, f2); - this.c = a; - this.b = c2; - } - function ESd(a, b, c2, d, e, f2) { - mxd.call(this, b, d, e, f2); - this.c = a; - this.a = c2; - } - function Bqd(a, b, c2) { - var d, e, f2; - d = aC(a, c2); - e = null; - !!d && (e = aqd(d)); - f2 = e; - Vqd(b, c2, f2); - } - function Cqd(a, b, c2) { - var d, e, f2; - d = aC(a, c2); - e = null; - !!d && (e = aqd(d)); - f2 = e; - Vqd(b, c2, f2); - } - function v1d(a, b, c2) { - var d, e; - e = (d = nUd(a.b, b), d); - return !e ? null : V1d(p1d(a, e), c2); - } - function gid(a, b) { - var c2; - return c2 = a.Yg(b), c2 >= 0 ? a._g(c2, true, true) : sid(a, b, true); - } - function s6b(a, b) { - return Kdb(Edb(ED(vNb(a, (wtc(), htc)))), Edb(ED(vNb(b, htc)))); - } - function pUc() { - pUc = ccb; - oUc = b3c(b3c(g3c(new j3c(), (yRc(), vRc)), (qSc(), pSc)), lSc); - } - function IHc(a, b, c2) { - var d; - d = SHc(a, b, c2); - a.b = new BHc(d.c.length); - return KHc(a, d); - } - function qhe(a) { - if (a.b <= 0) - throw vbb(new utb()); - --a.b; - a.a -= a.c.c; - return meb(a.a); - } - function ptd(a) { - var b; - if (!a.a) { - throw vbb(new vtb()); - } - b = a.a; - a.a = Xod(a.a); - return b; - } - function dBb(a) { - while (!a.a) { - if (!HBb(a.c, new hBb(a))) { - return false; - } - } - return true; - } - function vr(a) { - var b; - Qb(a); - if (JD(a, 198)) { - b = BD(a, 198); - return b; - } - return new wr(a); - } - function r3c(a) { - p3c(); - BD(a.We((Y9c(), x9c)), 174).Fc((rcd(), ocd)); - a.Ye(w9c, null); - } - function p3c() { - p3c = ccb; - m3c = new v3c(); - o3c = new x3c(); - n3c = mn((Y9c(), w9c), m3c, b9c, o3c); - } - function fWc() { - fWc = ccb; - dWc = new hWc("LEAF_NUMBER", 0); - eWc = new hWc("NODE_SIZE", 1); - } - function UMc(a, b, c2) { - a.a = b; - a.c = c2; - a.b.a.$b(); - Osb(a.d); - a.e.a.c = KC(SI, Uhe, 1, 0, 5, 1); - } - function yHc(a) { - a.a = KC(WD, oje, 25, a.b + 1, 15, 1); - a.c = KC(WD, oje, 25, a.b, 15, 1); - a.d = 0; - } - function MWb(a, b) { - if (a.a.ue(b.d, a.b) > 0) { - Ekb(a.c, new dWb(b.c, b.d, a.d)); - a.b = b.d; - } - } - function nud(a, b) { - if (a.g == null || b >= a.i) - throw vbb(new $zd(b, a.i)); - return a.g[b]; - } - function pOd(a, b, c2) { - Itd(a, c2); - if (c2 != null && !a.wj(c2)) { - throw vbb(new tcb()); - } - return c2; - } - function KLd(a) { - var b; - if (a.Ek()) { - for (b = a.i - 1; b >= 0; --b) { - qud(a, b); - } - } - return wud(a); - } - function Bwb(a) { - var b, c2; - if (!a.b) { - return null; - } - c2 = a.b; - while (b = c2.a[0]) { - c2 = b; - } - return c2; - } - function ulb(a, b) { - var c2, d; - pCb(b); - return c2 = (d = a.slice(0, b), PC(d, a)), c2.length = b, c2; - } - function Klb(a, b, c2, d) { - var e; - d = (ipb(), !d ? fpb : d); - e = a.slice(b, c2); - Llb(e, a, b, c2, -b, d); - } - function bid(a, b, c2, d, e) { - return b < 0 ? sid(a, c2, d) : BD(c2, 66).Nj().Pj(a, a.yh(), b, d, e); - } - function hZd(a) { - if (JD(a, 172)) { - return "" + BD(a, 172).a; - } - return a == null ? null : fcb(a); - } - function iZd(a) { - if (JD(a, 172)) { - return "" + BD(a, 172).a; - } - return a == null ? null : fcb(a); - } - function nDb(a, b) { - if (b.a) { - throw vbb(new hz(Hke)); - } - Qqb(a.a, b); - b.a = a; - !a.j && (a.j = b); - } - function qBb(a, b) { - nvb.call(this, b.rd(), b.qd() & -16449); - uCb(a); - this.a = a; - this.c = b; - } - function Ti(a, b) { - var c2, d; - d = b / a.c.Hd().gc() | 0; - c2 = b % a.c.Hd().gc(); - return Mi(a, d, c2); - } - function NHb() { - NHb = ccb; - LHb = new OHb(jle, 0); - KHb = new OHb(gle, 1); - MHb = new OHb(kle, 2); - } - function lxb() { - lxb = ccb; - hxb = new mxb("All", 0); - ixb = new rxb(); - jxb = new txb(); - kxb = new wxb(); - } - function zxb() { - zxb = ccb; - yxb = as((lxb(), OC(GC(iL, 1), Kie, 297, 0, [hxb, ixb, jxb, kxb]))); - } - function uWb() { - uWb = ccb; - tWb = as((lWb(), OC(GC(SP, 1), Kie, 405, 0, [hWb, kWb, iWb, jWb]))); - } - function ALb() { - ALb = ccb; - zLb = as((vLb(), OC(GC(PN, 1), Kie, 406, 0, [uLb, rLb, sLb, tLb]))); - } - function WMb() { - WMb = ccb; - VMb = as((RMb(), OC(GC(jO, 1), Kie, 323, 0, [OMb, NMb, PMb, QMb]))); - } - function WOb() { - WOb = ccb; - VOb = as((ROb(), OC(GC(CO, 1), Kie, 394, 0, [OOb, NOb, POb, QOb]))); - } - function GRc() { - GRc = ccb; - FRc = as((yRc(), OC(GC(h$, 1), Kie, 393, 0, [uRc, vRc, wRc, xRc]))); - } - function mbc() { - mbc = ccb; - lbc = as((gbc(), OC(GC(VS, 1), Kie, 360, 0, [fbc, dbc, ebc, cbc]))); - } - function oXc() { - oXc = ccb; - nXc = as((iXc(), OC(GC(a_, 1), Kie, 340, 0, [hXc, fXc, gXc, eXc]))); - } - function Fjc() { - Fjc = ccb; - Ejc = as((Ajc(), OC(GC(mV, 1), Kie, 411, 0, [wjc, xjc, yjc, zjc]))); - } - function Pzc() { - Pzc = ccb; - Ozc = as((Izc(), OC(GC($W, 1), Kie, 197, 0, [Gzc, Hzc, Fzc, Ezc]))); - } - function ugd() { - ugd = ccb; - tgd = as((pgd(), OC(GC(k2, 1), Kie, 396, 0, [mgd, ngd, lgd, ogd]))); - } - function xbd() { - xbd = ccb; - wbd = as((rbd(), OC(GC(A1, 1), Kie, 285, 0, [qbd, nbd, obd, pbd]))); - } - function Fad() { - Fad = ccb; - Ead = as((Aad(), OC(GC(v1, 1), Kie, 218, 0, [zad, xad, wad, yad]))); - } - function Ied() { - Ied = ccb; - Hed = as((Ded(), OC(GC(O1, 1), Kie, 311, 0, [Ced, zed, Bed, Aed]))); - } - function ydd() { - ydd = ccb; - xdd = as((tdd(), OC(GC(I1, 1), Kie, 374, 0, [rdd, sdd, qdd, pdd]))); - } - function A9d() { - A9d = ccb; - Smd(); - x9d = Pje; - w9d = Qje; - z9d = new Ndb(Pje); - y9d = new Ndb(Qje); - } - function _qc() { - _qc = ccb; - $qc = new arc(ane, 0); - Zqc = new arc("IMPROVE_STRAIGHTNESS", 1); - } - function eIc(a, b) { - FHc(); - return Ekb(a, new vgd(b, meb(b.e.c.length + b.g.c.length))); - } - function gIc(a, b) { - FHc(); - return Ekb(a, new vgd(b, meb(b.e.c.length + b.g.c.length))); - } - function PC(a, b) { - HC(b) != 10 && OC(rb(b), b.hm, b.__elementTypeId$, HC(b), a); - return a; - } - function Lkb(a, b) { - var c2; - c2 = Jkb(a, b, 0); - if (c2 == -1) { - return false; - } - Kkb(a, c2); - return true; - } - function Zrb(a, b) { - var c2; - c2 = BD(Thb(a.e, b), 387); - if (c2) { - jsb(c2); - return c2.e; - } - return null; - } - function Jbb(a) { - var b; - if (Fbb(a)) { - b = 0 - a; - if (!isNaN(b)) { - return b; - } - } - return zbb(hD(a)); - } - function Jkb(a, b, c2) { - for (; c2 < a.c.length; ++c2) { - if (wtb(b, a.c[c2])) { - return c2; - } - } - return -1; - } - function SAb(a, b, c2) { - var d; - Tzb(a); - d = new NBb(); - d.a = b; - a.a.Nb(new VBb(d, c2)); - return d.a; - } - function aAb(a) { - var b; - Tzb(a); - b = KC(UD, Vje, 25, 0, 15, 1); - _ub(a.a, new kAb(b)); - return b; - } - function ajc(a) { - var b, c2; - c2 = BD(Ikb(a.j, 0), 11); - b = BD(vNb(c2, (wtc(), $sc)), 11); - return b; - } - function yc(a) { - var b; - if (!xc(a)) { - throw vbb(new utb()); - } - a.e = 1; - b = a.d; - a.d = null; - return b; - } - function wu(a, b) { - var c2; - this.f = a; - this.b = b; - c2 = BD(Ohb(a.b, b), 283); - this.c = !c2 ? null : c2.b; - } - function Ygc() { - Hgc(); - this.b = new Lqb(); - this.f = new Lqb(); - this.g = new Lqb(); - this.e = new Lqb(); - } - function Tnc(a, b) { - this.a = KC(OQ, kne, 10, a.a.c.length, 0, 1); - Qkb(a.a, this.a); - this.b = b; - } - function zoc(a) { - var b; - for (b = a.p + 1; b < a.c.a.c.length; ++b) { - --BD(Ikb(a.c.a, b), 10).p; - } - } - function Rwd(a) { - var b; - b = a.Ai(); - b != null && a.d != -1 && BD(b, 92).Ng(a); - !!a.i && a.i.Fi(); - } - function rFd(a) { - Py(this); - this.g = !a ? null : Wy(a, a.$d()); - this.f = a; - Ry(this); - this._d(); - } - function pSd(a, b, c2, d, e, f2, g) { - nxd.call(this, b, d, e, f2, g); - this.c = a; - this.b = c2; - } - function Ayb(a, b, c2, d, e) { - uCb(a); - uCb(b); - uCb(c2); - uCb(d); - uCb(e); - return new Lyb(a, b, d); - } - function B2c(a, b) { - if (b < 0) { - throw vbb(new qcb(ese + b)); - } - A2c(a, b + 1); - return Ikb(a.j, b); - } - function Ob(a, b, c2, d) { - if (!a) { - throw vbb(new Wdb(hc(b, OC(GC(SI, 1), Uhe, 1, 5, [c2, d])))); - } - } - function dDb(a, b) { - return wtb(b, Ikb(a.f, 0)) || wtb(b, Ikb(a.f, 1)) || wtb(b, Ikb(a.f, 2)); - } - function ghd(a, b) { - ecd(BD(BD(a.f, 33).We((Y9c(), t9c)), 98)) && NCd(Yod(BD(a.f, 33)), b); - } - function p1d(a, b) { - var c2, d; - c2 = BD(b, 675); - d = c2.Oh(); - !d && c2.Rh(d = new Y1d(a, b)); - return d; - } - function q1d(a, b) { - var c2, d; - c2 = BD(b, 677); - d = c2.pk(); - !d && c2.tk(d = new j2d(a, b)); - return d; - } - function QSd(a) { - if (!a.b) { - a.b = new UTd(a, j5, a); - !a.a && (a.a = new fTd(a, a)); - } - return a.b; - } - function yTb() { - yTb = ccb; - wTb = new zTb("XY", 0); - vTb = new zTb("X", 1); - xTb = new zTb("Y", 2); - } - function EIb() { - EIb = ccb; - DIb = new FIb("TOP", 0); - CIb = new FIb(gle, 1); - BIb = new FIb(mle, 2); - } - function esc() { - esc = ccb; - csc = new fsc(ane, 0); - dsc = new fsc("TOP", 1); - bsc = new fsc(mle, 2); - } - function BAc() { - BAc = ccb; - zAc = new CAc("INPUT_ORDER", 0); - AAc = new CAc("PORT_DEGREE", 1); - } - function wD() { - wD = ccb; - sD = TC(Eje, Eje, 524287); - tD = TC(0, 0, Gje); - uD = RC(1); - RC(2); - vD = RC(0); - } - function WDc(a, b, c2) { - a.a.c = KC(SI, Uhe, 1, 0, 5, 1); - $Dc(a, b, c2); - a.a.c.length == 0 || TDc(a, b); - } - function rfb(a) { - var b, c2; - c2 = a.length; - b = KC(TD, $ie, 25, c2, 15, 1); - ffb(a, 0, c2, b, 0); - return b; - } - function Aid(a) { - var b; - if (!a.dh()) { - b = aLd(a.Tg()) - a.Ah(); - a.ph().bk(b); - } - return a.Pg(); - } - function xjd(a) { - var b; - b = CD(Ajd(a, 32)); - if (b == null) { - yjd(a); - b = CD(Ajd(a, 32)); - } - return b; - } - function iid(a, b) { - var c2; - c2 = bLd(a.d, b); - return c2 >= 0 ? fid(a, c2, true, true) : sid(a, b, true); - } - function vgc(a, b) { - qgc(); - var c2, d; - c2 = ugc(a); - d = ugc(b); - return !!c2 && !!d && !omb(c2.k, d.k); - } - function Gqd(a, b) { - dld(a, b == null || Ldb((uCb(b), b)) || isNaN((uCb(b), b)) ? 0 : (uCb(b), b)); - } - function Hqd(a, b) { - eld(a, b == null || Ldb((uCb(b), b)) || isNaN((uCb(b), b)) ? 0 : (uCb(b), b)); - } - function Iqd(a, b) { - cld(a, b == null || Ldb((uCb(b), b)) || isNaN((uCb(b), b)) ? 0 : (uCb(b), b)); - } - function Jqd(a, b) { - ald(a, b == null || Ldb((uCb(b), b)) || isNaN((uCb(b), b)) ? 0 : (uCb(b), b)); - } - function agd(a) { - (!this.q ? (mmb(), mmb(), kmb) : this.q).Ac(!a.q ? (mmb(), mmb(), kmb) : a.q); - } - function S2d(a, b) { - return JD(b, 99) && (BD(b, 18).Bb & Tje) != 0 ? new s4d(b, a) : new p4d(b, a); - } - function U2d(a, b) { - return JD(b, 99) && (BD(b, 18).Bb & Tje) != 0 ? new s4d(b, a) : new p4d(b, a); - } - function INb(a, b) { - HNb = new tOb(); - FNb = b; - GNb = a; - BD(GNb.b, 65); - KNb(GNb, HNb, null); - JNb(GNb); - } - function uud(a, b, c2) { - var d; - d = a.g[b]; - mud(a, b, a.oi(b, c2)); - a.gi(b, c2, d); - a.ci(); - return d; - } - function Ftd(a, b) { - var c2; - c2 = a.Xc(b); - if (c2 >= 0) { - a.$c(c2); - return true; - } else { - return false; - } - } - function YId(a) { - var b; - if (a.d != a.r) { - b = wId(a); - a.e = !!b && b.Cj() == Bve; - a.d = b; - } - return a.e; - } - function fr(a, b) { - var c2; - Qb(a); - Qb(b); - c2 = false; - while (b.Ob()) { - c2 = c2 | a.Fc(b.Pb()); - } - return c2; - } - function Wrb(a, b) { - var c2; - c2 = BD(Ohb(a.e, b), 387); - if (c2) { - Yrb(a, c2); - return c2.e; - } - return null; - } - function UA(a) { - var b, c2; - b = a / 60 | 0; - c2 = a % 60; - if (c2 == 0) { - return "" + b; - } - return "" + b + ":" + ("" + c2); - } - function LAb(a, b) { - var c2, d; - Uzb(a); - d = new IBb(b, a.a); - c2 = new fBb(d); - return new YAb(a, c2); - } - function tB(d, a) { - var b = d.a[a]; - var c2 = (rC(), qC)[typeof b]; - return c2 ? c2(b) : xC(typeof b); - } - function yzc(a) { - switch (a.g) { - case 0: - return Ohe; - case 1: - return -1; - default: - return 0; - } - } - function oD(a) { - if (eD(a, (wD(), vD)) < 0) { - return -aD(hD(a)); - } - return a.l + a.m * Hje + a.h * Ije; - } - function HC(a) { - return a.__elementTypeCategory$ == null ? 10 : a.__elementTypeCategory$; - } - function dub(a) { - var b; - b = a.b.c.length == 0 ? null : Ikb(a.b, 0); - b != null && fub(a, 0); - return b; - } - function uA(a, b) { - while (b[0] < a.length && hfb(" \r\n", wfb(bfb(a, b[0]))) >= 0) { - ++b[0]; - } - } - function sgb(a, b) { - this.e = b; - this.a = vgb(a); - this.a < 54 ? this.f = Sbb(a) : this.c = ghb(a); - } - function vge(a, b, c2, d) { - wfe(); - xfe.call(this, 26); - this.c = a; - this.a = b; - this.d = c2; - this.b = d; - } - function EA(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 Hhe(a, b) { - var c2; - c2 = 0; - while (a.e != a.i.gc()) { - Qrd(b, Dyd(a), meb(c2)); - c2 != Ohe && ++c2; - } - } - function xHc(a, b) { - var c2; - ++a.d; - ++a.c[b]; - c2 = b + 1; - while (c2 < a.a.length) { - ++a.a[c2]; - c2 += c2 & -c2; - } - } - function Qgc(a, b) { - var c2, d, e; - e = b.c.i; - c2 = BD(Ohb(a.f, e), 57); - d = c2.d.c - c2.e.c; - p7c(b.a, d, 0); - } - function Scb(a) { - var b, c2; - b = a + 128; - c2 = (Ucb(), Tcb)[b]; - !c2 && (c2 = Tcb[b] = new Mcb(a)); - return c2; - } - function es(a, b) { - var c2; - uCb(b); - c2 = a[":" + b]; - nCb(!!c2, OC(GC(SI, 1), Uhe, 1, 5, [b])); - return c2; - } - function Mz(a) { - var b, c2; - if (a.b) { - c2 = null; - do { - b = a.b; - a.b = null; - c2 = Pz(b, c2); - } while (a.b); - a.b = c2; - } - } - function Lz(a) { - var b, c2; - if (a.a) { - c2 = null; - do { - b = a.a; - a.a = null; - c2 = Pz(b, c2); - } while (a.a); - a.a = c2; - } - } - function Dqb(a) { - var b; - ++a.a; - for (b = a.c.a.length; a.a < b; ++a.a) { - if (a.c.b[a.a]) { - return; - } - } - } - function S9b(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 fic(a, b) { - var c2; - c2 = Jy(a.e.c, b.e.c); - if (c2 == 0) { - return Kdb(a.e.d, b.e.d); - } - return c2; - } - function Ogb(a, b) { - if (b.e == 0) { - return Ggb; - } - if (a.e == 0) { - return Ggb; - } - return Dhb(), Ehb(a, b); - } - function nCb(a, b) { - if (!a) { - throw vbb(new Wdb(DCb("Enum constant undefined: %s", b))); - } - } - function AWb() { - AWb = ccb; - xWb = new XWb(); - yWb = new _Wb(); - vWb = new dXb(); - wWb = new hXb(); - zWb = new lXb(); - } - function UEb() { - UEb = ccb; - SEb = new VEb("BY_SIZE", 0); - TEb = new VEb("BY_SIZE_AND_SHAPE", 1); - } - function XRb() { - XRb = ccb; - VRb = new YRb("EADES", 0); - WRb = new YRb("FRUCHTERMAN_REINGOLD", 1); - } - function xqc() { - xqc = ccb; - vqc = new yqc("READING_DIRECTION", 0); - wqc = new yqc("ROTATION", 1); - } - function uqc() { - uqc = ccb; - tqc = as((mqc(), OC(GC(IW, 1), Kie, 335, 0, [iqc, hqc, kqc, lqc, jqc]))); - } - function bAc() { - bAc = ccb; - aAc = as((Vzc(), OC(GC(_W, 1), Kie, 315, 0, [Uzc, Rzc, Szc, Qzc, Tzc]))); - } - function bkc() { - bkc = ccb; - akc = as((Xjc(), OC(GC(uV, 1), Kie, 363, 0, [Tjc, Vjc, Wjc, Ujc, Sjc]))); - } - function Htc() { - Htc = ccb; - Gtc = as((Ctc(), OC(GC(TW, 1), Kie, 163, 0, [Btc, xtc, ytc, ztc, Atc]))); - } - function S_c() { - S_c = ccb; - R_c = as((N_c(), OC(GC(Q_, 1), Kie, 316, 0, [I_c, J_c, M_c, K_c, L_c]))); - } - function S5c() { - S5c = ccb; - R5c = as((N5c(), OC(GC(e1, 1), Kie, 175, 0, [L5c, K5c, I5c, M5c, J5c]))); - } - function p$c() { - p$c = ccb; - o$c = as((k$c(), OC(GC(y_, 1), Kie, 355, 0, [g$c, f$c, i$c, h$c, j$c]))); - } - function vUb() { - vUb = ccb; - uUb = as((qUb(), OC(GC(zP, 1), Kie, 356, 0, [lUb, mUb, nUb, oUb, pUb]))); - } - function mad() { - mad = ccb; - lad = as((ead(), OC(GC(t12, 1), Kie, 103, 0, [cad, bad, aad, _9c, dad]))); - } - function Ybd() { - Ybd = ccb; - Xbd = as((Tbd(), OC(GC(C1, 1), Kie, 249, 0, [Qbd, Sbd, Obd, Pbd, Rbd]))); - } - function cdd() { - cdd = ccb; - bdd = as((Ucd(), OC(GC(F1, 1), bne, 61, 0, [Scd, Acd, zcd, Rcd, Tcd]))); - } - function _1c(a, b) { - var c2; - c2 = BD(Ohb(a.a, b), 134); - if (!c2) { - c2 = new zNb(); - Rhb(a.a, b, c2); - } - return c2; - } - function hoc(a) { - var b; - b = BD(vNb(a, (wtc(), usc)), 305); - if (b) { - return b.a == a; - } - return false; - } - function ioc(a) { - var b; - b = BD(vNb(a, (wtc(), usc)), 305); - if (b) { - return b.i == a; - } - return false; - } - function Jub(a, b) { - uCb(b); - Iub(a); - if (a.d.Ob()) { - b.td(a.d.Pb()); - return true; - } - return false; - } - function Oy(a) { - if (ybb(a, Ohe) > 0) { - return Ohe; - } - if (ybb(a, Rie) < 0) { - return Rie; - } - return Tbb(a); - } - function Cv(a) { - if (a < 3) { - Xj(a, Hie); - return a + 1; - } - if (a < Iie) { - return QD(a / 0.75 + 1); - } - return Ohe; - } - function XKd(a, b) { - var c2; - c2 = (a.i == null && TKd(a), a.i); - return b >= 0 && b < c2.length ? c2[b] : null; - } - function cC(a, b, c2) { - var d; - if (b == null) { - throw vbb(new Geb()); - } - d = aC(a, b); - dC(a, b, c2); - return d; - } - function Emc(a) { - a.a >= -0.01 && a.a <= ple && (a.a = 0); - a.b >= -0.01 && a.b <= ple && (a.b = 0); - return a; - } - function sfb(a, b) { - return b == (ntb(), ntb(), mtb) ? a.toLocaleLowerCase() : a.toLowerCase(); - } - function idb(a) { - return ((a.i & 2) != 0 ? "interface " : (a.i & 1) != 0 ? "" : "class ") + (fdb(a), a.o); - } - function Pnd(a) { - var b, c2; - c2 = (b = new SSd(), b); - wtd((!a.q && (a.q = new cUd(n5, a, 11, 10)), a.q), c2); - } - function Pdd(a, b) { - var c2; - c2 = b > 0 ? b - 1 : b; - return Vdd(Wdd(Xdd(Ydd(new Zdd(), c2), a.n), a.j), a.k); - } - function u2d(a, b, c2, d) { - var e; - a.j = -1; - Qxd(a, I2d(a, b, c2), (Q6d(), e = BD(b, 66).Mj(), e.Ok(d))); - } - function VWb(a) { - this.g = a; - this.f = new Rkb(); - this.a = $wnd.Math.min(this.g.c.c, this.g.d.c); - } - function mDb(a) { - this.b = new Rkb(); - this.a = new Rkb(); - this.c = new Rkb(); - this.d = new Rkb(); - this.e = a; - } - function Cnc(a, b) { - this.a = new Lqb(); - this.e = new Lqb(); - this.b = (xzc(), wzc); - this.c = a; - this.b = b; - } - function bIb(a, b, c2) { - $Gb.call(this); - THb(this); - this.a = a; - this.c = c2; - this.b = b.d; - this.f = b.e; - } - function yd(a) { - this.d = a; - this.c = a.c.vc().Kc(); - this.b = null; - this.a = null; - this.e = (hs(), gs); - } - function zud(a) { - if (a < 0) { - throw vbb(new Wdb("Illegal Capacity: " + a)); - } - this.g = this.ri(a); - } - function avb(a, b) { - if (0 > a || a > b) { - throw vbb(new scb("fromIndex: 0, toIndex: " + a + oke + b)); - } - } - function Gs(a) { - var b; - if (a.a == a.b.a) { - throw vbb(new utb()); - } - b = a.a; - a.c = b; - a.a = a.a.e; - return b; - } - function Zsb(a) { - var b; - yCb(!!a.c); - b = a.c.a; - Nsb(a.d, a.c); - a.b == a.c ? a.b = b : --a.a; - a.c = null; - } - function VAb(a, b) { - var c2; - Uzb(a); - c2 = new lBb(a, a.a.rd(), a.a.qd() | 4, b); - return new YAb(a, c2); - } - function ke(a, b) { - var c2, d; - c2 = BD(Hv(a.d, b), 14); - if (!c2) { - return null; - } - d = b; - return a.e.pc(d, c2); - } - function xac(a, b) { - var c2, d; - for (d = a.Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 70); - yNb(c2, (wtc(), Ssc), b); - } - } - function t9b(a) { - var b; - b = Edb(ED(vNb(a, (Nyc(), Zwc)))); - if (b < 0) { - b = 0; - yNb(a, Zwc, b); - } - return b; - } - function ifc(a, b, c2) { - var d; - d = $wnd.Math.max(0, a.b / 2 - 0.5); - cfc(c2, d, 1); - Ekb(b, new rfc(c2, d)); - } - function NMc(a, b, c2) { - var d; - d = a.a.e[BD(b.a, 10).p] - a.a.e[BD(c2.a, 10).p]; - return QD(Eeb(d)); - } - function iZb(a, b, c2, d, e, f2) { - var g; - g = kZb(d); - QZb(g, e); - RZb(g, f2); - Rc(a.a, d, new BZb(g, b, c2.f)); - } - function Bid(a, b) { - var c2; - c2 = YKd(a.Tg(), b); - if (!c2) { - throw vbb(new Wdb(ite + b + lte)); - } - return c2; - } - function ntd(a, b) { - var c2; - c2 = a; - while (Xod(c2)) { - c2 = Xod(c2); - if (c2 == b) { - return true; - } - } - return false; - } - function Uw(a, b) { - var c2, d, e; - d = b.a.cd(); - c2 = BD(b.a.dd(), 14).gc(); - for (e = 0; e < c2; e++) { - a.td(d); - } - } - function Hkb(a, b) { - var c2, d, e, f2; - uCb(b); - for (d = a.c, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - b.td(c2); - } - } - function Nsb(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 wqb(a, b) { - if (!!b && a.b[b.g] == b) { - NC(a.b, b.g, null); - --a.c; - return true; - } - return false; - } - function lo(a, b) { - return !!vo(a, b, Tbb(Ibb(Eie, keb(Tbb(Ibb(b == null ? 0 : tb(b), Fie)), 15)))); - } - function w$b(a, b) { - ecd(BD(vNb(BD(a.e, 10), (Nyc(), Vxc)), 98)) && (mmb(), Okb(BD(a.e, 10).j, b)); - } - function THb(a) { - a.b = (NHb(), KHb); - a.f = (EIb(), CIb); - a.d = (Xj(2, Jie), new Skb(2)); - a.e = new d7c(); - } - function gHb() { - gHb = ccb; - dHb = new hHb("BEGIN", 0); - eHb = new hHb(gle, 1); - fHb = new hHb("END", 2); - } - function qad() { - qad = ccb; - nad = new rad(gle, 0); - oad = new rad("HEAD", 1); - pad2 = new rad("TAIL", 2); - } - function Fsd() { - Csd(); - return OC(GC(O3, 1), Kie, 237, 0, [Bsd, ysd, zsd, xsd, Asd, vsd, usd, wsd]); - } - function c6c() { - _5c(); - return OC(GC(f1, 1), Kie, 277, 0, [$5c, T5c, X5c, Z5c, U5c, V5c, W5c, Y5c]); - } - function Dlc() { - Alc(); - return OC(GC(KV, 1), Kie, 270, 0, [tlc, wlc, slc, zlc, vlc, ulc, ylc, xlc]); - } - function nAc() { - kAc(); - return OC(GC(aX, 1), Kie, 260, 0, [iAc, dAc, gAc, eAc, fAc, cAc, hAc, jAc]); - } - function kcd() { - kcd = ccb; - jcd = as((dcd(), OC(GC(D1, 1), Kie, 98, 0, [ccd, bcd, acd, Zbd, _bd, $bd]))); - } - function tHb() { - tHb = ccb; - sHb = (gHb(), OC(GC(pN, 1), Kie, 232, 0, [dHb, eHb, fHb])).length; - rHb = sHb; - } - function wed(a) { - this.b = (Qb(a), new Tkb(a)); - this.a = new Rkb(); - this.d = new Rkb(); - this.e = new d7c(); - } - function W6c(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; - } - function bKd(a) { - var b; - if (a.w) { - return a.w; - } else { - b = cKd(a); - !!b && !b.kh() && (a.w = b); - return b; - } - } - function gZd(a) { - var b; - if (a == null) { - return null; - } else { - b = BD(a, 190); - return Umd(b, b.length); - } - } - function qud(a, b) { - if (a.g == null || b >= a.i) - throw vbb(new $zd(b, a.i)); - return a.li(b, a.g[b]); - } - function Mmc(a) { - var b, c2; - b = a.a.d.j; - c2 = a.c.d.j; - while (b != c2) { - rqb(a.b, b); - b = Xcd(b); - } - rqb(a.b, b); - } - function Jmc(a) { - var b; - for (b = 0; b < a.c.length; b++) { - (tCb(b, a.c.length), BD(a.c[b], 11)).p = b; - } - } - function bEc(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; - } - } - function ZEc(a, b) { - var c2, d, e, f2; - for (d = a.d, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - REc(a.g, c2).a = b; - } - } - function q7c(a, b) { - var c2, d; - for (d = Jsb(a, 0); d.b != d.d.c; ) { - c2 = BD(Xsb(d), 8); - P6c(c2, b); - } - return a; - } - function zUb(a, b) { - var c2; - c2 = c7c(R6c(BD(Ohb(a.g, b), 8)), E6c(BD(Ohb(a.f, b), 460).b)); - return c2; - } - function lib(a) { - var b; - xpb(a.e, a); - sCb(a.b); - a.c = a.a; - b = BD(a.a.Pb(), 42); - a.b = kib(a); - return b; - } - function CD(a) { - var b; - CCb(a == null || Array.isArray(a) && (b = HC(a), !(b >= 14 && b <= 16))); - return a; - } - function dcb(a, b, c2) { - var d = function() { - return a.apply(d, arguments); - }; - b.apply(d, c2); - return d; - } - function TLc(a, b, c2) { - var d, e; - d = b; - do { - e = Edb(a.p[d.p]) + c2; - a.p[d.p] = e; - d = a.a[d.p]; - } while (d != b); - } - function NQd(a, b) { - var c2, d; - d = a.a; - c2 = OQd(a, b, null); - d != b && !a.e && (c2 = QQd(a, b, c2)); - !!c2 && c2.Fi(); - } - function ADb(a, b) { - return Iy(), My(Qie), $wnd.Math.abs(a - b) <= Qie || a == b || isNaN(a) && isNaN(b); - } - function Ky(a, b) { - Iy(); - My(Qie); - return $wnd.Math.abs(a - b) <= Qie || a == b || isNaN(a) && isNaN(b); - } - function Akc(a, b) { - gkc(); - return beb(a.b.c.length - a.e.c.length, b.b.c.length - b.e.c.length); - } - function oo(a, b) { - return Kv(uo(a, b, Tbb(Ibb(Eie, keb(Tbb(Ibb(b == null ? 0 : tb(b), Fie)), 15))))); - } - function o0b() { - o0b = ccb; - n0b = as((j0b(), OC(GC(NQ, 1), Kie, 267, 0, [h0b, g0b, e0b, i0b, f0b, d0b]))); - } - function n8c() { - n8c = ccb; - m8c = as((i8c(), OC(GC(r1, 1), Kie, 291, 0, [h8c, g8c, f8c, d8c, c8c, e8c]))); - } - function K7c() { - K7c = ccb; - J7c = as((F7c(), OC(GC(o1, 1), Kie, 248, 0, [z7c, C7c, D7c, E7c, A7c, B7c]))); - } - function Fpc() { - Fpc = ccb; - Epc = as((Apc(), OC(GC(EW, 1), Kie, 227, 0, [wpc, ypc, vpc, xpc, zpc, upc]))); - } - function Drc() { - Drc = ccb; - Crc = as((yrc(), OC(GC(OW, 1), Kie, 275, 0, [wrc, trc, xrc, vrc, urc, rrc]))); - } - function qrc() { - qrc = ccb; - prc = as((lrc(), OC(GC(NW, 1), Kie, 274, 0, [irc, hrc, krc, grc, jrc, frc]))); - } - function tzc() { - tzc = ccb; - szc = as((lzc(), OC(GC(YW, 1), Kie, 313, 0, [jzc, hzc, fzc, gzc, kzc, izc]))); - } - function Yqc() { - Yqc = ccb; - Xqc = as((Sqc(), OC(GC(LW, 1), Kie, 276, 0, [Nqc, Mqc, Pqc, Oqc, Rqc, Qqc]))); - } - function wSc() { - wSc = ccb; - vSc = as((qSc(), OC(GC(t$, 1), Kie, 327, 0, [pSc, lSc, nSc, mSc, oSc, kSc]))); - } - function ycd() { - ycd = ccb; - xcd = as((rcd(), OC(GC(E1, 1), Kie, 273, 0, [pcd, ncd, ocd, mcd, lcd, qcd]))); - } - function Rad() { - Rad = ccb; - Qad = as((Mad(), OC(GC(w1, 1), Kie, 312, 0, [Kad, Iad, Lad, Gad, Jad, Had]))); - } - function Lbd() { - Hbd(); - return OC(GC(B1, 1), Kie, 93, 0, [zbd, ybd, Bbd, Gbd, Fbd, Ebd, Cbd, Dbd, Abd]); - } - function vkd(a, b) { - var c2; - c2 = a.a; - a.a = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new lSd(a, 0, c2, a.a)); - } - function wkd(a, b) { - var c2; - c2 = a.b; - a.b = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new lSd(a, 1, c2, a.b)); - } - function hmd(a, b) { - var c2; - c2 = a.b; - a.b = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new lSd(a, 3, c2, a.b)); - } - function ald(a, b) { - var c2; - c2 = a.f; - a.f = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new lSd(a, 3, c2, a.f)); - } - function cld(a, b) { - var c2; - c2 = a.g; - a.g = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new lSd(a, 4, c2, a.g)); - } - function dld(a, b) { - var c2; - c2 = a.i; - a.i = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new lSd(a, 5, c2, a.i)); - } - function eld(a, b) { - var c2; - c2 = a.j; - a.j = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new lSd(a, 6, c2, a.j)); - } - function omd(a, b) { - var c2; - c2 = a.j; - a.j = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new lSd(a, 1, c2, a.j)); - } - function imd(a, b) { - var c2; - c2 = a.c; - a.c = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new lSd(a, 4, c2, a.c)); - } - function pmd(a, b) { - var c2; - c2 = a.k; - a.k = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new lSd(a, 2, c2, a.k)); - } - function qQd(a, b) { - var c2; - c2 = a.d; - a.d = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new mSd(a, 2, c2, a.d)); - } - function AId(a, b) { - var c2; - c2 = a.s; - a.s = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new mSd(a, 4, c2, a.s)); - } - function DId(a, b) { - var c2; - c2 = a.t; - a.t = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new mSd(a, 5, c2, a.t)); - } - function _Jd(a, b) { - var c2; - c2 = a.F; - a.F = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 5, c2, b)); - } - function izd(a, b) { - var c2; - c2 = BD(Ohb((pEd(), oEd), a), 55); - return c2 ? c2.xj(b) : KC(SI, Uhe, 1, b, 5, 1); - } - function Xpd(a, b) { - var c2, d; - c2 = b in a.a; - if (c2) { - d = aC(a, b).he(); - if (d) { - return d.a; - } - } - return null; - } - function ftd(a, b) { - var c2, d, e; - c2 = (d = (Fhd(), e = new Jod(), e), !!b && God(d, b), d); - Hod(c2, a); - return c2; - } - function LLd(a, b, c2) { - Itd(a, c2); - if (!a.Bk() && c2 != null && !a.wj(c2)) { - throw vbb(new tcb()); - } - return c2; - } - function Xdd(a, b) { - a.n = b; - if (a.n) { - a.f = new Rkb(); - a.e = new Rkb(); - } else { - a.f = null; - a.e = null; - } - return a; - } - function ndb(a, b, c2, d, e, f2) { - var g; - g = ldb(a, b); - zdb(c2, g); - g.i = e ? 8 : 0; - g.f = d; - g.e = e; - g.g = f2; - return g; - } - function rSd(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 tSd(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 BSd(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 GSd(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 xSd(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 rDb(a, b) { - var c2, d, e, f2; - for (d = b, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - nDb(a.a, c2); - } - return a; - } - function pl(a) { - var b, c2, d, e; - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - Qb(b); - } - return new vl(a); - } - function Uz(a) { - var b = /function(?:\s+([\w$]+))?\s*\(/; - var c2 = b.exec(a); - return c2 && c2[1] || Xie; - } - function zdb(a, b) { - if (!a) { - return; - } - b.n = a; - var d = tdb(b); - if (!d) { - _bb[a] = [b]; - return; - } - d.gm = b; - } - function vlb(a, b, c2) { - var d, e; - e = a.length; - d = $wnd.Math.min(c2, e); - $Bb(a, 0, b, 0, d, true); - return b; - } - function RPb(a, b, c2) { - var d, e; - for (e = b.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 79); - Qqb(a, BD(c2.Kb(d), 33)); - } - } - function Xbb() { - Ybb(); - var a = Wbb; - for (var b = 0; b < arguments.length; b++) { - a.push(arguments[b]); - } - } - function n7c(a, b) { - var c2, d, e, f2; - for (d = b, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - Gsb(a, c2, a.c.b, a.c); - } - } - function s$c(a, b) { - a.b = $wnd.Math.max(a.b, b.d); - a.e += b.r + (a.a.c.length == 0 ? 0 : a.c); - Ekb(a.a, b); - } - function wkb(a) { - yCb(a.c >= 0); - if (ekb(a.d, a.c) < 0) { - a.a = a.a - 1 & a.d.a.length - 1; - a.b = a.d.c; - } - a.c = -1; - } - function pgb(a) { - if (a.a < 54) { - return a.f < 0 ? -1 : a.f > 0 ? 1 : 0; - } - return (!a.c && (a.c = fhb(a.f)), a.c).e; - } - function My(a) { - if (!(a >= 0)) { - throw vbb(new Wdb("tolerance (" + a + ") must be >= 0")); - } - return a; - } - function n4c() { - if (!f4c) { - f4c = new m4c(); - l4c(f4c, OC(GC(C0, 1), Uhe, 130, 0, [new Z9c()])); - } - return f4c; - } - function KAc() { - KAc = ccb; - JAc = new LAc(ole, 0); - HAc = new LAc("INPUT", 1); - IAc = new LAc("OUTPUT", 2); - } - function bqc() { - bqc = ccb; - $pc = new cqc("ARD", 0); - aqc = new cqc("MSD", 1); - _pc = new cqc("MANUAL", 2); - } - function rGc() { - rGc = ccb; - oGc = new sGc("BARYCENTER", 0); - pGc = new sGc(Bne, 1); - qGc = new sGc(Cne, 2); - } - function ztd(a, b) { - var c2; - c2 = a.gc(); - if (b < 0 || b > c2) - throw vbb(new Cyd(b, c2)); - return new czd(a, b); - } - function JAd(a, b) { - var c2; - if (JD(b, 42)) { - return a.c.Mc(b); - } else { - c2 = qAd(a, b); - LAd(a, b); - return c2; - } - } - function $nd(a, b, c2) { - yId(a, b); - pnd(a, c2); - AId(a, 0); - DId(a, 1); - CId(a, true); - BId(a, true); - return a; - } - function Xj(a, b) { - if (a < 0) { - throw vbb(new Wdb(b + " cannot be negative but was: " + a)); - } - return a; - } - function Bt(a, b) { - var c2, d; - for (c2 = 0, d = a.gc(); c2 < d; ++c2) { - if (wtb(b, a.Xb(c2))) { - return c2; - } - } - return -1; - } - function Nc(a) { - var b, c2; - for (c2 = a.c.Cc().Kc(); c2.Ob(); ) { - b = BD(c2.Pb(), 14); - b.$b(); - } - a.c.$b(); - a.d = 0; - } - function Ri(a) { - var b, c2, d, e; - for (c2 = a.a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - Flb(b, b.length, null); - } - } - function ieb(a) { - var b, c2; - if (a == 0) { - return 32; - } else { - c2 = 0; - for (b = 1; (b & a) == 0; b <<= 1) { - ++c2; - } - return c2; - } - } - function NGb(a) { - var b, c2; - for (c2 = new olb(ahd(a)); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 680); - b.Gf(); - } - } - function CUb(a) { - xUb(); - this.g = new Lqb(); - this.f = new Lqb(); - this.b = new Lqb(); - this.c = new Hp(); - this.i = a; - } - function XZb() { - this.f = new d7c(); - this.d = new s0b(); - this.c = new d7c(); - this.a = new Rkb(); - this.b = new Rkb(); - } - function c6d(a, b, c2, d) { - this.rj(); - this.a = b; - this.b = a; - this.c = null; - this.c = new d6d(this, b, c2, d); - } - function nxd(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 hJd() { - FId.call(this); - this.n = -1; - this.g = null; - this.i = null; - this.j = null; - this.Bb |= zte; - } - function Ldd() { - Idd(); - return OC(GC(J1, 1), Kie, 259, 0, [Bdd, Ddd, Add, Edd, Fdd, Hdd, Gdd, Cdd, zdd]); - } - function uFb() { - rFb(); - return OC(GC(dN, 1), Kie, 250, 0, [qFb, lFb, mFb, kFb, oFb, pFb, nFb, jFb, iFb]); - } - function qeb() { - qeb = ccb; - peb = OC(GC(WD, 1), oje, 25, 15, [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]); - } - function vCc() { - vCc = ccb; - uCc = e3c(e3c(e3c(new j3c(), (qUb(), lUb), (S8b(), Z7b)), mUb, w8b), nUb, v8b); - } - function VCc() { - VCc = ccb; - UCc = e3c(e3c(e3c(new j3c(), (qUb(), lUb), (S8b(), Z7b)), mUb, w8b), nUb, v8b); - } - function rDc() { - rDc = ccb; - qDc = e3c(e3c(e3c(new j3c(), (qUb(), lUb), (S8b(), Z7b)), mUb, w8b), nUb, v8b); - } - function yFc() { - yFc = ccb; - xFc = c3c(e3c(e3c(new j3c(), (qUb(), nUb), (S8b(), z8b)), oUb, p8b), pUb, y8b); - } - function Rpc() { - Rpc = ccb; - Ppc = new Tpc("LAYER_SWEEP", 0); - Opc = new Tpc(Tne, 1); - Qpc = new Tpc(ane, 2); - } - function RLc(a, b) { - var c2, d; - c2 = a.c; - d = b.e[a.p]; - if (d > 0) { - return BD(Ikb(c2.a, d - 1), 10); - } - return null; - } - function Lkd(a, b) { - var c2; - c2 = a.k; - a.k = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 2, c2, a.k)); - } - function kmd(a, b) { - var c2; - c2 = a.f; - a.f = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 8, c2, a.f)); - } - function lmd(a, b) { - var c2; - c2 = a.i; - a.i = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 7, c2, a.i)); - } - function Hod(a, b) { - var c2; - c2 = a.a; - a.a = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 8, c2, a.a)); - } - function zpd(a, b) { - var c2; - c2 = a.b; - a.b = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 0, c2, a.b)); - } - function UUd(a, b) { - var c2; - c2 = a.b; - a.b = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 0, c2, a.b)); - } - function VUd(a, b) { - var c2; - c2 = a.c; - a.c = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 1, c2, a.c)); - } - function Apd(a, b) { - var c2; - c2 = a.c; - a.c = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 1, c2, a.c)); - } - function pQd(a, b) { - var c2; - c2 = a.c; - a.c = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 4, c2, a.c)); - } - function PHd(a, b) { - var c2; - c2 = a.d; - a.d = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 1, c2, a.d)); - } - function jKd(a, b) { - var c2; - c2 = a.D; - a.D = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 2, c2, a.D)); - } - function Rdd(a, b) { - if (a.r > 0 && a.c < a.r) { - a.c += b; - !!a.i && a.i.d > 0 && a.g != 0 && Rdd(a.i, b / a.r * a.i.d); - } - } - function dge(a, b, c2) { - var d; - a.b = b; - a.a = c2; - d = (a.a & 512) == 512 ? new hee() : new ude(); - a.c = ode(d, a.b, a.a); - } - function g3d(a, b) { - return T6d(a.e, b) ? (Q6d(), YId(b) ? new R7d(b, a) : new f7d(b, a)) : new c8d(b, a); - } - function _o(a, b) { - return Fv(vo(a.a, b, Tbb(Ibb(Eie, keb(Tbb(Ibb(b == null ? 0 : tb(b), Fie)), 15))))); - } - function Nyb(a, b, c2) { - return Ayb(a, new Kzb(b), new Mzb(), new Ozb(c2), OC(GC(xL, 1), Kie, 132, 0, [])); - } - function pAb(a) { - var b, c2; - if (0 > a) { - return new yAb(); - } - b = a + 1; - c2 = new rAb(b, a); - return new vAb(null, c2); - } - function umb(a, b) { - mmb(); - var c2; - c2 = new Mqb(1); - ND(a) ? Shb(c2, a, b) : jrb(c2.f, a, b); - return new iob(c2); - } - function aMb(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; - } - function P2b(a) { - var b; - b = vNb(a, (wtc(), $sc)); - if (JD(b, 160)) { - return O2b(BD(b, 160)); - } - return null; - } - function Kp(a) { - var b; - a = $wnd.Math.max(a, 2); - b = geb(a); - if (a > b) { - b <<= 1; - return b > 0 ? b : Iie; - } - return b; - } - function xc(a) { - Ub(a.e != 3); - switch (a.e) { - case 2: - return false; - case 0: - return true; - } - return zc(a); - } - function T6c(a, b) { - var c2; - if (JD(b, 8)) { - c2 = BD(b, 8); - return a.a == c2.a && a.b == c2.b; - } else { - return false; - } - } - function _Mb(a, b, c2) { - var d, e, f2; - f2 = b >> 5; - e = b & 31; - d = xbb(Pbb(a.n[c2][f2], Tbb(Nbb(e, 1))), 3); - return d; - } - function IAd(a, b) { - var c2, d; - for (d = b.vc().Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 42); - HAd(a, c2.cd(), c2.dd()); - } - } - function N1c(a, b) { - var c2; - c2 = new tOb(); - BD(b.b, 65); - BD(b.b, 65); - BD(b.b, 65); - Hkb(b.a, new T1c(a, c2, b)); - } - function DUd(a, b) { - var c2; - c2 = a.b; - a.b = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 21, c2, a.b)); - } - function jmd(a, b) { - var c2; - c2 = a.d; - a.d = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 11, c2, a.d)); - } - function _Id(a, b) { - var c2; - c2 = a.j; - a.j = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 13, c2, a.j)); - } - function $jb(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) { - NC(b, d, a.a[e]); - } - } - function rqb(a, b) { - var c2; - uCb(b); - c2 = b.g; - if (!a.b[c2]) { - NC(a.b, c2, b); - ++a.c; - return true; - } - return false; - } - function eub(a, b) { - var c2; - c2 = b == null ? -1 : Jkb(a.b, b, 0); - if (c2 < 0) { - return false; - } - fub(a, c2); - return true; - } - function fub(a, b) { - var c2; - c2 = Kkb(a.b, a.b.c.length - 1); - if (b < a.b.c.length) { - Nkb(a.b, b, c2); - bub(a, b); - } - } - function eyb(a, b) { - ((oyb(), lyb) ? null : b.c).length == 0 && qyb(b, new zyb()); - Shb(a.a, lyb ? null : b.c, b); - } - function M5b(a, b) { - Odd(b, "Hierarchical port constraint processing", 1); - N5b(a); - P5b(a); - Qdd(b); - } - function GOb(a, b) { - var c2, d; - for (d = b.Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 266); - a.b = true; - Qqb(a.e, c2); - c2.b = a; - } - } - function Owb(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 Gec(a, b) { - var c2, d; - c2 = BD(vNb(a, (Nyc(), ayc)), 8); - d = BD(vNb(b, ayc), 8); - return Kdb(c2.b, d.b); - } - function jfc(a) { - oEb.call(this); - this.b = Edb(ED(vNb(a, (Nyc(), lyc)))); - this.a = BD(vNb(a, Swc), 218); - } - function XGc(a, b, c2) { - uEc.call(this, a, b, c2); - this.a = new Lqb(); - this.b = new Lqb(); - this.d = new $Gc(this); - } - function ku(a) { - this.e = a; - this.d = new Uqb(Cv(Ec(this.e).gc())); - this.c = this.e.a; - this.b = this.e.c; - } - function BHc(a) { - this.b = a; - this.a = KC(WD, oje, 25, a + 1, 15, 1); - this.c = KC(WD, oje, 25, a, 15, 1); - this.d = 0; - } - function THc(a, b, c2) { - var d; - d = new Rkb(); - UHc(a, b, d, c2, true, true); - a.b = new BHc(d.c.length); - return d; - } - function nMc(a, b) { - var c2; - c2 = BD(Ohb(a.c, b), 458); - if (!c2) { - c2 = new uMc(); - c2.c = b; - Rhb(a.c, c2.c, c2); - } - return c2; - } - function $B(e, a) { - var b = e.a; - var c2 = 0; - for (var d in b) { - b.hasOwnProperty(d) && (a[c2++] = d); - } - return a; - } - function pRd(a) { - var b; - if (a.b == null) { - return LRd(), LRd(), KRd; - } - b = a.Lk() ? a.Kk() : a.Jk(); - return b; - } - function r$c(a) { - var b, c2; - for (c2 = new Fyd(a); c2.e != c2.i.gc(); ) { - b = BD(Dyd(c2), 33); - dld(b, 0); - eld(b, 0); - } - } - function HSb() { - HSb = ccb; - FSb = new Lsd(Ime); - GSb = new Lsd(Jme); - ESb = new Lsd(Kme); - DSb = new Lsd(Lme); - } - function y5b() { - y5b = ccb; - x5b = new z5b("TO_INTERNAL_LTR", 0); - w5b = new z5b("TO_INPUT_DIRECTION", 1); - } - function PUc() { - PUc = ccb; - NUc = new RUc("P1_NODE_PLACEMENT", 0); - OUc = new RUc("P2_EDGE_ROUTING", 1); - } - function Fkc() { - Fkc = ccb; - Ekc = new Gkc("START", 0); - Dkc = new Gkc("MIDDLE", 1); - Ckc = new Gkc("END", 2); - } - function I9b() { - I9b = ccb; - H9b = new Msd("edgelabelcenterednessanalysis.includelabel", (Bcb(), zcb)); - } - function Zyc(a, b) { - MAb(JAb(new YAb(null, new Kub(new Pib(a.b), 1)), new bfd(a, b)), new ffd(a, b)); - } - function $Xc() { - this.c = new jVc(0); - this.b = new jVc(Tqe); - this.d = new jVc(Sqe); - this.a = new jVc(cme); - } - function $Fc(a) { - var b, c2; - for (c2 = a.c.a.ec().Kc(); c2.Ob(); ) { - b = BD(c2.Pb(), 214); - eFc(b, new oHc(b.e)); - } - } - function ZFc(a) { - var b, c2; - for (c2 = a.c.a.ec().Kc(); c2.Ob(); ) { - b = BD(c2.Pb(), 214); - dFc(b, new nHc(b.f)); - } - } - function pnd(a, b) { - var c2; - c2 = a.zb; - a.zb = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 1, c2, a.zb)); - } - function cod(a, b) { - var c2; - c2 = a.xb; - a.xb = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 3, c2, a.xb)); - } - function dod(a, b) { - var c2; - c2 = a.yb; - a.yb = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 2, c2, a.yb)); - } - function Knd(a, b) { - var c2, d; - c2 = (d = new OJd(), d); - c2.n = b; - wtd((!a.s && (a.s = new cUd(t5, a, 21, 17)), a.s), c2); - } - function Qnd(a, b) { - var c2, d; - d = (c2 = new FUd(), c2); - d.n = b; - wtd((!a.s && (a.s = new cUd(t5, a, 21, 17)), a.s), d); - } - function ktb(a, b) { - var c2, d; - c2 = a.Pc(); - Klb(c2, 0, c2.length, b); - for (d = 0; d < c2.length; d++) { - a._c(d, c2[d]); - } - } - function ye(a, b) { - var c2, d, e; - uCb(b); - c2 = false; - for (e = b.Kc(); e.Ob(); ) { - d = e.Pb(); - c2 = c2 | a.Fc(d); - } - return c2; - } - function Bx(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 SA(a) { - var b; - if (a == 0) { - return "UTC"; - } - if (a < 0) { - a = -a; - b = "UTC+"; - } else { - b = "UTC-"; - } - return b + UA(a); - } - function Jq(a, b) { - var c2; - if (JD(b, 14)) { - c2 = BD(b, 14); - return a.Gc(c2); - } - return fr(a, BD(Qb(b), 20).Kc()); - } - function Bnc(a, b, c2) { - Cnc.call(this, b, c2); - this.d = KC(OQ, kne, 10, a.a.c.length, 0, 1); - Qkb(a.a, this.d); - } - function IMc(a) { - a.a = null; - a.e = null; - a.b.c = KC(SI, Uhe, 1, 0, 5, 1); - a.f.c = KC(SI, Uhe, 1, 0, 5, 1); - a.c = null; - } - function gKd(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; - } - } - function Poc(a, b) { - return Edb(ED(Btb(TAb(NAb(new YAb(null, new Kub(a.c.b, 16)), new fpc(a)), b)))); - } - function Soc(a, b) { - return Edb(ED(Btb(TAb(NAb(new YAb(null, new Kub(a.c.b, 16)), new dpc(a)), b)))); - } - function Q2b(a, b) { - Odd(b, zne, 1); - MAb(LAb(new YAb(null, new Kub(a.b, 16)), new U2b()), new W2b()); - Qdd(b); - } - function SXc(a, b) { - var c2, d; - c2 = BD(hkd(a, (ZWc(), SWc)), 19); - d = BD(hkd(b, SWc), 19); - return beb(c2.a, d.a); - } - function p7c(a, b, c2) { - var d, e; - for (e = Jsb(a, 0); e.b != e.d.c; ) { - d = BD(Xsb(e), 8); - d.a += b; - d.b += c2; - } - return a; - } - function uo(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; - } - function vo(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; - } - function khb(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 rmb(a, b) { - mmb(); - var c2, d; - d = new Rkb(); - for (c2 = 0; c2 < a; ++c2) { - d.c[d.c.length] = b; - } - return new Yob(d); - } - function Zzb(a) { - var b; - b = Yzb(a); - if (Bbb(b.a, 0)) { - return Ltb(), Ltb(), Ktb; - } - return Ltb(), new Ptb(b.b); - } - function $zb(a) { - var b; - b = Yzb(a); - if (Bbb(b.a, 0)) { - return Ltb(), Ltb(), Ktb; - } - return Ltb(), new Ptb(b.c); - } - function uAb(a) { - var b; - b = tAb(a); - if (Bbb(b.a, 0)) { - return Utb(), Utb(), Ttb; - } - return Utb(), new Xtb(b.b); - } - function zZb(a) { - if (a.b.c.i.k == (j0b(), e0b)) { - return BD(vNb(a.b.c.i, (wtc(), $sc)), 11); - } - return a.b.c; - } - function AZb(a) { - if (a.b.d.i.k == (j0b(), e0b)) { - return BD(vNb(a.b.d.i, (wtc(), $sc)), 11); - } - return a.b.d; - } - function Vnd(a, b, c2, d, e, f2, g, h, i3, j, k, l, m) { - aod(a, b, c2, d, e, f2, g, h, i3, j, k, l, m); - MJd(a, false); - return a; - } - function tJb(a, b, c2, d, e, f2, g) { - $r.call(this, a, b); - this.d = c2; - this.e = d; - this.c = e; - this.b = f2; - this.a = Ou(g); - } - function $bb(a, b) { - typeof window === Jhe && typeof window["$gwt"] === Jhe && (window["$gwt"][a] = b); - } - function pWb(a, b) { - lWb(); - return a == hWb && b == kWb || a == kWb && b == hWb || a == jWb && b == iWb || a == iWb && b == jWb; - } - function qWb(a, b) { - lWb(); - return a == hWb && b == iWb || a == hWb && b == jWb || a == kWb && b == jWb || a == kWb && b == iWb; - } - function IJb(a, b) { - return Iy(), My(ple), $wnd.Math.abs(0 - b) <= ple || 0 == b || isNaN(0) && isNaN(b) ? 0 : a / b; - } - function Rrc() { - Orc(); - return OC(GC(PW, 1), Kie, 256, 0, [Frc, Hrc, Irc, Jrc, Krc, Lrc, Nrc, Erc, Grc, Mrc]); - } - function NKd() { - NKd = ccb; - KKd = new KPd(); - MKd = OC(GC(t5, 1), Mve, 170, 0, []); - LKd = OC(GC(n5, 1), Nve, 59, 0, []); - } - function CBc() { - CBc = ccb; - BBc = new DBc("NO", 0); - zBc = new DBc("GREEDY", 1); - ABc = new DBc("LOOK_BACK", 2); - } - function z0b() { - z0b = ccb; - w0b = new m1b(); - u0b = new h1b(); - v0b = new q1b(); - t0b = new u1b(); - x0b = new y1b(); - y0b = new C1b(); - } - function J9b(a) { - var b, c2, d; - d = 0; - for (c2 = new olb(a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 29); - b.p = d; - ++d; - } - } - function nfd(a, b) { - var c2; - c2 = sfd(a); - return mfd(new f7c(c2.c, c2.d), new f7c(c2.b, c2.a), a.rf(), b, a.Hf()); - } - function Udd(a, b) { - var c2; - if (a.b) { - return null; - } else { - c2 = Pdd(a, a.g); - Dsb(a.a, c2); - c2.i = a; - a.d = b; - return c2; - } - } - function kUc(a, b, c2) { - Odd(c2, "DFS Treeifying phase", 1); - jUc(a, b); - hUc(a, b); - a.a = null; - a.b = null; - Qdd(c2); - } - function zic(a, b, c2) { - this.g = a; - this.d = b; - this.e = c2; - this.a = new Rkb(); - xic(this); - mmb(); - Okb(this.a, null); - } - function Aud(a) { - this.i = a.gc(); - if (this.i > 0) { - this.g = this.ri(this.i + (this.i / 8 | 0) + 1); - a.Qc(this.g); - } - } - function u3d(a, b) { - k2d.call(this, D9, a, b); - this.b = this; - this.a = S6d(a.Tg(), XKd(this.e.Tg(), this.c)); - } - function Ld(a, b) { - var c2, d; - uCb(b); - for (d = b.vc().Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 42); - a.zc(c2.cd(), c2.dd()); - } - } - function G2d(a, b, c2) { - var d; - for (d = c2.Kc(); d.Ob(); ) { - if (!E2d(a, b, d.Pb())) { - return false; - } - } - return true; - } - function sVd(a, b, c2, d, e) { - var f2; - if (c2) { - f2 = bLd(b.Tg(), a.c); - e = c2.gh(b, -1 - (f2 == -1 ? d : f2), null, e); - } - return e; - } - function tVd(a, b, c2, d, e) { - var f2; - if (c2) { - f2 = bLd(b.Tg(), a.c); - e = c2.ih(b, -1 - (f2 == -1 ? d : f2), null, e); - } - return e; - } - function Mgb(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 Z4b(a) { - switch (a.g) { - case 2: - return Ucd(), Tcd; - case 4: - return Ucd(), zcd; - default: - return a; - } - } - function $4b(a) { - switch (a.g) { - case 1: - return Ucd(), Rcd; - case 3: - return Ucd(), Acd; - default: - return a; - } - } - function nkc(a) { - var b, c2, d; - return a.j == (Ucd(), Acd) && (b = pkc(a), c2 = uqb(b, zcd), d = uqb(b, Tcd), d || d && c2); - } - function oqb(a) { - var b, c2; - b = BD(a.e && a.e(), 9); - c2 = BD(ZBb(b, b.length), 9); - return new xqb(b, c2, b.length); - } - function l7b(a, b) { - Odd(b, zne, 1); - UGb(TGb(new YGb((a$b(), new l$b(a, false, false, new T$b()))))); - Qdd(b); - } - function Fcb(a, b) { - Bcb(); - return ND(a) ? cfb(a, GD(b)) : LD(a) ? Ddb(a, ED(b)) : KD(a) ? Dcb(a, DD(b)) : a.wd(b); - } - function WZc(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); - Ekb(a.a, b); - } - function m6c(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 Ynd(a, b, c2, d) { - JD(a.Cb, 179) && (BD(a.Cb, 179).tb = null); - pnd(a, c2); - !!b && hKd(a, b); - d && a.xk(true); - } - function Yqd(a, b) { - var c2; - c2 = BD(b, 183); - Spd(c2, "x", a.i); - Spd(c2, "y", a.j); - Spd(c2, Gte, a.g); - Spd(c2, Fte, a.f); - } - function LFc() { - LFc = ccb; - KFc = b3c(f3c(e3c(e3c(new j3c(), (qUb(), nUb), (S8b(), z8b)), oUb, p8b), pUb), y8b); - } - function dHc() { - dHc = ccb; - cHc = b3c(f3c(e3c(e3c(new j3c(), (qUb(), nUb), (S8b(), z8b)), oUb, p8b), pUb), y8b); - } - function sXc() { - sXc = ccb; - qXc = new uXc(ane, 0); - rXc = new uXc("POLAR_COORDINATE", 1); - pXc = new uXc("ID", 2); - } - function TAc() { - TAc = ccb; - QAc = new UAc("EQUALLY", 0); - RAc = new UAc(xle, 1); - SAc = new UAc("NORTH_SOUTH", 2); - } - function pAc() { - pAc = ccb; - oAc = as((kAc(), OC(GC(aX, 1), Kie, 260, 0, [iAc, dAc, gAc, eAc, fAc, cAc, hAc, jAc]))); - } - function Flc() { - Flc = ccb; - Elc = as((Alc(), OC(GC(KV, 1), Kie, 270, 0, [tlc, wlc, slc, zlc, vlc, ulc, ylc, xlc]))); - } - function e6c() { - e6c = ccb; - d6c = as((_5c(), OC(GC(f1, 1), Kie, 277, 0, [$5c, T5c, X5c, Z5c, U5c, V5c, W5c, Y5c]))); - } - function Hsd() { - Hsd = ccb; - Gsd = as((Csd(), OC(GC(O3, 1), Kie, 237, 0, [Bsd, ysd, zsd, xsd, Asd, vsd, usd, wsd]))); - } - function XNb() { - XNb = ccb; - VNb = new Msd("debugSVG", (Bcb(), false)); - WNb = new Msd("overlapsExisted", true); - } - function Xyb(a, b) { - return Ayb(new tzb(a), new vzb(b), new xzb(b), new zzb(), OC(GC(xL, 1), Kie, 132, 0, [])); - } - function hyb() { - var a; - if (!dyb) { - dyb = new gyb(); - a = new wyb(""); - uyb(a, ($xb(), Zxb)); - eyb(dyb, a); - } - return dyb; - } - function hr(a, b) { - var c2; - Qb(b); - while (a.Ob()) { - c2 = a.Pb(); - if (!QNc(BD(c2, 10))) { - return false; - } - } - return true; - } - function T3c(a, b) { - var c2; - c2 = h4c(n4c(), a); - if (c2) { - jkd(b, (Y9c(), F9c), c2); - return true; - } else { - return false; - } - } - function d3c(a, b) { - var c2; - for (c2 = 0; c2 < b.j.c.length; c2++) { - BD(B2c(a, c2), 21).Gc(BD(B2c(b, c2), 14)); - } - return a; - } - function M9b(a, b) { - var c2, d; - for (d = new olb(b.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 29); - a.a[c2.p] = _$b(c2); - } - } - function stb(a, b) { - var c2, d; - uCb(b); - for (d = a.vc().Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 42); - b.Od(c2.cd(), c2.dd()); - } - } - function cId(a, b) { - var c2; - if (JD(b, 83)) { - BD(a.c, 76).Xj(); - c2 = BD(b, 83); - IAd(a, c2); - } else { - BD(a.c, 76).Wb(b); - } - } - function Su(a) { - return JD(a, 152) ? km(BD(a, 152)) : JD(a, 131) ? BD(a, 131).a : JD(a, 54) ? new ov(a) : new dv(a); - } - function fac(a, b) { - return b < a.b.gc() ? BD(a.b.Xb(b), 10) : b == a.b.gc() ? a.a : BD(Ikb(a.e, b - a.b.gc() - 1), 10); - } - function crb(a, b) { - a.a = wbb(a.a, 1); - a.c = $wnd.Math.min(a.c, b); - a.b = $wnd.Math.max(a.b, b); - a.d = wbb(a.d, b); - } - function n3b(a, b) { - var c2; - Odd(b, "Edge and layer constraint edge reversal", 1); - c2 = m3b(a); - l3b(c2); - Qdd(b); - } - function tAd(a) { - var b; - if (a.d == null) { - ++a.e; - a.f = 0; - sAd(null); - } else { - ++a.e; - b = a.d; - a.d = null; - a.f = 0; - sAd(b); - } - } - function zbb(a) { - var b; - b = a.h; - if (b == 0) { - return a.l + a.m * Hje; - } - if (b == Fje) { - return a.l + a.m * Hje - Ije; - } - return a; - } - function aKb(a) { - $Jb(); - if (a.A.Hc((tdd(), pdd))) { - if (!a.B.Hc((Idd(), Ddd))) { - return _Jb(a); - } - } - return null; - } - function Zgb(a) { - uCb(a); - if (a.length == 0) { - throw vbb(new Oeb("Zero length BigInteger")); - } - dhb(this, a); - } - function Vb(a) { - if (!a) { - throw vbb(new Zdb("no calls to next() since the last call to remove()")); - } - } - function Cbb(a) { - if (Kje < a && a < Ije) { - return a < 0 ? $wnd.Math.ceil(a) : $wnd.Math.floor(a); - } - return zbb(fD(a)); - } - function Yyb(a, b) { - var c2, d, e; - c2 = a.c.Ee(); - for (e = b.Kc(); e.Ob(); ) { - d = e.Pb(); - a.a.Od(c2, d); - } - return a.b.Kb(c2); - } - function Uhd(a, b) { - var c2, d, e; - c2 = a.Jg(); - if (c2 != null && a.Mg()) { - for (d = 0, e = c2.length; d < e; ++d) { - c2[d].ui(b); - } - } - } - function f_b(a, b) { - var c2, d; - c2 = a; - d = Q_b(c2).e; - while (d) { - c2 = d; - if (c2 == b) { - return true; - } - d = Q_b(c2).e; - } - return false; - } - function lDc(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; - } - function Si(a, b, c2) { - var d, e; - e = BD(tn(a.d, b), 19); - d = BD(tn(a.b, c2), 19); - return !e || !d ? null : Mi(a, e.a, d.a); - } - function cYc(a, b) { - var c2, d; - for (d = new Fyd(a); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 33); - bld(c2, c2.i + b.b, c2.j + b.d); - } - } - function qjc(a, b) { - var c2, d; - for (d = new olb(b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 70); - Ekb(a.d, c2); - ujc(a, c2); - } - } - function pQc(a, b) { - var c2, d; - d = new Rkb(); - c2 = b; - do { - d.c[d.c.length] = c2; - c2 = BD(Ohb(a.k, c2), 17); - } while (c2); - return d; - } - function Ajd(a, b) { - var c2; - if ((a.Db & b) != 0) { - c2 = zjd(a, b); - return c2 == -1 ? a.Eb : CD(a.Eb)[c2]; - } else { - return null; - } - } - function Lnd(a, b) { - var c2, d; - c2 = (d = new hLd(), d); - c2.G = b; - !a.rb && (a.rb = new jUd(a, d5, a)); - wtd(a.rb, c2); - return c2; - } - function Mnd(a, b) { - var c2, d; - c2 = (d = new MPd(), d); - c2.G = b; - !a.rb && (a.rb = new jUd(a, d5, a)); - wtd(a.rb, c2); - return c2; - } - function Hkd(a, b) { - switch (b) { - case 1: - return !!a.n && a.n.i != 0; - case 2: - return a.k != null; - } - return dkd(a, b); - } - function gNc(a) { - switch (a.a.g) { - case 1: - return new NNc(); - case 3: - return new vQc(); - default: - return new wNc(); - } - } - function MRd(a) { - var b; - if (a.g > 1 || a.Ob()) { - ++a.a; - a.g = 0; - b = a.i; - a.Ob(); - return b; - } else { - throw vbb(new utb()); - } - } - function kNc(a) { - fNc(); - var b; - if (!Lpb(eNc, a)) { - b = new hNc(); - b.a = a; - Opb(eNc, a, b); - } - return BD(Mpb(eNc, a), 635); - } - function Rbb(a) { - var b, c2, d, e; - e = a; - d = 0; - if (e < 0) { - e += Ije; - d = Fje; - } - c2 = QD(e / Hje); - b = QD(e - c2 * Hje); - return TC(b, c2, d); - } - function Ox(a) { - var b, c2, d; - d = 0; - for (c2 = new Gqb(a.a); c2.a < c2.c.a.length; ) { - b = Fqb(c2); - a.b.Hc(b) && ++d; - } - return d; - } - function Ku(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 Zwb(a, b) { - var c2; - this.c = a; - c2 = new Rkb(); - Ewb(a, c2, b, a.b, null, false, null, false); - this.a = new Bib(c2, 0); - } - function p4d(a, b) { - this.b = a; - this.e = b; - this.d = b.j; - this.f = (Q6d(), BD(a, 66).Oj()); - this.k = S6d(b.e.Tg(), a); - } - function xwb(a, b, c2) { - this.b = (uCb(a), a); - this.d = (uCb(b), b); - this.e = (uCb(c2), c2); - this.c = this.d + ("" + this.e); - } - function xRb() { - this.a = BD(Ksd((wSb(), eSb)), 19).a; - this.c = Edb(ED(Ksd(uSb))); - this.b = Edb(ED(Ksd(qSb))); - } - function Nbd() { - Nbd = ccb; - Mbd = as((Hbd(), OC(GC(B1, 1), Kie, 93, 0, [zbd, ybd, Bbd, Gbd, Fbd, Ebd, Cbd, Dbd, Abd]))); - } - function wFb() { - wFb = ccb; - vFb = as((rFb(), OC(GC(dN, 1), Kie, 250, 0, [qFb, lFb, mFb, kFb, oFb, pFb, nFb, jFb, iFb]))); - } - function vLb() { - vLb = ccb; - uLb = new wLb("UP", 0); - rLb = new wLb(vle, 1); - sLb = new wLb(jle, 2); - tLb = new wLb(kle, 3); - } - function rTc() { - rTc = ccb; - qTc = (STc(), QTc); - pTc = new Nsd(Zqe, qTc); - oTc = ($Tc(), ZTc); - nTc = new Nsd($qe, oTc); - } - function Xrc() { - Xrc = ccb; - Vrc = new Yrc("ONE_SIDED", 0); - Wrc = new Yrc("TWO_SIDED", 1); - Urc = new Yrc("OFF", 2); - } - function TQc(a) { - a.r = new Tqb(); - a.w = new Tqb(); - a.t = new Rkb(); - a.i = new Rkb(); - a.d = new Tqb(); - a.a = new I6c(); - a.c = new Lqb(); - } - function uOc(a) { - this.n = new Rkb(); - this.e = new Psb(); - this.j = new Psb(); - this.k = new Rkb(); - this.f = new Rkb(); - this.p = a; - } - function PEc(a, b) { - if (a.c) { - QEc(a, b, true); - MAb(new YAb(null, new Kub(b, 16)), new bFc(a)); - } - QEc(a, b, false); - } - function wFc(a, b, c2) { - return a == (rGc(), qGc) ? new pFc() : Cub(b, 1) != 0 ? new iHc(c2.length) : new RGc(c2.length); - } - function tNb(a, b) { - var c2; - if (!b) { - return a; - } - c2 = b.Ve(); - c2.dc() || (!a.q ? a.q = new Nqb(c2) : Ld(a.q, c2)); - return a; - } - function Erb(a, b) { - var c2; - c2 = a.a.get(b); - if (c2 === void 0) { - ++a.d; - } else { - urb(a.a, b); - --a.c; - zpb(a.b); - } - return c2; - } - function UYb(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 Kdb(d, e); - } - return c2; - } - function XLb(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; - } - function KZb(a) { - if (a.b.c.length != 0 && !!BD(Ikb(a.b, 0), 70).a) { - return BD(Ikb(a.b, 0), 70).a; - } - return JZb(a); - } - function Pq(a) { - var b; - if (a) { - b = a; - if (b.dc()) { - throw vbb(new utb()); - } - return b.Xb(b.gc() - 1); - } - return nr(a.Kc()); - } - function vgb(a) { - var b; - ybb(a, 0) < 0 && (a = Lbb(a)); - return b = Tbb(Obb(a, 32)), 64 - (b != 0 ? heb(b) : heb(Tbb(a)) + 32); - } - function QNc(a) { - var b; - b = BD(vNb(a, (wtc(), Hsc)), 61); - return a.k == (j0b(), e0b) && (b == (Ucd(), Tcd) || b == zcd); - } - function bZb(a, b, c2) { - var d, e; - e = BD(vNb(a, (Nyc(), jxc)), 74); - if (e) { - d = new s7c(); - o7c(d, 0, e); - q7c(d, c2); - ye(b, d); - } - } - function M_b(a, b, c2) { - var d, e, f2, g; - g = Q_b(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 dcc(a, b) { - var c2, d; - c2 = a.j; - d = b.j; - return c2 != d ? c2.g - d.g : a.p == b.p ? 0 : c2 == (Ucd(), Acd) ? a.p - b.p : b.p - a.p; - } - function dmc(a) { - var b, c2; - bmc(a); - for (c2 = new olb(a.d); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 101); - !!b.i && cmc(b); - } - } - function lBc(a, b, c2, d, e) { - NC(a.c[b.g], c2.g, d); - NC(a.c[c2.g], b.g, d); - NC(a.b[b.g], c2.g, e); - NC(a.b[c2.g], b.g, e); - } - function G1c(a, b, c2, d) { - BD(c2.b, 65); - BD(c2.b, 65); - BD(d.b, 65); - BD(d.b, 65); - BD(d.b, 65); - Hkb(d.a, new L1c(a, b, d)); - } - function WDb(a, b) { - a.d == (ead(), aad) || a.d == dad ? BD(b.a, 57).c.Fc(BD(b.b, 57)) : BD(b.b, 57).c.Fc(BD(b.a, 57)); - } - function Gkd(a, b, c2, d) { - if (c2 == 1) { - return !a.n && (a.n = new cUd(D2, a, 1, 7)), Txd(a.n, b, d); - } - return ckd(a, b, c2, d); - } - function Gnd(a, b) { - var c2, d; - d = (c2 = new BYd(), c2); - pnd(d, b); - wtd((!a.A && (a.A = new K4d(u5, a, 7)), a.A), d); - return d; - } - function Zqd(a, b, c2) { - var d, e, f2, g; - f2 = null; - g = b; - e = Ypd(g, Jte); - d = new jrd(a, c2); - f2 = (lqd(d.a, d.b, e), e); - return f2; - } - function KJd(a) { - var b; - if (!a.a || (a.Bb & 1) == 0 && a.a.kh()) { - b = wId(a); - JD(b, 148) && (a.a = BD(b, 148)); - } - return a.a; - } - function Be(a, b) { - var c2, d; - uCb(b); - for (d = b.Kc(); d.Ob(); ) { - c2 = d.Pb(); - if (!a.Hc(c2)) { - return false; - } - } - return true; - } - function cD(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 TC(c2 & Eje, d & Eje, e & Fje); - } - function nD(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 TC(c2 & Eje, d & Eje, e & Fje); - } - function bdb(a) { - var b; - if (a < 128) { - b = (ddb(), cdb)[a]; - !b && (b = cdb[a] = new Xcb(a)); - return b; - } - return new Xcb(a); - } - function ubb(a) { - var b; - if (JD(a, 78)) { - return a; - } - b = a && a.__java$exception; - if (!b) { - b = new lz(a); - Sz(b); - } - return b; - } - function btd(a) { - if (JD(a, 186)) { - return BD(a, 118); - } else if (!a) { - throw vbb(new Heb(gue)); + 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 null; - } - } - function Zjb(a, b) { - if (b == null) { - return false; - } - while (a.a != a.b) { - if (pb(b, vkb(a))) { - return true; - } - } - return false; - } - function kib(a) { - if (a.a.Ob()) { - return true; - } - if (a.a != a.d) { - return false; - } - a.a = new orb(a.e.f); - return a.a.Ob(); - } - function Gkb(a, b) { - var c2, d; - c2 = b.Pc(); - d = c2.length; - if (d == 0) { - return false; - } - bCb(a.c, a.c.length, c2); - return true; - } - function Vyb(a, b, c2) { - var d, e; - for (e = b.vc().Kc(); e.Ob(); ) { - d = BD(e.Pb(), 42); - a.yc(d.cd(), d.dd(), c2); - } - return a; - } - function yac(a, b) { - var c2, d; - for (d = new olb(a.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 70); - yNb(c2, (wtc(), Ssc), b); - } - } - function FZc(a, b, c2) { - var d, e; - for (e = new olb(a.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 33); - bld(d, d.i + b, d.j + c2); - } - } - function Nb(a, b) { - if (!a) { - throw vbb(new Wdb(hc("value already present: %s", OC(GC(SI, 1), Uhe, 1, 5, [b])))); - } - } - function mEb(a, b) { - if (!a || !b || a == b) { - return false; - } - return CDb(a.d.c, b.d.c + b.d.b) && CDb(b.d.c, a.d.c + a.d.b); - } - function xyb() { - oyb(); - if (lyb) { - return new wyb(null); - } - return fyb(hyb(), "com.google.common.base.Strings"); - } - function J2c(a, b) { - var c2; - c2 = Pu(b.a.gc()); - MAb(VAb(new YAb(null, new Kub(b, 1)), a.i), new W2c(a, c2)); - return c2; - } - function Hnd(a) { - var b, c2; - c2 = (b = new BYd(), b); - pnd(c2, "T"); - wtd((!a.d && (a.d = new K4d(u5, a, 11)), a.d), c2); - return c2; - } - function Etd(a) { - var b, c2, d, e; - b = 1; - for (c2 = 0, e = a.gc(); c2 < e; ++c2) { - d = a.ki(c2); - b = 31 * b + (d == null ? 0 : tb(d)); - } - return b; - } - function Wi(a, b, c2, d) { - var e; - Pb(b, a.e.Hd().gc()); - Pb(c2, a.c.Hd().gc()); - e = a.a[b][c2]; - NC(a.a[b], c2, d); - return e; - } - function OC(a, b, c2, d, e) { - e.gm = a; - e.hm = b; - e.im = gcb; - e.__elementTypeId$ = c2; - e.__elementTypeCategory$ = d; - return e; - } - function p6c(a, b, c2, d, e) { - i6c(); - return $wnd.Math.min(A6c(a, b, c2, d, e), A6c(c2, d, a, b, V6c(new f7c(e.a, e.b)))); - } - function gbc() { - gbc = ccb; - fbc = new ibc(ane, 0); - dbc = new ibc(Gne, 1); - ebc = new ibc(Hne, 2); - cbc = new ibc("BOTH", 3); - } - function Ajc() { - Ajc = ccb; - wjc = new Bjc(gle, 0); - xjc = new Bjc(jle, 1); - yjc = new Bjc(kle, 2); - zjc = new Bjc("TOP", 3); - } - function lWb() { - lWb = ccb; - hWb = new oWb("Q1", 0); - kWb = new oWb("Q4", 1); - iWb = new oWb("Q2", 2); - jWb = new oWb("Q3", 3); - } - function LBc() { - LBc = ccb; - JBc = new MBc("OFF", 0); - KBc = new MBc("SINGLE_EDGE", 1); - IBc = new MBc("MULTI_EDGE", 2); - } - function a1c() { - a1c = ccb; - _0c = new c1c("MINIMUM_SPANNING_TREE", 0); - $0c = new c1c("MAXIMUM_SPANNING_TREE", 1); - } - function Y1c() { - Y1c = ccb; - W1c = new k2c(); - V1c = new f2c(); - } - function URc(a) { - var b, c2, d; - b = new Psb(); - for (d = Jsb(a.d, 0); d.b != d.d.c; ) { - c2 = BD(Xsb(d), 188); - Dsb(b, c2.c); - } - return b; - } - function dVc(a) { - var b, c2, d, e; - e = new Rkb(); - for (d = a.Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 33); - b = gVc(c2); - Gkb(e, b); - } - return e; - } - function xcc(a) { - var b; - PZb(a, true); - b = _ie; - wNb(a, (Nyc(), cyc)) && (b += BD(vNb(a, cyc), 19).a); - yNb(a, cyc, meb(b)); - } - function q1c(a, b, c2) { - var d; - Uhb(a.a); - Hkb(c2.i, new B1c(a)); - d = new hDb(BD(Ohb(a.a, b.b), 65)); - p1c(a, d, b); - c2.f = d; - } - function QLc(a, b) { - var c2, d; - c2 = a.c; - d = b.e[a.p]; - if (d < c2.a.c.length - 1) { - return BD(Ikb(c2.a, d + 1), 10); - } - return null; - } - function rr(a, b) { - var c2, d; - Rb(b, "predicate"); - for (d = 0; a.Ob(); d++) { - c2 = a.Pb(); - if (b.Lb(c2)) { - return d; - } - } - return -1; - } - function ZEd(a, b) { - var c2, d; - d = 0; - if (a < 64 && a <= b) { - b = b < 64 ? b : 63; - for (c2 = a; c2 <= b; c2++) { - d = Mbb(d, Nbb(1, c2)); - } - } - return d; - } - function pmb(a) { - mmb(); - 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 etd(a) { - var b, c2; - c2 = (Fhd(), b = new rmd(), b); - !!a && wtd((!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a), c2); - return c2; - } - function TA(a) { - var b; - b = new PA(); - b.a = a; - b.b = RA(a); - b.c = KC(ZI, nie, 2, 2, 6, 1); - b.c[0] = SA(a); - b.c[1] = SA(a); - return b; - } - function fkd(a, b) { - switch (b) { + 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: - !a.o && (a.o = new dId((Thd(), Qhd), S2, a, 0)); - a.o.c.$b(); - return; - } - Cid(a, b); - } - function jEb(a, b, c2) { - switch (c2.g) { - case 2: - a.b = b; + return 5; break; case 1: - a.c = b; - break; - case 4: - a.d = b; break; - case 3: - a.a = b; - } - } - function sbd(a) { - switch (a.g) { - case 1: - return obd; case 2: - return nbd; + break; case 3: - return pbd; - default: - return qbd; - } - } - function Zac(a) { - switch (BD(vNb(a, (Nyc(), mxc)), 163).g) { - case 2: + break; case 4: - return true; - default: - return false; - } - } - function Trc() { - Trc = ccb; - Src = as((Orc(), OC(GC(PW, 1), Kie, 256, 0, [Frc, Hrc, Irc, Jrc, Krc, Lrc, Nrc, Erc, Grc, Mrc]))); - } - function Ndd() { - Ndd = ccb; - Mdd = as((Idd(), OC(GC(J1, 1), Kie, 259, 0, [Bdd, Ddd, Add, Edd, Fdd, Hdd, Gdd, Cdd, zdd]))); - } - function wUc() { - wUc = ccb; - vUc = e3c(b3c(b3c(g3c(e3c(new j3c(), (yRc(), vRc), (qSc(), pSc)), wRc), mSc), nSc), xRc, oSc); - } - function Gqc() { - Gqc = ccb; - Eqc = new Hqc(ane, 0); - Dqc = new Hqc("INCOMING_ONLY", 1); - Fqc = new Hqc("OUTGOING_ONLY", 2); - } - function rC() { - rC = ccb; - qC = { "boolean": sC, "number": tC, "string": vC, "object": uC, "function": uC, "undefined": wC }; - } - function Whb(a, b) { - mCb(a >= 0, "Negative initial capacity"); - mCb(b >= 0, "Non-positive load factor"); - Uhb(this); - } - function _Ed(a, b, c2) { - if (a >= 128) - return false; - return a < 64 ? Kbb(xbb(Nbb(1, a), c2), 0) : Kbb(xbb(Nbb(1, a - 64), b), 0); - } - function bOb(a, b) { - if (!a || !b || a == b) { - return false; - } - return Jy(a.b.c, b.b.c + b.b.b) < 0 && Jy(b.b.c, a.b.c + a.b.b) < 0; - } - function I4b(a) { - var b, c2, d; - c2 = a.n; - d = a.o; - b = a.d; - return new J6c(c2.a - b.b, c2.b - b.d, d.a + (b.b + b.c), d.b + (b.d + b.a)); - } - function $ic(a) { - var b, c2, d, e; - for (c2 = a.a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - djc(a, b, (Ucd(), Rcd)); - djc(a, b, Acd); - } - } - function Uy(a) { - var b, c2, d, e; - for (b = (a.j == null && (a.j = (Rz(), e = Qz.ce(a), Tz(e))), a.j), c2 = 0, d = b.length; c2 < d; ++c2) - ; - } - function hD(a) { - var b, c2, d; - b = ~a.l + 1 & Eje; - c2 = ~a.m + (b == 0 ? 1 : 0) & Eje; - d = ~a.h + (b == 0 && c2 == 0 ? 1 : 0) & Fje; - return TC(b, c2, d); - } - function C$c(a, b) { - var c2, d; - c2 = BD(BD(Ohb(a.g, b.a), 46).a, 65); - d = BD(BD(Ohb(a.g, b.b), 46).a, 65); - return _Nb(c2, d); - } - function xtd(a, b, c2) { - var d; - d = a.gc(); - if (b > d) - throw vbb(new Cyd(b, d)); - a.hi() && (c2 = Dtd(a, c2)); - return a.Vh(b, c2); - } - function xNb(a, b, c2) { - return c2 == null ? (!a.q && (a.q = new Lqb()), Thb(a.q, b)) : (!a.q && (a.q = new Lqb()), Rhb(a.q, b, c2)), a; - } - function yNb(a, b, c2) { - c2 == null ? (!a.q && (a.q = new Lqb()), Thb(a.q, b)) : (!a.q && (a.q = new Lqb()), Rhb(a.q, b, c2)); - return a; - } - function TQb(a) { - var b, c2; - c2 = new kRb(); - tNb(c2, a); - yNb(c2, (HSb(), FSb), a); - b = new Lqb(); - VQb(a, c2, b); - UQb(a, c2, b); - return c2; - } - function j6c(a) { - i6c(); - var b, c2, d; - c2 = KC(m1, nie, 8, 2, 0, 1); - d = 0; - for (b = 0; b < 2; b++) { - d += 0.5; - c2[b] = r6c(d, a); - } - return c2; - } - function Mic(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 | Nic(a, b, f2, e); - } - return c2; - } - function nNb(a, b, c2, d, e) { - var f2, g; - for (g = c2; g <= e; g++) { - for (f2 = b; f2 <= d; f2++) { - YMb(a, f2, g) || aNb(a, f2, g, true, false); - } - } - } - function rNd(a, b) { - this.b = a; - nNd.call(this, (BD(qud(ZKd((NFd(), MFd).o), 10), 18), b.i), b.g); - this.a = (NKd(), MKd); - } - function hj(a, b) { - this.c = a; - this.d = b; - this.b = this.d / this.c.c.Hd().gc() | 0; - this.a = this.d % this.c.c.Hd().gc(); - } - function jdb() { - this.o = null; - this.k = null; - this.j = null; - this.d = null; - this.b = null; - this.n = null; - this.a = null; - } - function fB(a, b, c2) { - this.q = new $wnd.Date(); - this.q.setFullYear(a + nje, b, c2); - this.q.setHours(0, 0, 0, 0); - YA(this, 0); - } - function tAc() { - tAc = ccb; - rAc = new uAc(ane, 0); - qAc = new uAc("NODES_AND_EDGES", 1); - sAc = new uAc("PREFER_EDGES", 2); - } - function RA(a) { - var b; - if (a == 0) { - return "Etc/GMT"; - } - if (a < 0) { - a = -a; - b = "Etc/GMT-"; - } else { - b = "Etc/GMT+"; - } - return b + UA(a); - } - function geb(a) { - var b; - if (a < 0) { - return Rie; - } else if (a == 0) { - return 0; - } else { - for (b = Iie; (b & a) == 0; b >>= 1) - ; - return b; - } - } - function $C(a) { - var b, c2; - c2 = heb(a.h); - if (c2 == 32) { - b = heb(a.m); - return b == 32 ? heb(a.l) + 32 : b + 20 - 10; - } else { - return c2 - 12; - } - } - function bkb(a) { - var b; - b = a.a[a.b]; - if (b == null) { - return null; - } - NC(a.a, a.b, null); - a.b = a.b + 1 & a.a.length - 1; - return b; - } - function EDc(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 Iwb(a, b, c2) { - var d, e; - d = new exb(b, c2); - e = new fxb(); - a.b = Gwb(a, a.b, d, e); - e.b || ++a.c; - a.b.b = false; - return e.d; - } - function djc(a, b, c2) { - var d, e, f2, g; - g = CHc(b, c2); - f2 = 0; - for (e = g.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 11); - Rhb(a.c, d, meb(f2++)); - } - } - function xVb(a) { - var b, c2; - for (c2 = new olb(a.a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 81); - b.g.c = -b.g.c - b.g.b; - } - sVb(a); - } - function XDb(a) { - var b, c2; - for (c2 = new olb(a.a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 57); - b.d.c = -b.d.c - b.d.b; - } - RDb(a); - } - function AUd(a) { - var b; - if (!a.c || (a.Bb & 1) == 0 && (a.c.Db & 64) != 0) { - b = wId(a); - JD(b, 88) && (a.c = BD(b, 26)); - } - return a.c; - } - function ZC(a) { - var b, c2, d; - b = ~a.l + 1 & Eje; - c2 = ~a.m + (b == 0 ? 1 : 0) & Eje; - d = ~a.h + (b == 0 && c2 == 0 ? 1 : 0) & Fje; - a.l = b; - a.m = c2; - a.h = d; - } - function l7c(a) { - var b, c2, d, e, f2; - b = new d7c(); - 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 nmb(a, b) { - mmb(); - 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 w6c(a) { - i6c(); - var b, c2; - c2 = -17976931348623157e292; - for (b = 0; b < a.length; b++) { - a[b] > c2 && (c2 = a[b]); - } - return c2; - } - function SHc(a, b, c2) { - var d; - d = new Rkb(); - UHc(a, b, d, (Ucd(), zcd), true, false); - UHc(a, c2, d, Tcd, false, false); - return d; - } - function crd(a, b, c2) { - var d, e, f2, g; - f2 = null; - g = b; - e = Ypd(g, "labels"); - d = new Hrd(a, c2); - f2 = (Dqd(d.a, d.b, e), e); - return f2; - } - function j1d(a, b, c2, d) { - var e; - e = r1d(a, b, c2, d); - if (!e) { - e = i1d(a, c2, d); - if (!!e && !e1d(a, b, e)) { - return null; - } - } - return e; - } - function m1d(a, b, c2, d) { - var e; - e = s1d(a, b, c2, d); - if (!e) { - e = l1d(a, c2, d); - if (!!e && !e1d(a, b, e)) { - return null; - } - } - return e; - } - function Xb(a, b) { - var c2; - for (c2 = 0; c2 < a.a.a.length; c2++) { - if (!BD($lb(a.a, c2), 169).Lb(b)) { - return false; - } - } - return true; - } - function Cb(a, b, c2) { - Qb(b); - if (c2.Ob()) { - Mfb(b, Fb(c2.Pb())); - while (c2.Ob()) { - Mfb(b, a.a); - Mfb(b, Fb(c2.Pb())); - } - } - return b; - } - function qmb(a) { - mmb(); - 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 WC(a, b, c2, d, e) { - var f2; - f2 = lD(a, b); - c2 && ZC(f2); - if (e) { - a = YC(a, b); - d ? QC = hD(a) : QC = TC(a.l, a.m, a.h); - } - return f2; - } - function Xzb(b, c2) { - var d; - try { - c2.Vd(); - } catch (a) { - a = ubb(a); - if (JD(a, 78)) { - d = a; - b.c[b.c.length] = d; - } else - throw vbb(a); - } - } - function jRb(a, b, c2) { - var d, e; - if (JD(b, 144) && !!c2) { - d = BD(b, 144); - e = c2; - return a.a[d.b][e.b] + a.a[e.b][d.b]; - } - return 0; - } - function xld(a, b) { - switch (b) { + break; + case 5: + break; + case 6: + return 19; + break; case 7: - return !!a.e && a.e.i != 0; + this.begin("LINE"); + return 14; + break; case 8: - return !!a.d && a.d.i != 0; - } - return Ykd(a, b); - } - function YQb(a, b) { - switch (b.g) { - case 0: - JD(a.b, 631) || (a.b = new xRb()); + 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; - case 1: - JD(a.b, 632) || (a.b = new DRb()); - } - } - function Ghe(a, b) { - while (a.g == null && !a.c ? Uud(a) : a.g == null || a.i != 0 && BD(a.g[a.i - 1], 47).Ob()) { - Ord(b, Vud(a)); - } - } - function kic(a, b, c2) { - a.g = qic(a, b, (Ucd(), zcd), a.b); - a.d = qic(a, c2, zcd, a.b); - if (a.g.c == 0 || a.d.c == 0) { - return; - } - nic(a); - } - function lic(a, b, c2) { - a.g = qic(a, b, (Ucd(), Tcd), a.j); - a.d = qic(a, c2, Tcd, a.j); - if (a.g.c == 0 || a.d.c == 0) { - return; - } - nic(a); - } - function $yc(a, b, c2) { - return !WAb(JAb(new YAb(null, new Kub(a.c, 16)), new Xxb(new dfd(b, c2)))).sd((EAb(), DAb)); - } - function KAb(a) { - var b; - Tzb(a); - b = new NBb(); - if (a.a.sd(b)) { - return Atb(), new Ftb(uCb(b.a)); - } - return Atb(), Atb(), ztb; - } - function nA(a) { - var b; - if (a.b <= 0) { - return false; - } - b = hfb("MLydhHmsSDkK", wfb(bfb(a.c, 0))); - return b > 1 || b >= 0 && a.b < 3; - } - function w7c(a) { - var b, c2, d; - b = new s7c(); - for (d = Jsb(a, 0); d.b != d.d.c; ) { - c2 = BD(Xsb(d), 8); - St(b, 0, new g7c(c2)); - } - return b; - } - function qVb(a) { - var b, c2; - for (c2 = new olb(a.a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 81); - b.f.$b(); - } - LVb(a.b, a); - rVb(a); - } - function tb(a) { - return ND(a) ? LCb(a) : LD(a) ? Hdb(a) : KD(a) ? (uCb(a), a) ? 1231 : 1237 : ID(a) ? a.Hb() : MC(a) ? FCb(a) : rz(a); - } - function rb(a) { - return ND(a) ? ZI : LD(a) ? BI : KD(a) ? wI : ID(a) ? a.gm : MC(a) ? a.gm : a.gm || Array.isArray(a) && GC(PH, 1) || PH; - } - function j_c(a) { - switch (a.g) { - case 0: - return new Q1c(); - default: - throw vbb(new Wdb(Mre + (a.f != null ? a.f : "" + a.g))); - } - } - function S0c(a) { - switch (a.g) { - case 0: - return new k1c(); - default: - throw vbb(new Wdb(Mre + (a.f != null ? a.f : "" + a.g))); - } - } - function ekd(a, b, c2) { - switch (b) { - case 0: - !a.o && (a.o = new dId((Thd(), Qhd), S2, a, 0)); - cId(a.o, c2); - return; - } - yid(a, b, c2); - } - function XRc(a, b, c2) { - this.g = a; - this.e = new d7c(); - this.f = new d7c(); - this.d = new Psb(); - this.b = new Psb(); - this.a = b; - this.c = c2; - } - function PZc(a, b, c2, d) { - this.b = new Rkb(); - this.n = new Rkb(); - this.i = d; - this.j = c2; - this.s = a; - this.t = b; - this.r = 0; - this.d = 0; - } - function nib(a) { - this.e = a; - this.d = new Irb(this.e.g); - this.a = this.d; - this.b = kib(this); - this.$modCount = a.$modCount; - } - function Pr(a) { - while (!a.d || !a.d.Ob()) { - if (!!a.b && !akb(a.b)) { - a.d = BD(fkb(a.b), 47); - } else { - return null; - } - } - return a.d; - } - function Xyc(a) { - Ekb(a.c, (Y1c(), W1c)); - if (Ky(a.a, Edb(ED(Ksd((dzc(), bzc)))))) { - return new Zed(); - } - return new _ed(a); - } - function bRc(a) { - switch (a.g) { - case 1: - return Sqe; - default: - case 2: - return 0; - case 3: - return cme; - case 4: - return Tqe; - } - } - function Ife() { - wfe(); - var a; - if (dfe) - return dfe; - a = Afe(Kfe("M", true)); - a = Bfe(Kfe("M", false), a); - dfe = a; - return dfe; - } - function Awb(a, b) { - var c2, d, e; - e = a.b; - while (e) { - c2 = a.a.ue(b, e.d); - if (c2 == 0) { - return e; - } - d = c2 < 0 ? 0 : 1; - e = e.a[d]; - } - return null; - } - function Tyb(a, b, c2) { - var d, e; - d = (Bcb(), _Pb(c2) ? true : false); - e = BD(b.xc(d), 15); - if (!e) { - e = new Rkb(); - b.zc(d, e); - } - e.Fc(c2); - } - function dYc(a, b) { - var c2, d; - c2 = BD(hkd(a, (lZc(), UYc)), 19).a; - d = BD(hkd(b, UYc), 19).a; - return c2 == d ? -1 : c2 < d ? -1 : c2 > d ? 1 : 0; - } - function NYb(a, b) { - if (OYb(a, b)) { - Rc(a.b, BD(vNb(b, (wtc(), Esc)), 21), b); - Dsb(a.a, b); - return true; - } else { - return false; - } - } - function d3b(a) { - var b, c2; - b = BD(vNb(a, (wtc(), gtc)), 10); - if (b) { - c2 = b.c; - Lkb(c2.a, b); - c2.a.c.length == 0 && Lkb(Q_b(b).b, c2); - } - } - function syb(a) { - if (lyb) { - return KC(qL, tke, 572, 0, 0, 1); - } - return BD(Qkb(a.a, KC(qL, tke, 572, a.a.c.length, 0, 1)), 842); - } - function mn(a, b, c2, d) { - Vm(); - return new wx(OC(GC(CK, 1), zie, 42, 0, [(Wj(a, b), new Wo(a, b)), (Wj(c2, d), new Wo(c2, d))])); - } - function Dnd(a, b, c2) { - var d, e; - e = (d = new SSd(), d); - $nd(e, b, c2); - wtd((!a.q && (a.q = new cUd(n5, a, 11, 10)), a.q), e); - return e; - } - function Zmd(a) { - var b, c2, d, e; - e = icb(Rmd, a); - c2 = e.length; - d = KC(ZI, nie, 2, c2, 6, 1); - for (b = 0; b < c2; ++b) { - d[b] = e[b]; - } - return d; - } - function l4c(a, b) { - var c2, d, e, f2, g; - for (d = b, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - g = new v4c(a); - c2.Qe(g); - q4c(g); - } - Uhb(a.f); - } - function hw(a, b) { - var c2; - if (b === a) { - return true; - } - if (JD(b, 224)) { - c2 = BD(b, 224); - return pb(a.Zb(), c2.Zb()); - } - return false; - } - function aub(a, b) { - var c2; - if (b * 2 + 1 >= a.b.c.length) { - return; - } - aub(a, 2 * b + 1); - c2 = 2 * b + 2; - c2 < a.b.c.length && aub(a, c2); - bub(a, b); - } - function Ss(a, b, c2) { - var d, e; - this.g = a; - this.c = b; - this.a = this; - this.d = this; - e = Kp(c2); - d = KC(BG, Gie, 330, e, 0, 1); - this.b = d; - } - function whb(a, b, c2) { - var d; - for (d = c2 - 1; d >= 0 && a[d] === b[d]; d--) - ; - return d < 0 ? 0 : Gbb(xbb(a[d], Yje), xbb(b[d], Yje)) ? -1 : 1; - } - function UFc(a, b) { - var c2, d; - for (d = Jsb(a, 0); d.b != d.d.c; ) { - c2 = BD(Xsb(d), 214); - if (c2.e.length > 0) { - b.td(c2); - c2.i && _Fc(c2); - } - } - } - function nzd(a, b) { - var c2, d; - d = BD(Ajd(a.a, 4), 126); - c2 = KC($3, hve, 415, b, 0, 1); - d != null && $fb(d, 0, c2, 0, d.length); - return c2; - } - function JEd(a, b) { - var c2; - c2 = new NEd((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 Dc(a, b) { - var c2, d; - for (d = a.Zb().Cc().Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 14); - if (c2.Hc(b)) { - return true; - } - } - return false; - } - function oNb(a, b, c2, d, e) { - var f2, g; - for (g = c2; g <= e; g++) { - for (f2 = b; f2 <= d; f2++) { - if (YMb(a, f2, g)) { - return true; - } - } - } - return false; - } - function Tt(a, b, c2) { - var d, e, f2, g; - uCb(c2); - g = false; - f2 = a.Zc(b); - for (e = c2.Kc(); e.Ob(); ) { - d = e.Pb(); - f2.Rb(d); - g = true; - } - return g; - } - function Dv(a, b) { - var c2; - if (a === b) { - return true; - } else if (JD(b, 83)) { - c2 = BD(b, 83); - return Ax(Wm(a), c2.vc()); - } - return false; - } - function Nhb(a, b, c2) { - var d, e; - for (e = c2.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 42); - if (a.re(b, d.dd())) { - return true; - } - } - return false; - } - function Hic(a, b, c2) { - if (!a.d[b.p][c2.p]) { - Gic(a, b, c2); - a.d[b.p][c2.p] = true; - a.d[c2.p][b.p] = true; - } - return a.a[b.p][c2.p]; - } - function Itd(a, b) { - if (!a.ai() && b == null) { - throw vbb(new Wdb("The 'no null' constraint is violated")); - } - return b; - } - function $Jd(a, b) { - if (a.D == null && a.B != null) { - a.D = a.B; - a.B = null; - } - jKd(a, b == null ? null : (uCb(b), b)); - !!a.C && a.yk(null); - } - function XHc(a, b) { - var c2; - if (!a || a == b || !wNb(b, (wtc(), Psc))) { - return false; - } - c2 = BD(vNb(b, (wtc(), Psc)), 10); - return c2 != a; - } - function b4d(a) { - switch (a.i) { - case 2: { - return true; - } - case 1: { - return false; - } - case -1: { - ++a.c; - } - default: { - return a.pl(); - } - } - } - function c4d(a) { - switch (a.i) { - case -2: { - return true; - } - case -1: { - return false; - } - case 1: { - --a.c; - } - default: { - return a.ql(); - } - } - } - function Xdb(a) { - Zy.call(this, "The given string does not match the expected format for individual spacings.", a); - } - function pgd() { - pgd = ccb; - mgd = new qgd("ELK", 0); - ngd = new qgd("JSON", 1); - lgd = new qgd("DOT", 2); - ogd = new qgd("SVG", 3); - } - function pWc() { - pWc = ccb; - mWc = new rWc(ane, 0); - nWc = new rWc("RADIAL_COMPACTION", 1); - oWc = new rWc("WEDGE_COMPACTION", 2); - } - function Fyb() { - Fyb = ccb; - Cyb = new Gyb("CONCURRENT", 0); - Dyb = new Gyb("IDENTITY_FINISH", 1); - Eyb = new Gyb("UNORDERED", 2); - } - function nPb() { - nPb = ccb; - kPb = (cPb(), bPb); - jPb = new Nsd(Tle, kPb); - iPb = new Lsd(Ule); - lPb = new Lsd(Vle); - mPb = new Lsd(Wle); - } - function Occ() { - Occ = ccb; - Mcc = new Zcc(); - Ncc = new _cc(); - Lcc = new bdc(); - Kcc = new fdc(); - Jcc = new jdc(); - Icc = (uCb(Jcc), new bpb()); - } - function tBc() { - tBc = ccb; - qBc = new uBc("CONSERVATIVE", 0); - rBc = new uBc("CONSERVATIVE_SOFT", 1); - sBc = new uBc("SLOPPY", 2); - } - function Zad() { - Zad = ccb; - Xad = new q0b(15); - Wad = new Osd((Y9c(), f9c), Xad); - Yad = C9c; - Sad = s8c; - Tad = Y8c; - Vad = _8c; - Uad = $8c; - } - function o7c(a, b, c2) { - var d, e, f2; - d = new Psb(); - for (f2 = Jsb(c2, 0); f2.b != f2.d.c; ) { - e = BD(Xsb(f2), 8); - Dsb(d, new g7c(e)); - } - Tt(a, b, d); - } - function r7c(a) { - var b, c2, d; - b = 0; - d = KC(m1, nie, 8, a.b, 0, 1); - c2 = Jsb(a, 0); - while (c2.b != c2.d.c) { - d[b++] = BD(Xsb(c2), 8); - } - return d; - } - function $Pd(a) { - var b; - b = (!a.a && (a.a = new cUd(g5, a, 9, 5)), a.a); - if (b.i != 0) { - return nQd(BD(qud(b, 0), 678)); - } - return null; - } - function Ly(a, b) { - var c2; - c2 = wbb(a, b); - if (Gbb(Vbb(a, b), 0) | Ebb(Vbb(a, c2), 0)) { - return c2; - } - return wbb(rie, Vbb(Pbb(c2, 63), 1)); - } - function Yyc(a, b) { - var c2; - c2 = Ksd((dzc(), bzc)) != null && b.wg() != null ? Edb(ED(b.wg())) / Edb(ED(Ksd(bzc))) : 1; - Rhb(a.b, b, c2); - } - function le(a, b) { - var c2, d; - c2 = BD(a.d.Bc(b), 14); - if (!c2) { - return null; - } - d = a.e.hc(); - d.Gc(c2); - a.e.d -= c2.gc(); - c2.$b(); - return d; - } - function AHc(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 rwb(a) { - var b; - b = a.a.c.length; - if (b > 0) { - return _vb(b - 1, a.a.c.length), Kkb(a.a, b - 1); - } else { - throw vbb(new Jpb()); - } - } - function C2c(a, b, c2) { - if (b < 0) { - throw vbb(new qcb(ese + b)); - } - if (b < a.j.c.length) { - Nkb(a.j, b, c2); - } else { - A2c(a, b); - Ekb(a.j, c2); - } - } - function oCb(a, b, c2) { - if (a > b) { - throw vbb(new Wdb(xke + a + yke + b)); - } - if (a < 0 || b > c2) { - throw vbb(new scb(xke + a + zke + b + oke + c2)); - } - } - function j5c(a) { - if (!a.a || (a.a.i & 8) == 0) { - throw vbb(new Zdb("Enumeration class expected for layout option " + a.f)); - } - } - function vud(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.ri(a.i); - $fb(b, 0, a.g, 0, a.i); - } - } - function hkb(a, b) { - var c2, d; - c2 = a.a.length - 1; - a.c = a.c - 1 & c2; - while (b != a.c) { - d = b + 1 & c2; - NC(a.a, b, a.a[d]); - b = d; - } - NC(a.a, a.c, null); - } - function ikb(a, b) { - var c2, d; - c2 = a.a.length - 1; - while (b != a.b) { - d = b - 1 & c2; - NC(a.a, b, a.a[d]); - b = d; - } - NC(a.a, a.b, null); - a.b = a.b + 1 & c2; - } - function Fkb(a, b, c2) { - var d, e; - wCb(b, a.c.length); - d = c2.Pc(); - e = d.length; - if (e == 0) { - return false; - } - bCb(a.c, b, d); - return true; - } - function VEd(a) { - var b, c2; - if (a == null) - return null; - for (b = 0, c2 = a.length; b < c2; b++) { - if (!gFd(a[b])) - return a[b]; - } - return null; - } - function grb(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.re(b, d.cd())) { - return d; - } - } - return null; - } - function Hlb(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 as(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 gr(a) { - var b; - Qb(a); - Mb(true, "numberToAdvance must be nonnegative"); - for (b = 0; b < 0 && Qr(a); b++) { - Rr(a); - } - return b; - } - function eDc(a) { - var b, c2, d; - d = 0; - for (c2 = new Sr(ur(a.a.Kc(), new Sq())); Qr(c2); ) { - b = BD(Rr(c2), 17); - b.c.i == b.d.i || ++d; - } - return d; - } - function HZb(a, b) { - var c2, d, e; - c2 = a; - e = 0; - do { - if (c2 == b) { - return e; - } - d = c2.e; - if (!d) { - throw vbb(new Vdb()); - } - c2 = Q_b(d); - ++e; - } while (true); - } - function w$c(a, b) { - var c2, d, e; - e = b - a.f; - for (d = new olb(a.d); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 443); - _Zc(c2, c2.e, c2.f + e); - } - a.f = b; - } - function aRc(a, b, c2) { - if ($wnd.Math.abs(b - a) < Rqe || $wnd.Math.abs(c2 - a) < Rqe) { - return true; - } - return b - a > Rqe ? a - c2 > Rqe : c2 - a > Rqe; - } - function pHb(a, b) { - if (!a) { - return 0; - } - if (b && !a.j) { - return 0; - } - if (JD(a, 124)) { - if (BD(a, 124).a.b == 0) { - return 0; - } - } - return a.Re(); - } - function qHb(a, b) { - if (!a) { - return 0; - } - if (b && !a.k) { - return 0; - } - if (JD(a, 124)) { - if (BD(a, 124).a.a == 0) { - return 0; - } - } - return a.Se(); - } - function fhb(a) { - Hgb(); - if (a < 0) { - if (a != -1) { - return new Tgb(-1, -a); - } - return Bgb; - } else - return a <= 10 ? Dgb[QD(a)] : new Tgb(1, a); - } - function xC(a) { - rC(); - throw vbb(new MB("Unexpected typeof result '" + a + "'; please report this bug to the GWT team")); - } - function lz(a) { - jz(); - Py(this); - Ry(this); - this.e = a; - Sy(this, a); - this.g = a == null ? Xhe : fcb(a); - this.a = ""; - this.b = a; - this.a = ""; - } - function F$c() { - this.a = new G$c(); - this.f = new I$c(this); - this.b = new K$c(this); - this.i = new M$c(this); - this.e = new O$c(this); - } - function ss() { - rs.call(this, new _rb(Cv(16))); - Xj(2, mie); - this.b = 2; - this.a = new Ms(null, null, 0, null); - As(this.a, this.a); - } - function xzc() { - xzc = ccb; - uzc = new zzc("DUMMY_NODE_OVER", 0); - vzc = new zzc("DUMMY_NODE_UNDER", 1); - wzc = new zzc("EQUAL", 2); - } - function LUb() { - LUb = ccb; - JUb = Fx(OC(GC(t12, 1), Kie, 103, 0, [(ead(), aad), bad])); - KUb = Fx(OC(GC(t12, 1), Kie, 103, 0, [dad, _9c])); - } - function VQc(a) { - return (Ucd(), Lcd).Hc(a.j) ? Edb(ED(vNb(a, (wtc(), qtc)))) : l7c(OC(GC(m1, 1), nie, 8, 0, [a.i.n, a.n, a.a])).b; - } - function DOb(a) { - var b, c2, d, e; - d = a.b.a; - for (c2 = d.a.ec().Kc(); c2.Ob(); ) { - b = BD(c2.Pb(), 561); - e = new MPb(b, a.e, a.f); - Ekb(a.g, e); - } - } - function yId(a, b) { - var c2, d, e; - d = a.nk(b, null); - e = null; - if (b) { - e = (LFd(), c2 = new UQd(), c2); - NQd(e, a.r); - } - d = xId(a, e, d); - !!d && d.Fi(); - } - function VFc(a, b) { - var c2, d; - d = Cub(a.d, 1) != 0; - c2 = true; - while (c2) { - c2 = false; - c2 = b.c.Tf(b.e, d); - c2 = c2 | dGc(a, b, d, false); - d = !d; - } - $Fc(a); - } - function wZc(a, b) { - var c2, d, e; - d = false; - c2 = b.q.d; - if (b.d < a.b) { - e = ZZc(b.q, a.b); - if (b.q.d > e) { - $Zc(b.q, e); - d = c2 != b.q.d; - } - } - return d; - } - function PVc(a, b) { - var c2, d, e, f2, g, h, i3, j; - i3 = b.i; - j = b.j; - d = a.f; - e = d.i; - f2 = d.j; - g = i3 - e; - h = j - f2; - c2 = $wnd.Math.sqrt(g * g + h * h); - return c2; - } - function Rnd(a, b) { - var c2, d; - d = jid(a); - if (!d) { - c2 = (IEd(), PEd(b)); - d = new s0d(c2); - wtd(d.Vk(), a); - } - return d; - } - function Sc(a, b) { - var c2, d; - c2 = BD(a.c.Bc(b), 14); - if (!c2) { - return a.jc(); - } - d = a.hc(); - d.Gc(c2); - a.d -= c2.gc(); - c2.$b(); - return a.mc(d); - } - function j7c(a, b) { - var c2; - for (c2 = 0; c2 < b.length; c2++) { - if (a == (BCb(c2, b.length), b.charCodeAt(c2))) { - return true; - } - } - return false; - } - function E_b(a, b) { - var c2; - for (c2 = 0; c2 < b.length; c2++) { - if (a == (BCb(c2, b.length), b.charCodeAt(c2))) { - return true; - } - } - return false; - } - function hFd(a) { - var b, c2; - if (a == null) - return false; - for (b = 0, c2 = a.length; b < c2; b++) { - if (!gFd(a[b])) - return false; - } - return true; - } - function Ngb(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 vkb(a) { - var b; - sCb(a.a != a.b); - b = a.d.a[a.a]; - mkb(a.b == a.d.c && b != null); - a.c = a.a; - a.a = a.a + 1 & a.d.a.length - 1; - return b; - } - function phe(a) { - var b; - if (!(a.c.c < 0 ? a.a >= a.c.b : a.a <= a.c.b)) { - throw vbb(new utb()); - } - b = a.a; - a.a += a.c.c; - ++a.b; - return meb(b); - } - function BWb(a) { - var b; - b = new VWb(a); - rXb(a.a, zWb, new amb(OC(GC(bQ, 1), Uhe, 369, 0, [b]))); - !!b.d && Ekb(b.f, b.d); - return b.f; - } - function Z1b(a) { - var b; - b = new q_b(a.a); - tNb(b, a); - yNb(b, (wtc(), $sc), a); - b.o.a = a.g; - b.o.b = a.f; - b.n.a = a.i; - b.n.b = a.j; - return b; - } - function A9b(a, b, c2, d) { - var e, f2; - for (f2 = a.Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 70); - e.n.a = b.a + (d.a - e.o.a) / 2; - e.n.b = b.b; - b.b += e.o.b + c2; - } - } - function UDb(a, b, c2) { - var d, e; - for (e = b.a.a.ec().Kc(); e.Ob(); ) { - d = BD(e.Pb(), 57); - if (VDb(a, d, c2)) { - return true; - } - } - return false; - } - function JDc(a) { - var b, c2; - for (c2 = new olb(a.r); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 10); - if (a.n[b.p] <= 0) { - return b; - } } - return null; - } - function cVc(a) { - var b, c2, d, e; - e = new Tqb(); - for (d = new olb(a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 33); - b = fVc(c2); - ye(e, b); - } - return e; - } - function zFc(a) { - var b; - b = k3c(xFc); - BD(vNb(a, (wtc(), Ksc)), 21).Hc((Orc(), Krc)) && e3c(b, (qUb(), nUb), (S8b(), H8b)); - return b; - } - function qKb(a, b, c2) { - var d; - d = new AJb(a, b); - Rc(a.r, b.Hf(), d); - if (c2 && !tcd(a.u)) { - d.c = new aIb(a.d); - Hkb(b.wf(), new tKb(d)); - } - } - function ybb(a, b) { - var c2; - if (Fbb(a) && Fbb(b)) { - c2 = a - b; - if (!isNaN(c2)) { - return c2; - } - } - return eD(Fbb(a) ? Rbb(a) : a, Fbb(b) ? Rbb(b) : b); - } - function bFd(a, b) { - return b < a.length && (BCb(b, a.length), a.charCodeAt(b) != 63) && (BCb(b, a.length), a.charCodeAt(b) != 35); - } - function Kic(a, b, c2, d) { - var e, f2; - a.a = b; - f2 = d ? 0 : 1; - a.f = (e = new Iic(a.c, a.a, c2, f2), new jjc(c2, a.a, e, a.e, a.b, a.c == (rGc(), pGc))); - } - function Tmd(a, b, c2) { - var d, e; - e = a.a; - a.a = b; - if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - d = new nSd(a, 1, 1, e, b); - !c2 ? c2 = d : c2.Ei(d); - } - return c2; - } - function GQd(a, b, c2) { - var d, e; - e = a.b; - a.b = b; - if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - d = new nSd(a, 1, 3, e, b); - !c2 ? c2 = d : c2.Ei(d); - } - return c2; - } - function IQd(a, b, c2) { - var d, e; - e = a.f; - a.f = b; - if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - d = new nSd(a, 1, 0, e, b); - !c2 ? c2 = d : c2.Ei(d); - } - return c2; - } - function xid(a, b) { - var c2, d, e, f2; - f2 = (e = a ? jid(a) : null, q6d((d = b, e ? e.Xk() : null, d))); - if (f2 == b) { - c2 = jid(a); - !!c2 && c2.Xk(); - } - return f2; - } - function x6c(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; + }, "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; + }(); + parser22.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser22; + parser22.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(id27, name, description, type3) { + let assignedBox = state3.records.currentBox; + const old = state3.records.actors.get(id27); + 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(id27, { + 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 = id27; + } + } + if (state3.records.currentBox) { + state3.records.currentBox.actorKeys.push(id27); + } + state3.records.prevActor = id27; + }, "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(id27) { + return state3.records.actors.get(id27); + }, "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 { - e *= c2; - d -= 1; + state3.records.lastCreated = void 0; } - } - return b < 0 ? 1 / e : e; - } - function y6c(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 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 { - e *= c2; - d -= 1; - } - } - return b < 0 ? 1 / e : e; - } - function sAd(a) { - var b, c2; - if (a != null) { - for (c2 = 0; c2 < a.length; ++c2) { - b = a[c2]; - if (b) { - BD(b.g, 367); - b.i; - } + 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 YZc(a) { - var b, c2, d; - d = 0; - for (c2 = new olb(a.a); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 187); - d = $wnd.Math.max(d, b.g); - } - return d; - } - function eGc(a) { - var b, c2, d; - for (d = new olb(a.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 214); - b = c2.c.Rf() ? c2.f : c2.a; - !!b && mHc(b, c2.j); - } - } - function hbd() { - hbd = ccb; - fbd = new ibd("INHERIT", 0); - ebd = new ibd("INCLUDE_CHILDREN", 1); - gbd = new ibd("SEPARATE_CHILDREN", 2); - } - function Jkd(a, b) { - switch (b) { - case 1: - !a.n && (a.n = new cUd(D2, a, 1, 7)); - Uxd(a.n); - return; - case 2: - Lkd(a, null); - return; - } - fkd(a, b); - } - function Dm(a) { - var b; - switch (a.gc()) { - case 0: - return hm; - case 1: - return new my(Qb(a.Xb(0))); - default: - b = a; - return new ux(b); - } - } - function Vn(a) { - Ql(); - switch (a.gc()) { - case 0: - return yx(), xx; - case 1: - return new oy(a.Kc().Pb()); - default: - return new zx(a); - } - } - function Up(a) { - Ql(); - switch (a.c) { - case 0: - return yx(), xx; - case 1: - return new oy(qr(new Gqb(a))); - default: - return new Tp(a); - } - } - function Hv(b, c2) { - Qb(b); - try { - return b.xc(c2); - } catch (a) { - a = ubb(a); - if (JD(a, 205) || JD(a, 173)) { - return null; - } else - throw vbb(a); - } - } - function Iv(b, c2) { - Qb(b); - try { - return b.Bc(c2); - } catch (a) { - a = ubb(a); - if (JD(a, 205) || JD(a, 173)) { - return null; - } else - throw vbb(a); - } - } - function Ck(b, c2) { - Qb(b); - try { - return b.Hc(c2); - } catch (a) { - a = ubb(a); - if (JD(a, 205) || JD(a, 173)) { - return false; - } else - throw vbb(a); - } - } - function Dk(b, c2) { - Qb(b); - try { - return b.Mc(c2); - } catch (a) { - a = ubb(a); - if (JD(a, 205) || JD(a, 173)) { - return false; - } else - throw vbb(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((diagram24, actors2, actorKeys, conf8) => { + if (!diagram24.select) { + return; + } + actorKeys.forEach((actorKey) => { + const actor = actors2.get(actorKey); + const actorDOM = diagram24.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 Gv(b, c2) { - Qb(b); - try { - return b._b(c2); - } catch (a) { - a = ubb(a); - if (JD(a, 205) || JD(a, 173)) { - return false; - } else - throw vbb(a); - } - } - function KXb(a, b) { - var c2; - if (a.a.c.length > 0) { - c2 = BD(Ikb(a.a, a.a.c.length - 1), 570); - if (NYb(c2, b)) { - return; - } - } - Ekb(a.a, new PYb(b)); - } - function $gc(a) { - Hgc(); - var b, c2; - b = a.d.c - a.e.c; - c2 = BD(a.g, 145); - Hkb(c2.b, new shc(b)); - Hkb(c2.c, new uhc(b)); - reb(c2.i, new whc(b)); - } - function gic(a) { - var b; - b = new Ufb(); - b.a += "VerticalSegment "; - Pfb(b, a.e); - b.a += " "; - Qfb(b, Eb(new Gb(), new olb(a.k))); - return b.a; - } - function u4c(a) { - var b; - b = BD(Wrb(a.c.c, ""), 229); - if (!b) { - b = new W3c(d4c(c4c(new e4c(), ""), "Other")); - Xrb(a.c.c, "", b); - } - return b; - } - function qnd(a) { - var b; - if ((a.Db & 64) != 0) - return Eid(a); - b = new Jfb(Eid(a)); - b.a += " (name: "; - Efb(b, a.zb); - b.a += ")"; - return b.a; - } - function Jnd(a, b, c2) { - var d, e; - e = a.sb; - a.sb = b; - if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - d = new nSd(a, 1, 4, e, b); - !c2 ? c2 = d : c2.Ei(d); - } - return c2; - } - function _ic(a, b) { - var c2, d, e; - c2 = 0; - for (e = V_b(a, b).Kc(); e.Ob(); ) { - d = BD(e.Pb(), 11); - c2 += vNb(d, (wtc(), gtc)) != null ? 1 : 0; - } - return c2; - } - function vPc(a, b, c2) { - var d, e, f2; - d = 0; - for (f2 = Jsb(a, 0); f2.b != f2.d.c; ) { - e = Edb(ED(Xsb(f2))); - if (e > c2) { - break; - } else - e >= b && ++d; - } - return d; - } - function RTd(a, b, c2) { - var d, e; - d = new pSd(a.e, 3, 13, null, (e = b.c, e ? e : (jGd(), YFd)), HLd(a, b), false); - !c2 ? c2 = d : c2.Ei(d); - return c2; - } - function STd(a, b, c2) { - var d, e; - d = new pSd(a.e, 4, 13, (e = b.c, e ? e : (jGd(), YFd)), null, HLd(a, b), false); - !c2 ? c2 = d : c2.Ei(d); - return c2; - } - function zId(a, b, c2) { - var d, e; - e = a.r; - a.r = b; - if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - d = new nSd(a, 1, 8, e, a.r); - !c2 ? c2 = d : c2.Ei(d); - } - return c2; - } - function o1d(a, b) { - var c2, d; - c2 = BD(b, 676); - d = c2.vk(); - !d && c2.wk(d = JD(b, 88) ? new C1d(a, BD(b, 26)) : new O1d(a, BD(b, 148))); - return d; - } - function kud(a, b, c2) { - var d; - a.qi(a.i + 1); - d = a.oi(b, c2); - b != a.i && $fb(a.g, b, a.g, b + 1, a.i - b); - NC(a.g, b, d); - ++a.i; - a.bi(b, c2); - a.ci(); - } - function vwb(a, b) { - var c2; - if (b.a) { - c2 = b.a.a.length; - !a.a ? a.a = new Wfb(a.d) : Qfb(a.a, a.b); - Ofb(a.a, b.a, b.d.length, c2); - } - return a; - } - function __d(a, b) { - var c2, d, e, f2; - b.vi(a.a); - f2 = BD(Ajd(a.a, 8), 1936); - if (f2 != null) { - for (c2 = f2, d = 0, e = c2.length; d < e; ++d) { - null.jm(); - } - } - } - function TAb(a, b) { - var c2; - c2 = new NBb(); - if (!a.a.sd(c2)) { - Tzb(a); - return Atb(), Atb(), ztb; - } - return Atb(), new Ftb(uCb(SAb(a, c2.a, b))); - } - function CHc(a, b) { - switch (b.g) { - case 2: - case 1: - return V_b(a, b); - case 3: - case 4: - return Su(V_b(a, b)); - } - return mmb(), mmb(), jmb; - } - function pb(a, b) { - return ND(a) ? dfb(a, b) : LD(a) ? Fdb(a, b) : KD(a) ? (uCb(a), PD(a) === PD(b)) : ID(a) ? a.Fb(b) : MC(a) ? mb(a, b) : qz(a, b); - } - function r6d(a) { - return !a ? null : (a.i & 1) != 0 ? a == sbb ? wI : a == WD ? JI : a == VD ? FI : a == UD ? BI : a == XD ? MI : a == rbb ? UI : a == SD ? xI : yI : a; - } - function Fhb(a, b, c2, d, e) { - if (b == 0 || d == 0) { - return; - } - b == 1 ? e[d] = Hhb(e, c2, d, a[0]) : d == 1 ? e[b] = Hhb(e, a, b, c2[0]) : Ghb(a, c2, e, b, d); - } - function c6b(a, b) { - var c2; - if (a.c.length == 0) { - return; - } - c2 = BD(Qkb(a, KC(OQ, kne, 10, a.c.length, 0, 1)), 193); - Nlb(c2, new o6b()); - _5b(c2, b); - } - function i6b(a, b) { - var c2; - if (a.c.length == 0) { - return; + } + } + 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, diagram24, 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(diagram24) + }); + }, "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(diagram24, 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(diagram24, textObj, { startx, stopx, starty: lineStartY }); + } else { + drawText3(diagram24, textObj); + } + const textWidth = textDims.width; + let line2; + if (startx === stopx) { + if (conf4.rightAngles) { + line2 = diagram24.append("path").attr( + "d", + `M ${startx},${lineStartY} H ${startx + common_default.getMax(conf4.width / 2, textWidth / 2)} V ${lineStartY + 25} H ${startx}` + ); + } else { + line2 = diagram24.append("path").attr( + "d", + "M " + startx + "," + lineStartY + " C " + (startx + 60) + "," + (lineStartY - 10) + " " + (startx + 60) + "," + (lineStartY + 30) + " " + startx + "," + (lineStartY + 20) + ); + } + } else { + line2 = diagram24.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)"); + diagram24.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(diagram24, 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(diagram24, actors2, actorKeys, isFooter) { + if (!isFooter) { + for (const actorKey of actorKeys) { + const actor = actors2.get(actorKey); + await svgDraw_default2.drawActor(diagram24, 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(diagram24, actor, conf4, true); + maxHeight = common_default.getMax(maxHeight, height2); + } + bounds.bumpVerticalPos(maxHeight + conf4.boxMargin); + } + }, "drawActors"); + drawActorsPopup = /* @__PURE__ */ __name(function(diagram24, 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( + diagram24, + 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, id27, _version, diagObj) { + const { securityLevel, sequence } = getConfig2(); + conf4 = sequence; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id27); + } + 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 diagram24 = securityLevel === "sandbox" ? root4.select(`[id="${id27}"]`) : select_default2(`[id="${id27}"]`); + 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(diagram24); + svgDraw_default2.insertDatabaseIcon(diagram24); + svgDraw_default2.insertClockIcon(diagram24); + 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(diagram24, actors2, createdActors, actorKeys, 0, messages, false); + const loopWidths = await calculateLoopBounds(messages, actors2, maxMessageWidthPerActor, diagObj); + svgDraw_default2.insertArrowHead(diagram24); + svgDraw_default2.insertArrowCrossHead(diagram24); + svgDraw_default2.insertArrowFilledHead(diagram24); + svgDraw_default2.insertSequenceNumber(diagram24); + function activeEnd(msg, verticalPos) { + const activationData = bounds.endActivation(msg); + if (activationData.starty + 18 > verticalPos) { + activationData.starty = verticalPos - 6; + verticalPos += 12; + } + svgDraw_default2.drawActivation( + diagram24, + 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(diagram24, noteModel); + break; + case diagObj.db.LINETYPE.ACTIVE_START: + bounds.newActivation(msg, diagram24, 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(diagram24, 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(diagram24, 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(diagram24, 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(diagram24, 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(); } - c2 = BD(Qkb(a, KC(OQ, kne, 10, a.c.length, 0, 1)), 193); - Nlb(c2, new t6b()); - _5b(c2, b); - } - function Ekd(a, b, c2, d) { - switch (b) { - case 1: - return !a.n && (a.n = new cUd(D2, a, 1, 7)), a.n; - case 2: - return a.k; + 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(diagram24, 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(diagram24, 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(diagram24, 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(diagram24, actors2, actorKeys, false); + for (const e3 of messagesToDraw) { + await drawMessage(diagram24, e3.messageModel, e3.lineStartY, diagObj); + } + if (conf4.mirrorActors) { + await drawActors(diagram24, actors2, actorKeys, true); + } + backgrounds.forEach((e3) => svgDraw_default2.drawBackgroundRect(diagram24, e3)); + fixLifeLineHeights(diagram24, 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(diagram24, box2, conf4); + } + if (hasBoxes) { + bounds.bumpVerticalPos(conf4.boxMargin); + } + const requiredBoxSize = drawActorsPopup(diagram24, 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) { + diagram24.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 2 * conf4.diagramMarginX).attr("y", -25); + } + configureSvgSize(diagram24, height2, width3, conf4.useMaxWidth); + const extraVertForTitle = title2 ? 40 : 0; + diagram24.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); } - return bkd(a, b, c2, d); - } - function ead() { - ead = ccb; - cad = new iad(ole, 0); - bad = new iad(kle, 1); - aad = new iad(jle, 2); - _9c = new iad(vle, 3); - dad = new iad("UP", 4); - } - function RXb() { - RXb = ccb; - QXb = new SXb(ane, 0); - PXb = new SXb("INSIDE_PORT_SIDE_GROUPS", 1); - OXb = new SXb("FORCE_MODEL_ORDER", 2); - } - function xCb(a, b, c2) { - if (a < 0 || b > c2) { - throw vbb(new qcb(xke + a + zke + b + ", size: " + c2)); + 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); } - if (a > b) { - throw vbb(new Wdb(xke + a + yke + b)); + 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); } - } - function eid(a, b, c2) { - if (b < 0) { - vid(a, c2); - } else { - if (!c2.Ij()) { - throw vbb(new Wdb(ite + c2.ne() + jte)); - } - BD(c2, 66).Nj().Vj(a, a.yh(), b); - } - } - function Jlb(a, b, c2, d, e, f2, g, h) { - var i3; - i3 = c2; - while (f2 < g) { - i3 >= d || b < c2 && h.ue(a[b], a[i3]) <= 0 ? NC(e, f2++, a[b++]) : NC(e, f2++, a[i3++]); - } - } - function yZb(a, b, c2, d, e, f2) { - this.e = new Rkb(); - this.f = (KAc(), JAc); - Ekb(this.e, a); - this.d = b; - this.a = c2; - this.b = d; - this.f = e; - this.c = f2; - } - function VOd(a, b) { - var c2, d; - for (d = new Fyd(a); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 26); - if (PD(b) === PD(c2)) { - return true; + 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; } - } - return false; + }); } - function uJb(a) { - qJb(); - var b, c2, d, e; - for (c2 = wJb(), d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - if (Jkb(b.a, a, 0) != -1) { - return b; - } - } - return pJb; + } + } + 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 parser22 = { + 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 jFd(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; + }, "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 QHd(a) { - var b; - if ((a.Db & 64) != 0) - return Eid(a); - b = new Jfb(Eid(a)); - b.a += " (source: "; - Efb(b, a.d); - b.a += ")"; - return b.a; - } - function OQd(a, b, c2) { - var d, e; - e = a.a; - a.a = b; - if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - d = new nSd(a, 1, 5, e, a.a); - !c2 ? c2 = d : Qwd(c2, d); - } - return c2; - } - function BId(a, b) { - var c2; - c2 = (a.Bb & 256) != 0; - b ? a.Bb |= 256 : a.Bb &= -257; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new qSd(a, 1, 2, c2, b)); - } - function eLd(a, b) { - var c2; - c2 = (a.Bb & 256) != 0; - b ? a.Bb |= 256 : a.Bb &= -257; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new qSd(a, 1, 8, c2, b)); - } - function LPd(a, b) { - var c2; - c2 = (a.Bb & 256) != 0; - b ? a.Bb |= 256 : a.Bb &= -257; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new qSd(a, 1, 8, c2, b)); - } - function CId(a, b) { - var c2; - c2 = (a.Bb & 512) != 0; - b ? a.Bb |= 512 : a.Bb &= -513; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new qSd(a, 1, 3, c2, b)); - } - function fLd(a, b) { - var c2; - c2 = (a.Bb & 512) != 0; - b ? a.Bb |= 512 : a.Bb &= -513; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new qSd(a, 1, 9, c2, b)); - } - function N7d(a, b) { - var c2; - if (a.b == -1 && !!a.a) { - c2 = a.a.Gj(); - a.b = !c2 ? bLd(a.c.Tg(), a.a) : a.c.Xg(a.a.aj(), c2); - } - return a.c.Og(a.b, b); - } - function meb(a) { - var b, c2; - if (a > -129 && a < 128) { - b = a + 128; - c2 = (oeb(), neb)[b]; - !c2 && (c2 = neb[b] = new _db(a)); - return c2; - } - return new _db(a); - } - function Web(a) { - var b, c2; - if (a > -129 && a < 128) { - b = a + 128; - c2 = (Yeb(), Xeb)[b]; - !c2 && (c2 = Xeb[b] = new Qeb(a)); - return c2; - } - return new Qeb(a); - } - function L5b(a) { - var b, c2; - b = a.k; - if (b == (j0b(), e0b)) { - c2 = BD(vNb(a, (wtc(), Hsc)), 61); - return c2 == (Ucd(), Acd) || c2 == Rcd; - } - return false; + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - function i1d(a, b, c2) { - var d, e, f2; - f2 = (e = nUd(a.b, b), e); - if (f2) { - d = BD(V1d(p1d(a, f2), ""), 26); - if (d) { - return r1d(a, d, b, c2); + __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 null; + return token2; } - function l1d(a, b, c2) { - var d, e, f2; - f2 = (e = nUd(a.b, b), e); - if (f2) { - d = BD(V1d(p1d(a, f2), ""), 26); - if (d) { - return s1d(a, d, b, c2); + __name(lex2, "lex"); + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); } + action = table[state5] && table[state5][symbol]; } - return null; - } - function cTd(a, b) { - var c2, d; - for (d = new Fyd(a); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 138); - if (PD(b) === PD(c2)) { - return true; + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state5]) { + 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 + }); } - return false; - } - function vtd(a, b, c2) { - var d; - d = a.gc(); - if (b > d) - throw vbb(new Cyd(b, d)); - if (a.hi() && a.Hc(c2)) { - throw vbb(new Wdb(kue)); - } - a.Xh(b, c2); - } - function iqd(a, b) { - var c2; - c2 = oo(a.i, b); - if (c2 == null) { - throw vbb(new cqd("Node did not exist in input.")); - } - Yqd(b, c2); - return null; - } - function $hd(a, b) { - var c2; - c2 = YKd(a, b); - if (JD(c2, 322)) { - return BD(c2, 34); - } - throw vbb(new Wdb(ite + b + "' is not a valid attribute")); - } - function V2d(a, b, c2) { - var d, e; - e = JD(b, 99) && (BD(b, 18).Bb & Tje) != 0 ? new s4d(b, a) : new p4d(b, a); - for (d = 0; d < c2; ++d) { - d4d(e); - } - return e; - } - function ede(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 lYb(a) { - var b, c2, d; - b = new Rkb(); - for (d = new olb(a.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 594); - Gkb(b, BD(c2.jf(), 14)); - } - return b; - } - function SSc(a) { - var b, c2, d; - b = BD(vNb(a, (mTc(), gTc)), 15); - for (d = b.Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 188); - Dsb(c2.b.d, c2); - Dsb(c2.c.b, c2); + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } - } - function b5b(a) { - switch (BD(vNb(a, (wtc(), Osc)), 303).g) { + switch (action[0]) { case 1: - yNb(a, Osc, (esc(), bsc)); + 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: - yNb(a, Osc, (esc(), dsc)); - } - } - function _Fc(a) { - var b; - if (a.g) { - b = a.c.Rf() ? a.f : a.a; - bGc(b.a, a.o, true); - bGc(b.a, a.o, false); - yNb(a.o, (Nyc(), Vxc), (dcd(), Zbd)); - } - } - function loc(a) { - var b; - if (!a.a) { - throw vbb(new Zdb("Cannot offset an unassigned cut.")); - } - b = a.c - a.b; - a.b += b; - noc(a, b); - ooc(a, b); - } - function ckb(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; - NC(a.a, a.c, null); - return b; - } - function zGb(a) { - var b, c2; - for (c2 = a.p.a.ec().Kc(); c2.Ob(); ) { - b = BD(c2.Pb(), 213); - if (b.f && a.b[b.c] < -1e-10) { - return b; - } - } - return null; - } - function bLb(a, b) { - switch (a.b.g) { - case 0: - case 1: - return b; - case 2: - case 3: - return new J6c(b.d, 0, b.a, b.b); - default: - return null; - } - } - function had(a) { - switch (a.g) { - case 2: - return bad; - case 1: - return aad; - case 4: - return _9c; - case 3: - return dad; - default: - return cad; - } - } - function Vcd(a) { - switch (a.g) { - case 1: - return Tcd; - case 2: - return Acd; - case 3: - return zcd; - case 4: - return Rcd; - default: - return Scd; - } - } - function Wcd(a) { - switch (a.g) { - case 1: - return Rcd; - case 2: - return Tcd; - case 3: - return Acd; - case 4: - return zcd; - default: - return Scd; - } - } - function Xcd(a) { - switch (a.g) { - case 1: - return zcd; - case 2: - return Rcd; + 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 Tcd; - case 4: - return Acd; - default: - return Scd; - } - } - function DPc(a) { - switch (a) { - case 0: - return new OPc(); - case 1: - return new EPc(); - case 2: - return new JPc(); - default: - throw vbb(new Vdb()); - } - } - function Kdb(a, b) { - if (a < b) { - return -1; - } - if (a > b) { - return 1; - } - if (a == b) { - return a == 0 ? Kdb(1 / a, 1 / b) : 0; + return true; } - return isNaN(a) ? isNaN(b) ? 0 : 1 : -1; - } - function f4b(a, b) { - Odd(b, "Sort end labels", 1); - MAb(JAb(LAb(new YAb(null, new Kub(a.b, 16)), new q4b()), new s4b()), new u4b()); - Qdd(b); } - function Wxd(a, b, c2) { - var d, e; - if (a.ej()) { - e = a.fj(); - d = sud(a, b, c2); - a.$i(a.Zi(7, meb(c2), d, b, e)); - return d; + 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 { - return sud(a, b, c2); + 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]; } - } - function vAd(a, b) { - var c2, d, e; - if (a.d == null) { - ++a.e; - --a.f; + 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 { - e = b.cd(); - c2 = b.Sh(); - d = (c2 & Ohe) % a.d.length; - KAd(a, d, xAd(a, d, c2, e)); - } - } - function ZId(a, b) { - var c2; - c2 = (a.Bb & zte) != 0; - b ? a.Bb |= zte : a.Bb &= -1025; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new qSd(a, 1, 10, c2, b)); - } - function dJd(a, b) { - var c2; - c2 = (a.Bb & Rje) != 0; - b ? a.Bb |= Rje : a.Bb &= -4097; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new qSd(a, 1, 12, c2, b)); - } - function eJd(a, b) { - var c2; - c2 = (a.Bb & Cve) != 0; - b ? a.Bb |= Cve : a.Bb &= -8193; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new qSd(a, 1, 15, c2, b)); - } - function fJd(a, b) { - var c2; - c2 = (a.Bb & Dve) != 0; - b ? a.Bb |= Dve : a.Bb &= -2049; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new qSd(a, 1, 11, c2, b)); - } - function jOb(a, b) { - var c2; - c2 = Kdb(a.b.c, b.b.c); - if (c2 != 0) { - return c2; - } - c2 = Kdb(a.a.a, b.a.a); - if (c2 != 0) { - return c2; - } - return Kdb(a.a.b, b.a.b); - } - function jqd(a, b) { - var c2; - c2 = Ohb(a.k, b); - if (c2 == null) { - throw vbb(new cqd("Port did not exist in input.")); - } - Yqd(b, c2); - return null; - } - function k6d(a) { - var b, c2; - for (c2 = l6d(bKd(a)).Kc(); c2.Ob(); ) { - b = GD(c2.Pb()); - if (Dmd(a, b)) { - return uFd((tFd(), sFd), b); - } + 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]; } - return null; - } - function n3d(a, b) { - var c2, d, e, f2, g; - g = S6d(a.e.Tg(), b); - f2 = 0; - c2 = BD(a.g, 119); - for (e = 0; e < a.i; ++e) { - d = c2[e]; - g.rl(d.ak()) && ++f2; - } - return f2; - } - function Vsd(a, b, c2) { - var d, e; - d = BD(b.We(a.a), 35); - e = BD(c2.We(a.a), 35); - return d != null && e != null ? Fcb(d, e) : d != null ? -1 : e != null ? 1 : 0; - } - function ved(a, b, c2) { - var d, e; - if (a.c) { - Efd(a.c, b, c2); + 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 { - for (e = new olb(a.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 157); - ved(d, b, c2); - } - } - } - function RUb(a, b) { - var c2, d; - for (d = new olb(b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 46); - Lkb(a.b.b, c2.b); - fVb(BD(c2.a, 189), BD(c2.b, 81)); - } - } - function tr(a) { - var b, c2; - c2 = Kfb(new Ufb(), 91); - b = true; - while (a.Ob()) { - b || (c2.a += She, c2); - b = false; - Pfb(c2, a.Pb()); - } - return (c2.a += "]", c2).a; - } - function aJd(a, b) { - var c2; - c2 = (a.Bb & oie) != 0; - b ? a.Bb |= oie : a.Bb &= -16385; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new qSd(a, 1, 16, c2, b)); - } - function MJd(a, b) { - var c2; - c2 = (a.Bb & ote) != 0; - b ? a.Bb |= ote : a.Bb &= -32769; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new qSd(a, 1, 18, c2, b)); - } - function CUd(a, b) { - var c2; - c2 = (a.Bb & ote) != 0; - b ? a.Bb |= ote : a.Bb &= -32769; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new qSd(a, 1, 18, c2, b)); - } - function EUd(a, b) { - var c2; - c2 = (a.Bb & Tje) != 0; - b ? a.Bb |= Tje : a.Bb &= -65537; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new qSd(a, 1, 20, c2, b)); - } - function Tee(a) { - var b; - b = KC(TD, $ie, 25, 2, 15, 1); - a -= Tje; - b[0] = (a >> 10) + Uje & aje; - b[1] = (a & 1023) + 56320 & aje; - return zfb(b, 0, b.length); - } - function a_b(a) { - var b, c2; - c2 = BD(vNb(a, (Nyc(), Lwc)), 103); - if (c2 == (ead(), cad)) { - b = Edb(ED(vNb(a, owc))); - return b >= 1 ? bad : _9c; - } - return c2; - } - function rec(a) { - switch (BD(vNb(a, (Nyc(), Swc)), 218).g) { - case 1: - return new Fmc(); - case 3: - return new wnc(); - default: - return new zmc(); - } - } - function Uzb(a) { - if (a.c) { - Uzb(a.c); - } else if (a.d) { - throw vbb(new Zdb("Stream already terminated, can't be modified or used")); - } - } - function Mkd(a) { - var b; - if ((a.Db & 64) != 0) - return Eid(a); - b = new Jfb(Eid(a)); - b.a += " (identifier: "; - Efb(b, a.k); - b.a += ")"; - return b.a; - } - function ctd(a, b, c2) { - var d, e; - d = (Fhd(), e = new xkd(), e); - vkd(d, b); - wkd(d, c2); - !!a && wtd((!a.a && (a.a = new xMd(y2, a, 5)), a.a), d); - return d; - } - function ttb(a, b, c2, d) { - var e, f2; - uCb(d); - uCb(c2); - e = a.xc(b); - f2 = e == null ? c2 : Myb(BD(e, 15), BD(c2, 14)); - f2 == null ? a.Bc(b) : a.zc(b, f2); - return f2; - } - function pqb(a) { - var b, c2, d, e; - c2 = (b = BD(gdb((d = a.gm, e = d.f, e == CI ? d : e)), 9), new xqb(b, BD(_Bb(b, b.length), 9), 0)); - rqb(c2, a); - return c2; - } - function hDc(a, b, c2) { - var d, e; - for (e = a.a.ec().Kc(); e.Ob(); ) { - d = BD(e.Pb(), 10); - if (Be(c2, BD(Ikb(b, d.p), 14))) { - return d; + 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); } } - return null; - } - function Db(b, c2, d) { - var e; - try { - Cb(b, c2, d); - } catch (a) { - a = ubb(a); - if (JD(a, 597)) { - e = a; - throw vbb(new ycb(e)); - } else - throw vbb(a); - } - return c2; - } - function Qbb(a, b) { - var c2; - if (Fbb(a) && Fbb(b)) { - c2 = a - b; - if (Kje < c2 && c2 < Ije) { - return c2; - } - } - return zbb(nD(Fbb(a) ? Rbb(a) : a, Fbb(b) ? Rbb(b) : b)); - } - function wbb(a, b) { - var c2; - if (Fbb(a) && Fbb(b)) { - c2 = a + b; - if (Kje < c2 && c2 < Ije) { - return c2; - } - } - return zbb(cD(Fbb(a) ? Rbb(a) : a, Fbb(b) ? Rbb(b) : b)); - } - function Ibb(a, b) { - var c2; - if (Fbb(a) && Fbb(b)) { - c2 = a * b; - if (Kje < c2 && c2 < Ije) { - return c2; - } - } - return zbb(gD(Fbb(a) ? Rbb(a) : a, Fbb(b) ? Rbb(b) : b)); - } - function V_b(a, b) { - var c2; - a.i || N_b(a); - c2 = BD(Mpb(a.g, b), 46); - return !c2 ? (mmb(), mmb(), jmb) : new Jib(a.j, BD(c2.a, 19).a, BD(c2.b, 19).a); - } - function Drb(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; - zpb(a.b); - } else { - ++a.d; - } - return d; - } - function kNb(a, b, c2) { - a.n = IC(XD, [nie, Sje], [364, 25], 14, [c2, QD($wnd.Math.ceil(b / 32))], 2); - a.o = b; - a.p = c2; - a.j = b - 1 >> 1; - a.k = c2 - 1 >> 1; - } - function Gub() { - zub(); - var a, b, c2; - c2 = yub++ + Date.now(); - a = QD($wnd.Math.floor(c2 * lke)) & nke; - b = QD(c2 - a * mke); - this.a = a ^ 1502; - this.b = b ^ kke; - } - function O_b(a) { - var b, c2, d; - b = new Rkb(); - for (d = new olb(a.j); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 11); - Ekb(b, c2.b); - } - return Qb(b), new sl(b); - } - function R_b(a) { - var b, c2, d; - b = new Rkb(); - for (d = new olb(a.j); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 11); - Ekb(b, c2.e); - } - return Qb(b), new sl(b); - } - function U_b(a) { - var b, c2, d; - b = new Rkb(); - for (d = new olb(a.j); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 11); - Ekb(b, c2.g); - } - return Qb(b), new sl(b); - } - function n6d(a) { - var b, c2; - for (c2 = o6d(bKd(WId(a))).Kc(); c2.Ob(); ) { - b = GD(c2.Pb()); - if (Dmd(a, b)) - return FFd((EFd(), DFd), b); + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; } - return null; - } - function wm(a) { - var b, c2, d; - for (c2 = 0, d = a.length; c2 < d; c2++) { - if (a[c2] == null) { - throw vbb(new Heb("at index " + c2)); - } - } - b = a; - return new amb(b); - } - function wid(a, b) { - var c2; - c2 = YKd(a.Tg(), b); - if (JD(c2, 99)) { - return BD(c2, 18); - } - throw vbb(new Wdb(ite + b + "' is not a valid reference")); - } - function Tdb(a) { - var b; - b = Hcb(a); - if (b > 34028234663852886e22) { - return Pje; - } else if (b < -34028234663852886e22) { - return Qje; - } - return b; - } - function aeb(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 Ev(a) { - var b, c2, d, e; - b = new cq(a.Hd().gc()); - e = 0; - for (d = vr(a.Hd().Kc()); d.Ob(); ) { - c2 = d.Pb(); - bq(b, c2, meb(e++)); - } - return fn(b.a); - } - function Uyb(a, b) { - var c2, d, e; - e = new Lqb(); - for (d = b.vc().Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 42); - Rhb(e, c2.cd(), Yyb(a, BD(c2.dd(), 15))); - } - return e; - } - function EZc(a, b) { - a.n.c.length == 0 && Ekb(a.n, new VZc(a.s, a.t, a.i)); - Ekb(a.b, b); - QZc(BD(Ikb(a.n, a.n.c.length - 1), 211), b); - GZc(a, b); - } - function LFb(a) { - if (a.c != a.b.b || a.i != a.g.b) { - a.a.c = KC(SI, Uhe, 1, 0, 5, 1); - Gkb(a.a, a.b); - Gkb(a.a, a.g); - a.c = a.b.b; - a.i = a.g.b; - } - return a.a; - } - function Ycc(a, b) { - var c2, d, e; - e = 0; - for (d = BD(b.Kb(a), 20).Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 17); - Ccb(DD(vNb(c2, (wtc(), ltc)))) || ++e; - } - return e; - } - function efc(a, b) { - var c2, d, e; - d = tgc(b); - e = Edb(ED(pBc(d, (Nyc(), lyc)))); - c2 = $wnd.Math.max(0, e / 2 - 0.5); - cfc(b, c2, 1); - Ekb(a, new Dfc(b, c2)); - } - function Ctc() { - Ctc = ccb; - Btc = new Dtc(ane, 0); - xtc = new Dtc("FIRST", 1); - ytc = new Dtc(Gne, 2); - ztc = new Dtc("LAST", 3); - Atc = new Dtc(Hne, 4); - } - function Aad() { - Aad = ccb; - zad = new Bad(ole, 0); - xad = new Bad("POLYLINE", 1); - wad = new Bad("ORTHOGONAL", 2); - yad = new Bad("SPLINES", 3); - } - function zYc() { - zYc = ccb; - xYc = new AYc("ASPECT_RATIO_DRIVEN", 0); - yYc = new AYc("MAX_SCALE_DRIVEN", 1); - wYc = new AYc("AREA_DRIVEN", 2); - } - function Y$c() { - Y$c = ccb; - V$c = new Z$c("P1_STRUCTURE", 0); - W$c = new Z$c("P2_PROCESSING_ORDER", 1); - X$c = new Z$c("P3_EXECUTION", 2); - } - function tVc() { - tVc = ccb; - sVc = new uVc("OVERLAP_REMOVAL", 0); - qVc = new uVc("COMPACTION", 1); - rVc = new uVc("GRAPH_SIZE_CALCULATION", 2); - } - function Jy(a, b) { - Iy(); - return My(Qie), $wnd.Math.abs(a - b) <= Qie || a == b || isNaN(a) && isNaN(b) ? 0 : a < b ? -1 : a > b ? 1 : Ny(isNaN(a), isNaN(b)); - } - function yOc(a, b) { - var c2, d; - c2 = Jsb(a, 0); - while (c2.b != c2.d.c) { - d = Gdb(ED(Xsb(c2))); - if (d == b) { - return; - } else if (d > b) { - Ysb(c2); - 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 + 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; } - Vsb(c2, b); - } - function t4c(a, b) { - var c2, d, e, f2, g; - c2 = b.f; - Xrb(a.c.d, c2, b); - if (b.g != null) { - for (e = b.g, f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - Xrb(a.c.e, d, b); + 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; + } } } - } - function Ilb(a, b, c2, d) { - var e, f2, g; - for (e = b + 1; e < c2; ++e) { - for (f2 = e; f2 > b && d.ue(a[f2 - 1], a[f2]) > 0; --f2) { - g = a[f2]; - NC(a, f2, a[f2 - 1]); - NC(a, f2 - 1, g); + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; } + return false; } - } - function did(a, b, c2, d) { - if (b < 0) { - uid(a, c2, d); + if (this._input === "") { + return this.EOF; } else { - if (!c2.Ij()) { - throw vbb(new Wdb(ite + c2.ne() + jte)); - } - BD(c2, 66).Nj().Tj(a, a.yh(), b, d); + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); } - } - function xFb(a, b) { - if (b == a.d) { - return a.e; - } else if (b == a.e) { - return a.d; + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; } else { - throw vbb(new Wdb("Node " + b + " not part of edge " + a)); + 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 iEb(a, b) { - switch (b.g) { - case 2: - return a.b; + }, "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 a.c; - case 4: - return a.d; - case 3: - return a.a; - default: - return false; - } - } - function GVb(a, b) { - switch (b.g) { + return 54; + break; case 2: - return a.b; - case 1: - return a.c; - case 4: - return a.d; - case 3: - return a.a; - default: - return false; - } - } - function Xkd(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 Ekd(a, b, c2, d); - } - function Ljc(a) { - if (a.k != (j0b(), h0b)) { - return false; - } - return FAb(new YAb(null, new Lub(new Sr(ur(U_b(a).a.Kc(), new Sq())))), new Mjc()); - } - function MEd(a) { - if (a.e == null) { - return a; - } else - !a.c && (a.c = new NEd((a.f & 256) != 0, a.i, a.a, a.d, (a.f & 16) != 0, a.j, a.g, null)); - return a.c; - } - function VC(a, b) { - if (a.h == Gje && a.m == 0 && a.l == 0) { - b && (QC = TC(0, 0, 0)); - return SC((wD(), uD)); - } - b && (QC = TC(a.l, a.m, a.h)); - return TC(0, 0, 0); - } - function fcb(a) { - var b; - if (Array.isArray(a) && a.im === gcb) { - return hdb(rb(a)) + "@" + (b = tb(a) >>> 0, b.toString(16)); - } - return a.toString(); - } - function Rpb(a) { - var b; - this.a = (b = BD(a.e && a.e(), 9), new xqb(b, BD(_Bb(b, b.length), 9), 0)); - this.b = KC(SI, Uhe, 1, this.a.a.length, 5, 1); - } - function _Ob(a) { - var b, c2, d; - this.a = new zsb(); - for (d = new olb(a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 14); - b = new MOb(); - GOb(b, c2); - Qqb(this.a, b); - } - } - function cKb(a) { - $Jb(); - var b, c2, d, e; - b = a.o.b; - for (d = BD(BD(Qc(a.r, (Ucd(), Rcd)), 21), 84).Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 111); - e = c2.e; - e.b += b; - } - } - function ag(a) { - var b; - if (a.b) { - ag(a.b); - if (a.b.d != a.c) { - throw vbb(new Apb()); - } - } else if (a.d.dc()) { - b = BD(a.f.c.xc(a.e), 14); - !!b && (a.d = b); - } - } - function fFd(a) { - var b; - if (a == null) - return true; - b = a.length; - return b > 0 && (BCb(b - 1, a.length), a.charCodeAt(b - 1) == 58) && !OEd(a, CEd, DEd); - } - function OEd(a, b, c2) { - var d, e; - for (d = 0, e = a.length; d < e; d++) { - if (_Ed((BCb(d, a.length), a.charCodeAt(d)), b, c2)) - return true; - } - return false; - } - function JOb(a, b) { - var c2, d; - for (d = a.e.a.ec().Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 266); - if (t6c(b, c2.d) || o6c(b, c2.d)) { - return true; - } - } - return false; - } - function Q9b(a, b) { - var c2, d, e; - d = N9b(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 NCd(a, b) { - LCd(); - var c2, d, e, f2; - d = KLd(a); - e = b; - Klb(d, 0, d.length, e); - for (c2 = 0; c2 < d.length; c2++) { - f2 = MCd(a, d[c2], c2); - c2 != f2 && Wxd(a, c2, f2); - } - } - function EHb(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 Htd(a) { - var b, c2, d; - d = new Hfb(); - d.a += "["; - for (b = 0, c2 = a.gc(); b < c2; ) { - Efb(d, xfb(a.ki(b))); - ++b < c2 && (d.a += She, d); - } - d.a += "]"; - return d.a; - } - function fsd(a) { - var b, c2, d, e, f2; - f2 = hsd(a); - c2 = Fhe(a.c); - d = !c2; - if (d) { - e = new wB(); - cC(f2, "knownLayouters", e); - b = new qsd(e); - reb(a.c, b); - } - return f2; - } - function Ce(a, b) { - var c2, d, e; - uCb(b); - c2 = false; - for (d = new olb(a); d.a < d.c.c.length; ) { - e = mlb(d); - if (ze(b, e, false)) { - nlb(d); - c2 = true; - } - } - return c2; - } - function UGb(a) { - var b, c2, d; - d = Edb(ED(a.a.We((Y9c(), Q9c)))); - for (c2 = new olb(a.a.xf()); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 680); - XGb(a, b, d); - } - } - function MUb(a, b) { - var c2, d; - for (d = new olb(b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 46); - Ekb(a.b.b, BD(c2.b, 81)); - eVb(BD(c2.a, 189), BD(c2.b, 81)); - } - } - function XCc(a, b, c2) { - var d, e; - e = a.a.b; - for (d = e.c.length; d < c2; d++) { - Dkb(e, 0, new H1b(a.a)); - } - $_b(b, BD(Ikb(e, e.c.length - c2), 29)); - a.b[b.p] = c2; - } - function JTb(a, b, c2) { - var d; - d = c2; - !d && (d = Ydd(new Zdd(), 0)); - Odd(d, Vme, 2); - qZb(a.b, b, Udd(d, 1)); - LTb(a, b, Udd(d, 1)); - _Yb(b, Udd(d, 1)); - Qdd(d); - } - function eKc(a, b, c2, d, e) { - FJc(); - AFb(DFb(CFb(BFb(EFb(new FFb(), 0), e.d.e - a), b), e.d)); - AFb(DFb(CFb(BFb(EFb(new FFb(), 0), c2 - e.a.e), e.a), d)); - } - function e$c(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 && q$c(this.c, this.b, this.a); - } - function ezc(a) { - dzc(); - this.c = Ou(OC(GC(h0, 1), Uhe, 831, 0, [Uyc])); - this.b = new Lqb(); - this.a = a; - Rhb(this.b, bzc, 1); - Hkb(czc, new Xed(this)); - } - function I2c(a, b) { - var c2; - if (a.d) { - if (Mhb(a.b, b)) { - return BD(Ohb(a.b, b), 51); - } else { - c2 = b.Kf(); - Rhb(a.b, b, c2); - return c2; - } - } else { - return b.Kf(); - } - } - function Kgb(a, b) { - var c2; - if (PD(a) === PD(b)) { - return true; - } - if (JD(b, 91)) { - c2 = BD(b, 91); - return a.e == c2.e && a.d == c2.d && Lgb(a, c2.a); - } - return false; - } - function Zcd(a) { - Ucd(); - switch (a.g) { - case 4: - return Acd; - case 1: - return zcd; - case 3: - return Rcd; - case 2: - return Tcd; - default: - return Scd; - } - } - function Ykd(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 Hkd(a, b); - } - function gWc(a) { - switch (a.g) { - case 0: - return new FXc(); - case 1: - return new IXc(); - default: - throw vbb(new Wdb(jre + (a.f != null ? a.f : "" + a.g))); - } - } - function QUc(a) { - switch (a.g) { - case 0: - return new CXc(); - case 1: - return new MXc(); - default: - throw vbb(new Wdb(Dne + (a.f != null ? a.f : "" + a.g))); - } - } - function b1c(a) { - switch (a.g) { - case 0: - return new s1c(); - case 1: - return new w1c(); - default: - throw vbb(new Wdb(Mre + (a.f != null ? a.f : "" + a.g))); - } - } - function qWc(a) { - switch (a.g) { - case 1: - return new SVc(); - case 2: - return new KVc(); - default: - throw vbb(new Wdb(jre + (a.f != null ? a.f : "" + a.g))); - } - } - function ryb(a) { - var b, c2; - if (a.b) { - return a.b; - } - c2 = lyb ? null : a.d; - while (c2) { - b = lyb ? null : c2.b; - if (b) { - return b; - } - c2 = lyb ? null : c2.d; - } - return $xb(), Zxb; - } - function hhb(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 = Mgb(a); - if (d == a.d - 1) { - --c2; - c2 = c2 | 0; - } - } - b -= heb(c2); - return b; - } - function bhb(a) { - var b, c2, d; - if (a < Fgb.length) { - return Fgb[a]; - } - c2 = a >> 5; - b = a & 31; - d = KC(WD, oje, 25, c2 + 1, 15, 1); - d[c2] = 1 << b; - return new Vgb(1, c2 + 1, d); - } - function O2b(a) { - var b, c2, d; - c2 = a.zg(); - if (c2) { - b = a.Ug(); - if (JD(b, 160)) { - d = O2b(BD(b, 160)); - if (d != null) { - return d + "." + c2; - } - } - return c2; - } - return null; - } - function ze(a, b, c2) { - var d, e; - for (e = a.Kc(); e.Ob(); ) { - d = e.Pb(); - if (PD(b) === PD(d) || b != null && pb(b, d)) { - c2 && e.Qb(); - return true; - } - } - return false; - } - function zvd(a, b, c2) { - var d, e; - ++a.j; - if (c2.dc()) { - return false; - } else { - for (e = c2.Kc(); e.Ob(); ) { - d = e.Pb(); - a.Hi(b, a.oi(b, d)); - ++b; - } - return true; - } - } - function yA(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; - } - d.i = a; - return true; - } - function XUb(a) { - LUb(); - return Bcb(), GVb(BD(a.a, 81).j, BD(a.b, 103)) || BD(a.a, 81).d.e != 0 && GVb(BD(a.a, 81).j, BD(a.b, 103)) ? true : false; - } - function s3c(a) { - p3c(); - if (BD(a.We((Y9c(), b9c)), 174).Hc((Idd(), Gdd))) { - BD(a.We(x9c), 174).Fc((rcd(), qcd)); - BD(a.We(b9c), 174).Mc(Gdd); - } - } - function Gxd(a, b) { - var c2, d; - if (!b) { - return false; - } else { - for (c2 = 0; c2 < a.i; ++c2) { - d = BD(a.g[c2], 366); - if (d.Di(b)) { - return false; - } - } - return wtd(a, b); - } - } - function pvd(a) { - var b, c2, d, e; - b = new wB(); - for (e = new Dnb(a.b.Kc()); e.b.Ob(); ) { - d = BD(e.b.Pb(), 686); - c2 = lsd(d); - uB(b, b.a.length, c2); - } - return b.a; - } - function cLb(a) { - var b; - !a.c && (a.c = new VKb()); - Okb(a.d, new jLb()); - _Kb(a); - b = UKb(a); - MAb(new YAb(null, new Kub(a.d, 16)), new CLb(a)); - return b; - } - function mKd(a) { - var b; - if ((a.Db & 64) != 0) - return qnd(a); - b = new Jfb(qnd(a)); - b.a += " (instanceClassName: "; - Efb(b, a.D); - b.a += ")"; - return b.a; - } - function Pqd(a, b) { - var c2, d, e, f2; - if (b) { - e = Xpd(b, "x"); - c2 = new bsd(a); - hmd(c2.a, (uCb(e), e)); - f2 = Xpd(b, "y"); - d = new csd(a); - imd(d.a, (uCb(f2), f2)); - } - } - function Eqd(a, b) { - var c2, d, e, f2; - if (b) { - e = Xpd(b, "x"); - c2 = new Yrd(a); - omd(c2.a, (uCb(e), e)); - f2 = Xpd(b, "y"); - d = new _rd(a); - pmd(d.a, (uCb(f2), f2)); - } - } - function bLd(a, b) { - var c2, d, e; - c2 = (a.i == null && TKd(a), a.i); - d = b.aj(); - if (d != -1) { - for (e = c2.length; d < e; ++d) { - if (c2[d] == b) { - return d; - } - } - } - return -1; - } - function tNd(a) { - var b, c2, d, e, f2; - c2 = BD(a.g, 674); - for (d = a.i - 1; d >= 0; --d) { - b = c2[d]; - for (e = 0; e < d; ++e) { - f2 = c2[e]; - if (uNd(a, b, f2)) { - tud(a, d); - break; - } - } - } - } - function jCb(b) { - var c2 = b.e; - function d(a) { - if (!a || a.length == 0) { - return ""; - } - return " " + a.join("\n "); - } - return c2 && (c2.stack || d(b[Yie])); - } - function nm(a) { - im(); - var b; - b = a.Pc(); - switch (b.length) { - case 0: - return hm; - case 1: - return new my(Qb(b[0])); - default: - return new ux(wm(b)); - } - } - function W_b(a, b) { - switch (b.g) { - case 1: - return Nq(a.j, (z0b(), u0b)); - case 2: - return Nq(a.j, (z0b(), w0b)); - default: - return mmb(), mmb(), jmb; - } - } - function $kd(a, b) { - switch (b) { + return 55; + break; case 3: - ald(a, 0); - return; + return 56; + break; case 4: - cld(a, 0); - return; + break; case 5: - dld(a, 0); - return; + break; case 6: - eld(a, 0); - return; - } - Jkd(a, b); - } - function dzc() { - dzc = ccb; - Vyc(); - bzc = (Nyc(), vyc); - czc = Ou(OC(GC(Q3, 1), zqe, 146, 0, [kyc, lyc, nyc, oyc, ryc, syc, tyc, uyc, xyc, zyc, myc, pyc, wyc])); - } - function Y9b(a) { - var b, c2; - b = a.d == (Apc(), vpc); - c2 = U9b(a); - b && !c2 || !b && c2 ? yNb(a.a, (Nyc(), mwc), (F7c(), D7c)) : yNb(a.a, (Nyc(), mwc), (F7c(), C7c)); - } - function XAb(a, b) { - var c2; - c2 = BD(GAb(a, Byb(new fzb(), new dzb(), new Ezb(), OC(GC(xL, 1), Kie, 132, 0, [(Fyb(), Dyb)]))), 15); - return c2.Qc(aBb(c2.gc())); - } - function Ded() { - Ded = ccb; - Ced = new Eed("SIMPLE", 0); - zed = new Eed("GROUP_DEC", 1); - Bed = new Eed("GROUP_MIXED", 2); - Aed = new Eed("GROUP_INC", 3); - } - function CWd() { - CWd = ccb; - AWd = new DWd(); - tWd = new GWd(); - uWd = new JWd(); - vWd = new MWd(); - wWd = new PWd(); - xWd = new SWd(); - yWd = new VWd(); - zWd = new YWd(); - BWd = new _Wd(); - } - function FHb(a, b, c2) { - tHb(); - oHb.call(this); - this.a = IC(oN, [nie, ile], [595, 212], 0, [sHb, rHb], 2); - this.c = new I6c(); - this.g = a; - this.f = b; - this.d = c2; - } - function pNb(a, b) { - this.n = IC(XD, [nie, Sje], [364, 25], 14, [b, QD($wnd.Math.ceil(a / 32))], 2); - this.o = a; - this.p = b; - this.j = a - 1 >> 1; - this.k = b - 1 >> 1; - } - function r3b(a, b) { - Odd(b, "End label post-processing", 1); - MAb(JAb(LAb(new YAb(null, new Kub(a.b, 16)), new w3b()), new y3b()), new A3b()); - Qdd(b); - } - function NLc(a, b, c2) { - var d, e; - d = Edb(a.p[b.i.p]) + Edb(a.d[b.i.p]) + b.n.b + b.a.b; - e = Edb(a.p[c2.i.p]) + Edb(a.d[c2.i.p]) + c2.n.b + c2.a.b; - return e - d; - } - function xhb(a, b, c2) { - var d, e; - d = xbb(c2, Yje); - for (e = 0; ybb(d, 0) != 0 && e < b; e++) { - d = wbb(d, xbb(a[e], Yje)); - a[e] = Tbb(d); - d = Obb(d, 32); - } - return Tbb(d); - } - function $Ed(a) { - var b, c2, d, e; - e = 0; - for (c2 = 0, d = a.length; c2 < d; c2++) { - b = (BCb(c2, a.length), a.charCodeAt(c2)); - b < 64 && (e = Mbb(e, Nbb(1, b))); - } - return e; - } - function S9d(a) { - var b; - return a == null ? null : new Ygb((b = Qge(a, true), b.length > 0 && (BCb(0, b.length), b.charCodeAt(0) == 43) ? b.substr(1) : b)); - } - function T9d(a) { - var b; - return a == null ? null : new Ygb((b = Qge(a, true), b.length > 0 && (BCb(0, b.length), b.charCodeAt(0) == 43) ? b.substr(1) : b)); - } - function xud(a, b) { - var c2; - if (a.i > 0) { - if (b.length < a.i) { - c2 = izd(rb(b).c, a.i); - b = c2; - } - $fb(a.g, 0, b, 0, a.i); - } - b.length > a.i && NC(b, a.i, null); - return b; - } - function Sxd(a, b, c2) { - var d, e, f2; - if (a.ej()) { - d = a.i; - f2 = a.fj(); - kud(a, d, b); - e = a.Zi(3, null, b, d, f2); - !c2 ? c2 = e : c2.Ei(e); - } else { - kud(a, a.i, b); - } - return c2; - } - function HMd(a, b, c2) { - var d, e; - d = new pSd(a.e, 4, 10, (e = b.c, JD(e, 88) ? BD(e, 26) : (jGd(), _Fd)), null, HLd(a, b), false); - !c2 ? c2 = d : c2.Ei(d); - return c2; - } - function GMd(a, b, c2) { - var d, e; - d = new pSd(a.e, 3, 10, null, (e = b.c, JD(e, 88) ? BD(e, 26) : (jGd(), _Fd)), HLd(a, b), false); - !c2 ? c2 = d : c2.Ei(d); - return c2; - } - function _Jb(a) { - $Jb(); - var b; - b = new g7c(BD(a.e.We((Y9c(), _8c)), 8)); - if (a.B.Hc((Idd(), Bdd))) { - b.a <= 0 && (b.a = 20); - b.b <= 0 && (b.b = 20); - } - return b; - } - function Lzc(a) { - Izc(); - var b; - (!a.q ? (mmb(), mmb(), kmb) : a.q)._b((Nyc(), Cxc)) ? b = BD(vNb(a, Cxc), 197) : b = BD(vNb(Q_b(a), Dxc), 197); - return b; - } - function pBc(a, b) { - var c2, d; - d = null; - if (wNb(a, (Nyc(), qyc))) { - c2 = BD(vNb(a, qyc), 94); - c2.Xe(b) && (d = c2.We(b)); - } - d == null && (d = vNb(Q_b(a), b)); - return d; - } - function Ze(a, b) { - var c2, d, e; - if (JD(b, 42)) { - c2 = BD(b, 42); - d = c2.cd(); - e = Hv(a.Rc(), d); - return Hb(e, c2.dd()) && (e != null || a.Rc()._b(d)); - } - return false; - } - function qAd(a, b) { - var c2, d, e; - if (a.f > 0) { - a.qj(); - d = b == null ? 0 : tb(b); - e = (d & Ohe) % a.d.length; - c2 = xAd(a, e, d, b); - return c2 != -1; - } else { - return false; - } - } - function AAd(a, b) { - var c2, d, e; - if (a.f > 0) { - a.qj(); - d = b == null ? 0 : tb(b); - e = (d & Ohe) % a.d.length; - c2 = wAd(a, e, d, b); - if (c2) { - return c2.dd(); - } - } - return null; - } - function R2d(a, b) { - var c2, d, e, f2; - f2 = S6d(a.e.Tg(), b); - c2 = BD(a.g, 119); - for (e = 0; e < a.i; ++e) { - d = c2[e]; - if (f2.rl(d.ak())) { - return false; - } - } - return true; - } - function B6d(a) { - if (a.b == null) { - while (a.a.Ob()) { - a.b = a.a.Pb(); - if (!BD(a.b, 49).Zg()) { - return true; - } - } - a.b = null; - return false; - } else { - return true; - } - } - function Myd(b, c2) { - b.mj(); - try { - b.d.Vc(b.e++, c2); - b.f = b.d.j; - b.g = -1; - } catch (a) { - a = ubb(a); - if (JD(a, 73)) { - throw vbb(new Apb()); - } else - throw vbb(a); - } - } - function IA(a, b) { - GA(); - var c2, d; - c2 = LA((KA(), KA(), JA)); - d = null; - b == c2 && (d = BD(Phb(FA, a), 615)); - if (!d) { - d = new HA(a); - b == c2 && Shb(FA, a, d); - } - return d; - } - function Epb(a, b) { - var c2, d; - a.a = wbb(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; - } - function ogb(a, b) { - var c2; - a.c = b; - a.a = hhb(b); - a.a < 54 && (a.f = (c2 = b.d > 1 ? Mbb(Nbb(b.a[1], 32), xbb(b.a[0], Yje)) : xbb(b.a[0], Yje), Sbb(Ibb(b.e, c2)))); - } - function Hbb(a, b) { - var c2; - if (Fbb(a) && Fbb(b)) { - c2 = a % b; - if (Kje < c2 && c2 < Ije) { - return c2; - } - } - return zbb((UC(Fbb(a) ? Rbb(a) : a, Fbb(b) ? Rbb(b) : b, true), QC)); - } - function p5b(a, b) { - var c2; - m5b(b); - c2 = BD(vNb(a, (Nyc(), Rwc)), 276); - !!c2 && yNb(a, Rwc, Tqc(c2)); - n5b(a.c); - n5b(a.f); - o5b(a.d); - o5b(BD(vNb(a, wxc), 207)); - } - function rHc(a) { - this.e = KC(WD, oje, 25, a.length, 15, 1); - this.c = KC(sbb, dle, 25, a.length, 16, 1); - this.b = KC(sbb, dle, 25, a.length, 16, 1); - this.f = 0; - } - function BDc(a) { - var b, c2; - a.j = KC(UD, Vje, 25, a.p.c.length, 15, 1); - for (c2 = new olb(a.p); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 10); - a.j[b.p] = b.o.b / a.i; - } - } - function yic(a) { - var b; - if (a.c == 0) { - return; - } - b = BD(Ikb(a.a, a.b), 287); - b.b == 1 ? (++a.b, a.b < a.a.c.length && Cic(BD(Ikb(a.a, a.b), 287))) : --b.b; - --a.c; - } - function eac(a) { - var b; - b = a.a; - do { - b = BD(Rr(new Sr(ur(U_b(b).a.Kc(), new Sq()))), 17).d.i; - b.k == (j0b(), g0b) && Ekb(a.e, b); - } while (b.k == (j0b(), g0b)); - } - function idd() { - idd = ccb; - fdd = new q0b(15); - edd = new Osd((Y9c(), f9c), fdd); - hdd = new Osd(T9c, 15); - gdd = new Osd(E9c, meb(0)); - ddd = new Osd(r8c, tme); - } - function tdd() { - tdd = ccb; - rdd = new udd("PORTS", 0); - sdd = new udd("PORT_LABELS", 1); - qdd = new udd("NODE_LABELS", 2); - pdd = new udd("MINIMUM_SIZE", 3); - } - function Ree(a, b) { - var c2, d; - d = b.length; - for (c2 = 0; c2 < d; c2 += 2) - Ufe(a, (BCb(c2, b.length), b.charCodeAt(c2)), (BCb(c2 + 1, b.length), b.charCodeAt(c2 + 1))); - } - function _Zc(a, b, c2) { - var d, e, f2, g; - f2 = b - a.e; - g = c2 - a.f; - for (e = new olb(a.a); e.a < e.c.c.length; ) { - d = BD(mlb(e), 187); - OZc(d, d.s + f2, d.t + g); - } - a.e = b; - a.f = c2; - } - function jUc(a, b) { - var c2, d, e, f2; - f2 = b.b.b; - a.a = new Psb(); - a.b = KC(WD, oje, 25, f2, 15, 1); - c2 = 0; - for (e = Jsb(b.b, 0); e.b != e.d.c; ) { - d = BD(Xsb(e), 86); - d.g = c2++; - } - } - function ihb(a, b) { - var c2, d, e, f2; - c2 = b >> 5; - b &= 31; - e = a.d + c2 + (b == 0 ? 0 : 1); - d = KC(WD, oje, 25, e, 15, 1); - jhb(d, a.a, c2, b); - f2 = new Vgb(a.e, e, d); - Jgb(f2); - return f2; - } - function Ofe(a, b, c2) { - var d, e; - d = BD(Phb(Zee, b), 117); - e = BD(Phb($ee, b), 117); - if (c2) { - Shb(Zee, a, d); - Shb($ee, a, e); - } else { - Shb($ee, a, d); - Shb(Zee, a, e); - } - } - function Cwb(a, b, c2) { - var d, e, f2; - e = null; - f2 = a.b; - while (f2) { - d = a.a.ue(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; - } - function Dwb(a, b, c2) { - var d, e, f2; - e = null; - f2 = a.b; - while (f2) { - d = a.a.ue(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 Nic(a, b, c2, d) { - var e, f2, g; - e = false; - if (fjc(a.f, c2, d)) { - ijc(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 QHc(a, b, c2, d, e) { - var f2, g, h; - g = e; - while (b.b != b.c) { - f2 = BD(fkb(b), 10); - h = BD(V_b(f2, d).Xb(0), 11); - a.d[h.p] = g++; - c2.c[c2.c.length] = h; - } - return g; - } - function hBc(a, b, c2) { - var d, e, f2, g, h; - g = a.k; - h = b.k; - d = c2[g.g][h.g]; - e = ED(pBc(a, d)); - f2 = ED(pBc(b, d)); - return $wnd.Math.max((uCb(e), e), (uCb(f2), f2)); - } - function zZc(a, b, c2) { - var d, e, f2, g; - d = c2 / a.c.length; - e = 0; - for (g = new olb(a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 200); - w$c(f2, f2.f + d * e); - t$c(f2, b, d); - ++e; - } - } - function hnc(a, b, c2) { - var d, e, f2, g; - e = BD(Ohb(a.b, c2), 177); - d = 0; - for (g = new olb(b.j); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 113); - e[f2.d.p] && ++d; - } - return d; - } - function mzd(a) { - var b, c2; - b = BD(Ajd(a.a, 4), 126); - if (b != null) { - c2 = KC($3, hve, 415, b.length, 0, 1); - $fb(b, 0, c2, 0, b.length); - return c2; - } else { - return jzd; - } - } - function Cz() { - var a; - if (xz != 0) { - a = sz(); - if (a - yz > 2e3) { - yz = a; - zz = $wnd.setTimeout(Iz, 10); - } - } - if (xz++ == 0) { - Lz((Kz(), Jz)); - return true; - } - return false; - } - function wCc(a, b) { - var c2, d, e; - for (d = new Sr(ur(U_b(a).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 17); - e = c2.d.i; - if (e.c == b) { - return false; - } - } - return true; - } - function Ek(b, c2) { - var d, e; - if (JD(c2, 245)) { - e = BD(c2, 245); - try { - d = b.vd(e); - return d == 0; - } catch (a) { - a = ubb(a); - if (!JD(a, 205)) - throw vbb(a); - } - } - return false; - } - function Xz() { - if (Error.stackTraceLimit > 0) { - $wnd.Error.stackTraceLimit = Error.stackTraceLimit = 64; - return true; - } - return "stack" in new Error(); - } - function BDb(a, b) { - return Iy(), Iy(), My(Qie), ($wnd.Math.abs(a - b) <= Qie || a == b || isNaN(a) && isNaN(b) ? 0 : a < b ? -1 : a > b ? 1 : Ny(isNaN(a), isNaN(b))) > 0; - } - function DDb(a, b) { - return Iy(), Iy(), My(Qie), ($wnd.Math.abs(a - b) <= Qie || a == b || isNaN(a) && isNaN(b) ? 0 : a < b ? -1 : a > b ? 1 : Ny(isNaN(a), isNaN(b))) < 0; - } - function CDb(a, b) { - return Iy(), Iy(), My(Qie), ($wnd.Math.abs(a - b) <= Qie || a == b || isNaN(a) && isNaN(b) ? 0 : a < b ? -1 : a > b ? 1 : Ny(isNaN(a), isNaN(b))) <= 0; - } - function ydb(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; - } - function zfb(a, b, c2) { - var d, e, f2, g; - f2 = b + c2; - ACb(b, f2, a.length); - g = ""; - for (e = b; e < f2; ) { - d = $wnd.Math.min(e + 1e4, f2); - g += vfb(a.slice(e, d)); - e = d; - } - return g; - } - function N9d(a) { - var b, c2, d, e, f2; - if (a == null) - return null; - f2 = new Rkb(); - for (c2 = Zmd(a), d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - Ekb(f2, Qge(b, true)); - } - return f2; - } - function Q9d(a) { - var b, c2, d, e, f2; - if (a == null) - return null; - f2 = new Rkb(); - for (c2 = Zmd(a), d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - Ekb(f2, Qge(b, true)); - } - return f2; - } - function R9d(a) { - var b, c2, d, e, f2; - if (a == null) - return null; - f2 = new Rkb(); - for (c2 = Zmd(a), d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - Ekb(f2, Qge(b, true)); - } - return f2; - } - function ted(a, b) { - var c2, d, e; - if (a.c) { - cld(a.c, b); - } else { - c2 = b - red(a); - for (e = new olb(a.d); e.a < e.c.c.length; ) { - d = BD(mlb(e), 157); - ted(d, red(d) + c2); - } - } - } - function sed(a, b) { - var c2, d, e; - if (a.c) { - ald(a.c, b); - } else { - c2 = b - qed(a); - for (e = new olb(a.a); e.a < e.c.c.length; ) { - d = BD(mlb(e), 157); - sed(d, qed(d) + c2); - } - } - } - function t6d(a, b) { - var c2, d, e, f2; - e = new Skb(b.gc()); - for (d = b.Kc(); d.Ob(); ) { - c2 = d.Pb(); - f2 = s6d(a, BD(c2, 56)); - !!f2 && (e.c[e.c.length] = f2, true); - } - return e; - } - function LAd(a, b) { - var c2, d, e; - a.qj(); - d = b == null ? 0 : tb(b); - e = (d & Ohe) % a.d.length; - c2 = wAd(a, e, d, b); - if (c2) { - JAd(a, c2); - return c2.dd(); - } else { - return null; - } - } - function rde(a) { - var b, c2; - c2 = sde(a); - b = null; - while (a.c == 2) { - nde(a); - if (!b) { - b = (wfe(), wfe(), new Lge(2)); - Kge(b, c2); - c2 = b; - } - c2.$l(sde(a)); - } - return c2; - } - function Wpd(a) { - var b, c2, d; - d = null; - b = Vte in a.a; - c2 = !b; - if (c2) { - throw vbb(new cqd("Every element must have an id.")); - } - d = Vpd(aC(a, Vte)); - return d; - } - function jid(a) { - var b, c2, d; - d = a.Zg(); - if (!d) { - b = 0; - for (c2 = a.eh(); c2; c2 = c2.eh()) { - if (++b > Wje) { - return c2.fh(); - } - d = c2.Zg(); - if (!!d || c2 == a) { - break; - } - } - } - return d; - } - function fvd(a) { - evd(); - if (JD(a, 156)) { - return BD(Ohb(cvd, hK), 288).vg(a); - } - if (Mhb(cvd, rb(a))) { - return BD(Ohb(cvd, rb(a)), 288).vg(a); - } - return null; - } - function fZd(a) { - if (efb(kse, a)) { - return Bcb(), Acb; - } else if (efb(lse, a)) { - return Bcb(), zcb; - } else { - throw vbb(new Wdb("Expecting true or false")); - } - } - function uDc(a, b) { - if (b.c == a) { - return b.d; - } else if (b.d == a) { - return b.c; - } - throw vbb(new Wdb("Input edge is not connected to the input port.")); - } - function Igb(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 * whb(a.a, b.a, a.d); - } - function Zcb(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 Ue(a, b) { - var c2; - if (PD(b) === PD(a)) { - return true; - } - if (!JD(b, 21)) { - return false; - } - c2 = BD(b, 21); - if (c2.gc() != a.gc()) { - return false; - } - return a.Ic(c2); - } - function ekb(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; - mkb(c2 < e); - if (c2 >= f2) { - hkb(a, b); - return -1; - } else { - ikb(a, b); - return 1; - } - } - function lA(a, b) { - var c2, d; - c2 = (BCb(b, a.length), a.charCodeAt(b)); - d = b + 1; - while (d < a.length && (BCb(d, a.length), a.charCodeAt(d) == c2)) { - ++d; - } - return d - b; - } - function sJb(a) { - switch (a.g) { + 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: - return true; - default: - return false; - } - } - function bC(f2, a) { - var b = f2.a; - var c2; - a = String(a); - b.hasOwnProperty(a) && (c2 = b[a]); - var d = (rC(), qC)[typeof c2]; - var e = d ? d(c2) : xC(typeof c2); - return e; - } - function b3c(a, b) { - if (a.a < 0) { - throw vbb(new Zdb("Did not call before(...) or after(...) before calling add(...).")); - } - i3c(a, a.a, b); - return a; - } - function VOc(a, b, c2, d) { - var e, f2; - if (b.c.length == 0) { - return; - } - e = ROc(c2, d); - f2 = QOc(b); - MAb(VAb(new YAb(null, new Kub(f2, 1)), new cPc()), new gPc(a, c2, e, d)); - } - function Cjd(a, b, c2) { - var d; - if ((a.Db & b) != 0) { - if (c2 == null) { - Bjd(a, b); - } else { - d = zjd(a, b); - d == -1 ? a.Eb = c2 : NC(CD(a.Eb), d, c2); - } - } else - c2 != null && vjd(a, b, c2); - } - function yjd(a) { - var b, c2; - if ((a.Db & 32) == 0) { - c2 = (b = BD(Ajd(a, 16), 26), aLd(!b ? a.zh() : b) - aLd(a.zh())); - c2 != 0 && Cjd(a, 32, KC(SI, Uhe, 1, c2, 5, 1)); - } - return a; - } - function W1d(a) { - var b; - a.b || X1d(a, (b = h1d(a.e, a.a), !b || !dfb(lse, AAd((!b.b && (b.b = new sId((jGd(), fGd), x6, b)), b.b), "qualified")))); - return a.c; - } - function dTd(a, b, c2) { - var d, e, f2; - d = BD(qud(QSd(a.a), b), 87); - f2 = (e = d.c, e ? e : (jGd(), YFd)); - (f2.kh() ? xid(a.b, BD(f2, 49)) : f2) == c2 ? KQd(d) : NQd(d, c2); - return f2; - } - function fCb(a, b) { - (!b && console.groupCollapsed != null ? console.groupCollapsed : console.group != null ? console.group : console.log).call(console, a); - } - function NNb(a, b, c2, d) { - d == a ? (BD(c2.b, 65), BD(c2.b, 65), BD(d.b, 65), BD(d.b, 65).c.b) : (BD(c2.b, 65), BD(c2.b, 65), BD(d.b, 65), BD(d.b, 65).c.b); - KNb(d, b, a); - } - function EOb(a) { - var c2, d; - for (c2 = new olb(a.g); c2.a < c2.c.c.length; ) { - BD(mlb(c2), 562); - } - d = new ENb(a.g, Edb(a.a), a.c); - ELb(d); - a.g = d.b; - a.d = d.a; - } - function ymc(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 MIc(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); - } - function efb(a, b) { - uCb(a); - if (b == null) { - return false; - } - if (dfb(a, b)) { - return true; - } - return a.length == b.length && dfb(a.toLowerCase(), b.toLowerCase()); - } - function x6d(a, b) { - var c2, d, e, f2; - for (d = 0, e = b.gc(); d < e; ++d) { - c2 = b.il(d); - if (JD(c2, 99) && (BD(c2, 18).Bb & ote) != 0) { - f2 = b.jl(d); - f2 != null && s6d(a, BD(f2, 56)); - } - } - } - function p1c(a, b, c2) { - var d, e, f2; - for (f2 = new olb(c2.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 221); - d = new hDb(BD(Ohb(a.a, e.b), 65)); - Ekb(b.a, d); - p1c(a, d, e); - } - } - function Aeb(a) { - var b, c2; - if (ybb(a, -129) > 0 && ybb(a, 128) < 0) { - b = Tbb(a) + 128; - c2 = (Ceb(), Beb)[b]; - !c2 && (c2 = Beb[b] = new teb(a)); - return c2; - } - return new teb(a); - } - function _0d(a, b) { - var c2, d; - c2 = b.Hh(a.a); - if (c2) { - d = GD(AAd((!c2.b && (c2.b = new sId((jGd(), fGd), x6, c2)), c2.b), fue)); - if (d != null) { - return d; - } - } - return b.ne(); - } - function a1d(a, b) { - var c2, d; - c2 = b.Hh(a.a); - if (c2) { - d = GD(AAd((!c2.b && (c2.b = new sId((jGd(), fGd), x6, c2)), c2.b), fue)); - if (d != null) { - return d; - } - } - return b.ne(); - } - function FMc(a, b) { - wMc(); - var c2, d; - for (d = new Sr(ur(O_b(a).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 17); - if (c2.d.i == b || c2.c.i == b) { - return c2; - } - } - return null; - } - function HUb(a, b, c2) { - this.c = a; - this.f = new Rkb(); - this.e = new d7c(); - this.j = new IVb(); - this.n = new IVb(); - this.b = b; - this.g = new J6c(b.c, b.d, b.b, b.a); - this.a = c2; - } - function gVb(a) { - var b, c2, d, e; - this.a = new zsb(); - this.d = new Tqb(); - this.e = 0; - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - !this.f && (this.f = b); - eVb(this, b); - } - } - function Xgb(a) { - Hgb(); - if (a.length == 0) { - this.e = 0; - this.d = 1; - this.a = OC(GC(WD, 1), oje, 25, 15, [0]); - } else { - this.e = 1; - this.d = a.length; - this.a = a; - Jgb(this); - } - } - function mIb(a, b, c2) { - oHb.call(this); - this.a = KC(oN, ile, 212, (gHb(), OC(GC(pN, 1), Kie, 232, 0, [dHb, eHb, fHb])).length, 0, 1); - this.b = a; - this.d = b; - this.c = c2; - } - function Kjc(a) { - this.d = new Rkb(); - this.e = new $rb(); - this.c = KC(WD, oje, 25, (Ucd(), OC(GC(F1, 1), bne, 61, 0, [Scd, Acd, zcd, Rcd, Tcd])).length, 15, 1); - this.b = a; - } - function Vbc(a) { - var b, c2, d, e, f2, g; - g = BD(vNb(a, (wtc(), $sc)), 11); - yNb(g, qtc, a.i.n.b); - b = k_b(a.e); - for (d = b, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - RZb(c2, g); - } - } - function Wbc(a) { - var b, c2, d, e, f2, g; - c2 = BD(vNb(a, (wtc(), $sc)), 11); - yNb(c2, qtc, a.i.n.b); - b = k_b(a.g); - for (e = b, f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - QZb(d, c2); - } - } - function vcc(a) { - var b, c2; - if (wNb(a.d.i, (Nyc(), Nxc))) { - b = BD(vNb(a.c.i, Nxc), 19); - c2 = BD(vNb(a.d.i, Nxc), 19); - return beb(b.a, c2.a) > 0; - } else { - return false; - } - } - function q2c(a) { - var b; - if (PD(hkd(a, (Y9c(), J8c))) === PD((hbd(), fbd))) { - if (!Xod(a)) { - jkd(a, J8c, gbd); - } else { - b = BD(hkd(Xod(a), J8c), 334); - jkd(a, J8c, b); - } - } - } - function ijc(a, b, c2) { - var d, e; - bIc(a.e, b, c2, (Ucd(), Tcd)); - bIc(a.i, b, c2, zcd); - if (a.a) { - e = BD(vNb(b, (wtc(), $sc)), 11); - d = BD(vNb(c2, $sc), 11); - cIc(a.g, e, d); - } - } - function OEc(a, b, c2) { - var d, e, f2; - d = b.c.p; - f2 = b.p; - a.b[d][f2] = new $Ec(a, b); - if (c2) { - a.a[d][f2] = new FEc(b); - e = BD(vNb(b, (wtc(), Psc)), 10); - !!e && Rc(a.d, e, b); - } - } - function TPb(a, b) { - var c2, d, e; - Ekb(PPb, a); - b.Fc(a); - c2 = BD(Ohb(OPb, a), 21); - if (c2) { - for (e = c2.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 33); - Jkb(PPb, d, 0) != -1 || TPb(d, b); - } - } - } - function tyb(a, b, c2) { - var d; - (jyb ? (ryb(a), true) : kyb ? ($xb(), true) : nyb ? ($xb(), true) : myb && ($xb(), false)) && (d = new iyb(b), d.b = c2, pyb(a, d), void 0); - } - function xKb(a, b) { - var c2; - c2 = !a.A.Hc((tdd(), sdd)) || a.q == (dcd(), $bd); - a.u.Hc((rcd(), ncd)) ? c2 ? vKb(a, b) : zKb(a, b) : a.u.Hc(pcd) && (c2 ? wKb(a, b) : AKb(a, b)); - } - function b0d(a, b) { - var c2, d; - ++a.j; - if (b != null) { - c2 = (d = a.a.Cb, JD(d, 97) ? BD(d, 97).Jg() : null); - if (xlb(b, c2)) { - Cjd(a.a, 4, c2); - return; - } - } - Cjd(a.a, 4, BD(b, 126)); - } - function dYb(a, b, c2) { - return new J6c($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 k4b(a, b) { - var c2, d; - c2 = beb(a.a.c.p, b.a.c.p); - if (c2 != 0) { - return c2; - } - d = beb(a.a.d.i.p, b.a.d.i.p); - if (d != 0) { - return d; - } - return beb(b.a.d.p, a.a.d.p); - } - function _Dc(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 : Kdb(d, e); - } - } - function HFb(a, b, c2) { - var d, e, f2; - if (c2[b.d]) { - return; - } - c2[b.d] = true; - for (e = new olb(LFb(b)); e.a < e.c.c.length; ) { - d = BD(mlb(e), 213); - f2 = xFb(d, b); - HFb(a, f2, c2); - } - } - function umc(a, b, c2) { - var d; - d = c2[a.g][b]; - switch (a.g) { - case 1: - case 3: - return new f7c(0, d); - case 2: - case 4: - return new f7c(d, 0); - default: - return null; - } - } - function r2c(b, c2, d) { - var e, f2; - f2 = BD(hgd(c2.f), 209); - try { - f2.Ze(b, d); - igd(c2.f, f2); - } catch (a) { - a = ubb(a); - if (JD(a, 102)) { - e = a; - throw vbb(e); - } else - throw vbb(a); - } - } - function Vqd(a, b, c2) { - var d, e, f2, g, h, i3; - d = null; - h = k4c(n4c(), b); - f2 = null; - if (h) { - e = null; - i3 = o5c(h, c2); - g = null; - i3 != null && (g = a.Ye(h, i3)); - e = g; - f2 = e; - } - d = f2; - return d; - } - function TTd(a, b, c2, d) { - var e, f2, g; - e = new pSd(a.e, 1, 13, (g = b.c, g ? g : (jGd(), YFd)), (f2 = c2.c, f2 ? f2 : (jGd(), YFd)), HLd(a, b), false); - !d ? d = e : d.Ei(e); - return d; - } - function UEd(a, b, c2, d) { - var e; - e = a.length; - if (b >= e) - return e; - for (b = b > 0 ? b : 0; b < e; b++) { - if (_Ed((BCb(b, a.length), a.charCodeAt(b)), c2, d)) - break; - } - return b; - } - function Qkb(a, b) { - var c2, d; - d = a.c.length; - b.length < d && (b = eCb(new Array(d), b)); - for (c2 = 0; c2 < d; ++c2) { - NC(b, c2, a.c[c2]); - } - b.length > d && NC(b, d, null); - return b; - } - function _lb(a, b) { - var c2, d; - d = a.a.length; - b.length < d && (b = eCb(new Array(d), b)); - for (c2 = 0; c2 < d; ++c2) { - NC(b, c2, a.a[c2]); - } - b.length > d && NC(b, d, null); - return b; - } - function Xrb(a, b, c2) { - var d, e, f2; - e = BD(Ohb(a.e, b), 387); - if (!e) { - d = new lsb(a, b, c2); - Rhb(a.e, b, d); - isb(d); - return null; - } else { - f2 = ijb(e, c2); - Yrb(a, e); - return f2; - } - } - function P9d(a) { - var b; - if (a == null) - return null; - b = ide(Qge(a, true)); - if (b == null) { - throw vbb(new n8d("Invalid hexBinary value: '" + a + "'")); - } - return b; - } - function ghb(a) { - Hgb(); - if (ybb(a, 0) < 0) { - if (ybb(a, -1) != 0) { - return new Wgb(-1, Jbb(a)); - } - return Bgb; - } else - return ybb(a, 10) <= 0 ? Dgb[Tbb(a)] : new Wgb(1, a); - } - function wJb() { - qJb(); - return OC(GC(DN, 1), Kie, 159, 0, [nJb, mJb, oJb, eJb, dJb, fJb, iJb, hJb, gJb, lJb, kJb, jJb, bJb, aJb, cJb, $Ib, ZIb, _Ib, XIb, WIb, YIb, pJb]); - } - function vjc(a) { - var b; - this.d = new Rkb(); - this.j = new d7c(); - this.g = new d7c(); - b = a.g.b; - this.f = BD(vNb(Q_b(b), (Nyc(), Lwc)), 103); - this.e = Edb(ED(c_b(b, ryc))); - } - function Pjc(a) { - this.b = new Rkb(); - this.e = new Rkb(); - this.d = a; - this.a = !WAb(JAb(new YAb(null, new Lub(new b1b(a.b))), new Xxb(new Qjc()))).sd((EAb(), DAb)); - } - function N5c() { - N5c = ccb; - L5c = new O5c("PARENTS", 0); - K5c = new O5c("NODES", 1); - I5c = new O5c("EDGES", 2); - M5c = new O5c("PORTS", 3); - J5c = new O5c("LABELS", 4); - } - function Tbd() { - Tbd = ccb; - Qbd = new Ubd("DISTRIBUTED", 0); - Sbd = new Ubd("JUSTIFIED", 1); - Obd = new Ubd("BEGIN", 2); - Pbd = new Ubd(gle, 3); - Rbd = new Ubd("END", 4); - } - function UMd(a) { - var b; - b = a.yi(null); - switch (b) { - case 10: - return 0; - case 15: - return 1; - case 14: - return 2; - case 11: - return 3; + this.popState(); + this.begin("callback_args"); + break; case 21: - return 4; - } - return -1; - } - function cYb(a) { - switch (a.g) { - case 1: - return ead(), dad; - case 4: - return ead(), aad; - case 2: - return ead(), bad; - case 3: - return ead(), _9c; - } - return ead(), cad; - } - function kA(a, b, c2) { - var d; - d = c2.q.getFullYear() - nje + nje; - d < 0 && (d = -d); - switch (b) { - case 1: - a.a += d; + return 70; break; - case 2: - EA(a, d % 100, 2); + case 22: + this.popState(); break; - default: - EA(a, d, b); - } - } - function Jsb(a, b) { - var c2, d; - wCb(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 $sb(a, b, d); - } - function MEb() { - MEb = ccb; - LEb = new NEb("NUM_OF_EXTERNAL_SIDES_THAN_NUM_OF_EXTENSIONS_LAST", 0); - KEb = new NEb("CORNER_CASES_THAN_SINGLE_SIDE_LAST", 1); - } - function h4b(a) { - var b, c2, d, e; - d = c4b(a); - Okb(d, a4b); - e = a.d; - e.c = KC(SI, Uhe, 1, 0, 5, 1); - for (c2 = new olb(d); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 456); - Gkb(e, b.b); - } - } - function gkd(a) { - var b, c2, d; - d = (!a.o && (a.o = new dId((Thd(), Qhd), S2, a, 0)), a.o); - for (c2 = d.c.Kc(); c2.e != c2.i.gc(); ) { - b = BD(c2.nj(), 42); - b.dd(); - } - return FAd(d); - } - function N5b(a) { - var b; - if (!ecd(BD(vNb(a, (Nyc(), Vxc)), 98))) { - return; - } - b = a.b; - O5b((tCb(0, b.c.length), BD(b.c[0], 29))); - O5b(BD(Ikb(b, b.c.length - 1), 29)); - } - function Roc(a, b) { - var c2, d, e, f2; - c2 = 0; - for (e = new olb(b.a); e.a < e.c.c.length; ) { - d = BD(mlb(e), 10); - f2 = d.o.a + d.d.c + d.d.b + a.j; - c2 = $wnd.Math.max(c2, f2); - } - return c2; - } - function XEd(a) { - var b, c2, d, e; - e = 0; - for (c2 = 0, d = a.length; c2 < d; c2++) { - b = (BCb(c2, a.length), a.charCodeAt(c2)); - b >= 64 && b < 128 && (e = Mbb(e, Nbb(1, b - 64))); - } - return e; - } - function c_b(a, b) { - var c2, d; - d = null; - if (wNb(a, (Y9c(), O9c))) { - c2 = BD(vNb(a, O9c), 94); - c2.Xe(b) && (d = c2.We(b)); - } - d == null && !!Q_b(a) && (d = vNb(Q_b(a), b)); - return d; - } - function oQc(a, b) { - var c2, d, e; - e = b.d.i; - d = e.k; - if (d == (j0b(), h0b) || d == d0b) { - return; - } - c2 = new Sr(ur(U_b(e).a.Kc(), new Sq())); - Qr(c2) && Rhb(a.k, b, BD(Rr(c2), 17)); - } - function mid(a, b) { - var c2, d, e; - d = XKd(a.Tg(), b); - c2 = b - a.Ah(); - return c2 < 0 ? (e = a.Yg(d), e >= 0 ? a.lh(e) : tid(a, d)) : c2 < 0 ? tid(a, d) : BD(d, 66).Nj().Sj(a, a.yh(), c2); - } - function Ksd(a) { - var b; - if (JD(a.a, 4)) { - b = fvd(a.a); - if (b == null) { - throw vbb(new Zdb(mse + a.b + "'. " + ise + (fdb(Y3), Y3.k) + jse)); - } - return b; - } else { - return a.a; - } - } - function L9d(a) { - var b; - if (a == null) - return null; - b = bde(Qge(a, true)); - if (b == null) { - throw vbb(new n8d("Invalid base64Binary value: '" + a + "'")); - } - return b; - } - function Dyd(b) { - var c2; - try { - c2 = b.i.Xb(b.e); - b.mj(); - b.g = b.e++; - return c2; - } catch (a) { - a = ubb(a); - if (JD(a, 73)) { - b.mj(); - throw vbb(new utb()); - } else - throw vbb(a); - } - } - function Zyd(b) { - var c2; - try { - c2 = b.c.ki(b.e); - b.mj(); - b.g = b.e++; - return c2; - } catch (a) { - a = ubb(a); - if (JD(a, 73)) { - b.mj(); - throw vbb(new utb()); - } else - throw vbb(a); - } - } - function CPb() { - CPb = ccb; - BPb = (Y9c(), K9c); - vPb = G8c; - qPb = r8c; - wPb = f9c; - zPb = (fFb(), bFb); - yPb = _Eb; - APb = dFb; - xPb = $Eb; - sPb = (nPb(), jPb); - rPb = iPb; - tPb = lPb; - uPb = mPb; - } - function NWb(a) { - LWb(); - this.c = new Rkb(); - this.d = a; - switch (a.g) { - case 0: - case 2: - this.a = tmb(KWb); - this.b = Pje; + case 23: + return 71; break; - case 3: - case 1: - this.a = KWb; - this.b = Qje; - } - } - function ued(a, b, c2) { - var d, e; - if (a.c) { - dld(a.c, a.c.i + b); - eld(a.c, a.c.j + c2); - } else { - for (e = new olb(a.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 157); - ued(d, b, c2); - } - } - } - function KEd(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 (!dfb(a.j[c2], b.j[c2])) - return false; - } - return true; - } - function gA(a, b, c2) { - var d; - if (b.a.length > 0) { - Ekb(a.b, new WA(b.a, c2)); - d = b.a.length; - 0 < d ? b.a = b.a.substr(0, 0) : 0 > d && (b.a += yfb(KC(TD, $ie, 25, -d, 15, 1))); - } - } - function JKb(a, b) { - var c2, d, e; - c2 = a.o; - for (e = BD(BD(Qc(a.r, b), 21), 84).Kc(); e.Ob(); ) { - d = BD(e.Pb(), 111); - d.e.a = DKb(d, c2.a); - d.e.b = c2.b * Edb(ED(d.b.We(BKb))); - } - } - function S5b(a, b) { - var c2, d, e, f2; - e = a.k; - c2 = Edb(ED(vNb(a, (wtc(), htc)))); - f2 = b.k; - d = Edb(ED(vNb(b, htc))); - return f2 != (j0b(), e0b) ? -1 : e != e0b ? 1 : c2 == d ? 0 : c2 < d ? -1 : 1; - } - function B$c(a, b) { - var c2, d; - c2 = BD(BD(Ohb(a.g, b.a), 46).a, 65); - d = BD(BD(Ohb(a.g, b.b), 46).a, 65); - return S6c(b.a, b.b) - S6c(b.a, E6c(c2.b)) - S6c(b.b, E6c(d.b)); - } - function aZb(a, b) { - var c2; - c2 = BD(vNb(a, (Nyc(), jxc)), 74); - if (Lq(b, ZYb)) { - if (!c2) { - c2 = new s7c(); - yNb(a, jxc, c2); - } else { - Osb(c2); - } - } else - !!c2 && yNb(a, jxc, null); - return c2; - } - function a0b(a) { - var b; - b = new Ufb(); - b.a += "n"; - a.k != (j0b(), h0b) && Qfb(Qfb((b.a += "(", b), Zr(a.k).toLowerCase()), ")"); - Qfb((b.a += "_", b), P_b(a)); - return b.a; - } - function Kdc(a, b) { - Odd(b, "Self-Loop post-processing", 1); - MAb(JAb(JAb(LAb(new YAb(null, new Kub(a.b, 16)), new Qdc()), new Sdc()), new Udc()), new Wdc()); - Qdd(b); - } - function kid(a, b, c2, d) { - var e; - if (c2 >= 0) { - return a.hh(b, c2, d); - } else { - !!a.eh() && (d = (e = a.Vg(), e >= 0 ? a.Qg(d) : a.eh().ih(a, -1 - e, null, d))); - return a.Sg(b, c2, d); - } - } - function zld(a, b) { - switch (b) { - case 7: - !a.e && (a.e = new y5d(B2, a, 7, 4)); - Uxd(a.e); - return; - case 8: - !a.d && (a.d = new y5d(B2, a, 8, 5)); - Uxd(a.d); - return; - } - $kd(a, b); - } - function Ut(b, c2) { - var d; - d = b.Zc(c2); - try { - return d.Pb(); - } catch (a) { - a = ubb(a); - if (JD(a, 109)) { - throw vbb(new qcb("Can't get element " + c2)); - } else - throw vbb(a); - } - } - function Tgb(a, b) { - this.e = a; - if (b < Zje) { - this.d = 1; - this.a = OC(GC(WD, 1), oje, 25, 15, [b | 0]); - } else { - this.d = 2; - this.a = OC(GC(WD, 1), oje, 25, 15, [b % Zje | 0, b / Zje | 0]); - } - } - function omb(a, b) { - mmb(); - var c2, d, e, f2; - c2 = a; - f2 = b; - if (JD(a, 21) && !JD(b, 21)) { - c2 = b; - f2 = a; - } - for (e = c2.Kc(); e.Ob(); ) { - d = e.Pb(); - if (f2.Hc(d)) { - return false; - } - } - return true; - } - function Txd(a, b, c2) { - var d, e, f2, g; - d = a.Xc(b); - if (d != -1) { - if (a.ej()) { - f2 = a.fj(); - g = tud(a, d); - e = a.Zi(4, g, null, d, f2); - !c2 ? c2 = e : c2.Ei(e); - } else { - tud(a, d); - } - } - return c2; - } - function uwd(a, b, c2) { - var d, e, f2, g; - d = a.Xc(b); - if (d != -1) { - if (a.ej()) { - f2 = a.fj(); - g = Evd(a, d); - e = a.Zi(4, g, null, d, f2); - !c2 ? c2 = e : c2.Ei(e); - } else { - Evd(a, d); - } - } - return c2; - } - function PJb(a, b) { - var c2; - c2 = BD(Mpb(a.b, b), 124).n; - switch (b.g) { - case 1: - a.t >= 0 && (c2.d = a.t); + case 24: + this.popState(); break; - case 3: - a.t >= 0 && (c2.a = a.t); - } - if (a.C) { - c2.b = a.C.b; - c2.c = a.C.c; - } - } - function RMb() { - RMb = ccb; - OMb = new SMb(xle, 0); - NMb = new SMb(yle, 1); - PMb = new SMb(zle, 2); - QMb = new SMb(Ale, 3); - OMb.a = false; - NMb.a = true; - PMb.a = false; - QMb.a = true; - } - function ROb() { - ROb = ccb; - OOb = new SOb(xle, 0); - NOb = new SOb(yle, 1); - POb = new SOb(zle, 2); - QOb = new SOb(Ale, 3); - OOb.a = false; - NOb.a = true; - POb.a = false; - QOb.a = true; - } - function dac(a) { - var b; - b = a.a; - do { - b = BD(Rr(new Sr(ur(R_b(b).a.Kc(), new Sq()))), 17).c.i; - b.k == (j0b(), g0b) && a.b.Fc(b); - } while (b.k == (j0b(), g0b)); - a.b = Su(a.b); - } - function CDc(a) { - var b, c2, d; - d = a.c.a; - a.p = (Qb(d), new Tkb(d)); - for (c2 = new olb(d); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 10); - b.p = GDc(b).a; - } - mmb(); - Okb(a.p, new PDc()); - } - function eVc(a) { - var b, c2, d, e; - d = 0; - e = gVc(a); - if (e.c.length == 0) { - return 1; - } else { - for (c2 = new olb(e); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 33); - d += eVc(b); - } - } - return d; - } - function JJb(a, b) { - var c2, d, e; - e = 0; - d = BD(BD(Qc(a.r, b), 21), 84).Kc(); - while (d.Ob()) { - c2 = BD(d.Pb(), 111); - e += c2.d.b + c2.b.rf().a + c2.d.c; - d.Ob() && (e += a.w); - } - return e; - } - function RKb(a, b) { - var c2, d, e; - e = 0; - d = BD(BD(Qc(a.r, b), 21), 84).Kc(); - while (d.Ob()) { - c2 = BD(d.Pb(), 111); - e += c2.d.d + c2.b.rf().b + c2.d.a; - d.Ob() && (e += a.w); - } - return e; - } - function SOc(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; - } - function AD(a, b) { - if (ND(a)) { - return !!zD[b]; - } else if (a.hm) { - return !!a.hm[b]; - } else if (LD(a)) { - return !!yD[b]; - } else if (KD(a)) { - return !!xD[b]; - } - return false; - } - function jkd(a, b, c2) { - c2 == null ? (!a.o && (a.o = new dId((Thd(), Qhd), S2, a, 0)), LAd(a.o, b)) : (!a.o && (a.o = new dId((Thd(), Qhd), S2, a, 0)), HAd(a.o, b, c2)); - return a; - } - function jKb(a, b, c2, d) { - var e, f2; - f2 = b.Xe((Y9c(), W8c)) ? BD(b.We(W8c), 21) : a.j; - e = uJb(f2); - if (e == (qJb(), pJb)) { - return; - } - if (c2 && !sJb(e)) { - return; - } - UHb(lKb(a, e, d), b); - } - function fid(a, b, c2, d) { - var e, f2, g; - f2 = XKd(a.Tg(), b); - e = b - a.Ah(); - return e < 0 ? (g = a.Yg(f2), g >= 0 ? a._g(g, c2, true) : sid(a, f2, c2)) : BD(f2, 66).Nj().Pj(a, a.yh(), e, c2, d); - } - function u6d(a, b, c2, d) { - var e, f2, g; - if (c2.mh(b)) { - Q6d(); - if (YId(b)) { - e = BD(c2.ah(b), 153); - x6d(a, e); - } else { - f2 = (g = b, !g ? null : BD(d, 49).xh(g)); - !!f2 && v6d(c2.ah(b), f2); - } - } - } - function H3b(a) { - switch (a.g) { - case 1: - return vLb(), uLb; - case 3: - return vLb(), rLb; - case 2: - return vLb(), tLb; - case 4: - return vLb(), sLb; - default: - return null; - } - } - function kCb(a) { - switch (typeof a) { - case Mhe: - return LCb(a); - case Lhe: - return QD(a); - case Khe: - return Bcb(), a ? 1231 : 1237; - default: - return a == null ? 0 : FCb(a); - } - } - function Gic(a, b, c2) { - if (a.e) { - switch (a.b) { - case 1: - oic(a.c, b, c2); - break; - case 0: - pic(a.c, b, c2); - } - } else { - mic(a.c, b, c2); - } - a.a[b.p][c2.p] = a.c.i; - a.a[c2.p][b.p] = a.c.e; - } - function lHc(a) { - var b, c2; - if (a == null) { - return null; - } - c2 = KC(OQ, nie, 193, a.length, 0, 2); - for (b = 0; b < c2.length; b++) { - c2[b] = BD(ulb(a[b], a[b].length), 193); - } - return c2; - } - function d4d(a) { - var b; - if (b4d(a)) { - a4d(a); - if (a.Lk()) { - b = b3d(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 vbb(new utb()); - } - } - function fMb(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 HLd(a, b) { - var c2, d, e; - e = rud(a, b); - if (e >= 0) - return e; - if (a.Fk()) { - for (d = 0; d < a.i; ++d) { - c2 = a.Gk(BD(a.g[d], 56)); - if (PD(c2) === PD(b)) { - return d; - } - } - } - return -1; - } - function Gtd(a, b, c2) { - var d, e; - e = a.gc(); - if (b >= e) - throw vbb(new Cyd(b, e)); - if (a.hi()) { - d = a.Xc(c2); - if (d >= 0 && d != b) { - throw vbb(new Wdb(kue)); - } - } - return a.mi(b, c2); - } - function gx(a, b) { - this.a = BD(Qb(a), 245); - this.b = BD(Qb(b), 245); - if (a.vd(b) > 0 || a == (Lk(), Kk) || b == (_k(), $k)) { - throw vbb(new Wdb("Invalid range: " + nx(a, b))); - } - } - function mYb(a) { - var b, c2; - this.b = new Rkb(); - this.c = a; - this.a = false; - for (c2 = new olb(a.a); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 10); - this.a = this.a | b.k == (j0b(), h0b); - } - } - function GFb(a, b) { - var c2, d, e; - c2 = nGb(new pGb(), a); - for (e = new olb(b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 121); - AFb(DFb(CFb(EFb(BFb(new FFb(), 0), 0), c2), d)); - } - return c2; - } - function Nac(a, b, c2) { - var d, e, f2; - for (e = new Sr(ur((b ? R_b(a) : U_b(a)).a.Kc(), new Sq())); Qr(e); ) { - d = BD(Rr(e), 17); - f2 = b ? d.c.i : d.d.i; - f2.k == (j0b(), f0b) && $_b(f2, c2); - } - } - function Izc() { - Izc = ccb; - Gzc = new Kzc(ane, 0); - Hzc = new Kzc("PORT_POSITION", 1); - Fzc = new Kzc("NODE_SIZE_WHERE_SPACE_PERMITS", 2); - Ezc = new Kzc("NODE_SIZE", 3); - } - function F7c() { - F7c = ccb; - z7c = new G7c("AUTOMATIC", 0); - C7c = new G7c(jle, 1); - D7c = new G7c(kle, 2); - E7c = new G7c("TOP", 3); - A7c = new G7c(mle, 4); - B7c = new G7c(gle, 5); - } - function Hhb(a, b, c2, d) { - Dhb(); - var e, f2; - e = 0; - for (f2 = 0; f2 < c2; f2++) { - e = wbb(Ibb(xbb(b[f2], Yje), xbb(d, Yje)), xbb(Tbb(e), Yje)); - a[f2] = Tbb(e); - e = Pbb(e, 32); - } - return Tbb(e); - } - function zHb(a, b, c2) { - var d, e; - e = 0; - for (d = 0; d < rHb; d++) { - e = $wnd.Math.max(e, pHb(a.a[b.g][d], c2)); - } - b == (gHb(), eHb) && !!a.b && (e = $wnd.Math.max(e, a.b.b)); - return e; - } - function Bub(a, b) { - var c2, d; - lCb(b > 0); - if ((b & -b) == b) { - return QD(b * Cub(a, 31) * 4656612873077393e-25); - } - do { - c2 = Cub(a, 31); - d = c2 % b; - } while (c2 - d + (b - 1) < 0); - return QD(d); - } - function LCb(a) { - JCb(); - var b, c2, d; - c2 = ":" + a; - d = ICb[c2]; - if (d != null) { - return QD((uCb(d), d)); - } - d = GCb[c2]; - b = d == null ? KCb(a) : QD((uCb(d), d)); - MCb(); - ICb[c2] = b; - return b; - } - function qZb(a, b, c2) { - Odd(c2, "Compound graph preprocessor", 1); - a.a = new Hp(); - vZb(a, b, null); - pZb(a, b); - uZb(a); - yNb(b, (wtc(), zsc), a.a); - a.a = null; - Uhb(a.b); - Qdd(c2); - } - function X$b(a, b, c2) { - switch (c2.g) { - case 1: - a.a = b.a / 2; - a.b = 0; + case 25: + return "STR"; break; - case 2: - a.a = b.a; - a.b = b.b / 2; + case 26: + this.begin("string"); break; - case 3: - a.a = b.a / 2; - a.b = b.b; + case 27: + return 73; break; - case 4: - a.a = 0; - a.b = b.b / 2; - } - } - function tkc(a) { - var b, c2, d; - for (d = BD(Qc(a.a, (Xjc(), Vjc)), 15).Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 101); - b = Bkc(c2); - kkc(a, c2, b[0], (Fkc(), Ckc), 0); - kkc(a, c2, b[1], Ekc, 1); - } - } - function ukc(a) { - var b, c2, d; - for (d = BD(Qc(a.a, (Xjc(), Wjc)), 15).Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 101); - b = Bkc(c2); - kkc(a, c2, b[0], (Fkc(), Ckc), 0); - kkc(a, c2, b[1], Ekc, 1); - } - } - function tXc(a) { - switch (a.g) { - case 0: - return null; - case 1: - return new $Xc(); - case 2: - return new QXc(); - default: - throw vbb(new Wdb(jre + (a.f != null ? a.f : "" + a.g))); - } - } - function OZc(a, b, c2) { - var d, e; - FZc(a, b - a.s, c2 - a.t); - for (e = new olb(a.n); e.a < e.c.c.length; ) { - d = BD(mlb(e), 211); - SZc(d, d.e + b - a.s); - TZc(d, d.f + c2 - a.t); - } - a.s = b; - a.t = c2; - } - function JFb(a) { - var b, c2, d, e, f2; - c2 = 0; - for (e = new olb(a.a); e.a < e.c.c.length; ) { - d = BD(mlb(e), 121); - d.d = c2++; - } - b = IFb(a); - f2 = null; - b.c.length > 1 && (f2 = GFb(a, b)); - return f2; - } - function dmd(a) { - var b; - if (!!a.f && a.f.kh()) { - b = BD(a.f, 49); - a.f = BD(xid(a, b), 82); - a.f != b && (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 9, 8, b, a.f)); - } - return a.f; - } - function emd(a) { - var b; - if (!!a.i && a.i.kh()) { - b = BD(a.i, 49); - a.i = BD(xid(a, b), 82); - a.i != b && (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 9, 7, b, a.i)); - } - return a.i; - } - function zUd(a) { - var b; - if (!!a.b && (a.b.Db & 64) != 0) { - b = a.b; - a.b = BD(xid(a, b), 18); - a.b != b && (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 9, 21, b, a.b)); - } - return a.b; - } - function uAd(a, b) { - var c2, d, e; - if (a.d == null) { - ++a.e; - ++a.f; - } else { - d = b.Sh(); - BAd(a, a.f + 1); - e = (d & Ohe) % a.d.length; - c2 = a.d[e]; - !c2 && (c2 = a.d[e] = a.uj()); - c2.Fc(b); - ++a.f; - } - } - function m3d(a, b, c2) { - var d; - if (b.Kj()) { - return false; - } else if (b.Zj() != -2) { - d = b.zj(); - return d == null ? c2 == null : pb(d, c2); - } else - return b.Hj() == a.e.Tg() && c2 == null; - } - function wo() { - var a; - Xj(16, Hie); - a = Kp(16); - this.b = KC(GF, Gie, 317, a, 0, 1); - this.c = KC(GF, Gie, 317, a, 0, 1); - this.a = null; - this.e = null; - this.i = 0; - this.f = a - 1; - this.g = 0; - } - function b0b(a) { - n_b.call(this); - this.k = (j0b(), h0b); - this.j = (Xj(6, Jie), new Skb(6)); - this.b = (Xj(2, Jie), new Skb(2)); - this.d = new L_b(); - this.f = new s0b(); - this.a = a; - } - function Scc(a) { - var b, c2; - if (a.c.length <= 1) { - return; - } - b = Pcc(a, (Ucd(), Rcd)); - Rcc(a, BD(b.a, 19).a, BD(b.b, 19).a); - c2 = Pcc(a, Tcd); - Rcc(a, BD(c2.a, 19).a, BD(c2.b, 19).a); - } - function Vzc() { - Vzc = ccb; - Uzc = new Xzc("SIMPLE", 0); - Rzc = new Xzc(Tne, 1); - Szc = new Xzc("LINEAR_SEGMENTS", 2); - Qzc = new Xzc("BRANDES_KOEPF", 3); - Tzc = new Xzc(Aqe, 4); - } - function XDc(a, b, c2) { - if (!ecd(BD(vNb(b, (Nyc(), Vxc)), 98))) { - WDc(a, b, Y_b(b, c2)); - WDc(a, b, Y_b(b, (Ucd(), Rcd))); - WDc(a, b, Y_b(b, Acd)); - mmb(); - Okb(b.j, new jEc(a)); - } - } - function HVc(a, b, c2, d) { - var e, f2, g; - e = d ? BD(Qc(a.a, b), 21) : BD(Qc(a.b, b), 21); - for (g = e.Kc(); g.Ob(); ) { - f2 = BD(g.Pb(), 33); - if (BVc(a, c2, f2)) { - return true; - } - } - return false; - } - function FMd(a) { - var b, c2; - for (c2 = new Fyd(a); c2.e != c2.i.gc(); ) { - b = BD(Dyd(c2), 87); - if (!!b.e || (!b.d && (b.d = new xMd(j5, b, 1)), b.d).i != 0) { - return true; - } - } - return false; - } - function QTd(a) { - var b, c2; - for (c2 = new Fyd(a); c2.e != c2.i.gc(); ) { - b = BD(Dyd(c2), 87); - if (!!b.e || (!b.d && (b.d = new xMd(j5, b, 1)), b.d).i != 0) { - return true; - } - } - return false; - } - function FDc(a) { - var b, c2, d; - b = 0; - for (d = new olb(a.c.a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 10); - b += sr(new Sr(ur(U_b(c2).a.Kc(), new Sq()))); - } - return b / a.c.a.c.length; - } - function UPc(a) { - var b, c2; - a.c || XPc(a); - c2 = new s7c(); - b = new olb(a.a); - mlb(b); - while (b.a < b.c.c.length) { - Dsb(c2, BD(mlb(b), 407).a); - } - sCb(c2.b != 0); - Nsb(c2, c2.c.b); - return c2; - } - function J0c() { - J0c = ccb; - I0c = (A0c(), z0c); - G0c = new q0b(8); - new Osd((Y9c(), f9c), G0c); - new Osd(T9c, 8); - H0c = x0c; - E0c = n0c; - F0c = o0c; - D0c = new Osd(y8c, (Bcb(), false)); - } - function uld(a, b, c2, d) { - switch (b) { - case 7: - return !a.e && (a.e = new y5d(B2, a, 7, 4)), a.e; - case 8: - return !a.d && (a.d = new y5d(B2, a, 8, 5)), a.d; - } - return Xkd(a, b, c2, d); - } - function JQd(a) { - var b; - if (!!a.a && a.a.kh()) { - b = BD(a.a, 49); - a.a = BD(xid(a, b), 138); - a.a != b && (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 9, 5, b, a.a)); - } - return a.a; - } - function yde(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 Wj(a, b) { - if (a == null) { - throw vbb(new Heb("null key in entry: null=" + b)); - } else if (b == null) { - throw vbb(new Heb("null value in entry: " + a + "=null")); - } - } - function kr(a, b) { - var c2, d; - while (a.Ob()) { - if (!b.Ob()) { - return false; - } - c2 = a.Pb(); - d = b.Pb(); - if (!(PD(c2) === PD(d) || c2 != null && pb(c2, d))) { - return false; - } - } - return !b.Ob(); - } - function jIb(a, b) { - var c2; - c2 = OC(GC(UD, 1), Vje, 25, 15, [pHb(a.a[0], b), pHb(a.a[1], b), pHb(a.a[2], b)]); - if (a.d) { - c2[0] = $wnd.Math.max(c2[0], c2[2]); - c2[2] = c2[0]; - } - return c2; - } - function kIb(a, b) { - var c2; - c2 = OC(GC(UD, 1), Vje, 25, 15, [qHb(a.a[0], b), qHb(a.a[1], b), qHb(a.a[2], b)]); - if (a.d) { - c2[0] = $wnd.Math.max(c2[0], c2[2]); - c2[2] = c2[0]; - } - return c2; - } - function mqc() { - mqc = ccb; - iqc = new oqc("GREEDY", 0); - hqc = new oqc(Une, 1); - kqc = new oqc(Tne, 2); - lqc = new oqc("MODEL_ORDER", 3); - jqc = new oqc("GREEDY_MODEL_ORDER", 4); - } - function iUc(a, b) { - var c2, d, e; - a.b[b.g] = 1; - for (d = Jsb(b.d, 0); d.b != d.d.c; ) { - c2 = BD(Xsb(d), 188); - e = c2.c; - a.b[e.g] == 1 ? Dsb(a.a, c2) : a.b[e.g] == 2 ? a.b[e.g] = 1 : iUc(a, e); - } - } - function V9b(a, b) { - var c2, d, e; - e = new Skb(b.gc()); - for (d = b.Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 286); - c2.c == c2.f ? K9b(a, c2, c2.c) : L9b(a, c2) || (e.c[e.c.length] = c2, true); - } - return e; - } - function IZc(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 olb(a.n); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 211); - RZc(f2, h, d, e); - ++e; - } - } - function tEb(a) { - var b, c2, d; - zwb(a.b.a); - a.a = KC(PM, Uhe, 57, a.c.c.a.b.c.length, 0, 1); - b = 0; - for (d = new olb(a.c.c.a.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 57); - c2.f = b++; - } - } - function RVb(a) { - var b, c2, d; - zwb(a.b.a); - a.a = KC(IP, Uhe, 81, a.c.a.a.b.c.length, 0, 1); - b = 0; - for (d = new olb(a.c.a.a.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 81); - c2.i = b++; - } - } - function P1c(a, b, c2) { - var d; - Odd(c2, "Shrinking tree compaction", 1); - if (Ccb(DD(vNb(b, (XNb(), VNb))))) { - N1c(a, b.f); - INb(b.f, (d = b.c, d)); - } else { - INb(b.f, b.c); - } - Qdd(c2); - } - function mr(a) { - var b; - b = gr(a); - if (!Qr(a)) { - throw vbb(new qcb("position (0) must be less than the number of elements that remained (" + b + ")")); - } - return Rr(a); - } - function hNb(b, c2, d) { - var e; - try { - return YMb(b, c2 + b.j, d + b.k); - } catch (a) { - a = ubb(a); - if (JD(a, 73)) { - e = a; - throw vbb(new qcb(e.g + Gle + c2 + She + d + ").")); - } else - throw vbb(a); - } - } - function iNb(b, c2, d) { - var e; - try { - return ZMb(b, c2 + b.j, d + b.k); - } catch (a) { - a = ubb(a); - if (JD(a, 73)) { - e = a; - throw vbb(new qcb(e.g + Gle + c2 + She + d + ").")); - } else - throw vbb(a); - } - } - function jNb(b, c2, d) { - var e; - try { - return $Mb(b, c2 + b.j, d + b.k); - } catch (a) { - a = ubb(a); - if (JD(a, 73)) { - e = a; - throw vbb(new qcb(e.g + Gle + c2 + She + d + ").")); - } else - throw vbb(a); - } - } - function s5b(a) { - switch (a.g) { - case 1: - return Ucd(), Tcd; - case 4: - return Ucd(), Acd; - case 3: - return Ucd(), zcd; - case 2: - return Ucd(), Rcd; - default: - return Ucd(), Scd; - } - } - function cjc(a, b, c2) { - if (b.k == (j0b(), h0b) && c2.k == g0b) { - a.d = _ic(b, (Ucd(), Rcd)); - a.b = _ic(b, Acd); - } - if (c2.k == h0b && b.k == g0b) { - a.d = _ic(c2, (Ucd(), Acd)); - a.b = _ic(c2, Rcd); - } - } - function gjc(a, b) { - var c2, d, e; - e = V_b(a, b); - for (d = e.Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 11); - if (vNb(c2, (wtc(), gtc)) != null || a1b(new b1b(c2.b))) { - return true; - } - } - return false; - } - function QZc(a, b) { - dld(b, a.e + a.d + (a.c.c.length == 0 ? 0 : a.b)); - eld(b, a.f); - a.a = $wnd.Math.max(a.a, b.f); - a.d += b.g + (a.c.c.length == 0 ? 0 : a.b); - Ekb(a.c, b); - return true; - } - function XZc(a, b, c2) { - var d, e, f2, g; - g = 0; - d = c2 / a.a.c.length; - for (f2 = new olb(a.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 187); - OZc(e, e.s, e.t + g * d); - IZc(e, a.d - e.r + b, d); - ++g; - } - } - function H4b(a) { - var b, c2, d, e, f2; - for (d = new olb(a.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 29); - b = 0; - for (f2 = new olb(c2.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 10); - e.p = b++; - } - } - } - function r6c(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 = k6c(e, d) * x6c(1 - a, e - d) * x6c(a, d); - g += f2.a * c2; - h += f2.b * c2; - } - return new f7c(g, h); - } - function jud(a, b) { - var c2, d, e, f2, g; - c2 = b.gc(); - a.qi(a.i + c2); - f2 = b.Kc(); - g = a.i; - a.i += c2; - for (d = g; d < a.i; ++d) { - e = f2.Pb(); - mud(a, d, a.oi(d, e)); - a.bi(d, e); - a.ci(); - } - return c2 != 0; - } - function twd(a, b, c2) { - var d, e, f2; - if (a.ej()) { - d = a.Vi(); - f2 = a.fj(); - ++a.j; - a.Hi(d, a.oi(d, b)); - e = a.Zi(3, null, b, d, f2); - !c2 ? c2 = e : c2.Ei(e); - } else { - Avd(a, a.Vi(), b); - } - return c2; - } - function WOd(a, b, c2) { - var d, e, f2; - d = BD(qud(VKd(a.a), b), 87); - f2 = (e = d.c, JD(e, 88) ? BD(e, 26) : (jGd(), _Fd)); - ((f2.Db & 64) != 0 ? xid(a.b, f2) : f2) == c2 ? KQd(d) : NQd(d, c2); - return f2; - } - function Ewb(a, b, c2, d, e, f2, g, h) { - var i3, j; - if (!d) { - return; - } - i3 = d.a[0]; - !!i3 && Ewb(a, b, c2, i3, e, f2, g, h); - Fwb(a, c2, d.d, e, f2, g, h) && b.Fc(d); - j = d.a[1]; - !!j && Ewb(a, b, c2, j, e, f2, g, h); - } - function eAb(a, b) { - var c2; - if (!a.a) { - c2 = KC(UD, Vje, 25, 0, 15, 1); - _ub(a.b.a, new iAb(c2)); - c2.sort(dcb(Ylb.prototype.te, Ylb, [])); - a.a = new Avb(c2, a.d); - } - return pvb(a.a, b); - } - function YMb(b, c2, d) { - try { - return Bbb(_Mb(b, c2, d), 1); - } catch (a) { - a = ubb(a); - if (JD(a, 320)) { - throw vbb(new qcb(Dle + b.o + "*" + b.p + Ele + c2 + She + d + Fle)); - } else - throw vbb(a); - } - } - function ZMb(b, c2, d) { - try { - return Bbb(_Mb(b, c2, d), 0); - } catch (a) { - a = ubb(a); - if (JD(a, 320)) { - throw vbb(new qcb(Dle + b.o + "*" + b.p + Ele + c2 + She + d + Fle)); - } else - throw vbb(a); - } - } - function $Mb(b, c2, d) { - try { - return Bbb(_Mb(b, c2, d), 2); - } catch (a) { - a = ubb(a); - if (JD(a, 320)) { - throw vbb(new qcb(Dle + b.o + "*" + b.p + Ele + c2 + She + d + Fle)); - } else - throw vbb(a); - } - } - function Nyd(b, c2) { - if (b.g == -1) { - throw vbb(new Ydb()); - } - b.mj(); - try { - b.d._c(b.g, c2); - b.f = b.d.j; - } catch (a) { - a = ubb(a); - if (JD(a, 73)) { - throw vbb(new Apb()); - } else - throw vbb(a); - } - } - function rJc(a, b, c2) { - Odd(c2, "Linear segments node placement", 1); - a.b = BD(vNb(b, (wtc(), otc)), 304); - sJc(a, b); - nJc(a, b); - kJc(a, b); - qJc(a); - a.a = null; - a.b = null; - Qdd(c2); - } - function Ee(a, b) { - var c2, d, e, f2; - f2 = a.gc(); - b.length < f2 && (b = eCb(new Array(f2), b)); - e = b; - d = a.Kc(); - for (c2 = 0; c2 < f2; ++c2) { - NC(e, c2, d.Pb()); - } - b.length > f2 && NC(b, f2, null); - return b; - } - function Lu(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; - } - function Jd(a, b) { - var c2, d, e; - c2 = b.cd(); - e = b.dd(); - d = a.xc(c2); - if (!(PD(e) === PD(d) || e != null && pb(e, d))) { - return false; - } - if (d == null && !a._b(c2)) { - return false; - } - return true; - } - function YC(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; - } else { - c2 = a.l; - d = a.m; - e = a.h & (1 << b - 44) - 1; - } - return TC(c2, d, e); - } - function yKb(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; - } - } - function aLb(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; + case 28: + this.begin("namespace"); + return 40; break; - case 1: - c2.d += a.e; + case 29: + this.popState(); + return 8; break; - case 2: - c2.c = a.e - d.a - d.d; + case 30: break; - case 3: - c2.c = a.e + d.d; - } - } - function ZOb(a, b, c2, d) { - var e, f2; - this.a = b; - this.c = d; - e = a.a; - YOb(this, new f7c(-e.c, -e.d)); - P6c(this.b, c2); - f2 = d / 2; - b.a ? b7c(this.b, 0, f2) : b7c(this.b, f2, 0); - Ekb(a.c, this); - } - function iXc() { - iXc = ccb; - hXc = new kXc(ane, 0); - fXc = new kXc(Vne, 1); - gXc = new kXc("EDGE_LENGTH_BY_POSITION", 2); - eXc = new kXc("CROSSING_MINIMIZATION_BY_POSITION", 3); - } - function Wqd(a, b) { - var c2, d; - c2 = BD(oo(a.g, b), 33); - if (c2) { - return c2; - } - d = BD(oo(a.j, b), 118); - if (d) { - return d; - } - throw vbb(new cqd("Referenced shape does not exist: " + b)); - } - function rTb(a, b) { - if (a.c == b) { - return a.d; - } else if (a.d == b) { - return a.c; - } else { - throw vbb(new Wdb("Node 'one' must be either source or target of edge 'edge'.")); - } - } - function TMc(a, b) { - if (a.c.i == b) { - return a.d.i; - } else if (a.d.i == b) { - return a.c.i; - } else { - throw vbb(new Wdb("Node " + b + " is neither source nor target of edge " + a)); - } - } - function _lc(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); - amc(a, b, (Ajc(), zjc), c2); + case 31: + this.begin("namespace-body"); + return 37; break; - case 1: - case 3: - amc(a, b, (Ajc(), wjc), null); - } - } - function smc(a, b, c2, d, e, f2) { - var g, h, i3, j, k; - g = qmc(b, c2, f2); - h = c2 == (Ucd(), Acd) || c2 == Tcd ? -1 : 1; - j = a[c2.g]; - for (k = 0; k < j.length; k++) { - i3 = j[k]; - i3 > 0 && (i3 += e); - j[k] = g; - g += h * (i3 + d); - } - } - function Uoc(a) { - var b, c2, d; - d = a.f; - a.n = KC(UD, Vje, 25, d, 15, 1); - a.d = KC(UD, Vje, 25, d, 15, 1); - for (b = 0; b < d; b++) { - c2 = BD(Ikb(a.c.b, b), 29); - a.n[b] = Roc(a, c2); - a.d[b] = Qoc(a, c2); - } - } - function zjd(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; - } - } - function s3d(a, b) { - var c2, d, e, f2, g; - g = S6d(a.e.Tg(), b); - f2 = null; - c2 = BD(a.g, 119); - for (e = 0; e < a.i; ++e) { - d = c2[e]; - if (g.rl(d.ak())) { - !f2 && (f2 = new yud()); - wtd(f2, d); - } - } - !!f2 && Yxd(a, f2); - } - function H9d(a) { - var b, c2, d; - if (!a) - return null; - if (a.dc()) - return ""; - d = new Hfb(); - for (c2 = a.Kc(); c2.Ob(); ) { - b = c2.Pb(); - Efb(d, GD(b)); - d.a += " "; - } - return lcb(d, d.a.length - 1); - } - function Ty(a, b, c2) { - var d, e, f2, g, h; - Uy(a); - for (e = (a.k == null && (a.k = KC(_I, nie, 78, 0, 0, 1)), a.k), f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - Ty(d); - } - h = a.f; - !!h && Ty(h); - } - function LC(a, b) { - var c2 = new Array(b); - var d; - switch (a) { - case 14: - case 15: - d = 0; + case 32: + this.popState(); + return 39; break; - case 16: - d = false; + case 33: + return "EOF_IN_STRUCT"; break; - default: - return c2; - } - for (var e = 0; e < b; ++e) { - c2[e] = d; - } - return c2; - } - function PDb(a) { - var b, c2, d; - for (c2 = new olb(a.a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 57); - b.c.$b(); - } - fad(a.d) ? d = a.a.c : d = a.a.d; - Hkb(d, new dEb(a)); - a.c.Me(a); - QDb(a); - } - function sRb(a) { - var b, c2, d, e; - for (c2 = new olb(a.e.c); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 282); - for (e = new olb(b.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 447); - lRb(d); - } - cRb(b); - } - } - function a$c(a) { - var b, c2, d, e, f2; - d = 0; - f2 = 0; - e = 0; - for (c2 = new olb(a.a); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 187); - f2 = $wnd.Math.max(f2, b.r); - d += b.d + (e > 0 ? a.c : 0); - ++e; - } - a.b = d; - a.d = f2; - } - function BZc(a, b) { - var c2, d, e, f2, g; - d = 0; - e = 0; - c2 = 0; - for (g = new olb(b); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 200); - d = $wnd.Math.max(d, f2.e); - e += f2.b + (c2 > 0 ? a.g : 0); - ++c2; - } - a.c = e; - a.d = d; - } - function AHb(a, b) { - var c2; - c2 = OC(GC(UD, 1), Vje, 25, 15, [zHb(a, (gHb(), dHb), b), zHb(a, eHb, b), zHb(a, fHb, b)]); - if (a.f) { - c2[0] = $wnd.Math.max(c2[0], c2[2]); - c2[2] = c2[0]; - } - return c2; - } - function lNb(b, c2, d) { - var e; - try { - aNb(b, c2 + b.j, d + b.k, false, true); - } catch (a) { - a = ubb(a); - if (JD(a, 73)) { - e = a; - throw vbb(new qcb(e.g + Gle + c2 + She + d + ").")); - } else - throw vbb(a); - } - } - function mNb(b, c2, d) { - var e; - try { - aNb(b, c2 + b.j, d + b.k, true, false); - } catch (a) { - a = ubb(a); - if (JD(a, 73)) { - e = a; - throw vbb(new qcb(e.g + Gle + c2 + She + d + ").")); - } else - throw vbb(a); - } - } - function d5b(a) { - var b; - if (!wNb(a, (Nyc(), xxc))) { - return; - } - b = BD(vNb(a, xxc), 21); - if (b.Hc((Hbd(), zbd))) { - b.Mc(zbd); - b.Fc(Bbd); - } else if (b.Hc(Bbd)) { - b.Mc(Bbd); - b.Fc(zbd); - } - } - function e5b(a) { - var b; - if (!wNb(a, (Nyc(), xxc))) { - return; - } - b = BD(vNb(a, xxc), 21); - if (b.Hc((Hbd(), Gbd))) { - b.Mc(Gbd); - b.Fc(Ebd); - } else if (b.Hc(Ebd)) { - b.Mc(Ebd); - b.Fc(Gbd); - } - } - function udc(a, b, c2) { - Odd(c2, "Self-Loop ordering", 1); - MAb(NAb(JAb(JAb(LAb(new YAb(null, new Kub(b.b, 16)), new ydc()), new Adc()), new Cdc()), new Edc()), new Gdc(a)); - Qdd(c2); - } - function ikc(a, b, c2, d) { - var e, f2; - for (e = b; e < a.c.length; e++) { - f2 = (tCb(e, a.c.length), BD(a.c[e], 11)); - if (c2.Mb(f2)) { - d.c[d.c.length] = f2; - } else { - return e; - } - } - return a.c.length; - } - function Kmc(a, b, c2, d) { - var e, f2, g, h; - a.a == null && Nmc(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 ehd(a) { - var b, c2; - if (!a.b) { - a.b = Qu(BD(a.f, 33).Ag().i); - for (c2 = new Fyd(BD(a.f, 33).Ag()); c2.e != c2.i.gc(); ) { - b = BD(Dyd(c2), 137); - Ekb(a.b, new dhd(b)); - } - } - return a.b; - } - function fhd(a) { - var b, c2; - if (!a.e) { - a.e = Qu(Yod(BD(a.f, 33)).i); - for (c2 = new Fyd(Yod(BD(a.f, 33))); c2.e != c2.i.gc(); ) { - b = BD(Dyd(c2), 118); - Ekb(a.e, new thd(b)); - } - } - return a.e; - } - function ahd(a) { - var b, c2; - if (!a.a) { - a.a = Qu(Vod(BD(a.f, 33)).i); - for (c2 = new Fyd(Vod(BD(a.f, 33))); c2.e != c2.i.gc(); ) { - b = BD(Dyd(c2), 33); - Ekb(a.a, new hhd(a, b)); - } - } - return a.a; - } - function dKd(b) { - var c2; - if (!b.C && (b.D != null || b.B != null)) { - c2 = eKd(b); - if (c2) { - b.yk(c2); - } else { - try { - b.yk(null); - } catch (a) { - a = ubb(a); - if (!JD(a, 60)) - throw vbb(a); - } - } - } - return b.C; - } - function GJb(a) { - switch (a.q.g) { - case 5: - DJb(a, (Ucd(), Acd)); - DJb(a, Rcd); + case 34: + return 8; break; - case 4: - EJb(a, (Ucd(), Acd)); - EJb(a, Rcd); + case 35: break; - default: - FJb(a, (Ucd(), Acd)); - FJb(a, Rcd); - } - } - function PKb(a) { - switch (a.q.g) { - case 5: - MKb(a, (Ucd(), zcd)); - MKb(a, Tcd); + case 36: + return "EDGE_STATE"; break; - case 4: - NKb(a, (Ucd(), zcd)); - NKb(a, Tcd); + case 37: + this.begin("class"); + return 44; break; - default: - OKb(a, (Ucd(), zcd)); - OKb(a, Tcd); - } - } - function EXb(a, b) { - var c2, d, e; - e = new d7c(); - for (d = a.Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 37); - uXb(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 GXb(a, b) { - var c2, d, e; - e = new d7c(); - for (d = a.Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 37); - uXb(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 d_b(a) { - var b, c2, d; - d = Ohe; - for (c2 = new olb(a.a); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 10); - wNb(b, (wtc(), Zsc)) && (d = $wnd.Math.min(d, BD(vNb(b, Zsc), 19).a)); - } - return d; - } - function pHc(a, b) { - var c2, d; - if (b.length == 0) { - return 0; - } - c2 = NHc(a.a, b[0], (Ucd(), Tcd)); - c2 += NHc(a.a, b[b.length - 1], zcd); - for (d = 0; d < b.length; d++) { - c2 += qHc(a, d, b); - } - return c2; - } - function vQc() { - hQc(); - this.c = new Rkb(); - this.i = new Rkb(); - this.e = new zsb(); - this.f = new zsb(); - this.g = new zsb(); - this.j = new Rkb(); - this.a = new Rkb(); - this.b = new Lqb(); - this.k = new Lqb(); - } - function aKd(a, b) { - var c2, d; - if (a.Db >> 16 == 6) { - return a.Cb.ih(a, 5, o5, b); - } - return d = zUd(BD(XKd((c2 = BD(Ajd(a, 16), 26), !c2 ? a.zh() : c2), a.Db >> 16), 18)), a.Cb.ih(a, d.n, d.f, b); - } - function Wz(a) { - Rz(); - 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 []; - } - function jeb(a) { - var b; - b = (qeb(), peb); - 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; - } - function _jb(a) { - var b, c2, d; - if (a.b != a.c) { - return; - } - d = a.a.length; - c2 = geb($wnd.Math.max(8, d)) << 1; - if (a.b != 0) { - b = _Bb(a.a, c2); - $jb(a, b, d); - a.a = b; - a.b = 0; - } else { - dCb(a.a, c2); - } - a.c = d; - } - function DKb(a, b) { - var c2; - c2 = a.b; - return c2.Xe((Y9c(), s9c)) ? c2.Hf() == (Ucd(), Tcd) ? -c2.rf().a - Edb(ED(c2.We(s9c))) : b + Edb(ED(c2.We(s9c))) : c2.Hf() == (Ucd(), Tcd) ? -c2.rf().a : b; - } - function P_b(a) { - var b; - if (a.b.c.length != 0 && !!BD(Ikb(a.b, 0), 70).a) { - return BD(Ikb(a.b, 0), 70).a; - } - b = JZb(a); - if (b != null) { - return b; - } - return "" + (!a.c ? -1 : Jkb(a.c.a, a, 0)); - } - function C0b(a) { - var b; - if (a.f.c.length != 0 && !!BD(Ikb(a.f, 0), 70).a) { - return BD(Ikb(a.f, 0), 70).a; - } - b = JZb(a); - if (b != null) { - return b; - } - return "" + (!a.i ? -1 : Jkb(a.i.j, a, 0)); - } - function Ogc(a, b) { - var c2, d; - if (b < 0 || b >= a.gc()) { - return null; - } - for (c2 = b; c2 < a.gc(); ++c2) { - d = BD(a.Xb(c2), 128); - if (c2 == a.gc() - 1 || !d.o) { - return new vgd(meb(c2), d); - } - } - return null; - } - function uoc(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 = BD(Ikb(f2.a, e), 10); - if (!(g.k == (j0b(), d0b) || voc(g))) { - return false; - } - } - return true; - } - function u$c(a) { - var b, c2, d, e, f2; - f2 = 0; - e = Qje; - d = 0; - for (c2 = new olb(a.a); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 187); - f2 += b.r + (d > 0 ? a.c : 0); - e = $wnd.Math.max(e, b.d); - ++d; - } - a.e = f2; - a.b = e; - } - function shd(a) { - var b, c2; - if (!a.b) { - a.b = Qu(BD(a.f, 118).Ag().i); - for (c2 = new Fyd(BD(a.f, 118).Ag()); c2.e != c2.i.gc(); ) { - b = BD(Dyd(c2), 137); - Ekb(a.b, new dhd(b)); - } - } - return a.b; - } - function Ctd(a, b) { - var c2, d, e; - if (b.dc()) { - return LCd(), LCd(), KCd; - } else { - c2 = new zyd(a, b.gc()); - for (e = new Fyd(a); e.e != e.i.gc(); ) { - d = Dyd(e); - b.Hc(d) && wtd(c2, d); - } - return c2; - } - } - function bkd(a, b, c2, d) { - if (b == 0) { - return d ? (!a.o && (a.o = new dId((Thd(), Qhd), S2, a, 0)), a.o) : (!a.o && (a.o = new dId((Thd(), Qhd), S2, a, 0)), FAd(a.o)); - } - return fid(a, b, c2, d); - } - function Tnd(a) { - var b, c2; - if (a.rb) { - for (b = 0, c2 = a.rb.i; b < c2; ++b) { - Cmd(qud(a.rb, b)); - } - } - if (a.vb) { - for (b = 0, c2 = a.vb.i; b < c2; ++b) { - Cmd(qud(a.vb, b)); - } - } - u1d((O6d(), M6d), a); - a.Bb |= 1; - } - function _nd(a, b, c2, d, e, f2, g, h, i3, j, k, l, m, n) { - aod(a, b, d, null, e, f2, g, h, i3, j, m, true, n); - CUd(a, k); - JD(a.Cb, 88) && XMd($Kd(BD(a.Cb, 88)), 2); - !!c2 && DUd(a, c2); - EUd(a, l); - return a; - } - function jZd(b) { - var c2, d; - if (b == null) { - return null; - } - d = 0; - try { - d = Icb(b, Rie, Ohe) & aje; - } catch (a) { - a = ubb(a); - if (JD(a, 127)) { - c2 = rfb(b); - d = c2[0]; - } else - throw vbb(a); - } - return bdb(d); - } - function kZd(b) { - var c2, d; - if (b == null) { - return null; - } - d = 0; - try { - d = Icb(b, Rie, Ohe) & aje; - } catch (a) { - a = ubb(a); - if (JD(a, 127)) { - c2 = rfb(b); - d = c2[0]; - } else - throw vbb(a); - } - return bdb(d); - } - function bD(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 & Eje; - a.m = d & Eje; - a.h = e & Fje; - return true; - } - function Fwb(a, b, c2, d, e, f2, g) { - var h, i3; - if (b.Ae() && (i3 = a.a.ue(c2, d), i3 < 0 || !e && i3 == 0)) { - return false; - } - if (b.Be() && (h = a.a.ue(c2, f2), h > 0 || !g && h == 0)) { - return false; - } - return true; - } - function Vcc(a, b) { - Occ(); - var c2; - c2 = a.j.g - b.j.g; - if (c2 != 0) { - return 0; - } - switch (a.j.g) { - case 2: - return Ycc(b, Ncc) - Ycc(a, Ncc); - case 4: - return Ycc(a, Mcc) - Ycc(b, Mcc); - } - return 0; - } - function Tqc(a) { - switch (a.g) { - case 0: - return Mqc; - case 1: - return Nqc; - case 2: - return Oqc; - case 3: - return Pqc; - case 4: - return Qqc; - case 5: - return Rqc; - default: - return null; - } - } - function End(a, b, c2) { - var d, e; - d = (e = new rUd(), yId(e, b), pnd(e, c2), wtd((!a.c && (a.c = new cUd(p5, a, 12, 10)), a.c), e), e); - AId(d, 0); - DId(d, 1); - CId(d, true); - BId(d, true); - return d; - } - function tud(a, b) { - var c2, d; - if (b >= a.i) - throw vbb(new $zd(b, a.i)); - ++a.j; - c2 = a.g[b]; - d = a.i - b - 1; - d > 0 && $fb(a.g, b + 1, a.g, b, d); - NC(a.g, --a.i, null); - a.fi(b, c2); - a.ci(); - return c2; - } - function UId(a, b) { - var c2, d; - if (a.Db >> 16 == 17) { - return a.Cb.ih(a, 21, c5, b); - } - return d = zUd(BD(XKd((c2 = BD(Ajd(a, 16), 26), !c2 ? a.zh() : c2), a.Db >> 16), 18)), a.Cb.ih(a, d.n, d.f, b); - } - function iDb(a) { - var b, c2, d, e; - mmb(); - Okb(a.c, a.a); - for (e = new olb(a.c); e.a < e.c.c.length; ) { - d = mlb(e); - for (c2 = new olb(a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 679); - b.Ke(d); - } - } - } - function pXb(a) { - var b, c2, d, e; - mmb(); - Okb(a.c, a.a); - for (e = new olb(a.c); e.a < e.c.c.length; ) { - d = mlb(e); - for (c2 = new olb(a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 369); - b.Ke(d); - } - } - } - function AGb(a) { - var b, c2, d, e, f2; - e = Ohe; - f2 = null; - for (d = new olb(a.d); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 213); - 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 OSb() { - OSb = ccb; - MSb = new Nsd(Mme, (Bcb(), false)); - ISb = new Nsd(Nme, 100); - KSb = (yTb(), wTb); - JSb = new Nsd(Ome, KSb); - LSb = new Nsd(Pme, qme); - NSb = new Nsd(Qme, meb(Ohe)); - } - function ric(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - j = 0; - for (e = a.a[b], f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - k = CHc(d, c2); - for (i3 = k.Kc(); i3.Ob(); ) { - h = BD(i3.Pb(), 11); - Rhb(a.f, h, meb(j++)); - } - } - } - function uqd(a, b, c2) { - var d, e, f2, g; - if (c2) { - e = c2.a.length; - d = new Yge(e); - for (g = (d.b - d.a) * d.c < 0 ? (Xge(), Wge) : new she(d); g.Ob(); ) { - f2 = BD(g.Pb(), 19); - Rc(a, b, Vpd(tB(c2, f2.a))); - } - } - } - function vqd(a, b, c2) { - var d, e, f2, g; - if (c2) { - e = c2.a.length; - d = new Yge(e); - for (g = (d.b - d.a) * d.c < 0 ? (Xge(), Wge) : new she(d); g.Ob(); ) { - f2 = BD(g.Pb(), 19); - Rc(a, b, Vpd(tB(c2, f2.a))); - } - } - } - function Bkc(a) { - gkc(); - var b; - b = BD(Ee(Ec(a.k), KC(F1, bne, 61, 2, 0, 1)), 122); - Klb(b, 0, b.length, null); - if (b[0] == (Ucd(), Acd) && b[1] == Tcd) { - NC(b, 0, Tcd); - NC(b, 1, Acd); - } - return b; - } - function JHc(a, b, c2) { - var d, e, f2; - e = HHc(a, b, c2); - f2 = KHc(a, e); - yHc(a.b); - cIc(a, b, c2); - mmb(); - Okb(e, new hIc(a)); - d = KHc(a, e); - yHc(a.b); - cIc(a, c2, b); - return new vgd(meb(f2), meb(d)); - } - function jJc() { - jJc = ccb; - gJc = e3c(new j3c(), (qUb(), pUb), (S8b(), h8b)); - hJc = new Msd("linearSegments.inputPrio", meb(0)); - iJc = new Msd("linearSegments.outputPrio", meb(0)); - } - function yRc() { - yRc = ccb; - uRc = new ARc("P1_TREEIFICATION", 0); - vRc = new ARc("P2_NODE_ORDERING", 1); - wRc = new ARc("P3_NODE_PLACEMENT", 2); - xRc = new ARc("P4_EDGE_ROUTING", 3); - } - function ZWc() { - ZWc = ccb; - UWc = (Y9c(), C9c); - XWc = T9c; - NWc = Y8c; - OWc = _8c; - PWc = b9c; - MWc = W8c; - QWc = e9c; - TWc = x9c; - KWc = (HWc(), wWc); - LWc = xWc; - RWc = zWc; - SWc = BWc; - VWc = CWc; - WWc = DWc; - YWc = FWc; - } - function rbd() { - rbd = ccb; - qbd = new tbd("UNKNOWN", 0); - nbd = new tbd("ABOVE", 1); - obd = new tbd("BELOW", 2); - pbd = new tbd("INLINE", 3); - new Msd("org.eclipse.elk.labelSide", qbd); - } - function rud(a, b) { - var c2; - if (a.ni() && b != null) { - for (c2 = 0; c2 < a.i; ++c2) { - if (pb(b, a.g[c2])) { - return c2; - } - } - } else { - for (c2 = 0; c2 < a.i; ++c2) { - if (PD(a.g[c2]) === PD(b)) { - return c2; - } - } - } - return -1; - } - function DZb(a, b, c2) { - var d, e; - if (b.c == (KAc(), IAc) && c2.c == HAc) { - return -1; - } else if (b.c == HAc && c2.c == IAc) { - return 1; - } - d = HZb(b.a, a.a); - e = HZb(c2.a, a.a); - return b.c == IAc ? e - d : d - e; - } - function Z_b(a, b, c2) { - if (!!c2 && (b < 0 || b > c2.a.c.length)) { - throw vbb(new Wdb("index must be >= 0 and <= layer node count")); - } - !!a.c && Lkb(a.c.a, a); - a.c = c2; - !!c2 && Dkb(c2.a, b, a); - } - function p7b(a, b) { - var c2, d, e; - for (d = new Sr(ur(O_b(a).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 17); - e = BD(b.Kb(c2), 10); - return new cc(Qb(e.n.b + e.o.b / 2)); - } - return wb(), wb(), vb; - } - function rMc(a, b) { - this.c = new Lqb(); - this.a = a; - this.b = b; - this.d = BD(vNb(a, (wtc(), otc)), 304); - PD(vNb(a, (Nyc(), yxc))) === PD((_qc(), Zqc)) ? this.e = new bNc() : this.e = new WMc(); - } - function $dd(a, b) { - var c2, d, e, f2; - f2 = 0; - for (d = new olb(a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 33); - f2 += $wnd.Math.pow(c2.g * c2.f - b, 2); - } - e = $wnd.Math.sqrt(f2 / (a.c.length - 1)); - return e; - } - function bgd(a, b) { - var c2, d; - d = null; - if (a.Xe((Y9c(), O9c))) { - c2 = BD(a.We(O9c), 94); - c2.Xe(b) && (d = c2.We(b)); - } - d == null && !!a.yf() && (d = a.yf().We(b)); - d == null && (d = Ksd(b)); - return d; - } - function Vt(b, c2) { - var d, e; - d = b.Zc(c2); - try { - e = d.Pb(); - d.Qb(); - return e; - } catch (a) { - a = ubb(a); - if (JD(a, 109)) { - throw vbb(new qcb("Can't remove element " + c2)); - } else - throw vbb(a); - } - } - function qA(a, b) { - var c2, d, e; - d = new eB(); - e = new fB(d.q.getFullYear() - nje, d.q.getMonth(), d.q.getDate()); - c2 = pA(a, b, e); - if (c2 == 0 || c2 < b.length) { - throw vbb(new Wdb(b)); - } - return e; - } - function _tb(a, b) { - var c2, d, e; - uCb(b); - lCb(b != a); - e = a.b.c.length; - for (d = b.Kc(); d.Ob(); ) { - c2 = d.Pb(); - Ekb(a.b, uCb(c2)); - } - if (e != a.b.c.length) { - aub(a, 0); - return true; - } - return false; - } - function bTb() { - bTb = ccb; - VSb = (Y9c(), O8c); - new Osd(B8c, (Bcb(), true)); - YSb = Y8c; - ZSb = _8c; - $Sb = b9c; - XSb = W8c; - _Sb = e9c; - aTb = x9c; - USb = (OSb(), MSb); - SSb = JSb; - TSb = LSb; - WSb = NSb; - RSb = ISb; - } - function MZb(a, b) { - if (b == a.c) { - return a.d; - } else if (b == a.d) { - return a.c; - } else { - throw vbb(new Wdb("'port' must be either the source port or target port of the edge.")); - } - } - function C3b(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; - } - } - function H6b(a, b, c2, d) { - var e, f2, g, h; - $_b(b, BD(d.Xb(0), 29)); - h = d.bd(1, d.gc()); - for (f2 = BD(c2.Kb(b), 20).Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 17); - g = e.c.i == b ? e.d.i : e.c.i; - H6b(a, g, c2, h); - } - } - function Xec(a) { - var b; - b = new Lqb(); - if (wNb(a, (wtc(), ttc))) { - return BD(vNb(a, ttc), 83); - } - MAb(JAb(new YAb(null, new Kub(a.j, 16)), new Zec()), new _ec(b)); - yNb(a, ttc, b); - return b; - } - function cmd(a, b) { - var c2, d; - if (a.Db >> 16 == 6) { - return a.Cb.ih(a, 6, B2, b); - } - return d = zUd(BD(XKd((c2 = BD(Ajd(a, 16), 26), !c2 ? (Thd(), Lhd) : c2), a.Db >> 16), 18)), a.Cb.ih(a, d.n, d.f, b); - } - function Eod(a, b) { - var c2, d; - if (a.Db >> 16 == 7) { - return a.Cb.ih(a, 1, C2, b); - } - return d = zUd(BD(XKd((c2 = BD(Ajd(a, 16), 26), !c2 ? (Thd(), Nhd) : c2), a.Db >> 16), 18)), a.Cb.ih(a, d.n, d.f, b); - } - function lpd(a, b) { - var c2, d; - if (a.Db >> 16 == 9) { - return a.Cb.ih(a, 9, E2, b); - } - return d = zUd(BD(XKd((c2 = BD(Ajd(a, 16), 26), !c2 ? (Thd(), Phd) : c2), a.Db >> 16), 18)), a.Cb.ih(a, d.n, d.f, b); - } - function mQd(a, b) { - var c2, d; - if (a.Db >> 16 == 5) { - return a.Cb.ih(a, 9, h5, b); - } - return d = zUd(BD(XKd((c2 = BD(Ajd(a, 16), 26), !c2 ? (jGd(), VFd) : c2), a.Db >> 16), 18)), a.Cb.ih(a, d.n, d.f, b); - } - function KHd(a, b) { - var c2, d; - if (a.Db >> 16 == 3) { - return a.Cb.ih(a, 0, k5, b); - } - return d = zUd(BD(XKd((c2 = BD(Ajd(a, 16), 26), !c2 ? (jGd(), OFd) : c2), a.Db >> 16), 18)), a.Cb.ih(a, d.n, d.f, b); - } - function Snd(a, b) { - var c2, d; - if (a.Db >> 16 == 7) { - return a.Cb.ih(a, 6, o5, b); - } - return d = zUd(BD(XKd((c2 = BD(Ajd(a, 16), 26), !c2 ? (jGd(), cGd) : c2), a.Db >> 16), 18)), a.Cb.ih(a, d.n, d.f, b); - } - function ird() { - this.a = new bqd(); - this.g = new wo(); - this.j = new wo(); - this.b = new Lqb(); - this.d = new wo(); - this.i = new wo(); - this.k = new Lqb(); - this.c = new Lqb(); - this.e = new Lqb(); - this.f = new Lqb(); - } - function MCd(a, b, c2) { - var d, e, f2; - c2 < 0 && (c2 = 0); - f2 = a.i; - for (e = c2; e < f2; e++) { - d = qud(a, e); - if (b == null) { - if (d == null) { - return e; - } - } else if (PD(b) === PD(d) || pb(b, d)) { - return e; - } - } - return -1; - } - function b1d(a, b) { - var c2, d; - c2 = b.Hh(a.a); - if (!c2) { - return null; - } else { - d = GD(AAd((!c2.b && (c2.b = new sId((jGd(), fGd), x6, c2)), c2.b), Awe)); - return dfb(Bwe, d) ? u1d(a, bKd(b.Hj())) : d; - } - } - function p6d(a, b) { - var c2, d; - if (b) { - if (b == a) { - return true; - } - c2 = 0; - for (d = BD(b, 49).eh(); !!d && d != b; d = d.eh()) { - if (++c2 > Wje) { - return p6d(a, d); - } - if (d == a) { - return true; - } - } - } - return false; - } - function HKb(a) { - CKb(); - switch (a.q.g) { - case 5: - EKb(a, (Ucd(), Acd)); - EKb(a, Rcd); + case 38: + this.popState(); + return 8; break; - case 4: - FKb(a, (Ucd(), Acd)); - FKb(a, Rcd); + case 39: break; - default: - GKb(a, (Ucd(), Acd)); - GKb(a, Rcd); - } - } - function LKb(a) { - CKb(); - switch (a.q.g) { - case 5: - IKb(a, (Ucd(), zcd)); - IKb(a, Tcd); + case 40: + this.popState(); + this.popState(); + return 39; break; - case 4: - JKb(a, (Ucd(), zcd)); - JKb(a, Tcd); + 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; - default: - KKb(a, (Ucd(), zcd)); - KKb(a, Tcd); - } - } - function XQb(a) { - var b, c2; - b = BD(vNb(a, (wSb(), pSb)), 19); - if (b) { - c2 = b.a; - c2 == 0 ? yNb(a, (HSb(), GSb), new Gub()) : yNb(a, (HSb(), GSb), new Hub(c2)); - } else { - yNb(a, (HSb(), GSb), new Hub(1)); - } - } - function V$b(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; - } - function hbc(a, b) { - switch (a.g) { - case 0: - return b == (Ctc(), ytc) ? dbc : ebc; - case 1: - return b == (Ctc(), ytc) ? dbc : cbc; - case 2: - return b == (Ctc(), ytc) ? cbc : ebc; - default: - return cbc; - } - } - function v$c(a, b) { - var c2, d, e; - Lkb(a.a, b); - a.e -= b.r + (a.a.c.length == 0 ? 0 : a.c); - e = ere; - for (d = new olb(a.a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 187); - e = $wnd.Math.max(e, c2.d); - } - a.b = e; - } - function Lld(a, b) { - var c2, d; - if (a.Db >> 16 == 3) { - return a.Cb.ih(a, 12, E2, b); - } - return d = zUd(BD(XKd((c2 = BD(Ajd(a, 16), 26), !c2 ? (Thd(), Khd) : c2), a.Db >> 16), 18)), a.Cb.ih(a, d.n, d.f, b); - } - function Uod(a, b) { - var c2, d; - if (a.Db >> 16 == 11) { - return a.Cb.ih(a, 10, E2, b); - } - return d = zUd(BD(XKd((c2 = BD(Ajd(a, 16), 26), !c2 ? (Thd(), Ohd) : c2), a.Db >> 16), 18)), a.Cb.ih(a, d.n, d.f, b); - } - function PSd(a, b) { - var c2, d; - if (a.Db >> 16 == 10) { - return a.Cb.ih(a, 11, c5, b); - } - return d = zUd(BD(XKd((c2 = BD(Ajd(a, 16), 26), !c2 ? (jGd(), aGd) : c2), a.Db >> 16), 18)), a.Cb.ih(a, d.n, d.f, b); - } - function qUd(a, b) { - var c2, d; - if (a.Db >> 16 == 10) { - return a.Cb.ih(a, 12, n5, b); - } - return d = zUd(BD(XKd((c2 = BD(Ajd(a, 16), 26), !c2 ? (jGd(), dGd) : c2), a.Db >> 16), 18)), a.Cb.ih(a, d.n, d.f, b); - } - function wId(a) { - var b; - if ((a.Bb & 1) == 0 && !!a.r && a.r.kh()) { - b = BD(a.r, 49); - a.r = BD(xid(a, b), 138); - a.r != b && (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 9, 8, b, a.r)); - } - return a.r; - } - function yHb(a, b, c2) { - var d; - d = OC(GC(UD, 1), Vje, 25, 15, [BHb(a, (gHb(), dHb), b, c2), BHb(a, eHb, b, c2), BHb(a, fHb, b, c2)]); - if (a.f) { - d[0] = $wnd.Math.max(d[0], d[2]); - d[2] = d[0]; - } - return d; - } - function O9b(a, b) { - var c2, d, e; - e = V9b(a, b); - if (e.c.length == 0) { - return; - } - Okb(e, new pac()); - c2 = e.c.length; - for (d = 0; d < c2; d++) { - K9b(a, (tCb(d, e.c.length), BD(e.c[d], 286)), R9b(a, e, d)); - } - } - function qkc(a) { - var b, c2, d, e; - for (e = BD(Qc(a.a, (Xjc(), Sjc)), 15).Kc(); e.Ob(); ) { - d = BD(e.Pb(), 101); - for (c2 = Ec(d.k).Kc(); c2.Ob(); ) { - b = BD(c2.Pb(), 61); - kkc(a, d, b, (Fkc(), Dkc), 1); - } - } - } - function voc(a) { - var b, c2; - if (a.k == (j0b(), g0b)) { - for (c2 = new Sr(ur(O_b(a).a.Kc(), new Sq())); Qr(c2); ) { - b = BD(Rr(c2), 17); - if (!OZb(b) && a.c == LZb(b, a).c) { - return true; - } - } } - return false; - } - function JNc(a) { - var b, c2; - if (a.k == (j0b(), g0b)) { - for (c2 = new Sr(ur(O_b(a).a.Kc(), new Sq())); Qr(c2); ) { - b = BD(Rr(c2), 17); - if (!OZb(b) && b.c.i.c == b.d.i.c) { - return true; - } - } + }, "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; + }(); + parser22.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser22; + parser22.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; } - return false; - } - function HUc(a, b) { - var c2, d, e, f2; - Odd(b, "Dull edge routing", 1); - for (f2 = Jsb(a.b, 0); f2.b != f2.d.c; ) { - e = BD(Xsb(f2), 86); - for (d = Jsb(e.d, 0); d.b != d.d.c; ) { - c2 = BD(Xsb(d), 188); - Osb(c2.a); + 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 xqd(a, b) { - var c2, d, e, f2, g; - if (b) { - e = b.a.length; - c2 = new Yge(e); - for (g = (c2.b - c2.a) * c2.c < 0 ? (Xge(), Wge) : new she(c2); g.Ob(); ) { - f2 = BD(g.Pb(), 19); - d = Zpd(b, f2.a); - !!d && ard(a, d); - } - } + } 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 (/[$*]/.exec(lastChar)) { + potentialClassifier = lastChar; + } + 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 id27 = common_default.sanitizeText(_id, getConfig2()); + let genericType = ""; + let className = id27; + if (id27.indexOf("~") > 0) { + const split = id27.split("~"); + className = sanitizeText5(split[0]); + genericType = sanitizeText5(split[1]); + } + return { className, type: genericType }; + }, "splitClassNameAndType"); + setClassLabel = /* @__PURE__ */ __name(function(_id, label) { + const id27 = common_default.sanitizeText(_id, getConfig2()); + if (label) { + label = sanitizeText5(label); + } + const { className } = splitClassNameAndType(id27); + classes2.get(className).label = label; + }, "setClassLabel"); + addClass3 = /* @__PURE__ */ __name(function(_id) { + const id27 = common_default.sanitizeText(_id, getConfig2()); + const { className, type: type3 } = splitClassNameAndType(id27); + 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 id27 = common_default.sanitizeText(_id, getConfig2()); + if (classes2.has(id27)) { + return classes2.get(id27).domId; + } + throw new Error("Class not found: " + id27); + }, "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(id27) { + return classes2.get(id27); + }, "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 id27 = _id; + if (/\d/.exec(_id[0])) { + id27 = MERMAID_DOM_ID_PREFIX2 + id27; + } + const classNode = classes2.get(id27); + if (classNode) { + classNode.cssClasses.push(className); + } + }); + }, "setCssClass"); + setTooltip2 = /* @__PURE__ */ __name(function(ids, tooltip) { + ids.split(",").forEach(function(id27) { + if (tooltip !== void 0) { + classes2.get(id27).tooltip = sanitizeText5(tooltip); + } + }); + }, "setTooltip"); + getTooltip2 = /* @__PURE__ */ __name(function(id27, namespace) { + if (namespace && namespaces.has(namespace)) { + return namespaces.get(namespace).classes.get(id27).tooltip; + } + return classes2.get(id27).tooltip; + }, "getTooltip"); + setLink3 = /* @__PURE__ */ __name(function(ids, linkStr, target) { + const config6 = getConfig2(); + ids.split(",").forEach(function(_id) { + let id27 = _id; + if (/\d/.exec(_id[0])) { + id27 = MERMAID_DOM_ID_PREFIX2 + id27; + } + const theClass = classes2.get(id27); + 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 DZd() { - tZd(); - var a, b; - xZd((NFd(), MFd)); - wZd(MFd); - Tnd(MFd); - FQd = (jGd(), YFd); - for (b = new olb(rZd); b.a < b.c.c.length; ) { - a = BD(mlb(b), 241); - QQd(a, YFd, null); - } - return true; + } + }); + setCssClass(ids, "clickable"); + }, "setLink"); + setClickEvent3 = /* @__PURE__ */ __name(function(ids, functionName, functionArgs) { + ids.split(",").forEach(function(id27) { + setClickFunc(id27, functionName, functionArgs); + classes2.get(id27).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 id27 = domId; + if (classes2.has(id27)) { + const elemId = lookUpDomId2(id27); + 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 eD(a, b) { - var c2, d, e, f2, g, h, i3, j; - i3 = a.h >> 19; - j = b.h >> 19; - if (i3 != j) { - return j - i3; - } - 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 fFb() { - fFb = ccb; - eFb = (rFb(), oFb); - dFb = new Nsd(Yke, eFb); - cFb = (UEb(), TEb); - bFb = new Nsd(Zke, cFb); - aFb = (MEb(), LEb); - _Eb = new Nsd($ke, aFb); - $Eb = new Nsd(_ke, (Bcb(), true)); - } - function cfc(a, b, c2) { - var d, e; - d = b * c2; - if (JD(a.g, 145)) { - e = ugc(a); - if (e.f.d) { - e.f.a || (a.d.a += d + ple); - } else { - a.d.d -= d + ple; - a.d.a += d + ple; - } - } else if (JD(a.g, 10)) { - a.d.d -= d; - a.d.a += 2 * d; - } - } - function vmc(a, b, c2) { - var d, e, f2, g, h; - e = a[c2.g]; - for (h = new olb(b.d); h.a < h.c.c.length; ) { - g = BD(mlb(h), 101); - f2 = g.i; - if (!!f2 && f2.i == c2) { - d = g.d[c2.g]; - e[d] = $wnd.Math.max(e[d], f2.j.b); - } - } - } - function AZc(a, b) { - var c2, d, e, f2, g; - d = 0; - e = 0; - c2 = 0; - for (g = new olb(b.d); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 443); - a$c(f2); - d = $wnd.Math.max(d, f2.b); - e += f2.d + (c2 > 0 ? a.g : 0); - ++c2; - } - b.b = d; - b.e = e; - } - function to(a) { - var b, c2, d; - d = a.b; - if (Lp(a.i, d.length)) { - c2 = d.length * 2; - a.b = KC(GF, Gie, 317, c2, 0, 1); - a.c = KC(GF, Gie, 317, c2, 0, 1); - a.f = c2 - 1; - a.i = 0; - for (b = a.a; b; b = b.c) { - po(a, b, b); - } - ++a.g; - } - } - function cNb(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; - YMb(b, e, g) ? jNb(a, f2, h) || lNb(a, f2, h) : $Mb(b, e, g) && (hNb(a, f2, h) || mNb(a, f2, h)); - } - } - } - function Ooc(a, b, c2) { - var d; - d = b.c.i; - if (d.k == (j0b(), g0b)) { - yNb(a, (wtc(), Vsc), BD(vNb(d, Vsc), 11)); - yNb(a, Wsc, BD(vNb(d, Wsc), 11)); - } else { - yNb(a, (wtc(), Vsc), b.c); - yNb(a, Wsc, c2.d); - } - } - function l6c(a, b, c2) { - i6c(); - var d, e, f2, g, h, i3; - g = b / 2; - f2 = c2 / 2; - d = $wnd.Math.abs(a.a); - e = $wnd.Math.abs(a.b); - h = 1; - i3 = 1; - d > g && (h = g / d); - e > f2 && (i3 = f2 / e); - Y6c(a, $wnd.Math.min(h, i3)); - return a; - } - function ond() { - Smd(); - var b, c2; - try { - c2 = BD(mUd((yFd(), xFd), yte), 2014); - if (c2) { - return c2; - } - } catch (a) { - a = ubb(a); - if (JD(a, 102)) { - b = a; - uvd((h0d(), b)); - } else - throw vbb(a); - } - return new knd(); - } - function Y9d() { - A9d(); - var b, c2; - try { - c2 = BD(mUd((yFd(), xFd), Ewe), 2024); - if (c2) { - return c2; - } - } catch (a) { - a = ubb(a); - if (JD(a, 102)) { - b = a; - uvd((h0d(), b)); - } else - throw vbb(a); - } - return new U9d(); - } - function qZd() { - Smd(); - var b, c2; - try { - c2 = BD(mUd((yFd(), xFd), _ve), 1941); - if (c2) { - return c2; - } - } catch (a) { - a = ubb(a); - if (JD(a, 102)) { - b = a; - uvd((h0d(), b)); - } else - throw vbb(a); - } - return new mZd(); - } - function HQd(a, b, c2) { - var d, e; - e = a.e; - a.e = b; - if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - d = new nSd(a, 1, 4, e, b); - !c2 ? c2 = d : c2.Ei(d); - } - e != b && (b ? c2 = QQd(a, MQd(a, b), c2) : c2 = QQd(a, a.a, c2)); - return c2; - } - function nB() { - eB.call(this); - this.e = -1; - this.a = false; - this.p = Rie; - 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 = Rie; - } - function qEb(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 = Kdb(d, e); - if (c2 == 0) { - if (!a.a && b.a) { - return -1; - } else if (!b.a && a.a) { - return 1; + }); + } + }, "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(id27) { + if (namespaces.has(id27)) { + return; + } + namespaces.set(id27, { + id: id27, + classes: /* @__PURE__ */ new Map(), + children: {}, + domId: MERMAID_DOM_ID_PREFIX2 + id27 + "-" + namespaceCounter + }); + namespaceCounter++; + }, "addNamespace"); + getNamespace = /* @__PURE__ */ __name(function(name) { + return namespaces.get(name); + }, "getNamespace"); + getNamespaces = /* @__PURE__ */ __name(function() { + return namespaces; + }, "getNamespaces"); + addClassesToNamespace = /* @__PURE__ */ __name(function(id27, classNames) { + if (!namespaces.has(id27)) { + return; + } + for (const name of classNames) { + const { className } = splitClassNameAndType(name); + classes2.get(className).parent = id27; + namespaces.get(id27).classes.set(className, classes2.get(className)); + } + }, "addClassesToNamespace"); + setCssStyle = /* @__PURE__ */ __name(function(id27, styles3) { + const thisClass = classes2.get(id27); + 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 id27 = classDef.id; + const classInfo = { + id: id27, + label: classDef.id, + width: 0, + height: 0 + }; + const g2 = elem.append("g").attr("id", diagObj.db.lookUpDomId(id27)).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 id27 = note3.id; + const noteInfo = { + id: id27, + text: note3.text, + width: 0, + height: 0 + }; + const g2 = elem.append("g").attr("id", id27).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, id27, _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" + id27); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const diagram24 = root4.select(`[id='${id27}']`); + insertMarkers3(diagram24); + 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(diagram24, 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(diagram24, 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 + } } - } - return c2; + }, + "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(diagram24, g2.edge(e3), g2.edge(e3).relation, conf8, diagObj); + } + }); + const svgBounds = diagram24.node().getBBox(); + const width3 = svgBounds.width + padding * 2; + const height2 = svgBounds.height + padding * 2; + configureSvgSize(diagram24, height2, width3, conf8.useMaxWidth); + const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width3} ${height2}`; + log.debug(`viewBox ${vBox}`); + diagram24.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, id27) => { + markerArray.forEach((markerName) => { + markers2[markerName](elem, type3, id27); + }); + }, "insertMarkers"); + extension2 = /* @__PURE__ */ __name((elem, type3, id27) => { + log.trace("Making markers for ", id27); + elem.append("defs").append("marker").attr("id", id27 + "_" + 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", id27 + "_" + 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, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + 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", id27 + "_" + 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, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + 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", id27 + "_" + 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, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + 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", id27 + "_" + 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, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + 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", id27 + "_" + 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, id27) => { + elem.append("marker").attr("id", id27 + "_" + 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", id27 + "_" + 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, id27) => { + elem.append("marker").attr("id", id27 + "_" + 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", id27 + "_" + 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, id27) => { + elem.append("marker").attr("id", id27 + "_" + 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", id27 + "_" + 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, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + 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((id27, ancestorId) => { + log.trace("In isDescendant", ancestorId, " ", id27, " = ", descendants2[ancestorId].includes(id27)); + if (descendants2[ancestorId].includes(id27)) { + 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 eOb(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 = Kdb(d, e); - if (c2 == 0) { - if (!a.a && b.a) { - return -1; - } else if (!b.a && a.a) { - return 1; - } + 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); } - return c2; - } - function PVb(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 = Kdb(d, e); - if (c2 == 0) { - if (!a.a && b.a) { - return -1; - } else if (!b.a && a.a) { - return 1; + }); + } + log.debug("Removing node", node2); + graph.removeNode(node2); + }); + }, "copy"); + extractDescendants2 = /* @__PURE__ */ __name((id27, graph) => { + const children2 = graph.children(id27); + let res = [...children2]; + for (const child of children2) { + parents2[child] = id27; + res = [...res, ...extractDescendants2(child, graph)]; + } + return res; + }, "extractDescendants"); + findNonClusterChild2 = /* @__PURE__ */ __name((id27, graph) => { + log.trace("Searching", id27); + const children2 = graph.children(id27); + log.trace("Searching children of id ", id27, children2); + if (children2.length < 1) { + log.trace("This is a valid node", id27); + return id27; + } + for (const child of children2) { + const _id = findNonClusterChild2(child, graph); + if (_id) { + log.trace("Found replacement for", id27, " => ", _id); + return _id; + } + } + }, "findNonClusterChild"); + getAnchorId2 = /* @__PURE__ */ __name((id27) => { + if (!clusterDb2[id27]) { + return id27; + } + if (!clusterDb2[id27].externalConnections) { + return id27; + } + if (clusterDb2[id27]) { + return clusterDb2[id27].id; + } + return id27; + }, "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(id27) { + const children2 = graph.children(id27); + if (children2.length > 0) { + log.warn( + "Cluster identified", + id27, + " Replacement id in edges: ", + findNonClusterChild2(id27, graph) + ); + descendants2[id27] = extractDescendants2(id27, graph); + clusterDb2[id27] = { id: findNonClusterChild2(id27, graph), clusterData: graph.node(id27) }; + } + }); + graph.nodes().forEach(function(id27) { + const children2 = graph.children(id27); + const edges5 = graph.edges(); + if (children2.length > 0) { + log.debug("Cluster identified", id27, descendants2); + edges5.forEach((edge) => { + if (edge.v !== id27 && edge.w !== id27) { + const d1 = isDescendant3(edge.v, id27); + const d2 = isDescendant3(edge.w, id27); + if (d1 ^ d2) { + log.warn("Edge: ", edge, " leaves cluster ", id27); + log.warn("Descendants of XXX ", id27, ": ", descendants2[id27]); + clusterDb2[id27].externalConnections = true; } } - return c2; - } - function ZTb() { - ZTb = ccb; - WTb = c3c(e3c(e3c(e3c(new j3c(), (qUb(), oUb), (S8b(), m8b)), oUb, q8b), pUb, x8b), pUb, a8b); - YTb = e3c(e3c(new j3c(), oUb, S7b), oUb, b8b); - XTb = c3c(new j3c(), pUb, d8b); - } - function s3b(a) { - var b, c2, d, e, f2; - b = BD(vNb(a, (wtc(), Csc)), 83); - f2 = a.n; - for (d = b.Cc().Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 306); - e = c2.i; - e.c += f2.a; - e.d += f2.b; - c2.c ? VHb(c2) : XHb(c2); - } - yNb(a, Csc, null); - } - function qmc(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; - } + }); + } else { + log.debug("Not a cluster ", id27, descendants2); + } + }); + for (let id27 of Object.keys(clusterDb2)) { + const nonClusterChild = clusterDb2[id27].id; + const parent4 = graph.parent(nonClusterChild); + if (parent4 !== id27 && clusterDb2[parent4] && !clusterDb2[parent4].externalConnections) { + clusterDb2[id27].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, id27, diagramType) => { + if (edge.arrowTypeStart) { + addEdgeMarker2(svgPath, "start", edge.arrowTypeStart, url, id27, diagramType); + } + if (edge.arrowTypeEnd) { + addEdgeMarker2(svgPath, "end", edge.arrowTypeEnd, url, id27, 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, id27, 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}#${id27}_${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 BXc(a) { - var b, c2, d, e, f2; - d = 0; - e = dme; - if (a.b) { - for (b = 0; b < 360; b++) { - c2 = b * 0.017453292519943295; - zXc(a, a.d, 0, 0, dre, c2); - f2 = a.b.ig(a.d); - if (f2 < e) { - d = c2; - e = f2; - } - } - } - zXc(a, a.d, 0, 0, dre, d); - } - function E$c(a, b) { - var c2, d, e, f2; - f2 = new Lqb(); - b.e = null; - b.f = null; - for (d = new olb(b.i); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 65); - e = BD(Ohb(a.g, c2.a), 46); - c2.a = D6c(c2.b); - Rhb(f2, c2.a, e); - } - a.g = f2; - } - function t$c(a, b, c2) { - var d, e, f2, g, h, i3; - e = b - a.e; - f2 = e / a.d.c.length; - g = 0; - for (i3 = new olb(a.d); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 443); - d = a.b - h.b + c2; - _Zc(h, h.e + g * f2, h.f); - XZc(h, f2, d); - ++g; - } - } - function YBd(a) { - var b; - a.f.qj(); - if (a.b != -1) { - ++a.b; - b = a.f.d[a.a]; - if (a.b < b.i) { - return; - } - ++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; - } - } - a.b = -1; - } - function j0d(a, b) { - var c2, d, e; - e = b.c.length; - c2 = l0d(a, e == 0 ? "" : (tCb(0, b.c.length), GD(b.c[0]))); - for (d = 1; d < e && !!c2; ++d) { - c2 = BD(c2, 49).oh((tCb(d, b.c.length), GD(b.c[d]))); - } - return c2; - } - function rEc(a, b) { - var c2, d; - for (d = new olb(b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 10); - a.c[c2.c.p][c2.p].a = Aub(a.i); - a.c[c2.c.p][c2.p].d = Edb(a.c[c2.c.p][c2.p].a); - a.c[c2.c.p][c2.p].b = 1; - } - } - function _dd(a, b) { - var c2, d, e, f2; - f2 = 0; - for (d = new olb(a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 157); - f2 += $wnd.Math.pow(red(c2) * qed(c2) - b, 2); - } - e = $wnd.Math.sqrt(f2 / (a.c.length - 1)); - return e; - } - function LHc(a, b, c2, d) { - var e, f2, g; - f2 = GHc(a, b, c2, d); - g = MHc(a, f2); - bIc(a, b, c2, d); - yHc(a.b); - mmb(); - Okb(f2, new lIc(a)); - e = MHc(a, f2); - bIc(a, c2, b, d); - yHc(a.b); - return new vgd(meb(g), meb(e)); - } - function cJc(a, b, c2) { - var d, e; - Odd(c2, "Interactive node placement", 1); - a.a = BD(vNb(b, (wtc(), otc)), 304); - for (e = new olb(b.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 29); - bJc(a, d); - } - Qdd(c2); - } - function MVc(a, b) { - var c2; - Odd(b, "General Compactor", 1); - b.n && !!a && Tdd(b, i6d(a), (pgd(), mgd)); - c2 = qWc(BD(hkd(a, (ZWc(), LWc)), 380)); - c2.hg(a); - b.n && !!a && Tdd(b, i6d(a), (pgd(), mgd)); - } - function Dfd(a, b, c2) { - var d, e; - nmd(a, a.j + b, a.k + c2); - for (e = new Fyd((!a.a && (a.a = new xMd(y2, a, 5)), a.a)); e.e != e.i.gc(); ) { - d = BD(Dyd(e), 469); - ukd(d, d.a + b, d.b + c2); - } - gmd(a, a.b + b, a.c + c2); - } - function vld(a, b, c2, d) { - switch (c2) { - case 7: - return !a.e && (a.e = new y5d(B2, a, 7, 4)), Sxd(a.e, b, d); - case 8: - return !a.d && (a.d = new y5d(B2, a, 8, 5)), Sxd(a.d, b, d); - } - return Fkd(a, b, c2, d); + isInside = true; + } else { + lastPointOutside = point8; + if (!isInside) { + points.push(point8); } - function wld(a, b, c2, d) { - switch (c2) { - case 7: - return !a.e && (a.e = new y5d(B2, a, 7, 4)), Txd(a.e, b, d); - case 8: - return !a.d && (a.d = new y5d(B2, a, 8, 5)), Txd(a.d, b, d); + } + }); + return points; + }, "cutPathAtIntersect"); + insertEdge2 = /* @__PURE__ */ __name(function(elem, e3, edge, clusterDb3, diagramType, graph, id27) { + 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, id27, 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, id27, 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, + id27, + 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); } - return Gkd(a, b, c2, d); } - function lqd(a, b, c2) { - var d, e, f2, g, h; - if (c2) { - f2 = c2.a.length; - d = new Yge(f2); - for (h = (d.b - d.a) * d.c < 0 ? (Xge(), Wge) : new she(d); h.Ob(); ) { - g = BD(h.Pb(), 19); - e = Zpd(c2, g.a); - !!e && drd(a, e, 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); + } + } + }); + 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, id27); + 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, id27) => { + markers_default2(elem, markers3, diagramType, id27); + 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, id27, 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 edgeData2 = { + 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, edgeData2, edgeId); + }); + }, "addNotes"); + addRelations = /* @__PURE__ */ __name(function(relations3, g2) { + const conf8 = getConfig2().flowchart; + let cnt4 = 0; + relations3.forEach(function(edge) { + cnt4++; + const edgeData2 = { + //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(edgeData2, edge); + if (edge.style !== void 0) { + const styles3 = getStylesFromArray(edge.style); + edgeData2.style = styles3.style; + edgeData2.labelStyle = styles3.labelStyle; + } + edge.text = edge.title; + if (edge.text === void 0) { + if (edge.style !== void 0) { + edgeData2.arrowheadStyle = "fill: #333"; + } + } else { + edgeData2.arrowheadStyle = "fill: #333"; + edgeData2.labelpos = "c"; + if (getConfig2().flowchart?.htmlLabels ?? getConfig2().htmlLabels) { + edgeData2.labelType = "html"; + edgeData2.label = '' + edge.text + ""; + } else { + edgeData2.labelType = "text"; + edgeData2.label = edge.text.replace(common_default.lineBreakRegex, "\n"); + if (edge.style === void 0) { + edgeData2.style = edgeData2.style || "stroke: #333; stroke-width: 1.5px;fill:none"; } + edgeData2.labelStyle = edgeData2.labelStyle.replace("color:", "fill:"); } - function HAd(a, b, c2) { - var d, e, f2, g, h; - a.qj(); - f2 = b == null ? 0 : tb(b); - if (a.f > 0) { - g = (f2 & Ohe) % a.d.length; - e = wAd(a, g, f2, b); - if (e) { - h = e.ed(c2); - return h; + } + g2.setEdge(edge.id1, edge.id2, edgeData2, cnt4); + }); + }, "addRelations"); + setConf5 = /* @__PURE__ */ __name(function(cnf) { + conf5 = { + ...conf5, + ...cnf + }; + }, "setConf"); + draw13 = /* @__PURE__ */ __name(async function(text2, id27, _version, diagObj) { + log.info("Drawing class - ", id27); + 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, id27, diagObj); + addClasses(classes6, g2, id27, diagObj); + addRelations(relations3, g2); + addNotes(notes2, g2, relations3.length + 1, classes6); + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id27); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const svg = root4.select(`[id="${id27}"]`); + const element3 = root4.select("#" + id27 + " g"); + await render5( + element3, + g2, + ["aggregation", "extension", "composition", "dependency", "lollipop"], + "classDiagram", + id27 + ); + 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="' + id27 + '"] .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 parser22 = { + 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]; } - } - d = a.tj(f2, b, c2); - a.c.Fc(d); - return null; + 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 id27 = $$[$0]; + var description = $$[$0 - 2].trim(); + if ($$[$0].match(":")) { + var parts = $$[$0].split(":"); + id27 = parts[0]; + description = [description, parts[1]]; + } + this.$ = { stmt: "state", id: id27, 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 t1d(a, b) { - var c2, d, e, f2; - switch (o1d(a, b)._k()) { - case 3: - case 2: { - c2 = OKd(b); - for (e = 0, f2 = c2.i; e < f2; ++e) { - d = BD(qud(c2, e), 34); - if ($1d(q1d(a, d)) == 5) { - return d; - } - } - break; + }, "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 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 null; + return token2; } - function Qs(a) { - var b, c2, d, e, f2; - if (Lp(a.f, a.b.length)) { - d = KC(BG, Gie, 330, a.b.length * 2, 0, 1); - a.b = d; - e = d.length - 1; - for (c2 = a.a; c2 != a; c2 = c2.Rd()) { - f2 = BD(c2, 330); - b = f2.d & e; - f2.a = d[b]; - d[b] = f2; - } - } - } - function DJb(a, b) { - var c2, d, e, f2; - f2 = 0; - for (e = BD(BD(Qc(a.r, b), 21), 84).Kc(); e.Ob(); ) { - d = BD(e.Pb(), 111); - f2 = $wnd.Math.max(f2, d.e.a + d.b.rf().a); - } - c2 = BD(Mpb(a.b, b), 124); - c2.n.b = 0; - c2.a.a = f2; - } - function MKb(a, b) { - var c2, d, e, f2; - c2 = 0; - for (f2 = BD(BD(Qc(a.r, b), 21), 84).Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 111); - c2 = $wnd.Math.max(c2, e.e.b + e.b.rf().b); - } - d = BD(Mpb(a.b, b), 124); - d.n.d = 0; - d.a.b = c2; - } - function INc(a) { - var b, c2; - c2 = BD(vNb(a, (wtc(), Ksc)), 21); - b = k3c(zNc); - c2.Hc((Orc(), Lrc)) && d3c(b, CNc); - c2.Hc(Nrc) && d3c(b, ENc); - c2.Hc(Erc) && d3c(b, ANc); - c2.Hc(Grc) && d3c(b, BNc); - return b; - } - function j1c(a, b) { - var c2; - Odd(b, "Delaunay triangulation", 1); - c2 = new Rkb(); - Hkb(a.i, new n1c(c2)); - Ccb(DD(vNb(a, (XNb(), VNb)))) && "null10bw"; - !a.e ? a.e = NCb(c2) : ye(a.e, NCb(c2)); - Qdd(b); - } - function q6c(a) { - if (a < 0) { - throw vbb(new Wdb("The input must be positive")); - } else - return a < h6c.length ? Sbb(h6c[a]) : $wnd.Math.sqrt(dre * a) * (y6c(a, a) / x6c(2.718281828459045, a)); - } - function pud(a, b) { - var c2; - if (a.ni() && b != null) { - for (c2 = 0; c2 < a.i; ++c2) { - if (pb(b, a.g[c2])) { - return true; - } - } + __name(lex2, "lex"); + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; } else { - for (c2 = 0; c2 < a.i; ++c2) { - if (PD(a.g[c2]) === PD(b)) { - return true; - } + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); } + action = table[state5] && table[state5][symbol]; } - return false; - } - function jr(a, b) { - if (b == null) { - while (a.a.Ob()) { - if (BD(a.a.Pb(), 42).dd() == null) { - return true; - } - } - } else { - while (a.a.Ob()) { - if (pb(b, BD(a.a.Pb(), 42).dd())) { - return true; + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state5]) { + 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 + }); } - return false; - } - function zy(a, b) { - var c2, d, e; - if (b === a) { - return true; - } else if (JD(b, 664)) { - e = BD(b, 1947); - return Ue((d = a.g, !d ? a.g = new vi(a) : d), (c2 = e.g, !c2 ? e.g = new vi(e) : c2)); - } else { - return false; - } - } - function Tz(a) { - var b, c2, d, e; - b = "Sz"; - c2 = "ez"; - e = $wnd.Math.min(a.length, 5); - for (d = e - 1; d >= 0; d--) { - if (dfb(a[d].d, b) || dfb(a[d].d, c2)) { - a.length >= d + 1 && a.splice(0, d + 1); - break; - } - } - return a; - } - function Abb(a, b) { - var c2; - if (Fbb(a) && Fbb(b)) { - c2 = a / b; - if (Kje < c2 && c2 < Ije) { - return c2 < 0 ? $wnd.Math.ceil(c2) : $wnd.Math.floor(c2); - } - } - return zbb(UC(Fbb(a) ? Rbb(a) : a, Fbb(b) ? Rbb(b) : b, false)); - } - function LZb(a, b) { - if (b == a.c.i) { - return a.d.i; - } else if (b == a.d.i) { - return a.c.i; - } else { - throw vbb(new Wdb("'node' must either be the source node or target node of the edge.")); - } - } - function C2b(a) { - var b, c2, d, e; - e = BD(vNb(a, (wtc(), xsc)), 37); - if (e) { - d = new d7c(); - b = Q_b(a.c.i); - while (b != e) { - c2 = b.e; - b = Q_b(c2); - O6c(P6c(P6c(d, c2.n), b.c), b.d.b, b.d.d); - } - return d; - } - return w2b; - } - function Ldc(a) { - var b; - b = BD(vNb(a, (wtc(), ntc)), 403); - MAb(LAb(new YAb(null, new Kub(b.d, 16)), new Ydc()), new $dc(a)); - MAb(JAb(new YAb(null, new Kub(b.d, 16)), new aec()), new cec(a)); - } - function woc(a, b) { - var c2, d, e, f2; - e = b ? U_b(a) : R_b(a); - for (d = new Sr(ur(e.a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 17); - f2 = LZb(c2, a); - if (f2.k == (j0b(), g0b) && f2.c != a.c) { - return f2; - } - } - return null; - } - function HDc(a) { - var b, c2, d; - for (c2 = new olb(a.p); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 10); - if (b.k != (j0b(), h0b)) { - continue; - } - d = b.o.b; - a.i = $wnd.Math.min(a.i, d); - a.g = $wnd.Math.max(a.g, d); - } - } - function oEc(a, b, c2) { - var d, e, f2; - for (f2 = new olb(b); f2.a < f2.c.c.length; ) { - d = BD(mlb(f2), 10); - a.c[d.c.p][d.p].e = false; - } - for (e = new olb(b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 10); - nEc(a, d, c2); - } - } - function WOc(a, b, c2) { - var d, e; - d = vPc(b.j, c2.s, c2.c) + vPc(c2.e, b.s, b.c); - e = vPc(c2.j, b.s, b.c) + vPc(b.e, c2.s, c2.c); - if (d == e) { - if (d > 0) { - a.b += 2; - a.a += d; - } - } else { - a.b += 1; - a.a += $wnd.Math.min(d, e); - } - } - function Rpd(a, b) { - var c2, d; - d = false; - if (ND(b)) { - d = true; - Qpd(a, new yC(GD(b))); - } - if (!d) { - if (JD(b, 236)) { - d = true; - Qpd(a, (c2 = Kcb(BD(b, 236)), new TB(c2))); - } - } - if (!d) { - throw vbb(new vcb(Ute)); - } - } - function IMd(a, b, c2, d) { - var e, f2, g; - e = new pSd(a.e, 1, 10, (g = b.c, JD(g, 88) ? BD(g, 26) : (jGd(), _Fd)), (f2 = c2.c, JD(f2, 88) ? BD(f2, 26) : (jGd(), _Fd)), HLd(a, b), false); - !d ? d = e : d.Ei(e); - return d; - } - function T_b(a) { - var b, c2; - switch (BD(vNb(Q_b(a), (Nyc(), ixc)), 420).g) { - case 0: - b = a.n; - c2 = a.o; - return new f7c(b.a + c2.a / 2, b.b + c2.b / 2); - case 1: - return new g7c(a.n); - default: - return null; - } - } - function lrc() { - lrc = ccb; - irc = new mrc(ane, 0); - hrc = new mrc("LEFTUP", 1); - krc = new mrc("RIGHTUP", 2); - grc = new mrc("LEFTDOWN", 3); - jrc = new mrc("RIGHTDOWN", 4); - frc = new mrc("BALANCED", 5); - } - function FFc(a, b, c2) { - var d, e, f2; - d = Kdb(a.a[b.p], a.a[c2.p]); - if (d == 0) { - e = BD(vNb(b, (wtc(), Qsc)), 15); - f2 = BD(vNb(c2, Qsc), 15); - if (e.Hc(c2)) { - return -1; - } else if (f2.Hc(b)) { - return 1; - } - } - return d; - } - function jXc(a) { - switch (a.g) { - case 1: - return new XVc(); - case 2: - return new ZVc(); - case 3: - return new VVc(); - case 0: - return null; - default: - throw vbb(new Wdb(jre + (a.f != null ? a.f : "" + a.g))); - } - } - function Ikd(a, b, c2) { - switch (b) { - case 1: - !a.n && (a.n = new cUd(D2, a, 1, 7)); - Uxd(a.n); - !a.n && (a.n = new cUd(D2, a, 1, 7)); - ytd(a.n, BD(c2, 14)); - return; - case 2: - Lkd(a, GD(c2)); - return; - } - ekd(a, b, c2); - } - function Zkd(a, b, c2) { - switch (b) { - case 3: - ald(a, Edb(ED(c2))); - return; - case 4: - cld(a, Edb(ED(c2))); - return; - case 5: - dld(a, Edb(ED(c2))); - return; - case 6: - eld(a, Edb(ED(c2))); - return; - } - Ikd(a, b, c2); - } - function Fnd(a, b, c2) { - var d, e, f2; - f2 = (d = new rUd(), d); - e = xId(f2, b, null); - !!e && e.Fi(); - pnd(f2, c2); - wtd((!a.c && (a.c = new cUd(p5, a, 12, 10)), a.c), f2); - AId(f2, 0); - DId(f2, 1); - CId(f2, true); - BId(f2, true); - } - function mUd(a, b) { - var c2, d, e; - c2 = Crb(a.g, b); - if (JD(c2, 235)) { - e = BD(c2, 235); - e.Qh() == null && void 0; - return e.Nh(); - } else if (JD(c2, 498)) { - d = BD(c2, 1938); - e = d.b; - return e; - } else { - return null; - } - } - function Ui(a, b, c2, d) { - var e, f2; - Qb(b); - Qb(c2); - f2 = BD(tn(a.d, b), 19); - Ob(!!f2, "Row %s not in %s", b, a.e); - e = BD(tn(a.b, c2), 19); - Ob(!!e, "Column %s not in %s", c2, a.c); - return Wi(a, f2.a, e.a, d); - } - function JC(a, b, c2, d, e, f2, g) { - var h, i3, j, k, l; - k = e[f2]; - j = f2 == g - 1; - h = j ? d : 0; - l = LC(h, k); - d != 10 && OC(GC(a, g - f2), b[f2], c2[f2], h, l); - if (!j) { - ++f2; - for (i3 = 0; i3 < k; ++i3) { - l[i3] = JC(a, b, c2, d, e, f2, g); - } - } - return l; - } - function Eyd(b) { - if (b.g == -1) { - throw vbb(new Ydb()); - } - b.mj(); - try { - b.i.$c(b.g); - b.f = b.i.j; - b.g < b.e && --b.e; - b.g = -1; - } catch (a) { - a = ubb(a); - if (JD(a, 73)) { - throw vbb(new Apb()); - } else - throw vbb(a); - } - } - function hYb(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 a.c[a.c.length] = b, true; - } - function nZb(a) { - var b, c2, d, e; - e = -1; - d = 0; - for (c2 = new olb(a); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 243); - if (b.c == (KAc(), HAc)) { - e = d == 0 ? 0 : d - 1; - break; - } else - d == a.c.length - 1 && (e = d); - d += 1; - } - return e; - } - function UZc(a) { - var b, c2, d, e; - e = 0; - b = 0; - for (d = new olb(a.c); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 33); - dld(c2, a.e + e); - eld(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 bEb(a) { - var b, c2, d; - for (c2 = new olb(a.a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 57); - 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; - } - RDb(a); - } - function BVb(a) { - var b, c2, d; - for (c2 = new olb(a.a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 81); - 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; - } - sVb(a); - } - function Lmc(a) { - var b, c2, d, e, f2; - f2 = Ec(a.k); - for (c2 = (Ucd(), OC(GC(F1, 1), bne, 61, 0, [Scd, Acd, zcd, Rcd, Tcd])), d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - if (b != Scd && !f2.Hc(b)) { - return b; - } - } - return null; - } - function znc(a, b) { - var c2, d; - d = BD(Etb(KAb(JAb(new YAb(null, new Kub(b.j, 16)), new Pnc()))), 11); - if (d) { - c2 = BD(Ikb(d.e, 0), 17); - if (c2) { - return BD(vNb(c2, (wtc(), Zsc)), 19).a; - } - } - return yzc(a.b); - } - function CCc(a, b) { - var c2, d, e, f2; - for (f2 = new olb(b.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 10); - Blb(a.d); - for (d = new Sr(ur(U_b(e).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 17); - zCc(a, e, c2.d.i); - } - } - } - function NZc(a, b) { - var c2, d; - Lkb(a.b, b); - for (d = new olb(a.n); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 211); - if (Jkb(c2.c, b, 0) != -1) { - Lkb(c2.c, b); - UZc(c2); - c2.c.c.length == 0 && Lkb(a.n, c2); - break; - } - } - HZc(a); - } - function $Zc(a, b) { - var c2, d, e, f2, g; - g = a.f; - e = 0; - f2 = 0; - for (d = new olb(a.a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 187); - OZc(c2, a.e, g); - KZc(c2, b); - f2 = $wnd.Math.max(f2, c2.r); - g += c2.d + a.c; - e = g; - } - a.d = f2; - a.b = e; - } - function hVc(a) { - var b, c2; - c2 = $sd(a); - if (Qq(c2)) { - return null; - } else { - b = (Qb(c2), BD(mr(new Sr(ur(c2.a.Kc(), new Sq()))), 79)); - return atd(BD(qud((!b.b && (b.b = new y5d(z2, b, 4, 7)), b.b), 0), 82)); - } - } - function XId(a) { - var b; - if (!a.o) { - b = a.Lj(); - b ? a.o = new dYd(a, a, null) : a.rk() ? a.o = new uVd(a, null) : $1d(q1d((O6d(), M6d), a)) == 1 ? a.o = new nYd(a) : a.o = new sYd(a, null); - } - return a.o; - } - function w6d(a, b, c2, d) { - var e, f2, g, h, i3; - if (c2.mh(b)) { - e = (g = b, !g ? null : BD(d, 49).xh(g)); - if (e) { - i3 = c2.ah(b); - h = b.t; - if (h > 1 || h == -1) { - f2 = BD(i3, 15); - e.Wb(t6d(a, f2)); - } else { - e.Wb(s6d(a, BD(i3, 56))); - } - } - } - } - function Zbb(b, c2, d, e) { - Ybb(); - var f2 = Wbb; - function g() { - for (var a = 0; a < f2.length; a++) { - f2[a](); - } - } - if (b) { - try { - Ihe(g)(); - } catch (a) { - b(c2, a); - } - } else { - Ihe(g)(); - } - } - function Kgc(a) { - var b, c2, d, e, f2; - for (d = new nib(new eib(a.b).a); d.b; ) { - c2 = lib(d); - b = BD(c2.cd(), 10); - f2 = BD(BD(c2.dd(), 46).a, 10); - e = BD(BD(c2.dd(), 46).b, 8); - P6c(X6c(b.n), P6c(R6c(f2.n), e)); + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } - } - function llc(a) { - switch (BD(vNb(a.b, (Nyc(), Vwc)), 375).g) { - case 1: - MAb(NAb(LAb(new YAb(null, new Kub(a.d, 16)), new Glc()), new Ilc()), new Klc()); - break; - case 2: - nlc(a); - break; - case 0: - mlc(a); - } - } - function KXc(a, b, c2) { - var d; - Odd(c2, "Straight Line Edge Routing", 1); - c2.n && !!b && Tdd(c2, i6d(b), (pgd(), mgd)); - d = BD(hkd(b, (MUc(), LUc)), 33); - LXc(a, d); - c2.n && !!b && Tdd(c2, i6d(b), (pgd(), mgd)); - } - function i8c() { - i8c = ccb; - h8c = new j8c("V_TOP", 0); - g8c = new j8c("V_CENTER", 1); - f8c = new j8c("V_BOTTOM", 2); - d8c = new j8c("H_LEFT", 3); - c8c = new j8c("H_CENTER", 4); - e8c = new j8c("H_RIGHT", 5); - } - function gLd(a) { - var b; - if ((a.Db & 64) != 0) - return mKd(a); - b = new Jfb(mKd(a)); - b.a += " (abstract: "; - Ffb(b, (a.Bb & 256) != 0); - b.a += ", interface: "; - Ffb(b, (a.Bb & 512) != 0); - b.a += ")"; - return b.a; - } - function l3d(a, b, c2, d) { - var e, f2, g, h; - if (oid(a.e)) { - e = b.ak(); - h = b.dd(); - f2 = c2.dd(); - g = H2d(a, 1, e, h, f2, e.$j() ? M2d(a, e, f2, JD(e, 99) && (BD(e, 18).Bb & Tje) != 0) : -1, true); - d ? d.Ei(g) : d = g; - } - return d; - } - function kz(a) { - var b; - if (a.c == null) { - b = PD(a.b) === PD(iz) ? null : a.b; - a.d = b == null ? Xhe : MD(b) ? nz(FD(b)) : ND(b) ? Vie : hdb(rb(b)); - a.a = a.a + ": " + (MD(b) ? mz(FD(b)) : b + ""); - a.c = "(" + a.d + ") " + a.a; - } - } - function Wgb(a, b) { - this.e = a; - if (Bbb(xbb(b, -4294967296), 0)) { - this.d = 1; - this.a = OC(GC(WD, 1), oje, 25, 15, [Tbb(b)]); - } else { - this.d = 2; - this.a = OC(GC(WD, 1), oje, 25, 15, [Tbb(b), Tbb(Obb(b, 32))]); - } - } - function yrb() { - function b() { - try { - return (/* @__PURE__ */ new Map()).entries().next().done; - } catch (a) { - return false; - } - } - if (typeof Map === Nhe && Map.prototype.entries && b()) { - return Map; - } else { - return zrb(); - } - } - function VPc(a, b) { - var c2, d, e, f2; - f2 = new Bib(a.e, 0); - c2 = 0; - while (f2.b < f2.d.gc()) { - d = Edb((sCb(f2.b < f2.d.gc()), ED(f2.d.Xb(f2.c = f2.b++)))); - e = d - b; - if (e > Oqe) { - return c2; - } else - e > -1e-6 && ++c2; - } - return c2; - } - function PQd(a, b) { - var c2; - if (b != a.b) { - c2 = null; - !!a.b && (c2 = lid(a.b, a, -4, c2)); - !!b && (c2 = kid(b, a, -4, c2)); - c2 = GQd(a, b, c2); - !!c2 && c2.Fi(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 3, b, b)); - } - function SQd(a, b) { - var c2; - if (b != a.f) { - c2 = null; - !!a.f && (c2 = lid(a.f, a, -1, c2)); - !!b && (c2 = kid(b, a, -1, c2)); - c2 = IQd(a, b, c2); - !!c2 && c2.Fi(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 0, b, b)); - } - function E9d(a) { - var b, c2, d; - if (a == null) - return null; - c2 = BD(a, 15); - if (c2.dc()) - return ""; - d = new Hfb(); - for (b = c2.Kc(); b.Ob(); ) { - Efb(d, (Q8d(), GD(b.Pb()))); - d.a += " "; - } - return lcb(d, d.a.length - 1); - } - function I9d(a) { - var b, c2, d; - if (a == null) - return null; - c2 = BD(a, 15); - if (c2.dc()) - return ""; - d = new Hfb(); - for (b = c2.Kc(); b.Ob(); ) { - Efb(d, (Q8d(), GD(b.Pb()))); - d.a += " "; - } - return lcb(d, d.a.length - 1); - } - function qEc(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 Ddb(d.a, e.a); - } else if (d.a != null) { - return -1; - } else if (e.a != null) { - return 1; - } - return 0; - } - function zqd(a, b) { - var c2, d, e, f2, g, h; - if (b) { - f2 = b.a.length; - c2 = new Yge(f2); - for (h = (c2.b - c2.a) * c2.c < 0 ? (Xge(), Wge) : new she(c2); h.Ob(); ) { - g = BD(h.Pb(), 19); - e = Zpd(b, g.a); - d = new Crd(a); - Aqd(d.a, e); - } - } - } - function Qqd(a, b) { - var c2, d, e, f2, g, h; - if (b) { - f2 = b.a.length; - c2 = new Yge(f2); - for (h = (c2.b - c2.a) * c2.c < 0 ? (Xge(), Wge) : new she(c2); h.Ob(); ) { - g = BD(h.Pb(), 19); - e = Zpd(b, g.a); - d = new lrd(a); - nqd(d.a, e); - } - } - } - function eFd(b) { - var c2; - if (b != null && b.length > 0 && bfb(b, b.length - 1) == 33) { - try { - c2 = PEd(qfb(b, 0, b.length - 1)); - return c2.e == null; - } catch (a) { - a = ubb(a); - if (!JD(a, 32)) - throw vbb(a); - } - } - return false; - } - function h3d(a, b, c2) { - var d, e, f2; - d = b.ak(); - f2 = b.dd(); - e = d.$j() ? H2d(a, 3, d, null, f2, M2d(a, d, f2, JD(d, 99) && (BD(d, 18).Bb & Tje) != 0), true) : H2d(a, 1, d, d.zj(), f2, -1, true); - c2 ? c2.Ei(e) : c2 = e; - return c2; - } - function Vee() { - var a, b, c2; - b = 0; - for (a = 0; a < "X".length; a++) { - c2 = Uee((BCb(a, "X".length), "X".charCodeAt(a))); - if (c2 == 0) - throw vbb(new mde("Unknown Option: " + "X".substr(a))); - b |= c2; - } - return b; - } - function mZb(a, b, c2) { - var d, e, f2; - d = Q_b(b); - e = a_b(d); - f2 = new H0b(); - F0b(f2, b); - switch (c2.g) { + switch (action[0]) { case 1: - G0b(f2, Wcd(Zcd(e))); - break; - case 2: - G0b(f2, Zcd(e)); - } - yNb(f2, (Nyc(), Uxc), ED(vNb(a, Uxc))); - return f2; - } - function U9b(a) { - var b, c2; - b = BD(Rr(new Sr(ur(R_b(a.a).a.Kc(), new Sq()))), 17); - c2 = BD(Rr(new Sr(ur(U_b(a.a).a.Kc(), new Sq()))), 17); - return Ccb(DD(vNb(b, (wtc(), ltc)))) || Ccb(DD(vNb(c2, ltc))); - } - function Xjc() { - Xjc = ccb; - Tjc = new Yjc("ONE_SIDE", 0); - Vjc = new Yjc("TWO_SIDES_CORNER", 1); - Wjc = new Yjc("TWO_SIDES_OPPOSING", 2); - Ujc = new Yjc("THREE_SIDES", 3); - Sjc = new Yjc("FOUR_SIDES", 4); - } - function jkc(a, b, c2, d, e) { - var f2, g; - f2 = BD(GAb(JAb(b.Oc(), new _kc()), Byb(new fzb(), new dzb(), new Ezb(), OC(GC(xL, 1), Kie, 132, 0, [(Fyb(), Dyb)]))), 15); - g = BD(Si(a.b, c2, d), 15); - e == 0 ? g.Wc(0, f2) : g.Gc(f2); - } - function KDc(a, b) { - var c2, d, e, f2, g; - for (f2 = new olb(b.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 10); - for (d = new Sr(ur(R_b(e).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 17); - g = c2.c.i.p; - a.n[g] = a.n[g] - 1; - } - } - } - function cnc(a, b) { - var c2, d, e, f2, g; - for (f2 = new olb(b.d); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 101); - g = BD(Ohb(a.c, e), 112).o; - for (d = new Gqb(e.b); d.a < d.c.a.length; ) { - c2 = BD(Fqb(d), 61); - ojc(e, c2, g); - } - } - } - function HJc(a) { - var b, c2; - for (c2 = new olb(a.e.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 29); - YJc(a, b); - } - MAb(JAb(LAb(LAb(new YAb(null, new Kub(a.e.b, 16)), new YKc()), new tLc()), new vLc()), new xLc(a)); - } - function Qwd(a, b) { - if (!b) { - return false; - } else { - if (a.Di(b)) { - return false; - } - if (!a.i) { - if (JD(b, 143)) { - a.i = BD(b, 143); - return true; + 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 { - a.i = new Hxd(); - return a.i.Ei(b); - } - } else { - return a.i.Ei(b); - } - } - } - function B9d(a) { - a = Qge(a, true); - if (dfb(kse, a) || dfb("1", a)) { - return Bcb(), Acb; - } else if (dfb(lse, a) || dfb("0", a)) { - return Bcb(), zcb; - } - throw vbb(new n8d("Invalid boolean value: '" + a + "'")); - } - function Kd(a, b, c2) { - var d, e, f2; - for (e = a.vc().Kc(); e.Ob(); ) { - d = BD(e.Pb(), 42); - f2 = d.cd(); - if (PD(b) === PD(f2) || b != null && pb(b, f2)) { - if (c2) { - d = new pjb(d.cd(), d.dd()); - e.Qb(); - } - return d; - } - } - return null; - } - function dKb(a) { - $Jb(); - var b, c2, d; - if (!a.B.Hc((Idd(), Add))) { - return; - } - d = a.f.i; - b = new K6c(a.a.c); - c2 = new p0b(); - 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.Ff(c2); - } - function LNb(a, b, c2, d) { - var e, f2, g; - g = $wnd.Math.min(c2, ONb(BD(a.b, 65), b, c2, d)); - for (f2 = new olb(a.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 221); - e != b && (g = $wnd.Math.min(g, LNb(e, b, g, d))); - } - return g; - } - function WZb(a) { - var b, c2, d, e; - e = KC(OQ, nie, 193, a.b.c.length, 0, 2); - d = new Bib(a.b, 0); - while (d.b < d.d.gc()) { - b = (sCb(d.b < d.d.gc()), BD(d.d.Xb(d.c = d.b++), 29)); - c2 = d.b - 1; - e[c2] = l_b(b.a); - } - return e; - } - function K3b(a, b, c2, d, e) { - var f2, g, h, i3; - g = eLb(dLb(iLb(H3b(c2)), d), C3b(a, c2, e)); - for (i3 = Y_b(a, c2).Kc(); i3.Ob(); ) { - h = BD(i3.Pb(), 11); - if (b[h.p]) { - f2 = b[h.p].i; - Ekb(g.d, new BLb(f2, bLb(g, f2))); - } - } - cLb(g); - } - function sic(a, b) { - this.f = new Lqb(); - this.b = new Lqb(); - this.j = new Lqb(); - this.a = a; - this.c = b; - this.c > 0 && ric(this, this.c - 1, (Ucd(), zcd)); - this.c < this.a.length - 1 && ric(this, this.c + 1, (Ucd(), Tcd)); - } - function SEc(a) { - a.length > 0 && a[0].length > 0 && (this.c = Ccb(DD(vNb(Q_b(a[0][0]), (wtc(), Rsc))))); - this.a = KC(CX, nie, 2018, a.length, 0, 2); - this.b = KC(FX, nie, 2019, a.length, 0, 2); - this.d = new ss(); - } - function tKc(a) { - if (a.c.length == 0) { - return false; - } - if ((tCb(0, a.c.length), BD(a.c[0], 17)).c.i.k == (j0b(), g0b)) { - return true; - } - return FAb(NAb(new YAb(null, new Kub(a, 16)), new wKc()), new yKc()); - } - function rRc(a, b, c2) { - Odd(c2, "Tree layout", 1); - H2c(a.b); - K2c(a.b, (yRc(), uRc), uRc); - K2c(a.b, vRc, vRc); - K2c(a.b, wRc, wRc); - K2c(a.b, xRc, xRc); - a.a = F2c(a.b, b); - sRc(a, b, Udd(c2, 1)); - Qdd(c2); - return b; - } - function HXc(a, b) { - var c2, d, e, f2, g, h, i3; - h = gVc(b); - f2 = b.f; - i3 = b.g; - g = $wnd.Math.sqrt(f2 * f2 + i3 * i3); - e = 0; - for (d = new olb(h); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 33); - e += HXc(a, c2); - } - return $wnd.Math.max(e, g); - } - function dcd() { - dcd = ccb; - ccd = new gcd(ole, 0); - bcd = new gcd("FREE", 1); - acd = new gcd("FIXED_SIDE", 2); - Zbd = new gcd("FIXED_ORDER", 3); - _bd = new gcd("FIXED_RATIO", 4); - $bd = new gcd("FIXED_POS", 5); - } - function c1d(a, b) { - var c2, d, e; - c2 = b.Hh(a.a); - if (c2) { - e = GD(AAd((!c2.b && (c2.b = new sId((jGd(), fGd), x6, c2)), c2.b), Cwe)); - for (d = 1; d < (O6d(), N6d).length; ++d) { - if (dfb(N6d[d], e)) { - return d; - } - } - } - return 0; - } - function Qlb(a) { - var b, c2, d, e, f2; - if (a == null) { - return Xhe; - } - f2 = new xwb(She, "[", "]"); - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - uwb(f2, "" + b); - } - return !f2.a ? f2.c : f2.e.length == 0 ? f2.a.a : f2.a.a + ("" + f2.e); - } - function Wlb(a) { - var b, c2, d, e, f2; - if (a == null) { - return Xhe; - } - f2 = new xwb(She, "[", "]"); - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - uwb(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 xwb(She, "{", "}"); - for (c2 = a.vc().Kc(); c2.Ob(); ) { - b = BD(c2.Pb(), 42); - uwb(d, Nd(a, b.cd()) + "=" + Nd(a, b.dd())); - } - return !d.a ? d.c : d.e.length == 0 ? d.a.a : d.a.a + ("" + d.e); - } - function EGb(a) { - var b, c2, d, e; - while (!akb(a.o)) { - c2 = BD(fkb(a.o), 46); - d = BD(c2.a, 121); - b = BD(c2.b, 213); - e = xFb(b, d); - if (b.e == d) { - NFb(e.g, b); - d.e = e.e + b.a; - } else { - NFb(e.b, b); - d.e = e.e - b.a; - } - Ekb(a.e.a, d); - } - } - function F6b(a, b) { - var c2, d, e; - c2 = null; - for (e = BD(b.Kb(a), 20).Kc(); e.Ob(); ) { - d = BD(e.Pb(), 17); - 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 uPc(a, b) { - var c2, d, e, f2, g; - c2 = WNc(a, false, b); - for (e = new olb(c2); e.a < e.c.c.length; ) { - d = BD(mlb(e), 129); - d.d == 0 ? (BOc(d, null), COc(d, null)) : (f2 = d.a, g = d.b, BOc(d, g), COc(d, f2), void 0); - } - } - function qQc(a) { - var b, c2; - b = new j3c(); - d3c(b, cQc); - c2 = BD(vNb(a, (wtc(), Ksc)), 21); - c2.Hc((Orc(), Nrc)) && d3c(b, gQc); - c2.Hc(Erc) && d3c(b, dQc); - c2.Hc(Lrc) && d3c(b, fQc); - c2.Hc(Grc) && d3c(b, eQc); - return b; - } - function Xac(a) { - var b, c2, d, e; - Wac(a); - for (c2 = new Sr(ur(O_b(a).a.Kc(), new Sq())); Qr(c2); ) { - b = BD(Rr(c2), 17); - d = b.c.i == a; - e = d ? b.d : b.c; - d ? RZb(b, null) : QZb(b, null); - yNb(b, (wtc(), ctc), e); - _ac(a, e.i); - } - } - function wmc(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; - } - } - function aVc(a) { - var b, c2, d; - for (c2 = new Fyd((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a)); c2.e != c2.i.gc(); ) { - b = BD(Dyd(c2), 33); - d = $sd(b); - if (!Qr(new Sr(ur(d.a.Kc(), new Sq())))) { - return b; - } - } - return null; - } - function Cod() { - var a; - if (yod) - return BD(nUd((yFd(), xFd), yte), 2016); - a = BD(JD(Phb((yFd(), xFd), yte), 555) ? Phb(xFd, yte) : new Bod(), 555); - yod = true; - zod(a); - Aod(a); - Tnd(a); - Shb(xFd, yte, a); - return a; - } - function t3d(a, b, c2) { - var d, e; - if (a.j == 0) - return c2; - e = BD(LLd(a, b, c2), 72); - d = c2.ak(); - if (!d.Ij() || !a.a.rl(d)) { - throw vbb(new hz("Invalid entry feature '" + d.Hj().zb + "." + d.ne() + "'")); - } - return e; - } - function Qi(a, b) { - var c2, d, e, f2, g, h, i3, j; - for (h = a.a, i3 = 0, j = h.length; i3 < j; ++i3) { - g = h[i3]; - for (d = g, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - if (PD(b) === PD(c2) || b != null && pb(b, c2)) { - return true; + symbol = preErrorSymbol; + preErrorSymbol = null; } - } - } - return false; - } - function qhb(a) { - var b, c2, d; - if (ybb(a, 0) >= 0) { - c2 = Abb(a, Jje); - d = Hbb(a, Jje); - } else { - b = Pbb(a, 1); - c2 = Abb(b, 5e8); - d = Hbb(b, 5e8); - d = wbb(Nbb(d, 1), xbb(a, 1)); - } - return Mbb(Nbb(d, 32), xbb(c2, Yje)); - } - function oQb(a, b, c2) { - var d, e; - d = (sCb(b.b != 0), BD(Nsb(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; + 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; - default: - d.a = a.g; - } - e = Jsb(b, 0); - Vsb(e, d); - return b; - } - function pmc(a, b, c2, d) { - var e, f2, g, h, i3; - i3 = a.b; - f2 = b.d; - g = f2.j; - h = umc(g, i3.d[g.g], c2); - e = P6c(R6c(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; - } - Gsb(d, h, d.c.b, d.c); - } - function yJc(a, b, c2) { - var d, e, f2, g; - g = Jkb(a.e, b, 0); - f2 = new zJc(); - f2.b = c2; - d = new Bib(a.e, g); - while (d.b < d.d.gc()) { - e = (sCb(d.b < d.d.gc()), BD(d.d.Xb(d.c = d.b++), 10)); - e.p = c2; - Ekb(f2.e, e); - uib(d); - } - return f2; - } - function sYc(a, b, c2, d) { - var e, f2, g, h, i3; - e = null; - f2 = 0; - for (h = new olb(b); h.a < h.c.c.length; ) { - g = BD(mlb(h), 33); - i3 = g.i + g.g; - if (a < g.j + g.f + d) { - !e ? e = g : c2.i - i3 < c2.i - f2 && (e = g); - f2 = e.i + e.g; - } - } - return !e ? 0 : f2 + d; - } - function tYc(a, b, c2, d) { - var e, f2, g, h, i3; - f2 = null; - e = 0; - for (h = new olb(b); h.a < h.c.c.length; ) { - g = BD(mlb(h), 33); - i3 = g.j + g.f; - if (a < g.i + g.g + d) { - !f2 ? f2 = g : c2.j - i3 < c2.j - e && (f2 = g); - e = f2.j + f2.f; - } - } - return !f2 ? 0 : e + d; - } - function mA(a) { - var b, c2, d; - b = false; - d = a.b.c.length; - for (c2 = 0; c2 < d; c2++) { - if (nA(BD(Ikb(a.b, c2), 434))) { - if (!b && c2 + 1 < d && nA(BD(Ikb(a.b, c2 + 1), 434))) { - b = true; - BD(Ikb(a.b, c2), 434).a = true; - } - } else { - b = false; - } - } - } - function Ahb(a, b, c2, d, e) { - var f2, g; - f2 = 0; - for (g = 0; g < e; g++) { - f2 = wbb(f2, Qbb(xbb(b[g], Yje), xbb(d[g], Yje))); - a[g] = Tbb(f2); - f2 = Obb(f2, 32); - } - for (; g < c2; g++) { - f2 = wbb(f2, xbb(b[g], Yje)); - a[g] = Tbb(f2); - f2 = Obb(f2, 32); - } - } - function Jhb(a, b) { - Dhb(); - var c2, d; - d = (Hgb(), Cgb); - c2 = a; - for (; b > 1; b >>= 1) { - (b & 1) != 0 && (d = Ogb(d, c2)); - c2.d == 1 ? c2 = Ogb(c2, c2) : c2 = new Xgb(Lhb(c2.a, c2.d, KC(WD, oje, 25, c2.d << 1, 15, 1))); - } - d = Ogb(d, c2); - return d; - } - function zub() { - zub = ccb; - var a, b, c2, d; - wub = KC(UD, Vje, 25, 25, 15, 1); - xub = KC(UD, Vje, 25, 33, 15, 1); - d = 152587890625e-16; - for (b = 32; b >= 0; b--) { - xub[b] = d; - d *= 0.5; - } - c2 = 1; - for (a = 24; a >= 0; a--) { - wub[a] = c2; - c2 *= 0.5; - } - } - function S1b(a) { - var b, c2; - if (Ccb(DD(hkd(a, (Nyc(), fxc))))) { - for (c2 = new Sr(ur(_sd(a).a.Kc(), new Sq())); Qr(c2); ) { - b = BD(Rr(c2), 79); - if (Qld(b)) { - if (Ccb(DD(hkd(b, gxc)))) { - return true; - } - } - } + return true; } - return false; } - function kjc(a, b) { - var c2, d, e; - if (Qqb(a.f, b)) { - b.b = a; - d = b.c; - Jkb(a.j, d, 0) != -1 || Ekb(a.j, d); - e = b.d; - Jkb(a.j, e, 0) != -1 || Ekb(a.j, e); - c2 = b.a.b; - if (c2.c.length != 0) { - !a.i && (a.i = new vjc(a)); - qjc(a.i, c2); - } - } - } - function rmc(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 (Xcd(d) == f2) { - return 0; - } else if (Vcd(d) == f2) { - return 1; - } else { - b = a.b; - return uqb(b.b, Xcd(d)) ? 0 : 1; - } - } - function lzc() { - lzc = ccb; - jzc = new nzc(Aqe, 0); - hzc = new nzc("LONGEST_PATH", 1); - fzc = new nzc("COFFMAN_GRAHAM", 2); - gzc = new nzc(Tne, 3); - kzc = new nzc("STRETCH_WIDTH", 4); - izc = new nzc("MIN_WIDTH", 5); - } - function E3c(a) { - var b; - this.d = new Lqb(); - this.c = a.c; - this.e = a.d; - this.b = a.b; - this.f = new jgd(a.e); - this.a = a.a; - !a.f ? this.g = (b = BD(gdb(O3), 9), new xqb(b, BD(_Bb(b, b.length), 9), 0)) : this.g = a.f; - } - function grd(a, b) { - var c2, d, e, f2, g, h; - e = a; - g = $pd(e, "layoutOptions"); - !g && (g = $pd(e, Dte)); - if (g) { - h = g; - d = null; - !!h && (d = (f2 = $B(h, KC(ZI, nie, 2, 0, 6, 1)), new mC(h, f2))); - if (d) { - c2 = new Drd(h, b); - reb(d, c2); - } - } - } - function atd(a) { - if (JD(a, 239)) { - return BD(a, 33); - } else if (JD(a, 186)) { - return mpd(BD(a, 118)); - } else if (!a) { - throw vbb(new Heb(gue)); + 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 vbb(new cgb("Only support nodes and ports.")); - } - } - function CA(a, b, c2, d) { - if (b >= 0 && dfb(a.substr(b, "GMT".length), "GMT")) { - c2[0] = b + 3; - return tA(a, c2, d); - } - if (b >= 0 && dfb(a.substr(b, "UTC".length), "UTC")) { - c2[0] = b + 3; - return tA(a, c2, d); - } - return tA(a, c2, d); - } - function tjc(a, b) { - var c2, d, e, f2, g; - f2 = a.g.a; - g = a.g.b; - for (d = new olb(a.d); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 70); - e = c2.n; - e.a = f2; - a.i == (Ucd(), Acd) ? e.b = g + a.j.b - c2.o.b : e.b = g; - P6c(e, b); - f2 += c2.o.a + a.e; + 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]; } - } - function Odd(a, b, c2) { - if (a.b) { - throw vbb(new Zdb("The task is already done.")); - } else if (a.p != null) { - return false; + 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 { - a.p = b; - a.r = c2; - a.k && (a.o = (Zfb(), Ibb(Cbb(Date.now()), _ie))); - return true; + 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 hsd(a) { - var b, c2, d, e, f2, g, h; - h = new eC(); - c2 = a.tg(); - e = c2 != null; - e && Upd(h, Vte, a.tg()); - d = a.ne(); - f2 = d != null; - f2 && Upd(h, fue, a.ne()); - b = a.sg(); - g = b != null; - g && Upd(h, "description", a.sg()); - return h; - } - function uId(a, b, c2) { - var d, e, f2; - f2 = a.q; - a.q = b; - if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - e = new nSd(a, 1, 9, f2, b); - !c2 ? c2 = e : c2.Ei(e); - } - if (!b) { - !!a.r && (c2 = a.nk(null, c2)); - } else { - d = b.c; - d != a.r && (c2 = a.nk(d, c2)); - } - return c2; - } - function IYd(a, b, c2) { - var d, e, f2, g, h; - c2 = (h = b, kid(h, a.e, -1 - a.c, c2)); - g = AYd(a.a); - for (f2 = (d = new nib(new eib(g.a).a), new ZYd(d)); f2.a.b; ) { - e = BD(lib(f2.a).cd(), 87); - c2 = QQd(e, MQd(e, a.a), c2); - } - return c2; - } - function JYd(a, b, c2) { - var d, e, f2, g, h; - c2 = (h = b, lid(h, a.e, -1 - a.c, c2)); - g = AYd(a.a); - for (f2 = (d = new nib(new eib(g.a).a), new ZYd(d)); f2.a.b; ) { - e = BD(lib(f2.a).cd(), 87); - c2 = QQd(e, MQd(e, a.a), c2); - } - return c2; - } - function jhb(a, b, c2, d) { - var e, f2, g; - if (d == 0) { - $fb(b, 0, a, c2, a.length - c2); + 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 { - 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 LJb(a) { - var b, c2, d, e, f2; - b = 0; - c2 = 0; - for (f2 = a.Kc(); f2.Ob(); ) { - d = BD(f2.Pb(), 111); - b = $wnd.Math.max(b, d.d.b); - c2 = $wnd.Math.max(c2, d.d.c); - } - for (e = a.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 111); - d.d.b = b; - d.d.c = c2; - } - } - function TKb(a) { - var b, c2, d, e, f2; - c2 = 0; - b = 0; - for (f2 = a.Kc(); f2.Ob(); ) { - d = BD(f2.Pb(), 111); - c2 = $wnd.Math.max(c2, d.d.d); - b = $wnd.Math.max(b, d.d.a); - } - for (e = a.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 111); - d.d.d = c2; - d.d.a = b; - } - } - function rpc(a, b) { - var c2, d, e, f2; - f2 = new Rkb(); - e = 0; - d = b.Kc(); - while (d.Ob()) { - c2 = meb(BD(d.Pb(), 19).a + e); - while (c2.a < a.f && !Voc(a, c2.a)) { - c2 = meb(c2.a + 1); - ++e; - } - if (c2.a >= a.f) { - break; - } - f2.c[f2.c.length] = c2; - } - return f2; - } - function sfd(a) { - var b, c2, d, e; - b = null; - for (e = new olb(a.wf()); e.a < e.c.c.length; ) { - d = BD(mlb(e), 181); - c2 = new J6c(d.qf().a, d.qf().b, d.rf().a, d.rf().b); - !b ? b = c2 : H6c(b, c2); - } - !b && (b = new I6c()); - return b; - } - function Fkd(a, b, c2, d) { - var e, f2; - if (c2 == 1) { - return !a.n && (a.n = new cUd(D2, a, 1, 7)), Sxd(a.n, b, d); - } - return f2 = BD(XKd((e = BD(Ajd(a, 16), 26), !e ? a.zh() : e), c2), 66), f2.Nj().Qj(a, yjd(a), c2 - aLd(a.zh()), b, d); - } - function iud(a, b, c2) { - var d, e, f2, g, h; - d = c2.gc(); - a.qi(a.i + d); - h = a.i - b; - h > 0 && $fb(a.g, b, a.g, b + d, h); - g = c2.Kc(); - a.i += d; - for (e = 0; e < d; ++e) { - f2 = g.Pb(); - mud(a, b, a.oi(b, f2)); - a.bi(b, f2); - a.ci(); - ++b; - } - return d != 0; - } - function xId(a, b, c2) { - var d; - if (b != a.q) { - !!a.q && (c2 = lid(a.q, a, -10, c2)); - !!b && (c2 = kid(b, a, -10, c2)); - c2 = uId(a, b, c2); - } else if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - d = new nSd(a, 1, 9, b, b); - !c2 ? c2 = d : c2.Ei(d); - } - return c2; - } - function Yj(a, b, c2, d) { - Mb((c2 & oie) == 0, "flatMap does not support SUBSIZED characteristic"); - Mb((c2 & 4) == 0, "flatMap does not support SORTED characteristic"); - Qb(a); - Qb(b); - return new jk(a, c2, d, b); - } - function Qy(a, b) { - vCb(b, "Cannot suppress a null exception."); - mCb(b != a, "Exception can not suppress itself."); - if (a.i) { - return; + 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 + }); } - a.k == null ? a.k = OC(GC(_I, 1), nie, 78, 0, [b]) : a.k[a.k.length] = b; - } - function oA(a, b, c2, d) { - var e, f2, g, h, i3, j; - g = c2.length; - f2 = 0; - e = -1; - j = sfb(a.substr(b), (ntb(), ltb)); - for (h = 0; h < g; ++h) { - i3 = c2[h].length; - if (i3 > f2 && nfb(j, sfb(c2[h], ltb))) { - e = h; - f2 = i3; + 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); } } - e >= 0 && (d[0] = b + f2); - return e; - } - function MIb(a, b) { - var c2; - c2 = NIb(a.b.Hf(), b.b.Hf()); - if (c2 != 0) { - return c2; - } - switch (a.b.Hf().g) { - case 1: - case 2: - return beb(a.b.sf(), b.b.sf()); - case 3: - case 4: - return beb(b.b.sf(), a.b.sf()); - } - return 0; - } - function iRb(a) { - var b, c2, d; - d = a.e.c.length; - a.a = IC(WD, [nie, oje], [48, 25], 15, [d, d], 2); - for (c2 = new olb(a.c); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 282); - a.a[b.c.b][b.d.b] += BD(vNb(b, (wSb(), oSb)), 19).a; - } - } - function H1c(a, b, c2) { - Odd(c2, "Grow Tree", 1); - a.b = b.f; - if (Ccb(DD(vNb(b, (XNb(), VNb))))) { - a.c = new tOb(); - D1c(a, null); - } else { - a.c = new tOb(); - } - a.a = false; - F1c(a, b.f); - yNb(b, WNb, (Bcb(), a.a ? true : false)); - Qdd(c2); - } - function Umd(a, b) { - var c2, d, e, f2, g; - if (a == null) { - return null; - } else { - g = KC(TD, $ie, 25, 2 * b, 15, 1); - for (d = 0, e = 0; d < b; ++d) { - c2 = a[d] >> 4 & 15; - f2 = a[d] & 15; - g[e++] = Qmd[c2]; - g[e++] = Qmd[f2]; - } - return zfb(g, 0, g.length); - } - } - function j3d(a, b, c2) { - var d, e, f2; - d = b.ak(); - f2 = b.dd(); - e = d.$j() ? H2d(a, 4, d, f2, null, M2d(a, d, f2, JD(d, 99) && (BD(d, 18).Bb & Tje) != 0), true) : H2d(a, d.Kj() ? 2 : 1, d, f2, d.zj(), -1, true); - c2 ? c2.Ei(e) : c2 = e; - return c2; - } - function wfb(a) { - var b, c2; - if (a >= Tje) { - b = Uje + (a - Tje >> 10 & 1023) & aje; - c2 = 56320 + (a - Tje & 1023) & aje; - return String.fromCharCode(b) + ("" + String.fromCharCode(c2)); - } else { - return String.fromCharCode(a & aje); - } - } - function bKb(a, b) { - $Jb(); - var c2, d, e, f2; - e = BD(BD(Qc(a.r, b), 21), 84); - if (e.gc() >= 2) { - d = BD(e.Kc().Pb(), 111); - c2 = a.u.Hc((rcd(), mcd)); - f2 = a.u.Hc(qcd); - return !d.a && !c2 && (e.gc() == 2 || f2); - } else { - return false; - } - } - function IVc(a, b, c2, d, e) { - var f2, g, h; - f2 = JVc(a, b, c2, d, e); - h = false; - while (!f2) { - AVc(a, e, true); - h = true; - f2 = JVc(a, b, c2, d, e); - } - h && AVc(a, e, false); - g = dVc(e); - if (g.c.length != 0) { - !!a.d && a.d.lg(g); - IVc(a, e, c2, d, g); - } - } - function Mad() { - Mad = ccb; - Kad = new Nad(ane, 0); - Iad = new Nad("DIRECTED", 1); - Lad = new Nad("UNDIRECTED", 2); - Gad = new Nad("ASSOCIATION", 3); - Jad = new Nad("GENERALIZATION", 4); - Had = new Nad("DEPENDENCY", 5); - } - function kfd(a, b) { - var c2; - if (!mpd(a)) { - throw vbb(new Zdb(Sse)); - } - c2 = mpd(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; - } - function cub(a, b) { - var c2, d; - uCb(b); - d = a.b.c.length; - Ekb(a.b, b); - while (d > 0) { - c2 = d; - d = (d - 1) / 2 | 0; - if (a.a.ue(Ikb(a.b, d), b) <= 0) { - Nkb(a.b, c2, b); - return true; - } - Nkb(a.b, c2, Ikb(a.b, d)); + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; } - Nkb(a.b, d, b); - return true; - } - function BHb(a, b, c2, d) { - var e, f2; - e = 0; - if (!c2) { - for (f2 = 0; f2 < sHb; f2++) { - e = $wnd.Math.max(e, qHb(a.a[f2][b.g], d)); + 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]; } - } else { - e = qHb(a.a[c2.g][b.g], d); - } - b == (gHb(), eHb) && !!a.b && (e = $wnd.Math.max(e, a.b.a)); - return e; - } - function knc(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 == (Ucd(), zcd) || e.i == (Ucd(), Tcd)) { - 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; - } - function Tpd(a, b, c2, d) { - var e; - e = false; - if (ND(d)) { - e = true; - Upd(b, c2, GD(d)); - } - if (!e) { - if (KD(d)) { - e = true; - Tpd(a, b, c2, d); - } - } - if (!e) { - if (JD(d, 236)) { - e = true; - Spd(b, c2, BD(d, 236)); - } - } - if (!e) { - throw vbb(new vcb(Ute)); - } - } - function W0d(a, b) { - var c2, d, e; - c2 = b.Hh(a.a); - if (c2) { - e = AAd((!c2.b && (c2.b = new sId((jGd(), fGd), x6, c2)), c2.b), Sve); - if (e != null) { - for (d = 1; d < (O6d(), K6d).length; ++d) { - if (dfb(K6d[d], e)) { - return d; - } - } - } - } - return 0; - } - function X0d(a, b) { - var c2, d, e; - c2 = b.Hh(a.a); - if (c2) { - e = AAd((!c2.b && (c2.b = new sId((jGd(), fGd), x6, c2)), c2.b), Sve); - if (e != null) { - for (d = 1; d < (O6d(), L6d).length; ++d) { - if (dfb(L6d[d], e)) { - return d; + 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 0; - } - function Ve(a, b) { - var c2, d, e, f2; - uCb(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; - } - } - return f2 != a.a.gc(); - } - function bYb(a) { - var b, c2; - c2 = R6c(l7c(OC(GC(m1, 1), nie, 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 P9b(a) { - var b; - b = (I9b(), BD(Rr(new Sr(ur(R_b(a).a.Kc(), new Sq()))), 17).c.i); - while (b.k == (j0b(), g0b)) { - yNb(b, (wtc(), Tsc), (Bcb(), true)); - b = BD(Rr(new Sr(ur(R_b(b).a.Kc(), new Sq()))), 17).c.i; - } - } - function bIc(a, b, c2, d) { - var e, f2, g, h; - h = CHc(b, d); - for (g = h.Kc(); g.Ob(); ) { - e = BD(g.Pb(), 11); - a.d[e.p] = a.d[e.p] + a.c[c2.p]; - } - h = CHc(c2, d); - for (f2 = h.Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 11); - a.d[e.p] = a.d[e.p] - a.c[b.p]; - } - } - function Efd(a, b, c2) { - var d, e; - for (e = new Fyd((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a)); e.e != e.i.gc(); ) { - d = BD(Dyd(e), 33); - bld(d, d.i + b, d.j + c2); - } - reb((!a.b && (a.b = new cUd(B2, a, 12, 3)), a.b), new Kfd(b, c2)); - } - function Mwb(a, b, c2, d) { - var e, f2; - f2 = b; - e = f2.d == null || a.a.ue(c2.d, f2.d) > 0 ? 1 : 0; - while (f2.a[e] != c2) { - f2 = f2.a[e]; - e = a.a.ue(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 ucd(a) { - rcd(); - var b, c2; - b = qqb(ncd, OC(GC(E1, 1), Kie, 273, 0, [pcd])); - if (Ox(Cx(b, a)) > 1) { - return false; - } - c2 = qqb(mcd, OC(GC(E1, 1), Kie, 273, 0, [lcd, qcd])); - if (Ox(Cx(c2, a)) > 1) { - return false; - } - return true; - } - function fod(a, b) { - var c2; - c2 = Phb((yFd(), xFd), a); - JD(c2, 498) ? Shb(xFd, a, new bUd(this, b)) : Shb(xFd, a, this); - bod(this, b); - if (b == (LFd(), KFd)) { - this.wb = BD(this, 1939); - BD(b, 1941); - } else { - this.wb = (NFd(), MFd); - } - } - function lZd(b) { - var c2, d, e; - if (b == null) { - return null; - } - c2 = null; - for (d = 0; d < Pmd.length; ++d) { - try { - return DQd(Pmd[d], b); - } catch (a) { - a = ubb(a); - if (JD(a, 32)) { - e = a; - c2 = e; - } else - throw vbb(a); - } - } - throw vbb(new rFd(c2)); - } - function Dpb() { - Dpb = ccb; - Bpb = OC(GC(ZI, 1), nie, 2, 6, ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]); - Cpb = OC(GC(ZI, 1), nie, 2, 6, ["Jan", "Feb", "Mar", "Apr", fje, "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]); - } - function yyb(a) { - var b, c2, d; - b = dfb(typeof b, uke) ? null : new iCb(); - if (!b) { - return; - } - $xb(); - c2 = (d = 900, d >= _ie ? "error" : d >= 900 ? "warn" : d >= 800 ? "info" : "log"); - gCb(c2, a.a); - !!a.b && hCb(b, c2, a.b, "Exception: ", true); - } - function vNb(a, b) { - var c2, d; - d = (!a.q && (a.q = new Lqb()), Ohb(a.q, b)); - if (d != null) { - return d; - } - c2 = b.wg(); - JD(c2, 4) && (c2 == null ? (!a.q && (a.q = new Lqb()), Thb(a.q, b)) : (!a.q && (a.q = new Lqb()), Rhb(a.q, b, c2)), a); - return c2; - } - function qUb() { - qUb = ccb; - lUb = new rUb("P1_CYCLE_BREAKING", 0); - mUb = new rUb("P2_LAYERING", 1); - nUb = new rUb("P3_NODE_ORDERING", 2); - oUb = new rUb("P4_NODE_PLACEMENT", 3); - pUb = new rUb("P5_EDGE_ROUTING", 4); - } - function SUb(a, b) { - var c2, d, e, f2, g; - e = b == 1 ? KUb : JUb; - for (d = e.a.ec().Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 103); - for (g = BD(Qc(a.f.c, c2), 21).Kc(); g.Ob(); ) { - f2 = BD(g.Pb(), 46); - Lkb(a.b.b, f2.b); - Lkb(a.b.a, BD(f2.b, 81).d); - } - } - } - function IWb(a, b) { - AWb(); - var c2; - if (a.c == b.c) { - if (a.b == b.b || pWb(a.b, b.b)) { - c2 = mWb(a.b) ? 1 : -1; - if (a.a && !b.a) { - return c2; - } else if (!a.a && b.a) { - return -c2; - } - } - return beb(a.b.g, b.b.g); - } else { - return Kdb(a.c, b.c); - } - } - function y6b(a, b) { - var c2; - Odd(b, "Hierarchical port position processing", 1); - c2 = a.b; - c2.c.length > 0 && x6b((tCb(0, c2.c.length), BD(c2.c[0], 29)), a); - c2.c.length > 1 && x6b(BD(Ikb(c2, c2.c.length - 1), 29), a); - Qdd(b); - } - function RVc(a, b) { - var c2, d, e; - if (CVc(a, b)) { - return true; - } - for (d = new olb(b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 33); - e = hVc(c2); - if (BVc(a, c2, e)) { - return true; - } - if (PVc(a, c2) - a.g <= a.a) { - return true; + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; } - } - return false; - } - function d0c() { - d0c = ccb; - c0c = (A0c(), z0c); - __c = v0c; - $_c = t0c; - Y_c = p0c; - Z_c = r0c; - X_c = new q0b(8); - W_c = new Osd((Y9c(), f9c), X_c); - a0c = new Osd(T9c, 8); - b0c = x0c; - T_c = k0c; - U_c = m0c; - V_c = new Osd(y8c, (Bcb(), false)); - } - function X7c() { - X7c = ccb; - U7c = new q0b(15); - T7c = new Osd((Y9c(), f9c), U7c); - W7c = new Osd(T9c, 15); - V7c = new Osd(D9c, meb(0)); - O7c = I8c; - Q7c = Y8c; - S7c = b9c; - L7c = new Osd(r8c, pse); - P7c = O8c; - R7c = _8c; - M7c = t8c; - N7c = w8c; - } - function jtd(a) { - if ((!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b).i != 1 || (!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c).i != 1) { - throw vbb(new Wdb(iue)); - } - return atd(BD(qud((!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b), 0), 82)); - } - function ktd(a) { - if ((!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b).i != 1 || (!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c).i != 1) { - throw vbb(new Wdb(iue)); - } - return btd(BD(qud((!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b), 0), 82)); - } - function mtd(a) { - if ((!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b).i != 1 || (!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c).i != 1) { - throw vbb(new Wdb(iue)); - } - return btd(BD(qud((!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c), 0), 82)); - } - function ltd(a) { - if ((!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b).i != 1 || (!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c).i != 1) { - throw vbb(new Wdb(iue)); - } - return atd(BD(qud((!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c), 0), 82)); - } - function Dvd(a, b, c2) { - var d, e, f2; - ++a.j; - e = a.Vi(); - if (b >= e || b < 0) - throw vbb(new qcb(lue + b + mue + e)); - if (c2 >= e || c2 < 0) - throw vbb(new qcb(nue + c2 + mue + e)); - b != c2 ? d = (f2 = a.Ti(c2), a.Hi(b, f2), f2) : d = a.Oi(c2); - return d; - } - function m6d(a) { - var b, c2, d; - d = a; - if (a) { - b = 0; - for (c2 = a.Ug(); c2; c2 = c2.Ug()) { - if (++b > Wje) { - return m6d(c2); - } - d = c2; - if (c2 == a) { - throw vbb(new Zdb("There is a cycle in the containment hierarchy of " + a)); - } - } - } - return d; - } - function Fe(a) { - var b, c2, d; - d = new xwb(She, "[", "]"); - for (c2 = a.Kc(); c2.Ob(); ) { - b = c2.Pb(); - uwb(d, PD(b) === PD(a) ? "(this Collection)" : b == null ? Xhe : fcb(b)); - } - return !d.a ? d.c : d.e.length == 0 ? d.a.a : d.a.a + ("" + d.e); - } - function CVc(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 | BVc(a, BD(b.Xb(c2), 33), BD(b.Xb(c2 + 1), 33)) : d = d | BVc(a, BD(b.Xb(c2), 33), BD(b.Xb(0), 33)); - } - return d; - } - function Ymd(a, b) { - var c2; - if (b != a.a) { - c2 = null; - !!a.a && (c2 = BD(a.a, 49).ih(a, 4, o5, c2)); - !!b && (c2 = BD(b, 49).gh(a, 4, o5, c2)); - c2 = Tmd(a, b, c2); - !!c2 && c2.Fi(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 1, b, b)); - } - function RQd(a, b) { - var c2; - if (b != a.e) { - !!a.e && QYd(AYd(a.e), a); - !!b && (!b.b && (b.b = new RYd(new NYd())), PYd(b.b, a)); - c2 = HQd(a, b, null); - !!c2 && c2.Fi(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 4, b, b)); - } - function ufb(a) { - var b, c2, d; - c2 = a.length; - d = 0; - while (d < c2 && (BCb(d, a.length), a.charCodeAt(d) <= 32)) { - ++d; - } - b = c2; - while (b > d && (BCb(b - 1, a.length), a.charCodeAt(b - 1) <= 32)) { - --b; - } - return d > 0 || b < c2 ? a.substr(d, b - d) : a; - } - function ujc(a, b) { - var c2; - c2 = b.o; - if (fad(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 gkc() { - gkc = ccb; - dkc = OC(GC(F1, 1), bne, 61, 0, [(Ucd(), Acd), zcd, Rcd]); - ckc = OC(GC(F1, 1), bne, 61, 0, [zcd, Rcd, Tcd]); - ekc = OC(GC(F1, 1), bne, 61, 0, [Rcd, Tcd, Acd]); - fkc = OC(GC(F1, 1), bne, 61, 0, [Tcd, Acd, zcd]); - } - function omc(a, b, c2, d) { - var e, f2, g, h, i3, j, k; - g = a.c.d; - h = a.d.d; - if (g.j == h.j) { - return; - } - k = a.b; - e = g.j; - i3 = null; - while (e != h.j) { - i3 = b == 0 ? Xcd(e) : Vcd(e); - f2 = umc(e, k.d[e.g], c2); - j = umc(i3, k.d[i3.g], c2); - Dsb(d, P6c(f2, j)); - e = i3; - } - } - function oFc(a, b, c2, d) { - var e, f2, g, h, i3; - g = JHc(a.a, b, c2); - h = BD(g.a, 19).a; - f2 = BD(g.b, 19).a; - if (d) { - i3 = BD(vNb(b, (wtc(), gtc)), 10); - e = BD(vNb(c2, gtc), 10); - if (!!i3 && !!e) { - mic(a.b, i3, e); - h += a.b.i; - f2 += a.b.e; - } - } - return h > f2; - } - function oHc(a) { - var b, c2, d, e, f2, g, h, i3, j; - this.a = lHc(a); - this.b = new Rkb(); - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - f2 = new Rkb(); - Ekb(this.b, f2); - for (h = b, i3 = 0, j = h.length; i3 < j; ++i3) { - g = h[i3]; - Ekb(f2, new Tkb(g.j)); - } - } - } - function qHc(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 = KIc(a.d, d, e); - f2 += NHc(a.a, d, (Ucd(), zcd)); - f2 += NHc(a.a, e, Tcd); - } else { - f2 = IHc(a.a, d, e); - } - } - a.c[b] && (f2 += PHc(a.a, d)); - return f2; - } - function jZb(a, b, c2, d, e) { - var f2, g, h, i3; - i3 = null; - for (h = new olb(d); h.a < h.c.c.length; ) { - g = BD(mlb(h), 441); - if (g != c2 && Jkb(g.e, e, 0) != -1) { - i3 = g; - break; - } - } - f2 = kZb(e); - QZb(f2, c2.b); - RZb(f2, i3.b); - Rc(a.a, e, new BZb(f2, b, c2.f)); - } - function nic(a) { - while (a.g.c != 0 && a.d.c != 0) { - if (wic(a.g).c > wic(a.d).c) { - a.i += a.g.c; - yic(a.d); - } else if (wic(a.d).c > wic(a.g).c) { - a.e += a.d.c; - yic(a.g); - } else { - a.i += vic(a.g); - a.e += vic(a.d); - yic(a.g); - yic(a.d); - } - } - } - function XOc(a, b, c2) { - var d, e, f2, g; - f2 = b.q; - g = b.r; - new DOc((HOc(), FOc), b, f2, 1); - new DOc(FOc, f2, g, 1); - for (e = new olb(c2); e.a < e.c.c.length; ) { - d = BD(mlb(e), 112); - if (d != f2 && d != b && d != g) { - pPc(a.a, d, b); - pPc(a.a, d, g); - } - } - } - function XQc(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 = Qqe * a.b + 0.9 * b; - a.f = Qqe * a.b + 0.9 * c2; + if (this._input === "") { + return this.EOF; } else { - a.b = 0.5 * (b + d); - a.g = Qqe * a.b + 0.9 * d; - a.f = Qqe * a.b + 0.9 * b; - } - } - function acb() { - _bb = {}; - !Array.isArray && (Array.isArray = function(a) { - return Object.prototype.toString.call(a) === "[object Array]"; - }); - function b() { - return (/* @__PURE__ */ new Date()).getTime(); - } - !Date.now && (Date.now = b); - } - function $Tb(a, b) { - var c2, d; - d = BD(vNb(b, (Nyc(), Vxc)), 98); - yNb(b, (wtc(), dtc), d); - c2 = b.e; - !!c2 && (MAb(new YAb(null, new Kub(c2.a, 16)), new dUb(a)), MAb(LAb(new YAb(null, new Kub(c2.b, 16)), new fUb()), new hUb(a))); - } - function _$b(a) { - var b, c2, d, e; - if (gad(BD(vNb(a.b, (Nyc(), Lwc)), 103))) { - return 0; - } - b = 0; - for (d = new olb(a.a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 10); - if (c2.k == (j0b(), h0b)) { - e = c2.o.a; - b = $wnd.Math.max(b, e); - } - } - return b; - } - function c5b(a) { - switch (BD(vNb(a, (Nyc(), mxc)), 163).g) { - case 1: - yNb(a, mxc, (Ctc(), ztc)); - break; - case 2: - yNb(a, mxc, (Ctc(), Atc)); - break; - case 3: - yNb(a, mxc, (Ctc(), xtc)); - break; - case 4: - yNb(a, mxc, (Ctc(), ytc)); - } - } - function yrc() { - yrc = ccb; - wrc = new zrc(ane, 0); - trc = new zrc(jle, 1); - xrc = new zrc(kle, 2); - vrc = new zrc("LEFT_RIGHT_CONSTRAINT_LOCKING", 3); - urc = new zrc("LEFT_RIGHT_CONNECTION_LOCKING", 4); - rrc = new zrc(Vne, 5); - } - function qRc(a, b, c2) { - var d, e, f2, g, h, i3, 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); - i3 = 1; - j = 1; - d > h && (i3 = h / d); - e > f2 && (j = f2 / e); - g = $wnd.Math.min(i3, j); - a.a += g * (b.a - a.a); - a.b += g * (b.b - a.b); - } - function sZc(a, b, c2, d, e) { - var f2, g; - g = false; - f2 = BD(Ikb(c2.b, 0), 33); - while (yZc(a, b, f2, d, e)) { - g = true; - NZc(c2, f2); - if (c2.b.c.length == 0) { - break; - } - f2 = BD(Ikb(c2.b, 0), 33); - } - c2.b.c.length == 0 && v$c(c2.j, c2); - g && a$c(b.q); - return g; - } - function t6c(a, b) { - i6c(); - var c2, d, e, f2; - if (b.b < 2) { - return false; - } - f2 = Jsb(b, 0); - c2 = BD(Xsb(f2), 8); - d = c2; - while (f2.b != f2.d.c) { - e = BD(Xsb(f2), 8); - if (s6c(a, d, e)) { - return true; - } - d = e; - } - if (s6c(a, d, c2)) { - return true; + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); } - return false; - } - function ckd(a, b, c2, d) { - var e, f2; - if (c2 == 0) { - return !a.o && (a.o = new dId((Thd(), Qhd), S2, a, 0)), bId(a.o, b, d); - } - return f2 = BD(XKd((e = BD(Ajd(a, 16), 26), !e ? a.zh() : e), c2), 66), f2.Nj().Rj(a, yjd(a), c2 - aLd(a.zh()), b, d); - } - function bod(a, b) { - var c2; - if (b != a.sb) { - c2 = null; - !!a.sb && (c2 = BD(a.sb, 49).ih(a, 1, i5, c2)); - !!b && (c2 = BD(b, 49).gh(a, 1, i5, c2)); - c2 = Jnd(a, b, c2); - !!c2 && c2.Fi(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 4, b, b)); - } - function yqd(a, b) { - var c2, d, e, f2; - if (b) { - e = Xpd(b, "x"); - c2 = new zrd(a); - hmd(c2.a, (uCb(e), e)); - f2 = Xpd(b, "y"); - d = new Ard(a); - imd(d.a, (uCb(f2), f2)); - } else { - throw vbb(new cqd("All edge sections need an end point.")); - } - } - function wqd(a, b) { - var c2, d, e, f2; - if (b) { - e = Xpd(b, "x"); - c2 = new wrd(a); - omd(c2.a, (uCb(e), e)); - f2 = Xpd(b, "y"); - d = new xrd(a); - pmd(d.a, (uCb(f2), f2)); - } else { - throw vbb(new cqd("All edge sections need a start point.")); - } - } - function pyb(a, b) { - var c2, d, e, f2, g, h, i3; - for (d = syb(a), f2 = 0, h = d.length; f2 < h; ++f2) { - yyb(b); - } - i3 = !lyb && a.e ? lyb ? null : a.d : null; - while (i3) { - for (c2 = syb(i3), e = 0, g = c2.length; e < g; ++e) { - yyb(b); - } - i3 = !lyb && i3.e ? lyb ? null : i3.d : null; - } - } - function j0b() { - j0b = ccb; - h0b = new k0b("NORMAL", 0); - g0b = new k0b("LONG_EDGE", 1); - e0b = new k0b("EXTERNAL_PORT", 2); - i0b = new k0b("NORTH_SOUTH_PORT", 3); - f0b = new k0b("LABEL", 4); - d0b = new k0b("BREAKING_POINT", 5); - } - function g4b(a) { - var b, c2, d, e; - b = false; - if (wNb(a, (wtc(), Csc))) { - c2 = BD(vNb(a, Csc), 83); - for (e = new olb(a.j); e.a < e.c.c.length; ) { - d = BD(mlb(e), 11); - if (e4b(d)) { - if (!b) { - d4b(Q_b(a)); - b = true; - } - h4b(BD(c2.xc(d), 306)); - } - } - } - } - function qec(a, b, c2) { - var d; - Odd(c2, "Self-Loop routing", 1); - d = rec(b); - RD(vNb(b, (g6c(), f6c))); - MAb(NAb(JAb(JAb(LAb(new YAb(null, new Kub(b.b, 16)), new uec()), new wec()), new yec()), new Aec()), new Cec(a, d)); - Qdd(c2); - } - function gsd(a) { - var b, c2, d, e, f2, g, h, i3, j; - j = hsd(a); - c2 = a.e; - f2 = c2 != null; - f2 && Upd(j, eue, a.e); - h = a.k; - g = !!h; - g && Upd(j, "type", Zr(a.k)); - d = Fhe(a.j); - e = !d; - if (e) { - i3 = new wB(); - cC(j, Mte, i3); - b = new ssd(i3); - reb(a.j, b); - } - return j; - } - function Jv(a) { - var b, c2, d, e; - e = Kfb((Xj(a.gc(), "size"), new Vfb()), 123); - d = true; - for (c2 = Wm(a).Kc(); c2.Ob(); ) { - b = BD(c2.Pb(), 42); - d || (e.a += She, e); - d = false; - Pfb(Kfb(Pfb(e, b.cd()), 61), b.dd()); - } - return (e.a += "}", e).a; - } - function kD(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; + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; } else { - c2 = 0; - d = 0; - e = a.l << b - 44; - } - return TC(c2 & Eje, d & Eje, e & Fje); - } - function Hcb(a) { - Gcb == null && (Gcb = new RegExp("^\\s*[+-]?(NaN|Infinity|((\\d+\\.?\\d*)|(\\.\\d+))([eE][+-]?\\d+)?[dDfF]?)\\s*$")); - if (!Gcb.test(a)) { - throw vbb(new Oeb(Oje + a + '"')); - } - return parseFloat(a); - } - function IFb(a) { - var b, c2, d, e; - b = new Rkb(); - c2 = KC(sbb, dle, 25, a.a.c.length, 16, 1); - Glb(c2, c2.length); - for (e = new olb(a.a); e.a < e.c.c.length; ) { - d = BD(mlb(e), 121); - if (!c2[d.d]) { - b.c[b.c.length] = d; - HFb(a, d, c2); - } - } - return b; - } - function Nmc(a, b) { - var c2, d, e, f2; - f2 = b.b.j; - a.a = KC(WD, oje, 25, f2.c.length, 15, 1); - e = 0; - for (d = 0; d < f2.c.length; d++) { - c2 = (tCb(d, f2.c.length), BD(f2.c[d], 11)); - c2.e.c.length == 0 && c2.g.c.length == 0 ? e += 1 : e += 3; - a.a[d] = e; - } - } - function Sqc() { - Sqc = ccb; - Nqc = new Uqc("ALWAYS_UP", 0); - Mqc = new Uqc("ALWAYS_DOWN", 1); - Pqc = new Uqc("DIRECTION_UP", 2); - Oqc = new Uqc("DIRECTION_DOWN", 3); - Rqc = new Uqc("SMART_UP", 4); - Qqc = new Uqc("SMART_DOWN", 5); - } - function k6c(a, b) { - if (a < 0 || b < 0) { - throw vbb(new Wdb("k and n must be positive")); - } else if (b > a) { - throw vbb(new Wdb("k must be smaller than n")); - } else - return b == 0 || b == a ? 1 : a == 0 ? 0 : q6c(a) / (q6c(b) * q6c(a - b)); - } - function jfd(a, b) { - var c2, d, e, f2; - c2 = new _ud(a); - while (c2.g == null && !c2.c ? Uud(c2) : c2.g == null || c2.i != 0 && BD(c2.g[c2.i - 1], 47).Ob()) { - f2 = BD(Vud(c2), 56); - if (JD(f2, 160)) { - d = BD(f2, 160); - for (e = 0; e < b.length; e++) { - b[e].og(d); - } - } - } - } - function fld(a) { - var b; - if ((a.Db & 64) != 0) - return Mkd(a); - b = new Jfb(Mkd(a)); - b.a += " (height: "; - Bfb(b, a.f); - b.a += ", width: "; - Bfb(b, a.g); - b.a += ", x: "; - Bfb(b, a.i); - b.a += ", y: "; - Bfb(b, a.j); - b.a += ")"; - return b.a; - } - function un(a) { - var b, c2, d, e, f2, g, h; - b = new $rb(); - for (d = a, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - g = Qb(c2.cd()); - h = Xrb(b, g, Qb(c2.dd())); - if (h != null) { - throw vbb(new Wdb("duplicate key: " + g)); - } - } - this.b = (mmb(), new iob(b)); - } - function Rlb(a) { - var b, c2, d, e, f2; - if (a == null) { - return Xhe; - } - f2 = new xwb(She, "[", "]"); - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - uwb(f2, String.fromCharCode(b)); - } - return !f2.a ? f2.c : f2.e.length == 0 ? f2.a.a : f2.a.a + ("" + f2.e); - } - function SRb() { - SRb = ccb; - MRb = (XRb(), WRb); - LRb = new Nsd(mme, MRb); - meb(1); - KRb = new Nsd(nme, meb(300)); - meb(0); - PRb = new Nsd(ome, meb(0)); - QRb = new Nsd(pme, qme); - NRb = new Nsd(rme, 5); - RRb = WRb; - ORb = VRb; - } - function NUb(a, b) { - var c2, d, e, f2, g; - e = b == 1 ? KUb : JUb; - for (d = e.a.ec().Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 103); - for (g = BD(Qc(a.f.c, c2), 21).Kc(); g.Ob(); ) { - f2 = BD(g.Pb(), 46); - Ekb(a.b.b, BD(f2.b, 81)); - Ekb(a.b.a, BD(f2.b, 81).d); - } - } - } - function kVd(a, b) { - var c2; - if (b != null && !a.c.Yj().wj(b)) { - c2 = JD(b, 56) ? BD(b, 56).Tg().zb : hdb(rb(b)); - throw vbb(new Cdb(ite + a.c.ne() + "'s type '" + a.c.Yj().ne() + "' does not permit a value of type '" + c2 + "'")); - } - } - function cZb(a, b, c2) { - var d, e; - e = new Bib(a.b, 0); - while (e.b < e.d.gc()) { - d = (sCb(e.b < e.d.gc()), BD(e.d.Xb(e.c = e.b++), 70)); - if (PD(vNb(d, (wtc(), btc))) !== PD(b)) { - continue; - } - Y$b(d.n, Q_b(a.c.i), c2); - uib(e); - Ekb(b.b, d); - } - } - function vdc(a, b) { - if (b.a) { - switch (BD(vNb(b.b, (wtc(), dtc)), 98).g) { - case 0: - case 1: - llc(b); - case 2: - MAb(new YAb(null, new Kub(b.d, 16)), new Idc()); - wkc(a.a, b); - } + 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 { - MAb(new YAb(null, new Kub(b.d, 16)), new Idc()); - } - } - function Znc(a) { - var b, c2; - c2 = $wnd.Math.sqrt((a.k == null && (a.k = Soc(a, new bpc())), Edb(a.k) / (a.b * (a.g == null && (a.g = Poc(a, new _oc())), Edb(a.g))))); - b = Tbb(Cbb($wnd.Math.round(c2))); - b = $wnd.Math.min(b, a.f); - return b; - } - function H0b() { - z0b(); - n_b.call(this); - this.j = (Ucd(), Scd); - this.a = new d7c(); - new L_b(); - this.f = (Xj(2, Jie), new Skb(2)); - this.e = (Xj(4, Jie), new Skb(4)); - this.g = (Xj(4, Jie), new Skb(4)); - this.b = new Z0b(this.e, this.g); - } - function j3b(a, b) { - var c2, d; - if (Ccb(DD(vNb(b, (wtc(), ltc))))) { - return false; - } - d = b.c.i; - if (a == (Ctc(), xtc)) { - if (d.k == (j0b(), f0b)) { - return false; - } - } - c2 = BD(vNb(d, (Nyc(), mxc)), 163); - if (c2 == ytc) { - return false; + return this.conditionStack[0]; } - return true; - } - function k3b(a, b) { - var c2, d; - if (Ccb(DD(vNb(b, (wtc(), ltc))))) { - return false; - } - d = b.d.i; - if (a == (Ctc(), ztc)) { - if (d.k == (j0b(), f0b)) { - return false; - } - } - c2 = BD(vNb(d, (Nyc(), mxc)), 163); - if (c2 == Atc) { - return false; - } - return true; - } - function L3b(a, b) { - var c2, d, e, f2, g, h, i3; - g = a.d; - i3 = a.o; - h = new J6c(-g.b, -g.d, g.b + i3.a + g.c, g.d + i3.b + g.a); - for (d = b, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - !!c2 && H6c(h, c2.i); - } - g.b = -h.c; - g.d = -h.d; - g.c = h.b - g.b - i3.a; - g.a = h.a - g.d - i3.b; - } - function N_c() { - N_c = ccb; - I_c = new O_c("CENTER_DISTANCE", 0); - J_c = new O_c("CIRCLE_UNDERLAP", 1); - M_c = new O_c("RECTANGLE_UNDERLAP", 2); - K_c = new O_c("INVERTED_OVERLAP", 3); - L_c = new O_c("MINIMUM_ROOT_DISTANCE", 4); - } - function jde(a) { - hde(); - var b, c2, d, e, f2; - if (a == null) - return null; - d = a.length; - e = d * 2; - b = KC(TD, $ie, 25, e, 15, 1); - for (c2 = 0; c2 < d; c2++) { - f2 = a[c2]; - f2 < 0 && (f2 += 256); - b[c2 * 2] = gde[f2 >> 4]; - b[c2 * 2 + 1] = gde[f2 & 15]; - } - return zfb(b, 0, b.length); - } - function fn(a) { - Vm(); - var b, c2, d; - d = a.c.length; - switch (d) { - case 0: - return Um; - case 1: - b = BD(qr(new olb(a)), 42); - return ln(b.cd(), b.dd()); - default: - c2 = BD(Qkb(a, KC(CK, zie, 42, a.c.length, 0, 1)), 165); - return new wx(c2); - } - } - function ITb(a) { - var b, c2, d, e, f2, g; - b = new jkb(); - c2 = new jkb(); - Wjb(b, a); - Wjb(c2, a); - while (c2.b != c2.c) { - e = BD(fkb(c2), 37); - for (g = new olb(e.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 10); - if (f2.e) { - d = f2.e; - Wjb(b, d); - Wjb(c2, d); - } - } - } - return b; - } - function Y_b(a, b) { - switch (b.g) { - case 1: - return Nq(a.j, (z0b(), v0b)); - case 2: - return Nq(a.j, (z0b(), t0b)); - case 3: - return Nq(a.j, (z0b(), x0b)); - case 4: - return Nq(a.j, (z0b(), y0b)); - default: - return mmb(), mmb(), jmb; - } - } - function tic(a, b) { - var c2, d, e; - c2 = uic(b, a.e); - d = BD(Ohb(a.g.f, c2), 19).a; - e = a.a.c.length - 1; - if (a.a.c.length != 0 && BD(Ikb(a.a, e), 287).c == d) { - ++BD(Ikb(a.a, e), 287).a; - ++BD(Ikb(a.a, e), 287).b; + }, "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 { - Ekb(a.a, new Dic(d)); - } - } - function VGc(a, b, c2) { - var d, e; - d = UGc(a, b, c2); - if (d != 0) { - return d; - } - if (wNb(b, (wtc(), Zsc)) && wNb(c2, Zsc)) { - e = beb(BD(vNb(b, Zsc), 19).a, BD(vNb(c2, Zsc), 19).a); - e < 0 ? WGc(a, b, c2) : e > 0 && WGc(a, c2, b); - return e; - } - return TGc(a, b, c2); - } - function MSc(a, b, c2) { - var d, e, f2, g; - if (b.b != 0) { - d = new Psb(); - for (g = Jsb(b, 0); g.b != g.d.c; ) { - f2 = BD(Xsb(g), 86); - ye(d, URc(f2)); - e = f2.e; - e.a = BD(vNb(f2, (mTc(), kTc)), 19).a; - e.b = BD(vNb(f2, lTc), 19).a; - } - MSc(a, d, Udd(c2, d.b / a.a | 0)); - } - } - function JZc(a, b) { - var c2, d, e, f2, g; - if (a.e <= b) { - return a.g; - } - if (LZc(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 = MZc(a, e, false); - if (c2.b <= e && c2.a <= b) { - g = e; - f2 = e; - } else { - d = e; - } - e = (f2 - d) / 2 + d; - } - return g; - } - function t2c(a, b, c2) { - var d; - d = o2c(a, b, true); - Odd(c2, "Recursive Graph Layout", d); - jfd(b, OC(GC(g2, 1), Uhe, 527, 0, [new q3c()])); - ikd(b, (Y9c(), F9c)) || jfd(b, OC(GC(g2, 1), Uhe, 527, 0, [new U3c()])); - u2c(a, b, null, c2); - Qdd(c2); - } - function Qdd(a) { - var b; - if (a.p == null) { - throw vbb(new Zdb("The task has not begun yet.")); - } - if (!a.b) { - if (a.k) { - b = (Zfb(), Ibb(Cbb(Date.now()), _ie)); - a.q = Sbb(Qbb(b, a.o)) * 1e-9; - } - a.c < a.r && Rdd(a, a.r - a.c); - a.b = true; - } - } - function ofd(a) { - var b, c2, d; - d = new s7c(); - Dsb(d, new f7c(a.j, a.k)); - for (c2 = new Fyd((!a.a && (a.a = new xMd(y2, a, 5)), a.a)); c2.e != c2.i.gc(); ) { - b = BD(Dyd(c2), 469); - Dsb(d, new f7c(b.a, b.b)); - } - Dsb(d, new f7c(a.b, a.c)); - return d; - } - function qqd(a, b, c2, d, e) { - var f2, g, h, i3, j, k; - if (e) { - i3 = e.a.length; - f2 = new Yge(i3); - for (k = (f2.b - f2.a) * f2.c < 0 ? (Xge(), Wge) : new she(f2); k.Ob(); ) { - j = BD(k.Pb(), 19); - h = Zpd(e, j.a); - g = new prd(a, b, c2, d); - rqd(g.a, g.b, g.c, g.d, h); - } - } - } - function Ax(b, c2) { - var d; - if (PD(b) === PD(c2)) { - return true; - } - if (JD(c2, 21)) { - d = BD(c2, 21); - try { - return b.gc() == d.gc() && b.Ic(d); - } catch (a) { - a = ubb(a); - if (JD(a, 173) || JD(a, 205)) { - return false; - } else - throw vbb(a); - } - } - return false; - } - function UHb(a, b) { - var c2; - Ekb(a.d, b); - c2 = b.rf(); - 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); + 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 { - 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 cmc(a) { - var b, c2, d, e; - e = a.i; - b = e.b; - d = e.j; - c2 = e.g; - switch (e.a.g) { + 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: - c2.a = (a.g.b.o.a - d.a) / 2; + return 41; break; case 1: - c2.a = b.d.n.a + b.d.a.a; + return 48; break; case 2: - c2.a = b.d.n.a + b.d.a.a - d.a; + return 49; break; case 3: - c2.b = b.d.n.b + b.d.a.b; - } - } - function Q6c(a, b, c2, d, e) { - if (d < b || e < c2) { - throw vbb(new Wdb("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 lsd(a) { - if (JD(a, 149)) { - return esd(BD(a, 149)); - } else if (JD(a, 229)) { - return fsd(BD(a, 229)); - } else if (JD(a, 23)) { - return gsd(BD(a, 23)); - } else { - throw vbb(new Wdb(Xte + Fe(new amb(OC(GC(SI, 1), Uhe, 1, 5, [a]))))); - } - } - function mhb(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) { - $fb(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 zMc(a, b, c2, d) { - var e, f2, g; - if (b.k == (j0b(), g0b)) { - for (f2 = new Sr(ur(R_b(b).a.Kc(), new Sq())); Qr(f2); ) { - e = BD(Rr(f2), 17); - g = e.c.i.k; - if (g == g0b && a.c.a[e.c.i.c.p] == d && a.c.a[b.c.p] == c2) { - return true; - } - } - } - return false; - } - function mD(a, b) { - var c2, d, e, f2; - b &= 63; - c2 = a.h & Fje; - 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 TC(d & Eje, e & Eje, f2 & Fje); - } - function Iic(a, b, c2, d) { - var e; - this.b = d; - this.e = a == (rGc(), pGc); - e = b[c2]; - this.d = IC(sbb, [nie, dle], [177, 25], 16, [e.length, e.length], 2); - this.a = IC(WD, [nie, oje], [48, 25], 15, [e.length, e.length], 2); - this.c = new sic(b, c2); - } - function ljc(a) { - var b, c2, d; - a.k = new Ki((Ucd(), OC(GC(F1, 1), bne, 61, 0, [Scd, Acd, zcd, Rcd, Tcd])).length, a.j.c.length); - for (d = new olb(a.j); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 113); - b = c2.d.j; - Rc(a.k, b, c2); - } - a.e = Zjc(Ec(a.k)); - } - function UQc(a, b) { - var c2, d, e; - Qqb(a.d, b); - c2 = new _Qc(); - Rhb(a.c, b, c2); - c2.f = VQc(b.c); - c2.a = VQc(b.d); - c2.d = (hQc(), e = b.c.i.k, e == (j0b(), h0b) || e == d0b); - c2.e = (d = b.d.i.k, d == h0b || d == d0b); - c2.b = b.c.j == (Ucd(), Tcd); - c2.c = b.d.j == zcd; - } - function BGb(a) { - var b, c2, d, e, f2; - f2 = Ohe; - e = Ohe; - for (d = new olb(LFb(a)); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 213); - b = c2.e.e - c2.d.e; - c2.e == a && b < e ? e = b : b < f2 && (f2 = b); - } - e == Ohe && (e = -1); - f2 == Ohe && (f2 = -1); - return new vgd(meb(e), meb(f2)); - } - function zQb(a, b) { - var c2, d, e; - e = dme; - d = (ROb(), OOb); - e = $wnd.Math.abs(a.b); - c2 = $wnd.Math.abs(b.f - a.b); - if (c2 < e) { - e = c2; - d = POb; - } - c2 = $wnd.Math.abs(a.a); - if (c2 < e) { - e = c2; - d = QOb; - } - c2 = $wnd.Math.abs(b.g - a.a); - if (c2 < e) { - e = c2; - d = NOb; - } - return d; - } - function L9b(a, b) { - var c2, d, e, f2; - c2 = b.a.o.a; - f2 = new Jib(Q_b(b.a).b, b.c, b.f + 1); - for (e = new vib(f2); e.b < e.d.gc(); ) { - d = (sCb(e.b < e.d.gc()), BD(e.d.Xb(e.c = e.b++), 29)); - if (d.c.a >= c2) { - K9b(a, b, d.p); - return true; - } - } - return false; - } - function Iod(a) { - var b; - if ((a.Db & 64) != 0) - return fld(a); - b = new Wfb(dte); - !a.a || Qfb(Qfb((b.a += ' "', b), a.a), '"'); - Qfb(Lfb(Qfb(Lfb(Qfb(Lfb(Qfb(Lfb((b.a += " (", b), a.i), ","), a.j), " | "), a.g), ","), a.f), ")"); - return b.a; - } - function Z2d(a, b, c2) { - var d, e, f2, g, h; - h = S6d(a.e.Tg(), b); - e = BD(a.g, 119); - d = 0; - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (h.rl(f2.ak())) { - if (d == c2) { - Xxd(a, g); - return Q6d(), BD(b, 66).Oj() ? f2 : f2.dd(); - } - ++d; - } - } - throw vbb(new qcb(gve + c2 + mue + d)); - } - function sde(a) { - var b, c2, d; - b = a.c; - if (b == 2 || b == 7 || b == 1) { - return wfe(), wfe(), ffe; - } else { - d = qde(a); - c2 = null; - while ((b = a.c) != 2 && b != 7 && b != 1) { - if (!c2) { - c2 = (wfe(), wfe(), new Lge(1)); - Kge(c2, d); - d = c2; - } - Kge(c2, qde(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)", OC(GC(SI, 1), Uhe, 1, 5, [meb(b), meb(a)])); - } - function Pz(b, c2) { - var d, e, f2, g; - for (e = 0, f2 = b.length; e < f2; e++) { - g = b[e]; - try { - g[1] ? g[0].jm() && (c2 = Oz(c2, g)) : g[0].jm(); - } catch (a) { - a = ubb(a); - if (JD(a, 78)) { - d = a; - Az(); - Gz(JD(d, 477) ? BD(d, 477).ae() : d); - } else - throw vbb(a); - } - } - return c2; - } - function K9b(a, b, c2) { - var d, e, f2; - c2 != b.c + b.b.gc() && Z9b(b.a, fac(b, c2 - b.c)); - f2 = b.a.c.p; - a.a[f2] = $wnd.Math.max(a.a[f2], b.a.o.a); - for (e = BD(vNb(b.a, (wtc(), ktc)), 15).Kc(); e.Ob(); ) { - d = BD(e.Pb(), 70); - yNb(d, H9b, (Bcb(), true)); - } - } - function Wec(a, b) { - var c2, d, e; - e = Vec(b); - yNb(b, (wtc(), Xsc), e); - if (e) { - d = Ohe; - !!irb(a.f, e) && (d = BD(Wd(irb(a.f, e)), 19).a); - c2 = BD(Ikb(b.g, 0), 17); - Ccb(DD(vNb(c2, ltc))) || Rhb(a, e, meb($wnd.Math.min(BD(vNb(c2, Zsc), 19).a, d))); - } - } - function iCc(a, b, c2) { - var d, e, f2, g, h; - b.p = -1; - for (h = W_b(b, (KAc(), IAc)).Kc(); h.Ob(); ) { - g = BD(h.Pb(), 11); - for (e = new olb(g.g); e.a < e.c.c.length; ) { - d = BD(mlb(e), 17); - f2 = d.d.i; - b != f2 && (f2.p < 0 ? c2.Fc(d) : f2.p > 0 && iCc(a, f2, c2)); - } - } - b.p = 0; - } - function p5c(a) { - var b; - this.c = new Psb(); - 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 = BD(gdb(e1), 9), new xqb(b, BD(_Bb(b, b.length), 9), 0)) : this.j = a.i; - this.g = a.f; - } - function Wb(a) { - var b, c2, d, e; - b = Kfb(Qfb(new Wfb("Predicates."), "and"), 40); - c2 = true; - for (e = new vib(a); e.b < e.d.gc(); ) { - d = (sCb(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 Rcc(a, b, c2) { - var d, e, f2; - if (c2 <= b + 2) { - return; - } - e = (c2 - b) / 2 | 0; - for (d = 0; d < e; ++d) { - f2 = (tCb(b + d, a.c.length), BD(a.c[b + d], 11)); - Nkb(a, b + d, (tCb(c2 - d - 1, a.c.length), BD(a.c[c2 - d - 1], 11))); - tCb(c2 - d - 1, a.c.length); - a.c[c2 - d - 1] = f2; - } - } - function hjc(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - f2 = a.d.p; - h = f2.e; - i3 = f2.r; - a.g = new dIc(i3); - g = a.d.o.c.p; - d = g > 0 ? h[g - 1] : KC(OQ, kne, 10, 0, 0, 1); - e = h[g]; - j = g < h.length - 1 ? h[g + 1] : KC(OQ, kne, 10, 0, 0, 1); - k = b == c2 - 1; - k ? RHc(a.g, e, j) : RHc(a.g, d, e); - } - function pjc(a) { - var b; - this.j = new Rkb(); - this.f = new Tqb(); - this.b = (b = BD(gdb(F1), 9), new xqb(b, BD(_Bb(b, b.length), 9), 0)); - this.d = KC(WD, oje, 25, (Ucd(), OC(GC(F1, 1), bne, 61, 0, [Scd, Acd, zcd, Rcd, Tcd])).length, 15, 1); - this.g = a; - } - function QVc(a, b) { - var c2, d, e; - if (b.c.length != 0) { - c2 = RVc(a, b); - e = false; - while (!c2) { - AVc(a, b, true); - e = true; - c2 = RVc(a, b); - } - e && AVc(a, b, false); - d = dVc(b); - !!a.b && a.b.lg(d); - a.a = PVc(a, (tCb(0, b.c.length), BD(b.c[0], 33))); - QVc(a, d); - } - } - function Cid(a, b) { - var c2, d, e; - d = XKd(a.Tg(), b); - c2 = b - a.Ah(); - if (c2 < 0) { - if (!d) { - throw vbb(new Wdb(mte + b + nte)); - } else if (d.Ij()) { - e = a.Yg(d); - e >= 0 ? a.Bh(e) : vid(a, d); - } else { - throw vbb(new Wdb(ite + d.ne() + jte)); - } - } else { - eid(a, c2, d); - } - } - function aqd(a) { - var b, c2; - c2 = null; - b = false; - if (JD(a, 204)) { - b = true; - c2 = BD(a, 204).a; - } - if (!b) { - if (JD(a, 258)) { - b = true; - c2 = "" + BD(a, 258).a; - } - } - if (!b) { - if (JD(a, 483)) { - b = true; - c2 = "" + BD(a, 483).a; - } - } - if (!b) { - throw vbb(new vcb(Ute)); - } - return c2; - } - function ORd(a, b) { - var c2, d; - if (a.f) { - while (b.Ob()) { - c2 = BD(b.Pb(), 72); - d = c2.ak(); - if (JD(d, 99) && (BD(d, 18).Bb & ote) != 0 && (!a.e || d.Gj() != x2 || d.aj() != 0) && c2.dd() != null) { - b.Ub(); - return true; - } - } - return false; - } else { - return b.Ob(); - } - } - function QRd(a, b) { - var c2, d; - if (a.f) { - while (b.Sb()) { - c2 = BD(b.Ub(), 72); - d = c2.ak(); - if (JD(d, 99) && (BD(d, 18).Bb & ote) != 0 && (!a.e || d.Gj() != x2 || d.aj() != 0) && c2.dd() != null) { - b.Pb(); - return true; - } - } - return false; - } else { - return b.Sb(); - } - } - function I2d(a, b, c2) { - var d, e, f2, g, h, i3; - i3 = S6d(a.e.Tg(), b); - d = 0; - h = a.i; - e = BD(a.g, 119); - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (i3.rl(f2.ak())) { - if (c2 == d) { - return g; - } - ++d; - h = g + 1; - } - } - if (c2 == d) { - return h; - } else { - throw vbb(new qcb(gve + c2 + mue + d)); - } - } - function d9b(a, b) { - var c2, d, e, f2; - if (a.f.c.length == 0) { - return null; - } else { - f2 = new I6c(); - for (d = new olb(a.f); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 70); - 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 QJc(a, b, c2) { - var d, e, f2; - for (e = new Sr(ur(O_b(c2).a.Kc(), new Sq())); Qr(e); ) { - d = BD(Rr(e), 17); - if (!(!OZb(d) && !(!OZb(d) && d.c.i.c == d.d.i.c))) { - continue; - } - f2 = IJc(a, d, c2, new vKc()); - f2.c.length > 1 && (b.c[b.c.length] = f2, true); - } - } - function TJc(a) { - var b, c2, d, e; - c2 = new Psb(); - ye(c2, a.o); - d = new twb(); - while (c2.b != 0) { - b = BD(c2.b == 0 ? null : (sCb(c2.b != 0), Nsb(c2, c2.a.a)), 508); - e = KJc(a, b, true); - e && Ekb(d.a, b); - } - while (d.a.c.length != 0) { - b = BD(rwb(d), 508); - KJc(a, b, false); - } - } - function _5c() { - _5c = ccb; - $5c = new a6c(ole, 0); - T5c = new a6c("BOOLEAN", 1); - X5c = new a6c("INT", 2); - Z5c = new a6c("STRING", 3); - U5c = new a6c("DOUBLE", 4); - V5c = new a6c("ENUM", 5); - W5c = new a6c("ENUMSET", 6); - Y5c = new a6c("OBJECT", 7); - } - function H6c(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; - } - G6c(a, d, f2, e - d, g - f2); - } - function O6d() { - O6d = ccb; - L6d = OC(GC(ZI, 1), nie, 2, 6, [swe, twe, uwe, vwe, wwe, xwe, eue]); - K6d = OC(GC(ZI, 1), nie, 2, 6, [swe, "empty", twe, Qve, "elementOnly"]); - N6d = OC(GC(ZI, 1), nie, 2, 6, [swe, "preserve", "replace", ywe]); - M6d = new y1d(); - } - function Y$b(a, b, c2) { - var d, e, f2; - if (b == c2) { - return; - } - d = b; - do { - P6c(a, d.c); - e = d.e; - if (e) { - f2 = d.d; - O6c(a, f2.b, f2.d); - P6c(a, e.n); - d = Q_b(e); - } - } while (e); - d = c2; - do { - c7c(a, d.c); - e = d.e; - if (e) { - f2 = d.d; - b7c(a, f2.b, f2.d); - c7c(a, e.n); - d = Q_b(e); - } - } while (e); - } - function qic(a, b, c2, d) { - var e, f2, g, h, i3; - if (d.f.c + d.g.c == 0) { - for (g = a.a[a.c], h = 0, i3 = g.length; h < i3; ++h) { - f2 = g[h]; - Rhb(d, f2, new zic(a, f2, c2)); - } - } - e = BD(Wd(irb(d.f, b)), 663); - e.b = 0; - e.c = e.f; - e.c == 0 || Cic(BD(Ikb(e.a, e.b), 287)); - return e; - } - function Apc() { - Apc = ccb; - wpc = new Bpc("MEDIAN_LAYER", 0); - ypc = new Bpc("TAIL_LAYER", 1); - vpc = new Bpc("HEAD_LAYER", 2); - xpc = new Bpc("SPACE_EFFICIENT_LAYER", 3); - zpc = new Bpc("WIDEST_LAYER", 4); - upc = new Bpc("CENTER_LAYER", 5); - } - function rJb(a) { - switch (a.g) { - case 0: - case 1: - case 2: - return Ucd(), Acd; - case 3: + return 50; + break; case 4: + return 51; + break; case 5: - return Ucd(), Rcd; + break; case 6: + { + } + break; case 7: + return 5; + break; case 8: - return Ucd(), Tcd; + break; case 9: + break; case 10: + break; case 11: - return Ucd(), zcd; - default: - return Ucd(), Scd; - } - } - function sKc(a, b) { - var c2; - if (a.c.length == 0) { - return false; - } - c2 = Lzc((tCb(0, a.c.length), BD(a.c[0], 17)).c.i); - FJc(); - if (c2 == (Izc(), Fzc) || c2 == Ezc) { - return true; - } - return FAb(NAb(new YAb(null, new Kub(a, 16)), new AKc()), new CKc(b)); - } - function cRc(a, b, c2) { - var d, e, f2; - if (!a.b[b.g]) { - a.b[b.g] = true; - d = c2; - !d && (d = new SRc()); - Dsb(d.b, b); - for (f2 = a.a[b.g].Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 188); - e.b != b && cRc(a, e.b, d); - e.c != b && cRc(a, e.c, d); - Dsb(d.a, e); - } - return d; - } - return null; - } - function qSc() { - qSc = ccb; - pSc = new rSc("ROOT_PROC", 0); - lSc = new rSc("FAN_PROC", 1); - nSc = new rSc("NEIGHBORS_PROC", 2); - mSc = new rSc("LEVEL_HEIGHT", 3); - oSc = new rSc("NODE_POSITION_PROC", 4); - kSc = new rSc("DETREEIFYING_PROC", 5); - } - function kqd(a, b) { - if (JD(b, 239)) { - return eqd(a, BD(b, 33)); - } else if (JD(b, 186)) { - return fqd(a, BD(b, 118)); - } else if (JD(b, 439)) { - return dqd(a, BD(b, 202)); - } else { - throw vbb(new Wdb(Xte + Fe(new amb(OC(GC(SI, 1), Uhe, 1, 5, [b]))))); - } - } - function xu(a, b, c2) { - var d, e; - this.f = a; - d = BD(Ohb(a.b, b), 283); - 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) { - vu(this); - } - } else { - this.c = !d ? null : d.b; - while (c2-- > 0) { - uu(this); - } - } - this.b = b; - this.a = null; - } - function rEb(a, b) { - var c2, d; - b.a ? sEb(a, b) : (c2 = BD(Exb(a.b, b.b), 57), !!c2 && c2 == a.a[b.b.f] && !!c2.a && c2.a != b.b.a && c2.c.Fc(b.b), d = BD(Dxb(a.b, b.b), 57), !!d && a.a[d.f] == b.b && !!d.a && d.a != b.b.a && b.b.c.Fc(d), Fxb(a.b, b.b), void 0); - } - function FJb(a, b) { - var c2, d; - c2 = BD(Mpb(a.b, b), 124); - if (BD(BD(Qc(a.r, b), 21), 84).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((tdd(), sdd)) && KJb(a, b); - d = JJb(a, b); - KIb(a, b) == (Tbd(), Qbd) && (d += 2 * a.w); - c2.a.a = d; - } - function OKb(a, b) { - var c2, d; - c2 = BD(Mpb(a.b, b), 124); - if (BD(BD(Qc(a.r, b), 21), 84).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((tdd(), sdd)) && SKb(a, b); - d = RKb(a, b); - KIb(a, b) == (Tbd(), Qbd) && (d += 2 * a.w); - c2.a.b = d; - } - function cOb(a, b) { - var c2, d, e, f2; - f2 = new Rkb(); - for (d = new olb(b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 65); - Ekb(f2, new oOb(c2, true)); - Ekb(f2, new oOb(c2, false)); - } - e = new hOb(a); - zwb(e.a.a); - kDb(f2, a.b, new amb(OC(GC(JM, 1), Uhe, 679, 0, [e]))); - } - function rQb(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2, p, q; - i3 = a.a; - n = a.b; - j = b.a; - o2 = b.b; - k = c2.a; - p = c2.b; - l = d.a; - q = d.b; - f2 = i3 * o2 - n * j; - g = k * q - p * l; - e = (i3 - j) * (p - q) - (n - o2) * (k - l); - h = (f2 * (k - l) - g * (i3 - j)) / e; - m = (f2 * (p - q) - g * (n - o2)) / e; - return new f7c(h, m); - } - function TBc(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 Sr(ur(U_b(b).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 17); - if (OZb(c2)) { - continue; - } - e = c2.d.i; - a.a[e.p] ? Ekb(a.b, c2) : TBc(a, e); - } - a.a[b.p] = false; - } - function pCc(a, b, c2) { - var d; - d = 0; - switch (BD(vNb(b, (Nyc(), mxc)), 163).g) { - case 2: - d = 2 * -c2 + a.a; - ++a.a; break; - case 1: - d = -c2; + case 12: + this.pushState("SCALE"); + return 17; break; - case 3: - d = c2; + case 13: + return 18; break; - case 4: - d = 2 * c2 + a.b; - ++a.b; - } - wNb(b, (wtc(), Zsc)) && (d += BD(vNb(b, Zsc), 19).a); - return d; - } - function jOc(a, b, c2) { - var d, e, f2; - c2.zc(b, a); - Ekb(a.n, b); - f2 = a.p.eg(b); - b.j == a.p.fg() ? yOc(a.e, f2) : yOc(a.j, f2); - lOc(a); - for (e = ul(pl(OC(GC(KI, 1), Uhe, 20, 0, [new J0b(b), new R0b(b)]))); Qr(e); ) { - d = BD(Rr(e), 11); - c2._b(d) || jOc(a, d, c2); - } - } - function rfd(a) { - var b, c2, d; - c2 = BD(hkd(a, (Y9c(), Y8c)), 21); - if (c2.Hc((tdd(), pdd))) { - d = BD(hkd(a, b9c), 21); - b = new g7c(BD(hkd(a, _8c), 8)); - if (d.Hc((Idd(), Bdd))) { - b.a <= 0 && (b.a = 20); - b.b <= 0 && (b.b = 20); - } - return b; - } else { - return new d7c(); - } - } - function PKd(a) { - var b, c2, d; - if (!a.b) { - d = new $Nd(); - for (c2 = new $yd(SKd(a)); c2.e != c2.i.gc(); ) { - b = BD(Zyd(c2), 18); - (b.Bb & ote) != 0 && wtd(d, b); - } - vud(d); - a.b = new nNd((BD(qud(ZKd((NFd(), MFd).o), 8), 18), d.i), d.g); - $Kd(a).b &= -9; - } - return a.b; - } - function Rmc(a, b) { - var c2, d, e, f2, g, h, i3, j; - i3 = BD(Ee(Ec(b.k), KC(F1, bne, 61, 2, 0, 1)), 122); - j = b.g; - c2 = Tmc(b, i3[0]); - e = Smc(b, i3[1]); - d = Kmc(a, j, c2, e); - f2 = Tmc(b, i3[1]); - h = Smc(b, i3[0]); - g = Kmc(a, j, f2, h); - if (d <= g) { - b.a = c2; - b.c = e; - } else { - b.a = f2; - b.c = h; - } - } - function ESc(a, b, c2) { - var d, e, f2; - Odd(c2, "Processor set neighbors", 1); - a.a = b.b.b == 0 ? 1 : b.b.b; - e = null; - d = Jsb(b.b, 0); - while (!e && d.b != d.d.c) { - f2 = BD(Xsb(d), 86); - Ccb(DD(vNb(f2, (mTc(), jTc)))) && (e = f2); - } - !!e && FSc(a, new ZRc(e), c2); - Qdd(c2); - } - function PEd(a) { - IEd(); - var b, c2, d, e; - d = hfb(a, wfb(35)); - b = d == -1 ? a : a.substr(0, d); - c2 = d == -1 ? null : a.substr(d + 1); - e = kFd(HEd, b); - if (!e) { - e = aFd(b); - lFd(HEd, b, e); - c2 != null && (e = JEd(e, c2)); - } else - c2 != null && (e = JEd(e, (uCb(c2), c2))); - return e; - } - function smb(a) { - var h; - mmb(); - var b, c2, d, e, f2, g; - if (JD(a, 54)) { - for (e = 0, d = a.gc() - 1; e < d; ++e, --d) { - h = a.Xb(e); - a._c(e, a.Xb(d)); - a._c(d, h); - } - } else { - b = a.Yc(); - f2 = a.Zc(a.gc()); - while (b.Tb() < f2.Vb()) { - c2 = b.Pb(); - g = f2.Ub(); - b.Wb(g); - f2.Wb(c2); - } - } - } - function I3b(a, b) { - var c2, d, e; - Odd(b, "End label pre-processing", 1); - c2 = Edb(ED(vNb(a, (Nyc(), nyc)))); - d = Edb(ED(vNb(a, ryc))); - e = gad(BD(vNb(a, Lwc), 103)); - MAb(LAb(new YAb(null, new Kub(a.b, 16)), new Q3b()), new S3b(c2, d, e)); - Qdd(b); - } - function NFc(a, b) { - var c2, d, e, f2, g, h; - h = 0; - f2 = new jkb(); - Wjb(f2, b); - while (f2.b != f2.c) { - g = BD(fkb(f2), 214); - h += pHc(g.d, g.e); - for (e = new olb(g.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 37); - c2 = BD(Ikb(a.b, d.p), 214); - c2.s || (h += NFc(a, c2)); - } - } - return h; - } - function YQc(a, b, c2) { - var d, e; - TQc(this); - b == (FQc(), DQc) ? Qqb(this.r, a.c) : Qqb(this.w, a.c); - c2 == DQc ? Qqb(this.r, a.d) : Qqb(this.w, a.d); - UQc(this, a); - d = VQc(a.c); - e = VQc(a.d); - XQc(this, d, e, e); - this.o = (hQc(), $wnd.Math.abs(d - e) < 0.2); - } - function a0d(a, b, c2) { - var d, e, f2, g, h, i3; - h = BD(Ajd(a.a, 8), 1936); - if (h != null) { - for (e = h, f2 = 0, g = e.length; f2 < g; ++f2) { - null.jm(); - } - } - d = c2; - if ((a.a.Db & 1) == 0) { - i3 = new f0d(a, c2, b); - d.ui(i3); - } - JD(d, 672) ? BD(d, 672).wi(a.a) : d.ti() == a.a && d.vi(null); - } - function dae() { - var a; - if (Z9d) - return BD(nUd((yFd(), xFd), Ewe), 1945); - eae(); - a = BD(JD(Phb((yFd(), xFd), Ewe), 586) ? Phb(xFd, Ewe) : new cae(), 586); - Z9d = true; - aae(a); - bae(a); - Rhb((JFd(), IFd), a, new fae()); - Tnd(a); - Shb(xFd, Ewe, a); - return a; - } - function xA(a, b, c2, d) { - var e; - e = oA(a, c2, OC(GC(ZI, 1), nie, 2, 6, [rje, sje, tje, uje, vje, wje, xje]), b); - e < 0 && (e = oA(a, c2, OC(GC(ZI, 1), nie, 2, 6, ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]), b)); - if (e < 0) { - return false; - } - d.d = e; - return true; - } - function AA(a, b, c2, d) { - var e; - e = oA(a, c2, OC(GC(ZI, 1), nie, 2, 6, [rje, sje, tje, uje, vje, wje, xje]), b); - e < 0 && (e = oA(a, c2, OC(GC(ZI, 1), nie, 2, 6, ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]), b)); - if (e < 0) { - return false; - } - d.d = e; - return true; - } - function NVb(a) { - var b, c2, d; - KVb(a); - d = new Rkb(); - for (c2 = new olb(a.a.a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 81); - Ekb(d, new ZVb(b, true)); - Ekb(d, new ZVb(b, false)); - } - RVb(a.c); - rXb(d, a.b, new amb(OC(GC(bQ, 1), Uhe, 369, 0, [a.c]))); - MVb(a); - } - function c4b(a) { - var b, c2, d, e; - c2 = new Lqb(); - for (e = new olb(a.d); e.a < e.c.c.length; ) { - d = BD(mlb(e), 181); - b = BD(d.We((wtc(), Dsc)), 17); - !!irb(c2.f, b) || Rhb(c2, b, new p4b(b)); - Ekb(BD(Wd(irb(c2.f, b)), 456).b, d); - } - return new Tkb(new $ib(c2)); - } - function Gac(a, b) { - var c2, d, e, f2, g; - d = new kkb(a.j.c.length); - c2 = null; - for (f2 = new olb(a.j); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 11); - if (e.j != c2) { - d.b == d.c || Hac(d, c2, b); - Yjb(d); - c2 = e.j; - } - g = N3b(e); - !!g && (Xjb(d, g), true); - } - d.b == d.c || Hac(d, c2, b); - } - function wbc(a, b) { - var c2, d, e; - d = new Bib(a.b, 0); - while (d.b < d.d.gc()) { - c2 = (sCb(d.b < d.d.gc()), BD(d.d.Xb(d.c = d.b++), 70)); - e = BD(vNb(c2, (Nyc(), Qwc)), 272); - if (e == (qad(), oad)) { - uib(d); - Ekb(b.b, c2); - wNb(c2, (wtc(), Dsc)) || yNb(c2, Dsc, a); - } - } - } - function GDc(a) { - var b, c2, d, e, f2; - b = sr(new Sr(ur(U_b(a).a.Kc(), new Sq()))); - for (e = new Sr(ur(R_b(a).a.Kc(), new Sq())); Qr(e); ) { - d = BD(Rr(e), 17); - c2 = d.c.i; - f2 = sr(new Sr(ur(U_b(c2).a.Kc(), new Sq()))); - b = $wnd.Math.max(b, f2); - } - return meb(b); - } - function rUc(a, b, c2) { - var d, e, f2, g; - Odd(c2, "Processor arrange node", 1); - e = null; - f2 = new Psb(); - d = Jsb(b.b, 0); - while (!e && d.b != d.d.c) { - g = BD(Xsb(d), 86); - Ccb(DD(vNb(g, (mTc(), jTc)))) && (e = g); - } - Gsb(f2, e, f2.c.b, f2.c); - qUc(a, f2, Udd(c2, 1)); - Qdd(c2); - } - function Ffd(a, b, c2) { - var d, e, f2; - d = BD(hkd(a, (Y9c(), w8c)), 21); - e = 0; - f2 = 0; - b.a > c2.a && (d.Hc((i8c(), c8c)) ? e = (b.a - c2.a) / 2 : d.Hc(e8c) && (e = b.a - c2.a)); - b.b > c2.b && (d.Hc((i8c(), g8c)) ? f2 = (b.b - c2.b) / 2 : d.Hc(f8c) && (f2 = b.b - c2.b)); - Efd(a, e, f2); - } - function aod(a, b, c2, d, e, f2, g, h, i3, j, k, l, m) { - JD(a.Cb, 88) && XMd($Kd(BD(a.Cb, 88)), 4); - pnd(a, c2); - a.f = g; - dJd(a, h); - fJd(a, i3); - ZId(a, j); - eJd(a, k); - CId(a, l); - aJd(a, m); - BId(a, true); - AId(a, e); - a.ok(f2); - yId(a, b); - d != null && (a.i = null, _Id(a, d)); - } - function PRd(a) { - var b, c2; - if (a.f) { - while (a.n > 0) { - b = BD(a.k.Xb(a.n - 1), 72); - c2 = b.ak(); - if (JD(c2, 99) && (BD(c2, 18).Bb & ote) != 0 && (!a.e || c2.Gj() != x2 || c2.aj() != 0) && b.dd() != null) { - return true; - } else { - --a.n; - } - } - return false; - } else { - return a.n > 0; - } - } - function Jb(a, b, c2) { - if (a < 0) { - return hc(The, OC(GC(SI, 1), Uhe, 1, 5, [c2, meb(a)])); - } else if (b < 0) { - throw vbb(new Wdb(Vhe + b)); - } else { - return hc("%s (%s) must not be greater than size (%s)", OC(GC(SI, 1), Uhe, 1, 5, [c2, meb(a), meb(b)])); - } - } - function Llb(a, b, c2, d, e, f2) { - var g, h, i3, j; - g = d - c2; - if (g < 7) { - Ilb(b, c2, d, f2); - return; - } - i3 = c2 + e; - h = d + e; - j = i3 + (h - i3 >> 1); - Llb(b, a, i3, j, -e, f2); - Llb(b, a, j, h, -e, f2); - if (f2.ue(a[j - 1], a[j]) <= 0) { - while (c2 < d) { - NC(b, c2++, a[i3++]); - } - return; - } - Jlb(a, i3, j, h, b, c2, d, f2); - } - function nEb(a, b) { - var c2, d, e; - e = new Rkb(); - for (d = new olb(a.c.a.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 57); - if (b.Lb(c2)) { - Ekb(e, new BEb(c2, true)); - Ekb(e, new BEb(c2, false)); - } - } - tEb(a.e); - kDb(e, a.d, new amb(OC(GC(JM, 1), Uhe, 679, 0, [a.e]))); - } - function gnc(a, b) { - var c2, d, e, f2, g, h, i3; - i3 = b.d; - e = b.b.j; - for (h = new olb(i3); h.a < h.c.c.length; ) { - g = BD(mlb(h), 101); - f2 = KC(sbb, dle, 25, e.c.length, 16, 1); - Rhb(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 tOc(a, b) { - a.r = new uOc(a.p); - sOc(a.r, a); - ye(a.r.j, a.j); - Osb(a.j); - Dsb(a.j, b); - Dsb(a.r.e, b); - lOc(a); - lOc(a.r); - while (a.f.c.length != 0) { - AOc(BD(Ikb(a.f, 0), 129)); - } - while (a.k.c.length != 0) { - AOc(BD(Ikb(a.k, 0), 129)); - } - return a.r; - } - function yid(a, b, c2) { - var d, e, f2; - e = XKd(a.Tg(), b); - d = b - a.Ah(); - if (d < 0) { - if (!e) { - throw vbb(new Wdb(mte + b + nte)); - } else if (e.Ij()) { - f2 = a.Yg(e); - f2 >= 0 ? a.sh(f2, c2) : uid(a, e, c2); - } else { - throw vbb(new Wdb(ite + e.ne() + jte)); - } - } else { - did(a, d, e, c2); - } - } - function q6d(b) { - var c2, d, e, f2; - d = BD(b, 49).qh(); - if (d) { - try { - e = null; - c2 = nUd((yFd(), xFd), LEd(MEd(d))); - if (c2) { - f2 = c2.rh(); - !!f2 && (e = f2.Wk(tfb(d.e))); - } - if (!!e && e != b) { - return q6d(e); - } - } catch (a) { - a = ubb(a); - if (!JD(a, 60)) - throw vbb(a); - } - } - return b; - } - function jrb(a, b, c2) { - var d, e, f2, g; - g = b == null ? 0 : a.b.se(b); - e = (d = a.a.get(g), d == null ? new Array() : d); - if (e.length == 0) { - a.a.set(g, e); - } else { - f2 = grb(a, b, e); - if (f2) { - return f2.ed(c2); - } - } - NC(e, e.length, new pjb(b, c2)); - ++a.c; - zpb(a.b); - return null; - } - function YUc(a, b) { - var c2, d; - H2c(a.a); - K2c(a.a, (PUc(), NUc), NUc); - K2c(a.a, OUc, OUc); - d = new j3c(); - e3c(d, OUc, (tVc(), sVc)); - PD(hkd(b, (ZWc(), LWc))) !== PD((pWc(), mWc)) && e3c(d, OUc, qVc); - e3c(d, OUc, rVc); - E2c(a.a, d); - c2 = F2c(a.a, b); - return c2; - } - function uC(a) { - if (!a) { - return OB(), NB; - } - var b = a.valueOf ? a.valueOf() : a; - if (b !== a) { - var c2 = qC[typeof b]; - return c2 ? c2(b) : xC(typeof b); - } else if (a instanceof Array || a instanceof $wnd.Array) { - return new xB(a); - } else { - return new fC(a); - } - } - function RJb(a, b, c2) { - var d, e, f2; - f2 = a.o; - d = BD(Mpb(a.p, c2), 244); - e = d.i; - e.b = gIb(d); - e.a = fIb(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; + case 14: + this.popState(); break; - case 3: - e.d = f2.b; - } - hIb(d); - iIb(d); - } - function SJb(a, b, c2) { - var d, e, f2; - f2 = a.o; - d = BD(Mpb(a.p, c2), 244); - e = d.i; - e.b = gIb(d); - e.a = fIb(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; + case 15: + this.begin("acc_title"); + return 33; break; - case 2: - e.c = f2.a; - } - hIb(d); - iIb(d); - } - function Jgc(a, b) { - var c2, d, e, f2, g; - if (b.dc()) { - return; - } - e = BD(b.Xb(0), 128); - if (b.gc() == 1) { - Igc(a, e, e, 1, 0, b); - return; - } - c2 = 1; - while (c2 < b.gc()) { - if (e.j || !e.o) { - f2 = Ogc(b, c2); - if (f2) { - d = BD(f2.a, 19).a; - g = BD(f2.b, 128); - Igc(a, e, g, c2, d, b); - c2 = d + 1; - e = g; - } - } - } - } - function mlc(a) { - var b, c2, d, e, f2, g; - g = new Tkb(a.d); - Okb(g, new Qlc()); - b = (Alc(), OC(GC(KV, 1), Kie, 270, 0, [tlc, wlc, slc, zlc, vlc, ulc, ylc, xlc])); - c2 = 0; - for (f2 = new olb(g); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 101); - d = b[c2 % b.length]; - olc(e, d); - ++c2; - } - } - function o6c(a, b) { - i6c(); - var c2, d, e, f2; - if (b.b < 2) { - return false; - } - f2 = Jsb(b, 0); - c2 = BD(Xsb(f2), 8); - d = c2; - while (f2.b != f2.d.c) { - e = BD(Xsb(f2), 8); - if (!(m6c(a, d) && m6c(a, e))) { - return false; - } - d = e; - } - if (!(m6c(a, d) && m6c(a, c2))) { - return false; - } - return true; - } - function hrd(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - k = null; - l = a; - g = Xpd(l, "x"); - c2 = new Krd(b); - Gqd(c2.a, g); - h = Xpd(l, "y"); - d = new Lrd(b); - Hqd(d.a, h); - i3 = Xpd(l, Gte); - e = new Mrd(b); - Iqd(e.a, i3); - j = Xpd(l, Fte); - f2 = new Nrd(b); - k = (Jqd(f2.a, j), j); - return k; - } - function XMd(a, b) { - TMd(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 l0d(b, c2) { - var d, e, f2; - f2 = 0; - if (c2.length > 0) { - try { - f2 = Icb(c2, Rie, Ohe); - } catch (a) { - a = ubb(a); - if (JD(a, 127)) { - e = a; - throw vbb(new rFd(e)); - } else - throw vbb(a); - } - } - d = (!b.a && (b.a = new z0d(b)), b.a); - return f2 < d.i && f2 >= 0 ? BD(qud(d, f2), 56) : null; - } - function Ib(a, b) { - if (a < 0) { - return hc(The, OC(GC(SI, 1), Uhe, 1, 5, ["index", meb(a)])); - } else if (b < 0) { - throw vbb(new Wdb(Vhe + b)); - } else { - return hc("%s (%s) must be less than size (%s)", OC(GC(SI, 1), Uhe, 1, 5, ["index", meb(a), meb(b)])); - } - } - function Slb(a) { - var b, c2, d, e, f2; - if (a == null) { - return Xhe; - } - f2 = new xwb(She, "[", "]"); - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - !f2.a ? f2.a = new Wfb(f2.d) : Qfb(f2.a, f2.b); - Nfb(f2.a, "" + b); - } - return !f2.a ? f2.c : f2.e.length == 0 ? f2.a.a : f2.a.a + ("" + f2.e); - } - function Tlb(a) { - var b, c2, d, e, f2; - if (a == null) { - return Xhe; - } - f2 = new xwb(She, "[", "]"); - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - !f2.a ? f2.a = new Wfb(f2.d) : Qfb(f2.a, f2.b); - Nfb(f2.a, "" + b); - } - return !f2.a ? f2.c : f2.e.length == 0 ? f2.a.a : f2.a.a + ("" + f2.e); - } - function Ulb(a) { - var b, c2, d, e, f2; - if (a == null) { - return Xhe; - } - f2 = new xwb(She, "[", "]"); - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - !f2.a ? f2.a = new Wfb(f2.d) : Qfb(f2.a, f2.b); - Nfb(f2.a, "" + b); - } - return !f2.a ? f2.c : f2.e.length == 0 ? f2.a.a : f2.a.a + ("" + f2.e); - } - function Xlb(a) { - var b, c2, d, e, f2; - if (a == null) { - return Xhe; - } - f2 = new xwb(She, "[", "]"); - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - !f2.a ? f2.a = new Wfb(f2.d) : Qfb(f2.a, f2.b); - Nfb(f2.a, "" + b); - } - return !f2.a ? f2.c : f2.e.length == 0 ? f2.a.a : f2.a.a + ("" + f2.e); - } - function bub(a, b) { - var c2, d, e, f2, g, h; - c2 = a.b.c.length; - e = Ikb(a.b, b); - while (b * 2 + 1 < c2) { - d = (f2 = 2 * b + 1, g = f2 + 1, h = f2, g < c2 && a.a.ue(Ikb(a.b, g), Ikb(a.b, f2)) < 0 && (h = g), h); - if (a.a.ue(e, Ikb(a.b, d)) < 0) { - break; - } - Nkb(a.b, b, Ikb(a.b, d)); - b = d; - } - Nkb(a.b, b, e); - } - function $Bb(a, b, c2, d, e, f2) { - var g, h, i3, j, k; - if (PD(a) === PD(c2)) { - a = a.slice(b, b + e); - b = 0; - } - i3 = 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(i3, k); - h = g; - d += e; - } - } - function xGb(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; - } - return false; - } - function cRb(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 = Y6c(c7c(new f7c(h.a, h.b), g), 1 / (d + 1)); - f2 = new f7c(g.a, g.b); - for (c2 = new olb(a.a); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 559); - b.d.a = f2.a; - b.d.b = f2.b; - P6c(f2, e); - } - } - } - function YNb(a, b, c2) { - var d, e, f2, g, h, i3; - i3 = Pje; - for (f2 = new olb(wOb(a.b)); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 168); - for (h = new olb(wOb(b.b)); h.a < h.c.c.length; ) { - g = BD(mlb(h), 168); - d = p6c(e.a, e.b, g.a, g.b, c2); - i3 = $wnd.Math.min(i3, d); - } - } - return i3; - } - function G0b(a, b) { - if (!b) { - throw vbb(new Geb()); - } - 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 dfc(a, b) { - var c2, d, e; - if (JD(b.g, 10) && BD(b.g, 10).k == (j0b(), e0b)) { - return Pje; - } - e = ugc(b); - if (e) { - return $wnd.Math.max(0, a.b / 2 - 0.5); - } - c2 = tgc(b); - if (c2) { - d = Edb(ED(pBc(c2, (Nyc(), vyc)))); - return $wnd.Math.max(0, d / 2 - 0.5); - } - return Pje; - } - function ffc(a, b) { - var c2, d, e; - if (JD(b.g, 10) && BD(b.g, 10).k == (j0b(), e0b)) { - return Pje; - } - e = ugc(b); - if (e) { - return $wnd.Math.max(0, a.b / 2 - 0.5); - } - c2 = tgc(b); - if (c2) { - d = Edb(ED(pBc(c2, (Nyc(), vyc)))); - return $wnd.Math.max(0, d / 2 - 0.5); - } - return Pje; - } - function xic(a) { - var b, c2, d, e, f2, g; - g = CHc(a.d, a.e); - for (f2 = g.Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 11); - d = a.e == (Ucd(), Tcd) ? e.e : e.g; - for (c2 = new olb(d); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 17); - if (!OZb(b) && b.c.i.c != b.d.i.c) { - tic(a, b); - ++a.f; - ++a.c; - } - } - } - } - function tpc(a, b) { - var c2, d; - if (b.dc()) { - return mmb(), mmb(), jmb; - } - d = new Rkb(); - Ekb(d, meb(Rie)); - for (c2 = 1; c2 < a.f; ++c2) { - a.a == null && Toc(a); - a.a[c2] && Ekb(d, meb(c2)); - } - if (d.c.length == 1) { - return mmb(), mmb(), jmb; - } - Ekb(d, meb(Ohe)); - return spc(b, d); - } - function MJc(a, b) { - var c2, d, e, f2, g, h, i3; - g = b.c.i.k != (j0b(), h0b); - i3 = g ? b.d : b.c; - c2 = MZb(b, i3).i; - e = BD(Ohb(a.k, i3), 121); - d = a.i[c2.p].a; - if (S_b(i3.i) < (!c2.c ? -1 : Jkb(c2.c.a, c2, 0))) { - f2 = e; - h = d; - } else { - f2 = d; - h = e; - } - AFb(DFb(CFb(EFb(BFb(new FFb(), 0), 4), f2), h)); - } - function oqd(a, b, c2) { - var d, e, f2, g, h, i3; - if (c2) { - e = c2.a.length; - d = new Yge(e); - for (h = (d.b - d.a) * d.c < 0 ? (Xge(), Wge) : new she(d); h.Ob(); ) { - g = BD(h.Pb(), 19); - i3 = Wqd(a, Vpd(tB(c2, g.a))); - if (i3) { - f2 = (!b.b && (b.b = new y5d(z2, b, 4, 7)), b.b); - wtd(f2, i3); - } - } - } - } - function pqd(a, b, c2) { - var d, e, f2, g, h, i3; - if (c2) { - e = c2.a.length; - d = new Yge(e); - for (h = (d.b - d.a) * d.c < 0 ? (Xge(), Wge) : new she(d); h.Ob(); ) { - g = BD(h.Pb(), 19); - i3 = Wqd(a, Vpd(tB(c2, g.a))); - if (i3) { - f2 = (!b.c && (b.c = new y5d(z2, b, 5, 8)), b.c); - wtd(f2, i3); - } - } - } - } - function po(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 qr(a) { - var b, c2, d; - b = a.Pb(); - if (!a.Ob()) { - return b; - } - d = Pfb(Qfb(new Ufb(), "expected one element but was: <"), b); - for (c2 = 0; c2 < 4 && a.Ob(); c2++) { - Pfb((d.a += She, d), a.Pb()); - } - a.Ob() && (d.a += ", ...", d); - d.a += ">"; - throw vbb(new Wdb(d.a)); - } - function lt(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 = BD(Thb(a.b, b.a), 283); - c2.a = 0; - ++a.c; - } else { - c2 = BD(Ohb(a.b, b.a), 283); - --c2.a; - !b.e ? c2.b = b.c : b.e.c = b.c; - !b.c ? c2.c = b.e : b.c.e = b.e; - } - --a.d; - } - function OA(a) { - var b, c2; - c2 = -a.a; - b = OC(GC(TD, 1), $ie, 25, 15, [43, 48, 48, 48, 48]); - if (c2 < 0) { - b[0] = 45; - c2 = -c2; - } - b[1] = b[1] + ((c2 / 60 | 0) / 10 | 0) & aje; - b[2] = b[2] + (c2 / 60 | 0) % 10 & aje; - b[3] = b[3] + (c2 % 60 / 10 | 0) & aje; - b[4] = b[4] + c2 % 10 & aje; - return zfb(b, 0, b.length); - } - function uRb(a, b, c2) { - var d, e; - d = b.d; - e = c2.d; - while (d.a - e.a == 0 && d.b - e.b == 0) { - d.a += Cub(a, 26) * ike + Cub(a, 27) * jke - 0.5; - d.b += Cub(a, 26) * ike + Cub(a, 27) * jke - 0.5; - e.a += Cub(a, 26) * ike + Cub(a, 27) * jke - 0.5; - e.b += Cub(a, 26) * ike + Cub(a, 27) * jke - 0.5; - } - } - function N_b(a) { - var b, c2, d, e; - a.g = new Rpb(BD(Qb(F1), 290)); - d = 0; - c2 = (Ucd(), Acd); - b = 0; - for (; b < a.j.c.length; b++) { - e = BD(Ikb(a.j, b), 11); - if (e.j != c2) { - d != b && Npb(a.g, c2, new vgd(meb(d), meb(b))); - c2 = e.j; - d = b; - } - } - Npb(a.g, c2, new vgd(meb(d), meb(b))); - } - function d4b(a) { - var b, c2, d, e, f2, g, h; - d = 0; - for (c2 = new olb(a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 29); - for (f2 = new olb(b.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 10); - e.p = d++; - for (h = new olb(e.j); h.a < h.c.c.length; ) { - g = BD(mlb(h), 11); - g.p = d++; - } - } - } - } - function qPc(a, b, c2, d, e) { - var f2, g, h, i3, j; - if (b) { - for (h = b.Kc(); h.Ob(); ) { - g = BD(h.Pb(), 10); - for (j = X_b(g, (KAc(), IAc), c2).Kc(); j.Ob(); ) { - i3 = BD(j.Pb(), 11); - f2 = BD(Wd(irb(e.f, i3)), 112); - if (!f2) { - f2 = new uOc(a.d); - d.c[d.c.length] = f2; - jOc(f2, i3, e); - } - } - } - } - } - function vid(a, b) { - var c2, d, e; - e = e1d((O6d(), M6d), a.Tg(), b); - if (e) { - Q6d(); - BD(e, 66).Oj() || (e = _1d(q1d(M6d, e))); - d = (c2 = a.Yg(e), BD(c2 >= 0 ? a._g(c2, true, true) : sid(a, e, true), 153)); - BD(d, 215).ol(b); - } else { - throw vbb(new Wdb(ite + b.ne() + jte)); - } - } - function ugb(a) { - var b, c2; - if (a > -140737488355328 && a < 140737488355328) { - if (a == 0) { - return 0; - } - b = a < 0; - b && (a = -a); - c2 = QD($wnd.Math.floor($wnd.Math.log(a) / 0.6931471805599453)); - (!b || a != $wnd.Math.pow(2, c2)) && ++c2; - return c2; - } - return vgb(Cbb(a)); - } - function QOc(a) { - var b, c2, d, e, f2, g, h; - f2 = new zsb(); - for (c2 = new olb(a); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 129); - 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 K5b(a, b) { - var c2, d, e; - d = new b0b(a); - tNb(d, b); - yNb(d, (wtc(), Gsc), b); - yNb(d, (Nyc(), Vxc), (dcd(), $bd)); - yNb(d, mwc, (F7c(), B7c)); - __b(d, (j0b(), e0b)); - c2 = new H0b(); - F0b(c2, d); - G0b(c2, (Ucd(), Tcd)); - e = new H0b(); - F0b(e, d); - G0b(e, zcd); - return d; - } - function Spc(a) { - switch (a.g) { - case 0: - return new fGc((rGc(), oGc)); - case 1: - return new CFc(); - case 2: - return new fHc(); - default: - throw vbb(new Wdb("No implementation is available for the crossing minimizer " + (a.f != null ? a.f : "" + a.g))); - } - } - function tDc(a, b) { - var c2, d, e, f2, g; - a.c[b.p] = true; - Ekb(a.a, b); - for (g = new olb(b.j); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 11); - for (d = new b1b(f2.b); llb(d.a) || llb(d.b); ) { - c2 = BD(llb(d.a) ? mlb(d.a) : mlb(d.b), 17); - e = uDc(f2, c2).i; - a.c[e.p] || tDc(a, e); - } - } - } - function _Uc(a) { - var b, c2, d, e, f2, g, h; - g = 0; - for (c2 = new Fyd((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a)); c2.e != c2.i.gc(); ) { - b = BD(Dyd(c2), 33); - h = b.g; - e = b.f; - d = $wnd.Math.sqrt(h * h + e * e); - g = $wnd.Math.max(d, g); - f2 = _Uc(b); - g = $wnd.Math.max(f2, g); - } - return g; - } - function rcd() { - rcd = ccb; - pcd = new scd("OUTSIDE", 0); - ncd = new scd("INSIDE", 1); - ocd = new scd("NEXT_TO_PORT_IF_POSSIBLE", 2); - mcd = new scd("ALWAYS_SAME_SIDE", 3); - lcd = new scd("ALWAYS_OTHER_SAME_SIDE", 4); - qcd = new scd("SPACE_EFFICIENT", 5); - } - function drd(a, b, c2) { - var d, e, f2, h, i3, j; - d = Tqd(a, (e = (Fhd(), f2 = new apd(), f2), !!c2 && $od(e, c2), e), b); - Lkd(d, _pd(b, Vte)); - grd(b, d); - brd(b, d); - hrd(b, d); - h = b; - i3 = Ypd(h, "ports"); - j = new Jrd(a, d); - Fqd(j.a, j.b, i3); - crd(a, b, d); - Zqd(a, b, d); - return d; - } - function NA(a) { - var b, c2; - c2 = -a.a; - b = OC(GC(TD, 1), $ie, 25, 15, [43, 48, 48, 58, 48, 48]); - if (c2 < 0) { - b[0] = 45; - c2 = -c2; - } - b[1] = b[1] + ((c2 / 60 | 0) / 10 | 0) & aje; - b[2] = b[2] + (c2 / 60 | 0) % 10 & aje; - b[4] = b[4] + (c2 % 60 / 10 | 0) & aje; - b[5] = b[5] + c2 % 10 & aje; - return zfb(b, 0, b.length); - } - function QA(a) { - var b; - b = OC(GC(TD, 1), $ie, 25, 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) & aje; - b[5] = b[5] + (a / 60 | 0) % 10 & aje; - b[7] = b[7] + (a % 60 / 10 | 0) & aje; - b[8] = b[8] + a % 10 & aje; - return zfb(b, 0, b.length); - } - function Vlb(a) { - var b, c2, d, e, f2; - if (a == null) { - return Xhe; - } - f2 = new xwb(She, "[", "]"); - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - !f2.a ? f2.a = new Wfb(f2.d) : Qfb(f2.a, f2.b); - Nfb(f2.a, "" + Ubb(b)); - } - return !f2.a ? f2.c : f2.e.length == 0 ? f2.a.a : f2.a.a + ("" + f2.e); - } - function DGb(a, b) { - var c2, d, e; - e = Ohe; - for (d = new olb(LFb(b)); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 213); - if (c2.f && !a.c[c2.c]) { - a.c[c2.c] = true; - e = $wnd.Math.min(e, DGb(a, xFb(c2, b))); - } - } - a.i[b.d] = a.j; - a.g[b.d] = $wnd.Math.min(e, a.j++); - return a.g[b.d]; - } - function EKb(a, b) { - var c2, d, e; - for (e = BD(BD(Qc(a.r, b), 21), 84).Kc(); e.Ob(); ) { - d = BD(e.Pb(), 111); - d.e.b = (c2 = d.b, c2.Xe((Y9c(), s9c)) ? c2.Hf() == (Ucd(), Acd) ? -c2.rf().b - Edb(ED(c2.We(s9c))) : Edb(ED(c2.We(s9c))) : c2.Hf() == (Ucd(), Acd) ? -c2.rf().b : 0); - } - } - function LPb(a) { - var b, c2, d, e, f2, g, h; - c2 = IOb(a.e); - f2 = Y6c(b7c(R6c(HOb(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++) { - JOb(a.e, new J6c(d, e, a.a, a.b)) && aNb(a, g, h, false, true); - d += a.a; - } - e += a.b; - } - } - function s2c(a) { - var b, c2, d; - if (Ccb(DD(hkd(a, (Y9c(), M8c))))) { - d = new Rkb(); - for (c2 = new Sr(ur(_sd(a).a.Kc(), new Sq())); Qr(c2); ) { - b = BD(Rr(c2), 79); - Qld(b) && Ccb(DD(hkd(b, N8c))) && (d.c[d.c.length] = b, true); - } - return d; - } else { - return mmb(), mmb(), jmb; - } - } - function Vpd(a) { - var b, c2; - c2 = false; - if (JD(a, 204)) { - c2 = true; - return BD(a, 204).a; - } - if (!c2) { - if (JD(a, 258)) { - b = BD(a, 258).a % 1 == 0; - if (b) { - c2 = true; - return meb(Idb(BD(a, 258).a)); - } - } - } - throw vbb(new cqd("Id must be a string or an integer: '" + a + "'.")); - } - function k0d(a, b) { - var c2, d, e, f2, g, h; - f2 = null; - for (e = new x0d((!a.a && (a.a = new z0d(a)), a.a)); u0d(e); ) { - c2 = BD(Vud(e), 56); - d = (g = c2.Tg(), h = (OKd(g), g.o), !h || !c2.mh(h) ? null : h6d(KJd(h), c2.ah(h))); - if (d != null) { - if (dfb(d, b)) { - f2 = c2; - break; - } - } - } - return f2; - } - function Bw(a, b, c2) { - var d, e, f2, g, h; - Xj(c2, "occurrences"); - if (c2 == 0) { - return h = BD(Hv(nd(a.a), b), 14), !h ? 0 : h.gc(); - } - g = BD(Hv(nd(a.a), b), 14); - 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 ax(a, b, c2) { - var d, e, f2, g; - Xj(c2, "oldCount"); - Xj(0, "newCount"); - d = BD(Hv(nd(a.a), b), 14); - if ((!d ? 0 : d.gc()) == c2) { - Xj(0, "count"); - e = (f2 = BD(Hv(nd(a.a), b), 14), !f2 ? 0 : f2.gc()); - g = -e; - g > 0 ? zh() : g < 0 && Bw(a, b, -g); - return true; - } else { - return false; - } - } - function fIb(a) { - var b, c2, d, e, f2, g, h; - h = 0; - if (a.b == 0) { - g = jIb(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 = Mtb(Zzb(OAb(JAb(Plb(a.a), new xIb()), new zIb()))); - } - return h > 0 ? h + a.n.d + a.n.a : 0; - } - function gIb(a) { - var b, c2, d, e, f2, g, h; - h = 0; - if (a.b == 0) { - h = Mtb(Zzb(OAb(JAb(Plb(a.a), new tIb()), new vIb()))); - } else { - g = kIb(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 MJb(a, b) { - var c2, d, e, f2; - f2 = BD(Mpb(a.b, b), 124); - c2 = f2.a; - for (e = BD(BD(Qc(a.r, b), 21), 84).Kc(); e.Ob(); ) { - d = BD(e.Pb(), 111); - !!d.c && (c2.a = $wnd.Math.max(c2.a, ZHb(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 NQb(a, b) { - var c2, d, e; - c2 = BD(vNb(b, (wSb(), oSb)), 19).a - BD(vNb(a, oSb), 19).a; - if (c2 == 0) { - d = c7c(R6c(BD(vNb(a, (HSb(), DSb)), 8)), BD(vNb(a, ESb), 8)); - e = c7c(R6c(BD(vNb(b, DSb), 8)), BD(vNb(b, ESb), 8)); - return Kdb(d.a * d.b, e.a * e.b); - } - return c2; - } - function iRc(a, b) { - var c2, d, e; - c2 = BD(vNb(b, (JTc(), ETc)), 19).a - BD(vNb(a, ETc), 19).a; - if (c2 == 0) { - d = c7c(R6c(BD(vNb(a, (mTc(), VSc)), 8)), BD(vNb(a, WSc), 8)); - e = c7c(R6c(BD(vNb(b, VSc), 8)), BD(vNb(b, WSc), 8)); - return Kdb(d.a * d.b, e.a * e.b); - } - return c2; - } - function TZb(a) { - var b, c2; - c2 = new Ufb(); - c2.a += "e_"; - b = KZb(a); - b != null && (c2.a += "" + b, c2); - if (!!a.c && !!a.d) { - Qfb((c2.a += " ", c2), C0b(a.c)); - Qfb(Pfb((c2.a += "[", c2), a.c.i), "]"); - Qfb((c2.a += gne, c2), C0b(a.d)); - Qfb(Pfb((c2.a += "[", c2), a.d.i), "]"); - } - return c2.a; - } - function zRc(a) { - switch (a.g) { - case 0: - return new lUc(); - case 1: - return new sUc(); - case 2: - return new CUc(); - case 3: - return new IUc(); - default: - throw vbb(new Wdb("No implementation is available for the layout phase " + (a.f != null ? a.f : "" + a.g))); - } - } - function mfd(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)); + case 16: + this.popState(); + return "acc_title_value"; break; - case 3: - f2 = $wnd.Math.max(0, -a.b - d); + case 17: + this.begin("acc_descr"); + return 35; break; - case 2: - f2 = $wnd.Math.max(0, -a.a - d); + case 18: + this.popState(); + return "acc_descr_value"; break; - case 4: - f2 = $wnd.Math.max(0, b.a + a.a - (c2.a + d)); - } - return f2; - } - function mqd(a, b, c2) { - var d, e, f2, g, h; - if (c2) { - e = c2.a.length; - d = new Yge(e); - for (h = (d.b - d.a) * d.c < 0 ? (Xge(), Wge) : new she(d); h.Ob(); ) { - g = BD(h.Pb(), 19); - f2 = Zpd(c2, g.a); - Lte in f2.a || Mte in f2.a ? $qd(a, f2, b) : erd(a, f2, b); - otd(BD(Ohb(a.b, Wpd(f2)), 79)); - } - } - } - function LJd(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 = wId(a); - if (!!b && (Q6d(), b.Cj() == Bve)) { - a.b = -1; - return true; - } else { - a.b = 1; - return false; - } - } - } - default: - case 1: { - return false; - } - } - } - function k1d(a, b) { - var c2, d, e, f2, g; - d = (!b.s && (b.s = new cUd(t5, b, 21, 17)), b.s); - f2 = null; - for (e = 0, g = d.i; e < g; ++e) { - c2 = BD(qud(d, e), 170); - switch ($1d(q1d(a, c2))) { - case 2: - case 3: { - !f2 && (f2 = new Rkb()); - f2.c[f2.c.length] = c2; - } - } - } - return !f2 ? (mmb(), mmb(), jmb) : f2; - } - function tde(a, b) { - var c2, d, e, f2; - nde(a); - if (a.c != 0 || a.a != 123) - throw vbb(new mde(tvd((h0d(), Fue)))); - f2 = b == 112; - d = a.d; - c2 = gfb(a.i, 125, d); - if (c2 < 0) - throw vbb(new mde(tvd((h0d(), Gue)))); - e = qfb(a.i, d, c2); - a.d = c2 + 1; - return Lfe(e, f2, (a.e & 512) == 512); - } - function QTb(a) { - var b; - b = BD(vNb(a, (Nyc(), Iwc)), 314); - if (b == (Rpc(), Ppc)) { - throw vbb(new z2c("The hierarchy aware processor " + b + " in child node " + a + " is only allowed if the root node specifies the same hierarchical processor.")); - } - } - function dhc(a, b) { - Hgc(); - var c2, d, e, f2, g, h; - c2 = null; - for (g = b.Kc(); g.Ob(); ) { - f2 = BD(g.Pb(), 128); - if (f2.o) { - continue; - } - d = F6c(f2.a); - e = C6c(f2.a); - h = new hic(d, e, null, BD(f2.d.a.ec().Kc().Pb(), 17)); - Ekb(h.c, f2.a); - a.c[a.c.length] = h; - !!c2 && Ekb(c2.d, h); - c2 = h; - } - } - function hKd(a, b) { - var c2, d, e; - if (!b) { - jKd(a, null); - _Jd(a, null); - } else if ((b.i & 4) != 0) { - d = "[]"; - for (c2 = b.c; ; c2 = c2.c) { - if ((c2.i & 4) == 0) { - e = jfb((fdb(c2), c2.o + d)); - jKd(a, e); - _Jd(a, e); - break; - } - d += "[]"; - } - } else { - e = jfb((fdb(b), b.o)); - jKd(a, e); - _Jd(a, e); - } - a.yk(b); - } - function b3d(a, b, c2, d, e) { - var f2, g, h, i3; - i3 = a3d(a, BD(e, 56)); - if (PD(i3) !== PD(e)) { - h = BD(a.g[c2], 72); - f2 = R6d(b, i3); - mud(a, c2, t3d(a, c2, f2)); - if (oid(a.e)) { - g = H2d(a, 9, f2.ak(), e, i3, d, false); - Qwd(g, new pSd(a.e, 9, a.c, h, f2, d, false)); - Rwd(g); - } - return i3; - } - return e; - } - function xCc(a, b, c2) { - var d, e, f2, g, h, i3; - d = BD(Qc(a.c, b), 15); - e = BD(Qc(a.c, c2), 15); - f2 = d.Zc(d.gc()); - g = e.Zc(e.gc()); - while (f2.Sb() && g.Sb()) { - h = BD(f2.Ub(), 19); - i3 = BD(g.Ub(), 19); - if (h != i3) { - return beb(h.a, i3.a); - } - } - return !f2.Ob() && !g.Ob() ? 0 : f2.Ob() ? 1 : -1; - } - function m5c(c2, d) { - var e, f2, g; - try { - g = fs(c2.a, d); - return g; - } catch (b) { - b = ubb(b); - if (JD(b, 32)) { - try { - f2 = Icb(d, Rie, Ohe); - e = gdb(c2.a); - if (f2 >= 0 && f2 < e.length) { - return e[f2]; - } - } catch (a) { - a = ubb(a); - if (!JD(a, 127)) - throw vbb(a); - } - return null; - } else - throw vbb(b); - } - } - function tid(a, b) { - var c2, d, e; - e = e1d((O6d(), M6d), a.Tg(), b); - if (e) { - Q6d(); - BD(e, 66).Oj() || (e = _1d(q1d(M6d, e))); - d = (c2 = a.Yg(e), BD(c2 >= 0 ? a._g(c2, true, true) : sid(a, e, true), 153)); - return BD(d, 215).ll(b); - } else { - throw vbb(new Wdb(ite + b.ne() + lte)); - } - } - function BZd() { - tZd(); - var a; - if (sZd) - return BD(nUd((yFd(), xFd), _ve), 1939); - rEd(CK, new J_d()); - CZd(); - a = BD(JD(Phb((yFd(), xFd), _ve), 547) ? Phb(xFd, _ve) : new AZd(), 547); - sZd = true; - yZd(a); - zZd(a); - Rhb((JFd(), IFd), a, new EZd()); - Shb(xFd, _ve, a); - return a; - } - function v2d(a, b) { - var c2, d, e, f2; - a.j = -1; - if (oid(a.e)) { - c2 = a.i; - f2 = a.i != 0; - lud(a, b); - d = new pSd(a.e, 3, a.c, null, b, c2, f2); - e = b.Qk(a.e, a.c, null); - e = h3d(a, b, e); - if (!e) { - Uhd(a.e, d); - } else { - e.Ei(d); - e.Fi(); - } - } else { - lud(a, b); - e = b.Qk(a.e, a.c, null); - !!e && e.Fi(); - } - } - function rA(a, b) { - var c2, d, e; - e = 0; - d = b[0]; - if (d >= a.length) { - return -1; - } - c2 = (BCb(d, a.length), a.charCodeAt(d)); - while (c2 >= 48 && c2 <= 57) { - e = e * 10 + (c2 - 48); - ++d; - if (d >= a.length) { - break; - } - c2 = (BCb(d, a.length), a.charCodeAt(d)); - } - d > b[0] ? b[0] = d : e = -1; - return e; - } - function vMb(a) { - var b, c2, d, e, f2; - e = BD(a.a, 19).a; - f2 = BD(a.b, 19).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 vgd(meb(c2), meb(d)); - } - function fNb(a, b, c2, d) { - var e, f2, g, h, i3, 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 ((i3 = f2, j = h, i3 += a.j, j += a.k, i3 >= 0 && j >= 0 && i3 < a.o && j < a.p) && (!ZMb(b, e, g) && hNb(a, f2, h) || YMb(b, e, g) && !iNb(a, f2, h))) { - return true; - } - } - } - return false; - } - function LNc(a, b, c2) { - var d, e, f2, g, h; - g = a.c; - h = a.d; - f2 = l7c(OC(GC(m1, 1), nie, 8, 0, [g.i.n, g.n, g.a])).b; - e = (f2 + l7c(OC(GC(m1, 1), nie, 8, 0, [h.i.n, h.n, h.a])).b) / 2; - d = null; - g.j == (Ucd(), zcd) ? d = new f7c(b + g.i.c.c.a + c2, e) : d = new f7c(b - c2, e); - St(a.a, 0, d); - } - function Qld(a) { - var b, c2, d, e; - b = null; - for (d = ul(pl(OC(GC(KI, 1), Uhe, 20, 0, [(!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b), (!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c)]))); Qr(d); ) { - c2 = BD(Rr(d), 82); - e = atd(c2); - if (!b) { - b = e; - } else if (b != e) { - return false; - } - } - return true; - } - function sud(a, b, c2) { - var d; - ++a.j; - if (b >= a.i) - throw vbb(new qcb(lue + b + mue + a.i)); - if (c2 >= a.i) - throw vbb(new qcb(nue + c2 + mue + a.i)); - d = a.g[c2]; - if (b != c2) { - b < c2 ? $fb(a.g, b, a.g, b + 1, c2 - b) : $fb(a.g, c2 + 1, a.g, c2, b - c2); - NC(a.g, b, d); - a.ei(b, d, c2); - a.ci(); - } - return d; - } - function Rc(a, b, c2) { - var d; - d = BD(a.c.xc(b), 14); - if (!d) { - d = a.ic(b); - if (d.Fc(c2)) { - ++a.d; - a.c.zc(b, d); - return true; - } else { - throw vbb(new ycb("New Collection violated the Collection spec")); - } - } else if (d.Fc(c2)) { - ++a.d; - return true; - } else { - return false; - } - } - function heb(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 - Rje; - b = d >> 16 & 4; - c2 += b; - a <<= b; - d = a - oie; - b = d >> 16 & 2; - c2 += b; - a <<= b; - d = a >> 14; - b = d & ~(d >> 1); - return c2 + 2 - b; - } - } - function $Pb(a) { - QPb(); - var b, c2, d, e; - PPb = new Rkb(); - OPb = new Lqb(); - NPb = new Rkb(); - b = (!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a); - SPb(b); - for (e = new Fyd(b); e.e != e.i.gc(); ) { - d = BD(Dyd(e), 33); - if (Jkb(PPb, d, 0) == -1) { - c2 = new Rkb(); - Ekb(NPb, c2); - TPb(d, c2); - } - } - return NPb; - } - function BQb(a, b, c2) { - var d, e, f2, g; - a.a = c2.b.d; - if (JD(b, 352)) { - e = itd(BD(b, 79), false, false); - f2 = ofd(e); - d = new FQb(a); - reb(f2, d); - ifd(f2, e); - b.We((Y9c(), Q8c)) != null && reb(BD(b.We(Q8c), 74), d); - } else { - g = BD(b, 470); - g.Hg(g.Dg() + a.a.a); - g.Ig(g.Eg() + a.a.b); - } - } - function _5b(a, b) { - var c2, d, e, f2, g, h, i3, j; - j = Edb(ED(vNb(b, (Nyc(), zyc)))); - i3 = 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 - i3; - f2 < 0 && (d.a -= f2); - g = b.f; - g.a = $wnd.Math.max(g.a, d.a + e.a); - i3 = d.a + e.a + c2.c + j; - } - } - function D$c(a, b) { - var c2, d, e, f2, g, h; - d = BD(BD(Ohb(a.g, b.a), 46).a, 65); - e = BD(BD(Ohb(a.g, b.b), 46).a, 65); - f2 = d.b; - g = e.b; - c2 = z6c(f2, g); - if (c2 >= 0) { - return c2; - } - h = U6c(c7c(new f7c(g.c + g.b / 2, g.d + g.a / 2), new f7c(f2.c + f2.b / 2, f2.d + f2.a / 2))); - return -(xOb(f2, g) - 1) * h; - } - function ufd(a, b, c2) { - var d; - MAb(new YAb(null, (!c2.a && (c2.a = new cUd(A2, c2, 6, 6)), new Kub(c2.a, 16))), new Mfd(a, b)); - MAb(new YAb(null, (!c2.n && (c2.n = new cUd(D2, c2, 1, 7)), new Kub(c2.n, 16))), new Ofd(a, b)); - d = BD(hkd(c2, (Y9c(), Q8c)), 74); - !!d && p7c(d, a, b); - } - function sid(a, b, c2) { - var d, e, f2; - f2 = e1d((O6d(), M6d), a.Tg(), b); - if (f2) { - Q6d(); - BD(f2, 66).Oj() || (f2 = _1d(q1d(M6d, f2))); - e = (d = a.Yg(f2), BD(d >= 0 ? a._g(d, true, true) : sid(a, f2, true), 153)); - return BD(e, 215).hl(b, c2); - } else { - throw vbb(new Wdb(ite + b.ne() + lte)); - } - } - function wAd(a, b, c2, d) { - var e, f2, g, h, i3; - e = a.d[b]; - if (e) { - f2 = e.g; - i3 = e.i; - if (d != null) { - for (h = 0; h < i3; ++h) { - g = BD(f2[h], 133); - if (g.Sh() == c2 && pb(d, g.cd())) { - return g; - } - } - } else { - for (h = 0; h < i3; ++h) { - g = BD(f2[h], 133); - if (PD(g.cd()) === PD(d)) { - return g; - } - } - } - } - return null; - } - function Pgb(a, b) { - var c2; - if (b < 0) { - throw vbb(new ocb("Negative exponent")); - } - if (b == 0) { - return Cgb; - } else if (b == 1 || Kgb(a, Cgb) || Kgb(a, Ggb)) { - return a; - } - if (!Sgb(a, 0)) { - c2 = 1; - while (!Sgb(a, c2)) { - ++c2; - } - return Ogb(bhb(c2 * b), Pgb(Rgb2(a, c2), b)); - } - return Jhb(a, b); - } - function xlb(a, b) { - var c2, d, e; - if (PD(a) === PD(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 (!(PD(d) === PD(e) || d != null && pb(d, e))) { - return false; - } - } - return true; - } - function CVb(a) { - nVb(); - var b, c2, d; - this.b = mVb; - this.c = (ead(), cad); - this.f = (iVb(), hVb); - this.a = a; - zVb(this, new DVb()); - sVb(this); - for (d = new olb(a.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 81); - if (!c2.d) { - b = new gVb(OC(GC(IP, 1), Uhe, 81, 0, [c2])); - Ekb(a.a, b); - } - } - } - function D3b(a, b, c2) { - var d, e, f2, g, h, i3; - if (!a || a.c.length == 0) { - return null; - } - f2 = new cIb(b, !c2); - for (e = new olb(a); e.a < e.c.c.length; ) { - d = BD(mlb(e), 70); - UHb(f2, (a$b(), new v$b(d))); - } - g = f2.i; - g.a = (i3 = f2.n, f2.e.b + i3.d + i3.a); - g.b = (h = f2.n, f2.e.a + h.b + h.c); - return f2; - } - function O5b(a) { - var b, c2, d, e, f2, g, h; - h = l_b(a.a); - Nlb(h, new T5b()); - c2 = null; - for (e = h, f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - if (d.k != (j0b(), e0b)) { + case 19: + this.begin("acc_descr_multiline"); break; - } - b = BD(vNb(d, (wtc(), Hsc)), 61); - if (b != (Ucd(), Tcd) && b != zcd) { - continue; - } - !!c2 && BD(vNb(c2, Qsc), 15).Fc(d); - c2 = d; - } - } - function YOc(a, b, c2) { - var d, e, f2, g, h, i3, j; - i3 = (tCb(b, a.c.length), BD(a.c[b], 329)); - Kkb(a, b); - if (i3.b / 2 >= c2) { - d = b; - j = (i3.c + i3.a) / 2; - g = j - c2; - if (i3.c <= j - c2) { - e = new bPc(i3.c, g); - Dkb(a, d++, e); - } - h = j + c2; - if (h <= i3.a) { - f2 = new bPc(h, i3.a); - wCb(d, a.c.length); - aCb(a.c, d, f2); - } - } - } - function u0d(a) { - var b; - if (!a.c && a.g == null) { - a.d = a.si(a.f); - wtd(a, a.d); - b = a.d; - } else { - if (a.g == null) { - return true; - } else if (a.i == 0) { - return false; - } else { - b = BD(a.g[a.i - 1], 47); - } - } - if (b == a.b && null.km >= null.jm()) { - Vud(a); - return u0d(a); - } else { - return b.Ob(); - } - } - function KTb(a, b, c2) { - var d, e, f2, g, h; - h = c2; - !h && (h = Ydd(new Zdd(), 0)); - Odd(h, Vme, 1); - aUb(a.c, b); - g = EYb(a.a, b); - if (g.gc() == 1) { - MTb(BD(g.Xb(0), 37), h); - } else { - f2 = 1 / g.gc(); - for (e = g.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 37); - MTb(d, Udd(h, f2)); - } - } - CYb(a.a, g, b); - NTb(b); - Qdd(h); - } - function qYb(a) { - this.a = a; - if (a.c.i.k == (j0b(), e0b)) { - this.c = a.c; - this.d = BD(vNb(a.c.i, (wtc(), Hsc)), 61); - } else if (a.d.i.k == e0b) { - this.c = a.d; - this.d = BD(vNb(a.d.i, (wtc(), Hsc)), 61); - } else { - throw vbb(new Wdb("Edge " + a + " is not an external edge.")); - } - } - function oQd(a, b) { - var c2, d, e; - e = a.b; - a.b = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 3, e, a.b)); - if (!b) { - pnd(a, null); - qQd(a, 0); - pQd(a, null); - } else if (b != a) { - pnd(a, b.zb); - qQd(a, b.d); - c2 = (d = b.c, d == null ? b.zb : d); - pQd(a, c2 == null || dfb(c2, b.zb) ? null : c2); - } - } - function NRd(a) { - var b, c2; - if (a.f) { - while (a.n < a.o) { - b = BD(!a.j ? a.k.Xb(a.n) : a.j.pi(a.n), 72); - c2 = b.ak(); - if (JD(c2, 99) && (BD(c2, 18).Bb & ote) != 0 && (!a.e || c2.Gj() != x2 || c2.aj() != 0) && b.dd() != null) { - return true; - } else { - ++a.n; - } - } - return false; - } else { - return a.n < a.o; - } - } - function _i(a, b) { - var c2; - this.e = (im(), Qb(a), im(), nm(a)); - this.c = (Qb(b), nm(b)); - Lb(this.e.Hd().dc() == this.c.Hd().dc()); - this.d = Ev(this.e); - this.b = Ev(this.c); - c2 = IC(SI, [nie, Uhe], [5, 1], 5, [this.e.Hd().gc(), this.c.Hd().gc()], 2); - this.a = c2; - Ri(this); - } - function vz(b) { - !tz && (tz = wz()), tz; - 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 uz(a); - }); - return '"' + d + '"'; - } - function cEb(a) { - ODb(); - var b, c2; - this.b = LDb; - this.c = NDb; - this.g = (FDb(), EDb); - this.d = (ead(), cad); - this.a = a; - RDb(this); - for (c2 = new olb(a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 57); - !b.a && pDb(rDb(new sDb(), OC(GC(PM, 1), Uhe, 57, 0, [b])), a); - b.e = new K6c(b.d); - } - } - function HQb(a) { - var b, c2, d, e, f2, g; - e = a.e.c.length; - d = KC(yK, eme, 15, e, 0, 1); - for (g = new olb(a.e); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 144); - d[f2.b] = new Psb(); - } - for (c2 = new olb(a.c); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 282); - d[b.c.b].Fc(b); - d[b.d.b].Fc(b); - } - return d; - } - function fDc(a) { - var b, c2, d, e, f2, g, h; - h = Pu(a.c.length); - for (e = new olb(a); e.a < e.c.c.length; ) { - d = BD(mlb(e), 10); - g = new Tqb(); - f2 = U_b(d); - for (c2 = new Sr(ur(f2.a.Kc(), new Sq())); Qr(c2); ) { - b = BD(Rr(c2), 17); - b.c.i == b.d.i || Qqb(g, b.d.i); - } - h.c[h.c.length] = g; - } - return h; - } - function ozd(a, b) { - var c2, d, e, f2, g; - c2 = BD(Ajd(a.a, 4), 126); - g = c2 == null ? 0 : c2.length; - if (b >= g) - throw vbb(new Cyd(b, g)); - e = c2[b]; - if (g == 1) { - d = null; - } else { - d = KC($3, hve, 415, g - 1, 0, 1); - $fb(c2, 0, d, 0, b); - f2 = g - b - 1; - f2 > 0 && $fb(c2, b + 1, d, b, f2); - } - b0d(a, d); - a0d(a, b, e); - return e; - } - function m8d() { - m8d = ccb; - k8d = BD(qud(ZKd((r8d(), q8d).qb), 6), 34); - h8d = BD(qud(ZKd(q8d.qb), 3), 34); - i8d = BD(qud(ZKd(q8d.qb), 4), 34); - j8d = BD(qud(ZKd(q8d.qb), 5), 18); - XId(k8d); - XId(h8d); - XId(i8d); - XId(j8d); - l8d = new amb(OC(GC(t5, 1), Mve, 170, 0, [k8d, h8d])); - } - function AJb(a, b) { - var c2; - this.d = new H_b(); - this.b = b; - this.e = new g7c(b.qf()); - c2 = a.u.Hc((rcd(), ocd)); - a.u.Hc(ncd) ? a.D ? this.a = c2 && !b.If() : this.a = true : a.u.Hc(pcd) ? c2 ? this.a = !(b.zf().Kc().Ob() || b.Bf().Kc().Ob()) : this.a = false : this.a = false; - } - function IKb(a, b) { - var c2, d, e, f2; - c2 = a.o.a; - for (f2 = BD(BD(Qc(a.r, b), 21), 84).Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 111); - e.e.a = (d = e.b, d.Xe((Y9c(), s9c)) ? d.Hf() == (Ucd(), Tcd) ? -d.rf().a - Edb(ED(d.We(s9c))) : c2 + Edb(ED(d.We(s9c))) : d.Hf() == (Ucd(), Tcd) ? -d.rf().a : c2); - } - } - function Q1b(a, b) { - var c2, d, e, f2; - c2 = BD(vNb(a, (Nyc(), Lwc)), 103); - f2 = BD(hkd(b, $xc), 61); - e = BD(vNb(a, Vxc), 98); - if (e != (dcd(), bcd) && e != ccd) { - if (f2 == (Ucd(), Scd)) { - f2 = lfd(b, c2); - f2 == Scd && (f2 = Zcd(c2)); - } - } else { - d = M1b(b); - d > 0 ? f2 = Zcd(c2) : f2 = Wcd(Zcd(c2)); - } - jkd(b, $xc, f2); - } - function olc(a, b) { - var c2, d, e, f2, g; - g = a.j; - b.a != b.b && Okb(g, new Ulc()); - e = g.c.length / 2 | 0; - for (d = 0; d < e; d++) { - f2 = (tCb(d, g.c.length), BD(g.c[d], 113)); - f2.c && G0b(f2.d, b.a); - } - for (c2 = e; c2 < g.c.length; c2++) { - f2 = (tCb(c2, g.c.length), BD(g.c[c2], 113)); - f2.c && G0b(f2.d, b.b); - } - } - function TGc(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 = Ddb(d.a, e.a); - f2 < 0 ? WGc(a, b, c2) : f2 > 0 && WGc(a, c2, b); - return f2; - } else if (d.a != null) { - WGc(a, b, c2); - return -1; - } else if (e.a != null) { - WGc(a, c2, b); - return 1; - } - return 0; - } - function swd(a, b) { - var c2, d, e, f2; - if (a.ej()) { - c2 = a.Vi(); - f2 = a.fj(); - ++a.j; - a.Hi(c2, a.oi(c2, b)); - d = a.Zi(3, null, b, c2, f2); - if (a.bj()) { - e = a.cj(b, null); - if (!e) { - a.$i(d); - } else { - e.Ei(d); - e.Fi(); - } - } else { - a.$i(d); - } - } else { - Bvd(a, b); - if (a.bj()) { - e = a.cj(b, null); - !!e && e.Fi(); - } - } - } - function D2d(a, b) { - var c2, d, e, f2, g; - g = S6d(a.e.Tg(), b); - e = new yud(); - c2 = BD(a.g, 119); - for (f2 = a.i; --f2 >= 0; ) { - d = c2[f2]; - g.rl(d.ak()) && wtd(e, d); - } - !Yxd(a, e) && oid(a.e) && GLd(a, b.$j() ? H2d(a, 6, b, (mmb(), jmb), null, -1, false) : H2d(a, b.Kj() ? 2 : 1, b, null, null, -1, false)); - } - function Dhb() { - Dhb = ccb; - var a, b; - Bhb = KC(cJ, nie, 91, 32, 0, 1); - Chb = KC(cJ, nie, 91, 32, 0, 1); - a = 1; - for (b = 0; b <= 18; b++) { - Bhb[b] = ghb(a); - Chb[b] = ghb(Nbb(a, b)); - a = Ibb(a, 5); - } - for (; b < Chb.length; b++) { - Bhb[b] = Ogb(Bhb[b - 1], Bhb[1]); - Chb[b] = Ogb(Chb[b - 1], (Hgb(), Egb)); - } - } - function K4b(a, b) { - var c2, d, e, f2, g; - if (a.a == (yrc(), wrc)) { - 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 wcc(a, b) { - var c2; - Odd(b, "Partition preprocessing", 1); - c2 = BD(GAb(JAb(LAb(JAb(new YAb(null, new Kub(a.a, 16)), new Acc()), new Ccc()), new Ecc()), Byb(new fzb(), new dzb(), new Ezb(), OC(GC(xL, 1), Kie, 132, 0, [(Fyb(), Dyb)]))), 15); - MAb(c2.Oc(), new Gcc()); - Qdd(b); - } - function DMc(a) { - wMc(); - var b, c2, d, e, f2, g, h; - c2 = new $rb(); - for (e = new olb(a.e.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 29); - for (g = new olb(d.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 10); - h = a.g[f2.p]; - b = BD(Wrb(c2, h), 15); - if (!b) { - b = new Rkb(); - Xrb(c2, h, b); - } - b.Fc(f2); - } - } - return c2; - } - function dRc(a, b) { - var c2, d, e, f2, g; - e = b.b.b; - a.a = KC(yK, eme, 15, e, 0, 1); - a.b = KC(sbb, dle, 25, e, 16, 1); - for (g = Jsb(b.b, 0); g.b != g.d.c; ) { - f2 = BD(Xsb(g), 86); - a.a[f2.g] = new Psb(); - } - for (d = Jsb(b.a, 0); d.b != d.d.c; ) { - c2 = BD(Xsb(d), 188); - a.a[c2.b.g].Fc(c2); - a.a[c2.c.g].Fc(c2); - } - } - function qmd(a) { - var b; - if ((a.Db & 64) != 0) - return Eid(a); - b = new Jfb(Eid(a)); - b.a += " (startX: "; - Bfb(b, a.j); - b.a += ", startY: "; - Bfb(b, a.k); - b.a += ", endX: "; - Bfb(b, a.b); - b.a += ", endY: "; - Bfb(b, a.c); - b.a += ", identifier: "; - Efb(b, a.d); - b.a += ")"; - return b.a; - } - function EId(a) { - var b; - if ((a.Db & 64) != 0) - return qnd(a); - b = new Jfb(qnd(a)); - b.a += " (ordered: "; - Ffb(b, (a.Bb & 256) != 0); - b.a += ", unique: "; - Ffb(b, (a.Bb & 512) != 0); - b.a += ", lowerBound: "; - Cfb(b, a.s); - b.a += ", upperBound: "; - Cfb(b, a.t); - b.a += ")"; - return b.a; - } - function Wnd(a, b, c2, d, e, f2, g, h) { - var i3; - JD(a.Cb, 88) && XMd($Kd(BD(a.Cb, 88)), 4); - pnd(a, c2); - a.f = d; - dJd(a, e); - fJd(a, f2); - ZId(a, g); - eJd(a, false); - CId(a, true); - aJd(a, h); - BId(a, true); - AId(a, 0); - a.b = 0; - DId(a, 1); - i3 = xId(a, b, null); - !!i3 && i3.Fi(); - MJd(a, false); - return a; - } - function fyb(a, b) { - var c2, d, e, f2; - c2 = BD(Phb(a.a, b), 512); - if (!c2) { - d = new wyb(b); - e = (oyb(), lyb) ? null : d.c; - f2 = qfb(e, 0, $wnd.Math.max(0, kfb(e, wfb(46)))); - vyb(d, fyb(a, f2)); - (lyb ? null : d.c).length == 0 && qyb(d, new zyb()); - Shb(a.a, lyb ? null : d.c, d); - return d; - } - return c2; - } - function BOb(a, b) { - var c2; - a.b = b; - a.g = new Rkb(); - c2 = COb(a.b); - a.e = c2; - a.f = c2; - a.c = Ccb(DD(vNb(a.b, (fFb(), $Eb)))); - a.a = ED(vNb(a.b, (Y9c(), r8c))); - a.a == null && (a.a = 1); - Edb(a.a) > 1 ? a.e *= Edb(a.a) : a.f /= Edb(a.a); - DOb(a); - EOb(a); - AOb(a); - yNb(a.b, (CPb(), uPb), a.g); - } - function Y5b(a, b, c2) { - var d, e, f2, g, h, i3; - d = 0; - i3 = c2; - if (!b) { - d = c2 * (a.c.length - 1); - i3 *= -1; - } - for (f2 = new olb(a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 10); - yNb(e, (Nyc(), mwc), (F7c(), B7c)); - e.o.a = d; - for (h = Y_b(e, (Ucd(), zcd)).Kc(); h.Ob(); ) { - g = BD(h.Pb(), 11); - g.n.a = d; - } - d += i3; - } - } - function Qxd(a, b, c2) { - var d, e, f2; - if (a.ej()) { - f2 = a.fj(); - kud(a, b, c2); - d = a.Zi(3, null, c2, b, f2); - if (a.bj()) { - e = a.cj(c2, null); - a.ij() && (e = a.jj(c2, e)); - if (!e) { - a.$i(d); - } else { - e.Ei(d); - e.Fi(); - } - } else { - a.$i(d); - } - } else { - kud(a, b, c2); - if (a.bj()) { - e = a.cj(c2, null); - !!e && e.Fi(); - } - } - } - function ILd(a, b, c2) { - var d, e, f2, g, h, i3; - h = a.Gk(c2); - if (h != c2) { - g = a.g[b]; - i3 = h; - mud(a, b, a.oi(b, i3)); - f2 = g; - a.gi(b, i3, f2); - if (a.rk()) { - d = c2; - e = a.dj(d, null); - !BD(h, 49).eh() && (e = a.cj(i3, e)); - !!e && e.Fi(); - } - oid(a.e) && GLd(a, a.Zi(9, c2, h, b, false)); - return h; - } else { - return c2; - } - } - function pVb(a, b) { - var c2, d, e, f2; - for (d = new olb(a.a.a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 189); - c2.g = true; - } - for (f2 = new olb(a.a.b); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 81); - e.k = Ccb(DD(a.e.Kb(new vgd(e, b)))); - e.d.g = e.d.g & Ccb(DD(a.e.Kb(new vgd(e, b)))); - } - return a; - } - function pkc(a) { - var b, c2, d, e, f2; - c2 = (b = BD(gdb(F1), 9), new xqb(b, BD(_Bb(b, b.length), 9), 0)); - f2 = BD(vNb(a, (wtc(), gtc)), 10); - if (f2) { - for (e = new olb(f2.j); e.a < e.c.c.length; ) { - d = BD(mlb(e), 11); - PD(vNb(d, $sc)) === PD(a) && a1b(new b1b(d.b)) && rqb(c2, d.j); - } - } - return c2; - } - function zCc(a, b, c2) { - var d, e, f2, g, h; - if (a.d[c2.p]) { - return; - } - for (e = new Sr(ur(U_b(c2).a.Kc(), new Sq())); Qr(e); ) { - d = BD(Rr(e), 17); - h = d.d.i; - for (g = new Sr(ur(R_b(h).a.Kc(), new Sq())); Qr(g); ) { - f2 = BD(Rr(g), 17); - f2.c.i == b && (a.a[f2.p] = true); - } - zCc(a, b, h); - } - a.d[c2.p] = true; - } - function Bjd(a, b) { - var c2, d, e, f2, g, h, i3; - d = aeb(a.Db & 254); - if (d == 1) { - a.Eb = null; - } else { - f2 = CD(a.Eb); - if (d == 2) { - e = zjd(a, b); - a.Eb = f2[e == 0 ? 1 : 0]; - } else { - g = KC(SI, Uhe, 1, d - 1, 5, 1); - for (c2 = 2, h = 0, i3 = 0; c2 <= 128; c2 <<= 1) { - c2 == b ? ++h : (a.Db & c2) != 0 && (g[i3++] = f2[h++]); - } - a.Eb = g; - } - } - a.Db &= ~b; - } - function n1d(a, b) { - var c2, d, e, f2, g; - d = (!b.s && (b.s = new cUd(t5, b, 21, 17)), b.s); - f2 = null; - for (e = 0, g = d.i; e < g; ++e) { - c2 = BD(qud(d, e), 170); - switch ($1d(q1d(a, c2))) { - case 4: - case 5: - case 6: { - !f2 && (f2 = new Rkb()); - f2.c[f2.c.length] = c2; - break; - } - } - } - return !f2 ? (mmb(), mmb(), jmb) : f2; - } - function Uee(a) { - var b; - b = 0; - switch (a) { - case 105: - b = 2; + case 20: + this.popState(); break; - case 109: - b = 8; + 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 115: - b = 4; + case 66: + this.popState(); + yy_.yytext = yy_.yytext.substr(2).trim(); + return 31; break; - case 120: - b = 16; + case 67: + this.popState(); + yy_.yytext = yy_.yytext.slice(0, -8).trim(); + return 31; break; - case 117: - b = 32; + case 68: + return 6; break; - case 119: - b = 64; + case 69: + return 6; break; case 70: - b = 256; + return 16; + break; + case 71: + return 54; break; case 72: - b = 128; + return 24; break; - case 88: - b = 512; + 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; - case 44: - b = zte; - } - return b; - } - function Ghb(a, b, c2, d, e) { - var f2, g, h, i3; - if (PD(a) === PD(b) && d == e) { - Lhb(a, d, c2); - return; - } - for (h = 0; h < d; h++) { - g = 0; - f2 = a[h]; - for (i3 = 0; i3 < e; i3++) { - g = wbb(wbb(Ibb(xbb(f2, Yje), xbb(b[i3], Yje)), xbb(c2[h + i3], Yje)), xbb(Tbb(g), Yje)); - c2[h + i3] = Tbb(g); - g = Pbb(g, 32); - } - c2[h + e] = Tbb(g); - } - } - function COb(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l; - k = 0; - j = 0; - e = a.a; - h = e.a.gc(); - for (d = e.a.ec().Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 561); - b = (c2.b && LOb(c2), c2.a); - l = b.a; - g = b.b; - k += l + g; - j += l * g; - } - i3 = $wnd.Math.sqrt(400 * h * j - 4 * j + k * k) + k; - f2 = 2 * (100 * h - 1); - if (f2 == 0) { - return i3; - } - return i3 / f2; - } - function mOc(a, b) { - if (b.b != 0) { - isNaN(a.s) ? a.s = Edb((sCb(b.b != 0), ED(b.a.a.c))) : a.s = $wnd.Math.min(a.s, Edb((sCb(b.b != 0), ED(b.a.a.c)))); - isNaN(a.c) ? a.c = Edb((sCb(b.b != 0), ED(b.c.b.c))) : a.c = $wnd.Math.max(a.c, Edb((sCb(b.b != 0), ED(b.c.b.c)))); } - } - function Pld(a) { - var b, c2, d, e; - b = null; - for (d = ul(pl(OC(GC(KI, 1), Uhe, 20, 0, [(!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b), (!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c)]))); Qr(d); ) { - c2 = BD(Rr(d), 82); - e = atd(c2); - if (!b) { - b = Xod(e); - } else if (b != Xod(e)) { - return true; - } + }, "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; + }(); + parser22.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser22; + parser22.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 = "", counter2 = 0, type3 = "", typeSpacer = DOMID_TYPE_SPACER) { + const typeStr = type3 !== null && type3.length > 0 ? `${typeSpacer}${type3}` : ""; + return `${DOMID_STATE}-${itemId}${typeStr}-${counter2}`; + } + function insertOrUpdateNode(nodes6, nodeData2, classes6) { + if (!nodeData2.id || nodeData2.id === "" || nodeData2.id === "
    ") { + return; + } + if (nodeData2.cssClasses) { + if (!Array.isArray(nodeData2.cssCompiledStyles)) { + nodeData2.cssCompiledStyles = []; + } + nodeData2.cssClasses.split(" ").forEach((cssClass) => { + if (classes6.get(cssClass)) { + const classDef = classes6.get(cssClass); + nodeData2.cssCompiledStyles = [...nodeData2.cssCompiledStyles, ...classDef.styles]; + } + }); + } + const existingNodeData = nodes6.find((node2) => node2.id === nodeData2.id); + if (existingNodeData) { + Object.assign(existingNodeData, nodeData2); + } else { + nodes6.push(nodeData2); + } + } + 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 edgeData2 = { + 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(edgeData2); + graphItemCount++; } - return false; - } - function Rxd(a, b) { - var c2, d, e, f2; - if (a.ej()) { - c2 = a.i; - f2 = a.fj(); - lud(a, b); - d = a.Zi(3, null, b, c2, f2); - if (a.bj()) { - e = a.cj(b, null); - a.ij() && (e = a.jj(b, e)); - if (!e) { - a.$i(d); - } else { - e.Ei(d); - e.Fi(); - } - } else { - a.$i(d); - } - } else { - lud(a, b); - if (a.bj()) { - e = a.cj(b, null); - !!e && e.Fi(); - } - } - } - function rwd(a, b, c2) { - var d, e, f2; - if (a.ej()) { - f2 = a.fj(); - ++a.j; - a.Hi(b, a.oi(b, c2)); - d = a.Zi(3, null, c2, b, f2); - if (a.bj()) { - e = a.cj(c2, null); - if (!e) { - a.$i(d); - } else { - e.Ei(d); - e.Fi(); - } + 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 { - a.$i(d); + newNode.description = [newNode.description, parsedItem.description]; } } else { - ++a.j; - a.Hi(b, a.oi(b, c2)); - if (a.bj()) { - e = a.cj(c2, null); - !!e && e.Fi(); - } - } - } - function Wee(a) { - var b, c2, d, e; - e = a.length; - b = null; - for (d = 0; d < e; d++) { - c2 = (BCb(d, a.length), a.charCodeAt(d)); - if (hfb(".*+?{[()|\\^$", wfb(c2)) >= 0) { - if (!b) { - b = new Ifb(); - d > 0 && Efb(b, a.substr(0, d)); - } - b.a += "\\"; - Afb(b, c2 & aje); - } else - !!b && Afb(b, c2 & aje); - } - return b ? b.a : a; - } - function l5c(a) { - var b; - if (!a.a) { - throw vbb(new Zdb("IDataType class expected for layout option " + a.f)); - } - b = gvd(a.a); - if (b == null) { - throw vbb(new Zdb("Couldn't create new instance of property '" + a.f + "'. " + ise + (fdb(Y3), Y3.k) + jse)); - } - return BD(b, 414); - } - function aid(a) { - var b, c2, d, e, f2; - f2 = a.eh(); - if (f2) { - if (f2.kh()) { - e = xid(a, f2); - if (e != f2) { - c2 = a.Vg(); - d = (b = a.Vg(), b >= 0 ? a.Qg(null) : a.eh().ih(a, -1 - b, null, null)); - a.Rg(BD(e, 49), c2); - !!d && d.Fi(); - a.Lg() && a.Mg() && c2 > -1 && Uhd(a, new nSd(a, 9, c2, f2, e)); - return e; - } - } - } - return f2; - } - function nTb(a) { - var b, c2, d, e, f2, g, h, i3; - g = 0; - f2 = a.f.e; - for (d = 0; d < f2.c.length; ++d) { - h = (tCb(d, f2.c.length), BD(f2.c[d], 144)); - for (e = d + 1; e < f2.c.length; ++e) { - i3 = (tCb(e, f2.c.length), BD(f2.c[e], 144)); - c2 = S6c(h.d, i3.d); - b = c2 - a.a[h.b][i3.b]; - g += a.i[h.b][i3.b] * b * b; - } - } - return g; - } - function _ac(a, b) { - var c2; - if (wNb(b, (Nyc(), mxc))) { - return; - } - c2 = hbc(BD(vNb(b, Uac), 360), BD(vNb(a, mxc), 163)); - yNb(b, Uac, c2); - if (Qr(new Sr(ur(O_b(b).a.Kc(), new Sq())))) { - return; - } - switch (c2.g) { - case 1: - yNb(b, mxc, (Ctc(), xtc)); - break; - case 2: - yNb(b, mxc, (Ctc(), ztc)); - } - } - function wkc(a, b) { - var c2; - mkc(a); - a.a = (c2 = new Ji(), MAb(new YAb(null, new Kub(b.d, 16)), new Vkc(c2)), c2); - rkc(a, BD(vNb(b.b, (Nyc(), Wwc)), 376)); - tkc(a); - skc(a); - qkc(a); - ukc(a); - vkc(a, b); - MAb(LAb(new YAb(null, $i(Yi(a.b).a)), new Lkc()), new Nkc()); - b.a = false; - a.a = null; - } - function Bod() { - fod.call(this, yte, (Fhd(), Ehd)); - 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 Csd() { - Csd = ccb; - Bsd = new Dsd(Wne, 0); - ysd = new Dsd("INSIDE_SELF_LOOPS", 1); - zsd = new Dsd("MULTI_EDGES", 2); - xsd = new Dsd("EDGE_LABELS", 3); - Asd = new Dsd("PORTS", 4); - vsd = new Dsd("COMPOUND", 5); - usd = new Dsd("CLUSTERS", 6); - wsd = new Dsd("DISCONNECTED", 7); - } - function Sgb(a, b) { - var c2, d, e; - if (b == 0) { - return (a.a[0] & 1) != 0; - } - if (b < 0) { - throw vbb(new ocb("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 = Mgb(a); - if (e < d) { - return false; - } else - d == e ? c2 = -c2 : c2 = ~c2; - } - return (c2 & b) != 0; - } - function O1c(a, b, c2, d) { - var e; - BD(c2.b, 65); - BD(c2.b, 65); - BD(d.b, 65); - BD(d.b, 65); - e = c7c(R6c(BD(c2.b, 65).c), BD(d.b, 65).c); - $6c(e, YNb(BD(c2.b, 65), BD(d.b, 65), e)); - BD(d.b, 65); - BD(d.b, 65); - BD(d.b, 65).c.a + e.a; - BD(d.b, 65).c.b + e.b; - BD(d.b, 65); - Hkb(d.a, new T1c(a, b, d)); - } - function vNd(a, b) { - var c2, d, e, f2, g, h, i3; - f2 = b.e; - if (f2) { - c2 = aid(f2); - d = BD(a.g, 674); - for (g = 0; g < a.i; ++g) { - i3 = d[g]; - if (JQd(i3) == c2) { - e = (!i3.d && (i3.d = new xMd(j5, i3, 1)), i3.d); - h = BD(c2.ah(Nid(f2, f2.Cb, f2.Db >> 16)), 15).Xc(f2); - if (h < e.i) { - return vNd(a, BD(qud(e, h), 87)); - } - } - } + newNode.shape = SHAPE_STATE; + newNode.description = parsedItem.description; } - return b; } - function bcb(a, b, c2) { - var d = _bb, 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 = _bb[b]), ecb(h)); - _2.hm = c2; - !b && (_2.im = gcb); - d[a] = _2; - } - for (var g = 3; g < arguments.length; ++g) { - arguments[g].prototype = _2; + 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 nodeData2 = { + 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 (nodeData2.shape === SHAPE_DIVIDER) { + nodeData2.label = ""; + } + if (parent4 && parent4.id !== "root") { + log.trace("Setting node ", itemId, " to be child of its parent ", parent4.id); + nodeData2.parentId = parent4.id; + } + nodeData2.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, nodeData2, 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, nodeData2, 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, id27, _version, diag) { + log.info("REF0:"); + log.info("Drawing state diagram (v2)", id27); + const { securityLevel, state: conf8, layout: layout6 } = getConfig2(); + diag.db.extract(diag.db.getRootDocV2()); + const data4Layout = diag.db.getData(); + const svg = getDiagramElement(id27, securityLevel); + data4Layout.type = diag.type; + data4Layout.layoutAlgorithm = layout6; + data4Layout.nodeSpacing = conf8?.nodeSpacing || 50; + data4Layout.rankSpacing = conf8?.rankSpacing || 50; + data4Layout.markers = ["barb"]; + data4Layout.diagramId = id27; + 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(id27 = "") { + let fixedId = id27; + if (id27 === START_NODE) { + startEndCount++; + fixedId = `${START_TYPE}${startEndCount}`; + } + return fixedId; + } + function startTypeIfNeeded(id27 = "", type3 = DEFAULT_STATE_TYPE) { + return id27 === START_NODE ? START_TYPE : type3; + } + function endIdIfNeeded(id27 = "") { + let fixedId = id27; + if (id27 === END_NODE) { + startEndCount++; + fixedId = `${END_TYPE}${startEndCount}`; + } + return fixedId; + } + function endTypeIfNeeded(id27 = "", type3 = DEFAULT_STATE_TYPE) { + return id27 === 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 id27 = 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( + id27, + type22, + item2.doc, + item2.description, + item2.note, + item2.classes, + item2.styles, + item2.textStyles + ); + currentDocument.relations.push({ + id1, + id2: id27, + 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]); } - f2 && (_2.gm = f2); } - function Qr(a) { - var b; - while (!BD(Qb(a.a), 47).Ob()) { - a.d = Pr(a); - if (!a.d) { - return false; - } - a.a = BD(a.d.Pb(), 47); - if (JD(a.a, 39)) { - b = BD(a.a, 39); - a.a = b.a; - !a.b && (a.b = new jkb()); - Wjb(a.b, a.d); - if (b.b) { - while (!akb(b.b)) { - Wjb(a.b, BD(gkb(b.b), 47)); - } - } - a.d = b.d; - } - } - return true; + 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 krb(a, b) { - var c2, d, e, f2, g; - f2 = b == null ? 0 : a.b.se(b); - d = (c2 = a.a.get(f2), c2 == null ? new Array() : c2); - for (g = 0; g < d.length; g++) { - e = d[g]; - if (a.b.re(b, e.cd())) { - if (d.length == 1) { - d.length = 0; - trb(a.a, f2); - } else { - d.splice(g, 1); - } - --a.c; - zpb(a.b); - return e.dd(); - } + 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((id27) => { + let foundState = getState(id27); + if (foundState === void 0) { + const trimmedId = id27.trim(); + addState(trimmedId); + foundState = getState(trimmedId); + } + foundState.styles = styles3.map((s2) => s2.replace(/;/g, "")?.trim()); + }); } - return null; + 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 GGb(a, b) { - var c2, d, e, f2; - e = 1; - b.j = true; - f2 = null; - for (d = new olb(LFb(b)); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 213); - if (!a.c[c2.c]) { - a.c[c2.c] = true; - f2 = xFb(c2, b); - if (c2.f) { - e += GGb(a, f2); - } else if (!f2.j && c2.a == c2.e.e - c2.d.e) { - c2.f = true; - Qqb(a.p, c2); - e += GGb(a, f2); - } - } - } - return e; - } - function MVb(a) { - var b, c2, d; - for (c2 = new olb(a.a.a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 81); - d = (uCb(0), 0); - if (d > 0) { - !(fad(a.a.c) && b.n.d) && !(gad(a.a.c) && b.n.b) && (b.g.d += $wnd.Math.max(0, d / 2 - 0.5)); - !(fad(a.a.c) && b.n.a) && !(gad(a.a.c) && b.n.c) && (b.g.a -= d - 1); - } - } - } - function N3b(a) { - var b, c2, d, e, f2; - e = new Rkb(); - f2 = O3b(a, e); - b = BD(vNb(a, (wtc(), gtc)), 10); - if (b) { - for (d = new olb(b.j); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 11); - PD(vNb(c2, $sc)) === PD(a) && (f2 = $wnd.Math.max(f2, O3b(c2, e))); - } - } - e.c.length == 0 || yNb(a, Ysc, f2); - return f2 != -1 ? e : null; - } - function a9b(a, b, c2) { - var d, e, f2, g, h, i3; - f2 = BD(Ikb(b.e, 0), 17).c; - d = f2.i; - e = d.k; - i3 = BD(Ikb(c2.g, 0), 17).d; - g = i3.i; - h = g.k; - e == (j0b(), g0b) ? yNb(a, (wtc(), Vsc), BD(vNb(d, Vsc), 11)) : yNb(a, (wtc(), Vsc), f2); - h == g0b ? yNb(a, (wtc(), Wsc), BD(vNb(g, Wsc), 11)) : yNb(a, (wtc(), Wsc), i3); - } - function Rs(a, b) { - var c2, d, e, f2; - f2 = Tbb(Ibb(Eie, keb(Tbb(Ibb(b == null ? 0 : tb(b), Fie)), 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; - Bs(d.c, d.f); - As(d.b, d.e); - --a.f; - ++a.e; - return true; - } - } - return false; + node2.label = node2.label[0]; + } + }); + }, "extract"); + addState = /* @__PURE__ */ __name(function(id27, type3 = DEFAULT_STATE_TYPE, doc = null, descr = null, note3 = null, classes6 = null, styles3 = null, textStyles = null) { + const trimmedId = id27?.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(id27) { + return currentDocument.states.get(id27); + }, "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 id27 = endIdIfNeeded(item2.trim()); + const type22 = endTypeIfNeeded(item2); + addState(id1, type1); + addState(id27, type22); + currentDocument.relations.push({ + id1, + id2: id27, + title: common_default.sanitizeText(title2, getConfig2()) + }); + } + }, "addRelation"); + addDescription = /* @__PURE__ */ __name(function(id27, descr) { + const theState = currentDocument.states.get(id27); + 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(id27, styleAttributes = "") { + if (!classes3.has(id27)) { + classes3.set(id27, { id: id27, styles: [], textStyles: [] }); + } + const foundClass = classes3.get(id27); + 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(id27) { + let foundState = getState(id27); + if (foundState === void 0) { + const trimmedId = id27.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 state5 = 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 = state5.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 state5; + }, "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 id27 = stateDef.id; + const stateInfo = { + id: id27, + label: stateDef.id, + width: 0, + height: 0 + }; + const g2 = elem.append("g").attr("id", id27).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(id27, 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, id27, _version, diagObj) { + conf6 = getConfig2().state; + const securityLevel = getConfig2().securityLevel; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id27); + } + 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 diagram24 = root4.select(`[id='${id27}']`); + insertMarkers5(diagram24); + const rootDoc2 = diagObj.db.getRootDoc(); + renderDoc(rootDoc2, diagram24, void 0, false, root4, doc, diagObj); + const padding3 = conf6.padding; + const bounds4 = diagram24.node().getBBox(); + const width3 = bounds4.width + padding3 * 2; + const height2 = bounds4.height + padding3 * 2; + const svgWidth = width3 * 1.75; + configureSvgSize(diagram24, height2, svgWidth, conf6.useMaxWidth); + diagram24.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, diagram24, 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 = diagram24.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 lD(a, b) { - var c2, d, e, f2, g; - b &= 63; - c2 = a.h; - d = (c2 & Gje) != 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 ? Fje : 0; - f2 = c2 >> b - 22; - e = a.m >> b - 22 | c2 << 44 - b; - } else { - g = d ? Fje : 0; - f2 = d ? Eje : 0; - e = c2 >> b - 44; - } - return TC(e & Eje, f2 & Eje, g & Fje); - } - function XOb(a) { - var b, c2, d, e, f2, g; - this.c = new Rkb(); - this.d = a; - d = Pje; - e = Pje; - b = Qje; - c2 = Qje; - for (g = Jsb(a, 0); g.b != g.d.c; ) { - f2 = BD(Xsb(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 J6c(d, e, b - d, c2 - e); - } - function Dac(a, b) { - var c2, d, e, f2, g, h; - for (f2 = new olb(a.b); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 29); - for (h = new olb(e.a); h.a < h.c.c.length; ) { - g = BD(mlb(h), 10); - g.k == (j0b(), f0b) && zac(g, b); - for (d = new Sr(ur(U_b(g).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 17); - yac(c2, b); - } - } - } - } - function Xoc(a) { - var b, c2, d; - this.c = a; - d = BD(vNb(a, (Nyc(), Lwc)), 103); - b = Edb(ED(vNb(a, owc))); - c2 = Edb(ED(vNb(a, Dyc))); - d == (ead(), aad) || d == bad || d == cad ? this.b = b * c2 : this.b = 1 / (b * c2); - this.j = Edb(ED(vNb(a, wyc))); - this.e = Edb(ED(vNb(a, vyc))); - this.f = a.b.c.length; - } - function ADc(a) { - var b, c2; - a.e = KC(WD, oje, 25, a.p.c.length, 15, 1); - a.k = KC(WD, oje, 25, a.p.c.length, 15, 1); - for (c2 = new olb(a.p); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 10); - a.e[b.p] = sr(new Sr(ur(R_b(b).a.Kc(), new Sq()))); - a.k[b.p] = sr(new Sr(ur(U_b(b).a.Kc(), new Sq()))); - } - } - function DDc(a) { - var b, c2, d, e, f2, g; - e = 0; - a.q = new Rkb(); - b = new Tqb(); - for (g = new olb(a.p); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 10); - f2.p = e; - for (d = new Sr(ur(U_b(f2).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 17); - Qqb(b, c2.d.i); - } - b.a.Bc(f2) != null; - Ekb(a.q, new Vqb(b)); - b.a.$b(); - ++e; - } - } - function JTc() { - JTc = ccb; - CTc = new q0b(20); - BTc = new Osd((Y9c(), f9c), CTc); - HTc = new Osd(T9c, 20); - uTc = new Osd(r8c, tme); - ETc = new Osd(D9c, meb(1)); - GTc = new Osd(H9c, (Bcb(), true)); - vTc = y8c; - xTc = Y8c; - yTc = _8c; - zTc = b9c; - wTc = W8c; - ATc = e9c; - DTc = x9c; - ITc = (rTc(), pTc); - FTc = nTc; - } - function RBd(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - if (a.a.f > 0 && JD(b, 42)) { - a.a.qj(); - j = BD(b, 42); - i3 = j.cd(); - f2 = i3 == null ? 0 : tb(i3); - g = DAd(a.a, f2); - c2 = a.a.d[g]; - if (c2) { - d = BD(c2.g, 367); - k = c2.i; - for (h = 0; h < k; ++h) { - e = d[h]; - if (e.Sh() == f2 && e.Fb(j)) { - RBd(a, j); - return true; - } - } - } - } - return false; + } else { + node2 = drawState(diagram24, stateDef, graph); + } + if (stateDef.note) { + const noteDef = { + descriptions: [], + id: stateDef.id + "-note", + note: stateDef.note, + type: "note" + }; + const note3 = drawState(diagram24, 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 skc(a) { - var b, c2, d, e; - for (e = BD(Qc(a.a, (Xjc(), Ujc)), 15).Kc(); e.Ob(); ) { - d = BD(e.Pb(), 101); - c2 = (b = Ec(d.k), b.Hc((Ucd(), Acd)) ? b.Hc(zcd) ? b.Hc(Rcd) ? b.Hc(Tcd) ? null : dkc : fkc : ekc : ckc); - kkc(a, d, c2[0], (Fkc(), Ckc), 0); - kkc(a, d, c2[1], Dkc, 1); - kkc(a, d, c2[2], Ekc, 1); - } - } - function enc(a, b) { - var c2, d; - c2 = fnc(b); - inc(a, b, c2); - uPc(a.a, BD(vNb(Q_b(b.b), (wtc(), jtc)), 230)); - dnc(a); - cnc(a, b); - d = KC(WD, oje, 25, b.b.j.c.length, 15, 1); - lnc(a, b, (Ucd(), Acd), d, c2); - lnc(a, b, zcd, d, c2); - lnc(a, b, Rcd, d, c2); - lnc(a, b, Tcd, d, c2); - a.a = null; - a.c = null; - a.b = null; - } - function OYc() { - OYc = ccb; - LYc = (zYc(), yYc); - KYc = new Nsd(Bre, LYc); - IYc = new Nsd(Cre, (Bcb(), true)); - meb(-1); - FYc = new Nsd(Dre, meb(-1)); - meb(-1); - GYc = new Nsd(Ere, meb(-1)); - JYc = new Nsd(Fre, false); - MYc = new Nsd(Gre, true); - HYc = new Nsd(Hre, false); - NYc = new Nsd(Ire, -1); - } - function yld(a, b, c2) { - switch (b) { - case 7: - !a.e && (a.e = new y5d(B2, a, 7, 4)); - Uxd(a.e); - !a.e && (a.e = new y5d(B2, a, 7, 4)); - ytd(a.e, BD(c2, 14)); - return; - case 8: - !a.d && (a.d = new y5d(B2, a, 8, 5)); - Uxd(a.d); - !a.d && (a.d = new y5d(B2, a, 8, 5)); - ytd(a.d, BD(c2, 14)); - return; - } - Zkd(a, b, c2); + 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 = diagram24.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(diagram24, 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 parser22 = { + 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 At(a, b) { - var c2, d, e, f2, g; - if (PD(b) === PD(a)) { - return true; - } - if (!JD(b, 15)) { - return false; - } - g = BD(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 (!(PD(c2) === PD(e) || c2 != null && pb(c2, e))) { - return false; - } - } - return true; + }, "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 U6b(a, b) { - var c2, d, e, f2; - f2 = BD(GAb(LAb(LAb(new YAb(null, new Kub(b.b, 16)), new $6b()), new a7b()), Byb(new fzb(), new dzb(), new Ezb(), OC(GC(xL, 1), Kie, 132, 0, [(Fyb(), Dyb)]))), 15); - f2.Jc(new c7b()); - c2 = 0; - for (e = f2.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 11); - d.p == -1 && T6b(a, d, c2++); - } + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - function Wzc(a) { - switch (a.g) { - case 0: - return new KLc(); - case 1: - return new dJc(); - case 2: - return new tJc(); - case 3: - return new CMc(); - case 4: - return new $Jc(); - default: - throw vbb(new Wdb("No implementation is available for the node placer " + (a.f != null ? a.f : "" + a.g))); + __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 nqc(a) { - switch (a.g) { - case 0: - return new aCc(); - case 1: - return new VBc(); - case 2: - return new kCc(); - case 3: - return new rCc(); - case 4: - return new eCc(); - default: - throw vbb(new Wdb("No implementation is available for the cycle breaker " + (a.f != null ? a.f : "" + a.g))); - } - } - function HWc() { - HWc = ccb; - BWc = new Nsd(lre, meb(0)); - CWc = new Nsd(mre, 0); - yWc = (pWc(), mWc); - xWc = new Nsd(nre, yWc); - meb(0); - wWc = new Nsd(ore, meb(1)); - EWc = (sXc(), qXc); - DWc = new Nsd(pre, EWc); - GWc = (fWc(), eWc); - FWc = new Nsd(qre, GWc); - AWc = (iXc(), hXc); - zWc = new Nsd(rre, AWc); - } - function XXb(a, b, c2) { - var d; - d = null; - !!b && (d = b.d); - hYb(a, new cWb(b.n.a - d.b + c2.a, b.n.b - d.d + c2.b)); - hYb(a, new cWb(b.n.a - d.b + c2.a, b.n.b + b.o.b + d.a + c2.b)); - hYb(a, new cWb(b.n.a + b.o.a + d.c + c2.a, b.n.b - d.d + c2.b)); - hYb(a, new cWb(b.n.a + b.o.a + d.c + c2.a, b.n.b + b.o.b + d.a + c2.b)); - } - function T6b(a, b, c2) { - var d, e, f2; - b.p = c2; - for (f2 = ul(pl(OC(GC(KI, 1), Uhe, 20, 0, [new J0b(b), new R0b(b)]))); Qr(f2); ) { - d = BD(Rr(f2), 11); - d.p == -1 && T6b(a, d, c2); - } - if (b.i.k == (j0b(), g0b)) { - for (e = new olb(b.i.j); e.a < e.c.c.length; ) { - d = BD(mlb(e), 11); - d != b && d.p == -1 && T6b(a, d, c2); - } - } - } - function rPc(a) { - var b, c2, d, e, f2; - e = BD(GAb(IAb(UAb(a)), Byb(new fzb(), new dzb(), new Ezb(), OC(GC(xL, 1), Kie, 132, 0, [(Fyb(), Dyb)]))), 15); - d = dme; - if (e.gc() >= 2) { - c2 = e.Kc(); - b = ED(c2.Pb()); - while (c2.Ob()) { - f2 = b; - b = ED(c2.Pb()); - d = $wnd.Math.min(d, (uCb(b), b) - (uCb(f2), f2)); - } - } - return d; - } - function gUc(a, b) { - var c2, d, e, f2, g; - d = new Psb(); - Gsb(d, b, d.c.b, d.c); - do { - c2 = (sCb(d.b != 0), BD(Nsb(d, d.a.a), 86)); - a.b[c2.g] = 1; - for (f2 = Jsb(c2.d, 0); f2.b != f2.d.c; ) { - e = BD(Xsb(f2), 188); - g = e.c; - a.b[g.g] == 1 ? Dsb(a.a, e) : a.b[g.g] == 2 ? a.b[g.g] = 1 : Gsb(d, g, d.c.b, d.c); - } - } while (d.b != 0); - } - function Ju(a, b) { - var c2, d, e; - if (PD(b) === PD(Qb(a))) { - return true; - } - if (!JD(b, 15)) { - return false; - } - d = BD(b, 15); - e = a.gc(); - if (e != d.gc()) { - return false; - } - if (JD(d, 54)) { - for (c2 = 0; c2 < e; c2++) { - if (!Hb(a.Xb(c2), d.Xb(c2))) { - return false; - } - } - return true; + __name(lex2, "lex"); + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; } else { - return kr(a.Kc(), d.Kc()); + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state5] && table[state5][symbol]; } - } - function Aac(a, b) { - var c2, d; - if (a.c.length != 0) { - if (a.c.length == 2) { - zac((tCb(0, a.c.length), BD(a.c[0], 10)), (rbd(), nbd)); - zac((tCb(1, a.c.length), BD(a.c[1], 10)), obd); - } else { - for (d = new olb(a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 10); - zac(c2, b); + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state5]) { + if (this.terminals_[p3] && p3 > TERROR) { + expected.push("'" + this.terminals_[p3] + "'"); } } - a.c = KC(SI, Uhe, 1, 0, 5, 1); - } - } - function uKc(a) { - var b, c2; - if (a.c.length != 2) { - throw vbb(new Zdb("Order only allowed for two paths.")); - } - b = (tCb(0, a.c.length), BD(a.c[0], 17)); - c2 = (tCb(1, a.c.length), BD(a.c[1], 17)); - if (b.d.i != c2.c.i) { - a.c = KC(SI, Uhe, 1, 0, 5, 1); - a.c[a.c.length] = c2; - a.c[a.c.length] = b; + 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 EMc(a, b) { - var c2, d, e, f2, g, h; - d = new $rb(); - g = Gx(new amb(a.g)); - for (f2 = g.a.ec().Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 10); - if (!e) { - Sdd(b, "There are no classes in a balanced layout."); - break; - } - h = a.j[e.p]; - c2 = BD(Wrb(d, h), 15); - if (!c2) { - c2 = new Rkb(); - Xrb(d, h, c2); - } - c2.Fc(e); + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } - return d; - } - function Dqd(a, b, c2) { - var d, e, f2, g, h, i3, j; - if (c2) { - f2 = c2.a.length; - d = new Yge(f2); - for (h = (d.b - d.a) * d.c < 0 ? (Xge(), Wge) : new she(d); h.Ob(); ) { - g = BD(h.Pb(), 19); - i3 = Zpd(c2, g.a); - if (i3) { - j = ftd(_pd(i3, Ite), b); - Rhb(a.f, j, i3); - e = Vte in i3.a; - e && Lkd(j, _pd(i3, Vte)); - grd(i3, j); - hrd(i3, j); + 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 ndc(a, b) { - var c2, d, e, f2, g; - Odd(b, "Port side processing", 1); - for (g = new olb(a.a); g.a < g.c.c.length; ) { - e = BD(mlb(g), 10); - odc(e); + 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]; } - for (d = new olb(a.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 29); - for (f2 = new olb(c2.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 10); - odc(e); - } + 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]; } - Qdd(b); - } - function bfc(a, b, c2) { - var d, e, f2, g, h; - e = a.f; - !e && (e = BD(a.a.a.ec().Kc().Pb(), 57)); - cfc(e, b, c2); - if (a.a.a.gc() == 1) { - return; + 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 + }); } - d = b * c2; - for (g = a.a.a.ec().Kc(); g.Ob(); ) { - f2 = BD(g.Pb(), 57); - if (f2 != e) { - h = ugc(f2); - if (h.f.d) { - f2.d.d += d + ple; - f2.d.a -= d + ple; - } else - h.f.a && (f2.d.a -= d + ple); - } - } - } - function tQb(a, b, c2, d, e) { - var f2, g, h, i3, j, k, l, m, n; - g = c2 - a; - h = d - b; - f2 = $wnd.Math.atan2(g, h); - i3 = f2 + cme; - j = f2 - cme; - k = e * $wnd.Math.sin(i3) + a; - m = e * $wnd.Math.cos(i3) + b; - l = e * $wnd.Math.sin(j) + a; - n = e * $wnd.Math.cos(j) + b; - return Ou(OC(GC(m1, 1), nie, 8, 0, [new f7c(k, m), new f7c(l, n)])); - } - function OLc(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l; - e = c2; - k = b; - f2 = k; - do { - f2 = a.a[f2.p]; - h = (l = a.g[f2.p], Edb(a.p[l.p]) + Edb(a.d[f2.p]) - f2.d.d); - i3 = RLc(f2, d); - if (i3) { - g = (j = a.g[i3.p], Edb(a.p[j.p]) + Edb(a.d[i3.p]) + i3.o.b + i3.d.a); - e = $wnd.Math.min(e, h - (g + jBc(a.k, f2, i3))); - } - } while (k != f2); - return e; - } - function PLc(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l; - e = c2; - k = b; - f2 = k; - do { - f2 = a.a[f2.p]; - g = (l = a.g[f2.p], Edb(a.p[l.p]) + Edb(a.d[f2.p]) + f2.o.b + f2.d.a); - i3 = QLc(f2, d); - if (i3) { - h = (j = a.g[i3.p], Edb(a.p[j.p]) + Edb(a.d[i3.p]) - i3.d.d); - e = $wnd.Math.min(e, h - (g + jBc(a.k, f2, i3))); - } - } while (k != f2); - return e; - } - function hkd(a, b) { - var c2, d; - d = (!a.o && (a.o = new dId((Thd(), Qhd), S2, a, 0)), AAd(a.o, b)); - if (d != null) { - return d; - } - c2 = b.wg(); - JD(c2, 4) && (c2 == null ? (!a.o && (a.o = new dId((Thd(), Qhd), S2, a, 0)), LAd(a.o, b)) : (!a.o && (a.o = new dId((Thd(), Qhd), S2, a, 0)), HAd(a.o, b, c2)), a); - return c2; - } - function Hbd() { - Hbd = ccb; - zbd = new Ibd("H_LEFT", 0); - ybd = new Ibd("H_CENTER", 1); - Bbd = new Ibd("H_RIGHT", 2); - Gbd = new Ibd("V_TOP", 3); - Fbd = new Ibd("V_CENTER", 4); - Ebd = new Ibd("V_BOTTOM", 5); - Cbd = new Ibd("INSIDE", 6); - Dbd = new Ibd("OUTSIDE", 7); - Abd = new Ibd("H_PRIORITY", 8); - } - function o6d(a) { - var b, c2, d, e, f2, g, h; - b = a.Hh(_ve); - if (b) { - h = GD(AAd((!b.b && (b.b = new sId((jGd(), fGd), x6, b)), b.b), "settingDelegates")); - if (h != null) { - c2 = new Rkb(); - for (e = mfb(h, "\\w+"), f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - c2.c[c2.c.length] = d; - } - return c2; - } - } - return mmb(), mmb(), jmb; - } - function sGb(a, b) { - var c2, d, e, f2, g, h, i3; - if (!b.f) { - throw vbb(new Wdb("The input edge is not a tree edge.")); - } - f2 = null; - e = Ohe; - for (d = new olb(a.d); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 213); - h = c2.d; - i3 = c2.e; - if (xGb(a, h, b) && !xGb(a, i3, b)) { - g = i3.e - h.e - c2.a; - if (g < e) { - e = g; - f2 = c2; - } - } - } - return f2; - } - function qTb(a) { - var b, c2, d, e, f2, g; - if (a.f.e.c.length <= 1) { - return; + 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); + } } - b = 0; - e = nTb(a); - c2 = Pje; - do { - b > 0 && (e = c2); - for (g = new olb(a.f.e); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 144); - if (Ccb(DD(vNb(f2, (bTb(), USb))))) { - continue; - } - d = mTb(a, f2); - P6c(X6c(f2.d), d); - } - c2 = nTb(a); - } while (!pTb(a, b++, e, c2)); - } - function $ac(a, b) { - var c2, d, e; - Odd(b, "Layer constraint preprocessing", 1); - c2 = new Rkb(); - e = new Bib(a.a, 0); - while (e.b < e.d.gc()) { - d = (sCb(e.b < e.d.gc()), BD(e.d.Xb(e.c = e.b++), 10)); - if (Zac(d)) { - Xac(d); - c2.c[c2.c.length] = d; - uib(e); - } - } - c2.c.length == 0 || yNb(a, (wtc(), Lsc), c2); - Qdd(b); - } - function sjc(a, b) { - var c2, d, e, f2, g; - f2 = a.g.a; - g = a.g.b; - for (d = new olb(a.d); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 70); - e = c2.n; - a.a == (Ajc(), xjc) || a.i == (Ucd(), zcd) ? e.a = f2 : a.a == yjc || a.i == (Ucd(), Tcd) ? e.a = f2 + a.j.a - c2.o.a : e.a = f2 + (a.j.a - c2.o.a) / 2; - e.b = g; - P6c(e, b); - g += c2.o.b + a.e; - } - } - function LSc(a, b, c2) { - var d, e, f2, g; - Odd(c2, "Processor set coordinates", 1); - a.a = b.b.b == 0 ? 1 : b.b.b; - f2 = null; - d = Jsb(b.b, 0); - while (!f2 && d.b != d.d.c) { - g = BD(Xsb(d), 86); - if (Ccb(DD(vNb(g, (mTc(), jTc))))) { - f2 = g; - e = g.e; - e.a = BD(vNb(g, kTc), 19).a; - e.b = 0; - } - } - MSc(a, URc(f2), Udd(c2, 1)); - Qdd(c2); - } - function xSc(a, b, c2) { - var d, e, f2; - Odd(c2, "Processor determine the height for each level", 1); - a.a = b.b.b == 0 ? 1 : b.b.b; - e = null; - d = Jsb(b.b, 0); - while (!e && d.b != d.d.c) { - f2 = BD(Xsb(d), 86); - Ccb(DD(vNb(f2, (mTc(), jTc)))) && (e = f2); - } - !!e && ySc(a, Ou(OC(GC(q$, 1), fme, 86, 0, [e])), c2); - Qdd(c2); - } - function brd(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - j = a; - i3 = $pd(j, "individualSpacings"); - if (i3) { - d = ikd(b, (Y9c(), O9c)); - g = !d; - if (g) { - e = new _fd(); - jkd(b, O9c, e); - } - h = BD(hkd(b, O9c), 373); - l = i3; - f2 = null; - !!l && (f2 = (k = $B(l, KC(ZI, nie, 2, 0, 6, 1)), new mC(l, k))); - if (f2) { - c2 = new Frd(l, h); - reb(f2, c2); - } - } - } - function frd(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m; - i3 = null; - l = a; - k = null; - if (cue in l.a || due in l.a || Ote in l.a) { - j = null; - m = etd(b); - g = $pd(l, cue); - c2 = new Ird(m); - Eqd(c2.a, g); - h = $pd(l, due); - d = new asd(m); - Pqd(d.a, h); - f2 = Ypd(l, Ote); - e = new dsd(m); - j = (Qqd(e.a, f2), f2); - k = j; - } - i3 = k; - return i3; - } - function $w(a, b) { - var c2, d, e; - if (b === a) { - return true; + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; } - if (JD(b, 543)) { - e = BD(b, 835); - if (a.a.d != e.a.d || Ah(a).gc() != Ah(e).gc()) { - return false; - } - for (d = Ah(e).Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 416); - if (Aw(a, c2.a.cd()) != BD(c2.a.dd(), 14).gc()) { - return false; - } + 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 true; + return false; } return false; - } - function BMb(a) { - var b, c2, d, e; - d = BD(a.a, 19).a; - e = BD(a.b, 19).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; + }, "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 { - if (d > 0 && e >= 0) { - b -= 1; - c2 += 1; - } else { - b += 1; - c2 -= 1; - } + return false; } + } else if (!this.options.flex) { + break; } } } - return new vgd(meb(b), meb(c2)); - } - function PIc(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 == (UIc(), TIc) && b.d == SIc) { - return -1; - } else if (a.d == SIc && b.d == TIc) { - return 1; - } - return 0; - } - function aNc(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 = NLc(a.a, g, d); - if (e > 0 && e < dme) { - c2 = OLc(a.a, d.i, e, a.c); - TLc(a.a, d.i, -c2); - return c2 > 0; - } else if (e < 0 && -e < dme) { - c2 = PLc(a.a, d.i, -e, a.c); - TLc(a.a, d.i, c2); - return c2 > 0; - } - return false; - } - function RZc(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l; - e = (b - a.d) / a.c.c.length; - f2 = 0; - a.a += c2; - a.d = b; - for (l = new olb(a.c); l.a < l.c.c.length; ) { - k = BD(mlb(l), 33); - j = k.g; - i3 = k.f; - dld(k, k.i + f2 * e); - eld(k, k.j + d * c2); - cld(k, k.g + e); - ald(k, a.a); - ++f2; - h = k.g; - g = k.f; - Ffd(k, new f7c(h, g), new f7c(j, i3)); - } - } - function Xmd(a) { - var b, c2, d, e, f2, g, h; - if (a == null) { - return null; - } - h = a.length; - e = (h + 1) / 2 | 0; - g = KC(SD, wte, 25, e, 15, 1); - h % 2 != 0 && (g[--e] = jnd((BCb(h - 1, a.length), a.charCodeAt(h - 1)))); - for (c2 = 0, d = 0; c2 < e; ++c2) { - b = jnd(bfb(a, d++)); - f2 = jnd(bfb(a, d++)); - g[c2] = (b << 4 | f2) << 24 >> 24; - } - return g; - } - function vdb(a) { - if (a.pe()) { - var b = a.c; - b.qe() ? a.o = "[" + b.n : !b.pe() ? a.o = "[L" + b.ne() + ";" : a.o = "[" + b.ne(); - a.b = b.me() + "[]"; - a.k = b.oe() + "[]"; - return; - } - var c2 = a.j; - var d = a.d; - d = d.split("/"); - a.o = ydb(".", [c2, ydb("$", d)]); - a.b = ydb(".", [c2, ydb(".", d)]); - a.k = d[d.length - 1]; - } - function qGb(a, b) { - var c2, d, e, f2, g; - g = null; - for (f2 = new olb(a.e.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 121); - if (e.b.a.c.length == e.g.a.c.length) { - d = e.e; - g = BGb(e); - for (c2 = e.e - BD(g.a, 19).a + 1; c2 < e.e + BD(g.b, 19).a; c2++) { - b[c2] < b[d] && (d = c2); - } - if (b[d] < b[e.e]) { - --b[e.e]; - ++b[d]; - e.e = d; - } - } - } - } - function SLc(a) { - var b, c2, d, e, f2, g, h, i3; - e = Pje; - d = Qje; - for (c2 = new olb(a.e.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 29); - for (g = new olb(b.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 10); - i3 = Edb(a.p[f2.p]); - h = i3 + Edb(a.b[a.g[f2.p].p]); - e = $wnd.Math.min(e, i3); - d = $wnd.Math.max(d, h); - } - } - return d - e; - } - function r1d(a, b, c2, d) { - var e, f2, g, h, j; - e = f1d(a, b); - for (h = 0, j = e.gc(); h < j; ++h) { - f2 = BD(e.Xb(h), 170); - if (dfb(d, a2d(q1d(a, f2)))) { - g = b2d(q1d(a, f2)); - if (c2 == null) { - if (g == null) { - return f2; - } - } else if (dfb(c2, g)) { - return f2; - } else - ; - } - } - return null; - } - function s1d(a, b, c2, d) { - var e, f2, g, h, j; - e = g1d(a, b); - for (h = 0, j = e.gc(); h < j; ++h) { - f2 = BD(e.Xb(h), 170); - if (dfb(d, a2d(q1d(a, f2)))) { - g = b2d(q1d(a, f2)); - if (c2 == null) { - if (g == null) { - return f2; - } - } else if (dfb(c2, g)) { - return f2; - } else - ; + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; } + return false; } - return null; - } - function p3d(a, b, c2) { - var d, e, f2, g, h, i3; - g = new yud(); - h = S6d(a.e.Tg(), b); - d = BD(a.g, 119); - Q6d(); - if (BD(b, 66).Oj()) { - for (f2 = 0; f2 < a.i; ++f2) { - e = d[f2]; - h.rl(e.ak()) && wtd(g, e); - } + if (this._input === "") { + return this.EOF; } else { - for (f2 = 0; f2 < a.i; ++f2) { - e = d[f2]; - if (h.rl(e.ak())) { - i3 = e.dd(); - wtd(g, c2 ? b3d(a, b, f2, g.i, i3) : i3); - } - } - } - return wud(g); - } - function T9b(a, b) { - var c2, d, e, f2, g; - c2 = new Rpb(EW); - for (e = (Apc(), OC(GC(EW, 1), Kie, 227, 0, [wpc, ypc, vpc, xpc, zpc, upc])), f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - Opb(c2, d, new Rkb()); - } - MAb(NAb(JAb(LAb(new YAb(null, new Kub(a.b, 16)), new hac()), new jac()), new lac(b)), new nac(c2)); - return c2; - } - function AVc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m; - for (f2 = b.Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 33); - k = e.i + e.g / 2; - m = e.j + e.f / 2; - i3 = a.f; - g = i3.i + i3.g / 2; - h = i3.j + i3.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; - } - dld(e, k - e.g / 2); - eld(e, m - e.f / 2); + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); } - } - function Yfe(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 UUb(a, b) { - var c2, d, e, f2, g, h, i3, j; - g = b == 1 ? KUb : JUb; - for (f2 = g.a.ec().Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 103); - for (i3 = BD(Qc(a.f.c, e), 21).Kc(); i3.Ob(); ) { - h = BD(i3.Pb(), 46); - d = BD(h.b, 81); - j = BD(h.a, 189); - c2 = j.c; - switch (e.g) { - case 2: - case 1: - d.g.d += c2; - break; - case 4: - case 3: - d.g.c += c2; - } - } - } - } - function PFc(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - j = -1; - k = 0; - for (g = a, h = 0, i3 = g.length; h < i3; ++h) { - f2 = g[h]; - c2 = new Dnc(j == -1 ? a[0] : a[j], b, (xzc(), wzc)); - for (d = 0; d < f2.length; d++) { - for (e = d + 1; e < f2.length; e++) { - wNb(f2[d], (wtc(), Zsc)) && wNb(f2[e], Zsc) && ync(c2, f2[d], f2[e]) > 0 && ++k; - } - } - ++j; - } - return k; - } - function Eid(a) { - var b, c2; - c2 = new Wfb(hdb(a.gm)); - c2.a += "@"; - Qfb(c2, (b = tb(a) >>> 0, b.toString(16))); - if (a.kh()) { - c2.a += " (eProxyURI: "; - Pfb(c2, a.qh()); - if (a.$g()) { - c2.a += " eClass: "; - Pfb(c2, a.$g()); - } - c2.a += ")"; - } else if (a.$g()) { - c2.a += " (eClass: "; - Pfb(c2, a.$g()); - c2.a += ")"; - } - return c2.a; - } - function TDb(a) { - var b, c2, d, e; - if (a.e) { - throw vbb(new Zdb((fdb(TM), Jke + TM.k + Kke))); - } - a.d == (ead(), cad) && SDb(a, aad); - for (c2 = new olb(a.a.a); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 307); - b.g = b.i; - } - for (e = new olb(a.a.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 57); - d.i = Qje; - } - a.b.Le(a); - return a; - } - function TPc(a, b) { - var c2, d, e, f2, g; - if (b < 2 * a.b) { - throw vbb(new Wdb("The knot vector must have at least two time the dimension elements.")); - } - a.f = 1; - for (e = 0; e < a.b; e++) { - Ekb(a.e, 0); - } - g = b + 1 - 2 * a.b; - c2 = g; - for (f2 = 1; f2 < g; f2++) { - Ekb(a.e, f2 / c2); - } - if (a.d) { - for (d = 0; d < a.b; d++) { - Ekb(a.e, 1); - } - } - } - function ard(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - j = b; - k = BD(_o(qo(a.i), j), 33); - if (!k) { - e = _pd(j, Vte); - h = "Unable to find elk node for json object '" + e; - i3 = h + "' Panic!"; - throw vbb(new cqd(i3)); - } - f2 = Ypd(j, "edges"); - c2 = new krd(a, k); - mqd(c2.a, c2.b, f2); - g = Ypd(j, Jte); - d = new vrd(a); - xqd(d.a, g); - } - function xAd(a, b, c2, d) { - var e, f2, g, h, i3; - if (d != null) { - e = a.d[b]; - if (e) { - f2 = e.g; - i3 = e.i; - for (h = 0; h < i3; ++h) { - g = BD(f2[h], 133); - if (g.Sh() == c2 && pb(d, g.cd())) { - return h; - } - } - } + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; } else { - e = a.d[b]; - if (e) { - f2 = e.g; - i3 = e.i; - for (h = 0; h < i3; ++h) { - g = BD(f2[h], 133); - if (PD(g.cd()) === PD(d)) { - return h; - } - } - } + 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]; } - return -1; - } - function nUd(a, b) { - var c2, d, e; - c2 = b == null ? Wd(irb(a.f, null)) : Crb(a.g, b); - if (JD(c2, 235)) { - e = BD(c2, 235); - e.Qh() == null && void 0; - return e; - } else if (JD(c2, 498)) { - d = BD(c2, 1938); - e = d.a; - !!e && (e.yb == null ? void 0 : b == null ? jrb(a.f, null, e) : Drb(a.g, b, e)); - return e; - } else { - return null; - } - } - function ide(a) { - hde(); - var b, c2, d, e, f2, g, h; - if (a == null) - return null; - e = a.length; - if (e % 2 != 0) - return null; - b = rfb(a); - f2 = e / 2 | 0; - c2 = KC(SD, wte, 25, f2, 15, 1); - for (d = 0; d < f2; d++) { - g = fde[b[d * 2]]; - if (g == -1) - return null; - h = fde[b[d * 2 + 1]]; - if (h == -1) - return null; - c2[d] = (g << 4 | h) << 24 >> 24; - } - return c2; - } - function lKb(a, b, c2) { - var d, e, f2; - e = BD(Mpb(a.i, b), 306); - if (!e) { - e = new bIb(a.d, b, c2); - Npb(a.i, b, e); - if (sJb(b)) { - CHb(a.a, b.c, b.b, e); - } else { - f2 = rJb(b); - d = BD(Mpb(a.p, f2), 244); - switch (f2.g) { - case 1: - case 3: - e.j = true; - lIb(d, b.b, e); - break; - case 4: - case 2: - e.k = true; - lIb(d, b.c, e); - } - } - } - return e; - } - function r3d(a, b, c2, d) { - var e, f2, g, h, i3, j; - h = new yud(); - i3 = S6d(a.e.Tg(), b); - e = BD(a.g, 119); - Q6d(); - if (BD(b, 66).Oj()) { - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - i3.rl(f2.ak()) && wtd(h, f2); - } - } else { - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (i3.rl(f2.ak())) { - j = f2.dd(); - wtd(h, d ? b3d(a, b, g, h.i, j) : j); - } - } - } - return xud(h, c2); - } - function YCc(a, b) { - var c2, d, e, f2, g, h, i3, j; - e = a.b[b.p]; - if (e >= 0) { - return e; - } else { - f2 = 1; - for (h = new olb(b.j); h.a < h.c.c.length; ) { - g = BD(mlb(h), 11); - for (d = new olb(g.g); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 17); - j = c2.d.i; - if (b != j) { - i3 = YCc(a, j); - f2 = $wnd.Math.max(f2, i3 + 1); - } - } - } - XCc(a, b, f2); - return f2; - } - } - function YGc(a, b, c2) { - var d, e, f2; - for (d = 1; d < a.c.length; d++) { - f2 = (tCb(d, a.c.length), BD(a.c[d], 10)); - e = d; - while (e > 0 && b.ue((tCb(e - 1, a.c.length), BD(a.c[e - 1], 10)), f2) > 0) { - Nkb(a, e, (tCb(e - 1, a.c.length), BD(a.c[e - 1], 10))); - --e; - } - tCb(e, a.c.length); - a.c[e] = f2; - } - c2.a = new Lqb(); - c2.b = new Lqb(); - } - function n5c(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - k = (d = BD(b.e && b.e(), 9), new xqb(d, BD(_Bb(d, d.length), 9), 0)); - i3 = mfb(c2, "[\\[\\]\\s,]+"); - for (f2 = i3, g = 0, h = f2.length; g < h; ++g) { - e = f2[g]; - if (ufb(e).length == 0) { - continue; - } - j = m5c(a, e); - if (j == null) { - return null; - } else { - rqb(k, BD(j, 22)); - } - } - return k; - } - function KVb(a) { - var b, c2, d; - for (c2 = new olb(a.a.a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 81); - d = (uCb(0), 0); - if (d > 0) { - !(fad(a.a.c) && b.n.d) && !(gad(a.a.c) && b.n.b) && (b.g.d -= $wnd.Math.max(0, d / 2 - 0.5)); - !(fad(a.a.c) && b.n.a) && !(gad(a.a.c) && b.n.c) && (b.g.a += $wnd.Math.max(0, d - 1)); - } - } - } - function Hac(a, b, c2) { - var d, e; - if ((a.c - a.b & a.a.length - 1) == 2) { - if (b == (Ucd(), Acd) || b == zcd) { - xac(BD(bkb(a), 15), (rbd(), nbd)); - xac(BD(bkb(a), 15), obd); - } else { - xac(BD(bkb(a), 15), (rbd(), obd)); - xac(BD(bkb(a), 15), nbd); - } - } else { - for (e = new xkb(a); e.a != e.b; ) { - d = BD(vkb(e), 15); - xac(d, c2); - } - } - } - function htd(a, b) { - var c2, d, e, f2, g, h, i3; - e = Nu(new qtd(a)); - h = new Bib(e, e.c.length); - f2 = Nu(new qtd(b)); - i3 = new Bib(f2, f2.c.length); - g = null; - while (h.b > 0 && i3.b > 0) { - c2 = (sCb(h.b > 0), BD(h.a.Xb(h.c = --h.b), 33)); - d = (sCb(i3.b > 0), BD(i3.a.Xb(i3.c = --i3.b), 33)); - if (c2 == d) { - g = c2; - } else { - break; - } - } - return g; - } - function Cub(a, b) { - var c2, d, e, f2, g, h; - f2 = a.a * kke + a.b * 1502; - h = a.b * kke + 11; - c2 = $wnd.Math.floor(h * lke); - f2 += c2; - h -= c2 * mke; - f2 %= mke; - a.a = f2; - a.b = h; - if (b <= 24) { - return $wnd.Math.floor(a.a * wub[b]); + }, "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 { - e = a.a * (1 << b - 24); - g = $wnd.Math.floor(a.b * xub[b]); - d = e + g; - d >= 2147483648 && (d -= Zje); - return d; - } - } - function Zic(a, b, c2) { - var d, e, f2, g; - if (bjc(a, b) > bjc(a, c2)) { - d = V_b(c2, (Ucd(), zcd)); - a.d = d.dc() ? 0 : B0b(BD(d.Xb(0), 11)); - g = V_b(b, Tcd); - a.b = g.dc() ? 0 : B0b(BD(g.Xb(0), 11)); + 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 { - e = V_b(c2, (Ucd(), Tcd)); - a.d = e.dc() ? 0 : B0b(BD(e.Xb(0), 11)); - f2 = V_b(b, zcd); - a.b = f2.dc() ? 0 : B0b(BD(f2.Xb(0), 11)); - } - } - function l6d(a) { - var b, c2, d, e, f2, g, h; - if (a) { - b = a.Hh(_ve); - if (b) { - g = GD(AAd((!b.b && (b.b = new sId((jGd(), fGd), x6, b)), b.b), "conversionDelegates")); - if (g != null) { - h = new Rkb(); - for (d = mfb(g, "\\w+"), e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - h.c[h.c.length] = c2; - } - return h; - } - } - } - return mmb(), mmb(), jmb; - } - function FKb(a, b) { - var c2, d, e, f2; - c2 = a.o.a; - for (f2 = BD(BD(Qc(a.r, b), 21), 84).Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 111); - e.e.a = c2 * Edb(ED(e.b.We(BKb))); - e.e.b = (d = e.b, d.Xe((Y9c(), s9c)) ? d.Hf() == (Ucd(), Acd) ? -d.rf().b - Edb(ED(d.We(s9c))) : Edb(ED(d.We(s9c))) : d.Hf() == (Ucd(), Acd) ? -d.rf().b : 0); - } - } - function Woc(a) { - var b, c2, d, e, f2, g, h, i3; - b = true; - e = null; - f2 = null; - j: - for (i3 = new olb(a.a); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 10); - for (d = new Sr(ur(R_b(h).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 17); - 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 OOc(a, b, c2) { - var d, e, f2, g, h, i3; - f2 = -1; - h = -1; - for (g = 0; g < b.c.length; g++) { - e = (tCb(g, b.c.length), BD(b.c[g], 329)); - if (e.c > a.c) { - break; - } else if (e.a >= a.s) { - f2 < 0 && (f2 = g); - h = g; - } - } - i3 = (a.s + a.c) / 2; - if (f2 >= 0) { - d = NOc(a, b, f2, h); - i3 = $Oc((tCb(d, b.c.length), BD(b.c[d], 329))); - YOc(b, d, c2); - } - return i3; - } - function lZc() { - lZc = ccb; - RYc = new Osd((Y9c(), r8c), 1.3); - VYc = I8c; - gZc = new q0b(15); - fZc = new Osd(f9c, gZc); - jZc = new Osd(T9c, 15); - SYc = w8c; - _Yc = Y8c; - aZc = _8c; - bZc = b9c; - $Yc = W8c; - cZc = e9c; - hZc = x9c; - eZc = (OYc(), KYc); - ZYc = IYc; - dZc = JYc; - iZc = MYc; - WYc = HYc; - XYc = O8c; - YYc = P8c; - UYc = GYc; - TYc = FYc; - kZc = NYc; - } - function Bnd(a, b, c2) { - var d, e, f2, g, h, i3, j; - g = (f2 = new RHd(), f2); - PHd(g, (uCb(b), b)); - j = (!g.b && (g.b = new sId((jGd(), fGd), x6, g)), g.b); - for (i3 = 1; i3 < c2.length; i3 += 2) { - HAd(j, c2[i3 - 1], c2[i3]); - } - d = (!a.Ab && (a.Ab = new cUd(a5, a, 0, 3)), a.Ab); - for (h = 0; h < 0; ++h) { - e = LHd(BD(qud(d, d.i - 1), 590)); - d = e; - } - wtd(d, g); - } - function MPb(a, b, c2) { - var d, e, f2; - sNb.call(this, new Rkb()); - this.a = b; - this.b = c2; - this.e = a; - d = (a.b && LOb(a), a.a); - this.d = KPb(d.a, this.a); - this.c = KPb(d.b, this.b); - kNb(this, this.d, this.c); - LPb(this); - for (f2 = this.e.e.a.ec().Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 266); - e.c.c.length > 0 && JPb(this, e); - } - } - function IQb(a, b, c2, d, e, f2) { - var g, h, i3; - if (!e[b.b]) { - e[b.b] = true; - g = d; - !g && (g = new kRb()); - Ekb(g.e, b); - for (i3 = f2[b.b].Kc(); i3.Ob(); ) { - h = BD(i3.Pb(), 282); - if (h.d == c2 || h.c == c2) { - continue; - } - h.c != b && IQb(a, h.c, b, g, e, f2); - h.d != b && IQb(a, h.d, b, g, e, f2); - Ekb(g.c, h); - Gkb(g.d, h.b); - } - return g; - } - return null; - } - function e4b(a) { - var b, c2, d, e, f2, g, h; - b = 0; - for (e = new olb(a.e); e.a < e.c.c.length; ) { - d = BD(mlb(e), 17); - c2 = FAb(new YAb(null, new Kub(d.b, 16)), new w4b()); - c2 && ++b; - } - for (g = new olb(a.g); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 17); - h = FAb(new YAb(null, new Kub(f2.b, 16)), new y4b()); - h && ++b; - } - return b >= 2; - } - function gec(a, b) { - var c2, d, e, f2; - Odd(b, "Self-Loop pre-processing", 1); - for (d = new olb(a.a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 10); - if (Ljc(c2)) { - e = (f2 = new Kjc(c2), yNb(c2, (wtc(), ntc), f2), Hjc(f2), f2); - MAb(NAb(LAb(new YAb(null, new Kub(e.d, 16)), new jec()), new lec()), new nec()); - eec(e); - } - } - Qdd(b); - } - function vnc(a, b, c2, d, e) { - var f2, g, h, i3, j, k; - f2 = a.c.d.j; - g = BD(Ut(c2, 0), 8); - for (k = 1; k < c2.b; k++) { - j = BD(Ut(c2, k), 8); - Gsb(d, g, d.c.b, d.c); - h = Y6c(P6c(new g7c(g), j), 0.5); - i3 = Y6c(new e7c(bRc(f2)), e); - P6c(h, i3); - Gsb(d, h, d.c.b, d.c); - g = j; - f2 = b == 0 ? Xcd(f2) : Vcd(f2); - } - Dsb(d, (sCb(c2.b != 0), BD(c2.c.b.c, 8))); - } - function Jbd(a) { - Hbd(); - var b, c2, d; - c2 = qqb(Cbd, OC(GC(B1, 1), Kie, 93, 0, [Dbd])); - if (Ox(Cx(c2, a)) > 1) { - return false; - } - b = qqb(zbd, OC(GC(B1, 1), Kie, 93, 0, [ybd, Bbd])); - if (Ox(Cx(b, a)) > 1) { - return false; - } - d = qqb(Gbd, OC(GC(B1, 1), Kie, 93, 0, [Fbd, Ebd])); - if (Ox(Cx(d, a)) > 1) { - return false; - } - return true; - } - function U0d(a, b) { - var c2, d, e; - c2 = b.Hh(a.a); - if (c2) { - e = GD(AAd((!c2.b && (c2.b = new sId((jGd(), fGd), x6, c2)), c2.b), "affiliation")); - if (e != null) { - d = kfb(e, wfb(35)); - return d == -1 ? l1d(a, u1d(a, bKd(b.Hj())), e) : d == 0 ? l1d(a, null, e.substr(1)) : l1d(a, e.substr(0, d), e.substr(d + 1)); - } - } - return null; - } - function ic(b) { - var c2, d, e; - try { - return b == null ? Xhe : fcb(b); - } catch (a) { - a = ubb(a); - if (JD(a, 102)) { - c2 = a; - e = hdb(rb(b)) + "@" + (d = (Zfb(), kCb(b)) >>> 0, d.toString(16)); - tyb(xyb(), ($xb(), "Exception during lenientFormat for " + e), c2); - return "<" + e + " threw " + hdb(c2.gm) + ">"; - } else - throw vbb(a); - } - } - function mzc(a) { - switch (a.g) { + 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 new xDc(); + break; case 1: - return new ZCc(); + break; case 2: - return new DCc(); + return 10; + break; case 3: - return new QCc(); + break; case 4: - return new LDc(); + break; case 5: - return new iDc(); - default: - throw vbb(new Wdb("No implementation is available for the layerer " + (a.f != null ? a.f : "" + a.g))); - } - } - function AQc(a, b, c2) { - var d, e, f2; - for (f2 = new olb(a.t); f2.a < f2.c.c.length; ) { - d = BD(mlb(f2), 268); - if (d.b.s < 0 && d.c > 0) { - d.b.n -= d.c; - d.b.n <= 0 && d.b.u > 0 && Dsb(b, d.b); - } - } - for (e = new olb(a.i); e.a < e.c.c.length; ) { - d = BD(mlb(e), 268); - if (d.a.s < 0 && d.c > 0) { - d.a.u -= d.c; - d.a.u <= 0 && d.a.n > 0 && Dsb(c2, d.a); - } - } - } - function Vud(a) { - var b, c2, d, e, f2; - if (a.g == null) { - a.d = a.si(a.f); - wtd(a, a.d); - if (a.c) { - f2 = a.f; - return f2; - } - } - b = BD(a.g[a.i - 1], 47); - e = b.Pb(); - a.e = b; - c2 = a.si(e); - if (c2.Ob()) { - a.d = c2; - wtd(a, c2); - } else { - a.d = null; - while (!b.Ob()) { - NC(a.g, --a.i, null); - if (a.i == 0) { - break; - } - d = BD(a.g[a.i - 1], 47); - b = d; - } + 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; } - return e; - } - function r2d(a, b) { - var c2, d, e, f2, g, h; - d = b; - e = d.ak(); - if (T6d(a.e, e)) { - if (e.hi() && E2d(a, e, d.dd())) { - return false; - } + }, "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; + }(); + parser22.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser22; + parser22.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(diagram24) { + 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(diagram24, circleData); + const labelData = { + x: 40, + y: yPos + 7, + fill: "#666", + text: person, + textMargin: conf8.boxTextMargin | 5 + }; + svgDraw_default4.drawText(diagram24, 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, id27, version4, diagObj) { + const conf8 = getConfig2().journey; + const securityLevel = getConfig2().securityLevel; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id27); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + bounds2.init(); + const diagram24 = root4.select("#" + id27); + svgDraw_default4.initGraphics(diagram24); + 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(diagram24); + bounds2.insert(0, 0, LEFT_MARGIN, Object.keys(actors).length * 50); + drawTasks(diagram24, tasks4, 0); + const box = bounds2.getBounds(); + if (title2) { + diagram24.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(diagram24, height2, width3, conf8.useMaxWidth); + diagram24.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; + diagram24.attr("viewBox", `${box.startx} -25 ${width3} ${height2 + extraVertForTitle}`); + diagram24.attr("preserveAspectRatio", "xMinYMin meet"); + diagram24.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(diagram24, 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 { - h = S6d(a.e.Tg(), e); - c2 = BD(a.g, 119); - for (f2 = 0; f2 < a.i; ++f2) { - g = c2[f2]; - if (h.rl(g.ak())) { - if (pb(g, d)) { - return false; - } else { - BD(Gtd(a, f2, b), 72); - return true; - } - } - } - } - return wtd(a, b); - } - function r9b(a, b, c2, d) { - var e, f2, g, h; - e = new b0b(a); - __b(e, (j0b(), f0b)); - yNb(e, (wtc(), $sc), b); - yNb(e, ktc, d); - yNb(e, (Nyc(), Vxc), (dcd(), $bd)); - yNb(e, Vsc, b.c); - yNb(e, Wsc, b.d); - zbc(b, e); - h = $wnd.Math.floor(c2 / 2); - for (g = new olb(e.j); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 11); - f2.n.b = h; - } - return e; - } - function wac(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - i3 = Pu(a.c - a.b & a.a.length - 1); - j = null; - k = null; - for (f2 = new xkb(a); f2.a != f2.b; ) { - e = BD(vkb(f2), 10); - c2 = (h = BD(vNb(e, (wtc(), Vsc)), 11), !h ? null : h.i); - d = (g = BD(vNb(e, Wsc), 11), !g ? null : g.i); - if (j != c2 || k != d) { - Aac(i3, b); - j = c2; - k = d; - } - i3.c[i3.c.length] = e; - } - Aac(i3, b); - } - function HNc(a) { - var b, c2, d, e, f2, g, h; - b = 0; - for (d = new olb(a.a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 10); - for (f2 = new Sr(ur(U_b(c2).a.Kc(), new Sq())); Qr(f2); ) { - e = BD(Rr(f2), 17); - if (a == e.d.i.c && e.c.j == (Ucd(), Tcd)) { - g = A0b(e.c).b; - h = A0b(e.d).b; - b = $wnd.Math.max(b, $wnd.Math.abs(h - g)); - } - } - } - return b; - } - function aWc(a, b, c2) { - var d, e, f2; - Odd(c2, "Remove overlaps", 1); - c2.n && !!b && Tdd(c2, i6d(b), (pgd(), mgd)); - d = BD(hkd(b, (MUc(), LUc)), 33); - a.f = d; - a.a = tXc(BD(hkd(b, (ZWc(), WWc)), 293)); - e = ED(hkd(b, (Y9c(), T9c))); - FVc(a, (uCb(e), e)); - f2 = gVc(d); - _Vc(a, b, f2, c2); - c2.n && !!b && Tdd(c2, i6d(b), (pgd(), mgd)); - } - function aYb(a, b, c2) { - switch (c2.g) { - case 1: - return new f7c(b.a, $wnd.Math.min(a.d.b, b.b)); - case 2: - return new f7c($wnd.Math.max(a.c.a, b.a), b.b); - case 3: - return new f7c(b.a, $wnd.Math.max(a.c.b, b.b)); - case 4: - return new f7c($wnd.Math.min(b.a, a.d.a), b.b); + break; } - return new f7c(b.a, b.b); } - function mFc(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m; - l = d ? (Ucd(), Tcd) : (Ucd(), zcd); - e = false; - for (i3 = b[c2], j = 0, k = i3.length; j < k; ++j) { - h = i3[j]; - if (ecd(BD(vNb(h, (Nyc(), Vxc)), 98))) { - continue; - } - g = h.e; - m = !V_b(h, l).dc() && !!g; - if (m) { - f2 = WZb(g); - a.b = new sic(f2, d ? 0 : f2.length - 1); - } - e = e | nFc(a, h, l, m); - } - return e; + const section = { + x: i2 * conf8.taskMargin + i2 * conf8.width + LEFT_MARGIN, + y: 50, + text: task.section, + fill, + num, + colour, + taskCount: taskInSectionCount + }; + svgDraw_default4.drawSection(diagram24, 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(diagram24, 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 parser22 = { + 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 $sd(a) { - var b, c2, d; - b = Pu(1 + (!a.c && (a.c = new cUd(F2, a, 9, 9)), a.c).i); - Ekb(b, (!a.d && (a.d = new y5d(B2, a, 8, 5)), a.d)); - for (d = new Fyd((!a.c && (a.c = new cUd(F2, a, 9, 9)), a.c)); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 118); - Ekb(b, (!c2.d && (c2.d = new y5d(B2, c2, 8, 5)), c2.d)); - } - return Qb(b), new sl(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 _sd(a) { - var b, c2, d; - b = Pu(1 + (!a.c && (a.c = new cUd(F2, a, 9, 9)), a.c).i); - Ekb(b, (!a.e && (a.e = new y5d(B2, a, 7, 4)), a.e)); - for (d = new Fyd((!a.c && (a.c = new cUd(F2, a, 9, 9)), a.c)); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 118); - Ekb(b, (!c2.e && (c2.e = new y5d(B2, c2, 7, 4)), c2.e)); - } - return Qb(b), new sl(b); + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - function M9d(a) { - var b, c2, d, e; - if (a == null) { - return null; - } else { - d = Qge(a, true); - e = Nwe.length; - if (dfb(d.substr(d.length - e, e), Nwe)) { - c2 = d.length; - if (c2 == 4) { - b = (BCb(0, d.length), d.charCodeAt(0)); - if (b == 43) { - return x9d; - } else if (b == 45) { - return w9d; - } - } else if (c2 == 3) { - return x9d; - } + __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(); } - return Hcb(d); + token2 = self2.symbols_[token2] || token2; } + return token2; } - function aKc(a) { - var b, c2, d, e; - b = 0; - c2 = 0; - for (e = new olb(a.j); e.a < e.c.c.length; ) { - d = BD(mlb(e), 11); - b = Tbb(wbb(b, HAb(JAb(new YAb(null, new Kub(d.e, 16)), new nLc())))); - c2 = Tbb(wbb(c2, HAb(JAb(new YAb(null, new Kub(d.g, 16)), new pLc())))); - if (b > 1 || c2 > 1) { - return 2; + __name(lex2, "lex"); + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); } + action = table[state5] && table[state5][symbol]; } - if (b + c2 == 1) { - return 2; - } - return 0; - } - function WQb(a, b, c2) { - var d, e, f2, g, h; - Odd(c2, "ELK Force", 1); - Ccb(DD(hkd(b, (wSb(), jSb)))) || $Cb((d = new _Cb((Pgd(), new bhd(b))), d)); - h = TQb(b); - XQb(h); - YQb(a, BD(vNb(h, fSb), 424)); - g = LQb(a.a, h); - for (f2 = g.Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 231); - tRb(a.b, e, Udd(c2, 1 / g.gc())); - } - h = KQb(g); - SQb(h); - Qdd(c2); - } - function yoc(a, b) { - var c2, d, e, f2, g; - Odd(b, "Breaking Point Processor", 1); - xoc(a); - if (Ccb(DD(vNb(a, (Nyc(), Jyc))))) { - for (e = new olb(a.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 29); - c2 = 0; - for (g = new olb(d.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 10); - f2.p = c2++; - } - } - soc(a); - toc(a, true); - toc(a, false); - } - Qdd(b); - } - function $1c(a, b, c2) { - var d, e, f2, g, h, i3; - h = a.c; - for (g = (!c2.q ? (mmb(), mmb(), kmb) : c2.q).vc().Kc(); g.Ob(); ) { - f2 = BD(g.Pb(), 42); - d = !WAb(JAb(new YAb(null, new Kub(h, 16)), new Xxb(new m2c(b, f2)))).sd((EAb(), DAb)); - if (d) { - i3 = f2.dd(); - if (JD(i3, 4)) { - e = fvd(i3); - e != null && (i3 = e); - } - b.Ye(BD(f2.cd(), 146), i3); - } - } - } - function MQd(a, b) { - var c2, d, e, f2, g; - if (!b) { - return null; - } else { - f2 = JD(a.Cb, 88) || JD(a.Cb, 99); - g = !f2 && JD(a.Cb, 322); - for (d = new Fyd((!b.a && (b.a = new KYd(b, j5, b)), b.a)); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 87); - e = KQd(c2); - if (f2 ? JD(e, 88) : g ? JD(e, 148) : !!e) { - return e; - } - } - return f2 ? (jGd(), _Fd) : (jGd(), YFd); - } - } - function g3b(a, b) { - var c2, d, e, f2, g, h; - Odd(b, "Constraints Postprocessor", 1); - g = 0; - for (f2 = new olb(a.b); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 29); - h = 0; - for (d = new olb(e.a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 10); - if (c2.k == (j0b(), h0b)) { - yNb(c2, (Nyc(), nxc), meb(g)); - yNb(c2, Gwc, meb(h)); - ++h; - } - } - ++g; - } - Qdd(b); - } - function eRc(a, b, c2, d) { - var e, f2, g, h, i3, j, k; - i3 = new f7c(c2, d); - c7c(i3, BD(vNb(b, (mTc(), WSc)), 8)); - for (k = Jsb(b.b, 0); k.b != k.d.c; ) { - j = BD(Xsb(k), 86); - P6c(j.e, i3); - Dsb(a.b, j); - } - for (h = Jsb(b.a, 0); h.b != h.d.c; ) { - g = BD(Xsb(h), 188); - for (f2 = Jsb(g.a, 0); f2.b != f2.d.c; ) { - e = BD(Xsb(f2), 8); - P6c(e, i3); - } - Dsb(a.a, g); - } - } - function uid(a, b, c2) { - var d, e, f2; - f2 = e1d((O6d(), M6d), a.Tg(), b); - if (f2) { - Q6d(); - if (!BD(f2, 66).Oj()) { - f2 = _1d(q1d(M6d, f2)); - if (!f2) { - throw vbb(new Wdb(ite + b.ne() + jte)); - } - } - e = (d = a.Yg(f2), BD(d >= 0 ? a._g(d, true, true) : sid(a, f2, true), 153)); - BD(e, 215).ml(b, c2); - } else { - throw vbb(new Wdb(ite + b.ne() + jte)); - } - } - function ROc(a, b) { - var c2, d, e, f2, g; - c2 = new Rkb(); - e = LAb(new YAb(null, new Kub(a, 16)), new iPc()); - f2 = LAb(new YAb(null, new Kub(a, 16)), new kPc()); - g = aAb(_zb(OAb(ty(OC(GC(xM, 1), Uhe, 833, 0, [e, f2])), new mPc()))); - for (d = 1; d < g.length; d++) { - g[d] - g[d - 1] >= 2 * b && Ekb(c2, new bPc(g[d - 1] + b, g[d] - b)); - } - return c2; - } - function AXc(a, b, c2) { - Odd(c2, "Eades radial", 1); - c2.n && !!b && Tdd(c2, i6d(b), (pgd(), mgd)); - a.d = BD(hkd(b, (MUc(), LUc)), 33); - a.c = Edb(ED(hkd(b, (ZWc(), VWc)))); - a.e = tXc(BD(hkd(b, WWc), 293)); - a.a = gWc(BD(hkd(b, YWc), 426)); - a.b = jXc(BD(hkd(b, RWc), 340)); - BXc(a); - c2.n && !!b && Tdd(c2, i6d(b), (pgd(), mgd)); - } - function Fqd(a, b, c2) { - var d, e, f2, g, h, j, k, l; - if (c2) { - f2 = c2.a.length; - d = new Yge(f2); - for (h = (d.b - d.a) * d.c < 0 ? (Xge(), Wge) : new she(d); h.Ob(); ) { - g = BD(h.Pb(), 19); - e = Zpd(c2, g.a); - !!e && (j = Uqd(a, (k = (Fhd(), l = new ppd(), l), !!b && npd(k, b), k), e), Lkd(j, _pd(e, Vte)), grd(e, j), hrd(e, j), crd(a, e, j)); - } - } - } - function UKd(a) { - var b, c2, d, e, f2, g; - if (!a.j) { - g = new HPd(); - b = KKd; - f2 = b.a.zc(a, b); - if (f2 == null) { - for (d = new Fyd(_Kd(a)); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 26); - e = UKd(c2); - ytd(g, e); - wtd(g, c2); - } - b.a.Bc(a) != null; - } - vud(g); - a.j = new nNd((BD(qud(ZKd((NFd(), MFd).o), 11), 18), g.i), g.g); - $Kd(a).b &= -33; - } - return a.j; - } - function O9d(a) { - var b, c2, d, e; - if (a == null) { - return null; - } else { - d = Qge(a, true); - e = Nwe.length; - if (dfb(d.substr(d.length - e, e), Nwe)) { - c2 = d.length; - if (c2 == 4) { - b = (BCb(0, d.length), d.charCodeAt(0)); - if (b == 43) { - return z9d; - } else if (b == 45) { - return y9d; - } - } else if (c2 == 3) { - return z9d; + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state5]) { + if (this.terminals_[p3] && p3 > TERROR) { + expected.push("'" + this.terminals_[p3] + "'"); } } - return new Odb(d); - } - } - function _C(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 ieb(c2); - } - if (b == 0 && d != 0 && c2 == 0) { - return ieb(d) + 22; - } - if (b != 0 && d == 0 && c2 == 0) { - return ieb(b) + 44; + 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 + }); } - return -1; - } - function qbc(a, b) { - var c2, d, e, f2, g; - Odd(b, "Edge joining", 1); - c2 = Ccb(DD(vNb(a, (Nyc(), Byc)))); - for (e = new olb(a.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 29); - g = new Bib(d.a, 0); - while (g.b < g.d.gc()) { - f2 = (sCb(g.b < g.d.gc()), BD(g.d.Xb(g.c = g.b++), 10)); - if (f2.k == (j0b(), g0b)) { - sbc(f2, c2); - uib(g); - } - } - } - Qdd(b); - } - function c_c(a, b, c2) { - var d, e; - H2c(a.b); - K2c(a.b, (Y$c(), V$c), (R0c(), Q0c)); - K2c(a.b, W$c, b.g); - K2c(a.b, X$c, b.a); - a.a = F2c(a.b, b); - Odd(c2, "Compaction by shrinking a tree", a.a.c.length); - if (b.i.c.length > 1) { - for (e = new olb(a.a); e.a < e.c.c.length; ) { - d = BD(mlb(e), 51); - d.pf(b, Udd(c2, 1)); - } - } - Qdd(c2); - } - function mo(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 eNb(a) { - var b, c2, d, e, f2, g, h, i3, j, k; - c2 = a.o; - b = a.p; - g = Ohe; - e = Rie; - h = Ohe; - f2 = Rie; - for (j = 0; j < c2; ++j) { - for (k = 0; k < b; ++k) { - if (YMb(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); - } - } - } - i3 = e - g + 1; - d = f2 - h + 1; - return new Ggd(meb(g), meb(h), meb(i3), meb(d)); - } - function DWb(a, b) { - var c2, d, e, f2; - f2 = new Bib(a, 0); - c2 = (sCb(f2.b < f2.d.gc()), BD(f2.d.Xb(f2.c = f2.b++), 140)); - while (f2.b < f2.d.gc()) { - d = (sCb(f2.b < f2.d.gc()), BD(f2.d.Xb(f2.c = f2.b++), 140)); - e = new dWb(d.c, c2.d, b); - sCb(f2.b > 0); - f2.a.Xb(f2.c = --f2.b); - Aib(f2, e); - sCb(f2.b < f2.d.gc()); - f2.d.Xb(f2.c = f2.b++); - e.a = false; - c2 = d; - } - } - function Y2b(a) { - var b, c2, d, e, f2, g; - e = BD(vNb(a, (wtc(), vsc)), 11); - for (g = new olb(a.j); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 11); - for (d = new olb(f2.g); d.a < d.c.c.length; ) { - b = BD(mlb(d), 17); - RZb(b, e); - return f2; - } - for (c2 = new olb(f2.e); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 17); - QZb(b, e); - return f2; - } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } - return null; - } - function iA(a, b, c2) { - var d, e; - d = Cbb(c2.q.getTime()); - if (ybb(d, 0) < 0) { - e = _ie - Tbb(Hbb(Jbb(d), _ie)); - e == _ie && (e = 0); - } else { - e = Tbb(Hbb(d, _ie)); - } - if (b == 1) { - e = $wnd.Math.min((e + 50) / 100 | 0, 9); - Kfb(a, 48 + e & aje); - } else if (b == 2) { - e = $wnd.Math.min((e + 5) / 10 | 0, 99); - EA(a, e, 2); - } else { - EA(a, e, 3); - b > 3 && EA(a, 0, b - 3); - } - } - function cUb(a) { - var b, c2, d, e; - if (PD(vNb(a, (Nyc(), axc))) === PD((hbd(), ebd))) { - return !a.e && PD(vNb(a, Cwc)) !== PD((Xrc(), Urc)); - } - d = BD(vNb(a, Dwc), 292); - e = Ccb(DD(vNb(a, Hwc))) || PD(vNb(a, Iwc)) === PD((Rpc(), Opc)); - b = BD(vNb(a, Bwc), 19).a; - c2 = a.a.c.length; - return !e && d != (Xrc(), Urc) && (b == 0 || b > c2); - } - function lkc(a) { - var b, c2; - c2 = 0; - for (; c2 < a.c.length; c2++) { - if (Ojc((tCb(c2, a.c.length), BD(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 (Ojc((tCb(b, a.c.length), BD(a.c[b], 113))) > 0) { - break; - } - } - if (b > 0 && c2 < a.c.length - 1) { - return b; - } - return a.c.length / 2 | 0; - } - function mmd(a, b) { - var c2, d; - if (b != a.Cb || a.Db >> 16 != 6 && !!b) { - if (p6d(a, b)) - throw vbb(new Wdb(ste + qmd(a))); - d = null; - !!a.Cb && (d = (c2 = a.Db >> 16, c2 >= 0 ? cmd(a, d) : a.Cb.ih(a, -1 - c2, null, d))); - !!b && (d = kid(b, a, 6, d)); - d = bmd(a, b, d); - !!d && d.Fi(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 6, b, b)); - } - function npd(a, b) { - var c2, d; - if (b != a.Cb || a.Db >> 16 != 9 && !!b) { - if (p6d(a, b)) - throw vbb(new Wdb(ste + opd(a))); - d = null; - !!a.Cb && (d = (c2 = a.Db >> 16, c2 >= 0 ? lpd(a, d) : a.Cb.ih(a, -1 - c2, null, d))); - !!b && (d = kid(b, a, 9, d)); - d = kpd(a, b, d); - !!d && d.Fi(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 9, b, b)); - } - function Rld(a, b) { - var c2, d; - if (b != a.Cb || a.Db >> 16 != 3 && !!b) { - if (p6d(a, b)) - throw vbb(new Wdb(ste + Sld(a))); - d = null; - !!a.Cb && (d = (c2 = a.Db >> 16, c2 >= 0 ? Lld(a, d) : a.Cb.ih(a, -1 - c2, null, d))); - !!b && (d = kid(b, a, 12, d)); - d = Kld(a, b, d); - !!d && d.Fi(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 3, b, b)); - } - function VId(b) { - var c2, d, e, f2, g; - e = wId(b); - g = b.j; - if (g == null && !!e) { - return b.$j() ? null : e.zj(); - } else if (JD(e, 148)) { - d = e.Aj(); - if (d) { - f2 = d.Nh(); - if (f2 != b.i) { - c2 = BD(e, 148); - if (c2.Ej()) { - try { - b.g = f2.Kh(c2, g); - } catch (a) { - a = ubb(a); - if (JD(a, 78)) { - b.g = null; - } else - throw vbb(a); - } + 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--; } - b.i = f2; + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; } - } - return b.g; + 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 null; } - function wOb(a) { - var b; - b = new Rkb(); - Ekb(b, new aDb(new f7c(a.c, a.d), new f7c(a.c + a.b, a.d))); - Ekb(b, new aDb(new f7c(a.c, a.d), new f7c(a.c, a.d + a.a))); - Ekb(b, new aDb(new f7c(a.c + a.b, a.d + a.a), new f7c(a.c + a.b, a.d))); - Ekb(b, new aDb(new f7c(a.c + a.b, a.d + a.a), new f7c(a.c, a.d + a.a))); - return b; - } - function IJc(a, b, c2, d) { - var e, f2, g; - g = LZb(b, c2); - d.c[d.c.length] = 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 Sr(ur(O_b(g).a.Kc(), new Sq())); Qr(f2); ) { - e = BD(Rr(f2), 17); - if (!(!OZb(e) && !(!OZb(e) && e.c.i.c == e.d.i.c)) || e == b) { - continue; - } - return IJc(a, e, g, d); - } - return d; - } - function vQb(a, b, c2) { - var d, e, f2; - for (f2 = b.a.ec().Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 79); - d = BD(Ohb(a.b, e), 266); - !d && (Xod(jtd(e)) == Xod(ltd(e)) ? uQb(a, e, c2) : jtd(e) == Xod(ltd(e)) ? Ohb(a.c, e) == null && Ohb(a.b, ltd(e)) != null && xQb(a, e, c2, false) : Ohb(a.d, e) == null && Ohb(a.b, jtd(e)) != null && xQb(a, e, c2, true)); - } - } - function jcc(a, b) { - var c2, d, e, f2, g, h, i3; - for (e = a.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 10); - h = new H0b(); - F0b(h, d); - G0b(h, (Ucd(), zcd)); - yNb(h, (wtc(), ftc), (Bcb(), true)); - for (g = b.Kc(); g.Ob(); ) { - f2 = BD(g.Pb(), 10); - i3 = new H0b(); - F0b(i3, f2); - G0b(i3, Tcd); - yNb(i3, ftc, true); - c2 = new UZb(); - yNb(c2, ftc, true); - QZb(c2, h); - RZb(c2, i3); - } - } - } - function jnc(a, b, c2, d) { - var e, f2, g, h; - e = hnc(a, b, c2); - f2 = hnc(a, c2, b); - g = BD(Ohb(a.c, b), 112); - h = BD(Ohb(a.c, c2), 112); - if (e < f2) { - new DOc((HOc(), GOc), g, h, f2 - e); - } else if (f2 < e) { - new DOc((HOc(), GOc), h, g, e - f2); - } else if (e != 0 || !(!b.i || !c2.i) && d[b.i.c][c2.i.c]) { - new DOc((HOc(), GOc), g, h, 0); - new DOc(GOc, h, g, 0); - } - } - function Qoc(a, b) { - var c2, d, e, f2, g, h, i3; - e = 0; - for (g = new olb(b.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 10); - e += f2.o.b + f2.d.a + f2.d.d + a.e; - for (d = new Sr(ur(R_b(f2).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 17); - if (c2.c.i.k == (j0b(), i0b)) { - i3 = c2.c.i; - h = BD(vNb(i3, (wtc(), $sc)), 10); - e += h.o.b + h.d.a + h.d.d; - } - } - } - return e; - } - function WNc(a, b, c2) { - var d, e, f2, g, h, i3, j; - f2 = new Rkb(); - j = new Psb(); - g = new Psb(); - XNc(a, j, g, b); - VNc(a, j, g, b, c2); - for (i3 = new olb(a); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 112); - for (e = new olb(h.k); e.a < e.c.c.length; ) { - d = BD(mlb(e), 129); - (!b || d.c == (HOc(), FOc)) && h.g > d.b.g && (f2.c[f2.c.length] = d, true); - } - } - return f2; - } - function k$c() { - k$c = ccb; - g$c = new l$c("CANDIDATE_POSITION_LAST_PLACED_RIGHT", 0); - f$c = new l$c("CANDIDATE_POSITION_LAST_PLACED_BELOW", 1); - i$c = new l$c("CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT", 2); - h$c = new l$c("CANDIDATE_POSITION_WHOLE_DRAWING_BELOW", 3); - j$c = new l$c("WHOLE_DRAWING", 4); - } - function Xqd(a, b) { - if (JD(b, 239)) { - return iqd(a, BD(b, 33)); - } else if (JD(b, 186)) { - return jqd(a, BD(b, 118)); - } else if (JD(b, 354)) { - return hqd(a, BD(b, 137)); - } else if (JD(b, 352)) { - return gqd(a, BD(b, 79)); - } else if (b) { - return null; - } else { - throw vbb(new Wdb(Xte + Fe(new amb(OC(GC(SI, 1), Uhe, 1, 5, [b]))))); - } - } - function aic(a) { - var b, c2, d, e, f2, g, h; - f2 = new Psb(); - for (e = new olb(a.d.a); e.a < e.c.c.length; ) { - d = BD(mlb(e), 121); - d.b.a.c.length == 0 && (Gsb(f2, d, f2.c.b, f2.c), true); - } - if (f2.b > 1) { - b = nGb((c2 = new pGb(), ++a.b, c2), a.d); - for (h = Jsb(f2, 0); h.b != h.d.c; ) { - g = BD(Xsb(h), 121); - AFb(DFb(CFb(EFb(BFb(new FFb(), 1), 0), b), g)); - } - } - } - function $od(a, b) { - var c2, d; - if (b != a.Cb || a.Db >> 16 != 11 && !!b) { - if (p6d(a, b)) - throw vbb(new Wdb(ste + _od(a))); - d = null; - !!a.Cb && (d = (c2 = a.Db >> 16, c2 >= 0 ? Uod(a, d) : a.Cb.ih(a, -1 - c2, null, d))); - !!b && (d = kid(b, a, 10, d)); - d = Tod(a, b, d); - !!d && d.Fi(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 11, b, b)); - } - function uZb(a) { - var b, c2, d, e; - for (d = new nib(new eib(a.b).a); d.b; ) { - c2 = lib(d); - e = BD(c2.cd(), 11); - b = BD(c2.dd(), 10); - yNb(b, (wtc(), $sc), e); - yNb(e, gtc, b); - yNb(e, Nsc, (Bcb(), true)); - G0b(e, BD(vNb(b, Hsc), 61)); - vNb(b, Hsc); - yNb(e.i, (Nyc(), Vxc), (dcd(), acd)); - BD(vNb(Q_b(e.i), Ksc), 21).Fc((Orc(), Krc)); - } - } - function G4b(a, b, c2) { - var d, e, f2, g, h, i3; - f2 = 0; - g = 0; - if (a.c) { - for (i3 = new olb(a.d.i.j); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 11); - f2 += h.e.c.length; - } + 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 { - f2 = 1; + 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]; } - if (a.d) { - for (i3 = new olb(a.c.i.j); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 11); - g += h.g.c.length; - } + 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 { - g = 1; - } - e = QD(Eeb(g - f2)); - d = (c2 + b) / 2 + (c2 - b) * (0.4 * e); - return d; - } - function Zjc(a) { - Xjc(); - var b, c2; - if (a.Hc((Ucd(), Scd))) { - throw vbb(new Wdb("Port sides must not contain UNDEFINED")); + 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]; } - switch (a.gc()) { - case 1: - return Tjc; - case 2: - b = a.Hc(zcd) && a.Hc(Tcd); - c2 = a.Hc(Acd) && a.Hc(Rcd); - return b || c2 ? Wjc : Vjc; - case 3: - return Ujc; - case 4: - return Sjc; - default: - return null; + 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 Hoc(a, b, c2) { - var d, e, f2, g, h; - Odd(c2, "Breaking Point Removing", 1); - a.a = BD(vNb(b, (Nyc(), Swc)), 218); - for (f2 = new olb(b.b); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 29); - for (h = new olb(Mu(e.a)); h.a < h.c.c.length; ) { - g = BD(mlb(h), 10); - if (hoc(g)) { - d = BD(vNb(g, (wtc(), usc)), 305); - !d.d && Ioc(a, d); - } + 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); } } - Qdd(c2); - } - function s6c(a, b, c2) { - i6c(); - if (m6c(a, b) && m6c(a, c2)) { - return false; + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; } - return u6c(new f7c(a.c, a.d), new f7c(a.c + a.b, a.d), b, c2) || u6c(new f7c(a.c + a.b, a.d), new f7c(a.c + a.b, a.d + a.a), b, c2) || u6c(new f7c(a.c + a.b, a.d + a.a), new f7c(a.c, a.d + a.a), b, c2) || u6c(new f7c(a.c, a.d + a.a), new f7c(a.c, a.d), b, c2); - } - function x1d(a, b) { - var c2, d, e, f2; - if (!a.dc()) { - for (c2 = 0, d = a.gc(); c2 < d; ++c2) { - f2 = GD(a.Xb(c2)); - if (f2 == null ? b == null : dfb(f2.substr(0, 3), "!##") ? b != null && (e = b.length, !dfb(f2.substr(f2.length - e, e), b) || f2.length != b.length + 3) && !dfb(Ewe, b) : dfb(f2, Fwe) && !dfb(Ewe, b) || dfb(f2, b)) { - return true; - } + 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; - } - function J3b(a, b, c2, d) { - var e, f2, g, h, i3, j; - g = a.j.c.length; - i3 = KC(tN, ile, 306, g, 0, 1); - for (h = 0; h < g; h++) { - f2 = BD(Ikb(a.j, h), 11); - f2.p = h; - i3[h] = D3b(N3b(f2), c2, d); - } - F3b(a, i3, c2, b, d); - j = new Lqb(); - for (e = 0; e < i3.length; e++) { - !!i3[e] && Rhb(j, BD(Ikb(a.j, e), 11), i3[e]); - } - if (j.f.c + j.g.c != 0) { - yNb(a, (wtc(), Csc), j); - L3b(a, i3); - } - } - function Lgc(a, b, c2) { - var d, e, f2; - for (e = new olb(a.a.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 57); - f2 = tgc(d); - if (f2) { - if (f2.k == (j0b(), e0b)) { - switch (BD(vNb(f2, (wtc(), Hsc)), 61).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); + }, "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; } } } - } - function kAc() { - kAc = ccb; - iAc = new lAc(ane, 0); - dAc = new lAc("NIKOLOV", 1); - gAc = new lAc("NIKOLOV_PIXEL", 2); - eAc = new lAc("NIKOLOV_IMPROVED", 3); - fAc = new lAc("NIKOLOV_IMPROVED_PIXEL", 4); - cAc = new lAc("DUMMYNODE_PERCENTAGE", 5); - hAc = new lAc("NODECOUNT_PERCENTAGE", 6); - jAc = new lAc("NO_BOUNDARY", 7); - } - function led(a, b, c2) { - var d, e, f2, g, h; - e = BD(hkd(b, (X7c(), V7c)), 19); - !e && (e = meb(0)); - f2 = BD(hkd(c2, V7c), 19); - !f2 && (f2 = meb(0)); - if (e.a > f2.a) { - return -1; - } else if (e.a < f2.a) { - return 1; - } else { - if (a.a) { - d = Kdb(b.j, c2.j); - if (d != 0) { - return d; - } - d = Kdb(b.i, c2.i); - if (d != 0) { - return d; - } - } - g = b.g * b.f; - h = c2.g * c2.f; - return Kdb(g, h); - } - } - function BAd(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - ++a.e; - i3 = a.d == null ? 0 : a.d.length; - if (b > i3) { - k = a.d; - a.d = KC(y4, jve, 63, 2 * i3 + 4, 0, 1); - for (f2 = 0; f2 < i3; ++f2) { - j = k[f2]; - if (j) { - d = j.g; - l = j.i; - for (h = 0; h < l; ++h) { - e = BD(d[h], 133); - g = DAd(a, e.Sh()); - c2 = a.d[g]; - !c2 && (c2 = a.d[g] = a.uj()); - c2.Fc(e); - } - } + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; } - return true; - } else { return false; } - } - function o2d(a, b, c2) { - var d, e, f2, g, h, i3; - e = c2; - f2 = e.ak(); - if (T6d(a.e, f2)) { - if (f2.hi()) { - d = BD(a.g, 119); - for (g = 0; g < a.i; ++g) { - h = d[g]; - if (pb(h, e) && g != b) { - throw vbb(new Wdb(kue)); - } - } - } + if (this._input === "") { + return this.EOF; } else { - i3 = S6d(a.e.Tg(), f2); - d = BD(a.g, 119); - for (g = 0; g < a.i; ++g) { - h = d[g]; - if (i3.rl(h.ak())) { - throw vbb(new Wdb(Hwe)); - } - } - } - vtd(a, b, c2); - } - function OYb(a, b) { - var c2, d, e, f2, g, h; - c2 = BD(vNb(b, (wtc(), Esc)), 21); - g = BD(Qc((xXb(), wXb), c2), 21); - h = BD(Qc(LYb, c2), 21); - for (f2 = g.Kc(); f2.Ob(); ) { - d = BD(f2.Pb(), 21); - if (!BD(Qc(a.b, d), 15).dc()) { - return false; - } - } - for (e = h.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 21); - if (!BD(Qc(a.b, d), 15).dc()) { - return false; - } - } - return true; - } - function scc(a, b) { - var c2, d, e, f2, g, h; - Odd(b, "Partition postprocessing", 1); - for (d = new olb(a.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 29); - for (f2 = new olb(c2.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 10); - h = new olb(e.j); - while (h.a < h.c.c.length) { - g = BD(mlb(h), 11); - Ccb(DD(vNb(g, (wtc(), ftc)))) && nlb(h); - } - } - } - Qdd(b); - } - function ZZc(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - if (a.a.c.length == 1) { - return JZc(BD(Ikb(a.a, 0), 187), b); - } - g = YZc(a); - i3 = 0; - j = a.d; - f2 = g; - k = a.d; - h = (j - f2) / 2 + f2; - while (f2 + 1 < j) { - i3 = 0; - for (d = new olb(a.a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 187); - i3 += (e = MZc(c2, h, false), e.a); - } - if (i3 < b) { - k = h; - j = h; - } else { - f2 = h; - } - h = (j - f2) / 2 + f2; - } - return k; - } - function fD(a) { - var b, c2, d, e, f2; - if (isNaN(a)) { - return wD(), vD; - } - if (a < -9223372036854776e3) { - return wD(), tD; - } - if (a >= 9223372036854776e3) { - return wD(), sD; - } - e = false; - if (a < 0) { - e = true; - a = -a; - } - d = 0; - if (a >= Ije) { - d = QD(a / Ije); - a -= d * Ije; - } - c2 = 0; - if (a >= Hje) { - c2 = QD(a / Hje); - a -= c2 * Hje; - } - b = QD(a); - f2 = TC(b, c2, d); - e && ZC(f2); - return f2; - } - function rKb(a, b) { - var c2, d, e, f2; - c2 = !b || !a.u.Hc((rcd(), ncd)); - f2 = 0; - for (e = new olb(a.e.Cf()); e.a < e.c.c.length; ) { - d = BD(mlb(e), 838); - if (d.Hf() == (Ucd(), Scd)) { - throw vbb(new Wdb("Label and node size calculator can only be used with ports that have port sides assigned.")); - } - d.vf(f2++); - qKb(a, d, c2); - } - } - function V0d(a, b) { - var c2, d, e, f2, g; - e = b.Hh(a.a); - if (e) { - d = (!e.b && (e.b = new sId((jGd(), fGd), x6, e)), e.b); - c2 = GD(AAd(d, cwe)); - if (c2 != null) { - f2 = c2.lastIndexOf("#"); - g = f2 == -1 ? w1d(a, b.Aj(), c2) : f2 == 0 ? v1d(a, null, c2.substr(1)) : v1d(a, c2.substr(0, f2), c2.substr(f2 + 1)); - if (JD(g, 148)) { - return BD(g, 148); - } - } + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); } - return null; - } - function Z0d(a, b) { - var c2, d, e, f2, g; - d = b.Hh(a.a); - if (d) { - c2 = (!d.b && (d.b = new sId((jGd(), fGd), x6, d)), d.b); - f2 = GD(AAd(c2, zwe)); - if (f2 != null) { - e = f2.lastIndexOf("#"); - g = e == -1 ? w1d(a, b.Aj(), f2) : e == 0 ? v1d(a, null, f2.substr(1)) : v1d(a, f2.substr(0, e), f2.substr(e + 1)); - if (JD(g, 148)) { - return BD(g, 148); - } - } + }, "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]; } - return null; - } - function RDb(a) { - var b, c2, d, e, f2; - for (c2 = new olb(a.a.a); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 307); - b.j = null; - for (f2 = b.a.a.ec().Kc(); f2.Ob(); ) { - d = BD(f2.Pb(), 57); - X6c(d.b); - (!b.j || d.d.c < b.j.d.c) && (b.j = d); - } - for (e = b.a.a.ec().Kc(); e.Ob(); ) { - d = BD(e.Pb(), 57); - d.b.a = d.d.c - b.j.d.c; - d.b.b = d.d.d - b.j.d.d; - } - } - return a; - } - function sVb(a) { - var b, c2, d, e, f2; - for (c2 = new olb(a.a.a); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 189); - b.f = null; - for (f2 = b.a.a.ec().Kc(); f2.Ob(); ) { - d = BD(f2.Pb(), 81); - X6c(d.e); - (!b.f || d.g.c < b.f.g.c) && (b.f = d); - } - for (e = b.a.a.ec().Kc(); e.Ob(); ) { - d = BD(e.Pb(), 81); - d.e.a = d.g.c - b.f.g.c; - d.e.b = d.g.d - b.f.g.d; - } - } - return a; - } - function EMb(a) { - var b, c2, d; - c2 = BD(a.a, 19).a; - d = BD(a.b, 19).a; - b = $wnd.Math.max($wnd.Math.abs(c2), $wnd.Math.abs(d)); - if (c2 < b && d == -b) { - return new vgd(meb(c2 + 1), meb(d)); - } - if (c2 == b && d < b) { - return new vgd(meb(c2), meb(d + 1)); - } - if (c2 >= -b && d == b) { - return new vgd(meb(c2 - 1), meb(d)); - } - return new vgd(meb(c2), meb(d - 1)); - } - function W8b() { - S8b(); - return OC(GC(AS, 1), Kie, 77, 0, [Y7b, V7b, Z7b, n8b, G8b, r8b, M8b, w8b, E8b, i8b, A8b, v8b, F8b, e8b, O8b, P7b, z8b, I8b, o8b, H8b, Q8b, C8b, Q7b, D8b, R8b, K8b, P8b, p8b, b8b, q8b, m8b, N8b, T7b, _7b, t8b, S7b, u8b, k8b, f8b, x8b, h8b, W7b, U7b, l8b, g8b, y8b, L8b, R7b, B8b, j8b, s8b, c8b, a8b, J8b, $7b, d8b, X7b]); - } - function Yic(a, b, c2) { - a.d = 0; - a.b = 0; - b.k == (j0b(), i0b) && c2.k == i0b && BD(vNb(b, (wtc(), $sc)), 10) == BD(vNb(c2, $sc), 10) && (ajc(b).j == (Ucd(), Acd) ? Zic(a, b, c2) : Zic(a, c2, b)); - b.k == i0b && c2.k == g0b ? ajc(b).j == (Ucd(), Acd) ? a.d = 1 : a.b = 1 : c2.k == i0b && b.k == g0b && (ajc(c2).j == (Ucd(), Acd) ? a.b = 1 : a.d = 1); - cjc(a, b, c2); - } - function esd(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l; - l = hsd(a); - b = a.a; - i3 = b != null; - i3 && Upd(l, "category", a.a); - e = Fhe(new Pib(a.d)); - g = !e; - if (g) { - j = new wB(); - cC(l, "knownOptions", j); - c2 = new msd(j); - reb(new Pib(a.d), c2); - } - f2 = Fhe(a.g); - h = !f2; - if (h) { - k = new wB(); - cC(l, "supportedFeatures", k); - d = new osd(k); - reb(a.g, d); - } - return l; - } - function ty(a) { - var b, c2, d, e, f2, g, h, i3, j; - d = false; - b = 336; - c2 = 0; - f2 = new Xp(a.length); - for (h = a, i3 = 0, j = h.length; i3 < j; ++i3) { - g = h[i3]; - d = d | (Uzb(g), false); - e = (Tzb(g), g.a); - Ekb(f2.a, Qb(e)); - b &= e.qd(); - c2 = Ly(c2, e.rd()); - } - return BD(BD(Rzb(new YAb(null, Yj(new Kub((im(), nm(f2.a)), 16), new vy(), b, c2)), new xy(a)), 670), 833); - } - function UWb(a, b) { - var c2; - if (!!a.d && (b.c != a.e.c || qWb(a.e.b, b.b))) { - Ekb(a.f, a.d); - a.a = a.d.c + a.d.b; - a.d = null; - a.e = null; - } - nWb(b.b) ? a.c = b : a.b = b; - if (b.b == (lWb(), hWb) && !b.a || b.b == iWb && b.a || b.b == jWb && b.a || b.b == kWb && !b.a) { - if (!!a.c && !!a.b) { - c2 = new J6c(a.a, a.c.d, b.c - a.a, a.b.d - a.c.d); - a.d = c2; - a.e = b; - } - } - } - function L2c(a) { - var b; - D2c.call(this); - this.i = new Z2c(); - this.g = a; - this.f = BD(a.e && a.e(), 9).length; - if (this.f == 0) { - throw vbb(new Wdb("There must be at least one phase in the phase enumeration.")); - } - this.c = (b = BD(gdb(this.g), 9), new xqb(b, BD(_Bb(b, b.length), 9), 0)); - this.a = new j3c(); - this.b = new Lqb(); - } - function God(a, b) { - var c2, d; - if (b != a.Cb || a.Db >> 16 != 7 && !!b) { - if (p6d(a, b)) - throw vbb(new Wdb(ste + Iod(a))); - d = null; - !!a.Cb && (d = (c2 = a.Db >> 16, c2 >= 0 ? Eod(a, d) : a.Cb.ih(a, -1 - c2, null, d))); - !!b && (d = BD(b, 49).gh(a, 1, C2, d)); - d = Dod(a, b, d); - !!d && d.Fi(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 7, b, b)); - } - function NHd(a, b) { - var c2, d; - if (b != a.Cb || a.Db >> 16 != 3 && !!b) { - if (p6d(a, b)) - throw vbb(new Wdb(ste + QHd(a))); - d = null; - !!a.Cb && (d = (c2 = a.Db >> 16, c2 >= 0 ? KHd(a, d) : a.Cb.ih(a, -1 - c2, null, d))); - !!b && (d = BD(b, 49).gh(a, 0, k5, d)); - d = JHd(a, b, d); - !!d && d.Fi(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 3, b, b)); - } - function Ehb(a, b) { - Dhb(); - var c2, d, e, f2, g, h, i3, j, k; - if (b.d > a.d) { - h = a; - a = b; - b = h; - } - if (b.d < 63) { - return Ihb(a, b); - } - g = (a.d & -2) << 4; - j = Rgb2(a, g); - k = Rgb2(b, g); - d = yhb(a, Qgb(j, g)); - e = yhb(b, Qgb(k, g)); - i3 = Ehb(j, k); - c2 = Ehb(d, e); - f2 = Ehb(yhb(j, d), yhb(e, k)); - f2 = thb(thb(f2, i3), c2); - f2 = Qgb(f2, g); - i3 = Qgb(i3, g << 1); - return thb(thb(i3, f2), c2); - } - function aGc(a, b, c2) { - var d, e, f2, g, h; - g = CHc(a, c2); - h = KC(OQ, kne, 10, b.length, 0, 1); - d = 0; - for (f2 = g.Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 11); - Ccb(DD(vNb(e, (wtc(), Nsc)))) && (h[d++] = BD(vNb(e, gtc), 10)); - } - if (d < b.length) { - throw vbb(new Zdb("Expected " + b.length + " hierarchical ports, but found only " + d + ".")); - } - return h; - } - function Und(a, b) { - var c2, d, e, f2, g, h; - if (!a.tb) { - f2 = (!a.rb && (a.rb = new jUd(a, d5, a)), a.rb); - h = new Mqb(f2.i); - for (e = new Fyd(f2); e.e != e.i.gc(); ) { - d = BD(Dyd(e), 138); - g = d.ne(); - c2 = BD(g == null ? jrb(h.f, null, d) : Drb(h.g, g, d), 138); - !!c2 && (g == null ? jrb(h.f, null, c2) : Drb(h.g, g, c2)); - } - a.tb = h; - } - return BD(Phb(a.tb, b), 138); - } - function YKd(a, b) { - var c2, d, e, f2, g; - (a.i == null && TKd(a), a.i).length; - if (!a.p) { - g = new Mqb((3 * a.g.i / 2 | 0) + 1); - for (e = new $yd(a.g); e.e != e.i.gc(); ) { - d = BD(Zyd(e), 170); - f2 = d.ne(); - c2 = BD(f2 == null ? jrb(g.f, null, d) : Drb(g.g, f2, d), 170); - !!c2 && (f2 == null ? jrb(g.f, null, c2) : Drb(g.g, f2, c2)); - } - a.p = g; - } - return BD(Phb(a.p, b), 170); - } - function hCb(a, b, c2, d, e) { - var f2, g, h, i3, j; - fCb(d + Wy(c2, c2.$d()), e); - gCb(b, jCb(c2)); - f2 = c2.f; - !!f2 && hCb(a, b, f2, "Caused by: ", false); - for (h = (c2.k == null && (c2.k = KC(_I, nie, 78, 0, 0, 1)), c2.k), i3 = 0, j = h.length; i3 < j; ++i3) { - g = h[i3]; - hCb(a, b, g, "Suppressed: ", false); - } - console.groupEnd != null && console.groupEnd.call(console); - } - function dGc(a, b, c2, d) { - var e, f2, g, h, i3; - i3 = b.e; - h = i3.length; - g = b.q._f(i3, c2 ? 0 : h - 1, c2); - e = i3[c2 ? 0 : h - 1]; - g = g | cGc(a, e, c2, d); - for (f2 = c2 ? 1 : h - 2; c2 ? f2 < h : f2 >= 0; f2 += c2 ? 1 : -1) { - g = g | b.c.Sf(i3, f2, c2, d && !Ccb(DD(vNb(b.j, (wtc(), Jsc)))) && !Ccb(DD(vNb(b.j, (wtc(), mtc))))); - g = g | b.q._f(i3, f2, c2); - g = g | cGc(a, i3[f2], c2, d); - } - Qqb(a.c, b); - return g; - } - function o3b(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m; - for (k = m_b(a.j), l = 0, m = k.length; l < m; ++l) { - j = k[l]; - if (c2 == (KAc(), HAc) || c2 == JAc) { - i3 = k_b(j.g); - for (e = i3, f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - k3b(b, d) && PZb(d, true); - } - } - if (c2 == IAc || c2 == JAc) { - h = k_b(j.e); - for (e = h, f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - j3b(b, d) && PZb(d, true); - } - } - } - } - function Qmc(a) { - var b, c2; - b = null; - c2 = null; - switch (Lmc(a).g) { + }, "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: - b = (Ucd(), zcd); - c2 = Tcd; break; case 2: - b = (Ucd(), Rcd); - c2 = Acd; + return 10; break; case 3: - b = (Ucd(), Tcd); - c2 = zcd; break; case 4: - b = (Ucd(), Acd); - c2 = Rcd; - } - mjc(a, BD(Btb(RAb(BD(Qc(a.k, b), 15).Oc(), Hmc)), 113)); - njc(a, BD(Btb(QAb(BD(Qc(a.k, c2), 15).Oc(), Hmc)), 113)); - } - function a6b(a) { - var b, c2, d, e, f2, g; - e = BD(Ikb(a.j, 0), 11); - if (e.e.c.length + e.g.c.length == 0) { - a.n.a = 0; - } else { - g = 0; - for (d = ul(pl(OC(GC(KI, 1), Uhe, 20, 0, [new J0b(e), new R0b(e)]))); Qr(d); ) { - c2 = BD(Rr(d), 11); - g += c2.i.n.a + c2.n.a + c2.a.a; - } - b = BD(vNb(a, (Nyc(), Txc)), 8); - f2 = !b ? 0 : b.a; - a.n.a = g / (e.e.c.length + e.g.c.length) - f2; - } - } - function F1c(a, b) { - var c2, d, e; - for (d = new olb(b.a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 221); - $Nb(BD(c2.b, 65), c7c(R6c(BD(b.b, 65).c), BD(b.b, 65).a)); - e = xOb(BD(b.b, 65).b, BD(c2.b, 65).b); - e > 1 && (a.a = true); - ZNb(BD(c2.b, 65), P6c(R6c(BD(b.b, 65).c), Y6c(c7c(R6c(BD(c2.b, 65).a), BD(b.b, 65).a), e))); - D1c(a, b); - F1c(a, c2); - } - } - function rVb(a) { - var b, c2, d, e, f2, g, h; - for (f2 = new olb(a.a.a); f2.a < f2.c.c.length; ) { - d = BD(mlb(f2), 189); - d.e = 0; - d.d.a.$b(); - } - for (e = new olb(a.a.a); e.a < e.c.c.length; ) { - d = BD(mlb(e), 189); - for (c2 = d.a.a.ec().Kc(); c2.Ob(); ) { - b = BD(c2.Pb(), 81); - for (h = b.f.Kc(); h.Ob(); ) { - g = BD(h.Pb(), 81); - if (g.d != d) { - Qqb(d.d, g); - ++g.d.e; - } - } - } + 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; + }(); + parser22.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser22; + parser22.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, id27, 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" + id27); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const svg = root4.select("#" + id27); + 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 bcc(a) { - var b, c2, d, e, f2, g, h, i3; - i3 = a.j.c.length; - c2 = 0; - b = i3; - e = 2 * i3; - for (h = new olb(a.j); h.a < h.c.c.length; ) { - g = BD(mlb(h), 11); - 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++; - } - } - mmb(); - Okb(a.j, new fcc()); - } - function Vec(a) { - var b, c2; - c2 = null; - b = BD(Ikb(a.g, 0), 17); - do { - c2 = b.d.i; - if (wNb(c2, (wtc(), Wsc))) { - return BD(vNb(c2, Wsc), 11).i; - } - if (c2.k != (j0b(), h0b) && Qr(new Sr(ur(U_b(c2).a.Kc(), new Sq())))) { - b = BD(Rr(new Sr(ur(U_b(c2).a.Kc(), new Sq()))), 17); - } else if (c2.k != h0b) { - return null; - } - } while (!!c2 && c2.k != (j0b(), h0b)); - return c2; - } - function Omc(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - h = b.j; - g = b.g; - i3 = BD(Ikb(h, h.c.length - 1), 113); - k = (tCb(0, h.c.length), BD(h.c[0], 113)); - j = Kmc(a, g, i3, k); - for (f2 = 1; f2 < h.c.length; f2++) { - c2 = (tCb(f2 - 1, h.c.length), BD(h.c[f2 - 1], 113)); - e = (tCb(f2, h.c.length), BD(h.c[f2], 113)); - d = Kmc(a, g, c2, e); - if (d > j) { - i3 = c2; - k = e; - j = d; - } - } - b.a = k; - b.c = i3; - } - function sEb(a, b) { - var c2, d; - d = Axb(a.b, b.b); - if (!d) { - throw vbb(new Zdb("Invalid hitboxes for scanline constraint calculation.")); - } - (mEb(b.b, BD(Cxb(a.b, b.b), 57)) || mEb(b.b, BD(Bxb(a.b, b.b), 57))) && (Zfb(), b.b + " has overlap."); - a.a[b.b.f] = BD(Exb(a.b, b.b), 57); - c2 = BD(Dxb(a.b, b.b), 57); - !!c2 && (a.a[c2.f] = b.b); - } - function AFb(a) { - if (!a.a.d || !a.a.e) { - throw vbb(new Zdb((fdb(fN), fN.k + " must have a source and target " + (fdb(jN), jN.k) + " specified."))); - } - if (a.a.d == a.a.e) { - throw vbb(new Zdb("Network simplex does not support self-loops: " + a.a + " " + a.a.d + " " + a.a.e)); - } - NFb(a.a.d.g, a.a); - NFb(a.a.e.b, a.a); - return a.a; - } - function HHc(a, b, c2) { - var d, e, f2, g, h, i3, j; - j = new Hxb(new tIc(a)); - for (g = OC(GC(aR, 1), lne, 11, 0, [b, c2]), h = 0, i3 = g.length; h < i3; ++h) { - f2 = g[h]; - Iwb(j.a, f2, (Bcb(), zcb)) == null; - for (e = new b1b(f2.b); llb(e.a) || llb(e.b); ) { - d = BD(llb(e.a) ? mlb(e.a) : mlb(e.b), 17); - d.c == d.d || Axb(j, f2 == d.c ? d.d : d.c); - } - } - return Qb(j), new Tkb(j); - } - function oPc(a, b, c2) { - var d, e, f2, g, h, i3; - d = 0; - if (b.b != 0 && c2.b != 0) { - f2 = Jsb(b, 0); - g = Jsb(c2, 0); - h = Edb(ED(Xsb(f2))); - i3 = Edb(ED(Xsb(g))); - e = true; - do { - if (h > i3 - a.b && h < i3 + a.b) { - return -1; - } else - h > i3 - a.a && h < i3 + a.a && ++d; - h <= i3 && f2.b != f2.d.c ? h = Edb(ED(Xsb(f2))) : i3 <= h && g.b != g.d.c ? i3 = Edb(ED(Xsb(g))) : e = false; - } while (e); - } - return d; - } - function F3b(a, b, c2, d, e) { - var f2, g, h, i3; - i3 = (f2 = BD(gdb(F1), 9), new xqb(f2, BD(_Bb(f2, f2.length), 9), 0)); - for (h = new olb(a.j); h.a < h.c.c.length; ) { - g = BD(mlb(h), 11); - if (b[g.p]) { - G3b(g, b[g.p], d); - rqb(i3, g.j); - } - } - if (e) { - K3b(a, b, (Ucd(), zcd), 2 * c2, d); - K3b(a, b, Tcd, 2 * c2, d); - } else { - K3b(a, b, (Ucd(), Acd), 2 * c2, d); - K3b(a, b, Rcd, 2 * c2, d); - } - } - function Szb(a) { - var b, c2, d, e, f2; - f2 = new Rkb(); - Hkb(a.b, new XBb(f2)); - a.b.c = KC(SI, Uhe, 1, 0, 5, 1); - if (f2.c.length != 0) { - b = (tCb(0, f2.c.length), BD(f2.c[0], 78)); - for (c2 = 1, d = f2.c.length; c2 < d; ++c2) { - e = (tCb(c2, f2.c.length), BD(f2.c[c2], 78)); - e != b && Qy(b, e); - } - if (JD(b, 60)) { - throw vbb(BD(b, 60)); - } - if (JD(b, 289)) { - throw vbb(BD(b, 289)); - } - } - } - function DCb(a, b) { - var c2, d, e, f2; - a = a == null ? Xhe : (uCb(a), a); - c2 = new Vfb(); - f2 = 0; - d = 0; - while (d < b.length) { - e = a.indexOf("%s", f2); - if (e == -1) { - break; - } - Qfb(c2, a.substr(f2, e - f2)); - Pfb(c2, b[d++]); - f2 = e + 2; - } - Qfb(c2, a.substr(f2)); - if (d < b.length) { - c2.a += " ["; - Pfb(c2, b[d++]); - while (d < b.length) { - c2.a += She; - Pfb(c2, b[d++]); - } - c2.a += "]"; - } - return c2.a; - } - function KCb(a) { - var b, c2, d, e; - b = 0; - d = a.length; - e = d - 4; - c2 = 0; - while (c2 < e) { - b = (BCb(c2 + 3, a.length), a.charCodeAt(c2 + 3) + (BCb(c2 + 2, a.length), 31 * (a.charCodeAt(c2 + 2) + (BCb(c2 + 1, a.length), 31 * (a.charCodeAt(c2 + 1) + (BCb(c2, a.length), 31 * (a.charCodeAt(c2) + 31 * b))))))); - b = b | 0; - c2 += 4; - } - while (c2 < d) { - b = b * 31 + bfb(a, c2++); - } - b = b | 0; - return b; - } - function Rac(a) { - var b, c2; - for (c2 = new Sr(ur(U_b(a).a.Kc(), new Sq())); Qr(c2); ) { - b = BD(Rr(c2), 17); - if (b.d.i.k != (j0b(), f0b)) { - throw vbb(new y2c(Fne + P_b(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 jQc(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m; - i3 = 0; - for (k = new olb(a.a); k.a < k.c.c.length; ) { - j = BD(mlb(k), 10); - h = 0; - for (f2 = new Sr(ur(R_b(j).a.Kc(), new Sq())); Qr(f2); ) { - e = BD(Rr(f2), 17); - l = A0b(e.c).b; - m = A0b(e.d).b; - h = $wnd.Math.max(h, $wnd.Math.abs(m - l)); - } - i3 = $wnd.Math.max(i3, h); - } - g = d * $wnd.Math.min(1, b / c2) * i3; - return g; - } - function See(a) { - var b; - b = new Ifb(); - (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 & zte) != 0 && (b.a += ",", b); - return jfb(b.a); - } - function F5b(a, b) { - var c2, d, e, f2; - Odd(b, "Resize child graph to fit parent.", 1); - for (d = new olb(a.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 29); - Gkb(a.a, c2.a); - c2.a.c = KC(SI, Uhe, 1, 0, 5, 1); - } - for (f2 = new olb(a.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 10); - $_b(e, null); - } - a.b.c = KC(SI, Uhe, 1, 0, 5, 1); - G5b(a); - !!a.e && E5b(a.e, a); - Qdd(b); - } - function eec(a) { - var b, c2, d, e, f2, g, h, i3, j; - d = a.b; - f2 = d.e; - g = ecd(BD(vNb(d, (Nyc(), Vxc)), 98)); - c2 = !!f2 && BD(vNb(f2, (wtc(), Ksc)), 21).Hc((Orc(), Hrc)); - if (g || c2) { - return; - } - for (j = (h = new $ib(a.e).a.vc().Kc(), new djb(h)); j.a.Ob(); ) { - i3 = (b = BD(j.a.Pb(), 42), BD(b.dd(), 113)); - if (i3.a) { - e = i3.d; - F0b(e, null); - i3.c = true; - a.a = true; - } - } - } - function QFc(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n; - m = -1; - n = 0; - for (j = a, k = 0, l = j.length; k < l; ++k) { - i3 = j[k]; - for (f2 = i3, g = 0, h = f2.length; g < h; ++g) { - e = f2[g]; - b = new Unc(m == -1 ? a[0] : a[m], Xec(e)); - for (c2 = 0; c2 < e.j.c.length; c2++) { - for (d = c2 + 1; d < e.j.c.length; d++) { - Rnc(b, BD(Ikb(e.j, c2), 11), BD(Ikb(e.j, d), 11)) > 0 && ++n; - } - } - } - ++m; - } - return n; + 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(diagram24, 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 = diagram24.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 = diagram24.append("g").attr("class", "lineWrapper"); + let lineLength = maxTaskHeight; + masterY += 100; + lineLength = lineLength + drawEvents(diagram24, 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(diagram24, 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 = diagram24.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 parser22 = { + 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 hUc(a, b) { - var c2, d, e, f2, g; - g = BD(vNb(b, (JTc(), FTc)), 425); - for (f2 = Jsb(b.b, 0); f2.b != f2.d.c; ) { - e = BD(Xsb(f2), 86); - if (a.b[e.g] == 0) { - switch (g.g) { - case 0: - iUc(a, e); - break; - case 1: - gUc(a, e); - } - a.b[e.g] = 2; - } - } - for (d = Jsb(a.a, 0); d.b != d.d.c; ) { - c2 = BD(Xsb(d), 188); - ze(c2.b.d, c2, true); - ze(c2.c.b, c2, true); - } - yNb(b, (mTc(), gTc), 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 S6d(a, b) { - Q6d(); - var c2, d, e, f2; - if (!b) { - return P6d; - } else if (b == (Q8d(), N8d) || (b == v8d || b == t8d || b == u8d) && a != s8d) { - return new Z6d(a, b); - } else { - d = BD(b, 677); - c2 = d.pk(); - if (!c2) { - a2d(q1d((O6d(), M6d), b)); - c2 = d.pk(); - } - f2 = (!c2.i && (c2.i = new Lqb()), c2.i); - e = BD(Wd(irb(f2.f, a)), 1942); - !e && Rhb(f2, a, e = new Z6d(a, b)); - return e; - } - } - function Tbc(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - i3 = BD(vNb(a, (wtc(), $sc)), 11); - j = l7c(OC(GC(m1, 1), nie, 8, 0, [i3.i.n, i3.n, i3.a])).a; - k = a.i.n.b; - c2 = k_b(a.e); - for (e = c2, f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - RZb(d, i3); - Fsb(d.a, new f7c(j, k)); - if (b) { - h = BD(vNb(d, (Nyc(), jxc)), 74); - if (!h) { - h = new s7c(); - yNb(d, jxc, h); - } - Dsb(h, new f7c(j, k)); - } - } - } - function Ubc(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - e = BD(vNb(a, (wtc(), $sc)), 11); - j = l7c(OC(GC(m1, 1), nie, 8, 0, [e.i.n, e.n, e.a])).a; - k = a.i.n.b; - c2 = k_b(a.g); - for (g = c2, h = 0, i3 = g.length; h < i3; ++h) { - f2 = g[h]; - QZb(f2, e); - Esb(f2.a, new f7c(j, k)); - if (b) { - d = BD(vNb(f2, (Nyc(), jxc)), 74); - if (!d) { - d = new s7c(); - yNb(f2, jxc, d); - } - Dsb(d, new f7c(j, k)); - } - } - } - function TFc(a, b) { - var c2, d, e, f2, g, h; - a.b = new Rkb(); - a.d = BD(vNb(b, (wtc(), jtc)), 230); - a.e = Dub(a.d); - f2 = new Psb(); - e = Ou(OC(GC(KQ, 1), cne, 37, 0, [b])); - g = 0; - while (g < e.c.length) { - d = (tCb(g, e.c.length), BD(e.c[g], 37)); - d.p = g++; - c2 = new fFc(d, a.a, a.b); - Gkb(e, c2.b); - Ekb(a.b, c2); - c2.s && (h = Jsb(f2, 0), Vsb(h, c2)); - } - a.c = new Tqb(); - return f2; - } - function HJb(a, b) { - var c2, d, e, f2, g, h; - for (g = BD(BD(Qc(a.r, b), 21), 84).Kc(); g.Ob(); ) { - f2 = BD(g.Pb(), 111); - c2 = f2.c ? ZHb(f2.c) : 0; - if (c2 > 0) { - if (f2.a) { - h = f2.b.rf().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 (tcd(a.u)) { - d = sfd(f2.b); - d.c < 0 && (f2.d.b = -d.c); - d.c + d.b > f2.b.rf().a && (f2.d.c = d.c + d.b - f2.b.rf().a); - } - } - } - function Eec(a, b) { - var c2, d, e, f2; - Odd(b, "Semi-Interactive Crossing Minimization Processor", 1); - c2 = false; - for (e = new olb(a.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 29); - f2 = TAb(VAb(JAb(JAb(new YAb(null, new Kub(d.a, 16)), new Jec()), new Lec()), new Nec()), new Rec()); - c2 = c2 | f2.a != null; - } - c2 && yNb(a, (wtc(), Rsc), (Bcb(), true)); - Qdd(b); - } - function sRc(a, b, c2) { - var d, e, f2, g, h; - e = c2; - !e && (e = new Zdd()); - Odd(e, "Layout", a.a.c.length); - if (Ccb(DD(vNb(b, (JTc(), vTc))))) { - Zfb(); - for (d = 0; d < a.a.c.length; d++) { - h = (d < 10 ? "0" : "") + d++; - " Slot " + h + ": " + hdb(rb(BD(Ikb(a.a, d), 51))); - } - } - for (g = new olb(a.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 51); - f2.pf(b, Udd(e, 1)); - } - Qdd(e); - } - function yMb(a) { - var b, c2; - b = BD(a.a, 19).a; - c2 = BD(a.b, 19).a; - if (b >= 0) { - if (b == c2) { - return new vgd(meb(-b - 1), meb(-b - 1)); - } - if (b == -c2) { - return new vgd(meb(-b), meb(c2 + 1)); - } - } - if ($wnd.Math.abs(b) > $wnd.Math.abs(c2)) { - if (b < 0) { - return new vgd(meb(-b), meb(c2)); - } - return new vgd(meb(-b), meb(c2 + 1)); - } - return new vgd(meb(b + 1), meb(c2)); - } - function q5b(a) { - var b, c2; - c2 = BD(vNb(a, (Nyc(), mxc)), 163); - b = BD(vNb(a, (wtc(), Osc)), 303); - if (c2 == (Ctc(), ytc)) { - yNb(a, mxc, Btc); - yNb(a, Osc, (esc(), dsc)); - } else if (c2 == Atc) { - yNb(a, mxc, Btc); - yNb(a, Osc, (esc(), bsc)); - } else if (b == (esc(), dsc)) { - yNb(a, mxc, ytc); - yNb(a, Osc, csc); - } else if (b == bsc) { - yNb(a, mxc, Atc); - yNb(a, Osc, csc); - } - } - function FNc() { - FNc = ccb; - DNc = new RNc(); - zNc = e3c(new j3c(), (qUb(), nUb), (S8b(), o8b)); - CNc = c3c(e3c(new j3c(), nUb, C8b), pUb, B8b); - ENc = b3c(b3c(g3c(c3c(e3c(new j3c(), lUb, M8b), pUb, L8b), oUb), K8b), N8b); - ANc = c3c(e3c(e3c(e3c(new j3c(), mUb, r8b), oUb, t8b), oUb, u8b), pUb, s8b); - BNc = c3c(e3c(e3c(new j3c(), oUb, u8b), oUb, _7b), pUb, $7b); - } - function hQc() { - hQc = ccb; - cQc = e3c(c3c(new j3c(), (qUb(), pUb), (S8b(), c8b)), nUb, o8b); - gQc = b3c(b3c(g3c(c3c(e3c(new j3c(), lUb, M8b), pUb, L8b), oUb), K8b), N8b); - dQc = c3c(e3c(e3c(e3c(new j3c(), mUb, r8b), oUb, t8b), oUb, u8b), pUb, s8b); - fQc = e3c(e3c(new j3c(), nUb, C8b), pUb, B8b); - eQc = c3c(e3c(e3c(new j3c(), oUb, u8b), oUb, _7b), pUb, $7b); - } - function GNc(a, b, c2, d, e) { - var f2, g; - if ((!OZb(b) && b.c.i.c == b.d.i.c || !T6c(l7c(OC(GC(m1, 1), nie, 8, 0, [e.i.n, e.n, e.a])), c2)) && !OZb(b)) { - b.c == e ? St(b.a, 0, new g7c(c2)) : Dsb(b.a, new g7c(c2)); - if (d && !Rqb(a.a, c2)) { - g = BD(vNb(b, (Nyc(), jxc)), 74); - if (!g) { - g = new s7c(); - yNb(b, jxc, g); - } - f2 = new g7c(c2); - Gsb(g, f2, g.c.b, g.c); - Qqb(a.a, f2); - } - } - } - function Qac(a) { - var b, c2; - for (c2 = new Sr(ur(R_b(a).a.Kc(), new Sq())); Qr(c2); ) { - b = BD(Rr(c2), 17); - if (b.c.i.k != (j0b(), f0b)) { - throw vbb(new y2c(Fne + P_b(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 vjd(a, b, c2) { - var d, e, f2, g, h, i3, j; - e = aeb(a.Db & 254); - if (e == 0) { - a.Eb = c2; - } else { - if (e == 1) { - h = KC(SI, Uhe, 1, 2, 5, 1); - f2 = zjd(a, b); - if (f2 == 0) { - h[0] = c2; - h[1] = a.Eb; - } else { - h[0] = a.Eb; - h[1] = c2; - } - } else { - h = KC(SI, Uhe, 1, e + 1, 5, 1); - g = CD(a.Eb); - for (d = 2, i3 = 0, j = 0; d <= 128; d <<= 1) { - d == b ? h[j++] = c2 : (a.Db & d) != 0 && (h[j++] = g[i3++]); - } - } - a.Eb = h; - } - a.Db |= b; - } - function ENb(a, b, c2) { - var d, e, f2, g; - this.b = new Rkb(); - e = 0; - d = 0; - for (g = new olb(a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 167); - c2 && rMb(f2); - Ekb(this.b, f2); - e += f2.o; - d += f2.p; - } - if (this.b.c.length > 0) { - f2 = BD(Ikb(this.b, 0), 167); - e += f2.o; - d += f2.p; - } - e *= 2; - d *= 2; - b > 1 ? e = QD($wnd.Math.ceil(e * b)) : d = QD($wnd.Math.ceil(d / b)); - this.a = new pNb(e, d); - } - function Igc(a, b, c2, d, e, f2) { - var g, h, i3, j, k, l, m, n, o2, p, q, r; - k = d; - if (b.j && b.o) { - n = BD(Ohb(a.f, b.A), 57); - p = n.d.c + n.d.b; - --k; - } else { - p = b.a.c + b.a.b; - } - l = e; - if (c2.q && c2.o) { - n = BD(Ohb(a.f, c2.C), 57); - j = n.d.c; - ++l; - } else { - j = c2.a.c; - } - q = j - p; - i3 = $wnd.Math.max(2, l - k); - h = q / i3; - o2 = p + h; - for (m = k; m < l; ++m) { - g = BD(f2.Xb(m), 128); - r = g.a.b; - g.a.c = o2 - r / 2; - o2 += h; - } - } - function UHc(a, b, c2, d, e, f2) { - var g, h, i3, j, k, l; - j = c2.c.length; - f2 && (a.c = KC(WD, oje, 25, b.length, 15, 1)); - for (g = e ? 0 : b.length - 1; e ? g < b.length : g >= 0; g += e ? 1 : -1) { - h = b[g]; - i3 = d == (Ucd(), zcd) ? e ? V_b(h, d) : Su(V_b(h, d)) : e ? Su(V_b(h, d)) : V_b(h, d); - f2 && (a.c[h.p] = i3.gc()); - for (l = i3.Kc(); l.Ob(); ) { - k = BD(l.Pb(), 11); - a.d[k.p] = j++; - } - Gkb(c2, i3); - } - } - function aQc(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - f2 = Edb(ED(a.b.Kc().Pb())); - j = Edb(ED(Pq(b.b))); - d = Y6c(R6c(a.a), j - c2); - e = Y6c(R6c(b.a), c2 - f2); - k = P6c(d, e); - Y6c(k, 1 / (j - f2)); - this.a = k; - this.b = new Rkb(); - h = true; - g = a.b.Kc(); - g.Pb(); - while (g.Ob()) { - i3 = Edb(ED(g.Pb())); - if (h && i3 - c2 > Oqe) { - this.b.Fc(c2); - h = false; - } - this.b.Fc(i3); - } - h && this.b.Fc(c2); - } - function vGb(a) { - var b, c2, d, e; - yGb(a, a.n); - if (a.d.c.length > 0) { - Blb(a.c); - while (GGb(a, BD(mlb(new olb(a.e.a)), 121)) < a.e.a.c.length) { - b = AGb(a); - e = b.e.e - b.d.e - b.a; - b.e.j && (e = -e); - for (d = new olb(a.e.a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 121); - c2.j && (c2.e += e); - } - Blb(a.c); - } - Blb(a.c); - DGb(a, BD(mlb(new olb(a.e.a)), 121)); - rGb(a); - } - } - function rkc(a, b) { - var c2, d, e, f2, g; - for (e = BD(Qc(a.a, (Xjc(), Tjc)), 15).Kc(); e.Ob(); ) { - d = BD(e.Pb(), 101); - c2 = BD(Ikb(d.j, 0), 113).d.j; - f2 = new Tkb(d.j); - Okb(f2, new Xkc()); - switch (b.g) { - case 1: - jkc(a, f2, c2, (Fkc(), Dkc), 1); - break; - case 0: - g = lkc(f2); - jkc(a, new Jib(f2, 0, g), c2, (Fkc(), Dkc), 0); - jkc(a, new Jib(f2, g, f2.c.length), c2, Dkc, 1); - } - } + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - function c2c(a, b) { - Y1c(); - var c2, d; - c2 = j4c(n4c(), b.tg()); - if (c2) { - d = c2.j; - if (JD(a, 239)) { - return Zod(BD(a, 33)) ? uqb(d, (N5c(), K5c)) || uqb(d, L5c) : uqb(d, (N5c(), K5c)); - } else if (JD(a, 352)) { - return uqb(d, (N5c(), I5c)); - } else if (JD(a, 186)) { - return uqb(d, (N5c(), M5c)); - } else if (JD(a, 354)) { - return uqb(d, (N5c(), J5c)); + __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 true; + return token2; } - function c3d(a, b, c2) { - var d, e, f2, g, h, i3; - e = c2; - f2 = e.ak(); - if (T6d(a.e, f2)) { - if (f2.hi()) { - d = BD(a.g, 119); - for (g = 0; g < a.i; ++g) { - h = d[g]; - if (pb(h, e) && g != b) { - throw vbb(new Wdb(kue)); - } - } - } + __name(lex2, "lex"); + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; } else { - i3 = S6d(a.e.Tg(), f2); - d = BD(a.g, 119); - for (g = 0; g < a.i; ++g) { - h = d[g]; - if (i3.rl(h.ak()) && g != b) { - throw vbb(new Wdb(Hwe)); - } + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); } + action = table[state5] && table[state5][symbol]; } - return BD(Gtd(a, b, c2), 72); - } - function Sy(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.Zd(); - return a && a.Xd(); - } }, suppressed: { get: function() { - return c2.Yd(); - } } }); - } catch (a) { - } - } - } - function lhb(a, b) { - var c2, d, e, f2, g; - d = b >> 5; - b &= 31; - if (d >= a.d) { - return a.e < 0 ? (Hgb(), Bgb) : (Hgb(), Ggb); - } - f2 = a.d - d; - e = KC(WD, oje, 25, f2 + 1, 15, 1); - mhb(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 Vgb(a.e, f2, e); - Jgb(g); - return g; - } - function UPb(a) { - var b, c2, d, e; - e = mpd(a); - c2 = new kQb(e); - d = new mQb(e); - b = new Rkb(); - Gkb(b, (!a.d && (a.d = new y5d(B2, a, 8, 5)), a.d)); - Gkb(b, (!a.e && (a.e = new y5d(B2, a, 7, 4)), a.e)); - return BD(GAb(NAb(JAb(new YAb(null, new Kub(b, 16)), c2), d), Ayb(new hzb(), new jzb(), new Gzb(), new Izb(), OC(GC(xL, 1), Kie, 132, 0, [(Fyb(), Eyb), Dyb]))), 21); - } - function p2d(a, b, c2, d) { - var e, f2, g, h, i3; - h = (Q6d(), BD(b, 66).Oj()); - if (T6d(a.e, b)) { - if (b.hi() && F2d(a, b, d, JD(b, 99) && (BD(b, 18).Bb & Tje) != 0)) { - throw vbb(new Wdb(kue)); - } - } else { - i3 = S6d(a.e.Tg(), b); - e = BD(a.g, 119); - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (i3.rl(f2.ak())) { - throw vbb(new Wdb(Hwe)); + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state5]) { + if (this.terminals_[p3] && p3 > TERROR) { + expected.push("'" + this.terminals_[p3] + "'"); } } - } - vtd(a, I2d(a, b, c2), h ? BD(d, 72) : R6d(b, d)); - } - function T6d(a, b) { - Q6d(); - var c2, d, e; - if (b.$j()) { - return true; - } else if (b.Zj() == -2) { - if (b == (m8d(), k8d) || b == h8d || b == i8d || b == j8d) { - return true; + if (lexer3.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; } else { - e = a.Tg(); - if (bLd(e, b) >= 0) { - return false; - } else { - c2 = e1d((O6d(), M6d), e, b); - if (!c2) { - return true; - } else { - d = c2.Zj(); - return (d > 1 || d == -1) && $1d(q1d(M6d, c2)) != 3; - } - } - } - } else { - return false; - } - } - function R1b(a, b, c2, d) { - var e, f2, g, h, i3; - h = atd(BD(qud((!b.b && (b.b = new y5d(z2, b, 4, 7)), b.b), 0), 82)); - i3 = atd(BD(qud((!b.c && (b.c = new y5d(z2, b, 5, 8)), b.c), 0), 82)); - if (Xod(h) == Xod(i3)) { - return null; - } - if (ntd(i3, h)) { - return null; + 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 + }); } - g = Mld(b); - if (g == c2) { - return d; - } else { - f2 = BD(Ohb(a.a, g), 10); - if (f2) { - e = f2.e; - if (e) { - return e; - } - } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } - return null; - } - function Cac(a, b) { - var c2; - c2 = BD(vNb(a, (Nyc(), Rwc)), 276); - Odd(b, "Label side selection (" + c2 + ")", 1); - switch (c2.g) { - case 0: - Dac(a, (rbd(), nbd)); - break; + switch (action[0]) { case 1: - Dac(a, (rbd(), obd)); + 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: - Bac(a, (rbd(), nbd)); + 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: - Bac(a, (rbd(), obd)); - break; - case 4: - Eac(a, (rbd(), nbd)); - break; - case 5: - Eac(a, (rbd(), obd)); + return true; } - Qdd(b); } - function bGc(a, b, c2) { - var d, e, f2, g, h, i3; - d = RFc(c2, a.length); - g = a[d]; - if (g[0].k != (j0b(), e0b)) { - 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]; } - f2 = SFc(c2, g.length); - i3 = b.j; - for (e = 0; e < i3.c.length; e++) { - h = (tCb(e, i3.c.length), BD(i3.c[e], 11)); - if ((c2 ? h.j == (Ucd(), zcd) : h.j == (Ucd(), Tcd)) && Ccb(DD(vNb(h, (wtc(), Nsc))))) { - Nkb(i3, e, BD(vNb(g[f2], (wtc(), $sc)), 11)); - f2 += c2 ? 1 : -1; - } + 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 rQc(a, b) { - var c2, d, e, f2, g; - g = new Rkb(); - c2 = b; - do { - f2 = BD(Ohb(a.b, c2), 128); - f2.B = c2.c; - f2.D = c2.d; - g.c[g.c.length] = f2; - c2 = BD(Ohb(a.k, c2), 17); - } while (c2); - d = (tCb(0, g.c.length), BD(g.c[0], 128)); - d.j = true; - d.A = BD(d.d.a.ec().Kc().Pb(), 17).c.i; - e = BD(Ikb(g, g.c.length - 1), 128); - e.q = true; - e.C = BD(e.d.a.ec().Kc().Pb(), 17).d.i; - return g; - } - function $wd(a) { - if (a.g == null) { - switch (a.p) { - case 0: - a.g = Swd(a) ? (Bcb(), Acb) : (Bcb(), zcb); - break; - case 1: - a.g = Scb(Twd(a)); - break; - case 2: - a.g = bdb(Uwd(a)); - break; - case 3: - a.g = Vwd(a); - break; - case 4: - a.g = new Ndb(Wwd(a)); - break; - case 6: - a.g = Aeb(Ywd(a)); - break; - case 5: - a.g = meb(Xwd(a)); - break; - case 7: - a.g = Web(Zwd(a)); - } + 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 a.g; - } - function hxd(a) { - if (a.n == null) { - switch (a.p) { - case 0: - a.n = _wd(a) ? (Bcb(), Acb) : (Bcb(), zcb); - break; - case 1: - a.n = Scb(axd(a)); - break; - case 2: - a.n = bdb(bxd(a)); - break; - case 3: - a.n = cxd(a); - break; - case 4: - a.n = new Ndb(dxd(a)); - break; - case 6: - a.n = Aeb(fxd(a)); - break; - case 5: - a.n = meb(exd(a)); - break; - case 7: - a.n = Web(gxd(a)); - } - } - return a.n; - } - function QDb(a) { - var b, c2, d, e, f2, g, h; - for (f2 = new olb(a.a.a); f2.a < f2.c.c.length; ) { - d = BD(mlb(f2), 307); - d.g = 0; - d.i = 0; - d.e.a.$b(); - } - for (e = new olb(a.a.a); e.a < e.c.c.length; ) { - d = BD(mlb(e), 307); - for (c2 = d.a.a.ec().Kc(); c2.Ob(); ) { - b = BD(c2.Pb(), 57); - for (h = b.c.Kc(); h.Ob(); ) { - g = BD(h.Pb(), 57); - if (g.a != d) { - Qqb(d.e, g); - ++g.a.g; - ++g.a.i; - } - } + 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 gOb(a, b) { - var c2, d, e, f2, g, h; - h = Axb(a.a, b.b); - if (!h) { - throw vbb(new Zdb("Invalid hitboxes for scanline overlap calculation.")); - } - g = false; - for (f2 = (d = new Ywb(new cxb(new Gjb(a.a.a).a).b), new Njb(d)); sib(f2.a.a); ) { - e = (c2 = Wwb(f2.a), BD(c2.cd(), 65)); - if (bOb(b.b, e)) { - T$c(a.b.a, b.b, e); - g = true; - } else { - if (g) { - break; - } - } + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; } - } - function G5b(a) { - var b, c2, d, e, f2; - e = BD(vNb(a, (Nyc(), Fxc)), 21); - f2 = BD(vNb(a, Ixc), 21); - c2 = new f7c(a.f.a + a.d.b + a.d.c, a.f.b + a.d.d + a.d.a); - b = new g7c(c2); - if (e.Hc((tdd(), pdd))) { - d = BD(vNb(a, Hxc), 8); - if (f2.Hc((Idd(), Bdd))) { - d.a <= 0 && (d.a = 20); - d.b <= 0 && (d.b = 20); + 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]; } - b.a = $wnd.Math.max(c2.a, d.a); - b.b = $wnd.Math.max(c2.b, d.b); + return false; } - H5b(a, c2, b); - } - function toc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m; - e = b ? new Coc() : new Eoc(); - f2 = false; - do { - f2 = false; - j = b ? Su(a.b) : a.b; - for (i3 = j.Kc(); i3.Ob(); ) { - h = BD(i3.Pb(), 29); - m = Mu(h.a); - b || new ov(m); - for (l = new olb(m); l.a < l.c.c.length; ) { - k = BD(mlb(l), 10); - if (e.Mb(k)) { - d = k; - c2 = BD(vNb(k, (wtc(), usc)), 305); - g = b ? c2.b : c2.k; - f2 = roc(d, g, b, 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; } } - } while (f2); - } - function WCc(a, b, c2) { - var d, e, f2, g, h; - Odd(c2, "Longest path layering", 1); - a.a = b; - h = a.a.a; - a.b = KC(WD, oje, 25, h.c.length, 15, 1); - d = 0; - for (g = new olb(h); g.a < g.c.c.length; ) { - e = BD(mlb(g), 10); - e.p = d; - a.b[d] = -1; - ++d; - } - for (f2 = new olb(h); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 10); - YCc(a, e); - } - h.c = KC(SI, Uhe, 1, 0, 5, 1); - a.a = null; - a.b = null; - Qdd(c2); - } - function QVb(a, b) { - var c2, d, e; - b.a ? (Axb(a.b, b.b), a.a[b.b.i] = BD(Exb(a.b, b.b), 81), c2 = BD(Dxb(a.b, b.b), 81), !!c2 && (a.a[c2.i] = b.b), void 0) : (d = BD(Exb(a.b, b.b), 81), !!d && d == a.a[b.b.i] && !!d.d && d.d != b.b.d && d.f.Fc(b.b), e = BD(Dxb(a.b, b.b), 81), !!e && a.a[e.i] == b.b && !!e.d && e.d != b.b.d && b.b.f.Fc(e), Fxb(a.b, b.b), void 0); - } - function zbc(a, b) { - var c2, d, e, f2, g, h; - f2 = a.d; - h = Edb(ED(vNb(a, (Nyc(), Zwc)))); - if (h < 0) { - h = 0; - yNb(a, Zwc, h); - } - b.o.b = h; - g = $wnd.Math.floor(h / 2); - d = new H0b(); - G0b(d, (Ucd(), Tcd)); - F0b(d, b); - d.n.b = g; - e = new H0b(); - G0b(e, zcd); - F0b(e, b); - e.n.b = g; - RZb(a, d); - c2 = new UZb(); - tNb(c2, a); - yNb(c2, jxc, null); - QZb(c2, e); - RZb(c2, f2); - ybc(b, a, c2); - wbc(a, c2); - return c2; - } - function uNc(a) { - var b, c2; - c2 = BD(vNb(a, (wtc(), Ksc)), 21); - b = new j3c(); - if (c2.Hc((Orc(), Irc))) { - d3c(b, oNc); - d3c(b, qNc); - } - if (c2.Hc(Krc) || Ccb(DD(vNb(a, (Nyc(), $wc))))) { - d3c(b, qNc); - c2.Hc(Lrc) && d3c(b, rNc); - } - c2.Hc(Hrc) && d3c(b, nNc); - c2.Hc(Nrc) && d3c(b, sNc); - c2.Hc(Jrc) && d3c(b, pNc); - c2.Hc(Erc) && d3c(b, lNc); - c2.Hc(Grc) && d3c(b, mNc); - return b; - } - function Ihb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m; - d = a.d; - f2 = b.d; - h = d + f2; - i3 = a.e != b.e ? -1 : 1; - if (h == 2) { - k = Ibb(xbb(a.a[0], Yje), xbb(b.a[0], Yje)); - m = Tbb(k); - l = Tbb(Pbb(k, 32)); - return l == 0 ? new Ugb(i3, m) : new Vgb(i3, 2, OC(GC(WD, 1), oje, 25, 15, [m, l])); - } - c2 = a.a; - e = b.a; - g = KC(WD, oje, 25, h, 15, 1); - Fhb(c2, d, e, f2, g); - j = new Vgb(i3, h, g); - Jgb(j); - return j; - } - function Gwb(a, b, c2, d) { - var e, f2; - if (!b) { - return c2; - } else { - e = a.a.ue(c2.d, b.d); - if (e == 0) { - d.d = ijb(b, c2.e); - d.b = true; - return b; - } - f2 = e < 0 ? 0 : 1; - b.a[f2] = Gwb(a, b.a[f2], c2, d); - if (Hwb(b.a[f2])) { - if (Hwb(b.a[1 - f2])) { - b.b = true; - b.a[0].b = false; - b.a[1].b = false; - } else { - Hwb(b.a[f2].a[f2]) ? b = Owb(b, 1 - f2) : Hwb(b.a[f2].a[1 - f2]) && (b = Nwb(b, 1 - f2)); - } - } - } - return b; - } - function wHb(a, b, c2) { - var d, e, f2, g; - e = a.i; - d = a.n; - vHb(a, (gHb(), dHb), e.c + d.b, c2); - vHb(a, fHb, 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); - vHb(a, eHb, e.c + d.b + c2[0] - (c2[1] - g) / 2, c2); - if (b == eHb) { - a.c.b = f2; - a.c.c = e.c + d.b + (f2 - g) / 2; - } - } - function AYb() { - this.c = KC(UD, Vje, 25, (Ucd(), OC(GC(F1, 1), bne, 61, 0, [Scd, Acd, zcd, Rcd, Tcd])).length, 15, 1); - this.b = KC(UD, Vje, 25, OC(GC(F1, 1), bne, 61, 0, [Scd, Acd, zcd, Rcd, Tcd]).length, 15, 1); - this.a = KC(UD, Vje, 25, OC(GC(F1, 1), bne, 61, 0, [Scd, Acd, zcd, Rcd, Tcd]).length, 15, 1); - zlb(this.c, Pje); - zlb(this.b, Qje); - zlb(this.a, Qje); - } - function Ufe(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 = KC(WD, oje, 25, 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 = KC(WD, oje, 25, d + 2, 15, 1); - $fb(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 || Yfe(a); - } - } - function inc(a, b, c2) { - var d, e, f2, g, h, i3, j; - j = b.d; - a.a = new Skb(j.c.length); - a.c = new Lqb(); - for (h = new olb(j); h.a < h.c.c.length; ) { - g = BD(mlb(h), 101); - f2 = new uOc(null); - Ekb(a.a, f2); - Rhb(a.c, g, f2); - } - a.b = new Lqb(); - gnc(a, b); - for (d = 0; d < j.c.length - 1; d++) { - i3 = BD(Ikb(b.d, d), 101); - for (e = d + 1; e < j.c.length; e++) { - jnc(a, i3, BD(Ikb(b.d, e), 101), c2); - } - } - } - function ySc(a, b, c2) { - var d, e, f2, g, h, i3; - if (!Qq(b)) { - i3 = Udd(c2, (JD(b, 14) ? BD(b, 14).gc() : sr(b.Kc())) / a.a | 0); - Odd(i3, Xqe, 1); - h = new BSc(); - g = 0; - for (f2 = b.Kc(); f2.Ob(); ) { - d = BD(f2.Pb(), 86); - h = pl(OC(GC(KI, 1), Uhe, 20, 0, [h, new ZRc(d)])); - g < d.f.b && (g = d.f.b); - } - for (e = b.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 86); - yNb(d, (mTc(), bTc), g); - } - Qdd(i3); - ySc(a, h, c2); - } - } - function bJc(a, b) { - var c2, d, e, f2, g, h, i3; - c2 = Qje; - h = (j0b(), h0b); - for (e = new olb(b.a); e.a < e.c.c.length; ) { - d = BD(mlb(e), 10); - f2 = d.k; - if (f2 != h0b) { - g = ED(vNb(d, (wtc(), atc))); - if (g == null) { - c2 = $wnd.Math.max(c2, 0); - d.n.b = c2 + iBc(a.a, f2, h); - } else { - d.n.b = (uCb(g), g); - } - } - i3 = iBc(a.a, f2, h); - d.n.b < c2 + i3 + d.d.d && (d.n.b = c2 + i3 + d.d.d); - c2 = d.n.b + d.o.b + d.d.a; - h = f2; - } - } - function uQb(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l; - f2 = itd(b, false, false); - j = ofd(f2); - l = Edb(ED(hkd(b, (CPb(), vPb)))); - e = sQb(j, l + a.a); - k = new XOb(e); - tNb(k, b); - Rhb(a.b, b, k); - c2.c[c2.c.length] = k; - i3 = (!b.n && (b.n = new cUd(D2, b, 1, 7)), b.n); - for (h = new Fyd(i3); h.e != h.i.gc(); ) { - g = BD(Dyd(h), 137); - d = wQb(a, g, true, 0, 0); - c2.c[c2.c.length] = d; - } - return k; - } - function JVc(a, b, c2, d, e) { - var f2, g, h, i3, j, k; - !!a.d && a.d.lg(e); - f2 = BD(e.Xb(0), 33); - if (HVc(a, c2, f2, false)) { - return true; - } - g = BD(e.Xb(e.gc() - 1), 33); - if (HVc(a, d, g, true)) { - return true; } - if (CVc(a, e)) { - return true; - } - for (k = e.Kc(); k.Ob(); ) { - j = BD(k.Pb(), 33); - for (i3 = b.Kc(); i3.Ob(); ) { - h = BD(i3.Pb(), 33); - if (BVc(a, j, h)) { - return true; - } + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; } + return false; } - return false; - } - function qid(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m; - m = b.c.length; - l = (j = a.Yg(c2), BD(j >= 0 ? a._g(j, false, true) : sid(a, c2, false), 58)); - n: - for (f2 = l.Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 56); - for (k = 0; k < m; ++k) { - g = (tCb(k, b.c.length), BD(b.c[k], 72)); - i3 = g.dd(); - h = g.ak(); - d = e.bh(h, false); - if (i3 == null ? d != null : !pb(i3, d)) { - continue n; - } - } - return e; - } - return null; - } - function V6b(a, b, c2, d) { - var e, f2, g, h; - e = BD(Y_b(b, (Ucd(), Tcd)).Kc().Pb(), 11); - f2 = BD(Y_b(b, zcd).Kc().Pb(), 11); - for (h = new olb(a.j); h.a < h.c.c.length; ) { - g = BD(mlb(h), 11); - while (g.e.c.length != 0) { - RZb(BD(Ikb(g.e, 0), 17), e); - } - while (g.g.c.length != 0) { - QZb(BD(Ikb(g.g, 0), 17), f2); - } + 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 + }); } - c2 || yNb(b, (wtc(), Vsc), null); - d || yNb(b, (wtc(), Wsc), null); - } - function itd(a, b, c2) { - var d, e; - if ((!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a).i == 0) { - return etd(a); + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; } else { - d = BD(qud((!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a), 0), 202); - if (b) { - Uxd((!d.a && (d.a = new xMd(y2, d, 5)), d.a)); - omd(d, 0); - pmd(d, 0); - hmd(d, 0); - imd(d, 0); - } - if (c2) { - e = (!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a); - while (e.i > 1) { - Xxd(e, e.i - 1); - } - } - return d; - } - } - function Z2b(a, b) { - var c2, d, e, f2, g, h, i3; - Odd(b, "Comment post-processing", 1); - for (f2 = new olb(a.b); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 29); - d = new Rkb(); - for (h = new olb(e.a); h.a < h.c.c.length; ) { - g = BD(mlb(h), 10); - i3 = BD(vNb(g, (wtc(), vtc)), 15); - c2 = BD(vNb(g, tsc), 15); - if (!!i3 || !!c2) { - $2b(g, i3, c2); - !!i3 && Gkb(d, i3); - !!c2 && Gkb(d, c2); - } - } - Gkb(e.a, d); - } - Qdd(b); - } - function Eac(a, b) { - var c2, d, e, f2, g, h, i3; - c2 = new jkb(); - for (f2 = new olb(a.b); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 29); - i3 = true; - d = 0; - for (h = new olb(e.a); h.a < h.c.c.length; ) { - g = BD(mlb(h), 10); - switch (g.k.g) { - case 4: - ++d; - case 1: - Xjb(c2, g); - break; - case 0: - Gac(g, b); - default: - c2.b == c2.c || Fac(c2, d, i3, false, b); - i3 = false; - d = 0; - } - } - c2.b == c2.c || Fac(c2, d, i3, true, b); - } - } - function Ebc(a, b) { - var c2, d, e, f2, g, h, i3; - e = new Rkb(); - for (c2 = 0; c2 <= a.i; c2++) { - d = new H1b(b); - d.p = a.i - c2; - e.c[e.c.length] = d; - } - for (h = new olb(a.o); h.a < h.c.c.length; ) { - g = BD(mlb(h), 10); - $_b(g, BD(Ikb(e, a.i - a.f[g.p]), 29)); - } - f2 = new olb(e); - while (f2.a < f2.c.c.length) { - i3 = BD(mlb(f2), 29); - i3.a.c.length == 0 && nlb(f2); - } - b.b.c = KC(SI, Uhe, 1, 0, 5, 1); - Gkb(b.b, e); - } - function KHc(a, b) { - var c2, d, e, f2, g, h; - c2 = 0; - for (h = new olb(b); h.a < h.c.c.length; ) { - g = BD(mlb(h), 11); - AHc(a.b, a.d[g.p]); - for (e = new b1b(g.b); llb(e.a) || llb(e.b); ) { - d = BD(llb(e.a) ? mlb(e.a) : mlb(e.b), 17); - f2 = aIc(a, g == d.c ? d.d : d.c); - if (f2 > a.d[g.p]) { - c2 += zHc(a.b, f2); - Wjb(a.a, meb(f2)); - } - } - while (!akb(a.a)) { - xHc(a.b, BD(fkb(a.a), 19).a); - } - } - return c2; - } - function o2c(a, b, c2) { - var d, e, f2, g; - f2 = (!b.a && (b.a = new cUd(E2, b, 10, 11)), b.a).i; - for (e = new Fyd((!b.a && (b.a = new cUd(E2, b, 10, 11)), b.a)); e.e != e.i.gc(); ) { - d = BD(Dyd(e), 33); - (!d.a && (d.a = new cUd(E2, d, 10, 11)), d.a).i == 0 || (f2 += o2c(a, d, false)); - } - if (c2) { - g = Xod(b); - while (g) { - f2 += (!g.a && (g.a = new cUd(E2, g, 10, 11)), g.a).i; - g = Xod(g); - } - } - return f2; - } - function Xxd(a, b) { - var c2, d, e, f2; - if (a.ej()) { - d = null; - e = a.fj(); - a.ij() && (d = a.kj(a.pi(b), null)); - c2 = a.Zi(4, f2 = tud(a, b), null, b, e); - if (a.bj() && f2 != null) { - d = a.dj(f2, d); - if (!d) { - a.$i(c2); - } else { - d.Ei(c2); - d.Fi(); - } - } else { - if (!d) { - a.$i(c2); - } else { - d.Ei(c2); - d.Fi(); - } - } - return f2; + 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 { - f2 = tud(a, b); - if (a.bj() && f2 != null) { - d = a.dj(f2, null); - !!d && d.Fi(); - } - return f2; - } - } - function UKb(a) { - var b, c2, d, e, f2, g, h, i3, j, k; - j = a.a; - b = new Tqb(); - i3 = 0; - for (d = new olb(a.d); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 222); - k = 0; - ktb(c2.b, new XKb()); - for (g = Jsb(c2.b, 0); g.b != g.d.c; ) { - f2 = BD(Xsb(g), 222); - 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); - i3 = $wnd.Math.max(i3, c2.c.d + c2.c.a); - } - return i3; - } - function Orc() { - Orc = ccb; - Frc = new Prc("COMMENTS", 0); - Hrc = new Prc("EXTERNAL_PORTS", 1); - Irc = new Prc("HYPEREDGES", 2); - Jrc = new Prc("HYPERNODES", 3); - Krc = new Prc("NON_FREE_PORTS", 4); - Lrc = new Prc("NORTH_SOUTH_PORTS", 5); - Nrc = new Prc(Wne, 6); - Erc = new Prc("CENTER_LABELS", 7); - Grc = new Prc("END_LABELS", 8); - Mrc = new Prc("PARTITIONS", 9); - } - function gVc(a) { - var b, c2, d, e, f2; - e = new Rkb(); - b = new Vqb((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a)); - for (d = new Sr(ur(_sd(a).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 79); - if (!JD(qud((!c2.b && (c2.b = new y5d(z2, c2, 4, 7)), c2.b), 0), 186)) { - f2 = atd(BD(qud((!c2.c && (c2.c = new y5d(z2, c2, 5, 8)), c2.c), 0), 82)); - b.a._b(f2) || (e.c[e.c.length] = f2, true); - } - } - return e; - } - function fVc(a) { - var b, c2, d, e, f2, g; - f2 = new Tqb(); - b = new Vqb((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a)); - for (e = new Sr(ur(_sd(a).a.Kc(), new Sq())); Qr(e); ) { - d = BD(Rr(e), 79); - if (!JD(qud((!d.b && (d.b = new y5d(z2, d, 4, 7)), d.b), 0), 186)) { - g = atd(BD(qud((!d.c && (d.c = new y5d(z2, d, 5, 8)), d.c), 0), 82)); - b.a._b(g) || (c2 = f2.a.zc(g, f2), c2 == null); - } - } - return f2; - } - function zA(a, b, c2, d, e) { - if (d < 0) { - d = oA(a, e, OC(GC(ZI, 1), nie, 2, 6, [bje, cje, dje, eje, fje, gje, hje, ije, jje, kje, lje, mje]), b); - d < 0 && (d = oA(a, e, OC(GC(ZI, 1), nie, 2, 6, ["Jan", "Feb", "Mar", "Apr", fje, "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 BA(a, b, c2, d, e) { - if (d < 0) { - d = oA(a, e, OC(GC(ZI, 1), nie, 2, 6, [bje, cje, dje, eje, fje, gje, hje, ije, jje, kje, lje, mje]), b); - d < 0 && (d = oA(a, e, OC(GC(ZI, 1), nie, 2, 6, ["Jan", "Feb", "Mar", "Apr", fje, "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 DA(a, b, c2, d, e, f2) { - var g, h, i3, j; - h = 32; - if (d < 0) { - if (b[0] >= a.length) { - return false; - } - h = bfb(a, b[0]); - if (h != 43 && h != 45) { - return false; - } - ++b[0]; - d = rA(a, b); - if (d < 0) { - return false; - } - h == 45 && (d = -d); - } - if (h == 32 && b[0] - c2 == 2 && e.b == 2) { - i3 = new eB(); - j = i3.q.getFullYear() - nje + nje - 80; - g = j % 100; - f2.a = d == g; - d += (j / 100 | 0) * 100 + (d < g ? 100 : 0); - } - f2.p = d; - return true; - } - function L1b(a, b) { - var c2, d, e, f2, g; - if (!Xod(a)) { - return; + return this.conditionStack[0]; } - g = BD(vNb(b, (Nyc(), Fxc)), 174); - PD(hkd(a, Vxc)) === PD((dcd(), ccd)) && jkd(a, Vxc, bcd); - d = (Pgd(), new bhd(Xod(a))); - f2 = new hhd(!Xod(a) ? null : new bhd(Xod(a)), a); - e = PGb(d, f2, false, true); - rqb(g, (tdd(), pdd)); - c2 = BD(vNb(b, Hxc), 8); - c2.a = $wnd.Math.max(e.a, c2.a); - c2.b = $wnd.Math.max(e.b, c2.b); - } - function Pac(a, b, c2) { - var d, e, f2, g, h, i3; - for (g = BD(vNb(a, (wtc(), Lsc)), 15).Kc(); g.Ob(); ) { - f2 = BD(g.Pb(), 10); - switch (BD(vNb(f2, (Nyc(), mxc)), 163).g) { - case 2: - $_b(f2, b); - break; - case 4: - $_b(f2, c2); - } - for (e = new Sr(ur(O_b(f2).a.Kc(), new Sq())); Qr(e); ) { - d = BD(Rr(e), 17); - if (!!d.c && !!d.d) { - continue; - } - h = !d.d; - i3 = BD(vNb(d, ctc), 11); - h ? RZb(d, i3) : QZb(d, i3); - } - } - } - function Alc() { - Alc = ccb; - tlc = new Blc(xle, 0, (Ucd(), Acd), Acd); - wlc = new Blc(zle, 1, Rcd, Rcd); - slc = new Blc(yle, 2, zcd, zcd); - zlc = new Blc(Ale, 3, Tcd, Tcd); - vlc = new Blc("NORTH_WEST_CORNER", 4, Tcd, Acd); - ulc = new Blc("NORTH_EAST_CORNER", 5, Acd, zcd); - ylc = new Blc("SOUTH_WEST_CORNER", 6, Rcd, Tcd); - xlc = new Blc("SOUTH_EAST_CORNER", 7, zcd, Rcd); - } - function i6c() { - i6c = ccb; - h6c = OC(GC(XD, 1), Sje, 25, 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 Pcc(a, b) { - var c2, d, e, f2, g; - if (a.c.length == 0) { - return new vgd(meb(0), meb(0)); - } - c2 = (tCb(0, a.c.length), BD(a.c[0], 11)).j; - g = 0; - f2 = b.g; - d = b.g + 1; - while (g < a.c.length - 1 && c2.g < f2) { - ++g; - c2 = (tCb(g, a.c.length), BD(a.c[g], 11)).j; - } - e = g; - while (e < a.c.length - 1 && c2.g < d) { - ++e; - c2 = (tCb(g, a.c.length), BD(a.c[g], 11)).j; - } - return new vgd(meb(g), meb(e)); - } - function R9b(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m; - f2 = b.c.length; - g = (tCb(c2, b.c.length), BD(b.c[c2], 286)); - 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]; - i3 = null; - for (e = c2 + 1; e < f2; e++) { - d = (tCb(e, b.c.length), BD(b.c[e], 286)); - d.c <= j && d.f >= j && (i3 = d); - } - !!i3 && (k = $wnd.Math.max(k, i3.a.o.a)); - if (k > m) { - l = j; - m = k; - } - } - return l; - } - function ode(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 = Xee(a.i)); - a.j = a.i.length; - nde(a); - f2 = rde(a); - if (a.d != a.j) - throw vbb(new mde(tvd((h0d(), sue)))); - if (a.g) { - for (d = 0; d < a.g.a.c.length; d++) { - e = BD(Uvb(a.g, d), 584); - if (a.f <= e.a) - throw vbb(new mde(tvd((h0d(), tue)))); - } - a.g.a.c = KC(SI, Uhe, 1, 0, 5, 1); - } - return f2; - } - function _Pd(a, b) { - var c2, d, e; - if (b == null) { - for (d = (!a.a && (a.a = new cUd(g5, a, 9, 5)), new Fyd(a.a)); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 678); - e = c2.c; - if ((e == null ? c2.zb : e) == null) { - return c2; - } - } + }, "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 { - for (d = (!a.a && (a.a = new cUd(g5, a, 9, 5)), new Fyd(a.a)); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 678); - if (dfb(b, (e = c2.c, e == null ? c2.zb : e))) { - return c2; - } - } - } - return null; - } - function KIb(a, b) { - var c2; - c2 = null; - switch (b.g) { - case 1: - a.e.Xe((Y9c(), o9c)) && (c2 = BD(a.e.We(o9c), 249)); + 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 3: - a.e.Xe((Y9c(), p9c)) && (c2 = BD(a.e.We(p9c), 249)); + case 1: + return 8; break; case 2: - a.e.Xe((Y9c(), n9c)) && (c2 = BD(a.e.We(n9c), 249)); + this.begin("CLASS"); + break; + case 3: + this.popState(); + return 16; break; case 4: - a.e.Xe((Y9c(), q9c)) && (c2 = BD(a.e.We(q9c), 249)); - } - !c2 && (c2 = BD(a.e.We((Y9c(), l9c)), 249)); - return c2; - } - function OCc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l; - b.p = 1; - f2 = b.c; - for (l = W_b(b, (KAc(), IAc)).Kc(); l.Ob(); ) { - k = BD(l.Pb(), 11); - for (e = new olb(k.g); e.a < e.c.c.length; ) { - d = BD(mlb(e), 17); - j = d.d.i; - if (b != j) { - g = j.c; - if (g.p <= f2.p) { - h = f2.p + 1; - if (h == c2.b.c.length) { - i3 = new H1b(c2); - i3.p = h; - Ekb(c2.b, i3); - $_b(j, i3); - } else { - i3 = BD(Ikb(c2.b, h), 29); - $_b(j, i3); - } - OCc(a, j, c2); - } - } - } - } - } - function ZXc(a, b, c2) { - var d, e, f2, g, h, i3; - e = c2; - f2 = 0; - for (h = new olb(b); h.a < h.c.c.length; ) { - g = BD(mlb(h), 33); - jkd(g, (ZWc(), SWc), meb(e++)); - i3 = gVc(g); - d = $wnd.Math.atan2(g.j + g.f / 2, g.i + g.g / 2); - d += d < 0 ? dre : 0; - d < 0.7853981633974483 || d > vre ? Okb(i3, a.b) : d <= vre && d > wre ? Okb(i3, a.d) : d <= wre && d > xre ? Okb(i3, a.c) : d <= xre && Okb(i3, a.a); - f2 = ZXc(a, i3, f2); - } - return e; - } - function Hgb() { - Hgb = ccb; - var a; - Cgb = new Ugb(1, 1); - Egb = new Ugb(1, 10); - Ggb = new Ugb(0, 0); - Bgb = new Ugb(-1, 1); - Dgb = OC(GC(cJ, 1), nie, 91, 0, [Ggb, Cgb, new Ugb(1, 2), new Ugb(1, 3), new Ugb(1, 4), new Ugb(1, 5), new Ugb(1, 6), new Ugb(1, 7), new Ugb(1, 8), new Ugb(1, 9), Egb]); - Fgb = KC(cJ, nie, 91, 32, 0, 1); - for (a = 0; a < Fgb.length; a++) { - Fgb[a] = ghb(Nbb(1, a)); - } - } - function B9b(a, b, c2, d, e, f2) { - var g, h, i3, j; - h = !WAb(JAb(a.Oc(), new Xxb(new F9b()))).sd((EAb(), DAb)); - g = a; - f2 == (ead(), dad) && (g = JD(g, 152) ? km(BD(g, 152)) : JD(g, 131) ? BD(g, 131).a : JD(g, 54) ? new ov(g) : new dv(g)); - for (j = g.Kc(); j.Ob(); ) { - i3 = BD(j.Pb(), 70); - i3.n.a = b.a; - h ? i3.n.b = b.b + (d.b - i3.o.b) / 2 : e ? i3.n.b = b.b : i3.n.b = b.b + d.b - i3.o.b; - b.a += i3.o.a + c2; - } - } - function UOc(a, b, c2, d) { - var e, f2, g, h, i3, j; - e = (d.c + d.a) / 2; - Osb(b.j); - Dsb(b.j, e); - Osb(c2.e); - Dsb(c2.e, e); - j = new aPc(); - for (h = new olb(a.f); h.a < h.c.c.length; ) { - f2 = BD(mlb(h), 129); - i3 = f2.a; - WOc(j, b, i3); - WOc(j, c2, i3); - } - for (g = new olb(a.k); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 129); - i3 = f2.b; - WOc(j, b, i3); - WOc(j, c2, i3); - } - j.b += 2; - j.a += POc(b, a.q); - j.a += POc(a.q, c2); - return j; - } - function FSc(a, b, c2) { - var d, e, f2, g, h; - if (!Qq(b)) { - h = Udd(c2, (JD(b, 14) ? BD(b, 14).gc() : sr(b.Kc())) / a.a | 0); - Odd(h, Xqe, 1); - g = new ISc(); - f2 = null; - for (e = b.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 86); - g = pl(OC(GC(KI, 1), Uhe, 20, 0, [g, new ZRc(d)])); - if (f2) { - yNb(f2, (mTc(), hTc), d); - yNb(d, _Sc, f2); - if (VRc(d) == VRc(f2)) { - yNb(f2, iTc, d); - yNb(d, aTc, f2); - } - } - f2 = d; - } - Qdd(h); - FSc(a, g, c2); - } - } - function VHb(a) { - var b, c2, d, e, f2, g, h; - c2 = a.i; - b = a.n; - h = c2.d; - a.f == (EIb(), CIb) ? h += (c2.a - a.e.b) / 2 : a.f == BIb && (h += c2.a - a.e.b); - for (e = new olb(a.d); e.a < e.c.c.length; ) { - d = BD(mlb(e), 181); - g = d.rf(); - f2 = new d7c(); - 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.tf(f2); - } - } - function XHb(a) { - var b, c2, d, e, f2, g, h; - c2 = a.i; - b = a.n; - h = c2.c; - a.b == (NHb(), KHb) ? h += (c2.b - a.e.a) / 2 : a.b == MHb && (h += c2.b - a.e.a); - for (e = new olb(a.d); e.a < e.c.c.length; ) { - d = BD(mlb(e), 181); - g = d.rf(); - f2 = new d7c(); - 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.tf(f2); - } - } - function D4b(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2; - k = c2.a.c; - g = c2.a.c + c2.a.b; - f2 = BD(Ohb(c2.c, b), 459); - n = f2.f; - o2 = f2.a; - i3 = new f7c(k, n); - l = new f7c(g, o2); - e = k; - c2.p || (e += a.c); - e += c2.F + c2.v * a.b; - j = new f7c(e, n); - m = new f7c(e, o2); - n7c(b.a, OC(GC(m1, 1), nie, 8, 0, [i3, j])); - h = c2.d.a.gc() > 1; - if (h) { - d = new f7c(e, c2.b); - Dsb(b.a, d); - } - n7c(b.a, OC(GC(m1, 1), nie, 8, 0, [m, l])); - } - function jdd(a) { - r4c(a, new E3c(P3c(M3c(O3c(N3c(new R3c(), Rse), "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 mdd()))); - p4c(a, Rse, ame, fdd); - p4c(a, Rse, wme, 15); - p4c(a, Rse, yme, meb(0)); - p4c(a, Rse, _le, tme); - } - function hde() { - hde = ccb; - var a, b, c2, d, e, f2; - fde = KC(SD, wte, 25, 255, 15, 1); - gde = KC(TD, $ie, 25, 16, 15, 1); - for (b = 0; b < 255; b++) { - fde[b] = -1; - } - for (c2 = 57; c2 >= 48; c2--) { - fde[c2] = c2 - 48 << 24 >> 24; - } - for (d = 70; d >= 65; d--) { - fde[d] = d - 65 + 10 << 24 >> 24; - } - for (e = 102; e >= 97; e--) { - fde[e] = e - 97 + 10 << 24 >> 24; - } - for (f2 = 0; f2 < 10; f2++) - gde[f2] = 48 + f2 & aje; - for (a = 10; a <= 15; a++) - gde[a] = 65 + a - 10 & aje; - } - function BVc(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - h = b.i - a.g / 2; - i3 = c2.i - a.g / 2; - j = b.j - a.g / 2; - k = c2.j - a.g / 2; - f2 = b.g + a.g / 2; - g = c2.g + a.g / 2; - d = b.f + a.g / 2; - e = c2.f + a.g / 2; - if (h < i3 + g && i3 < h && j < k + e && k < j) { - return true; - } else if (i3 < h + f2 && h < i3 && k < j + d && j < k) { - return true; - } else if (h < i3 + g && i3 < h && j < k && k < j + d) { - return true; - } else if (i3 < h + f2 && h < i3 && j < k + e && k < j) { - return true; - } - return false; - } - function NTb(a) { - var b, c2, d, e, f2; - e = BD(vNb(a, (Nyc(), Fxc)), 21); - f2 = BD(vNb(a, Ixc), 21); - c2 = new f7c(a.f.a + a.d.b + a.d.c, a.f.b + a.d.d + a.d.a); - b = new g7c(c2); - if (e.Hc((tdd(), pdd))) { - d = BD(vNb(a, Hxc), 8); - if (f2.Hc((Idd(), Bdd))) { - 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); - } - Ccb(DD(vNb(a, Gxc))) || OTb(a, c2, b); - } - function NJc(a, b) { - var c2, d, e, f2; - for (f2 = V_b(b, (Ucd(), Rcd)).Kc(); f2.Ob(); ) { - d = BD(f2.Pb(), 11); - c2 = BD(vNb(d, (wtc(), gtc)), 10); - !!c2 && AFb(DFb(CFb(EFb(BFb(new FFb(), 0), 0.1), a.i[b.p].d), a.i[c2.p].a)); - } - for (e = V_b(b, Acd).Kc(); e.Ob(); ) { - d = BD(e.Pb(), 11); - c2 = BD(vNb(d, (wtc(), gtc)), 10); - !!c2 && AFb(DFb(CFb(EFb(BFb(new FFb(), 0), 0.1), a.i[c2.p].d), a.i[b.p].a)); - } - } - function QKd(a) { - var b, c2, d, e, f2, g; - if (!a.c) { - g = new wNd(); - b = KKd; - f2 = b.a.zc(a, b); - if (f2 == null) { - for (d = new Fyd(VKd(a)); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 87); - e = KQd(c2); - JD(e, 88) && ytd(g, QKd(BD(e, 26))); - wtd(g, c2); - } - b.a.Bc(a) != null; - b.a.gc() == 0 && void 0; - } - tNd(g); - vud(g); - a.c = new nNd((BD(qud(ZKd((NFd(), MFd).o), 15), 18), g.i), g.g); - $Kd(a).b &= -33; - } - return a.c; - } - function eee(a) { - var b; - if (a.c != 10) - throw vbb(new mde(tvd((h0d(), uue)))); - b = a.a; - switch (b) { - case 110: - b = 10; + this.popState(); break; - case 114: - b = 13; + case 5: + yy.getLogger().trace("Begin icon"); + this.begin("ICON"); break; - case 116: - b = 9; + case 6: + yy.getLogger().trace("SPACELINE"); + return 6; 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: + case 7: + return 7; break; - default: - throw vbb(new mde(tvd((h0d(), Yue)))); - } - return b; - } - function qD(a) { - var b, c2, d, e, f2; - if (a.l == 0 && a.m == 0 && a.h == 0) { - return "0"; - } - if (a.h == Gje && a.m == 0 && a.l == 0) { - return "-9223372036854775808"; - } - if (a.h >> 19 != 0) { - return "-" + qD(hD(a)); - } - c2 = a; - d = ""; - while (!(c2.l == 0 && c2.m == 0 && c2.h == 0)) { - e = RC(Jje); - c2 = UC(c2, e, true); - b = "" + pD(QC); - 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 xrb() { - 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 Pgc(a) { - var b, c2, d, e, f2, g, h; - b = false; - c2 = 0; - for (e = new olb(a.d.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 29); - d.p = c2++; - for (g = new olb(d.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 10); - !b && !Qq(O_b(f2)) && (b = true); - } - } - h = qqb((ead(), cad), OC(GC(t12, 1), Kie, 103, 0, [aad, bad])); - if (!b) { - rqb(h, dad); - rqb(h, _9c); - } - a.a = new mDb(h); - Uhb(a.f); - Uhb(a.b); - Uhb(a.e); - Uhb(a.g); - } - function _Xb(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l; - d = c2.c; - e = c2.d; - h = A0b(b.c); - i3 = A0b(b.d); - if (d == b.c) { - h = aYb(a, h, e); - i3 = bYb(b.d); - } else { - h = bYb(b.c); - i3 = aYb(a, i3, e); - } - j = new t7c(b.a); - Gsb(j, h, j.a, j.a.a); - Gsb(j, i3, j.c.b, j.c); - g = b.c == d; - l = new BYb(); - for (f2 = 0; f2 < j.b - 1; ++f2) { - k = new vgd(BD(Ut(j, f2), 8), BD(Ut(j, f2 + 1), 8)); - g && f2 == 0 || !g && f2 == j.b - 2 ? l.b = k : Ekb(l.a, k); - } - return l; - } - function O$b(a, b) { - var c2, d, e, f2; - f2 = a.j.g - b.j.g; - if (f2 != 0) { - return f2; - } - c2 = BD(vNb(a, (Nyc(), Wxc)), 19); - d = BD(vNb(b, Wxc), 19); - if (!!c2 && !!d) { - e = c2.a - d.a; - if (e != 0) { - return e; - } - } - switch (a.j.g) { - case 1: - return Kdb(a.n.a, b.n.a); - case 2: - return Kdb(a.n.b, b.n.b); - case 3: - return Kdb(b.n.a, a.n.a); - case 4: - return Kdb(b.n.b, a.n.b); - default: - throw vbb(new Zdb(ine)); - } - } - function G6b(a, b, c2, d) { - var e, f2, g, h, i3; - if (sr((D6b(), new Sr(ur(O_b(b).a.Kc(), new Sq())))) >= a.a) { - return -1; - } - if (!F6b(b, c2)) { - return -1; - } - if (Qq(BD(d.Kb(b), 20))) { - return 1; - } - e = 0; - for (g = BD(d.Kb(b), 20).Kc(); g.Ob(); ) { - f2 = BD(g.Pb(), 17); - i3 = f2.c.i == b ? f2.d.i : f2.c.i; - h = G6b(a, i3, c2, d); - if (h == -1) { - return -1; - } - e = $wnd.Math.max(e, h); - if (e > a.c - 1) { - return -1; - } - } - return e + 1; - } - function Btd(a, b) { - var c2, d, e, f2, g, h; - if (PD(b) === PD(a)) { - return true; - } - if (!JD(b, 15)) { - return false; - } - d = BD(b, 15); - h = a.gc(); - if (d.gc() != h) { - return false; - } - g = d.Kc(); - if (a.ni()) { - for (c2 = 0; c2 < h; ++c2) { - e = a.ki(c2); - f2 = g.Pb(); - if (e == null ? f2 != null : !pb(e, f2)) { - return false; - } - } - } else { - for (c2 = 0; c2 < h; ++c2) { - e = a.ki(c2); - f2 = g.Pb(); - if (PD(e) !== PD(f2)) { - return false; - } - } - } - return true; - } - function rAd(a, b) { - var c2, d, e, f2, g, h; - if (a.f > 0) { - a.qj(); - if (b != null) { - for (f2 = 0; f2 < a.d.length; ++f2) { - c2 = a.d[f2]; - if (c2) { - d = BD(c2.g, 367); - h = c2.i; - for (g = 0; g < h; ++g) { - e = d[g]; - if (pb(b, e.dd())) { - return true; - } - } - } - } - } else { - for (f2 = 0; f2 < a.d.length; ++f2) { - c2 = a.d[f2]; - if (c2) { - d = BD(c2.g, 367); - h = c2.i; - for (g = 0; g < h; ++g) { - e = d[g]; - if (PD(b) === PD(e.dd())) { - return true; - } - } - } - } - } - } - return false; - } - function e6b(a, b, c2) { - var d, e, f2, g; - Odd(c2, "Orthogonally routing hierarchical port edges", 1); - a.a = 0; - d = h6b(b); - k6b(b, d); - j6b(a, b, d); - f6b(b); - e = BD(vNb(b, (Nyc(), Vxc)), 98); - f2 = b.b; - d6b((tCb(0, f2.c.length), BD(f2.c[0], 29)), e, b); - d6b(BD(Ikb(f2, f2.c.length - 1), 29), e, b); - g = b.b; - b6b((tCb(0, g.c.length), BD(g.c[0], 29))); - b6b(BD(Ikb(g, g.c.length - 1), 29)); - Qdd(c2); - } - function jnd(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 vbb(new Oeb("Invalid hexadecimal")); - } - } - } - function AUc(a, b, c2) { - var d, e, f2, g; - Odd(c2, "Processor order nodes", 2); - a.a = Edb(ED(vNb(b, (JTc(), HTc)))); - e = new Psb(); - for (g = Jsb(b.b, 0); g.b != g.d.c; ) { - f2 = BD(Xsb(g), 86); - Ccb(DD(vNb(f2, (mTc(), jTc)))) && (Gsb(e, f2, e.c.b, e.c), true); - } - d = (sCb(e.b != 0), BD(e.a.a.c, 86)); - yUc(a, d); - !c2.b && Rdd(c2, 1); - BUc(a, d, 0 - Edb(ED(vNb(d, (mTc(), bTc)))) / 2, 0); - !c2.b && Rdd(c2, 1); - Qdd(c2); - } - function rFb() { - rFb = ccb; - qFb = new sFb("SPIRAL", 0); - lFb = new sFb("LINE_BY_LINE", 1); - mFb = new sFb("MANHATTAN", 2); - kFb = new sFb("JITTER", 3); - oFb = new sFb("QUADRANTS_LINE_BY_LINE", 4); - pFb = new sFb("QUADRANTS_MANHATTAN", 5); - nFb = new sFb("QUADRANTS_JITTER", 6); - jFb = new sFb("COMBINE_LINE_BY_LINE_MANHATTAN", 7); - iFb = new sFb("COMBINE_JITTER_MANHATTAN", 8); - } - function roc(a, b, c2, d) { - var e, f2, g, h, i3, j; - i3 = woc(a, c2); - j = woc(b, c2); - e = false; - while (!!i3 && !!j) { - if (d || uoc(i3, j, c2)) { - g = woc(i3, c2); - h = woc(j, c2); - zoc(b); - zoc(a); - f2 = i3.c; - sbc(i3, false); - sbc(j, false); - if (c2) { - Z_b(b, j.p, f2); - b.p = j.p; - Z_b(a, i3.p + 1, f2); - a.p = i3.p; - } else { - Z_b(a, i3.p, f2); - a.p = i3.p; - Z_b(b, j.p + 1, f2); - b.p = j.p; - } - $_b(i3, null); - $_b(j, null); - i3 = g; - j = h; - e = true; - } else { + case 8: + return 15; break; - } - } - return e; - } - function VDc(a, b, c2, d) { - var e, f2, g, h, i3; - e = false; - f2 = false; - for (h = new olb(d.j); h.a < h.c.c.length; ) { - g = BD(mlb(h), 11); - PD(vNb(g, (wtc(), $sc))) === PD(c2) && (g.g.c.length == 0 ? g.e.c.length == 0 || (e = true) : f2 = true); - } - i3 = 0; - e && e ^ f2 ? i3 = c2.j == (Ucd(), Acd) ? -a.e[d.c.p][d.p] : b - a.e[d.c.p][d.p] : f2 && e ^ f2 ? i3 = a.e[d.c.p][d.p] + 1 : e && f2 && (i3 = c2.j == (Ucd(), Acd) ? 0 : b / 2); - return i3; - } - function NEd(a, b, c2, d, e, f2, g, h) { - var i3, j, k; - i3 = 0; - b != null && (i3 ^= LCb(b.toLowerCase())); - c2 != null && (i3 ^= LCb(c2)); - d != null && (i3 ^= LCb(d)); - g != null && (i3 ^= LCb(g)); - h != null && (i3 ^= LCb(h)); - for (j = 0, k = f2.length; j < k; j++) { - i3 ^= LCb(f2[j]); - } - a ? i3 |= 256 : i3 &= -257; - e ? i3 |= 16 : i3 &= -17; - this.f = i3; - this.i = b == null ? null : (uCb(b), b); - this.a = c2; - this.d = d; - this.j = f2; - this.g = g; - this.e = h; - } - function X_b(a, b, c2) { - var d, e; - e = null; - switch (b.g) { - case 1: - e = (z0b(), u0b); + case 9: + yy.getLogger().trace("end icon"); + this.popState(); break; - case 2: - e = (z0b(), w0b); - } - d = null; - switch (c2.g) { - case 1: - d = (z0b(), v0b); + case 10: + yy.getLogger().trace("Exploding node"); + this.begin("NODE"); + return 19; break; - case 2: - d = (z0b(), t0b); + case 11: + yy.getLogger().trace("Cloud"); + this.begin("NODE"); + return 19; break; - case 3: - d = (z0b(), x0b); + case 12: + yy.getLogger().trace("Explosion Bang"); + this.begin("NODE"); + return 19; break; - case 4: - d = (z0b(), y0b); - } - return !!e && !!d ? Nq(a.j, new Yb(new amb(OC(GC(_D, 1), Uhe, 169, 0, [BD(Qb(e), 169), BD(Qb(d), 169)])))) : (mmb(), mmb(), jmb); - } - function t5b(a) { - var b, c2, d; - b = BD(vNb(a, (Nyc(), Hxc)), 8); - yNb(a, Hxc, new f7c(b.b, b.a)); - switch (BD(vNb(a, mwc), 248).g) { - case 1: - yNb(a, mwc, (F7c(), E7c)); + case 13: + yy.getLogger().trace("Cloud Bang"); + this.begin("NODE"); + return 19; break; - case 2: - yNb(a, mwc, (F7c(), A7c)); + case 14: + this.begin("NODE"); + return 19; break; - case 3: - yNb(a, mwc, (F7c(), C7c)); + case 15: + this.begin("NODE"); + return 19; break; - case 4: - yNb(a, mwc, (F7c(), D7c)); - } - if ((!a.q ? (mmb(), mmb(), kmb) : a.q)._b(ayc)) { - c2 = BD(vNb(a, ayc), 8); - d = c2.a; - c2.a = c2.b; - c2.b = d; - } - } - function jjc(a, b, c2, d, e, f2) { - this.b = c2; - this.d = e; - if (a >= b.length) { - throw vbb(new qcb("Greedy SwitchDecider: Free layer not in graph.")); - } - this.c = b[a]; - this.e = new dIc(d); - THc(this.e, this.c, (Ucd(), Tcd)); - this.i = new dIc(d); - THc(this.i, this.c, zcd); - this.f = new ejc(this.c); - this.a = !f2 && e.i && !e.s && this.c[0].k == (j0b(), e0b); - this.a && hjc(this, a, b.length); - } - function hKb(a, b) { - var c2, d, e, f2, g, h; - f2 = !a.B.Hc((Idd(), zdd)); - g = a.B.Hc(Cdd); - a.a = new FHb(g, f2, a.c); - !!a.n && u_b(a.a.n, a.n); - lIb(a.g, (gHb(), eHb), a.a); - if (!b) { - d = new mIb(1, f2, a.c); - d.n.a = a.k; - Npb(a.p, (Ucd(), Acd), d); - e = new mIb(1, f2, a.c); - e.n.d = a.k; - Npb(a.p, Rcd, e); - h = new mIb(0, f2, a.c); - h.n.c = a.k; - Npb(a.p, Tcd, h); - c2 = new mIb(0, f2, a.c); - c2.n.b = a.k; - Npb(a.p, zcd, c2); - } - } - function Vgc(a) { - var b, c2, d; - b = BD(vNb(a.d, (Nyc(), Swc)), 218); - switch (b.g) { - case 2: - c2 = Ngc(a); + case 16: + this.begin("NODE"); + return 19; break; - case 3: - c2 = (d = new Rkb(), MAb(JAb(NAb(LAb(LAb(new YAb(null, new Kub(a.d.b, 16)), new Shc()), new Uhc()), new Whc()), new ehc()), new Yhc(d)), d); + case 17: + this.begin("NODE"); + return 19; break; - default: - throw vbb(new Zdb("Compaction not supported for " + b + " edges.")); - } - Ugc(a, c2); - reb(new Pib(a.g), new Ehc(a)); - } - function a2c(a, b) { - var c2; - c2 = new zNb(); - !!b && tNb(c2, BD(Ohb(a.a, C2), 94)); - JD(b, 470) && tNb(c2, BD(Ohb(a.a, G2), 94)); - if (JD(b, 354)) { - tNb(c2, BD(Ohb(a.a, D2), 94)); - return c2; - } - JD(b, 82) && tNb(c2, BD(Ohb(a.a, z2), 94)); - if (JD(b, 239)) { - tNb(c2, BD(Ohb(a.a, E2), 94)); - return c2; - } - if (JD(b, 186)) { - tNb(c2, BD(Ohb(a.a, F2), 94)); - return c2; - } - JD(b, 352) && tNb(c2, BD(Ohb(a.a, B2), 94)); - return c2; - } - function wSb() { - wSb = ccb; - oSb = new Osd((Y9c(), D9c), meb(1)); - uSb = new Osd(T9c, 80); - tSb = new Osd(M9c, 5); - bSb = new Osd(r8c, tme); - pSb = new Osd(E9c, meb(1)); - sSb = new Osd(H9c, (Bcb(), true)); - lSb = new q0b(50); - kSb = new Osd(f9c, lSb); - dSb = O8c; - mSb = t9c; - cSb = new Osd(B8c, false); - jSb = e9c; - iSb = b9c; - hSb = Y8c; - gSb = W8c; - nSb = x9c; - fSb = (SRb(), LRb); - vSb = QRb; - eSb = KRb; - qSb = NRb; - rSb = PRb; - } - function ZXb(a) { - var b, c2, d, e, f2, g, h, i3; - i3 = new jYb(); - for (h = new olb(a.a); h.a < h.c.c.length; ) { - g = BD(mlb(h), 10); - if (g.k == (j0b(), e0b)) { - continue; - } - XXb(i3, g, new d7c()); - for (f2 = new Sr(ur(U_b(g).a.Kc(), new Sq())); Qr(f2); ) { - e = BD(Rr(f2), 17); - if (e.c.i.k == e0b || e.d.i.k == e0b) { - continue; - } - for (d = Jsb(e.a, 0); d.b != d.d.c; ) { - c2 = BD(Xsb(d), 8); - b = c2; - hYb(i3, new cWb(b.a, b.b)); - } - } - } - return i3; - } - function A0c() { - A0c = ccb; - z0c = new Lsd(Qre); - y0c = (R0c(), Q0c); - x0c = new Nsd(Vre, y0c); - w0c = (a1c(), _0c); - v0c = new Nsd(Rre, w0c); - u0c = (N_c(), J_c); - t0c = new Nsd(Sre, u0c); - p0c = new Nsd(Tre, null); - s0c = (C_c(), A_c); - r0c = new Nsd(Ure, s0c); - l0c = (i_c(), h_c); - k0c = new Nsd(Wre, l0c); - m0c = new Nsd(Xre, (Bcb(), false)); - n0c = new Nsd(Yre, meb(64)); - o0c = new Nsd(Zre, true); - q0c = B_c; - } - function Toc(a) { - var b, c2, d, e, f2, g; - if (a.a != null) { - return; - } - a.a = KC(sbb, dle, 25, a.c.b.c.length, 16, 1); - a.a[0] = false; - if (wNb(a.c, (Nyc(), Lyc))) { - d = BD(vNb(a.c, Lyc), 15); - for (c2 = d.Kc(); c2.Ob(); ) { - b = BD(c2.Pb(), 19).a; - b > 0 && b < a.a.length && (a.a[b] = false); - } - } else { - g = new olb(a.c.b); - g.a < g.c.c.length && mlb(g); - e = 1; - while (g.a < g.c.c.length) { - f2 = BD(mlb(g), 29); - a.a[e++] = Woc(f2); - } - } - } - function TMd(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 Fyd(a.c); d.e != d.i.gc(); ) { - f2 = BD(Dyd(d), 473); - c2 = $Kd(f2); - XMd(c2, b); - } - } - } - function cGc(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2; - e = false; - for (g = b, h = 0, i3 = g.length; h < i3; ++h) { - f2 = g[h]; - Ccb((Bcb(), f2.e ? true : false)) && !BD(Ikb(a.b, f2.e.p), 214).s && (e = e | (j = f2.e, k = BD(Ikb(a.b, j.p), 214), l = k.e, m = SFc(c2, l.length), n = l[m][0], n.k == (j0b(), e0b) ? l[m] = aGc(f2, l[m], c2 ? (Ucd(), Tcd) : (Ucd(), zcd)) : k.c.Tf(l, c2), o2 = dGc(a, k, c2, d), bGc(k.e, k.o, c2), o2)); - } - return e; - } - function p2c(a, b) { - var c2, d, e, f2, g; - f2 = (!b.a && (b.a = new cUd(E2, b, 10, 11)), b.a).i; - for (e = new Fyd((!b.a && (b.a = new cUd(E2, b, 10, 11)), b.a)); e.e != e.i.gc(); ) { - d = BD(Dyd(e), 33); - if (PD(hkd(d, (Y9c(), J8c))) !== PD((hbd(), gbd))) { - g = BD(hkd(b, F9c), 149); - c2 = BD(hkd(d, F9c), 149); - (g == c2 || !!g && C3c(g, c2)) && (!d.a && (d.a = new cUd(E2, d, 10, 11)), d.a).i != 0 && (f2 += p2c(a, d)); - } - } - return f2; - } - function nlc(a) { - var b, c2, d, e, f2, g, h; - d = 0; - h = 0; - for (g = new olb(a.d); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 101); - e = BD(GAb(JAb(new YAb(null, new Kub(f2.j, 16)), new Ylc()), Byb(new fzb(), new dzb(), new Ezb(), OC(GC(xL, 1), Kie, 132, 0, [(Fyb(), Dyb)]))), 15); - c2 = null; - if (d <= h) { - c2 = (Ucd(), Acd); - d += e.gc(); - } else if (h < d) { - c2 = (Ucd(), Rcd); - h += e.gc(); - } - b = c2; - MAb(NAb(e.Oc(), new Mlc()), new Olc(b)); - } - } - function mkc(a) { - var b, c2, d, e, f2, g, h, i3; - a.b = new _i(new amb((Ucd(), OC(GC(F1, 1), bne, 61, 0, [Scd, Acd, zcd, Rcd, Tcd]))), new amb((Fkc(), OC(GC(vV, 1), Kie, 361, 0, [Ekc, Dkc, Ckc])))); - for (g = OC(GC(F1, 1), bne, 61, 0, [Scd, Acd, zcd, Rcd, Tcd]), h = 0, i3 = g.length; h < i3; ++h) { - f2 = g[h]; - for (c2 = OC(GC(vV, 1), Kie, 361, 0, [Ekc, Dkc, Ckc]), d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - Ui(a.b, f2, b, new Rkb()); - } - } - } - function KJb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - g = BD(BD(Qc(a.r, b), 21), 84); - h = a.u.Hc((rcd(), pcd)); - c2 = a.u.Hc(mcd); - d = a.u.Hc(lcd); - j = a.u.Hc(qcd); - l = a.B.Hc((Idd(), Hdd)); - k = !c2 && !d && (j || g.gc() == 2); - HJb(a, b); - e = null; - i3 = null; - if (h) { - f2 = g.Kc(); - e = BD(f2.Pb(), 111); - i3 = e; - while (f2.Ob()) { - i3 = BD(f2.Pb(), 111); - } - e.d.b = 0; - i3.d.c = 0; - k && !e.a && (e.d.c = 0); - } - if (l) { - LJb(g); - if (h) { - e.d.b = 0; - i3.d.c = 0; - } - } - } - function SKb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - g = BD(BD(Qc(a.r, b), 21), 84); - h = a.u.Hc((rcd(), pcd)); - c2 = a.u.Hc(mcd); - d = a.u.Hc(lcd); - i3 = a.u.Hc(qcd); - l = a.B.Hc((Idd(), Hdd)); - j = !c2 && !d && (i3 || g.gc() == 2); - QKb(a, b); - k = null; - e = null; - if (h) { - f2 = g.Kc(); - k = BD(f2.Pb(), 111); - e = k; - while (f2.Ob()) { - e = BD(f2.Pb(), 111); - } - k.d.d = 0; - e.d.a = 0; - j && !k.a && (k.d.a = 0); - } - if (l) { - TKb(g); - if (h) { - k.d.d = 0; - e.d.a = 0; - } - } - } - function oJc(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - e = b.k; - if (b.p >= 0) { - return false; - } else { - b.p = c2.b; - Ekb(c2.e, b); - } - if (e == (j0b(), g0b) || e == i0b) { - for (g = new olb(b.j); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 11); - for (k = (d = new olb(new R0b(f2).a.g), new U0b(d)); llb(k.a); ) { - j = BD(mlb(k.a), 17).d; - h = j.i; - i3 = h.k; - if (b.c != h.c) { - if (i3 == g0b || i3 == i0b) { - if (oJc(a, h, c2)) { - return true; - } - } - } - } - } - } - return true; - } - function gJd(a) { - var b; - if ((a.Db & 64) != 0) - return EId(a); - b = new Jfb(EId(a)); - b.a += " (changeable: "; - Ffb(b, (a.Bb & zte) != 0); - b.a += ", volatile: "; - Ffb(b, (a.Bb & Dve) != 0); - b.a += ", transient: "; - Ffb(b, (a.Bb & Rje) != 0); - b.a += ", defaultValueLiteral: "; - Efb(b, a.j); - b.a += ", unsettable: "; - Ffb(b, (a.Bb & Cve) != 0); - b.a += ", derived: "; - Ffb(b, (a.Bb & oie) != 0); - b.a += ")"; - return b.a; - } - function AOb(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m; - e = eNb(a.d); - g = BD(vNb(a.b, (CPb(), wPb)), 116); - h = g.b + g.c; - i3 = g.d + g.a; - k = e.d.a * a.e + h; - j = e.b.a * a.f + i3; - $Ob(a.b, new f7c(k, j)); - for (m = new olb(a.g); m.a < m.c.c.length; ) { - l = BD(mlb(m), 562); - b = l.g - e.a.a; - c2 = l.i - e.c.a; - d = P6c(Z6c(new f7c(b, c2), l.a, l.b), Y6c(b7c(R6c(HOb(l.e)), l.d * l.a, l.c * l.b), -0.5)); - f2 = IOb(l.e); - KOb(l.e, c7c(d, f2)); - } - } - function tmc(a, b, c2, d) { - var e, f2, g, h, i3; - i3 = KC(UD, nie, 104, (Ucd(), OC(GC(F1, 1), bne, 61, 0, [Scd, Acd, zcd, Rcd, Tcd])).length, 0, 2); - for (f2 = OC(GC(F1, 1), bne, 61, 0, [Scd, Acd, zcd, Rcd, Tcd]), g = 0, h = f2.length; g < h; ++g) { - e = f2[g]; - i3[e.g] = KC(UD, Vje, 25, a.c[e.g], 15, 1); - } - vmc(i3, a, Acd); - vmc(i3, a, Rcd); - smc(i3, a, Acd, b, c2, d); - smc(i3, a, zcd, b, c2, d); - smc(i3, a, Rcd, b, c2, d); - smc(i3, a, Tcd, b, c2, d); - return i3; - } - function UGc(a, b, c2) { - if (Mhb(a.a, b)) { - if (Rqb(BD(Ohb(a.a, b), 53), c2)) { - return 1; - } - } else { - Rhb(a.a, b, new Tqb()); - } - if (Mhb(a.a, c2)) { - if (Rqb(BD(Ohb(a.a, c2), 53), b)) { - return -1; - } - } else { - Rhb(a.a, c2, new Tqb()); - } - if (Mhb(a.b, b)) { - if (Rqb(BD(Ohb(a.b, b), 53), c2)) { - return -1; - } - } else { - Rhb(a.b, b, new Tqb()); - } - if (Mhb(a.b, c2)) { - if (Rqb(BD(Ohb(a.b, c2), 53), b)) { - return 1; - } - } else { - Rhb(a.b, c2, new Tqb()); - } - return 0; - } - function x2d(a, b, c2, d) { - var e, f2, g, h, i3, j; - if (c2 == null) { - e = BD(a.g, 119); - for (h = 0; h < a.i; ++h) { - g = e[h]; - if (g.ak() == b) { - return Txd(a, g, d); - } - } - } - f2 = (Q6d(), BD(b, 66).Oj() ? BD(c2, 72) : R6d(b, c2)); - if (oid(a.e)) { - j = !R2d(a, b); - d = Sxd(a, f2, d); - i3 = b.$j() ? H2d(a, 3, b, null, c2, M2d(a, b, c2, JD(b, 99) && (BD(b, 18).Bb & Tje) != 0), j) : H2d(a, 1, b, b.zj(), c2, -1, j); - d ? d.Ei(i3) : d = i3; - } else { - d = Sxd(a, f2, d); - } - return d; - } - function CJb(a) { - var b, c2, d, e, f2, g; - if (a.q == (dcd(), _bd) || a.q == $bd) { - return; - } - e = a.f.n.d + _Gb(BD(Mpb(a.b, (Ucd(), Acd)), 124)) + a.c; - b = a.f.n.a + _Gb(BD(Mpb(a.b, Rcd), 124)) + a.c; - d = BD(Mpb(a.b, zcd), 124); - g = BD(Mpb(a.b, Tcd), 124); - 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 rdc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m; - Odd(b, "Restoring reversed edges", 1); - for (i3 = new olb(a.b); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 29); - for (k = new olb(h.a); k.a < k.c.c.length; ) { - j = BD(mlb(k), 10); - for (m = new olb(j.j); m.a < m.c.c.length; ) { - l = BD(mlb(m), 11); - g = k_b(l.g); - for (d = g, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - Ccb(DD(vNb(c2, (wtc(), ltc)))) && PZb(c2, false); - } - } - } - } - Qdd(b); - } - function m4c() { - this.b = new $rb(); - this.d = new $rb(); - this.e = new $rb(); - this.c = new $rb(); - this.a = new Lqb(); - this.f = new Lqb(); - hvd(m1, new x4c(), new z4c()); - hvd(l1, new V4c(), new X4c()); - hvd(i1, new Z4c(), new _4c()); - hvd(j1, new b5c(), new d5c()); - hvd(i2, new f5c(), new h5c()); - hvd(DJ, new B4c(), new D4c()); - hvd(xK, new F4c(), new H4c()); - hvd(jK, new J4c(), new L4c()); - hvd(uK, new N4c(), new P4c()); - hvd(kL, new R4c(), new T4c()); - } - function R5d(a) { - var b, c2, d, e, f2, g; - f2 = 0; - b = wId(a); - !!b.Bj() && (f2 |= 4); - (a.Bb & Cve) != 0 && (f2 |= 2); - if (JD(a, 99)) { - c2 = BD(a, 18); - e = zUd(c2); - (c2.Bb & ote) != 0 && (f2 |= 32); - if (e) { - aLd(WId(e)); - f2 |= 8; - g = e.t; - (g > 1 || g == -1) && (f2 |= 16); - (e.Bb & ote) != 0 && (f2 |= 64); - } - (c2.Bb & Tje) != 0 && (f2 |= Dve); - f2 |= zte; - } else { - if (JD(b, 457)) { - f2 |= 512; - } else { - d = b.Bj(); - !!d && (d.i & 1) != 0 && (f2 |= 256); - } - } - (a.Bb & 512) != 0 && (f2 |= 128); - return f2; - } - function hc(a, b) { - var c2, d, e, f2, g; - a = a == null ? Xhe : (uCb(a), a); - for (e = 0; e < b.length; e++) { - b[e] = ic(b[e]); - } - c2 = new Vfb(); - g = 0; - d = 0; - while (d < b.length) { - f2 = a.indexOf("%s", g); - if (f2 == -1) { - break; - } - c2.a += "" + qfb(a == null ? Xhe : (uCb(a), a), g, f2); - Pfb(c2, b[d++]); - g = f2 + 2; - } - Ofb(c2, a, g, a.length); - if (d < b.length) { - c2.a += " ["; - Pfb(c2, b[d++]); - while (d < b.length) { - c2.a += She; - Pfb(c2, b[d++]); - } - c2.a += "]"; - } - return c2.a; - } - function m3b(a) { - var b, c2, d, e, f2; - f2 = new Skb(a.a.c.length); - for (e = new olb(a.a); e.a < e.c.c.length; ) { - d = BD(mlb(e), 10); - c2 = BD(vNb(d, (Nyc(), mxc)), 163); - b = null; - switch (c2.g) { - case 1: - case 2: - b = (Gqc(), Fqc); - break; - case 3: - case 4: - b = (Gqc(), Dqc); - } - if (b) { - yNb(d, (wtc(), Bsc), (Gqc(), Fqc)); - b == Dqc ? o3b(d, c2, (KAc(), HAc)) : b == Fqc && o3b(d, c2, (KAc(), IAc)); - } else { - f2.c[f2.c.length] = d; - } - } - return f2; - } - function MHc(a, b) { - var c2, d, e, f2, g, h, i3; - c2 = 0; - for (i3 = new olb(b); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 11); - AHc(a.b, a.d[h.p]); - g = 0; - for (e = new b1b(h.b); llb(e.a) || llb(e.b); ) { - d = BD(llb(e.a) ? mlb(e.a) : mlb(e.b), 17); - if (WHc(d)) { - f2 = aIc(a, h == d.c ? d.d : d.c); - if (f2 > a.d[h.p]) { - c2 += zHc(a.b, f2); - Wjb(a.a, meb(f2)); - } - } else { - ++g; - } - } - c2 += a.b.d * g; - while (!akb(a.a)) { - xHc(a.b, BD(fkb(a.a), 19).a); - } - } - return c2; - } - function Y6d(a, b) { - var c2; - if (a.f == W6d) { - c2 = $1d(q1d((O6d(), M6d), b)); - return a.e ? c2 == 4 && b != (m8d(), k8d) && b != (m8d(), h8d) && b != (m8d(), i8d) && b != (m8d(), j8d) : c2 == 2; - } - if (!!a.d && (a.d.Hc(b) || a.d.Hc(_1d(q1d((O6d(), M6d), b))) || a.d.Hc(e1d((O6d(), M6d), a.b, b)))) { - return true; - } - if (a.f) { - if (x1d((O6d(), a.f), b2d(q1d(M6d, b)))) { - c2 = $1d(q1d(M6d, b)); - return a.e ? c2 == 4 : c2 == 2; - } - } - return false; - } - function iVc(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l; - g = BD(hkd(c2, (Y9c(), C9c)), 8); - i3 = g.a; - k = g.b + a; - e = $wnd.Math.atan2(k, i3); - e < 0 && (e += dre); - e += b; - e > dre && (e -= dre); - h = BD(hkd(d, C9c), 8); - j = h.a; - l = h.b + a; - f2 = $wnd.Math.atan2(l, j); - f2 < 0 && (f2 += dre); - f2 += b; - f2 > dre && (f2 -= dre); - return Iy(), My(1e-10), $wnd.Math.abs(e - f2) <= 1e-10 || e == f2 || isNaN(e) && isNaN(f2) ? 0 : e < f2 ? -1 : e > f2 ? 1 : Ny(isNaN(e), isNaN(f2)); - } - function YDb(a) { - var b, c2, d, e, f2, g, h; - h = new Lqb(); - for (d = new olb(a.a.b); d.a < d.c.c.length; ) { - b = BD(mlb(d), 57); - Rhb(h, b, new Rkb()); - } - for (e = new olb(a.a.b); e.a < e.c.c.length; ) { - b = BD(mlb(e), 57); - b.i = Qje; - for (g = b.c.Kc(); g.Ob(); ) { - f2 = BD(g.Pb(), 57); - BD(Wd(irb(h.f, f2)), 15).Fc(b); - } - } - for (c2 = new olb(a.a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 57); - b.c.$b(); - b.c = BD(Wd(irb(h.f, b)), 15); - } - QDb(a); - } - function yVb(a) { - var b, c2, d, e, f2, g, h; - h = new Lqb(); - for (d = new olb(a.a.b); d.a < d.c.c.length; ) { - b = BD(mlb(d), 81); - Rhb(h, b, new Rkb()); - } - for (e = new olb(a.a.b); e.a < e.c.c.length; ) { - b = BD(mlb(e), 81); - b.o = Qje; - for (g = b.f.Kc(); g.Ob(); ) { - f2 = BD(g.Pb(), 81); - BD(Wd(irb(h.f, f2)), 15).Fc(b); - } - } - for (c2 = new olb(a.a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 81); - b.f.$b(); - b.f = BD(Wd(irb(h.f, b)), 15); - } - rVb(a); - } - function dNb(a, b, c2, d) { - var e, f2; - cNb(a, b, c2, d); - qNb(b, a.j - b.j + c2); - rNb(b, a.k - b.k + d); - for (f2 = new olb(b.f); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 324); - switch (e.a.g) { - case 0: - nNb(a, b.g + e.b.a, 0, b.g + e.c.a, b.i - 1); - break; - case 1: - nNb(a, b.g + b.o, b.i + e.b.a, a.o - 1, b.i + e.c.a); - break; - case 2: - nNb(a, b.g + e.b.a, b.i + b.p, b.g + e.c.a, a.p - 1); - break; - default: - nNb(a, 0, b.i + e.b.a, b.g - 1, b.i + e.c.a); - } - } - } - function aNb(b, c2, d, e, f2) { - var g, h, i3; - try { - if (c2 >= b.o) { - throw vbb(new rcb()); - } - i3 = c2 >> 5; - h = c2 & 31; - g = Nbb(1, Tbb(Nbb(h, 1))); - f2 ? b.n[d][i3] = Mbb(b.n[d][i3], g) : b.n[d][i3] = xbb(b.n[d][i3], Lbb(g)); - g = Nbb(g, 1); - e ? b.n[d][i3] = Mbb(b.n[d][i3], g) : b.n[d][i3] = xbb(b.n[d][i3], Lbb(g)); - } catch (a) { - a = ubb(a); - if (JD(a, 320)) { - throw vbb(new qcb(Dle + b.o + "*" + b.p + Ele + c2 + She + d + Fle)); - } else - throw vbb(a); - } - } - function BUc(a, b, c2, d) { - var e, f2, g; - if (b) { - f2 = Edb(ED(vNb(b, (mTc(), fTc)))) + d; - g = c2 + Edb(ED(vNb(b, bTc))) / 2; - yNb(b, kTc, meb(Tbb(Cbb($wnd.Math.round(f2))))); - yNb(b, lTc, meb(Tbb(Cbb($wnd.Math.round(g))))); - b.d.b == 0 || BUc(a, BD(pr((e = Jsb(new ZRc(b).a.d, 0), new aSc(e))), 86), c2 + Edb(ED(vNb(b, bTc))) + a.a, d + Edb(ED(vNb(b, cTc)))); - vNb(b, iTc) != null && BUc(a, BD(vNb(b, iTc), 86), c2, d); - } - } - function N9b(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m; - i3 = Q_b(b.a); - e = Edb(ED(vNb(i3, (Nyc(), pyc)))) * 2; - k = Edb(ED(vNb(i3, wyc))); - j = $wnd.Math.max(e, k); - f2 = KC(UD, Vje, 25, b.f - b.c + 1, 15, 1); - d = -j; - c2 = 0; - for (h = b.b.Kc(); h.Ob(); ) { - g = BD(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 olb(b.e); m.a < m.c.c.length; ) { - l = BD(mlb(m), 10); - d += a.a[l.c.p] + j; - f2[c2++] = d; - } - return f2; - } - function GHc(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m; - m = new Hxb(new pIc(a)); - for (h = OC(GC(OQ, 1), kne, 10, 0, [b, c2]), i3 = 0, j = h.length; i3 < j; ++i3) { - g = h[i3]; - for (l = CHc(g, d).Kc(); l.Ob(); ) { - k = BD(l.Pb(), 11); - for (f2 = new b1b(k.b); llb(f2.a) || llb(f2.b); ) { - e = BD(llb(f2.a) ? mlb(f2.a) : mlb(f2.b), 17); - if (!OZb(e)) { - Iwb(m.a, k, (Bcb(), zcb)) == null; - WHc(e) && Axb(m, k == e.c ? e.d : e.c); - } - } - } - } - return Qb(m), new Tkb(m); - } - function zhd(a, b) { - var c2, d, e, f2; - f2 = BD(hkd(a, (Y9c(), A9c)), 61).g - BD(hkd(b, A9c), 61).g; - if (f2 != 0) { - return f2; - } - c2 = BD(hkd(a, v9c), 19); - d = BD(hkd(b, v9c), 19); - if (!!c2 && !!d) { - e = c2.a - d.a; - if (e != 0) { - return e; - } - } - switch (BD(hkd(a, A9c), 61).g) { - case 1: - return Kdb(a.i, b.i); - case 2: - return Kdb(a.j, b.j); - case 3: - return Kdb(b.i, a.i); - case 4: - return Kdb(b.j, a.j); - default: - throw vbb(new Zdb(ine)); - } - } - function _od(a) { - var b, c2, d; - if ((a.Db & 64) != 0) - return fld(a); - b = new Wfb(ete); - c2 = a.k; - if (!c2) { - !a.n && (a.n = new cUd(D2, a, 1, 7)); - if (a.n.i > 0) { - d = (!a.n && (a.n = new cUd(D2, a, 1, 7)), BD(qud(a.n, 0), 137)).a; - !d || Qfb(Qfb((b.a += ' "', b), d), '"'); - } - } else { - Qfb(Qfb((b.a += ' "', b), c2), '"'); - } - Qfb(Lfb(Qfb(Lfb(Qfb(Lfb(Qfb(Lfb((b.a += " (", b), a.i), ","), a.j), " | "), a.g), ","), a.f), ")"); - return b.a; - } - function opd(a) { - var b, c2, d; - if ((a.Db & 64) != 0) - return fld(a); - b = new Wfb(fte); - c2 = a.k; - if (!c2) { - !a.n && (a.n = new cUd(D2, a, 1, 7)); - if (a.n.i > 0) { - d = (!a.n && (a.n = new cUd(D2, a, 1, 7)), BD(qud(a.n, 0), 137)).a; - !d || Qfb(Qfb((b.a += ' "', b), d), '"'); - } - } else { - Qfb(Qfb((b.a += ' "', b), c2), '"'); - } - Qfb(Lfb(Qfb(Lfb(Qfb(Lfb(Qfb(Lfb((b.a += " (", b), a.i), ","), a.j), " | "), a.g), ","), a.f), ")"); - return b.a; - } - function h4c(a, b) { - var c2, d, e, f2, g, h, i3; - if (b == null || b.length == 0) { - return null; - } - e = BD(Phb(a.a, b), 149); - if (!e) { - for (d = (h = new $ib(a.b).a.vc().Kc(), new djb(h)); d.a.Ob(); ) { - c2 = (f2 = BD(d.a.Pb(), 42), BD(f2.dd(), 149)); - g = c2.c; - i3 = b.length; - if (dfb(g.substr(g.length - i3, i3), b) && (b.length == g.length || bfb(g, g.length - b.length - 1) == 46)) { - if (e) { - return null; - } - e = c2; - } - } - !!e && Shb(a.a, b, e); - } - return e; - } - function QLb(a, b) { - var c2, d, e, f2; - c2 = new VLb(); - d = BD(GAb(NAb(new YAb(null, new Kub(a.f, 16)), c2), Ayb(new hzb(), new jzb(), new Gzb(), new Izb(), OC(GC(xL, 1), Kie, 132, 0, [(Fyb(), Eyb), Dyb]))), 21); - e = d.gc(); - d = BD(GAb(NAb(new YAb(null, new Kub(b.f, 16)), c2), Ayb(new hzb(), new jzb(), new Gzb(), new Izb(), OC(GC(xL, 1), Kie, 132, 0, [Eyb, Dyb]))), 21); - f2 = d.gc(); - if (e < f2) { - return -1; - } - if (e == f2) { - return 0; - } - return 1; - } - function r5b(a) { - var b, c2, d; - if (!wNb(a, (Nyc(), xxc))) { - return; - } - d = BD(vNb(a, xxc), 21); - if (d.dc()) { - return; - } - c2 = (b = BD(gdb(B1), 9), new xqb(b, BD(_Bb(b, b.length), 9), 0)); - d.Hc((Hbd(), Cbd)) ? rqb(c2, Cbd) : rqb(c2, Dbd); - d.Hc(Abd) || rqb(c2, Abd); - d.Hc(zbd) ? rqb(c2, Gbd) : d.Hc(ybd) ? rqb(c2, Fbd) : d.Hc(Bbd) && rqb(c2, Ebd); - d.Hc(Gbd) ? rqb(c2, zbd) : d.Hc(Fbd) ? rqb(c2, ybd) : d.Hc(Ebd) && rqb(c2, Bbd); - yNb(a, xxc, c2); - } - function kHc(a) { - var b, c2, d, e, f2, g, h; - e = BD(vNb(a, (wtc(), Psc)), 10); - d = a.j; - c2 = (tCb(0, d.c.length), BD(d.c[0], 11)); - for (g = new olb(e.j); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 11); - if (PD(f2) === PD(vNb(c2, $sc))) { - if (f2.j == (Ucd(), Acd) && a.p > e.p) { - G0b(f2, Rcd); - if (f2.d) { - h = f2.o.b; - b = f2.a.b; - f2.a.b = h - b; - } - } else if (f2.j == Rcd && e.p > a.p) { - G0b(f2, Acd); - if (f2.d) { - h = f2.o.b; - b = f2.a.b; - f2.a.b = -(h - b); - } - } + case 18: + return 13; break; - } - } - return e; - } - function NOc(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2; - f2 = c2; - if (c2 < d) { - m = (n = new uOc(a.p), o2 = new uOc(a.p), ye(n.e, a.e), n.q = a.q, n.r = o2, lOc(n), ye(o2.j, a.j), o2.r = n, lOc(o2), new vgd(n, o2)); - l = BD(m.a, 112); - k = BD(m.b, 112); - e = (tCb(f2, b.c.length), BD(b.c[f2], 329)); - g = UOc(a, l, k, e); - for (j = c2 + 1; j <= d; j++) { - h = (tCb(j, b.c.length), BD(b.c[j], 329)); - i3 = UOc(a, l, k, h); - if (SOc(h, i3, e, g)) { - e = h; - g = i3; - } - } - } - return f2; - } - function wQb(a, b, c2, d, e) { - var f2, g, h, i3, j, k, l; - if (!(JD(b, 239) || JD(b, 354) || JD(b, 186))) { - throw vbb(new Wdb("Method only works for ElkNode-, ElkLabel and ElkPort-objects.")); - } - g = a.a / 2; - i3 = b.i + d - g; - k = b.j + e - g; - j = i3 + b.g + a.a; - l = k + b.f + a.a; - f2 = new s7c(); - Dsb(f2, new f7c(i3, k)); - Dsb(f2, new f7c(i3, l)); - Dsb(f2, new f7c(j, l)); - Dsb(f2, new f7c(j, k)); - h = new XOb(f2); - tNb(h, b); - c2 && Rhb(a.b, b, h); - return h; - } - function uXb(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m; - f2 = new f7c(b, c2); - for (k = new olb(a.a); k.a < k.c.c.length; ) { - j = BD(mlb(k), 10); - P6c(j.n, f2); - for (m = new olb(j.j); m.a < m.c.c.length; ) { - l = BD(mlb(m), 11); - for (e = new olb(l.g); e.a < e.c.c.length; ) { - d = BD(mlb(e), 17); - q7c(d.a, f2); - g = BD(vNb(d, (Nyc(), jxc)), 74); - !!g && q7c(g, f2); - for (i3 = new olb(d.b); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 70); - P6c(h.n, f2); - } - } - } - } - } - function g_b(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m; - f2 = new f7c(b, c2); - for (k = new olb(a.a); k.a < k.c.c.length; ) { - j = BD(mlb(k), 10); - P6c(j.n, f2); - for (m = new olb(j.j); m.a < m.c.c.length; ) { - l = BD(mlb(m), 11); - for (e = new olb(l.g); e.a < e.c.c.length; ) { - d = BD(mlb(e), 17); - q7c(d.a, f2); - g = BD(vNb(d, (Nyc(), jxc)), 74); - !!g && q7c(g, f2); - for (i3 = new olb(d.b); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 70); - P6c(h.n, f2); - } - } - } - } - } - function N1b(a) { - if ((!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b).i == 0) { - throw vbb(new z2c("Edges must have a source.")); - } else if ((!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c).i == 0) { - throw vbb(new z2c("Edges must have a target.")); - } else { - !a.b && (a.b = new y5d(z2, a, 4, 7)); - if (!(a.b.i <= 1 && (!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c.i <= 1))) { - throw vbb(new z2c("Hyperedges are not supported.")); - } - } - } - function OFc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - l = 0; - f2 = new jkb(); - Wjb(f2, b); - while (f2.b != f2.c) { - i3 = BD(fkb(f2), 214); - j = 0; - k = BD(vNb(b.j, (Nyc(), ywc)), 339); - g = Edb(ED(vNb(b.j, uwc))); - h = Edb(ED(vNb(b.j, vwc))); - if (k != (tAc(), rAc)) { - j += g * PFc(i3.e, k); - j += h * QFc(i3.e); - } - l += pHc(i3.d, i3.e) + j; - for (e = new olb(i3.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 37); - c2 = BD(Ikb(a.b, d.p), 214); - c2.s || (l += NFc(a, c2)); - } - } - return l; - } - function dhb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q; - n = b.length; - i3 = n; - BCb(0, b.length); - if (b.charCodeAt(0) == 45) { - l = -1; - m = 1; - --n; - } else { - l = 1; - m = 0; - } - f2 = (phb(), ohb)[10]; - e = n / f2 | 0; - q = n % f2; - q != 0 && ++e; - h = KC(WD, oje, 25, e, 15, 1); - c2 = nhb[8]; - g = 0; - o2 = m + (q == 0 ? f2 : q); - for (p = m; p < i3; p = o2, o2 = p + f2) { - d = Icb(b.substr(p, o2 - p), Rie, Ohe); - j = (Dhb(), Hhb(h, h, g, c2)); - j += xhb(h, g, d); - h[g++] = j; - } - k = g; - a.e = l; - a.d = k; - a.a = h; - Jgb(a); - } - function SGb(a, b, c2, d, e, f2, g) { - a.c = d.qf().a; - a.d = d.qf().b; - if (e) { - a.c += e.qf().a; - a.d += e.qf().b; - } - a.b = b.rf().a; - a.a = b.rf().b; - if (!e) { - c2 ? a.c -= g + b.rf().a : a.c += d.rf().a + g; - } else { - switch (e.Hf().g) { - case 0: - case 2: - a.c += e.rf().a + g + f2.a + g; - break; - case 4: - a.c -= g + f2.a + g + b.rf().a; - break; - case 1: - a.c += e.rf().a + g; - a.d -= g + f2.b + g + b.rf().b; - break; - case 3: - a.c += e.rf().a + g; - a.d += e.rf().b + g + f2.b + g; - } - } - } - function gac(a, b) { - var c2, d; - this.b = new Rkb(); - this.e = new Rkb(); - this.a = a; - this.d = b; - dac(this); - eac(this); - this.b.dc() ? this.c = a.c.p : this.c = BD(this.b.Xb(0), 10).c.p; - this.e.c.length == 0 ? this.f = a.c.p : this.f = BD(Ikb(this.e, this.e.c.length - 1), 10).c.p; - for (d = BD(vNb(a, (wtc(), ktc)), 15).Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 70); - if (wNb(c2, (Nyc(), Owc))) { - this.d = BD(vNb(c2, Owc), 227); - break; - } - } - } - function Anc(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - d = BD(Ohb(a.a, b), 53); - f2 = BD(Ohb(a.a, c2), 53); - e = BD(Ohb(a.e, b), 53); - g = BD(Ohb(a.e, c2), 53); - d.a.zc(c2, d); - g.a.zc(b, g); - for (k = f2.a.ec().Kc(); k.Ob(); ) { - j = BD(k.Pb(), 10); - d.a.zc(j, d); - Qqb(BD(Ohb(a.e, j), 53), b); - ye(BD(Ohb(a.e, j), 53), e); - } - for (i3 = e.a.ec().Kc(); i3.Ob(); ) { - h = BD(i3.Pb(), 10); - g.a.zc(h, g); - Qqb(BD(Ohb(a.a, h), 53), c2); - ye(BD(Ohb(a.a, h), 53), f2); - } - } - function WGc(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - d = BD(Ohb(a.a, b), 53); - f2 = BD(Ohb(a.a, c2), 53); - e = BD(Ohb(a.b, b), 53); - g = BD(Ohb(a.b, c2), 53); - d.a.zc(c2, d); - g.a.zc(b, g); - for (k = f2.a.ec().Kc(); k.Ob(); ) { - j = BD(k.Pb(), 10); - d.a.zc(j, d); - Qqb(BD(Ohb(a.b, j), 53), b); - ye(BD(Ohb(a.b, j), 53), e); - } - for (i3 = e.a.ec().Kc(); i3.Ob(); ) { - h = BD(i3.Pb(), 10); - g.a.zc(h, g); - Qqb(BD(Ohb(a.a, h), 53), c2); - ye(BD(Ohb(a.a, h), 53), f2); - } - } - function doc(a, b) { - var c2, d, e; - Odd(b, "Breaking Point Insertion", 1); - d = new Xoc(a); - switch (BD(vNb(a, (Nyc(), Gyc)), 337).g) { - case 2: - e = new hpc(); - case 0: - e = new Ync(); + case 19: + return 22; break; - default: - e = new kpc(); - } - c2 = e.Vf(a, d); - Ccb(DD(vNb(a, Iyc))) && (c2 = coc(a, c2)); - if (!e.Wf() && wNb(a, Myc)) { - switch (BD(vNb(a, Myc), 338).g) { - case 2: - c2 = tpc(d, c2); - break; - case 1: - c2 = rpc(d, c2); - } - } - if (c2.dc()) { - Qdd(b); - return; - } - aoc(a, c2); - Qdd(b); - } - function $qd(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m; - k = null; - m = b; - l = Rqd(a, dtd(c2), m); - Lkd(l, _pd(m, Vte)); - g = Ypd(m, Lte); - d = new mrd(a, l); - oqd(d.a, d.b, g); - h = Ypd(m, Mte); - e = new nrd(a, l); - pqd(e.a, e.b, h); - if ((!l.b && (l.b = new y5d(z2, l, 4, 7)), l.b).i == 0 || (!l.c && (l.c = new y5d(z2, l, 5, 8)), l.c).i == 0) { - f2 = _pd(m, Vte); - i3 = Zte + f2; - j = i3 + $te; - throw vbb(new cqd(j)); - } - grd(m, l); - _qd(a, m, l); - k = crd(a, m, l); - return k; - } - function yGb(a, b) { - var c2, d, e, f2, g, h, i3; - e = KC(WD, oje, 25, a.e.a.c.length, 15, 1); - for (g = new olb(a.e.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 121); - e[f2.d] += f2.b.a.c.length; - } - h = Ru(b); - while (h.b != 0) { - f2 = BD(h.b == 0 ? null : (sCb(h.b != 0), Nsb(h, h.a.a)), 121); - for (d = vr(new olb(f2.g.a)); d.Ob(); ) { - c2 = BD(d.Pb(), 213); - i3 = c2.e; - i3.e = $wnd.Math.max(i3.e, f2.e + c2.a); - --e[i3.d]; - e[i3.d] == 0 && (Gsb(h, i3, h.c.b, h.c), true); - } - } - } - function CGb(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l; - c2 = Rie; - e = Ohe; - for (h = new olb(a.e.a); h.a < h.c.c.length; ) { - f2 = BD(mlb(h), 121); - e = $wnd.Math.min(e, f2.e); - c2 = $wnd.Math.max(c2, f2.e); - } - b = KC(WD, oje, 25, c2 - e + 1, 15, 1); - for (g = new olb(a.e.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 121); - f2.e -= e; - ++b[f2.e]; - } - d = 0; - if (a.k != null) { - for (j = a.k, k = 0, l = j.length; k < l; ++k) { - i3 = j[k]; - b[d++] += i3; - if (b.length == d) { - break; - } - } - } - return b; - } - function ixd(a) { - switch (a.d) { - case 9: - case 8: { - return true; - } - case 3: - case 5: - case 4: - case 6: { - return false; - } - case 7: { - return BD(hxd(a), 19).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 Bbb(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 $ad(a) { - r4c(a, new E3c(P3c(M3c(O3c(N3c(new R3c(), Qse), "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 bbd()))); - p4c(a, Qse, ame, Xad); - p4c(a, Qse, uqe, Ksd(Yad)); - p4c(a, Qse, use, Ksd(Sad)); - p4c(a, Qse, Fme, Ksd(Tad)); - p4c(a, Qse, Tme, Ksd(Vad)); - p4c(a, Qse, bqe, Ksd(Uad)); - } - function ro(a, b, c2) { - var d, e, f2, g, h; - d = Tbb(Ibb(Eie, keb(Tbb(Ibb(b == null ? 0 : tb(b), Fie)), 15))); - h = Tbb(Ibb(Eie, keb(Tbb(Ibb(c2 == null ? 0 : tb(c2), Fie)), 15))); - f2 = uo(a, b, d); - if (!!f2 && h == f2.f && Hb(c2, f2.i)) { - return c2; - } - g = vo(a, c2, h); - if (g) { - throw vbb(new Wdb("value already present: " + c2)); - } - e = new $o(b, d, c2, h); - if (f2) { - mo(a, f2); - po(a, e, f2); - f2.e = null; - f2.c = null; - return f2.i; - } else { - po(a, e, null); - to(a); - return null; - } - } - function E4b(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2; - k = c2.a.c; - g = c2.a.c + c2.a.b; - f2 = BD(Ohb(c2.c, b), 459); - n = f2.f; - o2 = f2.a; - f2.b ? i3 = new f7c(g, n) : i3 = new f7c(k, n); - f2.c ? l = new f7c(k, o2) : l = new f7c(g, o2); - e = k; - c2.p || (e += a.c); - e += c2.F + c2.v * a.b; - j = new f7c(e, n); - m = new f7c(e, o2); - n7c(b.a, OC(GC(m1, 1), nie, 8, 0, [i3, j])); - h = c2.d.a.gc() > 1; - if (h) { - d = new f7c(e, c2.b); - Dsb(b.a, d); - } - n7c(b.a, OC(GC(m1, 1), nie, 8, 0, [m, l])); - } - function Nid(a, b, c2) { - var d, e, f2, g, h, i3; - if (!b) { - return null; - } else { - if (c2 <= -1) { - d = XKd(b.Tg(), -1 - c2); - if (JD(d, 99)) { - return BD(d, 18); - } else { - g = BD(b.ah(d), 153); - for (h = 0, i3 = g.gc(); h < i3; ++h) { - if (PD(g.jl(h)) === PD(a)) { - e = g.il(h); - if (JD(e, 99)) { - f2 = BD(e, 18); - if ((f2.Bb & ote) != 0) { - return f2; - } - } - } - } - throw vbb(new Zdb("The containment feature could not be located")); - } - } else { - return zUd(BD(XKd(a.Tg(), c2), 18)); - } - } - } - function Xee(a) { - var b, c2, d, e, f2; - d = a.length; - b = new Ifb(); - f2 = 0; - while (f2 < d) { - c2 = bfb(a, f2++); - if (c2 == 9 || c2 == 10 || c2 == 12 || c2 == 13 || c2 == 32) - continue; - if (c2 == 35) { - while (f2 < d) { - c2 = bfb(a, f2++); - if (c2 == 13 || c2 == 10) - break; - } - continue; - } - if (c2 == 92 && f2 < d) { - if ((e = (BCb(f2, a.length), a.charCodeAt(f2))) == 35 || e == 9 || e == 10 || e == 12 || e == 13 || e == 32) { - Afb(b, e & aje); - ++f2; - } else { - b.a += "\\"; - Afb(b, e & aje); - ++f2; - } - } else - Afb(b, c2 & aje); - } - return b.a; - } - function GVc(a, b) { - var c2, d, e; - for (d = new olb(b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 33); - Rc(a.a, c2, c2); - Rc(a.b, c2, c2); - e = gVc(c2); - if (e.c.length != 0) { - !!a.d && a.d.lg(e); - Rc(a.a, c2, (tCb(0, e.c.length), BD(e.c[0], 33))); - Rc(a.b, c2, BD(Ikb(e, e.c.length - 1), 33)); - while (dVc(e).c.length != 0) { - e = dVc(e); - !!a.d && a.d.lg(e); - Rc(a.a, c2, (tCb(0, e.c.length), BD(e.c[0], 33))); - Rc(a.b, c2, BD(Ikb(e, e.c.length - 1), 33)); - } - } - } - } - function fnc(a) { - var b, c2, d, e, f2, g, h, i3, j, k; - c2 = 0; - for (h = new olb(a.d); h.a < h.c.c.length; ) { - g = BD(mlb(h), 101); - !!g.i && (g.i.c = c2++); - } - b = IC(sbb, [nie, dle], [177, 25], 16, [c2, c2], 2); - k = a.d; - for (e = 0; e < k.c.length; e++) { - i3 = (tCb(e, k.c.length), BD(k.c[e], 101)); - if (i3.i) { - for (f2 = e + 1; f2 < k.c.length; f2++) { - j = (tCb(f2, k.c.length), BD(k.c[f2], 101)); - if (j.i) { - d = knc(i3, j); - b[i3.i.c][j.i.c] = d; - b[j.i.c][i3.i.c] = d; - } - } - } - } - return b; - } - function ht(a, b, c2, d) { - var e, f2, g; - g = new qu(b, c2); - if (!a.a) { - a.a = a.e = g; - Rhb(a.b, b, new pu(g)); - ++a.c; - } else if (!d) { - a.e.b = g; - g.d = a.e; - a.e = g; - e = BD(Ohb(a.b, b), 283); - if (!e) { - Rhb(a.b, b, e = new pu(g)); - ++a.c; - } else { - ++e.a; - f2 = e.c; - f2.c = g; - g.e = f2; - e.c = g; - } - } else { - e = BD(Ohb(a.b, b), 283); - ++e.a; - g.d = d.d; - g.e = d.e; - g.b = d; - g.c = d; - !d.e ? BD(Ohb(a.b, b), 283).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 mfb(a, b) { - var c2, d, e, f2, g, h, i3, j; - c2 = new RegExp(b, "g"); - i3 = KC(ZI, nie, 2, 0, 6, 1); - d = 0; - j = a; - f2 = null; - while (true) { - h = c2.exec(j); - if (h == null || j == "") { - i3[d] = j; + case 20: + return 11; break; - } else { - g = h.index; - i3[d] = j.substr(0, g); - j = qfb(j, g + h[0].length, j.length); - c2.lastIndex = 0; - if (f2 == j) { - i3[d] = j.substr(0, 1); - j = j.substr(1); - } - f2 = j; - ++d; - } - } - if (a.length > 0) { - e = i3.length; - while (e > 0 && i3[e - 1] == "") { - --e; - } - e < i3.length && (i3.length = e); - } - return i3; - } - function f1d(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - l = _Kd(b); - j = null; - e = false; - for (h = 0, k = VKd(l.a).i; h < k; ++h) { - g = BD(nOd(l, h, (f2 = BD(qud(VKd(l.a), h), 87), i3 = f2.c, JD(i3, 88) ? BD(i3, 26) : (jGd(), _Fd))), 26); - c2 = f1d(a, g); - if (!c2.dc()) { - if (!j) { - j = c2; - } else { - if (!e) { - e = true; - j = new pFd(j); - } - j.Gc(c2); - } - } - } - d = k1d(a, b); - if (d.dc()) { - return !j ? (mmb(), mmb(), jmb) : j; - } else { - if (!j) { - return d; - } else { - e || (j = new pFd(j)); - j.Gc(d); - return j; - } - } - } - function g1d(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - l = _Kd(b); - j = null; - d = false; - for (h = 0, k = VKd(l.a).i; h < k; ++h) { - f2 = BD(nOd(l, h, (e = BD(qud(VKd(l.a), h), 87), i3 = e.c, JD(i3, 88) ? BD(i3, 26) : (jGd(), _Fd))), 26); - c2 = g1d(a, f2); - if (!c2.dc()) { - if (!j) { - j = c2; - } else { - if (!d) { - d = true; - j = new pFd(j); - } - j.Gc(c2); - } - } - } - g = n1d(a, b); - if (g.dc()) { - return !j ? (mmb(), mmb(), jmb) : j; - } else { - if (!j) { - return g; - } else { - d || (j = new pFd(j)); - j.Gc(g); - return j; - } - } - } - function B2d(a, b, c2) { - var d, e, f2, g, h, i3; - if (JD(b, 72)) { - return Txd(a, b, c2); - } else { - h = null; - f2 = null; - d = BD(a.g, 119); - for (g = 0; g < a.i; ++g) { - e = d[g]; - if (pb(b, e.dd())) { - f2 = e.ak(); - if (JD(f2, 99) && (BD(f2, 18).Bb & ote) != 0) { - h = e; - break; - } - } - } - if (h) { - if (oid(a.e)) { - i3 = f2.$j() ? H2d(a, 4, f2, b, null, M2d(a, f2, b, JD(f2, 99) && (BD(f2, 18).Bb & Tje) != 0), true) : H2d(a, f2.Kj() ? 2 : 1, f2, b, f2.zj(), -1, true); - c2 ? c2.Ei(i3) : c2 = i3; - } - c2 = B2d(a, h, c2); - } - return c2; - } - } - function pKb(a) { - var b, c2, d, e; - d = a.o; - $Jb(); - if (a.A.dc() || pb(a.A, ZJb)) { - e = d.a; - } else { - e = gIb(a.f); - if (a.A.Hc((tdd(), qdd)) && !a.B.Hc((Idd(), Edd))) { - e = $wnd.Math.max(e, gIb(BD(Mpb(a.p, (Ucd(), Acd)), 244))); - e = $wnd.Math.max(e, gIb(BD(Mpb(a.p, Rcd), 244))); - } - b = aKb(a); - !!b && (e = $wnd.Math.max(e, b.a)); - } - Ccb(DD(a.e.yf().We((Y9c(), $8c)))) ? d.a = $wnd.Math.max(d.a, e) : d.a = e; - c2 = a.f.i; - c2.c = 0; - c2.b = e; - hIb(a.f); - } - function $0d(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - c2 = b.Hh(a.a); - if (c2) { - i3 = GD(AAd((!c2.b && (c2.b = new sId((jGd(), fGd), x6, c2)), c2.b), "memberTypes")); - if (i3 != null) { - j = new Rkb(); - for (f2 = mfb(i3, "\\w"), g = 0, h = f2.length; g < h; ++g) { - e = f2[g]; - d = e.lastIndexOf("#"); - k = d == -1 ? w1d(a, b.Aj(), e) : d == 0 ? v1d(a, null, e.substr(1)) : v1d(a, e.substr(0, d), e.substr(d + 1)); - JD(k, 148) && Ekb(j, BD(k, 148)); - } - return j; - } - } - return mmb(), mmb(), jmb; - } - function tRb(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - Odd(c2, kme, 1); - a.bf(b); - f2 = 0; - while (a.df(f2)) { - for (k = new olb(b.e); k.a < k.c.c.length; ) { - i3 = BD(mlb(k), 144); - for (h = ul(pl(OC(GC(KI, 1), Uhe, 20, 0, [b.e, b.d, b.b]))); Qr(h); ) { - g = BD(Rr(h), 357); - if (g != i3) { - e = a.af(g, i3); - !!e && P6c(i3.a, e); - } - } - } - for (j = new olb(b.e); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 144); - d = i3.a; - Q6c(d, -a.d, -a.d, a.d, a.d); - P6c(i3.d, d); - X6c(d); - } - a.cf(); - ++f2; - } - Qdd(c2); - } - function $2d(a, b, c2) { - var d, e, f2, g; - g = S6d(a.e.Tg(), b); - d = BD(a.g, 119); - Q6d(); - if (BD(b, 66).Oj()) { - for (f2 = 0; f2 < a.i; ++f2) { - e = d[f2]; - if (g.rl(e.ak())) { - if (pb(e, c2)) { - Xxd(a, f2); - return true; - } - } - } - } else if (c2 != null) { - for (f2 = 0; f2 < a.i; ++f2) { - e = d[f2]; - if (g.rl(e.ak())) { - if (pb(c2, e.dd())) { - Xxd(a, f2); - return true; - } - } - } - } else { - for (f2 = 0; f2 < a.i; ++f2) { - e = d[f2]; - if (g.rl(e.ak())) { - if (e.dd() == null) { - Xxd(a, f2); - return true; - } - } - } - } - return false; - } - function sDc(a, b) { - var c2, d, e, f2, g; - a.c == null || a.c.length < b.c.length ? a.c = KC(sbb, dle, 25, b.c.length, 16, 1) : Blb(a.c); - a.a = new Rkb(); - d = 0; - for (g = new olb(b); g.a < g.c.c.length; ) { - e = BD(mlb(g), 10); - e.p = d++; - } - c2 = new Psb(); - for (f2 = new olb(b); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 10); - if (!a.c[e.p]) { - tDc(a, e); - c2.b == 0 || (sCb(c2.b != 0), BD(c2.a.a.c, 15)).gc() < a.a.c.length ? Esb(c2, a.a) : Fsb(c2, a.a); - a.a = new Rkb(); - } - } - return c2; - } - function jYc(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2; - g = BD(qud(b, 0), 33); - dld(g, 0); - eld(g, 0); - m = new Rkb(); - m.c[m.c.length] = g; - h = g; - f2 = new d$c(a.a, g.g, g.f, (k$c(), j$c)); - for (n = 1; n < b.i; n++) { - o2 = BD(qud(b, n), 33); - i3 = kYc(a, g$c, o2, h, f2, m, c2); - j = kYc(a, f$c, o2, h, f2, m, c2); - k = kYc(a, i$c, o2, h, f2, m, c2); - l = kYc(a, h$c, o2, h, f2, m, c2); - e = mYc(a, i3, j, k, l, o2, h, d); - dld(o2, e.d); - eld(o2, e.e); - c$c(e, j$c); - f2 = e; - h = o2; - m.c[m.c.length] = o2; - } - return f2; - } - function K0c(a) { - r4c(a, new E3c(P3c(M3c(O3c(N3c(new R3c(), ase), "ELK SPOrE Overlap Removal"), 'A node overlap removal algorithm proposed by Nachmanson et al. in "Node overlap removal by growing a tree".'), new N0c()))); - p4c(a, ase, Qre, Ksd(I0c)); - p4c(a, ase, ame, G0c); - p4c(a, ase, wme, 8); - p4c(a, ase, Vre, Ksd(H0c)); - p4c(a, ase, Yre, Ksd(E0c)); - p4c(a, ase, Zre, Ksd(F0c)); - p4c(a, ase, Zpe, (Bcb(), false)); - } - function sXb(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n; - g = O6c(b.c, c2, d); - for (l = new olb(b.a); l.a < l.c.c.length; ) { - k = BD(mlb(l), 10); - P6c(k.n, g); - for (n = new olb(k.j); n.a < n.c.c.length; ) { - m = BD(mlb(n), 11); - for (f2 = new olb(m.g); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 17); - q7c(e.a, g); - h = BD(vNb(e, (Nyc(), jxc)), 74); - !!h && q7c(h, g); - for (j = new olb(e.b); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 70); - P6c(i3.n, g); - } - } - } - Ekb(a.a, k); - k.a = a; - } - } - function g9b(a, b) { - var c2, d, e, f2, g; - Odd(b, "Node and Port Label Placement and Node Sizing", 1); - MGb((a$b(), new l$b(a, true, true, new j9b()))); - if (BD(vNb(a, (wtc(), Ksc)), 21).Hc((Orc(), Hrc))) { - f2 = BD(vNb(a, (Nyc(), Yxc)), 21); - e = f2.Hc((rcd(), ocd)); - g = Ccb(DD(vNb(a, Zxc))); - for (d = new olb(a.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 29); - MAb(JAb(new YAb(null, new Kub(c2.a, 16)), new l9b()), new n9b(f2, e, g)); - } - } - Qdd(b); - } - function Y0d(a, b) { - var c2, d, e, f2, g, h; - c2 = b.Hh(a.a); - if (c2) { - h = GD(AAd((!c2.b && (c2.b = new sId((jGd(), fGd), x6, c2)), c2.b), eue)); - if (h != null) { - e = kfb(h, wfb(35)); - d = b.Hj(); - if (e == -1) { - g = u1d(a, bKd(d)); - f2 = h; - } else if (e == 0) { - g = null; - f2 = h.substr(1); - } else { - g = h.substr(0, e); - f2 = h.substr(e + 1); - } - switch ($1d(q1d(a, b))) { - case 2: - case 3: { - return j1d(a, d, g, f2); - } - case 0: - case 4: - case 5: - case 6: { - return m1d(a, d, g, f2); - } - } - } - } - return null; - } - function q2d(a, b, c2) { - var d, e, f2, g, h; - g = (Q6d(), BD(b, 66).Oj()); - if (T6d(a.e, b)) { - if (b.hi() && F2d(a, b, c2, JD(b, 99) && (BD(b, 18).Bb & Tje) != 0)) { - return false; - } - } else { - h = S6d(a.e.Tg(), b); - d = BD(a.g, 119); - for (f2 = 0; f2 < a.i; ++f2) { - e = d[f2]; - if (h.rl(e.ak())) { - if (g ? pb(e, c2) : c2 == null ? e.dd() == null : pb(c2, e.dd())) { - return false; - } else { - BD(Gtd(a, f2, g ? BD(c2, 72) : R6d(b, c2)), 72); - return true; - } - } - } - } - return wtd(a, g ? BD(c2, 72) : R6d(b, c2)); - } - function uVb(a) { - var b, c2, d, e, f2, g, h, i3; - if (a.d) { - throw vbb(new Zdb((fdb(LP), Jke + LP.k + Kke))); - } - a.c == (ead(), cad) && tVb(a, aad); - for (c2 = new olb(a.a.a); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 189); - b.e = 0; - } - for (g = new olb(a.a.b); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 81); - f2.o = Qje; - for (e = f2.f.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 81); - ++d.d.e; - } - } - JVb(a); - for (i3 = new olb(a.a.b); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 81); - h.k = true; - } - return a; - } - function Ijc(a, b) { - var c2, d, e, f2, g, h, i3, j; - h = new pjc(a); - c2 = new Psb(); - Gsb(c2, b, c2.c.b, c2.c); - while (c2.b != 0) { - d = BD(c2.b == 0 ? null : (sCb(c2.b != 0), Nsb(c2, c2.a.a)), 113); - d.d.p = 1; - for (g = new olb(d.e); g.a < g.c.c.length; ) { - e = BD(mlb(g), 409); - kjc(h, e); - j = e.d; - j.d.p == 0 && (Gsb(c2, j, c2.c.b, c2.c), true); - } - for (f2 = new olb(d.b); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 409); - kjc(h, e); - i3 = e.c; - i3.d.p == 0 && (Gsb(c2, i3, c2.c.b, c2.c), true); - } - } - return h; - } - function hfd(a) { - var b, c2, d, e, f2; - d = Edb(ED(hkd(a, (Y9c(), G9c)))); - if (d == 1) { - return; - } - _kd(a, d * a.g, d * a.f); - c2 = Mq(Rq((!a.c && (a.c = new cUd(F2, a, 9, 9)), a.c), new Hfd())); - for (f2 = ul(pl(OC(GC(KI, 1), Uhe, 20, 0, [(!a.n && (a.n = new cUd(D2, a, 1, 7)), a.n), (!a.c && (a.c = new cUd(F2, a, 9, 9)), a.c), c2]))); Qr(f2); ) { - e = BD(Rr(f2), 470); - e.Gg(d * e.Dg(), d * e.Eg()); - e.Fg(d * e.Cg(), d * e.Bg()); - b = BD(e.We(r9c), 8); - if (b) { - b.a *= d; - b.b *= d; - } - } - } - function Mac(a, b, c2, d, e) { - var f2, g, h, i3, j, k, l, m; - for (g = new olb(a.b); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 29); - m = l_b(f2.a); - for (j = m, k = 0, l = j.length; k < l; ++k) { - i3 = j[k]; - switch (BD(vNb(i3, (Nyc(), mxc)), 163).g) { - case 1: - Qac(i3); - $_b(i3, b); - Nac(i3, true, d); - break; - case 3: - Rac(i3); - $_b(i3, c2); - Nac(i3, false, e); - } - } - } - h = new Bib(a.b, 0); - while (h.b < h.d.gc()) { - (sCb(h.b < h.d.gc()), BD(h.d.Xb(h.c = h.b++), 29)).a.c.length == 0 && uib(h); - } - } - function d1d(a, b) { - var c2, d, e, f2, g, h, i3; - c2 = b.Hh(a.a); - if (c2) { - i3 = GD(AAd((!c2.b && (c2.b = new sId((jGd(), fGd), x6, c2)), c2.b), Dwe)); - if (i3 != null) { - d = new Rkb(); - for (f2 = mfb(i3, "\\w"), g = 0, h = f2.length; g < h; ++g) { - e = f2[g]; - dfb(e, "##other") ? Ekb(d, "!##" + u1d(a, bKd(b.Hj()))) : dfb(e, "##local") ? (d.c[d.c.length] = null, true) : dfb(e, Bwe) ? Ekb(d, u1d(a, bKd(b.Hj()))) : (d.c[d.c.length] = e, true); - } - return d; - } - } - return mmb(), mmb(), jmb; - } - function kMb(a, b) { - var c2, d, e, f2; - c2 = new pMb(); - d = BD(GAb(NAb(new YAb(null, new Kub(a.f, 16)), c2), Ayb(new hzb(), new jzb(), new Gzb(), new Izb(), OC(GC(xL, 1), Kie, 132, 0, [(Fyb(), Eyb), Dyb]))), 21); - e = d.gc(); - d = BD(GAb(NAb(new YAb(null, new Kub(b.f, 16)), c2), Ayb(new hzb(), new jzb(), new Gzb(), new Izb(), OC(GC(xL, 1), Kie, 132, 0, [Eyb, Dyb]))), 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 hZb(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m; - h = a.i; - e = Ccb(DD(vNb(h, (Nyc(), fxc)))); - k = 0; - d = 0; - for (j = new olb(a.g); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 17); - g = OZb(i3); - f2 = g && e && Ccb(DD(vNb(i3, gxc))); - m = i3.d.i; - g && f2 ? ++d : g && !f2 ? ++k : Q_b(m).e == h ? ++d : ++k; - } - for (c2 = new olb(a.e); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 17); - g = OZb(b); - f2 = g && e && Ccb(DD(vNb(b, gxc))); - l = b.c.i; - g && f2 ? ++k : g && !f2 ? ++d : Q_b(l).e == h ? ++k : ++d; - } - return k - d; - } - function ULc(a, b, c2, d) { - this.e = a; - this.k = BD(vNb(a, (wtc(), otc)), 304); - this.g = KC(OQ, kne, 10, b, 0, 1); - this.b = KC(BI, nie, 333, b, 7, 1); - this.a = KC(OQ, kne, 10, b, 0, 1); - this.d = KC(BI, nie, 333, b, 7, 1); - this.j = KC(OQ, kne, 10, b, 0, 1); - this.i = KC(BI, nie, 333, b, 7, 1); - this.p = KC(BI, nie, 333, b, 7, 1); - this.n = KC(wI, nie, 476, b, 8, 1); - Alb(this.n, (Bcb(), false)); - this.f = KC(wI, nie, 476, b, 8, 1); - Alb(this.f, true); - this.o = c2; - this.c = d; - } - function X9b(a, b) { - var c2, d, e, f2, g, h; - if (b.dc()) { - return; - } - if (BD(b.Xb(0), 286).d == (Apc(), xpc)) { - O9b(a, b); - } else { - for (d = b.Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 286); - switch (c2.d.g) { - case 5: - K9b(a, c2, Q9b(a, c2)); - break; - case 0: - K9b(a, c2, (g = c2.f - c2.c + 1, h = (g - 1) / 2 | 0, c2.c + h)); - break; - case 4: - K9b(a, c2, S9b(a, c2)); - break; - case 2: - Y9b(c2); - K9b(a, c2, (f2 = U9b(c2), f2 ? c2.c : c2.f)); - break; - case 1: - Y9b(c2); - K9b(a, c2, (e = U9b(c2), e ? c2.f : c2.c)); - } - P9b(c2.a); - } - } - } - function C4b(a, b) { - var c2, d, e, f2, g, h, i3; - if (b.e) { - return; - } - b.e = true; - for (d = b.d.a.ec().Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 17); - if (b.o && b.d.a.gc() <= 1) { - g = b.a.c; - h = b.a.c + b.a.b; - i3 = new f7c(g + (h - g) / 2, b.b); - Dsb(BD(b.d.a.ec().Kc().Pb(), 17).a, i3); - continue; - } - e = BD(Ohb(b.c, c2), 459); - if (e.b || e.c) { - E4b(a, c2, b); - continue; - } - f2 = a.d == (tBc(), sBc) && (e.d || e.e) && K4b(a, b) && b.d.a.gc() <= 1; - f2 ? F4b(c2, b) : D4b(a, c2, b); - } - b.k && reb(b.d, new X4b()); - } - function zXc(a, b, c2, d, e, f2) { - var g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4; - m = f2; - h = (d + e) / 2 + m; - q = c2 * $wnd.Math.cos(h); - r = c2 * $wnd.Math.sin(h); - s = q - b.g / 2; - t4 = r - b.f / 2; - dld(b, s); - eld(b, t4); - l = a.a.jg(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 = gVc(b); - if (a.e) { - a.e.kg(a.d); - a.e.lg(o2); - } - for (j = new olb(o2); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 33); - k = a.a.jg(i3); - zXc(a, i3, c2 + a.c, g, g + n * k, f2); - g += n * k; - } - } - function jA(a, b, c2) { - var d; - d = c2.q.getMonth(); - switch (b) { - case 5: - Qfb(a, OC(GC(ZI, 1), nie, 2, 6, ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"])[d]); + case 21: + this.begin("NSTR2"); break; - case 4: - Qfb(a, OC(GC(ZI, 1), nie, 2, 6, [bje, cje, dje, eje, fje, gje, hje, ije, jje, kje, lje, mje])[d]); + case 22: + return "NODE_DESCR"; break; - case 3: - Qfb(a, OC(GC(ZI, 1), nie, 2, 6, ["Jan", "Feb", "Mar", "Apr", fje, "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"])[d]); + case 23: + this.popState(); break; - default: - EA(a, d + 1, b); - } - } - function uGb(a, b) { - var c2, d, e, f2, g; - Odd(b, "Network simplex", 1); - if (a.e.a.c.length < 1) { - Qdd(b); - return; - } - for (f2 = new olb(a.e.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 121); - e.e = 0; - } - g = a.e.a.c.length >= 40; - g && FGb(a); - wGb(a); - vGb(a); - c2 = zGb(a); - d = 0; - while (!!c2 && d < a.f) { - tGb(a, c2, sGb(a, c2)); - c2 = zGb(a); - ++d; - } - g && EGb(a); - a.a ? qGb(a, CGb(a)) : CGb(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; - Qdd(b); - } - function JQb(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m; - i3 = new f7c(c2, d); - c7c(i3, BD(vNb(b, (HSb(), ESb)), 8)); - for (m = new olb(b.e); m.a < m.c.c.length; ) { - l = BD(mlb(m), 144); - P6c(l.d, i3); - Ekb(a.e, l); - } - for (h = new olb(b.c); h.a < h.c.c.length; ) { - g = BD(mlb(h), 282); - for (f2 = new olb(g.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 559); - P6c(e.d, i3); - } - Ekb(a.c, g); - } - for (k = new olb(b.d); k.a < k.c.c.length; ) { - j = BD(mlb(k), 447); - P6c(j.d, i3); - Ekb(a.d, j); - } - } - function _Bc(a, b) { - var c2, d, e, f2, g, h, i3, j; - for (i3 = new olb(b.j); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 11); - for (e = new b1b(h.b); llb(e.a) || llb(e.b); ) { - d = BD(llb(e.a) ? mlb(e.a) : mlb(e.b), 17); - c2 = d.c == h ? d.d : d.c; - f2 = c2.i; - if (b == f2) { - continue; - } - j = BD(vNb(d, (Nyc(), cyc)), 19).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 && Dsb(a.f, f2); - } else { - a.c[g] -= j + 1; - a.c[g] <= 0 && a.a[g] > 0 && Dsb(a.e, f2); - } - } - } - } - } - function _Kb(a) { - var b, c2, d, e, f2, g, h, i3, j; - h = new Hxb(BD(Qb(new nLb()), 62)); - j = Qje; - for (c2 = new olb(a.d); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 222); - j = b.c.c; - while (h.a.c != 0) { - i3 = BD(zjb(Bwb(h.a)), 222); - if (i3.c.c + i3.c.b < j) { - Jwb(h.a, i3) != null; - } else { - break; - } - } - for (g = (e = new Ywb(new cxb(new Gjb(h.a).a).b), new Njb(e)); sib(g.a.a); ) { - f2 = (d = Wwb(g.a), BD(d.cd(), 222)); - Dsb(f2.b, b); - Dsb(b.b, f2); - } - Iwb(h.a, b, (Bcb(), zcb)) == null; - } - } - function QEc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l; - f2 = new Skb(b.c.length); - for (j = new olb(b); j.a < j.c.c.length; ) { - g = BD(mlb(j), 10); - Ekb(f2, a.b[g.c.p][g.p]); - } - LEc(a, f2, c2); - l = null; - while (l = MEc(f2)) { - NEc(a, BD(l.a, 233), BD(l.b, 233), f2); - } - b.c = KC(SI, Uhe, 1, 0, 5, 1); - for (e = new olb(f2); e.a < e.c.c.length; ) { - d = BD(mlb(e), 233); - for (h = d.d, i3 = 0, k = h.length; i3 < k; ++i3) { - g = h[i3]; - b.c[b.c.length] = g; - a.a[g.c.p][g.p].a = REc(d.g, d.d[0]).a; - } - } - } - function JRc(a, b) { - var c2, d, e, f2; - if (0 < (JD(a, 14) ? BD(a, 14).gc() : sr(a.Kc()))) { - e = b; - if (1 < e) { - --e; - f2 = new KRc(); - for (d = a.Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 86); - f2 = pl(OC(GC(KI, 1), Uhe, 20, 0, [f2, new ZRc(c2)])); - } - return JRc(f2, e); - } - if (e < 0) { - f2 = new NRc(); - for (d = a.Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 86); - f2 = pl(OC(GC(KI, 1), Uhe, 20, 0, [f2, new ZRc(c2)])); - } - if (0 < (JD(f2, 14) ? BD(f2, 14).gc() : sr(f2.Kc()))) { - return JRc(f2, e); - } - } - } - return BD(pr(a.Kc()), 86); - } - function Idd() { - Idd = ccb; - Bdd = new Jdd("DEFAULT_MINIMUM_SIZE", 0); - Ddd = new Jdd("MINIMUM_SIZE_ACCOUNTS_FOR_PADDING", 1); - Add = new Jdd("COMPUTE_PADDING", 2); - Edd = new Jdd("OUTSIDE_NODE_LABELS_OVERHANG", 3); - Fdd = new Jdd("PORTS_OVERHANG", 4); - Hdd = new Jdd("UNIFORM_PORT_SPACING", 5); - Gdd = new Jdd("SPACE_EFFICIENT_PORT_LABELS", 6); - Cdd = new Jdd("FORCE_TABULAR_NODE_LABELS", 7); - zdd = new Jdd("ASYMMETRICAL", 8); - } - function s6d(a, b) { - var c2, d, e, f2, g, h, i3, j; - if (!b) { - return null; - } else { - c2 = (f2 = b.Tg(), !f2 ? null : bKd(f2).Nh().Jh(f2)); - if (c2) { - Xrb(a, b, c2); - e = b.Tg(); - for (i3 = 0, j = (e.i == null && TKd(e), e.i).length; i3 < j; ++i3) { - h = (d = (e.i == null && TKd(e), e.i), i3 >= 0 && i3 < d.length ? d[i3] : null); - if (h.Ij() && !h.Jj()) { - if (JD(h, 322)) { - u6d(a, BD(h, 34), b, c2); - } else { - g = BD(h, 18); - (g.Bb & ote) != 0 && w6d(a, g, b, c2); - } - } - } - b.kh() && BD(c2, 49).vh(BD(b, 49).qh()); - } - return c2; - } - } - function tGb(a, b, c2) { - var d, e, f2; - if (!b.f) { - throw vbb(new Wdb("Given leave edge is no tree edge.")); - } - if (c2.f) { - throw vbb(new Wdb("Given enter edge is a tree edge already.")); - } - b.f = false; - Sqb(a.p, b); - c2.f = true; - Qqb(a.p, c2); - d = c2.e.e - c2.d.e - c2.a; - xGb(a, c2.e, b) || (d = -d); - for (f2 = new olb(a.e.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 121); - xGb(a, e, b) || (e.e += d); - } - a.j = 1; - Blb(a.c); - DGb(a, BD(mlb(new olb(a.e.a)), 121)); - rGb(a); - } - function x6b(a, b) { - var c2, d, e, f2, g, h; - h = BD(vNb(b, (Nyc(), Vxc)), 98); - if (!(h == (dcd(), _bd) || h == $bd)) { - return; - } - e = new f7c(b.f.a + b.d.b + b.d.c, b.f.b + b.d.d + b.d.a).b; - for (g = new olb(a.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 10); - if (f2.k != (j0b(), e0b)) { - continue; - } - c2 = BD(vNb(f2, (wtc(), Hsc)), 61); - if (c2 != (Ucd(), zcd) && c2 != Tcd) { - continue; - } - d = Edb(ED(vNb(f2, htc))); - h == _bd && (d *= e); - f2.n.b = d - BD(vNb(f2, Txc), 8).b; - M_b(f2, false, true); - } - } - function YDc(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n; - bEc(a, b, c2); - f2 = b[c2]; - n = d ? (Ucd(), Tcd) : (Ucd(), zcd); - if (ZDc(b.length, c2, d)) { - e = b[d ? c2 - 1 : c2 + 1]; - UDc(a, e, d ? (KAc(), IAc) : (KAc(), HAc)); - for (i3 = f2, k = 0, m = i3.length; k < m; ++k) { - g = i3[k]; - XDc(a, g, n); - } - UDc(a, f2, d ? (KAc(), HAc) : (KAc(), IAc)); - for (h = e, j = 0, l = h.length; j < l; ++j) { - g = h[j]; - !!g.e || XDc(a, g, Wcd(n)); - } - } else { - for (h = f2, j = 0, l = h.length; j < l; ++j) { - g = h[j]; - XDc(a, g, n); - } - } - return false; - } - function nFc(a, b, c2, d) { - var e, f2, g, h, i3, j, k; - i3 = V_b(b, c2); - (c2 == (Ucd(), Rcd) || c2 == Tcd) && (i3 = JD(i3, 152) ? km(BD(i3, 152)) : JD(i3, 131) ? BD(i3, 131).a : JD(i3, 54) ? new ov(i3) : new dv(i3)); - g = false; - do { - e = false; - for (f2 = 0; f2 < i3.gc() - 1; f2++) { - j = BD(i3.Xb(f2), 11); - h = BD(i3.Xb(f2 + 1), 11); - if (oFc(a, j, h, d)) { - g = true; - cIc(a.a, BD(i3.Xb(f2), 11), BD(i3.Xb(f2 + 1), 11)); - k = BD(i3.Xb(f2 + 1), 11); - i3._c(f2 + 1, BD(i3.Xb(f2), 11)); - i3._c(f2, k); - e = true; - } - } - } while (e); - return g; - } - function W2d(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2; - if (oid(a.e)) { - if (b != c2) { - e = BD(a.g, 119); - n = e[c2]; - g = n.ak(); - if (T6d(a.e, g)) { - o2 = S6d(a.e.Tg(), g); - i3 = -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.rl(f2.ak()); - j == b && (i3 = j == l && !k ? d - 1 : d); - k && ++d; - } - } - m = BD(Wxd(a, b, c2), 72); - h != i3 && GLd(a, new ESd(a.e, 7, g, meb(h), n.dd(), i3)); - return m; - } - } - } else { - return BD(sud(a, b, c2), 72); - } - return BD(Wxd(a, b, c2), 72); - } - function Qcc(a, b) { - var c2, d, e, f2, g, h, i3; - Odd(b, "Port order processing", 1); - i3 = BD(vNb(a, (Nyc(), _xc)), 421); - for (d = new olb(a.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 29); - for (f2 = new olb(c2.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 10); - g = BD(vNb(e, Vxc), 98); - h = e.j; - if (g == (dcd(), Zbd) || g == _bd || g == $bd) { - mmb(); - Okb(h, Icc); - } else if (g != bcd && g != ccd) { - mmb(); - Okb(h, Lcc); - Scc(h); - i3 == (BAc(), AAc) && Okb(h, Kcc); - } - e.i = true; - N_b(e); - } - } - Qdd(b); - } - function vDc(a) { - var b, c2, d, e, f2, g, h, i3; - i3 = new Lqb(); - b = new KFb(); - for (g = a.Kc(); g.Ob(); ) { - e = BD(g.Pb(), 10); - h = nGb(oGb(new pGb(), e), b); - jrb(i3.f, e, h); - } - for (f2 = a.Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 10); - for (d = new Sr(ur(U_b(e).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 17); - if (OZb(c2)) { - continue; - } - AFb(DFb(CFb(BFb(EFb(new FFb(), $wnd.Math.max(1, BD(vNb(c2, (Nyc(), dyc)), 19).a)), 1), BD(Ohb(i3, c2.c.i), 121)), BD(Ohb(i3, c2.d.i), 121))); - } - } - return b; - } - function tNc() { - tNc = ccb; - oNc = e3c(new j3c(), (qUb(), oUb), (S8b(), k8b)); - qNc = e3c(new j3c(), nUb, o8b); - rNc = c3c(e3c(new j3c(), nUb, C8b), pUb, B8b); - nNc = c3c(e3c(e3c(new j3c(), nUb, e8b), oUb, f8b), pUb, g8b); - sNc = b3c(b3c(g3c(c3c(e3c(new j3c(), lUb, M8b), pUb, L8b), oUb), K8b), N8b); - pNc = c3c(new j3c(), pUb, l8b); - lNc = c3c(e3c(e3c(e3c(new j3c(), mUb, r8b), oUb, t8b), oUb, u8b), pUb, s8b); - mNc = c3c(e3c(e3c(new j3c(), oUb, u8b), oUb, _7b), pUb, $7b); - } - function XC(a, b, c2, d, e, f2) { - var g, h, i3, j, k, l, m; - j = $C(b) - $C(a); - g = kD(b, j); - i3 = TC(0, 0, 0); - while (j >= 0) { - h = bD(a, g); - if (h) { - j < 22 ? (i3.l |= 1 << j, void 0) : j < 44 ? (i3.m |= 1 << j - 22, void 0) : (i3.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 && ZC(i3); - if (f2) { - if (d) { - QC = hD(a); - e && (QC = nD(QC, (wD(), uD))); - } else { - QC = TC(a.l, a.m, a.h); - } - } - return i3; - } - function TDc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - j = a.e[b.c.p][b.p] + 1; - i3 = b.c.a.c.length + 1; - for (h = new olb(a.a); h.a < h.c.c.length; ) { - g = BD(mlb(h), 11); - l = 0; - f2 = 0; - for (e = ul(pl(OC(GC(KI, 1), Uhe, 20, 0, [new J0b(g), new R0b(g)]))); Qr(e); ) { - d = BD(Rr(e), 11); - if (d.i.c == b.c) { - l += aEc(a, d.i) + 1; - ++f2; - } - } - c2 = l / f2; - k = g.j; - k == (Ucd(), zcd) ? c2 < j ? a.f[g.p] = a.c - c2 : a.f[g.p] = a.b + (i3 - c2) : k == Tcd && (c2 < j ? a.f[g.p] = a.b + c2 : a.f[g.p] = a.c - (i3 - c2)); - } - } - function Icb(a, b, c2) { - var d, e, f2, g, h; - if (a == null) { - throw vbb(new Oeb(Xhe)); - } - f2 = a.length; - g = f2 > 0 && (BCb(0, a.length), a.charCodeAt(0) == 45 || (BCb(0, a.length), a.charCodeAt(0) == 43)) ? 1 : 0; - for (d = g; d < f2; d++) { - if (Zcb((BCb(d, a.length), a.charCodeAt(d))) == -1) { - throw vbb(new Oeb(Oje + a + '"')); - } - } - h = parseInt(a, 10); - e = h < b; - if (isNaN(h)) { - throw vbb(new Oeb(Oje + a + '"')); - } else if (e || h > c2) { - throw vbb(new Oeb(Oje + a + '"')); - } - return h; - } - function dnc(a) { - var b, c2, d, e, f2, g, h; - g = new Psb(); - for (f2 = new olb(a.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 112); - pOc(e, e.f.c.length); - qOc(e, e.k.c.length); - if (e.i == 0) { - e.o = 0; - Gsb(g, e, g.c.b, g.c); - } - } - while (g.b != 0) { - e = BD(g.b == 0 ? null : (sCb(g.b != 0), Nsb(g, g.a.a)), 112); - d = e.o + 1; - for (c2 = new olb(e.f); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 129); - h = b.a; - rOc(h, $wnd.Math.max(h.o, d)); - qOc(h, h.i - 1); - h.i == 0 && (Gsb(g, h, g.c.b, g.c), true); - } - } - } - function v2c(a) { - var b, c2, d, e, f2, g, h, i3; - for (g = new olb(a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 79); - d = atd(BD(qud((!f2.b && (f2.b = new y5d(z2, f2, 4, 7)), f2.b), 0), 82)); - h = d.i; - i3 = d.j; - e = BD(qud((!f2.a && (f2.a = new cUd(A2, f2, 6, 6)), f2.a), 0), 202); - nmd(e, e.j + h, e.k + i3); - gmd(e, e.b + h, e.c + i3); - for (c2 = new Fyd((!e.a && (e.a = new xMd(y2, e, 5)), e.a)); c2.e != c2.i.gc(); ) { - b = BD(Dyd(c2), 469); - ukd(b, b.a + h, b.b + i3); - } - p7c(BD(hkd(f2, (Y9c(), Q8c)), 74), h, i3); - } - } - function fee(a) { - var b; - switch (a) { - case 100: - return kee(nxe, true); - case 68: - return kee(nxe, false); - case 119: - return kee(oxe, true); - case 87: - return kee(oxe, false); - case 115: - return kee(pxe, true); - case 83: - return kee(pxe, false); - case 99: - return kee(qxe, true); - case 67: - return kee(qxe, false); - case 105: - return kee(rxe, true); - case 73: - return kee(rxe, false); - default: - throw vbb(new hz((b = a, mxe + b.toString(16)))); - } - } - function $Xb(a) { - var b, c2, d, e, f2; - e = BD(Ikb(a.a, 0), 10); - b = new b0b(a); - Ekb(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 (BD(vNb(e, (wtc(), Hsc)), 61).g) { - case 4: - b.n.a += 2; + case 24: + yy.getLogger().trace("Starting NSTR"); + this.begin("NSTR"); break; - case 1: - b.n.b += 2; + case 25: + yy.getLogger().trace("description:", yy_.yytext); + return "NODE_DESCR"; break; - case 2: - b.n.a -= 2; + case 26: + this.popState(); break; - case 3: - b.n.b -= 2; - } - d = new H0b(); - F0b(d, b); - c2 = new UZb(); - f2 = BD(Ikb(e.j, 0), 11); - QZb(c2, f2); - RZb(c2, d); - P6c(X6c(d.n), f2.n); - P6c(X6c(d.a), f2.a); - return b; - } - function Fac(a, b, c2, d, e) { - if (c2 && (!d || (a.c - a.b & a.a.length - 1) > 1) && b == 1 && BD(a.a[a.b], 10).k == (j0b(), f0b)) { - zac(BD(a.a[a.b], 10), (rbd(), nbd)); - } else if (d && (!c2 || (a.c - a.b & a.a.length - 1) > 1) && b == 1 && BD(a.a[a.c - 1 & a.a.length - 1], 10).k == (j0b(), f0b)) { - zac(BD(a.a[a.c - 1 & a.a.length - 1], 10), (rbd(), obd)); - } else if ((a.c - a.b & a.a.length - 1) == 2) { - zac(BD(bkb(a), 10), (rbd(), nbd)); - zac(BD(bkb(a), 10), obd); - } else { - wac(a, e); - } - Yjb(a); - } - function pRc(a, b, c2) { - var d, e, f2, g, h; - f2 = 0; - for (e = new Fyd((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a)); e.e != e.i.gc(); ) { - d = BD(Dyd(e), 33); - g = ""; - (!d.n && (d.n = new cUd(D2, d, 1, 7)), d.n).i == 0 || (g = BD(qud((!d.n && (d.n = new cUd(D2, d, 1, 7)), d.n), 0), 137).a); - h = new XRc(f2++, b, g); - tNb(h, d); - yNb(h, (mTc(), dTc), 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); - Dsb(b.b, h); - jrb(c2.f, d, h); - } - } - function B2b(a) { - var b, c2, d, e, f2; - d = BD(vNb(a, (wtc(), $sc)), 33); - f2 = BD(hkd(d, (Nyc(), Fxc)), 174).Hc((tdd(), sdd)); - if (!a.e) { - e = BD(vNb(a, Ksc), 21); - b = new f7c(a.f.a + a.d.b + a.d.c, a.f.b + a.d.d + a.d.a); - if (e.Hc((Orc(), Hrc))) { - jkd(d, Vxc, (dcd(), $bd)); - Afd(d, b.a, b.b, false, true); - } else { - Ccb(DD(hkd(d, Gxc))) || Afd(d, b.a, b.b, true, true); - } - } - f2 ? jkd(d, Fxc, pqb(sdd)) : jkd(d, Fxc, (c2 = BD(gdb(I1), 9), new xqb(c2, BD(_Bb(c2, c2.length), 9), 0))); - } - function tA(a, b, c2) { - var d, e, f2, g; - if (b[0] >= a.length) { - c2.o = 0; - return true; - } - switch (bfb(a, b[0])) { - case 43: - e = 1; + case 27: + this.popState(); + yy.getLogger().trace("node end ))"); + return "NODE_DEND"; break; - case 45: - e = -1; + case 28: + this.popState(); + yy.getLogger().trace("node end )"); + return "NODE_DEND"; break; - default: - c2.o = 0; - return true; - } - ++b[0]; - f2 = b[0]; - g = rA(a, b); - if (g == 0 && b[0] == f2) { - return false; - } - if (b[0] < a.length && bfb(a, b[0]) == 58) { - d = g * 60; - ++b[0]; - f2 = b[0]; - g = rA(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 Hjc(a) { - var b, c2, d, e, f2, g, h, i3, j; - g = new Rkb(); - for (d = new Sr(ur(U_b(a.b).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 17); - OZb(c2) && Ekb(g, new Gjc(c2, Jjc(a, c2.c), Jjc(a, c2.d))); - } - for (j = (f2 = new $ib(a.e).a.vc().Kc(), new djb(f2)); j.a.Ob(); ) { - h = (b = BD(j.a.Pb(), 42), BD(b.dd(), 113)); - h.d.p = 0; - } - for (i3 = (e = new $ib(a.e).a.vc().Kc(), new djb(e)); i3.a.Ob(); ) { - h = (b = BD(i3.a.Pb(), 42), BD(b.dd(), 113)); - h.d.p == 0 && Ekb(a.d, Ijc(a, h)); - } - } - function W1b(a) { - var b, c2, d, e, f2, g, h; - f2 = mpd(a); - for (e = new Fyd((!a.e && (a.e = new y5d(B2, a, 7, 4)), a.e)); e.e != e.i.gc(); ) { - d = BD(Dyd(e), 79); - h = atd(BD(qud((!d.c && (d.c = new y5d(z2, d, 5, 8)), d.c), 0), 82)); - if (!ntd(h, f2)) { - return true; - } - } - for (c2 = new Fyd((!a.d && (a.d = new y5d(B2, a, 8, 5)), a.d)); c2.e != c2.i.gc(); ) { - b = BD(Dyd(c2), 79); - g = atd(BD(qud((!b.b && (b.b = new y5d(z2, b, 4, 7)), b.b), 0), 82)); - if (!ntd(g, f2)) { - return true; - } - } - return false; - } - function Dmc(a) { - var b, c2, d, e, f2, g, h, i3; - i3 = new s7c(); - b = Jsb(a, 0); - h = null; - c2 = BD(Xsb(b), 8); - e = BD(Xsb(b), 8); - while (b.b != b.d.c) { - h = c2; - c2 = e; - e = BD(Xsb(b), 8); - f2 = Emc(c7c(new f7c(h.a, h.b), c2)); - g = Emc(c7c(new f7c(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 = Eeb(f2.a) * d; - f2.b = Eeb(f2.b) * d; - g.a = Eeb(g.a) * d; - g.b = Eeb(g.b) * d; - Dsb(i3, P6c(f2, c2)); - Dsb(i3, P6c(g, c2)); - } - return i3; - } - function _hd(a, b, c2, d) { - var e, f2, g, h, i3; - g = a.eh(); - i3 = a.Zg(); - e = null; - if (i3) { - if (!!b && (Nid(a, b, c2).Bb & Tje) == 0) { - d = Txd(i3.Vk(), a, d); - a.uh(null); - e = b.fh(); - } else { - i3 = null; - } - } else { - !!g && (i3 = g.fh()); - !!b && (e = b.fh()); - } - i3 != e && !!i3 && i3.Zk(a); - h = a.Vg(); - a.Rg(b, c2); - i3 != e && !!e && e.Yk(a); - if (a.Lg() && a.Mg()) { - if (!!g && h >= 0 && h != c2) { - f2 = new nSd(a, 1, h, g, null); - !d ? d = f2 : d.Ei(f2); - } - if (c2 >= 0) { - f2 = new nSd(a, 1, c2, h == c2 ? g : null, b); - !d ? d = f2 : d.Ei(f2); - } - } - return d; - } - function LEd(a) { - var b, c2, d; - if (a.b == null) { - d = new Hfb(); - if (a.i != null) { - Efb(d, a.i); - d.a += ":"; - } - if ((a.f & 256) != 0) { - if ((a.f & 256) != 0 && a.a != null) { - YEd(a.i) || (d.a += "//", d); - Efb(d, a.a); - } - if (a.d != null) { - d.a += "/"; - Efb(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); - Efb(d, a.j[b]); - } - if (a.g != null) { - d.a += "?"; - Efb(d, a.g); - } - } else { - Efb(d, a.a); - } - if (a.e != null) { - d.a += "#"; - Efb(d, a.e); - } - a.b = d.a; - } - return a.b; - } - function E5b(a, b) { - var c2, d, e, f2, g, h; - for (e = new olb(b.a); e.a < e.c.c.length; ) { - d = BD(mlb(e), 10); - f2 = vNb(d, (wtc(), $sc)); - if (JD(f2, 11)) { - g = BD(f2, 11); - h = b_b(b, d, g.o.a, g.o.b); - g.n.a = h.a; - g.n.b = h.b; - G0b(g, BD(vNb(d, Hsc), 61)); - } - } - c2 = new f7c(b.f.a + b.d.b + b.d.c, b.f.b + b.d.d + b.d.a); - if (BD(vNb(b, (wtc(), Ksc)), 21).Hc((Orc(), Hrc))) { - yNb(a, (Nyc(), Vxc), (dcd(), $bd)); - BD(vNb(Q_b(a), Ksc), 21).Fc(Krc); - j_b(a, c2, false); - } else { - j_b(a, c2, true); - } - } - function YFc(a, b, c2) { - var d, e, f2, g, h, i3; - Odd(c2, "Minimize Crossings " + a.a, 1); - d = b.b.c.length == 0 || !WAb(JAb(new YAb(null, new Kub(b.b, 16)), new Xxb(new xGc()))).sd((EAb(), DAb)); - i3 = b.b.c.length == 1 && BD(Ikb(b.b, 0), 29).a.c.length == 1; - f2 = PD(vNb(b, (Nyc(), axc))) === PD((hbd(), ebd)); - if (d || i3 && !f2) { - Qdd(c2); - return; - } - e = TFc(a, b); - g = (h = BD(Ut(e, 0), 214), h.c.Rf() ? h.c.Lf() ? new kGc(a) : new mGc(a) : new iGc(a)); - UFc(e, g); - eGc(a); - Qdd(c2); - } - function so(a, b, c2, d) { - var e, f2, g, h, i3; - i3 = Tbb(Ibb(Eie, keb(Tbb(Ibb(b == null ? 0 : tb(b), Fie)), 15))); - e = Tbb(Ibb(Eie, keb(Tbb(Ibb(c2 == null ? 0 : tb(c2), Fie)), 15))); - h = vo(a, b, i3); - g = uo(a, c2, e); - if (!!h && e == h.a && Hb(c2, h.g)) { - return c2; - } else if (!!g && !d) { - throw vbb(new Wdb("key already present: " + c2)); - } - !!h && mo(a, h); - !!g && mo(a, g); - f2 = new $o(c2, e, b, i3); - po(a, f2, g); - if (g) { - g.e = null; - g.c = null; - } - if (h) { - h.e = null; - h.c = null; - } - to(a); - return !h ? null : h.g; - } - function Lhb(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 = wbb(wbb(Ibb(xbb(a[f2], Yje), xbb(a[h], Yje)), xbb(c2[f2 + h], Yje)), xbb(Tbb(d), Yje)); - c2[f2 + h] = Tbb(d); - d = Pbb(d, 32); - } - c2[f2 + b] = Tbb(d); - } - khb(c2, c2, b << 1); - d = 0; - for (e = 0, g = 0; e < b; ++e, g++) { - d = wbb(wbb(Ibb(xbb(a[e], Yje), xbb(a[e], Yje)), xbb(c2[g], Yje)), xbb(Tbb(d), Yje)); - c2[g] = Tbb(d); - d = Pbb(d, 32); - ++g; - d = wbb(d, xbb(c2[g], Yje)); - c2[g] = Tbb(d); - d = Pbb(d, 32); - } - return c2; - } - function ZJc(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - if (Qq(b)) { - return; - } - i3 = Edb(ED(pBc(c2.c, (Nyc(), zyc)))); - j = BD(pBc(c2.c, yyc), 142); - !j && (j = new H_b()); - d = c2.a; - e = null; - for (h = b.Kc(); h.Ob(); ) { - g = BD(h.Pb(), 11); - k = 0; - if (!e) { - k = j.d; - } else { - k = i3; - k += e.o.b; - } - f2 = nGb(oGb(new pGb(), g), a.f); - Rhb(a.k, g, f2); - AFb(DFb(CFb(BFb(EFb(new FFb(), 0), QD($wnd.Math.ceil(k))), d), f2)); - e = g; - d = f2; - } - AFb(DFb(CFb(BFb(EFb(new FFb(), 0), QD($wnd.Math.ceil(j.a + e.o.b))), d), c2.d)); - } - function uZc(a, b, c2, d, e, f2, g, h) { - var i3, j, k, l, m, n; - n = false; - m = f2 - c2.s; - k = c2.t - b.f + (j = MZc(c2, m, false), j.a); - if (d.g + h > m) { - return false; - } - l = (i3 = MZc(d, m, false), i3.a); - if (k + h + l <= b.b) { - KZc(c2, f2 - c2.s); - c2.c = true; - KZc(d, f2 - c2.s); - OZc(d, c2.s, c2.t + c2.d + h); - d.k = true; - WZc(c2.q, d); - n = true; - if (e) { - s$c(b, d); - d.j = b; - if (a.c.length > g) { - v$c((tCb(g, a.c.length), BD(a.c[g], 200)), d); - (tCb(g, a.c.length), BD(a.c[g], 200)).a.c.length == 0 && Kkb(a, g); - } - } - } - return n; - } - function kcc(a, b) { - var c2, d, e, f2, g, h; - Odd(b, "Partition midprocessing", 1); - e = new Hp(); - MAb(JAb(new YAb(null, new Kub(a.a, 16)), new occ()), new qcc(e)); - if (e.d == 0) { - return; - } - h = BD(GAb(UAb((f2 = e.i, new YAb(null, (!f2 ? e.i = new zf(e, e.c) : f2).Nc()))), Byb(new fzb(), new dzb(), new Ezb(), OC(GC(xL, 1), Kie, 132, 0, [(Fyb(), Dyb)]))), 15); - d = h.Kc(); - c2 = BD(d.Pb(), 19); - while (d.Ob()) { - g = BD(d.Pb(), 19); - jcc(BD(Qc(e, c2), 21), BD(Qc(e, g), 21)); - c2 = g; - } - Qdd(b); - } - function DYb(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - if (b.p == 0) { - b.p = 1; - g = c2; - if (!g) { - e = new Rkb(); - f2 = (d = BD(gdb(F1), 9), new xqb(d, BD(_Bb(d, d.length), 9), 0)); - g = new vgd(e, f2); - } - BD(g.a, 15).Fc(b); - b.k == (j0b(), e0b) && BD(g.b, 21).Fc(BD(vNb(b, (wtc(), Hsc)), 61)); - for (i3 = new olb(b.j); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 11); - for (k = ul(pl(OC(GC(KI, 1), Uhe, 20, 0, [new J0b(h), new R0b(h)]))); Qr(k); ) { - j = BD(Rr(k), 11); - DYb(a, j.i, g); - } - } - return g; - } - return null; - } - function Dmd(a, b) { - var c2, d, e, f2, g; - if (a.Ab) { - if (a.Ab) { - g = a.Ab.i; - if (g > 0) { - e = BD(a.Ab.g, 1934); - 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 (dfb(b, c2.d)) { - return c2; - } - } - } - } - } else { - if (b == null) { - for (d = new Fyd(a.Ab); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 590); - if (c2.d == null) { - return c2; - } - } - } else { - for (d = new Fyd(a.Ab); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 590); - if (dfb(b, c2.d)) { - return c2; - } - } - } - } - } - return null; - } - function gRc(a, b) { - var c2, d, e, f2, g, h, i3, j; - j = DD(vNb(b, (JTc(), GTc))); - if (j == null || (uCb(j), j)) { - dRc(a, b); - e = new Rkb(); - for (i3 = Jsb(b.b, 0); i3.b != i3.d.c; ) { - g = BD(Xsb(i3), 86); - c2 = cRc(a, g, null); - if (c2) { - tNb(c2, b); - e.c[e.c.length] = c2; - } - } - a.a = null; - a.b = null; - if (e.c.length > 1) { - for (d = new olb(e); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 135); - f2 = 0; - for (h = Jsb(c2.b, 0); h.b != h.d.c; ) { - g = BD(Xsb(h), 86); - g.g = f2++; - } - } - } - return e; - } - return Ou(OC(GC(n$, 1), fme, 135, 0, [b])); - } - function rqd(a, b, c2, d, e) { - var f2, g, h, i3, j, k, l, m, n, p, q, r, s, t4, u2, v; - n = Sqd(a, etd(b), e); - jmd(n, _pd(e, Vte)); - o = null; - p = e; - q = $pd(p, Yte); - r = new urd(n); - wqd(r.a, q); - s = $pd(p, "endPoint"); - t4 = new yrd(n); - yqd(t4.a, s); - u2 = Ypd(p, Ote); - v = new Brd(n); - zqd(v.a, u2); - l = _pd(e, Qte); - f2 = new qrd(a, n); - sqd(f2.a, f2.b, l); - m = _pd(e, Pte); - g = new rrd(a, n); - tqd(g.a, g.b, m); - j = Ypd(e, Ste); - h = new srd(c2, n); - uqd(h.b, h.a, j); - k = Ypd(e, Rte); - i3 = new trd(d, n); - vqd(i3.b, i3.a, k); - } - function i_b(a, b, c2) { - var d, e, f2, g, h; - h = null; - switch (b.g) { - case 1: - for (e = new olb(a.j); e.a < e.c.c.length; ) { - d = BD(mlb(e), 11); - if (Ccb(DD(vNb(d, (wtc(), Msc))))) { - return d; - } - } - h = new H0b(); - yNb(h, (wtc(), Msc), (Bcb(), true)); + case 29: + this.popState(); + yy.getLogger().trace("node end ...", yy_.yytext); + return "NODE_DEND"; break; - case 2: - for (g = new olb(a.j); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 11); - if (Ccb(DD(vNb(f2, (wtc(), etc))))) { - return f2; - } - } - h = new H0b(); - yNb(h, (wtc(), etc), (Bcb(), true)); - } - if (h) { - F0b(h, a); - G0b(h, c2); - X$b(h.n, a.o, c2); - } - return h; - } - function O3b(a, b) { - var c2, d, e, f2, g, h; - h = -1; - g = new Psb(); - for (d = new b1b(a.b); llb(d.a) || llb(d.b); ) { - c2 = BD(llb(d.a) ? mlb(d.a) : mlb(d.b), 17); - h = $wnd.Math.max(h, Edb(ED(vNb(c2, (Nyc(), Zwc))))); - c2.c == a ? MAb(JAb(new YAb(null, new Kub(c2.b, 16)), new U3b()), new W3b(g)) : MAb(JAb(new YAb(null, new Kub(c2.b, 16)), new Y3b()), new $3b(g)); - for (f2 = Jsb(g, 0); f2.b != f2.d.c; ) { - e = BD(Xsb(f2), 70); - wNb(e, (wtc(), Dsc)) || yNb(e, Dsc, c2); - } - Gkb(b, g); - Osb(g); - } - return h; - } - function _bc(a, b, c2, d, e) { - var f2, g, h, i3; - f2 = new b0b(a); - __b(f2, (j0b(), i0b)); - yNb(f2, (Nyc(), Vxc), (dcd(), $bd)); - yNb(f2, (wtc(), $sc), b.c.i); - g = new H0b(); - yNb(g, $sc, b.c); - G0b(g, e); - F0b(g, f2); - yNb(b.c, gtc, f2); - h = new b0b(a); - __b(h, i0b); - yNb(h, Vxc, $bd); - yNb(h, $sc, b.d.i); - i3 = new H0b(); - yNb(i3, $sc, b.d); - G0b(i3, e); - F0b(i3, h); - yNb(b.d, gtc, h); - QZb(b, g); - RZb(b, i3); - wCb(0, c2.c.length); - aCb(c2.c, 0, f2); - d.c[d.c.length] = h; - yNb(f2, ysc, meb(1)); - yNb(h, ysc, meb(1)); - } - function BPc(a, b, c2, d, e) { - var f2, g, h, i3, j; - h = e ? d.b : d.a; - if (Rqb(a.a, d)) { - return; - } - j = h > c2.s && h < c2.c; - i3 = false; - if (c2.e.b != 0 && c2.j.b != 0) { - i3 = i3 | ($wnd.Math.abs(h - Edb(ED(Hsb(c2.e)))) < qme && $wnd.Math.abs(h - Edb(ED(Hsb(c2.j)))) < qme); - i3 = i3 | ($wnd.Math.abs(h - Edb(ED(Isb(c2.e)))) < qme && $wnd.Math.abs(h - Edb(ED(Isb(c2.j)))) < qme); - } - if (j || i3) { - g = BD(vNb(b, (Nyc(), jxc)), 74); - if (!g) { - g = new s7c(); - yNb(b, jxc, g); - } - f2 = new g7c(d); - Gsb(g, f2, g.c.b, g.c); - Qqb(a.a, f2); - } - } - function gNb(a, b, c2, d) { - var e, f2, g, h, i3, j, k; - if (fNb(a, b, c2, d)) { - return true; - } else { - for (g = new olb(b.f); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 324); - h = false; - i3 = a.j - b.j + c2; - j = i3 + b.o; - k = a.k - b.k + d; - e = k + b.p; - switch (f2.a.g) { - case 0: - h = oNb(a, i3 + f2.b.a, 0, i3 + f2.c.a, k - 1); - break; - case 1: - h = oNb(a, j, k + f2.b.a, a.o - 1, k + f2.c.a); - break; - case 2: - h = oNb(a, i3 + f2.b.a, e, i3 + f2.c.a, a.p - 1); - break; - default: - h = oNb(a, 0, k + f2.b.a, i3 - 1, k + f2.c.a); - } - if (h) { - return true; - } - } - } - return false; - } - function LMc(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - for (g = new olb(b.b); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 29); - for (j = new olb(f2.a); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 10); - k = new Rkb(); - h = 0; - for (d = new Sr(ur(R_b(i3).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 17); - if (OZb(c2) || !OZb(c2) && c2.c.i.c == c2.d.i.c) { - continue; - } - e = BD(vNb(c2, (Nyc(), eyc)), 19).a; - if (e > h) { - h = e; - k.c = KC(SI, Uhe, 1, 0, 5, 1); - } - e == h && Ekb(k, new vgd(c2.c.i, c2)); - } - mmb(); - Okb(k, a.c); - Dkb(a.b, i3.p, k); - } - } - } - function MMc(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - for (g = new olb(b.b); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 29); - for (j = new olb(f2.a); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 10); - k = new Rkb(); - h = 0; - for (d = new Sr(ur(U_b(i3).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 17); - if (OZb(c2) || !OZb(c2) && c2.c.i.c == c2.d.i.c) { - continue; - } - e = BD(vNb(c2, (Nyc(), eyc)), 19).a; - if (e > h) { - h = e; - k.c = KC(SI, Uhe, 1, 0, 5, 1); - } - e == h && Ekb(k, new vgd(c2.d.i, c2)); - } - mmb(); - Okb(k, a.c); - Dkb(a.f, i3.p, k); - } - } - } - function Y7c(a) { - r4c(a, new E3c(P3c(M3c(O3c(N3c(new R3c(), qse), "ELK Box"), "Algorithm for packing of unconnected boxes, i.e. graphs without edges."), new _7c()))); - p4c(a, qse, ame, U7c); - p4c(a, qse, wme, 15); - p4c(a, qse, vme, meb(0)); - p4c(a, qse, Jre, Ksd(O7c)); - p4c(a, qse, Fme, Ksd(Q7c)); - p4c(a, qse, Eme, Ksd(S7c)); - p4c(a, qse, _le, pse); - p4c(a, qse, Ame, Ksd(P7c)); - p4c(a, qse, Tme, Ksd(R7c)); - p4c(a, qse, rse, Ksd(M7c)); - p4c(a, qse, lqe, Ksd(N7c)); - } - function W$b(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - e = a.i; - g = e.o.a; - f2 = e.o.b; - if (g <= 0 && f2 <= 0) { - return Ucd(), Scd; - } - 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 Ucd(), Tcd; - } else if (j + h > g) { - return Ucd(), zcd; - } - break; - case 4: - case 3: - if (k < 0) { - return Ucd(), Acd; - } else if (k + c2 > f2) { - return Ucd(), Rcd; - } - } - i3 = (j + h / 2) / g; - d = (k + c2 / 2) / f2; - return i3 + d <= 1 && i3 - d <= 0 ? (Ucd(), Tcd) : i3 + d >= 1 && i3 - d >= 0 ? (Ucd(), zcd) : d < 0.5 ? (Ucd(), Acd) : (Ucd(), Rcd); - } - function pJc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p; - c2 = false; - k = Edb(ED(vNb(b, (Nyc(), vyc)))); - o2 = Qie * k; - for (e = new olb(b.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 29); - j = new olb(d.a); - f2 = BD(mlb(j), 10); - l = xJc(a.a[f2.p]); - while (j.a < j.c.c.length) { - h = BD(mlb(j), 10); - m = xJc(a.a[h.p]); - if (l != m) { - n = jBc(a.b, f2, h); - g = f2.n.b + f2.o.b + f2.d.a + l.a + n; - i3 = h.n.b - h.d.d + m.a; - if (g > i3 + 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 VGb(a, b, c2, d, e, f2, g) { - var h, i3, j, k, l, m; - m = new I6c(); - for (j = b.Kc(); j.Ob(); ) { - h = BD(j.Pb(), 839); - for (l = new olb(h.wf()); l.a < l.c.c.length; ) { - k = BD(mlb(l), 181); - if (PD(k.We((Y9c(), C8c))) === PD((qad(), pad2))) { - SGb(m, k, false, d, e, f2, g); - H6c(a, m); - } - } - } - for (i3 = c2.Kc(); i3.Ob(); ) { - h = BD(i3.Pb(), 839); - for (l = new olb(h.wf()); l.a < l.c.c.length; ) { - k = BD(mlb(l), 181); - if (PD(k.We((Y9c(), C8c))) === PD((qad(), oad))) { - SGb(m, k, true, d, e, f2, g); - H6c(a, m); - } - } - } - } - function oRc(a, b, c2) { - var d, e, f2, g, h, i3, j; - for (g = new Fyd((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a)); g.e != g.i.gc(); ) { - f2 = BD(Dyd(g), 33); - for (e = new Sr(ur(_sd(f2).a.Kc(), new Sq())); Qr(e); ) { - d = BD(Rr(e), 79); - if (!Pld(d) && !Pld(d) && !Qld(d)) { - i3 = BD(Wd(irb(c2.f, f2)), 86); - j = BD(Ohb(c2, atd(BD(qud((!d.c && (d.c = new y5d(z2, d, 5, 8)), d.c), 0), 82))), 86); - if (!!i3 && !!j) { - h = new QRc(i3, j); - yNb(h, (mTc(), dTc), d); - tNb(h, d); - Dsb(i3.d, h); - Dsb(j.b, h); - Dsb(b.a, h); - } - } - } - } - } - function QKb(a, b) { - var c2, d, e, f2, g, h, i3, j; - for (i3 = BD(BD(Qc(a.r, b), 21), 84).Kc(); i3.Ob(); ) { - h = BD(i3.Pb(), 111); - e = h.c ? YHb(h.c) : 0; - if (e > 0) { - if (h.a) { - j = h.b.rf().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 = BD(Ikb(h.c.d, 0), 181).rf().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 (tcd(a.u)) { - f2 = sfd(h.b); - f2.d < 0 && (h.d.d = -f2.d); - f2.d + f2.a > h.b.rf().b && (h.d.a = f2.d + f2.a - h.b.rf().b); - } - } - } - function FC(a, b) { - var c2; - switch (HC(a)) { - case 6: - return ND(b); - case 7: - return LD(b); - case 8: - return KD(b); - case 3: - return Array.isArray(b) && (c2 = HC(b), !(c2 >= 14 && c2 <= 16)); - case 11: - return b != null && typeof b === Nhe; - case 12: - return b != null && (typeof b === Jhe || typeof b == Nhe); - case 0: - return AD(b, a.__elementTypeId$); - case 2: - return OD(b) && !(b.im === gcb); - case 1: - return OD(b) && !(b.im === gcb) || AD(b, a.__elementTypeId$); - default: - return true; - } - } - function xOb(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 mgb(a, b) { - var c2, d, e, f2, g, h; - e = pgb(a); - h = pgb(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) * Xje) + 1) - (b.d > 0 ? b.d : $wnd.Math.floor((b.a - 1) * Xje) + 1); - if (c2 > d + 1) { - return e; - } else if (c2 < d - 1) { - return -e; - } else { - f2 = (!a.c && (a.c = fhb(a.f)), a.c); - g = (!b.c && (b.c = fhb(b.f)), b.c); - d < 0 ? f2 = Ogb(f2, Khb(-d)) : d > 0 && (g = Ogb(g, Khb(d))); - return Igb(f2, g); - } - } else - return e < h ? -1 : 1; - } - function mTb(a, b) { - var c2, d, e, f2, g, h, i3; - f2 = 0; - h = 0; - i3 = 0; - for (e = new olb(a.f.e); e.a < e.c.c.length; ) { - d = BD(mlb(e), 144); - if (b == d) { - continue; - } - g = a.i[b.b][d.b]; - f2 += g; - c2 = S6c(b.d, d.d); - c2 > 0 && a.d != (yTb(), xTb) && (h += g * (d.d.a + a.a[b.b][d.b] * (b.d.a - d.d.a) / c2)); - c2 > 0 && a.d != (yTb(), vTb) && (i3 += g * (d.d.b + a.a[b.b][d.b] * (b.d.b - d.d.b) / c2)); - } - switch (a.d.g) { - case 1: - return new f7c(h / f2, b.d.b); - case 2: - return new f7c(b.d.a, i3 / f2); - default: - return new f7c(h / f2, i3 / f2); - } - } - function Wcc(a, b) { - Occ(); - var c2, d, e, f2, g; - g = BD(vNb(a.i, (Nyc(), Vxc)), 98); - f2 = a.j.g - b.j.g; - if (f2 != 0 || !(g == (dcd(), Zbd) || g == _bd || g == $bd)) { - return 0; - } - if (g == (dcd(), Zbd)) { - c2 = BD(vNb(a, Wxc), 19); - d = BD(vNb(b, Wxc), 19); - if (!!c2 && !!d) { - e = c2.a - d.a; - if (e != 0) { - return e; - } - } - } - switch (a.j.g) { - case 1: - return Kdb(a.n.a, b.n.a); - case 2: - return Kdb(a.n.b, b.n.b); - case 3: - return Kdb(b.n.a, a.n.a); - case 4: - return Kdb(b.n.b, a.n.b); - default: - throw vbb(new Zdb(ine)); - } - } - function tfd(a) { - var b, c2, d, e, f2, g; - c2 = (!a.a && (a.a = new xMd(y2, a, 5)), a.a).i + 2; - g = new Skb(c2); - Ekb(g, new f7c(a.j, a.k)); - MAb(new YAb(null, (!a.a && (a.a = new xMd(y2, a, 5)), new Kub(a.a, 16))), new Qfd(g)); - Ekb(g, new f7c(a.b, a.c)); - b = 1; - while (b < g.c.length - 1) { - d = (tCb(b - 1, g.c.length), BD(g.c[b - 1], 8)); - e = (tCb(b, g.c.length), BD(g.c[b], 8)); - f2 = (tCb(b + 1, g.c.length), BD(g.c[b + 1], 8)); - d.a == e.a && e.a == f2.a || d.b == e.b && e.b == f2.b ? Kkb(g, b) : ++b; - } - return g; - } - function Xgc(a, b) { - var c2, d, e, f2, g, h, i3; - c2 = vDb(yDb(wDb(xDb(new zDb(), b), new K6c(b.e)), Ggc), a.a); - b.j.c.length == 0 || nDb(BD(Ikb(b.j, 0), 57).a, c2); - i3 = new lEb(); - Rhb(a.e, c2, i3); - g = new Tqb(); - h = new Tqb(); - for (f2 = new olb(b.k); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 17); - Qqb(g, e.c); - Qqb(h, e.d); - } - d = g.a.gc() - h.a.gc(); - if (d < 0) { - jEb(i3, true, (ead(), aad)); - jEb(i3, false, bad); - } else if (d > 0) { - jEb(i3, false, (ead(), aad)); - jEb(i3, true, bad); - } - Hkb(b.g, new $hc(a, c2)); - Rhb(a.g, b, c2); - } - function Neb() { - Neb = ccb; - var a; - Jeb = OC(GC(WD, 1), oje, 25, 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]); - Keb = KC(WD, oje, 25, 37, 15, 1); - Leb = OC(GC(WD, 1), oje, 25, 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]); - Meb = KC(XD, Sje, 25, 37, 14, 1); - for (a = 2; a <= 36; a++) { - Keb[a] = QD($wnd.Math.pow(a, Jeb[a])); - Meb[a] = Abb(rie, Keb[a]); - } - } - function pfd(a) { - var b; - if ((!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a).i != 1) { - throw vbb(new Wdb(Tse + (!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a).i)); - } - b = new s7c(); - !!btd(BD(qud((!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b), 0), 82)) && ye(b, qfd(a, btd(BD(qud((!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b), 0), 82)), false)); - !!btd(BD(qud((!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c), 0), 82)) && ye(b, qfd(a, btd(BD(qud((!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c), 0), 82)), true)); - return b; - } - function _Mc(a, b) { - var c2, d, e, f2, g; - b.d ? e = a.a.c == (YLc(), XLc) ? R_b(b.b) : U_b(b.b) : e = a.a.c == (YLc(), WLc) ? R_b(b.b) : U_b(b.b); - f2 = false; - for (d = new Sr(ur(e.a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 17); - g = Ccb(a.a.f[a.a.g[b.b.p].p]); - if (!g && !OZb(c2) && c2.c.i.c == c2.d.i.c) { - continue; - } - if (Ccb(a.a.n[a.a.g[b.b.p].p]) || Ccb(a.a.n[a.a.g[b.b.p].p])) { - continue; - } - f2 = true; - if (Rqb(a.b, a.a.g[TMc(c2, b.b).p])) { - b.c = true; - b.a = c2; - return b; - } - } - b.c = f2; - b.a = null; - return b; - } - function bed(a, b, c2, d, e) { - var f2, g, h, i3, j, k, l; - mmb(); - Okb(a, new Red()); - h = new Bib(a, 0); - l = new Rkb(); - f2 = 0; - while (h.b < h.d.gc()) { - g = (sCb(h.b < h.d.gc()), BD(h.d.Xb(h.c = h.b++), 157)); - if (l.c.length != 0 && red(g) * qed(g) > f2 * 2) { - k = new wed(l); - j = red(g) / qed(g); - i3 = fed(k, b, new p0b(), c2, d, e, j); - P6c(X6c(k.e), i3); - l.c = KC(SI, Uhe, 1, 0, 5, 1); - f2 = 0; - l.c[l.c.length] = k; - l.c[l.c.length] = g; - f2 = red(k) * qed(k) + red(g) * qed(g); - } else { - l.c[l.c.length] = g; - f2 += red(g) * qed(g); - } - } - return l; - } - function qwd(a, b, c2) { - var d, e, f2, g, h, i3, j; - d = c2.gc(); - if (d == 0) { - return false; - } else { - if (a.ej()) { - i3 = a.fj(); - zvd(a, b, c2); - g = d == 1 ? a.Zi(3, null, c2.Kc().Pb(), b, i3) : a.Zi(5, null, c2, b, i3); - if (a.bj()) { - h = d < 100 ? null : new Ixd(d); - f2 = b + d; - for (e = b; e < f2; ++e) { - j = a.Oi(e); - h = a.cj(j, h); - h = h; - } - if (!h) { - a.$i(g); - } else { - h.Ei(g); - h.Fi(); - } - } else { - a.$i(g); - } - } else { - zvd(a, b, c2); - if (a.bj()) { - h = d < 100 ? null : new Ixd(d); - f2 = b + d; - for (e = b; e < f2; ++e) { - h = a.cj(a.Oi(e), h); - } - !!h && h.Fi(); - } - } - return true; - } - } - function wwd(a, b, c2) { - var d, e, f2, g, h; - if (a.ej()) { - e = null; - f2 = a.fj(); - d = a.Zi(1, h = (g = a.Ui(b, a.oi(b, c2)), g), c2, b, f2); - if (a.bj() && !(a.ni() && !!h ? pb(h, c2) : PD(h) === PD(c2))) { - !!h && (e = a.dj(h, e)); - e = a.cj(c2, e); - if (!e) { - a.$i(d); - } else { - e.Ei(d); - e.Fi(); - } - } else { - if (!e) { - a.$i(d); - } else { - e.Ei(d); - e.Fi(); - } - } - return h; - } else { - h = (g = a.Ui(b, a.oi(b, c2)), g); - if (a.bj() && !(a.ni() && !!h ? pb(h, c2) : PD(h) === PD(c2))) { - e = null; - !!h && (e = a.dj(h, null)); - e = a.cj(c2, e); - !!e && e.Fi(); - } - return h; - } - } - function rRb(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - a.e = b; - a.f = BD(vNb(b, (HSb(), GSb)), 230); - iRb(b); - a.d = $wnd.Math.max(b.e.c.length * 16 + b.c.c.length, 256); - if (!Ccb(DD(vNb(b, (wSb(), dSb))))) { - k = a.e.e.c.length; - for (i3 = new olb(b.e); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 144); - j = h.d; - j.a = Aub(a.f) * k; - j.b = Aub(a.f) * k; - } - } - c2 = b.b; - for (f2 = new olb(b.c); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 282); - d = BD(vNb(e, rSb), 19).a; - if (d > 0) { - for (g = 0; g < d; g++) { - Ekb(c2, new aRb(e)); - } - cRb(e); - } - } - } - function zac(a, b) { - var c2, d, e, f2, g, h; - if (a.k == (j0b(), f0b)) { - c2 = WAb(JAb(BD(vNb(a, (wtc(), ktc)), 15).Oc(), new Xxb(new Kac()))).sd((EAb(), DAb)) ? b : (rbd(), pbd); - yNb(a, Ssc, c2); - if (c2 != (rbd(), obd)) { - d = BD(vNb(a, $sc), 17); - h = Edb(ED(vNb(d, (Nyc(), Zwc)))); - g = 0; - if (c2 == nbd) { - g = a.o.b - $wnd.Math.ceil(h / 2); - } else if (c2 == pbd) { - a.o.b -= Edb(ED(vNb(Q_b(a), nyc))); - g = (a.o.b - $wnd.Math.ceil(h)) / 2; - } - for (f2 = new olb(a.j); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 11); - e.n.b = g; - } - } - } - } - function Uge() { - Uge = ccb; - g5d(); - Tge = new Vge(); - OC(GC(w5, 2), nie, 368, 0, [OC(GC(w5, 1), Axe, 592, 0, [new Rge(Xwe)])]); - OC(GC(w5, 2), nie, 368, 0, [OC(GC(w5, 1), Axe, 592, 0, [new Rge(Ywe)])]); - OC(GC(w5, 2), nie, 368, 0, [OC(GC(w5, 1), Axe, 592, 0, [new Rge(Zwe)]), OC(GC(w5, 1), Axe, 592, 0, [new Rge(Ywe)])]); - new Ygb("-1"); - OC(GC(w5, 2), nie, 368, 0, [OC(GC(w5, 1), Axe, 592, 0, [new Rge("\\c+")])]); - new Ygb("0"); - new Ygb("0"); - new Ygb("1"); - new Ygb("0"); - new Ygb(hxe); - } - function KQd(a) { - var b, c2; - if (!!a.c && a.c.kh()) { - c2 = BD(a.c, 49); - a.c = BD(xid(a, c2), 138); - if (a.c != c2) { - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 9, 2, c2, a.c)); - if (JD(a.Cb, 399)) { - a.Db >> 16 == -15 && a.Cb.nh() && Rwd(new oSd(a.Cb, 9, 13, c2, a.c, HLd(QSd(BD(a.Cb, 59)), a))); - } else if (JD(a.Cb, 88)) { - if (a.Db >> 16 == -23 && a.Cb.nh()) { - b = a.c; - JD(b, 88) || (b = (jGd(), _Fd)); - JD(c2, 88) || (c2 = (jGd(), _Fd)); - Rwd(new oSd(a.Cb, 9, 10, c2, b, HLd(VKd(BD(a.Cb, 26)), a))); - } - } - } - } - return a.c; - } - function f7b(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - Odd(b, "Hypernodes processing", 1); - for (e = new olb(a.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 29); - for (h = new olb(d.a); h.a < h.c.c.length; ) { - g = BD(mlb(h), 10); - if (Ccb(DD(vNb(g, (Nyc(), exc)))) && g.j.c.length <= 2) { - l = 0; - k = 0; - c2 = 0; - f2 = 0; - for (j = new olb(g.j); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 11); - switch (i3.j.g) { - case 1: - ++l; - break; - case 2: - ++k; - break; - case 3: - ++c2; - break; - case 4: - ++f2; - } - } - l == 0 && c2 == 0 && e7b(a, g, f2 <= k); - } - } - } - Qdd(b); - } - function i7b(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - Odd(b, "Layer constraint edge reversal", 1); - for (g = new olb(a.b); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 29); - k = -1; - c2 = new Rkb(); - j = l_b(f2.a); - for (e = 0; e < j.length; e++) { - d = BD(vNb(j[e], (wtc(), Osc)), 303); - if (k == -1) { - d != (esc(), dsc) && (k = e); - } else { - if (d == (esc(), dsc)) { - $_b(j[e], null); - Z_b(j[e], k++, f2); - } - } - d == (esc(), bsc) && Ekb(c2, j[e]); - } - for (i3 = new olb(c2); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 10); - $_b(h, null); - $_b(h, f2); - } - } - Qdd(b); - } - function W6b(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l; - Odd(c2, "Hyperedge merging", 1); - U6b(a, b); - i3 = new Bib(b.b, 0); - while (i3.b < i3.d.gc()) { - h = (sCb(i3.b < i3.d.gc()), BD(i3.d.Xb(i3.c = i3.b++), 29)); - 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 = (tCb(j, k.c.length), BD(k.c[j], 10)); - e = d.k; - if (e == (j0b(), g0b) && g == g0b) { - l = S6b(d, f2); - if (l.a) { - V6b(d, f2, l.b, l.c); - tCb(j, k.c.length); - cCb(k.c, j, 1); - --j; - d = f2; - e = g; - } - } - f2 = d; - g = e; - } - } - Qdd(c2); - } - function WFc(a, b) { - var c2, d, e; - d = Cub(a.d, 1) != 0; - !Ccb(DD(vNb(b.j, (wtc(), Jsc)))) && !Ccb(DD(vNb(b.j, mtc))) || PD(vNb(b.j, (Nyc(), ywc))) === PD((tAc(), rAc)) ? b.c.Tf(b.e, d) : d = Ccb(DD(vNb(b.j, Jsc))); - dGc(a, b, d, true); - Ccb(DD(vNb(b.j, mtc))) && yNb(b.j, mtc, (Bcb(), false)); - if (Ccb(DD(vNb(b.j, Jsc)))) { - yNb(b.j, Jsc, (Bcb(), false)); - yNb(b.j, mtc, true); - } - c2 = OFc(a, b); - do { - $Fc(a); - if (c2 == 0) { - return 0; - } - d = !d; - e = c2; - dGc(a, b, d, false); - c2 = OFc(a, b); - } while (e > c2); - return e; - } - function XFc(a, b) { - var c2, d, e; - d = Cub(a.d, 1) != 0; - !Ccb(DD(vNb(b.j, (wtc(), Jsc)))) && !Ccb(DD(vNb(b.j, mtc))) || PD(vNb(b.j, (Nyc(), ywc))) === PD((tAc(), rAc)) ? b.c.Tf(b.e, d) : d = Ccb(DD(vNb(b.j, Jsc))); - dGc(a, b, d, true); - Ccb(DD(vNb(b.j, mtc))) && yNb(b.j, mtc, (Bcb(), false)); - if (Ccb(DD(vNb(b.j, Jsc)))) { - yNb(b.j, Jsc, (Bcb(), false)); - yNb(b.j, mtc, true); - } - c2 = NFc(a, b); - do { - $Fc(a); - if (c2 == 0) { - return 0; - } - d = !d; - e = c2; - dGc(a, b, d, false); - c2 = NFc(a, b); - } while (e > c2); - return e; - } - function uNd(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2; - if (b == c2) { - return true; - } else { - b = vNd(a, b); - c2 = vNd(a, c2); - d = JQd(b); - if (d) { - k = JQd(c2); - if (k != d) { - if (!k) { - return false; - } else { - i3 = d.Dj(); - o2 = k.Dj(); - return i3 == o2 && i3 != null; - } - } else { - g = (!b.d && (b.d = new xMd(j5, b, 1)), b.d); - f2 = g.i; - m = (!c2.d && (c2.d = new xMd(j5, c2, 1)), c2.d); - if (f2 == m.i) { - for (j = 0; j < f2; ++j) { - e = BD(qud(g, j), 87); - l = BD(qud(m, j), 87); - if (!uNd(a, e, l)) { - return false; - } - } - } - return true; - } - } else { - h = b.e; - n = c2.e; - return h == n; - } - } - } - function X2d(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l; - if (T6d(a.e, b)) { - l = S6d(a.e.Tg(), b); - f2 = BD(a.g, 119); - k = null; - i3 = -1; - h = -1; - e = 0; - for (j = 0; j < a.i; ++j) { - g = f2[j]; - if (l.rl(g.ak())) { - e == c2 && (i3 = j); - if (e == d) { - h = j; - k = g.dd(); - } - ++e; - } - } - if (i3 == -1) { - throw vbb(new qcb(lue + c2 + mue + e)); - } - if (h == -1) { - throw vbb(new qcb(nue + d + mue + e)); - } - Wxd(a, i3, h); - oid(a.e) && GLd(a, H2d(a, 7, b, meb(d), k, c2, true)); - return k; - } else { - throw vbb(new Wdb("The feature must be many-valued to support move")); - } - } - function b_b(a, b, c2, d) { - var e, f2, g, h, i3; - i3 = new g7c(b.n); - i3.a += b.o.a / 2; - i3.b += b.o.b / 2; - h = Edb(ED(vNb(b, (Nyc(), Uxc)))); - f2 = a.f; - g = a.d; - e = a.c; - switch (BD(vNb(b, (wtc(), Hsc)), 61).g) { - case 1: - i3.a += g.b + e.a - c2 / 2; - i3.b = -d - h; - b.n.b = -(g.d + h + e.b); - break; - case 2: - i3.a = f2.a + g.b + g.c + h; - i3.b += g.d + e.b - d / 2; - b.n.a = f2.a + g.c + h - e.a; - break; - case 3: - i3.a += g.b + e.a - c2 / 2; - i3.b = f2.b + g.d + g.a + h; - b.n.b = f2.b + g.a + h - e.b; - break; - case 4: - i3.a = -c2 - h; - i3.b += g.d + e.b - d / 2; - b.n.a = -(g.b + h + e.a); - } - return i3; - } - function P1b(a) { - var b, c2, d, e, f2, g; - d = new XZb(); - tNb(d, a); - PD(vNb(d, (Nyc(), Lwc))) === PD((ead(), cad)) && yNb(d, Lwc, a_b(d)); - if (vNb(d, (g6c(), f6c)) == null) { - g = BD(m6d(a), 160); - yNb(d, f6c, RD(g.We(f6c))); - } - yNb(d, (wtc(), $sc), a); - yNb(d, Ksc, (b = BD(gdb(PW), 9), new xqb(b, BD(_Bb(b, b.length), 9), 0))); - e = OGb((!Xod(a) ? null : (Pgd(), new bhd(Xod(a))), Pgd(), new hhd(!Xod(a) ? null : new bhd(Xod(a)), a)), bad); - f2 = BD(vNb(d, Kxc), 116); - c2 = d.d; - t_b(c2, f2); - t_b(c2, e); - return d; - } - function ybc(a, b, c2) { - var d, e; - d = b.c.i; - e = c2.d.i; - if (d.k == (j0b(), g0b)) { - yNb(a, (wtc(), Vsc), BD(vNb(d, Vsc), 11)); - yNb(a, Wsc, BD(vNb(d, Wsc), 11)); - yNb(a, Usc, DD(vNb(d, Usc))); - } else if (d.k == f0b) { - yNb(a, (wtc(), Vsc), BD(vNb(d, Vsc), 11)); - yNb(a, Wsc, BD(vNb(d, Wsc), 11)); - yNb(a, Usc, (Bcb(), true)); - } else if (e.k == f0b) { - yNb(a, (wtc(), Vsc), BD(vNb(e, Vsc), 11)); - yNb(a, Wsc, BD(vNb(e, Wsc), 11)); - yNb(a, Usc, (Bcb(), true)); - } else { - yNb(a, (wtc(), Vsc), b.c); - yNb(a, Wsc, c2.d); - } - } - function FGb(a) { - var b, c2, d, e, f2, g, h; - a.o = new jkb(); - d = new Psb(); - for (g = new olb(a.e.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 121); - LFb(f2).c.length == 1 && (Gsb(d, f2, d.c.b, d.c), true); - } - while (d.b != 0) { - f2 = BD(d.b == 0 ? null : (sCb(d.b != 0), Nsb(d, d.a.a)), 121); - if (LFb(f2).c.length == 0) { - continue; - } - b = BD(Ikb(LFb(f2), 0), 213); - c2 = f2.g.a.c.length > 0; - h = xFb(b, f2); - c2 ? OFb(h.b, b) : OFb(h.g, b); - LFb(h).c.length == 1 && (Gsb(d, h, d.c.b, d.c), true); - e = new vgd(f2, b); - Wjb(a.o, e); - Lkb(a.e.a, f2); - } - } - function _Nb(a, b) { - var c2, d, e, f2, g, h, i3; - d = $wnd.Math.abs(D6c(a.b).a - D6c(b.b).a); - h = $wnd.Math.abs(D6c(a.b).b - D6c(b.b).b); - e = 0; - i3 = 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) { - i3 = $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 - i3 / h; - } - f2 = $wnd.Math.min(c2, g); - return (1 - f2) * $wnd.Math.sqrt(d * d + h * h); - } - function lQc(a) { - var b, c2, d, e; - nQc(a, a.e, a.f, (FQc(), DQc), true, a.c, a.i); - nQc(a, a.e, a.f, DQc, false, a.c, a.i); - nQc(a, a.e, a.f, EQc, true, a.c, a.i); - nQc(a, a.e, a.f, EQc, false, a.c, a.i); - mQc(a, a.c, a.e, a.f, a.i); - d = new Bib(a.i, 0); - while (d.b < d.d.gc()) { - b = (sCb(d.b < d.d.gc()), BD(d.d.Xb(d.c = d.b++), 128)); - e = new Bib(a.i, d.b); - while (e.b < e.d.gc()) { - c2 = (sCb(e.b < e.d.gc()), BD(e.d.Xb(e.c = e.b++), 128)); - kQc(b, c2); - } - } - wQc(a.i, BD(vNb(a.d, (wtc(), jtc)), 230)); - zQc(a.i); - } - function fKd(a, b) { - var c2, d; - if (b != null) { - d = dKd(a); - if (d) { - if ((d.i & 1) != 0) { - if (d == sbb) { - return KD(b); - } else if (d == WD) { - return JD(b, 19); - } else if (d == VD) { - return JD(b, 155); - } else if (d == SD) { - return JD(b, 217); - } else if (d == TD) { - return JD(b, 172); - } else if (d == UD) { - return LD(b); - } else if (d == rbb) { - return JD(b, 184); - } else if (d == XD) { - return JD(b, 162); - } - } else { - return pEd(), c2 = BD(Ohb(oEd, d), 55), !c2 || c2.wj(b); - } - } else if (JD(b, 56)) { - return a.uk(BD(b, 56)); - } - } - return false; - } - function ade() { - ade = ccb; - var a, b, c2, d, e, f2, g, h, i3; - $ce = KC(SD, wte, 25, 255, 15, 1); - _ce = KC(TD, $ie, 25, 64, 15, 1); - for (b = 0; b < 255; b++) { - $ce[b] = -1; - } - for (c2 = 90; c2 >= 65; c2--) { - $ce[c2] = c2 - 65 << 24 >> 24; - } - for (d = 122; d >= 97; d--) { - $ce[d] = d - 97 + 26 << 24 >> 24; - } - for (e = 57; e >= 48; e--) { - $ce[e] = e - 48 + 52 << 24 >> 24; - } - $ce[43] = 62; - $ce[47] = 63; - for (f2 = 0; f2 <= 25; f2++) - _ce[f2] = 65 + f2 & aje; - for (g = 26, i3 = 0; g <= 51; ++g, i3++) - _ce[g] = 97 + i3 & aje; - for (a = 52, h = 0; a <= 61; ++a, h++) - _ce[a] = 48 + h & aje; - _ce[62] = 43; - _ce[63] = 47; - } - function FXb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n; - if (a.dc()) { - return new d7c(); - } - j = 0; - l = 0; - for (e = a.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 37); - f2 = d.f; - j = $wnd.Math.max(j, f2.a); - l += f2.a * f2.b; - } - j = $wnd.Math.max(j, $wnd.Math.sqrt(l) * Edb(ED(vNb(BD(a.Kc().Pb(), 37), (Nyc(), owc))))); - m = 0; - n = 0; - i3 = 0; - c2 = b; - for (h = a.Kc(); h.Ob(); ) { - g = BD(h.Pb(), 37); - k = g.f; - if (m + k.a > j) { - m = 0; - n += i3 + b; - i3 = 0; - } - uXb(g, m, n); - c2 = $wnd.Math.max(c2, m + k.a); - i3 = $wnd.Math.max(i3, k.b); - m += k.a + b; - } - return new f7c(c2 + b, n + i3 + b); - } - function mQc(a, b, c2, d, e) { - var f2, g, h, i3, j, k, l; - for (g = new olb(b); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 17); - i3 = f2.c; - if (c2.a._b(i3)) { - j = (FQc(), DQc); - } else if (d.a._b(i3)) { - j = (FQc(), EQc); - } else { - throw vbb(new Wdb("Source port must be in one of the port sets.")); - } - k = f2.d; - if (c2.a._b(k)) { - l = (FQc(), DQc); - } else if (d.a._b(k)) { - l = (FQc(), EQc); - } else { - throw vbb(new Wdb("Target port must be in one of the port sets.")); - } - h = new YQc(f2, j, l); - Rhb(a.b, f2, h); - e.c[e.c.length] = h; - } - } - function lfd(a, b) { - var c2, d, e, f2, g, h, i3; - if (!mpd(a)) { - throw vbb(new Zdb(Sse)); - } - d = mpd(a); - f2 = d.g; - e = d.f; - if (f2 <= 0 && e <= 0) { - return Ucd(), Scd; - } - h = a.i; - i3 = a.j; - switch (b.g) { - case 2: - case 1: - if (h < 0) { - return Ucd(), Tcd; - } else if (h + a.g > f2) { - return Ucd(), zcd; - } - break; - case 4: - case 3: - if (i3 < 0) { - return Ucd(), Acd; - } else if (i3 + a.f > e) { - return Ucd(), Rcd; - } - } - g = (h + a.g / 2) / f2; - c2 = (i3 + a.f / 2) / e; - return g + c2 <= 1 && g - c2 <= 0 ? (Ucd(), Tcd) : g + c2 >= 1 && g - c2 >= 0 ? (Ucd(), zcd) : c2 < 0.5 ? (Ucd(), Acd) : (Ucd(), Rcd); - } - function vhb(a, b, c2, d, e) { - var f2, g; - f2 = wbb(xbb(b[0], Yje), xbb(d[0], Yje)); - a[0] = Tbb(f2); - f2 = Obb(f2, 32); - if (c2 >= e) { - for (g = 1; g < e; g++) { - f2 = wbb(f2, wbb(xbb(b[g], Yje), xbb(d[g], Yje))); - a[g] = Tbb(f2); - f2 = Obb(f2, 32); - } - for (; g < c2; g++) { - f2 = wbb(f2, xbb(b[g], Yje)); - a[g] = Tbb(f2); - f2 = Obb(f2, 32); - } - } else { - for (g = 1; g < c2; g++) { - f2 = wbb(f2, wbb(xbb(b[g], Yje), xbb(d[g], Yje))); - a[g] = Tbb(f2); - f2 = Obb(f2, 32); - } - for (; g < e; g++) { - f2 = wbb(f2, xbb(d[g], Yje)); - a[g] = Tbb(f2); - f2 = Obb(f2, 32); - } - } - ybb(f2, 0) != 0 && (a[g] = Tbb(f2)); - } - function _fe(a) { - wfe(); - var b, c2, d, e, f2, g; - if (a.e != 4 && a.e != 5) - throw vbb(new Wdb("Token#complementRanges(): must be RANGE: " + a.e)); - f2 = a; - Yfe(f2); - Vfe(f2); - d = f2.b.length + 2; - f2.b[0] == 0 && (d -= 2); - c2 = f2.b[f2.b.length - 1]; - c2 == lxe && (d -= 2); - e = new $fe(4); - e.b = KC(WD, oje, 25, 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 != lxe) { - e.b[g++] = c2 + 1; - e.b[g] = lxe; - } - e.a = true; - return e; - } - function Pxd(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - d = c2.gc(); - if (d == 0) { - return false; - } else { - if (a.ej()) { - j = a.fj(); - iud(a, b, c2); - g = d == 1 ? a.Zi(3, null, c2.Kc().Pb(), b, j) : a.Zi(5, null, c2, b, j); - if (a.bj()) { - h = d < 100 ? null : new Ixd(d); - f2 = b + d; - for (e = b; e < f2; ++e) { - k = a.g[e]; - h = a.cj(k, h); - h = a.jj(k, h); - } - if (!h) { - a.$i(g); - } else { - h.Ei(g); - h.Fi(); - } - } else { - a.$i(g); - } - } else { - iud(a, b, c2); - if (a.bj()) { - h = d < 100 ? null : new Ixd(d); - f2 = b + d; - for (e = b; e < f2; ++e) { - i3 = a.g[e]; - h = a.cj(i3, h); - } - !!h && h.Fi(); - } - } - return true; - } - } - function YNc(a, b, c2, d) { - var e, f2, g, h, i3; - for (g = new olb(a.k); g.a < g.c.c.length; ) { - e = BD(mlb(g), 129); - if (!d || e.c == (HOc(), FOc)) { - i3 = e.b; - if (i3.g < 0 && e.d > 0) { - pOc(i3, i3.d - e.d); - e.c == (HOc(), FOc) && nOc(i3, i3.a - e.d); - i3.d <= 0 && i3.i > 0 && (Gsb(b, i3, b.c.b, b.c), true); - } - } - } - for (f2 = new olb(a.f); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 129); - if (!d || e.c == (HOc(), FOc)) { - h = e.a; - if (h.g < 0 && e.d > 0) { - qOc(h, h.i - e.d); - e.c == (HOc(), FOc) && oOc(h, h.b - e.d); - h.i <= 0 && h.d > 0 && (Gsb(c2, h, c2.c.b, c2.c), true); - } - } - } - } - function gSc(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - Odd(c2, "Processor compute fanout", 1); - Uhb(a.b); - Uhb(a.a); - h = null; - f2 = Jsb(b.b, 0); - while (!h && f2.b != f2.d.c) { - j = BD(Xsb(f2), 86); - Ccb(DD(vNb(j, (mTc(), jTc)))) && (h = j); - } - i3 = new Psb(); - Gsb(i3, h, i3.c.b, i3.c); - fSc(a, i3); - for (k = Jsb(b.b, 0); k.b != k.d.c; ) { - j = BD(Xsb(k), 86); - g = GD(vNb(j, (mTc(), $Sc))); - e = Phb(a.b, g) != null ? BD(Phb(a.b, g), 19).a : 0; - yNb(j, ZSc, meb(e)); - d = 1 + (Phb(a.a, g) != null ? BD(Phb(a.a, g), 19).a : 0); - yNb(j, XSc, meb(d)); - } - Qdd(c2); - } - function WPc(a, b, c2, d, e) { - var f2, g, h, i3, j, k, l, m, n, o2; - m = VPc(a, c2); - for (i3 = 0; i3 < b; i3++) { - Aib(e, c2); - n = new Rkb(); - o2 = (sCb(d.b < d.d.gc()), BD(d.d.Xb(d.c = d.b++), 407)); - for (k = m + i3; k < a.b; k++) { - h = o2; - o2 = (sCb(d.b < d.d.gc()), BD(d.d.Xb(d.c = d.b++), 407)); - Ekb(n, new aQc(h, o2, c2)); - } - for (l = m + i3; l < a.b; l++) { - sCb(d.b > 0); - d.a.Xb(d.c = --d.b); - l > m + i3 && uib(d); - } - for (g = new olb(n); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 407); - Aib(d, f2); - } - if (i3 < b - 1) { - for (j = m + i3; j < a.b; j++) { - sCb(d.b > 0); - d.a.Xb(d.c = --d.b); - } - } - } - } - function Jfe() { - wfe(); - var a, b, c2, d, e, f2; - if (gfe) - return gfe; - a = new $fe(4); - Xfe(a, Kfe(vxe, true)); - Zfe(a, Kfe("M", true)); - Zfe(a, Kfe("C", true)); - f2 = new $fe(4); - for (d = 0; d < 11; d++) { - Ufe(f2, d, d); - } - b = new $fe(4); - Xfe(b, Kfe("M", true)); - Ufe(b, 4448, 4607); - Ufe(b, 65438, 65439); - e = new Lge(2); - Kge(e, a); - Kge(e, ffe); - c2 = new Lge(2); - c2.$l(Bfe(f2, Kfe("L", true))); - c2.$l(b); - c2 = new lge(3, c2); - c2 = new rge(e, c2); - gfe = c2; - return gfe; - } - function S3c(a) { - var b, c2; - b = GD(hkd(a, (Y9c(), o8c))); - if (T3c(b, a)) { - return; - } - if (!ikd(a, F9c) && ((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a).i != 0 || Ccb(DD(hkd(a, M8c))))) { - if (b == null || ufb(b).length == 0) { - if (!T3c(sne, a)) { - c2 = Qfb(Qfb(new Wfb("Unable to load default layout algorithm "), sne), " for unconfigured node "); - yfd(a, c2); - throw vbb(new y2c(c2.a)); - } - } else { - c2 = Qfb(Qfb(new Wfb("Layout algorithm '"), b), "' not found for "); - yfd(a, c2); - throw vbb(new y2c(c2.a)); - } - } - } - function hIb(a) { - var b, c2, d, e, f2, g, h, i3, 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, i3 = 0, k = g.length; i3 < k; ++i3) { - e = g[i3]; - mHb(e, n, m); - } - } else { - d = kIb(a, false); - mHb(a.a[0], c2.c + b.b, d[0]); - mHb(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); - mHb(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]; - JD(e, 326) && BD(e, 326).Te(); - } - } - function KMc(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l; - l = new JMc(); - l.d = 0; - for (g = new olb(a.b); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 29); - l.d += f2.a.c.length; - } - d = 0; - e = 0; - l.a = KC(WD, oje, 25, a.b.c.length, 15, 1); - j = 0; - k = 0; - l.e = KC(WD, oje, 25, l.d, 15, 1); - for (c2 = new olb(a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 29); - b.p = d++; - l.a[b.p] = e++; - k = 0; - for (i3 = new olb(b.a); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 10); - h.p = j++; - l.e[h.p] = k++; - } - } - l.c = new OMc(l); - l.b = Pu(l.d); - LMc(l, a); - l.f = Pu(l.d); - MMc(l, a); - return l; - } - function GZc(a, b) { - var c2, d, e, f2; - f2 = BD(Ikb(a.n, a.n.c.length - 1), 211).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 olb(a.n); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 211); - 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); - u$c(a.j); - } - function LQb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - k = DD(vNb(b, (wSb(), sSb))); - if (k == null || (uCb(k), k)) { - l = KC(sbb, dle, 25, b.e.c.length, 16, 1); - g = HQb(b); - e = new Psb(); - for (j = new olb(b.e); j.a < j.c.c.length; ) { - h = BD(mlb(j), 144); - c2 = IQb(a, h, null, null, l, g); - if (c2) { - tNb(c2, b); - Gsb(e, c2, e.c.b, e.c); - } - } - if (e.b > 1) { - for (d = Jsb(e, 0); d.b != d.d.c; ) { - c2 = BD(Xsb(d), 231); - f2 = 0; - for (i3 = new olb(c2.e); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 144); - h.b = f2++; - } - } - } - return e; - } - return Ou(OC(GC($O, 1), fme, 231, 0, [b])); - } - function TKd(a) { - var b, c2, d, e, f2, g, h; - if (!a.g) { - h = new zNd(); - b = KKd; - g = b.a.zc(a, b); - if (g == null) { - for (d = new Fyd(_Kd(a)); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 26); - ytd(h, TKd(c2)); - } - b.a.Bc(a) != null; - b.a.gc() == 0 && void 0; - } - e = h.i; - for (f2 = (!a.s && (a.s = new cUd(t5, a, 21, 17)), new Fyd(a.s)); f2.e != f2.i.gc(); ++e) { - bJd(BD(Dyd(f2), 449), e); - } - ytd(h, (!a.s && (a.s = new cUd(t5, a, 21, 17)), a.s)); - vud(h); - a.g = new rNd(a, h); - a.i = BD(h.g, 247); - a.i == null && (a.i = MKd); - a.p = null; - $Kd(a).b &= -5; - } - return a.g; - } - function iIb(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2; - d = a.i; - c2 = a.n; - if (a.b == 0) { - b = jIb(a, false); - nHb(a.a[0], d.d + c2.d, b[0]); - nHb(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); - nHb(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, i3 = 0, k = g.length; i3 < k; ++i3) { - e = g[i3]; - nHb(e, o2, n); - } - } - for (f2 = a.a, h = 0, j = f2.length; h < j; ++h) { - e = f2[h]; - JD(e, 326) && BD(e, 326).Ue(); - } - } - function boc(a) { - var b, c2, d, e, f2, g, h, i3, j, k; - k = KC(WD, oje, 25, a.b.c.length + 1, 15, 1); - j = new Tqb(); - d = 0; - for (f2 = new olb(a.b); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 29); - k[d++] = j.a.gc(); - for (i3 = new olb(e.a); i3.a < i3.c.c.length; ) { - g = BD(mlb(i3), 10); - for (c2 = new Sr(ur(U_b(g).a.Kc(), new Sq())); Qr(c2); ) { - b = BD(Rr(c2), 17); - j.a.zc(b, j); - } - } - for (h = new olb(e.a); h.a < h.c.c.length; ) { - g = BD(mlb(h), 10); - for (c2 = new Sr(ur(R_b(g).a.Kc(), new Sq())); Qr(c2); ) { - b = BD(Rr(c2), 17); - j.a.Bc(b) != null; - } - } - } - return k; - } - function F2d(a, b, c2, d) { - var e, f2, g, h, i3; - i3 = S6d(a.e.Tg(), b); - e = BD(a.g, 119); - Q6d(); - if (BD(b, 66).Oj()) { - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (i3.rl(f2.ak()) && pb(f2, c2)) { - return true; - } - } - } else if (c2 != null) { - for (h = 0; h < a.i; ++h) { - f2 = e[h]; - if (i3.rl(f2.ak()) && pb(c2, f2.dd())) { - return true; - } - } - if (d) { - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (i3.rl(f2.ak()) && PD(c2) === PD(a3d(a, BD(f2.dd(), 56)))) { - return true; - } - } - } - } else { - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (i3.rl(f2.ak()) && f2.dd() == null) { - return false; - } - } - } - return false; - } - function e3d(a, b, c2, d) { - var e, f2, g, h, i3, j; - j = S6d(a.e.Tg(), b); - g = BD(a.g, 119); - if (T6d(a.e, b)) { - if (b.hi()) { - f2 = M2d(a, b, d, JD(b, 99) && (BD(b, 18).Bb & Tje) != 0); - if (f2 >= 0 && f2 != c2) { - throw vbb(new Wdb(kue)); - } - } - e = 0; - for (i3 = 0; i3 < a.i; ++i3) { - h = g[i3]; - if (j.rl(h.ak())) { - if (e == c2) { - return BD(Gtd(a, i3, (Q6d(), BD(b, 66).Oj() ? BD(d, 72) : R6d(b, d))), 72); - } - ++e; - } - } - throw vbb(new qcb(gve + c2 + mue + e)); - } else { - for (i3 = 0; i3 < a.i; ++i3) { - h = g[i3]; - if (j.rl(h.ak())) { - return Q6d(), BD(b, 66).Oj() ? h : h.dd(); - } - } - return null; - } - } - function ONb(a, b, c2, d) { - var e, f2, g, h; - h = c2; - for (g = new olb(b.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 221); - e = BD(f2.b, 65); - if (Jy(a.b.c, e.b.c + e.b.b) <= 0 && Jy(e.b.c, a.b.c + a.b.b) <= 0 && Jy(a.b.d, e.b.d + e.b.a) <= 0 && Jy(e.b.d, a.b.d + a.b.a) <= 0) { - if (Jy(e.b.c, a.b.c + a.b.b) == 0 && d.a < 0 || Jy(e.b.c + e.b.b, a.b.c) == 0 && d.a > 0 || Jy(e.b.d, a.b.d + a.b.a) == 0 && d.b < 0 || Jy(e.b.d + e.b.a, a.b.d) == 0 && d.b > 0) { - h = 0; - break; - } - } else { - h = $wnd.Math.min(h, YNb(a, e, d)); - } - h = $wnd.Math.min(h, ONb(a, f2, h, d)); - } - return h; - } - function ifd(a, b) { - var c2, d, e, f2, g, h, i3; - if (a.b < 2) { - throw vbb(new Wdb("The vector chain must contain at least a source and a target point.")); - } - e = (sCb(a.b != 0), BD(a.a.a.c, 8)); - nmd(b, e.a, e.b); - i3 = new Oyd((!b.a && (b.a = new xMd(y2, b, 5)), b.a)); - g = Jsb(a, 1); - while (g.a < a.b - 1) { - h = BD(Xsb(g), 8); - if (i3.e != i3.i.gc()) { - c2 = BD(Dyd(i3), 469); - } else { - c2 = (Fhd(), d = new xkd(), d); - Myd(i3, c2); - } - ukd(c2, h.a, h.b); - } - while (i3.e != i3.i.gc()) { - Dyd(i3); - Eyd(i3); - } - f2 = (sCb(a.b != 0), BD(a.c.b.c, 8)); - gmd(b, f2.a, f2.b); - } - function $lc(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - c2 = 0; - for (e = new olb((tCb(0, a.c.length), BD(a.c[0], 101)).g.b.j); e.a < e.c.c.length; ) { - d = BD(mlb(e), 11); - d.p = c2++; - } - b == (Ucd(), Acd) ? Okb(a, new gmc()) : Okb(a, new kmc()); - h = 0; - k = a.c.length - 1; - while (h < k) { - g = (tCb(h, a.c.length), BD(a.c[h], 101)); - j = (tCb(k, a.c.length), BD(a.c[k], 101)); - f2 = b == Acd ? g.c : g.a; - i3 = b == Acd ? j.a : j.c; - amc(g, b, (Ajc(), yjc), f2); - amc(j, b, xjc, i3); - ++h; - --k; - } - h == k && amc((tCb(h, a.c.length), BD(a.c[h], 101)), b, (Ajc(), wjc), null); - } - function UVc(a, b, c2) { - var d, e, f2, g, h, i3, 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 f7c(o2, q); - j = BD(hkd(b, (Y9c(), C9c)), 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; - i3 = new f7c(p, r); - k = BD(hkd(c2, C9c), 8); - k.a = k.a + l; - k.b = k.b + m; - g = (i3.b - k.b) / (i3.a - k.a); - e = i3.b - g * i3.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 && i3.a < n || n < k.a && n < i3.a) { - return false; - } - return true; - } - function gqd(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n; - m = BD(Ohb(a.c, b), 183); - if (!m) { - throw vbb(new cqd("Edge did not exist in input.")); - } - j = Wpd(m); - f2 = Fhe((!b.a && (b.a = new cUd(A2, b, 6, 6)), b.a)); - h = !f2; - if (h) { - n = new wB(); - c2 = new Rrd(a, j, n); - Dhe((!b.a && (b.a = new cUd(A2, b, 6, 6)), b.a), c2); - cC(m, Nte, n); - } - e = ikd(b, (Y9c(), Q8c)); - if (e) { - k = BD(hkd(b, Q8c), 74); - g = !k || Ehe(k); - i3 = !g; - if (i3) { - l = new wB(); - d = new Zrd(l); - reb(k, d); - cC(m, "junctionPoints", l); - } - } - Upd(m, "container", Mld(b).k); - return null; - } - function eDb(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - this.a = a; - this.b = b; - this.c = c2; - this.e = Ou(OC(GC(GM, 1), Uhe, 168, 0, [new aDb(a, b), new aDb(b, c2), new aDb(c2, a)])); - this.f = Ou(OC(GC(m1, 1), nie, 8, 0, [a, b, c2])); - this.d = (d = c7c(R6c(this.b), this.a), e = c7c(R6c(this.c), this.a), f2 = c7c(R6c(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), i3 = 2 * (d.a * f2.b - d.b * f2.a), j = (e.b * g - d.b * h) / i3, k = (d.a * h - e.a * g) / i3, new f7c(j, k)); - } - function nvd(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2; - m = new yC(a.p); - cC(b, fue, m); - if (c2 && !(!a.f ? null : vmb(a.f)).a.dc()) { - k = new wB(); - cC(b, "logs", k); - h = 0; - for (o2 = new Dnb((!a.f ? null : vmb(a.f)).b.Kc()); o2.b.Ob(); ) { - n = GD(o2.b.Pb()); - l = new yC(n); - tB(k, h); - vB(k, h, l); - ++h; - } - } - if (d) { - j = new TB(a.q); - cC(b, "executionTime", j); - } - if (!vmb(a.a).a.dc()) { - g = new wB(); - cC(b, Jte, g); - h = 0; - for (f2 = new Dnb(vmb(a.a).b.Kc()); f2.b.Ob(); ) { - e = BD(f2.b.Pb(), 1949); - i3 = new eC(); - tB(g, h); - vB(g, h, i3); - nvd(e, i3, c2, d); - ++h; - } - } - } - function PZb(a, b) { - var c2, d, e, f2, g, h; - f2 = a.c; - g = a.d; - QZb(a, null); - RZb(a, null); - b && Ccb(DD(vNb(g, (wtc(), Msc)))) ? QZb(a, i_b(g.i, (KAc(), IAc), (Ucd(), zcd))) : QZb(a, g); - b && Ccb(DD(vNb(f2, (wtc(), etc)))) ? RZb(a, i_b(f2.i, (KAc(), HAc), (Ucd(), Tcd))) : RZb(a, f2); - for (d = new olb(a.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 70); - e = BD(vNb(c2, (Nyc(), Qwc)), 272); - e == (qad(), pad2) ? yNb(c2, Qwc, oad) : e == oad && yNb(c2, Qwc, pad2); - } - h = Ccb(DD(vNb(a, (wtc(), ltc)))); - yNb(a, ltc, (Bcb(), h ? false : true)); - a.a = w7c(a.a); - } - function VQb(a, b, c2) { - var d, e, f2, g, h, i3; - d = 0; - for (f2 = new Fyd((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a)); f2.e != f2.i.gc(); ) { - e = BD(Dyd(f2), 33); - g = ""; - (!e.n && (e.n = new cUd(D2, e, 1, 7)), e.n).i == 0 || (g = BD(qud((!e.n && (e.n = new cUd(D2, e, 1, 7)), e.n), 0), 137).a); - h = new pRb(g); - tNb(h, e); - yNb(h, (HSb(), FSb), e); - h.b = 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); - Ekb(b.e, h); - jrb(c2.f, e, h); - i3 = BD(hkd(e, (wSb(), mSb)), 98); - i3 == (dcd(), ccd) && (i3 = bcd); - } - } - function XJc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q; - c2 = nGb(new pGb(), a.f); - j = a.i[b.c.i.p]; - n = a.i[b.d.i.p]; - i3 = b.c; - m = b.d; - h = i3.a.b; - l = m.a.b; - j.b || (h += i3.n.b); - n.b || (l += m.n.b); - k = QD($wnd.Math.max(0, h - l)); - g = QD($wnd.Math.max(0, l - h)); - o2 = (p = $wnd.Math.max(1, BD(vNb(b, (Nyc(), eyc)), 19).a), q = JJc(b.c.i.k, b.d.i.k), p * q); - e = AFb(DFb(CFb(BFb(EFb(new FFb(), o2), g), c2), BD(Ohb(a.k, b.c), 121))); - f2 = AFb(DFb(CFb(BFb(EFb(new FFb(), o2), k), c2), BD(Ohb(a.k, b.d), 121))); - d = new qKc(e, f2); - a.c[b.p] = d; - } - function NEc(a, b, c2, d) { - var e, f2, g, h, i3, j; - g = new _Ec(a, b, c2); - i3 = new Bib(d, 0); - e = false; - while (i3.b < i3.d.gc()) { - h = (sCb(i3.b < i3.d.gc()), BD(i3.d.Xb(i3.c = i3.b++), 233)); - if (h == b || h == c2) { - uib(i3); - } else if (!e && Edb(REc(h.g, h.d[0]).a) > Edb(REc(g.g, g.d[0]).a)) { - sCb(i3.b > 0); - i3.a.Xb(i3.c = --i3.b); - Aib(i3, g); - e = true; - } else if (!!h.e && h.e.gc() > 0) { - f2 = (!h.e && (h.e = new Rkb()), h.e).Mc(b); - j = (!h.e && (h.e = new Rkb()), h.e).Mc(c2); - if (f2 || j) { - (!h.e && (h.e = new Rkb()), h.e).Fc(g); - ++g.c; - } - } - } - e || (d.c[d.c.length] = g, true); - } - function odc(a) { - var b, c2, d; - if (fcd(BD(vNb(a, (Nyc(), Vxc)), 98))) { - for (c2 = new olb(a.j); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 11); - b.j == (Ucd(), Scd) && (d = BD(vNb(b, (wtc(), gtc)), 10), d ? G0b(b, BD(vNb(d, Hsc), 61)) : b.e.c.length - b.g.c.length < 0 ? G0b(b, zcd) : G0b(b, Tcd)); - } - } else { - for (c2 = new olb(a.j); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 11); - d = BD(vNb(b, (wtc(), gtc)), 10); - d ? G0b(b, BD(vNb(d, Hsc), 61)) : b.e.c.length - b.g.c.length < 0 ? G0b(b, (Ucd(), zcd)) : G0b(b, (Ucd(), Tcd)); - } - yNb(a, Vxc, (dcd(), acd)); - } - } - function age(a) { - var b, c2, d; - switch (a) { - case 91: - case 93: - case 45: - case 94: - case 44: - case 92: - d = "\\" + String.fromCharCode(a & aje); - 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" + qfb(c2, c2.length - 2, c2.length); - } else if (a >= Tje) { - c2 = (b = a >>> 0, "0" + b.toString(16)); - d = "\\v" + qfb(c2, c2.length - 6, c2.length); - } else - d = "" + String.fromCharCode(a & aje); - } - return d; - } - function yhb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - g = a.e; - i3 = b.e; - if (i3 == 0) { - return a; - } - if (g == 0) { - return b.e == 0 ? b : new Vgb(-b.e, b.d, b.a); - } - f2 = a.d; - h = b.d; - if (f2 + h == 2) { - c2 = xbb(a.a[0], Yje); - d = xbb(b.a[0], Yje); - g < 0 && (c2 = Jbb(c2)); - i3 < 0 && (d = Jbb(d)); - return ghb(Qbb(c2, d)); - } - e = f2 != h ? f2 > h ? 1 : -1 : whb(a.a, b.a, f2); - if (e == -1) { - l = -i3; - k = g == i3 ? zhb(b.a, h, a.a, f2) : uhb(b.a, h, a.a, f2); - } else { - l = g; - if (g == i3) { - if (e == 0) { - return Hgb(), Ggb; - } - k = zhb(a.a, f2, b.a, h); - } else { - k = uhb(a.a, f2, b.a, h); - } - } - j = new Vgb(l, k.length, k); - Jgb(j); - return j; - } - function YPc(a) { - var b, c2, d, e, f2, g; - this.e = new Rkb(); - this.a = new Rkb(); - for (c2 = a.b - 1; c2 < 3; c2++) { - St(a, 0, BD(Ut(a, 0), 8)); - } - if (a.b < 4) { - throw vbb(new Wdb("At (least dimension + 1) control points are necessary!")); - } else { - this.b = 3; - this.d = true; - this.c = false; - TPc(this, a.b + this.b - 1); - g = new Rkb(); - f2 = new olb(this.e); - for (b = 0; b < this.b - 1; b++) { - Ekb(g, ED(mlb(f2))); - } - for (e = Jsb(a, 0); e.b != e.d.c; ) { - d = BD(Xsb(e), 8); - Ekb(g, ED(mlb(f2))); - Ekb(this.a, new bQc(d, g)); - tCb(0, g.c.length); - g.c.splice(0, 1); - } - } - } - function Bac(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - for (f2 = new olb(a.b); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 29); - for (h = new olb(e.a); h.a < h.c.c.length; ) { - g = BD(mlb(h), 10); - if (g.k == (j0b(), f0b)) { - i3 = (j = BD(Rr(new Sr(ur(R_b(g).a.Kc(), new Sq()))), 17), k = BD(Rr(new Sr(ur(U_b(g).a.Kc(), new Sq()))), 17), !Ccb(DD(vNb(j, (wtc(), ltc)))) || !Ccb(DD(vNb(k, ltc)))) ? b : sbd(b); - zac(g, i3); - } - for (d = new Sr(ur(U_b(g).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 17); - i3 = Ccb(DD(vNb(c2, (wtc(), ltc)))) ? sbd(b) : b; - yac(c2, i3); - } - } - } - } - function yZc(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 = BD(Ikb(b.n, b.n.c.length - 1), 211); - if (g.e + g.d + c2.g + e <= d && (f2 = BD(Ikb(b.n, b.n.c.length - 1), 211), f2.f - a.f + c2.f <= a.b || a.a.c.length == 1)) { - EZc(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)) { - Ekb(b.b, c2); - h = BD(Ikb(b.n, b.n.c.length - 1), 211); - Ekb(b.n, new VZc(b.s, h.f + h.a + b.i, b.i)); - QZc(BD(Ikb(b.n, b.n.c.length - 1), 211), c2); - GZc(b, c2); - return true; - } - } - return false; - } - function Zxd(a, b, c2) { - var d, e, f2, g; - if (a.ej()) { - e = null; - f2 = a.fj(); - d = a.Zi(1, g = uud(a, b, c2), c2, b, f2); - if (a.bj() && !(a.ni() && g != null ? pb(g, c2) : PD(g) === PD(c2))) { - g != null && (e = a.dj(g, e)); - e = a.cj(c2, e); - a.ij() && (e = a.lj(g, c2, e)); - if (!e) { - a.$i(d); - } else { - e.Ei(d); - e.Fi(); - } - } else { - a.ij() && (e = a.lj(g, c2, e)); - if (!e) { - a.$i(d); - } else { - e.Ei(d); - e.Fi(); - } - } - return g; - } else { - g = uud(a, b, c2); - if (a.bj() && !(a.ni() && g != null ? pb(g, c2) : PD(g) === PD(c2))) { - e = null; - g != null && (e = a.dj(g, null)); - e = a.cj(c2, e); - !!e && e.Fi(); - } - return g; - } - } - function YA(a, b) { - var c2, d, e, f2, g, h, i3, 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) { - i3 = h / 60 | 0; - j = h % 60; - e = a.q.getDate(); - c2 = a.q.getHours(); - c2 + i3 >= 24 && ++e; - f2 = new $wnd.Date(a.q.getFullYear(), a.q.getMonth(), e, b + i3, 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 opc(a, b) { - var c2, d, e, f2, g; - Odd(b, "Path-Like Graph Wrapping", 1); - if (a.b.c.length == 0) { - Qdd(b); - return; - } - e = new Xoc(a); - g = (e.i == null && (e.i = Soc(e, new Zoc())), Edb(e.i) * e.f); - c2 = g / (e.i == null && (e.i = Soc(e, new Zoc())), Edb(e.i)); - if (e.b > c2) { - Qdd(b); - return; - } - switch (BD(vNb(a, (Nyc(), Gyc)), 337).g) { - case 2: - f2 = new hpc(); + case 30: + this.popState(); + yy.getLogger().trace("node end (("); + return "NODE_DEND"; break; - case 0: - f2 = new Ync(); + case 31: + this.popState(); + yy.getLogger().trace("node end (-"); + return "NODE_DEND"; break; - default: - f2 = new kpc(); - } - d = f2.Vf(a, e); - if (!f2.Wf()) { - switch (BD(vNb(a, Myc), 338).g) { - case 2: - d = tpc(e, d); - break; - case 1: - d = rpc(e, d); - } - } - npc(a, e, d); - Qdd(b); - } - function MFc(a, b) { - var c2, d, e, f2; - Fub(a.d, a.e); - a.c.a.$b(); - if (Edb(ED(vNb(b.j, (Nyc(), uwc)))) != 0 || Edb(ED(vNb(b.j, uwc))) != 0) { - c2 = dme; - PD(vNb(b.j, ywc)) !== PD((tAc(), rAc)) && yNb(b.j, (wtc(), Jsc), (Bcb(), true)); - f2 = BD(vNb(b.j, Ayc), 19).a; - for (e = 0; e < f2; e++) { - d = WFc(a, b); - if (d < c2) { - c2 = d; - ZFc(a); - if (c2 == 0) { - break; - } - } - } - } else { - c2 = Ohe; - PD(vNb(b.j, ywc)) !== PD((tAc(), rAc)) && yNb(b.j, (wtc(), Jsc), (Bcb(), true)); - f2 = BD(vNb(b.j, Ayc), 19).a; - for (e = 0; e < f2; e++) { - d = XFc(a, b); - if (d < c2) { - c2 = d; - ZFc(a); - if (c2 == 0) { - break; - } - } - } - } - } - function spc(a, b) { - var c2, d, e, f2, g, h, i3, j; - g = new Rkb(); - h = 0; - c2 = 0; - i3 = 0; - while (h < b.c.length - 1 && c2 < a.gc()) { - d = BD(a.Xb(c2), 19).a + i3; - while ((tCb(h + 1, b.c.length), BD(b.c[h + 1], 19)).a < d) { - ++h; - } - j = 0; - f2 = d - (tCb(h, b.c.length), BD(b.c[h], 19)).a; - e = (tCb(h + 1, b.c.length), BD(b.c[h + 1], 19)).a - d; - f2 > e && ++j; - Ekb(g, (tCb(h + j, b.c.length), BD(b.c[h + j], 19))); - i3 += (tCb(h + j, b.c.length), BD(b.c[h + j], 19)).a - d; - ++c2; - while (c2 < a.gc() && BD(a.Xb(c2), 19).a + i3 <= (tCb(h + j, b.c.length), BD(b.c[h + j], 19)).a) { - ++c2; - } - h += 1 + j; - } - return g; - } - function RKd(a) { - var b, c2, d, e, f2, g, h; - if (!a.d) { - h = new XNd(); - b = KKd; - f2 = b.a.zc(a, b); - if (f2 == null) { - for (d = new Fyd(_Kd(a)); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 26); - ytd(h, RKd(c2)); - } - b.a.Bc(a) != null; - b.a.gc() == 0 && void 0; - } - g = h.i; - for (e = (!a.q && (a.q = new cUd(n5, a, 11, 10)), new Fyd(a.q)); e.e != e.i.gc(); ++g) { - BD(Dyd(e), 399); - } - ytd(h, (!a.q && (a.q = new cUd(n5, a, 11, 10)), a.q)); - vud(h); - a.d = new nNd((BD(qud(ZKd((NFd(), MFd).o), 9), 18), h.i), h.g); - a.e = BD(h.g, 673); - a.e == null && (a.e = LKd); - $Kd(a).b &= -17; - } - return a.d; - } - function M2d(a, b, c2, d) { - var e, f2, g, h, i3, j; - j = S6d(a.e.Tg(), b); - i3 = 0; - e = BD(a.g, 119); - Q6d(); - if (BD(b, 66).Oj()) { - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (j.rl(f2.ak())) { - if (pb(f2, c2)) { - return i3; - } - ++i3; - } - } - } else if (c2 != null) { - for (h = 0; h < a.i; ++h) { - f2 = e[h]; - if (j.rl(f2.ak())) { - if (pb(c2, f2.dd())) { - return i3; - } - ++i3; - } - } - if (d) { - i3 = 0; - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (j.rl(f2.ak())) { - if (PD(c2) === PD(a3d(a, BD(f2.dd(), 56)))) { - return i3; - } - ++i3; - } - } - } - } else { - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (j.rl(f2.ak())) { - if (f2.dd() == null) { - return i3; - } - ++i3; - } - } - } - return -1; - } - function aed(a, b, c2, d, e) { - var f2, g, h, i3, j, k, l, m, n; - mmb(); - Okb(a, new Jed()); - g = Ru(a); - n = new Rkb(); - m = new Rkb(); - h = null; - i3 = 0; - while (g.b != 0) { - f2 = BD(g.b == 0 ? null : (sCb(g.b != 0), Nsb(g, g.a.a)), 157); - if (!h || red(h) * qed(h) / 2 < red(f2) * qed(f2)) { - h = f2; - n.c[n.c.length] = f2; - } else { - i3 += red(f2) * qed(f2); - m.c[m.c.length] = f2; - if (m.c.length > 1 && (i3 > red(h) * qed(h) / 2 || g.b == 0)) { - l = new wed(m); - k = red(h) / qed(h); - j = fed(l, b, new p0b(), c2, d, e, k); - P6c(X6c(l.e), j); - h = l; - n.c[n.c.length] = l; - i3 = 0; - m.c = KC(SI, Uhe, 1, 0, 5, 1); - } - } - } - Gkb(n, m); - return n; - } - function y6d(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2, p; - if (c2.mh(b)) { - k = (n = b, !n ? null : BD(d, 49).xh(n)); - if (k) { - p = c2.bh(b, a.a); - o2 = b.t; - if (o2 > 1 || o2 == -1) { - l = BD(p, 69); - m = BD(k, 69); - if (l.dc()) { - m.$b(); - } else { - g = !!zUd(b); - f2 = 0; - for (h = a.a ? l.Kc() : l.Zh(); h.Ob(); ) { - j = BD(h.Pb(), 56); - e = BD(Wrb(a, j), 56); - if (!e) { - if (a.b && !g) { - m.Xh(f2, j); - ++f2; - } - } else { - if (g) { - i3 = m.Xc(e); - i3 == -1 ? m.Xh(f2, e) : f2 != i3 && m.ji(f2, e); - } else { - m.Xh(f2, e); - } - ++f2; - } - } - } - } else { - if (p == null) { - k.Wb(null); - } else { - e = Wrb(a, p); - e == null ? a.b && !zUd(b) && k.Wb(p) : k.Wb(e); - } - } - } - } - } - function E6b(a, b) { - var c2, d, e, f2, g, h, i3, j; - c2 = new L6b(); - for (e = new Sr(ur(R_b(b).a.Kc(), new Sq())); Qr(e); ) { - d = BD(Rr(e), 17); - if (OZb(d)) { - continue; - } - h = d.c.i; - if (F6b(h, C6b)) { - j = G6b(a, h, C6b, B6b); - if (j == -1) { - continue; - } - c2.b = $wnd.Math.max(c2.b, j); - !c2.a && (c2.a = new Rkb()); - Ekb(c2.a, h); - } - } - for (g = new Sr(ur(U_b(b).a.Kc(), new Sq())); Qr(g); ) { - f2 = BD(Rr(g), 17); - if (OZb(f2)) { - continue; - } - i3 = f2.d.i; - if (F6b(i3, B6b)) { - j = G6b(a, i3, B6b, C6b); - if (j == -1) { - continue; - } - c2.d = $wnd.Math.max(c2.d, j); - !c2.c && (c2.c = new Rkb()); - Ekb(c2.c, i3); - } - } - return c2; - } - function Khb(a) { - Dhb(); - var b, c2, d, e; - b = QD(a); - if (a < Chb.length) { - return Chb[b]; - } else if (a <= 50) { - return Pgb((Hgb(), Egb), b); - } else if (a <= _ie) { - return Qgb(Pgb(Bhb[1], b), b); - } - if (a > 1e6) { - throw vbb(new ocb("power of ten too big")); - } - if (a <= Ohe) { - return Qgb(Pgb(Bhb[1], b), b); - } - d = Pgb(Bhb[1], Ohe); - e = d; - c2 = Cbb(a - Ohe); - b = QD(a % Ohe); - while (ybb(c2, Ohe) > 0) { - e = Ogb(e, d); - c2 = Qbb(c2, Ohe); - } - e = Ogb(e, Pgb(Bhb[1], b)); - e = Qgb(e, Ohe); - c2 = Cbb(a - Ohe); - while (ybb(c2, Ohe) > 0) { - e = Qgb(e, Ohe); - c2 = Qbb(c2, Ohe); - } - e = Qgb(e, b); - return e; - } - function X5b(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - Odd(b, "Hierarchical port dummy size processing", 1); - i3 = new Rkb(); - k = new Rkb(); - d = Edb(ED(vNb(a, (Nyc(), myc)))); - c2 = d * 2; - for (f2 = new olb(a.b); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 29); - i3.c = KC(SI, Uhe, 1, 0, 5, 1); - k.c = KC(SI, Uhe, 1, 0, 5, 1); - for (h = new olb(e.a); h.a < h.c.c.length; ) { - g = BD(mlb(h), 10); - if (g.k == (j0b(), e0b)) { - j = BD(vNb(g, (wtc(), Hsc)), 61); - j == (Ucd(), Acd) ? (i3.c[i3.c.length] = g, true) : j == Rcd && (k.c[k.c.length] = g, true); - } - } - Y5b(i3, true, c2); - Y5b(k, false, c2); - } - Qdd(b); - } - function Oac(a, b) { - var c2, d, e, f2, g, h, i3; - Odd(b, "Layer constraint postprocessing", 1); - i3 = a.b; - if (i3.c.length != 0) { - d = (tCb(0, i3.c.length), BD(i3.c[0], 29)); - g = BD(Ikb(i3, i3.c.length - 1), 29); - c2 = new H1b(a); - f2 = new H1b(a); - Mac(a, d, g, c2, f2); - c2.a.c.length == 0 || (wCb(0, i3.c.length), aCb(i3.c, 0, c2)); - f2.a.c.length == 0 || (i3.c[i3.c.length] = f2, true); - } - if (wNb(a, (wtc(), Lsc))) { - e = new H1b(a); - h = new H1b(a); - Pac(a, e, h); - e.a.c.length == 0 || (wCb(0, i3.c.length), aCb(i3.c, 0, e)); - h.a.c.length == 0 || (i3.c[i3.c.length] = h, true); - } - Qdd(b); - } - function b6b(a) { - var b, c2, d, e, f2, g, h, i3, j, k; - for (i3 = new olb(a.a); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 10); - if (h.k != (j0b(), e0b)) { - continue; - } - e = BD(vNb(h, (wtc(), Hsc)), 61); - if (e == (Ucd(), zcd) || e == Tcd) { - for (d = new Sr(ur(O_b(h).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 17); - b = c2.a; - if (b.b == 0) { - continue; - } - j = c2.c; - if (j.i == h) { - f2 = (sCb(b.b != 0), BD(b.a.a.c, 8)); - f2.b = l7c(OC(GC(m1, 1), nie, 8, 0, [j.i.n, j.n, j.a])).b; - } - k = c2.d; - if (k.i == h) { - g = (sCb(b.b != 0), BD(b.c.b.c, 8)); - g.b = l7c(OC(GC(m1, 1), nie, 8, 0, [k.i.n, k.n, k.a])).b; - } - } - } - } - } - function Tec(a, b) { - var c2, d, e, f2, g, h, i3; - Odd(b, "Sort By Input Model " + vNb(a, (Nyc(), ywc)), 1); - e = 0; - for (d = new olb(a.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 29); - i3 = e == 0 ? 0 : e - 1; - h = BD(Ikb(a.b, i3), 29); - for (g = new olb(c2.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 10); - if (PD(vNb(f2, Vxc)) !== PD((dcd(), Zbd)) && PD(vNb(f2, Vxc)) !== PD($bd)) { - mmb(); - Okb(f2.j, new Tnc(h, Xec(f2))); - Sdd(b, "Node " + f2 + " ports: " + f2.j); - } - } - mmb(); - Okb(c2.a, new Bnc(h, BD(vNb(a, ywc), 339), BD(vNb(a, wwc), 378))); - Sdd(b, "Layer " + e + ": " + c2); - ++e; - } - Qdd(b); - } - function U1b(a, b) { - var c2, d, e, f2; - f2 = P1b(b); - MAb(new YAb(null, (!b.c && (b.c = new cUd(F2, b, 9, 9)), new Kub(b.c, 16))), new i2b(f2)); - e = BD(vNb(f2, (wtc(), Ksc)), 21); - O1b(b, e); - if (e.Hc((Orc(), Hrc))) { - for (d = new Fyd((!b.c && (b.c = new cUd(F2, b, 9, 9)), b.c)); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 118); - Y1b(a, b, f2, c2); - } - } - BD(hkd(b, (Nyc(), Fxc)), 174).gc() != 0 && L1b(b, f2); - Ccb(DD(vNb(f2, Mxc))) && e.Fc(Mrc); - wNb(f2, hyc) && Wyc(new ezc(Edb(ED(vNb(f2, hyc)))), f2); - PD(hkd(b, axc)) === PD((hbd(), ebd)) ? V1b(a, b, f2) : T1b(a, b, f2); - return f2; - } - function hic(a, b, c2, d) { - var e, f2, g; - this.j = new Rkb(); - this.k = new Rkb(); - this.b = new Rkb(); - this.c = new Rkb(); - this.e = new I6c(); - this.i = new s7c(); - this.f = new lEb(); - this.d = new Rkb(); - this.g = new Rkb(); - Ekb(this.b, a); - Ekb(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 = BD(vNb(d, (Nyc(), jxc)), 74); - if (e) { - for (g = Jsb(e, 0); g.b != g.d.c; ) { - f2 = BD(Xsb(g), 8); - ADb(f2.a, a.a) && Dsb(this.i, f2); - } - } - !!c2 && Ekb(this.j, c2); - Ekb(this.k, d); - } - function oTb(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m; - k = new gub(new ETb(c2)); - h = KC(sbb, dle, 25, a.f.e.c.length, 16, 1); - Glb(h, h.length); - c2[b.b] = 0; - for (j = new olb(a.f.e); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 144); - i3.b != b.b && (c2[i3.b] = Ohe); - zCb(cub(k, i3)); - } - while (k.b.c.length != 0) { - l = BD(dub(k), 144); - h[l.b] = true; - for (f2 = au(new bu(a.b, l), 0); f2.c; ) { - e = BD(uu(f2), 282); - m = rTb(e, l); - if (h[m.b]) { - continue; - } - wNb(e, (bTb(), RSb)) ? g = Edb(ED(vNb(e, RSb))) : g = a.c; - d = c2[l.b] + g; - if (d < c2[m.b]) { - c2[m.b] = d; - eub(k, m); - zCb(cub(k, m)); - } - } - } - } - function xMc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l; - e = true; - for (g = new olb(a.b); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 29); - j = Qje; - k = null; - for (i3 = new olb(f2.a); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 10); - l = Edb(b.p[h.p]) + Edb(b.d[h.p]) - h.d.d; - d = Edb(b.p[h.p]) + Edb(b.d[h.p]) + h.o.b + h.d.a; - if (l > j && d > j) { - k = h; - j = Edb(b.p[h.p]) + Edb(b.d[h.p]) + h.o.b + h.d.a; - } else { - e = false; - c2.n && Sdd(c2, "bk node placement breaks on " + h + " which should have been after " + k); - break; - } - } - if (!e) { + case 32: + this.popState(); + yy.getLogger().trace("node end (-"); + return "NODE_DEND"; break; - } - } - c2.n && Sdd(c2, b + " is feasible: " + e); - return e; - } - function XNc(a, b, c2, d) { - var e, f2, g, h, i3, j, k; - h = -1; - for (k = new olb(a); k.a < k.c.c.length; ) { - j = BD(mlb(k), 112); - j.g = h--; - e = Tbb(tAb(PAb(JAb(new YAb(null, new Kub(j.f, 16)), new ZNc()), new _Nc())).d); - f2 = Tbb(tAb(PAb(JAb(new YAb(null, new Kub(j.k, 16)), new bOc()), new dOc())).d); - g = e; - i3 = f2; - if (!d) { - g = Tbb(tAb(PAb(new YAb(null, new Kub(j.f, 16)), new fOc())).d); - i3 = Tbb(tAb(PAb(new YAb(null, new Kub(j.k, 16)), new hOc())).d); - } - j.d = g; - j.a = e; - j.i = i3; - j.b = f2; - i3 == 0 ? (Gsb(c2, j, c2.c.b, c2.c), true) : g == 0 && (Gsb(b, j, b.c.b, b.c), true); - } - } - function $8b(a, b, c2, d) { - var e, f2, g, h, i3, j, k; - if (c2.d.i == b.i) { - return; - } - e = new b0b(a); - __b(e, (j0b(), g0b)); - yNb(e, (wtc(), $sc), c2); - yNb(e, (Nyc(), Vxc), (dcd(), $bd)); - d.c[d.c.length] = e; - g = new H0b(); - F0b(g, e); - G0b(g, (Ucd(), Tcd)); - h = new H0b(); - F0b(h, e); - G0b(h, zcd); - k = c2.d; - RZb(c2, g); - f2 = new UZb(); - tNb(f2, c2); - yNb(f2, jxc, null); - QZb(f2, h); - RZb(f2, k); - j = new Bib(c2.b, 0); - while (j.b < j.d.gc()) { - i3 = (sCb(j.b < j.d.gc()), BD(j.d.Xb(j.c = j.b++), 70)); - if (PD(vNb(i3, Qwc)) === PD((qad(), oad))) { - yNb(i3, Dsc, c2); - uib(j); - Ekb(f2.b, i3); - } - } - a9b(e, g, h); - } - function Z8b(a, b, c2, d) { - var e, f2, g, h, i3, j, k; - if (c2.c.i == b.i) { - return; - } - e = new b0b(a); - __b(e, (j0b(), g0b)); - yNb(e, (wtc(), $sc), c2); - yNb(e, (Nyc(), Vxc), (dcd(), $bd)); - d.c[d.c.length] = e; - g = new H0b(); - F0b(g, e); - G0b(g, (Ucd(), Tcd)); - h = new H0b(); - F0b(h, e); - G0b(h, zcd); - RZb(c2, g); - f2 = new UZb(); - tNb(f2, c2); - yNb(f2, jxc, null); - QZb(f2, h); - RZb(f2, b); - a9b(e, g, h); - j = new Bib(c2.b, 0); - while (j.b < j.d.gc()) { - i3 = (sCb(j.b < j.d.gc()), BD(j.d.Xb(j.c = j.b++), 70)); - k = BD(vNb(i3, Qwc), 272); - if (k == (qad(), oad)) { - wNb(i3, Dsc) || yNb(i3, Dsc, c2); - uib(j); - Ekb(f2.b, i3); - } - } - } - function dDc(a, b, c2, d, e) { - var f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4; - m = new Rkb(); - r = Gx(d); - q = b * a.a; - l = 0; - o2 = 0; - f2 = new Tqb(); - g = new Tqb(); - h = new Rkb(); - s = 0; - t4 = 0; - n = 0; - p = 0; - j = 0; - k = 0; - while (r.a.gc() != 0) { - i3 = hDc(r, e, g); - if (i3) { - r.a.Bc(i3) != null; - h.c[h.c.length] = i3; - f2.a.zc(i3, f2); - o2 = a.f[i3.p]; - s += a.e[i3.p] - o2 * a.b; - l = a.c[i3.p]; - t4 += l * a.b; - k += o2 * a.b; - p += a.e[i3.p]; - } - if (!i3 || r.a.gc() == 0 || s >= q && a.e[i3.p] > o2 * a.b || t4 >= c2 * q) { - m.c[m.c.length] = h; - h = new Rkb(); - ye(g, f2); - f2.a.$b(); - j -= k; - n = $wnd.Math.max(n, j * a.b + p); - j += t4; - s = t4; - t4 = 0; - k = 0; - p = 0; - } - } - return new vgd(n, m); - } - function q4c(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n; - for (c2 = (j = new $ib(a.c.b).a.vc().Kc(), new djb(j)); c2.a.Ob(); ) { - b = (h = BD(c2.a.Pb(), 42), BD(h.dd(), 149)); - e = b.a; - e == null && (e = ""); - d = i4c(a.c, e); - !d && e.length == 0 && (d = u4c(a)); - !!d && !ze(d.c, b, false) && Dsb(d.c, b); - } - for (g = Jsb(a.a, 0); g.b != g.d.c; ) { - f2 = BD(Xsb(g), 478); - k = j4c(a.c, f2.a); - n = j4c(a.c, f2.b); - !!k && !!n && Dsb(k.c, new vgd(n, f2.c)); - } - Osb(a.a); - for (m = Jsb(a.b, 0); m.b != m.d.c; ) { - l = BD(Xsb(m), 478); - b = g4c(a.c, l.a); - i3 = j4c(a.c, l.b); - !!b && !!i3 && B3c(b, i3, l.c); - } - Osb(a.b); - } - function qvd(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n; - f2 = new fC(a); - g = new ird(); - e = (ko(g.g), ko(g.j), Uhb(g.b), ko(g.d), ko(g.i), Uhb(g.k), Uhb(g.c), Uhb(g.e), n = drd(g, f2, null), ard(g, f2), n); - if (b) { - j = new fC(b); - h = rvd(j); - jfd(e, OC(GC(g2, 1), Uhe, 527, 0, [h])); - } - m = false; - l = false; - if (c2) { - j = new fC(c2); - que in j.a && (m = aC(j, que).ge().a); - rue in j.a && (l = aC(j, rue).ge().a); - } - k = Vdd(Xdd(new Zdd(), m), l); - t2c(new w2c(), e, k); - que in f2.a && cC(f2, que, null); - if (m || l) { - i3 = new eC(); - nvd(k, i3, m, l); - cC(f2, que, i3); - } - d = new Prd(g); - Ghe(new _ud(e), d); - } - function pA(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l; - g = new nB(); - j = OC(GC(WD, 1), oje, 25, 15, [0]); - e = -1; - f2 = 0; - d = 0; - for (i3 = 0; i3 < a.b.c.length; ++i3) { - k = BD(Ikb(a.b, i3), 434); - if (k.b > 0) { - if (e < 0 && k.a) { - e = i3; - f2 = j[0]; - d = 0; - } - if (e >= 0) { - h = k.b; - if (i3 == e) { - h -= d++; - if (h == 0) { - return 0; - } - } - if (!wA(b, j, k, h, g)) { - i3 = e - 1; - j[0] = f2; - continue; - } - } else { - e = -1; - if (!wA(b, j, k, 0, g)) { - return 0; - } - } - } else { - e = -1; - if (bfb(k.c, 0) == 32) { - l = j[0]; - uA(b, j); - if (j[0] > l) { - continue; - } - } else if (ofb(b, k.c, j[0])) { - j[0] += k.c.length; - continue; - } - return 0; - } - } - if (!mB(g, c2)) { - return 0; - } - return j[0]; - } - function SKd(a) { - var b, c2, d, e, f2, g, h, i3; - if (!a.f) { - i3 = new CNd(); - h = new CNd(); - b = KKd; - g = b.a.zc(a, b); - if (g == null) { - for (f2 = new Fyd(_Kd(a)); f2.e != f2.i.gc(); ) { - e = BD(Dyd(f2), 26); - ytd(i3, SKd(e)); - } - b.a.Bc(a) != null; - b.a.gc() == 0 && void 0; - } - for (d = (!a.s && (a.s = new cUd(t5, a, 21, 17)), new Fyd(a.s)); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 170); - JD(c2, 99) && wtd(h, BD(c2, 18)); - } - vud(h); - a.r = new UNd(a, (BD(qud(ZKd((NFd(), MFd).o), 6), 18), h.i), h.g); - ytd(i3, a.r); - vud(i3); - a.f = new nNd((BD(qud(ZKd(MFd.o), 5), 18), i3.i), i3.g); - $Kd(a).b &= -3; - } - return a.f; - } - function rMb(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2; - g = a.o; - d = KC(WD, oje, 25, g, 15, 1); - e = KC(WD, oje, 25, g, 15, 1); - c2 = a.p; - b = KC(WD, oje, 25, c2, 15, 1); - f2 = KC(WD, oje, 25, c2, 15, 1); - for (j = 0; j < g; j++) { - l = 0; - while (l < c2 && !YMb(a, j, l)) { - ++l; - } - d[j] = l; - } - for (k = 0; k < g; k++) { - l = c2 - 1; - while (l >= 0 && !YMb(a, k, l)) { - --l; - } - e[k] = l; - } - for (n = 0; n < c2; n++) { - h = 0; - while (h < g && !YMb(a, h, n)) { - ++h; - } - b[n] = h; - } - for (o2 = 0; o2 < c2; o2++) { - h = g - 1; - while (h >= 0 && !YMb(a, h, o2)) { - --h; - } - f2[o2] = h; - } - for (i3 = 0; i3 < g; i3++) { - for (m = 0; m < c2; m++) { - i3 < f2[m] && i3 > b[m] && m < e[i3] && m > d[i3] && aNb(a, i3, m, false, true); - } - } - } - function lRb(a) { - var b, c2, d, e, f2, g, h, i3; - c2 = Ccb(DD(vNb(a, (wSb(), cSb)))); - f2 = a.a.c.d; - h = a.a.d.d; - if (c2) { - g = Y6c(c7c(new f7c(h.a, h.b), f2), 0.5); - i3 = Y6c(R6c(a.e), 0.5); - b = c7c(P6c(new f7c(f2.a, f2.b), g), i3); - a7c(a.d, b); - } else { - e = Edb(ED(vNb(a.a, tSb))); - 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 Qge(a, b) { - var c2, d, e, f2, g, h, i3; - if (a == null) { - return null; - } - f2 = a.length; - if (f2 == 0) { - return ""; - } - i3 = KC(TD, $ie, 25, f2, 15, 1); - ACb(0, f2, a.length); - ACb(0, f2, i3.length); - ffb(a, 0, f2, i3, 0); - c2 = null; - h = b; - for (e = 0, g = 0; e < f2; e++) { - d = i3[e]; - lde(); - if (d <= 32 && (kde[d] & 2) != 0) { - if (h) { - !c2 && (c2 = new Jfb(a)); - Gfb(c2, e - g++); - } else { - h = b; - if (d != 32) { - !c2 && (c2 = new Jfb(a)); - kcb(c2, e - g, e - g + 1, String.fromCharCode(32)); - } - } - } else { - h = false; - } - } - if (h) { - if (!c2) { - return a.substr(0, f2 - 1); - } else { - f2 = c2.a.length; - return f2 > 0 ? qfb(c2.a, 0, f2 - 1) : ""; - } - } else { - return !c2 ? a : c2.a; - } - } - function DPb(a) { - r4c(a, new E3c(P3c(M3c(O3c(N3c(new R3c(), Yle), "ELK DisCo"), "Layouter for arranging unconnected subgraphs. The subgraphs themselves are, by default, not laid out."), new GPb()))); - p4c(a, Yle, Zle, Ksd(BPb)); - p4c(a, Yle, $le, Ksd(vPb)); - p4c(a, Yle, _le, Ksd(qPb)); - p4c(a, Yle, ame, Ksd(wPb)); - p4c(a, Yle, Zke, Ksd(zPb)); - p4c(a, Yle, $ke, Ksd(yPb)); - p4c(a, Yle, Yke, Ksd(APb)); - p4c(a, Yle, _ke, Ksd(xPb)); - p4c(a, Yle, Tle, Ksd(sPb)); - p4c(a, Yle, Ule, Ksd(rPb)); - p4c(a, Yle, Vle, Ksd(tPb)); - p4c(a, Yle, Wle, Ksd(uPb)); - } - function Zbc(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m; - f2 = new b0b(a); - __b(f2, (j0b(), i0b)); - yNb(f2, (Nyc(), Vxc), (dcd(), $bd)); - e = 0; - if (b) { - g = new H0b(); - yNb(g, (wtc(), $sc), b); - yNb(f2, $sc, b.i); - G0b(g, (Ucd(), Tcd)); - F0b(g, f2); - m = k_b(b.e); - for (j = m, k = 0, l = j.length; k < l; ++k) { - i3 = j[k]; - RZb(i3, g); - } - yNb(b, gtc, f2); - ++e; - } - if (c2) { - h = new H0b(); - yNb(f2, (wtc(), $sc), c2.i); - yNb(h, $sc, c2); - G0b(h, (Ucd(), zcd)); - F0b(h, f2); - m = k_b(c2.g); - for (j = m, k = 0, l = j.length; k < l; ++k) { - i3 = j[k]; - QZb(i3, h); - } - yNb(c2, gtc, f2); - ++e; - } - yNb(f2, (wtc(), ysc), meb(e)); - d.c[d.c.length] = f2; - return f2; - } - function Smd() { - Smd = ccb; - Qmd = OC(GC(TD, 1), $ie, 25, 15, [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70]); - Rmd = new RegExp("[ \n\r\f]+"); - try { - Pmd = OC(GC(c6, 1), Uhe, 2015, 0, [new EQd((GA(), IA("yyyy-MM-dd'T'HH:mm:ss'.'SSSZ", LA((KA(), KA(), JA))))), new EQd(IA("yyyy-MM-dd'T'HH:mm:ss'.'SSS", LA((null, JA)))), new EQd(IA("yyyy-MM-dd'T'HH:mm:ss", LA((null, JA)))), new EQd(IA("yyyy-MM-dd'T'HH:mm", LA((null, JA)))), new EQd(IA("yyyy-MM-dd", LA((null, JA))))]); - } catch (a) { - a = ubb(a); - if (!JD(a, 78)) - throw vbb(a); - } - } - function qgb(a) { - var b, c2, d, e; - d = shb((!a.c && (a.c = fhb(a.f)), a.c), 0); - if (a.e == 0 || a.a == 0 && a.f != -1 && a.e < 0) { - return d; - } - b = pgb(a) < 0 ? 1 : 0; - c2 = a.e; - e = (d.length + 1 + $wnd.Math.abs(QD(a.e)), new Vfb()); - b == 1 && (e.a += "-", e); - if (a.e > 0) { - c2 -= d.length - b; - if (c2 >= 0) { - e.a += "0."; - for (; c2 > egb.length; c2 -= egb.length) { - Rfb(e, egb); - } - Sfb(e, egb, QD(c2)); - Qfb(e, d.substr(b)); - } else { - c2 = b - c2; - Qfb(e, qfb(d, b, QD(c2))); - e.a += "."; - Qfb(e, pfb(d, QD(c2))); - } - } else { - Qfb(e, d.substr(b)); - for (; c2 < -egb.length; c2 += egb.length) { - Rfb(e, egb); - } - Sfb(e, egb, QD(-c2)); - } - return e.a; - } - function v6c(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m; - i3 = c7c(new f7c(c2.a, c2.b), a); - j = i3.a * b.b - i3.b * b.a; - k = b.a * d.b - b.b * d.a; - l = (i3.a * d.b - i3.b * d.a) / k; - m = j / k; - if (k == 0) { - if (j == 0) { - e = P6c(new f7c(c2.a, c2.b), Y6c(new f7c(d.a, d.b), 0.5)); - f2 = S6c(a, e); - g = S6c(P6c(new f7c(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 f7c(a.a, a.b); - } - if (g <= h) { - return P6c(new f7c(a.a, a.b), b); - } - return null; - } else { - return null; - } - } else { - return l >= 0 && l <= 1 && m >= 0 && m <= 1 ? P6c(new f7c(a.a, a.b), Y6c(new f7c(b.a, b.b), l)) : null; - } - } - function OTb(a, b, c2) { - var d, e, f2, g, h; - d = BD(vNb(a, (Nyc(), zwc)), 21); - c2.a > b.a && (d.Hc((i8c(), c8c)) ? a.c.a += (c2.a - b.a) / 2 : d.Hc(e8c) && (a.c.a += c2.a - b.a)); - c2.b > b.b && (d.Hc((i8c(), g8c)) ? a.c.b += (c2.b - b.b) / 2 : d.Hc(f8c) && (a.c.b += c2.b - b.b)); - if (BD(vNb(a, (wtc(), Ksc)), 21).Hc((Orc(), Hrc)) && (c2.a > b.a || c2.b > b.b)) { - for (h = new olb(a.a); h.a < h.c.c.length; ) { - g = BD(mlb(h), 10); - if (g.k == (j0b(), e0b)) { - e = BD(vNb(g, Hsc), 61); - e == (Ucd(), zcd) ? g.n.a += c2.a - b.a : e == Rcd && (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 H5b(a, b, c2) { - var d, e, f2, g, h; - d = BD(vNb(a, (Nyc(), zwc)), 21); - c2.a > b.a && (d.Hc((i8c(), c8c)) ? a.c.a += (c2.a - b.a) / 2 : d.Hc(e8c) && (a.c.a += c2.a - b.a)); - c2.b > b.b && (d.Hc((i8c(), g8c)) ? a.c.b += (c2.b - b.b) / 2 : d.Hc(f8c) && (a.c.b += c2.b - b.b)); - if (BD(vNb(a, (wtc(), Ksc)), 21).Hc((Orc(), Hrc)) && (c2.a > b.a || c2.b > b.b)) { - for (g = new olb(a.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 10); - if (f2.k == (j0b(), e0b)) { - e = BD(vNb(f2, Hsc), 61); - e == (Ucd(), zcd) ? f2.n.a += c2.a - b.a : e == Rcd && (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 kMc(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m; - b = DMc(a); - for (k = (h = new Pib(b).a.vc().Kc(), new Vib(h)); k.a.Ob(); ) { - j = (e = BD(k.a.Pb(), 42), BD(e.cd(), 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 = FMc(c2, f2); - i3 = 0; - a.c == (YLc(), WLc) ? i3 = d.d.n.b + d.d.a.b - d.c.n.b - d.c.a.b : i3 = d.c.n.b + d.c.a.b - d.d.n.b - d.d.a.b; - g = Edb(a.d[c2.p]) + i3; - 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] = Edb(a.d[c2.p]) + l; - c2 = a.a[c2.p]; - } while (c2 != j); - a.b[j.p] = l + m; - } - } - function LOb(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m; - a.b = false; - l = Pje; - i3 = Qje; - m = Pje; - j = Qje; - for (d = a.e.a.ec().Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 266); - e = c2.a; - l = $wnd.Math.min(l, e.c); - i3 = $wnd.Math.max(i3, e.c + e.b); - m = $wnd.Math.min(m, e.d); - j = $wnd.Math.max(j, e.d + e.a); - for (g = new olb(c2.c); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 395); - 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); - i3 = $wnd.Math.max(i3, h); - } - } - } - a.a = new f7c(i3 - l, j - m); - a.c = new f7c(l + a.d.a, m + a.d.b); - } - function xZc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l; - l = new Rkb(); - k = new x$c(0, c2); - f2 = 0; - s$c(k, new PZc(0, 0, k, c2)); - e = 0; - for (j = new Fyd(a); j.e != j.i.gc(); ) { - i3 = BD(Dyd(j), 33); - d = BD(Ikb(k.a, k.a.c.length - 1), 187); - h = e + i3.g + (BD(Ikb(k.a, 0), 187).b.c.length == 0 ? 0 : c2); - if (h > b) { - e = 0; - f2 += k.b + c2; - l.c[l.c.length] = k; - k = new x$c(f2, c2); - d = new PZc(0, k.f, k, c2); - s$c(k, d); - e = 0; - } - if (d.b.c.length == 0 || i3.f >= d.o && i3.f <= d.f || d.a * 0.5 <= i3.f && d.a * 1.5 >= i3.f) { - EZc(d, i3); - } else { - g = new PZc(d.s + d.r + c2, k.f, k, c2); - s$c(k, g); - EZc(g, i3); - } - e = i3.i + i3.g; - } - l.c[l.c.length] = k; - return l; - } - function OKd(a) { - var b, c2, d, e, f2, g, h, i3; - if (!a.a) { - a.o = null; - i3 = new GNd(a); - b = new KNd(); - c2 = KKd; - h = c2.a.zc(a, c2); - if (h == null) { - for (g = new Fyd(_Kd(a)); g.e != g.i.gc(); ) { - f2 = BD(Dyd(g), 26); - ytd(i3, OKd(f2)); - } - c2.a.Bc(a) != null; - c2.a.gc() == 0 && void 0; - } - for (e = (!a.s && (a.s = new cUd(t5, a, 21, 17)), new Fyd(a.s)); e.e != e.i.gc(); ) { - d = BD(Dyd(e), 170); - JD(d, 322) && wtd(b, BD(d, 34)); - } - vud(b); - a.k = new PNd(a, (BD(qud(ZKd((NFd(), MFd).o), 7), 18), b.i), b.g); - ytd(i3, a.k); - vud(i3); - a.a = new nNd((BD(qud(ZKd(MFd.o), 4), 18), i3.i), i3.g); - $Kd(a).b &= -2; - } - return a.a; - } - function vZc(a, b, c2, d, e, f2, g) { - var h, i3, j, k, l, m; - l = false; - i3 = ZZc(c2.q, b.f + b.b - c2.q.f); - m = e - (c2.q.e + i3 - g); - if (m < d.g) { - return false; - } - j = f2 == a.c.length - 1 && m >= (tCb(f2, a.c.length), BD(a.c[f2], 200)).e; - k = (h = MZc(d, m, false), h.a); - if (k > b.b && !j) { - return false; - } - if (j || k <= b.b) { - if (j && k > b.b) { - c2.d = k; - KZc(c2, JZc(c2, k)); - } else { - $Zc(c2.q, i3); - c2.c = true; - } - KZc(d, e - (c2.s + c2.r)); - OZc(d, c2.q.e + c2.q.d, b.f); - s$c(b, d); - if (a.c.length > f2) { - v$c((tCb(f2, a.c.length), BD(a.c[f2], 200)), d); - (tCb(f2, a.c.length), BD(a.c[f2], 200)).a.c.length == 0 && Kkb(a, f2); - } - l = true; - } - return l; - } - function C2d(a, b, c2, d) { - var e, f2, g, h, i3, j, k; - k = S6d(a.e.Tg(), b); - e = 0; - f2 = BD(a.g, 119); - i3 = null; - Q6d(); - if (BD(b, 66).Oj()) { - for (h = 0; h < a.i; ++h) { - g = f2[h]; - if (k.rl(g.ak())) { - if (pb(g, c2)) { - i3 = g; - break; - } - ++e; - } - } - } else if (c2 != null) { - for (h = 0; h < a.i; ++h) { - g = f2[h]; - if (k.rl(g.ak())) { - if (pb(c2, g.dd())) { - i3 = g; - break; - } - ++e; - } - } - } else { - for (h = 0; h < a.i; ++h) { - g = f2[h]; - if (k.rl(g.ak())) { - if (g.dd() == null) { - i3 = g; - break; - } - ++e; - } - } - } - if (i3) { - if (oid(a.e)) { - j = b.$j() ? new O7d(a.e, 4, b, c2, null, e, true) : H2d(a, b.Kj() ? 2 : 1, b, c2, b.zj(), -1, true); - d ? d.Ei(j) : d = j; - } - d = B2d(a, i3, d); - } - return d; - } - function kYc(a, b, c2, d, e, f2, g) { - var h, i3, j, k, l, m, n, o2, p; - o2 = 0; - p = 0; - i3 = 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 = tYc(o2, f2, d, g) : p = d.j; - m = $wnd.Math.max(i3, o2 + n); - j = $wnd.Math.max(h, p + k); + case 33: + this.popState(); + yy.getLogger().trace("node end (("); + return "NODE_DEND"; break; - case 1: - p = d.j + d.f + g; - a.c ? o2 = sYc(p, f2, d, g) : o2 = d.i; - m = $wnd.Math.max(i3, o2 + n); - j = $wnd.Math.max(h, p + k); + case 34: + this.popState(); + yy.getLogger().trace("node end (("); + return "NODE_DEND"; break; - case 2: - o2 = i3 + g; - p = 0; - m = i3 + g + n; - j = $wnd.Math.max(h, k); + case 35: + yy.getLogger().trace("Long description:", yy_.yytext); + return 20; break; - case 3: - o2 = 0; - p = h + g; - m = $wnd.Math.max(i3, n); - j = h + g + k; + case 36: + yy.getLogger().trace("Long description:", yy_.yytext); + return 20; break; - default: - throw vbb(new Wdb("IllegalPlacementOption.")); - } - l = new e$c(a.a, m, j, b, o2, p); - return l; - } - function R2b(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m; - h = a.d; - l = BD(vNb(a, (wtc(), vtc)), 15); - b = BD(vNb(a, tsc), 15); - if (!l && !b) { - return; } - f2 = Edb(ED(pBc(a, (Nyc(), iyc)))); - g = Edb(ED(pBc(a, jyc))); - m = 0; - if (l) { - j = 0; - for (e = l.Kc(); e.Ob(); ) { - d = BD(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 = BD(e.Pb(), 10); - j = $wnd.Math.max(j, d.o.b); - c2 += d.o.a; - } - c2 += f2 * (b.gc() - 1); - h.a += j + g; - } - i3 = $wnd.Math.max(m, c2); - if (i3 > a.o.a) { - k = (i3 - a.o.a) / 2; - h.b = $wnd.Math.max(h.b, k); - h.c = $wnd.Math.max(h.c, k); - } - } - function rvd(a) { - var b, c2, d, e, f2, g, h, i3; - f2 = new b2c(); - Z1c(f2, (Y1c(), V1c)); - for (d = (e = $B(a, KC(ZI, nie, 2, 0, 6, 1)), new vib(new amb(new mC(a, e).b))); d.b < d.d.gc(); ) { - c2 = (sCb(d.b < d.d.gc()), GD(d.d.Xb(d.c = d.b++))); - g = k4c(lvd, c2); - if (g) { - b = aC(a, c2); - b.je() ? h = b.je().a : b.ge() ? h = "" + b.ge().a : b.he() ? h = "" + b.he().a : h = b.Ib(); - i3 = o5c(g, h); - if (i3 != null) { - (uqb(g.j, (N5c(), K5c)) || uqb(g.j, L5c)) && xNb(_1c(f2, E2), g, i3); - uqb(g.j, I5c) && xNb(_1c(f2, B2), g, i3); - uqb(g.j, M5c) && xNb(_1c(f2, F2), g, i3); - uqb(g.j, J5c) && xNb(_1c(f2, D2), g, i3); - } - } - } - return f2; - } - function J2d(a, b, c2, d) { - var e, f2, g, h, i3, j; - i3 = S6d(a.e.Tg(), b); - f2 = BD(a.g, 119); - if (T6d(a.e, b)) { - e = 0; - for (h = 0; h < a.i; ++h) { - g = f2[h]; - if (i3.rl(g.ak())) { - if (e == c2) { - Q6d(); - if (BD(b, 66).Oj()) { - return g; - } else { - j = g.dd(); - j != null && d && JD(b, 99) && (BD(b, 18).Bb & Tje) != 0 && (j = b3d(a, b, h, e, j)); - return j; - } - } - ++e; - } - } - throw vbb(new qcb(gve + c2 + mue + e)); - } else { - e = 0; - for (h = 0; h < a.i; ++h) { - g = f2[h]; - if (i3.rl(g.ak())) { - Q6d(); - if (BD(b, 66).Oj()) { - return g; - } else { - j = g.dd(); - j != null && d && JD(b, 99) && (BD(b, 18).Bb & Tje) != 0 && (j = b3d(a, b, h, e, j)); - return j; - } - } - ++e; - } - return b.zj(); - } - } - function K2d(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - e = BD(a.g, 119); - if (T6d(a.e, b)) { - return Q6d(), BD(b, 66).Oj() ? new R7d(b, a) : new f7d(b, a); - } else { - j = S6d(a.e.Tg(), b); - d = 0; - for (h = 0; h < a.i; ++h) { - f2 = e[h]; - g = f2.ak(); - if (j.rl(g)) { - Q6d(); - if (BD(b, 66).Oj()) { - return f2; - } else if (g == (m8d(), k8d) || g == h8d) { - i3 = new Wfb(fcb(f2.dd())); - while (++h < a.i) { - f2 = e[h]; - g = f2.ak(); - (g == k8d || g == h8d) && Qfb(i3, fcb(f2.dd())); - } - return j6d(BD(b.Yj(), 148), i3.a); - } else { - k = f2.dd(); - k != null && c2 && JD(b, 99) && (BD(b, 18).Bb & Tje) != 0 && (k = b3d(a, b, h, d, k)); - return k; - } - } - ++d; - } - return b.zj(); - } - } - function MZc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m; - f2 = 0; - g = a.t; - e = 0; - d = 0; - i3 = 0; - m = 0; - l = 0; - if (c2) { - a.n.c = KC(SI, Uhe, 1, 0, 5, 1); - Ekb(a.n, new VZc(a.s, a.t, a.i)); - } - h = 0; - for (k = new olb(a.b); k.a < k.c.c.length; ) { - j = BD(mlb(k), 33); - if (f2 + j.g + (h > 0 ? a.i : 0) > b && i3 > 0) { - f2 = 0; - g += i3 + a.i; - e = $wnd.Math.max(e, m); - d += i3 + a.i; - i3 = 0; - m = 0; - if (c2) { - ++l; - Ekb(a.n, new VZc(a.s, g, a.i)); - } - h = 0; - } - m += j.g + (h > 0 ? a.i : 0); - i3 = $wnd.Math.max(i3, j.f); - c2 && QZc(BD(Ikb(a.n, l), 211), j); - f2 += j.g + (h > 0 ? a.i : 0); - ++h; - } - e = $wnd.Math.max(e, m); - d += i3; - if (c2) { - a.r = e; - a.d = d; - u$c(a.j); - } - return new J6c(a.s, a.t, e, d); - } - function $fb(a, b, c2, d, e) { - Zfb(); - var f2, g, h, i3, j, k, l, m, n; - vCb(a, "src"); - vCb(c2, "dest"); - m = rb(a); - i3 = rb(c2); - rCb((m.i & 4) != 0, "srcType is not an array"); - rCb((i3.i & 4) != 0, "destType is not an array"); - l = m.c; - g = i3.c; - rCb((l.i & 1) != 0 ? l == g : (g.i & 1) == 0, "Array types don't match"); - n = a.length; - j = c2.length; - if (b < 0 || d < 0 || e < 0 || b + e > n || d + e > j) { - throw vbb(new pcb()); - } - if ((l.i & 1) == 0 && m != i3) { - k = CD(a); - f2 = CD(c2); - if (PD(a) === PD(c2) && b < d) { - b += e; - for (h = d + e; h-- > d; ) { - NC(f2, h, k[--b]); - } - } else { - for (h = d + e; d < h; ) { - NC(f2, d++, k[b++]); - } - } - } else - e > 0 && $Bb(a, b, c2, d, e, true); - } - function phb() { - phb = ccb; - nhb = OC(GC(WD, 1), oje, 25, 15, [Rie, 1162261467, Iie, 1220703125, 362797056, 1977326743, Iie, 387420489, Jje, 214358881, 429981696, 815730721, 1475789056, 170859375, 268435456, 410338673, 612220032, 893871739, 128e7, 1801088541, 113379904, 148035889, 191102976, 244140625, 308915776, 387420489, 481890304, 594823321, 729e6, 887503681, Iie, 1291467969, 1544804416, 1838265625, 60466176]); - ohb = OC(GC(WD, 1), oje, 25, 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 soc(a) { - var b, c2, d, e, f2, g, h, i3; - for (e = new olb(a.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 29); - for (g = new olb(Mu(d.a)); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 10); - if (ioc(f2)) { - c2 = BD(vNb(f2, (wtc(), usc)), 305); - if (!c2.g && !!c2.d) { - b = c2; - i3 = c2.d; - while (i3) { - roc(i3.i, i3.k, false, true); - zoc(b.a); - zoc(i3.i); - zoc(i3.k); - zoc(i3.b); - RZb(i3.c, b.c.d); - RZb(b.c, null); - $_b(b.a, null); - $_b(i3.i, null); - $_b(i3.k, null); - $_b(i3.b, null); - h = new goc(b.i, i3.a, b.e, i3.j, i3.f); - h.k = b.k; - h.n = b.n; - h.b = b.b; - h.c = i3.c; - h.g = b.g; - h.d = i3.d; - yNb(b.i, usc, h); - yNb(i3.a, usc, h); - i3 = i3.d; - b = h; - } - } - } - } - } - } - function Xfe(a, b) { - var c2, d, e, f2, g; - g = BD(b, 136); - Yfe(a); - Yfe(g); - if (g.b == null) - return; - a.c = true; - if (a.b == null) { - a.b = KC(WD, oje, 25, g.b.length, 15, 1); - $fb(g.b, 0, a.b, 0, g.b.length); - return; - } - f2 = KC(WD, oje, 25, 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 S6b(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - c2 = Ccb(DD(vNb(a, (wtc(), Usc)))); - h = Ccb(DD(vNb(b, Usc))); - d = BD(vNb(a, Vsc), 11); - i3 = BD(vNb(b, Vsc), 11); - e = BD(vNb(a, Wsc), 11); - j = BD(vNb(b, Wsc), 11); - k = !!d && d == i3; - l = !!e && e == j; - if (!c2 && !h) { - return new Z6b(BD(mlb(new olb(a.j)), 11).p == BD(mlb(new olb(b.j)), 11).p, k, l); - } - f2 = (!Ccb(DD(vNb(a, Usc))) || Ccb(DD(vNb(a, Tsc)))) && (!Ccb(DD(vNb(b, Usc))) || Ccb(DD(vNb(b, Tsc)))); - g = (!Ccb(DD(vNb(a, Usc))) || !Ccb(DD(vNb(a, Tsc)))) && (!Ccb(DD(vNb(b, Usc))) || !Ccb(DD(vNb(b, Tsc)))); - return new Z6b(k && f2 || l && g, k, l); - } - function HZc(a) { - var b, c2, d, e, f2, g, h, i3; - d = 0; - c2 = 0; - i3 = new Psb(); - b = 0; - for (h = new olb(a.n); h.a < h.c.c.length; ) { - g = BD(mlb(h), 211); - if (g.c.c.length == 0) { - Gsb(i3, g, i3.c.b, i3.c); - } else { - d = $wnd.Math.max(d, g.d); - c2 += g.a + (b > 0 ? a.i : 0); - } - ++b; - } - Ce(a.n, i3); - a.d = c2; - a.r = d; - a.g = 0; - a.f = 0; - a.e = 0; - a.o = Pje; - a.p = Pje; - for (f2 = new olb(a.b); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 33); - 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); - u$c(a.j); - } - function Sld(a) { - var b, c2, d, e; - if ((a.Db & 64) != 0) - return Mkd(a); - b = new Wfb(_se); - d = a.k; - if (!d) { - !a.n && (a.n = new cUd(D2, a, 1, 7)); - if (a.n.i > 0) { - e = (!a.n && (a.n = new cUd(D2, a, 1, 7)), BD(qud(a.n, 0), 137)).a; - !e || Qfb(Qfb((b.a += ' "', b), e), '"'); - } - } else { - Qfb(Qfb((b.a += ' "', b), d), '"'); - } - c2 = (!a.b && (a.b = new y5d(z2, a, 4, 7)), !(a.b.i <= 1 && (!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c.i <= 1))); - c2 ? (b.a += " [", b) : (b.a += " ", b); - Qfb(b, Eb(new Gb(), new Fyd(a.b))); - c2 && (b.a += "]", b); - b.a += gne; - c2 && (b.a += "[", b); - Qfb(b, Eb(new Gb(), new Fyd(a.c))); - c2 && (b.a += "]", b); - return b.a; - } - function TQd(a, b) { - var c2, d, e, f2, g, h, i3; - if (a.a) { - h = a.a.ne(); - i3 = null; - if (h != null) { - b.a += "" + h; - } else { - g = a.a.Dj(); - if (g != null) { - f2 = hfb(g, wfb(91)); - if (f2 != -1) { - i3 = g.substr(f2); - b.a += "" + qfb(g == null ? Xhe : (uCb(g), g), 0, f2); - } else { - b.a += "" + g; - } - } - } - if (!!a.d && a.d.i != 0) { - e = true; - b.a += "<"; - for (d = new Fyd(a.d); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 87); - e ? e = false : (b.a += She, b); - TQd(c2, b); - } - b.a += ">"; - } - i3 != null && (b.a += "" + i3, b); - } else if (a.e) { - h = a.e.zb; - h != null && (b.a += "" + h, b); - } else { - b.a += "?"; - if (a.b) { - b.a += " super "; - TQd(a.b, b); - } else { - if (a.f) { - b.a += " extends "; - TQd(a.f, b); - } - } - } - } - function Z9b(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3; - v = a.c; - w2 = b.c; - c2 = Jkb(v.a, a, 0); - d = Jkb(w2.a, b, 0); - t4 = BD(W_b(a, (KAc(), HAc)).Kc().Pb(), 11); - C = BD(W_b(a, IAc).Kc().Pb(), 11); - u2 = BD(W_b(b, HAc).Kc().Pb(), 11); - D3 = BD(W_b(b, IAc).Kc().Pb(), 11); - r = k_b(t4.e); - A = k_b(C.g); - s = k_b(u2.e); - B = k_b(D3.g); - Z_b(a, d, w2); - for (g = s, k = 0, o2 = g.length; k < o2; ++k) { - e = g[k]; - RZb(e, t4); - } - for (h = B, l = 0, p = h.length; l < p; ++l) { - e = h[l]; - QZb(e, C); - } - Z_b(b, c2, v); - for (i3 = r, m = 0, q = i3.length; m < q; ++m) { - e = i3[m]; - RZb(e, u2); - } - for (f2 = A, j = 0, n = f2.length; j < n; ++j) { - e = f2[j]; - QZb(e, D3); - } - } - function $$b(a, b, c2, d) { - var e, f2, g, h, i3, j, k; - f2 = a_b(d); - h = Ccb(DD(vNb(d, (Nyc(), uxc)))); - if ((h || Ccb(DD(vNb(a, exc)))) && !fcd(BD(vNb(a, Vxc), 98))) { - e = Zcd(f2); - i3 = i_b(a, c2, c2 == (KAc(), IAc) ? e : Wcd(e)); - } else { - i3 = new H0b(); - F0b(i3, a); - if (b) { - k = i3.n; - k.a = b.a - a.n.a; - k.b = b.b - a.n.b; - Q6c(k, 0, 0, a.o.a, a.o.b); - G0b(i3, W$b(i3, f2)); - } else { - e = Zcd(f2); - G0b(i3, c2 == (KAc(), IAc) ? e : Wcd(e)); - } - g = BD(vNb(d, (wtc(), Ksc)), 21); - j = i3.j; - switch (f2.g) { - case 2: - case 1: - (j == (Ucd(), Acd) || j == Rcd) && g.Fc((Orc(), Lrc)); - break; - case 4: - case 3: - (j == (Ucd(), zcd) || j == Tcd) && g.Fc((Orc(), Lrc)); - } - } - return i3; - } - function pPc(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - if ($wnd.Math.abs(b.s - b.c) < qme || $wnd.Math.abs(c2.s - c2.c) < qme) { - return 0; - } - d = oPc(a, b.j, c2.e); - e = oPc(a, c2.j, b.e); - f2 = d == -1 || e == -1; - g = 0; - if (f2) { - if (d == -1) { - new DOc((HOc(), FOc), c2, b, 1); - ++g; - } - if (e == -1) { - new DOc((HOc(), FOc), b, c2, 1); - ++g; - } - } else { - h = vPc(b.j, c2.s, c2.c); - h += vPc(c2.e, b.s, b.c); - i3 = vPc(c2.j, b.s, b.c); - i3 += vPc(b.e, c2.s, c2.c); - j = d + 16 * h; - k = e + 16 * i3; - if (j < k) { - new DOc((HOc(), GOc), b, c2, k - j); - } else if (j > k) { - new DOc((HOc(), GOc), c2, b, j - k); - } else if (j > 0 && k > 0) { - new DOc((HOc(), GOc), b, c2, 0); - new DOc(GOc, c2, b, 0); - } - } - return g; - } - function TUb(a, b) { - var c2, d, e, f2, g, h; - for (g = new nib(new eib(a.f.b).a); g.b; ) { - f2 = lib(g); - e = BD(f2.cd(), 594); - if (b == 1) { - if (e.gf() != (ead(), dad) && e.gf() != _9c) { - continue; - } - } else { - if (e.gf() != (ead(), aad) && e.gf() != bad) { - continue; - } - } - d = BD(BD(f2.dd(), 46).b, 81); - h = BD(BD(f2.dd(), 46).a, 189); - c2 = h.c; - switch (e.gf().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 nJc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p; - h = KC(WD, oje, 25, b.b.c.length, 15, 1); - j = KC(NQ, Kie, 267, b.b.c.length, 0, 1); - i3 = KC(OQ, kne, 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 olb(k.e); g.a < g.c.c.length; ) { - e = BD(mlb(g), 10); - d = G1b(e.c); - ++h[d]; - o2 = Edb(ED(vNb(b, (Nyc(), lyc)))); - h[d] > 0 && !!i3[d] && (o2 = jBc(a.b, i3[d], e)); - p = $wnd.Math.max(p, e.c.c.b + o2); - } - for (f2 = new olb(k.e); f2.a < f2.c.c.length; ) { - e = BD(mlb(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[Jkb(c2.b.b, c2, 0)] = e.k; - i3[Jkb(c2.b.b, c2, 0)] = e; - } - } - } - function LXc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m; - for (d = new Sr(ur(_sd(b).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 79); - if (!JD(qud((!c2.b && (c2.b = new y5d(z2, c2, 4, 7)), c2.b), 0), 186)) { - i3 = atd(BD(qud((!c2.c && (c2.c = new y5d(z2, c2, 5, 8)), c2.c), 0), 82)); - if (!Pld(c2)) { - g = b.i + b.g / 2; - h = b.j + b.f / 2; - k = i3.i + i3.g / 2; - l = i3.j + i3.f / 2; - m = new d7c(); - m.a = k - g; - m.b = l - h; - f2 = new f7c(m.a, m.b); - l6c(f2, b.g, b.f); - m.a -= f2.a; - m.b -= f2.b; - g = k - m.a; - h = l - m.b; - j = new f7c(m.a, m.b); - l6c(j, i3.g, i3.f); - m.a -= j.a; - m.b -= j.b; - k = g + m.a; - l = h + m.b; - e = itd(c2, true, true); - omd(e, g); - pmd(e, h); - hmd(e, k); - imd(e, l); - LXc(a, i3); - } - } - } - } - function e0c(a) { - r4c(a, new E3c(P3c(M3c(O3c(N3c(new R3c(), Pre), "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 h0c()))); - p4c(a, Pre, Qre, Ksd(c0c)); - p4c(a, Pre, Rre, Ksd(__c)); - p4c(a, Pre, Sre, Ksd($_c)); - p4c(a, Pre, Tre, Ksd(Y_c)); - p4c(a, Pre, Ure, Ksd(Z_c)); - p4c(a, Pre, ame, X_c); - p4c(a, Pre, wme, 8); - p4c(a, Pre, Vre, Ksd(b0c)); - p4c(a, Pre, Wre, Ksd(T_c)); - p4c(a, Pre, Xre, Ksd(U_c)); - p4c(a, Pre, Zpe, (Bcb(), false)); - } - function JLc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - Odd(b, "Simple node placement", 1); - l = BD(vNb(a, (wtc(), otc)), 304); - h = 0; - for (f2 = new olb(a.b); f2.a < f2.c.c.length; ) { - d = BD(mlb(f2), 29); - g = d.c; - g.b = 0; - c2 = null; - for (j = new olb(d.a); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 10); - !!c2 && (g.b += hBc(i3, c2, l.c)); - g.b += i3.d.d + i3.o.b + i3.d.a; - c2 = i3; - } - h = $wnd.Math.max(h, g.b); - } - for (e = new olb(a.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 29); - g = d.c; - k = (h - g.b) / 2; - c2 = null; - for (j = new olb(d.a); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 10); - !!c2 && (k += hBc(i3, c2, l.c)); - k += i3.d.d; - i3.n.b = k; - k += i3.o.b + i3.d.a; - c2 = i3; - } - } - Qdd(b); - } - function s2d(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l; - if (d.gc() == 0) { - return false; - } - i3 = (Q6d(), BD(b, 66).Oj()); - g = i3 ? d : new zud(d.gc()); - if (T6d(a.e, b)) { - if (b.hi()) { - for (k = d.Kc(); k.Ob(); ) { - j = k.Pb(); - if (!F2d(a, b, j, JD(b, 99) && (BD(b, 18).Bb & Tje) != 0)) { - f2 = R6d(b, j); - g.Fc(f2); - } - } - } else if (!i3) { - for (k = d.Kc(); k.Ob(); ) { - j = k.Pb(); - f2 = R6d(b, j); - g.Fc(f2); - } - } - } else { - l = S6d(a.e.Tg(), b); - e = BD(a.g, 119); - for (h = 0; h < a.i; ++h) { - f2 = e[h]; - if (l.rl(f2.ak())) { - throw vbb(new Wdb(Hwe)); - } - } - if (d.gc() > 1) { - throw vbb(new Wdb(Hwe)); - } - if (!i3) { - f2 = R6d(b, d.Kc().Pb()); - g.Fc(f2); - } - } - return xtd(a, I2d(a, b, c2), g); - } - function Pmc(a, b) { - var c2, d, e, f2; - Jmc(b.b.j); - MAb(NAb(new YAb(null, new Kub(b.d, 16)), new $mc()), new anc()); - for (f2 = new olb(b.d); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 101); - switch (e.e.g) { - case 0: - c2 = BD(Ikb(e.j, 0), 113).d.j; - mjc(e, BD(Btb(RAb(BD(Qc(e.k, c2), 15).Oc(), Hmc)), 113)); - njc(e, BD(Btb(QAb(BD(Qc(e.k, c2), 15).Oc(), Hmc)), 113)); - break; - case 1: - d = Bkc(e); - mjc(e, BD(Btb(RAb(BD(Qc(e.k, d[0]), 15).Oc(), Hmc)), 113)); - njc(e, BD(Btb(QAb(BD(Qc(e.k, d[1]), 15).Oc(), Hmc)), 113)); - break; - case 2: - Rmc(a, e); - break; - case 3: - Qmc(e); - break; - case 4: - Omc(a, e); - } - Mmc(e); - } - a.a = null; - } - function $Mc(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - d = a.a.o == (eMc(), dMc) ? Pje : Qje; - h = _Mc(a, new ZMc(b, c2)); - if (!h.a && h.c) { - Dsb(a.d, h); - return d; - } else if (h.a) { - e = h.a.c; - i3 = h.a.d; - if (c2) { - j = a.a.c == (YLc(), XLc) ? i3 : e; - f2 = a.a.c == XLc ? e : i3; - g = a.a.g[f2.i.p]; - k = Edb(a.a.p[g.p]) + Edb(a.a.d[f2.i.p]) + f2.n.b + f2.a.b - Edb(a.a.d[j.i.p]) - j.n.b - j.a.b; - } else { - j = a.a.c == (YLc(), WLc) ? i3 : e; - f2 = a.a.c == WLc ? e : i3; - k = Edb(a.a.p[a.a.g[f2.i.p].p]) + Edb(a.a.d[f2.i.p]) + f2.n.b + f2.a.b - Edb(a.a.d[j.i.p]) - j.n.b - j.a.b; - } - a.a.n[a.a.g[e.i.p].p] = (Bcb(), true); - a.a.n[a.a.g[i3.i.p].p] = true; - return k; - } - return d; - } - function f3d(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - if (T6d(a.e, b)) { - i3 = (Q6d(), BD(b, 66).Oj() ? new R7d(b, a) : new f7d(b, a)); - D2d(i3.c, i3.b); - b7d(i3, BD(c2, 14)); - } else { - k = S6d(a.e.Tg(), b); - d = BD(a.g, 119); - for (g = 0; g < a.i; ++g) { - e = d[g]; - f2 = e.ak(); - if (k.rl(f2)) { - if (f2 == (m8d(), k8d) || f2 == h8d) { - j = m3d(a, b, c2); - h = g; - j ? Xxd(a, g) : ++g; - while (g < a.i) { - e = d[g]; - f2 = e.ak(); - f2 == k8d || f2 == h8d ? Xxd(a, g) : ++g; - } - j || BD(Gtd(a, h, R6d(b, c2)), 72); - } else - m3d(a, b, c2) ? Xxd(a, g) : BD(Gtd(a, g, (Q6d(), BD(b, 66).Oj() ? BD(c2, 72) : R6d(b, c2))), 72); - return; - } - } - m3d(a, b, c2) || wtd(a, (Q6d(), BD(b, 66).Oj() ? BD(c2, 72) : R6d(b, c2))); - } - } - function IMb(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - if (!pb(c2, a.b)) { - a.b = c2; - f2 = new LMb(); - g = BD(GAb(NAb(new YAb(null, new Kub(c2.f, 16)), f2), Ayb(new hzb(), new jzb(), new Gzb(), new Izb(), OC(GC(xL, 1), Kie, 132, 0, [(Fyb(), Eyb), Dyb]))), 21); - a.e = true; - a.f = true; - a.c = true; - a.d = true; - e = g.Hc((RMb(), OMb)); - d = g.Hc(PMb); - e && !d && (a.f = false); - !e && d && (a.d = false); - e = g.Hc(NMb); - d = g.Hc(QMb); - e && !d && (a.c = false); - !e && d && (a.e = false); - } - k = BD(a.a.Ce(b, c2), 46); - i3 = BD(k.a, 19).a; - j = BD(k.b, 19).a; - h = false; - i3 < 0 ? a.c || (h = true) : a.e || (h = true); - j < 0 ? a.d || (h = true) : a.f || (h = true); - return h ? IMb(a, k, c2) : k; - } - function oKb(a) { - var b, c2, d, e; - e = a.o; - $Jb(); - if (a.A.dc() || pb(a.A, ZJb)) { - b = e.b; - } else { - b = fIb(a.f); - if (a.A.Hc((tdd(), qdd)) && !a.B.Hc((Idd(), Edd))) { - b = $wnd.Math.max(b, fIb(BD(Mpb(a.p, (Ucd(), zcd)), 244))); - b = $wnd.Math.max(b, fIb(BD(Mpb(a.p, Tcd), 244))); - } - c2 = aKb(a); - !!c2 && (b = $wnd.Math.max(b, c2.b)); - if (a.A.Hc(rdd)) { - if (a.q == (dcd(), _bd) || a.q == $bd) { - b = $wnd.Math.max(b, _Gb(BD(Mpb(a.b, (Ucd(), zcd)), 124))); - b = $wnd.Math.max(b, _Gb(BD(Mpb(a.b, Tcd), 124))); - } - } - } - Ccb(DD(a.e.yf().We((Y9c(), $8c)))) ? e.b = $wnd.Math.max(e.b, b) : e.b = b; - d = a.f.i; - d.d = 0; - d.a = b; - iIb(a.f); - } - function $Ic(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p; - for (l = 0; l < b.length; l++) { - for (h = a.Kc(); h.Ob(); ) { - f2 = BD(h.Pb(), 225); - f2.Of(l, b); - } - for (m = 0; m < b[l].length; m++) { - for (i3 = a.Kc(); i3.Ob(); ) { - f2 = BD(i3.Pb(), 225); - f2.Pf(l, m, b); - } - p = b[l][m].j; - for (n = 0; n < p.c.length; n++) { - for (j = a.Kc(); j.Ob(); ) { - f2 = BD(j.Pb(), 225); - f2.Qf(l, m, n, b); - } - o2 = (tCb(n, p.c.length), BD(p.c[n], 11)); - c2 = 0; - for (e = new b1b(o2.b); llb(e.a) || llb(e.b); ) { - d = BD(llb(e.a) ? mlb(e.a) : mlb(e.b), 17); - for (k = a.Kc(); k.Ob(); ) { - f2 = BD(k.Pb(), 225); - f2.Nf(l, m, n, c2++, d, b); - } - } - } - } - } - for (g = a.Kc(); g.Ob(); ) { - f2 = BD(g.Pb(), 225); - f2.Mf(); - } - } - function J4b(a, b) { - var c2, d, e, f2, g, h, i3; - a.b = Edb(ED(vNb(b, (Nyc(), myc)))); - a.c = Edb(ED(vNb(b, pyc))); - a.d = BD(vNb(b, Xwc), 336); - a.a = BD(vNb(b, swc), 275); - H4b(b); - h = BD(GAb(JAb(JAb(LAb(LAb(new YAb(null, new Kub(b.b, 16)), new N4b()), new P4b()), new R4b()), new T4b()), Byb(new fzb(), new dzb(), new Ezb(), OC(GC(xL, 1), Kie, 132, 0, [(Fyb(), Dyb)]))), 15); - for (e = h.Kc(); e.Ob(); ) { - c2 = BD(e.Pb(), 17); - g = BD(vNb(c2, (wtc(), rtc)), 15); - g.Jc(new V4b(a)); - yNb(c2, rtc, null); - } - for (d = h.Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 17); - i3 = BD(vNb(c2, (wtc(), stc)), 17); - f2 = BD(vNb(c2, ptc), 15); - B4b(a, f2, i3); - yNb(c2, ptc, null); - } - } - function uZd(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 bKc(a) { - var b, c2, d, e, f2, g, h, i3, j; - if (a.k != (j0b(), h0b)) { - return false; - } - if (a.j.c.length <= 1) { - return false; - } - f2 = BD(vNb(a, (Nyc(), Vxc)), 98); - if (f2 == (dcd(), $bd)) { - return false; - } - e = (Izc(), (!a.q ? (mmb(), mmb(), kmb) : a.q)._b(Cxc) ? d = BD(vNb(a, Cxc), 197) : d = BD(vNb(Q_b(a), Dxc), 197), d); - if (e == Gzc) { - return false; - } - if (!(e == Fzc || e == Ezc)) { - g = Edb(ED(pBc(a, zyc))); - b = BD(vNb(a, yyc), 142); - !b && (b = new J_b(g, g, g, g)); - j = V_b(a, (Ucd(), Tcd)); - i3 = b.d + b.a + (j.gc() - 1) * g; - if (i3 > a.o.b) { - return false; - } - c2 = V_b(a, zcd); - h = b.d + b.a + (c2.gc() - 1) * g; - if (h > a.o.b) { - return false; - } - } - return true; - } - function thb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2; - g = a.e; - i3 = b.e; - if (g == 0) { - return b; - } - if (i3 == 0) { - return a; - } - f2 = a.d; - h = b.d; - if (f2 + h == 2) { - c2 = xbb(a.a[0], Yje); - d = xbb(b.a[0], Yje); - if (g == i3) { - k = wbb(c2, d); - o2 = Tbb(k); - n = Tbb(Pbb(k, 32)); - return n == 0 ? new Ugb(g, o2) : new Vgb(g, 2, OC(GC(WD, 1), oje, 25, 15, [o2, n])); - } - return ghb(g < 0 ? Qbb(d, c2) : Qbb(c2, d)); - } else if (g == i3) { - m = g; - l = f2 >= h ? uhb(a.a, f2, b.a, h) : uhb(b.a, h, a.a, f2); - } else { - e = f2 != h ? f2 > h ? 1 : -1 : whb(a.a, b.a, f2); - if (e == 0) { - return Hgb(), Ggb; - } - if (e == 1) { - m = g; - l = zhb(a.a, f2, b.a, h); - } else { - m = i3; - l = zhb(b.a, h, a.a, f2); - } - } - j = new Vgb(m, l.length, l); - Jgb(j); - return j; - } - function oZb(a, b, c2, d, e, f2, g) { - var h, i3, j, k, l, m, n; - l = Ccb(DD(vNb(b, (Nyc(), vxc)))); - m = null; - f2 == (KAc(), HAc) && d.c.i == c2 ? m = d.c : f2 == IAc && d.d.i == c2 && (m = d.d); - j = g; - if (!j || !l || !!m) { - k = (Ucd(), Scd); - m ? k = m.j : fcd(BD(vNb(c2, Vxc), 98)) && (k = f2 == HAc ? Tcd : zcd); - i3 = lZb(a, b, c2, f2, k, d); - h = kZb((Q_b(c2), d)); - if (f2 == HAc) { - QZb(h, BD(Ikb(i3.j, 0), 11)); - RZb(h, e); - } else { - QZb(h, e); - RZb(h, BD(Ikb(i3.j, 0), 11)); - } - j = new yZb(d, h, i3, BD(vNb(i3, (wtc(), $sc)), 11), f2, !m); - } else { - Ekb(j.e, d); - n = $wnd.Math.max(Edb(ED(vNb(j.d, Zwc))), Edb(ED(vNb(d, Zwc)))); - yNb(j.d, Zwc, n); - } - Rc(a.a, d, new BZb(j.d, b, f2)); - return j; - } - function V1d(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - k = null; - !!a.d && (k = BD(Phb(a.d, b), 138)); - if (!k) { - f2 = a.a.Mh(); - l = f2.i; - if (!a.d || Vhb(a.d) != l) { - i3 = new Lqb(); - !!a.d && Ld(i3, a.d); - j = i3.f.c + i3.g.c; - for (h = j; h < l; ++h) { - d = BD(qud(f2, h), 138); - e = o1d(a.e, d).ne(); - c2 = BD(e == null ? jrb(i3.f, null, d) : Drb(i3.g, e, d), 138); - !!c2 && c2 != d && (e == null ? jrb(i3.f, null, c2) : Drb(i3.g, e, c2)); - } - if (i3.f.c + i3.g.c != l) { - for (g = 0; g < j; ++g) { - d = BD(qud(f2, g), 138); - e = o1d(a.e, d).ne(); - c2 = BD(e == null ? jrb(i3.f, null, d) : Drb(i3.g, e, d), 138); - !!c2 && c2 != d && (e == null ? jrb(i3.f, null, c2) : Drb(i3.g, e, c2)); - } - } - a.d = i3; - } - k = BD(Phb(a.d, b), 138); - } - return k; - } - function lZb(a, b, c2, d, e, f2) { - var g, h, i3, j, k, l; - g = null; - j = d == (KAc(), HAc) ? f2.c : f2.d; - i3 = a_b(b); - if (j.i == c2) { - g = BD(Ohb(a.b, j), 10); - if (!g) { - g = Z$b(j, BD(vNb(c2, (Nyc(), Vxc)), 98), e, hZb(j), null, j.n, j.o, i3, b); - yNb(g, (wtc(), $sc), j); - Rhb(a.b, j, g); - } - } else { - g = Z$b((k = new zNb(), l = Edb(ED(vNb(b, (Nyc(), lyc)))) / 2, xNb(k, Uxc, l), k), BD(vNb(c2, Vxc), 98), e, d == HAc ? -1 : 1, null, new d7c(), new f7c(0, 0), i3, b); - h = mZb(g, c2, d); - yNb(g, (wtc(), $sc), h); - Rhb(a.b, h, g); - } - BD(vNb(b, (wtc(), Ksc)), 21).Fc((Orc(), Hrc)); - fcd(BD(vNb(b, (Nyc(), Vxc)), 98)) ? yNb(b, Vxc, (dcd(), acd)) : yNb(b, Vxc, (dcd(), bcd)); - return g; - } - function vNc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q; - Odd(b, "Orthogonal edge routing", 1); - j = Edb(ED(vNb(a, (Nyc(), wyc)))); - c2 = Edb(ED(vNb(a, myc))); - d = Edb(ED(vNb(a, pyc))); - m = new tPc(0, c2); - q = 0; - g = new Bib(a.b, 0); - h = null; - k = null; - i3 = null; - l = null; - do { - k = g.b < g.d.gc() ? (sCb(g.b < g.d.gc()), BD(g.d.Xb(g.c = g.b++), 29)) : null; - l = !k ? null : k.a; - if (h) { - h_b(h, q); - q += h.c.a; - } - p = !h ? q : q + d; - o2 = sPc(m, a, i3, l, p); - e = !h || Kq(i3, (FNc(), DNc)); - f2 = !k || Kq(l, (FNc(), DNc)); - 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; - i3 = l; - } while (k); - a.f.a = q; - Qdd(b); - } - function IEd() { - IEd = ccb; - var a; - HEd = new mFd(); - BEd = KC(ZI, nie, 2, 0, 6, 1); - uEd = Mbb(ZEd(33, 58), ZEd(1, 26)); - vEd = Mbb(ZEd(97, 122), ZEd(65, 90)); - wEd = ZEd(48, 57); - sEd = Mbb(uEd, 0); - tEd = Mbb(vEd, wEd); - xEd = Mbb(Mbb(0, ZEd(1, 6)), ZEd(33, 38)); - yEd = Mbb(Mbb(wEd, ZEd(65, 70)), ZEd(97, 102)); - EEd = Mbb(sEd, XEd("-_.!~*'()")); - FEd = Mbb(tEd, $Ed("-_.!~*'()")); - XEd(lve); - $Ed(lve); - Mbb(EEd, XEd(";:@&=+$,")); - Mbb(FEd, $Ed(";:@&=+$,")); - zEd = XEd(":/?#"); - AEd = $Ed(":/?#"); - CEd = XEd("/?#"); - DEd = $Ed("/?#"); - a = new Tqb(); - a.a.zc("jar", a); - a.a.zc("zip", a); - a.a.zc("archive", a); - GEd = (mmb(), new zob(a)); - } - function yUc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - yNb(b, (mTc(), cTc), 0); - i3 = BD(vNb(b, aTc), 86); - if (b.d.b == 0) { - if (i3) { - k = Edb(ED(vNb(i3, fTc))) + a.a + zUc(i3, b); - yNb(b, fTc, k); - } else { - yNb(b, fTc, 0); - } - } else { - for (d = (f2 = Jsb(new ZRc(b).a.d, 0), new aSc(f2)); Wsb(d.a); ) { - c2 = BD(Xsb(d.a), 188).c; - yUc(a, c2); - } - h = BD(pr((g = Jsb(new ZRc(b).a.d, 0), new aSc(g))), 86); - l = BD(or((e = Jsb(new ZRc(b).a.d, 0), new aSc(e))), 86); - j = (Edb(ED(vNb(l, fTc))) + Edb(ED(vNb(h, fTc)))) / 2; - if (i3) { - k = Edb(ED(vNb(i3, fTc))) + a.a + zUc(i3, b); - yNb(b, fTc, k); - yNb(b, cTc, Edb(ED(vNb(b, fTc))) - j); - xUc(a, b); - } else { - yNb(b, fTc, j); - } - } - } - function Dbc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2; - h = 0; - o2 = 0; - i3 = tlb(a.f, a.f.length); - f2 = a.d; - g = a.i; - d = a.a; - e = a.b; - do { - n = 0; - for (k = new olb(a.p); k.a < k.c.c.length; ) { - j = BD(mlb(k), 10); - m = Cbc(a, j); - c2 = true; - (a.q == (kAc(), dAc) || a.q == gAc) && (c2 = Ccb(DD(m.b))); - if (BD(m.a, 19).a < 0 && c2) { - ++n; - i3 = tlb(a.f, a.f.length); - a.d = a.d + BD(m.a, 19).a; - o2 += f2 - a.d; - f2 = a.d + BD(m.a, 19).a; - g = a.i; - d = Mu(a.a); - e = Mu(a.b); - } else { - a.f = tlb(i3, i3.length); - a.d = f2; - a.a = (Qb(d), d ? new Tkb(d) : Nu(new olb(d))); - a.b = (Qb(e), e ? new Tkb(e) : Nu(new olb(e))); - a.i = g; - } - } - ++h; - l = n != 0 && Ccb(DD(b.Kb(new vgd(meb(o2), meb(h))))); - } while (l); - } - function lYc(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C; - g = a.f; - m = b.f; - h = g == (k$c(), f$c) || g == h$c; - n = m == f$c || m == h$c; - i3 = g == g$c || g == i$c; - o2 = m == g$c || m == i$c; - j = g == g$c || g == f$c; - p = m == g$c || m == f$c; - if (h && n) { - return a.f == h$c ? a : b; - } else if (i3 && o2) { - return a.f == i$c ? a : b; - } else if (j && p) { - if (g == g$c) { - 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), t4 = s - $wnd.Math.min(c2.j, l.e), u2 = l.d + d.g - c2.i, u2 * t4); - 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 == g$c ? a : b : a.f == f$c ? a : b; - } - return a; - } - function wGb(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l; - k = a.e.a.c.length; - for (g = new olb(a.e.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 121); - f2.j = false; - } - a.i = KC(WD, oje, 25, k, 15, 1); - a.g = KC(WD, oje, 25, k, 15, 1); - a.n = new Rkb(); - e = 0; - l = new Rkb(); - for (i3 = new olb(a.e.a); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 121); - h.d = e++; - h.b.a.c.length == 0 && Ekb(a.n, h); - Gkb(l, h.g); - } - b = 0; - for (d = new olb(l); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 213); - c2.c = b++; - c2.f = false; - } - j = l.c.length; - if (a.b == null || a.b.length < j) { - a.b = KC(UD, Vje, 25, j, 15, 1); - a.c = KC(sbb, dle, 25, j, 16, 1); - } else { - Blb(a.c); + }, "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; + }(); + parser22.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser22; + parser22.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, id27, descr, type3) => { + log.info("addNode", level, id27, 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(id27, 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((id27, element3) => { + elements2[id27] = 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((id27) => elements2[id27], "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; } - a.d = l; - a.p = new Asb(Cv(a.d.c.length)); - a.j = 1; } - function sTb(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - if (b.e.c.length <= 1) { - return; - } - a.f = b; - a.d = BD(vNb(a.f, (bTb(), SSb)), 379); - a.g = BD(vNb(a.f, WSb), 19).a; - a.e = Edb(ED(vNb(a.f, TSb))); - a.c = Edb(ED(vNb(a.f, RSb))); - it(a.b); - for (e = new olb(a.f.c); e.a < e.c.c.length; ) { - d = BD(mlb(e), 282); - ht(a.b, d.c, d, null); - ht(a.b, d.d, d, null); - } - h = a.f.e.c.length; - a.a = IC(UD, [nie, Vje], [104, 25], 15, [h, h], 2); - for (j = new olb(a.f.e); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 144); - oTb(a, i3, a.a[i3.b]); - } - a.i = IC(UD, [nie, Vje], [104, 25], 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 Vfe(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 vbb(new hz("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 = KC(WD, oje, 25, b, 15, 1); - $fb(a.b, 0, d, 0, b); - a.b = d; - } - a.a = true; - } - function pZb(a, b) { - var c2, d, e, f2, g, h, i3; - for (g = Ec(a.a).Kc(); g.Ob(); ) { - f2 = BD(g.Pb(), 17); - if (f2.b.c.length > 0) { - d = new Tkb(BD(Qc(a.a, f2), 21)); - mmb(); - Okb(d, new EZb(b)); - e = new Bib(f2.b, 0); - while (e.b < e.d.gc()) { - c2 = (sCb(e.b < e.d.gc()), BD(e.d.Xb(e.c = e.b++), 70)); - h = -1; - switch (BD(vNb(c2, (Nyc(), Qwc)), 272).g) { - case 1: - h = d.c.length - 1; - break; - case 0: - h = nZb(d); - break; - case 2: - h = 0; - } - if (h != -1) { - i3 = (tCb(h, d.c.length), BD(d.c[h], 243)); - Ekb(i3.b.b, c2); - BD(vNb(Q_b(i3.b.c.i), (wtc(), Ksc)), 21).Fc((Orc(), Grc)); - BD(vNb(Q_b(i3.b.c.i), Ksc), 21).Fc(Erc); - uib(e); - yNb(c2, btc, f2); - } - } - } - QZb(f2, null); - RZb(f2, null); - } + } + if (able) { + ele._private[params.field] = params.value; + if (changed) { + changedEles.push(ele); } - function FLb(a, b) { - var c2, d, e, f2; - c2 = new KLb(); - d = BD(GAb(NAb(new YAb(null, new Kub(a.f, 16)), c2), Ayb(new hzb(), new jzb(), new Gzb(), new Izb(), OC(GC(xL, 1), Kie, 132, 0, [(Fyb(), Eyb), Dyb]))), 21); - e = d.gc(); - e = e == 2 ? 1 : 0; - e == 1 && Bbb(Hbb(BD(GAb(JAb(d.Lc(), new MLb()), Xyb(Aeb(0), new Czb())), 162).a, 2), 0) && (e = 0); - d = BD(GAb(NAb(new YAb(null, new Kub(b.f, 16)), c2), Ayb(new hzb(), new jzb(), new Gzb(), new Izb(), OC(GC(xL, 1), Kie, 132, 0, [Eyb, Dyb]))), 21); - f2 = d.gc(); - f2 = f2 == 2 ? 1 : 0; - f2 == 1 && Bbb(Hbb(BD(GAb(JAb(d.Lc(), new OLb()), Xyb(Aeb(0), new Czb())), 162).a, 2), 0) && (f2 = 0); - if (e < f2) { - return -1; - } - if (e == f2) { - return 0; - } - return 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 edgeData2 = edge._private.data; + var thisToOther = this.hasElementWithId(edgeData2.source) && otherNodes.hasElementWithId(edgeData2.target); + var otherToThis = otherNodes.hasElementWithId(edgeData2.source) && this.hasElementWithId(edgeData2.target); + var edgeConnectsThisAndOther = thisToOther || otherToThis; + if (!edgeConnectsThisAndOther) { + continue; + } + if (p3.thisIsSrc || p3.thisIsTgt) { + if (p3.thisIsSrc && !thisToOther) { + continue; } - function h6b(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n; - j = new Rkb(); - if (!wNb(a, (wtc(), Fsc))) { - return j; - } - for (d = BD(vNb(a, Fsc), 15).Kc(); d.Ob(); ) { - b = BD(d.Pb(), 10); - g6b(b, a); - j.c[j.c.length] = b; - } - for (f2 = new olb(a.b); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 29); - for (h = new olb(e.a); h.a < h.c.c.length; ) { - g = BD(mlb(h), 10); - if (g.k != (j0b(), e0b)) { - continue; - } - i3 = BD(vNb(g, Gsc), 10); - !!i3 && (k = new H0b(), F0b(k, g), l = BD(vNb(g, Hsc), 61), G0b(k, l), m = BD(Ikb(i3.j, 0), 11), n = new UZb(), QZb(n, k), RZb(n, m), void 0); - } - } - for (c2 = new olb(j); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 10); - $_b(b, BD(Ikb(a.b, a.b.c.length - 1), 29)); - } - return j; - } - function M1b(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m; - b = mpd(a); - f2 = Ccb(DD(hkd(b, (Nyc(), fxc)))); - k = 0; - e = 0; - for (j = new Fyd((!a.e && (a.e = new y5d(B2, a, 7, 4)), a.e)); j.e != j.i.gc(); ) { - i3 = BD(Dyd(j), 79); - h = Qld(i3); - g = h && f2 && Ccb(DD(hkd(i3, gxc))); - m = atd(BD(qud((!i3.c && (i3.c = new y5d(z2, i3, 5, 8)), i3.c), 0), 82)); - h && g ? ++e : h && !g ? ++k : Xod(m) == b || m == b ? ++e : ++k; - } - for (d = new Fyd((!a.d && (a.d = new y5d(B2, a, 8, 5)), a.d)); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 79); - h = Qld(c2); - g = h && f2 && Ccb(DD(hkd(c2, gxc))); - l = atd(BD(qud((!c2.b && (c2.b = new y5d(z2, c2, 4, 7)), c2.b), 0), 82)); - h && g ? ++k : h && !g ? ++e : Xod(l) == b || l == b ? ++k : ++e; - } - return k - e; - } - function ubc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n; - Odd(b, "Edge splitting", 1); - if (a.b.c.length <= 2) { - Qdd(b); - return; - } - f2 = new Bib(a.b, 0); - g = (sCb(f2.b < f2.d.gc()), BD(f2.d.Xb(f2.c = f2.b++), 29)); - while (f2.b < f2.d.gc()) { - e = g; - g = (sCb(f2.b < f2.d.gc()), BD(f2.d.Xb(f2.c = f2.b++), 29)); - for (i3 = new olb(e.a); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 10); - for (k = new olb(h.j); k.a < k.c.c.length; ) { - j = BD(mlb(k), 11); - for (d = new olb(j.g); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 17); - m = c2.d; - l = m.i.c; - l != e && l != g && zbc(c2, (n = new b0b(a), __b(n, (j0b(), g0b)), yNb(n, (wtc(), $sc), c2), yNb(n, (Nyc(), Vxc), (dcd(), $bd)), $_b(n, g), n)); - } - } - } - } - Qdd(b); - } - function MTb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n; - h = b.p != null && !b.b; - h || Odd(b, kme, 1); - c2 = BD(vNb(a, (wtc(), itc)), 15); - g = 1 / c2.gc(); - if (b.n) { - Sdd(b, "ELK Layered uses the following " + c2.gc() + " modules:"); - n = 0; - for (m = c2.Kc(); m.Ob(); ) { - k = BD(m.Pb(), 51); - d = (n < 10 ? "0" : "") + n++; - Sdd(b, " Slot " + d + ": " + hdb(rb(k))); - } - } - for (l = c2.Kc(); l.Ob(); ) { - k = BD(l.Pb(), 51); - k.pf(a, Udd(b, g)); - } - for (f2 = new olb(a.b); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 29); - Gkb(a.a, e.a); - e.a.c = KC(SI, Uhe, 1, 0, 5, 1); - } - for (j = new olb(a.a); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 10); - $_b(i3, null); - } - a.b.c = KC(SI, Uhe, 1, 0, 5, 1); - h || Qdd(b); - } - function kJc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A; - d = Edb(ED(vNb(b, (Nyc(), Bxc)))); - v = BD(vNb(b, Ayc), 19).a; - m = 4; - e = 3; - w2 = 20 / v; - n = false; - i3 = 0; - g = Ohe; - do { - f2 = i3 != 1; - l = i3 != 0; - A = 0; - for (q = a.a, s = 0, u2 = q.length; s < u2; ++s) { - o2 = q[s]; - o2.f = null; - lJc(a, o2, f2, l, d); - A += $wnd.Math.abs(o2.a); - } - do { - h = pJc(a, b); - } while (h); - for (p = a.a, r = 0, t4 = p.length; r < t4; ++r) { - o2 = p[r]; - c2 = xJc(o2).a; - if (c2 != 0) { - for (k = new olb(o2.e); k.a < k.c.c.length; ) { - j = BD(mlb(k), 10); - j.n.b += c2; - } - } - } - if (i3 == 0 || i3 == 1) { - --m; - if (m <= 0 && (A < g || -m > v)) { - i3 = 2; - g = Ohe; - } else if (i3 == 0) { - i3 = 1; - g = A; - } else { - i3 = 0; - g = A; - } - } else { - n = A >= g || g - A < w2; - g = A; - n && --e; - } - } while (!(n && e <= 0)); - } - function UCb(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2; - o2 = new Lqb(); - for (f2 = a.a.ec().Kc(); f2.Ob(); ) { - d = BD(f2.Pb(), 168); - Rhb(o2, d, c2.Je(d)); - } - g = (Qb(a), a ? new Tkb(a) : Nu(a.a.ec().Kc())); - Okb(g, new WCb(o2)); - h = Gx(g); - i3 = new hDb(b); - n = new Lqb(); - jrb(n.f, b, i3); - while (h.a.gc() != 0) { - j = null; - k = null; - l = null; - for (e = h.a.ec().Kc(); e.Ob(); ) { - d = BD(e.Pb(), 168); - if (Edb(ED(Wd(irb(o2.f, d)))) <= Pje) { - if (Mhb(n, d.a) && !Mhb(n, d.b)) { - k = d.b; - l = d.a; - j = d; - break; - } - if (Mhb(n, d.b)) { - if (!Mhb(n, d.a)) { - k = d.a; - l = d.b; - j = d; - break; - } - } - } - } - if (!j) { - break; - } - m = new hDb(k); - Ekb(BD(Wd(irb(n.f, l)), 221).a, m); - jrb(n.f, k, m); - h.a.Bc(j) != null; - } - return i3; - } - function UBc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n; - Odd(c2, "Depth-first cycle removal", 1); - l = b.a; - k = l.c.length; - a.c = new Rkb(); - a.d = KC(sbb, dle, 25, k, 16, 1); - a.a = KC(sbb, dle, 25, k, 16, 1); - a.b = new Rkb(); - g = 0; - for (j = new olb(l); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 10); - i3.p = g; - Qq(R_b(i3)) && Ekb(a.c, i3); - ++g; - } - for (n = new olb(a.c); n.a < n.c.c.length; ) { - m = BD(mlb(n), 10); - TBc(a, m); - } - for (f2 = 0; f2 < k; f2++) { - if (!a.d[f2]) { - h = (tCb(f2, l.c.length), BD(l.c[f2], 10)); - TBc(a, h); - } - } - for (e = new olb(a.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 17); - PZb(d, true); - yNb(b, (wtc(), Asc), (Bcb(), true)); - } - a.c = null; - a.d = null; - a.a = null; - a.b = null; - Qdd(c2); - } - function PSc(a, b) { - var c2, d, e, f2, g, h, i3; - a.a.c = KC(SI, Uhe, 1, 0, 5, 1); - for (d = Jsb(b.b, 0); d.b != d.d.c; ) { - c2 = BD(Xsb(d), 86); - if (c2.b.b == 0) { - yNb(c2, (mTc(), jTc), (Bcb(), true)); - Ekb(a.a, c2); - } - } - switch (a.a.c.length) { - case 0: - e = new XRc(0, b, "DUMMY_ROOT"); - yNb(e, (mTc(), jTc), (Bcb(), true)); - yNb(e, YSc, true); - Dsb(b.b, e); - break; - case 1: - break; - default: - f2 = new XRc(0, b, "SUPER_ROOT"); - for (h = new olb(a.a); h.a < h.c.c.length; ) { - g = BD(mlb(h), 86); - i3 = new QRc(f2, g); - yNb(i3, (mTc(), YSc), (Bcb(), true)); - Dsb(f2.a.a, i3); - Dsb(f2.d, i3); - Dsb(g.b, i3); - yNb(g, jTc, false); - } - yNb(f2, (mTc(), jTc), (Bcb(), true)); - yNb(f2, YSc, true); - Dsb(b.b, f2); - } - } - function z6c(a, b) { - i6c(); - 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); - Iy(); - My(Jqe); - if (($wnd.Math.abs(d) <= Jqe || d == 0 || isNaN(d) && isNaN(0) ? 0 : d < 0 ? -1 : d > 0 ? 1 : Ny(isNaN(d), isNaN(0))) >= 0 ^ (My(Jqe), ($wnd.Math.abs(h) <= Jqe || h == 0 || isNaN(h) && isNaN(0) ? 0 : h < 0 ? -1 : h > 0 ? 1 : Ny(isNaN(h), isNaN(0))) >= 0)) { - return $wnd.Math.max(h, d); - } - My(Jqe); - if (($wnd.Math.abs(d) <= Jqe || d == 0 || isNaN(d) && isNaN(0) ? 0 : d < 0 ? -1 : d > 0 ? 1 : Ny(isNaN(d), isNaN(0))) > 0) { - return $wnd.Math.sqrt(h * h + d * d); - } - return -$wnd.Math.sqrt(h * h + d * d); - } - function Kge(a, b) { - var c2, d, e, f2, g, h; - if (!b) - return; - !a.a && (a.a = new Wvb()); - if (a.e == 2) { - Tvb(a.a, b); - return; - } - if (b.e == 1) { - for (e = 0; e < b.em(); e++) - Kge(a, b.am(e)); - return; - } - h = a.a.a.c.length; - if (h == 0) { - Tvb(a.a, b); - return; - } - g = BD(Uvb(a.a, h - 1), 117); - if (!((g.e == 0 || g.e == 10) && (b.e == 0 || b.e == 10))) { - Tvb(a.a, b); - return; - } - f2 = b.e == 0 ? 2 : b.bm().length; - if (g.e == 0) { - c2 = new Ifb(); - d = g._l(); - d >= Tje ? Efb(c2, Tee(d)) : Afb(c2, d & aje); - g = new Hge(10, null, 0); - Vvb(a.a, g, h - 1); - } else { - c2 = (g.bm().length + f2, new Ifb()); - Efb(c2, g.bm()); - } - if (b.e == 0) { - d = b._l(); - d >= Tje ? Efb(c2, Tee(d)) : Afb(c2, d & aje); - } else { - Efb(c2, b.bm()); - } - BD(g, 521).b = c2.a; - } - function rgb2(a) { - var b, c2, d, e, f2; - if (a.g != null) { - return a.g; - } - if (a.a < 32) { - a.g = rhb(Cbb(a.f), QD(a.e)); - return a.g; - } - e = shb((!a.c && (a.c = fhb(a.f)), a.c), 0); - if (a.e == 0) { - return e; - } - b = (!a.c && (a.c = fhb(a.f)), a.c).e < 0 ? 2 : 1; - c2 = e.length; - d = -a.e + c2 - b; - f2 = new Ufb(); - f2.a += "" + e; - if (a.e > 0 && d >= -6) { - if (d >= 0) { - Tfb(f2, c2 - QD(a.e), String.fromCharCode(46)); - } else { - f2.a = qfb(f2.a, 0, b - 1) + "0." + pfb(f2.a, b - 1); - Tfb(f2, b + 1, zfb(egb, 0, -QD(d) - 1)); - } - } else { - if (c2 - b >= 1) { - Tfb(f2, b, String.fromCharCode(46)); - ++c2; - } - Tfb(f2, c2, String.fromCharCode(69)); - d > 0 && Tfb(f2, ++c2, String.fromCharCode(43)); - Tfb(f2, ++c2, "" + Ubb(Cbb(d))); - } - a.g = f2.a; - return a.g; + if (p3.thisIsTgt && !otherToThis) { + continue; } - function npc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q; - if (c2.dc()) { - return; - } - h = 0; - m = 0; - d = c2.Kc(); - o2 = BD(d.Pb(), 19).a; - while (h < b.f) { - if (h == o2) { - m = 0; - d.Ob() ? o2 = BD(d.Pb(), 19).a : o2 = b.f + 1; - } - if (h != m) { - q = BD(Ikb(a.b, h), 29); - n = BD(Ikb(a.b, m), 29); - p = Mu(q.a); - for (l = new olb(p); l.a < l.c.c.length; ) { - k = BD(mlb(l), 10); - Z_b(k, n.a.c.length, n); - if (m == 0) { - g = Mu(R_b(k)); - for (f2 = new olb(g); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 17); - PZb(e, true); - yNb(a, (wtc(), Asc), (Bcb(), true)); - Noc(a, e, 1); - } - } - } - } - ++m; - ++h; - } - i3 = new Bib(a.b, 0); - while (i3.b < i3.d.gc()) { - j = (sCb(i3.b < i3.d.gc()), BD(i3.d.Xb(i3.c = i3.b++), 29)); - j.a.c.length == 0 && uib(i3); - } - } - function xmc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4; - g = b.b; - k = g.o; - i3 = g.d; - d = Edb(ED(c_b(g, (Nyc(), lyc)))); - e = Edb(ED(c_b(g, nyc))); - j = Edb(ED(c_b(g, xyc))); - h = new L_b(); - v_b(h, i3.d, i3.c, i3.a, i3.b); - m = tmc(b, d, e, j); - for (r = new olb(b.d); r.a < r.c.c.length; ) { - q = BD(mlb(r), 101); - for (o2 = q.f.a.ec().Kc(); o2.Ob(); ) { - n = BD(o2.Pb(), 409); - f2 = n.a; - l = rmc(n); - c2 = (s = new s7c(), pmc(n, n.c, m, s), omc(n, l, m, s), pmc(n, n.d, m, s), s); - c2 = a.Uf(n, l, c2); - Osb(f2.a); - ye(f2.a, c2); - MAb(new YAb(null, new Kub(c2, 16)), new Bmc(k, h)); - } - p = q.i; - if (p) { - wmc(q, p, m, e); - t4 = new g7c(p.g); - ymc(k, h, t4); - P6c(t4, p.j); - ymc(k, h, t4); - } - } - v_b(i3, h.d, h.c, h.a, h.b); - } - function rgc(a, b, c2) { - var d, e, f2; - e = BD(vNb(b, (Nyc(), swc)), 275); - if (e == (yrc(), wrc)) { - return; - } - Odd(c2, "Horizontal Compaction", 1); - a.a = b; - f2 = new Ygc(); - d = new cEb((f2.d = b, f2.c = BD(vNb(f2.d, Swc), 218), Pgc(f2), Wgc(f2), Vgc(f2), f2.a)); - aEb(d, a.b); - switch (BD(vNb(b, rwc), 422).g) { - case 1: - $Db(d, new jfc(a.a)); - break; - default: - $Db(d, (ODb(), MDb)); - } - switch (e.g) { - case 1: - TDb(d); - break; - case 2: - TDb(SDb(d, (ead(), bad))); - break; - case 3: - TDb(_Db(SDb(TDb(d), (ead(), bad)), new Bgc())); - break; - case 4: - TDb(_Db(SDb(TDb(d), (ead(), bad)), new Dgc(f2))); - break; - case 5: - TDb(ZDb(d, pgc)); - } - SDb(d, (ead(), aad)); - d.e = true; - Mgc(f2); - Qdd(c2); - } - function mYc(a, b, c2, d, e, f2, g, h) { - var i3, j, k, l; - i3 = Ou(OC(GC(z_, 1), Uhe, 220, 0, [b, c2, d, e])); - l = null; - switch (a.b.g) { - case 1: - l = Ou(OC(GC(o_, 1), Uhe, 526, 0, [new uYc(), new oYc(), new qYc()])); - break; - case 0: - l = Ou(OC(GC(o_, 1), Uhe, 526, 0, [new qYc(), new oYc(), new uYc()])); - break; - case 2: - l = Ou(OC(GC(o_, 1), Uhe, 526, 0, [new oYc(), new uYc(), new qYc()])); - } - for (k = new olb(l); k.a < k.c.c.length; ) { - j = BD(mlb(k), 526); - i3.c.length > 1 && (i3 = j.mg(i3, a.a, h)); - } - if (i3.c.length == 1) { - return BD(Ikb(i3, i3.c.length - 1), 220); - } - if (i3.c.length == 2) { - return lYc((tCb(0, i3.c.length), BD(i3.c[0], 220)), (tCb(1, i3.c.length), BD(i3.c[1], 220)), g, f2); - } - return null; - } - function JNb(a) { - var b, c2, d, e, f2, g; - Hkb(a.a, new PNb()); - for (c2 = new olb(a.a); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 221); - d = c7c(R6c(BD(a.b, 65).c), BD(b.b, 65).c); - if (FNb) { - g = BD(a.b, 65).b; - f2 = BD(b.b, 65).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 && $6c(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 && $6c(d, $wnd.Math.max(g.d - (f2.d + f2.a), f2.d - (g.d + g.a))); - } - } else { - $6c(d, _Nb(BD(a.b, 65), BD(b.b, 65))); - } - e = $wnd.Math.sqrt(d.a * d.a + d.b * d.b); - e = LNb(GNb, b, e, d); - $6c(d, e); - $Nb(BD(b.b, 65), d); - Hkb(b.a, new RNb(d)); - BD(GNb.b, 65); - KNb(GNb, HNb, b); - } - } - function VJc(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2; - a.f = new KFb(); - j = 0; - e = 0; - for (g = new olb(a.e.b); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 29); - for (i3 = new olb(f2.a); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 10); - h.p = j++; - for (d = new Sr(ur(U_b(h).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 17); - c2.p = e++; - } - b = bKc(h); - for (m = new olb(h.j); m.a < m.c.c.length; ) { - l = BD(mlb(m), 11); - if (b) { - o2 = l.a.b; - if (o2 != $wnd.Math.floor(o2)) { - k = o2 - Sbb(Cbb($wnd.Math.round(o2))); - l.a.b -= k; - } - } - n = l.n.b + l.a.b; - if (n != $wnd.Math.floor(n)) { - k = n - Sbb(Cbb($wnd.Math.round(n))); - l.n.b -= k; - } - } - } - } - a.g = j; - a.b = e; - a.i = KC(xY, Uhe, 401, j, 0, 1); - a.c = KC(wY, Uhe, 649, e, 0, 1); - a.d.a.$b(); - } - function Uxd(a) { - var b, c2, d, e, f2, g, h, i3, j; - if (a.ej()) { - i3 = a.fj(); - if (a.i > 0) { - b = new _zd(a.i, a.g); - c2 = a.i; - f2 = c2 < 100 ? null : new Ixd(c2); - if (a.ij()) { - for (d = 0; d < a.i; ++d) { - g = a.g[d]; - f2 = a.kj(g, f2); - } - } - oud(a); - e = c2 == 1 ? a.Zi(4, qud(b, 0), null, 0, i3) : a.Zi(6, b, null, -1, i3); - if (a.bj()) { - for (d = new $yd(b); d.e != d.i.gc(); ) { - f2 = a.dj(Zyd(d), f2); - } - if (!f2) { - a.$i(e); - } else { - f2.Ei(e); - f2.Fi(); - } - } else { - if (!f2) { - a.$i(e); - } else { - f2.Ei(e); - f2.Fi(); - } - } - } else { - oud(a); - a.$i(a.Zi(6, (mmb(), jmb), null, -1, i3)); - } - } else if (a.bj()) { - if (a.i > 0) { - h = a.g; - j = a.i; - oud(a); - f2 = j < 100 ? null : new Ixd(j); - for (d = 0; d < j; ++d) { - g = h[d]; - f2 = a.dj(g, f2); - } - !!f2 && f2.Fi(); - } else { - oud(a); - } - } else { - oud(a); - } - } - function ZQc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m; - TQc(this); - c2 == (FQc(), DQc) ? Qqb(this.r, a) : Qqb(this.w, a); - k = Pje; - j = Qje; - for (g = b.a.ec().Kc(); g.Ob(); ) { - e = BD(g.Pb(), 46); - h = BD(e.a, 455); - d = BD(e.b, 17); - i3 = d.c; - i3 == a && (i3 = d.d); - h == DQc ? Qqb(this.r, i3) : Qqb(this.w, i3); - m = (Ucd(), Lcd).Hc(i3.j) ? Edb(ED(vNb(i3, (wtc(), qtc)))) : l7c(OC(GC(m1, 1), nie, 8, 0, [i3.i.n, i3.n, i3.a])).b; - k = $wnd.Math.min(k, m); - j = $wnd.Math.max(j, m); - } - l = (Ucd(), Lcd).Hc(a.j) ? Edb(ED(vNb(a, (wtc(), qtc)))) : l7c(OC(GC(m1, 1), nie, 8, 0, [a.i.n, a.n, a.a])).b; - XQc(this, l, k, j); - for (f2 = b.a.ec().Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 46); - UQc(this, BD(e.b, 17)); - } - this.o = false; - } - function gD(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, 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; - i3 = 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; - D3 = e * h; - F = f2 * h; - G = g * h; - if (i3 != 0) { - C += c2 * i3; - D3 += d * i3; - F += e * i3; - G += f2 * i3; - } - if (j != 0) { - D3 += c2 * j; - F += d * j; - G += e * j; - } - if (k != 0) { - F += c2 * k; - G += d * k; - } - l != 0 && (G += c2 * l); - n = B & Eje; - o2 = (C & 511) << 13; - m = n + o2; - q = B >> 22; - r = C >> 9; - s = (D3 & 262143) << 4; - t4 = (F & 31) << 17; - p = q + r + s + t4; - v = D3 >> 18; - w2 = F >> 5; - A = (G & 4095) << 8; - u2 = v + w2 + A; - p += m >> 22; - m &= Eje; - u2 += p >> 22; - p &= Eje; - u2 &= Fje; - return TC(m, p, u2); - } - function o7b(a) { - var b, c2, d, e, f2, g, h; - h = BD(Ikb(a.j, 0), 11); - if (h.g.c.length != 0 && h.e.c.length != 0) { - throw vbb(new Zdb("Interactive layout does not support NORTH/SOUTH ports with incoming _and_ outgoing edges.")); - } - if (h.g.c.length != 0) { - f2 = Pje; - for (c2 = new olb(h.g); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 17); - g = b.d.i; - d = BD(vNb(g, (Nyc(), txc)), 142); - f2 = $wnd.Math.min(f2, g.n.a - d.b); - } - return new cc(Qb(f2)); - } - if (h.e.c.length != 0) { - e = Qje; - for (c2 = new olb(h.e); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 17); - g = b.c.i; - d = BD(vNb(g, (Nyc(), txc)), 142); - e = $wnd.Math.max(e, g.n.a + g.o.a + d.c); - } - return new cc(Qb(e)); - } - return wb(), wb(), vb; - } - function ELd(a, b) { - var c2, d, e, f2, g, h, i3; - if (a.Fk()) { - if (a.i > 4) { - if (a.wj(b)) { - if (a.rk()) { - e = BD(b, 49); - d = e.Ug(); - i3 = d == a.e && (a.Dk() ? e.Og(e.Vg(), a.zk()) == a.Ak() : -1 - e.Vg() == a.aj()); - if (a.Ek() && !i3 && !d && !!e.Zg()) { - for (f2 = 0; f2 < a.i; ++f2) { - c2 = a.Gk(BD(a.g[f2], 56)); - if (PD(c2) === PD(b)) { - return true; - } - } - } - return i3; - } else if (a.Dk() && !a.Ck()) { - g = BD(b, 56).ah(zUd(BD(a.ak(), 18))); - if (PD(g) === PD(a.e)) { - return true; - } else if (g == null || !BD(g, 56).kh()) { - return false; - } - } - } else { - return false; - } - } - h = pud(a, b); - if (a.Ek() && !h) { - for (f2 = 0; f2 < a.i; ++f2) { - e = a.Gk(BD(a.g[f2], 56)); - if (PD(e) === PD(b)) { - return true; - } - } - } - return h; - } else { - return pud(a, b); - } - } - function mHc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m; - k = new Rkb(); - m = new Tqb(); - g = b.b; - for (e = 0; e < g.c.length; e++) { - j = (tCb(e, g.c.length), BD(g.c[e], 29)).a; - k.c = KC(SI, Uhe, 1, 0, 5, 1); - for (f2 = 0; f2 < j.c.length; f2++) { - h = a.a[e][f2]; - h.p = f2; - h.k == (j0b(), i0b) && (k.c[k.c.length] = h, true); - Nkb(BD(Ikb(b.b, e), 29).a, f2, h); - h.j.c = KC(SI, Uhe, 1, 0, 5, 1); - Gkb(h.j, BD(BD(Ikb(a.b, e), 15).Xb(f2), 14)); - ecd(BD(vNb(h, (Nyc(), Vxc)), 98)) || yNb(h, Vxc, (dcd(), Zbd)); - } - for (d = new olb(k); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 10); - l = kHc(c2); - m.a.zc(l, m); - m.a.zc(c2, m); - } - } - for (i3 = m.a.ec().Kc(); i3.Ob(); ) { - h = BD(i3.Pb(), 10); - mmb(); - Okb(h.j, (Occ(), Icc)); - h.i = true; - N_b(h); - } - } - function g6b(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - k = BD(vNb(a, (wtc(), Hsc)), 61); - d = BD(Ikb(a.j, 0), 11); - k == (Ucd(), Acd) ? G0b(d, Rcd) : k == Rcd && G0b(d, Acd); - if (BD(vNb(b, (Nyc(), Fxc)), 174).Hc((tdd(), sdd))) { - i3 = Edb(ED(vNb(a, tyc))); - j = Edb(ED(vNb(a, uyc))); - g = Edb(ED(vNb(a, ryc))); - h = BD(vNb(b, Yxc), 21); - if (h.Hc((rcd(), ncd))) { - c2 = j; - l = a.o.a / 2 - d.n.a; - for (f2 = new olb(d.f); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 70); - e.n.b = c2; - e.n.a = l - e.o.a / 2; - c2 += e.o.b + g; - } - } else if (h.Hc(pcd)) { - for (f2 = new olb(d.f); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 70); - e.n.a = i3 + a.o.a - d.n.a; - } - } - WGb(new YGb((a$b(), new l$b(b, false, false, new T$b()))), new x$b(null, a, false)); - } - } - function Ugc(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - if (b.c.length == 0) { - return; - } - mmb(); - Mlb(b.c, b.c.length, null); - e = new olb(b); - d = BD(mlb(e), 145); - while (e.a < e.c.c.length) { - c2 = BD(mlb(e), 145); - if (ADb(d.e.c, c2.e.c) && !(DDb(B6c(d.e).b, c2.e.d) || DDb(B6c(c2.e).b, d.e.d))) { - d = (Gkb(d.k, c2.k), Gkb(d.b, c2.b), Gkb(d.c, c2.c), ye(d.i, c2.i), Gkb(d.d, c2.d), Gkb(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), i3 = h - f2, j = $wnd.Math.max(d.e.d + d.e.a, c2.e.d + c2.e.a), k = j - g, G6c(d.e, f2, g, i3, k), hEb(d.f, c2.f), !d.a && (d.a = c2.a), Gkb(d.g, c2.g), Ekb(d.g, c2), d); - } else { - Xgc(a, d); - d = c2; - } - } - Xgc(a, d); - } - function e_b(a, b, c2, d) { - var e, f2, g, h, i3, j; - h = a.j; - if (h == (Ucd(), Scd) && b != (dcd(), bcd) && b != (dcd(), ccd)) { - h = W$b(a, c2); - G0b(a, h); - !(!a.q ? (mmb(), mmb(), kmb) : a.q)._b((Nyc(), Uxc)) && h != Scd && (a.n.a != 0 || a.n.b != 0) && yNb(a, Uxc, V$b(a, h)); - } - if (b == (dcd(), _bd)) { - 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); - } - yNb(a, (wtc(), htc), j); - } - i3 = a.o; - g = a.a; - if (d) { - g.a = d.a; - g.b = d.b; - a.d = true; - } else if (b != bcd && b != ccd && h != Scd) { - switch (h.g) { - case 1: - g.a = i3.a / 2; - break; - case 2: - g.a = i3.a; - g.b = i3.b / 2; - break; - case 3: - g.a = i3.a / 2; - g.b = i3.b; - break; - case 4: - g.b = i3.b / 2; - } - } else { - g.a = i3.a / 2; - g.b = i3.b / 2; - } - } - function vwd(a) { - var b, c2, d, e, f2, g, h, i3, j, k; - if (a.ej()) { - k = a.Vi(); - i3 = a.fj(); - if (k > 0) { - b = new Aud(a.Gi()); - c2 = k; - f2 = c2 < 100 ? null : new Ixd(c2); - Cvd(a, c2, b.g); - e = c2 == 1 ? a.Zi(4, qud(b, 0), null, 0, i3) : a.Zi(6, b, null, -1, i3); - if (a.bj()) { - for (d = new Fyd(b); d.e != d.i.gc(); ) { - f2 = a.dj(Dyd(d), f2); - } - if (!f2) { - a.$i(e); - } else { - f2.Ei(e); - f2.Fi(); - } - } else { - if (!f2) { - a.$i(e); - } else { - f2.Ei(e); - f2.Fi(); - } - } - } else { - Cvd(a, a.Vi(), a.Wi()); - a.$i(a.Zi(6, (mmb(), jmb), null, -1, i3)); - } - } else if (a.bj()) { - k = a.Vi(); - if (k > 0) { - h = a.Wi(); - j = k; - Cvd(a, k, h); - f2 = j < 100 ? null : new Ixd(j); - for (d = 0; d < j; ++d) { - g = h[d]; - f2 = a.dj(g, f2); - } - !!f2 && f2.Fi(); - } else { - Cvd(a, a.Vi(), a.Wi()); - } + } + 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 { - Cvd(a, a.Vi(), a.Wi()); + 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 LEc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n; - for (h = new olb(b); h.a < h.c.c.length; ) { - f2 = BD(mlb(h), 233); - f2.e = null; - f2.c = 0; - } - i3 = null; - for (g = new olb(b); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 233); - l = f2.d[0]; - if (c2 && l.k != (j0b(), h0b)) { - continue; - } - for (n = BD(vNb(l, (wtc(), Qsc)), 15).Kc(); n.Ob(); ) { - m = BD(n.Pb(), 10); - if (!c2 || m.k == (j0b(), h0b)) { - (!f2.e && (f2.e = new Rkb()), f2.e).Fc(a.b[m.c.p][m.p]); - ++a.b[m.c.p][m.p].c; - } - } - if (!c2 && l.k == (j0b(), h0b)) { - if (i3) { - for (k = BD(Qc(a.d, i3), 21).Kc(); k.Ob(); ) { - j = BD(k.Pb(), 10); - for (e = BD(Qc(a.d, l), 21).Kc(); e.Ob(); ) { - d = BD(e.Pb(), 10); - YEc(a.b[j.c.p][j.p]).Fc(a.b[d.c.p][d.p]); - ++a.b[d.c.p][d.p].c; - } - } - } - i3 = l; - } - } + } + } + 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 OHc(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - c2 = 0; - k = new Rkb(); - for (h = new olb(b); h.a < h.c.c.length; ) { - g = BD(mlb(h), 11); - AHc(a.b, a.d[g.p]); - k.c = KC(SI, Uhe, 1, 0, 5, 1); - switch (g.i.k.g) { - case 0: - d = BD(vNb(g, (wtc(), gtc)), 10); - Hkb(d.j, new xIc(k)); - break; - case 1: - Ctb(KAb(JAb(new YAb(null, new Kub(g.i.j, 16)), new zIc(g))), new CIc(k)); - break; - case 3: - e = BD(vNb(g, (wtc(), $sc)), 11); - Ekb(k, new vgd(e, meb(g.e.c.length + g.g.c.length))); - } - for (j = new olb(k); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 46); - f2 = aIc(a, BD(i3.a, 11)); - if (f2 > a.d[g.p]) { - c2 += zHc(a.b, f2) * BD(i3.b, 19).a; - Wjb(a.a, meb(f2)); - } - } - while (!akb(a.a)) { - xHc(a.b, BD(fkb(a.a), 19).a); - } - } - return c2; - } - function eed(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2, p, q; - l = new g7c(BD(hkd(a, (X7c(), R7c)), 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 = ED(hkd(a, L7c)); - (e == null || (uCb(e), e) <= 0) && (e = 1.3); - h = new Rkb(); - for (o2 = new Fyd((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a)); o2.e != o2.i.gc(); ) { - n = BD(Dyd(o2), 33); - g = new xed(n); - h.c[h.c.length] = g; - } - m = BD(hkd(a, M7c), 311); - switch (m.g) { - case 3: - q = bed(h, b, l.a, l.b, (j = d, uCb(e), j)); - break; - case 1: - q = aed(h, b, l.a, l.b, (k = d, uCb(e), k)); - break; - default: - q = ced(h, b, l.a, l.b, (i3 = d, uCb(e), i3)); - } - f2 = new wed(q); - p = fed(f2, b, c2, l.a, l.b, d, (uCb(e), e)); - Afd(a, p.a, p.b, false, true); - } - function vkc(a, b) { - var c2, d, e, f2; - c2 = b.b; - f2 = new Tkb(c2.j); - e = 0; - d = c2.j; - d.c = KC(SI, Uhe, 1, 0, 5, 1); - hkc(BD(Si(a.b, (Ucd(), Acd), (Fkc(), Ekc)), 15), c2); - e = ikc(f2, e, new blc(), d); - hkc(BD(Si(a.b, Acd, Dkc), 15), c2); - e = ikc(f2, e, new dlc(), d); - hkc(BD(Si(a.b, Acd, Ckc), 15), c2); - hkc(BD(Si(a.b, zcd, Ekc), 15), c2); - hkc(BD(Si(a.b, zcd, Dkc), 15), c2); - e = ikc(f2, e, new flc(), d); - hkc(BD(Si(a.b, zcd, Ckc), 15), c2); - hkc(BD(Si(a.b, Rcd, Ekc), 15), c2); - e = ikc(f2, e, new hlc(), d); - hkc(BD(Si(a.b, Rcd, Dkc), 15), c2); - e = ikc(f2, e, new jlc(), d); - hkc(BD(Si(a.b, Rcd, Ckc), 15), c2); - hkc(BD(Si(a.b, Tcd, Ekc), 15), c2); - e = ikc(f2, e, new Pkc(), d); - hkc(BD(Si(a.b, Tcd, Dkc), 15), c2); - hkc(BD(Si(a.b, Tcd, Ckc), 15), c2); - } - function nbc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p; - Odd(b, "Layer size calculation", 1); - k = Pje; - j = Qje; - e = false; - for (h = new olb(a.b); h.a < h.c.c.length; ) { - g = BD(mlb(h), 29); - i3 = g.c; - i3.a = 0; - i3.b = 0; - if (g.a.c.length == 0) { - continue; - } - e = true; - for (m = new olb(g.a); m.a < m.c.c.length; ) { - l = BD(mlb(m), 10); - o2 = l.o; - n = l.d; - i3.a = $wnd.Math.max(i3.a, o2.a + n.b + n.c); - } - d = BD(Ikb(g.a, 0), 10); - p = d.n.b - d.d.d; - d.k == (j0b(), e0b) && (p -= BD(vNb(a, (Nyc(), yyc)), 142).d); - f2 = BD(Ikb(g.a, g.a.c.length - 1), 10); - c2 = f2.n.b + f2.o.b + f2.d.a; - f2.k == e0b && (c2 += BD(vNb(a, (Nyc(), yyc)), 142).a); - i3.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; - Qdd(b); - } - function h_b(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r; - f2 = 0; - g = 0; - for (j = new olb(a.a); j.a < j.c.c.length; ) { - h = BD(mlb(j), 10); - f2 = $wnd.Math.max(f2, h.d.b); - g = $wnd.Math.max(g, h.d.c); - } - for (i3 = new olb(a.a); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 10); - c2 = BD(vNb(h, (Nyc(), mwc)), 248); - 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 olb(h.j); n.a < n.c.c.length; ) { - m = BD(mlb(n), 11); - 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 ced(a, b, c2, d, e) { - var f2, g, h, i3, j, k, l, m, n, o2, p, q; - h = KC(UD, Vje, 25, a.c.length, 15, 1); - m = new gub(new Ned()); - _tb(m, a); - j = 0; - p = new Rkb(); - while (m.b.c.length != 0) { - g = BD(m.b.c.length == 0 ? null : Ikb(m.b, 0), 157); - if (j > 1 && red(g) * qed(g) / 2 > h[0]) { - f2 = 0; - while (f2 < p.c.length - 1 && red(g) * qed(g) / 2 > h[f2]) { - ++f2; - } - o2 = new Jib(p, 0, f2 + 1); - l = new wed(o2); - k = red(g) / qed(g); - i3 = fed(l, b, new p0b(), c2, d, e, k); - P6c(X6c(l.e), i3); - zCb(cub(m, l)); - n = new Jib(p, f2 + 1, p.c.length); - _tb(m, n); - p.c = KC(SI, Uhe, 1, 0, 5, 1); - j = 0; - Dlb(h, h.length, 0); - } else { - q = m.b.c.length == 0 ? null : Ikb(m.b, 0); - q != null && fub(m, 0); - j > 0 && (h[j] = h[j - 1]); - h[j] += red(g) * qed(g); - ++j; - p.c[p.c.length] = g; - } - } - return p; - } - function Wac(a) { - var b, c2, d, e, f2; - d = BD(vNb(a, (Nyc(), mxc)), 163); - if (d == (Ctc(), ytc)) { - for (c2 = new Sr(ur(R_b(a).a.Kc(), new Sq())); Qr(c2); ) { - b = BD(Rr(c2), 17); - if (!Yac(b)) { - throw vbb(new y2c(Fne + P_b(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 == Atc) { - for (f2 = new Sr(ur(U_b(a).a.Kc(), new Sq())); Qr(f2); ) { - e = BD(Rr(f2), 17); - if (!Yac(e)) { - throw vbb(new y2c(Fne + P_b(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 C9b(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2; - Odd(b, "Label dummy removal", 1); - d = Edb(ED(vNb(a, (Nyc(), nyc)))); - e = Edb(ED(vNb(a, ryc))); - j = BD(vNb(a, Lwc), 103); - for (i3 = new olb(a.b); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 29); - l = new Bib(h.a, 0); - while (l.b < l.d.gc()) { - k = (sCb(l.b < l.d.gc()), BD(l.d.Xb(l.c = l.b++), 10)); - if (k.k == (j0b(), f0b)) { - m = BD(vNb(k, (wtc(), $sc)), 17); - o2 = Edb(ED(vNb(m, Zwc))); - g = PD(vNb(k, Ssc)) === PD((rbd(), obd)); - c2 = new g7c(k.n); - g && (c2.b += o2 + d); - f2 = new f7c(k.o.a, k.o.b - o2 - d); - n = BD(vNb(k, ktc), 15); - j == (ead(), dad) || j == _9c ? B9b(n, c2, e, f2, g, j) : A9b(n, c2, e, f2); - Gkb(m.b, n); - sbc(k, PD(vNb(a, Swc)) === PD((Aad(), xad))); - uib(l); - } - } - } - Qdd(b); - } - function tZb(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v; - i3 = new Rkb(); - for (f2 = new olb(b.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 10); - for (h = new olb(e.j); h.a < h.c.c.length; ) { - g = BD(mlb(h), 11); - k = null; - for (t4 = k_b(g.g), u2 = 0, v = t4.length; u2 < v; ++u2) { - s = t4[u2]; - if (!f_b(s.d.i, c2)) { - r = oZb(a, b, c2, s, s.c, (KAc(), IAc), k); - r != k && (i3.c[i3.c.length] = r, true); - r.c && (k = r); - } - } - j = null; - for (o2 = k_b(g.e), p = 0, q = o2.length; p < q; ++p) { - n = o2[p]; - if (!f_b(n.c.i, c2)) { - r = oZb(a, b, c2, n, n.d, (KAc(), HAc), j); - r != j && (i3.c[i3.c.length] = r, true); - r.c && (j = r); - } - } - } - } - for (m = new olb(i3); m.a < m.c.c.length; ) { - l = BD(mlb(m), 441); - Jkb(b.a, l.a, 0) != -1 || Ekb(b.a, l.a); - l.c && (d.c[d.c.length] = l, true); - } - } - function jCc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q; - Odd(c2, "Interactive cycle breaking", 1); - l = new Rkb(); - for (n = new olb(b.a); n.a < n.c.c.length; ) { - m = BD(mlb(n), 10); - m.p = 1; - o2 = T_b(m).a; - for (k = W_b(m, (KAc(), IAc)).Kc(); k.Ob(); ) { - j = BD(k.Pb(), 11); - for (f2 = new olb(j.g); f2.a < f2.c.c.length; ) { - d = BD(mlb(f2), 17); - p = d.d.i; - if (p != m) { - q = T_b(p).a; - q < o2 && (l.c[l.c.length] = d, true); - } - } - } - } - for (g = new olb(l); g.a < g.c.c.length; ) { - d = BD(mlb(g), 17); - PZb(d, true); - } - l.c = KC(SI, Uhe, 1, 0, 5, 1); - for (i3 = new olb(b.a); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 10); - h.p > 0 && iCc(a, h, l); - } - for (e = new olb(l); e.a < e.c.c.length; ) { - d = BD(mlb(e), 17); - PZb(d, true); - } - l.c = KC(SI, Uhe, 1, 0, 5, 1); - Qdd(c2); + var args = []; + for (var i2 = 0; i2 < arguments.length; i2++) { + args.push(arguments[i2]); } - function _z(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - j = ""; - if (b.length == 0) { - return a.de(Zie, Xie, -1, -1); - } - k = ufb(b); - dfb(k.substr(0, 3), "at ") && (k = k.substr(3)); - k = k.replace(/\[.*?\]/g, ""); - g = k.indexOf("("); - if (g == -1) { - g = k.indexOf("@"); - if (g == -1) { - j = k; - k = ""; - } else { - j = ufb(k.substr(g + 1)); - k = ufb(k.substr(0, g)); - } - } else { - c2 = k.indexOf(")", g); - j = k.substr(g + 1, c2 - (g + 1)); - k = ufb(k.substr(0, g)); - } - g = hfb(k, wfb(46)); - g != -1 && (k = k.substr(g + 1)); - (k.length == 0 || dfb(k, "Anonymous function")) && (k = Xie); - h = kfb(j, wfb(58)); - e = lfb(j, wfb(58), h - 1); - i3 = -1; - d = -1; - f2 = Zie; - if (h != -1 && e != -1) { - f2 = j.substr(0, e); - i3 = Vz(j.substr(e + 1, h - (e + 1))); - d = Vz(j.substr(h + 1)); - } - return a.de(f2, k, i3, d); - } - function UC(a, b, c2) { - var d, e, f2, g, h, i3; - if (b.l == 0 && b.m == 0 && b.h == 0) { - throw vbb(new ocb("divide by zero")); - } - if (a.l == 0 && a.m == 0 && a.h == 0) { - c2 && (QC = TC(0, 0, 0)); - return TC(0, 0, 0); - } - if (b.h == Gje && b.m == 0 && b.l == 0) { - return VC(a, c2); - } - i3 = false; - if (b.h >> 19 != 0) { - b = hD(b); - i3 = !i3; - } - g = _C(b); - f2 = false; - e = false; - d = false; - if (a.h == Gje && a.m == 0 && a.l == 0) { - e = true; - f2 = true; - if (g == -1) { - a = SC((wD(), sD)); - d = true; - i3 = !i3; - } else { - h = lD(a, g); - i3 && ZC(h); - c2 && (QC = TC(0, 0, 0)); - return h; - } - } else if (a.h >> 19 != 0) { - f2 = true; - a = hD(a); - d = true; - i3 = !i3; - } - if (g != -1) { - return WC(a, g, i3, f2, c2); - } - if (eD(a, b) < 0) { - c2 && (f2 ? QC = hD(a) : QC = TC(a.l, a.m, a.h)); - return TC(0, 0, 0); - } - return XC(d ? a : TC(a.l, a.m, a.h), b, i3, f2, e, c2); - } - function F2c(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2; - if (a.e && a.c.c < a.f) { - throw vbb(new Zdb("Expected " + a.f + " phases to be configured; only found " + a.c.c)); - } - k = BD(gdb(a.g), 9); - n = Pu(a.f); - for (f2 = k, h = 0, j = f2.length; h < j; ++h) { - d = f2[h]; - l = BD(B2c(a, d.g), 246); - l ? Ekb(n, BD(I2c(a, l), 123)) : (n.c[n.c.length] = null, true); - } - o2 = new j3c(); - MAb(JAb(NAb(JAb(new YAb(null, new Kub(n, 16)), new O2c()), new Q2c(b)), new S2c()), new U2c(o2)); - d3c(o2, a.a); - c2 = new Rkb(); - for (e = k, g = 0, i3 = e.length; g < i3; ++g) { - d = e[g]; - Gkb(c2, J2c(a, Dx(BD(B2c(o2, d.g), 20)))); - m = BD(Ikb(n, d.g), 123); - !!m && (c2.c[c2.c.length] = m, true); - } - Gkb(c2, J2c(a, Dx(BD(B2c(o2, k[k.length - 1].g + 1), 20)))); - return c2; - } - function qCc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q; - Odd(c2, "Model order cycle breaking", 1); - a.a = 0; - a.b = 0; - n = new Rkb(); - k = b.a.c.length; - for (j = new olb(b.a); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 10); - wNb(i3, (wtc(), Zsc)) && (k = $wnd.Math.max(k, BD(vNb(i3, Zsc), 19).a + 1)); - } - for (p = new olb(b.a); p.a < p.c.c.length; ) { - o2 = BD(mlb(p), 10); - g = pCc(a, o2, k); - for (m = W_b(o2, (KAc(), IAc)).Kc(); m.Ob(); ) { - l = BD(m.Pb(), 11); - for (f2 = new olb(l.g); f2.a < f2.c.c.length; ) { - d = BD(mlb(f2), 17); - q = d.d.i; - h = pCc(a, q, k); - h < g && (n.c[n.c.length] = d, true); - } - } - } - for (e = new olb(n); e.a < e.c.c.length; ) { - d = BD(mlb(e), 17); - PZb(d, true); - yNb(b, (wtc(), Asc), (Bcb(), true)); - } - n.c = KC(SI, Uhe, 1, 0, 5, 1); - Qdd(c2); - } - function kQc(a, b) { - var c2, d, e, f2, g, h, i3; - if (a.g > b.f || b.g > a.f) { - return; - } - c2 = 0; - d = 0; - for (g = a.w.a.ec().Kc(); g.Ob(); ) { - e = BD(g.Pb(), 11); - aRc(l7c(OC(GC(m1, 1), nie, 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 = BD(h.Pb(), 11); - aRc(l7c(OC(GC(m1, 1), nie, 8, 0, [e.i.n, e.n, e.a])).b, b.g, b.f) && --c2; - } - for (i3 = b.w.a.ec().Kc(); i3.Ob(); ) { - e = BD(i3.Pb(), 11); - aRc(l7c(OC(GC(m1, 1), nie, 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 = BD(f2.Pb(), 11); - aRc(l7c(OC(GC(m1, 1), nie, 8, 0, [e.i.n, e.n, e.a])).b, a.g, a.f) && --d; - } - if (c2 < d) { - new BQc(a, b, d - c2); - } else if (d < c2) { - new BQc(b, a, c2 - d); - } else { - new BQc(b, a, 0); - new BQc(a, b, 0); - } - } - function JPb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s; - j = b.c; - e = IOb(a.e); - l = Y6c(b7c(R6c(HOb(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 (i3 = new olb(j); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 395); - m = h.b; - n = c2 + m.a; - q = d + m.b; - o2 = QD(n / a.a); - r = QD(q / a.b); - f2 = h.a; - switch (f2.g) { - case 0: - k = (RMb(), OMb); - break; - case 1: - k = (RMb(), NMb); - break; - case 2: - k = (RMb(), PMb); - break; - default: - k = (RMb(), QMb); - } - if (f2.a) { - s = QD((q + h.c) / a.b); - Ekb(a.f, new uOb(k, meb(r), meb(s))); - f2 == (ROb(), QOb) ? nNb(a, 0, r, o2, s) : nNb(a, o2, r, a.d - 1, s); - } else { - p = QD((n + h.c) / a.a); - Ekb(a.f, new uOb(k, meb(o2), meb(p))); - f2 == (ROb(), OOb) ? nNb(a, o2, 0, p, r) : nNb(a, o2, r, p, a.c - 1); - } - } - } - function coc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2; - m = new Rkb(); - e = new Rkb(); - p = null; - for (h = b.Kc(); h.Ob(); ) { - g = BD(h.Pb(), 19); - f2 = new qoc(g.a); - e.c[e.c.length] = f2; - if (p) { - f2.d = p; - p.e = f2; - } - p = f2; - } - t4 = boc(a); - for (k = 0; k < e.c.length; ++k) { - n = null; - q = poc((tCb(0, e.c.length), BD(e.c[0], 652))); - c2 = null; - d = Pje; - 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; - i3 = o2; - } else { - j = q; - i3 = r; - } - s = (u2 = Edb(ED(vNb(a, (Nyc(), Hyc)))), t4[l] + $wnd.Math.pow(i3, u2)); - if (s < d) { - d = s; - c2 = j; - c2.c = l; - } - if (!!q && l == q.b) { - n = q; - q = koc(q); - } - } - if (c2) { - Ekb(m, meb(c2.c)); - c2.a = true; - loc(c2); - } - } - mmb(); - Mlb(m.c, m.c.length, null); - return m; - } - function qNd(a) { - var b, c2, d, e, f2, g, h, i3, j, k; - b = new zNd(); - c2 = new zNd(); - j = dfb(Qve, (e = Dmd(a.b, Rve), !e ? null : GD(AAd((!e.b && (e.b = new sId((jGd(), fGd), x6, e)), e.b), Sve)))); - for (i3 = 0; i3 < a.i; ++i3) { - h = BD(a.g[i3], 170); - if (JD(h, 99)) { - g = BD(h, 18); - (g.Bb & ote) != 0 ? ((g.Bb & oie) == 0 || !j && (f2 = Dmd(g, Rve), (!f2 ? null : GD(AAd((!f2.b && (f2.b = new sId((jGd(), fGd), x6, f2)), f2.b), eue))) == null)) && wtd(b, g) : (k = zUd(g), !!k && (k.Bb & ote) != 0 || ((g.Bb & oie) == 0 || !j && (d = Dmd(g, Rve), (!d ? null : GD(AAd((!d.b && (d.b = new sId((jGd(), fGd), x6, d)), d.b), eue))) == null)) && wtd(c2, g)); - } else { - Q6d(); - if (BD(h, 66).Oj()) { - if (!h.Jj()) { - wtd(b, h); - wtd(c2, h); - } - } - } - } - vud(b); - vud(c2); - a.a = BD(b.g, 247); - BD(c2.g, 247); - } - function LTb(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, p, q, r; - j = ITb(b); - q = BD(vNb(b, (Nyc(), Iwc)), 314); - q != (Rpc(), Ppc) && reb(j, new STb()); - r = BD(vNb(b, Cwc), 292); - reb(j, new UTb(r)); - p = 0; - k = new Rkb(); - for (f2 = new xkb(j); f2.a != f2.b; ) { - e = BD(vkb(f2), 37); - aUb(a.c, e); - m = BD(vNb(e, (wtc(), itc)), 15); - p += m.gc(); - d = m.Kc(); - Ekb(k, new vgd(e, d)); - } - Odd(c2, "Recursive hierarchical layout", p); - n = BD(BD(Ikb(k, k.c.length - 1), 46).b, 47); - while (n.Ob()) { - for (i3 = new olb(k); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 46); - m = BD(h.b, 47); - g = BD(h.a, 37); - while (m.Ob()) { - l = BD(m.Pb(), 51); - if (JD(l, 507)) { - if (!g.e) { - l.pf(g, Udd(c2, 1)); - break; - } else { - break; - } - } else { - l.pf(g, Udd(c2, 1)); - } - } - } - } - Qdd(c2); + 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 rid(b, c2) { - var d, e, f2, g, h, i3, j, k, l, m; - j = c2.length - 1; - i3 = (BCb(j, c2.length), c2.charCodeAt(j)); - if (i3 == 93) { - h = hfb(c2, wfb(91)); - if (h >= 0) { - f2 = wid(b, c2.substr(1, h - 1)); - l = c2.substr(h + 1, j - (h + 1)); - return pid(b, l, f2); - } - } else { - d = -1; - Vcb == null && (Vcb = new RegExp("\\d")); - if (Vcb.test(String.fromCharCode(i3))) { - d = lfb(c2, wfb(46), j - 1); - if (d >= 0) { - e = BD(hid(b, Bid(b, c2.substr(1, d - 1)), false), 58); - k = 0; - try { - k = Icb(c2.substr(d + 1), Rie, Ohe); - } catch (a) { - a = ubb(a); - if (JD(a, 127)) { - g = a; - throw vbb(new rFd(g)); - } else - throw vbb(a); - } - if (k < e.gc()) { - m = e.Xb(k); - JD(m, 72) && (m = BD(m, 72).dd()); - return BD(m, 56); - } - } - } - if (d < 0) { - return BD(hid(b, Bid(b, c2.substr(1)), false), 56); - } - } - return null; + } + 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 e1d(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l; - if (bLd(b, c2) >= 0) { - return c2; - } - switch ($1d(q1d(a, c2))) { - case 2: { - if (dfb("", o1d(a, c2.Hj()).ne())) { - i3 = b2d(q1d(a, c2)); - h = a2d(q1d(a, c2)); - k = r1d(a, b, i3, h); - if (k) { - return k; - } - e = f1d(a, b); - for (g = 0, l = e.gc(); g < l; ++g) { - k = BD(e.Xb(g), 170); - if (x1d(c2d(q1d(a, k)), i3)) { - return k; - } - } - } - return null; - } - case 4: { - if (dfb("", o1d(a, c2.Hj()).ne())) { - for (d = c2; d; d = Z1d(q1d(a, d))) { - j = b2d(q1d(a, d)); - h = a2d(q1d(a, d)); - k = s1d(a, b, j, h); - if (k) { - return k; - } - } - i3 = b2d(q1d(a, c2)); - if (dfb(Ewe, i3)) { - return t1d(a, b); - } else { - f2 = g1d(a, b); - for (g = 0, l = f2.gc(); g < l; ++g) { - k = BD(f2.Xb(g), 170); - if (x1d(c2d(q1d(a, k)), i3)) { - return k; - } - } - } - } - return null; - } - default: { - return null; - } - } + channel2 = parseFloat(channel2); + if (isPct[i2]) { + channel2 = channel2 / 100 * 255; } - function t2d(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - if (c2.gc() == 0) { - return false; - } - h = (Q6d(), BD(b, 66).Oj()); - f2 = h ? c2 : new zud(c2.gc()); - if (T6d(a.e, b)) { - if (b.hi()) { - for (j = c2.Kc(); j.Ob(); ) { - i3 = j.Pb(); - if (!F2d(a, b, i3, JD(b, 99) && (BD(b, 18).Bb & Tje) != 0)) { - e = R6d(b, i3); - f2.Hc(e) || f2.Fc(e); - } - } - } else if (!h) { - for (j = c2.Kc(); j.Ob(); ) { - i3 = j.Pb(); - e = R6d(b, i3); - f2.Fc(e); - } - } - } else { - if (c2.gc() > 1) { - throw vbb(new Wdb(Hwe)); - } - k = S6d(a.e.Tg(), b); - d = BD(a.g, 119); - for (g = 0; g < a.i; ++g) { - e = d[g]; - if (k.rl(e.ak())) { - if (c2.Hc(h ? e : e.dd())) { - return false; - } else { - for (j = c2.Kc(); j.Ob(); ) { - i3 = j.Pb(); - BD(Gtd(a, g, h ? BD(i3, 72) : R6d(b, i3)), 72); - } - return true; - } - } - } - if (!h) { - e = R6d(b, c2.Kc().Pb()); - f2.Fc(e); - } - } - return ytd(a, f2); - } - function qMc(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - k = new Psb(); - for (h = (j = new $ib(a.c).a.vc().Kc(), new djb(j)); h.a.Ob(); ) { - f2 = (e = BD(h.a.Pb(), 42), BD(e.dd(), 458)); - f2.b == 0 && (Gsb(k, f2, k.c.b, k.c), true); - } - while (k.b != 0) { - f2 = BD(k.b == 0 ? null : (sCb(k.b != 0), Nsb(k, k.a.a)), 458); - f2.a == null && (f2.a = 0); - for (d = new olb(f2.d); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 654); - c2.b.a == null ? c2.b.a = Edb(f2.a) + c2.a : b.o == (eMc(), cMc) ? c2.b.a = $wnd.Math.min(Edb(c2.b.a), Edb(f2.a) + c2.a) : c2.b.a = $wnd.Math.max(Edb(c2.b.a), Edb(f2.a) + c2.a); - --c2.b.b; - c2.b.b == 0 && Dsb(k, c2.b); - } - } - for (g = (i3 = new $ib(a.c).a.vc().Kc(), new djb(i3)); g.a.Ob(); ) { - f2 = (e = BD(g.a.Pb(), 42), BD(e.dd(), 458)); - b.i[f2.c.p] = f2.a; - } - } - function mTc() { - mTc = ccb; - dTc = new Lsd(Ime); - new Msd("DEPTH", meb(0)); - ZSc = new Msd("FAN", meb(0)); - XSc = new Msd(Yqe, meb(0)); - jTc = new Msd("ROOT", (Bcb(), false)); - _Sc = new Msd("LEFTNEIGHBOR", null); - hTc = new Msd("RIGHTNEIGHBOR", null); - aTc = new Msd("LEFTSIBLING", null); - iTc = new Msd("RIGHTSIBLING", null); - YSc = new Msd("DUMMY", false); - new Msd("LEVEL", meb(0)); - gTc = new Msd("REMOVABLE_EDGES", new Psb()); - kTc = new Msd("XCOOR", meb(0)); - lTc = new Msd("YCOOR", meb(0)); - bTc = new Msd("LEVELHEIGHT", 0); - $Sc = new Msd("ID", ""); - eTc = new Msd("POSITION", meb(0)); - fTc = new Msd("PRELIM", 0); - cTc = new Msd("MODIFIER", 0); - WSc = new Lsd(Kme); - VSc = new Lsd(Lme); - } - function MNc(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2; - k = c2 + b.c.c.a; - for (n = new olb(b.j); n.a < n.c.c.length; ) { - m = BD(mlb(n), 11); - e = l7c(OC(GC(m1, 1), nie, 8, 0, [m.i.n, m.n, m.a])); - if (b.k == (j0b(), i0b)) { - h = BD(vNb(m, (wtc(), $sc)), 11); - e.a = l7c(OC(GC(m1, 1), nie, 8, 0, [h.i.n, h.n, h.a])).a; - b.n.a = e.a; - } - g = new f7c(0, e.b); - if (m.j == (Ucd(), zcd)) { - g.a = k; - } else if (m.j == Tcd) { - g.a = c2; - } else { - continue; - } - o2 = $wnd.Math.abs(e.a - g.a); - if (o2 <= d && !JNc(b)) { - continue; - } - f2 = m.g.c.length + m.e.c.length > 1; - for (j = new b1b(m.b); llb(j.a) || llb(j.b); ) { - i3 = BD(llb(j.a) ? mlb(j.a) : mlb(j.b), 17); - l = i3.c == m ? i3.d : i3.c; - $wnd.Math.abs(l7c(OC(GC(m1, 1), nie, 8, 0, [l.i.n, l.n, l.a])).b - g.b) > 1 && GNc(a, i3, g, f2, m); - } - } + if (channel2 < 0 || channel2 > 255) { + return; } - function XPc(a) { - var b, c2, d, e, f2, g; - e = new Bib(a.e, 0); - d = new Bib(a.a, 0); - if (a.d) { - for (c2 = 0; c2 < a.b; c2++) { - sCb(e.b < e.d.gc()); - e.d.Xb(e.c = e.b++); - } - } else { - for (c2 = 0; c2 < a.b - 1; c2++) { - sCb(e.b < e.d.gc()); - e.d.Xb(e.c = e.b++); - uib(e); - } - } - b = Edb((sCb(e.b < e.d.gc()), ED(e.d.Xb(e.c = e.b++)))); - while (a.f - b > Oqe) { - f2 = b; - g = 0; - while ($wnd.Math.abs(b - f2) < Oqe) { - ++g; - b = Edb((sCb(e.b < e.d.gc()), ED(e.d.Xb(e.c = e.b++)))); - sCb(d.b < d.d.gc()); - d.d.Xb(d.c = d.b++); - } - if (g < a.b) { - sCb(e.b > 0); - e.a.Xb(e.c = --e.b); - WPc(a, a.b - g, f2, d, e); - sCb(e.b < e.d.gc()); - e.d.Xb(e.c = e.b++); - } - sCb(d.b > 0); - d.a.Xb(d.c = --d.b); - } - if (!a.d) { - for (c2 = 0; c2 < a.b - 1; c2++) { - sCb(e.b < e.d.gc()); - e.d.Xb(e.c = e.b++); - uib(e); - } - } - a.d = true; - a.c = true; - } - function Q8d() { - Q8d = ccb; - s8d = (r8d(), q8d).b; - v8d = BD(qud(ZKd(q8d.b), 0), 34); - t8d = BD(qud(ZKd(q8d.b), 1), 34); - u8d = BD(qud(ZKd(q8d.b), 2), 34); - F8d = q8d.bb; - BD(qud(ZKd(q8d.bb), 0), 34); - BD(qud(ZKd(q8d.bb), 1), 34); - H8d = q8d.fb; - I8d = BD(qud(ZKd(q8d.fb), 0), 34); - BD(qud(ZKd(q8d.fb), 1), 34); - BD(qud(ZKd(q8d.fb), 2), 18); - K8d = q8d.qb; - N8d = BD(qud(ZKd(q8d.qb), 0), 34); - BD(qud(ZKd(q8d.qb), 1), 18); - BD(qud(ZKd(q8d.qb), 2), 18); - L8d = BD(qud(ZKd(q8d.qb), 3), 34); - M8d = BD(qud(ZKd(q8d.qb), 4), 34); - P8d = BD(qud(ZKd(q8d.qb), 6), 34); - O8d = BD(qud(ZKd(q8d.qb), 5), 18); - w8d = q8d.j; - x8d = q8d.k; - y8d = q8d.q; - z8d = q8d.w; - A8d = q8d.B; - B8d = q8d.A; - C8d = q8d.C; - D8d = q8d.D; - E8d = q8d._; - G8d = q8d.cb; - J8d = q8d.hb; - } - function $Dc(a, b, c2) { - var d, e, f2, g, h, i3, 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 = BD(l.Pb(), 11); - h = k.j == (Ucd(), Acd) || k.j == Rcd; - n = 0; - if (h) { - m = BD(vNb(k, (wtc(), gtc)), 10); - if (!m) { - continue; - } - n += VDc(a, d, k, m); - } else { - for (j = new olb(k.g); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 17); - e = i3.d; - if (e.i.c == b.c) { - Ekb(a.a, k); - continue o; - } else { - n += a.g[e.p]; - } - } - for (g = new olb(k.e); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 17); - e = f2.c; - if (e.i.c == b.c) { - Ekb(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 $9d(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 l5b(a, b, c2) { - var d, e, f2, g; - Odd(c2, "Graph transformation (" + a.a + ")", 1); - g = Mu(b.a); - for (f2 = new olb(b.b); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 29); - Gkb(g, e.a); - } - d = BD(vNb(b, (Nyc(), Mwc)), 419); - if (d == (xqc(), vqc)) { - switch (BD(vNb(b, Lwc), 103).g) { - case 2: - _4b(b, g); - break; - case 3: - p5b(b, g); - break; - case 4: - if (a.a == (y5b(), x5b)) { - p5b(b, g); - a5b(b, g); - } else { - a5b(b, g); - p5b(b, g); - } - } - } else { - if (a.a == (y5b(), x5b)) { - switch (BD(vNb(b, Lwc), 103).g) { - case 2: - _4b(b, g); - a5b(b, g); - break; - case 3: - p5b(b, g); - _4b(b, g); - break; - case 4: - _4b(b, g); - p5b(b, g); - } - } else { - switch (BD(vNb(b, Lwc), 103).g) { - case 2: - _4b(b, g); - a5b(b, g); - break; - case 3: - _4b(b, g); - p5b(b, g); - break; - case 4: - p5b(b, g); - _4b(b, g); - } - } - } - Qdd(c2); - } - function j6b(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p; - j = new zsb(); - k = new zsb(); - o2 = new zsb(); - p = new zsb(); - i3 = Edb(ED(vNb(b, (Nyc(), vyc)))); - f2 = Edb(ED(vNb(b, lyc))); - for (h = new olb(c2); h.a < h.c.c.length; ) { - g = BD(mlb(h), 10); - l = BD(vNb(g, (wtc(), Hsc)), 61); - if (l == (Ucd(), Acd)) { - k.a.zc(g, k); - for (e = new Sr(ur(R_b(g).a.Kc(), new Sq())); Qr(e); ) { - d = BD(Rr(e), 17); - Qqb(j, d.c.i); - } - } else if (l == Rcd) { - p.a.zc(g, p); - for (e = new Sr(ur(R_b(g).a.Kc(), new Sq())); Qr(e); ) { - d = BD(Rr(e), 17); - Qqb(o2, d.c.i); - } - } - } - if (j.a.gc() != 0) { - m = new tPc(2, f2); - n = sPc(m, b, j, k, -i3 - b.c.b); - if (n > 0) { - a.a = i3 + (n - 1) * f2; - b.c.b += a.a; - b.f.b += a.a; - } - } - if (o2.a.gc() != 0) { - m = new tPc(1, f2); - n = sPc(m, b, o2, p, b.f.b + i3 - b.c.b); - n > 0 && (b.f.b += i3 + (n - 1) * f2); - } - } - function kKd(a, b) { - var c2, d, e, f2; - f2 = a.F; - if (b == null) { - a.F = null; - $Jd(a, null); - } else { - a.F = (uCb(b), b); - d = hfb(b, wfb(60)); - if (d != -1) { - e = b.substr(0, d); - hfb(b, wfb(46)) == -1 && !dfb(e, Khe) && !dfb(e, Eve) && !dfb(e, Fve) && !dfb(e, Gve) && !dfb(e, Hve) && !dfb(e, Ive) && !dfb(e, Jve) && !dfb(e, Kve) && (e = Lve); - c2 = kfb(b, wfb(62)); - c2 != -1 && (e += "" + b.substr(c2 + 1)); - $Jd(a, e); - } else { - e = b; - if (hfb(b, wfb(46)) == -1) { - d = hfb(b, wfb(91)); - d != -1 && (e = b.substr(0, d)); - if (!dfb(e, Khe) && !dfb(e, Eve) && !dfb(e, Fve) && !dfb(e, Gve) && !dfb(e, Hve) && !dfb(e, Ive) && !dfb(e, Jve) && !dfb(e, Kve)) { - e = Lve; - d != -1 && (e += "" + b.substr(d)); - } else { - e = b; - } - } - $Jd(a, e); - e == b && (a.F = a.D); - } - } - (a.Db & 4) != 0 && (a.Db & 1) == 0 && Uhd(a, new nSd(a, 1, 5, f2, b)); + 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 AMc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4; - p = b.b.c.length; - if (p < 3) { - return; - } - n = KC(WD, oje, 25, p, 15, 1); - l = 0; - for (k = new olb(b.b); k.a < k.c.c.length; ) { - j = BD(mlb(k), 29); - n[l++] = j.a.c.length; - } - m = new Bib(b.b, 2); - for (d = 1; d < p - 1; d++) { - c2 = (sCb(m.b < m.d.gc()), BD(m.d.Xb(m.c = m.b++), 29)); - o2 = new olb(c2.a); - f2 = 0; - h = 0; - for (i3 = 0; i3 < n[d + 1]; i3++) { - t4 = BD(mlb(o2), 10); - if (i3 == n[d + 1] - 1 || zMc(a, t4, d + 1, d)) { - g = n[d] - 1; - zMc(a, t4, d + 1, d) && (g = a.c.e[BD(BD(BD(Ikb(a.c.b, t4.p), 15).Xb(0), 46).a, 10).p]); - while (h <= i3) { - s = BD(Ikb(c2.a, h), 10); - if (!zMc(a, s, d + 1, d)) { - for (r = BD(Ikb(a.c.b, s.p), 15).Kc(); r.Ob(); ) { - q = BD(r.Pb(), 46); - e = a.c.e[BD(q.a, 10).p]; - (e < f2 || e > g) && Qqb(a.b, BD(q.b, 17)); - } - } - ++h; - } - f2 = g; - } - } - } + 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 o5c(b, c2) { - var d; - if (c2 == null || dfb(c2, Xhe)) { - return null; - } - if (c2.length == 0 && b.k != (_5c(), W5c)) { - return null; - } - switch (b.k.g) { - case 1: - return efb(c2, kse) ? (Bcb(), Acb) : efb(c2, lse) ? (Bcb(), zcb) : null; - case 2: - try { - return meb(Icb(c2, Rie, Ohe)); - } catch (a) { - a = ubb(a); - if (JD(a, 127)) { - return null; - } else - throw vbb(a); - } - case 4: - try { - return Hcb(c2); - } catch (a) { - a = ubb(a); - if (JD(a, 127)) { - return null; - } else - throw vbb(a); - } - case 3: - return c2; - case 5: - j5c(b); - return m5c(b, c2); - case 6: - j5c(b); - return n5c(b, b.a, c2); - case 7: - try { - d = l5c(b); - d.Jf(c2); - return d; - } catch (a) { - a = ubb(a); - if (JD(a, 32)) { - return null; - } else - throw vbb(a); - } - default: - throw vbb(new Zdb("Invalid type set for this layout option.")); - } - } - function JWb(a) { - AWb(); - var b, c2, d, e, f2, g, h; - h = new CWb(); - for (c2 = new olb(a); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 140); - (!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 NWb((lWb(), hWb)); - rXb(a, yWb, new amb(OC(GC(bQ, 1), Uhe, 369, 0, [d]))); - g = new NWb(kWb); - rXb(a, xWb, new amb(OC(GC(bQ, 1), Uhe, 369, 0, [g]))); - e = new NWb(iWb); - rXb(a, wWb, new amb(OC(GC(bQ, 1), Uhe, 369, 0, [e]))); - f2 = new NWb(jWb); - rXb(a, vWb, new amb(OC(GC(bQ, 1), Uhe, 369, 0, [f2]))); - DWb(d.c, hWb); - DWb(e.c, iWb); - DWb(f2.c, jWb); - DWb(g.c, kWb); - h.a.c = KC(SI, Uhe, 1, 0, 5, 1); - Gkb(h.a, d.c); - Gkb(h.a, Su(e.c)); - Gkb(h.a, f2.c); - Gkb(h.a, Su(g.c)); - return h; - } - function jxd(a) { - var b; - switch (a.d) { - case 1: { - if (a.hj()) { - return a.o != -2; - } - break; - } - case 2: { - if (a.hj()) { - return a.o == -2; - } - break; - } - case 3: - case 5: - case 4: - case 6: - case 7: { - return a.o > -2; - } - default: { - return false; - } - } - b = a.gj(); - switch (a.p) { - case 0: - return b != null && Ccb(DD(b)) != Kbb(a.k, 0); - case 1: - return b != null && BD(b, 217).a != Tbb(a.k) << 24 >> 24; - case 2: - return b != null && BD(b, 172).a != (Tbb(a.k) & aje); - case 6: - return b != null && Kbb(BD(b, 162).a, a.k); - case 5: - return b != null && BD(b, 19).a != Tbb(a.k); - case 7: - return b != null && BD(b, 184).a != Tbb(a.k) << 16 >> 16; - case 3: - return b != null && Edb(ED(b)) != a.j; - case 4: - return b != null && BD(b, 155).a != a.j; - default: - return b == null ? a.n != null : !pb(b, a.n); - } - } - function nOd(a, b, c2) { - var d, e, f2, g; - if (a.Fk() && a.Ek()) { - g = oOd(a, BD(c2, 56)); - if (PD(g) !== PD(c2)) { - a.Oi(b); - a.Ui(b, pOd(a, b, g)); - if (a.rk()) { - f2 = (e = BD(c2, 49), a.Dk() ? a.Bk() ? e.ih(a.b, zUd(BD(XKd(wjd(a.b), a.aj()), 18)).n, BD(XKd(wjd(a.b), a.aj()).Yj(), 26).Bj(), null) : e.ih(a.b, bLd(e.Tg(), zUd(BD(XKd(wjd(a.b), a.aj()), 18))), null, null) : e.ih(a.b, -1 - a.aj(), null, null)); - !BD(g, 49).eh() && (f2 = (d = BD(g, 49), a.Dk() ? a.Bk() ? d.gh(a.b, zUd(BD(XKd(wjd(a.b), a.aj()), 18)).n, BD(XKd(wjd(a.b), a.aj()).Yj(), 26).Bj(), f2) : d.gh(a.b, bLd(d.Tg(), zUd(BD(XKd(wjd(a.b), a.aj()), 18))), null, f2) : d.gh(a.b, -1 - a.aj(), null, f2))); - !!f2 && f2.Fi(); - } - oid(a.b) && a.$i(a.Zi(9, c2, g, b, false)); - return g; - } - } - return c2; - } - function Noc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2; - k = Edb(ED(vNb(a, (Nyc(), oyc)))); - d = Edb(ED(vNb(a, Cyc))); - m = new _fd(); - yNb(m, oyc, k + d); - j = b; - r = j.d; - p = j.c.i; - s = j.d.i; - q = G1b(p.c); - t4 = G1b(s.c); - e = new Rkb(); - for (l = q; l <= t4; l++) { - h = new b0b(a); - __b(h, (j0b(), g0b)); - yNb(h, (wtc(), $sc), j); - yNb(h, Vxc, (dcd(), $bd)); - yNb(h, qyc, m); - n = BD(Ikb(a.b, l), 29); - l == q ? Z_b(h, n.a.c.length - c2, n) : $_b(h, n); - u2 = Edb(ED(vNb(j, Zwc))); - if (u2 < 0) { - u2 = 0; - yNb(j, Zwc, u2); - } - h.o.b = u2; - o2 = $wnd.Math.floor(u2 / 2); - g = new H0b(); - G0b(g, (Ucd(), Tcd)); - F0b(g, h); - g.n.b = o2; - i3 = new H0b(); - G0b(i3, zcd); - F0b(i3, h); - i3.n.b = o2; - RZb(j, g); - f2 = new UZb(); - tNb(f2, j); - yNb(f2, jxc, null); - QZb(f2, i3); - RZb(f2, r); - Ooc(h, j, f2); - e.c[e.c.length] = f2; - j = f2; - } - return e; - } - function sbc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4; - i3 = BD(Y_b(a, (Ucd(), Tcd)).Kc().Pb(), 11).e; - n = BD(Y_b(a, zcd).Kc().Pb(), 11).g; - h = i3.c.length; - t4 = A0b(BD(Ikb(a.j, 0), 11)); - while (h-- > 0) { - p = (tCb(0, i3.c.length), BD(i3.c[0], 17)); - e = (tCb(0, n.c.length), BD(n.c[0], 17)); - s = e.d.e; - f2 = Jkb(s, e, 0); - SZb(p, e.d, f2); - QZb(e, null); - RZb(e, null); - o2 = p.a; - b && Dsb(o2, new g7c(t4)); - for (d = Jsb(e.a, 0); d.b != d.d.c; ) { - c2 = BD(Xsb(d), 8); - Dsb(o2, new g7c(c2)); - } - r = p.b; - for (m = new olb(e.b); m.a < m.c.c.length; ) { - l = BD(mlb(m), 70); - r.c[r.c.length] = l; - } - q = BD(vNb(p, (Nyc(), jxc)), 74); - g = BD(vNb(e, jxc), 74); - if (g) { - if (!q) { - q = new s7c(); - yNb(p, jxc, q); - } - for (k = Jsb(g, 0); k.b != k.d.c; ) { - j = BD(Xsb(k), 8); - Dsb(q, new g7c(j)); - } - } - } - } - function EJb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n; - c2 = BD(Mpb(a.b, b), 124); - i3 = BD(BD(Qc(a.r, b), 21), 84); - if (i3.dc()) { - c2.n.b = 0; - c2.n.c = 0; - return; - } - j = a.u.Hc((rcd(), ncd)); - g = 0; - h = i3.Kc(); - k = null; - l = 0; - m = 0; - while (h.Ob()) { - d = BD(h.Pb(), 111); - e = Edb(ED(d.b.We((CKb(), BKb)))); - f2 = d.b.rf().a; - a.A.Hc((tdd(), sdd)) && KJb(a, b); - if (!k) { - !!a.C && a.C.b > 0 && (g = $wnd.Math.max(g, IJb(a.C.b + d.d.b, e))); - } else { - n = m + k.d.c + a.w + d.d.b; - g = $wnd.Math.max(g, (Iy(), My(ple), $wnd.Math.abs(l - e) <= ple || 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, (Iy(), My(ple), $wnd.Math.abs(l - 1) <= ple || l == 1 || isNaN(l) && isNaN(1) ? 0 : n / (1 - l))); - } - c2.n.b = 0; - c2.a.a = g; - } - function NKb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n; - c2 = BD(Mpb(a.b, b), 124); - i3 = BD(BD(Qc(a.r, b), 21), 84); - if (i3.dc()) { - c2.n.d = 0; - c2.n.a = 0; - return; - } - j = a.u.Hc((rcd(), ncd)); - g = 0; - a.A.Hc((tdd(), sdd)) && SKb(a, b); - h = i3.Kc(); - k = null; - m = 0; - l = 0; - while (h.Ob()) { - d = BD(h.Pb(), 111); - f2 = Edb(ED(d.b.We((CKb(), BKb)))); - e = d.b.rf().b; - if (!k) { - !!a.C && a.C.d > 0 && (g = $wnd.Math.max(g, IJb(a.C.d + d.d.d, f2))); - } else { - n = l + k.d.a + a.w + d.d.d; - g = $wnd.Math.max(g, (Iy(), My(ple), $wnd.Math.abs(m - f2) <= ple || 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, (Iy(), My(ple), $wnd.Math.abs(m - 1) <= ple || m == 1 || isNaN(m) && isNaN(1) ? 0 : n / (1 - m))); - } - c2.n.d = 0; - c2.a.b = g; - } - function _Ec(a, b, c2) { - var d, e, f2, g, h, i3; - this.g = a; - h = b.d.length; - i3 = c2.d.length; - this.d = KC(OQ, kne, 10, h + i3, 0, 1); - for (g = 0; g < h; g++) { - this.d[g] = b.d[g]; - } - for (f2 = 0; f2 < i3; f2++) { - this.d[h + f2] = c2.d[f2]; - } - if (b.e) { - this.e = Ru(b.e); - this.e.Mc(c2); - if (c2.e) { - for (e = c2.e.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 233); - if (d == b) { - continue; - } else - this.e.Hc(d) ? --d.c : this.e.Fc(d); - } - } - } else if (c2.e) { - this.e = Ru(c2.e); - this.e.Mc(b); - } - this.f = b.f + c2.f; - this.a = b.a + c2.a; - this.a > 0 ? ZEc(this, this.f / this.a) : REc(b.g, b.d[0]).a != null && REc(c2.g, c2.d[0]).a != null ? ZEc(this, (Edb(REc(b.g, b.d[0]).a) + Edb(REc(c2.g, c2.d[0]).a)) / 2) : REc(b.g, b.d[0]).a != null ? ZEc(this, REc(b.g, b.d[0]).a) : REc(c2.g, c2.d[0]).a != null && ZEc(this, REc(c2.g, c2.d[0]).a); - } - function BUb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - a.a = new dVb(oqb(t12)); - for (d = new olb(b.a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 841); - h = new gVb(OC(GC(IP, 1), Uhe, 81, 0, [])); - Ekb(a.a.a, h); - for (j = new olb(c2.d); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 110); - k = new GUb(a, i3); - AUb(k, BD(vNb(c2.c, (wtc(), Esc)), 21)); - if (!Mhb(a.g, c2)) { - Rhb(a.g, c2, new f7c(i3.c, i3.d)); - Rhb(a.f, c2, k); - } - Ekb(a.a.b, k); - eVb(h, k); - } - for (g = new olb(c2.b); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 594); - k = new GUb(a, f2.kf()); - Rhb(a.b, f2, new vgd(h, k)); - AUb(k, BD(vNb(c2.c, (wtc(), Esc)), 21)); - if (f2.hf()) { - l = new HUb(a, f2.hf(), 1); - AUb(l, BD(vNb(c2.c, Esc), 21)); - e = new gVb(OC(GC(IP, 1), Uhe, 81, 0, [])); - eVb(e, l); - Rc(a.c, f2.gf(), new vgd(h, l)); - } - } - } - return a.a; - } - function oBc(a) { - var b; - this.a = a; - b = (j0b(), OC(GC(NQ, 1), Kie, 267, 0, [h0b, g0b, e0b, i0b, f0b, d0b])).length; - this.b = IC(Q3, [nie, zqe], [593, 146], 0, [b, b], 2); - this.c = IC(Q3, [nie, zqe], [593, 146], 0, [b, b], 2); - nBc(this, h0b, (Nyc(), vyc), wyc); - lBc(this, h0b, g0b, oyc, pyc); - kBc(this, h0b, i0b, oyc); - kBc(this, h0b, e0b, oyc); - lBc(this, h0b, f0b, vyc, wyc); - nBc(this, g0b, lyc, myc); - kBc(this, g0b, i0b, lyc); - kBc(this, g0b, e0b, lyc); - lBc(this, g0b, f0b, oyc, pyc); - mBc(this, i0b, lyc); - kBc(this, i0b, e0b, lyc); - kBc(this, i0b, f0b, syc); - mBc(this, e0b, zyc); - lBc(this, e0b, f0b, uyc, tyc); - nBc(this, f0b, lyc, lyc); - nBc(this, d0b, lyc, myc); - lBc(this, d0b, h0b, oyc, pyc); - lBc(this, d0b, f0b, oyc, pyc); - lBc(this, d0b, g0b, oyc, pyc); - } - function _2d(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q; - g = c2.ak(); - if (JD(g, 99) && (BD(g, 18).Bb & Tje) != 0) { - m = BD(c2.dd(), 49); - p = xid(a.e, m); - if (p != m) { - k = R6d(g, p); - mud(a, b, t3d(a, b, k)); - l = null; - if (oid(a.e)) { - d = e1d((O6d(), M6d), a.e.Tg(), g); - if (d != XKd(a.e.Tg(), a.c)) { - q = S6d(a.e.Tg(), g); - h = 0; - f2 = BD(a.g, 119); - for (i3 = 0; i3 < b; ++i3) { - e = f2[i3]; - q.rl(e.ak()) && ++h; - } - l = new O7d(a.e, 9, d, m, p, h, false); - l.Ei(new pSd(a.e, 9, a.c, c2, k, b, false)); - } - } - o2 = BD(g, 18); - n = zUd(o2); - if (n) { - l = m.ih(a.e, bLd(m.Tg(), n), null, l); - l = BD(p, 49).gh(a.e, bLd(p.Tg(), n), null, l); - } else if ((o2.Bb & ote) != 0) { - j = -1 - bLd(a.e.Tg(), o2); - l = m.ih(a.e, j, null, null); - !BD(p, 49).eh() && (l = BD(p, 49).gh(a.e, j, null, l)); - } - !!l && l.Fi(); - return k; - } - } - return c2; - } - function yUb(a) { - var b, c2, d, e, f2, g, h, i3; - for (f2 = new olb(a.a.b); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 81); - e.b.c = e.g.c; - e.b.d = e.g.d; - } - i3 = new f7c(Pje, Pje); - b = new f7c(Qje, Qje); - for (d = new olb(a.a.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 81); - i3.a = $wnd.Math.min(i3.a, c2.g.c); - i3.b = $wnd.Math.min(i3.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 = BD(h.Pb(), 46); - c2 = BD(g.b, 81); - i3.a = $wnd.Math.min(i3.a, c2.g.c); - i3.b = $wnd.Math.min(i3.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 = V6c(new f7c(i3.a, i3.b)); - a.e = c7c(new f7c(b.a, b.b), i3); - a.a.a.c = KC(SI, Uhe, 1, 0, 5, 1); - a.a.b.c = KC(SI, Uhe, 1, 0, 5, 1); - } - function svd(a) { - var b, c2, d; - l4c(lvd, OC(GC(C0, 1), Uhe, 130, 0, [new Z9c()])); - c2 = new xB(a); - for (d = 0; d < c2.a.length; ++d) { - b = tB(c2, d).je().a; - dfb(b, "layered") ? l4c(lvd, OC(GC(C0, 1), Uhe, 130, 0, [new kwc()])) : dfb(b, "force") ? l4c(lvd, OC(GC(C0, 1), Uhe, 130, 0, [new TRb()])) : dfb(b, "stress") ? l4c(lvd, OC(GC(C0, 1), Uhe, 130, 0, [new PSb()])) : dfb(b, "mrtree") ? l4c(lvd, OC(GC(C0, 1), Uhe, 130, 0, [new sTc()])) : dfb(b, "radial") ? l4c(lvd, OC(GC(C0, 1), Uhe, 130, 0, [new IWc()])) : dfb(b, "disco") ? l4c(lvd, OC(GC(C0, 1), Uhe, 130, 0, [new gFb(), new oPb()])) : dfb(b, "sporeOverlap") || dfb(b, "sporeCompaction") ? l4c(lvd, OC(GC(C0, 1), Uhe, 130, 0, [new B0c()])) : dfb(b, "rectpacking") && l4c(lvd, OC(GC(C0, 1), Uhe, 130, 0, [new PYc()])); - } - } - function j_b(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r; - m = new g7c(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 = PD(vNb(a, (Nyc(), Vxc))) === PD((dcd(), $bd)); - for (o2 = new olb(a.j); o2.a < o2.c.c.length; ) { - n = BD(mlb(o2), 11); - 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 olb(a.b); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 70); - k = i3.n.a + i3.o.a / 2; - l = i3.n.b + i3.o.b / 2; - q = k / m.a; - g = l / m.b; - if (q + g >= 1) { - if (q - g > 0 && l >= 0) { - i3.n.a += p; - i3.n.b += f2 * g; - } else if (q - g < 0 && k >= 0) { - i3.n.a += p * q; - i3.n.b += f2; - } - } - } - a.o.a = b.a; - a.o.b = b.b; - yNb(a, (Nyc(), Fxc), (tdd(), d = BD(gdb(I1), 9), new xqb(d, BD(_Bb(d, d.length), 9), 0))); - } - function iFd(a, b, c2, d, e, f2) { - var g; - if (!(b == null || !OEd(b, zEd, AEd))) { - throw vbb(new Wdb("invalid scheme: " + b)); - } - if (!a && !(c2 != null && hfb(c2, wfb(35)) == -1 && c2.length > 0 && (BCb(0, c2.length), c2.charCodeAt(0) != 47))) { - throw vbb(new Wdb("invalid opaquePart: " + c2)); - } - if (a && !(b != null && hnb(GEd, b.toLowerCase())) && !(c2 == null || !OEd(c2, CEd, DEd))) { - throw vbb(new Wdb(mve + c2)); - } - if (a && b != null && hnb(GEd, b.toLowerCase()) && !eFd(c2)) { - throw vbb(new Wdb(mve + c2)); - } - if (!fFd(d)) { - throw vbb(new Wdb("invalid device: " + d)); - } - if (!hFd(e)) { - g = e == null ? "invalid segments: null" : "invalid segment: " + VEd(e); - throw vbb(new Wdb(g)); - } - if (!(f2 == null || hfb(f2, wfb(35)) == -1)) { - throw vbb(new Wdb("invalid query: " + f2)); - } - } - function nVc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r; - Odd(b, "Calculate Graph Size", 1); - b.n && !!a && Tdd(b, i6d(a), (pgd(), mgd)); - h = dme; - i3 = dme; - f2 = ere; - g = ere; - for (l = new Fyd((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a)); l.e != l.i.gc(); ) { - j = BD(Dyd(l), 33); - o2 = j.i; - p = j.j; - r = j.g; - d = j.f; - e = BD(hkd(j, (Y9c(), S8c)), 142); - h = $wnd.Math.min(h, o2 - e.b); - i3 = $wnd.Math.min(i3, p - e.d); - f2 = $wnd.Math.max(f2, o2 + r + e.c); - g = $wnd.Math.max(g, p + d + e.a); - } - n = BD(hkd(a, (Y9c(), f9c)), 116); - m = new f7c(h - n.b, i3 - n.d); - for (k = new Fyd((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a)); k.e != k.i.gc(); ) { - j = BD(Dyd(k), 33); - dld(j, j.i - m.a); - eld(j, j.j - m.b); - } - q = f2 - h + (n.b + n.c); - c2 = g - i3 + (n.d + n.a); - cld(a, q); - ald(a, c2); - b.n && !!a && Tdd(b, i6d(a), (pgd(), mgd)); - } - function rGb(a) { - var b, c2, d, e, f2, g, h, i3, j, k; - d = new Rkb(); - for (g = new olb(a.e.a); g.a < g.c.c.length; ) { - e = BD(mlb(g), 121); - k = 0; - e.k.c = KC(SI, Uhe, 1, 0, 5, 1); - for (c2 = new olb(LFb(e)); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 213); - if (b.f) { - Ekb(e.k, b); - ++k; - } - } - k == 1 && (d.c[d.c.length] = e, true); - } - for (f2 = new olb(d); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 121); - while (e.k.c.length == 1) { - j = BD(mlb(new olb(e.k)), 213); - a.b[j.c] = j.g; - h = j.d; - i3 = j.e; - for (c2 = new olb(LFb(e)); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 213); - pb(b, j) || (b.f ? h == b.d || i3 == 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); - } - Lkb(h.k, j); - Lkb(i3.k, j); - h == e ? e = j.e : e = j.d; - } - } - } - function k4c(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2; - if (b == null || b.length == 0) { - return null; - } - f2 = BD(Phb(a.f, b), 23); - if (!f2) { - for (e = (n = new $ib(a.d).a.vc().Kc(), new djb(n)); e.a.Ob(); ) { - c2 = (g = BD(e.a.Pb(), 42), BD(g.dd(), 23)); - h = c2.f; - o2 = b.length; - if (dfb(h.substr(h.length - o2, o2), b) && (b.length == h.length || bfb(h, h.length - b.length - 1) == 46)) { - if (f2) { - return null; - } - f2 = c2; - } - } - if (!f2) { - for (d = (m = new $ib(a.d).a.vc().Kc(), new djb(m)); d.a.Ob(); ) { - c2 = (g = BD(d.a.Pb(), 42), BD(g.dd(), 23)); - l = c2.g; - if (l != null) { - for (i3 = l, j = 0, k = i3.length; j < k; ++j) { - h = i3[j]; - o2 = b.length; - if (dfb(h.substr(h.length - o2, o2), b) && (b.length == h.length || bfb(h, h.length - b.length - 1) == 46)) { - if (f2) { - return null; - } - f2 = c2; - } - } - } - } - } - !!f2 && Shb(a.f, b, f2); - } - return f2; + 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 sA(a, b) { - var c2, d, e, f2, g; - c2 = new Vfb(); - g = false; - for (f2 = 0; f2 < b.length; f2++) { - d = (BCb(f2, b.length), b.charCodeAt(f2)); - if (d == 32) { - gA(a, c2, 0); - c2.a += " "; - gA(a, c2, 0); - while (f2 + 1 < b.length && (BCb(f2 + 1, b.length), b.charCodeAt(f2 + 1) == 32)) { - ++f2; - } - continue; - } - if (g) { - if (d == 39) { - if (f2 + 1 < b.length && (BCb(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 (hfb("GyMLdkHmsSEcDahKzZv", wfb(d)) > 0) { - gA(a, c2, 0); - c2.a += String.fromCharCode(d); - e = lA(b, f2); - gA(a, c2, e); - f2 += e - 1; - continue; - } - if (d == 39) { - if (f2 + 1 < b.length && (BCb(f2 + 1, b.length), b.charCodeAt(f2 + 1) == 39)) { - c2.a += "'"; - ++f2; - } else { - g = true; - } - } else { - c2.a += String.fromCharCode(d); - } - } - gA(a, c2, 0); - mA(a); + 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 wDc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r; - Odd(c2, "Network simplex layering", 1); - a.b = b; - r = BD(vNb(b, (Nyc(), Ayc)), 19).a * 4; - q = a.b.a; - if (q.c.length < 1) { - Qdd(c2); - return; - } - f2 = sDc(a, q); - p = null; - for (e = Jsb(f2, 0); e.b != e.d.c; ) { - d = BD(Xsb(e), 15); - h = r * QD($wnd.Math.sqrt(d.gc())); - g = vDc(d); - uGb(HGb(JGb(IGb(LGb(g), h), p), true), Udd(c2, 1)); - m = a.b.b; - for (o2 = new olb(g.a); o2.a < o2.c.c.length; ) { - n = BD(mlb(o2), 121); - while (m.c.length <= n.e) { - Dkb(m, m.c.length, new H1b(a.b)); - } - k = BD(n.f, 10); - $_b(k, BD(Ikb(m, n.e), 29)); - } - if (f2.b > 1) { - p = KC(WD, oje, 25, a.b.b.c.length, 15, 1); - l = 0; - for (j = new olb(a.b.b); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 29); - p[l++] = i3.a.c.length; - } - } - } - q.c = KC(SI, Uhe, 1, 0, 5, 1); - a.a = null; - a.b = null; - a.c = null; - Qdd(c2); - } - function OUb(a) { - var b, c2, d, e, f2, g, h; - b = 0; - for (f2 = new olb(a.b.a); f2.a < f2.c.c.length; ) { - d = BD(mlb(f2), 189); - d.b = 0; - d.c = 0; - } - NUb(a, 0); - MUb(a, a.g); - sVb(a.c); - wVb(a.c); - c2 = (ead(), aad); - uVb(oVb(tVb(uVb(oVb(tVb(uVb(tVb(a.c, c2)), had(c2)))), c2))); - tVb(a.c, aad); - RUb(a, a.g); - SUb(a, 0); - TUb(a, 0); - UUb(a, 1); - NUb(a, 1); - MUb(a, a.d); - sVb(a.c); - for (g = new olb(a.b.a); g.a < g.c.c.length; ) { - d = BD(mlb(g), 189); - b += $wnd.Math.abs(d.c); - } - for (h = new olb(a.b.a); h.a < h.c.c.length; ) { - d = BD(mlb(h), 189); - d.b = 0; - d.c = 0; - } - c2 = dad; - uVb(oVb(tVb(uVb(oVb(tVb(uVb(wVb(tVb(a.c, c2))), had(c2)))), c2))); - tVb(a.c, aad); - RUb(a, a.d); - SUb(a, 1); - TUb(a, 1); - UUb(a, 0); - wVb(a.c); - for (e = new olb(a.b.a); e.a < e.c.c.length; ) { - d = BD(mlb(e), 189); - b += $wnd.Math.abs(d.c); - } - return b; - } - function Wfe(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - j = b; - if (j.b == null || a.b == null) - return; - Yfe(a); - Vfe(a); - Yfe(j); - Vfe(j); - c2 = KC(WD, oje, 25, 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]; - i3 = j.b[g + 1]; - if (f2 < h) { - d += 2; - } else if (f2 >= h && e <= i3) { - if (h <= e && f2 <= i3) { - c2[k++] = e; - c2[k++] = f2; - d += 2; - } else if (h <= e) { - c2[k++] = e; - c2[k++] = i3; - a.b[d] = i3 + 1; - g += 2; - } else if (f2 <= i3) { - c2[k++] = h; - c2[k++] = f2; - d += 2; - } else { - c2[k++] = h; - c2[k++] = i3; - a.b[d] = i3 + 1; - } - } else if (i3 < e) { - g += 2; - } else { - throw vbb(new hz("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 = KC(WD, oje, 25, k, 15, 1); - $fb(c2, 0, a.b, 0, k); - } - function PUb(a) { - var b, c2, d, e, f2, g, h; - b = new Rkb(); - a.g = new Rkb(); - a.d = new Rkb(); - for (g = new nib(new eib(a.f.b).a); g.b; ) { - f2 = lib(g); - Ekb(b, BD(BD(f2.dd(), 46).b, 81)); - fad(BD(f2.cd(), 594).gf()) ? Ekb(a.d, BD(f2.dd(), 46)) : Ekb(a.g, BD(f2.dd(), 46)); - } - MUb(a, a.d); - MUb(a, a.g); - a.c = new CVb(a.b); - AVb(a.c, (xUb(), wUb)); - RUb(a, a.d); - RUb(a, a.g); - Gkb(b, a.c.a.b); - a.e = new f7c(Pje, Pje); - a.a = new f7c(Qje, Qje); - for (d = new olb(b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 81); - 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); - } - zVb(a.c, new YUb()); - h = 0; - do { - e = OUb(a); - ++h; - } while ((h < 2 || e > Qie) && h < 10); - zVb(a.c, new _Ub()); - OUb(a); - vVb(a.c); - yUb(a.f); - } - function sZb(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q; - if (!Ccb(DD(vNb(c2, (Nyc(), fxc))))) { - return; - } - for (h = new olb(c2.j); h.a < h.c.c.length; ) { - g = BD(mlb(h), 11); - m = k_b(g.g); - for (j = m, k = 0, l = j.length; k < l; ++k) { - i3 = j[k]; - f2 = i3.d.i == c2; - e = f2 && Ccb(DD(vNb(i3, gxc))); - if (e) { - o2 = i3.c; - n = BD(Ohb(a.b, o2), 10); - if (!n) { - n = Z$b(o2, (dcd(), bcd), o2.j, -1, null, null, o2.o, BD(vNb(b, Lwc), 103), b); - yNb(n, (wtc(), $sc), o2); - Rhb(a.b, o2, n); - Ekb(b.a, n); - } - q = i3.d; - p = BD(Ohb(a.b, q), 10); - if (!p) { - p = Z$b(q, (dcd(), bcd), q.j, 1, null, null, q.o, BD(vNb(b, Lwc), 103), b); - yNb(p, (wtc(), $sc), q); - Rhb(a.b, q, p); - Ekb(b.a, p); - } - d = kZb(i3); - QZb(d, BD(Ikb(n.j, 0), 11)); - RZb(d, BD(Ikb(p.j, 0), 11)); - Rc(a.a, i3, new BZb(d, b, (KAc(), IAc))); - BD(vNb(b, (wtc(), Ksc)), 21).Fc((Orc(), Hrc)); - } - } - } + 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 W9b(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2; - Odd(c2, "Label dummy switching", 1); - d = BD(vNb(b, (Nyc(), Owc)), 227); - J9b(b); - e = T9b(b, d); - a.a = KC(UD, Vje, 25, b.b.c.length, 15, 1); - for (h = (Apc(), OC(GC(EW, 1), Kie, 227, 0, [wpc, ypc, vpc, xpc, zpc, upc])), k = 0, n = h.length; k < n; ++k) { - f2 = h[k]; - if ((f2 == zpc || f2 == upc || f2 == xpc) && !BD(uqb(e.a, f2) ? e.b[f2.g] : null, 15).dc()) { - M9b(a, b); - break; - } - } - for (i3 = OC(GC(EW, 1), Kie, 227, 0, [wpc, ypc, vpc, xpc, zpc, upc]), l = 0, o2 = i3.length; l < o2; ++l) { - f2 = i3[l]; - f2 == zpc || f2 == upc || f2 == xpc || X9b(a, BD(uqb(e.a, f2) ? e.b[f2.g] : null, 15)); - } - for (g = OC(GC(EW, 1), Kie, 227, 0, [wpc, ypc, vpc, xpc, zpc, upc]), j = 0, m = g.length; j < m; ++j) { - f2 = g[j]; - (f2 == zpc || f2 == upc || f2 == xpc) && X9b(a, BD(uqb(e.a, f2) ? e.b[f2.g] : null, 15)); - } - a.a = null; - Qdd(c2); + } + } + }, "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 clear30() { + 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 AFc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m; - switch (a.k.g) { - case 1: - d = BD(vNb(a, (wtc(), $sc)), 17); - c2 = BD(vNb(d, _sc), 74); - !c2 ? c2 = new s7c() : Ccb(DD(vNb(d, ltc))) && (c2 = w7c(c2)); - j = BD(vNb(a, Vsc), 11); - if (j) { - k = l7c(OC(GC(m1, 1), nie, 8, 0, [j.i.n, j.n, j.a])); - if (b <= k.a) { - return k.b; - } - Gsb(c2, k, c2.a, c2.a.a); - } - l = BD(vNb(a, Wsc), 11); - if (l) { - m = l7c(OC(GC(m1, 1), nie, 8, 0, [l.i.n, l.n, l.a])); - if (m.a <= b) { - return m.b; - } - Gsb(c2, m, c2.c.b, c2.c); - } - if (c2.b >= 2) { - i3 = Jsb(c2, 0); - g = BD(Xsb(i3), 8); - h = BD(Xsb(i3), 8); - while (h.a < b && i3.b != i3.d.c) { - g = h; - h = BD(Xsb(i3), 8); - } - return g.b + (b - g.a) / (h.a - g.a) * (h.b - g.b); - } - break; - case 3: - f2 = BD(vNb(BD(Ikb(a.j, 0), 11), (wtc(), $sc)), 11); - e = f2.i; - switch (f2.j.g) { - case 1: - return e.n.b; - case 3: - return e.n.b + e.o.b; - } - } - return T_b(a).b; - } - function Wgc(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l; - for (g = new olb(a.d.b); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 29); - for (i3 = new olb(f2.a); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 10); - if (Ccb(DD(vNb(h, (Nyc(), pwc))))) { - if (!Qq(O_b(h))) { - d = BD(Oq(O_b(h)), 17); - k = d.c.i; - k == h && (k = d.d.i); - l = new vgd(k, c7c(R6c(h.n), k.n)); - Rhb(a.b, h, l); - continue; - } - } - e = new J6c(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 = vDb(yDb(wDb(xDb(new zDb(), h), e), Fgc), a.a); - pDb(qDb(rDb(new sDb(), OC(GC(PM, 1), Uhe, 57, 0, [b])), b), a.a); - j = new lEb(); - Rhb(a.e, b, j); - c2 = sr(new Sr(ur(R_b(h).a.Kc(), new Sq()))) - sr(new Sr(ur(U_b(h).a.Kc(), new Sq()))); - c2 < 0 ? jEb(j, true, (ead(), aad)) : c2 > 0 && jEb(j, true, (ead(), bad)); - h.k == (j0b(), e0b) && kEb(j); - Rhb(a.f, h, b); - } - } - } - function Bbc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m; - Odd(c2, "Node promotion heuristic", 1); - a.g = b; - Abc(a); - a.q = BD(vNb(b, (Nyc(), rxc)), 260); - k = BD(vNb(a.g, qxc), 19).a; - f2 = new Jbc(); - switch (a.q.g) { - case 2: - case 1: - Dbc(a, f2); - break; - case 3: - a.q = (kAc(), jAc); - Dbc(a, f2); - i3 = 0; - for (h = new olb(a.a); h.a < h.c.c.length; ) { - g = BD(mlb(h), 19); - i3 = $wnd.Math.max(i3, g.a); - } - if (i3 > a.j) { - a.q = dAc; - Dbc(a, f2); - } - break; - case 4: - a.q = (kAc(), jAc); - Dbc(a, f2); - j = 0; - for (e = new olb(a.b); e.a < e.c.c.length; ) { - d = ED(mlb(e)); - j = $wnd.Math.max(j, (uCb(d), d)); - } - if (j > a.k) { - a.q = gAc; - Dbc(a, f2); - } - break; - case 6: - m = QD($wnd.Math.ceil(a.f.length * k / 100)); - Dbc(a, new Mbc(m)); - break; - case 5: - l = QD($wnd.Math.ceil(a.d * k / 100)); - Dbc(a, new Pbc(l)); - break; - default: - Dbc(a, f2); - } - Ebc(a, b); - Qdd(c2); - } - function fFc(a, b, c2) { - var d, e, f2, g; - this.j = a; - this.e = WZb(a); - this.o = this.j.e; - this.i = !!this.o; - this.p = this.i ? BD(Ikb(c2, Q_b(this.o).p), 214) : null; - e = BD(vNb(a, (wtc(), Ksc)), 21); - this.g = e.Hc((Orc(), Hrc)); - this.b = new Rkb(); - this.d = new rHc(this.e); - g = BD(vNb(this.j, jtc), 230); - this.q = wFc(b, g, this.e); - this.k = new BGc(this); - f2 = Ou(OC(GC(qY, 1), Uhe, 225, 0, [this, this.d, this.k, this.q])); - if (b == (rGc(), oGc) && !Ccb(DD(vNb(a, (Nyc(), Awc))))) { - d = new SEc(this.e); - f2.c[f2.c.length] = d; - this.c = new uEc(d, g, BD(this.q, 402)); - } else if (b == oGc && Ccb(DD(vNb(a, (Nyc(), Awc))))) { - d = new SEc(this.e); - f2.c[f2.c.length] = d; - this.c = new XGc(d, g, BD(this.q, 402)); - } else { - this.c = new Oic(b, this); - } - Ekb(f2, this.c); - $Ic(f2, this.e); - this.s = AGc(this.k); - } - function xUc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2; - l = BD(pr((g = Jsb(new ZRc(b).a.d, 0), new aSc(g))), 86); - o2 = l ? BD(vNb(l, (mTc(), _Sc)), 86) : null; - e = 1; - while (!!l && !!o2) { - i3 = 0; - u2 = 0; - c2 = l; - d = o2; - for (h = 0; h < e; h++) { - c2 = VRc(c2); - d = VRc(d); - u2 += Edb(ED(vNb(c2, (mTc(), cTc)))); - i3 += Edb(ED(vNb(d, cTc))); - } - t4 = Edb(ED(vNb(o2, (mTc(), fTc)))); - s = Edb(ED(vNb(l, fTc))); - m = zUc(l, o2); - n = t4 + i3 + a.a + m - s - u2; - if (0 < n) { - j = b; - k = 0; - while (!!j && j != d) { - ++k; - j = BD(vNb(j, aTc), 86); - } - if (j) { - r = n / k; - j = b; - while (j != d) { - q = Edb(ED(vNb(j, fTc))) + n; - yNb(j, fTc, q); - p = Edb(ED(vNb(j, cTc))) + n; - yNb(j, cTc, p); - n -= r; - j = BD(vNb(j, aTc), 86); - } - } else { - return; - } - } - ++e; - l.d.b == 0 ? l = JRc(new ZRc(b), e) : l = BD(pr((f2 = Jsb(new ZRc(l).a.d, 0), new aSc(f2))), 86); - o2 = l ? BD(vNb(l, _Sc), 86) : null; - } - } - function Cbc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - i3 = true; - e = 0; - j = a.f[b.p]; - k = b.o.b + a.n; - c2 = a.c[b.p][2]; - Nkb(a.a, j, meb(BD(Ikb(a.a, j), 19).a - 1 + c2)); - Nkb(a.b, j, Edb(ED(Ikb(a.b, j))) - k + c2 * a.e); - ++j; - if (j >= a.i) { - ++a.i; - Ekb(a.a, meb(1)); - Ekb(a.b, k); - } else { - d = a.c[b.p][1]; - Nkb(a.a, j, meb(BD(Ikb(a.a, j), 19).a + 1 - d)); - Nkb(a.b, j, Edb(ED(Ikb(a.b, j))) + k - d * a.e); - } - (a.q == (kAc(), dAc) && (BD(Ikb(a.a, j), 19).a > a.j || BD(Ikb(a.a, j - 1), 19).a > a.j) || a.q == gAc && (Edb(ED(Ikb(a.b, j))) > a.k || Edb(ED(Ikb(a.b, j - 1))) > a.k)) && (i3 = false); - for (g = new Sr(ur(R_b(b).a.Kc(), new Sq())); Qr(g); ) { - f2 = BD(Rr(g), 17); - h = f2.c.i; - if (a.f[h.p] == j) { - l = Cbc(a, h); - e = e + BD(l.a, 19).a; - i3 = i3 && Ccb(DD(l.b)); - } - } - a.f[b.p] = j; - e = e + a.c[b.p][0]; - return new vgd(meb(e), (Bcb(), i3 ? true : false)); - } - function sPc(a, b, c2, d, e) { - var f2, g, h, i3, j, k, l, m, n, o2, p, q, r; - l = new Lqb(); - g = new Rkb(); - qPc(a, c2, a.d.fg(), g, l); - qPc(a, d, a.d.gg(), g, l); - a.b = 0.2 * (p = rPc(LAb(new YAb(null, new Kub(g, 16)), new xPc())), q = rPc(LAb(new YAb(null, new Kub(g, 16)), new zPc())), $wnd.Math.min(p, q)); - f2 = 0; - for (h = 0; h < g.c.length - 1; h++) { - i3 = (tCb(h, g.c.length), BD(g.c[h], 112)); - for (o2 = h + 1; o2 < g.c.length; o2++) { - f2 += pPc(a, i3, (tCb(o2, g.c.length), BD(g.c[o2], 112))); - } - } - m = BD(vNb(b, (wtc(), jtc)), 230); - f2 >= 2 && (r = WNc(g, true, m), !a.e && (a.e = new ZOc(a)), VOc(a.e, r, g, a.b), void 0); - uPc(g, m); - wPc(g); - n = -1; - for (k = new olb(g); k.a < k.c.c.length; ) { - j = BD(mlb(k), 112); - if ($wnd.Math.abs(j.s - j.c) < qme) { - continue; - } - n = $wnd.Math.max(n, j.o); - a.d.dg(j, e, a.c); - } - a.d.a.a.$b(); - return n + 1; - } - function aUb(a, b) { - var c2, d, e, f2, g; - c2 = Edb(ED(vNb(b, (Nyc(), lyc)))); - c2 < 2 && yNb(b, lyc, 2); - d = BD(vNb(b, Lwc), 103); - d == (ead(), cad) && yNb(b, Lwc, a_b(b)); - e = BD(vNb(b, fyc), 19); - e.a == 0 ? yNb(b, (wtc(), jtc), new Gub()) : yNb(b, (wtc(), jtc), new Hub(e.a)); - f2 = DD(vNb(b, Axc)); - f2 == null && yNb(b, Axc, (Bcb(), PD(vNb(b, Swc)) === PD((Aad(), wad)) ? true : false)); - MAb(new YAb(null, new Kub(b.a, 16)), new dUb(a)); - MAb(LAb(new YAb(null, new Kub(b.b, 16)), new fUb()), new hUb(a)); - g = new oBc(b); - yNb(b, (wtc(), otc), g); - H2c(a.a); - K2c(a.a, (qUb(), lUb), BD(vNb(b, Jwc), 246)); - K2c(a.a, mUb, BD(vNb(b, sxc), 246)); - K2c(a.a, nUb, BD(vNb(b, Iwc), 246)); - K2c(a.a, oUb, BD(vNb(b, Exc), 246)); - K2c(a.a, pUb, kNc(BD(vNb(b, Swc), 218))); - E2c(a.a, _Tb(b)); - yNb(b, itc, F2c(a.a, b)); - } - function fjc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2; - if (m = a.c[b], n = a.c[c2], (o2 = BD(vNb(m, (wtc(), Qsc)), 15), !!o2 && o2.gc() != 0 && o2.Hc(n)) || (p = m.k != (j0b(), g0b) && n.k != g0b, q = BD(vNb(m, Psc), 10), r = BD(vNb(n, Psc), 10), s = q != r, t4 = !!q && q != m || !!r && r != n, u2 = gjc(m, (Ucd(), Acd)), v = gjc(n, Rcd), t4 = t4 | (gjc(m, Rcd) || gjc(n, Acd)), w2 = t4 && s || u2 || v, p && w2) || m.k == (j0b(), i0b) && n.k == h0b || n.k == (j0b(), i0b) && m.k == h0b) { - return false; - } - k = a.c[b]; - f2 = a.c[c2]; - e = LHc(a.e, k, f2, (Ucd(), Tcd)); - i3 = LHc(a.i, k, f2, zcd); - Yic(a.f, k, f2); - j = Hic(a.b, k, f2) + BD(e.a, 19).a + BD(i3.a, 19).a + a.f.d; - h = Hic(a.b, f2, k) + BD(e.b, 19).a + BD(i3.b, 19).a + a.f.b; - if (a.a) { - l = BD(vNb(k, $sc), 11); - g = BD(vNb(f2, $sc), 11); - d = JHc(a.g, l, g); - j += BD(d.a, 19).a; - h += BD(d.b, 19).a; - } - return j > h; - } - function k6b(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p; - c2 = BD(vNb(a, (Nyc(), Vxc)), 98); - g = a.f; - f2 = a.d; - h = g.a + f2.b + f2.c; - i3 = 0 - f2.d - a.c.b; - k = g.b + f2.d + f2.a - a.c.b; - j = new Rkb(); - l = new Rkb(); - for (e = new olb(b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 10); - switch (c2.g) { - case 1: - case 2: - case 3: - a6b(d); - break; - case 4: - m = BD(vNb(d, Txc), 8); - n = !m ? 0 : m.a; - d.n.a = h * Edb(ED(vNb(d, (wtc(), htc)))) - n; - M_b(d, true, false); - break; - case 5: - o2 = BD(vNb(d, Txc), 8); - p = !o2 ? 0 : o2.a; - d.n.a = Edb(ED(vNb(d, (wtc(), htc)))) - p; - M_b(d, true, false); - g.a = $wnd.Math.max(g.a, d.n.a + d.o.a / 2); - } - switch (BD(vNb(d, (wtc(), Hsc)), 61).g) { - case 1: - d.n.b = i3; - j.c[j.c.length] = d; - break; - case 3: - d.n.b = k; - l.c[l.c.length] = d; - } - } - switch (c2.g) { - case 1: - case 2: - c6b(j, a); - c6b(l, a); - break; - case 3: - i6b(j, a); - i6b(l, a); - } - } - function VHc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l; - k = new Rkb(); - l = new jkb(); - f2 = null; - e = 0; - for (d = 0; d < b.length; ++d) { - c2 = b[d]; - XHc(f2, c2) && (e = QHc(a, l, k, EHc, e)); - wNb(c2, (wtc(), Psc)) && (f2 = BD(vNb(c2, Psc), 10)); - switch (c2.k.g) { - case 0: - for (i3 = Vq(Nq(V_b(c2, (Ucd(), Acd)), new GIc())); xc(i3); ) { - g = BD(yc(i3), 11); - a.d[g.p] = e++; - k.c[k.c.length] = g; - } - e = QHc(a, l, k, EHc, e); - for (j = Vq(Nq(V_b(c2, Rcd), new GIc())); xc(j); ) { - g = BD(yc(j), 11); - a.d[g.p] = e++; - k.c[k.c.length] = g; - } - break; - case 3: - if (!V_b(c2, DHc).dc()) { - g = BD(V_b(c2, DHc).Xb(0), 11); - a.d[g.p] = e++; - k.c[k.c.length] = g; - } - V_b(c2, EHc).dc() || Wjb(l, c2); - break; - case 1: - for (h = V_b(c2, (Ucd(), Tcd)).Kc(); h.Ob(); ) { - g = BD(h.Pb(), 11); - a.d[g.p] = e++; - k.c[k.c.length] = g; - } - V_b(c2, zcd).Jc(new EIc(l, c2)); - } - } - QHc(a, l, k, EHc, e); - return k; - } - function y$c(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s; - j = Pje; - k = Pje; - h = Qje; - i3 = Qje; - for (m = new olb(b.i); m.a < m.c.c.length; ) { - l = BD(mlb(m), 65); - e = BD(BD(Ohb(a.g, l.a), 46).b, 33); - bld(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); - i3 = $wnd.Math.max(i3, e.j + e.f); - } - n = BD(hkd(a.c, (d0c(), W_c)), 116); - Afd(a.c, h - j + (n.b + n.c), i3 - k + (n.d + n.a), true, true); - Efd(a.c, -j + n.b, -k + n.d); - for (d = new Fyd(Wod(a.c)); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 79); - g = itd(c2, true, true); - o2 = jtd(c2); - q = ltd(c2); - p = new f7c(o2.i + o2.g / 2, o2.j + o2.f / 2); - f2 = new f7c(q.i + q.g / 2, q.j + q.f / 2); - r = c7c(new f7c(f2.a, f2.b), p); - l6c(r, o2.g, o2.f); - P6c(p, r); - s = c7c(new f7c(p.a, p.b), f2); - l6c(s, q.g, q.f); - P6c(f2, s); - nmd(g, p.a, p.b); - gmd(g, f2.a, f2.b); - } - } - function EYb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2; - a.c = a.d; - o2 = DD(vNb(b, (Nyc(), gyc))); - n = o2 == null || (uCb(o2), o2); - f2 = BD(vNb(b, (wtc(), Ksc)), 21).Hc((Orc(), Hrc)); - e = BD(vNb(b, Vxc), 98); - c2 = !(e == (dcd(), Zbd) || e == _bd || e == $bd); - if (n && (c2 || !f2)) { - for (l = new olb(b.a); l.a < l.c.c.length; ) { - j = BD(mlb(l), 10); - j.p = 0; - } - m = new Rkb(); - for (k = new olb(b.a); k.a < k.c.c.length; ) { - j = BD(mlb(k), 10); - d = DYb(a, j, null); - if (d) { - i3 = new XZb(); - tNb(i3, b); - yNb(i3, Esc, BD(d.b, 21)); - u_b(i3.d, b.d); - yNb(i3, Hxc, null); - for (h = BD(d.a, 15).Kc(); h.Ob(); ) { - g = BD(h.Pb(), 10); - Ekb(i3.a, g); - g.a = i3; - } - m.Fc(i3); - } - } - f2 && (PD(vNb(b, twc)) === PD((RXb(), OXb)) ? a.c = a.b : a.c = a.a); - } else { - m = new amb(OC(GC(KQ, 1), cne, 37, 0, [b])); - } - PD(vNb(b, twc)) !== PD((RXb(), QXb)) && (mmb(), m.ad(new HYb())); - return m; - } - function KTc(a) { - r4c(a, new E3c(Q3c(L3c(P3c(M3c(O3c(N3c(new R3c(), are), "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 NTc()), bre), pqb((Csd(), wsd))))); - p4c(a, are, ame, CTc); - p4c(a, are, wme, 20); - p4c(a, are, _le, tme); - p4c(a, are, vme, meb(1)); - p4c(a, are, zme, (Bcb(), true)); - p4c(a, are, Zpe, Ksd(vTc)); - p4c(a, are, Fme, Ksd(xTc)); - p4c(a, are, Tme, Ksd(yTc)); - p4c(a, are, Eme, Ksd(zTc)); - p4c(a, are, Gme, Ksd(wTc)); - p4c(a, are, Dme, Ksd(ATc)); - p4c(a, are, Hme, Ksd(DTc)); - p4c(a, are, Zqe, Ksd(ITc)); - p4c(a, are, $qe, Ksd(FTc)); - } - function zod(a) { - if (a.q) - return; - a.q = true; - a.p = Lnd(a, 0); - a.a = Lnd(a, 1); - Qnd(a.a, 0); - a.f = Lnd(a, 2); - Qnd(a.f, 1); - Knd(a.f, 2); - a.n = Lnd(a, 3); - Knd(a.n, 3); - Knd(a.n, 4); - Knd(a.n, 5); - Knd(a.n, 6); - a.g = Lnd(a, 4); - Qnd(a.g, 7); - Knd(a.g, 8); - a.c = Lnd(a, 5); - Qnd(a.c, 7); - Qnd(a.c, 8); - a.i = Lnd(a, 6); - Qnd(a.i, 9); - Qnd(a.i, 10); - Qnd(a.i, 11); - Qnd(a.i, 12); - Knd(a.i, 13); - a.j = Lnd(a, 7); - Qnd(a.j, 9); - a.d = Lnd(a, 8); - Qnd(a.d, 3); - Qnd(a.d, 4); - Qnd(a.d, 5); - Qnd(a.d, 6); - Knd(a.d, 7); - Knd(a.d, 8); - Knd(a.d, 9); - Knd(a.d, 10); - a.b = Lnd(a, 9); - Knd(a.b, 0); - Knd(a.b, 1); - a.e = Lnd(a, 10); - Knd(a.e, 1); - Knd(a.e, 2); - Knd(a.e, 3); - Knd(a.e, 4); - Qnd(a.e, 5); - Qnd(a.e, 6); - Qnd(a.e, 7); - Qnd(a.e, 8); - Qnd(a.e, 9); - Qnd(a.e, 10); - Knd(a.e, 11); - a.k = Lnd(a, 11); - Knd(a.k, 0); - Knd(a.k, 1); - a.o = Mnd(a, 12); - a.s = Mnd(a, 13); - } - function AUb(a, b) { - b.dc() && HVb(a.j, true, true, true, true); - pb(b, (Ucd(), Gcd)) && HVb(a.j, true, true, true, false); - pb(b, Bcd) && HVb(a.j, false, true, true, true); - pb(b, Ocd) && HVb(a.j, true, true, false, true); - pb(b, Qcd) && HVb(a.j, true, false, true, true); - pb(b, Hcd) && HVb(a.j, false, true, true, false); - pb(b, Ccd) && HVb(a.j, false, true, false, true); - pb(b, Pcd) && HVb(a.j, true, false, false, true); - pb(b, Ncd) && HVb(a.j, true, false, true, false); - pb(b, Lcd) && HVb(a.j, true, true, true, true); - pb(b, Ecd) && HVb(a.j, true, true, true, true); - pb(b, Lcd) && HVb(a.j, true, true, true, true); - pb(b, Dcd) && HVb(a.j, true, true, true, true); - pb(b, Mcd) && HVb(a.j, true, true, true, true); - pb(b, Kcd) && HVb(a.j, true, true, true, true); - pb(b, Jcd) && HVb(a.j, true, true, true, true); - } - function rZb(a, b, c2, d, e) { - var f2, g, h, i3, j, k, l, m, n, o2, p, q; - f2 = new Rkb(); - for (j = new olb(d); j.a < j.c.c.length; ) { - h = BD(mlb(j), 441); - g = null; - if (h.f == (KAc(), IAc)) { - for (o2 = new olb(h.e); o2.a < o2.c.c.length; ) { - n = BD(mlb(o2), 17); - q = n.d.i; - if (Q_b(q) == b) { - iZb(a, b, h, n, h.b, n.d); - } else if (!c2 || f_b(q, c2)) { - jZb(a, b, h, d, n); - } else { - m = oZb(a, b, c2, n, h.b, IAc, g); - m != g && (f2.c[f2.c.length] = m, true); - m.c && (g = m); - } - } - } else { - for (l = new olb(h.e); l.a < l.c.c.length; ) { - k = BD(mlb(l), 17); - p = k.c.i; - if (Q_b(p) == b) { - iZb(a, b, h, k, k.c, h.b); - } else if (!c2 || f_b(p, c2)) { - continue; - } else { - m = oZb(a, b, c2, k, h.b, HAc, g); - m != g && (f2.c[f2.c.length] = m, true); - m.c && (g = m); - } - } - } - } - for (i3 = new olb(f2); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 441); - Jkb(b.a, h.a, 0) != -1 || Ekb(b.a, h.a); - h.c && (e.c[e.c.length] = h, true); - } + for (var i2 = 0; i2 < arr.length; i2++) { + this.add(arr[i2]); } - function SJc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m; - j = new Rkb(); - for (i3 = new olb(b.a); i3.a < i3.c.c.length; ) { - g = BD(mlb(i3), 10); - for (m = V_b(g, (Ucd(), zcd)).Kc(); m.Ob(); ) { - l = BD(m.Pb(), 11); - for (e = new olb(l.g); e.a < e.c.c.length; ) { - d = BD(mlb(e), 17); - if (!OZb(d) && d.c.i.c == d.d.i.c || OZb(d) || d.d.i.c != c2) { - continue; - } - j.c[j.c.length] = d; - } - } - } - for (h = Su(c2.a).Kc(); h.Ob(); ) { - g = BD(h.Pb(), 10); - for (m = V_b(g, (Ucd(), Tcd)).Kc(); m.Ob(); ) { - l = BD(m.Pb(), 11); - for (e = new olb(l.e); e.a < e.c.c.length; ) { - d = BD(mlb(e), 17); - if (!OZb(d) && d.c.i.c == d.d.i.c || OZb(d) || d.c.i.c != b) { - continue; - } - k = new Bib(j, j.c.length); - f2 = (sCb(k.b > 0), BD(k.a.Xb(k.c = --k.b), 17)); - while (f2 != d && k.b > 0) { - a.a[f2.p] = true; - a.a[d.p] = true; - f2 = (sCb(k.b > 0), BD(k.a.Xb(k.c = --k.b), 17)); - } - k.b > 0 && uib(k); - } - } - } + } + } + __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 Vmd(b, c2, d) { - var e, f2, g, h, i3, j, k, l, m; - if (b.a != c2.Aj()) { - throw vbb(new Wdb(tte + c2.ne() + ute)); - } - e = o1d((O6d(), M6d), c2).$k(); - if (e) { - return e.Aj().Nh().Ih(e, d); - } - h = o1d(M6d, c2).al(); - if (h) { - if (d == null) { - return null; - } - i3 = BD(d, 15); - if (i3.dc()) { - return ""; - } - m = new Hfb(); - for (g = i3.Kc(); g.Ob(); ) { - f2 = g.Pb(); - Efb(m, h.Aj().Nh().Ih(h, f2)); - m.a += " "; - } - return lcb(m, m.a.length - 1); - } - l = o1d(M6d, c2).bl(); - if (!l.dc()) { - for (k = l.Kc(); k.Ob(); ) { - j = BD(k.Pb(), 148); - if (j.wj(d)) { - try { - m = j.Aj().Nh().Ih(j, d); - if (m != null) { - return m; - } - } catch (a) { - a = ubb(a); - if (!JD(a, 102)) - throw vbb(a); - } - } - } - throw vbb(new Wdb("Invalid value: '" + d + "' for datatype :" + c2.ne())); - } - BD(c2, 834).Fj(); - return d == null ? null : JD(d, 172) ? "" + BD(d, 172).a : rb(d) == $J ? CQd(Pmd[0], BD(d, 199)) : fcb(d); - } - function zQc(a) { - var b, c2, d, e, f2, g, h, i3, j, k; - j = new Psb(); - h = new Psb(); - for (f2 = new olb(a); f2.a < f2.c.c.length; ) { - d = BD(mlb(f2), 128); - d.v = 0; - d.n = d.i.c.length; - d.u = d.t.c.length; - d.n == 0 && (Gsb(j, d, j.c.b, j.c), true); - d.u == 0 && d.r.a.gc() == 0 && (Gsb(h, d, h.c.b, h.c), true); - } - g = -1; - while (j.b != 0) { - d = BD(Vt(j, 0), 128); - for (c2 = new olb(d.t); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 268); - 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 && (Gsb(j, k, j.c.b, j.c), true); - } - } - if (g > -1) { - for (e = Jsb(h, 0); e.b != e.d.c; ) { - d = BD(Xsb(e), 128); - d.v = g; - } - while (h.b != 0) { - d = BD(Vt(h, 0), 128); - for (c2 = new olb(d.i); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 268); - i3 = b.a; - if (i3.r.a.gc() != 0) { - continue; - } - i3.v = $wnd.Math.min(i3.v, d.v - 1); - --i3.u; - i3.u == 0 && (Gsb(h, i3, h.c.b, h.c), true); - } - } - } - } - function A6c(a, b, c2, d, e) { - var f2, g, h, i3; - i3 = Pje; - g = false; - h = v6c(a, c7c(new f7c(b.a, b.b), a), P6c(new f7c(c2.a, c2.b), e), c7c(new f7c(d.a, d.b), c2)); - f2 = !!h && !($wnd.Math.abs(h.a - a.a) <= nse && $wnd.Math.abs(h.b - a.b) <= nse || $wnd.Math.abs(h.a - b.a) <= nse && $wnd.Math.abs(h.b - b.b) <= nse); - h = v6c(a, c7c(new f7c(b.a, b.b), a), c2, e); - !!h && (($wnd.Math.abs(h.a - a.a) <= nse && $wnd.Math.abs(h.b - a.b) <= nse) == ($wnd.Math.abs(h.a - b.a) <= nse && $wnd.Math.abs(h.b - b.b) <= nse) || f2 ? i3 = $wnd.Math.min(i3, U6c(c7c(h, c2))) : g = true); - h = v6c(a, c7c(new f7c(b.a, b.b), a), d, e); - !!h && (g || ($wnd.Math.abs(h.a - a.a) <= nse && $wnd.Math.abs(h.b - a.b) <= nse) == ($wnd.Math.abs(h.a - b.a) <= nse && $wnd.Math.abs(h.b - b.b) <= nse) || f2) && (i3 = $wnd.Math.min(i3, U6c(c7c(h, d)))); - return i3; - } - function cTb(a) { - r4c(a, new E3c(L3c(P3c(M3c(O3c(N3c(new R3c(), Rme), Sme), "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 fTb()), ume))); - p4c(a, Rme, Ame, Ksd(VSb)); - p4c(a, Rme, Cme, (Bcb(), true)); - p4c(a, Rme, Fme, Ksd(YSb)); - p4c(a, Rme, Tme, Ksd(ZSb)); - p4c(a, Rme, Eme, Ksd($Sb)); - p4c(a, Rme, Gme, Ksd(XSb)); - p4c(a, Rme, Dme, Ksd(_Sb)); - p4c(a, Rme, Hme, Ksd(aTb)); - p4c(a, Rme, Mme, Ksd(USb)); - p4c(a, Rme, Ome, Ksd(SSb)); - p4c(a, Rme, Pme, Ksd(TSb)); - p4c(a, Rme, Qme, Ksd(WSb)); - p4c(a, Rme, Nme, Ksd(RSb)); - } - function BFc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r; - Odd(b, "Interactive crossing minimization", 1); - g = 0; - for (f2 = new olb(a.b); f2.a < f2.c.c.length; ) { - d = BD(mlb(f2), 29); - d.p = g++; - } - m = WZb(a); - q = new iHc(m.length); - $Ic(new amb(OC(GC(qY, 1), Uhe, 225, 0, [q])), m); - p = 0; - g = 0; - for (e = new olb(a.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 29); - c2 = 0; - l = 0; - for (k = new olb(d.a); k.a < k.c.c.length; ) { - i3 = BD(mlb(k), 10); - if (i3.n.a > 0) { - c2 += i3.n.a + i3.o.a / 2; - ++l; - } - for (o2 = new olb(i3.j); o2.a < o2.c.c.length; ) { - n = BD(mlb(o2), 11); - n.p = p++; - } - } - l > 0 && (c2 /= l); - r = KC(UD, Vje, 25, d.a.c.length, 15, 1); - h = 0; - for (j = new olb(d.a); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 10); - i3.p = h++; - r[i3.p] = AFc(i3, c2); - i3.k == (j0b(), g0b) && yNb(i3, (wtc(), atc), r[i3.p]); - } - mmb(); - Okb(d.a, new GFc(r)); - YDc(q, m, g, true); - ++g; - } - Qdd(b); - } - function Zfe(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - if (b.e == 5) { - Wfe(a, b); - return; - } - j = b; - if (j.b == null || a.b == null) - return; - Yfe(a); - Vfe(a); - Yfe(j); - Vfe(j); - c2 = KC(WD, oje, 25, 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]; - i3 = j.b[g + 1]; - if (f2 < h) { - c2[k++] = a.b[d++]; - c2[k++] = a.b[d++]; - } else if (f2 >= h && e <= i3) { - if (h <= e && f2 <= i3) { - d += 2; - } else if (h <= e) { - a.b[d] = i3 + 1; - g += 2; - } else if (f2 <= i3) { - c2[k++] = e; - c2[k++] = h - 1; - d += 2; - } else { - c2[k++] = e; - c2[k++] = h - 1; - a.b[d] = i3 + 1; - g += 2; - } - } else if (i3 < e) { - g += 2; - } else { - throw vbb(new hz("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 = KC(WD, oje, 25, k, 15, 1); - $fb(c2, 0, a.b, 0, k); + }, "add") + }, { + key: "delete", + value: /* @__PURE__ */ __name(function _delete(val) { + var o2 = this._obj; + if (o2[val] === 1) { + o2[val] = 0; + this.size--; } - function BJb(a) { - var b, c2, d, e, f2, g, h; - if (a.A.dc()) { - return; - } - if (a.A.Hc((tdd(), rdd))) { - BD(Mpb(a.b, (Ucd(), Acd)), 124).k = true; - BD(Mpb(a.b, Rcd), 124).k = true; - b = a.q != (dcd(), _bd) && a.q != $bd; - ZGb(BD(Mpb(a.b, zcd), 124), b); - ZGb(BD(Mpb(a.b, Tcd), 124), b); - ZGb(a.g, b); - if (a.A.Hc(sdd)) { - BD(Mpb(a.b, Acd), 124).j = true; - BD(Mpb(a.b, Rcd), 124).j = true; - BD(Mpb(a.b, zcd), 124).k = true; - BD(Mpb(a.b, Tcd), 124).k = true; - a.g.k = true; - } - } - if (a.A.Hc(qdd)) { - a.a.j = true; - a.a.k = true; - a.g.j = true; - a.g.k = true; - h = a.B.Hc((Idd(), Edd)); - for (e = wJb(), f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - c2 = BD(Mpb(a.i, d), 306); - if (c2) { - if (sJb(d)) { - c2.j = true; - c2.k = true; - } else { - c2.j = !h; - c2.k = !h; - } - } - } - } - if (a.A.Hc(pdd) && a.B.Hc((Idd(), Ddd))) { - 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 GJc(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r; - for (d = new olb(a.e.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 29); - for (f2 = new olb(c2.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 10); - n = a.i[e.p]; - j = n.a.e; - i3 = n.d.e; - e.n.b = j; - r = i3 - j - e.o.b; - b = bKc(e); - m = (Izc(), (!e.q ? (mmb(), mmb(), kmb) : e.q)._b((Nyc(), Cxc)) ? l = BD(vNb(e, Cxc), 197) : l = BD(vNb(Q_b(e), Dxc), 197), l); - b && (m == Fzc || m == Ezc) && (e.o.b += r); - if (b && (m == Hzc || m == Fzc || m == Ezc)) { - for (p = new olb(e.j); p.a < p.c.c.length; ) { - o2 = BD(mlb(p), 11); - if ((Ucd(), Ecd).Hc(o2.j)) { - k = BD(Ohb(a.k, o2), 121); - o2.n.b = k.e - j; - } - } - for (h = new olb(e.b); h.a < h.c.c.length; ) { - g = BD(mlb(h), 70); - q = BD(vNb(e, xxc), 21); - q.Hc((Hbd(), Ebd)) ? g.n.b += r : q.Hc(Fbd) && (g.n.b += r / 2); - } - (m == Fzc || m == Ezc) && V_b(e, (Ucd(), Rcd)).Jc(new $Kc(r)); - } - } + }, "_delete") + }, { + key: "clear", + value: /* @__PURE__ */ __name(function clear30() { + 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 Lwb(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n; - if (!a.b) { - return false; - } - g = null; - m = null; - i3 = new exb(null, null); - e = 1; - i3.a[1] = a.b; - l = i3; - while (l.a[e]) { - j = e; - h = m; - m = l; - l = l.a[e]; - d = a.a.ue(b, l.d); - e = d < 0 ? 0 : 1; - d == 0 && (!c2.c || wtb(l.e, c2.d)) && (g = l); - if (!(!!l && l.b) && !Hwb(l.a[e])) { - if (Hwb(l.a[1 - e])) { - m = m.a[j] = Owb(l, e); - } else if (!Hwb(l.a[1 - e])) { - n = m.a[1 - j]; - if (n) { - if (!Hwb(n.a[1 - j]) && !Hwb(n.a[j])) { - m.b = false; - n.b = true; - l.b = true; - } else { - f2 = h.a[1] == m ? 1 : 0; - Hwb(n.a[j]) ? h.a[f2] = Nwb(m, j) : Hwb(n.a[1 - j]) && (h.a[f2] = Owb(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 exb(l.d, l.e); - Mwb(a, i3, g, k); - m == g && (m = k); - } - m.a[m.a[1] == l ? 1 : 0] = l.a[!l.a[0] ? 1 : 0]; - --a.c; + } + 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"; } - a.b = i3.a[1]; - !!a.b && (a.b.b = false); - return c2.b; + V2[vId] = true; + connectedNodes.push(v4); } - function cic(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m; - for (e = new olb(a.a.a.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 57); - for (i3 = d.c.Kc(); i3.Ob(); ) { - h = BD(i3.Pb(), 57); - if (d.a == h.a) { - continue; - } - fad(a.a.d) ? l = a.a.g.Oe(d, h) : l = a.a.g.Pe(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 (vgc(d, h)) { - g = nGb(new pGb(), a.d); - j = QD($wnd.Math.ceil(h.b.a - d.b.a)); - b = j - (h.b.a - d.b.a); - k = ugc(d).a; - c2 = d; - if (!k) { - k = ugc(h).a; - b = -b; - c2 = h; - } - if (k) { - c2.b.a -= b; - k.n.a -= b; - } - AFb(DFb(CFb(EFb(BFb(new FFb(), $wnd.Math.max(0, j)), 1), g), a.c[d.a.d])); - AFb(DFb(CFb(EFb(BFb(new FFb(), $wnd.Math.max(0, -j)), 1), g), a.c[h.a.d])); - } else { - m = 1; - (JD(d.g, 145) && JD(h.g, 10) || JD(h.g, 145) && JD(d.g, 10)) && (m = 2); - AFb(DFb(CFb(EFb(BFb(new FFb(), QD(f2)), m), a.c[d.a.d]), a.c[h.a.d])); - } - } - } - } - function pEc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m; - if (c2) { - d = -1; - k = new Bib(b, 0); - while (k.b < k.d.gc()) { - h = (sCb(k.b < k.d.gc()), BD(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 Bib(b, k.b); - while (f2.b < f2.d.gc()) { - m = tEc(a, (sCb(f2.b < f2.d.gc()), BD(f2.d.Xb(f2.c = f2.b++), 10))).a; - if (m != null) { - g = (uCb(m), m); - break; - } - } - l = (d + g) / 2; - a.c[h.c.p][h.p].a = l; - a.c[h.c.p][h.p].d = (uCb(l), l); - a.c[h.c.p][h.p].b = 1; - } - d = (uCb(l), l); - } - } else { - e = 0; - for (j = new olb(b); j.a < j.c.c.length; ) { - h = BD(mlb(j), 10); - a.c[h.c.p][h.p].a != null && (e = $wnd.Math.max(e, Edb(a.c[h.c.p][h.p].a))); - } - e += 2; - for (i3 = new olb(b); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 10); - if (a.c[h.c.p][h.p].a == null) { - l = Cub(a.i, 24) * lke * 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 CZd() { - rEd(b5, new i$d()); - rEd(a5, new P$d()); - rEd(c5, new u_d()); - rEd(d5, new M_d()); - rEd(f5, new P_d()); - rEd(h5, new S_d()); - rEd(g5, new V_d()); - rEd(i5, new Y_d()); - rEd(k5, new GZd()); - rEd(l5, new JZd()); - rEd(m5, new MZd()); - rEd(n5, new PZd()); - rEd(o5, new SZd()); - rEd(p5, new VZd()); - rEd(q5, new YZd()); - rEd(t5, new _Zd()); - rEd(v52, new c$d()); - rEd(x6, new f$d()); - rEd(j5, new l$d()); - rEd(u5, new o$d()); - rEd(wI, new r$d()); - rEd(GC(SD, 1), new u$d()); - rEd(xI, new x$d()); - rEd(yI, new A$d()); - rEd($J, new D$d()); - rEd(O4, new G$d()); - rEd(BI, new J$d()); - rEd(T4, new M$d()); - rEd(U4, new S$d()); - rEd(O9, new V$d()); - rEd(E9, new Y$d()); - rEd(FI, new _$d()); - rEd(JI, new c_d()); - rEd(AI, new f_d()); - rEd(MI, new i_d()); - rEd(DK, new l_d()); - rEd(v8, new o_d()); - rEd(u8, new r_d()); - rEd(UI, new x_d()); - rEd(ZI, new A_d()); - rEd(X4, new D_d()); - rEd(V4, new G_d()); - } - function hA(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l; - !c2 && (c2 = TA(b.q.getTimezoneOffset())); - e = (b.q.getTimezoneOffset() - c2.a) * 6e4; - h = new gB(wbb(Cbb(b.q.getTime()), e)); - i3 = h; - if (h.q.getTimezoneOffset() != b.q.getTimezoneOffset()) { - e > 0 ? e -= 864e5 : e += 864e5; - i3 = new gB(wbb(Cbb(b.q.getTime()), e)); - } - k = new Vfb(); - j = a.a.length; - for (f2 = 0; f2 < j; ) { - d = bfb(a.a, f2); - if (d >= 97 && d <= 122 || d >= 65 && d <= 90) { - for (g = f2 + 1; g < j && bfb(a.a, g) == d; ++g) - ; - vA(k, d, g - f2, h, i3, c2); - f2 = g; - } else if (d == 39) { - ++f2; - if (f2 < j && bfb(a.a, f2) == 39) { - k.a += "'"; - ++f2; - continue; - } - l = false; - while (!l) { - g = f2; - while (g < j && bfb(a.a, g) != 39) { - ++g; - } - if (g >= j) { - throw vbb(new Wdb("Missing trailing '")); - } - g + 1 < j && bfb(a.a, g + 1) == 39 ? ++g : l = true; - Qfb(k, qfb(a.a, f2, g)); - f2 = g + 1; - } - } else { - k.a += String.fromCharCode(d); - ++f2; - } - } - return k.a; - } - function MEc(a) { - var b, c2, d, e, f2, g, h, i3; - b = null; - for (d = new olb(a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 233); - Edb(REc(c2.g, c2.d[0]).a); - c2.b = null; - if (!!c2.e && c2.e.gc() > 0 && c2.c == 0) { - !b && (b = new Rkb()); - b.c[b.c.length] = c2; - } - } - if (b) { - while (b.c.length != 0) { - c2 = BD(Kkb(b, 0), 233); - if (!!c2.b && c2.b.c.length > 0) { - for (f2 = (!c2.b && (c2.b = new Rkb()), new olb(c2.b)); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 233); - if (Gdb(REc(e.g, e.d[0]).a) == Gdb(REc(c2.g, c2.d[0]).a)) { - if (Jkb(a, e, 0) > Jkb(a, c2, 0)) { - return new vgd(e, c2); - } - } else if (Edb(REc(e.g, e.d[0]).a) > Edb(REc(c2.g, c2.d[0]).a)) { - return new vgd(e, c2); - } - } - } - for (h = (!c2.e && (c2.e = new Rkb()), c2.e).Kc(); h.Ob(); ) { - g = BD(h.Pb(), 233); - i3 = (!g.b && (g.b = new Rkb()), g.b); - wCb(0, i3.c.length); - aCb(i3.c, 0, c2); - g.c == i3.c.length && (b.c[b.c.length] = g, true); - } - } - } - return null; + 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 wlb(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - if (a == null) { - return Xhe; - } - i3 = b.a.zc(a, b); - if (i3 != null) { - return "[...]"; - } - c2 = new xwb(She, "[", "]"); - 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 = HC(d), !(k >= 14 && k <= 16))) { - if (b.a._b(d)) { - !c2.a ? c2.a = new Wfb(c2.d) : Qfb(c2.a, c2.b); - Nfb(c2.a, "[...]"); - } else { - h = CD(d); - j = new Vqb(b); - uwb(c2, wlb(h, j)); - } - } else - JD(d, 177) ? uwb(c2, Xlb(BD(d, 177))) : JD(d, 190) ? uwb(c2, Qlb(BD(d, 190))) : JD(d, 195) ? uwb(c2, Rlb(BD(d, 195))) : JD(d, 2012) ? uwb(c2, Wlb(BD(d, 2012))) : JD(d, 48) ? uwb(c2, Ulb(BD(d, 48))) : JD(d, 364) ? uwb(c2, Vlb(BD(d, 364))) : JD(d, 832) ? uwb(c2, Tlb(BD(d, 832))) : JD(d, 104) && uwb(c2, Slb(BD(d, 104))); - } else { - uwb(c2, d == null ? Xhe : fcb(d)); - } - } - return !c2.a ? c2.c : c2.e.length == 0 ? c2.a.a : c2.a.a + ("" + c2.e); - } - function xQb(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4; - h = itd(b, false, false); - r = ofd(h); - d && (r = w7c(r)); - t4 = Edb(ED(hkd(b, (CPb(), vPb)))); - q = (sCb(r.b != 0), BD(r.a.a.c, 8)); - l = BD(Ut(r, 1), 8); - if (r.b > 2) { - k = new Rkb(); - Gkb(k, new Jib(r, 1, r.b)); - f2 = sQb(k, t4 + a.a); - s = new XOb(f2); - tNb(s, b); - c2.c[c2.c.length] = s; - } else { - d ? s = BD(Ohb(a.b, jtd(b)), 266) : s = BD(Ohb(a.b, ltd(b)), 266); - } - i3 = jtd(b); - d && (i3 = ltd(b)); - g = zQb(q, i3); - j = t4 + a.a; - if (g.a) { - j += $wnd.Math.abs(q.b - l.b); - p = new f7c(l.a, (l.b + q.b) / 2); - } else { - j += $wnd.Math.abs(q.a - l.a); - p = new f7c((l.a + q.a) / 2, l.b); - } - d ? Rhb(a.d, b, new ZOb(s, g, p, j)) : Rhb(a.c, b, new ZOb(s, g, p, j)); - Rhb(a.b, b, s); - o2 = (!b.n && (b.n = new cUd(D2, b, 1, 7)), b.n); - for (n = new Fyd(o2); n.e != n.i.gc(); ) { - m = BD(Dyd(n), 137); - e = wQb(a, m, true, 0, 0); - c2.c[c2.c.length] = e; - } - } - function wPc(a) { - var b, c2, d, e, f2, g, h, i3, j, k; - j = new Rkb(); - h = new Rkb(); - for (g = new olb(a); g.a < g.c.c.length; ) { - e = BD(mlb(g), 112); - pOc(e, e.f.c.length); - qOc(e, e.k.c.length); - e.d == 0 && (j.c[j.c.length] = e, true); - e.i == 0 && e.e.b == 0 && (h.c[h.c.length] = e, true); - } - d = -1; - while (j.c.length != 0) { - e = BD(Kkb(j, 0), 112); - for (c2 = new olb(e.k); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 129); - k = b.b; - rOc(k, $wnd.Math.max(k.o, e.o + 1)); - d = $wnd.Math.max(d, k.o); - pOc(k, k.d - 1); - k.d == 0 && (j.c[j.c.length] = k, true); - } - } - if (d > -1) { - for (f2 = new olb(h); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 112); - e.o = d; - } - while (h.c.length != 0) { - e = BD(Kkb(h, 0), 112); - for (c2 = new olb(e.f); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 129); - i3 = b.a; - if (i3.e.b > 0) { - continue; - } - rOc(i3, $wnd.Math.min(i3.o, e.o - 1)); - qOc(i3, i3.i - 1); - i3.i == 0 && (h.c[h.c.length] = i3, true); - } - } - } - } - function QQd(a, b, c2) { - var d, e, f2, g, h, i3, j; - j = a.c; - !b && (b = FQd); - a.c = b; - if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - i3 = new nSd(a, 1, 2, j, a.c); - !c2 ? c2 = i3 : c2.Ei(i3); - } - if (j != b) { - if (JD(a.Cb, 284)) { - if (a.Db >> 16 == -10) { - c2 = BD(a.Cb, 284).nk(b, c2); - } else if (a.Db >> 16 == -15) { - !b && (b = (jGd(), YFd)); - !j && (j = (jGd(), YFd)); - if (a.Cb.nh()) { - i3 = new pSd(a.Cb, 1, 13, j, b, HLd(QSd(BD(a.Cb, 59)), a), false); - !c2 ? c2 = i3 : c2.Ei(i3); - } - } - } else if (JD(a.Cb, 88)) { - if (a.Db >> 16 == -23) { - JD(b, 88) || (b = (jGd(), _Fd)); - JD(j, 88) || (j = (jGd(), _Fd)); - if (a.Cb.nh()) { - i3 = new pSd(a.Cb, 1, 10, j, b, HLd(VKd(BD(a.Cb, 26)), a), false); - !c2 ? c2 = i3 : c2.Ei(i3); - } - } - } else if (JD(a.Cb, 444)) { - h = BD(a.Cb, 836); - g = (!h.b && (h.b = new RYd(new NYd())), h.b); - for (f2 = (d = new nib(new eib(g.a).a), new ZYd(d)); f2.a.b; ) { - e = BD(lib(f2.a).cd(), 87); - c2 = QQd(e, MQd(e, h), c2); - } - } - } - return c2; - } - function O1b(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m; - g = Ccb(DD(hkd(a, (Nyc(), fxc)))); - m = BD(hkd(a, Yxc), 21); - i3 = false; - j = false; - l = new Fyd((!a.c && (a.c = new cUd(F2, a, 9, 9)), a.c)); - while (l.e != l.i.gc() && (!i3 || !j)) { - f2 = BD(Dyd(l), 118); - h = 0; - for (e = ul(pl(OC(GC(KI, 1), Uhe, 20, 0, [(!f2.d && (f2.d = new y5d(B2, f2, 8, 5)), f2.d), (!f2.e && (f2.e = new y5d(B2, f2, 7, 4)), f2.e)]))); Qr(e); ) { - d = BD(Rr(e), 79); - k = g && Qld(d) && Ccb(DD(hkd(d, gxc))); - c2 = ELd((!d.b && (d.b = new y5d(z2, d, 4, 7)), d.b), f2) ? a == Xod(atd(BD(qud((!d.c && (d.c = new y5d(z2, d, 5, 8)), d.c), 0), 82))) : a == Xod(atd(BD(qud((!d.b && (d.b = new y5d(z2, d, 4, 7)), d.b), 0), 82))); - if (k || c2) { - ++h; - if (h > 1) { - break; - } - } - } - h > 0 ? i3 = true : m.Hc((rcd(), ncd)) && (!f2.n && (f2.n = new cUd(D2, f2, 1, 7)), f2.n).i > 0 && (i3 = true); - h > 1 && (j = true); - } - i3 && b.Fc((Orc(), Hrc)); - j && b.Fc((Orc(), Irc)); + if (ret === false) { + return "break"; } - function zfd(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m; - m = BD(hkd(a, (Y9c(), Y8c)), 21); - if (m.dc()) { - return null; - } - h = 0; - g = 0; - if (m.Hc((tdd(), rdd))) { - k = BD(hkd(a, t9c), 98); - d = 2; - c2 = 2; - e = 2; - f2 = 2; - b = !Xod(a) ? BD(hkd(a, z8c), 103) : BD(hkd(Xod(a), z8c), 103); - for (j = new Fyd((!a.c && (a.c = new cUd(F2, a, 9, 9)), a.c)); j.e != j.i.gc(); ) { - i3 = BD(Dyd(j), 118); - l = BD(hkd(i3, A9c), 61); - if (l == (Ucd(), Scd)) { - l = lfd(i3, b); - jkd(i3, A9c, l); - } - if (k == (dcd(), $bd)) { - switch (l.g) { - case 1: - d = $wnd.Math.max(d, i3.i + i3.g); - break; - case 2: - c2 = $wnd.Math.max(c2, i3.j + i3.f); - break; - case 3: - e = $wnd.Math.max(e, i3.i + i3.g); - break; - case 4: - f2 = $wnd.Math.max(f2, i3.j + i3.f); - } - } else { - switch (l.g) { - case 1: - d += i3.g + 2; - break; - case 2: - c2 += i3.f + 2; - break; - case 3: - e += i3.g + 2; - break; - case 4: - f2 += i3.f + 2; - } - } + 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); } - h = $wnd.Math.max(d, e); - g = $wnd.Math.max(c2, f2); + connectedBy[wId] = e3; + id2depth[wId] = id2depth[vId] + 1; } - return Afd(a, h, g, true, true); } - function lnc(a, b, c2, d, e) { - var f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2; - s = BD(GAb(VAb(JAb(new YAb(null, new Kub(b.d, 16)), new pnc(c2)), new rnc(c2)), Byb(new fzb(), new dzb(), new Ezb(), OC(GC(xL, 1), Kie, 132, 0, [(Fyb(), Dyb)]))), 15); - l = Ohe; - k = Rie; - for (i3 = new olb(b.b.j); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 11); - if (h.j == c2) { - l = $wnd.Math.min(l, h.p); - k = $wnd.Math.max(k, h.p); - } - } - if (l == Ohe) { - for (g = 0; g < s.gc(); g++) { - ojc(BD(s.Xb(g), 101), c2, g); - } - } else { - t4 = KC(WD, oje, 25, e.length, 15, 1); - Elb(t4, t4.length); - for (r = s.Kc(); r.Ob(); ) { - q = BD(r.Pb(), 101); - f2 = BD(Ohb(a.b, q), 177); - j = 0; - for (p = l; p <= k; p++) { - f2[p] && (j = $wnd.Math.max(j, d[p])); - } - if (q.i) { - n = q.i.c; - u2 = new Tqb(); - for (m = 0; m < e.length; m++) { - e[n][m] && Qqb(u2, meb(t4[m])); - } - while (Rqb(u2, meb(j))) { - ++j; - } - } - ojc(q, c2, j); - for (o2 = l; o2 <= k; o2++) { - f2[o2] && (d[o2] = j + 1); - } - !!q.i && (t4[q.i.c] = j); - } - } - } - function YJc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p; - e = null; - for (d = new olb(b.a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 10); - bKc(c2) ? f2 = (h = nGb(oGb(new pGb(), c2), a.f), i3 = nGb(oGb(new pGb(), c2), a.f), j = new rKc(c2, true, h, i3), k = c2.o.b, l = (Izc(), (!c2.q ? (mmb(), mmb(), kmb) : c2.q)._b((Nyc(), Cxc)) ? m = BD(vNb(c2, Cxc), 197) : m = BD(vNb(Q_b(c2), Dxc), 197), m), n = 1e4, l == Ezc && (n = 1), o2 = AFb(DFb(CFb(BFb(EFb(new FFb(), n), QD($wnd.Math.ceil(k))), h), i3)), l == Fzc && Qqb(a.d, o2), ZJc(a, Su(V_b(c2, (Ucd(), Tcd))), j), ZJc(a, V_b(c2, zcd), j), j) : f2 = (p = nGb(oGb(new pGb(), c2), a.f), MAb(JAb(new YAb(null, new Kub(c2.j, 16)), new EKc()), new GKc(a, p)), new rKc(c2, false, p, p)); - a.i[c2.p] = f2; - if (e) { - g = e.c.d.a + jBc(a.n, e.c, c2) + c2.d.d; - e.b || (g += e.c.o.b); - AFb(DFb(CFb(EFb(BFb(new FFb(), QD($wnd.Math.ceil(g))), 0), e.d), f2.a)); - } - e = f2; - } - } - function s9b(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p; - Odd(b, "Label dummy insertions", 1); - l = new Rkb(); - g = Edb(ED(vNb(a, (Nyc(), nyc)))); - j = Edb(ED(vNb(a, ryc))); - k = BD(vNb(a, Lwc), 103); - for (n = new olb(a.a); n.a < n.c.c.length; ) { - m = BD(mlb(n), 10); - for (f2 = new Sr(ur(U_b(m).a.Kc(), new Sq())); Qr(f2); ) { - e = BD(Rr(f2), 17); - if (e.c.i != e.d.i && Lq(e.b, p9b)) { - p = t9b(e); - o2 = Pu(e.b.c.length); - c2 = r9b(a, e, p, o2); - l.c[l.c.length] = c2; - d = c2.o; - h = new Bib(e.b, 0); - while (h.b < h.d.gc()) { - i3 = (sCb(h.b < h.d.gc()), BD(h.d.Xb(h.c = h.b++), 70)); - if (PD(vNb(i3, Qwc)) === PD((qad(), nad))) { - if (k == (ead(), dad) || k == _9c) { - d.a += i3.o.a + j; - d.b = $wnd.Math.max(d.b, i3.o.b); - } else { - d.a = $wnd.Math.max(d.a, i3.o.a); - d.b += i3.o.b + j; - } - o2.c[o2.c.length] = i3; - uib(h); - } - } - if (k == (ead(), dad) || k == _9c) { - d.a -= j; - d.b += g + p; - } else { - d.b += g - j + p; - } - } - } - } - Gkb(a.a, l); - Qdd(b); - } - function eYb(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n; - f2 = new qYb(b); - l = _Xb(a, b, f2); - n = $wnd.Math.max(Edb(ED(vNb(b, (Nyc(), Zwc)))), 1); - for (k = new olb(l.a); k.a < k.c.c.length; ) { - j = BD(mlb(k), 46); - i3 = dYb(BD(j.a, 8), BD(j.b, 8), n); - o = true; - o = o & iYb(c2, new f7c(i3.c, i3.d)); - o = o & iYb(c2, O6c(new f7c(i3.c, i3.d), i3.b, 0)); - o = o & iYb(c2, O6c(new f7c(i3.c, i3.d), 0, i3.a)); - o & iYb(c2, O6c(new f7c(i3.c, i3.d), i3.b, i3.a)); - } - m = f2.d; - h = dYb(BD(l.b.a, 8), BD(l.b.b, 8), n); - if (m == (Ucd(), Tcd) || m == zcd) { - 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 = Qje; - 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 eKd(b) { - var c2, d, e, f2; - d = b.D != null ? b.D : b.B; - c2 = hfb(d, wfb(91)); - if (c2 != -1) { - e = d.substr(0, c2); - f2 = new Hfb(); - do - f2.a += "["; - while ((c2 = gfb(d, 91, ++c2)) != -1); - if (dfb(e, Khe)) - f2.a += "Z"; - else if (dfb(e, Eve)) - f2.a += "B"; - else if (dfb(e, Fve)) - f2.a += "C"; - else if (dfb(e, Gve)) - f2.a += "D"; - else if (dfb(e, Hve)) - f2.a += "F"; - else if (dfb(e, Ive)) - f2.a += "I"; - else if (dfb(e, Jve)) - f2.a += "J"; - else if (dfb(e, Kve)) - f2.a += "S"; - else { - f2.a += "L"; - f2.a += "" + e; - f2.a += ";"; - } - try { - return null; - } catch (a) { - a = ubb(a); - if (!JD(a, 60)) - throw vbb(a); - } - } else if (hfb(d, wfb(46)) == -1) { - if (dfb(d, Khe)) - return sbb; - else if (dfb(d, Eve)) - return SD; - else if (dfb(d, Fve)) - return TD; - else if (dfb(d, Gve)) - return UD; - else if (dfb(d, Hve)) - return VD; - else if (dfb(d, Ive)) - return WD; - else if (dfb(d, Jve)) - return XD; - else if (dfb(d, Kve)) - return rbb; - } - return null; + }, "_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 $1b(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - j = new b0b(c2); - tNb(j, b); - yNb(j, (wtc(), $sc), b); - j.o.a = b.g; - j.o.b = b.f; - j.n.a = b.i; - j.n.b = b.j; - Ekb(c2.a, j); - Rhb(a.a, b, j); - ((!b.a && (b.a = new cUd(E2, b, 10, 11)), b.a).i != 0 || Ccb(DD(hkd(b, (Nyc(), fxc))))) && yNb(j, wsc, (Bcb(), true)); - i3 = BD(vNb(c2, Ksc), 21); - k = BD(vNb(j, (Nyc(), Vxc)), 98); - k == (dcd(), ccd) ? yNb(j, Vxc, bcd) : k != bcd && i3.Fc((Orc(), Krc)); - d = BD(vNb(c2, Lwc), 103); - for (h = new Fyd((!b.c && (b.c = new cUd(F2, b, 9, 9)), b.c)); h.e != h.i.gc(); ) { - g = BD(Dyd(h), 118); - Ccb(DD(hkd(g, Jxc))) || _1b(a, g, j, i3, d, k); - } - for (f2 = new Fyd((!b.n && (b.n = new cUd(D2, b, 1, 7)), b.n)); f2.e != f2.i.gc(); ) { - e = BD(Dyd(f2), 137); - !Ccb(DD(hkd(e, Jxc))) && !!e.a && Ekb(j.b, Z1b(e)); - } - Ccb(DD(vNb(j, pwc))) && i3.Fc((Orc(), Frc)); - if (Ccb(DD(vNb(j, exc)))) { - i3.Fc((Orc(), Jrc)); - i3.Fc(Irc); - yNb(j, Vxc, bcd); - } - return j; - } - function F4b(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3; - h = BD(Ohb(b.c, a), 459); - s = b.a.c; - i3 = b.a.c + b.a.b; - C = h.f; - D3 = h.a; - g = C < D3; - p = new f7c(s, C); - t4 = new f7c(i3, D3); - e = (s + i3) / 2; - q = new f7c(e, C); - u2 = new f7c(e, D3); - f2 = G4b(a, C, D3); - w2 = A0b(b.B); - A = new f7c(e, f2); - B = A0b(b.D); - c2 = j6c(OC(GC(m1, 1), nie, 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 = BD(Ikb(r.c.a, m), 10); - d = I4b(l); - n = !(s6c(d, w2, c2[0]) || n6c(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 = BD(Ikb(v.c.a, m), 10); - d = I4b(l); - o2 = !(s6c(d, c2[0], B) || n6c(d, c2[0], B)); - } else { - o2 = true; - } - } - n && o2 && Dsb(a.a, A); - n || n7c(a.a, OC(GC(m1, 1), nie, 8, 0, [p, q])); - o2 || n7c(a.a, OC(GC(m1, 1), nie, 8, 0, [u2, t4])); + 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 yfd(a, b) { - var c2, d, e, f2, g, h, i3, j; - if (JD(a.Ug(), 160)) { - yfd(BD(a.Ug(), 160), b); - b.a += " > "; - } else { - b.a += "Root "; - } - c2 = a.Tg().zb; - dfb(c2.substr(0, 3), "Elk") ? Qfb(b, c2.substr(3)) : (b.a += "" + c2, b); - e = a.zg(); - if (e) { - Qfb((b.a += " ", b), e); - return; - } - if (JD(a, 354)) { - j = BD(a, 137).a; - if (j) { - Qfb((b.a += " ", b), j); - return; - } - } - for (g = new Fyd(a.Ag()); g.e != g.i.gc(); ) { - f2 = BD(Dyd(g), 137); - j = f2.a; - if (j) { - Qfb((b.a += " ", b), j); - return; - } - } - if (JD(a, 352)) { - d = BD(a, 79); - !d.b && (d.b = new y5d(z2, d, 4, 7)); - if (d.b.i != 0 && (!d.c && (d.c = new y5d(z2, d, 5, 8)), d.c.i != 0)) { - b.a += " ("; - h = new Oyd((!d.b && (d.b = new y5d(z2, d, 4, 7)), d.b)); - while (h.e != h.i.gc()) { - h.e > 0 && (b.a += She, b); - yfd(BD(Dyd(h), 160), b); - } - b.a += gne; - i3 = new Oyd((!d.c && (d.c = new y5d(z2, d, 5, 8)), d.c)); - while (i3.e != i3.i.gc()) { - i3.e > 0 && (b.a += She, b); - yfd(BD(Dyd(i3), 160), b); - } - b.a += ")"; - } - } + if (x5 > y5) { + return 1; } - function y2b(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n; - f2 = BD(vNb(a, (wtc(), $sc)), 79); - if (!f2) { - return; - } - d = a.a; - e = new g7c(c2); - P6c(e, C2b(a)); - if (f_b(a.d.i, a.c.i)) { - m = a.c; - l = l7c(OC(GC(m1, 1), nie, 8, 0, [m.n, m.a])); - c7c(l, c2); - } else { - l = A0b(a.c); - } - Gsb(d, l, d.a, d.a.a); - n = A0b(a.d); - vNb(a, utc) != null && P6c(n, BD(vNb(a, utc), 8)); - Gsb(d, n, d.c.b, d.c); - q7c(d, e); - g = itd(f2, true, true); - kmd(g, BD(qud((!f2.b && (f2.b = new y5d(z2, f2, 4, 7)), f2.b), 0), 82)); - lmd(g, BD(qud((!f2.c && (f2.c = new y5d(z2, f2, 5, 8)), f2.c), 0), 82)); - ifd(d, g); - for (k = new olb(a.b); k.a < k.c.c.length; ) { - j = BD(mlb(k), 70); - h = BD(vNb(j, $sc), 137); - cld(h, j.o.a); - ald(h, j.o.b); - bld(h, j.n.a + e.a, j.n.b + e.b); - jkd(h, (I9b(), H9b), DD(vNb(j, H9b))); - } - i3 = BD(vNb(a, (Nyc(), jxc)), 74); - if (i3) { - q7c(i3, e); - jkd(f2, jxc, i3); - } else { - jkd(f2, jxc, null); - } - b == (Aad(), yad) ? jkd(f2, Swc, yad) : jkd(f2, Swc, null); - } - function mJc(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s; - n = b.c.length; - m = 0; - for (l = new olb(a.b); l.a < l.c.c.length; ) { - k = BD(mlb(l), 29); - r = k.a; - if (r.c.length == 0) { - continue; - } - q = new olb(r); - j = 0; - s = null; - e = BD(mlb(q), 10); - f2 = null; - while (e) { - f2 = BD(Ikb(b, e.p), 257); - if (f2.c >= 0) { - i3 = null; - h = new Bib(k.a, j + 1); - while (h.b < h.d.gc()) { - g = (sCb(h.b < h.d.gc()), BD(h.d.Xb(h.c = h.b++), 10)); - i3 = BD(Ikb(b, g.p), 257); - if (i3.d == f2.d && i3.c < f2.c) { - break; - } else { - i3 = null; - } - } - if (i3) { - if (s) { - Nkb(d, e.p, meb(BD(Ikb(d, e.p), 19).a - 1)); - BD(Ikb(c2, s.p), 15).Mc(f2); - } - f2 = yJc(f2, e, n++); - b.c[b.c.length] = f2; - Ekb(c2, new Rkb()); - if (s) { - BD(Ikb(c2, s.p), 15).Fc(f2); - Ekb(d, meb(1)); - } else { - Ekb(d, meb(0)); - } - } - } - o2 = null; - if (q.a < q.c.c.length) { - o2 = BD(mlb(q), 10); - p = BD(Ikb(b, o2.p), 257); - BD(Ikb(c2, e.p), 15).Fc(p); - Nkb(d, o2.p, meb(BD(Ikb(d, o2.p), 19).a + 1)); - } - f2.d = m; - f2.c = j++; - s = e; - e = o2; - } - ++m; - } - } - function u6c(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4; - i3 = a; - k = c7c(new f7c(b.a, b.b), a); - j = c2; - l = c7c(new f7c(d.a, d.b), c2); - m = i3.a; - q = i3.b; - o2 = j.a; - s = j.b; - n = k.a; - r = k.b; - p = l.a; - t4 = l.b; - e = p * r - n * t4; - Iy(); - My(Jqe); - if ($wnd.Math.abs(0 - e) <= Jqe || 0 == e || isNaN(0) && isNaN(e)) { - return false; - } - g = 1 / e * ((m - o2) * r - (q - s) * n); - h = 1 / e * -(-(m - o2) * t4 + (q - s) * p); - f2 = (My(Jqe), ($wnd.Math.abs(0 - g) <= Jqe || 0 == g || isNaN(0) && isNaN(g) ? 0 : 0 < g ? -1 : 0 > g ? 1 : Ny(isNaN(0), isNaN(g))) < 0 && (My(Jqe), ($wnd.Math.abs(g - 1) <= Jqe || g == 1 || isNaN(g) && isNaN(1) ? 0 : g < 1 ? -1 : g > 1 ? 1 : Ny(isNaN(g), isNaN(1))) < 0) && (My(Jqe), ($wnd.Math.abs(0 - h) <= Jqe || 0 == h || isNaN(0) && isNaN(h) ? 0 : 0 < h ? -1 : 0 > h ? 1 : Ny(isNaN(0), isNaN(h))) < 0) && (My(Jqe), ($wnd.Math.abs(h - 1) <= Jqe || h == 1 || isNaN(h) && isNaN(1) ? 0 : h < 1 ? -1 : h > 1 ? 1 : Ny(isNaN(h), isNaN(1))) < 0)); - return f2; - } - function z6d(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2; - for (l = new usb(new nsb(a)); l.b != l.c.a.d; ) { - k = tsb(l); - h = BD(k.d, 56); - b = BD(k.e, 56); - g = h.Tg(); - for (p = 0, u2 = (g.i == null && TKd(g), g.i).length; p < u2; ++p) { - j = (f2 = (g.i == null && TKd(g), g.i), p >= 0 && p < f2.length ? f2[p] : null); - if (j.Ij() && !j.Jj()) { - if (JD(j, 99)) { - i3 = BD(j, 18); - (i3.Bb & ote) == 0 && (w2 = zUd(i3), !(!!w2 && (w2.Bb & ote) != 0)) && y6d(a, i3, h, b); - } else { - Q6d(); - if (BD(j, 66).Oj()) { - c2 = (v = j, BD(!v ? null : BD(b, 49).xh(v), 153)); - if (c2) { - n = BD(h.ah(j), 153); - d = c2.gc(); - for (q = 0, o2 = n.gc(); q < o2; ++q) { - m = n.il(q); - if (JD(m, 99)) { - t4 = n.jl(q); - e = Wrb(a, t4); - if (e == null && t4 != null) { - s = BD(m, 18); - if (!a.b || (s.Bb & ote) != 0 || !!zUd(s)) { - continue; - } - e = t4; - } - if (!c2.dl(m, e)) { - for (r = 0; r < d; ++r) { - if (c2.il(r) == m && PD(c2.jl(r)) === PD(e)) { - c2.ii(c2.gc() - 1, r); - --d; - break; - } - } - } - } else { - c2.dl(n.il(q), n.jl(q)); - } - } - } - } - } - } - } - } + return 0; + }, "defaultCmp"); + insort = /* @__PURE__ */ __name(function(a2, x5, lo, hi, cmp) { + var mid; + if (lo == null) { + lo = 0; } - function CZc(a, b, c2, d, e, f2, g) { - var h, i3, j, k, l, m, n, o2, p, q, r, s, t4; - r = xZc(b, c2, a.g); - e.n && e.n && !!f2 && Tdd(e, i6d(f2), (pgd(), mgd)); - if (a.b) { - for (q = 0; q < r.c.length; q++) { - l = (tCb(q, r.c.length), BD(r.c[q], 200)); - if (q != 0) { - n = (tCb(q - 1, r.c.length), BD(r.c[q - 1], 200)); - w$c(l, n.f + n.b + a.g); - } - tZc(q, r, c2, a.g); - AZc(a, l); - e.n && !!f2 && Tdd(e, i6d(f2), (pgd(), mgd)); - } + if (cmp == null) { + cmp = defaultCmp; + } + if (lo < 0) { + throw new Error("lo must be non-negative"); + } + if (hi == null) { + hi = a2.length; + } + while (lo < hi) { + mid = floor((lo + hi) / 2); + if (cmp(x5, a2[mid]) < 0) { + hi = mid; } else { - for (p = new olb(r); p.a < p.c.c.length; ) { - o2 = BD(mlb(p), 200); - for (k = new olb(o2.a); k.a < k.c.c.length; ) { - j = BD(mlb(k), 187); - s = new b$c(j.s, j.t, a.g); - WZc(s, j); - Ekb(o2.d, s); - } - } - } - BZc(a, r); - e.n && e.n && !!f2 && Tdd(e, i6d(f2), (pgd(), mgd)); - t4 = $wnd.Math.max(a.d, d.a - (g.b + g.c)); - m = $wnd.Math.max(a.c, d.b - (g.d + g.a)); - h = m - a.c; - if (a.e && a.f) { - i3 = t4 / m; - i3 < a.a ? t4 = m * a.a : h += t4 / a.a - m; - } - a.e && zZc(r, t4, h); - e.n && e.n && !!f2 && Tdd(e, i6d(f2), (pgd(), mgd)); - return new d$c(a.a, t4, a.c + h, (k$c(), j$c)); - } - function UJc(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l; - a.j = KC(WD, oje, 25, a.g, 15, 1); - a.o = new Rkb(); - MAb(LAb(new YAb(null, new Kub(a.e.b, 16)), new aLc()), new cLc(a)); - a.a = KC(sbb, dle, 25, a.b, 16, 1); - TAb(new YAb(null, new Kub(a.e.b, 16)), new rLc(a)); - d = (l = new Rkb(), MAb(JAb(LAb(new YAb(null, new Kub(a.e.b, 16)), new hLc()), new jLc(a)), new lLc(a, l)), l); - for (i3 = new olb(d); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 508); - if (h.c.length <= 1) { - continue; - } - if (h.c.length == 2) { - uKc(h); - bKc((tCb(0, h.c.length), BD(h.c[0], 17)).d.i) || Ekb(a.o, h); - continue; - } - if (tKc(h) || sKc(h, new fLc())) { - continue; - } - j = new olb(h); - e = null; - while (j.a < j.c.c.length) { - b = BD(mlb(j), 17); - c2 = a.c[b.p]; - !e || j.a >= j.c.c.length ? k = JJc((j0b(), h0b), g0b) : k = JJc((j0b(), g0b), g0b); - 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 VNc(a, b, c2, d, e) { - var f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v; - v = Hx(a); - k = new Rkb(); - h = a.c.length; - l = h - 1; - m = h + 1; - while (v.a.c != 0) { - while (c2.b != 0) { - t4 = (sCb(c2.b != 0), BD(Nsb(c2, c2.a.a), 112)); - Jwb(v.a, t4) != null; - t4.g = l--; - YNc(t4, b, c2, d); - } - while (b.b != 0) { - u2 = (sCb(b.b != 0), BD(Nsb(b, b.a.a), 112)); - Jwb(v.a, u2) != null; - u2.g = m++; - YNc(u2, b, c2, d); - } - j = Rie; - for (r = (g = new Ywb(new cxb(new Gjb(v.a).a).b), new Njb(g)); sib(r.a.a); ) { - q = (f2 = Wwb(r.a), BD(f2.cd(), 112)); - if (!d && q.b > 0 && q.a <= 0) { - k.c = KC(SI, Uhe, 1, 0, 5, 1); - k.c[k.c.length] = q; - break; - } - p = q.i - q.d; - if (p >= j) { - if (p > j) { - k.c = KC(SI, Uhe, 1, 0, 5, 1); - j = p; - } - k.c[k.c.length] = q; - } - } - if (k.c.length != 0) { - i3 = BD(Ikb(k, Bub(e, k.c.length)), 112); - Jwb(v.a, i3) != null; - i3.g = m++; - YNc(i3, b, c2, d); - k.c = KC(SI, Uhe, 1, 0, 5, 1); - } - } - s = a.c.length + 1; - for (o2 = new olb(a); o2.a < o2.c.c.length; ) { - n = BD(mlb(o2), 112); - n.g < h && (n.g = n.g + s); + lo = mid + 1; } } - function SDb(a, b) { - var c2; - if (a.e) { - throw vbb(new Zdb((fdb(TM), Jke + TM.k + Kke))); - } - if (!lDb(a.a, b)) { - throw vbb(new hz(Lke + b + Mke)); - } - if (b == a.d) { - return a; - } - c2 = a.d; - a.d = b; - switch (c2.g) { - case 0: - switch (b.g) { - case 2: - PDb(a); - break; - case 1: - XDb(a); - PDb(a); - break; - case 4: - bEb(a); - PDb(a); - break; - case 3: - bEb(a); - XDb(a); - PDb(a); - } - break; - case 2: - switch (b.g) { - case 1: - XDb(a); - YDb(a); - break; - case 4: - bEb(a); - PDb(a); - break; - case 3: - bEb(a); - XDb(a); - PDb(a); - } - break; - case 1: - switch (b.g) { - case 2: - XDb(a); - YDb(a); - break; - case 4: - XDb(a); - bEb(a); - PDb(a); - break; - case 3: - XDb(a); - bEb(a); - XDb(a); - PDb(a); - } - break; - case 4: - switch (b.g) { - case 2: - bEb(a); - PDb(a); - break; - case 1: - bEb(a); - XDb(a); - PDb(a); - break; - case 3: - XDb(a); - YDb(a); - } - break; - case 3: - switch (b.g) { - case 2: - XDb(a); - bEb(a); - PDb(a); - break; - case 1: - XDb(a); - bEb(a); - XDb(a); - PDb(a); - break; - case 4: - XDb(a); - YDb(a); - } - } - return 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 tVb(a, b) { - var c2; - if (a.d) { - throw vbb(new Zdb((fdb(LP), Jke + LP.k + Kke))); - } - if (!cVb(a.a, b)) { - throw vbb(new hz(Lke + b + Mke)); - } - if (b == a.c) { - return a; - } - c2 = a.c; - a.c = b; - switch (c2.g) { - case 0: - switch (b.g) { - case 2: - qVb(a); - break; - case 1: - xVb(a); - qVb(a); - break; - case 4: - BVb(a); - qVb(a); - break; - case 3: - BVb(a); - xVb(a); - qVb(a); - } - break; - case 2: - switch (b.g) { - case 1: - xVb(a); - yVb(a); - break; - case 4: - BVb(a); - qVb(a); - break; - case 3: - BVb(a); - xVb(a); - qVb(a); - } - break; - case 1: - switch (b.g) { - case 2: - xVb(a); - yVb(a); - break; - case 4: - xVb(a); - BVb(a); - qVb(a); - break; - case 3: - xVb(a); - BVb(a); - xVb(a); - qVb(a); - } - break; - case 4: - switch (b.g) { - case 2: - BVb(a); - qVb(a); - break; - case 1: - BVb(a); - xVb(a); - qVb(a); - break; - case 3: - xVb(a); - yVb(a); - } - break; - case 3: - switch (b.g) { - case 2: - xVb(a); - BVb(a); - qVb(a); - break; - case 1: - xVb(a); - BVb(a); - xVb(a); - qVb(a); - break; - case 4: - xVb(a); - yVb(a); - } - } - return a; - } - function UQb(a, b, c2) { - var d, e, f2, g, h, i3, j, k; - for (i3 = new Fyd((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a)); i3.e != i3.i.gc(); ) { - h = BD(Dyd(i3), 33); - for (e = new Sr(ur(_sd(h).a.Kc(), new Sq())); Qr(e); ) { - d = BD(Rr(e), 79); - !d.b && (d.b = new y5d(z2, d, 4, 7)); - if (!(d.b.i <= 1 && (!d.c && (d.c = new y5d(z2, d, 5, 8)), d.c.i <= 1))) { - throw vbb(new z2c("Graph must not contain hyperedges.")); - } - if (!Pld(d) && h != atd(BD(qud((!d.c && (d.c = new y5d(z2, d, 5, 8)), d.c), 0), 82))) { - j = new gRb(); - tNb(j, d); - yNb(j, (HSb(), FSb), d); - dRb(j, BD(Wd(irb(c2.f, h)), 144)); - eRb(j, BD(Ohb(c2, atd(BD(qud((!d.c && (d.c = new y5d(z2, d, 5, 8)), d.c), 0), 82))), 144)); - Ekb(b.c, j); - for (g = new Fyd((!d.n && (d.n = new cUd(D2, d, 1, 7)), d.n)); g.e != g.i.gc(); ) { - f2 = BD(Dyd(g), 137); - k = new mRb(j, f2.a); - tNb(k, f2); - yNb(k, FSb, f2); - k.e.a = $wnd.Math.max(f2.g, 1); - k.e.b = $wnd.Math.max(f2.f, 1); - lRb(k); - Ekb(b.d, k); - } - } - } + 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; + } + lastelt = array4.pop(); + if (array4.length) { + returnitem = array4[0]; + array4[0] = lastelt; + _siftup(array4, 0, cmp); + } else { + returnitem = lastelt; + } + return returnitem; + }, "heappop"); + heapreplace = /* @__PURE__ */ __name(function(array4, item, cmp) { + var returnitem; + if (cmp == null) { + cmp = defaultCmp; + } + 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; + } + if (array4.length && cmp(array4[0], item) < 0) { + _ref = [array4[0], item], item = _ref[0], array4[0] = _ref[1]; + _siftup(array4, 0, cmp); + } + return item; + }, "heappushpop"); + heapify = /* @__PURE__ */ __name(function(array4, cmp) { + var i2, _i, _len, _ref1, _results, _results1; + if (cmp == null) { + cmp = defaultCmp; + } + _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 OGb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4; - l = new LIb(a); - iKb(l, !(b == (ead(), dad) || b == _9c)); - k = l.a; - m = new p0b(); - for (e = (gHb(), OC(GC(pN, 1), Kie, 232, 0, [dHb, eHb, fHb])), g = 0, i3 = e.length; g < i3; ++g) { - c2 = e[g]; - j = xHb(k, dHb, c2); - !!j && (m.d = $wnd.Math.max(m.d, j.Re())); - } - for (d = OC(GC(pN, 1), Kie, 232, 0, [dHb, eHb, fHb]), f2 = 0, h = d.length; f2 < h; ++f2) { - c2 = d[f2]; - j = xHb(k, fHb, c2); - !!j && (m.a = $wnd.Math.max(m.a, j.Re())); - } - for (p = OC(GC(pN, 1), Kie, 232, 0, [dHb, eHb, fHb]), r = 0, t4 = p.length; r < t4; ++r) { - n = p[r]; - j = xHb(k, n, dHb); - !!j && (m.b = $wnd.Math.max(m.b, j.Se())); - } - for (o2 = OC(GC(pN, 1), Kie, 232, 0, [dHb, eHb, fHb]), q = 0, s = o2.length; q < s; ++q) { - n = o2[q]; - j = xHb(k, n, fHb); - !!j && (m.c = $wnd.Math.max(m.c, j.Se())); - } - 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 d6b(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2; - m = c2.d; - l = c2.c; - f2 = new f7c(c2.f.a + c2.d.b + c2.d.c, c2.f.b + c2.d.d + c2.d.a); - g = f2.b; - for (j = new olb(a.a); j.a < j.c.c.length; ) { - h = BD(mlb(j), 10); - if (h.k != (j0b(), e0b)) { - continue; - } - d = BD(vNb(h, (wtc(), Hsc)), 61); - e = BD(vNb(h, Isc), 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 == (dcd(), _bd)) { - n = Edb(ED(vNb(h, htc))); - k.b = f2.b * n - BD(vNb(h, (Nyc(), Txc)), 8).b; - o2 = k.b + e.b; - M_b(h, false, true); - } else if (b == $bd) { - k.b = Edb(ED(vNb(h, htc))) - BD(vNb(h, (Nyc(), Txc)), 8).b; - o2 = k.b + e.b; - M_b(h, false, true); - } - } - g = $wnd.Math.max(g, o2); + return _results; + }, "heapify"); + updateItem = /* @__PURE__ */ __name(function(array4, item, cmp) { + var pos; + if (cmp == null) { + cmp = defaultCmp; + } + pos = array4.indexOf(item); + if (pos === -1) { + return; + } + _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; + } + result = array4.slice(0, n2); + if (!result.length) { + return result; + } + heapify(result, cmp); + _ref = array4.slice(n2); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + elem = _ref[_i]; + heappushpop(result, elem, cmp); + } + 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; + } + if (n2 * 10 <= array4.length) { + result = array4.slice(0, n2).sort(cmp); + if (!result.length) { + return result; } - c2.f.b += g - f2.b; - for (i3 = new olb(a.a); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 10); - if (h.k != (j0b(), e0b)) { - continue; - } - d = BD(vNb(h, (wtc(), Hsc)), 61); - 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 nRc(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B; - e = BD(vNb(a, (mTc(), dTc)), 33); - j = Ohe; - k = Ohe; - h = Rie; - i3 = Rie; - for (w2 = Jsb(a.b, 0); w2.b != w2.d.c; ) { - u2 = BD(Xsb(w2), 86); - p = u2.e; - q = u2.f; - j = $wnd.Math.min(j, p.a - q.a / 2); - k = $wnd.Math.min(k, p.b - q.b / 2); - h = $wnd.Math.max(h, p.a + q.a / 2); - i3 = $wnd.Math.max(i3, p.b + q.b / 2); - } - o2 = BD(hkd(e, (JTc(), BTc)), 116); - n = new f7c(o2.b - j, o2.d - k); - for (v = Jsb(a.b, 0); v.b != v.d.c; ) { - u2 = BD(Xsb(v), 86); - m = vNb(u2, dTc); - if (JD(m, 239)) { - f2 = BD(m, 33); - l = P6c(u2.e, n); - bld(f2, l.a - f2.g / 2, l.b - f2.f / 2); - } - } - for (t4 = Jsb(a.a, 0); t4.b != t4.d.c; ) { - s = BD(Xsb(t4), 188); - d = BD(vNb(s, dTc), 79); - if (d) { - b = s.a; - r = new g7c(s.b.e); - Gsb(b, r, b.a, b.a.a); - A = new g7c(s.c.e); - Gsb(b, A, b.c.b, b.c); - qRc(r, BD(Ut(b, 1), 8), s.b.f); - qRc(A, BD(Ut(b, b.b - 2), 8), s.c.f); - c2 = itd(d, true, true); - ifd(b, c2); - } - } - B = h - j + (o2.b + o2.c); - g = i3 - k + (o2.d + o2.a); - Afd(e, B, g, false, false); - } - function xoc(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4; - l = a.b; - k = new Bib(l, 0); - Aib(k, new H1b(a)); - s = false; - g = 1; - while (k.b < k.d.gc()) { - j = (sCb(k.b < k.d.gc()), BD(k.d.Xb(k.c = k.b++), 29)); - p = (tCb(g, l.c.length), BD(l.c[g], 29)); - q = Mu(j.a); - r = q.c.length; - for (o2 = new olb(q); o2.a < o2.c.c.length; ) { - m = BD(mlb(o2), 10); - $_b(m, p); - } - if (s) { - for (n = av(new ov(q), 0); n.c.Sb(); ) { - m = BD(pv(n), 10); - for (f2 = new olb(Mu(R_b(m))); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 17); - PZb(e, true); - yNb(a, (wtc(), Asc), (Bcb(), true)); - d = Noc(a, e, r); - c2 = BD(vNb(m, usc), 305); - t4 = BD(Ikb(d, d.c.length - 1), 17); - c2.k = t4.c.i; - c2.n = t4; - c2.b = e.d.i; - c2.c = e; - } - } - s = false; - } else { - if (q.c.length != 0) { - b = (tCb(0, q.c.length), BD(q.c[0], 10)); - if (b.k == (j0b(), d0b)) { - s = true; - g = -1; - } - } + 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]; } - ++g; - } - h = new Bib(a.b, 0); - while (h.b < h.d.gc()) { - i3 = (sCb(h.b < h.d.gc()), BD(h.d.Xb(h.c = h.b++), 29)); - i3.a.c.length == 0 && uib(h); } + return result; } - function wKb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r; - k = BD(BD(Qc(a.r, b), 21), 84); - if (k.gc() <= 2 || b == (Ucd(), zcd) || b == (Ucd(), Tcd)) { - AKb(a, b); - return; + 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)); + } + return _results; + }, "nsmallest"); + _siftdown = /* @__PURE__ */ __name(function(array4, startpos, pos, cmp) { + var newitem, parent4, parentpos; + if (cmp == null) { + cmp = defaultCmp; + } + newitem = array4[pos]; + while (pos > startpos) { + parentpos = pos - 1 >> 1; + parent4 = array4[parentpos]; + if (cmp(newitem, parent4) < 0) { + array4[pos] = parent4; + pos = parentpos; + continue; } - p = a.u.Hc((rcd(), qcd)); - c2 = b == (Ucd(), Acd) ? (vLb(), uLb) : (vLb(), rLb); - r = b == Acd ? (EIb(), BIb) : (EIb(), DIb); - d = dLb(iLb(c2), a.s); - q = b == Acd ? Pje : Qje; - for (j = k.Kc(); j.Ob(); ) { - h = BD(j.Pb(), 111); - if (!h.c || h.c.d.c.length <= 0) { - continue; - } - o2 = h.b.rf(); - 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; - } - ytb(r, lle); - l.f = r; - $Hb(l, (NHb(), MHb)); - Ekb(d.d, new BLb(m, bLb(d, m))); - q = b == Acd ? $wnd.Math.min(q, n.b) : $wnd.Math.max(q, n.b + h.b.rf().b); - } - q += b == Acd ? -a.t : a.t; - cLb((d.e = q, d)); - for (i3 = k.Kc(); i3.Ob(); ) { - h = BD(i3.Pb(), 111); - if (!h.c || h.c.d.c.length <= 0) { - continue; - } - m = h.c.i; - m.c -= h.e.a; - m.d -= h.e.b; + break; + } + return array4[pos] = newitem; + }, "_siftdown"); + _siftup = /* @__PURE__ */ __name(function(array4, pos, cmp) { + var childpos, endpos, newitem, rightpos, startpos; + if (cmp == null) { + cmp = defaultCmp; + } + 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 IDc(a, b, c2) { - var d; - Odd(c2, "StretchWidth layering", 1); - if (b.a.c.length == 0) { - Qdd(c2); - return; + 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 = []; + } + __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(); + } + })(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; } - a.c = b; - a.t = 0; - a.u = 0; - a.i = Pje; - a.g = Qje; - a.d = Edb(ED(vNb(b, (Nyc(), lyc)))); - CDc(a); - DDc(a); - ADc(a); - HDc(a); - BDc(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 = FDc(a); - d = new H1b(a.c); - Ekb(a.c.b, d); - a.r = Mu(a.p); - a.n = tlb(a.k, a.k.length); - while (a.r.c.length != 0) { - a.o = JDc(a); - if (!a.o || EDc(a) && a.b.a.gc() != 0) { - KDc(a, d); - d = new H1b(a.c); - Ekb(a.c.b, d); - ye(a.a, a.b); - a.b.a.$b(); - a.t = a.u; - a.u = 0; - } else { - if (EDc(a)) { - a.c.b.c = KC(SI, Uhe, 1, 0, 5, 1); - d = new H1b(a.c); - Ekb(a.c.b, d); - a.t = 0; - a.u = 0; - a.b.a.$b(); - a.a.a.$b(); - ++a.f; - a.r = Mu(a.p); - a.n = tlb(a.k, a.k.length); - } else { - $_b(a.o, d); - Lkb(a.r, a.o); - Qqb(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 = KC(SI, Uhe, 1, 0, 5, 1); - smb(b.b); - Qdd(c2); - } - function Mgc(a) { - var b, c2, d, e; - MAb(JAb(new YAb(null, new Kub(a.a.b, 16)), new khc()), new mhc()); - Kgc(a); - MAb(JAb(new YAb(null, new Kub(a.a.b, 16)), new ohc()), new qhc()); - if (a.c == (Aad(), yad)) { - MAb(JAb(LAb(new YAb(null, new Kub(new Pib(a.f), 1)), new yhc()), new Ahc()), new Chc(a)); - MAb(JAb(NAb(LAb(LAb(new YAb(null, new Kub(a.d.b, 16)), new Ghc()), new Ihc()), new Khc()), new Mhc()), new Ohc(a)); - } - e = new f7c(Pje, Pje); - b = new f7c(Qje, Qje); - for (d = new olb(a.a.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 57); - 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); - } - P6c(X6c(a.d.c), V6c(new f7c(e.a, e.b))); - P6c(X6c(a.d.f), c7c(new f7c(b.a, b.b), e)); - Lgc(a, e, b); - Uhb(a.f); - Uhb(a.b); - Uhb(a.g); - Uhb(a.e); - a.a.a.c = KC(SI, Uhe, 1, 0, 5, 1); - a.a.b.c = KC(SI, Uhe, 1, 0, 5, 1); - a.a = null; - a.d = null; - } - function vZb(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4; - e = new Rkb(); - for (p = new olb(b.a); p.a < p.c.c.length; ) { - o2 = BD(mlb(p), 10); - n = o2.e; - if (n) { - d = vZb(a, n, o2); - Gkb(e, d); - sZb(a, n, o2); - if (BD(vNb(n, (wtc(), Ksc)), 21).Hc((Orc(), Hrc))) { - s = BD(vNb(o2, (Nyc(), Vxc)), 98); - m = BD(vNb(o2, Yxc), 174).Hc((rcd(), ncd)); - for (r = new olb(o2.j); r.a < r.c.c.length; ) { - q = BD(mlb(r), 11); - f2 = BD(Ohb(a.b, q), 10); - if (!f2) { - f2 = Z$b(q, s, q.j, -(q.e.c.length - q.g.c.length), null, new d7c(), q.o, BD(vNb(n, Lwc), 103), n); - yNb(f2, $sc, q); - Rhb(a.b, q, f2); - Ekb(n.a, f2); - } - g = BD(Ikb(f2.j, 0), 11); - for (k = new olb(q.f); k.a < k.c.c.length; ) { - j = BD(mlb(k), 70); - h = new p_b(); - h.o.a = j.o.a; - h.o.b = j.o.b; - Ekb(g.f, h); - if (!m) { - t4 = q.j; - l = 0; - tcd(BD(vNb(o2, Yxc), 21)) && (l = mfd(j.n, j.o, q.o, 0, t4)); - s == (dcd(), bcd) || (Ucd(), Ecd).Hc(t4) ? h.o.a = l : h.o.b = l; - } - } - } - } - } + } + 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; + } + 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 + }; } - i3 = new Rkb(); - rZb(a, b, c2, e, i3); - !!c2 && tZb(a, b, c2, i3); - return i3; } - function nEc(a, b, c2) { - var d, e, f2, g, h, i3, 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 olb(b.j); k.a < k.c.c.length; ) { - j = BD(mlb(k), 11); - l = c2 ? new J0b(j) : new R0b(j); - for (i3 = l.Kc(); i3.Ob(); ) { - h = BD(i3.Pb(), 11); - g = h.i; - if (g.c == b.c) { - if (g != b) { - nEc(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 = BD(vNb(b, (wtc(), ssc)), 15); - if (f2) { - for (e = f2.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 10); - if (b.c == d.c) { - nEc(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 += Cub(a.i, 24) * lke * 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 m5b(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q; - for (o2 = new olb(a); o2.a < o2.c.c.length; ) { - n = BD(mlb(o2), 10); - n5b(n.n); - n5b(n.o); - o5b(n.f); - r5b(n); - t5b(n); - for (q = new olb(n.j); q.a < q.c.c.length; ) { - p = BD(mlb(q), 11); - n5b(p.n); - n5b(p.a); - n5b(p.o); - G0b(p, s5b(p.j)); - f2 = BD(vNb(p, (Nyc(), Wxc)), 19); - !!f2 && yNb(p, Wxc, meb(-f2.a)); - for (e = new olb(p.g); e.a < e.c.c.length; ) { - d = BD(mlb(e), 17); - for (c2 = Jsb(d.a, 0); c2.b != c2.d.c; ) { - b = BD(Xsb(c2), 8); - n5b(b); - } - i3 = BD(vNb(d, jxc), 74); - if (i3) { - for (h = Jsb(i3, 0); h.b != h.d.c; ) { - g = BD(Xsb(h), 8); - n5b(g); - } - } - for (l = new olb(d.b); l.a < l.c.c.length; ) { - j = BD(mlb(l), 70); - n5b(j.n); - n5b(j.o); - } - } - for (m = new olb(p.f); m.a < m.c.c.length; ) { - j = BD(mlb(m), 70); - n5b(j.n); - n5b(j.o); - } - } - if (n.k == (j0b(), e0b)) { - yNb(n, (wtc(), Hsc), s5b(BD(vNb(n, Hsc), 61))); - q5b(n); - } - for (k = new olb(n.b); k.a < k.c.c.length; ) { - j = BD(mlb(k), 70); - r5b(j); - n5b(j.o); - n5b(j.n); - } - } - } - function yQb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A; - a.e = b; - h = $Pb(b); - w2 = new Rkb(); - for (d = new olb(h); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 15); - A = new Rkb(); - w2.c[w2.c.length] = A; - i3 = new Tqb(); - for (o2 = c2.Kc(); o2.Ob(); ) { - n = BD(o2.Pb(), 33); - f2 = wQb(a, n, true, 0, 0); - A.c[A.c.length] = f2; - p = n.i; - q = n.j; - m = (!n.n && (n.n = new cUd(D2, n, 1, 7)), n.n); - for (l = new Fyd(m); l.e != l.i.gc(); ) { - j = BD(Dyd(l), 137); - e = wQb(a, j, false, p, q); - A.c[A.c.length] = e; - } - v = (!n.c && (n.c = new cUd(F2, n, 9, 9)), n.c); - for (s = new Fyd(v); s.e != s.i.gc(); ) { - r = BD(Dyd(s), 118); - g = wQb(a, r, false, p, q); - A.c[A.c.length] = g; - t4 = r.i + p; - u2 = r.j + q; - m = (!r.n && (r.n = new cUd(D2, r, 1, 7)), r.n); - for (k = new Fyd(m); k.e != k.i.gc(); ) { - j = BD(Dyd(k), 137); - e = wQb(a, j, false, t4, u2); - A.c[A.c.length] = e; - } - } - ye(i3, Dx(pl(OC(GC(KI, 1), Uhe, 20, 0, [_sd(n), $sd(n)])))); - } - vQb(a, i3, A); - } - a.f = new aPb(w2); - tNb(a.f, b); - return a.f; - } - function Kqd(a, b, c2, d, e) { - var f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F, G; - D3 = Ohb(a.e, d); - if (D3 == null) { - D3 = new eC(); - n = BD(D3, 183); - s = b + "_s"; - t4 = s + e; - m = new yC(t4); - cC(n, Vte, m); - } - C = BD(D3, 183); - Qpd(c2, C); - G = new eC(); - Spd(G, "x", d.j); - Spd(G, "y", d.k); - cC(C, Yte, G); - A = new eC(); - Spd(A, "x", d.b); - Spd(A, "y", d.c); - cC(C, "endPoint", A); - l = Fhe((!d.a && (d.a = new xMd(y2, d, 5)), d.a)); - o2 = !l; - if (o2) { - w2 = new wB(); - f2 = new Srd(w2); - reb((!d.a && (d.a = new xMd(y2, d, 5)), d.a), f2); - cC(C, Ote, w2); - } - i3 = dmd(d); - u2 = !!i3; - u2 && Tpd(a.a, C, Qte, kqd(a, dmd(d))); - r = emd(d); - v = !!r; - v && Tpd(a.a, C, Pte, kqd(a, emd(d))); - j = (!d.e && (d.e = new y5d(A2, d, 10, 9)), d.e).i == 0; - p = !j; - if (p) { - B = new wB(); - g = new Urd(a, B); - reb((!d.e && (d.e = new y5d(A2, d, 10, 9)), d.e), g); - cC(C, Ste, B); - } - k = (!d.g && (d.g = new y5d(A2, d, 9, 10)), d.g).i == 0; - q = !k; - if (q) { - F = new wB(); - h = new Wrd(a, F); - reb((!d.g && (d.g = new y5d(A2, d, 9, 10)), d.g), h); - cC(C, Rte, F); - } - } - function eKb(a) { - $Jb(); - var b, c2, d, e, f2, g, h; - d = a.f.n; - for (g = ci(a.r).a.nc(); g.Ob(); ) { - f2 = BD(g.Pb(), 111); - e = 0; - if (f2.b.Xe((Y9c(), s9c))) { - e = Edb(ED(f2.b.We(s9c))); - if (e < 0) { - switch (f2.b.Hf().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 (tcd(a.u)) { - b = nfd(f2.b, e); - h = !BD(a.e.We(b9c), 174).Hc((Idd(), zdd)); - c2 = false; - switch (f2.b.Hf().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; - } - } + } + 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(); } } + 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; + } } - function l3b(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l; - for (j = new olb(a); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 10); - g = BD(vNb(i3, (Nyc(), mxc)), 163); - f2 = null; - switch (g.g) { - case 1: - case 2: - f2 = (Gqc(), Fqc); - break; - case 3: - case 4: - f2 = (Gqc(), Dqc); - } - if (f2) { - yNb(i3, (wtc(), Bsc), (Gqc(), Fqc)); - f2 == Dqc ? o3b(i3, g, (KAc(), HAc)) : f2 == Fqc && o3b(i3, g, (KAc(), IAc)); - } else { - if (fcd(BD(vNb(i3, Vxc), 98)) && i3.j.c.length != 0) { - b = true; - for (l = new olb(i3.j); l.a < l.c.c.length; ) { - k = BD(mlb(l), 11); - if (!(k.j == (Ucd(), zcd) && k.e.c.length - k.g.c.length > 0 || k.j == Tcd && k.e.c.length - k.g.c.length < 0)) { - b = false; - break; - } - for (e = new olb(k.g); e.a < e.c.c.length; ) { - c2 = BD(mlb(e), 17); - h = BD(vNb(c2.d.i, mxc), 163); - if (h == (Ctc(), ztc) || h == Atc) { - b = false; - break; - } - } - for (d = new olb(k.e); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 17); - h = BD(vNb(c2.c.i, mxc), 163); - if (h == (Ctc(), xtc) || h == ytc) { - b = false; - break; - } - } - } - b && o3b(i3, g, (KAc(), JAc)); - } - } - } - } - function lJc(a, b, c2, d, e) { - var f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2; - w2 = 0; - n = 0; - for (l = new olb(b.e); l.a < l.c.c.length; ) { - k = BD(mlb(l), 10); - m = 0; - h = 0; - i3 = c2 ? BD(vNb(k, hJc), 19).a : Rie; - r = d ? BD(vNb(k, iJc), 19).a : Rie; - j = $wnd.Math.max(i3, r); - for (t4 = new olb(k.j); t4.a < t4.c.c.length; ) { - s = BD(mlb(t4), 11); - u2 = k.n.b + s.n.b + s.a.b; - if (d) { - for (g = new olb(s.g); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 17); - p = f2.d; - o2 = p.i; - if (b != a.a[o2.p]) { - q = $wnd.Math.max(BD(vNb(o2, hJc), 19).a, BD(vNb(o2, iJc), 19).a); - v = BD(vNb(f2, (Nyc(), eyc)), 19).a; - if (v >= j && v >= q) { - m += o2.n.b + p.n.b + p.a.b - u2; - ++h; - } - } - } - } - if (c2) { - for (g = new olb(s.e); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 17); - p = f2.c; - o2 = p.i; - if (b != a.a[o2.p]) { - q = $wnd.Math.max(BD(vNb(o2, hJc), 19).a, BD(vNb(o2, iJc), 19).a); - v = BD(vNb(f2, (Nyc(), eyc)), 19).a; - if (v >= j && v >= q) { - m += o2.n.b + p.n.b + p.a.b - u2; - ++h; - } - } - } - } + }, "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); + } + } + 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, id27) { + openSet.push(ele); + openSetIds.add(id27); + }, "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(id27) { + return openSetIds.has(id27); + }, "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); } - if (h > 0) { - w2 += m / h; - ++n; + pathNode = cameFrom[pathNodeId]; + if (pathNode == null) { + break; } + pathNodeId = pathNode.id(); + pathEdge = cameFromEdge[pathNodeId]; } - if (n > 0) { - b.a = e * w2 / n; - b.g = n; - } else { - b.a = 0; - b.g = 0; - } - } - function oMc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m; - for (e = new olb(a.a.b); e.a < e.c.c.length; ) { - c2 = BD(mlb(e), 29); - for (i3 = new olb(c2.a); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 10); - b.j[h.p] = h; - b.i[h.p] = b.o == (eMc(), dMc) ? Qje : Pje; - } - } - Uhb(a.c); - g = a.a.b; - b.c == (YLc(), WLc) && (g = JD(g, 152) ? km(BD(g, 152)) : JD(g, 131) ? BD(g, 131).a : JD(g, 54) ? new ov(g) : new dv(g)); - UMc(a.e, b, a.b); - Alb(b.p, null); - for (f2 = g.Kc(); f2.Ob(); ) { - c2 = BD(f2.Pb(), 29); - j = c2.a; - b.o == (eMc(), dMc) && (j = JD(j, 152) ? km(BD(j, 152)) : JD(j, 131) ? BD(j, 131).a : JD(j, 54) ? new ov(j) : new dv(j)); - for (m = j.Kc(); m.Ob(); ) { - l = BD(m.Pb(), 10); - b.g[l.p] == l && pMc(a, l, b); - } - } - qMc(a, b); - for (d = g.Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 29); - for (m = new olb(c2.a); m.a < m.c.c.length; ) { - l = BD(mlb(m), 10); - b.p[l.p] = b.p[b.g[l.p].p]; - if (l == b.g[l.p]) { - k = Edb(b.i[b.j[l.p].p]); - (b.o == (eMc(), dMc) && k > Qje || b.o == cMc && k < Pje) && (b.p[l.p] = Edb(b.p[l.p]) + k); - } - } - } - a.e.cg(); - } - function PGb(a, b, c2, d) { - var e, f2, g, h, i3; - h = new LIb(b); - rKb(h, d); - e = true; - if (!!a && a.Xe((Y9c(), z8c))) { - f2 = BD(a.We((Y9c(), z8c)), 103); - e = f2 == (ead(), cad) || f2 == aad || f2 == bad; - } - hKb(h, false); - Hkb(h.e.wf(), new mKb(h, false, e)); - NJb(h, h.f, (gHb(), dHb), (Ucd(), Acd)); - NJb(h, h.f, fHb, Rcd); - NJb(h, h.g, dHb, Tcd); - NJb(h, h.g, fHb, zcd); - PJb(h, Acd); - PJb(h, Rcd); - OJb(h, zcd); - OJb(h, Tcd); - $Jb(); - g = h.A.Hc((tdd(), pdd)) && h.B.Hc((Idd(), Ddd)) ? _Jb(h) : null; - !!g && DHb(h.a, g); - eKb(h); - GJb(h); - PKb(h); - BJb(h); - pKb(h); - HKb(h); - xKb(h, Acd); - xKb(h, Rcd); - CJb(h); - oKb(h); - if (!c2) { - return h.o; - } - cKb(h); - LKb(h); - xKb(h, zcd); - xKb(h, Tcd); - i3 = h.B.Hc((Idd(), Edd)); - RJb(h, i3, Acd); - RJb(h, i3, Rcd); - SJb(h, i3, zcd); - SJb(h, i3, Tcd); - MAb(new YAb(null, new Kub(new $ib(h.i), 0)), new TJb()); - MAb(JAb(new YAb(null, ci(h.r).a.oc()), new VJb()), new XJb()); - dKb(h); - h.e.uf(h.o); - MAb(new YAb(null, ci(h.r).a.oc()), new fKb()); - return h.o; - } - function JVb(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p; - j = Pje; - for (d = new olb(a.a.b); d.a < d.c.c.length; ) { - b = BD(mlb(d), 81); - j = $wnd.Math.min(j, b.d.f.g.c + b.e.a); - } - n = new Psb(); - for (g = new olb(a.a.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 189); - f2.i = j; - f2.e == 0 && (Gsb(n, f2, n.c.b, n.c), true); - } - while (n.b != 0) { - f2 = BD(n.b == 0 ? null : (sCb(n.b != 0), Nsb(n, n.a.a)), 189); - e = f2.f.g.c; - for (m = f2.a.a.ec().Kc(); m.Ob(); ) { - k = BD(m.Pb(), 81); - 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 == (ead(), bad) || a.c == _9c ? f2.c += e : f2.c -= e; - for (l = f2.a.a.ec().Kc(); l.Ob(); ) { - k = BD(l.Pb(), 81); - for (i3 = k.f.Kc(); i3.Ob(); ) { - h = BD(i3.Pb(), 81); - fad(a.c) ? o2 = a.f.ef(k, h) : o2 = a.f.ff(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 && Dsb(n, h.d); - } - } - } - for (c2 = new olb(a.a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 81); - b.g.c = b.o; - } - } - function ELb(a) { - var b, c2, d, e, f2, g, h, i3; - h = a.b; - b = a.a; - switch (BD(vNb(a, (fFb(), bFb)), 427).g) { - case 0: - Okb(h, new tpb(new bMb())); - break; - case 1: - default: - Okb(h, new tpb(new gMb())); + return { + found: true, + distance: gScore[cMinId], + path: this.spawn(path4), + steps + }; + } + 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; } - switch (BD(vNb(a, _Eb), 428).g) { - case 1: - Okb(h, new YLb()); - Okb(h, new lMb()); - Okb(h, new GLb()); - break; - case 0: - default: - Okb(h, new YLb()); - Okb(h, new RLb()); + if (directed && e3.data("source") !== cMinId) { + continue; } - switch (BD(vNb(a, dFb), 250).g) { - case 0: - i3 = new FMb(); - break; - case 1: - i3 = new zMb(); - break; - case 2: - i3 = new CMb(); - break; - case 3: - i3 = new wMb(); - break; - case 5: - i3 = new JMb(new CMb()); - break; - case 4: - i3 = new JMb(new zMb()); - break; - case 7: - i3 = new tMb(new JMb(new zMb()), new JMb(new CMb())); - break; - case 8: - i3 = new tMb(new JMb(new wMb()), new JMb(new CMb())); - break; - case 6: - default: - i3 = new JMb(new wMb()); - } - for (g = new olb(h); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 167); - d = 0; - e = 0; - c2 = new vgd(meb(d), meb(e)); - while (gNb(b, f2, d, e)) { - c2 = BD(i3.Ce(c2, f2), 46); - d = BD(c2.a, 19).a; - e = BD(c2.b, 19).a; - } - dNb(b, f2, d, e); - } - } - function qQb(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A; - f2 = a.f.b; - m = f2.a; - k = f2.b; - o2 = a.e.g; - n = a.e.f; - _kd(a.e, f2.a, f2.b); - w2 = m / o2; - A = k / n; - for (j = new Fyd(Kkd(a.e)); j.e != j.i.gc(); ) { - i3 = BD(Dyd(j), 137); - dld(i3, i3.i * w2); - eld(i3, i3.j * A); - } - for (s = new Fyd(Yod(a.e)); s.e != s.i.gc(); ) { - r = BD(Dyd(s), 118); - u2 = r.i; - v = r.j; - u2 > 0 && dld(r, u2 * w2); - v > 0 && eld(r, v * A); - } - stb(a.b, new CQb()); - b = new Rkb(); - for (h = new nib(new eib(a.c).a); h.b; ) { - g = lib(h); - d = BD(g.cd(), 79); - c2 = BD(g.dd(), 395).a; - e = itd(d, false, false); - l = oQb(jtd(d), ofd(e), c2); - ifd(l, e); - t4 = ktd(d); - if (!!t4 && Jkb(b, t4, 0) == -1) { - b.c[b.c.length] = t4; - pQb(t4, (sCb(l.b != 0), BD(l.a.a.c, 8)), c2); - } - } - for (q = new nib(new eib(a.d).a); q.b; ) { - p = lib(q); - d = BD(p.cd(), 79); - c2 = BD(p.dd(), 395).a; - e = itd(d, false, false); - l = oQb(ltd(d), w7c(ofd(e)), c2); - l = w7c(l); - ifd(l, e); - t4 = mtd(d); - if (!!t4 && Jkb(b, t4, 0) == -1) { - b.c[b.c.length] = t4; - pQb(t4, (sCb(l.b != 0), BD(l.c.b.c, 8)), c2); - } - } - } - function _Vc(a, b, c2, d) { - var e, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B; - if (c2.c.length != 0) { - o2 = new Rkb(); - for (n = new olb(c2); n.a < n.c.c.length; ) { - m = BD(mlb(n), 33); - Ekb(o2, new f7c(m.i, m.j)); - } - d.n && !!b && Tdd(d, i6d(b), (pgd(), mgd)); - while (CVc(a, c2)) { - AVc(a, c2, false); - } - d.n && !!b && Tdd(d, i6d(b), (pgd(), mgd)); - h = 0; - i3 = 0; - e = null; - if (c2.c.length != 0) { - e = (tCb(0, c2.c.length), BD(c2.c[0], 33)); - h = e.i - (tCb(0, o2.c.length), BD(o2.c[0], 8)).a; - i3 = e.j - (tCb(0, o2.c.length), BD(o2.c[0], 8)).b; - } - g = $wnd.Math.sqrt(h * h + i3 * i3); - l = cVc(c2); - while (l.a.gc() != 0) { - for (k = l.a.ec().Kc(); k.Ob(); ) { - j = BD(k.Pb(), 33); - p = a.f; - q = p.i + p.g / 2; - r = p.j + p.f / 2; - s = j.i + j.g / 2; - t4 = j.j + j.f / 2; - u2 = s - q; - v = t4 - r; - w2 = $wnd.Math.sqrt(u2 * u2 + v * v); - A = u2 / w2; - B = v / w2; - dld(j, j.i + A * g); - eld(j, j.j + B * g); - } - d.n && !!b && Tdd(d, i6d(b), (pgd(), mgd)); - l = cVc(new Tkb(l)); - } - !!a.a && a.a.lg(new Tkb(l)); - d.n && !!b && Tdd(d, i6d(b), (pgd(), mgd)); - _Vc(a, b, new Tkb(l), d); - } - } - function $2b(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r; - p = a.n; - q = a.o; - m = a.d; - l = Edb(ED(pBc(a, (Nyc(), iyc)))); - if (b) { - k = l * (b.gc() - 1); - n = 0; - for (i3 = b.Kc(); i3.Ob(); ) { - g = BD(i3.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 = BD(h.Pb(), 10); - g.n.a = r; - g.n.b = f2 - g.o.b; - r += g.o.a + l; - j = Y2b(g); - j.n.a = g.o.a / 2 - j.a.a; - j.n.b = g.o.b; - o2 = BD(vNb(g, (wtc(), vsc)), 11); - if (o2.e.c.length + o2.g.c.length == 1) { - o2.n.a = e - o2.a.a; - o2.n.b = 0; - F0b(o2, a); - } - e += d; - } - } - if (c2) { - k = l * (c2.gc() - 1); - n = 0; - for (i3 = c2.Kc(); i3.Ob(); ) { - g = BD(i3.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 = BD(h.Pb(), 10); - g.n.a = r; - g.n.b = f2; - r += g.o.a + l; - j = Y2b(g); - j.n.a = g.o.a / 2 - j.a.a; - j.n.b = 0; - o2 = BD(vNb(g, (wtc(), vsc)), 11); - if (o2.e.c.length + o2.g.c.length == 1) { - o2.n.a = e - o2.a.a; - o2.n.b = q.b; - F0b(o2, a); - } - e += d; - } - } - } - function q7b(a, b) { - var c2, d, e, f2, g, h; - if (!BD(vNb(b, (wtc(), Ksc)), 21).Hc((Orc(), Hrc))) { - return; + var wSrc = e3.source(); + var wTgt = e3.target(); + var w3 = wSrc.id() !== cMinId ? wSrc : wTgt; + var wid = w3.id(); + if (!this.hasElementWithId(wid)) { + continue; } - for (h = new olb(b.a); h.a < h.c.c.length; ) { - f2 = BD(mlb(h), 10); - if (f2.k == (j0b(), h0b)) { - e = BD(vNb(f2, (Nyc(), txc)), 142); - 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); - } + if (closedSetIds[wid]) { + continue; } - for (g = new olb(b.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 10); - if (f2.k != (j0b(), h0b)) { - switch (f2.k.g) { - case 2: - d = BD(vNb(f2, (Nyc(), mxc)), 163); - if (d == (Ctc(), ytc)) { - f2.n.a = a.c - 10; - p7b(f2, new x7b()).Jb(new A7b(f2)); - break; - } - if (d == Atc) { - f2.n.a = a.a + 10; - p7b(f2, new D7b()).Jb(new G7b(f2)); - break; - } - c2 = BD(vNb(f2, Osc), 303); - if (c2 == (esc(), dsc)) { - o7b(f2).Jb(new J7b(f2)); - f2.n.b = a.d - 10; - break; - } - if (c2 == bsc) { - o7b(f2).Jb(new M7b(f2)); - f2.n.b = a.b + 10; - break; - } - break; - default: - throw vbb(new Wdb("The node type " + f2.k + " is not supported by the " + zS)); - } - } - } - } - function Y1b(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2, p, q; - i3 = new f7c(d.i + d.g / 2, d.j + d.f / 2); - n = M1b(d); - o2 = BD(hkd(b, (Nyc(), Vxc)), 98); - q = BD(hkd(d, $xc), 61); - if (!hCd(gkd(d), Uxc)) { - d.i == 0 && d.j == 0 ? p = 0 : p = kfd(d, q); - jkd(d, Uxc, p); - } - j = new f7c(b.g, b.f); - e = Z$b(d, o2, q, n, j, i3, new f7c(d.g, d.f), BD(vNb(c2, Lwc), 103), c2); - yNb(e, (wtc(), $sc), d); - f2 = BD(Ikb(e.j, 0), 11); - E0b(f2, W1b(d)); - yNb(e, Yxc, (rcd(), pqb(pcd))); - l = BD(hkd(b, Yxc), 174).Hc(ncd); - for (h = new Fyd((!d.n && (d.n = new cUd(D2, d, 1, 7)), d.n)); h.e != h.i.gc(); ) { - g = BD(Dyd(h), 137); - if (!Ccb(DD(hkd(g, Jxc))) && !!g.a) { - m = Z1b(g); - Ekb(f2.f, m); - if (!l) { - k = 0; - tcd(BD(hkd(b, Yxc), 21)) && (k = mfd(new f7c(g.i, g.j), new f7c(g.g, g.f), new f7c(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; - } - } - } + 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; } - yNb(e, tyc, ED(hkd(Xod(b), tyc))); - yNb(e, uyc, ED(hkd(Xod(b), uyc))); - yNb(e, ryc, ED(hkd(Xod(b), ryc))); - Ekb(c2.a, e); - Rhb(a.a, d, e); - } - function qUc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v; - Odd(c2, "Processor arrange level", 1); - k = 0; - mmb(); - ktb(b, new Wsd((mTc(), ZSc))); - f2 = b.b; - h = Jsb(b, b.b); - j = true; - while (j && h.b.b != h.d.a) { - r = BD(Ysb(h), 86); - BD(vNb(r, ZSc), 19).a == 0 ? --f2 : j = false; - } - v = new Jib(b, 0, f2); - g = new Qsb(v); - v = new Jib(b, f2, b.b); - i3 = new Qsb(v); - if (g.b == 0) { - for (o2 = Jsb(i3, 0); o2.b != o2.d.c; ) { - n = BD(Xsb(o2), 86); - yNb(n, eTc, meb(k++)); - } - } else { - l = g.b; - for (u2 = Jsb(g, 0); u2.b != u2.d.c; ) { - t4 = BD(Xsb(u2), 86); - yNb(t4, eTc, meb(k++)); - d = URc(t4); - qUc(a, d, Udd(c2, 1 / l | 0)); - ktb(d, tmb(new Wsd(eTc))); - m = new Psb(); - for (s = Jsb(d, 0); s.b != s.d.c; ) { - r = BD(Xsb(s), 86); - for (q = Jsb(t4.d, 0); q.b != q.d.c; ) { - p = BD(Xsb(q), 188); - p.c == r && (Gsb(m, p, m.c.b, m.c), true); - } - } - Osb(t4.d); - ye(t4.d, m); - h = Jsb(i3, i3.b); - e = t4.d.b; - j = true; - while (0 < e && j && h.b.b != h.d.a) { - r = BD(Ysb(h), 86); - if (BD(vNb(r, ZSc), 19).a == 0) { - yNb(r, eTc, meb(k++)); - --e; - Zsb(h); - } else { - j = false; - } - } - } + if (tempScore < gScore[wid]) { + gScore[wid] = tempScore; + fScore[wid] = tempScore + heuristic2(w3); + cameFrom[wid] = cMin; + cameFromEdge[wid] = e3; } - Qdd(c2); } - function _8b(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4; - Odd(b, "Inverted port preprocessing", 1); - k = a.b; - j = new Bib(k, 0); - c2 = null; - t4 = new Rkb(); - while (j.b < j.d.gc()) { - s = c2; - c2 = (sCb(j.b < j.d.gc()), BD(j.d.Xb(j.c = j.b++), 29)); - for (n = new olb(t4); n.a < n.c.c.length; ) { - l = BD(mlb(n), 10); - $_b(l, s); - } - t4.c = KC(SI, Uhe, 1, 0, 5, 1); - for (o2 = new olb(c2.a); o2.a < o2.c.c.length; ) { - l = BD(mlb(o2), 10); - if (l.k != (j0b(), h0b)) { - continue; - } - if (!fcd(BD(vNb(l, (Nyc(), Vxc)), 98))) { - continue; - } - for (r = X_b(l, (KAc(), HAc), (Ucd(), zcd)).Kc(); r.Ob(); ) { - p = BD(r.Pb(), 11); - i3 = p.e; - h = BD(Qkb(i3, KC(AQ, jne, 17, i3.c.length, 0, 1)), 474); - for (e = h, f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - Z8b(a, p, d, t4); - } - } - for (q = X_b(l, IAc, Tcd).Kc(); q.Ob(); ) { - p = BD(q.Pb(), 11); - i3 = p.g; - h = BD(Qkb(i3, KC(AQ, jne, 17, i3.c.length, 0, 1)), 474); - for (e = h, f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - $8b(a, p, d, t4); - } - } - } - } - for (m = new olb(t4); m.a < m.c.c.length; ) { - l = BD(mlb(m), 10); - $_b(l, c2); - } - Qdd(b); - } - function _1b(a, b, c2, d, e, f2) { - var g, h, i3, j, k, l; - j = new H0b(); - tNb(j, b); - G0b(j, BD(hkd(b, (Nyc(), $xc)), 61)); - yNb(j, (wtc(), $sc), b); - F0b(j, c2); - l = j.o; - l.a = b.g; - l.b = b.f; - k = j.n; - k.a = b.i; - k.b = b.j; - Rhb(a.a, b, j); - g = FAb(NAb(LAb(new YAb(null, (!b.e && (b.e = new y5d(B2, b, 7, 4)), new Kub(b.e, 16))), new m2b()), new e2b()), new o2b(b)); - g || (g = FAb(NAb(LAb(new YAb(null, (!b.d && (b.d = new y5d(B2, b, 8, 5)), new Kub(b.d, 16))), new q2b()), new g2b()), new s2b(b))); - g || (g = FAb(new YAb(null, (!b.e && (b.e = new y5d(B2, b, 7, 4)), new Kub(b.e, 16))), new u2b())); - yNb(j, Nsc, (Bcb(), g ? true : false)); - e_b(j, f2, e, BD(hkd(b, Txc), 8)); - for (i3 = new Fyd((!b.n && (b.n = new cUd(D2, b, 1, 7)), b.n)); i3.e != i3.i.gc(); ) { - h = BD(Dyd(i3), 137); - !Ccb(DD(hkd(h, Jxc))) && !!h.a && Ekb(j.f, Z1b(h)); - } - switch (e.g) { - case 2: - case 1: - (j.j == (Ucd(), Acd) || j.j == Rcd) && d.Fc((Orc(), Lrc)); - break; - case 4: - case 3: - (j.j == (Ucd(), zcd) || j.j == Tcd) && d.Fc((Orc(), Lrc)); - } - return j; - } - function nQc(a, b, c2, d, e, f2, g) { - var h, i3, j, k, l, m, n, o2, p, q, r, s, t4; - m = null; - d == (FQc(), DQc) ? m = b : d == EQc && (m = c2); - for (p = m.a.ec().Kc(); p.Ob(); ) { - o2 = BD(p.Pb(), 11); - q = l7c(OC(GC(m1, 1), nie, 8, 0, [o2.i.n, o2.n, o2.a])).b; - t4 = new Tqb(); - h = new Tqb(); - for (j = new b1b(o2.b); llb(j.a) || llb(j.b); ) { - i3 = BD(llb(j.a) ? mlb(j.a) : mlb(j.b), 17); - if (Ccb(DD(vNb(i3, (wtc(), ltc)))) != e) { - continue; - } - if (Jkb(f2, i3, 0) != -1) { - i3.d == o2 ? r = i3.c : r = i3.d; - s = l7c(OC(GC(m1, 1), nie, 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) ? Qqb(t4, new vgd(DQc, i3)) : Qqb(t4, new vgd(EQc, i3)) : b.a._b(r) ? Qqb(h, new vgd(DQc, i3)) : Qqb(h, new vgd(EQc, i3)); - } - } - if (t4.a.gc() > 1) { - n = new ZQc(o2, t4, d); - reb(t4, new PQc(a, n)); - g.c[g.c.length] = n; - for (l = t4.a.ec().Kc(); l.Ob(); ) { - k = BD(l.Pb(), 46); - Lkb(f2, k.b); - } - } - if (h.a.gc() > 1) { - n = new ZQc(o2, h, d); - reb(h, new RQc(a, n)); - g.c[g.c.length] = n; - for (l = h.a.ec().Kc(); l.Ob(); ) { - k = BD(l.Pb(), 46); - Lkb(f2, k.b); - } - } - } - } - function $Wc(a) { - r4c(a, new E3c(L3c(P3c(M3c(O3c(N3c(new R3c(), sre), "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 bXc()), sre))); - p4c(a, sre, uqe, Ksd(UWc)); - p4c(a, sre, wme, Ksd(XWc)); - p4c(a, sre, Fme, Ksd(NWc)); - p4c(a, sre, Tme, Ksd(OWc)); - p4c(a, sre, Eme, Ksd(PWc)); - p4c(a, sre, Gme, Ksd(MWc)); - p4c(a, sre, Dme, Ksd(QWc)); - p4c(a, sre, Hme, Ksd(TWc)); - p4c(a, sre, ore, Ksd(KWc)); - p4c(a, sre, nre, Ksd(LWc)); - p4c(a, sre, rre, Ksd(RWc)); - p4c(a, sre, lre, Ksd(SWc)); - p4c(a, sre, mre, Ksd(VWc)); - p4c(a, sre, pre, Ksd(WWc)); - p4c(a, sre, qre, Ksd(YWc)); - } - function LIb(a) { - var b; - this.r = Cy(new OIb(), new SIb()); - this.b = new Rpb(BD(Qb(F1), 290)); - this.p = new Rpb(BD(Qb(F1), 290)); - this.i = new Rpb(BD(Qb(DN), 290)); - this.e = a; - this.o = new g7c(a.rf()); - this.D = a.Df() || Ccb(DD(a.We((Y9c(), M8c)))); - this.A = BD(a.We((Y9c(), Y8c)), 21); - this.B = BD(a.We(b9c), 21); - this.q = BD(a.We(t9c), 98); - this.u = BD(a.We(x9c), 21); - if (!ucd(this.u)) { - throw vbb(new y2c("Invalid port label placement: " + this.u)); - } - this.v = Ccb(DD(a.We(z9c))); - this.j = BD(a.We(W8c), 21); - if (!Jbd(this.j)) { - throw vbb(new y2c("Invalid node label placement: " + this.j)); - } - this.n = BD(bgd(a, U8c), 116); - this.k = Edb(ED(bgd(a, Q9c))); - this.d = Edb(ED(bgd(a, P9c))); - this.w = Edb(ED(bgd(a, X9c))); - this.s = Edb(ED(bgd(a, R9c))); - this.t = Edb(ED(bgd(a, S9c))); - this.C = BD(bgd(a, V9c), 142); - this.c = 2 * this.d; - b = !this.B.Hc((Idd(), zdd)); - this.f = new mIb(0, b, 0); - this.g = new mIb(1, b, 0); - lIb(this.f, (gHb(), eHb), this.g); - } - function Lgd(a, b, c2, d, e) { - var f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3; - t4 = 0; - o2 = 0; - n = 0; - m = 1; - for (s = new Fyd((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a)); s.e != s.i.gc(); ) { - q = BD(Dyd(s), 33); - m += sr(new Sr(ur(_sd(q).a.Kc(), new Sq()))); - B = q.g; - o2 = $wnd.Math.max(o2, B); - l = q.f; - n = $wnd.Math.max(n, l); - t4 += B * l; - } - p = (!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a).i; - g = t4 + 2 * d * d * m * p; - f2 = $wnd.Math.sqrt(g); - i3 = $wnd.Math.max(f2 * c2, o2); - h = $wnd.Math.max(f2 / c2, n); - for (r = new Fyd((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a)); r.e != r.i.gc(); ) { - q = BD(Dyd(r), 33); - C = e.b + (Cub(b, 26) * ike + Cub(b, 27) * jke) * (i3 - q.g); - D3 = e.b + (Cub(b, 26) * ike + Cub(b, 27) * jke) * (h - q.f); - dld(q, C); - eld(q, D3); - } - A = i3 + (e.b + e.c); - w2 = h + (e.d + e.a); - for (v = new Fyd((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a)); v.e != v.i.gc(); ) { - u2 = BD(Dyd(v), 33); - for (k = new Sr(ur(_sd(u2).a.Kc(), new Sq())); Qr(k); ) { - j = BD(Rr(k), 79); - Pld(j) || Kgd(j, b, A, w2); - } - } - A += e.b + e.c; - w2 += e.d + e.a; - Afd(a, A, w2, false, true); - } - function Jcb(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l; - if (a == null) { - throw vbb(new Oeb(Xhe)); - } - j = a; - f2 = a.length; - i3 = false; - if (f2 > 0) { - b = (BCb(0, a.length), a.charCodeAt(0)); - if (b == 45 || b == 43) { - a = a.substr(1); - --f2; - i3 = b == 45; - } - } - if (f2 == 0) { - throw vbb(new Oeb(Oje + j + '"')); - } - while (a.length > 0 && (BCb(0, a.length), a.charCodeAt(0) == 48)) { - a = a.substr(1); - --f2; - } - if (f2 > (Neb(), Leb)[10]) { - throw vbb(new Oeb(Oje + j + '"')); - } - for (e = 0; e < f2; e++) { - if (Zcb((BCb(e, a.length), a.charCodeAt(e))) == -1) { - throw vbb(new Oeb(Oje + j + '"')); - } - } - l = 0; - g = Jeb[10]; - k = Keb[10]; - h = Jbb(Meb[10]); - c2 = true; - d = f2 % g; - if (d > 0) { - l = -parseInt(a.substr(0, d), 10); - a = a.substr(d); - f2 -= d; - c2 = false; - } - while (f2 >= g) { - d = parseInt(a.substr(0, g), 10); - a = a.substr(g); - f2 -= g; - if (c2) { - c2 = false; - } else { - if (ybb(l, h) < 0) { - throw vbb(new Oeb(Oje + j + '"')); - } - l = Ibb(l, k); - } - l = Qbb(l, d); - } - if (ybb(l, 0) > 0) { - throw vbb(new Oeb(Oje + j + '"')); - } - if (!i3) { - l = Jbb(l); - if (ybb(l, 0) < 0) { - throw vbb(new Oeb(Oje + j + '"')); - } - } - return l; - } - function Z6d(a, b) { - X6d(); - var c2, d, e, f2, g, h, i3; - this.a = new a7d(this); - this.b = a; - this.c = b; - this.f = c2d(q1d((O6d(), M6d), b)); - if (this.f.dc()) { - if ((h = t1d(M6d, a)) == b) { - this.e = true; - this.d = new Rkb(); - this.f = new oFd(); - this.f.Fc(Ewe); - BD(V1d(p1d(M6d, bKd(a)), ""), 26) == a && this.f.Fc(u1d(M6d, bKd(a))); - for (e = g1d(M6d, a).Kc(); e.Ob(); ) { - d = BD(e.Pb(), 170); - switch ($1d(q1d(M6d, d))) { - case 4: { - this.d.Fc(d); - break; - } - case 5: { - this.f.Gc(c2d(q1d(M6d, d))); - break; - } - } - } - } else { - Q6d(); - if (BD(b, 66).Oj()) { - this.e = true; - this.f = null; - this.d = new Rkb(); - for (g = 0, i3 = (a.i == null && TKd(a), a.i).length; g < i3; ++g) { - d = (c2 = (a.i == null && TKd(a), a.i), g >= 0 && g < c2.length ? c2[g] : null); - for (f2 = _1d(q1d(M6d, d)); f2; f2 = _1d(q1d(M6d, f2))) { - f2 == b && this.d.Fc(d); - } - } - } else if ($1d(q1d(M6d, b)) == 1 && !!h) { - this.f = null; - this.d = (m8d(), l8d); - } else { - this.f = null; - this.e = true; - this.d = (mmb(), new anb(b)); - } - } - } else { - this.e = $1d(q1d(M6d, b)) == 5; - this.f.Fb(W6d) && (this.f = W6d); - } - } - function zKb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2; - c2 = 0; - d = yKb(a, b); - m = a.s; - n = a.t; - for (j = BD(BD(Qc(a.r, b), 21), 84).Kc(); j.Ob(); ) { - i3 = BD(j.Pb(), 111); - if (!i3.c || i3.c.d.c.length <= 0) { - continue; - } - o2 = i3.b.rf(); - h = i3.b.Xe((Y9c(), s9c)) ? Edb(ED(i3.b.We(s9c))) : 0; - k = i3.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 = i3.a ? (o2.a - l.b) / 2 : o2.a + m; - l.d = o2.b + h + d; - $Hb(k, (NHb(), KHb)); - _Hb(k, (EIb(), DIb)); - break; - case 3: - l.c = i3.a ? (o2.a - l.b) / 2 : o2.a + m; - l.d = -h - d - l.a; - $Hb(k, (NHb(), KHb)); - _Hb(k, (EIb(), BIb)); - break; - case 2: - l.c = -h - d - l.b; - if (i3.a) { - e = a.v ? l.a : BD(Ikb(k.d, 0), 181).rf().b; - l.d = (o2.b - e) / 2; - } else { - l.d = o2.b + n; - } - $Hb(k, (NHb(), MHb)); - _Hb(k, (EIb(), CIb)); - break; - case 4: - l.c = o2.a + h + d; - if (i3.a) { - e = a.v ? l.a : BD(Ikb(k.d, 0), 181).rf().b; - l.d = (o2.b - e) / 2; - } else { - l.d = o2.b + n; - } - $Hb(k, (NHb(), LHb)); - _Hb(k, (EIb(), CIb)); - } - (b == (Ucd(), Acd) || b == Rcd) && (c2 = $wnd.Math.max(c2, l.a)); - } - c2 > 0 && (BD(Mpb(a.b, b), 124).a.b = c2); - } - function b3b(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r; - Odd(b, "Comment pre-processing", 1); - c2 = 0; - i3 = new olb(a.a); - while (i3.a < i3.c.c.length) { - h = BD(mlb(i3), 10); - if (Ccb(DD(vNb(h, (Nyc(), pwc))))) { - ++c2; - e = 0; - d = null; - j = null; - for (o2 = new olb(h.j); o2.a < o2.c.c.length; ) { - m = BD(mlb(o2), 11); - e += m.e.c.length + m.g.c.length; - if (m.e.c.length == 1) { - d = BD(Ikb(m.e, 0), 17); - j = d.c; - } - if (m.g.c.length == 1) { - d = BD(Ikb(m.g, 0), 17); - j = d.d; - } - } - if (e == 1 && j.e.c.length + j.g.c.length == 1 && !Ccb(DD(vNb(j.i, pwc)))) { - c3b(h, d, j, j.i); - nlb(i3); - } else { - r = new Rkb(); - for (n = new olb(h.j); n.a < n.c.c.length; ) { - m = BD(mlb(n), 11); - for (l = new olb(m.g); l.a < l.c.c.length; ) { - k = BD(mlb(l), 17); - k.d.g.c.length == 0 || (r.c[r.c.length] = k, true); - } - for (g = new olb(m.e); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 17); - f2.c.e.c.length == 0 || (r.c[r.c.length] = f2, true); - } - } - for (q = new olb(r); q.a < q.c.c.length; ) { - p = BD(mlb(q), 17); - PZb(p, true); - } - } - } - } - b.n && Sdd(b, "Found " + c2 + " comment boxes"); - Qdd(b); + } + 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 f9b(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2, p; - m = Edb(ED(vNb(a, (Nyc(), tyc)))); - n = Edb(ED(vNb(a, uyc))); - l = Edb(ED(vNb(a, ryc))); - h = a.o; - f2 = BD(Ikb(a.j, 0), 11); - g = f2.n; - p = d9b(f2, l); - if (!p) { - return; - } - if (b.Hc((rcd(), ncd))) { - switch (BD(vNb(a, (wtc(), Hsc)), 61).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 : BD(Ikb(f2.f, 0), 70).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 : BD(Ikb(f2.f, 0), 70).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(pcd)) { - switch (BD(vNb(a, (wtc(), Hsc)), 61).g) { - case 1: - case 3: - p.c = g.a + m; - break; - case 2: - case 4: - if (c2 && !f2.c) { - k = d ? p.a : BD(Ikb(f2.f, 0), 70).o.b; - p.d = (h.b - k) / 2 - g.b; - } else { - p.d = g.b + n; - } - } - } - e = p.d; - for (j = new olb(f2.f); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 70); - o2 = i3.n; - o2.a = p.c; - o2.b = e; - e += i3.o.b + l; - } - } - function eae() { - rEd(Q9, new Lae()); - rEd(S9, new qbe()); - rEd(T9, new Xbe()); - rEd(U9, new Cce()); - rEd(ZI, new Oce()); - rEd(GC(SD, 1), new Rce()); - rEd(wI, new Uce()); - rEd(xI, new Xce()); - rEd(ZI, new hae()); - rEd(ZI, new kae()); - rEd(ZI, new nae()); - rEd(BI, new qae()); - rEd(ZI, new tae()); - rEd(yK, new wae()); - rEd(yK, new zae()); - rEd(ZI, new Cae()); - rEd(FI, new Fae()); - rEd(ZI, new Iae()); - rEd(ZI, new Oae()); - rEd(ZI, new Rae()); - rEd(ZI, new Uae()); - rEd(ZI, new Xae()); - rEd(GC(SD, 1), new $ae()); - rEd(ZI, new bbe()); - rEd(ZI, new ebe()); - rEd(yK, new hbe()); - rEd(yK, new kbe()); - rEd(ZI, new nbe()); - rEd(JI, new tbe()); - rEd(ZI, new wbe()); - rEd(MI, new zbe()); - rEd(ZI, new Cbe()); - rEd(ZI, new Fbe()); - rEd(ZI, new Ibe()); - rEd(ZI, new Lbe()); - rEd(yK, new Obe()); - rEd(yK, new Rbe()); - rEd(ZI, new Ube()); - rEd(ZI, new $be()); - rEd(ZI, new bce()); - rEd(ZI, new ece()); - rEd(ZI, new hce()); - rEd(ZI, new kce()); - rEd(UI, new nce()); - rEd(ZI, new qce()); - rEd(ZI, new tce()); - rEd(ZI, new wce()); - rEd(UI, new zce()); - rEd(MI, new Fce()); - rEd(ZI, new Ice()); - rEd(JI, new Lce()); - } - function Bmd(b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2; - n = c2.length; - if (n > 0) { - j = (BCb(0, c2.length), c2.charCodeAt(0)); - if (j != 64) { - if (j == 37) { - m = c2.lastIndexOf("%"); - k = false; - if (m != 0 && (m == n - 1 || (k = (BCb(m + 1, c2.length), c2.charCodeAt(m + 1) == 46)))) { - h = c2.substr(1, m - 1); - u2 = dfb("%", h) ? null : QEd(h); - e = 0; - if (k) { - try { - e = Icb(c2.substr(m + 2), Rie, Ohe); - } catch (a) { - a = ubb(a); - if (JD(a, 127)) { - i3 = a; - throw vbb(new rFd(i3)); - } else - throw vbb(a); - } - } - for (r = pRd(b.Wg()); r.Ob(); ) { - p = MRd(r); - if (JD(p, 510)) { - f2 = BD(p, 590); - t4 = f2.d; - if ((u2 == null ? t4 == null : dfb(u2, t4)) && e-- == 0) { - return f2; - } - } - } - return null; - } - } - l = c2.lastIndexOf("."); - o2 = l == -1 ? c2 : c2.substr(0, l); - d = 0; - if (l != -1) { - try { - d = Icb(c2.substr(l + 1), Rie, Ohe); - } catch (a) { - a = ubb(a); - if (JD(a, 127)) { - o2 = c2; - } else - throw vbb(a); - } - } - o2 = dfb("%", o2) ? null : QEd(o2); - for (q = pRd(b.Wg()); q.Ob(); ) { - p = MRd(q); - if (JD(p, 191)) { - g = BD(p, 191); - s = g.ne(); - if ((o2 == null ? s == null : dfb(o2, s)) && d-- == 0) { - return g; - } - } - } - return null; - } - } - return rid(b, c2); + } + 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 f6b(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F; - w2 = new Rkb(); - for (o2 = new olb(a.b); o2.a < o2.c.c.length; ) { - n = BD(mlb(o2), 29); - for (r = new olb(n.a); r.a < r.c.c.length; ) { - p = BD(mlb(r), 10); - if (p.k != (j0b(), e0b)) { - continue; - } - if (!wNb(p, (wtc(), Gsc))) { - continue; - } - s = null; - u2 = null; - t4 = null; - for (C = new olb(p.j); C.a < C.c.c.length; ) { - B = BD(mlb(C), 11); - switch (B.j.g) { - case 4: - s = B; - break; - case 2: - u2 = B; - break; - default: - t4 = B; - } - } - v = BD(Ikb(t4.g, 0), 17); - k = new t7c(v.a); - j = new g7c(t4.n); - P6c(j, p.n); - l = Jsb(k, 0); - Vsb(l, j); - A = w7c(v.a); - m = new g7c(t4.n); - P6c(m, p.n); - Gsb(A, m, A.c.b, A.c); - D3 = BD(vNb(p, Gsc), 10); - F = BD(Ikb(D3.j, 0), 11); - i3 = BD(Qkb(s.e, KC(AQ, jne, 17, 0, 0, 1)), 474); - for (d = i3, f2 = 0, h = d.length; f2 < h; ++f2) { - b = d[f2]; - RZb(b, F); - o7c(b.a, b.a.b, k); - } - i3 = k_b(u2.g); - for (c2 = i3, e = 0, g = c2.length; e < g; ++e) { - b = c2[e]; - QZb(b, F); - o7c(b.a, 0, A); - } - QZb(v, null); - RZb(v, null); - w2.c[w2.c.length] = p; - } - } - for (q = new olb(w2); q.a < q.c.c.length; ) { - p = BD(mlb(q), 10); - $_b(p, null); - } - } - function lgb() { - lgb = ccb; - var a, b, c2; - new sgb(1, 0); - new sgb(10, 0); - new sgb(0, 0); - dgb = KC(bJ, nie, 240, 11, 0, 1); - egb = KC(TD, $ie, 25, 100, 15, 1); - fgb = OC(GC(UD, 1), Vje, 25, 15, [1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625, 48828125, 244140625, 1220703125, 6103515625, 30517578125, 152587890625, 762939453125, 3814697265625, 19073486328125, 95367431640625, 476837158203125, 2384185791015625]); - ggb = KC(WD, oje, 25, fgb.length, 15, 1); - hgb = OC(GC(UD, 1), Vje, 25, 15, [1, 10, 100, _ie, 1e4, Wje, 1e6, 1e7, 1e8, Jje, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16]); - igb = KC(WD, oje, 25, hgb.length, 15, 1); - jgb = KC(bJ, nie, 240, 11, 0, 1); - a = 0; - for (; a < jgb.length; a++) { - dgb[a] = new sgb(a, 0); - jgb[a] = new sgb(0, a); - egb[a] = 48; - } - for (; a < egb.length; a++) { - egb[a] = 48; - } - for (c2 = 0; c2 < ggb.length; c2++) { - ggb[c2] = ugb(fgb[c2]); - } - for (b = 0; b < igb.length; b++) { - igb[b] = ugb(hgb[b]); - } - Dhb(); - } - function zrb() { - 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[hke] = 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 (!xrb()) { - 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[hke] = 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; - }; + 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; + } + if (!directed) { + var ts = t4 * N2 + s2; + if (!directed && dist3[ts] > _weight) { + dist3[ts] = _weight; + next3[ts] = s2; + edgeNext[ts] = edge; } - return e; } - function cde(a) { - ade(); - var b, c2, d, e, f2, g, h, i3, 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 = KC(TD, $ie, 25, m * 4, 15, 1); - j = 0; - k = 0; - b = 0; - c2 = 0; - d = 0; - g = 0; - e = 0; - for (i3 = 0; i3 < n; i3++) { - 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++] = _ce[o2]; - f2[g++] = _ce[p | j << 4]; - f2[g++] = _ce[k << 2 | q]; - f2[g++] = _ce[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++] = _ce[o2]; - f2[g++] = _ce[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++] = _ce[o2]; - f2[g++] = _ce[p | j << 4]; - f2[g++] = _ce[k << 2]; - f2[g++] = 61; - } - return zfb(f2, 0, f2.length); - } - function mB(a, b) { - var c2, d, e, f2, g, h, i3; - a.e == 0 && a.p > 0 && (a.p = -(a.p - 1)); - a.p > Rie && dB(b, a.p - nje); - g = b.q.getDate(); - ZA(b, 1); - a.k >= 0 && aB(b, a.k); - if (a.c >= 0) { - ZA(b, a.c); - } else if (a.k >= 0) { - i3 = new fB(b.q.getFullYear() - nje, b.q.getMonth(), 35); - d = 35 - i3.q.getDate(); - ZA(b, $wnd.Math.min(d, g)); - } else { - ZA(b, g); - } - a.f < 0 && (a.f = b.q.getHours()); - a.b > 0 && a.f < 12 && (a.f += 12); - $A(b, a.f == 24 && a.g ? 0 : a.f); - a.j >= 0 && _A(b, a.j); - a.n >= 0 && bB(b, a.n); - a.i >= 0 && cB(b, wbb(Ibb(Abb(Cbb(b.q.getTime()), _ie), _ie), a.i)); - if (a.a) { - e = new eB(); - dB(e, e.q.getFullYear() - nje - 80); - Gbb(Cbb(b.q.getTime()), Cbb(e.q.getTime())) && dB(b, e.q.getFullYear() - nje + 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(); - ZA(b, b.q.getDate() + c2); - b.q.getMonth() != h && ZA(b, b.q.getDate() + (c2 > 0 ? -7 : 7)); - } else { - if (b.q.getDay() != a.d) { - return false; - } + } + 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]; } } - if (a.o > Rie) { - f2 = b.q.getTimezoneOffset(); - cB(b, wbb(Cbb(b.q.getTime()), (a.o - f2) * 60 * _ie)); - } - return true; } - function z2b(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2; - e = vNb(b, (wtc(), $sc)); - if (!JD(e, 239)) { - return; - } - o2 = BD(e, 33); - p = b.e; - m = new g7c(b.c); - f2 = b.d; - m.a += f2.b; - m.b += f2.d; - u2 = BD(hkd(o2, (Nyc(), Ixc)), 174); - if (uqb(u2, (Idd(), Add))) { - n = BD(hkd(o2, Kxc), 116); - w_b(n, f2.a); - z_b(n, f2.d); - x_b(n, f2.b); - y_b(n, f2.c); - } - c2 = new Rkb(); - for (k = new olb(b.a); k.a < k.c.c.length; ) { - i3 = BD(mlb(k), 10); - if (JD(vNb(i3, $sc), 239)) { - A2b(i3, m); - } else if (JD(vNb(i3, $sc), 186) && !p) { - d = BD(vNb(i3, $sc), 118); - s = b_b(b, i3, d.g, d.f); - bld(d, s.a, s.b); - } - for (r = new olb(i3.j); r.a < r.c.c.length; ) { - q = BD(mlb(r), 11); - MAb(JAb(new YAb(null, new Kub(q.g, 16)), new G2b(i3)), new I2b(c2)); - } - } - if (p) { - for (r = new olb(p.j); r.a < r.c.c.length; ) { - q = BD(mlb(r), 11); - MAb(JAb(new YAb(null, new Kub(q.g, 16)), new K2b(p)), new M2b(c2)); - } - } - t4 = BD(hkd(o2, Swc), 218); - for (h = new olb(c2); h.a < h.c.c.length; ) { - g = BD(mlb(h), 17); - y2b(g, t4, m); - } - B2b(b); - for (j = new olb(b.a); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 10); - l = i3.e; - !!l && z2b(a, l); - } - } - function xSb(a) { - r4c(a, new E3c(Q3c(L3c(P3c(M3c(O3c(N3c(new R3c(), ume), "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 ASb()), ume), qqb((Csd(), zsd), OC(GC(O3, 1), Kie, 237, 0, [xsd]))))); - p4c(a, ume, vme, meb(1)); - p4c(a, ume, wme, 80); - p4c(a, ume, xme, 5); - p4c(a, ume, _le, tme); - p4c(a, ume, yme, meb(1)); - p4c(a, ume, zme, (Bcb(), true)); - p4c(a, ume, ame, lSb); - p4c(a, ume, Ame, Ksd(dSb)); - p4c(a, ume, Bme, Ksd(mSb)); - p4c(a, ume, Cme, false); - p4c(a, ume, Dme, Ksd(jSb)); - p4c(a, ume, Eme, Ksd(iSb)); - p4c(a, ume, Fme, Ksd(hSb)); - p4c(a, ume, Gme, Ksd(gSb)); - p4c(a, ume, Hme, Ksd(nSb)); - p4c(a, ume, mme, Ksd(fSb)); - p4c(a, ume, pme, Ksd(vSb)); - p4c(a, ume, nme, Ksd(eSb)); - p4c(a, ume, rme, Ksd(qSb)); - p4c(a, ume, ome, Ksd(rSb)); - } - function GKb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n; - if (BD(BD(Qc(a.r, b), 21), 84).dc()) { - return; - } - g = BD(Mpb(a.b, b), 124); - i3 = g.i; - h = g.n; - k = KIb(a, b); - d = i3.b - h.b - h.c; - e = g.a.a; - f2 = i3.c + h.b; - n = a.w; - if ((k == (Tbd(), Qbd) || k == Sbd) && BD(BD(Qc(a.r, b), 21), 84).gc() == 1) { - e = k == Qbd ? e - 2 * a.w : e; - k = Pbd; - } - if (d < e && !a.B.Hc((Idd(), Fdd))) { - if (k == Qbd) { - n += (d - e) / (BD(BD(Qc(a.r, b), 21), 84).gc() + 1); - f2 += n; - } else { - n += (d - e) / (BD(BD(Qc(a.r, b), 21), 84).gc() - 1); - } - } else { - if (d < e) { - e = k == Qbd ? e - 2 * a.w : e; - k = Pbd; - } - switch (k.g) { - case 3: - f2 += (d - e) / 2; - break; - case 4: - f2 += d - e; - break; - case 0: - c2 = (d - e) / (BD(BD(Qc(a.r, b), 21), 84).gc() + 1); - n += $wnd.Math.max(0, c2); - f2 += n; - break; - case 1: - c2 = (d - e) / (BD(BD(Qc(a.r, b), 21), 84).gc() - 1); - n += $wnd.Math.max(0, c2); - } + } + 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(); } - for (m = BD(BD(Qc(a.r, b), 21), 84).Kc(); m.Ob(); ) { - l = BD(m.Pb(), 111); - l.e.a = f2 + l.d.b; - l.e.b = (j = l.b, j.Xe((Y9c(), s9c)) ? j.Hf() == (Ucd(), Acd) ? -j.rf().b - Edb(ED(j.We(s9c))) : Edb(ED(j.We(s9c))) : j.Hf() == (Ucd(), Acd) ? -j.rf().b : 0); - f2 += l.d.b + l.b.rf().a + l.d.c + n; + if (next3[i3 * N2 + j3] == null) { + return cy.collection(); } + 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 KKb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2; - if (BD(BD(Qc(a.r, b), 21), 84).dc()) { - return; - } - g = BD(Mpb(a.b, b), 124); - i3 = g.i; - h = g.n; - l = KIb(a, b); - d = i3.a - h.d - h.a; - e = g.a.b; - f2 = i3.d + h.d; - o2 = a.w; - j = a.o.a; - if ((l == (Tbd(), Qbd) || l == Sbd) && BD(BD(Qc(a.r, b), 21), 84).gc() == 1) { - e = l == Qbd ? e - 2 * a.w : e; - l = Pbd; - } - if (d < e && !a.B.Hc((Idd(), Fdd))) { - if (l == Qbd) { - o2 += (d - e) / (BD(BD(Qc(a.r, b), 21), 84).gc() + 1); - f2 += o2; - } else { - o2 += (d - e) / (BD(BD(Qc(a.r, b), 21), 84).gc() - 1); - } - } else { - if (d < e) { - e = l == Qbd ? e - 2 * a.w : e; - l = Pbd; - } - switch (l.g) { - case 3: - f2 += (d - e) / 2; - break; - case 4: - f2 += d - e; - break; - case 0: - c2 = (d - e) / (BD(BD(Qc(a.r, b), 21), 84).gc() + 1); - o2 += $wnd.Math.max(0, c2); - f2 += o2; - break; - case 1: - c2 = (d - e) / (BD(BD(Qc(a.r, b), 21), 84).gc() - 1); - o2 += $wnd.Math.max(0, c2); - } - } - for (n = BD(BD(Qc(a.r, b), 21), 84).Kc(); n.Ob(); ) { - m = BD(n.Pb(), 111); - m.e.a = (k = m.b, k.Xe((Y9c(), s9c)) ? k.Hf() == (Ucd(), Tcd) ? -k.rf().a - Edb(ED(k.We(s9c))) : j + Edb(ED(k.We(s9c))) : k.Hf() == (Ucd(), Tcd) ? -k.rf().a : j); - m.e.b = f2 + m.d.d; - f2 += m.d.d + m.b.rf().b + m.d.a + o2; - } - } - function Abc(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p; - a.n = Edb(ED(vNb(a.g, (Nyc(), vyc)))); - a.e = Edb(ED(vNb(a.g, pyc))); - a.i = a.g.b.c.length; - h = a.i - 1; - m = 0; - a.j = 0; - a.k = 0; - a.a = Ou(KC(JI, nie, 19, a.i, 0, 1)); - a.b = Ou(KC(BI, nie, 333, a.i, 7, 1)); - for (g = new olb(a.g.b); g.a < g.c.c.length; ) { - e = BD(mlb(g), 29); - e.p = h; - for (l = new olb(e.a); l.a < l.c.c.length; ) { - k = BD(mlb(l), 10); - k.p = m; - ++m; - } - --h; - } - a.f = KC(WD, oje, 25, m, 15, 1); - a.c = IC(WD, [nie, oje], [48, 25], 15, [m, 3], 2); - a.o = new Rkb(); - a.p = new Rkb(); - b = 0; - a.d = 0; - for (f2 = new olb(a.g.b); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 29); - h = e.p; - d = 0; - p = 0; - i3 = e.a.c.length; - j = 0; - for (l = new olb(e.a); l.a < l.c.c.length; ) { - k = BD(mlb(l), 10); - m = k.p; - a.f[m] = k.c.p; - j += k.o.b + a.n; - c2 = sr(new Sr(ur(R_b(k).a.Kc(), new Sq()))); - o2 = sr(new Sr(ur(U_b(k).a.Kc(), new Sq()))); - a.c[m][0] = o2 - c2; - a.c[m][1] = c2; - a.c[m][2] = o2; - d += c2; - p += o2; - c2 > 0 && Ekb(a.p, k); - Ekb(a.o, k); - } - b -= d; - n = i3 + b; - j += b * a.e; - Nkb(a.a, h, meb(n)); - Nkb(a.b, h, j); - a.j = $wnd.Math.max(a.j, n); - a.k = $wnd.Math.max(a.k, j); - a.d += b; - b += p; - } - } - function Ucd() { - Ucd = ccb; - var a; - Scd = new Ycd(ole, 0); - Acd = new Ycd(xle, 1); - zcd = new Ycd(yle, 2); - Rcd = new Ycd(zle, 3); - Tcd = new Ycd(Ale, 4); - Fcd = (mmb(), new zob((a = BD(gdb(F1), 9), new xqb(a, BD(_Bb(a, a.length), 9), 0)))); - Gcd = Up(qqb(Acd, OC(GC(F1, 1), bne, 61, 0, []))); - Bcd = Up(qqb(zcd, OC(GC(F1, 1), bne, 61, 0, []))); - Ocd = Up(qqb(Rcd, OC(GC(F1, 1), bne, 61, 0, []))); - Qcd = Up(qqb(Tcd, OC(GC(F1, 1), bne, 61, 0, []))); - Lcd = Up(qqb(Acd, OC(GC(F1, 1), bne, 61, 0, [Rcd]))); - Ecd = Up(qqb(zcd, OC(GC(F1, 1), bne, 61, 0, [Tcd]))); - Ncd = Up(qqb(Acd, OC(GC(F1, 1), bne, 61, 0, [Tcd]))); - Hcd = Up(qqb(Acd, OC(GC(F1, 1), bne, 61, 0, [zcd]))); - Pcd = Up(qqb(Rcd, OC(GC(F1, 1), bne, 61, 0, [Tcd]))); - Ccd = Up(qqb(zcd, OC(GC(F1, 1), bne, 61, 0, [Rcd]))); - Kcd = Up(qqb(Acd, OC(GC(F1, 1), bne, 61, 0, [zcd, Tcd]))); - Dcd = Up(qqb(zcd, OC(GC(F1, 1), bne, 61, 0, [Rcd, Tcd]))); - Mcd = Up(qqb(Acd, OC(GC(F1, 1), bne, 61, 0, [Rcd, Tcd]))); - Icd = Up(qqb(Acd, OC(GC(F1, 1), bne, 61, 0, [zcd, Rcd]))); - Jcd = Up(qqb(Acd, OC(GC(F1, 1), bne, 61, 0, [zcd, Rcd, Tcd]))); - } - function fSc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4; - if (b.b != 0) { - n = new Psb(); - h = null; - o2 = null; - d = QD($wnd.Math.floor($wnd.Math.log(b.b) * $wnd.Math.LOG10E) + 1); - i3 = 0; - for (t4 = Jsb(b, 0); t4.b != t4.d.c; ) { - r = BD(Xsb(t4), 86); - if (PD(o2) !== PD(vNb(r, (mTc(), $Sc)))) { - o2 = GD(vNb(r, $Sc)); - i3 = 0; - } - o2 != null ? h = o2 + iSc(i3++, d) : h = iSc(i3++, d); - yNb(r, $Sc, h); - for (q = (e = Jsb(new ZRc(r).a.d, 0), new aSc(e)); Wsb(q.a); ) { - p = BD(Xsb(q.a), 188).c; - Gsb(n, p, n.c.b, n.c); - yNb(p, $Sc, h); - } - } - m = new Lqb(); - for (g = 0; g < h.length - d; g++) { - for (s = Jsb(b, 0); s.b != s.d.c; ) { - r = BD(Xsb(s), 86); - j = qfb(GD(vNb(r, (mTc(), $Sc))), 0, g + 1); - c2 = (j == null ? Wd(irb(m.f, null)) : Crb(m.g, j)) != null ? BD(j == null ? Wd(irb(m.f, null)) : Crb(m.g, j), 19).a + 1 : 1; - Shb(m, j, meb(c2)); - } - } - for (l = new nib(new eib(m).a); l.b; ) { - k = lib(l); - f2 = meb(Ohb(a.a, k.cd()) != null ? BD(Ohb(a.a, k.cd()), 19).a : 0); - Shb(a.a, GD(k.cd()), meb(BD(k.dd(), 19).a + f2.a)); - f2 = BD(Ohb(a.b, k.cd()), 19); - (!f2 || f2.a < BD(k.dd(), 19).a) && Shb(a.b, GD(k.cd()), BD(k.dd(), 19)); - } - fSc(a, n); - } - } - function PCc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r; - Odd(c2, "Interactive node layering", 1); - d = new Rkb(); - for (n = new olb(b.a); n.a < n.c.c.length; ) { - l = BD(mlb(n), 10); - j = l.n.a; - i3 = j + l.o.a; - i3 = $wnd.Math.max(j + 1, i3); - r = new Bib(d, 0); - e = null; - while (r.b < r.d.gc()) { - p = (sCb(r.b < r.d.gc()), BD(r.d.Xb(r.c = r.b++), 569)); - if (p.c >= i3) { - sCb(r.b > 0); - r.a.Xb(r.c = --r.b); - break; - } else if (p.a > j) { - if (!e) { - Ekb(p.b, l); - p.c = $wnd.Math.min(p.c, j); - p.a = $wnd.Math.max(p.a, i3); - e = p; - } else { - Gkb(e.b, p.b); - e.a = $wnd.Math.max(e.a, p.a); - uib(r); - } - } - } - if (!e) { - e = new TCc(); - e.c = j; - e.a = i3; - Aib(r, e); - Ekb(e.b, l); - } - } - h = b.b; - k = 0; - for (q = new olb(d); q.a < q.c.c.length; ) { - p = BD(mlb(q), 569); - f2 = new H1b(b); - f2.p = k++; - h.c[h.c.length] = f2; - for (o2 = new olb(p.b); o2.a < o2.c.c.length; ) { - l = BD(mlb(o2), 10); - $_b(l, f2); - l.p = 0; - } - } - for (m = new olb(b.a); m.a < m.c.c.length; ) { - l = BD(mlb(m), 10); - l.p == 0 && OCc(a, l, b); - } - g = new Bib(h, 0); - while (g.b < g.d.gc()) { - (sCb(g.b < g.d.gc()), BD(g.d.Xb(g.c = g.b++), 29)).a.c.length == 0 && uib(g); - } - b.a.c = KC(SI, Uhe, 1, 0, 5, 1); - Qdd(c2); - } - function Snc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m; - if (b.e.c.length != 0 && c2.e.c.length != 0) { - d = BD(Ikb(b.e, 0), 17).c.i; - g = BD(Ikb(c2.e, 0), 17).c.i; - if (d == g) { - return beb(BD(vNb(BD(Ikb(b.e, 0), 17), (wtc(), Zsc)), 19).a, BD(vNb(BD(Ikb(c2.e, 0), 17), Zsc), 19).a); - } - for (k = a.a, l = 0, m = k.length; l < m; ++l) { - j = k[l]; - if (j == d) { - return 1; - } else if (j == g) { - return -1; - } - } - } - if (b.g.c.length != 0 && c2.g.c.length != 0) { - f2 = BD(vNb(b, (wtc(), Xsc)), 10); - i3 = BD(vNb(c2, Xsc), 10); - e = 0; - h = 0; - wNb(BD(Ikb(b.g, 0), 17), Zsc) && (e = BD(vNb(BD(Ikb(b.g, 0), 17), Zsc), 19).a); - wNb(BD(Ikb(c2.g, 0), 17), Zsc) && (h = BD(vNb(BD(Ikb(b.g, 0), 17), Zsc), 19).a); - if (!!f2 && f2 == i3) { - if (Ccb(DD(vNb(BD(Ikb(b.g, 0), 17), ltc))) && !Ccb(DD(vNb(BD(Ikb(c2.g, 0), 17), ltc)))) { - return 1; - } else if (!Ccb(DD(vNb(BD(Ikb(b.g, 0), 17), ltc))) && Ccb(DD(vNb(BD(Ikb(c2.g, 0), 17), ltc)))) { - return -1; - } - return e < h ? -1 : e > h ? 1 : 0; - } - if (a.b) { - a.b._b(f2) && (e = BD(a.b.xc(f2), 19).a); - a.b._b(i3) && (h = BD(a.b.xc(i3), 19).a); - } - return e < h ? -1 : e > h ? 1 : 0; - } - return b.e.c.length != 0 && c2.g.c.length != 0 ? 1 : -1; - } - function acc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A; - Odd(b, Ine, 1); - p = new Rkb(); - w2 = new Rkb(); - for (j = new olb(a.b); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 29); - r = -1; - o2 = l_b(i3.a); - for (l = o2, m = 0, n = l.length; m < n; ++m) { - k = l[m]; - ++r; - if (!(k.k == (j0b(), h0b) && fcd(BD(vNb(k, (Nyc(), Vxc)), 98)))) { - continue; - } - ecd(BD(vNb(k, (Nyc(), Vxc)), 98)) || bcc(k); - yNb(k, (wtc(), Psc), k); - p.c = KC(SI, Uhe, 1, 0, 5, 1); - w2.c = KC(SI, Uhe, 1, 0, 5, 1); - c2 = new Rkb(); - u2 = new Psb(); - Jq(u2, Y_b(k, (Ucd(), Acd))); - $bc(a, u2, p, w2, c2); - h = r; - A = k; - for (f2 = new olb(p); f2.a < f2.c.c.length; ) { - d = BD(mlb(f2), 10); - Z_b(d, h, i3); - ++r; - yNb(d, Psc, k); - g = BD(Ikb(d.j, 0), 11); - q = BD(vNb(g, $sc), 11); - Ccb(DD(vNb(q, nwc))) || BD(vNb(d, Qsc), 15).Fc(A); - } - Osb(u2); - for (t4 = Y_b(k, Rcd).Kc(); t4.Ob(); ) { - s = BD(t4.Pb(), 11); - Gsb(u2, s, u2.a, u2.a.a); - } - $bc(a, u2, w2, null, c2); - v = k; - for (e = new olb(w2); e.a < e.c.c.length; ) { - d = BD(mlb(e), 10); - Z_b(d, ++r, i3); - yNb(d, Psc, k); - g = BD(Ikb(d.j, 0), 11); - q = BD(vNb(g, $sc), 11); - Ccb(DD(vNb(q, nwc))) || BD(vNb(v, Qsc), 15).Fc(d); - } - c2.c.length == 0 || yNb(k, ssc, c2); - } - } - Qdd(b); - } - function SQb(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F, G, H2, I; - l = BD(vNb(a, (HSb(), FSb)), 33); - r = Ohe; - s = Ohe; - p = Rie; - q = Rie; - for (u2 = new olb(a.e); u2.a < u2.c.c.length; ) { - t4 = BD(mlb(u2), 144); - C = t4.d; - D3 = t4.e; - r = $wnd.Math.min(r, C.a - D3.a / 2); - s = $wnd.Math.min(s, C.b - D3.b / 2); - p = $wnd.Math.max(p, C.a + D3.a / 2); - q = $wnd.Math.max(q, C.b + D3.b / 2); - } - B = BD(hkd(l, (wSb(), kSb)), 116); - A = new f7c(B.b - r, B.d - s); - for (h = new olb(a.e); h.a < h.c.c.length; ) { - g = BD(mlb(h), 144); - w2 = vNb(g, FSb); - if (JD(w2, 239)) { - n = BD(w2, 33); - v = P6c(g.d, A); - bld(n, v.a - n.g / 2, v.b - n.f / 2); - } - } - for (d = new olb(a.c); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 282); - j = BD(vNb(c2, FSb), 79); - k = itd(j, true, true); - F = (H2 = c7c(R6c(c2.d.d), c2.c.d), l6c(H2, c2.c.e.a, c2.c.e.b), P6c(H2, c2.c.d)); - nmd(k, F.a, F.b); - b = (I = c7c(R6c(c2.c.d), c2.d.d), l6c(I, c2.d.e.a, c2.d.e.b), P6c(I, c2.d.d)); - gmd(k, b.a, b.b); - } - for (f2 = new olb(a.d); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 447); - m = BD(vNb(e, FSb), 137); - o2 = P6c(e.d, A); - bld(m, o2.a, o2.b); - } - G = p - r + (B.b + B.c); - i3 = q - s + (B.d + B.a); - Afd(l, G, i3, false, true); - } - function bmc(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m; - c2 = null; - i3 = null; - e = BD(vNb(a.b, (Nyc(), Wwc)), 376); - if (e == (_Ac(), ZAc)) { - c2 = new Rkb(); - i3 = new Rkb(); - } - for (h = new olb(a.d); h.a < h.c.c.length; ) { - g = BD(mlb(h), 101); - f2 = g.i; - if (!f2) { - continue; - } - switch (g.e.g) { - case 0: - b = BD(Fqb(new Gqb(g.b)), 61); - e == ZAc && b == (Ucd(), Acd) ? (c2.c[c2.c.length] = g, true) : e == ZAc && b == (Ucd(), Rcd) ? (i3.c[i3.c.length] = g, true) : _lc(g, b); - break; - case 1: - j = g.a.d.j; - k = g.c.d.j; - j == (Ucd(), Acd) ? amc(g, Acd, (Ajc(), xjc), g.a) : k == Acd ? amc(g, Acd, (Ajc(), yjc), g.c) : j == Rcd ? amc(g, Rcd, (Ajc(), yjc), g.a) : k == Rcd && amc(g, Rcd, (Ajc(), xjc), g.c); - break; - case 2: - case 3: - d = g.b; - uqb(d, (Ucd(), Acd)) ? uqb(d, Rcd) ? uqb(d, Tcd) ? uqb(d, zcd) || amc(g, Acd, (Ajc(), yjc), g.c) : amc(g, Acd, (Ajc(), xjc), g.a) : amc(g, Acd, (Ajc(), wjc), null) : amc(g, Rcd, (Ajc(), wjc), null); - break; - case 4: - l = g.a.d.j; - m = g.a.d.j; - l == (Ucd(), Acd) || m == Acd ? amc(g, Rcd, (Ajc(), wjc), null) : amc(g, Acd, (Ajc(), wjc), null); - } - } - if (c2) { - c2.c.length == 0 || $lc(c2, (Ucd(), Acd)); - i3.c.length == 0 || $lc(i3, (Ucd(), Rcd)); - } - } - function A2b(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p; - d = BD(vNb(a, (wtc(), $sc)), 33); - o2 = BD(vNb(a, (Nyc(), Gwc)), 19).a; - f2 = BD(vNb(a, nxc), 19).a; - jkd(d, Gwc, meb(o2)); - jkd(d, nxc, meb(f2)); - dld(d, a.n.a + b.a); - eld(d, a.n.b + b.b); - if (BD(hkd(d, Fxc), 174).gc() != 0 || !!a.e || PD(vNb(Q_b(a), Exc)) === PD((Vzc(), Tzc)) && Jzc((Izc(), (!a.q ? (mmb(), mmb(), kmb) : a.q)._b(Cxc) ? m = BD(vNb(a, Cxc), 197) : m = BD(vNb(Q_b(a), Dxc), 197), m))) { - cld(d, a.o.a); - ald(d, a.o.b); - } - for (l = new olb(a.j); l.a < l.c.c.length; ) { - j = BD(mlb(l), 11); - p = vNb(j, $sc); - if (JD(p, 186)) { - e = BD(p, 118); - bld(e, j.n.a, j.n.b); - jkd(e, $xc, j.j); - } - } - n = BD(vNb(a, xxc), 174).gc() != 0; - for (i3 = new olb(a.b); i3.a < i3.c.c.length; ) { - g = BD(mlb(i3), 70); - if (n || BD(vNb(g, xxc), 174).gc() != 0) { - c2 = BD(vNb(g, $sc), 137); - _kd(c2, g.o.a, g.o.b); - bld(c2, g.n.a, g.n.b); - } - } - if (!tcd(BD(vNb(a, Yxc), 21))) { - for (k = new olb(a.j); k.a < k.c.c.length; ) { - j = BD(mlb(k), 11); - for (h = new olb(j.f); h.a < h.c.c.length; ) { - g = BD(mlb(h), 70); - c2 = BD(vNb(g, $sc), 137); - cld(c2, g.o.a); - ald(c2, g.o.b); - bld(c2, g.n.a, g.n.b); - } - } - } - } - function gtd(a) { - var b, c2, d, e, f2; - ytb(a, hue2); - switch ((!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b).i + (!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c).i) { - case 0: - throw vbb(new Wdb("The edge must have at least one source or target.")); - case 1: - return (!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b).i == 0 ? Xod(atd(BD(qud((!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c), 0), 82))) : Xod(atd(BD(qud((!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b), 0), 82))); - } - if ((!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b).i == 1 && (!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c).i == 1) { - e = atd(BD(qud((!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b), 0), 82)); - f2 = atd(BD(qud((!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c), 0), 82)); - if (Xod(e) == Xod(f2)) { - return Xod(e); - } else if (e == Xod(f2)) { - return e; - } else if (f2 == Xod(e)) { - return f2; - } - } - d = ul(pl(OC(GC(KI, 1), Uhe, 20, 0, [(!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b), (!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c)]))); - b = atd(BD(Rr(d), 82)); - while (Qr(d)) { - c2 = atd(BD(Rr(d), 82)); - if (c2 != b && !ntd(c2, b)) { - if (Xod(c2) == Xod(b)) { - b = Xod(c2); - } else { - b = htd(b, c2); - if (!b) { - return null; - } - } - } + 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(); } - return b; - } - function KNc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2; - Odd(c2, "Polyline edge routing", 1); - q = Edb(ED(vNb(b, (Nyc(), Uwc)))); - n = Edb(ED(vNb(b, wyc))); - e = Edb(ED(vNb(b, myc))); - d = $wnd.Math.min(1, e / n); - t4 = 0; - i3 = 0; - if (b.b.c.length != 0) { - u2 = HNc(BD(Ikb(b.b, 0), 29)); - t4 = 0.4 * d * u2; - } - h = new Bib(b.b, 0); - while (h.b < h.d.gc()) { - g = (sCb(h.b < h.d.gc()), BD(h.d.Xb(h.c = h.b++), 29)); - f2 = Kq(g, DNc); - f2 && t4 > 0 && (t4 -= n); - h_b(g, t4); - k = 0; - for (m = new olb(g.a); m.a < m.c.c.length; ) { - l = BD(mlb(m), 10); - j = 0; - for (p = new Sr(ur(U_b(l).a.Kc(), new Sq())); Qr(p); ) { - o2 = BD(Rr(p), 17); - r = A0b(o2.c).b; - s = A0b(o2.d).b; - if (g == o2.d.i.c && !OZb(o2)) { - LNc(o2, t4, 0.4 * d * $wnd.Math.abs(r - s)); - if (o2.c.j == (Ucd(), Tcd)) { - 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: - MNc(a, l, t4, q); - } - k = $wnd.Math.max(k, j); - } - if (h.b < h.d.gc()) { - u2 = HNc((sCb(h.b < h.d.gc()), BD(h.d.Xb(h.c = h.b++), 29))); - k = $wnd.Math.max(k, u2); - sCb(h.b > 0); - h.a.Xb(h.c = --h.b); - } - i3 = 0.4 * d * k; - !f2 && h.b < h.d.gc() && (i3 += n); - t4 += g.c.a + i3; - } - a.a.a.$b(); - b.f.a = t4; - Qdd(c2); - } - function bic(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s; - k = new Lqb(); - i3 = new Hp(); - for (d = new olb(a.a.a.b); d.a < d.c.c.length; ) { - b = BD(mlb(d), 57); - j = tgc(b); - if (j) { - jrb(k.f, j, b); - } else { - s = ugc(b); - if (s) { - for (f2 = new olb(s.k); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 17); - Rc(i3, e, b); - } - } - } + var _getInfo = getInfo3(node3), edge2 = _getInfo.edge, pred = _getInfo.pred; + path4.unshift(node3[0]); + if (node3.same(thisStart) && path4.length > 0) { + break; } - for (c2 = new olb(a.a.a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 57); - j = tgc(b); - if (j) { - for (h = new Sr(ur(U_b(j).a.Kc(), new Sq())); Qr(h); ) { - g = BD(Rr(h), 17); - if (OZb(g)) { - continue; - } - o2 = g.c; - r = g.d; - if ((Ucd(), Lcd).Hc(g.c.j) && Lcd.Hc(g.d.j)) { - continue; - } - p = BD(Ohb(k, g.d.i), 57); - AFb(DFb(CFb(EFb(BFb(new FFb(), 0), 100), a.c[b.a.d]), a.c[p.a.d])); - if (o2.j == Tcd && l1b((z0b(), o2))) { - for (m = BD(Qc(i3, g), 21).Kc(); m.Ob(); ) { - l = BD(m.Pb(), 57); - if (l.d.c < b.d.c) { - n = a.c[l.a.d]; - q = a.c[b.a.d]; - if (n == q) { - continue; - } - AFb(DFb(CFb(EFb(BFb(new FFb(), 1), 100), n), q)); - } - } - } - if (r.j == zcd && g1b((z0b(), r))) { - for (m = BD(Qc(i3, g), 21).Kc(); m.Ob(); ) { - l = BD(m.Pb(), 57); - if (l.d.c > b.d.c) { - n = a.c[b.a.d]; - q = a.c[l.a.d]; - if (n == q) { - continue; - } - AFb(DFb(CFb(EFb(BFb(new FFb(), 1), 100), n), q)); - } - } - } - } - } + if (edge2 != null) { + path4.unshift(edge2); } + node3 = pred; } - function QEd(a) { - IEd(); - var b, c2, d, e, f2, g, h, i3; - if (a == null) - return null; - e = hfb(a, wfb(37)); - if (e < 0) { - return a; - } else { - i3 = new Wfb(a.substr(0, e)); - b = KC(SD, wte, 25, 4, 15, 1); - h = 0; - d = 0; - for (g = a.length; e < g; e++) { - BCb(e, a.length); - if (a.charCodeAt(e) == 37 && a.length > e + 2 && _Ed((BCb(e + 1, a.length), a.charCodeAt(e + 1)), xEd, yEd) && _Ed((BCb(e + 2, a.length), a.charCodeAt(e + 2)), xEd, yEd)) { - c2 = dFd((BCb(e + 1, a.length), a.charCodeAt(e + 1)), (BCb(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: { - Kfb(i3, ((b[0] & 31) << 6 | b[1] & 63) & aje); - break; - } - case 3: { - Kfb(i3, ((b[0] & 15) << 12 | (b[1] & 63) << 6 | b[2] & 63) & aje); - break; - } - } - h = 0; - d = 0; - } - } else { - for (f2 = 0; f2 < h; ++f2) { - Kfb(i3, b[f2] & aje); - } - h = 0; - i3.a += String.fromCharCode(c2); - } - } else { - for (f2 = 0; f2 < h; ++f2) { - Kfb(i3, b[f2] & aje); - } - h = 0; - Kfb(i3, (BCb(e, a.length), a.charCodeAt(e))); - } - } - return i3.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 wA(a, b, c2, d, e) { - var f2, g, h; - uA(a, b); - g = b[0]; - f2 = bfb(c2.c, 0); - h = -1; - if (nA(c2)) { - if (d > 0) { - if (g + d > a.length) { - return false; - } - h = rA(a.substr(0, g + d), b); - } else { - h = rA(a, b); - } - } - switch (f2) { - case 71: - h = oA(a, g, OC(GC(ZI, 1), nie, 2, 6, [pje, qje]), b); - e.e = h; - return true; - case 77: - return zA(a, b, e, h, g); - case 76: - return BA(a, b, e, h, g); - case 69: - return xA(a, b, g, e); - case 99: - return AA(a, b, g, e); - case 97: - h = oA(a, g, OC(GC(ZI, 1), nie, 2, 6, ["AM", "PM"]), b); - e.b = h; - return true; - case 121: - return DA(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 yA(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 && (BCb(g, a.length), a.charCodeAt(g) == 90)) { - ++b[0]; - e.o = 0; - return true; - } - case 122: - case 118: - return CA(a, g, b, e); - default: - return false; - } + 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 vKb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2; - m = BD(BD(Qc(a.r, b), 21), 84); - if (b == (Ucd(), zcd) || b == Tcd) { - zKb(a, b); - return; - } - f2 = b == Acd ? (vLb(), rLb) : (vLb(), uLb); - u2 = b == Acd ? (EIb(), DIb) : (EIb(), BIb); - c2 = BD(Mpb(a.b, b), 124); - d = c2.i; - e = d.c + w6c(OC(GC(UD, 1), Vje, 25, 15, [c2.n.b, a.C.b, a.k])); - r = d.c + d.b - w6c(OC(GC(UD, 1), Vje, 25, 15, [c2.n.c, a.C.c, a.k])); - g = dLb(iLb(f2), a.t); - s = b == Acd ? Qje : Pje; - for (l = m.Kc(); l.Ob(); ) { - j = BD(l.Pb(), 111); - if (!j.c || j.c.d.c.length <= 0) { - continue; - } - q = j.b.rf(); - p = j.e; - n = j.c; - o2 = n.i; - o2.b = (i3 = n.n, n.e.a + i3.b + i3.c); - o2.a = (h = n.n, n.e.b + h.d + h.a); - ytb(u2, lle); - n.f = u2; - $Hb(n, (NHb(), MHb)); - 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); - Ekb(g.d, new BLb(o2, bLb(g, o2))); - s = b == Acd ? $wnd.Math.max(s, p.b + j.b.rf().b) : $wnd.Math.min(s, p.b); - } - s += b == Acd ? a.t : -a.t; - t4 = cLb((g.e = s, g)); - t4 > 0 && (BD(Mpb(a.b, b), 124).a.b = t4); - for (k = m.Kc(); k.Ob(); ) { - j = BD(k.Pb(), 111); - 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 SPb(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n; - b = new Lqb(); - for (i3 = new Fyd(a); i3.e != i3.i.gc(); ) { - h = BD(Dyd(i3), 33); - c2 = new Tqb(); - Rhb(OPb, h, c2); - n = new aQb(); - e = BD(GAb(new YAb(null, new Lub(new Sr(ur($sd(h).a.Kc(), new Sq())))), Wyb(n, Byb(new fzb(), new dzb(), new Ezb(), OC(GC(xL, 1), Kie, 132, 0, [(Fyb(), Dyb)])))), 83); - RPb(c2, BD(e.xc((Bcb(), true)), 14), new cQb()); - d = BD(GAb(JAb(BD(e.xc(false), 15).Lc(), new eQb()), Byb(new fzb(), new dzb(), new Ezb(), OC(GC(xL, 1), Kie, 132, 0, [Dyb]))), 15); - for (g = d.Kc(); g.Ob(); ) { - f2 = BD(g.Pb(), 79); - m = ktd(f2); - if (m) { - j = BD(Wd(irb(b.f, m)), 21); - if (!j) { - j = UPb(m); - jrb(b.f, m, j); - } - ye(c2, j); - } - } - e = BD(GAb(new YAb(null, new Lub(new Sr(ur(_sd(h).a.Kc(), new Sq())))), Wyb(n, Byb(new fzb(), new dzb(), new Ezb(), OC(GC(xL, 1), Kie, 132, 0, [Dyb])))), 83); - RPb(c2, BD(e.xc(true), 14), new gQb()); - d = BD(GAb(JAb(BD(e.xc(false), 15).Lc(), new iQb()), Byb(new fzb(), new dzb(), new Ezb(), OC(GC(xL, 1), Kie, 132, 0, [Dyb]))), 15); - for (l = d.Kc(); l.Ob(); ) { - k = BD(l.Pb(), 79); - m = mtd(k); - if (m) { - j = BD(Wd(irb(b.f, m)), 21); - if (!j) { - j = UPb(m); - jrb(b.f, m, j); - } - ye(c2, j); - } - } - } - } - function rhb(a, b) { - phb(); - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p; - i3 = ybb(a, 0) < 0; - i3 && (a = Jbb(a)); - if (ybb(a, 0) == 0) { - switch (b) { - case 0: - return "0"; - case 1: - return $je; - 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 Ufb(); - b < 0 ? (n.a += "0E+", n) : (n.a += "0E", n); - n.a += b == Rie ? "2147483648" : "" + -b; - return n.a; - } - } - k = 18; - l = KC(TD, $ie, 25, k + 1, 15, 1); - c2 = k; - p = a; - do { - j = p; - p = Abb(p, 10); - l[--c2] = Tbb(wbb(48, Qbb(j, Ibb(p, 10)))) & aje; - } while (ybb(p, 0) != 0); - e = Qbb(Qbb(Qbb(k, c2), b), 1); - if (b == 0) { - i3 && (l[--c2] = 45); - return zfb(l, c2, k - c2); - } - if (b > 0 && ybb(e, -6) >= 0) { - if (ybb(e, 0) >= 0) { - f2 = c2 + Tbb(e); - for (h = k - 1; h >= f2; h--) { - l[h + 1] = l[h]; - } - l[++f2] = 46; - i3 && (l[--c2] = 45); - return zfb(l, c2, k - c2 + 1); - } - for (g = 2; Gbb(g, wbb(Jbb(e), 1)); g++) { - l[--c2] = 48; - } - l[--c2] = 46; - l[--c2] = 48; - i3 && (l[--c2] = 45); - return zfb(l, c2, k - c2); - } - o2 = c2 + 1; - d = k; - m = new Vfb(); - i3 && (m.a += "-", m); - if (d - o2 >= 1) { - Kfb(m, l[c2]); - m.a += "."; - m.a += zfb(l, c2 + 1, k - c2 - 1); - } else { - m.a += zfb(l, c2, k - c2); - } - m.a += "E"; - ybb(e, 0) > 0 && (m.a += "+", m); - m.a += "" + Ubb(e); - return m.a; - } - function iQc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n; - a.e.a.$b(); - a.f.a.$b(); - a.c.c = KC(SI, Uhe, 1, 0, 5, 1); - a.i.c = KC(SI, Uhe, 1, 0, 5, 1); - a.g.a.$b(); - if (b) { - for (g = new olb(b.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 10); - for (l = Y_b(f2, (Ucd(), zcd)).Kc(); l.Ob(); ) { - k = BD(l.Pb(), 11); - Qqb(a.e, k); - for (e = new olb(k.g); e.a < e.c.c.length; ) { - d = BD(mlb(e), 17); - if (OZb(d)) { - continue; - } - Ekb(a.c, d); - oQc(a, d); - h = d.c.i.k; - (h == (j0b(), h0b) || h == i0b || h == e0b || h == d0b) && Ekb(a.j, d); - n = d.d; - m = n.i.c; - m == c2 ? Qqb(a.f, n) : m == b ? Qqb(a.e, n) : Lkb(a.c, d); - } - } - } - } - if (c2) { - for (g = new olb(c2.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 10); - for (j = new olb(f2.j); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 11); - for (e = new olb(i3.g); e.a < e.c.c.length; ) { - d = BD(mlb(e), 17); - OZb(d) && Qqb(a.g, d); - } - } - for (l = Y_b(f2, (Ucd(), Tcd)).Kc(); l.Ob(); ) { - k = BD(l.Pb(), 11); - Qqb(a.f, k); - for (e = new olb(k.g); e.a < e.c.c.length; ) { - d = BD(mlb(e), 17); - if (OZb(d)) { - continue; - } - Ekb(a.c, d); - oQc(a, d); - h = d.c.i.k; - (h == (j0b(), h0b) || h == i0b || h == e0b || h == d0b) && Ekb(a.j, d); - n = d.d; - m = n.i.c; - m == c2 ? Qqb(a.f, n) : m == b ? Qqb(a.e, n) : Lkb(a.c, d); - } - } - } + }, "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); } } - function Afd(a, b, c2, d, e) { - var f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2; - q = new f7c(a.g, a.f); - p = rfd(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; - u2 = p.a - q.a; - i3 = p.b - q.b; - if (d) { - g = !Xod(a) ? BD(hkd(a, (Y9c(), z8c)), 103) : BD(hkd(Xod(a), (Y9c(), z8c)), 103); - h = PD(hkd(a, (Y9c(), t9c))) === PD((dcd(), $bd)); - for (s = new Fyd((!a.c && (a.c = new cUd(F2, a, 9, 9)), a.c)); s.e != s.i.gc(); ) { - r = BD(Dyd(s), 118); - t4 = BD(hkd(r, A9c), 61); - if (t4 == (Ucd(), Scd)) { - t4 = lfd(r, g); - jkd(r, A9c, t4); - } - switch (t4.g) { - case 1: - h || dld(r, r.i * w2); - break; - case 2: - dld(r, r.i + u2); - h || eld(r, r.j * k); - break; - case 3: - h || dld(r, r.i * w2); - eld(r, r.j + i3); - break; - case 4: - h || eld(r, r.j * k); - } - } - } - _kd(a, p.a, p.b); - if (e) { - for (m = new Fyd((!a.n && (a.n = new cUd(D2, a, 1, 7)), a.n)); m.e != m.i.gc(); ) { - l = BD(Dyd(m), 137); - 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) { - dld(l, l.i + u2); - eld(l, l.j + i3 * j); - } else if (v - j < 0 && n >= 0) { - dld(l, l.i + u2 * v); - eld(l, l.j + i3); - } - } + if (!replacedEdge) { + break; + } + } + 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; } - } - jkd(a, (Y9c(), Y8c), (tdd(), f2 = BD(gdb(I1), 9), new xqb(f2, BD(_Bb(f2, f2.length), 9), 0))); - return new f7c(w2, k); - } - function Yfd(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2; - n = Xod(atd(BD(qud((!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b), 0), 82))); - o2 = Xod(atd(BD(qud((!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c), 0), 82))); - l = n == o2; - h = new d7c(); - b = BD(hkd(a, (Zad(), Sad)), 74); - if (!!b && b.b >= 2) { - if ((!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a).i == 0) { - c2 = (Fhd(), e = new rmd(), e); - wtd((!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a), c2); - } else if ((!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a).i > 1) { - m = new Oyd((!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a)); - while (m.e != m.i.gc()) { - Eyd(m); - } - } - ifd(b, BD(qud((!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a), 0), 202)); - } - if (l) { - for (d = new Fyd((!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a)); d.e != d.i.gc(); ) { - c2 = BD(Dyd(d), 202); - for (j = new Fyd((!c2.a && (c2.a = new xMd(y2, c2, 5)), c2.a)); j.e != j.i.gc(); ) { - i3 = BD(Dyd(j), 469); - h.a = $wnd.Math.max(h.a, i3.a); - h.b = $wnd.Math.max(h.b, i3.b); - } - } - } - for (g = new Fyd((!a.n && (a.n = new cUd(D2, a, 1, 7)), a.n)); g.e != g.i.gc(); ) { - f2 = BD(Dyd(g), 137); - k = BD(hkd(f2, Yad), 8); - !!k && bld(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 yMc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B; - t4 = b.c.length; - e = new ULc(a.a, c2, null, null); - B = KC(UD, Vje, 25, t4, 15, 1); - p = KC(UD, Vje, 25, t4, 15, 1); - o2 = KC(UD, Vje, 25, t4, 15, 1); - q = 0; - for (h = 0; h < t4; h++) { - p[h] = Ohe; - o2[h] = Rie; - } - for (i3 = 0; i3 < t4; i3++) { - d = (tCb(i3, b.c.length), BD(b.c[i3], 180)); - B[i3] = SLc(d); - B[q] > B[i3] && (q = i3); - for (l = new olb(a.a.b); l.a < l.c.c.length; ) { - k = BD(mlb(l), 29); - for (s = new olb(k.a); s.a < s.c.c.length; ) { - r = BD(mlb(s), 10); - w2 = Edb(d.p[r.p]) + Edb(d.d[r.p]); - p[i3] = $wnd.Math.min(p[i3], w2); - o2[i3] = $wnd.Math.max(o2[i3], w2 + r.o.b); - } - } - } - A = KC(UD, Vje, 25, t4, 15, 1); - for (j = 0; j < t4; j++) { - (tCb(j, b.c.length), BD(b.c[j], 180)).o == (eMc(), cMc) ? A[j] = p[q] - p[j] : A[j] = o2[q] - o2[j]; - } - f2 = KC(UD, Vje, 25, t4, 15, 1); - for (n = new olb(a.a.b); n.a < n.c.c.length; ) { - m = BD(mlb(n), 29); - for (v = new olb(m.a); v.a < v.c.c.length; ) { - u2 = BD(mlb(v), 10); - for (g = 0; g < t4; g++) { - f2[g] = Edb((tCb(g, b.c.length), BD(b.c[g], 180)).p[u2.p]) + Edb((tCb(g, b.c.length), BD(b.c[g], 180)).d[u2.p]) + A[g]; - } - f2.sort(dcb(Ylb.prototype.te, Ylb, [])); - e.p[u2.p] = (f2[1] + f2[2]) / 2; - e.d[u2.p] = 0; - } - } - return e; - } - function G3b(a, b, c2) { - var d, e, f2, g, h; - d = b.i; - f2 = a.i.o; - e = a.i.d; - h = a.n; - g = l7c(OC(GC(m1, 1), nie, 8, 0, [h, a.a])); - switch (a.j.g) { - case 1: - _Hb(b, (EIb(), BIb)); - d.d = -e.d - c2 - d.a; - if (BD(BD(Ikb(b.d, 0), 181).We((wtc(), Ssc)), 285) == (rbd(), nbd)) { - $Hb(b, (NHb(), MHb)); - d.c = g.a - Edb(ED(vNb(a, Ysc))) - c2 - d.b; - } else { - $Hb(b, (NHb(), LHb)); - d.c = g.a + Edb(ED(vNb(a, Ysc))) + c2; - } - break; - case 2: - $Hb(b, (NHb(), LHb)); - d.c = f2.a + e.c + c2; - if (BD(BD(Ikb(b.d, 0), 181).We((wtc(), Ssc)), 285) == (rbd(), nbd)) { - _Hb(b, (EIb(), BIb)); - d.d = g.b - Edb(ED(vNb(a, Ysc))) - c2 - d.a; - } else { - _Hb(b, (EIb(), DIb)); - d.d = g.b + Edb(ED(vNb(a, Ysc))) + c2; - } - break; - case 3: - _Hb(b, (EIb(), DIb)); - d.d = f2.b + e.a + c2; - if (BD(BD(Ikb(b.d, 0), 181).We((wtc(), Ssc)), 285) == (rbd(), nbd)) { - $Hb(b, (NHb(), MHb)); - d.c = g.a - Edb(ED(vNb(a, Ysc))) - c2 - d.b; - } else { - $Hb(b, (NHb(), LHb)); - d.c = g.a + Edb(ED(vNb(a, Ysc))) + c2; + if (options3.findNegativeWeightCycles !== false) { + var negativeNodes = []; + if (srcDist + _weight2 < tgtDist) { + negativeNodes.push(_src); } - break; - case 4: - $Hb(b, (NHb(), MHb)); - d.c = -e.b - c2 - d.b; - if (BD(BD(Ikb(b.d, 0), 181).We((wtc(), Ssc)), 285) == (rbd(), nbd)) { - _Hb(b, (EIb(), BIb)); - d.d = g.b - Edb(ED(vNb(a, Ysc))) - c2 - d.a; - } else { - _Hb(b, (EIb(), DIb)); - d.d = g.b + Edb(ED(vNb(a, Ysc))) + c2; - } - } - } - function ded(a, b, c2, d, e, f2, g) { - var h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F, G, H2, I; - n = 0; - D3 = 0; - for (i3 = new olb(a); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 33); - zfd(h); - n = $wnd.Math.max(n, h.g); - D3 += h.g * h.f; - } - o2 = D3 / a.c.length; - C = $dd(a, o2); - D3 += a.c.length * C; - n = $wnd.Math.max(n, $wnd.Math.sqrt(D3 * g)) + c2.b; - H2 = c2.b; - I = c2.d; - m = 0; - k = c2.b + c2.c; - B = new Psb(); - Dsb(B, meb(0)); - w2 = new Psb(); - j = new Bib(a, 0); - while (j.b < j.d.gc()) { - h = (sCb(j.b < j.d.gc()), BD(j.d.Xb(j.c = j.b++), 33)); - G = h.g; - l = h.f; - if (H2 + G > n) { - if (f2) { - Fsb(w2, m); - Fsb(B, meb(j.b - 1)); - } - H2 = c2.b; - I += m + b; - m = 0; - k = $wnd.Math.max(k, c2.b + c2.c + G); - } - dld(h, H2); - eld(h, I); - k = $wnd.Math.max(k, H2 + G + c2.c); - m = $wnd.Math.max(m, l); - H2 += G + b; - } - k = $wnd.Math.max(k, d); - F = I + m + c2.a; - if (F < e) { - m += e - F; - F = e; - } - if (f2) { - H2 = c2.b; - j = new Bib(a, 0); - Fsb(B, meb(a.c.length)); - A = Jsb(B, 0); - r = BD(Xsb(A), 19).a; - Fsb(w2, m); - v = Jsb(w2, 0); - u2 = 0; - while (j.b < j.d.gc()) { - if (j.b == r) { - H2 = c2.b; - u2 = Edb(ED(Xsb(v))); - r = BD(Xsb(A), 19).a; - } - h = (sCb(j.b < j.d.gc()), BD(j.d.Xb(j.c = j.b++), 33)); - s = h.f; - ald(h, u2); - p = u2; - if (j.b == r) { - q = k - H2 - c2.c; - t4 = h.g; - cld(h, q); - Ffd(h, new f7c(q, p), new f7c(t4, s)); - } - H2 += h.g + b; - } - } - return new f7c(k, F); - } - function _Yb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C; - Odd(b, "Compound graph postprocessor", 1); - c2 = Ccb(DD(vNb(a, (Nyc(), Byc)))); - h = BD(vNb(a, (wtc(), zsc)), 224); - k = new Tqb(); - for (r = h.ec().Kc(); r.Ob(); ) { - q = BD(r.Pb(), 17); - g = new Tkb(h.cc(q)); - mmb(); - Okb(g, new EZb(a)); - v = zZb((tCb(0, g.c.length), BD(g.c[0], 243))); - A = AZb(BD(Ikb(g, g.c.length - 1), 243)); - t4 = v.i; - f_b(A.i, t4) ? s = t4.e : s = Q_b(t4); - l = aZb(q, g); - Osb(q.a); - m = null; - for (f2 = new olb(g); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 243); - p = new d7c(); - Y$b(p, e.a, s); - n = e.b; - d = new s7c(); - o7c(d, 0, n.a); - q7c(d, p); - u2 = new g7c(A0b(n.c)); - w2 = new g7c(A0b(n.d)); - P6c(u2, p); - P6c(w2, p); - if (m) { - d.b == 0 ? o2 = w2 : o2 = (sCb(d.b != 0), BD(d.a.a.c, 8)); - B = $wnd.Math.abs(m.a - o2.a) > qme; - C = $wnd.Math.abs(m.b - o2.b) > qme; - (!c2 && B && C || c2 && (B || C)) && Dsb(q.a, u2); - } - ye(q.a, d); - d.b == 0 ? m = u2 : m = (sCb(d.b != 0), BD(d.c.b.c, 8)); - bZb(n, l, p); - if (AZb(e) == A) { - if (Q_b(A.i) != e.a) { - p = new d7c(); - Y$b(p, Q_b(A.i), s); - } - yNb(q, utc, p); - } - cZb(n, q, s); - k.a.zc(n, k); - } - QZb(q, v); - RZb(q, A); - } - for (j = k.a.ec().Kc(); j.Ob(); ) { - i3 = BD(j.Pb(), 17); - QZb(i3, null); - RZb(i3, null); - } - Qdd(b); - } - function KQb(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2; - if (a.gc() == 1) { - return BD(a.Xb(0), 231); - } else if (a.gc() <= 0) { - return new kRb(); - } - for (e = a.Kc(); e.Ob(); ) { - c2 = BD(e.Pb(), 231); - o2 = 0; - k = Ohe; - l = Ohe; - i3 = Rie; - j = Rie; - for (n = new olb(c2.e); n.a < n.c.c.length; ) { - m = BD(mlb(n), 144); - o2 += BD(vNb(m, (wSb(), oSb)), 19).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); - i3 = $wnd.Math.max(i3, m.d.a + m.e.a / 2); - j = $wnd.Math.max(j, m.d.b + m.e.b / 2); - } - yNb(c2, (wSb(), oSb), meb(o2)); - yNb(c2, (HSb(), ESb), new f7c(k, l)); - yNb(c2, DSb, new f7c(i3, j)); - } - mmb(); - a.ad(new OQb()); - p = new kRb(); - tNb(p, BD(a.Xb(0), 94)); - h = 0; - s = 0; - for (f2 = a.Kc(); f2.Ob(); ) { - c2 = BD(f2.Pb(), 231); - q = c7c(R6c(BD(vNb(c2, (HSb(), DSb)), 8)), BD(vNb(c2, ESb), 8)); - h = $wnd.Math.max(h, q.a); - s += q.a * q.b; - } - h = $wnd.Math.max(h, $wnd.Math.sqrt(s) * Edb(ED(vNb(p, (wSb(), bSb))))); - r = Edb(ED(vNb(p, uSb))); - t4 = 0; - u2 = 0; - g = 0; - b = r; - for (d = a.Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 231); - q = c7c(R6c(BD(vNb(c2, (HSb(), DSb)), 8)), BD(vNb(c2, ESb), 8)); - if (t4 + q.a > h) { - t4 = 0; - u2 += g + r; - g = 0; - } - JQb(p, c2, t4, u2); - b = $wnd.Math.max(b, t4 + q.a); - g = $wnd.Math.max(g, q.b); - t4 += q.a + r; - } - return p; - } - function Ioc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2; - k = new s7c(); - switch (a.a.g) { - case 3: - m = BD(vNb(b.e, (wtc(), rtc)), 15); - n = BD(vNb(b.j, rtc), 15); - o2 = BD(vNb(b.f, rtc), 15); - c2 = BD(vNb(b.e, ptc), 15); - d = BD(vNb(b.j, ptc), 15); - e = BD(vNb(b.f, ptc), 15); - g = new Rkb(); - Gkb(g, m); - n.Jc(new Loc()); - Gkb(g, JD(n, 152) ? km(BD(n, 152)) : JD(n, 131) ? BD(n, 131).a : JD(n, 54) ? new ov(n) : new dv(n)); - Gkb(g, o2); - f2 = new Rkb(); - Gkb(f2, c2); - Gkb(f2, JD(d, 152) ? km(BD(d, 152)) : JD(d, 131) ? BD(d, 131).a : JD(d, 54) ? new ov(d) : new dv(d)); - Gkb(f2, e); - yNb(b.f, rtc, g); - yNb(b.f, ptc, f2); - yNb(b.f, stc, b.f); - yNb(b.e, rtc, null); - yNb(b.e, ptc, null); - yNb(b.j, rtc, null); - yNb(b.j, ptc, null); - break; - case 1: - ye(k, b.e.a); - Dsb(k, b.i.n); - ye(k, Su(b.j.a)); - Dsb(k, b.a.n); - ye(k, b.f.a); - break; - default: - ye(k, b.e.a); - ye(k, Su(b.j.a)); - ye(k, b.f.a); - } - Osb(b.f.a); - ye(b.f.a, k); - QZb(b.f, b.e.c); - h = BD(vNb(b.e, (Nyc(), jxc)), 74); - j = BD(vNb(b.j, jxc), 74); - i3 = BD(vNb(b.f, jxc), 74); - if (!!h || !!j || !!i3) { - l = new s7c(); - Goc(l, i3); - Goc(l, j); - Goc(l, h); - yNb(b.f, jxc, l); - } - QZb(b.j, null); - RZb(b.j, null); - QZb(b.e, null); - RZb(b.e, null); - $_b(b.a, null); - $_b(b.i, null); - !!b.g && Ioc(a, b.g); - } - function bde(a) { - ade(); - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q; - if (a == null) - return null; - f2 = rfb(a); - o2 = ede(f2); - if (o2 % 4 != 0) { - return null; - } - p = o2 / 4 | 0; - if (p == 0) - return KC(SD, wte, 25, 0, 15, 1); - l = null; - b = 0; - c2 = 0; - d = 0; - e = 0; - g = 0; - h = 0; - i3 = 0; - j = 0; - n = 0; - m = 0; - k = 0; - l = KC(SD, wte, 25, p * 3, 15, 1); - for (; n < p - 1; n++) { - if (!dde(g = f2[k++]) || !dde(h = f2[k++]) || !dde(i3 = f2[k++]) || !dde(j = f2[k++])) - return null; - b = $ce[g]; - c2 = $ce[h]; - d = $ce[i3]; - e = $ce[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 (!dde(g = f2[k++]) || !dde(h = f2[k++])) { - return null; - } - b = $ce[g]; - c2 = $ce[h]; - i3 = f2[k++]; - j = f2[k++]; - if ($ce[i3] == -1 || $ce[j] == -1) { - if (i3 == 61 && j == 61) { - if ((c2 & 15) != 0) - return null; - q = KC(SD, wte, 25, n * 3 + 1, 15, 1); - $fb(l, 0, q, 0, n * 3); - q[m] = (b << 2 | c2 >> 4) << 24 >> 24; - return q; - } else if (i3 != 61 && j == 61) { - d = $ce[i3]; - if ((d & 3) != 0) - return null; - q = KC(SD, wte, 25, n * 3 + 2, 15, 1); - $fb(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 = $ce[i3]; - e = $ce[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 Sbc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v; - Odd(b, Ine, 1); - o2 = BD(vNb(a, (Nyc(), Swc)), 218); - for (e = new olb(a.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 29); - j = l_b(d.a); - for (g = j, h = 0, i3 = g.length; h < i3; ++h) { - f2 = g[h]; - if (f2.k != (j0b(), i0b)) { - continue; + if (!directed && tgtDist + _weight2 < srcDist) { + negativeNodes.push(_tgt); } - if (o2 == (Aad(), yad)) { - for (l = new olb(f2.j); l.a < l.c.c.length; ) { - k = BD(mlb(l), 11); - k.e.c.length == 0 || Vbc(k); - k.g.c.length == 0 || Wbc(k); + 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; } - } else if (JD(vNb(f2, (wtc(), $sc)), 17)) { - q = BD(vNb(f2, $sc), 17); - r = BD(Y_b(f2, (Ucd(), Tcd)).Kc().Pb(), 11); - s = BD(Y_b(f2, zcd).Kc().Pb(), 11); - t4 = BD(vNb(r, $sc), 11); - u2 = BD(vNb(s, $sc), 11); - QZb(q, u2); - RZb(q, t4); - v = new g7c(s.i.n); - v.a = l7c(OC(GC(m1, 1), nie, 8, 0, [u2.i.n, u2.n, u2.a])).a; - Dsb(q.a, v); - v = new g7c(r.i.n); - v.a = l7c(OC(GC(m1, 1), nie, 8, 0, [t4.i.n, t4.n, t4.a])).a; - Dsb(q.a, v); - } else { - if (f2.j.c.length >= 2) { - p = true; - m = new olb(f2.j); - c2 = BD(mlb(m), 11); - n = null; - while (m.a < m.c.c.length) { - n = c2; - c2 = BD(mlb(m), 11); - if (!pb(vNb(n, $sc), vNb(c2, $sc))) { - p = false; - break; - } + 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; } - } else { - p = false; - } - for (l = new olb(f2.j); l.a < l.c.c.length; ) { - k = BD(mlb(l), 11); - k.e.c.length == 0 || Tbc(k, p); - k.g.c.length == 0 || Ubc(k, p); - } - } - $_b(f2, null); - } - } - Qdd(b); - } - function KJc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B; - t4 = a.c[(tCb(0, b.c.length), BD(b.c[0], 17)).p]; - A = a.c[(tCb(1, b.c.length), BD(b.c[1], 17)).p]; - if (t4.a.e.e - t4.a.a - (t4.b.e.e - t4.b.a) == 0 && A.a.e.e - A.a.a - (A.b.e.e - A.b.a) == 0) { - return false; - } - r = t4.b.e.f; - if (!JD(r, 10)) { - return false; - } - q = BD(r, 10); - v = a.i[q.p]; - w2 = !q.c ? -1 : Jkb(q.c.a, q, 0); - f2 = Pje; - if (w2 > 0) { - e = BD(Ikb(q.c.a, w2 - 1), 10); - g = a.i[e.p]; - B = $wnd.Math.ceil(jBc(a.n, e, q)); - f2 = v.a.e - q.d.d - (g.a.e + e.o.b + e.d.a) - B; - } - j = Pje; - if (w2 < q.c.a.c.length - 1) { - i3 = BD(Ikb(q.c.a, w2 + 1), 10); - k = a.i[i3.p]; - B = $wnd.Math.ceil(jBc(a.n, i3, q)); - j = k.a.e - i3.d.d - (v.a.e + q.o.b + q.d.a) - B; - } - if (c2 && (Iy(), My(Jqe), $wnd.Math.abs(f2 - j) <= Jqe || f2 == j || isNaN(f2) && isNaN(j))) { - return true; - } - d = gKc(t4.a); - h = -gKc(t4.b); - l = -gKc(A.a); - s = gKc(A.b); - p = t4.a.e.e - t4.a.a - (t4.b.e.e - t4.b.a) > 0 && A.a.e.e - A.a.a - (A.b.e.e - A.b.a) < 0; - o2 = t4.a.e.e - t4.a.a - (t4.b.e.e - t4.b.a) < 0 && A.a.e.e - A.a.a - (A.b.e.e - A.b.a) > 0; - n = t4.a.e.e + t4.b.a < A.b.e.e + A.a.a; - m = t4.a.e.e + t4.b.a > A.b.e.e + A.a.a; - u2 = 0; - !p && !o2 && (m ? f2 + l > 0 ? u2 = l : j - d > 0 && (u2 = d) : n && (f2 + h > 0 ? u2 = h : j - s > 0 && (u2 = s))); - v.a.e += u2; - v.b && (v.d.e += u2); - return false; - } - function XGb(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m; - d = new J6c(b.qf().a, b.qf().b, b.rf().a, b.rf().b); - e = new I6c(); - if (a.c) { - for (g = new olb(b.wf()); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 181); - e.c = f2.qf().a + b.qf().a; - e.d = f2.qf().b + b.qf().b; - e.b = f2.rf().a; - e.a = f2.rf().b; - H6c(d, e); - } - } - for (j = new olb(b.Cf()); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 838); - k = i3.qf().a + b.qf().a; - l = i3.qf().b + b.qf().b; - if (a.e) { - e.c = k; - e.d = l; - e.b = i3.rf().a; - e.a = i3.rf().b; - H6c(d, e); - } - if (a.d) { - for (g = new olb(i3.wf()); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 181); - e.c = f2.qf().a + k; - e.d = f2.qf().b + l; - e.b = f2.rf().a; - e.a = f2.rf().b; - H6c(d, e); - } - } - if (a.b) { - m = new f7c(-c2, -c2); - if (BD(b.We((Y9c(), x9c)), 174).Hc((rcd(), pcd))) { - for (g = new olb(i3.wf()); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 181); - m.a += f2.rf().a + c2; - m.b += f2.rf().b + c2; } - } - m.a = $wnd.Math.max(m.a, 0); - m.b = $wnd.Math.max(m.b, 0); - VGb(d, i3.Bf(), i3.zf(), b, i3, m, c2); - } - } - a.b && VGb(d, b.Bf(), b.zf(), b, null, null, c2); - h = new K_b(b.Af()); - h.d = $wnd.Math.max(0, b.qf().b - d.d); - h.a = $wnd.Math.max(0, d.d + d.a - (b.qf().b + b.rf().b)); - h.b = $wnd.Math.max(0, b.qf().a - d.c); - h.c = $wnd.Math.max(0, d.c + d.b - (b.qf().a + b.rf().a)); - b.Ef(h); - } - function wz() { - 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 pid(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m; - i3 = new Rkb(); - l = b.length; - g = AUd(c2); - for (j = 0; j < l; ++j) { - k = ifb(b, wfb(61), j); - d = $hd(g, b.substr(j, k - j)); - e = KJd(d); - f2 = e.Aj().Nh(); - switch (bfb(b, ++k)) { - case 39: { - h = gfb(b, 39, ++k); - Ekb(i3, new kGd(d, Pid(b.substr(k, h - k), f2, e))); - j = h + 1; - break; - } - case 34: { - h = gfb(b, 34, ++k); - Ekb(i3, new kGd(d, Pid(b.substr(k, h - k), f2, e))); - j = h + 1; - break; - } - case 91: { - m = new Rkb(); - Ekb(i3, new kGd(d, m)); - n: - for (; ; ) { - switch (bfb(b, ++k)) { - case 39: { - h = gfb(b, 39, ++k); - Ekb(m, Pid(b.substr(k, h - k), f2, e)); - k = h + 1; - break; - } - case 34: { - h = gfb(b, 34, ++k); - Ekb(m, Pid(b.substr(k, h - k), f2, e)); - k = h + 1; - break; - } - case 110: { - ++k; - if (b.indexOf("ull", k) == k) { - m.c[m.c.length] = null; - } else { - throw vbb(new hz(kte)); - } - k += 3; - break; - } - } - if (k < l) { - switch (BCb(k, b.length), b.charCodeAt(k)) { - case 44: { - break; - } - case 93: { - break n; - } - default: { - throw vbb(new hz("Expecting , or ]")); - } - } - } else { - break; - } - } - j = k + 1; - break; - } - case 110: { - ++k; - if (b.indexOf("ull", k) == k) { - Ekb(i3, new kGd(d, null)); - } else { - throw vbb(new hz(kte)); + 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); } - j = k + 3; - break; - } - } - if (j < l) { - BCb(j, b.length); - if (b.charCodeAt(j) != 44) { - throw vbb(new hz("Expecting ,")); } } else { break; } } - return qid(a, i3, c2); } - function AKb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m; - j = BD(BD(Qc(a.r, b), 21), 84); - g = bKb(a, b); - c2 = a.u.Hc((rcd(), lcd)); - for (i3 = j.Kc(); i3.Ob(); ) { - h = BD(i3.Pb(), 111); - if (!h.c || h.c.d.c.length <= 0) { - continue; - } - m = h.b.rf(); - 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; - $Hb(k, (NHb(), KHb)); - } else if (g || c2) { - l.c = -l.b - a.s; - $Hb(k, (NHb(), MHb)); - } else { - l.c = m.a + a.s; - $Hb(k, (NHb(), LHb)); - } - l.d = -l.a - a.t; - _Hb(k, (EIb(), BIb)); - break; - case 3: - if (h.a) { - l.c = (m.a - l.b) / 2; - $Hb(k, (NHb(), KHb)); - } else if (g || c2) { - l.c = -l.b - a.s; - $Hb(k, (NHb(), MHb)); - } else { - l.c = m.a + a.s; - $Hb(k, (NHb(), LHb)); - } - l.d = m.b + a.t; - _Hb(k, (EIb(), DIb)); - break; - case 2: - if (h.a) { - d = a.v ? l.a : BD(Ikb(k.d, 0), 181).rf().b; - l.d = (m.b - d) / 2; - _Hb(k, (EIb(), CIb)); - } else if (g || c2) { - l.d = -l.a - a.t; - _Hb(k, (EIb(), BIb)); - } else { - l.d = m.b + a.t; - _Hb(k, (EIb(), DIb)); - } - l.c = m.a + a.s; - $Hb(k, (NHb(), LHb)); - break; - case 4: - if (h.a) { - d = a.v ? l.a : BD(Ikb(k.d, 0), 181).rf().b; - l.d = (m.b - d) / 2; - _Hb(k, (EIb(), CIb)); - } else if (g || c2) { - l.d = -l.a - a.t; - _Hb(k, (EIb(), BIb)); - } else { - l.d = m.b + a.t; - _Hb(k, (EIb(), DIb)); - } - l.c = -l.b - a.s; - $Hb(k, (NHb(), MHb)); - } - g = false; - } - } - function Kfe(a, b) { - wfe(); - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2; - if (Vhb(Zee) == 0) { - l = KC(lbb, nie, 117, _ee.length, 0, 1); - for (g = 0; g < l.length; g++) { - l[g] = new $fe(4); - } - d = new Ifb(); - for (f2 = 0; f2 < Yee.length; f2++) { - k = new $fe(4); - if (f2 < 84) { - h = f2 * 2; - n = (BCb(h, wxe.length), wxe.charCodeAt(h)); - m = (BCb(h + 1, wxe.length), wxe.charCodeAt(h + 1)); - Ufe(k, n, m); - } else { - h = (f2 - 84) * 2; - Ufe(k, afe[h], afe[h + 1]); - } - i3 = Yee[f2]; - dfb(i3, "Specials") && Ufe(k, 65520, 65533); - if (dfb(i3, uxe)) { - Ufe(k, 983040, 1048573); - Ufe(k, 1048576, 1114109); - } - Shb(Zee, i3, k); - Shb($ee, i3, _fe(k)); - j = d.a.length; - 0 < j ? d.a = d.a.substr(0, 0) : 0 > j && (d.a += yfb(KC(TD, $ie, 25, -j, 15, 1))); - d.a += "Is"; - if (hfb(i3, wfb(32)) >= 0) { - for (e = 0; e < i3.length; e++) { - BCb(e, i3.length); - i3.charCodeAt(e) != 32 && Afb(d, (BCb(e, i3.length), i3.charCodeAt(e))); - } - } else { - d.a += "" + i3; - } - Ofe(d.a, i3, true); - } - Ofe(vxe, "Cn", false); - Ofe(xxe, "Cn", true); - c2 = new $fe(4); - Ufe(c2, 0, lxe); - Shb(Zee, "ALL", c2); - Shb($ee, "ALL", _fe(c2)); - !bfe && (bfe = new Lqb()); - Shb(bfe, vxe, vxe); - !bfe && (bfe = new Lqb()); - Shb(bfe, xxe, xxe); - !bfe && (bfe = new Lqb()); - Shb(bfe, "ALL", "ALL"); - } - o2 = b ? BD(Phb(Zee, a), 136) : BD(Phb($ee, a), 136); - return o2; - } - function c3b(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s; - m = false; - l = false; - if (fcd(BD(vNb(d, (Nyc(), Vxc)), 98))) { - g = false; - h = false; - t: - for (o2 = new olb(d.j); o2.a < o2.c.c.length; ) { - n = BD(mlb(o2), 11); - for (q = ul(pl(OC(GC(KI, 1), Uhe, 20, 0, [new J0b(n), new R0b(n)]))); Qr(q); ) { - p = BD(Rr(q), 11); - if (!Ccb(DD(vNb(p.i, pwc)))) { - if (n.j == (Ucd(), Acd)) { - g = true; - break t; - } - if (n.j == Rcd) { - h = true; - break t; - } - } - } - } - m = h && !g; - l = g && !h; - } - if (!m && !l && d.b.c.length != 0) { - k = 0; - for (j = new olb(d.b); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 70); - k += i3.n.b + i3.o.b / 2; - } - k /= d.b.c.length; - s = k >= d.o.b / 2; - } else { - s = !l; - } - if (s) { - r = BD(vNb(d, (wtc(), vtc)), 15); - if (!r) { - f2 = new Rkb(); - yNb(d, vtc, f2); - } else if (m) { - f2 = r; - } else { - e = BD(vNb(d, tsc), 15); - if (!e) { - f2 = new Rkb(); - yNb(d, tsc, f2); - } else { - r.gc() <= e.gc() ? f2 = r : f2 = e; - } - } - } else { - e = BD(vNb(d, (wtc(), tsc)), 15); - if (!e) { - f2 = new Rkb(); - yNb(d, tsc, f2); - } else if (l) { - f2 = e; - } else { - r = BD(vNb(d, vtc), 15); - if (!r) { - f2 = new Rkb(); - yNb(d, vtc, f2); - } else { - e.gc() <= r.gc() ? f2 = e : f2 = r; - } - } - } - f2.Fc(a); - yNb(a, (wtc(), vsc), c2); - if (b.d == c2) { - RZb(b, null); - c2.e.c.length + c2.g.c.length == 0 && F0b(c2, null); - d3b(c2); - } else { - QZb(b, null); - c2.e.c.length + c2.g.c.length == 0 && F0b(c2, null); - } - Osb(b.a); - } - function aoc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F, G, H2; - s = new Bib(a.b, 0); - k = b.Kc(); - o2 = 0; - j = BD(k.Pb(), 19).a; - v = 0; - c2 = new Tqb(); - A = new zsb(); - while (s.b < s.d.gc()) { - r = (sCb(s.b < s.d.gc()), BD(s.d.Xb(s.c = s.b++), 29)); - for (u2 = new olb(r.a); u2.a < u2.c.c.length; ) { - t4 = BD(mlb(u2), 10); - for (n = new Sr(ur(U_b(t4).a.Kc(), new Sq())); Qr(n); ) { - l = BD(Rr(n), 17); - A.a.zc(l, A); - } - for (m = new Sr(ur(R_b(t4).a.Kc(), new Sq())); Qr(m); ) { - l = BD(Rr(m), 17); - A.a.Bc(l) != null; - } - } - if (o2 + 1 == j) { - e = new H1b(a); - Aib(s, e); - f2 = new H1b(a); - Aib(s, f2); - for (C = A.a.ec().Kc(); C.Ob(); ) { - B = BD(C.Pb(), 17); - if (!c2.a._b(B)) { - ++v; - c2.a.zc(B, c2); - } - g = new b0b(a); - yNb(g, (Nyc(), Vxc), (dcd(), acd)); - $_b(g, e); - __b(g, (j0b(), d0b)); - p = new H0b(); - F0b(p, g); - G0b(p, (Ucd(), Tcd)); - D3 = new H0b(); - F0b(D3, g); - G0b(D3, zcd); - d = new b0b(a); - yNb(d, Vxc, acd); - $_b(d, f2); - __b(d, d0b); - q = new H0b(); - F0b(q, d); - G0b(q, Tcd); - F = new H0b(); - F0b(F, d); - G0b(F, zcd); - w2 = new UZb(); - QZb(w2, B.c); - RZb(w2, p); - H2 = new UZb(); - QZb(H2, D3); - RZb(H2, q); - QZb(B, F); - h = new goc(g, d, w2, H2, B); - yNb(g, (wtc(), usc), h); - yNb(d, usc, h); - G = w2.c.i; - if (G.k == d0b) { - i3 = BD(vNb(G, usc), 305); - i3.d = h; - h.g = i3; - } - } - if (k.Ob()) { - j = BD(k.Pb(), 19).a; - } else { - break; - } - } - ++o2; - } - return meb(v); - } - function T1b(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p; - l = 0; - for (e = new Fyd((!b.a && (b.a = new cUd(E2, b, 10, 11)), b.a)); e.e != e.i.gc(); ) { - d = BD(Dyd(e), 33); - if (!Ccb(DD(hkd(d, (Nyc(), Jxc))))) { - if ((PD(hkd(b, ywc)) !== PD((tAc(), rAc)) || PD(hkd(b, Jwc)) === PD((mqc(), lqc)) || PD(hkd(b, Jwc)) === PD((mqc(), jqc)) || Ccb(DD(hkd(b, Awc))) || PD(hkd(b, twc)) !== PD((RXb(), QXb))) && !Ccb(DD(hkd(d, xwc)))) { - jkd(d, (wtc(), Zsc), meb(l)); - ++l; - } - $1b(a, d, c2); - } - } - l = 0; - for (j = new Fyd((!b.b && (b.b = new cUd(B2, b, 12, 3)), b.b)); j.e != j.i.gc(); ) { - h = BD(Dyd(j), 79); - if (PD(hkd(b, (Nyc(), ywc))) !== PD((tAc(), rAc)) || PD(hkd(b, Jwc)) === PD((mqc(), lqc)) || PD(hkd(b, Jwc)) === PD((mqc(), jqc)) || Ccb(DD(hkd(b, Awc))) || PD(hkd(b, twc)) !== PD((RXb(), QXb))) { - jkd(h, (wtc(), Zsc), meb(l)); - ++l; - } - o2 = jtd(h); - p = ltd(h); - k = Ccb(DD(hkd(o2, fxc))); - n = !Ccb(DD(hkd(h, Jxc))); - m = k && Qld(h) && Ccb(DD(hkd(h, gxc))); - f2 = Xod(o2) == b && Xod(o2) == Xod(p); - g = (Xod(o2) == b && p == b) ^ (Xod(p) == b && o2 == b); - n && !m && (g || f2) && X1b(a, h, b, c2); - } - if (Xod(b)) { - for (i3 = new Fyd(Wod(Xod(b))); i3.e != i3.i.gc(); ) { - h = BD(Dyd(i3), 79); - o2 = jtd(h); - if (o2 == b && Qld(h)) { - m = Ccb(DD(hkd(o2, (Nyc(), fxc)))) && Ccb(DD(hkd(h, gxc))); - m && X1b(a, h, b, c2); - } - } - } - } - function gDc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F, G, H2, I; - Odd(c2, "MinWidth layering", 1); - n = b.b; - A = b.a; - I = BD(vNb(b, (Nyc(), oxc)), 19).a; - h = BD(vNb(b, pxc), 19).a; - a.b = Edb(ED(vNb(b, lyc))); - a.d = Pje; - for (u2 = new olb(A); u2.a < u2.c.c.length; ) { - s = BD(mlb(u2), 10); - if (s.k != (j0b(), h0b)) { - continue; - } - D3 = s.o.b; - a.d = $wnd.Math.min(a.d, D3); - } - a.d = $wnd.Math.max(1, a.d); - B = A.c.length; - a.c = KC(WD, oje, 25, B, 15, 1); - a.f = KC(WD, oje, 25, B, 15, 1); - a.e = KC(UD, Vje, 25, B, 15, 1); - j = 0; - a.a = 0; - for (v = new olb(A); v.a < v.c.c.length; ) { - s = BD(mlb(v), 10); - s.p = j++; - a.c[s.p] = eDc(R_b(s)); - a.f[s.p] = eDc(U_b(s)); - a.e[s.p] = s.o.b / a.d; - a.a += a.e[s.p]; - } - a.b /= a.d; - a.a /= B; - w2 = fDc(A); - Okb(A, tmb(new mDc(a))); - p = Pje; - o2 = Ohe; - g = null; - H2 = I; - G = I; - f2 = h; - e = h; - if (I < 0) { - H2 = BD(bDc.a.zd(), 19).a; - G = BD(bDc.b.zd(), 19).a; - } - if (h < 0) { - f2 = BD(aDc.a.zd(), 19).a; - e = BD(aDc.b.zd(), 19).a; - } - for (F = H2; F <= G; F++) { - for (d = f2; d <= e; d++) { - C = dDc(a, F, d, A, w2); - r = Edb(ED(C.a)); - m = BD(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 = BD(l.Pb(), 15); - i3 = new H1b(b); - for (t4 = k.Kc(); t4.Ob(); ) { - s = BD(t4.Pb(), 10); - $_b(s, i3); - } - n.c[n.c.length] = i3; - } - smb(n); - A.c = KC(SI, Uhe, 1, 0, 5, 1); - Qdd(c2); - } - function I6b(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3; - a.b = b; - a.a = BD(vNb(b, (Nyc(), bxc)), 19).a; - a.c = BD(vNb(b, dxc), 19).a; - a.c == 0 && (a.c = Ohe); - q = new Bib(b.b, 0); - while (q.b < q.d.gc()) { - p = (sCb(q.b < q.d.gc()), BD(q.d.Xb(q.c = q.b++), 29)); - h = new Rkb(); - k = -1; - u2 = -1; - for (t4 = new olb(p.a); t4.a < t4.c.c.length; ) { - s = BD(mlb(t4), 10); - if (sr((D6b(), new Sr(ur(O_b(s).a.Kc(), new Sq())))) >= a.a) { - d = E6b(a, s); - k = $wnd.Math.max(k, d.b); - u2 = $wnd.Math.max(u2, d.d); - Ekb(h, new vgd(s, d)); - } - } - B = new Rkb(); - for (j = 0; j < k; ++j) { - Dkb(B, 0, (sCb(q.b > 0), q.a.Xb(q.c = --q.b), C = new H1b(a.b), Aib(q, C), sCb(q.b < q.d.gc()), q.d.Xb(q.c = q.b++), C)); - } - for (g = new olb(h); g.a < g.c.c.length; ) { - e = BD(mlb(g), 46); - n = BD(e.b, 571).a; - if (!n) { - continue; - } - for (m = new olb(n); m.a < m.c.c.length; ) { - l = BD(mlb(m), 10); - H6b(a, l, B6b, B); - } - } - c2 = new Rkb(); - for (i3 = 0; i3 < u2; ++i3) { - Ekb(c2, (D3 = new H1b(a.b), Aib(q, D3), D3)); - } - for (f2 = new olb(h); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 46); - A = BD(e.b, 571).c; - if (!A) { - continue; - } - for (w2 = new olb(A); w2.a < w2.c.c.length; ) { - v = BD(mlb(w2), 10); - H6b(a, v, C6b, c2); - } - } - } - r = new Bib(b.b, 0); - while (r.b < r.d.gc()) { - o2 = (sCb(r.b < r.d.gc()), BD(r.d.Xb(r.c = r.b++), 29)); - o2.a.c.length == 0 && uib(r); - } - } - function uQc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F, G; - Odd(c2, "Spline edge routing", 1); - if (b.b.c.length == 0) { - b.f.a = 0; - Qdd(c2); - return; - } - s = Edb(ED(vNb(b, (Nyc(), wyc)))); - h = Edb(ED(vNb(b, pyc))); - g = Edb(ED(vNb(b, myc))); - r = BD(vNb(b, Xwc), 336); - B = r == (tBc(), sBc); - A = Edb(ED(vNb(b, Ywc))); - a.d = b; - a.j.c = KC(SI, Uhe, 1, 0, 5, 1); - a.a.c = KC(SI, Uhe, 1, 0, 5, 1); - Uhb(a.k); - i3 = BD(Ikb(b.b, 0), 29); - k = Kq(i3.a, (FNc(), DNc)); - o2 = BD(Ikb(b.b, b.b.c.length - 1), 29); - l = Kq(o2.a, DNc); - p = new olb(b.b); - q = null; - G = 0; - do { - t4 = p.a < p.c.c.length ? BD(mlb(p), 29) : null; - iQc(a, q, t4); - lQc(a); - C = Vtb(uAb(PAb(JAb(new YAb(null, new Kub(a.i, 16)), new LQc()), new NQc()))); - F = 0; - u2 = G; - m = !q || k && q == i3; - n = !t4 || l && t4 == o2; - if (C > 0) { - j = 0; - !!q && (j += h); - j += (C - 1) * g; - !!t4 && (j += h); - B && !!t4 && (j = $wnd.Math.max(j, jQc(t4, g, s, A))); - if (j < s && !m && !n) { - F = (s - j) / 2; - j = s; - } - u2 += j; - } else - !m && !n && (u2 += s); - !!t4 && h_b(t4, u2); - for (w2 = new olb(a.i); w2.a < w2.c.c.length; ) { - v = BD(mlb(w2), 128); - v.a.c = G; - v.a.b = u2 - G; - v.F = F; - v.p = !q; - } - Gkb(a.a, a.i); - G = u2; - !!t4 && (G += t4.c.a); - q = t4; - m = n; - } while (t4); - for (e = new olb(a.j); e.a < e.c.c.length; ) { - d = BD(mlb(e), 17); - f2 = pQc(a, d); - yNb(d, (wtc(), ptc), f2); - D3 = rQc(a, d); - yNb(d, rtc, D3); - } - b.f.a = G; - a.d = null; - Qdd(c2); - } - function Yxd(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2; - p = a.i != 0; - t4 = false; - r = null; - if (oid(a.e)) { - k = b.gc(); - if (k > 0) { - m = k < 100 ? null : new Ixd(k); - j = new Aud(b); - o2 = j.g; - r = KC(WD, oje, 25, k, 15, 1); - d = 0; - u2 = new zud(k); - for (e = 0; e < a.i; ++e) { - h = a.g[e]; - n = h; - v: - for (s = 0; s < 2; ++s) { - for (i3 = k; --i3 >= 0; ) { - if (n != null ? pb(n, o2[i3]) : PD(n) === PD(o2[i3])) { - if (r.length <= d) { - q = r; - r = KC(WD, oje, 25, 2 * r.length, 15, 1); - $fb(q, 0, r, 0, d); - } - r[d++] = e; - wtd(u2, o2[i3]); - break v; - } - } - n = n; - if (PD(n) === PD(h)) { - break; - } - } - } - j = u2; - o2 = u2.g; - k = d; - if (d > r.length) { - q = r; - r = KC(WD, oje, 25, d, 15, 1); - $fb(q, 0, r, 0, d); - } - if (d > 0) { - t4 = true; - for (f2 = 0; f2 < d; ++f2) { - n = o2[f2]; - m = k3d(a, BD(n, 72), m); - } - for (g = d; --g >= 0; ) { - tud(a, r[g]); - } - if (d != k) { - for (e = k; --e >= d; ) { - tud(j, e); - } - q = r; - r = KC(WD, oje, 25, d, 15, 1); - $fb(q, 0, r, 0, d); - } - b = j; - } - } - } else { - b = Ctd(a, b); - for (e = a.i; --e >= 0; ) { - if (b.Hc(a.g[e])) { - tud(a, e); - t4 = true; - } - } - } - if (t4) { - if (r != null) { - c2 = b.gc(); - l = c2 == 1 ? FLd(a, 4, b.Kc().Pb(), null, r[0], p) : FLd(a, 6, b, r, r[0], p); - m = c2 < 100 ? null : new Ixd(c2); - for (e = b.Kc(); e.Ob(); ) { - n = e.Pb(); - m = Q2d(a, BD(n, 72), m); - } - if (!m) { - Uhd(a.e, l); - } else { - m.Ei(l); - m.Fi(); - } - } else { - m = Vxd(b.gc()); - for (e = b.Kc(); e.Ob(); ) { - n = e.Pb(); - m = Q2d(a, BD(n, 72), m); - } - !!m && m.Fi(); - } - return true; - } else { - return false; - } - } - function fYb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4; - c2 = new mYb(b); - c2.a || $Xb(b); - j = ZXb(b); - i3 = new Hp(); - q = new AYb(); - for (p = new olb(b.a); p.a < p.c.c.length; ) { - o2 = BD(mlb(p), 10); - for (e = new Sr(ur(U_b(o2).a.Kc(), new Sq())); Qr(e); ) { - d = BD(Rr(e), 17); - if (d.c.i.k == (j0b(), e0b) || d.d.i.k == e0b) { - k = eYb(a, d, j, q); - Rc(i3, cYb(k.d), k.a); - } - } - } - g = new Rkb(); - for (t4 = BD(vNb(c2.c, (wtc(), Esc)), 21).Kc(); t4.Ob(); ) { - s = BD(t4.Pb(), 61); - 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 J6c(a.d.a, n, j.b.a - a.d.a, m - n); - r = new J6c(a.d.a, n, h, m - n); - iYb(j, new f7c(f2.c + f2.b, f2.d)); - iYb(j, new f7c(f2.c + f2.b, f2.d + f2.a)); - break; - case 2: - f2 = new J6c(j.a.a, n, a.c.a - j.a.a, m - n); - r = new J6c(a.c.a - h, n, h, m - n); - iYb(j, new f7c(f2.c, f2.d)); - iYb(j, new f7c(f2.c, f2.d + f2.a)); - break; - case 1: - f2 = new J6c(n, a.d.b, m - n, j.b.b - a.d.b); - r = new J6c(n, a.d.b, m - n, h); - iYb(j, new f7c(f2.c, f2.d + f2.a)); - iYb(j, new f7c(f2.c + f2.b, f2.d + f2.a)); - break; - case 3: - f2 = new J6c(n, j.a.b, m - n, a.c.b - j.a.b); - r = new J6c(n, a.c.b - h, m - n, h); - iYb(j, new f7c(f2.c, f2.d)); - iYb(j, new f7c(f2.c + f2.b, f2.d)); - } - if (f2) { - l = new vYb(); - l.d = s; - l.b = f2; - l.c = r; - l.a = Dx(BD(Qc(i3, cYb(s)), 21)); - g.c[g.c.length] = l; - } - } - Gkb(c2.b, g); - c2.d = BWb(JWb(j)); - return c2; - } - function pMc(a, b, c2) { - var d, e, f2, g, h, i3, 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 == (eMc(), cMc) ? Qje : Pje; - do { - e = a.b.e[g.p]; - f2 = g.c.a.c.length; - if (c2.o == cMc && e > 0 || c2.o == dMc && e < f2 - 1) { - i3 = null; - j = null; - c2.o == dMc ? i3 = BD(Ikb(g.c.a, e + 1), 10) : i3 = BD(Ikb(g.c.a, e - 1), 10); - j = c2.g[i3.p]; - pMc(a, j, c2); - p = a.e.bg(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 = jBc(a.d, g, i3); - if (c2.o == dMc) { - d = Edb(c2.p[b.p]); - l = Edb(c2.p[j.p]) + Edb(c2.d[i3.p]) - i3.d.d - o2 - g.d.a - g.o.b - Edb(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 = Edb(c2.p[b.p]); - l = Edb(c2.p[j.p]) + Edb(c2.d[i3.p]) + i3.o.b + i3.d.a + o2 + g.d.d - Edb(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 = Edb(ED(vNb(a.a, (Nyc(), vyc)))); - n = nMc(a, c2.j[b.p]); - k = nMc(a, c2.j[j.p]); - if (c2.o == dMc) { - m = Edb(c2.p[b.p]) + Edb(c2.d[g.p]) + g.o.b + g.d.a + o2 - (Edb(c2.p[j.p]) + Edb(c2.d[i3.p]) - i3.d.d); - tMc(n, k, m); - } else { - m = Edb(c2.p[b.p]) + Edb(c2.d[g.p]) - g.d.d - Edb(c2.p[j.p]) - Edb(c2.d[i3.p]) - i3.o.b - i3.d.a - o2; - tMc(n, k, m); - } - } - } else { - p = a.e.bg(p, b, g); - } - g = c2.a[g.p]; - } while (g != b); - SMc(a.e, b); - } - function _qd(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F, G; - t4 = b; - s = new Hp(); - u2 = new Hp(); - k = Ypd(t4, Nte); - d = new ord(a, c2, s, u2); - qqd(d.a, d.b, d.c, d.d, k); - i3 = (A = s.i, !A ? s.i = new zf(s, s.c) : A); - for (C = i3.Kc(); C.Ob(); ) { - B = BD(C.Pb(), 202); - e = BD(Qc(s, B), 21); - for (p = e.Kc(); p.Ob(); ) { - o2 = p.Pb(); - v = BD(oo(a.d, o2), 202); - if (v) { - h = (!B.e && (B.e = new y5d(A2, B, 10, 9)), B.e); - wtd(h, v); - } else { - g = _pd(t4, Vte); - m = _te + o2 + aue + g; - n = m + $te; - throw vbb(new cqd(n)); - } - } - } - j = (w2 = u2.i, !w2 ? u2.i = new zf(u2, u2.c) : w2); - for (F = j.Kc(); F.Ob(); ) { - D3 = BD(F.Pb(), 202); - f2 = BD(Qc(u2, D3), 21); - for (r = f2.Kc(); r.Ob(); ) { - q = r.Pb(); - v = BD(oo(a.d, q), 202); - if (v) { - l = (!D3.g && (D3.g = new y5d(A2, D3, 9, 10)), D3.g); - wtd(l, v); - } else { - g = _pd(t4, Vte); - m = _te + q + aue + g; - n = m + $te; - throw vbb(new cqd(n)); - } - } - } - !c2.b && (c2.b = new y5d(z2, c2, 4, 7)); - if (c2.b.i != 0 && (!c2.c && (c2.c = new y5d(z2, c2, 5, 8)), c2.c.i != 0) && (!c2.b && (c2.b = new y5d(z2, c2, 4, 7)), c2.b.i <= 1 && (!c2.c && (c2.c = new y5d(z2, c2, 5, 8)), c2.c.i <= 1)) && (!c2.a && (c2.a = new cUd(A2, c2, 6, 6)), c2.a).i == 1) { - G = BD(qud((!c2.a && (c2.a = new cUd(A2, c2, 6, 6)), c2.a), 0), 202); - if (!dmd(G) && !emd(G)) { - kmd(G, BD(qud((!c2.b && (c2.b = new y5d(z2, c2, 4, 7)), c2.b), 0), 82)); - lmd(G, BD(qud((!c2.c && (c2.c = new y5d(z2, c2, 5, 8)), c2.c), 0), 82)); - } - } - } - function qJc(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3; - for (t4 = a.a, u2 = 0, v = t4.length; u2 < v; ++u2) { - s = t4[u2]; - j = Ohe; - k = Ohe; - for (o2 = new olb(s.e); o2.a < o2.c.c.length; ) { - m = BD(mlb(o2), 10); - g = !m.c ? -1 : Jkb(m.c.a, m, 0); - if (g > 0) { - l = BD(Ikb(m.c.a, g - 1), 10); - B = jBc(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 = BD(Ikb(m.c.a, g + 1), 10); - B = jBc(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); - } - i3 = Ohe; - f2 = false; - e = BD(Ikb(s.e, 0), 10); - for (D3 = new olb(e.j); D3.a < D3.c.c.length; ) { - C = BD(mlb(D3), 11); - p = e.n.b + C.n.b + C.a.b; - for (d = new olb(C.e); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 17); - w2 = c2.c; - b = w2.i.n.b + w2.n.b + w2.a.b - p; - if ($wnd.Math.abs(b) < $wnd.Math.abs(i3) && $wnd.Math.abs(b) < (b < 0 ? j : k)) { - i3 = b; - f2 = true; - } - } - } - h = BD(Ikb(s.e, s.e.c.length - 1), 10); - for (A = new olb(h.j); A.a < A.c.c.length; ) { - w2 = BD(mlb(A), 11); - p = h.n.b + w2.n.b + w2.a.b; - for (d = new olb(w2.g); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 17); - C = c2.d; - b = C.i.n.b + C.n.b + C.a.b - p; - if ($wnd.Math.abs(b) < $wnd.Math.abs(i3) && $wnd.Math.abs(b) < (b < 0 ? j : k)) { - i3 = b; - f2 = true; - } - } - } - if (f2 && i3 != 0) { - for (n = new olb(s.e); n.a < n.c.c.length; ) { - m = BD(mlb(n), 10); - m.n.b += i3; - } - } - } - } - function ync(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q; - if (Mhb(a.a, b)) { - if (Rqb(BD(Ohb(a.a, b), 53), c2)) { - return 1; - } - } else { - Rhb(a.a, b, new Tqb()); - } - if (Mhb(a.a, c2)) { - if (Rqb(BD(Ohb(a.a, c2), 53), b)) { - return -1; - } - } else { - Rhb(a.a, c2, new Tqb()); - } - if (Mhb(a.e, b)) { - if (Rqb(BD(Ohb(a.e, b), 53), c2)) { - return -1; - } - } else { - Rhb(a.e, b, new Tqb()); - } - if (Mhb(a.e, c2)) { - if (Rqb(BD(Ohb(a.a, c2), 53), b)) { - return 1; - } - } else { - Rhb(a.e, c2, new Tqb()); - } - if (a.c == (tAc(), sAc) || !wNb(b, (wtc(), Zsc)) || !wNb(c2, (wtc(), Zsc))) { - i3 = BD(Etb(Dtb(KAb(JAb(new YAb(null, new Kub(b.j, 16)), new Hnc())), new Jnc())), 11); - k = BD(Etb(Dtb(KAb(JAb(new YAb(null, new Kub(c2.j, 16)), new Lnc())), new Nnc())), 11); - if (!!i3 && !!k) { - h = i3.i; - j = k.i; - if (!!h && h == j) { - for (m = new olb(h.j); m.a < m.c.c.length; ) { - l = BD(mlb(m), 11); - if (l == i3) { - Anc(a, c2, b); - return -1; - } else if (l == k) { - Anc(a, b, c2); - return 1; - } - } - return beb(znc(a, b), znc(a, c2)); - } - for (o2 = a.d, p = 0, q = o2.length; p < q; ++p) { - n = o2[p]; - if (n == h) { - Anc(a, c2, b); - return -1; - } else if (n == j) { - Anc(a, b, c2); - return 1; - } - } - } - if (!wNb(b, (wtc(), Zsc)) || !wNb(c2, Zsc)) { - e = znc(a, b); - g = znc(a, c2); - e > g ? Anc(a, b, c2) : Anc(a, c2, b); - return e < g ? -1 : e > g ? 1 : 0; - } - } - d = BD(vNb(b, (wtc(), Zsc)), 19).a; - f2 = BD(vNb(c2, Zsc), 19).a; - d > f2 ? Anc(a, b, c2) : Anc(a, c2, b); - return d < f2 ? -1 : d > f2 ? 1 : 0; - } - function u2c(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s; - if (Ccb(DD(hkd(b, (Y9c(), d9c))))) { - return mmb(), mmb(), jmb; - } - j = (!b.a && (b.a = new cUd(E2, b, 10, 11)), b.a).i != 0; - l = s2c(b); - k = !l.dc(); - if (j || k) { - e = BD(hkd(b, F9c), 149); - if (!e) { - throw vbb(new y2c("Resolved algorithm is not set; apply a LayoutAlgorithmResolver before computing layout.")); - } - s = D3c(e, (Csd(), ysd)); - q2c(b); - if (!j && k && !s) { - return mmb(), mmb(), jmb; - } - i3 = new Rkb(); - if (PD(hkd(b, J8c)) === PD((hbd(), ebd)) && (D3c(e, vsd) || D3c(e, usd))) { - n = p2c(a, b); - o2 = new Psb(); - ye(o2, (!b.a && (b.a = new cUd(E2, b, 10, 11)), b.a)); - while (o2.b != 0) { - m = BD(o2.b == 0 ? null : (sCb(o2.b != 0), Nsb(o2, o2.a.a)), 33); - q2c(m); - r = PD(hkd(m, J8c)) === PD(gbd); - if (r || ikd(m, o8c) && !C3c(e, hkd(m, F9c))) { - h = u2c(a, m, c2, d); - Gkb(i3, h); - jkd(m, J8c, gbd); - hfd(m); - } else { - ye(o2, (!m.a && (m.a = new cUd(E2, m, 10, 11)), m.a)); - } - } - } else { - n = (!b.a && (b.a = new cUd(E2, b, 10, 11)), b.a).i; - for (g = new Fyd((!b.a && (b.a = new cUd(E2, b, 10, 11)), b.a)); g.e != g.i.gc(); ) { - f2 = BD(Dyd(g), 33); - h = u2c(a, f2, c2, d); - Gkb(i3, h); - hfd(f2); - } - } - for (q = new olb(i3); q.a < q.c.c.length; ) { - p = BD(mlb(q), 79); - jkd(p, d9c, (Bcb(), true)); - } - r2c(b, e, Udd(d, n)); - v2c(i3); - return k && s ? l : (mmb(), mmb(), jmb); - } else { - return mmb(), mmb(), jmb; - } - } - function Z$b(a, b, c2, d, e, f2, g, h, i3) { - var j, k, l, m, n, o2, p; - n = c2; - k = new b0b(i3); - __b(k, (j0b(), e0b)); - yNb(k, (wtc(), Isc), g); - yNb(k, (Nyc(), Vxc), (dcd(), $bd)); - p = Edb(ED(a.We(Uxc))); - yNb(k, Uxc, p); - l = new H0b(); - F0b(l, k); - if (!(b != bcd && b != ccd)) { - d >= 0 ? n = Zcd(h) : n = Wcd(Zcd(h)); - a.Ye($xc, n); - } - j = new d7c(); - m = false; - if (a.Xe(Txc)) { - a7c(j, BD(a.We(Txc), 8)); - m = true; - } else { - _6c(j, g.a / 2, g.b / 2); - } - switch (n.g) { - case 4: - yNb(k, mxc, (Ctc(), ytc)); - yNb(k, Bsc, (Gqc(), Fqc)); - k.o.b = g.b; - p < 0 && (k.o.a = -p); - G0b(l, (Ucd(), zcd)); - m || (j.a = g.a); - j.a -= g.a; - break; - case 2: - yNb(k, mxc, (Ctc(), Atc)); - yNb(k, Bsc, (Gqc(), Dqc)); - k.o.b = g.b; - p < 0 && (k.o.a = -p); - G0b(l, (Ucd(), Tcd)); - m || (j.a = 0); - break; - case 1: - yNb(k, Osc, (esc(), dsc)); - k.o.a = g.a; - p < 0 && (k.o.b = -p); - G0b(l, (Ucd(), Rcd)); - m || (j.b = g.b); - j.b -= g.b; - break; - case 3: - yNb(k, Osc, (esc(), bsc)); - k.o.a = g.a; - p < 0 && (k.o.b = -p); - G0b(l, (Ucd(), Acd)); - m || (j.b = 0); - } - a7c(l.n, j); - yNb(k, Txc, j); - if (b == Zbd || b == _bd || b == $bd) { - o2 = 0; - if (b == Zbd && a.Xe(Wxc)) { - switch (n.g) { - case 1: - case 2: - o2 = BD(a.We(Wxc), 19).a; - break; - case 3: - case 4: - o2 = -BD(a.We(Wxc), 19).a; - } - } else { - switch (n.g) { - case 4: - case 2: - o2 = f2.b; - b == _bd && (o2 /= e.b); - break; - case 1: - case 3: - o2 = f2.a; - b == _bd && (o2 /= e.a); - } - } - yNb(k, htc, o2); - } - yNb(k, Hsc, n); - return k; - } - function AGc(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C; - c2 = Edb(ED(vNb(a.a.j, (Nyc(), Ewc)))); - if (c2 < -1 || !a.a.i || ecd(BD(vNb(a.a.o, Vxc), 98)) || V_b(a.a.o, (Ucd(), zcd)).gc() < 2 && V_b(a.a.o, Tcd).gc() < 2) { - return true; - } - if (a.a.c.Rf()) { - return false; - } - v = 0; - u2 = 0; - t4 = new Rkb(); - for (i3 = a.a.e, j = 0, k = i3.length; j < k; ++j) { - h = i3[j]; - for (m = h, n = 0, p = m.length; n < p; ++n) { - l = m[n]; - if (l.k == (j0b(), i0b)) { - t4.c[t4.c.length] = l; - continue; - } - d = a.b[l.c.p][l.p]; - if (l.k == e0b) { - d.b = 1; - BD(vNb(l, (wtc(), $sc)), 11).j == (Ucd(), zcd) && (u2 += d.a); - } else { - C = V_b(l, (Ucd(), Tcd)); - C.dc() || !Lq(C, new NGc()) ? d.c = 1 : (e = V_b(l, zcd), (e.dc() || !Lq(e, new JGc())) && (v += d.a)); - } - for (g = new Sr(ur(U_b(l).a.Kc(), new Sq())); Qr(g); ) { - f2 = BD(Rr(g), 17); - v += d.c; - u2 += d.b; - B = f2.d.i; - zGc(a, d, B); - } - r = pl(OC(GC(KI, 1), Uhe, 20, 0, [V_b(l, (Ucd(), Acd)), V_b(l, Rcd)])); - for (A = new Sr(new xl(r.a.length, r.a)); Qr(A); ) { - w2 = BD(Rr(A), 11); - s = BD(vNb(w2, (wtc(), gtc)), 10); - if (s) { - v += d.c; - u2 += d.b; - zGc(a, d, s); - } - } - } - for (o2 = new olb(t4); o2.a < o2.c.c.length; ) { - l = BD(mlb(o2), 10); - d = a.b[l.c.p][l.p]; - for (g = new Sr(ur(U_b(l).a.Kc(), new Sq())); Qr(g); ) { - f2 = BD(Rr(g), 17); - v += d.c; - u2 += d.b; - B = f2.d.i; - zGc(a, d, B); - } - } - t4.c = KC(SI, Uhe, 1, 0, 5, 1); - } - b = v + u2; - q = b == 0 ? Pje : (v - u2) / b; - return q >= c2; - } - function ovd() { - mvd(); - function h(f2) { - var g = this; - this.dispatch = function(a) { - var b = a.data; - switch (b.cmd) { - case "algorithms": - var c2 = pvd((mmb(), new lnb(new $ib(lvd.b)))); - f2.postMessage({ id: b.id, data: c2 }); - break; - case "categories": - var d = pvd((mmb(), new lnb(new $ib(lvd.c)))); - f2.postMessage({ id: b.id, data: d }); - break; - case "options": - var e = pvd((mmb(), new lnb(new $ib(lvd.d)))); - f2.postMessage({ id: b.id, data: e }); - break; - case "register": - svd(b.algorithms); - f2.postMessage({ id: b.id }); - break; - case "layout": - qvd(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 === uke && typeof self !== uke) { - var i3 = new h(self); - self.onmessage = i3.saveDispatch; - } else if (typeof module3 !== uke && module3.exports) { - Object.defineProperty(exports3, "__esModule", { value: true }); - module3.exports = { "default": j, Worker: j }; - } + } + 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 aae(a) { - if (a.N) - return; - a.N = true; - a.b = Lnd(a, 0); - Knd(a.b, 0); - Knd(a.b, 1); - Knd(a.b, 2); - a.bb = Lnd(a, 1); - Knd(a.bb, 0); - Knd(a.bb, 1); - a.fb = Lnd(a, 2); - Knd(a.fb, 3); - Knd(a.fb, 4); - Qnd(a.fb, 5); - a.qb = Lnd(a, 3); - Knd(a.qb, 0); - Qnd(a.qb, 1); - Qnd(a.qb, 2); - Knd(a.qb, 3); - Knd(a.qb, 4); - Qnd(a.qb, 5); - Knd(a.qb, 6); - a.a = Mnd(a, 4); - a.c = Mnd(a, 5); - a.d = Mnd(a, 6); - a.e = Mnd(a, 7); - a.f = Mnd(a, 8); - a.g = Mnd(a, 9); - a.i = Mnd(a, 10); - a.j = Mnd(a, 11); - a.k = Mnd(a, 12); - a.n = Mnd(a, 13); - a.o = Mnd(a, 14); - a.p = Mnd(a, 15); - a.q = Mnd(a, 16); - a.s = Mnd(a, 17); - a.r = Mnd(a, 18); - a.t = Mnd(a, 19); - a.u = Mnd(a, 20); - a.v = Mnd(a, 21); - a.w = Mnd(a, 22); - a.B = Mnd(a, 23); - a.A = Mnd(a, 24); - a.C = Mnd(a, 25); - a.D = Mnd(a, 26); - a.F = Mnd(a, 27); - a.G = Mnd(a, 28); - a.H = Mnd(a, 29); - a.J = Mnd(a, 30); - a.I = Mnd(a, 31); - a.K = Mnd(a, 32); - a.M = Mnd(a, 33); - a.L = Mnd(a, 34); - a.P = Mnd(a, 35); - a.Q = Mnd(a, 36); - a.R = Mnd(a, 37); - a.S = Mnd(a, 38); - a.T = Mnd(a, 39); - a.U = Mnd(a, 40); - a.V = Mnd(a, 41); - a.X = Mnd(a, 42); - a.W = Mnd(a, 43); - a.Y = Mnd(a, 44); - a.Z = Mnd(a, 45); - a.$ = Mnd(a, 46); - a._ = Mnd(a, 47); - a.ab = Mnd(a, 48); - a.cb = Mnd(a, 49); - a.db = Mnd(a, 50); - a.eb = Mnd(a, 51); - a.gb = Mnd(a, 52); - a.hb = Mnd(a, 53); - a.ib = Mnd(a, 54); - a.jb = Mnd(a, 55); - a.kb = Mnd(a, 56); - a.lb = Mnd(a, 57); - a.mb = Mnd(a, 58); - a.nb = Mnd(a, 59); - a.ob = Mnd(a, 60); - a.pb = Mnd(a, 61); - } - function f5b(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2; - s = 0; - if (b.f.a == 0) { - for (q = new olb(a); q.a < q.c.c.length; ) { - o2 = BD(mlb(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 olb(a); p.a < p.c.c.length; ) { - o2 = BD(mlb(p), 10); - g5b(o2.n, s - o2.o.a); - h5b(o2.f); - d5b(o2); - (!o2.q ? (mmb(), mmb(), kmb) : o2.q)._b((Nyc(), ayc)) && g5b(BD(vNb(o2, ayc), 8), s - o2.o.a); - switch (BD(vNb(o2, mwc), 248).g) { - case 1: - yNb(o2, mwc, (F7c(), D7c)); - break; - case 2: - yNb(o2, mwc, (F7c(), C7c)); - } - r = o2.o; - for (u2 = new olb(o2.j); u2.a < u2.c.c.length; ) { - t4 = BD(mlb(u2), 11); - g5b(t4.n, r.a - t4.o.a); - g5b(t4.a, t4.o.a); - G0b(t4, Z4b(t4.j)); - g = BD(vNb(t4, Wxc), 19); - !!g && yNb(t4, Wxc, meb(-g.a)); - for (f2 = new olb(t4.g); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 17); - for (d = Jsb(e.a, 0); d.b != d.d.c; ) { - c2 = BD(Xsb(d), 8); - c2.a = s - c2.a; - } - j = BD(vNb(e, jxc), 74); - if (j) { - for (i3 = Jsb(j, 0); i3.b != i3.d.c; ) { - h = BD(Xsb(i3), 8); - h.a = s - h.a; - } - } - for (m = new olb(e.b); m.a < m.c.c.length; ) { - k = BD(mlb(m), 70); - g5b(k.n, s - k.o.a); - } - } - for (n = new olb(t4.f); n.a < n.c.c.length; ) { - k = BD(mlb(n), 70); - g5b(k.n, t4.o.a - k.o.a); - } - } - if (o2.k == (j0b(), e0b)) { - yNb(o2, (wtc(), Hsc), Z4b(BD(vNb(o2, Hsc), 61))); - c5b(o2); - } - for (l = new olb(o2.b); l.a < l.c.c.length; ) { - k = BD(mlb(l), 70); - d5b(k); - g5b(k.n, r.a - k.o.a); - } - } + }, "copyNodesMap"); + for (var iter = 0; iter <= numIter; iter++) { + for (var _i4 = 0; _i4 < numNodes; _i4++) { + metaNodeMap[_i4] = _i4; } - function i5b(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2; - s = 0; - if (b.f.b == 0) { - for (q = new olb(a); q.a < q.c.c.length; ) { - o2 = BD(mlb(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 olb(a); p.a < p.c.c.length; ) { - o2 = BD(mlb(p), 10); - j5b(o2.n, s - o2.o.b); - k5b(o2.f); - e5b(o2); - (!o2.q ? (mmb(), mmb(), kmb) : o2.q)._b((Nyc(), ayc)) && j5b(BD(vNb(o2, ayc), 8), s - o2.o.b); - switch (BD(vNb(o2, mwc), 248).g) { - case 3: - yNb(o2, mwc, (F7c(), A7c)); - break; - case 4: - yNb(o2, mwc, (F7c(), E7c)); - } - r = o2.o; - for (u2 = new olb(o2.j); u2.a < u2.c.c.length; ) { - t4 = BD(mlb(u2), 11); - j5b(t4.n, r.b - t4.o.b); - j5b(t4.a, t4.o.b); - G0b(t4, $4b(t4.j)); - g = BD(vNb(t4, Wxc), 19); - !!g && yNb(t4, Wxc, meb(-g.a)); - for (f2 = new olb(t4.g); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 17); - for (d = Jsb(e.a, 0); d.b != d.d.c; ) { - c2 = BD(Xsb(d), 8); - c2.b = s - c2.b; - } - j = BD(vNb(e, jxc), 74); - if (j) { - for (i3 = Jsb(j, 0); i3.b != i3.d.c; ) { - h = BD(Xsb(i3), 8); - h.b = s - h.b; - } - } - for (m = new olb(e.b); m.a < m.c.c.length; ) { - k = BD(mlb(m), 70); - j5b(k.n, s - k.o.b); - } - } - for (n = new olb(t4.f); n.a < n.c.c.length; ) { - k = BD(mlb(n), 70); - j5b(k.n, t4.o.b - k.o.b); - } - } - if (o2.k == (j0b(), e0b)) { - yNb(o2, (wtc(), Hsc), $4b(BD(vNb(o2, Hsc), 61))); - b5b(o2); - } - for (l = new olb(o2.b); l.a < l.c.c.length; ) { - k = BD(mlb(l), 70); - e5b(k); - j5b(k.n, r.b - k.o.b); - } - } + 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 tZc(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n; - l = false; - j = a + 1; - k = (tCb(a, b.c.length), BD(b.c[a], 200)); - g = k.a; - h = null; - for (f2 = 0; f2 < k.a.c.length; f2++) { - e = (tCb(f2, g.c.length), BD(g.c[f2], 187)); - if (e.c) { - continue; - } - if (e.b.c.length == 0) { - Zfb(); - v$c(k, e); - --f2; - l = true; - continue; - } - if (!e.k) { - !!h && a$c(h); - h = new b$c(!h ? 0 : h.e + h.d + d, k.f, d); - OZc(e, h.e + h.d, k.f); - Ekb(k.d, h); - WZc(h, e); - e.k = true; - } - i3 = null; - i3 = (n = null, f2 < k.a.c.length - 1 ? n = BD(Ikb(k.a, f2 + 1), 187) : j < b.c.length && (tCb(j, b.c.length), BD(b.c[j], 200)).a.c.length != 0 && (n = BD(Ikb((tCb(j, b.c.length), BD(b.c[j], 200)).a, 0), 187)), n); - m = false; - !!i3 && (m = !pb(i3.j, k)); - if (i3) { - if (i3.b.c.length == 0) { - v$c(k, i3); - break; - } else { - KZc(e, c2 - e.s); - a$c(e.q); - l = l | sZc(k, e, i3, c2, d); - } - if (i3.b.c.length == 0) { - v$c((tCb(j, b.c.length), BD(b.c[j], 200)), i3); - i3 = null; - while (b.c.length > j && (tCb(j, b.c.length), BD(b.c[j], 200)).a.c.length == 0) { - Lkb(b, (tCb(j, b.c.length), b.c[j])); - } - } - if (!i3) { - --f2; - continue; - } - if (uZc(b, k, e, i3, m, c2, j, d)) { - l = true; - continue; - } - if (m) { - if (vZc(b, k, e, i3, c2, j, d)) { - l = true; - continue; - } else if (wZc(k, e)) { - e.c = true; - l = true; - continue; - } - } else if (wZc(k, e)) { - e.c = true; - l = true; - continue; - } - if (l) { - continue; - } - } - if (wZc(k, e)) { - e.c = true; - l = true; - !!i3 && (i3.k = false); - continue; - } else { - a$c(e.q); - } - } - return l; - } - function fed(a, b, c2, d, e, f2, g) { - var h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F, G, H2, I; - p = 0; - D3 = 0; - for (j = new olb(a.b); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 157); - !!i3.c && zfd(i3.c); - p = $wnd.Math.max(p, red(i3)); - D3 += red(i3) * qed(i3); - } - q = D3 / a.b.c.length; - C = _dd(a.b, q); - D3 += a.b.c.length * C; - p = $wnd.Math.max(p, $wnd.Math.sqrt(D3 * g)) + c2.b; - H2 = c2.b; - I = c2.d; - n = 0; - l = c2.b + c2.c; - B = new Psb(); - Dsb(B, meb(0)); - w2 = new Psb(); - k = new Bib(a.b, 0); - o2 = null; - h = new Rkb(); - while (k.b < k.d.gc()) { - i3 = (sCb(k.b < k.d.gc()), BD(k.d.Xb(k.c = k.b++), 157)); - G = red(i3); - m = qed(i3); - if (H2 + G > p) { - if (f2) { - Fsb(w2, n); - Fsb(B, meb(k.b - 1)); - Ekb(a.d, o2); - h.c = KC(SI, Uhe, 1, 0, 5, 1); - } - H2 = c2.b; - I += n + b; - n = 0; - l = $wnd.Math.max(l, c2.b + c2.c + G); - } - h.c[h.c.length] = i3; - ued(i3, H2, I); - l = $wnd.Math.max(l, H2 + G + c2.c); - n = $wnd.Math.max(n, m); - H2 += G + b; - o2 = i3; - } - Gkb(a.a, h); - Ekb(a.d, BD(Ikb(h, h.c.length - 1), 157)); - l = $wnd.Math.max(l, d); - F = I + n + c2.a; - if (F < e) { - n += e - F; - F = e; - } - if (f2) { - H2 = c2.b; - k = new Bib(a.b, 0); - Fsb(B, meb(a.b.c.length)); - A = Jsb(B, 0); - s = BD(Xsb(A), 19).a; - Fsb(w2, n); - v = Jsb(w2, 0); - u2 = 0; - while (k.b < k.d.gc()) { - if (k.b == s) { - H2 = c2.b; - u2 = Edb(ED(Xsb(v))); - s = BD(Xsb(A), 19).a; - } - i3 = (sCb(k.b < k.d.gc()), BD(k.d.Xb(k.c = k.b++), 157)); - sed(i3, u2); - if (k.b == s) { - r = l - H2 - c2.c; - t4 = red(i3); - ted(i3, r); - ved(i3, (r - t4) / 2, 0); - } - H2 += red(i3) + b; - } - } - return new f7c(l, F); - } - function pde(a) { - var b, c2, d, e, f2; - b = a.c; - f2 = null; - switch (b) { - case 6: - return a.Vl(); - case 13: - return a.Wl(); - case 23: - return a.Nl(); - case 22: - return a.Sl(); - case 18: - return a.Pl(); - case 8: - nde(a); - f2 = (wfe(), efe); - break; - case 9: - return a.vl(true); - case 19: - return a.wl(); - case 10: - switch (a.a) { - case 100: - case 68: - case 119: - case 87: - case 115: - case 83: - f2 = a.ul(a.a); - nde(a); - return f2; - case 101: - case 102: - case 110: - case 114: - case 116: - case 117: - case 118: - case 120: - { - c2 = a.tl(); - c2 < Tje ? f2 = (wfe(), wfe(), new ige(0, c2)) : f2 = Ffe(Tee(c2)); - } - break; - case 99: - return a.Fl(); - case 67: - return a.Al(); - case 105: - return a.Il(); - case 73: - return a.Bl(); - case 103: - return a.Gl(); - case 88: - return a.Cl(); - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - return a.xl(); - case 80: - case 112: - f2 = tde(a, a.a); - if (!f2) - throw vbb(new mde(tvd((h0d(), Iue)))); - break; - default: - f2 = zfe(a.a); - } - nde(a); - break; - case 0: - if (a.a == 93 || a.a == 123 || a.a == 125) - throw vbb(new mde(tvd((h0d(), Hue)))); - f2 = zfe(a.a); - d = a.a; - nde(a); - if ((d & 64512) == Uje && a.c == 0 && (a.a & 64512) == 56320) { - e = KC(TD, $ie, 25, 2, 15, 1); - e[0] = d & aje; - e[1] = a.a & aje; - f2 = Efe(Ffe(zfb(e, 0, e.length)), 0); - nde(a); - } - break; - default: - throw vbb(new mde(tvd((h0d(), Hue)))); - } - return f2; - } - function e7b(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r; - d = new Rkb(); - e = Ohe; - f2 = Ohe; - g = Ohe; - if (c2) { - e = a.f.a; - for (p = new olb(b.j); p.a < p.c.c.length; ) { - o2 = BD(mlb(p), 11); - for (i3 = new olb(o2.g); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 17); - if (h.a.b != 0) { - k = BD(Hsb(h.a), 8); - if (k.a < e) { - f2 = e - k.a; - g = Ohe; - d.c = KC(SI, Uhe, 1, 0, 5, 1); - e = k.a; - } - if (k.a <= e) { - d.c[d.c.length] = h; - h.a.b > 1 && (g = $wnd.Math.min(g, $wnd.Math.abs(BD(Ut(h.a, 1), 8).b - k.b))); - } - } - } - } - } else { - for (p = new olb(b.j); p.a < p.c.c.length; ) { - o2 = BD(mlb(p), 11); - for (i3 = new olb(o2.e); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 17); - if (h.a.b != 0) { - m = BD(Isb(h.a), 8); - if (m.a > e) { - f2 = m.a - e; - g = Ohe; - d.c = KC(SI, Uhe, 1, 0, 5, 1); - e = m.a; - } - if (m.a >= e) { - d.c[d.c.length] = h; - h.a.b > 1 && (g = $wnd.Math.min(g, $wnd.Math.abs(BD(Ut(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 H0b(); - F0b(n, b); - G0b(n, (Ucd(), Acd)); - n.n.a = b.o.a / 2; - r = new H0b(); - F0b(r, b); - G0b(r, Rcd); - r.n.a = b.o.a / 2; - r.n.b = b.o.b; - for (i3 = new olb(d); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 17); - if (c2) { - j = BD(Lsb(h.a), 8); - q = h.a.b == 0 ? A0b(h.d) : BD(Hsb(h.a), 8); - q.b >= j.b ? QZb(h, r) : QZb(h, n); - } else { - j = BD(Msb(h.a), 8); - q = h.a.b == 0 ? A0b(h.c) : BD(Isb(h.a), 8); - q.b >= j.b ? RZb(h, r) : RZb(h, n); - } - l = BD(vNb(h, (Nyc(), jxc)), 74); - !!l && ze(l, j, true); - } - b.n.a = e - b.o.a / 2; - } - } - function erd(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F, G, H2, I, J, K2; - D3 = null; - G = b; - F = Rqd(a, dtd(c2), G); - Lkd(F, _pd(G, Vte)); - H2 = BD(oo(a.g, Vpd(aC(G, Cte))), 33); - m = aC(G, "sourcePort"); - d = null; - !!m && (d = Vpd(m)); - I = BD(oo(a.j, d), 118); - if (!H2) { - h = Wpd(G); - o2 = "An edge must have a source node (edge id: '" + h; - p = o2 + $te; - throw vbb(new cqd(p)); - } - if (!!I && !Hb(mpd(I), H2)) { - i3 = _pd(G, Vte); - q = "The source port of an edge must be a port of the edge's source node (edge id: '" + i3; - r = q + $te; - throw vbb(new cqd(r)); - } - B = (!F.b && (F.b = new y5d(z2, F, 4, 7)), F.b); - f2 = null; - I ? f2 = I : f2 = H2; - wtd(B, f2); - J = BD(oo(a.g, Vpd(aC(G, bue))), 33); - n = aC(G, "targetPort"); - e = null; - !!n && (e = Vpd(n)); - K2 = BD(oo(a.j, e), 118); - if (!J) { - l = Wpd(G); - s = "An edge must have a target node (edge id: '" + l; - t4 = s + $te; - throw vbb(new cqd(t4)); - } - if (!!K2 && !Hb(mpd(K2), J)) { - j = _pd(G, Vte); - u2 = "The target port of an edge must be a port of the edge's target node (edge id: '" + j; - v = u2 + $te; - throw vbb(new cqd(v)); - } - C = (!F.c && (F.c = new y5d(z2, F, 5, 8)), F.c); - g = null; - K2 ? g = K2 : g = J; - wtd(C, g); - if ((!F.b && (F.b = new y5d(z2, F, 4, 7)), F.b).i == 0 || (!F.c && (F.c = new y5d(z2, F, 5, 8)), F.c).i == 0) { - k = _pd(G, Vte); - w2 = Zte + k; - A = w2 + $te; - throw vbb(new cqd(A)); - } - grd(G, F); - frd(G, F); - D3 = crd(a, G, F); - return D3; - } - function DXb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3; - l = FXb(zXb(a, (Ucd(), Fcd)), b); - o2 = EXb(zXb(a, Gcd), b); - u2 = EXb(zXb(a, Ocd), b); - B = GXb(zXb(a, Qcd), b); - m = GXb(zXb(a, Bcd), b); - s = EXb(zXb(a, Ncd), b); - p = EXb(zXb(a, Hcd), b); - w2 = EXb(zXb(a, Pcd), b); - v = EXb(zXb(a, Ccd), b); - C = GXb(zXb(a, Ecd), b); - r = EXb(zXb(a, Lcd), b); - t4 = EXb(zXb(a, Kcd), b); - A = EXb(zXb(a, Dcd), b); - D3 = GXb(zXb(a, Mcd), b); - n = GXb(zXb(a, Icd), b); - q = EXb(zXb(a, Jcd), b); - c2 = w6c(OC(GC(UD, 1), Vje, 25, 15, [s.a, B.a, w2.a, D3.a])); - d = w6c(OC(GC(UD, 1), Vje, 25, 15, [o2.a, l.a, u2.a, q.a])); - e = r.a; - f2 = w6c(OC(GC(UD, 1), Vje, 25, 15, [p.a, m.a, v.a, n.a])); - j = w6c(OC(GC(UD, 1), Vje, 25, 15, [s.b, o2.b, p.b, t4.b])); - i3 = w6c(OC(GC(UD, 1), Vje, 25, 15, [B.b, l.b, m.b, q.b])); - k = C.b; - h = w6c(OC(GC(UD, 1), Vje, 25, 15, [w2.b, u2.b, v.b, A.b])); - vXb(zXb(a, Fcd), c2 + e, j + k); - vXb(zXb(a, Jcd), c2 + e, j + k); - vXb(zXb(a, Gcd), c2 + e, 0); - vXb(zXb(a, Ocd), c2 + e, j + k + i3); - vXb(zXb(a, Qcd), 0, j + k); - vXb(zXb(a, Bcd), c2 + e + d, j + k); - vXb(zXb(a, Hcd), c2 + e + d, 0); - vXb(zXb(a, Pcd), 0, j + k + i3); - vXb(zXb(a, Ccd), c2 + e + d, j + k + i3); - vXb(zXb(a, Ecd), 0, j); - vXb(zXb(a, Lcd), c2, 0); - vXb(zXb(a, Dcd), 0, j + k + i3); - vXb(zXb(a, Icd), c2 + e + d, 0); - g = new d7c(); - g.a = w6c(OC(GC(UD, 1), Vje, 25, 15, [c2 + d + e + f2, C.a, t4.a, A.a])); - g.b = w6c(OC(GC(UD, 1), Vje, 25, 15, [j + i3 + k + h, r.b, D3.b, n.b])); - return g; - } - function Ngc(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q; - p = new Rkb(); - for (m = new olb(a.d.b); m.a < m.c.c.length; ) { - l = BD(mlb(m), 29); - for (o2 = new olb(l.a); o2.a < o2.c.c.length; ) { - n = BD(mlb(o2), 10); - e = BD(Ohb(a.f, n), 57); - for (i3 = new Sr(ur(U_b(n).a.Kc(), new Sq())); Qr(i3); ) { - g = BD(Rr(i3), 17); - d = Jsb(g.a, 0); - j = true; - k = null; - if (d.b != d.d.c) { - b = BD(Xsb(d), 8); - c2 = null; - if (g.c.j == (Ucd(), Acd)) { - q = new hic(b, new f7c(b.a, e.d.d), e, g); - q.f.a = true; - q.a = g.c; - p.c[p.c.length] = q; - } - if (g.c.j == Rcd) { - q = new hic(b, new f7c(b.a, e.d.d + e.d.a), e, g); - q.f.d = true; - q.a = g.c; - p.c[p.c.length] = q; - } - while (d.b != d.d.c) { - c2 = BD(Xsb(d), 8); - if (!ADb(b.b, c2.b)) { - k = new hic(b, c2, null, g); - p.c[p.c.length] = 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 = BD(Ohb(a.f, g.d.i), 57); - 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 Sr(ur(R_b(n).a.Kc(), new Sq())); Qr(h); ) { - g = BD(Rr(h), 17); - if (g.a.b != 0) { - b = BD(Isb(g.a), 8); - if (g.d.j == (Ucd(), Acd)) { - q = new hic(b, new f7c(b.a, e.d.d), e, g); - q.f.a = true; - q.a = g.d; - p.c[p.c.length] = q; - } - if (g.d.j == Rcd) { - q = new hic(b, new f7c(b.a, e.d.d + e.d.a), e, g); - q.f.d = true; - q.a = g.d; - p.c[p.c.length] = q; - } - } - } - } - } - return p; - } - function WJc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l; - Odd(c2, "Network simplex node placement", 1); - a.e = b; - a.n = BD(vNb(b, (wtc(), otc)), 304); - VJc(a); - HJc(a); - MAb(LAb(new YAb(null, new Kub(a.e.b, 16)), new KKc()), new MKc(a)); - MAb(JAb(LAb(JAb(LAb(new YAb(null, new Kub(a.e.b, 16)), new zLc()), new BLc()), new DLc()), new FLc()), new IKc(a)); - if (Ccb(DD(vNb(a.e, (Nyc(), Axc))))) { - g = Udd(c2, 1); - Odd(g, "Straight Edges Pre-Processing", 1); - UJc(a); - Qdd(g); - } - JFb(a.f); - f2 = BD(vNb(b, Ayc), 19).a * a.f.a.c.length; - uGb(HGb(IGb(LGb(a.f), f2), false), Udd(c2, 1)); - if (a.d.a.gc() != 0) { - g = Udd(c2, 1); - Odd(g, "Flexible Where Space Processing", 1); - h = BD(Btb(RAb(NAb(new YAb(null, new Kub(a.f.a, 16)), new OKc()), new iKc())), 19).a; - i3 = BD(Btb(QAb(NAb(new YAb(null, new Kub(a.f.a, 16)), new QKc()), new mKc())), 19).a; - j = i3 - h; - k = nGb(new pGb(), a.f); - l = nGb(new pGb(), a.f); - AFb(DFb(CFb(BFb(EFb(new FFb(), 2e4), j), k), l)); - MAb(JAb(JAb(Plb(a.i), new SKc()), new UKc()), new WKc(h, k, j, l)); - for (e = a.d.a.ec().Kc(); e.Ob(); ) { - d = BD(e.Pb(), 213); - d.g = 1; - } - uGb(HGb(IGb(LGb(a.f), f2), false), Udd(g, 1)); - Qdd(g); - } - if (Ccb(DD(vNb(b, Axc)))) { - g = Udd(c2, 1); - Odd(g, "Straight Edges Post-Processing", 1); - TJc(a); - Qdd(g); - } - GJc(a); - a.e = null; - a.f = null; - a.i = null; - a.c = null; - Uhb(a.k); - a.j = null; - a.a = null; - a.o = null; - a.d.a.$b(); - Qdd(c2); - } - function lMc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v; - for (h = new olb(a.a.b); h.a < h.c.c.length; ) { - f2 = BD(mlb(h), 29); - for (t4 = new olb(f2.a); t4.a < t4.c.c.length; ) { - s = BD(mlb(t4), 10); - b.g[s.p] = s; - b.a[s.p] = s; - b.d[s.p] = 0; - } - } - i3 = a.a.b; - b.c == (YLc(), WLc) && (i3 = JD(i3, 152) ? km(BD(i3, 152)) : JD(i3, 131) ? BD(i3, 131).a : JD(i3, 54) ? new ov(i3) : new dv(i3)); - for (g = i3.Kc(); g.Ob(); ) { - f2 = BD(g.Pb(), 29); - n = -1; - m = f2.a; - if (b.o == (eMc(), dMc)) { - n = Ohe; - m = JD(m, 152) ? km(BD(m, 152)) : JD(m, 131) ? BD(m, 131).a : JD(m, 54) ? new ov(m) : new dv(m); - } - for (v = m.Kc(); v.Ob(); ) { - u2 = BD(v.Pb(), 10); - l = null; - b.c == WLc ? l = BD(Ikb(a.b.f, u2.p), 15) : l = BD(Ikb(a.b.b, u2.p), 15); - if (l.gc() > 0) { - d = l.gc(); - j = QD($wnd.Math.floor((d + 1) / 2)) - 1; - e = QD($wnd.Math.ceil((d + 1) / 2)) - 1; - if (b.o == dMc) { - for (k = e; k >= j; k--) { - if (b.a[u2.p] == u2) { - p = BD(l.Xb(k), 46); - o2 = BD(p.a, 10); - if (!Rqb(c2, p.b) && n > a.b.e[o2.p]) { - b.a[o2.p] = u2; - b.g[u2.p] = b.g[o2.p]; - b.a[u2.p] = b.g[u2.p]; - b.f[b.g[u2.p].p] = (Bcb(), Ccb(b.f[b.g[u2.p].p]) & u2.k == (j0b(), g0b) ? true : false); - n = a.b.e[o2.p]; - } - } - } - } else { - for (k = j; k <= e; k++) { - if (b.a[u2.p] == u2) { - r = BD(l.Xb(k), 46); - q = BD(r.a, 10); - if (!Rqb(c2, r.b) && n < a.b.e[q.p]) { - b.a[q.p] = u2; - b.g[u2.p] = b.g[q.p]; - b.a[u2.p] = b.g[u2.p]; - b.f[b.g[u2.p].p] = (Bcb(), Ccb(b.f[b.g[u2.p].p]) & u2.k == (j0b(), g0b) ? true : false); - n = a.b.e[q.p]; - } - } - } - } - } - } - } + } + 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 Thd() { - Thd = ccb; - Hhd(); - Shd = Ghd.a; - BD(qud(ZKd(Ghd.a), 0), 18); - Mhd = Ghd.f; - BD(qud(ZKd(Ghd.f), 0), 18); - BD(qud(ZKd(Ghd.f), 1), 34); - Rhd = Ghd.n; - BD(qud(ZKd(Ghd.n), 0), 34); - BD(qud(ZKd(Ghd.n), 1), 34); - BD(qud(ZKd(Ghd.n), 2), 34); - BD(qud(ZKd(Ghd.n), 3), 34); - Nhd = Ghd.g; - BD(qud(ZKd(Ghd.g), 0), 18); - BD(qud(ZKd(Ghd.g), 1), 34); - Jhd = Ghd.c; - BD(qud(ZKd(Ghd.c), 0), 18); - BD(qud(ZKd(Ghd.c), 1), 18); - Ohd = Ghd.i; - BD(qud(ZKd(Ghd.i), 0), 18); - BD(qud(ZKd(Ghd.i), 1), 18); - BD(qud(ZKd(Ghd.i), 2), 18); - BD(qud(ZKd(Ghd.i), 3), 18); - BD(qud(ZKd(Ghd.i), 4), 34); - Phd = Ghd.j; - BD(qud(ZKd(Ghd.j), 0), 18); - Khd = Ghd.d; - BD(qud(ZKd(Ghd.d), 0), 18); - BD(qud(ZKd(Ghd.d), 1), 18); - BD(qud(ZKd(Ghd.d), 2), 18); - BD(qud(ZKd(Ghd.d), 3), 18); - BD(qud(ZKd(Ghd.d), 4), 34); - BD(qud(ZKd(Ghd.d), 5), 34); - BD(qud(ZKd(Ghd.d), 6), 34); - BD(qud(ZKd(Ghd.d), 7), 34); - Ihd = Ghd.b; - BD(qud(ZKd(Ghd.b), 0), 34); - BD(qud(ZKd(Ghd.b), 1), 34); - Lhd = Ghd.e; - BD(qud(ZKd(Ghd.e), 0), 34); - BD(qud(ZKd(Ghd.e), 1), 34); - BD(qud(ZKd(Ghd.e), 2), 34); - BD(qud(ZKd(Ghd.e), 3), 34); - BD(qud(ZKd(Ghd.e), 4), 18); - BD(qud(ZKd(Ghd.e), 5), 18); - BD(qud(ZKd(Ghd.e), 6), 18); - BD(qud(ZKd(Ghd.e), 7), 18); - BD(qud(ZKd(Ghd.e), 8), 18); - BD(qud(ZKd(Ghd.e), 9), 18); - BD(qud(ZKd(Ghd.e), 10), 34); - Qhd = Ghd.k; - BD(qud(ZKd(Ghd.k), 0), 34); - BD(qud(ZKd(Ghd.k), 1), 34); - } - function wQc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F; - C = new Psb(); - w2 = new Psb(); - q = -1; - for (i3 = new olb(a); i3.a < i3.c.c.length; ) { - g = BD(mlb(i3), 128); - g.s = q--; - k = 0; - t4 = 0; - for (f2 = new olb(g.t); f2.a < f2.c.c.length; ) { - d = BD(mlb(f2), 268); - t4 += d.c; - } - for (e = new olb(g.i); e.a < e.c.c.length; ) { - d = BD(mlb(e), 268); - k += d.c; - } - g.n = k; - g.u = t4; - t4 == 0 ? (Gsb(w2, g, w2.c.b, w2.c), true) : k == 0 && (Gsb(C, g, C.c.b, C.c), true); - } - F = Gx(a); - l = a.c.length; - p = l + 1; - r = l - 1; - n = new Rkb(); - while (F.a.gc() != 0) { - while (w2.b != 0) { - v = (sCb(w2.b != 0), BD(Nsb(w2, w2.a.a), 128)); - F.a.Bc(v) != null; - v.s = r--; - AQc(v, C, w2); - } - while (C.b != 0) { - A = (sCb(C.b != 0), BD(Nsb(C, C.a.a), 128)); - F.a.Bc(A) != null; - A.s = p++; - AQc(A, C, w2); - } - o2 = Rie; - for (j = F.a.ec().Kc(); j.Ob(); ) { - g = BD(j.Pb(), 128); - s = g.u - g.n; - if (s >= o2) { - if (s > o2) { - n.c = KC(SI, Uhe, 1, 0, 5, 1); - o2 = s; - } - n.c[n.c.length] = g; - } - } - if (n.c.length != 0) { - m = BD(Ikb(n, Bub(b, n.c.length)), 128); - F.a.Bc(m) != null; - m.s = p++; - AQc(m, C, w2); - n.c = KC(SI, Uhe, 1, 0, 5, 1); - } - } - u2 = a.c.length + 1; - for (h = new olb(a); h.a < h.c.c.length; ) { - g = BD(mlb(h), 128); - g.s < l && (g.s += u2); - } - for (B = new olb(a); B.a < B.c.c.length; ) { - A = BD(mlb(B), 128); - c2 = new Bib(A.t, 0); - while (c2.b < c2.d.gc()) { - d = (sCb(c2.b < c2.d.gc()), BD(c2.d.Xb(c2.c = c2.b++), 268)); - D3 = d.b; - if (A.s > D3.s) { - uib(c2); - Lkb(D3.i, d); - if (d.c > 0) { - d.a = D3; - Ekb(D3.t, d); - d.b = A; - Ekb(A.i, d); - } - } + } + 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 qde(a) { - var b, c2, d, e, f2; - b = a.c; - switch (b) { - case 11: - return a.Ml(); - case 12: - return a.Ol(); - case 14: - return a.Ql(); - case 15: - return a.Tl(); - case 16: - return a.Rl(); - case 17: - return a.Ul(); - case 21: - nde(a); - return wfe(), wfe(), ffe; - case 10: - switch (a.a) { - case 65: - return a.yl(); - case 90: - return a.Dl(); - case 122: - return a.Kl(); - case 98: - return a.El(); - case 66: - return a.zl(); - case 60: - return a.Jl(); - case 62: - return a.Hl(); - } - } - f2 = pde(a); - b = a.c; - switch (b) { - case 3: - return a.Zl(f2); - case 4: - return a.Xl(f2); - case 5: - return a.Yl(f2); - case 0: - if (a.a == 123 && a.d < a.j) { - e = a.d; - d = 0; - c2 = -1; - if ((b = bfb(a.i, e++)) >= 48 && b <= 57) { - d = b - 48; - while (e < a.j && (b = bfb(a.i, e++)) >= 48 && b <= 57) { - d = d * 10 + b - 48; - if (d < 0) - throw vbb(new mde(tvd((h0d(), bve)))); - } - } else { - throw vbb(new mde(tvd((h0d(), Zue)))); - } - c2 = d; - if (b == 44) { - if (e >= a.j) { - throw vbb(new mde(tvd((h0d(), _ue)))); - } else if ((b = bfb(a.i, e++)) >= 48 && b <= 57) { - c2 = b - 48; - while (e < a.j && (b = bfb(a.i, e++)) >= 48 && b <= 57) { - c2 = c2 * 10 + b - 48; - if (c2 < 0) - throw vbb(new mde(tvd((h0d(), bve)))); - } - if (d > c2) - throw vbb(new mde(tvd((h0d(), ave)))); - } else { - c2 = -1; - } - } - if (b != 125) - throw vbb(new mde(tvd((h0d(), $ue)))); - if (a.sl(e)) { - f2 = (wfe(), wfe(), new lge(9, f2)); - a.d = e + 1; - } else { - f2 = (wfe(), wfe(), new lge(3, f2)); - a.d = e; - } - f2.dm(d); - f2.cm(c2); - nde(a); - } - } - return f2; - } - function $bc(a, b, c2, d, e) { - var f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F; - p = new Skb(b.b); - u2 = new Skb(b.b); - m = new Skb(b.b); - B = new Skb(b.b); - q = new Skb(b.b); - for (A = Jsb(b, 0); A.b != A.d.c; ) { - v = BD(Xsb(A), 11); - for (h = new olb(v.g); h.a < h.c.c.length; ) { - f2 = BD(mlb(h), 17); - if (f2.c.i == f2.d.i) { - if (v.j == f2.d.j) { - B.c[B.c.length] = f2; - continue; - } else if (v.j == (Ucd(), Acd) && f2.d.j == Rcd) { - q.c[q.c.length] = f2; - continue; - } - } - } - } - for (i3 = new olb(q); i3.a < i3.c.c.length; ) { - f2 = BD(mlb(i3), 17); - _bc(a, f2, c2, d, (Ucd(), zcd)); - } - for (g = new olb(B); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 17); - C = new b0b(a); - __b(C, (j0b(), i0b)); - yNb(C, (Nyc(), Vxc), (dcd(), $bd)); - yNb(C, (wtc(), $sc), f2); - D3 = new H0b(); - yNb(D3, $sc, f2.d); - G0b(D3, (Ucd(), Tcd)); - F0b(D3, C); - F = new H0b(); - yNb(F, $sc, f2.c); - G0b(F, zcd); - F0b(F, C); - yNb(f2.c, gtc, C); - yNb(f2.d, gtc, C); - QZb(f2, null); - RZb(f2, null); - c2.c[c2.c.length] = C; - yNb(C, ysc, meb(2)); - } - for (w2 = Jsb(b, 0); w2.b != w2.d.c; ) { - v = BD(Xsb(w2), 11); - j = v.e.c.length > 0; - r = v.g.c.length > 0; - j && r ? (m.c[m.c.length] = v, true) : j ? (p.c[p.c.length] = v, true) : r && (u2.c[u2.c.length] = v, true); - } - for (o2 = new olb(p); o2.a < o2.c.c.length; ) { - n = BD(mlb(o2), 11); - Ekb(e, Zbc(a, n, null, c2)); - } - for (t4 = new olb(u2); t4.a < t4.c.c.length; ) { - s = BD(mlb(t4), 11); - Ekb(e, Zbc(a, null, s, c2)); - } - for (l = new olb(m); l.a < l.c.c.length; ) { - k = BD(mlb(l), 11); - Ekb(e, Zbc(a, k, k, c2)); - } - } - function NCb(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3; - s = new f7c(Pje, Pje); - b = new f7c(Qje, Qje); - for (B = new olb(a); B.a < B.c.c.length; ) { - A = BD(mlb(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 f7c(b.a - s.a, b.b - s.b); - j = new f7c(s.a - 50, s.b - m.a - 50); - k = new f7c(s.a - 50, b.b + m.a + 50); - l = new f7c(b.a + m.b / 2 + 50, s.b + m.b / 2); - n = new eDb(j, k, l); - w2 = new Tqb(); - f2 = new Rkb(); - c2 = new Rkb(); - w2.a.zc(n, w2); - for (D3 = new olb(a); D3.a < D3.c.c.length; ) { - C = BD(mlb(D3), 8); - f2.c = KC(SI, Uhe, 1, 0, 5, 1); - for (v = w2.a.ec().Kc(); v.Ob(); ) { - t4 = BD(v.Pb(), 308); - d = t4.d; - S6c(d, t4.a); - Jy(S6c(t4.d, C), S6c(t4.d, t4.a)) < 0 && (f2.c[f2.c.length] = t4, true); - } - c2.c = KC(SI, Uhe, 1, 0, 5, 1); - for (u2 = new olb(f2); u2.a < u2.c.c.length; ) { - t4 = BD(mlb(u2), 308); - for (q = new olb(t4.e); q.a < q.c.c.length; ) { - o2 = BD(mlb(q), 168); - g = true; - for (i3 = new olb(f2); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 308); - h != t4 && (wtb(o2, Ikb(h.e, 0)) || wtb(o2, Ikb(h.e, 1)) || wtb(o2, Ikb(h.e, 2))) && (g = false); - } - g && (c2.c[c2.c.length] = o2, true); - } - } - Ve(w2, f2); - reb(w2, new OCb()); - for (p = new olb(c2); p.a < p.c.c.length; ) { - o2 = BD(mlb(p), 168); - Qqb(w2, new eDb(C, o2.a, o2.b)); - } - } - r = new Tqb(); - reb(w2, new QCb(r)); - e = r.a.ec().Kc(); - while (e.Ob()) { - o2 = BD(e.Pb(), 168); - (dDb(n, o2.a) || dDb(n, o2.b)) && e.Qb(); - } - reb(r, new SCb()); - return r; - } - function _Tb(a) { - var b, c2, d, e, f2; - c2 = BD(vNb(a, (wtc(), Ksc)), 21); - b = k3c(WTb); - e = BD(vNb(a, (Nyc(), axc)), 334); - e == (hbd(), ebd) && d3c(b, XTb); - Ccb(DD(vNb(a, $wc))) ? e3c(b, (qUb(), lUb), (S8b(), I8b)) : e3c(b, (qUb(), nUb), (S8b(), I8b)); - vNb(a, (g6c(), f6c)) != null && d3c(b, YTb); - (Ccb(DD(vNb(a, hxc))) || Ccb(DD(vNb(a, _wc)))) && c3c(b, (qUb(), pUb), (S8b(), W7b)); - switch (BD(vNb(a, Lwc), 103).g) { - case 2: - case 3: - case 4: - c3c(e3c(b, (qUb(), lUb), (S8b(), Y7b)), pUb, X7b); - } - c2.Hc((Orc(), Frc)) && c3c(e3c(e3c(b, (qUb(), lUb), (S8b(), V7b)), oUb, T7b), pUb, U7b); - PD(vNb(a, rxc)) !== PD((kAc(), iAc)) && e3c(b, (qUb(), nUb), (S8b(), A8b)); - if (c2.Hc(Mrc)) { - e3c(b, (qUb(), lUb), (S8b(), G8b)); - e3c(b, mUb, E8b); - e3c(b, nUb, F8b); - } - PD(vNb(a, swc)) !== PD((yrc(), wrc)) && PD(vNb(a, Swc)) !== PD((Aad(), xad)) && c3c(b, (qUb(), pUb), (S8b(), j8b)); - Ccb(DD(vNb(a, cxc))) && e3c(b, (qUb(), nUb), (S8b(), i8b)); - Ccb(DD(vNb(a, Hwc))) && e3c(b, (qUb(), nUb), (S8b(), O8b)); - if (cUb(a)) { - PD(vNb(a, axc)) === PD(ebd) ? d = BD(vNb(a, Cwc), 292) : d = BD(vNb(a, Dwc), 292); - f2 = d == (Xrc(), Vrc) ? (S8b(), D8b) : (S8b(), R8b); - e3c(b, (qUb(), oUb), f2); - } - switch (BD(vNb(a, Kyc), 377).g) { - case 1: - e3c(b, (qUb(), oUb), (S8b(), P8b)); - break; - case 2: - c3c(e3c(e3c(b, (qUb(), nUb), (S8b(), P7b)), oUb, Q7b), pUb, R7b); - } - PD(vNb(a, ywc)) !== PD((tAc(), rAc)) && e3c(b, (qUb(), nUb), (S8b(), Q8b)); - return b; - } - function mZc(a) { - r4c(a, new E3c(P3c(M3c(O3c(N3c(new R3c(), Kre), "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 pZc()))); - p4c(a, Kre, _le, 1.3); - p4c(a, Kre, Jre, Ksd(VYc)); - p4c(a, Kre, ame, gZc); - p4c(a, Kre, wme, 15); - p4c(a, Kre, lqe, Ksd(SYc)); - p4c(a, Kre, Fme, Ksd(_Yc)); - p4c(a, Kre, Tme, Ksd(aZc)); - p4c(a, Kre, Eme, Ksd(bZc)); - p4c(a, Kre, Gme, Ksd($Yc)); - p4c(a, Kre, Dme, Ksd(cZc)); - p4c(a, Kre, Hme, Ksd(hZc)); - p4c(a, Kre, Bre, Ksd(eZc)); - p4c(a, Kre, Cre, Ksd(ZYc)); - p4c(a, Kre, Fre, Ksd(dZc)); - p4c(a, Kre, Gre, Ksd(iZc)); - p4c(a, Kre, Hre, Ksd(WYc)); - p4c(a, Kre, Ame, Ksd(XYc)); - p4c(a, Kre, xqe, Ksd(YYc)); - p4c(a, Kre, Ere, Ksd(UYc)); - p4c(a, Kre, Dre, Ksd(TYc)); - p4c(a, Kre, Ire, Ksd(kZc)); - } - function Wmd(b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r; - if (d == null) { - return null; - } - if (b.a != c2.Aj()) { - throw vbb(new Wdb(tte + c2.ne() + ute)); - } - if (JD(c2, 457)) { - r = _Pd(BD(c2, 671), d); - if (!r) { - throw vbb(new Wdb(vte + d + "' is not a valid enumerator of '" + c2.ne() + "'")); - } - return r; - } - switch (o1d((O6d(), M6d), c2).cl()) { - case 2: { - d = Qge(d, false); - break; - } - case 3: { - d = Qge(d, true); - break; - } - } - e = o1d(M6d, c2).$k(); - if (e) { - return e.Aj().Nh().Kh(e, d); - } - n = o1d(M6d, c2).al(); - if (n) { - r = new Rkb(); - for (k = Zmd(d), l = 0, m = k.length; l < m; ++l) { - j = k[l]; - Ekb(r, n.Aj().Nh().Kh(n, j)); - } - return r; - } - q = o1d(M6d, c2).bl(); - if (!q.dc()) { - for (p = q.Kc(); p.Ob(); ) { - o2 = BD(p.Pb(), 148); - try { - r = o2.Aj().Nh().Kh(o2, d); - if (r != null) { - return r; - } - } catch (a) { - a = ubb(a); - if (!JD(a, 60)) - throw vbb(a); - } - } - throw vbb(new Wdb(vte + d + "' does not match any member types of the union datatype '" + c2.ne() + "'")); - } - BD(c2, 834).Fj(); - f2 = r6d(c2.Bj()); - if (!f2) - return null; - if (f2 == yI) { - h = 0; - try { - h = Icb(d, Rie, Ohe) & aje; - } catch (a) { - a = ubb(a); - if (JD(a, 127)) { - g = rfb(d); - h = g[0]; - } else - throw vbb(a); - } - return bdb(h); - } - if (f2 == $J) { - for (i3 = 0; i3 < Pmd.length; ++i3) { - try { - return DQd(Pmd[i3], d); - } catch (a) { - a = ubb(a); - if (!JD(a, 32)) - throw vbb(a); - } - } - throw vbb(new Wdb(vte + d + "' is not a date formatted string of the form yyyy-MM-dd'T'HH:mm:ss'.'SSSZ or a valid subset thereof")); - } - throw vbb(new Wdb(vte + d + "' is invalid. ")); - } - function ngb(a, b) { - var c2, d, e, f2, g, h, i3, j; - c2 = 0; - g = 0; - f2 = b.length; - h = null; - j = new Vfb(); - if (g < f2 && (BCb(g, b.length), b.charCodeAt(g) == 43)) { - ++g; - ++c2; - if (g < f2 && (BCb(g, b.length), b.charCodeAt(g) == 43 || (BCb(g, b.length), b.charCodeAt(g) == 45))) { - throw vbb(new Oeb(Oje + b + '"')); - } - } - while (g < f2 && (BCb(g, b.length), b.charCodeAt(g) != 46) && (BCb(g, b.length), b.charCodeAt(g) != 101) && (BCb(g, b.length), b.charCodeAt(g) != 69)) { - ++g; - } - j.a += "" + qfb(b == null ? Xhe : (uCb(b), b), c2, g); - if (g < f2 && (BCb(g, b.length), b.charCodeAt(g) == 46)) { - ++g; - c2 = g; - while (g < f2 && (BCb(g, b.length), b.charCodeAt(g) != 101) && (BCb(g, b.length), b.charCodeAt(g) != 69)) { - ++g; - } - a.e = g - c2; - j.a += "" + qfb(b == null ? Xhe : (uCb(b), b), c2, g); - } else { - a.e = 0; - } - if (g < f2 && (BCb(g, b.length), b.charCodeAt(g) == 101 || (BCb(g, b.length), b.charCodeAt(g) == 69))) { - ++g; - c2 = g; - if (g < f2 && (BCb(g, b.length), b.charCodeAt(g) == 43)) { - ++g; - g < f2 && (BCb(g, b.length), b.charCodeAt(g) != 45) && ++c2; - } - h = b.substr(c2, f2 - c2); - a.e = a.e - Icb(h, Rie, Ohe); - if (a.e != QD(a.e)) { - throw vbb(new Oeb("Scale out of range.")); - } - } - i3 = j.a; - if (i3.length < 16) { - a.f = (kgb == null && (kgb = new RegExp("^[+-]?\\d*$", "i")), kgb.test(i3) ? parseInt(i3, 10) : NaN); - if (isNaN(a.f)) { - throw vbb(new Oeb(Oje + b + '"')); - } - a.a = ugb(a.f); - } else { - ogb(a, new Ygb(i3)); - } - a.d = j.a.length; - for (e = 0; e < j.a.length; ++e) { - d = bfb(j.a, e); - if (d != 45 && d != 48) { - break; - } - --a.d; - } - a.d == 0 && (a.d = 1); - } - function xXb() { - xXb = ccb; - wXb = new Hp(); - Rc(wXb, (Ucd(), Fcd), Jcd); - Rc(wXb, Qcd, Jcd); - Rc(wXb, Qcd, Mcd); - Rc(wXb, Bcd, Icd); - Rc(wXb, Bcd, Jcd); - Rc(wXb, Gcd, Jcd); - Rc(wXb, Gcd, Kcd); - Rc(wXb, Ocd, Dcd); - Rc(wXb, Ocd, Jcd); - Rc(wXb, Lcd, Ecd); - Rc(wXb, Lcd, Jcd); - Rc(wXb, Lcd, Kcd); - Rc(wXb, Lcd, Dcd); - Rc(wXb, Ecd, Lcd); - Rc(wXb, Ecd, Mcd); - Rc(wXb, Ecd, Icd); - Rc(wXb, Ecd, Jcd); - Rc(wXb, Ncd, Ncd); - Rc(wXb, Ncd, Kcd); - Rc(wXb, Ncd, Mcd); - Rc(wXb, Hcd, Hcd); - Rc(wXb, Hcd, Kcd); - Rc(wXb, Hcd, Icd); - Rc(wXb, Pcd, Pcd); - Rc(wXb, Pcd, Dcd); - Rc(wXb, Pcd, Mcd); - Rc(wXb, Ccd, Ccd); - Rc(wXb, Ccd, Dcd); - Rc(wXb, Ccd, Icd); - Rc(wXb, Kcd, Gcd); - Rc(wXb, Kcd, Lcd); - Rc(wXb, Kcd, Ncd); - Rc(wXb, Kcd, Hcd); - Rc(wXb, Kcd, Jcd); - Rc(wXb, Kcd, Kcd); - Rc(wXb, Kcd, Mcd); - Rc(wXb, Kcd, Icd); - Rc(wXb, Dcd, Ocd); - Rc(wXb, Dcd, Lcd); - Rc(wXb, Dcd, Pcd); - Rc(wXb, Dcd, Ccd); - Rc(wXb, Dcd, Dcd); - Rc(wXb, Dcd, Mcd); - Rc(wXb, Dcd, Icd); - Rc(wXb, Dcd, Jcd); - Rc(wXb, Mcd, Qcd); - Rc(wXb, Mcd, Ecd); - Rc(wXb, Mcd, Ncd); - Rc(wXb, Mcd, Pcd); - Rc(wXb, Mcd, Kcd); - Rc(wXb, Mcd, Dcd); - Rc(wXb, Mcd, Mcd); - Rc(wXb, Mcd, Jcd); - Rc(wXb, Icd, Bcd); - Rc(wXb, Icd, Ecd); - Rc(wXb, Icd, Hcd); - Rc(wXb, Icd, Ccd); - Rc(wXb, Icd, Kcd); - Rc(wXb, Icd, Dcd); - Rc(wXb, Icd, Icd); - Rc(wXb, Icd, Jcd); - Rc(wXb, Jcd, Fcd); - Rc(wXb, Jcd, Qcd); - Rc(wXb, Jcd, Bcd); - Rc(wXb, Jcd, Gcd); - Rc(wXb, Jcd, Ocd); - Rc(wXb, Jcd, Lcd); - Rc(wXb, Jcd, Ecd); - Rc(wXb, Jcd, Kcd); - Rc(wXb, Jcd, Dcd); - Rc(wXb, Jcd, Mcd); - Rc(wXb, Jcd, Icd); - Rc(wXb, Jcd, Jcd); - } - function YXb(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B; - a.d = new f7c(Pje, Pje); - a.c = new f7c(Qje, Qje); - for (m = b.Kc(); m.Ob(); ) { - k = BD(m.Pb(), 37); - for (t4 = new olb(k.a); t4.a < t4.c.c.length; ) { - s = BD(mlb(t4), 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 nYb(); - for (l = b.Kc(); l.Ob(); ) { - k = BD(l.Pb(), 37); - d = fYb(a, k); - Ekb(h.a, d); - d.a = d.a | !BD(vNb(d.c, (wtc(), Esc)), 21).dc(); - } - a.b = (LUb(), B = new VUb(), B.f = new CUb(c2), B.b = BUb(B.f, h), B); - PUb((o2 = a.b, new Zdd(), o2)); - a.e = new d7c(); - a.a = a.b.f.e; - for (g = new olb(h.a); g.a < g.c.c.length; ) { - e = BD(mlb(g), 841); - u2 = QUb(a.b, e); - g_b(e.c, u2.a, u2.b); - for (q = new olb(e.c.a); q.a < q.c.c.length; ) { - p = BD(mlb(q), 10); - if (p.k == (j0b(), e0b)) { - r = aYb(a, p.n, BD(vNb(p, (wtc(), Hsc)), 61)); - P6c(X6c(p.n), r); - } - } - } - for (f2 = new olb(h.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 841); - for (j = new olb(lYb(e)); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 17); - A = new t7c(i3.a); - St(A, 0, A0b(i3.c)); - Dsb(A, A0b(i3.d)); - n = null; - for (w2 = Jsb(A, 0); w2.b != w2.d.c; ) { - v = BD(Xsb(w2), 8); - if (!n) { - n = v; - continue; - } - if (Ky(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 (Ky(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; - } - } - } - V6c(a.e); - P6c(a.a, a.e); - } - function wZd(a) { - Bnd(a.b, _ve, OC(GC(ZI, 1), nie, 2, 6, [bwe, "ConsistentTransient"])); - Bnd(a.a, _ve, OC(GC(ZI, 1), nie, 2, 6, [bwe, "WellFormedSourceURI"])); - Bnd(a.o, _ve, OC(GC(ZI, 1), nie, 2, 6, [bwe, "InterfaceIsAbstract AtMostOneID UniqueFeatureNames UniqueOperationSignatures NoCircularSuperTypes WellFormedMapEntryClass ConsistentSuperTypes DisjointFeatureAndOperationSignatures"])); - Bnd(a.p, _ve, OC(GC(ZI, 1), nie, 2, 6, [bwe, "WellFormedInstanceTypeName UniqueTypeParameterNames"])); - Bnd(a.v, _ve, OC(GC(ZI, 1), nie, 2, 6, [bwe, "UniqueEnumeratorNames UniqueEnumeratorLiterals"])); - Bnd(a.R, _ve, OC(GC(ZI, 1), nie, 2, 6, [bwe, "WellFormedName"])); - Bnd(a.T, _ve, OC(GC(ZI, 1), nie, 2, 6, [bwe, "UniqueParameterNames UniqueTypeParameterNames NoRepeatingVoid"])); - Bnd(a.U, _ve, OC(GC(ZI, 1), nie, 2, 6, [bwe, "WellFormedNsURI WellFormedNsPrefix UniqueSubpackageNames UniqueClassifierNames UniqueNsURIs"])); - Bnd(a.W, _ve, OC(GC(ZI, 1), nie, 2, 6, [bwe, "ConsistentOpposite SingleContainer ConsistentKeys ConsistentUnique ConsistentContainer"])); - Bnd(a.bb, _ve, OC(GC(ZI, 1), nie, 2, 6, [bwe, "ValidDefaultValueLiteral"])); - Bnd(a.eb, _ve, OC(GC(ZI, 1), nie, 2, 6, [bwe, "ValidLowerBound ValidUpperBound ConsistentBounds ValidType"])); - Bnd(a.H, _ve, OC(GC(ZI, 1), nie, 2, 6, [bwe, "ConsistentType ConsistentBounds ConsistentArguments"])); - } - function B4b(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C; - if (b.dc()) { - return; - } - e = new s7c(); - h = c2 ? c2 : BD(b.Xb(0), 17); - o2 = h.c; - hQc(); - m = o2.i.k; - if (!(m == (j0b(), h0b) || m == i0b || m == e0b || m == d0b)) { - throw vbb(new Wdb("The target node of the edge must be a normal node or a northSouthPort.")); - } - Fsb(e, l7c(OC(GC(m1, 1), nie, 8, 0, [o2.i.n, o2.n, o2.a]))); - if ((Ucd(), Lcd).Hc(o2.j)) { - q = Edb(ED(vNb(o2, (wtc(), qtc)))); - l = new f7c(l7c(OC(GC(m1, 1), nie, 8, 0, [o2.i.n, o2.n, o2.a])).a, q); - Gsb(e, l, e.c.b, e.c); - } - k = null; - d = false; - i3 = b.Kc(); - while (i3.Ob()) { - g = BD(i3.Pb(), 17); - f2 = g.a; - if (f2.b != 0) { - if (d) { - j = Y6c(P6c(k, (sCb(f2.b != 0), BD(f2.a.a.c, 8))), 0.5); - Gsb(e, j, e.c.b, e.c); - d = false; - } else { - d = true; - } - k = R6c((sCb(f2.b != 0), BD(f2.c.b.c, 8))); - ye(e, f2); - Osb(f2); - } - } - p = h.d; - if (Lcd.Hc(p.j)) { - q = Edb(ED(vNb(p, (wtc(), qtc)))); - l = new f7c(l7c(OC(GC(m1, 1), nie, 8, 0, [p.i.n, p.n, p.a])).a, q); - Gsb(e, l, e.c.b, e.c); - } - Fsb(e, l7c(OC(GC(m1, 1), nie, 8, 0, [p.i.n, p.n, p.a]))); - a.d == (tBc(), qBc) && (r = (sCb(e.b != 0), BD(e.a.a.c, 8)), s = BD(Ut(e, 1), 8), t4 = new e7c(bRc(o2.j)), t4.a *= 5, t4.b *= 5, u2 = c7c(new f7c(s.a, s.b), r), v = new f7c(A4b(t4.a, u2.a), A4b(t4.b, u2.b)), P6c(v, r), w2 = Jsb(e, 1), Vsb(w2, v), A = (sCb(e.b != 0), BD(e.c.b.c, 8)), B = BD(Ut(e, e.b - 2), 8), t4 = new e7c(bRc(p.j)), t4.a *= 5, t4.b *= 5, u2 = c7c(new f7c(B.a, B.b), A), C = new f7c(A4b(t4.a, u2.a), A4b(t4.b, u2.b)), P6c(C, A), St(e, e.b - 1, C), void 0); - n = new YPc(e); - ye(h.a, UPc(n)); - } - function Kgd(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F, G, H2, I, J, K2, L2, M2, N, O, P; - t4 = BD(qud((!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b), 0), 82); - v = t4.Dg(); - w2 = t4.Eg(); - u2 = t4.Cg() / 2; - p = t4.Bg() / 2; - if (JD(t4, 186)) { - s = BD(t4, 118); - v += mpd(s).i; - v += mpd(s).i; - } - v += u2; - w2 += p; - F = BD(qud((!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b), 0), 82); - H2 = F.Dg(); - I = F.Eg(); - G = F.Cg() / 2; - A = F.Bg() / 2; - if (JD(F, 186)) { - D3 = BD(F, 118); - H2 += mpd(D3).i; - H2 += mpd(D3).i; - } - H2 += G; - I += A; - if ((!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a).i == 0) { - h = (Fhd(), j = new rmd(), j); - wtd((!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a), h); - } else if ((!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a).i > 1) { - o2 = new Oyd((!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a)); - while (o2.e != o2.i.gc()) { - Eyd(o2); - } - } - g = BD(qud((!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a), 0), 202); - q = H2; - H2 > v + u2 ? q = v + u2 : H2 < v - u2 && (q = v - u2); - r = I; - I > w2 + p ? r = w2 + p : I < w2 - p && (r = w2 - p); - q > v - u2 && q < v + u2 && r > w2 - p && r < w2 + p && (q = v + u2); - omd(g, q); - pmd(g, r); - B = v; - v > H2 + G ? B = H2 + G : v < H2 - G && (B = H2 - G); - C = w2; - w2 > I + A ? C = I + A : w2 < I - A && (C = I - A); - B > H2 - G && B < H2 + G && C > I - A && C < I + A && (C = I + A); - hmd(g, B); - imd(g, C); - Uxd((!g.a && (g.a = new xMd(y2, g, 5)), g.a)); - f2 = Bub(b, 5); - t4 == F && ++f2; - L2 = B - q; - O = C - r; - J = $wnd.Math.sqrt(L2 * L2 + O * O); - l = J * 0.20000000298023224; - M2 = L2 / (f2 + 1); - P = O / (f2 + 1); - K2 = q; - N = r; - for (k = 0; k < f2; k++) { - K2 += M2; - N += P; - m = K2 + Cub(b, 24) * lke * l - l / 2; - m < 0 ? m = 1 : m > c2 && (m = c2 - 1); - n = N + Cub(b, 24) * lke * l - l / 2; - n < 0 ? n = 1 : n > d && (n = d - 1); - e = (Fhd(), i3 = new xkd(), i3); - vkd(e, m); - wkd(e, n); - wtd((!g.a && (g.a = new xMd(y2, g, 5)), g.a), e); - } - } - function Nyc() { - Nyc = ccb; - iyc = (Y9c(), I9c); - jyc = J9c; - kyc = K9c; - lyc = L9c; - nyc = M9c; - oyc = N9c; - ryc = P9c; - tyc = R9c; - uyc = S9c; - syc = Q9c; - vyc = T9c; - xyc = U9c; - zyc = X9c; - qyc = O9c; - hyc = (jwc(), Bvc); - myc = Cvc; - pyc = Dvc; - wyc = Evc; - byc = new Osd(D9c, meb(0)); - cyc = yvc; - dyc = zvc; - eyc = Avc; - Kyc = awc; - Cyc = Hvc; - Dyc = Kvc; - Gyc = Svc; - Eyc = Nvc; - Fyc = Pvc; - Myc = fwc; - Lyc = cwc; - Iyc = Yvc; - Hyc = Wvc; - Jyc = $vc; - Cxc = pvc; - Dxc = qvc; - Xwc = Auc; - Ywc = Duc; - Lxc = new q0b(12); - Kxc = new Osd(f9c, Lxc); - Twc = (Aad(), wad); - Swc = new Osd(E8c, Twc); - Uxc = new Osd(s9c, 0); - fyc = new Osd(E9c, meb(1)); - owc = new Osd(r8c, tme); - Jxc = d9c; - Vxc = t9c; - $xc = A9c; - Kwc = y8c; - mwc = p8c; - axc = J8c; - gyc = new Osd(H9c, (Bcb(), true)); - fxc = M8c; - gxc = N8c; - Fxc = Y8c; - Ixc = b9c; - Gxc = $8c; - Nwc = (ead(), cad); - Lwc = new Osd(z8c, Nwc); - xxc = W8c; - wxc = U8c; - Yxc = x9c; - Xxc = w9c; - Zxc = z9c; - Oxc = (Tbd(), Sbd); - new Osd(l9c, Oxc); - Qxc = o9c; - Rxc = p9c; - Sxc = q9c; - Pxc = n9c; - Byc = Gvc; - sxc = avc; - rxc = $uc; - Ayc = Fvc; - mxc = Suc; - Jwc = muc; - Iwc = kuc; - Awc = Xtc; - Bwc = Ytc; - Dwc = buc; - Cwc = Ztc; - Hwc = iuc; - uxc = cvc; - vxc = dvc; - ixc = Luc; - Exc = uvc; - zxc = hvc; - $wc = Guc; - Bxc = nvc; - Vwc = wuc; - Wwc = yuc; - zwc = w8c; - yxc = evc; - swc = Mtc; - rwc = Ktc; - qwc = Jtc; - cxc = Juc; - bxc = Iuc; - dxc = Kuc; - Hxc = _8c; - jxc = Q8c; - Zwc = G8c; - Qwc = C8c; - Pwc = B8c; - Ewc = euc; - Wxc = v9c; - pwc = v8c; - exc = L8c; - Txc = r9c; - Mxc = h9c; - Nxc = j9c; - oxc = Vuc; - pxc = Xuc; - ayc = C9c; - nwc = Itc; - qxc = Zuc; - Rwc = suc; - Owc = quc; - txc = S8c; - kxc = Puc; - Axc = kvc; - yyc = V9c; - Mwc = ouc; - _xc = wvc; - Uwc = uuc; - lxc = Ruc; - Fwc = guc; - hxc = P8c; - nxc = Uuc; - Gwc = huc; - ywc = Vtc; - wwc = Stc; - uwc = Qtc; - vwc = Rtc; - xwc = Utc; - twc = Otc; - _wc = Huc; - } - function shb(a, b) { - phb(); - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F, G, H2; - B = a.e; - o2 = a.d; - e = a.a; - if (B == 0) { - switch (b) { - case 0: - return "0"; - case 1: - return $je; - 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 Ufb(); - b < 0 ? (w2.a += "0E+", w2) : (w2.a += "0E", w2); - w2.a += -b; - return w2.a; - } - } - t4 = o2 * 10 + 1 + 7; - u2 = KC(TD, $ie, 25, t4 + 1, 15, 1); - c2 = t4; - if (o2 == 1) { - h = e[0]; - if (h < 0) { - H2 = xbb(h, Yje); - do { - p = H2; - H2 = Abb(H2, 10); - u2[--c2] = 48 + Tbb(Qbb(p, Ibb(H2, 10))) & aje; - } while (ybb(H2, 0) != 0); - } else { - H2 = h; - do { - p = H2; - H2 = H2 / 10 | 0; - u2[--c2] = 48 + (p - H2 * 10) & aje; - } while (H2 != 0); - } - } else { - D3 = KC(WD, oje, 25, o2, 15, 1); - G = o2; - $fb(e, 0, D3, 0, G); - I: - while (true) { - A = 0; - for (j = G - 1; j >= 0; j--) { - F = wbb(Nbb(A, 32), xbb(D3[j], Yje)); - r = qhb(F); - D3[j] = Tbb(r); - A = Tbb(Obb(r, 32)); - } - s = Tbb(A); - q = c2; - do { - u2[--c2] = 48 + s % 10 & aje; - } while ((s = s / 10 | 0) != 0 && c2 != 0); - d = 9 - q + c2; - for (i3 = 0; i3 < d && c2 > 0; i3++) { - u2[--c2] = 48; - } - l = G - 1; - for (; D3[l] == 0; l--) { - if (l == 0) { - break I; - } - } - G = l + 1; - } - while (u2[c2] == 48) { - ++c2; - } - } - n = B < 0; - g = t4 - c2 - b - 1; - if (b == 0) { - n && (u2[--c2] = 45); - return zfb(u2, c2, t4 - c2); - } - if (b > 0 && g >= -6) { - if (g >= 0) { - k = c2 + g; - for (m = t4 - 1; m >= k; m--) { - u2[m + 1] = u2[m]; - } - u2[++k] = 46; - n && (u2[--c2] = 45); - return zfb(u2, c2, t4 - c2 + 1); - } - for (l = 2; l < -g + 1; l++) { - u2[--c2] = 48; - } - u2[--c2] = 46; - u2[--c2] = 48; - n && (u2[--c2] = 45); - return zfb(u2, c2, t4 - c2); - } - C = c2 + 1; - f2 = t4; - v = new Vfb(); - n && (v.a += "-", v); - if (f2 - C >= 1) { - Kfb(v, u2[c2]); - v.a += "."; - v.a += zfb(u2, c2 + 1, t4 - c2 - 1); - } else { - v.a += zfb(u2, c2, t4 - c2); - } - v.a += "E"; - g > 0 && (v.a += "+", v); - v.a += "" + g; - return v.a; - } - function z$c(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2; - a.c = b; - a.g = new Lqb(); - c2 = (Pgd(), new bhd(a.c)); - d = new YGb(c2); - UGb(d); - t4 = GD(hkd(a.c, (d0c(), Y_c))); - i3 = BD(hkd(a.c, $_c), 316); - v = BD(hkd(a.c, __c), 429); - g = BD(hkd(a.c, T_c), 482); - u2 = BD(hkd(a.c, Z_c), 430); - a.j = Edb(ED(hkd(a.c, a0c))); - h = a.a; - switch (i3.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 vbb(new Wdb(Mre + (i3.f != null ? i3.f : "" + i3.g))); - } - a.d = new g_c(h, v, g); - yNb(a.d, (XNb(), VNb), DD(hkd(a.c, V_c))); - a.d.c = Ccb(DD(hkd(a.c, U_c))); - if (Vod(a.c).i == 0) { - return a.d; - } - for (l = new Fyd(Vod(a.c)); l.e != l.i.gc(); ) { - k = BD(Dyd(l), 33); - n = k.g / 2; - m = k.f / 2; - w2 = new f7c(k.i + n, k.j + m); - while (Mhb(a.g, w2)) { - O6c(w2, ($wnd.Math.random() - 0.5) * qme, ($wnd.Math.random() - 0.5) * qme); - } - p = BD(hkd(k, (Y9c(), S8c)), 142); - q = new aOb(w2, new J6c(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))); - Ekb(a.d.i, q); - Rhb(a.g, w2, new vgd(q, k)); - } - switch (u2.g) { - case 0: - if (t4 == null) { - a.d.d = BD(Ikb(a.d.i, 0), 65); - } else { - for (s = new olb(a.d.i); s.a < s.c.c.length; ) { - q = BD(mlb(s), 65); - o2 = BD(BD(Ohb(a.g, q.a), 46).b, 33).zg(); - o2 != null && dfb(o2, t4) && (a.d.d = q); - } - } - break; - case 1: - e = new f7c(a.c.g, a.c.f); - e.a *= 0.5; - e.b *= 0.5; - O6c(e, a.c.i, a.c.j); - f2 = Pje; - for (r = new olb(a.d.i); r.a < r.c.c.length; ) { - q = BD(mlb(r), 65); - j = S6c(q.a, e); - if (j < f2) { - f2 = j; - a.d.d = q; - } - } - break; - default: - throw vbb(new Wdb(Mre + (u2.f != null ? u2.f : "" + u2.g))); - } - return a.d; - } - function qfd(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2; - v = BD(qud((!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a), 0), 202); - k = new s7c(); - u2 = new Lqb(); - w2 = tfd(v); - jrb(u2.f, v, w2); - m = new Lqb(); - d = new Psb(); - for (o2 = ul(pl(OC(GC(KI, 1), Uhe, 20, 0, [(!b.d && (b.d = new y5d(B2, b, 8, 5)), b.d), (!b.e && (b.e = new y5d(B2, b, 7, 4)), b.e)]))); Qr(o2); ) { - n = BD(Rr(o2), 79); - if ((!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a).i != 1) { - throw vbb(new Wdb(Tse + (!a.a && (a.a = new cUd(A2, a, 6, 6)), a.a).i)); - } - if (n != a) { - q = BD(qud((!n.a && (n.a = new cUd(A2, n, 6, 6)), n.a), 0), 202); - Gsb(d, q, d.c.b, d.c); - p = BD(Wd(irb(u2.f, q)), 12); - if (!p) { - p = tfd(q); - jrb(u2.f, q, p); - } - l = c2 ? c7c(new g7c(BD(Ikb(w2, w2.c.length - 1), 8)), BD(Ikb(p, p.c.length - 1), 8)) : c7c(new g7c((tCb(0, w2.c.length), BD(w2.c[0], 8))), (tCb(0, p.c.length), BD(p.c[0], 8))); - jrb(m.f, q, l); - } - } - if (d.b != 0) { - r = BD(Ikb(w2, c2 ? w2.c.length - 1 : 0), 8); - for (j = 1; j < w2.c.length; j++) { - s = BD(Ikb(w2, c2 ? w2.c.length - 1 - j : j), 8); - e = Jsb(d, 0); - while (e.b != e.d.c) { - q = BD(Xsb(e), 202); - p = BD(Wd(irb(u2.f, q)), 12); - if (p.c.length <= j) { - Zsb(e); - } else { - t4 = P6c(new g7c(BD(Ikb(p, c2 ? p.c.length - 1 - j : j), 8)), BD(Wd(irb(m.f, q)), 8)); - if (s.a != t4.a || s.b != t4.b) { - f2 = s.a - r.a; - h = s.b - r.b; - g = t4.a - r.a; - i3 = t4.b - r.b; - g * h == i3 * 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) == (i3 == 0 || isNaN(i3) ? i3 : i3 < 0 ? -1 : 1) ? ($wnd.Math.abs(f2) < $wnd.Math.abs(g) || $wnd.Math.abs(h) < $wnd.Math.abs(i3)) && (Gsb(k, s, k.c.b, k.c), true) : j > 1 && (Gsb(k, r, k.c.b, k.c), true); - Zsb(e); - } - } - } - r = s; - } - } - return k; - } - function $Bc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F, G, H2, I, J, K2, L2; - Odd(c2, "Greedy cycle removal", 1); - t4 = b.a; - L2 = t4.c.length; - a.a = KC(WD, oje, 25, L2, 15, 1); - a.c = KC(WD, oje, 25, L2, 15, 1); - a.b = KC(WD, oje, 25, L2, 15, 1); - j = 0; - for (r = new olb(t4); r.a < r.c.c.length; ) { - p = BD(mlb(r), 10); - p.p = j; - for (C = new olb(p.j); C.a < C.c.c.length; ) { - w2 = BD(mlb(C), 11); - for (h = new olb(w2.e); h.a < h.c.c.length; ) { - d = BD(mlb(h), 17); - if (d.c.i == p) { - continue; - } - G = BD(vNb(d, (Nyc(), cyc)), 19).a; - a.a[j] += G > 0 ? G + 1 : 1; - } - for (g = new olb(w2.g); g.a < g.c.c.length; ) { - d = BD(mlb(g), 17); - if (d.d.i == p) { - continue; - } - G = BD(vNb(d, (Nyc(), cyc)), 19).a; - a.c[j] += G > 0 ? G + 1 : 1; - } - } - a.c[j] == 0 ? Dsb(a.e, p) : a.a[j] == 0 && Dsb(a.f, p); - ++j; - } - o2 = -1; - n = 1; - l = new Rkb(); - a.d = BD(vNb(b, (wtc(), jtc)), 230); - while (L2 > 0) { - while (a.e.b != 0) { - I = BD(Lsb(a.e), 10); - a.b[I.p] = o2--; - _Bc(a, I); - --L2; - } - while (a.f.b != 0) { - J = BD(Lsb(a.f), 10); - a.b[J.p] = n++; - _Bc(a, J); - --L2; - } - if (L2 > 0) { - m = Rie; - for (s = new olb(t4); s.a < s.c.c.length; ) { - p = BD(mlb(s), 10); - if (a.b[p.p] == 0) { - u2 = a.c[p.p] - a.a[p.p]; - if (u2 >= m) { - if (u2 > m) { - l.c = KC(SI, Uhe, 1, 0, 5, 1); - m = u2; - } - l.c[l.c.length] = p; - } - } - } - k = a.Zf(l); - a.b[k.p] = n++; - _Bc(a, k); - --L2; - } - } - H2 = t4.c.length + 1; - for (j = 0; j < t4.c.length; j++) { - a.b[j] < 0 && (a.b[j] += H2); - } - for (q = new olb(t4); q.a < q.c.c.length; ) { - p = BD(mlb(q), 10); - F = m_b(p.j); - for (A = F, B = 0, D3 = A.length; B < D3; ++B) { - w2 = A[B]; - v = k_b(w2.g); - for (e = v, f2 = 0, i3 = e.length; f2 < i3; ++f2) { - d = e[f2]; - K2 = d.d.i.p; - if (a.b[p.p] > a.b[K2]) { - PZb(d, true); - yNb(b, Asc, (Bcb(), true)); - } - } - } - } - a.a = null; - a.c = null; - a.b = null; - Osb(a.f); - Osb(a.e); - Qdd(c2); - } - function sQb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r; - d = new Rkb(); - h = new Rkb(); - q = b / 2; - n = a.gc(); - e = BD(a.Xb(0), 8); - r = BD(a.Xb(1), 8); - o2 = tQb(e.a, e.b, r.a, r.b, q); - Ekb(d, (tCb(0, o2.c.length), BD(o2.c[0], 8))); - Ekb(h, (tCb(1, o2.c.length), BD(o2.c[1], 8))); - for (j = 2; j < n; j++) { - p = e; - e = r; - r = BD(a.Xb(j), 8); - o2 = tQb(e.a, e.b, p.a, p.b, q); - Ekb(d, (tCb(1, o2.c.length), BD(o2.c[1], 8))); - Ekb(h, (tCb(0, o2.c.length), BD(o2.c[0], 8))); - o2 = tQb(e.a, e.b, r.a, r.b, q); - Ekb(d, (tCb(0, o2.c.length), BD(o2.c[0], 8))); - Ekb(h, (tCb(1, o2.c.length), BD(o2.c[1], 8))); - } - o2 = tQb(r.a, r.b, e.a, e.b, q); - Ekb(d, (tCb(1, o2.c.length), BD(o2.c[1], 8))); - Ekb(h, (tCb(0, o2.c.length), BD(o2.c[0], 8))); - c2 = new s7c(); - g = new Rkb(); - Dsb(c2, (tCb(0, d.c.length), BD(d.c[0], 8))); - for (k = 1; k < d.c.length - 2; k += 2) { - f2 = (tCb(k, d.c.length), BD(d.c[k], 8)); - m = rQb((tCb(k - 1, d.c.length), BD(d.c[k - 1], 8)), f2, (tCb(k + 1, d.c.length), BD(d.c[k + 1], 8)), (tCb(k + 2, d.c.length), BD(d.c[k + 2], 8))); - !isFinite(m.a) || !isFinite(m.b) ? (Gsb(c2, f2, c2.c.b, c2.c), true) : (Gsb(c2, m, c2.c.b, c2.c), true); - } - Dsb(c2, BD(Ikb(d, d.c.length - 1), 8)); - Ekb(g, (tCb(0, h.c.length), BD(h.c[0], 8))); - for (l = 1; l < h.c.length - 2; l += 2) { - f2 = (tCb(l, h.c.length), BD(h.c[l], 8)); - m = rQb((tCb(l - 1, h.c.length), BD(h.c[l - 1], 8)), f2, (tCb(l + 1, h.c.length), BD(h.c[l + 1], 8)), (tCb(l + 2, h.c.length), BD(h.c[l + 2], 8))); - !isFinite(m.a) || !isFinite(m.b) ? (g.c[g.c.length] = f2, true) : (g.c[g.c.length] = m, true); - } - Ekb(g, BD(Ikb(h, h.c.length - 1), 8)); - for (i3 = g.c.length - 1; i3 >= 0; i3--) { - Dsb(c2, (tCb(i3, g.c.length), BD(g.c[i3], 8))); - } - return c2; - } - function aFd(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n; - g = true; - l = null; - d = null; - e = null; - b = false; - n = BEd; - j = null; - f2 = null; - h = 0; - i3 = UEd(a, h, zEd, AEd); - if (i3 < a.length && (BCb(i3, a.length), a.charCodeAt(i3) == 58)) { - l = a.substr(h, i3 - h); - h = i3 + 1; - } - c2 = l != null && hnb(GEd, l.toLowerCase()); - if (c2) { - i3 = a.lastIndexOf("!/"); - if (i3 == -1) { - throw vbb(new Wdb("no archive separator")); - } - g = true; - d = qfb(a, h, ++i3); - h = i3; - } else if (h >= 0 && dfb(a.substr(h, "//".length), "//")) { - h += 2; - i3 = UEd(a, h, CEd, DEd); - d = a.substr(h, i3 - h); - h = i3; - } else if (l != null && (h == a.length || (BCb(h, a.length), a.charCodeAt(h) != 47))) { - g = false; - i3 = ifb(a, wfb(35), h); - i3 == -1 && (i3 = a.length); - d = a.substr(h, i3 - h); - h = i3; - } - if (!c2 && h < a.length && (BCb(h, a.length), a.charCodeAt(h) == 47)) { - i3 = UEd(a, h + 1, CEd, DEd); - k = a.substr(h + 1, i3 - (h + 1)); - if (k.length > 0 && bfb(k, k.length - 1) == 58) { - e = k; - h = i3; - } - } - if (h < a.length && (BCb(h, a.length), a.charCodeAt(h) == 47)) { - ++h; - b = true; - } - if (h < a.length && (BCb(h, a.length), a.charCodeAt(h) != 63) && (BCb(h, a.length), a.charCodeAt(h) != 35)) { - m = new Rkb(); - while (h < a.length && (BCb(h, a.length), a.charCodeAt(h) != 63) && (BCb(h, a.length), a.charCodeAt(h) != 35)) { - i3 = UEd(a, h, CEd, DEd); - Ekb(m, a.substr(h, i3 - h)); - h = i3; - h < a.length && (BCb(h, a.length), a.charCodeAt(h) == 47) && (bFd(a, ++h) || (m.c[m.c.length] = "", true)); - } - n = KC(ZI, nie, 2, m.c.length, 6, 1); - Qkb(m, n); - } - if (h < a.length && (BCb(h, a.length), a.charCodeAt(h) == 63)) { - i3 = gfb(a, 35, ++h); - i3 == -1 && (i3 = a.length); - j = a.substr(h, i3 - h); - h = i3; - } - h < a.length && (f2 = pfb(a, ++h)); - iFd(g, l, d, e, n, j); - return new NEd(g, l, d, e, b, n, j, f2); - } - function sJc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F, G, H2, I, J, K2; - I = new Rkb(); - for (o2 = new olb(b.b); o2.a < o2.c.c.length; ) { - m = BD(mlb(o2), 29); - for (v = new olb(m.a); v.a < v.c.c.length; ) { - u2 = BD(mlb(v), 10); - u2.p = -1; - l = Rie; - B = Rie; - for (D3 = new olb(u2.j); D3.a < D3.c.c.length; ) { - C = BD(mlb(D3), 11); - for (e = new olb(C.e); e.a < e.c.c.length; ) { - c2 = BD(mlb(e), 17); - F = BD(vNb(c2, (Nyc(), eyc)), 19).a; - l = $wnd.Math.max(l, F); - } - for (d = new olb(C.g); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 17); - F = BD(vNb(c2, (Nyc(), eyc)), 19).a; - B = $wnd.Math.max(B, F); - } - } - yNb(u2, hJc, meb(l)); - yNb(u2, iJc, meb(B)); - } - } - r = 0; - for (n = new olb(b.b); n.a < n.c.c.length; ) { - m = BD(mlb(n), 29); - for (v = new olb(m.a); v.a < v.c.c.length; ) { - u2 = BD(mlb(v), 10); - if (u2.p < 0) { - H2 = new zJc(); - H2.b = r++; - oJc(a, u2, H2); - I.c[I.c.length] = H2; - } - } - } - A = Pu(I.c.length); - k = Pu(I.c.length); - for (g = 0; g < I.c.length; g++) { - Ekb(A, new Rkb()); - Ekb(k, meb(0)); - } - mJc(b, I, A, k); - J = BD(Qkb(I, KC(sY, Iqe, 257, I.c.length, 0, 1)), 840); - w2 = BD(Qkb(A, KC(yK, eme, 15, A.c.length, 0, 1)), 192); - j = KC(WD, oje, 25, k.c.length, 15, 1); - for (h = 0; h < j.length; h++) { - j[h] = (tCb(h, k.c.length), BD(k.c[h], 19)).a; - } - s = 0; - t4 = new Rkb(); - for (i3 = 0; i3 < J.length; i3++) { - j[i3] == 0 && Ekb(t4, J[i3]); - } - q = KC(WD, oje, 25, J.length, 15, 1); - while (t4.c.length != 0) { - H2 = BD(Kkb(t4, 0), 257); - q[H2.b] = s++; - while (!w2[H2.b].dc()) { - K2 = BD(w2[H2.b].$c(0), 257); - --j[K2.b]; - j[K2.b] == 0 && (t4.c[t4.c.length] = K2, true); - } - } - a.a = KC(sY, Iqe, 257, 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 olb(p.e); v.a < v.c.c.length; ) { - u2 = BD(mlb(v), 10); - u2.p = G; - } - } - return a.a; - } - function nde(a) { - var b, c2, d; - if (a.d >= a.j) { - a.a = -1; - a.c = 1; - return; - } - b = bfb(a.i, a.d++); - a.a = b; - if (a.b == 1) { - switch (b) { - case 92: - d = 10; - if (a.d >= a.j) - throw vbb(new mde(tvd((h0d(), uue)))); - a.a = bfb(a.i, a.d++); - break; - case 45: - if ((a.e & 512) == 512 && a.d < a.j && bfb(a.i, a.d) == 91) { - ++a.d; - d = 24; - } else - d = 0; - break; - case 91: - if ((a.e & 512) != 512 && a.d < a.j && bfb(a.i, a.d) == 58) { - ++a.d; - d = 20; - break; - } - default: - if ((b & 64512) == Uje && a.d < a.j) { - c2 = bfb(a.i, a.d); - if ((c2 & 64512) == 56320) { - a.a = Tje + (b - Uje << 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 (bfb(a.i, a.d) != 63) - break; - if (++a.d >= a.j) - throw vbb(new mde(tvd((h0d(), vue)))); - b = bfb(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 vbb(new mde(tvd((h0d(), vue)))); - b = bfb(a.i, a.d++); - if (b == 61) { - d = 16; - } else if (b == 33) { - d = 17; - } else - throw vbb(new mde(tvd((h0d(), wue)))); - break; - case 35: - while (a.d < a.j) { - b = bfb(a.i, a.d++); - if (b == 41) - break; - } - if (b != 41) - throw vbb(new mde(tvd((h0d(), xue)))); - 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 vbb(new mde(tvd((h0d(), vue)))); - } - break; - case 92: - d = 10; - if (a.d >= a.j) - throw vbb(new mde(tvd((h0d(), uue)))); - a.a = bfb(a.i, a.d++); - break; - default: - d = 0; - } - a.c = d; + } 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 P5b(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F, G; - A = BD(vNb(a, (Nyc(), Vxc)), 98); - if (!(A != (dcd(), bcd) && A != ccd)) { - return; - } - o2 = a.b; - n = o2.c.length; - k = new Skb((Xj(n + 2, Mie), Oy(wbb(wbb(5, n + 2), (n + 2) / 10 | 0)))); - p = new Skb((Xj(n + 2, Mie), Oy(wbb(wbb(5, n + 2), (n + 2) / 10 | 0)))); - Ekb(k, new Lqb()); - Ekb(k, new Lqb()); - Ekb(p, new Rkb()); - Ekb(p, new Rkb()); - w2 = new Rkb(); - for (b = 0; b < n; b++) { - c2 = (tCb(b, o2.c.length), BD(o2.c[b], 29)); - B = (tCb(b, k.c.length), BD(k.c[b], 83)); - q = new Lqb(); - k.c[k.c.length] = q; - D3 = (tCb(b, p.c.length), BD(p.c[b], 15)); - s = new Rkb(); - p.c[p.c.length] = s; - for (e = new olb(c2.a); e.a < e.c.c.length; ) { - d = BD(mlb(e), 10); - if (L5b(d)) { - w2.c[w2.c.length] = d; - continue; - } - for (j = new Sr(ur(R_b(d).a.Kc(), new Sq())); Qr(j); ) { - h = BD(Rr(j), 17); - F = h.c.i; - if (!L5b(F)) { - continue; - } - C = BD(B.xc(vNb(F, (wtc(), $sc))), 10); - if (!C) { - C = K5b(a, F); - B.zc(vNb(F, $sc), C); - D3.Fc(C); - } - QZb(h, BD(Ikb(C.j, 1), 11)); - } - for (i3 = new Sr(ur(U_b(d).a.Kc(), new Sq())); Qr(i3); ) { - h = BD(Rr(i3), 17); - G = h.d.i; - if (!L5b(G)) { - continue; - } - r = BD(Ohb(q, vNb(G, (wtc(), $sc))), 10); - if (!r) { - r = K5b(a, G); - Rhb(q, vNb(G, $sc), r); - s.c[s.c.length] = r; - } - RZb(h, BD(Ikb(r.j, 0), 11)); - } - } - } - for (l = 0; l < p.c.length; l++) { - t4 = (tCb(l, p.c.length), BD(p.c[l], 15)); - if (t4.dc()) { - continue; - } - m = null; - if (l == 0) { - m = new H1b(a); - wCb(0, o2.c.length); - aCb(o2.c, 0, m); - } else if (l == k.c.length - 1) { - m = new H1b(a); - o2.c[o2.c.length] = m; - } else { - m = (tCb(l - 1, o2.c.length), BD(o2.c[l - 1], 29)); - } - for (g = t4.Kc(); g.Ob(); ) { - f2 = BD(g.Pb(), 10); - $_b(f2, m); - } - } - for (v = new olb(w2); v.a < v.c.c.length; ) { - u2 = BD(mlb(v), 10); - $_b(u2, null); - } - yNb(a, (wtc(), Fsc), w2); + } 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 BCc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v; - Odd(c2, "Coffman-Graham Layering", 1); - if (b.a.c.length == 0) { - Qdd(c2); - return; - } - v = BD(vNb(b, (Nyc(), kxc)), 19).a; - i3 = 0; - g = 0; - for (m = new olb(b.a); m.a < m.c.c.length; ) { - l = BD(mlb(m), 10); - l.p = i3++; - for (f2 = new Sr(ur(U_b(l).a.Kc(), new Sq())); Qr(f2); ) { - e = BD(Rr(f2), 17); - e.p = g++; - } - } - a.d = KC(sbb, dle, 25, i3, 16, 1); - a.a = KC(sbb, dle, 25, g, 16, 1); - a.b = KC(WD, oje, 25, i3, 15, 1); - a.e = KC(WD, oje, 25, i3, 15, 1); - a.f = KC(WD, oje, 25, i3, 15, 1); - Nc(a.c); - CCc(a, b); - o2 = new gub(new GCc(a)); - for (u2 = new olb(b.a); u2.a < u2.c.c.length; ) { - s = BD(mlb(u2), 10); - for (f2 = new Sr(ur(R_b(s).a.Kc(), new Sq())); Qr(f2); ) { - e = BD(Rr(f2), 17); - a.a[e.p] || ++a.b[s.p]; - } - a.b[s.p] == 0 && (zCb(cub(o2, s)), true); - } - h = 0; - while (o2.b.c.length != 0) { - s = BD(dub(o2), 10); - a.f[s.p] = h++; - for (f2 = new Sr(ur(U_b(s).a.Kc(), new Sq())); Qr(f2); ) { - e = BD(Rr(f2), 17); - if (a.a[e.p]) { - continue; - } - q = e.d.i; - --a.b[q.p]; - Rc(a.c, q, meb(a.f[s.p])); - a.b[q.p] == 0 && (zCb(cub(o2, q)), true); - } - } - n = new gub(new KCc(a)); - for (t4 = new olb(b.a); t4.a < t4.c.c.length; ) { - s = BD(mlb(t4), 10); - for (f2 = new Sr(ur(U_b(s).a.Kc(), new Sq())); Qr(f2); ) { - e = BD(Rr(f2), 17); - a.a[e.p] || ++a.e[s.p]; - } - a.e[s.p] == 0 && (zCb(cub(n, s)), true); - } - k = new Rkb(); - d = yCc(b, k); - while (n.b.c.length != 0) { - r = BD(dub(n), 10); - (d.a.c.length >= v || !wCc(r, d)) && (d = yCc(b, k)); - $_b(r, d); - for (f2 = new Sr(ur(R_b(r).a.Kc(), new Sq())); Qr(f2); ) { - e = BD(Rr(f2), 17); - if (a.a[e.p]) { - continue; - } - p = e.c.i; - --a.e[p.p]; - a.e[p.p] == 0 && (zCb(cub(n, p)), true); - } - } - for (j = k.c.length - 1; j >= 0; --j) { - Ekb(b.b, (tCb(j, k.c.length), BD(k.c[j], 29))); - } - b.a.c = KC(SI, Uhe, 1, 0, 5, 1); - Qdd(c2); + } 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 gee(a) { - var b, c2, d, e, f2, g, h, i3, j; - a.b = 1; - nde(a); - b = null; - if (a.c == 0 && a.a == 94) { - nde(a); - b = (wfe(), wfe(), new $fe(4)); - Ufe(b, 0, lxe); - h = new $fe(4); - } else { - h = (wfe(), wfe(), new $fe(4)); - } - e = true; - while ((j = a.c) != 1) { - if (j == 0 && a.a == 93 && !e) { - if (b) { - Zfe(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: - Xfe(h, fee(c2)); - d = true; - break; - case 105: - case 73: - case 99: - case 67: - c2 = (Xfe(h, fee(c2)), -1); - c2 < 0 && (d = true); - break; - case 112: - case 80: - i3 = tde(a, c2); - if (!i3) - throw vbb(new mde(tvd((h0d(), Iue)))); - Xfe(h, i3); - d = true; - break; - default: - c2 = eee(a); - } - } else if (j == 24 && !e) { - if (b) { - Zfe(b, h); - h = b; - } - f2 = gee(a); - Zfe(h, f2); - if (a.c != 0 || a.a != 93) - throw vbb(new mde(tvd((h0d(), Mue)))); - break; - } - nde(a); - if (!d) { - if (j == 0) { - if (c2 == 91) - throw vbb(new mde(tvd((h0d(), Nue)))); - if (c2 == 93) - throw vbb(new mde(tvd((h0d(), Oue)))); - if (c2 == 45 && !e && a.a != 93) - throw vbb(new mde(tvd((h0d(), Pue)))); - } - if (a.c != 0 || a.a != 45 || c2 == 45 && e) { - Ufe(h, c2, c2); - } else { - nde(a); - if ((j = a.c) == 1) - throw vbb(new mde(tvd((h0d(), Kue)))); - if (j == 0 && a.a == 93) { - Ufe(h, c2, c2); - Ufe(h, 45, 45); - } else if (j == 0 && a.a == 93 || j == 24) { - throw vbb(new mde(tvd((h0d(), Pue)))); - } else { - g = a.a; - if (j == 0) { - if (g == 91) - throw vbb(new mde(tvd((h0d(), Nue)))); - if (g == 93) - throw vbb(new mde(tvd((h0d(), Oue)))); - if (g == 45) - throw vbb(new mde(tvd((h0d(), Pue)))); - } else - j == 10 && (g = eee(a)); - nde(a); - if (c2 > g) - throw vbb(new mde(tvd((h0d(), Sue)))); - Ufe(h, c2, g); - } - } - } - e = false; - } - if (a.c == 1) - throw vbb(new mde(tvd((h0d(), Kue)))); - Yfe(h); - Vfe(h); - a.b = 0; - nde(a); - return h; - } - function xZd(a) { - Bnd(a.c, Rve, OC(GC(ZI, 1), nie, 2, 6, [cwe, "http://www.w3.org/2001/XMLSchema#decimal"])); - Bnd(a.d, Rve, OC(GC(ZI, 1), nie, 2, 6, [cwe, "http://www.w3.org/2001/XMLSchema#integer"])); - Bnd(a.e, Rve, OC(GC(ZI, 1), nie, 2, 6, [cwe, "http://www.w3.org/2001/XMLSchema#boolean"])); - Bnd(a.f, Rve, OC(GC(ZI, 1), nie, 2, 6, [cwe, "EBoolean", fue, "EBoolean:Object"])); - Bnd(a.i, Rve, OC(GC(ZI, 1), nie, 2, 6, [cwe, "http://www.w3.org/2001/XMLSchema#byte"])); - Bnd(a.g, Rve, OC(GC(ZI, 1), nie, 2, 6, [cwe, "http://www.w3.org/2001/XMLSchema#hexBinary"])); - Bnd(a.j, Rve, OC(GC(ZI, 1), nie, 2, 6, [cwe, "EByte", fue, "EByte:Object"])); - Bnd(a.n, Rve, OC(GC(ZI, 1), nie, 2, 6, [cwe, "EChar", fue, "EChar:Object"])); - Bnd(a.t, Rve, OC(GC(ZI, 1), nie, 2, 6, [cwe, "http://www.w3.org/2001/XMLSchema#double"])); - Bnd(a.u, Rve, OC(GC(ZI, 1), nie, 2, 6, [cwe, "EDouble", fue, "EDouble:Object"])); - Bnd(a.F, Rve, OC(GC(ZI, 1), nie, 2, 6, [cwe, "http://www.w3.org/2001/XMLSchema#float"])); - Bnd(a.G, Rve, OC(GC(ZI, 1), nie, 2, 6, [cwe, "EFloat", fue, "EFloat:Object"])); - Bnd(a.I, Rve, OC(GC(ZI, 1), nie, 2, 6, [cwe, "http://www.w3.org/2001/XMLSchema#int"])); - Bnd(a.J, Rve, OC(GC(ZI, 1), nie, 2, 6, [cwe, "EInt", fue, "EInt:Object"])); - Bnd(a.N, Rve, OC(GC(ZI, 1), nie, 2, 6, [cwe, "http://www.w3.org/2001/XMLSchema#long"])); - Bnd(a.O, Rve, OC(GC(ZI, 1), nie, 2, 6, [cwe, "ELong", fue, "ELong:Object"])); - Bnd(a.Z, Rve, OC(GC(ZI, 1), nie, 2, 6, [cwe, "http://www.w3.org/2001/XMLSchema#short"])); - Bnd(a.$, Rve, OC(GC(ZI, 1), nie, 2, 6, [cwe, "EShort", fue, "EShort:Object"])); - Bnd(a._, Rve, OC(GC(ZI, 1), nie, 2, 6, [cwe, "http://www.w3.org/2001/XMLSchema#string"])); - } - function fRc(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F, G; - if (a.c.length == 1) { - return tCb(0, a.c.length), BD(a.c[0], 135); - } else if (a.c.length <= 0) { - return new SRc(); - } - for (i3 = new olb(a); i3.a < i3.c.c.length; ) { - g = BD(mlb(i3), 135); - s = 0; - o2 = Ohe; - p = Ohe; - m = Rie; - n = Rie; - for (r = Jsb(g.b, 0); r.b != r.d.c; ) { - q = BD(Xsb(r), 86); - s += BD(vNb(q, (JTc(), ETc)), 19).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); - } - yNb(g, (JTc(), ETc), meb(s)); - yNb(g, (mTc(), WSc), new f7c(o2, p)); - yNb(g, VSc, new f7c(m, n)); - } - mmb(); - Okb(a, new jRc()); - v = new SRc(); - tNb(v, (tCb(0, a.c.length), BD(a.c[0], 94))); - l = 0; - D3 = 0; - for (j = new olb(a); j.a < j.c.c.length; ) { - g = BD(mlb(j), 135); - w2 = c7c(R6c(BD(vNb(g, (mTc(), VSc)), 8)), BD(vNb(g, WSc), 8)); - l = $wnd.Math.max(l, w2.a); - D3 += w2.a * w2.b; - } - l = $wnd.Math.max(l, $wnd.Math.sqrt(D3) * Edb(ED(vNb(v, (JTc(), uTc))))); - A = Edb(ED(vNb(v, HTc))); - F = 0; - G = 0; - k = 0; - b = A; - for (h = new olb(a); h.a < h.c.c.length; ) { - g = BD(mlb(h), 135); - w2 = c7c(R6c(BD(vNb(g, (mTc(), VSc)), 8)), BD(vNb(g, WSc), 8)); - if (F + w2.a > l) { - F = 0; - G += k + A; - k = 0; - } - eRc(v, g, F, G); - b = $wnd.Math.max(b, F + w2.a); - k = $wnd.Math.max(k, w2.b); - F += w2.a + A; - } - u2 = new Lqb(); - c2 = new Lqb(); - for (C = new olb(a); C.a < C.c.c.length; ) { - B = BD(mlb(C), 135); - d = Ccb(DD(vNb(B, (Y9c(), y8c)))); - t4 = !B.q ? kmb : B.q; - for (f2 = t4.vc().Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 42); - if (Mhb(u2, e.cd())) { - if (PD(BD(e.cd(), 146).wg()) !== PD(e.dd())) { - if (d && Mhb(c2, e.cd())) { - Zfb(); - "Found different values for property " + BD(e.cd(), 146).tg() + " in components."; - } else { - Rhb(u2, BD(e.cd(), 146), e.dd()); - yNb(v, BD(e.cd(), 146), e.dd()); - d && Rhb(c2, BD(e.cd(), 146), e.dd()); - } - } - } else { - Rhb(u2, BD(e.cd(), 146), e.dd()); - yNb(v, BD(e.cd(), 146), e.dd()); - } - } - } - return v; - } - function MYb() { - MYb = ccb; - xXb(); - LYb = new Hp(); - Rc(LYb, (Ucd(), Gcd), Fcd); - Rc(LYb, Qcd, Fcd); - Rc(LYb, Hcd, Fcd); - Rc(LYb, Ncd, Fcd); - Rc(LYb, Mcd, Fcd); - Rc(LYb, Kcd, Fcd); - Rc(LYb, Ncd, Gcd); - Rc(LYb, Fcd, Bcd); - Rc(LYb, Gcd, Bcd); - Rc(LYb, Qcd, Bcd); - Rc(LYb, Hcd, Bcd); - Rc(LYb, Lcd, Bcd); - Rc(LYb, Ncd, Bcd); - Rc(LYb, Mcd, Bcd); - Rc(LYb, Kcd, Bcd); - Rc(LYb, Ecd, Bcd); - Rc(LYb, Fcd, Ocd); - Rc(LYb, Gcd, Ocd); - Rc(LYb, Bcd, Ocd); - Rc(LYb, Qcd, Ocd); - Rc(LYb, Hcd, Ocd); - Rc(LYb, Lcd, Ocd); - Rc(LYb, Ncd, Ocd); - Rc(LYb, Ecd, Ocd); - Rc(LYb, Pcd, Ocd); - Rc(LYb, Mcd, Ocd); - Rc(LYb, Icd, Ocd); - Rc(LYb, Kcd, Ocd); - Rc(LYb, Gcd, Qcd); - Rc(LYb, Hcd, Qcd); - Rc(LYb, Ncd, Qcd); - Rc(LYb, Kcd, Qcd); - Rc(LYb, Gcd, Hcd); - Rc(LYb, Qcd, Hcd); - Rc(LYb, Ncd, Hcd); - Rc(LYb, Hcd, Hcd); - Rc(LYb, Mcd, Hcd); - Rc(LYb, Fcd, Ccd); - Rc(LYb, Gcd, Ccd); - Rc(LYb, Bcd, Ccd); - Rc(LYb, Ocd, Ccd); - Rc(LYb, Qcd, Ccd); - Rc(LYb, Hcd, Ccd); - Rc(LYb, Lcd, Ccd); - Rc(LYb, Ncd, Ccd); - Rc(LYb, Pcd, Ccd); - Rc(LYb, Ecd, Ccd); - Rc(LYb, Kcd, Ccd); - Rc(LYb, Mcd, Ccd); - Rc(LYb, Jcd, Ccd); - Rc(LYb, Fcd, Pcd); - Rc(LYb, Gcd, Pcd); - Rc(LYb, Bcd, Pcd); - Rc(LYb, Qcd, Pcd); - Rc(LYb, Hcd, Pcd); - Rc(LYb, Lcd, Pcd); - Rc(LYb, Ncd, Pcd); - Rc(LYb, Ecd, Pcd); - Rc(LYb, Kcd, Pcd); - Rc(LYb, Icd, Pcd); - Rc(LYb, Jcd, Pcd); - Rc(LYb, Gcd, Ecd); - Rc(LYb, Qcd, Ecd); - Rc(LYb, Hcd, Ecd); - Rc(LYb, Ncd, Ecd); - Rc(LYb, Pcd, Ecd); - Rc(LYb, Kcd, Ecd); - Rc(LYb, Mcd, Ecd); - Rc(LYb, Fcd, Dcd); - Rc(LYb, Gcd, Dcd); - Rc(LYb, Bcd, Dcd); - Rc(LYb, Qcd, Dcd); - Rc(LYb, Hcd, Dcd); - Rc(LYb, Lcd, Dcd); - Rc(LYb, Ncd, Dcd); - Rc(LYb, Ecd, Dcd); - Rc(LYb, Kcd, Dcd); - Rc(LYb, Gcd, Mcd); - Rc(LYb, Bcd, Mcd); - Rc(LYb, Ocd, Mcd); - Rc(LYb, Hcd, Mcd); - Rc(LYb, Fcd, Icd); - Rc(LYb, Gcd, Icd); - Rc(LYb, Ocd, Icd); - Rc(LYb, Qcd, Icd); - Rc(LYb, Hcd, Icd); - Rc(LYb, Lcd, Icd); - Rc(LYb, Ncd, Icd); - Rc(LYb, Ncd, Jcd); - Rc(LYb, Hcd, Jcd); - Rc(LYb, Ecd, Fcd); - Rc(LYb, Ecd, Qcd); - Rc(LYb, Ecd, Bcd); - Rc(LYb, Lcd, Fcd); - Rc(LYb, Lcd, Gcd); - Rc(LYb, Lcd, Ocd); - } - function HVd(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 U5d(a.b, a.a, b, a.c); - case 1: - return new BMd(a.a, b, bLd(b.Tg(), a.c)); - case 43: - return new N4d(a.a, b, bLd(b.Tg(), a.c)); - case 3: - return new xMd(a.a, b, bLd(b.Tg(), a.c)); - case 45: - return new K4d(a.a, b, bLd(b.Tg(), a.c)); - case 41: - return new dId(BD(wId(a.c), 26), a.a, b, bLd(b.Tg(), a.c)); - case 50: - return new c6d(BD(wId(a.c), 26), a.a, b, bLd(b.Tg(), a.c)); - case 5: - return new Q4d(a.a, b, bLd(b.Tg(), a.c), a.d.n); - case 47: - return new U4d(a.a, b, bLd(b.Tg(), a.c), a.d.n); - case 7: - return new cUd(a.a, b, bLd(b.Tg(), a.c), a.d.n); - case 49: - return new gUd(a.a, b, bLd(b.Tg(), a.c), a.d.n); - case 9: - return new I4d(a.a, b, bLd(b.Tg(), a.c)); - case 11: - return new G4d(a.a, b, bLd(b.Tg(), a.c)); - case 13: - return new C4d(a.a, b, bLd(b.Tg(), a.c)); - case 15: - return new k2d(a.a, b, bLd(b.Tg(), a.c)); - case 17: - return new c5d(a.a, b, bLd(b.Tg(), a.c)); - case 19: - return new _4d(a.a, b, bLd(b.Tg(), a.c)); - case 21: - return new X4d(a.a, b, bLd(b.Tg(), a.c)); - case 23: - return new pMd(a.a, b, bLd(b.Tg(), a.c)); - case 25: - return new D5d(a.a, b, bLd(b.Tg(), a.c), a.d.n); - case 27: - return new y5d(a.a, b, bLd(b.Tg(), a.c), a.d.n); - case 29: - return new t5d(a.a, b, bLd(b.Tg(), a.c), a.d.n); - case 31: - return new n5d(a.a, b, bLd(b.Tg(), a.c), a.d.n); - case 33: - return new A5d(a.a, b, bLd(b.Tg(), a.c), a.d.n); - case 35: - return new v5d(a.a, b, bLd(b.Tg(), a.c), a.d.n); - case 37: - return new p5d(a.a, b, bLd(b.Tg(), a.c), a.d.n); - case 39: - return new i5d(a.a, b, bLd(b.Tg(), a.c), a.d.n); - case 40: - return new u3d(b, bLd(b.Tg(), a.c)); - default: - throw vbb(new hz("Unknown feature style: " + a.e)); - } - } - function BMc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2; - Odd(c2, "Brandes & Koepf node placement", 1); - a.a = b; - a.c = KMc(b); - d = BD(vNb(b, (Nyc(), zxc)), 274); - n = Ccb(DD(vNb(b, Axc))); - a.d = d == (lrc(), irc) && !n || d == frc; - AMc(a, b); - v = null; - w2 = null; - r = null; - s = null; - q = (Xj(4, Jie), new Skb(4)); - switch (BD(vNb(b, zxc), 274).g) { - case 3: - r = new ULc(b, a.c.d, (eMc(), cMc), (YLc(), WLc)); - q.c[q.c.length] = r; - break; - case 1: - s = new ULc(b, a.c.d, (eMc(), dMc), (YLc(), WLc)); - q.c[q.c.length] = s; - break; - case 4: - v = new ULc(b, a.c.d, (eMc(), cMc), (YLc(), XLc)); - q.c[q.c.length] = v; - break; - case 2: - w2 = new ULc(b, a.c.d, (eMc(), dMc), (YLc(), XLc)); - q.c[q.c.length] = w2; - break; - default: - r = new ULc(b, a.c.d, (eMc(), cMc), (YLc(), WLc)); - s = new ULc(b, a.c.d, dMc, WLc); - v = new ULc(b, a.c.d, cMc, XLc); - w2 = new ULc(b, a.c.d, dMc, XLc); - q.c[q.c.length] = v; - q.c[q.c.length] = w2; - q.c[q.c.length] = r; - q.c[q.c.length] = s; - } - e = new mMc(b, a.c); - for (h = new olb(q); h.a < h.c.c.length; ) { - f2 = BD(mlb(h), 180); - lMc(e, f2, a.b); - kMc(f2); - } - m = new rMc(b, a.c); - for (i3 = new olb(q); i3.a < i3.c.c.length; ) { - f2 = BD(mlb(i3), 180); - oMc(m, f2); - } - if (c2.n) { - for (j = new olb(q); j.a < j.c.c.length; ) { - f2 = BD(mlb(j), 180); - Sdd(c2, f2 + " size is " + SLc(f2)); - } - } - l = null; - if (a.d) { - k = yMc(a, q, a.c.d); - xMc(b, k, c2) && (l = k); - } - if (!l) { - for (j = new olb(q); j.a < j.c.c.length; ) { - f2 = BD(mlb(j), 180); - xMc(b, f2, c2) && (!l || SLc(l) > SLc(f2)) && (l = f2); - } - } - !l && (l = (tCb(0, q.c.length), BD(q.c[0], 180))); - for (p = new olb(b.b); p.a < p.c.c.length; ) { - o2 = BD(mlb(p), 29); - for (u2 = new olb(o2.a); u2.a < u2.c.c.length; ) { - t4 = BD(mlb(u2), 10); - t4.n.b = Edb(l.p[t4.p]) + Edb(l.d[t4.p]); - } - } - if (c2.n) { - Sdd(c2, "Chosen node placement: " + l); - Sdd(c2, "Blocks: " + DMc(l)); - Sdd(c2, "Classes: " + EMc(l, c2)); - Sdd(c2, "Marked edges: " + a.b); - } - for (g = new olb(q); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 180); - f2.g = null; - f2.b = null; - f2.a = null; - f2.d = null; - f2.j = null; - f2.i = null; - f2.p = null; - } - IMc(a.c); - a.b.a.$b(); - Qdd(c2); - } - function V1b(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F; - g = new Psb(); - v = BD(vNb(c2, (Nyc(), Lwc)), 103); - o2 = 0; - ye(g, (!b.a && (b.a = new cUd(E2, b, 10, 11)), b.a)); - while (g.b != 0) { - j = BD(g.b == 0 ? null : (sCb(g.b != 0), Nsb(g, g.a.a)), 33); - (PD(hkd(b, ywc)) !== PD((tAc(), rAc)) || PD(hkd(b, Jwc)) === PD((mqc(), lqc)) || PD(hkd(b, Jwc)) === PD((mqc(), jqc)) || Ccb(DD(hkd(b, Awc))) || PD(hkd(b, twc)) !== PD((RXb(), QXb))) && !Ccb(DD(hkd(j, xwc))) && jkd(j, (wtc(), Zsc), meb(o2++)); - q = !Ccb(DD(hkd(j, Jxc))); - if (q) { - l = (!j.a && (j.a = new cUd(E2, j, 10, 11)), j.a).i != 0; - n = S1b(j); - m = PD(hkd(j, axc)) === PD((hbd(), ebd)); - F = !ikd(j, (Y9c(), o8c)) || dfb(GD(hkd(j, o8c)), sne); - t4 = null; - if (F && m && (l || n)) { - t4 = P1b(j); - yNb(t4, Lwc, v); - wNb(t4, hyc) && Wyc(new ezc(Edb(ED(vNb(t4, hyc)))), t4); - if (BD(hkd(j, Fxc), 174).gc() != 0) { - k = t4; - MAb(new YAb(null, (!j.c && (j.c = new cUd(F2, j, 9, 9)), new Kub(j.c, 16))), new k2b(k)); - L1b(j, t4); - } - } - w2 = c2; - A = BD(Ohb(a.a, Xod(j)), 10); - !!A && (w2 = A.e); - s = $1b(a, j, w2); - if (t4) { - s.e = t4; - t4.e = s; - ye(g, (!j.a && (j.a = new cUd(E2, j, 10, 11)), j.a)); - } - } - } - o2 = 0; - Gsb(g, b, g.c.b, g.c); - while (g.b != 0) { - f2 = BD(g.b == 0 ? null : (sCb(g.b != 0), Nsb(g, g.a.a)), 33); - for (i3 = new Fyd((!f2.b && (f2.b = new cUd(B2, f2, 12, 3)), f2.b)); i3.e != i3.i.gc(); ) { - h = BD(Dyd(i3), 79); - N1b(h); - (PD(hkd(b, ywc)) !== PD((tAc(), rAc)) || PD(hkd(b, Jwc)) === PD((mqc(), lqc)) || PD(hkd(b, Jwc)) === PD((mqc(), jqc)) || Ccb(DD(hkd(b, Awc))) || PD(hkd(b, twc)) !== PD((RXb(), QXb))) && jkd(h, (wtc(), Zsc), meb(o2++)); - C = atd(BD(qud((!h.b && (h.b = new y5d(z2, h, 4, 7)), h.b), 0), 82)); - D3 = atd(BD(qud((!h.c && (h.c = new y5d(z2, h, 5, 8)), h.c), 0), 82)); - if (Ccb(DD(hkd(h, Jxc))) || Ccb(DD(hkd(C, Jxc))) || Ccb(DD(hkd(D3, Jxc)))) { - continue; - } - p = Qld(h) && Ccb(DD(hkd(C, fxc))) && Ccb(DD(hkd(h, gxc))); - u2 = f2; - p || ntd(D3, C) ? u2 = C : ntd(C, D3) && (u2 = D3); - w2 = c2; - A = BD(Ohb(a.a, u2), 10); - !!A && (w2 = A.e); - r = X1b(a, h, u2, w2); - yNb(r, (wtc(), xsc), R1b(a, h, b, c2)); - } - m = PD(hkd(f2, axc)) === PD((hbd(), ebd)); - if (m) { - for (e = new Fyd((!f2.a && (f2.a = new cUd(E2, f2, 10, 11)), f2.a)); e.e != e.i.gc(); ) { - d = BD(Dyd(e), 33); - F = !ikd(d, (Y9c(), o8c)) || dfb(GD(hkd(d, o8c)), sne); - B = PD(hkd(d, axc)) === PD(ebd); - F && B && (Gsb(g, d, g.c.b, g.c), true); - } - } + } + } else { + if (ua_t === 0 || ub_t === 0) { + if (midOfThree(x1, x22, x42) === x42) { + return [x42, y42]; + } + if (midOfThree(x1, x22, x32) === x32) { + return [x32, y32]; + } + if (midOfThree(x32, x42, x22) === x22) { + return [x22, y22]; + } + 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; + } + } + 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; + } + 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; + } + 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; } } - function vA(a, b, c2, d, e, f2) { - var g, h, i3, j, k, l, m, n, o2, p, q, r; - switch (b) { - case 71: - h = d.q.getFullYear() - nje >= -1900 ? 1 : 0; - c2 >= 4 ? Qfb(a, OC(GC(ZI, 1), nie, 2, 6, [pje, qje])[h]) : Qfb(a, OC(GC(ZI, 1), nie, 2, 6, ["BC", "AD"])[h]); - break; - case 121: - kA(a, c2, d); - break; - case 77: - jA(a, c2, d); - break; - case 107: - i3 = e.q.getHours(); - i3 == 0 ? EA(a, 24, c2) : EA(a, i3, c2); - break; - case 83: - iA(a, c2, e); - break; - case 69: - k = d.q.getDay(); - c2 == 5 ? Qfb(a, OC(GC(ZI, 1), nie, 2, 6, ["S", "M", "T", "W", "T", "F", "S"])[k]) : c2 == 4 ? Qfb(a, OC(GC(ZI, 1), nie, 2, 6, [rje, sje, tje, uje, vje, wje, xje])[k]) : Qfb(a, OC(GC(ZI, 1), nie, 2, 6, ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"])[k]); - break; - case 97: - e.q.getHours() >= 12 && e.q.getHours() < 24 ? Qfb(a, OC(GC(ZI, 1), nie, 2, 6, ["AM", "PM"])[1]) : Qfb(a, OC(GC(ZI, 1), nie, 2, 6, ["AM", "PM"])[0]); - break; - case 104: - l = e.q.getHours() % 12; - l == 0 ? EA(a, 12, c2) : EA(a, l, c2); - break; - case 75: - m = e.q.getHours() % 12; - EA(a, m, c2); - break; - case 72: - n = e.q.getHours(); - EA(a, n, c2); - break; - case 99: - o2 = d.q.getDay(); - c2 == 5 ? Qfb(a, OC(GC(ZI, 1), nie, 2, 6, ["S", "M", "T", "W", "T", "F", "S"])[o2]) : c2 == 4 ? Qfb(a, OC(GC(ZI, 1), nie, 2, 6, [rje, sje, tje, uje, vje, wje, xje])[o2]) : c2 == 3 ? Qfb(a, OC(GC(ZI, 1), nie, 2, 6, ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"])[o2]) : EA(a, o2, 1); - break; - case 76: - p = d.q.getMonth(); - c2 == 5 ? Qfb(a, OC(GC(ZI, 1), nie, 2, 6, ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"])[p]) : c2 == 4 ? Qfb(a, OC(GC(ZI, 1), nie, 2, 6, [bje, cje, dje, eje, fje, gje, hje, ije, jje, kje, lje, mje])[p]) : c2 == 3 ? Qfb(a, OC(GC(ZI, 1), nie, 2, 6, ["Jan", "Feb", "Mar", "Apr", fje, "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"])[p]) : EA(a, p + 1, c2); - break; - case 81: - q = d.q.getMonth() / 3 | 0; - c2 < 4 ? Qfb(a, OC(GC(ZI, 1), nie, 2, 6, ["Q1", "Q2", "Q3", "Q4"])[q]) : Qfb(a, OC(GC(ZI, 1), nie, 2, 6, ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"])[q]); - break; - case 100: - r = d.q.getDate(); - EA(a, r, c2); - break; - case 109: - j = e.q.getMinutes(); - EA(a, j, c2); - break; - case 115: - g = e.q.getSeconds(); - EA(a, g, c2); - break; - case 122: - c2 < 4 ? Qfb(a, f2.c[0]) : Qfb(a, f2.c[1]); - break; - case 118: - Qfb(a, f2.b); - break; - case 90: - c2 < 3 ? Qfb(a, OA(f2)) : c2 == 3 ? Qfb(a, NA(f2)) : Qfb(a, QA(f2.a)); - break; - default: - return false; + } + 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; + } + 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]; } - return true; } - function X1b(a, b, c2, d) { - var e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F, G, H2; - N1b(b); - i3 = BD(qud((!b.b && (b.b = new y5d(z2, b, 4, 7)), b.b), 0), 82); - k = BD(qud((!b.c && (b.c = new y5d(z2, b, 5, 8)), b.c), 0), 82); - h = atd(i3); - j = atd(k); - g = (!b.a && (b.a = new cUd(A2, b, 6, 6)), b.a).i == 0 ? null : BD(qud((!b.a && (b.a = new cUd(A2, b, 6, 6)), b.a), 0), 202); - A = BD(Ohb(a.a, h), 10); - F = BD(Ohb(a.a, j), 10); - B = null; - G = null; - if (JD(i3, 186)) { - w2 = BD(Ohb(a.a, i3), 299); - if (JD(w2, 11)) { - B = BD(w2, 11); - } else if (JD(w2, 10)) { - A = BD(w2, 10); - B = BD(Ikb(A.j, 0), 11); - } - } - if (JD(k, 186)) { - D3 = BD(Ohb(a.a, k), 299); - if (JD(D3, 11)) { - G = BD(D3, 11); - } else if (JD(D3, 10)) { - F = BD(D3, 10); - G = BD(Ikb(F.j, 0), 11); - } - } - if (!A || !F) { - throw vbb(new z2c("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 UZb(); - tNb(p, b); - yNb(p, (wtc(), $sc), b); - yNb(p, (Nyc(), jxc), null); - n = BD(vNb(d, Ksc), 21); - A == F && n.Fc((Orc(), Nrc)); - if (!B) { - v = (KAc(), IAc); - C = null; - if (!!g && fcd(BD(vNb(A, Vxc), 98))) { - C = new f7c(g.j, g.k); - Bfd(C, Mld(b)); - Cfd(C, c2); - if (ntd(j, h)) { - v = HAc; - P6c(C, A.n); - } - } - B = $$b(A, C, v, d); - } - if (!G) { - v = (KAc(), HAc); - H2 = null; - if (!!g && fcd(BD(vNb(F, Vxc), 98))) { - H2 = new f7c(g.b, g.c); - Bfd(H2, Mld(b)); - Cfd(H2, c2); - } - G = $$b(F, H2, v, Q_b(F)); - } - QZb(p, B); - RZb(p, G); - (B.e.c.length > 1 || B.g.c.length > 1 || G.e.c.length > 1 || G.g.c.length > 1) && n.Fc((Orc(), Irc)); - for (m = new Fyd((!b.n && (b.n = new cUd(D2, b, 1, 7)), b.n)); m.e != m.i.gc(); ) { - l = BD(Dyd(m), 137); - if (!Ccb(DD(hkd(l, Jxc))) && !!l.a) { - q = Z1b(l); - Ekb(p.b, q); - switch (BD(vNb(q, Qwc), 272).g) { - case 1: - case 2: - n.Fc((Orc(), Grc)); - break; - case 0: - n.Fc((Orc(), Erc)); - yNb(q, Qwc, (qad(), nad)); - } - } + 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; + } + if (diff2 < precision) { + break; + } + } + 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; } - f2 = BD(vNb(d, Iwc), 314); - r = BD(vNb(d, Exc), 315); - e = f2 == (Rpc(), Opc) || r == (Vzc(), Rzc); - if (!!g && (!g.a && (g.a = new xMd(y2, g, 5)), g.a).i != 0 && e) { - s = ofd(g); - o2 = new s7c(); - for (u2 = Jsb(s, 0); u2.b != u2.d.c; ) { - t4 = BD(Xsb(u2), 8); - Dsb(o2, new g7c(t4)); + degrees3[node2.id()] = currDegree.degree; + } + return { + degree: /* @__PURE__ */ __name(function degree(node3) { + if (maxDegree === 0) { + return 0; } - yNb(p, _sc, o2); - } - return p; + if (string(node3)) { + node3 = cy.filter(node3); + } + 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 id27 = _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[id27] = _currDegree.indegree; + outdegrees[id27] = _currDegree.outdegree; } - function yZd(a) { - if (a.gb) - return; - a.gb = true; - a.b = Lnd(a, 0); - Knd(a.b, 18); - Qnd(a.b, 19); - a.a = Lnd(a, 1); - Knd(a.a, 1); - Qnd(a.a, 2); - Qnd(a.a, 3); - Qnd(a.a, 4); - Qnd(a.a, 5); - a.o = Lnd(a, 2); - Knd(a.o, 8); - Knd(a.o, 9); - Qnd(a.o, 10); - Qnd(a.o, 11); - Qnd(a.o, 12); - Qnd(a.o, 13); - Qnd(a.o, 14); - Qnd(a.o, 15); - Qnd(a.o, 16); - Qnd(a.o, 17); - Qnd(a.o, 18); - Qnd(a.o, 19); - Qnd(a.o, 20); - Qnd(a.o, 21); - Qnd(a.o, 22); - Qnd(a.o, 23); - Pnd(a.o); - Pnd(a.o); - Pnd(a.o); - Pnd(a.o); - Pnd(a.o); - Pnd(a.o); - Pnd(a.o); - Pnd(a.o); - Pnd(a.o); - Pnd(a.o); - a.p = Lnd(a, 3); - Knd(a.p, 2); - Knd(a.p, 3); - Knd(a.p, 4); - Knd(a.p, 5); - Qnd(a.p, 6); - Qnd(a.p, 7); - Pnd(a.p); - Pnd(a.p); - a.q = Lnd(a, 4); - Knd(a.q, 8); - a.v = Lnd(a, 5); - Qnd(a.v, 9); - Pnd(a.v); - Pnd(a.v); - Pnd(a.v); - a.w = Lnd(a, 6); - Knd(a.w, 2); - Knd(a.w, 3); - Knd(a.w, 4); - Qnd(a.w, 5); - a.B = Lnd(a, 7); - Qnd(a.B, 1); - Pnd(a.B); - Pnd(a.B); - Pnd(a.B); - a.Q = Lnd(a, 8); - Qnd(a.Q, 0); - Pnd(a.Q); - a.R = Lnd(a, 9); - Knd(a.R, 1); - a.S = Lnd(a, 10); - Pnd(a.S); - Pnd(a.S); - Pnd(a.S); - Pnd(a.S); - Pnd(a.S); - Pnd(a.S); - Pnd(a.S); - Pnd(a.S); - Pnd(a.S); - Pnd(a.S); - Pnd(a.S); - Pnd(a.S); - Pnd(a.S); - Pnd(a.S); - Pnd(a.S); - a.T = Lnd(a, 11); - Qnd(a.T, 10); - Qnd(a.T, 11); - Qnd(a.T, 12); - Qnd(a.T, 13); - Qnd(a.T, 14); - Pnd(a.T); - Pnd(a.T); - a.U = Lnd(a, 12); - Knd(a.U, 2); - Knd(a.U, 3); - Qnd(a.U, 4); - Qnd(a.U, 5); - Qnd(a.U, 6); - Qnd(a.U, 7); - Pnd(a.U); - a.V = Lnd(a, 13); - Qnd(a.V, 10); - a.W = Lnd(a, 14); - Knd(a.W, 18); - Knd(a.W, 19); - Knd(a.W, 20); - Qnd(a.W, 21); - Qnd(a.W, 22); - Qnd(a.W, 23); - a.bb = Lnd(a, 15); - Knd(a.bb, 10); - Knd(a.bb, 11); - Knd(a.bb, 12); - Knd(a.bb, 13); - Knd(a.bb, 14); - Knd(a.bb, 15); - Knd(a.bb, 16); - Qnd(a.bb, 17); - Pnd(a.bb); - Pnd(a.bb); - a.eb = Lnd(a, 16); - Knd(a.eb, 2); - Knd(a.eb, 3); - Knd(a.eb, 4); - Knd(a.eb, 5); - Knd(a.eb, 6); - Knd(a.eb, 7); - Qnd(a.eb, 8); - Qnd(a.eb, 9); - a.ab = Lnd(a, 17); - Knd(a.ab, 0); - Knd(a.ab, 1); - a.H = Lnd(a, 18); - Qnd(a.H, 0); - Qnd(a.H, 1); - Qnd(a.H, 2); - Qnd(a.H, 3); - Qnd(a.H, 4); - Qnd(a.H, 5); - Pnd(a.H); - a.db = Lnd(a, 19); - Qnd(a.db, 2); - a.c = Mnd(a, 20); - a.d = Mnd(a, 21); - a.e = Mnd(a, 22); - a.f = Mnd(a, 23); - a.i = Mnd(a, 24); - a.g = Mnd(a, 25); - a.j = Mnd(a, 26); - a.k = Mnd(a, 27); - a.n = Mnd(a, 28); - a.r = Mnd(a, 29); - a.s = Mnd(a, 30); - a.t = Mnd(a, 31); - a.u = Mnd(a, 32); - a.fb = Mnd(a, 33); - a.A = Mnd(a, 34); - a.C = Mnd(a, 35); - a.D = Mnd(a, 36); - a.F = Mnd(a, 37); - a.G = Mnd(a, 38); - a.I = Mnd(a, 39); - a.J = Mnd(a, 40); - a.L = Mnd(a, 41); - a.M = Mnd(a, 42); - a.N = Mnd(a, 43); - a.O = Mnd(a, 44); - a.P = Mnd(a, 45); - a.X = Mnd(a, 46); - a.Y = Mnd(a, 47); - a.Z = Mnd(a, 48); - a.$ = Mnd(a, 49); - a._ = Mnd(a, 50); - a.cb = Mnd(a, 51); - a.K = Mnd(a, 52); - } - function Y9c() { - Y9c = ccb; - var a, b; - o8c = new Lsd(sse); - F9c = new Lsd(tse); - q8c = (F7c(), z7c); - p8c = new Nsd($pe, q8c); - r8c = new Nsd(_le, null); - s8c = new Lsd(use); - x8c = (i8c(), qqb(h8c, OC(GC(r1, 1), Kie, 291, 0, [d8c]))); - w8c = new Nsd(lqe, x8c); - y8c = new Nsd(Zpe, (Bcb(), false)); - A8c = (ead(), cad); - z8c = new Nsd(cqe, A8c); - F8c = (Aad(), zad); - E8c = new Nsd(ype, F8c); - I8c = new Nsd(Jre, false); - K8c = (hbd(), fbd); - J8c = new Nsd(tpe, K8c); - g9c = new q0b(12); - f9c = new Nsd(ame, g9c); - O8c = new Nsd(Ame, false); - P8c = new Nsd(xqe, false); - e9c = new Nsd(Dme, false); - u9c = (dcd(), ccd); - t9c = new Nsd(Bme, u9c); - C9c = new Lsd(uqe); - D9c = new Lsd(vme); - E9c = new Lsd(yme); - H9c = new Lsd(zme); - R8c = new s7c(); - Q8c = new Nsd(mqe, R8c); - v8c = new Nsd(pqe, false); - L8c = new Nsd(qqe, false); - T8c = new H_b(); - S8c = new Nsd(vqe, T8c); - d9c = new Nsd(Xpe, false); - G9c = new Nsd(wse, 1); - new Nsd(xse, true); - meb(0); - new Nsd(yse, meb(100)); - new Nsd(zse, false); - meb(0); - new Nsd(Ase, meb(4e3)); - meb(0); - new Nsd(Bse, meb(400)); - new Nsd(Cse, false); - new Nsd(Dse, false); - new Nsd(Ese, true); - new Nsd(Fse, false); - u8c = (Ded(), Ced); - t8c = new Nsd(rse, u8c); - I9c = new Nsd(Lpe, 10); - J9c = new Nsd(Mpe, 10); - K9c = new Nsd(Zle, 20); - L9c = new Nsd(Npe, 10); - M9c = new Nsd(xme, 2); - N9c = new Nsd(Ope, 10); - P9c = new Nsd(Ppe, 0); - Q9c = new Nsd(Spe, 5); - R9c = new Nsd(Qpe, 1); - S9c = new Nsd(Rpe, 1); - T9c = new Nsd(wme, 20); - U9c = new Nsd(Tpe, 10); - X9c = new Nsd(Upe, 10); - O9c = new Lsd(Vpe); - W9c = new I_b(); - V9c = new Nsd(wqe, W9c); - j9c = new Lsd(tqe); - i9c = false; - h9c = new Nsd(sqe, i9c); - V8c = new q0b(5); - U8c = new Nsd(dqe, V8c); - X8c = (Hbd(), b = BD(gdb(B1), 9), new xqb(b, BD(_Bb(b, b.length), 9), 0)); - W8c = new Nsd(Gme, X8c); - m9c = (Tbd(), Qbd); - l9c = new Nsd(gqe, m9c); - o9c = new Lsd(hqe); - p9c = new Lsd(iqe); - q9c = new Lsd(jqe); - n9c = new Lsd(kqe); - Z8c = (a = BD(gdb(I1), 9), new xqb(a, BD(_Bb(a, a.length), 9), 0)); - Y8c = new Nsd(Fme, Z8c); - c9c = pqb((Idd(), Bdd)); - b9c = new Nsd(Eme, c9c); - a9c = new f7c(0, 0); - _8c = new Nsd(Tme, a9c); - $8c = new Nsd(bqe, false); - D8c = (qad(), nad); - C8c = new Nsd(nqe, D8c); - B8c = new Nsd(Cme, false); - meb(1); - new Nsd(Hse, null); - r9c = new Lsd(rqe); - v9c = new Lsd(oqe); - B9c = (Ucd(), Scd); - A9c = new Nsd(Ype, B9c); - s9c = new Lsd(Wpe); - y9c = (rcd(), pqb(pcd)); - x9c = new Nsd(Hme, y9c); - w9c = new Nsd(eqe, false); - z9c = new Nsd(fqe, true); - M8c = new Nsd(_pe, false); - N8c = new Nsd(aqe, false); - G8c = new Nsd($le, 1); - H8c = (Mad(), Kad); - new Nsd(Ise, H8c); - k9c = true; - } - function wtc() { - wtc = ccb; - var a, b; - $sc = new Lsd(Ime); - xsc = new Lsd("coordinateOrigin"); - itc = new Lsd("processors"); - wsc = new Msd("compoundNode", (Bcb(), false)); - Nsc = new Msd("insideConnections", false); - _sc = new Lsd("originalBendpoints"); - atc = new Lsd("originalDummyNodePosition"); - btc = new Lsd("originalLabelEdge"); - ktc = new Lsd("representedLabels"); - Csc = new Lsd("endLabels"); - Dsc = new Lsd("endLabel.origin"); - Ssc = new Msd("labelSide", (rbd(), qbd)); - Ysc = new Msd("maxEdgeThickness", 0); - ltc = new Msd("reversed", false); - jtc = new Lsd(Jme); - Vsc = new Msd("longEdgeSource", null); - Wsc = new Msd("longEdgeTarget", null); - Usc = new Msd("longEdgeHasLabelDummies", false); - Tsc = new Msd("longEdgeBeforeLabelDummy", false); - Bsc = new Msd("edgeConstraint", (Gqc(), Eqc)); - Psc = new Lsd("inLayerLayoutUnit"); - Osc = new Msd("inLayerConstraint", (esc(), csc)); - Qsc = new Msd("inLayerSuccessorConstraint", new Rkb()); - Rsc = new Msd("inLayerSuccessorConstraintBetweenNonDummies", false); - gtc = new Lsd("portDummy"); - ysc = new Msd("crossingHint", meb(0)); - Ksc = new Msd("graphProperties", (b = BD(gdb(PW), 9), new xqb(b, BD(_Bb(b, b.length), 9), 0))); - Hsc = new Msd("externalPortSide", (Ucd(), Scd)); - Isc = new Msd("externalPortSize", new d7c()); - Fsc = new Lsd("externalPortReplacedDummies"); - Gsc = new Lsd("externalPortReplacedDummy"); - Esc = new Msd("externalPortConnections", (a = BD(gdb(F1), 9), new xqb(a, BD(_Bb(a, a.length), 9), 0))); - htc = new Msd(tle, 0); - ssc = new Lsd("barycenterAssociates"); - vtc = new Lsd("TopSideComments"); - tsc = new Lsd("BottomSideComments"); - vsc = new Lsd("CommentConnectionPort"); - Msc = new Msd("inputCollect", false); - etc = new Msd("outputCollect", false); - Asc = new Msd("cyclic", false); - zsc = new Lsd("crossHierarchyMap"); - utc = new Lsd("targetOffset"); - new Msd("splineLabelSize", new d7c()); - otc = new Lsd("spacings"); - ftc = new Msd("partitionConstraint", false); - usc = new Lsd("breakingPoint.info"); - stc = new Lsd("splines.survivingEdge"); - rtc = new Lsd("splines.route.start"); - ptc = new Lsd("splines.edgeChain"); - dtc = new Lsd("originalPortConstraints"); - ntc = new Lsd("selfLoopHolder"); - qtc = new Lsd("splines.nsPortY"); - Zsc = new Lsd("modelOrder"); - Xsc = new Lsd("longEdgeTargetNode"); - Jsc = new Msd(Xne, false); - mtc = new Msd(Xne, false); - Lsc = new Lsd("layerConstraints.hiddenNodes"); - ctc = new Lsd("layerConstraints.opposidePort"); - ttc = new Lsd("targetNode.modelOrder"); - } - function jwc() { - jwc = ccb; - puc = (xqc(), vqc); - ouc = new Nsd(Yne, puc); - Guc = new Nsd(Zne, (Bcb(), false)); - Muc = (msc(), ksc); - Luc = new Nsd($ne, Muc); - cvc = new Nsd(_ne, false); - dvc = new Nsd(aoe, true); - Itc = new Nsd(boe, false); - xvc = (BAc(), zAc); - wvc = new Nsd(coe, xvc); - meb(1); - Fvc = new Nsd(doe, meb(7)); - Gvc = new Nsd(eoe, false); - Huc = new Nsd(foe, false); - nuc = (mqc(), iqc); - muc = new Nsd(goe, nuc); - bvc = (lzc(), jzc); - avc = new Nsd(hoe, bvc); - Tuc = (Ctc(), Btc); - Suc = new Nsd(ioe, Tuc); - meb(-1); - Ruc = new Nsd(joe, meb(-1)); - meb(-1); - Uuc = new Nsd(koe, meb(-1)); - meb(-1); - Vuc = new Nsd(loe, meb(4)); - meb(-1); - Xuc = new Nsd(moe, meb(2)); - _uc = (kAc(), iAc); - $uc = new Nsd(noe, _uc); - meb(0); - Zuc = new Nsd(ooe, meb(0)); - Puc = new Nsd(poe, meb(Ohe)); - luc = (Rpc(), Ppc); - kuc = new Nsd(qoe, luc); - Xtc = new Nsd(roe, false); - euc = new Nsd(soe, 0.1); - iuc = new Nsd(toe, false); - meb(-1); - guc = new Nsd(uoe, meb(-1)); - meb(-1); - huc = new Nsd(voe, meb(-1)); - meb(0); - Ytc = new Nsd(woe, meb(40)); - cuc = (Xrc(), Wrc); - buc = new Nsd(xoe, cuc); - $tc = Urc; - Ztc = new Nsd(yoe, $tc); - vvc = (Vzc(), Qzc); - uvc = new Nsd(zoe, vvc); - kvc = new Lsd(Aoe); - fvc = (_qc(), Zqc); - evc = new Nsd(Boe, fvc); - ivc = (lrc(), irc); - hvc = new Nsd(Coe, ivc); - nvc = new Nsd(Doe, 0.3); - pvc = new Lsd(Eoe); - rvc = (Izc(), Gzc); - qvc = new Nsd(Foe, rvc); - xuc = (TAc(), RAc); - wuc = new Nsd(Goe, xuc); - zuc = (_Ac(), $Ac); - yuc = new Nsd(Hoe, zuc); - Buc = (tBc(), sBc); - Auc = new Nsd(Ioe, Buc); - Duc = new Nsd(Joe, 0.2); - uuc = new Nsd(Koe, 2); - Bvc = new Nsd(Loe, null); - Dvc = new Nsd(Moe, 10); - Cvc = new Nsd(Noe, 10); - Evc = new Nsd(Ooe, 20); - meb(0); - yvc = new Nsd(Poe, meb(0)); - meb(0); - zvc = new Nsd(Qoe, meb(0)); - meb(0); - Avc = new Nsd(Roe, meb(0)); - Jtc = new Nsd(Soe, false); - Ntc = (yrc(), wrc); - Mtc = new Nsd(Toe, Ntc); - Ltc = (Ipc(), Hpc); - Ktc = new Nsd(Uoe, Ltc); - Juc = new Nsd(Voe, false); - meb(0); - Iuc = new Nsd(Woe, meb(16)); - meb(0); - Kuc = new Nsd(Xoe, meb(5)); - bwc = (LBc(), JBc); - awc = new Nsd(Yoe, bwc); - Hvc = new Nsd(Zoe, 10); - Kvc = new Nsd($oe, 1); - Tvc = (bqc(), aqc); - Svc = new Nsd(_oe, Tvc); - Nvc = new Lsd(ape); - Qvc = meb(1); - meb(0); - Pvc = new Nsd(bpe, Qvc); - gwc = (CBc(), zBc); - fwc = new Nsd(cpe, gwc); - cwc = new Lsd(dpe); - Yvc = new Nsd(epe, true); - Wvc = new Nsd(fpe, 2); - $vc = new Nsd(gpe, true); - tuc = (Sqc(), Qqc); - suc = new Nsd(hpe, tuc); - ruc = (Apc(), wpc); - quc = new Nsd(ipe, ruc); - Wtc = (tAc(), rAc); - Vtc = new Nsd(jpe, Wtc); - Utc = new Nsd(kpe, false); - Ptc = (RXb(), QXb); - Otc = new Nsd(lpe, Ptc); - Ttc = (xzc(), uzc); - Stc = new Nsd(mpe, Ttc); - Qtc = new Nsd(npe, 0); - Rtc = new Nsd(ope, 0); - Ouc = kqc; - Nuc = Opc; - Wuc = izc; - Yuc = izc; - Quc = fzc; - fuc = (hbd(), ebd); - juc = Ppc; - duc = Ppc; - _tc = Ppc; - auc = ebd; - lvc = Tzc; - mvc = Qzc; - gvc = Qzc; - jvc = Qzc; - ovc = Szc; - tvc = Tzc; - svc = Tzc; - Cuc = (Aad(), yad); - Euc = yad; - Fuc = sBc; - vuc = xad; - Ivc = KBc; - Jvc = IBc; - Lvc = KBc; - Mvc = IBc; - Uvc = KBc; - Vvc = IBc; - Ovc = _pc; - Rvc = aqc; - hwc = KBc; - iwc = IBc; - dwc = KBc; - ewc = IBc; - Zvc = IBc; - Xvc = IBc; - _vc = IBc; - } - function S8b() { - S8b = ccb; - Y7b = new T8b("DIRECTION_PREPROCESSOR", 0); - V7b = new T8b("COMMENT_PREPROCESSOR", 1); - Z7b = new T8b("EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER", 2); - n8b = new T8b("INTERACTIVE_EXTERNAL_PORT_POSITIONER", 3); - G8b = new T8b("PARTITION_PREPROCESSOR", 4); - r8b = new T8b("LABEL_DUMMY_INSERTER", 5); - M8b = new T8b("SELF_LOOP_PREPROCESSOR", 6); - w8b = new T8b("LAYER_CONSTRAINT_PREPROCESSOR", 7); - E8b = new T8b("PARTITION_MIDPROCESSOR", 8); - i8b = new T8b("HIGH_DEGREE_NODE_LAYER_PROCESSOR", 9); - A8b = new T8b("NODE_PROMOTION", 10); - v8b = new T8b("LAYER_CONSTRAINT_POSTPROCESSOR", 11); - F8b = new T8b("PARTITION_POSTPROCESSOR", 12); - e8b = new T8b("HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR", 13); - O8b = new T8b("SEMI_INTERACTIVE_CROSSMIN_PROCESSOR", 14); - P7b = new T8b("BREAKING_POINT_INSERTER", 15); - z8b = new T8b("LONG_EDGE_SPLITTER", 16); - I8b = new T8b("PORT_SIDE_PROCESSOR", 17); - o8b = new T8b("INVERTED_PORT_PROCESSOR", 18); - H8b = new T8b("PORT_LIST_SORTER", 19); - Q8b = new T8b("SORT_BY_INPUT_ORDER_OF_MODEL", 20); - C8b = new T8b("NORTH_SOUTH_PORT_PREPROCESSOR", 21); - Q7b = new T8b("BREAKING_POINT_PROCESSOR", 22); - D8b = new T8b(Bne, 23); - R8b = new T8b(Cne, 24); - K8b = new T8b("SELF_LOOP_PORT_RESTORER", 25); - P8b = new T8b("SINGLE_EDGE_GRAPH_WRAPPER", 26); - p8b = new T8b("IN_LAYER_CONSTRAINT_PROCESSOR", 27); - b8b = new T8b("END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR", 28); - q8b = new T8b("LABEL_AND_NODE_SIZE_PROCESSOR", 29); - m8b = new T8b("INNERMOST_NODE_MARGIN_CALCULATOR", 30); - N8b = new T8b("SELF_LOOP_ROUTER", 31); - T7b = new T8b("COMMENT_NODE_MARGIN_CALCULATOR", 32); - _7b = new T8b("END_LABEL_PREPROCESSOR", 33); - t8b = new T8b("LABEL_DUMMY_SWITCHER", 34); - S7b = new T8b("CENTER_LABEL_MANAGEMENT_PROCESSOR", 35); - u8b = new T8b("LABEL_SIDE_SELECTOR", 36); - k8b = new T8b("HYPEREDGE_DUMMY_MERGER", 37); - f8b = new T8b("HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR", 38); - x8b = new T8b("LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR", 39); - h8b = new T8b("HIERARCHICAL_PORT_POSITION_PROCESSOR", 40); - W7b = new T8b("CONSTRAINTS_POSTPROCESSOR", 41); - U7b = new T8b("COMMENT_POSTPROCESSOR", 42); - l8b = new T8b("HYPERNODE_PROCESSOR", 43); - g8b = new T8b("HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER", 44); - y8b = new T8b("LONG_EDGE_JOINER", 45); - L8b = new T8b("SELF_LOOP_POSTPROCESSOR", 46); - R7b = new T8b("BREAKING_POINT_REMOVER", 47); - B8b = new T8b("NORTH_SOUTH_PORT_POSTPROCESSOR", 48); - j8b = new T8b("HORIZONTAL_COMPACTOR", 49); - s8b = new T8b("LABEL_DUMMY_REMOVER", 50); - c8b = new T8b("FINAL_SPLINE_BENDPOINTS_CALCULATOR", 51); - a8b = new T8b("END_LABEL_SORTER", 52); - J8b = new T8b("REVERSED_EDGE_RESTORER", 53); - $7b = new T8b("END_LABEL_POSTPROCESSOR", 54); - d8b = new T8b("HIERARCHICAL_NODE_RESIZER", 55); - X7b = new T8b("DIRECTION_POSTPROCESSOR", 56); - } - function KIc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F, G, H2, I, J, K2, L2, M2, N, O, P, Q2, R, S3, T, U2, V, W2, X, Y2, Z, $, ab, bb, cb, db2, eb, fb, gb, hb, ib, jb, kb, lb; - cb = 0; - for (H2 = b, K2 = 0, N = H2.length; K2 < N; ++K2) { - F = H2[K2]; - for (V = new olb(F.j); V.a < V.c.c.length; ) { - U2 = BD(mlb(V), 11); - X = 0; - for (h = new olb(U2.g); h.a < h.c.c.length; ) { - g = BD(mlb(h), 17); - F.c != g.d.i.c && ++X; - } - X > 0 && (a.a[U2.p] = cb++); - } - } - hb = 0; - for (I = c2, L2 = 0, O = I.length; L2 < O; ++L2) { - F = I[L2]; - P = 0; - for (V = new olb(F.j); V.a < V.c.c.length; ) { - U2 = BD(mlb(V), 11); - if (U2.j == (Ucd(), Acd)) { - for (h = new olb(U2.e); h.a < h.c.c.length; ) { - g = BD(mlb(h), 17); - if (F.c != g.c.i.c) { - ++P; - break; - } - } - } else { - break; - } + return { + indegree: /* @__PURE__ */ __name(function indegree(node3) { + if (maxIndegree == 0) { + return 0; } - R = 0; - Y2 = new Bib(F.j, F.j.c.length); - while (Y2.b > 0) { - U2 = (sCb(Y2.b > 0), BD(Y2.a.Xb(Y2.c = --Y2.b), 11)); - X = 0; - for (h = new olb(U2.e); h.a < h.c.c.length; ) { - g = BD(mlb(h), 17); - F.c != g.c.i.c && ++X; - } - if (X > 0) { - if (U2.j == (Ucd(), Acd)) { - a.a[U2.p] = hb; - ++hb; - } else { - a.a[U2.p] = hb + P + R; - ++R; - } - } + if (string(node3)) { + node3 = cy.filter(node3); } - hb += R; - } - W2 = new Lqb(); - o2 = new zsb(); - for (G = b, J = 0, M2 = G.length; J < M2; ++J) { - F = G[J]; - for (fb = new olb(F.j); fb.a < fb.c.c.length; ) { - eb = BD(mlb(fb), 11); - for (h = new olb(eb.g); h.a < h.c.c.length; ) { - g = BD(mlb(h), 17); - jb = g.d; - if (F.c != jb.i.c) { - db2 = BD(Wd(irb(W2.f, eb)), 467); - ib = BD(Wd(irb(W2.f, jb)), 467); - if (!db2 && !ib) { - n = new NIc(); - o2.a.zc(n, o2); - Ekb(n.a, g); - Ekb(n.d, eb); - jrb(W2.f, eb, n); - Ekb(n.d, jb); - jrb(W2.f, jb, n); - } else if (!db2) { - Ekb(ib.a, g); - Ekb(ib.d, eb); - jrb(W2.f, eb, ib); - } else if (!ib) { - Ekb(db2.a, g); - Ekb(db2.d, jb); - jrb(W2.f, jb, db2); - } else if (db2 == ib) { - Ekb(db2.a, g); - } else { - Ekb(db2.a, g); - for (T = new olb(ib.d); T.a < T.c.c.length; ) { - S3 = BD(mlb(T), 11); - jrb(W2.f, S3, db2); - } - Gkb(db2.a, ib.a); - Gkb(db2.d, ib.d); - o2.a.Bc(ib) != null; - } - } - } + return indegrees[node3.id()] / maxIndegree; + }, "indegree"), + outdegree: /* @__PURE__ */ __name(function outdegree(node3) { + if (maxOutdegree === 0) { + return 0; } - } - p = BD(Ee(o2, KC(oY, { 3: 1, 4: 1, 5: 1, 1946: 1 }, 467, o2.a.gc(), 0, 1)), 1946); - D3 = 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 olb(j.d); V.a < V.c.c.length; ) { - U2 = BD(mlb(V), 11); - Z = a.a[U2.p]; - if (U2.i.c == D3) { - Z < j.e && (j.e = Z); - Z > j.b && (j.b = Z); - } else if (U2.i.c == bb) { - Z < j.f && (j.f = Z); - Z > j.c && (j.c = Z); - } - } - } - Klb(p, 0, p.length, null); - gb = KC(WD, oje, 25, p.length, 15, 1); - d = KC(WD, oje, 25, 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 (t4 = 0; t4 < gb.length; t4++) { - gb[t4] += d[gb[t4]]; - $ = $wnd.Math.max($, gb[t4] + 1); - } - i3 = 1; - while (i3 < $) { - i3 *= 2; - } - lb = 2 * i3 - 1; - i3 -= 1; - kb = KC(WD, oje, 25, lb, 15, 1); - e = 0; - for (B = 0; B < gb.length; B++) { - A = gb[B] + i3; - ++kb[A]; - while (A > 0) { - A % 2 > 0 && (e += kb[A + 1]); - A = (A - 1) / 2 | 0; - ++kb[A]; - } - } - C = KC(nY, Uhe, 362, p.length * 2, 0, 1); - for (u2 = 0; u2 < p.length; u2++) { - C[2 * u2] = new QIc(p[u2], p[u2].e, p[u2].b, (UIc(), TIc)); - C[2 * u2 + 1] = new QIc(p[u2], p[u2].b, p[u2].e, SIc); - } - Klb(C, 0, C.length, null); - Q2 = 0; - for (v = 0; v < C.length; v++) { - switch (C[v].d.g) { - case 0: - ++Q2; - break; - case 1: - --Q2; - e += Q2; - } - } - ab = KC(nY, Uhe, 362, p.length * 2, 0, 1); - for (w2 = 0; w2 < p.length; w2++) { - ab[2 * w2] = new QIc(p[w2], p[w2].f, p[w2].c, (UIc(), TIc)); - ab[2 * w2 + 1] = new QIc(p[w2], p[w2].c, p[w2].f, SIc); - } - Klb(ab, 0, ab.length, null); - Q2 = 0; - for (q = 0; q < ab.length; q++) { - switch (ab[q].d.g) { - case 0: - ++Q2; - break; - case 1: - --Q2; - e += Q2; - } - } - return e; - } - function wfe() { - wfe = ccb; - ffe = new xfe(7); - hfe = new ige(8, 94); - new ige(8, 64); - ife = new ige(8, 36); - ofe = new ige(8, 65); - pfe = new ige(8, 122); - qfe = new ige(8, 90); - tfe = new ige(8, 98); - mfe = new ige(8, 66); - rfe = new ige(8, 60); - ufe = new ige(8, 62); - efe = new xfe(11); - cfe = new $fe(4); - Ufe(cfe, 48, 57); - sfe = new $fe(4); - Ufe(sfe, 48, 57); - Ufe(sfe, 65, 90); - Ufe(sfe, 95, 95); - Ufe(sfe, 97, 122); - nfe = new $fe(4); - Ufe(nfe, 9, 9); - Ufe(nfe, 10, 10); - Ufe(nfe, 12, 12); - Ufe(nfe, 13, 13); - Ufe(nfe, 32, 32); - jfe = _fe(cfe); - lfe = _fe(sfe); - kfe = _fe(nfe); - Zee = new Lqb(); - $ee = new Lqb(); - _ee = OC(GC(ZI, 1), nie, 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"]); - Yee = OC(GC(ZI, 1), nie, 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", uxe, "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"]); - afe = OC(GC(WD, 1), oje, 25, 15, [66304, 66351, 66352, 66383, 66560, 66639, 118784, 119039, 119040, 119295, 119808, 120831, 131072, 173782, 194560, 195103, 917504, 917631]); - } - function qJb() { - qJb = ccb; - nJb = new tJb("OUT_T_L", 0, (NHb(), LHb), (EIb(), BIb), (gHb(), dHb), dHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb((Hbd(), Dbd), OC(GC(B1, 1), Kie, 93, 0, [Gbd, zbd]))])); - mJb = new tJb("OUT_T_C", 1, KHb, BIb, dHb, eHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Dbd, OC(GC(B1, 1), Kie, 93, 0, [Gbd, ybd])), qqb(Dbd, OC(GC(B1, 1), Kie, 93, 0, [Gbd, ybd, Abd]))])); - oJb = new tJb("OUT_T_R", 2, MHb, BIb, dHb, fHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Dbd, OC(GC(B1, 1), Kie, 93, 0, [Gbd, Bbd]))])); - eJb = new tJb("OUT_B_L", 3, LHb, DIb, fHb, dHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Dbd, OC(GC(B1, 1), Kie, 93, 0, [Ebd, zbd]))])); - dJb = new tJb("OUT_B_C", 4, KHb, DIb, fHb, eHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Dbd, OC(GC(B1, 1), Kie, 93, 0, [Ebd, ybd])), qqb(Dbd, OC(GC(B1, 1), Kie, 93, 0, [Ebd, ybd, Abd]))])); - fJb = new tJb("OUT_B_R", 5, MHb, DIb, fHb, fHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Dbd, OC(GC(B1, 1), Kie, 93, 0, [Ebd, Bbd]))])); - iJb = new tJb("OUT_L_T", 6, MHb, DIb, dHb, dHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Dbd, OC(GC(B1, 1), Kie, 93, 0, [zbd, Gbd, Abd]))])); - hJb = new tJb("OUT_L_C", 7, MHb, CIb, eHb, dHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Dbd, OC(GC(B1, 1), Kie, 93, 0, [zbd, Fbd])), qqb(Dbd, OC(GC(B1, 1), Kie, 93, 0, [zbd, Fbd, Abd]))])); - gJb = new tJb("OUT_L_B", 8, MHb, BIb, fHb, dHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Dbd, OC(GC(B1, 1), Kie, 93, 0, [zbd, Ebd, Abd]))])); - lJb = new tJb("OUT_R_T", 9, LHb, DIb, dHb, fHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Dbd, OC(GC(B1, 1), Kie, 93, 0, [Bbd, Gbd, Abd]))])); - kJb = new tJb("OUT_R_C", 10, LHb, CIb, eHb, fHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Dbd, OC(GC(B1, 1), Kie, 93, 0, [Bbd, Fbd])), qqb(Dbd, OC(GC(B1, 1), Kie, 93, 0, [Bbd, Fbd, Abd]))])); - jJb = new tJb("OUT_R_B", 11, LHb, BIb, fHb, fHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Dbd, OC(GC(B1, 1), Kie, 93, 0, [Bbd, Ebd, Abd]))])); - bJb = new tJb("IN_T_L", 12, LHb, DIb, dHb, dHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Cbd, OC(GC(B1, 1), Kie, 93, 0, [Gbd, zbd])), qqb(Cbd, OC(GC(B1, 1), Kie, 93, 0, [Gbd, zbd, Abd]))])); - aJb = new tJb("IN_T_C", 13, KHb, DIb, dHb, eHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Cbd, OC(GC(B1, 1), Kie, 93, 0, [Gbd, ybd])), qqb(Cbd, OC(GC(B1, 1), Kie, 93, 0, [Gbd, ybd, Abd]))])); - cJb = new tJb("IN_T_R", 14, MHb, DIb, dHb, fHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Cbd, OC(GC(B1, 1), Kie, 93, 0, [Gbd, Bbd])), qqb(Cbd, OC(GC(B1, 1), Kie, 93, 0, [Gbd, Bbd, Abd]))])); - $Ib = new tJb("IN_C_L", 15, LHb, CIb, eHb, dHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Cbd, OC(GC(B1, 1), Kie, 93, 0, [Fbd, zbd])), qqb(Cbd, OC(GC(B1, 1), Kie, 93, 0, [Fbd, zbd, Abd]))])); - ZIb = new tJb("IN_C_C", 16, KHb, CIb, eHb, eHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Cbd, OC(GC(B1, 1), Kie, 93, 0, [Fbd, ybd])), qqb(Cbd, OC(GC(B1, 1), Kie, 93, 0, [Fbd, ybd, Abd]))])); - _Ib = new tJb("IN_C_R", 17, MHb, CIb, eHb, fHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Cbd, OC(GC(B1, 1), Kie, 93, 0, [Fbd, Bbd])), qqb(Cbd, OC(GC(B1, 1), Kie, 93, 0, [Fbd, Bbd, Abd]))])); - XIb = new tJb("IN_B_L", 18, LHb, BIb, fHb, dHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Cbd, OC(GC(B1, 1), Kie, 93, 0, [Ebd, zbd])), qqb(Cbd, OC(GC(B1, 1), Kie, 93, 0, [Ebd, zbd, Abd]))])); - WIb = new tJb("IN_B_C", 19, KHb, BIb, fHb, eHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Cbd, OC(GC(B1, 1), Kie, 93, 0, [Ebd, ybd])), qqb(Cbd, OC(GC(B1, 1), Kie, 93, 0, [Ebd, ybd, Abd]))])); - YIb = new tJb("IN_B_R", 20, MHb, BIb, fHb, fHb, OC(GC(LK, 1), Uhe, 21, 0, [qqb(Cbd, OC(GC(B1, 1), Kie, 93, 0, [Ebd, Bbd])), qqb(Cbd, OC(GC(B1, 1), Kie, 93, 0, [Ebd, Bbd, Abd]))])); - pJb = new tJb(ole, 21, null, null, null, null, OC(GC(LK, 1), Uhe, 21, 0, [])); - } - function jGd() { - jGd = ccb; - PFd = (NFd(), MFd).b; - BD(qud(ZKd(MFd.b), 0), 34); - BD(qud(ZKd(MFd.b), 1), 18); - OFd = MFd.a; - BD(qud(ZKd(MFd.a), 0), 34); - BD(qud(ZKd(MFd.a), 1), 18); - BD(qud(ZKd(MFd.a), 2), 18); - BD(qud(ZKd(MFd.a), 3), 18); - BD(qud(ZKd(MFd.a), 4), 18); - QFd = MFd.o; - BD(qud(ZKd(MFd.o), 0), 34); - BD(qud(ZKd(MFd.o), 1), 34); - SFd = BD(qud(ZKd(MFd.o), 2), 18); - BD(qud(ZKd(MFd.o), 3), 18); - BD(qud(ZKd(MFd.o), 4), 18); - BD(qud(ZKd(MFd.o), 5), 18); - BD(qud(ZKd(MFd.o), 6), 18); - BD(qud(ZKd(MFd.o), 7), 18); - BD(qud(ZKd(MFd.o), 8), 18); - BD(qud(ZKd(MFd.o), 9), 18); - BD(qud(ZKd(MFd.o), 10), 18); - BD(qud(ZKd(MFd.o), 11), 18); - BD(qud(ZKd(MFd.o), 12), 18); - BD(qud(ZKd(MFd.o), 13), 18); - BD(qud(ZKd(MFd.o), 14), 18); - BD(qud(ZKd(MFd.o), 15), 18); - BD(qud(WKd(MFd.o), 0), 59); - BD(qud(WKd(MFd.o), 1), 59); - BD(qud(WKd(MFd.o), 2), 59); - BD(qud(WKd(MFd.o), 3), 59); - BD(qud(WKd(MFd.o), 4), 59); - BD(qud(WKd(MFd.o), 5), 59); - BD(qud(WKd(MFd.o), 6), 59); - BD(qud(WKd(MFd.o), 7), 59); - BD(qud(WKd(MFd.o), 8), 59); - BD(qud(WKd(MFd.o), 9), 59); - RFd = MFd.p; - BD(qud(ZKd(MFd.p), 0), 34); - BD(qud(ZKd(MFd.p), 1), 34); - BD(qud(ZKd(MFd.p), 2), 34); - BD(qud(ZKd(MFd.p), 3), 34); - BD(qud(ZKd(MFd.p), 4), 18); - BD(qud(ZKd(MFd.p), 5), 18); - BD(qud(WKd(MFd.p), 0), 59); - BD(qud(WKd(MFd.p), 1), 59); - TFd = MFd.q; - BD(qud(ZKd(MFd.q), 0), 34); - UFd = MFd.v; - BD(qud(ZKd(MFd.v), 0), 18); - BD(qud(WKd(MFd.v), 0), 59); - BD(qud(WKd(MFd.v), 1), 59); - BD(qud(WKd(MFd.v), 2), 59); - VFd = MFd.w; - BD(qud(ZKd(MFd.w), 0), 34); - BD(qud(ZKd(MFd.w), 1), 34); - BD(qud(ZKd(MFd.w), 2), 34); - BD(qud(ZKd(MFd.w), 3), 18); - WFd = MFd.B; - BD(qud(ZKd(MFd.B), 0), 18); - BD(qud(WKd(MFd.B), 0), 59); - BD(qud(WKd(MFd.B), 1), 59); - BD(qud(WKd(MFd.B), 2), 59); - ZFd = MFd.Q; - BD(qud(ZKd(MFd.Q), 0), 18); - BD(qud(WKd(MFd.Q), 0), 59); - $Fd = MFd.R; - BD(qud(ZKd(MFd.R), 0), 34); - _Fd = MFd.S; - BD(qud(WKd(MFd.S), 0), 59); - BD(qud(WKd(MFd.S), 1), 59); - BD(qud(WKd(MFd.S), 2), 59); - BD(qud(WKd(MFd.S), 3), 59); - BD(qud(WKd(MFd.S), 4), 59); - BD(qud(WKd(MFd.S), 5), 59); - BD(qud(WKd(MFd.S), 6), 59); - BD(qud(WKd(MFd.S), 7), 59); - BD(qud(WKd(MFd.S), 8), 59); - BD(qud(WKd(MFd.S), 9), 59); - BD(qud(WKd(MFd.S), 10), 59); - BD(qud(WKd(MFd.S), 11), 59); - BD(qud(WKd(MFd.S), 12), 59); - BD(qud(WKd(MFd.S), 13), 59); - BD(qud(WKd(MFd.S), 14), 59); - aGd = MFd.T; - BD(qud(ZKd(MFd.T), 0), 18); - BD(qud(ZKd(MFd.T), 2), 18); - bGd = BD(qud(ZKd(MFd.T), 3), 18); - BD(qud(ZKd(MFd.T), 4), 18); - BD(qud(WKd(MFd.T), 0), 59); - BD(qud(WKd(MFd.T), 1), 59); - BD(qud(ZKd(MFd.T), 1), 18); - cGd = MFd.U; - BD(qud(ZKd(MFd.U), 0), 34); - BD(qud(ZKd(MFd.U), 1), 34); - BD(qud(ZKd(MFd.U), 2), 18); - BD(qud(ZKd(MFd.U), 3), 18); - BD(qud(ZKd(MFd.U), 4), 18); - BD(qud(ZKd(MFd.U), 5), 18); - BD(qud(WKd(MFd.U), 0), 59); - dGd = MFd.V; - BD(qud(ZKd(MFd.V), 0), 18); - eGd = MFd.W; - BD(qud(ZKd(MFd.W), 0), 34); - BD(qud(ZKd(MFd.W), 1), 34); - BD(qud(ZKd(MFd.W), 2), 34); - BD(qud(ZKd(MFd.W), 3), 18); - BD(qud(ZKd(MFd.W), 4), 18); - BD(qud(ZKd(MFd.W), 5), 18); - gGd = MFd.bb; - BD(qud(ZKd(MFd.bb), 0), 34); - BD(qud(ZKd(MFd.bb), 1), 34); - BD(qud(ZKd(MFd.bb), 2), 34); - BD(qud(ZKd(MFd.bb), 3), 34); - BD(qud(ZKd(MFd.bb), 4), 34); - BD(qud(ZKd(MFd.bb), 5), 34); - BD(qud(ZKd(MFd.bb), 6), 34); - BD(qud(ZKd(MFd.bb), 7), 18); - BD(qud(WKd(MFd.bb), 0), 59); - BD(qud(WKd(MFd.bb), 1), 59); - hGd = MFd.eb; - BD(qud(ZKd(MFd.eb), 0), 34); - BD(qud(ZKd(MFd.eb), 1), 34); - BD(qud(ZKd(MFd.eb), 2), 34); - BD(qud(ZKd(MFd.eb), 3), 34); - BD(qud(ZKd(MFd.eb), 4), 34); - BD(qud(ZKd(MFd.eb), 5), 34); - BD(qud(ZKd(MFd.eb), 6), 18); - BD(qud(ZKd(MFd.eb), 7), 18); - fGd = MFd.ab; - BD(qud(ZKd(MFd.ab), 0), 34); - BD(qud(ZKd(MFd.ab), 1), 34); - XFd = MFd.H; - BD(qud(ZKd(MFd.H), 0), 18); - BD(qud(ZKd(MFd.H), 1), 18); - BD(qud(ZKd(MFd.H), 2), 18); - BD(qud(ZKd(MFd.H), 3), 18); - BD(qud(ZKd(MFd.H), 4), 18); - BD(qud(ZKd(MFd.H), 5), 18); - BD(qud(WKd(MFd.H), 0), 59); - iGd = MFd.db; - BD(qud(ZKd(MFd.db), 0), 18); - YFd = MFd.M; - } - function bae(a) { - var b; - if (a.O) - return; - a.O = true; - pnd(a, "type"); - cod(a, "ecore.xml.type"); - dod(a, Ewe); - b = BD(nUd((yFd(), xFd), Ewe), 1945); - wtd(_Kd(a.fb), a.b); - Xnd(a.b, Q9, "AnyType", false, false, true); - Vnd(BD(qud(ZKd(a.b), 0), 34), a.wb.D, Qve, null, 0, -1, Q9, false, false, true, false, false, false); - Vnd(BD(qud(ZKd(a.b), 1), 34), a.wb.D, "any", null, 0, -1, Q9, true, true, true, false, false, true); - Vnd(BD(qud(ZKd(a.b), 2), 34), a.wb.D, "anyAttribute", null, 0, -1, Q9, false, false, true, false, false, false); - Xnd(a.bb, S9, Jwe, false, false, true); - Vnd(BD(qud(ZKd(a.bb), 0), 34), a.gb, "data", null, 0, 1, S9, false, false, true, false, true, false); - Vnd(BD(qud(ZKd(a.bb), 1), 34), a.gb, bue, null, 1, 1, S9, false, false, true, false, true, false); - Xnd(a.fb, T9, Kwe, false, false, true); - Vnd(BD(qud(ZKd(a.fb), 0), 34), b.gb, "rawValue", null, 0, 1, T9, true, true, true, false, true, true); - Vnd(BD(qud(ZKd(a.fb), 1), 34), b.a, Bte, null, 0, 1, T9, true, true, true, false, true, true); - _nd(BD(qud(ZKd(a.fb), 2), 18), a.wb.q, null, "instanceType", 1, 1, T9, false, false, true, false, false, false, false); - Xnd(a.qb, U9, Lwe, false, false, true); - Vnd(BD(qud(ZKd(a.qb), 0), 34), a.wb.D, Qve, null, 0, -1, null, false, false, true, false, false, false); - _nd(BD(qud(ZKd(a.qb), 1), 18), a.wb.ab, null, "xMLNSPrefixMap", 0, -1, null, true, false, true, true, false, false, false); - _nd(BD(qud(ZKd(a.qb), 2), 18), a.wb.ab, null, "xSISchemaLocation", 0, -1, null, true, false, true, true, false, false, false); - Vnd(BD(qud(ZKd(a.qb), 3), 34), a.gb, "cDATA", null, 0, -2, null, true, true, true, false, false, true); - Vnd(BD(qud(ZKd(a.qb), 4), 34), a.gb, "comment", null, 0, -2, null, true, true, true, false, false, true); - _nd(BD(qud(ZKd(a.qb), 5), 18), a.bb, null, jxe, 0, -2, null, true, true, true, true, false, false, true); - Vnd(BD(qud(ZKd(a.qb), 6), 34), a.gb, Ite, null, 0, -2, null, true, true, true, false, false, true); - Znd(a.a, SI, "AnySimpleType", true); - Znd(a.c, ZI, "AnyURI", true); - Znd(a.d, GC(SD, 1), "Base64Binary", true); - Znd(a.e, sbb, "Boolean", true); - Znd(a.f, wI, "BooleanObject", true); - Znd(a.g, SD, "Byte", true); - Znd(a.i, xI, "ByteObject", true); - Znd(a.j, ZI, "Date", true); - Znd(a.k, ZI, "DateTime", true); - Znd(a.n, bJ, "Decimal", true); - Znd(a.o, UD, "Double", true); - Znd(a.p, BI, "DoubleObject", true); - Znd(a.q, ZI, "Duration", true); - Znd(a.s, yK, "ENTITIES", true); - Znd(a.r, yK, "ENTITIESBase", true); - Znd(a.t, ZI, Rwe, true); - Znd(a.u, VD, "Float", true); - Znd(a.v, FI, "FloatObject", true); - Znd(a.w, ZI, "GDay", true); - Znd(a.B, ZI, "GMonth", true); - Znd(a.A, ZI, "GMonthDay", true); - Znd(a.C, ZI, "GYear", true); - Znd(a.D, ZI, "GYearMonth", true); - Znd(a.F, GC(SD, 1), "HexBinary", true); - Znd(a.G, ZI, "ID", true); - Znd(a.H, ZI, "IDREF", true); - Znd(a.J, yK, "IDREFS", true); - Znd(a.I, yK, "IDREFSBase", true); - Znd(a.K, WD, "Int", true); - Znd(a.M, cJ, "Integer", true); - Znd(a.L, JI, "IntObject", true); - Znd(a.P, ZI, "Language", true); - Znd(a.Q, XD, "Long", true); - Znd(a.R, MI, "LongObject", true); - Znd(a.S, ZI, "Name", true); - Znd(a.T, ZI, Swe, true); - Znd(a.U, cJ, "NegativeInteger", true); - Znd(a.V, ZI, axe, true); - Znd(a.X, yK, "NMTOKENS", true); - Znd(a.W, yK, "NMTOKENSBase", true); - Znd(a.Y, cJ, "NonNegativeInteger", true); - Znd(a.Z, cJ, "NonPositiveInteger", true); - Znd(a.$, ZI, "NormalizedString", true); - Znd(a._, ZI, "NOTATION", true); - Znd(a.ab, ZI, "PositiveInteger", true); - Znd(a.cb, ZI, "QName", true); - Znd(a.db, rbb, "Short", true); - Znd(a.eb, UI, "ShortObject", true); - Znd(a.gb, ZI, Vie, true); - Znd(a.hb, ZI, "Time", true); - Znd(a.ib, ZI, "Token", true); - Znd(a.jb, rbb, "UnsignedByte", true); - Znd(a.kb, UI, "UnsignedByteObject", true); - Znd(a.lb, XD, "UnsignedInt", true); - Znd(a.mb, MI, "UnsignedIntObject", true); - Znd(a.nb, cJ, "UnsignedLong", true); - Znd(a.ob, WD, "UnsignedShort", true); - Znd(a.pb, JI, "UnsignedShortObject", true); - Rnd(a, Ewe); - _9d(a); - } - function Oyc(a) { - r4c(a, new E3c(Q3c(L3c(P3c(M3c(O3c(N3c(new R3c(), sne), "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 Ryc()), sne), qqb((Csd(), Bsd), OC(GC(O3, 1), Kie, 237, 0, [ysd, zsd, xsd, Asd, vsd, usd]))))); - p4c(a, sne, Lpe, Ksd(iyc)); - p4c(a, sne, Mpe, Ksd(jyc)); - p4c(a, sne, Zle, Ksd(kyc)); - p4c(a, sne, Npe, Ksd(lyc)); - p4c(a, sne, xme, Ksd(nyc)); - p4c(a, sne, Ope, Ksd(oyc)); - p4c(a, sne, Ppe, Ksd(ryc)); - p4c(a, sne, Qpe, Ksd(tyc)); - p4c(a, sne, Rpe, Ksd(uyc)); - p4c(a, sne, Spe, Ksd(syc)); - p4c(a, sne, wme, Ksd(vyc)); - p4c(a, sne, Tpe, Ksd(xyc)); - p4c(a, sne, Upe, Ksd(zyc)); - p4c(a, sne, Vpe, Ksd(qyc)); - p4c(a, sne, Loe, Ksd(hyc)); - p4c(a, sne, Noe, Ksd(myc)); - p4c(a, sne, Moe, Ksd(pyc)); - p4c(a, sne, Ooe, Ksd(wyc)); - p4c(a, sne, vme, meb(0)); - p4c(a, sne, Poe, Ksd(cyc)); - p4c(a, sne, Qoe, Ksd(dyc)); - p4c(a, sne, Roe, Ksd(eyc)); - p4c(a, sne, Yoe, Ksd(Kyc)); - p4c(a, sne, Zoe, Ksd(Cyc)); - p4c(a, sne, $oe, Ksd(Dyc)); - p4c(a, sne, _oe, Ksd(Gyc)); - p4c(a, sne, ape, Ksd(Eyc)); - p4c(a, sne, bpe, Ksd(Fyc)); - p4c(a, sne, cpe, Ksd(Myc)); - p4c(a, sne, dpe, Ksd(Lyc)); - p4c(a, sne, epe, Ksd(Iyc)); - p4c(a, sne, fpe, Ksd(Hyc)); - p4c(a, sne, gpe, Ksd(Jyc)); - p4c(a, sne, Eoe, Ksd(Cxc)); - p4c(a, sne, Foe, Ksd(Dxc)); - p4c(a, sne, Ioe, Ksd(Xwc)); - p4c(a, sne, Joe, Ksd(Ywc)); - p4c(a, sne, ame, Lxc); - p4c(a, sne, ype, Twc); - p4c(a, sne, Wpe, 0); - p4c(a, sne, yme, meb(1)); - p4c(a, sne, _le, tme); - p4c(a, sne, Xpe, Ksd(Jxc)); - p4c(a, sne, Bme, Ksd(Vxc)); - p4c(a, sne, Ype, Ksd($xc)); - p4c(a, sne, Zpe, Ksd(Kwc)); - p4c(a, sne, $pe, Ksd(mwc)); - p4c(a, sne, tpe, Ksd(axc)); - p4c(a, sne, zme, (Bcb(), true)); - p4c(a, sne, _pe, Ksd(fxc)); - p4c(a, sne, aqe, Ksd(gxc)); - p4c(a, sne, Fme, Ksd(Fxc)); - p4c(a, sne, Eme, Ksd(Ixc)); - p4c(a, sne, bqe, Ksd(Gxc)); - p4c(a, sne, cqe, Nwc); - p4c(a, sne, Gme, Ksd(xxc)); - p4c(a, sne, dqe, Ksd(wxc)); - p4c(a, sne, Hme, Ksd(Yxc)); - p4c(a, sne, eqe, Ksd(Xxc)); - p4c(a, sne, fqe, Ksd(Zxc)); - p4c(a, sne, gqe, Oxc); - p4c(a, sne, hqe, Ksd(Qxc)); - p4c(a, sne, iqe, Ksd(Rxc)); - p4c(a, sne, jqe, Ksd(Sxc)); - p4c(a, sne, kqe, Ksd(Pxc)); - p4c(a, sne, eoe, Ksd(Byc)); - p4c(a, sne, hoe, Ksd(sxc)); - p4c(a, sne, noe, Ksd(rxc)); - p4c(a, sne, doe, Ksd(Ayc)); - p4c(a, sne, ioe, Ksd(mxc)); - p4c(a, sne, goe, Ksd(Jwc)); - p4c(a, sne, qoe, Ksd(Iwc)); - p4c(a, sne, roe, Ksd(Awc)); - p4c(a, sne, woe, Ksd(Bwc)); - p4c(a, sne, xoe, Ksd(Dwc)); - p4c(a, sne, yoe, Ksd(Cwc)); - p4c(a, sne, toe, Ksd(Hwc)); - p4c(a, sne, _ne, Ksd(uxc)); - p4c(a, sne, aoe, Ksd(vxc)); - p4c(a, sne, $ne, Ksd(ixc)); - p4c(a, sne, zoe, Ksd(Exc)); - p4c(a, sne, Coe, Ksd(zxc)); - p4c(a, sne, Zne, Ksd($wc)); - p4c(a, sne, Doe, Ksd(Bxc)); - p4c(a, sne, Goe, Ksd(Vwc)); - p4c(a, sne, Hoe, Ksd(Wwc)); - p4c(a, sne, lqe, Ksd(zwc)); - p4c(a, sne, Boe, Ksd(yxc)); - p4c(a, sne, Toe, Ksd(swc)); - p4c(a, sne, Uoe, Ksd(rwc)); - p4c(a, sne, Soe, Ksd(qwc)); - p4c(a, sne, Voe, Ksd(cxc)); - p4c(a, sne, Woe, Ksd(bxc)); - p4c(a, sne, Xoe, Ksd(dxc)); - p4c(a, sne, Tme, Ksd(Hxc)); - p4c(a, sne, mqe, Ksd(jxc)); - p4c(a, sne, $le, Ksd(Zwc)); - p4c(a, sne, nqe, Ksd(Qwc)); - p4c(a, sne, Cme, Ksd(Pwc)); - p4c(a, sne, soe, Ksd(Ewc)); - p4c(a, sne, oqe, Ksd(Wxc)); - p4c(a, sne, pqe, Ksd(pwc)); - p4c(a, sne, qqe, Ksd(exc)); - p4c(a, sne, rqe, Ksd(Txc)); - p4c(a, sne, sqe, Ksd(Mxc)); - p4c(a, sne, tqe, Ksd(Nxc)); - p4c(a, sne, loe, Ksd(oxc)); - p4c(a, sne, moe, Ksd(pxc)); - p4c(a, sne, uqe, Ksd(ayc)); - p4c(a, sne, boe, Ksd(nwc)); - p4c(a, sne, ooe, Ksd(qxc)); - p4c(a, sne, hpe, Ksd(Rwc)); - p4c(a, sne, ipe, Ksd(Owc)); - p4c(a, sne, vqe, Ksd(txc)); - p4c(a, sne, poe, Ksd(kxc)); - p4c(a, sne, Aoe, Ksd(Axc)); - p4c(a, sne, wqe, Ksd(yyc)); - p4c(a, sne, Yne, Ksd(Mwc)); - p4c(a, sne, coe, Ksd(_xc)); - p4c(a, sne, Koe, Ksd(Uwc)); - p4c(a, sne, joe, Ksd(lxc)); - p4c(a, sne, uoe, Ksd(Fwc)); - p4c(a, sne, xqe, Ksd(hxc)); - p4c(a, sne, koe, Ksd(nxc)); - p4c(a, sne, voe, Ksd(Gwc)); - p4c(a, sne, jpe, Ksd(ywc)); - p4c(a, sne, mpe, Ksd(wwc)); - p4c(a, sne, npe, Ksd(uwc)); - p4c(a, sne, ope, Ksd(vwc)); - p4c(a, sne, kpe, Ksd(xwc)); - p4c(a, sne, lpe, Ksd(twc)); - p4c(a, sne, foe, Ksd(_wc)); - } - function kee(a, b) { - var c2, d; - if (!cee) { - cee = new Lqb(); - dee = new Lqb(); - d = (wfe(), wfe(), new $fe(4)); - Ree(d, " \n\r\r "); - Shb(cee, pxe, d); - Shb(dee, pxe, _fe(d)); - d = new $fe(4); - Ree(d, sxe); - Shb(cee, nxe, d); - Shb(dee, nxe, _fe(d)); - d = new $fe(4); - Ree(d, sxe); - Shb(cee, nxe, d); - Shb(dee, nxe, _fe(d)); - d = new $fe(4); - Ree(d, txe); - Xfe(d, BD(Phb(cee, nxe), 117)); - Shb(cee, oxe, d); - Shb(dee, oxe, _fe(d)); - d = new $fe(4); - Ree(d, "-.0:AZ__az··ÀÖØöøıĴľŁňŊžƀǃǍǰǴǵǺȗɐʨʻˁːˑ̀͠͡ͅΆΊΌΌΎΡΣώϐϖϚϚϜϜϞϞϠϠϢϳЁЌЎяёќўҁ҃҆ҐӄӇӈӋӌӐӫӮӵӸӹԱՖՙՙաֆֹֻֽֿֿׁׂ֑֣֡ׄׄאתװײءغـْ٠٩ٰڷںھۀێېۓە۪ۭۨ۰۹ँःअह़्॑॔क़ॣ०९ঁঃঅঌএঐওনপরললশহ়়াৄেৈো্ৗৗড়ঢ়য়ৣ০ৱਂਂਅਊਏਐਓਨਪਰਲਲ਼ਵਸ਼ਸਹ਼਼ਾੂੇੈੋ੍ਖ਼ੜਫ਼ਫ਼੦ੴઁઃઅઋઍઍએઑઓનપરલળવહ઼ૅેૉો્ૠૠ૦૯ଁଃଅଌଏଐଓନପରଲଳଶହ଼ୃେୈୋ୍ୖୗଡ଼ଢ଼ୟୡ୦୯ஂஃஅஊஎஐஒகஙசஜஜஞடணதநபமவஷஹாூெைொ்ௗௗ௧௯ఁఃఅఌఎఐఒనపళవహాౄెైొ్ౕౖౠౡ౦౯ಂಃಅಌಎಐಒನಪಳವಹಾೄೆೈೊ್ೕೖೞೞೠೡ೦೯ംഃഅഌഎഐഒനപഹാൃെൈൊ്ൗൗൠൡ൦൯กฮะฺเ๎๐๙ກຂຄຄງຈຊຊຍຍດທນຟມຣລລວວສຫອຮະູົຽເໄໆໆ່ໍ໐໙༘༙༠༩༹༹༵༵༷༷༾ཇཉཀྵ྄ཱ྆ྋྐྕྗྗྙྭྱྷྐྵྐྵႠჅაჶᄀᄀᄂᄃᄅᄇᄉᄉᄋᄌᄎᄒᄼᄼᄾᄾᅀᅀᅌᅌᅎᅎᅐᅐᅔᅕᅙᅙᅟᅡᅣᅣᅥᅥᅧᅧᅩᅩᅭᅮᅲᅳᅵᅵᆞᆞᆨᆨᆫᆫᆮᆯᆷᆸᆺᆺᆼᇂᇫᇫᇰᇰᇹᇹḀẛẠỹἀἕἘἝἠὅὈὍὐὗὙὙὛὛὝὝὟώᾀᾴᾶᾼιιῂῄῆῌῐΐῖΊῠῬῲῴῶῼ⃐⃜⃡⃡ΩΩKÅ℮℮ↀↂ々々〇〇〡〯〱〵ぁゔ゙゚ゝゞァヺーヾㄅㄬ一龥가힣"); - Shb(cee, qxe, d); - Shb(dee, qxe, _fe(d)); - d = new $fe(4); - Ree(d, txe); - Ufe(d, 95, 95); - Ufe(d, 58, 58); - Shb(cee, rxe, d); - Shb(dee, rxe, _fe(d)); - } - c2 = b ? BD(Phb(cee, a), 136) : BD(Phb(dee, a), 136); - return c2; - } - function _9d(a) { - Bnd(a.a, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "anySimpleType"])); - Bnd(a.b, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "anyType", Sve, Qve])); - Bnd(BD(qud(ZKd(a.b), 0), 34), Rve, OC(GC(ZI, 1), nie, 2, 6, [Sve, xwe, fue, ":mixed"])); - Bnd(BD(qud(ZKd(a.b), 1), 34), Rve, OC(GC(ZI, 1), nie, 2, 6, [Sve, xwe, Dwe, Fwe, fue, ":1", Owe, "lax"])); - Bnd(BD(qud(ZKd(a.b), 2), 34), Rve, OC(GC(ZI, 1), nie, 2, 6, [Sve, vwe, Dwe, Fwe, fue, ":2", Owe, "lax"])); - Bnd(a.c, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "anyURI", Cwe, ywe])); - Bnd(a.d, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "base64Binary", Cwe, ywe])); - Bnd(a.e, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, Khe, Cwe, ywe])); - Bnd(a.f, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "boolean:Object", cwe, Khe])); - Bnd(a.g, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, Eve])); - Bnd(a.i, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "byte:Object", cwe, Eve])); - Bnd(a.j, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "date", Cwe, ywe])); - Bnd(a.k, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "dateTime", Cwe, ywe])); - Bnd(a.n, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "decimal", Cwe, ywe])); - Bnd(a.o, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, Gve, Cwe, ywe])); - Bnd(a.p, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "double:Object", cwe, Gve])); - Bnd(a.q, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "duration", Cwe, ywe])); - Bnd(a.s, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "ENTITIES", cwe, Pwe, Qwe, "1"])); - Bnd(a.r, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, Pwe, zwe, Rwe])); - Bnd(a.t, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, Rwe, cwe, Swe])); - Bnd(a.u, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, Hve, Cwe, ywe])); - Bnd(a.v, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "float:Object", cwe, Hve])); - Bnd(a.w, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "gDay", Cwe, ywe])); - Bnd(a.B, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "gMonth", Cwe, ywe])); - Bnd(a.A, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "gMonthDay", Cwe, ywe])); - Bnd(a.C, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "gYear", Cwe, ywe])); - Bnd(a.D, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "gYearMonth", Cwe, ywe])); - Bnd(a.F, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "hexBinary", Cwe, ywe])); - Bnd(a.G, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "ID", cwe, Swe])); - Bnd(a.H, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "IDREF", cwe, Swe])); - Bnd(a.J, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "IDREFS", cwe, Twe, Qwe, "1"])); - Bnd(a.I, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, Twe, zwe, "IDREF"])); - Bnd(a.K, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, Ive])); - Bnd(a.M, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, Uwe])); - Bnd(a.L, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "int:Object", cwe, Ive])); - Bnd(a.P, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "language", cwe, Vwe, Wwe, Xwe])); - Bnd(a.Q, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, Jve])); - Bnd(a.R, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "long:Object", cwe, Jve])); - Bnd(a.S, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "Name", cwe, Vwe, Wwe, Ywe])); - Bnd(a.T, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, Swe, cwe, "Name", Wwe, Zwe])); - Bnd(a.U, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "negativeInteger", cwe, $we, _we, "-1"])); - Bnd(a.V, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, axe, cwe, Vwe, Wwe, "\\c+"])); - Bnd(a.X, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "NMTOKENS", cwe, bxe, Qwe, "1"])); - Bnd(a.W, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, bxe, zwe, axe])); - Bnd(a.Y, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, cxe, cwe, Uwe, dxe, "0"])); - Bnd(a.Z, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, $we, cwe, Uwe, _we, "0"])); - Bnd(a.$, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, exe, cwe, Mhe, Cwe, "replace"])); - Bnd(a._, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "NOTATION", Cwe, ywe])); - Bnd(a.ab, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "positiveInteger", cwe, cxe, dxe, "1"])); - Bnd(a.bb, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "processingInstruction_._type", Sve, "empty"])); - Bnd(BD(qud(ZKd(a.bb), 0), 34), Rve, OC(GC(ZI, 1), nie, 2, 6, [Sve, uwe, fue, "data"])); - Bnd(BD(qud(ZKd(a.bb), 1), 34), Rve, OC(GC(ZI, 1), nie, 2, 6, [Sve, uwe, fue, bue])); - Bnd(a.cb, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "QName", Cwe, ywe])); - Bnd(a.db, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, Kve])); - Bnd(a.eb, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "short:Object", cwe, Kve])); - Bnd(a.fb, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "simpleAnyType", Sve, twe])); - Bnd(BD(qud(ZKd(a.fb), 0), 34), Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, ":3", Sve, twe])); - Bnd(BD(qud(ZKd(a.fb), 1), 34), Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, ":4", Sve, twe])); - Bnd(BD(qud(ZKd(a.fb), 2), 18), Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, ":5", Sve, twe])); - Bnd(a.gb, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, Mhe, Cwe, "preserve"])); - Bnd(a.hb, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "time", Cwe, ywe])); - Bnd(a.ib, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, Vwe, cwe, exe, Cwe, ywe])); - Bnd(a.jb, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, fxe, _we, "255", dxe, "0"])); - Bnd(a.kb, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "unsignedByte:Object", cwe, fxe])); - Bnd(a.lb, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, gxe, _we, "4294967295", dxe, "0"])); - Bnd(a.mb, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "unsignedInt:Object", cwe, gxe])); - Bnd(a.nb, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "unsignedLong", cwe, cxe, _we, hxe, dxe, "0"])); - Bnd(a.ob, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, ixe, _we, "65535", dxe, "0"])); - Bnd(a.pb, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "unsignedShort:Object", cwe, ixe])); - Bnd(a.qb, Rve, OC(GC(ZI, 1), nie, 2, 6, [fue, "", Sve, Qve])); - Bnd(BD(qud(ZKd(a.qb), 0), 34), Rve, OC(GC(ZI, 1), nie, 2, 6, [Sve, xwe, fue, ":mixed"])); - Bnd(BD(qud(ZKd(a.qb), 1), 18), Rve, OC(GC(ZI, 1), nie, 2, 6, [Sve, uwe, fue, "xmlns:prefix"])); - Bnd(BD(qud(ZKd(a.qb), 2), 18), Rve, OC(GC(ZI, 1), nie, 2, 6, [Sve, uwe, fue, "xsi:schemaLocation"])); - Bnd(BD(qud(ZKd(a.qb), 3), 34), Rve, OC(GC(ZI, 1), nie, 2, 6, [Sve, wwe, fue, "cDATA", Awe, Bwe])); - Bnd(BD(qud(ZKd(a.qb), 4), 34), Rve, OC(GC(ZI, 1), nie, 2, 6, [Sve, wwe, fue, "comment", Awe, Bwe])); - Bnd(BD(qud(ZKd(a.qb), 5), 18), Rve, OC(GC(ZI, 1), nie, 2, 6, [Sve, wwe, fue, jxe, Awe, Bwe])); - Bnd(BD(qud(ZKd(a.qb), 6), 34), Rve, OC(GC(ZI, 1), nie, 2, 6, [Sve, wwe, fue, Ite, Awe, Bwe])); - } - function tvd(a) { - return dfb("_UI_EMFDiagnostic_marker", a) ? "EMF Problem" : dfb("_UI_CircularContainment_diagnostic", a) ? "An object may not circularly contain itself" : dfb(sue, a) ? "Wrong character." : dfb(tue, a) ? "Invalid reference number." : dfb(uue, a) ? "A character is required after \\." : dfb(vue, a) ? "'?' is not expected. '(?:' or '(?=' or '(?!' or '(?<' or '(?#' or '(?>'?" : dfb(wue, a) ? "'(?<' or '(? toIndex: ", zke = ", toIndex: ", Ake = "Index: ", Bke = ", Size: ", Cke = "org.eclipse.elk.alg.common", Dke = { 62: 1 }, Eke = "org.eclipse.elk.alg.common.compaction", Fke = "Scanline/EventHandler", Gke = "org.eclipse.elk.alg.common.compaction.oned", Hke = "CNode belongs to another CGroup.", Ike = "ISpacingsHandler/1", Jke = "The ", Kke = " instance has been finished already.", Lke = "The direction ", Mke = " is not supported by the CGraph instance.", Nke = "OneDimensionalCompactor", Oke = "OneDimensionalCompactor/lambda$0$Type", Pke = "Quadruplet", Qke = "ScanlineConstraintCalculator", Rke = "ScanlineConstraintCalculator/ConstraintsScanlineHandler", Ske = "ScanlineConstraintCalculator/ConstraintsScanlineHandler/lambda$0$Type", Tke = "ScanlineConstraintCalculator/Timestamp", Uke = "ScanlineConstraintCalculator/lambda$0$Type", Vke = { 169: 1, 45: 1 }, Wke = "org.eclipse.elk.alg.common.compaction.options", Xke = "org.eclipse.elk.core.data", Yke = "org.eclipse.elk.polyomino.traversalStrategy", Zke = "org.eclipse.elk.polyomino.lowLevelSort", $ke = "org.eclipse.elk.polyomino.highLevelSort", _ke = "org.eclipse.elk.polyomino.fill", ale = { 130: 1 }, ble = "polyomino", cle = "org.eclipse.elk.alg.common.networksimplex", dle = { 177: 1, 3: 1, 4: 1 }, ele = "org.eclipse.elk.alg.common.nodespacing", fle = "org.eclipse.elk.alg.common.nodespacing.cellsystem", gle = "CENTER", hle = { 212: 1, 326: 1 }, ile = { 3: 1, 4: 1, 5: 1, 595: 1 }, jle = "LEFT", kle = "RIGHT", lle = "Vertical alignment cannot be null", mle = "BOTTOM", nle = "org.eclipse.elk.alg.common.nodespacing.internal", ole = "UNDEFINED", ple = 0.01, qle = "org.eclipse.elk.alg.common.nodespacing.internal.algorithm", rle = "LabelPlacer/lambda$0$Type", sle = "LabelPlacer/lambda$1$Type", tle = "portRatioOrPosition", ule = "org.eclipse.elk.alg.common.overlaps", vle = "DOWN", wle = "org.eclipse.elk.alg.common.polyomino", xle = "NORTH", yle = "EAST", zle = "SOUTH", Ale = "WEST", Ble = "org.eclipse.elk.alg.common.polyomino.structures", Cle = "Direction", Dle = "Grid is only of size ", Ele = ". Requested point (", Fle = ") is out of bounds.", Gle = " Given center based coordinates were (", Hle = "org.eclipse.elk.graph.properties", Ile = "IPropertyHolder", Jle = { 3: 1, 94: 1, 134: 1 }, Kle = "org.eclipse.elk.alg.common.spore", Lle = "org.eclipse.elk.alg.common.utils", Mle = { 209: 1 }, Nle = "org.eclipse.elk.core", Ole = "Connected Components Compaction", Ple = "org.eclipse.elk.alg.disco", Qle = "org.eclipse.elk.alg.disco.graph", Rle = "org.eclipse.elk.alg.disco.options", Sle = "CompactionStrategy", Tle = "org.eclipse.elk.disco.componentCompaction.strategy", Ule = "org.eclipse.elk.disco.componentCompaction.componentLayoutAlgorithm", Vle = "org.eclipse.elk.disco.debug.discoGraph", Wle = "org.eclipse.elk.disco.debug.discoPolys", Xle = "componentCompaction", Yle = "org.eclipse.elk.disco", Zle = "org.eclipse.elk.spacing.componentComponent", $le = "org.eclipse.elk.edge.thickness", _le = "org.eclipse.elk.aspectRatio", ame = "org.eclipse.elk.padding", bme = "org.eclipse.elk.alg.disco.transform", cme = 1.5707963267948966, dme = 17976931348623157e292, eme = { 3: 1, 4: 1, 5: 1, 192: 1 }, fme = { 3: 1, 6: 1, 4: 1, 5: 1, 106: 1, 120: 1 }, gme = "org.eclipse.elk.alg.force", hme = "ComponentsProcessor", ime = "ComponentsProcessor/1", jme = "org.eclipse.elk.alg.force.graph", kme = "Component Layout", lme = "org.eclipse.elk.alg.force.model", mme = "org.eclipse.elk.force.model", nme = "org.eclipse.elk.force.iterations", ome = "org.eclipse.elk.force.repulsivePower", pme = "org.eclipse.elk.force.temperature", qme = 1e-3, rme = "org.eclipse.elk.force.repulsion", sme = "org.eclipse.elk.alg.force.options", tme = 1.600000023841858, ume = "org.eclipse.elk.force", vme = "org.eclipse.elk.priority", wme = "org.eclipse.elk.spacing.nodeNode", xme = "org.eclipse.elk.spacing.edgeLabel", yme = "org.eclipse.elk.randomSeed", zme = "org.eclipse.elk.separateConnectedComponents", Ame = "org.eclipse.elk.interactive", Bme = "org.eclipse.elk.portConstraints", Cme = "org.eclipse.elk.edgeLabels.inline", Dme = "org.eclipse.elk.omitNodeMicroLayout", Eme = "org.eclipse.elk.nodeSize.options", Fme = "org.eclipse.elk.nodeSize.constraints", Gme = "org.eclipse.elk.nodeLabels.placement", Hme = "org.eclipse.elk.portLabels.placement", Ime = "origin", Jme = "random", Kme = "boundingBox.upLeft", Lme = "boundingBox.lowRight", Mme = "org.eclipse.elk.stress.fixed", Nme = "org.eclipse.elk.stress.desiredEdgeLength", Ome = "org.eclipse.elk.stress.dimension", Pme = "org.eclipse.elk.stress.epsilon", Qme = "org.eclipse.elk.stress.iterationLimit", Rme = "org.eclipse.elk.stress", Sme = "ELK Stress", Tme = "org.eclipse.elk.nodeSize.minimum", Ume = "org.eclipse.elk.alg.force.stress", Vme = "Layered layout", Wme = "org.eclipse.elk.alg.layered", Xme = "org.eclipse.elk.alg.layered.compaction.components", Yme = "org.eclipse.elk.alg.layered.compaction.oned", Zme = "org.eclipse.elk.alg.layered.compaction.oned.algs", $me = "org.eclipse.elk.alg.layered.compaction.recthull", _me = "org.eclipse.elk.alg.layered.components", ane = "NONE", bne = { 3: 1, 6: 1, 4: 1, 9: 1, 5: 1, 122: 1 }, cne = { 3: 1, 6: 1, 4: 1, 5: 1, 141: 1, 106: 1, 120: 1 }, dne = "org.eclipse.elk.alg.layered.compound", ene = { 51: 1 }, fne = "org.eclipse.elk.alg.layered.graph", gne = " -> ", hne = "Not supported by LGraph", ine = "Port side is undefined", jne = { 3: 1, 6: 1, 4: 1, 5: 1, 474: 1, 141: 1, 106: 1, 120: 1 }, kne = { 3: 1, 6: 1, 4: 1, 5: 1, 141: 1, 193: 1, 203: 1, 106: 1, 120: 1 }, lne = { 3: 1, 6: 1, 4: 1, 5: 1, 141: 1, 1943: 1, 203: 1, 106: 1, 120: 1 }, mne = `([{"' \r -`, nne = `)]}"' \r -`, one2 = "The given string contains parts that cannot be parsed as numbers.", pne = "org.eclipse.elk.core.math", qne = { 3: 1, 4: 1, 142: 1, 207: 1, 414: 1 }, rne = { 3: 1, 4: 1, 116: 1, 207: 1, 414: 1 }, sne = "org.eclipse.elk.layered", tne = "org.eclipse.elk.alg.layered.graph.transform", une = "ElkGraphImporter", vne = "ElkGraphImporter/lambda$0$Type", wne = "ElkGraphImporter/lambda$1$Type", xne = "ElkGraphImporter/lambda$2$Type", yne = "ElkGraphImporter/lambda$4$Type", zne = "Node margin calculation", Ane = "org.eclipse.elk.alg.layered.intermediate", Bne = "ONE_SIDED_GREEDY_SWITCH", Cne = "TWO_SIDED_GREEDY_SWITCH", Dne = "No implementation is available for the layout processor ", Ene = "IntermediateProcessorStrategy", Fne = "Node '", Gne = "FIRST_SEPARATE", Hne = "LAST_SEPARATE", Ine = "Odd port side processing", Jne = "org.eclipse.elk.alg.layered.intermediate.compaction", Kne = "org.eclipse.elk.alg.layered.intermediate.greedyswitch", Lne = "org.eclipse.elk.alg.layered.p3order.counting", Mne = { 225: 1 }, Nne = "org.eclipse.elk.alg.layered.intermediate.loops", One = "org.eclipse.elk.alg.layered.intermediate.loops.ordering", Pne = "org.eclipse.elk.alg.layered.intermediate.loops.routing", Qne = "org.eclipse.elk.alg.layered.intermediate.preserveorder", Rne = "org.eclipse.elk.alg.layered.intermediate.wrapping", Sne = "org.eclipse.elk.alg.layered.options", Tne = "INTERACTIVE", Une = "DEPTH_FIRST", Vne = "EDGE_LENGTH", Wne = "SELF_LOOPS", Xne = "firstTryWithInitialOrder", Yne = "org.eclipse.elk.layered.directionCongruency", Zne = "org.eclipse.elk.layered.feedbackEdges", $ne = "org.eclipse.elk.layered.interactiveReferencePoint", _ne = "org.eclipse.elk.layered.mergeEdges", aoe = "org.eclipse.elk.layered.mergeHierarchyEdges", boe = "org.eclipse.elk.layered.allowNonFlowPortsToSwitchSides", coe = "org.eclipse.elk.layered.portSortingStrategy", doe = "org.eclipse.elk.layered.thoroughness", eoe = "org.eclipse.elk.layered.unnecessaryBendpoints", foe = "org.eclipse.elk.layered.generatePositionAndLayerIds", goe = "org.eclipse.elk.layered.cycleBreaking.strategy", hoe = "org.eclipse.elk.layered.layering.strategy", ioe = "org.eclipse.elk.layered.layering.layerConstraint", joe = "org.eclipse.elk.layered.layering.layerChoiceConstraint", koe = "org.eclipse.elk.layered.layering.layerId", loe = "org.eclipse.elk.layered.layering.minWidth.upperBoundOnWidth", moe = "org.eclipse.elk.layered.layering.minWidth.upperLayerEstimationScalingFactor", noe = "org.eclipse.elk.layered.layering.nodePromotion.strategy", ooe = "org.eclipse.elk.layered.layering.nodePromotion.maxIterations", poe = "org.eclipse.elk.layered.layering.coffmanGraham.layerBound", qoe = "org.eclipse.elk.layered.crossingMinimization.strategy", roe = "org.eclipse.elk.layered.crossingMinimization.forceNodeModelOrder", soe = "org.eclipse.elk.layered.crossingMinimization.hierarchicalSweepiness", toe = "org.eclipse.elk.layered.crossingMinimization.semiInteractive", uoe = "org.eclipse.elk.layered.crossingMinimization.positionChoiceConstraint", voe = "org.eclipse.elk.layered.crossingMinimization.positionId", woe = "org.eclipse.elk.layered.crossingMinimization.greedySwitch.activationThreshold", xoe = "org.eclipse.elk.layered.crossingMinimization.greedySwitch.type", yoe = "org.eclipse.elk.layered.crossingMinimization.greedySwitchHierarchical.type", zoe = "org.eclipse.elk.layered.nodePlacement.strategy", Aoe = "org.eclipse.elk.layered.nodePlacement.favorStraightEdges", Boe = "org.eclipse.elk.layered.nodePlacement.bk.edgeStraightening", Coe = "org.eclipse.elk.layered.nodePlacement.bk.fixedAlignment", Doe = "org.eclipse.elk.layered.nodePlacement.linearSegments.deflectionDampening", Eoe = "org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility", Foe = "org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility.default", Goe = "org.eclipse.elk.layered.edgeRouting.selfLoopDistribution", Hoe = "org.eclipse.elk.layered.edgeRouting.selfLoopOrdering", Ioe = "org.eclipse.elk.layered.edgeRouting.splines.mode", Joe = "org.eclipse.elk.layered.edgeRouting.splines.sloppy.layerSpacingFactor", Koe = "org.eclipse.elk.layered.edgeRouting.polyline.slopedEdgeZoneWidth", Loe = "org.eclipse.elk.layered.spacing.baseValue", Moe = "org.eclipse.elk.layered.spacing.edgeNodeBetweenLayers", Noe = "org.eclipse.elk.layered.spacing.edgeEdgeBetweenLayers", Ooe = "org.eclipse.elk.layered.spacing.nodeNodeBetweenLayers", Poe = "org.eclipse.elk.layered.priority.direction", Qoe = "org.eclipse.elk.layered.priority.shortness", Roe = "org.eclipse.elk.layered.priority.straightness", Soe = "org.eclipse.elk.layered.compaction.connectedComponents", Toe = "org.eclipse.elk.layered.compaction.postCompaction.strategy", Uoe = "org.eclipse.elk.layered.compaction.postCompaction.constraints", Voe = "org.eclipse.elk.layered.highDegreeNodes.treatment", Woe = "org.eclipse.elk.layered.highDegreeNodes.threshold", Xoe = "org.eclipse.elk.layered.highDegreeNodes.treeHeight", Yoe = "org.eclipse.elk.layered.wrapping.strategy", Zoe = "org.eclipse.elk.layered.wrapping.additionalEdgeSpacing", $oe = "org.eclipse.elk.layered.wrapping.correctionFactor", _oe = "org.eclipse.elk.layered.wrapping.cutting.strategy", ape = "org.eclipse.elk.layered.wrapping.cutting.cuts", bpe = "org.eclipse.elk.layered.wrapping.cutting.msd.freedom", cpe = "org.eclipse.elk.layered.wrapping.validify.strategy", dpe = "org.eclipse.elk.layered.wrapping.validify.forbiddenIndices", epe = "org.eclipse.elk.layered.wrapping.multiEdge.improveCuts", fpe = "org.eclipse.elk.layered.wrapping.multiEdge.distancePenalty", gpe = "org.eclipse.elk.layered.wrapping.multiEdge.improveWrappedEdges", hpe = "org.eclipse.elk.layered.edgeLabels.sideSelection", ipe = "org.eclipse.elk.layered.edgeLabels.centerLabelPlacementStrategy", jpe = "org.eclipse.elk.layered.considerModelOrder.strategy", kpe = "org.eclipse.elk.layered.considerModelOrder.noModelOrder", lpe = "org.eclipse.elk.layered.considerModelOrder.components", mpe = "org.eclipse.elk.layered.considerModelOrder.longEdgeStrategy", npe = "org.eclipse.elk.layered.considerModelOrder.crossingCounterNodeInfluence", ope = "org.eclipse.elk.layered.considerModelOrder.crossingCounterPortInfluence", ppe = "layering", qpe = "layering.minWidth", rpe = "layering.nodePromotion", spe = "crossingMinimization", tpe = "org.eclipse.elk.hierarchyHandling", upe = "crossingMinimization.greedySwitch", vpe = "nodePlacement", wpe = "nodePlacement.bk", xpe = "edgeRouting", ype = "org.eclipse.elk.edgeRouting", zpe = "spacing", Ape = "priority", Bpe = "compaction", Cpe = "compaction.postCompaction", Dpe = "Specifies whether and how post-process compaction is applied.", Epe = "highDegreeNodes", Fpe = "wrapping", Gpe = "wrapping.cutting", Hpe = "wrapping.validify", Ipe = "wrapping.multiEdge", Jpe = "edgeLabels", Kpe = "considerModelOrder", Lpe = "org.eclipse.elk.spacing.commentComment", Mpe = "org.eclipse.elk.spacing.commentNode", Npe = "org.eclipse.elk.spacing.edgeEdge", Ope = "org.eclipse.elk.spacing.edgeNode", Ppe = "org.eclipse.elk.spacing.labelLabel", Qpe = "org.eclipse.elk.spacing.labelPortHorizontal", Rpe = "org.eclipse.elk.spacing.labelPortVertical", Spe = "org.eclipse.elk.spacing.labelNode", Tpe = "org.eclipse.elk.spacing.nodeSelfLoop", Upe = "org.eclipse.elk.spacing.portPort", Vpe = "org.eclipse.elk.spacing.individual", Wpe = "org.eclipse.elk.port.borderOffset", Xpe = "org.eclipse.elk.noLayout", Ype = "org.eclipse.elk.port.side", Zpe = "org.eclipse.elk.debugMode", $pe = "org.eclipse.elk.alignment", _pe = "org.eclipse.elk.insideSelfLoops.activate", aqe = "org.eclipse.elk.insideSelfLoops.yo", bqe = "org.eclipse.elk.nodeSize.fixedGraphSize", cqe = "org.eclipse.elk.direction", dqe = "org.eclipse.elk.nodeLabels.padding", eqe = "org.eclipse.elk.portLabels.nextToPortIfPossible", fqe = "org.eclipse.elk.portLabels.treatAsGroup", gqe = "org.eclipse.elk.portAlignment.default", hqe = "org.eclipse.elk.portAlignment.north", iqe = "org.eclipse.elk.portAlignment.south", jqe = "org.eclipse.elk.portAlignment.west", kqe = "org.eclipse.elk.portAlignment.east", lqe = "org.eclipse.elk.contentAlignment", mqe = "org.eclipse.elk.junctionPoints", nqe = "org.eclipse.elk.edgeLabels.placement", oqe = "org.eclipse.elk.port.index", pqe = "org.eclipse.elk.commentBox", qqe = "org.eclipse.elk.hypernode", rqe = "org.eclipse.elk.port.anchor", sqe = "org.eclipse.elk.partitioning.activate", tqe = "org.eclipse.elk.partitioning.partition", uqe = "org.eclipse.elk.position", vqe = "org.eclipse.elk.margins", wqe = "org.eclipse.elk.spacing.portsSurrounding", xqe = "org.eclipse.elk.interactiveLayout", yqe = "org.eclipse.elk.core.util", zqe = { 3: 1, 4: 1, 5: 1, 593: 1 }, Aqe = "NETWORK_SIMPLEX", Bqe = { 123: 1, 51: 1 }, Cqe = "org.eclipse.elk.alg.layered.p1cycles", Dqe = "org.eclipse.elk.alg.layered.p2layers", Eqe = { 402: 1, 225: 1 }, Fqe = { 832: 1, 3: 1, 4: 1 }, Gqe = "org.eclipse.elk.alg.layered.p3order", Hqe = "org.eclipse.elk.alg.layered.p4nodes", Iqe = { 3: 1, 4: 1, 5: 1, 840: 1 }, Jqe = 1e-5, Kqe = "org.eclipse.elk.alg.layered.p4nodes.bk", Lqe = "org.eclipse.elk.alg.layered.p5edges", Mqe = "org.eclipse.elk.alg.layered.p5edges.orthogonal", Nqe = "org.eclipse.elk.alg.layered.p5edges.orthogonal.direction", Oqe = 1e-6, Pqe = "org.eclipse.elk.alg.layered.p5edges.splines", Qqe = 0.09999999999999998, Rqe = 1e-8, Sqe = 4.71238898038469, Tqe = 3.141592653589793, Uqe = "org.eclipse.elk.alg.mrtree", Vqe = "org.eclipse.elk.alg.mrtree.graph", Wqe = "org.eclipse.elk.alg.mrtree.intermediate", Xqe = "Set neighbors in level", Yqe = "DESCENDANTS", Zqe = "org.eclipse.elk.mrtree.weighting", $qe = "org.eclipse.elk.mrtree.searchOrder", _qe = "org.eclipse.elk.alg.mrtree.options", are = "org.eclipse.elk.mrtree", bre = "org.eclipse.elk.tree", cre = "org.eclipse.elk.alg.radial", dre = 6.283185307179586, ere = 5e-324, fre = "org.eclipse.elk.alg.radial.intermediate", gre = "org.eclipse.elk.alg.radial.intermediate.compaction", hre = { 3: 1, 4: 1, 5: 1, 106: 1 }, ire = "org.eclipse.elk.alg.radial.intermediate.optimization", jre = "No implementation is available for the layout option ", kre = "org.eclipse.elk.alg.radial.options", lre = "org.eclipse.elk.radial.orderId", mre = "org.eclipse.elk.radial.radius", nre = "org.eclipse.elk.radial.compactor", ore = "org.eclipse.elk.radial.compactionStepSize", pre = "org.eclipse.elk.radial.sorter", qre = "org.eclipse.elk.radial.wedgeCriteria", rre = "org.eclipse.elk.radial.optimizationCriteria", sre = "org.eclipse.elk.radial", tre = "org.eclipse.elk.alg.radial.p1position.wedge", ure = "org.eclipse.elk.alg.radial.sorting", vre = 5.497787143782138, wre = 3.9269908169872414, xre = 2.356194490192345, yre = "org.eclipse.elk.alg.rectpacking", zre = "org.eclipse.elk.alg.rectpacking.firstiteration", Are = "org.eclipse.elk.alg.rectpacking.options", Bre = "org.eclipse.elk.rectpacking.optimizationGoal", Cre = "org.eclipse.elk.rectpacking.lastPlaceShift", Dre = "org.eclipse.elk.rectpacking.currentPosition", Ere = "org.eclipse.elk.rectpacking.desiredPosition", Fre = "org.eclipse.elk.rectpacking.onlyFirstIteration", Gre = "org.eclipse.elk.rectpacking.rowCompaction", Hre = "org.eclipse.elk.rectpacking.expandToAspectRatio", Ire = "org.eclipse.elk.rectpacking.targetWidth", Jre = "org.eclipse.elk.expandNodes", Kre = "org.eclipse.elk.rectpacking", Lre = "org.eclipse.elk.alg.rectpacking.util", Mre = "No implementation available for ", Nre = "org.eclipse.elk.alg.spore", Ore = "org.eclipse.elk.alg.spore.options", Pre = "org.eclipse.elk.sporeCompaction", Qre = "org.eclipse.elk.underlyingLayoutAlgorithm", Rre = "org.eclipse.elk.processingOrder.treeConstruction", Sre = "org.eclipse.elk.processingOrder.spanningTreeCostFunction", Tre = "org.eclipse.elk.processingOrder.preferredRoot", Ure = "org.eclipse.elk.processingOrder.rootSelection", Vre = "org.eclipse.elk.structure.structureExtractionStrategy", Wre = "org.eclipse.elk.compaction.compactionStrategy", Xre = "org.eclipse.elk.compaction.orthogonal", Yre = "org.eclipse.elk.overlapRemoval.maxIterations", Zre = "org.eclipse.elk.overlapRemoval.runScanline", $re = "processingOrder", _re = "overlapRemoval", ase = "org.eclipse.elk.sporeOverlap", bse = "org.eclipse.elk.alg.spore.p1structure", cse = "org.eclipse.elk.alg.spore.p2processingorder", dse = "org.eclipse.elk.alg.spore.p3execution", ese = "Invalid index: ", fse = "org.eclipse.elk.core.alg", gse = { 331: 1 }, hse = { 288: 1 }, ise = "Make sure its type is registered with the ", jse = " utility class.", kse = "true", lse = "false", mse = "Couldn't clone property '", nse = 0.05, ose = "org.eclipse.elk.core.options", pse = 1.2999999523162842, qse = "org.eclipse.elk.box", rse = "org.eclipse.elk.box.packingMode", sse = "org.eclipse.elk.algorithm", tse = "org.eclipse.elk.resolvedAlgorithm", use = "org.eclipse.elk.bendPoints", vse = "org.eclipse.elk.labelManager", wse = "org.eclipse.elk.scaleFactor", xse = "org.eclipse.elk.animate", yse = "org.eclipse.elk.animTimeFactor", zse = "org.eclipse.elk.layoutAncestors", Ase = "org.eclipse.elk.maxAnimTime", Bse = "org.eclipse.elk.minAnimTime", Cse = "org.eclipse.elk.progressBar", Dse = "org.eclipse.elk.validateGraph", Ese = "org.eclipse.elk.validateOptions", Fse = "org.eclipse.elk.zoomToFit", Gse = "org.eclipse.elk.font.name", Hse = "org.eclipse.elk.font.size", Ise = "org.eclipse.elk.edge.type", Jse = "partitioning", Kse = "nodeLabels", Lse = "portAlignment", Mse = "nodeSize", Nse = "port", Ose = "portLabels", Pse = "insideSelfLoops", Qse = "org.eclipse.elk.fixed", Rse = "org.eclipse.elk.random", Sse = "port must have a parent node to calculate the port side", Tse = "The edge needs to have exactly one edge section. Found: ", Use = "org.eclipse.elk.core.util.adapters", Vse = "org.eclipse.emf.ecore", Wse = "org.eclipse.elk.graph", Xse = "EMapPropertyHolder", Yse = "ElkBendPoint", Zse = "ElkGraphElement", $se = "ElkConnectableShape", _se = "ElkEdge", ate = "ElkEdgeSection", bte = "EModelElement", cte = "ENamedElement", dte = "ElkLabel", ete = "ElkNode", fte = "ElkPort", gte = { 92: 1, 90: 1 }, hte = "org.eclipse.emf.common.notify.impl", ite = "The feature '", jte = "' is not a valid changeable feature", kte = "Expecting null", lte = "' is not a valid feature", mte = "The feature ID", nte = " is not a valid feature ID", ote = 32768, pte = { 105: 1, 92: 1, 90: 1, 56: 1, 49: 1, 97: 1 }, qte = "org.eclipse.emf.ecore.impl", rte = "org.eclipse.elk.graph.impl", ste = "Recursive containment not allowed for ", tte = "The datatype '", ute = "' is not a valid classifier", vte = "The value '", wte = { 190: 1, 3: 1, 4: 1 }, xte = "The class '", yte = "http://www.eclipse.org/elk/ElkGraph", zte = 1024, Ate = "property", Bte = "value", Cte = "source", Dte = "properties", Ete = "identifier", Fte = "height", Gte = "width", Hte = "parent", Ite = "text", Jte = "children", Kte = "hierarchical", Lte = "sources", Mte = "targets", Nte = "sections", Ote = "bendPoints", Pte = "outgoingShape", Qte = "incomingShape", Rte = "outgoingSections", Ste = "incomingSections", Tte = "org.eclipse.emf.common.util", Ute = "Severe implementation error in the Json to ElkGraph importer.", Vte = "id", Wte = "org.eclipse.elk.graph.json", Xte = "Unhandled parameter types: ", Yte = "startPoint", Zte = "An edge must have at least one source and one target (edge id: '", $te = "').", _te = "Referenced edge section does not exist: ", aue = " (edge id: '", bue = "target", cue = "sourcePoint", due = "targetPoint", eue = "group", fue = "name", gue = "connectableShape cannot be null", hue2 = "edge cannot be null", iue = "Passed edge is not 'simple'.", jue = "org.eclipse.elk.graph.util", kue = "The 'no duplicates' constraint is violated", lue = "targetIndex=", mue = ", size=", nue = "sourceIndex=", oue = { 3: 1, 4: 1, 20: 1, 28: 1, 52: 1, 14: 1, 15: 1, 54: 1, 67: 1, 63: 1, 58: 1 }, pue = { 3: 1, 4: 1, 20: 1, 28: 1, 52: 1, 14: 1, 47: 1, 15: 1, 54: 1, 67: 1, 63: 1, 58: 1, 588: 1 }, que = "logging", rue = "measureExecutionTime", sue = "parser.parse.1", tue = "parser.parse.2", uue = "parser.next.1", vue = "parser.next.2", wue = "parser.next.3", xue = "parser.next.4", yue = "parser.factor.1", zue = "parser.factor.2", Aue = "parser.factor.3", Bue = "parser.factor.4", Cue = "parser.factor.5", Due = "parser.factor.6", Eue = "parser.atom.1", Fue = "parser.atom.2", Gue = "parser.atom.3", Hue = "parser.atom.4", Iue = "parser.atom.5", Jue = "parser.cc.1", Kue = "parser.cc.2", Lue = "parser.cc.3", Mue = "parser.cc.5", Nue = "parser.cc.6", Oue = "parser.cc.7", Pue = "parser.cc.8", Que = "parser.ope.1", Rue = "parser.ope.2", Sue = "parser.ope.3", Tue = "parser.descape.1", Uue = "parser.descape.2", Vue = "parser.descape.3", Wue = "parser.descape.4", Xue = "parser.descape.5", Yue = "parser.process.1", Zue = "parser.quantifier.1", $ue = "parser.quantifier.2", _ue = "parser.quantifier.3", ave = "parser.quantifier.4", bve = "parser.quantifier.5", cve = "org.eclipse.emf.common.notify", dve = { 415: 1, 672: 1 }, eve = { 3: 1, 4: 1, 20: 1, 28: 1, 52: 1, 14: 1, 15: 1, 67: 1, 58: 1 }, fve = { 366: 1, 143: 1 }, gve = "index=", hve = { 3: 1, 4: 1, 5: 1, 126: 1 }, ive = { 3: 1, 4: 1, 20: 1, 28: 1, 52: 1, 14: 1, 15: 1, 54: 1, 67: 1, 58: 1 }, jve = { 3: 1, 6: 1, 4: 1, 5: 1, 192: 1 }, kve = { 3: 1, 4: 1, 5: 1, 165: 1, 367: 1 }, lve = ";/?:@&=+$,", mve = "invalid authority: ", nve = "EAnnotation", ove = "ETypedElement", pve = "EStructuralFeature", qve = "EAttribute", rve = "EClassifier", sve = "EEnumLiteral", tve = "EGenericType", uve = "EOperation", vve = "EParameter", wve = "EReference", xve = "ETypeParameter", yve = "org.eclipse.emf.ecore.util", zve = { 76: 1 }, Ave = { 3: 1, 20: 1, 14: 1, 15: 1, 58: 1, 589: 1, 76: 1, 69: 1, 95: 1 }, Bve = "org.eclipse.emf.ecore.util.FeatureMap$Entry", Cve = 8192, Dve = 2048, Eve = "byte", Fve = "char", Gve = "double", Hve = "float", Ive = "int", Jve = "long", Kve = "short", Lve = "java.lang.Object", Mve = { 3: 1, 4: 1, 5: 1, 247: 1 }, Nve = { 3: 1, 4: 1, 5: 1, 673: 1 }, Ove = { 3: 1, 4: 1, 20: 1, 28: 1, 52: 1, 14: 1, 15: 1, 54: 1, 67: 1, 63: 1, 58: 1, 69: 1 }, Pve = { 3: 1, 4: 1, 20: 1, 28: 1, 52: 1, 14: 1, 15: 1, 54: 1, 67: 1, 63: 1, 58: 1, 76: 1, 69: 1, 95: 1 }, Qve = "mixed", Rve = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData", Sve = "kind", Tve = { 3: 1, 4: 1, 5: 1, 674: 1 }, Uve = { 3: 1, 4: 1, 20: 1, 28: 1, 52: 1, 14: 1, 15: 1, 67: 1, 58: 1, 76: 1, 69: 1, 95: 1 }, Vve = { 20: 1, 28: 1, 52: 1, 14: 1, 15: 1, 58: 1, 69: 1 }, Wve = { 47: 1, 125: 1, 279: 1 }, Xve = { 72: 1, 332: 1 }, Yve = "The value of type '", Zve = "' must be of type '", $ve = 1316, _ve = "http://www.eclipse.org/emf/2002/Ecore", awe = -32768, bwe = "constraints", cwe = "baseType", dwe = "getEStructuralFeature", ewe = "getFeatureID", fwe = "feature", gwe = "getOperationID", hwe = "operation", iwe = "defaultValue", jwe = "eTypeParameters", kwe = "isInstance", lwe = "getEEnumLiteral", mwe = "eContainingClass", nwe = { 55: 1 }, owe = { 3: 1, 4: 1, 5: 1, 119: 1 }, pwe = "org.eclipse.emf.ecore.resource", qwe = { 92: 1, 90: 1, 591: 1, 1935: 1 }, rwe = "org.eclipse.emf.ecore.resource.impl", swe = "unspecified", twe = "simple", uwe = "attribute", vwe = "attributeWildcard", wwe = "element", xwe = "elementWildcard", ywe = "collapse", zwe = "itemType", Awe = "namespace", Bwe = "##targetNamespace", Cwe = "whiteSpace", Dwe = "wildcards", Ewe = "http://www.eclipse.org/emf/2003/XMLType", Fwe = "##any", Gwe = "uninitialized", Hwe = "The multiplicity constraint is violated", Iwe = "org.eclipse.emf.ecore.xml.type", Jwe = "ProcessingInstruction", Kwe = "SimpleAnyType", Lwe = "XMLTypeDocumentRoot", Mwe = "org.eclipse.emf.ecore.xml.type.impl", Nwe = "INF", Owe = "processing", Pwe = "ENTITIES_._base", Qwe = "minLength", Rwe = "ENTITY", Swe = "NCName", Twe = "IDREFS_._base", Uwe = "integer", Vwe = "token", Wwe = "pattern", Xwe = "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*", Ywe = "\\i\\c*", Zwe = "[\\i-[:]][\\c-[:]]*", $we = "nonPositiveInteger", _we = "maxInclusive", axe = "NMTOKEN", bxe = "NMTOKENS_._base", cxe = "nonNegativeInteger", dxe = "minInclusive", exe = "normalizedString", fxe = "unsignedByte", gxe = "unsignedInt", hxe = "18446744073709551615", ixe = "unsignedShort", jxe = "processingInstruction", kxe = "org.eclipse.emf.ecore.xml.type.internal", lxe = 1114111, mxe = "Internal Error: shorthands: \\u", nxe = "xml:isDigit", oxe = "xml:isWord", pxe = "xml:isSpace", qxe = "xml:isNameChar", rxe = "xml:isInitialNameChar", sxe = "09٠٩۰۹०९০৯੦੯૦૯୦୯௧௯౦౯೦೯൦൯๐๙໐໙༠༩", txe = "AZazÀÖØöøıĴľŁňŊžƀǃǍǰǴǵǺȗɐʨʻˁΆΆΈΊΌΌΎΡΣώϐϖϚϚϜϜϞϞϠϠϢϳЁЌЎяёќўҁҐӄӇӈӋӌӐӫӮӵӸӹԱՖՙՙաֆאתװײءغفيٱڷںھۀێېۓەەۥۦअहऽऽक़ॡঅঌএঐওনপরললশহড়ঢ়য়ৡৰৱਅਊਏਐਓਨਪਰਲਲ਼ਵਸ਼ਸਹਖ਼ੜਫ਼ਫ਼ੲੴઅઋઍઍએઑઓનપરલળવહઽઽૠૠଅଌଏଐଓନପରଲଳଶହଽଽଡ଼ଢ଼ୟୡஅஊஎஐஒகஙசஜஜஞடணதநபமவஷஹఅఌఎఐఒనపళవహౠౡಅಌಎಐಒನಪಳವಹೞೞೠೡഅഌഎഐഒനപഹൠൡกฮะะาำเๅກຂຄຄງຈຊຊຍຍດທນຟມຣລລວວສຫອຮະະາຳຽຽເໄཀཇཉཀྵႠჅაჶᄀᄀᄂᄃᄅᄇᄉᄉᄋᄌᄎᄒᄼᄼᄾᄾᅀᅀᅌᅌᅎᅎᅐᅐᅔᅕᅙᅙᅟᅡᅣᅣᅥᅥᅧᅧᅩᅩᅭᅮᅲᅳᅵᅵᆞᆞᆨᆨᆫᆫᆮᆯᆷᆸᆺᆺᆼᇂᇫᇫᇰᇰᇹᇹḀẛẠỹἀἕἘἝἠὅὈὍὐὗὙὙὛὛὝὝὟώᾀᾴᾶᾼιιῂῄῆῌῐΐῖΊῠῬῲῴῶῼΩΩKÅ℮℮ↀↂ〇〇〡〩ぁゔァヺㄅㄬ一龥가힣", uxe = "Private Use", vxe = "ASSIGNED", wxe = "\0€ÿĀſƀɏɐʯʰ˿̀ͯͰϿЀӿ԰֏֐׿؀ۿ܀ݏހ޿ऀॿঀ৿਀੿઀૿଀୿஀௿ఀ౿ಀ೿ഀൿ඀෿฀๿຀໿ༀ࿿က႟Ⴀჿᄀᇿሀ፿Ꭰ᏿᐀ᙿ ᚟ᚠ᛿ក៿᠀᢯Ḁỿἀ῿ ⁰₟₠⃏⃐⃿℀⅏⅐↏←⇿∀⋿⌀⏿␀␿⑀⑟①⓿─╿▀▟■◿☀⛿✀➿⠀⣿⺀⻿⼀⿟⿰⿿ 〿぀ゟ゠ヿ㄀ㄯ㄰㆏㆐㆟ㆠㆿ㈀㋿㌀㏿㐀䶵一鿿ꀀ꒏꒐꓏가힣豈﫿ffﭏﭐ﷿︠︯︰﹏﹐﹯ﹰ﻾\uFEFF\uFEFF＀￯", xxe = "UNASSIGNED", yxe = { 3: 1, 117: 1 }, zxe = "org.eclipse.emf.ecore.xml.type.util", Axe = { 3: 1, 4: 1, 5: 1, 368: 1 }, Bxe = "org.eclipse.xtext.xbase.lib", Cxe = "Cannot add elements to a Range", Dxe = "Cannot set elements in a Range", Exe = "Cannot remove elements from a Range", Fxe = "locale", Gxe = "default", Hxe = "user.agent"; - var _2, _bb, Wbb; - $wnd.goog = $wnd.goog || {}; - $wnd.goog.global = $wnd.goog.global || $wnd; - acb(); - bcb(1, null, {}, nb); - _2.Fb = function ob(a) { - return mb(this, a); - }; - _2.Gb = function qb() { - return this.gm; - }; - _2.Hb = function sb() { - return FCb(this); - }; - _2.Ib = function ub() { - var a; - return hdb(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 xD, yD, zD; - bcb(290, 1, { 290: 1, 2026: 1 }, jdb); - _2.le = function kdb(a) { - var b; - b = new jdb(); - b.i = 4; - a > 1 ? b.c = rdb(this, a - 1) : b.c = this; - return b; - }; - _2.me = function qdb() { - fdb(this); - return this.b; - }; - _2.ne = function sdb() { - return hdb(this); - }; - _2.oe = function udb() { - return fdb(this), this.k; - }; - _2.pe = function wdb() { - return (this.i & 4) != 0; - }; - _2.qe = function xdb() { - return (this.i & 1) != 0; - }; - _2.Ib = function Adb() { - return idb(this); - }; - _2.i = 0; - var SI = mdb(Phe, "Object", 1); - var AI = mdb(Phe, "Class", 290); - bcb(1998, 1, Qhe); - mdb(Rhe, "Optional", 1998); - bcb(1170, 1998, Qhe, 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; + if (string(node3)) { + node3 = cy.filter(node3); + } + return outdegrees[node3.id()] / maxOutdegree; + }, "outdegree") }; - var vb; - mdb(Rhe, "Absent", 1170); - bcb(628, 1, {}, Gb); - mdb(Rhe, "Joiner", 628); - var _D = odb(Rhe, "Predicate"); - bcb(582, 1, { 169: 1, 582: 1, 3: 1, 45: 1 }, Yb); - _2.Mb = function ac(a) { - return Xb(this, a); + } + }, "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]); + } + return { + degree: Math.pow(k2, 1 - alpha) * Math.pow(s2, alpha) }; - _2.Lb = function Zb(a) { - return Xb(this, a); + } 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]); + } + for (var _i3 = 0; _i3 < outgoing.length; _i3++) { + s_out += weight8(outgoing[_i3]); + } + 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) }; - _2.Fb = function $b(a) { - var b; - if (JD(a, 582)) { - b = BD(a, 582); - return At(this.a, b.a); + } + }, "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; + } } - return false; - }; - _2.Hb = function _b() { - return qmb(this.a) + 306654252; - }; - _2.Ib = function bc() { - return Wb(this.a); - }; - mdb(Rhe, "Predicates/AndPredicate", 582); - bcb(408, 1998, { 408: 1, 3: 1 }, cc); - _2.Fb = function dc(a) { - var b; - if (JD(a, 408)) { - b = BD(a, 408); - return pb(this.a, b.a); + } + if (!harmonic) { + currCloseness = 1 / currCloseness; + } + if (maxCloseness < currCloseness) { + maxCloseness = currCloseness; + } + closenesses[node_i.id()] = currCloseness; + } + return { + closeness: /* @__PURE__ */ __name(function closeness(node2) { + if (maxCloseness == 0) { + return 0; } - return false; - }; - _2.Hb = function ec() { - return 1502476572 + tb(this.a); - }; - _2.Ib = function fc() { - return Whe + 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.")); - }; - mdb(Rhe, "Present", 408); - bcb(198, 1, Yhe); - _2.Nb = function kc(a) { - Rrb(this, a); - }; - _2.Qb = function lc() { - jc(); - }; - mdb(Zhe, "UnmodifiableIterator", 198); - bcb(1978, 198, $he); - _2.Qb = function nc() { - jc(); - }; - _2.Rb = function mc(a) { - throw vbb(new bgb()); - }; - _2.Wb = function oc(a) { - throw vbb(new bgb()); - }; - mdb(Zhe, "UnmodifiableListIterator", 1978); - bcb(386, 1978, $he); - _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 vbb(new utb()); + if (string(node2)) { + node2 = cy.filter(node2)[0].id(); + } else { + node2 = node2.id(); } - return this.Xb(this.c++); - }; - _2.Tb = function uc() { - return this.c; - }; - _2.Ub = function vc() { - if (this.c <= 0) { - throw vbb(new utb()); + 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 { + totalDistance += d2; } - return this.Xb(--this.c); - }; - _2.Vb = function wc() { - return this.c - 1; - }; - _2.c = 0; - _2.d = 0; - mdb(Zhe, "AbstractIndexedListIterator", 386); - bcb(699, 198, Yhe); - _2.Ob = function Ac() { - return xc(this); - }; - _2.Pb = function Bc() { - return yc(this); - }; - _2.e = 1; - mdb(Zhe, "AbstractIterator", 699); - bcb(1986, 1, { 224: 1 }); - _2.Zb = function Hc() { - var a; - return a = this.f, !a ? this.f = this.ac() : a; - }; - _2.Fb = function Ic(a) { - return hw(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 fcb(this.Zb()); - }; - mdb(Zhe, "AbstractMultimap", 1986); - bcb(726, 1986, _he); - _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 Yj(this.c.vc().Nc(), new $g(), 64, this.d); - }; - _2.cc = function dd(a) { - return Qc(this, a); - }; - _2.fc = function gd(a) { - return Sc(this, a); - }; - _2.gc = function hd() { - return this.d; - }; - _2.mc = function jd(a) { - return mmb(), new lnb(a); - }; - _2.nc = function kd() { - return new Dd(this); - }; - _2.oc = function ld() { - return Yj(this.c.Cc().Nc(), new Fd(), 64, this.d); - }; - _2.pc = function md(a, b) { - return new dg(this, a, b, null); - }; - _2.d = 0; - mdb(Zhe, "AbstractMapBasedMultimap", 726); - bcb(1631, 726, _he); - _2.hc = function pd() { - return new Skb(this.a); - }; - _2.jc = function qd() { - return mmb(), mmb(), jmb; - }; - _2.cc = function sd(a) { - return BD(Qc(this, a), 15); - }; - _2.fc = function ud(a) { - return BD(Sc(this, a), 15); - }; - _2.Zb = function od() { - return nd(this); - }; - _2.Fb = function rd(a) { - return hw(this, a); - }; - _2.qc = function td(a) { - return BD(Qc(this, a), 15); - }; - _2.rc = function vd(a) { - return BD(Sc(this, a), 15); - }; - _2.mc = function wd(a) { - return vmb(BD(a, 15)); - }; - _2.pc = function xd(a, b) { - return Vc(this, a, BD(b, 15), null); - }; - mdb(Zhe, "AbstractListMultimap", 1631); - bcb(732, 1, aie); - _2.Nb = function zd(a) { - Rrb(this, a); - }; - _2.Ob = function Ad() { - return this.c.Ob() || this.e.Ob(); - }; - _2.Pb = function Bd() { - var a; - if (!this.e.Ob()) { - a = BD(this.c.Pb(), 42); - this.b = a.cd(); - this.a = BD(a.dd(), 14); - this.e = this.a.Kc(); - } - return this.sc(this.b, this.e.Pb()); - }; - _2.Qb = function Cd() { - this.e.Qb(); - this.a.dc() && this.c.Qb(); - --this.d.d; - }; - mdb(Zhe, "AbstractMapBasedMultimap/Itr", 732); - bcb(1099, 732, aie, Dd); - _2.sc = function Ed(a, b) { - return b; - }; - mdb(Zhe, "AbstractMapBasedMultimap/1", 1099); - bcb(1100, 1, {}, Fd); - _2.Kb = function Gd(a) { - return BD(a, 14).Nc(); - }; - mdb(Zhe, "AbstractMapBasedMultimap/1methodref$spliterator$Type", 1100); - bcb(1101, 732, aie, Hd); - _2.sc = function Id(a, b) { - return new Wo(a, b); - }; - mdb(Zhe, "AbstractMapBasedMultimap/2", 1101); - var DK = odb(bie, "Map"); - bcb(1967, 1, cie); - _2.wc = function Td(a) { - stb(this, a); - }; - _2.yc = function $d(a, b, c2) { - return ttb(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 = BD(c2.Pb(), 42); - d = b.dd(); - if (PD(a) === PD(d) || a != null && pb(a, d)) { - return true; - } + } + } + 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; } - return false; - }; - _2.Fb = function Sd(a) { - var b, c2, d; - if (a === this) { - return true; + }, "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); + } + } + } else { + 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); + } + } } - if (!JD(a, 83)) { - return false; + } + var e3 = {}; + for (var _i2 = 0; _i2 < V2.length; _i2++) { + e3[V2[_i2].id()] = 0; + } + 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]); } - d = BD(a, 83); - if (this.gc() != d.gc()) { - return false; + if (_w2 != V2[s3].id()) { + C2.set(_w2, C2.get(_w2) + e3[_w2]); } - for (c2 = d.vc().Kc(); c2.Ob(); ) { - b = BD(c2.Pb(), 42); - if (!this.tc(b)) { - return false; - } - } - return true; - }; - _2.xc = function Ud(a) { - return Wd(Kd(this, a, false)); - }; - _2.Hb = function Xd() { - return pmb(this.vc()); - }; - _2.dc = function Yd() { - return this.gc() == 0; - }; - _2.ec = function Zd() { - return new Pib(this); - }; - _2.zc = function _d(a, b) { - throw vbb(new cgb("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 $ib(this); - }; - mdb(bie, "AbstractMap", 1967); - bcb(1987, 1967, cie); - _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 Zv(this) : a; - }; - mdb(Zhe, "Maps/ViewCachingAbstractMap", 1987); - bcb(389, 1987, cie, 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() : ir(new mf(this)); - }; - _2._b = function pe(a) { - return Gv(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 fcb(this.d); - }; - mdb(Zhe, "AbstractMapBasedMultimap/AsMap", 389); - var KI = odb(Phe, "Iterable"); - bcb(28, 1, die); - _2.Jc = function Le(a) { - reb(this, a); - }; - _2.Lc = function Ne() { - return this.Oc(); - }; - _2.Nc = function Pe() { - return new Kub(this, 0); - }; - _2.Oc = function Qe() { - return new YAb(null, this.Nc()); - }; - _2.Fc = function Ge(a) { - throw vbb(new cgb("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); - }; - mdb(bie, "AbstractCollection", 28); - var LK = odb(bie, "Set"); - bcb(eie, 28, fie); - _2.Nc = function Ye() { - return new Kub(this, 1); - }; - _2.Fb = function We(a) { - return Ue(this, a); - }; - _2.Hb = function Xe() { - return pmb(this); - }; - mdb(bie, "AbstractSet", eie); - bcb(1970, eie, fie); - mdb(Zhe, "Sets/ImprovedAbstractSet", 1970); - bcb(1971, 1970, fie); - _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)) { - b = BD(a, 42); - return this.Rc().ec().Mc(b.cd()); - } - return false; - }; - _2.gc = function cf() { - return this.Rc().gc(); - }; - mdb(Zhe, "Maps/EntrySet", 1971); - bcb(1097, 1971, fie, df); - _2.Hc = function ef(a) { - return Ck(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 (!Ck(this.a.d.vc(), a)) { - return false; - } - b = BD(a, 42); - Tc(this.a.e, b.cd()); - return true; - }; - _2.Nc = function jf() { - return $j(this.a.d.vc().Nc(), new kf(this.a)); - }; - mdb(Zhe, "AbstractMapBasedMultimap/AsMap/AsMapEntries", 1097); - bcb(1098, 1, {}, kf); - _2.Kb = function lf(a) { - return me(this.a, BD(a, 42)); - }; - mdb(Zhe, "AbstractMapBasedMultimap/AsMap/AsMapEntries/0methodref$wrapEntry$Type", 1098); - bcb(730, 1, aie, mf); - _2.Nb = function nf(a) { - Rrb(this, a); - }; - _2.Pb = function pf() { - var a; - return a = BD(this.b.Pb(), 42), this.a = BD(a.dd(), 14), 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; - }; - mdb(Zhe, "AbstractMapBasedMultimap/AsMap/AsMapIterator", 730); - bcb(532, 1970, fie, 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 Xv(a)); - }; - _2.dc = function vf() { - return this.b.dc(); - }; - _2.Kc = function wf() { - return new Mv(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(); - }; - mdb(Zhe, "Maps/KeySet", 532); - bcb(318, 532, fie, zf); - _2.$b = function Af() { - var a; - ir((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 = BD(this.b.Bc(a), 14); - if (b) { - c2 = b.gc(); - b.$b(); - this.a.d -= c2; - } - return c2 > 0; - }; - _2.Nc = function Gf() { - return this.b.ec().Nc(); - }; - mdb(Zhe, "AbstractMapBasedMultimap/KeySet", 318); - bcb(731, 1, aie, Hf); - _2.Nb = function If(a) { - Rrb(this, a); - }; - _2.Ob = function Jf() { - return this.c.Ob(); - }; - _2.Pb = function Kf() { - this.a = BD(this.c.Pb(), 42); - return this.a.cd(); - }; - _2.Qb = function Lf() { - var a; - Vb(!!this.a); - a = BD(this.a.dd(), 14); - this.c.Qb(); - this.b.a.d -= a.gc(); - a.$b(); - this.a = null; - }; - mdb(Zhe, "AbstractMapBasedMultimap/KeySet/1", 731); - bcb(491, 389, { 83: 1, 161: 1 }, Mf); - _2.bc = function Nf() { - return this.Sc(); - }; - _2.ec = function Pf() { - return this.Tc(); - }; - _2.Sc = function Of() { - return new Yf(this.c, this.Uc()); - }; - _2.Tc = function Qf() { - var a; - return a = this.b, !a ? this.b = this.Sc() : a; - }; - _2.Uc = function Rf() { - return BD(this.d, 161); - }; - mdb(Zhe, "AbstractMapBasedMultimap/SortedAsMap", 491); - bcb(542, 491, gie, Sf); - _2.bc = function Tf() { - return new $f(this.a, BD(BD(this.d, 161), 171)); - }; - _2.Sc = function Uf() { - return new $f(this.a, BD(BD(this.d, 161), 171)); - }; - _2.ec = function Vf() { - var a; - return a = this.b, BD(!a ? this.b = new $f(this.a, BD(BD(this.d, 161), 171)) : a, 271); - }; - _2.Tc = function Wf() { - var a; - return a = this.b, BD(!a ? this.b = new $f(this.a, BD(BD(this.d, 161), 171)) : a, 271); - }; - _2.Uc = function Xf() { - return BD(BD(this.d, 161), 171); - }; - mdb(Zhe, "AbstractMapBasedMultimap/NavigableAsMap", 542); - bcb(490, 318, hie, Yf); - _2.Nc = function Zf() { - return this.b.ec().Nc(); - }; - mdb(Zhe, "AbstractMapBasedMultimap/SortedKeySet", 490); - bcb(388, 490, iie, $f); - mdb(Zhe, "AbstractMapBasedMultimap/NavigableKeySet", 388); - bcb(541, 28, die, dg); - _2.Fc = function eg(a) { - var b, c2; - ag(this); - c2 = this.d.dc(); - b = this.d.Fc(a); - if (b) { - ++this.f.d; - c2 && _f(this); - } - return b; - }; - _2.Gc = function fg(a) { - var b, c2, d; - if (a.dc()) { - return false; - } - d = (ag(this), this.d.gc()); - b = this.d.Gc(a); - if (b) { - c2 = this.d.gc(); - this.f.d += c2 - d; - d == 0 && _f(this); - } - return b; - }; - _2.$b = function gg() { - var a; - a = (ag(this), this.d.gc()); - if (a == 0) { - return; - } - this.d.$b(); - this.f.d -= a; - bg(this); - }; - _2.Hc = function hg(a) { - ag(this); - return this.d.Hc(a); - }; - _2.Ic = function ig(a) { - ag(this); - return this.d.Ic(a); - }; - _2.Fb = function jg(a) { - if (a === this) { - return true; - } - ag(this); - return pb(this.d, a); - }; - _2.Hb = function kg() { - ag(this); - return tb(this.d); - }; - _2.Kc = function lg() { - ag(this); - return new Gg(this); - }; - _2.Mc = function mg(a) { - var b; - ag(this); - b = this.d.Mc(a); - if (b) { - --this.f.d; - bg(this); - } - return b; - }; - _2.gc = function ng() { - return cg(this); - }; - _2.Nc = function og() { - return ag(this), this.d.Nc(); - }; - _2.Ib = function pg() { - ag(this); - return fcb(this.d); - }; - mdb(Zhe, "AbstractMapBasedMultimap/WrappedCollection", 541); - var yK = odb(bie, "List"); - bcb(728, 541, { 20: 1, 28: 1, 14: 1, 15: 1 }, qg); - _2.ad = function zg(a) { - ktb(this, a); - }; - _2.Nc = function Ag() { - return ag(this), this.d.Nc(); - }; - _2.Vc = function rg(a, b) { - var c2; - ag(this); - c2 = this.d.dc(); - BD(this.d, 15).Vc(a, b); - ++this.a.d; - c2 && _f(this); - }; - _2.Wc = function sg(a, b) { - var c2, d, e; - if (b.dc()) { - return false; - } - e = (ag(this), this.d.gc()); - c2 = BD(this.d, 15).Wc(a, b); - if (c2) { - d = this.d.gc(); - this.a.d += d - e; - e == 0 && _f(this); - } - return c2; - }; - _2.Xb = function tg(a) { - ag(this); - return BD(this.d, 15).Xb(a); - }; - _2.Xc = function ug(a) { - ag(this); - return BD(this.d, 15).Xc(a); - }; - _2.Yc = function vg() { - ag(this); - return new Mg(this); - }; - _2.Zc = function wg(a) { - ag(this); - return new Ng(this, a); - }; - _2.$c = function xg(a) { - var b; - ag(this); - b = BD(this.d, 15).$c(a); - --this.a.d; - bg(this); - return b; - }; - _2._c = function yg(a, b) { - ag(this); - return BD(this.d, 15)._c(a, b); - }; - _2.bd = function Bg(a, b) { - ag(this); - return Vc(this.a, this.e, BD(this.d, 15).bd(a, b), !this.b ? this : this.b); - }; - mdb(Zhe, "AbstractMapBasedMultimap/WrappedList", 728); - bcb(1096, 728, { 20: 1, 28: 1, 14: 1, 15: 1, 54: 1 }, Cg); - mdb(Zhe, "AbstractMapBasedMultimap/RandomAccessWrappedList", 1096); - bcb(620, 1, aie, Gg); - _2.Nb = function Ig(a) { - Rrb(this, a); - }; - _2.Ob = function Jg() { - Fg(this); - return this.b.Ob(); - }; - _2.Pb = function Kg() { - Fg(this); - return this.b.Pb(); - }; - _2.Qb = function Lg() { - Eg(this); - }; - mdb(Zhe, "AbstractMapBasedMultimap/WrappedCollection/WrappedIterator", 620); - bcb(729, 620, jie, Mg, Ng); - _2.Qb = function Tg() { - Eg(this); - }; - _2.Rb = function Og(a) { - var b; - b = cg(this.a) == 0; - (Fg(this), BD(this.b, 125)).Rb(a); - ++this.a.a.d; - b && _f(this.a); - }; - _2.Sb = function Pg() { - return (Fg(this), BD(this.b, 125)).Sb(); - }; - _2.Tb = function Qg() { - return (Fg(this), BD(this.b, 125)).Tb(); - }; - _2.Ub = function Rg() { - return (Fg(this), BD(this.b, 125)).Ub(); - }; - _2.Vb = function Sg() { - return (Fg(this), BD(this.b, 125)).Vb(); - }; - _2.Wb = function Ug(a) { - (Fg(this), BD(this.b, 125)).Wb(a); - }; - mdb(Zhe, "AbstractMapBasedMultimap/WrappedList/WrappedListIterator", 729); - bcb(727, 541, hie, Vg); - _2.Nc = function Wg() { - return ag(this), this.d.Nc(); - }; - mdb(Zhe, "AbstractMapBasedMultimap/WrappedSortedSet", 727); - bcb(1095, 727, iie, Xg); - mdb(Zhe, "AbstractMapBasedMultimap/WrappedNavigableSet", 1095); - bcb(1094, 541, fie, Yg); - _2.Nc = function Zg() { - return ag(this), this.d.Nc(); - }; - mdb(Zhe, "AbstractMapBasedMultimap/WrappedSet", 1094); - bcb(1103, 1, {}, $g); - _2.Kb = function _g(a) { - return fd(BD(a, 42)); - }; - mdb(Zhe, "AbstractMapBasedMultimap/lambda$1$Type", 1103); - bcb(1102, 1, {}, ah); - _2.Kb = function bh(a) { - return new Wo(this.a, a); - }; - mdb(Zhe, "AbstractMapBasedMultimap/lambda$2$Type", 1102); - var CK = odb(bie, "Map/Entry"); - bcb(345, 1, kie); - _2.Fb = function dh(a) { - var b; - if (JD(a, 42)) { - b = BD(a, 42); - return Hb(this.cd(), b.cd()) && Hb(this.dd(), b.dd()); - } - return false; - }; - _2.Hb = function eh() { - var a, b; - a = this.cd(); - b = this.dd(); - return (a == null ? 0 : tb(a)) ^ (b == null ? 0 : tb(b)); - }; - _2.ed = function fh(a) { - throw vbb(new bgb()); - }; - _2.Ib = function gh() { - return this.cd() + "=" + this.dd(); - }; - mdb(Zhe, lie, 345); - bcb(1988, 28, die); - _2.$b = function hh() { - this.fd().$b(); - }; - _2.Hc = function ih(a) { - var b; - if (JD(a, 42)) { - b = BD(a, 42); - return Cc(this.fd(), b.cd(), b.dd()); + } + }, "_loop"); + for (var s2 = 0; s2 < V2.length; s2++) { + _loop(s2); + } + var ret = { + betweenness: /* @__PURE__ */ __name(function betweenness(node2) { + var id27 = cy.collection(node2).id(); + return C2.get(id27); + }, "betweenness"), + betweennessNormalized: /* @__PURE__ */ __name(function betweennessNormalized(node2) { + if (max10 == 0) { + return 0; } + var id27 = cy.collection(node2).id(); + return C2.get(id27) / 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]; + } + } + } + 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]); + } + } + 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); + } + } + } + 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; - }; - _2.Mc = function jh(a) { - var b; - if (JD(a, 42)) { - b = BD(a, 42); - return Gc(this.fd(), b.cd(), b.dd()); + } + } + } + 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)]; + } + 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; + } + 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; } - return false; - }; - _2.gc = function kh() { - return this.fd().d; - }; - mdb(Zhe, "Multimaps/Entries", 1988); - bcb(733, 1988, die, lh); - _2.Kc = function mh() { - return this.a.kc(); - }; - _2.fd = function nh() { - return this.a; - }; - _2.Nc = function oh() { - return this.a.lc(); - }; - mdb(Zhe, "AbstractMultimap/Entries", 733); - bcb(734, 733, fie, ph); - _2.Nc = function sh() { - return this.a.lc(); - }; - _2.Fb = function qh(a) { - return Ax(this, a); - }; - _2.Hb = function rh() { - return Bx(this); - }; - mdb(Zhe, "AbstractMultimap/EntrySet", 734); - bcb(735, 28, die, th); - _2.$b = function uh() { - this.a.$b(); - }; - _2.Hc = function vh(a) { - return Dc(this.a, a); - }; - _2.Kc = function wh() { - return this.a.nc(); - }; - _2.gc = function xh() { - return this.a.d; - }; - _2.Nc = function yh() { - return this.a.oc(); - }; - mdb(Zhe, "AbstractMultimap/Values", 735); - bcb(1989, 28, { 835: 1, 20: 1, 28: 1, 14: 1 }); - _2.Jc = function Gh(a) { - Qb(a); - Ah(this).Jc(new Xw(a)); - }; - _2.Nc = function Kh() { - var a; - return a = Ah(this).Nc(), Yj(a, new cx(), 64 | a.qd() & 1296, this.a.d); - }; - _2.Fc = function Ch(a) { - zh(); - return true; - }; - _2.Gc = function Dh(a) { - return Qb(this), Qb(a), JD(a, 543) ? Zw(BD(a, 835)) : !a.dc() && fr(this, a.Kc()); - }; - _2.Hc = function Eh(a) { - var b; - return b = BD(Hv(nd(this.a), a), 14), (!b ? 0 : b.gc()) > 0; - }; - _2.Fb = function Fh(a) { - return $w(this, a); - }; - _2.Hb = function Hh() { - return tb(Ah(this)); - }; - _2.dc = function Ih() { - return Ah(this).dc(); - }; - _2.Mc = function Jh(a) { - return Bw(this, a, 1) > 0; - }; - _2.Ib = function Lh() { - return fcb(Ah(this)); - }; - mdb(Zhe, "AbstractMultiset", 1989); - bcb(1991, 1970, fie); - _2.$b = function Mh() { - Nc(this.a.a); - }; - _2.Hc = function Nh(a) { - var b, c2; - if (JD(a, 492)) { - c2 = BD(a, 416); - if (BD(c2.a.dd(), 14).gc() <= 0) { - return false; - } - b = Aw(this.a, c2.a.cd()); - return b == BD(c2.a.dd(), 14).gc(); + } + 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; + } + 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 false; - }; - _2.Mc = function Oh(a) { - var b, c2, d, e; - if (JD(a, 492)) { - c2 = BD(a, 416); - b = c2.a.cd(); - d = BD(c2.a.dd(), 14).gc(); - if (d != 0) { - e = this.a; - return ax(e, b, d); - } + } + 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]; + } + 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); + } + 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; + } + } + 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]; + } + } 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]; + } + } 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 false; - }; - mdb(Zhe, "Multisets/EntrySet", 1991); - bcb(1109, 1991, fie, Ph); - _2.Kc = function Qh() { - return new Lw(fe(nd(this.a.a)).Kc()); - }; - _2.gc = function Rh() { - return nd(this.a.a).gc(); - }; - mdb(Zhe, "AbstractMultiset/EntrySet", 1109); - bcb(619, 726, _he); - _2.hc = function Uh() { - return this.gd(); - }; - _2.jc = function Vh() { - return this.hd(); - }; - _2.cc = function Yh(a) { - return this.jd(a); - }; - _2.fc = function $h(a) { - return this.kd(a); - }; - _2.Zb = function Th() { - var a; - return a = this.f, !a ? this.f = this.ac() : a; - }; - _2.hd = function Wh() { - return mmb(), mmb(), lmb; - }; - _2.Fb = function Xh(a) { - return hw(this, a); - }; - _2.jd = function Zh(a) { - return BD(Qc(this, a), 21); - }; - _2.kd = function _h(a) { - return BD(Sc(this, a), 21); - }; - _2.mc = function ai(a) { - return mmb(), new zob(BD(a, 21)); - }; - _2.pc = function bi(a, b) { - return new Yg(this, a, BD(b, 21)); - }; - mdb(Zhe, "AbstractSetMultimap", 619); - bcb(1657, 619, _he); - _2.hc = function ei() { - return new Hxb(this.b); - }; - _2.gd = function fi() { - return new Hxb(this.b); - }; - _2.jc = function gi() { - return Ix(new Hxb(this.b)); - }; - _2.hd = function hi() { - return Ix(new Hxb(this.b)); - }; - _2.cc = function ii(a) { - return BD(BD(Qc(this, a), 21), 84); - }; - _2.jd = function ji(a) { - return BD(BD(Qc(this, a), 21), 84); - }; - _2.fc = function ki(a) { - return BD(BD(Sc(this, a), 21), 84); - }; - _2.kd = function li(a) { - return BD(BD(Sc(this, a), 21), 84); - }; - _2.mc = function mi(a) { - return JD(a, 271) ? Ix(BD(a, 271)) : (mmb(), new Zob(BD(a, 84))); - }; - _2.Zb = function di() { - var a; - return a = this.f, !a ? this.f = JD(this.c, 171) ? new Sf(this, BD(this.c, 171)) : JD(this.c, 161) ? new Mf(this, BD(this.c, 161)) : new ne(this, this.c) : a; - }; - _2.pc = function ni(a, b) { - return JD(b, 271) ? new Xg(this, a, BD(b, 271)) : new Vg(this, a, BD(b, 84)); - }; - mdb(Zhe, "AbstractSortedSetMultimap", 1657); - bcb(1658, 1657, _he); - _2.Zb = function pi2() { - var a; - return a = this.f, BD(BD(!a ? this.f = JD(this.c, 171) ? new Sf(this, BD(this.c, 171)) : JD(this.c, 161) ? new Mf(this, BD(this.c, 161)) : new ne(this, this.c) : a, 161), 171); - }; - _2.ec = function ri() { - var a; - return a = this.i, BD(BD(!a ? this.i = JD(this.c, 171) ? new $f(this, BD(this.c, 171)) : JD(this.c, 161) ? new Yf(this, BD(this.c, 161)) : new zf(this, this.c) : a, 84), 271); - }; - _2.bc = function qi() { - return JD(this.c, 171) ? new $f(this, BD(this.c, 171)) : JD(this.c, 161) ? new Yf(this, BD(this.c, 161)) : new zf(this, this.c); - }; - mdb(Zhe, "AbstractSortedKeySortedSetMultimap", 1658); - bcb(2010, 1, { 1947: 1 }); - _2.Fb = function si(a) { - return zy(this, a); - }; - _2.Hb = function ti() { - var a; - return pmb((a = this.g, !a ? this.g = new vi(this) : a)); - }; - _2.Ib = function ui() { - var a; - return Md((a = this.f, !a ? this.f = new Rj(this) : a)); - }; - mdb(Zhe, "AbstractTable", 2010); - bcb(665, eie, fie, vi); - _2.$b = function wi() { - Pi(); - }; - _2.Hc = function xi(a) { - var b, c2; - if (JD(a, 468)) { - b = BD(a, 682); - c2 = BD(Hv(Vi(this.a), Em(b.c.e, b.b)), 83); - return !!c2 && Ck(c2.vc(), new Wo(Em(b.c.c, b.a), Mi(b.c, b.b, b.a))); + } + 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 + } + }); + 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 (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]); + } + dists[i2][j2] = dist3; + dists[j2][i2] = dist3; + if (dist3 < dists[i2][mins[i2]]) { + mins[i2] = j2; + } + } + } + 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]; + } + } + 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); + } + } + 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]]; + } + if (sum2 > maxSum) { + maxI = i2; + maxSum = sum2; + } + } + 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; } - return false; - }; - _2.Kc = function yi() { - return Ni(this.a); - }; - _2.Mc = function zi(a) { - var b, c2; - if (JD(a, 468)) { - b = BD(a, 682); - c2 = BD(Hv(Vi(this.a), Em(b.c.e, b.b)), 83); - return !!c2 && Dk(c2.vc(), new Wo(Em(b.c.c, b.a), Mi(b.c, b.b, b.a))); + } + for (var _j2 = 0; _j2 < n2; _j2++) { + R2[_i8 * n2 + _j2] = (1 - opts.damping) * (S3[_i8 * n2 + _j2] - max10) + opts.damping * old[_j2]; + } + 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]; + } + 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]; + } + 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 false; - }; - _2.gc = function Ai() { - return Xi(this.a); - }; - _2.Nc = function Bi() { - return Oi(this.a); - }; - mdb(Zhe, "AbstractTable/CellSet", 665); - bcb(1928, 28, die, Ci); - _2.$b = function Di() { - Pi(); - }; - _2.Hc = function Ei(a) { - return Qi(this.a, a); - }; - _2.Kc = function Fi() { - return Zi(this.a); - }; - _2.gc = function Gi() { - return Xi(this.a); - }; - _2.Nc = function Hi() { - return $i(this.a); - }; - mdb(Zhe, "AbstractTable/Values", 1928); - bcb(1632, 1631, _he); - mdb(Zhe, "ArrayListMultimapGwtSerializationDependencies", 1632); - bcb(513, 1632, _he, Ji, Ki); - _2.hc = function Li() { - return new Skb(this.a); - }; - _2.a = 0; - mdb(Zhe, "ArrayListMultimap", 513); - bcb(664, 2010, { 664: 1, 1947: 1, 3: 1 }, _i); - mdb(Zhe, "ArrayTable", 664); - bcb(1924, 386, $he, aj); - _2.Xb = function bj(a) { - return new hj(this.a, a); - }; - mdb(Zhe, "ArrayTable/1", 1924); - bcb(1925, 1, {}, cj); - _2.ld = function dj(a) { - return new hj(this.a, a); + if (se[_i11] === 0 || se[_i11] === opts.minIterations) { + _sum++; + } + } + if (_sum === n2) { + break; + } + } + } + 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] }; - mdb(Zhe, "ArrayTable/1methodref$getCell$Type", 1925); - bcb(2011, 1, { 682: 1 }); - _2.Fb = function ej(a) { - var b; - if (a === this) { - return true; + } + 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 id27 = 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 = id27; + } else if (d22 == 1) { + if (oddOut) dflag = true; + else oddOut = id27; + } else if (d22 > 1 || d1 > 1) { + dflag = true; + } + nodes6[id27] = []; + ele.outgoers().forEach(function(e3) { + if (e3.isEdge()) nodes6[id27].push(e3.id()); + }); + } else { + edges5[id27] = [void 0, ele.target().id()]; } - if (JD(a, 468)) { - b = BD(a, 682); - return Hb(Em(this.c.e, this.b), Em(b.c.e, b.b)) && Hb(Em(this.c.c, this.a), Em(b.c.c, b.a)) && Hb(Mi(this.c, this.b, this.a), Mi(b.c, b.b, b.a)); + }); + } else { + eles.forEach(function(ele) { + var id27 = ele.id(); + if (ele.isNode()) { + var d3 = ele.degree(true); + if (d3 % 2) { + if (!oddIn) oddIn = id27; + else if (!oddOut) oddOut = id27; + else dflag = true; + } + nodes6[id27] = []; + ele.connectedEdges().forEach(function(e3) { + return nodes6[id27].push(e3.id()); + }); + } else { + edges5[id27] = [ele.source().id(), ele.target().id()]; } - return false; - }; - _2.Hb = function fj() { - return Hlb(OC(GC(SI, 1), Uhe, 1, 5, [Em(this.c.e, this.b), Em(this.c.c, this.a), Mi(this.c, this.b, this.a)])); - }; - _2.Ib = function gj() { - return "(" + Em(this.c.e, this.b) + "," + Em(this.c.c, this.a) + ")=" + Mi(this.c, this.b, this.a); - }; - mdb(Zhe, "Tables/AbstractCell", 2011); - bcb(468, 2011, { 468: 1, 682: 1 }, hj); - _2.a = 0; - _2.b = 0; - _2.d = 0; - mdb(Zhe, "ArrayTable/2", 468); - bcb(1927, 1, {}, ij); - _2.ld = function jj(a) { - return Ti(this.a, a); - }; - mdb(Zhe, "ArrayTable/2methodref$getValue$Type", 1927); - bcb(1926, 386, $he, kj); - _2.Xb = function lj(a) { - return Ti(this.a, a); - }; - mdb(Zhe, "ArrayTable/3", 1926); - bcb(1979, 1967, cie); - _2.$b = function nj() { - ir(this.kc()); - }; - _2.vc = function oj() { - return new Sv(this); - }; - _2.lc = function pj() { - return new Mub(this.kc(), this.gc()); - }; - mdb(Zhe, "Maps/IteratorBasedAbstractMap", 1979); - bcb(828, 1979, cie); - _2.$b = function tj() { - throw vbb(new bgb()); - }; - _2._b = function uj(a) { - return sn(this.c, a); - }; - _2.kc = function vj() { - return new Jj(this, this.c.b.c.gc()); - }; - _2.lc = function wj() { - return Zj(this.c.b.c.gc(), 16, new Dj(this)); - }; - _2.xc = function xj(a) { - var b; - b = BD(tn(this.c, a), 19); - return !b ? null : this.nd(b.a); - }; - _2.dc = function yj() { - return this.c.b.c.dc(); - }; - _2.ec = function zj() { - return Xm(this.c); - }; - _2.zc = function Aj(a, b) { - var c2; - c2 = BD(tn(this.c, a), 19); - if (!c2) { - throw vbb(new Wdb(this.md() + " " + a + " not in " + Xm(this.c))); + }); + } + var result = { + found: false, + trail: void 0 + }; + if (dflag) return result; + else if (oddOut && oddIn) { + if (directed) { + if (startVertex && oddOut != startVertex) { + return result; } - return this.od(c2.a, b); - }; - _2.Bc = function Bj(a) { - throw vbb(new bgb()); - }; - _2.gc = function Cj() { - return this.c.b.c.gc(); - }; - mdb(Zhe, "ArrayTable/ArrayMap", 828); - bcb(1923, 1, {}, Dj); - _2.ld = function Ej(a) { - return qj(this.a, a); - }; - mdb(Zhe, "ArrayTable/ArrayMap/0methodref$getEntry$Type", 1923); - bcb(1921, 345, kie, Fj); - _2.cd = function Gj() { - return rj(this.a, this.b); - }; - _2.dd = function Hj() { - return this.a.nd(this.b); - }; - _2.ed = function Ij(a) { - return this.a.od(this.b, a); - }; - _2.b = 0; - mdb(Zhe, "ArrayTable/ArrayMap/1", 1921); - bcb(1922, 386, $he, Jj); - _2.Xb = function Kj(a) { - return qj(this.a, a); - }; - mdb(Zhe, "ArrayTable/ArrayMap/2", 1922); - bcb(1920, 828, cie, Lj); - _2.md = function Mj() { - return "Column"; - }; - _2.nd = function Nj(a) { - return Mi(this.b, this.a, a); - }; - _2.od = function Oj(a, b) { - return Wi(this.b, this.a, a, b); - }; - _2.a = 0; - mdb(Zhe, "ArrayTable/Row", 1920); - bcb(829, 828, cie, Rj); - _2.nd = function Tj(a) { - return new Lj(this.a, a); - }; - _2.zc = function Uj(a, b) { - return BD(b, 83), Pj(); - }; - _2.od = function Vj(a, b) { - return BD(b, 83), Qj(); - }; - _2.md = function Sj() { - return "Row"; - }; - mdb(Zhe, "ArrayTable/RowMap", 829); - bcb(1120, 1, pie2, _j); - _2.qd = function ak() { - return this.a.qd() & -262; - }; - _2.rd = function bk() { - return this.a.rd(); - }; - _2.Nb = function ck(a) { - this.a.Nb(new gk(a, this.b)); - }; - _2.sd = function dk(a) { - return this.a.sd(new ek(a, this.b)); - }; - mdb(Zhe, "CollectSpliterators/1", 1120); - bcb(1121, 1, qie, ek); - _2.td = function fk(a) { - this.a.td(this.b.Kb(a)); - }; - mdb(Zhe, "CollectSpliterators/1/lambda$0$Type", 1121); - bcb(1122, 1, qie, gk); - _2.td = function hk(a) { - this.a.td(this.b.Kb(a)); - }; - mdb(Zhe, "CollectSpliterators/1/lambda$1$Type", 1122); - bcb(1123, 1, pie2, jk); - _2.qd = function kk() { - return this.a; - }; - _2.rd = function lk() { - !!this.d && (this.b = Deb(this.b, this.d.rd())); - return Deb(this.b, 0); - }; - _2.Nb = function mk(a) { - if (this.d) { - this.d.Nb(a); - this.d = null; + startVertex = oddOut; + } else { + if (startVertex && oddOut != startVertex && oddIn != startVertex) { + return result; + } else if (!startVertex) { + startVertex = oddOut; } - this.c.Nb(new rk(this.e, a)); - this.b = 0; - }; - _2.sd = function ok(a) { - while (true) { - if (!!this.d && this.d.sd(a)) { - Kbb(this.b, rie) && (this.b = Qbb(this.b, 1)); - return true; - } else { - this.d = null; + } + } 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; + } + subtour2.unshift(adj); + subtour2.unshift(currentNode); + } + 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); + } + } + trail.unshift(eles.getElementById(subtour.shift())); + for (var d2 in nodes6) { + if (nodes6[d2].length) { + return result; + } + } + result.found = true; + result.trail = this.spawn(trail, true); + return result; + }, "hierholzer") + }; + hopcroftTarjanBiconnected = /* @__PURE__ */ __name(function hopcroftTarjanBiconnected2() { + var eles = this; + var nodes6 = {}; + var id27 = 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(); + })); + } + }); + }); + components3.push(component2); + }, "buildComponent"); + var biconnectedSearch = /* @__PURE__ */ __name(function biconnectedSearch2(root4, currentNode, parent4) { + if (root4 === parent4) edgeCount4 += 1; + nodes6[currentNode] = { + id: id27, + low: id27++, + 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 (!this.c.sd(new pk(this, this.e))) { - return false; + 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); } } - }; - _2.a = 0; - _2.b = 0; - mdb(Zhe, "CollectSpliterators/1FlatMapSpliterator", 1123); - bcb(1124, 1, qie, pk); - _2.td = function qk(a) { - ik(this.a, this.b, a); - }; - mdb(Zhe, "CollectSpliterators/1FlatMapSpliterator/lambda$0$Type", 1124); - bcb(1125, 1, qie, rk); - _2.td = function sk(a) { - nk(this.b, this.a, a); - }; - mdb(Zhe, "CollectSpliterators/1FlatMapSpliterator/lambda$1$Type", 1125); - bcb(1117, 1, pie2, tk); - _2.qd = function uk() { - return 16464 | this.b; - }; - _2.rd = function vk() { - return this.a.rd(); - }; - _2.Nb = function wk(a) { - this.a.xe(new Ak(a, this.c)); - }; - _2.sd = function xk(a) { - return this.a.ye(new yk(a, this.c)); - }; - _2.b = 0; - mdb(Zhe, "CollectSpliterators/1WithCharacteristics", 1117); - bcb(1118, 1, sie, yk); - _2.ud = function zk(a) { - this.a.td(this.b.ld(a)); - }; - mdb(Zhe, "CollectSpliterators/1WithCharacteristics/lambda$0$Type", 1118); - bcb(1119, 1, sie, Ak); - _2.ud = function Bk(a) { - this.a.td(this.b.ld(a)); - }; - mdb(Zhe, "CollectSpliterators/1WithCharacteristics/lambda$1$Type", 1119); - bcb(245, 1, tie); - _2.wd = function Hk(a) { - return this.vd(BD(a, 245)); - }; - _2.vd = function Gk(a) { - var b; - if (a == (_k(), $k)) { - return 1; - } - if (a == (Lk(), Kk)) { - return -1; + }); + } + }, "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; + } + } + }); + var cutVertices = Object.keys(nodes6).filter(function(id28) { + return nodes6[id28].cutVertex; + }).map(function(id28) { + return eles.getElementById(id28); + }); + 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); } - b = (ex(), Fcb(this.a, a.a)); - if (b != 0) { - return b; + if (!nodes6[targetNodeId].explored) { + nodes6[sourceNodeId].low = Math.min(nodes6[sourceNodeId].low, nodes6[targetNodeId].low); } - return JD(this, 519) == JD(a, 519) ? 0 : JD(this, 519) ? 1 : -1; - }; - _2.zd = function Ik() { - return this.a; - }; - _2.Fb = function Jk(a) { - return Ek(this, a); - }; - mdb(Zhe, "Cut", 245); - bcb(1761, 245, tie, Mk); - _2.vd = function Nk(a) { - return a == this ? 0 : 1; - }; - _2.xd = function Ok(a) { - throw vbb(new xcb()); - }; - _2.yd = function Pk(a) { - a.a += "+∞)"; - }; - _2.zd = function Qk() { - throw vbb(new Zdb(uie)); - }; - _2.Hb = function Rk() { - return Zfb(), kCb(this); - }; - _2.Ad = function Sk(a) { - return false; - }; - _2.Ib = function Tk() { - return "+∞"; - }; - var Kk; - mdb(Zhe, "Cut/AboveAll", 1761); - bcb(519, 245, { 245: 1, 519: 1, 3: 1, 35: 1 }, Uk); - _2.xd = function Vk(a) { - Pfb((a.a += "(", a), this.a); - }; - _2.yd = function Wk(a) { - Kfb(Pfb(a, this.a), 93); - }; - _2.Hb = function Xk() { - return ~tb(this.a); - }; - _2.Ad = function Yk(a) { - return ex(), Fcb(this.a, a) < 0; - }; - _2.Ib = function Zk() { - return "/" + this.a + "\\"; - }; - mdb(Zhe, "Cut/AboveValue", 519); - bcb(1760, 245, tie, al); - _2.vd = function bl(a) { - return a == this ? 0 : -1; - }; - _2.xd = function cl(a) { - a.a += "(-∞"; - }; - _2.yd = function dl(a) { - throw vbb(new xcb()); - }; - _2.zd = function el() { - throw vbb(new Zdb(uie)); - }; - _2.Hb = function fl() { - return Zfb(), kCb(this); - }; - _2.Ad = function gl(a) { - return true; - }; - _2.Ib = function hl() { - return "-∞"; - }; - var $k; - mdb(Zhe, "Cut/BelowAll", 1760); - bcb(1762, 245, tie, il); - _2.xd = function jl(a) { - Pfb((a.a += "[", a), this.a); - }; - _2.yd = function kl(a) { - Kfb(Pfb(a, this.a), 41); - }; - _2.Hb = function ll() { - return tb(this.a); - }; - _2.Ad = function ml(a) { - return ex(), Fcb(this.a, a) <= 0; - }; - _2.Ib = function nl() { - return "\\" + this.a + "/"; - }; - mdb(Zhe, "Cut/BelowValue", 1762); - bcb(537, 1, vie); - _2.Jc = function ql(a) { - reb(this, a); - }; - _2.Ib = function rl() { - return tr(BD(Rb(this, "use Optional.orNull() instead of Optional.or(null)"), 20).Kc()); - }; - mdb(Zhe, "FluentIterable", 537); - bcb(433, 537, vie, sl); - _2.Kc = function tl() { - return new Sr(ur(this.a.Kc(), new Sq())); - }; - mdb(Zhe, "FluentIterable/2", 433); - bcb(1046, 537, vie, vl); - _2.Kc = function wl() { - return ul(this); - }; - mdb(Zhe, "FluentIterable/3", 1046); - bcb(708, 386, $he, xl); - _2.Xb = function yl(a) { - return this.a[a].Kc(); - }; - mdb(Zhe, "FluentIterable/3/1", 708); - bcb(1972, 1, {}); - _2.Ib = function zl() { - return fcb(this.Bd().b); - }; - mdb(Zhe, "ForwardingObject", 1972); - bcb(1973, 1972, wie); - _2.Bd = function Fl() { - return this.Cd(); - }; - _2.Jc = function Gl(a) { - reb(this, a); - }; - _2.Lc = function Jl() { - return this.Oc(); - }; - _2.Nc = function Ml() { - return new Kub(this, 0); - }; - _2.Oc = function Nl() { - return new YAb(null, this.Nc()); - }; - _2.Fc = function Al(a) { - return this.Cd(), enb(); - }; - _2.Gc = function Bl(a) { - return this.Cd(), fnb(); - }; - _2.$b = function Cl() { - this.Cd(), gnb(); - }; - _2.Hc = function Dl(a) { - return this.Cd().Hc(a); - }; - _2.Ic = function El(a) { - return this.Cd().Ic(a); - }; - _2.dc = function Hl() { - return this.Cd().b.dc(); - }; - _2.Kc = function Il() { - return this.Cd().Kc(); - }; - _2.Mc = function Kl(a) { - return this.Cd(), jnb(); - }; - _2.gc = function Ll() { - return this.Cd().b.gc(); - }; - _2.Pc = function Ol() { - return this.Cd().Pc(); - }; - _2.Qc = function Pl(a) { - return this.Cd().Qc(a); - }; - mdb(Zhe, "ForwardingCollection", 1973); - bcb(1980, 28, xie); - _2.Kc = function Xl() { - return this.Ed(); - }; - _2.Fc = function Sl(a) { - throw vbb(new bgb()); - }; - _2.Gc = function Tl(a) { - throw vbb(new bgb()); - }; - _2.$b = function Ul() { - throw vbb(new bgb()); - }; - _2.Hc = function Vl(a) { - return a != null && ze(this, a, false); - }; - _2.Dd = function Wl() { - switch (this.gc()) { - case 0: - return im(), im(), hm; - case 1: - return im(), new my(Qb(this.Ed().Pb())); - default: - return new px(this, this.Pc()); + } + }); + 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; } - }; - _2.Mc = function Yl(a) { - throw vbb(new bgb()); - }; - mdb(Zhe, "ImmutableCollection", 1980); - bcb(712, 1980, xie, Zl); - _2.Kc = function cm() { - return vr(this.a.Kc()); - }; - _2.Hc = function $l(a) { - return a != null && this.a.Hc(a); - }; - _2.Ic = function _l(a) { - return this.a.Ic(a); - }; - _2.dc = function am() { - return this.a.dc(); - }; - _2.Ed = function bm() { - return vr(this.a.Kc()); - }; - _2.gc = function dm() { - return this.a.gc(); - }; - _2.Pc = function em() { - return this.a.Pc(); - }; - _2.Qc = function fm(a) { - return this.a.Qc(a); - }; - _2.Ib = function gm() { - return fcb(this.a); - }; - mdb(Zhe, "ForwardingImmutableCollection", 712); - bcb(152, 1980, yie); - _2.Kc = function sm() { - return this.Ed(); - }; - _2.Yc = function tm() { - return this.Fd(0); - }; - _2.Zc = function vm(a) { - return this.Fd(a); - }; - _2.ad = function zm(a) { - ktb(this, a); - }; - _2.Nc = function Am() { - return new Kub(this, 16); - }; - _2.bd = function Cm(a, b) { - return this.Gd(a, b); - }; - _2.Vc = function lm(a, b) { - throw vbb(new bgb()); - }; - _2.Wc = function mm(a, b) { - throw vbb(new bgb()); - }; - _2.Fb = function om(a) { - return Ju(this, a); - }; - _2.Hb = function pm() { - return Ku(this); - }; - _2.Xc = function qm(a) { - return a == null ? -1 : Lu(this, a); - }; - _2.Ed = function rm() { - return this.Fd(0); - }; - _2.Fd = function um(a) { - return jm(this, a); - }; - _2.$c = function xm(a) { - throw vbb(new bgb()); - }; - _2._c = function ym(a, b) { - throw vbb(new bgb()); - }; - _2.Gd = function Bm(a, b) { - var c2; - return Dm((c2 = new $u(this), new Jib(c2, a, b))); - }; - var hm; - mdb(Zhe, "ImmutableList", 152); - bcb(2006, 152, yie); - _2.Kc = function Nm() { - return vr(this.Hd().Kc()); - }; - _2.bd = function Qm(a, b) { - return Dm(this.Hd().bd(a, b)); - }; - _2.Hc = function Fm(a) { - return a != null && this.Hd().Hc(a); - }; - _2.Ic = function Gm(a) { - return this.Hd().Ic(a); - }; - _2.Fb = function Hm(a) { - return pb(this.Hd(), a); - }; - _2.Xb = function Im(a) { - return Em(this, a); - }; - _2.Hb = function Jm() { - return tb(this.Hd()); - }; - _2.Xc = function Km(a) { - return this.Hd().Xc(a); - }; - _2.dc = function Lm() { - return this.Hd().dc(); - }; - _2.Ed = function Mm() { - return vr(this.Hd().Kc()); - }; - _2.gc = function Om() { - return this.Hd().gc(); - }; - _2.Gd = function Pm(a, b) { - return Dm(this.Hd().bd(a, b)); - }; - _2.Pc = function Rm() { - return this.Hd().Qc(KC(SI, Uhe, 1, this.Hd().gc(), 5, 1)); - }; - _2.Qc = function Sm(a) { - return this.Hd().Qc(a); - }; - _2.Ib = function Tm() { - return fcb(this.Hd()); - }; - mdb(Zhe, "ForwardingImmutableList", 2006); - bcb(714, 1, Aie); - _2.vc = function cn() { - return Wm(this); - }; - _2.wc = function en2(a) { - stb(this, a); - }; - _2.ec = function jn() { - return Xm(this); - }; - _2.yc = function kn(a, b, c2) { - return ttb(this, a, b, c2); - }; - _2.Cc = function rn() { - return this.Ld(); - }; - _2.$b = function Zm() { - throw vbb(new bgb()); - }; - _2._b = function $m(a) { - return this.xc(a) != null; - }; - _2.uc = function _m(a) { - return this.Ld().Hc(a); - }; - _2.Jd = function an() { - return new jq(this); - }; - _2.Kd = function bn() { - return new sq(this); - }; - _2.Fb = function dn(a) { - return Dv(this, a); - }; - _2.Hb = function gn() { - return Wm(this).Hb(); - }; - _2.dc = function hn() { - return this.gc() == 0; - }; - _2.zc = function nn(a, b) { - return Ym(); - }; - _2.Bc = function on(a) { - throw vbb(new bgb()); - }; - _2.Ib = function pn() { - return Jv(this); - }; - _2.Ld = function qn() { - if (this.e) { - return this.e; - } - return this.e = this.Kd(); - }; - _2.c = null; - _2.d = null; - _2.e = null; - var Um; - mdb(Zhe, "ImmutableMap", 714); - bcb(715, 714, Aie); - _2._b = function vn(a) { - return sn(this, a); - }; - _2.uc = function wn(a) { - return dob(this.b, a); - }; - _2.Id = function xn() { - return Vn(new Ln(this)); - }; - _2.Jd = function yn() { - return Vn(gob(this.b)); - }; - _2.Kd = function zn() { - return Ql(), new Zl(hob(this.b)); - }; - _2.Fb = function An(a) { - return fob(this.b, a); - }; - _2.xc = function Bn(a) { - return tn(this, a); - }; - _2.Hb = function Cn() { - return tb(this.b.c); - }; - _2.dc = function Dn() { - return this.b.c.dc(); - }; - _2.gc = function En() { - return this.b.c.gc(); - }; - _2.Ib = function Fn() { - return fcb(this.b.c); - }; - mdb(Zhe, "ForwardingImmutableMap", 715); - bcb(1974, 1973, Bie); - _2.Bd = function Gn() { - return this.Md(); - }; - _2.Cd = function Hn() { - return this.Md(); - }; - _2.Nc = function Kn() { - return new Kub(this, 1); - }; - _2.Fb = function In(a) { - return a === this || this.Md().Fb(a); - }; - _2.Hb = function Jn() { - return this.Md().Hb(); - }; - mdb(Zhe, "ForwardingSet", 1974); - bcb(1069, 1974, Bie, Ln); - _2.Bd = function Nn() { - return eob(this.a.b); - }; - _2.Cd = function On() { - return eob(this.a.b); - }; - _2.Hc = function Mn(b) { - if (JD(b, 42) && BD(b, 42).cd() == null) { - return false; - } - try { - return Dob(eob(this.a.b), b); - } catch (a) { - a = ubb(a); - if (JD(a, 205)) { - return false; - } else - throw vbb(a); + } + 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); + } + } + }); + 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, state5, name, value2) { + if (curr.state === STATE_PENDING) { + curr.state = state5; + 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; + } + 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); } - }; - _2.Md = function Pn() { - return eob(this.a.b); - }; - _2.Qc = function Qn(a) { - var b; - b = Eob(eob(this.a.b), a); - eob(this.a.b).b.gc() < b.length && NC(b, eob(this.a.b).b.gc(), null); - return b; - }; - mdb(Zhe, "ForwardingImmutableMap/1", 1069); - bcb(1981, 1980, Cie); - _2.Kc = function Tn() { - return this.Ed(); - }; - _2.Nc = function Un() { - return new Kub(this, 1); - }; - _2.Fb = function Rn(a) { - return Ax(this, a); - }; - _2.Hb = function Sn() { - return Bx(this); - }; - mdb(Zhe, "ImmutableSet", 1981); - bcb(703, 1981, Cie); - _2.Kc = function ao() { - return vr(new Dnb(this.a.b.Kc())); - }; - _2.Hc = function Xn2(a) { - return a != null && hnb(this.a, a); - }; - _2.Ic = function Yn2(a) { - return inb(this.a, a); - }; - _2.Hb = function Zn2() { - return tb(this.a.b); - }; - _2.dc = function $n() { - return this.a.b.dc(); - }; - _2.Ed = function _n() { - return vr(new Dnb(this.a.b.Kc())); - }; - _2.gc = function bo() { - return this.a.b.gc(); - }; - _2.Pc = function co() { - return this.a.b.Pc(); - }; - _2.Qc = function eo(a) { - return knb(this.a, a); - }; - _2.Ib = function fo() { - return fcb(this.a.b); - }; - mdb(Zhe, "ForwardingImmutableSet", 703); - bcb(1975, 1974, Die); - _2.Bd = function go() { - return this.b; - }; - _2.Cd = function ho() { - return this.b; - }; - _2.Md = function io() { - return this.b; - }; - _2.Nc = function jo() { - return new Rub(this); - }; - mdb(Zhe, "ForwardingSortedSet", 1975); - bcb(533, 1979, Aie, wo); - _2.Ac = function Fo(a) { - Ld(this, a); - }; - _2.Cc = function Io() { - var a; - return a = this.d, new up(!a ? this.d = new ap(this) : a); - }; - _2.$b = function xo() { - ko(this); - }; - _2._b = function yo(a) { - return !!uo(this, a, Tbb(Ibb(Eie, keb(Tbb(Ibb(a == null ? 0 : tb(a), Fie)), 15)))); - }; - _2.uc = function zo(a) { - return lo(this, a); - }; - _2.kc = function Ao() { - return new Qo(this, this); - }; - _2.wc = function Bo(a) { - no(this, a); - }; - _2.xc = function Co(a) { - return oo(this, a); - }; - _2.ec = function Do() { - return new Bp(this); - }; - _2.zc = function Eo(a, b) { - return ro(this, a, b); - }; - _2.Bc = function Go(a) { - var b; - b = uo(this, a, Tbb(Ibb(Eie, keb(Tbb(Ibb(a == null ? 0 : tb(a), Fie)), 15)))); - if (!b) { - return null; + ); + } 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); + } + }, "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 { - mo(this, b); - b.e = null; - b.c = null; - return b.i; + var val = p3; + fulfill2(i3, val); } - }; - _2.gc = function Ho() { - return this.i; - }; - _2.pd = function Jo() { - var a; - return a = this.d, new up(!a ? this.d = new ap(this) : a); - }; - _2.f = 0; - _2.g = 0; - _2.i = 0; - mdb(Zhe, "HashBiMap", 533); - bcb(534, 1, aie); - _2.Nb = function Mo(a) { - Rrb(this, a); - }; - _2.Ob = function No() { - return Ko(this); - }; - _2.Pb = function Oo() { - var a; - if (!Ko(this)) { - throw vbb(new utb()); - } - a = this.c; - this.c = a.c; - this.f = a; - --this.d; - return this.Nd(a); - }; - _2.Qb = function Po() { - if (this.e.g != this.b) { - throw vbb(new Apb()); - } - Vb(!!this.f); - mo(this.e, this.f); - this.b = this.e.g; - this.f = null; - }; - _2.b = 0; - _2.d = 0; - _2.f = null; - mdb(Zhe, "HashBiMap/Itr", 534); - bcb(1011, 534, aie, Qo); - _2.Nd = function Ro(a) { - return new So(this, a); - }; - mdb(Zhe, "HashBiMap/1", 1011); - bcb(1012, 345, kie, So); - _2.cd = function To() { - return this.a.g; - }; - _2.dd = function Uo() { - return this.a.i; - }; - _2.ed = function Vo(a) { - var b, c2, d; - c2 = this.a.i; - d = Tbb(Ibb(Eie, keb(Tbb(Ibb(a == null ? 0 : tb(a), Fie)), 15))); - if (d == this.a.f && (PD(a) === PD(c2) || a != null && pb(a, c2))) { - return a; - } - Nb(!vo(this.b.a, a, d), a); - mo(this.b.a, this.a); - b = new $o(this.a.g, this.a.a, a, d); - po(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; - }; - mdb(Zhe, "HashBiMap/1/MapEntry", 1012); - bcb(238, 345, { 345: 1, 238: 1, 3: 1, 42: 1 }, Wo); - _2.cd = function Xo() { - return this.g; - }; - _2.dd = function Yo() { - return this.i; - }; - _2.ed = function Zo(a) { - throw vbb(new bgb()); - }; - mdb(Zhe, "ImmutableEntry", 238); - bcb(317, 238, { 345: 1, 317: 1, 238: 1, 3: 1, 42: 1 }, $o); - _2.a = 0; - _2.f = 0; - var GF = mdb(Zhe, "HashBiMap/BiEntry", 317); - bcb(610, 1979, Aie, ap); - _2.Ac = function jp(a) { - Ld(this, a); - }; - _2.Cc = function mp() { - return new Bp(this.a); - }; - _2.$b = function bp() { - ko(this.a); - }; - _2._b = function cp(a) { - return lo(this.a, a); - }; - _2.kc = function dp() { - return new op(this, this.a); - }; - _2.wc = function ep(a) { - Qb(a); - no(this.a, new zp(a)); - }; - _2.xc = function fp(a) { - return _o(this, a); - }; - _2.ec = function gp() { - return new up(this); - }; - _2.zc = function ip(a, b) { - return so(this.a, a, b, false); - }; - _2.Bc = function kp(a) { - var b; - b = vo(this.a, a, Tbb(Ibb(Eie, keb(Tbb(Ibb(a == null ? 0 : tb(a), Fie)), 15)))); - if (!b) { - return null; - } else { - mo(this.a, b); - b.e = null; - b.c = null; - return b.g; + })(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; + } + q2.push(this); + if (elementOrCollection(_p.target)) { + _p.target.cy().addToAnimationPool(_p.target); + } + _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(); + } + _p.progress = p3; + _p.started = false; + if (wasPlaying) { + this.play(); + } + } + 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; + } + _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; + } + } + 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; + } + var ele = all[0]; + if (ele) { + return ele._private.animation.current.length > 0; + } + }, "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; + } + for (var i2 = 0; i2 < all.length; i2++) { + var ele = all[i2]; + ele._private.animation.queue = []; + } + 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; + } + 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; + } + 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; + } + var style3 = cy.style(); + properties = extend2({}, properties, params); + var propertiesEmpty = Object.keys(properties).length === 0; + if (propertiesEmpty) { + return new Animation(all[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 = style3.getPropsList(properties.style || properties.css); + properties.css = void 0; + } + if (isEles && properties.renderedPosition != null) { + var rpos = properties.renderedPosition; + var pan2 = cy.pan(); + var zoom2 = cy.zoom(); + properties.position = renderedToModelPosition(rpos, zoom2, pan2); + } + 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 + }; + } + var center4 = properties.center || properties.centre; + if (isCore && center4 != null) { + var centerPan = cy.getCenterPan(center4.eles, properties.zoom); + if (centerPan != null) { + properties.pan = centerPan; } - }; - _2.gc = function lp() { - return this.a.i; - }; - _2.pd = function np() { - return new Bp(this.a); - }; - mdb(Zhe, "HashBiMap/Inverse", 610); - bcb(1008, 534, aie, op); - _2.Nd = function pp(a) { - return new qp(this, a); - }; - mdb(Zhe, "HashBiMap/Inverse/1", 1008); - bcb(1009, 345, kie, qp); - _2.cd = function rp() { - return this.a.i; - }; - _2.dd = function sp() { - return this.a.g; - }; - _2.ed = function tp(a) { - var b, c2, d; - d = this.a.g; - b = Tbb(Ibb(Eie, keb(Tbb(Ibb(a == null ? 0 : tb(a), Fie)), 15))); - if (b == this.a.a && (PD(a) === PD(d) || a != null && pb(a, d))) { - return a; - } - Nb(!uo(this.b.a.a, a, b), a); - mo(this.b.a.a, this.a); - c2 = new $o(a, b, this.a.i, this.a.f); - this.a = c2; - po(this.b.a.a, c2, null); - this.b.b = this.b.a.a.g; - return d; - }; - mdb(Zhe, "HashBiMap/Inverse/1/InverseEntry", 1009); - bcb(611, 532, fie, up); - _2.Kc = function vp() { - return new xp(this.a.a); - }; - _2.Mc = function wp(a) { - var b; - b = vo(this.a.a, a, Tbb(Ibb(Eie, keb(Tbb(Ibb(a == null ? 0 : tb(a), Fie)), 15)))); - if (!b) { - return false; - } else { - mo(this.a.a, b); - return true; + } + 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; } - }; - mdb(Zhe, "HashBiMap/Inverse/InverseKeySet", 611); - bcb(1007, 534, aie, xp); - _2.Nd = function yp(a) { - return a.i; - }; - mdb(Zhe, "HashBiMap/Inverse/InverseKeySet/1", 1007); - bcb(1010, 1, {}, zp); - _2.Od = function Ap(a, b) { - hp(this.a, a, b); - }; - mdb(Zhe, "HashBiMap/Inverse/lambda$0$Type", 1010); - bcb(609, 532, fie, Bp); - _2.Kc = function Cp() { - return new Ep(this.a); - }; - _2.Mc = function Dp(a) { - var b; - b = uo(this.a, a, Tbb(Ibb(Eie, keb(Tbb(Ibb(a == null ? 0 : tb(a), Fie)), 15)))); - if (!b) { - return false; + } + 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 { - mo(this.a, b); - b.e = null; - b.c = null; - return true; - } - }; - mdb(Zhe, "HashBiMap/KeySet", 609); - bcb(1006, 534, aie, Ep); - _2.Nd = function Fp(a) { - return a.g; - }; - mdb(Zhe, "HashBiMap/KeySet/1", 1006); - bcb(1093, 619, _he); - mdb(Zhe, "HashMultimapGwtSerializationDependencies", 1093); - bcb(265, 1093, _he, Hp); - _2.hc = function Ip() { - return new Uqb(Cv(this.a)); - }; - _2.gd = function Jp() { - return new Uqb(Cv(this.a)); - }; - _2.a = 2; - mdb(Zhe, "HashMultimap", 265); - bcb(1999, 152, yie); - _2.Hc = function Mp(a) { - return this.Pd().Hc(a); - }; - _2.dc = function Np() { - return this.Pd().dc(); - }; - _2.gc = function Op() { - return this.Pd().gc(); - }; - mdb(Zhe, "ImmutableAsList", 1999); - bcb(1931, 715, Aie); - _2.Ld = function Qp() { - return Ql(), new oy(this.a); - }; - _2.Cc = function Rp() { - return Ql(), new oy(this.a); - }; - _2.pd = function Sp() { - return Ql(), new oy(this.a); - }; - mdb(Zhe, "ImmutableBiMap", 1931); - bcb(1977, 1, {}); - mdb(Zhe, "ImmutableCollection/Builder", 1977); - bcb(1022, 703, Cie, Tp); - mdb(Zhe, "ImmutableEnumSet", 1022); - bcb(969, 386, $he, Vp); - _2.Xb = function Wp(a) { - return this.a.Xb(a); - }; - mdb(Zhe, "ImmutableList/1", 969); - bcb(968, 1977, {}, Xp); - mdb(Zhe, "ImmutableList/Builder", 968); - bcb(614, 198, Yhe, Yp); - _2.Ob = function Zp() { - return this.a.Ob(); - }; - _2.Pb = function $p() { - return BD(this.a.Pb(), 42).cd(); - }; - mdb(Zhe, "ImmutableMap/1", 614); - bcb(1041, 1, {}, _p); - _2.Kb = function aq(a) { - return BD(a, 42).cd(); - }; - mdb(Zhe, "ImmutableMap/2methodref$getKey$Type", 1041); - bcb(1040, 1, {}, cq); - mdb(Zhe, "ImmutableMap/Builder", 1040); - bcb(2e3, 1981, Cie); - _2.Kc = function gq() { - var a; - return a = Wm(this.a).Ed(), new Yp(a); - }; - _2.Dd = function dq() { - return new Fq(this); - }; - _2.Jc = function eq2(a) { - var b, c2; - Qb(a); - c2 = this.gc(); - for (b = 0; b < c2; b++) { - a.td(BD(Rl(Wm(this.a)).Xb(b), 42).cd()); + properties.zoom = null; } - }; - _2.Ed = function fq() { - var a; - return (a = this.c, !a ? this.c = new Fq(this) : a).Ed(); - }; - _2.Nc = function hq() { - return Zj(this.gc(), 1296, new Dq(this)); - }; - mdb(Zhe, "IndexedImmutableSet", 2e3); - bcb(1180, 2e3, Cie, jq); - _2.Kc = function nq() { - var a; - return a = Wm(this.a).Ed(), new Yp(a); - }; - _2.Hc = function kq(a) { - return this.a._b(a); - }; - _2.Jc = function lq(a) { - Qb(a); - stb(this.a, new qq(a)); - }; - _2.Ed = function mq() { - var a; - return a = Wm(this.a).Ed(), new Yp(a); - }; - _2.gc = function oq() { - return this.a.gc(); - }; - _2.Nc = function pq() { - return $j(Wm(this.a).Nc(), new _p()); - }; - mdb(Zhe, "ImmutableMapKeySet", 1180); - bcb(1181, 1, {}, qq); - _2.Od = function rq(a, b) { - Ql(); - this.a.td(a); - }; - mdb(Zhe, "ImmutableMapKeySet/lambda$0$Type", 1181); - bcb(1178, 1980, xie, sq); - _2.Kc = function vq() { - return new Aq(this); - }; - _2.Hc = function tq(a) { - return a != null && jr(new Aq(this), a); - }; - _2.Ed = function uq() { - return new Aq(this); - }; - _2.gc = function wq() { - return this.a.gc(); - }; - _2.Nc = function xq() { - return $j(Wm(this.a).Nc(), new yq()); - }; - mdb(Zhe, "ImmutableMapValues", 1178); - bcb(1179, 1, {}, yq); - _2.Kb = function zq(a) { - return BD(a, 42).dd(); - }; - mdb(Zhe, "ImmutableMapValues/0methodref$getValue$Type", 1179); - bcb(626, 198, Yhe, Aq); - _2.Ob = function Bq() { - return this.a.Ob(); - }; - _2.Pb = function Cq() { - return BD(this.a.Pb(), 42).dd(); - }; - mdb(Zhe, "ImmutableMapValues/1", 626); - bcb(1182, 1, {}, Dq); - _2.ld = function Eq(a) { - return iq(this.a, a); - }; - mdb(Zhe, "IndexedImmutableSet/0methodref$get$Type", 1182); - bcb(752, 1999, yie, Fq); - _2.Pd = function Gq() { - return this.a; - }; - _2.Xb = function Hq(a) { - return iq(this.a, a); - }; - _2.gc = function Iq() { - return this.a.a.gc(); - }; - mdb(Zhe, "IndexedImmutableSet/1", 752); - bcb(44, 1, {}, Sq); - _2.Kb = function Tq(a) { - return BD(a, 20).Kc(); - }; - _2.Fb = function Uq(a) { - return this === a; - }; - mdb(Zhe, "Iterables/10", 44); - bcb(1042, 537, vie, Wq); - _2.Jc = function Xq(a) { - Qb(a); - this.b.Jc(new $q(this.a, a)); - }; - _2.Kc = function Yq() { - return Vq(this); - }; - mdb(Zhe, "Iterables/4", 1042); - bcb(1043, 1, qie, $q); - _2.td = function _q(a) { - Zq(this.b, this.a, a); - }; - mdb(Zhe, "Iterables/4/lambda$0$Type", 1043); - bcb(1044, 537, vie, ar); - _2.Jc = function br(a) { - Qb(a); - reb(this.a, new dr(a, this.b)); - }; - _2.Kc = function cr() { - return ur(new Fyd(this.a), this.b); - }; - mdb(Zhe, "Iterables/5", 1044); - bcb(1045, 1, qie, dr); - _2.td = function er2(a) { - this.a.td(Gfd(a)); - }; - mdb(Zhe, "Iterables/5/lambda$0$Type", 1045); - bcb(1071, 198, Yhe, wr); - _2.Ob = function xr() { - return this.a.Ob(); - }; - _2.Pb = function yr() { - return this.a.Pb(); - }; - mdb(Zhe, "Iterators/1", 1071); - bcb(1072, 699, Yhe, zr); - _2.Yb = function Ar() { - var a; - while (this.b.Ob()) { - a = this.b.Pb(); - if (this.a.Lb(a)) { - return a; + } + 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; + } + if (params) { + properties = extend2({}, properties, params); + } + 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(); + } + 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; + } + 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; } } - return this.e = 2, null; - }; - mdb(Zhe, "Iterators/5", 1072); - bcb(487, 1, aie); - _2.Nb = function Cr(a) { - Rrb(this, a); - }; - _2.Ob = function Dr() { - return this.b.Ob(); - }; - _2.Pb = function Er() { - return this.Qd(this.b.Pb()); - }; - _2.Qb = function Fr() { - this.b.Qb(); - }; - mdb(Zhe, "TransformedIterator", 487); - bcb(1073, 487, aie, Gr); - _2.Qd = function Hr(a) { - return this.a.Kb(a); - }; - mdb(Zhe, "Iterators/6", 1073); - bcb(717, 198, Yhe, Ir); - _2.Ob = function Jr() { - return !this.a; - }; - _2.Pb = function Kr() { - if (this.a) { - throw vbb(new utb()); + if (clearQueue2) { + _p.animation.queue = []; } - this.a = true; - return this.b; - }; - _2.a = false; - mdb(Zhe, "Iterators/9", 717); - bcb(1070, 386, $he, Nr); - _2.Xb = function Or(a) { - return this.a[this.b + a]; - }; - _2.b = 0; - var Lr; - mdb(Zhe, "Iterators/ArrayItr", 1070); - bcb(39, 1, { 39: 1, 47: 1 }, Sr); - _2.Nb = function Tr(a) { - Rrb(this, a); - }; - _2.Ob = function Ur() { - return Qr(this); - }; - _2.Pb = function Vr() { - return Rr(this); - }; - _2.Qb = function Wr() { - Vb(!!this.c); - this.c.Qb(); - this.c = null; - }; - mdb(Zhe, "Iterators/ConcatenatedIterator", 39); - bcb(22, 1, { 3: 1, 35: 1, 22: 1 }); - _2.wd = function _r(a) { - return Xr(this, BD(a, 22)); - }; - _2.Fb = function bs(a) { - return this === a; - }; - _2.Hb = function cs() { - return FCb(this); - }; - _2.Ib = function ds() { - return Zr(this); - }; - _2.g = 0; - var CI = mdb(Phe, "Enum", 22); - bcb(538, 22, { 538: 1, 3: 1, 35: 1, 22: 1, 47: 1 }, is); - _2.Nb = function js(a) { - Rrb(this, a); - }; - _2.Ob = function ks() { - return false; - }; - _2.Pb = function ls() { - throw vbb(new utb()); - }; - _2.Qb = function ms() { - Vb(false); - }; - var gs; - var yG = ndb(Zhe, "Iterators/EmptyModifiableIterator", 538, CI, os, ns); - var ps; - bcb(1834, 619, _he); - mdb(Zhe, "LinkedHashMultimapGwtSerializationDependencies", 1834); - bcb(1835, 1834, _he, ss); - _2.hc = function us() { - return new Asb(Cv(this.b)); - }; - _2.$b = function ts() { - Nc(this); - As(this.a, this.a); - }; - _2.gd = function vs() { - return new Asb(Cv(this.b)); - }; - _2.ic = function ws(a) { - return new Ss(this, a, this.b); - }; - _2.kc = function xs() { - return new Hs(this); - }; - _2.lc = function ys() { - var a; - return new Kub((a = this.g, BD(!a ? this.g = new ph(this) : a, 21)), 17); - }; - _2.ec = function zs() { - var a; - return a = this.i, !a ? this.i = new zf(this, this.c) : a; - }; - _2.nc = function Cs() { - return new Ov(new Hs(this)); - }; - _2.oc = function Ds() { - var a; - return $j(new Kub((a = this.g, BD(!a ? this.g = new ph(this) : a, 21)), 17), new Es()); - }; - _2.b = 2; - mdb(Zhe, "LinkedHashMultimap", 1835); - bcb(1838, 1, {}, Es); - _2.Kb = function Fs(a) { - return BD(a, 42).dd(); - }; - mdb(Zhe, "LinkedHashMultimap/0methodref$getValue$Type", 1838); - bcb(824, 1, aie, Hs); - _2.Nb = function Is(a) { - Rrb(this, a); - }; - _2.Pb = function Ks() { - return Gs(this); - }; - _2.Ob = function Js() { - return this.a != this.b.a; - }; - _2.Qb = function Ls2() { - Vb(!!this.c); - Gc(this.b, this.c.g, this.c.i); - this.c = null; - }; - mdb(Zhe, "LinkedHashMultimap/1", 824); - bcb(330, 238, { 345: 1, 238: 1, 330: 1, 2020: 1, 3: 1, 42: 1 }, Ms); - _2.Rd = function Ns() { - return this.f; - }; - _2.Sd = function Os(a) { - this.c = a; - }; - _2.Td = function Ps(a) { - this.f = a; - }; - _2.d = 0; - var BG = mdb(Zhe, "LinkedHashMultimap/ValueEntry", 330); - bcb(1836, 1970, { 2020: 1, 20: 1, 28: 1, 14: 1, 21: 1 }, Ss); - _2.Fc = function Ts(a) { - var b, c2, d, e, f2; - f2 = Tbb(Ibb(Eie, keb(Tbb(Ibb(a == null ? 0 : tb(a), Fie)), 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; - } + if (!jumpToEnd) { + _p.animation.current = []; } - d = new Ms(this.c, a, f2, e); - Bs(this.d, d); - d.f = this; - this.d = d; - As(this.g.a.b, d); - As(d, this.g.a); - this.b[b] = d; - ++this.f; - ++this.e; - Qs(this); + } + 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; - }; - _2.$b = function Us() { - var a, b; - Alb(this.b, null); - this.f = 0; - for (a = this.a; a != this; a = a.Rd()) { - b = BD(a, 330); - As(b.b, b.e); - } - this.a = this; - this.d = this; - ++this.e; - }; - _2.Hc = function Vs(a) { - var b, c2; - c2 = Tbb(Ibb(Eie, keb(Tbb(Ibb(a == null ? 0 : tb(a), Fie)), 15))); - for (b = this.b[c2 & this.b.length - 1]; b; b = b.a) { - if (b.d == c2 && Hb(b.i, a)) { - 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]; + } } - } - return false; - }; - _2.Jc = function Ws(a) { - var b; - Qb(a); - for (b = this.a; b != this; b = b.Rd()) { - a.td(BD(b, 330).i); - } - }; - _2.Rd = function Xs() { - return this.a; - }; - _2.Kc = function Ys() { - return new ct(this); - }; - _2.Mc = function Zs(a) { - return Rs(this, a); - }; - _2.Sd = function $s(a) { - this.d = a; - }; - _2.Td = function _s(a) { - this.a = a; - }; - _2.gc = function at() { - return this.f; - }; - _2.e = 0; - _2.f = 0; - mdb(Zhe, "LinkedHashMultimap/ValueSet", 1836); - bcb(1837, 1, aie, ct); - _2.Nb = function dt(a) { - Rrb(this, a); - }; - _2.Ob = function et() { - return bt(this), this.b != this.c; - }; - _2.Pb = function ft() { - var a, b; - bt(this); - if (this.b == this.c) { - throw vbb(new utb()); - } - a = BD(this.b, 330); - b = a.i; - this.d = a; - this.b = a.f; - return b; - }; - _2.Qb = function gt() { - bt(this); - Vb(!!this.d); - Rs(this.c, this.d.i); - this.a = this.c.e; - this.d = null; - }; - _2.a = 0; - mdb(Zhe, "LinkedHashMultimap/ValueSet/1", 1837); - bcb(766, 1986, _he, mt); - _2.Zb = function nt() { - var a; - return a = this.f, !a ? this.f = new jw(this) : a; - }; - _2.Fb = function tt(a) { - return hw(this, a); - }; - _2.cc = function ut(a) { - return new bu(this, a); - }; - _2.fc = function xt(a) { - return kt(this, a); - }; - _2.$b = function pt() { - it(this); - }; - _2._b = function qt(a) { - return jt(this, a); - }; - _2.ac = function rt() { - return new jw(this); - }; - _2.bc = function st() { - return new eu(this); - }; - _2.qc = function vt(a) { - return new bu(this, a); - }; - _2.dc = function wt() { - return !this.a; - }; - _2.rc = function yt(a) { - return kt(this, a); - }; - _2.gc = function zt() { - return this.d; - }; - _2.c = 0; - _2.d = 0; - mdb(Zhe, "LinkedListMultimap", 766); - bcb(52, 28, Lie); - _2.ad = function Pt(a) { - ktb(this, a); - }; - _2.Nc = function Qt() { - return new Kub(this, 16); - }; - _2.Vc = function Ct(a, b) { - throw vbb(new cgb("Add not supported on this list")); - }; - _2.Fc = function Dt(a) { - this.Vc(this.gc(), a); - return true; - }; - _2.Wc = function Et(a, b) { - var c2, d, e; - uCb(b); - c2 = false; - for (e = b.Kc(); e.Ob(); ) { - d = e.Pb(); - this.Vc(a++, d); - c2 = true; - } - return c2; - }; - _2.$b = function Ft() { - this.Ud(0, this.gc()); - }; - _2.Fb = function Gt(a) { - return At(this, a); - }; - _2.Hb = function Ht() { - return qmb(this); - }; - _2.Xc = function It(a) { - return Bt(this, a); - }; - _2.Kc = function Jt() { - return new vib(this); - }; - _2.Yc = function Kt() { - return this.Zc(0); - }; - _2.Zc = function Lt(a) { - return new Bib(this, a); - }; - _2.$c = function Mt(a) { - throw vbb(new cgb("Remove not supported on this list")); - }; - _2.Ud = function Nt(a, b) { - var c2, d; - d = this.Zc(a); - for (c2 = a; c2 < b; ++c2) { - d.Pb(); - d.Qb(); - } - }; - _2._c = function Ot(a, b) { - throw vbb(new cgb("Set not supported on this list")); - }; - _2.bd = function Rt(a, b) { - return new Jib(this, a, b); - }; - _2.j = 0; - mdb(bie, "AbstractList", 52); - bcb(1964, 52, Lie); - _2.Vc = function Wt(a, b) { - St(this, a, b); - }; - _2.Wc = function Xt(a, b) { - return Tt(this, a, b); - }; - _2.Xb = function Yt(a) { - return Ut(this, a); - }; - _2.Kc = function Zt() { - return this.Zc(0); - }; - _2.$c = function $t(a) { - return Vt(this, a); - }; - _2._c = function _t(b, c2) { - var d, e; - d = this.Zc(b); - try { - e = d.Pb(); - d.Wb(c2); - return e; - } catch (a) { - a = ubb(a); - if (JD(a, 109)) { - throw vbb(new qcb("Can't set element " + b)); - } else - throw vbb(a); - } - }; - mdb(bie, "AbstractSequentialList", 1964); - bcb(636, 1964, Lie, bu); - _2.Zc = function cu(a) { - return au(this, a); - }; - _2.gc = function du() { - var a; - a = BD(Ohb(this.a.b, this.b), 283); - return !a ? 0 : a.a; - }; - mdb(Zhe, "LinkedListMultimap/1", 636); - bcb(1297, 1970, fie, eu); - _2.Hc = function fu(a) { - return jt(this.a, a); - }; - _2.Kc = function gu() { - return new ku(this.a); - }; - _2.Mc = function hu(a) { - return !kt(this.a, a).a.dc(); - }; - _2.gc = function iu() { - return Vhb(this.a.b); - }; - mdb(Zhe, "LinkedListMultimap/1KeySetImpl", 1297); - bcb(1296, 1, aie, ku); - _2.Nb = function lu(a) { - Rrb(this, a); - }; - _2.Ob = function mu() { - ju(this); - return !!this.c; - }; - _2.Pb = function nu() { - ju(this); - ot(this.c); - this.a = this.c; - Qqb(this.d, this.a.a); - do { - this.c = this.c.b; - } while (!!this.c && !Qqb(this.d, this.c.a)); - return this.a.a; - }; - _2.Qb = function ou() { - ju(this); - Vb(!!this.a); - ir(new wu(this.e, this.a.a)); - this.a = null; - this.b = this.e.c; - }; - _2.b = 0; - mdb(Zhe, "LinkedListMultimap/DistinctKeyIterator", 1296); - bcb(283, 1, { 283: 1 }, pu); - _2.a = 0; - mdb(Zhe, "LinkedListMultimap/KeyList", 283); - bcb(1295, 345, kie, qu); - _2.cd = function ru() { - return this.a; - }; - _2.dd = function su() { - return this.f; - }; - _2.ed = function tu(a) { - var b; - b = this.f; - this.f = a; - return b; - }; - mdb(Zhe, "LinkedListMultimap/Node", 1295); - bcb(560, 1, jie, wu, xu); - _2.Nb = function zu(a) { - Rrb(this, a); - }; - _2.Rb = function yu(a) { - this.e = ht(this.f, this.b, a, this.c); - ++this.d; - this.a = null; - }; - _2.Ob = function Au() { - return !!this.c; - }; - _2.Sb = function Bu() { - return !!this.e; - }; - _2.Pb = function Cu() { - return uu(this); - }; - _2.Tb = function Du() { - return this.d; - }; - _2.Ub = function Eu() { - return vu(this); - }; - _2.Vb = function Fu() { - return this.d - 1; - }; - _2.Qb = function Gu() { - Vb(!!this.a); - if (this.a != this.c) { - this.e = this.a.e; - --this.d; - } else { - this.c = this.a.c; - } - lt(this.f, this.a); - this.a = null; - }; - _2.Wb = function Hu(a) { - Ub(!!this.a); - this.a.f = a; - }; - _2.d = 0; - mdb(Zhe, "LinkedListMultimap/ValueForKeyIterator", 560); - bcb(1018, 52, Lie); - _2.Vc = function Tu(a, b) { - this.a.Vc(a, b); - }; - _2.Wc = function Uu(a, b) { - return this.a.Wc(a, b); - }; - _2.Hc = function Vu(a) { - return this.a.Hc(a); - }; - _2.Xb = function Wu(a) { - return this.a.Xb(a); - }; - _2.$c = function Xu(a) { - return this.a.$c(a); - }; - _2._c = function Yu(a, b) { - return this.a._c(a, b); - }; - _2.gc = function Zu() { - return this.a.gc(); - }; - mdb(Zhe, "Lists/AbstractListWrapper", 1018); - bcb(1019, 1018, Nie); - mdb(Zhe, "Lists/RandomAccessListWrapper", 1019); - bcb(1021, 1019, Nie, $u); - _2.Zc = function _u(a) { - return this.a.Zc(a); - }; - mdb(Zhe, "Lists/1", 1021); - bcb(131, 52, { 131: 1, 20: 1, 28: 1, 52: 1, 14: 1, 15: 1 }, dv); - _2.Vc = function ev(a, b) { - this.a.Vc(cv(this, a), b); - }; - _2.$b = function fv() { - this.a.$b(); - }; - _2.Xb = function gv(a) { - return this.a.Xb(bv(this, a)); - }; - _2.Kc = function hv() { - return av(this, 0); - }; - _2.Zc = function iv(a) { - return av(this, a); - }; - _2.$c = function jv(a) { - return this.a.$c(bv(this, a)); - }; - _2.Ud = function kv(a, b) { - (Tb(a, b, this.a.gc()), Su(this.a.bd(cv(this, b), cv(this, a)))).$b(); - }; - _2._c = function lv(a, b) { - return this.a._c(bv(this, a), b); - }; - _2.gc = function mv() { - return this.a.gc(); - }; - _2.bd = function nv(a, b) { - return Tb(a, b, this.a.gc()), Su(this.a.bd(cv(this, b), cv(this, a))); - }; - mdb(Zhe, "Lists/ReverseList", 131); - bcb(280, 131, { 131: 1, 20: 1, 28: 1, 52: 1, 14: 1, 15: 1, 54: 1 }, ov); - mdb(Zhe, "Lists/RandomAccessReverseList", 280); - bcb(1020, 1, jie, qv); - _2.Nb = function sv(a) { - Rrb(this, a); - }; - _2.Rb = function rv(a) { - this.c.Rb(a); - this.c.Ub(); - this.a = false; - }; - _2.Ob = function tv() { - return this.c.Sb(); - }; - _2.Sb = function uv() { - return this.c.Ob(); - }; - _2.Pb = function vv() { - return pv(this); - }; - _2.Tb = function wv() { - return cv(this.b, this.c.Tb()); - }; - _2.Ub = function xv() { - if (!this.c.Ob()) { - throw vbb(new utb()); - } - this.a = true; - return this.c.Pb(); - }; - _2.Vb = function yv() { - return cv(this.b, this.c.Tb()) - 1; - }; - _2.Qb = function zv() { - Vb(this.a); - this.c.Qb(); - this.a = false; - }; - _2.Wb = function Av(a) { - Ub(this.a); - this.c.Wb(a); - }; - _2.a = false; - mdb(Zhe, "Lists/ReverseList/1", 1020); - bcb(432, 487, aie, Mv); - _2.Qd = function Nv(a) { - return Lv(a); - }; - mdb(Zhe, "Maps/1", 432); - bcb(698, 487, aie, Ov); - _2.Qd = function Pv(a) { - return BD(a, 42).dd(); - }; - mdb(Zhe, "Maps/2", 698); - bcb(962, 487, aie, Qv); - _2.Qd = function Rv(a) { - return new Wo(a, ww(this.a, a)); - }; - mdb(Zhe, "Maps/3", 962); - bcb(959, 1971, fie, Sv); - _2.Jc = function Tv(a) { - mj(this.a, a); - }; - _2.Kc = function Uv() { - return this.a.kc(); - }; - _2.Rc = function Vv() { - return this.a; - }; - _2.Nc = function Wv() { - return this.a.lc(); - }; - mdb(Zhe, "Maps/IteratorBasedAbstractMap/1", 959); - bcb(960, 1, {}, Xv); - _2.Od = function Yv(a, b) { - this.a.td(a); - }; - mdb(Zhe, "Maps/KeySet/lambda$0$Type", 960); - bcb(958, 28, die, Zv); - _2.$b = function $v() { - this.a.$b(); - }; - _2.Hc = function _v(a) { - return this.a.uc(a); - }; - _2.Jc = function aw(a) { - Qb(a); - this.a.wc(new fw(a)); - }; - _2.dc = function bw() { - return this.a.dc(); - }; - _2.Kc = function cw() { - return new Ov(this.a.vc().Kc()); - }; - _2.Mc = function dw(b) { - var c2, d; - try { - return ze(this, b, true); - } catch (a) { - a = ubb(a); - if (JD(a, 41)) { - for (d = this.a.vc().Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 42); - if (Hb(b, c2.dd())) { - this.a.Bc(c2.cd()); - return true; + 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; + } } } - return false; - } else - throw vbb(a); - } - }; - _2.gc = function ew() { - return this.a.gc(); - }; - mdb(Zhe, "Maps/Values", 958); - bcb(961, 1, {}, fw); - _2.Od = function gw(a, b) { - this.a.td(b); - }; - mdb(Zhe, "Maps/Values/lambda$0$Type", 961); - bcb(736, 1987, cie, jw); - _2.xc = function nw(a) { - return this.a._b(a) ? this.a.cc(a) : null; - }; - _2.Bc = function qw(a) { - return this.a._b(a) ? this.a.fc(a) : null; - }; - _2.$b = function kw() { - this.a.$b(); - }; - _2._b = function lw(a) { - return this.a._b(a); - }; - _2.Ec = function mw() { - return new sw(this); - }; - _2.Dc = function() { - return this.Ec(); - }; - _2.dc = function ow() { - return this.a.dc(); - }; - _2.ec = function pw() { - return this.a.ec(); - }; - _2.gc = function rw() { - return this.a.ec().gc(); - }; - mdb(Zhe, "Multimaps/AsMap", 736); - bcb(1104, 1971, fie, sw); - _2.Kc = function tw() { - return Bv(this.a.a.ec(), new xw(this)); - }; - _2.Rc = function uw() { - return this.a; - }; - _2.Mc = function vw(a) { - var b; - if (!Ze(this, a)) { - return false; - } - b = BD(a, 42); - iw(this.a, b.cd()); - return true; - }; - mdb(Zhe, "Multimaps/AsMap/EntrySet", 1104); - bcb(1108, 1, {}, xw); - _2.Kb = function yw(a) { - return ww(this, a); - }; - _2.Fb = function zw(a) { - return this === a; - }; - mdb(Zhe, "Multimaps/AsMap/EntrySet/1", 1108); - bcb(543, 1989, { 543: 1, 835: 1, 20: 1, 28: 1, 14: 1 }, Cw); - _2.$b = function Dw() { - Nc(this.a); - }; - _2.Hc = function Ew(a) { - return Oc(this.a, a); - }; - _2.Jc = function Fw(a) { - Qb(a); - reb(Pc(this.a), new Rw(a)); - }; - _2.Kc = function Gw() { - return new Mv(Pc(this.a).a.kc()); - }; - _2.gc = function Hw() { - return this.a.d; - }; - _2.Nc = function Iw() { - return $j(Pc(this.a).Nc(), new Jw()); - }; - mdb(Zhe, "Multimaps/Keys", 543); - bcb(1106, 1, {}, Jw); - _2.Kb = function Kw(a) { - return BD(a, 42).cd(); - }; - mdb(Zhe, "Multimaps/Keys/0methodref$getKey$Type", 1106); - bcb(1105, 487, aie, Lw); - _2.Qd = function Mw(a) { - return new Qw(BD(a, 42)); - }; - mdb(Zhe, "Multimaps/Keys/1", 1105); - bcb(1990, 1, { 416: 1 }); - _2.Fb = function Nw(a) { - var b; - if (JD(a, 492)) { - b = BD(a, 416); - return BD(this.a.dd(), 14).gc() == BD(b.a.dd(), 14).gc() && Hb(this.a.cd(), b.a.cd()); - } - return false; - }; - _2.Hb = function Ow() { - var a; - a = this.a.cd(); - return (a == null ? 0 : tb(a)) ^ BD(this.a.dd(), 14).gc(); - }; - _2.Ib = function Pw() { - var a, b; - b = xfb(this.a.cd()); - a = BD(this.a.dd(), 14).gc(); - return a == 1 ? b : b + " x " + a; - }; - mdb(Zhe, "Multisets/AbstractEntry", 1990); - bcb(492, 1990, { 492: 1, 416: 1 }, Qw); - mdb(Zhe, "Multimaps/Keys/1/1", 492); - bcb(1107, 1, qie, Rw); - _2.td = function Sw(a) { - this.a.td(BD(a, 42).cd()); - }; - mdb(Zhe, "Multimaps/Keys/lambda$1$Type", 1107); - bcb(1110, 1, qie, Vw); - _2.td = function Ww(a) { - Tw(BD(a, 416)); - }; - mdb(Zhe, "Multiset/lambda$0$Type", 1110); - bcb(737, 1, qie, Xw); - _2.td = function Yw(a) { - Uw(this.a, BD(a, 416)); - }; - mdb(Zhe, "Multiset/lambda$1$Type", 737); - bcb(1111, 1, {}, bx); - mdb(Zhe, "Multisets/0methodref$add$Type", 1111); - bcb(738, 1, {}, cx); - _2.Kb = function dx(a) { - return _w(BD(a, 416)); - }; - mdb(Zhe, "Multisets/lambda$3$Type", 738); - bcb(2008, 1, Qhe); - mdb(Zhe, "RangeGwtSerializationDependencies", 2008); - bcb(514, 2008, { 169: 1, 514: 1, 3: 1, 45: 1 }, gx); - _2.Lb = function hx(a) { - return fx(this, BD(a, 35)); - }; - _2.Mb = function lx(a) { - return fx(this, BD(a, 35)); - }; - _2.Fb = function jx(a) { - var b; - if (JD(a, 514)) { - b = BD(a, 514); - return Ek(this.a, b.a) && Ek(this.b, b.b); - } - return false; - }; - _2.Hb = function kx() { - return this.a.Hb() * 31 + this.b.Hb(); - }; - _2.Ib = function mx() { - return nx(this.a, this.b); - }; - mdb(Zhe, "Range", 514); - bcb(778, 1999, yie, px); - _2.Zc = function tx(a) { - return jm(this.b, a); - }; - _2.Pd = function qx() { - return this.a; - }; - _2.Xb = function rx(a) { - return Em(this.b, a); - }; - _2.Fd = function sx(a) { - return jm(this.b, a); - }; - mdb(Zhe, "RegularImmutableAsList", 778); - bcb(646, 2006, yie, ux); - _2.Hd = function vx() { - return this.a; - }; - mdb(Zhe, "RegularImmutableList", 646); - bcb(616, 715, Aie, wx); - mdb(Zhe, "RegularImmutableMap", 616); - bcb(716, 703, Cie, zx); - var xx; - mdb(Zhe, "RegularImmutableSet", 716); - bcb(1976, eie, fie); - _2.Kc = function Mx() { - return new Xx(this.a, this.b); - }; - _2.Fc = function Jx(a) { - throw vbb(new bgb()); - }; - _2.Gc = function Kx(a) { - throw vbb(new bgb()); - }; - _2.$b = function Lx() { - throw vbb(new bgb()); - }; - _2.Mc = function Nx(a) { - throw vbb(new bgb()); - }; - mdb(Zhe, "Sets/SetView", 1976); - bcb(963, 1976, fie, Px); - _2.Kc = function Tx() { - return new Xx(this.a, this.b); - }; - _2.Hc = function Qx(a) { - return tqb(this.a, a) && this.b.Hc(a); - }; - _2.Ic = function Rx(a) { - return Be(this.a, a) && this.b.Ic(a); - }; - _2.dc = function Sx() { - return omb(this.b, this.a); - }; - _2.Lc = function Ux() { - return JAb(new YAb(null, new Kub(this.a, 1)), new _x(this.b)); - }; - _2.gc = function Vx() { - return Ox(this); - }; - _2.Oc = function Wx() { - return JAb(new YAb(null, new Kub(this.a, 1)), new Zx(this.b)); - }; - mdb(Zhe, "Sets/2", 963); - bcb(700, 699, Yhe, Xx); - _2.Yb = function Yx() { - var a; - while (Eqb(this.a)) { - a = Fqb(this.a); - if (this.c.Hc(a)) { - return a; + if (p3.updateStyle) { + self2.updateStyle(); + } + p3.onSet(self2); + if (p3.settingTriggersEvent) { + self2[p3.triggerFnName](p3.settingEvent); + } } } - return this.e = 2, null; - }; - mdb(Zhe, "Sets/2/1", 700); - bcb(964, 1, Oie, Zx); - _2.Mb = function $x(a) { - return this.a.Hc(a); - }; - mdb(Zhe, "Sets/2/4methodref$contains$Type", 964); - bcb(965, 1, Oie, _x); - _2.Mb = function ay(a) { - return this.a.Hc(a); - }; - mdb(Zhe, "Sets/2/5methodref$contains$Type", 965); - bcb(607, 1975, { 607: 1, 3: 1, 20: 1, 14: 1, 271: 1, 21: 1, 84: 1 }, by); - _2.Bd = function cy() { - return this.b; - }; - _2.Cd = function dy() { - return this.b; - }; - _2.Md = function ey() { - return this.b; - }; - _2.Jc = function fy(a) { - this.a.Jc(a); - }; - _2.Lc = function gy() { - return this.a.Lc(); - }; - _2.Oc = function hy() { - return this.a.Oc(); - }; - mdb(Zhe, "Sets/UnmodifiableNavigableSet", 607); - bcb(1932, 1931, Aie, iy); - _2.Ld = function jy() { - return Ql(), new oy(this.a); - }; - _2.Cc = function ky() { - return Ql(), new oy(this.a); - }; - _2.pd = function ly() { - return Ql(), new oy(this.a); - }; - mdb(Zhe, "SingletonImmutableBiMap", 1932); - bcb(647, 2006, yie, my); - _2.Hd = function ny() { - return this.a; - }; - mdb(Zhe, "SingletonImmutableList", 647); - bcb(350, 1981, Cie, oy); - _2.Kc = function ry() { - return new Ir(this.a); - }; - _2.Hc = function py(a) { - return pb(this.a, a); - }; - _2.Ed = function qy() { - return new Ir(this.a); - }; - _2.gc = function sy() { - return 1; - }; - mdb(Zhe, "SingletonImmutableSet", 350); - bcb(1115, 1, {}, vy); - _2.Kb = function wy(a) { - return BD(a, 164); - }; - mdb(Zhe, "Streams/lambda$0$Type", 1115); - bcb(1116, 1, Pie, xy); - _2.Vd = function yy() { - uy(this.a); - }; - mdb(Zhe, "Streams/lambda$1$Type", 1116); - bcb(1659, 1658, _he, Ay); - _2.Zb = function By() { - var a; - return a = this.f, BD(BD(!a ? this.f = JD(this.c, 171) ? new Sf(this, BD(this.c, 171)) : JD(this.c, 161) ? new Mf(this, BD(this.c, 161)) : new ne(this, this.c) : a, 161), 171); - }; - _2.hc = function Ey() { - return new Hxb(this.b); - }; - _2.gd = function Fy() { - return new Hxb(this.b); - }; - _2.ec = function Hy() { - var a; - return a = this.i, BD(BD(!a ? this.i = JD(this.c, 171) ? new $f(this, BD(this.c, 171)) : JD(this.c, 161) ? new Yf(this, BD(this.c, 161)) : new zf(this, this.c) : a, 84), 271); - }; - _2.ac = function Dy() { - return JD(this.c, 171) ? new Sf(this, BD(this.c, 171)) : JD(this.c, 161) ? new Mf(this, BD(this.c, 161)) : new ne(this, this.c); - }; - _2.ic = function Gy(a) { - a == null && this.a.ue(a, a); - return new Hxb(this.b); - }; - mdb(Zhe, "TreeMultimap", 1659); - bcb(78, 1, { 3: 1, 78: 1 }); - _2.Wd = function $y(a) { - return new Error(a); - }; - _2.Xd = function az() { - return this.e; - }; - _2.Yd = function bz() { - return XAb(NAb(Plb((this.k == null && (this.k = KC(_I, nie, 78, 0, 0, 1)), this.k)), new _fb())); - }; - _2.Zd = function cz() { - return this.f; - }; - _2.$d = function dz() { - return this.g; - }; - _2._d = function ez() { - Vy(this, _y(this.Wd(Wy(this, this.g)))); - Sz(this); - }; - _2.Ib = function fz() { - return Wy(this, this.$d()); - }; - _2.e = Sie; - _2.i = false; - _2.n = true; - var _I = mdb(Phe, "Throwable", 78); - bcb(102, 78, { 3: 1, 102: 1, 78: 1 }); - mdb(Phe, "Exception", 102); - bcb(60, 102, Tie, gz, hz); - mdb(Phe, "RuntimeException", 60); - bcb(598, 60, Tie); - mdb(Phe, "JsException", 598); - bcb(863, 598, Tie); - mdb(Uie, "JavaScriptExceptionBase", 863); - bcb(477, 863, { 477: 1, 3: 1, 102: 1, 60: 1, 78: 1 }, lz); - _2.$d = function oz() { - kz(this); - return this.c; - }; - _2.ae = function pz() { - return PD(this.b) === PD(iz) ? null : this.b; - }; - var iz; - mdb(Wie, "JavaScriptException", 477); - var PH = mdb(Wie, "JavaScriptObject$", 0); - var tz; - bcb(1948, 1, {}); - mdb(Wie, "Scheduler", 1948); - var xz = 0, yz = 0, zz = -1; - bcb(890, 1948, {}, Nz); - var Jz; - mdb(Uie, "SchedulerImpl", 890); - var Qz; - bcb(1960, 1, {}); - mdb(Uie, "StackTraceCreator/Collector", 1960); - bcb(864, 1960, {}, Yz); - _2.be = function Zz(a) { - var b = {}; - var c2 = []; - a[Yie] = c2; - var d = arguments.callee.caller; - while (d) { - var e = (Rz(), d.name || (d.name = Uz(d.toString()))); - c2.push(e); - var f2 = ":" + e; - var g = b[f2]; - if (g) { - var h, i3; - for (h = 0, i3 = g.length; h < i3; h++) { - if (g[h] === d) { - return; + } 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; } } } - (g || (b[f2] = [])).push(d); - d = d.caller; } - }; - _2.ce = function $z(a) { - var b, c2, d, e; - d = (Rz(), a && a[Yie] ? a[Yie] : []); - c2 = d.length; - e = KC(VI, nie, 310, c2, 0, 1); - for (b = 0; b < c2; b++) { - e[b] = new Zeb(d[b], null, -1); - } - return e; - }; - mdb(Uie, "StackTraceCreator/CollectorLegacy", 864); - bcb(1961, 1960, {}); - _2.be = function aA(a) { - }; - _2.de = function bA(a, b, c2, d) { - return new Zeb(b, a + "@" + d, c2 < 0 ? -1 : c2); - }; - _2.ce = function cA(a) { - var b, c2, d, e, f2, g; - e = Wz(a); - f2 = KC(VI, nie, 310, 0, 0, 1); - b = 0; - d = e.length; - if (d == 0) { - return f2; - } - g = _z(this, e[0]); - dfb(g.d, Xie) || (f2[b++] = g); - for (c2 = 1; c2 < d; c2++) { - f2[b++] = _z(this, e[c2]); - } - return f2; - }; - mdb(Uie, "StackTraceCreator/CollectorModern", 1961); - bcb(865, 1961, {}, dA); - _2.de = function eA(a, b, c2, d) { - return new Zeb(b, a, -1); - }; - mdb(Uie, "StackTraceCreator/CollectorModernNoSourceMap", 865); - bcb(1050, 1, {}); - mdb(yje, zje, 1050); - bcb(615, 1050, { 615: 1 }, HA); - var FA; - mdb(Aje, zje, 615); - bcb(2001, 1, {}); - mdb(yje, Bje, 2001); - bcb(2002, 2001, {}); - mdb(Aje, Bje, 2002); - bcb(1090, 1, {}, MA); - var JA; - mdb(Aje, "LocaleInfo", 1090); - bcb(1918, 1, {}, PA); - _2.a = 0; - mdb(Aje, "TimeZone", 1918); - bcb(1258, 2002, {}, VA); - mdb("com.google.gwt.i18n.client.impl.cldr", "DateTimeFormatInfoImpl", 1258); - bcb(434, 1, { 434: 1 }, WA); - _2.a = false; - _2.b = 0; - mdb(yje, "DateTimeFormat/PatternPart", 434); - bcb(199, 1, Cje, eB, fB, gB); - _2.wd = function hB(a) { - return XA(this, BD(a, 199)); - }; - _2.Fb = function iB(a) { - return JD(a, 199) && Bbb(Cbb(this.q.getTime()), Cbb(BD(a, 199).q.getTime())); - }; - _2.Hb = function jB() { - var a; - a = Cbb(this.q.getTime()); - return Tbb(Vbb(a, Pbb(a, 32))); - }; - _2.Ib = function lB() { - var a, b, c2; - c2 = -this.q.getTimezoneOffset(); - a = (c2 >= 0 ? "+" : "") + (c2 / 60 | 0); - b = kB($wnd.Math.abs(c2) % 60); - return (Dpb(), Bpb)[this.q.getDay()] + " " + Cpb[this.q.getMonth()] + " " + kB(this.q.getDate()) + " " + kB(this.q.getHours()) + ":" + kB(this.q.getMinutes()) + ":" + kB(this.q.getSeconds()) + " GMT" + a + b + " " + this.q.getFullYear(); - }; - var $J = mdb(bie, "Date", 199); - bcb(1915, 199, Cje, nB); - _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; - mdb("com.google.gwt.i18n.shared.impl", "DateRecord", 1915); - bcb(1966, 1, {}); - _2.fe = function oB() { - return null; - }; - _2.ge = function pB() { - return null; - }; - _2.he = function qB() { - return null; - }; - _2.ie = function rB() { - return null; - }; - _2.je = function sB() { - return null; - }; - mdb(Dje, "JSONValue", 1966); - bcb(216, 1966, { 216: 1 }, wB, xB); - _2.Fb = function yB(a) { - if (!JD(a, 216)) { - return false; + if (p3.updateStyle) { + self2.updateStyle(); } - return qz(this.a, BD(a, 216).a); - }; - _2.ee = function zB() { - return DB; - }; - _2.Hb = function AB() { - return rz(this.a); - }; - _2.fe = function BB() { - return this; - }; - _2.Ib = function CB() { - var a, b, c2; - c2 = new Wfb("["); - for (b = 0, a = this.a.length; b < a; b++) { - b > 0 && (c2.a += ",", c2); - Pfb(c2, tB(this, b)); - } - c2.a += "]"; - return c2.a; - }; - mdb(Dje, "JSONArray", 216); - bcb(483, 1966, { 483: 1 }, HB); - _2.ee = function IB() { - return LB; - }; - _2.ge = function JB() { - return this; - }; - _2.Ib = function KB() { - return Bcb(), "" + this.a; - }; - _2.a = false; - var EB, FB; - mdb(Dje, "JSONBoolean", 483); - bcb(985, 60, Tie, MB); - mdb(Dje, "JSONException", 985); - bcb(1023, 1966, {}, PB); - _2.ee = function QB() { - return SB; - }; - _2.Ib = function RB() { - return Xhe; - }; - var NB; - mdb(Dje, "JSONNull", 1023); - bcb(258, 1966, { 258: 1 }, TB); - _2.Fb = function UB(a) { - if (!JD(a, 258)) { - return false; + p3.onSet(self2); + if (p3.settingTriggersEvent) { + self2[p3.triggerFnName](p3.settingEvent); } - return this.a == BD(a, 258).a; - }; - _2.ee = function VB() { - return ZB; - }; - _2.Hb = function WB() { - return Hdb(this.a); - }; - _2.he = function XB() { - return this; - }; - _2.Ib = function YB() { - return this.a + ""; - }; - _2.a = 0; - mdb(Dje, "JSONNumber", 258); - bcb(183, 1966, { 183: 1 }, eC, fC); - _2.Fb = function gC(a) { - if (!JD(a, 183)) { - return false; + } 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 qz(this.a, BD(a, 183).a); - }; - _2.ee = function hC() { - return lC; - }; - _2.Hb = function iC() { - return rz(this.a); - }; - _2.ie = function jC() { - return this; - }; - _2.Ib = function kC() { - var a, b, c2, d, e, f2, g; - g = new Wfb("{"); - a = true; - f2 = $B(this, KC(ZI, nie, 2, 0, 6, 1)); - for (c2 = f2, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - a ? a = false : (g.a += She, g); - Qfb(g, vz(b)); - g.a += ":"; - Pfb(g, aC(this, b)); - } - g.a += "}"; - return g.a; - }; - mdb(Dje, "JSONObject", 183); - bcb(596, eie, fie, mC); - _2.Hc = function nC(a) { - return ND(a) && _B(this.a, GD(a)); - }; - _2.Kc = function oC() { - return new vib(new amb(this.b)); - }; - _2.gc = function pC() { - return this.b.length; - }; - mdb(Dje, "JSONObject/1", 596); - var qC; - bcb(204, 1966, { 204: 1 }, yC); - _2.Fb = function zC(a) { - if (!JD(a, 204)) { - return false; + return _ret; + } + 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; + } + } } - return dfb(this.a, BD(a, 204).a); - }; - _2.ee = function AC() { - return EC; - }; - _2.Hb = function BC() { - return LCb(this.a); - }; - _2.je = function CC() { - return this; - }; - _2.Ib = function DC() { - return vz(this.a); - }; - mdb(Dje, "JSONString", 204); - var QC; - var sD, tD, uD, vD; - bcb(1962, 1, { 525: 1 }); - mdb(Lje, "OutputStream", 1962); - bcb(1963, 1962, { 525: 1 }); - mdb(Lje, "FilterOutputStream", 1963); - bcb(866, 1963, { 525: 1 }, jcb); - mdb(Lje, "PrintStream", 866); - bcb(418, 1, { 475: 1 }); - _2.Ib = function ncb() { - return this.a; - }; - mdb(Phe, "AbstractStringBuilder", 418); - bcb(529, 60, Tie, ocb); - mdb(Phe, "ArithmeticException", 529); - bcb(73, 60, Mje, pcb, qcb); - mdb(Phe, "IndexOutOfBoundsException", 73); - bcb(320, 73, { 3: 1, 320: 1, 102: 1, 73: 1, 60: 1, 78: 1 }, rcb, scb); - mdb(Phe, "ArrayIndexOutOfBoundsException", 320); - bcb(528, 60, Tie, tcb, ucb); - mdb(Phe, "ArrayStoreException", 528); - bcb(289, 78, Nje, vcb); - mdb(Phe, "Error", 289); - bcb(194, 289, Nje, xcb, ycb); - mdb(Phe, "AssertionError", 194); - xD = { 3: 1, 476: 1, 35: 1 }; - var zcb, Acb; - var wI = mdb(Phe, "Boolean", 476); - bcb(236, 1, { 3: 1, 236: 1 }); - var Gcb; - mdb(Phe, "Number", 236); - bcb(217, 236, { 3: 1, 217: 1, 35: 1, 236: 1 }, Mcb); - _2.wd = function Ncb(a) { - return Lcb(this, BD(a, 217)); - }; - _2.ke = function Ocb() { - return this.a; - }; - _2.Fb = function Pcb(a) { - return JD(a, 217) && BD(a, 217).a == this.a; - }; - _2.Hb = function Qcb() { - return this.a; - }; - _2.Ib = function Rcb() { - return "" + this.a; - }; - _2.a = 0; - var xI = mdb(Phe, "Byte", 217); - var Tcb; - bcb(172, 1, { 3: 1, 172: 1, 35: 1 }, Xcb); - _2.wd = function Ycb(a) { - return Wcb(this, BD(a, 172)); - }; - _2.Fb = function $cb(a) { - return JD(a, 172) && BD(a, 172).a == this.a; - }; - _2.Hb = function _cb() { - return this.a; - }; - _2.Ib = function adb() { - return String.fromCharCode(this.a); - }; - _2.a = 0; - var Vcb; - var yI = mdb(Phe, "Character", 172); - var cdb; - bcb(205, 60, { 3: 1, 205: 1, 102: 1, 60: 1, 78: 1 }, Bdb, Cdb); - mdb(Phe, "ClassCastException", 205); - yD = { 3: 1, 35: 1, 333: 1, 236: 1 }; - var BI = mdb(Phe, "Double", 333); - bcb(155, 236, { 3: 1, 35: 1, 155: 1, 236: 1 }, Ndb, Odb); - _2.wd = function Pdb(a) { - return Mdb(this, BD(a, 155)); - }; - _2.ke = function Qdb() { - return this.a; - }; - _2.Fb = function Rdb(a) { - return JD(a, 155) && Fdb(this.a, BD(a, 155).a); - }; - _2.Hb = function Sdb() { - return QD(this.a); - }; - _2.Ib = function Udb() { - return "" + this.a; - }; - _2.a = 0; - var FI = mdb(Phe, "Float", 155); - bcb(32, 60, { 3: 1, 102: 1, 32: 1, 60: 1, 78: 1 }, Vdb, Wdb, Xdb); - mdb(Phe, "IllegalArgumentException", 32); - bcb(71, 60, Tie, Ydb, Zdb); - mdb(Phe, "IllegalStateException", 71); - bcb(19, 236, { 3: 1, 35: 1, 19: 1, 236: 1 }, _db); - _2.wd = function ceb(a) { - return $db(this, BD(a, 19)); - }; - _2.ke = function deb() { - return this.a; - }; - _2.Fb = function eeb(a) { - return JD(a, 19) && BD(a, 19).a == this.a; - }; - _2.Hb = function feb() { - return this.a; - }; - _2.Ib = function leb() { - return "" + this.a; - }; - _2.a = 0; - var JI = mdb(Phe, "Integer", 19); - var neb; - var peb; - bcb(162, 236, { 3: 1, 35: 1, 162: 1, 236: 1 }, teb); - _2.wd = function veb(a) { - return seb(this, BD(a, 162)); - }; - _2.ke = function web() { - return Sbb(this.a); - }; - _2.Fb = function xeb(a) { - return JD(a, 162) && Bbb(BD(a, 162).a, this.a); - }; - _2.Hb = function yeb() { - return Tbb(this.a); - }; - _2.Ib = function zeb() { - return "" + Ubb(this.a); - }; - _2.a = 0; - var MI = mdb(Phe, "Long", 162); - var Beb; - bcb(2039, 1, {}); - bcb(1831, 60, Tie, Feb); - mdb(Phe, "NegativeArraySizeException", 1831); - bcb(173, 598, { 3: 1, 102: 1, 173: 1, 60: 1, 78: 1 }, Geb, Heb); - _2.Wd = function Ieb(a) { - return new TypeError(a); - }; - mdb(Phe, "NullPointerException", 173); - var Jeb, Keb, Leb, Meb; - bcb(127, 32, { 3: 1, 102: 1, 32: 1, 127: 1, 60: 1, 78: 1 }, Oeb); - mdb(Phe, "NumberFormatException", 127); - bcb(184, 236, { 3: 1, 35: 1, 236: 1, 184: 1 }, Qeb); - _2.wd = function Reb(a) { - return Peb(this, BD(a, 184)); - }; - _2.ke = function Seb() { - return this.a; - }; - _2.Fb = function Teb(a) { - return JD(a, 184) && BD(a, 184).a == this.a; - }; - _2.Hb = function Ueb() { - return this.a; - }; - _2.Ib = function Veb() { - return "" + this.a; - }; - _2.a = 0; - var UI = mdb(Phe, "Short", 184); - var Xeb; - bcb(310, 1, { 3: 1, 310: 1 }, Zeb); - _2.Fb = function $eb(a) { - var b; - if (JD(a, 310)) { - b = BD(a, 310); - return this.c == b.c && this.d == b.d && this.a == b.a && this.b == b.b; + if (p3.triggerEvent) { + self2[p3.triggerFnName](p3.event); } - return false; - }; - _2.Hb = function _eb() { - return Hlb(OC(GC(SI, 1), Uhe, 1, 5, [meb(this.c), this.a, this.d, this.b])); - }; - _2.Ib = function afb() { - return this.a + "." + this.d + "(" + (this.b != null ? this.b : "Unknown Source") + (this.c >= 0 ? ":" + this.c : "") + ")"; - }; - _2.c = 0; - var VI = mdb(Phe, "StackTraceElement", 310); - zD = { 3: 1, 475: 1, 35: 1, 2: 1 }; - var ZI = mdb(Phe, Vie, 2); - bcb(107, 418, { 475: 1 }, Hfb, Ifb, Jfb); - mdb(Phe, "StringBuffer", 107); - bcb(100, 418, { 475: 1 }, Ufb, Vfb, Wfb); - mdb(Phe, "StringBuilder", 100); - bcb(687, 73, Mje, Xfb); - mdb(Phe, "StringIndexOutOfBoundsException", 687); - bcb(2043, 1, {}); - var Yfb; - bcb(844, 1, {}, _fb); - _2.Kb = function agb(a) { - return BD(a, 78).e; - }; - mdb(Phe, "Throwable/lambda$0$Type", 844); - bcb(41, 60, { 3: 1, 102: 1, 60: 1, 78: 1, 41: 1 }, bgb, cgb); - mdb(Phe, "UnsupportedOperationException", 41); - bcb(240, 236, { 3: 1, 35: 1, 236: 1, 240: 1 }, sgb, tgb); - _2.wd = function wgb(a) { - return mgb(this, BD(a, 240)); - }; - _2.ke = function xgb() { - return Hcb(rgb2(this)); - }; - _2.Fb = function ygb(a) { - var b; - if (this === a) { - return true; + } 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; + } + } } - if (JD(a, 240)) { - b = BD(a, 240); - return this.e == b.e && mgb(this, b) == 0; + if (p3.triggerEvent) { + self2[p3.triggerFnName](p3.event); } - return false; - }; - _2.Hb = function zgb() { - var a; - if (this.b != 0) { - return this.b; - } - if (this.a < 54) { - a = Cbb(this.f); - this.b = Tbb(xbb(a, -1)); - this.b = 33 * this.b + Tbb(xbb(Obb(a, 32), -1)); - this.b = 17 * this.b + QD(this.e); - return this.b; - } - this.b = 17 * Ngb(this.c) + QD(this.e); - return this.b; - }; - _2.Ib = function Agb() { - return rgb2(this); - }; - _2.a = 0; - _2.b = 0; - _2.d = 0; - _2.e = 0; - _2.f = 0; - var dgb, egb, fgb, ggb, hgb, igb, jgb, kgb; - var bJ = mdb("java.math", "BigDecimal", 240); - bcb(91, 236, { 3: 1, 35: 1, 236: 1, 91: 1 }, Tgb, Ugb, Vgb, Wgb, Xgb, Ygb); - _2.wd = function $gb(a) { - return Igb(this, BD(a, 91)); - }; - _2.ke = function _gb() { - return Hcb(shb(this, 0)); - }; - _2.Fb = function ahb(a) { - return Kgb(this, a); - }; - _2.Hb = function chb() { - return Ngb(this); - }; - _2.Ib = function ehb() { - return shb(this, 0); - }; - _2.b = -2; - _2.c = 0; - _2.d = 0; - _2.e = 0; - var Bgb, Cgb, Dgb, Egb, Fgb, Ggb; - var cJ = mdb("java.math", "BigInteger", 91); - var nhb, ohb; - var Bhb, Chb; - bcb(488, 1967, cie); - _2.$b = function Xhb() { - Uhb(this); - }; - _2._b = function Yhb(a) { - return Mhb(this, a); - }; - _2.uc = function Zhb(a) { - return Nhb(this, a, this.g) || Nhb(this, a, this.f); - }; - _2.vc = function $hb() { - return new eib(this); - }; - _2.xc = function _hb(a) { - return Ohb(this, a); - }; - _2.zc = function aib(a, b) { - return Rhb(this, a, b); - }; - _2.Bc = function bib(a) { - return Thb(this, a); - }; - _2.gc = function cib() { - return Vhb(this); - }; - mdb(bie, "AbstractHashMap", 488); - bcb(261, eie, fie, eib); - _2.$b = function fib() { - this.a.$b(); - }; - _2.Hc = function gib(a) { - return dib(this, a); - }; - _2.Kc = function hib() { - return new nib(this.a); - }; - _2.Mc = function iib(a) { - var b; - if (dib(this, a)) { - b = BD(a, 42).cd(); - this.a.Bc(b); - return true; + } + 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; } - return false; - }; - _2.gc = function jib() { - return this.a.gc(); - }; - mdb(bie, "AbstractHashMap/EntrySet", 261); - bcb(262, 1, aie, nib); - _2.Nb = function oib(a) { - Rrb(this, a); - }; - _2.Pb = function qib() { - return lib(this); - }; - _2.Ob = function pib() { - return this.b; - }; - _2.Qb = function rib() { - mib(this); - }; - _2.b = false; - mdb(bie, "AbstractHashMap/EntrySetIterator", 262); - bcb(417, 1, aie, vib); - _2.Nb = function wib(a) { - Rrb(this, a); - }; - _2.Ob = function xib() { - return sib(this); - }; - _2.Pb = function yib() { - return tib(this); - }; - _2.Qb = function zib() { - uib(this); - }; - _2.b = 0; - _2.c = -1; - mdb(bie, "AbstractList/IteratorImpl", 417); - bcb(96, 417, jie, Bib); - _2.Qb = function Hib() { - uib(this); - }; - _2.Rb = function Cib(a) { - Aib(this, a); - }; - _2.Sb = function Dib() { - return this.b > 0; - }; - _2.Tb = function Eib() { - return this.b; - }; - _2.Ub = function Fib() { - return sCb(this.b > 0), this.a.Xb(this.c = --this.b); - }; - _2.Vb = function Gib() { - return this.b - 1; - }; - _2.Wb = function Iib(a) { - yCb(this.c != -1); - this.a._c(this.c, a); - }; - mdb(bie, "AbstractList/ListIteratorImpl", 96); - bcb(219, 52, Lie, Jib); - _2.Vc = function Kib(a, b) { - wCb(a, this.b); - this.c.Vc(this.a + a, b); - ++this.b; - }; - _2.Xb = function Lib(a) { - tCb(a, this.b); - return this.c.Xb(this.a + a); - }; - _2.$c = function Mib(a) { - var b; - tCb(a, this.b); - b = this.c.$c(this.a + a); - --this.b; - return b; - }; - _2._c = function Nib(a, b) { - tCb(a, this.b); - return this.c._c(this.a + a, b); - }; - _2.gc = function Oib() { - return this.b; - }; - _2.a = 0; - _2.b = 0; - mdb(bie, "AbstractList/SubList", 219); - bcb(384, eie, fie, Pib); - _2.$b = function Qib() { - this.a.$b(); - }; - _2.Hc = function Rib(a) { - return this.a._b(a); - }; - _2.Kc = function Sib() { - var a; - return a = this.a.vc().Kc(), new Vib(a); - }; - _2.Mc = function Tib(a) { - if (this.a._b(a)) { - this.a.Bc(a); - return true; - } - return false; - }; - _2.gc = function Uib() { - return this.a.gc(); - }; - mdb(bie, "AbstractMap/1", 384); - bcb(691, 1, aie, Vib); - _2.Nb = function Wib(a) { - Rrb(this, a); - }; - _2.Ob = function Xib() { - return this.a.Ob(); - }; - _2.Pb = function Yib() { - var a; - return a = BD(this.a.Pb(), 42), a.cd(); - }; - _2.Qb = function Zib() { - this.a.Qb(); - }; - mdb(bie, "AbstractMap/1/1", 691); - bcb(226, 28, die, $ib); - _2.$b = function _ib() { - this.a.$b(); - }; - _2.Hc = function ajb(a) { - return this.a.uc(a); - }; - _2.Kc = function bjb() { - var a; - return a = this.a.vc().Kc(), new djb(a); - }; - _2.gc = function cjb() { - return this.a.gc(); - }; - mdb(bie, "AbstractMap/2", 226); - bcb(294, 1, aie, djb); - _2.Nb = function ejb(a) { - Rrb(this, a); - }; - _2.Ob = function fjb() { - return this.a.Ob(); - }; - _2.Pb = function gjb() { - var a; - return a = BD(this.a.Pb(), 42), a.dd(); - }; - _2.Qb = function hjb() { - this.a.Qb(); - }; - mdb(bie, "AbstractMap/2/1", 294); - bcb(484, 1, { 484: 1, 42: 1 }); - _2.Fb = function jjb(a) { - var b; - if (!JD(a, 42)) { - return false; - } - b = BD(a, 42); - return wtb(this.d, b.cd()) && wtb(this.e, b.dd()); - }; - _2.cd = function kjb() { - return this.d; - }; - _2.dd = function ljb() { - return this.e; - }; - _2.Hb = function mjb() { - return xtb(this.d) ^ xtb(this.e); - }; - _2.ed = function njb(a) { - return ijb(this, a); - }; - _2.Ib = function ojb() { - return this.d + "=" + this.e; - }; - mdb(bie, "AbstractMap/AbstractEntry", 484); - bcb(383, 484, { 484: 1, 383: 1, 42: 1 }, pjb); - mdb(bie, "AbstractMap/SimpleEntry", 383); - bcb(1984, 1, _je); - _2.Fb = function qjb(a) { - var b; - if (!JD(a, 42)) { - return false; - } - b = BD(a, 42); - return wtb(this.cd(), b.cd()) && wtb(this.dd(), b.dd()); - }; - _2.Hb = function rjb() { - return xtb(this.cd()) ^ xtb(this.dd()); - }; - _2.Ib = function sjb() { - return this.cd() + "=" + this.dd(); - }; - mdb(bie, lie, 1984); - bcb(1992, 1967, gie); - _2.tc = function vjb(a) { - return tjb(this, a); - }; - _2._b = function wjb(a) { - return ujb(this, a); - }; - _2.vc = function xjb() { - return new Bjb(this); - }; - _2.xc = function yjb(a) { - var b; - b = a; - return Wd(Awb(this, b)); - }; - _2.ec = function Ajb() { - return new Gjb(this); - }; - mdb(bie, "AbstractNavigableMap", 1992); - bcb(739, eie, fie, Bjb); - _2.Hc = function Cjb(a) { - return JD(a, 42) && tjb(this.b, BD(a, 42)); - }; - _2.Kc = function Djb() { - return new Ywb(this.b); - }; - _2.Mc = function Ejb(a) { - var b; - if (JD(a, 42)) { - b = BD(a, 42); - return Kwb(this.b, b); - } - return false; - }; - _2.gc = function Fjb() { - return this.b.c; - }; - mdb(bie, "AbstractNavigableMap/EntrySet", 739); - bcb(493, eie, iie, Gjb); - _2.Nc = function Mjb() { - return new Rub(this); - }; - _2.$b = function Hjb() { - zwb(this.a); - }; - _2.Hc = function Ijb(a) { - return ujb(this.a, a); - }; - _2.Kc = function Jjb() { - var a; - return a = new Ywb(new cxb(this.a).b), new Njb(a); - }; - _2.Mc = function Kjb(a) { - if (ujb(this.a, a)) { - Jwb(this.a, a); - return true; - } - return false; - }; - _2.gc = function Ljb() { - return this.a.c; - }; - mdb(bie, "AbstractNavigableMap/NavigableKeySet", 493); - bcb(494, 1, aie, Njb); - _2.Nb = function Ojb(a) { - Rrb(this, a); - }; - _2.Ob = function Pjb() { - return sib(this.a.a); - }; - _2.Pb = function Qjb() { - var a; - return a = Wwb(this.a), a.cd(); - }; - _2.Qb = function Rjb() { - Xwb(this.a); - }; - mdb(bie, "AbstractNavigableMap/NavigableKeySet/1", 494); - bcb(2004, 28, die); - _2.Fc = function Sjb(a) { - return zCb(cub(this, a)), true; - }; - _2.Gc = function Tjb(a) { - uCb(a); - mCb(a != this, "Can't add a queue to itself"); - return ye(this, a); - }; - _2.$b = function Ujb() { - while (dub(this) != null) - ; - }; - mdb(bie, "AbstractQueue", 2004); - bcb(302, 28, { 4: 1, 20: 1, 28: 1, 14: 1 }, jkb, kkb); - _2.Fc = function lkb(a) { - return Xjb(this, a), true; - }; - _2.$b = function nkb() { - Yjb(this); - }; - _2.Hc = function okb(a) { - return Zjb(new xkb(this), a); - }; - _2.dc = function pkb() { - return akb(this); - }; - _2.Kc = function qkb() { - return new xkb(this); - }; - _2.Mc = function rkb(a) { - return dkb(new xkb(this), a); - }; - _2.gc = function skb() { - return this.c - this.b & this.a.length - 1; - }; - _2.Nc = function tkb() { - return new Kub(this, 272); - }; - _2.Qc = function ukb(a) { - var b; - b = this.c - this.b & this.a.length - 1; - a.length < b && (a = eCb(new Array(b), a)); - $jb(this, a, b); - a.length > b && NC(a, b, null); - return a; - }; - _2.b = 0; - _2.c = 0; - mdb(bie, "ArrayDeque", 302); - bcb(446, 1, aie, xkb); - _2.Nb = function ykb(a) { - Rrb(this, a); - }; - _2.Ob = function zkb() { - return this.a != this.b; - }; - _2.Pb = function Akb() { - return vkb(this); - }; - _2.Qb = function Bkb() { - wkb(this); - }; - _2.a = 0; - _2.b = 0; - _2.c = -1; - mdb(bie, "ArrayDeque/IteratorImpl", 446); - bcb(12, 52, ake, Rkb, Skb, Tkb); - _2.Vc = function Ukb(a, b) { - Dkb(this, a, b); - }; - _2.Fc = function Vkb(a) { - return Ekb(this, a); - }; - _2.Wc = function Wkb(a, b) { - return Fkb(this, a, b); - }; - _2.Gc = function Xkb(a) { - return Gkb(this, a); - }; - _2.$b = function Ykb() { - this.c = KC(SI, Uhe, 1, 0, 5, 1); - }; - _2.Hc = function Zkb(a) { - return Jkb(this, a, 0) != -1; - }; - _2.Jc = function $kb(a) { - Hkb(this, a); - }; - _2.Xb = function _kb(a) { - return Ikb(this, a); - }; - _2.Xc = function alb(a) { - return Jkb(this, a, 0); - }; - _2.dc = function blb() { - return this.c.length == 0; - }; - _2.Kc = function clb() { - return new olb(this); - }; - _2.$c = function dlb(a) { - return Kkb(this, a); - }; - _2.Mc = function elb(a) { - return Lkb(this, a); - }; - _2.Ud = function flb(a, b) { - Mkb(this, a, b); - }; - _2._c = function glb(a, b) { - return Nkb(this, a, b); - }; - _2.gc = function hlb() { - return this.c.length; - }; - _2.ad = function ilb(a) { - Okb(this, a); - }; - _2.Pc = function jlb() { - return Pkb(this); - }; - _2.Qc = function klb(a) { - return Qkb(this, a); - }; - var DJ = mdb(bie, "ArrayList", 12); - bcb(7, 1, aie, olb); - _2.Nb = function plb(a) { - Rrb(this, a); - }; - _2.Ob = function qlb() { - return llb(this); - }; - _2.Pb = function rlb() { - return mlb(this); - }; - _2.Qb = function slb() { - nlb(this); - }; - _2.a = 0; - _2.b = -1; - mdb(bie, "ArrayList/1", 7); - bcb(2013, $wnd.Function, {}, Ylb); - _2.te = function Zlb(a, b) { - return Kdb(a, b); - }; - bcb(154, 52, bke, amb); - _2.Hc = function bmb(a) { - return Bt(this, a) != -1; - }; - _2.Jc = function cmb(a) { - var b, c2, d, e; - uCb(a); - for (c2 = this.a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - a.td(b); - } - }; - _2.Xb = function dmb(a) { - return $lb(this, a); - }; - _2._c = function emb(a, b) { - var c2; - c2 = (tCb(a, this.a.length), this.a[a]); - NC(this.a, a, b); - return c2; - }; - _2.gc = function fmb() { - return this.a.length; - }; - _2.ad = function gmb(a) { - Mlb(this.a, this.a.length, a); - }; - _2.Pc = function hmb() { - return _lb(this, KC(SI, Uhe, 1, this.a.length, 5, 1)); - }; - _2.Qc = function imb(a) { - return _lb(this, a); - }; - mdb(bie, "Arrays/ArrayList", 154); - var jmb, kmb, lmb; - bcb(940, 52, bke, xmb); - _2.Hc = function ymb(a) { - return false; - }; - _2.Xb = function zmb(a) { - return wmb(a); - }; - _2.Kc = function Amb() { - return mmb(), Emb(), Dmb; - }; - _2.Yc = function Bmb() { - return mmb(), Emb(), Dmb; - }; - _2.gc = function Cmb() { - return 0; - }; - mdb(bie, "Collections/EmptyList", 940); - bcb(941, 1, jie, Fmb); - _2.Nb = function Hmb(a) { - Rrb(this, a); - }; - _2.Rb = function Gmb(a) { - throw vbb(new bgb()); - }; - _2.Ob = function Imb() { - return false; - }; - _2.Sb = function Jmb() { - return false; - }; - _2.Pb = function Kmb() { - throw vbb(new utb()); - }; - _2.Tb = function Lmb() { - return 0; - }; - _2.Ub = function Mmb() { - throw vbb(new utb()); - }; - _2.Vb = function Nmb() { - return -1; - }; - _2.Qb = function Omb() { - throw vbb(new Ydb()); - }; - _2.Wb = function Pmb(a) { - throw vbb(new Ydb()); - }; - var Dmb; - mdb(bie, "Collections/EmptyListIterator", 941); - bcb(943, 1967, Aie, Qmb); - _2._b = function Rmb(a) { - return false; - }; - _2.uc = function Smb(a) { - return false; - }; - _2.vc = function Tmb() { - return mmb(), lmb; - }; - _2.xc = function Umb(a) { - return null; - }; - _2.ec = function Vmb() { - return mmb(), lmb; - }; - _2.gc = function Wmb() { - return 0; - }; - _2.Cc = function Xmb() { - return mmb(), jmb; - }; - mdb(bie, "Collections/EmptyMap", 943); - bcb(942, eie, Cie, Ymb); - _2.Hc = function Zmb(a) { - return false; - }; - _2.Kc = function $mb() { - return mmb(), Emb(), Dmb; - }; - _2.gc = function _mb() { - return 0; - }; - mdb(bie, "Collections/EmptySet", 942); - bcb(599, 52, { 3: 1, 20: 1, 28: 1, 52: 1, 14: 1, 15: 1 }, anb); - _2.Hc = function bnb(a) { - return wtb(this.a, a); - }; - _2.Xb = function cnb(a) { - tCb(a, 1); - return this.a; - }; - _2.gc = function dnb() { - return 1; - }; - mdb(bie, "Collections/SingletonList", 599); - bcb(372, 1, wie, lnb); - _2.Jc = function rnb(a) { - reb(this, a); - }; - _2.Lc = function unb() { - return new YAb(null, this.Nc()); - }; - _2.Nc = function xnb() { - return new Kub(this, 0); - }; - _2.Oc = function ynb() { - return new YAb(null, this.Nc()); - }; - _2.Fc = function mnb(a) { - return enb(); - }; - _2.Gc = function nnb(a) { - return fnb(); - }; - _2.$b = function onb() { - gnb(); - }; - _2.Hc = function pnb(a) { - return hnb(this, a); - }; - _2.Ic = function qnb(a) { - return inb(this, a); - }; - _2.dc = function snb() { - return this.b.dc(); - }; - _2.Kc = function tnb() { - return new Dnb(this.b.Kc()); - }; - _2.Mc = function vnb(a) { - return jnb(); - }; - _2.gc = function wnb() { - return this.b.gc(); - }; - _2.Pc = function znb() { - return this.b.Pc(); - }; - _2.Qc = function Anb(a) { - return knb(this, a); - }; - _2.Ib = function Bnb() { - return fcb(this.b); - }; - mdb(bie, "Collections/UnmodifiableCollection", 372); - bcb(371, 1, aie, Dnb); - _2.Nb = function Enb(a) { - Rrb(this, a); - }; - _2.Ob = function Fnb() { - return this.b.Ob(); - }; - _2.Pb = function Gnb() { - return this.b.Pb(); - }; - _2.Qb = function Hnb() { - Cnb(); - }; - mdb(bie, "Collections/UnmodifiableCollectionIterator", 371); - bcb(531, 372, cke, Inb); - _2.Nc = function Vnb() { - return new Kub(this, 16); - }; - _2.Vc = function Jnb(a, b) { - throw vbb(new bgb()); - }; - _2.Wc = function Knb(a, b) { - throw vbb(new bgb()); - }; - _2.Fb = function Lnb(a) { - return pb(this.a, a); - }; - _2.Xb = function Mnb(a) { - return this.a.Xb(a); - }; - _2.Hb = function Nnb() { - return tb(this.a); - }; - _2.Xc = function Onb(a) { - return this.a.Xc(a); - }; - _2.dc = function Pnb() { - return this.a.dc(); - }; - _2.Yc = function Qnb() { - return new Xnb(this.a.Zc(0)); - }; - _2.Zc = function Rnb(a) { - return new Xnb(this.a.Zc(a)); - }; - _2.$c = function Snb(a) { - throw vbb(new bgb()); - }; - _2._c = function Tnb(a, b) { - throw vbb(new bgb()); - }; - _2.ad = function Unb(a) { - throw vbb(new bgb()); - }; - _2.bd = function Wnb(a, b) { - return new Inb(this.a.bd(a, b)); - }; - mdb(bie, "Collections/UnmodifiableList", 531); - bcb(690, 371, jie, Xnb); - _2.Qb = function bob() { - Cnb(); - }; - _2.Rb = function Ynb(a) { - throw vbb(new bgb()); - }; - _2.Sb = function Znb() { - return this.a.Sb(); - }; - _2.Tb = function $nb() { - return this.a.Tb(); - }; - _2.Ub = function _nb() { - return this.a.Ub(); - }; - _2.Vb = function aob() { - return this.a.Vb(); - }; - _2.Wb = function cob(a) { - throw vbb(new bgb()); - }; - mdb(bie, "Collections/UnmodifiableListIterator", 690); - bcb(600, 1, cie, iob); - _2.wc = function oob(a) { - stb(this, a); - }; - _2.yc = function tob(a, b, c2) { - return ttb(this, a, b, c2); - }; - _2.$b = function job() { - throw vbb(new bgb()); - }; - _2._b = function kob(a) { - return this.c._b(a); - }; - _2.uc = function lob(a) { - return dob(this, a); - }; - _2.vc = function mob() { - return eob(this); - }; - _2.Fb = function nob(a) { - return fob(this, a); - }; - _2.xc = function pob(a) { - return this.c.xc(a); - }; - _2.Hb = function qob() { - return tb(this.c); - }; - _2.dc = function rob() { - return this.c.dc(); - }; - _2.ec = function sob() { - return gob(this); - }; - _2.zc = function uob(a, b) { - throw vbb(new bgb()); - }; - _2.Bc = function vob(a) { - throw vbb(new bgb()); - }; - _2.gc = function wob() { - return this.c.gc(); - }; - _2.Ib = function xob() { - return fcb(this.c); - }; - _2.Cc = function yob() { - return hob(this); - }; - mdb(bie, "Collections/UnmodifiableMap", 600); - bcb(382, 372, Bie, zob); - _2.Nc = function Cob() { - return new Kub(this, 1); - }; - _2.Fb = function Aob(a) { - return pb(this.b, a); - }; - _2.Hb = function Bob() { - return tb(this.b); - }; - mdb(bie, "Collections/UnmodifiableSet", 382); - bcb(944, 382, Bie, Gob); - _2.Hc = function Hob(a) { - return Dob(this, a); - }; - _2.Ic = function Iob(a) { - return this.b.Ic(a); - }; - _2.Kc = function Job() { - var a; - a = this.b.Kc(); - return new Mob(a); - }; - _2.Pc = function Kob() { - var a; - a = this.b.Pc(); - Fob(a, a.length); - return a; - }; - _2.Qc = function Lob(a) { - return Eob(this, a); - }; - mdb(bie, "Collections/UnmodifiableMap/UnmodifiableEntrySet", 944); - bcb(945, 1, aie, Mob); - _2.Nb = function Nob(a) { - Rrb(this, a); - }; - _2.Pb = function Pob() { - return new Rob(BD(this.a.Pb(), 42)); - }; - _2.Ob = function Oob() { - return this.a.Ob(); - }; - _2.Qb = function Qob() { - throw vbb(new bgb()); - }; - mdb(bie, "Collections/UnmodifiableMap/UnmodifiableEntrySet/1", 945); - bcb(688, 1, _je, Rob); - _2.Fb = function Sob(a) { - return this.a.Fb(a); - }; - _2.cd = function Tob() { - return this.a.cd(); - }; - _2.dd = function Uob() { - return this.a.dd(); - }; - _2.Hb = function Vob() { - return this.a.Hb(); - }; - _2.ed = function Wob(a) { - throw vbb(new bgb()); - }; - _2.Ib = function Xob() { - return fcb(this.a); - }; - mdb(bie, "Collections/UnmodifiableMap/UnmodifiableEntrySet/UnmodifiableEntry", 688); - bcb(601, 531, { 20: 1, 14: 1, 15: 1, 54: 1 }, Yob); - mdb(bie, "Collections/UnmodifiableRandomAccessList", 601); - bcb(689, 382, Die, Zob); - _2.Nc = function apb() { - return new Rub(this); - }; - _2.Fb = function $ob(a) { - return pb(this.a, a); - }; - _2.Hb = function _ob() { - return tb(this.a); - }; - mdb(bie, "Collections/UnmodifiableSortedSet", 689); - bcb(847, 1, dke, bpb); - _2.ue = function cpb(a, b) { - var c2; - return c2 = Ucc(BD(a, 11), BD(b, 11)), c2 != 0 ? c2 : Wcc(BD(a, 11), BD(b, 11)); - }; - _2.Fb = function dpb(a) { - return this === a; - }; - _2.ve = function epb() { - return new tpb(this); - }; - mdb(bie, "Comparator/lambda$0$Type", 847); - var fpb, gpb, hpb; - bcb(751, 1, dke, kpb); - _2.ue = function lpb(a, b) { - return jpb(BD(a, 35), BD(b, 35)); - }; - _2.Fb = function mpb(a) { - return this === a; - }; - _2.ve = function npb() { - return ipb(), hpb; - }; - mdb(bie, "Comparators/NaturalOrderComparator", 751); - bcb(1177, 1, dke, ppb); - _2.ue = function qpb(a, b) { - return opb(BD(a, 35), BD(b, 35)); - }; - _2.Fb = function rpb(a) { - return this === a; - }; - _2.ve = function spb() { - return ipb(), gpb; - }; - mdb(bie, "Comparators/ReverseNaturalOrderComparator", 1177); - bcb(64, 1, dke, tpb); - _2.Fb = function vpb(a) { - return this === a; - }; - _2.ue = function upb(a, b) { - return this.a.ue(b, a); - }; - _2.ve = function wpb() { - return this.a; - }; - mdb(bie, "Comparators/ReversedComparator", 64); - bcb(166, 60, Tie, Apb); - mdb(bie, "ConcurrentModificationException", 166); - var Bpb, Cpb; - bcb(1904, 1, eke, Gpb); - _2.we = function Hpb(a) { - Epb(this, a); - }; - _2.Ib = function Ipb() { - return "DoubleSummaryStatistics[count = " + Ubb(this.a) + ", avg = " + (Dbb(this.a, 0) ? Fpb(this) / Sbb(this.a) : 0) + ", min = " + this.c + ", max = " + this.b + ", sum = " + Fpb(this) + "]"; - }; - _2.a = 0; - _2.b = Qje; - _2.c = Pje; - _2.d = 0; - _2.e = 0; - _2.f = 0; - mdb(bie, "DoubleSummaryStatistics", 1904); - bcb(1805, 60, Tie, Jpb); - mdb(bie, "EmptyStackException", 1805); - bcb(451, 1967, cie, Rpb); - _2.zc = function Xpb(a, b) { - return Opb(this, a, b); - }; - _2.$b = function Spb() { - Kpb(this); - }; - _2._b = function Tpb(a) { - return Lpb(this, a); - }; - _2.uc = function Upb(a) { - var b, c2; - for (c2 = new Gqb(this.a); c2.a < c2.c.a.length; ) { - b = Fqb(c2); - if (wtb(a, this.b[b.g])) { - return true; - } - } - return false; - }; - _2.vc = function Vpb() { - return new _pb(this); - }; - _2.xc = function Wpb(a) { - return Mpb(this, a); - }; - _2.Bc = function Ypb(a) { - return Ppb(this, a); - }; - _2.gc = function Zpb() { - return this.a.c; - }; - mdb(bie, "EnumMap", 451); - bcb(1352, eie, fie, _pb); - _2.$b = function aqb() { - Kpb(this.a); - }; - _2.Hc = function bqb(a) { - return $pb(this, a); - }; - _2.Kc = function cqb() { - return new fqb(this.a); - }; - _2.Mc = function dqb(a) { - var b; - if ($pb(this, a)) { - b = BD(a, 42).cd(); - Ppb(this.a, b); - return true; - } - return false; - }; - _2.gc = function eqb() { - return this.a.a.c; - }; - mdb(bie, "EnumMap/EntrySet", 1352); - bcb(1353, 1, aie, fqb); - _2.Nb = function gqb(a) { - Rrb(this, a); - }; - _2.Pb = function iqb() { - return this.b = Fqb(this.a), new kqb(this.c, this.b); - }; - _2.Ob = function hqb() { - return Eqb(this.a); - }; - _2.Qb = function jqb() { - yCb(!!this.b); - Ppb(this.c, this.b); - this.b = null; - }; - mdb(bie, "EnumMap/EntrySetIterator", 1353); - bcb(1354, 1984, _je, kqb); - _2.cd = function lqb() { - return this.a; - }; - _2.dd = function mqb() { - return this.b.b[this.a.g]; - }; - _2.ed = function nqb(a) { - return Qpb(this.b, this.a.g, a); - }; - mdb(bie, "EnumMap/MapEntry", 1354); - bcb(174, eie, { 20: 1, 28: 1, 14: 1, 174: 1, 21: 1 }); - var hK = mdb(bie, "EnumSet", 174); - bcb(156, 174, { 20: 1, 28: 1, 14: 1, 174: 1, 156: 1, 21: 1 }, xqb); - _2.Fc = function yqb(a) { - return rqb(this, BD(a, 22)); - }; - _2.Hc = function zqb(a) { - return tqb(this, a); - }; - _2.Kc = function Aqb() { - return new Gqb(this); - }; - _2.Mc = function Bqb(a) { - return vqb(this, a); - }; - _2.gc = function Cqb() { - return this.c; - }; - _2.c = 0; - mdb(bie, "EnumSet/EnumSetImpl", 156); - bcb(343, 1, aie, Gqb); - _2.Nb = function Hqb(a) { - Rrb(this, a); - }; - _2.Pb = function Jqb() { - return Fqb(this); - }; - _2.Ob = function Iqb() { - return Eqb(this); - }; - _2.Qb = function Kqb() { - yCb(this.b != -1); - NC(this.c.b, this.b, null); - --this.c.c; - this.b = -1; - }; - _2.a = -1; - _2.b = -1; - mdb(bie, "EnumSet/EnumSetImpl/IteratorImpl", 343); - bcb(43, 488, fke, Lqb, Mqb, Nqb); - _2.re = function Oqb(a, b) { - return PD(a) === PD(b) || a != null && pb(a, b); - }; - _2.se = function Pqb(a) { - var b; - b = tb(a); - return b | 0; - }; - mdb(bie, "HashMap", 43); - bcb(53, eie, gke, Tqb, Uqb, Vqb); - _2.Fc = function Xqb(a) { - return Qqb(this, a); - }; - _2.$b = function Yqb() { - this.a.$b(); - }; - _2.Hc = function Zqb(a) { - return Rqb(this, a); - }; - _2.dc = function $qb() { - return this.a.gc() == 0; - }; - _2.Kc = function _qb() { - return this.a.ec().Kc(); - }; - _2.Mc = function arb(a) { - return Sqb(this, a); - }; - _2.gc = function brb() { - return this.a.gc(); - }; - var jK = mdb(bie, "HashSet", 53); - bcb(1781, 1, sie, drb); - _2.ud = function erb(a) { - crb(this, a); - }; - _2.Ib = function frb() { - return "IntSummaryStatistics[count = " + Ubb(this.a) + ", avg = " + (Dbb(this.a, 0) ? Sbb(this.d) / Sbb(this.a) : 0) + ", min = " + this.c + ", max = " + this.b + ", sum = " + Ubb(this.d) + "]"; - }; - _2.a = 0; - _2.b = Rie; - _2.c = Ohe; - _2.d = 0; - mdb(bie, "IntSummaryStatistics", 1781); - bcb(1049, 1, vie, lrb); - _2.Jc = function mrb(a) { - reb(this, a); - }; - _2.Kc = function nrb() { - return new orb(this); - }; - _2.c = 0; - mdb(bie, "InternalHashCodeMap", 1049); - bcb(711, 1, aie, orb); - _2.Nb = function prb(a) { - Rrb(this, a); - }; - _2.Pb = function rrb() { - return this.d = this.a[this.c++], this.d; - }; - _2.Ob = function qrb() { - 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 srb() { - krb(this.e, this.d.cd()); - this.c != 0 && --this.c; - }; - _2.c = 0; - _2.d = null; - mdb(bie, "InternalHashCodeMap/1", 711); - var vrb; - bcb(1047, 1, vie, Frb); - _2.Jc = function Grb(a) { - reb(this, a); - }; - _2.Kc = function Hrb() { - return new Irb(this); - }; - _2.c = 0; - _2.d = 0; - mdb(bie, "InternalStringMap", 1047); - bcb(710, 1, aie, Irb); - _2.Nb = function Jrb(a) { - Rrb(this, a); - }; - _2.Pb = function Lrb() { - return this.c = this.a, this.a = this.b.next(), new Nrb(this.d, this.c, this.d.d); - }; - _2.Ob = function Krb() { - return !this.a.done; - }; - _2.Qb = function Mrb() { - Erb(this.d, this.c.value[0]); - }; - mdb(bie, "InternalStringMap/1", 710); - bcb(1048, 1984, _je, Nrb); - _2.cd = function Orb() { - return this.b.value[0]; - }; - _2.dd = function Prb() { - if (this.a.d != this.c) { - return Crb(this.a, this.b.value[0]); - } - return this.b.value[1]; - }; - _2.ed = function Qrb(a) { - return Drb(this.a, this.b.value[0], a); - }; - _2.c = 0; - mdb(bie, "InternalStringMap/2", 1048); - bcb(228, 43, fke, $rb, _rb); - _2.$b = function asb() { - Urb(this); - }; - _2._b = function bsb(a) { - return Vrb(this, a); - }; - _2.uc = function csb(a) { - var b; - b = this.d.a; - while (b != this.d) { - if (wtb(b.e, a)) { - return true; - } - b = b.a; - } - return false; - }; - _2.vc = function dsb() { - return new nsb(this); - }; - _2.xc = function esb(a) { - return Wrb(this, a); - }; - _2.zc = function fsb(a, b) { - return Xrb(this, a, b); - }; - _2.Bc = function gsb(a) { - return Zrb(this, a); - }; - _2.gc = function hsb() { - return Vhb(this.e); - }; - _2.c = false; - mdb(bie, "LinkedHashMap", 228); - bcb(387, 383, { 484: 1, 383: 1, 387: 1, 42: 1 }, ksb, lsb); - mdb(bie, "LinkedHashMap/ChainEntry", 387); - bcb(701, eie, fie, nsb); - _2.$b = function osb() { - Urb(this.a); - }; - _2.Hc = function psb(a) { - return msb(this, a); - }; - _2.Kc = function qsb() { - return new usb(this); - }; - _2.Mc = function rsb(a) { - var b; - if (msb(this, a)) { - b = BD(a, 42).cd(); - Zrb(this.a, b); - return true; - } - return false; - }; - _2.gc = function ssb() { - return Vhb(this.a.e); - }; - mdb(bie, "LinkedHashMap/EntrySet", 701); - bcb(702, 1, aie, usb); - _2.Nb = function vsb(a) { - Rrb(this, a); - }; - _2.Pb = function xsb() { - return tsb(this); - }; - _2.Ob = function wsb() { - return this.b != this.c.a.d; - }; - _2.Qb = function ysb() { - yCb(!!this.a); - xpb(this.c.a.e, this); - jsb(this.a); - Thb(this.c.a.e, this.a.d); - ypb(this.c.a.e, this); - this.a = null; - }; - mdb(bie, "LinkedHashMap/EntrySet/EntryIterator", 702); - bcb(178, 53, gke, zsb, Asb, Bsb); - var uK = mdb(bie, "LinkedHashSet", 178); - bcb(68, 1964, { 3: 1, 4: 1, 20: 1, 28: 1, 52: 1, 14: 1, 68: 1, 15: 1 }, Psb, Qsb); - _2.Fc = function Rsb(a) { - return Dsb(this, a); - }; - _2.$b = function Ssb() { - Osb(this); - }; - _2.Zc = function Tsb(a) { - return Jsb(this, a); - }; - _2.gc = function Usb() { - return this.b; - }; - _2.b = 0; - var xK = mdb(bie, "LinkedList", 68); - bcb(970, 1, jie, $sb); - _2.Nb = function atb(a) { - Rrb(this, a); - }; - _2.Rb = function _sb(a) { - Vsb(this, a); - }; - _2.Ob = function btb() { - return Wsb(this); - }; - _2.Sb = function ctb() { - return this.b.b != this.d.a; - }; - _2.Pb = function dtb() { - return Xsb(this); - }; - _2.Tb = function etb() { - return this.a; - }; - _2.Ub = function ftb() { - return Ysb(this); - }; - _2.Vb = function gtb() { - return this.a - 1; - }; - _2.Qb = function htb() { - Zsb(this); - }; - _2.Wb = function itb(a) { - yCb(!!this.c); - this.c.c = a; - }; - _2.a = 0; - _2.c = null; - mdb(bie, "LinkedList/ListIteratorImpl", 970); - bcb(608, 1, {}, jtb); - mdb(bie, "LinkedList/Node", 608); - bcb(1959, 1, {}); - var ltb, mtb; - mdb(bie, "Locale", 1959); - bcb(861, 1959, {}, otb); - _2.Ib = function ptb() { - return ""; - }; - mdb(bie, "Locale/1", 861); - bcb(862, 1959, {}, qtb); - _2.Ib = function rtb() { - return "unknown"; - }; - mdb(bie, "Locale/4", 862); - bcb(109, 60, { 3: 1, 102: 1, 60: 1, 78: 1, 109: 1 }, utb, vtb); - mdb(bie, "NoSuchElementException", 109); - bcb(404, 1, { 404: 1 }, Ftb); - _2.Fb = function Gtb(a) { - var b; - if (a === this) { - return true; - } - if (!JD(a, 404)) { - return false; - } - b = BD(a, 404); - return wtb(this.a, b.a); - }; - _2.Hb = function Htb() { - return xtb(this.a); - }; - _2.Ib = function Jtb() { - return this.a != null ? Whe + xfb(this.a) + ")" : "Optional.empty()"; - }; - var ztb; - mdb(bie, "Optional", 404); - bcb(463, 1, { 463: 1 }, Otb, Ptb); - _2.Fb = function Qtb(a) { - var b; - if (a === this) { - return true; - } - if (!JD(a, 463)) { - return false; - } - b = BD(a, 463); - return this.a == b.a && Kdb(this.b, b.b) == 0; - }; - _2.Hb = function Rtb() { - return this.a ? QD(this.b) : 0; - }; - _2.Ib = function Stb() { - return this.a ? "OptionalDouble.of(" + ("" + this.b) + ")" : "OptionalDouble.empty()"; - }; - _2.a = false; - _2.b = 0; - var Ktb; - mdb(bie, "OptionalDouble", 463); - bcb(517, 1, { 517: 1 }, Wtb, Xtb); - _2.Fb = function Ytb(a) { - var b; - if (a === this) { - return true; + } + 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; + }, "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; } - if (!JD(a, 517)) { - return false; - } - b = BD(a, 517); - return this.a == b.a && beb(this.b, b.b) == 0; - }; - _2.Hb = function Ztb() { - return this.a ? this.b : 0; - }; - _2.Ib = function $tb() { - return this.a ? "OptionalInt.of(" + ("" + this.b) + ")" : "OptionalInt.empty()"; - }; - _2.a = false; - _2.b = 0; - var Ttb; - mdb(bie, "OptionalInt", 517); - bcb(503, 2004, die, gub); - _2.Gc = function hub(a) { - return _tb(this, a); - }; - _2.$b = function iub() { - this.b.c = KC(SI, Uhe, 1, 0, 5, 1); - }; - _2.Hc = function jub(a) { - return (a == null ? -1 : Jkb(this.b, a, 0)) != -1; - }; - _2.Kc = function kub() { - return new qub(this); - }; - _2.Mc = function lub(a) { - return eub(this, a); - }; - _2.gc = function mub() { - return this.b.c.length; - }; - _2.Nc = function nub() { - return new Kub(this, 256); - }; - _2.Pc = function oub() { - return Pkb(this.b); - }; - _2.Qc = function pub(a) { - return Qkb(this.b, a); - }; - mdb(bie, "PriorityQueue", 503); - bcb(1277, 1, aie, qub); - _2.Nb = function rub(a) { - Rrb(this, a); - }; - _2.Ob = function tub() { - return this.a < this.c.b.c.length; - }; - _2.Pb = function uub() { - sCb(this.a < this.c.b.c.length); - this.b = this.a++; - return Ikb(this.c.b, this.b); - }; - _2.Qb = function vub() { - yCb(this.b != -1); - fub(this.c, this.a = this.b); - this.b = -1; - }; - _2.a = 0; - _2.b = -1; - mdb(bie, "PriorityQueue/1", 1277); - bcb(230, 1, { 230: 1 }, Gub, Hub); - _2.a = 0; - _2.b = 0; - var wub, xub, yub = 0; - mdb(bie, "Random", 230); - bcb(27, 1, pie2, Kub, Lub, Mub); - _2.qd = function Nub() { - return this.a; - }; - _2.rd = function Oub() { - Iub(this); - return this.c; - }; - _2.Nb = function Pub(a) { - Iub(this); - this.d.Nb(a); - }; - _2.sd = function Qub(a) { - return Jub(this, a); - }; - _2.a = 0; - _2.c = 0; - mdb(bie, "Spliterators/IteratorSpliterator", 27); - bcb(485, 27, pie2, Rub); - mdb(bie, "SortedSet/1", 485); - bcb(602, 1, eke, Tub); - _2.we = function Uub(a) { - this.a.td(a); - }; - mdb(bie, "Spliterator/OfDouble/0methodref$accept$Type", 602); - bcb(603, 1, eke, Vub); - _2.we = function Wub(a) { - this.a.td(a); - }; - mdb(bie, "Spliterator/OfDouble/1methodref$accept$Type", 603); - bcb(604, 1, sie, Xub); - _2.ud = function Yub(a) { - this.a.td(meb(a)); - }; - mdb(bie, "Spliterator/OfInt/2methodref$accept$Type", 604); - bcb(605, 1, sie, Zub); - _2.ud = function $ub(a) { - this.a.td(meb(a)); - }; - mdb(bie, "Spliterator/OfInt/3methodref$accept$Type", 605); - bcb(617, 1, pie2); - _2.Nb = function evb(a) { - Sub(this, a); - }; - _2.qd = function cvb() { - return this.d; - }; - _2.rd = function dvb() { - return this.e; - }; - _2.d = 0; - _2.e = 0; - mdb(bie, "Spliterators/BaseSpliterator", 617); - bcb(721, 617, pie2); - _2.xe = function gvb(a) { - _ub(this, a); - }; - _2.Nb = function hvb(a) { - JD(a, 182) ? _ub(this, BD(a, 182)) : _ub(this, new Vub(a)); - }; - _2.sd = function ivb(a) { - return JD(a, 182) ? this.ye(BD(a, 182)) : this.ye(new Tub(a)); - }; - mdb(bie, "Spliterators/AbstractDoubleSpliterator", 721); - bcb(720, 617, pie2); - _2.xe = function kvb(a) { - _ub(this, a); - }; - _2.Nb = function lvb(a) { - JD(a, 196) ? _ub(this, BD(a, 196)) : _ub(this, new Zub(a)); - }; - _2.sd = function mvb(a) { - return JD(a, 196) ? this.ye(BD(a, 196)) : this.ye(new Xub(a)); - }; - mdb(bie, "Spliterators/AbstractIntSpliterator", 720); - bcb(540, 617, pie2); - mdb(bie, "Spliterators/AbstractSpliterator", 540); - bcb(692, 1, pie2); - _2.Nb = function tvb(a) { - Sub(this, a); - }; - _2.qd = function rvb() { - return this.b; - }; - _2.rd = function svb() { - return this.d - this.c; - }; - _2.b = 0; - _2.c = 0; - _2.d = 0; - mdb(bie, "Spliterators/BaseArraySpliterator", 692); - bcb(947, 692, pie2, vvb); - _2.ze = function wvb(a, b) { - uvb(this, BD(a, 38), b); - }; - _2.Nb = function xvb(a) { - ovb(this, a); - }; - _2.sd = function yvb(a) { - return pvb(this, a); - }; - mdb(bie, "Spliterators/ArraySpliterator", 947); - bcb(693, 692, pie2, Avb); - _2.ze = function Cvb(a, b) { - zvb(this, BD(a, 182), b); - }; - _2.xe = function Dvb(a) { - ovb(this, a); - }; - _2.Nb = function Evb(a) { - JD(a, 182) ? ovb(this, BD(a, 182)) : ovb(this, new Vub(a)); - }; - _2.ye = function Fvb(a) { - return pvb(this, a); - }; - _2.sd = function Gvb(a) { - return JD(a, 182) ? pvb(this, BD(a, 182)) : pvb(this, new Tub(a)); - }; - mdb(bie, "Spliterators/DoubleArraySpliterator", 693); - bcb(1968, 1, pie2); - _2.Nb = function Lvb(a) { - Sub(this, a); - }; - _2.qd = function Jvb() { - return 16448; - }; - _2.rd = function Kvb() { - return 0; - }; - var Hvb; - mdb(bie, "Spliterators/EmptySpliterator", 1968); - bcb(946, 1968, pie2, Ovb); - _2.xe = function Pvb(a) { - Mvb(a); - }; - _2.Nb = function Qvb(a) { - JD(a, 196) ? Mvb(BD(a, 196)) : Mvb(new Zub(a)); - }; - _2.ye = function Rvb(a) { - return Nvb(a); - }; - _2.sd = function Svb(a) { - return JD(a, 196) ? Nvb(BD(a, 196)) : Nvb(new Xub(a)); - }; - mdb(bie, "Spliterators/EmptySpliterator/OfInt", 946); - bcb(580, 52, pke, Wvb); - _2.Vc = function Xvb(a, b) { - _vb(a, this.a.c.length + 1); - Dkb(this.a, a, b); - }; - _2.Fc = function Yvb(a) { - return Ekb(this.a, a); - }; - _2.Wc = function Zvb(a, b) { - _vb(a, this.a.c.length + 1); - return Fkb(this.a, a, b); - }; - _2.Gc = function $vb(a) { - return Gkb(this.a, a); - }; - _2.$b = function awb() { - this.a.c = KC(SI, Uhe, 1, 0, 5, 1); - }; - _2.Hc = function bwb(a) { - return Jkb(this.a, a, 0) != -1; - }; - _2.Ic = function cwb(a) { - return Be(this.a, a); - }; - _2.Jc = function dwb(a) { - Hkb(this.a, a); - }; - _2.Xb = function ewb(a) { - return _vb(a, this.a.c.length), Ikb(this.a, a); - }; - _2.Xc = function fwb(a) { - return Jkb(this.a, a, 0); - }; - _2.dc = function gwb() { - return this.a.c.length == 0; - }; - _2.Kc = function hwb() { - return new olb(this.a); - }; - _2.$c = function iwb(a) { - return _vb(a, this.a.c.length), Kkb(this.a, a); - }; - _2.Ud = function jwb(a, b) { - Mkb(this.a, a, b); - }; - _2._c = function kwb(a, b) { - return _vb(a, this.a.c.length), Nkb(this.a, a, b); - }; - _2.gc = function lwb() { - return this.a.c.length; - }; - _2.ad = function mwb(a) { - Okb(this.a, a); - }; - _2.bd = function nwb(a, b) { - return new Jib(this.a, a, b); - }; - _2.Pc = function owb() { - return Pkb(this.a); - }; - _2.Qc = function pwb(a) { - return Qkb(this.a, a); - }; - _2.Ib = function qwb() { - return Fe(this.a); - }; - mdb(bie, "Vector", 580); - bcb(809, 580, pke, twb); - mdb(bie, "Stack", 809); - bcb(206, 1, { 206: 1 }, xwb); - _2.Ib = function ywb() { - return wwb(this); - }; - mdb(bie, "StringJoiner", 206); - bcb(544, 1992, { 3: 1, 83: 1, 171: 1, 161: 1 }, Pwb, Qwb); - _2.$b = function Rwb() { - zwb(this); - }; - _2.vc = function Swb() { - return new cxb(this); - }; - _2.zc = function Twb(a, b) { - return Iwb(this, a, b); - }; - _2.Bc = function Uwb(a) { - return Jwb(this, a); - }; - _2.gc = function Vwb() { - return this.c; - }; - _2.c = 0; - mdb(bie, "TreeMap", 544); - bcb(390, 1, aie, Ywb); - _2.Nb = function $wb(a) { - Rrb(this, a); - }; - _2.Pb = function axb() { - return Wwb(this); - }; - _2.Ob = function _wb() { - return sib(this.a); - }; - _2.Qb = function bxb() { - Xwb(this); - }; - mdb(bie, "TreeMap/EntryIterator", 390); - bcb(435, 739, fie, cxb); - _2.$b = function dxb() { - zwb(this.a); - }; - mdb(bie, "TreeMap/EntrySet", 435); - bcb(436, 383, { 484: 1, 383: 1, 42: 1, 436: 1 }, exb); - _2.b = false; - var dL = mdb(bie, "TreeMap/Node", 436); - bcb(621, 1, {}, fxb); - _2.Ib = function gxb() { - return "State: mv=" + this.c + " value=" + this.d + " done=" + this.a + " found=" + this.b; - }; - _2.a = false; - _2.b = false; - _2.c = false; - mdb(bie, "TreeMap/State", 621); - bcb(297, 22, qke, mxb); - _2.Ae = function nxb() { - return false; - }; - _2.Be = function oxb() { - return false; - }; - var hxb, ixb, jxb, kxb; - var iL = ndb(bie, "TreeMap/SubMapType", 297, CI, qxb, pxb); - bcb(1112, 297, qke, rxb); - _2.Be = function sxb() { - return true; - }; - ndb(bie, "TreeMap/SubMapType/1", 1112, iL, null, null); - bcb(1113, 297, qke, txb); - _2.Ae = function uxb() { - return true; - }; - _2.Be = function vxb() { - return true; - }; - ndb(bie, "TreeMap/SubMapType/2", 1113, iL, null, null); - bcb(1114, 297, qke, wxb); - _2.Ae = function xxb() { - return true; - }; - ndb(bie, "TreeMap/SubMapType/3", 1114, iL, null, null); - var yxb; - bcb(208, eie, { 3: 1, 20: 1, 28: 1, 14: 1, 271: 1, 21: 1, 84: 1, 208: 1 }, Gxb, Hxb); - _2.Nc = function Oxb() { - return new Rub(this); - }; - _2.Fc = function Ixb(a) { - return Axb(this, a); - }; - _2.$b = function Jxb() { - zwb(this.a); - }; - _2.Hc = function Kxb(a) { - return ujb(this.a, a); - }; - _2.Kc = function Lxb() { - var a; - return a = new Ywb(new cxb(new Gjb(this.a).a).b), new Njb(a); - }; - _2.Mc = function Mxb(a) { - return Fxb(this, a); - }; - _2.gc = function Nxb() { - return this.a.c; - }; - var kL = mdb(bie, "TreeSet", 208); - bcb(966, 1, {}, Rxb); - _2.Ce = function Sxb(a, b) { - return Pxb(this.a, a, b); - }; - mdb(rke, "BinaryOperator/lambda$0$Type", 966); - bcb(967, 1, {}, Txb); - _2.Ce = function Uxb(a, b) { - return Qxb(this.a, a, b); - }; - mdb(rke, "BinaryOperator/lambda$1$Type", 967); - bcb(846, 1, {}, Vxb); - _2.Kb = function Wxb(a) { - return a; - }; - mdb(rke, "Function/lambda$0$Type", 846); - bcb(431, 1, Oie, Xxb); - _2.Mb = function Yxb(a) { - return !this.a.Mb(a); - }; - mdb(rke, "Predicate/lambda$2$Type", 431); - bcb(572, 1, { 572: 1 }); - var qL = mdb(ske, "Handler", 572); - bcb(2007, 1, Qhe); - _2.ne = function _xb() { - return "DUMMY"; - }; - _2.Ib = function ayb() { - return this.ne(); - }; - var Zxb; - mdb(ske, "Level", 2007); - bcb(1621, 2007, Qhe, byb); - _2.ne = function cyb() { - return "INFO"; - }; - mdb(ske, "Level/LevelInfo", 1621); - bcb(1640, 1, {}, gyb); - var dyb; - mdb(ske, "LogManager", 1640); - bcb(1780, 1, Qhe, iyb); - _2.b = null; - mdb(ske, "LogRecord", 1780); - bcb(512, 1, { 512: 1 }, wyb); - _2.e = false; - var jyb = false, kyb = false, lyb = false, myb = false, nyb = false; - mdb(ske, "Logger", 512); - bcb(819, 572, { 572: 1 }, zyb); - mdb(ske, "SimpleConsoleLogHandler", 819); - bcb(132, 22, { 3: 1, 35: 1, 22: 1, 132: 1 }, Gyb); - var Cyb, Dyb, Eyb; - var xL = ndb(vke, "Collector/Characteristics", 132, CI, Iyb, Hyb); - var Jyb; - bcb(744, 1, {}, Lyb); - mdb(vke, "CollectorImpl", 744); - bcb(1060, 1, {}, Zyb); - _2.Ce = function $yb(a, b) { - return vwb(BD(a, 206), BD(b, 206)); - }; - mdb(vke, "Collectors/10methodref$merge$Type", 1060); - bcb(1061, 1, {}, _yb); - _2.Kb = function azb(a) { - return wwb(BD(a, 206)); - }; - mdb(vke, "Collectors/11methodref$toString$Type", 1061); - bcb(1062, 1, {}, bzb); - _2.Kb = function czb(a) { - return Bcb(), _Pb(a) ? true : false; - }; - mdb(vke, "Collectors/12methodref$test$Type", 1062); - bcb(251, 1, {}, dzb); - _2.Od = function ezb(a, b) { - BD(a, 14).Fc(b); - }; - mdb(vke, "Collectors/20methodref$add$Type", 251); - bcb(253, 1, {}, fzb); - _2.Ee = function gzb() { - return new Rkb(); - }; - mdb(vke, "Collectors/21methodref$ctor$Type", 253); - bcb(346, 1, {}, hzb); - _2.Ee = function izb() { - return new Tqb(); - }; - mdb(vke, "Collectors/23methodref$ctor$Type", 346); - bcb(347, 1, {}, jzb); - _2.Od = function kzb(a, b) { - Qqb(BD(a, 53), b); - }; - mdb(vke, "Collectors/24methodref$add$Type", 347); - bcb(1055, 1, {}, lzb); - _2.Ce = function mzb(a, b) { - return Myb(BD(a, 15), BD(b, 14)); - }; - mdb(vke, "Collectors/4methodref$addAll$Type", 1055); - bcb(1059, 1, {}, nzb); - _2.Od = function ozb(a, b) { - uwb(BD(a, 206), BD(b, 475)); - }; - mdb(vke, "Collectors/9methodref$add$Type", 1059); - bcb(1058, 1, {}, pzb); - _2.Ee = function qzb() { - return new xwb(this.a, this.b, this.c); - }; - mdb(vke, "Collectors/lambda$15$Type", 1058); - bcb(1063, 1, {}, rzb); - _2.Ee = function szb() { - var a; - return a = new $rb(), Xrb(a, (Bcb(), false), new Rkb()), Xrb(a, true, new Rkb()), a; - }; - mdb(vke, "Collectors/lambda$22$Type", 1063); - bcb(1064, 1, {}, tzb); - _2.Ee = function uzb() { - return OC(GC(SI, 1), Uhe, 1, 5, [this.a]); - }; - mdb(vke, "Collectors/lambda$25$Type", 1064); - bcb(1065, 1, {}, vzb); - _2.Od = function wzb(a, b) { - Oyb(this.a, CD(a)); - }; - mdb(vke, "Collectors/lambda$26$Type", 1065); - bcb(1066, 1, {}, xzb); - _2.Ce = function yzb(a, b) { - return Pyb(this.a, CD(a), CD(b)); - }; - mdb(vke, "Collectors/lambda$27$Type", 1066); - bcb(1067, 1, {}, zzb); - _2.Kb = function Azb(a) { - return CD(a)[0]; - }; - mdb(vke, "Collectors/lambda$28$Type", 1067); - bcb(713, 1, {}, Czb); - _2.Ce = function Dzb(a, b) { - return Bzb(a, b); - }; - mdb(vke, "Collectors/lambda$4$Type", 713); - bcb(252, 1, {}, Ezb); - _2.Ce = function Fzb(a, b) { - return Ryb(BD(a, 14), BD(b, 14)); - }; - mdb(vke, "Collectors/lambda$42$Type", 252); - bcb(348, 1, {}, Gzb); - _2.Ce = function Hzb(a, b) { - return Syb(BD(a, 53), BD(b, 53)); - }; - mdb(vke, "Collectors/lambda$50$Type", 348); - bcb(349, 1, {}, Izb); - _2.Kb = function Jzb(a) { - return BD(a, 53); - }; - mdb(vke, "Collectors/lambda$51$Type", 349); - bcb(1054, 1, {}, Kzb); - _2.Od = function Lzb(a, b) { - Tyb(this.a, BD(a, 83), b); - }; - mdb(vke, "Collectors/lambda$7$Type", 1054); - bcb(1056, 1, {}, Mzb); - _2.Ce = function Nzb(a, b) { - return Vyb(BD(a, 83), BD(b, 83), new lzb()); - }; - mdb(vke, "Collectors/lambda$8$Type", 1056); - bcb(1057, 1, {}, Ozb); - _2.Kb = function Pzb(a) { - return Uyb(this.a, BD(a, 83)); - }; - mdb(vke, "Collectors/lambda$9$Type", 1057); - bcb(539, 1, {}); - _2.He = function Wzb() { - Qzb(this); - }; - _2.d = false; - mdb(vke, "TerminatableStream", 539); - bcb(812, 539, wke, bAb); - _2.He = function cAb() { - Qzb(this); - }; - mdb(vke, "DoubleStreamImpl", 812); - bcb(1784, 721, pie2, fAb); - _2.ye = function hAb(a) { - return eAb(this, BD(a, 182)); - }; - _2.a = null; - mdb(vke, "DoubleStreamImpl/2", 1784); - bcb(1785, 1, eke, iAb); - _2.we = function jAb(a) { - gAb(this.a, a); - }; - mdb(vke, "DoubleStreamImpl/2/lambda$0$Type", 1785); - bcb(1782, 1, eke, kAb); - _2.we = function lAb(a) { - dAb(this.a, a); - }; - mdb(vke, "DoubleStreamImpl/lambda$0$Type", 1782); - bcb(1783, 1, eke, mAb); - _2.we = function nAb(a) { - Epb(this.a, a); - }; - mdb(vke, "DoubleStreamImpl/lambda$2$Type", 1783); - bcb(1358, 720, pie2, rAb); - _2.ye = function sAb(a) { - return qAb(this, BD(a, 196)); - }; - _2.a = 0; - _2.b = 0; - _2.c = 0; - mdb(vke, "IntStream/5", 1358); - bcb(787, 539, wke, vAb); - _2.He = function wAb() { - Qzb(this); - }; - _2.Ie = function xAb() { - return Tzb(this), this.a; - }; - mdb(vke, "IntStreamImpl", 787); - bcb(788, 539, wke, yAb); - _2.He = function zAb() { - Qzb(this); - }; - _2.Ie = function AAb() { - return Tzb(this), Ivb(), Hvb; - }; - mdb(vke, "IntStreamImpl/Empty", 788); - bcb(1463, 1, sie, BAb); - _2.ud = function CAb(a) { - crb(this.a, a); - }; - mdb(vke, "IntStreamImpl/lambda$4$Type", 1463); - var xM = odb(vke, "Stream"); - bcb(30, 539, { 525: 1, 670: 1, 833: 1 }, YAb); - _2.He = function ZAb() { - Qzb(this); - }; - var DAb; - mdb(vke, "StreamImpl", 30); - bcb(845, 1, {}, bBb); - _2.ld = function cBb(a) { - return aBb(a); - }; - mdb(vke, "StreamImpl/0methodref$lambda$2$Type", 845); - bcb(1084, 540, pie2, fBb); - _2.sd = function gBb(a) { - while (dBb(this)) { - if (this.a.sd(a)) { - return true; - } else { - Qzb(this.b); - this.b = null; - this.a = null; - } + if (!changedEle && changedNow) { + changed.push(ele); + changedEle = true; } + } + } + 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), state5 = _ref4[0]; + query.checks.push({ + type: Type3.STATE, + value: state5 + }); + }, "populate") + }, { + name: "id", + query: true, + regex: "\\#(" + tokens.id + ")", + populate: /* @__PURE__ */ __name(function populate4(selector, query, _ref5) { + var _ref6 = _slicedToArray(_ref5, 1), id27 = _ref6[0]; + query.checks.push({ + type: Type3.ID, + value: cleanMetaChars(id27) + }); + }, "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; - }; - mdb(vke, "StreamImpl/1", 1084); - bcb(1085, 1, qie, hBb); - _2.td = function iBb(a) { - eBb(this.a, BD(a, 833)); - }; - mdb(vke, "StreamImpl/1/lambda$0$Type", 1085); - bcb(1086, 1, Oie, jBb); - _2.Mb = function kBb(a) { - return Qqb(this.a, a); - }; - mdb(vke, "StreamImpl/1methodref$add$Type", 1086); - bcb(1087, 540, pie2, lBb); - _2.sd = function mBb(a) { - var b; - if (!this.a) { - b = new Rkb(); - this.b.a.Nb(new nBb(b)); - mmb(); - Okb(b, this.c); - this.a = new Kub(b, 16); - } - return Jub(this.a, a); - }; - _2.a = null; - mdb(vke, "StreamImpl/5", 1087); - bcb(1088, 1, qie, nBb); - _2.td = function oBb(a) { - Ekb(this.a, a); - }; - mdb(vke, "StreamImpl/5/2methodref$add$Type", 1088); - bcb(722, 540, pie2, qBb); - _2.sd = function rBb(a) { - this.b = false; - while (!this.b && this.c.sd(new sBb(this, a))) - ; - return this.b; - }; - _2.b = false; - mdb(vke, "StreamImpl/FilterSpliterator", 722); - bcb(1079, 1, qie, sBb); - _2.td = function tBb(a) { - pBb(this.a, this.b, a); - }; - mdb(vke, "StreamImpl/FilterSpliterator/lambda$0$Type", 1079); - bcb(1075, 721, pie2, wBb); - _2.ye = function xBb(a) { - return vBb(this, BD(a, 182)); - }; - mdb(vke, "StreamImpl/MapToDoubleSpliterator", 1075); - bcb(1078, 1, qie, yBb); - _2.td = function zBb(a) { - uBb(this.a, this.b, a); - }; - mdb(vke, "StreamImpl/MapToDoubleSpliterator/lambda$0$Type", 1078); - bcb(1074, 720, pie2, CBb); - _2.ye = function DBb(a) { - return BBb(this, BD(a, 196)); - }; - mdb(vke, "StreamImpl/MapToIntSpliterator", 1074); - bcb(1077, 1, qie, EBb); - _2.td = function FBb(a) { - ABb(this.a, this.b, a); - }; - mdb(vke, "StreamImpl/MapToIntSpliterator/lambda$0$Type", 1077); - bcb(719, 540, pie2, IBb); - _2.sd = function JBb(a) { - return HBb(this, a); - }; - mdb(vke, "StreamImpl/MapToObjSpliterator", 719); - bcb(1076, 1, qie, KBb); - _2.td = function LBb(a) { - GBb(this.a, this.b, a); - }; - mdb(vke, "StreamImpl/MapToObjSpliterator/lambda$0$Type", 1076); - bcb(618, 1, qie, NBb); - _2.td = function OBb(a) { - MBb(this, a); - }; - mdb(vke, "StreamImpl/ValueConsumer", 618); - bcb(1080, 1, qie, PBb); - _2.td = function QBb(a) { - EAb(); - }; - mdb(vke, "StreamImpl/lambda$0$Type", 1080); - bcb(1081, 1, qie, RBb); - _2.td = function SBb(a) { - EAb(); - }; - mdb(vke, "StreamImpl/lambda$1$Type", 1081); - bcb(1082, 1, {}, TBb); - _2.Ce = function UBb(a, b) { - return $Ab(this.a, a, b); - }; - mdb(vke, "StreamImpl/lambda$4$Type", 1082); - bcb(1083, 1, qie, VBb); - _2.td = function WBb(a) { - _Ab(this.b, this.a, a); - }; - mdb(vke, "StreamImpl/lambda$5$Type", 1083); - bcb(1089, 1, qie, XBb); - _2.td = function YBb(a) { - Xzb(this.a, BD(a, 365)); - }; - mdb(vke, "TerminatableStream/lambda$0$Type", 1089); - bcb(2041, 1, {}); - bcb(1914, 1, {}, iCb); - mdb("javaemul.internal", "ConsoleLogger", 1914); - bcb(2038, 1, {}); - var ECb = 0; - var GCb, HCb = 0, ICb; - bcb(1768, 1, qie, OCb); - _2.td = function PCb(a) { - BD(a, 308); - }; - mdb(Cke, "BowyerWatsonTriangulation/lambda$0$Type", 1768); - bcb(1769, 1, qie, QCb); - _2.td = function RCb(a) { - ye(this.a, BD(a, 308).e); - }; - mdb(Cke, "BowyerWatsonTriangulation/lambda$1$Type", 1769); - bcb(1770, 1, qie, SCb); - _2.td = function TCb(a) { - BD(a, 168); - }; - mdb(Cke, "BowyerWatsonTriangulation/lambda$2$Type", 1770); - bcb(1765, 1, Dke, WCb); - _2.ue = function XCb(a, b) { - return VCb(this.a, BD(a, 168), BD(b, 168)); - }; - _2.Fb = function YCb(a) { - return this === a; - }; - _2.ve = function ZCb() { - return new tpb(this); - }; - mdb(Cke, "NaiveMinST/lambda$0$Type", 1765); - bcb(499, 1, {}, _Cb); - mdb(Cke, "NodeMicroLayout", 499); - bcb(168, 1, { 168: 1 }, aDb); - _2.Fb = function bDb(a) { - var b; - if (JD(a, 168)) { - b = BD(a, 168); - return wtb(this.a, b.a) && wtb(this.b, b.b) || wtb(this.a, b.b) && wtb(this.b, b.a); - } else { - return false; - } - }; - _2.Hb = function cDb() { - return xtb(this.a) + xtb(this.b); - }; - var GM = mdb(Cke, "TEdge", 168); - bcb(308, 1, { 308: 1 }, eDb); - _2.Fb = function fDb(a) { - var b; - if (JD(a, 308)) { - b = BD(a, 308); - return dDb(this, b.a) && dDb(this, b.b) && dDb(this, b.c); - } else { - return false; - } - }; - _2.Hb = function gDb() { - return xtb(this.a) + xtb(this.b) + xtb(this.c); - }; - mdb(Cke, "TTriangle", 308); - bcb(221, 1, { 221: 1 }, hDb); - mdb(Cke, "Tree", 221); - bcb(1254, 1, {}, jDb); - mdb(Eke, "Scanline", 1254); - var JM = odb(Eke, Fke); - bcb(1692, 1, {}, mDb); - mdb(Gke, "CGraph", 1692); - bcb(307, 1, { 307: 1 }, oDb); - _2.b = 0; - _2.c = 0; - _2.d = 0; - _2.g = 0; - _2.i = 0; - _2.k = Qje; - mdb(Gke, "CGroup", 307); - bcb(815, 1, {}, sDb); - mdb(Gke, "CGroup/CGroupBuilder", 815); - bcb(57, 1, { 57: 1 }, tDb); - _2.Ib = function uDb() { - var a; - if (this.j) { - return GD(this.j.Kb(this)); - } - return fdb(PM), PM.o + "@" + (a = FCb(this) >>> 0, a.toString(16)); - }; - _2.f = 0; - _2.i = Qje; - var PM = mdb(Gke, "CNode", 57); - bcb(814, 1, {}, zDb); - mdb(Gke, "CNode/CNodeBuilder", 814); - var EDb; - bcb(1525, 1, {}, GDb); - _2.Oe = function HDb(a, b) { - return 0; - }; - _2.Pe = function IDb(a, b) { - return 0; - }; - mdb(Gke, Ike, 1525); - bcb(1790, 1, {}, JDb); - _2.Le = function KDb(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p; - j = Pje; - for (d = new olb(a.a.b); d.a < d.c.c.length; ) { - b = BD(mlb(d), 57); - j = $wnd.Math.min(j, b.a.j.d.c + b.b.a); - } - n = new Psb(); - for (g = new olb(a.a.a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 307); - f2.k = j; - f2.g == 0 && (Gsb(n, f2, n.c.b, n.c), true); - } - while (n.b != 0) { - f2 = BD(n.b == 0 ? null : (sCb(n.b != 0), Nsb(n, n.a.a)), 307); - e = f2.j.d.c; - for (m = f2.a.a.ec().Kc(); m.Ob(); ) { - k = BD(m.Pb(), 57); - p = f2.k + k.b.a; - !UDb(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 == (ead(), bad) || a.d == _9c ? f2.c += e : f2.c -= e; - for (l = f2.a.a.ec().Kc(); l.Ob(); ) { - k = BD(l.Pb(), 57); - for (i3 = k.c.Kc(); i3.Ob(); ) { - h = BD(i3.Pb(), 57); - fad(a.d) ? o2 = a.g.Oe(k, h) : o2 = a.g.Pe(k, h); - h.a.k = $wnd.Math.max(h.a.k, k.i + k.d.b + o2 - h.b.a); - VDb(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 && Dsb(n, h.a); - } - } - } - for (c2 = new olb(a.a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 57); - b.d.c = b.i; + } 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 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) + "]"; + } + case Type3.DATA_BOOL: { + var _operator = check.operator, _field = check.field; + return "[" + clean(_operator) + _field + "]"; + } + case Type3.DATA_EXIST: { + var _field2 = check.field; + return "[" + _field2 + "]"; + } + case Type3.META_COMPARE: { + var _operator2 = check.operator, _field3 = check.field; + return "[[" + _field3 + space(clean(_operator2)) + cleanVal(value2) + "]]"; + } + case Type3.STATE: { + return value2; + } + case Type3.ID: { + return "#" + value2; + } + case Type3.CLASS: { + return "." + value2; + } + case Type3.PARENT: + case Type3.CHILD: { + return queryToString(check.parent, subject) + space(">") + queryToString(check.child, subject); + } + case Type3.ANCESTOR: + case Type3.DESCENDANT: { + return queryToString(check.ancestor, subject) + " " + queryToString(check.descendant, subject); + } + 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; + } + case Type3.TRUE: { + return ""; + } + } + }, "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 id27 = check.value; + return ele.id() === id27; + }; + 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; + } + } + 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; + } + } + 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; + } + } + 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); + } + } 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; + } + } + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + var _parent = ele._private.parent; + if (_parent) { + parents4.push(_parent); + } + } + 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); + } + 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]); + } + } + 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()); } + } + } + __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 }; - mdb(Gke, "LongestPathCompaction", 1790); - bcb(1690, 1, {}, cEb); - _2.e = false; - var LDb, MDb, NDb; - var TM = mdb(Gke, Nke, 1690); - bcb(1691, 1, qie, dEb); - _2.td = function eEb(a) { - WDb(this.a, BD(a, 46)); - }; - mdb(Gke, Oke, 1691); - bcb(1791, 1, {}, fEb); - _2.Me = function gEb(a) { - var b, c2, d, e, f2, g, h; - for (c2 = new olb(a.a.b); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 57); - b.c.$b(); - } - for (e = new olb(a.a.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 57); - for (g = new olb(a.a.b); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 57); - if (d == f2) { - continue; - } - if (!!d.a && d.a == f2.a) { - continue; - } - fad(a.d) ? h = a.g.Pe(d, f2) : h = a.g.Oe(d, f2); - (f2.d.c > d.d.c || d.d.c == f2.d.c && d.d.b < f2.d.b) && BDb(f2.d.d + f2.d.a + h, d.d.d) && DDb(f2.d.d, d.d.d + d.d.a + h) && d.c.Fc(f2); + if (ele.isParent() && !(delta.x === 0 && delta.y === 0)) { + ele.children().shift(delta, silent); + } + 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); + } + } 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); } } + } + 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 }; - mdb(Gke, "QuadraticConstraintCalculation", 1791); - bcb(522, 1, { 522: 1 }, lEb); - _2.a = false; - _2.b = false; - _2.c = false; - _2.d = false; - mdb(Gke, Pke, 522); - bcb(803, 1, {}, oEb); - _2.Me = function pEb(a) { - this.c = a; - nEb(this, new GEb()); - }; - mdb(Gke, Qke, 803); - bcb(1718, 1, { 679: 1 }, uEb); - _2.Ke = function vEb(a) { - rEb(this, BD(a, 464)); - }; - mdb(Gke, Rke, 1718); - bcb(1719, 1, Dke, xEb); - _2.ue = function yEb(a, b) { - return wEb(BD(a, 57), BD(b, 57)); - }; - _2.Fb = function zEb(a) { - return this === a; - }; - _2.ve = function AEb() { - return new tpb(this); - }; - mdb(Gke, Ske, 1719); - bcb(464, 1, { 464: 1 }, BEb); - _2.a = false; - mdb(Gke, Tke, 464); - bcb(1720, 1, Dke, CEb); - _2.ue = function DEb(a, b) { - return qEb(BD(a, 464), BD(b, 464)); - }; - _2.Fb = function EEb(a) { - return this === a; - }; - _2.ve = function FEb() { - return new tpb(this); - }; - mdb(Gke, Uke, 1720); - bcb(1721, 1, Vke, GEb); - _2.Lb = function HEb(a) { - return BD(a, 57), true; - }; - _2.Fb = function IEb(a) { - return this === a; - }; - _2.Mb = function JEb(a) { - return BD(a, 57), true; - }; - mdb(Gke, "ScanlineConstraintCalculator/lambda$1$Type", 1721); - bcb(428, 22, { 3: 1, 35: 1, 22: 1, 428: 1 }, NEb); - var KEb, LEb; - var aN = ndb(Wke, "HighLevelSortingCriterion", 428, CI, PEb, OEb); - var QEb; - bcb(427, 22, { 3: 1, 35: 1, 22: 1, 427: 1 }, VEb); - var SEb, TEb; - var bN = ndb(Wke, "LowLevelSortingCriterion", 427, CI, XEb, WEb); - var YEb; - var C0 = odb(Xke, "ILayoutMetaDataProvider"); - bcb(853, 1, ale, gFb); - _2.Qe = function hFb(a) { - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Yke), ble), "Polyomino Traversal Strategy"), "Traversal strategy for trying different candidate positions for polyominoes."), eFb), (_5c(), V5c)), dN), pqb((N5c(), L5c))))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Zke), ble), "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."), cFb), V5c), bN), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), $ke), ble), "Polyomino Primary Sorting Criterion"), "Possible primary sorting criteria for the processing order of polyominoes."), aFb), V5c), aN), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), _ke), ble), "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."), (Bcb(), true)), T5c), wI), pqb(L5c)))); - }; - var $Eb, _Eb, aFb, bFb, cFb, dFb, eFb; - mdb(Wke, "PolyominoOptions", 853); - bcb(250, 22, { 3: 1, 35: 1, 22: 1, 250: 1 }, sFb); - var iFb, jFb, kFb, lFb, mFb, nFb, oFb, pFb, qFb; - var dN = ndb(Wke, "TraversalStrategy", 250, CI, uFb, tFb); - var vFb; - bcb(213, 1, { 213: 1 }, yFb); - _2.Ib = function zFb() { - 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 fN = mdb(cle, "NEdge", 213); - bcb(176, 1, {}, FFb); - mdb(cle, "NEdge/NEdgeBuilder", 176); - bcb(653, 1, {}, KFb); - mdb(cle, "NGraph", 653); - bcb(121, 1, { 121: 1 }, MFb); - _2.c = -1; - _2.d = 0; - _2.e = 0; - _2.i = -1; - _2.j = false; - var jN = mdb(cle, "NNode", 121); - bcb(795, 1, cke, PFb); - _2.Jc = function XFb(a) { - reb(this, a); - }; - _2.Lc = function cGb() { - return new YAb(null, new Kub(this, 16)); - }; - _2.ad = function hGb(a) { - ktb(this, a); - }; - _2.Nc = function iGb() { - return new Kub(this, 16); + silent = val; + } else if (string(dim) && number$1(val)) { + delta = { + x: 0, + y: 0 }; - _2.Oc = function jGb() { - return new YAb(null, new Kub(this, 16)); - }; - _2.Vc = function QFb(a, b) { - ++this.b; - Dkb(this.a, a, b); - }; - _2.Fc = function RFb(a) { - return NFb(this, a); - }; - _2.Wc = function SFb(a, b) { - ++this.b; - return Fkb(this.a, a, b); - }; - _2.Gc = function TFb(a) { - ++this.b; - return Gkb(this.a, a); - }; - _2.$b = function UFb() { - ++this.b; - this.a.c = KC(SI, Uhe, 1, 0, 5, 1); - }; - _2.Hc = function VFb(a) { - return Jkb(this.a, a, 0) != -1; - }; - _2.Ic = function WFb(a) { - return Be(this.a, a); - }; - _2.Xb = function YFb(a) { - return Ikb(this.a, a); - }; - _2.Xc = function ZFb(a) { - return Jkb(this.a, a, 0); - }; - _2.dc = function $Fb() { - return this.a.c.length == 0; - }; - _2.Kc = function _Fb() { - return vr(new olb(this.a)); - }; - _2.Yc = function aGb() { - throw vbb(new bgb()); - }; - _2.Zc = function bGb(a) { - throw vbb(new bgb()); - }; - _2.$c = function dGb(a) { - ++this.b; - return Kkb(this.a, a); - }; - _2.Mc = function eGb(a) { - return OFb(this, a); - }; - _2._c = function fGb(a, b) { - ++this.b; - return Nkb(this.a, a, b); - }; - _2.gc = function gGb() { - return this.a.c.length; - }; - _2.bd = function kGb(a, b) { - return new Jib(this.a, a, b); - }; - _2.Pc = function lGb() { - return Pkb(this.a); - }; - _2.Qc = function mGb(a) { - return Qkb(this.a, a); - }; - _2.b = 0; - mdb(cle, "NNode/ChangeAwareArrayList", 795); - bcb(269, 1, {}, pGb); - mdb(cle, "NNode/NNodeBuilder", 269); - bcb(1630, 1, {}, KGb); - _2.a = false; - _2.f = Ohe; - _2.j = 0; - mdb(cle, "NetworkSimplex", 1630); - bcb(1294, 1, qie, QGb); - _2.td = function RGb(a) { - PGb(this.a, BD(a, 680), true, false); - }; - mdb(ele, "NodeLabelAndSizeCalculator/lambda$0$Type", 1294); - bcb(558, 1, {}, YGb); - _2.b = true; - _2.c = true; - _2.d = true; - _2.e = true; - mdb(ele, "NodeMarginCalculator", 558); - bcb(212, 1, { 212: 1 }); - _2.j = false; - _2.k = false; - var oN = mdb(fle, "Cell", 212); - bcb(124, 212, { 124: 1, 212: 1 }, aHb); - _2.Re = function bHb() { - return _Gb(this); - }; - _2.Se = function cHb() { - var a; - a = this.n; - return this.a.a + a.b + a.c; - }; - mdb(fle, "AtomicCell", 124); - bcb(232, 22, { 3: 1, 35: 1, 22: 1, 232: 1 }, hHb); - var dHb, eHb, fHb; - var pN = ndb(fle, "ContainerArea", 232, CI, jHb, iHb); - var kHb; - bcb(326, 212, hle); - mdb(fle, "ContainerCell", 326); - bcb(1473, 326, hle, FHb); - _2.Re = function GHb() { - var a; - a = 0; - this.e ? this.b ? a = this.b.b : !!this.a[1][1] && (a = this.a[1][1].Re()) : a = EHb(this, AHb(this, true)); - return a > 0 ? a + this.n.d + this.n.a : 0; - }; - _2.Se = function HHb() { - 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].Se()); - } else if (this.g) { - e = EHb(this, yHb(this, null, true)); - } else { - for (b = (gHb(), OC(GC(pN, 1), Kie, 232, 0, [dHb, eHb, fHb])), c2 = 0, d = b.length; c2 < d; ++c2) { - a = b[c2]; - e = $wnd.Math.max(e, EHb(this, yHb(this, a, true))); - } + 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; } - return e > 0 ? e + this.n.b + this.n.c : 0; - }; - _2.Te = function IHb() { - var a, b, c2, d, e; - if (this.g) { - a = yHb(this, null, false); - for (c2 = (gHb(), OC(GC(pN, 1), Kie, 232, 0, [dHb, eHb, fHb])), d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - wHb(this, b, a); - } + var pos = ele.position(); + var newPos = { + x: pos.x + delta.x, + y: pos.y + delta.y + }; + if (silent) { + ele.silentPosition(newPos); } else { - for (c2 = (gHb(), OC(GC(pN, 1), Kie, 232, 0, [dHb, eHb, fHb])), d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - a = yHb(this, b, false); - wHb(this, b, a); - } - } - }; - _2.Ue = function JHb() { - var a, b, c2, d; - b = this.i; - a = this.n; - d = AHb(this, false); - uHb(this, (gHb(), dHb), b.d + a.d, d); - uHb(this, fHb, 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); - uHb(this, eHb, 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 rHb = 0, sHb = 0; - mdb(fle, "GridContainerCell", 1473); - bcb(461, 22, { 3: 1, 35: 1, 22: 1, 461: 1 }, OHb); - var KHb, LHb, MHb; - var sN = ndb(fle, "HorizontalLabelAlignment", 461, CI, QHb, PHb); - var RHb; - bcb(306, 212, { 212: 1, 306: 1 }, aIb, bIb, cIb); - _2.Re = function dIb() { - return YHb(this); - }; - _2.Se = function eIb() { - return ZHb(this); - }; - _2.a = 0; - _2.c = false; - var tN = mdb(fle, "LabelCell", 306); - bcb(244, 326, { 212: 1, 326: 1, 244: 1 }, mIb); - _2.Re = function nIb() { - return fIb(this); - }; - _2.Se = function oIb() { - return gIb(this); - }; - _2.Te = function rIb() { - hIb(this); - }; - _2.Ue = function sIb() { - iIb(this); - }; - _2.b = 0; - _2.c = 0; - _2.d = false; - mdb(fle, "StripContainerCell", 244); - bcb(1626, 1, Oie, tIb); - _2.Mb = function uIb(a) { - return pIb(BD(a, 212)); - }; - mdb(fle, "StripContainerCell/lambda$0$Type", 1626); - bcb(1627, 1, {}, vIb); - _2.Fe = function wIb(a) { - return BD(a, 212).Se(); - }; - mdb(fle, "StripContainerCell/lambda$1$Type", 1627); - bcb(1628, 1, Oie, xIb); - _2.Mb = function yIb(a) { - return qIb(BD(a, 212)); - }; - mdb(fle, "StripContainerCell/lambda$2$Type", 1628); - bcb(1629, 1, {}, zIb); - _2.Fe = function AIb(a) { - return BD(a, 212).Re(); - }; - mdb(fle, "StripContainerCell/lambda$3$Type", 1629); - bcb(462, 22, { 3: 1, 35: 1, 22: 1, 462: 1 }, FIb); - var BIb, CIb, DIb; - var zN = ndb(fle, "VerticalLabelAlignment", 462, CI, HIb, GIb); - var IIb; - bcb(789, 1, {}, LIb); - _2.c = 0; - _2.d = 0; - _2.k = 0; - _2.s = 0; - _2.t = 0; - _2.v = false; - _2.w = 0; - _2.D = false; - mdb(nle, "NodeContext", 789); - bcb(1471, 1, Dke, OIb); - _2.ue = function PIb(a, b) { - return NIb(BD(a, 61), BD(b, 61)); - }; - _2.Fb = function QIb(a) { - return this === a; - }; - _2.ve = function RIb() { - return new tpb(this); - }; - mdb(nle, "NodeContext/0methodref$comparePortSides$Type", 1471); - bcb(1472, 1, Dke, SIb); - _2.ue = function TIb(a, b) { - return MIb(BD(a, 111), BD(b, 111)); - }; - _2.Fb = function UIb(a) { - return this === a; - }; - _2.ve = function VIb() { - return new tpb(this); - }; - mdb(nle, "NodeContext/1methodref$comparePortContexts$Type", 1472); - bcb(159, 22, { 3: 1, 35: 1, 22: 1, 159: 1 }, tJb); - var WIb, XIb, YIb, ZIb, $Ib, _Ib, aJb, bJb, cJb, dJb, eJb, fJb, gJb, hJb, iJb, jJb, kJb, lJb, mJb, nJb, oJb, pJb; - var DN = ndb(nle, "NodeLabelLocation", 159, CI, wJb, vJb); - var xJb; - bcb(111, 1, { 111: 1 }, AJb); - _2.a = false; - mdb(nle, "PortContext", 111); - bcb(1476, 1, qie, TJb); - _2.td = function UJb(a) { - WHb(BD(a, 306)); - }; - mdb(qle, rle, 1476); - bcb(1477, 1, Oie, VJb); - _2.Mb = function WJb(a) { - return !!BD(a, 111).c; - }; - mdb(qle, sle, 1477); - bcb(1478, 1, qie, XJb); - _2.td = function YJb(a) { - WHb(BD(a, 111).c); - }; - mdb(qle, "LabelPlacer/lambda$2$Type", 1478); - var ZJb; - bcb(1475, 1, qie, fKb); - _2.td = function gKb(a) { - $Jb(); - zJb(BD(a, 111)); - }; - mdb(qle, "NodeLabelAndSizeUtilities/lambda$0$Type", 1475); - bcb(790, 1, qie, mKb); - _2.td = function nKb(a) { - kKb(this.b, this.c, this.a, BD(a, 181)); - }; - _2.a = false; - _2.c = false; - mdb(qle, "NodeLabelCellCreator/lambda$0$Type", 790); - bcb(1474, 1, qie, tKb); - _2.td = function uKb(a) { - sKb(this.a, BD(a, 181)); - }; - mdb(qle, "PortContextCreator/lambda$0$Type", 1474); - var BKb; - bcb(1829, 1, {}, VKb); - mdb(ule, "GreedyRectangleStripOverlapRemover", 1829); - bcb(1830, 1, Dke, XKb); - _2.ue = function YKb(a, b) { - return WKb(BD(a, 222), BD(b, 222)); - }; - _2.Fb = function ZKb(a) { - return this === a; - }; - _2.ve = function $Kb() { - return new tpb(this); - }; - mdb(ule, "GreedyRectangleStripOverlapRemover/0methodref$compareByYCoordinate$Type", 1830); - bcb(1786, 1, {}, fLb); - _2.a = 5; - _2.e = 0; - mdb(ule, "RectangleStripOverlapRemover", 1786); - bcb(1787, 1, Dke, jLb); - _2.ue = function kLb(a, b) { - return gLb(BD(a, 222), BD(b, 222)); - }; - _2.Fb = function lLb(a) { - return this === a; - }; - _2.ve = function mLb() { - return new tpb(this); - }; - mdb(ule, "RectangleStripOverlapRemover/0methodref$compareLeftRectangleBorders$Type", 1787); - bcb(1789, 1, Dke, nLb); - _2.ue = function oLb(a, b) { - return hLb(BD(a, 222), BD(b, 222)); - }; - _2.Fb = function pLb(a) { - return this === a; - }; - _2.ve = function qLb() { - return new tpb(this); - }; - mdb(ule, "RectangleStripOverlapRemover/1methodref$compareRightRectangleBorders$Type", 1789); - bcb(406, 22, { 3: 1, 35: 1, 22: 1, 406: 1 }, wLb); - var rLb, sLb, tLb, uLb; - var PN = ndb(ule, "RectangleStripOverlapRemover/OverlapRemovalDirection", 406, CI, yLb, xLb); - var zLb; - bcb(222, 1, { 222: 1 }, BLb); - mdb(ule, "RectangleStripOverlapRemover/RectangleNode", 222); - bcb(1788, 1, qie, CLb); - _2.td = function DLb(a) { - aLb(this.a, BD(a, 222)); - }; - mdb(ule, "RectangleStripOverlapRemover/lambda$1$Type", 1788); - bcb(1304, 1, Dke, GLb); - _2.ue = function HLb(a, b) { - return FLb(BD(a, 167), BD(b, 167)); - }; - _2.Fb = function ILb(a) { - return this === a; - }; - _2.ve = function JLb() { - return new tpb(this); - }; - mdb(wle, "PolyominoCompactor/CornerCasesGreaterThanRestComparator", 1304); - bcb(1307, 1, {}, KLb); - _2.Kb = function LLb(a) { - return BD(a, 324).a; - }; - mdb(wle, "PolyominoCompactor/CornerCasesGreaterThanRestComparator/lambda$0$Type", 1307); - bcb(1308, 1, Oie, MLb); - _2.Mb = function NLb(a) { - return BD(a, 323).a; - }; - mdb(wle, "PolyominoCompactor/CornerCasesGreaterThanRestComparator/lambda$1$Type", 1308); - bcb(1309, 1, Oie, OLb); - _2.Mb = function PLb(a) { - return BD(a, 323).a; - }; - mdb(wle, "PolyominoCompactor/CornerCasesGreaterThanRestComparator/lambda$2$Type", 1309); - bcb(1302, 1, Dke, RLb); - _2.ue = function SLb(a, b) { - return QLb(BD(a, 167), BD(b, 167)); - }; - _2.Fb = function TLb(a) { - return this === a; - }; - _2.ve = function ULb() { - return new tpb(this); - }; - mdb(wle, "PolyominoCompactor/MinNumOfExtensionDirectionsComparator", 1302); - bcb(1305, 1, {}, VLb); - _2.Kb = function WLb(a) { - return BD(a, 324).a; - }; - mdb(wle, "PolyominoCompactor/MinNumOfExtensionDirectionsComparator/lambda$0$Type", 1305); - bcb(767, 1, Dke, YLb); - _2.ue = function ZLb(a, b) { - return XLb(BD(a, 167), BD(b, 167)); - }; - _2.Fb = function $Lb(a) { - return this === a; - }; - _2.ve = function _Lb() { - return new tpb(this); - }; - mdb(wle, "PolyominoCompactor/MinNumOfExtensionsComparator", 767); - bcb(1300, 1, Dke, bMb); - _2.ue = function cMb(a, b) { - return aMb(BD(a, 321), BD(b, 321)); - }; - _2.Fb = function dMb(a) { - return this === a; - }; - _2.ve = function eMb() { - return new tpb(this); - }; - mdb(wle, "PolyominoCompactor/MinPerimeterComparator", 1300); - bcb(1301, 1, Dke, gMb); - _2.ue = function hMb(a, b) { - return fMb(BD(a, 321), BD(b, 321)); - }; - _2.Fb = function iMb(a) { - return this === a; - }; - _2.ve = function jMb() { - return new tpb(this); - }; - mdb(wle, "PolyominoCompactor/MinPerimeterComparatorWithShape", 1301); - bcb(1303, 1, Dke, lMb); - _2.ue = function mMb(a, b) { - return kMb(BD(a, 167), BD(b, 167)); - }; - _2.Fb = function nMb(a) { - return this === a; - }; - _2.ve = function oMb() { - return new tpb(this); - }; - mdb(wle, "PolyominoCompactor/SingleExtensionSideGreaterThanRestComparator", 1303); - bcb(1306, 1, {}, pMb); - _2.Kb = function qMb(a) { - return BD(a, 324).a; - }; - mdb(wle, "PolyominoCompactor/SingleExtensionSideGreaterThanRestComparator/lambda$0$Type", 1306); - bcb(777, 1, {}, tMb); - _2.Ce = function uMb(a, b) { - return sMb(this, BD(a, 46), BD(b, 167)); - }; - mdb(wle, "SuccessorCombination", 777); - bcb(644, 1, {}, wMb); - _2.Ce = function xMb(a, b) { - var c2; - return vMb((c2 = BD(a, 46), BD(b, 167), c2)); - }; - mdb(wle, "SuccessorJitter", 644); - bcb(643, 1, {}, zMb); - _2.Ce = function AMb(a, b) { - var c2; - return yMb((c2 = BD(a, 46), BD(b, 167), c2)); - }; - mdb(wle, "SuccessorLineByLine", 643); - bcb(568, 1, {}, CMb); - _2.Ce = function DMb(a, b) { - var c2; - return BMb((c2 = BD(a, 46), BD(b, 167), c2)); - }; - mdb(wle, "SuccessorManhattan", 568); - bcb(1356, 1, {}, FMb); - _2.Ce = function GMb(a, b) { - var c2; - return EMb((c2 = BD(a, 46), BD(b, 167), c2)); - }; - mdb(wle, "SuccessorMaxNormWindingInMathPosSense", 1356); - bcb(400, 1, {}, JMb); - _2.Ce = function KMb(a, b) { - return HMb(this, a, b); - }; - _2.c = false; - _2.d = false; - _2.e = false; - _2.f = false; - mdb(wle, "SuccessorQuadrantsGeneric", 400); - bcb(1357, 1, {}, LMb); - _2.Kb = function MMb(a) { - return BD(a, 324).a; - }; - mdb(wle, "SuccessorQuadrantsGeneric/lambda$0$Type", 1357); - bcb(323, 22, { 3: 1, 35: 1, 22: 1, 323: 1 }, SMb); - _2.a = false; - var NMb, OMb, PMb, QMb; - var jO = ndb(Ble, Cle, 323, CI, UMb, TMb); - var VMb; - bcb(1298, 1, {}); - _2.Ib = function bNb() { - var a, b, c2, d, e, f2; - c2 = " "; - a = meb(0); - for (e = 0; e < this.o; e++) { - c2 += "" + a.a; - a = meb(XMb(a.a)); - } - c2 += "\n"; - a = meb(0); - for (f2 = 0; f2 < this.p; f2++) { - c2 += "" + a.a; - a = meb(XMb(a.a)); - for (d = 0; d < this.o; d++) { - b = _Mb(this, d, f2); - ybb(b, 0) == 0 ? c2 += "_" : ybb(b, 1) == 0 ? c2 += "X" : c2 += "0"; - } - c2 += "\n"; - } - return qfb(c2, 0, c2.length - 1); - }; - _2.o = 0; - _2.p = 0; - mdb(Ble, "TwoBitGrid", 1298); - bcb(321, 1298, { 321: 1 }, pNb); - _2.j = 0; - _2.k = 0; - mdb(Ble, "PlanarGrid", 321); - bcb(167, 321, { 321: 1, 167: 1 }); - _2.g = 0; - _2.i = 0; - mdb(Ble, "Polyomino", 167); - var P3 = odb(Hle, Ile); - bcb(134, 1, Jle, zNb); - _2.Ye = function DNb(a, b) { - return xNb(this, a, b); - }; - _2.Ve = function ANb() { - return uNb(this); - }; - _2.We = function BNb(a) { - return vNb(this, a); - }; - _2.Xe = function CNb(a) { - return wNb(this, a); - }; - mdb(Hle, "MapPropertyHolder", 134); - bcb(1299, 134, Jle, ENb); - mdb(Ble, "Polyominoes", 1299); - var FNb = false, GNb, HNb; - bcb(1766, 1, qie, PNb); - _2.td = function QNb(a) { - JNb(BD(a, 221)); - }; - mdb(Kle, "DepthFirstCompaction/0methodref$compactTree$Type", 1766); - bcb(810, 1, qie, RNb); - _2.td = function SNb(a) { - MNb(this.a, BD(a, 221)); - }; - mdb(Kle, "DepthFirstCompaction/lambda$1$Type", 810); - bcb(1767, 1, qie, TNb); - _2.td = function UNb(a) { - NNb(this.a, this.b, this.c, BD(a, 221)); - }; - mdb(Kle, "DepthFirstCompaction/lambda$2$Type", 1767); - var VNb, WNb; - bcb(65, 1, { 65: 1 }, aOb); - mdb(Kle, "Node", 65); - bcb(1250, 1, {}, dOb); - mdb(Kle, "ScanlineOverlapCheck", 1250); - bcb(1251, 1, { 679: 1 }, hOb); - _2.Ke = function iOb(a) { - fOb(this, BD(a, 440)); - }; - mdb(Kle, "ScanlineOverlapCheck/OverlapsScanlineHandler", 1251); - bcb(1252, 1, Dke, kOb); - _2.ue = function lOb(a, b) { - return jOb(BD(a, 65), BD(b, 65)); - }; - _2.Fb = function mOb(a) { - return this === a; - }; - _2.ve = function nOb() { - return new tpb(this); - }; - mdb(Kle, "ScanlineOverlapCheck/OverlapsScanlineHandler/lambda$0$Type", 1252); - bcb(440, 1, { 440: 1 }, oOb); - _2.a = false; - mdb(Kle, "ScanlineOverlapCheck/Timestamp", 440); - bcb(1253, 1, Dke, pOb); - _2.ue = function qOb(a, b) { - return eOb(BD(a, 440), BD(b, 440)); - }; - _2.Fb = function rOb(a) { - return this === a; - }; - _2.ve = function sOb() { - return new tpb(this); - }; - mdb(Kle, "ScanlineOverlapCheck/lambda$0$Type", 1253); - bcb(550, 1, {}, tOb); - mdb(Lle, "SVGImage", 550); - bcb(324, 1, { 324: 1 }, uOb); - _2.Ib = function vOb() { - return "(" + this.a + She + this.b + She + this.c + ")"; - }; - mdb(Lle, "UniqueTriple", 324); - bcb(209, 1, Mle); - mdb(Nle, "AbstractLayoutProvider", 209); - bcb(1132, 209, Mle, yOb); - _2.Ze = function zOb(a, b) { - var c2, d, e, f2; - Odd(b, Ole, 1); - this.a = Edb(ED(hkd(a, (CPb(), BPb)))); - if (ikd(a, rPb)) { - e = GD(hkd(a, rPb)); - c2 = h4c(n4c(), e); - if (c2) { - d = BD(hgd(c2.f), 209); - d.Ze(a, Udd(b, 1)); - } - } - f2 = new AQb(this.a); - this.b = yQb(f2, a); - switch (BD(hkd(a, (nPb(), jPb)), 481).g) { - case 0: - BOb(new FOb(), this.b); - jkd(a, uPb, vNb(this.b, uPb)); - break; - default: - Zfb(); + ele.position(newPos); } - qQb(f2); - jkd(a, tPb, this.b); - Qdd(b); - }; - _2.a = 0; - mdb(Ple, "DisCoLayoutProvider", 1132); - bcb(1244, 1, {}, FOb); - _2.c = false; - _2.e = 0; - _2.f = 0; - mdb(Ple, "DisCoPolyominoCompactor", 1244); - bcb(561, 1, { 561: 1 }, MOb); - _2.b = true; - mdb(Qle, "DCComponent", 561); - bcb(394, 22, { 3: 1, 35: 1, 22: 1, 394: 1 }, SOb); - _2.a = false; - var NOb, OOb, POb, QOb; - var CO = ndb(Qle, "DCDirection", 394, CI, UOb, TOb); - var VOb; - bcb(266, 134, { 3: 1, 266: 1, 94: 1, 134: 1 }, XOb); - mdb(Qle, "DCElement", 266); - bcb(395, 1, { 395: 1 }, ZOb); - _2.c = 0; - mdb(Qle, "DCExtension", 395); - bcb(755, 134, Jle, aPb); - mdb(Qle, "DCGraph", 755); - bcb(481, 22, { 3: 1, 35: 1, 22: 1, 481: 1 }, dPb); - var bPb; - var GO = ndb(Rle, Sle, 481, CI, fPb, ePb); - var gPb; - bcb(854, 1, ale, oPb); - _2.Qe = function pPb(a) { - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Tle), Xle), "Connected Components Compaction Strategy"), "Strategy for packing different connected components in order to save space and enhance readability of a graph."), kPb), (_5c(), V5c)), GO), pqb((N5c(), L5c))))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), Ule), Xle), "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."), Z5c), ZI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), Vle), "debug"), "DCGraph"), "Access to the DCGraph is intended for the debug view,"), Y5c), SI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), Wle), "debug"), "List of Polyominoes"), "Access to the polyominoes is intended for the debug view,"), Y5c), SI), pqb(L5c)))); - DPb((new EPb(), a)); - }; - var iPb, jPb, kPb, lPb, mPb; - mdb(Rle, "DisCoMetaDataProvider", 854); - bcb(998, 1, ale, EPb); - _2.Qe = function FPb(a) { - DPb(a); - }; - var qPb, rPb, sPb, tPb, uPb, vPb, wPb, xPb, yPb, zPb, APb, BPb; - mdb(Rle, "DisCoOptions", 998); - bcb(999, 1, {}, GPb); - _2.$e = function HPb() { - var a; - return a = new yOb(), a; - }; - _2._e = function IPb(a) { - }; - mdb(Rle, "DisCoOptions/DiscoFactory", 999); - bcb(562, 167, { 321: 1, 167: 1, 562: 1 }, MPb); - _2.a = 0; - _2.b = 0; - _2.c = 0; - _2.d = 0; - mdb("org.eclipse.elk.alg.disco.structures", "DCPolyomino", 562); - var NPb, OPb, PPb; - bcb(1268, 1, Oie, aQb); - _2.Mb = function bQb(a) { - return _Pb(a); - }; - mdb(bme, "ElkGraphComponentsProcessor/lambda$0$Type", 1268); - bcb(1269, 1, {}, cQb); - _2.Kb = function dQb(a) { - return QPb(), jtd(BD(a, 79)); - }; - mdb(bme, "ElkGraphComponentsProcessor/lambda$1$Type", 1269); - bcb(1270, 1, Oie, eQb); - _2.Mb = function fQb(a) { - return WPb(BD(a, 79)); - }; - mdb(bme, "ElkGraphComponentsProcessor/lambda$2$Type", 1270); - bcb(1271, 1, {}, gQb); - _2.Kb = function hQb(a) { - return QPb(), ltd(BD(a, 79)); - }; - mdb(bme, "ElkGraphComponentsProcessor/lambda$3$Type", 1271); - bcb(1272, 1, Oie, iQb); - _2.Mb = function jQb(a) { - return XPb(BD(a, 79)); - }; - mdb(bme, "ElkGraphComponentsProcessor/lambda$4$Type", 1272); - bcb(1273, 1, Oie, kQb); - _2.Mb = function lQb(a) { - return YPb(this.a, BD(a, 79)); - }; - mdb(bme, "ElkGraphComponentsProcessor/lambda$5$Type", 1273); - bcb(1274, 1, {}, mQb); - _2.Kb = function nQb(a) { - return ZPb(this.a, BD(a, 79)); - }; - mdb(bme, "ElkGraphComponentsProcessor/lambda$6$Type", 1274); - bcb(1241, 1, {}, AQb); - _2.a = 0; - mdb(bme, "ElkGraphTransformer", 1241); - bcb(1242, 1, {}, CQb); - _2.Od = function DQb(a, b) { - BQb(this, BD(a, 160), BD(b, 266)); - }; - mdb(bme, "ElkGraphTransformer/OffsetApplier", 1242); - bcb(1243, 1, qie, FQb); - _2.td = function GQb(a) { - EQb(this, BD(a, 8)); - }; - mdb(bme, "ElkGraphTransformer/OffsetApplier/OffSetToChainApplier", 1243); - bcb(753, 1, {}, MQb); - mdb(gme, hme, 753); - bcb(1232, 1, Dke, OQb); - _2.ue = function PQb(a, b) { - return NQb(BD(a, 231), BD(b, 231)); - }; - _2.Fb = function QQb(a) { - return this === a; - }; - _2.ve = function RQb() { - return new tpb(this); - }; - mdb(gme, ime, 1232); - bcb(740, 209, Mle, ZQb); - _2.Ze = function $Qb(a, b) { - WQb(this, a, b); - }; - mdb(gme, "ForceLayoutProvider", 740); - bcb(357, 134, { 3: 1, 357: 1, 94: 1, 134: 1 }); - mdb(jme, "FParticle", 357); - bcb(559, 357, { 3: 1, 559: 1, 357: 1, 94: 1, 134: 1 }, aRb); - _2.Ib = function bRb() { - var a; - if (this.a) { - a = Jkb(this.a.a, this, 0); - return a >= 0 ? "b" + a + "[" + fRb(this.a) + "]" : "b[" + fRb(this.a) + "]"; - } - return "b_" + FCb(this); - }; - mdb(jme, "FBendpoint", 559); - bcb(282, 134, { 3: 1, 282: 1, 94: 1, 134: 1 }, gRb); - _2.Ib = function hRb() { - return fRb(this); - }; - mdb(jme, "FEdge", 282); - bcb(231, 134, { 3: 1, 231: 1, 94: 1, 134: 1 }, kRb); - var $O = mdb(jme, "FGraph", 231); - bcb(447, 357, { 3: 1, 447: 1, 357: 1, 94: 1, 134: 1 }, mRb); - _2.Ib = function nRb() { - return this.b == null || this.b.length == 0 ? "l[" + fRb(this.a) + "]" : "l_" + this.b; - }; - mdb(jme, "FLabel", 447); - bcb(144, 357, { 3: 1, 144: 1, 357: 1, 94: 1, 134: 1 }, pRb); - _2.Ib = function qRb() { - return oRb(this); - }; - _2.b = 0; - mdb(jme, "FNode", 144); - bcb(2003, 1, {}); - _2.bf = function vRb(a) { - rRb(this, a); - }; - _2.cf = function wRb() { - sRb(this); - }; - _2.d = 0; - mdb(lme, "AbstractForceModel", 2003); - bcb(631, 2003, { 631: 1 }, xRb); - _2.af = function zRb(a, b) { - var c2, d, e, f2, g; - uRb(this.f, a, b); - e = c7c(R6c(b.d), a.d); - g = $wnd.Math.sqrt(e.a * e.a + e.b * e.b); - d = $wnd.Math.max(0, g - U6c(a.e) / 2 - U6c(b.e) / 2); - c2 = jRb(this.e, a, b); - c2 > 0 ? f2 = -yRb(d, this.c) * c2 : f2 = CRb(d, this.b) * BD(vNb(a, (wSb(), oSb)), 19).a; - Y6c(e, f2 / g); - return e; - }; - _2.bf = function ARb(a) { - rRb(this, a); - this.a = BD(vNb(a, (wSb(), eSb)), 19).a; - this.c = Edb(ED(vNb(a, uSb))); - this.b = Edb(ED(vNb(a, qSb))); - }; - _2.df = function BRb(a) { - return a < this.a; - }; - _2.a = 0; - _2.b = 0; - _2.c = 0; - mdb(lme, "EadesModel", 631); - bcb(632, 2003, { 632: 1 }, DRb); - _2.af = function FRb(a, b) { - var c2, d, e, f2, g; - uRb(this.f, a, b); - e = c7c(R6c(b.d), a.d); - g = $wnd.Math.sqrt(e.a * e.a + e.b * e.b); - d = $wnd.Math.max(0, g - U6c(a.e) / 2 - U6c(b.e) / 2); - f2 = JRb(d, this.a) * BD(vNb(a, (wSb(), oSb)), 19).a; - c2 = jRb(this.e, a, b); - c2 > 0 && (f2 -= ERb(d, this.a) * c2); - Y6c(e, f2 * this.b / g); - return e; - }; - _2.bf = function GRb(a) { - var b, c2, d, e, f2, g, h; - rRb(this, a); - this.b = Edb(ED(vNb(a, (wSb(), vSb)))); - this.c = this.b / BD(vNb(a, eSb), 19).a; - d = a.e.c.length; - f2 = 0; - e = 0; - for (h = new olb(a.e); h.a < h.c.c.length; ) { - g = BD(mlb(h), 144); - f2 += g.e.a; - e += g.e.b; - } - b = f2 * e; - c2 = Edb(ED(vNb(a, uSb))) * ple; - this.a = $wnd.Math.sqrt(b / (2 * d)) * c2; - }; - _2.cf = function HRb() { - sRb(this); - this.b -= this.c; - }; - _2.df = function IRb(a) { - return this.b > 0; - }; - _2.a = 0; - _2.b = 0; - _2.c = 0; - mdb(lme, "FruchtermanReingoldModel", 632); - bcb(849, 1, ale, TRb); - _2.Qe = function URb(a) { - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), mme), ""), "Force Model"), "Determines the model for force calculation."), MRb), (_5c(), V5c)), gP), pqb((N5c(), L5c))))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), nme), ""), "Iterations"), "The number of iterations on the force model."), meb(300)), X5c), JI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), ome), ""), "Repulsive Power"), "Determines how many bend points are added to the edge; such bend points are regarded as repelling particles in the force model"), meb(0)), X5c), JI), pqb(I5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), pme), ""), "FR Temperature"), "The temperature is used as a scaling factor for particle displacements."), qme), U5c), BI), pqb(L5c)))); - o4c(a, pme, mme, RRb); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), rme), ""), "Eades Repulsion"), "Factor for repulsive forces in Eades' model."), 5), U5c), BI), pqb(L5c)))); - o4c(a, rme, mme, ORb); - xSb((new ySb(), a)); - }; - var KRb, LRb, MRb, NRb, ORb, PRb, QRb, RRb; - mdb(sme, "ForceMetaDataProvider", 849); - bcb(424, 22, { 3: 1, 35: 1, 22: 1, 424: 1 }, YRb); - var VRb, WRb; - var gP = ndb(sme, "ForceModelStrategy", 424, CI, $Rb, ZRb); - var _Rb; - bcb(988, 1, ale, ySb); - _2.Qe = function zSb(a) { - xSb(a); - }; - var bSb, cSb, dSb, eSb, fSb, gSb, hSb, iSb, jSb, kSb, lSb, mSb, nSb, oSb, pSb, qSb, rSb, sSb, tSb, uSb, vSb; - mdb(sme, "ForceOptions", 988); - bcb(989, 1, {}, ASb); - _2.$e = function BSb() { - var a; - return a = new ZQb(), a; - }; - _2._e = function CSb(a) { - }; - mdb(sme, "ForceOptions/ForceFactory", 989); - var DSb, ESb, FSb, GSb; - bcb(850, 1, ale, PSb); - _2.Qe = function QSb(a) { - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Mme), ""), "Fixed Position"), "Prevent that the node is moved by the layout algorithm."), (Bcb(), false)), (_5c(), T5c)), wI), pqb((N5c(), K5c))))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Nme), ""), "Desired Edge Length"), "Either specified for parent nodes or for individual edges, where the latter takes higher precedence."), 100), U5c), BI), qqb(L5c, OC(GC(e1, 1), Kie, 175, 0, [I5c]))))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Ome), ""), "Layout Dimension"), "Dimensions that are permitted to be altered during layout."), KSb), V5c), oP), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Pme), ""), "Stress Epsilon"), "Termination criterion for the iterative process."), qme), U5c), BI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Qme), ""), "Iteration Limit"), "Maximum number of performed iterations. Takes higher precedence than 'epsilon'."), meb(Ohe)), X5c), JI), pqb(L5c)))); - cTb((new dTb(), a)); - }; - var ISb, JSb, KSb, LSb, MSb, NSb; - mdb(sme, "StressMetaDataProvider", 850); - bcb(992, 1, ale, dTb); - _2.Qe = function eTb(a) { - cTb(a); - }; - var RSb, SSb, TSb, USb, VSb, WSb, XSb, YSb, ZSb, $Sb, _Sb, aTb; - mdb(sme, "StressOptions", 992); - bcb(993, 1, {}, fTb); - _2.$e = function gTb() { - var a; - return a = new iTb(), a; - }; - _2._e = function hTb(a) { - }; - mdb(sme, "StressOptions/StressFactory", 993); - bcb(1128, 209, Mle, iTb); - _2.Ze = function jTb(a, b) { - var c2, d, e, f2, g; - Odd(b, Sme, 1); - Ccb(DD(hkd(a, (bTb(), VSb)))) ? Ccb(DD(hkd(a, _Sb))) || $Cb((c2 = new _Cb((Pgd(), new bhd(a))), c2)) : WQb(new ZQb(), a, Udd(b, 1)); - e = TQb(a); - d = LQb(this.a, e); - for (g = d.Kc(); g.Ob(); ) { - f2 = BD(g.Pb(), 231); - if (f2.e.c.length <= 1) { - continue; + } + 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)); } - sTb(this.b, f2); - qTb(this.b); - Hkb(f2.d, new kTb()); - } - e = KQb(d); - SQb(e); - Qdd(b); - }; - mdb(Ume, "StressLayoutProvider", 1128); - bcb(1129, 1, qie, kTb); - _2.td = function lTb(a) { - lRb(BD(a, 447)); - }; - mdb(Ume, "StressLayoutProvider/lambda$0$Type", 1129); - bcb(990, 1, {}, tTb); - _2.c = 0; - _2.e = 0; - _2.g = 0; - mdb(Ume, "StressMajorization", 990); - bcb(379, 22, { 3: 1, 35: 1, 22: 1, 379: 1 }, zTb); - var vTb, wTb, xTb; - var oP = ndb(Ume, "StressMajorization/Dimension", 379, CI, BTb, ATb); - var CTb; - bcb(991, 1, Dke, ETb); - _2.ue = function FTb(a, b) { - return uTb(this.a, BD(a, 144), BD(b, 144)); - }; - _2.Fb = function GTb(a) { - return this === a; - }; - _2.ve = function HTb() { - return new tpb(this); - }; - mdb(Ume, "StressMajorization/lambda$0$Type", 991); - bcb(1229, 1, {}, PTb); - mdb(Wme, "ElkLayered", 1229); - bcb(1230, 1, qie, STb); - _2.td = function TTb(a) { - QTb(BD(a, 37)); - }; - mdb(Wme, "ElkLayered/lambda$0$Type", 1230); - bcb(1231, 1, qie, UTb); - _2.td = function VTb(a) { - RTb(this.a, BD(a, 37)); - }; - mdb(Wme, "ElkLayered/lambda$1$Type", 1231); - bcb(1263, 1, {}, bUb); - var WTb, XTb, YTb; - mdb(Wme, "GraphConfigurator", 1263); - bcb(759, 1, qie, dUb); - _2.td = function eUb(a) { - $Tb(this.a, BD(a, 10)); - }; - mdb(Wme, "GraphConfigurator/lambda$0$Type", 759); - bcb(760, 1, {}, fUb); - _2.Kb = function gUb(a) { - return ZTb(), new YAb(null, new Kub(BD(a, 29).a, 16)); - }; - mdb(Wme, "GraphConfigurator/lambda$1$Type", 760); - bcb(761, 1, qie, hUb); - _2.td = function iUb(a) { - $Tb(this.a, BD(a, 10)); - }; - mdb(Wme, "GraphConfigurator/lambda$2$Type", 761); - bcb(1127, 209, Mle, jUb); - _2.Ze = function kUb(a, b) { - var c2; - c2 = U1b(new a2b(), a); - PD(hkd(a, (Nyc(), axc))) === PD((hbd(), ebd)) ? JTb(this.a, c2, b) : KTb(this.a, c2, b); - z2b(new D2b(), c2); - }; - mdb(Wme, "LayeredLayoutProvider", 1127); - bcb(356, 22, { 3: 1, 35: 1, 22: 1, 356: 1 }, rUb); - var lUb, mUb, nUb, oUb, pUb; - var zP = ndb(Wme, "LayeredPhases", 356, CI, tUb, sUb); - var uUb; - bcb(1651, 1, {}, CUb); - _2.i = 0; - var wUb; - mdb(Xme, "ComponentsToCGraphTransformer", 1651); - var hVb; - bcb(1652, 1, {}, DUb); - _2.ef = function EUb(a, b) { - return $wnd.Math.min(a.a != null ? Edb(a.a) : a.c.i, b.a != null ? Edb(b.a) : b.c.i); - }; - _2.ff = function FUb(a, b) { - return $wnd.Math.min(a.a != null ? Edb(a.a) : a.c.i, b.a != null ? Edb(b.a) : b.c.i); - }; - mdb(Xme, "ComponentsToCGraphTransformer/1", 1652); - bcb(81, 1, { 81: 1 }); - _2.i = 0; - _2.k = true; - _2.o = Qje; - var IP = mdb(Yme, "CNode", 81); - bcb(460, 81, { 460: 1, 81: 1 }, GUb, HUb); - _2.Ib = function IUb() { - return ""; - }; - mdb(Xme, "ComponentsToCGraphTransformer/CRectNode", 460); - bcb(1623, 1, {}, VUb); - var JUb, KUb; - mdb(Xme, "OneDimensionalComponentsCompaction", 1623); - bcb(1624, 1, {}, YUb); - _2.Kb = function ZUb(a) { - return WUb(BD(a, 46)); - }; - _2.Fb = function $Ub(a) { - return this === a; - }; - mdb(Xme, "OneDimensionalComponentsCompaction/lambda$0$Type", 1624); - bcb(1625, 1, {}, _Ub); - _2.Kb = function aVb(a) { - return XUb(BD(a, 46)); - }; - _2.Fb = function bVb(a) { - return this === a; - }; - mdb(Xme, "OneDimensionalComponentsCompaction/lambda$1$Type", 1625); - bcb(1654, 1, {}, dVb); - mdb(Yme, "CGraph", 1654); - bcb(189, 1, { 189: 1 }, gVb); - _2.b = 0; - _2.c = 0; - _2.e = 0; - _2.g = true; - _2.i = Qje; - mdb(Yme, "CGroup", 189); - bcb(1653, 1, {}, jVb); - _2.ef = function kVb(a, b) { - return $wnd.Math.max(a.a != null ? Edb(a.a) : a.c.i, b.a != null ? Edb(b.a) : b.c.i); - }; - _2.ff = function lVb(a, b) { - return $wnd.Math.max(a.a != null ? Edb(a.a) : a.c.i, b.a != null ? Edb(b.a) : b.c.i); - }; - mdb(Yme, Ike, 1653); - bcb(1655, 1, {}, CVb); - _2.d = false; - var mVb; - var LP = mdb(Yme, Nke, 1655); - bcb(1656, 1, {}, DVb); - _2.Kb = function EVb(a) { - return nVb(), Bcb(), BD(BD(a, 46).a, 81).d.e != 0 ? true : false; - }; - _2.Fb = function FVb(a) { - return this === a; - }; - mdb(Yme, Oke, 1656); - bcb(823, 1, {}, IVb); - _2.a = false; - _2.b = false; - _2.c = false; - _2.d = false; - mdb(Yme, Pke, 823); - bcb(1825, 1, {}, OVb); - mdb(Zme, Qke, 1825); - var bQ = odb($me, Fke); - bcb(1826, 1, { 369: 1 }, SVb); - _2.Ke = function TVb(a) { - QVb(this, BD(a, 466)); - }; - mdb(Zme, Rke, 1826); - bcb(1827, 1, Dke, VVb); - _2.ue = function WVb(a, b) { - return UVb(BD(a, 81), BD(b, 81)); - }; - _2.Fb = function XVb(a) { - return this === a; - }; - _2.ve = function YVb() { - return new tpb(this); - }; - mdb(Zme, Ske, 1827); - bcb(466, 1, { 466: 1 }, ZVb); - _2.a = false; - mdb(Zme, Tke, 466); - bcb(1828, 1, Dke, $Vb); - _2.ue = function _Vb(a, b) { - return PVb(BD(a, 466), BD(b, 466)); - }; - _2.Fb = function aWb(a) { - return this === a; - }; - _2.ve = function bWb() { - return new tpb(this); - }; - mdb(Zme, Uke, 1828); - bcb(140, 1, { 140: 1 }, cWb, dWb); - _2.Fb = function eWb(a) { - var b; - if (a == null) { - return false; - } - if (TP != rb(a)) { - return false; } - b = BD(a, 140); - return wtb(this.c, b.c) && wtb(this.d, b.d); - }; - _2.Hb = function fWb() { - return Hlb(OC(GC(SI, 1), Uhe, 1, 5, [this.c, this.d])); - }; - _2.Ib = function gWb() { - return "(" + this.c + She + this.d + (this.a ? "cx" : "") + this.b + ")"; - }; - _2.a = true; - _2.c = 0; - _2.d = 0; - var TP = mdb($me, "Point", 140); - bcb(405, 22, { 3: 1, 35: 1, 22: 1, 405: 1 }, oWb); - var hWb, iWb, jWb, kWb; - var SP = ndb($me, "Point/Quadrant", 405, CI, sWb, rWb); - var tWb; - bcb(1642, 1, {}, CWb); - _2.b = null; - _2.c = null; - _2.d = null; - _2.e = null; - _2.f = null; - var vWb, wWb, xWb, yWb, zWb; - mdb($me, "RectilinearConvexHull", 1642); - bcb(574, 1, { 369: 1 }, NWb); - _2.Ke = function OWb(a) { - MWb(this, BD(a, 140)); - }; - _2.b = 0; - var KWb; - mdb($me, "RectilinearConvexHull/MaximalElementsEventHandler", 574); - bcb(1644, 1, Dke, QWb); - _2.ue = function RWb(a, b) { - return PWb(ED(a), ED(b)); - }; - _2.Fb = function SWb(a) { - return this === a; - }; - _2.ve = function TWb() { - return new tpb(this); - }; - mdb($me, "RectilinearConvexHull/MaximalElementsEventHandler/lambda$0$Type", 1644); - bcb(1643, 1, { 369: 1 }, VWb); - _2.Ke = function WWb(a) { - UWb(this, BD(a, 140)); - }; - _2.a = 0; - _2.b = null; - _2.c = null; - _2.d = null; - _2.e = null; - mdb($me, "RectilinearConvexHull/RectangleEventHandler", 1643); - bcb(1645, 1, Dke, XWb); - _2.ue = function YWb(a, b) { - return EWb(BD(a, 140), BD(b, 140)); - }; - _2.Fb = function ZWb(a) { - return this === a; - }; - _2.ve = function $Wb() { - return new tpb(this); - }; - mdb($me, "RectilinearConvexHull/lambda$0$Type", 1645); - bcb(1646, 1, Dke, _Wb); - _2.ue = function aXb(a, b) { - return FWb(BD(a, 140), BD(b, 140)); - }; - _2.Fb = function bXb(a) { - return this === a; - }; - _2.ve = function cXb() { - return new tpb(this); - }; - mdb($me, "RectilinearConvexHull/lambda$1$Type", 1646); - bcb(1647, 1, Dke, dXb); - _2.ue = function eXb(a, b) { - return GWb(BD(a, 140), BD(b, 140)); - }; - _2.Fb = function fXb(a) { - return this === a; - }; - _2.ve = function gXb() { - return new tpb(this); - }; - mdb($me, "RectilinearConvexHull/lambda$2$Type", 1647); - bcb(1648, 1, Dke, hXb); - _2.ue = function iXb(a, b) { - return HWb(BD(a, 140), BD(b, 140)); - }; - _2.Fb = function jXb(a) { - return this === a; - }; - _2.ve = function kXb() { - return new tpb(this); - }; - mdb($me, "RectilinearConvexHull/lambda$3$Type", 1648); - bcb(1649, 1, Dke, lXb); - _2.ue = function mXb(a, b) { - return IWb(BD(a, 140), BD(b, 140)); - }; - _2.Fb = function nXb(a) { - return this === a; - }; - _2.ve = function oXb() { - return new tpb(this); - }; - mdb($me, "RectilinearConvexHull/lambda$4$Type", 1649); - bcb(1650, 1, {}, qXb); - mdb($me, "Scanline", 1650); - bcb(2005, 1, {}); - mdb(_me, "AbstractGraphPlacer", 2005); - bcb(325, 1, { 325: 1 }, AXb); - _2.mf = function BXb(a) { - if (this.nf(a)) { - Rc(this.b, BD(vNb(a, (wtc(), Esc)), 21), a); - return true; + } else { + var pos = ele.position(); + rpos = modelToRenderedPosition(pos, zoom2, pan2); + if (dim === void 0) { + return rpos; } else { - return false; - } - }; - _2.nf = function CXb(a) { - var b, c2, d, e; - b = BD(vNb(a, (wtc(), Esc)), 21); - e = BD(Qc(wXb, b), 21); - for (d = e.Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 21); - if (!BD(Qc(this.b, c2), 15).dc()) { - return false; - } - } - return true; - }; - var wXb; - mdb(_me, "ComponentGroup", 325); - bcb(765, 2005, {}, HXb); - _2.of = function IXb(a) { - var b, c2; - for (c2 = new olb(this.a); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 325); - if (b.mf(a)) { - return; - } - } - Ekb(this.a, new AXb(a)); - }; - _2.lf = function JXb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2; - this.a.c = KC(SI, Uhe, 1, 0, 5, 1); - b.a.c = KC(SI, Uhe, 1, 0, 5, 1); - if (a.dc()) { - b.f.a = 0; - b.f.b = 0; - return; - } - g = BD(a.Xb(0), 37); - tNb(b, g); - for (e = a.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 37); - this.of(d); - } - o2 = new d7c(); - f2 = Edb(ED(vNb(g, (Nyc(), kyc)))); - for (j = new olb(this.a); j.a < j.c.c.length; ) { - h = BD(mlb(j), 325); - k = DXb(h, f2); - vXb(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 (Ccb(DD(vNb(g, qwc))) && PD(vNb(g, Swc)) === PD((Aad(), wad))) { - for (n = a.Kc(); n.Ob(); ) { - l = BD(n.Pb(), 37); - uXb(l, l.c.a, l.c.b); - } - c2 = new gYb(); - YXb(c2, a, f2); - for (m = a.Kc(); m.Ob(); ) { - l = BD(m.Pb(), 37); - P6c(X6c(l.c), c2.e); - } - P6c(X6c(b.f), c2.a); - } - for (i3 = new olb(this.a); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 325); - tXb(b, Uc(h.b)); - } - }; - mdb(_me, "ComponentGroupGraphPlacer", 765); - bcb(1293, 765, {}, LXb); - _2.of = function MXb(a) { - KXb(this, a); - }; - _2.lf = function NXb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4; - this.a.c = KC(SI, Uhe, 1, 0, 5, 1); - b.a.c = KC(SI, Uhe, 1, 0, 5, 1); - if (a.dc()) { - b.f.a = 0; - b.f.b = 0; - return; - } - g = BD(a.Xb(0), 37); - tNb(b, g); - for (e = a.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 37); - KXb(this, d); - } - t4 = new d7c(); - s = new d7c(); - p = new d7c(); - o2 = new d7c(); - f2 = Edb(ED(vNb(g, (Nyc(), kyc)))); - for (j = new olb(this.a); j.a < j.c.c.length; ) { - h = BD(mlb(j), 325); - if (fad(BD(vNb(b, (Y9c(), z8c)), 103))) { - p.a = t4.a; - for (r = new Mv(Pc(Fc(h.b).a).a.kc()); r.b.Ob(); ) { - q = BD(Lv(r.b.Pb()), 21); - if (q.Hc((Ucd(), Acd))) { - p.a = s.a; - break; - } - } - } else if (gad(BD(vNb(b, z8c), 103))) { - p.b = t4.b; - for (r = new Mv(Pc(Fc(h.b).a).a.kc()); r.b.Ob(); ) { - q = BD(Lv(r.b.Pb()), 21); - if (q.Hc((Ucd(), Tcd))) { - p.b = s.b; - break; - } - } - } - k = DXb(BD(h, 570), f2); - vXb(Uc(h.b), p.a, p.b); - if (fad(BD(vNb(b, z8c), 103))) { - s.a = p.a + k.a; - o2.a = $wnd.Math.max(o2.a, s.a); - for (r = new Mv(Pc(Fc(h.b).a).a.kc()); r.b.Ob(); ) { - q = BD(Lv(r.b.Pb()), 21); - if (q.Hc((Ucd(), Rcd))) { - t4.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 (gad(BD(vNb(b, z8c), 103))) { - s.b = p.b + k.b; - o2.b = $wnd.Math.max(o2.b, s.b); - for (r = new Mv(Pc(Fc(h.b).a).a.kc()); r.b.Ob(); ) { - q = BD(Lv(r.b.Pb()), 21); - if (q.Hc((Ucd(), zcd))) { - t4.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 (Ccb(DD(vNb(g, qwc))) && PD(vNb(g, Swc)) === PD((Aad(), wad))) { - for (n = a.Kc(); n.Ob(); ) { - l = BD(n.Pb(), 37); - uXb(l, l.c.a, l.c.b); - } - c2 = new gYb(); - YXb(c2, a, f2); - for (m = a.Kc(); m.Ob(); ) { - l = BD(m.Pb(), 37); - P6c(X6c(l.c), c2.e); - } - P6c(X6c(b.f), c2.a); - } - for (i3 = new olb(this.a); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 325); - tXb(b, Uc(h.b)); - } - }; - mdb(_me, "ComponentGroupModelOrderGraphPlacer", 1293); - bcb(423, 22, { 3: 1, 35: 1, 22: 1, 423: 1 }, SXb); - var OXb, PXb, QXb; - var hQ = ndb(_me, "ComponentOrderingStrategy", 423, CI, UXb, TXb); - var VXb; - bcb(650, 1, {}, gYb); - mdb(_me, "ComponentsCompactor", 650); - bcb(1468, 12, ake, jYb); - _2.Fc = function kYb(a) { - return hYb(this, BD(a, 140)); - }; - mdb(_me, "ComponentsCompactor/Hullpoints", 1468); - bcb(1465, 1, { 841: 1 }, mYb); - _2.a = false; - mdb(_me, "ComponentsCompactor/InternalComponent", 1465); - bcb(1464, 1, vie, nYb); - _2.Jc = function oYb(a) { - reb(this, a); - }; - _2.Kc = function pYb() { - return new olb(this.a); - }; - mdb(_me, "ComponentsCompactor/InternalConnectedComponents", 1464); - bcb(1467, 1, { 594: 1 }, qYb); - _2.hf = function sYb() { - return null; - }; - _2.jf = function tYb() { - return this.a; - }; - _2.gf = function rYb() { - return cYb(this.d); - }; - _2.kf = function uYb() { - return this.b; - }; - mdb(_me, "ComponentsCompactor/InternalExternalExtension", 1467); - bcb(1466, 1, { 594: 1 }, vYb); - _2.jf = function yYb() { - return this.a; - }; - _2.gf = function wYb() { - return cYb(this.d); - }; - _2.hf = function xYb() { - return this.c; - }; - _2.kf = function zYb() { - return this.b; - }; - mdb(_me, "ComponentsCompactor/InternalUnionExternalExtension", 1466); - bcb(1470, 1, {}, AYb); - mdb(_me, "ComponentsCompactor/OuterSegments", 1470); - bcb(1469, 1, {}, BYb); - mdb(_me, "ComponentsCompactor/Segments", 1469); - bcb(1264, 1, {}, FYb); - mdb(_me, hme, 1264); - bcb(1265, 1, Dke, HYb); - _2.ue = function IYb(a, b) { - return GYb(BD(a, 37), BD(b, 37)); - }; - _2.Fb = function JYb(a) { - return this === a; - }; - _2.ve = function KYb() { - return new tpb(this); - }; - mdb(_me, "ComponentsProcessor/lambda$0$Type", 1265); - bcb(570, 325, { 325: 1, 570: 1 }, PYb); - _2.mf = function QYb(a) { - return NYb(this, a); - }; - _2.nf = function RYb(a) { - return OYb(this, a); - }; - var LYb; - mdb(_me, "ModelOrderComponentGroup", 570); - bcb(1291, 2005, {}, SYb); - _2.lf = function TYb(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2; - if (a.gc() == 1) { - t4 = BD(a.Xb(0), 37); - if (t4 != b) { - b.a.c = KC(SI, Uhe, 1, 0, 5, 1); - sXb(b, t4, 0, 0); - tNb(b, t4); - u_b(b.d, t4.d); - b.f.a = t4.f.a; - b.f.b = t4.f.b; - } - return; - } else if (a.dc()) { - b.a.c = KC(SI, Uhe, 1, 0, 5, 1); - b.f.a = 0; - b.f.b = 0; - return; - } - if (PD(vNb(b, (Nyc(), twc))) === PD((RXb(), QXb))) { - for (i3 = a.Kc(); i3.Ob(); ) { - g = BD(i3.Pb(), 37); - r = 0; - for (p = new olb(g.a); p.a < p.c.c.length; ) { - o2 = BD(mlb(p), 10); - r += BD(vNb(o2, byc), 19).a; - } - g.p = r; - } - mmb(); - a.ad(new VYb()); - } - f2 = BD(a.Xb(0), 37); - b.a.c = KC(SI, Uhe, 1, 0, 5, 1); - tNb(b, f2); - n = 0; - u2 = 0; - for (j = a.Kc(); j.Ob(); ) { - g = BD(j.Pb(), 37); - s = g.f; - n = $wnd.Math.max(n, s.a); - u2 += s.a * s.b; - } - n = $wnd.Math.max(n, $wnd.Math.sqrt(u2) * Edb(ED(vNb(b, owc)))); - e = Edb(ED(vNb(b, kyc))); - v = 0; - w2 = 0; - m = 0; - c2 = e; - for (h = a.Kc(); h.Ob(); ) { - g = BD(h.Pb(), 37); - s = g.f; - if (v + s.a > n) { - v = 0; - w2 += m + e; - m = 0; - } - q = g.c; - uXb(g, v + q.a, w2 + q.b); - X6c(q); - c2 = $wnd.Math.max(c2, v + s.a); - m = $wnd.Math.max(m, s.b); - v += s.a + e; - } - b.f.a = c2; - b.f.b = w2 + m; - if (Ccb(DD(vNb(f2, qwc)))) { - d = new gYb(); - YXb(d, a, e); - for (l = a.Kc(); l.Ob(); ) { - k = BD(l.Pb(), 37); - P6c(X6c(k.c), d.e); - } - P6c(X6c(b.f), d.a); - } - tXb(b, a); - }; - mdb(_me, "SimpleRowGraphPlacer", 1291); - bcb(1292, 1, Dke, VYb); - _2.ue = function WYb(a, b) { - return UYb(BD(a, 37), BD(b, 37)); - }; - _2.Fb = function XYb(a) { - return this === a; - }; - _2.ve = function YYb() { - return new tpb(this); - }; - mdb(_me, "SimpleRowGraphPlacer/1", 1292); - var ZYb; - bcb(1262, 1, Vke, dZb); - _2.Lb = function eZb(a) { - var b; - return b = BD(vNb(BD(a, 243).b, (Nyc(), jxc)), 74), !!b && b.b != 0; - }; - _2.Fb = function fZb(a) { - return this === a; - }; - _2.Mb = function gZb(a) { - var b; - return b = BD(vNb(BD(a, 243).b, (Nyc(), jxc)), 74), !!b && b.b != 0; - }; - mdb(dne, "CompoundGraphPostprocessor/1", 1262); - bcb(1261, 1, ene, wZb); - _2.pf = function xZb(a, b) { - qZb(this, BD(a, 37), b); - }; - mdb(dne, "CompoundGraphPreprocessor", 1261); - bcb(441, 1, { 441: 1 }, yZb); - _2.c = false; - mdb(dne, "CompoundGraphPreprocessor/ExternalPort", 441); - bcb(243, 1, { 243: 1 }, BZb); - _2.Ib = function CZb() { - return Zr(this.c) + ":" + TZb(this.b); - }; - mdb(dne, "CrossHierarchyEdge", 243); - bcb(763, 1, Dke, EZb); - _2.ue = function FZb(a, b) { - return DZb(this, BD(a, 243), BD(b, 243)); - }; - _2.Fb = function GZb(a) { - return this === a; - }; - _2.ve = function IZb() { - return new tpb(this); - }; - mdb(dne, "CrossHierarchyEdgeComparator", 763); - bcb(299, 134, { 3: 1, 299: 1, 94: 1, 134: 1 }); - _2.p = 0; - mdb(fne, "LGraphElement", 299); - bcb(17, 299, { 3: 1, 17: 1, 299: 1, 94: 1, 134: 1 }, UZb); - _2.Ib = function VZb() { - return TZb(this); - }; - var AQ = mdb(fne, "LEdge", 17); - bcb(37, 299, { 3: 1, 20: 1, 37: 1, 299: 1, 94: 1, 134: 1 }, XZb); - _2.Jc = function YZb(a) { - reb(this, a); - }; - _2.Kc = function ZZb() { - return new olb(this.b); - }; - _2.Ib = function $Zb() { - 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 KQ = mdb(fne, "LGraph", 37); - var _Zb; - bcb(657, 1, {}); - _2.qf = function b$b() { - return this.e.n; - }; - _2.We = function c$b(a) { - return vNb(this.e, a); - }; - _2.rf = function d$b() { - return this.e.o; - }; - _2.sf = function e$b() { - return this.e.p; - }; - _2.Xe = function f$b(a) { - return wNb(this.e, a); - }; - _2.tf = function g$b(a) { - this.e.n.a = a.a; - this.e.n.b = a.b; - }; - _2.uf = function h$b(a) { - this.e.o.a = a.a; - this.e.o.b = a.b; - }; - _2.vf = function i$b(a) { - this.e.p = a; - }; - mdb(fne, "LGraphAdapters/AbstractLShapeAdapter", 657); - bcb(577, 1, { 839: 1 }, j$b); - _2.wf = function k$b() { - var a, b; - if (!this.b) { - this.b = Pu(this.a.b.c.length); - for (b = new olb(this.a.b); b.a < b.c.c.length; ) { - a = BD(mlb(b), 70); - Ekb(this.b, new v$b(a)); - } - } - return this.b; - }; - _2.b = null; - mdb(fne, "LGraphAdapters/LEdgeAdapter", 577); - bcb(656, 1, {}, l$b); - _2.xf = function m$b() { - var a, b, c2, d, e, f2; - if (!this.b) { - this.b = new Rkb(); - for (d = new olb(this.a.b); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 29); - for (f2 = new olb(c2.a); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 10); - if (this.c.Mb(e)) { - Ekb(this.b, new x$b(this, e, this.e)); - if (this.d) { - if (wNb(e, (wtc(), vtc))) { - for (b = BD(vNb(e, vtc), 15).Kc(); b.Ob(); ) { - a = BD(b.Pb(), 10); - Ekb(this.b, new x$b(this, a, false)); - } - } - if (wNb(e, tsc)) { - for (b = BD(vNb(e, tsc), 15).Kc(); b.Ob(); ) { - a = BD(b.Pb(), 10); - Ekb(this.b, new x$b(this, a, false)); - } - } - } - } - } - } - } - return this.b; - }; - _2.qf = function n$b() { - throw vbb(new cgb(hne)); - }; - _2.We = function o$b(a) { - return vNb(this.a, a); - }; - _2.rf = function p$b() { - return this.a.f; - }; - _2.sf = function q$b() { - return this.a.p; - }; - _2.Xe = function r$b(a) { - return wNb(this.a, a); - }; - _2.tf = function s$b(a) { - throw vbb(new cgb(hne)); - }; - _2.uf = function t$b(a) { - this.a.f.a = a.a; - this.a.f.b = a.b; - }; - _2.vf = function u$b(a) { - this.a.p = a; - }; - _2.b = null; - _2.d = false; - _2.e = false; - mdb(fne, "LGraphAdapters/LGraphAdapter", 656); - bcb(576, 657, { 181: 1 }, v$b); - mdb(fne, "LGraphAdapters/LLabelAdapter", 576); - bcb(575, 657, { 680: 1 }, x$b); - _2.yf = function y$b() { - return this.b; - }; - _2.zf = function z$b() { - return mmb(), mmb(), jmb; - }; - _2.wf = function A$b() { - var a, b; - if (!this.a) { - this.a = Pu(BD(this.e, 10).b.c.length); - for (b = new olb(BD(this.e, 10).b); b.a < b.c.c.length; ) { - a = BD(mlb(b), 70); - Ekb(this.a, new v$b(a)); - } - } - return this.a; - }; - _2.Af = function B$b() { - var a; - a = BD(this.e, 10).d; - return new J_b(a.d, a.c, a.a, a.b); - }; - _2.Bf = function C$b() { - return mmb(), mmb(), jmb; - }; - _2.Cf = function D$b() { - var a, b; - if (!this.c) { - this.c = Pu(BD(this.e, 10).j.c.length); - for (b = new olb(BD(this.e, 10).j); b.a < b.c.c.length; ) { - a = BD(mlb(b), 11); - Ekb(this.c, new I$b(a, this.d)); - } + return rpos[dim]; } - return this.c; - }; - _2.Df = function E$b() { - return Ccb(DD(vNb(BD(this.e, 10), (wtc(), wsc)))); - }; - _2.Ef = function F$b(a) { - BD(this.e, 10).d.b = a.b; - BD(this.e, 10).d.d = a.d; - BD(this.e, 10).d.c = a.c; - BD(this.e, 10).d.a = a.a; - }; - _2.Ff = function G$b(a) { - BD(this.e, 10).f.b = a.b; - BD(this.e, 10).f.d = a.d; - BD(this.e, 10).f.c = a.c; - BD(this.e, 10).f.a = a.a; - }; - _2.Gf = function H$b() { - w$b(this, (a$b(), _Zb)); - }; - _2.a = null; - _2.b = null; - _2.c = null; - _2.d = false; - mdb(fne, "LGraphAdapters/LNodeAdapter", 575); - bcb(1722, 657, { 838: 1 }, I$b); - _2.zf = function J$b() { - var a, b, c2, d; - if (this.d && BD(this.e, 11).i.k == (j0b(), i0b)) { - return mmb(), mmb(), jmb; - } else if (!this.a) { - this.a = new Rkb(); - for (c2 = new olb(BD(this.e, 11).e); c2.a < c2.c.c.length; ) { - a = BD(mlb(c2), 17); - Ekb(this.a, new j$b(a)); - } - if (this.d) { - d = BD(vNb(BD(this.e, 11), (wtc(), gtc)), 10); - if (d) { - for (b = new Sr(ur(R_b(d).a.Kc(), new Sq())); Qr(b); ) { - a = BD(Rr(b), 17); - Ekb(this.a, new j$b(a)); - } - } + } + } 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]; } - } - return this.a; - }; - _2.wf = function K$b() { - var a, b; - if (!this.b) { - this.b = Pu(BD(this.e, 11).f.c.length); - for (b = new olb(BD(this.e, 11).f); b.a < b.c.c.length; ) { - a = BD(mlb(b), 70); - Ekb(this.b, new v$b(a)); + 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 + }); } } - return this.b; - }; - _2.Bf = function L$b() { - var a, b, c2, d; - if (this.d && BD(this.e, 11).i.k == (j0b(), i0b)) { - return mmb(), mmb(), jmb; - } else if (!this.c) { - this.c = new Rkb(); - for (c2 = new olb(BD(this.e, 11).g); c2.a < c2.c.c.length; ) { - a = BD(mlb(c2), 17); - Ekb(this.c, new j$b(a)); - } - if (this.d) { - d = BD(vNb(BD(this.e, 11), (wtc(), gtc)), 10); - if (d) { - for (b = new Sr(ur(U_b(d).a.Kc(), new Sq())); Qr(b); ) { - a = BD(Rr(b), 17); - Ekb(this.c, new j$b(a)); - } - } - } + } 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]; } - return this.c; - }; - _2.Hf = function M$b() { - return BD(this.e, 11).j; - }; - _2.If = function N$b() { - return Ccb(DD(vNb(BD(this.e, 11), (wtc(), Nsc)))); - }; - _2.a = null; - _2.b = null; - _2.c = null; - _2.d = false; - mdb(fne, "LGraphAdapters/LPortAdapter", 1722); - bcb(1723, 1, Dke, P$b); - _2.ue = function Q$b(a, b) { - return O$b(BD(a, 11), BD(b, 11)); - }; - _2.Fb = function R$b(a) { - return this === a; - }; - _2.ve = function S$b() { - return new tpb(this); - }; - mdb(fne, "LGraphAdapters/PortComparator", 1723); - bcb(804, 1, Oie, T$b); - _2.Mb = function U$b(a) { - return BD(a, 10), a$b(), true; - }; - mdb(fne, "LGraphAdapters/lambda$0$Type", 804); - bcb(392, 299, { 3: 1, 299: 1, 392: 1, 94: 1, 134: 1 }); - mdb(fne, "LShape", 392); - bcb(70, 392, { 3: 1, 299: 1, 70: 1, 392: 1, 94: 1, 134: 1 }, p_b, q_b); - _2.Ib = function r_b() { - var a; - a = o_b(this); - return a == null ? "label" : "l_" + a; - }; - mdb(fne, "LLabel", 70); - bcb(207, 1, { 3: 1, 4: 1, 207: 1, 414: 1 }); - _2.Fb = function C_b(a) { - var b; - if (JD(a, 207)) { - b = BD(a, 207); - return this.d == b.d && this.a == b.a && this.b == b.b && this.c == b.c; + 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 false; - } - }; - _2.Hb = function D_b() { - var a, b; - a = Hdb(this.b) << 16; - a |= Hdb(this.a) & aje; - b = Hdb(this.c) << 16; - b |= Hdb(this.d) & aje; - return a ^ b; - }; - _2.Jf = function F_b(b) { - var c2, d, e, f2, g, h, i3, j, k, l, m; - g = 0; - while (g < b.length && E_b((BCb(g, b.length), b.charCodeAt(g)), mne)) { - ++g; - } - c2 = b.length; - while (c2 > 0 && E_b((BCb(c2 - 1, b.length), b.charCodeAt(c2 - 1)), nne)) { - --c2; - } - if (g < c2) { - l = mfb(b.substr(g, c2 - g), ",|;"); - try { - for (i3 = l, j = 0, k = i3.length; j < k; ++j) { - h = i3[j]; - f2 = mfb(h, "="); - if (f2.length != 2) { - throw vbb(new Wdb("Expecting a list of key-value pairs.")); - } - e = ufb(f2[0]); - m = Hcb(ufb(f2[1])); - dfb(e, "top") ? this.d = m : dfb(e, "left") ? this.b = m : dfb(e, "bottom") ? this.a = m : dfb(e, "right") && (this.c = m); - } - } catch (a) { - a = ubb(a); - if (JD(a, 127)) { - d = a; - throw vbb(new Wdb(one2 + d)); - } else - throw vbb(a); - } + return ppos[dim]; } + } + } 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"); + } + } + }); + 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") + } + }; + 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 }; - _2.Ib = function G_b() { - 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; - mdb(pne, "Spacing", 207); - bcb(142, 207, qne, H_b, I_b, J_b, K_b); - var i1 = mdb(pne, "ElkMargin", 142); - bcb(651, 142, qne, L_b); - mdb(fne, "LMargin", 651); - bcb(10, 392, { 3: 1, 299: 1, 10: 1, 392: 1, 94: 1, 134: 1 }, b0b); - _2.Ib = function c0b() { - return a0b(this); - }; - _2.i = false; - var OQ = mdb(fne, "LNode", 10); - bcb(267, 22, { 3: 1, 35: 1, 22: 1, 267: 1 }, k0b); - var d0b, e0b, f0b, g0b, h0b, i0b; - var NQ = ndb(fne, "LNode/NodeType", 267, CI, m0b, l0b); - var n0b; - bcb(116, 207, rne, p0b, q0b, r0b); - var j1 = mdb(pne, "ElkPadding", 116); - bcb(764, 116, rne, s0b); - mdb(fne, "LPadding", 764); - bcb(11, 392, { 3: 1, 299: 1, 11: 1, 392: 1, 94: 1, 134: 1 }, H0b); - _2.Ib = function I0b() { - var a, b, c2; - a = new Ufb(); - Qfb((a.a += "p_", a), C0b(this)); - !!this.i && Qfb(Pfb((a.a += "[", a), this.i), "]"); - if (this.e.c.length == 1 && this.g.c.length == 0 && BD(Ikb(this.e, 0), 17).c != this) { - b = BD(Ikb(this.e, 0), 17).c; - Qfb((a.a += " << ", a), C0b(b)); - Qfb(Pfb((a.a += "[", a), b.i), "]"); - } - if (this.e.c.length == 0 && this.g.c.length == 1 && BD(Ikb(this.g, 0), 17).d != this) { - c2 = BD(Ikb(this.g, 0), 17).d; - Qfb((a.a += " >> ", a), C0b(c2)); - Qfb(Pfb((a.a += "[", a), c2.i), "]"); - } - return a.a; - }; - _2.c = true; - _2.d = false; - var t0b, u0b, v0b, w0b, x0b, y0b; - var aR = mdb(fne, "LPort", 11); - bcb(397, 1, vie, J0b); - _2.Jc = function K0b(a) { - reb(this, a); + 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 }; - _2.Kc = function L0b() { - var a; - a = new olb(this.a.e); - return new M0b(a); - }; - mdb(fne, "LPort/1", 397); - bcb(1290, 1, aie, M0b); - _2.Nb = function N0b(a) { - Rrb(this, a); - }; - _2.Pb = function P0b() { - return BD(mlb(this.a), 17).c; - }; - _2.Ob = function O0b() { - return llb(this.a); - }; - _2.Qb = function Q0b() { - nlb(this.a); - }; - mdb(fne, "LPort/1/1", 1290); - bcb(359, 1, vie, R0b); - _2.Jc = function S0b(a) { - reb(this, a); - }; - _2.Kc = function T0b() { - var a; - return a = new olb(this.a.g), new U0b(a); - }; - mdb(fne, "LPort/2", 359); - bcb(762, 1, aie, U0b); - _2.Nb = function V0b(a) { - Rrb(this, a); - }; - _2.Pb = function X0b() { - return BD(mlb(this.a), 17).d; - }; - _2.Ob = function W0b() { - return llb(this.a); - }; - _2.Qb = function Y0b() { - nlb(this.a); - }; - mdb(fne, "LPort/2/1", 762); - bcb(1283, 1, vie, Z0b); - _2.Jc = function $0b(a) { - reb(this, a); - }; - _2.Kc = function _0b() { - return new b1b(this); - }; - mdb(fne, "LPort/CombineIter", 1283); - bcb(201, 1, aie, b1b); - _2.Nb = function c1b(a) { - Rrb(this, a); - }; - _2.Qb = function f1b() { - Srb(); - }; - _2.Ob = function d1b() { - return a1b(this); - }; - _2.Pb = function e1b() { - return llb(this.a) ? mlb(this.a) : mlb(this.b); - }; - mdb(fne, "LPort/CombineIter/1", 201); - bcb(1285, 1, Vke, h1b); - _2.Lb = function i1b(a) { - return g1b(a); - }; - _2.Fb = function j1b(a) { - return this === a; - }; - _2.Mb = function k1b(a) { - return z0b(), BD(a, 11).e.c.length != 0; - }; - mdb(fne, "LPort/lambda$0$Type", 1285); - bcb(1284, 1, Vke, m1b); - _2.Lb = function n1b(a) { - return l1b(a); - }; - _2.Fb = function o1b(a) { - return this === a; - }; - _2.Mb = function p1b(a) { - return z0b(), BD(a, 11).g.c.length != 0; - }; - mdb(fne, "LPort/lambda$1$Type", 1284); - bcb(1286, 1, Vke, q1b); - _2.Lb = function r1b(a) { - return z0b(), BD(a, 11).j == (Ucd(), Acd); - }; - _2.Fb = function s1b(a) { - return this === a; - }; - _2.Mb = function t1b(a) { - return z0b(), BD(a, 11).j == (Ucd(), Acd); - }; - mdb(fne, "LPort/lambda$2$Type", 1286); - bcb(1287, 1, Vke, u1b); - _2.Lb = function v1b(a) { - return z0b(), BD(a, 11).j == (Ucd(), zcd); - }; - _2.Fb = function w1b(a) { - return this === a; - }; - _2.Mb = function x1b(a) { - return z0b(), BD(a, 11).j == (Ucd(), zcd); - }; - mdb(fne, "LPort/lambda$3$Type", 1287); - bcb(1288, 1, Vke, y1b); - _2.Lb = function z1b(a) { - return z0b(), BD(a, 11).j == (Ucd(), Rcd); - }; - _2.Fb = function A1b(a) { - return this === a; - }; - _2.Mb = function B1b(a) { - return z0b(), BD(a, 11).j == (Ucd(), Rcd); - }; - mdb(fne, "LPort/lambda$4$Type", 1288); - bcb(1289, 1, Vke, C1b); - _2.Lb = function D1b(a) { - return z0b(), BD(a, 11).j == (Ucd(), Tcd); - }; - _2.Fb = function E1b(a) { - return this === a; - }; - _2.Mb = function F1b(a) { - return z0b(), BD(a, 11).j == (Ucd(), Tcd); - }; - mdb(fne, "LPort/lambda$5$Type", 1289); - bcb(29, 299, { 3: 1, 20: 1, 299: 1, 29: 1, 94: 1, 134: 1 }, H1b); - _2.Jc = function I1b(a) { - reb(this, a); - }; - _2.Kc = function J1b() { - return new olb(this.a); - }; - _2.Ib = function K1b() { - return "L_" + Jkb(this.b.b, this, 0) + Fe(this.a); - }; - mdb(fne, "Layer", 29); - bcb(1342, 1, {}, a2b); - mdb(tne, une, 1342); - bcb(1346, 1, {}, e2b); - _2.Kb = function f2b(a) { - return atd(BD(a, 82)); - }; - mdb(tne, "ElkGraphImporter/0methodref$connectableShapeToNode$Type", 1346); - bcb(1349, 1, {}, g2b); - _2.Kb = function h2b(a) { - return atd(BD(a, 82)); - }; - mdb(tne, "ElkGraphImporter/1methodref$connectableShapeToNode$Type", 1349); - bcb(1343, 1, qie, i2b); - _2.td = function j2b(a) { - Q1b(this.a, BD(a, 118)); - }; - mdb(tne, vne, 1343); - bcb(1344, 1, qie, k2b); - _2.td = function l2b(a) { - Q1b(this.a, BD(a, 118)); - }; - mdb(tne, wne, 1344); - bcb(1345, 1, {}, m2b); - _2.Kb = function n2b(a) { - return new YAb(null, new Kub(Old(BD(a, 79)), 16)); - }; - mdb(tne, xne, 1345); - bcb(1347, 1, Oie, o2b); - _2.Mb = function p2b(a) { - return b2b(this.a, BD(a, 33)); - }; - mdb(tne, yne, 1347); - bcb(1348, 1, {}, q2b); - _2.Kb = function r2b(a) { - return new YAb(null, new Kub(Nld(BD(a, 79)), 16)); - }; - mdb(tne, "ElkGraphImporter/lambda$5$Type", 1348); - bcb(1350, 1, Oie, s2b); - _2.Mb = function t2b(a) { - return c2b(this.a, BD(a, 33)); - }; - mdb(tne, "ElkGraphImporter/lambda$7$Type", 1350); - bcb(1351, 1, Oie, u2b); - _2.Mb = function v2b(a) { - return d2b(BD(a, 79)); - }; - mdb(tne, "ElkGraphImporter/lambda$8$Type", 1351); - bcb(1278, 1, {}, D2b); - var w2b; - mdb(tne, "ElkGraphLayoutTransferrer", 1278); - bcb(1279, 1, Oie, G2b); - _2.Mb = function H2b(a) { - return E2b(this.a, BD(a, 17)); - }; - mdb(tne, "ElkGraphLayoutTransferrer/lambda$0$Type", 1279); - bcb(1280, 1, qie, I2b); - _2.td = function J2b(a) { - x2b(); - Ekb(this.a, BD(a, 17)); - }; - mdb(tne, "ElkGraphLayoutTransferrer/lambda$1$Type", 1280); - bcb(1281, 1, Oie, K2b); - _2.Mb = function L2b(a) { - return F2b(this.a, BD(a, 17)); - }; - mdb(tne, "ElkGraphLayoutTransferrer/lambda$2$Type", 1281); - bcb(1282, 1, qie, M2b); - _2.td = function N2b(a) { - x2b(); - Ekb(this.a, BD(a, 17)); - }; - mdb(tne, "ElkGraphLayoutTransferrer/lambda$3$Type", 1282); - bcb(1485, 1, ene, S2b); - _2.pf = function T2b(a, b) { - Q2b(BD(a, 37), b); - }; - mdb(Ane, "CommentNodeMarginCalculator", 1485); - bcb(1486, 1, {}, U2b); - _2.Kb = function V2b(a) { - return new YAb(null, new Kub(BD(a, 29).a, 16)); - }; - mdb(Ane, "CommentNodeMarginCalculator/lambda$0$Type", 1486); - bcb(1487, 1, qie, W2b); - _2.td = function X2b(a) { - R2b(BD(a, 10)); - }; - mdb(Ane, "CommentNodeMarginCalculator/lambda$1$Type", 1487); - bcb(1488, 1, ene, _2b); - _2.pf = function a3b(a, b) { - Z2b(BD(a, 37), b); - }; - mdb(Ane, "CommentPostprocessor", 1488); - bcb(1489, 1, ene, e3b); - _2.pf = function f3b(a, b) { - b3b(BD(a, 37), b); - }; - mdb(Ane, "CommentPreprocessor", 1489); - bcb(1490, 1, ene, h3b); - _2.pf = function i3b(a, b) { - g3b(BD(a, 37), b); - }; - mdb(Ane, "ConstraintsPostprocessor", 1490); - bcb(1491, 1, ene, p3b); - _2.pf = function q3b(a, b) { - n3b(BD(a, 37), b); - }; - mdb(Ane, "EdgeAndLayerConstraintEdgeReverser", 1491); - bcb(1492, 1, ene, t3b); - _2.pf = function v3b(a, b) { - r3b(BD(a, 37), b); - }; - mdb(Ane, "EndLabelPostprocessor", 1492); - bcb(1493, 1, {}, w3b); - _2.Kb = function x3b(a) { - return new YAb(null, new Kub(BD(a, 29).a, 16)); - }; - mdb(Ane, "EndLabelPostprocessor/lambda$0$Type", 1493); - bcb(1494, 1, Oie, y3b); - _2.Mb = function z3b(a) { - return u3b(BD(a, 10)); - }; - mdb(Ane, "EndLabelPostprocessor/lambda$1$Type", 1494); - bcb(1495, 1, qie, A3b); - _2.td = function B3b(a) { - s3b(BD(a, 10)); - }; - mdb(Ane, "EndLabelPostprocessor/lambda$2$Type", 1495); - bcb(1496, 1, ene, M3b); - _2.pf = function P3b(a, b) { - I3b(BD(a, 37), b); - }; - mdb(Ane, "EndLabelPreprocessor", 1496); - bcb(1497, 1, {}, Q3b); - _2.Kb = function R3b(a) { - return new YAb(null, new Kub(BD(a, 29).a, 16)); - }; - mdb(Ane, "EndLabelPreprocessor/lambda$0$Type", 1497); - bcb(1498, 1, qie, S3b); - _2.td = function T3b(a) { - E3b(this.a, this.b, this.c, BD(a, 10)); - }; - _2.a = 0; - _2.b = 0; - _2.c = false; - mdb(Ane, "EndLabelPreprocessor/lambda$1$Type", 1498); - bcb(1499, 1, Oie, U3b); - _2.Mb = function V3b(a) { - return PD(vNb(BD(a, 70), (Nyc(), Qwc))) === PD((qad(), pad2)); - }; - mdb(Ane, "EndLabelPreprocessor/lambda$2$Type", 1499); - bcb(1500, 1, qie, W3b); - _2.td = function X3b(a) { - Dsb(this.a, BD(a, 70)); - }; - mdb(Ane, "EndLabelPreprocessor/lambda$3$Type", 1500); - bcb(1501, 1, Oie, Y3b); - _2.Mb = function Z3b(a) { - return PD(vNb(BD(a, 70), (Nyc(), Qwc))) === PD((qad(), oad)); - }; - mdb(Ane, "EndLabelPreprocessor/lambda$4$Type", 1501); - bcb(1502, 1, qie, $3b); - _2.td = function _3b(a) { - Dsb(this.a, BD(a, 70)); - }; - mdb(Ane, "EndLabelPreprocessor/lambda$5$Type", 1502); - bcb(1551, 1, ene, i4b); - _2.pf = function j4b(a, b) { - f4b(BD(a, 37), b); - }; - var a4b; - mdb(Ane, "EndLabelSorter", 1551); - bcb(1552, 1, Dke, l4b); - _2.ue = function m4b(a, b) { - return k4b(BD(a, 456), BD(b, 456)); - }; - _2.Fb = function n4b(a) { - return this === a; - }; - _2.ve = function o4b() { - return new tpb(this); - }; - mdb(Ane, "EndLabelSorter/1", 1552); - bcb(456, 1, { 456: 1 }, p4b); - mdb(Ane, "EndLabelSorter/LabelGroup", 456); - bcb(1553, 1, {}, q4b); - _2.Kb = function r4b(a) { - return b4b(), new YAb(null, new Kub(BD(a, 29).a, 16)); - }; - mdb(Ane, "EndLabelSorter/lambda$0$Type", 1553); - bcb(1554, 1, Oie, s4b); - _2.Mb = function t4b(a) { - return b4b(), BD(a, 10).k == (j0b(), h0b); - }; - mdb(Ane, "EndLabelSorter/lambda$1$Type", 1554); - bcb(1555, 1, qie, u4b); - _2.td = function v4b(a) { - g4b(BD(a, 10)); - }; - mdb(Ane, "EndLabelSorter/lambda$2$Type", 1555); - bcb(1556, 1, Oie, w4b); - _2.Mb = function x4b(a) { - return b4b(), PD(vNb(BD(a, 70), (Nyc(), Qwc))) === PD((qad(), oad)); - }; - mdb(Ane, "EndLabelSorter/lambda$3$Type", 1556); - bcb(1557, 1, Oie, y4b); - _2.Mb = function z4b(a) { - return b4b(), PD(vNb(BD(a, 70), (Nyc(), Qwc))) === PD((qad(), pad2)); - }; - mdb(Ane, "EndLabelSorter/lambda$4$Type", 1557); - bcb(1503, 1, ene, L4b); - _2.pf = function M4b(a, b) { - J4b(this, BD(a, 37)); - }; - _2.b = 0; - _2.c = 0; - mdb(Ane, "FinalSplineBendpointsCalculator", 1503); - bcb(1504, 1, {}, N4b); - _2.Kb = function O4b(a) { - return new YAb(null, new Kub(BD(a, 29).a, 16)); - }; - mdb(Ane, "FinalSplineBendpointsCalculator/lambda$0$Type", 1504); - bcb(1505, 1, {}, P4b); - _2.Kb = function Q4b(a) { - return new YAb(null, new Lub(new Sr(ur(U_b(BD(a, 10)).a.Kc(), new Sq())))); - }; - mdb(Ane, "FinalSplineBendpointsCalculator/lambda$1$Type", 1505); - bcb(1506, 1, Oie, R4b); - _2.Mb = function S4b(a) { - return !OZb(BD(a, 17)); - }; - mdb(Ane, "FinalSplineBendpointsCalculator/lambda$2$Type", 1506); - bcb(1507, 1, Oie, T4b); - _2.Mb = function U4b(a) { - return wNb(BD(a, 17), (wtc(), rtc)); - }; - mdb(Ane, "FinalSplineBendpointsCalculator/lambda$3$Type", 1507); - bcb(1508, 1, qie, V4b); - _2.td = function W4b(a) { - C4b(this.a, BD(a, 128)); - }; - mdb(Ane, "FinalSplineBendpointsCalculator/lambda$4$Type", 1508); - bcb(1509, 1, qie, X4b); - _2.td = function Y4b(a) { - smb(BD(a, 17).a); - }; - mdb(Ane, "FinalSplineBendpointsCalculator/lambda$5$Type", 1509); - bcb(792, 1, ene, u5b); - _2.pf = function v5b(a, b) { - l5b(this, BD(a, 37), b); - }; - mdb(Ane, "GraphTransformer", 792); - bcb(511, 22, { 3: 1, 35: 1, 22: 1, 511: 1 }, z5b); - var w5b, x5b; - var ZR = ndb(Ane, "GraphTransformer/Mode", 511, CI, B5b, A5b); - var C5b; - bcb(1510, 1, ene, I5b); - _2.pf = function J5b(a, b) { - F5b(BD(a, 37), b); - }; - mdb(Ane, "HierarchicalNodeResizingProcessor", 1510); - bcb(1511, 1, ene, Q5b); - _2.pf = function R5b(a, b) { - M5b(BD(a, 37), b); - }; - mdb(Ane, "HierarchicalPortConstraintProcessor", 1511); - bcb(1512, 1, Dke, T5b); - _2.ue = function U5b(a, b) { - return S5b(BD(a, 10), BD(b, 10)); - }; - _2.Fb = function V5b(a) { - return this === a; - }; - _2.ve = function W5b() { - return new tpb(this); - }; - mdb(Ane, "HierarchicalPortConstraintProcessor/NodeComparator", 1512); - bcb(1513, 1, ene, Z5b); - _2.pf = function $5b(a, b) { - X5b(BD(a, 37), b); - }; - mdb(Ane, "HierarchicalPortDummySizeProcessor", 1513); - bcb(1514, 1, ene, l6b); - _2.pf = function m6b(a, b) { - e6b(this, BD(a, 37), b); - }; - _2.a = 0; - mdb(Ane, "HierarchicalPortOrthogonalEdgeRouter", 1514); - bcb(1515, 1, Dke, o6b); - _2.ue = function p6b(a, b) { - return n6b(BD(a, 10), BD(b, 10)); - }; - _2.Fb = function q6b(a) { - return this === a; - }; - _2.ve = function r6b() { - return new tpb(this); - }; - mdb(Ane, "HierarchicalPortOrthogonalEdgeRouter/1", 1515); - bcb(1516, 1, Dke, t6b); - _2.ue = function u6b(a, b) { - return s6b(BD(a, 10), BD(b, 10)); - }; - _2.Fb = function v6b(a) { - return this === a; - }; - _2.ve = function w6b() { - return new tpb(this); - }; - mdb(Ane, "HierarchicalPortOrthogonalEdgeRouter/2", 1516); - bcb(1517, 1, ene, z6b); - _2.pf = function A6b(a, b) { - y6b(BD(a, 37), b); - }; - mdb(Ane, "HierarchicalPortPositionProcessor", 1517); - bcb(1518, 1, ene, J6b); - _2.pf = function K6b(a, b) { - I6b(this, BD(a, 37)); - }; - _2.a = 0; - _2.c = 0; - var B6b, C6b; - mdb(Ane, "HighDegreeNodeLayeringProcessor", 1518); - bcb(571, 1, { 571: 1 }, L6b); - _2.b = -1; - _2.d = -1; - mdb(Ane, "HighDegreeNodeLayeringProcessor/HighDegreeNodeInformation", 571); - bcb(1519, 1, {}, M6b); - _2.Kb = function N6b(a) { - return D6b(), R_b(BD(a, 10)); - }; - _2.Fb = function O6b(a) { - return this === a; - }; - mdb(Ane, "HighDegreeNodeLayeringProcessor/lambda$0$Type", 1519); - bcb(1520, 1, {}, P6b); - _2.Kb = function Q6b(a) { - return D6b(), U_b(BD(a, 10)); - }; - _2.Fb = function R6b(a) { - return this === a; - }; - mdb(Ane, "HighDegreeNodeLayeringProcessor/lambda$1$Type", 1520); - bcb(1526, 1, ene, X6b); - _2.pf = function Y6b(a, b) { - W6b(this, BD(a, 37), b); - }; - mdb(Ane, "HyperedgeDummyMerger", 1526); - bcb(793, 1, {}, Z6b); - _2.a = false; - _2.b = false; - _2.c = false; - mdb(Ane, "HyperedgeDummyMerger/MergeState", 793); - bcb(1527, 1, {}, $6b); - _2.Kb = function _6b(a) { - return new YAb(null, new Kub(BD(a, 29).a, 16)); - }; - mdb(Ane, "HyperedgeDummyMerger/lambda$0$Type", 1527); - bcb(1528, 1, {}, a7b); - _2.Kb = function b7b(a) { - return new YAb(null, new Kub(BD(a, 10).j, 16)); - }; - mdb(Ane, "HyperedgeDummyMerger/lambda$1$Type", 1528); - bcb(1529, 1, qie, c7b); - _2.td = function d7b(a) { - BD(a, 11).p = -1; - }; - mdb(Ane, "HyperedgeDummyMerger/lambda$2$Type", 1529); - bcb(1530, 1, ene, g7b); - _2.pf = function h7b(a, b) { - f7b(BD(a, 37), b); - }; - mdb(Ane, "HypernodesProcessor", 1530); - bcb(1531, 1, ene, j7b); - _2.pf = function k7b(a, b) { - i7b(BD(a, 37), b); - }; - mdb(Ane, "InLayerConstraintProcessor", 1531); - bcb(1532, 1, ene, m7b); - _2.pf = function n7b(a, b) { - l7b(BD(a, 37), b); - }; - mdb(Ane, "InnermostNodeMarginCalculator", 1532); - bcb(1533, 1, ene, r7b); - _2.pf = function w7b(a, b) { - q7b(this, BD(a, 37)); - }; - _2.a = Qje; - _2.b = Qje; - _2.c = Pje; - _2.d = Pje; - var zS = mdb(Ane, "InteractiveExternalPortPositioner", 1533); - bcb(1534, 1, {}, x7b); - _2.Kb = function y7b(a) { - return BD(a, 17).d.i; - }; - _2.Fb = function z7b(a) { - return this === a; - }; - mdb(Ane, "InteractiveExternalPortPositioner/lambda$0$Type", 1534); - bcb(1535, 1, {}, A7b); - _2.Kb = function B7b(a) { - return s7b(this.a, ED(a)); - }; - _2.Fb = function C7b(a) { - return this === a; - }; - mdb(Ane, "InteractiveExternalPortPositioner/lambda$1$Type", 1535); - bcb(1536, 1, {}, D7b); - _2.Kb = function E7b(a) { - return BD(a, 17).c.i; - }; - _2.Fb = function F7b(a) { - return this === a; - }; - mdb(Ane, "InteractiveExternalPortPositioner/lambda$2$Type", 1536); - bcb(1537, 1, {}, G7b); - _2.Kb = function H7b(a) { - return t7b(this.a, ED(a)); - }; - _2.Fb = function I7b(a) { - return this === a; - }; - mdb(Ane, "InteractiveExternalPortPositioner/lambda$3$Type", 1537); - bcb(1538, 1, {}, J7b); - _2.Kb = function K7b(a) { - return u7b(this.a, ED(a)); - }; - _2.Fb = function L7b(a) { - return this === a; - }; - mdb(Ane, "InteractiveExternalPortPositioner/lambda$4$Type", 1538); - bcb(1539, 1, {}, M7b); - _2.Kb = function N7b(a) { - return v7b(this.a, ED(a)); - }; - _2.Fb = function O7b(a) { - return this === a; - }; - mdb(Ane, "InteractiveExternalPortPositioner/lambda$5$Type", 1539); - bcb(77, 22, { 3: 1, 35: 1, 22: 1, 77: 1, 234: 1 }, T8b); - _2.Kf = function U8b() { - switch (this.g) { - case 15: - return new eoc(); - case 22: - return new Aoc(); - case 47: - return new Joc(); - case 28: - case 35: - return new uac(); - case 32: - return new S2b(); - case 42: - return new _2b(); - case 1: - return new e3b(); - case 41: - return new h3b(); - case 56: - return new u5b((y5b(), x5b)); - case 0: - return new u5b((y5b(), w5b)); - case 2: - return new p3b(); - case 54: - return new t3b(); - case 33: - return new M3b(); - case 51: - return new L4b(); - case 55: - return new I5b(); - case 13: - return new Q5b(); - case 38: - return new Z5b(); - case 44: - return new l6b(); - case 40: - return new z6b(); - case 9: - return new J6b(); - case 49: - return new sgc(); - case 37: - return new X6b(); - case 43: - return new g7b(); - case 27: - return new j7b(); - case 30: - return new m7b(); - case 3: - return new r7b(); - case 18: - return new b9b(); - case 29: - return new h9b(); - case 5: - return new u9b(); - case 50: - return new D9b(); - case 34: - return new $9b(); - case 36: - return new Iac(); - case 52: - return new i4b(); - case 11: - return new Sac(); - case 7: - return new abc(); - case 39: - return new obc(); - case 45: - return new rbc(); - case 16: - return new vbc(); - case 10: - return new Fbc(); - case 48: - return new Xbc(); - case 21: - return new ccc(); - case 23: - return new fGc((rGc(), pGc)); - case 8: - return new lcc(); - case 12: - return new tcc(); - case 4: - return new ycc(); - case 19: - return new Tcc(); - case 17: - return new pdc(); - case 53: - return new sdc(); - case 6: - return new hec(); - case 25: - return new wdc(); - case 46: - return new Ndc(); - case 31: - return new sec(); - case 14: - return new Fec(); - case 26: - return new ppc(); - case 20: - return new Uec(); - case 24: - return new fGc((rGc(), qGc)); + } + __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: - throw vbb(new Wdb(Dne + (this.f != null ? this.f : "" + this.g))); + return 0; } - }; - var P7b, Q7b, R7b, S7b, T7b, U7b, V7b, W7b, X7b, Y7b, Z7b, $7b, _7b, a8b, b8b, c8b, d8b, e8b, f8b, g8b, h8b, i8b, j8b, k8b, l8b, m8b, n8b, o8b, p8b, q8b, r8b, s8b, t8b, u8b, v8b, w8b, x8b, y8b, z8b, A8b, B8b, C8b, D8b, E8b, F8b, G8b, H8b, I8b, J8b, K8b, L8b, M8b, N8b, O8b, P8b, Q8b, R8b; - var AS = ndb(Ane, Ene, 77, CI, W8b, V8b); - var X8b; - bcb(1540, 1, ene, b9b); - _2.pf = function c9b(a, b) { - _8b(BD(a, 37), b); - }; - mdb(Ane, "InvertedPortProcessor", 1540); - bcb(1541, 1, ene, h9b); - _2.pf = function i9b(a, b) { - g9b(BD(a, 37), b); - }; - mdb(Ane, "LabelAndNodeSizeProcessor", 1541); - bcb(1542, 1, Oie, j9b); - _2.Mb = function k9b(a) { - return BD(a, 10).k == (j0b(), h0b); - }; - mdb(Ane, "LabelAndNodeSizeProcessor/lambda$0$Type", 1542); - bcb(1543, 1, Oie, l9b); - _2.Mb = function m9b(a) { - return BD(a, 10).k == (j0b(), e0b); - }; - mdb(Ane, "LabelAndNodeSizeProcessor/lambda$1$Type", 1543); - bcb(1544, 1, qie, n9b); - _2.td = function o9b(a) { - e9b(this.b, this.a, this.c, BD(a, 10)); - }; - _2.a = false; - _2.c = false; - mdb(Ane, "LabelAndNodeSizeProcessor/lambda$2$Type", 1544); - bcb(1545, 1, ene, u9b); - _2.pf = function v9b(a, b) { - s9b(BD(a, 37), b); - }; - var p9b; - mdb(Ane, "LabelDummyInserter", 1545); - bcb(1546, 1, Vke, w9b); - _2.Lb = function x9b(a) { - return PD(vNb(BD(a, 70), (Nyc(), Qwc))) === PD((qad(), nad)); - }; - _2.Fb = function y9b(a) { - return this === a; - }; - _2.Mb = function z9b(a) { - return PD(vNb(BD(a, 70), (Nyc(), Qwc))) === PD((qad(), nad)); - }; - mdb(Ane, "LabelDummyInserter/1", 1546); - bcb(1547, 1, ene, D9b); - _2.pf = function E9b(a, b) { - C9b(BD(a, 37), b); - }; - mdb(Ane, "LabelDummyRemover", 1547); - bcb(1548, 1, Oie, F9b); - _2.Mb = function G9b(a) { - return Ccb(DD(vNb(BD(a, 70), (Nyc(), Pwc)))); - }; - mdb(Ane, "LabelDummyRemover/lambda$0$Type", 1548); - bcb(1359, 1, ene, $9b); - _2.pf = function cac(a, b) { - W9b(this, BD(a, 37), b); - }; - _2.a = null; - var H9b; - mdb(Ane, "LabelDummySwitcher", 1359); - bcb(286, 1, { 286: 1 }, gac); - _2.c = 0; - _2.d = null; - _2.f = 0; - mdb(Ane, "LabelDummySwitcher/LabelDummyInfo", 286); - bcb(1360, 1, {}, hac); - _2.Kb = function iac(a) { - return I9b(), new YAb(null, new Kub(BD(a, 29).a, 16)); - }; - mdb(Ane, "LabelDummySwitcher/lambda$0$Type", 1360); - bcb(1361, 1, Oie, jac); - _2.Mb = function kac(a) { - return I9b(), BD(a, 10).k == (j0b(), f0b); - }; - mdb(Ane, "LabelDummySwitcher/lambda$1$Type", 1361); - bcb(1362, 1, {}, lac); - _2.Kb = function mac(a) { - return _9b(this.a, BD(a, 10)); - }; - mdb(Ane, "LabelDummySwitcher/lambda$2$Type", 1362); - bcb(1363, 1, qie, nac); - _2.td = function oac(a) { - aac(this.a, BD(a, 286)); - }; - mdb(Ane, "LabelDummySwitcher/lambda$3$Type", 1363); - bcb(1364, 1, Dke, pac); - _2.ue = function qac(a, b) { - return bac(BD(a, 286), BD(b, 286)); - }; - _2.Fb = function rac(a) { - return this === a; - }; - _2.ve = function sac() { - return new tpb(this); - }; - mdb(Ane, "LabelDummySwitcher/lambda$4$Type", 1364); - bcb(791, 1, ene, uac); - _2.pf = function vac(a, b) { - tac(BD(a, 37), b); - }; - mdb(Ane, "LabelManagementProcessor", 791); - bcb(1549, 1, ene, Iac); - _2.pf = function Jac(a, b) { - Cac(BD(a, 37), b); - }; - mdb(Ane, "LabelSideSelector", 1549); - bcb(1550, 1, Oie, Kac); - _2.Mb = function Lac(a) { - return Ccb(DD(vNb(BD(a, 70), (Nyc(), Pwc)))); - }; - mdb(Ane, "LabelSideSelector/lambda$0$Type", 1550); - bcb(1558, 1, ene, Sac); - _2.pf = function Tac(a, b) { - Oac(BD(a, 37), b); - }; - mdb(Ane, "LayerConstraintPostprocessor", 1558); - bcb(1559, 1, ene, abc); - _2.pf = function bbc(a, b) { - $ac(BD(a, 37), b); - }; - var Uac; - mdb(Ane, "LayerConstraintPreprocessor", 1559); - bcb(360, 22, { 3: 1, 35: 1, 22: 1, 360: 1 }, ibc); - var cbc, dbc, ebc, fbc; - var VS = ndb(Ane, "LayerConstraintPreprocessor/HiddenNodeConnections", 360, CI, kbc, jbc); - var lbc; - bcb(1560, 1, ene, obc); - _2.pf = function pbc(a, b) { - nbc(BD(a, 37), b); - }; - mdb(Ane, "LayerSizeAndGraphHeightCalculator", 1560); - bcb(1561, 1, ene, rbc); - _2.pf = function tbc(a, b) { - qbc(BD(a, 37), b); - }; - mdb(Ane, "LongEdgeJoiner", 1561); - bcb(1562, 1, ene, vbc); - _2.pf = function xbc(a, b) { - ubc(BD(a, 37), b); - }; - mdb(Ane, "LongEdgeSplitter", 1562); - bcb(1563, 1, ene, Fbc); - _2.pf = function Ibc(a, b) { - Bbc(this, BD(a, 37), b); - }; - _2.d = 0; - _2.e = 0; - _2.i = 0; - _2.j = 0; - _2.k = 0; - _2.n = 0; - mdb(Ane, "NodePromotion", 1563); - bcb(1564, 1, {}, Jbc); - _2.Kb = function Kbc(a) { - return BD(a, 46), Bcb(), true; - }; - _2.Fb = function Lbc(a) { - return this === a; - }; - mdb(Ane, "NodePromotion/lambda$0$Type", 1564); - bcb(1565, 1, {}, Mbc); - _2.Kb = function Nbc(a) { - return Gbc(this.a, BD(a, 46)); - }; - _2.Fb = function Obc(a) { - return this === a; - }; - _2.a = 0; - mdb(Ane, "NodePromotion/lambda$1$Type", 1565); - bcb(1566, 1, {}, Pbc); - _2.Kb = function Qbc(a) { - return Hbc(this.a, BD(a, 46)); - }; - _2.Fb = function Rbc(a) { - return this === a; - }; - _2.a = 0; - mdb(Ane, "NodePromotion/lambda$2$Type", 1566); - bcb(1567, 1, ene, Xbc); - _2.pf = function Ybc(a, b) { - Sbc(BD(a, 37), b); - }; - mdb(Ane, "NorthSouthPortPostprocessor", 1567); - bcb(1568, 1, ene, ccc); - _2.pf = function ecc(a, b) { - acc(BD(a, 37), b); - }; - mdb(Ane, "NorthSouthPortPreprocessor", 1568); - bcb(1569, 1, Dke, fcc); - _2.ue = function gcc(a, b) { - return dcc(BD(a, 11), BD(b, 11)); - }; - _2.Fb = function hcc(a) { - return this === a; - }; - _2.ve = function icc() { - return new tpb(this); - }; - mdb(Ane, "NorthSouthPortPreprocessor/lambda$0$Type", 1569); - bcb(1570, 1, ene, lcc); - _2.pf = function ncc(a, b) { - kcc(BD(a, 37), b); - }; - mdb(Ane, "PartitionMidprocessor", 1570); - bcb(1571, 1, Oie, occ); - _2.Mb = function pcc(a) { - return wNb(BD(a, 10), (Nyc(), Nxc)); - }; - mdb(Ane, "PartitionMidprocessor/lambda$0$Type", 1571); - bcb(1572, 1, qie, qcc); - _2.td = function rcc(a) { - mcc(this.a, BD(a, 10)); - }; - mdb(Ane, "PartitionMidprocessor/lambda$1$Type", 1572); - bcb(1573, 1, ene, tcc); - _2.pf = function ucc(a, b) { - scc(BD(a, 37), b); - }; - mdb(Ane, "PartitionPostprocessor", 1573); - bcb(1574, 1, ene, ycc); - _2.pf = function zcc(a, b) { - wcc(BD(a, 37), b); - }; - mdb(Ane, "PartitionPreprocessor", 1574); - bcb(1575, 1, Oie, Acc); - _2.Mb = function Bcc(a) { - return wNb(BD(a, 10), (Nyc(), Nxc)); - }; - mdb(Ane, "PartitionPreprocessor/lambda$0$Type", 1575); - bcb(1576, 1, {}, Ccc); - _2.Kb = function Dcc(a) { - return new YAb(null, new Lub(new Sr(ur(U_b(BD(a, 10)).a.Kc(), new Sq())))); - }; - mdb(Ane, "PartitionPreprocessor/lambda$1$Type", 1576); - bcb(1577, 1, Oie, Ecc); - _2.Mb = function Fcc(a) { - return vcc(BD(a, 17)); - }; - mdb(Ane, "PartitionPreprocessor/lambda$2$Type", 1577); - bcb(1578, 1, qie, Gcc); - _2.td = function Hcc(a) { - xcc(BD(a, 17)); - }; - mdb(Ane, "PartitionPreprocessor/lambda$3$Type", 1578); - bcb(1579, 1, ene, Tcc); - _2.pf = function Xcc(a, b) { - Qcc(BD(a, 37), b); - }; - var Icc, Jcc, Kcc, Lcc, Mcc, Ncc; - mdb(Ane, "PortListSorter", 1579); - bcb(1580, 1, {}, Zcc); - _2.Kb = function $cc(a) { - return Occ(), BD(a, 11).e; - }; - mdb(Ane, "PortListSorter/lambda$0$Type", 1580); - bcb(1581, 1, {}, _cc); - _2.Kb = function adc(a) { - return Occ(), BD(a, 11).g; - }; - mdb(Ane, "PortListSorter/lambda$1$Type", 1581); - bcb(1582, 1, Dke, bdc); - _2.ue = function cdc(a, b) { - return Ucc(BD(a, 11), BD(b, 11)); - }; - _2.Fb = function ddc(a) { - return this === a; - }; - _2.ve = function edc() { - return new tpb(this); - }; - mdb(Ane, "PortListSorter/lambda$2$Type", 1582); - bcb(1583, 1, Dke, fdc); - _2.ue = function gdc(a, b) { - return Vcc(BD(a, 11), BD(b, 11)); - }; - _2.Fb = function hdc(a) { - return this === a; - }; - _2.ve = function idc() { - return new tpb(this); - }; - mdb(Ane, "PortListSorter/lambda$3$Type", 1583); - bcb(1584, 1, Dke, jdc); - _2.ue = function kdc(a, b) { - return Wcc(BD(a, 11), BD(b, 11)); - }; - _2.Fb = function ldc(a) { - return this === a; - }; - _2.ve = function mdc() { - return new tpb(this); - }; - mdb(Ane, "PortListSorter/lambda$4$Type", 1584); - bcb(1585, 1, ene, pdc); - _2.pf = function qdc(a, b) { - ndc(BD(a, 37), b); - }; - mdb(Ane, "PortSideProcessor", 1585); - bcb(1586, 1, ene, sdc); - _2.pf = function tdc(a, b) { - rdc(BD(a, 37), b); - }; - mdb(Ane, "ReversedEdgeRestorer", 1586); - bcb(1591, 1, ene, wdc); - _2.pf = function xdc(a, b) { - udc(this, BD(a, 37), b); - }; - mdb(Ane, "SelfLoopPortRestorer", 1591); - bcb(1592, 1, {}, ydc); - _2.Kb = function zdc(a) { - return new YAb(null, new Kub(BD(a, 29).a, 16)); - }; - mdb(Ane, "SelfLoopPortRestorer/lambda$0$Type", 1592); - bcb(1593, 1, Oie, Adc); - _2.Mb = function Bdc(a) { - return BD(a, 10).k == (j0b(), h0b); - }; - mdb(Ane, "SelfLoopPortRestorer/lambda$1$Type", 1593); - bcb(1594, 1, Oie, Cdc); - _2.Mb = function Ddc(a) { - return wNb(BD(a, 10), (wtc(), ntc)); - }; - mdb(Ane, "SelfLoopPortRestorer/lambda$2$Type", 1594); - bcb(1595, 1, {}, Edc); - _2.Kb = function Fdc(a) { - return BD(vNb(BD(a, 10), (wtc(), ntc)), 403); - }; - mdb(Ane, "SelfLoopPortRestorer/lambda$3$Type", 1595); - bcb(1596, 1, qie, Gdc); - _2.td = function Hdc(a) { - vdc(this.a, BD(a, 403)); - }; - mdb(Ane, "SelfLoopPortRestorer/lambda$4$Type", 1596); - bcb(794, 1, qie, Idc); - _2.td = function Jdc(a) { - ljc(BD(a, 101)); - }; - mdb(Ane, "SelfLoopPortRestorer/lambda$5$Type", 794); - bcb(1597, 1, ene, Ndc); - _2.pf = function Pdc(a, b) { - Kdc(BD(a, 37), b); - }; - mdb(Ane, "SelfLoopPostProcessor", 1597); - bcb(1598, 1, {}, Qdc); - _2.Kb = function Rdc(a) { - return new YAb(null, new Kub(BD(a, 29).a, 16)); - }; - mdb(Ane, "SelfLoopPostProcessor/lambda$0$Type", 1598); - bcb(1599, 1, Oie, Sdc); - _2.Mb = function Tdc(a) { - return BD(a, 10).k == (j0b(), h0b); - }; - mdb(Ane, "SelfLoopPostProcessor/lambda$1$Type", 1599); - bcb(1600, 1, Oie, Udc); - _2.Mb = function Vdc(a) { - return wNb(BD(a, 10), (wtc(), ntc)); - }; - mdb(Ane, "SelfLoopPostProcessor/lambda$2$Type", 1600); - bcb(1601, 1, qie, Wdc); - _2.td = function Xdc(a) { - Ldc(BD(a, 10)); - }; - mdb(Ane, "SelfLoopPostProcessor/lambda$3$Type", 1601); - bcb(1602, 1, {}, Ydc); - _2.Kb = function Zdc(a) { - return new YAb(null, new Kub(BD(a, 101).f, 1)); - }; - mdb(Ane, "SelfLoopPostProcessor/lambda$4$Type", 1602); - bcb(1603, 1, qie, $dc); - _2.td = function _dc(a) { - Mdc(this.a, BD(a, 409)); - }; - mdb(Ane, "SelfLoopPostProcessor/lambda$5$Type", 1603); - bcb(1604, 1, Oie, aec); - _2.Mb = function bec(a) { - return !!BD(a, 101).i; - }; - mdb(Ane, "SelfLoopPostProcessor/lambda$6$Type", 1604); - bcb(1605, 1, qie, cec); - _2.td = function dec(a) { - Odc(this.a, BD(a, 101)); - }; - mdb(Ane, "SelfLoopPostProcessor/lambda$7$Type", 1605); - bcb(1587, 1, ene, hec); - _2.pf = function iec(a, b) { - gec(BD(a, 37), b); - }; - mdb(Ane, "SelfLoopPreProcessor", 1587); - bcb(1588, 1, {}, jec); - _2.Kb = function kec(a) { - return new YAb(null, new Kub(BD(a, 101).f, 1)); - }; - mdb(Ane, "SelfLoopPreProcessor/lambda$0$Type", 1588); - bcb(1589, 1, {}, lec); - _2.Kb = function mec(a) { - return BD(a, 409).a; - }; - mdb(Ane, "SelfLoopPreProcessor/lambda$1$Type", 1589); - bcb(1590, 1, qie, nec); - _2.td = function oec(a) { - fec(BD(a, 17)); - }; - mdb(Ane, "SelfLoopPreProcessor/lambda$2$Type", 1590); - bcb(1606, 1, ene, sec); - _2.pf = function tec(a, b) { - qec(this, BD(a, 37), b); - }; - mdb(Ane, "SelfLoopRouter", 1606); - bcb(1607, 1, {}, uec); - _2.Kb = function vec(a) { - return new YAb(null, new Kub(BD(a, 29).a, 16)); - }; - mdb(Ane, "SelfLoopRouter/lambda$0$Type", 1607); - bcb(1608, 1, Oie, wec); - _2.Mb = function xec(a) { - return BD(a, 10).k == (j0b(), h0b); - }; - mdb(Ane, "SelfLoopRouter/lambda$1$Type", 1608); - bcb(1609, 1, Oie, yec); - _2.Mb = function zec(a) { - return wNb(BD(a, 10), (wtc(), ntc)); - }; - mdb(Ane, "SelfLoopRouter/lambda$2$Type", 1609); - bcb(1610, 1, {}, Aec); - _2.Kb = function Bec(a) { - return BD(vNb(BD(a, 10), (wtc(), ntc)), 403); - }; - mdb(Ane, "SelfLoopRouter/lambda$3$Type", 1610); - bcb(1611, 1, qie, Cec); - _2.td = function Dec(a) { - pec(this.a, this.b, BD(a, 403)); - }; - mdb(Ane, "SelfLoopRouter/lambda$4$Type", 1611); - bcb(1612, 1, ene, Fec); - _2.pf = function Iec(a, b) { - Eec(BD(a, 37), b); - }; - mdb(Ane, "SemiInteractiveCrossMinProcessor", 1612); - bcb(1613, 1, Oie, Jec); - _2.Mb = function Kec(a) { - return BD(a, 10).k == (j0b(), h0b); - }; - mdb(Ane, "SemiInteractiveCrossMinProcessor/lambda$0$Type", 1613); - bcb(1614, 1, Oie, Lec); - _2.Mb = function Mec(a) { - return uNb(BD(a, 10))._b((Nyc(), ayc)); - }; - mdb(Ane, "SemiInteractiveCrossMinProcessor/lambda$1$Type", 1614); - bcb(1615, 1, Dke, Nec); - _2.ue = function Oec(a, b) { - return Gec(BD(a, 10), BD(b, 10)); - }; - _2.Fb = function Pec(a) { - return this === a; - }; - _2.ve = function Qec() { - return new tpb(this); - }; - mdb(Ane, "SemiInteractiveCrossMinProcessor/lambda$2$Type", 1615); - bcb(1616, 1, {}, Rec); - _2.Ce = function Sec(a, b) { - return Hec(BD(a, 10), BD(b, 10)); - }; - mdb(Ane, "SemiInteractiveCrossMinProcessor/lambda$3$Type", 1616); - bcb(1618, 1, ene, Uec); - _2.pf = function Yec(a, b) { - Tec(BD(a, 37), b); - }; - mdb(Ane, "SortByInputModelProcessor", 1618); - bcb(1619, 1, Oie, Zec); - _2.Mb = function $ec(a) { - return BD(a, 11).g.c.length != 0; - }; - mdb(Ane, "SortByInputModelProcessor/lambda$0$Type", 1619); - bcb(1620, 1, qie, _ec); - _2.td = function afc(a) { - Wec(this.a, BD(a, 11)); - }; - mdb(Ane, "SortByInputModelProcessor/lambda$1$Type", 1620); - bcb(1693, 803, {}, jfc); - _2.Me = function kfc(a) { - var b, c2, d, e; - this.c = a; - switch (this.a.g) { - case 2: - b = new Rkb(); - MAb(JAb(new YAb(null, new Kub(this.c.a.b, 16)), new lgc()), new ngc(this, b)); - nEb(this, new tfc()); - Hkb(b, new xfc()); - b.c = KC(SI, Uhe, 1, 0, 5, 1); - MAb(JAb(new YAb(null, new Kub(this.c.a.b, 16)), new zfc()), new Bfc(b)); - nEb(this, new Ffc()); - Hkb(b, new Jfc()); - b.c = KC(SI, Uhe, 1, 0, 5, 1); - c2 = Ntb($zb(OAb(new YAb(null, new Kub(this.c.a.b, 16)), new Lfc(this))), new Nfc()); - MAb(new YAb(null, new Kub(this.c.a.a, 16)), new Rfc(c2, b)); - nEb(this, new Vfc()); - Hkb(b, new Zfc()); - b.c = KC(SI, Uhe, 1, 0, 5, 1); + } else if (paddingObject.units === "px") { + return paddingObject.pfValue; + } else { + return 0; + } + } + __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; + } + } + } + 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; + } + 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) - 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 3: - d = new Rkb(); - nEb(this, new lfc()); - e = Ntb($zb(OAb(new YAb(null, new Kub(this.c.a.b, 16)), new pfc(this))), new Pfc()); - MAb(JAb(new YAb(null, new Kub(this.c.a.b, 16)), new _fc()), new bgc(e, d)); - nEb(this, new fgc()); - Hkb(d, new jgc()); - d.c = KC(SI, Uhe, 1, 0, 5, 1); + case "right": + xo = lx1; break; - default: - throw vbb(new x2c()); - } - }; - _2.b = 0; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation", 1693); - bcb(1694, 1, Vke, lfc); - _2.Lb = function mfc(a) { - return JD(BD(a, 57).g, 145); - }; - _2.Fb = function nfc(a) { - return this === a; - }; - _2.Mb = function ofc(a) { - return JD(BD(a, 57).g, 145); - }; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$0$Type", 1694); - bcb(1695, 1, {}, pfc); - _2.Fe = function qfc(a) { - return dfc(this.a, BD(a, 57)); - }; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$1$Type", 1695); - bcb(1703, 1, Pie, rfc); - _2.Vd = function sfc() { - cfc(this.a, this.b, -1); - }; - _2.b = 0; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$10$Type", 1703); - bcb(1705, 1, Vke, tfc); - _2.Lb = function ufc(a) { - return JD(BD(a, 57).g, 145); - }; - _2.Fb = function vfc(a) { - return this === a; - }; - _2.Mb = function wfc(a) { - return JD(BD(a, 57).g, 145); - }; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$11$Type", 1705); - bcb(1706, 1, qie, xfc); - _2.td = function yfc(a) { - BD(a, 365).Vd(); - }; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$12$Type", 1706); - bcb(1707, 1, Oie, zfc); - _2.Mb = function Afc(a) { - return JD(BD(a, 57).g, 10); - }; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$13$Type", 1707); - bcb(1709, 1, qie, Bfc); - _2.td = function Cfc(a) { - efc(this.a, BD(a, 57)); - }; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$14$Type", 1709); - bcb(1708, 1, Pie, Dfc); - _2.Vd = function Efc() { - cfc(this.b, this.a, -1); - }; - _2.a = 0; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$15$Type", 1708); - bcb(1710, 1, Vke, Ffc); - _2.Lb = function Gfc(a) { - return JD(BD(a, 57).g, 10); - }; - _2.Fb = function Hfc(a) { - return this === a; - }; - _2.Mb = function Ifc(a) { - return JD(BD(a, 57).g, 10); - }; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$16$Type", 1710); - bcb(1711, 1, qie, Jfc); - _2.td = function Kfc(a) { - BD(a, 365).Vd(); - }; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$17$Type", 1711); - bcb(1712, 1, {}, Lfc); - _2.Fe = function Mfc(a) { - return ffc(this.a, BD(a, 57)); - }; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$18$Type", 1712); - bcb(1713, 1, {}, Nfc); - _2.De = function Ofc() { - return 0; - }; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$19$Type", 1713); - bcb(1696, 1, {}, Pfc); - _2.De = function Qfc() { - return 0; - }; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$2$Type", 1696); - bcb(1715, 1, qie, Rfc); - _2.td = function Sfc(a) { - gfc(this.a, this.b, BD(a, 307)); - }; - _2.a = 0; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$20$Type", 1715); - bcb(1714, 1, Pie, Tfc); - _2.Vd = function Ufc() { - bfc(this.a, this.b, -1); - }; - _2.b = 0; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$21$Type", 1714); - bcb(1716, 1, Vke, Vfc); - _2.Lb = function Wfc(a) { - return BD(a, 57), true; - }; - _2.Fb = function Xfc(a) { - return this === a; - }; - _2.Mb = function Yfc(a) { - return BD(a, 57), true; - }; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$22$Type", 1716); - bcb(1717, 1, qie, Zfc); - _2.td = function $fc(a) { - BD(a, 365).Vd(); - }; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$23$Type", 1717); - bcb(1697, 1, Oie, _fc); - _2.Mb = function agc(a) { - return JD(BD(a, 57).g, 10); - }; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$3$Type", 1697); - bcb(1699, 1, qie, bgc); - _2.td = function cgc(a) { - hfc(this.a, this.b, BD(a, 57)); - }; - _2.a = 0; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$4$Type", 1699); - bcb(1698, 1, Pie, dgc); - _2.Vd = function egc() { - cfc(this.b, this.a, -1); - }; - _2.a = 0; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$5$Type", 1698); - bcb(1700, 1, Vke, fgc); - _2.Lb = function ggc(a) { - return BD(a, 57), true; - }; - _2.Fb = function hgc(a) { - return this === a; - }; - _2.Mb = function igc(a) { - return BD(a, 57), true; - }; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$6$Type", 1700); - bcb(1701, 1, qie, jgc); - _2.td = function kgc(a) { - BD(a, 365).Vd(); - }; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$7$Type", 1701); - bcb(1702, 1, Oie, lgc); - _2.Mb = function mgc(a) { - return JD(BD(a, 57).g, 145); - }; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$8$Type", 1702); - bcb(1704, 1, qie, ngc); - _2.td = function ogc(a) { - ifc(this.a, this.b, BD(a, 57)); - }; - mdb(Jne, "EdgeAwareScanlineConstraintCalculation/lambda$9$Type", 1704); - bcb(1521, 1, ene, sgc); - _2.pf = function xgc(a, b) { - rgc(this, BD(a, 37), b); - }; - var pgc; - mdb(Jne, "HorizontalGraphCompactor", 1521); - bcb(1522, 1, {}, ygc); - _2.Oe = function zgc(a, b) { - var c2, d, e; - if (vgc(a, b)) { - return 0; } - c2 = tgc(a); - d = tgc(b); - if (!!c2 && c2.k == (j0b(), e0b) || !!d && d.k == (j0b(), e0b)) { - return 0; - } - e = BD(vNb(this.a.a, (wtc(), otc)), 304); - return fBc(e, c2 ? c2.k : (j0b(), g0b), d ? d.k : (j0b(), g0b)); - }; - _2.Pe = function Agc(a, b) { - var c2, d, e; - if (vgc(a, b)) { - return 1; - } - c2 = tgc(a); - d = tgc(b); - e = BD(vNb(this.a.a, (wtc(), otc)), 304); - return iBc(e, c2 ? c2.k : (j0b(), g0b), d ? d.k : (j0b(), g0b)); - }; - mdb(Jne, "HorizontalGraphCompactor/1", 1522); - bcb(1523, 1, {}, Bgc); - _2.Ne = function Cgc(a, b) { - return qgc(), a.a.i == 0; - }; - mdb(Jne, "HorizontalGraphCompactor/lambda$0$Type", 1523); - bcb(1524, 1, {}, Dgc); - _2.Ne = function Egc(a, b) { - return wgc(this.a, a, b); - }; - mdb(Jne, "HorizontalGraphCompactor/lambda$1$Type", 1524); - bcb(1664, 1, {}, Ygc); - var Fgc, Ggc; - mdb(Jne, "LGraphToCGraphTransformer", 1664); - bcb(1672, 1, Oie, ehc); - _2.Mb = function fhc(a) { - return a != null; - }; - mdb(Jne, "LGraphToCGraphTransformer/0methodref$nonNull$Type", 1672); - bcb(1665, 1, {}, ghc); - _2.Kb = function hhc(a) { - return Hgc(), fcb(vNb(BD(BD(a, 57).g, 10), (wtc(), $sc))); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$0$Type", 1665); - bcb(1666, 1, {}, ihc); - _2.Kb = function jhc(a) { - return Hgc(), gic(BD(BD(a, 57).g, 145)); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$1$Type", 1666); - bcb(1675, 1, Oie, khc); - _2.Mb = function lhc(a) { - return Hgc(), JD(BD(a, 57).g, 10); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$10$Type", 1675); - bcb(1676, 1, qie, mhc); - _2.td = function nhc(a) { - Zgc(BD(a, 57)); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$11$Type", 1676); - bcb(1677, 1, Oie, ohc); - _2.Mb = function phc(a) { - return Hgc(), JD(BD(a, 57).g, 145); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$12$Type", 1677); - bcb(1681, 1, qie, qhc); - _2.td = function rhc(a) { - $gc(BD(a, 57)); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$13$Type", 1681); - bcb(1678, 1, qie, shc); - _2.td = function thc(a) { - _gc(this.a, BD(a, 8)); - }; - _2.a = 0; - mdb(Jne, "LGraphToCGraphTransformer/lambda$14$Type", 1678); - bcb(1679, 1, qie, uhc); - _2.td = function vhc(a) { - ahc(this.a, BD(a, 110)); - }; - _2.a = 0; - mdb(Jne, "LGraphToCGraphTransformer/lambda$15$Type", 1679); - bcb(1680, 1, qie, whc); - _2.td = function xhc(a) { - bhc(this.a, BD(a, 8)); - }; - _2.a = 0; - mdb(Jne, "LGraphToCGraphTransformer/lambda$16$Type", 1680); - bcb(1682, 1, {}, yhc); - _2.Kb = function zhc(a) { - return Hgc(), new YAb(null, new Lub(new Sr(ur(U_b(BD(a, 10)).a.Kc(), new Sq())))); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$17$Type", 1682); - bcb(1683, 1, Oie, Ahc); - _2.Mb = function Bhc(a) { - return Hgc(), OZb(BD(a, 17)); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$18$Type", 1683); - bcb(1684, 1, qie, Chc); - _2.td = function Dhc(a) { - Qgc(this.a, BD(a, 17)); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$19$Type", 1684); - bcb(1668, 1, qie, Ehc); - _2.td = function Fhc(a) { - Rgc(this.a, BD(a, 145)); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$2$Type", 1668); - bcb(1685, 1, {}, Ghc); - _2.Kb = function Hhc(a) { - return Hgc(), new YAb(null, new Kub(BD(a, 29).a, 16)); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$20$Type", 1685); - bcb(1686, 1, {}, Ihc); - _2.Kb = function Jhc(a) { - return Hgc(), new YAb(null, new Lub(new Sr(ur(U_b(BD(a, 10)).a.Kc(), new Sq())))); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$21$Type", 1686); - bcb(1687, 1, {}, Khc); - _2.Kb = function Lhc(a) { - return Hgc(), BD(vNb(BD(a, 17), (wtc(), rtc)), 15); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$22$Type", 1687); - bcb(1688, 1, Oie, Mhc); - _2.Mb = function Nhc(a) { - return chc(BD(a, 15)); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$23$Type", 1688); - bcb(1689, 1, qie, Ohc); - _2.td = function Phc(a) { - Jgc(this.a, BD(a, 15)); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$24$Type", 1689); - bcb(1667, 1, qie, Qhc); - _2.td = function Rhc(a) { - Sgc(this.a, this.b, BD(a, 145)); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$3$Type", 1667); - bcb(1669, 1, {}, Shc); - _2.Kb = function Thc(a) { - return Hgc(), new YAb(null, new Kub(BD(a, 29).a, 16)); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$4$Type", 1669); - bcb(1670, 1, {}, Uhc); - _2.Kb = function Vhc(a) { - return Hgc(), new YAb(null, new Lub(new Sr(ur(U_b(BD(a, 10)).a.Kc(), new Sq())))); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$5$Type", 1670); - bcb(1671, 1, {}, Whc); - _2.Kb = function Xhc(a) { - return Hgc(), BD(vNb(BD(a, 17), (wtc(), rtc)), 15); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$6$Type", 1671); - bcb(1673, 1, qie, Yhc); - _2.td = function Zhc(a) { - dhc(this.a, BD(a, 15)); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$8$Type", 1673); - bcb(1674, 1, qie, $hc); - _2.td = function _hc(a) { - Tgc(this.a, this.b, BD(a, 145)); - }; - mdb(Jne, "LGraphToCGraphTransformer/lambda$9$Type", 1674); - bcb(1663, 1, {}, dic); - _2.Le = function eic(a) { - var b, c2, d, e, f2; - this.a = a; - this.d = new KFb(); - this.c = KC(jN, Uhe, 121, this.a.a.a.c.length, 0, 1); - this.b = 0; - for (c2 = new olb(this.a.a.a); c2.a < c2.c.c.length; ) { - b = BD(mlb(c2), 307); - b.d = this.b; - f2 = nGb(oGb(new pGb(), b), this.d); - this.c[this.b] = f2; - ++this.b; - } - cic(this); - bic(this); - aic(this); - uGb(LGb(this.d), new Zdd()); - for (e = new olb(this.a.a.b); e.a < e.c.c.length; ) { - d = BD(mlb(e), 57); - d.d.c = this.c[d.a.d].e + d.b.a; + switch (valign.value) { + case "top": + yo = ly2; + break; + case "bottom": + yo = ly1; + break; } - }; - _2.b = 0; - mdb(Jne, "NetworkSimplexCompaction", 1663); - bcb(145, 1, { 35: 1, 145: 1 }, hic); - _2.wd = function iic(a) { - return fic(this, BD(a, 145)); - }; - _2.Ib = function jic() { - return gic(this); - }; - mdb(Jne, "VerticalSegment", 145); - bcb(827, 1, {}, sic); - _2.c = 0; - _2.e = 0; - _2.i = 0; - mdb(Kne, "BetweenLayerEdgeTwoNodeCrossingsCounter", 827); - bcb(663, 1, { 663: 1 }, zic); - _2.Ib = function Aic() { - return "AdjacencyList [node=" + this.d + ", adjacencies= " + this.a + "]"; - }; - _2.b = 0; - _2.c = 0; - _2.f = 0; - mdb(Kne, "BetweenLayerEdgeTwoNodeCrossingsCounter/AdjacencyList", 663); - bcb(287, 1, { 35: 1, 287: 1 }, Dic); - _2.wd = function Eic(a) { - return Bic(this, BD(a, 287)); - }; - _2.Ib = function Fic() { - return "Adjacency [position=" + this.c + ", cardinality=" + this.a + ", currentCardinality=" + this.b + "]"; - }; - _2.a = 0; - _2.b = 0; - _2.c = 0; - mdb(Kne, "BetweenLayerEdgeTwoNodeCrossingsCounter/AdjacencyList/Adjacency", 287); - bcb(1929, 1, {}, Iic); - _2.b = 0; - _2.e = false; - mdb(Kne, "CrossingMatrixFiller", 1929); - var qY = odb(Lne, "IInitializable"); - bcb(1804, 1, Mne, Oic); - _2.Nf = function Ric(a, b, c2, d, e, f2) { - }; - _2.Pf = function Tic(a, b, c2) { - }; - _2.Lf = function Pic() { - return this.c != (rGc(), pGc); - }; - _2.Mf = function Qic() { - this.e = KC(WD, oje, 25, this.d, 15, 1); - }; - _2.Of = function Sic(a, b) { - b[a][0].c.p = a; - }; - _2.Qf = function Uic(a, b, c2, d) { - ++this.d; - }; - _2.Rf = function Vic() { - return true; - }; - _2.Sf = function Wic(a, b, c2, d) { - Kic(this, a, b, c2); - return Jic(this, b); - }; - _2.Tf = function Xic(a, b) { - var c2; - c2 = Lic(b, a.length); - Kic(this, a, c2, b); - return Mic(this, c2); - }; - _2.d = 0; - mdb(Kne, "GreedySwitchHeuristic", 1804); - bcb(1930, 1, {}, ejc); - _2.b = 0; - _2.d = 0; - mdb(Kne, "NorthSouthEdgeNeighbouringNodeCrossingsCounter", 1930); - bcb(1917, 1, {}, jjc); - _2.a = false; - mdb(Kne, "SwitchDecider", 1917); - bcb(101, 1, { 101: 1 }, pjc); - _2.a = null; - _2.c = null; - _2.i = null; - mdb(Nne, "SelfHyperLoop", 101); - bcb(1916, 1, {}, vjc); - _2.c = 0; - _2.e = 0; - mdb(Nne, "SelfHyperLoopLabels", 1916); - bcb(411, 22, { 3: 1, 35: 1, 22: 1, 411: 1 }, Bjc); - var wjc, xjc, yjc, zjc; - var mV = ndb(Nne, "SelfHyperLoopLabels/Alignment", 411, CI, Djc, Cjc); - var Ejc; - bcb(409, 1, { 409: 1 }, Gjc); - mdb(Nne, "SelfLoopEdge", 409); - bcb(403, 1, { 403: 1 }, Kjc); - _2.a = false; - mdb(Nne, "SelfLoopHolder", 403); - bcb(1724, 1, Oie, Mjc); - _2.Mb = function Njc(a) { - return OZb(BD(a, 17)); - }; - mdb(Nne, "SelfLoopHolder/lambda$0$Type", 1724); - bcb(113, 1, { 113: 1 }, Pjc); - _2.a = false; - _2.c = false; - mdb(Nne, "SelfLoopPort", 113); - bcb(1792, 1, Oie, Qjc); - _2.Mb = function Rjc(a) { - return OZb(BD(a, 17)); - }; - mdb(Nne, "SelfLoopPort/lambda$0$Type", 1792); - bcb(363, 22, { 3: 1, 35: 1, 22: 1, 363: 1 }, Yjc); - var Sjc, Tjc, Ujc, Vjc, Wjc; - var uV = ndb(Nne, "SelfLoopType", 363, CI, _jc, $jc); - var akc; - bcb(1732, 1, {}, xkc); - var ckc, dkc, ekc, fkc; - mdb(One, "PortRestorer", 1732); - bcb(361, 22, { 3: 1, 35: 1, 22: 1, 361: 1 }, Gkc); - var Ckc, Dkc, Ekc; - var vV = ndb(One, "PortRestorer/PortSideArea", 361, CI, Ikc, Hkc); - var Jkc; - bcb(1733, 1, {}, Lkc); - _2.Kb = function Mkc(a) { - return gkc(), BD(a, 15).Oc(); - }; - mdb(One, "PortRestorer/lambda$0$Type", 1733); - bcb(1734, 1, qie, Nkc); - _2.td = function Okc(a) { - gkc(); - BD(a, 113).c = false; - }; - mdb(One, "PortRestorer/lambda$1$Type", 1734); - bcb(1743, 1, Oie, Pkc); - _2.Mb = function Qkc(a) { - return gkc(), BD(a, 11).j == (Ucd(), Tcd); - }; - mdb(One, "PortRestorer/lambda$10$Type", 1743); - bcb(1744, 1, {}, Rkc); - _2.Kb = function Skc(a) { - return gkc(), BD(a, 113).d; - }; - mdb(One, "PortRestorer/lambda$11$Type", 1744); - bcb(1745, 1, qie, Tkc); - _2.td = function Ukc(a) { - ykc(this.a, BD(a, 11)); - }; - mdb(One, "PortRestorer/lambda$12$Type", 1745); - bcb(1735, 1, qie, Vkc); - _2.td = function Wkc(a) { - zkc(this.a, BD(a, 101)); - }; - mdb(One, "PortRestorer/lambda$2$Type", 1735); - bcb(1736, 1, Dke, Xkc); - _2.ue = function Ykc(a, b) { - return Akc(BD(a, 113), BD(b, 113)); - }; - _2.Fb = function Zkc(a) { - return this === a; - }; - _2.ve = function $kc() { - return new tpb(this); - }; - mdb(One, "PortRestorer/lambda$3$Type", 1736); - bcb(1737, 1, Oie, _kc); - _2.Mb = function alc(a) { - return gkc(), BD(a, 113).c; - }; - mdb(One, "PortRestorer/lambda$4$Type", 1737); - bcb(1738, 1, Oie, blc); - _2.Mb = function clc(a) { - return nkc(BD(a, 11)); - }; - mdb(One, "PortRestorer/lambda$5$Type", 1738); - bcb(1739, 1, Oie, dlc); - _2.Mb = function elc(a) { - return gkc(), BD(a, 11).j == (Ucd(), Acd); - }; - mdb(One, "PortRestorer/lambda$6$Type", 1739); - bcb(1740, 1, Oie, flc); - _2.Mb = function glc(a) { - return gkc(), BD(a, 11).j == (Ucd(), zcd); - }; - mdb(One, "PortRestorer/lambda$7$Type", 1740); - bcb(1741, 1, Oie, hlc); - _2.Mb = function ilc(a) { - return okc(BD(a, 11)); - }; - mdb(One, "PortRestorer/lambda$8$Type", 1741); - bcb(1742, 1, Oie, jlc); - _2.Mb = function klc(a) { - return gkc(), BD(a, 11).j == (Ucd(), Rcd); - }; - mdb(One, "PortRestorer/lambda$9$Type", 1742); - bcb(270, 22, { 3: 1, 35: 1, 22: 1, 270: 1 }, Blc); - var slc, tlc, ulc, vlc, wlc, xlc, ylc, zlc; - var KV = ndb(One, "PortSideAssigner/Target", 270, CI, Dlc, Clc); - var Elc; - bcb(1725, 1, {}, Glc); - _2.Kb = function Hlc(a) { - return JAb(new YAb(null, new Kub(BD(a, 101).j, 16)), new Ylc()); - }; - mdb(One, "PortSideAssigner/lambda$1$Type", 1725); - bcb(1726, 1, {}, Ilc); - _2.Kb = function Jlc(a) { - return BD(a, 113).d; - }; - mdb(One, "PortSideAssigner/lambda$2$Type", 1726); - bcb(1727, 1, qie, Klc); - _2.td = function Llc(a) { - G0b(BD(a, 11), (Ucd(), Acd)); - }; - mdb(One, "PortSideAssigner/lambda$3$Type", 1727); - bcb(1728, 1, {}, Mlc); - _2.Kb = function Nlc(a) { - return BD(a, 113).d; - }; - mdb(One, "PortSideAssigner/lambda$4$Type", 1728); - bcb(1729, 1, qie, Olc); - _2.td = function Plc(a) { - plc(this.a, BD(a, 11)); - }; - mdb(One, "PortSideAssigner/lambda$5$Type", 1729); - bcb(1730, 1, Dke, Qlc); - _2.ue = function Rlc(a, b) { - return qlc(BD(a, 101), BD(b, 101)); - }; - _2.Fb = function Slc(a) { - return this === a; - }; - _2.ve = function Tlc() { - return new tpb(this); - }; - mdb(One, "PortSideAssigner/lambda$6$Type", 1730); - bcb(1731, 1, Dke, Ulc); - _2.ue = function Vlc(a, b) { - return rlc(BD(a, 113), BD(b, 113)); - }; - _2.Fb = function Wlc(a) { - return this === a; - }; - _2.ve = function Xlc() { - return new tpb(this); - }; - mdb(One, "PortSideAssigner/lambda$7$Type", 1731); - bcb(805, 1, Oie, Ylc); - _2.Mb = function Zlc(a) { - return BD(a, 113).c; - }; - mdb(One, "PortSideAssigner/lambda$8$Type", 805); - bcb(2009, 1, {}); - mdb(Pne, "AbstractSelfLoopRouter", 2009); - bcb(1750, 1, Dke, gmc); - _2.ue = function hmc(a, b) { - return emc(BD(a, 101), BD(b, 101)); - }; - _2.Fb = function imc(a) { - return this === a; - }; - _2.ve = function jmc() { - return new tpb(this); - }; - mdb(Pne, rle, 1750); - bcb(1751, 1, Dke, kmc); - _2.ue = function lmc(a, b) { - return fmc(BD(a, 101), BD(b, 101)); - }; - _2.Fb = function mmc(a) { - return this === a; - }; - _2.ve = function nmc() { - return new tpb(this); - }; - mdb(Pne, sle, 1751); - bcb(1793, 2009, {}, zmc); - _2.Uf = function Amc(a, b, c2) { - return c2; - }; - mdb(Pne, "OrthogonalSelfLoopRouter", 1793); - bcb(1795, 1, qie, Bmc); - _2.td = function Cmc(a) { - ymc(this.b, this.a, BD(a, 8)); - }; - mdb(Pne, "OrthogonalSelfLoopRouter/lambda$0$Type", 1795); - bcb(1794, 1793, {}, Fmc); - _2.Uf = function Gmc(a, b, c2) { - var d, e; - d = a.c.d; - St(c2, 0, P6c(R6c(d.n), d.a)); - e = a.d.d; - Dsb(c2, P6c(R6c(e.n), e.a)); - return Dmc(c2); - }; - mdb(Pne, "PolylineSelfLoopRouter", 1794); - bcb(1746, 1, {}, Umc); - _2.a = null; - var Hmc; - mdb(Pne, "RoutingDirector", 1746); - bcb(1747, 1, Dke, Wmc); - _2.ue = function Xmc(a, b) { - return Vmc(BD(a, 113), BD(b, 113)); - }; - _2.Fb = function Ymc(a) { - return this === a; - }; - _2.ve = function Zmc() { - return new tpb(this); - }; - mdb(Pne, "RoutingDirector/lambda$0$Type", 1747); - bcb(1748, 1, {}, $mc); - _2.Kb = function _mc(a) { - return Imc(), BD(a, 101).j; - }; - mdb(Pne, "RoutingDirector/lambda$1$Type", 1748); - bcb(1749, 1, qie, anc); - _2.td = function bnc(a) { - Imc(); - BD(a, 15).ad(Hmc); - }; - mdb(Pne, "RoutingDirector/lambda$2$Type", 1749); - bcb(1752, 1, {}, mnc); - mdb(Pne, "RoutingSlotAssigner", 1752); - bcb(1753, 1, Oie, pnc); - _2.Mb = function qnc(a) { - return nnc(this.a, BD(a, 101)); - }; - mdb(Pne, "RoutingSlotAssigner/lambda$0$Type", 1753); - bcb(1754, 1, Dke, rnc); - _2.ue = function snc(a, b) { - return onc(this.a, BD(a, 101), BD(b, 101)); - }; - _2.Fb = function tnc(a) { - return this === a; - }; - _2.ve = function unc() { - return new tpb(this); - }; - mdb(Pne, "RoutingSlotAssigner/lambda$1$Type", 1754); - bcb(1796, 1793, {}, wnc); - _2.Uf = function xnc(a, b, c2) { - var d, e, f2, g; - d = Edb(ED(c_b(a.b.g.b, (Nyc(), nyc)))); - g = new u7c(OC(GC(m1, 1), nie, 8, 0, [(f2 = a.c.d, P6c(new g7c(f2.n), f2.a))])); - vnc(a, b, c2, g, d); - Dsb(g, (e = a.d.d, P6c(new g7c(e.n), e.a))); - return UPc(new YPc(g)); - }; - mdb(Pne, "SplineSelfLoopRouter", 1796); - bcb(578, 1, Dke, Bnc, Dnc); - _2.ue = function Enc(a, b) { - return ync(this, BD(a, 10), BD(b, 10)); - }; - _2.Fb = function Fnc(a) { - return this === a; - }; - _2.ve = function Gnc() { - return new tpb(this); - }; - mdb(Qne, "ModelOrderNodeComparator", 578); - bcb(1755, 1, Oie, Hnc); - _2.Mb = function Inc(a) { - return BD(a, 11).e.c.length != 0; - }; - mdb(Qne, "ModelOrderNodeComparator/lambda$0$Type", 1755); - bcb(1756, 1, {}, Jnc); - _2.Kb = function Knc(a) { - return BD(Ikb(BD(a, 11).e, 0), 17).c; - }; - mdb(Qne, "ModelOrderNodeComparator/lambda$1$Type", 1756); - bcb(1757, 1, Oie, Lnc); - _2.Mb = function Mnc(a) { - return BD(a, 11).e.c.length != 0; - }; - mdb(Qne, "ModelOrderNodeComparator/lambda$2$Type", 1757); - bcb(1758, 1, {}, Nnc); - _2.Kb = function Onc(a) { - return BD(Ikb(BD(a, 11).e, 0), 17).c; - }; - mdb(Qne, "ModelOrderNodeComparator/lambda$3$Type", 1758); - bcb(1759, 1, Oie, Pnc); - _2.Mb = function Qnc(a) { - return BD(a, 11).e.c.length != 0; - }; - mdb(Qne, "ModelOrderNodeComparator/lambda$4$Type", 1759); - bcb(806, 1, Dke, Tnc, Unc); - _2.ue = function Vnc(a, b) { - return Rnc(this, a, b); - }; - _2.Fb = function Wnc(a) { - return this === a; - }; - _2.ve = function Xnc() { - return new tpb(this); - }; - mdb(Qne, "ModelOrderPortComparator", 806); - bcb(801, 1, {}, Ync); - _2.Vf = function $nc(a, b) { - var c2, d, e, f2; - e = Znc(b); - c2 = new Rkb(); - f2 = b.f / e; - for (d = 1; d < e; ++d) { - Ekb(c2, meb(Tbb(Cbb($wnd.Math.round(d * f2))))); - } - return c2; - }; - _2.Wf = function _nc() { - return false; - }; - mdb(Rne, "ARDCutIndexHeuristic", 801); - bcb(1479, 1, ene, eoc); - _2.pf = function foc(a, b) { - doc(BD(a, 37), b); - }; - mdb(Rne, "BreakingPointInserter", 1479); - bcb(305, 1, { 305: 1 }, goc); - _2.Ib = function joc() { - var a; - a = new Ufb(); - a.a += "BPInfo["; - a.a += "\n start="; - Pfb(a, this.i); - a.a += "\n end="; - Pfb(a, this.a); - a.a += "\n nodeStartEdge="; - Pfb(a, this.e); - a.a += "\n startEndEdge="; - Pfb(a, this.j); - a.a += "\n originalEdge="; - Pfb(a, this.f); - a.a += "\n startInLayerDummy="; - Pfb(a, this.k); - a.a += "\n startInLayerEdge="; - Pfb(a, this.n); - a.a += "\n endInLayerDummy="; - Pfb(a, this.b); - a.a += "\n endInLayerEdge="; - Pfb(a, this.c); - return a.a; - }; - mdb(Rne, "BreakingPointInserter/BPInfo", 305); - bcb(652, 1, { 652: 1 }, qoc); - _2.a = false; - _2.b = 0; - _2.c = 0; - mdb(Rne, "BreakingPointInserter/Cut", 652); - bcb(1480, 1, ene, Aoc); - _2.pf = function Boc(a, b) { - yoc(BD(a, 37), b); - }; - mdb(Rne, "BreakingPointProcessor", 1480); - bcb(1481, 1, Oie, Coc); - _2.Mb = function Doc(a) { - return hoc(BD(a, 10)); - }; - mdb(Rne, "BreakingPointProcessor/0methodref$isEnd$Type", 1481); - bcb(1482, 1, Oie, Eoc); - _2.Mb = function Foc(a) { - return ioc(BD(a, 10)); - }; - mdb(Rne, "BreakingPointProcessor/1methodref$isStart$Type", 1482); - bcb(1483, 1, ene, Joc); - _2.pf = function Koc(a, b) { - Hoc(this, BD(a, 37), b); - }; - mdb(Rne, "BreakingPointRemover", 1483); - bcb(1484, 1, qie, Loc); - _2.td = function Moc(a) { - BD(a, 128).k = true; - }; - mdb(Rne, "BreakingPointRemover/lambda$0$Type", 1484); - bcb(797, 1, {}, Xoc); - _2.b = 0; - _2.e = 0; - _2.f = 0; - _2.j = 0; - mdb(Rne, "GraphStats", 797); - bcb(798, 1, {}, Zoc); - _2.Ce = function $oc(a, b) { - return $wnd.Math.max(Edb(ED(a)), Edb(ED(b))); - }; - mdb(Rne, "GraphStats/0methodref$max$Type", 798); - bcb(799, 1, {}, _oc); - _2.Ce = function apc(a, b) { - return $wnd.Math.max(Edb(ED(a)), Edb(ED(b))); - }; - mdb(Rne, "GraphStats/2methodref$max$Type", 799); - bcb(1660, 1, {}, bpc); - _2.Ce = function cpc(a, b) { - return Yoc(ED(a), ED(b)); - }; - mdb(Rne, "GraphStats/lambda$1$Type", 1660); - bcb(1661, 1, {}, dpc); - _2.Kb = function epc(a) { - return Roc(this.a, BD(a, 29)); - }; - mdb(Rne, "GraphStats/lambda$2$Type", 1661); - bcb(1662, 1, {}, fpc); - _2.Kb = function gpc(a) { - return Qoc(this.a, BD(a, 29)); - }; - mdb(Rne, "GraphStats/lambda$6$Type", 1662); - bcb(800, 1, {}, hpc); - _2.Vf = function ipc(a, b) { - var c2; - c2 = BD(vNb(a, (Nyc(), Eyc)), 15); - return c2 ? c2 : (mmb(), mmb(), jmb); - }; - _2.Wf = function jpc() { - return false; - }; - mdb(Rne, "ICutIndexCalculator/ManualCutIndexCalculator", 800); - bcb(802, 1, {}, kpc); - _2.Vf = function lpc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2; - u2 = (b.n == null && Uoc(b), b.n); - i3 = (b.d == null && Uoc(b), b.d); - t4 = KC(UD, Vje, 25, u2.length, 15, 1); - t4[0] = u2[0]; - r = u2[0]; - for (j = 1; j < u2.length; j++) { - t4[j] = t4[j - 1] + u2[j]; - r += u2[j]; - } - e = Znc(b) - 1; - g = BD(vNb(a, (Nyc(), Fyc)), 19).a; - d = Qje; - c2 = new Rkb(); - 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 Rkb(); - s = Qje; - l = 0; - h = 0; - o2 = i3[0]; - if (m == 0) { - s = r; - h = (b.g == null && (b.g = Poc(b, new _oc())), Edb(b.g)); - } else { - while (k < b.f) { - if (t4[k - 1] - q >= p) { - Ekb(f2, meb(k)); - s = $wnd.Math.max(s, t4[k - 1] - l); - h += o2; - q += t4[k - 1] - q; - l = t4[k - 1]; - o2 = i3[k]; - } - o2 = $wnd.Math.max(o2, i3[k]); - ++k; - } - h += o2; - } - n = $wnd.Math.min(1 / s, 1 / b.b / h); - if (n > d) { - d = n; - c2 = f2; - } - } - return c2; - }; - _2.Wf = function mpc() { - return false; - }; - mdb(Rne, "MSDCutIndexHeuristic", 802); - bcb(1617, 1, ene, ppc); - _2.pf = function qpc(a, b) { - opc(BD(a, 37), b); - }; - mdb(Rne, "SingleEdgeGraphWrapper", 1617); - bcb(227, 22, { 3: 1, 35: 1, 22: 1, 227: 1 }, Bpc); - var upc, vpc, wpc, xpc, ypc, zpc; - var EW = ndb(Sne, "CenterEdgeLabelPlacementStrategy", 227, CI, Dpc, Cpc); - var Epc; - bcb(422, 22, { 3: 1, 35: 1, 22: 1, 422: 1 }, Jpc); - var Gpc, Hpc; - var FW = ndb(Sne, "ConstraintCalculationStrategy", 422, CI, Lpc, Kpc); - var Mpc; - bcb(314, 22, { 3: 1, 35: 1, 22: 1, 314: 1, 246: 1, 234: 1 }, Tpc); - _2.Kf = function Vpc() { - return Spc(this); - }; - _2.Xf = function Upc() { - return Spc(this); - }; - var Opc, Ppc, Qpc; - var GW = ndb(Sne, "CrossingMinimizationStrategy", 314, CI, Xpc, Wpc); - var Ypc; - bcb(337, 22, { 3: 1, 35: 1, 22: 1, 337: 1 }, cqc); - var $pc, _pc, aqc; - var HW = ndb(Sne, "CuttingStrategy", 337, CI, eqc, dqc); - var fqc; - bcb(335, 22, { 3: 1, 35: 1, 22: 1, 335: 1, 246: 1, 234: 1 }, oqc); - _2.Kf = function qqc() { - return nqc(this); - }; - _2.Xf = function pqc() { - return nqc(this); - }; - var hqc, iqc, jqc, kqc, lqc; - var IW = ndb(Sne, "CycleBreakingStrategy", 335, CI, sqc, rqc); - var tqc; - bcb(419, 22, { 3: 1, 35: 1, 22: 1, 419: 1 }, yqc); - var vqc, wqc; - var JW = ndb(Sne, "DirectionCongruency", 419, CI, Aqc, zqc); - var Bqc; - bcb(450, 22, { 3: 1, 35: 1, 22: 1, 450: 1 }, Hqc); - var Dqc, Eqc, Fqc; - var KW = ndb(Sne, "EdgeConstraint", 450, CI, Jqc, Iqc); - var Kqc; - bcb(276, 22, { 3: 1, 35: 1, 22: 1, 276: 1 }, Uqc); - var Mqc, Nqc, Oqc, Pqc, Qqc, Rqc; - var LW = ndb(Sne, "EdgeLabelSideSelection", 276, CI, Wqc, Vqc); - var Xqc; - bcb(479, 22, { 3: 1, 35: 1, 22: 1, 479: 1 }, arc); - var Zqc, $qc; - var MW = ndb(Sne, "EdgeStraighteningStrategy", 479, CI, crc, brc); - var drc; - bcb(274, 22, { 3: 1, 35: 1, 22: 1, 274: 1 }, mrc); - var frc, grc, hrc, irc, jrc, krc; - var NW = ndb(Sne, "FixedAlignment", 274, CI, orc, nrc); - var prc; - bcb(275, 22, { 3: 1, 35: 1, 22: 1, 275: 1 }, zrc); - var rrc, trc, urc, vrc, wrc, xrc; - var OW = ndb(Sne, "GraphCompactionStrategy", 275, CI, Brc, Arc); - var Crc; - bcb(256, 22, { 3: 1, 35: 1, 22: 1, 256: 1 }, Prc); - var Erc, Frc, Grc, Hrc, Irc, Jrc, Krc, Lrc, Mrc, Nrc; - var PW = ndb(Sne, "GraphProperties", 256, CI, Rrc, Qrc); - var Src; - bcb(292, 22, { 3: 1, 35: 1, 22: 1, 292: 1 }, Yrc); - var Urc, Vrc, Wrc; - var QW = ndb(Sne, "GreedySwitchType", 292, CI, $rc, Zrc); - var _rc; - bcb(303, 22, { 3: 1, 35: 1, 22: 1, 303: 1 }, fsc); - var bsc, csc, dsc; - var RW = ndb(Sne, "InLayerConstraint", 303, CI, hsc, gsc); - var isc; - bcb(420, 22, { 3: 1, 35: 1, 22: 1, 420: 1 }, nsc); - var ksc, lsc; - var SW = ndb(Sne, "InteractiveReferencePoint", 420, CI, psc, osc); - var qsc; - var ssc, tsc, usc, vsc, wsc, xsc, ysc, zsc, Asc, Bsc, Csc, Dsc, Esc, Fsc, Gsc, Hsc, Isc, Jsc, Ksc, Lsc, Msc, Nsc, Osc, Psc, Qsc, Rsc, Ssc, Tsc, Usc, Vsc, Wsc, Xsc, Ysc, Zsc, $sc, _sc, atc, btc, ctc, dtc, etc, ftc, gtc, htc, itc, jtc, ktc, ltc, mtc, ntc, otc, ptc, qtc, rtc, stc, ttc, utc, vtc; - bcb(163, 22, { 3: 1, 35: 1, 22: 1, 163: 1 }, Dtc); - var xtc, ytc, ztc, Atc, Btc; - var TW = ndb(Sne, "LayerConstraint", 163, CI, Ftc, Etc); - var Gtc; - bcb(848, 1, ale, kwc); - _2.Qe = function lwc(a) { - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Yne), ""), "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."), puc), (_5c(), V5c)), JW), pqb((N5c(), L5c))))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Zne), ""), "Feedback Edges"), "Whether feedback edges should be highlighted by routing around the nodes."), (Bcb(), false)), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), $ne), ""), "Interactive Reference Point"), "Determines which point of a node is considered by interactive layout phases."), Muc), V5c), SW), pqb(L5c)))); - o4c(a, $ne, goe, Ouc); - o4c(a, $ne, qoe, Nuc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), _ne), ""), "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), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), aoe), ""), "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), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(C5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), boe), ""), "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), T5c), wI), pqb(M5c)), OC(GC(ZI, 1), nie, 2, 6, ["org.eclipse.elk.layered.northOrSouthPort"])))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), coe), ""), "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."), xvc), V5c), cX), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), doe), ""), "Thoroughness"), "How much effort should be spent to produce a nice layout."), meb(7)), X5c), JI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), eoe), ""), "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), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), foe), ""), "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), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), goe), "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)."), nuc), V5c), IW), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), hoe), ppe), "Node Layering Strategy"), "Strategy for node layering."), bvc), V5c), YW), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), ioe), ppe), "Layer Constraint"), "Determines a constraint on the placement of the node regarding the layering."), Tuc), V5c), TW), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), joe), ppe), "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."), meb(-1)), X5c), JI), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), koe), ppe), "Layer ID"), "Layer identifier that was calculated by ELK Layered for a node. This is only generated if interactiveLayot or generatePositionAndLayerIds is set."), meb(-1)), X5c), JI), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), loe), qpe), "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."), meb(4)), X5c), JI), pqb(L5c)))); - o4c(a, loe, hoe, Wuc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), moe), qpe), "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."), meb(2)), X5c), JI), pqb(L5c)))); - o4c(a, moe, hoe, Yuc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), noe), rpe), "Node Promotion Strategy"), "Reduces number of dummy nodes after layering phase (if possible)."), _uc), V5c), aX), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), ooe), rpe), "Max Node Promotion Iterations"), "Limits the number of iterations for node promotion."), meb(0)), X5c), JI), pqb(L5c)))); - o4c(a, ooe, noe, null); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), poe), "layering.coffmanGraham"), "Layer Bound"), "The maximum number of nodes allowed per layer."), meb(Ohe)), X5c), JI), pqb(L5c)))); - o4c(a, poe, hoe, Quc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), qoe), spe), "Crossing Minimization Strategy"), "Strategy for crossing minimization."), luc), V5c), GW), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), roe), spe), "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), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), soe), spe), "Hierarchical Sweepiness"), "How likely it is to use cross-hierarchy (1) vs bottom-up (-1)."), 0.1), U5c), BI), pqb(L5c)))); - o4c(a, soe, tpe, fuc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), toe), spe), "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), T5c), wI), pqb(L5c)))); - o4c(a, toe, qoe, juc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), uoe), spe), "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."), meb(-1)), X5c), JI), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), voe), spe), "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."), meb(-1)), X5c), JI), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), woe), upe), "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."), meb(40)), X5c), JI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), xoe), upe), "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."), cuc), V5c), QW), pqb(L5c)))); - o4c(a, xoe, qoe, duc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), yoe), "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."), $tc), V5c), QW), pqb(L5c)))); - o4c(a, yoe, qoe, _tc); - o4c(a, yoe, tpe, auc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), zoe), vpe), "Node Placement Strategy"), "Strategy for node placement."), vvc), V5c), _W), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), Aoe), vpe), "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."), T5c), wI), pqb(L5c)))); - o4c(a, Aoe, zoe, lvc); - o4c(a, Aoe, zoe, mvc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Boe), wpe), "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."), fvc), V5c), MW), pqb(L5c)))); - o4c(a, Boe, zoe, gvc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Coe), wpe), "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."), ivc), V5c), NW), pqb(L5c)))); - o4c(a, Coe, zoe, jvc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Doe), "nodePlacement.linearSegments"), "Linear Segments Deflection Dampening"), "Dampens the movement of nodes to keep the diagram from getting too large."), 0.3), U5c), BI), pqb(L5c)))); - o4c(a, Doe, zoe, ovc); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), Eoe), "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."), V5c), $W), pqb(K5c)))); - o4c(a, Eoe, zoe, tvc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Foe), "nodePlacement.networkSimplex.nodeFlexibility"), "Node Flexibility Default"), "Default value of the 'nodeFlexibility' option for the children of a hierarchical node."), rvc), V5c), $W), pqb(L5c)))); - o4c(a, Foe, zoe, svc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Goe), xpe), "Self-Loop Distribution"), "Alter the distribution of the loops around the node. It only takes effect for PortConstraints.FREE."), xuc), V5c), eX), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Hoe), xpe), "Self-Loop Ordering"), "Alter the ordering of the loops they can either be stacked or sequenced. It only takes effect for PortConstraints.FREE."), zuc), V5c), fX), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Ioe), "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."), Buc), V5c), hX), pqb(L5c)))); - o4c(a, Ioe, ype, Cuc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Joe), "edgeRouting.splines.sloppy"), "Sloppy Spline Layer Spacing Factor"), "Spacing factor for routing area between layers when using sloppy spline routing."), 0.2), U5c), BI), pqb(L5c)))); - o4c(a, Joe, ype, Euc); - o4c(a, Joe, Ioe, Fuc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Koe), "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), U5c), BI), pqb(L5c)))); - o4c(a, Koe, ype, vuc); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), Loe), zpe), "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."), U5c), BI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Moe), zpe), "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), U5c), BI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Noe), zpe), "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), U5c), BI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Ooe), zpe), "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), U5c), BI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Poe), Ape), "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."), meb(0)), X5c), JI), pqb(I5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Qoe), Ape), "Shortness Priority"), "Defines how important it is to keep an edge as short as possible. This option is evaluated during the layering phase."), meb(0)), X5c), JI), pqb(I5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Roe), Ape), "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."), meb(0)), X5c), JI), pqb(I5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Soe), Bpe), Ole), "Tries to further compact components (disconnected sub-graphs)."), false), T5c), wI), pqb(L5c)))); - o4c(a, Soe, zme, true); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Toe), Cpe), "Post Compaction Strategy"), Dpe), Ntc), V5c), OW), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Uoe), Cpe), "Post Compaction Constraint Calculation"), Dpe), Ltc), V5c), FW), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Voe), Epe), "High Degree Node Treatment"), "Makes room around high degree nodes to place leafs and trees."), false), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Woe), Epe), "High Degree Node Threshold"), "Whether a node is considered to have a high degree."), meb(16)), X5c), JI), pqb(L5c)))); - o4c(a, Woe, Voe, true); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Xoe), Epe), "High Degree Node Maximum Tree Height"), "Maximum height of a subtree connected to a high degree node to be moved to separate layers."), meb(5)), X5c), JI), pqb(L5c)))); - o4c(a, Xoe, Voe, true); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Yoe), Fpe), "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'."), bwc), V5c), jX), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Zoe), Fpe), "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), U5c), BI), pqb(L5c)))); - o4c(a, Zoe, Yoe, Ivc); - o4c(a, Zoe, Yoe, Jvc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), $oe), Fpe), "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), U5c), BI), pqb(L5c)))); - o4c(a, $oe, Yoe, Lvc); - o4c(a, $oe, Yoe, Mvc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), _oe), Gpe), "Cutting Strategy"), "The strategy by which the layer indexes are determined at which the layering crumbles into chunks."), Tvc), V5c), HW), pqb(L5c)))); - o4c(a, _oe, Yoe, Uvc); - o4c(a, _oe, Yoe, Vvc); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), ape), Gpe), "Manually Specified Cuts"), "Allows the user to specify her own cuts for a certain graph."), Y5c), yK), pqb(L5c)))); - o4c(a, ape, _oe, Ovc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), bpe), "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."), Qvc), X5c), JI), pqb(L5c)))); - o4c(a, bpe, _oe, Rvc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), cpe), Hpe), "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."), gwc), V5c), iX), pqb(L5c)))); - o4c(a, cpe, Yoe, hwc); - o4c(a, cpe, Yoe, iwc); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), dpe), Hpe), "Valid Indices for Wrapping"), null), Y5c), yK), pqb(L5c)))); - o4c(a, dpe, Yoe, dwc); - o4c(a, dpe, Yoe, ewc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), epe), Ipe), "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), T5c), wI), pqb(L5c)))); - o4c(a, epe, Yoe, Zvc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), fpe), Ipe), "Distance Penalty When Improving Cuts"), null), 2), U5c), BI), pqb(L5c)))); - o4c(a, fpe, Yoe, Xvc); - o4c(a, fpe, epe, true); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), gpe), Ipe), "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), T5c), wI), pqb(L5c)))); - o4c(a, gpe, Yoe, _vc); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), hpe), Jpe), "Edge Label Side Selection"), "Method to decide on edge label sides."), tuc), V5c), LW), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), ipe), Jpe), "Edge Center Label Placement Strategy"), "Determines in which layer center labels of long edges should be placed."), ruc), V5c), EW), qqb(L5c, OC(GC(e1, 1), Kie, 175, 0, [J5c]))))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), jpe), Kpe), "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."), Wtc), V5c), bX), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), kpe), Kpe), "No Model Order"), "Set on a node to not set a model order for this node even though it is a real node."), false), T5c), wI), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), lpe), Kpe), "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."), Ptc), V5c), hQ), pqb(L5c)))); - o4c(a, lpe, zme, null); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), mpe), Kpe), "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."), Ttc), V5c), ZW), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), npe), Kpe), "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), U5c), BI), pqb(L5c)))); - o4c(a, npe, jpe, null); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), ope), Kpe), "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), U5c), BI), pqb(L5c)))); - o4c(a, ope, jpe, null); - Oyc((new Pyc(), a)); - }; - var Itc, Jtc, Ktc, Ltc, Mtc, Ntc, Otc, Ptc, Qtc, Rtc, Stc, Ttc, Utc, Vtc, Wtc, Xtc, Ytc, Ztc, $tc, _tc, auc, buc, cuc, duc, euc, fuc, guc, huc, iuc, juc, kuc, luc, muc, nuc, ouc, puc, quc, ruc, suc, tuc, uuc, vuc, wuc, xuc, yuc, zuc, Auc, Buc, Cuc, Duc, Euc, Fuc, Guc, Huc, Iuc, Juc, Kuc, Luc, Muc, Nuc, Ouc, Puc, Quc, Ruc, Suc, Tuc, Uuc, Vuc, Wuc, Xuc, Yuc, Zuc, $uc, _uc, avc, bvc, cvc, dvc, evc, fvc, gvc, hvc, ivc, jvc, kvc, lvc, mvc, nvc, ovc, pvc, qvc, rvc, svc, tvc, uvc, vvc, wvc, xvc, yvc, zvc, Avc, Bvc, Cvc, Dvc, Evc, Fvc, Gvc, Hvc, Ivc, Jvc, Kvc, Lvc, Mvc, Nvc, Ovc, Pvc, Qvc, Rvc, Svc, Tvc, Uvc, Vvc, Wvc, Xvc, Yvc, Zvc, $vc, _vc, awc, bwc, cwc, dwc, ewc, fwc, gwc, hwc, iwc; - mdb(Sne, "LayeredMetaDataProvider", 848); - bcb(986, 1, ale, Pyc); - _2.Qe = function Qyc(a) { - Oyc(a); - }; - var 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, Ywc, Zwc, $wc, _wc, 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, 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; - mdb(Sne, "LayeredOptions", 986); - bcb(987, 1, {}, Ryc); - _2.$e = function Syc() { - var a; - return a = new jUb(), a; - }; - _2._e = function Tyc(a) { - }; - mdb(Sne, "LayeredOptions/LayeredFactory", 987); - bcb(1372, 1, {}); - _2.a = 0; - var Uyc; - mdb(yqe, "ElkSpacings/AbstractSpacingsBuilder", 1372); - bcb(779, 1372, {}, ezc); - var bzc, czc; - mdb(Sne, "LayeredSpacings/LayeredSpacingsBuilder", 779); - bcb(313, 22, { 3: 1, 35: 1, 22: 1, 313: 1, 246: 1, 234: 1 }, nzc); - _2.Kf = function pzc() { - return mzc(this); - }; - _2.Xf = function ozc() { - return mzc(this); - }; - var fzc, gzc, hzc, izc, jzc, kzc; - var YW = ndb(Sne, "LayeringStrategy", 313, CI, rzc, qzc); - var szc; - bcb(378, 22, { 3: 1, 35: 1, 22: 1, 378: 1 }, zzc); - var uzc, vzc, wzc; - var ZW = ndb(Sne, "LongEdgeOrderingStrategy", 378, CI, Bzc, Azc); - var Czc; - bcb(197, 22, { 3: 1, 35: 1, 22: 1, 197: 1 }, Kzc); - var Ezc, Fzc, Gzc, Hzc; - var $W = ndb(Sne, "NodeFlexibility", 197, CI, Nzc, Mzc); - var Ozc; - bcb(315, 22, { 3: 1, 35: 1, 22: 1, 315: 1, 246: 1, 234: 1 }, Xzc); - _2.Kf = function Zzc() { - return Wzc(this); - }; - _2.Xf = function Yzc() { - return Wzc(this); - }; - var Qzc, Rzc, Szc, Tzc, Uzc; - var _W = ndb(Sne, "NodePlacementStrategy", 315, CI, _zc, $zc); - var aAc; - bcb(260, 22, { 3: 1, 35: 1, 22: 1, 260: 1 }, lAc); - var cAc, dAc, eAc, fAc, gAc, hAc, iAc, jAc; - var aX = ndb(Sne, "NodePromotionStrategy", 260, CI, nAc, mAc); - var oAc; - bcb(339, 22, { 3: 1, 35: 1, 22: 1, 339: 1 }, uAc); - var qAc, rAc, sAc; - var bX = ndb(Sne, "OrderingStrategy", 339, CI, wAc, vAc); - var xAc; - bcb(421, 22, { 3: 1, 35: 1, 22: 1, 421: 1 }, CAc); - var zAc, AAc; - var cX = ndb(Sne, "PortSortingStrategy", 421, CI, EAc, DAc); - var FAc; - bcb(452, 22, { 3: 1, 35: 1, 22: 1, 452: 1 }, LAc); - var HAc, IAc, JAc; - var dX = ndb(Sne, "PortType", 452, CI, NAc, MAc); - var OAc; - bcb(375, 22, { 3: 1, 35: 1, 22: 1, 375: 1 }, UAc); - var QAc, RAc, SAc; - var eX = ndb(Sne, "SelfLoopDistributionStrategy", 375, CI, WAc, VAc); - var XAc; - bcb(376, 22, { 3: 1, 35: 1, 22: 1, 376: 1 }, aBc); - var ZAc, $Ac; - var fX = ndb(Sne, "SelfLoopOrderingStrategy", 376, CI, cBc, bBc); - var dBc; - bcb(304, 1, { 304: 1 }, oBc); - mdb(Sne, "Spacings", 304); - bcb(336, 22, { 3: 1, 35: 1, 22: 1, 336: 1 }, uBc); - var qBc, rBc, sBc; - var hX = ndb(Sne, "SplineRoutingMode", 336, CI, wBc, vBc); - var xBc; - bcb(338, 22, { 3: 1, 35: 1, 22: 1, 338: 1 }, DBc); - var zBc, ABc, BBc; - var iX = ndb(Sne, "ValidifyStrategy", 338, CI, FBc, EBc); - var GBc; - bcb(377, 22, { 3: 1, 35: 1, 22: 1, 377: 1 }, MBc); - var IBc, JBc, KBc; - var jX = ndb(Sne, "WrappingStrategy", 377, CI, OBc, NBc); - var PBc; - bcb(1383, 1, Bqe, VBc); - _2.Yf = function WBc(a) { - return BD(a, 37), RBc; - }; - _2.pf = function XBc(a, b) { - UBc(this, BD(a, 37), b); - }; - var RBc; - mdb(Cqe, "DepthFirstCycleBreaker", 1383); - bcb(782, 1, Bqe, aCc); - _2.Yf = function cCc(a) { - return BD(a, 37), YBc; - }; - _2.pf = function dCc(a, b) { - $Bc(this, BD(a, 37), b); - }; - _2.Zf = function bCc(a) { - return BD(Ikb(a, Bub(this.d, a.c.length)), 10); - }; - var YBc; - mdb(Cqe, "GreedyCycleBreaker", 782); - bcb(1386, 782, Bqe, eCc); - _2.Zf = function fCc(a) { - var b, c2, d, e; - e = null; - b = Ohe; - for (d = new olb(a); d.a < d.c.c.length; ) { - c2 = BD(mlb(d), 10); - if (wNb(c2, (wtc(), Zsc)) && BD(vNb(c2, Zsc), 19).a < b) { - b = BD(vNb(c2, Zsc), 19).a; - e = c2; - } - } - if (!e) { - return BD(Ikb(a, Bub(this.d, a.c.length)), 10); - } - return e; - }; - mdb(Cqe, "GreedyModelOrderCycleBreaker", 1386); - bcb(1384, 1, Bqe, kCc); - _2.Yf = function lCc(a) { - return BD(a, 37), gCc; - }; - _2.pf = function mCc(a, b) { - jCc(this, BD(a, 37), b); - }; - var gCc; - mdb(Cqe, "InteractiveCycleBreaker", 1384); - bcb(1385, 1, Bqe, rCc); - _2.Yf = function sCc(a) { - return BD(a, 37), nCc; - }; - _2.pf = function tCc(a, b) { - qCc(this, BD(a, 37), b); - }; - _2.a = 0; - _2.b = 0; - var nCc; - mdb(Cqe, "ModelOrderCycleBreaker", 1385); - bcb(1389, 1, Bqe, DCc); - _2.Yf = function ECc(a) { - return BD(a, 37), uCc; - }; - _2.pf = function FCc(a, b) { - BCc(this, BD(a, 37), b); - }; - var uCc; - mdb(Dqe, "CoffmanGrahamLayerer", 1389); - bcb(1390, 1, Dke, GCc); - _2.ue = function HCc(a, b) { - return xCc(this.a, BD(a, 10), BD(b, 10)); - }; - _2.Fb = function ICc(a) { - return this === a; - }; - _2.ve = function JCc() { - return new tpb(this); - }; - mdb(Dqe, "CoffmanGrahamLayerer/0methodref$compareNodesInTopo$Type", 1390); - bcb(1391, 1, Dke, KCc); - _2.ue = function LCc(a, b) { - return ACc(this.a, BD(a, 10), BD(b, 10)); - }; - _2.Fb = function MCc(a) { - return this === a; - }; - _2.ve = function NCc() { - return new tpb(this); - }; - mdb(Dqe, "CoffmanGrahamLayerer/lambda$1$Type", 1391); - bcb(1392, 1, Bqe, QCc); - _2.Yf = function RCc(a) { - return BD(a, 37), e3c(e3c(e3c(new j3c(), (qUb(), lUb), (S8b(), n8b)), mUb, w8b), nUb, v8b); - }; - _2.pf = function SCc(a, b) { - PCc(this, BD(a, 37), b); - }; - mdb(Dqe, "InteractiveLayerer", 1392); - bcb(569, 1, { 569: 1 }, TCc); - _2.a = 0; - _2.c = 0; - mdb(Dqe, "InteractiveLayerer/LayerSpan", 569); - bcb(1388, 1, Bqe, ZCc); - _2.Yf = function $Cc(a) { - return BD(a, 37), UCc; - }; - _2.pf = function _Cc(a, b) { - WCc(this, BD(a, 37), b); - }; - var UCc; - mdb(Dqe, "LongestPathLayerer", 1388); - bcb(1395, 1, Bqe, iDc); - _2.Yf = function jDc(a) { - return BD(a, 37), e3c(e3c(e3c(new j3c(), (qUb(), lUb), (S8b(), Z7b)), mUb, w8b), nUb, v8b); - }; - _2.pf = function kDc(a, b) { - gDc(this, BD(a, 37), b); - }; - _2.a = 0; - _2.b = 0; - _2.d = 0; - var aDc, bDc; - mdb(Dqe, "MinWidthLayerer", 1395); - bcb(1396, 1, Dke, mDc); - _2.ue = function nDc(a, b) { - return lDc(this, BD(a, 10), BD(b, 10)); - }; - _2.Fb = function oDc(a) { - return this === a; - }; - _2.ve = function pDc() { - return new tpb(this); - }; - mdb(Dqe, "MinWidthLayerer/MinOutgoingEdgesComparator", 1396); - bcb(1387, 1, Bqe, xDc); - _2.Yf = function yDc(a) { - return BD(a, 37), qDc; - }; - _2.pf = function zDc(a, b) { - wDc(this, BD(a, 37), b); - }; - var qDc; - mdb(Dqe, "NetworkSimplexLayerer", 1387); - bcb(1393, 1, Bqe, LDc); - _2.Yf = function MDc(a) { - return BD(a, 37), e3c(e3c(e3c(new j3c(), (qUb(), lUb), (S8b(), Z7b)), mUb, w8b), nUb, v8b); - }; - _2.pf = function NDc(a, b) { - IDc(this, BD(a, 37), b); - }; - _2.d = 0; - _2.f = 0; - _2.g = 0; - _2.i = 0; - _2.s = 0; - _2.t = 0; - _2.u = 0; - mdb(Dqe, "StretchWidthLayerer", 1393); - bcb(1394, 1, Dke, PDc); - _2.ue = function QDc(a, b) { - return ODc(BD(a, 10), BD(b, 10)); - }; - _2.Fb = function RDc(a) { - return this === a; - }; - _2.ve = function SDc() { - return new tpb(this); - }; - mdb(Dqe, "StretchWidthLayerer/1", 1394); - bcb(402, 1, Eqe); - _2.Nf = function fEc(a, b, c2, d, e, f2) { - }; - _2._f = function dEc(a, b, c2) { - return YDc(this, a, b, c2); - }; - _2.Mf = function eEc() { - this.g = KC(VD, Fqe, 25, this.d, 15, 1); - this.f = KC(VD, Fqe, 25, this.d, 15, 1); - }; - _2.Of = function gEc(a, b) { - this.e[a] = KC(WD, oje, 25, b[a].length, 15, 1); - }; - _2.Pf = function hEc(a, b, c2) { - var d; - d = c2[a][b]; - d.p = b; - this.e[a][b] = b; - }; - _2.Qf = function iEc(a, b, c2, d) { - BD(Ikb(d[a][b].j, c2), 11).p = this.d++; - }; - _2.b = 0; - _2.c = 0; - _2.d = 0; - mdb(Gqe, "AbstractBarycenterPortDistributor", 402); - bcb(1633, 1, Dke, jEc); - _2.ue = function kEc(a, b) { - return _Dc(this.a, BD(a, 11), BD(b, 11)); - }; - _2.Fb = function lEc(a) { - return this === a; - }; - _2.ve = function mEc() { - return new tpb(this); - }; - mdb(Gqe, "AbstractBarycenterPortDistributor/lambda$0$Type", 1633); - bcb(817, 1, Mne, uEc); - _2.Nf = function xEc(a, b, c2, d, e, f2) { - }; - _2.Pf = function zEc(a, b, c2) { - }; - _2.Qf = function AEc(a, b, c2, d) { - }; - _2.Lf = function vEc() { - return false; - }; - _2.Mf = function wEc() { - this.c = this.e.a; - this.g = this.f.g; - }; - _2.Of = function yEc(a, b) { - b[a][0].c.p = a; - }; - _2.Rf = function BEc() { - return false; - }; - _2.ag = function CEc(a, b, c2, d) { - if (c2) { - rEc(this, a); - } else { - oEc(this, a, d); - pEc(this, a, b); - } - if (a.c.length > 1) { - Ccb(DD(vNb(Q_b((tCb(0, a.c.length), BD(a.c[0], 10))), (Nyc(), Awc)))) ? YGc(a, this.d, BD(this, 660)) : (mmb(), Okb(a, this.d)); - PEc(this.e, a); - } - }; - _2.Sf = function DEc(a, b, c2, d) { - var e, f2, g, h, i3, j, k; - if (b != sEc(c2, a.length)) { - f2 = a[b - (c2 ? 1 : -1)]; - UDc(this.f, f2, c2 ? (KAc(), IAc) : (KAc(), HAc)); - } - e = a[b][0]; - k = !d || e.k == (j0b(), e0b); - j = Ou(a[b]); - this.ag(j, k, false, c2); - g = 0; - for (i3 = new olb(j); i3.a < i3.c.c.length; ) { - h = BD(mlb(i3), 10); - a[b][g++] = h; - } - return false; - }; - _2.Tf = function EEc(a, b) { - var c2, d, e, f2, g; - g = sEc(b, a.length); - f2 = Ou(a[g]); - this.ag(f2, false, true, b); - c2 = 0; - for (e = new olb(f2); e.a < e.c.c.length; ) { - d = BD(mlb(e), 10); - a[g][c2++] = d; - } - return false; - }; - mdb(Gqe, "BarycenterHeuristic", 817); - bcb(658, 1, { 658: 1 }, FEc); - _2.Ib = function GEc() { - 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 CX = mdb(Gqe, "BarycenterHeuristic/BarycenterState", 658); - bcb(1802, 1, Dke, HEc); - _2.ue = function IEc(a, b) { - return qEc(this.a, BD(a, 10), BD(b, 10)); - }; - _2.Fb = function JEc(a) { - return this === a; - }; - _2.ve = function KEc() { - return new tpb(this); - }; - mdb(Gqe, "BarycenterHeuristic/lambda$0$Type", 1802); - bcb(816, 1, Mne, SEc); - _2.Mf = function TEc() { - }; - _2.Nf = function UEc(a, b, c2, d, e, f2) { - }; - _2.Qf = function XEc(a, b, c2, d) { - }; - _2.Of = function VEc(a, b) { - this.a[a] = KC(CX, { 3: 1, 4: 1, 5: 1, 2018: 1 }, 658, b[a].length, 0, 1); - this.b[a] = KC(FX, { 3: 1, 4: 1, 5: 1, 2019: 1 }, 233, b[a].length, 0, 1); - }; - _2.Pf = function WEc(a, b, c2) { - OEc(this, c2[a][b], true); - }; - _2.c = false; - mdb(Gqe, "ForsterConstraintResolver", 816); - bcb(233, 1, { 233: 1 }, $Ec, _Ec); - _2.Ib = function aFc() { - var a, b; - b = new Ufb(); - b.a += "["; - for (a = 0; a < this.d.length; a++) { - Qfb(b, a0b(this.d[a])); - REc(this.g, this.d[0]).a != null && Qfb(Qfb((b.a += "<", b), Jdb(REc(this.g, this.d[0]).a)), ">"); - a < this.d.length - 1 && (b.a += She, b); - } - return (b.a += "]", b).a; - }; - _2.a = 0; - _2.c = 0; - _2.f = 0; - var FX = mdb(Gqe, "ForsterConstraintResolver/ConstraintGroup", 233); - bcb(1797, 1, qie, bFc); - _2.td = function cFc(a) { - OEc(this.a, BD(a, 10), false); - }; - mdb(Gqe, "ForsterConstraintResolver/lambda$0$Type", 1797); - bcb(214, 1, { 214: 1, 225: 1 }, fFc); - _2.Nf = function hFc(a, b, c2, d, e, f2) { - }; - _2.Of = function iFc(a, b) { - }; - _2.Mf = function gFc() { - this.r = KC(WD, oje, 25, this.n, 15, 1); - }; - _2.Pf = function jFc(a, b, c2) { - var d, e; - e = c2[a][b]; - d = e.e; - !!d && Ekb(this.b, d); - }; - _2.Qf = function kFc(a, b, c2, d) { - ++this.n; - }; - _2.Ib = function lFc() { - return wlb(this.e, new Tqb()); - }; - _2.g = false; - _2.i = false; - _2.n = 0; - _2.s = false; - mdb(Gqe, "GraphInfoHolder", 214); - bcb(1832, 1, Mne, pFc); - _2.Nf = function sFc(a, b, c2, d, e, f2) { - }; - _2.Of = function tFc(a, b) { - }; - _2.Qf = function vFc(a, b, c2, d) { - }; - _2._f = function qFc(a, b, c2) { - c2 && b > 0 ? (RHc(this.a, a[b - 1], a[b]), void 0) : !c2 && b < a.length - 1 ? (RHc(this.a, a[b], a[b + 1]), void 0) : THc(this.a, a[b], c2 ? (Ucd(), Tcd) : (Ucd(), zcd)); - return mFc(this, a, b, c2); - }; - _2.Mf = function rFc() { - this.d = KC(WD, oje, 25, this.c, 15, 1); - this.a = new dIc(this.d); - }; - _2.Pf = function uFc(a, b, c2) { - var d; - d = c2[a][b]; - this.c += d.j.c.length; - }; - _2.c = 0; - mdb(Gqe, "GreedyPortDistributor", 1832); - bcb(1401, 1, Bqe, CFc); - _2.Yf = function DFc(a) { - return zFc(BD(a, 37)); - }; - _2.pf = function EFc(a, b) { - BFc(BD(a, 37), b); - }; - var xFc; - mdb(Gqe, "InteractiveCrossingMinimizer", 1401); - bcb(1402, 1, Dke, GFc); - _2.ue = function HFc(a, b) { - return FFc(this, BD(a, 10), BD(b, 10)); - }; - _2.Fb = function IFc(a) { - return this === a; - }; - _2.ve = function JFc() { - return new tpb(this); - }; - mdb(Gqe, "InteractiveCrossingMinimizer/1", 1402); - bcb(507, 1, { 507: 1, 123: 1, 51: 1 }, fGc); - _2.Yf = function gGc(a) { - var b; - return BD(a, 37), b = k3c(KFc), e3c(b, (qUb(), nUb), (S8b(), H8b)), b; - }; - _2.pf = function hGc(a, b) { - YFc(this, BD(a, 37), b); - }; - _2.e = 0; - var KFc; - mdb(Gqe, "LayerSweepCrossingMinimizer", 507); - bcb(1398, 1, qie, iGc); - _2.td = function jGc(a) { - MFc(this.a, BD(a, 214)); - }; - mdb(Gqe, "LayerSweepCrossingMinimizer/0methodref$compareDifferentRandomizedLayouts$Type", 1398); - bcb(1399, 1, qie, kGc); - _2.td = function lGc(a) { - VFc(this.a, BD(a, 214)); - }; - mdb(Gqe, "LayerSweepCrossingMinimizer/1methodref$minimizeCrossingsNoCounter$Type", 1399); - bcb(1400, 1, qie, mGc); - _2.td = function nGc(a) { - XFc(this.a, BD(a, 214)); - }; - mdb(Gqe, "LayerSweepCrossingMinimizer/2methodref$minimizeCrossingsWithCounter$Type", 1400); - bcb(454, 22, { 3: 1, 35: 1, 22: 1, 454: 1 }, sGc); - var oGc, pGc, qGc; - var PX = ndb(Gqe, "LayerSweepCrossingMinimizer/CrossMinType", 454, CI, uGc, tGc); - var vGc; - bcb(1397, 1, Oie, xGc); - _2.Mb = function yGc(a) { - return LFc(), BD(a, 29).a.c.length == 0; - }; - mdb(Gqe, "LayerSweepCrossingMinimizer/lambda$0$Type", 1397); - bcb(1799, 1, Mne, BGc); - _2.Mf = function CGc() { - }; - _2.Nf = function DGc(a, b, c2, d, e, f2) { - }; - _2.Qf = function GGc(a, b, c2, d) { - }; - _2.Of = function EGc(a, b) { - b[a][0].c.p = a; - this.b[a] = KC(SX, { 3: 1, 4: 1, 5: 1, 1944: 1 }, 659, b[a].length, 0, 1); - }; - _2.Pf = function FGc(a, b, c2) { - var d; - d = c2[a][b]; - d.p = b; - NC(this.b[a], b, new HGc()); - }; - mdb(Gqe, "LayerSweepTypeDecider", 1799); - bcb(659, 1, { 659: 1 }, HGc); - _2.Ib = function IGc() { - return "NodeInfo [connectedEdges=" + this.a + ", hierarchicalInfluence=" + this.b + ", randomInfluence=" + this.c + "]"; - }; - _2.a = 0; - _2.b = 0; - _2.c = 0; - var SX = mdb(Gqe, "LayerSweepTypeDecider/NodeInfo", 659); - bcb(1800, 1, Vke, JGc); - _2.Lb = function KGc(a) { - return a1b(new b1b(BD(a, 11).b)); - }; - _2.Fb = function LGc(a) { - return this === a; - }; - _2.Mb = function MGc(a) { - return a1b(new b1b(BD(a, 11).b)); - }; - mdb(Gqe, "LayerSweepTypeDecider/lambda$0$Type", 1800); - bcb(1801, 1, Vke, NGc); - _2.Lb = function OGc(a) { - return a1b(new b1b(BD(a, 11).b)); - }; - _2.Fb = function PGc(a) { - return this === a; - }; - _2.Mb = function QGc(a) { - return a1b(new b1b(BD(a, 11).b)); - }; - mdb(Gqe, "LayerSweepTypeDecider/lambda$1$Type", 1801); - bcb(1833, 402, Eqe, RGc); - _2.$f = function SGc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l; - j = this.g; - switch (c2.g) { - case 1: { - d = 0; - e = 0; - for (i3 = new olb(a.j); i3.a < i3.c.c.length; ) { - g = BD(mlb(i3), 11); - if (g.e.c.length != 0) { - ++d; - g.j == (Ucd(), Acd) && ++e; - } - } - f2 = b + e; - l = b + d; - for (h = W_b(a, (KAc(), HAc)).Kc(); h.Ob(); ) { - g = BD(h.Pb(), 11); - if (g.j == (Ucd(), Acd)) { - j[g.p] = f2; - --f2; - } else { - j[g.p] = l; - --l; - } + } + 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; + } + } + 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; + } + } + 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; } - return d; - } - case 2: { - k = 0; - for (h = W_b(a, (KAc(), IAc)).Kc(); h.Ob(); ) { - g = BD(h.Pb(), 11); - ++k; - j[g.p] = b + k; + if (ey1 > ey2) { + var _temp = ey1; + ey1 = ey2; + ey2 = _temp; } - return k; + updateBounds(bounds4, ex1 - wHalf, ey1 - wHalf, ex2 + wHalf, ey2 + wHalf); } - default: - throw vbb(new Vdb()); - } - }; - mdb(Gqe, "LayerTotalPortDistributor", 1833); - bcb(660, 817, { 660: 1, 225: 1 }, XGc); - _2.ag = function ZGc(a, b, c2, d) { - if (c2) { - rEc(this, a); - } else { - oEc(this, a, d); - pEc(this, a, b); - } - if (a.c.length > 1) { - Ccb(DD(vNb(Q_b((tCb(0, a.c.length), BD(a.c[0], 10))), (Nyc(), Awc)))) ? YGc(a, this.d, this) : (mmb(), Okb(a, this.d)); - Ccb(DD(vNb(Q_b((tCb(0, a.c.length), BD(a.c[0], 10))), Awc))) || PEc(this.e, a); - } - }; - mdb(Gqe, "ModelOrderBarycenterHeuristic", 660); - bcb(1803, 1, Dke, $Gc); - _2.ue = function _Gc(a, b) { - return VGc(this.a, BD(a, 10), BD(b, 10)); - }; - _2.Fb = function aHc(a) { - return this === a; - }; - _2.ve = function bHc() { - return new tpb(this); - }; - mdb(Gqe, "ModelOrderBarycenterHeuristic/lambda$0$Type", 1803); - bcb(1403, 1, Bqe, fHc); - _2.Yf = function gHc(a) { - var b; - return BD(a, 37), b = k3c(cHc), e3c(b, (qUb(), nUb), (S8b(), H8b)), b; - }; - _2.pf = function hHc(a, b) { - eHc((BD(a, 37), b)); - }; - var cHc; - mdb(Gqe, "NoCrossingMinimizer", 1403); - bcb(796, 402, Eqe, iHc); - _2.$f = function jHc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n; - l = this.g; - switch (c2.g) { - case 1: { - e = 0; - f2 = 0; - for (k = new olb(a.j); k.a < k.c.c.length; ) { - i3 = BD(mlb(k), 11); - if (i3.e.c.length != 0) { - ++e; - i3.j == (Ucd(), Acd) && ++f2; - } - } - d = 1 / (e + 1); - g = b + f2 * d; - n = b + 1 - d; - for (j = W_b(a, (KAc(), HAc)).Kc(); j.Ob(); ) { - i3 = BD(j.Pb(), 11); - if (i3.j == (Ucd(), Acd)) { - l[i3.p] = g; - g -= d; - } else { - l[i3.p] = n; - n -= d; - } - } - break; + } 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; } - case 2: { - h = 0; - for (k = new olb(a.j); k.a < k.c.c.length; ) { - i3 = BD(mlb(k), 11); - i3.g.c.length == 0 || ++h; - } - d = 1 / (h + 1); - m = b + d; - for (j = W_b(a, (KAc(), IAc)).Kc(); j.Ob(); ) { - i3 = BD(j.Pb(), 11); - l[i3.p] = m; - m += d; + 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); } - break; - } - default: - throw vbb(new Wdb("Port type is undefined")); - } - return 1; - }; - mdb(Gqe, "NodeRelativePortDistributor", 796); - bcb(807, 1, {}, nHc, oHc); - mdb(Gqe, "SweepCopy", 807); - bcb(1798, 1, Mne, rHc); - _2.Of = function uHc(a, b) { - }; - _2.Mf = function sHc() { - var a; - a = KC(WD, oje, 25, this.f, 15, 1); - this.d = new LIc(a); - this.a = new dIc(a); - }; - _2.Nf = function tHc(a, b, c2, d, e, f2) { - var g; - g = BD(Ikb(f2[a][b].j, c2), 11); - e.c == g && e.c.i.c == e.d.i.c && ++this.e[a]; - }; - _2.Pf = function vHc(a, b, c2) { - var d; - d = c2[a][b]; - this.c[a] = this.c[a] | d.k == (j0b(), i0b); - }; - _2.Qf = function wHc(a, b, c2, d) { - var e; - e = BD(Ikb(d[a][b].j, c2), 11); - e.p = this.f++; - e.g.c.length + e.e.c.length > 1 && (e.j == (Ucd(), zcd) ? this.b[a] = true : e.j == Tcd && a > 0 && (this.b[a - 1] = true)); - }; - _2.f = 0; - mdb(Lne, "AllCrossingsCounter", 1798); - bcb(587, 1, {}, BHc); - _2.b = 0; - _2.d = 0; - mdb(Lne, "BinaryIndexedTree", 587); - bcb(524, 1, {}, dIc); - var DHc, EHc; - mdb(Lne, "CrossingsCounter", 524); - bcb(1906, 1, Dke, hIc); - _2.ue = function iIc(a, b) { - return YHc(this.a, BD(a, 11), BD(b, 11)); - }; - _2.Fb = function jIc(a) { - return this === a; - }; - _2.ve = function kIc() { - return new tpb(this); - }; - mdb(Lne, "CrossingsCounter/lambda$0$Type", 1906); - bcb(1907, 1, Dke, lIc); - _2.ue = function mIc(a, b) { - return ZHc(this.a, BD(a, 11), BD(b, 11)); - }; - _2.Fb = function nIc(a) { - return this === a; - }; - _2.ve = function oIc() { - return new tpb(this); - }; - mdb(Lne, "CrossingsCounter/lambda$1$Type", 1907); - bcb(1908, 1, Dke, pIc); - _2.ue = function qIc(a, b) { - return $Hc(this.a, BD(a, 11), BD(b, 11)); - }; - _2.Fb = function rIc(a) { - return this === a; - }; - _2.ve = function sIc() { - return new tpb(this); - }; - mdb(Lne, "CrossingsCounter/lambda$2$Type", 1908); - bcb(1909, 1, Dke, tIc); - _2.ue = function uIc(a, b) { - return _Hc(this.a, BD(a, 11), BD(b, 11)); - }; - _2.Fb = function vIc(a) { - return this === a; - }; - _2.ve = function wIc() { - return new tpb(this); - }; - mdb(Lne, "CrossingsCounter/lambda$3$Type", 1909); - bcb(1910, 1, qie, xIc); - _2.td = function yIc(a) { - eIc(this.a, BD(a, 11)); - }; - mdb(Lne, "CrossingsCounter/lambda$4$Type", 1910); - bcb(1911, 1, Oie, zIc); - _2.Mb = function AIc(a) { - return fIc(this.a, BD(a, 11)); - }; - mdb(Lne, "CrossingsCounter/lambda$5$Type", 1911); - bcb(1912, 1, qie, CIc); - _2.td = function DIc(a) { - BIc(this, a); - }; - mdb(Lne, "CrossingsCounter/lambda$6$Type", 1912); - bcb(1913, 1, qie, EIc); - _2.td = function FIc(a) { - var b; - FHc(); - Wjb(this.b, (b = this.a, BD(a, 11), b)); - }; - mdb(Lne, "CrossingsCounter/lambda$7$Type", 1913); - bcb(826, 1, Vke, GIc); - _2.Lb = function HIc(a) { - return FHc(), wNb(BD(a, 11), (wtc(), gtc)); - }; - _2.Fb = function IIc(a) { - return this === a; - }; - _2.Mb = function JIc(a) { - return FHc(), wNb(BD(a, 11), (wtc(), gtc)); - }; - mdb(Lne, "CrossingsCounter/lambda$8$Type", 826); - bcb(1905, 1, {}, LIc); - mdb(Lne, "HyperedgeCrossingsCounter", 1905); - bcb(467, 1, { 35: 1, 467: 1 }, NIc); - _2.wd = function OIc(a) { - return MIc(this, BD(a, 467)); - }; - _2.b = 0; - _2.c = 0; - _2.e = 0; - _2.f = 0; - var oY = mdb(Lne, "HyperedgeCrossingsCounter/Hyperedge", 467); - bcb(362, 1, { 35: 1, 362: 1 }, QIc); - _2.wd = function RIc(a) { - return PIc(this, BD(a, 362)); - }; - _2.b = 0; - _2.c = 0; - var nY = mdb(Lne, "HyperedgeCrossingsCounter/HyperedgeCorner", 362); - bcb(523, 22, { 3: 1, 35: 1, 22: 1, 523: 1 }, VIc); - var SIc, TIc; - var mY = ndb(Lne, "HyperedgeCrossingsCounter/HyperedgeCorner/Type", 523, CI, XIc, WIc); - var YIc; - bcb(1405, 1, Bqe, dJc); - _2.Yf = function eJc(a) { - return BD(vNb(BD(a, 37), (wtc(), Ksc)), 21).Hc((Orc(), Hrc)) ? _Ic : null; - }; - _2.pf = function fJc(a, b) { - cJc(this, BD(a, 37), b); - }; - var _Ic; - mdb(Hqe, "InteractiveNodePlacer", 1405); - bcb(1406, 1, Bqe, tJc); - _2.Yf = function uJc(a) { - return BD(vNb(BD(a, 37), (wtc(), Ksc)), 21).Hc((Orc(), Hrc)) ? gJc : null; - }; - _2.pf = function vJc(a, b) { - rJc(this, BD(a, 37), b); - }; - var gJc, hJc, iJc; - mdb(Hqe, "LinearSegmentsNodePlacer", 1406); - bcb(257, 1, { 35: 1, 257: 1 }, zJc); - _2.wd = function AJc(a) { - return wJc(this, BD(a, 257)); - }; - _2.Fb = function BJc(a) { - var b; - if (JD(a, 257)) { - b = BD(a, 257); - return this.b == b.b; - } - return false; - }; - _2.Hb = function CJc() { - return this.b; - }; - _2.Ib = function DJc() { - return "ls" + Fe(this.e); - }; - _2.a = 0; - _2.b = 0; - _2.c = -1; - _2.d = -1; - _2.g = 0; - var sY = mdb(Hqe, "LinearSegmentsNodePlacer/LinearSegment", 257); - bcb(1408, 1, Bqe, $Jc); - _2.Yf = function _Jc(a) { - return BD(vNb(BD(a, 37), (wtc(), Ksc)), 21).Hc((Orc(), Hrc)) ? EJc : null; - }; - _2.pf = function hKc(a, b) { - WJc(this, BD(a, 37), b); - }; - _2.b = 0; - _2.g = 0; - var EJc; - mdb(Hqe, "NetworkSimplexPlacer", 1408); - bcb(1427, 1, Dke, iKc); - _2.ue = function jKc(a, b) { - return beb(BD(a, 19).a, BD(b, 19).a); - }; - _2.Fb = function kKc(a) { - return this === a; - }; - _2.ve = function lKc() { - return new tpb(this); - }; - mdb(Hqe, "NetworkSimplexPlacer/0methodref$compare$Type", 1427); - bcb(1429, 1, Dke, mKc); - _2.ue = function nKc(a, b) { - return beb(BD(a, 19).a, BD(b, 19).a); - }; - _2.Fb = function oKc(a) { - return this === a; - }; - _2.ve = function pKc() { - return new tpb(this); - }; - mdb(Hqe, "NetworkSimplexPlacer/1methodref$compare$Type", 1429); - bcb(649, 1, { 649: 1 }, qKc); - var wY = mdb(Hqe, "NetworkSimplexPlacer/EdgeRep", 649); - bcb(401, 1, { 401: 1 }, rKc); - _2.b = false; - var xY = mdb(Hqe, "NetworkSimplexPlacer/NodeRep", 401); - bcb(508, 12, { 3: 1, 4: 1, 20: 1, 28: 1, 52: 1, 12: 1, 14: 1, 15: 1, 54: 1, 508: 1 }, vKc); - mdb(Hqe, "NetworkSimplexPlacer/Path", 508); - bcb(1409, 1, {}, wKc); - _2.Kb = function xKc(a) { - return BD(a, 17).d.i.k; - }; - mdb(Hqe, "NetworkSimplexPlacer/Path/lambda$0$Type", 1409); - bcb(1410, 1, Oie, yKc); - _2.Mb = function zKc(a) { - return BD(a, 267) == (j0b(), g0b); - }; - mdb(Hqe, "NetworkSimplexPlacer/Path/lambda$1$Type", 1410); - bcb(1411, 1, {}, AKc); - _2.Kb = function BKc(a) { - return BD(a, 17).d.i; - }; - mdb(Hqe, "NetworkSimplexPlacer/Path/lambda$2$Type", 1411); - bcb(1412, 1, Oie, CKc); - _2.Mb = function DKc(a) { - return eLc(Lzc(BD(a, 10))); - }; - mdb(Hqe, "NetworkSimplexPlacer/Path/lambda$3$Type", 1412); - bcb(1413, 1, Oie, EKc); - _2.Mb = function FKc(a) { - return dKc(BD(a, 11)); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$0$Type", 1413); - bcb(1414, 1, qie, GKc); - _2.td = function HKc(a) { - LJc(this.a, this.b, BD(a, 11)); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$1$Type", 1414); - bcb(1423, 1, qie, IKc); - _2.td = function JKc(a) { - MJc(this.a, BD(a, 17)); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$10$Type", 1423); - bcb(1424, 1, {}, KKc); - _2.Kb = function LKc(a) { - return FJc(), new YAb(null, new Kub(BD(a, 29).a, 16)); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$11$Type", 1424); - bcb(1425, 1, qie, MKc); - _2.td = function NKc(a) { - NJc(this.a, BD(a, 10)); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$12$Type", 1425); - bcb(1426, 1, {}, OKc); - _2.Kb = function PKc(a) { - return FJc(), meb(BD(a, 121).e); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$13$Type", 1426); - bcb(1428, 1, {}, QKc); - _2.Kb = function RKc(a) { - return FJc(), meb(BD(a, 121).e); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$15$Type", 1428); - bcb(1430, 1, Oie, SKc); - _2.Mb = function TKc(a) { - return FJc(), BD(a, 401).c.k == (j0b(), h0b); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$17$Type", 1430); - bcb(1431, 1, Oie, UKc); - _2.Mb = function VKc(a) { - return FJc(), BD(a, 401).c.j.c.length > 1; - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$18$Type", 1431); - bcb(1432, 1, qie, WKc); - _2.td = function XKc(a) { - eKc(this.c, this.b, this.d, this.a, BD(a, 401)); - }; - _2.c = 0; - _2.d = 0; - mdb(Hqe, "NetworkSimplexPlacer/lambda$19$Type", 1432); - bcb(1415, 1, {}, YKc); - _2.Kb = function ZKc(a) { - return FJc(), new YAb(null, new Kub(BD(a, 29).a, 16)); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$2$Type", 1415); - bcb(1433, 1, qie, $Kc); - _2.td = function _Kc(a) { - fKc(this.a, BD(a, 11)); - }; - _2.a = 0; - mdb(Hqe, "NetworkSimplexPlacer/lambda$20$Type", 1433); - bcb(1434, 1, {}, aLc); - _2.Kb = function bLc(a) { - return FJc(), new YAb(null, new Kub(BD(a, 29).a, 16)); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$21$Type", 1434); - bcb(1435, 1, qie, cLc); - _2.td = function dLc(a) { - OJc(this.a, BD(a, 10)); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$22$Type", 1435); - bcb(1436, 1, Oie, fLc); - _2.Mb = function gLc(a) { - return eLc(a); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$23$Type", 1436); - bcb(1437, 1, {}, hLc); - _2.Kb = function iLc(a) { - return FJc(), new YAb(null, new Kub(BD(a, 29).a, 16)); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$24$Type", 1437); - bcb(1438, 1, Oie, jLc); - _2.Mb = function kLc(a) { - return PJc(this.a, BD(a, 10)); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$25$Type", 1438); - bcb(1439, 1, qie, lLc); - _2.td = function mLc(a) { - QJc(this.a, this.b, BD(a, 10)); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$26$Type", 1439); - bcb(1440, 1, Oie, nLc); - _2.Mb = function oLc(a) { - return FJc(), !OZb(BD(a, 17)); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$27$Type", 1440); - bcb(1441, 1, Oie, pLc); - _2.Mb = function qLc(a) { - return FJc(), !OZb(BD(a, 17)); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$28$Type", 1441); - bcb(1442, 1, {}, rLc); - _2.Ce = function sLc(a, b) { - return RJc(this.a, BD(a, 29), BD(b, 29)); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$29$Type", 1442); - bcb(1416, 1, {}, tLc); - _2.Kb = function uLc(a) { - return FJc(), new YAb(null, new Lub(new Sr(ur(U_b(BD(a, 10)).a.Kc(), new Sq())))); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$3$Type", 1416); - bcb(1417, 1, Oie, vLc); - _2.Mb = function wLc(a) { - return FJc(), cKc(BD(a, 17)); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$4$Type", 1417); - bcb(1418, 1, qie, xLc); - _2.td = function yLc(a) { - XJc(this.a, BD(a, 17)); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$5$Type", 1418); - bcb(1419, 1, {}, zLc); - _2.Kb = function ALc(a) { - return FJc(), new YAb(null, new Kub(BD(a, 29).a, 16)); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$6$Type", 1419); - bcb(1420, 1, Oie, BLc); - _2.Mb = function CLc(a) { - return FJc(), BD(a, 10).k == (j0b(), h0b); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$7$Type", 1420); - bcb(1421, 1, {}, DLc); - _2.Kb = function ELc(a) { - return FJc(), new YAb(null, new Lub(new Sr(ur(O_b(BD(a, 10)).a.Kc(), new Sq())))); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$8$Type", 1421); - bcb(1422, 1, Oie, FLc); - _2.Mb = function GLc(a) { - return FJc(), NZb(BD(a, 17)); - }; - mdb(Hqe, "NetworkSimplexPlacer/lambda$9$Type", 1422); - bcb(1404, 1, Bqe, KLc); - _2.Yf = function LLc(a) { - return BD(vNb(BD(a, 37), (wtc(), Ksc)), 21).Hc((Orc(), Hrc)) ? HLc : null; - }; - _2.pf = function MLc(a, b) { - JLc(BD(a, 37), b); - }; - var HLc; - mdb(Hqe, "SimpleNodePlacer", 1404); - bcb(180, 1, { 180: 1 }, ULc); - _2.Ib = function VLc() { - var a; - a = ""; - this.c == (YLc(), XLc) ? a += kle : this.c == WLc && (a += jle); - this.o == (eMc(), cMc) ? a += vle : this.o == dMc ? a += "UP" : a += "BALANCED"; - return a; - }; - mdb(Kqe, "BKAlignedLayout", 180); - bcb(516, 22, { 3: 1, 35: 1, 22: 1, 516: 1 }, ZLc); - var WLc, XLc; - var fZ = ndb(Kqe, "BKAlignedLayout/HDirection", 516, CI, _Lc, $Lc); - var aMc; - bcb(515, 22, { 3: 1, 35: 1, 22: 1, 515: 1 }, fMc); - var cMc, dMc; - var gZ = ndb(Kqe, "BKAlignedLayout/VDirection", 515, CI, hMc, gMc); - var iMc; - bcb(1634, 1, {}, mMc); - mdb(Kqe, "BKAligner", 1634); - bcb(1637, 1, {}, rMc); - mdb(Kqe, "BKCompactor", 1637); - bcb(654, 1, { 654: 1 }, sMc); - _2.a = 0; - mdb(Kqe, "BKCompactor/ClassEdge", 654); - bcb(458, 1, { 458: 1 }, uMc); - _2.a = null; - _2.b = 0; - mdb(Kqe, "BKCompactor/ClassNode", 458); - bcb(1407, 1, Bqe, CMc); - _2.Yf = function GMc(a) { - return BD(vNb(BD(a, 37), (wtc(), Ksc)), 21).Hc((Orc(), Hrc)) ? vMc : null; - }; - _2.pf = function HMc(a, b) { - BMc(this, BD(a, 37), b); - }; - _2.d = false; - var vMc; - mdb(Kqe, "BKNodePlacer", 1407); - bcb(1635, 1, {}, JMc); - _2.d = 0; - mdb(Kqe, "NeighborhoodInformation", 1635); - bcb(1636, 1, Dke, OMc); - _2.ue = function PMc(a, b) { - return NMc(this, BD(a, 46), BD(b, 46)); - }; - _2.Fb = function QMc(a) { - return this === a; - }; - _2.ve = function RMc() { - return new tpb(this); - }; - mdb(Kqe, "NeighborhoodInformation/NeighborComparator", 1636); - bcb(808, 1, {}); - mdb(Kqe, "ThresholdStrategy", 808); - bcb(1763, 808, {}, WMc); - _2.bg = function XMc(a, b, c2) { - return this.a.o == (eMc(), dMc) ? Pje : Qje; - }; - _2.cg = function YMc() { - }; - mdb(Kqe, "ThresholdStrategy/NullThresholdStrategy", 1763); - bcb(579, 1, { 579: 1 }, ZMc); - _2.c = false; - _2.d = false; - mdb(Kqe, "ThresholdStrategy/Postprocessable", 579); - bcb(1764, 808, {}, bNc); - _2.bg = function cNc(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 == (YLc(), XLc)) { - e && (f2 = $Mc(this, b, true)); - !isNaN(f2) && !isFinite(f2) && d && (f2 = $Mc(this, c2, false)); - } else { - e && (f2 = $Mc(this, b, true)); - !isNaN(f2) && !isFinite(f2) && d && (f2 = $Mc(this, c2, false)); - } - return f2; - }; - _2.cg = function dNc() { - var a, b, c2, d, e; - while (this.d.b != 0) { - e = BD(Ksb(this.d), 579); - d = _Mc(this, e); - if (!d.a) { - continue; - } - a = d.a; - c2 = Ccb(this.a.f[this.a.g[e.b.p].p]); - if (!c2 && !OZb(a) && a.c.i.c == a.d.i.c) { - continue; } - b = aNc(this, e); - b || swb(this.e, e); } - while (this.e.a.c.length != 0) { - aNc(this, BD(rwb(this.e), 579)); + } 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; } - }; - mdb(Kqe, "ThresholdStrategy/SimpleThresholdStrategy", 1764); - bcb(635, 1, { 635: 1, 246: 1, 234: 1 }, hNc); - _2.Kf = function jNc() { - return gNc(this); - }; - _2.Xf = function iNc() { - return gNc(this); - }; - var eNc; - mdb(Lqe, "EdgeRouterFactory", 635); - bcb(1458, 1, Bqe, wNc); - _2.Yf = function xNc(a) { - return uNc(BD(a, 37)); - }; - _2.pf = function yNc(a, b) { - vNc(BD(a, 37), b); - }; - var lNc, mNc, nNc, oNc, pNc, qNc, rNc, sNc; - mdb(Lqe, "OrthogonalEdgeRouter", 1458); - bcb(1451, 1, Bqe, NNc); - _2.Yf = function ONc(a) { - return INc(BD(a, 37)); - }; - _2.pf = function PNc(a, b) { - KNc(this, BD(a, 37), b); - }; - var zNc, ANc, BNc, CNc, DNc, ENc; - mdb(Lqe, "PolylineEdgeRouter", 1451); - bcb(1452, 1, Vke, RNc); - _2.Lb = function SNc(a) { - return QNc(BD(a, 10)); - }; - _2.Fb = function TNc(a) { - return this === a; - }; - _2.Mb = function UNc(a) { - return QNc(BD(a, 10)); - }; - mdb(Lqe, "PolylineEdgeRouter/1", 1452); - bcb(1809, 1, Oie, ZNc); - _2.Mb = function $Nc(a) { - return BD(a, 129).c == (HOc(), FOc); - }; - mdb(Mqe, "HyperEdgeCycleDetector/lambda$0$Type", 1809); - bcb(1810, 1, {}, _Nc); - _2.Ge = function aOc(a) { - return BD(a, 129).d; - }; - mdb(Mqe, "HyperEdgeCycleDetector/lambda$1$Type", 1810); - bcb(1811, 1, Oie, bOc); - _2.Mb = function cOc(a) { - return BD(a, 129).c == (HOc(), FOc); - }; - mdb(Mqe, "HyperEdgeCycleDetector/lambda$2$Type", 1811); - bcb(1812, 1, {}, dOc); - _2.Ge = function eOc(a) { - return BD(a, 129).d; - }; - mdb(Mqe, "HyperEdgeCycleDetector/lambda$3$Type", 1812); - bcb(1813, 1, {}, fOc); - _2.Ge = function gOc(a) { - return BD(a, 129).d; - }; - mdb(Mqe, "HyperEdgeCycleDetector/lambda$4$Type", 1813); - bcb(1814, 1, {}, hOc); - _2.Ge = function iOc(a) { - return BD(a, 129).d; - }; - mdb(Mqe, "HyperEdgeCycleDetector/lambda$5$Type", 1814); - bcb(112, 1, { 35: 1, 112: 1 }, uOc); - _2.wd = function vOc(a) { - return kOc(this, BD(a, 112)); - }; - _2.Fb = function wOc(a) { - var b; - if (JD(a, 112)) { - b = BD(a, 112); - return this.g == b.g; + if (ey1 > ey2) { + var _temp3 = ey1; + ey1 = ey2; + ey2 = _temp3; } - return false; - }; - _2.Hb = function xOc() { - return this.g; - }; - _2.Ib = function zOc() { - var a, b, c2, d; - a = new Wfb("{"); - d = new olb(this.n); - while (d.a < d.c.c.length) { - c2 = BD(mlb(d), 11); - b = P_b(c2.i); - b == null && (b = "n" + S_b(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; - mdb(Mqe, "HyperEdgeSegment", 112); - bcb(129, 1, { 129: 1 }, DOc); - _2.Ib = function EOc() { - return this.a + "->" + this.b + " (" + Yr(this.c) + ")"; - }; - _2.d = 0; - mdb(Mqe, "HyperEdgeSegmentDependency", 129); - bcb(520, 22, { 3: 1, 35: 1, 22: 1, 520: 1 }, IOc); - var FOc, GOc; - var DZ = ndb(Mqe, "HyperEdgeSegmentDependency/DependencyType", 520, CI, KOc, JOc); - var LOc; - bcb(1815, 1, {}, ZOc); - mdb(Mqe, "HyperEdgeSegmentSplitter", 1815); - bcb(1816, 1, {}, aPc); - _2.a = 0; - _2.b = 0; - mdb(Mqe, "HyperEdgeSegmentSplitter/AreaRating", 1816); - bcb(329, 1, { 329: 1 }, bPc); - _2.a = 0; - _2.b = 0; - _2.c = 0; - mdb(Mqe, "HyperEdgeSegmentSplitter/FreeArea", 329); - bcb(1817, 1, Dke, cPc); - _2.ue = function dPc(a, b) { - return _Oc(BD(a, 112), BD(b, 112)); - }; - _2.Fb = function ePc(a) { - return this === a; - }; - _2.ve = function fPc() { - return new tpb(this); - }; - mdb(Mqe, "HyperEdgeSegmentSplitter/lambda$0$Type", 1817); - bcb(1818, 1, qie, gPc); - _2.td = function hPc(a) { - TOc(this.a, this.d, this.c, this.b, BD(a, 112)); - }; - _2.b = 0; - mdb(Mqe, "HyperEdgeSegmentSplitter/lambda$1$Type", 1818); - bcb(1819, 1, {}, iPc); - _2.Kb = function jPc(a) { - return new YAb(null, new Kub(BD(a, 112).e, 16)); - }; - mdb(Mqe, "HyperEdgeSegmentSplitter/lambda$2$Type", 1819); - bcb(1820, 1, {}, kPc); - _2.Kb = function lPc(a) { - return new YAb(null, new Kub(BD(a, 112).j, 16)); - }; - mdb(Mqe, "HyperEdgeSegmentSplitter/lambda$3$Type", 1820); - bcb(1821, 1, {}, mPc); - _2.Fe = function nPc(a) { - return Edb(ED(a)); - }; - mdb(Mqe, "HyperEdgeSegmentSplitter/lambda$4$Type", 1821); - bcb(655, 1, {}, tPc); - _2.a = 0; - _2.b = 0; - _2.c = 0; - mdb(Mqe, "OrthogonalRoutingGenerator", 655); - bcb(1638, 1, {}, xPc); - _2.Kb = function yPc(a) { - return new YAb(null, new Kub(BD(a, 112).e, 16)); - }; - mdb(Mqe, "OrthogonalRoutingGenerator/lambda$0$Type", 1638); - bcb(1639, 1, {}, zPc); - _2.Kb = function APc(a) { - return new YAb(null, new Kub(BD(a, 112).j, 16)); - }; - mdb(Mqe, "OrthogonalRoutingGenerator/lambda$1$Type", 1639); - bcb(661, 1, {}); - mdb(Nqe, "BaseRoutingDirectionStrategy", 661); - bcb(1807, 661, {}, EPc); - _2.dg = function FPc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p; - if (!!a.r && !a.q) { - return; + ex1 -= wHalf; + ex2 += wHalf; + ey1 -= wHalf; + ey2 += wHalf; + updateBounds(bounds4, ex1, ey1, ex2, ey2); + } + } + 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); + } + } + 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); + } + if (isEdge2) { + if (options3.includeSourceLabels) { + updateBoundsFromLabel(bounds4, ele, "source"); } - k = b + a.o * c2; - for (j = new olb(a.n); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 11); - l = l7c(OC(GC(m1, 1), nie, 8, 0, [i3.i.n, i3.n, i3.a])).a; - for (h = new olb(i3.g); h.a < h.c.c.length; ) { - g = BD(mlb(h), 17); - if (!OZb(g)) { - o2 = g.d; - p = l7c(OC(GC(m1, 1), nie, 8, 0, [o2.i.n, o2.n, o2.a])).a; - if ($wnd.Math.abs(l - p) > qme) { - f2 = k; - e = a; - d = new f7c(l, f2); - Dsb(g.a, d); - BPc(this, g, e, d, false); - m = a.r; - if (m) { - n = Edb(ED(Ut(m.e, 0))); - d = new f7c(n, f2); - Dsb(g.a, d); - BPc(this, g, e, d, false); - f2 = b + m.o * c2; - e = m; - d = new f7c(n, f2); - Dsb(g.a, d); - BPc(this, g, e, d, false); - } - d = new f7c(p, f2); - Dsb(g.a, d); - BPc(this, g, e, d, false); - } - } - } + if (options3.includeTargetLabels) { + updateBoundsFromLabel(bounds4, ele, "target"); } - }; - _2.eg = function GPc(a) { - return a.i.n.a + a.n.a + a.a.a; - }; - _2.fg = function HPc() { - return Ucd(), Rcd; - }; - _2.gg = function IPc() { - return Ucd(), Acd; - }; - mdb(Nqe, "NorthToSouthRoutingStrategy", 1807); - bcb(1808, 661, {}, JPc); - _2.dg = function KPc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p; - if (!!a.r && !a.q) { - return; + } + } + } + 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); + } + } + 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); } - k = b - a.o * c2; - for (j = new olb(a.n); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 11); - l = l7c(OC(GC(m1, 1), nie, 8, 0, [i3.i.n, i3.n, i3.a])).a; - for (h = new olb(i3.g); h.a < h.c.c.length; ) { - g = BD(mlb(h), 17); - if (!OZb(g)) { - o2 = g.d; - p = l7c(OC(GC(m1, 1), nie, 8, 0, [o2.i.n, o2.n, o2.a])).a; - if ($wnd.Math.abs(l - p) > qme) { - f2 = k; - e = a; - d = new f7c(l, f2); - Dsb(g.a, d); - BPc(this, g, e, d, false); - m = a.r; - if (m) { - n = Edb(ED(Ut(m.e, 0))); - d = new f7c(n, f2); - Dsb(g.a, d); - BPc(this, g, e, d, false); - f2 = b - m.o * c2; - e = m; - d = new f7c(n, f2); - Dsb(g.a, d); - BPc(this, g, e, d, false); - } - d = new f7c(p, f2); - Dsb(g.a, d); - BPc(this, g, e, d, false); - } - } - } + if (opts.includeSourceLabels) { + updateBoundsFromBox(bb, _p.labelBounds.sourceRot); } - }; - _2.eg = function LPc(a) { - return a.i.n.a + a.n.a + a.a.a; - }; - _2.fg = function MPc() { - return Ucd(), Acd; - }; - _2.gg = function NPc() { - return Ucd(), Rcd; - }; - mdb(Nqe, "SouthToNorthRoutingStrategy", 1808); - bcb(1806, 661, {}, OPc); - _2.dg = function PPc(a, b, c2) { - var d, e, f2, g, h, i3, j, k, l, m, n, o2, p; - if (!!a.r && !a.q) { - return; + if (opts.includeTargetLabels) { + updateBoundsFromBox(bb, _p.labelBounds.targetRot); } - k = b + a.o * c2; - for (j = new olb(a.n); j.a < j.c.c.length; ) { - i3 = BD(mlb(j), 11); - l = l7c(OC(GC(m1, 1), nie, 8, 0, [i3.i.n, i3.n, i3.a])).b; - for (h = new olb(i3.g); h.a < h.c.c.length; ) { - g = BD(mlb(h), 17); - if (!OZb(g)) { - o2 = g.d; - p = l7c(OC(GC(m1, 1), nie, 8, 0, [o2.i.n, o2.n, o2.a])).b; - if ($wnd.Math.abs(l - p) > qme) { - f2 = k; - e = a; - d = new f7c(f2, l); - Dsb(g.a, d); - BPc(this, g, e, d, true); - m = a.r; - if (m) { - n = Edb(ED(Ut(m.e, 0))); - d = new f7c(f2, n); - Dsb(g.a, d); - BPc(this, g, e, d, true); - f2 = b + m.o * c2; - e = m; - d = new f7c(f2, n); - Dsb(g.a, d); - BPc(this, g, e, d, true); - } - d = new f7c(f2, p); - Dsb(g.a, d); - BPc(this, g, e, d, true); - } - } - } + } + } + 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); + } + } + 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; } - }; - _2.eg = function QPc(a) { - return a.i.n.b + a.n.b + a.a.b; - }; - _2.fg = function RPc() { - return Ucd(), zcd; - }; - _2.gg = function SPc() { - return Ucd(), Tcd; - }; - mdb(Nqe, "WestToEastRoutingStrategy", 1806); - bcb(813, 1, {}, YPc); - _2.Ib = function ZPc() { - return Fe(this.a); - }; - _2.b = 0; - _2.c = false; - _2.d = false; - _2.f = 0; - mdb(Pqe, "NubSpline", 813); - bcb(407, 1, { 407: 1 }, aQc, bQc); - mdb(Pqe, "NubSpline/PolarCP", 407); - bcb(1453, 1, Bqe, vQc); - _2.Yf = function xQc(a) { - return qQc(BD(a, 37)); - }; - _2.pf = function yQc(a, b) { - uQc(this, BD(a, 37), b); - }; - var cQc, dQc, eQc, fQc, gQc; - mdb(Pqe, "SplineEdgeRouter", 1453); - bcb(268, 1, { 268: 1 }, BQc); - _2.Ib = function CQc() { - return this.a + " ->(" + this.c + ") " + this.b; - }; - _2.c = 0; - mdb(Pqe, "SplineEdgeRouter/Dependency", 268); - bcb(455, 22, { 3: 1, 35: 1, 22: 1, 455: 1 }, GQc); - var DQc, EQc; - var YZ = ndb(Pqe, "SplineEdgeRouter/SideToProcess", 455, CI, IQc, HQc); - var JQc; - bcb(1454, 1, Oie, LQc); - _2.Mb = function MQc(a) { - return hQc(), !BD(a, 128).o; - }; - mdb(Pqe, "SplineEdgeRouter/lambda$0$Type", 1454); - bcb(1455, 1, {}, NQc); - _2.Ge = function OQc(a) { - return hQc(), BD(a, 128).v + 1; - }; - mdb(Pqe, "SplineEdgeRouter/lambda$1$Type", 1455); - bcb(1456, 1, qie, PQc); - _2.td = function QQc(a) { - sQc(this.a, this.b, BD(a, 46)); - }; - mdb(Pqe, "SplineEdgeRouter/lambda$2$Type", 1456); - bcb(1457, 1, qie, RQc); - _2.td = function SQc(a) { - tQc(this.a, this.b, BD(a, 46)); - }; - mdb(Pqe, "SplineEdgeRouter/lambda$3$Type", 1457); - bcb(128, 1, { 35: 1, 128: 1 }, YQc, ZQc); - _2.wd = function $Qc(a) { - return WQc(this, BD(a, 128)); - }; - _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; - mdb(Pqe, "SplineSegment", 128); - bcb(459, 1, { 459: 1 }, _Qc); - _2.a = 0; - _2.b = false; - _2.c = false; - _2.d = false; - _2.e = false; - _2.f = 0; - mdb(Pqe, "SplineSegment/EdgeInformation", 459); - bcb(1234, 1, {}, hRc); - mdb(Uqe, hme, 1234); - bcb(1235, 1, Dke, jRc); - _2.ue = function kRc(a, b) { - return iRc(BD(a, 135), BD(b, 135)); - }; - _2.Fb = function lRc(a) { - return this === a; - }; - _2.ve = function mRc() { - return new tpb(this); - }; - mdb(Uqe, ime, 1235); - bcb(1233, 1, {}, tRc); - mdb(Uqe, "MrTree", 1233); - bcb(393, 22, { 3: 1, 35: 1, 22: 1, 393: 1, 246: 1, 234: 1 }, ARc); - _2.Kf = function CRc() { - return zRc(this); - }; - _2.Xf = function BRc() { - return zRc(this); - }; - var uRc, vRc, wRc, xRc; - var h$ = ndb(Uqe, "TreeLayoutPhases", 393, CI, ERc, DRc); - var FRc; - bcb(1130, 209, Mle, HRc); - _2.Ze = function IRc(a, b) { - var c2, d, e, f2, g, h, i3; - Ccb(DD(hkd(a, (JTc(), ATc)))) || $Cb((c2 = new _Cb((Pgd(), new bhd(a))), c2)); - g = (h = new SRc(), tNb(h, a), yNb(h, (mTc(), dTc), a), i3 = new Lqb(), pRc(a, h, i3), oRc(a, h, i3), h); - f2 = gRc(this.a, g); - for (e = new olb(f2); e.a < e.c.c.length; ) { - d = BD(mlb(e), 135); - rRc(this.b, d, Udd(b, 1 / f2.c.length)); - } - g = fRc(f2); - nRc(g); - }; - mdb(Uqe, "TreeLayoutProvider", 1130); - bcb(1847, 1, vie, KRc); - _2.Jc = function LRc(a) { - reb(this, a); - }; - _2.Kc = function MRc() { - return mmb(), Emb(), Dmb; - }; - mdb(Uqe, "TreeUtil/1", 1847); - bcb(1848, 1, vie, NRc); - _2.Jc = function ORc(a) { - reb(this, a); - }; - _2.Kc = function PRc() { - return mmb(), Emb(), Dmb; - }; - mdb(Uqe, "TreeUtil/2", 1848); - bcb(502, 134, { 3: 1, 502: 1, 94: 1, 134: 1 }); - _2.g = 0; - mdb(Vqe, "TGraphElement", 502); - bcb(188, 502, { 3: 1, 188: 1, 502: 1, 94: 1, 134: 1 }, QRc); - _2.Ib = function RRc() { - return !!this.b && !!this.c ? WRc(this.b) + "->" + WRc(this.c) : "e_" + tb(this); - }; - mdb(Vqe, "TEdge", 188); - bcb(135, 134, { 3: 1, 135: 1, 94: 1, 134: 1 }, SRc); - _2.Ib = function TRc() { - var a, b, c2, d, e; - e = null; - for (d = Jsb(this.b, 0); d.b != d.d.c; ) { - c2 = BD(Xsb(d), 86); - e += (c2.c == null || c2.c.length == 0 ? "n_" + c2.g : "n_" + c2.c) + "\n"; - } - for (b = Jsb(this.a, 0); b.b != b.d.c; ) { - a = BD(Xsb(b), 188); - e += (!!a.b && !!a.c ? WRc(a.b) + "->" + WRc(a.c) : "e_" + tb(a)) + "\n"; - } - return e; - }; - var n$ = mdb(Vqe, "TGraph", 135); - bcb(633, 502, { 3: 1, 502: 1, 633: 1, 94: 1, 134: 1 }); - mdb(Vqe, "TShape", 633); - bcb(86, 633, { 3: 1, 502: 1, 86: 1, 633: 1, 94: 1, 134: 1 }, XRc); - _2.Ib = function YRc() { - return WRc(this); - }; - var q$ = mdb(Vqe, "TNode", 86); - bcb(255, 1, vie, ZRc); - _2.Jc = function $Rc(a) { - reb(this, a); - }; - _2.Kc = function _Rc() { - var a; - return a = Jsb(this.a.d, 0), new aSc(a); - }; - mdb(Vqe, "TNode/2", 255); - bcb(358, 1, aie, aSc); - _2.Nb = function bSc(a) { - Rrb(this, a); - }; - _2.Pb = function dSc() { - return BD(Xsb(this.a), 188).c; - }; - _2.Ob = function cSc() { - return Wsb(this.a); - }; - _2.Qb = function eSc() { - Zsb(this.a); - }; - mdb(Vqe, "TNode/2/1", 358); - bcb(1840, 1, ene, hSc); - _2.pf = function jSc(a, b) { - gSc(this, BD(a, 135), b); - }; - mdb(Wqe, "FanProcessor", 1840); - bcb(327, 22, { 3: 1, 35: 1, 22: 1, 327: 1, 234: 1 }, rSc); - _2.Kf = function sSc() { - switch (this.g) { - case 0: - return new QSc(); - case 1: - return new hSc(); - case 2: - return new GSc(); - case 3: - return new zSc(); - case 4: - return new NSc(); - case 5: - return new TSc(); + var d2 = ele.pstyle(opts.name); + switch (d2.strValue) { + case "label": + ele.recalculateRenderedStyle(); + return _p.rstyle[opts.labelName] || 0; default: - throw vbb(new Wdb(Dne + (this.f != null ? this.f : "" + this.g))); + return d2.pfValue; } + } else { + return 1; + } + } + }, "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; + } + } + }, "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 }; - var kSc, lSc, mSc, nSc, oSc, pSc; - var t$ = ndb(Wqe, Ene, 327, CI, uSc, tSc); - var vSc; - bcb(1843, 1, ene, zSc); - _2.pf = function ASc(a, b) { - xSc(this, BD(a, 135), b); - }; - _2.a = 0; - mdb(Wqe, "LevelHeightProcessor", 1843); - bcb(1844, 1, vie, BSc); - _2.Jc = function CSc(a) { - reb(this, a); - }; - _2.Kc = function DSc() { - return mmb(), Emb(), Dmb; - }; - mdb(Wqe, "LevelHeightProcessor/1", 1844); - bcb(1841, 1, ene, GSc); - _2.pf = function HSc(a, b) { - ESc(this, BD(a, 135), b); - }; - _2.a = 0; - mdb(Wqe, "NeighborsProcessor", 1841); - bcb(1842, 1, vie, ISc); - _2.Jc = function JSc(a) { - reb(this, a); - }; - _2.Kc = function KSc() { - return mmb(), Emb(), Dmb; - }; - mdb(Wqe, "NeighborsProcessor/1", 1842); - bcb(1845, 1, ene, NSc); - _2.pf = function OSc(a, b) { - LSc(this, BD(a, 135), b); - }; - _2.a = 0; - mdb(Wqe, "NodePositionProcessor", 1845); - bcb(1839, 1, ene, QSc); - _2.pf = function RSc(a, b) { - PSc(this, BD(a, 135)); - }; - mdb(Wqe, "RootProcessor", 1839); - bcb(1846, 1, ene, TSc); - _2.pf = function USc(a, b) { - SSc(BD(a, 135)); - }; - mdb(Wqe, "Untreeifyer", 1846); - var VSc, WSc, XSc, YSc, ZSc, $Sc, _Sc, aTc, bTc, cTc, dTc, eTc, fTc, gTc, hTc, iTc, jTc, kTc, lTc; - bcb(851, 1, ale, sTc); - _2.Qe = function tTc(a) { - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Zqe), ""), "Weighting of Nodes"), "Which weighting to use when computing a node order."), qTc), (_5c(), V5c)), E$), pqb((N5c(), L5c))))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), $qe), ""), "Search Order"), "Which search order to use when computing a spanning tree."), oTc), V5c), F$), pqb(L5c)))); - KTc((new LTc(), a)); - }; - var nTc, oTc, pTc, qTc; - mdb(_qe, "MrTreeMetaDataProvider", 851); - bcb(994, 1, ale, LTc); - _2.Qe = function MTc(a) { - KTc(a); - }; - var uTc, vTc, wTc, xTc, yTc, zTc, ATc, BTc, CTc, DTc, ETc, FTc, GTc, HTc, ITc; - mdb(_qe, "MrTreeOptions", 994); - bcb(995, 1, {}, NTc); - _2.$e = function OTc() { - var a; - return a = new HRc(), a; - }; - _2._e = function PTc(a) { - }; - mdb(_qe, "MrTreeOptions/MrtreeFactory", 995); - bcb(480, 22, { 3: 1, 35: 1, 22: 1, 480: 1 }, TTc); - var QTc, RTc; - var E$ = ndb(_qe, "OrderWeighting", 480, CI, VTc, UTc); - var WTc; - bcb(425, 22, { 3: 1, 35: 1, 22: 1, 425: 1 }, _Tc); - var YTc, ZTc; - var F$ = ndb(_qe, "TreeifyingOrder", 425, CI, bUc, aUc); - var cUc; - bcb(1459, 1, Bqe, lUc); - _2.Yf = function mUc(a) { - return BD(a, 135), eUc; - }; - _2.pf = function nUc(a, b) { - kUc(this, BD(a, 135), b); - }; - var eUc; - mdb("org.eclipse.elk.alg.mrtree.p1treeify", "DFSTreeifyer", 1459); - bcb(1460, 1, Bqe, sUc); - _2.Yf = function tUc(a) { - return BD(a, 135), oUc; - }; - _2.pf = function uUc(a, b) { - rUc(this, BD(a, 135), b); - }; - var oUc; - mdb("org.eclipse.elk.alg.mrtree.p2order", "NodeOrderer", 1460); - bcb(1461, 1, Bqe, CUc); - _2.Yf = function DUc(a) { - return BD(a, 135), vUc; - }; - _2.pf = function EUc(a, b) { - AUc(this, BD(a, 135), b); - }; - _2.a = 0; - var vUc; - mdb("org.eclipse.elk.alg.mrtree.p3place", "NodePlacer", 1461); - bcb(1462, 1, Bqe, IUc); - _2.Yf = function JUc(a) { - return BD(a, 135), FUc; - }; - _2.pf = function KUc(a, b) { - HUc(BD(a, 135), b); - }; - var FUc; - mdb("org.eclipse.elk.alg.mrtree.p4route", "EdgeRouter", 1462); - var LUc; - bcb(495, 22, { 3: 1, 35: 1, 22: 1, 495: 1, 246: 1, 234: 1 }, RUc); - _2.Kf = function TUc() { - return QUc(this); - }; - _2.Xf = function SUc() { - return QUc(this); - }; - var NUc, OUc; - var K$ = ndb(cre, "RadialLayoutPhases", 495, CI, VUc, UUc); - var WUc; - bcb(1131, 209, Mle, ZUc); - _2.Ze = function $Uc(a, b) { - var c2, d, e, f2, g, h; - c2 = YUc(this, a); - Odd(b, "Radial layout", c2.c.length); - Ccb(DD(hkd(a, (ZWc(), QWc)))) || $Cb((d = new _Cb((Pgd(), new bhd(a))), d)); - h = aVc(a); - jkd(a, (MUc(), LUc), h); - if (!h) { - throw vbb(new Wdb("The given graph is not a tree!")); - } - e = Edb(ED(hkd(a, VWc))); - e == 0 && (e = _Uc(a)); - jkd(a, VWc, e); - for (g = new olb(YUc(this, a)); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 51); - f2.pf(a, Udd(b, 1)); - } - Qdd(b); - }; - mdb(cre, "RadialLayoutProvider", 1131); - bcb(549, 1, Dke, jVc); - _2.ue = function kVc(a, b) { - return iVc(this.a, this.b, BD(a, 33), BD(b, 33)); - }; - _2.Fb = function lVc(a) { - return this === a; - }; - _2.ve = function mVc() { - return new tpb(this); - }; - _2.a = 0; - _2.b = 0; - mdb(cre, "RadialUtil/lambda$0$Type", 549); - bcb(1375, 1, ene, oVc); - _2.pf = function pVc(a, b) { - nVc(BD(a, 33), b); - }; - mdb(fre, "CalculateGraphSize", 1375); - bcb(442, 22, { 3: 1, 35: 1, 22: 1, 442: 1, 234: 1 }, uVc); - _2.Kf = function vVc() { - switch (this.g) { - case 0: - return new bWc(); - case 1: - return new NVc(); - case 2: - return new oVc(); - default: - throw vbb(new Wdb(Dne + (this.f != null ? this.f : "" + this.g))); + } + 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; + } + } + } + }, "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; + } + }, 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); } - }; - var qVc, rVc, sVc; - var O$ = ndb(fre, Ene, 442, CI, xVc, wVc); - var yVc; - bcb(645, 1, {}); - _2.e = 1; - _2.g = 0; - mdb(gre, "AbstractRadiusExtensionCompaction", 645); - bcb(1772, 645, {}, KVc); - _2.hg = function LVc(a) { - var b, c2, d, e, f2, g, h, i3, j; - this.c = BD(hkd(a, (MUc(), LUc)), 33); - EVc(this, this.c); - this.d = tXc(BD(hkd(a, (ZWc(), WWc)), 293)); - i3 = BD(hkd(a, KWc), 19); - !!i3 && DVc(this, i3.a); - h = ED(hkd(a, (Y9c(), T9c))); - FVc(this, (uCb(h), h)); - j = gVc(this.c); - !!this.d && this.d.lg(j); - GVc(this, j); - g = new amb(OC(GC(E2, 1), hre, 33, 0, [this.c])); - for (c2 = 0; c2 < 2; c2++) { - for (b = 0; b < j.c.length; b++) { - e = new amb(OC(GC(E2, 1), hre, 33, 0, [(tCb(b, j.c.length), BD(j.c[b], 33))])); - f2 = b < j.c.length - 1 ? (tCb(b + 1, j.c.length), BD(j.c[b + 1], 33)) : (tCb(0, j.c.length), BD(j.c[0], 33)); - d = b == 0 ? BD(Ikb(j, j.c.length - 1), 33) : (tCb(b - 1, j.c.length), BD(j.c[b - 1], 33)); - IVc(this, (tCb(b, j.c.length), BD(j.c[b], 33), g), d, f2, e); - } + self2.beforeEmit(self2.context, listener, eventObj); + if (listener.conf && listener.conf.one) { + self2.listeners = self2.listeners.filter(function(l2) { + return l2 !== listener; + }); } - }; - mdb(gre, "AnnulusWedgeCompaction", 1772); - bcb(1374, 1, ene, NVc); - _2.pf = function OVc(a, b) { - MVc(BD(a, 33), b); - }; - mdb(gre, "GeneralCompactor", 1374); - bcb(1771, 645, {}, SVc); - _2.hg = function TVc(a) { - var b, c2, d, e; - c2 = BD(hkd(a, (MUc(), LUc)), 33); - this.f = c2; - this.b = tXc(BD(hkd(a, (ZWc(), WWc)), 293)); - e = BD(hkd(a, KWc), 19); - !!e && DVc(this, e.a); - d = ED(hkd(a, (Y9c(), T9c))); - FVc(this, (uCb(d), d)); - b = gVc(c2); - !!this.b && this.b.lg(b); - QVc(this, b); - }; - _2.a = 0; - mdb(gre, "RadialCompaction", 1771); - bcb(1779, 1, {}, VVc); - _2.ig = function WVc(a) { - var b, c2, d, e, f2, g; - this.a = a; - b = 0; - g = gVc(a); - d = 0; - for (f2 = new olb(g); f2.a < f2.c.c.length; ) { - e = BD(mlb(f2), 33); - ++d; - for (c2 = d; c2 < g.c.length; c2++) { - UVc(this, e, (tCb(c2, g.c.length), BD(g.c[c2], 33))) && (b += 1); - } - } - return b; - }; - mdb(ire, "CrossingMinimizationPosition", 1779); - bcb(1777, 1, {}, XVc); - _2.ig = function YVc(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n; - d = 0; - for (c2 = new Sr(ur(_sd(a).a.Kc(), new Sq())); Qr(c2); ) { - b = BD(Rr(c2), 79); - h = atd(BD(qud((!b.c && (b.c = new y5d(z2, b, 5, 8)), b.c), 0), 82)); - 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 d7c(); - l.a = j - e; - l.b = k - f2; - g = new f7c(l.a, l.b); - l6c(g, a.g, a.f); - l.a -= g.a; - l.b -= g.b; - e = j - l.a; - f2 = k - l.b; - i3 = new f7c(l.a, l.b); - l6c(i3, h.g, h.f); - l.a -= i3.a; - l.b -= i3.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; - }; - mdb(ire, "EdgeLengthOptimization", 1777); - bcb(1778, 1, {}, ZVc); - _2.ig = function $Vc(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l; - d = 0; - for (c2 = new Sr(ur(_sd(a).a.Kc(), new Sq())); Qr(c2); ) { - b = BD(Rr(c2), 79); - h = atd(BD(qud((!b.c && (b.c = new y5d(z2, b, 5, 8)), b.c), 0), 82)); - i3 = h.i + h.g / 2; - j = h.j + h.f / 2; - e = BD(hkd(h, (Y9c(), C9c)), 8); - f2 = a.i + e.a + a.g / 2; - g = a.j + e.b + a.f; - k = i3 - f2; - l = j - g; - d += $wnd.Math.sqrt(k * k + l * l); - } - return d; - }; - mdb(ire, "EdgeLengthPositionOptimization", 1778); - bcb(1373, 645, ene, bWc); - _2.pf = function cWc(a, b) { - aWc(this, BD(a, 33), b); - }; - mdb("org.eclipse.elk.alg.radial.intermediate.overlaps", "RadiusExtensionOverlapRemoval", 1373); - bcb(426, 22, { 3: 1, 35: 1, 22: 1, 426: 1 }, hWc); - var dWc, eWc; - var X$ = ndb(kre, "AnnulusWedgeCriteria", 426, CI, jWc, iWc); - var kWc; - bcb(380, 22, { 3: 1, 35: 1, 22: 1, 380: 1 }, rWc); - var mWc, nWc, oWc; - var Y$ = ndb(kre, Sle, 380, CI, tWc, sWc); - var uWc; - bcb(852, 1, ale, IWc); - _2.Qe = function JWc(a) { - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), lre), ""), "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."), meb(0)), (_5c(), X5c)), JI), pqb((N5c(), K5c))))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), mre), ""), "Radius"), "The radius option can be used to set the initial radius for the radial layouter."), 0), U5c), BI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), nre), ""), "Compaction"), "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."), yWc), V5c), Y$), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), ore), ""), "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."), meb(1)), X5c), JI), pqb(L5c)))); - o4c(a, ore, nre, null); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), pre), ""), "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."), EWc), V5c), b_), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), qre), ""), "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."), GWc), V5c), X$), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), rre), ""), "Translation Optimization"), "Find the optimal translation of the nodes of the first radii according to this criteria. For example edge crossings can be minimized."), AWc), V5c), a_), pqb(L5c)))); - $Wc((new _Wc(), a)); - }; - var wWc, xWc, yWc, zWc, AWc, BWc, CWc, DWc, EWc, FWc, GWc; - mdb(kre, "RadialMetaDataProvider", 852); - bcb(996, 1, ale, _Wc); - _2.Qe = function aXc(a) { - $Wc(a); - }; - var KWc, LWc, MWc, NWc, OWc, PWc, QWc, RWc, SWc, TWc, UWc, VWc, WWc, XWc, YWc; - mdb(kre, "RadialOptions", 996); - bcb(997, 1, {}, bXc); - _2.$e = function cXc() { - var a; - return a = new ZUc(), a; - }; - _2._e = function dXc(a) { - }; - mdb(kre, "RadialOptions/RadialFactory", 997); - bcb(340, 22, { 3: 1, 35: 1, 22: 1, 340: 1 }, kXc); - var eXc, fXc, gXc, hXc; - var a_ = ndb(kre, "RadialTranslationStrategy", 340, CI, mXc, lXc); - var nXc; - bcb(293, 22, { 3: 1, 35: 1, 22: 1, 293: 1 }, uXc); - var pXc, qXc, rXc; - var b_ = ndb(kre, "SortingStrategy", 293, CI, wXc, vXc); - var xXc; - bcb(1449, 1, Bqe, CXc); - _2.Yf = function DXc(a) { - return BD(a, 33), null; - }; - _2.pf = function EXc(a, b) { - AXc(this, BD(a, 33), b); - }; - _2.c = 0; - mdb("org.eclipse.elk.alg.radial.p1position", "EadesRadial", 1449); - bcb(1775, 1, {}, FXc); - _2.jg = function GXc(a) { - return eVc(a); - }; - mdb(tre, "AnnulusWedgeByLeafs", 1775); - bcb(1776, 1, {}, IXc); - _2.jg = function JXc(a) { - return HXc(this, a); - }; - mdb(tre, "AnnulusWedgeByNodeSpace", 1776); - bcb(1450, 1, Bqe, MXc); - _2.Yf = function NXc(a) { - return BD(a, 33), null; - }; - _2.pf = function OXc(a, b) { - KXc(this, BD(a, 33), b); - }; - mdb("org.eclipse.elk.alg.radial.p2routing", "StraightLineEdgeRouter", 1450); - bcb(811, 1, {}, QXc); - _2.kg = function RXc(a) { - }; - _2.lg = function TXc(a) { - PXc(this, a); - }; - mdb(ure, "IDSorter", 811); - bcb(1774, 1, Dke, UXc); - _2.ue = function VXc(a, b) { - return SXc(BD(a, 33), BD(b, 33)); - }; - _2.Fb = function WXc(a) { - return this === a; - }; - _2.ve = function XXc() { - return new tpb(this); - }; - mdb(ure, "IDSorter/lambda$0$Type", 1774); - bcb(1773, 1, {}, $Xc); - _2.kg = function _Xc(a) { - YXc(this, a); - }; - _2.lg = function aYc(a) { - var b; - if (!a.dc()) { - if (!this.e) { - b = bVc(BD(a.Xb(0), 33)); - YXc(this, b); - } - PXc(this.e, a); + 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(); } - }; - mdb(ure, "PolarCoordinateSorter", 1773); - bcb(1136, 209, Mle, bYc); - _2.Ze = function eYc(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B, C, D3, F; - Odd(b, "Rectangle Packing", 1); - b.n && b.n && !!a && Tdd(b, i6d(a), (pgd(), mgd)); - c2 = Edb(ED(hkd(a, (lZc(), RYc)))); - p = BD(hkd(a, eZc), 381); - s = Ccb(DD(hkd(a, ZYc))); - w2 = Ccb(DD(hkd(a, dZc))); - l = Ccb(DD(hkd(a, VYc))); - A = BD(hkd(a, fZc), 116); - v = Edb(ED(hkd(a, jZc))); - e = Ccb(DD(hkd(a, iZc))); - m = Ccb(DD(hkd(a, WYc))); - r = Ccb(DD(hkd(a, XYc))); - F = Edb(ED(hkd(a, kZc))); - C = (!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a); - r$c(C); - if (r) { - o2 = new Rkb(); - for (i3 = new Fyd(C); i3.e != i3.i.gc(); ) { - g = BD(Dyd(i3), 33); - ikd(g, UYc) && (o2.c[o2.c.length] = g, true); - } - for (j = new olb(o2); j.a < j.c.c.length; ) { - g = BD(mlb(j), 33); - Ftd(C, g); - } - mmb(); - Okb(o2, new fYc()); - for (k = new olb(o2); k.a < k.c.c.length; ) { - g = BD(mlb(k), 33); - B = BD(hkd(g, UYc), 19).a; - B = $wnd.Math.min(B, C.i); - vtd(C, B, g); - } - q = 0; - for (h = new Fyd(C); h.e != h.i.gc(); ) { - g = BD(Dyd(h), 33); - jkd(g, TYc, meb(q)); - ++q; - } - } - u2 = rfd(a); - u2.a -= A.b + A.c; - u2.b -= A.d + A.a; - t4 = u2.a; - if (F < 0 || F < u2.a) { - n = new nYc(c2, p, s); - f2 = jYc(n, C, v, A); - b.n && b.n && !!a && Tdd(b, i6d(a), (pgd(), mgd)); - } else { - f2 = new d$c(c2, F, 0, (k$c(), j$c)); - } - u2.a += A.b + A.c; - u2.b += A.d + A.a; - if (!w2) { - r$c(C); - D3 = new DZc(c2, l, m, e, v); - t4 = $wnd.Math.max(u2.a, f2.c); - f2 = CZc(D3, C, t4, u2, b, a, A); - } - cYc(C, A); - Afd(a, f2.c + (A.b + A.c), f2.b + (A.d + A.a), false, true); - Ccb(DD(hkd(a, cZc))) || $Cb((d = new _Cb((Pgd(), new bhd(a))), d)); - b.n && b.n && !!a && Tdd(b, i6d(a), (pgd(), mgd)); - Qdd(b); - }; - mdb(yre, "RectPackingLayoutProvider", 1136); - bcb(1137, 1, Dke, fYc); - _2.ue = function gYc(a, b) { - return dYc(BD(a, 33), BD(b, 33)); - }; - _2.Fb = function hYc(a) { - return this === a; - }; - _2.ve = function iYc() { - return new tpb(this); - }; - mdb(yre, "RectPackingLayoutProvider/lambda$0$Type", 1137); - bcb(1256, 1, {}, nYc); - _2.a = 0; - _2.c = false; - mdb(zre, "AreaApproximation", 1256); - var o_ = odb(zre, "BestCandidateFilter"); - bcb(638, 1, { 526: 1 }, oYc); - _2.mg = function pYc(a, b, c2) { - var d, e, f2, g, h, i3; - i3 = new Rkb(); - f2 = Pje; - for (h = new olb(a); h.a < h.c.c.length; ) { - g = BD(mlb(h), 220); - f2 = $wnd.Math.min(f2, (g.c + (c2.b + c2.c)) * (g.b + (c2.d + c2.a))); - } - for (e = new olb(a); e.a < e.c.c.length; ) { - d = BD(mlb(e), 220); - (d.c + (c2.b + c2.c)) * (d.b + (c2.d + c2.a)) == f2 && (i3.c[i3.c.length] = d, true); - } - return i3; - }; - mdb(zre, "AreaFilter", 638); - bcb(639, 1, { 526: 1 }, qYc); - _2.mg = function rYc(a, b, c2) { - var d, e, f2, g, h, i3; - h = new Rkb(); - i3 = Pje; - for (g = new olb(a); g.a < g.c.c.length; ) { - f2 = BD(mlb(g), 220); - i3 = $wnd.Math.min(i3, $wnd.Math.abs((f2.c + (c2.b + c2.c)) / (f2.b + (c2.d + c2.a)) - b)); - } - for (e = new olb(a); e.a < e.c.c.length; ) { - d = BD(mlb(e), 220); - $wnd.Math.abs((d.c + (c2.b + c2.c)) / (d.b + (c2.d + c2.a)) - b) == i3 && (h.c[h.c.length] = d, true); - } - return h; - }; - mdb(zre, "AspectRatioFilter", 639); - bcb(637, 1, { 526: 1 }, uYc); - _2.mg = function vYc(a, b, c2) { - var d, e, f2, g, h, i3; - i3 = new Rkb(); - f2 = Qje; - for (h = new olb(a); h.a < h.c.c.length; ) { - g = BD(mlb(h), 220); - f2 = $wnd.Math.max(f2, q$c(g.c + (c2.b + c2.c), g.b + (c2.d + c2.a), g.a)); - } - for (e = new olb(a); e.a < e.c.c.length; ) { - d = BD(mlb(e), 220); - q$c(d.c + (c2.b + c2.c), d.b + (c2.d + c2.a), d.a) == f2 && (i3.c[i3.c.length] = d, true); - } - return i3; - }; - mdb(zre, "ScaleMeasureFilter", 637); - bcb(381, 22, { 3: 1, 35: 1, 22: 1, 381: 1 }, AYc); - var wYc, xYc, yYc; - var q_ = ndb(Are, "OptimizationGoal", 381, CI, CYc, BYc); - var DYc; - bcb(856, 1, ale, PYc); - _2.Qe = function QYc(a) { - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Bre), ""), "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."), LYc), (_5c(), V5c)), q_), pqb((N5c(), K5c))))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Cre), ""), "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."), (Bcb(), true)), T5c), wI), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Dre), ""), "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."), meb(-1)), X5c), JI), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Ere), ""), "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."), meb(-1)), X5c), JI), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Fre), ""), "Only Area Approximation"), "If enabled only the width approximation step is executed and the nodes are placed accordingly. The nodes are layouted according to the packingStrategy. If set to true not expansion of nodes is taking place."), false), T5c), wI), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Gre), ""), "Compact Rows"), "Enables compaction. Compacts blocks if they do not use the full height of the row. This option allows to have a smaller drawing. If this option is disabled all nodes are placed next to each other in rows."), true), T5c), wI), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Hre), ""), "Fit Aspect Ratio"), "Expands nodes if expandNodes is true to fit the aspect ratio instead of only in their bounds. The option is only useful if the used packingStrategy is ASPECT_RATIO_DRIVEN, otherwise this may result in unreasonable ndoe expansion."), false), T5c), wI), pqb(K5c)))); - o4c(a, Hre, Jre, null); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Ire), ""), "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), U5c), BI), pqb(K5c)))); - mZc((new nZc(), a)); - }; - var FYc, GYc, HYc, IYc, JYc, KYc, LYc, MYc, NYc; - mdb(Are, "RectPackingMetaDataProvider", 856); - bcb(1004, 1, ale, nZc); - _2.Qe = function oZc(a) { - mZc(a); - }; - var RYc, SYc, TYc, UYc, VYc, WYc, XYc, YYc, ZYc, $Yc, _Yc, aZc, bZc, cZc, dZc, eZc, fZc, gZc, hZc, iZc, jZc, kZc; - mdb(Are, "RectPackingOptions", 1004); - bcb(1005, 1, {}, pZc); - _2.$e = function qZc() { - var a; - return a = new bYc(), a; - }; - _2._e = function rZc(a) { - }; - mdb(Are, "RectPackingOptions/RectpackingFactory", 1005); - bcb(1257, 1, {}, DZc); - _2.a = 0; - _2.b = false; - _2.c = 0; - _2.d = 0; - _2.e = false; - _2.f = false; - _2.g = 0; - mdb("org.eclipse.elk.alg.rectpacking.seconditeration", "RowFillingAndCompaction", 1257); - bcb(187, 1, { 187: 1 }, PZc); - _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 = Pje; - _2.p = Pje; - _2.r = 0; - _2.s = 0; - _2.t = 0; - mdb(Lre, "Block", 187); - bcb(211, 1, { 211: 1 }, VZc); - _2.a = 0; - _2.b = 0; - _2.d = 0; - _2.e = 0; - _2.f = 0; - mdb(Lre, "BlockRow", 211); - bcb(443, 1, { 443: 1 }, b$c); - _2.b = 0; - _2.c = 0; - _2.d = 0; - _2.e = 0; - _2.f = 0; - mdb(Lre, "BlockStack", 443); - bcb(220, 1, { 220: 1 }, d$c, e$c); - _2.a = 0; - _2.b = 0; - _2.c = 0; - _2.d = 0; - _2.e = 0; - var z_ = mdb(Lre, "DrawingData", 220); - bcb(355, 22, { 3: 1, 35: 1, 22: 1, 355: 1 }, l$c); - var f$c, g$c, h$c, i$c, j$c; - var y_ = ndb(Lre, "DrawingDataDescriptor", 355, CI, n$c, m$c); - var o$c; - bcb(200, 1, { 200: 1 }, x$c); - _2.b = 0; - _2.c = 0; - _2.e = 0; - _2.f = 0; - mdb(Lre, "RectRow", 200); - bcb(756, 1, {}, F$c); - _2.j = 0; - mdb(Nre, une, 756); - bcb(1245, 1, {}, G$c); - _2.Je = function H$c(a) { - return S6c(a.a, a.b); - }; - mdb(Nre, vne, 1245); - bcb(1246, 1, {}, I$c); - _2.Je = function J$c(a) { - return A$c(this.a, a); - }; - mdb(Nre, wne, 1246); - bcb(1247, 1, {}, K$c); - _2.Je = function L$c(a) { - return B$c(this.a, a); - }; - mdb(Nre, xne, 1247); - bcb(1248, 1, {}, M$c); - _2.Je = function N$c(a) { - return C$c(this.a, a); - }; - mdb(Nre, "ElkGraphImporter/lambda$3$Type", 1248); - bcb(1249, 1, {}, O$c); - _2.Je = function P$c(a) { - return D$c(this.a, a); - }; - mdb(Nre, yne, 1249); - bcb(1133, 209, Mle, Q$c); - _2.Ze = function S$c(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n; - if (ikd(a, (d0c(), c0c))) { - n = GD(hkd(a, (J0c(), I0c))); - f2 = h4c(n4c(), n); - if (f2) { - g = BD(hgd(f2.f), 209); - g.Ze(a, Udd(b, 1)); - } - } - jkd(a, Z_c, (C_c(), A_c)); - jkd(a, $_c, (N_c(), K_c)); - jkd(a, __c, (a1c(), _0c)); - h = BD(hkd(a, (J0c(), E0c)), 19).a; - Odd(b, "Overlap removal", 1); - Ccb(DD(hkd(a, D0c))) && "null45scanlineOverlaps"; - i3 = new Tqb(); - j = new U$c(i3); - d = new F$c(); - c2 = z$c(d, a); - k = true; - e = 0; - while (e < h && k) { - if (Ccb(DD(hkd(a, F0c)))) { - i3.a.$b(); - cOb(new dOb(j), c2.i); - if (i3.a.gc() == 0) { - break; - } - c2.e = i3; - } - H2c(this.b); - K2c(this.b, (Y$c(), V$c), (R0c(), Q0c)); - K2c(this.b, W$c, c2.g); - K2c(this.b, X$c, (s_c(), r_c)); - this.a = F2c(this.b, c2); - for (m = new olb(this.a); m.a < m.c.c.length; ) { - l = BD(mlb(m), 51); - l.pf(c2, Udd(b, 1)); - } - E$c(d, c2); - k = Ccb(DD(vNb(c2, (XNb(), WNb)))); - ++e; - } - y$c(d, c2); - Qdd(b); - }; - mdb(Nre, "OverlapRemovalLayoutProvider", 1133); - bcb(1134, 1, {}, U$c); - mdb(Nre, "OverlapRemovalLayoutProvider/lambda$0$Type", 1134); - bcb(437, 22, { 3: 1, 35: 1, 22: 1, 437: 1 }, Z$c); - var V$c, W$c, X$c; - var J_ = ndb(Nre, "SPOrEPhases", 437, CI, _$c, $$c); - var a_c; - bcb(1255, 1, {}, d_c); - mdb(Nre, "ShrinkTree", 1255); - bcb(1135, 209, Mle, e_c); - _2.Ze = function f_c(a, b) { - var c2, d, e, f2, g; - if (ikd(a, (d0c(), c0c))) { - g = GD(hkd(a, c0c)); - e = h4c(n4c(), g); - if (e) { - f2 = BD(hgd(e.f), 209); - f2.Ze(a, Udd(b, 1)); - } - } - d = new F$c(); - c2 = z$c(d, a); - c_c(this.a, c2, Udd(b, 1)); - y$c(d, c2); - }; - mdb(Nre, "ShrinkTreeLayoutProvider", 1135); - bcb(300, 134, { 3: 1, 300: 1, 94: 1, 134: 1 }, g_c); - _2.c = false; - mdb("org.eclipse.elk.alg.spore.graph", "Graph", 300); - bcb(482, 22, { 3: 1, 35: 1, 22: 1, 482: 1, 246: 1, 234: 1 }, k_c); - _2.Kf = function m_c() { - return j_c(this); - }; - _2.Xf = function l_c() { - return j_c(this); - }; - var h_c; - var N_ = ndb(Ore, Sle, 482, CI, o_c, n_c); - var p_c; - bcb(551, 22, { 3: 1, 35: 1, 22: 1, 551: 1, 246: 1, 234: 1 }, t_c); - _2.Kf = function v_c() { - return new I1c(); - }; - _2.Xf = function u_c() { - return new I1c(); - }; - var r_c; - var O_ = ndb(Ore, "OverlapRemovalStrategy", 551, CI, x_c, w_c); - var y_c; - bcb(430, 22, { 3: 1, 35: 1, 22: 1, 430: 1 }, D_c); - var A_c, B_c; - var P_ = ndb(Ore, "RootSelection", 430, CI, F_c, E_c); - var G_c; - bcb(316, 22, { 3: 1, 35: 1, 22: 1, 316: 1 }, O_c); - var I_c, J_c, K_c, L_c, M_c; - var Q_ = ndb(Ore, "SpanningTreeCostFunction", 316, CI, Q_c, P_c); - var R_c; - bcb(1002, 1, ale, f0c); - _2.Qe = function g0c(a) { - e0c(a); - }; - var T_c, U_c, V_c, W_c, X_c, Y_c, Z_c, $_c, __c, a0c, b0c, c0c; - mdb(Ore, "SporeCompactionOptions", 1002); - bcb(1003, 1, {}, h0c); - _2.$e = function i0c() { - var a; - return a = new e_c(), a; - }; - _2._e = function j0c(a) { - }; - mdb(Ore, "SporeCompactionOptions/SporeCompactionFactory", 1003); - bcb(855, 1, ale, B0c); - _2.Qe = function C0c(a) { - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), Qre), ""), "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."), (_5c(), Z5c)), ZI), pqb((N5c(), L5c))))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Vre), "structure"), "Structure Extraction Strategy"), "This option defines what kind of triangulation or other partitioning of the plane is applied to the vertices."), y0c), V5c), W_), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Rre), $re), "Tree Construction Strategy"), "Whether a minimum spanning tree or a maximum spanning tree should be constructed."), w0c), V5c), X_), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Sre), $re), "Cost Function for Spanning Tree"), "The cost function is used in the creation of the spanning tree."), u0c), V5c), Q_), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Tre), $re), "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), Z5c), ZI), pqb(L5c)))); - o4c(a, Tre, Ure, q0c); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Ure), $re), "Root selection for spanning tree"), "This sets the method used to select a root node for the construction of a spanning tree"), s0c), V5c), P_), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Wre), Bpe), "Compaction Strategy"), "This option defines how the compaction is applied."), l0c), V5c), N_), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Xre), Bpe), "Orthogonal Compaction"), "Restricts the translation of nodes to orthogonal directions in the compaction phase."), (Bcb(), false)), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Yre), _re), "Upper limit for iterations of overlap removal"), null), meb(64)), X5c), JI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Zre), _re), "Whether to run a supplementary scanline overlap check."), null), true), T5c), wI), pqb(L5c)))); - K0c((new L0c(), a)); - e0c((new f0c(), a)); - }; - var k0c, l0c, m0c, n0c, o0c, p0c, q0c, r0c, s0c, t0c, u0c, v0c, w0c, x0c, y0c, z0c; - mdb(Ore, "SporeMetaDataProvider", 855); - bcb(_ie, 1, ale, L0c); - _2.Qe = function M0c(a) { - K0c(a); - }; - var D0c, E0c, F0c, G0c, H0c, I0c; - mdb(Ore, "SporeOverlapRemovalOptions", _ie); - bcb(1001, 1, {}, N0c); - _2.$e = function O0c() { - var a; - return a = new Q$c(), a; - }; - _2._e = function P0c(a) { - }; - mdb(Ore, "SporeOverlapRemovalOptions/SporeOverlapFactory", 1001); - bcb(530, 22, { 3: 1, 35: 1, 22: 1, 530: 1, 246: 1, 234: 1 }, T0c); - _2.Kf = function V0c() { - return S0c(this); - }; - _2.Xf = function U0c() { - return S0c(this); - }; - var Q0c; - var W_ = ndb(Ore, "StructureExtractionStrategy", 530, CI, X0c, W0c); - var Y0c; - bcb(429, 22, { 3: 1, 35: 1, 22: 1, 429: 1, 246: 1, 234: 1 }, c1c); - _2.Kf = function e1c() { - return b1c(this); - }; - _2.Xf = function d1c() { - return b1c(this); - }; - var $0c, _0c; - var X_ = ndb(Ore, "TreeConstructionStrategy", 429, CI, g1c, f1c); - var h1c; - bcb(1443, 1, Bqe, k1c); - _2.Yf = function l1c(a) { - return BD(a, 300), new j3c(); - }; - _2.pf = function m1c(a, b) { - j1c(BD(a, 300), b); - }; - mdb(bse, "DelaunayTriangulationPhase", 1443); - bcb(1444, 1, qie, n1c); - _2.td = function o1c(a) { - Ekb(this.a, BD(a, 65).a); - }; - mdb(bse, "DelaunayTriangulationPhase/lambda$0$Type", 1444); - bcb(783, 1, Bqe, s1c); - _2.Yf = function t1c(a) { - return BD(a, 300), new j3c(); - }; - _2.pf = function u1c(a, b) { - this.ng(BD(a, 300), b); - }; - _2.ng = function v1c(a, b) { - var c2, d, e; - Odd(b, "Minimum spanning tree construction", 1); - a.d ? d = a.d.a : d = BD(Ikb(a.i, 0), 65).a; - Ccb(DD(vNb(a, (XNb(), VNb)))) ? e = UCb(a.e, d, (c2 = a.b, c2)) : e = UCb(a.e, d, a.b); - q1c(this, e, a); - Qdd(b); - }; - mdb(cse, "MinSTPhase", 783); - bcb(1446, 783, Bqe, w1c); - _2.ng = function y1c(a, b) { - var c2, d, e, f2; - Odd(b, "Maximum spanning tree construction", 1); - c2 = new z1c(a); - a.d ? e = a.d.c : e = BD(Ikb(a.i, 0), 65).c; - Ccb(DD(vNb(a, (XNb(), VNb)))) ? f2 = UCb(a.e, e, (d = c2, d)) : f2 = UCb(a.e, e, c2); - q1c(this, f2, a); - Qdd(b); - }; - mdb(cse, "MaxSTPhase", 1446); - bcb(1447, 1, {}, z1c); - _2.Je = function A1c(a) { - return x1c(this.a, a); - }; - mdb(cse, "MaxSTPhase/lambda$0$Type", 1447); - bcb(1445, 1, qie, B1c); - _2.td = function C1c(a) { - r1c(this.a, BD(a, 65)); - }; - mdb(cse, "MinSTPhase/lambda$0$Type", 1445); - bcb(785, 1, Bqe, I1c); - _2.Yf = function J1c(a) { - return BD(a, 300), new j3c(); - }; - _2.pf = function K1c(a, b) { - H1c(this, BD(a, 300), b); - }; - _2.a = false; - mdb(dse, "GrowTreePhase", 785); - bcb(786, 1, qie, L1c); - _2.td = function M1c(a) { - G1c(this.a, this.b, this.c, BD(a, 221)); - }; - mdb(dse, "GrowTreePhase/lambda$0$Type", 786); - bcb(1448, 1, Bqe, Q1c); - _2.Yf = function R1c(a) { - return BD(a, 300), new j3c(); - }; - _2.pf = function S1c(a, b) { - P1c(this, BD(a, 300), b); - }; - mdb(dse, "ShrinkTreeCompactionPhase", 1448); - bcb(784, 1, qie, T1c); - _2.td = function U1c(a) { - O1c(this.a, this.b, this.c, BD(a, 221)); - }; - mdb(dse, "ShrinkTreeCompactionPhase/lambda$0$Type", 784); - var g2 = odb(yqe, "IGraphElementVisitor"); - bcb(860, 1, { 527: 1 }, b2c); - _2.og = function e2c(a) { - var b; - b = a2c(this, a); - tNb(b, BD(Ohb(this.b, a), 94)); - $1c(this, a, b); - }; - var V1c, W1c; - mdb(Nle, "LayoutConfigurator", 860); - var h0 = odb(Nle, "LayoutConfigurator/IPropertyHolderOptionFilter"); - bcb(932, 1, { 1933: 1 }, f2c); - _2.pg = function g2c(a, b) { - return Y1c(), !a.Xe(b); - }; - mdb(Nle, "LayoutConfigurator/lambda$0$Type", 932); - bcb(933, 1, { 1933: 1 }, i2c); - _2.pg = function j2c(a, b) { - return h2c(a, b); - }; - mdb(Nle, "LayoutConfigurator/lambda$1$Type", 933); - bcb(931, 1, { 831: 1 }, k2c); - _2.qg = function l2c(a, b) { - return Y1c(), !a.Xe(b); - }; - mdb(Nle, "LayoutConfigurator/lambda$2$Type", 931); - bcb(934, 1, Oie, m2c); - _2.Mb = function n2c(a) { - return d2c(this.a, this.b, BD(a, 1933)); - }; - mdb(Nle, "LayoutConfigurator/lambda$3$Type", 934); - bcb(858, 1, {}, w2c); - mdb(Nle, "RecursiveGraphLayoutEngine", 858); - bcb(296, 60, Tie, x2c, y2c); - mdb(Nle, "UnsupportedConfigurationException", 296); - bcb(453, 60, Tie, z2c); - mdb(Nle, "UnsupportedGraphException", 453); - bcb(754, 1, {}); - mdb(yqe, "AbstractRandomListAccessor", 754); - bcb(500, 754, {}, L2c); - _2.rg = function N2c() { - return null; - }; - _2.d = true; - _2.e = true; - _2.f = 0; - mdb(fse, "AlgorithmAssembler", 500); - bcb(1236, 1, Oie, O2c); - _2.Mb = function P2c(a) { - return !!BD(a, 123); - }; - mdb(fse, "AlgorithmAssembler/lambda$0$Type", 1236); - bcb(1237, 1, {}, Q2c); - _2.Kb = function R2c(a) { - return M2c(this.a, BD(a, 123)); - }; - mdb(fse, "AlgorithmAssembler/lambda$1$Type", 1237); - bcb(1238, 1, Oie, S2c); - _2.Mb = function T2c(a) { - return !!BD(a, 80); - }; - mdb(fse, "AlgorithmAssembler/lambda$2$Type", 1238); - bcb(1239, 1, qie, U2c); - _2.td = function V2c(a) { - d3c(this.a, BD(a, 80)); - }; - mdb(fse, "AlgorithmAssembler/lambda$3$Type", 1239); - bcb(1240, 1, qie, W2c); - _2.td = function X2c(a) { - G2c(this.a, this.b, BD(a, 234)); - }; - mdb(fse, "AlgorithmAssembler/lambda$4$Type", 1240); - bcb(1355, 1, Dke, Z2c); - _2.ue = function $2c(a, b) { - return Y2c(BD(a, 234), BD(b, 234)); - }; - _2.Fb = function _2c(a) { - return this === a; - }; - _2.ve = function a3c() { - return new tpb(this); - }; - mdb(fse, "EnumBasedFactoryComparator", 1355); - bcb(80, 754, { 80: 1 }, j3c); - _2.rg = function l3c() { - return new Tqb(); - }; - _2.a = 0; - mdb(fse, "LayoutProcessorConfiguration", 80); - bcb(1013, 1, { 527: 1 }, q3c); - _2.og = function u3c(a) { - stb(n3c, new z3c(a)); - }; - var m3c, n3c, o3c; - mdb(Xke, "DeprecatedLayoutOptionReplacer", 1013); - bcb(1014, 1, qie, v3c); - _2.td = function w3c(a) { - r3c(BD(a, 160)); - }; - mdb(Xke, "DeprecatedLayoutOptionReplacer/lambda$0$Type", 1014); - bcb(1015, 1, qie, x3c); - _2.td = function y3c(a) { - s3c(BD(a, 160)); - }; - mdb(Xke, "DeprecatedLayoutOptionReplacer/lambda$1$Type", 1015); - bcb(1016, 1, {}, z3c); - _2.Od = function A3c(a, b) { - t3c(this.a, BD(a, 146), BD(b, 38)); - }; - mdb(Xke, "DeprecatedLayoutOptionReplacer/lambda$2$Type", 1016); - bcb(149, 1, { 686: 1, 149: 1 }, E3c); - _2.Fb = function F3c(a) { - return C3c(this, a); - }; - _2.sg = function G3c() { - return this.b; - }; - _2.tg = function H3c() { - return this.c; - }; - _2.ne = function I3c() { - return this.e; - }; - _2.Hb = function J3c() { - return LCb(this.c); - }; - _2.Ib = function K3c() { - return "Layout Algorithm: " + this.c; - }; - var E0 = mdb(Xke, "LayoutAlgorithmData", 149); - bcb(263, 1, {}, R3c); - mdb(Xke, "LayoutAlgorithmData/Builder", 263); - bcb(1017, 1, { 527: 1 }, U3c); - _2.og = function V3c(a) { - JD(a, 239) && !Ccb(DD(a.We((Y9c(), d9c)))) && S3c(BD(a, 33)); - }; - mdb(Xke, "LayoutAlgorithmResolver", 1017); - bcb(229, 1, { 686: 1, 229: 1 }, W3c); - _2.Fb = function X3c(a) { - if (JD(a, 229)) { - return dfb(this.b, BD(a, 229).b); - } - return false; - }; - _2.sg = function Y3c() { - return this.a; - }; - _2.tg = function Z3c() { - return this.b; - }; - _2.ne = function $3c() { - return this.d; - }; - _2.Hb = function _3c() { - return LCb(this.b); - }; - _2.Ib = function a4c() { - return "Layout Type: " + this.b; - }; - mdb(Xke, "LayoutCategoryData", 229); - bcb(344, 1, {}, e4c); - mdb(Xke, "LayoutCategoryData/Builder", 344); - bcb(867, 1, {}, m4c); - var f4c; - mdb(Xke, "LayoutMetaDataService", 867); - bcb(868, 1, {}, v4c); - mdb(Xke, "LayoutMetaDataService/Registry", 868); - bcb(478, 1, { 478: 1 }, w4c); - mdb(Xke, "LayoutMetaDataService/Registry/Triple", 478); - bcb(869, 1, gse, x4c); - _2.ug = function y4c() { - return new d7c(); - }; - mdb(Xke, "LayoutMetaDataService/lambda$0$Type", 869); - bcb(870, 1, hse, z4c); - _2.vg = function A4c(a) { - return R6c(BD(a, 8)); - }; - mdb(Xke, "LayoutMetaDataService/lambda$1$Type", 870); - bcb(879, 1, gse, B4c); - _2.ug = function C4c() { - return new Rkb(); - }; - mdb(Xke, "LayoutMetaDataService/lambda$10$Type", 879); - bcb(880, 1, hse, D4c); - _2.vg = function E4c(a) { - return new Tkb(BD(a, 12)); - }; - mdb(Xke, "LayoutMetaDataService/lambda$11$Type", 880); - bcb(881, 1, gse, F4c); - _2.ug = function G4c() { - return new Psb(); - }; - mdb(Xke, "LayoutMetaDataService/lambda$12$Type", 881); - bcb(882, 1, hse, H4c); - _2.vg = function I4c(a) { - return Ru(BD(a, 68)); - }; - mdb(Xke, "LayoutMetaDataService/lambda$13$Type", 882); - bcb(883, 1, gse, J4c); - _2.ug = function K4c() { - return new Tqb(); - }; - mdb(Xke, "LayoutMetaDataService/lambda$14$Type", 883); - bcb(884, 1, hse, L4c); - _2.vg = function M4c(a) { - return Dx(BD(a, 53)); - }; - mdb(Xke, "LayoutMetaDataService/lambda$15$Type", 884); - bcb(885, 1, gse, N4c); - _2.ug = function O4c() { - return new zsb(); - }; - mdb(Xke, "LayoutMetaDataService/lambda$16$Type", 885); - bcb(886, 1, hse, P4c); - _2.vg = function Q4c(a) { - return Gx(BD(a, 53)); - }; - mdb(Xke, "LayoutMetaDataService/lambda$17$Type", 886); - bcb(887, 1, gse, R4c); - _2.ug = function S4c() { - return new Gxb(); - }; - mdb(Xke, "LayoutMetaDataService/lambda$18$Type", 887); - bcb(888, 1, hse, T4c); - _2.vg = function U4c(a) { - return Hx(BD(a, 208)); - }; - mdb(Xke, "LayoutMetaDataService/lambda$19$Type", 888); - bcb(871, 1, gse, V4c); - _2.ug = function W4c() { - return new s7c(); - }; - mdb(Xke, "LayoutMetaDataService/lambda$2$Type", 871); - bcb(872, 1, hse, X4c); - _2.vg = function Y4c(a) { - return new t7c(BD(a, 74)); - }; - mdb(Xke, "LayoutMetaDataService/lambda$3$Type", 872); - bcb(873, 1, gse, Z4c); - _2.ug = function $4c() { - return new H_b(); - }; - mdb(Xke, "LayoutMetaDataService/lambda$4$Type", 873); - bcb(874, 1, hse, _4c); - _2.vg = function a5c(a) { - return new K_b(BD(a, 142)); - }; - mdb(Xke, "LayoutMetaDataService/lambda$5$Type", 874); - bcb(875, 1, gse, b5c); - _2.ug = function c5c() { - return new p0b(); - }; - mdb(Xke, "LayoutMetaDataService/lambda$6$Type", 875); - bcb(876, 1, hse, d5c); - _2.vg = function e5c(a) { - return new r0b(BD(a, 116)); - }; - mdb(Xke, "LayoutMetaDataService/lambda$7$Type", 876); - bcb(877, 1, gse, f5c); - _2.ug = function g5c() { - return new _fd(); - }; - mdb(Xke, "LayoutMetaDataService/lambda$8$Type", 877); - bcb(878, 1, hse, h5c); - _2.vg = function i5c(a) { - return new agd(BD(a, 373)); - }; - mdb(Xke, "LayoutMetaDataService/lambda$9$Type", 878); - var Q3 = odb(Hle, "IProperty"); - bcb(23, 1, { 35: 1, 686: 1, 23: 1, 146: 1 }, p5c); - _2.wd = function q5c(a) { - return k5c(this, BD(a, 146)); - }; - _2.Fb = function r5c(a) { - return JD(a, 23) ? dfb(this.f, BD(a, 23).f) : JD(a, 146) && dfb(this.f, BD(a, 146).tg()); - }; - _2.wg = function s5c() { - var a; - if (JD(this.b, 4)) { - a = fvd(this.b); - if (a == null) { - throw vbb(new Zdb(mse + this.f + "'. Make sure it's type is registered with the " + (fdb(Y3), Y3.k) + jse)); - } - return a; - } else { - return this.b; - } - }; - _2.sg = function t5c() { - return this.d; - }; - _2.tg = function u5c() { - return this.f; - }; - _2.ne = function v5c() { - return this.i; - }; - _2.Hb = function w5c() { - return LCb(this.f); - }; - _2.Ib = function x5c() { - return "Layout Option: " + this.f; - }; - mdb(Xke, "LayoutOptionData", 23); - bcb(24, 1, {}, H5c); - mdb(Xke, "LayoutOptionData/Builder", 24); - bcb(175, 22, { 3: 1, 35: 1, 22: 1, 175: 1 }, O5c); - var I5c, J5c, K5c, L5c, M5c; - var e1 = ndb(Xke, "LayoutOptionData/Target", 175, CI, Q5c, P5c); - var R5c; - bcb(277, 22, { 3: 1, 35: 1, 22: 1, 277: 1 }, a6c); - var T5c, U5c, V5c, W5c, X5c, Y5c, Z5c, $5c; - var f1 = ndb(Xke, "LayoutOptionData/Type", 277, CI, c6c, b6c); - var d6c; - var f6c; - var h6c; - bcb(110, 1, { 110: 1 }, I6c, J6c, K6c); - _2.Fb = function L6c(a) { - var b; - if (a == null || !JD(a, 110)) { - return false; - } - b = BD(a, 110); - return wtb(this.c, b.c) && wtb(this.d, b.d) && wtb(this.b, b.b) && wtb(this.a, b.a); - }; - _2.Hb = function M6c() { - return Hlb(OC(GC(SI, 1), Uhe, 1, 5, [this.c, this.d, this.b, this.a])); - }; - _2.Ib = function N6c() { - 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; - mdb(pne, "ElkRectangle", 110); - bcb(8, 1, { 3: 1, 4: 1, 8: 1, 414: 1 }, d7c, e7c, f7c, g7c); - _2.Fb = function h7c(a) { - return T6c(this, a); - }; - _2.Hb = function i7c() { - return Hdb(this.a) + jeb(Hdb(this.b)); - }; - _2.Jf = function k7c(b) { - var c2, d, e, f2; - e = 0; - while (e < b.length && j7c((BCb(e, b.length), b.charCodeAt(e)), mne)) { - ++e; - } - c2 = b.length; - while (c2 > 0 && j7c((BCb(c2 - 1, b.length), b.charCodeAt(c2 - 1)), nne)) { - --c2; + } + }, "_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); + } + } + 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); + } + } + 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); } - if (e >= c2) { - throw vbb(new Wdb("The given string does not contain any numbers.")); + } + return filterEles; + } + return this.spawn(); + }, "filter"), + not: /* @__PURE__ */ __name(function not(toRemove) { + if (!toRemove) { + return this; + } else { + if (string(toRemove)) { + toRemove = this.filter(toRemove); + } + 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); } - f2 = mfb(b.substr(e, c2 - e), ",|;|\r|\n"); - if (f2.length != 2) { - throw vbb(new Wdb("Exactly two numbers are expected, " + f2.length + " were found.")); + } + 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); + } + } + 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 id27 = ele._private.data.id; + var inOther = other2.hasElementWithId(id27); + if (!inOther) { + elements3.push(ele); } - try { - this.a = Hcb(ufb(f2[0])); - this.b = Hcb(ufb(f2[1])); - } catch (a) { - a = ubb(a); - if (JD(a, 127)) { - d = a; - throw vbb(new Wdb(one2 + d)); - } else - throw vbb(a); + } + }, "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 id27 = ele._private.data.id; + var inOther = other2.hasElementWithId(id27); + if (inOther) { + both.merge(ele); + } else { + retEles.push(ele); } - }; - _2.Ib = function m7c() { - return "(" + this.a + "," + this.b + ")"; - }; - _2.a = 0; - _2.b = 0; - var m1 = mdb(pne, "KVector", 8); - bcb(74, 68, { 3: 1, 4: 1, 20: 1, 28: 1, 52: 1, 14: 1, 68: 1, 15: 1, 74: 1, 414: 1 }, s7c, t7c, u7c); - _2.Pc = function x7c() { - return r7c(this); - }; - _2.Jf = function v7c(b) { - var c2, d, e, f2, g, h; - e = mfb(b, ",|;|\\(|\\)|\\[|\\]|\\{|\\}| | |\n"); - Osb(this); - try { - d = 0; - g = 0; - f2 = 0; - h = 0; - while (d < e.length) { - if (e[d] != null && ufb(e[d]).length > 0) { - g % 2 == 0 ? f2 = Hcb(e[d]) : h = Hcb(e[d]); - g > 0 && g % 2 != 0 && Dsb(this, new f7c(f2, h)); - ++g; - } - ++d; - } - } catch (a) { - a = ubb(a); - if (JD(a, 127)) { - c2 = a; - throw vbb(new Wdb("The given string does not match the expected format for vectors." + c2)); - } else - throw vbb(a); + } + }, "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); + } + } + 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 id27 = toAddEle._private.data.id; + var add3 = !map5.has(id27); + if (add3) { + var index = this.length++; + this[index] = toAddEle; + map5.set(id27, { + ele: toAddEle, + index + }); + } + } + return this; + }, "merge"), + unmergeAt: /* @__PURE__ */ __name(function unmergeAt(i2) { + var ele = this[i2]; + var id27 = ele.id(); + var _p = this._private; + var map5 = _p.map; + this[i2] = void 0; + map5["delete"](id27); + 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 id27 = ele._private.data.id; + var map5 = _p.map; + var entry = map5.get(id27); + 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); + } + } + 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; + } + } + 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; + } + } + 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; } + } + } + 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; + } + 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 }; - _2.Ib = function y7c() { - var a, b, c2; - a = new Wfb("("); - b = Jsb(this, 0); - while (b.b != b.d.c) { - c2 = BD(Xsb(b), 8); - Qfb(a, c2.a + "," + c2.b); - b.b != b.d.c && (a.a += "; ", a); - } - return (a.a += ")", a).a; - }; - var l1 = mdb(pne, "KVectorChain", 74); - bcb(248, 22, { 3: 1, 35: 1, 22: 1, 248: 1 }, G7c); - var z7c, A7c, B7c, C7c, D7c, E7c; - var o1 = ndb(ose, "Alignment", 248, CI, I7c, H7c); - var J7c; - bcb(979, 1, ale, Z7c); - _2.Qe = function $7c(a) { - Y7c(a); - }; - var L7c, M7c, N7c, O7c, P7c, Q7c, R7c, S7c, T7c, U7c, V7c, W7c; - mdb(ose, "BoxLayouterOptions", 979); - bcb(980, 1, {}, _7c); - _2.$e = function a8c() { - var a; - return a = new ged(), a; - }; - _2._e = function b8c(a) { - }; - mdb(ose, "BoxLayouterOptions/BoxFactory", 980); - bcb(291, 22, { 3: 1, 35: 1, 22: 1, 291: 1 }, j8c); - var c8c, d8c, e8c, f8c, g8c, h8c; - var r1 = ndb(ose, "ContentAlignment", 291, CI, l8c, k8c); - var m8c; - bcb(684, 1, ale, Z9c); - _2.Qe = function $9c(a) { - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), sse), ""), "Layout Algorithm"), "Select a specific layout algorithm."), (_5c(), Z5c)), ZI), pqb((N5c(), L5c))))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), tse), ""), "Resolved Layout Algorithm"), "Meta data associated with the selected algorithm."), Y5c), E0), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), $pe), ""), "Alignment"), "Alignment of the selected node relative to other nodes; the exact meaning depends on the used algorithm."), q8c), V5c), o1), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), _le), ""), "Aspect Ratio"), "The desired aspect ratio of the drawing, that is the quotient of width by height."), U5c), BI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), use), ""), "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."), Y5c), l1), pqb(I5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), lqe), ""), "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."), x8c), W5c), r1), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Zpe), ""), "Debug Mode"), "Whether additional debug information shall be generated."), (Bcb(), false)), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), cqe), ""), Cle), "Overall direction of edges: horizontal (right / left) or vertical (down / up)."), A8c), V5c), t12), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), ype), ""), "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."), F8c), V5c), v1), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Jre), ""), "Expand Nodes"), "If active, nodes are expanded to fill the area of their parent."), false), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), tpe), ""), "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`."), K8c), V5c), z1), qqb(L5c, OC(GC(e1, 1), Kie, 175, 0, [K5c]))))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), ame), ""), "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."), g9c), Y5c), j1), qqb(L5c, OC(GC(e1, 1), Kie, 175, 0, [K5c]))))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Ame), ""), "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), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), xqe), ""), "interactive Layout"), "Whether the graph should be changeable interactively and by setting constraints"), false), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Dme), ""), "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), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Bme), ""), "Port Constraints"), "Defines constraints of the position of the ports of a node."), u9c), V5c), D1), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), uqe), ""), "Position"), "The position of a node, port, or label. This is used by the 'Fixed Layout' algorithm to specify a pre-defined position."), Y5c), m1), qqb(K5c, OC(GC(e1, 1), Kie, 175, 0, [M5c, J5c]))))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), vme), ""), "Priority"), "Defines the priority of an object; its meaning depends on the specific layout algorithm and the context where it is used."), X5c), JI), qqb(K5c, OC(GC(e1, 1), Kie, 175, 0, [I5c]))))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), yme), ""), "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)."), X5c), JI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), zme), ""), "Separate Connected Components"), "Whether each connected component should be processed separately."), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), mqe), ""), "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."), R8c), Y5c), l1), pqb(I5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), pqe), ""), "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), T5c), wI), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), qqe), ""), "Hypernode"), "Whether the node should be handled as a hypernode."), false), T5c), wI), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), vse), ""), "Label Manager"), "Label managers can shorten labels upon a layout algorithm's request."), Y5c), h1), qqb(L5c, OC(GC(e1, 1), Kie, 175, 0, [J5c]))))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), vqe), ""), "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."), T8c), Y5c), i1), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Xpe), ""), "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), T5c), wI), qqb(K5c, OC(GC(e1, 1), Kie, 175, 0, [I5c, M5c, J5c]))))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), wse), ""), "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), U5c), BI), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), xse), ""), "Animate"), "Whether the shift from the old layout to the new computed layout shall be animated."), true), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), yse), ""), "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'."), meb(100)), X5c), JI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), zse), ""), "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), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Ase), ""), "Maximal Animation Time"), "The maximal time for animations, in milliseconds."), meb(4e3)), X5c), JI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Bse), ""), "Minimal Animation Time"), "The minimal time for animations, in milliseconds."), meb(400)), X5c), JI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Cse), ""), "Progress Bar"), "Whether a progress bar shall be displayed during layout computations."), false), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Dse), ""), "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), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Ese), ""), "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), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Fse), ""), "Zoom to Fit"), "Whether the zoom level shall be set to view the whole diagram after layout."), false), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), rse), "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."), u8c), V5c), O1), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Lpe), zpe), "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), U5c), BI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Mpe), zpe), "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), U5c), BI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Zle), zpe), "Components Spacing"), "Spacing to be preserved between pairs of connected components. This option is only relevant if 'separateConnectedComponents' is activated."), 20), U5c), BI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Npe), zpe), "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), U5c), BI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), xme), zpe), "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), U5c), BI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Ope), zpe), "Edge Node Spacing"), "Spacing to be preserved between nodes and edges."), 10), U5c), BI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Ppe), zpe), "Label Spacing"), "Determines the amount of space to be left between two labels of the same graph element."), 0), U5c), BI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Spe), zpe), "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), U5c), BI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Qpe), zpe), "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), U5c), BI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Rpe), zpe), "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), U5c), BI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), wme), zpe), "Node Spacing"), "The minimal distance to be preserved between each two nodes."), 20), U5c), BI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Tpe), zpe), "Node Self Loop Spacing"), "Spacing to be preserved between a node and its self loops."), 10), U5c), BI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Upe), zpe), "Port Spacing"), "Spacing between pairs of ports of the same node."), 10), U5c), BI), qqb(L5c, OC(GC(e1, 1), Kie, 175, 0, [K5c]))))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), Vpe), zpe), "Individual Spacing"), "Allows to specify individual spacing values for graph elements that shall be different from the value specified for the element's parent."), Y5c), i2), qqb(K5c, OC(GC(e1, 1), Kie, 175, 0, [I5c, M5c, J5c]))))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), wqe), zpe), "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."), W9c), Y5c), i1), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), tqe), Jse), "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)."), X5c), JI), qqb(L5c, OC(GC(e1, 1), Kie, 175, 0, [K5c]))))); - o4c(a, tqe, sqe, k9c); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), sqe), Jse), "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."), i9c), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), dqe), Kse), "Node Label Padding"), "Define padding for node labels that are placed inside of a node."), V8c), Y5c), j1), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Gme), Kse), "Node Label Placement"), "Hints for where node labels are to be placed; if empty, the node label's position is not modified."), X8c), W5c), B1), qqb(K5c, OC(GC(e1, 1), Kie, 175, 0, [J5c]))))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), gqe), Lse), "Port Alignment"), "Defines the default port distribution for a node. May be overridden for each side individually."), m9c), V5c), C1), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), hqe), Lse), "Port Alignment (North)"), "Defines how ports on the northern side are placed, overriding the node's general port alignment."), V5c), C1), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), iqe), Lse), "Port Alignment (South)"), "Defines how ports on the southern side are placed, overriding the node's general port alignment."), V5c), C1), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), jqe), Lse), "Port Alignment (West)"), "Defines how ports on the western side are placed, overriding the node's general port alignment."), V5c), C1), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), kqe), Lse), "Port Alignment (East)"), "Defines how ports on the eastern side are placed, overriding the node's general port alignment."), V5c), C1), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Fme), Mse), "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."), Z8c), W5c), I1), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Eme), Mse), "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."), c9c), W5c), J1), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Tme), Mse), "Node Size Minimum"), "The minimal size to which a node can be reduced."), a9c), Y5c), m1), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), bqe), Mse), "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), T5c), wI), pqb(L5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), nqe), Jpe), "Edge Label Placement"), "Gives a hint on where to put edge labels."), D8c), V5c), u1), pqb(J5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Cme), Jpe), "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), T5c), wI), pqb(J5c)))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), Gse), "font"), "Font Name"), "Font name used for a label."), Z5c), ZI), pqb(J5c)))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), Hse), "font"), "Font Size"), "Font size used for a label."), X5c), JI), pqb(J5c)))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), rqe), Nse), "Port Anchor Offset"), "The offset to the port position where connections shall be attached."), Y5c), m1), pqb(M5c)))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), oqe), Nse), "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."), X5c), JI), pqb(M5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Ype), Nse), "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."), B9c), V5c), F1), pqb(M5c)))); - t4c(a, new p5c(F5c(E5c(G5c(z5c(D5c(A5c(B5c(new H5c(), Wpe), Nse), "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."), U5c), BI), pqb(M5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Hme), Ose), "Port Label Placement"), "Decides on a placement method for port labels; if empty, the node label's position is not modified."), y9c), W5c), E1), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), eqe), Ose), "Port Labels Next to Port"), "Use 'portLabels.placement': NEXT_TO_PORT_OF_POSSIBLE."), false), T5c), wI), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), fqe), Ose), "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), T5c), wI), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), _pe), Pse), "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), T5c), wI), pqb(K5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), aqe), Pse), "Inside Self Loop"), "Whether a self loop should be routed inside a node instead of around that node."), false), T5c), wI), pqb(I5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), $le), "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), U5c), BI), pqb(I5c)))); - t4c(a, new p5c(F5c(E5c(G5c(y5c(z5c(D5c(A5c(B5c(new H5c(), Ise), "edge"), "Edge Type"), "The type of an edge. This is usually used for UML class diagrams, where associations must be handled differently from generalizations."), H8c), V5c), w1), pqb(I5c)))); - s4c(a, new W3c(b4c(d4c(c4c(new e4c(), sne), "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.'))); - s4c(a, new W3c(b4c(d4c(c4c(new e4c(), "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.`))); - s4c(a, new W3c(b4c(d4c(c4c(new e4c(), ume), "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."))); - s4c(a, new W3c(b4c(d4c(c4c(new e4c(), "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."))); - s4c(a, new W3c(b4c(d4c(c4c(new e4c(), bre), "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."))); - s4c(a, new W3c(b4c(d4c(c4c(new e4c(), "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."))); - s4c(a, new W3c(b4c(d4c(c4c(new e4c(), sre), "Radial"), "Radial layout algorithms usually position the nodes of the graph on concentric circles."))); - $ad((new _ad(), a)); - Y7c((new Z7c(), a)); - jdd((new kdd(), a)); - }; - var o8c, p8c, q8c, r8c, s8c, t8c, u8c, v8c, w8c, x8c, y8c, z8c, A8c, B8c, C8c, D8c, E8c, F8c, G8c, H8c, I8c, J8c, K8c, L8c, M8c, N8c, O8c, P8c, Q8c, R8c, S8c, T8c, U8c, V8c, W8c, X8c, Y8c, Z8c, $8c, _8c, a9c, b9c, c9c, d9c, e9c, f9c, g9c, h9c, i9c, j9c, k9c, l9c, m9c, n9c, o9c, p9c, q9c, r9c, s9c, t9c, u9c, v9c, w9c, x9c, y9c, z9c, A9c, B9c, C9c, D9c, E9c, F9c, G9c, H9c, I9c, J9c, K9c, L9c, M9c, N9c, O9c, P9c, Q9c, R9c, S9c, T9c, U9c, V9c, W9c, X9c; - mdb(ose, "CoreOptions", 684); - bcb(103, 22, { 3: 1, 35: 1, 22: 1, 103: 1 }, iad); - var _9c, aad, bad, cad, dad; - var t12 = ndb(ose, Cle, 103, CI, kad, jad); - var lad; - bcb(272, 22, { 3: 1, 35: 1, 22: 1, 272: 1 }, rad); - var nad, oad, pad2; - var u1 = ndb(ose, "EdgeLabelPlacement", 272, CI, tad, sad); - var uad; - bcb(218, 22, { 3: 1, 35: 1, 22: 1, 218: 1 }, Bad); - var wad, xad, yad, zad; - var v1 = ndb(ose, "EdgeRouting", 218, CI, Dad, Cad); - var Ead; - bcb(312, 22, { 3: 1, 35: 1, 22: 1, 312: 1 }, Nad); - var Gad, Had, Iad, Jad, Kad, Lad; - var w1 = ndb(ose, "EdgeType", 312, CI, Pad, Oad); - var Qad; - bcb(977, 1, ale, _ad); - _2.Qe = function abd(a) { - $ad(a); + var i2 = 0; + var length2 = this.length; + return _defineProperty$1({ + next: /* @__PURE__ */ __name(function next3() { + if (i2 < length2) { + entry.value = _this[i2++]; + } else { + entry.value = void 0; + entry.done = true; + } + 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 }; - var Sad, Tad, Uad, Vad, Wad, Xad, Yad; - mdb(ose, "FixedLayouterOptions", 977); - bcb(978, 1, {}, bbd); - _2.$e = function cbd() { - var a; - return a = new Zfd(), a; + } else if (options3.nodeDimensionsIncludeLabels) { + var bbDim = this.boundingBox(); + dims = { + w: bbDim.w, + h: bbDim.h }; - _2._e = function dbd(a) { + } else { + dims = { + w: this.outerWidth(), + h: this.outerHeight() }; - mdb(ose, "FixedLayouterOptions/FixedFactory", 978); - bcb(334, 22, { 3: 1, 35: 1, 22: 1, 334: 1 }, ibd); - var ebd, fbd, gbd; - var z1 = ndb(ose, "HierarchyHandling", 334, CI, kbd, jbd); - var lbd; - bcb(285, 22, { 3: 1, 35: 1, 22: 1, 285: 1 }, tbd); - var nbd, obd, pbd, qbd; - var A1 = ndb(ose, "LabelSide", 285, CI, vbd, ubd); - var wbd; - bcb(93, 22, { 3: 1, 35: 1, 22: 1, 93: 1 }, Ibd); - var ybd, zbd, Abd, Bbd, Cbd, Dbd, Ebd, Fbd, Gbd; - var B1 = ndb(ose, "NodeLabelPlacement", 93, CI, Lbd, Kbd); - var Mbd; - bcb(249, 22, { 3: 1, 35: 1, 22: 1, 249: 1 }, Ubd); - var Obd, Pbd, Qbd, Rbd, Sbd; - var C1 = ndb(ose, "PortAlignment", 249, CI, Wbd, Vbd); - var Xbd; - bcb(98, 22, { 3: 1, 35: 1, 22: 1, 98: 1 }, gcd); - var Zbd, $bd, _bd, acd, bcd, ccd; - var D1 = ndb(ose, "PortConstraints", 98, CI, icd, hcd); - var jcd; - bcb(273, 22, { 3: 1, 35: 1, 22: 1, 273: 1 }, scd); - var lcd, mcd, ncd, ocd, pcd, qcd; - var E1 = ndb(ose, "PortLabelPlacement", 273, CI, wcd, vcd); - var xcd; - bcb(61, 22, { 3: 1, 35: 1, 22: 1, 61: 1 }, Ycd); - var zcd, Acd, Bcd, Ccd, Dcd, Ecd, Fcd, Gcd, Hcd, Icd, Jcd, Kcd, Lcd, Mcd, Ncd, Ocd, Pcd, Qcd, Rcd, Scd, Tcd; - var F1 = ndb(ose, "PortSide", 61, CI, _cd, $cd); - var bdd; - bcb(981, 1, ale, kdd); - _2.Qe = function ldd(a) { - jdd(a); + } + 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 ddd, edd, fdd, gdd, hdd; - mdb(ose, "RandomLayouterOptions", 981); - bcb(982, 1, {}, mdd); - _2.$e = function ndd() { - var a; - return a = new Mgd(), a; + var spacingVector = { + // scale from center of bounding box (not necessarily 0,0) + x: (pos.x - center4.x) * spacing2, + y: (pos.y - center4.y) * spacing2 }; - _2._e = function odd(a) { + return { + x: center4.x + spacingVector.x, + y: center4.y + spacingVector.y }; - mdb(ose, "RandomLayouterOptions/RandomFactory", 982); - bcb(374, 22, { 3: 1, 35: 1, 22: 1, 374: 1 }, udd); - var pdd, qdd, rdd, sdd; - var I1 = ndb(ose, "SizeConstraint", 374, CI, wdd, vdd); - var xdd; - bcb(259, 22, { 3: 1, 35: 1, 22: 1, 259: 1 }, Jdd); - var zdd, Add, Bdd, Cdd, Ddd, Edd, Fdd, Gdd, Hdd; - var J1 = ndb(ose, "SizeOptions", 259, CI, Ldd, Kdd); - var Mdd; - bcb(370, 1, { 1949: 1 }, Zdd); - _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; - mdb(yqe, "BasicProgressMonitor", 370); - bcb(972, 209, Mle, ged); - _2.Ze = function ked(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - Odd(b, "Box layout", 2); - e = Gdb(ED(hkd(a, (X7c(), W7c)))); - f2 = BD(hkd(a, T7c), 116); - c2 = Ccb(DD(hkd(a, O7c))); - d = Ccb(DD(hkd(a, P7c))); - switch (BD(hkd(a, M7c), 311).g) { - case 0: - g = (h = new Tkb((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a)), mmb(), Okb(h, new med(d)), h); - i3 = rfd(a); - j = ED(hkd(a, L7c)); - (j == null || (uCb(j), j) <= 0) && (j = 1.3); - k = ded(g, e, f2, i3.a, i3.b, c2, (uCb(j), j)); - Afd(a, k.a, k.b, false, true); - break; - default: - eed(a, e, f2, c2); + }, "calculateSpacing"); + var useSpacingFactor = options3.spacingFactor && options3.spacingFactor !== 1; + var spacingBb = /* @__PURE__ */ __name(function spacingBb2() { + if (!useSpacingFactor) { + return null; + } + 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); + } + 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); + } + if (options3.transform != null) { + newPos2 = options3.transform(node3, newPos2); + } + 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 { + node2.position(newPos); } - Qdd(b); - }; - mdb(yqe, "BoxLayoutProvider", 972); - bcb(973, 1, Dke, med); - _2.ue = function ned(a, b) { - return led(this, BD(a, 33), BD(b, 33)); - }; - _2.Fb = function oed(a) { - return this === a; - }; - _2.ve = function ped() { - return new tpb(this); - }; - _2.a = false; - mdb(yqe, "BoxLayoutProvider/1", 973); - bcb(157, 1, { 157: 1 }, wed, xed); - _2.Ib = function yed() { - return this.c ? _od(this.c) : Fe(this.b); - }; - mdb(yqe, "BoxLayoutProvider/Group", 157); - bcb(311, 22, { 3: 1, 35: 1, 22: 1, 311: 1 }, Eed); - var zed, Aed, Bed, Ced; - var O1 = ndb(yqe, "BoxLayoutProvider/PackingMode", 311, CI, Ged, Fed); - var Hed; - bcb(974, 1, Dke, Jed); - _2.ue = function Ked(a, b) { - return hed(BD(a, 157), BD(b, 157)); - }; - _2.Fb = function Led(a) { - return this === a; - }; - _2.ve = function Med() { - return new tpb(this); - }; - mdb(yqe, "BoxLayoutProvider/lambda$0$Type", 974); - bcb(975, 1, Dke, Ned); - _2.ue = function Oed(a, b) { - return ied(BD(a, 157), BD(b, 157)); - }; - _2.Fb = function Ped(a) { - return this === a; - }; - _2.ve = function Qed() { - return new tpb(this); - }; - mdb(yqe, "BoxLayoutProvider/lambda$1$Type", 975); - bcb(976, 1, Dke, Red); - _2.ue = function Sed(a, b) { - return jed(BD(a, 157), BD(b, 157)); - }; - _2.Fb = function Ted(a) { - return this === a; - }; - _2.ve = function Ued() { - return new tpb(this); - }; - mdb(yqe, "BoxLayoutProvider/lambda$2$Type", 976); - bcb(1365, 1, { 831: 1 }, Ved); - _2.qg = function Wed(a, b) { - return Vyc(), !JD(b, 160) || h2c((Y1c(), BD(a, 160)), b); - }; - mdb(yqe, "ElkSpacings/AbstractSpacingsBuilder/lambda$0$Type", 1365); - bcb(1366, 1, qie, Xed); - _2.td = function Yed(a) { - Yyc(this.a, BD(a, 146)); - }; - mdb(yqe, "ElkSpacings/AbstractSpacingsBuilder/lambda$1$Type", 1366); - bcb(1367, 1, qie, Zed); - _2.td = function $ed(a) { - BD(a, 94); - Vyc(); - }; - mdb(yqe, "ElkSpacings/AbstractSpacingsBuilder/lambda$2$Type", 1367); - bcb(1371, 1, qie, _ed); - _2.td = function afd(a) { - Zyc(this.a, BD(a, 94)); - }; - mdb(yqe, "ElkSpacings/AbstractSpacingsBuilder/lambda$3$Type", 1371); - bcb(1369, 1, Oie, bfd); - _2.Mb = function cfd(a) { - return $yc(this.a, this.b, BD(a, 146)); - }; - mdb(yqe, "ElkSpacings/AbstractSpacingsBuilder/lambda$4$Type", 1369); - bcb(1368, 1, Oie, dfd); - _2.Mb = function efd(a) { - return azc(this.a, this.b, BD(a, 831)); - }; - mdb(yqe, "ElkSpacings/AbstractSpacingsBuilder/lambda$5$Type", 1368); - bcb(1370, 1, qie, ffd); - _2.td = function gfd(a) { - _yc(this.a, this.b, BD(a, 146)); - }; - mdb(yqe, "ElkSpacings/AbstractSpacingsBuilder/lambda$6$Type", 1370); - bcb(935, 1, {}, Hfd); - _2.Kb = function Ifd(a) { - return Gfd(a); - }; - _2.Fb = function Jfd(a) { - return this === a; - }; - mdb(yqe, "ElkUtil/lambda$0$Type", 935); - bcb(936, 1, qie, Kfd); - _2.td = function Lfd(a) { - ufd(this.a, this.b, BD(a, 79)); - }; - _2.a = 0; - _2.b = 0; - mdb(yqe, "ElkUtil/lambda$1$Type", 936); - bcb(937, 1, qie, Mfd); - _2.td = function Nfd(a) { - vfd(this.a, this.b, BD(a, 202)); - }; - _2.a = 0; - _2.b = 0; - mdb(yqe, "ElkUtil/lambda$2$Type", 937); - bcb(938, 1, qie, Ofd); - _2.td = function Pfd(a) { - wfd(this.a, this.b, BD(a, 137)); - }; - _2.a = 0; - _2.b = 0; - mdb(yqe, "ElkUtil/lambda$3$Type", 938); - bcb(939, 1, qie, Qfd); - _2.td = function Rfd(a) { - xfd(this.a, BD(a, 469)); - }; - mdb(yqe, "ElkUtil/lambda$4$Type", 939); - bcb(342, 1, { 35: 1, 342: 1 }, Tfd); - _2.wd = function Ufd(a) { - return Sfd(this, BD(a, 236)); - }; - _2.Fb = function Vfd(a) { - var b; - if (JD(a, 342)) { - b = BD(a, 342); - return this.a == b.a; - } - return false; - }; - _2.Hb = function Wfd() { - return QD(this.a); - }; - _2.Ib = function Xfd() { - return this.a + " (exclusive)"; - }; - _2.a = 0; - mdb(yqe, "ExclusiveBounds/ExclusiveLowerBound", 342); - bcb(1138, 209, Mle, Zfd); - _2.Ze = function $fd(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r, s, t4, u2, v, w2, A, B; - Odd(b, "Fixed Layout", 1); - f2 = BD(hkd(a, (Y9c(), E8c)), 218); - l = 0; - m = 0; - for (s = new Fyd((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a)); s.e != s.i.gc(); ) { - q = BD(Dyd(s), 33); - B = BD(hkd(q, (Zad(), Yad)), 8); - if (B) { - bld(q, B.a, B.b); - if (BD(hkd(q, Tad), 174).Hc((tdd(), pdd))) { - n = BD(hkd(q, Vad), 8); - n.a > 0 && n.b > 0 && Afd(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 Fyd((!q.n && (q.n = new cUd(D2, q, 1, 7)), q.n)); j.e != j.i.gc(); ) { - h = BD(Dyd(j), 137); - B = BD(hkd(h, Yad), 8); - !!B && bld(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 Fyd((!q.c && (q.c = new cUd(F2, q, 9, 9)), q.c)); v.e != v.i.gc(); ) { - u2 = BD(Dyd(v), 118); - B = BD(hkd(u2, Yad), 8); - !!B && bld(u2, B.a, B.b); - w2 = q.i + u2.i; - A = q.j + u2.j; - l = $wnd.Math.max(l, w2 + u2.g); - m = $wnd.Math.max(m, A + u2.f); - for (i3 = new Fyd((!u2.n && (u2.n = new cUd(D2, u2, 1, 7)), u2.n)); i3.e != i3.i.gc(); ) { - h = BD(Dyd(i3), 137); - B = BD(hkd(h, Yad), 8); - !!B && bld(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 Sr(ur(_sd(q).a.Kc(), new Sq())); Qr(e); ) { - c2 = BD(Rr(e), 79); - k = Yfd(c2); - l = $wnd.Math.max(l, k.a); - m = $wnd.Math.max(m, k.b); - } - for (d = new Sr(ur($sd(q).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 79); - if (Xod(jtd(c2)) != a) { - k = Yfd(c2); - l = $wnd.Math.max(l, k.a); - m = $wnd.Math.max(m, k.b); - } - } - } - if (f2 == (Aad(), wad)) { - for (r = new Fyd((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a)); r.e != r.i.gc(); ) { - q = BD(Dyd(r), 33); - for (d = new Sr(ur(_sd(q).a.Kc(), new Sq())); Qr(d); ) { - c2 = BD(Rr(d), 79); - g = pfd(c2); - g.b == 0 ? jkd(c2, Q8c, null) : jkd(c2, Q8c, g); - } - } - } - if (!Ccb(DD(hkd(a, (Zad(), Uad))))) { - t4 = BD(hkd(a, Wad), 116); - p = l + t4.b + t4.c; - o2 = m + t4.d + t4.a; - Afd(a, p, o2, true, true); - } - Qdd(b); - }; - mdb(yqe, "FixedLayoutProvider", 1138); - bcb(373, 134, { 3: 1, 414: 1, 373: 1, 94: 1, 134: 1 }, _fd, agd); - _2.Jf = function dgd(b) { - var c2, d, e, f2, g, h, i3, j, k; - if (!b) { - return; - } - try { - j = mfb(b, ";,;"); - for (g = j, h = 0, i3 = g.length; h < i3; ++h) { - f2 = g[h]; - d = mfb(f2, "\\:"); - e = k4c(n4c(), d[0]); - if (!e) { - throw vbb(new Wdb("Invalid option id: " + d[0])); - } - k = o5c(e, d[1]); - if (k == null) { - throw vbb(new Wdb("Invalid option value: " + d[1])); - } - k == null ? (!this.q && (this.q = new Lqb()), Thb(this.q, e)) : (!this.q && (this.q = new Lqb()), Rhb(this.q, e, k)); - } - } catch (a) { - a = ubb(a); - if (JD(a, 102)) { - c2 = a; - throw vbb(new Xdb(c2)); - } else - throw vbb(a); - } - }; - _2.Ib = function egd() { - var a; - a = GD(GAb(NAb((!this.q ? (mmb(), mmb(), kmb) : this.q).vc().Oc(), new fgd()), Ayb(new pzb(), new nzb(), new Zyb(), new _yb(), OC(GC(xL, 1), Kie, 132, 0, [])))); - return a; - }; - var i2 = mdb(yqe, "IndividualSpacings", 373); - bcb(971, 1, {}, fgd); - _2.Kb = function ggd(a) { - return cgd(BD(a, 42)); - }; - mdb(yqe, "IndividualSpacings/lambda$0$Type", 971); - bcb(709, 1, {}, jgd); - _2.c = 0; - mdb(yqe, "InstancePool", 709); - bcb(1275, 1, {}, kgd); - mdb(yqe, "LoggedGraph", 1275); - bcb(396, 22, { 3: 1, 35: 1, 22: 1, 396: 1 }, qgd); - var lgd, mgd, ngd, ogd; - var k2 = ndb(yqe, "LoggedGraph/Type", 396, CI, sgd, rgd); - var tgd; - bcb(46, 1, { 20: 1, 46: 1 }, vgd); - _2.Jc = function xgd(a) { - reb(this, a); - }; - _2.Fb = function wgd(a) { - var b, c2, d; - if (JD(a, 46)) { - c2 = BD(a, 46); - 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; + } + 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); + } + 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); + } + if (options3.zoom != null) { + cy.zoom(options3.zoom); + } + if (options3.pan) { + cy.pan(options3.pan); + } + 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 renderer8 = cy.renderer(); + var styleEnabled2 = cy.styleEnabled(); + if (renderer8 && styleEnabled2) { + renderer8.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); + } + } + }, "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; + } + } + }, "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 { - return false; - } - }; - _2.Hb = function ygd() { - var a, b, c2, d, e, f2; - c2 = this.a == null ? 0 : tb(this.a); - a = c2 & aje; - b = c2 & -65536; - f2 = this.b == null ? 0 : tb(this.b); - d = f2 & aje; - e = f2 & -65536; - return a ^ e >> 16 & aje | b ^ d << 16; - }; - _2.Kc = function zgd() { - return new Bgd(this); - }; - _2.Ib = function Agd() { - return this.a == null && this.b == null ? "pair(null,null)" : this.a == null ? "pair(null," + fcb(this.b) + ")" : this.b == null ? "pair(" + fcb(this.a) + ",null)" : "pair(" + fcb(this.a) + "," + fcb(this.b) + ")"; - }; - mdb(yqe, "Pair", 46); - bcb(983, 1, aie, Bgd); - _2.Nb = function Cgd(a) { - Rrb(this, a); - }; - _2.Ob = function Dgd() { - return !this.c && (!this.b && this.a.a != null || this.a.b != null); - }; - _2.Pb = function Egd() { - 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 vbb(new utb()); - }; - _2.Qb = function Fgd() { - this.c && this.a.b != null ? this.a.b = null : this.b && this.a.a != null && (this.a.a = null); - throw vbb(new Ydb()); - }; - _2.b = false; - _2.c = false; - mdb(yqe, "Pair/1", 983); - bcb(448, 1, { 448: 1 }, Ggd); - _2.Fb = function Hgd(a) { - return wtb(this.a, BD(a, 448).a) && wtb(this.c, BD(a, 448).c) && wtb(this.d, BD(a, 448).d) && wtb(this.b, BD(a, 448).b); - }; - _2.Hb = function Igd() { - return Hlb(OC(GC(SI, 1), Uhe, 1, 5, [this.a, this.c, this.d, this.b])); - }; - _2.Ib = function Jgd() { - return "(" + this.a + She + this.c + She + this.d + She + this.b + ")"; - }; - mdb(yqe, "Quadruple", 448); - bcb(1126, 209, Mle, Mgd); - _2.Ze = function Ngd(a, b) { - var c2, d, e, f2, g; - Odd(b, "Random Layout", 1); - if ((!a.a && (a.a = new cUd(E2, a, 10, 11)), a.a).i == 0) { - Qdd(b); return; } - f2 = BD(hkd(a, (idd(), gdd)), 19); - !!f2 && f2.a != 0 ? e = new Hub(f2.a) : e = new Gub(); - c2 = Gdb(ED(hkd(a, ddd))); - g = Gdb(ED(hkd(a, hdd))); - d = BD(hkd(a, edd), 116); - Lgd(a, e, c2, g, d); - Qdd(b); - }; - mdb(yqe, "RandomLayoutProvider", 1126); - var Ogd; - bcb(553, 1, {}); - _2.qf = function Sgd() { - return new f7c(this.f.i, this.f.j); - }; - _2.We = function Tgd(a) { - if (Jsd(a, (Y9c(), s9c))) { - return hkd(this.f, Qgd); - } - return hkd(this.f, a); - }; - _2.rf = function Ugd() { - return new f7c(this.f.g, this.f.f); - }; - _2.sf = function Vgd() { - return this.g; - }; - _2.Xe = function Wgd(a) { - return ikd(this.f, a); - }; - _2.tf = function Xgd(a) { - dld(this.f, a.a); - eld(this.f, a.b); - }; - _2.uf = function Ygd(a) { - cld(this.f, a.a); - ald(this.f, a.b); - }; - _2.vf = function Zgd(a) { - this.g = a; - }; - _2.g = 0; - var Qgd; - mdb(Use, "ElkGraphAdapters/AbstractElkGraphElementAdapter", 553); - bcb(554, 1, { 839: 1 }, $gd); - _2.wf = function _gd() { - var a, b; - if (!this.b) { - this.b = Qu(Kkd(this.a).i); - for (b = new Fyd(Kkd(this.a)); b.e != b.i.gc(); ) { - a = BD(Dyd(b), 137); - Ekb(this.b, new dhd(a)); - } - } - return this.b; - }; - _2.b = null; - mdb(Use, "ElkGraphAdapters/ElkEdgeAdapter", 554); - bcb(301, 553, {}, bhd); - _2.xf = function chd() { - return ahd(this); - }; - _2.a = null; - mdb(Use, "ElkGraphAdapters/ElkGraphAdapter", 301); - bcb(630, 553, { 181: 1 }, dhd); - mdb(Use, "ElkGraphAdapters/ElkLabelAdapter", 630); - bcb(629, 553, { 680: 1 }, hhd); - _2.wf = function khd() { - return ehd(this); - }; - _2.Af = function lhd() { - var a; - return a = BD(hkd(this.f, (Y9c(), S8c)), 142), !a && (a = new H_b()), a; - }; - _2.Cf = function nhd() { - return fhd(this); - }; - _2.Ef = function phd(a) { - var b; - b = new K_b(a); - jkd(this.f, (Y9c(), S8c), b); - }; - _2.Ff = function qhd(a) { - jkd(this.f, (Y9c(), f9c), new r0b(a)); - }; - _2.yf = function ihd() { - return this.d; - }; - _2.zf = function jhd() { - var a, b; - if (!this.a) { - this.a = new Rkb(); - for (b = new Sr(ur($sd(BD(this.f, 33)).a.Kc(), new Sq())); Qr(b); ) { - a = BD(Rr(b), 79); - Ekb(this.a, new $gd(a)); - } + } else { + style3.applyBypass(this, name, value2, updateTransitions); + this.emitAndNotify("style"); + } + } else if (name === void 0) { + var _ele = this[0]; + if (_ele) { + return style3.getRawStyle(_ele); + } else { + return; + } + } + 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); + } + } else { + names = names.split(/\s+/); + for (var _i = 0; _i < eles.length; _i++) { + var _ele2 = eles[_i]; + style3.removeBypasses(_ele2, names, updateTransitions); + } + } + 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; + } + 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 this.a; - }; - _2.Bf = function mhd() { - var a, b; - if (!this.c) { - this.c = new Rkb(); - for (b = new Sr(ur(_sd(BD(this.f, 33)).a.Kc(), new Sq())); Qr(b); ) { - a = BD(Rr(b), 79); - Ekb(this.c, new $gd(a)); - } + } + 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; + } + } + }, "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; + } + 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; } - return this.c; - }; - _2.Df = function ohd() { - return Vod(BD(this.f, 33)).i != 0 || Ccb(DD(BD(this.f, 33).We((Y9c(), M8c)))); - }; - _2.Gf = function rhd() { - ghd(this, (Pgd(), Ogd)); - }; - _2.a = null; - _2.b = null; - _2.c = null; - _2.d = null; - _2.e = null; - mdb(Use, "ElkGraphAdapters/ElkNodeAdapter", 629); - bcb(1266, 553, { 838: 1 }, thd); - _2.wf = function vhd() { - return shd(this); - }; - _2.zf = function uhd() { - var a, b; - if (!this.a) { - this.a = Pu(BD(this.f, 118).xg().i); - for (b = new Fyd(BD(this.f, 118).xg()); b.e != b.i.gc(); ) { - a = BD(Dyd(b), 79); - Ekb(this.a, new $gd(a)); - } + } + if (!disqualified) { + ret.push(ele); + } + } + 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; + } + 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); } - return this.a; - }; - _2.Bf = function whd() { - var a, b; - if (!this.c) { - this.c = Pu(BD(this.f, 118).yg().i); - for (b = new Fyd(BD(this.f, 118).yg()); b.e != b.i.gc(); ) { - a = BD(Dyd(b), 79); - Ekb(this.c, new $gd(a)); - } + } + } + 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; + } + 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 this.c; - }; - _2.Hf = function xhd() { - return BD(BD(this.f, 118).We((Y9c(), A9c)), 61); - }; - _2.If = function yhd() { - var a, b, c2, d, e, f2, g, h; - d = mpd(BD(this.f, 118)); - for (c2 = new Fyd(BD(this.f, 118).yg()); c2.e != c2.i.gc(); ) { - a = BD(Dyd(c2), 79); - for (h = new Fyd((!a.c && (a.c = new y5d(z2, a, 5, 8)), a.c)); h.e != h.i.gc(); ) { - g = BD(Dyd(h), 82); - if (ntd(atd(g), d)) { - return true; - } else if (atd(g) == d && Ccb(DD(hkd(a, (Y9c(), N8c))))) { - return true; - } - } + } + if (!newNext) { + break; + } + 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]); } - for (b = new Fyd(BD(this.f, 118).xg()); b.e != b.i.gc(); ) { - a = BD(Dyd(b), 79); - for (f2 = new Fyd((!a.b && (a.b = new y5d(z2, a, 4, 7)), a.b)); f2.e != f2.i.gc(); ) { - e = BD(Dyd(f2), 82); - if (ntd(atd(e), d)) { - return true; - } + elements3.push(edge[0]); + } + } + 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; + } + var edges5 = node2._private.edges; + for (var j2 = 0; j2 < edges5.length; j2++) { + var edge = edges5[j2]; + retEles.push(edge); + } + } + 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; + } + 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); } + }); + }); + }, "_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 = {}; + } + var _data = json3.data; + if (_data.id == null) { + _data.id = uuid(); + } else if (cy.hasElementWithId(_data.id) || elesIds.has(_data.id)) { + continue; + } + 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 id27 = element$1._private.data.id; + if (!unique || !map5.has(id27)) { + if (unique) { + map5.set(id27, { + 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(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 + }); + } + }, "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(id27) { + id27 = "" + id27; + return this._private.map.has(id27); + }; + elesfn$1.getElementById = function(id27) { + id27 = "" + id27; + var cy = this._private.cy; + var entry = this._private.map.get(id27); + 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 id27 = this[0]._private.data.id; + return eles._private.map.get(id27).index; + }; + elesfn$1.indexOf = function(ele) { + var id27 = ele[0]._private.data.id; + return this._private.map.get(id27).index; + }; + elesfn$1.indexOfId = function(id27) { + id27 = "" + id27; + return this._private.map.get(id27).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 false; - }; - _2.a = null; - _2.b = null; - _2.c = null; - mdb(Use, "ElkGraphAdapters/ElkPortAdapter", 1266); - bcb(1267, 1, Dke, Ahd); - _2.ue = function Bhd(a, b) { - return zhd(BD(a, 118), BD(b, 118)); - }; - _2.Fb = function Chd(a) { - return this === a; - }; - _2.ve = function Dhd() { - return new tpb(this); - }; - mdb(Use, "ElkGraphAdapters/PortComparator", 1267); - var m5 = odb(Vse, "EObject"); - var x2 = odb(Wse, Xse); - var y2 = odb(Wse, Yse); - var C2 = odb(Wse, Zse); - var G2 = odb(Wse, "ElkShape"); - var z2 = odb(Wse, $se); - var B2 = odb(Wse, _se); - var A2 = odb(Wse, ate); - var k5 = odb(Vse, bte); - var i5 = odb(Vse, "EFactory"); - var Ehd; - var l5 = odb(Vse, cte); - var o5 = odb(Vse, "EPackage"); - var Ghd; - var Ihd, Jhd, Khd, Lhd, Mhd, Nhd, Ohd, Phd, Qhd, Rhd, Shd; - var D2 = odb(Wse, dte); - var E2 = odb(Wse, ete); - var F2 = odb(Wse, fte); - bcb(90, 1, gte); - _2.Jg = function Vhd() { - this.Kg(); - return null; - }; - _2.Kg = function Whd() { - return null; - }; - _2.Lg = function Xhd() { - return this.Kg(), false; - }; - _2.Mg = function Yhd() { - return false; - }; - _2.Ng = function Zhd(a) { - Uhd(this, a); - }; - mdb(hte, "BasicNotifierImpl", 90); - bcb(97, 90, pte); - _2.nh = function fjd() { - return oid(this); - }; - _2.Og = function Fid(a, b) { - return a; - }; - _2.Pg = function Gid() { - throw vbb(new bgb()); - }; - _2.Qg = function Hid(a) { - var b; - return b = zUd(BD(XKd(this.Tg(), this.Vg()), 18)), this.eh().ih(this, b.n, b.f, a); - }; - _2.Rg = function Iid(a, b) { - throw vbb(new bgb()); - }; - _2.Sg = function Jid(a, b, c2) { - return _hd(this, a, b, c2); - }; - _2.Tg = function Kid() { - var a; - if (this.Pg()) { - a = this.Pg().ck(); - if (a) { - return a; - } - } - return this.zh(); - }; - _2.Ug = function Lid() { - return aid(this); - }; - _2.Vg = function Mid() { - throw vbb(new bgb()); - }; - _2.Wg = function Oid() { - var a, b; - b = this.ph().dk(); - !b && this.Pg().ik(b = (nRd(), a = pNd(TKd(this.Tg())), a == null ? mRd : new qRd(this, a))); - return b; - }; - _2.Xg = function Qid(a, b) { - return a; - }; - _2.Yg = function Rid(a) { - var b; - b = a.Gj(); - return !b ? bLd(this.Tg(), a) : a.aj(); - }; - _2.Zg = function Sid() { - var a; - a = this.Pg(); - return !a ? null : a.fk(); - }; - _2.$g = function Tid() { - return !this.Pg() ? null : this.Pg().ck(); - }; - _2._g = function Uid(a, b, c2) { - return fid(this, a, b, c2); - }; - _2.ah = function Vid(a) { - return gid(this, a); - }; - _2.bh = function Wid(a, b) { - return hid(this, a, b); - }; - _2.dh = function Xid() { - var a; - a = this.Pg(); - return !!a && a.gk(); - }; - _2.eh = function Yid() { - throw vbb(new bgb()); - }; - _2.fh = function Zid() { - return jid(this); - }; - _2.gh = function $id(a, b, c2, d) { - return kid(this, a, b, d); - }; - _2.hh = function _id(a, b, c2) { - var d; - return d = BD(XKd(this.Tg(), b), 66), d.Nj().Qj(this, this.yh(), b - this.Ah(), a, c2); - }; - _2.ih = function ajd(a, b, c2, d) { - return lid(this, a, b, d); - }; - _2.jh = function bjd(a, b, c2) { - var d; - return d = BD(XKd(this.Tg(), b), 66), d.Nj().Rj(this, this.yh(), b - this.Ah(), a, c2); - }; - _2.kh = function cjd() { - return !!this.Pg() && !!this.Pg().ek(); - }; - _2.lh = function djd(a) { - return mid(this, a); - }; - _2.mh = function ejd(a) { - return nid(this, a); - }; - _2.oh = function gjd(a) { - return rid(this, a); - }; - _2.ph = function hjd() { - throw vbb(new bgb()); - }; - _2.qh = function ijd() { - return !this.Pg() ? null : this.Pg().ek(); - }; - _2.rh = function jjd() { - return jid(this); - }; - _2.sh = function kjd(a, b) { - yid(this, a, b); - }; - _2.th = function ljd(a) { - this.ph().hk(a); - }; - _2.uh = function mjd(a) { - this.ph().kk(a); - }; - _2.vh = function njd(a) { - this.ph().jk(a); - }; - _2.wh = function ojd(a, b) { - var c2, d, e, f2; - f2 = this.Zg(); - if (!!f2 && !!a) { - b = Txd(f2.Vk(), this, b); - f2.Zk(this); - } - d = this.eh(); - if (d) { - if ((Nid(this, this.eh(), this.Vg()).Bb & Tje) != 0) { - e = d.fh(); - !!e && (!a ? e.Yk(this) : !f2 && e.Zk(this)); - } else { - b = (c2 = this.Vg(), c2 >= 0 ? this.Qg(b) : this.eh().ih(this, -1 - c2, null, b)); - b = this.Sg(null, -1, b); - } - } - this.uh(a); - return b; - }; - _2.xh = function pjd(a) { - var b, c2, d, e, f2, g, h, i3; - c2 = this.Tg(); - f2 = bLd(c2, a); - b = this.Ah(); - if (f2 >= b) { - return BD(a, 66).Nj().Uj(this, this.yh(), f2 - b); - } else if (f2 <= -1) { - g = e1d((O6d(), M6d), c2, a); - if (g) { - Q6d(); - BD(g, 66).Oj() || (g = _1d(q1d(M6d, g))); - e = (d = this.Yg(g), BD(d >= 0 ? this._g(d, true, true) : sid(this, g, true), 153)); - i3 = g.Zj(); - if (i3 > 1 || i3 == -1) { - return BD(BD(e, 215).hl(a, false), 76); - } - } else { - throw vbb(new Wdb(ite + a.ne() + lte)); - } - } else if (a.$j()) { - return d = this.Yg(a), BD(d >= 0 ? this._g(d, false, true) : sid(this, a, false), 76); - } - h = new nGd(this, a); - return h; - }; - _2.yh = function qjd() { - return Aid(this); - }; - _2.zh = function rjd() { - return (NFd(), MFd).S; - }; - _2.Ah = function sjd() { - return aLd(this.zh()); - }; - _2.Bh = function tjd(a) { - Cid(this, a); - }; - _2.Ib = function ujd() { - return Eid(this); - }; - mdb(qte, "BasicEObjectImpl", 97); - var zFd; - bcb(114, 97, { 105: 1, 92: 1, 90: 1, 56: 1, 108: 1, 49: 1, 97: 1, 114: 1 }); - _2.Ch = function Djd(a) { - var b; - b = xjd(this); - return b[a]; - }; - _2.Dh = function Ejd(a, b) { - var c2; - c2 = xjd(this); - NC(c2, a, b); - }; - _2.Eh = function Fjd(a) { - var b; - b = xjd(this); - NC(b, a, null); - }; - _2.Jg = function Gjd() { - return BD(Ajd(this, 4), 126); - }; - _2.Kg = function Hjd() { - throw vbb(new bgb()); - }; - _2.Lg = function Ijd() { - return (this.Db & 4) != 0; - }; - _2.Pg = function Jjd() { - throw vbb(new bgb()); - }; - _2.Fh = function Kjd(a) { - Cjd(this, 2, a); - }; - _2.Rg = function Ljd(a, b) { - this.Db = b << 16 | this.Db & 255; - this.Fh(a); - }; - _2.Tg = function Mjd() { - return wjd(this); - }; - _2.Vg = function Njd() { - return this.Db >> 16; - }; - _2.Wg = function Ojd() { - var a, b; - return nRd(), b = pNd(TKd((a = BD(Ajd(this, 16), 26), !a ? this.zh() : a))), b == null ? mRd : new qRd(this, b); - }; - _2.Mg = function Pjd() { - return (this.Db & 1) == 0; - }; - _2.Zg = function Qjd() { - return BD(Ajd(this, 128), 1935); - }; - _2.$g = function Rjd() { - return BD(Ajd(this, 16), 26); - }; - _2.dh = function Sjd() { - return (this.Db & 32) != 0; - }; - _2.eh = function Tjd() { - return BD(Ajd(this, 2), 49); - }; - _2.kh = function Ujd() { - return (this.Db & 64) != 0; - }; - _2.ph = function Vjd() { - throw vbb(new bgb()); - }; - _2.qh = function Wjd() { - return BD(Ajd(this, 64), 281); - }; - _2.th = function Xjd(a) { - Cjd(this, 16, a); - }; - _2.uh = function Yjd(a) { - Cjd(this, 128, a); - }; - _2.vh = function Zjd(a) { - Cjd(this, 64, a); - }; - _2.yh = function $jd() { - return yjd(this); - }; - _2.Db = 0; - mdb(qte, "MinimalEObjectImpl", 114); - bcb(115, 114, { 105: 1, 92: 1, 90: 1, 56: 1, 108: 1, 49: 1, 97: 1, 114: 1, 115: 1 }); - _2.Fh = function _jd(a) { - this.Cb = a; - }; - _2.eh = function akd() { - return this.Cb; - }; - mdb(qte, "MinimalEObjectImpl/Container", 115); - bcb(1985, 115, { 105: 1, 413: 1, 94: 1, 92: 1, 90: 1, 56: 1, 108: 1, 49: 1, 97: 1, 114: 1, 115: 1 }); - _2._g = function kkd(a, b, c2) { - return bkd(this, a, b, c2); - }; - _2.jh = function lkd(a, b, c2) { - return ckd(this, a, b, c2); - }; - _2.lh = function mkd(a) { - return dkd(this, a); - }; - _2.sh = function nkd(a, b) { - ekd(this, a, b); - }; - _2.zh = function okd() { - return Thd(), Shd; - }; - _2.Bh = function pkd(a) { - fkd(this, a); - }; - _2.Ve = function qkd() { - return gkd(this); - }; - _2.We = function rkd(a) { - return hkd(this, a); - }; - _2.Xe = function skd(a) { - return ikd(this, a); - }; - _2.Ye = function tkd(a, b) { - return jkd(this, a, b); - }; - mdb(rte, "EMapPropertyHolderImpl", 1985); - bcb(567, 115, { 105: 1, 469: 1, 92: 1, 90: 1, 56: 1, 108: 1, 49: 1, 97: 1, 114: 1, 115: 1 }, xkd); - _2._g = function ykd(a, b, c2) { - switch (a) { - case 0: - return this.a; - case 1: - return this.b; - } - return fid(this, a, b, c2); - }; - _2.lh = function zkd(a) { - switch (a) { - case 0: - return this.a != 0; - case 1: - return this.b != 0; - } - return mid(this, a); - }; - _2.sh = function Akd(a, b) { - switch (a) { - case 0: - vkd(this, Edb(ED(b))); - return; - case 1: - wkd(this, Edb(ED(b))); - return; - } - yid(this, a, b); - }; - _2.zh = function Bkd() { - return Thd(), Ihd; - }; - _2.Bh = function Ckd(a) { - switch (a) { - case 0: - vkd(this, 0); - return; - case 1: - wkd(this, 0); - return; - } - Cid(this, a); - }; - _2.Ib = function Dkd() { - var a; - if ((this.Db & 64) != 0) - return Eid(this); - a = new Jfb(Eid(this)); - a.a += " (x: "; - Bfb(a, this.a); - a.a += ", y: "; - Bfb(a, this.b); - a.a += ")"; - return a.a; - }; - _2.a = 0; - _2.b = 0; - mdb(rte, "ElkBendPointImpl", 567); - bcb(723, 1985, { 105: 1, 413: 1, 160: 1, 94: 1, 92: 1, 90: 1, 56: 1, 108: 1, 49: 1, 97: 1, 114: 1, 115: 1 }); - _2._g = function Nkd(a, b, c2) { - return Ekd(this, a, b, c2); - }; - _2.hh = function Okd(a, b, c2) { - return Fkd(this, a, b, c2); - }; - _2.jh = function Pkd(a, b, c2) { - return Gkd(this, a, b, c2); - }; - _2.lh = function Qkd(a) { - return Hkd(this, a); - }; - _2.sh = function Rkd(a, b) { - Ikd(this, a, b); - }; - _2.zh = function Skd() { - return Thd(), Mhd; - }; - _2.Bh = function Tkd(a) { - Jkd(this, a); - }; - _2.zg = function Ukd() { - return this.k; - }; - _2.Ag = function Vkd() { - return Kkd(this); - }; - _2.Ib = function Wkd() { - return Mkd(this); - }; - _2.k = null; - mdb(rte, "ElkGraphElementImpl", 723); - bcb(724, 723, { 105: 1, 413: 1, 160: 1, 470: 1, 94: 1, 92: 1, 90: 1, 56: 1, 108: 1, 49: 1, 97: 1, 114: 1, 115: 1 }); - _2._g = function gld(a, b, c2) { - return Xkd(this, a, b, c2); - }; - _2.lh = function hld(a) { - return Ykd(this, a); - }; - _2.sh = function ild(a, b) { - Zkd(this, a, b); - }; - _2.zh = function jld() { - return Thd(), Rhd; - }; - _2.Bh = function kld(a) { - $kd(this, a); - }; - _2.Bg = function lld() { - return this.f; - }; - _2.Cg = function mld() { - return this.g; - }; - _2.Dg = function nld() { - return this.i; - }; - _2.Eg = function old() { - return this.j; - }; - _2.Fg = function pld(a, b) { - _kd(this, a, b); - }; - _2.Gg = function qld(a, b) { - bld(this, a, b); - }; - _2.Hg = function rld(a) { - dld(this, a); - }; - _2.Ig = function sld(a) { - eld(this, a); - }; - _2.Ib = function tld() { - return fld(this); - }; - _2.f = 0; - _2.g = 0; - _2.i = 0; - _2.j = 0; - mdb(rte, "ElkShapeImpl", 724); - bcb(725, 724, { 105: 1, 413: 1, 82: 1, 160: 1, 470: 1, 94: 1, 92: 1, 90: 1, 56: 1, 108: 1, 49: 1, 97: 1, 114: 1, 115: 1 }); - _2._g = function Bld(a, b, c2) { - return uld(this, a, b, c2); - }; - _2.hh = function Cld(a, b, c2) { - return vld(this, a, b, c2); - }; - _2.jh = function Dld(a, b, c2) { - return wld(this, a, b, c2); - }; - _2.lh = function Eld(a) { - return xld(this, a); - }; - _2.sh = function Fld(a, b) { - yld(this, a, b); - }; - _2.zh = function Gld() { - return Thd(), Jhd; - }; - _2.Bh = function Hld(a) { - zld(this, a); - }; - _2.xg = function Ild() { - return !this.d && (this.d = new y5d(B2, this, 8, 5)), this.d; - }; - _2.yg = function Jld() { - return !this.e && (this.e = new y5d(B2, this, 7, 4)), this.e; - }; - mdb(rte, "ElkConnectableShapeImpl", 725); - bcb(352, 723, { 105: 1, 413: 1, 79: 1, 160: 1, 352: 1, 94: 1, 92: 1, 90: 1, 56: 1, 108: 1, 49: 1, 97: 1, 114: 1, 115: 1 }, Tld); - _2.Qg = function Uld(a) { - return Lld(this, a); - }; - _2._g = function Vld(a, b, c2) { - switch (a) { - case 3: - return Mld(this); - case 4: - return !this.b && (this.b = new y5d(z2, this, 4, 7)), this.b; - case 5: - return !this.c && (this.c = new y5d(z2, this, 5, 8)), this.c; - case 6: - return !this.a && (this.a = new cUd(A2, this, 6, 6)), this.a; - case 7: - return Bcb(), !this.b && (this.b = new y5d(z2, this, 4, 7)), this.b.i <= 1 && (!this.c && (this.c = new y5d(z2, this, 5, 8)), this.c.i <= 1) ? false : true; - case 8: - return Bcb(), Pld(this) ? true : false; - case 9: - return Bcb(), Qld(this) ? true : false; - case 10: - return Bcb(), !this.b && (this.b = new y5d(z2, this, 4, 7)), this.b.i != 0 && (!this.c && (this.c = new y5d(z2, this, 5, 8)), this.c.i != 0) ? true : false; - } - return Ekd(this, a, b, c2); - }; - _2.hh = function Wld(a, b, c2) { - var d; - switch (b) { - case 3: - !!this.Cb && (c2 = (d = this.Db >> 16, d >= 0 ? Lld(this, c2) : this.Cb.ih(this, -1 - d, null, c2))); - return Kld(this, BD(a, 33), c2); - case 4: - return !this.b && (this.b = new y5d(z2, this, 4, 7)), Sxd(this.b, a, c2); - case 5: - return !this.c && (this.c = new y5d(z2, this, 5, 8)), Sxd(this.c, a, c2); - case 6: - return !this.a && (this.a = new cUd(A2, this, 6, 6)), Sxd(this.a, a, c2); - } - return Fkd(this, a, b, c2); - }; - _2.jh = function Xld(a, b, c2) { - switch (b) { - case 3: - return Kld(this, null, c2); - case 4: - return !this.b && (this.b = new y5d(z2, this, 4, 7)), Txd(this.b, a, c2); - case 5: - return !this.c && (this.c = new y5d(z2, this, 5, 8)), Txd(this.c, a, c2); - case 6: - return !this.a && (this.a = new cUd(A2, this, 6, 6)), Txd(this.a, a, c2); + if (tgt != null && tgt != _data2.target) { + spec.target = "" + tgt; + move = true; } - return Gkd(this, a, b, c2); - }; - _2.lh = function Yld(a) { - switch (a) { - case 3: - return !!Mld(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 y5d(z2, this, 4, 7)), !(this.b.i <= 1 && (!this.c && (this.c = new y5d(z2, this, 5, 8)), this.c.i <= 1)); - case 8: - return Pld(this); - case 9: - return Qld(this); - case 10: - return !this.b && (this.b = new y5d(z2, this, 4, 7)), this.b.i != 0 && (!this.c && (this.c = new y5d(z2, this, 5, 8)), this.c.i != 0); + if (move) { + ele = ele.move(spec); } - return Hkd(this, a); - }; - _2.sh = function Zld(a, b) { - switch (a) { - case 3: - Rld(this, BD(b, 33)); - return; - case 4: - !this.b && (this.b = new y5d(z2, this, 4, 7)); - Uxd(this.b); - !this.b && (this.b = new y5d(z2, this, 4, 7)); - ytd(this.b, BD(b, 14)); - return; - case 5: - !this.c && (this.c = new y5d(z2, this, 5, 8)); - Uxd(this.c); - !this.c && (this.c = new y5d(z2, this, 5, 8)); - ytd(this.c, BD(b, 14)); - return; - case 6: - !this.a && (this.a = new cUd(A2, this, 6, 6)); - Uxd(this.a); - !this.a && (this.a = new cUd(A2, this, 6, 6)); - ytd(this.a, BD(b, 14)); - 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; + } + if (parent4 != null) { + parent4 = "" + parent4; + } + ele = ele.move({ + parent: parent4 + }); } - Ikd(this, a, b); - }; - _2.zh = function $ld() { - return Thd(), Khd; - }; - _2.Bh = function _ld(a) { - switch (a) { - case 3: - Rld(this, null); - return; - case 4: - !this.b && (this.b = new y5d(z2, this, 4, 7)); - Uxd(this.b); - return; - case 5: - !this.c && (this.c = new y5d(z2, this, 5, 8)); - Uxd(this.c); - return; - case 6: - !this.a && (this.a = new cUd(A2, this, 6, 6)); - Uxd(this.a); - return; + } + } + 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](); } - Jkd(this, a); - }; - _2.Ib = function amd() { - return Sld(this); - }; - mdb(rte, "ElkEdgeImpl", 352); - bcb(439, 1985, { 105: 1, 413: 1, 202: 1, 439: 1, 94: 1, 92: 1, 90: 1, 56: 1, 108: 1, 49: 1, 97: 1, 114: 1, 115: 1 }, rmd); - _2.Qg = function smd(a) { - return cmd(this, a); - }; - _2._g = function tmd(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 xMd(y2, this, 5)), this.a; - case 6: - return fmd(this); - case 7: - if (b) - return emd(this); - return this.i; - case 8: - if (b) - return dmd(this); - return this.f; - case 9: - return !this.g && (this.g = new y5d(A2, this, 9, 10)), this.g; - case 10: - return !this.e && (this.e = new y5d(A2, this, 10, 9)), this.e; - case 11: - return this.d; + } + }, "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 id27 = _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 j2 = 0; j2 < fieldsLength; j2++) { + var field = fields[j2]; + var val = _data3[field]; + if (number$1(val)) { + val = _data3[field] = "" + _data3[field]; } - return bkd(this, a, b, c2); - }; - _2.hh = function umd(a, b, c2) { - var d, e, f2; - switch (b) { - case 6: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? cmd(this, c2) : this.Cb.ih(this, -1 - e, null, c2))); - return bmd(this, BD(a, 79), c2); - case 9: - return !this.g && (this.g = new y5d(A2, this, 9, 10)), Sxd(this.g, a, c2); - case 10: - return !this.e && (this.e = new y5d(A2, this, 10, 9)), Sxd(this.e, a, c2); + if (val == null || val === "") { + error("Can not create edge `" + id27 + "` with unspecified " + field); + badSourceOrTarget = true; + } else if (!cy.hasElementWithId(val)) { + error("Can not create edge `" + id27 + "` with nonexistant " + field + " `" + val + "`"); + badSourceOrTarget = true; } - return f2 = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? (Thd(), Lhd) : d), b), 66), f2.Nj().Qj(this, yjd(this), b - aLd((Thd(), Lhd)), a, c2); - }; - _2.jh = function vmd(a, b, c2) { - switch (b) { - case 5: - return !this.a && (this.a = new xMd(y2, this, 5)), Txd(this.a, a, c2); - case 6: - return bmd(this, null, c2); - case 9: - return !this.g && (this.g = new y5d(A2, this, 9, 10)), Txd(this.g, a, c2); - case 10: - return !this.e && (this.e = new y5d(A2, this, 10, 9)), Txd(this.e, a, c2); + } + 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$2(); + _private.map.set(id27, { + 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 ckd(this, a, b, c2); - }; - _2.lh = function wmd(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 !!fmd(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; + if (!selfAsParent) { + parent4[0]._private.children.push(node2); + node2._private.parent = parent4[0]; + cy_p.hasCompoundNodes = true; } - return dkd(this, a); - }; - _2.sh = function xmd(a, b) { - switch (a) { - case 1: - omd(this, Edb(ED(b))); - return; - case 2: - pmd(this, Edb(ED(b))); - return; - case 3: - hmd(this, Edb(ED(b))); - return; - case 4: - imd(this, Edb(ED(b))); - return; - case 5: - !this.a && (this.a = new xMd(y2, this, 5)); - Uxd(this.a); - !this.a && (this.a = new xMd(y2, this, 5)); - ytd(this.a, BD(b, 14)); - return; - case 6: - mmd(this, BD(b, 79)); - return; - case 7: - lmd(this, BD(b, 82)); - return; - case 8: - kmd(this, BD(b, 82)); - return; - case 9: - !this.g && (this.g = new y5d(A2, this, 9, 10)); - Uxd(this.g); - !this.g && (this.g = new y5d(A2, this, 9, 10)); - ytd(this.g, BD(b, 14)); - return; - case 10: - !this.e && (this.e = new y5d(A2, this, 10, 9)); - Uxd(this.e); - !this.e && (this.e = new y5d(A2, this, 10, 9)); - ytd(this.e, BD(b, 14)); - return; - case 11: - jmd(this, GD(b)); - return; - } - ekd(this, a, b); - }; - _2.zh = function ymd() { - return Thd(), Lhd; - }; - _2.Bh = function zmd(a) { - switch (a) { - case 1: - omd(this, 0); - return; - case 2: - pmd(this, 0); - return; - case 3: - hmd(this, 0); - return; - case 4: - imd(this, 0); - return; - case 5: - !this.a && (this.a = new xMd(y2, this, 5)); - Uxd(this.a); - return; - case 6: - mmd(this, null); - return; - case 7: - lmd(this, null); - return; - case 8: - kmd(this, null); - return; - case 9: - !this.g && (this.g = new y5d(A2, this, 9, 10)); - Uxd(this.g); - return; - case 10: - !this.e && (this.e = new y5d(A2, this, 10, 9)); - Uxd(this.e); - return; - case 11: - jmd(this, null); - return; - } - fkd(this, a); - }; - _2.Ib = function Amd() { - return qmd(this); - }; - _2.b = 0; - _2.c = 0; - _2.d = null; - _2.j = 0; - _2.k = 0; - mdb(rte, "ElkEdgeSectionImpl", 439); - bcb(150, 115, { 105: 1, 92: 1, 90: 1, 147: 1, 56: 1, 108: 1, 49: 1, 97: 1, 150: 1, 114: 1, 115: 1 }); - _2._g = function Emd(a, b, c2) { - var d; - if (a == 0) { - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), this.Ab; - } - return bid(this, a - aLd(this.zh()), XKd((d = BD(Ajd(this, 16), 26), !d ? this.zh() : d), a), b, c2); - }; - _2.hh = function Fmd(a, b, c2) { - var d, e; - if (b == 0) { - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Sxd(this.Ab, a, c2); - } - return e = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? this.zh() : d), b), 66), e.Nj().Qj(this, yjd(this), b - aLd(this.zh()), a, c2); - }; - _2.jh = function Gmd(a, b, c2) { - var d, e; - if (b == 0) { - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Txd(this.Ab, a, c2); - } - return e = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? this.zh() : d), b), 66), e.Nj().Rj(this, yjd(this), b - aLd(this.zh()), a, c2); - }; - _2.lh = function Hmd(a) { - var b; - if (a == 0) { - return !!this.Ab && this.Ab.i != 0; - } - return cid(this, a - aLd(this.zh()), XKd((b = BD(Ajd(this, 16), 26), !b ? this.zh() : b), a)); - }; - _2.oh = function Imd(a) { - return Bmd(this, a); - }; - _2.sh = function Jmd(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - ytd(this.Ab, BD(b, 14)); - return; - } - did(this, a - aLd(this.zh()), XKd((c2 = BD(Ajd(this, 16), 26), !c2 ? this.zh() : c2), a), b); - }; - _2.uh = function Kmd(a) { - Cjd(this, 128, a); - }; - _2.zh = function Lmd() { - return jGd(), ZFd; - }; - _2.Bh = function Mmd(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - return; - } - eid(this, a - aLd(this.zh()), XKd((b = BD(Ajd(this, 16), 26), !b ? this.zh() : b), a)); - }; - _2.Gh = function Nmd() { - this.Bb |= 1; - }; - _2.Hh = function Omd(a) { - return Dmd(this, a); - }; - _2.Bb = 0; - mdb(qte, "EModelElementImpl", 150); - bcb(704, 150, { 105: 1, 92: 1, 90: 1, 471: 1, 147: 1, 56: 1, 108: 1, 49: 1, 97: 1, 150: 1, 114: 1, 115: 1 }, $md); - _2.Ih = function _md(a, b) { - return Vmd(this, a, b); - }; - _2.Jh = function and(a) { - var b, c2, d, e, f2; - if (this.a != bKd(a) || (a.Bb & 256) != 0) { - throw vbb(new Wdb(xte + a.zb + ute)); + } + } + } + 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; + } + _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(); } - for (d = _Kd(a); VKd(d.a).i != 0; ) { - c2 = BD(nOd(d, 0, (b = BD(qud(VKd(d.a), 0), 87), f2 = b.c, JD(f2, 88) ? BD(f2, 26) : (jGd(), _Fd))), 26); - if (dKd(c2)) { - e = bKd(c2).Nh().Jh(c2); - BD(e, 49).th(a); - return e; + } + } else { + var parent4 = _ele4.parent(); + if (parent4.length !== 0) { + removeChildRef(parent4, _ele4); + } + } + 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(id27) { + return id27 == null ? id27 : "" + id27; + }, "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; + } } - d = _Kd(c2); - } - return (a.D != null ? a.D : a.B) == "java.util.Map$Entry" ? new lHd(a) : new _Gd(a); - }; - _2.Kh = function bnd(a, b) { - return Wmd(this, a, b); - }; - _2._g = function cnd(a, b, c2) { - var d; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), this.Ab; - case 1: - return this.a; - } - return bid(this, a - aLd((jGd(), WFd)), XKd((d = BD(Ajd(this, 16), 26), !d ? WFd : d), a), b, c2); - }; - _2.hh = function dnd(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Sxd(this.Ab, a, c2); - case 1: - !!this.a && (c2 = BD(this.a, 49).ih(this, 4, o5, c2)); - return Tmd(this, BD(a, 235), c2); - } - return e = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? (jGd(), WFd) : d), b), 66), e.Nj().Qj(this, yjd(this), b - aLd((jGd(), WFd)), a, c2); - }; - _2.jh = function end2(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Txd(this.Ab, a, c2); - case 1: - return Tmd(this, null, c2); - } - return e = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? (jGd(), WFd) : d), b), 66), e.Nj().Rj(this, yjd(this), b - aLd((jGd(), WFd)), a, c2); - }; - _2.lh = function fnd(a) { - var b; - switch (a) { - case 0: - return !!this.Ab && this.Ab.i != 0; - case 1: - return !!this.a; - } - return cid(this, a - aLd((jGd(), WFd)), XKd((b = BD(Ajd(this, 16), 26), !b ? WFd : b), a)); - }; - _2.sh = function gnd(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - ytd(this.Ab, BD(b, 14)); - return; - case 1: - Ymd(this, BD(b, 235)); - return; - } - did(this, a - aLd((jGd(), WFd)), XKd((c2 = BD(Ajd(this, 16), 26), !c2 ? WFd : c2), a), b); - }; - _2.zh = function hnd() { - return jGd(), WFd; - }; - _2.Bh = function ind(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - return; - case 1: - Ymd(this, null); - return; - } - eid(this, a - aLd((jGd(), WFd)), XKd((b = BD(Ajd(this, 16), 26), !b ? WFd : b), a)); - }; - var Pmd, Qmd, Rmd; - mdb(qte, "EFactoryImpl", 704); - bcb(zte, 704, { 105: 1, 2014: 1, 92: 1, 90: 1, 471: 1, 147: 1, 56: 1, 108: 1, 49: 1, 97: 1, 150: 1, 114: 1, 115: 1 }, knd); - _2.Ih = function lnd(a, b) { - switch (a.yj()) { - case 12: - return BD(b, 146).tg(); - case 13: - return fcb(b); - default: - throw vbb(new Wdb(tte + a.ne() + ute)); - } - }; - _2.Jh = function mnd(a) { - var b, c2, d, e, f2, g, h, i3; - switch (a.G == -1 && (a.G = (b = bKd(a), b ? HLd(b.Mh(), a) : -1)), a.G) { - case 4: - return f2 = new Jod(), f2; - case 6: - return g = new apd(), g; - case 7: - return h = new ppd(), h; - case 8: - return d = new Tld(), d; - case 9: - return c2 = new xkd(), c2; - case 10: - return e = new rmd(), e; - case 11: - return i3 = new Bpd(), i3; - default: - throw vbb(new Wdb(xte + a.zb + ute)); - } - }; - _2.Kh = function nnd(a, b) { - switch (a.yj()) { - case 13: - case 12: - return null; - default: - throw vbb(new Wdb(tte + a.ne() + ute)); - } - }; - mdb(rte, "ElkGraphFactoryImpl", zte); - bcb(438, 150, { 105: 1, 92: 1, 90: 1, 147: 1, 191: 1, 56: 1, 108: 1, 49: 1, 97: 1, 150: 1, 114: 1, 115: 1 }); - _2.Wg = function rnd() { - var a, b; - b = (a = BD(Ajd(this, 16), 26), pNd(TKd(!a ? this.zh() : a))); - return b == null ? (nRd(), nRd(), mRd) : new GRd(this, b); - }; - _2._g = function snd(a, b, c2) { - var d; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), this.Ab; - case 1: - return this.ne(); - } - return bid(this, a - aLd(this.zh()), XKd((d = BD(Ajd(this, 16), 26), !d ? this.zh() : d), a), b, c2); - }; - _2.lh = function tnd(a) { - var b; - switch (a) { - case 0: - return !!this.Ab && this.Ab.i != 0; - case 1: - return this.zb != null; - } - return cid(this, a - aLd(this.zh()), XKd((b = BD(Ajd(this, 16), 26), !b ? this.zh() : b), a)); - }; - _2.sh = function und(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - ytd(this.Ab, BD(b, 14)); - return; - case 1: - this.Lh(GD(b)); - return; - } - did(this, a - aLd(this.zh()), XKd((c2 = BD(Ajd(this, 16), 26), !c2 ? this.zh() : c2), a), b); - }; - _2.zh = function vnd() { - return jGd(), $Fd; - }; - _2.Bh = function wnd(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - return; - case 1: - this.Lh(null); - return; - } - eid(this, a - aLd(this.zh()), XKd((b = BD(Ajd(this, 16), 26), !b ? this.zh() : b), a)); - }; - _2.ne = function xnd() { - return this.zb; - }; - _2.Lh = function ynd(a) { - pnd(this, a); - }; - _2.Ib = function znd() { - return qnd(this); - }; - _2.zb = null; - mdb(qte, "ENamedElementImpl", 438); - bcb(179, 438, { 105: 1, 92: 1, 90: 1, 147: 1, 191: 1, 56: 1, 235: 1, 108: 1, 49: 1, 97: 1, 150: 1, 179: 1, 114: 1, 115: 1, 675: 1 }, eod); - _2.Qg = function god(a) { - return Snd(this, a); - }; - _2._g = function hod(a, b, c2) { - var d; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, 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 jUd(this, d5, this)), this.rb; - case 6: - return !this.vb && (this.vb = new gUd(o5, this, 6, 7)), this.vb; - case 7: - if (b) - return this.Db >> 16 == 7 ? BD(this.Cb, 235) : null; - return Ind(this); - } - return bid(this, a - aLd((jGd(), cGd)), XKd((d = BD(Ajd(this, 16), 26), !d ? cGd : d), a), b, c2); - }; - _2.hh = function iod(a, b, c2) { - var d, e, f2; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Sxd(this.Ab, a, c2); - case 4: - !!this.sb && (c2 = BD(this.sb, 49).ih(this, 1, i5, c2)); - return Jnd(this, BD(a, 471), c2); - case 5: - return !this.rb && (this.rb = new jUd(this, d5, this)), Sxd(this.rb, a, c2); - case 6: - return !this.vb && (this.vb = new gUd(o5, this, 6, 7)), Sxd(this.vb, a, c2); - case 7: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? Snd(this, c2) : this.Cb.ih(this, -1 - e, null, c2))); - return _hd(this, a, 7, c2); - } - return f2 = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? (jGd(), cGd) : d), b), 66), f2.Nj().Qj(this, yjd(this), b - aLd((jGd(), cGd)), a, c2); - }; - _2.jh = function jod(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Txd(this.Ab, a, c2); - case 4: - return Jnd(this, null, c2); - case 5: - return !this.rb && (this.rb = new jUd(this, d5, this)), Txd(this.rb, a, c2); - case 6: - return !this.vb && (this.vb = new gUd(o5, this, 6, 7)), Txd(this.vb, a, c2); - case 7: - return _hd(this, null, 7, c2); - } - return e = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? (jGd(), cGd) : d), b), 66), e.Nj().Rj(this, yjd(this), b - aLd((jGd(), cGd)), a, c2); - }; - _2.lh = function kod(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 !!Ind(this); - } - return cid(this, a - aLd((jGd(), cGd)), XKd((b = BD(Ajd(this, 16), 26), !b ? cGd : b), a)); - }; - _2.oh = function lod(a) { - var b; - b = Und(this, a); - return b ? b : Bmd(this, a); - }; - _2.sh = function mod(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - ytd(this.Ab, BD(b, 14)); - return; - case 1: - pnd(this, GD(b)); - return; - case 2: - dod(this, GD(b)); - return; - case 3: - cod(this, GD(b)); - return; - case 4: - bod(this, BD(b, 471)); - return; - case 5: - !this.rb && (this.rb = new jUd(this, d5, this)); - Uxd(this.rb); - !this.rb && (this.rb = new jUd(this, d5, this)); - ytd(this.rb, BD(b, 14)); - return; - case 6: - !this.vb && (this.vb = new gUd(o5, this, 6, 7)); - Uxd(this.vb); - !this.vb && (this.vb = new gUd(o5, this, 6, 7)); - ytd(this.vb, BD(b, 14)); - return; } - did(this, a - aLd((jGd(), cGd)), XKd((c2 = BD(Ajd(this, 16), 26), !c2 ? cGd : c2), a), b); - }; - _2.vh = function nod(a) { - var b, c2; - if (!!a && !!this.rb) { - for (c2 = new Fyd(this.rb); c2.e != c2.i.gc(); ) { - b = Dyd(c2); - JD(b, 351) && (BD(b, 351).w = null); + 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; } } - Cjd(this, 64, a); - }; - _2.zh = function ood() { - return jGd(), cGd; - }; - _2.Bh = function pod(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - return; - case 1: - pnd(this, null); - return; - case 2: - dod(this, null); - return; - case 3: - cod(this, null); - return; - case 4: - bod(this, null); - return; - case 5: - !this.rb && (this.rb = new jUd(this, d5, this)); - Uxd(this.rb); - return; - case 6: - !this.vb && (this.vb = new gUd(o5, this, 6, 7)); - Uxd(this.vb); - return; - } - eid(this, a - aLd((jGd(), cGd)), XKd((b = BD(Ajd(this, 16), 26), !b ? cGd : b), a)); - }; - _2.Gh = function qod() { - Tnd(this); - }; - _2.Mh = function rod() { - return !this.rb && (this.rb = new jUd(this, d5, this)), this.rb; - }; - _2.Nh = function sod() { - return this.sb; - }; - _2.Oh = function tod() { - return this.ub; - }; - _2.Ph = function uod() { - return this.xb; - }; - _2.Qh = function vod() { - return this.yb; - }; - _2.Rh = function wod(a) { - this.ub = a; - }; - _2.Ib = function xod() { - var a; - if ((this.Db & 64) != 0) - return qnd(this); - a = new Jfb(qnd(this)); - a.a += " (nsURI: "; - Efb(a, this.yb); - a.a += ", nsPrefix: "; - Efb(a, this.xb); - a.a += ")"; - return a.a; - }; - _2.xb = null; - _2.yb = null; - mdb(qte, "EPackageImpl", 179); - bcb(555, 179, { 105: 1, 2016: 1, 555: 1, 92: 1, 90: 1, 147: 1, 191: 1, 56: 1, 235: 1, 108: 1, 49: 1, 97: 1, 150: 1, 179: 1, 114: 1, 115: 1, 675: 1 }, Bod); - _2.q = false; - _2.r = false; - var yod = false; - mdb(rte, "ElkGraphPackageImpl", 555); - bcb(354, 724, { 105: 1, 413: 1, 160: 1, 137: 1, 470: 1, 354: 1, 94: 1, 92: 1, 90: 1, 56: 1, 108: 1, 49: 1, 97: 1, 114: 1, 115: 1 }, Jod); - _2.Qg = function Kod(a) { - return Eod(this, a); - }; - _2._g = function Lod(a, b, c2) { - switch (a) { - case 7: - return Fod(this); - case 8: - return this.a; - } - return Xkd(this, a, b, c2); - }; - _2.hh = function Mod(a, b, c2) { - var d; - switch (b) { - case 7: - !!this.Cb && (c2 = (d = this.Db >> 16, d >= 0 ? Eod(this, c2) : this.Cb.ih(this, -1 - d, null, c2))); - return Dod(this, BD(a, 160), c2); - } - return Fkd(this, a, b, c2); - }; - _2.jh = function Nod(a, b, c2) { - if (b == 7) { - return Dod(this, null, c2); - } - return Gkd(this, a, b, c2); - }; - _2.lh = function Ood(a) { - switch (a) { - case 7: - return !!Fod(this); - case 8: - return !dfb("", this.a); - } - return Ykd(this, a); - }; - _2.sh = function Pod(a, b) { - switch (a) { - case 7: - God(this, BD(b, 160)); - return; - case 8: - Hod(this, GD(b)); - return; - } - Zkd(this, a, b); - }; - _2.zh = function Qod() { - return Thd(), Nhd; - }; - _2.Bh = function Rod(a) { - switch (a) { - case 7: - God(this, null); - return; - case 8: - Hod(this, ""); - return; - } - $kd(this, a); - }; - _2.Ib = function Sod() { - return Iod(this); - }; - _2.a = ""; - mdb(rte, "ElkLabelImpl", 354); - bcb(239, 725, { 105: 1, 413: 1, 82: 1, 160: 1, 33: 1, 470: 1, 239: 1, 94: 1, 92: 1, 90: 1, 56: 1, 108: 1, 49: 1, 97: 1, 114: 1, 115: 1 }, apd); - _2.Qg = function bpd(a) { - return Uod(this, a); - }; - _2._g = function cpd(a, b, c2) { - switch (a) { - case 9: - return !this.c && (this.c = new cUd(F2, this, 9, 9)), this.c; - case 10: - return !this.a && (this.a = new cUd(E2, this, 10, 11)), this.a; - case 11: - return Xod(this); - case 12: - return !this.b && (this.b = new cUd(B2, this, 12, 3)), this.b; - case 13: - return Bcb(), !this.a && (this.a = new cUd(E2, this, 10, 11)), this.a.i > 0 ? true : false; - } - return uld(this, a, b, c2); - }; - _2.hh = function dpd(a, b, c2) { - var d; - switch (b) { - case 9: - return !this.c && (this.c = new cUd(F2, this, 9, 9)), Sxd(this.c, a, c2); - case 10: - return !this.a && (this.a = new cUd(E2, this, 10, 11)), Sxd(this.a, a, c2); - case 11: - !!this.Cb && (c2 = (d = this.Db >> 16, d >= 0 ? Uod(this, c2) : this.Cb.ih(this, -1 - d, null, c2))); - return Tod(this, BD(a, 33), c2); - case 12: - return !this.b && (this.b = new cUd(B2, this, 12, 3)), Sxd(this.b, a, c2); - } - return vld(this, a, b, c2); - }; - _2.jh = function epd(a, b, c2) { - switch (b) { - case 9: - return !this.c && (this.c = new cUd(F2, this, 9, 9)), Txd(this.c, a, c2); - case 10: - return !this.a && (this.a = new cUd(E2, this, 10, 11)), Txd(this.a, a, c2); - case 11: - return Tod(this, null, c2); - case 12: - return !this.b && (this.b = new cUd(B2, this, 12, 3)), Txd(this.b, a, c2); - } - return wld(this, a, b, c2); - }; - _2.lh = function fpd(a) { - switch (a) { - case 9: - return !!this.c && this.c.i != 0; - case 10: - return !!this.a && this.a.i != 0; - case 11: - return !!Xod(this); - case 12: - return !!this.b && this.b.i != 0; - case 13: - return !this.a && (this.a = new cUd(E2, this, 10, 11)), this.a.i > 0; - } - return xld(this, a); - }; - _2.sh = function gpd(a, b) { - switch (a) { - case 9: - !this.c && (this.c = new cUd(F2, this, 9, 9)); - Uxd(this.c); - !this.c && (this.c = new cUd(F2, this, 9, 9)); - ytd(this.c, BD(b, 14)); - return; - case 10: - !this.a && (this.a = new cUd(E2, this, 10, 11)); - Uxd(this.a); - !this.a && (this.a = new cUd(E2, this, 10, 11)); - ytd(this.a, BD(b, 14)); - return; - case 11: - $od(this, BD(b, 33)); - return; - case 12: - !this.b && (this.b = new cUd(B2, this, 12, 3)); - Uxd(this.b); - !this.b && (this.b = new cUd(B2, this, 12, 3)); - ytd(this.b, BD(b, 14)); - return; - } - yld(this, a, b); - }; - _2.zh = function hpd() { - return Thd(), Ohd; - }; - _2.Bh = function ipd(a) { - switch (a) { - case 9: - !this.c && (this.c = new cUd(F2, this, 9, 9)); - Uxd(this.c); - return; - case 10: - !this.a && (this.a = new cUd(E2, this, 10, 11)); - Uxd(this.a); - return; - case 11: - $od(this, null); - return; - case 12: - !this.b && (this.b = new cUd(B2, this, 12, 3)); - Uxd(this.b); - return; - } - zld(this, a); - }; - _2.Ib = function jpd() { - return _od(this); - }; - mdb(rte, "ElkNodeImpl", 239); - bcb(186, 725, { 105: 1, 413: 1, 82: 1, 160: 1, 118: 1, 470: 1, 186: 1, 94: 1, 92: 1, 90: 1, 56: 1, 108: 1, 49: 1, 97: 1, 114: 1, 115: 1 }, ppd); - _2.Qg = function qpd(a) { - return lpd(this, a); - }; - _2._g = function rpd(a, b, c2) { - if (a == 9) { - return mpd(this); - } - return uld(this, a, b, c2); - }; - _2.hh = function spd(a, b, c2) { - var d; - switch (b) { - case 9: - !!this.Cb && (c2 = (d = this.Db >> 16, d >= 0 ? lpd(this, c2) : this.Cb.ih(this, -1 - d, null, c2))); - return kpd(this, BD(a, 33), c2); - } - return vld(this, a, b, c2); - }; - _2.jh = function tpd(a, b, c2) { - if (b == 9) { - return kpd(this, null, c2); - } - return wld(this, a, b, c2); - }; - _2.lh = function upd(a) { - if (a == 9) { - return !!mpd(this); - } - return xld(this, a); - }; - _2.sh = function vpd(a, b) { - switch (a) { - case 9: - npd(this, BD(b, 33)); - return; - } - yld(this, a, b); - }; - _2.zh = function wpd() { - return Thd(), Phd; - }; - _2.Bh = function xpd(a) { - switch (a) { - case 9: - npd(this, null); - return; - } - zld(this, a); - }; - _2.Ib = function ypd() { - return opd(this); - }; - mdb(rte, "ElkPortImpl", 186); - var J4 = odb(Tte, "BasicEMap/Entry"); - bcb(1092, 115, { 105: 1, 42: 1, 92: 1, 90: 1, 133: 1, 56: 1, 108: 1, 49: 1, 97: 1, 114: 1, 115: 1 }, Bpd); - _2.Fb = function Hpd(a) { - return this === a; - }; - _2.cd = function Jpd() { - return this.b; - }; - _2.Hb = function Lpd() { - return FCb(this); - }; - _2.Uh = function Npd(a) { - zpd(this, BD(a, 146)); - }; - _2._g = function Cpd(a, b, c2) { - switch (a) { - case 0: - return this.b; - case 1: - return this.c; - } - return fid(this, a, b, c2); - }; - _2.lh = function Dpd(a) { - switch (a) { - case 0: - return !!this.b; - case 1: - return this.c != null; + 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()); } - return mid(this, a); - }; - _2.sh = function Epd(a, b) { - switch (a) { - case 0: - zpd(this, BD(b, 146)); - return; - case 1: - Apd(this, b); - return; + elements3 = new Collection(cy, jsons); + } + } 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); + } } - yid(this, a, b); - }; - _2.zh = function Fpd() { - return Thd(), Qhd; - }; - _2.Bh = function Gpd(a) { - switch (a) { - case 0: - zpd(this, null); - return; - case 1: - Apd(this, null); - return; - } - Cid(this, a); - }; - _2.Sh = function Ipd() { - var a; - if (this.a == -1) { - a = this.b; - this.a = !a ? 0 : tb(a); - } - return this.a; - }; - _2.dd = function Kpd() { - return this.c; - }; - _2.Th = function Mpd(a) { - this.a = a; - }; - _2.ed = function Opd(a) { - var b; - b = this.c; - Apd(this, a); - return b; - }; - _2.Ib = function Ppd() { - var a; - if ((this.Db & 64) != 0) - return Eid(this); - a = new Ufb(); - Qfb(Qfb(Qfb(a, this.b ? this.b.tg() : Xhe), gne), xfb(this.c)); - return a.a; - }; - _2.a = -1; - _2.c = null; - var S2 = mdb(rte, "ElkPropertyToValueMapEntryImpl", 1092); - bcb(984, 1, {}, bqd); - mdb(Wte, "JsonAdapter", 984); - bcb(210, 60, Tie, cqd); - mdb(Wte, "JsonImportException", 210); - bcb(857, 1, {}, ird); - mdb(Wte, "JsonImporter", 857); - bcb(891, 1, {}, jrd); - mdb(Wte, "JsonImporter/lambda$0$Type", 891); - bcb(892, 1, {}, krd); - mdb(Wte, "JsonImporter/lambda$1$Type", 892); - bcb(900, 1, {}, lrd); - mdb(Wte, "JsonImporter/lambda$10$Type", 900); - bcb(902, 1, {}, mrd); - mdb(Wte, "JsonImporter/lambda$11$Type", 902); - bcb(903, 1, {}, nrd); - mdb(Wte, "JsonImporter/lambda$12$Type", 903); - bcb(909, 1, {}, ord); - mdb(Wte, "JsonImporter/lambda$13$Type", 909); - bcb(908, 1, {}, prd); - mdb(Wte, "JsonImporter/lambda$14$Type", 908); - bcb(904, 1, {}, qrd); - mdb(Wte, "JsonImporter/lambda$15$Type", 904); - bcb(905, 1, {}, rrd); - mdb(Wte, "JsonImporter/lambda$16$Type", 905); - bcb(906, 1, {}, srd); - mdb(Wte, "JsonImporter/lambda$17$Type", 906); - bcb(907, 1, {}, trd); - mdb(Wte, "JsonImporter/lambda$18$Type", 907); - bcb(912, 1, {}, urd); - mdb(Wte, "JsonImporter/lambda$19$Type", 912); - bcb(893, 1, {}, vrd); - mdb(Wte, "JsonImporter/lambda$2$Type", 893); - bcb(910, 1, {}, wrd); - mdb(Wte, "JsonImporter/lambda$20$Type", 910); - bcb(911, 1, {}, xrd); - mdb(Wte, "JsonImporter/lambda$21$Type", 911); - bcb(915, 1, {}, yrd); - mdb(Wte, "JsonImporter/lambda$22$Type", 915); - bcb(913, 1, {}, zrd); - mdb(Wte, "JsonImporter/lambda$23$Type", 913); - bcb(914, 1, {}, Ard); - mdb(Wte, "JsonImporter/lambda$24$Type", 914); - bcb(917, 1, {}, Brd); - mdb(Wte, "JsonImporter/lambda$25$Type", 917); - bcb(916, 1, {}, Crd); - mdb(Wte, "JsonImporter/lambda$26$Type", 916); - bcb(918, 1, qie, Drd); - _2.td = function Erd(a) { - Bqd(this.b, this.a, GD(a)); - }; - mdb(Wte, "JsonImporter/lambda$27$Type", 918); - bcb(919, 1, qie, Frd); - _2.td = function Grd(a) { - Cqd(this.b, this.a, GD(a)); - }; - mdb(Wte, "JsonImporter/lambda$28$Type", 919); - bcb(920, 1, {}, Hrd); - mdb(Wte, "JsonImporter/lambda$29$Type", 920); - bcb(896, 1, {}, Ird); - mdb(Wte, "JsonImporter/lambda$3$Type", 896); - bcb(921, 1, {}, Jrd); - mdb(Wte, "JsonImporter/lambda$30$Type", 921); - bcb(922, 1, {}, Krd); - mdb(Wte, "JsonImporter/lambda$31$Type", 922); - bcb(923, 1, {}, Lrd); - mdb(Wte, "JsonImporter/lambda$32$Type", 923); - bcb(924, 1, {}, Mrd); - mdb(Wte, "JsonImporter/lambda$33$Type", 924); - bcb(925, 1, {}, Nrd); - mdb(Wte, "JsonImporter/lambda$34$Type", 925); - bcb(859, 1, {}, Prd); - mdb(Wte, "JsonImporter/lambda$35$Type", 859); - bcb(929, 1, {}, Rrd); - mdb(Wte, "JsonImporter/lambda$36$Type", 929); - bcb(926, 1, qie, Srd); - _2.td = function Trd(a) { - Lqd(this.a, BD(a, 469)); - }; - mdb(Wte, "JsonImporter/lambda$37$Type", 926); - bcb(927, 1, qie, Urd); - _2.td = function Vrd(a) { - Mqd(this.a, this.b, BD(a, 202)); - }; - mdb(Wte, "JsonImporter/lambda$38$Type", 927); - bcb(928, 1, qie, Wrd); - _2.td = function Xrd(a) { - Nqd(this.a, this.b, BD(a, 202)); - }; - mdb(Wte, "JsonImporter/lambda$39$Type", 928); - bcb(894, 1, {}, Yrd); - mdb(Wte, "JsonImporter/lambda$4$Type", 894); - bcb(930, 1, qie, Zrd); - _2.td = function $rd(a) { - Oqd(this.a, BD(a, 8)); - }; - mdb(Wte, "JsonImporter/lambda$40$Type", 930); - bcb(895, 1, {}, _rd); - mdb(Wte, "JsonImporter/lambda$5$Type", 895); - bcb(899, 1, {}, asd); - mdb(Wte, "JsonImporter/lambda$6$Type", 899); - bcb(897, 1, {}, bsd); - mdb(Wte, "JsonImporter/lambda$7$Type", 897); - bcb(898, 1, {}, csd); - mdb(Wte, "JsonImporter/lambda$8$Type", 898); - bcb(901, 1, {}, dsd); - mdb(Wte, "JsonImporter/lambda$9$Type", 901); - bcb(948, 1, qie, msd); - _2.td = function nsd(a) { - Qpd(this.a, new yC(GD(a))); - }; - mdb(Wte, "JsonMetaDataConverter/lambda$0$Type", 948); - bcb(949, 1, qie, osd); - _2.td = function psd(a) { - isd(this.a, BD(a, 237)); - }; - mdb(Wte, "JsonMetaDataConverter/lambda$1$Type", 949); - bcb(950, 1, qie, qsd); - _2.td = function rsd(a) { - jsd(this.a, BD(a, 149)); - }; - mdb(Wte, "JsonMetaDataConverter/lambda$2$Type", 950); - bcb(951, 1, qie, ssd); - _2.td = function tsd(a) { - ksd(this.a, BD(a, 175)); - }; - mdb(Wte, "JsonMetaDataConverter/lambda$3$Type", 951); - bcb(237, 22, { 3: 1, 35: 1, 22: 1, 237: 1 }, Dsd); - var usd, vsd, wsd, xsd, ysd, zsd, Asd, Bsd; - var O3 = ndb(Hle, "GraphFeature", 237, CI, Fsd, Esd); - var Gsd; - bcb(13, 1, { 35: 1, 146: 1 }, Lsd, Msd, Nsd, Osd); - _2.wd = function Psd(a) { - return Isd(this, BD(a, 146)); - }; - _2.Fb = function Qsd(a) { - return Jsd(this, a); - }; - _2.wg = function Rsd() { - return Ksd(this); - }; - _2.tg = function Ssd() { - return this.b; - }; - _2.Hb = function Tsd() { - return LCb(this.b); - }; - _2.Ib = function Usd() { - return this.b; - }; - mdb(Hle, "Property", 13); - bcb(818, 1, Dke, Wsd); - _2.ue = function Xsd(a, b) { - return Vsd(this, BD(a, 94), BD(b, 94)); - }; - _2.Fb = function Ysd(a) { - return this === a; - }; - _2.ve = function Zsd() { - return new tpb(this); - }; - mdb(Hle, "PropertyHolderComparator", 818); - bcb(695, 1, aie, qtd); - _2.Nb = function rtd(a) { - Rrb(this, a); - }; - _2.Pb = function ttd() { - return ptd(this); - }; - _2.Qb = function utd() { - Srb(); - }; - _2.Ob = function std() { - return !!this.a; - }; - mdb(jue, "ElkGraphUtil/AncestorIterator", 695); - var T4 = odb(Tte, "EList"); - bcb(67, 52, { 20: 1, 28: 1, 52: 1, 14: 1, 15: 1, 67: 1, 58: 1 }); - _2.Vc = function Jtd(a, b) { - vtd(this, a, b); - }; - _2.Fc = function Ktd(a) { - return wtd(this, a); - }; - _2.Wc = function Ltd(a, b) { - return xtd(this, a, b); - }; - _2.Gc = function Mtd(a) { - return ytd(this, a); - }; - _2.Zh = function Ntd() { - return new $yd(this); - }; - _2.$h = function Otd() { - return new bzd(this); - }; - _2._h = function Ptd(a) { - return ztd(this, a); - }; - _2.ai = function Qtd() { - return true; - }; - _2.bi = function Rtd(a, b) { - }; - _2.ci = function Std() { - }; - _2.di = function Ttd(a, b) { - Atd(this, a, b); - }; - _2.ei = function Utd(a, b, c2) { - }; - _2.fi = function Vtd(a, b) { - }; - _2.gi = function Wtd(a, b, c2) { - }; - _2.Fb = function Xtd(a) { - return Btd(this, a); - }; - _2.Hb = function Ytd() { - return Etd(this); - }; - _2.hi = function Ztd() { - return false; - }; - _2.Kc = function $td() { - return new Fyd(this); - }; - _2.Yc = function _td() { - return new Oyd(this); - }; - _2.Zc = function aud(a) { - var b; - b = this.gc(); - if (a < 0 || a > b) - throw vbb(new Cyd(a, b)); - return new Pyd(this, a); - }; - _2.ji = function bud(a, b) { - this.ii(a, this.Xc(b)); - }; - _2.Mc = function cud(a) { - return Ftd(this, a); - }; - _2.li = function dud(a, b) { - return b; - }; - _2._c = function eud(a, b) { - return Gtd(this, a, b); - }; - _2.Ib = function fud() { - return Htd(this); - }; - _2.ni = function gud() { - return true; - }; - _2.oi = function hud(a, b) { - return Itd(this, b); - }; - mdb(Tte, "AbstractEList", 67); - bcb(63, 67, oue, yud, zud, Aud); - _2.Vh = function Bud(a, b) { - return iud(this, a, b); - }; - _2.Wh = function Cud(a) { - return jud(this, a); - }; - _2.Xh = function Dud(a, b) { - kud(this, a, b); - }; - _2.Yh = function Eud(a) { - lud(this, a); - }; - _2.pi = function Fud(a) { - return nud(this, a); - }; - _2.$b = function Gud() { - oud(this); - }; - _2.Hc = function Hud(a) { - return pud(this, a); - }; - _2.Xb = function Iud(a) { - return qud(this, a); - }; - _2.qi = function Jud(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.ri(b); - d != null && $fb(d, 0, this.g, 0, this.i); - } - }; - _2.Xc = function Kud(a) { - return rud(this, a); - }; - _2.dc = function Lud() { - return this.i == 0; - }; - _2.ii = function Mud(a, b) { - return sud(this, a, b); - }; - _2.ri = function Nud(a) { - return KC(SI, Uhe, 1, a, 5, 1); - }; - _2.ki = function Oud(a) { - return this.g[a]; - }; - _2.$c = function Pud(a) { - return tud(this, a); - }; - _2.mi = function Qud(a, b) { - return uud(this, a, b); - }; - _2.gc = function Rud() { - return this.i; - }; - _2.Pc = function Sud() { - return wud(this); - }; - _2.Qc = function Tud(a) { - return xud(this, a); - }; - _2.i = 0; - var y4 = mdb(Tte, "BasicEList", 63); - var X4 = odb(Tte, "TreeIterator"); - bcb(694, 63, pue); - _2.Nb = function Xud(a) { - Rrb(this, a); - }; - _2.Ob = function Yud() { - return this.g == null && !this.c ? Uud(this) : this.g == null || this.i != 0 && BD(this.g[this.i - 1], 47).Ob(); - }; - _2.Pb = function Zud() { - return Vud(this); - }; - _2.Qb = function $ud() { - if (!this.e) { - throw vbb(new Zdb("There is no valid object to remove.")); - } - this.e.Qb(); - }; - _2.c = false; - mdb(Tte, "AbstractTreeIterator", 694); - bcb(685, 694, pue, _ud); - _2.si = function avd(a) { - var b; - b = BD(a, 56).Wg().Kc(); - JD(b, 279) && BD(b, 279).Nk(new bvd()); - return b; - }; - mdb(jue, "ElkGraphUtil/PropertiesSkippingTreeIterator", 685); - bcb(952, 1, {}, bvd); - mdb(jue, "ElkGraphUtil/PropertiesSkippingTreeIterator/1", 952); - var cvd, dvd; - var Y3 = mdb(jue, "ElkReflect", null); - bcb(889, 1, hse, jvd); - _2.vg = function kvd(a) { - return evd(), sqb(BD(a, 174)); - }; - mdb(jue, "ElkReflect/lambda$0$Type", 889); - var lvd; - odb(Tte, "ResourceLocator"); - bcb(1051, 1, {}); - mdb(Tte, "DelegatingResourceLocator", 1051); - bcb(1052, 1051, {}); - mdb("org.eclipse.emf.common", "EMFPlugin", 1052); - var $3 = odb(cve, "Adapter"); - var _3 = odb(cve, "Notification"); - bcb(1153, 1, dve); - _2.ti = function vvd() { - return this.d; - }; - _2.ui = function wvd(a) { - }; - _2.vi = function xvd(a) { - this.d = a; - }; - _2.wi = function yvd(a) { - this.d == a && (this.d = null); - }; - _2.d = null; - mdb(hte, "AdapterImpl", 1153); - bcb(1995, 67, eve); - _2.Vh = function Fvd(a, b) { - return zvd(this, a, b); - }; - _2.Wh = function Gvd(a) { - var b, c2, d; - ++this.j; - if (a.dc()) { - return false; - } else { - b = this.Vi(); - for (d = a.Kc(); d.Ob(); ) { - c2 = d.Pb(); - this.Ii(this.oi(b, c2)); - ++b; - } - return true; - } - }; - _2.Xh = function Hvd(a, b) { - Avd(this, a, b); - }; - _2.Yh = function Ivd(a) { - Bvd(this, a); - }; - _2.Gi = function Jvd() { - return this.Ji(); - }; - _2.$b = function Kvd() { - Cvd(this, this.Vi(), this.Wi()); - }; - _2.Hc = function Lvd(a) { - return this.Li(a); - }; - _2.Ic = function Mvd(a) { - return this.Mi(a); - }; - _2.Hi = function Nvd(a, b) { - this.Si().jm(); - }; - _2.Ii = function Ovd(a) { - this.Si().jm(); - }; - _2.Ji = function Pvd() { - return this.Si(); - }; - _2.Ki = function Qvd() { - this.Si().jm(); - }; - _2.Li = function Rvd(a) { - return this.Si().jm(); - }; - _2.Mi = function Svd(a) { - return this.Si().jm(); - }; - _2.Ni = function Tvd(a) { - return this.Si().jm(); - }; - _2.Oi = function Uvd(a) { - return this.Si().jm(); - }; - _2.Pi = function Vvd() { - return this.Si().jm(); - }; - _2.Qi = function Wvd(a) { - return this.Si().jm(); - }; - _2.Ri = function Xvd() { - return this.Si().jm(); - }; - _2.Ti = function Yvd(a) { - return this.Si().jm(); - }; - _2.Ui = function Zvd(a, b) { - return this.Si().jm(); - }; - _2.Vi = function $vd() { - return this.Si().jm(); - }; - _2.Wi = function _vd() { - return this.Si().jm(); - }; - _2.Xi = function awd(a) { - return this.Si().jm(); - }; - _2.Yi = function bwd() { - return this.Si().jm(); - }; - _2.Fb = function cwd(a) { - return this.Ni(a); - }; - _2.Xb = function dwd(a) { - return this.li(a, this.Oi(a)); - }; - _2.Hb = function ewd() { - return this.Pi(); - }; - _2.Xc = function fwd(a) { - return this.Qi(a); - }; - _2.dc = function gwd() { - return this.Ri(); - }; - _2.ii = function hwd(a, b) { - return Dvd(this, a, b); - }; - _2.ki = function iwd(a) { - return this.Oi(a); - }; - _2.$c = function jwd(a) { - return Evd(this, a); - }; - _2.Mc = function kwd(a) { - var b; - b = this.Xc(a); - if (b >= 0) { - this.$c(b); - return true; - } else { - return false; - } - }; - _2.mi = function lwd(a, b) { - return this.Ui(a, this.oi(a, b)); - }; - _2.gc = function mwd() { - return this.Vi(); - }; - _2.Pc = function nwd() { - return this.Wi(); - }; - _2.Qc = function owd(a) { - return this.Xi(a); - }; - _2.Ib = function pwd() { - return this.Yi(); - }; - mdb(Tte, "DelegatingEList", 1995); - bcb(1996, 1995, eve); - _2.Vh = function xwd(a, b) { - return qwd(this, a, b); - }; - _2.Wh = function ywd(a) { - return this.Vh(this.Vi(), a); - }; - _2.Xh = function zwd(a, b) { - rwd(this, a, b); - }; - _2.Yh = function Awd(a) { - swd(this, a); - }; - _2.ai = function Bwd() { - return !this.bj(); - }; - _2.$b = function Cwd() { - vwd(this); - }; - _2.Zi = function Dwd(a, b, c2, d, e) { - return new Cxd(this, a, b, c2, d, e); - }; - _2.$i = function Ewd(a) { - Uhd(this.Ai(), a); - }; - _2._i = function Fwd() { - return null; - }; - _2.aj = function Gwd() { - return -1; - }; - _2.Ai = function Hwd() { - return null; - }; - _2.bj = function Iwd() { - return false; - }; - _2.cj = function Jwd(a, b) { - return b; - }; - _2.dj = function Kwd(a, b) { - return b; - }; - _2.ej = function Lwd() { - return false; - }; - _2.fj = function Mwd() { - return !this.Ri(); - }; - _2.ii = function Nwd(a, b) { - var c2, d; - if (this.ej()) { - d = this.fj(); - c2 = Dvd(this, a, b); - this.$i(this.Zi(7, meb(b), c2, a, d)); - return c2; + } + 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(state5) { + return -state5.tension * state5.x - state5.friction * state5.v; + } + __name(springAccelerationForState, "springAccelerationForState"); + function springEvaluateStateWithDerivative(initialState, dt, derivative) { + var state5 = { + x: initialState.x + derivative.dx * dt, + v: initialState.v + derivative.dv * dt, + tension: initialState.tension, + friction: initialState.friction + }; + return { + dx: state5.v, + dv: springAccelerationForState(state5) + }; + } + __name(springEvaluateStateWithDerivative, "springEvaluateStateWithDerivative"); + function springIntegrateState(state5, dt) { + var a2 = { + dx: state5.v, + dv: springAccelerationForState(state5) + }, b2 = springEvaluateStateWithDerivative(state5, dt * 0.5, a2), c3 = springEvaluateStateWithDerivative(state5, dt * 0.5, b2), d2 = springEvaluateStateWithDerivative(state5, 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); + state5.x = state5.x + dxdt * dt; + state5.v = state5.v + dvdt * dt; + return state5; + } + __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; + } + } + 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; + } + requestAnimationFrame2(/* @__PURE__ */ __name(function animationStep(now4) { + stepAll(now4, cy); + headlessStep(); + }, "animationStep")); + } + __name(headlessStep, "headlessStep"); + var renderer8 = cy.renderer(); + if (renderer8 && renderer8.beforeRender) { + renderer8.beforeRender(/* @__PURE__ */ __name(function rendererAnimationStep(willDraw, now4) { + stepAll(now4, cy); + }, "rendererAnimationStep"), renderer8.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 renderer8 = this._private.renderer; + options3 = options3 || {}; + return renderer8.png(options3); + }, "png"), + jpg: /* @__PURE__ */ __name(function jpg(options3) { + var renderer8 = this._private.renderer; + options3 = options3 || {}; + options3.bg = options3.bg || "#fff"; + return renderer8.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); + } + return; + } + if (!_p.notificationsEnabled) { + return; + } + var renderer8 = this.renderer(); + if (this.destroyed() || !renderer8) { + return; + } + renderer8.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 renderer8 = this.renderer(); + Object.keys(_p.batchNotifications).forEach(function(eventName) { + var eles = _p.batchNotifications[eventName]; + if (eles.empty()) { + renderer8.notify(eventName); } else { - return Dvd(this, a, b); + renderer8.notify(eventName, eles); } - }; - _2.$c = function Owd(a) { - var b, c2, d, e; - if (this.ej()) { - c2 = null; - d = this.fj(); - b = this.Zi(4, e = Evd(this, a), null, a, d); - if (this.bj() && !!e) { - c2 = this.dj(e, c2); - if (!c2) { - this.$i(b); - } else { - c2.Ei(b); - c2.Fi(); - } - } else { - if (!c2) { - this.$i(b); - } else { - c2.Ei(b); - c2.Fi(); - } + }); + } + 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 id27 = ids[i2]; + var data5 = map5[id27]; + var ele = cy.getElementById(id27); + ele.data(data5); + } + }); + }, "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]); + } + } + 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 = {}; + } + 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; + } + 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; } - return e; - } else { - e = Evd(this, a); - if (this.bj() && !!e) { - c2 = this.dj(e, null); - !!c2 && c2.Fi(); + laterCxtOverrides = laterCxt.properties[prop.name] != null; + if (laterCxtOverrides) { + break; } - return e; } - }; - _2.mi = function Pwd(a, b) { - return wwd(this, a, b); - }; - mdb(hte, "DelegatingNotifyingListImpl", 1996); - bcb(143, 1, fve); - _2.Ei = function pxd(a) { - return Qwd(this, a); - }; - _2.Fi = function qxd() { - Rwd(this); - }; - _2.xi = function rxd() { - return this.d; - }; - _2._i = function sxd() { - return null; - }; - _2.gj = function txd() { - return null; - }; - _2.yi = function uxd(a) { - return -1; - }; - _2.zi = function vxd() { - return $wd(this); - }; - _2.Ai = function wxd() { - return null; - }; - _2.Bi = function xxd() { - return hxd(this); - }; - _2.Ci = function yxd() { - return this.o < 0 ? this.o < -2 ? -2 - this.o - 1 : -1 : this.o; - }; - _2.hj = function zxd() { - return false; - }; - _2.Di = function Axd(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l; - switch (this.d) { - case 1: - case 2: { - e = a.xi(); - switch (e) { - case 1: - case 2: { - f2 = a.Ai(); - if (PD(f2) === PD(this.Ai()) && this.yi(null) == a.yi(null)) { - this.g = a.zi(); - a.xi() == 1 && (this.d = 1); - return true; - } - } - } - } - case 4: { - e = a.xi(); - switch (e) { - case 4: { - f2 = a.Ai(); - if (PD(f2) === PD(this.Ai()) && this.yi(null) == a.yi(null)) { - j = jxd(this); - i3 = this.o < 0 ? this.o < -2 ? -2 - this.o - 1 : -1 : this.o; - g = a.Ci(); - this.d = 6; - l = new zud(2); - if (i3 <= g) { - wtd(l, this.n); - wtd(l, a.Bi()); - this.g = OC(GC(WD, 1), oje, 25, 15, [this.o = i3, g + 1]); - } else { - wtd(l, a.Bi()); - wtd(l, this.n); - this.g = OC(GC(WD, 1), oje, 25, 15, [this.o = g, i3]); - } - this.n = l; - j || (this.o = -2 - this.o - 1); - return true; - } - break; - } - } - break; - } - case 6: { - e = a.xi(); - switch (e) { - case 4: { - f2 = a.Ai(); - if (PD(f2) === PD(this.Ai()) && this.yi(null) == a.yi(null)) { - j = jxd(this); - g = a.Ci(); - k = BD(this.g, 48); - d = KC(WD, oje, 25, k.length + 1, 15, 1); - b = 0; - while (b < k.length) { - h = k[b]; - if (h <= g) { - d[b++] = h; - ++g; - } else { - break; - } - } - c2 = BD(this.n, 15); - c2.Vc(b, a.Bi()); - 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; - } + if (!addedProp[name] && !laterCxtOverrides) { + addedProp[name] = true; + diffProps.push(name); } + } + } + } + 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 + }; + } + } + 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 = /* @__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); + } + } 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]; + } + if (fieldVal == null) { + printMappingErr(); return false; - }; - _2.Ib = function Bxd() { - var a, b, c2, d; - d = new Jfb(hdb(this.gm) + "@" + (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: { - Cfb(d, this.d); - break; - } - } - ixd(this) && (d.a += ", touch: true", d); - d.a += ", position: "; - Cfb(d, this.o < 0 ? this.o < -2 ? -2 - this.o - 1 : -1 : this.o); - d.a += ", notifier: "; - Dfb(d, this.Ai()); - d.a += ", feature: "; - Dfb(d, this._i()); - d.a += ", oldValue: "; - Dfb(d, hxd(this)); - d.a += ", newValue: "; - if (this.d == 6 && JD(this.g, 48)) { - c2 = BD(this.g, 48); - d.a += "["; - for (a = 0; a < c2.length; ) { - d.a += c2[a]; - ++a < c2.length && (d.a += She, d); - } - d.a += "]"; + } + 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; + } else { + var fieldWidth = prop.fieldMax - prop.fieldMin; + if (fieldWidth === 0) { + percent = 0; } else { - Dfb(d, $wd(this)); - } - d.a += ", isTouch: "; - Ffb(d, ixd(this)); - d.a += ", wasSet: "; - Ffb(d, jxd(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; - mdb(hte, "NotificationImpl", 143); - bcb(1167, 143, fve, Cxd); - _2._i = function Dxd() { - return this.a._i(); - }; - _2.yi = function Exd(a) { - return this.a.aj(); - }; - _2.Ai = function Fxd() { - return this.a.Ai(); - }; - mdb(hte, "DelegatingNotifyingListImpl/1", 1167); - bcb(242, 63, oue, Hxd, Ixd); - _2.Fc = function Jxd(a) { - return Gxd(this, BD(a, 366)); - }; - _2.Ei = function Kxd(a) { - return Gxd(this, a); - }; - _2.Fi = function Lxd() { - var a, b, c2; - for (a = 0; a < this.i; ++a) { - b = BD(this.g[a], 366); - c2 = b.Ai(); - c2 != null && b.xi() != -1 && BD(c2, 92).Ng(b); + percent = (fieldVal - prop.fieldMin) / fieldWidth; } - }; - _2.ri = function Mxd(a) { - return KC(_3, Uhe, 366, a, 0, 1); - }; - mdb(hte, "NotificationChainImpl", 242); - bcb(1378, 90, gte); - _2.Kg = function Nxd() { - return this.e; - }; - _2.Mg = function Oxd() { - return (this.f & 1) != 0; - }; - _2.f = 1; - mdb(hte, "NotifierImpl", 1378); - bcb(1993, 63, oue); - _2.Vh = function $xd(a, b) { - return Pxd(this, a, b); - }; - _2.Wh = function _xd(a) { - return this.Vh(this.i, a); - }; - _2.Xh = function ayd(a, b) { - Qxd(this, a, b); - }; - _2.Yh = function byd(a) { - Rxd(this, a); - }; - _2.ai = function cyd() { - return !this.bj(); - }; - _2.$b = function dyd() { - Uxd(this); - }; - _2.Zi = function eyd(a, b, c2, d, e) { - return new vyd(this, a, b, c2, d, e); - }; - _2.$i = function fyd(a) { - Uhd(this.Ai(), a); - }; - _2._i = function gyd() { - return null; - }; - _2.aj = function hyd() { - return -1; - }; - _2.Ai = function iyd() { - return null; - }; - _2.bj = function jyd() { + } + if (percent < 0) { + percent = 0; + } else if (percent > 1) { + percent = 1; + } + 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; - }; - _2.ij = function kyd() { + } + if (!flatProp) { + printMappingErr(); return false; - }; - _2.cj = function lyd(a, b) { - return b; - }; - _2.dj = function myd(a, b) { - return b; - }; - _2.ej = function nyd() { + } + 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]; + } + if (_fieldVal != null) { + flatProp = this.parse(prop.name, _fieldVal, prop.bypass, flatPropMapping); + } + if (!flatProp) { + printMappingErr(); return false; - }; - _2.fj = function oyd() { - return this.i != 0; - }; - _2.ii = function pyd(a, b) { - return Wxd(this, a, b); - }; - _2.$c = function qyd(a) { - return Xxd(this, a); - }; - _2.mi = function ryd(a, b) { - return Zxd(this, a, b); - }; - _2.jj = function syd(a, b) { - return b; - }; - _2.kj = function tyd(a, b) { - return b; - }; - _2.lj = function uyd(a, b, c2) { - return c2; - }; - mdb(hte, "NotifyingListImpl", 1993); - bcb(1166, 143, fve, vyd); - _2._i = function wyd() { - return this.a._i(); - }; - _2.yi = function xyd(a) { - return this.a.aj(); - }; - _2.Ai = function yyd() { - return this.a.Ai(); - }; - mdb(hte, "NotifyingListImpl/1", 1166); - bcb(953, 63, oue, zyd); - _2.Hc = function Ayd(a) { - if (this.i > 10) { - if (!this.b || this.c.j != this.a) { - this.b = new Vqb(this); - this.a = this.j; - } - return Rqb(this.b, a); - } else { - return pud(this, a); - } - }; - _2.ni = function Byd() { - return true; - }; - _2.a = 0; - mdb(Tte, "AbstractEList/1", 953); - bcb(295, 73, Mje, Cyd); - mdb(Tte, "AbstractEList/BasicIndexOutOfBoundsException", 295); - bcb(40, 1, aie, Fyd); - _2.Nb = function Iyd(a) { - Rrb(this, a); - }; - _2.mj = function Gyd() { - if (this.i.j != this.f) { - throw vbb(new Apb()); - } - }; - _2.nj = function Hyd() { - return Dyd(this); - }; - _2.Ob = function Jyd() { - return this.e != this.i.gc(); - }; - _2.Pb = function Kyd() { - return this.nj(); - }; - _2.Qb = function Lyd() { - Eyd(this); - }; - _2.e = 0; - _2.f = 0; - _2.g = -1; - mdb(Tte, "AbstractEList/EIterator", 40); - bcb(278, 40, jie, Oyd, Pyd); - _2.Qb = function Xyd() { - Eyd(this); - }; - _2.Rb = function Qyd(a) { - Myd(this, a); - }; - _2.oj = function Ryd() { - var b; - try { - b = this.d.Xb(--this.e); - this.mj(); - this.g = this.e; - return b; - } catch (a) { - a = ubb(a); - if (JD(a, 73)) { - this.mj(); - throw vbb(new utb()); - } else - throw vbb(a); - } - }; - _2.pj = function Syd(a) { - Nyd(this, a); - }; - _2.Sb = function Tyd() { - return this.e != 0; - }; - _2.Tb = function Uyd() { - return this.e; - }; - _2.Ub = function Vyd() { - return this.oj(); - }; - _2.Vb = function Wyd() { - return this.e - 1; - }; - _2.Wb = function Yyd(a) { - this.pj(a); - }; - mdb(Tte, "AbstractEList/EListIterator", 278); - bcb(341, 40, aie, $yd); - _2.nj = function _yd() { - return Zyd(this); - }; - _2.Qb = function azd() { - throw vbb(new bgb()); - }; - mdb(Tte, "AbstractEList/NonResolvingEIterator", 341); - bcb(385, 278, jie, bzd, czd); - _2.Rb = function dzd(a) { - throw vbb(new bgb()); - }; - _2.nj = function ezd() { - var b; - try { - b = this.c.ki(this.e); - this.mj(); - this.g = this.e++; - return b; - } catch (a) { - a = ubb(a); - if (JD(a, 73)) { - this.mj(); - throw vbb(new utb()); - } else - throw vbb(a); - } - }; - _2.oj = function fzd() { - var b; - try { - b = this.c.ki(--this.e); - this.mj(); - this.g = this.e; - return b; - } catch (a) { - a = ubb(a); - if (JD(a, 73)) { - this.mj(); - throw vbb(new utb()); - } else - throw vbb(a); - } - }; - _2.Qb = function gzd() { - throw vbb(new bgb()); - }; - _2.Wb = function hzd(a) { - throw vbb(new bgb()); - }; - mdb(Tte, "AbstractEList/NonResolvingEListIterator", 385); - bcb(1982, 67, ive); - _2.Vh = function pzd(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m; - e = b.gc(); - if (e != 0) { - j = BD(Ajd(this.a, 4), 126); - k = j == null ? 0 : j.length; - m = k + e; - d = nzd(this, m); - l = k - a; - l > 0 && $fb(j, a, d, a + e, l); - i3 = b.Kc(); - for (g = 0; g < e; ++g) { - h = i3.Pb(); - c2 = a + g; - lzd(d, c2, Itd(this, h)); - } - b0d(this, d); - for (f2 = 0; f2 < e; ++f2) { - h = d[a]; - this.bi(a, h); - ++a; - } - return true; - } else { - ++this.j; - return false; - } - }; - _2.Wh = function qzd(a) { - var b, c2, d, e, f2, g, h, i3, j; - d = a.gc(); - if (d != 0) { - i3 = (c2 = BD(Ajd(this.a, 4), 126), c2 == null ? 0 : c2.length); - j = i3 + d; - b = nzd(this, j); - h = a.Kc(); - for (f2 = i3; f2 < j; ++f2) { - g = h.Pb(); - lzd(b, f2, Itd(this, g)); - } - b0d(this, b); - for (e = i3; e < j; ++e) { - g = b[e]; - this.bi(e, g); - } - return true; - } else { - ++this.j; - return false; - } - }; - _2.Xh = function rzd(a, b) { - var c2, d, e, f2; - d = BD(Ajd(this.a, 4), 126); - e = d == null ? 0 : d.length; - c2 = nzd(this, e + 1); - f2 = Itd(this, b); - a != e && $fb(d, a, c2, a + 1, e - a); - NC(c2, a, f2); - b0d(this, c2); - this.bi(a, b); - }; - _2.Yh = function szd(a) { - var b, c2, d; - d = (c2 = BD(Ajd(this.a, 4), 126), c2 == null ? 0 : c2.length); - b = nzd(this, d + 1); - lzd(b, d, Itd(this, a)); - b0d(this, b); - this.bi(d, a); - }; - _2.Zh = function tzd() { - return new Uzd(this); - }; - _2.$h = function uzd() { - return new Xzd(this); - }; - _2._h = function vzd(a) { - var b, c2; - c2 = (b = BD(Ajd(this.a, 4), 126), b == null ? 0 : b.length); - if (a < 0 || a > c2) - throw vbb(new Cyd(a, c2)); - return new Yzd(this, a); - }; - _2.$b = function wzd() { - var a, b; - ++this.j; - a = BD(Ajd(this.a, 4), 126); - b = a == null ? 0 : a.length; - b0d(this, null); - Atd(this, b, a); - }; - _2.Hc = function xzd(a) { - var b, c2, d, e, f2; - b = BD(Ajd(this.a, 4), 126); - 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 (PD(c2) === PD(a)) { - return true; - } - } - } - } + } + 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; - }; - _2.Xb = function yzd(a) { - var b, c2; - b = BD(Ajd(this.a, 4), 126); - c2 = b == null ? 0 : b.length; - if (a >= c2) - throw vbb(new Cyd(a, c2)); - return b[a]; - }; - _2.Xc = function zzd(a) { - var b, c2, d; - b = BD(Ajd(this.a, 4), 126); - if (b != null) { - if (a != null) { - for (c2 = 0, d = b.length; c2 < d; ++c2) { - if (pb(a, b[c2])) { - return c2; - } - } + } + 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 = 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 { - for (c2 = 0, d = b.length; c2 < d; ++c2) { - if (PD(b[c2]) === PD(a)) { - return c2; - } - } + style3[propName] = null; } } - return -1; - }; - _2.dc = function Azd() { - return BD(Ajd(this.a, 4), 126) == null; - }; - _2.Kc = function Bzd() { - return new Lzd(this); - }; - _2.Yc = function Czd() { - return new Pzd(this); - }; - _2.Zc = function Dzd(a) { - var b, c2; - c2 = (b = BD(Ajd(this.a, 4), 126), b == null ? 0 : b.length); - if (a < 0 || a > c2) - throw vbb(new Cyd(a, c2)); - return new Qzd(this, a); - }; - _2.ii = function Ezd(a, b) { - var c2, d, e; - c2 = mzd(this); - e = c2 == null ? 0 : c2.length; - if (a >= e) - throw vbb(new qcb(lue + a + mue + e)); - if (b >= e) - throw vbb(new qcb(nue + b + mue + e)); - d = c2[b]; - if (a != b) { - a < b ? $fb(c2, a, c2, a + 1, b - a) : $fb(c2, b + 1, c2, b, a - b); - NC(c2, a, d); - b0d(this, c2); - } - return d; - }; - _2.ki = function Fzd(a) { - return BD(Ajd(this.a, 4), 126)[a]; - }; - _2.$c = function Gzd(a) { - return ozd(this, a); - }; - _2.mi = function Hzd(a, b) { - var c2, d; - c2 = mzd(this); - d = c2[a]; - lzd(c2, a, Itd(this, b)); - b0d(this, c2); - return d; - }; - _2.gc = function Izd() { - var a; - return a = BD(Ajd(this.a, 4), 126), a == null ? 0 : a.length; - }; - _2.Pc = function Jzd() { - var a, b, c2; - a = BD(Ajd(this.a, 4), 126); - c2 = a == null ? 0 : a.length; - b = KC($3, hve, 415, c2, 0, 1); - c2 > 0 && $fb(a, 0, b, 0, c2); - return b; - }; - _2.Qc = function Kzd(a) { - var b, c2, d; - b = BD(Ajd(this.a, 4), 126); - d = b == null ? 0 : b.length; - if (d > 0) { - if (a.length < d) { - c2 = izd(rb(a).c, d); - a = c2; - } - $fb(b, 0, a, 0, d); - } - a.length > d && NC(a, d, null); - return a; - }; - var jzd; - mdb(Tte, "ArrayDelegatingEList", 1982); - bcb(1038, 40, aie, Lzd); - _2.mj = function Mzd() { - if (this.b.j != this.f || PD(BD(Ajd(this.b.a, 4), 126)) !== PD(this.a)) { - throw vbb(new Apb()); - } - }; - _2.Qb = function Nzd() { - Eyd(this); - this.a = BD(Ajd(this.b.a, 4), 126); - }; - mdb(Tte, "ArrayDelegatingEList/EIterator", 1038); - bcb(706, 278, jie, Pzd, Qzd); - _2.mj = function Rzd() { - if (this.b.j != this.f || PD(BD(Ajd(this.b.a, 4), 126)) !== PD(this.a)) { - throw vbb(new Apb()); - } - }; - _2.pj = function Szd(a) { - Nyd(this, a); - this.a = BD(Ajd(this.b.a, 4), 126); - }; - _2.Qb = function Tzd() { - Eyd(this); - this.a = BD(Ajd(this.b.a, 4), 126); - }; - mdb(Tte, "ArrayDelegatingEList/EListIterator", 706); - bcb(1039, 341, aie, Uzd); - _2.mj = function Vzd() { - if (this.b.j != this.f || PD(BD(Ajd(this.b.a, 4), 126)) !== PD(this.a)) { - throw vbb(new Apb()); + } + } + } + }; + 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; + } + 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; + } + 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; + } + if (diff2) { + style3[prop] = toProp.strValue; + this.applyBypass(ele, prop, initVal); + anyPrev = true; + } + } + if (!anyPrev) { + return; + } + _p.transitioning = true; + new Promise$1(function(resolve3) { + if (delay2 > 0) { + ele.delayAnimation(delay2).play().promise().then(resolve3); + } else { + resolve3(); + } + }).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(); } - }; - mdb(Tte, "ArrayDelegatingEList/NonResolvingEIterator", 1039); - bcb(707, 385, jie, Xzd, Yzd); - _2.mj = function Zzd() { - if (this.b.j != this.f || PD(BD(Ajd(this.b.a, 4), 126)) !== PD(this.a)) { - throw vbb(new Apb()); + }); + } + 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); } - }; - mdb(Tte, "ArrayDelegatingEList/NonResolvingEListIterator", 707); - bcb(606, 295, Mje, $zd); - mdb(Tte, "BasicEList/BasicIndexOutOfBoundsException", 606); - bcb(696, 63, oue, _zd); - _2.Vc = function aAd(a, b) { - throw vbb(new bgb()); - }; - _2.Fc = function bAd(a) { - throw vbb(new bgb()); - }; - _2.Wc = function cAd(a, b) { - throw vbb(new bgb()); - }; - _2.Gc = function dAd(a) { - throw vbb(new bgb()); - }; - _2.$b = function eAd() { - throw vbb(new bgb()); - }; - _2.qi = function fAd(a) { - throw vbb(new bgb()); - }; - _2.Kc = function gAd() { - return this.Zh(); - }; - _2.Yc = function hAd() { - return this.$h(); - }; - _2.Zc = function iAd(a) { - return this._h(a); - }; - _2.ii = function jAd(a, b) { - throw vbb(new bgb()); - }; - _2.ji = function kAd(a, b) { - throw vbb(new bgb()); - }; - _2.$c = function lAd(a) { - throw vbb(new bgb()); - }; - _2.Mc = function mAd(a) { - throw vbb(new bgb()); - }; - _2._c = function nAd(a, b) { - throw vbb(new bgb()); - }; - mdb(Tte, "BasicEList/UnmodifiableEList", 696); - bcb(705, 1, { 3: 1, 20: 1, 14: 1, 15: 1, 58: 1, 589: 1 }); - _2.Vc = function OAd(a, b) { - oAd(this, a, BD(b, 42)); - }; - _2.Fc = function PAd(a) { - return pAd(this, BD(a, 42)); - }; - _2.Jc = function XAd(a) { - reb(this, a); - }; - _2.Xb = function YAd(a) { - return BD(qud(this.c, a), 133); - }; - _2.ii = function fBd(a, b) { - return BD(this.c.ii(a, b), 42); - }; - _2.ji = function gBd(a, b) { - GAd(this, a, BD(b, 42)); - }; - _2.Lc = function jBd() { - return new YAb(null, new Kub(this, 16)); - }; - _2.$c = function kBd(a) { - return BD(this.c.$c(a), 42); - }; - _2._c = function mBd(a, b) { - return MAd(this, a, BD(b, 42)); - }; - _2.ad = function oBd(a) { - ktb(this, a); - }; - _2.Nc = function pBd() { - return new Kub(this, 16); - }; - _2.Oc = function qBd() { - return new YAb(null, new Kub(this, 16)); - }; - _2.Wc = function QAd(a, b) { - return this.c.Wc(a, b); - }; - _2.Gc = function RAd(a) { - return this.c.Gc(a); - }; - _2.$b = function SAd() { - this.c.$b(); - }; - _2.Hc = function TAd(a) { - return this.c.Hc(a); - }; - _2.Ic = function UAd(a) { - return Be(this.c, a); - }; - _2.qj = function VAd() { - var a, b, c2; - if (this.d == null) { - this.d = KC(y4, jve, 63, 2 * this.f + 1, 0, 1); - c2 = this.e; - this.f = 0; - for (b = this.c.Kc(); b.e != b.i.gc(); ) { - a = BD(b.nj(), 133); - uAd(this, a); - } - this.e = c2; + } + } + } 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)]; + } + 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 _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 + }; + } + ret = this.applyParsedProperty(ele, copy4(_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 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; + } + 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 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; + } + var value2 = ""; + var parsedProp = this.parse(name, value2, true); + var diffProp = diffProps[prop.name] = { + prev: prevProp }; - _2.Fb = function WAd(a) { - return zAd(this, a); - }; - _2.Hb = function ZAd() { - return Etd(this.c); - }; - _2.Xc = function $Ad(a) { - return this.c.Xc(a); - }; - _2.rj = function _Ad() { - this.c = new yBd(this); - }; - _2.dc = function aBd() { - return this.f == 0; - }; - _2.Kc = function bBd() { - return this.c.Kc(); - }; - _2.Yc = function cBd() { - return this.c.Yc(); - }; - _2.Zc = function dBd(a) { - return this.c.Zc(a); - }; - _2.sj = function eBd() { - return FAd(this); - }; - _2.tj = function hBd(a, b, c2) { - return new zCd(a, b, c2); - }; - _2.uj = function iBd() { - return new EBd(); - }; - _2.Mc = function lBd(a) { - return JAd(this, a); - }; - _2.gc = function nBd() { - return this.f; - }; - _2.bd = function rBd(a, b) { - return new Jib(this.c, a, b); - }; - _2.Pc = function sBd() { - return this.c.Pc(); - }; - _2.Qc = function tBd(a) { - return this.c.Qc(a); - }; - _2.Ib = function uBd() { - return Htd(this.c); - }; - _2.e = 0; - _2.f = 0; - mdb(Tte, "BasicEMap", 705); - bcb(1033, 63, oue, yBd); - _2.bi = function zBd(a, b) { - vBd(this, BD(b, 133)); - }; - _2.ei = function BBd(a, b, c2) { - var d; - ++(d = this, BD(b, 133), d).a.e; - }; - _2.fi = function CBd(a, b) { - wBd(this, BD(b, 133)); - }; - _2.gi = function DBd(a, b, c2) { - xBd(this, BD(b, 133), BD(c2, 133)); - }; - _2.di = function ABd(a, b) { - tAd(this.a); - }; - mdb(Tte, "BasicEMap/1", 1033); - bcb(1034, 63, oue, EBd); - _2.ri = function FBd(a) { - return KC(I4, kve, 612, a, 0, 1); - }; - mdb(Tte, "BasicEMap/2", 1034); - bcb(1035, eie, fie, GBd); - _2.$b = function HBd() { - this.a.c.$b(); - }; - _2.Hc = function IBd(a) { - return qAd(this.a, a); - }; - _2.Kc = function JBd() { - return this.a.f == 0 ? (LCd(), KCd.a) : new dCd(this.a); - }; - _2.Mc = function KBd(a) { - var b; - b = this.a.f; - LAd(this.a, a); - return this.a.f != b; - }; - _2.gc = function LBd() { - return this.a.f; - }; - mdb(Tte, "BasicEMap/3", 1035); - bcb(1036, 28, die, MBd); - _2.$b = function NBd() { - this.a.c.$b(); - }; - _2.Hc = function OBd(a) { - return rAd(this.a, a); - }; - _2.Kc = function PBd() { - return this.a.f == 0 ? (LCd(), KCd.a) : new fCd(this.a); - }; - _2.gc = function QBd() { - return this.a.f; - }; - mdb(Tte, "BasicEMap/4", 1036); - bcb(1037, eie, fie, SBd); - _2.$b = function TBd() { - this.a.c.$b(); - }; - _2.Hc = function UBd(a) { - var b, c2, d, e, f2, g, h, i3, j; - if (this.a.f > 0 && JD(a, 42)) { - this.a.qj(); - i3 = BD(a, 42); - h = i3.cd(); - e = h == null ? 0 : tb(h); - f2 = DAd(this.a, e); - b = this.a.d[f2]; - if (b) { - c2 = BD(b.g, 367); - j = b.i; - for (g = 0; g < j; ++g) { - d = c2[g]; - if (d.Sh() == e && d.Fb(i3)) { - return true; - } - } + 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; + } + } + 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 { + return getValueStringWithUnits(value2, units); } - } - return false; - }; - _2.Kc = function VBd() { - return this.a.f == 0 ? (LCd(), KCd.a) : new ZBd(this.a); - }; - _2.Mc = function WBd(a) { - return RBd(this, a); - }; - _2.gc = function XBd() { - return this.a.f; - }; - mdb(Tte, "BasicEMap/5", 1037); - bcb(613, 1, aie, ZBd); - _2.Nb = function $Bd(a) { - Rrb(this, a); - }; - _2.Ob = function _Bd() { - return this.b != -1; - }; - _2.Pb = function aCd() { - var a; - if (this.f.e != this.c) { - throw vbb(new Apb()); - } - if (this.b == -1) { - throw vbb(new utb()); - } - this.d = this.a; - this.e = this.b; - YBd(this); - a = BD(this.f.d[this.d].g[this.e], 133); - return this.vj(a); - }; - _2.Qb = function bCd() { - if (this.f.e != this.c) { - throw vbb(new Apb()); - } - if (this.e == -1) { - throw vbb(new Ydb()); - } - this.f.c.Mc(qud(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.vj = function cCd(a) { - return a; - }; - _2.a = 0; - _2.b = -1; - _2.c = 0; - _2.d = 0; - _2.e = 0; - mdb(Tte, "BasicEMap/BasicEMapIterator", 613); - bcb(1031, 613, aie, dCd); - _2.vj = function eCd(a) { - return a.cd(); - }; - mdb(Tte, "BasicEMap/BasicEMapKeyIterator", 1031); - bcb(1032, 613, aie, fCd); - _2.vj = function gCd(a) { - return a.dd(); - }; - mdb(Tte, "BasicEMap/BasicEMapValueIterator", 1032); - bcb(1030, 1, cie, iCd); - _2.wc = function oCd(a) { - stb(this, a); - }; - _2.yc = function tCd(a, b, c2) { - return ttb(this, a, b, c2); - }; - _2.$b = function jCd() { - this.a.c.$b(); - }; - _2._b = function kCd(a) { - return hCd(this, a); - }; - _2.uc = function lCd(a) { - return rAd(this.a, a); - }; - _2.vc = function mCd() { - return yAd(this.a); - }; - _2.Fb = function nCd(a) { - return zAd(this.a, a); - }; - _2.xc = function pCd(a) { - return AAd(this.a, a); - }; - _2.Hb = function qCd() { - return Etd(this.a.c); - }; - _2.dc = function rCd() { - return this.a.f == 0; - }; - _2.ec = function sCd() { - return EAd(this.a); - }; - _2.zc = function uCd(a, b) { - return HAd(this.a, a, b); - }; - _2.Bc = function vCd(a) { - return LAd(this.a, a); - }; - _2.gc = function wCd() { - return this.a.f; - }; - _2.Ib = function xCd() { - return Htd(this.a.c); - }; - _2.Cc = function yCd() { - return NAd(this.a); - }; - mdb(Tte, "BasicEMap/DelegatingMap", 1030); - bcb(612, 1, { 42: 1, 133: 1, 612: 1 }, zCd); - _2.Fb = function ACd(a) { - var b; - if (JD(a, 42)) { - b = BD(a, 42); - return (this.b != null ? pb(this.b, b.cd()) : PD(this.b) === PD(b.cd())) && (this.c != null ? pb(this.c, b.dd()) : PD(this.c) === PD(b.dd())); } else { - return false; - } - }; - _2.Sh = function BCd() { - return this.a; - }; - _2.cd = function CCd() { - return this.b; - }; - _2.dd = function DCd() { - return this.c; - }; - _2.Hb = function ECd() { - return this.a ^ (this.c == null ? 0 : tb(this.c)); - }; - _2.Th = function FCd(a) { - this.a = a; - }; - _2.Uh = function GCd(a) { - throw vbb(new gz()); - }; - _2.ed = function HCd(a) { - var b; - b = this.c; - this.c = a; - return b; - }; - _2.Ib = function ICd() { - return this.b + "->" + this.c; - }; - _2.a = 0; - var I4 = mdb(Tte, "BasicEMap/EntryImpl", 612); - bcb(536, 1, {}, JCd); - mdb(Tte, "BasicEMap/View", 536); - var KCd; - bcb(768, 1, {}); - _2.Fb = function ZCd(a) { - return At((mmb(), jmb), a); - }; - _2.Hb = function $Cd() { - return qmb((mmb(), jmb)); - }; - _2.Ib = function _Cd() { - return Fe((mmb(), jmb)); - }; - mdb(Tte, "ECollections/BasicEmptyUnmodifiableEList", 768); - bcb(1312, 1, jie, aDd); - _2.Nb = function cDd(a) { - Rrb(this, a); - }; - _2.Rb = function bDd(a) { - throw vbb(new bgb()); - }; - _2.Ob = function dDd() { - return false; - }; - _2.Sb = function eDd() { - return false; - }; - _2.Pb = function fDd() { - throw vbb(new utb()); - }; - _2.Tb = function gDd() { - return 0; - }; - _2.Ub = function hDd() { - throw vbb(new utb()); - }; - _2.Vb = function iDd() { - return -1; - }; - _2.Qb = function jDd() { - throw vbb(new bgb()); - }; - _2.Wb = function kDd(a) { - throw vbb(new bgb()); - }; - mdb(Tte, "ECollections/BasicEmptyUnmodifiableEList/1", 1312); - bcb(1310, 768, { 20: 1, 14: 1, 15: 1, 58: 1 }, lDd); - _2.Vc = function mDd(a, b) { - OCd(); - }; - _2.Fc = function nDd(a) { - return PCd(); - }; - _2.Wc = function oDd(a, b) { - return QCd(); - }; - _2.Gc = function pDd(a) { - return RCd(); - }; - _2.$b = function qDd() { - SCd(); - }; - _2.Hc = function rDd(a) { - return false; - }; - _2.Ic = function sDd(a) { - return false; - }; - _2.Jc = function tDd(a) { - reb(this, a); - }; - _2.Xb = function uDd(a) { - return wmb((mmb(), a)), null; - }; - _2.Xc = function vDd(a) { - return -1; - }; - _2.dc = function wDd() { - return true; - }; - _2.Kc = function xDd() { - return this.a; - }; - _2.Yc = function yDd() { - return this.a; - }; - _2.Zc = function zDd(a) { - return this.a; - }; - _2.ii = function ADd(a, b) { - return TCd(); - }; - _2.ji = function BDd(a, b) { - UCd(); - }; - _2.Lc = function CDd() { - return new YAb(null, new Kub(this, 16)); - }; - _2.$c = function DDd(a) { - return VCd(); - }; - _2.Mc = function EDd(a) { - return WCd(); - }; - _2._c = function FDd(a, b) { - return XCd(); - }; - _2.gc = function GDd() { - return 0; - }; - _2.ad = function HDd(a) { - ktb(this, a); - }; - _2.Nc = function IDd() { - return new Kub(this, 16); - }; - _2.Oc = function JDd() { - return new YAb(null, new Kub(this, 16)); - }; - _2.bd = function KDd(a, b) { - return mmb(), new Jib(jmb, a, b); - }; - _2.Pc = function LDd() { - return De((mmb(), jmb)); - }; - _2.Qc = function MDd(a) { - return mmb(), Ee(jmb, a); - }; - mdb(Tte, "ECollections/EmptyUnmodifiableEList", 1310); - bcb(1311, 768, { 20: 1, 14: 1, 15: 1, 58: 1, 589: 1 }, NDd); - _2.Vc = function ODd(a, b) { - OCd(); - }; - _2.Fc = function PDd(a) { - return PCd(); - }; - _2.Wc = function QDd(a, b) { - return QCd(); - }; - _2.Gc = function RDd(a) { - return RCd(); - }; - _2.$b = function SDd() { - SCd(); - }; - _2.Hc = function TDd(a) { - return false; - }; - _2.Ic = function UDd(a) { - return false; - }; - _2.Jc = function VDd(a) { - reb(this, a); - }; - _2.Xb = function WDd(a) { - return wmb((mmb(), a)), null; - }; - _2.Xc = function XDd(a) { - return -1; - }; - _2.dc = function YDd() { - return true; - }; - _2.Kc = function ZDd() { - return this.a; - }; - _2.Yc = function $Dd() { - return this.a; - }; - _2.Zc = function _Dd(a) { - return this.a; - }; - _2.ii = function bEd(a, b) { - return TCd(); - }; - _2.ji = function cEd(a, b) { - UCd(); - }; - _2.Lc = function dEd() { - return new YAb(null, new Kub(this, 16)); - }; - _2.$c = function eEd(a) { - return VCd(); - }; - _2.Mc = function fEd(a) { - return WCd(); - }; - _2._c = function gEd(a, b) { - return XCd(); - }; - _2.gc = function hEd() { - return 0; - }; - _2.ad = function iEd(a) { - ktb(this, a); - }; - _2.Nc = function jEd() { - return new Kub(this, 16); - }; - _2.Oc = function kEd() { - return new YAb(null, new Kub(this, 16)); - }; - _2.bd = function lEd(a, b) { - return mmb(), new Jib(jmb, a, b); - }; - _2.Pc = function mEd() { - return De((mmb(), jmb)); - }; - _2.Qc = function nEd(a) { - return mmb(), Ee(jmb, a); - }; - _2.sj = function aEd() { - return mmb(), mmb(), kmb; - }; - mdb(Tte, "ECollections/EmptyUnmodifiableEMap", 1311); - var U4 = odb(Tte, "Enumerator"); - var oEd; - bcb(281, 1, { 281: 1 }, NEd); - _2.Fb = function REd(a) { - var b; - if (this === a) - return true; - if (!JD(a, 281)) - return false; - b = BD(a, 281); - return this.f == b.f && TEd(this.i, b.i) && SEd(this.a, (this.f & 256) != 0 ? (b.f & 256) != 0 ? b.a : null : (b.f & 256) != 0 ? null : b.a) && SEd(this.d, b.d) && SEd(this.g, b.g) && SEd(this.e, b.e) && KEd(this, b); - }; - _2.Hb = function WEd() { - return this.f; - }; - _2.Ib = function cFd() { - return LEd(this); - }; - _2.f = 0; - var sEd = 0, tEd = 0, uEd = 0, vEd = 0, wEd = 0, xEd = 0, yEd = 0, zEd = 0, AEd = 0, BEd, CEd = 0, DEd = 0, EEd = 0, FEd = 0, GEd, HEd; - mdb(Tte, "URI", 281); - bcb(1091, 43, fke, mFd); - _2.zc = function nFd(a, b) { - return BD(Shb(this, GD(a), BD(b, 281)), 281); - }; - mdb(Tte, "URI/URICache", 1091); - bcb(497, 63, oue, oFd, pFd); - _2.hi = function qFd() { - return true; - }; - mdb(Tte, "UniqueEList", 497); - bcb(581, 60, Tie, rFd); - mdb(Tte, "WrappedException", 581); - var a5 = odb(Vse, nve); - var v52 = odb(Vse, ove); - var t5 = odb(Vse, pve); - var b5 = odb(Vse, qve); - var d5 = odb(Vse, rve); - var c5 = odb(Vse, "EClass"); - var f5 = odb(Vse, "EDataType"); - var sFd; - bcb(1183, 43, fke, vFd); - _2.xc = function wFd(a) { - return ND(a) ? Phb(this, a) : Wd(irb(this.f, a)); - }; - mdb(Vse, "EDataType/Internal/ConversionDelegate/Factory/Registry/Impl", 1183); - var h5 = odb(Vse, "EEnum"); - var g5 = odb(Vse, sve); - var j5 = odb(Vse, tve); - var n5 = odb(Vse, uve); - var xFd; - var p5 = odb(Vse, vve); - var q5 = odb(Vse, wve); - bcb(1029, 1, {}, BFd); - _2.Ib = function CFd() { - return "NIL"; - }; - mdb(Vse, "EStructuralFeature/Internal/DynamicValueHolder/1", 1029); - var DFd; - bcb(1028, 43, fke, GFd); - _2.xc = function HFd(a) { - return ND(a) ? Phb(this, a) : Wd(irb(this.f, a)); - }; - mdb(Vse, "EStructuralFeature/Internal/SettingDelegate/Factory/Registry/Impl", 1028); - var u5 = odb(Vse, xve); - var w5 = odb(Vse, "EValidator/PatternMatcher"); - var IFd; - var KFd; - var MFd; - var OFd, PFd, QFd, RFd, SFd, TFd, UFd, VFd, WFd, XFd, YFd, ZFd, $Fd, _Fd, aGd, bGd, cGd, dGd, eGd, fGd, gGd, hGd, iGd; - var E9 = odb(yve, "FeatureMap/Entry"); - bcb(535, 1, { 72: 1 }, kGd); - _2.ak = function lGd() { - return this.a; - }; - _2.dd = function mGd() { - return this.b; - }; - mdb(qte, "BasicEObjectImpl/1", 535); - bcb(1027, 1, zve, nGd); - _2.Wj = function oGd(a) { - return hid(this.a, this.b, a); - }; - _2.fj = function pGd() { - return nid(this.a, this.b); - }; - _2.Wb = function qGd(a) { - zid(this.a, this.b, a); - }; - _2.Xj = function rGd() { - Did(this.a, this.b); - }; - mdb(qte, "BasicEObjectImpl/4", 1027); - bcb(1983, 1, { 108: 1 }); - _2.bk = function uGd(a) { - this.e = a == 0 ? sGd : KC(SI, Uhe, 1, a, 5, 1); - }; - _2.Ch = function vGd(a) { - return this.e[a]; - }; - _2.Dh = function wGd(a, b) { - this.e[a] = b; - }; - _2.Eh = function xGd(a) { - this.e[a] = null; - }; - _2.ck = function yGd() { - return this.c; - }; - _2.dk = function zGd() { - throw vbb(new bgb()); - }; - _2.ek = function AGd() { - throw vbb(new bgb()); - }; - _2.fk = function BGd() { - return this.d; - }; - _2.gk = function CGd() { - return this.e != null; - }; - _2.hk = function DGd(a) { - this.c = a; - }; - _2.ik = function EGd(a) { - throw vbb(new bgb()); - }; - _2.jk = function FGd(a) { - throw vbb(new bgb()); - }; - _2.kk = function GGd(a) { - this.d = a; - }; - var sGd; - mdb(qte, "BasicEObjectImpl/EPropertiesHolderBaseImpl", 1983); - bcb(185, 1983, { 108: 1 }, HGd); - _2.dk = function IGd() { - return this.a; - }; - _2.ek = function JGd() { - return this.b; - }; - _2.ik = function KGd(a) { - this.a = a; - }; - _2.jk = function LGd(a) { - this.b = a; - }; - mdb(qte, "BasicEObjectImpl/EPropertiesHolderImpl", 185); - bcb(506, 97, pte, MGd); - _2.Kg = function NGd() { - return this.f; - }; - _2.Pg = function OGd() { - return this.k; - }; - _2.Rg = function PGd(a, b) { - this.g = a; - this.i = b; - }; - _2.Tg = function QGd() { - return (this.j & 2) == 0 ? this.zh() : this.ph().ck(); - }; - _2.Vg = function RGd() { - return this.i; - }; - _2.Mg = function SGd() { - return (this.j & 1) != 0; - }; - _2.eh = function TGd() { - return this.g; - }; - _2.kh = function UGd() { - return (this.j & 4) != 0; - }; - _2.ph = function VGd() { - return !this.k && (this.k = new HGd()), this.k; - }; - _2.th = function WGd(a) { - this.ph().hk(a); - a ? this.j |= 2 : this.j &= -3; - }; - _2.vh = function XGd(a) { - this.ph().jk(a); - a ? this.j |= 4 : this.j &= -5; - }; - _2.zh = function YGd() { - return (NFd(), MFd).S; - }; - _2.i = 0; - _2.j = 1; - mdb(qte, "EObjectImpl", 506); - bcb(780, 506, { 105: 1, 92: 1, 90: 1, 56: 1, 108: 1, 49: 1, 97: 1 }, _Gd); - _2.Ch = function aHd(a) { - return this.e[a]; - }; - _2.Dh = function bHd(a, b) { - this.e[a] = b; - }; - _2.Eh = function cHd(a) { - this.e[a] = null; - }; - _2.Tg = function dHd() { - return this.d; - }; - _2.Yg = function eHd(a) { - return bLd(this.d, a); - }; - _2.$g = function fHd() { - return this.d; - }; - _2.dh = function gHd() { - return this.e != null; - }; - _2.ph = function hHd() { - !this.k && (this.k = new vHd()); - return this.k; - }; - _2.th = function iHd(a) { - this.d = a; - }; - _2.yh = function jHd() { - var a; - if (this.e == null) { - a = aLd(this.d); - this.e = a == 0 ? ZGd : KC(SI, Uhe, 1, a, 5, 1); - } - return this; - }; - _2.Ah = function kHd() { - return 0; - }; - var ZGd; - mdb(qte, "DynamicEObjectImpl", 780); - bcb(1376, 780, { 105: 1, 42: 1, 92: 1, 90: 1, 133: 1, 56: 1, 108: 1, 49: 1, 97: 1 }, lHd); - _2.Fb = function nHd(a) { - return this === a; - }; - _2.Hb = function rHd() { - return FCb(this); - }; - _2.th = function mHd(a) { - this.d = a; - this.b = YKd(a, "key"); - this.c = YKd(a, Bte); - }; - _2.Sh = function oHd() { - var a; - if (this.a == -1) { - a = iid(this, this.b); - this.a = a == null ? 0 : tb(a); + if (isArrayValue) { + return value2.map(function(v3) { + return string(v3) ? v3 : "" + getRenderedValue(v3); + }).join(" "); + } else { + return "" + getRenderedValue(value2); + } } - return this.a; - }; - _2.cd = function pHd() { - return iid(this, this.b); - }; - _2.dd = function qHd() { - return iid(this, this.c); - }; - _2.Th = function sHd(a) { - this.a = a; - }; - _2.Uh = function tHd(a) { - zid(this, this.b, a); - }; - _2.ed = function uHd(a) { - var b; - b = iid(this, this.c); - zid(this, this.c, a); - return b; - }; - _2.a = 0; - mdb(qte, "DynamicEObjectImpl/BasicEMapEntry", 1376); - bcb(1377, 1, { 108: 1 }, vHd); - _2.bk = function wHd(a) { - throw vbb(new bgb()); - }; - _2.Ch = function xHd(a) { - throw vbb(new bgb()); - }; - _2.Dh = function yHd(a, b) { - throw vbb(new bgb()); - }; - _2.Eh = function zHd(a) { - throw vbb(new bgb()); - }; - _2.ck = function AHd() { - throw vbb(new bgb()); - }; - _2.dk = function BHd() { - return this.a; - }; - _2.ek = function CHd() { - return this.b; - }; - _2.fk = function DHd() { - return this.c; - }; - _2.gk = function EHd() { - throw vbb(new bgb()); - }; - _2.hk = function FHd(a) { - throw vbb(new bgb()); - }; - _2.ik = function GHd(a) { - this.a = a; - }; - _2.jk = function HHd(a) { - this.b = a; - }; - _2.kk = function IHd(a) { - this.c = a; - }; - mdb(qte, "DynamicEObjectImpl/DynamicEPropertiesHolderImpl", 1377); - bcb(510, 150, { 105: 1, 92: 1, 90: 1, 590: 1, 147: 1, 56: 1, 108: 1, 49: 1, 97: 1, 510: 1, 150: 1, 114: 1, 115: 1 }, RHd); - _2.Qg = function SHd(a) { - return KHd(this, a); - }; - _2._g = function THd(a, b, c2) { - var d; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), this.Ab; - case 1: - return this.d; - case 2: - return c2 ? (!this.b && (this.b = new sId((jGd(), fGd), x6, this)), this.b) : (!this.b && (this.b = new sId((jGd(), fGd), x6, this)), FAd(this.b)); - case 3: - return MHd(this); - case 4: - return !this.a && (this.a = new xMd(m5, this, 4)), this.a; - case 5: - return !this.c && (this.c = new _4d(m5, this, 5)), this.c; - } - return bid(this, a - aLd((jGd(), OFd)), XKd((d = BD(Ajd(this, 16), 26), !d ? OFd : d), a), b, c2); - }; - _2.hh = function UHd(a, b, c2) { - var d, e, f2; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Sxd(this.Ab, a, c2); - case 3: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? KHd(this, c2) : this.Cb.ih(this, -1 - e, null, c2))); - return JHd(this, BD(a, 147), c2); - } - return f2 = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? (jGd(), OFd) : d), b), 66), f2.Nj().Qj(this, yjd(this), b - aLd((jGd(), OFd)), a, c2); - }; - _2.jh = function VHd(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Txd(this.Ab, a, c2); - case 2: - return !this.b && (this.b = new sId((jGd(), fGd), x6, this)), bId(this.b, a, c2); - case 3: - return JHd(this, null, c2); - case 4: - return !this.a && (this.a = new xMd(m5, this, 4)), Txd(this.a, a, c2); - } - return e = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? (jGd(), OFd) : d), b), 66), e.Nj().Rj(this, yjd(this), b - aLd((jGd(), OFd)), a, c2); - }; - _2.lh = function WHd(a) { - var b; - switch (a) { - case 0: - return !!this.Ab && this.Ab.i != 0; - case 1: - return this.d != null; + } else if (strValue != null) { + return strValue; + } + } + 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); + } + } + 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); + } + } + } + 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]); + } + } + } + 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; + } + } + 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 = style3.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; + } + 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: - return !!this.b && this.b.f != 0; - case 3: - return !!MHd(this); - case 4: - return !!this.a && this.a.i != 0; - case 5: - return !!this.c && this.c.i != 0; - } - return cid(this, a - aLd((jGd(), OFd)), XKd((b = BD(Ajd(this, 16), 26), !b ? OFd : b), a)); - }; - _2.sh = function XHd(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - ytd(this.Ab, BD(b, 14)); - return; + return unitsArr[0] !== "deg" && unitsArr[0] !== "rad" && unitsArr[1] !== "deg" && unitsArr[1] !== "rad"; case 1: - OHd(this, GD(b)); - return; - case 2: - !this.b && (this.b = new sId((jGd(), fGd), x6, this)); - cId(this.b, b); - return; - case 3: - NHd(this, BD(b, 147)); - return; - case 4: - !this.a && (this.a = new xMd(m5, this, 4)); - Uxd(this.a); - !this.a && (this.a = new xMd(m5, this, 4)); - ytd(this.a, BD(b, 14)); - return; - case 5: - !this.c && (this.c = new _4d(m5, this, 5)); - Uxd(this.c); - !this.c && (this.c = new _4d(m5, this, 5)); - ytd(this.c, BD(b, 14)); - return; + return string(valArr[0]) || unitsArr[0] === "deg" || unitsArr[0] === "rad"; + default: + return false; } - did(this, a - aLd((jGd(), OFd)), XKd((c2 = BD(Ajd(this, 16), 26), !c2 ? OFd : c2), a), b); - }; - _2.zh = function YHd() { - return jGd(), OFd; - }; - _2.Bh = function ZHd(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - return; - case 1: - PHd(this, null); - return; - case 2: - !this.b && (this.b = new sId((jGd(), fGd), x6, this)); - this.b.c.$b(); - return; - case 3: - NHd(this, null); - return; - case 4: - !this.a && (this.a = new xMd(m5, this, 4)); - Uxd(this.a); - return; - case 5: - !this.c && (this.c = new _4d(m5, this, 5)); - Uxd(this.c); - return; - } - eid(this, a - aLd((jGd(), OFd)), XKd((b = BD(Ajd(this, 16), 26), !b ? OFd : b), a)); - }; - _2.Ib = function $Hd() { - return QHd(this); - }; - _2.d = null; - mdb(qte, "EAnnotationImpl", 510); - bcb(151, 705, Ave, dId); - _2.Xh = function eId(a, b) { - _Hd(this, a, BD(b, 42)); - }; - _2.lk = function fId(a, b) { - return aId(this, BD(a, 42), b); - }; - _2.pi = function gId(a) { - return BD(BD(this.c, 69).pi(a), 133); - }; - _2.Zh = function hId() { - return BD(this.c, 69).Zh(); - }; - _2.$h = function iId() { - return BD(this.c, 69).$h(); - }; - _2._h = function jId(a) { - return BD(this.c, 69)._h(a); - }; - _2.mk = function kId(a, b) { - return bId(this, a, b); - }; - _2.Wj = function lId(a) { - return BD(this.c, 76).Wj(a); - }; - _2.rj = function mId() { - }; - _2.fj = function nId() { - return BD(this.c, 76).fj(); - }; - _2.tj = function oId(a, b, c2) { - var d; - d = BD(bKd(this.b).Nh().Jh(this.b), 133); - d.Th(a); - d.Uh(b); - d.ed(c2); - return d; - }; - _2.uj = function pId() { - return new W5d(this); - }; - _2.Wb = function qId(a) { - cId(this, a); - }; - _2.Xj = function rId() { - BD(this.c, 76).Xj(); - }; - mdb(yve, "EcoreEMap", 151); - bcb(158, 151, Ave, sId); - _2.qj = function tId() { - var a, b, c2, d, e, f2; - if (this.d == null) { - f2 = KC(y4, jve, 63, 2 * this.f + 1, 0, 1); - for (c2 = this.c.Kc(); c2.e != c2.i.gc(); ) { - b = BD(c2.nj(), 133); - d = b.Sh(); - e = (d & Ohe) % f2.length; - a = f2[e]; - !a && (a = f2[e] = new W5d(this)); - a.Fc(b); - } - this.d = f2; - } - }; - mdb(qte, "EAnnotationImpl/1", 158); - bcb(284, 438, { 105: 1, 92: 1, 90: 1, 147: 1, 191: 1, 56: 1, 108: 1, 472: 1, 49: 1, 97: 1, 150: 1, 284: 1, 114: 1, 115: 1 }); - _2._g = function GId(a, b, c2) { - var d, e; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return Bcb(), (this.Bb & 256) != 0 ? true : false; - case 3: - return Bcb(), (this.Bb & 512) != 0 ? true : false; - case 4: - return meb(this.s); - case 5: - return meb(this.t); - case 6: - return Bcb(), this.$j() ? true : false; - case 7: - return Bcb(), e = this.s, e >= 1 ? true : false; - case 8: - if (b) - return wId(this); - return this.r; - case 9: - return this.q; - } - return bid(this, a - aLd(this.zh()), XKd((d = BD(Ajd(this, 16), 26), !d ? this.zh() : d), a), b, c2); - }; - _2.jh = function HId(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Txd(this.Ab, a, c2); - case 9: - return vId(this, c2); - } - return e = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? this.zh() : d), b), 66), e.Nj().Rj(this, yjd(this), b - aLd(this.zh()), a, c2); - }; - _2.lh = function IId(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.$j(); - case 7: - return c2 = this.s, c2 >= 1; - case 8: - return !!this.r && !this.q.e && LQd(this.q).i == 0; - case 9: - return !!this.q && !(!!this.r && !this.q.e && LQd(this.q).i == 0); - } - return cid(this, a - aLd(this.zh()), XKd((b = BD(Ajd(this, 16), 26), !b ? this.zh() : b), a)); - }; - _2.sh = function JId(a, b) { - var c2, d; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - ytd(this.Ab, BD(b, 14)); - return; - case 1: - this.Lh(GD(b)); - return; - case 2: - BId(this, Ccb(DD(b))); - return; - case 3: - CId(this, Ccb(DD(b))); - return; - case 4: - AId(this, BD(b, 19).a); - return; - case 5: - this.ok(BD(b, 19).a); - return; - case 8: - yId(this, BD(b, 138)); - return; - case 9: - d = xId(this, BD(b, 87), null); - !!d && d.Fi(); - return; - } - did(this, a - aLd(this.zh()), XKd((c2 = BD(Ajd(this, 16), 26), !c2 ? this.zh() : c2), a), b); - }; - _2.zh = function KId() { - return jGd(), hGd; - }; - _2.Bh = function LId(a) { - var b, c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - return; - case 1: - this.Lh(null); - return; - case 2: - BId(this, true); - return; - case 3: - CId(this, true); - return; - case 4: - AId(this, 0); - return; - case 5: - this.ok(1); - return; - case 8: - yId(this, null); - return; - case 9: - c2 = xId(this, null, null); - !!c2 && c2.Fi(); - return; - } - eid(this, a - aLd(this.zh()), XKd((b = BD(Ajd(this, 16), 26), !b ? this.zh() : b), a)); - }; - _2.Gh = function MId() { - wId(this); - this.Bb |= 1; - }; - _2.Yj = function NId() { - return wId(this); - }; - _2.Zj = function OId() { - return this.t; - }; - _2.$j = function PId() { - var a; - return a = this.t, a > 1 || a == -1; - }; - _2.hi = function QId() { - return (this.Bb & 512) != 0; - }; - _2.nk = function RId(a, b) { - return zId(this, a, b); - }; - _2.ok = function SId(a) { - DId(this, a); - }; - _2.Ib = function TId() { - return EId(this); - }; - _2.s = 0; - _2.t = 1; - mdb(qte, "ETypedElementImpl", 284); - bcb(449, 284, { 105: 1, 92: 1, 90: 1, 147: 1, 191: 1, 56: 1, 170: 1, 66: 1, 108: 1, 472: 1, 49: 1, 97: 1, 150: 1, 449: 1, 284: 1, 114: 1, 115: 1, 677: 1 }); - _2.Qg = function iJd(a) { - return UId(this, a); - }; - _2._g = function jJd(a, b, c2) { - var d, e; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return Bcb(), (this.Bb & 256) != 0 ? true : false; - case 3: - return Bcb(), (this.Bb & 512) != 0 ? true : false; - case 4: - return meb(this.s); - case 5: - return meb(this.t); - case 6: - return Bcb(), this.$j() ? true : false; - case 7: - return Bcb(), e = this.s, e >= 1 ? true : false; - case 8: - if (b) - return wId(this); - return this.r; - case 9: - return this.q; - case 10: - return Bcb(), (this.Bb & zte) != 0 ? true : false; - case 11: - return Bcb(), (this.Bb & Dve) != 0 ? true : false; - case 12: - return Bcb(), (this.Bb & Rje) != 0 ? true : false; - case 13: - return this.j; - case 14: - return VId(this); - case 15: - return Bcb(), (this.Bb & Cve) != 0 ? true : false; - case 16: - return Bcb(), (this.Bb & oie) != 0 ? true : false; - case 17: - return WId(this); - } - return bid(this, a - aLd(this.zh()), XKd((d = BD(Ajd(this, 16), 26), !d ? this.zh() : d), a), b, c2); - }; - _2.hh = function kJd(a, b, c2) { - var d, e, f2; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Sxd(this.Ab, a, c2); - case 17: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? UId(this, c2) : this.Cb.ih(this, -1 - e, null, c2))); - return _hd(this, a, 17, c2); - } - return f2 = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? this.zh() : d), b), 66), f2.Nj().Qj(this, yjd(this), b - aLd(this.zh()), a, c2); - }; - _2.jh = function lJd(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Txd(this.Ab, a, c2); - case 9: - return vId(this, c2); - case 17: - return _hd(this, null, 17, c2); - } - return e = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? this.zh() : d), b), 66), e.Nj().Rj(this, yjd(this), b - aLd(this.zh()), a, c2); - }; - _2.lh = function mJd(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.$j(); - case 7: - return c2 = this.s, c2 >= 1; - case 8: - return !!this.r && !this.q.e && LQd(this.q).i == 0; - case 9: - return !!this.q && !(!!this.r && !this.q.e && LQd(this.q).i == 0); - case 10: - return (this.Bb & zte) == 0; - case 11: - return (this.Bb & Dve) != 0; - case 12: - return (this.Bb & Rje) != 0; - case 13: - return this.j != null; - case 14: - return VId(this) != null; - case 15: - return (this.Bb & Cve) != 0; - case 16: - return (this.Bb & oie) != 0; - case 17: - return !!WId(this); - } - return cid(this, a - aLd(this.zh()), XKd((b = BD(Ajd(this, 16), 26), !b ? this.zh() : b), a)); - }; - _2.sh = function nJd(a, b) { - var c2, d; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - ytd(this.Ab, BD(b, 14)); - return; - case 1: - cJd(this, GD(b)); - return; - case 2: - BId(this, Ccb(DD(b))); - return; - case 3: - CId(this, Ccb(DD(b))); - return; - case 4: - AId(this, BD(b, 19).a); - return; - case 5: - this.ok(BD(b, 19).a); - return; - case 8: - yId(this, BD(b, 138)); - return; - case 9: - d = xId(this, BD(b, 87), null); - !!d && d.Fi(); - return; - case 10: - ZId(this, Ccb(DD(b))); - return; - case 11: - fJd(this, Ccb(DD(b))); - return; - case 12: - dJd(this, Ccb(DD(b))); - return; - case 13: - $Id(this, GD(b)); - return; - case 15: - eJd(this, Ccb(DD(b))); - return; - case 16: - aJd(this, Ccb(DD(b))); - return; - } - did(this, a - aLd(this.zh()), XKd((c2 = BD(Ajd(this, 16), 26), !c2 ? this.zh() : c2), a), b); - }; - _2.zh = function oJd() { - return jGd(), gGd; - }; - _2.Bh = function pJd(a) { - var b, c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - return; - case 1: - JD(this.Cb, 88) && XMd($Kd(BD(this.Cb, 88)), 4); - pnd(this, null); - return; - case 2: - BId(this, true); - return; - case 3: - CId(this, true); - return; - case 4: - AId(this, 0); - return; - case 5: - this.ok(1); - return; - case 8: - yId(this, null); - return; - case 9: - c2 = xId(this, null, null); - !!c2 && c2.Fi(); - return; - case 10: - ZId(this, true); - return; - case 11: - fJd(this, false); - return; - case 12: - dJd(this, false); - return; - case 13: - this.i = null; - _Id(this, null); - return; - case 15: - eJd(this, false); - return; - case 16: - aJd(this, false); - return; - } - eid(this, a - aLd(this.zh()), XKd((b = BD(Ajd(this, 16), 26), !b ? this.zh() : b), a)); - }; - _2.Gh = function qJd() { - a2d(q1d((O6d(), M6d), this)); - wId(this); - this.Bb |= 1; - }; - _2.Gj = function rJd() { - return this.f; - }; - _2.zj = function sJd() { - return VId(this); - }; - _2.Hj = function tJd() { - return WId(this); - }; - _2.Lj = function uJd() { - return null; - }; - _2.pk = function vJd() { - return this.k; - }; - _2.aj = function wJd() { - return this.n; - }; - _2.Mj = function xJd() { - return XId(this); - }; - _2.Nj = function yJd() { - var a, b, c2, d, e, f2, g, h, i3; - if (!this.p) { - c2 = WId(this); - (c2.i == null && TKd(c2), c2.i).length; - d = this.Lj(); - !!d && aLd(WId(d)); - e = wId(this); - g = e.Bj(); - a = !g ? null : (g.i & 1) != 0 ? g == sbb ? wI : g == WD ? JI : g == VD ? FI : g == UD ? BI : g == XD ? MI : g == rbb ? UI : g == SD ? xI : yI : g; - b = VId(this); - h = e.zj(); - n6d(this); - (this.Bb & oie) != 0 && (!!(f2 = t1d((O6d(), M6d), c2)) && f2 != this || !!(f2 = _1d(q1d(M6d, this)))) ? this.p = new zVd(this, f2) : this.$j() ? this.rk() ? !d ? (this.Bb & Cve) != 0 ? !a ? this.sk() ? this.p = new KVd(42, this) : this.p = new KVd(0, this) : a == CK ? this.p = new IVd(50, J4, this) : this.sk() ? this.p = new IVd(43, a, this) : this.p = new IVd(1, a, this) : !a ? this.sk() ? this.p = new KVd(44, this) : this.p = new KVd(2, this) : a == CK ? this.p = new IVd(41, J4, this) : this.sk() ? this.p = new IVd(45, a, this) : this.p = new IVd(3, a, this) : (this.Bb & Cve) != 0 ? !a ? this.sk() ? this.p = new LVd(46, this, d) : this.p = new LVd(4, this, d) : this.sk() ? this.p = new JVd(47, a, this, d) : this.p = new JVd(5, a, this, d) : !a ? this.sk() ? this.p = new LVd(48, this, d) : this.p = new LVd(6, this, d) : this.sk() ? this.p = new JVd(49, a, this, d) : this.p = new JVd(7, a, this, d) : JD(e, 148) ? a == E9 ? this.p = new KVd(40, this) : (this.Bb & 512) != 0 ? (this.Bb & Cve) != 0 ? !a ? this.p = new KVd(8, this) : this.p = new IVd(9, a, this) : !a ? this.p = new KVd(10, this) : this.p = new IVd(11, a, this) : (this.Bb & Cve) != 0 ? !a ? this.p = new KVd(12, this) : this.p = new IVd(13, a, this) : !a ? this.p = new KVd(14, this) : this.p = new IVd(15, a, this) : !d ? this.sk() ? (this.Bb & Cve) != 0 ? !a ? this.p = new KVd(16, this) : this.p = new IVd(17, a, this) : !a ? this.p = new KVd(18, this) : this.p = new IVd(19, a, this) : (this.Bb & Cve) != 0 ? !a ? this.p = new KVd(20, this) : this.p = new IVd(21, a, this) : !a ? this.p = new KVd(22, this) : this.p = new IVd(23, a, this) : (i3 = d.t, i3 > 1 || i3 == -1 ? this.sk() ? (this.Bb & Cve) != 0 ? !a ? this.p = new LVd(24, this, d) : this.p = new JVd(25, a, this, d) : !a ? this.p = new LVd(26, this, d) : this.p = new JVd(27, a, this, d) : (this.Bb & Cve) != 0 ? !a ? this.p = new LVd(28, this, d) : this.p = new JVd(29, a, this, d) : !a ? this.p = new LVd(30, this, d) : this.p = new JVd(31, a, this, d) : this.sk() ? (this.Bb & Cve) != 0 ? !a ? this.p = new LVd(32, this, d) : this.p = new JVd(33, a, this, d) : !a ? this.p = new LVd(34, this, d) : this.p = new JVd(35, a, this, d) : (this.Bb & Cve) != 0 ? !a ? this.p = new LVd(36, this, d) : this.p = new JVd(37, a, this, d) : !a ? this.p = new LVd(38, this, d) : this.p = new JVd(39, a, this, d)) : this.qk() ? this.sk() ? this.p = new kWd(BD(e, 26), this, d) : this.p = new cWd(BD(e, 26), this, d) : JD(e, 148) ? a == E9 ? this.p = new KVd(40, this) : (this.Bb & Cve) != 0 ? !a ? this.p = new jXd(BD(e, 148), b, h, this) : this.p = new lXd(b, h, this, (CWd(), g == WD ? yWd : g == sbb ? tWd : g == XD ? zWd : g == VD ? xWd : g == UD ? wWd : g == rbb ? BWd : g == SD ? uWd : g == TD ? vWd : AWd)) : !a ? this.p = new cXd(BD(e, 148), b, h, this) : this.p = new eXd(b, h, this, (CWd(), g == WD ? yWd : g == sbb ? tWd : g == XD ? zWd : g == VD ? xWd : g == UD ? wWd : g == rbb ? BWd : g == SD ? uWd : g == TD ? vWd : AWd)) : this.rk() ? !d ? (this.Bb & Cve) != 0 ? this.sk() ? this.p = new FXd(BD(e, 26), this) : this.p = new DXd(BD(e, 26), this) : this.sk() ? this.p = new BXd(BD(e, 26), this) : this.p = new zXd(BD(e, 26), this) : (this.Bb & Cve) != 0 ? this.sk() ? this.p = new NXd(BD(e, 26), this, d) : this.p = new LXd(BD(e, 26), this, d) : this.sk() ? this.p = new JXd(BD(e, 26), this, d) : this.p = new HXd(BD(e, 26), this, d) : this.sk() ? !d ? (this.Bb & Cve) != 0 ? this.p = new RXd(BD(e, 26), this) : this.p = new PXd(BD(e, 26), this) : (this.Bb & Cve) != 0 ? this.p = new VXd(BD(e, 26), this, d) : this.p = new TXd(BD(e, 26), this, d) : !d ? (this.Bb & Cve) != 0 ? this.p = new XXd(BD(e, 26), this) : this.p = new nXd(BD(e, 26), this) : (this.Bb & Cve) != 0 ? this.p = new _Xd(BD(e, 26), this, d) : this.p = new ZXd(BD(e, 26), this, d); - } - return this.p; - }; - _2.Ij = function zJd() { - return (this.Bb & zte) != 0; - }; - _2.qk = function AJd() { - return false; - }; - _2.rk = function BJd() { - return false; - }; - _2.Jj = function CJd() { - return (this.Bb & oie) != 0; - }; - _2.Oj = function DJd() { - return YId(this); - }; - _2.sk = function EJd() { + }, "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; + } + if (val1 == 0 && val2 != 0) { + return true; + } else if (val1 != 0 && val2 == 0) { + return true; + } else { return false; - }; - _2.Kj = function FJd() { - return (this.Bb & Cve) != 0; - }; - _2.tk = function GJd(a) { - this.k = a; - }; - _2.Lh = function HJd(a) { - cJd(this, a); - }; - _2.Ib = function IJd() { - return gJd(this); - }; - _2.e = false; - _2.n = 0; - mdb(qte, "EStructuralFeatureImpl", 449); - bcb(322, 449, { 105: 1, 92: 1, 90: 1, 34: 1, 147: 1, 191: 1, 56: 1, 170: 1, 66: 1, 108: 1, 472: 1, 49: 1, 97: 1, 322: 1, 150: 1, 449: 1, 284: 1, 114: 1, 115: 1, 677: 1 }, OJd); - _2._g = function PJd(a, b, c2) { - var d, e; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return Bcb(), (this.Bb & 256) != 0 ? true : false; - case 3: - return Bcb(), (this.Bb & 512) != 0 ? true : false; - case 4: - return meb(this.s); - case 5: - return meb(this.t); - case 6: - return Bcb(), LJd(this) ? true : false; - case 7: - return Bcb(), e = this.s, e >= 1 ? true : false; - case 8: - if (b) - return wId(this); - return this.r; - case 9: - return this.q; - case 10: - return Bcb(), (this.Bb & zte) != 0 ? true : false; - case 11: - return Bcb(), (this.Bb & Dve) != 0 ? true : false; - case 12: - return Bcb(), (this.Bb & Rje) != 0 ? true : false; - case 13: - return this.j; - case 14: - return VId(this); - case 15: - return Bcb(), (this.Bb & Cve) != 0 ? true : false; - case 16: - return Bcb(), (this.Bb & oie) != 0 ? true : false; - case 17: - return WId(this); - case 18: - return Bcb(), (this.Bb & ote) != 0 ? true : false; - case 19: - if (b) - return KJd(this); - return JJd(this); - } - return bid(this, a - aLd((jGd(), PFd)), XKd((d = BD(Ajd(this, 16), 26), !d ? PFd : d), a), b, c2); - }; - _2.lh = function QJd(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 LJd(this); - case 7: - return c2 = this.s, c2 >= 1; - case 8: - return !!this.r && !this.q.e && LQd(this.q).i == 0; - case 9: - return !!this.q && !(!!this.r && !this.q.e && LQd(this.q).i == 0); - case 10: - return (this.Bb & zte) == 0; - case 11: - return (this.Bb & Dve) != 0; - case 12: - return (this.Bb & Rje) != 0; - case 13: - return this.j != null; - case 14: - return VId(this) != null; - case 15: - return (this.Bb & Cve) != 0; - case 16: - return (this.Bb & oie) != 0; - case 17: - return !!WId(this); - case 18: - return (this.Bb & ote) != 0; - case 19: - return !!JJd(this); - } - return cid(this, a - aLd((jGd(), PFd)), XKd((b = BD(Ajd(this, 16), 26), !b ? PFd : b), a)); - }; - _2.sh = function RJd(a, b) { - var c2, d; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - ytd(this.Ab, BD(b, 14)); - return; - case 1: - cJd(this, GD(b)); - return; - case 2: - BId(this, Ccb(DD(b))); - return; - case 3: - CId(this, Ccb(DD(b))); - return; - case 4: - AId(this, BD(b, 19).a); - return; - case 5: - NJd(this, BD(b, 19).a); - return; - case 8: - yId(this, BD(b, 138)); - return; - case 9: - d = xId(this, BD(b, 87), null); - !!d && d.Fi(); - return; - case 10: - ZId(this, Ccb(DD(b))); - return; - case 11: - fJd(this, Ccb(DD(b))); - return; - case 12: - dJd(this, Ccb(DD(b))); - return; - case 13: - $Id(this, GD(b)); - return; - case 15: - eJd(this, Ccb(DD(b))); - return; - case 16: - aJd(this, Ccb(DD(b))); - return; - case 18: - MJd(this, Ccb(DD(b))); - return; - } - did(this, a - aLd((jGd(), PFd)), XKd((c2 = BD(Ajd(this, 16), 26), !c2 ? PFd : c2), a), b); - }; - _2.zh = function SJd() { - return jGd(), PFd; - }; - _2.Bh = function TJd(a) { - var b, c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - return; - case 1: - JD(this.Cb, 88) && XMd($Kd(BD(this.Cb, 88)), 4); - pnd(this, null); - return; - case 2: - BId(this, true); - return; - case 3: - CId(this, true); - return; - case 4: - AId(this, 0); - return; - case 5: - this.b = 0; - DId(this, 1); - return; - case 8: - yId(this, null); - return; - case 9: - c2 = xId(this, null, null); - !!c2 && c2.Fi(); - return; - case 10: - ZId(this, true); - return; - case 11: - fJd(this, false); - return; - case 12: - dJd(this, false); - return; - case 13: - this.i = null; - _Id(this, null); - return; - case 15: - eJd(this, false); - return; - case 16: - aJd(this, false); - return; - case 18: - MJd(this, false); - return; - } - eid(this, a - aLd((jGd(), PFd)), XKd((b = BD(Ajd(this, 16), 26), !b ? PFd : b), a)); - }; - _2.Gh = function UJd() { - KJd(this); - a2d(q1d((O6d(), M6d), this)); - wId(this); - this.Bb |= 1; - }; - _2.$j = function VJd() { - return LJd(this); - }; - _2.nk = function WJd(a, b) { - this.b = 0; - this.a = null; - return zId(this, a, b); - }; - _2.ok = function XJd(a) { - NJd(this, a); - }; - _2.Ib = function YJd() { - var a; - if ((this.Db & 64) != 0) - return gJd(this); - a = new Jfb(gJd(this)); - a.a += " (iD: "; - Ffb(a, (this.Bb & ote) != 0); - a.a += ")"; - return a.a; - }; - _2.b = 0; - mdb(qte, "EAttributeImpl", 322); - bcb(351, 438, { 105: 1, 92: 1, 90: 1, 138: 1, 147: 1, 191: 1, 56: 1, 108: 1, 49: 1, 97: 1, 351: 1, 150: 1, 114: 1, 115: 1, 676: 1 }); - _2.uk = function nKd(a) { - return a.Tg() == this; - }; - _2.Qg = function oKd(a) { - return aKd(this, a); - }; - _2.Rg = function pKd(a, b) { - this.w = null; - this.Db = b << 16 | this.Db & 255; - this.Cb = a; - }; - _2._g = function qKd(a, b, c2) { - var d; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return this.D != null ? this.D : this.B; - case 3: - return dKd(this); - case 4: - return this.zj(); - case 5: - return this.F; - case 6: - if (b) - return bKd(this); - return ZJd(this); - case 7: - return !this.A && (this.A = new K4d(u5, this, 7)), this.A; - } - return bid(this, a - aLd(this.zh()), XKd((d = BD(Ajd(this, 16), 26), !d ? this.zh() : d), a), b, c2); - }; - _2.hh = function rKd(a, b, c2) { - var d, e, f2; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Sxd(this.Ab, a, c2); - case 6: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? aKd(this, c2) : this.Cb.ih(this, -1 - e, null, c2))); - return _hd(this, a, 6, c2); - } - return f2 = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? this.zh() : d), b), 66), f2.Nj().Qj(this, yjd(this), b - aLd(this.zh()), a, c2); - }; - _2.jh = function sKd(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Txd(this.Ab, a, c2); - case 6: - return _hd(this, null, 6, c2); - case 7: - return !this.A && (this.A = new K4d(u5, this, 7)), Txd(this.A, a, c2); - } - return e = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? this.zh() : d), b), 66), e.Nj().Rj(this, yjd(this), b - aLd(this.zh()), a, c2); - }; - _2.lh = function tKd(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 !!dKd(this); - case 4: - return this.zj() != null; - case 5: - return this.F != null && this.F != this.D && this.F != this.B; - case 6: - return !!ZJd(this); - case 7: - return !!this.A && this.A.i != 0; - } - return cid(this, a - aLd(this.zh()), XKd((b = BD(Ajd(this, 16), 26), !b ? this.zh() : b), a)); - }; - _2.sh = function uKd(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - ytd(this.Ab, BD(b, 14)); - return; - case 1: - lKd(this, GD(b)); - return; - case 2: - iKd(this, GD(b)); - return; - case 5: - kKd(this, GD(b)); - return; - case 7: - !this.A && (this.A = new K4d(u5, this, 7)); - Uxd(this.A); - !this.A && (this.A = new K4d(u5, this, 7)); - ytd(this.A, BD(b, 14)); - return; - } - did(this, a - aLd(this.zh()), XKd((c2 = BD(Ajd(this, 16), 26), !c2 ? this.zh() : c2), a), b); - }; - _2.zh = function vKd() { - return jGd(), RFd; - }; - _2.Bh = function wKd(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - return; - case 1: - JD(this.Cb, 179) && (BD(this.Cb, 179).tb = null); - pnd(this, null); - return; - case 2: - $Jd(this, null); - _Jd(this, this.D); - return; - case 5: - kKd(this, null); - return; - case 7: - !this.A && (this.A = new K4d(u5, this, 7)); - Uxd(this.A); - return; - } - eid(this, a - aLd(this.zh()), XKd((b = BD(Ajd(this, 16), 26), !b ? this.zh() : b), a)); - }; - _2.yj = function xKd() { - var a; - return this.G == -1 && (this.G = (a = bKd(this), a ? HLd(a.Mh(), this) : -1)), this.G; - }; - _2.zj = function yKd() { - return null; - }; - _2.Aj = function zKd() { - return bKd(this); - }; - _2.vk = function AKd() { - return this.v; - }; - _2.Bj = function BKd() { - return dKd(this); - }; - _2.Cj = function CKd() { - return this.D != null ? this.D : this.B; - }; - _2.Dj = function DKd() { - return this.F; - }; - _2.wj = function EKd(a) { - return fKd(this, a); - }; - _2.wk = function FKd(a) { - this.v = a; - }; - _2.xk = function GKd(a) { - gKd(this, a); - }; - _2.yk = function HKd(a) { - this.C = a; - }; - _2.Lh = function IKd(a) { - lKd(this, a); - }; - _2.Ib = function JKd() { - return mKd(this); - }; - _2.C = null; - _2.D = null; - _2.G = -1; - mdb(qte, "EClassifierImpl", 351); - bcb(88, 351, { 105: 1, 92: 1, 90: 1, 26: 1, 138: 1, 147: 1, 191: 1, 56: 1, 108: 1, 49: 1, 97: 1, 88: 1, 351: 1, 150: 1, 473: 1, 114: 1, 115: 1, 676: 1 }, hLd); - _2.uk = function iLd(a) { - return dLd(this, a.Tg()); - }; - _2._g = function jLd(a, b, c2) { - var d; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return this.D != null ? this.D : this.B; - case 3: - return dKd(this); - case 4: - return null; - case 5: - return this.F; - case 6: - if (b) - return bKd(this); - return ZJd(this); - case 7: - return !this.A && (this.A = new K4d(u5, this, 7)), this.A; - case 8: - return Bcb(), (this.Bb & 256) != 0 ? true : false; - case 9: - return Bcb(), (this.Bb & 512) != 0 ? true : false; - case 10: - return _Kd(this); - case 11: - return !this.q && (this.q = new cUd(n5, this, 11, 10)), this.q; - case 12: - return OKd(this); - case 13: - return SKd(this); - case 14: - return SKd(this), this.r; - case 15: - return OKd(this), this.k; - case 16: - return PKd(this); - case 17: - return RKd(this); - case 18: - return TKd(this); - case 19: - return UKd(this); - case 20: - return OKd(this), this.o; - case 21: - return !this.s && (this.s = new cUd(t5, this, 21, 17)), this.s; - case 22: - return VKd(this); - case 23: - return QKd(this); - } - return bid(this, a - aLd((jGd(), QFd)), XKd((d = BD(Ajd(this, 16), 26), !d ? QFd : d), a), b, c2); - }; - _2.hh = function kLd(a, b, c2) { - var d, e, f2; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Sxd(this.Ab, a, c2); - case 6: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? aKd(this, c2) : this.Cb.ih(this, -1 - e, null, c2))); - return _hd(this, a, 6, c2); - case 11: - return !this.q && (this.q = new cUd(n5, this, 11, 10)), Sxd(this.q, a, c2); - case 21: - return !this.s && (this.s = new cUd(t5, this, 21, 17)), Sxd(this.s, a, c2); - } - return f2 = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? (jGd(), QFd) : d), b), 66), f2.Nj().Qj(this, yjd(this), b - aLd((jGd(), QFd)), a, c2); - }; - _2.jh = function lLd(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Txd(this.Ab, a, c2); - case 6: - return _hd(this, null, 6, c2); - case 7: - return !this.A && (this.A = new K4d(u5, this, 7)), Txd(this.A, a, c2); - case 11: - return !this.q && (this.q = new cUd(n5, this, 11, 10)), Txd(this.q, a, c2); - case 21: - return !this.s && (this.s = new cUd(t5, this, 21, 17)), Txd(this.s, a, c2); - case 22: - return Txd(VKd(this), a, c2); - } - return e = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? (jGd(), QFd) : d), b), 66), e.Nj().Rj(this, yjd(this), b - aLd((jGd(), QFd)), a, c2); - }; - _2.lh = function mLd(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 !!dKd(this); - case 4: - return false; - case 5: - return this.F != null && this.F != this.D && this.F != this.B; - case 6: - return !!ZJd(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 && VKd(this.u.a).i != 0 && !(!!this.n && FMd(this.n)); - case 11: - return !!this.q && this.q.i != 0; - case 12: - return OKd(this).i != 0; - case 13: - return SKd(this).i != 0; - case 14: - return SKd(this), this.r.i != 0; - case 15: - return OKd(this), this.k.i != 0; - case 16: - return PKd(this).i != 0; - case 17: - return RKd(this).i != 0; - case 18: - return TKd(this).i != 0; - case 19: - return UKd(this).i != 0; - case 20: - return OKd(this), !!this.o; - case 21: - return !!this.s && this.s.i != 0; - case 22: - return !!this.n && FMd(this.n); - case 23: - return QKd(this).i != 0; - } - return cid(this, a - aLd((jGd(), QFd)), XKd((b = BD(Ajd(this, 16), 26), !b ? QFd : b), a)); - }; - _2.oh = function nLd(a) { - var b; - b = this.i == null || !!this.q && this.q.i != 0 ? null : YKd(this, a); - return b ? b : Bmd(this, a); - }; - _2.sh = function oLd(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - ytd(this.Ab, BD(b, 14)); - return; - case 1: - lKd(this, GD(b)); - return; - case 2: - iKd(this, GD(b)); - return; - case 5: - kKd(this, GD(b)); - return; - case 7: - !this.A && (this.A = new K4d(u5, this, 7)); - Uxd(this.A); - !this.A && (this.A = new K4d(u5, this, 7)); - ytd(this.A, BD(b, 14)); - return; - case 8: - eLd(this, Ccb(DD(b))); - return; - case 9: - fLd(this, Ccb(DD(b))); - return; - case 10: - vwd(_Kd(this)); - ytd(_Kd(this), BD(b, 14)); - return; - case 11: - !this.q && (this.q = new cUd(n5, this, 11, 10)); - Uxd(this.q); - !this.q && (this.q = new cUd(n5, this, 11, 10)); - ytd(this.q, BD(b, 14)); - return; - case 21: - !this.s && (this.s = new cUd(t5, this, 21, 17)); - Uxd(this.s); - !this.s && (this.s = new cUd(t5, this, 21, 17)); - ytd(this.s, BD(b, 14)); - return; - case 22: - Uxd(VKd(this)); - ytd(VKd(this), BD(b, 14)); - return; - } - did(this, a - aLd((jGd(), QFd)), XKd((c2 = BD(Ajd(this, 16), 26), !c2 ? QFd : c2), a), b); - }; - _2.zh = function pLd() { - return jGd(), QFd; - }; - _2.Bh = function qLd(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - return; - case 1: - JD(this.Cb, 179) && (BD(this.Cb, 179).tb = null); - pnd(this, null); - return; - case 2: - $Jd(this, null); - _Jd(this, this.D); - return; - case 5: - kKd(this, null); - return; - case 7: - !this.A && (this.A = new K4d(u5, this, 7)); - Uxd(this.A); - return; - case 8: - eLd(this, false); - return; - case 9: - fLd(this, false); - return; - case 10: - !!this.u && vwd(this.u); - return; - case 11: - !this.q && (this.q = new cUd(n5, this, 11, 10)); - Uxd(this.q); - return; - case 21: - !this.s && (this.s = new cUd(t5, this, 21, 17)); - Uxd(this.s); - return; - case 22: - !!this.n && Uxd(this.n); - return; - } - eid(this, a - aLd((jGd(), QFd)), XKd((b = BD(Ajd(this, 16), 26), !b ? QFd : b), a)); - }; - _2.Gh = function rLd() { - var a, b; - OKd(this); - SKd(this); - PKd(this); - RKd(this); - TKd(this); - UKd(this); - QKd(this); - oud(SMd($Kd(this))); - if (this.s) { - for (a = 0, b = this.s.i; a < b; ++a) { - Cmd(qud(this.s, a)); - } - } - if (this.q) { - for (a = 0, b = this.q.i; a < b; ++a) { - Cmd(qud(this.q, a)); - } - } - o1d((O6d(), M6d), this).ne(); - this.Bb |= 1; - }; - _2.Ib = function sLd() { - return gLd(this); - }; - _2.k = null; - _2.r = null; - var KKd, LKd, MKd; - mdb(qte, "EClassImpl", 88); - bcb(1994, 1993, Ove); - _2.Vh = function tLd(a, b) { - return Pxd(this, a, b); - }; - _2.Wh = function uLd(a) { - return Pxd(this, this.i, a); - }; - _2.Xh = function vLd(a, b) { - Qxd(this, a, b); - }; - _2.Yh = function wLd(a) { - Rxd(this, a); - }; - _2.lk = function xLd(a, b) { - return Sxd(this, a, b); - }; - _2.pi = function yLd(a) { - return nud(this, a); - }; - _2.mk = function CLd(a, b) { - return Txd(this, a, b); - }; - _2.mi = function DLd(a, b) { - return Zxd(this, a, b); - }; - _2.Zh = function zLd() { - return new $yd(this); - }; - _2.$h = function ALd() { - return new bzd(this); - }; - _2._h = function BLd(a) { - return ztd(this, a); - }; - mdb(yve, "NotifyingInternalEListImpl", 1994); - bcb(622, 1994, Pve); - _2.Hc = function NLd(a) { - return ELd(this, a); - }; - _2.Zi = function OLd(a, b, c2, d, e) { - return FLd(this, a, b, c2, d, e); - }; - _2.$i = function PLd(a) { - GLd(this, a); - }; - _2.Wj = function QLd(a) { - return this; - }; - _2.ak = function RLd() { - return XKd(this.e.Tg(), this.aj()); - }; - _2._i = function SLd() { - return this.ak(); - }; - _2.aj = function TLd() { - return bLd(this.e.Tg(), this.ak()); - }; - _2.zk = function ULd() { - return BD(this.ak().Yj(), 26).Bj(); - }; - _2.Ak = function VLd() { - return zUd(BD(this.ak(), 18)).n; - }; - _2.Ai = function WLd() { - return this.e; - }; - _2.Bk = function XLd() { - return true; - }; - _2.Ck = function YLd() { - return false; - }; - _2.Dk = function ZLd() { - return false; - }; - _2.Ek = function $Ld() { - return false; - }; - _2.Xc = function _Ld(a) { - return HLd(this, a); - }; - _2.cj = function aMd(a, b) { - var c2; - return c2 = BD(a, 49), this.Dk() ? this.Bk() ? c2.gh(this.e, this.Ak(), this.zk(), b) : c2.gh(this.e, bLd(c2.Tg(), zUd(BD(this.ak(), 18))), null, b) : c2.gh(this.e, -1 - this.aj(), null, b); - }; - _2.dj = function bMd(a, b) { - var c2; - return c2 = BD(a, 49), this.Dk() ? this.Bk() ? c2.ih(this.e, this.Ak(), this.zk(), b) : c2.ih(this.e, bLd(c2.Tg(), zUd(BD(this.ak(), 18))), null, b) : c2.ih(this.e, -1 - this.aj(), null, b); - }; - _2.rk = function cMd() { - return false; - }; - _2.Fk = function dMd() { - return true; - }; - _2.wj = function eMd(a) { - return qEd(this.d, a); - }; - _2.ej = function fMd() { - return oid(this.e); - }; - _2.fj = function gMd() { - return this.i != 0; - }; - _2.ri = function hMd(a) { - return izd(this.d, a); - }; - _2.li = function iMd(a, b) { - return this.Fk() && this.Ek() ? ILd(this, a, BD(b, 56)) : b; - }; - _2.Gk = function jMd(a) { - return a.kh() ? xid(this.e, BD(a, 49)) : a; - }; - _2.Wb = function kMd(a) { - JLd(this, a); - }; - _2.Pc = function lMd() { - return KLd(this); - }; - _2.Qc = function mMd(a) { - var b; - if (this.Ek()) { - for (b = this.i - 1; b >= 0; --b) { - qud(this, b); - } - } - return xud(this, a); - }; - _2.Xj = function nMd() { - Uxd(this); - }; - _2.oi = function oMd(a, b) { - return LLd(this, a, b); - }; - mdb(yve, "EcoreEList", 622); - bcb(496, 622, Pve, pMd); - _2.ai = function qMd() { - return false; - }; - _2.aj = function rMd() { - return this.c; - }; - _2.bj = function sMd() { - return false; - }; - _2.Fk = function tMd() { - return true; - }; - _2.hi = function uMd() { - return true; - }; - _2.li = function vMd(a, b) { - return b; - }; - _2.ni = function wMd() { - return false; - }; - _2.c = 0; - mdb(yve, "EObjectEList", 496); - bcb(85, 496, Pve, xMd); - _2.bj = function yMd() { - return true; - }; - _2.Dk = function zMd() { - return false; - }; - _2.rk = function AMd() { - return true; - }; - mdb(yve, "EObjectContainmentEList", 85); - bcb(545, 85, Pve, BMd); - _2.ci = function CMd() { - this.b = true; - }; - _2.fj = function DMd() { - return this.b; - }; - _2.Xj = function EMd() { - var a; - Uxd(this); - if (oid(this.e)) { - a = this.b; - this.b = false; - Uhd(this.e, new qSd(this.e, 2, this.c, a, false)); - } else { - this.b = false; - } - }; - _2.b = false; - mdb(yve, "EObjectContainmentEList/Unsettable", 545); - bcb(1140, 545, Pve, JMd); - _2.ii = function NMd(a, b) { - var c2, d; - return c2 = BD(Wxd(this, a, b), 87), oid(this.e) && GLd(this, new ESd(this.a, 7, (jGd(), SFd), meb(b), (d = c2.c, JD(d, 88) ? BD(d, 26) : _Fd), a)), c2; - }; - _2.jj = function OMd(a, b) { - return GMd(this, BD(a, 87), b); - }; - _2.kj = function PMd(a, b) { - return HMd(this, BD(a, 87), b); - }; - _2.lj = function QMd(a, b, c2) { - return IMd(this, BD(a, 87), BD(b, 87), c2); - }; - _2.Zi = function KMd(a, b, c2, d, e) { - switch (a) { - case 3: { - return FLd(this, a, b, c2, d, this.i > 1); - } - case 5: { - return FLd(this, a, b, c2, d, this.i - BD(c2, 15).gc() > 0); - } - default: { - return new pSd(this.e, a, this.c, b, c2, d, true); - } - } - }; - _2.ij = function LMd() { - return true; - }; - _2.fj = function MMd() { - return FMd(this); - }; - _2.Xj = function RMd() { - Uxd(this); - }; - mdb(qte, "EClassImpl/1", 1140); - bcb(1154, 1153, dve); - _2.ui = function VMd(a) { - var b, c2, d, e, f2, g, h; - c2 = a.xi(); - if (c2 != 8) { - d = UMd(a); - if (d == 0) { - switch (c2) { - case 1: - case 9: { - h = a.Bi(); - if (h != null) { - b = $Kd(BD(h, 473)); - !b.c && (b.c = new xYd()); - Ftd(b.c, a.Ai()); - } - g = a.zi(); - if (g != null) { - e = BD(g, 473); - if ((e.Bb & 1) == 0) { - b = $Kd(e); - !b.c && (b.c = new xYd()); - wtd(b.c, BD(a.Ai(), 26)); - } - } - break; - } - case 3: { - g = a.zi(); - if (g != null) { - e = BD(g, 473); - if ((e.Bb & 1) == 0) { - b = $Kd(e); - !b.c && (b.c = new xYd()); - wtd(b.c, BD(a.Ai(), 26)); - } - } - break; - } - case 5: { - g = a.zi(); - if (g != null) { - for (f2 = BD(g, 14).Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 473); - if ((e.Bb & 1) == 0) { - b = $Kd(e); - !b.c && (b.c = new xYd()); - wtd(b.c, BD(a.Ai(), 26)); - } - } - } - break; - } - case 4: { - h = a.Bi(); - if (h != null) { - e = BD(h, 473); - if ((e.Bb & 1) == 0) { - b = $Kd(e); - !b.c && (b.c = new xYd()); - Ftd(b.c, a.Ai()); - } - } - break; - } - case 6: { - h = a.Bi(); - if (h != null) { - for (f2 = BD(h, 14).Kc(); f2.Ob(); ) { - e = BD(f2.Pb(), 473); - if ((e.Bb & 1) == 0) { - b = $Kd(e); - !b.c && (b.c = new xYd()); - Ftd(b.c, a.Ai()); - } - } - } - break; - } - } - } - this.Hk(d); - } - }; - _2.Hk = function WMd(a) { - TMd(this, a); - }; - _2.b = 63; - mdb(qte, "ESuperAdapter", 1154); - bcb(1155, 1154, dve, YMd); - _2.Hk = function ZMd(a) { - XMd(this, a); - }; - mdb(qte, "EClassImpl/10", 1155); - bcb(1144, 696, Pve); - _2.Vh = function $Md(a, b) { - return iud(this, a, b); - }; - _2.Wh = function _Md(a) { - return jud(this, a); - }; - _2.Xh = function aNd(a, b) { - kud(this, a, b); - }; - _2.Yh = function bNd(a) { - lud(this, a); - }; - _2.pi = function dNd(a) { - return nud(this, a); - }; - _2.mi = function lNd(a, b) { - return uud(this, a, b); - }; - _2.lk = function cNd(a, b) { - throw vbb(new bgb()); - }; - _2.Zh = function eNd() { - return new $yd(this); - }; - _2.$h = function fNd() { - return new bzd(this); - }; - _2._h = function gNd(a) { - return ztd(this, a); - }; - _2.mk = function hNd(a, b) { - throw vbb(new bgb()); - }; - _2.Wj = function iNd(a) { - return this; - }; - _2.fj = function jNd() { - return this.i != 0; - }; - _2.Wb = function kNd(a) { - throw vbb(new bgb()); - }; - _2.Xj = function mNd() { - throw vbb(new bgb()); - }; - mdb(yve, "EcoreEList/UnmodifiableEList", 1144); - bcb(319, 1144, Pve, nNd); - _2.ni = function oNd() { - return false; - }; - mdb(yve, "EcoreEList/UnmodifiableEList/FastCompare", 319); - bcb(1147, 319, Pve, rNd); - _2.Xc = function sNd(a) { - var b, c2, d; - if (JD(a, 170)) { - b = BD(a, 170); - c2 = b.aj(); - if (c2 != -1) { - for (d = this.i; c2 < d; ++c2) { - if (PD(this.g[c2]) === PD(a)) { - return c2; - } - } - } - } - return -1; - }; - mdb(qte, "EClassImpl/1EAllStructuralFeaturesList", 1147); - bcb(1141, 497, oue, wNd); - _2.ri = function xNd(a) { - return KC(j5, Tve, 87, a, 0, 1); - }; - _2.ni = function yNd() { - return false; - }; - mdb(qte, "EClassImpl/1EGenericSuperTypeEList", 1141); - bcb(623, 497, oue, zNd); - _2.ri = function ANd(a) { - return KC(t5, Mve, 170, a, 0, 1); - }; - _2.ni = function BNd() { - return false; - }; - mdb(qte, "EClassImpl/1EStructuralFeatureUniqueEList", 623); - bcb(741, 497, oue, CNd); - _2.ri = function DNd(a) { - return KC(q5, Mve, 18, a, 0, 1); - }; - _2.ni = function ENd() { - return false; - }; - mdb(qte, "EClassImpl/1ReferenceList", 741); - bcb(1142, 497, oue, GNd); - _2.bi = function HNd(a, b) { - FNd(this, BD(b, 34)); - }; - _2.ri = function INd(a) { - return KC(b5, Mve, 34, a, 0, 1); - }; - _2.ni = function JNd() { - return false; - }; - mdb(qte, "EClassImpl/2", 1142); - bcb(1143, 497, oue, KNd); - _2.ri = function LNd(a) { - return KC(b5, Mve, 34, a, 0, 1); - }; - _2.ni = function MNd() { - return false; - }; - mdb(qte, "EClassImpl/3", 1143); - bcb(1145, 319, Pve, PNd); - _2.Fc = function QNd(a) { - return NNd(this, BD(a, 34)); - }; - _2.Yh = function RNd(a) { - ONd(this, BD(a, 34)); - }; - mdb(qte, "EClassImpl/4", 1145); - bcb(1146, 319, Pve, UNd); - _2.Fc = function VNd(a) { - return SNd(this, BD(a, 18)); - }; - _2.Yh = function WNd(a) { - TNd(this, BD(a, 18)); - }; - mdb(qte, "EClassImpl/5", 1146); - bcb(1148, 497, oue, XNd); - _2.ri = function YNd(a) { - return KC(n5, Nve, 59, a, 0, 1); - }; - _2.ni = function ZNd() { - return false; - }; - mdb(qte, "EClassImpl/6", 1148); - bcb(1149, 497, oue, $Nd); - _2.ri = function _Nd(a) { - return KC(q5, Mve, 18, a, 0, 1); - }; - _2.ni = function aOd() { - return false; - }; - mdb(qte, "EClassImpl/7", 1149); - bcb(1997, 1996, { 3: 1, 4: 1, 20: 1, 28: 1, 52: 1, 14: 1, 15: 1, 67: 1, 58: 1, 69: 1 }); - _2.Vh = function bOd(a, b) { - return qwd(this, a, b); - }; - _2.Wh = function cOd(a) { - return qwd(this, this.Vi(), a); - }; - _2.Xh = function dOd(a, b) { - rwd(this, a, b); - }; - _2.Yh = function eOd(a) { - swd(this, a); - }; - _2.lk = function fOd(a, b) { - return twd(this, a, b); - }; - _2.mk = function lOd(a, b) { - return uwd(this, a, b); - }; - _2.mi = function mOd(a, b) { - return wwd(this, a, b); - }; - _2.pi = function gOd(a) { - return this.Oi(a); - }; - _2.Zh = function hOd() { - return new $yd(this); - }; - _2.Gi = function iOd() { - return this.Ji(); - }; - _2.$h = function jOd() { - return new bzd(this); - }; - _2._h = function kOd(a) { - return ztd(this, a); - }; - mdb(yve, "DelegatingNotifyingInternalEListImpl", 1997); - bcb(742, 1997, Uve); - _2.ai = function rOd() { - var a; - a = XKd(wjd(this.b), this.aj()).Yj(); - return JD(a, 148) && !JD(a, 457) && (a.Bj().i & 1) == 0; - }; - _2.Hc = function sOd(a) { - var b, c2, d, e, f2, g, h, i3; - if (this.Fk()) { - i3 = this.Vi(); - if (i3 > 4) { - if (this.wj(a)) { - if (this.rk()) { - d = BD(a, 49); - c2 = d.Ug(); - h = c2 == this.b && (this.Dk() ? d.Og(d.Vg(), BD(XKd(wjd(this.b), this.aj()).Yj(), 26).Bj()) == zUd(BD(XKd(wjd(this.b), this.aj()), 18)).n : -1 - d.Vg() == this.aj()); - if (this.Ek() && !h && !c2 && !!d.Zg()) { - for (e = 0; e < i3; ++e) { - b = oOd(this, this.Oi(e)); - if (PD(b) === PD(a)) { - return true; - } - } - } - return h; - } else if (this.Dk() && !this.Ck()) { - f2 = BD(a, 56).ah(zUd(BD(XKd(wjd(this.b), this.aj()), 18))); - if (PD(f2) === PD(this.b)) { - return true; - } else if (f2 == null || !BD(f2, 56).kh()) { - return false; - } - } - } else { - return false; - } - } - g = this.Li(a); - if (this.Ek() && !g) { - for (e = 0; e < i3; ++e) { - d = oOd(this, this.Oi(e)); - if (PD(d) === PD(a)) { - return true; - } - } - } - return g; - } else { - return this.Li(a); - } - }; - _2.Zi = function tOd(a, b, c2, d, e) { - return new pSd(this.b, a, this.aj(), b, c2, d, e); - }; - _2.$i = function uOd(a) { - Uhd(this.b, a); - }; - _2.Wj = function vOd(a) { - return this; - }; - _2._i = function wOd() { - return XKd(wjd(this.b), this.aj()); - }; - _2.aj = function xOd() { - return bLd(wjd(this.b), XKd(wjd(this.b), this.aj())); - }; - _2.Ai = function yOd() { - return this.b; - }; - _2.Bk = function zOd() { - return !!XKd(wjd(this.b), this.aj()).Yj().Bj(); - }; - _2.bj = function AOd() { - var a, b; - b = XKd(wjd(this.b), this.aj()); - if (JD(b, 99)) { - a = BD(b, 18); - return (a.Bb & ote) != 0 || !!zUd(BD(b, 18)); - } else { - return false; - } - }; - _2.Ck = function BOd() { - var a, b, c2, d; - b = XKd(wjd(this.b), this.aj()); - if (JD(b, 99)) { - a = BD(b, 18); - c2 = zUd(a); - return !!c2 && (d = c2.t, d > 1 || d == -1); - } else { - return false; - } - }; - _2.Dk = function COd() { - var a, b, c2; - b = XKd(wjd(this.b), this.aj()); - if (JD(b, 99)) { - a = BD(b, 18); - c2 = zUd(a); - return !!c2; - } else { - return false; - } - }; - _2.Ek = function DOd() { - var a, b; - b = XKd(wjd(this.b), this.aj()); - if (JD(b, 99)) { - a = BD(b, 18); - return (a.Bb & Tje) != 0; - } else { - return false; - } - }; - _2.Xc = function EOd(a) { - var b, c2, d, e; - d = this.Qi(a); - if (d >= 0) - return d; - if (this.Fk()) { - for (c2 = 0, e = this.Vi(); c2 < e; ++c2) { - b = oOd(this, this.Oi(c2)); - if (PD(b) === PD(a)) { - return c2; - } - } - } - return -1; - }; - _2.cj = function FOd(a, b) { - var c2; - return c2 = BD(a, 49), this.Dk() ? this.Bk() ? c2.gh(this.b, zUd(BD(XKd(wjd(this.b), this.aj()), 18)).n, BD(XKd(wjd(this.b), this.aj()).Yj(), 26).Bj(), b) : c2.gh(this.b, bLd(c2.Tg(), zUd(BD(XKd(wjd(this.b), this.aj()), 18))), null, b) : c2.gh(this.b, -1 - this.aj(), null, b); - }; - _2.dj = function GOd(a, b) { - var c2; - return c2 = BD(a, 49), this.Dk() ? this.Bk() ? c2.ih(this.b, zUd(BD(XKd(wjd(this.b), this.aj()), 18)).n, BD(XKd(wjd(this.b), this.aj()).Yj(), 26).Bj(), b) : c2.ih(this.b, bLd(c2.Tg(), zUd(BD(XKd(wjd(this.b), this.aj()), 18))), null, b) : c2.ih(this.b, -1 - this.aj(), null, b); - }; - _2.rk = function HOd() { - var a, b; - b = XKd(wjd(this.b), this.aj()); - if (JD(b, 99)) { - a = BD(b, 18); - return (a.Bb & ote) != 0; - } else { - return false; - } - }; - _2.Fk = function IOd() { - return JD(XKd(wjd(this.b), this.aj()).Yj(), 88); - }; - _2.wj = function JOd(a) { - return XKd(wjd(this.b), this.aj()).Yj().wj(a); - }; - _2.ej = function KOd() { - return oid(this.b); - }; - _2.fj = function LOd() { - return !this.Ri(); - }; - _2.hi = function MOd() { - return XKd(wjd(this.b), this.aj()).hi(); - }; - _2.li = function NOd(a, b) { - return nOd(this, a, b); - }; - _2.Wb = function OOd(a) { - vwd(this); - ytd(this, BD(a, 15)); - }; - _2.Pc = function POd() { - var a; - if (this.Ek()) { - for (a = this.Vi() - 1; a >= 0; --a) { - nOd(this, a, this.Oi(a)); - } - } - return this.Wi(); - }; - _2.Qc = function QOd(a) { - var b; - if (this.Ek()) { - for (b = this.Vi() - 1; b >= 0; --b) { - nOd(this, b, this.Oi(b)); - } - } - return this.Xi(a); - }; - _2.Xj = function ROd() { - vwd(this); - }; - _2.oi = function SOd(a, b) { - return pOd(this, a, b); - }; - mdb(yve, "DelegatingEcoreEList", 742); - bcb(1150, 742, Uve, YOd); - _2.Hi = function _Od(a, b) { - TOd(this, a, BD(b, 26)); - }; - _2.Ii = function aPd(a) { - UOd(this, BD(a, 26)); - }; - _2.Oi = function gPd(a) { - var b, c2; - return b = BD(qud(VKd(this.a), a), 87), c2 = b.c, JD(c2, 88) ? BD(c2, 26) : (jGd(), _Fd); - }; - _2.Ti = function lPd(a) { - var b, c2; - return b = BD(Xxd(VKd(this.a), a), 87), c2 = b.c, JD(c2, 88) ? BD(c2, 26) : (jGd(), _Fd); - }; - _2.Ui = function mPd(a, b) { - return WOd(this, a, BD(b, 26)); - }; - _2.ai = function ZOd() { - return false; - }; - _2.Zi = function $Od(a, b, c2, d, e) { - return null; - }; - _2.Ji = function bPd() { - return new EPd(this); - }; - _2.Ki = function cPd() { - Uxd(VKd(this.a)); - }; - _2.Li = function dPd(a) { - return VOd(this, a); - }; - _2.Mi = function ePd(a) { - var b, c2; - for (c2 = a.Kc(); c2.Ob(); ) { - b = c2.Pb(); - if (!VOd(this, b)) { - return false; - } - } - return true; - }; - _2.Ni = function fPd(a) { - var b, c2, d; - if (JD(a, 15)) { - d = BD(a, 15); - if (d.gc() == VKd(this.a).i) { - for (b = d.Kc(), c2 = new Fyd(this); b.Ob(); ) { - if (PD(b.Pb()) !== PD(Dyd(c2))) { - return false; - } - } - return true; - } - } - return false; - }; - _2.Pi = function hPd() { - var a, b, c2, d, e; - c2 = 1; - for (b = new Fyd(VKd(this.a)); b.e != b.i.gc(); ) { - a = BD(Dyd(b), 87); - d = (e = a.c, JD(e, 88) ? BD(e, 26) : (jGd(), _Fd)); - c2 = 31 * c2 + (!d ? 0 : FCb(d)); - } - return c2; - }; - _2.Qi = function iPd(a) { - var b, c2, d, e; - d = 0; - for (c2 = new Fyd(VKd(this.a)); c2.e != c2.i.gc(); ) { - b = BD(Dyd(c2), 87); - if (PD(a) === PD((e = b.c, JD(e, 88) ? BD(e, 26) : (jGd(), _Fd)))) { - return d; - } - ++d; - } - return -1; - }; - _2.Ri = function jPd() { - return VKd(this.a).i == 0; - }; - _2.Si = function kPd() { - return null; - }; - _2.Vi = function nPd() { - return VKd(this.a).i; - }; - _2.Wi = function oPd() { - var a, b, c2, d, e, f2; - f2 = VKd(this.a).i; - e = KC(SI, Uhe, 1, f2, 5, 1); - c2 = 0; - for (b = new Fyd(VKd(this.a)); b.e != b.i.gc(); ) { - a = BD(Dyd(b), 87); - e[c2++] = (d = a.c, JD(d, 88) ? BD(d, 26) : (jGd(), _Fd)); - } - return e; - }; - _2.Xi = function pPd(a) { - var b, c2, d, e, f2, g, h; - h = VKd(this.a).i; - if (a.length < h) { - e = izd(rb(a).c, h); - a = e; - } - a.length > h && NC(a, h, null); - d = 0; - for (c2 = new Fyd(VKd(this.a)); c2.e != c2.i.gc(); ) { - b = BD(Dyd(c2), 87); - f2 = (g = b.c, JD(g, 88) ? BD(g, 26) : (jGd(), _Fd)); - NC(a, d++, f2); - } - return a; - }; - _2.Yi = function qPd() { - var a, b, c2, d, e; - e = new Hfb(); - e.a += "["; - a = VKd(this.a); - for (b = 0, d = VKd(this.a).i; b < d; ) { - Efb(e, xfb((c2 = BD(qud(a, b), 87).c, JD(c2, 88) ? BD(c2, 26) : (jGd(), _Fd)))); - ++b < d && (e.a += She, e); - } - e.a += "]"; - return e.a; - }; - _2.$i = function rPd(a) { - }; - _2.aj = function sPd() { - return 10; - }; - _2.Bk = function tPd() { - return true; - }; - _2.bj = function uPd() { - return false; - }; - _2.Ck = function vPd() { - return false; - }; - _2.Dk = function wPd() { - return false; - }; - _2.Ek = function xPd() { - return true; - }; - _2.rk = function yPd() { - return false; - }; - _2.Fk = function zPd() { - return true; - }; - _2.wj = function APd(a) { - return JD(a, 88); - }; - _2.fj = function BPd() { - return cLd(this.a); - }; - _2.hi = function CPd() { - return true; - }; - _2.ni = function DPd() { - return true; - }; - mdb(qte, "EClassImpl/8", 1150); - bcb(1151, 1964, Lie, EPd); - _2.Zc = function FPd(a) { - return ztd(this.a, a); - }; - _2.gc = function GPd() { - return VKd(this.a.a).i; - }; - mdb(qte, "EClassImpl/8/1", 1151); - bcb(1152, 497, oue, HPd); - _2.ri = function IPd(a) { - return KC(d5, Uhe, 138, a, 0, 1); - }; - _2.ni = function JPd() { - return false; - }; - mdb(qte, "EClassImpl/9", 1152); - bcb(1139, 53, gke, KPd); - mdb(qte, "EClassImpl/MyHashSet", 1139); - bcb(566, 351, { 105: 1, 92: 1, 90: 1, 138: 1, 148: 1, 834: 1, 147: 1, 191: 1, 56: 1, 108: 1, 49: 1, 97: 1, 351: 1, 150: 1, 114: 1, 115: 1, 676: 1 }, MPd); - _2._g = function NPd(a, b, c2) { - var d; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return this.D != null ? this.D : this.B; - case 3: - return dKd(this); - case 4: - return this.zj(); - case 5: - return this.F; - case 6: - if (b) - return bKd(this); - return ZJd(this); - case 7: - return !this.A && (this.A = new K4d(u5, this, 7)), this.A; - case 8: - return Bcb(), (this.Bb & 256) != 0 ? true : false; - } - return bid(this, a - aLd(this.zh()), XKd((d = BD(Ajd(this, 16), 26), !d ? this.zh() : d), a), b, c2); - }; - _2.lh = function OPd(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 !!dKd(this); - case 4: - return this.zj() != null; - case 5: - return this.F != null && this.F != this.D && this.F != this.B; - case 6: - return !!ZJd(this); - case 7: - return !!this.A && this.A.i != 0; - case 8: - return (this.Bb & 256) == 0; - } - return cid(this, a - aLd(this.zh()), XKd((b = BD(Ajd(this, 16), 26), !b ? this.zh() : b), a)); - }; - _2.sh = function PPd(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - ytd(this.Ab, BD(b, 14)); - return; - case 1: - lKd(this, GD(b)); - return; - case 2: - iKd(this, GD(b)); - return; - case 5: - kKd(this, GD(b)); - return; - case 7: - !this.A && (this.A = new K4d(u5, this, 7)); - Uxd(this.A); - !this.A && (this.A = new K4d(u5, this, 7)); - ytd(this.A, BD(b, 14)); - return; - case 8: - LPd(this, Ccb(DD(b))); - return; - } - did(this, a - aLd(this.zh()), XKd((c2 = BD(Ajd(this, 16), 26), !c2 ? this.zh() : c2), a), b); - }; - _2.zh = function QPd() { - return jGd(), TFd; - }; - _2.Bh = function RPd(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - return; - case 1: - JD(this.Cb, 179) && (BD(this.Cb, 179).tb = null); - pnd(this, null); - return; - case 2: - $Jd(this, null); - _Jd(this, this.D); - return; - case 5: - kKd(this, null); - return; - case 7: - !this.A && (this.A = new K4d(u5, this, 7)); - Uxd(this.A); - return; - case 8: - LPd(this, true); - return; - } - eid(this, a - aLd(this.zh()), XKd((b = BD(Ajd(this, 16), 26), !b ? this.zh() : b), a)); - }; - _2.Gh = function SPd() { - o1d((O6d(), M6d), this).ne(); - this.Bb |= 1; - }; - _2.Fj = function TPd() { - var a, b, c2; - if (!this.c) { - a = l6d(bKd(this)); - if (!a.dc()) { - for (c2 = a.Kc(); c2.Ob(); ) { - b = GD(c2.Pb()); - !!Dmd(this, b) && k6d(this); - } - } - } - return this.b; - }; - _2.zj = function UPd() { - var b; - if (!this.e) { - b = null; - try { - b = dKd(this); - } catch (a) { - a = ubb(a); - if (!JD(a, 102)) - throw vbb(a); - } - this.d = null; - !!b && (b.i & 1) != 0 && (b == sbb ? this.d = (Bcb(), zcb) : b == WD ? this.d = meb(0) : b == VD ? this.d = new Ndb(0) : b == UD ? this.d = 0 : b == XD ? this.d = Aeb(0) : b == rbb ? this.d = Web(0) : b == SD ? this.d = Scb(0) : this.d = bdb(0)); - this.e = true; - } - return this.d; - }; - _2.Ej = function VPd() { - return (this.Bb & 256) != 0; - }; - _2.Ik = function WPd(a) { - a && (this.D = "org.eclipse.emf.common.util.AbstractEnumerator"); - }; - _2.xk = function XPd(a) { - gKd(this, a); - this.Ik(a); - }; - _2.yk = function YPd(a) { - this.C = a; - this.e = false; - }; - _2.Ib = function ZPd() { - var a; - if ((this.Db & 64) != 0) - return mKd(this); - a = new Jfb(mKd(this)); - a.a += " (serializable: "; - Ffb(a, (this.Bb & 256) != 0); - a.a += ")"; - return a.a; - }; - _2.c = false; - _2.d = null; - _2.e = false; - mdb(qte, "EDataTypeImpl", 566); - bcb(457, 566, { 105: 1, 92: 1, 90: 1, 138: 1, 148: 1, 834: 1, 671: 1, 147: 1, 191: 1, 56: 1, 108: 1, 49: 1, 97: 1, 351: 1, 457: 1, 150: 1, 114: 1, 115: 1, 676: 1 }, aQd); - _2._g = function bQd(a, b, c2) { - var d; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return this.D != null ? this.D : this.B; - case 3: - return dKd(this); - case 4: - return $Pd(this); - case 5: - return this.F; - case 6: - if (b) - return bKd(this); - return ZJd(this); - case 7: - return !this.A && (this.A = new K4d(u5, this, 7)), this.A; - case 8: - return Bcb(), (this.Bb & 256) != 0 ? true : false; - case 9: - return !this.a && (this.a = new cUd(g5, this, 9, 5)), this.a; - } - return bid(this, a - aLd((jGd(), UFd)), XKd((d = BD(Ajd(this, 16), 26), !d ? UFd : d), a), b, c2); - }; - _2.hh = function cQd(a, b, c2) { - var d, e, f2; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Sxd(this.Ab, a, c2); - case 6: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? aKd(this, c2) : this.Cb.ih(this, -1 - e, null, c2))); - return _hd(this, a, 6, c2); - case 9: - return !this.a && (this.a = new cUd(g5, this, 9, 5)), Sxd(this.a, a, c2); - } - return f2 = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? (jGd(), UFd) : d), b), 66), f2.Nj().Qj(this, yjd(this), b - aLd((jGd(), UFd)), a, c2); - }; - _2.jh = function dQd(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Txd(this.Ab, a, c2); - case 6: - return _hd(this, null, 6, c2); - case 7: - return !this.A && (this.A = new K4d(u5, this, 7)), Txd(this.A, a, c2); - case 9: - return !this.a && (this.a = new cUd(g5, this, 9, 5)), Txd(this.a, a, c2); - } - return e = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? (jGd(), UFd) : d), b), 66), e.Nj().Rj(this, yjd(this), b - aLd((jGd(), UFd)), a, c2); - }; - _2.lh = function eQd(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 !!dKd(this); - case 4: - return !!$Pd(this); - case 5: - return this.F != null && this.F != this.D && this.F != this.B; - case 6: - return !!ZJd(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 cid(this, a - aLd((jGd(), UFd)), XKd((b = BD(Ajd(this, 16), 26), !b ? UFd : b), a)); - }; - _2.sh = function fQd(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - ytd(this.Ab, BD(b, 14)); - return; - case 1: - lKd(this, GD(b)); - return; - case 2: - iKd(this, GD(b)); - return; - case 5: - kKd(this, GD(b)); - return; - case 7: - !this.A && (this.A = new K4d(u5, this, 7)); - Uxd(this.A); - !this.A && (this.A = new K4d(u5, this, 7)); - ytd(this.A, BD(b, 14)); - return; - case 8: - LPd(this, Ccb(DD(b))); - return; - case 9: - !this.a && (this.a = new cUd(g5, this, 9, 5)); - Uxd(this.a); - !this.a && (this.a = new cUd(g5, this, 9, 5)); - ytd(this.a, BD(b, 14)); - return; - } - did(this, a - aLd((jGd(), UFd)), XKd((c2 = BD(Ajd(this, 16), 26), !c2 ? UFd : c2), a), b); - }; - _2.zh = function gQd() { - return jGd(), UFd; - }; - _2.Bh = function hQd(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - return; - case 1: - JD(this.Cb, 179) && (BD(this.Cb, 179).tb = null); - pnd(this, null); - return; - case 2: - $Jd(this, null); - _Jd(this, this.D); - return; - case 5: - kKd(this, null); - return; - case 7: - !this.A && (this.A = new K4d(u5, this, 7)); - Uxd(this.A); - return; - case 8: - LPd(this, true); - return; - case 9: - !this.a && (this.a = new cUd(g5, this, 9, 5)); - Uxd(this.a); - return; - } - eid(this, a - aLd((jGd(), UFd)), XKd((b = BD(Ajd(this, 16), 26), !b ? UFd : b), a)); - }; - _2.Gh = function iQd() { - var a, b; - if (this.a) { - for (a = 0, b = this.a.i; a < b; ++a) { - Cmd(qud(this.a, a)); - } - } - o1d((O6d(), M6d), this).ne(); - this.Bb |= 1; - }; - _2.zj = function jQd() { - return $Pd(this); - }; - _2.wj = function kQd(a) { - if (a != null) { - return true; - } - return false; - }; - _2.Ik = function lQd(a) { - }; - mdb(qte, "EEnumImpl", 457); - bcb(573, 438, { 105: 1, 92: 1, 90: 1, 1940: 1, 678: 1, 147: 1, 191: 1, 56: 1, 108: 1, 49: 1, 97: 1, 573: 1, 150: 1, 114: 1, 115: 1 }, rQd); - _2.ne = function AQd() { - return this.zb; - }; - _2.Qg = function sQd(a) { - return mQd(this, a); - }; - _2._g = function tQd(a, b, c2) { - var d, e; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return meb(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 ? BD(this.Cb, 671) : null; - } - return bid(this, a - aLd((jGd(), VFd)), XKd((d = BD(Ajd(this, 16), 26), !d ? VFd : d), a), b, c2); - }; - _2.hh = function uQd(a, b, c2) { - var d, e, f2; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Sxd(this.Ab, a, c2); - case 5: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? mQd(this, c2) : this.Cb.ih(this, -1 - e, null, c2))); - return _hd(this, a, 5, c2); - } - return f2 = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? (jGd(), VFd) : d), b), 66), f2.Nj().Qj(this, yjd(this), b - aLd((jGd(), VFd)), a, c2); - }; - _2.jh = function vQd(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Txd(this.Ab, a, c2); - case 5: - return _hd(this, null, 5, c2); - } - return e = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? (jGd(), VFd) : d), b), 66), e.Nj().Rj(this, yjd(this), b - aLd((jGd(), VFd)), a, c2); - }; - _2.lh = function wQd(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 ? BD(this.Cb, 671) : null); - } - return cid(this, a - aLd((jGd(), VFd)), XKd((b = BD(Ajd(this, 16), 26), !b ? VFd : b), a)); - }; - _2.sh = function xQd(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - ytd(this.Ab, BD(b, 14)); - return; - case 1: - pnd(this, GD(b)); - return; - case 2: - qQd(this, BD(b, 19).a); - return; - case 3: - oQd(this, BD(b, 1940)); - return; - case 4: - pQd(this, GD(b)); - return; - } - did(this, a - aLd((jGd(), VFd)), XKd((c2 = BD(Ajd(this, 16), 26), !c2 ? VFd : c2), a), b); - }; - _2.zh = function yQd() { - return jGd(), VFd; - }; - _2.Bh = function zQd(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - return; - case 1: - pnd(this, null); - return; - case 2: - qQd(this, 0); - return; - case 3: - oQd(this, null); - return; - case 4: - pQd(this, null); - return; - } - eid(this, a - aLd((jGd(), VFd)), XKd((b = BD(Ajd(this, 16), 26), !b ? VFd : b), a)); - }; - _2.Ib = function BQd() { - var a; - return a = this.c, a == null ? this.zb : a; - }; - _2.b = null; - _2.c = null; - _2.d = 0; - mdb(qte, "EEnumLiteralImpl", 573); - var c6 = odb(qte, "EFactoryImpl/InternalEDateTimeFormat"); - bcb(489, 1, { 2015: 1 }, EQd); - mdb(qte, "EFactoryImpl/1ClientInternalEDateTimeFormat", 489); - bcb(241, 115, { 105: 1, 92: 1, 90: 1, 87: 1, 56: 1, 108: 1, 49: 1, 97: 1, 241: 1, 114: 1, 115: 1 }, UQd); - _2.Sg = function VQd(a, b, c2) { - var d; - c2 = _hd(this, a, b, c2); - if (!!this.e && JD(a, 170)) { - d = MQd(this, this.e); - d != this.c && (c2 = QQd(this, d, c2)); - } - return c2; - }; - _2._g = function WQd(a, b, c2) { - var d; - switch (a) { - case 0: - return this.f; - case 1: - return !this.d && (this.d = new xMd(j5, this, 1)), this.d; - case 2: - if (b) - return KQd(this); - return this.c; - case 3: - return this.b; - case 4: - return this.e; - case 5: - if (b) - return JQd(this); - return this.a; - } - return bid(this, a - aLd((jGd(), XFd)), XKd((d = BD(Ajd(this, 16), 26), !d ? XFd : d), a), b, c2); - }; - _2.jh = function XQd(a, b, c2) { - var d, e; - switch (b) { - case 0: - return IQd(this, null, c2); - case 1: - return !this.d && (this.d = new xMd(j5, this, 1)), Txd(this.d, a, c2); - case 3: - return GQd(this, null, c2); - } - return e = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? (jGd(), XFd) : d), b), 66), e.Nj().Rj(this, yjd(this), b - aLd((jGd(), XFd)), a, c2); - }; - _2.lh = function YQd(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 cid(this, a - aLd((jGd(), XFd)), XKd((b = BD(Ajd(this, 16), 26), !b ? XFd : b), a)); - }; - _2.sh = function ZQd(a, b) { - var c2; - switch (a) { - case 0: - SQd(this, BD(b, 87)); - return; - case 1: - !this.d && (this.d = new xMd(j5, this, 1)); - Uxd(this.d); - !this.d && (this.d = new xMd(j5, this, 1)); - ytd(this.d, BD(b, 14)); - return; - case 3: - PQd(this, BD(b, 87)); - return; - case 4: - RQd(this, BD(b, 836)); - return; - case 5: - NQd(this, BD(b, 138)); - return; - } - did(this, a - aLd((jGd(), XFd)), XKd((c2 = BD(Ajd(this, 16), 26), !c2 ? XFd : c2), a), b); - }; - _2.zh = function $Qd() { - return jGd(), XFd; - }; - _2.Bh = function _Qd(a) { - var b; - switch (a) { - case 0: - SQd(this, null); - return; - case 1: - !this.d && (this.d = new xMd(j5, this, 1)); - Uxd(this.d); - return; - case 3: - PQd(this, null); - return; - case 4: - RQd(this, null); - return; - case 5: - NQd(this, null); - return; - } - eid(this, a - aLd((jGd(), XFd)), XKd((b = BD(Ajd(this, 16), 26), !b ? XFd : b), a)); - }; - _2.Ib = function aRd() { - var a; - a = new Wfb(Eid(this)); - a.a += " (expression: "; - TQd(this, a); - a.a += ")"; - return a.a; - }; - var FQd; - mdb(qte, "EGenericTypeImpl", 241); - bcb(1969, 1964, Vve); - _2.Xh = function cRd(a, b) { - bRd(this, a, b); - }; - _2.lk = function dRd(a, b) { - bRd(this, this.gc(), a); - return b; - }; - _2.pi = function eRd(a) { - return Ut(this.Gi(), a); - }; - _2.Zh = function fRd() { - return this.$h(); - }; - _2.Gi = function gRd() { - return new O0d(this); - }; - _2.$h = function hRd() { - return this._h(0); - }; - _2._h = function iRd(a) { - return this.Gi().Zc(a); - }; - _2.mk = function jRd(a, b) { - ze(this, a, true); - return b; - }; - _2.ii = function kRd(a, b) { - var c2, d; - d = Vt(this, b); - c2 = this.Zc(a); - c2.Rb(d); - return d; - }; - _2.ji = function lRd(a, b) { - var c2; - ze(this, b, true); - c2 = this.Zc(a); - c2.Rb(b); - }; - mdb(yve, "AbstractSequentialInternalEList", 1969); - bcb(486, 1969, Vve, qRd); - _2.pi = function rRd(a) { - return Ut(this.Gi(), a); - }; - _2.Zh = function sRd() { - if (this.b == null) { - return LRd(), LRd(), KRd; - } - return this.Jk(); - }; - _2.Gi = function tRd() { - return new w4d(this.a, this.b); - }; - _2.$h = function uRd() { - if (this.b == null) { - return LRd(), LRd(), KRd; - } - return this.Jk(); - }; - _2._h = function vRd(a) { - var b, c2; - if (this.b == null) { - if (a < 0 || a > 1) { - throw vbb(new qcb(gve + a + ", size=0")); - } - return LRd(), LRd(), KRd; - } - c2 = this.Jk(); - for (b = 0; b < a; ++b) { - MRd(c2); - } - return c2; - }; - _2.dc = function wRd() { - 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.Mk() || this.a.mh(a)) { - f2 = this.a.bh(a, false); - Q6d(); - if (BD(a, 66).Oj()) { - b = BD(f2, 153); - for (d = 0, e = b.gc(); d < e; ++d) { - if (oRd(b.il(d)) && b.jl(d) != null) { - return false; - } - } - } else if (a.$j()) { - if (!BD(f2, 14).dc()) { - return false; - } - } else if (f2 != null) { - return false; - } - } - } - } - return true; - }; - _2.Kc = function xRd() { - return pRd(this); - }; - _2.Zc = function yRd(a) { - var b, c2; - if (this.b == null) { - if (a != 0) { - throw vbb(new qcb(gve + a + ", size=0")); - } - return LRd(), LRd(), KRd; - } - c2 = this.Lk() ? this.Kk() : this.Jk(); - for (b = 0; b < a; ++b) { - MRd(c2); - } - return c2; - }; - _2.ii = function zRd(a, b) { - throw vbb(new bgb()); - }; - _2.ji = function ARd(a, b) { - throw vbb(new bgb()); - }; - _2.Jk = function BRd() { - return new RRd(this.a, this.b); - }; - _2.Kk = function CRd() { - return new dSd(this.a, this.b); - }; - _2.Lk = function DRd() { - return true; - }; - _2.gc = function ERd() { - 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.Mk() || this.a.mh(a)) { - g = this.a.bh(a, false); - Q6d(); - if (BD(a, 66).Oj()) { - b = BD(g, 153); - for (d = 0, f2 = b.gc(); d < f2; ++d) { - oRd(b.il(d)) && b.jl(d) != null && ++e; - } - } else - a.$j() ? e += BD(g, 14).gc() : g != null && ++e; - } - } - } - return e; - }; - _2.Mk = function FRd() { - return true; - }; - var mRd; - mdb(yve, "EContentsEList", 486); - bcb(1156, 486, Vve, GRd); - _2.Jk = function HRd() { - return new hSd(this.a, this.b); - }; - _2.Kk = function IRd() { - return new fSd(this.a, this.b); - }; - _2.Mk = function JRd() { - return false; - }; - mdb(qte, "ENamedElementImpl/1", 1156); - bcb(279, 1, Wve, RRd); - _2.Nb = function URd(a) { - Rrb(this, a); - }; - _2.Rb = function SRd(a) { - throw vbb(new bgb()); - }; - _2.Nk = function TRd(a) { - if (this.g != 0 || !!this.e) { - throw vbb(new Zdb("Iterator already in use or already filtered")); - } - this.e = a; - }; - _2.Ob = function VRd() { - 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 ? !NRd(this) : !ORd(this, this.p))) { - while (this.d < this.c.length) { - b = this.c[this.d++]; - if ((!this.e || b.Gj() != x2 || b.aj() != 0) && (!this.Mk() || this.b.mh(b))) { - f2 = this.b.bh(b, this.Lk()); - this.f = (Q6d(), BD(b, 66).Oj()); - if (this.f || b.$j()) { - if (this.Lk()) { - d = BD(f2, 15); - this.k = d; - } else { - d = BD(f2, 69); - this.k = this.j = d; - } - if (JD(this.k, 54)) { - this.p = null; - this.o = this.k.gc(); - this.n = 0; - } else { - this.p = !this.j ? this.k.Yc() : this.j.$h(); - } - if (!this.p ? NRd(this) : ORd(this, this.p)) { - e = !this.p ? !this.j ? this.k.Xb(this.n++) : this.j.pi(this.n++) : this.p.Pb(); - if (this.f) { - a = BD(e, 72); - a.ak(); - c2 = a.dd(); - 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.pi(this.n++) : this.p.Pb(); - if (this.f) { - a = BD(e, 72); - a.ak(); - c2 = a.dd(); - this.i = c2; - } else { - c2 = e; - this.i = c2; - } - this.g = 3; - return true; - } - } - } - }; - _2.Sb = function WRd() { - 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 ? !PRd(this) : !QRd(this, this.p))) { - while (this.d > 0) { - b = this.c[--this.d]; - if ((!this.e || b.Gj() != x2 || b.aj() != 0) && (!this.Mk() || this.b.mh(b))) { - f2 = this.b.bh(b, this.Lk()); - this.f = (Q6d(), BD(b, 66).Oj()); - if (this.f || b.$j()) { - if (this.Lk()) { - d = BD(f2, 15); - this.k = d; - } else { - d = BD(f2, 69); - this.k = this.j = d; - } - if (JD(this.k, 54)) { - this.o = this.k.gc(); - this.n = this.o; - } else { - this.p = !this.j ? this.k.Zc(this.k.gc()) : this.j._h(this.k.gc()); - } - if (!this.p ? PRd(this) : QRd(this, this.p)) { - e = !this.p ? !this.j ? this.k.Xb(--this.n) : this.j.pi(--this.n) : this.p.Ub(); - if (this.f) { - a = BD(e, 72); - a.ak(); - c2 = a.dd(); - 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.pi(--this.n) : this.p.Ub(); - if (this.f) { - a = BD(e, 72); - a.ak(); - c2 = a.dd(); - this.i = c2; - } else { - c2 = e; - this.i = c2; - } - this.g = -3; - return true; - } - } - } - }; - _2.Pb = function XRd() { - return MRd(this); - }; - _2.Tb = function YRd() { - return this.a; - }; - _2.Ub = function ZRd() { - var a; - if (this.g < -1 || this.Sb()) { - --this.a; - this.g = 0; - a = this.i; - this.Sb(); - return a; - } else { - throw vbb(new utb()); - } - }; - _2.Vb = function $Rd() { - return this.a - 1; - }; - _2.Qb = function _Rd() { - throw vbb(new bgb()); - }; - _2.Lk = function aSd() { - return false; - }; - _2.Wb = function bSd(a) { - throw vbb(new bgb()); - }; - _2.Mk = function cSd() { - return true; - }; - _2.a = 0; - _2.d = 0; - _2.f = false; - _2.g = 0; - _2.n = 0; - _2.o = 0; - var KRd; - mdb(yve, "EContentsEList/FeatureIteratorImpl", 279); - bcb(697, 279, Wve, dSd); - _2.Lk = function eSd() { - return true; - }; - mdb(yve, "EContentsEList/ResolvingFeatureIteratorImpl", 697); - bcb(1157, 697, Wve, fSd); - _2.Mk = function gSd() { - return false; - }; - mdb(qte, "ENamedElementImpl/1/1", 1157); - bcb(1158, 279, Wve, hSd); - _2.Mk = function iSd() { - return false; - }; - mdb(qte, "ENamedElementImpl/1/2", 1158); - bcb(36, 143, fve, lSd, mSd, nSd, oSd, pSd, qSd, rSd, sSd, tSd, uSd, vSd, wSd, xSd, ySd, zSd, ASd, BSd, CSd, DSd, ESd, FSd, GSd, HSd, ISd, JSd); - _2._i = function KSd() { - return kSd(this); - }; - _2.gj = function LSd() { - var a; - a = kSd(this); - if (a) { - return a.zj(); - } - return null; - }; - _2.yi = function MSd(a) { - this.b == -1 && !!this.a && (this.b = this.c.Xg(this.a.aj(), this.a.Gj())); - return this.c.Og(this.b, a); - }; - _2.Ai = function NSd() { - return this.c; - }; - _2.hj = function OSd() { - var a; - a = kSd(this); - if (a) { - return a.Kj(); - } - return false; - }; - _2.b = -1; - mdb(qte, "ENotificationImpl", 36); - bcb(399, 284, { 105: 1, 92: 1, 90: 1, 147: 1, 191: 1, 56: 1, 59: 1, 108: 1, 472: 1, 49: 1, 97: 1, 150: 1, 399: 1, 284: 1, 114: 1, 115: 1 }, SSd); - _2.Qg = function TSd(a) { - return PSd(this, a); - }; - _2._g = function USd(a, b, c2) { - var d, e, f2; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return Bcb(), (this.Bb & 256) != 0 ? true : false; - case 3: - return Bcb(), (this.Bb & 512) != 0 ? true : false; - case 4: - return meb(this.s); - case 5: - return meb(this.t); - case 6: - return Bcb(), f2 = this.t, f2 > 1 || f2 == -1 ? true : false; - case 7: - return Bcb(), e = this.s, e >= 1 ? true : false; - case 8: - if (b) - return wId(this); - return this.r; - case 9: - return this.q; - case 10: - return this.Db >> 16 == 10 ? BD(this.Cb, 26) : null; - case 11: - return !this.d && (this.d = new K4d(u5, this, 11)), this.d; - case 12: - return !this.c && (this.c = new cUd(p5, this, 12, 10)), this.c; - case 13: - return !this.a && (this.a = new fTd(this, this)), this.a; - case 14: - return QSd(this); - } - return bid(this, a - aLd((jGd(), aGd)), XKd((d = BD(Ajd(this, 16), 26), !d ? aGd : d), a), b, c2); - }; - _2.hh = function VSd(a, b, c2) { - var d, e, f2; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Sxd(this.Ab, a, c2); - case 10: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? PSd(this, c2) : this.Cb.ih(this, -1 - e, null, c2))); - return _hd(this, a, 10, c2); - case 12: - return !this.c && (this.c = new cUd(p5, this, 12, 10)), Sxd(this.c, a, c2); - } - return f2 = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? (jGd(), aGd) : d), b), 66), f2.Nj().Qj(this, yjd(this), b - aLd((jGd(), aGd)), a, c2); - }; - _2.jh = function WSd(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Txd(this.Ab, a, c2); - case 9: - return vId(this, c2); - case 10: - return _hd(this, null, 10, c2); - case 11: - return !this.d && (this.d = new K4d(u5, this, 11)), Txd(this.d, a, c2); - case 12: - return !this.c && (this.c = new cUd(p5, this, 12, 10)), Txd(this.c, a, c2); - case 14: - return Txd(QSd(this), a, c2); - } - return e = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? (jGd(), aGd) : d), b), 66), e.Nj().Rj(this, yjd(this), b - aLd((jGd(), aGd)), a, c2); - }; - _2.lh = function XSd(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 && LQd(this.q).i == 0; - case 9: - return !!this.q && !(!!this.r && !this.q.e && LQd(this.q).i == 0); - case 10: - return !!(this.Db >> 16 == 10 ? BD(this.Cb, 26) : null); - case 11: - return !!this.d && this.d.i != 0; - case 12: - return !!this.c && this.c.i != 0; - case 13: - return !!this.a && QSd(this.a.a).i != 0 && !(!!this.b && QTd(this.b)); - case 14: - return !!this.b && QTd(this.b); - } - return cid(this, a - aLd((jGd(), aGd)), XKd((b = BD(Ajd(this, 16), 26), !b ? aGd : b), a)); - }; - _2.sh = function YSd(a, b) { - var c2, d; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - ytd(this.Ab, BD(b, 14)); - return; - case 1: - pnd(this, GD(b)); - return; - case 2: - BId(this, Ccb(DD(b))); - return; - case 3: - CId(this, Ccb(DD(b))); - return; - case 4: - AId(this, BD(b, 19).a); - return; - case 5: - DId(this, BD(b, 19).a); - return; - case 8: - yId(this, BD(b, 138)); - return; - case 9: - d = xId(this, BD(b, 87), null); - !!d && d.Fi(); - return; - case 11: - !this.d && (this.d = new K4d(u5, this, 11)); - Uxd(this.d); - !this.d && (this.d = new K4d(u5, this, 11)); - ytd(this.d, BD(b, 14)); - return; - case 12: - !this.c && (this.c = new cUd(p5, this, 12, 10)); - Uxd(this.c); - !this.c && (this.c = new cUd(p5, this, 12, 10)); - ytd(this.c, BD(b, 14)); - return; - case 13: - !this.a && (this.a = new fTd(this, this)); - vwd(this.a); - !this.a && (this.a = new fTd(this, this)); - ytd(this.a, BD(b, 14)); - return; - case 14: - Uxd(QSd(this)); - ytd(QSd(this), BD(b, 14)); - return; - } - did(this, a - aLd((jGd(), aGd)), XKd((c2 = BD(Ajd(this, 16), 26), !c2 ? aGd : c2), a), b); - }; - _2.zh = function ZSd() { - return jGd(), aGd; - }; - _2.Bh = function $Sd(a) { - var b, c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - return; - case 1: - pnd(this, null); - return; - case 2: - BId(this, true); - return; - case 3: - CId(this, true); - return; - case 4: - AId(this, 0); - return; - case 5: - DId(this, 1); - return; - case 8: - yId(this, null); - return; - case 9: - c2 = xId(this, null, null); - !!c2 && c2.Fi(); - return; - case 11: - !this.d && (this.d = new K4d(u5, this, 11)); - Uxd(this.d); - return; - case 12: - !this.c && (this.c = new cUd(p5, this, 12, 10)); - Uxd(this.c); - return; - case 13: - !!this.a && vwd(this.a); - return; - case 14: - !!this.b && Uxd(this.b); - return; - } - eid(this, a - aLd((jGd(), aGd)), XKd((b = BD(Ajd(this, 16), 26), !b ? aGd : b), a)); - }; - _2.Gh = function _Sd() { - var a, b; - if (this.c) { - for (a = 0, b = this.c.i; a < b; ++a) { - Cmd(qud(this.c, a)); - } - } - wId(this); - this.Bb |= 1; - }; - mdb(qte, "EOperationImpl", 399); - bcb(505, 742, Uve, fTd); - _2.Hi = function iTd(a, b) { - aTd(this, a, BD(b, 138)); - }; - _2.Ii = function jTd(a) { - bTd(this, BD(a, 138)); - }; - _2.Oi = function pTd(a) { - var b, c2; - return b = BD(qud(QSd(this.a), a), 87), c2 = b.c, c2 ? c2 : (jGd(), YFd); - }; - _2.Ti = function uTd(a) { - var b, c2; - return b = BD(Xxd(QSd(this.a), a), 87), c2 = b.c, c2 ? c2 : (jGd(), YFd); - }; - _2.Ui = function vTd(a, b) { - return dTd(this, a, BD(b, 138)); - }; - _2.ai = function gTd() { - return false; - }; - _2.Zi = function hTd(a, b, c2, d, e) { - return null; - }; - _2.Ji = function kTd() { - return new NTd(this); - }; - _2.Ki = function lTd() { - Uxd(QSd(this.a)); - }; - _2.Li = function mTd(a) { - return cTd(this, a); - }; - _2.Mi = function nTd(a) { - var b, c2; - for (c2 = a.Kc(); c2.Ob(); ) { - b = c2.Pb(); - if (!cTd(this, b)) { - return false; - } - } - return true; - }; - _2.Ni = function oTd(a) { - var b, c2, d; - if (JD(a, 15)) { - d = BD(a, 15); - if (d.gc() == QSd(this.a).i) { - for (b = d.Kc(), c2 = new Fyd(this); b.Ob(); ) { - if (PD(b.Pb()) !== PD(Dyd(c2))) { - return false; - } - } - return true; - } - } - return false; - }; - _2.Pi = function qTd() { - var a, b, c2, d, e; - c2 = 1; - for (b = new Fyd(QSd(this.a)); b.e != b.i.gc(); ) { - a = BD(Dyd(b), 87); - d = (e = a.c, e ? e : (jGd(), YFd)); - c2 = 31 * c2 + (!d ? 0 : tb(d)); - } - return c2; - }; - _2.Qi = function rTd(a) { - var b, c2, d, e; - d = 0; - for (c2 = new Fyd(QSd(this.a)); c2.e != c2.i.gc(); ) { - b = BD(Dyd(c2), 87); - if (PD(a) === PD((e = b.c, e ? e : (jGd(), YFd)))) { - return d; - } - ++d; - } - return -1; - }; - _2.Ri = function sTd() { - return QSd(this.a).i == 0; - }; - _2.Si = function tTd() { - return null; - }; - _2.Vi = function wTd() { - return QSd(this.a).i; - }; - _2.Wi = function xTd() { - var a, b, c2, d, e, f2; - f2 = QSd(this.a).i; - e = KC(SI, Uhe, 1, f2, 5, 1); - c2 = 0; - for (b = new Fyd(QSd(this.a)); b.e != b.i.gc(); ) { - a = BD(Dyd(b), 87); - e[c2++] = (d = a.c, d ? d : (jGd(), YFd)); - } - return e; - }; - _2.Xi = function yTd(a) { - var b, c2, d, e, f2, g, h; - h = QSd(this.a).i; - if (a.length < h) { - e = izd(rb(a).c, h); - a = e; - } - a.length > h && NC(a, h, null); - d = 0; - for (c2 = new Fyd(QSd(this.a)); c2.e != c2.i.gc(); ) { - b = BD(Dyd(c2), 87); - f2 = (g = b.c, g ? g : (jGd(), YFd)); - NC(a, d++, f2); - } - return a; - }; - _2.Yi = function zTd() { - var a, b, c2, d, e; - e = new Hfb(); - e.a += "["; - a = QSd(this.a); - for (b = 0, d = QSd(this.a).i; b < d; ) { - Efb(e, xfb((c2 = BD(qud(a, b), 87).c, c2 ? c2 : (jGd(), YFd)))); - ++b < d && (e.a += She, e); - } - e.a += "]"; - return e.a; - }; - _2.$i = function ATd(a) { - }; - _2.aj = function BTd() { - return 13; - }; - _2.Bk = function CTd() { - return true; - }; - _2.bj = function DTd() { - return false; - }; - _2.Ck = function ETd() { - return false; - }; - _2.Dk = function FTd() { - return false; - }; - _2.Ek = function GTd() { - return true; - }; - _2.rk = function HTd() { - return false; - }; - _2.Fk = function ITd() { - return true; - }; - _2.wj = function JTd(a) { - return JD(a, 138); - }; - _2.fj = function KTd() { - return RSd(this.a); - }; - _2.hi = function LTd() { - return true; - }; - _2.ni = function MTd() { - return true; - }; - mdb(qte, "EOperationImpl/1", 505); - bcb(1340, 1964, Lie, NTd); - _2.Zc = function OTd(a) { - return ztd(this.a, a); - }; - _2.gc = function PTd() { - return QSd(this.a.a).i; - }; - mdb(qte, "EOperationImpl/1/1", 1340); - bcb(1341, 545, Pve, UTd); - _2.ii = function YTd(a, b) { - var c2, d; - return c2 = BD(Wxd(this, a, b), 87), oid(this.e) && GLd(this, new ESd(this.a, 7, (jGd(), bGd), meb(b), (d = c2.c, d ? d : YFd), a)), c2; - }; - _2.jj = function ZTd(a, b) { - return RTd(this, BD(a, 87), b); - }; - _2.kj = function $Td(a, b) { - return STd(this, BD(a, 87), b); - }; - _2.lj = function _Td(a, b, c2) { - return TTd(this, BD(a, 87), BD(b, 87), c2); - }; - _2.Zi = function VTd(a, b, c2, d, e) { - switch (a) { - case 3: { - return FLd(this, a, b, c2, d, this.i > 1); - } - case 5: { - return FLd(this, a, b, c2, d, this.i - BD(c2, 15).gc() > 0); - } - default: { - return new pSd(this.e, a, this.c, b, c2, d, true); - } - } - }; - _2.ij = function WTd() { - return true; - }; - _2.fj = function XTd() { - return QTd(this); - }; - _2.Xj = function aUd() { - Uxd(this); - }; - mdb(qte, "EOperationImpl/2", 1341); - bcb(498, 1, { 1938: 1, 498: 1 }, bUd); - mdb(qte, "EPackageImpl/1", 498); - bcb(16, 85, Pve, cUd); - _2.zk = function dUd() { - return this.d; - }; - _2.Ak = function eUd() { - return this.b; - }; - _2.Dk = function fUd() { - return true; - }; - _2.b = 0; - mdb(yve, "EObjectContainmentWithInverseEList", 16); - bcb(353, 16, Pve, gUd); - _2.Ek = function hUd() { - return true; - }; - _2.li = function iUd(a, b) { - return ILd(this, a, BD(b, 56)); - }; - mdb(yve, "EObjectContainmentWithInverseEList/Resolving", 353); - bcb(298, 353, Pve, jUd); - _2.ci = function kUd() { - this.a.tb = null; - }; - mdb(qte, "EPackageImpl/2", 298); - bcb(1228, 1, {}, lUd); - mdb(qte, "EPackageImpl/3", 1228); - bcb(718, 43, fke, oUd); - _2._b = function pUd(a) { - return ND(a) ? Qhb(this, a) : !!irb(this.f, a); - }; - mdb(qte, "EPackageRegistryImpl", 718); - bcb(509, 284, { 105: 1, 92: 1, 90: 1, 147: 1, 191: 1, 56: 1, 2017: 1, 108: 1, 472: 1, 49: 1, 97: 1, 150: 1, 509: 1, 284: 1, 114: 1, 115: 1 }, rUd); - _2.Qg = function sUd(a) { - return qUd(this, a); - }; - _2._g = function tUd(a, b, c2) { - var d, e, f2; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return Bcb(), (this.Bb & 256) != 0 ? true : false; - case 3: - return Bcb(), (this.Bb & 512) != 0 ? true : false; - case 4: - return meb(this.s); - case 5: - return meb(this.t); - case 6: - return Bcb(), f2 = this.t, f2 > 1 || f2 == -1 ? true : false; - case 7: - return Bcb(), e = this.s, e >= 1 ? true : false; - case 8: - if (b) - return wId(this); - return this.r; - case 9: - return this.q; - case 10: - return this.Db >> 16 == 10 ? BD(this.Cb, 59) : null; - } - return bid(this, a - aLd((jGd(), dGd)), XKd((d = BD(Ajd(this, 16), 26), !d ? dGd : d), a), b, c2); - }; - _2.hh = function uUd(a, b, c2) { - var d, e, f2; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Sxd(this.Ab, a, c2); - case 10: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? qUd(this, c2) : this.Cb.ih(this, -1 - e, null, c2))); - return _hd(this, a, 10, c2); - } - return f2 = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? (jGd(), dGd) : d), b), 66), f2.Nj().Qj(this, yjd(this), b - aLd((jGd(), dGd)), a, c2); - }; - _2.jh = function vUd(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Txd(this.Ab, a, c2); - case 9: - return vId(this, c2); - case 10: - return _hd(this, null, 10, c2); - } - return e = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? (jGd(), dGd) : d), b), 66), e.Nj().Rj(this, yjd(this), b - aLd((jGd(), dGd)), a, c2); - }; - _2.lh = function wUd(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 && LQd(this.q).i == 0; - case 9: - return !!this.q && !(!!this.r && !this.q.e && LQd(this.q).i == 0); - case 10: - return !!(this.Db >> 16 == 10 ? BD(this.Cb, 59) : null); - } - return cid(this, a - aLd((jGd(), dGd)), XKd((b = BD(Ajd(this, 16), 26), !b ? dGd : b), a)); - }; - _2.zh = function xUd() { - return jGd(), dGd; - }; - mdb(qte, "EParameterImpl", 509); - bcb(99, 449, { 105: 1, 92: 1, 90: 1, 147: 1, 191: 1, 56: 1, 18: 1, 170: 1, 66: 1, 108: 1, 472: 1, 49: 1, 97: 1, 150: 1, 99: 1, 449: 1, 284: 1, 114: 1, 115: 1, 677: 1 }, FUd); - _2._g = function GUd(a, b, c2) { - var d, e, f2, g; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return Bcb(), (this.Bb & 256) != 0 ? true : false; - case 3: - return Bcb(), (this.Bb & 512) != 0 ? true : false; - case 4: - return meb(this.s); - case 5: - return meb(this.t); - case 6: - return Bcb(), g = this.t, g > 1 || g == -1 ? true : false; - case 7: - return Bcb(), e = this.s, e >= 1 ? true : false; - case 8: - if (b) - return wId(this); - return this.r; - case 9: - return this.q; - case 10: - return Bcb(), (this.Bb & zte) != 0 ? true : false; - case 11: - return Bcb(), (this.Bb & Dve) != 0 ? true : false; - case 12: - return Bcb(), (this.Bb & Rje) != 0 ? true : false; - case 13: - return this.j; - case 14: - return VId(this); - case 15: - return Bcb(), (this.Bb & Cve) != 0 ? true : false; - case 16: - return Bcb(), (this.Bb & oie) != 0 ? true : false; - case 17: - return WId(this); - case 18: - return Bcb(), (this.Bb & ote) != 0 ? true : false; - case 19: - return Bcb(), f2 = zUd(this), !!f2 && (f2.Bb & ote) != 0 ? true : false; - case 20: - return Bcb(), (this.Bb & Tje) != 0 ? true : false; - case 21: - if (b) - return zUd(this); - return this.b; - case 22: - if (b) - return AUd(this); - return yUd(this); - case 23: - return !this.a && (this.a = new _4d(b5, this, 23)), this.a; - } - return bid(this, a - aLd((jGd(), eGd)), XKd((d = BD(Ajd(this, 16), 26), !d ? eGd : d), a), b, c2); - }; - _2.lh = function HUd(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 && LQd(this.q).i == 0; - case 9: - return !!this.q && !(!!this.r && !this.q.e && LQd(this.q).i == 0); - case 10: - return (this.Bb & zte) == 0; - case 11: - return (this.Bb & Dve) != 0; - case 12: - return (this.Bb & Rje) != 0; - case 13: - return this.j != null; - case 14: - return VId(this) != null; - case 15: - return (this.Bb & Cve) != 0; - case 16: - return (this.Bb & oie) != 0; - case 17: - return !!WId(this); - case 18: - return (this.Bb & ote) != 0; - case 19: - return d = zUd(this), !!d && (d.Bb & ote) != 0; - case 20: - return (this.Bb & Tje) == 0; - case 21: - return !!this.b; - case 22: - return !!yUd(this); - case 23: - return !!this.a && this.a.i != 0; - } - return cid(this, a - aLd((jGd(), eGd)), XKd((b = BD(Ajd(this, 16), 26), !b ? eGd : b), a)); - }; - _2.sh = function IUd(a, b) { - var c2, d; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - ytd(this.Ab, BD(b, 14)); - return; - case 1: - cJd(this, GD(b)); - return; - case 2: - BId(this, Ccb(DD(b))); - return; - case 3: - CId(this, Ccb(DD(b))); - return; - case 4: - AId(this, BD(b, 19).a); - return; - case 5: - DId(this, BD(b, 19).a); - return; - case 8: - yId(this, BD(b, 138)); - return; - case 9: - d = xId(this, BD(b, 87), null); - !!d && d.Fi(); - return; - case 10: - ZId(this, Ccb(DD(b))); - return; - case 11: - fJd(this, Ccb(DD(b))); - return; - case 12: - dJd(this, Ccb(DD(b))); - return; - case 13: - $Id(this, GD(b)); - return; - case 15: - eJd(this, Ccb(DD(b))); - return; - case 16: - aJd(this, Ccb(DD(b))); - return; - case 18: - BUd(this, Ccb(DD(b))); - return; - case 20: - EUd(this, Ccb(DD(b))); - return; - case 21: - DUd(this, BD(b, 18)); - return; - case 23: - !this.a && (this.a = new _4d(b5, this, 23)); - Uxd(this.a); - !this.a && (this.a = new _4d(b5, this, 23)); - ytd(this.a, BD(b, 14)); - return; - } - did(this, a - aLd((jGd(), eGd)), XKd((c2 = BD(Ajd(this, 16), 26), !c2 ? eGd : c2), a), b); - }; - _2.zh = function JUd() { - return jGd(), eGd; - }; - _2.Bh = function KUd(a) { - var b, c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - return; - case 1: - JD(this.Cb, 88) && XMd($Kd(BD(this.Cb, 88)), 4); - pnd(this, null); - return; - case 2: - BId(this, true); - return; - case 3: - CId(this, true); - return; - case 4: - AId(this, 0); - return; - case 5: - DId(this, 1); - return; - case 8: - yId(this, null); - return; - case 9: - c2 = xId(this, null, null); - !!c2 && c2.Fi(); - return; - case 10: - ZId(this, true); - return; - case 11: - fJd(this, false); - return; - case 12: - dJd(this, false); - return; - case 13: - this.i = null; - _Id(this, null); - return; - case 15: - eJd(this, false); - return; - case 16: - aJd(this, false); - return; - case 18: - CUd(this, false); - JD(this.Cb, 88) && XMd($Kd(BD(this.Cb, 88)), 2); - return; - case 20: - EUd(this, true); - return; - case 21: - DUd(this, null); - return; - case 23: - !this.a && (this.a = new _4d(b5, this, 23)); - Uxd(this.a); - return; - } - eid(this, a - aLd((jGd(), eGd)), XKd((b = BD(Ajd(this, 16), 26), !b ? eGd : b), a)); - }; - _2.Gh = function LUd() { - AUd(this); - a2d(q1d((O6d(), M6d), this)); - wId(this); - this.Bb |= 1; - }; - _2.Lj = function MUd() { - return zUd(this); - }; - _2.qk = function NUd() { - var a; - return a = zUd(this), !!a && (a.Bb & ote) != 0; - }; - _2.rk = function OUd() { - return (this.Bb & ote) != 0; - }; - _2.sk = function PUd() { - return (this.Bb & Tje) != 0; - }; - _2.nk = function QUd(a, b) { - this.c = null; - return zId(this, a, b); - }; - _2.Ib = function RUd() { - var a; - if ((this.Db & 64) != 0) - return gJd(this); - a = new Jfb(gJd(this)); - a.a += " (containment: "; - Ffb(a, (this.Bb & ote) != 0); - a.a += ", resolveProxies: "; - Ffb(a, (this.Bb & Tje) != 0); - a.a += ")"; - return a.a; - }; - mdb(qte, "EReferenceImpl", 99); - bcb(548, 115, { 105: 1, 42: 1, 92: 1, 90: 1, 133: 1, 56: 1, 108: 1, 49: 1, 97: 1, 548: 1, 114: 1, 115: 1 }, XUd); - _2.Fb = function bVd(a) { - return this === a; - }; - _2.cd = function dVd() { - return this.b; - }; - _2.dd = function eVd() { - return this.c; - }; - _2.Hb = function fVd() { - return FCb(this); - }; - _2.Uh = function hVd(a) { - SUd(this, GD(a)); - }; - _2.ed = function iVd(a) { - return WUd(this, GD(a)); - }; - _2._g = function YUd(a, b, c2) { - var d; - switch (a) { - case 0: - return this.b; - case 1: - return this.c; - } - return bid(this, a - aLd((jGd(), fGd)), XKd((d = BD(Ajd(this, 16), 26), !d ? fGd : d), a), b, c2); - }; - _2.lh = function ZUd(a) { - var b; - switch (a) { - case 0: - return this.b != null; - case 1: - return this.c != null; - } - return cid(this, a - aLd((jGd(), fGd)), XKd((b = BD(Ajd(this, 16), 26), !b ? fGd : b), a)); - }; - _2.sh = function $Ud(a, b) { - var c2; - switch (a) { - case 0: - TUd(this, GD(b)); - return; - case 1: - VUd(this, GD(b)); - return; - } - did(this, a - aLd((jGd(), fGd)), XKd((c2 = BD(Ajd(this, 16), 26), !c2 ? fGd : c2), a), b); - }; - _2.zh = function _Ud() { - return jGd(), fGd; - }; - _2.Bh = function aVd(a) { - var b; - switch (a) { - case 0: - UUd(this, null); - return; - case 1: - VUd(this, null); - return; - } - eid(this, a - aLd((jGd(), fGd)), XKd((b = BD(Ajd(this, 16), 26), !b ? fGd : b), a)); - }; - _2.Sh = function cVd() { - var a; - if (this.a == -1) { - a = this.b; - this.a = a == null ? 0 : LCb(a); - } - return this.a; - }; - _2.Th = function gVd(a) { - this.a = a; - }; - _2.Ib = function jVd() { - var a; - if ((this.Db & 64) != 0) - return Eid(this); - a = new Jfb(Eid(this)); - a.a += " (key: "; - Efb(a, this.b); - a.a += ", value: "; - Efb(a, this.c); - a.a += ")"; - return a.a; - }; - _2.a = -1; - _2.b = null; - _2.c = null; - var x6 = mdb(qte, "EStringToStringMapEntryImpl", 548); - var D9 = odb(yve, "FeatureMap/Entry/Internal"); - bcb(565, 1, Xve); - _2.Ok = function mVd(a) { - return this.Pk(BD(a, 49)); - }; - _2.Pk = function nVd(a) { - return this.Ok(a); - }; - _2.Fb = function oVd(a) { - var b, c2; - if (this === a) { - return true; - } else if (JD(a, 72)) { - b = BD(a, 72); - if (b.ak() == this.c) { - c2 = this.dd(); - return c2 == null ? b.dd() == null : pb(c2, b.dd()); - } else { - return false; - } - } else { - return false; - } - }; - _2.ak = function pVd() { - return this.c; - }; - _2.Hb = function qVd() { - var a; - a = this.dd(); - return tb(this.c) ^ (a == null ? 0 : tb(a)); - }; - _2.Ib = function rVd() { - var a, b; - a = this.c; - b = bKd(a.Hj()).Ph(); - a.ne(); - return (b != null && b.length != 0 ? b + ":" + a.ne() : a.ne()) + "=" + this.dd(); - }; - mdb(qte, "EStructuralFeatureImpl/BasicFeatureMapEntry", 565); - bcb(776, 565, Xve, uVd); - _2.Pk = function vVd(a) { - return new uVd(this.c, a); - }; - _2.dd = function wVd() { - return this.a; - }; - _2.Qk = function xVd(a, b, c2) { - return sVd(this, a, this.a, b, c2); - }; - _2.Rk = function yVd(a, b, c2) { - return tVd(this, a, this.a, b, c2); - }; - mdb(qte, "EStructuralFeatureImpl/ContainmentUpdatingFeatureMapEntry", 776); - bcb(1314, 1, {}, zVd); - _2.Pj = function AVd(a, b, c2, d, e) { - var f2; - f2 = BD(gid(a, this.b), 215); - return f2.nl(this.a).Wj(d); - }; - _2.Qj = function BVd(a, b, c2, d, e) { - var f2; - f2 = BD(gid(a, this.b), 215); - return f2.el(this.a, d, e); - }; - _2.Rj = function CVd(a, b, c2, d, e) { - var f2; - f2 = BD(gid(a, this.b), 215); - return f2.fl(this.a, d, e); - }; - _2.Sj = function DVd(a, b, c2) { - var d; - d = BD(gid(a, this.b), 215); - return d.nl(this.a).fj(); - }; - _2.Tj = function EVd(a, b, c2, d) { - var e; - e = BD(gid(a, this.b), 215); - e.nl(this.a).Wb(d); - }; - _2.Uj = function FVd(a, b, c2) { - return BD(gid(a, this.b), 215).nl(this.a); - }; - _2.Vj = function GVd(a, b, c2) { - var d; - d = BD(gid(a, this.b), 215); - d.nl(this.a).Xj(); - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateFeatureMapDelegator", 1314); - bcb(89, 1, {}, IVd, JVd, KVd, LVd); - _2.Pj = function MVd(a, b, c2, d, e) { - var f2; - f2 = b.Ch(c2); - f2 == null && b.Dh(c2, f2 = HVd(this, a)); - if (!e) { - switch (this.e) { - case 50: - case 41: - return BD(f2, 589).sj(); - case 40: - return BD(f2, 215).kl(); - } - } - return f2; - }; - _2.Qj = function NVd(a, b, c2, d, e) { - var f2, g; - g = b.Ch(c2); - g == null && b.Dh(c2, g = HVd(this, a)); - f2 = BD(g, 69).lk(d, e); - return f2; - }; - _2.Rj = function OVd(a, b, c2, d, e) { - var f2; - f2 = b.Ch(c2); - f2 != null && (e = BD(f2, 69).mk(d, e)); - return e; - }; - _2.Sj = function PVd(a, b, c2) { - var d; - d = b.Ch(c2); - return d != null && BD(d, 76).fj(); - }; - _2.Tj = function QVd(a, b, c2, d) { - var e; - e = BD(b.Ch(c2), 76); - !e && b.Dh(c2, e = HVd(this, a)); - e.Wb(d); - }; - _2.Uj = function RVd(a, b, c2) { - var d, e; - e = b.Ch(c2); - e == null && b.Dh(c2, e = HVd(this, a)); - if (JD(e, 76)) { - return BD(e, 76); - } else { - d = BD(b.Ch(c2), 15); - return new iYd(d); - } - }; - _2.Vj = function SVd(a, b, c2) { - var d; - d = BD(b.Ch(c2), 76); - !d && b.Dh(c2, d = HVd(this, a)); - d.Xj(); - }; - _2.b = 0; - _2.e = 0; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateMany", 89); - bcb(504, 1, {}); - _2.Qj = function WVd(a, b, c2, d, e) { - throw vbb(new bgb()); - }; - _2.Rj = function XVd(a, b, c2, d, e) { - throw vbb(new bgb()); - }; - _2.Uj = function YVd(a, b, c2) { - return new ZVd(this, a, b, c2); - }; - var TVd; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingle", 504); - bcb(1331, 1, zve, ZVd); - _2.Wj = function $Vd(a) { - return this.a.Pj(this.c, this.d, this.b, a, true); - }; - _2.fj = function _Vd() { - return this.a.Sj(this.c, this.d, this.b); - }; - _2.Wb = function aWd(a) { - this.a.Tj(this.c, this.d, this.b, a); - }; - _2.Xj = function bWd() { - this.a.Vj(this.c, this.d, this.b); - }; - _2.b = 0; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingle/1", 1331); - bcb(769, 504, {}, cWd); - _2.Pj = function dWd(a, b, c2, d, e) { - return Nid(a, a.eh(), a.Vg()) == this.b ? this.sk() && d ? aid(a) : a.eh() : null; - }; - _2.Qj = function eWd(a, b, c2, d, e) { - var f2, g; - !!a.eh() && (e = (f2 = a.Vg(), f2 >= 0 ? a.Qg(e) : a.eh().ih(a, -1 - f2, null, e))); - g = bLd(a.Tg(), this.e); - return a.Sg(d, g, e); - }; - _2.Rj = function fWd(a, b, c2, d, e) { - var f2; - f2 = bLd(a.Tg(), this.e); - return a.Sg(null, f2, e); - }; - _2.Sj = function gWd(a, b, c2) { - var d; - d = bLd(a.Tg(), this.e); - return !!a.eh() && a.Vg() == d; - }; - _2.Tj = function hWd(a, b, c2, d) { - var e, f2, g, h, i3; - if (d != null && !fKd(this.a, d)) { - throw vbb(new Cdb(Yve + (JD(d, 56) ? gLd(BD(d, 56).Tg()) : idb(rb(d))) + Zve + this.a + "'")); - } - e = a.eh(); - g = bLd(a.Tg(), this.e); - if (PD(d) !== PD(e) || a.Vg() != g && d != null) { - if (p6d(a, BD(d, 56))) - throw vbb(new Wdb(ste + a.Ib())); - i3 = null; - !!e && (i3 = (f2 = a.Vg(), f2 >= 0 ? a.Qg(i3) : a.eh().ih(a, -1 - f2, null, i3))); - h = BD(d, 49); - !!h && (i3 = h.gh(a, bLd(h.Tg(), this.b), null, i3)); - i3 = a.Sg(h, g, i3); - !!i3 && i3.Fi(); - } else { - a.Lg() && a.Mg() && Uhd(a, new nSd(a, 1, g, d, d)); - } - }; - _2.Vj = function iWd(a, b, c2) { - var d, e, f2, g; - d = a.eh(); - if (d) { - g = (e = a.Vg(), e >= 0 ? a.Qg(null) : a.eh().ih(a, -1 - e, null, null)); - f2 = bLd(a.Tg(), this.e); - g = a.Sg(null, f2, g); - !!g && g.Fi(); - } else { - a.Lg() && a.Mg() && Uhd(a, new DSd(a, 1, this.e, null, null)); - } - }; - _2.sk = function jWd() { - return false; - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleContainer", 769); - bcb(1315, 769, {}, kWd); - _2.sk = function lWd() { - return true; - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleContainerResolving", 1315); - bcb(563, 504, {}); - _2.Pj = function oWd(a, b, c2, d, e) { - var f2; - return f2 = b.Ch(c2), f2 == null ? this.b : PD(f2) === PD(TVd) ? null : f2; - }; - _2.Sj = function pWd(a, b, c2) { - var d; - d = b.Ch(c2); - return d != null && (PD(d) === PD(TVd) || !pb(d, this.b)); - }; - _2.Tj = function qWd(a, b, c2, d) { - var e, f2; - if (a.Lg() && a.Mg()) { - e = (f2 = b.Ch(c2), f2 == null ? this.b : PD(f2) === PD(TVd) ? null : f2); - if (d == null) { - if (this.c != null) { - b.Dh(c2, null); - d = this.b; - } else - this.b != null ? b.Dh(c2, TVd) : b.Dh(c2, null); - } else { - this.Sk(d); - b.Dh(c2, d); - } - Uhd(a, this.d.Tk(a, 1, this.e, e, d)); - } else { - if (d == null) { - this.c != null ? b.Dh(c2, null) : this.b != null ? b.Dh(c2, TVd) : b.Dh(c2, null); - } else { - this.Sk(d); - b.Dh(c2, d); - } - } - }; - _2.Vj = function rWd(a, b, c2) { - var d, e; - if (a.Lg() && a.Mg()) { - d = (e = b.Ch(c2), e == null ? this.b : PD(e) === PD(TVd) ? null : e); - b.Eh(c2); - Uhd(a, this.d.Tk(a, 1, this.e, d, this.b)); - } else { - b.Eh(c2); - } - }; - _2.Sk = function sWd(a) { - throw vbb(new Bdb()); - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleData", 563); - bcb($ve, 1, {}, DWd); - _2.Tk = function EWd(a, b, c2, d, e) { - return new DSd(a, b, c2, d, e); - }; - _2.Uk = function FWd(a, b, c2, d, e, f2) { - return new FSd(a, b, c2, d, e, f2); - }; - var tWd, uWd, vWd, wWd, xWd, yWd, zWd, AWd, BWd; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator", $ve); - bcb(1332, $ve, {}, GWd); - _2.Tk = function HWd(a, b, c2, d, e) { - return new ISd(a, b, c2, Ccb(DD(d)), Ccb(DD(e))); - }; - _2.Uk = function IWd(a, b, c2, d, e, f2) { - return new JSd(a, b, c2, Ccb(DD(d)), Ccb(DD(e)), f2); - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/1", 1332); - bcb(1333, $ve, {}, JWd); - _2.Tk = function KWd(a, b, c2, d, e) { - return new rSd(a, b, c2, BD(d, 217).a, BD(e, 217).a); - }; - _2.Uk = function LWd(a, b, c2, d, e, f2) { - return new sSd(a, b, c2, BD(d, 217).a, BD(e, 217).a, f2); - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/2", 1333); - bcb(1334, $ve, {}, MWd); - _2.Tk = function NWd(a, b, c2, d, e) { - return new tSd(a, b, c2, BD(d, 172).a, BD(e, 172).a); - }; - _2.Uk = function OWd(a, b, c2, d, e, f2) { - return new uSd(a, b, c2, BD(d, 172).a, BD(e, 172).a, f2); - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/3", 1334); - bcb(1335, $ve, {}, PWd); - _2.Tk = function QWd(a, b, c2, d, e) { - return new vSd(a, b, c2, Edb(ED(d)), Edb(ED(e))); - }; - _2.Uk = function RWd(a, b, c2, d, e, f2) { - return new wSd(a, b, c2, Edb(ED(d)), Edb(ED(e)), f2); - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/4", 1335); - bcb(1336, $ve, {}, SWd); - _2.Tk = function TWd(a, b, c2, d, e) { - return new xSd(a, b, c2, BD(d, 155).a, BD(e, 155).a); - }; - _2.Uk = function UWd(a, b, c2, d, e, f2) { - return new ySd(a, b, c2, BD(d, 155).a, BD(e, 155).a, f2); - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/5", 1336); - bcb(1337, $ve, {}, VWd); - _2.Tk = function WWd(a, b, c2, d, e) { - return new zSd(a, b, c2, BD(d, 19).a, BD(e, 19).a); - }; - _2.Uk = function XWd(a, b, c2, d, e, f2) { - return new ASd(a, b, c2, BD(d, 19).a, BD(e, 19).a, f2); - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/6", 1337); - bcb(1338, $ve, {}, YWd); - _2.Tk = function ZWd(a, b, c2, d, e) { - return new BSd(a, b, c2, BD(d, 162).a, BD(e, 162).a); - }; - _2.Uk = function $Wd(a, b, c2, d, e, f2) { - return new CSd(a, b, c2, BD(d, 162).a, BD(e, 162).a, f2); - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/7", 1338); - bcb(1339, $ve, {}, _Wd); - _2.Tk = function aXd(a, b, c2, d, e) { - return new GSd(a, b, c2, BD(d, 184).a, BD(e, 184).a); - }; - _2.Uk = function bXd(a, b, c2, d, e, f2) { - return new HSd(a, b, c2, BD(d, 184).a, BD(e, 184).a, f2); - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/8", 1339); - bcb(1317, 563, {}, cXd); - _2.Sk = function dXd(a) { - if (!this.a.wj(a)) { - throw vbb(new Cdb(Yve + rb(a) + Zve + this.a + "'")); - } - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleDataDynamic", 1317); - bcb(1318, 563, {}, eXd); - _2.Sk = function fXd(a) { - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleDataStatic", 1318); - bcb(770, 563, {}); - _2.Sj = function gXd(a, b, c2) { - var d; - d = b.Ch(c2); - return d != null; - }; - _2.Tj = function hXd(a, b, c2, d) { - var e, f2; - if (a.Lg() && a.Mg()) { - e = true; - f2 = b.Ch(c2); - if (f2 == null) { - e = false; - f2 = this.b; - } else - PD(f2) === PD(TVd) && (f2 = null); - if (d == null) { - if (this.c != null) { - b.Dh(c2, null); - d = this.b; - } else { - b.Dh(c2, TVd); - } - } else { - this.Sk(d); - b.Dh(c2, d); - } - Uhd(a, this.d.Uk(a, 1, this.e, f2, d, !e)); - } else { - if (d == null) { - this.c != null ? b.Dh(c2, null) : b.Dh(c2, TVd); - } else { - this.Sk(d); - b.Dh(c2, d); - } - } - }; - _2.Vj = function iXd(a, b, c2) { - var d, e; - if (a.Lg() && a.Mg()) { - d = true; - e = b.Ch(c2); - if (e == null) { - d = false; - e = this.b; - } else - PD(e) === PD(TVd) && (e = null); - b.Eh(c2); - Uhd(a, this.d.Uk(a, 2, this.e, e, this.b, d)); - } else { - b.Eh(c2); - } - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettable", 770); - bcb(1319, 770, {}, jXd); - _2.Sk = function kXd(a) { - if (!this.a.wj(a)) { - throw vbb(new Cdb(Yve + rb(a) + Zve + this.a + "'")); - } - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableDynamic", 1319); - bcb(1320, 770, {}, lXd); - _2.Sk = function mXd(a) { - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableStatic", 1320); - bcb(398, 504, {}, nXd); - _2.Pj = function pXd(a, b, c2, d, e) { - var f2, g, h, i3, j; - j = b.Ch(c2); - if (this.Kj() && PD(j) === PD(TVd)) { - return null; - } else if (this.sk() && d && j != null) { - h = BD(j, 49); - if (h.kh()) { - i3 = xid(a, h); - if (h != i3) { - if (!fKd(this.a, i3)) { - throw vbb(new Cdb(Yve + rb(i3) + Zve + this.a + "'")); - } - b.Dh(c2, j = i3); - if (this.rk()) { - f2 = BD(i3, 49); - g = h.ih(a, !this.b ? -1 - bLd(a.Tg(), this.e) : bLd(h.Tg(), this.b), null, null); - !f2.eh() && (g = f2.gh(a, !this.b ? -1 - bLd(a.Tg(), this.e) : bLd(f2.Tg(), this.b), null, g)); - !!g && g.Fi(); - } - a.Lg() && a.Mg() && Uhd(a, new DSd(a, 9, this.e, h, i3)); - } - } - return j; - } else { - return j; - } - }; - _2.Qj = function qXd(a, b, c2, d, e) { - var f2, g; - g = b.Ch(c2); - PD(g) === PD(TVd) && (g = null); - b.Dh(c2, d); - if (this.bj()) { - if (PD(g) !== PD(d) && g != null) { - f2 = BD(g, 49); - e = f2.ih(a, bLd(f2.Tg(), this.b), null, e); - } - } else - this.rk() && g != null && (e = BD(g, 49).ih(a, -1 - bLd(a.Tg(), this.e), null, e)); - if (a.Lg() && a.Mg()) { - !e && (e = new Ixd(4)); - e.Ei(new DSd(a, 1, this.e, g, d)); - } - return e; - }; - _2.Rj = function rXd(a, b, c2, d, e) { - var f2; - f2 = b.Ch(c2); - PD(f2) === PD(TVd) && (f2 = null); - b.Eh(c2); - if (a.Lg() && a.Mg()) { - !e && (e = new Ixd(4)); - this.Kj() ? e.Ei(new DSd(a, 2, this.e, f2, null)) : e.Ei(new DSd(a, 1, this.e, f2, null)); - } - return e; - }; - _2.Sj = function sXd(a, b, c2) { - var d; - d = b.Ch(c2); - return d != null; - }; - _2.Tj = function tXd(a, b, c2, d) { - var e, f2, g, h, i3; - if (d != null && !fKd(this.a, d)) { - throw vbb(new Cdb(Yve + (JD(d, 56) ? gLd(BD(d, 56).Tg()) : idb(rb(d))) + Zve + this.a + "'")); - } - i3 = b.Ch(c2); - h = i3 != null; - this.Kj() && PD(i3) === PD(TVd) && (i3 = null); - g = null; - if (this.bj()) { - if (PD(i3) !== PD(d)) { - if (i3 != null) { - e = BD(i3, 49); - g = e.ih(a, bLd(e.Tg(), this.b), null, g); - } - if (d != null) { - e = BD(d, 49); - g = e.gh(a, bLd(e.Tg(), this.b), null, g); - } - } - } else if (this.rk()) { - if (PD(i3) !== PD(d)) { - i3 != null && (g = BD(i3, 49).ih(a, -1 - bLd(a.Tg(), this.e), null, g)); - d != null && (g = BD(d, 49).gh(a, -1 - bLd(a.Tg(), this.e), null, g)); - } - } - d == null && this.Kj() ? b.Dh(c2, TVd) : b.Dh(c2, d); - if (a.Lg() && a.Mg()) { - f2 = new FSd(a, 1, this.e, i3, d, this.Kj() && !h); - if (!g) { - Uhd(a, f2); - } else { - g.Ei(f2); - g.Fi(); - } - } else - !!g && g.Fi(); - }; - _2.Vj = function uXd(a, b, c2) { - var d, e, f2, g, h; - h = b.Ch(c2); - g = h != null; - this.Kj() && PD(h) === PD(TVd) && (h = null); - f2 = null; - if (h != null) { - if (this.bj()) { - d = BD(h, 49); - f2 = d.ih(a, bLd(d.Tg(), this.b), null, f2); - } else - this.rk() && (f2 = BD(h, 49).ih(a, -1 - bLd(a.Tg(), this.e), null, f2)); - } - b.Eh(c2); - if (a.Lg() && a.Mg()) { - e = new FSd(a, this.Kj() ? 2 : 1, this.e, h, null, g); - if (!f2) { - Uhd(a, e); - } else { - f2.Ei(e); - f2.Fi(); - } - } else - !!f2 && f2.Fi(); - }; - _2.bj = function vXd() { - return false; - }; - _2.rk = function wXd() { - return false; - }; - _2.sk = function xXd() { - return false; - }; - _2.Kj = function yXd() { - return false; - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObject", 398); - bcb(564, 398, {}, zXd); - _2.rk = function AXd() { - return true; - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainment", 564); - bcb(1323, 564, {}, BXd); - _2.sk = function CXd() { - return true; - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentResolving", 1323); - bcb(772, 564, {}, DXd); - _2.Kj = function EXd() { - return true; - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettable", 772); - bcb(1325, 772, {}, FXd); - _2.sk = function GXd() { - return true; - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettableResolving", 1325); - bcb(640, 564, {}, HXd); - _2.bj = function IXd() { - return true; - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverse", 640); - bcb(1324, 640, {}, JXd); - _2.sk = function KXd() { - return true; - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseResolving", 1324); - bcb(773, 640, {}, LXd); - _2.Kj = function MXd() { - return true; - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettable", 773); - bcb(1326, 773, {}, NXd); - _2.sk = function OXd() { - return true; - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettableResolving", 1326); - bcb(641, 398, {}, PXd); - _2.sk = function QXd() { - return true; - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolving", 641); - bcb(1327, 641, {}, RXd); - _2.Kj = function SXd() { - return true; - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingUnsettable", 1327); - bcb(774, 641, {}, TXd); - _2.bj = function UXd() { - return true; - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverse", 774); - bcb(1328, 774, {}, VXd); - _2.Kj = function WXd() { - return true; - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverseUnsettable", 1328); - bcb(1321, 398, {}, XXd); - _2.Kj = function YXd() { - return true; - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectUnsettable", 1321); - bcb(771, 398, {}, ZXd); - _2.bj = function $Xd() { - return true; - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverse", 771); - bcb(1322, 771, {}, _Xd); - _2.Kj = function aYd() { - return true; - }; - mdb(qte, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverseUnsettable", 1322); - bcb(775, 565, Xve, dYd); - _2.Pk = function eYd(a) { - return new dYd(this.a, this.c, a); - }; - _2.dd = function fYd() { - return this.b; - }; - _2.Qk = function gYd(a, b, c2) { - return bYd(this, a, this.b, c2); - }; - _2.Rk = function hYd(a, b, c2) { - return cYd(this, a, this.b, c2); - }; - mdb(qte, "EStructuralFeatureImpl/InverseUpdatingFeatureMapEntry", 775); - bcb(1329, 1, zve, iYd); - _2.Wj = function jYd(a) { - return this.a; - }; - _2.fj = function kYd() { - return JD(this.a, 95) ? BD(this.a, 95).fj() : !this.a.dc(); - }; - _2.Wb = function lYd(a) { - this.a.$b(); - this.a.Gc(BD(a, 15)); - }; - _2.Xj = function mYd() { - JD(this.a, 95) ? BD(this.a, 95).Xj() : this.a.$b(); - }; - mdb(qte, "EStructuralFeatureImpl/SettingMany", 1329); - bcb(1330, 565, Xve, nYd); - _2.Ok = function oYd(a) { - return new sYd((Q8d(), P8d), this.b.Ih(this.a, a)); - }; - _2.dd = function pYd() { - return null; - }; - _2.Qk = function qYd(a, b, c2) { - return c2; - }; - _2.Rk = function rYd(a, b, c2) { - return c2; - }; - mdb(qte, "EStructuralFeatureImpl/SimpleContentFeatureMapEntry", 1330); - bcb(642, 565, Xve, sYd); - _2.Ok = function tYd(a) { - return new sYd(this.c, a); - }; - _2.dd = function uYd() { - return this.a; - }; - _2.Qk = function vYd(a, b, c2) { - return c2; - }; - _2.Rk = function wYd(a, b, c2) { - return c2; - }; - mdb(qte, "EStructuralFeatureImpl/SimpleFeatureMapEntry", 642); - bcb(391, 497, oue, xYd); - _2.ri = function yYd(a) { - return KC(c5, Uhe, 26, a, 0, 1); - }; - _2.ni = function zYd() { - return false; - }; - mdb(qte, "ESuperAdapter/1", 391); - bcb(444, 438, { 105: 1, 92: 1, 90: 1, 147: 1, 191: 1, 56: 1, 108: 1, 836: 1, 49: 1, 97: 1, 150: 1, 444: 1, 114: 1, 115: 1 }, BYd); - _2._g = function CYd(a, b, c2) { - var d; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return !this.a && (this.a = new KYd(this, j5, this)), this.a; - } - return bid(this, a - aLd((jGd(), iGd)), XKd((d = BD(Ajd(this, 16), 26), !d ? iGd : d), a), b, c2); - }; - _2.jh = function DYd(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)), Txd(this.Ab, a, c2); - case 2: - return !this.a && (this.a = new KYd(this, j5, this)), Txd(this.a, a, c2); - } - return e = BD(XKd((d = BD(Ajd(this, 16), 26), !d ? (jGd(), iGd) : d), b), 66), e.Nj().Rj(this, yjd(this), b - aLd((jGd(), iGd)), a, c2); - }; - _2.lh = function EYd(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 cid(this, a - aLd((jGd(), iGd)), XKd((b = BD(Ajd(this, 16), 26), !b ? iGd : b), a)); - }; - _2.sh = function FYd(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - ytd(this.Ab, BD(b, 14)); - return; - case 1: - pnd(this, GD(b)); - return; - case 2: - !this.a && (this.a = new KYd(this, j5, this)); - Uxd(this.a); - !this.a && (this.a = new KYd(this, j5, this)); - ytd(this.a, BD(b, 14)); - return; - } - did(this, a - aLd((jGd(), iGd)), XKd((c2 = BD(Ajd(this, 16), 26), !c2 ? iGd : c2), a), b); - }; - _2.zh = function GYd() { - return jGd(), iGd; - }; - _2.Bh = function HYd(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new cUd(a5, this, 0, 3)); - Uxd(this.Ab); - return; - case 1: - pnd(this, null); - return; - case 2: - !this.a && (this.a = new KYd(this, j5, this)); - Uxd(this.a); - return; - } - eid(this, a - aLd((jGd(), iGd)), XKd((b = BD(Ajd(this, 16), 26), !b ? iGd : b), a)); - }; - mdb(qte, "ETypeParameterImpl", 444); - bcb(445, 85, Pve, KYd); - _2.cj = function LYd(a, b) { - return IYd(this, BD(a, 87), b); - }; - _2.dj = function MYd(a, b) { - return JYd(this, BD(a, 87), b); - }; - mdb(qte, "ETypeParameterImpl/1", 445); - bcb(634, 43, fke, NYd); - _2.ec = function OYd() { - return new RYd(this); - }; - mdb(qte, "ETypeParameterImpl/2", 634); - bcb(556, eie, fie, RYd); - _2.Fc = function SYd(a) { - return PYd(this, BD(a, 87)); - }; - _2.Gc = function TYd(a) { - var b, c2, d; - d = false; - for (c2 = a.Kc(); c2.Ob(); ) { - b = BD(c2.Pb(), 87); - Rhb(this.a, b, "") == null && (d = true); - } - return d; - }; - _2.$b = function UYd() { - Uhb(this.a); - }; - _2.Hc = function VYd(a) { - return Mhb(this.a, a); - }; - _2.Kc = function WYd() { - var a; - return a = new nib(new eib(this.a).a), new ZYd(a); - }; - _2.Mc = function XYd(a) { - return QYd(this, a); - }; - _2.gc = function YYd() { - return Vhb(this.a); - }; - mdb(qte, "ETypeParameterImpl/2/1", 556); - bcb(557, 1, aie, ZYd); - _2.Nb = function $Yd(a) { - Rrb(this, a); - }; - _2.Pb = function aZd() { - return BD(lib(this.a).cd(), 87); - }; - _2.Ob = function _Yd() { - return this.a.b; - }; - _2.Qb = function bZd() { - mib(this.a); - }; - mdb(qte, "ETypeParameterImpl/2/1/1", 557); - bcb(1276, 43, fke, cZd); - _2._b = function dZd(a) { - return ND(a) ? Qhb(this, a) : !!irb(this.f, a); - }; - _2.xc = function eZd(a) { - var b, c2; - b = ND(a) ? Phb(this, a) : Wd(irb(this.f, a)); - if (JD(b, 837)) { - c2 = BD(b, 837); - b = c2._j(); - Rhb(this, BD(a, 235), b); - return b; - } else - return b != null ? b : a == null ? (g5d(), f5d) : null; - }; - mdb(qte, "EValidatorRegistryImpl", 1276); - bcb(1313, 704, { 105: 1, 92: 1, 90: 1, 471: 1, 147: 1, 56: 1, 108: 1, 1941: 1, 49: 1, 97: 1, 150: 1, 114: 1, 115: 1 }, mZd); - _2.Ih = function nZd(a, b) { - switch (a.yj()) { - 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 : fcb(b); - case 25: - return gZd(b); - case 27: - return hZd(b); - case 28: - return iZd(b); - case 29: - return b == null ? null : CQd(Pmd[0], BD(b, 199)); - case 41: - return b == null ? "" : hdb(BD(b, 290)); - case 42: - return fcb(b); - case 50: - return GD(b); - default: - throw vbb(new Wdb(tte + a.ne() + ute)); - } - }; - _2.Jh = function oZd(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q; - switch (a.G == -1 && (a.G = (m = bKd(a), m ? HLd(m.Mh(), a) : -1)), a.G) { - case 0: - return c2 = new OJd(), c2; - case 1: - return b = new RHd(), b; - case 2: - return d = new hLd(), d; - case 4: - return e = new MPd(), e; - case 5: - return f2 = new aQd(), f2; - case 6: - return g = new rQd(), g; - case 7: - return h = new $md(), h; - case 10: - return j = new MGd(), j; - case 11: - return k = new SSd(), k; - case 12: - return l = new eod(), l; - case 13: - return n = new rUd(), n; - case 14: - return o2 = new FUd(), o2; - case 17: - return p = new XUd(), p; - case 18: - return i3 = new UQd(), i3; - case 19: - return q = new BYd(), q; - default: - throw vbb(new Wdb(xte + a.zb + ute)); - } - }; - _2.Kh = function pZd(a, b) { - switch (a.yj()) { - case 20: - return b == null ? null : new tgb(b); - case 21: - return b == null ? null : new Ygb(b); - case 23: - case 22: - return b == null ? null : fZd(b); - case 26: - case 24: - return b == null ? null : Scb(Icb(b, -128, 127) << 24 >> 24); - case 25: - return Xmd(b); - case 27: - return jZd(b); - case 28: - return kZd(b); - case 29: - return lZd(b); - case 32: - case 31: - return b == null ? null : Hcb(b); - case 38: - case 37: - return b == null ? null : new Odb(b); - case 40: - case 39: - return b == null ? null : meb(Icb(b, Rie, Ohe)); - case 41: - return null; - case 42: - return b == null ? null : null; - case 44: - case 43: - return b == null ? null : Aeb(Jcb(b)); - case 49: - case 48: - return b == null ? null : Web(Icb(b, awe, 32767) << 16 >> 16); - case 50: - return b; - default: - throw vbb(new Wdb(tte + a.ne() + ute)); - } - }; - mdb(qte, "EcoreFactoryImpl", 1313); - bcb(547, 179, { 105: 1, 92: 1, 90: 1, 147: 1, 191: 1, 56: 1, 235: 1, 108: 1, 1939: 1, 49: 1, 97: 1, 150: 1, 179: 1, 547: 1, 114: 1, 115: 1, 675: 1 }, AZd); - _2.gb = false; - _2.hb = false; - var rZd, sZd = false; - mdb(qte, "EcorePackageImpl", 547); - bcb(1184, 1, { 837: 1 }, EZd); - _2._j = function FZd() { - return I6d(), H6d; - }; - mdb(qte, "EcorePackageImpl/1", 1184); - bcb(1193, 1, nwe, GZd); - _2.wj = function HZd(a) { - return JD(a, 147); - }; - _2.xj = function IZd(a) { - return KC(k5, Uhe, 147, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/10", 1193); - bcb(1194, 1, nwe, JZd); - _2.wj = function KZd(a) { - return JD(a, 191); - }; - _2.xj = function LZd(a) { - return KC(l5, Uhe, 191, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/11", 1194); - bcb(1195, 1, nwe, MZd); - _2.wj = function NZd(a) { - return JD(a, 56); - }; - _2.xj = function OZd(a) { - return KC(m5, Uhe, 56, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/12", 1195); - bcb(1196, 1, nwe, PZd); - _2.wj = function QZd(a) { - return JD(a, 399); - }; - _2.xj = function RZd(a) { - return KC(n5, Nve, 59, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/13", 1196); - bcb(1197, 1, nwe, SZd); - _2.wj = function TZd(a) { - return JD(a, 235); - }; - _2.xj = function UZd(a) { - return KC(o5, Uhe, 235, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/14", 1197); - bcb(1198, 1, nwe, VZd); - _2.wj = function WZd(a) { - return JD(a, 509); - }; - _2.xj = function XZd(a) { - return KC(p5, Uhe, 2017, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/15", 1198); - bcb(1199, 1, nwe, YZd); - _2.wj = function ZZd(a) { - return JD(a, 99); - }; - _2.xj = function $Zd(a) { - return KC(q5, Mve, 18, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/16", 1199); - bcb(1200, 1, nwe, _Zd); - _2.wj = function a$d(a) { - return JD(a, 170); - }; - _2.xj = function b$d(a) { - return KC(t5, Mve, 170, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/17", 1200); - bcb(1201, 1, nwe, c$d); - _2.wj = function d$d(a) { - return JD(a, 472); - }; - _2.xj = function e$d(a) { - return KC(v52, Uhe, 472, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/18", 1201); - bcb(1202, 1, nwe, f$d); - _2.wj = function g$d(a) { - return JD(a, 548); - }; - _2.xj = function h$d(a) { - return KC(x6, kve, 548, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/19", 1202); - bcb(1185, 1, nwe, i$d); - _2.wj = function j$d(a) { - return JD(a, 322); - }; - _2.xj = function k$d(a) { - return KC(b5, Mve, 34, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/2", 1185); - bcb(1203, 1, nwe, l$d); - _2.wj = function m$d(a) { - return JD(a, 241); - }; - _2.xj = function n$d(a) { - return KC(j5, Tve, 87, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/20", 1203); - bcb(1204, 1, nwe, o$d); - _2.wj = function p$d(a) { - return JD(a, 444); - }; - _2.xj = function q$d(a) { - return KC(u5, Uhe, 836, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/21", 1204); - bcb(1205, 1, nwe, r$d); - _2.wj = function s$d(a) { - return KD(a); - }; - _2.xj = function t$d(a) { - return KC(wI, nie, 476, a, 8, 1); - }; - mdb(qte, "EcorePackageImpl/22", 1205); - bcb(1206, 1, nwe, u$d); - _2.wj = function v$d(a) { - return JD(a, 190); - }; - _2.xj = function w$d(a) { - return KC(SD, nie, 190, a, 0, 2); - }; - mdb(qte, "EcorePackageImpl/23", 1206); - bcb(1207, 1, nwe, x$d); - _2.wj = function y$d(a) { - return JD(a, 217); - }; - _2.xj = function z$d(a) { - return KC(xI, nie, 217, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/24", 1207); - bcb(1208, 1, nwe, A$d); - _2.wj = function B$d(a) { - return JD(a, 172); - }; - _2.xj = function C$d(a) { - return KC(yI, nie, 172, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/25", 1208); - bcb(1209, 1, nwe, D$d); - _2.wj = function E$d(a) { - return JD(a, 199); - }; - _2.xj = function F$d(a) { - return KC($J, nie, 199, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/26", 1209); - bcb(1210, 1, nwe, G$d); - _2.wj = function H$d(a) { - return false; - }; - _2.xj = function I$d(a) { - return KC(O4, Uhe, 2110, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/27", 1210); - bcb(1211, 1, nwe, J$d); - _2.wj = function K$d(a) { - return LD(a); - }; - _2.xj = function L$d(a) { - return KC(BI, nie, 333, a, 7, 1); - }; - mdb(qte, "EcorePackageImpl/28", 1211); - bcb(1212, 1, nwe, M$d); - _2.wj = function N$d(a) { - return JD(a, 58); - }; - _2.xj = function O$d(a) { - return KC(T4, eme, 58, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/29", 1212); - bcb(1186, 1, nwe, P$d); - _2.wj = function Q$d(a) { - return JD(a, 510); - }; - _2.xj = function R$d(a) { - return KC(a5, { 3: 1, 4: 1, 5: 1, 1934: 1 }, 590, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/3", 1186); - bcb(1213, 1, nwe, S$d); - _2.wj = function T$d(a) { - return JD(a, 573); - }; - _2.xj = function U$d(a) { - return KC(U4, Uhe, 1940, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/30", 1213); - bcb(1214, 1, nwe, V$d); - _2.wj = function W$d(a) { - return JD(a, 153); - }; - _2.xj = function X$d(a) { - return KC(O9, eme, 153, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/31", 1214); - bcb(1215, 1, nwe, Y$d); - _2.wj = function Z$d(a) { - return JD(a, 72); - }; - _2.xj = function $$d(a) { - return KC(E9, owe, 72, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/32", 1215); - bcb(1216, 1, nwe, _$d); - _2.wj = function a_d(a) { - return JD(a, 155); - }; - _2.xj = function b_d(a) { - return KC(FI, nie, 155, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/33", 1216); - bcb(1217, 1, nwe, c_d); - _2.wj = function d_d(a) { - return JD(a, 19); - }; - _2.xj = function e_d(a) { - return KC(JI, nie, 19, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/34", 1217); - bcb(1218, 1, nwe, f_d); - _2.wj = function g_d(a) { - return JD(a, 290); - }; - _2.xj = function h_d(a) { - return KC(AI, Uhe, 290, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/35", 1218); - bcb(1219, 1, nwe, i_d); - _2.wj = function j_d(a) { - return JD(a, 162); - }; - _2.xj = function k_d(a) { - return KC(MI, nie, 162, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/36", 1219); - bcb(1220, 1, nwe, l_d); - _2.wj = function m_d(a) { - return JD(a, 83); - }; - _2.xj = function n_d(a) { - return KC(DK, Uhe, 83, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/37", 1220); - bcb(1221, 1, nwe, o_d); - _2.wj = function p_d(a) { - return JD(a, 591); - }; - _2.xj = function q_d(a) { - return KC(v8, Uhe, 591, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/38", 1221); - bcb(1222, 1, nwe, r_d); - _2.wj = function s_d(a) { - return false; - }; - _2.xj = function t_d(a) { - return KC(u8, Uhe, 2111, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/39", 1222); - bcb(1187, 1, nwe, u_d); - _2.wj = function v_d(a) { - return JD(a, 88); - }; - _2.xj = function w_d(a) { - return KC(c5, Uhe, 26, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/4", 1187); - bcb(1223, 1, nwe, x_d); - _2.wj = function y_d(a) { - return JD(a, 184); - }; - _2.xj = function z_d(a) { - return KC(UI, nie, 184, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/40", 1223); - bcb(1224, 1, nwe, A_d); - _2.wj = function B_d(a) { - return ND(a); - }; - _2.xj = function C_d(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(qte, "EcorePackageImpl/41", 1224); - bcb(1225, 1, nwe, D_d); - _2.wj = function E_d(a) { - return JD(a, 588); - }; - _2.xj = function F_d(a) { - return KC(X4, Uhe, 588, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/42", 1225); - bcb(1226, 1, nwe, G_d); - _2.wj = function H_d(a) { - return false; - }; - _2.xj = function I_d(a) { - return KC(V4, nie, 2112, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/43", 1226); - bcb(1227, 1, nwe, J_d); - _2.wj = function K_d(a) { - return JD(a, 42); - }; - _2.xj = function L_d(a) { - return KC(CK, zie, 42, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/44", 1227); - bcb(1188, 1, nwe, M_d); - _2.wj = function N_d(a) { - return JD(a, 138); - }; - _2.xj = function O_d(a) { - return KC(d5, Uhe, 138, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/5", 1188); - bcb(1189, 1, nwe, P_d); - _2.wj = function Q_d(a) { - return JD(a, 148); - }; - _2.xj = function R_d(a) { - return KC(f5, Uhe, 148, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/6", 1189); - bcb(1190, 1, nwe, S_d); - _2.wj = function T_d(a) { - return JD(a, 457); - }; - _2.xj = function U_d(a) { - return KC(h5, Uhe, 671, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/7", 1190); - bcb(1191, 1, nwe, V_d); - _2.wj = function W_d(a) { - return JD(a, 573); - }; - _2.xj = function X_d(a) { - return KC(g5, Uhe, 678, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/8", 1191); - bcb(1192, 1, nwe, Y_d); - _2.wj = function Z_d(a) { - return JD(a, 471); - }; - _2.xj = function $_d(a) { - return KC(i5, Uhe, 471, a, 0, 1); - }; - mdb(qte, "EcorePackageImpl/9", 1192); - bcb(1025, 1982, ive, c0d); - _2.bi = function d0d(a, b) { - __d(this, BD(b, 415)); - }; - _2.fi = function e0d(a, b) { - a0d(this, a, BD(b, 415)); - }; - mdb(qte, "MinimalEObjectImpl/1ArrayDelegatingAdapterList", 1025); - bcb(1026, 143, fve, f0d); - _2.Ai = function g0d() { - return this.a.a; - }; - mdb(qte, "MinimalEObjectImpl/1ArrayDelegatingAdapterList/1", 1026); - bcb(1053, 1052, {}, i0d); - mdb("org.eclipse.emf.ecore.plugin", "EcorePlugin", 1053); - var v8 = odb(pwe, "Resource"); - bcb(781, 1378, qwe); - _2.Yk = function m0d(a) { - }; - _2.Zk = function n0d(a) { - }; - _2.Vk = function o0d() { - return !this.a && (this.a = new z0d(this)), this.a; - }; - _2.Wk = function p0d(a) { - var b, c2, d, e, f2; - d = a.length; - if (d > 0) { - BCb(0, a.length); - if (a.charCodeAt(0) == 47) { - f2 = new Skb(4); - e = 1; - for (b = 1; b < d; ++b) { - BCb(b, a.length); - if (a.charCodeAt(b) == 47) { - Ekb(f2, e == b ? "" : a.substr(e, b - e)); - e = b + 1; - } - } - Ekb(f2, a.substr(e)); - return j0d(this, f2); - } else { - BCb(d - 1, a.length); - if (a.charCodeAt(d - 1) == 63) { - c2 = lfb(a, wfb(63), d - 2); - c2 > 0 && (a = a.substr(0, c2)); - } - } - } - return k0d(this, a); - }; - _2.Xk = function q0d() { - return this.c; - }; - _2.Ib = function r0d() { - var a; - return hdb(this.gm) + "@" + (a = tb(this) >>> 0, a.toString(16)) + " uri='" + this.d + "'"; - }; - _2.b = false; - mdb(rwe, "ResourceImpl", 781); - bcb(1379, 781, qwe, s0d); - mdb(rwe, "BinaryResourceImpl", 1379); - bcb(1169, 694, pue); - _2.si = function v0d(a) { - return JD(a, 56) ? t0d(this, BD(a, 56)) : JD(a, 591) ? new Fyd(BD(a, 591).Vk()) : PD(a) === PD(this.f) ? BD(a, 14).Kc() : (LCd(), KCd.a); - }; - _2.Ob = function w0d() { - return u0d(this); - }; - _2.a = false; - mdb(yve, "EcoreUtil/ContentTreeIterator", 1169); - bcb(1380, 1169, pue, x0d); - _2.si = function y0d(a) { - return PD(a) === PD(this.f) ? BD(a, 15).Kc() : new C6d(BD(a, 56)); - }; - mdb(rwe, "ResourceImpl/5", 1380); - bcb(648, 1994, Ove, z0d); - _2.Hc = function A0d(a) { - return this.i <= 4 ? pud(this, a) : JD(a, 49) && BD(a, 49).Zg() == this.a; - }; - _2.bi = function B0d(a, b) { - a == this.i - 1 && (this.a.b || (this.a.b = true, null)); - }; - _2.di = function C0d(a, b) { - a == 0 ? this.a.b || (this.a.b = true, null) : Atd(this, a, b); - }; - _2.fi = function D0d(a, b) { - }; - _2.gi = function E0d(a, b, c2) { - }; - _2.aj = function F0d() { - return 2; - }; - _2.Ai = function G0d() { - return this.a; - }; - _2.bj = function H0d() { - return true; - }; - _2.cj = function I0d(a, b) { - var c2; - c2 = BD(a, 49); - b = c2.wh(this.a, b); - return b; - }; - _2.dj = function J0d(a, b) { - var c2; - c2 = BD(a, 49); - return c2.wh(null, b); - }; - _2.ej = function K0d() { - return false; - }; - _2.hi = function L0d() { - return true; - }; - _2.ri = function M0d(a) { - return KC(m5, Uhe, 56, a, 0, 1); - }; - _2.ni = function N0d() { - return false; - }; - mdb(rwe, "ResourceImpl/ContentsEList", 648); - bcb(957, 1964, Lie, O0d); - _2.Zc = function P0d(a) { - return this.a._h(a); - }; - _2.gc = function Q0d() { - return this.a.gc(); - }; - mdb(yve, "AbstractSequentialInternalEList/1", 957); - var K6d, L6d, M6d, N6d; - bcb(624, 1, {}, y1d); - var R0d, S0d; - mdb(yve, "BasicExtendedMetaData", 624); - bcb(1160, 1, {}, C1d); - _2.$k = function D1d() { - return null; - }; - _2._k = function E1d() { - this.a == -2 && A1d(this, W0d(this.d, this.b)); - return this.a; - }; - _2.al = function F1d() { - return null; - }; - _2.bl = function G1d() { - return mmb(), mmb(), jmb; - }; - _2.ne = function H1d() { - this.c == Gwe && B1d(this, _0d(this.d, this.b)); - return this.c; - }; - _2.cl = function I1d() { - return 0; - }; - _2.a = -2; - _2.c = Gwe; - mdb(yve, "BasicExtendedMetaData/EClassExtendedMetaDataImpl", 1160); - bcb(1161, 1, {}, O1d); - _2.$k = function P1d() { - this.a == (T0d(), R0d) && J1d(this, V0d(this.f, this.b)); - return this.a; - }; - _2._k = function Q1d() { - return 0; - }; - _2.al = function R1d() { - this.c == (T0d(), R0d) && K1d(this, Z0d(this.f, this.b)); - return this.c; - }; - _2.bl = function S1d() { - !this.d && L1d(this, $0d(this.f, this.b)); - return this.d; - }; - _2.ne = function T1d() { - this.e == Gwe && M1d(this, _0d(this.f, this.b)); - return this.e; - }; - _2.cl = function U1d() { - this.g == -2 && N1d(this, c1d(this.f, this.b)); - return this.g; - }; - _2.e = Gwe; - _2.g = -2; - mdb(yve, "BasicExtendedMetaData/EDataTypeExtendedMetaDataImpl", 1161); - bcb(1159, 1, {}, Y1d); - _2.b = false; - _2.c = false; - mdb(yve, "BasicExtendedMetaData/EPackageExtendedMetaDataImpl", 1159); - bcb(1162, 1, {}, j2d); - _2.c = -2; - _2.e = Gwe; - _2.f = Gwe; - mdb(yve, "BasicExtendedMetaData/EStructuralFeatureExtendedMetaDataImpl", 1162); - bcb(585, 622, Pve, k2d); - _2.aj = function l2d() { - return this.c; - }; - _2.Fk = function m2d() { - return false; - }; - _2.li = function n2d(a, b) { - return b; - }; - _2.c = 0; - mdb(yve, "EDataTypeEList", 585); - var O9 = odb(yve, "FeatureMap"); - bcb(75, 585, { 3: 1, 4: 1, 20: 1, 28: 1, 52: 1, 14: 1, 15: 1, 54: 1, 67: 1, 63: 1, 58: 1, 76: 1, 153: 1, 215: 1, 1937: 1, 69: 1, 95: 1 }, u3d); - _2.Vc = function v3d(a, b) { - o2d(this, a, BD(b, 72)); - }; - _2.Fc = function w3d(a) { - return r2d(this, BD(a, 72)); - }; - _2.Yh = function B3d(a) { - w2d(this, BD(a, 72)); - }; - _2.cj = function M3d(a, b) { - return O2d(this, BD(a, 72), b); - }; - _2.dj = function N3d(a, b) { - return Q2d(this, BD(a, 72), b); - }; - _2.ii = function P3d(a, b) { - return W2d(this, a, b); - }; - _2.li = function R3d(a, b) { - return _2d(this, a, BD(b, 72)); - }; - _2._c = function T3d(a, b) { - return c3d(this, a, BD(b, 72)); - }; - _2.jj = function X3d(a, b) { - return i3d(this, BD(a, 72), b); - }; - _2.kj = function Y3d(a, b) { - return k3d(this, BD(a, 72), b); - }; - _2.lj = function Z3d(a, b, c2) { - return l3d(this, BD(a, 72), BD(b, 72), c2); - }; - _2.oi = function _3d(a, b) { - return t3d(this, a, BD(b, 72)); - }; - _2.dl = function x3d(a, b) { - return q2d(this, a, b); - }; - _2.Wc = function y3d(a, b) { - var c2, d, e, f2, g, h, i3, j, k; - j = new zud(b.gc()); - for (e = b.Kc(); e.Ob(); ) { - d = BD(e.Pb(), 72); - f2 = d.ak(); - if (T6d(this.e, f2)) { - (!f2.hi() || !E2d(this, f2, d.dd()) && !pud(j, d)) && wtd(j, d); - } else { - k = S6d(this.e.Tg(), f2); - c2 = BD(this.g, 119); - g = true; - for (h = 0; h < this.i; ++h) { - i3 = c2[h]; - if (k.rl(i3.ak())) { - BD(Gtd(this, h, d), 72); - g = false; - break; - } - } - g && wtd(j, d); - } - } - return xtd(this, a, j); - }; - _2.Gc = function z3d(a) { - var b, c2, d, e, f2, g, h, i3, j; - i3 = new zud(a.gc()); - for (d = a.Kc(); d.Ob(); ) { - c2 = BD(d.Pb(), 72); - e = c2.ak(); - if (T6d(this.e, e)) { - (!e.hi() || !E2d(this, e, c2.dd()) && !pud(i3, c2)) && wtd(i3, c2); - } else { - j = S6d(this.e.Tg(), e); - b = BD(this.g, 119); - f2 = true; - for (g = 0; g < this.i; ++g) { - h = b[g]; - if (j.rl(h.ak())) { - BD(Gtd(this, g, c2), 72); - f2 = false; - break; - } - } - f2 && wtd(i3, c2); - } - } - return ytd(this, i3); - }; - _2.Wh = function A3d(a) { - this.j = -1; - return Pxd(this, this.i, a); - }; - _2.el = function C3d(a, b, c2) { - return x2d(this, a, b, c2); - }; - _2.mk = function D3d(a, b) { - return B2d(this, a, b); - }; - _2.fl = function E3d(a, b, c2) { - return C2d(this, a, b, c2); - }; - _2.gl = function F3d() { - return this; - }; - _2.hl = function G3d(a, b) { - return K2d(this, a, b); - }; - _2.il = function H3d(a) { - return BD(qud(this, a), 72).ak(); - }; - _2.jl = function I3d(a) { - return BD(qud(this, a), 72).dd(); - }; - _2.kl = function J3d() { - return this.b; - }; - _2.bj = function K3d() { - return true; - }; - _2.ij = function L3d() { - return true; - }; - _2.ll = function O3d(a) { - return !R2d(this, a); - }; - _2.ri = function Q3d(a) { - return KC(D9, owe, 332, a, 0, 1); - }; - _2.Gk = function S3d(a) { - return a3d(this, a); - }; - _2.Wb = function U3d(a) { - d3d(this, a); - }; - _2.ml = function V3d(a, b) { - f3d(this, a, b); - }; - _2.nl = function W3d(a) { - return g3d(this, a); - }; - _2.ol = function $3d(a) { - s3d(this, a); - }; - mdb(yve, "BasicFeatureMap", 75); - bcb(1851, 1, jie); - _2.Nb = function f4d(a) { - Rrb(this, a); - }; - _2.Rb = function e4d(b) { - if (this.g == -1) { - throw vbb(new Ydb()); - } - a4d(this); - try { - p2d(this.e, this.b, this.a, b); - this.d = this.e.j; - d4d(this); - } catch (a) { - a = ubb(a); - if (JD(a, 73)) { - throw vbb(new Apb()); - } else - throw vbb(a); - } - }; - _2.Ob = function g4d() { - return b4d(this); - }; - _2.Sb = function h4d() { - return c4d(this); - }; - _2.Pb = function i4d() { - return d4d(this); - }; - _2.Tb = function j4d() { - return this.a; - }; - _2.Ub = function k4d() { - var a; - if (c4d(this)) { - a4d(this); - this.g = --this.a; - if (this.Lk()) { - a = b3d(this.e, this.b, this.c, this.a, this.j); - this.j = a; - } - this.i = 0; - return this.j; - } else { - throw vbb(new utb()); - } - }; - _2.Vb = function l4d() { - return this.a - 1; - }; - _2.Qb = function m4d() { - if (this.g == -1) { - throw vbb(new Ydb()); - } - a4d(this); - try { - Z2d(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 = ubb(a); - if (JD(a, 73)) { - throw vbb(new Apb()); - } else - throw vbb(a); - } - }; - _2.Lk = function n4d() { - return false; - }; - _2.Wb = function o4d(b) { - if (this.g == -1) { - throw vbb(new Ydb()); - } - a4d(this); - try { - e3d(this.e, this.b, this.g, b); - this.d = this.e.j; - } catch (a) { - a = ubb(a); - if (JD(a, 73)) { - throw vbb(new Apb()); - } else - throw vbb(a); - } - }; - _2.a = 0; - _2.c = 0; - _2.d = 0; - _2.f = false; - _2.g = 0; - _2.i = 0; - mdb(yve, "FeatureMapUtil/BasicFeatureEIterator", 1851); - bcb(410, 1851, jie, p4d); - _2.pl = function q4d() { - var a, b, c2; - c2 = this.e.i; - a = BD(this.e.g, 119); - while (this.c < c2) { - b = a[this.c]; - if (this.k.rl(b.ak())) { - this.j = this.f ? b : b.dd(); - this.i = 2; - return true; - } - ++this.c; - } - this.i = 1; - this.g = -1; - return false; - }; - _2.ql = function r4d() { - var a, b; - a = BD(this.e.g, 119); - while (--this.c >= 0) { - b = a[this.c]; - if (this.k.rl(b.ak())) { - this.j = this.f ? b : b.dd(); - this.i = -2; - return true; - } - } - this.i = -1; - this.g = -1; - return false; - }; - mdb(yve, "BasicFeatureMap/FeatureEIterator", 410); - bcb(662, 410, jie, s4d); - _2.Lk = function t4d() { - return true; - }; - mdb(yve, "BasicFeatureMap/ResolvingFeatureEIterator", 662); - bcb(955, 486, Vve, u4d); - _2.Gi = function v4d() { - return this; - }; - mdb(yve, "EContentsEList/1", 955); - bcb(956, 486, Vve, w4d); - _2.Lk = function x4d() { - return false; - }; - mdb(yve, "EContentsEList/2", 956); - bcb(954, 279, Wve, y4d); - _2.Nk = function z4d(a) { - }; - _2.Ob = function A4d() { - return false; - }; - _2.Sb = function B4d() { - return false; - }; - mdb(yve, "EContentsEList/FeatureIteratorImpl/1", 954); - bcb(825, 585, Pve, C4d); - _2.ci = function D4d() { - this.a = true; - }; - _2.fj = function E4d() { - return this.a; - }; - _2.Xj = function F4d() { - var a; - Uxd(this); - if (oid(this.e)) { - a = this.a; - this.a = false; - Uhd(this.e, new qSd(this.e, 2, this.c, a, false)); - } else { - this.a = false; - } - }; - _2.a = false; - mdb(yve, "EDataTypeEList/Unsettable", 825); - bcb(1849, 585, Pve, G4d); - _2.hi = function H4d() { - return true; - }; - mdb(yve, "EDataTypeUniqueEList", 1849); - bcb(1850, 825, Pve, I4d); - _2.hi = function J4d() { - return true; - }; - mdb(yve, "EDataTypeUniqueEList/Unsettable", 1850); - bcb(139, 85, Pve, K4d); - _2.Ek = function L4d() { - return true; - }; - _2.li = function M4d(a, b) { - return ILd(this, a, BD(b, 56)); - }; - mdb(yve, "EObjectContainmentEList/Resolving", 139); - bcb(1163, 545, Pve, N4d); - _2.Ek = function O4d() { - return true; - }; - _2.li = function P4d(a, b) { - return ILd(this, a, BD(b, 56)); - }; - mdb(yve, "EObjectContainmentEList/Unsettable/Resolving", 1163); - bcb(748, 16, Pve, Q4d); - _2.ci = function R4d() { - this.a = true; - }; - _2.fj = function S4d() { - return this.a; - }; - _2.Xj = function T4d() { - var a; - Uxd(this); - if (oid(this.e)) { - a = this.a; - this.a = false; - Uhd(this.e, new qSd(this.e, 2, this.c, a, false)); - } else { - this.a = false; - } - }; - _2.a = false; - mdb(yve, "EObjectContainmentWithInverseEList/Unsettable", 748); - bcb(1173, 748, Pve, U4d); - _2.Ek = function V4d() { - return true; - }; - _2.li = function W4d(a, b) { - return ILd(this, a, BD(b, 56)); - }; - mdb(yve, "EObjectContainmentWithInverseEList/Unsettable/Resolving", 1173); - bcb(743, 496, Pve, X4d); - _2.ci = function Y4d() { - this.a = true; - }; - _2.fj = function Z4d() { - return this.a; - }; - _2.Xj = function $4d() { - var a; - Uxd(this); - if (oid(this.e)) { - a = this.a; - this.a = false; - Uhd(this.e, new qSd(this.e, 2, this.c, a, false)); - } else { - this.a = false; - } - }; - _2.a = false; - mdb(yve, "EObjectEList/Unsettable", 743); - bcb(328, 496, Pve, _4d); - _2.Ek = function a5d() { - return true; - }; - _2.li = function b5d(a, b) { - return ILd(this, a, BD(b, 56)); - }; - mdb(yve, "EObjectResolvingEList", 328); - bcb(1641, 743, Pve, c5d); - _2.Ek = function d5d() { - return true; - }; - _2.li = function e5d(a, b) { - return ILd(this, a, BD(b, 56)); - }; - mdb(yve, "EObjectResolvingEList/Unsettable", 1641); - bcb(1381, 1, {}, h5d); - var f5d; - mdb(yve, "EObjectValidator", 1381); - bcb(546, 496, Pve, i5d); - _2.zk = function j5d() { - return this.d; - }; - _2.Ak = function k5d() { - return this.b; - }; - _2.bj = function l5d() { - return true; - }; - _2.Dk = function m5d() { - return true; - }; - _2.b = 0; - mdb(yve, "EObjectWithInverseEList", 546); - bcb(1176, 546, Pve, n5d); - _2.Ck = function o5d() { - return true; - }; - mdb(yve, "EObjectWithInverseEList/ManyInverse", 1176); - bcb(625, 546, Pve, p5d); - _2.ci = function q5d() { - this.a = true; - }; - _2.fj = function r5d() { - return this.a; - }; - _2.Xj = function s5d() { - var a; - Uxd(this); - if (oid(this.e)) { - a = this.a; - this.a = false; - Uhd(this.e, new qSd(this.e, 2, this.c, a, false)); - } else { - this.a = false; - } - }; - _2.a = false; - mdb(yve, "EObjectWithInverseEList/Unsettable", 625); - bcb(1175, 625, Pve, t5d); - _2.Ck = function u5d() { - return true; - }; - mdb(yve, "EObjectWithInverseEList/Unsettable/ManyInverse", 1175); - bcb(749, 546, Pve, v5d); - _2.Ek = function w5d() { - return true; - }; - _2.li = function x5d(a, b) { - return ILd(this, a, BD(b, 56)); - }; - mdb(yve, "EObjectWithInverseResolvingEList", 749); - bcb(31, 749, Pve, y5d); - _2.Ck = function z5d() { - return true; - }; - mdb(yve, "EObjectWithInverseResolvingEList/ManyInverse", 31); - bcb(750, 625, Pve, A5d); - _2.Ek = function B5d() { - return true; - }; - _2.li = function C5d(a, b) { - return ILd(this, a, BD(b, 56)); - }; - mdb(yve, "EObjectWithInverseResolvingEList/Unsettable", 750); - bcb(1174, 750, Pve, D5d); - _2.Ck = function E5d() { - return true; - }; - mdb(yve, "EObjectWithInverseResolvingEList/Unsettable/ManyInverse", 1174); - bcb(1164, 622, Pve); - _2.ai = function F5d() { - return (this.b & 1792) == 0; - }; - _2.ci = function G5d() { - this.b |= 1; - }; - _2.Bk = function H5d() { - return (this.b & 4) != 0; - }; - _2.bj = function I5d() { - return (this.b & 40) != 0; - }; - _2.Ck = function J5d() { - return (this.b & 16) != 0; - }; - _2.Dk = function K5d() { - return (this.b & 8) != 0; - }; - _2.Ek = function L5d() { - return (this.b & Dve) != 0; - }; - _2.rk = function M5d() { - return (this.b & 32) != 0; - }; - _2.Fk = function N5d() { - return (this.b & zte) != 0; - }; - _2.wj = function O5d(a) { - return !this.d ? this.ak().Yj().wj(a) : qEd(this.d, a); - }; - _2.fj = function P5d() { - return (this.b & 2) != 0 ? (this.b & 1) != 0 : this.i != 0; - }; - _2.hi = function Q5d() { - return (this.b & 128) != 0; - }; - _2.Xj = function S5d() { - var a; - Uxd(this); - if ((this.b & 2) != 0) { - if (oid(this.e)) { - a = (this.b & 1) != 0; - this.b &= -2; - GLd(this, new qSd(this.e, 2, bLd(this.e.Tg(), this.ak()), a, false)); - } else { - this.b &= -2; - } - } - }; - _2.ni = function T5d() { - return (this.b & 1536) == 0; - }; - _2.b = 0; - mdb(yve, "EcoreEList/Generic", 1164); - bcb(1165, 1164, Pve, U5d); - _2.ak = function V5d() { - return this.a; - }; - mdb(yve, "EcoreEList/Dynamic", 1165); - bcb(747, 63, oue, W5d); - _2.ri = function X5d(a) { - return izd(this.a.a, a); - }; - mdb(yve, "EcoreEMap/1", 747); - bcb(746, 85, Pve, Y5d); - _2.bi = function Z5d(a, b) { - uAd(this.b, BD(b, 133)); - }; - _2.di = function $5d(a, b) { - tAd(this.b); - }; - _2.ei = function _5d(a, b, c2) { - var d; - ++(d = this.b, BD(b, 133), d).e; - }; - _2.fi = function a6d(a, b) { - vAd(this.b, BD(b, 133)); - }; - _2.gi = function b6d(a, b, c2) { - vAd(this.b, BD(c2, 133)); - PD(c2) === PD(b) && BD(c2, 133).Th(CAd(BD(b, 133).cd())); - uAd(this.b, BD(b, 133)); - }; - mdb(yve, "EcoreEMap/DelegateEObjectContainmentEList", 746); - bcb(1171, 151, Ave, c6d); - mdb(yve, "EcoreEMap/Unsettable", 1171); - bcb(1172, 746, Pve, d6d); - _2.ci = function e6d() { - this.a = true; - }; - _2.fj = function f6d() { - return this.a; - }; - _2.Xj = function g6d() { - var a; - Uxd(this); - if (oid(this.e)) { - a = this.a; - this.a = false; - Uhd(this.e, new qSd(this.e, 2, this.c, a, false)); - } else { - this.a = false; - } - }; - _2.a = false; - mdb(yve, "EcoreEMap/Unsettable/UnsettableDelegateEObjectContainmentEList", 1172); - bcb(1168, 228, fke, A6d); - _2.a = false; - _2.b = false; - mdb(yve, "EcoreUtil/Copier", 1168); - bcb(745, 1, aie, C6d); - _2.Nb = function D6d(a) { - Rrb(this, a); - }; - _2.Ob = function E6d() { - return B6d(this); - }; - _2.Pb = function F6d() { - var a; - B6d(this); - a = this.b; - this.b = null; - return a; - }; - _2.Qb = function G6d() { - this.a.Qb(); - }; - mdb(yve, "EcoreUtil/ProperContentIterator", 745); - bcb(1382, 1381, {}, J6d); - var H6d; - mdb(yve, "EcoreValidator", 1382); - var P6d; - odb(yve, "FeatureMapUtil/Validator"); - bcb(1260, 1, { 1942: 1 }, U6d); - _2.rl = function V6d(a) { - return true; - }; - mdb(yve, "FeatureMapUtil/1", 1260); - bcb(757, 1, { 1942: 1 }, Z6d); - _2.rl = function $6d(a) { - var b; - if (this.c == a) - return true; - b = DD(Ohb(this.a, a)); - if (b == null) { - if (Y6d(this, a)) { - _6d(this.a, a, (Bcb(), Acb)); - return true; - } else { - _6d(this.a, a, (Bcb(), zcb)); - return false; - } - } else { - return b == (Bcb(), Acb); - } - }; - _2.e = false; - var W6d; - mdb(yve, "FeatureMapUtil/BasicValidator", 757); - bcb(758, 43, fke, a7d); - mdb(yve, "FeatureMapUtil/BasicValidator/Cache", 758); - bcb(501, 52, { 20: 1, 28: 1, 52: 1, 14: 1, 15: 1, 58: 1, 76: 1, 69: 1, 95: 1 }, f7d); - _2.Vc = function g7d(a, b) { - p2d(this.c, this.b, a, b); - }; - _2.Fc = function h7d(a) { - return q2d(this.c, this.b, a); - }; - _2.Wc = function i7d(a, b) { - return s2d(this.c, this.b, a, b); - }; - _2.Gc = function j7d(a) { - return b7d(this, a); - }; - _2.Xh = function k7d(a, b) { - u2d(this.c, this.b, a, b); - }; - _2.lk = function l7d(a, b) { - return x2d(this.c, this.b, a, b); - }; - _2.pi = function m7d(a) { - return J2d(this.c, this.b, a, false); - }; - _2.Zh = function n7d() { - return y2d(this.c, this.b); - }; - _2.$h = function o7d() { - return z2d(this.c, this.b); - }; - _2._h = function p7d(a) { - return A2d(this.c, this.b, a); - }; - _2.mk = function q7d(a, b) { - return c7d(this, a, b); - }; - _2.$b = function r7d() { - d7d(this); - }; - _2.Hc = function s7d(a) { - return E2d(this.c, this.b, a); - }; - _2.Ic = function t7d(a) { - return G2d(this.c, this.b, a); - }; - _2.Xb = function u7d(a) { - return J2d(this.c, this.b, a, true); - }; - _2.Wj = function v7d(a) { - return this; - }; - _2.Xc = function w7d(a) { - return L2d(this.c, this.b, a); - }; - _2.dc = function x7d() { - return e7d(this); - }; - _2.fj = function y7d() { - return !R2d(this.c, this.b); - }; - _2.Kc = function z7d() { - return S2d(this.c, this.b); - }; - _2.Yc = function A7d() { - return U2d(this.c, this.b); - }; - _2.Zc = function B7d(a) { - return V2d(this.c, this.b, a); - }; - _2.ii = function C7d(a, b) { - return X2d(this.c, this.b, a, b); - }; - _2.ji = function D7d(a, b) { - Y2d(this.c, this.b, a, b); - }; - _2.$c = function E7d(a) { - return Z2d(this.c, this.b, a); - }; - _2.Mc = function F7d(a) { - return $2d(this.c, this.b, a); - }; - _2._c = function G7d(a, b) { - return e3d(this.c, this.b, a, b); - }; - _2.Wb = function H7d(a) { - D2d(this.c, this.b); - b7d(this, BD(a, 15)); - }; - _2.gc = function I7d() { - return n3d(this.c, this.b); - }; - _2.Pc = function J7d() { - return o3d(this.c, this.b); - }; - _2.Qc = function K7d(a) { - return q3d(this.c, this.b, a); - }; - _2.Ib = function L7d() { - var a, b; - b = new Hfb(); - b.a += "["; - for (a = y2d(this.c, this.b); b4d(a); ) { - Efb(b, xfb(d4d(a))); - b4d(a) && (b.a += She, b); - } - b.a += "]"; - return b.a; - }; - _2.Xj = function M7d() { - D2d(this.c, this.b); - }; - mdb(yve, "FeatureMapUtil/FeatureEList", 501); - bcb(627, 36, fve, O7d); - _2.yi = function P7d(a) { - return N7d(this, a); - }; - _2.Di = function Q7d(a) { - var b, c2, d, e, f2, g, h; - switch (this.d) { - case 1: - case 2: { - f2 = a.Ai(); - if (PD(f2) === PD(this.c) && N7d(this, null) == a.yi(null)) { - this.g = a.zi(); - a.xi() == 1 && (this.d = 1); - return true; - } - break; - } - case 3: { - e = a.xi(); - switch (e) { - case 3: { - f2 = a.Ai(); - if (PD(f2) === PD(this.c) && N7d(this, null) == a.yi(null)) { - this.d = 5; - b = new zud(2); - wtd(b, this.g); - wtd(b, a.zi()); - this.g = b; - return true; - } - break; - } - } - break; - } - case 5: { - e = a.xi(); - switch (e) { - case 3: { - f2 = a.Ai(); - if (PD(f2) === PD(this.c) && N7d(this, null) == a.yi(null)) { - c2 = BD(this.g, 14); - c2.Fc(a.zi()); - return true; - } - break; - } - } - break; - } - case 4: { - e = a.xi(); - switch (e) { - case 3: { - f2 = a.Ai(); - if (PD(f2) === PD(this.c) && N7d(this, null) == a.yi(null)) { - this.d = 1; - this.g = a.zi(); - return true; - } - break; - } - case 4: { - f2 = a.Ai(); - if (PD(f2) === PD(this.c) && N7d(this, null) == a.yi(null)) { - this.d = 6; - h = new zud(2); - wtd(h, this.n); - wtd(h, a.Bi()); - this.n = h; - g = OC(GC(WD, 1), oje, 25, 15, [this.o, a.Ci()]); - this.g = g; - return true; - } - break; - } - } - break; - } - case 6: { - e = a.xi(); - switch (e) { - case 4: { - f2 = a.Ai(); - if (PD(f2) === PD(this.c) && N7d(this, null) == a.yi(null)) { - c2 = BD(this.n, 14); - c2.Fc(a.Bi()); - g = BD(this.g, 48); - d = KC(WD, oje, 25, g.length + 1, 15, 1); - $fb(g, 0, d, 0, g.length); - d[g.length] = a.Ci(); - this.g = d; - return true; - } - break; - } - } - break; - } - } - return false; - }; - mdb(yve, "FeatureMapUtil/FeatureENotificationImpl", 627); - bcb(552, 501, { 20: 1, 28: 1, 52: 1, 14: 1, 15: 1, 58: 1, 76: 1, 153: 1, 215: 1, 1937: 1, 69: 1, 95: 1 }, R7d); - _2.dl = function S7d(a, b) { - return q2d(this.c, a, b); - }; - _2.el = function T7d(a, b, c2) { - return x2d(this.c, a, b, c2); - }; - _2.fl = function U7d(a, b, c2) { - return C2d(this.c, a, b, c2); - }; - _2.gl = function V7d() { - return this; - }; - _2.hl = function W7d(a, b) { - return K2d(this.c, a, b); - }; - _2.il = function X7d(a) { - return BD(J2d(this.c, this.b, a, false), 72).ak(); - }; - _2.jl = function Y7d(a) { - return BD(J2d(this.c, this.b, a, false), 72).dd(); - }; - _2.kl = function Z7d() { - return this.a; - }; - _2.ll = function $7d(a) { - return !R2d(this.c, a); - }; - _2.ml = function _7d(a, b) { - f3d(this.c, a, b); - }; - _2.nl = function a8d(a) { - return g3d(this.c, a); - }; - _2.ol = function b8d(a) { - s3d(this.c, a); - }; - mdb(yve, "FeatureMapUtil/FeatureFeatureMap", 552); - bcb(1259, 1, zve, c8d); - _2.Wj = function d8d(a) { - return J2d(this.b, this.a, -1, a); - }; - _2.fj = function e8d() { - return !R2d(this.b, this.a); - }; - _2.Wb = function f8d(a) { - f3d(this.b, this.a, a); - }; - _2.Xj = function g8d() { - D2d(this.b, this.a); - }; - mdb(yve, "FeatureMapUtil/FeatureValue", 1259); - var h8d, i8d, j8d, k8d, l8d; - var Q9 = odb(Iwe, "AnyType"); - bcb(666, 60, Tie, n8d); - mdb(Iwe, "InvalidDatatypeValueException", 666); - var S9 = odb(Iwe, Jwe); - var T9 = odb(Iwe, Kwe); - var U9 = odb(Iwe, Lwe); - var o8d; - var q8d; - var s8d, t8d, u8d, v8d, w8d, x8d, y8d, z8d, A8d, B8d, C8d, D8d, E8d, F8d, G8d, H8d, I8d, J8d, K8d, L8d, M8d, N8d, O8d, P8d; - bcb(830, 506, { 105: 1, 92: 1, 90: 1, 56: 1, 49: 1, 97: 1, 843: 1 }, R8d); - _2._g = function S8d(a, b, c2) { - switch (a) { - case 0: - if (c2) - return !this.c && (this.c = new u3d(this, 0)), this.c; - return !this.c && (this.c = new u3d(this, 0)), this.c.b; - case 1: - if (c2) - return !this.c && (this.c = new u3d(this, 0)), BD(T2d(this.c, (Q8d(), t8d)), 153); - return (!this.c && (this.c = new u3d(this, 0)), BD(BD(T2d(this.c, (Q8d(), t8d)), 153), 215)).kl(); - case 2: - if (c2) - return !this.b && (this.b = new u3d(this, 2)), this.b; - return !this.b && (this.b = new u3d(this, 2)), this.b.b; - } - return bid(this, a - aLd(this.zh()), XKd((this.j & 2) == 0 ? this.zh() : (!this.k && (this.k = new HGd()), this.k).ck(), a), b, c2); - }; - _2.jh = function T8d(a, b, c2) { - var d; - switch (b) { - case 0: - return !this.c && (this.c = new u3d(this, 0)), B2d(this.c, a, c2); - case 1: - return (!this.c && (this.c = new u3d(this, 0)), BD(BD(T2d(this.c, (Q8d(), t8d)), 153), 69)).mk(a, c2); - case 2: - return !this.b && (this.b = new u3d(this, 2)), B2d(this.b, a, c2); - } - return d = BD(XKd((this.j & 2) == 0 ? this.zh() : (!this.k && (this.k = new HGd()), this.k).ck(), b), 66), d.Nj().Rj(this, Aid(this), b - aLd(this.zh()), a, c2); - }; - _2.lh = function U8d(a) { - switch (a) { - case 0: - return !!this.c && this.c.i != 0; - case 1: - return !(!this.c && (this.c = new u3d(this, 0)), BD(T2d(this.c, (Q8d(), t8d)), 153)).dc(); - case 2: - return !!this.b && this.b.i != 0; - } - return cid(this, a - aLd(this.zh()), XKd((this.j & 2) == 0 ? this.zh() : (!this.k && (this.k = new HGd()), this.k).ck(), a)); - }; - _2.sh = function V8d(a, b) { - switch (a) { - case 0: - !this.c && (this.c = new u3d(this, 0)); - d3d(this.c, b); - return; - case 1: - (!this.c && (this.c = new u3d(this, 0)), BD(BD(T2d(this.c, (Q8d(), t8d)), 153), 215)).Wb(b); - return; - case 2: - !this.b && (this.b = new u3d(this, 2)); - d3d(this.b, b); - return; - } - did(this, a - aLd(this.zh()), XKd((this.j & 2) == 0 ? this.zh() : (!this.k && (this.k = new HGd()), this.k).ck(), a), b); - }; - _2.zh = function W8d() { - return Q8d(), s8d; - }; - _2.Bh = function X8d(a) { - switch (a) { - case 0: - !this.c && (this.c = new u3d(this, 0)); - Uxd(this.c); - return; - case 1: - (!this.c && (this.c = new u3d(this, 0)), BD(T2d(this.c, (Q8d(), t8d)), 153)).$b(); - return; - case 2: - !this.b && (this.b = new u3d(this, 2)); - Uxd(this.b); - return; - } - eid(this, a - aLd(this.zh()), XKd((this.j & 2) == 0 ? this.zh() : (!this.k && (this.k = new HGd()), this.k).ck(), a)); - }; - _2.Ib = function Y8d() { - var a; - if ((this.j & 4) != 0) - return Eid(this); - a = new Jfb(Eid(this)); - a.a += " (mixed: "; - Dfb(a, this.c); - a.a += ", anyAttribute: "; - Dfb(a, this.b); - a.a += ")"; - return a.a; - }; - mdb(Mwe, "AnyTypeImpl", 830); - bcb(667, 506, { 105: 1, 92: 1, 90: 1, 56: 1, 49: 1, 97: 1, 2021: 1, 667: 1 }, _8d); - _2._g = function a9d(a, b, c2) { - switch (a) { - case 0: - return this.a; - case 1: - return this.b; - } - return bid(this, a - aLd((Q8d(), F8d)), XKd((this.j & 2) == 0 ? F8d : (!this.k && (this.k = new HGd()), this.k).ck(), a), b, c2); - }; - _2.lh = function b9d(a) { - switch (a) { - case 0: - return this.a != null; - case 1: - return this.b != null; - } - return cid(this, a - aLd((Q8d(), F8d)), XKd((this.j & 2) == 0 ? F8d : (!this.k && (this.k = new HGd()), this.k).ck(), a)); - }; - _2.sh = function c9d(a, b) { - switch (a) { - case 0: - Z8d(this, GD(b)); - return; - case 1: - $8d(this, GD(b)); - return; - } - did(this, a - aLd((Q8d(), F8d)), XKd((this.j & 2) == 0 ? F8d : (!this.k && (this.k = new HGd()), this.k).ck(), a), b); - }; - _2.zh = function d9d() { - return Q8d(), F8d; - }; - _2.Bh = function e9d(a) { - switch (a) { - case 0: - this.a = null; - return; - case 1: - this.b = null; - return; - } - eid(this, a - aLd((Q8d(), F8d)), XKd((this.j & 2) == 0 ? F8d : (!this.k && (this.k = new HGd()), this.k).ck(), a)); - }; - _2.Ib = function f9d() { - var a; - if ((this.j & 4) != 0) - return Eid(this); - a = new Jfb(Eid(this)); - a.a += " (data: "; - Efb(a, this.a); - a.a += ", target: "; - Efb(a, this.b); - a.a += ")"; - return a.a; - }; - _2.a = null; - _2.b = null; - mdb(Mwe, "ProcessingInstructionImpl", 667); - bcb(668, 830, { 105: 1, 92: 1, 90: 1, 56: 1, 49: 1, 97: 1, 843: 1, 2022: 1, 668: 1 }, i9d); - _2._g = function j9d(a, b, c2) { - switch (a) { - case 0: - if (c2) - return !this.c && (this.c = new u3d(this, 0)), this.c; - return !this.c && (this.c = new u3d(this, 0)), this.c.b; - case 1: - if (c2) - return !this.c && (this.c = new u3d(this, 0)), BD(T2d(this.c, (Q8d(), t8d)), 153); - return (!this.c && (this.c = new u3d(this, 0)), BD(BD(T2d(this.c, (Q8d(), t8d)), 153), 215)).kl(); - case 2: - if (c2) - return !this.b && (this.b = new u3d(this, 2)), this.b; - return !this.b && (this.b = new u3d(this, 2)), this.b.b; - case 3: - return !this.c && (this.c = new u3d(this, 0)), GD(K2d(this.c, (Q8d(), I8d), true)); - case 4: - return j6d(this.a, (!this.c && (this.c = new u3d(this, 0)), GD(K2d(this.c, (Q8d(), I8d), true)))); - case 5: - return this.a; - } - return bid(this, a - aLd((Q8d(), H8d)), XKd((this.j & 2) == 0 ? H8d : (!this.k && (this.k = new HGd()), this.k).ck(), a), b, c2); - }; - _2.lh = function k9d(a) { - switch (a) { - case 0: - return !!this.c && this.c.i != 0; - case 1: - return !(!this.c && (this.c = new u3d(this, 0)), BD(T2d(this.c, (Q8d(), t8d)), 153)).dc(); - case 2: - return !!this.b && this.b.i != 0; - case 3: - return !this.c && (this.c = new u3d(this, 0)), GD(K2d(this.c, (Q8d(), I8d), true)) != null; - case 4: - return j6d(this.a, (!this.c && (this.c = new u3d(this, 0)), GD(K2d(this.c, (Q8d(), I8d), true)))) != null; - case 5: - return !!this.a; - } - return cid(this, a - aLd((Q8d(), H8d)), XKd((this.j & 2) == 0 ? H8d : (!this.k && (this.k = new HGd()), this.k).ck(), a)); - }; - _2.sh = function l9d(a, b) { - switch (a) { - case 0: - !this.c && (this.c = new u3d(this, 0)); - d3d(this.c, b); - return; - case 1: - (!this.c && (this.c = new u3d(this, 0)), BD(BD(T2d(this.c, (Q8d(), t8d)), 153), 215)).Wb(b); - return; - case 2: - !this.b && (this.b = new u3d(this, 2)); - d3d(this.b, b); - return; - case 3: - h9d(this, GD(b)); - return; - case 4: - h9d(this, h6d(this.a, b)); - return; - case 5: - g9d(this, BD(b, 148)); - return; - } - did(this, a - aLd((Q8d(), H8d)), XKd((this.j & 2) == 0 ? H8d : (!this.k && (this.k = new HGd()), this.k).ck(), a), b); - }; - _2.zh = function m9d() { - return Q8d(), H8d; - }; - _2.Bh = function n9d(a) { - switch (a) { - case 0: - !this.c && (this.c = new u3d(this, 0)); - Uxd(this.c); - return; - case 1: - (!this.c && (this.c = new u3d(this, 0)), BD(T2d(this.c, (Q8d(), t8d)), 153)).$b(); - return; - case 2: - !this.b && (this.b = new u3d(this, 2)); - Uxd(this.b); - return; - case 3: - !this.c && (this.c = new u3d(this, 0)); - f3d(this.c, (Q8d(), I8d), null); - return; - case 4: - h9d(this, h6d(this.a, null)); - return; - case 5: - this.a = null; - return; - } - eid(this, a - aLd((Q8d(), H8d)), XKd((this.j & 2) == 0 ? H8d : (!this.k && (this.k = new HGd()), this.k).ck(), a)); - }; - mdb(Mwe, "SimpleAnyTypeImpl", 668); - bcb(669, 506, { 105: 1, 92: 1, 90: 1, 56: 1, 49: 1, 97: 1, 2023: 1, 669: 1 }, o9d); - _2._g = function p9d(a, b, c2) { - switch (a) { - case 0: - if (c2) - return !this.a && (this.a = new u3d(this, 0)), this.a; - return !this.a && (this.a = new u3d(this, 0)), this.a.b; - case 1: - return c2 ? (!this.b && (this.b = new dId((jGd(), fGd), x6, this, 1)), this.b) : (!this.b && (this.b = new dId((jGd(), fGd), x6, this, 1)), FAd(this.b)); - case 2: - return c2 ? (!this.c && (this.c = new dId((jGd(), fGd), x6, this, 2)), this.c) : (!this.c && (this.c = new dId((jGd(), fGd), x6, this, 2)), FAd(this.c)); - case 3: - return !this.a && (this.a = new u3d(this, 0)), T2d(this.a, (Q8d(), L8d)); - case 4: - return !this.a && (this.a = new u3d(this, 0)), T2d(this.a, (Q8d(), M8d)); - case 5: - return !this.a && (this.a = new u3d(this, 0)), T2d(this.a, (Q8d(), O8d)); - case 6: - return !this.a && (this.a = new u3d(this, 0)), T2d(this.a, (Q8d(), P8d)); - } - return bid(this, a - aLd((Q8d(), K8d)), XKd((this.j & 2) == 0 ? K8d : (!this.k && (this.k = new HGd()), this.k).ck(), a), b, c2); - }; - _2.jh = function q9d(a, b, c2) { - var d; - switch (b) { - case 0: - return !this.a && (this.a = new u3d(this, 0)), B2d(this.a, a, c2); - case 1: - return !this.b && (this.b = new dId((jGd(), fGd), x6, this, 1)), bId(this.b, a, c2); - case 2: - return !this.c && (this.c = new dId((jGd(), fGd), x6, this, 2)), bId(this.c, a, c2); - case 5: - return !this.a && (this.a = new u3d(this, 0)), c7d(T2d(this.a, (Q8d(), O8d)), a, c2); - } - return d = BD(XKd((this.j & 2) == 0 ? (Q8d(), K8d) : (!this.k && (this.k = new HGd()), this.k).ck(), b), 66), d.Nj().Rj(this, Aid(this), b - aLd((Q8d(), K8d)), a, c2); - }; - _2.lh = function r9d(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 u3d(this, 0)), !e7d(T2d(this.a, (Q8d(), L8d))); - case 4: - return !this.a && (this.a = new u3d(this, 0)), !e7d(T2d(this.a, (Q8d(), M8d))); - case 5: - return !this.a && (this.a = new u3d(this, 0)), !e7d(T2d(this.a, (Q8d(), O8d))); - case 6: - return !this.a && (this.a = new u3d(this, 0)), !e7d(T2d(this.a, (Q8d(), P8d))); - } - return cid(this, a - aLd((Q8d(), K8d)), XKd((this.j & 2) == 0 ? K8d : (!this.k && (this.k = new HGd()), this.k).ck(), a)); - }; - _2.sh = function s9d(a, b) { - switch (a) { - case 0: - !this.a && (this.a = new u3d(this, 0)); - d3d(this.a, b); - return; - case 1: - !this.b && (this.b = new dId((jGd(), fGd), x6, this, 1)); - cId(this.b, b); - return; - case 2: - !this.c && (this.c = new dId((jGd(), fGd), x6, this, 2)); - cId(this.c, b); - return; - case 3: - !this.a && (this.a = new u3d(this, 0)); - d7d(T2d(this.a, (Q8d(), L8d))); - !this.a && (this.a = new u3d(this, 0)); - b7d(T2d(this.a, L8d), BD(b, 14)); - return; - case 4: - !this.a && (this.a = new u3d(this, 0)); - d7d(T2d(this.a, (Q8d(), M8d))); - !this.a && (this.a = new u3d(this, 0)); - b7d(T2d(this.a, M8d), BD(b, 14)); - return; - case 5: - !this.a && (this.a = new u3d(this, 0)); - d7d(T2d(this.a, (Q8d(), O8d))); - !this.a && (this.a = new u3d(this, 0)); - b7d(T2d(this.a, O8d), BD(b, 14)); - return; - case 6: - !this.a && (this.a = new u3d(this, 0)); - d7d(T2d(this.a, (Q8d(), P8d))); - !this.a && (this.a = new u3d(this, 0)); - b7d(T2d(this.a, P8d), BD(b, 14)); - return; - } - did(this, a - aLd((Q8d(), K8d)), XKd((this.j & 2) == 0 ? K8d : (!this.k && (this.k = new HGd()), this.k).ck(), a), b); - }; - _2.zh = function t9d() { - return Q8d(), K8d; - }; - _2.Bh = function u9d(a) { - switch (a) { - case 0: - !this.a && (this.a = new u3d(this, 0)); - Uxd(this.a); - return; - case 1: - !this.b && (this.b = new dId((jGd(), fGd), x6, this, 1)); - this.b.c.$b(); - return; - case 2: - !this.c && (this.c = new dId((jGd(), fGd), x6, this, 2)); - this.c.c.$b(); - return; - case 3: - !this.a && (this.a = new u3d(this, 0)); - d7d(T2d(this.a, (Q8d(), L8d))); - return; - case 4: - !this.a && (this.a = new u3d(this, 0)); - d7d(T2d(this.a, (Q8d(), M8d))); - return; - case 5: - !this.a && (this.a = new u3d(this, 0)); - d7d(T2d(this.a, (Q8d(), O8d))); - return; - case 6: - !this.a && (this.a = new u3d(this, 0)); - d7d(T2d(this.a, (Q8d(), P8d))); - return; - } - eid(this, a - aLd((Q8d(), K8d)), XKd((this.j & 2) == 0 ? K8d : (!this.k && (this.k = new HGd()), this.k).ck(), a)); - }; - _2.Ib = function v9d() { - var a; - if ((this.j & 4) != 0) - return Eid(this); - a = new Jfb(Eid(this)); - a.a += " (mixed: "; - Dfb(a, this.a); - a.a += ")"; - return a.a; - }; - mdb(Mwe, "XMLTypeDocumentRootImpl", 669); - bcb(1919, 704, { 105: 1, 92: 1, 90: 1, 471: 1, 147: 1, 56: 1, 108: 1, 49: 1, 97: 1, 150: 1, 114: 1, 115: 1, 2024: 1 }, U9d); - _2.Ih = function V9d(a, b) { - switch (a.yj()) { - 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 : fcb(b); - case 19: - case 28: - case 29: - case 35: - case 38: - case 39: - case 41: - case 46: - case 52: - case 54: - case 5: - return GD(b); - case 6: - return C9d(BD(b, 190)); - case 12: - case 47: - case 49: - case 11: - return Vmd(this, a, b); - case 13: - return b == null ? null : qgb(BD(b, 240)); - case 15: - case 14: - return b == null ? null : D9d(Edb(ED(b))); - case 17: - return E9d((Q8d(), b)); - case 18: - return E9d(b); - case 21: - case 20: - return b == null ? null : F9d(BD(b, 155).a); - case 27: - return G9d(BD(b, 190)); - case 30: - return H9d((Q8d(), BD(b, 15))); - case 31: - return H9d(BD(b, 15)); - case 40: - return K9d((Q8d(), b)); - case 42: - return I9d((Q8d(), b)); - case 43: - return I9d(b); - case 59: - case 48: - return J9d((Q8d(), b)); - default: - throw vbb(new Wdb(tte + a.ne() + ute)); - } - }; - _2.Jh = function W9d(a) { - var b, c2, d, e, f2; - switch (a.G == -1 && (a.G = (c2 = bKd(a), c2 ? HLd(c2.Mh(), a) : -1)), a.G) { - case 0: - return b = new R8d(), b; - case 1: - return d = new _8d(), d; - case 2: - return e = new i9d(), e; - case 3: - return f2 = new o9d(), f2; - default: - throw vbb(new Wdb(xte + a.zb + ute)); - } - }; - _2.Kh = function X9d(a, b) { - var c2, d, e, f2, g, h, i3, j, k, l, m, n, o2, p, q, r; - switch (a.yj()) { - case 5: - case 52: - case 4: - return b; - case 6: - return L9d(b); - case 8: - case 7: - return b == null ? null : B9d(b); - case 9: - return b == null ? null : Scb(Icb((d = Qge(b, true), d.length > 0 && (BCb(0, d.length), d.charCodeAt(0) == 43) ? d.substr(1) : d), -128, 127) << 24 >> 24); - case 10: - return b == null ? null : Scb(Icb((e = Qge(b, true), e.length > 0 && (BCb(0, e.length), e.charCodeAt(0) == 43) ? e.substr(1) : e), -128, 127) << 24 >> 24); - case 11: - return GD(Wmd(this, (Q8d(), w8d), b)); - case 12: - return GD(Wmd(this, (Q8d(), x8d), b)); - case 13: - return b == null ? null : new tgb(Qge(b, true)); - case 15: - case 14: - return M9d(b); - case 16: - return GD(Wmd(this, (Q8d(), y8d), b)); - case 17: - return N9d((Q8d(), b)); - case 18: - return N9d(b); - case 28: - case 29: - case 35: - case 38: - case 39: - case 41: - case 54: - case 19: - return Qge(b, true); - case 21: - case 20: - return O9d(b); - case 22: - return GD(Wmd(this, (Q8d(), z8d), b)); - case 23: - return GD(Wmd(this, (Q8d(), A8d), b)); - case 24: - return GD(Wmd(this, (Q8d(), B8d), b)); - case 25: - return GD(Wmd(this, (Q8d(), C8d), b)); - case 26: - return GD(Wmd(this, (Q8d(), D8d), b)); - case 27: - return P9d(b); - case 30: - return Q9d((Q8d(), b)); - case 31: - return Q9d(b); - case 32: - return b == null ? null : meb(Icb((k = Qge(b, true), k.length > 0 && (BCb(0, k.length), k.charCodeAt(0) == 43) ? k.substr(1) : k), Rie, Ohe)); - case 33: - return b == null ? null : new Ygb((l = Qge(b, true), l.length > 0 && (BCb(0, l.length), l.charCodeAt(0) == 43) ? l.substr(1) : l)); - case 34: - return b == null ? null : meb(Icb((m = Qge(b, true), m.length > 0 && (BCb(0, m.length), m.charCodeAt(0) == 43) ? m.substr(1) : m), Rie, Ohe)); - case 36: - return b == null ? null : Aeb(Jcb((n = Qge(b, true), n.length > 0 && (BCb(0, n.length), n.charCodeAt(0) == 43) ? n.substr(1) : n))); - case 37: - return b == null ? null : Aeb(Jcb((o2 = Qge(b, true), o2.length > 0 && (BCb(0, o2.length), o2.charCodeAt(0) == 43) ? o2.substr(1) : o2))); - case 40: - return T9d((Q8d(), b)); - case 42: - return R9d((Q8d(), b)); - case 43: - return R9d(b); - case 44: - return b == null ? null : new Ygb((p = Qge(b, true), p.length > 0 && (BCb(0, p.length), p.charCodeAt(0) == 43) ? p.substr(1) : p)); - case 45: - return b == null ? null : new Ygb((q = Qge(b, true), q.length > 0 && (BCb(0, q.length), q.charCodeAt(0) == 43) ? q.substr(1) : q)); - case 46: - return Qge(b, false); - case 47: - return GD(Wmd(this, (Q8d(), E8d), b)); - case 59: - case 48: - return S9d((Q8d(), b)); - case 49: - return GD(Wmd(this, (Q8d(), G8d), b)); - case 50: - return b == null ? null : Web(Icb((r = Qge(b, true), r.length > 0 && (BCb(0, r.length), r.charCodeAt(0) == 43) ? r.substr(1) : r), awe, 32767) << 16 >> 16); - case 51: - return b == null ? null : Web(Icb((f2 = Qge(b, true), f2.length > 0 && (BCb(0, f2.length), f2.charCodeAt(0) == 43) ? f2.substr(1) : f2), awe, 32767) << 16 >> 16); - case 53: - return GD(Wmd(this, (Q8d(), J8d), b)); - case 55: - return b == null ? null : Web(Icb((g = Qge(b, true), g.length > 0 && (BCb(0, g.length), g.charCodeAt(0) == 43) ? g.substr(1) : g), awe, 32767) << 16 >> 16); - case 56: - return b == null ? null : Web(Icb((h = Qge(b, true), h.length > 0 && (BCb(0, h.length), h.charCodeAt(0) == 43) ? h.substr(1) : h), awe, 32767) << 16 >> 16); - case 57: - return b == null ? null : Aeb(Jcb((i3 = Qge(b, true), i3.length > 0 && (BCb(0, i3.length), i3.charCodeAt(0) == 43) ? i3.substr(1) : i3))); - case 58: - return b == null ? null : Aeb(Jcb((j = Qge(b, true), j.length > 0 && (BCb(0, j.length), j.charCodeAt(0) == 43) ? j.substr(1) : j))); - case 60: - return b == null ? null : meb(Icb((c2 = Qge(b, true), c2.length > 0 && (BCb(0, c2.length), c2.charCodeAt(0) == 43) ? c2.substr(1) : c2), Rie, Ohe)); - case 61: - return b == null ? null : meb(Icb(Qge(b, true), Rie, Ohe)); - default: - throw vbb(new Wdb(tte + a.ne() + ute)); - } - }; - var w9d, x9d, y9d, z9d; - mdb(Mwe, "XMLTypeFactoryImpl", 1919); - bcb(586, 179, { 105: 1, 92: 1, 90: 1, 147: 1, 191: 1, 56: 1, 235: 1, 108: 1, 49: 1, 97: 1, 150: 1, 179: 1, 114: 1, 115: 1, 675: 1, 1945: 1, 586: 1 }, cae); - _2.N = false; - _2.O = false; - var Z9d = false; - mdb(Mwe, "XMLTypePackageImpl", 586); - bcb(1852, 1, { 837: 1 }, fae); - _2._j = function gae() { - return Uge(), Tge; - }; - mdb(Mwe, "XMLTypePackageImpl/1", 1852); - bcb(1861, 1, nwe, hae); - _2.wj = function iae(a) { - return ND(a); - }; - _2.xj = function jae(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/10", 1861); - bcb(1862, 1, nwe, kae); - _2.wj = function lae(a) { - return ND(a); - }; - _2.xj = function mae(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/11", 1862); - bcb(1863, 1, nwe, nae); - _2.wj = function oae(a) { - return ND(a); - }; - _2.xj = function pae(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/12", 1863); - bcb(1864, 1, nwe, qae); - _2.wj = function rae(a) { - return LD(a); - }; - _2.xj = function sae(a) { - return KC(BI, nie, 333, a, 7, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/13", 1864); - bcb(1865, 1, nwe, tae); - _2.wj = function uae(a) { - return ND(a); - }; - _2.xj = function vae(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/14", 1865); - bcb(1866, 1, nwe, wae); - _2.wj = function xae(a) { - return JD(a, 15); - }; - _2.xj = function yae(a) { - return KC(yK, eme, 15, a, 0, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/15", 1866); - bcb(1867, 1, nwe, zae); - _2.wj = function Aae(a) { - return JD(a, 15); - }; - _2.xj = function Bae(a) { - return KC(yK, eme, 15, a, 0, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/16", 1867); - bcb(1868, 1, nwe, Cae); - _2.wj = function Dae(a) { - return ND(a); - }; - _2.xj = function Eae(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/17", 1868); - bcb(1869, 1, nwe, Fae); - _2.wj = function Gae(a) { - return JD(a, 155); - }; - _2.xj = function Hae(a) { - return KC(FI, nie, 155, a, 0, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/18", 1869); - bcb(1870, 1, nwe, Iae); - _2.wj = function Jae(a) { - return ND(a); - }; - _2.xj = function Kae(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/19", 1870); - bcb(1853, 1, nwe, Lae); - _2.wj = function Mae(a) { - return JD(a, 843); - }; - _2.xj = function Nae(a) { - return KC(Q9, Uhe, 843, a, 0, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/2", 1853); - bcb(1871, 1, nwe, Oae); - _2.wj = function Pae(a) { - return ND(a); - }; - _2.xj = function Qae(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/20", 1871); - bcb(1872, 1, nwe, Rae); - _2.wj = function Sae(a) { - return ND(a); - }; - _2.xj = function Tae(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/21", 1872); - bcb(1873, 1, nwe, Uae); - _2.wj = function Vae(a) { - return ND(a); - }; - _2.xj = function Wae(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/22", 1873); - bcb(1874, 1, nwe, Xae); - _2.wj = function Yae(a) { - return ND(a); - }; - _2.xj = function Zae(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/23", 1874); - bcb(1875, 1, nwe, $ae); - _2.wj = function _ae(a) { - return JD(a, 190); - }; - _2.xj = function abe(a) { - return KC(SD, nie, 190, a, 0, 2); - }; - mdb(Mwe, "XMLTypePackageImpl/24", 1875); - bcb(1876, 1, nwe, bbe); - _2.wj = function cbe(a) { - return ND(a); - }; - _2.xj = function dbe(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/25", 1876); - bcb(1877, 1, nwe, ebe); - _2.wj = function fbe(a) { - return ND(a); - }; - _2.xj = function gbe(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/26", 1877); - bcb(1878, 1, nwe, hbe); - _2.wj = function ibe(a) { - return JD(a, 15); - }; - _2.xj = function jbe(a) { - return KC(yK, eme, 15, a, 0, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/27", 1878); - bcb(1879, 1, nwe, kbe); - _2.wj = function lbe(a) { - return JD(a, 15); - }; - _2.xj = function mbe(a) { - return KC(yK, eme, 15, a, 0, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/28", 1879); - bcb(1880, 1, nwe, nbe); - _2.wj = function obe(a) { - return ND(a); - }; - _2.xj = function pbe(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/29", 1880); - bcb(1854, 1, nwe, qbe); - _2.wj = function rbe(a) { - return JD(a, 667); - }; - _2.xj = function sbe(a) { - return KC(S9, Uhe, 2021, a, 0, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/3", 1854); - bcb(1881, 1, nwe, tbe); - _2.wj = function ube(a) { - return JD(a, 19); - }; - _2.xj = function vbe(a) { - return KC(JI, nie, 19, a, 0, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/30", 1881); - bcb(1882, 1, nwe, wbe); - _2.wj = function xbe(a) { - return ND(a); - }; - _2.xj = function ybe(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/31", 1882); - bcb(1883, 1, nwe, zbe); - _2.wj = function Abe(a) { - return JD(a, 162); - }; - _2.xj = function Bbe(a) { - return KC(MI, nie, 162, a, 0, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/32", 1883); - bcb(1884, 1, nwe, Cbe); - _2.wj = function Dbe(a) { - return ND(a); - }; - _2.xj = function Ebe(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/33", 1884); - bcb(1885, 1, nwe, Fbe); - _2.wj = function Gbe(a) { - return ND(a); - }; - _2.xj = function Hbe(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/34", 1885); - bcb(1886, 1, nwe, Ibe); - _2.wj = function Jbe(a) { - return ND(a); - }; - _2.xj = function Kbe(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/35", 1886); - bcb(1887, 1, nwe, Lbe); - _2.wj = function Mbe(a) { - return ND(a); - }; - _2.xj = function Nbe(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/36", 1887); - bcb(1888, 1, nwe, Obe); - _2.wj = function Pbe(a) { - return JD(a, 15); - }; - _2.xj = function Qbe(a) { - return KC(yK, eme, 15, a, 0, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/37", 1888); - bcb(1889, 1, nwe, Rbe); - _2.wj = function Sbe(a) { - return JD(a, 15); - }; - _2.xj = function Tbe(a) { - return KC(yK, eme, 15, a, 0, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/38", 1889); - bcb(1890, 1, nwe, Ube); - _2.wj = function Vbe(a) { - return ND(a); - }; - _2.xj = function Wbe(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/39", 1890); - bcb(1855, 1, nwe, Xbe); - _2.wj = function Ybe(a) { - return JD(a, 668); - }; - _2.xj = function Zbe(a) { - return KC(T9, Uhe, 2022, a, 0, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/4", 1855); - bcb(1891, 1, nwe, $be); - _2.wj = function _be(a) { - return ND(a); - }; - _2.xj = function ace(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/40", 1891); - bcb(1892, 1, nwe, bce); - _2.wj = function cce(a) { - return ND(a); - }; - _2.xj = function dce(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/41", 1892); - bcb(1893, 1, nwe, ece); - _2.wj = function fce(a) { - return ND(a); - }; - _2.xj = function gce(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/42", 1893); - bcb(1894, 1, nwe, hce); - _2.wj = function ice(a) { - return ND(a); - }; - _2.xj = function jce(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/43", 1894); - bcb(1895, 1, nwe, kce); - _2.wj = function lce(a) { - return ND(a); - }; - _2.xj = function mce(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/44", 1895); - bcb(1896, 1, nwe, nce); - _2.wj = function oce(a) { - return JD(a, 184); - }; - _2.xj = function pce(a) { - return KC(UI, nie, 184, a, 0, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/45", 1896); - bcb(1897, 1, nwe, qce); - _2.wj = function rce(a) { - return ND(a); - }; - _2.xj = function sce(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/46", 1897); - bcb(1898, 1, nwe, tce); - _2.wj = function uce(a) { - return ND(a); - }; - _2.xj = function vce(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/47", 1898); - bcb(1899, 1, nwe, wce); - _2.wj = function xce(a) { - return ND(a); - }; - _2.xj = function yce(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/48", 1899); - bcb(nje, 1, nwe, zce); - _2.wj = function Ace(a) { - return JD(a, 184); - }; - _2.xj = function Bce(a) { - return KC(UI, nie, 184, a, 0, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/49", nje); - bcb(1856, 1, nwe, Cce); - _2.wj = function Dce(a) { - return JD(a, 669); - }; - _2.xj = function Ece(a) { - return KC(U9, Uhe, 2023, a, 0, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/5", 1856); - bcb(1901, 1, nwe, Fce); - _2.wj = function Gce(a) { - return JD(a, 162); - }; - _2.xj = function Hce(a) { - return KC(MI, nie, 162, a, 0, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/50", 1901); - bcb(1902, 1, nwe, Ice); - _2.wj = function Jce(a) { - return ND(a); - }; - _2.xj = function Kce(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/51", 1902); - bcb(1903, 1, nwe, Lce); - _2.wj = function Mce(a) { - return JD(a, 19); - }; - _2.xj = function Nce(a) { - return KC(JI, nie, 19, a, 0, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/52", 1903); - bcb(1857, 1, nwe, Oce); - _2.wj = function Pce(a) { - return ND(a); - }; - _2.xj = function Qce(a) { - return KC(ZI, nie, 2, a, 6, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/6", 1857); - bcb(1858, 1, nwe, Rce); - _2.wj = function Sce(a) { - return JD(a, 190); - }; - _2.xj = function Tce(a) { - return KC(SD, nie, 190, a, 0, 2); - }; - mdb(Mwe, "XMLTypePackageImpl/7", 1858); - bcb(1859, 1, nwe, Uce); - _2.wj = function Vce(a) { - return KD(a); - }; - _2.xj = function Wce(a) { - return KC(wI, nie, 476, a, 8, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/8", 1859); - bcb(1860, 1, nwe, Xce); - _2.wj = function Yce(a) { - return JD(a, 217); - }; - _2.xj = function Zce(a) { - return KC(xI, nie, 217, a, 0, 1); - }; - mdb(Mwe, "XMLTypePackageImpl/9", 1860); - var $ce, _ce; - var fde, gde; - var kde; - bcb(50, 60, Tie, mde); - mdb(kxe, "RegEx/ParseException", 50); - bcb(820, 1, {}, ude); - _2.sl = function vde(a) { - return a < this.j && bfb(this.i, a) == 63; - }; - _2.tl = function wde() { - var a, b, c2, d, e; - if (this.c != 10) - throw vbb(new mde(tvd((h0d(), uue)))); - 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: - nde(this); - if (this.c != 0) - throw vbb(new mde(tvd((h0d(), Tue)))); - if (this.a == 123) { - e = 0; - c2 = 0; - do { - nde(this); - if (this.c != 0) - throw vbb(new mde(tvd((h0d(), Tue)))); - if ((e = yde(this.a)) < 0) - break; - if (c2 > c2 * 16) - throw vbb(new mde(tvd((h0d(), Uue)))); - c2 = c2 * 16 + e; - } while (true); - if (this.a != 125) - throw vbb(new mde(tvd((h0d(), Vue)))); - if (c2 > lxe) - throw vbb(new mde(tvd((h0d(), Wue)))); - a = c2; - } else { - e = 0; - if (this.c != 0 || (e = yde(this.a)) < 0) - throw vbb(new mde(tvd((h0d(), Tue)))); - c2 = e; - nde(this); - if (this.c != 0 || (e = yde(this.a)) < 0) - throw vbb(new mde(tvd((h0d(), Tue)))); - c2 = c2 * 16 + e; - a = c2; - } - break; - case 117: - d = 0; - nde(this); - if (this.c != 0 || (d = yde(this.a)) < 0) - throw vbb(new mde(tvd((h0d(), Tue)))); - b = d; - nde(this); - if (this.c != 0 || (d = yde(this.a)) < 0) - throw vbb(new mde(tvd((h0d(), Tue)))); - b = b * 16 + d; - nde(this); - if (this.c != 0 || (d = yde(this.a)) < 0) - throw vbb(new mde(tvd((h0d(), Tue)))); - b = b * 16 + d; - nde(this); - if (this.c != 0 || (d = yde(this.a)) < 0) - throw vbb(new mde(tvd((h0d(), Tue)))); - b = b * 16 + d; - a = b; - break; - case 118: - nde(this); - if (this.c != 0 || (d = yde(this.a)) < 0) - throw vbb(new mde(tvd((h0d(), Tue)))); - b = d; - nde(this); - if (this.c != 0 || (d = yde(this.a)) < 0) - throw vbb(new mde(tvd((h0d(), Tue)))); - b = b * 16 + d; - nde(this); - if (this.c != 0 || (d = yde(this.a)) < 0) - throw vbb(new mde(tvd((h0d(), Tue)))); - b = b * 16 + d; - nde(this); - if (this.c != 0 || (d = yde(this.a)) < 0) - throw vbb(new mde(tvd((h0d(), Tue)))); - b = b * 16 + d; - nde(this); - if (this.c != 0 || (d = yde(this.a)) < 0) - throw vbb(new mde(tvd((h0d(), Tue)))); - b = b * 16 + d; - nde(this); - if (this.c != 0 || (d = yde(this.a)) < 0) - throw vbb(new mde(tvd((h0d(), Tue)))); - b = b * 16 + d; - if (b > lxe) - throw vbb(new mde(tvd((h0d(), "parser.descappe.4")))); - a = b; - break; - case 65: - case 90: - case 122: - throw vbb(new mde(tvd((h0d(), Xue)))); - } - return a; - }; - _2.ul = function xde(a) { - var b, c2; - switch (a) { - case 100: - c2 = (this.e & 32) == 32 ? Kfe("Nd", true) : (wfe(), cfe); - break; - case 68: - c2 = (this.e & 32) == 32 ? Kfe("Nd", false) : (wfe(), jfe); - break; - case 119: - c2 = (this.e & 32) == 32 ? Kfe("IsWord", true) : (wfe(), sfe); - break; - case 87: - c2 = (this.e & 32) == 32 ? Kfe("IsWord", false) : (wfe(), lfe); - break; - case 115: - c2 = (this.e & 32) == 32 ? Kfe("IsSpace", true) : (wfe(), nfe); - break; - case 83: - c2 = (this.e & 32) == 32 ? Kfe("IsSpace", false) : (wfe(), kfe); - break; - default: - throw vbb(new hz((b = a, mxe + b.toString(16)))); - } - return c2; - }; - _2.vl = function zde(a) { - var b, c2, d, e, f2, g, h, i3, j, k, l, m; - this.b = 1; - nde(this); - b = null; - if (this.c == 0 && this.a == 94) { - nde(this); - if (a) { - k = (wfe(), wfe(), new $fe(5)); - } else { - b = (wfe(), wfe(), new $fe(4)); - Ufe(b, 0, lxe); - k = new $fe(4); - } - } else { - k = (wfe(), wfe(), new $fe(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: - Xfe(k, this.ul(c2)); - d = true; - break; - case 105: - case 73: - case 99: - case 67: - c2 = this.Ll(k, c2); - c2 < 0 && (d = true); - break; - case 112: - case 80: - l = tde(this, c2); - if (!l) - throw vbb(new mde(tvd((h0d(), Iue)))); - Xfe(k, l); - d = true; - break; - default: - c2 = this.tl(); - } - } else if (m == 20) { - g = gfb(this.i, 58, this.d); - if (g < 0) - throw vbb(new mde(tvd((h0d(), Jue)))); - h = true; - if (bfb(this.i, this.d) == 94) { - ++this.d; - h = false; - } - f2 = qfb(this.i, this.d, g); - i3 = Lfe(f2, h, (this.e & 512) == 512); - if (!i3) - throw vbb(new mde(tvd((h0d(), Lue)))); - Xfe(k, i3); - d = true; - if (g + 1 >= this.j || bfb(this.i, g + 1) != 93) - throw vbb(new mde(tvd((h0d(), Jue)))); - this.d = g + 2; - } - nde(this); - if (!d) { - if (this.c != 0 || this.a != 45) { - Ufe(k, c2, c2); - } else { - nde(this); - if ((m = this.c) == 1) - throw vbb(new mde(tvd((h0d(), Kue)))); - if (m == 0 && this.a == 93) { - Ufe(k, c2, c2); - Ufe(k, 45, 45); - } else { - j = this.a; - m == 10 && (j = this.tl()); - nde(this); - Ufe(k, c2, j); - } - } - } - (this.e & zte) == zte && this.c == 0 && this.a == 44 && nde(this); - } - if (this.c == 1) - throw vbb(new mde(tvd((h0d(), Kue)))); - if (b) { - Zfe(b, k); - k = b; - } - Yfe(k); - Vfe(k); - this.b = 0; - nde(this); - return k; - }; - _2.wl = function Ade() { - var a, b, c2, d; - c2 = this.vl(false); - while ((d = this.c) != 7) { - a = this.a; - if (d == 0 && (a == 45 || a == 38) || d == 4) { - nde(this); - if (this.c != 9) - throw vbb(new mde(tvd((h0d(), Que)))); - b = this.vl(false); - if (d == 4) - Xfe(c2, b); - else if (a == 45) - Zfe(c2, b); - else if (a == 38) - Wfe(c2, b); - else - throw vbb(new hz("ASSERT")); - } else { - throw vbb(new mde(tvd((h0d(), Rue)))); - } - } - nde(this); - return c2; - }; - _2.xl = function Bde() { - var a, b; - a = this.a - 48; - b = (wfe(), wfe(), new Hge(12, null, a)); - !this.g && (this.g = new Wvb()); - Tvb(this.g, new cge(a)); - nde(this); - return b; - }; - _2.yl = function Cde() { - nde(this); - return wfe(), ofe; - }; - _2.zl = function Dde() { - nde(this); - return wfe(), mfe; - }; - _2.Al = function Ede() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.Bl = function Fde() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.Cl = function Gde() { - nde(this); - return Ife(); - }; - _2.Dl = function Hde() { - nde(this); - return wfe(), qfe; - }; - _2.El = function Ide() { - nde(this); - return wfe(), tfe; - }; - _2.Fl = function Jde() { - var a; - if (this.d >= this.j || ((a = bfb(this.i, this.d++)) & 65504) != 64) - throw vbb(new mde(tvd((h0d(), Eue)))); - nde(this); - return wfe(), wfe(), new ige(0, a - 64); - }; - _2.Gl = function Kde() { - nde(this); - return Jfe(); - }; - _2.Hl = function Lde() { - nde(this); - return wfe(), ufe; - }; - _2.Il = function Mde() { - var a; - a = (wfe(), wfe(), new ige(0, 105)); - nde(this); - return a; - }; - _2.Jl = function Nde() { - nde(this); - return wfe(), rfe; - }; - _2.Kl = function Ode() { - nde(this); - return wfe(), pfe; - }; - _2.Ll = function Pde(a, b) { - return this.tl(); - }; - _2.Ml = function Qde() { - nde(this); - return wfe(), hfe; - }; - _2.Nl = function Rde() { - var a, b, c2, d, e; - if (this.d + 1 >= this.j) - throw vbb(new mde(tvd((h0d(), Bue)))); - d = -1; - b = null; - a = bfb(this.i, this.d); - if (49 <= a && a <= 57) { - d = a - 48; - !this.g && (this.g = new Wvb()); - Tvb(this.g, new cge(d)); - ++this.d; - if (bfb(this.i, this.d) != 41) - throw vbb(new mde(tvd((h0d(), yue)))); - ++this.d; - } else { - a == 63 && --this.d; - nde(this); - b = qde(this); - switch (b.e) { - case 20: - case 21: - case 22: - case 23: - break; - case 8: - if (this.c != 7) - throw vbb(new mde(tvd((h0d(), yue)))); - break; - default: - throw vbb(new mde(tvd((h0d(), Cue)))); - } - } - nde(this); - e = rde(this); - c2 = null; - if (e.e == 2) { - if (e.em() != 2) - throw vbb(new mde(tvd((h0d(), Due)))); - c2 = e.am(1); - e = e.am(0); - } - if (this.c != 7) - throw vbb(new mde(tvd((h0d(), yue)))); - nde(this); - return wfe(), wfe(), new vge(d, b, e, c2); - }; - _2.Ol = function Sde() { - nde(this); - return wfe(), ife; - }; - _2.Pl = function Tde() { - var a; - nde(this); - a = Cfe(24, rde(this)); - if (this.c != 7) - throw vbb(new mde(tvd((h0d(), yue)))); - nde(this); - return a; - }; - _2.Ql = function Ude() { - var a; - nde(this); - a = Cfe(20, rde(this)); - if (this.c != 7) - throw vbb(new mde(tvd((h0d(), yue)))); - nde(this); - return a; - }; - _2.Rl = function Vde() { - var a; - nde(this); - a = Cfe(22, rde(this)); - if (this.c != 7) - throw vbb(new mde(tvd((h0d(), yue)))); - nde(this); - return a; - }; - _2.Sl = function Wde() { - var a, b, c2, d, e; - a = 0; - c2 = 0; - b = -1; - while (this.d < this.j) { - b = bfb(this.i, this.d); - e = Uee(b); - if (e == 0) - break; - a |= e; - ++this.d; - } - if (this.d >= this.j) - throw vbb(new mde(tvd((h0d(), zue)))); - if (b == 45) { - ++this.d; - while (this.d < this.j) { - b = bfb(this.i, this.d); - e = Uee(b); - if (e == 0) - break; - c2 |= e; - ++this.d; - } - if (this.d >= this.j) - throw vbb(new mde(tvd((h0d(), zue)))); - } - if (b == 58) { - ++this.d; - nde(this); - d = Dfe(rde(this), a, c2); - if (this.c != 7) - throw vbb(new mde(tvd((h0d(), yue)))); - nde(this); - } else if (b == 41) { - ++this.d; - nde(this); - d = Dfe(rde(this), a, c2); - } else - throw vbb(new mde(tvd((h0d(), Aue)))); - return d; - }; - _2.Tl = function Xde() { - var a; - nde(this); - a = Cfe(21, rde(this)); - if (this.c != 7) - throw vbb(new mde(tvd((h0d(), yue)))); - nde(this); - return a; - }; - _2.Ul = function Yde() { - var a; - nde(this); - a = Cfe(23, rde(this)); - if (this.c != 7) - throw vbb(new mde(tvd((h0d(), yue)))); - nde(this); - return a; - }; - _2.Vl = function Zde() { - var a, b; - nde(this); - a = this.f++; - b = Efe(rde(this), a); - if (this.c != 7) - throw vbb(new mde(tvd((h0d(), yue)))); - nde(this); - return b; - }; - _2.Wl = function $de() { - var a; - nde(this); - a = Efe(rde(this), 0); - if (this.c != 7) - throw vbb(new mde(tvd((h0d(), yue)))); - nde(this); - return a; - }; - _2.Xl = function _de(a) { - nde(this); - if (this.c == 5) { - nde(this); - return Bfe(a, (wfe(), wfe(), new lge(9, a))); - } else - return Bfe(a, (wfe(), wfe(), new lge(3, a))); - }; - _2.Yl = function aee(a) { - var b; - nde(this); - b = (wfe(), wfe(), new Lge(2)); - if (this.c == 5) { - nde(this); - Kge(b, ffe); - Kge(b, a); - } else { - Kge(b, a); - Kge(b, ffe); - } - return b; - }; - _2.Zl = function bee(a) { - nde(this); - if (this.c == 5) { - nde(this); - return wfe(), wfe(), new lge(9, a); - } else - return wfe(), wfe(), new lge(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; - mdb(kxe, "RegEx/RegexParser", 820); - bcb(1824, 820, {}, hee); - _2.sl = function iee(a) { - return false; - }; - _2.tl = function jee() { - return eee(this); - }; - _2.ul = function lee(a) { - return fee(a); - }; - _2.vl = function mee(a) { - return gee(this); - }; - _2.wl = function nee() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.xl = function oee() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.yl = function pee() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.zl = function qee() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.Al = function ree() { - nde(this); - return fee(67); - }; - _2.Bl = function see() { - nde(this); - return fee(73); - }; - _2.Cl = function tee() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.Dl = function uee() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.El = function vee2() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.Fl = function wee() { - nde(this); - return fee(99); - }; - _2.Gl = function xee() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.Hl = function yee() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.Il = function zee() { - nde(this); - return fee(105); - }; - _2.Jl = function Aee() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.Kl = function Bee() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.Ll = function Cee(a, b) { - return Xfe(a, fee(b)), -1; - }; - _2.Ml = function Dee() { - nde(this); - return wfe(), wfe(), new ige(0, 94); - }; - _2.Nl = function Eee() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.Ol = function Fee() { - nde(this); - return wfe(), wfe(), new ige(0, 36); - }; - _2.Pl = function Gee() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.Ql = function Hee() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.Rl = function Iee() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.Sl = function Jee() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.Tl = function Kee() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.Ul = function Lee() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.Vl = function Mee() { - var a; - nde(this); - a = Efe(rde(this), 0); - if (this.c != 7) - throw vbb(new mde(tvd((h0d(), yue)))); - nde(this); - return a; - }; - _2.Wl = function Nee() { - throw vbb(new mde(tvd((h0d(), Yue)))); - }; - _2.Xl = function Oee(a) { - nde(this); - return Bfe(a, (wfe(), wfe(), new lge(3, a))); - }; - _2.Yl = function Pee(a) { - var b; - nde(this); - b = (wfe(), wfe(), new Lge(2)); - Kge(b, a); - Kge(b, ffe); - return b; - }; - _2.Zl = function Qee(a) { - nde(this); - return wfe(), wfe(), new lge(3, a); - }; - var cee = null, dee = null; - mdb(kxe, "RegEx/ParserForXMLSchema", 1824); - bcb(117, 1, yxe, xfe); - _2.$l = function yfe(a) { - throw vbb(new hz("Not supported.")); - }; - _2._l = function Gfe() { - return -1; - }; - _2.am = function Hfe(a) { - return null; - }; - _2.bm = function Mfe() { - return null; - }; - _2.cm = function Pfe(a) { - }; - _2.dm = function Qfe(a) { - }; - _2.em = function Rfe() { - return 0; - }; - _2.Ib = function Sfe() { - return this.fm(0); - }; - _2.fm = function Tfe(a) { - return this.e == 11 ? "." : ""; - }; - _2.e = 0; - var Yee, Zee, $ee, _ee, afe, bfe = null, cfe, dfe = null, efe, ffe, gfe = null, hfe, ife, jfe, kfe, lfe, mfe, nfe, ofe, pfe, qfe, rfe, sfe, tfe, ufe; - var lbb = mdb(kxe, "RegEx/Token", 117); - bcb(136, 117, { 3: 1, 136: 1, 117: 1 }, $fe); - _2.fm = function bge(a) { - var b, c2, d; - if (this.e == 4) { - if (this == efe) - c2 = "."; - else if (this == cfe) - c2 = "\\d"; - else if (this == sfe) - c2 = "\\w"; - else if (this == nfe) - c2 = "\\s"; - else { - d = new Hfb(); - d.a += "["; - for (b = 0; b < this.b.length; b += 2) { - (a & zte) != 0 && b > 0 && (d.a += ",", d); - if (this.b[b] === this.b[b + 1]) { - Efb(d, age(this.b[b])); - } else { - Efb(d, age(this.b[b])); - d.a += "-"; - Efb(d, age(this.b[b + 1])); - } - } - d.a += "]"; - c2 = d.a; - } - } else { - if (this == jfe) - c2 = "\\D"; - else if (this == lfe) - c2 = "\\W"; - else if (this == kfe) - c2 = "\\S"; - else { - d = new Hfb(); - d.a += "[^"; - for (b = 0; b < this.b.length; b += 2) { - (a & zte) != 0 && b > 0 && (d.a += ",", d); - if (this.b[b] === this.b[b + 1]) { - Efb(d, age(this.b[b])); - } else { - Efb(d, age(this.b[b])); - d.a += "-"; - Efb(d, age(this.b[b + 1])); - } - } - d.a += "]"; - c2 = d.a; - } - } - return c2; - }; - _2.a = false; - _2.c = false; - mdb(kxe, "RegEx/RangeToken", 136); - bcb(584, 1, { 584: 1 }, cge); - _2.a = 0; - mdb(kxe, "RegEx/RegexParser/ReferencePosition", 584); - bcb(583, 1, { 3: 1, 583: 1 }, ege); - _2.Fb = function fge(a) { - var b; - if (a == null) - return false; - if (!JD(a, 583)) - return false; - b = BD(a, 583); - return dfb(this.b, b.b) && this.a == b.a; - }; - _2.Hb = function gge() { - return LCb(this.b + "/" + See(this.a)); - }; - _2.Ib = function hge() { - return this.c.fm(this.a); - }; - _2.a = 0; - mdb(kxe, "RegEx/RegularExpression", 583); - bcb(223, 117, yxe, ige); - _2._l = function jge() { - return this.a; - }; - _2.fm = function kge(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 = "\\" + HD(this.a & aje); - 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 >= Tje) { - c2 = (b = this.a >>> 0, "0" + b.toString(16)); - d = "\\v" + qfb(c2, c2.length - 6, c2.length); - } else - d = "" + HD(this.a & aje); - } - break; - case 8: - this == hfe || this == ife ? d = "" + HD(this.a & aje) : d = "\\" + HD(this.a & aje); - break; - default: - d = null; - } - return d; - }; - _2.a = 0; - mdb(kxe, "RegEx/Token/CharToken", 223); - bcb(309, 117, yxe, lge); - _2.am = function mge(a) { - return this.a; - }; - _2.cm = function nge(a) { - this.b = a; - }; - _2.dm = function oge(a) { - this.c = a; - }; - _2.em = function pge() { - return 1; - }; - _2.fm = function qge(a) { - var b; - if (this.e == 3) { - if (this.c < 0 && this.b < 0) { - b = this.a.fm(a) + "*"; - } else if (this.c == this.b) { - b = this.a.fm(a) + "{" + this.c + "}"; - } else if (this.c >= 0 && this.b >= 0) { - b = this.a.fm(a) + "{" + this.c + "," + this.b + "}"; - } else if (this.c >= 0 && this.b < 0) { - b = this.a.fm(a) + "{" + this.c + ",}"; - } else - throw vbb(new hz("Token#toString(): CLOSURE " + this.c + She + this.b)); - } else { - if (this.c < 0 && this.b < 0) { - b = this.a.fm(a) + "*?"; - } else if (this.c == this.b) { - b = this.a.fm(a) + "{" + this.c + "}?"; - } else if (this.c >= 0 && this.b >= 0) { - b = this.a.fm(a) + "{" + this.c + "," + this.b + "}?"; - } else if (this.c >= 0 && this.b < 0) { - b = this.a.fm(a) + "{" + this.c + ",}?"; - } else - throw vbb(new hz("Token#toString(): NONGREEDYCLOSURE " + this.c + She + this.b)); - } - return b; - }; - _2.b = 0; - _2.c = 0; - mdb(kxe, "RegEx/Token/ClosureToken", 309); - bcb(821, 117, yxe, rge); - _2.am = function sge(a) { - return a == 0 ? this.a : this.b; - }; - _2.em = function tge() { - return 2; - }; - _2.fm = function uge(a) { - var b; - this.b.e == 3 && this.b.am(0) == this.a ? b = this.a.fm(a) + "+" : this.b.e == 9 && this.b.am(0) == this.a ? b = this.a.fm(a) + "+?" : b = this.a.fm(a) + ("" + this.b.fm(a)); - return b; - }; - mdb(kxe, "RegEx/Token/ConcatToken", 821); - bcb(1822, 117, yxe, vge); - _2.am = function wge(a) { - if (a == 0) - return this.d; - if (a == 1) - return this.b; - throw vbb(new hz("Internal Error: " + a)); - }; - _2.em = function xge() { - return !this.b ? 1 : 2; - }; - _2.fm = function yge(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; - mdb(kxe, "RegEx/Token/ConditionToken", 1822); - bcb(1823, 117, yxe, zge); - _2.am = function Age(a) { - return this.b; - }; - _2.em = function Bge() { - return 1; - }; - _2.fm = function Cge(a) { - return "(?" + (this.a == 0 ? "" : See(this.a)) + (this.c == 0 ? "" : See(this.c)) + ":" + this.b.fm(a) + ")"; - }; - _2.a = 0; - _2.c = 0; - mdb(kxe, "RegEx/Token/ModifierToken", 1823); - bcb(822, 117, yxe, Dge); - _2.am = function Ege(a) { - return this.a; - }; - _2.em = function Fge() { - return 1; - }; - _2.fm = function Gge(a) { - var b; - b = null; - switch (this.e) { - case 6: - this.b == 0 ? b = "(?:" + this.a.fm(a) + ")" : b = "(" + this.a.fm(a) + ")"; - break; - case 20: - b = "(?=" + this.a.fm(a) + ")"; - break; - case 21: - b = "(?!" + this.a.fm(a) + ")"; - break; - case 22: - b = "(?<=" + this.a.fm(a) + ")"; - break; - case 23: - b = "(?" + this.a.fm(a) + ")"; - } - return b; - }; - _2.b = 0; - mdb(kxe, "RegEx/Token/ParenToken", 822); - bcb(521, 117, { 3: 1, 117: 1, 521: 1 }, Hge); - _2.bm = function Ige() { - return this.b; - }; - _2.fm = function Jge(a) { - return this.e == 12 ? "\\" + this.a : Wee(this.b); - }; - _2.a = 0; - mdb(kxe, "RegEx/Token/StringToken", 521); - bcb(465, 117, yxe, Lge); - _2.$l = function Mge(a) { - Kge(this, a); - }; - _2.am = function Nge(a) { - return BD(Uvb(this.a, a), 117); - }; - _2.em = function Oge() { - return !this.a ? 0 : this.a.a.c.length; - }; - _2.fm = function Pge(a) { - var b, c2, d, e, f2; - if (this.e == 1) { - if (this.a.a.c.length == 2) { - b = BD(Uvb(this.a, 0), 117); - c2 = BD(Uvb(this.a, 1), 117); - c2.e == 3 && c2.am(0) == b ? e = b.fm(a) + "+" : c2.e == 9 && c2.am(0) == b ? e = b.fm(a) + "+?" : e = b.fm(a) + ("" + c2.fm(a)); - } else { - f2 = new Hfb(); - for (d = 0; d < this.a.a.c.length; d++) { - Efb(f2, BD(Uvb(this.a, d), 117).fm(a)); - } - e = f2.a; - } - return e; - } - if (this.a.a.c.length == 2 && BD(Uvb(this.a, 1), 117).e == 7) { - e = BD(Uvb(this.a, 0), 117).fm(a) + "?"; - } else if (this.a.a.c.length == 2 && BD(Uvb(this.a, 0), 117).e == 7) { - e = BD(Uvb(this.a, 1), 117).fm(a) + "??"; - } else { - f2 = new Hfb(); - Efb(f2, BD(Uvb(this.a, 0), 117).fm(a)); - for (d = 1; d < this.a.a.c.length; d++) { - f2.a += "|"; - Efb(f2, BD(Uvb(this.a, d), 117).fm(a)); - } - e = f2.a; - } - return e; - }; - mdb(kxe, "RegEx/Token/UnionToken", 465); - bcb(518, 1, { 592: 1 }, Rge); - _2.Ib = function Sge() { - return this.a.b; - }; - mdb(zxe, "XMLTypeUtil/PatternMatcherImpl", 518); - bcb(1622, 1381, {}, Vge); - var Tge; - mdb(zxe, "XMLTypeValidator", 1622); - bcb(264, 1, vie, Yge); - _2.Jc = function Zge(a) { - reb(this, a); - }; - _2.Kc = function $ge() { - return (this.b - this.a) * this.c < 0 ? Wge : new she(this); - }; - _2.a = 0; - _2.b = 0; - _2.c = 0; - var Wge; - mdb(Bxe, "ExclusiveRange", 264); - bcb(1068, 1, jie, dhe); - _2.Rb = function ehe(a) { - BD(a, 19); - _ge(); - }; - _2.Nb = function fhe(a) { - Rrb(this, a); - }; - _2.Pb = function ihe() { - return ahe(); - }; - _2.Ub = function khe() { - return bhe(); - }; - _2.Wb = function nhe(a) { - BD(a, 19); - che(); - }; - _2.Ob = function ghe() { - return false; - }; - _2.Sb = function hhe() { - return false; - }; - _2.Tb = function jhe() { - return -1; - }; - _2.Vb = function lhe() { - return -1; - }; - _2.Qb = function mhe() { - throw vbb(new cgb(Exe)); - }; - mdb(Bxe, "ExclusiveRange/1", 1068); - bcb(254, 1, jie, she); - _2.Rb = function the(a) { - BD(a, 19); - ohe(); - }; - _2.Nb = function uhe(a) { - Rrb(this, a); - }; - _2.Pb = function xhe() { - return phe(this); - }; - _2.Ub = function zhe() { - return qhe(this); - }; - _2.Wb = function Che(a) { - BD(a, 19); - rhe(); - }; - _2.Ob = function vhe() { - return this.c.c < 0 ? this.a >= this.c.b : this.a <= this.c.b; - }; - _2.Sb = function whe() { - return this.b > 0; - }; - _2.Tb = function yhe() { - return this.b; - }; - _2.Vb = function Ahe() { - return this.b - 1; - }; - _2.Qb = function Bhe() { - throw vbb(new cgb(Exe)); - }; - _2.a = 0; - _2.b = 0; - mdb(Bxe, "ExclusiveRange/RangeIterator", 254); - var TD = pdb(Fve, "C"); - var WD = pdb(Ive, "I"); - var sbb = pdb(Khe, "Z"); - var XD = pdb(Jve, "J"); - var SD = pdb(Eve, "B"); - var UD = pdb(Gve, "D"); - var VD = pdb(Hve, "F"); - var rbb = pdb(Kve, "S"); - var h1 = odb("org.eclipse.elk.core.labels", "ILabelManager"); - var O4 = odb(Tte, "DiagnosticChain"); - var u8 = odb(pwe, "ResourceSet"); - var V4 = mdb(Tte, "InvocationTargetException", null); - var Ihe = (Az(), Dz); - var gwtOnLoad = gwtOnLoad = Zbb; - Xbb(hcb); - $bb("permProps", [[[Fxe, Gxe], [Hxe, "gecko1_8"]], [[Fxe, Gxe], [Hxe, "ie10"]], [[Fxe, Gxe], [Hxe, "ie8"]], [[Fxe, Gxe], [Hxe, "ie9"]], [[Fxe, Gxe], [Hxe, "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); - 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 radious = 0; - let _shape = ""; - let layoutOptions = {}; - switch (vertex.type) { - case "round": - radious = 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: radious, - ry: radious, - 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 - }; - 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$1().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; - log$1.info("abc88", graphDirection, edgeDirection, position2); - return portPos2[graphDirection][edgeDirection][position2]; - }; - const getNextPort = (node2, edgeDirection, graphDirection) => { - log$1.info("getNextPort abc88", { 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, dir) => { - 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", dir)}`; - } - if (endNode.type === "diamond") { - target = `${target}-${getNextPort(target, "in", dir)}`; - } - 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 dir = 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) { - var 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]); - var linkNameStart = "LS-" + edge.start; - var 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, dir); - 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) { - 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, "\\)"); - } - switch (edgeData.arrowTypeStart) { - case "arrow_cross": - svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-crossStart)"); - break; - case "arrow_point": - svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-pointStart)"); - break; - case "arrow_barb": - svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-barbStart)"); - break; - case "arrow_circle": - svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-circleStart)"); - break; - case "aggregation": - svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-aggregationStart)"); - break; - case "extension": - svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-extensionStart)"); - break; - case "composition": - svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-compositionStart)"); - break; - case "dependency": - svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-dependencyStart)"); - break; - case "lollipop": - svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-lollipopStart)"); - break; - } - switch (edgeData.arrowTypeEnd) { - case "arrow_cross": - svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-crossEnd)"); - break; - case "arrow_point": - svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-pointEnd)"); - break; - case "arrow_barb": - svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-barbEnd)"); - break; - case "arrow_circle": - svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-circleEnd)"); - break; - case "aggregation": - svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-aggregationEnd)"); - break; - case "extension": - svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-extensionEnd)"); - break; - case "composition": - svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-compositionEnd)"); - break; - case "dependency": - svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-dependencyEnd)"); - break; - case "lollipop": - svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-lollipopEnd)"); - break; - } - }; - const getClasses = function(text2, diagObj) { - log$1.info("Extracting classes"); - diagObj.db.clear("ver-2"); - try { - diagObj.parse(text2); - return diagObj.db.getClasses(); - } catch (e) { - return {}; - } - }; - 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) { - 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 curve = line$1().curve(curveLinear); - const edgePath = edgesEl.insert("path").attr("d", curve(points)).attr("class", "path").attr("fill", "none"); - const edgeG = edgesEl.insert("g").attr("class", "edgeLabel"); - const edgeWithLabel = select(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); - }; - 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$2 = async function(text2, id2, _version, diagObj) { - var _a; - diagObj.db.clear(); - nodeDb = {}; - portPos = {}; - diagObj.db.setGen("gen-2"); - diagObj.parser.parse(text2); - const renderEl = select("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 dir = diagObj.db.getDirection(); - switch (dir) { - 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$1(); - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("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, diagObj.arrowMarkerAbsolute); - 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); - (_a = g.edges) == null ? void 0 : _a.map((edge) => { - insertEdge(edgesEl, edge, edge.edgeData, diagObj, parentLookupDb); - }); - 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$1().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$1 = { - getClasses, - draw: draw$2 - }; - 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$2 = (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$1 = getStyles$2; - const diagram$2 = { - db: db$8, - renderer: renderer$1, - parser: parser$l, - styles: styles$1 - }; - const flowchartElkDefinition = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$2 - }, Symbol.toStringTag, { value: "Module" })); - var parser$1 = 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, 5], $V2 = [6, 9, 11, 17, 18, 20, 22, 23, 26, 27, 28], $V3 = [1, 15], $V4 = [1, 16], $V5 = [1, 17], $V6 = [1, 18], $V7 = [1, 19], $V8 = [1, 23], $V9 = [1, 24], $Va = [1, 27], $Vb = [4, 6, 9, 11, 17, 18, 20, 22, 23, 26, 27, 28]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "timeline": 4, "document": 5, "EOF": 6, "directive": 7, "line": 8, "SPACE": 9, "statement": 10, "NEWLINE": 11, "openDirective": 12, "typeDirective": 13, "closeDirective": 14, ":": 15, "argDirective": 16, "title": 17, "acc_title": 18, "acc_title_value": 19, "acc_descr": 20, "acc_descr_value": 21, "acc_descr_multiline_value": 22, "section": 23, "period_statement": 24, "event_statement": 25, "period": 26, "event": 27, "open_directive": 28, "type_directive": 29, "arg_directive": 30, "close_directive": 31, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 4: "timeline", 6: "EOF", 9: "SPACE", 11: "NEWLINE", 15: ":", 17: "title", 18: "acc_title", 19: "acc_title_value", 20: "acc_descr", 21: "acc_descr_value", 22: "acc_descr_multiline_value", 23: "section", 26: "period", 27: "event", 28: "open_directive", 29: "type_directive", 30: "arg_directive", 31: "close_directive" }, - productions_: [0, [3, 3], [3, 2], [5, 0], [5, 2], [8, 2], [8, 1], [8, 1], [8, 1], [7, 4], [7, 6], [10, 1], [10, 2], [10, 2], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [24, 1], [25, 1], [12, 1], [13, 1], [16, 1], [14, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 1: - return $$[$0 - 1]; - case 3: - this.$ = []; - break; - case 4: - $$[$0 - 1].push($$[$0]); - this.$ = $$[$0 - 1]; - break; - case 5: - case 6: - this.$ = $$[$0]; - break; - case 7: - case 8: - this.$ = []; - break; - case 11: - yy.getCommonDb().setDiagramTitle($$[$0].substr(6)); - this.$ = $$[$0].substr(6); - break; - case 12: - this.$ = $$[$0].trim(); - yy.getCommonDb().setAccTitle(this.$); - break; - case 13: - case 14: - this.$ = $$[$0].trim(); - yy.getCommonDb().setAccDescription(this.$); - break; - case 15: - yy.addSection($$[$0].substr(8)); - this.$ = $$[$0].substr(8); - break; - case 19: - yy.addTask($$[$0], 0, ""); - this.$ = $$[$0]; - break; - case 20: - yy.addEvent($$[$0].substr(2)); - this.$ = $$[$0]; - break; - case 21: - yy.parseDirective("%%{", "open_directive"); - break; - case 22: - yy.parseDirective($$[$0], "type_directive"); - break; - case 23: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); - yy.parseDirective($$[$0], "arg_directive"); - break; - case 24: - yy.parseDirective("}%%", "close_directive", "timeline"); - break; - } - }, - table: [{ 3: 1, 4: $V0, 7: 3, 12: 4, 28: $V1 }, { 1: [3] }, o($V2, [2, 3], { 5: 6 }), { 3: 7, 4: $V0, 7: 3, 12: 4, 28: $V1 }, { 13: 8, 29: [1, 9] }, { 29: [2, 21] }, { 6: [1, 10], 7: 22, 8: 11, 9: [1, 12], 10: 13, 11: [1, 14], 12: 4, 17: $V3, 18: $V4, 20: $V5, 22: $V6, 23: $V7, 24: 20, 25: 21, 26: $V8, 27: $V9, 28: $V1 }, { 1: [2, 2] }, { 14: 25, 15: [1, 26], 31: $Va }, o([15, 31], [2, 22]), o($V2, [2, 8], { 1: [2, 1] }), o($V2, [2, 4]), { 7: 22, 10: 28, 12: 4, 17: $V3, 18: $V4, 20: $V5, 22: $V6, 23: $V7, 24: 20, 25: 21, 26: $V8, 27: $V9, 28: $V1 }, o($V2, [2, 6]), o($V2, [2, 7]), o($V2, [2, 11]), { 19: [1, 29] }, { 21: [1, 30] }, o($V2, [2, 14]), o($V2, [2, 15]), o($V2, [2, 16]), o($V2, [2, 17]), o($V2, [2, 18]), o($V2, [2, 19]), o($V2, [2, 20]), { 11: [1, 31] }, { 16: 32, 30: [1, 33] }, { 11: [2, 24] }, o($V2, [2, 5]), o($V2, [2, 12]), o($V2, [2, 13]), o($Vb, [2, 9]), { 14: 34, 31: $Va }, { 31: [2, 23] }, { 11: [1, 35] }, o($Vb, [2, 10])], - defaultActions: { 5: [2, 21], 7: [2, 2], 27: [2, 24], 33: [2, 23] }, - parseError: function parseError2(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 parseError2(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 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; - }, - // unshifts one char (or a string) into the input - unput: 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 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, 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 && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = 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[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 - }); - } - }, - // 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 28; - case 1: - this.begin("type_directive"); - return 29; - case 2: - this.popState(); - this.begin("arg_directive"); - return 15; - case 3: - this.popState(); - this.popState(); - return 31; - case 4: - return 30; - case 5: - break; - case 6: - break; - case 7: - return 11; - case 8: - break; - case 9: - break; - case 10: - return 4; - case 11: - return 17; - case 12: - this.begin("acc_title"); - return 18; - case 13: - this.popState(); - return "acc_title_value"; - case 14: - this.begin("acc_descr"); - return 20; - case 15: - this.popState(); - return "acc_descr_value"; - case 16: - this.begin("acc_descr_multiline"); - break; - case 17: - this.popState(); - break; - case 18: - return "acc_descr_multiline_value"; - case 19: - return 23; - case 20: - return 27; - case 21: - return 26; - case 22: - return 6; - case 23: - return "INVALID"; - } - }, - rules: [/^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:%(?!\{)[^\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: { "open_directive": { "rules": [1], "inclusive": false }, "type_directive": { "rules": [2, 3], "inclusive": false }, "arg_directive": { "rules": [3, 4], "inclusive": false }, "acc_descr_multiline": { "rules": [17, 18], "inclusive": false }, "acc_descr": { "rules": [15], "inclusive": false }, "acc_title": { "rules": [13], "inclusive": false }, "INITIAL": { "rules": [0, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 19, 20, 21, 22, 23], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser() { - this.yy = {}; - } - Parser.prototype = parser2; - parser2.Parser = Parser; - return new Parser(); - }(); - parser$1.parser = parser$1; - const parser$2 = parser$1; - let currentSection = ""; - let currentTaskId = 0; - const sections = []; - const tasks = []; - const rawTasks = []; - const getCommonDb = () => commonDb$1; - const parseDirective = (statement, context, type2) => { - parseDirective$d(globalThis, statement, context, type2); - }; - const clear$1 = function() { - sections.length = 0; - tasks.length = 0; - currentSection = ""; - rawTasks.length = 0; - clear$i(); - }; - 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$1, - getCommonDb, - addSection, - getSections, - getTasks, - addTask, - addTaskOrg, - addEvent, - parseDirective - }; - const db = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - addEvent, - addSection, - addTask, - addTaskOrg, - clear: clear$1, - default: timelineDb, - getCommonDb, - getSections, - getTasks, - parseDirective - }, 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(element, faceData) { - const radius = 15; - const circleElement = element.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 = element.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(element, circleData) { - const circleElement = element.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, height2, cut) { - return x2 + "," + y2 + " " + (x2 + width2) + "," + y2 + " " + (x2 + width2) + "," + (y2 + height2 - cut) + " " + (x2 + width2 - cut * 1.2) + "," + (y2 + height2) + " " + x2 + "," + (y2 + height2); - } - 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(content, g, x2, y2, width2, height2, textAttrs, colour) { - const text2 = g.append("text").attr("x", x2 + width2 / 2).attr("y", y2 + height2 / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content); - _setTextAttrs(text2, textAttrs); - } - function byTspan(content, g, x2, y2, width2, height2, textAttrs, conf2, colour) { - const { taskFontSize, taskFontFamily } = conf2; - const lines = content.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 + height2 / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"); - _setTextAttrs(text2, textAttrs); - } - } - function byFo(content, g, x2, y2, width2, height2, textAttrs, conf2) { - const body = g.append("switch"); - const f2 = body.append("foreignObject").attr("x", x2).attr("y", y2).attr("width", width2).attr("height", height2).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(content); - byTspan(content, body, x2, y2, width2, height2, 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 = select(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$1 = { - drawRect, - drawCircle, - drawSection, - drawText, - drawLabel, - drawTask, - drawBackgroundRect, - getTextObj, - getNoteRect, - initGraphics, - drawNode: drawNode$1, - getVirtualNodeHeight - }; - const draw$1 = function(text2, id2, version2, diagObj) { - var _a, _b, _c, _d; - const conf2 = getConfig$1(); - const LEFT_MARGIN2 = conf2.leftMargin ?? 50; - (_b = (_a = diagObj.db).clear) == null ? void 0 : _b.call(_a); - diagObj.parser.parse(text2 + "\n"); - log$1.debug("timeline", diagObj.db); - const securityLevel = conf2.securityLevel; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? ( - // @ts-ignore d3 types are wrong - select(sandboxElement.nodes()[0].contentDocument.body) - ) : select("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$1.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$1.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$1.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$1.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$1.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, - ((_c = conf2.timeline) == null ? void 0 : _c.padding) ?? 50, - ((_d = conf2.timeline) == null ? void 0 : _d.useMaxWidth) ?? false - ); - }; - const drawTasks = function(diagram2, tasks2, sectionColor, masterX, masterY, maxTaskHeight, conf2, maxEventCount, maxEventLineLength, maxSectionHeight, isWithoutSections) { - var _a; - 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$1.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 && !((_a = conf2.timeline) == null ? void 0 : _a.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$1.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 = { - setConf: () => { - }, - draw: draw$1 - }; - 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$1 = (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 = getStyles$1; - const diagram$1 = { - db, - renderer, - parser: parser$2, - styles - }; - const timelineDefinition = /* @__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, 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 parseError2(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 parseError2(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 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; - }, - // unshifts one char (or a string) into the input - unput: 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 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, 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 && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = 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[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 - }); - } - }, - // 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 Parser() { - this.yy = {}; - } - Parser.prototype = parser2; - parser2.Parser = Parser; - return new Parser(); - }(); - parser.parser = parser; - const mindmapParser = parser; - const sanitizeText = (text2) => sanitizeText$7(text2, getConfig$1()); - let nodes = []; - let cnt = 0; - let elements = {}; - const clear = () => { - nodes = []; - cnt = 0; - elements = {}; - }; - const getParent = function(level) { - for (let i2 = nodes.length - 1; i2 >= 0; i2--) { - if (nodes[i2].level < level) { - return nodes[i2]; - } - } - return null; - }; - const getMindmap = () => { - return nodes.length > 0 ? nodes[0] : null; - }; - const addNode = (level, id2, descr, type2) => { - log$1.info("addNode", level, id2, descr, type2); - const conf2 = getConfig$1(); - const node2 = { - id: cnt++, - nodeId: sanitizeText(id2), - level, - descr: sanitizeText(descr), - type: type2, - children: [], - width: getConfig$1().mindmap.maxNodeWidth - }; - switch (node2.type) { - case nodeType.ROUNDED_RECT: - node2.padding = 2 * conf2.mindmap.padding; - break; - case nodeType.RECT: - node2.padding = 2 * conf2.mindmap.padding; - break; - case nodeType.HEXAGON: - node2.padding = 2 * conf2.mindmap.padding; - break; - default: - node2.padding = conf2.mindmap.padding; - } - const parent = getParent(level); - if (parent) { - parent.children.push(node2); - nodes.push(node2); - } else { - if (nodes.length === 0) { - nodes.push(node2); - } else { - let error = new Error( - 'There can be only one root. No parent could be found for ("' + node2.descr + '")' - ); - 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 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, element) => { - elements[id2] = element; - }; - const decorateNode = (decoration) => { - const node2 = nodes[nodes.length - 1]; - if (decoration && decoration.icon) { - node2.icon = sanitizeText(decoration.icon); - } - if (decoration && decoration.class) { - node2.class = sanitizeText(decoration.class); - } - }; - 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"; - } - }; - let parseError; - const setErrorHandler = (handler) => { - parseError = handler; - }; - const getLogger = () => log$1; - const getNodeById = (id2) => nodes[id2]; - const getElementById = (id2) => elements[id2]; - const mindmapDb = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - addNode, - clear, - decorateNode, - getElementById, - getLogger, - getMindmap, - getNodeById, - getType, - nodeType, - get parseError() { - return parseError; - }, - sanitizeText, - setElementForId, - setErrorHandler, - type2Str - }, Symbol.toStringTag, { value: "Module" })); - const MAX_SECTIONS = 12; - const defaultBkg = function(elem, node2, section) { - const rd = 5; - elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + 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(elem, node2) { - elem.append("rect").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + type2Str(node2.type)).attr("height", node2.height).attr("width", node2.width); - }; - const cloudBkg = function(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-" + 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(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-" + 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(elem, node2) { - elem.append("circle").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + 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(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(elem, node2) { - elem.append("rect").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + type2Str(node2.type)).attr("height", node2.height).attr("rx", node2.padding).attr("ry", node2.padding).attr("width", node2.width); - }; - const drawNode = function(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 description2 = node2.descr.replace(/()/g, "\n"); - createText(textElem, description2, { - useHtmlLabels: htmlLabels, - width: node2.width, - classes: "mindmap-node-label" - }); - 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 = conf2.fontSize.replace ? conf2.fontSize.replace("px", "") : 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 === 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 nodeType.DEFAULT: - defaultBkg(bkgElem, node2, section); - break; - case nodeType.ROUNDED_RECT: - roundedRectBkg(bkgElem, node2); - break; - case nodeType.RECT: - rectBkg(bkgElem, node2); - break; - case nodeType.CIRCLE: - bkgElem.attr("transform", "translate(" + node2.width / 2 + ", " + +node2.height / 2 + ")"); - circleBkg(bkgElem, node2); - break; - case nodeType.CLOUD: - cloudBkg(bkgElem, node2); - break; - case nodeType.BANG: - bangBkg(bkgElem, node2); - break; - case nodeType.HEXAGON: - hexagonBkg(bkgElem, node2); - break; - } - setElementForId(node2.id, nodeElem); - return node2.height; - }; - const drawEdge = function drawEdge2(edgesElem, mindmap2, parent, depth, fullSection) { - const section = fullSection % (MAX_SECTIONS - 1); - const sx = parent.x + parent.width / 2; - const sy = parent.y + parent.height / 2; - const ex = mindmap2.x + mindmap2.width / 2; - const ey = mindmap2.y + mindmap2.height / 2; - const mx = ex > sx ? sx + Math.abs(sx - ex) / 2 : sx - Math.abs(sx - ex) / 2; - const my = ey > sy ? sy + Math.abs(sy - ey) / 2 : sy - Math.abs(sy - ey) / 2; - const qx = ex > sx ? Math.abs(sx - mx) / 2 + sx : -Math.abs(sx - mx) / 2 + sx; - const qy = ey > sy ? Math.abs(sy - my) / 2 + sy : -Math.abs(sy - my) / 2 + sy; - edgesElem.append("path").attr( - "d", - parent.direction === "TB" || parent.direction === "BT" ? `M${sx},${sy} Q${sx},${qy} ${mx},${my} T${ex},${ey}` : `M${sx},${sy} Q${qx},${sy} ${mx},${my} T${ex},${ey}` - ).attr("class", "edge section-edge-" + section + " edge-depth-" + depth); - }; - const positionNode = function(node2) { - const nodeElem = getElementById(node2.id); - const x2 = node2.x || 0; - const y2 = node2.y || 0; - nodeElem.attr("transform", "translate(" + x2 + "," + y2 + ")"); - }; - const svgDraw = { drawNode, positionNode, drawEdge }; - var cytoscape_umdExports = {}; - var cytoscape_umd = { - get exports() { - return cytoscape_umdExports; - }, - set exports(v) { - cytoscape_umdExports = v; - } - }; - (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, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - 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 _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 (i3 && _arr.length === i3) - 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(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$1 = typeof window === "undefined" ? null : window; - var navigator2 = window$1 ? window$1.navigator : null; - window$1 ? window$1.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 string = function string2(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 element(obj) || collection(obj); - }; - var element = function element2(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, 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; - } - 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 colors[color2.toLowerCase()]; - }; - var color2tuple = function color2tuple2(color2) { - return (array2(color2) ? color2 : null) || colorname2tuple(color2) || hex2tuple(color2) || rgb2tuple(color2) || hsl2tuple(color2); - }; - var 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] - }; - 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(value) { - var type2 = typeof value; - return value != 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(string2) { - var index = string2.length; - while (index-- && reWhitespace2.test(string2.charAt(index))) { - } - return index; - } - var _trimmedEndIndex = trimmedEndIndex2; - var reTrimStart2 = /^\s+/; - function baseTrim2(string2) { - return string2 ? string2.slice(0, _trimmedEndIndex(string2) + 1).replace(reTrimStart2, "") : string2; - } - 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(value) { - var isOwn = hasOwnProperty$42.call(value, symToStringTag$12), tag = value[symToStringTag$12]; - try { - value[symToStringTag$12] = void 0; - var unmasked = true; - } catch (e) { - } - var result = nativeObjectToString$12.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag$12] = tag; - } else { - delete value[symToStringTag$12]; - } - } - return result; - } - var _getRawTag = getRawTag2; - var objectProto$42 = Object.prototype; - var nativeObjectToString2 = objectProto$42.toString; - function objectToString2(value) { - return nativeObjectToString2.call(value); - } - var _objectToString = objectToString2; - var nullTag2 = "[object Null]", undefinedTag2 = "[object Undefined]"; - var symToStringTag2 = _Symbol ? _Symbol.toStringTag : void 0; - function baseGetTag2(value) { - if (value == null) { - return value === void 0 ? undefinedTag2 : nullTag2; - } - return symToStringTag2 && symToStringTag2 in Object(value) ? _getRawTag(value) : _objectToString(value); - } - var _baseGetTag = baseGetTag2; - function isObjectLike2(value) { - return value != null && typeof value == "object"; - } - var isObjectLike_1 = isObjectLike2; - var symbolTag2 = "[object Symbol]"; - function isSymbol2(value) { - return typeof value == "symbol" || isObjectLike_1(value) && _baseGetTag(value) == 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(value) { - if (typeof value == "number") { - return value; - } - if (isSymbol_1(value)) { - return NAN2; - } - if (isObject_12(value)) { - var other = typeof value.valueOf == "function" ? value.valueOf() : value; - value = isObject_12(other) ? other + "" : other; - } - if (typeof value != "string") { - return value === 0 ? value : +value; - } - value = _baseTrim(value); - var isBinary2 = reIsBinary2.test(value); - return isBinary2 || reIsOctal2.test(value) ? freeParseInt2(value.slice(2), isBinary2 ? 2 : 8) : reIsBadHex2.test(value) ? NAN2 : +value; - } - 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$1 ? window$1.performance : null; - var pnow = performance2 && performance2.now ? function() { - return performance2.now(); - } : function() { - return Date.now(); - }; - var raf = function() { - if (window$1) { - if (window$1.requestAnimationFrame) { - return function(fn2) { - window$1.requestAnimationFrame(fn2); - }; - } else if (window$1.mozRequestAnimationFrame) { - return function(fn2) { - window$1.mozRequestAnimationFrame(fn2); - }; - } else if (window$1.webkitRequestAnimationFrame) { - return function(fn2) { - window$1.webkitRequestAnimationFrame(fn2); - }; - } else if (window$1.msRequestAnimationFrame) { - return function(fn2) { - window$1.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 push = function push2(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, value) { - if (prefix) { - propName = prependCamel(prefix, propName); - } - obj[propName] = value; - }; - 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 (string(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 = string(roots) ? this.filter(roots) : roots; - var Q2 = []; - 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()) { - Q2.unshift(vi); - if (params.bfs) { - V[viId] = true; - connectedNodes.push(vi); - } - id2depth[viId] = 0; - } - } - var _loop = function _loop2() { - var v2 = params.bfs ? Q2.shift() : Q2.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 _i2 = 0; _i2 < vwEdges.length; _i2++) { - var e = vwEdges[_i2]; - 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]; - Q2.push(w2); - if (params.bfs) { - V[wId] = true; - connectedNodes.push(w2); - } - connectedBy[wId] = e; - id2depth[wId] = id2depth[vId] + 1; - } - } - }; - 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); - } - 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, _i, _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 (_i = 0, _len = _ref1.length; _i < _len; _i++) { - i3 = _ref1[_i]; - _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, _i, _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 (_i = 0, _len = _ref.length; _i < _len; _i++) { - elem = _ref[_i]; - heappushpop(result, elem, cmp); - } - return result.sort(cmp).reverse(); - }; - nsmallest = function(array3, n, cmp) { - var elem, los, result, _i, _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 (_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; - } - 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 = string(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; - Q2.updateItem(node3); - }; - var Q2 = 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; - Q2.push(node2); - } - var distBetween = function distBetween2(u3, v2) { - var uvs = (directed ? u3.edgesTo(v2) : u3.edgesWith(v2)).intersect(edges2); - 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 { - edge: smallestEdge, - dist: smallestDistance - }; - }; - while (Q2.size() > 0) { - var u2 = Q2.pop(); - var smalletsDist = getDist2(u2); - var uid = u2.id(); - knownDist[uid] = smalletsDist; - if (smalletsDist === Infinity) { - continue; - } - var neighbors = u2.neighborhood().intersect(nodes2); - for (var _i2 = 0; _i2 < neighbors.length; _i2++) { - var v = neighbors[_i2]; - var vid = v.id(); - var vDist = distBetween(u2, v); - var alt = smalletsDist + vDist.dist; - if (alt < getDist2(v)) { - setDist(v, alt); - prev2[vid] = { - node: u2, - edge: vDist.edge - }; - } - } - } - return { - distanceTo: function distanceTo(node3) { - var target = string(node3) ? nodes2.filter(node3)[0] : node3[0]; - return knownDist[target.id()]; - }, - pathTo: function pathTo(node3) { - var target = string(node3) ? nodes2.filter(node3)[0] : node3[0]; - var S2 = []; - var u3 = target; - var uid2 = u3.id(); - if (target.length > 0) { - S2.unshift(target); - while (prev2[uid2]) { - var p2 = prev2[uid2]; - S2.unshift(p2.edge); - S2.unshift(p2.node); - u3 = p2.node; - uid2 = u3.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 _i = 0; _i < S2.length; _i++) { - var edge = S2[_i]; - var u2 = edge.source()[0]; - var v = edge.target()[0]; - var setUIndex = findSetIndex(u2); - 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 _i = 0; _i < edges2.length; _i++) { - var edge = edges2[_i]; - var src = edge.source()[0]; - var tgt = edge.target()[0]; - if (src === tgt) { - continue; - } - var s = indexOf(src); - var t4 = indexOf(tgt); - var st = s * N + t4; - var _weight = weightFn(edge); - if (dist3[st] > _weight) { - dist3[st] = _weight; - next2[st] = t4; - edgeNext[st] = edge; - } - if (!directed) { - var ts = t4 * 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 _i2 = 0; _i2 < N; _i2++) { - var ik = _i2 * N + k; - for (var _j = 0; _j < N; _j++) { - var ij = _i2 * 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 (string(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 (string(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 _i = 1; _i < numNodes; _i++) { - 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 _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; - }; - 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 _i3 = 0; _i3 < numNodes; _i3++) { - to[_i3] = from2[_i3]; - } - }; - for (var iter = 0; iter <= numIter; iter++) { - for (var _i4 = 0; _i4 < numNodes; _i4++) { - metaNodeMap[_i4] = _i4; - } - 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 _i5 = 0; _i5 < minCutNodeMap.length; _i5++) { - var partitionId = minCutNodeMap[_i5]; - var node2 = nodes2[_i5]; - 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 _i = 0; _i < length2; _i++) { - v[_i] = v[_i] / total; - } - return v; - }; - var qbezierAt = function qbezierAt2(p0, p1, p2, t4) { - return (1 - t4) * (1 - t4) * p0 + 2 * (1 - t4) * t4 * p1 + t4 * t4 * p2; - }; - var qbezierPtAt = function qbezierPtAt2(p0, p1, p2, t4) { - return { - x: qbezierAt(p0.x, p1.x, p2.x, t4), - y: qbezierAt(p0.y, p1.y, p2.y, t4) - }; - }; - var lineAt = function lineAt2(p0, p1, t4, 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 - }; - t4 = t4 == null ? 0 : t4; - d = d != null ? d : t4 * 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 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, height2, padding2) { - var cornerRadius = getRoundRectangleRadius(width2, height2); - var halfWidth = width2 / 2; - var halfHeight = height2 / 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 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 <= x2 && x2 <= x22 + t4 && y1 - t4 <= y2 && y2 <= y22 + t4; - }; - 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, t4, 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); - t4 = r - Math.sqrt(discriminant); - t4 = t4 < 0 ? -Math.pow(-t4, 1 / 3) : Math.pow(t4, 1 / 3); - result[0] = -term1 + s + t4; - term1 += (s + t4) / 2; - result[4] = result[2] = -term1; - term1 = Math.sqrt(3) * (-t4 + 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 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 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, height2, 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] = height2 / 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, height2) { - var cutPolygonPoints = new Array(basePoints.length); - var halfW = width2 / 2; - var halfH = height2 / 2; - var cornerRadius = getRoundPolygonRadius(width2, height2); - 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, height2, centerX, centerY, padding2) { - x2 -= centerX; - y2 -= centerY; - x2 /= width2 / 2 + padding2; - y2 /= height2 / 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, height2, 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] * height2 + 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 _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]; - } - 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, height2, padding2) { - var intersections = []; - var intersection2; - var lines = new Array(basePoints.length); - var halfW = width2 / 2; - var halfH = height2 / 2; - var cornerRadius = getRoundPolygonRadius(width2, height2); - 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 _i3 = 0; _i3 < lines.length / 4; _i3++) { - intersection2 = finiteLinesIntersect(x2, y2, centerX, centerY, lines[_i3 * 4], lines[_i3 * 4 + 1], lines[_i3 * 4 + 2], lines[_i3 * 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 _i4 = 1; _i4 < intersections.length / 2; _i4++) { - var squaredDistance = Math.pow(intersections[_i4 * 2] - x2, 2) + Math.pow(intersections[_i4 * 2 + 1] - y2, 2); - if (squaredDistance <= lowestSquaredDistance) { - lowestIntersection[0] = intersections[_i4 * 2]; - lowestIntersection[1] = intersections[_i4 * 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 _i5 = 0; _i5 < sides; _i5++) { - x2 = points[2 * _i5] = points[2 * _i5] * sx; - y2 = points[2 * _i5 + 1] = points[2 * _i5 + 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, height2) { - return Math.min(width2 / 4, height2 / 4, 8); - }; - var getRoundPolygonRadius = function getRoundPolygonRadius2(width2, height2) { - return Math.min(width2 / 10, height2 / 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, height2) { - return { - heightOffset: Math.min(15, 0.05 * height2), - 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 _i = 0; _i < numEdges; _i++) { - var edge = edges2[_i]; - var srcId = edge.data("source"); - var tgtId = edge.data("target"); - if (srcId === tgtId) { - continue; - } - var s = nodes2.indexOfId(srcId); - var t4 = nodes2.indexOfId(tgtId); - var w2 = weight(edge); - var _n = t4 * 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 _i2 = 0; _i2 < numNodes; _i2++) { - var _n2 = _i2 * numNodes + _j; - matrix[_n2] = p2; - } - } else { - for (var _i3 = 0; _i3 < numNodes; _i3++) { - var _n3 = _i3 * numNodes + _j; - matrix[_n3] = matrix[_n3] / columnSum[_j] + additionalProb; - } - } - } - 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; - } - 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]; - } - } - inPlaceSumNormalize(temp); - previous = eigenvector; - eigenvector = temp; - temp = previous; - var diff = 0; - for (var _i7 = 0; _i7 < numNodes; _i7++) { - var delta = previous[_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 (string(node3)) { - node3 = cy.filter(node3); - } - return degrees2[node3.id()] / maxDegree; - } - }; - } else { - var indegrees = {}; - var outdegrees = {}; - var maxIndegree = 0; - var maxOutdegree = 0; - for (var _i = 0; _i < numNodes; _i++) { - var _node = nodes2[_i]; - 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 (string(node3)) { - node3 = cy.filter(node3); - } - return indegrees[node3.id()] / maxIndegree; - }, - outdegree: function outdegree(node3) { - if (maxOutdegree === 0) { - return 0; - } - if (string(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 _i2 = 0; _i2 < incoming.length; _i2++) { - s_in += weight(incoming[_i2]); - } - for (var _i3 = 0; _i3 < outgoing.length; _i3++) { - s_out += weight(outgoing[_i3]); - } - 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 (string(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 Q2 = new heap(function(a, b) { - return d[a] - d[b]; - }); - for (var _i = 0; _i < V.length; _i++) { - var _vid = V[_i].id(); - P[_vid] = []; - g[_vid] = 0; - d[_vid] = Infinity; - } - g[sid] = 1; - d[sid] = 0; - Q2.push(sid); - while (!Q2.empty()) { - var _v = Q2.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 (Q2.nodes.indexOf(w2) < 0) { - Q2.push(w2); - } else { - Q2.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) { - Q2.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 _i2 = 0; _i2 < V.length; _i2++) { - e[V[_i2].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(M2, n, val) { - for (var i3 = 0; i3 < n; i3++) { - M2[i3 * n + i3] = val; - } - }; - var normalize2 = function normalize3(M2, n) { - var sum; - for (var col = 0; col < n; col++) { - sum = 0; - for (var row = 0; row < n; row++) { - sum += M2[row * n + col]; - } - for (var _row = 0; _row < n; _row++) { - M2[_row * n + col] = M2[_row * n + col] / sum; - } - } - }; - 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(M2, n, expandFactor) { - var _M = M2.slice(0); - for (var p2 = 1; p2 < expandFactor; p2++) { - M2 = mmult(M2, _M, n); - } - return M2; - }; - var inflate = function inflate2(M2, n, inflateFactor) { - var _M = new Array(n * n); - for (var i3 = 0; i3 < n * n; i3++) { - _M[i3] = Math.pow(M2[i3], inflateFactor); - } - normalize2(_M, n); - return _M; - }; - var hasConverged = function hasConverged2(M2, _M, n2, roundFactor) { - for (var i3 = 0; i3 < n2; i3++) { - var v1 = Math.round(M2[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(M2, n, nodes2, cy) { - var clusters = []; - for (var i3 = 0; i3 < n; i3++) { - var cluster = []; - for (var j = 0; j < n; j++) { - if (Math.round(M2[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 M2 = new Array(n2), _M; - for (var _i = 0; _i < n2; _i++) { - M2[_i] = 0; - } - for (var e = 0; e < edges2.length; e++) { - var edge = edges2[e]; - var _i2 = id2position[edge.source().id()]; - var j = id2position[edge.target().id()]; - var sim = getSimilarity$1(edge, opts.attributes); - M2[_i2 * n + j] += sim; - M2[j * n + _i2] += sim; - } - addLoops(M2, n, opts.multFactor); - normalize2(M2, n); - var isStillMoving = true; - var iterations = 0; - while (isStillMoving && iterations < opts.maxIterations) { - isStillMoving = false; - _M = expand(M2, n, opts.expandFactor); - M2 = inflate(_M, n, opts.inflateFactor); - if (!hasConverged(M2, _M, n2, 4)) { - isStillMoving = true; - } - iterations++; - } - var clusters = assign$2(M2, 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 _i = 0; _i < ndim; _i++) { - centroid[_i] = Math.random() * (max3[_i] - min3[_i]) + min3[_i]; - } - centroids[c2] = centroid; - } - return centroids; - }; - var classify = function classify2(node2, centroids, distance2, attributes, type2) { - var min3 = Infinity; - var index = 0; - for (var i3 = 0; i3 < centroids.length; i3++) { - var dist3 = getDist(distance2, node2, centroids[i3], attributes, type2); - if (dist3 < min3) { - min3 = dist3; - index = i3; - } - } - return index; - }; - 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 _i2 = 0; _i2 < k; _i2++) { - medoids[_i2] = 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 sum = new Array(ndim); - for (var d = 0; d < ndim; d++) { - sum[d] = 0; - for (var i3 = 0; i3 < cluster.length; i3++) { - node2 = cluster[i3]; - sum[d] += opts.attributes[d](node2); - } - newCentroid[d] = sum[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, U2, 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(U2[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(U2, _U, centroids, nodes2, opts) { - for (var i3 = 0; i3 < U2.length; i3++) { - _U[i3] = U2[i3].slice(); - } - var sum, numerator, denominator; - var pow = 2 / (opts.m - 1); - for (var c2 = 0; c2 < centroids.length; c2++) { - for (var n = 0; n < nodes2.length; n++) { - sum = 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"); - sum += Math.pow(numerator / denominator, pow); - } - U2[n][c2] = 1 / sum; - } - } - }; - var assign$1 = function assign2(nodes2, U2, opts, cy) { - var clusters = new Array(opts.k); - for (var c2 = 0; c2 < clusters.length; c2++) { - clusters[c2] = []; - } - var max3; - var index; - for (var n = 0; n < U2.length; n++) { - max3 = -Infinity; - index = -1; - for (var _c2 = 0; _c2 < U2[0].length; _c2++) { - if (U2[n][_c2] > max3) { - max3 = U2[n][_c2]; - index = _c2; - } - } - clusters[index].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 U2; - var _U; - var weight; - _U = new Array(nodes2.length); - for (var i3 = 0; i3 < nodes2.length; i3++) { - _U[i3] = new Array(opts.k); - } - U2 = new Array(nodes2.length); - for (var _i3 = 0; _i3 < nodes2.length; _i3++) { - U2[_i3] = new Array(opts.k); - } - for (var _i4 = 0; _i4 < nodes2.length; _i4++) { - var total = 0; - for (var j = 0; j < opts.k; j++) { - U2[_i4][j] = Math.random(); - total += U2[_i4][j]; - } - 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); - } - 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, U2, weight, opts); - updateMembership(U2, _U, centroids, nodes2, opts); - if (!haveMatricesConverged(U2, _U, opts.sensitivityThreshold)) { - isStillMoving = true; - } - iterations++; - } - clusters = assign$1(nodes2, U2, opts, cy); - return { - clusters, - degreeOfMembership: U2 - }; - }; - 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, index, 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 = index[minKey]; - var c2 = index[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); - 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[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 _i2 = 0; _i2 < clusters.length; _i2++) { - var key1 = clusters[_i2].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[_i2].index = _i2; - } - 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 index = []; - 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; - index[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, 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, 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 index = -1; - var max3 = -Infinity; - for (var ei = 0; ei < exemplars.length; ei++) { - var e = exemplars[ei]; - if (S2[i3 * n + e] > max3) { - index = e; - max3 = S2[i3 * n + e]; - } - } - if (index > 0) { - clusters.push(index); - } - } - 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 sum = 0; - for (var j = 0; j < ii.length; j++) { - sum += S2[ii[j] * n + ii[i3]]; - } - if (sum > maxSum) { - maxI = i3; - maxSum = sum; - } - } - 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 _i = 0; _i < n2; _i++) { - S2[_i] = -Infinity; - } - for (var _i2 = 0; _i2 < n; _i2++) { - for (var j = 0; j < n; j++) { - if (_i2 !== j) { - S2[_i2 * n + j] = getSimilarity(opts.distance, nodes2[_i2], nodes2[j], opts.attributes); - } - } - } - p2 = getPreference(S2, opts.preference); - for (var _i3 = 0; _i3 < n; _i3++) { - S2[_i3 * n + _i3] = p2; - } - R = new Array(n2); - for (var _i4 = 0; _i4 < n2; _i4++) { - R[_i4] = 0; - } - A = new Array(n2); - for (var _i5 = 0; _i5 < n2; _i5++) { - A[_i5] = 0; - } - var old = new Array(n); - var Rp = new Array(n); - var se = new Array(n); - for (var _i6 = 0; _i6 < n; _i6++) { - old[_i6] = 0; - Rp[_i6] = 0; - se[_i6] = 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 sum = 0; - for (var _j3 = 0; _j3 < n; _j3++) { - old[_j3] = A[_j3 * n + _i9]; - Rp[_j3] = Math.max(0, R[_j3 * n + _i9]); - sum += Rp[_j3]; - } - sum -= Rp[_i9]; - Rp[_i9] = R[_i9 * n + _i9]; - sum += Rp[_i9]; - for (var _j4 = 0; _j4 < n; _j4++) { - A[_j4 * n + _i9] = (1 - opts.damping) * Math.min(0, sum - Rp[_j4]) + opts.damping * old[_j4]; - } - A[_i9 * n + _i9] = (1 - opts.damping) * (sum - 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 = string(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 index = 0; - var components = []; - var stack = []; - var cut = eles.spawn(eles); - var stronglyConnectedSearch = function stronglyConnectedSearch2(sourceNodeId) { - stack.push(sourceNodeId); - nodes2[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 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(value) { - return deliver(this, STATE_FULFILLED, "fulfillValue", value); - }, - reject: function reject(value) { - return deliver(this, STATE_REJECTED, "rejectReason", value); - }, - /* "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(resolver(onFulfilled, next2, "fulfill")); - curr.onRejected.push(resolver(onRejected, next2, "reject")); - execute(curr); - return next2.proxy; - } - }; - var deliver = function deliver2(curr, state2, name2, value) { - if (curr.state === STATE_PENDING) { - curr.state = state2; - curr[name2] = value; - 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, name2, value) { - if (curr[name2].length === 0) - return; - var handlers = curr[name2]; - curr[name2] = []; - var func = function func2() { - for (var i3 = 0; i3 < handlers.length; i3++) { - handlers[i3](value); - } - }; - if (typeof setImmediate === "function") - setImmediate(func); - else - setTimeout(func, 0); - }; - var resolver = function resolver2(cb, next2, method) { - return function(value) { - if (typeof cb !== "function") - next2[method].call(next2, value); - else { - var result; - try { - result = cb(value); - } 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(resolveAll, rejectAll) { - var vals = new Array(ps.length); - var doneCount = 0; - var fulfill = function fulfill2(i4, val) { - vals[i4] = val; - doneCount++; - if (doneCount === ps.length) { - resolveAll(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(t4) { - var _p = this._private; - if (t4 === void 0) { - return _p.progress * _p.duration; - } else { - return this.progress(t4 / _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 name2 = prop.name; - var startStyleProp = _p.startStyle[name2]; - _p.startStyle[name2] = 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 all = selfIsArrayLike ? self2 : [self2]; - var cy = this._private.cy || this; - if (!cy.styleEnabled()) { - return false; - } - var ele = all[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 all = selfIsArrayLike ? self2 : [self2]; - var cy = this._private.cy || this; - if (!cy.styleEnabled()) { - return this; - } - for (var i3 = 0; i3 < all.length; i3++) { - var ele = all[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 all = 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(all[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(all[0], properties); - }; - }, - // animate - animate: function animate() { - return 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; - } - if (params) { - properties = extend2({}, properties, params); - } - for (var i3 = 0; i3 < all.length; i3++) { - var ele = all[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 all = selfIsArrayLike ? self2 : [self2]; - var cy = this._private.cy || this; - if (!cy.styleEnabled()) { - return this; - } - for (var i3 = 0; i3 < all.length; i3++) { - var ele = all[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(value, object3) { - if (isArray_1(value)) { - return false; - } - var type2 = typeof value; - if (type2 == "number" || type2 == "symbol" || type2 == "boolean" || value == null || isSymbol_1(value)) { - return true; - } - return reIsPlainProp2.test(value) || !reIsDeepProp2.test(value) || object3 != null && value in Object(object3); - } - var _isKey = isKey2; - var asyncTag2 = "[object AsyncFunction]", funcTag2 = "[object Function]", genTag2 = "[object GeneratorFunction]", proxyTag2 = "[object Proxy]"; - function isFunction2(value) { - if (!isObject_12(value)) { - return false; - } - var tag = _baseGetTag(value); - 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(value) { - if (!isObject_12(value) || _isMasked(value)) { - return false; - } - var pattern = isFunction_1(value) ? reIsNative2 : reIsHostCtor2; - return pattern.test(_toSource(value)); - } - var _baseIsNative = baseIsNative2; - function getValue$1(object3, key) { - return object3 == null ? void 0 : object3[key]; - } - var _getValue = getValue$1; - function getNative2(object3, key) { - var value = _getValue(object3, key); - return _baseIsNative(value) ? value : 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, value) { - var data2 = this.__data__; - this.size += this.has(key) ? 0 : 1; - data2[key] = _nativeCreate && value === void 0 ? HASH_UNDEFINED2 : value; - return this; - } - var _hashSet = hashSet2; - function Hash2(entries2) { - var index = -1, length2 = entries2 == null ? 0 : entries2.length; - this.clear(); - while (++index < length2) { - var entry = entries2[index]; - 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(value, other) { - return value === other || value !== value && 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__, index = _assocIndexOf(data2, key); - if (index < 0) { - return false; - } - var lastIndex = data2.length - 1; - if (index == lastIndex) { - data2.pop(); - } else { - splice2.call(data2, index, 1); - } - --this.size; - return true; - } - var _listCacheDelete = listCacheDelete2; - function listCacheGet2(key) { - var data2 = this.__data__, index = _assocIndexOf(data2, key); - return index < 0 ? void 0 : data2[index][1]; - } - var _listCacheGet = listCacheGet2; - function listCacheHas2(key) { - return _assocIndexOf(this.__data__, key) > -1; - } - var _listCacheHas = listCacheHas2; - function listCacheSet2(key, value) { - var data2 = this.__data__, index = _assocIndexOf(data2, key); - if (index < 0) { - ++this.size; - data2.push([key, value]); - } else { - data2[index][1] = value; - } - return this; - } - var _listCacheSet = listCacheSet2; - function ListCache2(entries2) { - var index = -1, length2 = entries2 == null ? 0 : entries2.length; - this.clear(); - while (++index < length2) { - var entry = entries2[index]; - 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(value) { - var type2 = typeof value; - return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value !== "__proto__" : value === 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, value) { - var data2 = _getMapData(this, key), size2 = data2.size; - data2.set(key, value); - this.size += data2.size == size2 ? 0 : 1; - return this; - } - var _mapCacheSet = mapCacheSet2; - function MapCache2(entries2) { - var index = -1, length2 = entries2 == null ? 0 : entries2.length; - this.clear(); - while (++index < length2) { - var entry = entries2[index]; - 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, resolver2) { - if (typeof func != "function" || resolver2 != null && typeof resolver2 != "function") { - throw new TypeError(FUNC_ERROR_TEXT2); - } - var memoized = function() { - var args = arguments, key = resolver2 ? resolver2.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(string2) { - var result = []; - if (string2.charCodeAt(0) === 46) { - result.push(""); - } - string2.replace(rePropName2, function(match5, number3, quote, subString) { - result.push(quote ? subString.replace(reEscapeChar2, "$1") : number3 || match5); - }); - return result; - }); - var _stringToPath = stringToPath2; - function arrayMap2(array3, iteratee) { - var index = -1, length2 = array3 == null ? 0 : array3.length, result = Array(length2); - while (++index < length2) { - result[index] = iteratee(array3[index], index, 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(value) { - if (typeof value == "string") { - return value; - } - if (isArray_1(value)) { - return _arrayMap(value, baseToString2) + ""; - } - if (isSymbol_1(value)) { - return symbolToString2 ? symbolToString2.call(value) : ""; - } - var result = value + ""; - return result == "0" && 1 / value == -INFINITY$12 ? "-0" : result; - } - var _baseToString = baseToString2; - function toString$1(value) { - return value == null ? "" : _baseToString(value); - } - var toString_1 = toString$1; - function castPath2(value, object3) { - if (isArray_1(value)) { - return value; - } - return _isKey(value, object3) ? [value] : _stringToPath(toString_1(value)); - } - var _castPath = castPath2; - var INFINITY2 = 1 / 0; - function toKey2(value) { - if (typeof value == "string" || isSymbol_1(value)) { - return value; - } - var result = value + ""; - return result == "0" && 1 / value == -INFINITY2 ? "-0" : result; - } - var _toKey = toKey2; - function baseGet2(object3, path2) { - path2 = _castPath(path2, object3); - var index = 0, length2 = path2.length; - while (object3 != null && index < length2) { - object3 = object3[_toKey(path2[index++])]; - } - return index && index == 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, value) { - if (key == "__proto__" && _defineProperty) { - _defineProperty(object3, key, { - "configurable": true, - "enumerable": true, - "value": value, - "writable": true - }); - } else { - object3[key] = value; - } - } - var _baseAssignValue = baseAssignValue2; - var objectProto2 = Object.prototype; - var hasOwnProperty2 = objectProto2.hasOwnProperty; - function assignValue2(object3, key, value) { - var objValue = object3[key]; - if (!(hasOwnProperty2.call(object3, key) && eq_1(objValue, value)) || value === void 0 && !(key in object3)) { - _baseAssignValue(object3, key, value); - } - } - var _assignValue = assignValue2; - var MAX_SAFE_INTEGER2 = 9007199254740991; - var reIsUint2 = /^(?:0|[1-9]\d*)$/; - function isIndex2(value, length2) { - var type2 = typeof value; - length2 = length2 == null ? MAX_SAFE_INTEGER2 : length2; - return !!length2 && (type2 == "number" || type2 != "symbol" && reIsUint2.test(value)) && (value > -1 && value % 1 == 0 && value < length2); - } - var _isIndex = isIndex2; - function baseSet2(object3, path2, value, customizer) { - if (!isObject_12(object3)) { - return object3; - } - path2 = _castPath(path2, object3); - var index = -1, length2 = path2.length, lastIndex = length2 - 1, nested = object3; - while (nested != null && ++index < length2) { - var key = _toKey(path2[index]), newValue = value; - 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_12(objValue) ? objValue : _isIndex(path2[index + 1]) ? [] : {}; - } - } - _assignValue(nested, key, newValue); - nested = nested[key]; - } - return object3; - } - var _baseSet = baseSet2; - function set2(object3, path2, value) { - return object3 == null ? object3 : _baseSet(object3, path2, value); - } - var set_1 = set2; - function copyArray2(source, array3) { - var index = -1, length2 = source.length; - array3 || (array3 = Array(length2)); - while (++index < length2) { - array3[index] = source[index]; - } - return array3; - } - var _copyArray = copyArray2; - function toPath(value) { - if (isArray_1(value)) { - return _arrayMap(value, _toKey); - } - return isSymbol_1(value) ? [value] : _copyArray(_stringToPath(toString_1(value))); - } - 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(name2, value) { - var p2 = params; - var self2 = this; - var selfIsArrayLike = self2.length !== void 0; - var all = selfIsArrayLike ? self2 : [self2]; - var single = selfIsArrayLike ? self2[0] : self2; - if (string(name2)) { - var isPathLike = name2.indexOf(".") !== -1; - var path2 = isPathLike && toPath_1(name2); - if (p2.allowGetting && value === void 0) { - var ret; - if (single) { - p2.beforeGet(single); - if (path2 && single._private[p2.field][name2] === void 0) { - ret = get_1(single._private[p2.field], path2); - } else { - ret = single._private[p2.field][name2]; - } - } - return ret; - } else if (p2.allowSetting && value !== void 0) { - var valid2 = !p2.immutableKeys[name2]; - if (valid2) { - var change2 = _defineProperty$1({}, name2, value); - p2.beforeSet(self2, change2); - for (var i3 = 0, l = all.length; i3 < l; i3++) { - var ele = all[i3]; - if (p2.canSet(ele)) { - if (path2 && single._private[p2.field][name2] === void 0) { - set_1(ele._private[p2.field], path2, value); - } else { - ele._private[p2.field][name2] = value; - } - } - } - if (p2.updateStyle) { - self2.updateStyle(); - } - p2.onSet(self2); - if (p2.settingTriggersEvent) { - self2[p2.triggerFnName](p2.settingEvent); - } - } - } - } else if (p2.allowSetting && plainObject(name2)) { - var obj = name2; - var k, v; - var keys2 = Object.keys(obj); - p2.beforeSet(self2, obj); - for (var _i = 0; _i < keys2.length; _i++) { - k = keys2[_i]; - v = obj[k]; - var _valid = !p2.immutableKeys[k]; - if (_valid) { - for (var j = 0; j < all.length; j++) { - var _ele = all[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(name2)) { - var fn2 = name2; - self2.on(p2.bindingEvent, fn2); - } else if (p2.allowGetting && name2 === 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 all = selfIsArrayLike ? self2 : [self2]; - if (string(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 = all.length; i_a < l_a; i_a++) { - all[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 = all.length; _i_a < _l_a; _i_a++) { - var _privateFields = all[_i_a]._private[p2.field]; - var _keys = Object.keys(_privateFields); - for (var _i2 = 0; _i2 < _keys.length; _i2++) { - var _key = _keys[_i2]; - 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(proto2) { - var p2 = proto2; - 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, op, i3; - ops = tokens.comparatorOp.split("|"); - for (i3 = 0; i3 < ops.length; i3++) { - op = ops[i3]; - tokens.comparatorOp += "|@" + op; - } - ops = tokens.comparatorOp.split("|"); - for (i3 = 0; i3 < ops.length; i3++) { - op = ops[i3]; - if (op.indexOf("!") >= 0) { - continue; - } - if (op === "=") { - continue; - } - tokens.comparatorOp += "|\\!" + op; - } - })(); - 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(match5, $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], value = _ref12[2]; - var valueIsString = new RegExp("^" + tokens.string + "$").exec(value) != null; - if (valueIsString) { - value = value.substring(1, value.length - 1); - } else { - value = parseFloat(value); - } - query.checks.push({ - type: Type2.DATA_COMPARE, - field: cleanMetaChars(variable), - operator: comparatorOp, - value - }); - } - }, { - 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 match5; - var name2; - 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) { - match5 = m; - expr = e; - name2 = n; - var consumed = m[0]; - remaining = remaining.substring(consumed.length); - break; - } - } - return { - expr, - match: match5, - name: name2, - remaining - }; - }; - var consumeWhitespace = function consumeWhitespace2(remaining) { - var match5 = remaining.match(/^\s+/); - if (match5) { - var consumed = match5[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 (string(val)) { - return '"' + val + '"'; - } else { - return clean(val); - } - }; - var space = function space2(val) { - return " " + val + " "; - }; - var checkToString = function checkToString2(check, subject) { - var type2 = check.type, value = check.value; - switch (type2) { - case Type2.GROUP: { - var group = clean(value); - return group.substring(0, group.length - 1); - } - case Type2.DATA_COMPARE: { - var field = check.field, operator = check.operator; - return "[" + field + space(clean(operator)) + cleanVal(value) + "]"; - } - 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(value) + "]]"; - } - case Type2.STATE: { - return value; - } - case Type2.ID: { - return "#" + value; - } - case Type2.CLASS: { - return "." + value; - } - 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 sub = queryToString(check.subject, subject); - var rhs = queryToString(check.right, subject); - return lhs + (lhs.length > 0 ? " " : "") + sub + 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, value) { - var matches2; - var isFieldStr = string(fieldVal); - var isFieldNum = number$12(fieldVal); - var isValStr = string(value); - 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 = "" + value; - } - if (caseInsensitive) { - fieldVal = fieldStr = fieldStr.toLowerCase(); - value = 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 === value; - break; - case ">": - isIneqCmp = true; - matches2 = fieldVal > value; - break; - case ">=": - isIneqCmp = true; - matches2 = fieldVal >= value; - break; - case "<": - isIneqCmp = true; - matches2 = fieldVal < value; - break; - case "<=": - isIneqCmp = true; - matches2 = fieldVal <= value; - 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, value = check.value; - return valCmp(meta(ele, field), operator, value); - }; - match[Type2.DATA_COMPARE] = function(check, ele) { - var field = check.field, operator = check.operator, value = check.value; - return valCmp(data$1(ele, field), operator, value); - }; - 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(element2) { - for (var j = 0; j < self2.length; j++) { - var query = self2[j]; - if (matches$1(query, element2)) { - 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 || string(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 (string(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 contains(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, name2) { - 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 ch = tch[name2] = tch[name2] || []; - var hash = hashString(key); - var cacheHit = ch[hash]; - if (cacheHit) { - return cacheHit; - } else { - return ch[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 (string(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 (string(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 && string(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 && string(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, height2, paddingObject, relativeTo) { - if (paddingObject.units === "%") { - switch (relativeTo) { - case "width": - return width2 > 0 ? paddingObject.pfValue * width2 : 0; - case "height": - return height2 > 0 ? paddingObject.pfValue * height2 : 0; - case "average": - return width2 > 0 && height2 > 0 ? paddingObject.pfValue * (width2 + height2) / 2 : 0; - case "min": - return width2 > 0 && height2 > 0 ? width2 > height2 ? paddingObject.pfValue * height2 : paddingObject.pfValue * width2 : 0; - case "max": - return width2 > 0 && height2 > 0 ? width2 > height2 ? paddingObject.pfValue * width2 : paddingObject.pfValue * height2 : 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 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); - } 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); - 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, - 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 _i = 0; _i < eles.length; _i++) { - var _ele = eles[_i]; - 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(name2) { - return "rendered" + name2[0].toUpperCase() + name2.substr(1); - }; - var edgePoints = Object.keys(pts).reduce(function(obj, name2) { - var spec = pts[name2]; - var rName = renderedName(name2); - obj[name2] = 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 match5 = evt.match(eventRegex); - if (match5) { - var type2 = match5[1]; - var namespace2 = match5[2] ? match5[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 match5 = evt.match(eventRegex); - if (match5) { - var type2 = match5[1]; - var namespace2 = match5[2] ? match5[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) { - push(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 && element(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 (string(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 (string(_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 (string(toRemove)) { - toRemove = this.filter(toRemove); - } - var elements2 = this.spawn(); - for (var i3 = 0; i3 < this.length; i3++) { - var element2 = this[i3]; - var remove2 = toRemove.has(element2); - if (!remove2) { - elements2.push(element2); - } - } - return elements2; - } - }, - absoluteComplement: function absoluteComplement() { - var cy = this.cy(); - return cy.mutableElements().not(this); - }, - intersect: function intersect2(other) { - if (string(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 (string(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 (string(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 (string(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 && string(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 index = this.length++; - this[index] = toAddEle; - map2.set(id2, { - ele: toAddEle, - index - }); - } - } - 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 && string(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; + }, "zeroNonZero"), + any: /* @__PURE__ */ __name(function any(val1, val2) { + return val1 != val2; + }, "any"), + emptyNonEmpty: /* @__PURE__ */ __name(function emptyNonEmpty(str1, str2) { + var empty1 = emptyString(str1); + var empty22 = emptyString(str2); + return empty1 && !empty22 || !empty1 && empty22; + }, "emptyNonEmpty") + }; + var t4 = styfn$2.types; + var mainLabel = [{ + name: "label", + type: t4.text, + triggersBounds: diff2.any, + triggersZOrder: diff2.emptyNonEmpty + }, { + name: "text-rotation", + type: t4.textRotation, + triggersBounds: diff2.any + }, { + name: "text-margin-x", + type: t4.bidirectionalSize, + triggersBounds: diff2.any + }, { + name: "text-margin-y", + type: t4.bidirectionalSize, + triggersBounds: diff2.any + }]; + var sourceLabel = [{ + name: "source-label", + type: t4.text, + triggersBounds: diff2.any + }, { + name: "source-text-rotation", + type: t4.textRotation, + triggersBounds: diff2.any + }, { + name: "source-text-margin-x", + type: t4.bidirectionalSize, + triggersBounds: diff2.any + }, { + name: "source-text-margin-y", + type: t4.bidirectionalSize, + triggersBounds: diff2.any + }, { + name: "source-text-offset", + type: t4.size, + triggersBounds: diff2.any + }]; + var targetLabel = [{ + name: "target-label", + type: t4.text, + triggersBounds: diff2.any + }, { + name: "target-text-rotation", + type: t4.textRotation, + triggersBounds: diff2.any + }, { + name: "target-text-margin-x", + type: t4.bidirectionalSize, + triggersBounds: diff2.any + }, { + name: "target-text-margin-y", + type: t4.bidirectionalSize, + triggersBounds: diff2.any + }, { + name: "target-text-offset", + type: t4.size, + triggersBounds: diff2.any + }]; + var labelDimensions = [{ + name: "font-family", + type: t4.fontFamily, + triggersBounds: diff2.any + }, { + name: "font-style", + type: t4.fontStyle, + triggersBounds: diff2.any + }, { + name: "font-weight", + type: t4.fontWeight, + triggersBounds: diff2.any + }, { + name: "font-size", + type: t4.size, + triggersBounds: diff2.any + }, { + name: "text-transform", + type: t4.textTransform, + triggersBounds: diff2.any + }, { + name: "text-wrap", + type: t4.textWrap, + triggersBounds: diff2.any + }, { + name: "text-overflow-wrap", + type: t4.textOverflowWrap, + triggersBounds: diff2.any + }, { + name: "text-max-width", + type: t4.size, + triggersBounds: diff2.any + }, { + name: "text-outline-width", + type: t4.size, + triggersBounds: diff2.any + }, { + name: "line-height", + type: t4.positiveNumber, + triggersBounds: diff2.any + }]; + var commonLabel = [{ + name: "text-valign", + type: t4.valign, + triggersBounds: diff2.any + }, { + name: "text-halign", + type: t4.halign, + triggersBounds: diff2.any + }, { + name: "color", + type: t4.color + }, { + name: "text-outline-color", + type: t4.color + }, { + name: "text-outline-opacity", + type: t4.zeroOneNumber + }, { + name: "text-background-color", + type: t4.color + }, { + name: "text-background-opacity", + type: t4.zeroOneNumber + }, { + name: "text-background-padding", + type: t4.size, + triggersBounds: diff2.any + }, { + name: "text-border-opacity", + type: t4.zeroOneNumber + }, { + name: "text-border-color", + type: t4.color + }, { + name: "text-border-width", + type: t4.size, + triggersBounds: diff2.any + }, { + name: "text-border-style", + type: t4.borderStyle, + triggersBounds: diff2.any + }, { + name: "text-background-shape", + type: t4.textBackgroundShape, + triggersBounds: diff2.any + }, { + name: "text-justification", + type: t4.justification + }]; + var behavior = [{ + name: "events", + type: t4.bool, + triggersZOrder: diff2.any + }, { + name: "text-events", + type: t4.bool, + triggersZOrder: diff2.any + }]; + var visibility = [{ + name: "display", + type: t4.display, + triggersZOrder: diff2.any, + triggersBounds: diff2.any, + triggersBoundsOfConnectedEdges: true + }, { + name: "visibility", + type: t4.visibility, + triggersZOrder: diff2.any + }, { + name: "opacity", + type: t4.zeroOneNumber, + triggersZOrder: diff2.zeroNonZero + }, { + name: "text-opacity", + type: t4.zeroOneNumber + }, { + name: "min-zoomed-font-size", + type: t4.size + }, { + name: "z-compound-depth", + type: t4.zCompoundDepth, + triggersZOrder: diff2.any + }, { + name: "z-index-compare", + type: t4.zIndexCompare, + triggersZOrder: diff2.any + }, { + name: "z-index", + type: t4.number, + triggersZOrder: diff2.any + }]; + var overlay = [{ + name: "overlay-padding", + type: t4.size, + triggersBounds: diff2.any + }, { + name: "overlay-color", + type: t4.color + }, { + name: "overlay-opacity", + type: t4.zeroOneNumber, + triggersBounds: diff2.zeroNonZero + }, { + name: "overlay-shape", + type: t4.overlayShape, + triggersBounds: diff2.any + }, { + name: "overlay-corner-radius", + type: t4.cornerRadius + }]; + var underlay = [{ + name: "underlay-padding", + type: t4.size, + triggersBounds: diff2.any + }, { + name: "underlay-color", + type: t4.color + }, { + name: "underlay-opacity", + type: t4.zeroOneNumber, + triggersBounds: diff2.zeroNonZero + }, { + name: "underlay-shape", + type: t4.overlayShape, + triggersBounds: diff2.any + }, { + name: "underlay-corner-radius", + type: t4.cornerRadius + }]; + var transition2 = [{ + name: "transition-property", + type: t4.propList + }, { + name: "transition-duration", + type: t4.time + }, { + name: "transition-delay", + type: t4.time + }, { + name: "transition-timing-function", + type: t4.easing + }]; + var nodeSizeHashOverride = /* @__PURE__ */ __name(function nodeSizeHashOverride2(ele, parsedProp) { + if (parsedProp.value === "label") { + return -ele.poolIndex(); } else { - var src = _p.source; - var tgt = _p.target; - var srcDepth = src.zDepth(); - var tgtDepth = tgt.zDepth(); - return Math.max(srcDepth, tgtDepth, 0); + return parsedProp.pfValue; } + }, "nodeSizeHashOverride"); + var nodeBody = [{ + name: "height", + type: t4.nodeSize, + triggersBounds: diff2.any, + hashOverride: nodeSizeHashOverride + }, { + name: "width", + type: t4.nodeSize, + triggersBounds: diff2.any, + hashOverride: nodeSizeHashOverride + }, { + name: "shape", + type: t4.nodeShape, + triggersBounds: diff2.any + }, { + name: "shape-polygon-points", + type: t4.polygonPointList, + triggersBounds: diff2.any + }, { + name: "corner-radius", + type: t4.cornerRadius + }, { + name: "background-color", + type: t4.color + }, { + name: "background-fill", + type: t4.fill + }, { + name: "background-opacity", + type: t4.zeroOneNumber + }, { + name: "background-blacken", + type: t4.nOneOneNumber + }, { + name: "background-gradient-stop-colors", + type: t4.colors + }, { + name: "background-gradient-stop-positions", + type: t4.percentages + }, { + name: "background-gradient-direction", + type: t4.gradientDirection + }, { + name: "padding", + type: t4.sizeMaybePercent, + triggersBounds: diff2.any + }, { + name: "padding-relative-to", + type: t4.paddingRelativeTo, + triggersBounds: diff2.any + }, { + name: "bounds-expansion", + type: t4.boundsExpansion, + triggersBounds: diff2.any + }]; + var nodeBorder = [{ + name: "border-color", + type: t4.color + }, { + name: "border-opacity", + type: t4.zeroOneNumber + }, { + name: "border-width", + type: t4.size, + triggersBounds: diff2.any + }, { + name: "border-style", + 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: t4.color + }, { + name: "outline-opacity", + type: t4.zeroOneNumber + }, { + name: "outline-width", + type: t4.size, + triggersBounds: diff2.any + }, { + name: "outline-style", + type: t4.borderStyle + }, { + name: "outline-offset", + type: t4.size, + triggersBounds: diff2.any + }]; + var backgroundImage = [{ + name: "background-image", + type: t4.urls + }, { + name: "background-image-crossorigin", + type: t4.bgCrossOrigin + }, { + name: "background-image-opacity", + type: t4.zeroOneNumbers + }, { + name: "background-image-containment", + type: t4.bgContainment + }, { + name: "background-image-smoothing", + type: t4.bools + }, { + name: "background-position-x", + type: t4.bgPos + }, { + name: "background-position-y", + type: t4.bgPos + }, { + name: "background-width-relative-to", + type: t4.bgRelativeTo + }, { + name: "background-height-relative-to", + type: t4.bgRelativeTo + }, { + name: "background-repeat", + type: t4.bgRepeat + }, { + name: "background-fit", + type: t4.bgFit + }, { + name: "background-clip", + type: t4.bgClip + }, { + name: "background-width", + type: t4.bgWH + }, { + name: "background-height", + type: t4.bgWH + }, { + name: "background-offset-x", + type: t4.bgPos + }, { + name: "background-offset-y", + type: t4.bgPos + }]; + var compound = [{ + name: "position", + type: t4.position, + triggersBounds: diff2.any + }, { + name: "compound-sizing-wrt-labels", + type: t4.compoundIncludeLabels, + triggersBounds: diff2.any + }, { + name: "min-width", + type: t4.size, + triggersBounds: diff2.any + }, { + name: "min-width-bias-left", + type: t4.sizeMaybePercent, + triggersBounds: diff2.any + }, { + name: "min-width-bias-right", + type: t4.sizeMaybePercent, + triggersBounds: diff2.any + }, { + name: "min-height", + type: t4.size, + triggersBounds: diff2.any + }, { + name: "min-height-bias-top", + type: t4.sizeMaybePercent, + triggersBounds: diff2.any + }, { + name: "min-height-bias-bottom", + type: t4.sizeMaybePercent, + triggersBounds: diff2.any + }]; + var edgeLine = [{ + name: "line-style", + type: t4.lineStyle + }, { + name: "line-color", + type: t4.color + }, { + name: "line-fill", + type: t4.fill + }, { + name: "line-cap", + type: t4.lineCap + }, { + name: "line-opacity", + type: t4.zeroOneNumber + }, { + name: "line-dash-pattern", + type: t4.numbers + }, { + name: "line-dash-offset", + type: t4.number + }, { + name: "line-outline-width", + type: t4.size + }, { + name: "line-outline-color", + type: t4.color + }, { + name: "line-gradient-stop-colors", + type: t4.colors + }, { + name: "line-gradient-stop-positions", + type: t4.percentages + }, { + name: "curve-style", + type: t4.curveStyle, + triggersBounds: diff2.any, + triggersBoundsOfParallelBeziers: true + }, { + name: "haystack-radius", + type: t4.zeroOneNumber, + triggersBounds: diff2.any + }, { + name: "source-endpoint", + type: t4.edgeEndpoint, + triggersBounds: diff2.any + }, { + name: "target-endpoint", + type: t4.edgeEndpoint, + triggersBounds: diff2.any + }, { + name: "control-point-step-size", + type: t4.size, + triggersBounds: diff2.any + }, { + name: "control-point-distances", + type: t4.bidirectionalSizes, + triggersBounds: diff2.any + }, { + name: "control-point-weights", + type: t4.numbers, + triggersBounds: diff2.any + }, { + name: "segment-distances", + type: t4.bidirectionalSizes, + triggersBounds: diff2.any + }, { + name: "segment-weights", + 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: t4.bidirectionalSizeMaybePercent, + triggersBounds: diff2.any + }, { + name: "taxi-turn-min-distance", + type: t4.size, + triggersBounds: diff2.any + }, { + name: "taxi-direction", + type: t4.axisDirection, + triggersBounds: diff2.any + }, { + name: "taxi-radius", + type: t4.number, + triggersBounds: diff2.any + }, { + name: "edge-distances", + type: t4.edgeDistances, + triggersBounds: diff2.any + }, { + name: "arrow-scale", + type: t4.positiveNumber, + triggersBounds: diff2.any + }, { + name: "loop-direction", + type: t4.angle, + triggersBounds: diff2.any + }, { + name: "loop-sweep", + type: t4.angle, + triggersBounds: diff2.any + }, { + name: "source-distance-from-node", + type: t4.size, + triggersBounds: diff2.any + }, { + name: "target-distance-from-node", + type: t4.size, + triggersBounds: diff2.any + }]; + var ghost = [{ + name: "ghost", + type: t4.bool, + triggersBounds: diff2.any + }, { + name: "ghost-offset-x", + type: t4.bidirectionalSize, + triggersBounds: diff2.any + }, { + name: "ghost-offset-y", + type: t4.bidirectionalSize, + triggersBounds: diff2.any + }, { + name: "ghost-opacity", + type: t4.zeroOneNumber + }]; + var core4 = [{ + name: "selection-box-color", + type: t4.color + }, { + name: "selection-box-opacity", + type: t4.zeroOneNumber + }, { + name: "selection-box-border-color", + type: t4.color + }, { + name: "selection-box-border-width", + type: t4.size + }, { + name: "active-bg-color", + type: t4.color + }, { + name: "active-bg-opacity", + type: t4.zeroOneNumber + }, { + name: "active-bg-size", + type: t4.size + }, { + name: "outside-texture-bg-color", + type: t4.color + }, { + name: "outside-texture-bg-opacity", + type: t4.zeroOneNumber + }]; + var pie2 = []; + styfn$2.pieBackgroundN = 16; + pie2.push({ + name: "pie-size", + type: t4.sizeMaybePercent + }); + for (var i2 = 1; i2 <= styfn$2.pieBackgroundN; i2++) { + pie2.push({ + name: "pie-" + i2 + "-background-color", + type: t4.color + }); + pie2.push({ + name: "pie-" + i2 + "-background-size", + type: t4.percent + }); + pie2.push({ + name: "pie-" + i2 + "-background-opacity", + type: t4.zeroOneNumber + }); } - }; - 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 edgeArrow = []; + var arrowPrefixes = styfn$2.arrowPrefixes = ["source", "mid-source", "target", "mid-target"]; + [{ + name: "arrow-shape", + type: t4.arrowShape, + triggersBounds: diff2.any + }, { + name: "arrow-color", + type: t4.color + }, { + name: "arrow-fill", + type: t4.arrowFill + }, { + name: "arrow-width", + type: t4.arrowWidth + }].forEach(function(prop2) { + arrowPrefixes.forEach(function(prefix) { + var name = prefix + "-" + prop2.name; + var type3 = prop2.type, triggersBounds = prop2.triggersBounds; + edgeArrow.push({ + name, + type: type3, + triggersBounds + }); }); - 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 + }, {}); + 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: transition2, + visibility, + overlay, + underlay, + ghost, + // labels + commonLabel, + labelDimensions, + mainLabel, + sourceLabel, + targetLabel, + // node props + nodeBody, + nodeBorder, + nodeOutline, + backgroundImage, + pie: pie2, + compound, + // edge props + edgeLine, + edgeArrow, + core: core4 + }; + var propGroupNames = styfn$2.propertyGroupNames = {}; + var propGroupKeys = styfn$2.propertyGroupKeys = Object.keys(propGroups); + propGroupKeys.forEach(function(key) { + propGroupNames[key] = propGroups[key].map(function(prop2) { + return prop2.name; }); - layout3.animations = []; - var calculateSpacing = function calculateSpacing2(spacing, 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) * spacing, - y: (pos.y - center2.y) * spacing - }; - 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; + propGroups[key].forEach(function(prop2) { + return prop2.groupKey = key; + }); + }); + var aliases = styfn$2.aliases = [{ + name: "content", + pointsTo: "label" + }, { + name: "control-point-distance", + pointsTo: "control-point-distances" + }, { + 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" + }, { + name: "padding-left", + pointsTo: "padding" + }, { + name: "padding-right", + pointsTo: "padding" + }, { + name: "padding-top", + pointsTo: "padding" + }, { + name: "padding-bottom", + pointsTo: "padding" + }]; + styfn$2.propertyNames = props.map(function(p3) { + return p3.name; + }); + for (var _i = 0; _i < props.length; _i++) { + var prop = props[_i]; + props[prop.name] = prop; + } + for (var _i2 = 0; _i2 < aliases.length; _i2++) { + var alias = aliases[_i2]; + var pointsToProp = props[alias.pointsTo]; + var aliasProp = { + name: alias.name, + alias: true, + pointsTo: pointsToProp }; - var bb = spacingBb(); - var getFinalPos = memoize$1(function(node3, i4) { - var newPos2 = fnMem(node3, i4); - if (useSpacingFactor) { - var spacing = Math.abs(options2.spacingFactor); - newPos2 = calculateSpacing(spacing, 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 - })); + props.push(aliasProp); + props[alias.name] = aliasProp; } + })(); + styfn$2.getDefaultProperty = function(name) { + return this.getDefaultProperties()[name]; }; - 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; + styfn$2.getDefaultProperties = function() { + var _p = this._private; + if (_p.defaultProperties != null) { + return _p.defaultProperties; } - } - 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(name2, value) { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return this; + var rawProps = extend2({ + // core props + "selection-box-color": "#ddd", + "selection-box-opacity": 0.65, + "selection-box-border-color": "#aaa", + "selection-box-border-width": 1, + "active-bg-color": "black", + "active-bg-opacity": 0.15, + "active-bg-size": 30, + "outside-texture-bg-color": "#000", + "outside-texture-bg-opacity": 0.125, + // common node/edge props + "events": "yes", + "text-events": "no", + "text-valign": "top", + "text-halign": "center", + "text-justification": "auto", + "line-height": 1, + "color": "#000", + "text-outline-color": "#000", + "text-outline-width": 0, + "text-outline-opacity": 1, + "text-opacity": 1, + "text-decoration": "none", + "text-transform": "none", + "text-wrap": "none", + "text-overflow-wrap": "whitespace", + "text-max-width": 9999, + "text-background-color": "#000", + "text-background-opacity": 0, + "text-background-shape": "rectangle", + "text-background-padding": 0, + "text-border-opacity": 0, + "text-border-width": 0, + "text-border-style": "solid", + "text-border-color": "#000", + "font-family": "Helvetica Neue, Helvetica, sans-serif", + "font-style": "normal", + "font-weight": "normal", + "font-size": 16, + "min-zoomed-font-size": 0, + "text-rotation": "none", + "source-text-rotation": "none", + "target-text-rotation": "none", + "visibility": "visible", + "display": "element", + "opacity": 1, + "z-compound-depth": "auto", + "z-index-compare": "auto", + "z-index": 0, + "label": "", + "text-margin-x": 0, + "text-margin-y": 0, + "source-label": "", + "source-text-offset": 0, + "source-text-margin-x": 0, + "source-text-margin-y": 0, + "target-label": "", + "target-text-offset": 0, + "target-text-margin-x": 0, + "target-text-margin-y": 0, + "overlay-opacity": 0, + "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, + "transition-timing-function": "linear", + // node props + "background-blacken": 0, + "background-color": "#999", + "background-fill": "solid", + "background-opacity": 1, + "background-image": "none", + "background-image-crossorigin": "anonymous", + "background-image-opacity": 1, + "background-image-containment": "inside", + "background-image-smoothing": "yes", + "background-position-x": "50%", + "background-position-y": "50%", + "background-offset-x": 0, + "background-offset-y": 0, + "background-width-relative-to": "include-padding", + "background-height-relative-to": "include-padding", + "background-repeat": "no-repeat", + "background-fit": "none", + "background-clip": "node", + "background-width": "auto", + "background-height": "auto", + "border-color": "#000", + "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, + "outline-offset": 0, + "outline-style": "solid", + "height": 30, + "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", + "background-gradient-stop-colors": "#999", + "background-gradient-stop-positions": "0%", + // ghost props + "ghost": "no", + "ghost-offset-y": 0, + "ghost-offset-x": 0, + "ghost-opacity": 0, + // compound props + "padding": 0, + "padding-relative-to": "width", + "position": "origin", + "compound-sizing-wrt-labels": "include", + "min-width": 0, + "min-width-bias-left": 0, + "min-width-bias-right": 0, + "min-height": 0, + "min-height-bias-top": 0, + "min-height-bias-bottom": 0 + }, { + // node pie bg + "pie-size": "100%" + }, [{ + name: "pie-{{i}}-background-color", + value: "black" + }, { + name: "pie-{{i}}-background-size", + value: "0%" + }, { + name: "pie-{{i}}-background-opacity", + value: 1 + }].reduce(function(css, prop2) { + for (var i3 = 1; i3 <= styfn$2.pieBackgroundN; i3++) { + var name2 = prop2.name.replace("{{i}}", i3); + var val2 = prop2.value; + css[name2] = val2; } - var updateTransitions = false; - var style2 = cy.style(); - if (plainObject(name2)) { - var props = name2; - style2.applyBypass(this, props, updateTransitions); - this.emitAndNotify("style"); - } else if (string(name2)) { - if (value === void 0) { - var ele = this[0]; - if (ele) { - return style2.getStylePropertyValue(ele, name2); - } else { - return; - } - } else { - style2.applyBypass(this, name2, value, updateTransitions); - this.emitAndNotify("style"); - } - } else if (name2 === void 0) { - var _ele = this[0]; - if (_ele) { - return style2.getRawStyle(_ele); - } else { - return; - } + return css; + }, {}), { + // edge props + "line-style": "solid", + "line-color": "#999", + "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", + "curve-style": "haystack", + "haystack-radius": 0, + "arrow-scale": 1, + "loop-direction": "-45deg", + "loop-sweep": "-90deg", + "source-distance-from-node": 0, + "target-distance-from-node": 0, + "source-endpoint": "outside-to-node", + "target-endpoint": "outside-to-node", + "line-dash-pattern": [6, 3], + "line-dash-offset": 0 + }, [{ + name: "arrow-shape", + value: "none" + }, { + name: "arrow-color", + value: "#999" + }, { + name: "arrow-fill", + value: "filled" + }, { + name: "arrow-width", + value: 1 + }].reduce(function(css, prop2) { + styfn$2.arrowPrefixes.forEach(function(prefix) { + var name2 = prefix + "-" + prop2.name; + var val2 = prop2.value; + css[name2] = val2; + }); + return css; + }, {})); + var parsedProps = {}; + for (var i2 = 0; i2 < this.properties.length; i2++) { + var prop = this.properties[i2]; + if (prop.pointsTo) { + continue; } - return this; - }, - removeStyle: function removeStyle(names) { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return this; + var name = prop.name; + var val = rawProps[name]; + var parsedProp = this.parse(name, val); + parsedProps[name] = parsedProp; + } + _p.defaultProperties = parsedProps; + return _p.defaultProperties; + }; + styfn$2.addDefaultStylesheet = function() { + this.selector(":parent").css({ + "shape": "rectangle", + "padding": 10, + "background-color": "#eee", + "border-color": "#ccc", + "border-width": 1 + }).selector("edge").css({ + "width": 3 + }).selector(":loop").css({ + "curve-style": "bezier" + }).selector("edge:compound").css({ + "curve-style": "bezier", + "source-endpoint": "outside-to-line", + "target-endpoint": "outside-to-line" + }).selector(":selected").css({ + "background-color": "#0169D9", + "line-color": "#0169D9", + "source-arrow-color": "#0169D9", + "target-arrow-color": "#0169D9", + "mid-source-arrow-color": "#0169D9", + "mid-target-arrow-color": "#0169D9" + }).selector(":parent:selected").css({ + "background-color": "#CCE1F9", + "border-color": "#aec8e5" + }).selector(":active").css({ + "overlay-color": "black", + "overlay-padding": 10, + "overlay-opacity": 0.25 + }); + this.defaultLength = this.length; + }; + styfn$1 = {}; + styfn$1.parse = function(name, value2, propIsBypass, propIsFlat) { + var self2 = this; + if (fn$6(value2)) { + return self2.parseImplWarn(name, value2, propIsBypass, propIsFlat); + } + var flatKey = propIsFlat === "mapping" || propIsFlat === true || propIsFlat === false || propIsFlat == null ? "dontcare" : propIsFlat; + var bypassKey = propIsBypass ? "t" : "f"; + var valueKey = "" + value2; + var argHash = hashStrings(name, valueKey, bypassKey, flatKey); + var propCache = self2.propCache = self2.propCache || []; + var ret; + if (!(ret = propCache[argHash])) { + ret = propCache[argHash] = self2.parseImplWarn(name, value2, propIsBypass, propIsFlat); + } + if (propIsBypass || propIsFlat === "mapping") { + ret = copy4(ret); + if (ret) { + ret.value = copy4(ret.value); } - 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 _i = 0; _i < eles.length; _i++) { - var _ele2 = eles[_i]; - style.removeBypasses(_ele2, names, updateTransitions); - } + } + return ret; + }; + styfn$1.parseImplWarn = function(name, value2, propIsBypass, propIsFlat) { + var prop = this.parseImpl(name, value2, propIsBypass, propIsFlat); + if (!prop && value2 != null) { + warn("The style property `".concat(name, ": ").concat(value2, "` is invalid")); + } + if (prop && (prop.name === "width" || prop.name === "height") && value2 === "label") { + warn("The style value of `label` is deprecated for `" + prop.name + "`"); + } + return prop; + }; + styfn$1.parseImpl = function(name, value2, propIsBypass, propIsFlat) { + var self2 = this; + name = camel2dash(name); + var property2 = self2.properties[name]; + var passedValue = value2; + var types = self2.types; + if (!property2) { + return null; + } + if (value2 === void 0) { + return null; + } + if (property2.alias) { + property2 = property2.pointsTo; + name = property2.name; + } + var valueIsString = string(value2); + if (valueIsString) { + value2 = value2.trim(); + } + var type3 = property2.type; + if (!type3) { + return null; + } + if (propIsBypass && (value2 === "" || value2 === null)) { + return { + name, + value: value2, + bypass: true, + deleteBypass: true + }; + } + if (fn$6(value2)) { + return { + name, + value: value2, + strValue: "fn", + mapped: types.fn, + bypass: propIsBypass + }; + } + 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; } - 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 mapped = types.data; + return { + name, + value: data5, + strValue: "" + value2, + mapped, + 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; } - 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; + if (type3.multiple) { + return false; } - }, - transparent: function transparent() { - var cy = this.cy(); - if (!cy.styleEnabled()) { + var _mapped = types.mapData; + if (!(type3.color || type3.number)) { 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; - } + var valueMin = this.parse(name, mapData[4]); + if (!valueMin || valueMin.mapped) { + return false; } - }, - backgrounding: function backgrounding() { - var cy = this.cy(); - if (!cy.styleEnabled()) { + var valueMax = this.parse(name, mapData[5]); + if (!valueMax || valueMax.mapped) { 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)) { + 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 (type3.color) { + var c1 = valueMin.value; + 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; } } + return { + name, + value: mapData, + strValue: "" + value2, + mapped: _mapped, + field: mapData[1], + fieldMin: parseFloat(mapData[2]), + // min & max are numeric + fieldMax: parseFloat(mapData[3]), + valueMin: valueMin.value, + valueMax: valueMax.value, + bypass: propIsBypass + }; } - 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; + if (type3.multiple && propIsFlat !== "multiple") { + var vals; + if (valueIsString) { + vals = value2.split(/\s+/); + } else if (array2(value2)) { + vals = value2; + } else { + vals = [value2]; } - 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); + if (type3.evenMultiple && vals.length % 2 !== 0) { + return null; + } + var valArr = []; + var unitsArr = []; + var pfValArr = []; + var strVal = ""; + var hasEnum = false; + 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 (type3.singleEnum && hasEnum) { + if (valArr.length === 1 && string(valArr[0])) { + return { + name, + value: valArr[0], + strValue: valArr[0], + bypass: propIsBypass + }; } else { - var src = _p.source; - var tgt = _p.target; - return edgeOkViaNode(src) && (!hasCompoundNodes || checkCompound(src, edgeOkViaNode)) && (src === tgt || edgeOkViaNode(tgt) && (!hasCompoundNodes || checkCompound(tgt, edgeOkViaNode))); + return null; } } - }; - } - 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 { + name, + value: valArr, + pfValue: pfValArr, + strValue: strVal, + bypass: propIsBypass, + units: unitsArr + }; } - 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); + 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, + value: value2, + strValue: "" + value2, + bypass: propIsBypass + }; } } - 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]; + return null; + }, "checkEnums"); + if (type3.number) { + var units; + var implicitUnits = "px"; + if (type3.units) { + units = type3.units; } - }; - 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); - } + if (type3.implicitUnits) { + implicitUnits = type3.implicitUnits; } - 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); + if (!type3.unitless) { + if (valueIsString) { + var unitsRegex = "px|em" + (type3.allowPercent ? "|\\%" : ""); + if (units) { + unitsRegex = units; } - } - } - 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; + var match2 = value2.match("^(" + number6 + ")(" + unitsRegex + ")?$"); + if (match2) { + value2 = match2[1]; + units = match2[2] || implicitUnits; } + } else if (!units || type3.implicitUnits) { + units = implicitUnits; } - 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]); - } + value2 = parseFloat(value2); + if (isNaN(value2) && type3.enums === void 0) { + return null; } - 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(); + if (isNaN(value2) && type3.enums !== void 0) { + value2 = passedValue; + return checkEnums(); } - 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(); + if (type3.integer && !integer2(value2)) { + return null; } - 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); - } + 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; } - 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 (string(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); - } + var ret = { + name, + value: value2, + strValue: "" + value2 + (units ? units : ""), + units, + bypass: propIsBypass + }; + if (type3.unitless || units !== "px" && units !== "em") { + ret.pfValue = value2; + } else { + ret.pfValue = units === "px" || !units ? value2 : this.getEmSizeInPixels() * value2; } - 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); - } + if (units === "ms" || units === "s") { + ret.pfValue = units === "ms" ? value2 : 1e3 * value2; } - 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]); + if (units === "deg" || units === "rad") { + ret.pfValue = units === "rad" ? value2 : deg2rad(value2); } - 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(); + if (units === "%") { + ret.pfValue = value2 / 100; + } + return ret; + } else if (type3.propList) { + var props = []; + var propsStr = "" + value2; + if (propsStr === "none") ; + else { + var propsSplit = propsStr.split(/\s*,\s*|\s+/); + for (var _i2 = 0; _i2 < propsSplit.length; _i2++) { + var propName = propsSplit[_i2].trim(); + if (self2.properties[propName]) { + props.push(propName); + } else { + warn("`" + propName + "` is not a valid property name"); + } + } + if (props.length === 0) { + return null; + } } - var visitInComponent = function visitInComponent2(node2, component) { - visited.merge(node2); - unvisited.unmerge(node2); - component.merge(node2); + return { + name, + value: props, + strValue: props.length === 0 ? "none" : props.join(" "), + bypass: propIsBypass }; - if (unvisited.empty()) { - return self2.spawn(); + } else if (type3.color) { + var tuple = color2tuple(value2); + if (!tuple) { + return null; } - 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); - } - }); - }); + return { + name, + value: tuple, + pfValue: tuple, + strValue: "rgb(" + tuple[0] + "," + tuple[1] + "," + tuple[2] + ")", + // n.b. no spaces b/c of multiple support + bypass: propIsBypass }; - 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]) && !element(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; + } else if (type3.regex || type3.regexes) { + if (type3.enums) { + var enumProp = checkEnums(); + if (enumProp) { + return enumProp; } - var ele = new Element(cy, json2, false); - eles.push(ele); - elesIds.add(_data.id); - } - elements2 = eles; - } - this.length = 0; - for (var _i = 0, _l = elements2.length; _i < _l; _i++) { - var element$1 = elements2[_i][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 - }); + var regexes = type3.regexes ? type3.regexes : [type3.regex]; + for (var _i3 = 0; _i3 < regexes.length; _i3++) { + var regex2 = new RegExp(regexes[_i3]); + var m2 = regex2.exec(value2); + if (m2) { + return { + name, + value: type3.singleRegexMatchValue ? m2[1] : m2, + strValue: "" + value2, + bypass: propIsBypass + }; } - this[this.length] = element$1; - this.length++; } + return null; + } else if (type3.string) { + return { + name, + value: "" + value2, + strValue: "" + value2, + bypass: propIsBypass + }; + } else if (type3.enums) { + return checkEnums(); + } else { + return null; + } + }; + Style2 = /* @__PURE__ */ __name(function Style3(cy) { + if (!(this instanceof Style3)) { + return new Style3(cy); + } + if (!core(cy)) { + error("A style must have a core reference"); + return; } 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 _i2 = 0; _i2 < eles2.length; _i2++) { - var _ele = eles2[_i2]; - m.set(_ele.id(), { - index: _i2, - ele: _ele - }); - } - } + coreStyle: {} }; - 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); + this.length = 0; + this.resetToDefault(); + }, "Style"); + styfn = Style2.prototype; + styfn.instanceString = function() { + return "style"; }; - elesfn$1.spawnSelf = function() { - return this.spawn(this); + styfn.clear = function() { + var _p = this._private; + var cy = _p.cy; + var eles = cy.elements(); + for (var i2 = 0; i2 < this.length; i2++) { + this[i2] = void 0; + } + this.length = 0; + _p.contextStyles = {}; + _p.propDiffs = {}; + this.cleanElements(eles, true); + eles.forEach(function(ele) { + var ele_p = ele[0]._private; + ele_p.styleDirty = true; + ele_p.appliedInitStyle = false; + }); + return this; }; - elesfn$1.cy = function() { - return this._private.cy; + styfn.resetToDefault = function() { + this.clear(); + this.addDefaultStylesheet(); + return this; }; - elesfn$1.renderer = function() { - return this._private.cy.renderer(); + styfn.core = function(propName) { + return this._private.coreStyle[propName] || this.getDefaultProperty(propName); }; - elesfn$1.element = function() { - return this[0]; + styfn.selector = function(selectorStr) { + var selector = selectorStr === "core" ? null : new Selector(selectorStr); + var i2 = this.length++; + this[i2] = { + selector, + properties: [], + mappedProperties: [], + index: i2 + }; + return this; }; - elesfn$1.collection = function() { - if (collection(this)) { - return this; - } else { - return new Collection(this._private.cy, [this]); + styfn.css = function() { + var self2 = this; + var args = arguments; + if (args.length === 1) { + 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 = map5[dash2camel(prop.name)]; + } + if (mapVal !== void 0) { + this.cssRule(prop.name, mapVal); + } + } + } else if (args.length === 2) { + this.cssRule(args[0], args[1]); } + return 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); + styfn.style = styfn.css; + styfn.cssRule = function(name, value2) { + var property2 = this.parse(name, value2); + if (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[i2].mappedProperties.push(property2); + } + var currentSelectorIsCore = !this[i2].selector; + if (currentSelectorIsCore) { + this._private.coreStyle[property2.name] = property2; + } + } + return this; }; - 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); + 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; }; - 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; + Style2.fromJson = function(cy, json3) { + var style3 = new Style2(cy); + style3.fromJson(json3); + return style3; }; - elesfn$1.indexOf = function(ele) { - var id2 = ele[0]._private.data.id; - return this._private.map.get(id2).index; + Style2.fromString = function(cy, string3) { + return new Style2(cy).fromString(string3); }; - elesfn$1.indexOfId = function(id2) { - id2 = "" + id2; - return this._private.map.get(id2).index; + [styfn$8, styfn$7, styfn$6, styfn$5, styfn$4, styfn$3, styfn$2, styfn$1].forEach(function(props) { + extend2(styfn, props); + }); + Style2.types = styfn.types; + Style2.properties = styfn.properties; + Style2.propertyGroups = styfn.propertyGroups; + Style2.propertyGroupNames = styfn.propertyGroupNames; + Style2.propertyGroupKeys = styfn.propertyGroupKeys; + corefn$2 = { + style: /* @__PURE__ */ __name(function style2(newStyle) { + if (newStyle) { + var s2 = this.setStyle(newStyle); + s2.update(); + } + return this._private.style; + }, "style"), + setStyle: /* @__PURE__ */ __name(function setStyle2(style3) { + var _p = this._private; + 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: /* @__PURE__ */ __name(function updateStyle2() { + this.mutableElements().updateStyle(); + }, "updateStyle") }; - elesfn$1.json = function(obj) { - var ele = this.element(); - var cy = this.cy(); - if (ele == null && obj) { + 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; - } - 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; + }, "autolock"), + autoungrabify: /* @__PURE__ */ __name(function autoungrabify(bool2) { + if (bool2 !== void 0) { + this._private.autoungrabify = bool2 ? true : false; + } else { + return this._private.autoungrabify; + } + return this; + }, "autoungrabify"), + autounselectify: /* @__PURE__ */ __name(function autounselectify(bool2) { + if (bool2 !== void 0) { + this._private.autounselectify = bool2 ? true : false; + } else { + return this._private.autounselectify; + } + return this; + }, "autounselectify"), + selectionType: /* @__PURE__ */ __name(function selectionType(selType) { + var _p = this._private; + if (_p.selectionType == null) { + _p.selectionType = defaultSelectionType; + } + if (selType !== void 0) { + if (selType === "additive" || selType === "single") { + _p.selectionType = selType; + } + } else { + return _p.selectionType; + } + return this; + }, "selectionType"), + panningEnabled: /* @__PURE__ */ __name(function panningEnabled(bool2) { + if (bool2 !== void 0) { + this._private.panningEnabled = bool2 ? true : false; + } else { + return this._private.panningEnabled; + } + return this; + }, "panningEnabled"), + userPanningEnabled: /* @__PURE__ */ __name(function userPanningEnabled(bool2) { + if (bool2 !== void 0) { + this._private.userPanningEnabled = bool2 ? true : false; + } else { + return this._private.userPanningEnabled; + } + return this; + }, "userPanningEnabled"), + zoomingEnabled: /* @__PURE__ */ __name(function zoomingEnabled(bool2) { + if (bool2 !== void 0) { + this._private.zoomingEnabled = bool2 ? true : false; + } else { + return this._private.zoomingEnabled; + } + return this; + }, "zoomingEnabled"), + userZoomingEnabled: /* @__PURE__ */ __name(function userZoomingEnabled(bool2) { + if (bool2 !== void 0) { + this._private.userZoomingEnabled = bool2 ? true : false; + } else { + return this._private.userZoomingEnabled; + } + return this; + }, "userZoomingEnabled"), + boxSelectionEnabled: /* @__PURE__ */ __name(function boxSelectionEnabled(bool2) { + if (bool2 !== void 0) { + this._private.boxSelectionEnabled = bool2 ? true : false; + } else { + return this._private.boxSelectionEnabled; + } + return this; + }, "boxSelectionEnabled"), + pan: /* @__PURE__ */ __name(function pan() { + var args = arguments; + var pan2 = this._private.pan; + var dim, val, dims, x5, y5; + switch (args.length) { + case 0: + return pan2; + case 1: + if (string(args[0])) { + dim = args[0]; + return pan2[dim]; + } else if (plainObject(args[0])) { + if (!this._private.panningEnabled) { + return this; + } + dims = args[0]; + x5 = dims.x; + y5 = dims.y; + if (number$1(x5)) { + pan2.x = x5; + } + if (number$1(y5)) { + pan2.y = y5; + } + this.emit("pan viewport"); } - if (tgt != null && tgt != _data2.target) { - spec.target = "" + tgt; - move = true; + break; + case 2: + if (!this._private.panningEnabled) { + return this; } - if (move) { - ele = ele.move(spec); + dim = args[0]; + val = args[1]; + if ((dim === "x" || dim === "y") && number$1(val)) { + pan2[dim] = val; } - } 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; + this.emit("pan viewport"); + break; + } + this.notify("viewport"); + return this; + }, "pan"), + panBy: /* @__PURE__ */ __name(function panBy(arg0, arg1) { + var args = arguments; + var pan2 = this._private.pan; + var dim, val, dims, x5, y5; + if (!this._private.panningEnabled) { + return this; + } + switch (args.length) { + case 1: + if (plainObject(arg0)) { + dims = args[0]; + x5 = dims.x; + y5 = dims.y; + if (number$1(x5)) { + pan2.x += x5; } - if (parent != null) { - parent = "" + parent; + if (number$1(y5)) { + pan2.y += y5; } - ele = ele.move({ - parent - }); + this.emit("pan viewport"); } + break; + case 2: + dim = arg0; + val = arg1; + if ((dim === "x" || dim === "y") && number$1(val)) { + pan2[dim] += val; + } + this.emit("pan viewport"); + break; + } + this.notify("viewport"); + return this; + }, "panBy"), + fit: /* @__PURE__ */ __name(function fit(elements3, padding3) { + var viewportState = this.getFitViewport(elements3, padding3); + if (viewportState) { + var _p = this._private; + _p.zoom = viewportState.zoom; + _p.pan = viewportState.pan; + this.emit("pan zoom viewport"); + this.notify("viewport"); + } + return this; + }, "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 (string(elements3)) { + var sel = elements3; + elements3 = this.$(sel); + } else if (boundingBox(elements3)) { + var bbe = elements3; + bb = { + x1: bbe.x1, + y1: bbe.y1, + x2: bbe.x2, + y2: bbe.y2 + }; + bb.w = bb.x2 - bb.x1; + bb.h = bb.y2 - bb.y1; + } else if (!elementOrCollection(elements3)) { + elements3 = this.mutableElements(); + } + if (elementOrCollection(elements3) && elements3.empty()) { + return; + } + 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: (w3 - zoom2 * (bb.x1 + bb.x2)) / 2, + y: (h2 - zoom2 * (bb.y1 + bb.y2)) / 2 + }; + return { + zoom: zoom2, + pan: pan2 + }; + } + return; + }, "getFitViewport"), + zoomRange: /* @__PURE__ */ __name(function zoomRange(min9, max10) { + var _p = this._private; + 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; + }, "zoomRange"), + minZoom: /* @__PURE__ */ __name(function minZoom(zoom2) { + if (zoom2 === void 0) { + return this._private.minZoom; + } else { + return this.zoomRange({ + min: zoom2 + }); + } + }, "minZoom"), + maxZoom: /* @__PURE__ */ __name(function maxZoom(zoom2) { + if (zoom2 === void 0) { + return this._private.maxZoom; + } else { + return this.zoomRange({ + max: zoom2 + }); + } + }, "maxZoom"), + getZoomedViewport: /* @__PURE__ */ __name(function getZoomedViewport(params) { + var _p = this._private; + var currentPan = _p.pan; + var currentZoom = _p.zoom; + var pos; + var zoom2; + var bail = false; + if (!_p.zoomingEnabled) { + bail = true; + } + if (number$1(params)) { + zoom2 = params; + } else if (plainObject(params)) { + zoom2 = params.level; + if (params.position != null) { + pos = modelToRenderedPosition(params.position, currentZoom, currentPan); + } else if (params.renderedPosition != null) { + pos = params.renderedPosition; + } + if (pos != null && !_p.panningEnabled) { + bail = true; } } - if (obj.position) { - ele.position(obj.position); + 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; } - 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](); - } + if (pos != null) { + var pan1 = currentPan; + var zoom1 = currentZoom; + var zoom22 = zoom2; + var pan2 = { + x: -zoom22 / zoom1 * (pos.x - pan1.x) + pos.x, + y: -zoom22 / zoom1 * (pos.y - pan1.y) + pos.y + }; + return { + zoomed: true, + panned: true, + zoom: zoom22, + pan: pan2 + }; + } else { + return { + zoomed: true, + panned: false, + zoom: zoom2, + pan: currentPan + }; + } + }, "getZoomedViewport"), + zoom: /* @__PURE__ */ __name(function zoom(params) { + if (params === void 0) { + return this._private.zoom; + } else { + var vp = this.getZoomedViewport(params); + var _p = this._private; + if (vp == null || !vp.zoomed) { + return this; + } + _p.zoom = vp.zoom; + if (vp.panned) { + _p.pan.x = vp.pan.x; + _p.pan.y = vp.pan.y; + } + this.emit("zoom" + (vp.panned ? " pan" : "") + " viewport"); + this.notify("viewport"); + return this; + } + }, "zoom"), + viewport: /* @__PURE__ */ __name(function viewport(opts) { + var _p = this._private; + var zoomDefd = true; + var panDefd = true; + var events = []; + var zoomFailed = false; + var panFailed = false; + if (!opts) { + return this; + } + if (!number$1(opts.zoom)) { + zoomDefd = false; + } + if (!plainObject(opts.pan)) { + panDefd = false; + } + if (!zoomDefd && !panDefd) { + return this; + } + if (zoomDefd) { + var z2 = opts.zoom; + if (z2 < _p.minZoom || z2 > _p.maxZoom || !_p.zoomingEnabled) { + zoomFailed = true; + } else { + _p.zoom = z2; + events.push("zoom"); + } + } + if (panDefd && (!zoomFailed || !opts.cancelOnFailedZoom) && _p.panningEnabled) { + var p3 = opts.pan; + if (number$1(p3.x)) { + _p.pan.x = p3.x; + panFailed = false; + } + if (number$1(p3.y)) { + _p.pan.y = p3.y; + panFailed = false; + } + if (!panFailed) { + events.push("pan"); } + } + if (events.length > 0) { + events.push("viewport"); + this.emit(events.join(" ")); + this.notify("viewport"); + } + return this; + }, "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; + }, "center"), + getCenterPan: /* @__PURE__ */ __name(function getCenterPan(elements3, zoom2) { + if (!this._private.panningEnabled) { + return; + } + if (string(elements3)) { + var selector = elements3; + elements3 = this.mutableElements().filter(selector); + } else if (!elementOrCollection(elements3)) { + elements3 = this.mutableElements(); + } + if (elements3.length === 0) { + return; + } + var bb = elements3.boundingBox(); + var w3 = this.width(); + var h2 = this.height(); + zoom2 = zoom2 === void 0 ? this._private.zoom : zoom2; + var pan2 = { + // middle + x: (w3 - zoom2 * (bb.x1 + bb.x2)) / 2, + y: (h2 - zoom2 * (bb.y1 + bb.y2)) / 2 }; - 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); + return pan2; + }, "getCenterPan"), + reset: /* @__PURE__ */ __name(function reset3() { + if (!this._private.panningEnabled || !this._private.zoomingEnabled) { + return this; } - cy.endBatch(); + this.viewport({ + pan: { + x: 0, + y: 0 + }, + zoom: 1 + }); 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; + }, "reset"), + invalidateSize: /* @__PURE__ */ __name(function invalidateSize() { + this._private.sizeCache = null; + }, "invalidateSize"), + size: /* @__PURE__ */ __name(function size4() { + var _p = this._private; + var container2 = _p.container; + var cy = this; + 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: 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 }); - return json2; - } + }, "size"), + width: /* @__PURE__ */ __name(function width2() { + return this.size().width; + }, "width"), + height: /* @__PURE__ */ __name(function height() { + return this.size().height; + }, "height"), + extent: /* @__PURE__ */ __name(function extent() { + var pan2 = this._private.pan; + var zoom2 = this._private.zoom; + var rb = this.renderedExtent(); + 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 + }; + 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: width3, + y2: height2, + w: width3, + h: height2 + }; + }, "renderedExtent"), + multiClickDebounceTime: /* @__PURE__ */ __name(function multiClickDebounceTime(_int) { + if (_int) this._private.multiClickDebounceTime = _int; + else return this._private.multiClickDebounceTime; + return this; + }, "multiClickDebounceTime") }; - 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; + corefn$1.centre = corefn$1.center; + corefn$1.autolockNodes = corefn$1.autolock; + corefn$1.autoungrabifyNodes = corefn$1.autoungrabify; + fn2 = { + data: define2.data({ + field: "data", + bindingEvent: "data", + allowBinding: true, + allowSetting: true, + settingEvent: "data", + settingTriggersEvent: true, + triggerFnName: "trigger", + allowGetting: true, + updateStyle: true + }), + removeData: define2.removeData({ + field: "data", + event: "data", + triggerFnName: "trigger", + triggerEvent: 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 + }) }; - 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); + fn2.attr = fn2.data; + fn2.removeAttr = fn2.removeData; + Core = /* @__PURE__ */ __name(function Core2(opts) { + var cy = this; + opts = extend2({}, opts); + var container2 = opts.container; + if (container2 && !htmlElement(container2) && htmlElement(container2[0])) { + container2 = container2[0]; } - 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 _i3 = 0, l = self2.length; _i3 < l; _i3++) { - var ele = self2[_i3]; - if (addToPool && !ele.removed()) { - continue; + var reg = container2 ? container2._cyreg : null; + reg = reg || {}; + if (reg && reg.cy) { + reg.cy.destroy(); + reg = {}; + } + var readies = reg.readies = reg.readies || []; + if (container2) { + container2._cyreg = reg; + } + reg.cy = cy; + var head2 = _window !== void 0 && container2 !== void 0 && !opts.headless; + var options3 = opts; + options3.layout = extend2({ + name: head2 ? "grid" : "null" + }, options3.layout); + options3.renderer = extend2({ + name: head2 ? "canvas" : "null" + }, 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 def2; } - if (ele.isNode()) { - nodes2.push(ele); + }, "defVal"); + var _p = this._private = { + container: container2, + // html dom ele container + ready: false, + // whether ready has been triggered + options: options3, + // cached options + elements: new Collection(this), + // elements in the graph + listeners: [], + // list of listeners + aniEles: new Collection(this), + // elements being animated + data: options3.data || {}, + // data for the core + scratch: {}, + // scratch object for core + layout: null, + renderer: null, + destroyed: false, + // whether destroy was called + notificationsEnabled: true, + // whether notifications are sent to the renderer + minZoom: 1e-50, + maxZoom: 1e50, + 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(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 + current: [], + queue: [] + }, + hasCompoundNodes: false, + multiClickDebounceTime: defVal(250, options3.multiClickDebounceTime) + }; + this.createEmitter(); + this.selectionType(options3.selectionType); + this.zoomRange({ + min: options3.minZoom, + max: options3.maxZoom + }); + var loadExtData = /* @__PURE__ */ __name(function loadExtData2(extData, next3) { + var anyIsPromise = extData.some(promise); + if (anyIsPromise) { + return Promise$1.all(extData).then(next3); } else { - edges2.push(ele); + next3(extData); } + }, "loadExtData"); + if (_p.styleEnabled) { + cy.setStyle([]); } - 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) || !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 rendererOptions = extend2({}, options3, options3.renderer); + cy.initRenderer(rendererOptions); + var setElesAndLayout = /* @__PURE__ */ __name(function setElesAndLayout2(elements3, onload, ondone) { + cy.notifications(false); + var oldEles = cy.mutableElements(); + if (oldEles.length > 0) { + oldEles.remove(); } - 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 (elements3 != null) { + if (plainObject(elements3) || array2(elements3)) { + cy.add(elements3); } } - 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; - } + cy.one("layoutready", function(e3) { + cy.notifications(true); + cy.emit(e3); + cy.one("load", onload); + cy.emitAndNotify("load"); + }).one("layoutstop", function() { + cy.one("done", ondone); + cy.emit("done"); + }); + var layoutOpts = extend2({}, cy._private.options.layout); + layoutOpts.eles = cy.elements(); + cy.layout(layoutOpts).run(); + }, "setElesAndLayout"); + loadExtData([options3.style, options3.elements], function(thens) { + var initStyle = thens[0]; + var initEles = thens[1]; + if (_p.styleEnabled) { + cy.style().append(initStyle); + } + setElesAndLayout(initEles, function() { + cy.startAnimationLoop(); + _p.ready = true; + if (fn$6(options3.ready)) { + cy.on("ready", options3.ready); } - if (badSourceOrTarget) { - removeFromElements(); - continue; + for (var i2 = 0; i2 < readies.length; i2++) { + var fn3 = readies[i2]; + cy.on("ready", fn3); } - 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); + if (reg) { + reg.readies = []; } - edge._private.source = src; - edge._private.target = tgt; + cy.emit("ready"); + }, options3.done); + }); + }, "Core"); + corefn = Core.prototype; + extend2(corefn, { + instanceString: /* @__PURE__ */ __name(function instanceString3() { + return "core"; + }, "instanceString"), + isReady: /* @__PURE__ */ __name(function isReady() { + return this._private.ready; + }, "isReady"), + destroyed: /* @__PURE__ */ __name(function destroyed() { + return this._private.destroyed; + }, "destroyed"), + ready: /* @__PURE__ */ __name(function ready(fn3) { + if (this.isReady()) { + this.emitter().emit("ready", [], fn3); + } else { + this.on("ready", fn3); } - _private.map = new Map$22(); - _private.map.set(id2, { - ele: _ele2, - index: 0 - }); - _private.removed = false; - if (addToPool) { - cy.addToPool(_ele2); + return this; + }, "ready"), + destroy: /* @__PURE__ */ __name(function destroy() { + var cy = this; + if (cy.destroyed()) return; + cy.stopAnimationLoop(); + cy.destroyRenderer(); + this.emit("destroy"); + cy._private.destroyed = true; + return cy; + }, "destroy"), + hasElementWithId: /* @__PURE__ */ __name(function hasElementWithId(id27) { + return this._private.elements.hasElementWithId(id27); + }, "hasElementWithId"), + getElementById: /* @__PURE__ */ __name(function getElementById2(id27) { + return this._private.elements.getElementById(id27); + }, "getElementById"), + hasCompoundNodes: /* @__PURE__ */ __name(function hasCompoundNodes() { + return this._private.hasCompoundNodes; + }, "hasCompoundNodes"), + headless: /* @__PURE__ */ __name(function headless() { + return this._private.renderer.isHeadless(); + }, "headless"), + styleEnabled: /* @__PURE__ */ __name(function styleEnabled() { + return this._private.styleEnabled; + }, "styleEnabled"), + addToPool: /* @__PURE__ */ __name(function addToPool(eles) { + this._private.elements.merge(eles); + return this; + }, "addToPool"), + removeFromPool: /* @__PURE__ */ __name(function removeFromPool(eles) { + this._private.elements.unmerge(eles); + return this; + }, "removeFromPool"), + container: /* @__PURE__ */ __name(function container() { + return this._private.container || null; + }, "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; + }, "window"), + mount: /* @__PURE__ */ __name(function mount(container2) { + if (container2 == null) { + return; } - } - for (var _i4 = 0; _i4 < nodes2.length; _i4++) { - var node2 = nodes2[_i4]; - var _data4 = node2._private.data; - if (number$12(_data4.parent)) { - _data4.parent = "" + _data4.parent; + var cy = this; + var _p = cy._private; + var options3 = _p.options; + if (!htmlElement(container2) && htmlElement(container2[0])) { + container2 = container2[0]; } - 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; + cy.stopAnimationLoop(); + cy.destroyRenderer(); + _p.container = container2; + _p.styleEnabled = true; + cy.invalidateSize(); + cy.initRenderer(extend2({}, options3, options3.renderer, { + // allow custom renderer name to be re-used, otherwise use canvas + name: options3.renderer.name === "null" ? "canvas" : options3.renderer.name + })); + cy.startAnimationLoop(); + cy.style(options3.style); + cy.emit("mount"); + return cy; + }, "mount"), + unmount: /* @__PURE__ */ __name(function unmount() { + var cy = this; + cy.stopAnimationLoop(); + cy.destroyRenderer(); + cy.initRenderer({ + name: "null" + }); + cy.emit("unmount"); + return cy; + }, "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 = /* @__PURE__ */ __name(function getFreshRef2(ele) { + return cy.getElementById(ele.id()); + }, "getFreshRef"); + if (plainObject(obj)) { + cy.startBatch(); + if (obj.elements) { + var idInJson = {}; + var updateEles = /* @__PURE__ */ __name(function updateEles2(jsons, gr2) { + var toAdd = []; + var toMod = []; + 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 id27 = "" + json4.data.id; + var ele = cy.getElementById(id27); + idInJson[id27] = true; + if (ele.length !== 0) { + toMod.push({ + ele, + json: json4 + }); + } else { + if (gr2) { + json4.group = gr2; + toAdd.push(json4); + } else { + toAdd.push(json4); + } + } + } + cy.add(toAdd); + 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 i2 = 0; i2 < grs.length; i2++) { + var gr = grs[i2]; + var elements3 = obj.elements[gr]; + if (array2(elements3)) { + updateEles(elements3, gr); + } } - ancestor = ancestor.parent(); } - if (!selfAsParent) { - parent[0]._private.children.push(node2); - node2._private.parent = parent[0]; - cy_p.hasCompoundNodes = true; + var parentsToRemove = cy.collection(); + eles.filter(function(ele) { + return !idInJson[ele.id()]; + }).forEach(function(ele) { + if (ele.isParent()) { + parentsToRemove.merge(ele); + } else { + ele.remove(); + } + }); + parentsToRemove.forEach(function(ele) { + return ele.children().move({ + parent: null + }); + }); + parentsToRemove.forEach(function(ele) { + return getFreshRef(ele).remove(); + }); + } + if (obj.style) { + cy.style(obj.style); + } + if (obj.zoom != null && obj.zoom !== _p.zoom) { + cy.zoom(obj.zoom); + } + if (obj.pan) { + if (obj.pan.x !== _p.pan.x || obj.pan.y !== _p.pan.y) { + cy.pan(obj.pan); } } - } - } - if (elements2.length > 0) { - var restored = elements2.length === self2.length ? self2 : new Collection(cy, elements2); - for (var _i5 = 0; _i5 < restored.length; _i5++) { - var _ele3 = restored[_i5]; - if (_ele3.isNode()) { - continue; + if (obj.data) { + cy.data(obj.data); } - _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()); + var fields = ["minZoom", "maxZoom", "zoomingEnabled", "userZoomingEnabled", "panningEnabled", "userPanningEnabled", "boxSelectionEnabled", "autolock", "autoungrabify", "autounselectify", "multiClickDebounceTime"]; + for (var _i2 = 0; _i2 < fields.length; _i2++) { + var f3 = fields[_i2]; + if (obj[f3] != null) { + cy[f3](obj[f3]); + } + } + cy.endBatch(); + return this; } else { - toUpdateStyle = restored; - } - toUpdateStyle.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(notifyRenderer); - if (notifyRenderer) { - restored.emitAndNotify("add"); - } else if (addToPool) { - restored.emit("add"); + var flat = !!obj; + var json3 = {}; + if (flat) { + json3.elements = this.elements().map(function(ele) { + return ele.json(); + }); + } else { + json3.elements = {}; + eles.forEach(function(ele) { + var group2 = ele.group(); + if (!json3.elements[group2]) { + json3.elements[group2] = []; + } + json3.elements[group2].push(ele.json()); + }); + } + if (this._private.styleEnabled) { + json3.style = cy.style().json(); + } + json3.data = copy4(cy.data()); + var options3 = _p.options; + json3.zoomingEnabled = _p.zoomingEnabled; + json3.userZoomingEnabled = _p.userZoomingEnabled; + json3.zoom = _p.zoom; + json3.minZoom = _p.minZoom; + json3.maxZoom = _p.maxZoom; + json3.panningEnabled = _p.panningEnabled; + json3.userPanningEnabled = _p.userPanningEnabled; + json3.pan = copy4(_p.pan); + json3.boxSelectionEnabled = _p.boxSelectionEnabled; + 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; } - } - return self2; - }; - elesfn$1.removed = function() { - var ele = this[0]; - return ele && ele._private.removed; + }, "json") + }); + corefn.$id = corefn.getElementById; + [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); + }); + defaults$7 = { + fit: true, + // whether to fit the viewport to the graph + directed: false, + // whether the tree is directed downwards (or edges can point in any direction if false) + padding: 30, + // padding on fit + circle: false, + // put depths in concentric circles if true, put depths top down if false + grid: false, + // whether to create an even grid into which the DAG is placed (circle:false only) + spacingFactor: 1.75, + // positive spacing factor, larger => more space between nodes (N.B. n/a if causes overlap) + boundingBox: void 0, + // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + avoidOverlap: true, + // prevents node overlap, may overflow boundingBox if not enough space + nodeDimensionsIncludeLabels: false, + // Excludes the label when calculating node bounding boxes for the layout algorithm + roots: void 0, + // the roots of the trees + depthSort: void 0, + // a sorting function to order nodes at equal depth. e.g. function(a, b){ return a.data('weight') - b.data('weight') } + 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: /* @__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: /* @__PURE__ */ __name(function transform2(node2, position5) { + return position5; + }, "transform") + // transform a given node position. Useful for changing flow direction in discrete layouts }; - elesfn$1.inside = function() { - var ele = this[0]; - return ele && !ele._private.removed; + 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 }; - 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]); + getInfo = /* @__PURE__ */ __name(function getInfo2(ele) { + return ele.scratch("breadthfirst"); + }, "getInfo"); + setInfo = /* @__PURE__ */ __name(function setInfo2(ele, obj) { + return ele.scratch("breadthfirst", obj); + }, "setInfo"); + __name(BreadthFirstLayout, "BreadthFirstLayout"); + BreadthFirstLayout.prototype.run = function() { + var params = this.options; + var options3 = params; + var cy = params.cy; + var eles = options3.eles; + var nodes6 = eles.nodes().filter(function(n3) { + return !n3.isParent(); + }); + var graph = eles; + 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(options3.roots)) { + roots = options3.roots; + } else if (array2(options3.roots)) { + var rootsArray = []; + for (var i2 = 0; i2 < options3.roots.length; i2++) { + var id27 = options3.roots[i2]; + var ele = cy.getElementById(id27); + rootsArray.push(ele); + } + roots = cy.collection(rootsArray); + } else if (string(options3.roots)) { + roots = cy.$(options3.roots); + } else { + if (directed) { + roots = nodes6.roots(); + } else { + var components3 = eles.components(); + roots = cy.collection(); + 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); + }, "_loop"); + for (var _i = 0; _i < components3.length; _i++) { + _loop(_i); + } } } - function addChildren2(node2) { - var children2 = node2._private.children; - for (var i4 = 0; i4 < children2.length; i4++) { - add(children2[i4]); + var depths = []; + var foundByBfs = {}; + 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 + }); + }, "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: options3.directed, + visit: /* @__PURE__ */ __name(function visit(node2, edge, pNode, i3, depth) { + var ele2 = node2[0]; + var id28 = ele2.id(); + addToDepth(ele2, depth); + foundByBfs[id28] = true; + }, "visit") + }); + var orphanNodes = []; + for (var _i2 = 0; _i2 < nodes6.length; _i2++) { + var _ele = nodes6[_i2]; + if (foundByBfs[_ele.id()]) { + continue; + } else { + orphanNodes.push(_ele); + } + } + 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(j2, 1); + j2--; + continue; + } + setInfo(_ele2, { + depth: i3, + index: j2 + }); + } + }, "assignDepthsAt"); + var assignDepths = /* @__PURE__ */ __name(function assignDepths2() { + for (var _i3 = 0; _i3 < depths.length; _i3++) { + assignDepthsAt(_i3); + } + }, "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 id28 = ele2.id(); + for (var k2 = 0; k2 < incomers.length; k2++) { + var incmr = incomers[k2]; + var iInfo = getInfo(incmr); + maxDepth = Math.max(maxDepth, iInfo.depth); } - } - function add(ele2) { - var alreadyAdded = elesToRemoveIds[ele2.id()]; - if (removeFromPool && ele2.removed() || alreadyAdded) { - return; - } else { - elesToRemoveIds[ele2.id()] = true; + if (eInfo.depth <= maxDepth) { + if (!options3.acyclic && shifted2[id28]) { + return null; + } + var newDepth = maxDepth + 1; + changeDepth(ele2, newDepth); + shifted2[id28] = newDepth; + return true; } - if (ele2.isNode()) { - elesToRemove.push(ele2); - addConnectedEdges(ele2); - addChildren2(ele2); - } else { - elesToRemove.unshift(ele2); + return false; + }, "adjustMaximally"); + if (directed && maximal) { + var Q2 = []; + var shifted = {}; + 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 (Q2.length > 0) { + var _ele3 = dequeue(); + var didShift = adjustMaximally(_ele3, shifted); + if (didShift) { + _ele3.outgoers().filter(function(el) { + return el.isNode() && eles.has(el); + }).forEach(enqueue); + } else if (didShift === null) { + warn("Detected double maximal shift for node `" + _ele3.id() + "`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs."); + break; + } } } - 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); + assignDepths(); + var minDistance = 0; + 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); } } - 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(); - } + var cachedWeightedPercent = {}; + var getWeightedPercent = /* @__PURE__ */ __name(function getWeightedPercent2(ele2) { + if (cachedWeightedPercent[ele2.id()]) { + return cachedWeightedPercent[ele2.id()]; + } + var eleDepth = getInfo(ele2).depth; + var neighbors = ele2.neighborhood(); + var percent = 0; + var samples = 0; + for (var _i5 = 0; _i5 < neighbors.length; _i5++) { + var neighbor = neighbors[_i5]; + if (neighbor.isEdge() || neighbor.isParent() || !nodes6.has(neighbor)) { + continue; } - } else { - var parent = _ele4.parent(); - if (parent.length !== 0) { - removeChildRef(parent, _ele4); + var bf = getInfo(neighbor); + if (bf == null) { + continue; + } + var index = bf.index; + var depth = bf.depth; + if (index == null || depth == null) { + continue; + } + var nDepth = depths[depth].length; + if (depth < eleDepth) { + percent += index / nDepth; + samples++; } } - if (removeFromPool) { - _ele4._private.removed = true; + samples = Math.max(1, samples); + percent = percent / samples; + if (samples === 0) { + percent = 0; } - } - 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; + cachedWeightedPercent[ele2.id()] = percent; + return percent; + }, "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 diff2; } + }, "sortFn"); + if (options3.depthSort !== void 0) { + sortFn = options3.depthSort; } - var removedElements = new Collection(this.cy(), elesToRemove); - if (removedElements.size() > 0) { - if (notifyRenderer) { - removedElements.emitAndNotify("remove"); - } else if (removeFromPool) { - removedElements.emit("remove"); - } + for (var _i6 = 0; _i6 < depths.length; _i6++) { + depths[_i6].sort(sortFn); + assignDepthsAt(_i6); } - for (var _i8 = 0; _i8 < alteredParents.length; _i8++) { - var _ele6 = alteredParents[_i8]; - if (!removeFromPool || !_ele6.removed()) { - _ele6.updateStyle(); - } + var orphanDepth = []; + for (var _i7 = 0; _i7 < orphanNodes.length; _i7++) { + orphanDepth.push(orphanNodes[_i7]); } - 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; + depths.unshift(orphanDepth); + assignDepths(); + var biggestDepthSize = 0; + for (var _i8 = 0; _i8 < depths.length; _i8++) { + biggestDepthSize = Math.max(depths[_i8].length, biggestDepthSize); + } + var center4 = { + x: bb.x1 + bb.w / 2, + y: bb.x1 + bb.h / 2 }; - 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"); + var maxDepthSize = depths.reduce(function(max10, eles2) { + return Math.max(max10, eles2.length); + }, 0); + 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 / ((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 (!options3.circle) { + var epos = { + x: center4.x + (index + 1 - (depthSize + 1) / 2) * distanceX, + y: (depth + 1) * distanceY + }; + return epos; + } else { + 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) { + radius2 = 1; + } + return { + x: center4.x + radius2 * Math.cos(theta), + y: center4.y + radius2 * Math.sin(theta) + }; } - } + }, "getPosition"); + eles.nodes().layoutPositions(this, options3, getPosition); 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 _i = 0, il = grs.length; _i < il; _i++) { - var group = grs[_i]; - 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 (string(collection2)) { - var selector2 = collection2; - collection2 = this.$(selector2); - } - return collection2.remove(); - } + defaults$6 = { + fit: true, + // whether to fit the viewport to the graph + padding: 30, + // the padding on fit + boundingBox: void 0, + // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + avoidOverlap: true, + // prevents node overlap, may overflow boundingBox and radius if not enough space + nodeDimensionsIncludeLabels: false, + // Excludes the label when calculating node bounding boxes for the layout algorithm + spacingFactor: void 0, + // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up + radius: void 0, + // the radius of the circle + startAngle: 3 / 2 * Math.PI, + // where nodes start in radians + sweep: void 0, + // how many radians should be between the first and last node (defaults to full circle) + clockwise: true, + // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) + sort: void 0, + // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } + 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: /* @__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: /* @__PURE__ */ __name(function transform3(node2, position5) { + return position5; + }, "transform") + // transform a given node position. Useful for changing flow direction in discrete layouts }; - /*! 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; + __name(CircleLayout, "CircleLayout"); + CircleLayout.prototype.run = function() { + var params = this.options; + var options3 = params; + var cy = params.cy; + 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); } - function B(aA1, aA2) { - return 3 * aA2 - 6 * aA1; + var bb = makeBoundingBox(options3.boundingBox ? options3.boundingBox : { + x1: 0, + y1: 0, + w: cy.width(), + h: cy.height() + }); + var center4 = { + x: bb.x1 + bb.w / 2, + y: bb.y1 + bb.h / 2 + }; + 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 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 { + r2 = Math.min(bb.h, bb.w) / 2 - minDistance; } - function C(aA1) { - return 3 * aA1; + 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)); + r2 = Math.max(rMin, r2); } - function calcBezier(aT, aA1, aA2) { - return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; + 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: center4.x + rx, + y: center4.y + ry + }; + return pos; + }, "getPos"); + eles.nodes().layoutPositions(this, options3, getPos); + return this; + }; + defaults$5 = { + fit: true, + // whether to fit the viewport to the graph + padding: 30, + // the padding on fit + startAngle: 3 / 2 * Math.PI, + // where nodes start in radians + sweep: void 0, + // how many radians should be between the first and last node (defaults to full circle) + clockwise: true, + // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) + equidistant: false, + // whether levels have an equal radial distance betwen them, may cause bounding box overflow + minNodeSpacing: 10, + // min spacing between outside of nodes (used for radius adjustment) + boundingBox: void 0, + // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + avoidOverlap: true, + // prevents node overlap, may overflow boundingBox if not enough space + nodeDimensionsIncludeLabels: false, + // Excludes the label when calculating node bounding boxes for the layout algorithm + height: void 0, + // height of layout area (overrides container height) + width: void 0, + // 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: /* @__PURE__ */ __name(function concentric(node2) { + return node2.degree(); + }, "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: /* @__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: /* @__PURE__ */ __name(function transform4(node2, position5) { + return position5; + }, "transform") + // transform a given node position. Useful for changing flow direction in discrete layouts + }; + __name(ConcentricLayout, "ConcentricLayout"); + ConcentricLayout.prototype.run = function() { + var params = this.options; + var options3 = params; + var clockwise = options3.counterclockwise !== void 0 ? !options3.counterclockwise : options3.clockwise; + var cy = params.cy; + 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 center4 = { + x: bb.x1 + bb.w / 2, + y: bb.y1 + bb.h / 2 + }; + var nodeValues = []; + var maxNodeSize = 0; + for (var i2 = 0; i2 < nodes6.length; i2++) { + var node2 = nodes6[i2]; + var value2 = void 0; + value2 = options3.concentric(node2); + nodeValues.push({ + value: value2, + node: node2 + }); + node2._private.scratch.concentric = value2; } - function getSlope(aT, aA1, aA2) { - return 3 * A(aA1, aA2) * aT * aT + 2 * B(aA1, aA2) * aT + C(aA1); + 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); } - function newtonRaphsonIterate(aX, aGuessT) { - for (var _i = 0; _i < NEWTON_ITERATIONS; ++_i) { - var currentSlope = getSlope(aGuessT, mX1, mX2); - if (currentSlope === 0) { - return aGuessT; + nodeValues.sort(function(a2, b2) { + return b2.value - a2.value; + }); + var levelWidth2 = options3.levelWidth(nodes6); + var levels = [[]]; + var currentLevel = levels[0]; + for (var _i2 = 0; _i2 < nodeValues.length; _i2++) { + var val = nodeValues[_i2]; + if (currentLevel.length > 0) { + var diff2 = Math.abs(currentLevel[0].value - val.value); + if (diff2 >= levelWidth2) { + currentLevel = []; + levels.push(currentLevel); } - var currentX = calcBezier(aGuessT, mX1, mX2) - aX; - aGuessT -= currentX / currentSlope; - } - return aGuessT; - } - function calcSampleValues() { - for (var _i2 = 0; _i2 < kSplineTableSize; ++_i2) { - mSampleValues[_i2] = calcBezier(_i2 * kSampleStepSize, mX1, mX2); } + currentLevel.push(val); } - 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 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 _precomputed = false; - function precompute() { - _precomputed = true; - if (mX1 !== mY1 || mX2 !== mY2) { - calcSampleValues(); + 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 && 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)); + r2 = Math.max(rMin, r2); } + level.r = r2; + r2 += minDist; } - var f2 = function f3(aX) { - if (!_precomputed) { - precompute(); - } - if (mX1 === mY1 && mX2 === mY2) { - return aX; - } - if (aX === 0) { - return 0; + if (options3.equidistant) { + var rDeltaMax = 0; + var _r = 0; + for (var _i4 = 0; _i4 < levels.length; _i4++) { + var _level = levels[_i4]; + var rDelta = _level.r - _r; + rDeltaMax = Math.max(rDeltaMax, rDelta); } - if (aX === 1) { - return 1; + _r = 0; + for (var _i5 = 0; _i5 < levels.length; _i5++) { + var _level2 = levels[_i5]; + if (_i5 === 0) { + _r = _level2.r; + } + _level2.r = _r; + _r += rDeltaMax; } - 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; - } + var pos = {}; + for (var _i6 = 0; _i6 < levels.length; _i6++) { + var _level3 = levels[_i6]; + var _dTheta = _level3.dTheta; + var _r2 = _level3.r; + 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()] = p3; } - 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); - }; + } + eles.nodes().layoutPositions(this, options3, function(ele) { + var id27 = ele.id(); + return pos[id27]; + }); + return this; }; - 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 + defaults$4 = { + // Called on `layoutready` + ready: /* @__PURE__ */ __name(function ready2() { + }, "ready"), + // Called on `layoutstop` + 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 + // 'end' : Animate with the end result, from the initial positions to the end positions + animate: true, + // Easing of the animation for animate:'end' + animationEasing: void 0, + // The duration of the animation for animate:'end' + animationDuration: void 0, + // 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: /* @__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, + // Number of iterations between consecutive screen positions update + refresh: 20, + // Whether to fit the network view after when done + fit: true, + // Padding on fit + padding: 30, + // Constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + boundingBox: void 0, + // Excludes the label when calculating node bounding boxes for the layout algorithm + nodeDimensionsIncludeLabels: false, + // Randomize the initial positions of the nodes (true) or use existing positions (false) + randomize: false, + // Extra spacing between components in non-compound graphs + componentSpacing: 40, + // Node repulsion (non overlapping) multiplier + nodeRepulsion: /* @__PURE__ */ __name(function nodeRepulsion(node2) { + return 2048; + }, "nodeRepulsion"), + // Node repulsion (overlapping) multiplier + nodeOverlap: 4, + // Ideal edge (non nested) length + idealEdgeLength: /* @__PURE__ */ __name(function idealEdgeLength(edge) { + return 32; + }, "idealEdgeLength"), + // Divisor to compute edge forces + 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) + gravity: 1, + // Maximum number of iterations to perform + numIter: 1e3, + // Initial temperature (maximum node displacement) + initialTemp: 1e3, + // Cooling factor (how the temperature is reduced between consecutive iterations + coolingFactor: 0.99, + // Lower temperature threshold (below this point the layout will end) + minTemp: 1 }; - 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; + __name(CoseLayout, "CoseLayout"); + CoseLayout.prototype.run = function() { + 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: layout6 + }); } - if (type2.roundValue || type2.color) { - val = Math.round(val); + if (true === options3.debug) { + DEBUG = true; + } else { + DEBUG = false; } - if (type2.min !== void 0) { - val = Math.max(val, type2.min); + var layoutInfo = createLayoutInfo(cy, layout6, options3); + if (DEBUG) { + printLayoutInfo(layoutInfo); } - if (type2.max !== void 0) { - val = Math.min(val, type2.max); + if (options3.randomize) { + randomizePositions(layoutInfo); } - 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; + var startTime = performanceNow(); + 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; } - } 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); - } + step(layoutInfo, options3); + layoutInfo.temperature = layoutInfo.temperature * options3.coolingFactor; + if (layoutInfo.temperature < options3.minTemp) { + return false; } - 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"]; + return true; + }, "mainLoop"); + var done = /* @__PURE__ */ __name(function done2() { + if (options3.animate === true || options3.animate === false) { + refresh(); + layout6.one("layoutstop", options3.stop); + layout6.emit({ + type: "layoutstop", + layout: layout6 + }); } else { - var easingVals; - if (string(pEasing)) { - var easingProp = style.parse("transition-timing-function", pEasing); - easingVals = easingProp.value; - } else { - easingVals = pEasing; + var nodes6 = options3.eles.nodes(); + var getScaledPos = getScaleInBoundsFn(layoutInfo, options3, nodes6); + nodes6.layoutPositions(layout6, options3, getScaledPos); + } + }, "done"); + var i2 = 0; + var loopRet = true; + if (options3.animate === true) { + var frame2 = /* @__PURE__ */ __name(function frame3() { + var f3 = 0; + while (loopRet && f3 < options3.refresh) { + loopRet = mainLoop(i2); + i2++; + f3++; } - var name2, args; - if (string(easingVals)) { - name2 = easingVals; - args = []; + if (!loopRet) { + separateComponents(layoutInfo, options3); + done(); } else { - name2 = easingVals[1]; - args = easingVals.slice(2).map(function(n) { - return +n; - }); - } - if (args.length > 0) { - if (name2 === "spring") { - args.push(ani_p.duration); + var now4 = performanceNow(); + if (now4 - startTime >= options3.animationThreshold) { + refresh(); } - ani_p.easingImpl = easings[name2].apply(null, args); - } else { - ani_p.easingImpl = easings[name2]; + requestAnimationFrame2(frame3); } - } - } - var easing = ani_p.easingImpl; - var percent; - if (ani_p.duration === 0) { - percent = 1; + }, "frame"); + frame2(); } 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"); + while (loopRet) { + loopRet = mainLoop(i2); + i2++; } + separateComponents(layoutInfo, options3); + done(); } - ani_p.progress = percent; - return percent; - } - function valid(start2, end2) { - if (start2 == null || end2 == null) { - return false; + return this; + }; + CoseLayout.prototype.stop = function() { + this.stopped = true; + if (this.thread) { + this.thread.stop(); } - if (number$12(start2) && number$12(end2)) { - return true; - } else if (start2 && end2) { - return true; + this.emit("layoutstop"); + return this; + }; + CoseLayout.prototype.destroy = function() { + if (this.thread) { + this.thread.stop(); } - 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 this; + }; + 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(), + h: cy.height() + }); + var layoutInfo = { + isCompound: cy.hasCompoundNodes(), + layoutNodes: [], + idToIndex: {}, + nodeSize: nodes6.size(), + graphSet: [], + indexToGraph: [], + layoutEdges: [], + edgeSize: edges5.size(), + temperature: options3.initialTemp, + clientWidth: bb.w, + clientHeight: bb.h, + boundingBox: bb + }; + var components3 = options3.eles.components(); + var id2cmptId = {}; + 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; } - return ranAnis; } - var ranEleAni = false; - for (var e = 0; e < eles.length; e++) { - var ele = eles[e]; - var handledThisEle = stepOne(ele); - ranEleAni = ranEleAni || handledThisEle; + for (var i2 = 0; i2 < layoutInfo.nodeSize; i2++) { + var n2 = nodes6[i2]; + var nbb = n2.layoutDimensions(options3); + var tempNode = {}; + tempNode.isLocked = n2.locked(); + tempNode.id = n2.data("id"); + tempNode.parentId = n2.data("parent"); + tempNode.cmptId = id2cmptId[n2.id()]; + tempNode.children = []; + tempNode.positionX = n2.position("x"); + tempNode.positionY = n2.position("y"); + tempNode.offsetX = 0; + tempNode.offsetY = 0; + tempNode.height = nbb.w; + tempNode.width = nbb.h; + tempNode.maxX = tempNode.positionX + tempNode.width / 2; + tempNode.minX = tempNode.positionX - tempNode.width / 2; + tempNode.maxY = tempNode.positionY + tempNode.height / 2; + tempNode.minY = tempNode.positionY - tempNode.height / 2; + 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] = i2; } - var ranCoreAni = stepOne(cy, true); - if (ranEleAni || ranCoreAni) { - if (eles.length > 0) { - cy.notify("draw", eles); + var queue = []; + var start3 = 0; + var end2 = -1; + var tempGraph = []; + 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(n2.id); } else { - cy.notify("draw"); + queue[++end2] = n2.id; + tempGraph.push(n2.id); } } - 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; + layoutInfo.graphSet.push(tempGraph); + 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 i2 = 0; i2 < children2.length; i2++) { + queue[++end2] = children2[i2]; } - 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); + 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; } - }, - eventMatches: function eventMatches(cy, listener, eventObj) { - var selector2 = listener.qualifier; - if (selector2 != null) { - return cy !== eventObj.target && element(eventObj.target) && selector2.matches(eventObj.target); + } + for (var i2 = 0; i2 < layoutInfo.edgeSize; i2++) { + var e3 = edges5[i2]; + var tempEdge = {}; + 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]; + var targetGraph = layoutInfo.indexToGraph[targetIx]; + if (sourceGraph != targetGraph) { + var lca = findLCA(tempEdge.sourceId, tempEdge.targetId, layoutInfo); + var lcaGraph = layoutInfo.graphSet[lca]; + var depth = 0; + var tempNode = layoutInfo.layoutNodes[sourceIx]; + while (-1 === lcaGraph.indexOf(tempNode.id)) { + tempNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[tempNode.parentId]]; + depth++; + } + tempNode = layoutInfo.layoutNodes[targetIx]; + while (-1 === lcaGraph.indexOf(tempNode.id)) { + tempNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[tempNode.parentId]]; + depth++; + } + idealLength *= depth * options3.nestingFactor; } - 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; + tempEdge.idealLength = idealLength; + tempEdge.elasticity = elasticity; + layoutInfo.layoutEdges.push(tempEdge); } - }; - var argSelector = function argSelector2(arg) { - if (string(arg)) { - return new Selector(arg); + return 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 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; + return res.graph; } - }; - 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); + }, "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 { + count: 2, + graph: graphIx + }; } - }; - 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 name2 = options2.name; - var Layout2 = cy.extension("layout", name2); - if (Layout2 == null) { - error("No such layout `" + name2 + "` found. Did you forget to import it and `cytoscape.use()` it?"); - return; - } - var eles; - if (string(options2.eles)) { - eles = cy.$(options2.eles); - } else { - eles = options2.eles != null ? options2.eles : cy.$(); + 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) { + continue; } - 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); + var childGraphIx = layoutInfo.indexToGraph[layoutInfo.idToIndex[children2[0]]]; + var result = findLCA_aux2(node1, node2, childGraphIx, layoutInfo); + if (0 === result.count) { + continue; + } else if (1 === result.count) { + c3++; + if (2 === c3) { + break; } - 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; + return result; } - _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 { + count: c3, + graph: graphIx + }; + }, "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; } - 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); - } + } + }, "randomizePositions"); + getScaleInBoundsFn = /* @__PURE__ */ __name(function getScaleInBoundsFn2(layoutInfo, options3, nodes6) { + var bb = layoutInfo.boundingBox; + var coseBB = { + x1: Infinity, + x2: -Infinity, + y1: Infinity, + y2: -Infinity + }; + 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); + coseBB.y1 = Math.min(coseBB.y1, lnode.positionY); + coseBB.y2 = Math.max(coseBB.y2, lnode.positionY); }); + coseBB.w = coseBB.x2 - coseBB.x1; + coseBB.h = coseBB.y2 - coseBB.y1; } - }; - 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]); - } + return function(ele, i2) { + var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[ele.data("id")]]; + if (options3.boundingBox) { + var pctX = (lnode.positionX - coseBB.x1) / coseBB.w; + var pctY = (lnode.positionY - coseBB.y1) / coseBB.h; + return { + x: bb.x1 + pctX * bb.w, + y: bb.y1 + pctY * bb.h + }; + } else { + return { + x: lnode.positionX, + y: lnode.positionY + }; } - cy._private.renderer = null; - cy.mutableElements().forEach(function(ele) { - var _p = ele._private; - _p.rscratch = {}; - _p.rstyle = {}; - _p.animation.current = []; - _p.animation.queue = []; + }; + }, "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; + layout6.one("layoutready", options3.ready); + layout6.emit({ + type: "layoutready", + layout: this }); - }, - 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 (string(eles)) { - return this.$(eles); - } else if (elementOrCollection(eles)) { - return eles.collection(); - } else if (array2(eles)) { - if (!opts) { - opts = {}; + }, "refreshPositions"); + step = /* @__PURE__ */ __name(function step2(layoutInfo, options3, _step) { + calculateNodeForces(layoutInfo, options3); + calculateEdgeForces(layoutInfo); + calculateGravityForces(layoutInfo, options3); + propagateForces(layoutInfo); + updatePositions(layoutInfo); + }, "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 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); } - 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) { + }, "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) { + return; + } + var directionX = node2.positionX - node1.positionX; + var directionY = node2.positionY - node1.positionY; + var maxRandDist = 1; + if (0 === directionX && 0 === directionY) { + directionX = randomDistance(maxRandDist); + directionY = randomDistance(maxRandDist); + } + var overlap = nodesOverlap(node1, node2, directionX, directionY); + if (overlap > 0) { + 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 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; + var forceX = force * distanceX / distance2; + var forceY = force * distanceY / distance2; + } + if (!node1.isLocked) { + node1.offsetX -= forceX; + node1.offsetY -= forceY; + } + if (!node2.isLocked) { + node2.offsetX += forceX; + node2.offsetY += forceY; + } + return; + }, "nodeRepulsion"); + nodesOverlap = /* @__PURE__ */ __name(function nodesOverlap2(node1, node2, dX, dY) { + if (dX > 0) { + var overlapX = node1.maxX - node2.minX; + } else { + var overlapX = node2.maxX - node1.minX; + } + if (dY > 0) { + var overlapY = node1.maxY - node2.minY; + } else { + var overlapY = node2.maxY - node1.minY; + } + if (overlapX >= 0 && overlapY >= 0) { + return Math.sqrt(overlapX * overlapX + overlapY * overlapY); + } else { + return 0; + } + }, "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 = H2 / W2; + var res = {}; + if (0 === dX && 0 < dY) { + res.x = X3; + res.y = Y3 + H2 / 2; + return res; + } + if (0 === dX && 0 > dY) { + res.x = X3; + res.y = Y3 + H2 / 2; + return res; + } + if (0 < dX && -1 * nodeSlope <= dirSlope && dirSlope <= nodeSlope) { + res.x = X3 + W2 / 2; + res.y = Y3 + W2 * dY / 2 / dX; + return res; + } + if (0 > dX && -1 * nodeSlope <= dirSlope && dirSlope <= nodeSlope) { + res.x = X3 - W2 / 2; + res.y = Y3 - W2 * dY / 2 / dX; + return res; + } + if (0 < dY && (dirSlope <= -1 * nodeSlope || dirSlope >= nodeSlope)) { + res.x = X3 + H2 * dX / 2 / dY; + res.y = Y3 + H2 / 2; + return res; + } + if (0 > dY && (dirSlope <= -1 * nodeSlope || dirSlope >= nodeSlope)) { + res.x = X3 - H2 * dX / 2 / dY; + res.y = Y3 - H2 / 2; + return res; + } + return res; + }, "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]; + var target = layoutInfo.layoutNodes[targetIx]; + var directionX = target.positionX - source.positionX; + var directionY = target.positionY - source.positionY; + if (0 === directionX && 0 === directionY) { continue; } - var cxtStyle = self2.getContextStyle(cxtMeta); - var app = self2.applyContextStyle(cxtMeta, cxtStyle, ele); - if (ele._private.appliedInitStyle) { - self2.updateTransitions(ele, app.diffProps); + var point1 = findClippingPoint(source, directionX, directionY); + 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 { - ele._private.appliedInitStyle = true; + var forceX = 0; + var forceY = 0; } - var hintsDiff = self2.updateStyleHints(ele); - if (hintsDiff) { - updatedEles.push(ele); + if (!source.isLocked) { + source.offsetX += forceX; + source.offsetY += forceY; + } + if (!target.isLocked) { + target.offsetX -= forceX; + target.offsetY -= forceY; } } - 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; + }, "calculateEdgeForces"); + calculateGravityForces = /* @__PURE__ */ __name(function calculateGravityForces2(layoutInfo, options3) { + if (options3.gravity === 0) { + return; } - 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; + var distThreshold = 1; + for (var i2 = 0; i2 < layoutInfo.graphSet.length; i2++) { + var graph = layoutInfo.graphSet[i2]; + var numNodes = graph.length; + if (0 === i2) { + var centerX = layoutInfo.clientHeight / 2; + var centerY = layoutInfo.clientWidth / 2; + } else { + var temp = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[0]]]; + var parent4 = layoutInfo.layoutNodes[layoutInfo.idToIndex[temp.parentId]]; + var centerX = parent4.positionX; + var centerY = parent4.positionY; + } + for (var j2 = 0; j2 < numNodes; j2++) { + var node2 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[j2]]]; + if (node2.isLocked) { + continue; } - for (var j = 0; j < props.length; j++) { - var prop = props[j]; - var name2 = 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[name2] && !laterCxtOverrides) { - addedProp[name2] = true; - diffProps.push(name2); - } + var dx = centerX - node2.positionX; + var dy = centerY - node2.positionY; + 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; } } } - 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; + }, "calculateGravityForces"); + propagateForces = /* @__PURE__ */ __name(function propagateForces2(layoutInfo, options3) { + var queue = []; + var start3 = 0; + var end2 = -1; + queue.push.apply(queue, layoutInfo.graphSet[0]); + end2 += layoutInfo.graphSet[0].length; + 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 i2 = 0; i2 < children2.length; i2++) { + var childNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[children2[i2]]]; + childNode.offsetX += offX; + childNode.offsetY += offY; + queue[++end2] = children2[i2]; + } + node2.offsetX = 0; + node2.offsetY = 0; } } - 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; + }, "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; } } - 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) { + for (var i2 = 0; i2 < layoutInfo.nodeSize; i2++) { + var n2 = layoutInfo.layoutNodes[i2]; + if (0 < n2.children.length || n2.isLocked) { 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 + 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 > max10) { + var res = { + x: max10 * forceX / force, + y: max10 * forceY / force + }; + } else { + var res = { + x: forceX, + y: forceY }; - 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; + return res; + }, "limitForce"); + updateAncestryBoundaries = /* @__PURE__ */ __name(function updateAncestryBoundaries2(node2, layoutInfo) { + var parentId = node2.parentId; + if (null == parentId) { + return; } - 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 p3 = layoutInfo.layoutNodes[layoutInfo.idToIndex[parentId]]; + var flag = false; + if (null == p3.maxX || node2.maxX + p3.padRight > p3.maxX) { + p3.maxX = node2.maxX + p3.padRight; + flag = true; } - 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 ch = strVal.charCodeAt(j); - updateGrKey1(ch, grKey2); - updateGrKey2(ch, 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 _i = 0; _i < propNames.length; _i++) { - var name2 = propNames[_i]; - var parsedProp = overriddenStyles[name2]; - if (parsedProp == null) { + if (null == p3.minX || node2.minX - p3.padLeft < p3.minX) { + p3.minX = node2.minX - p3.padLeft; + flag = true; + } + if (null == p3.maxY || node2.maxY + p3.padBottom > p3.maxY) { + p3.maxY = node2.maxY + p3.padBottom; + flag = true; + } + if (null == p3.minY || node2.minY - p3.padTop < p3.minY) { + p3.minY = node2.minY - p3.padTop; + flag = true; + } + if (flag) { + return updateAncestryBoundaries2(p3, layoutInfo); + } + return; + }, "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 component2 = components3[cid] = components3[cid] || []; + component2.push(node2); + } + var totalA = 0; + for (var i2 = 0; i2 < components3.length; i2++) { + var c3 = components3[i2]; + if (!c3) { continue; } - var propInfo = this.properties[name2]; - 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; + 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 x5 = 0; + var y5 = 0; + var usedW = 0; + var rowH = 0; + var maxRowW = Math.sqrt(totalA) * layoutInfo.clientWidth / layoutInfo.clientHeight; + for (var i2 = 0; i2 < components3.length; i2++) { + var c3 = components3[i2]; + if (!c3) { + continue; } - 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); + 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; } - } 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 (!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, backgroundImage = _p$styleKeys.backgroundImage, compound = _p$styleKeys.compound, pie2 = _p$styleKeys.pie; - var nodeKeys = [nodeBody, nodeBorder, 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; + x5 += c3.w + options3.componentSpacing; + usedW += c3.w + options3.componentSpacing; + rowH = Math.max(rowH, c3.h); + if (usedW > maxRowW) { + y5 += rowH + options3.componentSpacing; + x5 = 0; + usedW = 0; + rowH = 0; } - }; - var checkTriggers = function checkTriggers2() { - var fromVal = getVal(origProp); - var toVal = getVal(prop); - self2.checkTriggers(ele, prop.name, fromVal, toVal); - }; - if (prop && prop.name.substr(0, 3) === "pie") { - warn("The pie style properties are deprecated. Create charts using background images instead."); - } - 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(); + }, "separateComponents"); + defaults$3 = { + fit: true, + // whether to fit the viewport to the graph + padding: 30, + // padding used on fit + boundingBox: void 0, + // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + avoidOverlap: true, + // prevents node overlap, may overflow boundingBox if not enough space + avoidOverlapPadding: 10, + // extra spacing around nodes when avoidOverlap: true + nodeDimensionsIncludeLabels: false, + // Excludes the label when calculating node bounding boxes for the layout algorithm + spacingFactor: void 0, + // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up + condense: false, + // uses all available space on false, uses minimal space on true + rows: void 0, + // force num of rows in the grid + cols: void 0, + // force num of columns in the grid + 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') } + 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: /* @__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: /* @__PURE__ */ __name(function transform5(node2, position5) { + return position5; + }, "transform") + // transform a given node position. Useful for changing flow direction in discrete layouts + }; + __name(GridLayout, "GridLayout"); + GridLayout.prototype.run = function() { + var params = this.options; + var options3 = params; + var cy = params.cy; + var eles = options3.eles; + var nodes6 = eles.nodes().not(":parent"); + if (options3.sort) { + nodes6 = nodes6.sort(options3.sort); } - 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; + 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, options3, function(ele) { + return { + x: bb.x1, + y: bb.y1 + }; + }); + } else { + 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 = /* @__PURE__ */ __name(function small2(val) { + if (val == null) { + return Math.min(rows, cols); } else { - var fieldWidth = prop.fieldMax - prop.fieldMin; - if (fieldWidth === 0) { - percent = 0; + var min9 = Math.min(rows, cols); + if (min9 == rows) { + rows = val; } else { - percent = (fieldVal - prop.fieldMin) / fieldWidth; + cols = val; } } - 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); + }, "small"); + var large = /* @__PURE__ */ __name(function large2(val) { + if (val == null) { + return Math.max(rows, cols); } else { - return false; + var max10 = Math.max(rows, cols); + if (max10 == rows) { + rows = val; + } else { + cols = val; + } } - if (!flatProp) { - printMappingErr(); - return false; + }, "large"); + var oRows = options3.rows; + var oCols = options3.cols != null ? options3.cols : options3.columns; + if (oRows != null && oCols != null) { + rows = oRows; + cols = oCols; + } else if (oRows != null && oCols == null) { + rows = oRows; + cols = Math.ceil(cells / rows); + } else if (oRows == null && oCols != null) { + cols = oCols; + rows = Math.ceil(cells / cols); + } else if (cols * rows > cells) { + var sm = small(); + var lg = large(); + if ((sm - 1) * lg >= cells) { + small(sm - 1); + } else if ((lg - 1) * sm >= cells) { + large(lg - 1); + } + } else { + while (cols * rows < cells) { + var _sm = small(); + var _lg = large(); + if ((_lg + 1) * _sm >= cells) { + large(_lg + 1); + } else { + small(_sm + 1); + } } - 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]; + var cellWidth = bb.w / cols; + var cellHeight = bb.h / rows; + if (options3.condense) { + cellWidth = 0; + cellHeight = 0; + } + 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(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); } - if (_fieldVal != null) { - flatProp = this.parse(prop.name, _fieldVal, prop.bypass, flatPropMapping); + } + var cellUsed = {}; + var used = /* @__PURE__ */ __name(function used2(row2, col2) { + return cellUsed["c-" + row2 + "-" + col2] ? true : false; + }, "used"); + var use2 = /* @__PURE__ */ __name(function use3(row2, col2) { + cellUsed["c-" + row2 + "-" + col2] = true; + }, "use"); + var row = 0; + var col = 0; + var moveToNextCell = /* @__PURE__ */ __name(function moveToNextCell2() { + col++; + if (col >= cols) { + col = 0; + row++; } - if (!flatProp) { - printMappingErr(); - return false; + }, "moveToNextCell"); + var id2manPos = {}; + 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, + col: rcPos.col + }; + if (_pos.col === void 0) { + _pos.col = 0; + while (used(_pos.row, _pos.col)) { + _pos.col++; + } + } else if (_pos.row === void 0) { + _pos.row = 0; + while (used(_pos.row, _pos.col)) { + _pos.row++; + } + } + id2manPos[_node.id()] = _pos; + use2(_pos.row, _pos.col); } - 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)"); + var getPos = /* @__PURE__ */ __name(function getPos2(element3, i3) { + var x5, y5; + if (element3.locked() || element3.isParent()) { 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; + var rcPos2 = id2manPos[element3.id()]; + if (rcPos2) { + x5 = rcPos2.col * cellWidth + cellWidth / 2 + bb.x1; + y5 = rcPos2.row * cellHeight + cellHeight / 2 + bb.y1; + } else { + while (used(row, col)) { + moveToNextCell(); + } + x5 = col * cellWidth + cellWidth / 2 + bb.x1; + y5 = row * cellHeight + cellHeight / 2 + bb.y1; + use2(row, col); + moveToNextCell(); } - flatProp.mapping = copy2(prop); - prop = flatProp; - break; + return { + x: x5, + y: y5 + }; + }, "getPos"); + nodes6.layoutPositions(this, options3, getPos); + } + return this; + }; + defaults$2 = { + ready: /* @__PURE__ */ __name(function ready3() { + }, "ready"), + // on layoutready + stop: /* @__PURE__ */ __name(function stop4() { + }, "stop") + // on layoutstop + }; + __name(NullLayout, "NullLayout"); + NullLayout.prototype.run = function() { + 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 + }; + }); + layout6.one("layoutready", options3.ready); + layout6.emit("layoutready"); + layout6.one("layoutstop", options3.stop); + layout6.emit("layoutstop"); + return this; + }; + NullLayout.prototype.stop = function() { + return this; + }; + defaults$1 = { + positions: void 0, + // map of (node id) => (position obj); or function(node){ return somPos; } + zoom: void 0, + // the zoom level to set (prob want fit = false if set) + pan: void 0, + // the pan level to set (prob want fit = false if set) + fit: true, + // whether to fit to viewport + padding: 30, + // padding on fit + spacingFactor: void 0, + // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up + 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: /* @__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: /* @__PURE__ */ __name(function transform6(node2, position5) { + return position5; + }, "transform") + // transform a given node position. Useful for changing flow direction in discrete layouts + }; + __name(PresetLayout, "PresetLayout"); + PresetLayout.prototype.run = function() { + var options3 = this.options; + var eles = options3.eles; + var nodes6 = eles.nodes(); + var posIsFn = fn$6(options3.positions); + function getPosition(node2) { + if (options3.positions == null) { + return copyPosition(node2.position()); } - case void 0: - break; - default: - return false; + if (posIsFn) { + return options3.positions(node2); + } + var pos = options3.positions[node2._private.data.id]; + if (pos == null) { + return null; + } + return pos; } - if (propIsBypass) { - if (origPropIsBypass) { - prop.bypassed = origProp.bypassed; - } else { - prop.bypassed = origProp; + __name(getPosition, "getPosition"); + nodes6.layoutPositions(this, options3, function(node2, i2) { + var position5 = getPosition(node2); + if (node2.locked() || position5 == null) { + return false; } - style[prop.name] = prop; - } else { - if (origPropIsBypass) { - origProp.bypassed = prop; - } else { - style[prop.name] = prop; + return position5; + }); + return this; + }; + defaults3 = { + fit: true, + // whether to fit to viewport + padding: 30, + // fit padding + boundingBox: void 0, + // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + 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: /* @__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: /* @__PURE__ */ __name(function transform7(node2, position5) { + return position5; + }, "transform") + // transform a given node position. Useful for changing flow direction in discrete layouts + }; + __name(RandomLayout, "RandomLayout"); + RandomLayout.prototype.run = function() { + 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 = /* @__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) + }; + }, "getPos"); + eles.nodes().layoutPositions(this, options3, getPos); + return this; + }; + layout4 = [{ + name: "breadthfirst", + impl: BreadthFirstLayout + }, { + name: "circle", + impl: CircleLayout + }, { + name: "concentric", + impl: ConcentricLayout + }, { + name: "cose", + impl: CoseLayout + }, { + name: "grid", + impl: GridLayout + }, { + name: "null", + impl: NullLayout + }, { + name: "preset", + impl: PresetLayout + }, { + name: "random", + impl: RandomLayout + }]; + __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: noop4, + notify: /* @__PURE__ */ __name(function notify2() { + this.notifications++; + }, "notify"), + init: noop4, + isHeadless: /* @__PURE__ */ __name(function isHeadless() { + return true; + }, "isHeadless"), + png: throwImgErr, + jpg: throwImgErr + }; + BRp$f = {}; + BRp$f.arrowShapeWidth = 0.3; + BRp$f.registerArrowShapes = function() { + var arrowShapes = this.arrowShapes = {}; + var renderer8 = 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; + }, "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 + }; + }, "transform"); + var transformPoints = /* @__PURE__ */ __name(function transformPoints2(pts2, size5, angle2, translation) { + var retPts = []; + 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; + }, "transformPoints"); + var pointsToArr = /* @__PURE__ */ __name(function pointsToArr2(pts2) { + var ret = []; + for (var i2 = 0; i2 < pts2.length; i2++) { + var p3 = pts2[i2]; + ret.push(p3.x, p3.y); + } + return ret; + }, "pointsToArr"); + var standardGap = /* @__PURE__ */ __name(function standardGap2(edge) { + return edge.pstyle("width").pfValue * edge.pstyle("arrow-scale").pfValue * 2; + }, "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: /* @__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: /* @__PURE__ */ __name(function draw24(context, size5, angle2, translation) { + var points = transformPoints(this.points, size5, angle2, translation); + renderer8.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$1, + spacing: zeroify, + gap: zeroify + }); + defineArrowShape("triangle", { + points: [-0.15, -0.3, 0, 0, 0.15, -0.3] + }); + defineArrowShape("arrow", "triangle"); + defineArrowShape("triangle-backcurve", { + points: arrowShapes["triangle"].points, + controlPoint: [0, -0.15], + roughCollide: bbCollide, + draw: /* @__PURE__ */ __name(function draw24(context, size5, angle2, translation, edgeWidth) { + var ptsTrans = transformPoints(this.points, size5, angle2, translation); + var ctrlPt = this.controlPoint; + var ctrlPtTrans = transform8(ctrlPt[0], ctrlPt[1], size5, angle2, translation); + renderer8.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: /* @__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; + }, "collide"), + draw: /* @__PURE__ */ __name(function draw24(context, size5, angle2, translation, edgeWidth) { + var triPts = transformPoints(this.points, size5, angle2, translation); + var teePts = transformPoints(this.pointsTee, size5, angle2, translation); + renderer8.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: /* @__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 draw24(context, size5, angle2, translation, edgeWidth) { + var triPts = transformPoints(this.pointsTr, size5, angle2, translation); + renderer8.arrowShapeImpl(this.name)(context, triPts, translation.x, translation.y, this.radius * size5); + }, "draw"), + spacing: /* @__PURE__ */ __name(function spacing2(edge) { + return renderer8.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], + baseCrossLinePts: [ + -0.15, + -0.4, + // first half of the rectangle + -0.15, + -0.4, + 0.15, + -0.4, + // second half of the rectangle + 0.15, + -0.4 + ], + crossLinePts: /* @__PURE__ */ __name(function crossLinePts(size5, edgeWidth) { + var p3 = this.baseCrossLinePts.slice(); + var shiftFactor = edgeWidth / size5; + var y0 = 3; + var y1 = 5; + 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; + }, "collide"), + draw: /* @__PURE__ */ __name(function draw24(context, size5, angle2, translation, edgeWidth) { + var triPts = transformPoints(this.points, size5, angle2, translation); + var crossLinePts = transformPoints(this.crossLinePts(size5, edgeWidth), size5, angle2, translation); + renderer8.arrowShapeImpl(this.name)(context, triPts, crossLinePts); + }, "draw") + }); + defineArrowShape("vee", { + points: [-0.15, -0.3, 0, 0, 0.15, -0.3, 0, -0.15], + gap: /* @__PURE__ */ __name(function gap(edge) { + return standardGap(edge) * 0.525; + }, "gap") + }); + defineArrowShape("circle", { + radius: 0.15, + 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; + }, "collide"), + draw: /* @__PURE__ */ __name(function draw24(context, size5, angle2, translation, edgeWidth) { + renderer8.arrowShapeImpl(this.name)(context, translation.x, translation.y, this.radius * size5); + }, "draw"), + spacing: /* @__PURE__ */ __name(function spacing2(edge) { + return renderer8.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: /* @__PURE__ */ __name(function spacing2(edge) { + return 1; + }, "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: /* @__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: /* @__PURE__ */ __name(function gap(edge) { + return 0.95 * edge.pstyle("width").pfValue * edge.pstyle("arrow-scale").value; + }, "gap") + }); + }; + 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 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; } - checkTriggers(); - return true; + 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"), + bottom: styleValue2("padding-bottom") + }; + var border = { + left: styleValue2("border-left-width"), + right: styleValue2("border-right-width"), + top: styleValue2("border-top-width"), + bottom: styleValue2("border-bottom-width") + }; + 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 = rect4.width / (clientWidth + borderHor); + var unscaledW = clientWidth - paddingHor; + var unscaledH = clientHeight - paddingVer; + var left3 = rect4.left + padding3.left + border.left; + var top2 = rect4.top + padding3.top + border.top; + return this.containerBB = [left3, top2, unscaledW, unscaledH, scale]; }; - 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; + BRp$e.invalidateContainerClientCoordsCache = function() { + this.containerBB = null; + }; + BRp$e.findNearestElement = function(x5, y5, interactiveElementsOnly, isTouch) { + return this.findNearestElements(x5, y5, interactiveElementsOnly, isTouch)[0]; + }; + BRp$e.findNearestElements = function(x5, y5, interactiveElementsOnly, isTouch) { + var self2 = this; + var r2 = this; + var eles = r2.getCachedZSortedEles(); + var near = []; + 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; + if (interactiveElementsOnly) { + eles = eles.interactive; + } + function addEle(ele2, sqDist) { + if (ele2.isNode()) { + if (nearNode) { + return; + } else { + nearNode = ele2; + near.push(ele2); + } + } + 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 i3 = 0; i3 < near.length; i3++) { + if (near[i3].isEdge()) { + near[i3] = ele2; + nearEdge = ele2; + minSqDist = sqDist != null ? sqDist : minSqDist; + break; + } } } + } else { + near.push(ele2); + nearEdge = ele2; + minSqDist = sqDist != null ? sqDist : minSqDist; } } } - }; - 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; + __name(addEle, "addEle"); + function checkNode(node2) { + var width3 = node2.outerWidth() + 2 * nodeThreshold; + var height2 = node2.outerHeight() + 2 * nodeThreshold; + var hw = width3 / 2; + var hh = height2 / 2; + var pos = node2.position(); + 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; } - 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; + } + } + __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 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 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; + } } - 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; + } else if (rs.edgeType === "bezier" || rs.edgeType === "multibezier" || rs.edgeType === "self" || rs.edgeType === "compound") { + var pts2 = rs.allpts; + 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; + } } - if (diff) { - style[prop] = toProp.strValue; - this.applyBypass(ele, prop, initVal); - anyPrev = true; + } + var src = src || _p.source; + var tgt = tgt || _p.target; + var arSize = self2.getArrowWidth(styleWidth, scale); + var arrows = [{ + name: "source", + x: rs.arrowStartX, + y: rs.arrowStartY, + angle: rs.srcArrowAngle + }, { + name: "target", + x: rs.arrowEndX, + y: rs.arrowEndY, + angle: rs.tgtArrowAngle + }, { + name: "mid-source", + x: rs.midX, + y: rs.midY, + angle: rs.midsrcArrowAngle + }, { + name: "mid-target", + x: rs.midX, + y: rs.midY, + angle: rs.midtgtArrowAngle + }]; + 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(x5, y5, arSize, ar.angle, { + x: ar.x, + y: ar.y + }, edgeWidth, edgeThreshold) && shape.collide(x5, y5, arSize, ar.angle, { + x: ar.x, + y: ar.y + }, edgeWidth, edgeThreshold)) { + addEle(edge); + return true; } } - if (!anyPrev) { - return; + if (hasCompounds && near.length > 0) { + checkNode(src); + checkNode(tgt); } - _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, name2, fromValue, toValue, getTrigger, onTrigger) { - var prop = this.properties[name2]; - var triggerCheck = getTrigger(prop); - if (triggerCheck != null && triggerCheck(fromValue, toValue)) { - onTrigger(prop); + __name(checkEdge, "checkEdge"); + function preprop(obj, name, pre) { + return getPrefixedProperty(obj, name, pre); } - }; - styfn$8.checkZOrderTrigger = function(ele, name2, fromValue, toValue) { - var _this = this; - this.checkTrigger(ele, name2, fromValue, toValue, function(prop) { - return prop.triggersZOrder; - }, function() { - _this._private.cy.notify("zorder", ele); - }); - }; - styfn$8.checkBoundsTrigger = function(ele, name2, fromValue, toValue) { - this.checkTrigger(ele, name2, 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 && (name2 === "curve-style" && (fromValue === "bezier" || toValue === "bezier") || name2 === "display" && (fromValue === "none" || toValue === "none")) - ) { - ele.parallelEdges().forEach(function(pllEdge) { - if (pllEdge.isBundledBezier()) { - pllEdge.dirtyBoundingBoxCache(); - } - }); + __name(preprop, "preprop"); + function checkLabel(ele2, prefix) { + var _p = ele2._private; + var th = labelThreshold; + var prefixDash; + if (prefix) { + prefixDash = prefix + "-"; + } else { + prefixDash = ""; } - }); - }; - styfn$8.checkTriggers = function(ele, name2, fromValue, toValue) { - ele.dirtyStyleCache(); - this.checkZOrderTrigger(ele, name2, fromValue, toValue); - this.checkBoundsTrigger(ele, name2, fromValue, toValue); - }; - var styfn$7 = {}; - styfn$7.applyBypass = function(eles, name2, value, updateTransitions) { - var self2 = this; - var props = []; - var isBypass = true; - if (name2 === "*" || name2 === "**") { - if (value !== 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, value, true); - if (parsedProp) { - props.push(parsedProp); - } + ele2.boundingBox(); + var bb = _p.labelBounds[prefix || "main"]; + var text2 = ele2.pstyle(prefixDash + "label").value; + var eventsEnabled = ele2.pstyle("text-events").strValue === "yes"; + if (!eventsEnabled || !text2) { + return; + } + var lx = preprop(_p.rscratch, "labelX", prefix); + var ly = preprop(_p.rscratch, "labelY", prefix); + var theta = preprop(_p.rscratch, "labelAngle", prefix); + var ox = ele2.pstyle(prefixDash + "text-margin-x").pfValue; + var oy = ele2.pstyle(prefixDash + "text-margin-y").pfValue; + var lx1 = bb.x1 - th - ox; + var lx2 = bb.x2 + th - ox; + var ly1 = bb.y1 - th - oy; + var ly2 = bb.y2 + th - oy; + if (theta) { + var cos3 = Math.cos(theta); + var sin3 = Math.sin(theta); + var rotate = /* @__PURE__ */ __name(function rotate2(x6, y6) { + x6 = x6 - lx; + y6 = y6 - ly; + return { + 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); + var px2y2 = rotate(lx2, ly2); + var points = [ + // with the margin added after the rotation is applied + px1y1.x + ox, + px1y1.y + oy, + px2y1.x + ox, + px2y1.y + oy, + px2y2.x + ox, + px2y2.y + oy, + px1y2.x + ox, + px1y2.y + oy + ]; + if (pointInsidePolygonPoints(x5, y5, points)) { + addEle(ele2); + return true; + } + } else { + if (inBoundingBox(bb, x5, y5)) { + addEle(ele2); + return true; } } - } else if (string(name2)) { - var _parsedProp = this.parse(name2, value, true); - if (_parsedProp) { - props.push(_parsedProp); + } + __name(checkLabel, "checkLabel"); + for (var i2 = eles.length - 1; i2 >= 0; i2--) { + var ele = eles[i2]; + if (ele.isNode()) { + checkNode(ele) || checkLabel(ele); + } else { + checkEdge(ele) || checkLabel(ele) || checkLabel(ele, "source") || checkLabel(ele, "target"); } - } else if (plainObject(name2)) { - var specifiedProps = name2; - updateTransitions = value; - 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)]; + } + return near; + }; + BRp$e.getAllInBox = function(x1, y1, x22, y22) { + var eles = this.getCachedZSortedEles().interactive; + var box = []; + 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; + x22 = x2c; + y1 = y1c; + y22 = y2c; + var boxBb = makeBoundingBox({ + x1, + y1, + x2: x22, + y2: y22 + }); + for (var e3 = 0; e3 < eles.length; e3++) { + var ele = eles[e3]; + if (ele.isNode()) { + var node2 = ele; + var nodeBb = node2.boundingBox({ + includeNodes: true, + includeEdges: false, + includeLabels: false + }); + if (boundingBoxesIntersect(boxBb, nodeBb) && !boundingBoxInBoundingBox(nodeBb, boxBb)) { + box.push(node2); } - if (_value !== void 0) { - var _parsedProp2 = this.parse(_name2, _value, true); - if (_parsedProp2) { - props.push(_parsedProp2); + } else { + var edge = ele; + var _p = edge._private; + var rs = _p.rscratch; + if (rs.startX != null && rs.startY != null && !inBoundingBox(boxBb, rs.startX, rs.startY)) { + continue; + } + if (rs.endX != null && rs.endY != null && !inBoundingBox(boxBb, rs.endX, rs.endY)) { + continue; + } + 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 i2 = 0; i2 < pts2.length; i2++) { + if (!pointInBoundingBox(boxBb, pts2[i2])) { + allInside = false; + break; + } + } + if (allInside) { + box.push(edge); } + } else if (rs.edgeType === "haystack" || rs.edgeType === "straight") { + box.push(edge); } } + } + return box; + }; + BRp$d = {}; + BRp$d.calculateArrowAngles = function(edge) { + var rs = edge._private.rscratch; + var isHaystack = rs.edgeType === "haystack"; + var isBezier = rs.edgeType === "bezier"; + var isMultibezier = rs.edgeType === "multibezier"; + var isSegments = rs.edgeType === "segments"; + var isCompound = rs.edgeType === "compound"; + var isSelf = rs.edgeType === "self"; + var dispX, dispY; + var startX2, startY2, endX, endY, midX, midY; + if (isHaystack) { + startX2 = rs.haystackPts[0]; + startY2 = rs.haystackPts[1]; + endX = rs.haystackPts[2]; + endY = rs.haystackPts[3]; } else { - return false; + startX2 = rs.arrowStartX; + startY2 = rs.arrowStartY; + endX = rs.arrowEndX; + endY = rs.arrowEndY; } - if (props.length === 0) { - return false; + midX = rs.midX; + midY = rs.midY; + if (isSegments) { + 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 = startX2 - bX; + dispY = startY2 - bY; + } else { + dispX = startX2 - midX; + dispY = startY2 - midY; } - var ret = false; - for (var _i2 = 0; _i2 < eles.length; _i2++) { - var ele = eles[_i2]; - 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); - } + rs.srcArrowAngle = getAngleFromDisp(dispX, dispY); + var midX = rs.midX; + var midY = rs.midY; + if (isHaystack) { + midX = (startX2 + endX) / 2; + midY = (startY2 + endY) / 2; + } + dispX = endX - startX2; + dispY = endY - startY2; + if (isSegments) { + var pts2 = rs.allpts; + if (pts2.length / 2 % 2 === 0) { + 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 i2 = pts2.length / 2 - 1; + var i1 = i2 - 2; + dispX = pts2[i2] - pts2[i1]; + dispY = pts2[i2 + 1] - pts2[i1 + 1]; } - if (ret) { - this.updateStyleHints(ele); + } else if (isMultibezier || isCompound || isSelf) { + var pts2 = rs.allpts; + var cpts = rs.ctrlpts; + var bp0x, bp0y; + var bp1x, bp1y; + if (cpts.length / 2 % 2 === 0) { + var p0 = pts2.length / 2 - 1; + var ic = p0 + 2; + var p1 = ic + 2; + bp0x = qbezierAt(pts2[p0], pts2[ic], pts2[p1], 0); + bp0y = qbezierAt(pts2[p0 + 1], pts2[ic + 1], pts2[p1 + 1], 0); + bp1x = qbezierAt(pts2[p0], pts2[ic], pts2[p1], 1e-4); + bp1y = qbezierAt(pts2[p0 + 1], pts2[ic + 1], pts2[p1 + 1], 1e-4); + } else { + var ic = pts2.length / 2 - 1; + var p0 = ic - 2; + var p1 = ic + 2; + bp0x = qbezierAt(pts2[p0], pts2[ic], pts2[p1], 0.4999); + bp0y = qbezierAt(pts2[p0 + 1], pts2[ic + 1], pts2[p1 + 1], 0.4999); + bp1x = qbezierAt(pts2[p0], pts2[ic], pts2[p1], 0.5); + bp1y = qbezierAt(pts2[p0 + 1], pts2[ic + 1], pts2[p1 + 1], 0.5); } - if (updateTransitions) { - this.updateTransitions(ele, diffProps, isBypass); + dispX = bp1x - bp0x; + dispY = bp1y - bp0y; + } + rs.midtgtArrowAngle = getAngleFromDisp(dispX, dispY); + rs.midDispX = dispX; + rs.midDispY = dispY; + dispX *= -1; + dispY *= -1; + if (isSegments) { + var pts2 = rs.allpts; + 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]); } } - return ret; + rs.midsrcArrowAngle = getAngleFromDisp(dispX, dispY); + if (isSegments) { + dispX = endX - rs.segpts[rs.segpts.length - 2]; + dispY = endY - rs.segpts[rs.segpts.length - 1]; + } else if (isMultibezier || isCompound || isSelf || isBezier) { + var pts2 = rs.allpts; + 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 { + dispX = endX - midX; + dispY = endY - midY; + } + rs.tgtArrowAngle = getAngleFromDisp(dispX, dispY); }; - styfn$7.overrideBypass = function(eles, name2, value) { - name2 = camel2dash(name2); - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - var prop = ele._private.style[name2]; - var type2 = this.properties[name2].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, name2, value); + BRp$d.getArrowWidth = BRp$d.getArrowHeight = function(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; + cache3[edgeWidth + ", " + scale] = cachedVal; + return cachedVal; + }; + 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 { - prop.value = value; - if (prop.pfValue != null) { - prop.pfValue = value; - } - if (isColor) { - prop.strValue = "rgb(" + value.join(",") + ")"; - } else if (isMulti) { - prop.strValue = value.join(" "); + 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 = /* @__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 / l2, + y: dx / l2 + }; + }, "recalcVectorNormInverse"); + var edgeDistances = edge.pstyle("edge-distances").value; + switch (edgeDistances) { + case "node-position": + midptPts = posPts; + break; + case "intersection": + midptPts = intersectionPts; + break; + 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), x22 = _this$manualEndptToPx4[0], y22 = _this$manualEndptToPx4[1]; + var endPts = { + x1, + y1, + x2: x22, + y2: y22 + }; + vectorNormInverse = recalcVectorNormInverse(x1, y1, x22, y22); + midptPts = endPts; } else { - prop.strValue = "" + value; + 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).")); + midptPts = intersectionPts; } - this.updateStyleHints(ele); + break; } - this.checkTriggers(ele, name2, oldValue, value); } + return { + midptPts, + vectorNormInverse + }; }; - 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 name2 = props[i3]; - var prop = this.properties[name2]; - var prevProp = ele.pstyle(prop.name); - if (!prevProp || !prevProp.bypass) { - continue; - } - var value = ""; - var parsedProp = this.parse(name2, value, true); - var diffProp = diffProps[prop.name] = { - prev: prevProp + 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 angle2 = Math.random() * 2 * Math.PI; + rs.source = { + x: Math.cos(angle2), + y: Math.sin(angle2) + }; + angle2 = Math.random() * 2 * Math.PI; + rs.target = { + x: Math.cos(angle2), + y: Math.sin(angle2) }; - this.applyParsedProperty(ele, parsedProp); - diffProp.next = ele.pstyle(prop.name); - } - this.updateStyleHints(ele); - if (updateTransitions) { - this.updateTransitions(ele, diffProps, isBypass); } + var src = _p.source; + var tgt = _p.target; + var srcPos = src.position(); + var tgtPos = tgt.position(); + var srcW = src.width(); + var tgtW = tgt.width(); + var srcH = src.height(); + var tgtH = tgt.height(); + 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; + rs.edgeType = "haystack"; + rs.haystack = true; + this.storeEdgeProjections(edge); + this.calculateArrowAngles(edge); + this.recalculateEdgeLabelProjections(edge); + this.calculateLabelAngles(edge); } }; - 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(); - if (window$1 && domElement2 && window$1.getComputedStyle) { - return window$1.getComputedStyle(domElement2).getPropertyValue(propName); + BRp$c.findSegmentsPoints = function(edge, pairInfo) { + 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 = []; + 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 * 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"); } }; - var styfn$5 = {}; - styfn$5.getRenderedStyle = function(ele, prop) { - if (prop) { - return this.getStylePropertyValue(ele, prop, true); - } else { - return this.getRawStyle(ele, true); + 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"); + var ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[0] : void 0; + var loopDir = edge.pstyle("loop-direction").pfValue; + var loopSwp = edge.pstyle("loop-sweep").pfValue; + var stepSize = edge.pstyle("control-point-step-size").pfValue; + rs.edgeType = "self"; + var j2 = i2; + var loopDist = stepSize; + if (edgeIsUnbundled) { + 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); + 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)]; }; - 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; + 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 j2 = i2; + var loopDist = stepSize; + if (edgeIsUnbundled) { + j2 = 0; + loopDist = ctrlptDist; } + var loopW = 50; + var loopaPos = { + x: srcPos.x - srcW / 2, + y: srcPos.y - srcH / 2 + }; + var loopbPos = { + x: tgtPos.x - tgtW / 2, + y: tgtPos.y - tgtH / 2 + }; + var loopPos = { + x: Math.min(loopaPos.x, loopbPos.x), + y: Math.min(loopaPos.y, loopbPos.y) + }; + 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 * (j2 / 3 + 1) * compoundStretchA, loopPos.x - (1 + Math.pow(loopW, 1.12) / 100) * loopDist * (j2 / 3 + 1) * compoundStretchB, loopPos.y]; }; - 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]; + BRp$c.findStraightEdgePoints = function(edge) { + edge._private.rscratch.edgeType = "straight"; }; - 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; + 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"); + var ctrlptWs = edge.pstyle("control-point-weights"); + var bezierN = ctrlptDists && ctrlptWs ? Math.min(ctrlptDists.value.length, ctrlptWs.value.length) : 1; + var ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[0] : void 0; + var ctrlptWeight = ctrlptWs.value[0]; + var multi = edgeIsUnbundled; + rs.edgeType = multi ? "multibezier" : "bezier"; + rs.ctrlpts = []; + 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[b2] : stepSize; + ctrlptWeight = ctrlptWs.value[b2]; } - var type2 = prop.type; - var styleProp = ele.pstyle(prop.name); - if (styleProp) { - var value = styleProp.value, units = styleProp.units, strValue = styleProp.strValue; - if (isRenderedVal && type2.number && value != null && number$12(value)) { - 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(value); - var haveUnits = isArrayValue ? units.every(function(u2) { - return u2 != null; - }) : units != null; - if (haveUnits) { - if (isArrayValue) { - return value.map(function(v, i3) { - return getValueStringWithUnits(v, units[i3]); - }).join(" "); - } else { - return getValueStringWithUnits(value, units); - } - } else { - if (isArrayValue) { - return value.map(function(v) { - return string(v) ? v : "" + getRenderedValue(v); - }).join(" "); - } else { - return "" + getRenderedValue(value); - } - } - } else if (strValue != null) { - return strValue; - } + if (edgeIsUnbundled) { + manctrlptDist = ctrlptDist; + } else { + manctrlptDist = ctrlptDist !== void 0 ? sign2 * ctrlptDist : void 0; } - return null; + var distanceFromMidpoint = manctrlptDist !== void 0 ? manctrlptDist : normctrlptDist; + var w1 = 1 - 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 * w22, + y: midptPts.y1 * w1 + midptPts.y2 * w22 + }; + rs.ctrlpts.push(adjustedMidpt.x + vectorNormInverse.x * distanceFromMidpoint, adjustedMidpt.y + vectorNormInverse.y * distanceFromMidpoint); } }; - styfn$5.getAnimationStartStyle = function(ele, aniProps) { - var rstyle = {}; - for (var i3 = 0; i3 < aniProps.length; i3++) { - var aniProp = aniProps[i3]; - var name2 = aniProp.name; - var styleProp = ele.pstyle(name2); - if (styleProp !== void 0) { - if (plainObject(styleProp)) { - styleProp = this.parse(name2, styleProp.strValue); + BRp$c.findTaxiPoints = function(edge, pairInfo) { + var rs = edge._private.rscratch; + rs.edgeType = "segments"; + var VERTICAL = "vertical"; + var HORIZONTAL = "horizontal"; + var LEFTWARD = "leftward"; + var RIGHTWARD = "rightward"; + var DOWNWARD = "downward"; + var UPWARD = "upward"; + var AUTO = "auto"; + var posPts = pairInfo.posPts, srcW = pairInfo.srcW, srcH = pairInfo.srcH, tgtW = pairInfo.tgtW, tgtH = pairInfo.tgtH; + var edgeDistances = edge.pstyle("edge-distances").value; + var dIncludesNodeBody = edgeDistances !== "node-position"; + var taxiDir = edge.pstyle("taxi-direction").value; + var rawTaxiDir = taxiDir; + var taxiTurn = edge.pstyle("taxi-turn"); + var turnIsPercent = taxiTurn.units === "%"; + var taxiTurnPfVal = taxiTurn.pfValue; + var turnIsNegative = taxiTurnPfVal < 0; + var minD = edge.pstyle("taxi-turn-min-distance").pfValue; + var dw = dIncludesNodeBody ? (srcW + tgtW) / 2 : 0; + var dh = dIncludesNodeBody ? (srcH + tgtH) / 2 : 0; + var pdx = posPts.x2 - posPts.x1; + var pdy = posPts.y2 - posPts.y1; + 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; + if (rawTaxiDir === AUTO) { + taxiDir = Math.abs(dx) > Math.abs(dy) ? HORIZONTAL : VERTICAL; + } else if (rawTaxiDir === UPWARD || rawTaxiDir === DOWNWARD) { + taxiDir = VERTICAL; + isExplicitDir = true; + } else if (rawTaxiDir === LEFTWARD || rawTaxiDir === RIGHTWARD) { + taxiDir = HORIZONTAL; + isExplicitDir = true; + } + var isVert = taxiDir === VERTICAL; + 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; + l2 = sgnL * Math.abs(l2); + forcedDir = true; + } + var d2; + if (turnIsPercent) { + var p3 = taxiTurnPfVal < 0 ? 1 + taxiTurnPfVal : taxiTurnPfVal; + d2 = p3 * l2; + } else { + 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 x5 = (posPts.x1 + posPts.x2) / 2; + var y1 = posPts.y1, y22 = posPts.y2; + rs.segpts = [x5, y1, x5, y22]; + } else if (lShapeInsideTgt) { + var y5 = (posPts.y1 + posPts.y2) / 2; + var x1 = posPts.x1, x22 = posPts.x2; + rs.segpts = [x1, y5, x22, y5]; + } else { + rs.segpts = [posPts.x1, posPts.y2]; + } + } else { + var _lShapeInsideSrc = Math.abs(pl) <= srcW / 2; + var _lShapeInsideTgt = Math.abs(pdy) <= tgtH / 2; + if (_lShapeInsideSrc) { + var _y = (posPts.y1 + posPts.y2) / 2; + var _x = posPts.x1, _x2 = posPts.x2; + rs.segpts = [_x, _y, _x2, _y]; + } else if (_lShapeInsideTgt) { + var _x3 = (posPts.x1 + posPts.x2) / 2; + var _y2 = posPts.y1, _y3 = posPts.y2; + rs.segpts = [_x3, _y2, _x3, _y3]; } else { - styleProp = this.parse(name2, styleProp); + rs.segpts = [posPts.x2, posPts.y1]; } } - if (styleProp) { - rstyle[name2] = styleProp; + } else { + if (isVert) { + 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 + d2 + (dIncludesNodeBody ? srcW / 2 * sgnL : 0); + var _y5 = posPts.y1, _y6 = posPts.y2; + rs.segpts = [_x6, _y5, _x6, _y6]; } } - return rstyle; + 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); + } }; - 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 name2 = names[i3]; - var val = style[name2]; - var prop = props[name2] || props[camel2dash(name2)]; - var styleProp = this.parse(prop.name, val); - if (styleProp) { - rstyle.push(styleProp); + 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, 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 = dist({ + x: rs.ctrlpts[0], + y: rs.ctrlpts[1] + }, { + x: rs.startX, + y: rs.startY + }); + var closeStartACp = startACpDist < minCpADist; + var endACpDist = dist({ + x: rs.ctrlpts[0], + y: rs.ctrlpts[1] + }, { + x: rs.endX, + y: rs.endY + }); + var closeEndACp = endACpDist < minCpADist; + var overlapping = false; + if (badStart || badAStart || closeStartACp) { + overlapping = true; + var cpD = { + // delta + x: rs.ctrlpts[0] - srcPos.x, + y: rs.ctrlpts[1] - srcPos.y + }; + var cpL = Math.sqrt(cpD.x * cpD.x + cpD.y * cpD.y); + var cpM = { + // normalised delta + x: cpD.x / cpL, + y: cpD.y / cpL + }; + var radius2 = Math.max(srcW, srcH); + var cpProj = { + // *2 radius guarantees outside shape + 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, srcCornerRadius, srcRs); + if (closeStartACp) { + rs.ctrlpts[0] = rs.ctrlpts[0] + cpM.x * (minCpADist - startACpDist); + rs.ctrlpts[1] = rs.ctrlpts[1] + cpM.y * (minCpADist - startACpDist); + } else { + rs.ctrlpts[0] = srcCtrlPtIntn[0] + cpM.x * minCpADist; + rs.ctrlpts[1] = srcCtrlPtIntn[1] + cpM.y * minCpADist; } } - } - return rstyle; - }; - styfn$5.getNonDefaultPropertiesHash = function(ele, propNames, seed) { - var hash = seed.slice(); - var name2, val, strVal, chVal; - var i3, j; - for (i3 = 0; i3 < propNames.length; i3++) { - name2 = propNames[i3]; - val = ele.pstyle(name2, 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]); + if (badEnd || badAEnd || closeEndACp) { + overlapping = true; + var _cpD = { + // delta + x: rs.ctrlpts[0] - tgtPos.x, + y: rs.ctrlpts[1] - tgtPos.y + }; + var _cpL = Math.sqrt(_cpD.x * _cpD.x + _cpD.y * _cpD.y); + var _cpM = { + // normalised delta + x: _cpD.x / _cpL, + y: _cpD.y / _cpL + }; + var _radius = 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 + }; + 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); + } else { + rs.ctrlpts[0] = tgtCtrlPtIntn[0] + _cpM.x * minCpADist; + rs.ctrlpts[1] = tgtCtrlPtIntn[1] + _cpM.y * minCpADist; } } - } - 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 name2 = names[j]; - var value = props[name2]; - style.css(name2, value); - } - } - 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; + if (overlapping) { + this.findEndpoints(edge); } - json2.push({ - selector: !selector2 ? "core" : selector2.toString(), - style: css - }); } - return json2; }; - var styfn$3 = {}; - styfn$3.appendFromString = function(string2) { - var self2 = this; - var style = this; - var remaining = "" + string2; - 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 = ""; + BRp$c.storeAllpts = function(edge) { + var rs = edge._private.rscratch; + if (rs.edgeType === "multibezier" || rs.edgeType === "bezier" || rs.edgeType === "self" || rs.edgeType === "compound") { + rs.allpts = []; + rs.allpts.push(rs.startX, rs.startY); + 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); + } } - } - function removePropAndValFromRem() { - if (blockRem.length > propAndValStr.length) { - blockRem = blockRem.substr(propAndValStr.length); + rs.allpts.push(rs.endX, rs.endY); + var m2, mt; + if (rs.ctrlpts.length / 2 % 2 === 0) { + m2 = rs.allpts.length / 2 - 1; + rs.midX = rs.allpts[m2]; + rs.midY = rs.allpts[m2 + 1]; } 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; + m2 = rs.allpts.length / 2 - 3; + mt = 0.5; + 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); } - 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; + } else if (rs.edgeType === "straight") { + rs.allpts = [rs.startX, rs.startY, rs.endX, rs.endY]; + rs.midX = (rs.startX + rs.endX + rs.arrowStartX + rs.arrowEndX) / 4; + rs.midY = (rs.startY + rs.endY + rs.arrowStartY + rs.arrowEndY) / 4; + } else if (rs.edgeType === "segments") { + rs.allpts = []; + 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)); } } - 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; + 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 _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; } - 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(string2) { - var style = this; - style.resetToDefault(); - style.appendFromString(string2); - 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 - }, - 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"], - 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", "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"] - }, - 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"] - }, - 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 string(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; - } + BRp$c.checkForInvalidEdgeWarning = function(edge) { + var rs = edge[0]._private.rscratch; + 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) { + rs.loggedErr = true; + warn("Edge `" + edge.id() + "` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."); } + } + }; + BRp$c.findEdgeControlPoints = function(edges5) { + var _this = this; + if (!edges5 || edges5.length === 0) { + return; + } + var r2 = this; + var cy = r2.cy; + var hasCompounds = cy.hasCompoundNodes(); + var hashTable = { + 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; + } + }, "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); + } + map22.set(pairId2[1], val); + }, "set") }; - var diff = { - zeroNonZero: function zeroNonZero(val1, val2) { - if ((val1 == null || val2 == null) && val1 !== val2) { - return true; + var pairIds = []; + var haystackEdges = []; + 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()) { + continue; + } + if (curveStyle === "haystack") { + haystackEdges.push(edge); + continue; + } + 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; + var srcIndex = src.poolIndex(); + var tgtIndex = tgt.poolIndex(); + var pairId = [srcIndex, tgtIndex].sort(); + var tableEntry = hashTable.get(pairId); + if (tableEntry == null) { + tableEntry = { + eles: [] + }; + hashTable.set(pairId, tableEntry); + pairIds.push(pairId); + } + tableEntry.eles.push(edge); + if (edgeIsUnbundled) { + tableEntry.hasUnbundled = true; + } + if (edgeIsBezier) { + tableEntry.hasBezier = true; + } + } + 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(e3) { + return e3.isBundledBezier(); + }); + clearArray(pairInfo.eles); + pllEdges.forEach(function(edge2) { + return pairInfo.eles.push(edge2); + }); + pairInfo.eles.sort(function(edge1, edge2) { + return edge1.poolIndex() - edge2.poolIndex(); + }); + } + var firstEdge = pairInfo.eles[0]; + var src2 = firstEdge.source(); + var tgt2 = firstEdge.target(); + if (src2.poolIndex() > tgt2.poolIndex()) { + var temp = src2; + src2 = tgt2; + tgt2 = temp; + } + var srcPos = pairInfo.srcPos = src2.position(); + var tgtPos = pairInfo.tgtPos = tgt2.position(); + var srcW = pairInfo.srcW = src2.outerWidth(); + var srcH = pairInfo.srcH = src2.outerHeight(); + var tgtW = pairInfo.tgtW = tgt2.outerWidth(); + var tgtH = pairInfo.tgtH = tgt2.outerHeight(); + 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, + "south": 0, + "east": 0, + "northwest": 0, + "southwest": 0, + "northeast": 0, + "southeast": 0 + }; + 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.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, srcCornerRadius, srcRs); + var srcIntn = pairInfo.srcIntn = srcOutside; + 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], + x2: tgtOutside[0], + y1: srcOutside[1], + y2: tgtOutside[1] + }; + var posPts = pairInfo.posPts = { + x1: srcPos.x, + x2: tgtPos.x, + y1: srcPos.y, + y2: tgtPos.y + }; + var dy = tgtOutside[1] - srcOutside[1]; + var dx = tgtOutside[0] - srcOutside[0]; + var l2 = Math.sqrt(dx * dx + dy * dy); + var vector = pairInfo.vector = { + x: dx, + y: dy + }; + var vectorNorm = pairInfo.vectorNorm = { + x: vector.x / l2, + y: vector.y / l2 + }; + var vectorNormInverse = { + x: -vectorNorm.y, + y: vectorNorm.x + }; + 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, + dirCounts: pairInfo.dirCounts, + calculatedIntersection: true, + hasBezier: pairInfo.hasBezier, + hasUnbundled: pairInfo.hasUnbundled, + eles: pairInfo.eles, + srcPos: tgtPos, + tgtPos: srcPos, + srcW: tgtW, + srcH: tgtH, + tgtW: srcW, + tgtH: srcH, + srcIntn: tgtIntn, + tgtIntn: srcIntn, + srcShape: tgtShape, + tgtShape: srcShape, + posPts: { + x1: posPts.x2, + y1: posPts.y2, + x2: posPts.x1, + y2: posPts.y1 + }, + intersectionPts: { + x1: intersectionPts.x2, + y1: intersectionPts.y2, + x2: intersectionPts.x1, + y2: intersectionPts.y1 + }, + vector: { + x: -vector.x, + y: -vector.y + }, + vectorNorm: { + x: -vectorNorm.x, + y: -vectorNorm.y + }, + vectorNormInverse: { + x: -vectorNormInverse.x, + y: -vectorNormInverse.y + } + }; } - if (val1 == 0 && val2 != 0) { - return true; - } else if (val1 != 0 && val2 == 0) { - return true; + var passedPairInfo = edgeIsSwapped ? swappedpairInfo : pairInfo; + 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, _i2, _edgeIsUnbundled); + } else if (src2 === tgt2) { + _this.findLoopPoints(_edge, passedPairInfo, _i2, _edgeIsUnbundled); + } else if (_curveStyle.endsWith("segments")) { + _this.findSegmentsPoints(_edge, passedPairInfo); + } else if (_curveStyle.endsWith("taxi")) { + _this.findTaxiPoints(_edge, passedPairInfo); + } else if (_curveStyle === "straight" || !_edgeIsUnbundled && pairInfo.eles.length % 2 === 1 && _i2 === Math.floor(pairInfo.eles.length / 2)) { + _this.findStraightEdgePoints(_edge); } else { - return false; + _this.findBezierPoints(_edge, passedPairInfo, _i2, _edgeIsUnbundled, edgeIsSwapped); } - }, - any: function any(val1, val2) { - return val1 != val2; - }, - emptyNonEmpty: function emptyNonEmpty(str1, str2) { - var empty1 = emptyString(str1); - var empty2 = emptyString(str2); - return empty1 && !empty2 || !empty1 && empty2; + _this.findEndpoints(_edge); + _this.tryToCorrectInvalidPoints(_edge, passedPairInfo); + _this.checkForInvalidEdgeWarning(_edge); + _this.storeAllpts(_edge); + _this.storeEdgeProjections(_edge); + _this.calculateArrowAngles(_edge); + _this.recalculateEdgeLabelProjections(_edge); + _this.calculateLabelAngles(_edge); } + }, "_loop"); + for (var p3 = 0; p3 < pairIds.length; p3++) { + _loop(p3); + } + this.findHaystackPoints(haystackEdges); + }; + __name(getPts, "getPts"); + BRp$c.getSegmentPoints = function(edge) { + var rs = edge[0]._private.rscratch; + 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 type3 = rs.edgeType; + if (type3 === "bezier" || type3 === "multibezier" || type3 === "self" || type3 === "compound") { + this.recalculateRenderedStyle(edge); + return getPts(rs.ctrlpts); + } + }; + BRp$c.getEdgeMidpoint = function(edge) { + var rs = edge[0]._private.rscratch; + this.recalculateRenderedStyle(edge); + return { + x: rs.midX, + y: rs.midY }; - var t4 = styfn$2.types; - var mainLabel = [{ - name: "label", - type: t4.text, - triggersBounds: diff.any, - triggersZOrder: diff.emptyNonEmpty - }, { - name: "text-rotation", - type: t4.textRotation, - triggersBounds: diff.any - }, { - name: "text-margin-x", - type: t4.bidirectionalSize, - triggersBounds: diff.any - }, { - name: "text-margin-y", - type: t4.bidirectionalSize, - triggersBounds: diff.any - }]; - var sourceLabel = [{ - name: "source-label", - type: t4.text, - triggersBounds: diff.any - }, { - name: "source-text-rotation", - type: t4.textRotation, - triggersBounds: diff.any - }, { - name: "source-text-margin-x", - type: t4.bidirectionalSize, - triggersBounds: diff.any - }, { - name: "source-text-margin-y", - type: t4.bidirectionalSize, - triggersBounds: diff.any - }, { - name: "source-text-offset", - type: t4.size, - triggersBounds: diff.any - }]; - var targetLabel = [{ - name: "target-label", - type: t4.text, - triggersBounds: diff.any - }, { - name: "target-text-rotation", - type: t4.textRotation, - triggersBounds: diff.any - }, { - name: "target-text-margin-x", - type: t4.bidirectionalSize, - triggersBounds: diff.any - }, { - name: "target-text-margin-y", - type: t4.bidirectionalSize, - triggersBounds: diff.any - }, { - name: "target-text-offset", - type: t4.size, - triggersBounds: diff.any - }]; - var labelDimensions = [{ - name: "font-family", - type: t4.fontFamily, - triggersBounds: diff.any - }, { - name: "font-style", - type: t4.fontStyle, - triggersBounds: diff.any - }, { - name: "font-weight", - type: t4.fontWeight, - triggersBounds: diff.any - }, { - name: "font-size", - type: t4.size, - triggersBounds: diff.any - }, { - name: "text-transform", - type: t4.textTransform, - triggersBounds: diff.any - }, { - name: "text-wrap", - type: t4.textWrap, - triggersBounds: diff.any - }, { - name: "text-overflow-wrap", - type: t4.textOverflowWrap, - triggersBounds: diff.any - }, { - name: "text-max-width", - type: t4.size, - triggersBounds: diff.any - }, { - name: "text-outline-width", - type: t4.size, - triggersBounds: diff.any - }, { - name: "line-height", - type: t4.positiveNumber, - triggersBounds: diff.any - }]; - var commonLabel = [{ - name: "text-valign", - type: t4.valign, - triggersBounds: diff.any - }, { - name: "text-halign", - type: t4.halign, - triggersBounds: diff.any - }, { - name: "color", - type: t4.color - }, { - name: "text-outline-color", - type: t4.color - }, { - name: "text-outline-opacity", - type: t4.zeroOneNumber - }, { - name: "text-background-color", - type: t4.color - }, { - name: "text-background-opacity", - type: t4.zeroOneNumber - }, { - name: "text-background-padding", - type: t4.size, - triggersBounds: diff.any - }, { - name: "text-border-opacity", - type: t4.zeroOneNumber - }, { - name: "text-border-color", - type: t4.color - }, { - name: "text-border-width", - type: t4.size, - triggersBounds: diff.any - }, { - name: "text-border-style", - type: t4.borderStyle, - triggersBounds: diff.any - }, { - name: "text-background-shape", - type: t4.textBackgroundShape, - triggersBounds: diff.any - }, { - name: "text-justification", - type: t4.justification - }]; - var behavior = [{ - name: "events", - type: t4.bool - }, { - name: "text-events", - type: t4.bool - }]; - var visibility = [{ - name: "display", - type: t4.display, - triggersZOrder: diff.any, - triggersBounds: diff.any, - triggersBoundsOfParallelBeziers: true - }, { - name: "visibility", - type: t4.visibility, - triggersZOrder: diff.any - }, { - name: "opacity", - type: t4.zeroOneNumber, - triggersZOrder: diff.zeroNonZero - }, { - name: "text-opacity", - type: t4.zeroOneNumber - }, { - name: "min-zoomed-font-size", - type: t4.size - }, { - name: "z-compound-depth", - type: t4.zCompoundDepth, - triggersZOrder: diff.any - }, { - name: "z-index-compare", - type: t4.zIndexCompare, - triggersZOrder: diff.any - }, { - name: "z-index", - type: t4.nonNegativeInt, - triggersZOrder: diff.any - }]; - var overlay = [{ - name: "overlay-padding", - type: t4.size, - triggersBounds: diff.any - }, { - name: "overlay-color", - type: t4.color - }, { - name: "overlay-opacity", - type: t4.zeroOneNumber, - triggersBounds: diff.zeroNonZero - }, { - name: "overlay-shape", - type: t4.overlayShape, - triggersBounds: diff.any - }]; - var underlay = [{ - name: "underlay-padding", - type: t4.size, - triggersBounds: diff.any - }, { - name: "underlay-color", - type: t4.color - }, { - name: "underlay-opacity", - type: t4.zeroOneNumber, - triggersBounds: diff.zeroNonZero - }, { - name: "underlay-shape", - type: t4.overlayShape, - triggersBounds: diff.any - }]; - var transition = [{ - name: "transition-property", - type: t4.propList - }, { - name: "transition-duration", - type: t4.time - }, { - name: "transition-delay", - type: t4.time - }, { - name: "transition-timing-function", - type: t4.easing - }]; - var nodeSizeHashOverride = function nodeSizeHashOverride2(ele, parsedProp) { - if (parsedProp.value === "label") { - return -ele.poolIndex(); + }; + BRp$b = {}; + BRp$b.manualEndptToPx = function(node2, prop) { + var r2 = this; + var npos = node2.position(); + var w3 = node2.outerWidth(); + var h2 = node2.outerHeight(); + var rs = node2._private.rscratch; + if (prop.value.length === 2) { + var p3 = [prop.pfValue[0], prop.pfValue[1]]; + if (prop.units[0] === "%") { + p3[0] = p3[0] * w3; + } + if (prop.units[1] === "%") { + p3[1] = p3[1] * h2; + } + p3[0] += npos.x; + p3[1] += npos.y; + return p3; + } else { + 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 r2 = this; + var intersect3; + var source = edge.source()[0]; + var target = edge.target()[0]; + var srcPos = source.position(); + var tgtPos = target.position(); + var tgtArShape = edge.pstyle("target-arrow-shape").value; + 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 et2 = rs.edgeType; + var taxi = curveStyle === "taxi"; + 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 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; + 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; + p22 = srcArrowFromPt; + } + if (tgtManEndptVal === "inside-to-node") { + intersect3 = [tgtPos.x, tgtPos.y]; + } else if (tgtManEndpt.units) { + intersect3 = this.manualEndptToPx(target, tgtManEndpt); + } else if (tgtManEndptVal === "outside-to-line") { + 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]; + } + 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; + var lh = trs.labelHeight; + var lx = trs.labelX; + var ly = trs.labelY; + var lw2 = lw / 2; + var lh2 = lh / 2; + var va = target.pstyle("text-valign").value; + if (va === "top") { + ly -= lh2; + } else if (va === "bottom") { + ly += lh2; + } + var ha = target.pstyle("text-halign").value; + if (ha === "left") { + lx -= lw2; + } else if (ha === "right") { + lx += lw2; + } + 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(intersect3)); + var labIntSqdist = sqdist(refPt, array2point(labelIntersect)); + var minSqDist = intSqdist; + if (labIntSqdist < intSqdist) { + intersect3 = labelIntersect; + minSqDist = labIntSqdist; + } + if (labelIntersect.length > 2) { + var labInt2SqDist = sqdist(refPt, { + x: labelIntersect[2], + y: labelIntersect[3] + }); + if (labInt2SqDist < minSqDist) { + intersect3 = [labelIntersect[2], labelIntersect[3]]; + } + } + } + } + } + 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") { + intersect3 = [srcPos.x, srcPos.y]; + } else if (srcManEndpt.units) { + intersect3 = this.manualEndptToPx(source, srcManEndpt); + } else if (srcManEndptVal === "outside-to-line") { + intersect3 = rs.srcIntn; + } else { + if (srcManEndptVal === "outside-to-node" || srcManEndptVal === "outside-to-node-or-label") { + p2_i = p22; + } else if (srcManEndptVal === "outside-to-line" || srcManEndptVal === "outside-to-line-or-label") { + p2_i = [tgtPos.x, tgtPos.y]; + } + 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; + var _lh = srs.labelHeight; + var _lx = srs.labelX; + var _ly = srs.labelY; + var _lw2 = _lw / 2; + var _lh2 = _lh / 2; + var _va = source.pstyle("text-valign").value; + if (_va === "top") { + _ly -= _lh2; + } else if (_va === "bottom") { + _ly += _lh2; + } + var _ha = source.pstyle("text-halign").value; + if (_ha === "left") { + _lx -= _lw2; + } else if (_ha === "right") { + _lx += _lw2; + } + 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(intersect3)); + var _labIntSqdist = sqdist(_refPt, array2point(_labelIntersect)); + var _minSqDist = _intSqdist; + if (_labIntSqdist < _intSqdist) { + intersect3 = [_labelIntersect[0], _labelIntersect[1]]; + _minSqDist = _labIntSqdist; + } + if (_labelIntersect.length > 2) { + var _labInt2SqDist = sqdist(_refPt, { + x: _labelIntersect[2], + y: _labelIntersect[3] + }); + if (_labInt2SqDist < _minSqDist) { + intersect3 = [_labelIntersect[2], _labelIntersect[3]]; + } + } + } + } + } + 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$1(rs.startX) || !number$1(rs.startY) || !number$1(rs.endX) || !number$1(rs.endY)) { + rs.badLine = true; } else { - return parsedProp.pfValue; + rs.badLine = false; + } + } + }; + BRp$b.getSourceEndpoint = function(edge) { + var rs = edge[0]._private.rscratch; + this.recalculateRenderedStyle(edge); + switch (rs.edgeType) { + case "haystack": + return { + x: rs.haystackPts[0], + y: rs.haystackPts[1] + }; + default: + return { + x: rs.arrowStartX, + y: rs.arrowStartY + }; + } + }; + BRp$b.getTargetEndpoint = function(edge) { + var rs = edge[0]._private.rscratch; + this.recalculateRenderedStyle(edge); + switch (rs.edgeType) { + case "haystack": + return { + x: rs.haystackPts[2], + y: rs.haystackPts[3] + }; + default: + return { + x: rs.arrowEndX, + y: rs.arrowEndY + }; + } + }; + BRp$a = {}; + __name(pushBezierPts, "pushBezierPts"); + BRp$a.storeEdgeProjections = function(edge) { + var _p = edge._private; + var rs = _p.rscratch; + var et2 = rs.edgeType; + _p.rstyle.bezierPts = null; + _p.rstyle.linePts = null; + _p.rstyle.haystackPts = null; + if (et2 === "multibezier" || et2 === "bezier" || et2 === "self" || et2 === "compound") { + _p.rstyle.bezierPts = []; + for (var i2 = 0; i2 + 5 < rs.allpts.length; i2 += 4) { + pushBezierPts(this, edge, rs.allpts.slice(i2, i2 + 6)); + } + } else if (et2 === "segments") { + var lpts = _p.rstyle.linePts = []; + for (var i2 = 0; i2 + 1 < rs.allpts.length; i2 += 2) { + lpts.push({ + x: rs.allpts[i2], + y: rs.allpts[i2 + 1] + }); } + } else if (et2 === "haystack") { + var hpts = rs.haystackPts; + _p.rstyle.haystackPts = [{ + x: hpts[0], + y: hpts[1] + }, { + x: hpts[2], + y: hpts[3] + }]; + } + _p.rstyle.arrowWidth = this.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.arrowShapeWidth; + }; + BRp$a.recalculateEdgeProjections = function(edges5) { + this.findEdgeControlPoints(edges5); + }; + BRp$9 = {}; + BRp$9.recalculateNodeLabelProjection = function(node2) { + 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 padding3 = node2.padding(); + var nodePos = node2.position(); + var textHalign = node2.pstyle("text-halign").strValue; + var textValign = node2.pstyle("text-valign").strValue; + var rs = _p.rscratch; + var rstyle = _p.rstyle; + switch (textHalign) { + case "left": + textX = nodePos.x - nodeWidth / 2 - padding3; + break; + case "right": + textX = nodePos.x + nodeWidth / 2 + padding3; + break; + default: + textX = nodePos.x; + } + switch (textValign) { + case "top": + textY = nodePos.y - nodeHeight / 2 - padding3; + break; + case "bottom": + textY = nodePos.y + nodeHeight / 2 + padding3; + break; + default: + textY = nodePos.y; + } + rs.labelX = textX; + rs.labelY = textY; + rstyle.labelX = textX; + rstyle.labelY = textY; + this.calculateLabelAngles(node2); + this.applyLabelDimensions(node2); + }; + lineAngleFromDelta = /* @__PURE__ */ __name(function lineAngleFromDelta2(dx, dy) { + var angle2 = Math.atan(dy / dx); + if (dx === 0 && angle2 < 0) { + angle2 = angle2 * -1; + } + 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); + }, "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 p3; + var _p = edge._private; + var rs = _p.rscratch; + var r2 = this; + var content = { + mid: edge.pstyle("label").strValue, + source: edge.pstyle("source-label").strValue, + target: edge.pstyle("target-label").strValue }; - var nodeBody = [{ - name: "height", - type: t4.nodeSize, - triggersBounds: diff.any, - hashOverride: nodeSizeHashOverride - }, { - name: "width", - type: t4.nodeSize, - triggersBounds: diff.any, - hashOverride: nodeSizeHashOverride - }, { - name: "shape", - type: t4.nodeShape, - triggersBounds: diff.any - }, { - name: "shape-polygon-points", - type: t4.polygonPointList, - triggersBounds: diff.any - }, { - name: "background-color", - type: t4.color - }, { - name: "background-fill", - type: t4.fill - }, { - name: "background-opacity", - type: t4.zeroOneNumber - }, { - name: "background-blacken", - type: t4.nOneOneNumber - }, { - name: "background-gradient-stop-colors", - type: t4.colors - }, { - name: "background-gradient-stop-positions", - type: t4.percentages - }, { - name: "background-gradient-direction", - type: t4.gradientDirection - }, { - name: "padding", - type: t4.sizeMaybePercent, - triggersBounds: diff.any - }, { - name: "padding-relative-to", - type: t4.paddingRelativeTo, - triggersBounds: diff.any - }, { - name: "bounds-expansion", - type: t4.boundsExpansion, - triggersBounds: diff.any - }]; - var nodeBorder = [{ - name: "border-color", - type: t4.color - }, { - name: "border-opacity", - type: t4.zeroOneNumber - }, { - name: "border-width", - type: t4.size, - triggersBounds: diff.any - }, { - name: "border-style", - type: t4.borderStyle - }]; - var backgroundImage = [{ - name: "background-image", - type: t4.urls - }, { - name: "background-image-crossorigin", - type: t4.bgCrossOrigin - }, { - name: "background-image-opacity", - type: t4.zeroOneNumbers - }, { - name: "background-image-containment", - type: t4.bgContainment - }, { - name: "background-image-smoothing", - type: t4.bools - }, { - name: "background-position-x", - type: t4.bgPos - }, { - name: "background-position-y", - type: t4.bgPos - }, { - name: "background-width-relative-to", - type: t4.bgRelativeTo - }, { - name: "background-height-relative-to", - type: t4.bgRelativeTo - }, { - name: "background-repeat", - type: t4.bgRepeat - }, { - name: "background-fit", - type: t4.bgFit - }, { - name: "background-clip", - type: t4.bgClip - }, { - name: "background-width", - type: t4.bgWH - }, { - name: "background-height", - type: t4.bgWH - }, { - name: "background-offset-x", - type: t4.bgPos - }, { - name: "background-offset-y", - type: t4.bgPos - }]; - var compound = [{ - name: "position", - type: t4.position, - triggersBounds: diff.any - }, { - name: "compound-sizing-wrt-labels", - type: t4.compoundIncludeLabels, - triggersBounds: diff.any - }, { - name: "min-width", - type: t4.size, - triggersBounds: diff.any - }, { - name: "min-width-bias-left", - type: t4.sizeMaybePercent, - triggersBounds: diff.any - }, { - name: "min-width-bias-right", - type: t4.sizeMaybePercent, - triggersBounds: diff.any - }, { - name: "min-height", - type: t4.size, - triggersBounds: diff.any - }, { - name: "min-height-bias-top", - type: t4.sizeMaybePercent, - triggersBounds: diff.any - }, { - name: "min-height-bias-bottom", - type: t4.sizeMaybePercent, - triggersBounds: diff.any - }]; - var edgeLine = [{ - name: "line-style", - type: t4.lineStyle - }, { - name: "line-color", - type: t4.color - }, { - name: "line-fill", - type: t4.fill - }, { - name: "line-cap", - type: t4.lineCap - }, { - name: "line-opacity", - type: t4.zeroOneNumber - }, { - name: "line-dash-pattern", - type: t4.numbers - }, { - name: "line-dash-offset", - type: t4.number - }, { - name: "line-gradient-stop-colors", - type: t4.colors - }, { - name: "line-gradient-stop-positions", - type: t4.percentages - }, { - name: "curve-style", - type: t4.curveStyle, - triggersBounds: diff.any, - triggersBoundsOfParallelBeziers: true - }, { - name: "haystack-radius", - type: t4.zeroOneNumber, - triggersBounds: diff.any - }, { - name: "source-endpoint", - type: t4.edgeEndpoint, - triggersBounds: diff.any - }, { - name: "target-endpoint", - type: t4.edgeEndpoint, - triggersBounds: diff.any - }, { - name: "control-point-step-size", - type: t4.size, - triggersBounds: diff.any - }, { - name: "control-point-distances", - type: t4.bidirectionalSizes, - triggersBounds: diff.any - }, { - name: "control-point-weights", - type: t4.numbers, - triggersBounds: diff.any - }, { - name: "segment-distances", - type: t4.bidirectionalSizes, - triggersBounds: diff.any - }, { - name: "segment-weights", - type: t4.numbers, - triggersBounds: diff.any - }, { - name: "taxi-turn", - type: t4.bidirectionalSizeMaybePercent, - triggersBounds: diff.any - }, { - name: "taxi-turn-min-distance", - type: t4.size, - triggersBounds: diff.any - }, { - name: "taxi-direction", - type: t4.axisDirection, - triggersBounds: diff.any - }, { - name: "edge-distances", - type: t4.edgeDistances, - triggersBounds: diff.any - }, { - name: "arrow-scale", - type: t4.positiveNumber, - triggersBounds: diff.any - }, { - name: "loop-direction", - type: t4.angle, - triggersBounds: diff.any - }, { - name: "loop-sweep", - type: t4.angle, - triggersBounds: diff.any - }, { - name: "source-distance-from-node", - type: t4.size, - triggersBounds: diff.any - }, { - name: "target-distance-from-node", - type: t4.size, - triggersBounds: diff.any - }]; - var ghost = [{ - name: "ghost", - type: t4.bool, - triggersBounds: diff.any - }, { - name: "ghost-offset-x", - type: t4.bidirectionalSize, - triggersBounds: diff.any - }, { - name: "ghost-offset-y", - type: t4.bidirectionalSize, - triggersBounds: diff.any - }, { - name: "ghost-opacity", - type: t4.zeroOneNumber - }]; - var core3 = [{ - name: "selection-box-color", - type: t4.color - }, { - name: "selection-box-opacity", - type: t4.zeroOneNumber - }, { - name: "selection-box-border-color", - type: t4.color - }, { - name: "selection-box-border-width", - type: t4.size - }, { - name: "active-bg-color", - type: t4.color - }, { - name: "active-bg-opacity", - type: t4.zeroOneNumber - }, { - name: "active-bg-size", - type: t4.size - }, { - name: "outside-texture-bg-color", - type: t4.color - }, { - name: "outside-texture-bg-opacity", - type: t4.zeroOneNumber - }]; - var pie2 = []; - styfn$2.pieBackgroundN = 16; - pie2.push({ - name: "pie-size", - type: t4.sizeMaybePercent - }); - for (var i3 = 1; i3 <= styfn$2.pieBackgroundN; i3++) { - pie2.push({ - name: "pie-" + i3 + "-background-color", - type: t4.color - }); - pie2.push({ - name: "pie-" + i3 + "-background-size", - type: t4.percent - }); - pie2.push({ - name: "pie-" + i3 + "-background-opacity", - type: t4.zeroOneNumber - }); + if (content.mid || content.source || content.target) ; + else { + return; + } + p3 = { + x: rs.midX, + y: rs.midY + }; + var setRs = /* @__PURE__ */ __name(function setRs2(propName, prefix, value2) { + setPrefixedProperty(_p.rscratch, propName, prefix, value2); + setPrefixedProperty(_p.rstyle, propName, prefix, value2); + }, "setRs"); + setRs("labelX", null, p3.x); + setRs("labelY", null, p3.y); + var midAngle = lineAngleFromDelta(rs.midDispX, rs.midDispY); + setRs("labelAutoAngle", null, midAngle); + var createControlPointInfo = /* @__PURE__ */ __name(function createControlPointInfo2() { + if (createControlPointInfo2.cache) { + return createControlPointInfo2.cache; + } + var ctrlpts = []; + for (var i2 = 0; i2 + 5 < rs.allpts.length; i2 += 4) { + var p0 = { + x: rs.allpts[i2], + y: rs.allpts[i2 + 1] + }; + var p1 = { + x: rs.allpts[i2 + 2], + y: rs.allpts[i2 + 3] + }; + var p22 = { + x: rs.allpts[i2 + 4], + y: rs.allpts[i2 + 5] + }; + ctrlpts.push({ + p0, + p1, + p2: p22, + startDist: 0, + length: 0, + segments: [] + }); + } + var bpts = _p.rstyle.bezierPts; + 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: t03, + t1: t13, + startDist: prevSegment ? prevSegment.startDist + prevSegment.length : 0, + length: length2 + }; + cp2.segments.push(segment); + cp2.length += length2; + } + __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[_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[_i * nProjs + nProjs - 1], cp.p2, r2.bezierProjPcts[nProjs - 1], 1); + } + return createControlPointInfo2.cache = ctrlpts; + }, "createControlPointInfo"); + var calculateEndProjection = /* @__PURE__ */ __name(function calculateEndProjection2(prefix) { + var angle2; + var isSrc = prefix === "source"; + if (!content[prefix]) { + return; + } + var offset = edge.pstyle(prefix + "-text-offset").pfValue; + switch (rs.edgeType) { + case "self": + case "compound": + case "bezier": + case "multibezier": { + var cps = createControlPointInfo(); + var selected; + var startDist = 0; + var totalDist = 0; + 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) { + selected = { + cp: _cp, + segment: _seg + }; + break; + } + } + if (selected) { + break; + } + } + var cp = selected.cp; + var seg = selected.segment; + var tSegment = (offset - startDist) / seg.length; + var segDt = seg.t1 - seg.t0; + 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 d2 = 0, di, d0; + var p0, p1; + var l2 = rs.allpts.length; + for (var _i2 = 0; _i2 + 3 < l2; _i2 += 2) { + if (isSrc) { + p0 = { + x: rs.allpts[_i2], + y: rs.allpts[_i2 + 1] + }; + p1 = { + x: rs.allpts[_i2 + 2], + y: rs.allpts[_i2 + 3] + }; + } else { + p0 = { + x: rs.allpts[l2 - 2 - _i2], + y: rs.allpts[l2 - 1 - _i2] + }; + p1 = { + x: rs.allpts[l2 - 4 - _i2], + y: rs.allpts[l2 - 3 - _i2] + }; + } + 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); + p3 = lineAt(p0, p1, _t); + angle2 = lineAngle(p0, p1); + break; + } + } + setRs("labelX", prefix, p3.x); + setRs("labelY", prefix, p3.y); + setRs("labelAutoAngle", prefix, angle2); + }, "calculateEndProjection"); + calculateEndProjection("source"); + calculateEndProjection("target"); + this.applyLabelDimensions(edge); + }; + BRp$9.applyLabelDimensions = function(ele) { + this.applyPrefixedLabelDimensions(ele); + if (ele.isEdge()) { + this.applyPrefixedLabelDimensions(ele, "source"); + this.applyPrefixedLabelDimensions(ele, "target"); } - var edgeArrow = []; - var arrowPrefixes = styfn$2.arrowPrefixes = ["source", "mid-source", "target", "mid-target"]; - [{ - name: "arrow-shape", - type: t4.arrowShape, - triggersBounds: diff.any - }, { - name: "arrow-color", - type: t4.color - }, { - name: "arrow-fill", - type: t4.arrowFill - }].forEach(function(prop2) { - arrowPrefixes.forEach(function(prefix) { - var name2 = prefix + "-" + prop2.name; - var type2 = prop2.type, triggersBounds = prop2.triggersBounds; - edgeArrow.push({ - name: name2, - type: type2, - triggersBounds - }); - }); - }, {}); - var props = styfn$2.properties = [].concat(behavior, transition, visibility, overlay, underlay, ghost, commonLabel, labelDimensions, mainLabel, sourceLabel, targetLabel, nodeBody, nodeBorder, backgroundImage, pie2, compound, edgeLine, edgeArrow, core3); - var propGroups = styfn$2.propertyGroups = { - // common to all eles - behavior, - transition, - visibility, - overlay, - underlay, - ghost, - // labels - commonLabel, - labelDimensions, - mainLabel, - sourceLabel, - targetLabel, - // node props - nodeBody, - nodeBorder, - backgroundImage, - pie: pie2, - compound, - // edge props - edgeLine, - edgeArrow, - core: core3 - }; - var propGroupNames = styfn$2.propertyGroupNames = {}; - var propGroupKeys = styfn$2.propertyGroupKeys = Object.keys(propGroups); - propGroupKeys.forEach(function(key) { - propGroupNames[key] = propGroups[key].map(function(prop2) { - return prop2.name; - }); - propGroups[key].forEach(function(prop2) { - return prop2.groupKey = key; - }); - }); - var aliases = styfn$2.aliases = [{ - name: "content", - pointsTo: "label" - }, { - name: "control-point-distance", - pointsTo: "control-point-distances" - }, { - name: "control-point-weight", - pointsTo: "control-point-weights" - }, { - name: "edge-text-rotation", - pointsTo: "text-rotation" - }, { - name: "padding-left", - pointsTo: "padding" - }, { - name: "padding-right", - pointsTo: "padding" - }, { - name: "padding-top", - pointsTo: "padding" - }, { - name: "padding-bottom", - pointsTo: "padding" - }]; - styfn$2.propertyNames = props.map(function(p2) { - return p2.name; - }); - for (var _i = 0; _i < props.length; _i++) { - var prop = props[_i]; - props[prop.name] = prop; + }; + BRp$9.applyPrefixedLabelDimensions = function(ele, prefix) { + var _p = ele._private; + var text2 = this.getLabelText(ele, prefix); + var labelDims = this.calculateLabelDimensions(ele, text2); + var lineHeight = ele.pstyle("line-height").pfValue; + var textWrap = ele.pstyle("text-wrap").strValue; + var lines = getPrefixedProperty(_p.rscratch, "labelWrapCachedLines", prefix) || []; + var numLines = textWrap !== "wrap" ? 1 : Math.max(lines.length, 1); + var normPerLineHeight = labelDims.height / numLines; + var labelLineHeight = normPerLineHeight * lineHeight; + 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) { + var _p = ele._private; + var pfd = prefix ? prefix + "-" : ""; + var text2 = ele.pstyle(pfd + "label").strValue; + var textTransform = ele.pstyle("text-transform").value; + 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 ""; } - for (var _i2 = 0; _i2 < aliases.length; _i2++) { - var alias = aliases[_i2]; - var pointsToProp = props[alias.pointsTo]; - var aliasProp = { - name: alias.name, - alias: true, - pointsTo: pointsToProp - }; - props.push(aliasProp); - props[alias.name] = aliasProp; + if (textTransform == "none") ; + else if (textTransform == "uppercase") { + text2 = text2.toUpperCase(); + } else if (textTransform == "lowercase") { + text2 = text2.toLowerCase(); } - })(); - styfn$2.getDefaultProperty = function(name2) { - return this.getDefaultProperties()[name2]; + var wrapStyle = ele.pstyle("text-wrap").value; + if (wrapStyle === "wrap") { + var labelKey = rscratch("labelKey"); + if (labelKey != null && rscratch("labelWrapKey") === labelKey) { + return rscratch("labelWrapCachedText"); + } + 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 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) { + var processedLine = line2.split("").join(zwsp); + line2 = processedLine; + } + if (lineW > maxW) { + var separatorMatches = line2.matchAll(separatorRegex); + var 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; + } + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + if (!subline.match(/^[\s\u200b]+$/)) { + wrappedLines.push(subline); + } + } else { + wrappedLines.push(line2); + } + } + rscratch("labelWrapCachedLines", wrappedLines); + text2 = rscratch("labelWrapCachedText", wrappedLines.join("\n")); + rscratch("labelWrapKey", labelKey); + } else if (wrapStyle === "ellipsis") { + var _maxW = ele.pstyle("text-max-width").pfValue; + var ellipsized = ""; + var ellipsis = "\u2026"; + var incLastCh = false; + if (this.calculateLabelDimensions(ele, text2).width < _maxW) { + return text2; + } + for (var i2 = 0; i2 < text2.length; i2++) { + var widthWithNextCh = this.calculateLabelDimensions(ele, ellipsized + text2[i2] + ellipsis).width; + if (widthWithNextCh > _maxW) { + break; + } + ellipsized += text2[i2]; + if (i2 === text2.length - 1) { + incLastCh = true; + } + } + if (!incLastCh) { + ellipsized += ellipsis; + } + return ellipsized; + } + return text2; }; - styfn$2.getDefaultProperties = function() { - var _p = this._private; - if (_p.defaultProperties != null) { - return _p.defaultProperties; + BRp$9.getLabelJustification = function(ele) { + var justification = ele.pstyle("text-justification").strValue; + var textHalign = ele.pstyle("text-halign").strValue; + if (justification === "auto") { + if (ele.isNode()) { + switch (textHalign) { + case "left": + return "right"; + case "right": + return "left"; + default: + return "center"; + } + } else { + return "center"; + } + } else { + return justification; } - var rawProps = extend2({ - // core props - "selection-box-color": "#ddd", - "selection-box-opacity": 0.65, - "selection-box-border-color": "#aaa", - "selection-box-border-width": 1, - "active-bg-color": "black", - "active-bg-opacity": 0.15, - "active-bg-size": 30, - "outside-texture-bg-color": "#000", - "outside-texture-bg-opacity": 0.125, - // common node/edge props - "events": "yes", - "text-events": "no", - "text-valign": "top", - "text-halign": "center", - "text-justification": "auto", - "line-height": 1, - "color": "#000", - "text-outline-color": "#000", - "text-outline-width": 0, - "text-outline-opacity": 1, - "text-opacity": 1, - "text-decoration": "none", - "text-transform": "none", - "text-wrap": "none", - "text-overflow-wrap": "whitespace", - "text-max-width": 9999, - "text-background-color": "#000", - "text-background-opacity": 0, - "text-background-shape": "rectangle", - "text-background-padding": 0, - "text-border-opacity": 0, - "text-border-width": 0, - "text-border-style": "solid", - "text-border-color": "#000", - "font-family": "Helvetica Neue, Helvetica, sans-serif", - "font-style": "normal", - "font-weight": "normal", - "font-size": 16, - "min-zoomed-font-size": 0, - "text-rotation": "none", - "source-text-rotation": "none", - "target-text-rotation": "none", - "visibility": "visible", - "display": "element", - "opacity": 1, - "z-compound-depth": "auto", - "z-index-compare": "auto", - "z-index": 0, - "label": "", - "text-margin-x": 0, - "text-margin-y": 0, - "source-label": "", - "source-text-offset": 0, - "source-text-margin-x": 0, - "source-text-margin-y": 0, - "target-label": "", - "target-text-offset": 0, - "target-text-margin-x": 0, - "target-text-margin-y": 0, - "overlay-opacity": 0, - "overlay-color": "#000", - "overlay-padding": 10, - "overlay-shape": "round-rectangle", - "underlay-opacity": 0, - "underlay-color": "#000", - "underlay-padding": 10, - "underlay-shape": "round-rectangle", - "transition-property": "none", - "transition-duration": 0, - "transition-delay": 0, - "transition-timing-function": "linear", - // node props - "background-blacken": 0, - "background-color": "#999", - "background-fill": "solid", - "background-opacity": 1, - "background-image": "none", - "background-image-crossorigin": "anonymous", - "background-image-opacity": 1, - "background-image-containment": "inside", - "background-image-smoothing": "yes", - "background-position-x": "50%", - "background-position-y": "50%", - "background-offset-x": 0, - "background-offset-y": 0, - "background-width-relative-to": "include-padding", - "background-height-relative-to": "include-padding", - "background-repeat": "no-repeat", - "background-fit": "none", - "background-clip": "node", - "background-width": "auto", - "background-height": "auto", - "border-color": "#000", - "border-opacity": 1, - "border-width": 0, - "border-style": "solid", - "height": 30, - "width": 30, - "shape": "ellipse", - "shape-polygon-points": "-1, -1, 1, -1, 1, 1, -1, 1", - "bounds-expansion": 0, - // node gradient - "background-gradient-direction": "to-bottom", - "background-gradient-stop-colors": "#999", - "background-gradient-stop-positions": "0%", - // ghost props - "ghost": "no", - "ghost-offset-y": 0, - "ghost-offset-x": 0, - "ghost-opacity": 0, - // compound props - "padding": 0, - "padding-relative-to": "width", - "position": "origin", - "compound-sizing-wrt-labels": "include", - "min-width": 0, - "min-width-bias-left": 0, - "min-width-bias-right": 0, - "min-height": 0, - "min-height-bias-top": 0, - "min-height-bias-bottom": 0 - }, { - // node pie bg - "pie-size": "100%" - }, [{ - name: "pie-{{i}}-background-color", - value: "black" - }, { - name: "pie-{{i}}-background-size", - value: "0%" - }, { - name: "pie-{{i}}-background-opacity", - value: 1 - }].reduce(function(css, prop2) { - for (var i4 = 1; i4 <= styfn$2.pieBackgroundN; i4++) { - var name3 = prop2.name.replace("{{i}}", i4); - var val2 = prop2.value; - css[name3] = val2; + }; + BRp$9.calculateLabelDimensions = function(ele, text2) { + var r2 = this; + var containerWindow = r2.cy.window(); + var document2 = containerWindow.document; + var cacheKey = hashString(text2, ele._private.labelDimsKey); + var cache3 = r2.labelDimCache || (r2.labelDimCache = []); + var existingVal = cache3[cacheKey]; + if (existingVal != null) { + return existingVal; + } + var padding3 = 0; + var fStyle = ele.pstyle("font-style").strValue; + var size5 = ele.pstyle("font-size").pfValue; + var family = ele.pstyle("font-family").strValue; + var weight8 = ele.pstyle("font-weight").strValue; + var canvas = this.labelCalcCanvas; + var c2d = this.labelCalcCanvasContext; + if (!canvas) { + canvas = this.labelCalcCanvas = document2.createElement("canvas"); + c2d = this.labelCalcCanvasContext = canvas.getContext("2d"); + var ds = canvas.style; + ds.position = "absolute"; + ds.left = "-9999px"; + ds.top = "-9999px"; + ds.zIndex = "-1"; + ds.visibility = "hidden"; + ds.pointerEvents = "none"; + } + c2d.font = "".concat(fStyle, " ").concat(weight8, " ").concat(size5, "px ").concat(family); + var width3 = 0; + var height2 = 0; + var lines = text2.split("\n"); + for (var i2 = 0; i2 < lines.length; i2++) { + var line2 = lines[i2]; + var metrics = c2d.measureText(line2); + 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 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 (isEdge2 && rotStr === "autorotate") { + return rs.labelAutoAngle; + } else if (rotStr === "autorotate") { + return 0; + } else { + return rot.pfValue; + } + }; + BRp$9.calculateLabelAngles = function(ele) { + var r2 = this; + var isEdge2 = ele.isEdge(); + var _p = ele._private; + var rs = _p.rscratch; + rs.labelAngle = r2.calculateLabelAngle(ele); + if (isEdge2) { + rs.sourceLabelAngle = r2.calculateLabelAngle(ele, "source"); + rs.targetLabelAngle = r2.calculateLabelAngle(ele, "target"); + } + }; + BRp$8 = {}; + TOO_SMALL_CUT_RECT = 28; + warnedCutRect = false; + BRp$8.getNodeShape = function(node2) { + 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) { + warn("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"); + warnedCutRect = true; } - return css; - }, {}), { - // edge props - "line-style": "solid", - "line-color": "#999", - "line-fill": "solid", - "line-cap": "butt", - "line-opacity": 1, - "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, - "taxi-turn": "50%", - "taxi-turn-min-distance": 10, - "taxi-direction": "auto", - "edge-distances": "intersection", - "curve-style": "haystack", - "haystack-radius": 0, - "arrow-scale": 1, - "loop-direction": "-45deg", - "loop-sweep": "-90deg", - "source-distance-from-node": 0, - "target-distance-from-node": 0, - "source-endpoint": "outside-to-node", - "target-endpoint": "outside-to-node", - "line-dash-pattern": [6, 3], - "line-dash-offset": 0 - }, [{ - name: "arrow-shape", - value: "none" - }, { - name: "arrow-color", - value: "#999" - }, { - name: "arrow-fill", - value: "filled" - }].reduce(function(css, prop2) { - styfn$2.arrowPrefixes.forEach(function(prefix) { - var name3 = prefix + "-" + prop2.name; - var val2 = prop2.value; - css[name3] = val2; - }); - return css; - }, {})); - var parsedProps = {}; - for (var i3 = 0; i3 < this.properties.length; i3++) { - var prop = this.properties[i3]; - if (prop.pointsTo) { - continue; + return "rectangle"; + } + if (node2.isParent()) { + if (shape === "rectangle" || shape === "roundrectangle" || shape === "round-rectangle" || shape === "cutrectangle" || shape === "cut-rectangle" || shape === "barrel") { + return shape; + } else { + return "rectangle"; } - var name2 = prop.name; - var val = rawProps[name2]; - var parsedProp = this.parse(name2, val); - parsedProps[name2] = parsedProp; } - _p.defaultProperties = parsedProps; - return _p.defaultProperties; + if (shape === "polygon") { + var points = node2.pstyle("shape-polygon-points").value; + return r2.nodeShapes.makePolygon(points).name; + } + return shape; }; - styfn$2.addDefaultStylesheet = function() { - this.selector(":parent").css({ - "shape": "rectangle", - "padding": 10, - "background-color": "#eee", - "border-color": "#ccc", - "border-width": 1 - }).selector("edge").css({ - "width": 3 - }).selector(":loop").css({ - "curve-style": "bezier" - }).selector("edge:compound").css({ - "curve-style": "bezier", - "source-endpoint": "outside-to-line", - "target-endpoint": "outside-to-line" - }).selector(":selected").css({ - "background-color": "#0169D9", - "line-color": "#0169D9", - "source-arrow-color": "#0169D9", - "target-arrow-color": "#0169D9", - "mid-source-arrow-color": "#0169D9", - "mid-target-arrow-color": "#0169D9" - }).selector(":parent:selected").css({ - "background-color": "#CCE1F9", - "border-color": "#aec8e5" - }).selector(":active").css({ - "overlay-color": "black", - "overlay-padding": 10, - "overlay-opacity": 0.25 - }); - this.defaultLength = this.length; + BRp$7 = {}; + BRp$7.registerCalculationListeners = function() { + var cy = this.cy; + var elesToUpdate = cy.collection(); + 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 i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + var _p = ele._private; + var rstyle = _p.rstyle; + rstyle.clean = false; + rstyle.cleanConnected = false; + } + } + }, "enqueue"); + r2.binder(cy).on("bounds.* dirty.*", /* @__PURE__ */ __name(function onDirtyBounds(e3) { + var ele = e3.target; + enqueue(ele); + }, "onDirtyBounds")).on("style.* background.*", /* @__PURE__ */ __name(function onDirtyStyle(e3) { + var ele = e3.target; + enqueue(ele, false); + }, "onDirtyStyle")); + var updateEleCalcs = /* @__PURE__ */ __name(function updateEleCalcs2(willDraw) { + if (willDraw) { + var fns = r2.onUpdateEleCalcsFns; + elesToUpdate.cleanStyle(); + 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()); + rstyle.cleanConnected = true; + } + } + if (fns) { + for (var _i = 0; _i < fns.length; _i++) { + var fn3 = fns[_i]; + fn3(willDraw, elesToUpdate); + } + } + r2.recalculateRenderedStyle(elesToUpdate); + elesToUpdate = cy.collection(); + } + }, "updateEleCalcs"); + r2.flushRenderedStyleQueue = function() { + updateEleCalcs(true); + }; + r2.beforeRender(updateEleCalcs, r2.beforeRenderPriorities.eleCalcs); }; - var styfn$1 = {}; - styfn$1.parse = function(name2, value, propIsBypass, propIsFlat) { - var self2 = this; - if (fn$6(value)) { - return self2.parseImplWarn(name2, value, propIsBypass, propIsFlat); + BRp$7.onUpdateEleCalcs = function(fn3) { + var fns = this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || []; + fns.push(fn3); + }; + BRp$7.recalculateRenderedStyle = function(eles, useCache) { + var isCleanConnected = /* @__PURE__ */ __name(function isCleanConnected2(ele2) { + return ele2._private.rstyle.cleanConnected; + }, "isCleanConnected"); + var edges5 = []; + var nodes6 = []; + if (this.destroyed) { + return; } - var flatKey = propIsFlat === "mapping" || propIsFlat === true || propIsFlat === false || propIsFlat == null ? "dontcare" : propIsFlat; - var bypassKey = propIsBypass ? "t" : "f"; - var valueKey = "" + value; - var argHash = hashStrings(name2, valueKey, bypassKey, flatKey); - var propCache = self2.propCache = self2.propCache || []; - var ret; - if (!(ret = propCache[argHash])) { - ret = propCache[argHash] = self2.parseImplWarn(name2, value, propIsBypass, propIsFlat); + if (useCache === void 0) { + useCache = true; } - if (propIsBypass || propIsFlat === "mapping") { - ret = copy2(ret); - if (ret) { - ret.value = copy2(ret.value); + 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()))) { + rstyle.clean = false; + } + if (useCache && rstyle.clean || ele.removed()) { + continue; + } + if (ele.pstyle("display").value === "none") { + continue; + } + if (_p.group === "nodes") { + nodes6.push(ele); + } else { + edges5.push(ele); } + rstyle.clean = true; } - return ret; - }; - styfn$1.parseImplWarn = function(name2, value, propIsBypass, propIsFlat) { - var prop = this.parseImpl(name2, value, propIsBypass, propIsFlat); - if (!prop && value != null) { - warn("The style property `".concat(name2, ": ").concat(value, "` is invalid")); + for (var _i2 = 0; _i2 < nodes6.length; _i2++) { + var _ele = nodes6[_i2]; + var _p2 = _ele._private; + var _rstyle = _p2.rstyle; + var pos = _ele.position(); + this.recalculateNodeLabelProjection(_ele); + _rstyle.nodeX = pos.x; + _rstyle.nodeY = pos.y; + _rstyle.nodeW = _ele.pstyle("width").pfValue; + _rstyle.nodeH = _ele.pstyle("height").pfValue; } - if (prop && (prop.name === "width" || prop.name === "height") && value === "label") { - warn("The style value of `label` is deprecated for `" + prop.name + "`"); + 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; + _rstyle2.srcX = rs.arrowStartX; + _rstyle2.srcY = rs.arrowStartY; + _rstyle2.tgtX = rs.arrowEndX; + _rstyle2.tgtY = rs.arrowEndY; + _rstyle2.midX = rs.midX; + _rstyle2.midY = rs.midY; + _rstyle2.labelAngle = rs.labelAngle; + _rstyle2.sourceLabelAngle = rs.sourceLabelAngle; + _rstyle2.targetLabelAngle = rs.targetLabelAngle; } - return prop; }; - styfn$1.parseImpl = function(name2, value, propIsBypass, propIsFlat) { - var self2 = this; - name2 = camel2dash(name2); - var property2 = self2.properties[name2]; - var passedValue = value; - var types = self2.types; - if (!property2) { - return null; + BRp$6 = {}; + BRp$6.updateCachedGrabbedEles = function() { + var eles = this.cachedZSortedEles; + if (!eles) { + return; } - if (value === void 0) { - return null; + eles.drag = []; + eles.nondrag = []; + var grabTargets = []; + 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); + } else if (rs.inDragLayer) { + eles.drag.push(ele); + } else { + eles.nondrag.push(ele); + } } - if (property2.alias) { - property2 = property2.pointsTo; - name2 = property2.name; + for (var i2 = 0; i2 < grabTargets.length; i2++) { + var ele = grabTargets[i2]; + eles.drag.push(ele); } - var valueIsString = string(value); - if (valueIsString) { - value = value.trim(); + }; + BRp$6.invalidateCachedZSortedEles = function() { + this.cachedZSortedEles = null; + }; + BRp$6.getCachedZSortedEles = function(forceRecalc) { + if (forceRecalc || !this.cachedZSortedEles) { + var eles = this.cy.mutableElements().toArray(); + eles.sort(zIndexSort); + eles.interactive = eles.filter(function(ele) { + return ele.interactive(); + }); + this.cachedZSortedEles = eles; + this.updateCachedGrabbedEles(); + } else { + eles = this.cachedZSortedEles; } - var type2 = property2.type; - if (!type2) { - return null; + return eles; + }; + 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); + }); + BRp$4 = {}; + BRp$4.getCachedImage = function(url, crossOrigin, onLoad) { + 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 { + cache3 = imageCache[url] = imageCache[url] || {}; + var image = cache3.image = new Image(); + image.addEventListener("load", onLoad); + image.addEventListener("error", function() { + image.error = true; + }); + var dataUriPrefix = "data:"; + var isDataUri = url.substring(0, dataUriPrefix.length).toLowerCase() === dataUriPrefix; + if (!isDataUri) { + crossOrigin = crossOrigin === "null" ? null : crossOrigin; + image.crossOrigin = crossOrigin; + } + image.src = url; + return image; } - if (propIsBypass && (value === "" || value === null)) { - return { - name: name2, - value, - bypass: true, - deleteBypass: true - }; + }; + BRp$3 = {}; + BRp$3.registerBinding = function(target, event3, handler, useCapture) { + var args = Array.prototype.slice.apply(arguments, [1]); + var b2 = this.binder(target); + return b2.on.apply(b2, args); + }; + BRp$3.binder = function(tgt) { + var r2 = this; + var containerWindow = r2.cy.window(); + var tgtIsDom = tgt === containerWindow || tgt === containerWindow.document || tgt === containerWindow.document.body || domElement(tgt); + if (r2.supportsPassiveEvents == null) { + var supportsPassive = false; + try { + var opts = Object.defineProperty({}, "passive", { + get: /* @__PURE__ */ __name(function get6() { + supportsPassive = true; + return true; + }, "get") + }); + containerWindow.addEventListener("test", null, opts); + } catch (err) { + } + r2.supportsPassiveEvents = supportsPassive; } - if (fn$6(value)) { - return { - name: name2, - value, - strValue: "fn", - mapped: types.fn, - bypass: propIsBypass - }; + var on3 = /* @__PURE__ */ __name(function on4(event3, handler, useCapture) { + var args = Array.prototype.slice.call(arguments); + if (tgtIsDom && r2.supportsPassiveEvents) { + args[2] = { + capture: useCapture != null ? useCapture : false, + passive: false, + once: false + }; + } + r2.bindings.push({ + target: tgt, + args + }); + (tgt.addEventListener || tgt.on).apply(tgt, args); + return this; + }, "on"); + return { + on: on3, + addEventListener: on3, + addListener: on3, + bind: on3 + }; + }; + BRp$3.nodeIsDraggable = function(node2) { + return node2 && node2.isNode() && !node2.locked() && node2.grabbable(); + }; + BRp$3.nodeIsGrabbable = function(node2) { + return this.nodeIsDraggable(node2) && node2.interactive(); + }; + BRp$3.load = function() { + var r2 = this; + var containerWindow = r2.cy.window(); + var isSelected = /* @__PURE__ */ __name(function isSelected2(ele) { + return ele.selected(); + }, "isSelected"); + var triggerEvents = /* @__PURE__ */ __name(function triggerEvents2(target, names, e3, position5) { + if (target == null) { + target = r2.cy; + } + for (var i2 = 0; i2 < names.length; i2++) { + var name = names[i2]; + target.emit({ + originalEvent: e3, + type: name, + position: position5 + }); + } + }, "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 (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; + } + } + } else { + allowPassthrough = true; + } + return allowPassthrough; + }, "allowPanningPassthrough"); + var setGrabbed = /* @__PURE__ */ __name(function setGrabbed2(ele) { + ele[0]._private.grabbed = true; + }, "setGrabbed"); + var setFreed = /* @__PURE__ */ __name(function setFreed2(ele) { + ele[0]._private.grabbed = false; + }, "setFreed"); + var setInDragLayer = /* @__PURE__ */ __name(function setInDragLayer2(ele) { + ele[0]._private.rscratch.inDragLayer = true; + }, "setInDragLayer"); + var setOutDragLayer = /* @__PURE__ */ __name(function setOutDragLayer2(ele) { + ele[0]._private.rscratch.inDragLayer = false; + }, "setOutDragLayer"); + var setGrabTarget = /* @__PURE__ */ __name(function setGrabTarget2(ele) { + ele[0]._private.rscratch.isGrabTarget = true; + }, "setGrabTarget"); + var removeGrabTarget = /* @__PURE__ */ __name(function removeGrabTarget2(ele) { + ele[0]._private.rscratch.isGrabTarget = false; + }, "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); + } + }, "addToDragList"); + var addDescendantsToDrag = /* @__PURE__ */ __name(function addDescendantsToDrag2(node2, opts) { + if (!node2.cy().hasCompoundNodes()) { + return; + } + if (opts.inDragLayer == null && opts.addToList == null) { + return; + } + var innerNodes = node2.descendants(); + if (opts.inDragLayer) { + innerNodes.forEach(setInDragLayer); + innerNodes.connectedEdges().forEach(setInDragLayer); + } + if (opts.addToList) { + addToDragList(innerNodes, opts); + } + }, "addDescendantsToDrag"); + var addNodesToDrag = /* @__PURE__ */ __name(function addNodesToDrag2(nodes6, opts) { + opts = opts || {}; + var hasCompoundNodes2 = nodes6.cy().hasCompoundNodes(); + if (opts.inDragLayer) { + nodes6.forEach(setInDragLayer); + nodes6.neighborhood().stdFilter(function(ele) { + return !hasCompoundNodes2 || ele.isEdge(); + }).forEach(setInDragLayer); + } + if (opts.addToList) { + nodes6.forEach(function(ele) { + addToDragList(ele, opts); + }); + } + addDescendantsToDrag(nodes6, opts); + updateAncestorsInDragLayer(nodes6, { + inDragLayer: opts.inDragLayer + }); + r2.updateCachedGrabbedEles(); + }, "addNodesToDrag"); + var addNodeToDrag = addNodesToDrag; + var freeDraggedElements = /* @__PURE__ */ __name(function freeDraggedElements2(grabbedEles) { + if (!grabbedEles) { + return; + } + r2.getCachedZSortedEles().forEach(function(ele) { + setFreed(ele); + setOutDragLayer(ele); + removeGrabTarget(ele); + }); + 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 parent4 = node2.ancestors().orphans(); + if (parent4.same(node2)) { + return; + } + var nodes6 = parent4.descendants().spawnSelf().merge(parent4).unmerge(node2).unmerge(node2.descendants()); + var edges5 = nodes6.connectedEdges(); + if (opts.inDragLayer) { + edges5.forEach(setInDragLayer); + nodes6.forEach(setInDragLayer); + } + if (opts.addToList) { + nodes6.forEach(function(ele) { + addToDragList(ele, opts); + }); + } + }, "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) { + 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 j2 = 0; j2 < rNodes.length; j2++) { + var rNode = rNodes[j2]; + if (rNode === r2.container) { + r2.destroy(); + break; + } + } + } + } + }); + if (r2.container.parentNode) { + r2.removeObserver.observe(r2.container.parentNode, { + childList: true + }); + } + } else { + r2.registerBinding(r2.container, "DOMNodeRemoved", function(e3) { + r2.destroy(); + }); } - var data2, mapData; - if (!valueIsString || propIsFlat || value.length < 7 || value[1] !== "a") - ; - else if (value.length >= 7 && value[0] === "d" && (data2 = new RegExp(types.data.regex).exec(value))) { - if (propIsBypass) { + var onResize = debounce_1(function() { + r2.cy.resize(); + }, 100); + if (haveMutationsApi) { + r2.styleObserver = new MutationObserver(onResize); + r2.styleObserver.observe(r2.container, { + attributes: true + }); + } + r2.registerBinding(containerWindow, "resize", onResize); + if (haveResizeObserverApi) { + r2.resizeObserver = new ResizeObserver(onResize); + r2.resizeObserver.observe(r2.container); + } + var forEachUp = /* @__PURE__ */ __name(function forEachUp2(domEle, fn3) { + while (domEle != null) { + fn3(domEle); + domEle = domEle.parentNode; + } + }, "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); + }); + r2.registerBinding(r2.container, "contextmenu", function(e3) { + e3.preventDefault(); + }); + 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 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; + } + } + if (!atLeastOnePosInside) { return false; } - var mapped = types.data; - return { - name: name2, - value: data2, - strValue: "" + value, - mapped, - field: data2[1], - bypass: propIsBypass - }; - } else if (value.length >= 10 && value[0] === "m" && (mapData = new RegExp(types.mapData.regex).exec(value))) { - if (propIsBypass) { + var container2 = r2.container; + var target = e3.target; + var tParent = target.parentNode; + var containerIsTarget = false; + while (tParent) { + if (tParent === container2) { + containerIsTarget = true; + break; + } + tParent = tParent.parentNode; + } + if (!containerIsTarget) { return false; } - if (type2.multiple) { + return true; + }, "eventInContainer"); + r2.registerBinding(r2.container, "mousedown", /* @__PURE__ */ __name(function mousedownHandler(e3) { + if (!eventInContainer(e3)) { + return; + } + if (r2.hoverData.which === 1 && e3.which !== 1) { + return; + } + e3.preventDefault(); + blurActiveDomElement(); + 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 = 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 = r2.hoverData.down; + if (ele) { + ele.emit({ + originalEvent: e3, + type: "taphold", + position: { + x: pos[0], + y: pos[1] + } + }); + } else { + cy.emit({ + originalEvent: e3, + type: "taphold", + position: { + x: pos[0], + y: pos[1] + } + }); + } + } + }, r2.tapholdDuration); + }, "checkForTaphold"); + if (e3.which == 3) { + r2.hoverData.cxtStarted = true; + var cxtEvt = { + originalEvent: e3, + type: "cxttapstart", + position: { + x: pos[0], + y: pos[1] + } + }; + if (near) { + near.activate(); + near.emit(cxtEvt); + r2.hoverData.down = near; + } else { + cy.emit(cxtEvt); + } + r2.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(); + r2.hoverData.cxtDragged = false; + } else if (e3.which == 1) { + if (near) { + near.activate(); + } + { + if (near != null) { + if (r2.nodeIsGrabbable(near)) { + var makeEvent = /* @__PURE__ */ __name(function makeEvent2(type3) { + return { + originalEvent: e3, + type: type3, + position: { + x: pos[0], + y: pos[1] + } + }; + }, "makeEvent"); + var triggerGrab = /* @__PURE__ */ __name(function triggerGrab2(ele) { + ele.emit(makeEvent("grab")); + }, "triggerGrab"); + setGrabTarget(near); + if (!near.selected()) { + draggedElements = r2.dragData.possibleDragElements = cy.collection(); + addNodeToDrag(near, { + addToList: draggedElements + }); + near.emit(makeEvent("grabon")).emit(makeEvent("grab")); + } else { + draggedElements = r2.dragData.possibleDragElements = cy.collection(); + var selectedNodes = cy.$(function(ele) { + return ele.isNode() && ele.selected() && r2.nodeIsGrabbable(ele); + }); + addNodesToDrag(selectedNodes, { + addToList: draggedElements + }); + near.emit(makeEvent("grabon")); + selectedNodes.forEach(triggerGrab); + } + r2.redrawHint("eles", true); + r2.redrawHint("drag", true); + } + } + r2.hoverData.down = near; + r2.hoverData.downs = nears; + r2.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(); + } + triggerEvents(near, ["mousedown", "tapstart", "vmousedown"], e3, { + x: pos[0], + y: pos[1] + }); + if (near == null) { + select[4] = 1; + r2.data.bgActivePosistion = { + x: pos[0], + y: pos[1] + }; + r2.redrawHint("select", true); + r2.redraw(); + } else if (near.pannable()) { + select[4] = 1; + } + checkForTaphold(); + } + select[0] = select[2] = pos[0]; + select[1] = select[3] = pos[1]; + }, "mousedownHandler"), false); + r2.registerBinding(containerWindow, "mousemove", /* @__PURE__ */ __name(function mousemoveHandler(e3) { + var capture = r2.hoverData.capture; + if (!capture && !eventInContainer(e3)) { + return; + } + 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 (!r2.hoverData.draggingEles && !r2.hoverData.dragging && !r2.hoverData.selecting) { + near = r2.findNearestElement(pos[0], pos[1], true, false); + } + var last3 = r2.hoverData.last; + var down = r2.hoverData.down; + var disp = [pos[0] - select[2], pos[1] - select[3]]; + var draggedElements = r2.dragData.possibleDragElements; + var isOverThresholdDrag; + if (mdownGPos) { + var dx = gpos[0] - mdownGPos[0]; + var dx2 = dx * dx; + var dy = gpos[1] - mdownGPos[1]; + var dy2 = dy * dy; + var dist22 = dx2 + dy2; + r2.hoverData.isOverThresholdDrag = isOverThresholdDrag = dist22 >= r2.desktopTapThreshold2; + } + var multSelKeyDown = isMultSelKeyDown(e3); + if (isOverThresholdDrag) { + r2.hoverData.tapholdCancelled = true; + } + 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]); + } else { + dragDelta2[0] += disp[0]; + dragDelta2[1] += disp[1]; + } + }, "updateDragDelta"); + preventDefault2 = true; + triggerEvents(near, ["mousemove", "vmousemove", "tapdrag"], e3, { + x: pos[0], + y: pos[1] + }); + var goIntoBoxMode = /* @__PURE__ */ __name(function goIntoBoxMode2() { + r2.data.bgActivePosistion = void 0; + if (!r2.hoverData.selecting) { + cy.emit({ + originalEvent: e3, + type: "boxstart", + position: { + x: pos[0], + y: pos[1] + } + }); + } + select[4] = 1; + r2.hoverData.selecting = true; + r2.redrawHint("select", true); + r2.redraw(); + }, "goIntoBoxMode"); + if (r2.hoverData.which === 3) { + if (isOverThresholdDrag) { + var cxtEvt = { + originalEvent: e3, + type: "cxtdrag", + position: { + x: pos[0], + y: pos[1] + } + }; + if (down) { + down.emit(cxtEvt); + } else { + cy.emit(cxtEvt); + } + 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], + y: pos[1] + } + }); + } + r2.hoverData.cxtOver = near; + if (near) { + near.emit({ + originalEvent: e3, + type: "cxtdragover", + position: { + x: pos[0], + y: pos[1] + } + }); + } + } + } + } else if (r2.hoverData.dragging) { + preventDefault2 = true; + if (cy.panningEnabled() && cy.userPanningEnabled()) { + var deltaP; + if (r2.hoverData.justStartedPan) { + var mdPos = r2.hoverData.mdownPos; + deltaP = { + x: (pos[0] - mdPos[0]) * zoom2, + y: (pos[1] - mdPos[1]) * zoom2 + }; + r2.hoverData.justStartedPan = false; + } else { + deltaP = { + x: disp[0] * zoom2, + y: disp[1] * zoom2 + }; + } + cy.panBy(deltaP); + cy.emit("dragpan"); + r2.hoverData.dragged = true; + } + pos = r2.projectIntoViewport(e3.clientX, e3.clientY); + } else if (select[4] == 1 && (down == null || down.pannable())) { + if (isOverThresholdDrag) { + if (!r2.hoverData.dragging && cy.boxSelectionEnabled() && (multSelKeyDown || !cy.panningEnabled() || !cy.userPanningEnabled())) { + goIntoBoxMode(); + } else if (!r2.hoverData.selecting && cy.panningEnabled() && cy.userPanningEnabled()) { + var allowPassthrough = allowPanningPassthrough(down, r2.hoverData.downs); + if (allowPassthrough) { + r2.hoverData.dragging = true; + r2.hoverData.justStartedPan = true; + select[4] = 0; + r2.data.bgActivePosistion = array2point(mdownPos); + r2.redrawHint("select", true); + r2.redraw(); + } + } + if (down && down.pannable() && down.active()) { + down.unactivate(); + } + } + } else { + if (down && down.pannable() && down.active()) { + down.unactivate(); + } + 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"], e3, { + x: pos[0], + y: pos[1] + }); + } + r2.hoverData.last = near; + } + if (down) { + if (isOverThresholdDrag) { + if (cy.boxSelectionEnabled() && multSelKeyDown) { + if (down && down.grabbed()) { + freeDraggedElements(draggedElements); + down.emit("freeon"); + draggedElements.emit("free"); + if (r2.dragData.didDrag) { + down.emit("dragfreeon"); + draggedElements.emit("dragfree"); + } + } + goIntoBoxMode(); + } else if (down && down.grabbed() && r2.nodeIsDraggable(down)) { + var justStartedDrag = !r2.dragData.didDrag; + if (justStartedDrag) { + r2.redrawHint("eles", true); + } + r2.dragData.didDrag = true; + if (!r2.hoverData.draggingEles) { + addNodesToDrag(draggedElements, { + inDragLayer: true + }); + } + var totalShift = { + x: 0, + y: 0 + }; + if (number$1(disp[0]) && number$1(disp[1])) { + totalShift.x += disp[0]; + totalShift.y += disp[1]; + if (justStartedDrag) { + var dragDelta = r2.hoverData.dragDelta; + if (dragDelta && number$1(dragDelta[0]) && number$1(dragDelta[1])) { + totalShift.x += dragDelta[0]; + totalShift.y += dragDelta[1]; + } + } + } + r2.hoverData.draggingEles = true; + draggedElements.silentShift(totalShift).emit("position drag"); + r2.redrawHint("drag", true); + r2.redraw(); + } + } else { + updateDragDelta(); + } + } + preventDefault2 = true; + } + select[2] = pos[0]; + select[3] = pos[1]; + if (preventDefault2) { + if (e3.stopPropagation) e3.stopPropagation(); + if (e3.preventDefault) e3.preventDefault(); return false; } - var _mapped = types.mapData; - if (!(type2.color || type2.number)) { - return false; + }, "mousemoveHandler"), false); + var clickTimeout, didDoubleClick, prevClickTimeStamp; + r2.registerBinding(containerWindow, "mouseup", /* @__PURE__ */ __name(function mouseupHandler(e3) { + if (r2.hoverData.which === 1 && e3.which !== 1 && r2.hoverData.capture) { + return; } - var valueMin = this.parse(name2, mapData[4]); - if (!valueMin || valueMin.mapped) { - return false; + var capture = r2.hoverData.capture; + if (!capture) { + return; } - var valueMax = this.parse(name2, mapData[5]); - if (!valueMax || valueMax.mapped) { - return false; + 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 (valueMin.pfValue === valueMax.pfValue || valueMin.strValue === valueMax.strValue) { - warn("`" + name2 + ": " + value + "` is not a valid mapper because the output range is zero; converting to `" + name2 + ": " + valueMin.strValue + "`"); - return this.parse(name2, valueMin.strValue); - } else if (type2.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) { - return false; + if (r2.hoverData.which === 3) { + var cxtEvt = { + originalEvent: e3, + type: "cxttapend", + position: { + x: pos[0], + y: pos[1] + } + }; + if (down) { + down.emit(cxtEvt); + } else { + cy.emit(cxtEvt); + } + if (!r2.hoverData.cxtDragged) { + var cxtTap = { + originalEvent: e3, + type: "cxttap", + position: { + x: pos[0], + y: pos[1] + } + }; + if (down) { + down.emit(cxtTap); + } else { + cy.emit(cxtTap); + } + } + 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 (!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 (e3.timeStamp - prevClickTimeStamp <= cy.multiClickDebounceTime()) { + clickTimeout && clearTimeout(clickTimeout); + didDoubleClick = true; + prevClickTimeStamp = null; + triggerEvents(down, ["dblclick", "dbltap", "vdblclick"], e3, { + x: pos[0], + y: pos[1] + }); + } else { + clickTimeout = setTimeout(function() { + if (didDoubleClick) return; + triggerEvents(down, ["oneclick", "onetap", "voneclick"], e3, { + x: pos[0], + y: pos[1] + }); + }, cy.multiClickDebounceTime()); + prevClickTimeStamp = e3.timeStamp; + } + } + if (down == null && !r2.dragData.didDrag && !r2.hoverData.selecting && !r2.hoverData.dragged && !isMultSelKeyDown(e3)) { + cy.$(isSelected).unselect(["tapunselect"]); + if (draggedElements.length > 0) { + r2.redrawHint("eles", true); + } + r2.dragData.possibleDragElements = draggedElements = cy.collection(); + } + if (near == down && !r2.dragData.didDrag && !r2.hoverData.selecting) { + if (near != null && near._private.selectable) { + if (r2.hoverData.dragging) ; + else if (cy.selectionType() === "additive" || multSelKeyDown) { + if (near.selected()) { + near.unselect(["tapunselect"]); + } else { + near.select(["tapselect"]); + } + } else { + if (!multSelKeyDown) { + cy.$(isSelected).unmerge(near).unselect(["tapunselect"]); + near.select(["tapselect"]); + } + } + r2.redrawHint("eles", 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) { + r2.redrawHint("eles", true); + } + cy.emit({ + type: "boxend", + originalEvent: e3, + position: { + x: pos[0], + y: pos[1] + } + }); + 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 { + if (!multSelKeyDown) { + cy.$(isSelected).unmerge(box).unselect(); + } + box.emit("box").stdFilter(eleWouldBeSelected).select().emit("boxselect"); + } + r2.redraw(); + } + if (r2.hoverData.dragging) { + r2.hoverData.dragging = false; + r2.redrawHint("select", true); + r2.redrawHint("eles", true); + r2.redraw(); + } + if (!select[4]) { + r2.redrawHint("drag", true); + r2.redrawHint("eles", true); + var downWasGrabbed = down && down.grabbed(); + freeDraggedElements(draggedElements); + if (downWasGrabbed) { + down.emit("freeon"); + draggedElements.emit("free"); + if (r2.dragData.didDrag) { + down.emit("dragfreeon"); + draggedElements.emit("dragfree"); + } + } } } - return { - name: name2, - value: mapData, - strValue: "" + value, - mapped: _mapped, - field: mapData[1], - fieldMin: parseFloat(mapData[2]), - // min & max are numeric - fieldMax: parseFloat(mapData[3]), - valueMin: valueMin.value, - valueMax: valueMax.value, - bypass: propIsBypass - }; - } - if (type2.multiple && propIsFlat !== "multiple") { - var vals; - if (valueIsString) { - vals = value.split(/\s+/); - } else if (array2(value)) { - vals = value; - } else { - vals = [value]; - } - if (type2.evenMultiple && vals.length % 2 !== 0) { - return null; + select[4] = 0; + 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 valArr = []; - var unitsArr = []; - var pfValArr = []; - var strVal = ""; - var hasEnum = false; - for (var i3 = 0; i3 < vals.length; i3++) { - var p2 = self2.parse(name2, vals[i3], propIsBypass, "multiple"); - hasEnum = hasEnum || string(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)) { - return null; + 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 (type2.singleEnum && hasEnum) { - if (valArr.length === 1 && string(valArr[0])) { - return { - name: name2, - value: valArr[0], - strValue: valArr[0], - bypass: propIsBypass - }; + if (cy.panningEnabled() && cy.userPanningEnabled() && cy.zoomingEnabled() && cy.userZoomingEnabled()) { + 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 diff2; + if (e3.deltaY != null) { + diff2 = e3.deltaY / -250; + } else if (e3.wheelDeltaY != null) { + diff2 = e3.wheelDeltaY / 1e3; } else { - return null; + diff2 = e3.wheelDelta / 1e3; } - } - return { - name: name2, - value: valArr, - pfValue: pfValArr, - strValue: strVal, - bypass: propIsBypass, - units: unitsArr - }; - } - var checkEnums = function checkEnums2() { - for (var _i = 0; _i < type2.enums.length; _i++) { - var en2 = type2.enums[_i]; - if (en2 === value) { - return { - name: name2, - value, - strValue: "" + value, - bypass: propIsBypass - }; + diff2 = diff2 * r2.wheelSensitivity; + var needsWheelFix = e3.deltaMode === 1; + if (needsWheelFix) { + diff2 *= 33; } + var newZoom = cy.zoom() * Math.pow(10, diff2); + if (e3.type === "gesturechange") { + newZoom = r2.gestureStartZoom * e3.scale; + } + cy.zoom({ + level: newZoom, + renderedPosition: { + x: rpos[0], + y: rpos[1] + } + }); + 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); + }, "scrollHandler"), true); + r2.registerBinding(r2.container, "gesturestart", /* @__PURE__ */ __name(function gestureStartHandler(e3) { + r2.gestureStartZoom = r2.cy.zoom(); + if (!r2.hasTouchStarted) { + e3.preventDefault(); } - return null; - }; - if (type2.number) { - var units; - var implicitUnits = "px"; - if (type2.units) { - units = type2.units; + }, "gestureStartHandler"), true); + r2.registerBinding(r2.container, "gesturechange", function(e3) { + if (!r2.hasTouchStarted) { + wheelHandler(e3); } - if (type2.implicitUnits) { - implicitUnits = type2.implicitUnits; + }, true); + 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] + } + }); + }, "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] + } + }); + }, "mouseOverHandler"), false); + var f1x1, f1y1, f2x1, f2y1; + var distance1, distance1Sq; + var center1, modelCenter1; + var offsetLeft, offsetTop; + var containerWidth, containerHeight; + var twoFingersStartInside; + 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; + r2.registerBinding(r2.container, "touchstart", touchstartHandler = /* @__PURE__ */ __name(function touchstartHandler2(e3) { + r2.hasTouchStarted = true; + if (!eventInContainer(e3)) { + return; } - if (!type2.unitless) { - if (valueIsString) { - var unitsRegex = "px|em" + (type2.allowPercent ? "|\\%" : ""); - if (units) { - unitsRegex = units; + blurActiveDomElement(); + 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 = 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 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] - pan2.x) / zoom2, (center1[1] - pan2.y) / zoom2]; + var cxtDistThreshold = 200; + var cxtDistThresholdSq = cxtDistThreshold * cxtDistThreshold; + 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: e3, + type: "cxttapstart", + position: { + x: now4[0], + y: now4[1] + } + }); + r2.touchData.start = near1; + } else if (near2 && near2.isNode()) { + near2.activate().emit({ + originalEvent: e3, + type: "cxttapstart", + position: { + x: now4[0], + y: now4[1] + } + }); + r2.touchData.start = near2; + } else { + cy.emit({ + originalEvent: e3, + type: "cxttapstart", + position: { + x: now4[0], + y: now4[1] + } + }); } - var match5 = value.match("^(" + number2 + ")(" + unitsRegex + ")?$"); - if (match5) { - value = match5[1]; - units = match5[2] || implicitUnits; + if (r2.touchData.start) { + r2.touchData.start._private.grabbed = false; } - } else if (!units || type2.implicitUnits) { - units = implicitUnits; + r2.touchData.cxt = true; + r2.touchData.cxtDragged = false; + r2.data.bgActivePosistion = void 0; + r2.redraw(); + return; } } - value = parseFloat(value); - if (isNaN(value) && type2.enums === void 0) { - return null; - } - if (isNaN(value) && type2.enums !== void 0) { - value = passedValue; - return checkEnums(); - } - if (type2.integer && !integer(value)) { - return null; - } - if (type2.min !== void 0 && (value < type2.min || type2.strictMin && value === type2.min) || type2.max !== void 0 && (value > type2.max || type2.strictMax && value === type2.max)) { - return null; - } - var ret = { - name: name2, - value, - strValue: "" + value + (units ? units : ""), - units, - bypass: propIsBypass - }; - if (type2.unitless || units !== "px" && units !== "em") { - ret.pfValue = value; - } else { - ret.pfValue = units === "px" || !units ? value : this.getEmSizeInPixels() * value; + if (e3.touches[2]) { + if (cy.boxSelectionEnabled()) { + e3.preventDefault(); + } + } 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(); + r2.touchData.start = near; + r2.touchData.starts = nears; + if (r2.nodeIsGrabbable(near)) { + var draggedEles = r2.dragData.touchDragEles = cy.collection(); + var selectedNodes = null; + r2.redrawHint("eles", true); + r2.redrawHint("drag", true); + if (near.selected()) { + selectedNodes = cy.$(function(ele) { + return ele.selected() && r2.nodeIsGrabbable(ele); + }); + addNodesToDrag(selectedNodes, { + addToList: draggedEles + }); + } else { + addNodeToDrag(near, { + addToList: draggedEles + }); + } + setGrabTarget(near); + var makeEvent = /* @__PURE__ */ __name(function makeEvent2(type3) { + return { + originalEvent: e3, + type: type3, + position: { + x: now4[0], + y: now4[1] + } + }; + }, "makeEvent"); + near.emit(makeEvent("grabon")); + if (selectedNodes) { + selectedNodes.forEach(function(n2) { + n2.emit(makeEvent("grab")); + }); + } else { + near.emit(makeEvent("grab")); + } + } + } + triggerEvents(near, ["touchstart", "tapstart", "vmousedown"], e3, { + x: now4[0], + y: now4[1] + }); + if (near == null) { + r2.data.bgActivePosistion = { + x: pos[0], + y: pos[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] + }); + } + }, r2.tapholdDuration); } - if (units === "ms" || units === "s") { - ret.pfValue = units === "ms" ? value : 1e3 * value; + 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 = e3.touches[0]; + r2.touchData.startGPosition = [touch0.clientX, touch0.clientY]; } - if (units === "deg" || units === "rad") { - ret.pfValue = units === "rad" ? value : deg2rad(value); + }, "touchstartHandler"), false); + var touchmoveHandler; + r2.registerBinding(containerWindow, "touchmove", touchmoveHandler = /* @__PURE__ */ __name(function touchmoveHandler2(e3) { + var capture = r2.touchData.capture; + if (!capture && !eventInContainer(e3)) { + return; } - if (units === "%") { - ret.pfValue = value / 100; + 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 && e3.touches[0] && startGPos) { + var disp = []; + for (var j2 = 0; j2 < now4.length; j2++) { + disp[j2] = now4[j2] - earlier[j2]; + } + var dx = e3.touches[0].clientX - startGPos[0]; + var dx2 = dx * dx; + var dy = e3.touches[0].clientY - startGPos[1]; + var dy2 = dy * dy; + var dist22 = dx2 + dy2; + isOverThresholdDrag = dist22 >= r2.touchTapThreshold2; } - return ret; - } else if (type2.propList) { - var props = []; - var propsStr = "" + value; - if (propsStr === "none") - ; - else { - var propsSplit = propsStr.split(/\s*,\s*|\s+/); - for (var _i2 = 0; _i2 < propsSplit.length; _i2++) { - var propName = propsSplit[_i2].trim(); - if (self2.properties[propName]) { - props.push(propName); + 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; + var distThresholdSq = distThreshold * distThreshold; + var factorThreshold = 1.5; + var factorThresholdSq = factorThreshold * factorThreshold; + if (factorSq >= factorThresholdSq || distance2Sq >= distThresholdSq) { + r2.touchData.cxt = false; + r2.data.bgActivePosistion = void 0; + r2.redrawHint("select", true); + var cxtEvt = { + originalEvent: e3, + type: "cxttapend", + position: { + x: now4[0], + y: now4[1] + } + }; + if (r2.touchData.start) { + r2.touchData.start.unactivate().emit(cxtEvt); + r2.touchData.start = null; } else { - warn("`" + propName + "` is not a valid property name"); + cy.emit(cxtEvt); } } - if (props.length === 0) { - return null; - } - } - return { - name: name2, - value: props, - strValue: props.length === 0 ? "none" : props.join(" "), - bypass: propIsBypass - }; - } else if (type2.color) { - var tuple = color2tuple(value); - if (!tuple) { - return null; } - return { - name: name2, - value: tuple, - pfValue: tuple, - strValue: "rgb(" + tuple[0] + "," + tuple[1] + "," + tuple[2] + ")", - // n.b. no spaces b/c of multiple support - bypass: propIsBypass - }; - } else if (type2.regex || type2.regexes) { - if (type2.enums) { - var enumProp = checkEnums(); - if (enumProp) { - return enumProp; + if (capture && r2.touchData.cxt) { + var cxtEvt = { + originalEvent: e3, + type: "cxtdrag", + position: { + x: now4[0], + y: now4[1] + } + }; + r2.data.bgActivePosistion = void 0; + r2.redrawHint("select", true); + if (r2.touchData.start) { + r2.touchData.start.emit(cxtEvt); + } else { + cy.emit(cxtEvt); } - } - var regexes = type2.regexes ? type2.regexes : [type2.regex]; - for (var _i3 = 0; _i3 < regexes.length; _i3++) { - var regex = new RegExp(regexes[_i3]); - var m = regex.exec(value); - if (m) { - return { - name: name2, - value: type2.singleRegexMatchValue ? m[1] : m, - strValue: "" + value, - bypass: propIsBypass + if (r2.touchData.start) { + r2.touchData.start._private.grabbed = false; + } + 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: now4[0], + y: now4[1] + } + }); + } + r2.touchData.cxtOver = near; + if (near) { + near.emit({ + originalEvent: e3, + type: "cxtdragover", + position: { + x: now4[0], + y: now4[1] + } + }); + } + } + } else if (capture && e3.touches[2] && cy.boxSelectionEnabled()) { + e3.preventDefault(); + r2.data.bgActivePosistion = void 0; + this.lastThreeTouch = +/* @__PURE__ */ new Date(); + if (!r2.touchData.selecting) { + cy.emit({ + originalEvent: e3, + type: "boxstart", + position: { + x: now4[0], + y: now4[1] + } + }); + } + r2.touchData.selecting = true; + r2.touchData.didSelect = true; + select[4] = 1; + if (!select || select.length === 0 || select[0] === void 0) { + 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] = (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) { + 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 = 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) { + var df1x = f1x2 - f1x1; + var df1y = f1y2 - f1y1; + var df2x = f2x2 - f2x1; + var df2y = f2y2 - f2y1; + var tx = (df1x + df2x) / 2; + var ty = (df1y + df2y) / 2; + var zoom1 = cy.zoom(); + 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: -zoom22 / zoom1 * (ctrx - pan1.x - tx) + ctrx, + y: -zoom22 / zoom1 * (ctry - pan1.y - ty) + ctry }; + if (_start && _start.active()) { + var draggedEles = r2.dragData.touchDragEles; + freeDraggedElements(draggedEles); + r2.redrawHint("drag", true); + r2.redrawHint("eles", true); + _start.unactivate().emit("freeon"); + draggedEles.emit("free"); + if (r2.dragData.didDrag) { + _start.emit("dragfreeon"); + draggedEles.emit("dragfree"); + } + } + cy.viewport({ + zoom: zoom22, + pan: pan2, + cancelOnFailedZoom: true + }); + cy.emit("pinchzoom"); + distance1 = distance22; + f1x1 = f1x2; + f1y1 = f1y2; + f2x1 = f2x2; + f2y1 = f2y2; + 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 (!r2.hoverData.draggingEles && !r2.swipePanning) { + near = r2.findNearestElement(now4[0], now4[1], true, true); } - } - return null; - } else if (type2.string) { - return { - name: name2, - value: "" + value, - strValue: "" + value, - bypass: propIsBypass - }; - } else if (type2.enums) { - return checkEnums(); - } else { - return null; - } - }; - var Style = function Style2(cy) { - if (!(this instanceof Style2)) { - return new Style2(cy); - } - if (!core2(cy)) { - error("A style must have a core reference"); - return; - } - this._private = { - cy, - coreStyle: {} - }; - this.length = 0; - this.resetToDefault(); - }; - var styfn = Style.prototype; - styfn.instanceString = function() { - return "style"; - }; - styfn.clear = function() { - var _p = this._private; - var cy = _p.cy; - var eles = cy.elements(); - for (var i3 = 0; i3 < this.length; i3++) { - this[i3] = void 0; - } - this.length = 0; - _p.contextStyles = {}; - _p.propDiffs = {}; - this.cleanElements(eles, true); - eles.forEach(function(ele) { - var ele_p = ele[0]._private; - ele_p.styleDirty = true; - ele_p.appliedInitStyle = false; - }); - return this; - }; - styfn.resetToDefault = function() { - this.clear(); - this.addDefaultStylesheet(); - return this; - }; - styfn.core = function(propName) { - 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, - properties: [], - mappedProperties: [], - index: i3 - }; - return this; - }; - styfn.css = function() { - 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]; - if (mapVal === void 0) { - mapVal = map2[dash2camel(prop.name)]; + if (capture && start3 != null) { + e3.preventDefault(); + } + if (capture && start3 != null && r2.nodeIsDraggable(start3)) { + if (isOverThresholdDrag) { + var draggedEles = r2.dragData.touchDragEles; + var justStartedDrag = !r2.dragData.didDrag; + if (justStartedDrag) { + addNodesToDrag(draggedEles, { + inDragLayer: true + }); + } + r2.dragData.didDrag = true; + var totalShift = { + x: 0, + y: 0 + }; + if (number$1(disp[0]) && number$1(disp[1])) { + totalShift.x += disp[0]; + totalShift.y += disp[1]; + if (justStartedDrag) { + 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]; + } + } + } + r2.hoverData.draggingEles = true; + draggedEles.silentShift(totalShift).emit("position drag"); + r2.redrawHint("drag", true); + if (r2.touchData.startPosition[0] == earlier[0] && r2.touchData.startPosition[1] == earlier[1]) { + r2.redrawHint("eles", true); + } + r2.redraw(); + } else { + var dragDelta = r2.touchData.dragDelta = r2.touchData.dragDelta || []; + if (dragDelta.length === 0) { + dragDelta.push(disp[0]); + dragDelta.push(disp[1]); + } else { + dragDelta[0] += disp[0]; + dragDelta[1] += disp[1]; + } + } + } + { + triggerEvents(start3 || near, ["touchmove", "tapdrag", "vmousemove"], e3, { + x: now4[0], + y: now4[1] + }); + if ((!start3 || !start3.grabbed()) && near != last3) { + if (last3) { + last3.emit({ + originalEvent: e3, + type: "tapdragout", + position: { + x: now4[0], + y: now4[1] + } + }); + } + if (near) { + near.emit({ + originalEvent: e3, + type: "tapdragover", + position: { + x: now4[0], + y: now4[1] + } + }); + } + } + r2.touchData.last = near; } - if (mapVal !== void 0) { - this.cssRule(prop.name, mapVal); + if (capture) { + for (var i2 = 0; i2 < now4.length; i2++) { + if (now4[i2] && r2.touchData.startPosition[i2] && isOverThresholdDrag) { + r2.touchData.singleTouchMoved = true; + } + } } - } - } else if (args.length === 2) { - this.cssRule(args[0], args[1]); - } - return this; - }; - styfn.style = styfn.css; - styfn.cssRule = function(name2, value) { - var property2 = this.parse(name2, value); - if (property2) { - var i3 = this.length - 1; - this[i3].properties.push(property2); - this[i3].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); - } - var currentSelectorIsCore = !this[i3].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 (string(style)) { - this.appendFromString(style); - } - return this; - }; - Style.fromJson = function(cy, json2) { - var style = new Style(cy); - style.fromJson(json2); - return style; - }; - Style.fromString = function(cy, string2) { - return new Style(cy).fromString(string2); - }; - [styfn$8, styfn$7, styfn$6, styfn$5, styfn$4, styfn$3, styfn$2, styfn$1].forEach(function(props) { - extend2(styfn, props); - }); - Style.types = styfn.types; - Style.properties = styfn.properties; - Style.propertyGroups = styfn.propertyGroups; - Style.propertyGroupNames = styfn.propertyGroupNames; - Style.propertyGroupKeys = styfn.propertyGroupKeys; - var corefn$2 = { - style: function style(newStyle) { - if (newStyle) { - var s = this.setStyle(newStyle); - s.update(); - } - return this._private.style; - }, - setStyle: function setStyle2(style) { - var _p = this._private; - if (stylesheet(style)) { - _p.style = style.generateStyle(this); - } else if (array2(style)) { - _p.style = Style.fromJson(this, style); - } else if (string(style)) { - _p.style = Style.fromString(this, style); - } else { - _p.style = Style(this); - } - return _p.style; - }, - // e.g. cy.data() changed => recalc ele mappers - updateStyle: function updateStyle() { - this.mutableElements().updateStyle(); - } - }; - var defaultSelectionType = "single"; - var corefn$1 = { - autolock: function autolock(bool2) { - if (bool2 !== void 0) { - this._private.autolock = bool2 ? true : false; - } else { - return this._private.autolock; - } - return this; - }, - autoungrabify: function autoungrabify(bool2) { - if (bool2 !== void 0) { - this._private.autoungrabify = bool2 ? true : false; - } else { - return this._private.autoungrabify; - } - return this; - }, - autounselectify: function autounselectify(bool2) { - if (bool2 !== void 0) { - this._private.autounselectify = bool2 ? true : false; - } else { - return this._private.autounselectify; - } - return this; - }, - selectionType: function selectionType(selType) { - var _p = this._private; - if (_p.selectionType == null) { - _p.selectionType = defaultSelectionType; - } - if (selType !== void 0) { - if (selType === "additive" || selType === "single") { - _p.selectionType = selType; + if (capture && (start3 == null || start3.pannable()) && cy.panningEnabled() && cy.userPanningEnabled()) { + var allowPassthrough = allowPanningPassthrough(start3, r2.touchData.starts); + if (allowPassthrough) { + e3.preventDefault(); + if (!r2.data.bgActivePosistion) { + r2.data.bgActivePosistion = array2point(r2.touchData.startPosition); + } + if (r2.swipePanning) { + cy.panBy({ + x: disp[0] * zoom2, + y: disp[1] * zoom2 + }); + cy.emit("dragpan"); + } else if (isOverThresholdDrag) { + r2.swipePanning = true; + cy.panBy({ + x: dx * zoom2, + y: dy * zoom2 + }); + cy.emit("dragpan"); + if (start3) { + start3.unactivate(); + r2.redrawHint("select", true); + r2.touchData.start = null; + } + } + } + var pos = r2.projectIntoViewport(e3.touches[0].clientX, e3.touches[0].clientY); + now4[0] = pos[0]; + now4[1] = pos[1]; } - } else { - return _p.selectionType; } - return this; - }, - panningEnabled: function panningEnabled(bool2) { - if (bool2 !== void 0) { - this._private.panningEnabled = bool2 ? true : false; - } else { - return this._private.panningEnabled; + for (var j2 = 0; j2 < now4.length; j2++) { + earlier[j2] = now4[j2]; } - return this; - }, - userPanningEnabled: function userPanningEnabled(bool2) { - if (bool2 !== void 0) { - this._private.userPanningEnabled = bool2 ? true : false; - } else { - return this._private.userPanningEnabled; + 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(); } - return this; - }, - zoomingEnabled: function zoomingEnabled(bool2) { - if (bool2 !== void 0) { - this._private.zoomingEnabled = bool2 ? true : false; - } else { - return this._private.zoomingEnabled; + }, "touchmoveHandler"), false); + var touchcancelHandler; + r2.registerBinding(containerWindow, "touchcancel", touchcancelHandler = /* @__PURE__ */ __name(function touchcancelHandler2(e3) { + var start3 = r2.touchData.start; + r2.touchData.capture = false; + if (start3) { + start3.unactivate(); } - return this; - }, - userZoomingEnabled: function userZoomingEnabled(bool2) { - if (bool2 !== void 0) { - this._private.userZoomingEnabled = bool2 ? true : false; + }, "touchcancelHandler")); + var touchendHandler, didDoubleTouch, touchTimeout, prevTouchTimeStamp; + r2.registerBinding(containerWindow, "touchend", touchendHandler = /* @__PURE__ */ __name(function touchendHandler2(e3) { + var start3 = r2.touchData.start; + var capture = r2.touchData.capture; + if (capture) { + if (e3.touches.length === 0) { + r2.touchData.capture = false; + } + e3.preventDefault(); } else { - return this._private.userZoomingEnabled; + return; } - return this; - }, - boxSelectionEnabled: function boxSelectionEnabled(bool2) { - if (bool2 !== void 0) { - this._private.boxSelectionEnabled = bool2 ? true : false; - } else { - return this._private.boxSelectionEnabled; + 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(); } - return this; - }, - pan: function pan() { - var args = arguments; - var pan2 = this._private.pan; - var dim, val, dims, x2, y2; - switch (args.length) { - case 0: - return pan2; - case 1: - if (string(args[0])) { - dim = args[0]; - return pan2[dim]; - } else if (plainObject(args[0])) { - if (!this._private.panningEnabled) { - return this; - } - dims = args[0]; - x2 = dims.x; - y2 = dims.y; - if (number$12(x2)) { - pan2.x = x2; + var ctxTapend; + if (r2.touchData.cxt) { + ctxTapend = { + originalEvent: e3, + type: "cxttapend", + position: { + x: now4[0], + y: now4[1] + } + }; + if (start3) { + start3.emit(ctxTapend); + } else { + cy.emit(ctxTapend); + } + if (!r2.touchData.cxtDragged) { + var ctxTap = { + originalEvent: e3, + type: "cxttap", + position: { + x: now4[0], + y: now4[1] } - if (number$12(y2)) { - pan2.y = y2; + }; + if (start3) { + start3.emit(ctxTap); + } else { + cy.emit(ctxTap); + } + } + if (r2.touchData.start) { + r2.touchData.start._private.grabbed = false; + } + r2.touchData.cxt = false; + r2.touchData.start = null; + r2.redraw(); + return; + } + 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; + r2.redrawHint("select", true); + cy.emit({ + type: "boxend", + originalEvent: e3, + position: { + x: now4[0], + y: now4[1] + } + }); + var eleWouldBeSelected = /* @__PURE__ */ __name(function eleWouldBeSelected2(ele) { + return ele.selectable() && !ele.selected(); + }, "eleWouldBeSelected"); + box.emit("box").stdFilter(eleWouldBeSelected).select().emit("boxselect"); + if (box.nonempty()) { + 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); + r2.redrawHint("drag", true); + r2.redrawHint("eles", true); + if (startWasGrabbed) { + start3.emit("freeon"); + draggedEles.emit("free"); + if (r2.dragData.didDrag) { + start3.emit("dragfreeon"); + draggedEles.emit("dragfree"); } - this.emit("pan viewport"); } - break; - case 2: - if (!this._private.panningEnabled) { - return this; + triggerEvents(start3, ["touchend", "tapend", "vmouseup", "tapdragout"], e3, { + x: now4[0], + y: now4[1] + }); + start3.unactivate(); + r2.touchData.start = null; + } else { + 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 = r2.touchData.startPosition[0] - now4[0]; + var dx2 = dx * dx; + var dy = r2.touchData.startPosition[1] - now4[1]; + var dy2 = dy * dy; + var dist22 = dx2 + dy2; + var rdist2 = dist22 * zoom2 * zoom2; + if (!r2.touchData.singleTouchMoved) { + if (!start3) { + cy.$(":selected").unselect(["tapunselect"]); } - dim = args[0]; - val = args[1]; - if ((dim === "x" || dim === "y") && number$12(val)) { - pan2[dim] = val; + triggerEvents(start3, ["tap", "vclick"], e3, { + x: now4[0], + y: now4[1] + }); + didDoubleTouch = false; + if (e3.timeStamp - prevTouchTimeStamp <= cy.multiClickDebounceTime()) { + touchTimeout && clearTimeout(touchTimeout); + didDoubleTouch = true; + prevTouchTimeStamp = null; + triggerEvents(start3, ["dbltap", "vdblclick"], e3, { + x: now4[0], + y: now4[1] + }); + } else { + touchTimeout = setTimeout(function() { + if (didDoubleTouch) return; + triggerEvents(start3, ["onetap", "voneclick"], e3, { + x: now4[0], + y: now4[1] + }); + }, cy.multiClickDebounceTime()); + prevTouchTimeStamp = e3.timeStamp; } - this.emit("pan viewport"); - break; - } - this.notify("viewport"); - return this; - }, - panBy: function panBy(arg0, arg1) { - var args = arguments; - var pan = this._private.pan; - var dim, val, dims, x2, y2; - if (!this._private.panningEnabled) { - return this; - } - switch (args.length) { - case 1: - if (plainObject(arg0)) { - dims = args[0]; - x2 = dims.x; - y2 = dims.y; - if (number$12(x2)) { - pan.x += x2; - } - if (number$12(y2)) { - pan.y += y2; + } + if (start3 != null && !r2.dragData.didDrag && start3._private.selectable && rdist2 < r2.touchTapThreshold2 && !r2.pinching) { + if (cy.selectionType() === "single") { + cy.$(isSelected).unmerge(start3).unselect(["tapunselect"]); + start3.select(["tapselect"]); + } else { + if (start3.selected()) { + start3.unselect(["tapunselect"]); + } else { + start3.select(["tapselect"]); } - this.emit("pan viewport"); } - break; - case 2: - dim = arg0; - val = arg1; - if ((dim === "x" || dim === "y") && number$12(val)) { - pan[dim] += val; - } - this.emit("pan viewport"); - break; - } - this.notify("viewport"); - return this; - }, - fit: function fit(elements2, padding2) { - var viewportState = this.getFitViewport(elements2, padding2); - if (viewportState) { - var _p = this._private; - _p.zoom = viewportState.zoom; - _p.pan = viewportState.pan; - this.emit("pan zoom viewport"); - this.notify("viewport"); - } - return this; - }, - getFitViewport: function getFitViewport(elements2, padding2) { - if (number$12(elements2) && padding2 === void 0) { - padding2 = elements2; - elements2 = void 0; + r2.redrawHint("eles", true); + } + r2.touchData.singleTouchMoved = true; } - if (!this._private.panningEnabled || !this._private.zoomingEnabled) { - return; + for (var j2 = 0; j2 < now4.length; j2++) { + earlier[j2] = now4[j2]; } - var bb; - if (string(elements2)) { - var sel = elements2; - elements2 = this.$(sel); - } else if (boundingBox(elements2)) { - var bbe = elements2; - bb = { - x1: bbe.x1, - y1: bbe.y1, - x2: bbe.x2, - y2: bbe.y2 - }; - bb.w = bb.x2 - bb.x1; - bb.h = bb.y2 - bb.y1; - } else if (!elementOrCollection(elements2)) { - elements2 = this.mutableElements(); + 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 (elementOrCollection(elements2) && elements2.empty()) { - return; + if (e3.touches.length < 2) { + if (e3.touches.length === 1) { + r2.touchData.startGPosition = [e3.touches[0].clientX, e3.touches[0].clientY]; + } + r2.pinching = false; + r2.redrawHint("eles", true); + r2.redraw(); } - 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 = { - // now pan to middle - x: (w2 - zoom * (bb.x1 + bb.x2)) / 2, - y: (h - zoom * (bb.y1 + bb.y2)) / 2 - }; + }, "touchendHandler"), false); + if (typeof TouchEvent === "undefined") { + var pointers = []; + var makeTouch = /* @__PURE__ */ __name(function makeTouch2(e3) { return { - zoom, - pan - }; - } - return; - }, - zoomRange: function zoomRange(min3, max3) { - 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; - } - return this; - }, - minZoom: function minZoom(zoom) { - if (zoom === void 0) { - return this._private.minZoom; - } else { - return this.zoomRange({ - min: zoom - }); - } - }, - maxZoom: function maxZoom2(zoom) { - if (zoom === void 0) { - return this._private.maxZoom; - } else { - return this.zoomRange({ - max: zoom + clientX: e3.clientX, + clientY: e3.clientY, + force: 1, + 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: 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; + } + } + }, "removePointer"); + var updatePointer = /* @__PURE__ */ __name(function updatePointer2(e3) { + var p3 = pointers.filter(function(p4) { + return p4.event.pointerId === e3.pointerId; + })[0]; + p3.event = e3; + p3.touch = makeTouch(e3); + }, "updatePointer"); + var addTouchesToEvent = /* @__PURE__ */ __name(function addTouchesToEvent2(e3) { + e3.touches = pointers.map(function(p3) { + return p3.touch; }); - } - }, - getZoomedViewport: function getZoomedViewport(params) { - var _p = this._private; - var currentPan = _p.pan; - var currentZoom = _p.zoom; - var pos; - var zoom; - var bail = false; - if (!_p.zoomingEnabled) { - bail = true; - } - if (number$12(params)) { - zoom = params; - } else if (plainObject(params)) { - zoom = params.level; - if (params.position != null) { - pos = modelToRenderedPosition(params.position, currentZoom, currentPan); - } else if (params.renderedPosition != null) { - pos = params.renderedPosition; + }, "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; } - if (pos != null && !_p.panningEnabled) { - bail = true; + e3.preventDefault(); + addPointer(e3); + addTouchesToEvent(e3); + touchstartHandler(e3); + }); + r2.registerBinding(r2.container, "pointerup", function(e3) { + if (pointerIsMouse(e3)) { + return; } - } - 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))) { - return null; - } - if (pos != null) { - var pan1 = currentPan; - var zoom1 = currentZoom; - var zoom2 = zoom; - var pan2 = { - x: -zoom2 / zoom1 * (pos.x - pan1.x) + pos.x, - y: -zoom2 / zoom1 * (pos.y - pan1.y) + pos.y - }; + removePointer(e3); + addTouchesToEvent(e3); + touchendHandler(e3); + }); + r2.registerBinding(r2.container, "pointercancel", function(e3) { + if (pointerIsMouse(e3)) { + return; + } + removePointer(e3); + addTouchesToEvent(e3); + touchcancelHandler(e3); + }); + r2.registerBinding(r2.container, "pointermove", function(e3) { + if (pointerIsMouse(e3)) { + return; + } + e3.preventDefault(); + updatePointer(e3); + addTouchesToEvent(e3); + touchmoveHandler(e3); + }); + } + }; + BRp$2 = {}; + BRp$2.generatePolygon = function(name, points) { + return this.nodeShapes[name] = { + renderer: this, + name, + points, + draw: /* @__PURE__ */ __name(function draw24(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: /* @__PURE__ */ __name(function draw24(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) { + return this.nodeShapes[name] = { + renderer: this, + name, + 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 draw24(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() { + return this.nodeShapes["round-rectangle"] = this.nodeShapes["roundrectangle"] = { + renderer: this, + name: "round-rectangle", + points: generateUnitNgonPointsFitToSquare(4, 0), + draw: /* @__PURE__ */ __name(function draw24(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(x5, y5, this.points, centerX, centerY, width3, height2 - diam, [0, -1], padding3)) { + return true; + } + if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3 - diam, height2, [0, -1], padding3)) { + return true; + } + if (checkInEllipse(x5, y5, diam, diam, centerX - halfWidth + cornerRadius, centerY - halfHeight + cornerRadius, padding3)) { + return true; + } + if (checkInEllipse(x5, y5, diam, diam, centerX + halfWidth - cornerRadius, centerY - halfHeight + cornerRadius, padding3)) { + return true; + } + if (checkInEllipse(x5, y5, diam, diam, centerX + halfWidth - cornerRadius, centerY + halfHeight - cornerRadius, padding3)) { + return true; + } + if (checkInEllipse(x5, y5, diam, diam, centerX - halfWidth + cornerRadius, centerY + halfHeight - cornerRadius, padding3)) { + return true; + } + return false; + }, "checkPoint") + }; + }; + BRp$2.generateCutRectangle = function() { + return this.nodeShapes["cut-rectangle"] = this.nodeShapes["cutrectangle"] = { + renderer: this, + name: "cut-rectangle", + cornerLength: getCutRectangleCornerLength(), + points: generateUnitNgonPointsFitToSquare(4, 0), + draw: /* @__PURE__ */ __name(function draw24(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; + var yEnd = centerY + hh; return { - zoomed: true, - panned: true, - zoom: zoom2, - pan: pan2 + topLeft: [xBegin, yBegin + cl, xBegin + cl, yBegin, xBegin + cl, yBegin + cl], + topRight: [xEnd - cl, yBegin, xEnd, yBegin + cl, xEnd - cl, yBegin + cl], + bottomRight: [xEnd, yEnd - cl, xEnd - cl, yEnd, xEnd - cl, yEnd - cl], + bottomLeft: [xBegin + cl, yEnd, xBegin, yEnd - cl, xBegin + cl, yEnd - cl] }; - } else { - return { - zoomed: true, - panned: false, - zoom, - pan: currentPan + }, "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(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(x5, y5, this.points, centerX, centerY, width3 - 2 * cl, height2, [0, -1], padding3)) { + return true; + } + 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() { + return this.nodeShapes["barrel"] = { + renderer: this, + name: "barrel", + points: generateUnitNgonPointsFitToSquare(4, 0), + draw: /* @__PURE__ */ __name(function draw24(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(width3 + 2 * padding3, height2 + 2 * padding3, nodeX, nodeY); + var approximateBarrelCurvePts = /* @__PURE__ */ __name(function approximateBarrelCurvePts2(pts3) { + var m0 = qbezierPtAt({ + x: pts3[0], + y: pts3[1] + }, { + x: pts3[2], + y: pts3[3] + }, { + x: pts3[4], + y: pts3[5] + }, t03); + var m1 = qbezierPtAt({ + x: pts3[0], + y: pts3[1] + }, { + x: pts3[2], + y: pts3[3] + }, { + x: pts3[4], + y: pts3[5] + }, t13); + var m2 = qbezierPtAt({ + x: pts3[0], + y: pts3[1] + }, { + x: pts3[2], + y: pts3[3] + }, { + x: pts3[4], + 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(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(width3, height2); + var hOffset = curveConstants.heightOffset; + var wOffset = curveConstants.widthOffset; + 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], + bottomRight: [xEnd, yEnd - hOffset, xEnd - ctrlPtXOffset, yEnd, xEnd - wOffset, yEnd], + bottomLeft: [xBegin + wOffset, yEnd, xBegin + ctrlPtXOffset, yEnd, xBegin, yEnd - hOffset] }; - } - }, - zoom: function zoom(params) { - if (params === void 0) { - return this._private.zoom; - } else { - var vp = this.getZoomedViewport(params); - var _p = this._private; - if (vp == null || !vp.zoomed) { - return this; + pts2.topLeft.isTop = true; + pts2.topRight.isTop = true; + pts2.bottomLeft.isBottom = true; + pts2.bottomRight.isBottom = true; + return pts2; + }, "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(x5, y5, this.points, centerX, centerY, width3, height2 - 2 * hOffset, [0, -1], padding3)) { + return true; } - _p.zoom = vp.zoom; - if (vp.panned) { - _p.pan.x = vp.pan.x; - _p.pan.y = vp.pan.y; + if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3 - 2 * wOffset, height2, [0, -1], padding3)) { + return true; } - this.emit("zoom" + (vp.panned ? " pan" : "") + " viewport"); - this.notify("viewport"); - return this; - } - }, - viewport: function viewport(opts) { - var _p = this._private; - var zoomDefd = true; - var panDefd = true; - var events = []; - var zoomFailed = false; - var panFailed = false; - if (!opts) { - return this; - } - if (!number$12(opts.zoom)) { - zoomDefd = false; - } - if (!plainObject(opts.pan)) { - panDefd = false; - } - if (!zoomDefd && !panDefd) { - return this; - } - if (zoomDefd) { - var z = opts.zoom; - if (z < _p.minZoom || z > _p.maxZoom || !_p.zoomingEnabled) { - zoomFailed = true; - } else { - _p.zoom = z; - events.push("zoom"); + 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]; + var y02 = curvePts[5]; + var y23 = curvePts[1]; + var xMin = Math.min(x0, x22); + var xMax = Math.max(x0, x22); + var yMin = Math.min(y02, y23); + var yMax = Math.max(y02, y23); + if (xMin <= x6 && x6 <= xMax && yMin <= y6 && y6 <= yMax) { + var coeff = bezierPtsToQuadCoeff(x0, x1, x22); + 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 i2 = 0; i2 < curveRegions.length; i2++) { + var corner = curveRegions[i2]; + var cornerPts = barrelCurvePts[corner]; + 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, t4); + if (cornerPts.isTop && bezY <= y5) { + return true; + } + if (cornerPts.isBottom && y5 <= bezY) { + return true; + } + } + return false; + }, "checkPoint") + }; + }; + BRp$2.generateBottomRoundrectangle = function() { + return this.nodeShapes["bottom-round-rectangle"] = this.nodeShapes["bottomroundrectangle"] = { + renderer: this, + name: "bottom-round-rectangle", + points: generateUnitNgonPointsFitToSquare(4, 0), + draw: /* @__PURE__ */ __name(function draw24(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 + (width3 / 2 + padding3); + var topIntersections = finiteLinesIntersect(x5, y5, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false); + if (topIntersections.length > 0) { + return topIntersections; } - } - if (panDefd && (!zoomFailed || !opts.cancelOnFailedZoom) && _p.panningEnabled) { - var p2 = opts.pan; - if (number$12(p2.x)) { - _p.pan.x = p2.x; - panFailed = false; + 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(x5, y5, this.points, centerX, centerY, width3, height2 - diam, [0, -1], padding3)) { + return true; } - if (number$12(p2.y)) { - _p.pan.y = p2.y; - panFailed = false; + if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3 - diam, height2, [0, -1], padding3)) { + return true; } - if (!panFailed) { - events.push("pan"); + 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(x5, y5, points)) { + return true; + } + if (checkInEllipse(x5, y5, diam, diam, centerX + width3 / 2 - cornerRadius, centerY + height2 / 2 - cornerRadius, padding3)) { + return true; } + 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 renderer8 = this; + this.generateEllipse(); + this.generatePolygon("triangle", generateUnitNgonPointsFitToSquare(3, 0)); + this.generateRoundPolygon("round-triangle", generateUnitNgonPointsFitToSquare(3, 0)); + this.generatePolygon("rectangle", generateUnitNgonPointsFitToSquare(4, 0)); + nodeShapes["square"] = nodeShapes["rectangle"]; + this.generateRoundRectangle(); + this.generateCutRectangle(); + this.generateBarrel(); + this.generateBottomRoundrectangle(); + { + var diamondPoints = [0, 1, 1, 0, 0, -1, -1, 0]; + this.generatePolygon("diamond", diamondPoints); + this.generateRoundPolygon("round-diamond", diamondPoints); + } + this.generatePolygon("pentagon", generateUnitNgonPointsFitToSquare(5, 0)); + this.generateRoundPolygon("round-pentagon", generateUnitNgonPointsFitToSquare(5, 0)); + this.generatePolygon("hexagon", generateUnitNgonPointsFitToSquare(6, 0)); + this.generateRoundPolygon("round-hexagon", generateUnitNgonPointsFitToSquare(6, 0)); + this.generatePolygon("heptagon", generateUnitNgonPointsFitToSquare(7, 0)); + this.generateRoundPolygon("round-heptagon", generateUnitNgonPointsFitToSquare(7, 0)); + this.generatePolygon("octagon", generateUnitNgonPointsFitToSquare(8, 0)); + this.generateRoundPolygon("round-octagon", generateUnitNgonPointsFitToSquare(8, 0)); + var star5Points = new Array(20); + { + var outerPoints = generateUnitNgonPoints(5, 0); + var innerPoints = generateUnitNgonPoints(5, Math.PI / 5); + var innerRadius = 0.5 * (3 - Math.sqrt(5)); + innerRadius *= 1.57; + for (var i2 = 0; i2 < innerPoints.length / 2; i2++) { + innerPoints[i2 * 2] *= innerRadius; + innerPoints[i2 * 2 + 1] *= innerRadius; } - if (events.length > 0) { - events.push("viewport"); - this.emit(events.join(" ")); - this.notify("viewport"); + 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]; } - return this; - }, - center: function center2(elements2) { - var pan = this.getCenterPan(elements2); - if (pan) { - this._private.pan = pan; - this.emit("pan viewport"); - this.notify("viewport"); + } + star5Points = fitPolygonToSquare(star5Points); + this.generatePolygon("star", star5Points); + this.generatePolygon("vee", [-1, -1, 0, -0.333, 1, -1, 0, 1]); + this.generatePolygon("rhomboid", [-1, -1, 0.333, -1, 1, 1, -0.333, 1]); + this.generatePolygon("right-rhomboid", [-0.333, -1, 1, -1, 0.333, 1, -1, 1]); + this.nodeShapes["concavehexagon"] = this.generatePolygon("concave-hexagon", [-1, -0.95, -0.75, 0, -1, 0.95, 1, 0.95, 0.75, 0, 1, -0.95]); + { + var tagPoints = [-1, -1, 0.25, -1, 1, 0, 0.25, 1, -1, 1]; + this.generatePolygon("tag", tagPoints); + this.generateRoundPolygon("round-tag", tagPoints); + } + nodeShapes.makePolygon = function(points) { + var key = points.join("$"); + var name = "polygon-" + key; + var shape; + if (shape = this[name]) { + return shape; } - return this; - }, - getCenterPan: function getCenterPan(elements2, zoom) { - if (!this._private.panningEnabled) { + return renderer8.generatePolygon(name, points); + }; + }; + BRp$1 = {}; + BRp$1.timeToRender = function() { + return this.redrawTotalTime / this.redrawCount; + }; + BRp$1.redraw = function(options3) { + options3 = options3 || staticEmptyObject(); + var r2 = this; + if (r2.averageRedrawTime === void 0) { + r2.averageRedrawTime = 0; + } + if (r2.lastRedrawTime === void 0) { + r2.lastRedrawTime = 0; + } + if (r2.lastDrawTime === void 0) { + r2.lastDrawTime = 0; + } + r2.requestedFrame = true; + r2.renderOptions = options3; + }; + BRp$1.beforeRender = function(fn3, priority3) { + if (this.destroyed) { + return; + } + if (priority3 == null) { + error("Priority is not optional for beforeRender"); + } + var cbs = this.beforeRenderCallbacks; + cbs.push({ + fn: fn3, + priority: priority3 + }); + cbs.sort(function(a2, b2) { + return b2.priority - a2.priority; + }); + }; + 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 r2 = this; + var cy = r2.cy; + if (r2.renderLoopStarted) { + return; + } else { + r2.renderLoopStarted = true; + } + var renderFn = /* @__PURE__ */ __name(function renderFn2(requestTime) { + if (r2.destroyed) { return; } - if (string(elements2)) { - var selector2 = elements2; - elements2 = this.mutableElements().filter(selector2); - } else if (!elementOrCollection(elements2)) { - elements2 = this.mutableElements(); + if (cy.batching()) ; + else if (r2.requestedFrame && !r2.skipFrame) { + beforeRenderCallbacks(r2, true, requestTime); + var startTime = performanceNow(); + r2.render(r2.renderOptions); + var endTime = r2.lastDrawTime = performanceNow(); + if (r2.averageRedrawTime === void 0) { + r2.averageRedrawTime = endTime - startTime; + } + if (r2.redrawCount === void 0) { + r2.redrawCount = 0; + } + r2.redrawCount++; + if (r2.redrawTotalTime === void 0) { + r2.redrawTotalTime = 0; + } + var duration = endTime - startTime; + r2.redrawTotalTime += duration; + r2.lastRedrawTime = duration; + r2.averageRedrawTime = r2.averageRedrawTime / 2 + duration / 2; + r2.requestedFrame = false; + } else { + beforeRenderCallbacks(r2, false, requestTime); } - if (elements2.length === 0) { - return; + r2.skipFrame = false; + requestAnimationFrame2(renderFn2); + }, "renderFn"); + requestAnimationFrame2(renderFn); + }; + 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(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; + var stylesheetId = "__________cytoscape_stylesheet"; + var className = "__________cytoscape_container"; + var stylesheetAlreadyExists = document2.getElementById(stylesheetId) != null; + if (ctr.className.indexOf(className) < 0) { + ctr.className = (ctr.className || "") + " " + className; } - var bb = elements2.boundingBox(); - var w2 = this.width(); - var h = this.height(); - zoom = zoom === void 0 ? this._private.zoom : zoom; - var pan = { - // middle - x: (w2 - zoom * (bb.x1 + bb.x2)) / 2, - y: (h - zoom * (bb.y1 + bb.y2)) / 2 - }; - return pan; - }, - reset: function reset2() { - if (!this._private.panningEnabled || !this._private.zoomingEnabled) { - return this; + if (!stylesheetAlreadyExists) { + 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 position5 = computedStyle.getPropertyValue("position"); + if (position5 === "static") { + warn("A Cytoscape container has style position:static and so can not use UI extensions properly"); } - this.viewport({ - pan: { - x: 0, - y: 0 - }, - zoom: 1 - }); - return this; - }, - invalidateSize: function invalidateSize() { - this._private.sizeCache = null; - }, - size: function size2() { - var _p = this._private; - var container = _p.container; - return _p.sizeCache = _p.sizeCache || (container ? function() { - var style = window$1.getComputedStyle(container); - var val = function val2(name2) { - return parseFloat(style.getPropertyValue(name2)); - }; - return { - width: container.clientWidth - val("padding-left") - val("padding-right"), - height: container.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() { - return this.size().width; - }, - height: function height2() { - return this.size().height; - }, - extent: function extent() { - var pan = this._private.pan; - var zoom = 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 - }; - b.w = b.x2 - b.x1; - b.h = b.y2 - b.y1; - return b; - }, - renderedExtent: function renderedExtent() { - var width2 = this.width(); - var height2 = this.height(); - return { - x1: 0, - y1: 0, - x2: width2, - y2: height2, - w: width2, - h: height2 - }; - }, - multiClickDebounceTime: function multiClickDebounceTime(_int) { - if (_int) - this._private.multiClickDebounceTime = _int; - else - return this._private.multiClickDebounceTime; - return this; } + 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, + triggerMode: null, + dragging: false, + initialPan: [null, null], + capture: false + }; + r2.dragData = { + possibleDragElements: [] + }; + r2.touchData = { + start: null, + capture: false, + // These 3 fields related to tap, taphold events + startPosition: [null, null, null, null, null, null], + singleTouchStartTime: null, + singleTouchMoved: true, + now: [null, null, null, null, null, null], + earlier: [null, null, null, null, null, null] + }; + 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, + eleTxrDeq: 200, + lyrTxrDeq: 150, + lyrTxrSkip: 100 + }; + r2.registerNodeShapes(); + r2.registerArrowShapes(); + r2.registerCalculationListeners(); }; - corefn$1.centre = corefn$1.center; - corefn$1.autolockNodes = corefn$1.autolock; - corefn$1.autoungrabifyNodes = corefn$1.autoungrabify; - var fn = { - data: define3.data({ - field: "data", - bindingEvent: "data", - allowBinding: true, - allowSetting: true, - settingEvent: "data", - settingTriggersEvent: true, - triggerFnName: "trigger", - allowGetting: true, - updateStyle: true - }), - removeData: define3.removeData({ - field: "data", - event: "data", - triggerFnName: "trigger", - triggerEvent: 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 - }) - }; - fn.attr = fn.data; - fn.removeAttr = fn.removeData; - var Core = function Core2(opts) { - var cy = this; - opts = extend2({}, opts); - var container = opts.container; - if (container && !htmlElement(container) && htmlElement(container[0])) { - container = container[0]; + BRp.notify = function(eventName, eles) { + var r2 = this; + var cy = r2.cy; + if (this.destroyed) { + return; } - var reg = container ? container._cyreg : null; - reg = reg || {}; - if (reg && reg.cy) { - reg.cy.destroy(); - reg = {}; + if (eventName === "init") { + r2.load(); + return; } - var readies = reg.readies = reg.readies || []; - if (container) { - container._cyreg = reg; + if (eventName === "destroy") { + r2.destroy(); + return; } - reg.cy = cy; - var head2 = window$1 !== void 0 && container !== void 0 && !opts.headless; - var options2 = opts; - options2.layout = extend2({ - name: head2 ? "grid" : "null" - }, options2.layout); - options2.renderer = extend2({ - name: head2 ? "canvas" : "null" - }, options2.renderer); - var defVal = function defVal2(def, val, altVal) { - if (val !== void 0) { - return val; - } else if (altVal !== void 0) { - return altVal; - } else { - return def; + if (eventName === "add" || eventName === "remove" || eventName === "move" && cy.hasCompoundNodes() || eventName === "load" || eventName === "zorder" || eventName === "mount") { + r2.invalidateCachedZSortedEles(); + } + if (eventName === "viewport") { + r2.redrawHint("select", true); + } + if (eventName === "load" || eventName === "resize" || eventName === "mount") { + r2.invalidateContainerClientCoordsCache(); + r2.matchCanvasSize(r2.container); + } + r2.redrawHint("eles", true); + r2.redrawHint("drag", true); + this.startRenderLoop(); + this.redraw(); + }; + BRp.destroy = function() { + 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(r2.labelCalcDiv); + } catch (e3) { } - }; - var _p = this._private = { - container, - // html dom ele container - ready: false, - // whether ready has been triggered - options: options2, - // cached options - elements: new Collection(this), - // elements in the graph - listeners: [], - // list of listeners - aniEles: new Collection(this), - // elements being animated - data: options2.data || {}, - // data for the core - scratch: {}, - // scratch object for core - layout: null, - renderer: null, - destroyed: false, - // whether destroy was called - notificationsEnabled: true, - // 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, - 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 - }, - animation: { - // object for currently-running animations - current: [], - queue: [] - }, - hasCompoundNodes: false, - multiClickDebounceTime: defVal(250, options2.multiClickDebounceTime) - }; - this.createEmitter(); - this.selectionType(options2.selectionType); - this.zoomRange({ - min: options2.minZoom, - max: options2.maxZoom + } + }; + BRp.isHeadless = function() { + return false; + }; + [BRp$f, BRp$5, BRp$4, BRp$3, BRp$2, BRp$1].forEach(function(props) { + extend2(BRp, props); + }); + fullFpsTime = 1e3 / 60; + defs = { + setupDequeueing: /* @__PURE__ */ __name(function setupDequeueing(opts) { + return /* @__PURE__ */ __name(function setupDequeueingImpl() { + var self2 = this; + var r2 = this.renderer; + if (self2.dequeueingSetup) { + return; + } else { + self2.dequeueingSetup = true; + } + var queueRedraw = debounce_1(function() { + r2.redrawHint("eles", true); + r2.redrawHint("drag", true); + r2.redraw(); + }, opts.deqRedrawThreshold); + var dequeue = /* @__PURE__ */ __name(function dequeue2(willDraw, frameStartTime) { + var startTime = performanceNow(); + var avgRenderTime = r2.averageRedrawTime; + var renderTime = r2.lastRedrawTime; + var deqd = []; + var extent2 = r2.cy.extent(); + var pixelRatio = r2.getPixelRatio(); + if (!willDraw) { + r2.flushRenderedStyleQueue(); + } + while (true) { + 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) { + break; + } + } else { + if (willDraw) { + if (duration >= opts.deqCost * renderTime || duration >= opts.deqAvgCost * avgRenderTime) { + break; + } + } else if (frameDuration >= opts.deqNoDrawCost * fullFpsTime) { + break; + } + } + var thisDeqd = opts.deq(self2, pixelRatio, extent2); + if (thisDeqd.length > 0) { + for (var i2 = 0; i2 < thisDeqd.length; i2++) { + deqd.push(thisDeqd[i2]); + } + } else { + break; + } + } + if (deqd.length > 0) { + opts.onDeqd(self2, deqd); + if (!willDraw && opts.shouldRedraw(self2, deqd, pixelRatio, extent2)) { + queueRedraw(); + } + } + }, "dequeue"); + var priority3 = opts.priority || noop$1; + r2.beforeRender(dequeue, priority3(self2)); + }, "setupDequeueingImpl"); + }, "setupDequeueing") + }; + 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$2(); + this.keyForId = new Map$2(); + this.cachesByLvl = new Map$2(); + this.lvls = []; + this.getKey = getKey3; + this.doesEleInvalidateKey = doesEleInvalidateKey; + } + __name(ElementTextureCacheLookup2, "ElementTextureCacheLookup"); + _createClass(ElementTextureCacheLookup2, [{ + key: "getIdsFor", + 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$1(); + idsByKey.set(key, ids); + } + return ids; + }, "getIdsFor") + }, { + key: "addIdForKey", + value: /* @__PURE__ */ __name(function addIdForKey(key, id27) { + if (key != null) { + this.getIdsFor(key).add(id27); + } + }, "addIdForKey") + }, { + key: "deleteIdForKey", + value: /* @__PURE__ */ __name(function deleteIdForKey(key, id27) { + if (key != null) { + this.getIdsFor(key)["delete"](id27); + } + }, "deleteIdForKey") + }, { + key: "getNumberOfIdsForKey", + value: /* @__PURE__ */ __name(function getNumberOfIdsForKey(key) { + if (key == null) { + return 0; + } else { + return this.getIdsFor(key).size; + } + }, "getNumberOfIdsForKey") + }, { + key: "updateKeyMappingFor", + value: /* @__PURE__ */ __name(function updateKeyMappingFor(ele) { + var id27 = ele.id(); + var prevKey = this.keyForId.get(id27); + var currKey = this.getKey(ele); + this.deleteIdForKey(prevKey, id27); + this.addIdForKey(currKey, id27); + this.keyForId.set(id27, currKey); + }, "updateKeyMappingFor") + }, { + key: "deleteKeyMappingFor", + value: /* @__PURE__ */ __name(function deleteKeyMappingFor(ele) { + var id27 = ele.id(); + var prevKey = this.keyForId.get(id27); + this.deleteIdForKey(prevKey, id27); + this.keyForId["delete"](id27); + }, "deleteKeyMappingFor") + }, { + key: "keyHasChangedFor", + value: /* @__PURE__ */ __name(function keyHasChangedFor(ele) { + var id27 = ele.id(); + var prevKey = this.keyForId.get(id27); + var newKey = this.getKey(ele); + return prevKey !== newKey; + }, "keyHasChangedFor") + }, { + key: "isInvalid", + value: /* @__PURE__ */ __name(function isInvalid(ele) { + return this.keyHasChangedFor(ele) || this.doesEleInvalidateKey(ele); + }, "isInvalid") + }, { + key: "getCachesAt", + value: /* @__PURE__ */ __name(function getCachesAt(lvl) { + var cachesByLvl = this.cachesByLvl, lvls = this.lvls; + var caches = cachesByLvl.get(lvl); + if (!caches) { + caches = new Map$2(); + cachesByLvl.set(lvl, caches); + lvls.push(lvl); + } + return caches; + }, "getCachesAt") + }, { + key: "getCache", + value: /* @__PURE__ */ __name(function getCache(key, lvl) { + return this.getCachesAt(lvl).get(key); + }, "getCache") + }, { + key: "get", + value: /* @__PURE__ */ __name(function get6(ele, lvl) { + var key = this.getKey(ele); + var cache3 = this.getCache(key, lvl); + if (cache3 != null) { + this.updateKeyMappingFor(ele); + } + return cache3; + }, "get") + }, { + key: "getForCachedKey", + value: /* @__PURE__ */ __name(function getForCachedKey(ele, lvl) { + var key = this.keyForId.get(ele.id()); + var cache3 = this.getCache(key, lvl); + return cache3; + }, "getForCachedKey") + }, { + key: "hasCache", + value: /* @__PURE__ */ __name(function hasCache(key, lvl) { + return this.getCachesAt(lvl).has(key); + }, "hasCache") + }, { + key: "has", + value: /* @__PURE__ */ __name(function has2(ele, lvl) { + var key = this.getKey(ele); + return this.hasCache(key, lvl); + }, "has") + }, { + key: "setCache", + value: /* @__PURE__ */ __name(function setCache(key, lvl, cache3) { + cache3.key = key; + this.getCachesAt(lvl).set(key, cache3); + }, "setCache") + }, { + key: "set", + value: /* @__PURE__ */ __name(function set6(ele, lvl, cache3) { + var key = this.getKey(ele); + this.setCache(key, lvl, cache3); + this.updateKeyMappingFor(ele); + }, "set") + }, { + key: "deleteCache", + value: /* @__PURE__ */ __name(function deleteCache(key, lvl) { + this.getCachesAt(lvl)["delete"](key); + }, "deleteCache") + }, { + key: "delete", + value: /* @__PURE__ */ __name(function _delete(ele, lvl) { + var key = this.getKey(ele); + this.deleteCache(key, lvl); + }, "_delete") + }, { + key: "invalidateKey", + 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: /* @__PURE__ */ __name(function invalidate(ele) { + var id27 = ele.id(); + var key = this.keyForId.get(id27); + this.deleteKeyMappingFor(ele); + var entireKeyInvalidated = this.doesEleInvalidateKey(ele); + if (entireKeyInvalidated) { + this.invalidateKey(key); + } + return entireKeyInvalidated || this.getNumberOfIdsForKey(key) === 0; + }, "invalidate") + }]); + return ElementTextureCacheLookup2; + }(); + 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" + }; + initDefaults = defaults$g({ + getKey: null, + doesEleInvalidateKey: falsify, + drawElement: null, + getBoundingBox: null, + getRotationPoint: null, + getRotationOffset: null, + isVisible: trueify, + allowEdgeTxrCaching: true, + allowParentTxrCaching: true + }); + ElementTextureCache = /* @__PURE__ */ __name(function ElementTextureCache2(renderer8, initOptions) { + var self2 = this; + self2.renderer = renderer8; + self2.onDequeues = []; + var opts = initDefaults(initOptions); + extend2(self2, opts); + self2.lookup = new ElementTextureCacheLookup(opts.getKey, opts.doesEleInvalidateKey); + self2.setupDequeueing(); + }, "ElementTextureCache"); + ETCp = ElementTextureCache.prototype; + ETCp.reasons = getTxrReasons; + ETCp.getTextureQueue = function(txrH) { + var self2 = this; + self2.eleImgCaches = self2.eleImgCaches || {}; + return self2.eleImgCaches[txrH] = self2.eleImgCaches[txrH] || []; + }; + ETCp.getRetiredTextureQueue = function(txrH) { + var self2 = this; + var rtxtrQs = self2.eleImgCaches.retired = self2.eleImgCaches.retired || {}; + var rtxtrQ = rtxtrQs[txrH] = rtxtrQs[txrH] || []; + return rtxtrQ; + }; + ETCp.getElementQueue = function() { + var self2 = this; + var q2 = self2.eleCacheQueue = self2.eleCacheQueue || new heap(function(a2, b2) { + return b2.reqs - a2.reqs; }); - var loadExtData = function loadExtData2(extData, next2) { - var anyIsPromise = extData.some(promise); - if (anyIsPromise) { - return Promise$12.all(extData).then(next2); - } else { - next2(extData); + return q2; + }; + ETCp.getElementKeyToQueue = function() { + var self2 = this; + var k2q = self2.eleKeyToCacheQueue = self2.eleKeyToCacheQueue || {}; + return k2q; + }; + ETCp.getElement = function(ele, bb, pxRatio, lvl, reason) { + var self2 = this; + 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; + } + if (!self2.allowEdgeTxrCaching && ele.isEdge() || !self2.allowParentTxrCaching && ele.isParent()) { + return null; + } + if (lvl == null) { + lvl = Math.ceil(log22(zoom2 * pxRatio)); + } + if (lvl < minLvl$1) { + lvl = minLvl$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 = r2.eleTextBiggerThanMin(ele, scale); + if (!this.isVisible(ele, scaledLabelShown)) { + return null; + } + var eleCache = lookup2.get(ele, lvl); + if (eleCache && eleCache.invalidated) { + eleCache.invalidated = false; + eleCache.texture.invalidatedWidth -= eleCache.width; + } + if (eleCache) { + return eleCache; + } + var txrH; + if (eleScaledH <= minTxrH) { + txrH = minTxrH; + } else if (eleScaledH <= txrStepH) { + txrH = txrStepH; + } else { + txrH = Math.ceil(eleScaledH / txrStepH) * txrStepH; + } + if (eleScaledH > maxTxrH || eleScaledW > maxTxrW) { + return null; + } + var txrQ = self2.getTextureQueue(txrH); + var txr = txrQ[txrQ.length - 2]; + var addNewTxr = /* @__PURE__ */ __name(function addNewTxr2() { + return self2.recycleTexture(txrH, eleScaledW) || self2.addTexture(txrH, eleScaledW); + }, "addNewTxr"); + if (!txr) { + txr = txrQ[txrQ.length - 1]; + } + if (!txr) { + txr = addNewTxr(); + } + if (txr.width - txr.usedWidth < eleScaledW) { + txr = addNewTxr(); + } + 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 l2 = lvl + 1; l2 <= maxLvl$1; l2++) { + var c3 = lookup2.get(ele, l2); + if (c3) { + higherCache = c3; + break; } - }; - if (_p.styleEnabled) { - cy.setStyle([]); } - var rendererOptions = extend2({}, options2, options2.renderer); - cy.initRenderer(rendererOptions); - var setElesAndLayout = function setElesAndLayout2(elements2, onload, ondone) { - cy.notifications(false); - var oldEles = cy.mutableElements(); - if (oldEles.length > 0) { - oldEles.remove(); + var oneUpCache = higherCache && higherCache.level === lvl + 1 ? higherCache : null; + 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)) { + downscale(); + } else if (scalableFrom(higherCache)) { + if (highQualityReq) { + for (var _l = higherCache.level; _l > lvl; _l--) { + oneUpCache = self2.getElement(ele, bb, pxRatio, _l, getTxrReasons.downscale); + } + downscale(); + } else { + self2.queueElement(ele, higherCache.level - 1); + return higherCache; } - if (elements2 != null) { - if (plainObject(elements2) || array2(elements2)) { - cy.add(elements2); + } else { + var lowerCache; + if (!deqing && !highQualityReq && !downscaleReq) { + for (var _l2 = lvl - 1; _l2 >= minLvl$1; _l2--) { + var _c = lookup2.get(ele, _l2); + if (_c) { + lowerCache = _c; + break; + } } } - cy.one("layoutready", function(e) { - cy.notifications(true); - cy.emit(e); - cy.one("load", onload); - cy.emitAndNotify("load"); - }).one("layoutstop", function() { - cy.one("done", ondone); - cy.emit("done"); - }); - var layoutOpts = extend2({}, cy._private.options.layout); - layoutOpts.eles = cy.elements(); - cy.layout(layoutOpts).run(); - }; - loadExtData([options2.style, options2.elements], function(thens) { - var initStyle = thens[0]; - var initEles = thens[1]; - if (_p.styleEnabled) { - cy.style().append(initStyle); + if (scalableFrom(lowerCache)) { + self2.queueElement(ele, lvl); + return lowerCache; } - setElesAndLayout(initEles, function() { - cy.startAnimationLoop(); - _p.ready = true; - if (fn$6(options2.ready)) { - cy.on("ready", options2.ready); - } - for (var i3 = 0; i3 < readies.length; i3++) { - var fn2 = readies[i3]; - cy.on("ready", fn2); - } - if (reg) { - reg.readies = []; - } - cy.emit("ready"); - }, options2.done); - }); + txr.context.translate(txr.usedWidth, 0); + txr.context.scale(scale, scale); + this.drawElement(txr.context, ele, bb, scaledLabelShown, false); + txr.context.scale(1 / scale, 1 / scale); + txr.context.translate(-txr.usedWidth, 0); + } + eleCache = { + x: txr.usedWidth, + texture: txr, + level: lvl, + scale, + width: eleScaledW, + height: eleScaledH, + scaledLabelShown + }; + txr.usedWidth += Math.ceil(eleScaledW + eleTxrSpacing); + txr.eleCaches.push(eleCache); + lookup2.set(ele, lvl, eleCache); + self2.checkTextureFullness(txr); + return eleCache; }; - var corefn = Core.prototype; - extend2(corefn, { - instanceString: function instanceString() { - return "core"; - }, - isReady: function isReady() { - return this._private.ready; - }, - destroyed: function destroyed() { - return this._private.destroyed; - }, - ready: function ready(fn2) { - if (this.isReady()) { - this.emitter().emit("ready", [], fn2); - } else { - this.on("ready", fn2); + ETCp.invalidateElements = function(eles) { + for (var i2 = 0; i2 < eles.length; i2++) { + this.invalidateElement(eles[i2]); + } + }; + ETCp.invalidateElement = function(ele) { + var self2 = this; + var lookup2 = self2.lookup; + var caches = []; + var invalid = lookup2.isInvalid(ele); + if (!invalid) { + return; + } + for (var lvl = minLvl$1; lvl <= maxLvl$1; lvl++) { + var cache3 = lookup2.getForCachedKey(ele, lvl); + if (cache3) { + caches.push(cache3); } - return this; - }, - destroy: function destroy() { - var cy = this; - 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() { - return this._private.hasCompoundNodes; - }, - headless: function headless() { - return this._private.renderer.isHeadless(); - }, - styleEnabled: function styleEnabled() { - return this._private.styleEnabled; - }, - addToPool: function addToPool(eles) { - this._private.elements.merge(eles); - return this; - }, - removeFromPool: function removeFromPool(eles) { - this._private.elements.unmerge(eles); - return this; - }, - container: function container() { - return this._private.container || null; - }, - mount: function mount(container) { - if (container == null) { - return; + } + var noOtherElesUseCache = lookup2.invalidate(ele); + if (noOtherElesUseCache) { + for (var i2 = 0; i2 < caches.length; i2++) { + var _cache = caches[i2]; + var txr = _cache.texture; + txr.invalidatedWidth += _cache.width; + _cache.invalidated = true; + self2.checkTextureUtility(txr); } - var cy = this; - var _p = cy._private; - var options2 = _p.options; - if (!htmlElement(container) && htmlElement(container[0])) { - container = container[0]; + } + self2.removeFromQueue(ele); + }; + ETCp.checkTextureUtility = function(txr) { + if (txr.invalidatedWidth >= minUtility * txr.width) { + this.retireTexture(txr); + } + }; + ETCp.checkTextureFullness = function(txr) { + var self2 = this; + var txrQ = self2.getTextureQueue(txr.height); + if (txr.usedWidth / txr.width > maxFullness && txr.fullnessChecks >= maxFullnessChecks) { + removeFromArray(txrQ, txr); + } else { + txr.fullnessChecks++; + } + }; + ETCp.retireTexture = function(txr) { + var self2 = this; + var txrH = txr.height; + var txrQ = self2.getTextureQueue(txrH); + var lookup2 = this.lookup; + removeFromArray(txrQ, txr); + txr.retired = true; + var eleCaches = txr.eleCaches; + for (var i2 = 0; i2 < eleCaches.length; i2++) { + var eleCache = eleCaches[i2]; + lookup2.deleteCache(eleCache.key, eleCache.level); + } + clearArray(eleCaches); + var rtxtrQ = self2.getRetiredTextureQueue(txrH); + rtxtrQ.push(txr); + }; + ETCp.addTexture = function(txrH, minW) { + var self2 = this; + var txrQ = self2.getTextureQueue(txrH); + var txr = {}; + txrQ.push(txr); + txr.eleCaches = []; + txr.height = txrH; + txr.width = Math.max(defTxrWidth, minW); + txr.usedWidth = 0; + txr.invalidatedWidth = 0; + txr.fullnessChecks = 0; + txr.canvas = self2.renderer.makeOffscreenCanvas(txr.width, txr.height); + txr.context = txr.canvas.getContext("2d"); + return txr; + }; + ETCp.recycleTexture = function(txrH, minW) { + var self2 = this; + var txrQ = self2.getTextureQueue(txrH); + var rtxtrQ = self2.getRetiredTextureQueue(txrH); + for (var i2 = 0; i2 < rtxtrQ.length; i2++) { + var txr = rtxtrQ[i2]; + if (txr.width >= minW) { + txr.retired = false; + txr.usedWidth = 0; + txr.invalidatedWidth = 0; + txr.fullnessChecks = 0; + clearArray(txr.eleCaches); + txr.context.setTransform(1, 0, 0, 1, 0, 0); + txr.context.clearRect(0, 0, txr.width, txr.height); + removeFromArray(rtxtrQ, txr); + txrQ.push(txr); + return txr; } - cy.stopAnimationLoop(); - cy.destroyRenderer(); - _p.container = container; - _p.styleEnabled = true; - cy.invalidateSize(); - cy.initRenderer(extend2({}, options2, options2.renderer, { - // allow custom renderer name to be re-used, otherwise use canvas - name: options2.renderer.name === "null" ? "canvas" : options2.renderer.name - })); - cy.startAnimationLoop(); - cy.style(options2.style); - cy.emit("mount"); - return cy; - }, - unmount: function unmount() { - var cy = this; - cy.stopAnimationLoop(); - cy.destroyRenderer(); - cy.initRenderer({ - name: "null" - }); - cy.emit("unmount"); - return cy; - }, - options: function options2() { - return copy2(this._private.options); - }, - json: function json2(obj) { - var cy = this; - var _p = cy._private; - var eles = cy.mutableElements(); - var getFreshRef = function getFreshRef2(ele) { - return cy.getElementById(ele.id()); + } + }; + ETCp.queueElement = function(ele, lvl) { + var self2 = this; + var q2 = self2.getElementQueue(); + var k2q = self2.getElementKeyToQueue(); + var key = this.getKey(ele); + var existingReq = k2q[key]; + if (existingReq) { + existingReq.level = Math.max(existingReq.level, lvl); + existingReq.eles.merge(ele); + existingReq.reqs++; + q2.updateItem(existingReq); + } else { + var req = { + eles: ele.spawn().merge(ele), + level: lvl, + reqs: 1, + key }; - if (plainObject(obj)) { - cy.startBatch(); - if (obj.elements) { - var idInJson = {}; - var updateEles = function updateEles2(jsons, gr2) { - var toAdd = []; - var toMod = []; - for (var i4 = 0; i4 < jsons.length; i4++) { - var json4 = jsons[i4]; - 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; - if (ele.length !== 0) { - toMod.push({ - ele, - json: json4 - }); - } else { - if (gr2) { - json4.group = gr2; - toAdd.push(json4); - } else { - toAdd.push(json4); - } - } - } - cy.add(toAdd); - for (var _i = 0; _i < toMod.length; _i++) { - var _toMod$_i = toMod[_i], _ele = _toMod$_i.ele, _json = _toMod$_i.json; - _ele.json(_json); - } - }; - 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); - } - } - } - var parentsToRemove = cy.collection(); - eles.filter(function(ele) { - return !idInJson[ele.id()]; - }).forEach(function(ele) { - if (ele.isParent()) { - parentsToRemove.merge(ele); - } else { - ele.remove(); - } - }); - parentsToRemove.forEach(function(ele) { - return ele.children().move({ - parent: null - }); - }); - parentsToRemove.forEach(function(ele) { - return getFreshRef(ele).remove(); - }); - } - if (obj.style) { - cy.style(obj.style); - } - if (obj.zoom != null && obj.zoom !== _p.zoom) { - cy.zoom(obj.zoom); - } - if (obj.pan) { - if (obj.pan.x !== _p.pan.x || obj.pan.y !== _p.pan.y) { - cy.pan(obj.pan); - } - } - if (obj.data) { - cy.data(obj.data); - } - var fields = ["minZoom", "maxZoom", "zoomingEnabled", "userZoomingEnabled", "panningEnabled", "userPanningEnabled", "boxSelectionEnabled", "autolock", "autoungrabify", "autounselectify", "multiClickDebounceTime"]; - for (var _i2 = 0; _i2 < fields.length; _i2++) { - var f2 = fields[_i2]; - if (obj[f2] != null) { - cy[f2](obj[f2]); - } + q2.push(req); + k2q[key] = req; + } + }; + ETCp.dequeue = function(pxRatio) { + var self2 = this; + var q2 = self2.getElementQueue(); + var k2q = self2.getElementKeyToQueue(); + var dequeued = []; + var lookup2 = self2.lookup; + 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); + k2q[key] = null; + if (cacheExists) { + continue; } - cy.endBatch(); - return this; + dequeued.push(req); + var bb = self2.getBoundingBox(ele); + self2.getElement(ele, bb, pxRatio, req.level, getTxrReasons.dequeue); } else { - var flat = !!obj; - var json3 = {}; - if (flat) { - json3.elements = this.elements().map(function(ele) { - return ele.json(); - }); - } else { - json3.elements = {}; - eles.forEach(function(ele) { - var group = ele.group(); - if (!json3.elements[group]) { - json3.elements[group] = []; - } - json3.elements[group].push(ele.json()); - }); - } - if (this._private.styleEnabled) { - json3.style = cy.style().json(); - } - json3.data = copy2(cy.data()); - var options2 = _p.options; - json3.zoomingEnabled = _p.zoomingEnabled; - json3.userZoomingEnabled = _p.userZoomingEnabled; - json3.zoom = _p.zoom; - json3.minZoom = _p.minZoom; - json3.maxZoom = _p.maxZoom; - json3.panningEnabled = _p.panningEnabled; - json3.userPanningEnabled = _p.userPanningEnabled; - json3.pan = copy2(_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; - return json3; + break; } } - }); - 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) { - extend2(corefn, props); - }); - var defaults$7 = { - fit: true, - // whether to fit the viewport to the graph - directed: false, - // whether the tree is directed downwards (or edges can point in any direction if false) - padding: 30, - // padding on fit - circle: false, - // put depths in concentric circles if true, put depths top down if false - grid: false, - // whether to create an even grid into which the DAG is placed (circle:false only) - spacingFactor: 1.75, - // positive spacing factor, larger => more space between nodes (N.B. n/a if causes overlap) - boundingBox: void 0, - // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - avoidOverlap: true, - // prevents node overlap, may overflow boundingBox if not enough space - nodeDimensionsIncludeLabels: false, - // Excludes the label when calculating node bounding boxes for the layout algorithm - roots: void 0, - // the roots of the trees - maximal: false, - // whether to shift nodes down their natural BFS depths in order to avoid upwards edges (DAGS only) - depthSort: void 0, - // a sorting function to order nodes at equal depth. e.g. function(a, b){ return a.data('weight') - b.data('weight') } - 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) { - return true; - }, - // 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; + return dequeued; + }; + ETCp.removeFromQueue = function(ele) { + var self2 = this; + 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; + q2.updateItem(req); + q2.pop(); + k2q[key] = null; + } else { + req.eles.unmerge(ele); + } } - // transform a given node position. Useful for changing flow direction in discrete layouts }; - var getInfo2 = function getInfo3(ele) { - return ele.scratch("breadthfirst"); + ETCp.onDequeue = function(fn3) { + this.onDequeues.push(fn3); }; - var setInfo2 = function setInfo3(ele, obj) { - return ele.scratch("breadthfirst", obj); + ETCp.offDequeue = function(fn3) { + removeFromArray(this.onDequeues, fn3); }; - function BreadthFirstLayout(options2) { - this.options = extend2({}, defaults$7, options2); - } - BreadthFirstLayout.prototype.run = function() { - var params = this.options; - var options2 = params; - var cy = params.cy; - var eles = options2.eles; - var nodes2 = eles.nodes().filter(function(n2) { - return !n2.isParent(); - }); - var graph = eles; - var directed = options2.directed; - var maximal = options2.maximal || options2.maximalAdjustments > 0; - var bb = makeBoundingBox(options2.boundingBox ? options2.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)) { - var rootsArray = []; - for (var i3 = 0; i3 < options2.roots.length; i3++) { - var id2 = options2.roots[i3]; - var ele = cy.getElementById(id2); - rootsArray.push(ele); + ETCp.setupDequeueing = defs.setupDequeueing({ + deqRedrawThreshold: deqRedrawThreshold$1, + deqCost: deqCost$1, + deqAvgCost: deqAvgCost$1, + deqNoDrawCost: deqNoDrawCost$1, + deqFastCost: deqFastCost$1, + 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; + }, "shouldRedraw"), + priority: /* @__PURE__ */ __name(function priority(self2) { + return self2.renderer.beforeRenderPriorities.eleTxrDeq; + }, "priority") + }); + 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(renderer8) { + var self2 = this; + var r2 = self2.renderer = renderer8; + var cy = r2.cy; + self2.layersByLevel = {}; + self2.firstGet = true; + self2.lastInvalidationTime = performanceNow() - 2 * invalidThreshold; + self2.skipping = false; + self2.eleTxrDeqs = cy.collection(); + self2.scheduleElementRefinement = debounce_1(function() { + self2.refineElementTextures(self2.eleTxrDeqs); + self2.eleTxrDeqs.unmerge(self2.eleTxrDeqs); + }, refineEleDebounceTime); + r2.beforeRender(function(willDraw, now4) { + if (now4 - self2.lastInvalidationTime <= invalidThreshold) { + self2.skipping = true; + } else { + self2.skipping = false; + } + }, r2.beforeRenderPriorities.lyrTxrSkip); + var qSort = /* @__PURE__ */ __name(function qSort2(a2, b2) { + return b2.reqs - a2.reqs; + }, "qSort"); + self2.layersQueue = new heap(qSort); + self2.setupDequeueing(); + }, "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 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: w3, + height: h2, + canvas, + context: canvas.getContext("2d"), + eles: [], + elesQueue: [], + reqs: 0 + }; + var cxt = layer.context; + var dx = -layer.bb.x1; + var dy = -layer.bb.y1; + cxt.scale(scale, scale); + cxt.translate(dx, dy); + return layer; + }; + LTCp.getLayers = function(eles, pxRatio, lvl) { + var self2 = this; + 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(log22(zoom2 * pxRatio)); + if (lvl < minLvl) { + lvl = minLvl; + } else if (zoom2 >= maxZoom2 || lvl > maxLvl) { + return null; } - roots = cy.collection(rootsArray); - } else if (string(options2.roots)) { - roots = cy.$(options2.roots); - } else { - if (directed) { - roots = nodes2.roots(); - } else { - var components = eles.components(); - roots = cy.collection(); - var _loop = function _loop2(_i3) { - var comp = components[_i3]; - var maxDegree = comp.maxDegree(false); - var compRoots = comp.filter(function(ele2) { - return ele2.degree(false) === maxDegree; - }); - roots = roots.add(compRoots); - }; - for (var _i = 0; _i < components.length; _i++) { - _loop(_i); + } + self2.validateLayersElesOrdering(lvl, eles); + var layersByLvl = self2.layersByLevel; + var scale = Math.pow(2, lvl); + var layers = layersByLvl[lvl] = layersByLvl[lvl] || []; + var bb; + var lvlComplete = self2.levelIsComplete(lvl, eles); + var tmpLayers; + 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; + } + }, "canUseAsTmpLvl"); + var checkLvls = /* @__PURE__ */ __name(function checkLvls2(dir2) { + if (tmpLayers) { + return; + } + for (var l2 = lvl + dir2; minLvl <= l2 && l2 <= maxLvl; l2 += dir2) { + if (canUseAsTmpLvl(l2)) { + break; + } + } + }, "checkLvls"); + checkLvls(1); + checkLvls(-1); + 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 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 changeDepth = function changeDepth2(ele2, newDepth) { - var _getInfo = getInfo2(ele2), depth = _getInfo.depth, index = _getInfo.index; - depths[depth][index] = null; - addToDepth(ele2, newDepth); - }; - graph.bfs({ - roots, - directed: options2.directed, - visit: function visit(node2, edge, pNode, i4, depth) { - var ele2 = node2[0]; - var id3 = ele2.id(); - addToDepth(ele2, depth); - foundByBfs[id3] = true; + var getBb = /* @__PURE__ */ __name(function getBb2() { + if (!bb) { + bb = makeBoundingBox(); + for (var i3 = 0; i3 < eles.length; i3++) { + updateBoundingBox(bb, eles[i3].boundingBox()); + } } - }); - var orphanNodes = []; - for (var _i2 = 0; _i2 < nodes2.length; _i2++) { - var _ele = nodes2[_i2]; - if (foundByBfs[_ele.id()]) { - continue; - } else { - orphanNodes.push(_ele); + return bb; + }, "getBb"); + var makeLayer = /* @__PURE__ */ __name(function makeLayer2(opts) { + opts = opts || {}; + var after = opts.after; + getBb(); + var area = bb.w * scale * (bb.h * scale); + if (area > maxLayerArea) { + return null; + } + var layer2 = self2.makeLayer(bb, lvl); + if (after != null) { + 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 assignDepthsAt = function assignDepthsAt2(i4) { - var eles2 = depths[i4]; - for (var j = 0; j < eles2.length; j++) { - var _ele2 = eles2[j]; - if (_ele2 == null) { - eles2.splice(j, 1); - j--; - continue; - } - setInfo2(_ele2, { - depth: i4, - index: j + var layer = null; + var maxElesPerLayer = eles.length / defNumLayers; + var allowLazyQueueing = !firstGet; + 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]; + if (existingLayer) { + layer = existingLayer; + continue; + } + if (!layer || layer.eles.length >= maxElesPerLayer || !boundingBoxInBoundingBox(layer.bb, ele.boundingBox())) { + layer = makeLayer({ + insert: true, + after: layer }); + if (!layer) { + return null; + } } - }; - var assignDepths = function assignDepths2() { - for (var _i3 = 0; _i3 < depths.length; _i3++) { - assignDepthsAt(_i3); + if (tmpLayers || allowLazyQueueing) { + self2.queueLayer(layer, ele); + } else { + self2.drawEleInLayer(layer, ele, lvl, pxRatio); } - }; - var adjustMaximally = function adjustMaximally2(ele2, shifted2) { - var eInfo = getInfo2(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); - maxDepth = Math.max(maxDepth, iInfo.depth); + layer.eles.push(ele); + caches[lvl] = layer; + } + if (tmpLayers) { + return tmpLayers; + } + if (allowLazyQueueing) { + return null; + } + return layers; + }; + LTCp.getEleLevelForLayerLevel = function(lvl, pxRatio) { + return lvl; + }; + LTCp.drawEleInLayer = function(layer, ele, lvl, pxRatio) { + var self2 = this; + var r2 = this.renderer; + var context = layer.context; + var bb = ele.boundingBox(); + if (bb.w === 0 || bb.h === 0 || !ele.visible()) { + return; + } + lvl = self2.getEleLevelForLayerLevel(lvl, pxRatio); + { + r2.setImgSmoothing(context, false); + } + { + r2.drawCachedElement(context, ele, null, null, lvl, useHighQualityEleTxrReqs); + } + { + r2.setImgSmoothing(context, true); + } + }; + LTCp.levelIsComplete = function(lvl, eles) { + var self2 = this; + var layers = self2.layersByLevel[lvl]; + if (!layers || layers.length === 0) { + return false; + } + var numElesInLayers = 0; + for (var i2 = 0; i2 < layers.length; i2++) { + var layer = layers[i2]; + if (layer.reqs > 0) { + return false; } - if (eInfo.depth <= maxDepth) { - if (shifted2[id3]) { - return null; - } - changeDepth(ele2, maxDepth + 1); - shifted2[id3] = true; - return true; + if (layer.invalid) { + return false; } + numElesInLayers += layer.eles.length; + } + if (numElesInLayers !== eles.length) { return false; - }; - if (directed && maximal) { - var Q2 = []; - var shifted = {}; - var enqueue = function enqueue2(n2) { - return Q2.push(n2); - }; - var dequeue = function dequeue2() { - return Q2.shift(); - }; - nodes2.forEach(function(n2) { - return Q2.push(n2); - }); - while (Q2.length > 0) { - var _ele3 = dequeue(); - var didShift = adjustMaximally(_ele3, shifted); - if (didShift) { - _ele3.outgoers().filter(function(el) { - return el.isNode() && eles.has(el); - }).forEach(enqueue); - } else if (didShift === null) { - warn("Detected double maximal shift for node `" + _ele3.id() + "`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs."); + } + return true; + }; + LTCp.validateLayersElesOrdering = function(lvl, eles) { + var layers = this.layersByLevel[lvl]; + if (!layers) { + return; + } + for (var i2 = 0; i2 < layers.length; i2++) { + var layer = layers[i2]; + var offset = -1; + for (var j2 = 0; j2 < eles.length; j2++) { + if (layer.eles[0] === eles[j2]) { + offset = j2; break; } } - } - assignDepths(); - var minDistance = 0; - if (options2.avoidOverlap) { - for (var _i4 = 0; _i4 < nodes2.length; _i4++) { - var n = nodes2[_i4]; - var nbb = n.layoutDimensions(options2); - var w2 = nbb.w; - var h = nbb.h; - minDistance = Math.max(minDistance, w2, h); - } - } - var cachedWeightedPercent = {}; - var getWeightedPercent = function getWeightedPercent2(ele2) { - if (cachedWeightedPercent[ele2.id()]) { - return cachedWeightedPercent[ele2.id()]; + if (offset < 0) { + this.invalidateLayer(layer); + continue; } - var eleDepth = getInfo2(ele2).depth; - var neighbors = ele2.neighborhood(); - var percent = 0; - var samples = 0; - for (var _i5 = 0; _i5 < neighbors.length; _i5++) { - var neighbor = neighbors[_i5]; - if (neighbor.isEdge() || neighbor.isParent() || !nodes2.has(neighbor)) { - continue; + var o2 = offset; + for (var j2 = 0; j2 < layer.eles.length; j2++) { + if (layer.eles[j2] !== eles[o2 + j2]) { + this.invalidateLayer(layer); + break; } - var bf = getInfo2(neighbor); - if (bf == null) { + } + } + }; + LTCp.updateElementsInLayers = function(eles, update2) { + var self2 = this; + 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 l2 = minLvl; l2 <= maxLvl; l2++) { + var layer = caches[l2]; + if (!layer) { continue; } - var index = bf.index; - var depth = bf.depth; - if (index == null || depth == null) { + if (req && self2.getEleLevelForLayerLevel(layer.level) !== req.level) { continue; } - var nDepth = depths[depth].length; - if (depth < eleDepth) { - percent += index / nDepth; - samples++; - } - } - samples = Math.max(1, samples); - percent = percent / samples; - if (samples === 0) { - percent = 0; + update2(layer, ele, req); } - 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()); - } else { - return diff; + } + }; + LTCp.haveLayers = function() { + var self2 = this; + var haveLayers = false; + for (var l2 = minLvl; l2 <= maxLvl; l2++) { + var layers = self2.layersByLevel[l2]; + if (layers && layers.length > 0) { + haveLayers = true; + break; } - }; - if (options2.depthSort !== void 0) { - sortFn = options2.depthSort; } - for (var _i6 = 0; _i6 < depths.length; _i6++) { - depths[_i6].sort(sortFn); - assignDepthsAt(_i6); + return haveLayers; + }; + LTCp.invalidateElements = function(eles) { + var self2 = this; + if (eles.length === 0) { + return; } - var orphanDepth = []; - for (var _i7 = 0; _i7 < orphanNodes.length; _i7++) { - orphanDepth.push(orphanNodes[_i7]); + self2.lastInvalidationTime = performanceNow(); + if (eles.length === 0 || !self2.haveLayers()) { + return; } - depths.unshift(orphanDepth); - assignDepths(); - var biggestDepthSize = 0; - for (var _i8 = 0; _i8 < depths.length; _i8++) { - biggestDepthSize = Math.max(depths[_i8].length, biggestDepthSize); + self2.updateElementsInLayers(eles, /* @__PURE__ */ __name(function invalAssocLayers(layer, ele, req) { + self2.invalidateLayer(layer); + }, "invalAssocLayers")); + }; + LTCp.invalidateLayer = function(layer) { + this.lastInvalidationTime = performanceNow(); + if (layer.invalid) { + return; } - var center2 = { - 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); - }, 0); - var getPosition = function getPosition2(ele2) { - var _getInfo2 = getInfo2(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 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) { - var epos = { - x: center2.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 * index; - if (depth === 0 && depths[0].length === 1) { - radius = 1; + var lvl = layer.level; + var eles = layer.eles; + var layers = this.layersByLevel[lvl]; + removeFromArray(layers, layer); + layer.elesQueue = []; + layer.invalid = true; + if (layer.replacement) { + layer.replacement.invalid = true; + } + for (var i2 = 0; i2 < eles.length; i2++) { + var caches = eles[i2]._private.rscratch.imgLayerCaches; + if (caches) { + caches[lvl] = null; + } + } + }; + LTCp.refineElementTextures = function(eles) { + var self2 = this; + 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); + rLyr.replaces = layer; + rLyr.eles = layer.eles; + } + if (!rLyr.reqs) { + for (var i2 = 0; i2 < rLyr.eles.length; i2++) { + self2.queueLayer(rLyr, rLyr.eles[i2]); } - return { - x: center2.x + radius * Math.cos(theta), - y: center2.y + radius * Math.sin(theta) - }; } - }; - eles.nodes().layoutPositions(this, options2, getPosition); - return this; + }, "refineEachEle")); }; - var defaults$6 = { - fit: true, - // whether to fit the viewport to the graph - padding: 30, - // the padding on fit - boundingBox: void 0, - // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - avoidOverlap: true, - // prevents node overlap, may overflow boundingBox and radius if not enough space - nodeDimensionsIncludeLabels: false, - // Excludes the label when calculating node bounding boxes for the layout algorithm - spacingFactor: void 0, - // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up - radius: void 0, - // the radius of the circle - startAngle: 3 / 2 * Math.PI, - // where nodes start in radians - sweep: void 0, - // how many radians should be between the first and last node (defaults to full circle) - clockwise: true, - // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) - sort: void 0, - // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } - 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) { - return true; - }, - // 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 a given node position. Useful for changing flow direction in discrete layouts + LTCp.enqueueElementRefinement = function(ele) { + this.eleTxrDeqs.merge(ele); + this.scheduleElementRefinement(); }; - function CircleLayout(options2) { - this.options = extend2({}, defaults$6, options2); - } - CircleLayout.prototype.run = function() { - var params = this.options; - var options2 = 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); + LTCp.queueLayer = function(layer, ele) { + var self2 = this; + var q2 = self2.layersQueue; + var elesQ = layer.elesQueue; + var hasId = elesQ.hasId = elesQ.hasId || {}; + if (layer.replacement) { + return; } - var bb = makeBoundingBox(options2.boundingBox ? options2.boundingBox : { - x1: 0, - y1: 0, - w: cy.width(), - h: cy.height() - }); - var center2 = { - 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 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; + if (ele) { + if (hasId[ele.id()]) { + return; + } + elesQ.push(ele); + hasId[ele.id()] = true; + } + if (layer.reqs) { + layer.reqs++; + q2.updateItem(layer); } else { - r = Math.min(bb.h, bb.w) / 2 - minDistance; + layer.reqs = 1; + q2.push(layer); } - if (nodes2.length > 1 && options2.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); + }; + LTCp.dequeue = function(pxRatio) { + var self2 = this; + var q2 = self2.layersQueue; + var deqd = []; + var eleDeqs = 0; + while (eleDeqs < maxDeqSize) { + if (q2.size() === 0) { + break; + } + var layer = q2.peek(); + if (layer.replacement) { + q2.pop(); + continue; + } + if (layer.replaces && layer !== layer.replaces.replacement) { + q2.pop(); + continue; + } + if (layer.invalid) { + q2.pop(); + continue; + } + var ele = layer.elesQueue.shift(); + if (ele) { + self2.drawEleInLayer(layer, ele, layer.level, pxRatio); + eleDeqs++; + } + if (deqd.length === 0) { + deqd.push(true); + } + if (layer.elesQueue.length === 0) { + q2.pop(); + layer.reqs = 0; + if (layer.replaces) { + self2.applyLayerReplacement(layer); + } + self2.requestRedraw(); + } } - 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 pos = { - x: center2.x + rx, - y: center2.y + ry - }; - return pos; - }; - eles.nodes().layoutPositions(this, options2, getPos); - return this; + return deqd; }; - var defaults$5 = { - fit: true, - // whether to fit the viewport to the graph - padding: 30, - // the padding on fit - startAngle: 3 / 2 * Math.PI, - // where nodes start in radians - sweep: void 0, - // how many radians should be between the first and last node (defaults to full circle) - clockwise: true, - // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) - equidistant: false, - // whether levels have an equal radial distance betwen them, may cause bounding box overflow - minNodeSpacing: 10, - // min spacing between outside of nodes (used for radius adjustment) - boundingBox: void 0, - // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - avoidOverlap: true, - // prevents node overlap, may overflow boundingBox if not enough space - nodeDimensionsIncludeLabels: false, - // Excludes the label when calculating node bounding boxes for the layout algorithm - height: void 0, - // height of layout area (overrides container height) - width: void 0, - // 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) { - return node2.degree(); - }, - levelWidth: function levelWidth(nodes2) { - return nodes2.maxDegree() / 4; - }, - 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) { - return true; - }, - // 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; + LTCp.applyLayerReplacement = function(layer) { + var self2 = this; + var layersInLevel = self2.layersByLevel[layer.level]; + var replaced = layer.replaces; + var index = layersInLevel.indexOf(replaced); + if (index < 0 || replaced.invalid) { + return; } - // transform a given node position. Useful for changing flow direction in discrete layouts + 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(); }; - function ConcentricLayout(options2) { - this.options = extend2({}, defaults$5, options2); - } - ConcentricLayout.prototype.run = function() { - var params = this.options; - var options2 = params; - var clockwise = options2.counterclockwise !== void 0 ? !options2.counterclockwise : options2.clockwise; - var cy = params.cy; - var eles = options2.eles; - var nodes2 = eles.nodes().not(":parent"); - var bb = makeBoundingBox(options2.boundingBox ? options2.boundingBox : { - x1: 0, - y1: 0, - w: cy.width(), - h: cy.height() - }); - var center2 = { - 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]; - var value = void 0; - value = options2.concentric(node2); - nodeValues.push({ - value, - node: node2 - }); - node2._private.scratch.concentric = value; + LTCp.requestRedraw = debounce_1(function() { + var r2 = this.renderer; + r2.redrawHint("eles", true); + r2.redrawHint("drag", true); + r2.redraw(); + }, 100); + LTCp.setupDequeueing = defs.setupDequeueing({ + deqRedrawThreshold, + deqCost, + deqAvgCost, + deqNoDrawCost, + deqFastCost, + deq: /* @__PURE__ */ __name(function deq2(self2, pxRatio) { + return self2.dequeue(pxRatio); + }, "deq"), + onDeqd: noop$1, + shouldRedraw: trueify, + priority: /* @__PURE__ */ __name(function priority2(self2) { + return self2.renderer.beforeRenderPriorities.lyrTxrDeq; + }, "priority") + }); + 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, + "triangle-backcurve": triangleBackcurve, + "triangle-tee": triangleTee, + "circle-triangle": circleTriangle, + "triangle-cross": triangleTee, + "circle": circle5 + }))[name]; + }; + CRp$9 = {}; + CRp$9.drawElement = function(context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity) { + var r2 = this; + if (ele.isNode()) { + r2.drawNode(context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity); + } else { + r2.drawEdge(context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity); } - nodes2.updateStyle(); - for (var _i = 0; _i < nodes2.length; _i++) { - var _node = nodes2[_i]; - var nbb = _node.layoutDimensions(options2); - maxNodeSize = Math.max(maxNodeSize, nbb.w, nbb.h); + }; + CRp$9.drawElementOverlay = function(context, ele) { + var r2 = this; + if (ele.isNode()) { + r2.drawNodeOverlay(context, ele); + } else { + r2.drawEdgeOverlay(context, ele); } - nodeValues.sort(function(a, b) { - return b.value - a.value; - }); - var levelWidth = options2.levelWidth(nodes2); - var levels = [[]]; - var currentLevel = levels[0]; - 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) { - currentLevel = []; - levels.push(currentLevel); - } - } - currentLevel.push(val); + }; + CRp$9.drawElementUnderlay = function(context, ele) { + var r2 = this; + if (ele.isNode()) { + r2.drawNodeUnderlay(context, ele); + } else { + r2.drawEdgeUnderlay(context, ele); } - var minDist = maxNodeSize + options2.minNodeSpacing; - if (!options2.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); + }; + 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 r = 0; - for (var _i3 = 0; _i3 < levels.length; _i3++) { - var level = levels[_i3]; - var sweep = options2.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / level.length : options2.sweep; - var dTheta = level.dTheta = sweep / Math.max(1, level.length - 1); - if (level.length > 1 && options2.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); + var eleCache = eleTxrCache.getElement(ele, bb, pxRatio, lvl, reason); + if (eleCache != null) { + var opacity = getOpacity3(r2, ele); + if (opacity === 0) { + return; } - level.r = r; - r += minDist; - } - if (options2.equidistant) { - var rDeltaMax = 0; - var _r = 0; - for (var _i4 = 0; _i4 < levels.length; _i4++) { - var _level = levels[_i4]; - var rDelta = _level.r - _r; - rDeltaMax = Math.max(rDeltaMax, rDelta); + 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 = r2.getImgSmoothing(context); + if (!smooth) { + r2.setImgSmoothing(context, true); + } + var off = eleTxrCache.getRotationOffset(ele); + x5 = off.x; + y5 = off.y; + } else { + x5 = x1; + y5 = y1; } - _r = 0; - for (var _i5 = 0; _i5 < levels.length; _i5++) { - var _level2 = levels[_i5]; - if (_i5 === 0) { - _r = _level2.r; + var oldGlobalAlpha; + if (opacity !== 1) { + oldGlobalAlpha = context.globalAlpha; + context.globalAlpha = oldGlobalAlpha * opacity; + } + context.drawImage(eleCache.texture.canvas, eleCache.x, 0, eleCache.width, eleCache.height, x5, y5, w3, h2); + if (opacity !== 1) { + context.globalAlpha = oldGlobalAlpha; + } + if (theta !== 0) { + context.rotate(-theta); + context.translate(-sx, -sy); + if (!smooth) { + r2.setImgSmoothing(context, false); } - _level2.r = _r; - _r += rDeltaMax; } + } else { + eleTxrCache.drawElement(context, ele); } - var pos = {}; - 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) - }; - pos[_val.node.id()] = p2; + }; + getZeroRotation = /* @__PURE__ */ __name(function getZeroRotation2() { + return 0; + }, "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(); + }, "getOpacity"); + getTextOpacity = /* @__PURE__ */ __name(function getTextOpacity2(e3, ele) { + return ele.pstyle("text-opacity").pfValue * ele.effectiveOpacity(); + }, "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 (!extent2 || boundingBoxesIntersect(bb, extent2)) { + var isEdge2 = ele.isEdge(); + var badLine = ele.element()._private.rscratch.badLine; + 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 (isEdge2 && !badLine) { + r2.drawCachedElementPortion(context, ele, slbTxrCache, pxRatio, lvl, reason, getSourceLabelRotation, getTextOpacity); + r2.drawCachedElementPortion(context, ele, tlbTxrCache, pxRatio, lvl, reason, getTargetLabelRotation, getTextOpacity); + } + r2.drawElementOverlay(context, ele); } - eles.nodes().layoutPositions(this, options2, function(ele) { - var id2 = ele.id(); - return pos[id2]; - }); - return this; }; - var DEBUG; - var defaults$4 = { - // Called on `layoutready` - ready: function ready() { - }, - // Called on `layoutstop` - stop: function stop() { - }, - // Whether to animate while running the layout - // true : Animate continuously as the layout is running - // false : Just show the end result - // 'end' : Animate with the end result, from the initial positions to the end positions - animate: true, - // Easing of the animation for animate:'end' - animationEasing: void 0, - // The duration of the animation for animate:'end' - animationDuration: void 0, - // 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) { - return true; - }, - // The layout animates only after this many milliseconds for animate:true - // (prevents flashing on fast runs) - animationThreshold: 250, - // Number of iterations between consecutive screen positions update - refresh: 20, - // Whether to fit the network view after when done - fit: true, - // Padding on fit - padding: 30, - // Constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - boundingBox: void 0, - // Excludes the label when calculating node bounding boxes for the layout algorithm - nodeDimensionsIncludeLabels: false, - // Randomize the initial positions of the nodes (true) or use existing positions (false) - randomize: false, - // Extra spacing between components in non-compound graphs - componentSpacing: 40, - // Node repulsion (non overlapping) multiplier - nodeRepulsion: function nodeRepulsion2(node2) { - return 2048; - }, - // Node repulsion (overlapping) multiplier - nodeOverlap: 4, - // Ideal edge (non nested) length - idealEdgeLength: function idealEdgeLength(edge) { - return 32; - }, - // Divisor to compute edge forces - edgeElasticity: function edgeElasticity(edge) { - return 32; - }, - // Nesting factor (multiplier) to compute ideal edge length for nested edges - nestingFactor: 1.2, - // Gravity force (constant) - gravity: 1, - // Maximum number of iterations to perform - numIter: 1e3, - // Initial temperature (maximum node displacement) - initialTemp: 1e3, - // Cooling factor (how the temperature is reduced between consecutive iterations - coolingFactor: 0.99, - // Lower temperature threshold (below this point the layout will end) - minTemp: 1 + CRp$9.drawElements = function(context, eles) { + var r2 = this; + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + r2.drawElement(context, ele); + } }; - function CoseLayout(options2) { - this.options = extend2({}, defaults$4, options2); - this.options.layout = this; - } - 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({ - type: "layoutstart", - layout: layout3 - }); + 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); } - if (true === options2.debug) { - DEBUG = true; + }; + 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; + } + r2.drawCachedElement(context, ele, pxRatio, extent2); + } + }; + CRp$9.drawLayeredElements = function(context, eles, pxRatio, extent2) { + var r2 = this; + var layers = r2.data.lyrTxrCache.getLayers(eles, pxRatio); + if (layers) { + for (var i2 = 0; i2 < layers.length; i2++) { + var layer = layers[i2]; + var bb = layer.bb; + if (bb.w === 0 || bb.h === 0) { + continue; + } + context.drawImage(layer.canvas, bb.x1, bb.y1, bb.w, bb.h); + } } else { - DEBUG = false; + r2.drawCachedElements(context, eles, pxRatio, extent2); } - var layoutInfo = createLayoutInfo(cy, layout3, options2); - if (DEBUG) { - printLayoutInfo(layoutInfo); + }; + CRp$8 = {}; + CRp$8.drawEdge = function(context, edge, shiftToOriginWithBb) { + 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 r2 = this; + var rs = edge._private.rscratch; + if (shouldDrawOpacity && !edge.visible()) { + return; } - if (options2.randomize) { - randomizePositions(layoutInfo); + if (rs.badLine || rs.allpts == null || isNaN(rs.allpts[0])) { + return; } - var startTime = performanceNow(); - var refresh = function refresh2() { - refreshPositions(layoutInfo, cy, options2); - if (true === options2.fit) { - cy.fit(options2.padding); + var bb; + if (shiftToOriginWithBb) { + bb = shiftToOriginWithBb; + context.translate(-bb.x1, -bb.y1); + } + var opacity = shouldDrawOpacity ? edge.pstyle("opacity").value : 1; + var lineOpacity = shouldDrawOpacity ? edge.pstyle("line-opacity").value : 1; + var curveStyle = edge.pstyle("curve-style").value; + 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 = /* @__PURE__ */ __name(function drawLine2() { + var strokeOpacity = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : effectiveLineOpacity; + if (curveStyle === "straight-triangle") { + r2.eleStrokeStyle(context, edge, strokeOpacity); + r2.drawEdgeTrianglePath(edge, context, rs.allpts); + } else { + context.lineWidth = edgeWidth; + context.lineCap = lineCap; + r2.eleStrokeStyle(context, edge, strokeOpacity); + r2.drawEdgePath(edge, context, rs.allpts, lineStyle); + context.lineCap = "butt"; } - }; - var mainLoop = function mainLoop2(i4) { - if (layout3.stopped || i4 >= options2.numIter) { - return false; + }, "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; } - step(layoutInfo, options2); - layoutInfo.temperature = layoutInfo.temperature * options2.coolingFactor; - if (layoutInfo.temperature < options2.minTemp) { - return false; + if (curveStyle === "straight-triangle") { + r2.drawEdgeTrianglePath(edge, context, rs.allpts); + } else { + r2.drawEdgePath(edge, context, rs.allpts, lineStyle); + context.lineCap = "butt"; } - return true; - }; - var done = function done2() { - if (options2.animate === true || options2.animate === false) { - refresh(); - layout3.one("layoutstop", options2.stop); - layout3.emit({ - type: "layoutstop", - layout: layout3 - }); + }, "drawLineOutline"); + var drawOverlay = /* @__PURE__ */ __name(function drawOverlay2() { + if (!shouldDrawOverlay) { + return; + } + r2.drawEdgeOverlay(context, edge); + }, "drawOverlay"); + var drawUnderlay = /* @__PURE__ */ __name(function drawUnderlay2() { + if (!shouldDrawOverlay) { + return; + } + r2.drawEdgeUnderlay(context, edge); + }, "drawUnderlay"); + var drawArrows2 = /* @__PURE__ */ __name(function drawArrows3() { + var arrowOpacity = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : effectiveArrowOpacity; + 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) { + var gx = edge.pstyle("ghost-offset-x").pfValue; + var gy = edge.pstyle("ghost-offset-y").pfValue; + var ghostOpacity = edge.pstyle("ghost-opacity").value; + var effectiveGhostOpacity = effectiveLineOpacity * ghostOpacity; + context.translate(gx, gy); + drawLine(effectiveGhostOpacity); + drawArrows2(effectiveGhostOpacity); + context.translate(-gx, -gy); + } else { + drawLineOutline(); + } + drawUnderlay(); + drawLine(); + drawArrows2(); + drawOverlay(); + drawText6(); + if (shiftToOriginWithBb) { + context.translate(bb.x1, bb.y1); + } + }; + drawEdgeOverlayUnderlay = /* @__PURE__ */ __name(function drawEdgeOverlayUnderlay2(overlayOrUnderlay) { + if (!["overlay", "underlay"].includes(overlayOrUnderlay)) { + throw new Error("Invalid state"); + } + return function(context, edge) { + if (!edge.visible()) { + return; + } + var opacity = edge.pstyle("".concat(overlayOrUnderlay, "-opacity")).value; + if (opacity === 0) { + return; + } + var r2 = this; + var usePaths = r2.usePaths(); + var rs = edge._private.rscratch; + var padding3 = edge.pstyle("".concat(overlayOrUnderlay, "-padding")).pfValue; + var width3 = 2 * padding3; + var color2 = edge.pstyle("".concat(overlayOrUnderlay, "-color")).value; + context.lineWidth = width3; + if (rs.edgeType === "self" && !usePaths) { + context.lineCap = "butt"; } else { - var nodes2 = options2.eles.nodes(); - var getScaledPos = getScaleInBoundsFn(layoutInfo, options2, nodes2); - nodes2.layoutPositions(layout3, options2, getScaledPos); + context.lineCap = "round"; } + r2.colorStrokeStyle(context, color2[0], color2[1], color2[2], opacity); + r2.drawEdgePath(edge, context, rs.allpts, "solid"); }; - var i3 = 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 (!loopRet) { - separateComponents(layoutInfo, options2); - done(); - } else { - var now3 = performanceNow(); - if (now3 - startTime >= options2.animationThreshold) { - refresh(); + }, "drawEdgeOverlayUnderlay"); + CRp$8.drawEdgeOverlay = drawEdgeOverlayUnderlay("overlay"); + CRp$8.drawEdgeUnderlay = drawEdgeOverlayUnderlay("underlay"); + CRp$8.drawEdgePath = function(edge, context, pts2, type3) { + var rs = edge._private.rscratch; + var canvasCxt = context; + var path4; + var pathCacheHit = false; + var usePaths = this.usePaths(); + var lineDashPattern = edge.pstyle("line-dash-pattern").pfValue; + var lineDashOffset = edge.pstyle("line-dash-offset").pfValue; + if (usePaths) { + var pathCacheKey = pts2.join("$"); + var keyMatches = rs.pathCacheKey && rs.pathCacheKey === pathCacheKey; + if (keyMatches) { + path4 = context = rs.pathCache; + pathCacheHit = true; + } else { + path4 = context = new Path2D(); + rs.pathCacheKey = pathCacheKey; + rs.pathCache = path4; + } + } + if (canvasCxt.setLineDash) { + switch (type3) { + case "dotted": + canvasCxt.setLineDash([1, 1]); + break; + case "dashed": + canvasCxt.setLineDash(lineDashPattern); + canvasCxt.lineDashOffset = lineDashOffset; + break; + case "solid": + canvasCxt.setLineDash([]); + break; + } + } + if (!pathCacheHit && !rs.badLine) { + if (context.beginPath) { + context.beginPath(); + } + context.moveTo(pts2[0], pts2[1]); + switch (rs.edgeType) { + case "bezier": + case "self": + case "compound": + case "multibezier": + for (var i2 = 2; i2 + 3 < pts2.length; i2 += 4) { + context.quadraticCurveTo(pts2[i2], pts2[i2 + 1], pts2[i2 + 2], pts2[i2 + 3]); } - requestAnimationFrame2(frame3); - } - }; - frame2(); - } else { - while (loopRet) { - loopRet = mainLoop(i3); - i3++; + break; + case "straight": + case "haystack": + 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; } - separateComponents(layoutInfo, options2); - done(); } - return this; + context = canvasCxt; + if (usePaths) { + context.stroke(path4); + } else { + context.stroke(); + } + if (context.setLineDash) { + context.setLineDash([]); + } }; - CoseLayout.prototype.stop = function() { - this.stopped = true; - if (this.thread) { - this.thread.stop(); + CRp$8.drawEdgeTrianglePath = function(edge, context, pts2) { + context.fillStyle = context.strokeStyle; + var edgeWidth = edge.pstyle("width").pfValue; + 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 normal = [vector[1] / length2, -vector[0] / length2]; + var triangleHead = [normal[0] * edgeWidth / 2, normal[1] * edgeWidth / 2]; + context.beginPath(); + 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(); } - this.emit("layoutstop"); - return this; }; - CoseLayout.prototype.destroy = function() { - if (this.thread) { - this.thread.stop(); + CRp$8.drawArrowheads = function(context, edge, opacity) { + var rs = edge._private.rscratch; + var isHaystack = rs.edgeType === "haystack"; + if (!isHaystack) { + this.drawArrowhead(context, edge, "source", rs.arrowStartX, rs.arrowStartY, rs.srcArrowAngle, opacity); + } + this.drawArrowhead(context, edge, "mid-target", rs.midX, rs.midY, rs.midtgtArrowAngle, opacity); + this.drawArrowhead(context, edge, "mid-source", rs.midX, rs.midY, rs.midsrcArrowAngle, opacity); + if (!isHaystack) { + this.drawArrowhead(context, edge, "target", rs.arrowEndX, rs.arrowEndY, rs.tgtArrowAngle, opacity); } - return this; }; - var createLayoutInfo = function createLayoutInfo2(cy, layout3, options2) { - var edges2 = options2.eles.edges(); - var nodes2 = options2.eles.nodes(); - var layoutInfo = { - isCompound: cy.hasCompoundNodes(), - layoutNodes: [], - idToIndex: {}, - nodeSize: nodes2.size(), - graphSet: [], - indexToGraph: [], - layoutEdges: [], - edgeSize: edges2.size(), - temperature: options2.initialTemp, - clientWidth: cy.width(), - clientHeight: cy.width(), - boundingBox: makeBoundingBox(options2.boundingBox ? options2.boundingBox : { - x1: 0, - y1: 0, - w: cy.width(), - h: cy.height() - }) - }; - var components = options2.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; - } + 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; } - for (var i3 = 0; i3 < layoutInfo.nodeSize; i3++) { - var n = nodes2[i3]; - var nbb = n.layoutDimensions(options2); - var tempNode = {}; - tempNode.isLocked = n.locked(); - tempNode.id = n.data("id"); - tempNode.parentId = n.data("parent"); - tempNode.cmptId = id2cmptId[n.id()]; - tempNode.children = []; - tempNode.positionX = n.position("x"); - tempNode.positionY = n.position("y"); - tempNode.offsetX = 0; - tempNode.offsetY = 0; - tempNode.height = nbb.w; - tempNode.width = nbb.h; - tempNode.maxX = tempNode.positionX + tempNode.width / 2; - 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; - layoutInfo.layoutNodes.push(tempNode); - layoutInfo.idToIndex[tempNode.id] = i3; + var self2 = this; + var arrowShape = edge.pstyle(prefix + "-arrow-shape").value; + if (arrowShape === "none") { + return; } - var queue = []; - var start2 = 0; - var end2 = -1; - var tempGraph = []; - for (var i3 = 0; i3 < layoutInfo.nodeSize; i3++) { - var n = layoutInfo.layoutNodes[i3]; - var p_id = n.parentId; - if (null != p_id) { - layoutInfo.layoutNodes[layoutInfo.idToIndex[p_id]].children.push(n.id); + var arrowClearFill = edge.pstyle(prefix + "-arrow-fill").value === "hollow" ? "both" : "filled"; + var arrowFill = edge.pstyle(prefix + "-arrow-fill").value; + 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; + var edgeOpacity = edge.pstyle("opacity").value; + if (opacity === void 0) { + opacity = edgeOpacity; + } + var gco = context.globalCompositeOperation; + if (opacity !== 1 || arrowFill === "hollow") { + 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, 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, x5, y5, angle2); + }; + 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 path4; + var canvasContext = context; + var translation = { + x: x5, + y: y5 + }; + var scale = edge.pstyle("arrow-scale").value; + var size5 = this.getArrowWidth(edgeWidth, scale); + var shapeImpl = r2.arrowShapes[shape]; + if (usePaths) { + var cache3 = r2.arrowPathCache = r2.arrowPathCache || []; + var key = hashString(shape); + var cachedPath = cache3[key]; + if (cachedPath != null) { + path4 = context = cachedPath; + pathCacheHit = true; } else { - queue[++end2] = n.id; - tempGraph.push(n.id); + path4 = context = new Path2D(); + cache3[key] = path4; } } - layoutInfo.graphSet.push(tempGraph); - while (start2 <= end2) { - var node_id = queue[start2++]; - 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]; - } + if (!pathCacheHit) { + if (context.beginPath) { + context.beginPath(); } - } - for (var i3 = 0; i3 < layoutInfo.graphSet.length; i3++) { - var graph = layoutInfo.graphSet[i3]; - for (var j = 0; j < graph.length; j++) { - var index = layoutInfo.idToIndex[graph[j]]; - layoutInfo.indexToGraph[index] = i3; + if (usePaths) { + shapeImpl.draw(context, 1, 0, { + x: 0, + y: 0 + }, 1); + } else { + shapeImpl.draw(context, size5, angle2, translation, edgeWidth); } - } - for (var i3 = 0; i3 < layoutInfo.edgeSize; i3++) { - var e = edges2[i3]; - 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; - var sourceIx = layoutInfo.idToIndex[tempEdge.sourceId]; - var targetIx = layoutInfo.idToIndex[tempEdge.targetId]; - var sourceGraph = layoutInfo.indexToGraph[sourceIx]; - var targetGraph = layoutInfo.indexToGraph[targetIx]; - if (sourceGraph != targetGraph) { - var lca = findLCA(tempEdge.sourceId, tempEdge.targetId, layoutInfo); - var lcaGraph = layoutInfo.graphSet[lca]; - var depth = 0; - var tempNode = layoutInfo.layoutNodes[sourceIx]; - while (-1 === lcaGraph.indexOf(tempNode.id)) { - tempNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[tempNode.parentId]]; - depth++; - } - tempNode = layoutInfo.layoutNodes[targetIx]; - while (-1 === lcaGraph.indexOf(tempNode.id)) { - tempNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[tempNode.parentId]]; - depth++; - } - idealLength *= depth * options2.nestingFactor; + if (context.closePath) { + context.closePath(); } - tempEdge.idealLength = idealLength; - tempEdge.elasticity = elasticity; - layoutInfo.layoutEdges.push(tempEdge); - } - return layoutInfo; - }; - var findLCA = 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) { - var graph = layoutInfo.graphSet[graphIx]; - if (-1 < graph.indexOf(node1) && -1 < graph.indexOf(node2)) { - return { - count: 2, - graph: graphIx - }; + context = canvasContext; + if (usePaths) { + context.translate(x5, y5); + context.rotate(angle2); + context.scale(size5, size5); } - var c2 = 0; - for (var i3 = 0; i3 < graph.length; i3++) { - var nodeId = graph[i3]; - var nodeIx = layoutInfo.idToIndex[nodeId]; - var children2 = layoutInfo.layoutNodes[nodeIx].children; - if (0 === children2.length) { - continue; + if (fill === "filled" || fill === "both") { + if (usePaths) { + context.fill(path4); + } else { + context.fill(); } - var childGraphIx = layoutInfo.indexToGraph[layoutInfo.idToIndex[children2[0]]]; - var result = findLCA_aux2(node1, node2, childGraphIx, layoutInfo); - if (0 === result.count) { - continue; - } else if (1 === result.count) { - c2++; - if (2 === c2) { - break; - } + } + if (fill === "hollow" || fill === "both") { + context.lineWidth = shapeWidth / (usePaths ? size5 : 1); + context.lineJoin = "miter"; + if (usePaths) { + context.stroke(path4); } else { - return result; + context.stroke(); } } - return { - count: c2, - graph: graphIx - }; + if (usePaths) { + context.scale(1 / size5, 1 / size5); + context.rotate(-angle2); + context.translate(-x5, -y5); + } }; - var printLayoutInfo; - var randomizePositions = function randomizePositions2(layoutInfo, cy) { - var width2 = layoutInfo.clientWidth; - var height2 = 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() * height2; - } + 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, x5, y5, w3, h2); + } catch (e3) { + warn(e3); } }; - var getScaleInBoundsFn = function getScaleInBoundsFn2(layoutInfo, options2, nodes2) { - var bb = layoutInfo.boundingBox; - var coseBB = { - x1: Infinity, - x2: -Infinity, - y1: Infinity, - y2: -Infinity - }; - if (options2.boundingBox) { - nodes2.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); - coseBB.y1 = Math.min(coseBB.y1, lnode.positionY); - coseBB.y2 = Math.max(coseBB.y2, lnode.positionY); - }); - coseBB.w = coseBB.x2 - coseBB.x1; - coseBB.h = coseBB.y2 - coseBB.y1; + 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 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", 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", index); + var shouldClip = clip === "node"; + 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) { + document.body.appendChild(img); + imgW = img.cachedW = img.width || img.offsetWidth; + imgH = img.cachedH = img.height || img.offsetHeight; + document.body.removeChild(img); } - return function(ele, i3) { - var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[ele.data("id")]]; - if (options2.boundingBox) { - var pctX = (lnode.positionX - coseBB.x1) / coseBB.w; - var pctY = (lnode.positionY - coseBB.y1) / coseBB.h; - return { - x: bb.x1 + pctX * bb.w, - y: bb.y1 + pctY * bb.h - }; + 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 { - return { - x: lnode.positionX, - y: lnode.positionY - }; + w3 = getIndexedStyle(node2, "background-width", "pfValue", index); } - }; - }; - 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); - if (true !== layoutInfo.ready) { - layoutInfo.ready = true; - layout3.one("layoutready", options2.ready); - layout3.emit({ - type: "layoutready", - layout: this - }); } - }; - var step = function step2(layoutInfo, options2, _step) { - calculateNodeForces(layoutInfo, options2); - calculateEdgeForces(layoutInfo); - calculateGravityForces(layoutInfo, options2); - propagateForces(layoutInfo); - updatePositions(layoutInfo); - }; - var calculateNodeForces = function calculateNodeForces2(layoutInfo, options2) { - for (var i3 = 0; i3 < layoutInfo.graphSet.length; i3++) { - var graph = layoutInfo.graphSet[i3]; - 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); - } + if (getIndexedStyle(node2, "background-height", "value", index) !== "auto") { + if (getIndexedStyle(node2, "background-height", "units", index) === "%") { + h2 = getIndexedStyle(node2, "background-height", "pfValue", index) * nodeTH; + } else { + h2 = getIndexedStyle(node2, "background-height", "pfValue", index); } } - }; - var randomDistance = function randomDistance2(max3) { - return -max3 + 2 * max3 * Math.random(); - }; - var nodeRepulsion = function nodeRepulsion2(node1, node2, layoutInfo, options2) { - var cmptId1 = node1.cmptId; - var cmptId2 = node2.cmptId; - if (cmptId1 !== cmptId2 && !layoutInfo.isCompound) { + if (w3 === 0 || h2 === 0) { return; } - var directionX = node2.positionX - node1.positionX; - var directionY = node2.positionY - node1.positionY; - var maxRandDist = 1; - if (0 === directionX && 0 === directionY) { - directionX = randomDistance(maxRandDist); - directionY = randomDistance(maxRandDist); + 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 overlap = nodesOverlap(node1, node2, directionX, directionY); - if (overlap > 0) { - var force = options2.nodeOverlap * overlap; - var distance2 = Math.sqrt(directionX * directionX + directionY * directionY); - var forceX = force * directionX / distance2; - var forceY = force * directionY / distance2; + 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 === "%") { + x5 += (nodeTW - w3) * posXPfVal; } 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 distanceSqr = distanceX * distanceX + distanceY * distanceY; - var distance2 = Math.sqrt(distanceSqr); - var force = (node1.nodeRepulsion + node2.nodeRepulsion) / distanceSqr; - var forceX = force * distanceX / distance2; - var forceY = force * distanceY / distance2; - } - if (!node1.isLocked) { - node1.offsetX -= forceX; - node1.offsetY -= forceY; - } - if (!node2.isLocked) { - node2.offsetX += forceX; - node2.offsetY += forceY; + x5 += posXPfVal; } - return; - }; - var nodesOverlap = function nodesOverlap2(node1, node2, dX, dY) { - if (dX > 0) { - var overlapX = node1.maxX - node2.minX; + var offXUnits = getIndexedStyle(node2, "background-offset-x", "units", index); + var offXPfVal = getIndexedStyle(node2, "background-offset-x", "pfValue", index); + if (offXUnits === "%") { + x5 += (nodeTW - w3) * offXPfVal; } else { - var overlapX = node2.maxX - node1.minX; + x5 += offXPfVal; } - if (dY > 0) { - var overlapY = node1.maxY - node2.minY; + 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 === "%") { + y5 += (nodeTH - h2) * posYPfVal; } else { - var overlapY = node2.maxY - node1.minY; + y5 += posYPfVal; } - if (overlapX >= 0 && overlapY >= 0) { - return Math.sqrt(overlapX * overlapX + overlapY * overlapY); + var offYUnits = getIndexedStyle(node2, "background-offset-y", "units", index); + var offYPfVal = getIndexedStyle(node2, "background-offset-y", "pfValue", index); + if (offYUnits === "%") { + y5 += (nodeTH - h2) * offYPfVal; } else { - return 0; + y5 += offYPfVal; } - }; - var findClippingPoint = function findClippingPoint2(node2, dX, dY) { - var X = node2.positionX; - var Y2 = node2.positionY; - var H2 = node2.height || 1; - var W2 = node2.width || 1; - var dirSlope = dY / dX; - var nodeSlope = H2 / W2; - var res = {}; - if (0 === dX && 0 < dY) { - res.x = X; - res.y = Y2 + H2 / 2; - return res; + if (rs.pathCache) { + x5 -= nodeX; + y5 -= nodeY; + nodeX = 0; + nodeY = 0; } - if (0 === dX && 0 > dY) { - res.x = X; - res.y = Y2 + H2 / 2; - return res; + var gAlpha = context.globalAlpha; + context.globalAlpha = imgOpacity; + var smoothingEnabled = r2.getImgSmoothing(context); + var isSmoothingSwitched = false; + if (smooth === "no" && smoothingEnabled) { + r2.setImgSmoothing(context, false); + isSmoothingSwitched = true; + } else if (smooth === "yes" && !smoothingEnabled) { + r2.setImgSmoothing(context, true); + isSmoothingSwitched = true; } - if (0 < dX && -1 * nodeSlope <= dirSlope && dirSlope <= nodeSlope) { - res.x = X + W2 / 2; - res.y = Y2 + W2 * dY / 2 / dX; - return res; + if (repeat2 === "no-repeat") { + if (shouldClip) { + context.save(); + if (rs.pathCache) { + context.clip(rs.pathCache); + } else { + r2.nodeShapes[r2.getNodeShape(node2)].draw(context, nodeX, nodeY, nodeTW, nodeTH, cornerRadius, rs); + context.clip(); + } + } + 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; + r2.nodeShapes[r2.getNodeShape(node2)].draw(context, nodeX, nodeY, nodeTW, nodeTH, cornerRadius, rs); + context.translate(x5, y5); + context.fill(); + context.translate(-x5, -y5); } - if (0 > dX && -1 * nodeSlope <= dirSlope && dirSlope <= nodeSlope) { - res.x = X - W2 / 2; - res.y = Y2 - W2 * dY / 2 / dX; - return res; + context.globalAlpha = gAlpha; + if (isSmoothingSwitched) { + r2.setImgSmoothing(context, smoothingEnabled); } - if (0 < dY && (dirSlope <= -1 * nodeSlope || dirSlope >= nodeSlope)) { - res.x = X + H2 * dX / 2 / dY; - res.y = Y2 + H2 / 2; - return res; + }; + CRp$6 = {}; + CRp$6.eleTextBiggerThanMin = function(ele, scale) { + if (!scale) { + var zoom2 = ele.cy().zoom(); + var pxRatio = this.getPixelRatio(); + var lvl = Math.ceil(log22(zoom2 * pxRatio)); + scale = Math.pow(2, lvl); } - if (0 > dY && (dirSlope <= -1 * nodeSlope || dirSlope >= nodeSlope)) { - res.x = X - H2 * dX / 2 / dY; - res.y = Y2 - H2 / 2; - return res; + var computedSize = ele.pstyle("font-size").pfValue * scale; + var minSize = ele.pstyle("min-zoomed-font-size").pfValue; + if (computedSize < minSize) { + return false; } - return res; + return true; }; - var calculateEdgeForces = function calculateEdgeForces2(layoutInfo, options2) { - for (var i3 = 0; i3 < layoutInfo.edgeSize; i3++) { - var edge = layoutInfo.layoutEdges[i3]; - var sourceIx = layoutInfo.idToIndex[edge.sourceId]; - var source = layoutInfo.layoutNodes[sourceIx]; - var targetIx = layoutInfo.idToIndex[edge.targetId]; - var target = layoutInfo.layoutNodes[targetIx]; - var directionX = target.positionX - source.positionX; - var directionY = target.positionY - source.positionY; - if (0 === directionX && 0 === directionY) { - 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; - } else { - var forceX = 0; - var forceY = 0; - } - if (!source.isLocked) { - source.offsetX += forceX; - source.offsetY += forceY; - } - if (!target.isLocked) { - target.offsetX -= forceX; - target.offsetY -= forceY; + CRp$6.drawElementText = function(context, ele, shiftToOriginWithBb, force, prefix) { + var useEleOpacity = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true; + var r2 = this; + if (force == null) { + if (useEleOpacity && !r2.eleTextBiggerThanMin(ele)) { + return; } - } - }; - var calculateGravityForces = function calculateGravityForces2(layoutInfo, options2) { - if (options2.gravity === 0) { + } else if (force === false) { return; } - var distThreshold = 1; - for (var i3 = 0; i3 < layoutInfo.graphSet.length; i3++) { - var graph = layoutInfo.graphSet[i3]; - var numNodes = graph.length; - if (0 === i3) { - 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; + if (ele.isNode()) { + var label = ele.pstyle("label"); + if (!label || !label.value) { + return; } - for (var j = 0; j < numNodes; j++) { - var node2 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[j]]]; - 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; - node2.offsetX += fx; - node2.offsetY += fy; - } + var justification = r2.getLabelJustification(ele); + context.textAlign = justification; + context.textBaseline = "bottom"; + } else { + var badLine = ele.element()._private.rscratch.badLine; + var _label = ele.pstyle("label"); + var srcLabel = ele.pstyle("source-label"); + var tgtLabel = ele.pstyle("target-label"); + if (badLine || (!_label || !_label.value) && (!srcLabel || !srcLabel.value) && (!tgtLabel || !tgtLabel.value)) { + return; } + context.textAlign = "center"; + context.textBaseline = "bottom"; } - }; - var propagateForces = function propagateForces2(layoutInfo, options2) { - var queue = []; - var start2 = 0; - var end2 = -1; - queue.push.apply(queue, layoutInfo.graphSet[0]); - end2 += layoutInfo.graphSet[0].length; - while (start2 <= end2) { - var nodeId = queue[start2++]; - 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]]]; - childNode.offsetX += offX; - childNode.offsetY += offY; - queue[++end2] = children2[i3]; - } - node2.offsetX = 0; - node2.offsetY = 0; - } + var applyRotation = !shiftToOriginWithBb; + var bb; + if (shiftToOriginWithBb) { + bb = shiftToOriginWithBb; + context.translate(-bb.x1, -bb.y1); } - }; - 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; + if (prefix == null) { + r2.drawText(context, ele, null, applyRotation, useEleOpacity); + if (ele.isEdge()) { + r2.drawText(context, ele, "source", applyRotation, useEleOpacity); + r2.drawText(context, ele, "target", applyRotation, useEleOpacity); } + } else { + r2.drawText(context, ele, prefix, applyRotation, useEleOpacity); } - for (var i3 = 0; i3 < layoutInfo.nodeSize; i3++) { - var n = layoutInfo.layoutNodes[i3]; - if (0 < n.children.length || n.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); + if (shiftToOriginWithBb) { + context.translate(bb.x1, bb.y1); } - 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; + }; + CRp$6.getFontCache = function(context) { + var cache3; + this.fontCaches = this.fontCaches || []; + for (var i2 = 0; i2 < this.fontCaches.length; i2++) { + cache3 = this.fontCaches[i2]; + if (cache3.context === context) { + return cache3; } } + cache3 = { + context + }; + this.fontCaches.push(cache3); + return cache3; }; - var limitForce = function limitForce2(forceX, forceY, max3) { - var force = Math.sqrt(forceX * forceX + forceY * forceY); - if (force > max3) { - var res = { - x: max3 * forceX / force, - y: max3 * forceY / force - }; + CRp$6.setupTextStyle = function(context, ele) { + var useEleOpacity = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true; + var labelStyle = ele.pstyle("font-style").strValue; + var labelSize = ele.pstyle("font-size").pfValue + "px"; + var labelFamily = ele.pstyle("font-family").strValue; + var labelWeight = ele.pstyle("font-weight").strValue; + var opacity = useEleOpacity ? ele.effectiveOpacity() * ele.pstyle("text-opacity").value : 1; + var outlineOpacity = ele.pstyle("text-outline-opacity").value * opacity; + var color2 = ele.pstyle("color").value; + var outlineColor = ele.pstyle("text-outline-color").value; + context.font = labelStyle + " " + labelWeight + " " + labelSize + " " + labelFamily; + context.lineJoin = "round"; + this.colorFillStyle(context, color2[0], color2[1], color2[2], opacity); + this.colorStrokeStyle(context, outlineColor[0], outlineColor[1], outlineColor[2], outlineOpacity); + }; + __name(roundRect, "roundRect"); + CRp$6.getTextAngle = function(ele, prefix) { + var theta; + var _p = ele._private; + var rscratch = _p.rscratch; + var pdash = prefix ? prefix + "-" : ""; + var rotation = ele.pstyle(pdash + "text-rotation"); + var textAngle = getPrefixedProperty(rscratch, "labelAngle", prefix); + if (rotation.strValue === "autorotate") { + theta = ele.isEdge() ? textAngle : 0; + } else if (rotation.strValue === "none") { + theta = 0; } else { - var res = { - x: forceX, - y: forceY - }; + theta = rotation.pfValue; } - return res; + return theta; }; - var updateAncestryBoundaries = function updateAncestryBoundaries2(node2, layoutInfo) { - var parentId = node2.parentId; - if (null == parentId) { + CRp$6.drawText = function(context, ele, prefix) { + var applyRotation = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true; + var useEleOpacity = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true; + var _p = ele._private; + var rscratch = _p.rscratch; + var parentOpacity = useEleOpacity ? ele.effectiveOpacity() : 1; + if (useEleOpacity && (parentOpacity === 0 || ele.pstyle("text-opacity").value === 0)) { return; } - var p2 = layoutInfo.layoutNodes[layoutInfo.idToIndex[parentId]]; - var flag = false; - if (null == p2.maxX || node2.maxX + p2.padRight > p2.maxX) { - p2.maxX = node2.maxX + p2.padRight; - flag = true; - } - if (null == p2.minX || node2.minX - p2.padLeft < p2.minX) { - p2.minX = node2.minX - p2.padLeft; - flag = true; - } - if (null == p2.maxY || node2.maxY + p2.padBottom > p2.maxY) { - p2.maxY = node2.maxY + p2.padBottom; - flag = true; - } - if (null == p2.minY || node2.minY - p2.padTop < p2.minY) { - p2.minY = node2.minY - p2.padTop; - flag = true; - } - if (flag) { - return updateAncestryBoundaries2(p2, 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]; - var cid = node2.cmptId; - var component = components[cid] = components[cid] || []; - component.push(node2); + if (prefix === "main") { + prefix = null; } - var totalA = 0; - for (var i3 = 0; i3 < components.length; i3++) { - var c2 = components[i3]; - if (!c2) { - continue; + var textX = getPrefixedProperty(rscratch, "labelX", prefix); + var textY = getPrefixedProperty(rscratch, "labelY", prefix); + var orgTextX, orgTextY; + var text2 = this.getLabelText(ele, prefix); + if (text2 != null && text2 !== "" && !isNaN(textX) && !isNaN(textY)) { + this.setupTextStyle(context, ele, useEleOpacity); + var pdash = prefix ? prefix + "-" : ""; + var textW = getPrefixedProperty(rscratch, "labelWidth", prefix); + 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 isEdge2 = ele.isEdge(); + var halign = ele.pstyle("text-halign").value; + var valign = ele.pstyle("text-valign").value; + if (isEdge2) { + halign = "center"; + valign = "center"; } - 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) { - return c22.w * c22.h - c1.w * c1.h; - }); - var x2 = 0; - var y2 = 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) { - continue; + textX += marginX; + textY += marginY; + var theta; + if (!applyRotation) { + theta = 0; + } else { + theta = this.getTextAngle(ele, prefix); } - 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; - } + if (theta !== 0) { + orgTextX = textX; + orgTextY = textY; + context.translate(orgTextX, orgTextY); + context.rotate(theta); + textX = 0; + textY = 0; } - x2 += c2.w + options2.componentSpacing; - usedW += c2.w + options2.componentSpacing; - rowH = Math.max(rowH, c2.h); - if (usedW > maxRowW) { - y2 += rowH + options2.componentSpacing; - x2 = 0; - usedW = 0; - rowH = 0; + switch (valign) { + case "top": + break; + case "center": + textY += textH / 2; + break; + case "bottom": + textY += textH; + break; } - } - }; - var defaults$3 = { - fit: true, - // whether to fit the viewport to the graph - padding: 30, - // padding used on fit - boundingBox: void 0, - // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - avoidOverlap: true, - // prevents node overlap, may overflow boundingBox if not enough space - avoidOverlapPadding: 10, - // extra spacing around nodes when avoidOverlap: true - nodeDimensionsIncludeLabels: false, - // Excludes the label when calculating node bounding boxes for the layout algorithm - spacingFactor: void 0, - // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up - condense: false, - // uses all available space on false, uses minimal space on true - rows: void 0, - // force num of rows in the grid - cols: void 0, - // force num of columns in the grid - position: function position3(node2) { - }, - // 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') } - 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) { - return true; - }, - // 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 a given node position. Useful for changing flow direction in discrete layouts - }; - function GridLayout(options2) { - this.options = extend2({}, defaults$3, options2); - } - GridLayout.prototype.run = function() { - var params = this.options; - var options2 = params; - var cy = params.cy; - var eles = options2.eles; - var nodes2 = eles.nodes().not(":parent"); - if (options2.sort) { - nodes2 = nodes2.sort(options2.sort); - } - var bb = makeBoundingBox(options2.boundingBox ? options2.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) { - return { - x: bb.x1, - y: bb.y1 - }; - }); - } else { - var cells = nodes2.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) { - if (val == null) { - return Math.min(rows, cols); - } else { - var min3 = Math.min(rows, cols); - if (min3 == rows) { - rows = val; - } else { - cols = val; - } + var backgroundOpacity = ele.pstyle("text-background-opacity").value; + var borderOpacity = ele.pstyle("text-border-opacity").value; + var textBorderWidth = ele.pstyle("text-border-width").pfValue; + var backgroundPadding = ele.pstyle("text-background-padding").pfValue; + var styleShape = ele.pstyle("text-background-shape").strValue; + var rounded = styleShape.indexOf("round") === 0; + var roundRadius = 2; + if (backgroundOpacity > 0 || textBorderWidth > 0 && borderOpacity > 0) { + var bgX = textX - backgroundPadding; + switch (halign) { + case "left": + bgX -= textW; + break; + case "center": + bgX -= textW / 2; + break; } - }; - var large = function large2(val) { - if (val == null) { - return Math.max(rows, cols); - } else { - var max3 = Math.max(rows, cols); - if (max3 == rows) { - rows = val; + var bgY = textY - textH - backgroundPadding; + var bgW = textW + 2 * backgroundPadding; + var bgH = textH + 2 * backgroundPadding; + if (backgroundOpacity > 0) { + var textFill = context.fillStyle; + var textBackgroundColor = ele.pstyle("text-background-color").value; + context.fillStyle = "rgba(" + textBackgroundColor[0] + "," + textBackgroundColor[1] + "," + textBackgroundColor[2] + "," + backgroundOpacity * parentOpacity + ")"; + if (rounded) { + roundRect(context, bgX, bgY, bgW, bgH, roundRadius); } else { - cols = val; + context.fillRect(bgX, bgY, bgW, bgH); } + context.fillStyle = textFill; } - }; - var oRows = options2.rows; - var oCols = options2.cols != null ? options2.cols : options2.columns; - if (oRows != null && oCols != null) { - rows = oRows; - cols = oCols; - } else if (oRows != null && oCols == null) { - rows = oRows; - cols = Math.ceil(cells / rows); - } else if (oRows == null && oCols != null) { - cols = oCols; - rows = Math.ceil(cells / cols); - } else if (cols * rows > cells) { - var sm = small(); - var lg = large(); - if ((sm - 1) * lg >= cells) { - small(sm - 1); - } else if ((lg - 1) * sm >= cells) { - large(lg - 1); - } - } else { - while (cols * rows < cells) { - var _sm = small(); - var _lg = large(); - if ((_lg + 1) * _sm >= cells) { - large(_lg + 1); + if (textBorderWidth > 0 && borderOpacity > 0) { + var textStroke = context.strokeStyle; + var textLineWidth = context.lineWidth; + var textBorderColor = ele.pstyle("text-border-color").value; + var textBorderStyle = ele.pstyle("text-border-style").value; + context.strokeStyle = "rgba(" + textBorderColor[0] + "," + textBorderColor[1] + "," + textBorderColor[2] + "," + borderOpacity * parentOpacity + ")"; + context.lineWidth = textBorderWidth; + if (context.setLineDash) { + switch (textBorderStyle) { + case "dotted": + context.setLineDash([1, 1]); + break; + case "dashed": + context.setLineDash([4, 2]); + break; + case "double": + context.lineWidth = textBorderWidth / 4; + context.setLineDash([]); + break; + case "solid": + context.setLineDash([]); + break; + } + } + if (rounded) { + roundRect(context, bgX, bgY, bgW, bgH, roundRadius, "stroke"); } else { - small(_sm + 1); + context.strokeRect(bgX, bgY, bgW, bgH); + } + if (textBorderStyle === "double") { + var whiteWidth = textBorderWidth / 2; + if (rounded) { + roundRect(context, bgX + whiteWidth, bgY + whiteWidth, bgW - whiteWidth * 2, bgH - whiteWidth * 2, roundRadius, "stroke"); + } else { + context.strokeRect(bgX + whiteWidth, bgY + whiteWidth, bgW - whiteWidth * 2, bgH - whiteWidth * 2); + } + } + if (context.setLineDash) { + context.setLineDash([]); } + context.lineWidth = textLineWidth; + context.strokeStyle = textStroke; } } - var cellWidth = bb.w / cols; - var cellHeight = bb.h / rows; - if (options2.condense) { - cellWidth = 0; - cellHeight = 0; + var lineWidth = 2 * ele.pstyle("text-outline-width").pfValue; + if (lineWidth > 0) { + context.lineWidth = lineWidth; } - if (options2.avoidOverlap) { - for (var i3 = 0; i3 < nodes2.length; i3++) { - var node2 = nodes2[i3]; - var pos = node2._private.position; - if (pos.x == null || pos.y == null) { - pos.x = 0; - pos.y = 0; + if (ele.pstyle("text-wrap").value === "wrap") { + var lines = getPrefixedProperty(rscratch, "labelWrapCachedLines", prefix); + var lineHeight = getPrefixedProperty(rscratch, "labelLineHeight", prefix); + var halfTextW = textW / 2; + var justification = this.getLabelJustification(ele); + if (justification === "auto") ; + else if (halign === "left") { + if (justification === "left") { + textX += -textW; + } else if (justification === "center") { + textX += -halfTextW; } - 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 cellUsed = {}; - var used = function used2(row2, col2) { - return cellUsed["c-" + row2 + "-" + col2] ? true : false; - }; - var use = function use2(row2, col2) { - cellUsed["c-" + row2 + "-" + col2] = true; - }; - var row = 0; - var col = 0; - var moveToNextCell = function moveToNextCell2() { - col++; - if (col >= cols) { - col = 0; - row++; - } - }; - var id2manPos = {}; - for (var _i = 0; _i < nodes2.length; _i++) { - var _node = nodes2[_i]; - var rcPos = options2.position(_node); - if (rcPos && (rcPos.row !== void 0 || rcPos.col !== void 0)) { - var _pos = { - row: rcPos.row, - col: rcPos.col - }; - if (_pos.col === void 0) { - _pos.col = 0; - while (used(_pos.row, _pos.col)) { - _pos.col++; - } - } else if (_pos.row === void 0) { - _pos.row = 0; - while (used(_pos.row, _pos.col)) { - _pos.row++; - } + } else if (halign === "center") { + if (justification === "left") { + textX += -halfTextW; + } else if (justification === "right") { + textX += halfTextW; + } + } else if (halign === "right") { + if (justification === "center") { + textX += halfTextW; + } else if (justification === "right") { + textX += textW; } - id2manPos[_node.id()] = _pos; - use(_pos.row, _pos.col); } - } - var getPos = function getPos2(element2, i4) { - var x2, y2; - if (element2.locked() || element2.isParent()) { - return false; + switch (valign) { + case "top": + textY -= (lines.length - 1) * lineHeight; + break; + case "center": + case "bottom": + textY -= (lines.length - 1) * lineHeight; + break; } - var rcPos2 = id2manPos[element2.id()]; - if (rcPos2) { - x2 = rcPos2.col * cellWidth + cellWidth / 2 + bb.x1; - y2 = rcPos2.row * cellHeight + cellHeight / 2 + bb.y1; - } else { - while (used(row, col)) { - moveToNextCell(); + for (var l2 = 0; l2 < lines.length; l2++) { + if (lineWidth > 0) { + context.strokeText(lines[l2], textX, textY); } - x2 = col * cellWidth + cellWidth / 2 + bb.x1; - y2 = row * cellHeight + cellHeight / 2 + bb.y1; - use(row, col); - moveToNextCell(); + context.fillText(lines[l2], textX, textY); + textY += lineHeight; } - return { - x: x2, - y: y2 - }; - }; - nodes2.layoutPositions(this, options2, getPos); + } else { + if (lineWidth > 0) { + context.strokeText(text2, textX, textY); + } + context.fillText(text2, textX, textY); + } + if (theta !== 0) { + context.rotate(-theta); + context.translate(-orgTextX, -orgTextY); + } } - return this; }; - var defaults$2 = { - ready: function ready() { - }, - // on layoutready - stop: function stop() { + CRp$5 = {}; + CRp$5.drawNode = function(context, node2, shiftToOriginWithBb) { + 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 r2 = this; + var nodeWidth, nodeHeight; + var _p = node2._private; + var rs = _p.rscratch; + var pos = node2.position(); + if (!number$1(pos.x) || !number$1(pos.y)) { + return; } - // on layoutstop - }; - function NullLayout(options2) { - this.options = extend2({}, defaults$2, options2); - } - NullLayout.prototype.run = function() { - var options2 = this.options; - var eles = options2.eles; - var layout3 = this; - options2.cy; - layout3.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"); - return this; - }; - NullLayout.prototype.stop = function() { - return this; - }; - var defaults$12 = { - positions: void 0, - // map of (node id) => (position obj); or function(node){ return somPos; } - zoom: void 0, - // the zoom level to set (prob want fit = false if set) - pan: void 0, - // the pan level to set (prob want fit = false if set) - fit: true, - // whether to fit to viewport - padding: 30, - // padding on fit - 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) { - return true; - }, - // 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; + if (shouldDrawOpacity && !node2.visible()) { + return; } - // transform a given node position. Useful for changing flow direction in discrete layouts - }; - function PresetLayout(options2) { - this.options = extend2({}, defaults$12, options2); - } - PresetLayout.prototype.run = function() { - var options2 = this.options; - var eles = options2.eles; - var nodes2 = eles.nodes(); - var posIsFn = fn$6(options2.positions); - function getPosition(node2) { - if (options2.positions == null) { - return copyPosition(node2.position()); - } - if (posIsFn) { - return options2.positions(node2); - } - var pos = options2.positions[node2._private.data.id]; - if (pos == null) { - return null; - } - return pos; + var eleOpacity = shouldDrawOpacity ? node2.effectiveOpacity() : 1; + var usePaths = r2.usePaths(); + var path4; + var pathCacheHit = false; + var padding3 = node2.padding(); + nodeWidth = node2.width() + 2 * padding3; + nodeHeight = node2.height() + 2 * padding3; + var bb; + if (shiftToOriginWithBb) { + bb = shiftToOriginWithBb; + context.translate(-bb.x1, -bb.y1); } - nodes2.layoutPositions(this, options2, function(node2, i3) { - var position3 = getPosition(node2); - if (node2.locked() || position3 == null) { - return false; + var bgImgProp = node2.pstyle("background-image"); + var urls = bgImgProp.value; + var urlDefined = new Array(urls.length); + var image = new Array(urls.length); + var numImages = 0; + 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", i2); + numImages++; + image[i2] = r2.getCachedImage(url, bgImgCrossOrigin, function() { + _p.backgroundTimestamp = Date.now(); + node2.emitAndNotify("background"); + }); } - return position3; - }); - return this; - }; - var defaults2 = { - fit: true, - // whether to fit to viewport - padding: 30, - // fit padding - boundingBox: void 0, - // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - 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) { - return true; - }, - // 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 a given node position. Useful for changing flow direction in discrete layouts - }; - function RandomLayout(options2) { - this.options = extend2({}, defaults2, options2); - } - RandomLayout.prototype.run = function() { - var options2 = this.options; - var cy = options2.cy; - var eles = options2.eles; - var bb = makeBoundingBox(options2.boundingBox ? options2.boundingBox : { - x1: 0, - y1: 0, - w: cy.width(), - h: cy.height() - }); - var getPos = function getPos2(node2, i3) { - 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); - return this; - }; - var layout2 = [{ - name: "breadthfirst", - impl: BreadthFirstLayout - }, { - name: "circle", - impl: CircleLayout - }, { - name: "concentric", - impl: ConcentricLayout - }, { - name: "cose", - impl: CoseLayout - }, { - name: "grid", - impl: GridLayout - }, { - name: "null", - impl: NullLayout - }, { - name: "preset", - impl: PresetLayout - }, { - name: "random", - impl: RandomLayout - }]; - function NullRenderer(options2) { - this.options = options2; - this.notifications = 0; - } - var noop2 = function noop3() { - }; - var throwImgErr = function throwImgErr2() { - throw new Error("A headless instance can not render images"); - }; - NullRenderer.prototype = { - recalculateRenderedStyle: noop2, - notify: function notify() { - this.notifications++; - }, - init: noop2, - isHeadless: function isHeadless() { - return true; - }, - png: throwImgErr, - jpg: throwImgErr - }; - var 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; - 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; - var xTranslated = xScaled + translation.x; - var yTranslated = yScaled + translation.y; + var darkness = node2.pstyle("background-blacken").value; + var borderWidth = node2.pstyle("border-width").pfValue; + 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; + 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; + r2.eleFillStyle(context, node2, bgOpy); + }, "setupShapeColor"); + var setupBorderColor = /* @__PURE__ */ __name(function setupBorderColor2() { + var bdrOpy = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : borderOpacity; + 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; + 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 path5; + var cacheHit = false; + if (cachedPath != null) { + path5 = cachedPath; + cacheHit = true; + rs.pathCache = path5; + } else { + path5 = new Path2D(); + pathCache[key] = rs.pathCache = path5; + } return { - x: xTranslated, - y: yTranslated + path: path5, + cacheHit }; - }; - var transformPoints = function transformPoints2(pts2, size2, angle, 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)); - } - return retPts; - }; - var pointsToArr = function pointsToArr2(pts2) { - var ret = []; - for (var i3 = 0; i3 < pts2.length; i3++) { - var p2 = pts2[i3]; - ret.push(p2.x, p2.y); - } - return ret; - }; - var standardGap = function standardGap2(edge) { - return edge.pstyle("width").pfValue * edge.pstyle("arrow-scale").pfValue * 2; - }; - var defineArrowShape = function defineArrowShape2(name2, defn) { - if (string(defn)) { - defn = arrowShapes[defn]; - } - arrowShapes[name2] = extend2({ - name: name2, - 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); - return inside; - }, - roughCollide: bbCollide, - draw: function draw2(context, size2, angle, translation) { - var points = transformPoints(this.points, size2, angle, translation); - renderer3.arrowShapeImpl("polygon")(context, points); - }, - spacing: function spacing(edge) { - return 0; - }, - gap: standardGap - }, defn); - }; - defineArrowShape("none", { - collide: falsify, - roughCollide: falsify, - draw: noop$12, - spacing: zeroify, - gap: zeroify - }); - defineArrowShape("triangle", { - points: [-0.15, -0.3, 0, 0, 0.15, -0.3] - }); - defineArrowShape("arrow", "triangle"); - defineArrowShape("triangle-backcurve", { - 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); - 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) { - return standardGap(edge) * 0.8; - } - }); - 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); - 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); - } - }); - 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 t4 = translation; - var circleInside = Math.pow(t4.x - x2, 2) + Math.pow(t4.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 spacing(edge) { - return renderer3.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.radius; - } - }); - defineArrowShape("triangle-cross", { - points: [0, 0, 0.15, -0.3, -0.15, -0.3, 0, 0], - baseCrossLinePts: [ - -0.15, - -0.4, - // first half of the rectangle - -0.15, - -0.4, - 0.15, - -0.4, - // second half of the rectangle - 0.15, - -0.4 - ], - crossLinePts: function crossLinePts(size2, edgeWidth) { - var p2 = this.baseCrossLinePts.slice(); - var shiftFactor = edgeWidth / size2; - 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); - 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); - } - }); - defineArrowShape("vee", { - points: [-0.15, -0.3, 0, 0, 0.15, -0.3, 0, -0.15], - gap: function gap(edge) { - return standardGap(edge) * 0.525; + }, "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); + path4 = shapePath.path; + pathCacheHit = shapePath.cacheHit; + } + var drawShape = /* @__PURE__ */ __name(function drawShape2() { + if (!pathCacheHit) { + var npos = pos; + if (usePaths) { + npos = { + x: 0, + y: 0 + }; + } + r2.nodeShapes[r2.getNodeShape(node2)].draw(path4 || context, npos.x, npos.y, nodeWidth, nodeHeight, cornerRadius, rs); } - }); - defineArrowShape("circle", { - radius: 0.15, - collide: function collide(x2, y2, size2, angle, translation, edgeWidth, padding2) { - var t4 = translation; - var inside = Math.pow(t4.x - x2, 2) + Math.pow(t4.y - y2, 2) <= Math.pow((size2 + 2 * padding2) * 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 spacing(edge) { - return renderer3.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.radius; + if (usePaths) { + context.fill(path4); + } else { + context.fill(); } - }); - defineArrowShape("tee", { - points: [-0.15, 0, -0.15, -0.1, 0.15, -0.1, 0.15, 0], - spacing: function spacing(edge) { - return 1; - }, - gap: function gap(edge) { - return 1; + }, "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 _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[_i] && image[_i].complete && !image[_i].error) { + totalCompleted++; + r2.drawInscribedImage(context, image[_i], node2, _i, nodeOpacity); + } } - }); - 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) { - return edge.pstyle("width").pfValue * edge.pstyle("arrow-scale").value; + _p.backgrounding = !(totalCompleted === numImages); + if (prevBging !== _p.backgrounding) { + node2.updateStyle(false); } - }); - 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) { - return 0.95 * edge.pstyle("width").pfValue * edge.pstyle("arrow-scale").value; + }, "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 (r2.hasPie(node2)) { + r2.drawPie(context, node2, pieOpacity); + if (redrawShape) { + if (!usePaths) { + r2.nodeShapes[r2.getNodeShape(node2)].draw(context, pos.x, pos.y, nodeWidth, nodeHeight, cornerRadius, rs); + } + } } - }); - }; - var 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]; - }; - BRp$e.findContainerClientCoords = function() { - if (this.containerBB) { - return this.containerBB; - } - var container = this.container; - var rect2 = container.getBoundingClientRect(); - var style = window$1.getComputedStyle(container); - var styleValue2 = function styleValue3(name2) { - return parseFloat(style.getPropertyValue(name2)); - }; - var padding2 = { - left: styleValue2("padding-left"), - right: styleValue2("padding-right"), - top: styleValue2("padding-top"), - bottom: styleValue2("padding-bottom") - }; - var border = { - left: styleValue2("border-left-width"), - right: styleValue2("border-right-width"), - 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 borderHor = border.left + border.right; - var scale = rect2.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]; - }; - 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.findNearestElements = function(x2, y2, interactiveElementsOnly, isTouch) { - var self2 = this; - var r = this; - var eles = r.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 minSqDist = Infinity; - var nearEdge; - var nearNode; - if (interactiveElementsOnly) { - eles = eles.interactive; - } - function addEle(ele2, sqDist) { - if (ele2.isNode()) { - if (nearNode) { - return; + }, "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 c3 = darkness > 0 ? 0 : 255; + if (darkness !== 0) { + r2.colorFillStyle(context, c3, c3, c3, opacity); + if (usePaths) { + context.fill(path4); } else { - nearNode = ele2; - near.push(ele2); + context.fill(); + } + } + }, "darken"); + var drawBorder = /* @__PURE__ */ __name(function drawBorder2() { + if (borderWidth > 0) { + context.lineWidth = borderWidth; + context.lineCap = borderCap; + context.lineJoin = borderJoin; + if (context.setLineDash) { + switch (borderStyle) { + case "dotted": + context.setLineDash([1, 1]); + break; + case "dashed": + context.setLineDash(borderPattern); + context.lineDashOffset = borderOffset; + break; + case "solid": + case "double": + context.setLineDash([]); + break; + } } - } - 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; - nearEdge = ele2; - minSqDist = sqDist != null ? sqDist : minSqDist; - break; - } - } + 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 { - near.push(ele2); - nearEdge = ele2; - minSqDist = sqDist != null ? sqDist : minSqDist; + usePaths ? context.stroke(path4) : context.stroke(); } - } - } - function checkNode(node2) { - var width2 = node2.outerWidth() + 2 * nodeThreshold; - var height2 = node2.outerHeight() + 2 * nodeThreshold; - var hw = width2 / 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, height2, pos.x, pos.y)) { - addEle(node2, 0); - return true; + if (borderStyle === "double") { + context.lineWidth = borderWidth / 3; + var gco = context.globalCompositeOperation; + context.globalCompositeOperation = "destination-out"; + if (usePaths) { + context.stroke(path4); + } else { + context.stroke(); + } + context.globalCompositeOperation = gco; + } + if (context.setLineDash) { + context.setLineDash([]); } } - } - 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 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]))) { - addEle(edge, sqDist); - return true; + }, "drawBorder"); + var drawOutline = /* @__PURE__ */ __name(function drawOutline2() { + if (outlineWidth > 0) { + context.lineWidth = outlineWidth; + context.lineCap = "butt"; + if (context.setLineDash) { + switch (outlineStyle) { + case "dotted": + context.setLineDash([1, 1]); + break; + case "dashed": + context.setLineDash([4, 2]); + break; + case "solid": + case "double": + context.setLineDash([]); + break; } } - } 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]))) { - addEle(edge, sqDist); - return true; + var npos = pos; + if (usePaths) { + npos = { + x: 0, + y: 0 + }; + } + 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 = r2.nodeShapes[shape].points; + var _path; + if (usePaths) { + var outlinePath = getPath(sWidth, sHeight, shape, points); + _path = outlinePath.path; + } + if (shape === "ellipse") { + 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 = (bWidth + outlineOffset + outlineWidth) * 1.4; + } else if (shape === "round-heptagon") { + sMult = (bWidth + outlineOffset + outlineWidth) * 1.075; + offsetY = -(bWidth / 2 + outlineOffset + outlineWidth) / 35; + } else if (shape === "round-hexagon") { + sMult = (bWidth + outlineOffset + outlineWidth) * 1.12; + } else if (shape === "round-pentagon") { + sMult = (bWidth + outlineOffset + outlineWidth) * 1.13; + offsetY = -(bWidth / 2 + outlineOffset + outlineWidth) / 15; + } else if (shape === "round-tag") { + sMult = (bWidth + outlineOffset + outlineWidth) * 1.12; + offsetX = (bWidth / 2 + outlineWidth + outlineOffset) * 0.07; + } else if (shape === "round-triangle") { + sMult = (bWidth + outlineOffset + outlineWidth) * (Math.PI / 2); + offsetY = -(bWidth + outlineOffset / 2 + outlineWidth) / Math.PI; + } + if (sMult !== 0) { + scaleX = (nodeWidth + sMult) / nodeWidth; + 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] + }; } + 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)) { + 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)) { + 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)) { + 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") { + 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 pad3 = (bWidth + outlineWidth + outlineOffset) / nodeWidth; + points = joinLines(expandPolygon(points, pad3)); + r2.drawPolygonPath(_path || context, npos.x, npos.y, nodeWidth, nodeHeight, points); + } else { + var _pad = (bWidth + outlineWidth + outlineOffset) / nodeWidth; + points = joinLines(expandPolygon(points, -_pad)); + r2.drawPolygonPath(_path || context, npos.x, npos.y, nodeWidth, nodeHeight, points); } - } - var src = src || _p.source; - var tgt = tgt || _p.target; - var arSize = self2.getArrowWidth(styleWidth, scale); - var arrows2 = [{ - name: "source", - x: rs.arrowStartX, - y: rs.arrowStartY, - angle: rs.srcArrowAngle - }, { - name: "target", - x: rs.arrowEndX, - y: rs.arrowEndY, - angle: rs.tgtArrowAngle - }, { - name: "mid-source", - x: rs.midX, - y: rs.midY, - angle: rs.midsrcArrowAngle - }, { - name: "mid-target", - x: rs.midX, - 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]; - var edgeWidth = edge.pstyle("width").pfValue; - if (shape.roughCollide(x2, y2, arSize, ar.angle, { - x: ar.x, - y: ar.y - }, edgeWidth, edgeThreshold) && shape.collide(x2, y2, arSize, ar.angle, { - x: ar.x, - y: ar.y - }, edgeWidth, edgeThreshold)) { - addEle(edge); - return true; + if (usePaths) { + context.stroke(_path); + } else { + context.stroke(); + } + if (outlineStyle === "double") { + context.lineWidth = bWidth / 3; + var gco = context.globalCompositeOperation; + context.globalCompositeOperation = "destination-out"; + if (usePaths) { + context.stroke(_path); + } else { + context.stroke(); + } + context.globalCompositeOperation = gco; + } + if (context.setLineDash) { + context.setLineDash([]); } } - if (hasCompounds && near.length > 0) { - checkNode(src); - checkNode(tgt); + }, "drawOutline"); + var drawOverlay = /* @__PURE__ */ __name(function drawOverlay2() { + if (shouldDrawOverlay) { + r2.drawNodeOverlay(context, node2, pos, nodeWidth, nodeHeight); + } + }, "drawOverlay"); + var drawUnderlay = /* @__PURE__ */ __name(function drawUnderlay2() { + if (shouldDrawOverlay) { + r2.drawNodeUnderlay(context, node2, pos, nodeWidth, nodeHeight); } + }, "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; + var gy = node2.pstyle("ghost-offset-y").pfValue; + var ghostOpacity = node2.pstyle("ghost-opacity").value; + var effGhostOpacity = ghostOpacity * eleOpacity; + context.translate(gx, gy); + setupOutlineColor(); + drawOutline(); + setupShapeColor(ghostOpacity * bgOpacity); + drawShape(); + drawImages(effGhostOpacity, true); + setupBorderColor(ghostOpacity * borderOpacity); + drawBorder(); + drawPie(darkness !== 0 || borderWidth !== 0); + drawImages(effGhostOpacity, false); + darken2(effGhostOpacity); + context.translate(-gx, -gy); } - function preprop(obj, name2, pre) { - return getPrefixedProperty(obj, name2, pre); + if (usePaths) { + context.translate(-pos.x, -pos.y); } - function checkLabel(ele2, prefix) { - var _p = ele2._private; - var th = labelThreshold; - var prefixDash; - if (prefix) { - prefixDash = prefix + "-"; - } else { - prefixDash = ""; - } - ele2.boundingBox(); - var bb = _p.labelBounds[prefix || "main"]; - var text2 = ele2.pstyle(prefixDash + "label").value; - var eventsEnabled = ele2.pstyle("text-events").strValue === "yes"; - if (!eventsEnabled || !text2) { + drawUnderlay(); + if (usePaths) { + context.translate(pos.x, pos.y); + } + setupOutlineColor(); + drawOutline(); + setupShapeColor(); + drawShape(); + drawImages(eleOpacity, true); + setupBorderColor(); + drawBorder(); + drawPie(darkness !== 0 || borderWidth !== 0); + drawImages(eleOpacity, false); + darken2(); + if (usePaths) { + context.translate(-pos.x, -pos.y); + } + drawText6(); + drawOverlay(); + if (shiftToOriginWithBb) { + context.translate(bb.x1, bb.y1); + } + }; + drawNodeOverlayUnderlay = /* @__PURE__ */ __name(function drawNodeOverlayUnderlay2(overlayOrUnderlay) { + if (!["overlay", "underlay"].includes(overlayOrUnderlay)) { + throw new Error("Invalid state"); + } + return function(context, node2, pos, nodeWidth, nodeHeight) { + var r2 = this; + if (!node2.visible()) { return; } - var lx = preprop(_p.rscratch, "labelX", prefix); - var ly = preprop(_p.rscratch, "labelY", prefix); - var theta = preprop(_p.rscratch, "labelAngle", prefix); - var ox = ele2.pstyle(prefixDash + "text-margin-x").pfValue; - var oy = ele2.pstyle(prefixDash + "text-margin-y").pfValue; - var lx1 = bb.x1 - th - ox; - var lx2 = bb.x2 + th - ox; - var ly1 = bb.y1 - th - oy; - var ly2 = bb.y2 + th - oy; - if (theta) { - var cos3 = Math.cos(theta); - var sin3 = Math.sin(theta); - var rotate = function rotate2(x3, y3) { - x3 = x3 - lx; - y3 = y3 - ly; - return { - x: x3 * cos3 - y3 * sin3 + lx, - y: x3 * sin3 + y3 * cos3 + ly - }; - }; - var px1y1 = rotate(lx1, ly1); - var px1y2 = rotate(lx1, ly2); - var px2y1 = rotate(lx2, ly1); - var px2y2 = rotate(lx2, ly2); - var points = [ - // with the margin added after the rotation is applied - px1y1.x + ox, - px1y1.y + oy, - px2y1.x + ox, - px2y1.y + oy, - px2y2.x + ox, - px2y2.y + oy, - px1y2.x + ox, - px1y2.y + oy - ]; - if (pointInsidePolygonPoints(x2, y2, points)) { - addEle(ele2); - return true; - } - } else { - if (inBoundingBox(bb, x2, y2)) { - addEle(ele2); - return true; + 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) { + var _padding = node2.padding(); + nodeWidth = node2.width() + 2 * _padding; + nodeHeight = node2.height() + 2 * _padding; } + 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) { + node2 = node2[0]; + return node2._private.hasPie; + }; + CRp$5.drawPie = function(context, node2, nodeOpacity, pos) { + node2 = node2[0]; + pos = pos || node2.position(); + var cyStyle = node2.cy().style(); + var pieSize = node2.pstyle("pie-size"); + var x5 = pos.x; + var y5 = pos.y; + var nodeW = node2.width(); + var nodeH = node2.height(); + var radius2 = Math.min(nodeW, nodeH) / 2; + var lastPercent = 0; + var usePaths = this.usePaths(); + if (usePaths) { + x5 = 0; + y5 = 0; } - for (var i3 = eles.length - 1; i3 >= 0; i3--) { - var ele = eles[i3]; - if (ele.isNode()) { - checkNode(ele) || checkLabel(ele); - } else { - checkEdge(ele) || checkLabel(ele) || checkLabel(ele, "source") || checkLabel(ele, "target"); + if (pieSize.units === "%") { + radius2 = radius2 * pieSize.pfValue; + } else if (pieSize.pfValue !== void 0) { + radius2 = pieSize.pfValue / 2; + } + 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 (size5 === 0 || lastPercent >= 1 || lastPercent + percent > 1) { + continue; } + context.beginPath(); + 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; } - return near; }; - BRp$e.getAllInBox = function(x1, y1, x2, y2) { - 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); - x1 = x1c; - x2 = x2c; - y1 = y1c; - y2 = y2c; - var boxBb = makeBoundingBox({ - x1, - y1, - x2, - y2 - }); - for (var e = 0; e < eles.length; e++) { - var ele = eles[e]; - if (ele.isNode()) { - var node2 = ele; - var nodeBb = node2.boundingBox({ - includeNodes: true, - includeEdges: false, - includeLabels: false - }); - if (boundingBoxesIntersect(boxBb, nodeBb) && !boundingBoxInBoundingBox(nodeBb, boxBb)) { - box.push(node2); - } + 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 (containerWindow.devicePixelRatio || 1) / backingStore; + }; + CRp$4.paintCache = function(context) { + var caches = this.paintCaches = this.paintCaches || []; + var needToCreateCache = true; + var cache3; + for (var i2 = 0; i2 < caches.length; i2++) { + cache3 = caches[i2]; + if (cache3.context === context) { + needToCreateCache = false; + break; + } + } + if (needToCreateCache) { + cache3 = { + context + }; + caches.push(cache3); + } + return cache3; + }; + CRp$4.createGradientStyleFor = function(context, shapeStyleName, ele, fill, opacity) { + var gradientStyle; + var usePaths = this.usePaths(); + 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 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 edge = ele; - var _p = edge._private; - var rs = _p.rscratch; - if (rs.startX != null && rs.startY != null && !inBoundingBox(boxBb, rs.startX, rs.startY)) { - continue; - } - if (rs.endX != null && rs.endY != null && !inBoundingBox(boxBb, rs.endX, rs.endY)) { - continue; - } - 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])) { - allInside = false; - break; - } - } - if (allInside) { - box.push(edge); - } - } else if (rs.edgeType === "haystack" || rs.edgeType === "straight") { - box.push(edge); + var pos = usePaths ? { + x: 0, + y: 0 + } : 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()) { + var _start = ele.sourceEndpoint(), _end = ele.targetEndpoint(); + gradientStyle = context.createLinearGradient(_start.x, _start.y, _end.x, _end.y); + } else { + var _pos = usePaths ? { + x: 0, + y: 0 + } : ele.position(), _width = ele.paddedWidth(), _height = ele.paddedHeight(), halfWidth = _width / 2, halfHeight = _height / 2; + 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; + case "to-top": + gradientStyle = context.createLinearGradient(_pos.x, _pos.y + halfHeight, _pos.x, _pos.y - halfHeight); + break; + case "to-left": + gradientStyle = context.createLinearGradient(_pos.x + halfWidth, _pos.y, _pos.x - halfWidth, _pos.y); + break; + case "to-right": + gradientStyle = context.createLinearGradient(_pos.x - halfWidth, _pos.y, _pos.x + halfWidth, _pos.y); + break; + case "to-bottom-right": + case "to-right-bottom": + gradientStyle = context.createLinearGradient(_pos.x - halfWidth, _pos.y - halfHeight, _pos.x + halfWidth, _pos.y + halfHeight); + break; + case "to-top-right": + case "to-right-top": + gradientStyle = context.createLinearGradient(_pos.x - halfWidth, _pos.y + halfHeight, _pos.x + halfWidth, _pos.y - halfHeight); + break; + case "to-bottom-left": + case "to-left-bottom": + gradientStyle = context.createLinearGradient(_pos.x + halfWidth, _pos.y - halfHeight, _pos.x - halfWidth, _pos.y + halfHeight); + break; + case "to-top-left": + case "to-left-top": + gradientStyle = context.createLinearGradient(_pos.x + halfWidth, _pos.y + halfHeight, _pos.x - halfWidth, _pos.y - halfHeight); + break; } } } - return box; + 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; }; - var BRp$d = {}; - BRp$d.calculateArrowAngles = function(edge) { - var rs = edge._private.rscratch; - var isHaystack = rs.edgeType === "haystack"; - var isBezier = rs.edgeType === "bezier"; - var isMultibezier = rs.edgeType === "multibezier"; - var isSegments = rs.edgeType === "segments"; - var isCompound = rs.edgeType === "compound"; - var isSelf = rs.edgeType === "self"; - var dispX, dispY; - var startX, startY, endX, endY, midX, midY; - if (isHaystack) { - startX = rs.haystackPts[0]; - startY = rs.haystackPts[1]; - endX = rs.haystackPts[2]; - endY = rs.haystackPts[3]; + CRp$4.gradientFillStyle = function(context, ele, fill, opacity) { + var gradientStyle = this.createGradientStyleFor(context, "background", ele, fill, opacity); + if (!gradientStyle) return null; + context.fillStyle = gradientStyle; + }; + 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; + if (backgroundFill === "linear-gradient" || backgroundFill === "radial-gradient") { + this.gradientFillStyle(context, ele, backgroundFill, opacity); } else { - startX = rs.arrowStartX; - startY = rs.arrowStartY; - endX = rs.arrowEndX; - endY = rs.arrowEndY; + var backgroundColor = ele.pstyle("background-color").value; + this.colorFillStyle(context, backgroundColor[0], backgroundColor[1], backgroundColor[2], opacity); } - midX = rs.midX; - midY = rs.midY; - if (isSegments) { - dispX = startX - rs.segpts[0]; - dispY = startY - 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; + }; + CRp$4.gradientStrokeStyle = function(context, ele, fill, opacity) { + var gradientStyle = this.createGradientStyleFor(context, "line", ele, fill, opacity); + if (!gradientStyle) return null; + context.strokeStyle = gradientStyle; + }; + 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; + if (lineFill === "linear-gradient" || lineFill === "radial-gradient") { + this.gradientStrokeStyle(context, ele, lineFill, opacity); } else { - dispX = startX - midX; - dispY = startY - midY; + var lineColor = ele.pstyle("line-color").value; + this.colorStrokeStyle(context, lineColor[0], lineColor[1], lineColor[2], opacity); } - rs.srcArrowAngle = getAngleFromDisp(dispX, dispY); - var midX = rs.midX; - var midY = rs.midY; - if (isHaystack) { - midX = (startX + endX) / 2; - midY = (startY + endY) / 2; + }; + 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 = width3 * pixelRatio; + var canvasHeight = height2 * pixelRatio; + var canvas; + if (canvasWidth === r2.canvasWidth && canvasHeight === r2.canvasHeight) { + return; + } + 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 = width3 + "px"; + canvas.style.height = height2 + "px"; + } + for (var i2 = 0; i2 < r2.BUFFER_COUNT; i2++) { + canvas = data5.bufferCanvases[i2]; + canvas.width = canvasWidth; + canvas.height = canvasHeight; + canvas.style.width = width3 + "px"; + canvas.style.height = height2 + "px"; + } + r2.textureMult = 1; + if (pixelRatio <= 1) { + canvas = data5.bufferCanvases[r2.TEXTURE_BUFFER]; + r2.textureMult = 2; + canvas.width = canvasWidth * r2.textureMult; + canvas.height = canvasHeight * r2.textureMult; + } + r2.canvasWidth = canvasWidth; + r2.canvasHeight = canvasHeight; + }; + CRp$4.renderTo = function(cxt, zoom2, pan2, pxRatio) { + this.render({ + forcedContext: cxt, + forcedZoom: zoom2, + forcedPan: pan2, + drawAllLayers: true, + forcedPxRatio: pxRatio + }); + }; + 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 (r2.prevPxRatio !== pixelRatio) { + r2.invalidateContainerClientCoordsCache(); + r2.matchCanvasSize(r2.container); + r2.redrawHint("eles", true); + r2.redrawHint("drag", true); + } + r2.prevPxRatio = pixelRatio; + } + if (!forcedContext && r2.motionBlurTimeout) { + clearTimeout(r2.motionBlurTimeout); + } + if (motionBlur) { + if (r2.mbFrames == null) { + r2.mbFrames = 0; + } + r2.mbFrames++; + if (r2.mbFrames < 3) { + motionBlurFadeEffect = false; + } + if (r2.mbFrames > r2.minMbLowQualFrames) { + r2.motionBlurPxRatio = r2.mbPxRBlurry; + } + } + if (r2.clearingMotionBlur) { + r2.motionBlurPxRatio = 1; + } + if (r2.textureDrawLastFrame && !textureDraw) { + needDraw[r2.NODE] = true; + needDraw[r2.SELECT_BOX] = true; + } + var style3 = cy.style(); + var zoom2 = cy.zoom(); + var effectiveZoom = forcedZoom !== void 0 ? forcedZoom : zoom2; + var pan2 = cy.pan(); + var effectivePan = { + x: pan2.x, + y: pan2.y + }; + var vp = { + zoom: zoom2, + pan: { + x: pan2.x, + y: pan2.y + } + }; + 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 && !hasCompoundNodes2)) { + r2.motionBlurPxRatio = 1; + } + if (forcedPan) { + effectivePan = forcedPan; + } + effectiveZoom *= pixelRatio; + effectivePan.x *= pixelRatio; + effectivePan.y *= pixelRatio; + var eles = r2.getCachedZSortedEles(); + function mbclear(context2, x5, y5, w3, h2) { + var gco = context2.globalCompositeOperation; + context2.globalCompositeOperation = "destination-out"; + r2.colorFillStyle(context2, 255, 255, 255, r2.motionBlurTransparency); + context2.fillRect(x5, y5, w3, h2); + context2.globalCompositeOperation = gco; + } + __name(mbclear, "mbclear"); + function setContextTransform(context2, clear31) { + var ePan, eZoom, w3, h2; + if (!r2.clearingMotionBlur && (context2 === data5.bufferContexts[r2.MOTIONBLUR_BUFFER_NODE] || context2 === data5.bufferContexts[r2.MOTIONBLUR_BUFFER_DRAG])) { + ePan = { + x: pan2.x * mbPxRatio, + y: pan2.y * mbPxRatio + }; + eZoom = zoom2 * mbPxRatio; + w3 = r2.canvasWidth * mbPxRatio; + h2 = r2.canvasHeight * mbPxRatio; + } else { + ePan = effectivePan; + eZoom = effectiveZoom; + w3 = r2.canvasWidth; + h2 = r2.canvasHeight; + } + context2.setTransform(1, 0, 0, 1, 0, 0); + if (clear31 === "motionBlur") { + mbclear(context2, 0, 0, w3, h2); + } else if (!forcedContext && (clear31 === void 0 || clear31)) { + context2.clearRect(0, 0, w3, h2); + } + if (!drawAllLayers) { + context2.translate(ePan.x, ePan.y); + context2.scale(eZoom, eZoom); + } + if (forcedPan) { + context2.translate(forcedPan.x, forcedPan.y); + } + if (forcedZoom) { + context2.scale(forcedZoom, forcedZoom); + } + } + __name(setContextTransform, "setContextTransform"); + if (!textureDraw) { + r2.textureDrawLastFrame = false; + } + if (textureDraw) { + 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, r2.canvasWidth * r2.textureMult, r2.canvasHeight * r2.textureMult); + r2.render({ + forcedContext: cxt, + drawOnlyNodeLayer: true, + forcedPxRatio: pixelRatio * r2.textureMult + }); + var vp = r2.textureCache.viewport = { + zoom: cy.zoom(), + pan: cy.pan(), + width: r2.canvasWidth, + height: r2.canvasHeight + }; + vp.mpan = { + x: (0 - vp.pan.x) / vp.zoom, + y: (0 - vp.pan.y) / vp.zoom + }; + } + 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 = 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 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 (r2.textureOnViewport && !forcedContext) { + r2.textureCache = null; } - dispX = endX - startX; - dispY = endY - startY; - 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 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[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 clear30 = motionBlur && !useBuffer ? "motionBlur" : void 0; + setContextTransform(context, clear30); + if (hideEdges) { + r2.drawCachedNodes(context, eles.nondrag, pixelRatio, extent2); } 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]; + r2.drawLayeredElements(context, eles.nondrag, pixelRatio, extent2); } - } else if (isMultibezier || isCompound || isSelf) { - var pts2 = rs.allpts; - var cpts = rs.ctrlpts; - var bp0x, bp0y; - var bp1x, bp1y; - if (cpts.length / 2 % 2 === 0) { - var p0 = pts2.length / 2 - 1; - var ic = p0 + 2; - var p1 = ic + 2; - bp0x = qbezierAt(pts2[p0], pts2[ic], pts2[p1], 0); - bp0y = qbezierAt(pts2[p0 + 1], pts2[ic + 1], pts2[p1 + 1], 0); - bp1x = qbezierAt(pts2[p0], pts2[ic], pts2[p1], 1e-4); - bp1y = qbezierAt(pts2[p0 + 1], pts2[ic + 1], pts2[p1 + 1], 1e-4); + if (r2.debug) { + r2.drawDebugPoints(context, eles.nondrag); + } + if (!drawAllLayers && !motionBlur) { + needDraw[r2.NODE] = false; + } + } + 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) { + r2.drawCachedNodes(context, eles.drag, pixelRatio, extent2); } else { - var ic = pts2.length / 2 - 1; - var p0 = ic - 2; - var p1 = ic + 2; - bp0x = qbezierAt(pts2[p0], pts2[ic], pts2[p1], 0.4999); - bp0y = qbezierAt(pts2[p0 + 1], pts2[ic + 1], pts2[p1 + 1], 0.4999); - bp1x = qbezierAt(pts2[p0], pts2[ic], pts2[p1], 0.5); - bp1y = qbezierAt(pts2[p0 + 1], pts2[ic + 1], pts2[p1 + 1], 0.5); + r2.drawCachedElements(context, eles.drag, pixelRatio, extent2); + } + if (r2.debug) { + r2.drawDebugPoints(context, eles.drag); + } + if (!drawAllLayers && !motionBlur) { + needDraw[r2.DRAG] = false; } - dispX = bp1x - bp0x; - dispY = bp1y - bp0y; } - rs.midtgtArrowAngle = getAngleFromDisp(dispX, dispY); - rs.midDispX = dispX; - rs.midDispY = dispY; - dispX *= -1; - 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 (r2.showFps || !drawOnlyNodeLayer && needDraw[r2.SELECT_BOX] && !drawAllLayers) { + var context = forcedContext || data5.contexts[r2.SELECT_BOX]; + setContextTransform(context); + 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(" + 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(" + 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 (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, style3.core("active-bg-size").pfValue / zoom2, 0, 2 * Math.PI); + context.fill(); + } + 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); + context.fillStyle = "rgba(255, 0, 0, 0.75)"; + context.strokeStyle = "rgba(255, 0, 0, 0.75)"; + context.lineWidth = 1; + context.fillText("1 frame = " + timeToRender + " ms = " + fps + " fps", 0, 20); + var maxFps = 60; + context.strokeRect(0, 30, 250, 20); + context.fillRect(0, 30, 250 * Math.min(fps / maxFps, 1), 20); + } + if (!drawAllLayers) { + needDraw[r2.SELECT_BOX] = false; } } - rs.midsrcArrowAngle = getAngleFromDisp(dispX, dispY); - if (isSegments) { - dispX = endX - rs.segpts[rs.segpts.length - 2]; - 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); - dispX = endX - bX; - dispY = endY - bY; - } else { - dispX = endX - midX; - dispY = endY - midY; + if (motionBlur && mbPxRatio !== 1) { + 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, r2.canvasWidth, r2.canvasHeight); + } else { + mbclear(cxt2, 0, 0, r2.canvasWidth, r2.canvasHeight); + } + var pxr = mbPxRatio; + cxt2.drawImage( + txt, + // img + 0, + 0, + // sx, sy + r2.canvasWidth * pxr, + r2.canvasHeight * pxr, + // sw, sh + 0, + 0, + // x, y + r2.canvasWidth, + r2.canvasHeight + // w, h + ); + }, "drawMotionBlur"); + if (needDraw[r2.NODE] || needMbClear[r2.NODE]) { + drawMotionBlur(cxtNode, txtNode, needMbClear[r2.NODE]); + needDraw[r2.NODE] = false; + } + if (needDraw[r2.DRAG] || needMbClear[r2.DRAG]) { + drawMotionBlur(cxtDrag, txtDrag, needMbClear[r2.DRAG]); + needDraw[r2.DRAG] = false; + } } - 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]; - if (cachedVal) { - return cachedVal; + r2.prevViewport = vp; + if (r2.clearingMotionBlur) { + r2.clearingMotionBlur = false; + r2.motionBlurCleared = true; + r2.motionBlur = true; } - cachedVal = Math.max(Math.pow(edgeWidth * 13.37, 0.9), 29) * scale; - cache2[edgeWidth + ", " + scale] = cachedVal; - return cachedVal; - }; - var BRp$c = {}; - BRp$c.findHaystackPoints = function(edges2) { - for (var i3 = 0; i3 < edges2.length; i3++) { - var edge = edges2[i3]; - var _p = edge._private; - var rs = _p.rscratch; - if (!rs.haystack) { - var angle = Math.random() * 2 * Math.PI; - rs.source = { - x: Math.cos(angle), - y: Math.sin(angle) - }; - angle = Math.random() * 2 * Math.PI; - rs.target = { - x: Math.cos(angle), - y: Math.sin(angle) - }; - } - var src = _p.source; - var tgt = _p.target; - var srcPos = src.position(); - var tgtPos = tgt.position(); - var srcW = src.width(); - var tgtW = tgt.width(); - var srcH = src.height(); - var tgtH = tgt.height(); - var radius = edge.pstyle("haystack-radius").value; - var halfRadius = radius / 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; - rs.edgeType = "haystack"; - rs.haystack = true; - this.storeEdgeProjections(edge); - this.calculateArrowAngles(edge); - this.recalculateEdgeLabelProjections(edge); - this.calculateLabelAngles(edge); + if (motionBlur) { + 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); } - }; - BRp$c.findSegmentsPoints = function(edge, pairInfo) { - var rs = edge._private.rscratch; - var posPts = pairInfo.posPts, intersectionPts = pairInfo.intersectionPts, vectorNormInverse = pairInfo.vectorNormInverse; - var edgeDistances = edge.pstyle("edge-distances").value; - var segmentWs = edge.pstyle("segment-weights"); - var segmentDs = edge.pstyle("segment-distances"); - var segmentsN = Math.min(segmentWs.pfValue.length, segmentDs.pfValue.length); - 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; - var midptPts = edgeDistances === "node-position" ? posPts : intersectionPts; - 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); + if (!forcedContext) { + cy.emit("render"); } }; - BRp$c.findLoopPoints = function(edge, pairInfo, i3, edgeIsUnbundled) { - var rs = edge._private.rscratch; - var dirCounts = pairInfo.dirCounts, srcPos = pairInfo.srcPos; - var ctrlptDists = edge.pstyle("control-point-distances"); - var ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[0] : void 0; - var loopDir = edge.pstyle("loop-direction").pfValue; - var loopSwp = edge.pstyle("loop-sweep").pfValue; - var stepSize = edge.pstyle("control-point-step-size").pfValue; - rs.edgeType = "self"; - var j = i3; - var loopDist = stepSize; - if (edgeIsUnbundled) { - j = 0; - loopDist = ctrlptDist; + 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(); } - 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)]; + 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(); }; - BRp$c.findCompoundLoopPoints = function(edge, pairInfo, i3, 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 loopDist = stepSize; - if (edgeIsUnbundled) { - j = 0; - loopDist = ctrlptDist; + 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, 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(); } - var loopW = 50; - var loopaPos = { - x: srcPos.x - srcW / 2, - y: srcPos.y - srcH / 2 - }; - var loopbPos = { - x: tgtPos.x - tgtW / 2, - y: tgtPos.y - tgtH / 2 - }; - var loopPos = { - x: Math.min(loopaPos.x, loopbPos.x), - y: Math.min(loopaPos.y, loopbPos.y) - }; - 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]; + 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(); }; - BRp$c.findStraightEdgePoints = function(edge) { - edge._private.rscratch.edgeType = "straight"; + 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(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(); }; - BRp$c.findBezierPoints = function(edge, pairInfo, i3, edgeIsUnbundled, edgeIsSwapped) { - var rs = edge._private.rscratch; - var vectorNormInverse = pairInfo.vectorNormInverse, posPts = pairInfo.posPts, intersectionPts = pairInfo.intersectionPts; - var edgeDistances = edge.pstyle("edge-distances").value; - var stepSize = edge.pstyle("control-point-step-size").pfValue; - var ctrlptDists = edge.pstyle("control-point-distances"); - var ctrlptWs = edge.pstyle("control-point-weights"); - var bezierN = ctrlptDists && ctrlptWs ? Math.min(ctrlptDists.value.length, ctrlptWs.value.length) : 1; - var ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[0] : void 0; - var ctrlptWeight = ctrlptWs.value[0]; - 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); - var manctrlptDist = void 0; - var sign2 = signum(normctrlptDist); - if (multi) { - ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[b] : stepSize; - ctrlptWeight = ctrlptWs.value[b]; - } - if (edgeIsUnbundled) { - manctrlptDist = ctrlptDist; - } else { - manctrlptDist = ctrlptDist !== void 0 ? sign2 * ctrlptDist : void 0; - } - var distanceFromMidpoint = manctrlptDist !== void 0 ? manctrlptDist : normctrlptDist; - var w1 = 1 - ctrlptWeight; - var w2 = ctrlptWeight; - var midptPts = edgeDistances === "node-position" ? posPts : intersectionPts; - var adjustedMidpt = { - x: midptPts.x1 * w1 + midptPts.x2 * w2, - y: midptPts.y1 * w1 + midptPts.y2 * w2 - }; - rs.ctrlpts.push(adjustedMidpt.x + vectorNormInverse.x * distanceFromMidpoint, adjustedMidpt.y + vectorNormInverse.y * distanceFromMidpoint); + 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(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(); }; - BRp$c.findTaxiPoints = function(edge, pairInfo) { - var rs = edge._private.rscratch; - rs.edgeType = "segments"; - var VERTICAL = "vertical"; - var HORIZONTAL = "horizontal"; - var LEFTWARD = "leftward"; - var RIGHTWARD = "rightward"; - var DOWNWARD = "downward"; - var UPWARD = "upward"; - var AUTO = "auto"; - var posPts = pairInfo.posPts, srcW = pairInfo.srcW, srcH = pairInfo.srcH, tgtW = pairInfo.tgtW, tgtH = pairInfo.tgtH; - var edgeDistances = edge.pstyle("edge-distances").value; - var dIncludesNodeBody = edgeDistances !== "node-position"; - var taxiDir = edge.pstyle("taxi-direction").value; - var rawTaxiDir = taxiDir; - var taxiTurn = edge.pstyle("taxi-turn"); - var turnIsPercent = taxiTurn.units === "%"; - var taxiTurnPfVal = taxiTurn.pfValue; - var turnIsNegative = taxiTurnPfVal < 0; - var minD = edge.pstyle("taxi-turn-min-distance").pfValue; - var dw = dIncludesNodeBody ? (srcW + tgtW) / 2 : 0; - 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) { - if (dxy > 0) { - return Math.max(dxy - dwh, 0); - } else { - return Math.min(dxy + dwh, 0); - } - }; - var dx = subDWH(pdx, dw); - var dy = subDWH(pdy, dh); - var isExplicitDir = false; - if (rawTaxiDir === AUTO) { - taxiDir = Math.abs(dx) > Math.abs(dy) ? HORIZONTAL : VERTICAL; - } else if (rawTaxiDir === UPWARD || rawTaxiDir === DOWNWARD) { - taxiDir = VERTICAL; - isExplicitDir = true; - } else if (rawTaxiDir === LEFTWARD || rawTaxiDir === RIGHTWARD) { - taxiDir = HORIZONTAL; - isExplicitDir = true; + 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; + if (context.beginPath) { + context.beginPath(); } - var isVert = taxiDir === VERTICAL; - var l = 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); - forcedDir = true; + context.moveTo(xBegin, yBegin + hOffset); + context.lineTo(xBegin, yEnd - hOffset); + context.quadraticCurveTo(xBegin + ctrlPtXOffset, yEnd, xBegin + wOffset, yEnd); + context.lineTo(xEnd - wOffset, yEnd); + context.quadraticCurveTo(xEnd - ctrlPtXOffset, yEnd, xEnd, yEnd - hOffset); + context.lineTo(xEnd, yBegin + hOffset); + context.quadraticCurveTo(xEnd - ctrlPtXOffset, yBegin, xEnd - wOffset, yBegin); + context.lineTo(xBegin + wOffset, yBegin); + context.quadraticCurveTo(xBegin + ctrlPtXOffset, yBegin, xBegin, yBegin + hOffset); + context.closePath(); + }; + 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, width3, height2) { + if (context.beginPath) { + context.beginPath(); } - var d; - if (turnIsPercent) { - var p2 = taxiTurnPfVal < 0 ? 1 + taxiTurnPfVal : taxiTurnPfVal; - d = p2 * l; + if (context.ellipse) { + context.ellipse(centerX, centerY, width3 / 2, height2 / 2, 0, 0, 2 * Math.PI); } 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 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]; - } else if (lShapeInsideTgt) { - var y3 = (posPts.y1 + posPts.y2) / 2; - var x1 = posPts.x1, x22 = posPts.x2; - rs.segpts = [x1, y3, x22, y3]; - } else { - rs.segpts = [posPts.x1, posPts.y2]; - } - } else { - var _lShapeInsideSrc = Math.abs(pl) <= srcW / 2; - var _lShapeInsideTgt = Math.abs(pdy) <= tgtH / 2; - if (_lShapeInsideSrc) { - var _y = (posPts.y1 + posPts.y2) / 2; - var _x = posPts.x1, _x2 = posPts.x2; - rs.segpts = [_x, _y, _x2, _y]; - } else if (_lShapeInsideTgt) { - var _x3 = (posPts.x1 + posPts.x2) / 2; - var _y2 = posPts.y1, _y3 = posPts.y2; - rs.segpts = [_x3, _y2, _x3, _y3]; + var xPos, yPos; + 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 { - rs.segpts = [posPts.x2, posPts.y1]; + context.lineTo(xPos, yPos); } } - } else { - if (isVert) { - var _y4 = posPts.y1 + d + (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 _y5 = posPts.y1, _y6 = posPts.y2; - rs.segpts = [_x6, _y5, _x6, _y6]; - } } + context.closePath(); }; - 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 minCpADistFactor = 3; - var arrowW = this.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.arrowShapeWidth; - var minCpADist = minCpADistFactor * arrowW; - var startACpDist = dist2({ - x: rs.ctrlpts[0], - y: rs.ctrlpts[1] - }, { - x: rs.startX, - y: rs.startY - }); - var closeStartACp = startACpDist < minCpADist; - var endACpDist = dist2({ - x: rs.ctrlpts[0], - y: rs.ctrlpts[1] - }, { - x: rs.endX, - y: rs.endY - }); - var closeEndACp = endACpDist < minCpADist; - var overlapping = false; - if (badStart || badAStart || closeStartACp) { - overlapping = true; - var cpD = { - // delta - x: rs.ctrlpts[0] - srcPos.x, - y: rs.ctrlpts[1] - srcPos.y - }; - var cpL = Math.sqrt(cpD.x * cpD.x + cpD.y * cpD.y); - var cpM = { - // normalised delta - x: cpD.x / cpL, - y: cpD.y / cpL - }; - var radius = 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 - }; - var srcCtrlPtIntn = srcShape.intersectLine(srcPos.x, srcPos.y, srcW, srcH, cpProj.x, cpProj.y, 0); - if (closeStartACp) { - rs.ctrlpts[0] = rs.ctrlpts[0] + cpM.x * (minCpADist - startACpDist); - rs.ctrlpts[1] = rs.ctrlpts[1] + cpM.y * (minCpADist - startACpDist); - } else { - rs.ctrlpts[0] = srcCtrlPtIntn[0] + cpM.x * minCpADist; - rs.ctrlpts[1] = srcCtrlPtIntn[1] + cpM.y * minCpADist; - } + CRp$2 = {}; + CRp$2.createBuffer = function(w3, h2) { + var buffer = document.createElement("canvas"); + buffer.width = w3; + buffer.height = h2; + return [buffer, buffer.getContext("2d")]; + }; + CRp$2.bufferCanvasImage = function(options3) { + var cy = this.cy; + var eles = cy.mutableElements(); + var bb = eles.boundingBox(); + var ctrRect = this.findContainerClientCoords(); + 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 (options3.scale !== void 0) { + width3 *= options3.scale; + height2 *= options3.scale; + scale = options3.scale; + } else if (specdMaxDims) { + var maxScaleW = Infinity; + var maxScaleH = Infinity; + if (number$1(options3.maxWidth)) { + maxScaleW = scale * options3.maxWidth / width3; } - if (badEnd || badAEnd || closeEndACp) { - overlapping = true; - var _cpD = { - // delta - x: rs.ctrlpts[0] - tgtPos.x, - y: rs.ctrlpts[1] - tgtPos.y - }; - var _cpL = Math.sqrt(_cpD.x * _cpD.x + _cpD.y * _cpD.y); - var _cpM = { - // normalised delta - x: _cpD.x / _cpL, - y: _cpD.y / _cpL - }; - var _radius = 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 + if (number$1(options3.maxHeight)) { + maxScaleH = scale * options3.maxHeight / height2; + } + scale = Math.min(maxScaleW, maxScaleH); + width3 *= scale; + height2 *= scale; + } + if (!specdMaxDims) { + width3 *= pxRatio; + height2 *= pxRatio; + scale *= pxRatio; + } + var buffCanvas = document.createElement("canvas"); + buffCanvas.width = width3; + buffCanvas.height = height2; + buffCanvas.style.width = width3 + "px"; + buffCanvas.style.height = height2 + "px"; + var buffCxt = buffCanvas.getContext("2d"); + if (width3 > 0 && height2 > 0) { + buffCxt.clearRect(0, 0, width3, height2); + buffCxt.globalCompositeOperation = "source-over"; + var zsortedEles = this.getCachedZSortedEles(); + 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 pan2 = cy.pan(); + var translation = { + x: pan2.x * scale, + y: pan2.y * scale }; - var tgtCtrlPtIntn = tgtShape.intersectLine(tgtPos.x, tgtPos.y, tgtW, tgtH, _cpProj.x, _cpProj.y, 0); - if (closeEndACp) { - rs.ctrlpts[0] = rs.ctrlpts[0] + _cpM.x * (minCpADist - endACpDist); - rs.ctrlpts[1] = rs.ctrlpts[1] + _cpM.y * (minCpADist - endACpDist); - } else { - rs.ctrlpts[0] = tgtCtrlPtIntn[0] + _cpM.x * minCpADist; - rs.ctrlpts[1] = tgtCtrlPtIntn[1] + _cpM.y * minCpADist; - } + scale *= cy.zoom(); + buffCxt.translate(translation.x, translation.y); + buffCxt.scale(scale, scale); + this.drawElements(buffCxt, zsortedEles); + buffCxt.scale(1 / scale, 1 / scale); + buffCxt.translate(-translation.x, -translation.y); } - if (overlapping) { - this.findEndpoints(edge); + if (options3.bg) { + buffCxt.globalCompositeOperation = "destination-over"; + buffCxt.fillStyle = options3.bg; + buffCxt.rect(0, 0, width3, height2); + buffCxt.fill(); } } + return buffCanvas; + }; + __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(options3) { + return output(options3, this.bufferCanvasImage(options3), "image/jpeg"); + }; + CRp$1 = {}; + CRp$1.nodeShapeImpl = function(name, context, centerX, centerY, width3, height2, points, corners) { + switch (name) { + case "ellipse": + return this.drawEllipsePath(context, centerX, centerY, width3, height2); + case "polygon": + return this.drawPolygonPath(context, centerX, centerY, width3, height2, points); + case "round-polygon": + return this.drawRoundPolygonPath(context, centerX, centerY, width3, height2, points, corners); + case "roundrectangle": + case "round-rectangle": + return this.drawRoundRectanglePath(context, centerX, centerY, width3, height2, corners); + case "cutrectangle": + case "cut-rectangle": + return this.drawCutRectanglePath(context, centerX, centerY, width3, height2, points, corners); + case "bottomroundrectangle": + case "bottom-round-rectangle": + return this.drawBottomRoundRectanglePath(context, centerX, centerY, width3, height2, corners); + case "barrel": + return this.drawBarrelPath(context, centerX, centerY, width3, height2); + } + }; + CR = CanvasRenderer; + CRp = CanvasRenderer.prototype; + CRp.CANVAS_LAYERS = 3; + CRp.SELECT_BOX = 0; + CRp.DRAG = 1; + CRp.NODE = 2; + CRp.BUFFER_COUNT = 3; + CRp.TEXTURE_BUFFER = 0; + CRp.MOTIONBLUR_BUFFER_NODE = 1; + CRp.MOTIONBLUR_BUFFER_DRAG = 2; + __name(CanvasRenderer, "CanvasRenderer"); + CRp.redrawHint = function(group2, bool2) { + var r2 = this; + switch (group2) { + case "eles": + r2.data.canvasNeedsRedraw[CRp.NODE] = bool2; + break; + case "drag": + r2.data.canvasNeedsRedraw[CRp.DRAG] = bool2; + break; + case "select": + r2.data.canvasNeedsRedraw[CRp.SELECT_BOX] = bool2; + break; + } + }; + pathsImpld = typeof Path2D !== "undefined"; + CRp.path2dEnabled = function(on3) { + if (on3 === void 0) { + return this.pathsEnabled; + } + this.pathsEnabled = on3 ? true : false; + }; + CRp.usePaths = function() { + return pathsImpld && this.pathsEnabled; + }; + CRp.setImgSmoothing = function(context, bool2) { + if (context.imageSmoothingEnabled != null) { + context.imageSmoothingEnabled = bool2; + } else { + context.webkitImageSmoothingEnabled = bool2; + context.mozImageSmoothingEnabled = bool2; + context.msImageSmoothingEnabled = bool2; + } }; - BRp$c.storeAllpts = function(edge) { - var rs = edge._private.rscratch; - 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); - } - } - rs.allpts.push(rs.endX, rs.endY); - var m, 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]; - } else { - m = 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); - } - } else if (rs.edgeType === "straight") { - rs.allpts = [rs.startX, rs.startY, rs.endX, rs.endY]; - rs.midX = (rs.startX + rs.endX + rs.arrowStartX + rs.arrowEndX) / 4; - rs.midY = (rs.startY + rs.endY + rs.arrowStartY + rs.arrowEndY) / 4; - } else if (rs.edgeType === "segments") { - rs.allpts = []; - rs.allpts.push(rs.startX, rs.startY); - rs.allpts.push.apply(rs.allpts, rs.segpts); - rs.allpts.push(rs.endX, rs.endY); - 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 _i = rs.segpts.length / 2 - 1; - rs.midX = rs.segpts[_i]; - rs.midY = rs.segpts[_i + 1]; - } + CRp.getImgSmoothing = function(context) { + if (context.imageSmoothingEnabled != null) { + return context.imageSmoothingEnabled; + } else { + return context.webkitImageSmoothingEnabled || context.mozImageSmoothingEnabled || context.msImageSmoothingEnabled; } }; - 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)) { - rs.loggedErr = false; + CRp.makeOffscreenCanvas = function(width3, height2) { + var canvas; + if ((typeof OffscreenCanvas === "undefined" ? "undefined" : _typeof(OffscreenCanvas)) !== "undefined") { + canvas = new OffscreenCanvas(width3, height2); } else { - if (!rs.loggedErr) { - rs.loggedErr = true; - warn("Edge `" + edge.id() + "` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."); - } + var containerWindow = this.cy.window(); + var document2 = containerWindow.document; + canvas = document2.createElement("canvas"); + canvas.width = width3; + canvas.height = height2; } + return canvas; }; - BRp$c.findEdgeControlPoints = function(edges2) { - var _this = this; - if (!edges2 || edges2.length === 0) { - return; + [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); + }); + renderer5 = [{ + name: "null", + impl: NullRenderer + }, { + name: "base", + impl: BR + }, { + name: "canvas", + impl: CR + }]; + incExts = [{ + type: "layout", + extensions: layout4 + }, { + type: "renderer", + extensions: renderer5 + }]; + 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) { + return setExtension.apply(null, arguments); + } else if (arguments.length === 4) { + return getModule.apply(null, arguments); + } else if (arguments.length === 5) { + return setModule.apply(null, arguments); + } else { + error("Invalid extension access syntax"); } - var r = this; - var cy = r.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]); - } else { - return null; + }, "extension"); + Core.prototype.extension = extension3; + incExts.forEach(function(group2) { + group2.extensions.forEach(function(ext) { + setExtension(group2.type, ext.name, ext.impl); + }); + }); + Stylesheet = /* @__PURE__ */ __name(function Stylesheet2() { + if (!(this instanceof Stylesheet2)) { + return new Stylesheet2(); + } + this.length = 0; + }, "Stylesheet"); + sheetfn = Stylesheet.prototype; + sheetfn.instanceString = function() { + return "stylesheet"; + }; + sheetfn.selector = function(selector) { + var i2 = this.length++; + this[i2] = { + selector, + properties: [] + }; + return this; + }; + sheetfn.css = function(name, value2) { + var i2 = this.length - 1; + if (string(name)) { + this[i2].properties.push({ + name, + value: value2 + }); + } else if (plainObject(name)) { + 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; } - }, - 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); + var prop = Style2.properties[key] || Style2.properties[dash2camel(key)]; + if (prop == null) { + continue; } - map2.set(pairId2[1], val); - } - }; - var pairIds = []; - var haystackEdges = []; - for (var i3 = 0; i3 < edges2.length; i3++) { - var edge = edges2[i3]; - var _p = edge._private; - var curveStyle = edge.pstyle("curve-style").value; - if (edge.removed() || !edge.takesUpSpace()) { - continue; - } - if (curveStyle === "haystack") { - haystackEdges.push(edge); - continue; - } - var edgeIsUnbundled = curveStyle === "unbundled-bezier" || curveStyle === "segments" || curveStyle === "straight" || curveStyle === "straight-triangle" || curveStyle === "taxi"; - var edgeIsBezier = curveStyle === "unbundled-bezier" || curveStyle === "bezier"; - var src = _p.source; - var tgt = _p.target; - var srcIndex = src.poolIndex(); - var tgtIndex = tgt.poolIndex(); - var pairId = [srcIndex, tgtIndex].sort(); - var tableEntry = hashTable.get(pairId); - if (tableEntry == null) { - tableEntry = { - eles: [] - }; - hashTable.set(pairId, tableEntry); - pairIds.push(pairId); - } - tableEntry.eles.push(edge); - if (edgeIsUnbundled) { - tableEntry.hasUnbundled = true; - } - if (edgeIsBezier) { - tableEntry.hasBezier = true; - } - } - var _loop = function _loop2(p3) { - var pairId2 = pairIds[p3]; - var pairInfo = hashTable.get(pairId2); - var swappedpairInfo = void 0; - if (!pairInfo.hasUnbundled) { - var pllEdges = pairInfo.eles[0].parallelEdges().filter(function(e) { - return e.isBundledBezier(); - }); - clearArray(pairInfo.eles); - pllEdges.forEach(function(edge2) { - return pairInfo.eles.push(edge2); - }); - pairInfo.eles.sort(function(edge1, edge2) { - return edge1.poolIndex() - edge2.poolIndex(); + var _name = prop.name; + var _value = mapVal; + this[i2].properties.push({ + name: _name, + value: _value }); } - var firstEdge = pairInfo.eles[0]; - var src2 = firstEdge.source(); - var tgt2 = firstEdge.target(); - if (src2.poolIndex() > tgt2.poolIndex()) { - var temp = src2; - src2 = tgt2; - tgt2 = temp; + } + return this; + }; + sheetfn.style = sheetfn.css; + sheetfn.generateStyle = function(cy) { + var style3 = new Style2(cy); + return this.appendToStyle(style3); + }; + sheetfn.appendToStyle = function(style3) { + for (var i2 = 0; i2 < this.length; i2++) { + var context = this[i2]; + var selector = context.selector; + var props = context.properties; + style3.selector(selector); + for (var j2 = 0; j2 < props.length; j2++) { + var prop = props[j2]; + style3.css(prop.name, prop.value); } - var srcPos = pairInfo.srcPos = src2.position(); - var tgtPos = pairInfo.tgtPos = tgt2.position(); - var srcW = pairInfo.srcW = src2.outerWidth(); - 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)]; - pairInfo.dirCounts = { - "north": 0, - "west": 0, - "south": 0, - "east": 0, - "northwest": 0, - "southwest": 0, - "northeast": 0, - "southeast": 0 - }; - 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 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 srcIntn = pairInfo.srcIntn = srcOutside; - var tgtOutside = tgtShape.intersectLine(tgtPos.x, tgtPos.y, tgtW, tgtH, srcPos.x, srcPos.y, 0); - var tgtIntn = pairInfo.tgtIntn = tgtOutside; - var intersectionPts = pairInfo.intersectionPts = { - x1: srcOutside[0], - x2: tgtOutside[0], - y1: srcOutside[1], - y2: tgtOutside[1] + } + return style3; + }; + version3 = "3.30.1"; + cytoscape2 = /* @__PURE__ */ __name(function cytoscape3(options3) { + if (options3 === void 0) { + options3 = {}; + } + 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); + ext.apply(null, args); + return this; + }; + cytoscape2.warnings = function(bool2) { + return warnings(bool2); + }; + cytoscape2.version = version3; + cytoscape2.stylesheet = cytoscape2.Stylesheet = Stylesheet; + } + }); + + // ../../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(modules2) { + var installedModules = {}; + function __webpack_require__(moduleId) { + if (installedModules[moduleId]) { + return installedModules[moduleId].exports; + } + var module3 = installedModules[moduleId] = { + /******/ + i: moduleId, + /******/ + l: false, + /******/ + exports: {} + /******/ + }; + 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 = 26); + }([ + /* 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; + LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT = true; + LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT = false; + LayoutConstants.DEFAULT_ANIMATION_PERIOD = 50; + LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES = false; + LayoutConstants.DEFAULT_GRAPH_MARGIN = 15; + LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = false; + LayoutConstants.SIMPLE_NODE_SIZE = 40; + LayoutConstants.SIMPLE_NODE_HALF_SIZE = LayoutConstants.SIMPLE_NODE_SIZE / 2; + LayoutConstants.EMPTY_COMPOUND_NODE_SIZE = 40; + LayoutConstants.MIN_EDGE_LENGTH = 1; + LayoutConstants.WORLD_BOUNDARY = 1e6; + LayoutConstants.INITIAL_WORLD_BOUNDARY = LayoutConstants.WORLD_BOUNDARY / 1e3; + LayoutConstants.WORLD_CENTER_X = 1200; + LayoutConstants.WORLD_CENTER_Y = 900; + module3.exports = LayoutConstants; + }, + /* 1 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var LGraphObject = __webpack_require__(2); + var IGeometry = __webpack_require__(8); + var IMath = __webpack_require__(9); + function LEdge(source, target, vEdge) { + LGraphObject.call(this, vEdge); + this.isOverlapingSourceAndTarget = false; + this.vGraphObject = vEdge; + this.bendpoints = []; + this.source = source; + this.target = target; + } + __name(LEdge, "LEdge"); + LEdge.prototype = Object.create(LGraphObject.prototype); + for (var prop in LGraphObject) { + LEdge[prop] = LGraphObject[prop]; + } + LEdge.prototype.getSource = function() { + return this.source; + }; + LEdge.prototype.getTarget = function() { + return this.target; + }; + LEdge.prototype.isInterGraph = function() { + return this.isInterGraph; + }; + LEdge.prototype.getLength = function() { + return this.length; + }; + LEdge.prototype.isOverlapingSourceAndTarget = function() { + return this.isOverlapingSourceAndTarget; + }; + LEdge.prototype.getBendpoints = function() { + return this.bendpoints; + }; + LEdge.prototype.getLca = function() { + return this.lca; + }; + LEdge.prototype.getSourceInLca = function() { + return this.sourceInLca; + }; + LEdge.prototype.getTargetInLca = function() { + return this.targetInLca; + }; + LEdge.prototype.getOtherEnd = function(node2) { + if (this.source === node2) { + return this.target; + } else if (this.target === node2) { + return this.source; + } else { + throw "Node is not incident with this edge"; + } + }; + LEdge.prototype.getOtherEndInGraph = function(node2, graph) { + var otherEnd = this.getOtherEnd(node2); + var root4 = graph.getGraphManager().getRoot(); + while (true) { + if (otherEnd.getOwner() == graph) { + return otherEnd; + } + if (otherEnd.getOwner() == root4) { + break; + } + otherEnd = otherEnd.getOwner().getParent(); + } + return null; + }; + LEdge.prototype.updateLength = function() { + var clipPointCoordinates = new Array(4); + this.isOverlapingSourceAndTarget = IGeometry.getIntersection(this.target.getRect(), this.source.getRect(), clipPointCoordinates); + if (!this.isOverlapingSourceAndTarget) { + this.lengthX = clipPointCoordinates[0] - clipPointCoordinates[2]; + this.lengthY = clipPointCoordinates[1] - clipPointCoordinates[3]; + if (Math.abs(this.lengthX) < 1) { + this.lengthX = IMath.sign(this.lengthX); + } + if (Math.abs(this.lengthY) < 1) { + this.lengthY = IMath.sign(this.lengthY); + } + this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY); + } + }; + LEdge.prototype.updateLengthSimple = function() { + this.lengthX = this.target.getCenterX() - this.source.getCenterX(); + this.lengthY = this.target.getCenterY() - this.source.getCenterY(); + if (Math.abs(this.lengthX) < 1) { + this.lengthX = IMath.sign(this.lengthX); + } + if (Math.abs(this.lengthY) < 1) { + this.lengthY = IMath.sign(this.lengthY); + } + this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY); + }; + module3.exports = LEdge; + }, + /* 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, size5, vNode) { + if (size5 == null && vNode == null) { + vNode = loc; + } + LGraphObject.call(this, vNode); + 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 (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]; + } + LNode.prototype.getEdges = function() { + return this.edges; + }; + LNode.prototype.getChild = function() { + return this.child; + }; + LNode.prototype.getOwner = function() { + return this.owner; + }; + LNode.prototype.getWidth = function() { + return this.rect.width; + }; + LNode.prototype.setWidth = function(width3) { + this.rect.width = width3; + }; + LNode.prototype.getHeight = function() { + return this.rect.height; + }; + LNode.prototype.setHeight = function(height2) { + this.rect.height = height2; + }; + LNode.prototype.getCenterX = function() { + return this.rect.x + this.rect.width / 2; + }; + LNode.prototype.getCenterY = function() { + return this.rect.y + this.rect.height / 2; + }; + LNode.prototype.getCenter = function() { + return new PointD(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2); + }; + LNode.prototype.getLocation = function() { + return new PointD(this.rect.x, this.rect.y); + }; + LNode.prototype.getRect = function() { + return this.rect; + }; + LNode.prototype.getDiagonal = function() { + return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height); + }; + LNode.prototype.getHalfTheDiagonal = function() { + return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2; + }; + LNode.prototype.setRect = function(upperLeft, dimension) { + this.rect.x = upperLeft.x; + this.rect.y = upperLeft.y; + this.rect.width = dimension.width; + this.rect.height = dimension.height; + }; + LNode.prototype.setCenter = function(cx, cy) { + this.rect.x = cx - this.rect.width / 2; + this.rect.y = cy - this.rect.height / 2; + }; + LNode.prototype.setLocation = function(x5, y5) { + this.rect.x = x5; + this.rect.y = y5; + }; + LNode.prototype.moveBy = function(dx, dy) { + this.rect.x += dx; + this.rect.y += dy; + }; + LNode.prototype.getEdgeListToNode = function(to) { + var edgeList2 = []; + var edge; + var self2 = this; + 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(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; + }; + LNode.prototype.getNeighborsList = function() { + var neighbors = /* @__PURE__ */ new Set(); + var self2 = this; + self2.edges.forEach(function(edge) { + if (edge.source == self2) { + neighbors.add(edge.target); + } else { + if (edge.target != self2) { + throw "Incorrect incidency!"; + } + neighbors.add(edge.source); + } + }); + return neighbors; + }; + LNode.prototype.withChildren = function() { + var withNeighborsList = /* @__PURE__ */ new Set(); + var childNode; + var children2; + withNeighborsList.add(this); + if (this.child != null) { + 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); + }); + } + } + return withNeighborsList; + }; + LNode.prototype.getNoOfChildren = function() { + var noOfChildren = 0; + var childNode; + if (this.child == null) { + noOfChildren = 1; + } else { + var nodes6 = this.child.getNodes(); + for (var i2 = 0; i2 < nodes6.length; i2++) { + childNode = nodes6[i2]; + noOfChildren += childNode.getNoOfChildren(); + } + } + if (noOfChildren == 0) { + noOfChildren = 1; + } + return noOfChildren; + }; + LNode.prototype.getEstimatedSize = function() { + if (this.estimatedSize == Integer.MIN_VALUE) { + throw "assert failed"; + } + return this.estimatedSize; + }; + LNode.prototype.calcEstimatedSize = function() { + if (this.child == null) { + return this.estimatedSize = (this.rect.width + this.rect.height) / 2; + } else { + this.estimatedSize = this.child.calcEstimatedSize(); + this.rect.width = this.estimatedSize; + this.rect.height = this.estimatedSize; + return this.estimatedSize; + } + }; + LNode.prototype.scatter = function() { + var randomCenterX; + var randomCenterY; + var minX = -LayoutConstants.INITIAL_WORLD_BOUNDARY; + var maxX = LayoutConstants.INITIAL_WORLD_BOUNDARY; + randomCenterX = LayoutConstants.WORLD_CENTER_X + RandomSeed.nextDouble() * (maxX - minX) + minX; + var minY = -LayoutConstants.INITIAL_WORLD_BOUNDARY; + var maxY = LayoutConstants.INITIAL_WORLD_BOUNDARY; + randomCenterY = LayoutConstants.WORLD_CENTER_Y + RandomSeed.nextDouble() * (maxY - minY) + minY; + this.rect.x = randomCenterX; + this.rect.y = randomCenterY; + }; + LNode.prototype.updateBounds = function() { + if (this.getChild() == null) { + throw "assert failed"; + } + if (this.getChild().getNodes().length != 0) { + var childGraph = this.getChild(); + childGraph.updateBounds(true); + this.rect.x = childGraph.getLeft(); + this.rect.y = childGraph.getTop(); + this.setWidth(childGraph.getRight() - childGraph.getLeft()); + this.setHeight(childGraph.getBottom() - childGraph.getTop()); + if (LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS) { + 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 > height2) { + if (this.labelPos == "center") { + this.rect.y -= (this.labelHeight - height2) / 2; + } else if (this.labelPos == "top") { + this.rect.y -= this.labelHeight - height2; + } + this.setHeight(this.labelHeight); + } + } + } + }; + LNode.prototype.getInclusionTreeDepth = function() { + if (this.inclusionTreeDepth == Integer.MAX_VALUE) { + throw "assert failed"; + } + return this.inclusionTreeDepth; + }; + LNode.prototype.transform = function(trans) { + 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) { + top2 = LayoutConstants.WORLD_BOUNDARY; + } else if (top2 < -LayoutConstants.WORLD_BOUNDARY) { + top2 = -LayoutConstants.WORLD_BOUNDARY; + } + var leftTop = new PointD(left3, top2); + var vLeftTop = trans.inverseTransformPoint(leftTop); + this.setLocation(vLeftTop.x, vLeftTop.y); + }; + LNode.prototype.getLeft = function() { + return this.rect.x; + }; + LNode.prototype.getRight = function() { + return this.rect.x + this.rect.width; + }; + LNode.prototype.getTop = function() { + return this.rect.y; + }; + LNode.prototype.getBottom = function() { + return this.rect.y + this.rect.height; + }; + LNode.prototype.getParent = function() { + if (this.owner == null) { + return null; + } + return this.owner.getParent(); + }; + module3.exports = LNode; + }, + /* 4 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function PointD(x5, y5) { + if (x5 == null && y5 == null) { + this.x = 0; + this.y = 0; + } else { + 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(x5) { + this.x = x5; + }; + PointD.prototype.setY = function(y5) { + this.y = y5; + }; + PointD.prototype.getDifference = function(pt) { + return new DimensionD(this.x - pt.x, this.y - pt.y); + }; + PointD.prototype.getCopy = function() { + return new PointD(this.x, this.y); + }; + PointD.prototype.translate = function(dim) { + this.x += dim.width; + this.y += dim.height; + return this; + }; + module3.exports = PointD; + }, + /* 5 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var LGraphObject = __webpack_require__(2); + var Integer = __webpack_require__(10); + var LayoutConstants = __webpack_require__(0); + var LGraphManager = __webpack_require__(6); + var LNode = __webpack_require__(3); + var LEdge = __webpack_require__(1); + var RectangleD = __webpack_require__(13); + var Point3 = __webpack_require__(12); + var LinkedList = __webpack_require__(11); + 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 = 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]; + } + LGraph.prototype.getNodes = function() { + return this.nodes; + }; + LGraph.prototype.getEdges = function() { + return this.edges; + }; + LGraph.prototype.getGraphManager = function() { + return this.graphManager; + }; + LGraph.prototype.getParent = function() { + return this.parent; + }; + LGraph.prototype.getLeft = function() { + return this.left; + }; + LGraph.prototype.getRight = function() { + return this.right; + }; + LGraph.prototype.getTop = function() { + return this.top; + }; + LGraph.prototype.getBottom = function() { + return this.bottom; + }; + LGraph.prototype.isConnected = function() { + return this.isConnected; + }; + LGraph.prototype.add = function(obj1, sourceNode, targetNode) { + if (sourceNode == null && targetNode == null) { + var newNode = obj1; + if (this.graphManager == null) { + throw "Graph has no graph mgr!"; + } + if (this.getNodes().indexOf(newNode) > -1) { + throw "Node already in graph!"; + } + newNode.owner = this; + this.getNodes().push(newNode); + return newNode; + } else { + var newEdge = obj1; + if (!(this.getNodes().indexOf(sourceNode) > -1 && this.getNodes().indexOf(targetNode) > -1)) { + throw "Source or target not in graph!"; + } + if (!(sourceNode.owner == targetNode.owner && sourceNode.owner == this)) { + throw "Both owners must be this graph!"; + } + if (sourceNode.owner != targetNode.owner) { + return null; + } + newEdge.source = sourceNode; + newEdge.target = targetNode; + newEdge.isInterGraph = false; + this.getEdges().push(newEdge); + sourceNode.edges.push(newEdge); + if (targetNode != sourceNode) { + targetNode.edges.push(newEdge); + } + return newEdge; + } + }; + LGraph.prototype.remove = function(obj) { + var node2 = obj; + if (obj instanceof LNode) { + if (node2 == null) { + throw "Node is null!"; + } + if (!(node2.owner != null && node2.owner == this)) { + throw "Owner graph is invalid!"; + } + if (this.graphManager == null) { + throw "Owner graph manager is invalid!"; + } + var edgesToBeRemoved = node2.edges.slice(); + var edge; + var s2 = edgesToBeRemoved.length; + for (var i2 = 0; i2 < s2; i2++) { + edge = edgesToBeRemoved[i2]; + if (edge.isInterGraph) { + this.graphManager.remove(edge); + } else { + edge.source.owner.remove(edge); + } + } + var index = this.nodes.indexOf(node2); + if (index == -1) { + throw "Node not in owner node list!"; + } + this.nodes.splice(index, 1); + } else if (obj instanceof LEdge) { + var edge = obj; + if (edge == null) { + throw "Edge is null!"; + } + if (!(edge.source != null && edge.target != null)) { + throw "Source and/or target is null!"; + } + if (!(edge.source.owner != null && edge.target.owner != null && edge.source.owner == this && edge.target.owner == this)) { + throw "Source and/or target owner is invalid!"; + } + var sourceIndex = edge.source.edges.indexOf(edge); + var targetIndex = edge.target.edges.indexOf(edge); + if (!(sourceIndex > -1 && targetIndex > -1)) { + throw "Source and/or target doesn't know this edge!"; + } + edge.source.edges.splice(sourceIndex, 1); + if (edge.target != edge.source) { + edge.target.edges.splice(targetIndex, 1); + } + var index = edge.source.owner.getEdges().indexOf(edge); + if (index == -1) { + throw "Not in owner's edge list!"; + } + edge.source.owner.getEdges().splice(index, 1); + } + }; + LGraph.prototype.updateLeftTop = function() { + var top2 = Integer.MAX_VALUE; + var left3 = Integer.MAX_VALUE; + var nodeTop; + var nodeLeft; + var margin; + 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 (left3 > nodeLeft) { + left3 = nodeLeft; + } + } + if (top2 == Integer.MAX_VALUE) { + return null; + } + if (nodes6[0].getParent().paddingLeft != void 0) { + margin = nodes6[0].getParent().paddingLeft; + } else { + margin = this.margin; + } + this.left = left3 - margin; + this.top = top2 - margin; + return new Point3(this.left, this.top); + }; + LGraph.prototype.updateBounds = function(recursive) { + 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 margin; + 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(); + } + nodeLeft = lNode.getLeft(); + nodeRight = lNode.getRight(); + nodeTop = lNode.getTop(); + nodeBottom = lNode.getBottom(); + if (left3 > nodeLeft) { + left3 = nodeLeft; + } + if (right3 < nodeRight) { + right3 = nodeRight; + } + if (top2 > nodeTop) { + top2 = nodeTop; + } + if (bottom2 < nodeBottom) { + bottom2 = nodeBottom; + } + } + 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 (nodes6[0].getParent().paddingLeft != void 0) { + margin = nodes6[0].getParent().paddingLeft; + } else { + margin = this.margin; + } + this.left = boundingRect.x - margin; + this.right = boundingRect.x + boundingRect.width + margin; + this.top = boundingRect.y - margin; + this.bottom = boundingRect.y + boundingRect.height + margin; + }; + 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 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 (left3 > nodeLeft) { + left3 = nodeLeft; + } + if (right3 < nodeRight) { + right3 = nodeRight; + } + if (top2 > nodeTop) { + top2 = nodeTop; + } + if (bottom2 < nodeBottom) { + bottom2 = nodeBottom; + } + } + var boundingRect = new RectangleD(left3, top2, right3 - left3, bottom2 - top2); + return boundingRect; + }; + LGraph.prototype.getInclusionTreeDepth = function() { + if (this == this.graphManager.getRoot()) { + return 1; + } else { + return this.parent.getInclusionTreeDepth(); + } + }; + LGraph.prototype.getEstimatedSize = function() { + if (this.estimatedSize == Integer.MIN_VALUE) { + throw "assert failed"; + } + return this.estimatedSize; + }; + LGraph.prototype.calcEstimatedSize = function() { + 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 = size5 / Math.sqrt(this.nodes.length); + } + return this.estimatedSize; + }; + LGraph.prototype.updateConnected = function() { + var self2 = this; + if (this.nodes.length == 0) { + this.isConnected = true; + return; + } + var queue = new LinkedList(); + var visited = /* @__PURE__ */ new Set(); + var currentNode = this.nodes[0]; + var neighborEdges; + var currentNeighbor; + var childrenOfNode = currentNode.withChildren(); + childrenOfNode.forEach(function(node2) { + queue.push(node2); + visited.add(node2); + }); + while (queue.length !== 0) { + currentNode = queue.shift(); + neighborEdges = currentNode.getEdges(); + 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)) { + var childrenOfNeighbor = currentNeighbor.withChildren(); + childrenOfNeighbor.forEach(function(node2) { + queue.push(node2); + visited.add(node2); + }); + } + } + } + this.isConnected = false; + if (visited.size >= this.nodes.length) { + var noOfVisitedInThisGraph = 0; + visited.forEach(function(visitedNode) { + if (visitedNode.owner == self2) { + noOfVisitedInThisGraph++; + } + }); + if (noOfVisitedInThisGraph == this.nodes.length) { + this.isConnected = true; + } + } + }; + module3.exports = LGraph; + }, + /* 6 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var LGraph; + var LEdge = __webpack_require__(1); + function LGraphManager(layout6) { + LGraph = __webpack_require__(5); + 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 root4 = this.add(ngraph, nnode); + this.setRootGraph(root4); + return this.rootGraph; + }; + LGraphManager.prototype.add = function(newGraph, parentNode, newEdge, sourceNode, targetNode) { + if (newEdge == null && sourceNode == null && targetNode == null) { + if (newGraph == null) { + throw "Graph is null!"; + } + if (parentNode == null) { + throw "Parent node is null!"; + } + if (this.graphs.indexOf(newGraph) > -1) { + throw "Graph already in this graph mgr!"; + } + this.graphs.push(newGraph); + if (newGraph.parent != null) { + throw "Already has a parent!"; + } + if (parentNode.child != null) { + throw "Already has a child!"; + } + newGraph.parent = parentNode; + parentNode.child = newGraph; + return newGraph; + } else { + targetNode = newEdge; + sourceNode = parentNode; + newEdge = newGraph; + var sourceGraph = sourceNode.getOwner(); + var targetGraph = targetNode.getOwner(); + if (!(sourceGraph != null && sourceGraph.getGraphManager() == this)) { + throw "Source not in this graph mgr!"; + } + if (!(targetGraph != null && targetGraph.getGraphManager() == this)) { + throw "Target not in this graph mgr!"; + } + if (sourceGraph == targetGraph) { + newEdge.isInterGraph = false; + return sourceGraph.add(newEdge, sourceNode, targetNode); + } else { + newEdge.isInterGraph = true; + newEdge.source = sourceNode; + newEdge.target = targetNode; + if (this.edges.indexOf(newEdge) > -1) { + throw "Edge already in inter-graph edge list!"; + } + this.edges.push(newEdge); + if (!(newEdge.source != null && newEdge.target != null)) { + throw "Edge source and/or target is null!"; + } + if (!(newEdge.source.edges.indexOf(newEdge) == -1 && newEdge.target.edges.indexOf(newEdge) == -1)) { + throw "Edge already in source and/or target incidency list!"; + } + newEdge.source.edges.push(newEdge); + newEdge.target.edges.push(newEdge); + return newEdge; + } + } + }; + LGraphManager.prototype.remove = function(lObj) { + if (lObj instanceof LGraph) { + var graph = lObj; + if (graph.getGraphManager() != this) { + throw "Graph not in this graph mgr"; + } + if (!(graph == this.rootGraph || graph.parent != null && graph.parent.graphManager == this)) { + throw "Invalid parent node!"; + } + var edgesToBeRemoved = []; + edgesToBeRemoved = edgesToBeRemoved.concat(graph.getEdges()); + var edge; + 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; + s2 = nodesToBeRemoved.length; + for (var i2 = 0; i2 < s2; i2++) { + node2 = nodesToBeRemoved[i2]; + graph.remove(node2); + } + if (graph == this.rootGraph) { + this.setRootGraph(null); + } + var index = this.graphs.indexOf(graph); + this.graphs.splice(index, 1); + graph.parent = null; + } else if (lObj instanceof LEdge) { + edge = lObj; + if (edge == null) { + throw "Edge is null!"; + } + if (!edge.isInterGraph) { + throw "Not an inter-graph edge!"; + } + if (!(edge.source != null && edge.target != null)) { + throw "Source and/or target is null!"; + } + if (!(edge.source.edges.indexOf(edge) != -1 && edge.target.edges.indexOf(edge) != -1)) { + throw "Source and/or target doesn't know this edge!"; + } + 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 index = edge.source.owner.getGraphManager().edges.indexOf(edge); + edge.source.owner.getGraphManager().edges.splice(index, 1); + } }; - var posPts = pairInfo.posPts = { - x1: srcPos.x, - x2: tgtPos.x, - y1: srcPos.y, - y2: tgtPos.y + LGraphManager.prototype.updateBounds = function() { + this.rootGraph.updateBounds(true); }; - var dy = tgtOutside[1] - srcOutside[1]; - var dx = tgtOutside[0] - srcOutside[0]; - var l = Math.sqrt(dx * dx + dy * dy); - var vector = pairInfo.vector = { - x: dx, - y: dy + LGraphManager.prototype.getGraphs = function() { + return this.graphs; }; - var vectorNorm = pairInfo.vectorNorm = { - x: vector.x / l, - y: vector.y / l + LGraphManager.prototype.getAllNodes = function() { + if (this.allNodes == null) { + var nodeList = []; + var graphs = this.getGraphs(); + var s2 = graphs.length; + for (var i2 = 0; i2 < s2; i2++) { + nodeList = nodeList.concat(graphs[i2].getNodes()); + } + this.allNodes = nodeList; + } + return this.allNodes; }; - var vectorNormInverse = { - x: -vectorNorm.y, - y: vectorNorm.x + LGraphManager.prototype.resetAllNodes = function() { + this.allNodes = null; }; - 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.vectorNormInverse = vectorNormInverse; - swappedpairInfo = { - nodesOverlap: pairInfo.nodesOverlap, - dirCounts: pairInfo.dirCounts, - calculatedIntersection: true, - hasBezier: pairInfo.hasBezier, - hasUnbundled: pairInfo.hasUnbundled, - eles: pairInfo.eles, - srcPos: tgtPos, - tgtPos: srcPos, - srcW: tgtW, - srcH: tgtH, - tgtW: srcW, - tgtH: srcH, - srcIntn: tgtIntn, - tgtIntn: srcIntn, - srcShape: tgtShape, - tgtShape: srcShape, - posPts: { - x1: posPts.x2, - y1: posPts.y2, - x2: posPts.x1, - y2: posPts.y1 - }, - intersectionPts: { - x1: intersectionPts.x2, - y1: intersectionPts.y2, - x2: intersectionPts.x1, - y2: intersectionPts.y1 - }, - vector: { - x: -vector.x, - y: -vector.y - }, - vectorNorm: { - x: -vectorNorm.x, - y: -vectorNorm.y - }, - vectorNormInverse: { - x: -vectorNormInverse.x, - y: -vectorNormInverse.y - } + LGraphManager.prototype.resetAllEdges = function() { + this.allEdges = null; }; - } - var passedPairInfo = edgeIsSwapped ? swappedpairInfo : pairInfo; - rs.nodesOverlap = passedPairInfo.nodesOverlap; - rs.srcIntn = passedPairInfo.srcIntn; - rs.tgtIntn = passedPairInfo.tgtIntn; - 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, _i2, _edgeIsUnbundled); - } else if (src2 === tgt2) { - _this.findLoopPoints(_edge, passedPairInfo, _i2, _edgeIsUnbundled); - } else if (_curveStyle === "segments") { - _this.findSegmentsPoints(_edge, passedPairInfo); - } else if (_curveStyle === "taxi") { - _this.findTaxiPoints(_edge, passedPairInfo); - } 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, _i2, _edgeIsUnbundled, edgeIsSwapped); - } - _this.findEndpoints(_edge); - _this.tryToCorrectInvalidPoints(_edge, passedPairInfo); - _this.checkForInvalidEdgeWarning(_edge); - _this.storeAllpts(_edge); - _this.storeEdgeProjections(_edge); - _this.calculateArrowAngles(_edge); - _this.recalculateEdgeLabelProjections(_edge); - _this.calculateLabelAngles(_edge); - } - }; - for (var p2 = 0; p2 < pairIds.length; p2++) { - _loop(p2); - } - 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; - } - BRp$c.getSegmentPoints = function(edge) { - var rs = edge[0]._private.rscratch; - var type2 = rs.edgeType; - if (type2 === "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") { - this.recalculateRenderedStyle(edge); - return getPts(rs.ctrlpts); - } - }; - BRp$c.getEdgeMidpoint = function(edge) { - var rs = edge[0]._private.rscratch; - this.recalculateRenderedStyle(edge); - return { - x: rs.midX, - y: rs.midY - }; - }; - var BRp$b = {}; - BRp$b.manualEndptToPx = function(node2, prop) { - var r = this; - var npos = node2.position(); - var w2 = node2.outerWidth(); - var h = node2.outerHeight(); - if (prop.value.length === 2) { - var p2 = [prop.pfValue[0], prop.pfValue[1]]; - if (prop.units[0] === "%") { - p2[0] = p2[0] * w2; - } - if (prop.units[1] === "%") { - p2[1] = p2[1] * h; - } - p2[0] += npos.x; - p2[1] += npos.y; - return p2; - } 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); - } - }; - BRp$b.findEndpoints = function(edge) { - var r = this; - var intersect2; - var source = edge.source()[0]; - var target = edge.target()[0]; - var srcPos = source.position(); - var tgtPos = target.position(); - var tgtArShape = edge.pstyle("target-arrow-shape").value; - 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 curveStyle = edge.pstyle("curve-style").value; - var rs = edge._private.rscratch; - var et = 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 hasEndpts = bezier || multi || lines; - var overrideEndpts = self2 || taxi; - var srcManEndpt = edge.pstyle("source-endpoint"); - var srcManEndptVal = overrideEndpts ? "outside-to-node" : srcManEndpt.value; - var tgtManEndpt = edge.pstyle("target-endpoint"); - var tgtManEndptVal = overrideEndpts ? "outside-to-node" : tgtManEndpt.value; - rs.srcManEndpt = srcManEndpt; - rs.tgtManEndpt = tgtManEndpt; - var p1; - var p2; - 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; - } 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; - } - if (tgtManEndptVal === "inside-to-node") { - intersect2 = [tgtPos.x, tgtPos.y]; - } else if (tgtManEndpt.units) { - intersect2 = this.manualEndptToPx(target, tgtManEndpt); - } else if (tgtManEndptVal === "outside-to-line") { - intersect2 = 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); - if (tgtManEndptVal === "outside-to-node-or-label" || tgtManEndptVal === "outside-to-line-or-label") { - var trs = target._private.rscratch; - var lw = trs.labelWidth; - var lh = trs.labelHeight; - var lx = trs.labelX; - var ly = trs.labelY; - var lw2 = lw / 2; - var lh2 = lh / 2; - var va = target.pstyle("text-valign").value; - if (va === "top") { - ly -= lh2; - } else if (va === "bottom") { - ly += lh2; - } - var ha = target.pstyle("text-halign").value; - if (ha === "left") { - lx -= lw2; - } else if (ha === "right") { - lx += lw2; - } - 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 labIntSqdist = sqdist(refPt, array2point(labelIntersect)); - var minSqDist = intSqdist; - if (labIntSqdist < intSqdist) { - intersect2 = labelIntersect; - minSqDist = labIntSqdist; - } - if (labelIntersect.length > 2) { - var labInt2SqDist = sqdist(refPt, { - x: labelIntersect[2], - y: labelIntersect[3] - }); - if (labInt2SqDist < minSqDist) { - intersect2 = [labelIntersect[2], labelIntersect[3]]; + LGraphManager.prototype.resetAllNodesToApplyGravitation = function() { + this.allNodesToApplyGravitation = null; + }; + LGraphManager.prototype.getAllEdges = function() { + if (this.allEdges == null) { + var edgeList2 = []; + var graphs = this.getGraphs(); + var s2 = graphs.length; + for (var i2 = 0; i2 < graphs.length; i2++) { + edgeList2 = edgeList2.concat(graphs[i2].getEdges()); + } + edgeList2 = edgeList2.concat(this.edges); + this.allEdges = edgeList2; } - } - } - } - } - var arrowEnd = shortenIntersection(intersect2, p1, r.arrowShapes[tgtArShape].spacing(edge) + tgtDist); - var edgeEnd = shortenIntersection(intersect2, p1, r.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]; - } else if (srcManEndpt.units) { - intersect2 = this.manualEndptToPx(source, srcManEndpt); - } else if (srcManEndptVal === "outside-to-line") { - intersect2 = rs.srcIntn; - } else { - if (srcManEndptVal === "outside-to-node" || srcManEndptVal === "outside-to-node-or-label") { - p2_i = p2; - } 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); - if (srcManEndptVal === "outside-to-node-or-label" || srcManEndptVal === "outside-to-line-or-label") { - var srs = source._private.rscratch; - var _lw = srs.labelWidth; - var _lh = srs.labelHeight; - var _lx = srs.labelX; - var _ly = srs.labelY; - var _lw2 = _lw / 2; - var _lh2 = _lh / 2; - var _va = source.pstyle("text-valign").value; - if (_va === "top") { - _ly -= _lh2; - } else if (_va === "bottom") { - _ly += _lh2; - } - var _ha = source.pstyle("text-halign").value; - if (_ha === "left") { - _lx -= _lw2; - } else if (_ha === "right") { - _lx += _lw2; - } - 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 _labIntSqdist = sqdist(_refPt, array2point(_labelIntersect)); - var _minSqDist = _intSqdist; - if (_labIntSqdist < _intSqdist) { - intersect2 = [_labelIntersect[0], _labelIntersect[1]]; - _minSqDist = _labIntSqdist; - } - if (_labelIntersect.length > 2) { - var _labInt2SqDist = sqdist(_refPt, { - x: _labelIntersect[2], - y: _labelIntersect[3] - }); - if (_labInt2SqDist < _minSqDist) { - intersect2 = [_labelIntersect[2], _labelIntersect[3]]; + return this.allEdges; + }; + LGraphManager.prototype.getAllNodesToApplyGravitation = function() { + return this.allNodesToApplyGravitation; + }; + LGraphManager.prototype.setAllNodesToApplyGravitation = function(nodeList) { + if (this.allNodesToApplyGravitation != null) { + throw "assert failed"; } - } - } - } - } - var arrowStart = shortenIntersection(intersect2, p2, r.arrowShapes[srcArShape].spacing(edge) + srcDist); - var edgeStart = shortenIntersection(intersect2, p2, r.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)) { - rs.badLine = true; - } else { - rs.badLine = false; - } - } - }; - BRp$b.getSourceEndpoint = function(edge) { - var rs = edge[0]._private.rscratch; - this.recalculateRenderedStyle(edge); - switch (rs.edgeType) { - case "haystack": - return { - x: rs.haystackPts[0], - y: rs.haystackPts[1] - }; - default: - return { - x: rs.arrowStartX, - y: rs.arrowStartY - }; - } - }; - BRp$b.getTargetEndpoint = function(edge) { - var rs = edge[0]._private.rscratch; - this.recalculateRenderedStyle(edge); - switch (rs.edgeType) { - case "haystack": - return { - x: rs.haystackPts[2], - y: rs.haystackPts[3] - }; - default: - return { - x: rs.arrowEndX, - y: rs.arrowEndY - }; - } - }; - var BRp$a = {}; - function pushBezierPts(r, edge, pts2) { - var qbezierAt$1 = function qbezierAt$12(p1, p22, p3, t4) { - return qbezierAt(p1, p22, p3, t4); - }; - 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.storeEdgeProjections = function(edge) { - var _p = edge._private; - var rs = _p.rscratch; - var et = rs.edgeType; - _p.rstyle.bezierPts = null; - _p.rstyle.linePts = null; - _p.rstyle.haystackPts = null; - if (et === "multibezier" || et === "bezier" || et === "self" || et === "compound") { - _p.rstyle.bezierPts = []; - for (var i3 = 0; i3 + 5 < rs.allpts.length; i3 += 4) { - pushBezierPts(this, edge, rs.allpts.slice(i3, i3 + 6)); - } - } else if (et === "segments") { - var lpts = _p.rstyle.linePts = []; - for (var i3 = 0; i3 + 1 < rs.allpts.length; i3 += 2) { - lpts.push({ - x: rs.allpts[i3], - y: rs.allpts[i3 + 1] - }); - } - } else if (et === "haystack") { - var hpts = rs.haystackPts; - _p.rstyle.haystackPts = [{ - x: hpts[0], - y: hpts[1] - }, { - x: hpts[2], - y: hpts[3] - }]; - } - _p.rstyle.arrowWidth = this.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.arrowShapeWidth; - }; - BRp$a.recalculateEdgeProjections = function(edges2) { - this.findEdgeControlPoints(edges2); - }; - var BRp$9 = {}; - BRp$9.recalculateNodeLabelProjection = function(node2) { - 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 nodePos = node2.position(); - var textHalign = node2.pstyle("text-halign").strValue; - var textValign = node2.pstyle("text-valign").strValue; - var rs = _p.rscratch; - var rstyle = _p.rstyle; - switch (textHalign) { - case "left": - textX = nodePos.x - nodeWidth / 2 - padding2; - break; - case "right": - textX = nodePos.x + nodeWidth / 2 + padding2; - break; - default: - textX = nodePos.x; - } - switch (textValign) { - case "top": - textY = nodePos.y - nodeHeight / 2 - padding2; - break; - case "bottom": - textY = nodePos.y + nodeHeight / 2 + padding2; - break; - default: - textY = nodePos.y; - } - rs.labelX = textX; - rs.labelY = textY; - rstyle.labelX = textX; - rstyle.labelY = textY; - 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; - } - return angle; - }; - var lineAngle = 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, t4) { - var t02 = bound(0, t4 - 1e-3, 1); - var t12 = bound(0, t4 + 1e-3, 1); - var lp0 = qbezierPtAt(p0, p1, p2, t02); - var lp1 = qbezierPtAt(p0, p1, p2, t12); - return lineAngle(lp0, lp1); - }; - BRp$9.recalculateEdgeLabelProjections = function(edge) { - var p2; - var _p = edge._private; - var rs = _p.rscratch; - var r = this; - var content = { - mid: edge.pstyle("label").strValue, - source: edge.pstyle("source-label").strValue, - target: edge.pstyle("target-label").strValue - }; - if (content.mid || content.source || content.target) - ; - else { - return; - } - p2 = { - x: rs.midX, - y: rs.midY - }; - var setRs = function setRs2(propName, prefix, value) { - setPrefixedProperty(_p.rscratch, propName, prefix, value); - setPrefixedProperty(_p.rstyle, propName, prefix, value); - }; - setRs("labelX", null, p2.x); - setRs("labelY", null, p2.y); - var midAngle = lineAngleFromDelta(rs.midDispX, rs.midDispY); - setRs("labelAutoAngle", null, midAngle); - var createControlPointInfo = function createControlPointInfo2() { - if (createControlPointInfo2.cache) { - return createControlPointInfo2.cache; - } - var ctrlpts = []; - for (var i3 = 0; i3 + 5 < rs.allpts.length; i3 += 4) { - var p0 = { - x: rs.allpts[i3], - y: rs.allpts[i3 + 1] - }; - var p1 = { - x: rs.allpts[i3 + 2], - y: rs.allpts[i3 + 3] - }; - var p22 = { - x: rs.allpts[i3 + 4], - y: rs.allpts[i3 + 5] - }; - ctrlpts.push({ - p0, - p1, - p2: p22, - startDist: 0, - length: 0, - segments: [] - }); - } - var bpts = _p.rstyle.bezierPts; - var nProjs = r.bezierProjPcts.length; - function addSegment(cp2, p02, p12, t02, t12) { - var length2 = dist2(p02, p12); - var prevSegment = cp2.segments[cp2.segments.length - 1]; - var segment = { - p0: p02, - p1: p12, - t0: t02, - t1: t12, - startDist: prevSegment ? prevSegment.startDist + prevSegment.length : 0, - length: length2 - }; - cp2.segments.push(segment); - cp2.length += length2; - } - 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[_i * nProjs], 0, r.bezierProjPcts[0]); - for (var j = 0; j < nProjs - 1; j++) { - addSegment(cp, bpts[_i * nProjs + j], bpts[_i * nProjs + j + 1], r.bezierProjPcts[j], r.bezierProjPcts[j + 1]); - } - addSegment(cp, bpts[_i * nProjs + nProjs - 1], cp.p2, r.bezierProjPcts[nProjs - 1], 1); - } - return createControlPointInfo2.cache = ctrlpts; - }; - var calculateEndProjection = function calculateEndProjection2(prefix) { - var angle; - var isSrc = prefix === "source"; - if (!content[prefix]) { - return; - } - var offset = edge.pstyle(prefix + "-text-offset").pfValue; - switch (rs.edgeType) { - case "self": - case "compound": - case "bezier": - case "multibezier": { - var cps = createControlPointInfo(); - 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; - startDist = totalDist; - totalDist += _seg.length; - if (totalDist >= offset || lastSeg) { - selected = { - cp: _cp, - segment: _seg - }; - break; - } + this.allNodesToApplyGravitation = nodeList; + }; + LGraphManager.prototype.getRoot = function() { + return this.rootGraph; + }; + LGraphManager.prototype.setRootGraph = function(graph) { + if (graph.getGraphManager() != this) { + throw "Root not in this graph mgr!"; } - if (selected) { - break; + this.rootGraph = graph; + if (graph.parent == null) { + graph.parent = this.layout.newNode("Root node"); } - } - var cp = selected.cp; - var seg = selected.segment; - var tSegment = (offset - startDist) / seg.length; - var segDt = seg.t1 - seg.t0; - var t4 = isSrc ? seg.t0 + segDt * tSegment : seg.t1 - segDt * tSegment; - t4 = bound(0, t4, 1); - p2 = qbezierPtAt(cp.p0, cp.p1, cp.p2, t4); - angle = bezierAngle(cp.p0, cp.p1, cp.p2, t4); - break; - } - case "straight": - case "segments": - case "haystack": { - var d = 0, di, d0; - var p0, p1; - var l = rs.allpts.length; - for (var _i2 = 0; _i2 + 3 < l; _i2 += 2) { - if (isSrc) { - p0 = { - x: rs.allpts[_i2], - y: rs.allpts[_i2 + 1] - }; - p1 = { - x: rs.allpts[_i2 + 2], - y: rs.allpts[_i2 + 3] - }; - } else { - p0 = { - x: rs.allpts[l - 2 - _i2], - y: rs.allpts[l - 1 - _i2] - }; - p1 = { - x: rs.allpts[l - 4 - _i2], - y: rs.allpts[l - 3 - _i2] - }; + }; + LGraphManager.prototype.getLayout = function() { + return this.layout; + }; + LGraphManager.prototype.isOneAncestorOfOther = function(firstNode, secondNode) { + if (!(firstNode != null && secondNode != null)) { + throw "assert failed"; } - di = dist2(p0, p1); - d0 = d; - d += di; - if (d >= offset) { - break; + if (firstNode == secondNode) { + return true; } - } - var pD = offset - d0; - var _t = pD / di; - _t = bound(0, _t, 1); - p2 = lineAt(p0, p1, _t); - angle = lineAngle(p0, p1); - break; - } - } - setRs("labelX", prefix, p2.x); - setRs("labelY", prefix, p2.y); - setRs("labelAutoAngle", prefix, angle); - }; - calculateEndProjection("source"); - calculateEndProjection("target"); - this.applyLabelDimensions(edge); - }; - BRp$9.applyLabelDimensions = function(ele) { - this.applyPrefixedLabelDimensions(ele); - if (ele.isEdge()) { - this.applyPrefixedLabelDimensions(ele, "source"); - this.applyPrefixedLabelDimensions(ele, "target"); - } - }; - BRp$9.applyPrefixedLabelDimensions = function(ele, prefix) { - var _p = ele._private; - var text2 = this.getLabelText(ele, prefix); - var labelDims = this.calculateLabelDimensions(ele, text2); - var lineHeight = ele.pstyle("line-height").pfValue; - var textWrap = ele.pstyle("text-wrap").strValue; - var lines = getPrefixedProperty(_p.rscratch, "labelWrapCachedLines", prefix) || []; - var numLines = textWrap !== "wrap" ? 1 : Math.max(lines.length, 1); - var normPerLineHeight = labelDims.height / numLines; - var labelLineHeight = normPerLineHeight * lineHeight; - var width2 = labelDims.width; - var height2 = labelDims.height + (numLines - 1) * (lineHeight - 1) * normPerLineHeight; - setPrefixedProperty(_p.rstyle, "labelWidth", prefix, width2); - setPrefixedProperty(_p.rscratch, "labelWidth", prefix, width2); - setPrefixedProperty(_p.rstyle, "labelHeight", prefix, height2); - setPrefixedProperty(_p.rscratch, "labelHeight", prefix, height2); - setPrefixedProperty(_p.rscratch, "labelLineHeight", prefix, labelLineHeight); - }; - BRp$9.getLabelText = function(ele, prefix) { - var _p = ele._private; - var pfd = prefix ? prefix + "-" : ""; - var text2 = ele.pstyle(pfd + "label").strValue; - var textTransform = ele.pstyle("text-transform").value; - var rscratch = function rscratch2(propName, value) { - if (value) { - setPrefixedProperty(_p.rscratch, propName, prefix, value); - return value; - } else { - return getPrefixedProperty(_p.rscratch, propName, prefix); - } - }; - if (!text2) { - return ""; - } - if (textTransform == "none") - ; - else if (textTransform == "uppercase") { - text2 = text2.toUpperCase(); - } else if (textTransform == "lowercase") { - text2 = text2.toLowerCase(); - } - var wrapStyle = ele.pstyle("text-wrap").value; - if (wrapStyle === "wrap") { - var labelKey = rscratch("labelKey"); - if (labelKey != null && rscratch("labelWrapKey") === labelKey) { - return rscratch("labelWrapCachedText"); - } - var zwsp = "​"; - 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 lineDims = this.calculateLabelDimensions(ele, line2); - var lineW = lineDims.width; - if (overflowAny) { - var processedLine = line2.split("").join(zwsp); - line2 = processedLine; - } - if (lineW > maxW) { - var words = line2.split(wordsRegex); - 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 ownerGraph = firstNode.getOwner(); + var parentNode; + do { + parentNode = ownerGraph.getParent(); + if (parentNode == null) { + break; } - subline = word + wordSeparator; - } - } - if (!subline.match(/^[\s\u200b]+$/)) { - wrappedLines.push(subline); - } - } else { - wrappedLines.push(line2); - } - } - rscratch("labelWrapCachedLines", wrappedLines); - text2 = rscratch("labelWrapCachedText", wrappedLines.join("\n")); - rscratch("labelWrapKey", labelKey); - } else if (wrapStyle === "ellipsis") { - var _maxW = ele.pstyle("text-max-width").pfValue; - var ellipsized = ""; - var ellipsis = "…"; - 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; - if (widthWithNextCh > _maxW) { - break; - } - ellipsized += text2[i3]; - if (i3 === text2.length - 1) { - incLastCh = true; - } - } - if (!incLastCh) { - ellipsized += ellipsis; - } - return ellipsized; - } - return text2; - }; - BRp$9.getLabelJustification = function(ele) { - var justification = ele.pstyle("text-justification").strValue; - var textHalign = ele.pstyle("text-halign").strValue; - if (justification === "auto") { - if (ele.isNode()) { - switch (textHalign) { - case "left": - return "right"; - case "right": - return "left"; - default: - return "center"; - } - } else { - return "center"; - } - } else { - return justification; - } - }; - BRp$9.calculateLabelDimensions = function(ele, text2) { - var r = this; - var cacheKey = hashString(text2, ele._private.labelDimsKey); - var cache2 = r.labelDimCache || (r.labelDimCache = []); - var existingVal = cache2[cacheKey]; - if (existingVal != null) { - return existingVal; - } - var padding2 = 0; - var fStyle = ele.pstyle("font-style").strValue; - var size2 = ele.pstyle("font-size").pfValue; - var family = ele.pstyle("font-family").strValue; - var weight = ele.pstyle("font-weight").strValue; - var canvas = this.labelCalcCanvas; - var c2d = this.labelCalcCanvasContext; - if (!canvas) { - canvas = this.labelCalcCanvas = document.createElement("canvas"); - c2d = this.labelCalcCanvasContext = canvas.getContext("2d"); - var ds = canvas.style; - ds.position = "absolute"; - ds.left = "-9999px"; - ds.top = "-9999px"; - ds.zIndex = "-1"; - ds.visibility = "hidden"; - ds.pointerEvents = "none"; - } - c2d.font = "".concat(fStyle, " ").concat(weight, " ").concat(size2, "px ").concat(family); - var width2 = 0; - var height2 = 0; - var lines = text2.split("\n"); - for (var i3 = 0; i3 < lines.length; i3++) { - var line2 = lines[i3]; - var metrics = c2d.measureText(line2); - var w2 = Math.ceil(metrics.width); - var h = size2; - width2 = Math.max(w2, width2); - height2 += h; - } - width2 += padding2; - height2 += padding2; - return cache2[cacheKey] = { - width: width2, - height: height2 - }; - }; - BRp$9.calculateLabelAngle = function(ele, prefix) { - var _p = ele._private; - var rs = _p.rscratch; - var isEdge = 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") { - return rs.labelAutoAngle; - } else if (rotStr === "autorotate") { - return 0; - } else { - return rot.pfValue; - } - }; - BRp$9.calculateLabelAngles = function(ele) { - var r = this; - var isEdge = 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"); - } - }; - var BRp$8 = {}; - var TOO_SMALL_CUT_RECT = 28; - var warnedCutRect = false; - BRp$8.getNodeShape = function(node2) { - var r = this; - var shape = node2.pstyle("shape").value; - if (shape === "cutrectangle" && (node2.width() < TOO_SMALL_CUT_RECT || node2.height() < TOO_SMALL_CUT_RECT)) { - if (!warnedCutRect) { - warn("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"); - warnedCutRect = true; - } - return "rectangle"; - } - if (node2.isParent()) { - if (shape === "rectangle" || shape === "roundrectangle" || shape === "round-rectangle" || shape === "cutrectangle" || shape === "cut-rectangle" || shape === "barrel") { - return shape; - } else { - return "rectangle"; - } - } - if (shape === "polygon") { - var points = node2.pstyle("shape-polygon-points").value; - return r.nodeShapes.makePolygon(points).name; - } - return shape; - }; - var BRp$7 = {}; - BRp$7.registerCalculationListeners = function() { - var cy = this.cy; - var elesToUpdate = cy.collection(); - var r = this; - var enqueue = 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]; - 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(ele); - }).on("style.* background.*", function onDirtyStyle(e) { - var ele = e.target; - enqueue(ele, false); - }); - var updateEleCalcs = function updateEleCalcs2(willDraw) { - if (willDraw) { - var fns = r.onUpdateEleCalcsFns; - elesToUpdate.cleanStyle(); - for (var i3 = 0; i3 < elesToUpdate.length; i3++) { - var ele = elesToUpdate[i3]; - var rstyle = ele._private.rstyle; - if (ele.isNode() && !rstyle.cleanConnected) { - enqueue(ele.connectedEdges()); - rstyle.cleanConnected = true; - } - } - if (fns) { - for (var _i = 0; _i < fns.length; _i++) { - var fn2 = fns[_i]; - fn2(willDraw, elesToUpdate); - } - } - r.recalculateRenderedStyle(elesToUpdate); - elesToUpdate = cy.collection(); - } - }; - r.flushRenderedStyleQueue = function() { - updateEleCalcs(true); - }; - r.beforeRender(updateEleCalcs, r.beforeRenderPriorities.eleCalcs); - }; - BRp$7.onUpdateEleCalcs = function(fn2) { - var fns = this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || []; - fns.push(fn2); - }; - BRp$7.recalculateRenderedStyle = function(eles, useCache) { - var isCleanConnected = function isCleanConnected2(ele2) { - return ele2._private.rstyle.cleanConnected; - }; - var edges2 = []; - var nodes2 = []; - if (this.destroyed) { - return; - } - if (useCache === void 0) { - useCache = true; - } - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - var _p = ele._private; - var rstyle = _p.rstyle; - if (ele.isEdge() && (!isCleanConnected(ele.source()) || !isCleanConnected(ele.target()))) { - rstyle.clean = false; - } - if (useCache && rstyle.clean || ele.removed()) { - continue; - } - if (ele.pstyle("display").value === "none") { - continue; - } - if (_p.group === "nodes") { - nodes2.push(ele); - } else { - edges2.push(ele); - } - rstyle.clean = true; - } - for (var _i2 = 0; _i2 < nodes2.length; _i2++) { - var _ele = nodes2[_i2]; - var _p2 = _ele._private; - var _rstyle = _p2.rstyle; - var pos = _ele.position(); - this.recalculateNodeLabelProjection(_ele); - _rstyle.nodeX = pos.x; - _rstyle.nodeY = pos.y; - _rstyle.nodeW = _ele.pstyle("width").pfValue; - _rstyle.nodeH = _ele.pstyle("height").pfValue; - } - this.recalculateEdgeProjections(edges2); - for (var _i3 = 0; _i3 < edges2.length; _i3++) { - var _ele2 = edges2[_i3]; - var _p3 = _ele2._private; - var _rstyle2 = _p3.rstyle; - var rs = _p3.rscratch; - _rstyle2.srcX = rs.arrowStartX; - _rstyle2.srcY = rs.arrowStartY; - _rstyle2.tgtX = rs.arrowEndX; - _rstyle2.tgtY = rs.arrowEndY; - _rstyle2.midX = rs.midX; - _rstyle2.midY = rs.midY; - _rstyle2.labelAngle = rs.labelAngle; - _rstyle2.sourceLabelAngle = rs.sourceLabelAngle; - _rstyle2.targetLabelAngle = rs.targetLabelAngle; - } - }; - var BRp$6 = {}; - BRp$6.updateCachedGrabbedEles = function() { - var eles = this.cachedZSortedEles; - if (!eles) { - return; - } - eles.drag = []; - eles.nondrag = []; - var grabTargets = []; - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - var rs = ele._private.rscratch; - if (ele.grabbed() && !ele.isParent()) { - grabTargets.push(ele); - } else if (rs.inDragLayer) { - eles.drag.push(ele); - } else { - eles.nondrag.push(ele); - } - } - for (var i3 = 0; i3 < grabTargets.length; i3++) { - var ele = grabTargets[i3]; - eles.drag.push(ele); - } - }; - BRp$6.invalidateCachedZSortedEles = function() { - this.cachedZSortedEles = null; - }; - BRp$6.getCachedZSortedEles = function(forceRecalc) { - if (forceRecalc || !this.cachedZSortedEles) { - var eles = this.cy.mutableElements().toArray(); - eles.sort(zIndexSort); - eles.interactive = eles.filter(function(ele) { - return ele.interactive(); - }); - this.cachedZSortedEles = eles; - this.updateCachedGrabbedEles(); - } else { - eles = this.cachedZSortedEles; - } - return eles; - }; - var 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.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; - } else { - cache2 = imageCache[url] = imageCache[url] || {}; - var image = cache2.image = new Image(); - image.addEventListener("load", onLoad); - image.addEventListener("error", function() { - image.error = true; - }); - var dataUriPrefix = "data:"; - var isDataUri = url.substring(0, dataUriPrefix.length).toLowerCase() === dataUriPrefix; - if (!isDataUri) { - image.crossOrigin = crossOrigin; - } - image.src = url; - return image; - } - }; - var BRp$3 = {}; - BRp$3.registerBinding = function(target, event2, handler, useCapture) { - var args = Array.prototype.slice.apply(arguments, [1]); - var b = this.binder(target); - return b.on.apply(b, args); - }; - BRp$3.binder = function(tgt) { - var r = this; - var tgtIsDom = tgt === window || tgt === document || tgt === document.body || domElement(tgt); - if (r.supportsPassiveEvents == null) { - var supportsPassive = false; - try { - var opts = Object.defineProperty({}, "passive", { - get: function get3() { - supportsPassive = true; - return true; - } - }); - window.addEventListener("test", null, opts); - } catch (err) { - } - r.supportsPassiveEvents = supportsPassive; - } - var on = function on2(event2, handler, useCapture) { - var args = Array.prototype.slice.call(arguments); - if (tgtIsDom && r.supportsPassiveEvents) { - args[2] = { - capture: useCapture != null ? useCapture : false, - passive: false, - once: false - }; - } - r.bindings.push({ - target: tgt, - args - }); - (tgt.addEventListener || tgt.on).apply(tgt, args); - return this; - }; - return { - on, - addEventListener: on, - addListener: on, - bind: on - }; - }; - BRp$3.nodeIsDraggable = function(node2) { - return node2 && node2.isNode() && !node2.locked() && node2.grabbable(); - }; - BRp$3.nodeIsGrabbable = function(node2) { - return this.nodeIsDraggable(node2) && node2.interactive(); - }; - BRp$3.load = function() { - var r = this; - var isSelected = function isSelected2(ele) { - return ele.selected(); - }; - var triggerEvents = function triggerEvents2(target, names, e, position3) { - if (target == null) { - target = r.cy; - } - for (var i3 = 0; i3 < names.length; i3++) { - var name2 = names[i3]; - target.emit({ - originalEvent: e, - type: name2, - position: position3 - }); - } - }; - var isMultSelKeyDown = function isMultSelKeyDown2(e) { - return e.shiftKey || e.metaKey || e.ctrlKey; - }; - var allowPanningPassthrough = 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 (down.isNode() && down.isParent() && !down.pannable()) { - allowPassthrough = false; - break; - } - } - } else { - allowPassthrough = true; - } - return allowPassthrough; - }; - var setGrabbed = function setGrabbed2(ele) { - ele[0]._private.grabbed = true; - }; - var setFreed = function setFreed2(ele) { - ele[0]._private.grabbed = false; - }; - var setInDragLayer = function setInDragLayer2(ele) { - ele[0]._private.rscratch.inDragLayer = true; - }; - var setOutDragLayer = function setOutDragLayer2(ele) { - ele[0]._private.rscratch.inDragLayer = false; - }; - var setGrabTarget = function setGrabTarget2(ele) { - ele[0]._private.rscratch.isGrabTarget = true; - }; - var removeGrabTarget = function removeGrabTarget2(ele) { - ele[0]._private.rscratch.isGrabTarget = false; - }; - var addToDragList = function addToDragList2(ele, opts) { - var list = opts.addToList; - var listHasEle = list.has(ele); - if (!listHasEle && ele.grabbable() && !ele.locked()) { - list.merge(ele); - setGrabbed(ele); - } - }; - var addDescendantsToDrag = function addDescendantsToDrag2(node2, opts) { - if (!node2.cy().hasCompoundNodes()) { - return; - } - if (opts.inDragLayer == null && opts.addToList == null) { - return; - } - var innerNodes = node2.descendants(); - if (opts.inDragLayer) { - innerNodes.forEach(setInDragLayer); - innerNodes.connectedEdges().forEach(setInDragLayer); - } - if (opts.addToList) { - addToDragList(innerNodes, opts); - } - }; - var addNodesToDrag = function addNodesToDrag2(nodes2, opts) { - opts = opts || {}; - var hasCompoundNodes = nodes2.cy().hasCompoundNodes(); - if (opts.inDragLayer) { - nodes2.forEach(setInDragLayer); - nodes2.neighborhood().stdFilter(function(ele) { - return !hasCompoundNodes || ele.isEdge(); - }).forEach(setInDragLayer); - } - if (opts.addToList) { - nodes2.forEach(function(ele) { - addToDragList(ele, opts); - }); - } - addDescendantsToDrag(nodes2, opts); - updateAncestorsInDragLayer(nodes2, { - inDragLayer: opts.inDragLayer - }); - r.updateCachedGrabbedEles(); - }; - var addNodeToDrag = addNodesToDrag; - var freeDraggedElements = function freeDraggedElements2(grabbedEles) { - if (!grabbedEles) { - return; - } - r.getCachedZSortedEles().forEach(function(ele) { - setFreed(ele); - setOutDragLayer(ele); - removeGrabTarget(ele); - }); - r.updateCachedGrabbedEles(); - }; - var updateAncestorsInDragLayer = 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)) { - return; - } - var nodes2 = parent.descendants().spawnSelf().merge(parent).unmerge(node2).unmerge(node2.descendants()); - var edges2 = nodes2.connectedEdges(); - if (opts.inDragLayer) { - edges2.forEach(setInDragLayer); - nodes2.forEach(setInDragLayer); - } - if (opts.addToList) { - nodes2.forEach(function(ele) { - addToDragList(ele, opts); - }); - } - }; - var blurActiveDomElement = function blurActiveDomElement2() { - if (document.activeElement != null && document.activeElement.blur != null) { - document.activeElement.blur(); - } - }; - 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]; - var rNodes = mutn.removedNodes; - if (rNodes) { - for (var j = 0; j < rNodes.length; j++) { - var rNode = rNodes[j]; - if (rNode === r.container) { - r.destroy(); + if (parentNode == secondNode) { + return true; + } + ownerGraph = parentNode.getOwner(); + if (ownerGraph == null) { + break; + } + } while (true); + ownerGraph = secondNode.getOwner(); + do { + parentNode = ownerGraph.getParent(); + if (parentNode == null) { + break; + } + if (parentNode == firstNode) { + return true; + } + ownerGraph = parentNode.getOwner(); + if (ownerGraph == null) { break; } + } while (true); + return false; + }; + LGraphManager.prototype.calcLowestCommonAncestors = function() { + var edge; + var sourceNode; + var targetNode; + var sourceAncestorGraph; + var targetAncestorGraph; + 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; + edge.sourceInLca = sourceNode; + edge.targetInLca = targetNode; + if (sourceNode == targetNode) { + edge.lca = sourceNode.getOwner(); + continue; + } + sourceAncestorGraph = sourceNode.getOwner(); + while (edge.lca == null) { + edge.targetInLca = targetNode; + targetAncestorGraph = targetNode.getOwner(); + while (edge.lca == null) { + if (targetAncestorGraph == sourceAncestorGraph) { + edge.lca = targetAncestorGraph; + break; + } + if (targetAncestorGraph == this.rootGraph) { + break; + } + if (edge.lca != null) { + throw "assert failed"; + } + edge.targetInLca = targetAncestorGraph.getParent(); + targetAncestorGraph = edge.targetInLca.getOwner(); + } + if (sourceAncestorGraph == this.rootGraph) { + break; + } + if (edge.lca == null) { + edge.sourceInLca = sourceAncestorGraph.getParent(); + sourceAncestorGraph = edge.sourceInLca.getOwner(); + } + } + if (edge.lca == null) { + throw "assert failed"; + } } - } - } - }); - if (r.container.parentNode) { - r.removeObserver.observe(r.container.parentNode, { - childList: true - }); - } - } else { - r.registerBinding(r.container, "DOMNodeRemoved", function(e) { - r.destroy(); - }); - } - var onResize = debounce_1(function() { - r.cy.resize(); - }, 100); - if (haveMutationsApi) { - r.styleObserver = new MutationObserver(onResize); - r.styleObserver.observe(r.container, { - attributes: true - }); - } - r.registerBinding(window, "resize", onResize); - if (haveResizeObserverApi) { - r.resizeObserver = new ResizeObserver(onResize); - r.resizeObserver.observe(r.container); - } - var forEachUp = function forEachUp2(domEle, fn2) { - while (domEle != null) { - fn2(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); - }); - r.registerBinding(r.container, "contextmenu", function(e) { - e.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 height2 = containerPageCoords[3]; - var positions = e.touches ? e.touches : [e]; - 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 + height2) { - atLeastOnePosInside = true; - break; - } - } - if (!atLeastOnePosInside) { - return false; - } - var container = r.container; - var target = e.target; - var tParent = target.parentNode; - var containerIsTarget = false; - while (tParent) { - if (tParent === container) { - containerIsTarget = true; - break; - } - tParent = tParent.parentNode; - } - if (!containerIsTarget) { - return false; - } - return true; - }; - r.registerBinding(r.container, "mousedown", function mousedownHandler(e) { - if (!eventInContainer(e)) { - return; - } - e.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 select2 = r.selection; - var nears = r.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) { - return; - } else { - var ele = r.hoverData.down; - if (ele) { - ele.emit({ - originalEvent: e, - type: "taphold", - position: { - x: pos[0], - y: pos[1] + }; + LGraphManager.prototype.calcLowestCommonAncestor = function(firstNode, secondNode) { + if (firstNode == secondNode) { + return firstNode.getOwner(); + } + var firstOwnerGraph = firstNode.getOwner(); + do { + if (firstOwnerGraph == null) { + break; + } + var secondOwnerGraph = secondNode.getOwner(); + do { + if (secondOwnerGraph == null) { + break; } - }); - } else { - cy.emit({ - originalEvent: e, - type: "taphold", - position: { - x: pos[0], - y: pos[1] + if (secondOwnerGraph == firstOwnerGraph) { + return secondOwnerGraph; } - }); + secondOwnerGraph = secondOwnerGraph.getParent().getOwner(); + } while (true); + firstOwnerGraph = firstOwnerGraph.getParent().getOwner(); + } while (true); + return firstOwnerGraph; + }; + LGraphManager.prototype.calcInclusionTreeDepths = function(graph, depth) { + if (graph == null && depth == null) { + graph = this.rootGraph; + depth = 1; } - } - }, r.tapholdDuration); - }; - if (e.which == 3) { - r.hoverData.cxtStarted = true; - var cxtEvt = { - originalEvent: e, - type: "cxttapstart", - position: { - x: pos[0], - y: pos[1] - } - }; - if (near) { - near.activate(); - near.emit(cxtEvt); - r.hoverData.down = near; - } else { - cy.emit(cxtEvt); - } - r.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(); - r.hoverData.cxtDragged = false; - } else if (e.which == 1) { - if (near) { - near.activate(); - } - { - if (near != null) { - if (r.nodeIsGrabbable(near)) { - var makeEvent = function makeEvent2(type2) { - return { - originalEvent: e, - type: type2, - position: { - x: pos[0], - y: pos[1] - } - }; - }; - var triggerGrab = function triggerGrab2(ele) { - ele.emit(makeEvent("grab")); - }; - setGrabTarget(near); - if (!near.selected()) { - draggedElements = r.dragData.possibleDragElements = cy.collection(); - addNodeToDrag(near, { - addToList: draggedElements - }); - near.emit(makeEvent("grabon")).emit(makeEvent("grab")); - } else { - draggedElements = r.dragData.possibleDragElements = cy.collection(); - var selectedNodes = cy.$(function(ele) { - return ele.isNode() && ele.selected() && r.nodeIsGrabbable(ele); - }); - addNodesToDrag(selectedNodes, { - addToList: draggedElements - }); - near.emit(makeEvent("grabon")); - selectedNodes.forEach(triggerGrab); + var node2; + 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); + } + } + }; + LGraphManager.prototype.includesInvalidEdge = function() { + var edge; + 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; } - r.redrawHint("eles", true); - r.redrawHint("drag", true); } + return false; + }; + module3.exports = LGraphManager; + }, + /* 7 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var LayoutConstants = __webpack_require__(0); + function FDLayoutConstants() { } - r.hoverData.down = near; - r.hoverData.downs = nears; - r.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(); - } - triggerEvents(near, ["mousedown", "tapstart", "vmousedown"], e, { - x: pos[0], - y: pos[1] - }); - if (near == null) { - select2[4] = 1; - r.data.bgActivePosistion = { - x: pos[0], - y: pos[1] + __name(FDLayoutConstants, "FDLayoutConstants"); + for (var prop in LayoutConstants) { + FDLayoutConstants[prop] = LayoutConstants[prop]; + } + FDLayoutConstants.MAX_ITERATIONS = 2500; + FDLayoutConstants.DEFAULT_EDGE_LENGTH = 50; + FDLayoutConstants.DEFAULT_SPRING_STRENGTH = 0.45; + FDLayoutConstants.DEFAULT_REPULSION_STRENGTH = 4500; + FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH = 0.4; + FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1; + FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8; + FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5; + FDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = true; + FDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = true; + FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3; + FDLayoutConstants.COOLING_ADAPTATION_FACTOR = 0.33; + FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT = 1e3; + FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT = 5e3; + FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100; + FDLayoutConstants.MAX_NODE_DISPLACEMENT = FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3; + FDLayoutConstants.MIN_REPULSION_DIST = FDLayoutConstants.DEFAULT_EDGE_LENGTH / 10; + FDLayoutConstants.CONVERGENCE_CHECK_PERIOD = 100; + FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1; + FDLayoutConstants.MIN_EDGE_LENGTH = 1; + FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD = 10; + module3.exports = FDLayoutConstants; + }, + /* 8 */ + /***/ + function(module3, exports3, __webpack_require__) { + "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"; + } + var directions = new Array(2); + this.decideDirectionsForOverlappingNodes(rectA, rectB, directions); + overlapAmount[0] = Math.min(rectA.getRight(), rectB.getRight()) - Math.max(rectA.x, rectB.x); + overlapAmount[1] = Math.min(rectA.getBottom(), rectB.getBottom()) - Math.max(rectA.y, rectB.y); + if (rectA.getX() <= rectB.getX() && rectA.getRight() >= rectB.getRight()) { + overlapAmount[0] += Math.min(rectB.getX() - rectA.getX(), rectA.getRight() - rectB.getRight()); + } else if (rectB.getX() <= rectA.getX() && rectB.getRight() >= rectA.getRight()) { + overlapAmount[0] += Math.min(rectA.getX() - rectB.getX(), rectB.getRight() - rectA.getRight()); + } + if (rectA.getY() <= rectB.getY() && rectA.getBottom() >= rectB.getBottom()) { + overlapAmount[1] += Math.min(rectB.getY() - rectA.getY(), rectA.getBottom() - rectB.getBottom()); + } else if (rectB.getY() <= rectA.getY() && rectB.getBottom() >= rectA.getBottom()) { + overlapAmount[1] += Math.min(rectA.getY() - rectB.getY(), rectB.getBottom() - rectA.getBottom()); + } + var slope = Math.abs((rectB.getCenterY() - rectA.getCenterY()) / (rectB.getCenterX() - rectA.getCenterX())); + if (rectB.getCenterY() === rectA.getCenterY() && rectB.getCenterX() === rectA.getCenterX()) { + slope = 1; + } + var moveByY = slope * overlapAmount[0]; + var moveByX = overlapAmount[1] / slope; + if (overlapAmount[0] < moveByX) { + moveByX = overlapAmount[0]; + } else { + moveByY = overlapAmount[1]; + } + overlapAmount[0] = -1 * directions[0] * (moveByX / 2 + separationBuffer); + overlapAmount[1] = -1 * directions[1] * (moveByY / 2 + separationBuffer); }; - r.redrawHint("select", true); - r.redraw(); - } else if (near.pannable()) { - select2[4] = 1; - } - checkForTaphold(); - } - select2[0] = select2[2] = pos[0]; - select2[1] = select2[3] = pos[1]; - }, false); - r.registerBinding(window, "mousemove", function mousemoveHandler(e) { - var capture = r.hoverData.capture; - if (!capture && !eventInContainer(e)) { - 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 select2 = r.selection; - var near = null; - if (!r.hoverData.draggingEles && !r.hoverData.dragging && !r.hoverData.selecting) { - near = r.findNearestElement(pos[0], pos[1], true, false); - } - var last2 = r.hoverData.last; - var down = r.hoverData.down; - var disp = [pos[0] - select2[2], pos[1] - select2[3]]; - var draggedElements = r.dragData.possibleDragElements; - var isOverThresholdDrag; - if (mdownGPos) { - var dx = gpos[0] - mdownGPos[0]; - var dx2 = dx * dx; - var dy = gpos[1] - mdownGPos[1]; - var dy2 = dy * dy; - var dist22 = dx2 + dy2; - r.hoverData.isOverThresholdDrag = isOverThresholdDrag = dist22 >= r.desktopTapThreshold2; - } - var multSelKeyDown = isMultSelKeyDown(e); - if (isOverThresholdDrag) { - r.hoverData.tapholdCancelled = true; - } - var updateDragDelta = function updateDragDelta2() { - var dragDelta2 = r.hoverData.dragDelta = r.hoverData.dragDelta || []; - if (dragDelta2.length === 0) { - dragDelta2.push(disp[0]); - dragDelta2.push(disp[1]); - } else { - dragDelta2[0] += disp[0]; - dragDelta2[1] += disp[1]; - } - }; - preventDefault = true; - triggerEvents(near, ["mousemove", "vmousemove", "tapdrag"], e, { - x: pos[0], - y: pos[1] - }); - var goIntoBoxMode = function goIntoBoxMode2() { - r.data.bgActivePosistion = void 0; - if (!r.hoverData.selecting) { - cy.emit({ - originalEvent: e, - type: "boxstart", - position: { - x: pos[0], - y: pos[1] + IGeometry.decideDirectionsForOverlappingNodes = function(rectA, rectB, directions) { + if (rectA.getCenterX() < rectB.getCenterX()) { + directions[0] = -1; + } else { + directions[0] = 1; + } + if (rectA.getCenterY() < rectB.getCenterY()) { + directions[1] = -1; + } else { + directions[1] = 1; + } + }; + IGeometry.getIntersection2 = function(rectA, rectB, result) { + var p1x = rectA.getCenterX(); + var p1y = rectA.getCenterY(); + var p2x = rectB.getCenterX(); + var p2y = rectB.getCenterY(); + if (rectA.intersects(rectB)) { + result[0] = p1x; + result[1] = p1y; + result[2] = p2x; + result[3] = p2y; + return true; + } + var topLeftAx = rectA.getX(); + var topLeftAy = rectA.getY(); + var topRightAx = rectA.getRight(); + var bottomLeftAx = rectA.getX(); + var bottomLeftAy = rectA.getBottom(); + var bottomRightAx = rectA.getRight(); + var halfWidthA = rectA.getWidthHalf(); + var halfHeightA = rectA.getHeightHalf(); + var topLeftBx = rectB.getX(); + var topLeftBy = rectB.getY(); + var topRightBx = rectB.getRight(); + var bottomLeftBx = rectB.getX(); + var bottomLeftBy = rectB.getBottom(); + var bottomRightBx = rectB.getRight(); + var halfWidthB = rectB.getWidthHalf(); + var halfHeightB = rectB.getHeightHalf(); + var clipPointAFound = false; + var clipPointBFound = false; + if (p1x === p2x) { + if (p1y > p2y) { + result[0] = p1x; + result[1] = topLeftAy; + result[2] = p2x; + result[3] = bottomLeftBy; + return false; + } else if (p1y < p2y) { + result[0] = p1x; + result[1] = bottomLeftAy; + result[2] = p2x; + result[3] = topLeftBy; + return false; + } else { + } + } else if (p1y === p2y) { + if (p1x > p2x) { + result[0] = topLeftAx; + result[1] = p1y; + result[2] = topRightBx; + result[3] = p2y; + return false; + } else if (p1x < p2x) { + result[0] = topRightAx; + result[1] = p1y; + result[2] = topLeftBx; + result[3] = p2y; + return false; + } else { + } + } else { + var slopeA = rectA.height / rectA.width; + var slopeB = rectB.height / rectB.width; + var slopePrime = (p2y - p1y) / (p2x - p1x); + var cardinalDirectionA = void 0; + var cardinalDirectionB = void 0; + var tempPointAx = void 0; + var tempPointAy = void 0; + var tempPointBx = void 0; + var tempPointBy = void 0; + if (-slopeA === slopePrime) { + if (p1x > p2x) { + result[0] = bottomLeftAx; + result[1] = bottomLeftAy; + clipPointAFound = true; + } else { + result[0] = topRightAx; + result[1] = topLeftAy; + clipPointAFound = true; + } + } else if (slopeA === slopePrime) { + if (p1x > p2x) { + result[0] = topLeftAx; + result[1] = topLeftAy; + clipPointAFound = true; + } else { + result[0] = bottomRightAx; + result[1] = bottomLeftAy; + clipPointAFound = true; + } + } + if (-slopeB === slopePrime) { + if (p2x > p1x) { + result[2] = bottomLeftBx; + result[3] = bottomLeftBy; + clipPointBFound = true; + } else { + result[2] = topRightBx; + result[3] = topLeftBy; + clipPointBFound = true; + } + } else if (slopeB === slopePrime) { + if (p2x > p1x) { + result[2] = topLeftBx; + result[3] = topLeftBy; + clipPointBFound = true; + } else { + result[2] = bottomRightBx; + result[3] = bottomLeftBy; + clipPointBFound = true; + } + } + if (clipPointAFound && clipPointBFound) { + return false; + } + if (p1x > p2x) { + if (p1y > p2y) { + cardinalDirectionA = this.getCardinalDirection(slopeA, slopePrime, 4); + cardinalDirectionB = this.getCardinalDirection(slopeB, slopePrime, 2); + } else { + cardinalDirectionA = this.getCardinalDirection(-slopeA, slopePrime, 3); + cardinalDirectionB = this.getCardinalDirection(-slopeB, slopePrime, 1); + } + } else { + if (p1y > p2y) { + cardinalDirectionA = this.getCardinalDirection(-slopeA, slopePrime, 1); + cardinalDirectionB = this.getCardinalDirection(-slopeB, slopePrime, 3); + } else { + cardinalDirectionA = this.getCardinalDirection(slopeA, slopePrime, 2); + cardinalDirectionB = this.getCardinalDirection(slopeB, slopePrime, 4); + } + } + if (!clipPointAFound) { + switch (cardinalDirectionA) { + case 1: + tempPointAy = topLeftAy; + tempPointAx = p1x + -halfHeightA / slopePrime; + result[0] = tempPointAx; + result[1] = tempPointAy; + break; + case 2: + tempPointAx = bottomRightAx; + tempPointAy = p1y + halfWidthA * slopePrime; + result[0] = tempPointAx; + result[1] = tempPointAy; + break; + case 3: + tempPointAy = bottomLeftAy; + tempPointAx = p1x + halfHeightA / slopePrime; + result[0] = tempPointAx; + result[1] = tempPointAy; + break; + case 4: + tempPointAx = bottomLeftAx; + tempPointAy = p1y + -halfWidthA * slopePrime; + result[0] = tempPointAx; + result[1] = tempPointAy; + break; + } + } + if (!clipPointBFound) { + switch (cardinalDirectionB) { + case 1: + tempPointBy = topLeftBy; + tempPointBx = p2x + -halfHeightB / slopePrime; + result[2] = tempPointBx; + result[3] = tempPointBy; + break; + case 2: + tempPointBx = bottomRightBx; + tempPointBy = p2y + halfWidthB * slopePrime; + result[2] = tempPointBx; + result[3] = tempPointBy; + break; + case 3: + tempPointBy = bottomLeftBy; + tempPointBx = p2x + halfHeightB / slopePrime; + result[2] = tempPointBx; + result[3] = tempPointBy; + break; + case 4: + tempPointBx = bottomLeftBx; + tempPointBy = p2y + -halfWidthB * slopePrime; + result[2] = tempPointBx; + result[3] = tempPointBy; + break; + } + } } - }); - } - select2[4] = 1; - r.hoverData.selecting = true; - r.redrawHint("select", true); - r.redraw(); - }; - if (r.hoverData.which === 3) { - if (isOverThresholdDrag) { - var cxtEvt = { - originalEvent: e, - type: "cxtdrag", - position: { - x: pos[0], - y: pos[1] + return false; + }; + IGeometry.getCardinalDirection = function(slope, slopePrime, line2) { + if (slope > slopePrime) { + return line2; + } else { + return 1 + line2 % 4; } }; - if (down) { - down.emit(cxtEvt); - } 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, - type: "cxtdragout", - position: { - x: pos[0], - y: pos[1] - } - }); + IGeometry.getIntersection = function(s1, s2, f1, f22) { + if (f22 == null) { + return this.getIntersection2(s1, s2, f1); } - r.hoverData.cxtOver = near; - if (near) { - near.emit({ - originalEvent: e, - type: "cxtdragover", - position: { - x: pos[0], - y: pos[1] - } - }); + var x1 = s1.x; + var y1 = s1.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, c22 = void 0; + var denom = void 0; + 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; } - } - } - } else if (r.hoverData.dragging) { - preventDefault = true; - if (cy.panningEnabled() && cy.userPanningEnabled()) { - var deltaP; - if (r.hoverData.justStartedPan) { - var mdPos = r.hoverData.mdownPos; - deltaP = { - x: (pos[0] - mdPos[0]) * zoom, - y: (pos[1] - mdPos[1]) * zoom - }; - r.hoverData.justStartedPan = false; - } else { - deltaP = { - x: disp[0] * zoom, - y: disp[1] * zoom - }; - } - cy.panBy(deltaP); - cy.emit("dragpan"); - r.hoverData.dragged = true; - } - pos = r.projectIntoViewport(e.clientX, e.clientY); - } else if (select2[4] == 1 && (down == null || down.pannable())) { - if (isOverThresholdDrag) { - if (!r.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); - if (allowPassthrough) { - r.hoverData.dragging = true; - r.hoverData.justStartedPan = true; - select2[4] = 0; - r.data.bgActivePosistion = array2point(mdownPos); - r.redrawHint("select", true); - r.redraw(); + 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; + if (Cx !== Nx) { + C_angle = Math.atan((Ny - Cy) / (Nx - Cx)); + if (Nx < Cx) { + C_angle += Math.PI; + } else if (Ny < Cy) { + C_angle += this.TWO_PI; + } + } else if (Ny < Cy) { + C_angle = this.ONE_AND_HALF_PI; + } else { + C_angle = this.HALF_PI; } + return C_angle; + }; + 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 = ((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; + } + }; + IGeometry.HALF_PI = 0.5 * Math.PI; + IGeometry.ONE_AND_HALF_PI = 1.5 * Math.PI; + IGeometry.TWO_PI = 2 * Math.PI; + IGeometry.THREE_PI = 3 * Math.PI; + module3.exports = IGeometry; + }, + /* 9 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function IMath() { } - if (down && down.pannable() && down.active()) { - down.unactivate(); - } - } - } else { - if (down && down.pannable() && down.active()) { - down.unactivate(); - } - if ((!down || !down.grabbed()) && near != last2) { - if (last2) { - triggerEvents(last2, ["mouseout", "tapdragout"], e, { - x: pos[0], - y: pos[1] - }); - } - if (near) { - triggerEvents(near, ["mouseover", "tapdragover"], e, { - x: pos[0], - y: pos[1] - }); + __name(IMath, "IMath"); + IMath.sign = function(value2) { + if (value2 > 0) { + return 1; + } else if (value2 < 0) { + return -1; + } else { + return 0; + } + }; + IMath.floor = function(value2) { + return value2 < 0 ? Math.ceil(value2) : Math.floor(value2); + }; + IMath.ceil = function(value2) { + return value2 < 0 ? Math.floor(value2) : Math.ceil(value2); + }; + module3.exports = IMath; + }, + /* 10 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function Integer() { } - r.hoverData.last = near; - } - if (down) { - if (isOverThresholdDrag) { - if (cy.boxSelectionEnabled() && multSelKeyDown) { - if (down && down.grabbed()) { - freeDraggedElements(draggedElements); - down.emit("freeon"); - draggedElements.emit("free"); - if (r.dragData.didDrag) { - down.emit("dragfreeon"); - draggedElements.emit("dragfree"); - } - } - goIntoBoxMode(); - } else if (down && down.grabbed() && r.nodeIsDraggable(down)) { - var justStartedDrag = !r.dragData.didDrag; - if (justStartedDrag) { - r.redrawHint("eles", true); + __name(Integer, "Integer"); + Integer.MAX_VALUE = 2147483647; + Integer.MIN_VALUE = -2147483648; + module3.exports = Integer; + }, + /* 11 */ + /***/ + function(module3, exports3, __webpack_require__) { + "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; + Object.defineProperty(target, descriptor.key, descriptor); } - r.dragData.didDrag = true; - if (!r.hoverData.draggingEles) { - addNodesToDrag(draggedElements, { - inDragLayer: true + } + __name(defineProperties, "defineProperties"); + return function(Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + function _classCallCheck2(instance2, Constructor) { + if (!(instance2 instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + __name(_classCallCheck2, "_classCallCheck"); + var nodeFrom = /* @__PURE__ */ __name(function nodeFrom2(value2) { + return { value: value2, next: null, prev: null }; + }, "nodeFrom"); + var add3 = /* @__PURE__ */ __name(function add4(prev2, node2, next3, list2) { + if (prev2 !== null) { + prev2.next = node2; + } else { + list2.head = node2; + } + if (next3 !== null) { + next3.prev = node2; + } else { + list2.tail = node2; + } + node2.prev = prev2; + node2.next = next3; + list2.length++; + return node2; + }, "add"); + var _remove = /* @__PURE__ */ __name(function _remove2(node2, list2) { + var prev2 = node2.prev, next3 = node2.next; + if (prev2 !== null) { + prev2.next = next3; + } else { + list2.head = next3; + } + 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; + _classCallCheck2(this, LinkedList2); + this.length = 0; + this.head = null; + this.tail = null; + if (vals != null) { + vals.forEach(function(v3) { + return _this.push(v3); }); } - var totalShift = { - x: 0, - y: 0 - }; - if (number$12(disp[0]) && number$12(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])) { - totalShift.x += dragDelta[0]; - totalShift.y += dragDelta[1]; + } + __name(LinkedList2, "LinkedList"); + _createClass2(LinkedList2, [{ + key: "size", + value: /* @__PURE__ */ __name(function size5() { + return this.length; + }, "size") + }, { + key: "insertBefore", + value: /* @__PURE__ */ __name(function insertBefore(val, otherNode) { + return add3(otherNode.prev, nodeFrom(val), otherNode, this); + }, "insertBefore") + }, { + key: "insertAfter", + value: /* @__PURE__ */ __name(function insertAfter(val, otherNode) { + return add3(otherNode, nodeFrom(val), otherNode.next, this); + }, "insertAfter") + }, { + key: "insertNodeBefore", + value: /* @__PURE__ */ __name(function insertNodeBefore(newNode, otherNode) { + return add3(otherNode.prev, newNode, otherNode, this); + }, "insertNodeBefore") + }, { + key: "insertNodeAfter", + value: /* @__PURE__ */ __name(function insertNodeAfter(newNode, otherNode) { + return add3(otherNode, newNode, otherNode.next, this); + }, "insertNodeAfter") + }, { + key: "push", + value: /* @__PURE__ */ __name(function push3(val) { + return add3(this.tail, nodeFrom(val), null, this); + }, "push") + }, { + key: "unshift", + value: /* @__PURE__ */ __name(function unshift(val) { + return add3(null, nodeFrom(val), this.head, this); + }, "unshift") + }, { + key: "remove", + value: /* @__PURE__ */ __name(function remove3(node2) { + return _remove(node2, this); + }, "remove") + }, { + key: "pop", + value: /* @__PURE__ */ __name(function pop() { + return _remove(this.tail, this).value; + }, "pop") + }, { + key: "popNode", + value: /* @__PURE__ */ __name(function popNode() { + return _remove(this.tail, this); + }, "popNode") + }, { + key: "shift", + value: /* @__PURE__ */ __name(function shift2() { + return _remove(this.head, this).value; + }, "shift") + }, { + key: "shiftNode", + value: /* @__PURE__ */ __name(function shiftNode() { + return _remove(this.head, this); + }, "shiftNode") + }, { + key: "get_object_at", + value: /* @__PURE__ */ __name(function get_object_at(index) { + if (index <= this.length()) { + var i2 = 1; + var current = this.head; + while (i2 < index) { + current = current.next; + i2++; } + return current.value; } - } - r.hoverData.draggingEles = true; - draggedElements.silentShift(totalShift).emit("position drag"); - r.redrawHint("drag", true); - r.redraw(); + }, "get_object_at") + }, { + key: "set_object_at", + value: /* @__PURE__ */ __name(function set_object_at(index, value2) { + if (index <= this.length()) { + var i2 = 1; + var current = this.head; + while (i2 < index) { + current = current.next; + i2++; + } + current.value = value2; + } + }, "set_object_at") + }]); + return LinkedList2; + }(); + module3.exports = LinkedList; + }, + /* 12 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function Point3(x5, y5, p3) { + this.x = null; + this.y = null; + if (x5 == null && y5 == null && p3 == null) { + this.x = 0; + this.y = 0; + } 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; } - } else { - updateDragDelta(); - } - } - preventDefault = true; - } - select2[2] = pos[0]; - select2[3] = pos[1]; - if (preventDefault) { - if (e.stopPropagation) - e.stopPropagation(); - if (e.preventDefault) - e.preventDefault(); - return false; - } - }, false); - var clickTimeout, didDoubleClick, prevClickTimeStamp; - r.registerBinding(window, "mouseup", function mouseupHandler(e) { - var capture = r.hoverData.capture; - if (!capture) { - return; - } - r.hoverData.capture = false; - var cy = r.cy; - var pos = r.projectIntoViewport(e.clientX, e.clientY); - var select2 = 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; - if (down) { - down.unactivate(); - } - if (r.hoverData.which === 3) { - var cxtEvt = { - originalEvent: e, - type: "cxttapend", - position: { - x: pos[0], - y: pos[1] } - }; - if (down) { - down.emit(cxtEvt); - } else { - cy.emit(cxtEvt); - } - if (!r.hoverData.cxtDragged) { - var cxtTap = { - originalEvent: e, - type: "cxttap", - position: { - x: pos[0], - y: pos[1] - } + __name(Point3, "Point"); + Point3.prototype.getX = function() { + return this.x; }; - if (down) { - down.emit(cxtTap); - } else { - cy.emit(cxtTap); - } - } - r.hoverData.cxtDragged = false; - r.hoverData.which = null; - } else if (r.hoverData.which === 1) { - triggerEvents(near, ["mouseup", "tapend", "vmouseup"], e, { - 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, { - x: pos[0], - y: pos[1] - }); - didDoubleClick = false; - if (e.timeStamp - prevClickTimeStamp <= cy.multiClickDebounceTime()) { - clickTimeout && clearTimeout(clickTimeout); - didDoubleClick = true; - prevClickTimeStamp = null; - triggerEvents(down, ["dblclick", "dbltap", "vdblclick"], e, { - x: pos[0], - y: pos[1] - }); - } else { - clickTimeout = setTimeout(function() { - if (didDoubleClick) - return; - triggerEvents(down, ["oneclick", "onetap", "voneclick"], e, { - x: pos[0], - y: pos[1] - }); - }, cy.multiClickDebounceTime()); - prevClickTimeStamp = e.timeStamp; - } - } - if (down == null && !r.dragData.didDrag && !r.hoverData.selecting && !r.hoverData.dragged && !isMultSelKeyDown(e)) { - cy.$(isSelected).unselect(["tapunselect"]); - if (draggedElements.length > 0) { - r.redrawHint("eles", true); - } - r.dragData.possibleDragElements = draggedElements = cy.collection(); - } - if (near == down && !r.dragData.didDrag && !r.hoverData.selecting) { - if (near != null && near._private.selectable) { - if (r.hoverData.dragging) - ; - else if (cy.selectionType() === "additive" || multSelKeyDown) { - if (near.selected()) { - near.unselect(["tapunselect"]); + Point3.prototype.getY = function() { + return this.y; + }; + Point3.prototype.getLocation = function() { + return new Point3(this.x, this.y); + }; + 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 { - near.select(["tapselect"]); - } - } else { - if (!multSelKeyDown) { - cy.$(isSelected).unmerge(near).unselect(["tapunselect"]); - near.select(["tapselect"]); + this.x = Math.floor(x5 + 0.5); + this.y = Math.floor(y5 + 0.5); } } - r.redrawHint("eles", true); - } - } - if (r.hoverData.selecting) { - var box = cy.collection(r.getAllInBox(select2[0], select2[1], select2[2], select2[3])); - r.redrawHint("select", true); - if (box.length > 0) { - r.redrawHint("eles", true); - } - cy.emit({ - type: "boxend", - originalEvent: e, - position: { - x: pos[0], - y: pos[1] + }; + Point3.prototype.move = function(x5, y5) { + this.x = x5; + this.y = y5; + }; + Point3.prototype.translate = function(dx, dy) { + this.x += dx; + this.y += dy; + }; + Point3.prototype.equals = function(obj) { + if (obj.constructor.name == "Point") { + var pt = obj; + return this.x == pt.x && this.y == pt.y; } - }); - var eleWouldBeSelected = function eleWouldBeSelected2(ele) { - return ele.selectable() && !ele.selected(); + return this == obj; }; - if (cy.selectionType() === "additive") { - box.emit("box").stdFilter(eleWouldBeSelected).select().emit("boxselect"); - } else { - if (!multSelKeyDown) { - cy.$(isSelected).unmerge(box).unselect(); + Point3.prototype.toString = function() { + return new Point3().constructor.name + "[x=" + this.x + ",y=" + this.y + "]"; + }; + module3.exports = Point3; + }, + /* 13 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function RectangleD(x5, y5, width3, height2) { + this.x = 0; + this.y = 0; + this.width = 0; + this.height = 0; + if (x5 != null && y5 != null && width3 != null && height2 != null) { + this.x = x5; + this.y = y5; + this.width = width3; + this.height = height2; } - box.emit("box").stdFilter(eleWouldBeSelected).select().emit("boxselect"); } - r.redraw(); - } - if (r.hoverData.dragging) { - r.hoverData.dragging = false; - r.redrawHint("select", true); - r.redrawHint("eles", true); - r.redraw(); - } - if (!select2[4]) { - r.redrawHint("drag", true); - r.redrawHint("eles", true); - var downWasGrabbed = down && down.grabbed(); - freeDraggedElements(draggedElements); - if (downWasGrabbed) { - down.emit("freeon"); - draggedElements.emit("free"); - if (r.dragData.didDrag) { - down.emit("dragfreeon"); - draggedElements.emit("dragfree"); + __name(RectangleD, "RectangleD"); + RectangleD.prototype.getX = function() { + return this.x; + }; + RectangleD.prototype.setX = function(x5) { + this.x = x5; + }; + RectangleD.prototype.getY = function() { + return this.y; + }; + RectangleD.prototype.setY = function(y5) { + this.y = y5; + }; + RectangleD.prototype.getWidth = function() { + return this.width; + }; + RectangleD.prototype.setWidth = function(width3) { + this.width = width3; + }; + RectangleD.prototype.getHeight = function() { + return this.height; + }; + RectangleD.prototype.setHeight = function(height2) { + this.height = height2; + }; + RectangleD.prototype.getRight = function() { + return this.x + this.width; + }; + RectangleD.prototype.getBottom = function() { + return this.y + this.height; + }; + RectangleD.prototype.intersects = function(a2) { + if (this.getRight() < a2.x) { + return false; } - } - } - } - select2[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) { - 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(); - 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(); - }, 150); - var diff; - if (e.deltaY != null) { - diff = e.deltaY / -250; - } else if (e.wheelDeltaY != null) { - diff = e.wheelDeltaY / 1e3; - } else { - diff = e.wheelDelta / 1e3; - } - diff = diff * r.wheelSensitivity; - var needsWheelFix = e.deltaMode === 1; - if (needsWheelFix) { - diff *= 33; - } - var newZoom = cy.zoom() * Math.pow(10, diff); - if (e.type === "gesturechange") { - newZoom = r.gestureStartZoom * e.scale; - } - cy.zoom({ - level: newZoom, - renderedPosition: { - x: rpos[0], - y: rpos[1] - } - }); - cy.emit(e.type === "gesturechange" ? "pinchzoom" : "scrollzoom"); - } - }; - r.registerBinding(r.container, "wheel", wheelHandler, true); - r.registerBinding(window, "scroll", function scrollHandler(e) { - r.scrollingPage = true; - clearTimeout(r.scrollingPageTimeout); - r.scrollingPageTimeout = setTimeout(function() { - r.scrollingPage = false; - }, 250); - }, true); - r.registerBinding(r.container, "gesturestart", function gestureStartHandler(e) { - r.gestureStartZoom = r.cy.zoom(); - if (!r.hasTouchStarted) { - e.preventDefault(); - } - }, true); - r.registerBinding(r.container, "gesturechange", function(e) { - if (!r.hasTouchStarted) { - wheelHandler(e); - } - }, true); - r.registerBinding(r.container, "mouseout", function mouseOutHandler(e) { - var pos = r.projectIntoViewport(e.clientX, e.clientY); - r.cy.emit({ - originalEvent: e, - 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, - type: "mouseover", - position: { - x: pos[0], - y: pos[1] - } - }); - }, 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 touchstartHandler; - r.registerBinding(r.container, "touchstart", touchstartHandler = function touchstartHandler2(e) { - r.hasTouchStarted = true; - if (!eventInContainer(e)) { - 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(); - 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; - 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(); - 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]; - 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 (near1 && near1.isNode()) { - near1.activate().emit({ - originalEvent: e, - type: "cxttapstart", - position: { - x: now3[0], - y: now3[1] - } - }); - r.touchData.start = near1; - } else if (near2 && near2.isNode()) { - near2.activate().emit({ - originalEvent: e, - type: "cxttapstart", - position: { - x: now3[0], - y: now3[1] - } - }); - r.touchData.start = near2; - } else { - cy.emit({ - originalEvent: e, - type: "cxttapstart", - position: { - x: now3[0], - y: now3[1] + if (this.getBottom() < a2.y) { + return false; + } + if (a2.getRight() < this.x) { + return false; + } + if (a2.getBottom() < this.y) { + return false; + } + return true; + }; + RectangleD.prototype.getCenterX = function() { + return this.x + this.width / 2; + }; + RectangleD.prototype.getMinX = function() { + return this.getX(); + }; + RectangleD.prototype.getMaxX = function() { + return this.getX() + this.width; + }; + RectangleD.prototype.getCenterY = function() { + return this.y + this.height / 2; + }; + RectangleD.prototype.getMinY = function() { + return this.getY(); + }; + RectangleD.prototype.getMaxY = function() { + return this.getY() + this.height; + }; + RectangleD.prototype.getWidthHalf = function() { + return this.width / 2; + }; + RectangleD.prototype.getHeightHalf = function() { + return this.height / 2; + }; + module3.exports = RectangleD; + }, + /* 14 */ + /***/ + function(module3, exports3, __webpack_require__) { + "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)) { + return obj; + } + if (obj.uniqueID != null) { + return obj.uniqueID; + } + obj.uniqueID = UniqueIDGeneretor.getString(); + UniqueIDGeneretor.lastID++; + return obj.uniqueID; + }; + UniqueIDGeneretor.getString = function(id27) { + if (id27 == null) id27 = UniqueIDGeneretor.lastID; + return "Object#" + id27; + }; + UniqueIDGeneretor.isPrimitive = function(arg) { + 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++) { + arr2[i2] = arr[i2]; } - }); + return arr2; + } else { + return Array.from(arr); + } } - if (r.touchData.start) { - r.touchData.start._private.grabbed = false; + __name(_toConsumableArray, "_toConsumableArray"); + var LayoutConstants = __webpack_require__(0); + var LGraphManager = __webpack_require__(6); + var LNode = __webpack_require__(3); + var LEdge = __webpack_require__(1); + var LGraph = __webpack_require__(5); + var PointD = __webpack_require__(4); + var Transform2 = __webpack_require__(17); + var Emitter3 = __webpack_require__(27); + function Layout2(isRemoteUse) { + Emitter3.call(this); + this.layoutQuality = LayoutConstants.QUALITY; + this.createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED; + this.incremental = LayoutConstants.DEFAULT_INCREMENTAL; + this.animationOnLayout = LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT; + this.animationDuringLayout = LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT; + this.animationPeriod = LayoutConstants.DEFAULT_ANIMATION_PERIOD; + this.uniformLeafNodeSizes = LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES; + this.edgeToDummyNodes = /* @__PURE__ */ new Map(); + this.graphManager = new LGraphManager(this); + this.isLayoutFinished = false; + this.isSubLayout = false; + this.isRemoteUse = false; + if (isRemoteUse != null) { + this.isRemoteUse = isRemoteUse; + } } - r.touchData.cxt = true; - r.touchData.cxtDragged = false; - r.data.bgActivePosistion = void 0; - r.redraw(); - return; - } - } - if (e.touches[2]) { - if (cy.boxSelectionEnabled()) { - e.preventDefault(); - } - } else if (e.touches[1]) - ; - else if (e.touches[0]) { - var nears = r.findNearestElements(now3[0], now3[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(); - var selectedNodes = null; - r.redrawHint("eles", true); - r.redrawHint("drag", true); - if (near.selected()) { - selectedNodes = cy.$(function(ele) { - return ele.selected() && r.nodeIsGrabbable(ele); - }); - addNodesToDrag(selectedNodes, { - addToList: draggedEles - }); - } else { - addNodeToDrag(near, { - addToList: draggedEles - }); + __name(Layout2, "Layout"); + Layout2.RANDOM_SEED = 1; + Layout2.prototype = Object.create(Emitter3.prototype); + Layout2.prototype.getGraphManager = function() { + return this.graphManager; + }; + Layout2.prototype.getAllNodes = function() { + return this.graphManager.getAllNodes(); + }; + Layout2.prototype.getAllEdges = function() { + return this.graphManager.getAllEdges(); + }; + Layout2.prototype.getAllNodesToApplyGravitation = function() { + return this.graphManager.getAllNodesToApplyGravitation(); + }; + Layout2.prototype.newGraphManager = function() { + var gm = new LGraphManager(this); + this.graphManager = gm; + return gm; + }; + Layout2.prototype.newGraph = function(vGraph) { + return new LGraph(null, this.graphManager, vGraph); + }; + Layout2.prototype.newNode = function(vNode) { + return new LNode(this.graphManager, vNode); + }; + Layout2.prototype.newEdge = function(vEdge) { + return new LEdge(null, null, vEdge); + }; + Layout2.prototype.checkLayoutSuccess = function() { + return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge(); + }; + Layout2.prototype.runLayout = function() { + this.isLayoutFinished = false; + if (this.tilingPreLayout) { + this.tilingPreLayout(); } - setGrabTarget(near); - var makeEvent = function makeEvent2(type2) { - return { - originalEvent: e, - type: type2, - position: { - x: now3[0], - y: now3[1] - } - }; - }; - near.emit(makeEvent("grabon")); - if (selectedNodes) { - selectedNodes.forEach(function(n) { - n.emit(makeEvent("grab")); - }); + this.initParameters(); + var isLayoutSuccessfull; + if (this.checkLayoutSuccess()) { + isLayoutSuccessfull = false; } else { - near.emit(makeEvent("grab")); + isLayoutSuccessfull = this.layout(); } - } - } - triggerEvents(near, ["touchstart", "tapstart", "vmousedown"], e, { - x: now3[0], - y: now3[1] - }); - if (near == null) { - r.data.bgActivePosistion = { - x: pos[0], - y: pos[1] + if (LayoutConstants.ANIMATE === "during") { + return false; + } + if (isLayoutSuccessfull) { + if (!this.isSubLayout) { + this.doPostLayout(); + } + } + if (this.tilingPostLayout) { + this.tilingPostLayout(); + } + this.isLayoutFinished = true; + return isLayoutSuccessfull; }; - 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] - }); - } - }, r.tapholdDuration); - } - if (e.touches.length >= 1) { - var sPos = r.touchData.startPosition = []; - for (var i3 = 0; i3 < now3.length; i3++) { - sPos[i3] = earlier[i3] = now3[i3]; - } - var touch0 = e.touches[0]; - r.touchData.startGPosition = [touch0.clientX, touch0.clientY]; - } - }, false); - var touchmoveHandler; - r.registerBinding(window, "touchmove", touchmoveHandler = function touchmoveHandler2(e) { - var capture = r.touchData.capture; - if (!capture && !eventInContainer(e)) { - return; - } - var select2 = 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 isOverThresholdDrag; - if (capture && e.touches[0] && startGPos) { - var disp = []; - for (var j = 0; j < now3.length; j++) { - disp[j] = now3[j] - earlier[j]; - } - var dx = e.touches[0].clientX - startGPos[0]; - var dx2 = dx * dx; - var dy = e.touches[0].clientY - startGPos[1]; - var dy2 = dy * dy; - var dist22 = dx2 + dy2; - isOverThresholdDrag = dist22 >= r.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; - var distance2Sq = distanceSq(f1x2, f1y2, f2x2, f2y2); - var factorSq = distance2Sq / distance1Sq; - var distThreshold = 150; - var distThresholdSq = distThreshold * distThreshold; - 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); - var cxtEvt = { - originalEvent: e, - type: "cxttapend", - position: { - x: now3[0], - y: now3[1] + Layout2.prototype.doPostLayout = function() { + if (!this.incremental) { + this.transform(); } + this.update(); }; - if (r.touchData.start) { - r.touchData.start.unactivate().emit(cxtEvt); - r.touchData.start = null; - } else { - cy.emit(cxtEvt); - } - } - } - if (capture && r.touchData.cxt) { - var cxtEvt = { - originalEvent: e, - type: "cxtdrag", - position: { - x: now3[0], - y: now3[1] - } - }; - r.data.bgActivePosistion = void 0; - r.redrawHint("select", true); - if (r.touchData.start) { - r.touchData.start.emit(cxtEvt); - } else { - cy.emit(cxtEvt); - } - if (r.touchData.start) { - r.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, - type: "cxtdragout", - position: { - x: now3[0], - y: now3[1] + Layout2.prototype.update2 = function() { + if (this.createBendsAsNeeded) { + this.createBendpointsFromDummyNodes(); + this.graphManager.resetAllEdges(); + } + if (!this.isRemoteUse) { + var edge; + var allEdges = this.graphManager.getAllEdges(); + for (var i2 = 0; i2 < allEdges.length; i2++) { + edge = allEdges[i2]; } - }); - } - r.touchData.cxtOver = near; - if (near) { - near.emit({ - originalEvent: e, - type: "cxtdragover", - position: { - x: now3[0], - y: now3[1] + var node2; + var nodes6 = this.graphManager.getRoot().getNodes(); + for (var i2 = 0; i2 < nodes6.length; i2++) { + node2 = nodes6[i2]; } - }); - } - } - } else if (capture && e.touches[2] && cy.boxSelectionEnabled()) { - e.preventDefault(); - r.data.bgActivePosistion = void 0; - this.lastThreeTouch = +/* @__PURE__ */ new Date(); - if (!r.touchData.selecting) { - cy.emit({ - originalEvent: e, - type: "boxstart", - position: { - x: now3[0], - y: now3[1] + this.update(this.graphManager.getRoot()); } - }); - } - r.touchData.selecting = true; - r.touchData.didSelect = true; - select2[4] = 1; - if (!select2 || select2.length === 0 || select2[0] === void 0) { - select2[0] = (now3[0] + now3[2] + now3[4]) / 3; - select2[1] = (now3[1] + now3[3] + now3[5]) / 3; - select2[2] = (now3[0] + now3[2] + now3[4]) / 3 + 1; - select2[3] = (now3[1] + now3[3] + now3[5]) / 3 + 1; - } else { - select2[2] = (now3[0] + now3[2] + now3[4]) / 3; - select2[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; - if (draggedEles) { - r.redrawHint("drag", true); - for (var i3 = 0; i3 < draggedEles.length; i3++) { - var de_p = draggedEles[i3]._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 distance22 = distance2(f1x2, f1y2, f2x2, f2y2); - var factor = distance22 / distance1; - if (twoFingersStartInside) { - var df1x = f1x2 - f1x1; - var df1y = f1y2 - f1y1; - var df2x = f2x2 - f2x1; - var df2y = f2y2 - f2y1; - var tx = (df1x + df2x) / 2; - var ty = (df1y + df2y) / 2; - var zoom1 = cy.zoom(); - var zoom2 = 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 }; - if (_start && _start.active()) { - var draggedEles = r.dragData.touchDragEles; - freeDraggedElements(draggedEles); - r.redrawHint("drag", true); - r.redrawHint("eles", true); - _start.unactivate().emit("freeon"); - draggedEles.emit("free"); - if (r.dragData.didDrag) { - _start.emit("dragfreeon"); - draggedEles.emit("dragfree"); - } - } - cy.viewport({ - zoom: zoom2, - pan: pan2, - cancelOnFailedZoom: true - }); - cy.emit("pinchzoom"); - distance1 = distance22; - f1x1 = f1x2; - 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; - var near; - if (!r.hoverData.draggingEles && !r.swipePanning) { - near = r.findNearestElement(now3[0], now3[1], true, true); - } - if (capture && start2 != null) { - e.preventDefault(); - } - if (capture && start2 != null && r.nodeIsDraggable(start2)) { - if (isOverThresholdDrag) { - var draggedEles = r.dragData.touchDragEles; - var justStartedDrag = !r.dragData.didDrag; - if (justStartedDrag) { - addNodesToDrag(draggedEles, { - inDragLayer: true - }); - } - r.dragData.didDrag = true; - var totalShift = { - x: 0, - y: 0 - }; - if (number$12(disp[0]) && number$12(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])) { - totalShift.x += dragDelta[0]; - totalShift.y += dragDelta[1]; + Layout2.prototype.update = function(obj) { + if (obj == null) { + this.update2(); + } else if (obj instanceof LNode) { + var node2 = obj; + if (node2.getChild() != null) { + var nodes6 = node2.getChild().getNodes(); + for (var i2 = 0; i2 < nodes6.length; i2++) { + update(nodes6[i2]); } } + if (node2.vGraphObject != null) { + var vNode = node2.vGraphObject; + vNode.update(node2); + } + } else if (obj instanceof LEdge) { + var edge = obj; + if (edge.vGraphObject != null) { + var vEdge = edge.vGraphObject; + vEdge.update(edge); + } + } else if (obj instanceof LGraph) { + var graph = obj; + if (graph.vGraphObject != null) { + var vGraph = graph.vGraphObject; + vGraph.update(graph); + } } - r.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); + }; + Layout2.prototype.initParameters = function() { + if (!this.isSubLayout) { + this.layoutQuality = LayoutConstants.QUALITY; + this.animationDuringLayout = LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT; + this.animationPeriod = LayoutConstants.DEFAULT_ANIMATION_PERIOD; + this.animationOnLayout = LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT; + this.incremental = LayoutConstants.DEFAULT_INCREMENTAL; + this.createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED; + this.uniformLeafNodeSizes = LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES; } - r.redraw(); - } else { - var dragDelta = r.touchData.dragDelta = r.touchData.dragDelta || []; - if (dragDelta.length === 0) { - dragDelta.push(disp[0]); - dragDelta.push(disp[1]); - } else { - dragDelta[0] += disp[0]; - dragDelta[1] += disp[1]; + if (this.animationDuringLayout) { + this.animationOnLayout = false; } - } - } - { - triggerEvents(start2 || near, ["touchmove", "tapdrag", "vmousemove"], e, { - x: now3[0], - y: now3[1] - }); - if ((!start2 || !start2.grabbed()) && near != last2) { - if (last2) { - last2.emit({ - originalEvent: e, - type: "tapdragout", - position: { - x: now3[0], - y: now3[1] + }; + Layout2.prototype.transform = function(newLeftTop) { + if (newLeftTop == void 0) { + this.transform(new PointD(0, 0)); + } else { + var trans = new Transform2(); + var leftTop = this.graphManager.getRoot().updateLeftTop(); + if (leftTop != null) { + trans.setWorldOrgX(newLeftTop.x); + trans.setWorldOrgY(newLeftTop.y); + trans.setDeviceOrgX(leftTop.x); + trans.setDeviceOrgY(leftTop.y); + var nodes6 = this.getAllNodes(); + var node2; + for (var i2 = 0; i2 < nodes6.length; i2++) { + node2 = nodes6[i2]; + node2.transform(trans); } - }); + } } - if (near) { - near.emit({ - originalEvent: e, - type: "tapdragover", - position: { - x: now3[0], - y: now3[1] + }; + Layout2.prototype.positionNodesRandomly = function(graph) { + if (graph == void 0) { + this.positionNodesRandomly(this.getGraphManager().getRoot()); + this.getGraphManager().getRoot().updateBounds(true); + } else { + var lNode; + var childGraph; + var nodes6 = graph.getNodes(); + for (var i2 = 0; i2 < nodes6.length; i2++) { + lNode = nodes6[i2]; + childGraph = lNode.getChild(); + if (childGraph == null) { + lNode.scatter(); + } else if (childGraph.getNodes().length == 0) { + lNode.scatter(); + } else { + this.positionNodesRandomly(childGraph); + lNode.updateBounds(); } - }); + } } - } - r.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; + }; + Layout2.prototype.getFlatForest = function() { + var flatForest = []; + var isForest = true; + var allNodes = this.graphManager.getRoot().getNodes(); + var isFlat = true; + for (var i2 = 0; i2 < allNodes.length; i2++) { + if (allNodes[i2].getChild() != null) { + isFlat = false; + } } - } - } - if (capture && (start2 == null || start2.pannable()) && cy.panningEnabled() && cy.userPanningEnabled()) { - var allowPassthrough = allowPanningPassthrough(start2, r.touchData.starts); - if (allowPassthrough) { - e.preventDefault(); - if (!r.data.bgActivePosistion) { - r.data.bgActivePosistion = array2point(r.touchData.startPosition); + if (!isFlat) { + return flatForest; } - if (r.swipePanning) { - cy.panBy({ - x: disp[0] * zoom, - y: disp[1] * zoom - }); - cy.emit("dragpan"); - } else if (isOverThresholdDrag) { - r.swipePanning = true; - cy.panBy({ - x: dx * zoom, - y: dy * zoom - }); - cy.emit("dragpan"); - if (start2) { - start2.unactivate(); - r.redrawHint("select", true); - r.touchData.start = null; + var visited = /* @__PURE__ */ new Set(); + var toBeVisited = []; + var parents4 = /* @__PURE__ */ new Map(); + var unProcessedNodes = []; + unProcessedNodes = unProcessedNodes.concat(allNodes); + while (unProcessedNodes.length > 0 && isForest) { + toBeVisited.push(unProcessedNodes[0]); + while (toBeVisited.length > 0 && isForest) { + var currentNode = toBeVisited[0]; + toBeVisited.splice(0, 1); + visited.add(currentNode); + var neighborEdges = currentNode.getEdges(); + for (var i2 = 0; i2 < neighborEdges.length; i2++) { + var currentNeighbor = neighborEdges[i2].getOtherEnd(currentNode); + if (parents4.get(currentNode) != currentNeighbor) { + if (!visited.has(currentNeighbor)) { + toBeVisited.push(currentNeighbor); + parents4.set(currentNeighbor, currentNode); + } else { + isForest = false; + break; + } + } + } + } + if (!isForest) { + flatForest = []; + } else { + var temp = [].concat(_toConsumableArray(visited)); + flatForest.push(temp); + for (var i2 = 0; i2 < temp.length; i2++) { + var value2 = temp[i2]; + var index = unProcessedNodes.indexOf(value2); + if (index > -1) { + unProcessedNodes.splice(index, 1); + } + } + visited = /* @__PURE__ */ new Set(); + parents4 = /* @__PURE__ */ new Map(); } } - } - var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY); - now3[0] = pos[0]; - now3[1] = pos[1]; - } - } - for (var j = 0; j < now3.length; j++) { - earlier[j] = now3[j]; - } - 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(); - } - }, false); - var touchcancelHandler; - r.registerBinding(window, "touchcancel", touchcancelHandler = function touchcancelHandler2(e) { - var start2 = r.touchData.start; - r.touchData.capture = false; - if (start2) { - start2.unactivate(); - } - }); - var touchendHandler, didDoubleTouch, touchTimeout, prevTouchTimeStamp; - r.registerBinding(window, "touchend", touchendHandler = function touchendHandler2(e) { - var start2 = r.touchData.start; - var capture = r.touchData.capture; - if (capture) { - if (e.touches.length === 0) { - r.touchData.capture = false; - } - e.preventDefault(); - } else { - return; - } - var select2 = 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 ctxTapend; - if (r.touchData.cxt) { - ctxTapend = { - originalEvent: e, - type: "cxttapend", - position: { - x: now3[0], - y: now3[1] - } - }; - if (start2) { - start2.emit(ctxTapend); - } else { - cy.emit(ctxTapend); - } - if (!r.touchData.cxtDragged) { - var ctxTap = { - originalEvent: e, - type: "cxttap", - position: { - x: now3[0], - y: now3[1] - } + return flatForest; }; - if (start2) { - start2.emit(ctxTap); - } else { - cy.emit(ctxTap); - } - } - if (r.touchData.start) { - r.touchData.start._private.grabbed = false; - } - r.touchData.cxt = false; - r.touchData.start = null; - r.redraw(); - return; - } - if (!e.touches[2] && cy.boxSelectionEnabled() && r.touchData.selecting) { - r.touchData.selecting = false; - var box = cy.collection(r.getAllInBox(select2[0], select2[1], select2[2], select2[3])); - select2[0] = void 0; - select2[1] = void 0; - select2[2] = void 0; - select2[3] = void 0; - select2[4] = 0; - r.redrawHint("select", true); - cy.emit({ - type: "boxend", - originalEvent: e, - position: { - x: now3[0], - y: now3[1] - } - }); - var eleWouldBeSelected = function eleWouldBeSelected2(ele) { - return ele.selectable() && !ele.selected(); - }; - 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; - freeDraggedElements(draggedEles); - r.redrawHint("drag", true); - r.redrawHint("eles", true); - if (startWasGrabbed) { - start2.emit("freeon"); - draggedEles.emit("free"); - if (r.dragData.didDrag) { - start2.emit("dragfreeon"); - draggedEles.emit("dragfree"); - } - } - triggerEvents(start2, ["touchend", "tapend", "vmouseup", "tapdragout"], e, { - x: now3[0], - y: now3[1] - }); - start2.unactivate(); - r.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 dx = r.touchData.startPosition[0] - now3[0]; - var dx2 = dx * dx; - var dy = r.touchData.startPosition[1] - now3[1]; - var dy2 = dy * dy; - var dist22 = dx2 + dy2; - var rdist2 = dist22 * zoom * zoom; - if (!r.touchData.singleTouchMoved) { - if (!start2) { - cy.$(":selected").unselect(["tapunselect"]); - } - triggerEvents(start2, ["tap", "vclick"], e, { - x: now3[0], - y: now3[1] - }); - didDoubleTouch = false; - if (e.timeStamp - prevTouchTimeStamp <= cy.multiClickDebounceTime()) { - touchTimeout && clearTimeout(touchTimeout); - didDoubleTouch = true; - prevTouchTimeStamp = null; - triggerEvents(start2, ["dbltap", "vdblclick"], e, { - x: now3[0], - y: now3[1] - }); - } else { - touchTimeout = setTimeout(function() { - if (didDoubleTouch) - return; - triggerEvents(start2, ["onetap", "voneclick"], e, { - x: now3[0], - y: now3[1] - }); - }, cy.multiClickDebounceTime()); - prevTouchTimeStamp = e.timeStamp; - } - } - if (start2 != null && !r.dragData.didDrag && start2._private.selectable && rdist2 < r.touchTapThreshold2 && !r.pinching) { - if (cy.selectionType() === "single") { - cy.$(isSelected).unmerge(start2).unselect(["tapunselect"]); - start2.select(["tapselect"]); - } else { - if (start2.selected()) { - start2.unselect(["tapunselect"]); + Layout2.prototype.createDummyNodesForBendpoints = function(edge) { + var dummyNodes = []; + var prev2 = edge.source; + var graph = this.graphManager.calcLowestCommonAncestor(edge.source, edge.target); + for (var i2 = 0; i2 < edge.bendpoints.length; i2++) { + var dummyNode = this.newNode(null); + dummyNode.setRect(new Point(0, 0), new Dimension(1, 1)); + graph.add(dummyNode); + var dummyEdge = this.newEdge(null); + this.graphManager.add(dummyEdge, prev2, dummyNode); + dummyNodes.add(dummyNode); + prev2 = dummyNode; + } + var dummyEdge = this.newEdge(null); + this.graphManager.add(dummyEdge, prev2, edge.target); + this.edgeToDummyNodes.set(edge, dummyNodes); + if (edge.isInterGraph()) { + this.graphManager.remove(edge); } else { - start2.select(["tapselect"]); + graph.remove(edge); } - } - r.redrawHint("eles", true); - } - r.touchData.singleTouchMoved = true; - } - for (var j = 0; j < now3.length; j++) { - earlier[j] = now3[j]; - } - r.dragData.didDrag = false; - if (e.touches.length === 0) { - r.touchData.dragDelta = []; - r.touchData.startPosition = null; - r.touchData.startGPosition = null; - r.touchData.didSelect = false; - } - if (e.touches.length < 2) { - if (e.touches.length === 1) { - r.touchData.startGPosition = [e.touches[0].clientX, e.touches[0].clientY]; - } - r.pinching = false; - r.redrawHint("eles", true); - r.redraw(); - } - }, false); - if (typeof TouchEvent === "undefined") { - var pointers = []; - var makeTouch = function makeTouch2(e) { - return { - clientX: e.clientX, - clientY: e.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) { - 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); - return; - } - } - }; - var updatePointer = function updatePointer2(e) { - var p2 = pointers.filter(function(p3) { - return p3.event.pointerId === e.pointerId; - })[0]; - p2.event = e; - p2.touch = makeTouch(e); - }; - var addTouchesToEvent = function addTouchesToEvent2(e) { - e.touches = pointers.map(function(p2) { - return p2.touch; - }); - }; - var pointerIsMouse = function pointerIsMouse2(e) { - return e.pointerType === "mouse" || e.pointerType === 4; - }; - r.registerBinding(r.container, "pointerdown", function(e) { - if (pointerIsMouse(e)) { - return; - } - e.preventDefault(); - addPointer(e); - addTouchesToEvent(e); - touchstartHandler(e); - }); - r.registerBinding(r.container, "pointerup", function(e) { - if (pointerIsMouse(e)) { - return; - } - removePointer(e); - addTouchesToEvent(e); - touchendHandler(e); - }); - r.registerBinding(r.container, "pointercancel", function(e) { - if (pointerIsMouse(e)) { - return; - } - removePointer(e); - addTouchesToEvent(e); - touchcancelHandler(e); - }); - r.registerBinding(r.container, "pointermove", function(e) { - if (pointerIsMouse(e)) { - return; - } - e.preventDefault(); - updatePointer(e); - addTouchesToEvent(e); - touchmoveHandler(e); - }); - } - }; - var BRp$2 = {}; - BRp$2.generatePolygon = function(name2, points) { - return this.nodeShapes[name2] = { - renderer: this, - name: name2, - points, - draw: function draw2(context, centerX, centerY, width2, height2) { - this.renderer.nodeShapeImpl("polygon", context, centerX, centerY, width2, height2, this.points); - }, - intersectLine: function intersectLine2(nodeX, nodeY, width2, height2, x2, y2, padding2) { - return polygonIntersectLine(x2, y2, this.points, nodeX, nodeY, width2 / 2, height2 / 2, padding2); - }, - checkPoint: function checkPoint(x2, y2, padding2, width2, height2, centerX, centerY) { - return pointInsidePolygon(x2, y2, this.points, centerX, centerY, width2, height2, [0, -1], padding2); - } - }; - }; - BRp$2.generateEllipse = function() { - return this.nodeShapes["ellipse"] = { - renderer: this, - name: "ellipse", - draw: function draw2(context, centerX, centerY, width2, height2) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width2, height2); - }, - intersectLine: function intersectLine2(nodeX, nodeY, width2, height2, x2, y2, padding2) { - return intersectLineEllipse(x2, y2, nodeX, nodeY, width2 / 2 + padding2, height2 / 2 + padding2); - }, - checkPoint: function checkPoint(x2, y2, padding2, width2, height2, centerX, centerY) { - return checkInEllipse(x2, y2, width2, height2, centerX, centerY, padding2); - } - }; - }; - BRp$2.generateRoundPolygon = function(name2, 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[name2] = { - renderer: this, - name: name2, - points: allPoints, - draw: function draw2(context, centerX, centerY, width2, height2) { - this.renderer.nodeShapeImpl("round-polygon", context, centerX, centerY, width2, height2, this.points); - }, - intersectLine: function intersectLine2(nodeX, nodeY, width2, height2, x2, y2, padding2) { - return roundPolygonIntersectLine(x2, y2, this.points, nodeX, nodeY, width2, height2); - }, - checkPoint: function checkPoint(x2, y2, padding2, width2, height2, centerX, centerY) { - return pointInsideRoundPolygon(x2, y2, this.points, centerX, centerY, width2, height2); - } - }; - }; - BRp$2.generateRoundRectangle = function() { - return this.nodeShapes["round-rectangle"] = this.nodeShapes["roundrectangle"] = { - renderer: this, - name: "round-rectangle", - points: generateUnitNgonPointsFitToSquare(4, 0), - draw: function draw2(context, centerX, centerY, width2, height2) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width2, height2); - }, - intersectLine: function intersectLine2(nodeX, nodeY, width2, height2, x2, y2, padding2) { - return roundRectangleIntersectLine(x2, y2, nodeX, nodeY, width2, height2, padding2); - }, - checkPoint: function checkPoint(x2, y2, padding2, width2, height2, centerX, centerY) { - var cornerRadius = getRoundRectangleRadius(width2, height2); - var diam = cornerRadius * 2; - if (pointInsidePolygon(x2, y2, this.points, centerX, centerY, width2, height2 - diam, [0, -1], padding2)) { - return true; - } - if (pointInsidePolygon(x2, y2, this.points, centerX, centerY, width2 - diam, height2, [0, -1], padding2)) { - return true; - } - if (checkInEllipse(x2, y2, diam, diam, centerX - width2 / 2 + cornerRadius, centerY - height2 / 2 + cornerRadius, padding2)) { - return true; - } - if (checkInEllipse(x2, y2, diam, diam, centerX + width2 / 2 - cornerRadius, centerY - height2 / 2 + cornerRadius, padding2)) { - return true; - } - if (checkInEllipse(x2, y2, diam, diam, centerX + width2 / 2 - cornerRadius, centerY + height2 / 2 - cornerRadius, padding2)) { - return true; - } - if (checkInEllipse(x2, y2, diam, diam, centerX - width2 / 2 + cornerRadius, centerY + height2 / 2 - cornerRadius, padding2)) { - return true; - } - return false; - } - }; - }; - BRp$2.generateCutRectangle = function() { - return this.nodeShapes["cut-rectangle"] = this.nodeShapes["cutrectangle"] = { - renderer: this, - name: "cut-rectangle", - cornerLength: getCutRectangleCornerLength(), - points: generateUnitNgonPointsFitToSquare(4, 0), - draw: function draw2(context, centerX, centerY, width2, height2) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width2, height2); - }, - generateCutTrianglePts: function generateCutTrianglePts(width2, height2, centerX, centerY) { - var cl = this.cornerLength; - var hh = height2 / 2; - var hw = width2 / 2; - var xBegin = centerX - hw; - var xEnd = centerX + hw; - var yBegin = centerY - hh; - var yEnd = centerY + hh; - return { - topLeft: [xBegin, yBegin + cl, xBegin + cl, yBegin, xBegin + cl, yBegin + cl], - topRight: [xEnd - cl, yBegin, xEnd, yBegin + cl, xEnd - cl, yBegin + cl], - 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, height2, x2, y2, padding2) { - var cPts = this.generateCutTrianglePts(width2 + 2 * padding2, height2 + 2 * padding2, nodeX, nodeY); - 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, height2, centerX, centerY) { - if (pointInsidePolygon(x2, y2, this.points, centerX, centerY, width2, height2 - 2 * this.cornerLength, [0, -1], padding2)) { - return true; - } - if (pointInsidePolygon(x2, y2, this.points, centerX, centerY, width2 - 2 * this.cornerLength, height2, [0, -1], padding2)) { - return true; - } - var cutTrianglePts = this.generateCutTrianglePts(width2, height2, centerX, centerY); - return pointInsidePolygonPoints(x2, y2, cutTrianglePts.topLeft) || pointInsidePolygonPoints(x2, y2, cutTrianglePts.topRight) || pointInsidePolygonPoints(x2, y2, cutTrianglePts.bottomRight) || pointInsidePolygonPoints(x2, y2, cutTrianglePts.bottomLeft); - } - }; - }; - BRp$2.generateBarrel = function() { - return this.nodeShapes["barrel"] = { - renderer: this, - name: "barrel", - points: generateUnitNgonPointsFitToSquare(4, 0), - draw: function draw2(context, centerX, centerY, width2, height2) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width2, height2); - }, - intersectLine: function intersectLine2(nodeX, nodeY, width2, height2, x2, y2, padding2) { - var t02 = 0.15; - var t12 = 0.5; - var t22 = 0.85; - var bPts = this.generateBarrelBezierPts(width2 + 2 * padding2, height2 + 2 * padding2, nodeX, nodeY); - var approximateBarrelCurvePts = function approximateBarrelCurvePts2(pts3) { - var m0 = qbezierPtAt({ - x: pts3[0], - y: pts3[1] - }, { - x: pts3[2], - y: pts3[3] - }, { - x: pts3[4], - y: pts3[5] - }, t02); - var m1 = qbezierPtAt({ - x: pts3[0], - y: pts3[1] - }, { - x: pts3[2], - y: pts3[3] - }, { - x: pts3[4], - y: pts3[5] - }, t12); - var m2 = qbezierPtAt({ - x: pts3[0], - y: pts3[1] - }, { - x: pts3[2], - y: pts3[3] - }, { - x: pts3[4], - 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]]; - }; - 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, height2, centerX, centerY) { - var hh = height2 / 2; - var hw = width2 / 2; - var xBegin = centerX - hw; - var xEnd = centerX + hw; - var yBegin = centerY - hh; - var yEnd = centerY + hh; - var curveConstants = getBarrelCurveConstants(width2, height2); - var hOffset = curveConstants.heightOffset; - var wOffset = curveConstants.widthOffset; - var ctrlPtXOffset = curveConstants.ctrlPtOffsetPct * width2; - var pts2 = { - topLeft: [xBegin, yBegin + hOffset, xBegin + ctrlPtXOffset, yBegin, xBegin + wOffset, yBegin], - topRight: [xEnd - wOffset, yBegin, xEnd - ctrlPtXOffset, yBegin, xEnd, yBegin + hOffset], - bottomRight: [xEnd, yEnd - hOffset, xEnd - ctrlPtXOffset, yEnd, xEnd - wOffset, yEnd], - bottomLeft: [xBegin + wOffset, yEnd, xBegin + ctrlPtXOffset, yEnd, xBegin, yEnd - hOffset] - }; - pts2.topLeft.isTop = true; - pts2.topRight.isTop = true; - pts2.bottomLeft.isBottom = true; - pts2.bottomRight.isBottom = true; - return pts2; - }, - checkPoint: function checkPoint(x2, y2, padding2, width2, height2, centerX, centerY) { - var curveConstants = getBarrelCurveConstants(width2, height2); - var hOffset = curveConstants.heightOffset; - var wOffset = curveConstants.widthOffset; - if (pointInsidePolygon(x2, y2, this.points, centerX, centerY, width2, height2 - 2 * hOffset, [0, -1], padding2)) { - return true; - } - if (pointInsidePolygon(x2, y2, this.points, centerX, centerY, width2 - 2 * wOffset, height2, [0, -1], padding2)) { - return true; - } - var barrelCurvePts = this.generateBarrelBezierPts(width2, height2, centerX, centerY); - var getCurveT = function getCurveT2(x3, y3, curvePts) { - var x0 = curvePts[4]; - var x1 = curvePts[2]; - var x22 = curvePts[0]; - var y02 = curvePts[5]; - var y23 = curvePts[1]; - var xMin = Math.min(x0, x22); - 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) { - 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; - }); - if (validRoots.length > 0) { - return validRoots[0]; + return dummyNodes; + }; + Layout2.prototype.createBendpointsFromDummyNodes = function() { + 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 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 = p3.x; + ebp.y = p3.y; + dummyNode.getOwner().remove(dummyNode); + } + this.graphManager.add(lEdge, lEdge.source, lEdge.target); + } } + }; + Layout2.transform = function(sliderValue, defaultValue, minDiv, maxMul) { + if (minDiv != void 0 && maxMul != void 0) { + var value2 = defaultValue; + if (sliderValue <= 50) { + var minValue = defaultValue / minDiv; + value2 -= (defaultValue - minValue) / 50 * (50 - sliderValue); + } else { + var maxValue = defaultValue * maxMul; + value2 += (maxValue - defaultValue) / 50 * (sliderValue - 50); + } + return value2; + } else { + var a2, b2; + if (sliderValue <= 50) { + a2 = 9 * defaultValue / 500; + b2 = defaultValue / 10; + } else { + a2 = 9 * defaultValue / 50; + b2 = -8 * defaultValue; + } + return a2 * sliderValue + b2; + } + }; + Layout2.findCenterOfTree = function(nodes6) { + var list2 = []; + list2 = list2.concat(nodes6); + var removedNodes = []; + var remainingDegrees = /* @__PURE__ */ new Map(); + var foundCenter = false; + var centerNode = null; + if (list2.length == 1 || list2.length == 2) { + foundCenter = true; + centerNode = list2[0]; + } + for (var i2 = 0; i2 < list2.length; i2++) { + var node2 = list2[i2]; + var degree = node2.getNeighborsList().size; + remainingDegrees.set(node2, node2.getNeighborsList().size); + if (degree == 1) { + removedNodes.push(node2); + } + } + var tempList = []; + tempList = tempList.concat(removedNodes); + while (!foundCenter) { + var tempList2 = []; + tempList2 = tempList2.concat(tempList); + tempList = []; + for (var i2 = 0; i2 < list2.length; i2++) { + var node2 = list2[i2]; + var index = list2.indexOf(node2); + if (index >= 0) { + list2.splice(index, 1); + } + var neighbours = node2.getNeighborsList(); + neighbours.forEach(function(neighbour) { + if (removedNodes.indexOf(neighbour) < 0) { + var otherDegree = remainingDegrees.get(neighbour); + var newDegree = otherDegree - 1; + if (newDegree == 1) { + tempList.push(neighbour); + } + remainingDegrees.set(neighbour, newDegree); + } + }); + } + removedNodes = removedNodes.concat(tempList); + if (list2.length == 1 || list2.length == 2) { + foundCenter = true; + centerNode = list2[0]; + } + } + return centerNode; + }; + Layout2.prototype.setGraphManager = function(gm) { + this.graphManager = gm; + }; + module3.exports = Layout2; + }, + /* 16 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function RandomSeed() { } - return null; - }; - var curveRegions = Object.keys(barrelCurvePts); - for (var i3 = 0; i3 < curveRegions.length; i3++) { - var corner = curveRegions[i3]; - var cornerPts = barrelCurvePts[corner]; - var t4 = getCurveT(x2, y2, cornerPts); - if (t4 == null) { - continue; - } - var y0 = cornerPts[5]; - var y1 = cornerPts[3]; - var y22 = cornerPts[1]; - var bezY = qbezierAt(y0, y1, y22, t4); - if (cornerPts.isTop && bezY <= y2) { - return true; - } - if (cornerPts.isBottom && y2 <= bezY) { - return true; - } - } - return false; - } - }; - }; - BRp$2.generateBottomRoundrectangle = function() { - return this.nodeShapes["bottom-round-rectangle"] = this.nodeShapes["bottomroundrectangle"] = { - renderer: this, - name: "bottom-round-rectangle", - points: generateUnitNgonPointsFitToSquare(4, 0), - draw: function draw2(context, centerX, centerY, width2, height2) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width2, height2); - }, - intersectLine: function intersectLine2(nodeX, nodeY, width2, height2, x2, y2, padding2) { - var topStartX = nodeX - (width2 / 2 + padding2); - var topStartY = nodeY - (height2 / 2 + padding2); - var topEndY = topStartY; - var topEndX = nodeX + (width2 / 2 + padding2); - var topIntersections = finiteLinesIntersect(x2, y2, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false); - if (topIntersections.length > 0) { - return topIntersections; - } - return roundRectangleIntersectLine(x2, y2, nodeX, nodeY, width2, height2, padding2); - }, - checkPoint: function checkPoint(x2, y2, padding2, width2, height2, centerX, centerY) { - var cornerRadius = getRoundRectangleRadius(width2, height2); - var diam = 2 * cornerRadius; - if (pointInsidePolygon(x2, y2, this.points, centerX, centerY, width2, height2 - diam, [0, -1], padding2)) { - return true; - } - if (pointInsidePolygon(x2, y2, this.points, centerX, centerY, width2 - diam, height2, [0, -1], padding2)) { - return true; - } - var outerWidth = width2 / 2 + 2 * padding2; - var outerHeight = height2 / 2 + 2 * padding2; - var points = [centerX - outerWidth, centerY - outerHeight, centerX - outerWidth, centerY, centerX + outerWidth, centerY, centerX + outerWidth, centerY - outerHeight]; - if (pointInsidePolygonPoints(x2, y2, points)) { - return true; - } - if (checkInEllipse(x2, y2, diam, diam, centerX + width2 / 2 - cornerRadius, centerY + height2 / 2 - cornerRadius, padding2)) { - return true; - } - if (checkInEllipse(x2, y2, diam, diam, centerX - width2 / 2 + cornerRadius, centerY + height2 / 2 - cornerRadius, padding2)) { - return true; - } - return false; - } - }; - }; - BRp$2.registerNodeShapes = function() { - var nodeShapes = this.nodeShapes = {}; - var renderer3 = this; - this.generateEllipse(); - this.generatePolygon("triangle", generateUnitNgonPointsFitToSquare(3, 0)); - this.generateRoundPolygon("round-triangle", generateUnitNgonPointsFitToSquare(3, 0)); - this.generatePolygon("rectangle", generateUnitNgonPointsFitToSquare(4, 0)); - nodeShapes["square"] = nodeShapes["rectangle"]; - this.generateRoundRectangle(); - this.generateCutRectangle(); - this.generateBarrel(); - this.generateBottomRoundrectangle(); - { - var diamondPoints = [0, 1, 1, 0, 0, -1, -1, 0]; - this.generatePolygon("diamond", diamondPoints); - this.generateRoundPolygon("round-diamond", diamondPoints); - } - this.generatePolygon("pentagon", generateUnitNgonPointsFitToSquare(5, 0)); - this.generateRoundPolygon("round-pentagon", generateUnitNgonPointsFitToSquare(5, 0)); - this.generatePolygon("hexagon", generateUnitNgonPointsFitToSquare(6, 0)); - this.generateRoundPolygon("round-hexagon", generateUnitNgonPointsFitToSquare(6, 0)); - this.generatePolygon("heptagon", generateUnitNgonPointsFitToSquare(7, 0)); - this.generateRoundPolygon("round-heptagon", generateUnitNgonPointsFitToSquare(7, 0)); - this.generatePolygon("octagon", generateUnitNgonPointsFitToSquare(8, 0)); - this.generateRoundPolygon("round-octagon", generateUnitNgonPointsFitToSquare(8, 0)); - var star5Points = new Array(20); - { - var outerPoints = generateUnitNgonPoints(5, 0); - 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 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]; - } - } - star5Points = fitPolygonToSquare(star5Points); - this.generatePolygon("star", star5Points); - this.generatePolygon("vee", [-1, -1, 0, -0.333, 1, -1, 0, 1]); - this.generatePolygon("rhomboid", [-1, -1, 0.333, -1, 1, 1, -0.333, 1]); - this.nodeShapes["concavehexagon"] = this.generatePolygon("concave-hexagon", [-1, -0.95, -0.75, 0, -1, 0.95, 1, 0.95, 0.75, 0, 1, -0.95]); - { - var tagPoints = [-1, -1, 0.25, -1, 1, 0, 0.25, 1, -1, 1]; - this.generatePolygon("tag", tagPoints); - this.generateRoundPolygon("round-tag", tagPoints); - } - nodeShapes.makePolygon = function(points) { - var key = points.join("$"); - var name2 = "polygon-" + key; - var shape; - if (shape = this[name2]) { - return shape; - } - return renderer3.generatePolygon(name2, points); - }; - }; - var 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; - } - if (r.lastRedrawTime === void 0) { - r.lastRedrawTime = 0; - } - if (r.lastDrawTime === void 0) { - r.lastDrawTime = 0; - } - r.requestedFrame = true; - r.renderOptions = options2; - }; - BRp$1.beforeRender = function(fn2, priority) { - if (this.destroyed) { - return; - } - if (priority == null) { - error("Priority is not optional for beforeRender"); - } - var cbs = this.beforeRenderCallbacks; - cbs.push({ - fn: fn2, - priority - }); - cbs.sort(function(a, b) { - return b.priority - a.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); - } - }; - BRp$1.startRenderLoop = function() { - var r = this; - var cy = r.cy; - if (r.renderLoopStarted) { - return; - } else { - r.renderLoopStarted = true; - } - var renderFn = function renderFn2(requestTime) { - if (r.destroyed) { - return; - } - if (cy.batching()) - ; - else if (r.requestedFrame && !r.skipFrame) { - beforeRenderCallbacks(r, true, requestTime); - var startTime = performanceNow(); - r.render(r.renderOptions); - var endTime = r.lastDrawTime = performanceNow(); - if (r.averageRedrawTime === void 0) { - r.averageRedrawTime = endTime - startTime; - } - if (r.redrawCount === void 0) { - r.redrawCount = 0; - } - r.redrawCount++; - if (r.redrawTotalTime === void 0) { - r.redrawTotalTime = 0; - } - var duration = endTime - startTime; - r.redrawTotalTime += duration; - r.lastRedrawTime = duration; - r.averageRedrawTime = r.averageRedrawTime / 2 + duration / 2; - r.requestedFrame = false; - } else { - beforeRenderCallbacks(r, false, requestTime); - } - r.skipFrame = false; - requestAnimationFrame2(renderFn2); - }; - requestAnimationFrame2(renderFn); - }; - var BaseRenderer = function BaseRenderer2(options2) { - this.init(options2); - }; - var BR = BaseRenderer; - var 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(); - if (window$1) { - var document2 = window$1.document; - var head2 = document2.head; - var stylesheetId = "__________cytoscape_stylesheet"; - var className = "__________cytoscape_container"; - var stylesheetAlreadyExists = document2.getElementById(stylesheetId) != null; - if (ctr.className.indexOf(className) < 0) { - ctr.className = (ctr.className || "") + " " + className; - } - if (!stylesheetAlreadyExists) { - var stylesheet2 = document2.createElement("style"); - stylesheet2.id = stylesheetId; - stylesheet2.innerHTML = "." + className + " { position: relative; }"; - head2.insertBefore(stylesheet2, head2.children[0]); - } - var computedStyle = window$1.getComputedStyle(ctr); - var position3 = computedStyle.getPropertyValue("position"); - if (position3 === "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 = { - down: null, - last: null, - downTime: null, - triggerMode: null, - dragging: false, - initialPan: [null, null], - capture: false - }; - r.dragData = { - possibleDragElements: [] - }; - r.touchData = { - start: null, - capture: false, - // These 3 fields related to tap, taphold events - startPosition: [null, null, null, null, null, null], - singleTouchStartTime: null, - singleTouchMoved: true, - 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 = { - // higher priority execs before lower one - animations: 400, - eleCalcs: 300, - eleTxrDeq: 200, - lyrTxrDeq: 150, - lyrTxrSkip: 100 - }; - r.registerNodeShapes(); - r.registerArrowShapes(); - r.registerCalculationListeners(); - }; - BRp.notify = function(eventName, eles) { - var r = this; - var cy = r.cy; - if (this.destroyed) { - return; - } - if (eventName === "init") { - r.load(); - return; - } - if (eventName === "destroy") { - r.destroy(); - return; - } - if (eventName === "add" || eventName === "remove" || eventName === "move" && cy.hasCompoundNodes() || eventName === "load" || eventName === "zorder" || eventName === "mount") { - r.invalidateCachedZSortedEles(); - } - if (eventName === "viewport") { - r.redrawHint("select", true); - } - if (eventName === "load" || eventName === "resize" || eventName === "mount") { - r.invalidateContainerClientCoordsCache(); - r.matchCanvasSize(r.container); - } - r.redrawHint("eles", true); - r.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) { - try { - document.body.removeChild(r.labelCalcDiv); - } catch (e) { - } - } - }; - BRp.isHeadless = function() { - return false; - }; - [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() { - var self2 = this; - var r = 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(); - }, opts.deqRedrawThreshold); - var dequeue = function dequeue2(willDraw, frameStartTime) { - var startTime = performanceNow(); - var avgRenderTime = r.averageRedrawTime; - var renderTime = r.lastRedrawTime; - var deqd = []; - var extent = r.cy.extent(); - var pixelRatio = r.getPixelRatio(); - if (!willDraw) { - r.flushRenderedStyleQueue(); - } - while (true) { - var now3 = performanceNow(); - var duration = now3 - startTime; - var frameDuration = now3 - frameStartTime; - if (renderTime < fullFpsTime) { - var timeAvailable = fullFpsTime - (willDraw ? avgRenderTime : 0); - if (frameDuration >= opts.deqFastCost * timeAvailable) { - break; + __name(RandomSeed, "RandomSeed"); + RandomSeed.seed = 1; + RandomSeed.x = 0; + RandomSeed.nextDouble = function() { + RandomSeed.x = Math.sin(RandomSeed.seed++) * 1e4; + return RandomSeed.x - Math.floor(RandomSeed.x); + }; + module3.exports = RandomSeed; + }, + /* 17 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var PointD = __webpack_require__(4); + function Transform2(x5, y5) { + this.lworldOrgX = 0; + this.lworldOrgY = 0; + this.ldeviceOrgX = 0; + this.ldeviceOrgY = 0; + this.lworldExtX = 1; + this.lworldExtY = 1; + this.ldeviceExtX = 1; + this.ldeviceExtY = 1; + } + __name(Transform2, "Transform"); + Transform2.prototype.getWorldOrgX = function() { + return this.lworldOrgX; + }; + Transform2.prototype.setWorldOrgX = function(wox) { + this.lworldOrgX = wox; + }; + Transform2.prototype.getWorldOrgY = function() { + return this.lworldOrgY; + }; + Transform2.prototype.setWorldOrgY = function(woy) { + this.lworldOrgY = woy; + }; + Transform2.prototype.getWorldExtX = function() { + return this.lworldExtX; + }; + Transform2.prototype.setWorldExtX = function(wex) { + this.lworldExtX = wex; + }; + Transform2.prototype.getWorldExtY = function() { + return this.lworldExtY; + }; + Transform2.prototype.setWorldExtY = function(wey) { + this.lworldExtY = wey; + }; + Transform2.prototype.getDeviceOrgX = function() { + return this.ldeviceOrgX; + }; + Transform2.prototype.setDeviceOrgX = function(dox) { + this.ldeviceOrgX = dox; + }; + Transform2.prototype.getDeviceOrgY = function() { + return this.ldeviceOrgY; + }; + Transform2.prototype.setDeviceOrgY = function(doy) { + this.ldeviceOrgY = doy; + }; + Transform2.prototype.getDeviceExtX = function() { + return this.ldeviceExtX; + }; + Transform2.prototype.setDeviceExtX = function(dex) { + this.ldeviceExtX = dex; + }; + Transform2.prototype.getDeviceExtY = function() { + return this.ldeviceExtY; + }; + Transform2.prototype.setDeviceExtY = function(dey) { + this.ldeviceExtY = dey; + }; + Transform2.prototype.transformX = function(x5) { + var xDevice = 0; + var worldExtX = this.lworldExtX; + if (worldExtX != 0) { + xDevice = this.ldeviceOrgX + (x5 - this.lworldOrgX) * this.ldeviceExtX / worldExtX; + } + return xDevice; + }; + Transform2.prototype.transformY = function(y5) { + var yDevice = 0; + var worldExtY = this.lworldExtY; + if (worldExtY != 0) { + yDevice = this.ldeviceOrgY + (y5 - this.lworldOrgY) * this.ldeviceExtY / worldExtY; + } + return yDevice; + }; + Transform2.prototype.inverseTransformX = function(x5) { + var xWorld = 0; + var deviceExtX = this.ldeviceExtX; + if (deviceExtX != 0) { + xWorld = this.lworldOrgX + (x5 - this.ldeviceOrgX) * this.lworldExtX / deviceExtX; + } + return xWorld; + }; + Transform2.prototype.inverseTransformY = function(y5) { + var yWorld = 0; + var deviceExtY = this.ldeviceExtY; + if (deviceExtY != 0) { + yWorld = this.lworldOrgY + (y5 - this.ldeviceOrgY) * this.lworldExtY / deviceExtY; + } + return yWorld; + }; + Transform2.prototype.inverseTransformPoint = function(inPoint) { + var outPoint = new PointD(this.inverseTransformX(inPoint.x), this.inverseTransformY(inPoint.y)); + return outPoint; + }; + module3.exports = Transform2; + }, + /* 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++) { + arr2[i2] = arr[i2]; } + return arr2; } else { - if (willDraw) { - if (duration >= opts.deqCost * renderTime || duration >= opts.deqAvgCost * avgRenderTime) { - break; + return Array.from(arr); + } + } + __name(_toConsumableArray, "_toConsumableArray"); + var Layout2 = __webpack_require__(15); + var FDLayoutConstants = __webpack_require__(7); + var LayoutConstants = __webpack_require__(0); + var IGeometry = __webpack_require__(8); + var IMath = __webpack_require__(9); + function FDLayout() { + Layout2.call(this); + this.useSmartIdealEdgeLengthCalculation = FDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION; + this.idealEdgeLength = FDLayoutConstants.DEFAULT_EDGE_LENGTH; + this.springConstant = FDLayoutConstants.DEFAULT_SPRING_STRENGTH; + this.repulsionConstant = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH; + this.gravityConstant = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH; + this.compoundGravityConstant = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH; + this.gravityRangeFactor = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR; + this.compoundGravityRangeFactor = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR; + this.displacementThresholdPerNode = 3 * FDLayoutConstants.DEFAULT_EDGE_LENGTH / 100; + this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL; + this.initialCoolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL; + this.totalDisplacement = 0; + 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]; + } + FDLayout.prototype.initParameters = function() { + Layout2.prototype.initParameters.call(this, arguments); + this.totalIterations = 0; + this.notAnimatedIterations = 0; + this.useFRGridVariant = FDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION; + this.grid = []; + }; + FDLayout.prototype.calcIdealEdgeLengths = function() { + var edge; + var lcaDepth; + var source; + var target; + var sizeOfSourceInLca; + var sizeOfTargetInLca; + var allEdges = this.getGraphManager().getAllEdges(); + for (var i2 = 0; i2 < allEdges.length; i2++) { + edge = allEdges[i2]; + edge.idealLength = this.idealEdgeLength; + if (edge.isInterGraph) { + source = edge.getSource(); + target = edge.getTarget(); + sizeOfSourceInLca = edge.getSourceInLca().getEstimatedSize(); + sizeOfTargetInLca = edge.getTargetInLca().getEstimatedSize(); + if (this.useSmartIdealEdgeLengthCalculation) { + edge.idealLength += sizeOfSourceInLca + sizeOfTargetInLca - 2 * LayoutConstants.SIMPLE_NODE_SIZE; } - } else if (frameDuration >= opts.deqNoDrawCost * fullFpsTime) { - break; + lcaDepth = edge.getLca().getInclusionTreeDepth(); + edge.idealLength += FDLayoutConstants.DEFAULT_EDGE_LENGTH * FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (source.getInclusionTreeDepth() + target.getInclusionTreeDepth() - 2 * lcaDepth); } } - var thisDeqd = opts.deq(self2, pixelRatio, extent); - if (thisDeqd.length > 0) { - for (var i3 = 0; i3 < thisDeqd.length; i3++) { - deqd.push(thisDeqd[i3]); + }; + FDLayout.prototype.initSpringEmbedder = function() { + var s2 = this.getAllNodes().length; + if (this.incremental) { + 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 { - break; + 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; + } + this.initialCoolingFactor = this.coolingFactor; + this.maxNodeDisplacement = FDLayoutConstants.MAX_NODE_DISPLACEMENT; } - } - if (deqd.length > 0) { - opts.onDeqd(self2, deqd); - if (!willDraw && opts.shouldRedraw(self2, deqd, pixelRatio, extent)) { - queueRedraw(); + this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations); + this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length; + this.repulsionRange = this.calcRepulsionRange(); + }; + FDLayout.prototype.calcSpringForces = function() { + var lEdges = this.getAllEdges(); + var edge; + for (var i2 = 0; i2 < lEdges.length; i2++) { + edge = lEdges[i2]; + this.calcSpringForce(edge, edge.idealLength); } + }; + 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, j2; + var nodeA, nodeB; + var lNodes = this.getAllNodes(); + var processedNodeSet; + if (this.useFRGridVariant) { + if (this.totalIterations % FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD == 1 && gridUpdateAllowed) { + this.updateGrid(); + } + processedNodeSet = /* @__PURE__ */ new Set(); + for (i2 = 0; i2 < lNodes.length; i2++) { + nodeA = lNodes[i2]; + this.calculateRepulsionForceOfANode(nodeA, processedNodeSet, gridUpdateAllowed, forceToNodeSurroundingUpdate); + processedNodeSet.add(nodeA); + } + } else { + for (i2 = 0; i2 < lNodes.length; i2++) { + nodeA = lNodes[i2]; + for (j2 = i2 + 1; j2 < lNodes.length; j2++) { + nodeB = lNodes[j2]; + if (nodeA.getOwner() != nodeB.getOwner()) { + continue; + } + this.calcRepulsionForce(nodeA, nodeB); + } + } + } + }; + FDLayout.prototype.calcGravitationalForces = function() { + var node2; + var lNodes = this.getAllNodesToApplyGravitation(); + for (var i2 = 0; i2 < lNodes.length; i2++) { + node2 = lNodes[i2]; + this.calcGravitationalForce(node2); + } + }; + FDLayout.prototype.moveNodes = function() { + var lNodes = this.getAllNodes(); + var node2; + for (var i2 = 0; i2 < lNodes.length; i2++) { + node2 = lNodes[i2]; + node2.move(); + } + }; + FDLayout.prototype.calcSpringForce = function(edge, idealLength) { + var sourceNode = edge.getSource(); + var targetNode = edge.getTarget(); + var length2; + var springForce; + var springForceX; + var springForceY; + if (this.uniformLeafNodeSizes && sourceNode.getChild() == null && targetNode.getChild() == null) { + edge.updateLengthSimple(); + } else { + edge.updateLength(); + if (edge.isOverlapingSourceAndTarget) { + return; + } + } + length2 = edge.getLength(); + if (length2 == 0) return; + springForce = this.springConstant * (length2 - idealLength); + springForceX = springForce * (edge.lengthX / length2); + springForceY = springForce * (edge.lengthY / length2); + sourceNode.springForceX += springForceX; + sourceNode.springForceY += springForceY; + targetNode.springForceX -= springForceX; + targetNode.springForceY -= springForceY; + }; + FDLayout.prototype.calcRepulsionForce = function(nodeA, nodeB) { + var rectA = nodeA.getRect(); + var rectB = nodeB.getRect(); + var overlapAmount = new Array(2); + var clipPoints = new Array(4); + var distanceX; + var distanceY; + var distanceSquared; + var distance2; + var repulsionForce; + var repulsionForceX; + var repulsionForceY; + if (rectA.intersects(rectB)) { + IGeometry.calcSeparationAmount(rectA, rectB, overlapAmount, FDLayoutConstants.DEFAULT_EDGE_LENGTH / 2); + repulsionForceX = 2 * overlapAmount[0]; + repulsionForceY = 2 * overlapAmount[1]; + var childrenConstant = nodeA.noOfChildren * nodeB.noOfChildren / (nodeA.noOfChildren + nodeB.noOfChildren); + nodeA.repulsionForceX -= childrenConstant * repulsionForceX; + nodeA.repulsionForceY -= childrenConstant * repulsionForceY; + nodeB.repulsionForceX += childrenConstant * repulsionForceX; + nodeB.repulsionForceY += childrenConstant * repulsionForceY; + } else { + if (this.uniformLeafNodeSizes && nodeA.getChild() == null && nodeB.getChild() == null) { + distanceX = rectB.getCenterX() - rectA.getCenterX(); + distanceY = rectB.getCenterY() - rectA.getCenterY(); + } else { + IGeometry.getIntersection(rectA, rectB, clipPoints); + distanceX = clipPoints[2] - clipPoints[0]; + distanceY = clipPoints[3] - clipPoints[1]; + } + if (Math.abs(distanceX) < FDLayoutConstants.MIN_REPULSION_DIST) { + distanceX = IMath.sign(distanceX) * FDLayoutConstants.MIN_REPULSION_DIST; + } + if (Math.abs(distanceY) < FDLayoutConstants.MIN_REPULSION_DIST) { + distanceY = IMath.sign(distanceY) * FDLayoutConstants.MIN_REPULSION_DIST; + } + distanceSquared = distanceX * distanceX + distanceY * distanceY; + distance2 = Math.sqrt(distanceSquared); + repulsionForce = this.repulsionConstant * nodeA.noOfChildren * nodeB.noOfChildren / distanceSquared; + repulsionForceX = repulsionForce * distanceX / distance2; + repulsionForceY = repulsionForce * distanceY / distance2; + nodeA.repulsionForceX -= repulsionForceX; + nodeA.repulsionForceY -= repulsionForceY; + nodeB.repulsionForceX += repulsionForceX; + nodeB.repulsionForceY += repulsionForceY; + } + }; + FDLayout.prototype.calcGravitationalForce = function(node2) { + var ownerGraph; + var ownerCenterX; + var ownerCenterY; + var distanceX; + var distanceY; + var absDistanceX; + var absDistanceY; + var estimatedSize; + ownerGraph = node2.getOwner(); + ownerCenterX = (ownerGraph.getRight() + ownerGraph.getLeft()) / 2; + ownerCenterY = (ownerGraph.getTop() + ownerGraph.getBottom()) / 2; + distanceX = node2.getCenterX() - ownerCenterX; + distanceY = node2.getCenterY() - ownerCenterY; + absDistanceX = Math.abs(distanceX) + node2.getWidth() / 2; + absDistanceY = Math.abs(distanceY) + node2.getHeight() / 2; + if (node2.getOwner() == this.graphManager.getRoot()) { + estimatedSize = ownerGraph.getEstimatedSize() * this.gravityRangeFactor; + if (absDistanceX > estimatedSize || absDistanceY > estimatedSize) { + node2.gravitationForceX = -this.gravityConstant * distanceX; + node2.gravitationForceY = -this.gravityConstant * distanceY; + } + } else { + estimatedSize = ownerGraph.getEstimatedSize() * this.compoundGravityRangeFactor; + if (absDistanceX > estimatedSize || absDistanceY > estimatedSize) { + node2.gravitationForceX = -this.gravityConstant * distanceX * this.compoundGravityConstant; + node2.gravitationForceY = -this.gravityConstant * distanceY * this.compoundGravityConstant; + } + } + }; + FDLayout.prototype.isConverged = function() { + var converged; + var oscilating = false; + if (this.totalIterations > this.maxIterations / 3) { + oscilating = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2; + } + converged = this.totalDisplacement < this.totalDisplacementThreshold; + this.oldTotalDisplacement = this.totalDisplacement; + return converged || oscilating; + }; + FDLayout.prototype.animate = function() { + if (this.animationDuringLayout && !this.isSubLayout) { + if (this.notAnimatedIterations == this.animationPeriod) { + this.update(); + this.notAnimatedIterations = 0; + } else { + this.notAnimatedIterations++; + } + } + }; + FDLayout.prototype.calcNoOfChildrenForAllNodes = function() { + var node2; + var allNodes = this.graphManager.getAllNodes(); + for (var i2 = 0; i2 < allNodes.length; i2++) { + node2 = allNodes[i2]; + node2.noOfChildren = node2.getNoOfChildren(); + } + }; + FDLayout.prototype.calcGrid = function(graph) { + var sizeX = 0; + var sizeY = 0; + sizeX = parseInt(Math.ceil((graph.getRight() - graph.getLeft()) / this.repulsionRange)); + sizeY = parseInt(Math.ceil((graph.getBottom() - graph.getTop()) / this.repulsionRange)); + var grid = new Array(sizeX); + for (var i2 = 0; i2 < sizeX; i2++) { + grid[i2] = new Array(sizeY); + } + for (var i2 = 0; i2 < sizeX; i2++) { + for (var j2 = 0; j2 < sizeY; j2++) { + grid[i2][j2] = new Array(); + } + } + return grid; + }; + FDLayout.prototype.addNodeToGrid = function(v3, left3, top2) { + var startX2 = 0; + var finishX = 0; + var startY2 = 0; + var finishY = 0; + 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); + } + } + }; + FDLayout.prototype.updateGrid = function() { + var i2; + var nodeA; + var lNodes = this.getAllNodes(); + this.grid = this.calcGrid(this.graphManager.getRoot()); + for (i2 = 0; i2 < lNodes.length; i2++) { + nodeA = lNodes[i2]; + this.addNodeToGrid(nodeA, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop()); + } + }; + FDLayout.prototype.calculateRepulsionForceOfANode = function(nodeA, processedNodeSet, gridUpdateAllowed, forceToNodeSurroundingUpdate) { + if (this.totalIterations % FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD == 1 && gridUpdateAllowed || forceToNodeSurroundingUpdate) { + var surrounding = /* @__PURE__ */ new Set(); + nodeA.surrounding = new Array(); + var nodeB; + var grid = this.grid; + for (var i2 = nodeA.startX - 1; i2 < nodeA.finishX + 2; i2++) { + 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; + } + if (!processedNodeSet.has(nodeB) && !surrounding.has(nodeB)) { + var distanceX = Math.abs(nodeA.getCenterX() - nodeB.getCenterX()) - (nodeA.getWidth() / 2 + nodeB.getWidth() / 2); + var distanceY = Math.abs(nodeA.getCenterY() - nodeB.getCenterY()) - (nodeA.getHeight() / 2 + nodeB.getHeight() / 2); + if (distanceX <= this.repulsionRange && distanceY <= this.repulsionRange) { + surrounding.add(nodeB); + } + } + } + } + } + } + nodeA.surrounding = [].concat(_toConsumableArray(surrounding)); + } + for (i2 = 0; i2 < nodeA.surrounding.length; i2++) { + this.calcRepulsionForce(nodeA, nodeA.surrounding[i2]); + } + }; + FDLayout.prototype.calcRepulsionRange = function() { + return 0; + }; + module3.exports = FDLayout; + }, + /* 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; } - }; - var priority = opts.priority || noop$12; - r.beforeRender(dequeue, priority(self2)); - }; - } - }; - var ElementTextureCacheLookup = /* @__PURE__ */ function() { - function ElementTextureCacheLookup2(getKey2) { - 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.lvls = []; - this.getKey = getKey2; - this.doesEleInvalidateKey = doesEleInvalidateKey; - } - _createClass(ElementTextureCacheLookup2, [{ - key: "getIdsFor", - value: 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(); - idsByKey.set(key, ids); - } - return ids; - } - }, { - key: "addIdForKey", - value: function addIdForKey(key, id2) { - if (key != null) { - this.getIdsFor(key).add(id2); - } - } - }, { - key: "deleteIdForKey", - value: function deleteIdForKey(key, id2) { - if (key != null) { - this.getIdsFor(key)["delete"](id2); - } - } - }, { - key: "getNumberOfIdsForKey", - value: function getNumberOfIdsForKey(key) { - if (key == null) { - return 0; - } else { - return this.getIdsFor(key).size; - } - } - }, { - key: "updateKeyMappingFor", - value: function updateKeyMappingFor(ele) { - var id2 = ele.id(); - var prevKey = this.keyForId.get(id2); - var currKey = this.getKey(ele); - this.deleteIdForKey(prevKey, id2); - this.addIdForKey(currKey, id2); - this.keyForId.set(id2, currKey); - } - }, { - key: "deleteKeyMappingFor", - value: function deleteKeyMappingFor(ele) { - var id2 = ele.id(); - var prevKey = this.keyForId.get(id2); - this.deleteIdForKey(prevKey, id2); - this.keyForId["delete"](id2); - } - }, { - key: "keyHasChangedFor", - value: function keyHasChangedFor(ele) { - var id2 = ele.id(); - var prevKey = this.keyForId.get(id2); - var newKey = this.getKey(ele); - return prevKey !== newKey; - } - }, { - key: "isInvalid", - value: function isInvalid(ele) { - return this.keyHasChangedFor(ele) || this.doesEleInvalidateKey(ele); - } - }, { - key: "getCachesAt", - value: function getCachesAt(lvl) { - var cachesByLvl = this.cachesByLvl, lvls = this.lvls; - var caches = cachesByLvl.get(lvl); - if (!caches) { - caches = new Map$22(); - cachesByLvl.set(lvl, caches); - lvls.push(lvl); - } - return caches; - } - }, { - key: "getCache", - value: function getCache(key, lvl) { - return this.getCachesAt(lvl).get(key); - } - }, { - key: "get", - value: function get3(ele, lvl) { - var key = this.getKey(ele); - var cache2 = this.getCache(key, lvl); - if (cache2 != null) { - this.updateKeyMappingFor(ele); - } - return cache2; - } - }, { - key: "getForCachedKey", - value: function getForCachedKey(ele, lvl) { - var key = this.keyForId.get(ele.id()); - var cache2 = this.getCache(key, lvl); - return cache2; - } - }, { - key: "hasCache", - value: function hasCache(key, lvl) { - return this.getCachesAt(lvl).has(key); - } - }, { - key: "has", - value: function has2(ele, lvl) { - var key = this.getKey(ele); - return this.hasCache(key, lvl); - } - }, { - key: "setCache", - value: function setCache(key, lvl, cache2) { - cache2.key = key; - this.getCachesAt(lvl).set(key, cache2); - } - }, { - key: "set", - value: function set3(ele, lvl, cache2) { - var key = this.getKey(ele); - this.setCache(key, lvl, cache2); - this.updateKeyMappingFor(ele); - } - }, { - key: "deleteCache", - value: function deleteCache(key, lvl) { - this.getCachesAt(lvl)["delete"](key); - } - }, { - key: "delete", - value: function _delete(ele, lvl) { - var key = this.getKey(ele); - this.deleteCache(key, lvl); - } - }, { - key: "invalidateKey", - value: function invalidateKey(key) { - var _this = this; - this.lvls.forEach(function(lvl) { - return _this.deleteCache(key, lvl); - }); - } - // 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); - this.deleteKeyMappingFor(ele); - var entireKeyInvalidated = this.doesEleInvalidateKey(ele); - if (entireKeyInvalidated) { - this.invalidateKey(key); - } - return entireKeyInvalidated || this.getNumberOfIdsForKey(key) === 0; - } - }]); - 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 = { - dequeue: "dequeue", - downscale: "downscale", - highQuality: "highQuality" - }; - var initDefaults = defaults$g({ - getKey: null, - doesEleInvalidateKey: falsify, - drawElement: null, - getBoundingBox: null, - getRotationPoint: null, - getRotationOffset: null, - isVisible: trueify, - allowEdgeTxrCaching: true, - allowParentTxrCaching: true - }); - var ElementTextureCache = function ElementTextureCache2(renderer3, initOptions) { - var self2 = this; - self2.renderer = renderer3; - self2.onDequeues = []; - var opts = initDefaults(initOptions); - extend2(self2, opts); - self2.lookup = new ElementTextureCacheLookup(opts.getKey, opts.doesEleInvalidateKey); - self2.setupDequeueing(); - }; - var ETCp = ElementTextureCache.prototype; - ETCp.reasons = getTxrReasons; - ETCp.getTextureQueue = function(txrH) { - var self2 = this; - self2.eleImgCaches = self2.eleImgCaches || {}; - return self2.eleImgCaches[txrH] = self2.eleImgCaches[txrH] || []; - }; - ETCp.getRetiredTextureQueue = function(txrH) { - var self2 = this; - var rtxtrQs = self2.eleImgCaches.retired = self2.eleImgCaches.retired || {}; - var rtxtrQ = rtxtrQs[txrH] = rtxtrQs[txrH] || []; - return rtxtrQ; - }; - ETCp.getElementQueue = function() { - var self2 = this; - var q = self2.eleCacheQueue = self2.eleCacheQueue || new heap(function(a, b) { - return b.reqs - a.reqs; - }); - return q; - }; - ETCp.getElementKeyToQueue = function() { - var self2 = this; - var k2q = self2.eleKeyToCacheQueue = self2.eleKeyToCacheQueue || {}; - return k2q; - }; - ETCp.getElement = function(ele, bb, pxRatio, lvl, reason) { - var self2 = this; - var r = this.renderer; - var zoom = r.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; - } - if (!self2.allowEdgeTxrCaching && ele.isEdge() || !self2.allowParentTxrCaching && ele.isParent()) { - return null; - } - if (lvl == null) { - lvl = Math.ceil(log2(zoom * pxRatio)); - } - if (lvl < minLvl$1) { - lvl = minLvl$1; - } else if (zoom >= 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); - if (!this.isVisible(ele, scaledLabelShown)) { - return null; - } - var eleCache = lookup2.get(ele, lvl); - if (eleCache && eleCache.invalidated) { - eleCache.invalidated = false; - eleCache.texture.invalidatedWidth -= eleCache.width; - } - if (eleCache) { - return eleCache; - } - var txrH; - if (eleScaledH <= minTxrH) { - txrH = minTxrH; - } else if (eleScaledH <= txrStepH) { - txrH = txrStepH; - } else { - txrH = Math.ceil(eleScaledH / txrStepH) * txrStepH; - } - if (eleScaledH > maxTxrH || eleScaledW > maxTxrW) { - return null; - } - var txrQ = self2.getTextureQueue(txrH); - var txr = txrQ[txrQ.length - 2]; - var addNewTxr = function addNewTxr2() { - return self2.recycleTexture(txrH, eleScaledW) || self2.addTexture(txrH, eleScaledW); - }; - if (!txr) { - txr = txrQ[txrQ.length - 1]; - } - if (!txr) { - txr = addNewTxr(); - } - if (txr.width - txr.usedWidth < eleScaledW) { - txr = addNewTxr(); - } - var scalableFrom = function scalableFrom2(otherCache) { - return otherCache && otherCache.scaledLabelShown === scaledLabelShown; - }; - 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; - break; - } - } - var oneUpCache = higherCache && higherCache.level === lvl + 1 ? higherCache : null; - var downscale = function downscale2() { - txr.context.drawImage(oneUpCache.texture.canvas, oneUpCache.x, 0, oneUpCache.width, oneUpCache.height, txr.usedWidth, 0, eleScaledW, eleScaledH); - }; - txr.context.setTransform(1, 0, 0, 1, 0, 0); - txr.context.clearRect(txr.usedWidth, 0, eleScaledW, txrH); - if (scalableFrom(oneUpCache)) { - downscale(); - } else if (scalableFrom(higherCache)) { - if (highQualityReq) { - for (var _l = higherCache.level; _l > lvl; _l--) { - oneUpCache = self2.getElement(ele, bb, pxRatio, _l, getTxrReasons.downscale); - } - downscale(); - } else { - self2.queueElement(ele, higherCache.level - 1); - return higherCache; - } - } else { - var lowerCache; - if (!deqing && !highQualityReq && !downscaleReq) { - for (var _l2 = lvl - 1; _l2 >= minLvl$1; _l2--) { - var _c = lookup2.get(ele, _l2); - if (_c) { - lowerCache = _c; - break; - } - } - } - if (scalableFrom(lowerCache)) { - self2.queueElement(ele, lvl); - return lowerCache; - } - txr.context.translate(txr.usedWidth, 0); - txr.context.scale(scale, scale); - this.drawElement(txr.context, ele, bb, scaledLabelShown, false); - txr.context.scale(1 / scale, 1 / scale); - txr.context.translate(-txr.usedWidth, 0); - } - eleCache = { - x: txr.usedWidth, - texture: txr, - level: lvl, - scale, - width: eleScaledW, - height: eleScaledH, - scaledLabelShown - }; - txr.usedWidth += Math.ceil(eleScaledW + eleTxrSpacing); - txr.eleCaches.push(eleCache); - lookup2.set(ele, lvl, eleCache); - self2.checkTextureFullness(txr); - return eleCache; - }; - ETCp.invalidateElements = function(eles) { - for (var i3 = 0; i3 < eles.length; i3++) { - this.invalidateElement(eles[i3]); - } - }; - ETCp.invalidateElement = function(ele) { - var self2 = this; - var lookup2 = self2.lookup; - var caches = []; - var invalid = lookup2.isInvalid(ele); - if (!invalid) { - return; - } - for (var lvl = minLvl$1; lvl <= maxLvl$1; lvl++) { - var cache2 = lookup2.getForCachedKey(ele, lvl); - if (cache2) { - caches.push(cache2); - } - } - var noOtherElesUseCache = lookup2.invalidate(ele); - if (noOtherElesUseCache) { - for (var i3 = 0; i3 < caches.length; i3++) { - var _cache = caches[i3]; - var txr = _cache.texture; - txr.invalidatedWidth += _cache.width; - _cache.invalidated = true; - self2.checkTextureUtility(txr); - } - } - self2.removeFromQueue(ele); - }; - ETCp.checkTextureUtility = function(txr) { - if (txr.invalidatedWidth >= minUtility * txr.width) { - this.retireTexture(txr); - } - }; - ETCp.checkTextureFullness = function(txr) { - var self2 = this; - var txrQ = self2.getTextureQueue(txr.height); - if (txr.usedWidth / txr.width > maxFullness && txr.fullnessChecks >= maxFullnessChecks) { - removeFromArray(txrQ, txr); - } else { - txr.fullnessChecks++; - } - }; - ETCp.retireTexture = function(txr) { - var self2 = this; - var txrH = txr.height; - var txrQ = self2.getTextureQueue(txrH); - var lookup2 = this.lookup; - removeFromArray(txrQ, txr); - txr.retired = true; - var eleCaches = txr.eleCaches; - for (var i3 = 0; i3 < eleCaches.length; i3++) { - var eleCache = eleCaches[i3]; - lookup2.deleteCache(eleCache.key, eleCache.level); - } - clearArray(eleCaches); - var rtxtrQ = self2.getRetiredTextureQueue(txrH); - rtxtrQ.push(txr); - }; - ETCp.addTexture = function(txrH, minW) { - var self2 = this; - var txrQ = self2.getTextureQueue(txrH); - var txr = {}; - txrQ.push(txr); - txr.eleCaches = []; - txr.height = txrH; - txr.width = Math.max(defTxrWidth, minW); - txr.usedWidth = 0; - txr.invalidatedWidth = 0; - txr.fullnessChecks = 0; - txr.canvas = self2.renderer.makeOffscreenCanvas(txr.width, txr.height); - txr.context = txr.canvas.getContext("2d"); - return txr; - }; - ETCp.recycleTexture = function(txrH, minW) { - 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]; - if (txr.width >= minW) { - txr.retired = false; - txr.usedWidth = 0; - txr.invalidatedWidth = 0; - txr.fullnessChecks = 0; - clearArray(txr.eleCaches); - txr.context.setTransform(1, 0, 0, 1, 0, 0); - txr.context.clearRect(0, 0, txr.width, txr.height); - removeFromArray(rtxtrQ, txr); - txrQ.push(txr); - return txr; - } - } - }; - ETCp.queueElement = function(ele, lvl) { - var self2 = this; - var q = self2.getElementQueue(); - var k2q = self2.getElementKeyToQueue(); - var key = this.getKey(ele); - var existingReq = k2q[key]; - if (existingReq) { - existingReq.level = Math.max(existingReq.level, lvl); - existingReq.eles.merge(ele); - existingReq.reqs++; - q.updateItem(existingReq); - } else { - var req = { - eles: ele.spawn().merge(ele), - level: lvl, - reqs: 1, - key - }; - q.push(req); - k2q[key] = req; - } - }; - ETCp.dequeue = function(pxRatio) { - var self2 = this; - var q = 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(); - var key = req.key; - var ele = req.eles[0]; - var cacheExists = lookup2.hasCache(ele, req.level); - k2q[key] = null; - if (cacheExists) { - continue; - } - dequeued.push(req); - var bb = self2.getBoundingBox(ele); - self2.getElement(ele, bb, pxRatio, req.level, getTxrReasons.dequeue); - } else { - break; - } - } - return dequeued; - }; - ETCp.removeFromQueue = function(ele) { - var self2 = this; - var q = 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(); - k2q[key] = null; - } else { - req.eles.unmerge(ele); - } - } - }; - ETCp.onDequeue = function(fn2) { - this.onDequeues.push(fn2); - }; - ETCp.offDequeue = function(fn2) { - removeFromArray(this.onDequeues, fn2); - }; - ETCp.setupDequeueing = defs.setupDequeueing({ - deqRedrawThreshold: deqRedrawThreshold$1, - deqCost: deqCost$1, - 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)) { - return true; + __name(FDLayoutEdge, "FDLayoutEdge"); + FDLayoutEdge.prototype = Object.create(LEdge.prototype); + for (var prop in LEdge) { + FDLayoutEdge[prop] = LEdge[prop]; } - } - } - return false; - }, - priority: function priority(self2) { - return self2.renderer.beforeRenderPriorities.eleTxrDeq; - } - }); - 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) { - var self2 = this; - var r = self2.renderer = renderer3; - var cy = r.cy; - self2.layersByLevel = {}; - self2.firstGet = true; - self2.lastInvalidationTime = performanceNow() - 2 * invalidThreshold; - self2.skipping = false; - self2.eleTxrDeqs = cy.collection(); - self2.scheduleElementRefinement = debounce_1(function() { - self2.refineElementTextures(self2.eleTxrDeqs); - self2.eleTxrDeqs.unmerge(self2.eleTxrDeqs); - }, refineEleDebounceTime); - r.beforeRender(function(willDraw, now3) { - if (now3 - self2.lastInvalidationTime <= invalidThreshold) { - self2.skipping = true; - } else { - self2.skipping = false; - } - }, r.beforeRenderPriorities.lyrTxrSkip); - var qSort = function qSort2(a, b) { - return b.reqs - a.reqs; - }; - self2.layersQueue = new heap(qSort); - self2.setupDequeueing(); - }; - var LTCp = LayeredTextureCache.prototype; - var layerIdPool = 0; - var 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 layer = { - id: layerIdPool = ++layerIdPool % MAX_INT, - bb, - level: lvl, - width: w2, - height: h, - canvas, - context: canvas.getContext("2d"), - eles: [], - elesQueue: [], - reqs: 0 - }; - var cxt = layer.context; - var dx = -layer.bb.x1; - var dy = -layer.bb.y1; - cxt.scale(scale, scale); - cxt.translate(dx, dy); - return layer; - }; - LTCp.getLayers = function(eles, pxRatio, lvl) { - var self2 = this; - var r = self2.renderer; - var cy = r.cy; - var zoom = cy.zoom(); - var firstGet = self2.firstGet; - self2.firstGet = false; - if (lvl == null) { - lvl = Math.ceil(log2(zoom * pxRatio)); - if (lvl < minLvl) { - lvl = minLvl; - } else if (zoom >= maxZoom || lvl > maxLvl) { - return null; - } - } - self2.validateLayersElesOrdering(lvl, eles); - var layersByLvl = self2.layersByLevel; - var scale = Math.pow(2, lvl); - var layers = layersByLvl[lvl] = layersByLvl[lvl] || []; - 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]; - return true; - } - }; - var checkLvls = function checkLvls2(dir) { - if (tmpLayers) { - return; - } - for (var l = lvl + dir; minLvl <= l && l <= maxLvl; l += dir) { - if (canUseAsTmpLvl(l)) { - break; + module3.exports = FDLayoutEdge; + }, + /* 20 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var LNode = __webpack_require__(3); + function FDLayoutNode(gm, loc, size5, vNode) { + LNode.call(this, gm, loc, size5, vNode); + this.springForceX = 0; + this.springForceY = 0; + this.repulsionForceX = 0; + this.repulsionForceY = 0; + this.gravitationForceX = 0; + this.gravitationForceY = 0; + this.displacementX = 0; + this.displacementY = 0; + this.startX = 0; + this.finishX = 0; + this.startY = 0; + this.finishY = 0; + this.surrounding = []; + } + __name(FDLayoutNode, "FDLayoutNode"); + FDLayoutNode.prototype = Object.create(LNode.prototype); + for (var prop in LNode) { + FDLayoutNode[prop] = LNode[prop]; + } + FDLayoutNode.prototype.setGridCoordinates = function(_startX, _finishX, _startY, _finishY) { + this.startX = _startX; + this.finishX = _finishX; + this.startY = _startY; + this.finishY = _finishY; + }; + module3.exports = FDLayoutNode; + }, + /* 21 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function DimensionD2(width3, height2) { + this.width = 0; + this.height = 0; + 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(width3) { + this.width = width3; + }; + DimensionD2.prototype.getHeight = function() { + return this.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)) { + this.map[theId] = value2; + this.keys.push(key); + } + }; + HashMap.prototype.contains = function(key) { + var theId = UniqueIDGeneretor.createID(key); + return this.map[key] != null; + }; + HashMap.prototype.get = function(key) { + var theId = UniqueIDGeneretor.createID(key); + return this.map[theId]; + }; + HashMap.prototype.keySet = function() { + return this.keys; + }; + module3.exports = HashMap; + }, + /* 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; + }; + HashSet.prototype.remove = function(obj) { + delete this.set[UniqueIDGeneretor.createID(obj)]; + }; + HashSet.prototype.clear = function() { + this.set = {}; + }; + HashSet.prototype.contains = function(obj) { + return this.set[UniqueIDGeneretor.createID(obj)] == obj; + }; + HashSet.prototype.isEmpty = function() { + return this.size() === 0; + }; + HashSet.prototype.size = function() { + return Object.keys(this.set).length; + }; + HashSet.prototype.addAllTo = function(list2) { + var keys3 = Object.keys(this.set); + var length2 = keys3.length; + for (var i2 = 0; i2 < length2; i2++) { + list2.push(this.set[keys3[i2]]); + } + }; + HashSet.prototype.size = function() { + return Object.keys(this.set).length; + }; + HashSet.prototype.addAll = function(list2) { + var s2 = list2.length; + for (var i2 = 0; i2 < s2; i2++) { + var v3 = list2[i2]; + this.add(v3); + } + }; + module3.exports = HashSet; + }, + /* 24 */ + /***/ + function(module3, exports3, __webpack_require__) { + "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; + 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); + return 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(A2, compareFunction) { + _classCallCheck2(this, Quicksort2); + if (compareFunction !== null || compareFunction !== void 0) this.compareFunction = this._defaultCompareFunction; + var length2 = void 0; + if (A2 instanceof LinkedList) length2 = A2.size(); + else length2 = A2.length; + this._quicksort(A2, 0, length2 - 1); + } + __name(Quicksort2, "Quicksort"); + _createClass2(Quicksort2, [{ + key: "_quicksort", + 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: /* @__PURE__ */ __name(function _partition(A2, p3, r2) { + var x5 = this._get(A2, p3); + var i2 = p3; + var j2 = r2; + while (true) { + while (this.compareFunction(x5, this._get(A2, j2))) { + j2--; + } + while (this.compareFunction(this._get(A2, i2), x5)) { + i2++; + } + if (i2 < j2) { + this._swap(A2, i2, j2); + i2++; + j2--; + } else return j2; + } + }, "_partition") + }, { + key: "_get", + 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: /* @__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: /* @__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: /* @__PURE__ */ __name(function _defaultCompareFunction(a2, b2) { + return b2 > a2; + }, "_defaultCompareFunction") + }]); + return Quicksort2; + }(); + module3.exports = Quicksort; + }, + /* 25 */ + /***/ + function(module3, exports3, __webpack_require__) { + "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; + 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); + return 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; + _classCallCheck2(this, NeedlemanWunsch2); + this.sequence1 = sequence1; + this.sequence2 = sequence2; + this.match_score = match_score; + this.mismatch_penalty = mismatch_penalty; + this.gap_penalty = gap_penalty; + this.iMax = sequence1.length + 1; + this.jMax = sequence2.length + 1; + this.grid = new Array(this.iMax); + for (var i2 = 0; i2 < this.iMax; i2++) { + this.grid[i2] = new Array(this.jMax); + for (var j2 = 0; j2 < this.jMax; j2++) { + this.grid[i2][j2] = 0; + } + } + this.tracebackGrid = new Array(this.iMax); + 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[_i][_j] = [null, null, null]; + } + } + this.alignments = []; + this.score = -1; + this.computeGrids(); + } + __name(NeedlemanWunsch2, "NeedlemanWunsch"); + _createClass2(NeedlemanWunsch2, [{ + key: "getScore", + value: /* @__PURE__ */ __name(function getScore() { + return this.score; + }, "getScore") + }, { + key: "getAlignments", + value: /* @__PURE__ */ __name(function getAlignments2() { + return this.alignments; + }, "getAlignments") + // Main dynamic programming procedure + }, { + key: "computeGrids", + 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 _i2 = 1; _i2 < this.iMax; _i2++) { + for (var _j2 = 1; _j2 < this.jMax; _j2++) { + var diag = void 0; + 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[_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: /* @__PURE__ */ __name(function alignmentTraceback() { + var inProcessAlignments = []; + inProcessAlignments.push({ + pos: [this.sequence1.length, this.sequence2.length], + seq1: "", + seq2: "" + }); + while (inProcessAlignments[0]) { + var current = inProcessAlignments[0]; + var directions = this.tracebackGrid[current.pos[0]][current.pos[1]]; + if (directions[0]) { + inProcessAlignments.push({ + pos: [current.pos[0] - 1, current.pos[1] - 1], + seq1: this.sequence1[current.pos[0] - 1] + current.seq1, + seq2: this.sequence2[current.pos[1] - 1] + current.seq2 + }); + } + if (directions[1]) { + inProcessAlignments.push({ + pos: [current.pos[0] - 1, current.pos[1]], + seq1: this.sequence1[current.pos[0] - 1] + current.seq1, + seq2: "-" + current.seq2 + }); + } + if (directions[2]) { + inProcessAlignments.push({ + pos: [current.pos[0], current.pos[1] - 1], + seq1: "-" + current.seq1, + 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 + }); + inProcessAlignments.shift(); + } + return this.alignments; + }, "alignmentTraceback") + // Helper Functions + }, { + key: "getAllIndexes", + 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: /* @__PURE__ */ __name(function arrayAllMaxIndexes(array4) { + return this.getAllIndexes(array4, Math.max.apply(null, array4)); + }, "arrayAllMaxIndexes") + }]); + return NeedlemanWunsch2; + }(); + module3.exports = NeedlemanWunsch; + }, + /* 26 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var layoutBase = /* @__PURE__ */ __name(function layoutBase2() { + return; + }, "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__) { + "use strict"; + function Emitter3() { + this.listeners = []; + } + __name(Emitter3, "Emitter"); + var p3 = Emitter3.prototype; + p3.addListener = function(event3, callback) { + this.listeners.push({ + event: event3, + callback + }); + }; + p3.removeListener = function(event3, callback) { + for (var i2 = this.listeners.length; i2 >= 0; i2--) { + var l2 = this.listeners[i2]; + if (l2.event === event3 && l2.callback === callback) { + this.listeners.splice(i2, 1); + } + } + }; + p3.emit = function(event3, data5) { + for (var i2 = 0; i2 < this.listeners.length; i2++) { + var l2 = this.listeners[i2]; + if (event3 === l2.event) { + l2.callback(data5); + } + } + }; + module3.exports = Emitter3; } - }; - checkLvls(1); - checkLvls(-1); - for (var i4 = layers.length - 1; i4 >= 0; i4--) { - var layer2 = layers[i4]; - if (layer2.invalid) { - removeFromArray(layers, layer2); - } - } - }; - if (!lvlComplete) { - checkTempLevels(); - } else { - return layers; - } - var getBb = function getBb2() { - if (!bb) { - bb = makeBoundingBox(); - for (var i4 = 0; i4 < eles.length; i4++) { - updateBoundingBox(bb, eles[i4].boundingBox()); - } - } - return bb; - }; - var makeLayer = function makeLayer2(opts) { - opts = opts || {}; - var after = opts.after; - getBb(); - var area = bb.w * scale * (bb.h * scale); - if (area > maxLayerArea) { - return null; - } - var layer2 = self2.makeLayer(bb, lvl); - if (after != null) { - var index = layers.indexOf(after) + 1; - layers.splice(index, 0, layer2); - } else if (opts.insert === void 0 || opts.insert) { - layers.unshift(layer2); - } - return layer2; - }; - 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]; - var rs = ele._private.rscratch; - var caches = rs.imgLayerCaches = rs.imgLayerCaches || {}; - var existingLayer = caches[lvl]; - if (existingLayer) { - layer = existingLayer; - continue; - } - if (!layer || layer.eles.length >= maxElesPerLayer || !boundingBoxInBoundingBox(layer.bb, ele.boundingBox())) { - layer = makeLayer({ - insert: true, - after: layer - }); - if (!layer) { - return null; - } - } - if (tmpLayers || allowLazyQueueing) { - self2.queueLayer(layer, ele); - } else { - self2.drawEleInLayer(layer, ele, lvl, pxRatio); - } - layer.eles.push(ele); - caches[lvl] = layer; - } - if (tmpLayers) { - return tmpLayers; - } - if (allowLazyQueueing) { - return null; - } - return layers; - }; - LTCp.getEleLevelForLayerLevel = function(lvl, pxRatio) { - return lvl; - }; - LTCp.drawEleInLayer = function(layer, ele, lvl, pxRatio) { - var self2 = this; - var r = this.renderer; - var context = layer.context; - var bb = ele.boundingBox(); - if (bb.w === 0 || bb.h === 0 || !ele.visible()) { - return; - } - lvl = self2.getEleLevelForLayerLevel(lvl, pxRatio); - { - r.setImgSmoothing(context, false); - } - { - r.drawCachedElement(context, ele, null, null, lvl, useHighQualityEleTxrReqs); - } - { - r.setImgSmoothing(context, true); - } - }; - LTCp.levelIsComplete = function(lvl, eles) { - var self2 = this; - var layers = self2.layersByLevel[lvl]; - if (!layers || layers.length === 0) { - return false; - } - var numElesInLayers = 0; - for (var i3 = 0; i3 < layers.length; i3++) { - var layer = layers[i3]; - if (layer.reqs > 0) { - return false; - } - if (layer.invalid) { - return false; - } - numElesInLayers += layer.eles.length; - } - if (numElesInLayers !== eles.length) { - return false; - } - return true; - }; - LTCp.validateLayersElesOrdering = function(lvl, eles) { - var layers = this.layersByLevel[lvl]; - if (!layers) { - return; - } - for (var i3 = 0; i3 < layers.length; i3++) { - var layer = layers[i3]; - var offset = -1; - for (var j = 0; j < eles.length; j++) { - if (layer.eles[0] === eles[j]) { - offset = j; - break; - } - } - if (offset < 0) { - this.invalidateLayer(layer); - continue; - } - var o = offset; - for (var j = 0; j < layer.eles.length; j++) { - if (layer.eles[j] !== eles[o + j]) { - this.invalidateLayer(layer); - break; - } - } - } - }; - LTCp.updateElementsInLayers = function(eles, update2) { - var self2 = this; - var isEles = element(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 rs = ele._private.rscratch; - var caches = rs.imgLayerCaches = rs.imgLayerCaches || {}; - for (var l = minLvl; l <= maxLvl; l++) { - var layer = caches[l]; - if (!layer) { - continue; - } - if (req && self2.getEleLevelForLayerLevel(layer.level) !== req.level) { - continue; - } - update2(layer, ele, req); - } - } - }; - LTCp.haveLayers = function() { - var self2 = this; - var haveLayers = false; - for (var l = minLvl; l <= maxLvl; l++) { - var layers = self2.layersByLevel[l]; - if (layers && layers.length > 0) { - haveLayers = true; - break; - } - } - return haveLayers; - }; - LTCp.invalidateElements = function(eles) { - var self2 = this; - if (eles.length === 0) { - return; - } - self2.lastInvalidationTime = performanceNow(); - if (eles.length === 0 || !self2.haveLayers()) { - return; - } - self2.updateElementsInLayers(eles, function invalAssocLayers(layer, ele, req) { - self2.invalidateLayer(layer); - }); - }; - LTCp.invalidateLayer = function(layer) { - this.lastInvalidationTime = performanceNow(); - if (layer.invalid) { - return; - } - var lvl = layer.level; - var eles = layer.eles; - var layers = this.layersByLevel[lvl]; - removeFromArray(layers, layer); - layer.elesQueue = []; - layer.invalid = true; - if (layer.replacement) { - layer.replacement.invalid = true; - } - for (var i3 = 0; i3 < eles.length; i3++) { - var caches = eles[i3]._private.rscratch.imgLayerCaches; - if (caches) { - caches[lvl] = null; - } - } - }; - LTCp.refineElementTextures = function(eles) { - var self2 = this; - self2.updateElementsInLayers(eles, function refineEachEle(layer, ele, req) { - var rLyr = layer.replacement; - if (!rLyr) { - rLyr = layer.replacement = self2.makeLayer(layer.bb, layer.level); - rLyr.replaces = layer; - rLyr.eles = layer.eles; - } - if (!rLyr.reqs) { - for (var i3 = 0; i3 < rLyr.eles.length; i3++) { - self2.queueLayer(rLyr, rLyr.eles[i3]); - } - } - }); - }; - LTCp.enqueueElementRefinement = function(ele) { - this.eleTxrDeqs.merge(ele); - this.scheduleElementRefinement(); - }; - LTCp.queueLayer = function(layer, ele) { - var self2 = this; - var q = self2.layersQueue; - var elesQ = layer.elesQueue; - var hasId = elesQ.hasId = elesQ.hasId || {}; - if (layer.replacement) { - return; - } - if (ele) { - if (hasId[ele.id()]) { - return; - } - elesQ.push(ele); - hasId[ele.id()] = true; - } - if (layer.reqs) { - layer.reqs++; - q.updateItem(layer); - } else { - layer.reqs = 1; - q.push(layer); - } - }; - LTCp.dequeue = function(pxRatio) { - var self2 = this; - var q = self2.layersQueue; - var deqd = []; - var eleDeqs = 0; - while (eleDeqs < maxDeqSize) { - if (q.size() === 0) { - break; - } - var layer = q.peek(); - if (layer.replacement) { - q.pop(); - continue; - } - if (layer.replaces && layer !== layer.replaces.replacement) { - q.pop(); - continue; - } - if (layer.invalid) { - q.pop(); - continue; - } - var ele = layer.elesQueue.shift(); - if (ele) { - self2.drawEleInLayer(layer, ele, layer.level, pxRatio); - eleDeqs++; - } - if (deqd.length === 0) { - deqd.push(true); - } - if (layer.elesQueue.length === 0) { - q.pop(); - layer.reqs = 0; - if (layer.replaces) { - self2.applyLayerReplacement(layer); - } - self2.requestRedraw(); - } - } - return deqd; - }; - LTCp.applyLayerReplacement = function(layer) { - var self2 = this; - var layersInLevel = self2.layersByLevel[layer.level]; - var replaced = layer.replaces; - var index = layersInLevel.indexOf(replaced); - if (index < 0 || replaced.invalid) { - return; - } - layersInLevel[index] = 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; - } - } - self2.requestRedraw(); - }; - LTCp.requestRedraw = debounce_1(function() { - var r = this.renderer; - r.redrawHint("eles", true); - r.redrawHint("drag", true); - r.redraw(); - }, 100); - LTCp.setupDequeueing = defs.setupDequeueing({ - deqRedrawThreshold, - deqCost, - deqAvgCost, - deqNoDrawCost, - deqFastCost, - deq: function deq(self2, pxRatio) { - return self2.dequeue(pxRatio); - }, - onDeqd: noop$12, - shouldRedraw: trueify, - priority: function priority(self2) { - return self2.renderer.beforeRenderPriorities.lyrTxrDeq; - } - }); - 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.arrowShapeImpl = function(name2) { - return (impl || (impl = { - "polygon": polygon, - "triangle-backcurve": triangleBackcurve, - "triangle-tee": triangleTee, - "circle-triangle": circleTriangle, - "triangle-cross": triangleTee, - "circle": circle2 - }))[name2]; - }; - var CRp$9 = {}; - CRp$9.drawElement = function(context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity) { - var r = this; - if (ele.isNode()) { - r.drawNode(context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity); - } else { - r.drawEdge(context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity); - } - }; - CRp$9.drawElementOverlay = function(context, ele) { - var r = this; - if (ele.isNode()) { - r.drawNodeOverlay(context, ele); - } else { - r.drawEdgeOverlay(context, ele); - } - }; - CRp$9.drawElementUnderlay = function(context, ele) { - var r = this; - if (ele.isNode()) { - r.drawNodeUnderlay(context, ele); - } else { - r.drawEdgeUnderlay(context, ele); - } - }; - CRp$9.drawCachedElementPortion = function(context, ele, eleTxrCache, pxRatio, lvl, reason, getRotation, getOpacity2) { - var r = 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); - 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; - 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); - if (!smooth) { - r.setImgSmoothing(context, true); - } - var off = eleTxrCache.getRotationOffset(ele); - x2 = off.x; - y2 = off.y; - } else { - x2 = x1; - y2 = 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); - if (opacity !== 1) { - context.globalAlpha = oldGlobalAlpha; - } - if (theta !== 0) { - context.rotate(-theta); - context.translate(-sx, -sy); - if (!smooth) { - r.setImgSmoothing(context, false); - } - } - } else { - eleTxrCache.drawElement(context, ele); - } - }; - var getZeroRotation = 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) { - return ele.effectiveOpacity(); - }; - var getTextOpacity = function getTextOpacity2(e, 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; - 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(); - 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); - } - if (isEdge && !badLine) { - r.drawCachedElementPortion(context, ele, slbTxrCache, pxRatio, lvl, reason, getSourceLabelRotation, getTextOpacity); - r.drawCachedElementPortion(context, ele, tlbTxrCache, pxRatio, lvl, reason, getTargetLabelRotation, getTextOpacity); - } - r.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); - } - }; - 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.drawCachedNodes = function(context, eles, pxRatio, extent) { - var r = this; - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - if (!ele.isNode()) { - continue; - } - r.drawCachedElement(context, ele, pxRatio, extent); - } - }; - CRp$9.drawLayeredElements = function(context, eles, pxRatio, extent) { - var r = this; - var layers = r.data.lyrTxrCache.getLayers(eles, pxRatio); - if (layers) { - for (var i3 = 0; i3 < layers.length; i3++) { - var layer = layers[i3]; - var bb = layer.bb; - if (bb.w === 0 || bb.h === 0) { - continue; + /******/ + ]) + ); + }); + } + }); + + // ../../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(modules2) { + var installedModules = {}; + function __webpack_require__(moduleId) { + if (installedModules[moduleId]) { + return installedModules[moduleId].exports; + } + var module3 = installedModules[moduleId] = { + /******/ + i: moduleId, + /******/ + l: false, + /******/ + exports: {} + /******/ + }; + modules2[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__); + module3.l = true; + return module3.exports; } - context.drawImage(layer.canvas, bb.x1, bb.y1, bb.w, bb.h); - } - } else { - r.drawCachedElements(context, eles, pxRatio, extent); - } - }; - var CRp$8 = {}; - CRp$8.drawEdge = function(context, edge, shiftToOriginWithBb) { - var drawLabel2 = 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 rs = edge._private.rscratch; - if (shouldDrawOpacity && !edge.visible()) { - return; - } - if (rs.badLine || rs.allpts == null || isNaN(rs.allpts[0])) { - return; - } - var bb; - if (shiftToOriginWithBb) { - bb = shiftToOriginWithBb; - context.translate(-bb.x1, -bb.y1); - } - var opacity = shouldDrawOpacity ? edge.pstyle("opacity").value : 1; - var lineOpacity = shouldDrawOpacity ? edge.pstyle("line-opacity").value : 1; - var curveStyle = edge.pstyle("curve-style").value; - var lineStyle = edge.pstyle("line-style").value; - var edgeWidth = edge.pstyle("width").pfValue; - var lineCap = edge.pstyle("line-cap").value; - var effectiveLineOpacity = opacity * lineOpacity; - var effectiveArrowOpacity = opacity * lineOpacity; - var drawLine = 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); - } else { - context.lineWidth = edgeWidth; - context.lineCap = lineCap; - r.eleStrokeStyle(context, edge, strokeOpacity); - r.drawEdgePath(edge, context, rs.allpts, lineStyle); - context.lineCap = "butt"; - } - }; - var drawOverlay = function drawOverlay2() { - if (!shouldDrawOverlay) { - return; - } - r.drawEdgeOverlay(context, edge); - }; - var drawUnderlay = function drawUnderlay2() { - if (!shouldDrawOverlay) { - return; - } - r.drawEdgeUnderlay(context, edge); - }; - var drawArrows2 = 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); - }; - context.lineJoin = "round"; - var ghost = edge.pstyle("ghost").value === "yes"; - if (ghost) { - var gx = edge.pstyle("ghost-offset-x").pfValue; - var gy = edge.pstyle("ghost-offset-y").pfValue; - var ghostOpacity = edge.pstyle("ghost-opacity").value; - var effectiveGhostOpacity = effectiveLineOpacity * ghostOpacity; - context.translate(gx, gy); - drawLine(effectiveGhostOpacity); - drawArrows2(effectiveGhostOpacity); - context.translate(-gx, -gy); - } - drawUnderlay(); - drawLine(); - drawArrows2(); - drawOverlay(); - drawText2(); - if (shiftToOriginWithBb) { - context.translate(bb.x1, bb.y1); - } - }; - var drawEdgeOverlayUnderlay = function drawEdgeOverlayUnderlay2(overlayOrUnderlay) { - if (!["overlay", "underlay"].includes(overlayOrUnderlay)) { - throw new Error("Invalid state"); - } - return function(context, edge) { - if (!edge.visible()) { - return; - } - var opacity = edge.pstyle("".concat(overlayOrUnderlay, "-opacity")).value; - if (opacity === 0) { - return; - } - var r = this; - var usePaths = r.usePaths(); - var rs = edge._private.rscratch; - var padding2 = edge.pstyle("".concat(overlayOrUnderlay, "-padding")).pfValue; - var width2 = 2 * padding2; - var color2 = edge.pstyle("".concat(overlayOrUnderlay, "-color")).value; - context.lineWidth = width2; - 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"); - }; - }; - CRp$8.drawEdgeOverlay = drawEdgeOverlayUnderlay("overlay"); - CRp$8.drawEdgeUnderlay = drawEdgeOverlayUnderlay("underlay"); - CRp$8.drawEdgePath = function(edge, context, pts2, type2) { - var rs = edge._private.rscratch; - var canvasCxt = context; - var path2; - var pathCacheHit = false; - var usePaths = this.usePaths(); - var lineDashPattern = edge.pstyle("line-dash-pattern").pfValue; - var lineDashOffset = edge.pstyle("line-dash-offset").pfValue; - if (usePaths) { - var pathCacheKey = pts2.join("$"); - var keyMatches = rs.pathCacheKey && rs.pathCacheKey === pathCacheKey; - if (keyMatches) { - path2 = context = rs.pathCache; - pathCacheHit = true; - } else { - path2 = context = new Path2D(); - rs.pathCacheKey = pathCacheKey; - rs.pathCache = path2; - } - } - if (canvasCxt.setLineDash) { - switch (type2) { - case "dotted": - canvasCxt.setLineDash([1, 1]); - break; - case "dashed": - canvasCxt.setLineDash(lineDashPattern); - canvasCxt.lineDashOffset = lineDashOffset; - break; - case "solid": - canvasCxt.setLineDash([]); - break; - } - } - if (!pathCacheHit && !rs.badLine) { - if (context.beginPath) { - context.beginPath(); - } - context.moveTo(pts2[0], pts2[1]); - switch (rs.edgeType) { - case "bezier": - 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]); + __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 = 7); + }([ + /* 0 */ + /***/ + function(module3, exports3) { + module3.exports = __WEBPACK_EXTERNAL_MODULE_0__; + }, + /* 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]; + } + CoSEConstants.DEFAULT_USE_MULTI_LEVEL_SCALING = false; + CoSEConstants.DEFAULT_RADIAL_SEPARATION = FDLayoutConstants.DEFAULT_EDGE_LENGTH; + CoSEConstants.DEFAULT_COMPONENT_SEPERATION = 60; + CoSEConstants.TILE = true; + CoSEConstants.TILING_PADDING_VERTICAL = 10; + CoSEConstants.TILING_PADDING_HORIZONTAL = 10; + CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL = false; + module3.exports = CoSEConstants; + }, + /* 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]; + } + module3.exports = CoSEEdge; + }, + /* 3 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var LGraph = __webpack_require__(0).LGraph; + 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]; + } + module3.exports = CoSEGraph; + }, + /* 4 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var LGraphManager = __webpack_require__(0).LGraphManager; + 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]; + } + module3.exports = CoSEGraphManager; + }, + /* 5 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var FDLayoutNode = __webpack_require__(0).FDLayoutNode; + var IMath = __webpack_require__(0).IMath; + 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 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) > layout6.coolingFactor * layout6.maxNodeDisplacement) { + this.displacementY = layout6.coolingFactor * layout6.maxNodeDisplacement * IMath.sign(this.displacementY); + } + if (this.child == null) { + this.moveBy(this.displacementX, this.displacementY); + } else if (this.child.getNodes().length == 0) { + this.moveBy(this.displacementX, this.displacementY); + } else { + this.propogateDisplacementToChildren(this.displacementX, this.displacementY); + } + layout6.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY); + this.springForceX = 0; + this.springForceY = 0; + this.repulsionForceX = 0; + this.repulsionForceY = 0; + this.gravitationForceX = 0; + this.gravitationForceY = 0; + this.displacementX = 0; + this.displacementY = 0; + }; + CoSENode.prototype.propogateDisplacementToChildren = function(dX, dY) { + var nodes6 = this.getChild().getNodes(); + var node2; + for (var i2 = 0; i2 < nodes6.length; i2++) { + node2 = nodes6[i2]; + if (node2.getChild() == null) { + node2.moveBy(dX, dY); + node2.displacementX += dX; + node2.displacementY += dY; + } else { + node2.propogateDisplacementToChildren(dX, dY); + } + } + }; + CoSENode.prototype.setPred1 = function(pred12) { + this.pred1 = pred12; + }; + CoSENode.prototype.getPred1 = function() { + return pred1; + }; + CoSENode.prototype.getPred2 = function() { + return pred2; + }; + CoSENode.prototype.setNext = function(next3) { + this.next = next3; + }; + CoSENode.prototype.getNext = function() { + return next; + }; + CoSENode.prototype.setProcessed = function(processed2) { + this.processed = processed2; + }; + CoSENode.prototype.isProcessed = function() { + return processed; + }; + module3.exports = CoSENode; + }, + /* 6 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var FDLayout = __webpack_require__(0).FDLayout; + var CoSEGraphManager = __webpack_require__(4); + var CoSEGraph = __webpack_require__(3); + var CoSENode = __webpack_require__(5); + var CoSEEdge = __webpack_require__(2); + var CoSEConstants = __webpack_require__(1); + var FDLayoutConstants = __webpack_require__(0).FDLayoutConstants; + var LayoutConstants = __webpack_require__(0).LayoutConstants; + var Point3 = __webpack_require__(0).Point; + var PointD = __webpack_require__(0).PointD; + var Layout2 = __webpack_require__(0).Layout; + var Integer = __webpack_require__(0).Integer; + var IGeometry = __webpack_require__(0).IGeometry; + var LGraph = __webpack_require__(0).LGraph; + var Transform2 = __webpack_require__(0).Transform; + function CoSELayout() { + FDLayout.call(this); + this.toBeTiled = {}; + } + __name(CoSELayout, "CoSELayout"); + CoSELayout.prototype = Object.create(FDLayout.prototype); + for (var prop in FDLayout) { + CoSELayout[prop] = FDLayout[prop]; + } + CoSELayout.prototype.newGraphManager = function() { + var gm = new CoSEGraphManager(this); + this.graphManager = gm; + return gm; + }; + CoSELayout.prototype.newGraph = function(vGraph) { + return new CoSEGraph(null, this.graphManager, vGraph); + }; + CoSELayout.prototype.newNode = function(vNode) { + return new CoSENode(this.graphManager, vNode); + }; + CoSELayout.prototype.newEdge = function(vEdge) { + return new CoSEEdge(null, null, vEdge); + }; + CoSELayout.prototype.initParameters = function() { + FDLayout.prototype.initParameters.call(this, arguments); + if (!this.isSubLayout) { + if (CoSEConstants.DEFAULT_EDGE_LENGTH < 10) { + this.idealEdgeLength = 10; + } else { + this.idealEdgeLength = CoSEConstants.DEFAULT_EDGE_LENGTH; + } + this.useSmartIdealEdgeLengthCalculation = CoSEConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION; + this.springConstant = FDLayoutConstants.DEFAULT_SPRING_STRENGTH; + this.repulsionConstant = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH; + this.gravityConstant = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH; + this.compoundGravityConstant = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH; + this.gravityRangeFactor = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR; + this.compoundGravityRangeFactor = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR; + this.prunedNodesAll = []; + this.growTreeIterations = 0; + this.afterGrowthIterations = 0; + this.isTreeGrowing = false; + this.isGrowthFinished = false; + this.coolingCycle = 0; + this.maxCoolingCycle = this.maxIterations / FDLayoutConstants.CONVERGENCE_CHECK_PERIOD; + this.finalTemperature = FDLayoutConstants.CONVERGENCE_CHECK_PERIOD / this.maxIterations; + this.coolingAdjuster = 1; + } + }; + CoSELayout.prototype.layout = function() { + var createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED; + if (createBendsAsNeeded) { + this.createBendpoints(); + this.graphManager.resetAllEdges(); + } + this.level = 0; + return this.classicLayout(); + }; + CoSELayout.prototype.classicLayout = function() { + this.nodesWithGravity = this.calculateNodesToApplyGravitationTo(); + this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity); + this.calcNoOfChildrenForAllNodes(); + this.graphManager.calcLowestCommonAncestors(); + this.graphManager.calcInclusionTreeDepths(); + this.graphManager.getRoot().calcEstimatedSize(); + this.calcIdealEdgeLengths(); + if (!this.incremental) { + var forest = this.getFlatForest(); + if (forest.length > 0) { + this.positionNodesRadially(forest); + } else { + this.reduceTrees(); + this.graphManager.resetAllNodesToApplyGravitation(); + var allNodes = new Set(this.getAllNodes()); + var intersection3 = this.nodesWithGravity.filter(function(x5) { + return allNodes.has(x5); + }); + this.graphManager.setAllNodesToApplyGravitation(intersection3); + this.positionNodesRandomly(); + } + } else { + if (CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL) { + this.reduceTrees(); + this.graphManager.resetAllNodesToApplyGravitation(); + var allNodes = new Set(this.getAllNodes()); + var intersection3 = this.nodesWithGravity.filter(function(x5) { + return allNodes.has(x5); + }); + this.graphManager.setAllNodesToApplyGravitation(intersection3); + } + } + this.initSpringEmbedder(); + this.runSpringEmbedder(); + return true; + }; + CoSELayout.prototype.tick = function() { + this.totalIterations++; + if (this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) { + if (this.prunedNodesAll.length > 0) { + this.isTreeGrowing = true; + } else { + return true; + } + } + if (this.totalIterations % FDLayoutConstants.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) { + if (this.isConverged()) { + if (this.prunedNodesAll.length > 0) { + this.isTreeGrowing = true; + } else { + return true; + } + } + this.coolingCycle++; + if (this.layoutQuality == 0) { + this.coolingAdjuster = this.coolingCycle; + } else if (this.layoutQuality == 1) { + this.coolingAdjuster = this.coolingCycle / 3; + } + this.coolingFactor = Math.max(this.initialCoolingFactor - Math.pow(this.coolingCycle, Math.log(100 * (this.initialCoolingFactor - this.finalTemperature)) / Math.log(this.maxCoolingCycle)) / 100 * this.coolingAdjuster, this.finalTemperature); + this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor)); + } + if (this.isTreeGrowing) { + if (this.growTreeIterations % 10 == 0) { + if (this.prunedNodesAll.length > 0) { + this.graphManager.updateBounds(); + this.updateGrid(); + this.growTree(this.prunedNodesAll); + this.graphManager.resetAllNodesToApplyGravitation(); + var allNodes = new Set(this.getAllNodes()); + var intersection3 = this.nodesWithGravity.filter(function(x5) { + return allNodes.has(x5); + }); + this.graphManager.setAllNodesToApplyGravitation(intersection3); + this.graphManager.updateBounds(); + this.updateGrid(); + this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL; + } else { + this.isTreeGrowing = false; + this.isGrowthFinished = true; + } + } + this.growTreeIterations++; + } + if (this.isGrowthFinished) { + if (this.isConverged()) { + return true; + } + if (this.afterGrowthIterations % 10 == 0) { + this.graphManager.updateBounds(); + this.updateGrid(); + } + this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100); + this.afterGrowthIterations++; + } + var gridUpdateAllowed = !this.isTreeGrowing && !this.isGrowthFinished; + var forceToNodeSurroundingUpdate = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished; + this.totalDisplacement = 0; + this.graphManager.updateBounds(); + this.calcSpringForces(); + this.calcRepulsionForces(gridUpdateAllowed, forceToNodeSurroundingUpdate); + this.calcGravitationalForces(); + this.moveNodes(); + this.animate(); + return false; + }; + CoSELayout.prototype.getPositionsData = function() { + var allNodes = this.graphManager.getAllNodes(); + var pData = {}; + for (var i2 = 0; i2 < allNodes.length; i2++) { + var rect4 = allNodes[i2].rect; + var id27 = allNodes[i2].id; + pData[id27] = { + id: id27, + x: rect4.getCenterX(), + y: rect4.getCenterY(), + w: rect4.width, + h: rect4.height + }; + } + return pData; + }; + CoSELayout.prototype.runSpringEmbedder = function() { + this.initialAnimationPeriod = 25; + this.animationPeriod = this.initialAnimationPeriod; + var layoutEnded = false; + if (FDLayoutConstants.ANIMATE === "during") { + this.emit("layoutstarted"); + } else { + while (!layoutEnded) { + layoutEnded = this.tick(); + } + this.graphManager.updateBounds(); + } + }; + CoSELayout.prototype.calculateNodesToApplyGravitationTo = function() { + var nodeList = []; + var graph; + var graphs = this.graphManager.getGraphs(); + var size5 = graphs.length; + var i2; + for (i2 = 0; i2 < size5; i2++) { + graph = graphs[i2]; + graph.updateConnected(); + if (!graph.isConnected) { + nodeList = nodeList.concat(graph.getNodes()); + } + } + return nodeList; + }; + CoSELayout.prototype.createBendpoints = function() { + var edges5 = []; + edges5 = edges5.concat(this.graphManager.getAllEdges()); + var visited = /* @__PURE__ */ new Set(); + var i2; + for (i2 = 0; i2 < edges5.length; i2++) { + var edge = edges5[i2]; + if (!visited.has(edge)) { + var source = edge.getSource(); + var target = edge.getTarget(); + if (source == target) { + edge.getBendpoints().push(new PointD()); + edge.getBendpoints().push(new PointD()); + this.createDummyNodesForBendpoints(edge); + visited.add(edge); + } else { + var edgeList2 = []; + edgeList2 = edgeList2.concat(source.getEdgeListToNode(target)); + edgeList2 = edgeList2.concat(target.getEdgeListToNode(source)); + if (!visited.has(edgeList2[0])) { + if (edgeList2.length > 1) { + var k2; + for (k2 = 0; k2 < edgeList2.length; k2++) { + var multiEdge = edgeList2[k2]; + multiEdge.getBendpoints().push(new PointD()); + this.createDummyNodesForBendpoints(multiEdge); + } + } + edgeList2.forEach(function(edge2) { + visited.add(edge2); + }); + } + } + } + if (visited.size == edges5.length) { + break; + } + } + }; + CoSELayout.prototype.positionNodesRadially = function(forest) { + var currentStartingPoint = new Point3(0, 0); + var numberOfColumns = Math.ceil(Math.sqrt(forest.length)); + var height2 = 0; + var currentY = 0; + var currentX = 0; + var point8 = new PointD(0, 0); + for (var i2 = 0; i2 < forest.length; i2++) { + if (i2 % numberOfColumns == 0) { + currentX = 0; + currentY = height2; + if (i2 != 0) { + currentY += CoSEConstants.DEFAULT_COMPONENT_SEPERATION; + } + 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(id27) { + var compoundNode = self2.idToDummyNode[id27]; + tiledZeroDegreePack[id27] = self2.tileNodes(self2.memberGroups[id27], compoundNode.paddingLeft + compoundNode.paddingRight); + compoundNode.rect.width = tiledZeroDegreePack[id27].width; + compoundNode.rect.height = tiledZeroDegreePack[id27].height; + }); + }; + CoSELayout.prototype.repopulateCompounds = function() { + for (var i2 = this.compoundOrder.length - 1; i2 >= 0; i2--) { + var lCompoundNode = this.compoundOrder[i2]; + var id27 = lCompoundNode.id; + var horizontalMargin = lCompoundNode.paddingLeft; + var verticalMargin = lCompoundNode.paddingTop; + this.adjustLocations(this.tiledMemberPack[id27], lCompoundNode.rect.x, lCompoundNode.rect.y, horizontalMargin, verticalMargin); + } + }; + CoSELayout.prototype.repopulateZeroDegreeMembers = function() { + var self2 = this; + var tiledPack = this.tiledZeroDegreePack; + Object.keys(tiledPack).forEach(function(id27) { + var compoundNode = self2.idToDummyNode[id27]; + var horizontalMargin = compoundNode.paddingLeft; + var verticalMargin = compoundNode.paddingTop; + self2.adjustLocations(tiledPack[id27], compoundNode.rect.x, compoundNode.rect.y, horizontalMargin, verticalMargin); + }); + }; + CoSELayout.prototype.getToBeTiled = function(node2) { + var id27 = node2.id; + if (this.toBeTiled[id27] != null) { + return this.toBeTiled[id27]; + } + var childGraph = node2.getChild(); + if (childGraph == null) { + this.toBeTiled[id27] = 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[id27] = false; + return false; + } + if (theChild.getChild() == null) { + this.toBeTiled[theChild.id] = false; + continue; + } + if (!this.getToBeTiled(theChild)) { + this.toBeTiled[id27] = false; + return false; + } + } + this.toBeTiled[id27] = true; + return true; + }; + CoSELayout.prototype.getNodeDegree = function(node2) { + var id27 = 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(id27) { + var compoundNode = idToNode[id27]; + self2.tiledMemberPack[id27] = self2.tileNodes(childGraphMap[id27], compoundNode.paddingLeft + compoundNode.paddingRight); + compoundNode.rect.width = self2.tiledMemberPack[id27].width; + compoundNode.rect.height = self2.tiledMemberPack[id27].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; + } + } + 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(); + } + } + this.prunedNodesAll = prunedNodesAll; + }; + CoSELayout.prototype.growTree = function(prunedNodesAll) { + var lengthOfPrunedNodesInStep = prunedNodesAll.length; + var prunedNodesInStep = prunedNodesAll[lengthOfPrunedNodesInStep - 1]; + var nodeData2; + for (var i2 = 0; i2 < prunedNodesInStep.length; i2++) { + nodeData2 = prunedNodesInStep[i2]; + this.findPlaceforPrunedNode(nodeData2); + nodeData2[2].add(nodeData2[0]); + nodeData2[2].add(nodeData2[1], nodeData2[1].source, nodeData2[1].target); + } + prunedNodesAll.splice(prunedNodesAll.length - 1, 1); + this.graphManager.resetAllNodes(); + this.graphManager.resetAllEdges(); + }; + CoSELayout.prototype.findPlaceforPrunedNode = function(nodeData2) { + var gridForPrunedNode; + var nodeToConnect; + var prunedNode = nodeData2[0]; + if (prunedNode == nodeData2[1].source) { + nodeToConnect = nodeData2[1].target; + } else { + nodeToConnect = nodeData2[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 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++; + } + } + 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()); + } + }; + 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; } - break; - case "straight": - case "segments": - case "haystack": - for (var _i = 2; _i + 1 < pts2.length; _i += 2) { - context.lineTo(pts2[_i], pts2[_i + 1]); + var module3 = installedModules[moduleId] = { + /******/ + i: moduleId, + /******/ + l: false, + /******/ + exports: {} + /******/ + }; + 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 + /******/ + }); } - break; - } - } - context = canvasCxt; - if (usePaths) { - context.stroke(path2); - } else { - context.stroke(); - } - if (context.setLineDash) { - context.setLineDash([]); - } - }; - 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]]; - 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]; - 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.closePath(); - context.fill(); - } - }; - CRp$8.drawArrowheads = function(context, edge, opacity) { - var rs = edge._private.rscratch; - var isHaystack = rs.edgeType === "haystack"; - if (!isHaystack) { - this.drawArrowhead(context, edge, "source", rs.arrowStartX, rs.arrowStartY, rs.srcArrowAngle, opacity); - } - this.drawArrowhead(context, edge, "mid-target", rs.midX, rs.midY, rs.midtgtArrowAngle, opacity); - this.drawArrowhead(context, edge, "mid-source", rs.midX, rs.midY, rs.midsrcArrowAngle, opacity); - if (!isHaystack) { - 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) { - return; - } - var self2 = this; - var arrowShape = edge.pstyle(prefix + "-arrow-shape").value; - if (arrowShape === "none") { - return; - } - var arrowClearFill = edge.pstyle(prefix + "-arrow-fill").value === "hollow" ? "both" : "filled"; - var arrowFill = edge.pstyle(prefix + "-arrow-fill").value; - var edgeWidth = edge.pstyle("width").pfValue; - var edgeOpacity = edge.pstyle("opacity").value; - if (opacity === void 0) { - opacity = edgeOpacity; - } - var gco = context.globalCompositeOperation; - if (opacity !== 1 || arrowFill === "hollow") { - 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, x2, y2, angle); - 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, x2, y2, angle); - }; - CRp$8.drawArrowShape = function(edge, context, fill, edgeWidth, shape, x2, y2, angle) { - var r = this; - var usePaths = this.usePaths() && shape !== "triangle-cross"; - var pathCacheHit = false; - var path2; - var canvasContext = context; - var translation = { - x: x2, - y: y2 - }; - var scale = edge.pstyle("arrow-scale").value; - var size2 = this.getArrowWidth(edgeWidth, scale); - var shapeImpl = r.arrowShapes[shape]; - if (usePaths) { - var cache2 = r.arrowPathCache = r.arrowPathCache || []; - var key = hashString(shape); - var cachedPath = cache2[key]; - if (cachedPath != null) { - path2 = context = cachedPath; - pathCacheHit = true; - } else { - path2 = context = new Path2D(); - cache2[key] = path2; - } - } - if (!pathCacheHit) { - if (context.beginPath) { - context.beginPath(); - } - if (usePaths) { - shapeImpl.draw(context, 1, 0, { - x: 0, - y: 0 - }, 1); - } else { - shapeImpl.draw(context, size2, angle, translation, edgeWidth); - } - if (context.closePath) { - context.closePath(); - } - } - context = canvasContext; - if (usePaths) { - context.translate(x2, y2); - context.rotate(angle); - context.scale(size2, size2); - } - if (fill === "filled" || fill === "both") { - if (usePaths) { - context.fill(path2); + }; + __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 in options3) { + obj[i2] = options3[i2]; + } + 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); + } + }); + layout6.runLayout(); + if (this.options.animate !== "during") { + self2.options.eles.nodes().not(":parent").layoutPositions(self2, self2.options, getPositions); + ready4 = false; + } + return this; + }; + _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.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.stop = function() { + this.stopped = true; + return this; + }; + 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(db8, elem, node2, section) { + const rd = 5; + elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db8.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(db8, elem, node2) { + elem.append("rect").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db8.type2Str(node2.type)).attr("height", node2.height).attr("width", node2.width); + }, "rectBkg"); + cloudBkg = /* @__PURE__ */ __name(function(db8, 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-" + db8.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(db8, 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-" + db8.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(db8, elem, node2) { + elem.append("circle").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db8.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(db8, elem, node2) { + elem.append("rect").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db8.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(db8, 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 === db8.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 { - context.fill(); + 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) + ")" + ); } - } - if (fill === "hollow" || fill === "both") { - context.lineWidth = (shapeImpl.matchEdgeWidth ? edgeWidth : 1) / (usePaths ? size2 : 1); - context.lineJoin = "miter"; - if (usePaths) { - context.stroke(path2); + } else { + if (!htmlLabels) { + const dx = node2.width / 2; + const dy = node2.padding / 2; + textElem.attr("transform", "translate(" + dx + ", " + dy + ")"); } else { - context.stroke(); + const dx = (node2.width - bbox.width) / 2; + const dy = (node2.height - bbox.height) / 2; + textElem.attr("transform", "translate(" + dx + ", " + dy + ")"); } } - if (usePaths) { - context.scale(1 / size2, 1 / size2); - context.rotate(-angle); - context.translate(-x2, -y2); - } - }; - 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) { - return; - } - try { - context.drawImage(img, ix, iy, iw, ih, x2, y2, w2, h); - } catch (e) { - warn(e); - } - }; - CRp$7.drawInscribedImage = function(context, img, node2, index, nodeOpacity) { - var r = 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", 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", 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", index); - var shouldClip = clip === "node"; - var imgOpacity = getIndexedStyle(node2, "background-image-opacity", "value", index) * nodeOpacity; - var smooth = getIndexedStyle(node2, "background-image-smoothing", "value", index); - var imgW = img.width || img.cachedW; - var imgH = img.height || img.cachedH; - if (null == imgW || null == imgH) { - document.body.appendChild(img); - imgW = img.cachedW = img.width || img.offsetWidth; - imgH = img.cachedH = img.height || img.offsetHeight; - document.body.removeChild(img); - } - var w2 = imgW; - var h = imgH; - if (getIndexedStyle(node2, "background-width", "value", index) !== "auto") { - if (getIndexedStyle(node2, "background-width", "units", index) === "%") { - w2 = getIndexedStyle(node2, "background-width", "pfValue", index) * nodeTW; - } else { - w2 = getIndexedStyle(node2, "background-width", "pfValue", index); - } + switch (node2.type) { + case db8.nodeType.DEFAULT: + defaultBkg2(db8, bkgElem, node2, section); + break; + case db8.nodeType.ROUNDED_RECT: + roundedRectBkg(db8, bkgElem, node2, section); + break; + case db8.nodeType.RECT: + rectBkg(db8, bkgElem, node2, section); + break; + case db8.nodeType.CIRCLE: + bkgElem.attr("transform", "translate(" + node2.width / 2 + ", " + +node2.height / 2 + ")"); + circleBkg(db8, bkgElem, node2, section); + break; + case db8.nodeType.CLOUD: + cloudBkg(db8, bkgElem, node2, section); + break; + case db8.nodeType.BANG: + bangBkg(db8, bkgElem, node2, section); + break; + case db8.nodeType.HEXAGON: + hexagonBkg(db8, bkgElem, node2, section); + break; } - if (getIndexedStyle(node2, "background-height", "value", index) !== "auto") { - if (getIndexedStyle(node2, "background-height", "units", index) === "%") { - h = getIndexedStyle(node2, "background-height", "pfValue", index) * nodeTH; - } else { - h = getIndexedStyle(node2, "background-height", "pfValue", index); + db8.setElementForId(node2.id, nodeElem); + return node2.height; + }, "drawNode"); + positionNode3 = /* @__PURE__ */ __name(function(db8, node2) { + const nodeElem = db8.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(db8, svg, mindmap, section, conf8) { + await drawNode2(db8, svg, mindmap, section, conf8); + if (mindmap.children) { + await Promise.all( + mindmap.children.map( + (child, index) => drawNodes(db8, svg, child, section < 0 ? index : section, conf8) + ) + ); + } + } + function drawEdges(edgesEl, cy) { + cy.edges().map((edge, id27) => { + const data5 = edge.data(); + if (edge[0]._private.bodyBounds) { + const bounds4 = edge[0]._private.rscratch; + log.trace("Edge: ", id27, 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 } - } - if (w2 === 0 || h === 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", index); - var posXPfVal = getIndexedStyle(node2, "background-position-x", "pfValue", index); - if (posXUnits === "%") { - x2 += (nodeTW - w2) * posXPfVal; - } else { - x2 += posXPfVal; - } - var offXUnits = getIndexedStyle(node2, "background-offset-x", "units", index); - var offXPfVal = getIndexedStyle(node2, "background-offset-x", "pfValue", index); - if (offXUnits === "%") { - x2 += (nodeTW - w2) * offXPfVal; - } else { - x2 += offXPfVal; - } - var y2 = 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; - } else { - y2 += posYPfVal; - } - var offYUnits = getIndexedStyle(node2, "background-offset-y", "units", index); - var offYPfVal = getIndexedStyle(node2, "background-offset-y", "pfValue", index); - if (offYUnits === "%") { - y2 += (nodeTH - h) * offYPfVal; - } else { - y2 += offYPfVal; - } - if (rs.pathCache) { - x2 -= nodeX; - y2 -= nodeY; - nodeX = 0; - nodeY = 0; - } - var gAlpha = context.globalAlpha; - context.globalAlpha = imgOpacity; - var smoothingEnabled = r.getImgSmoothing(context); - var isSmoothingSwitched = false; - if (smooth === "no" && smoothingEnabled) { - r.setImgSmoothing(context, false); - isSmoothingSwitched = true; - } else if (smooth === "yes" && !smoothingEnabled) { - r.setImgSmoothing(context, true); - isSmoothingSwitched = true; - } - if (repeat2 === "no-repeat") { - if (shouldClip) { - context.save(); - if (rs.pathCache) { - context.clip(rs.pathCache); - } else { - r.nodeShapes[r.getNodeShape(node2)].draw(context, nodeX, nodeY, nodeTW, nodeTH); - context.clip(); + }); + }); + } + } + 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" } } - r.safeDrawImage(context, img, 0, 0, imgW, imgH, x2, y2, w2, h); - 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); - context.fill(); - context.translate(-x2, -y2); - } - context.globalAlpha = gAlpha; - if (isSmoothingSwitched) { - r.setImgSmoothing(context, smoothingEnabled); - } - }; - var CRp$6 = {}; - CRp$6.eleTextBiggerThanMin = function(ele, scale) { - if (!scale) { - var zoom = ele.cy().zoom(); - var pxRatio = this.getPixelRatio(); - var lvl = Math.ceil(log2(zoom * pxRatio)); - scale = Math.pow(2, lvl); - } - var computedSize = ele.pstyle("font-size").pfValue * scale; - var minSize = ele.pstyle("min-zoomed-font-size").pfValue; - if (computedSize < minSize) { - return false; - } - return true; - }; - CRp$6.drawElementText = function(context, ele, shiftToOriginWithBb, force, prefix) { - var useEleOpacity = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true; - var r = this; - if (force == null) { - if (useEleOpacity && !r.eleTextBiggerThanMin(ele)) { - return; - } - } else if (force === false) { + ] + }); + 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(db8, cy) { + cy.nodes().map((node2, id27) => { + const data5 = node2.data(); + data5.x = node2.position().x; + data5.y = node2.position().y; + positionNode3(db8, data5); + const el = db8.getElementById(data5.nodeId); + log.info("Id:", id27, "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-${id27})`); + }); + } + 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, id27, _version, diagObj) => { + log.debug("Rendering mindmap diagram\n" + text2); + const db8 = diagObj.db; + const mm = db8.getMindmap(); + if (!mm) { return; } - if (ele.isNode()) { - var label = ele.pstyle("label"); - if (!label || !label.value) { - return; - } - var justification = r.getLabelJustification(ele); - context.textAlign = justification; - context.textBaseline = "bottom"; - } else { - var badLine = ele.element()._private.rscratch.badLine; - var _label = ele.pstyle("label"); - var srcLabel = ele.pstyle("source-label"); - var tgtLabel = ele.pstyle("target-label"); - if (badLine || (!_label || !_label.value) && (!srcLabel || !srcLabel.value) && (!tgtLabel || !tgtLabel.value)) { - return; - } - context.textAlign = "center"; - context.textBaseline = "bottom"; - } - var applyRotation = !shiftToOriginWithBb; - var bb; - if (shiftToOriginWithBb) { - bb = shiftToOriginWithBb; - context.translate(-bb.x1, -bb.y1); - } - if (prefix == null) { - r.drawText(context, ele, null, applyRotation, useEleOpacity); - if (ele.isEdge()) { - r.drawText(context, ele, "source", applyRotation, useEleOpacity); - r.drawText(context, ele, "target", applyRotation, useEleOpacity); - } - } else { - r.drawText(context, ele, prefix, applyRotation, useEleOpacity); - } - if (shiftToOriginWithBb) { - context.translate(bb.x1, bb.y1); - } + const conf8 = getConfig2(); + conf8.htmlLabels = false; + const svg = selectSvgElement(id27); + const edgesElem = svg.append("g"); + edgesElem.attr("class", "mindmap-edges"); + const nodesElem = svg.append("g"); + nodesElem.attr("class", "mindmap-nodes"); + await drawNodes(db8, nodesElem, mm, -1, conf8); + const cy = await layoutMindmap(mm, conf8); + drawEdges(edgesElem, cy); + positionNodes(db8, cy); + setupGraphViewbox( + void 0, + svg, + conf8.mindmap?.padding ?? defaultConfig_default.mindmap.padding, + conf8.mindmap?.useMaxWidth ?? defaultConfig_default.mindmap.useMaxWidth + ); + }, "draw"); + mindmapRenderer_default = { + draw: draw19 }; - CRp$6.getFontCache = function(context) { - var cache2; - this.fontCaches = this.fontCaches || []; - for (var i3 = 0; i3 < this.fontCaches.length; i3++) { - cache2 = this.fontCaches[i3]; - if (cache2.context === context) { - return cache2; + } + }); + + // 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); } } - cache2 = { - context - }; - this.fontCaches.push(cache2); - return cache2; - }; - CRp$6.setupTextStyle = function(context, ele) { - var useEleOpacity = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true; - var labelStyle = ele.pstyle("font-style").strValue; - var labelSize = ele.pstyle("font-size").pfValue + "px"; - var labelFamily = ele.pstyle("font-family").strValue; - var labelWeight = ele.pstyle("font-weight").strValue; - var opacity = useEleOpacity ? ele.effectiveOpacity() * ele.pstyle("text-opacity").value : 1; - var outlineOpacity = ele.pstyle("text-outline-opacity").value * opacity; - var color2 = ele.pstyle("color").value; - var outlineColor = ele.pstyle("text-outline-color").value; - context.font = labelStyle + " " + labelWeight + " " + labelSize + " " + labelFamily; - context.lineJoin = "round"; - 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, height2) { - var radius = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 5; - 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 + height2 - radius); - ctx.quadraticCurveTo(x2 + width2, y2 + height2, x2 + width2 - radius, y2 + height2); - ctx.lineTo(x2 + radius, y2 + height2); - ctx.quadraticCurveTo(x2, y2 + height2, x2, y2 + height2 - radius); - ctx.lineTo(x2, y2 + radius); - ctx.quadraticCurveTo(x2, y2, x2 + radius, y2); - ctx.closePath(); - ctx.fill(); - } - CRp$6.getTextAngle = function(ele, prefix) { - var theta; - var _p = ele._private; - var rscratch = _p.rscratch; - var pdash = prefix ? prefix + "-" : ""; - var rotation = ele.pstyle(pdash + "text-rotation"); - var textAngle = getPrefixedProperty(rscratch, "labelAngle", prefix); - if (rotation.strValue === "autorotate") { - theta = ele.isEdge() ? textAngle : 0; - } else if (rotation.strValue === "none") { - theta = 0; - } else { - theta = rotation.pfValue; + 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 theta; + 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 }; - CRp$6.drawText = function(context, ele, prefix) { - var applyRotation = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true; - var useEleOpacity = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true; - var _p = ele._private; - var rscratch = _p.rscratch; - var parentOpacity = useEleOpacity ? ele.effectiveOpacity() : 1; - if (useEleOpacity && (parentOpacity === 0 || ele.pstyle("text-opacity").value === 0)) { - return; - } - if (prefix === "main") { - prefix = null; - } - var textX = getPrefixedProperty(rscratch, "labelX", prefix); - var textY = getPrefixedProperty(rscratch, "labelY", prefix); - var orgTextX, orgTextY; - var text2 = this.getLabelText(ele, prefix); - if (text2 != null && text2 !== "" && !isNaN(textX) && !isNaN(textY)) { - this.setupTextStyle(context, ele, useEleOpacity); - var pdash = prefix ? prefix + "-" : ""; - var textW = getPrefixedProperty(rscratch, "labelWidth", prefix); - 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 halign = ele.pstyle("text-halign").value; - var valign = ele.pstyle("text-valign").value; - if (isEdge) { - halign = "center"; - valign = "center"; - } - textX += marginX; - textY += marginY; - var theta; - if (!applyRotation) { - theta = 0; - } else { - theta = this.getTextAngle(ele, prefix); - } - if (theta !== 0) { - orgTextX = textX; - orgTextY = textY; - context.translate(orgTextX, orgTextY); - context.rotate(theta); - textX = 0; - textY = 0; - } - switch (valign) { - case "top": - break; - case "center": - textY += textH / 2; - break; - case "bottom": - textY += textH; - break; - } - var backgroundOpacity = ele.pstyle("text-background-opacity").value; - var borderOpacity = ele.pstyle("text-border-opacity").value; - var textBorderWidth = ele.pstyle("text-border-width").pfValue; - var backgroundPadding = ele.pstyle("text-background-padding").pfValue; - if (backgroundOpacity > 0 || textBorderWidth > 0 && borderOpacity > 0) { - var bgX = textX - backgroundPadding; - switch (halign) { - case "left": - bgX -= textW; + } + }); + + // 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 parser22 = { + 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 "center": - bgX -= textW / 2; + case 8: + case 9: + case 11: + this.$ = $$[$0]; + break; + case 10: + this.$ = $$[$0 - 1]; break; } - var bgY = textY - textH - backgroundPadding; - var bgW = textW + 2 * backgroundPadding; - var bgH = textH + 2 * backgroundPadding; - if (backgroundOpacity > 0) { - var textFill = context.fillStyle; - var textBackgroundColor = ele.pstyle("text-background-color").value; - context.fillStyle = "rgba(" + textBackgroundColor[0] + "," + textBackgroundColor[1] + "," + textBackgroundColor[2] + "," + backgroundOpacity * parentOpacity + ")"; - var styleShape = ele.pstyle("text-background-shape").strValue; - if (styleShape.indexOf("round") === 0) { - roundRect(context, bgX, bgY, bgW, bgH, 2); - } else { - context.fillRect(bgX, bgY, bgW, bgH); + }, "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(); + } + token2 = self2.symbols_[token2] || token2; } - context.fillStyle = textFill; + return token2; } - if (textBorderWidth > 0 && borderOpacity > 0) { - var textStroke = context.strokeStyle; - var textLineWidth = context.lineWidth; - var textBorderColor = ele.pstyle("text-border-color").value; - var textBorderStyle = ele.pstyle("text-border-style").value; - context.strokeStyle = "rgba(" + textBorderColor[0] + "," + textBorderColor[1] + "," + textBorderColor[2] + "," + borderOpacity * parentOpacity + ")"; - context.lineWidth = textBorderWidth; - if (context.setLineDash) { - switch (textBorderStyle) { - case "dotted": - context.setLineDash([1, 1]); - break; - case "dashed": - context.setLineDash([4, 2]); - break; - case "double": - context.lineWidth = textBorderWidth / 4; - context.setLineDash([]); - break; - case "solid": - context.setLineDash([]); - break; + __name(lex2, "lex"); + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); } + action = table[state5] && table[state5][symbol]; } - context.strokeRect(bgX, bgY, bgW, bgH); - if (textBorderStyle === "double") { - var whiteWidth = textBorderWidth / 2; - context.strokeRect(bgX + whiteWidth, bgY + whiteWidth, bgW - whiteWidth * 2, bgH - whiteWidth * 2); + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state5]) { + 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 (context.setLineDash) { - context.setLineDash([]); + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", 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; } - context.lineWidth = textLineWidth; - context.strokeStyle = textStroke; } - } - var lineWidth = 2 * ele.pstyle("text-outline-width").pfValue; - if (lineWidth > 0) { - context.lineWidth = lineWidth; - } - if (ele.pstyle("text-wrap").value === "wrap") { - var lines = getPrefixedProperty(rscratch, "labelWrapCachedLines", prefix); - var lineHeight = getPrefixedProperty(rscratch, "labelLineHeight", prefix); - var halfTextW = textW / 2; - var justification = this.getLabelJustification(ele); - if (justification === "auto") - ; - else if (halign === "left") { - if (justification === "left") { - textX += -textW; - } else if (justification === "center") { - textX += -halfTextW; + 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]; } - } else if (halign === "center") { - if (justification === "left") { - textX += -halfTextW; - } else if (justification === "right") { - textX += halfTextW; + 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]; } - } else if (halign === "right") { - if (justification === "center") { - textX += halfTextW; - } else if (justification === "right") { - textX += textW; + 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 + }); } - } - switch (valign) { - case "top": - textY -= (lines.length - 1) * lineHeight; - break; - case "center": - case "bottom": - textY -= (lines.length - 1) * lineHeight; - break; - } - for (var l = 0; l < lines.length; l++) { - if (lineWidth > 0) { - context.strokeText(lines[l], textX, textY); + 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); + } } - context.fillText(lines[l], textX, textY); - textY += lineHeight; - } - } else { - if (lineWidth > 0) { - context.strokeText(text2, textX, textY); - } - context.fillText(text2, textX, textY); - } - if (theta !== 0) { - context.rotate(-theta); - context.translate(-orgTextX, -orgTextY); - } - } + 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.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; + }(); + parser22.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser22; + parser22.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 }; - var CRp$5 = {}; - CRp$5.drawNode = function(context, node2, shiftToOriginWithBb) { - var drawLabel2 = 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 nodeWidth, nodeHeight; - var _p = node2._private; - var rs = _p.rscratch; - var pos = node2.position(); - if (!number$12(pos.x) || !number$12(pos.y)) { - return; + } + }); + + // ../../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; } - if (shouldDrawOpacity && !node2.visible()) { - return; + } + } 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; } - var eleOpacity = shouldDrawOpacity ? node2.effectiveOpacity() : 1; - var usePaths = r.usePaths(); - var path2; - var pathCacheHit = false; - var padding2 = node2.padding(); - nodeWidth = node2.width() + 2 * padding2; - nodeHeight = node2.height() + 2 * padding2; - var bb; - if (shiftToOriginWithBb) { - bb = shiftToOriginWithBb; - context.translate(-bb.x1, -bb.y1); + } + } + 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; } - var bgImgProp = node2.pstyle("background-image"); - var urls = bgImgProp.value; - 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"; - if (defd) { - var bgImgCrossOrigin = node2.cy().style().getIndexedStyle(node2, "background-image-crossorigin", "value", i3); - numImages++; - image[i3] = r.getCachedImage(url, bgImgCrossOrigin, function() { - _p.backgroundTimestamp = Date.now(); - node2.emitAndNotify("background"); - }); - } + } + } 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; } - var darkness = node2.pstyle("background-blacken").value; - var borderWidth = node2.pstyle("border-width").pfValue; - var bgOpacity = node2.pstyle("background-opacity").value * eleOpacity; - var borderColor = node2.pstyle("border-color").value; - var borderStyle = node2.pstyle("border-style").value; - var borderOpacity = node2.pstyle("border-opacity").value * eleOpacity; - context.lineJoin = "miter"; - var setupShapeColor = function setupShapeColor2() { - var bgOpy = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : bgOpacity; - r.eleFillStyle(context, node2, bgOpy); - }; - var setupBorderColor = 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 styleShape = node2.pstyle("shape").strValue; - var shapePts = node2.pstyle("shape-polygon-points").pfValue; - if (usePaths) { - context.translate(pos.x, pos.y); - var pathCache = r.nodePathCache = r.nodePathCache || []; - var key = hashStrings(styleShape === "polygon" ? styleShape + "," + shapePts.join(",") : styleShape, "" + nodeHeight, "" + nodeWidth); - var cachedPath = pathCache[key]; - if (cachedPath != null) { - path2 = cachedPath; - pathCacheHit = true; - rs.pathCache = path2; + } + } + 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, id27) { + const node2 = nodeById.get(id27); + if (!node2) throw new Error("missing: " + id27); + 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 id27 = 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 ? (id27 = typeof _2 === "function" ? _2 : constant2(_2), sankey) : id27; + }; + 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) => [id27(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 { - path2 = new Path2D(); - pathCache[key] = rs.pathCache = path2; - } + 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(id27) { + this.id = id27; + this.href = `#${id27}`; + } + 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, id27, _version, diagObj) { + const { securityLevel, sankey: conf8 } = getConfig2(); + const defaultSankeyConfig = defaultConfig2.sankey; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id27); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const svg = securityLevel === "sandbox" ? root4.select(`[id="${id27}"]`) : select_default2(`[id="${id27}"]`); + 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: id28, value: value2 }) => { + if (!showValues) { + return id28; + } + return `${id28} +${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; } - var drawShape = function drawShape2() { - if (!pathCacheHit) { - var npos = pos; - if (usePaths) { - npos = { - x: 0, - y: 0 - }; - } - r.nodeShapes[r.getNodeShape(node2)].draw(path2 || context, npos.x, npos.y, nodeWidth, nodeHeight); - } - if (usePaths) { - context.fill(path2); - } else { - context.fill(); + 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}.` + ); } - }; - var drawImages = 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 _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; + 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 (urlDefined[_i] && image[_i].complete && !image[_i].error) { - totalCompleted++; - r.drawInscribedImage(context, image[_i], node2, _i, nodeOpacity); + if (!nextBlock) { + break; } + ({ start: start3, end: end2, label } = nextBlock); } - _p.backgrounding = !(totalCompleted === numImages); - if (prevBging !== _p.backgrounding) { - node2.updateStyle(false); + } + 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 } - }; - var drawPie = 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 (redrawShape) { - if (!usePaths) { - r.nodeShapes[r.getNodeShape(node2)].draw(context, pos.x, pos.y, nodeWidth, nodeHeight); - } - } + ]; + }, "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, id27, _version, diagram24) => { + const db8 = diagram24.db; + const config6 = db8.getConfig(); + const { rowHeight, paddingY, bitWidth, bitsPerRow } = config6; + const words = db8.getPacket(); + const title2 = db8.getDiagramTitle(); + const totalRowHeight = rowHeight + paddingY; + const svgHeight = totalRowHeight * (words.length + 1) - (title2 ? 0 : rowHeight); + const svgWidth = bitWidth * bitsPerRow + 2; + const svg = selectSvgElement(id27); + 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; } - }; - var darken2 = 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; - if (darkness !== 0) { - r.colorFillStyle(context, c2, c2, c2, opacity); - if (usePaths) { - context.fill(path2); - } else { - context.fill(); - } + 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); } - }; - var drawBorder = function drawBorder2() { - if (borderWidth > 0) { - context.lineWidth = borderWidth; - context.lineCap = "butt"; - if (context.setLineDash) { - switch (borderStyle) { - case "dotted": - context.setLineDash([1, 1]); - break; - case "dashed": - context.setLineDash([4, 2]); - break; - case "solid": - case "double": - context.setLineDash([]); - break; - } + } + }, "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 parser22 = { + 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 edgeData2 = 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: edgeData2, 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 id27 = yy.generateId(); + this.$ = { ...$$[$0 - 2], type: "composite", children: $$[$0 - 1] }; + break; + case 28: + yy.getLogger().debug("Rule: blockStatement : ", $$[$0 - 2], $$[$0 - 1], $$[$0]); + const id28 = yy.generateId(); + this.$ = { id: id28, 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; } - if (usePaths) { - context.stroke(path2); + }, "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 { - context.stroke(); + 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; } - if (borderStyle === "double") { - context.lineWidth = borderWidth / 3; - var gco = context.globalCompositeOperation; - context.globalCompositeOperation = "destination-out"; - if (usePaths) { - context.stroke(path2); - } else { - context.stroke(); - } - context.globalCompositeOperation = gco; + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - if (context.setLineDash) { - context.setLineDash([]); + __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; } - } - }; - var drawOverlay = function drawOverlay2() { - if (shouldDrawOverlay) { - r.drawNodeOverlay(context, node2, pos, nodeWidth, nodeHeight); - } - }; - var drawUnderlay = function drawUnderlay2() { - if (shouldDrawOverlay) { - r.drawNodeUnderlay(context, node2, pos, nodeWidth, nodeHeight); - } - }; - var drawText2 = function drawText3() { - r.drawElementText(context, node2, null, drawLabel2); - }; - var ghost = node2.pstyle("ghost").value === "yes"; - if (ghost) { - var gx = node2.pstyle("ghost-offset-x").pfValue; - var gy = node2.pstyle("ghost-offset-y").pfValue; - var ghostOpacity = node2.pstyle("ghost-opacity").value; - var effGhostOpacity = ghostOpacity * eleOpacity; - context.translate(gx, gy); - setupShapeColor(ghostOpacity * bgOpacity); - drawShape(); - drawImages(effGhostOpacity, true); - setupBorderColor(ghostOpacity * borderOpacity); - drawBorder(); - drawPie(darkness !== 0 || borderWidth !== 0); - drawImages(effGhostOpacity, false); - darken2(effGhostOpacity); - context.translate(-gx, -gy); - } - if (usePaths) { - context.translate(-pos.x, -pos.y); - } - drawUnderlay(); - if (usePaths) { - context.translate(pos.x, pos.y); - } - setupShapeColor(); - drawShape(); - drawImages(eleOpacity, true); - setupBorderColor(); - drawBorder(); - drawPie(darkness !== 0 || borderWidth !== 0); - drawImages(eleOpacity, false); - darken2(); - if (usePaths) { - context.translate(-pos.x, -pos.y); - } - drawText2(); - drawOverlay(); - if (shiftToOriginWithBb) { - context.translate(bb.x1, bb.y1); - } - }; - var drawNodeOverlayUnderlay = function drawNodeOverlayUnderlay2(overlayOrUnderlay) { - if (!["overlay", "underlay"].includes(overlayOrUnderlay)) { - throw new Error("Invalid state"); - } - return function(context, node2, pos, nodeWidth, nodeHeight) { - var r = this; - if (!node2.visible()) { - return; - } - var padding2 = 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; - if (opacity > 0) { - pos = pos || node2.position(); - if (nodeWidth == null || nodeHeight == null) { - var _padding = node2.padding(); - nodeWidth = node2.width() + 2 * _padding; - nodeHeight = node2.height() + 2 * _padding; + __name(lex2, "lex"); + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state5] && table[state5][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state5]) { + 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: " + state5 + ", 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; + } } - 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); - context.fill(); - } + return true; + }, "parse") }; - }; - CRp$5.drawNodeOverlay = drawNodeOverlayUnderlay("overlay"); - CRp$5.drawNodeUnderlay = drawNodeOverlayUnderlay("underlay"); - CRp$5.hasPie = function(node2) { - node2 = node2[0]; - return node2._private.hasPie; - }; - CRp$5.drawPie = function(context, node2, nodeOpacity, pos) { - node2 = node2[0]; - pos = pos || node2.position(); - var cyStyle = node2.cy().style(); - var pieSize = node2.pstyle("pie-size"); - var x2 = pos.x; - var y2 = pos.y; - var nodeW = node2.width(); - var nodeH = node2.height(); - var radius = Math.min(nodeW, nodeH) / 2; - var lastPercent = 0; - var usePaths = this.usePaths(); - if (usePaths) { - x2 = 0; - y2 = 0; - } - if (pieSize.units === "%") { - radius = radius * pieSize.pfValue; - } else if (pieSize.pfValue !== void 0) { - radius = pieSize.pfValue / 2; + 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 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; + }(); + parser22.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser22; + parser22.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(id27, styleAttributes = "") { + let foundClass = classes5.get(id27); + if (!foundClass) { + foundClass = { id: id27, styles: [], textStyles: [] }; + classes5.set(id27, 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); + }); } - 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; - 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) { + }, "addStyleClass"); + addStyle2Node = /* @__PURE__ */ __name(function(id27, styles3 = "") { + const foundBlock = blockDatabase.get(id27); + if (styles3 !== void 0 && styles3 !== null) { + foundBlock.styles = styles3.split(STYLECLASS_SEP2); + } + }, "addStyle2Node"); + setCssClass3 = /* @__PURE__ */ __name(function(itemIds, cssClassName) { + itemIds.split(",").forEach(function(id27) { + let foundBlock = blockDatabase.get(id27); + if (foundBlock === void 0) { + const trimmedId = id27.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; } - context.beginPath(); - context.moveTo(x2, y2); - context.arc(x2, y2, radius, 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.getPixelRatio = function() { - var context = this.data.contexts[0]; - if (this.forcedPixelRatio != null) { - return this.forcedPixelRatio; - } - var backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1; - return (window.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) { - needToCreateCache = false; - break; + if (block3.type === "applyClass") { + setCssClass3(block3.id, block3?.styleClass ?? ""); + continue; } - } - if (needToCreateCache) { - cache2 = { - context - }; - caches.push(cache2); - } - return cache2; - }; - CRp$4.createGradientStyleFor = function(context, shapeStyleName, ele, fill, opacity) { - var gradientStyle; - var usePaths = this.usePaths(); - var colors2 = ele.pstyle(shapeStyleName + "-gradient-stop-colors").value, positions = 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); - 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(), height2 = ele.paddedHeight(); - gradientStyle = context.createRadialGradient(pos.x, pos.y, 0, pos.x, pos.y, Math.max(width2, height2)); + if (block3.type === "applyStyles") { + if (block3?.stylesStr) { + addStyle2Node(block3.id, block3?.stylesStr); + } + continue; } - } else { - if (ele.isEdge()) { - var _start = ele.sourceEndpoint(), _end = ele.targetEndpoint(); - gradientStyle = context.createLinearGradient(_start.x, _start.y, _end.x, _end.y); + 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 { - var _pos = usePaths ? { - 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) { - case "to-bottom": - gradientStyle = context.createLinearGradient(_pos.x, _pos.y - halfHeight, _pos.x, _pos.y + halfHeight); - break; - case "to-top": - gradientStyle = context.createLinearGradient(_pos.x, _pos.y + halfHeight, _pos.x, _pos.y - halfHeight); - break; - case "to-left": - gradientStyle = context.createLinearGradient(_pos.x + halfWidth, _pos.y, _pos.x - halfWidth, _pos.y); - break; - case "to-right": - gradientStyle = context.createLinearGradient(_pos.x - halfWidth, _pos.y, _pos.x + halfWidth, _pos.y); - break; - case "to-bottom-right": - case "to-right-bottom": - gradientStyle = context.createLinearGradient(_pos.x - halfWidth, _pos.y - halfHeight, _pos.x + halfWidth, _pos.y + halfHeight); - break; - case "to-top-right": - case "to-right-top": - gradientStyle = context.createLinearGradient(_pos.x - halfWidth, _pos.y + halfHeight, _pos.x + halfWidth, _pos.y - halfHeight); - break; - case "to-bottom-left": - case "to-left-bottom": - gradientStyle = context.createLinearGradient(_pos.x + halfWidth, _pos.y - halfHeight, _pos.x - halfWidth, _pos.y + halfHeight); - break; - case "to-top-left": - case "to-left-top": - gradientStyle = context.createLinearGradient(_pos.x + halfWidth, _pos.y + halfHeight, _pos.x - halfWidth, _pos.y - halfHeight); - break; + if (!block3.label) { + if (block3.type === "composite") { + block3.label = ""; + } else { + block3.label = block3.id; + } } - } - } - if (!gradientStyle) - return null; - var hasPositions = positions.length === colors2.length; - var length2 = colors2.length; - for (var i3 = 0; i3 < length2; i3++) { - gradientStyle.addColorStop(hasPositions ? positions[i3] : i3 / (length2 - 1), "rgba(" + colors2[i3][0] + "," + colors2[i3][1] + "," + colors2[i3][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; - context.fillStyle = gradientStyle; - }; - CRp$4.colorFillStyle = function(context, r, g, b, a) { - context.fillStyle = "rgba(" + r + "," + g + "," + b + "," + a + ")"; - }; - CRp$4.eleFillStyle = function(context, ele, opacity) { - var backgroundFill = ele.pstyle("background-fill").value; - if (backgroundFill === "linear-gradient" || backgroundFill === "radial-gradient") { - this.gradientFillStyle(context, ele, backgroundFill, opacity); - } else { - var backgroundColor = ele.pstyle("background-color").value; - this.colorFillStyle(context, backgroundColor[0], backgroundColor[1], backgroundColor[2], opacity); - } - }; - CRp$4.gradientStrokeStyle = function(context, ele, fill, opacity) { - var gradientStyle = this.createGradientStyleFor(context, "line", ele, fill, opacity); - 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.eleStrokeStyle = function(context, ele, opacity) { - var lineFill = ele.pstyle("line-fill").value; - if (lineFill === "linear-gradient" || lineFill === "radial-gradient") { - this.gradientStrokeStyle(context, ele, lineFill, opacity); - } else { - var lineColor = ele.pstyle("line-color").value; - 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 height2 = 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]) { - pixelRatio = mbPxRatio; - } - var canvasWidth = width2 * pixelRatio; - var canvasHeight = height2 * pixelRatio; - var canvas; - if (canvasWidth === r.canvasWidth && canvasHeight === r.canvasHeight) { - return; - } - r.fontCaches = null; - var canvasContainer = data2.canvasContainer; - canvasContainer.style.width = width2 + "px"; - canvasContainer.style.height = height2 + "px"; - for (var i3 = 0; i3 < r.CANVAS_LAYERS; i3++) { - canvas = data2.canvases[i3]; - canvas.width = canvasWidth; - canvas.height = canvasHeight; - canvas.style.width = width2 + "px"; - canvas.style.height = height2 + "px"; + 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; } - for (var i3 = 0; i3 < r.BUFFER_COUNT; i3++) { - canvas = data2.bufferCanvases[i3]; - canvas.width = canvasWidth; - canvas.height = canvasHeight; - canvas.style.width = width2 + "px"; - canvas.style.height = height2 + "px"; + if (block3.columns) { + return block3.columns; } - r.textureMult = 1; - if (pixelRatio <= 1) { - canvas = data2.bufferCanvases[r.TEXTURE_BUFFER]; - r.textureMult = 2; - canvas.width = canvasWidth * r.textureMult; - canvas.height = canvasHeight * r.textureMult; + if (!block3.children) { + return -1; } - r.canvasWidth = canvasWidth; - r.canvasHeight = canvasHeight; - }; - CRp$4.renderTo = function(cxt, zoom, pan, pxRatio) { - this.render({ - forcedContext: cxt, - forcedZoom: zoom, - forcedPan: pan, - drawAllLayers: true, - forcedPxRatio: pxRatio - }); + 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((id27) => { + return blockDatabase.get(id27); + }, "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, db8, 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 }; - 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; - var motionBlurFadeEffect = motionBlur; - if (!forcedContext) { - if (r.prevPxRatio !== pixelRatio) { - r.invalidateContainerClientCoordsCache(); - r.matchCanvasSize(r.container); - r.redrawHint("eles", true); - r.redrawHint("drag", true); - } - r.prevPxRatio = pixelRatio; - } - if (!forcedContext && r.motionBlurTimeout) { - clearTimeout(r.motionBlurTimeout); - } - if (motionBlur) { - if (r.mbFrames == null) { - r.mbFrames = 0; - } - r.mbFrames++; - if (r.mbFrames < 3) { - motionBlurFadeEffect = false; - } - if (r.mbFrames > r.minMbLowQualFrames) { - r.motionBlurPxRatio = r.mbPxRBlurry; - } - } - if (r.clearingMotionBlur) { - r.motionBlurPxRatio = 1; - } - if (r.textureDrawLastFrame && !textureDraw) { - needDraw[r.NODE] = true; - needDraw[r.SELECT_BOX] = true; - } - var style = cy.style(); - var zoom = cy.zoom(); - var effectiveZoom = forcedZoom !== void 0 ? forcedZoom : zoom; - var pan = cy.pan(); - var effectivePan = { - x: pan.x, - y: pan.y - }; - var vp = { - zoom, - pan: { - x: pan.x, - y: pan.y - } - }; - var prevVp = r.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 (forcedPan) { - effectivePan = forcedPan; - } - effectiveZoom *= pixelRatio; - effectivePan.x *= pixelRatio; - effectivePan.y *= pixelRatio; - var eles = r.getCachedZSortedEles(); - function mbclear(context2, x2, y2, w2, h) { - var gco = context2.globalCompositeOperation; - context2.globalCompositeOperation = "destination-out"; - r.colorFillStyle(context2, 255, 255, 255, r.motionBlurTransparency); - context2.fillRect(x2, y2, w2, h); - context2.globalCompositeOperation = gco; + } + let maxWidth = 0; + let maxHeight = 0; + if (block3.children?.length > 0) { + for (const child of block3.children) { + setBlockSizes(child, db8); + } + 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}` + ); } - 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])) { - ePan = { - x: pan.x * mbPxRatio, - y: pan.y * mbPxRatio - }; - eZoom = zoom * mbPxRatio; - w2 = r.canvasWidth * mbPxRatio; - h = r.canvasHeight * mbPxRatio; - } else { - ePan = effectivePan; - eZoom = effectiveZoom; - w2 = r.canvasWidth; - h = r.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 (!drawAllLayers) { - context2.translate(ePan.x, ePan.y); - context2.scale(eZoom, eZoom); - } - if (forcedPan) { - context2.translate(forcedPan.x, forcedPan.y); - } - if (forcedZoom) { - context2.scale(forcedZoom, forcedZoom); + } + for (const child of block3.children) { + setBlockSizes(child, db8, 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; + } } } - if (!textureDraw) { - r.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]; - cxt.setTransform(1, 0, 0, 1, 0, 0); - cxt.clearRect(0, 0, r.canvasWidth * r.textureMult, r.canvasHeight * r.textureMult); - r.render({ - forcedContext: cxt, - drawOnlyNodeLayer: true, - forcedPxRatio: pixelRatio * r.textureMult - }); - var vp = r.textureCache.viewport = { - zoom: cy.zoom(), - pan: cy.pan(), - width: r.canvasWidth, - height: r.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; - 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); - context.fillRect(0, 0, vp.width, vp.height); - var zoom = 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; + } + 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, db8) { + 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; } - 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 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); - if (hideEdges) { - r.drawCachedNodes(context, eles.nondrag, pixelRatio, extent); - } else { - r.drawLayeredElements(context, eles.nondrag, pixelRatio, extent); - } - if (r.debug) { - r.drawDebugPoints(context, eles.nondrag); - } - if (!drawAllLayers && !motionBlur) { - needDraw[r.NODE] = false; - } + 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); } - 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]); - setContextTransform(context, motionBlur && !useBuffer ? "motionBlur" : void 0); - if (hideEdges) { - r.drawCachedNodes(context, eles.drag, pixelRatio, extent); - } else { - r.drawCachedElements(context, eles.drag, pixelRatio, extent); - } - if (r.debug) { - r.drawDebugPoints(context, eles.drag); - } - if (!drawAllLayers && !motionBlur) { - needDraw[r.DRAG] = false; - } + 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 (r.showFps || !drawOnlyNodeLayer && needDraw[r.SELECT_BOX] && !drawAllLayers) { - var context = forcedContext || data2.contexts[r.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; - 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]); - 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]); - } - } - 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 + ")"; - context.beginPath(); - context.arc(pos.x, pos.y, style.core("active-bg-size").pfValue / zoom, 0, 2 * Math.PI); - context.fill(); - } - var timeToRender = r.lastRedrawTime; - if (r.showFps && timeToRender) { - timeToRender = Math.round(timeToRender); - var fps = Math.round(1e3 / timeToRender); - context.setTransform(1, 0, 0, 1, 0, 0); - context.fillStyle = "rgba(255, 0, 0, 0.75)"; - context.strokeStyle = "rgba(255, 0, 0, 0.75)"; - context.lineWidth = 1; - context.fillText("1 frame = " + timeToRender + " ms = " + fps + " fps", 0, 20); - var maxFps = 60; - context.strokeRect(0, 30, 250, 20); - context.fillRect(0, 30, 250 * Math.min(fps / maxFps, 1), 20); - } - if (!drawAllLayers) { - needDraw[r.SELECT_BOX] = false; - } + if (child.children) { + layoutBlocks(child, db8); } - 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) { - cxt2.setTransform(1, 0, 0, 1, 0, 0); - if (needClear || !motionBlurFadeEffect) { - cxt2.clearRect(0, 0, r.canvasWidth, r.canvasHeight); - } else { - mbclear(cxt2, 0, 0, r.canvasWidth, r.canvasHeight); - } - var pxr = mbPxRatio; - cxt2.drawImage( - txt, - // img - 0, - 0, - // sx, sy - r.canvasWidth * pxr, - r.canvasHeight * pxr, - // sw, sh - 0, - 0, - // x, y - r.canvasWidth, - r.canvasHeight - // w, h - ); - }; - if (needDraw[r.NODE] || needMbClear[r.NODE]) { - drawMotionBlur(cxtNode, txtNode, needMbClear[r.NODE]); - needDraw[r.NODE] = false; + 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(db8) { + const root4 = db8.getBlock("root"); + if (!root4) { + return; + } + setBlockSizes(root4, db8, 0, 0); + layoutBlocks(root4, db8); + 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 (needDraw[r.DRAG] || needMbClear[r.DRAG]) { - drawMotionBlur(cxtDrag, txtDrag, needMbClear[r.DRAG]); - needDraw[r.DRAG] = false; + if (width3 > maxWidth) { + maxWidth = width3 / (block3.widthInColumns ?? 1); } - } - r.prevViewport = vp; - if (r.clearingMotionBlur) { - r.clearingMotionBlur = false; - r.motionBlurCleared = true; - r.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(); - }, motionBlurDelay); - } - if (!forcedContext) { - cy.emit("render"); - } - }; - var CRp$3 = {}; - CRp$3.drawPolygonPath = function(context, x2, y2, width2, height2, points) { - var halfW = width2 / 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.closePath(); - }; - CRp$3.drawRoundPolygonPath = function(context, x2, y2, width2, height2, points) { - var halfW = width2 / 2; - var halfH = height2 / 2; - var cornerRadius = getRoundPolygonRadius(width2, height2); - if (context.beginPath) { - context.beginPath(); - } - for (var _i = 0; _i < points.length / 4; _i++) { - var sourceUv = void 0, destUv = void 0; - if (_i === 0) { - sourceUv = points.length - 2; - } else { - sourceUv = _i * 4 - 2; - } - destUv = _i * 4 + 2; - var px = x2 + halfW * points[_i * 4]; - var py = y2 + halfH * points[_i * 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 (_i === 0) { - context.moveTo(cp0x, cp0y); - } else { - context.lineTo(cp0x, cp0y); + if (height2 > maxHeight) { + maxHeight = height2; } - context.arcTo(px, py, cp1x, cp1y, cornerRadius); - } - context.closePath(); - }; - CRp$3.drawRoundRectanglePath = function(context, x2, y2, width2, height2) { - var halfWidth = width2 / 2; - var halfHeight = height2 / 2; - var cornerRadius = getRoundRectangleRadius(width2, height2); - 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.closePath(); - }; - CRp$3.drawBottomRoundRectanglePath = function(context, x2, y2, width2, height2) { - var halfWidth = width2 / 2; - var halfHeight = height2 / 2; - var cornerRadius = getRoundRectangleRadius(width2, height2); - 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.closePath(); - }; - CRp$3.drawCutRectanglePath = function(context, x2, y2, width2, height2) { - var halfWidth = width2 / 2; - var halfHeight = height2 / 2; - var cornerLength = getCutRectangleCornerLength(); - 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.closePath(); - }; - CRp$3.drawBarrelPath = function(context, x2, y2, width2, height2) { - var halfWidth = width2 / 2; - var halfHeight = height2 / 2; - var xBegin = x2 - halfWidth; - var xEnd = x2 + halfWidth; - var yBegin = y2 - halfHeight; - var yEnd = y2 + halfHeight; - var barrelCurveConstants = getBarrelCurveConstants(width2, height2); - var wOffset = barrelCurveConstants.widthOffset; - var hOffset = barrelCurveConstants.heightOffset; - var ctrlPtXOffset = barrelCurveConstants.ctrlPtOffsetPct * wOffset; - if (context.beginPath) { - context.beginPath(); } - context.moveTo(xBegin, yBegin + hOffset); - context.lineTo(xBegin, yEnd - hOffset); - context.quadraticCurveTo(xBegin + ctrlPtXOffset, yEnd, xBegin + wOffset, yEnd); - context.lineTo(xEnd - wOffset, yEnd); - context.quadraticCurveTo(xEnd - ctrlPtXOffset, yEnd, xEnd, yEnd - hOffset); - context.lineTo(xEnd, yBegin + hOffset); - context.quadraticCurveTo(xEnd - ctrlPtXOffset, yBegin, xEnd - wOffset, yBegin); - context.lineTo(xBegin + wOffset, yBegin); - 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) { - sin2[i2] = Math.sin(i2); - cos2[i2] = Math.cos(i2); + 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, db8, 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, db8) { + const node2 = getNodeFromBlock(block3, db8, false); + if (node2.type === "group") { + return; + } + const nodeEl = await insertNode(elem, node2); + const boundingBox3 = nodeEl.node().getBBox(); + const obj = db8.getBlock(node2.id); + obj.size = { width: boundingBox3.width, height: boundingBox3.height, x: 0, y: 0, node: nodeEl }; + db8.setBlock(obj); + nodeEl.remove(); + } + async function insertBlockPositioned(elem, block3, db8) { + const node2 = getNodeFromBlock(block3, db8, true); + const obj = db8.getBlock(node2.id); + if (obj.type !== "space") { + await insertNode(elem, node2); + block3.intersect = node2?.intersect; + positionNode(node2); + } + } + async function performOperations(elem, blocks2, db8, operation) { + for (const block3 of blocks2) { + await operation(elem, block3, db8); + if (block3.children) { + await performOperations(elem, block3.children, db8, operation); + } + } + } + async function calculateBlockSizes(elem, blocks2, db8) { + await performOperations(elem, blocks2, db8, calculateBlockSize); + } + async function insertBlocks(elem, blocks2, db8) { + await performOperations(elem, blocks2, db8, insertBlockPositioned); + } + async function insertEdges(elem, edges5, blocks2, db8, id27) { + 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 + }); } - CRp$3.drawEllipsePath = function(context, centerX, centerY, width2, height2) { - if (context.beginPath) { - context.beginPath(); - } - if (context.ellipse) { - context.ellipse(centerX, centerY, width2 / 2, height2 / 2, 0, 0, 2 * Math.PI); - } else { - var xPos, yPos; - var rw = width2 / 2; - var rh = height2 / 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) { - context.moveTo(xPos, yPos); - } else { - context.lineTo(xPos, yPos); - } + } + for (const edge of edges5) { + if (edge.start && edge.end) { + const startBlock = db8.getBlock(edge.start); + const endBlock = db8.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" + }, + void 0, + "block", + g2, + id27 + ); + 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 + } + ); } } - context.closePath(); + } + } + } + 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, id27, _version, diagObj) { + const { securityLevel, block: conf8 } = getConfig(); + const db8 = diagObj.db; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id27); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const svg = securityLevel === "sandbox" ? root4.select(`[id="${id27}"]`) : select_default2(`[id="${id27}"]`); + const markers3 = ["point", "circle", "cross"]; + markers_default2(svg, markers3, diagObj.type, id27); + const bl = db8.getBlocks(); + const blArr = db8.getBlocksFlat(); + const edges5 = db8.getEdges(); + const nodes6 = svg.insert("g").attr("class", "block"); + await calculateBlockSizes(nodes6, bl, db8); + const bounds4 = layout5(db8); + await insertBlocks(nodes6, bl, db8); + await insertEdges(nodes6, edges5, blArr, db8, id27); + 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 }; - var CRp$2 = {}; - CRp$2.createBuffer = function(w2, h) { - var buffer = document.createElement("canvas"); - buffer.width = w2; - buffer.height = h; - return [buffer, buffer.getContext("2d")]; + } + }); + + // 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 }; - CRp$2.bufferCanvasImage = function(options2) { - 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 height2 = options2.full ? Math.ceil(bb.h) : ctrRect[3]; - var specdMaxDims = number$12(options2.maxWidth) || number$12(options2.maxHeight); - var pxRatio = this.getPixelRatio(); - var scale = 1; - if (options2.scale !== void 0) { - width2 *= options2.scale; - height2 *= options2.scale; - scale = options2.scale; - } else if (specdMaxDims) { - var maxScaleW = Infinity; - var maxScaleH = Infinity; - if (number$12(options2.maxWidth)) { - maxScaleW = scale * options2.maxWidth / width2; + } + }); + + // src/diagrams/architecture/architectureTypes.ts + var ArchitectureDirectionName, ArchitectureDirectionArrow, ArchitectureDirectionArrowShift, getOppositeArchitectureDirection, isArchitectureDirection, isArchitectureDirectionX, isArchitectureDirectionY, isArchitectureDirectionXY, isArchitecturePairXY, isValidArchitectureDirectionPair, getArchitectureDirectionPair, shiftPositionByArchitectureDirectionPair, getArchitectureDirectionXYFactors, isArchitectureService, isArchitectureJunction, edgeData, nodeData; + var init_architectureTypes = __esm({ + "src/diagrams/architecture/architectureTypes.ts"() { + "use strict"; + ArchitectureDirectionName = { + L: "left", + R: "right", + T: "top", + B: "bottom" + }; + ArchitectureDirectionArrow = { + L: /* @__PURE__ */ __name((scale) => `${scale},${scale / 2} 0,${scale} 0,0`, "L"), + R: /* @__PURE__ */ __name((scale) => `0,${scale / 2} ${scale},0 ${scale},${scale}`, "R"), + T: /* @__PURE__ */ __name((scale) => `0,0 ${scale},0 ${scale / 2},${scale}`, "T"), + B: /* @__PURE__ */ __name((scale) => `${scale / 2},0 ${scale},${scale} 0,${scale}`, "B") + }; + ArchitectureDirectionArrowShift = { + L: /* @__PURE__ */ __name((orig, arrowSize) => orig - arrowSize + 2, "L"), + R: /* @__PURE__ */ __name((orig, _arrowSize) => orig - 2, "R"), + T: /* @__PURE__ */ __name((orig, arrowSize) => orig - arrowSize + 2, "T"), + B: /* @__PURE__ */ __name((orig, _arrowSize) => orig - 2, "B") + }; + getOppositeArchitectureDirection = /* @__PURE__ */ __name(function(x5) { + if (isArchitectureDirectionX(x5)) { + return x5 === "L" ? "R" : "L"; + } else { + return x5 === "T" ? "B" : "T"; + } + }, "getOppositeArchitectureDirection"); + isArchitectureDirection = /* @__PURE__ */ __name(function(x5) { + const temp = x5; + return temp === "L" || temp === "R" || temp === "T" || temp === "B"; + }, "isArchitectureDirection"); + isArchitectureDirectionX = /* @__PURE__ */ __name(function(x5) { + const temp = x5; + return temp === "L" || temp === "R"; + }, "isArchitectureDirectionX"); + isArchitectureDirectionY = /* @__PURE__ */ __name(function(x5) { + const temp = x5; + return temp === "T" || temp === "B"; + }, "isArchitectureDirectionY"); + isArchitectureDirectionXY = /* @__PURE__ */ __name(function(a2, b2) { + const aX_bY = isArchitectureDirectionX(a2) && isArchitectureDirectionY(b2); + const aY_bX = isArchitectureDirectionY(a2) && isArchitectureDirectionX(b2); + return aX_bY || aY_bX; + }, "isArchitectureDirectionXY"); + isArchitecturePairXY = /* @__PURE__ */ __name(function(pair) { + const lhs = pair[0]; + const rhs = pair[1]; + const aX_bY = isArchitectureDirectionX(lhs) && isArchitectureDirectionY(rhs); + const aY_bX = isArchitectureDirectionY(lhs) && isArchitectureDirectionX(rhs); + return aX_bY || aY_bX; + }, "isArchitecturePairXY"); + isValidArchitectureDirectionPair = /* @__PURE__ */ __name(function(x5) { + return x5 !== "LL" && x5 !== "RR" && x5 !== "TT" && x5 !== "BB"; + }, "isValidArchitectureDirectionPair"); + getArchitectureDirectionPair = /* @__PURE__ */ __name(function(sourceDir, targetDir) { + const pair = `${sourceDir}${targetDir}`; + return isValidArchitectureDirectionPair(pair) ? pair : void 0; + }, "getArchitectureDirectionPair"); + shiftPositionByArchitectureDirectionPair = /* @__PURE__ */ __name(function([x5, y5], pair) { + const lhs = pair[0]; + const rhs = pair[1]; + if (isArchitectureDirectionX(lhs)) { + if (isArchitectureDirectionY(rhs)) { + return [x5 + (lhs === "L" ? -1 : 1), y5 + (rhs === "T" ? 1 : -1)]; + } else { + return [x5 + (lhs === "L" ? -1 : 1), y5]; } - if (number$12(options2.maxHeight)) { - maxScaleH = scale * options2.maxHeight / height2; + } else { + if (isArchitectureDirectionX(rhs)) { + return [x5 + (rhs === "L" ? 1 : -1), y5 + (lhs === "T" ? 1 : -1)]; + } else { + return [x5, y5 + (lhs === "T" ? 1 : -1)]; } - scale = Math.min(maxScaleW, maxScaleH); - width2 *= scale; - height2 *= scale; } - if (!specdMaxDims) { - width2 *= pxRatio; - height2 *= pxRatio; - scale *= pxRatio; + }, "shiftPositionByArchitectureDirectionPair"); + getArchitectureDirectionXYFactors = /* @__PURE__ */ __name(function(pair) { + if (pair === "LT" || pair === "TL") { + return [1, 1]; + } else if (pair === "BL" || pair === "LB") { + return [1, -1]; + } else if (pair === "BR" || pair === "RB") { + return [-1, -1]; + } else { + return [-1, 1]; + } + }, "getArchitectureDirectionXYFactors"); + isArchitectureService = /* @__PURE__ */ __name(function(x5) { + const temp = x5; + return temp.type === "service"; + }, "isArchitectureService"); + isArchitectureJunction = /* @__PURE__ */ __name(function(x5) { + const temp = x5; + return temp.type === "junction"; + }, "isArchitectureJunction"); + edgeData = /* @__PURE__ */ __name((edge) => { + return edge.data(); + }, "edgeData"); + nodeData = /* @__PURE__ */ __name((node2) => { + return node2.data(); + }, "nodeData"); + } + }); + + // src/diagrams/architecture/architectureDb.ts + function getConfigField(field) { + const arch = getConfig2().architecture; + if (arch?.[field]) { + return arch[field]; + } + return DEFAULT_ARCHITECTURE_CONFIG[field]; + } + var DEFAULT_ARCHITECTURE_CONFIG, state4, clear29, addService, getServices, addJunction, getJunctions, getNodes2, getNode, addGroup, getGroups, addEdge, getEdges3, getDataStructures, setElementForId2, getElementById3, db7; + var init_architectureDb = __esm({ + "src/diagrams/architecture/architectureDb.ts"() { + "use strict"; + init_defaultConfig(); + init_diagramAPI(); + init_imperativeState(); + init_commonDb(); + init_architectureTypes(); + DEFAULT_ARCHITECTURE_CONFIG = defaultConfig_default.architecture; + state4 = new ImperativeState(() => ({ + nodes: {}, + groups: {}, + edges: [], + registeredIds: {}, + config: DEFAULT_ARCHITECTURE_CONFIG, + dataStructures: void 0, + elements: {} + })); + clear29 = /* @__PURE__ */ __name(() => { + state4.reset(); + clear(); + }, "clear"); + addService = /* @__PURE__ */ __name(function({ + id: id27, + icon, + in: parent4, + title: title2, + iconText + }) { + if (state4.records.registeredIds[id27] !== void 0) { + throw new Error( + `The service id [${id27}] is already in use by another ${state4.records.registeredIds[id27]}` + ); } - var buffCanvas = document.createElement("canvas"); - buffCanvas.width = width2; - buffCanvas.height = height2; - buffCanvas.style.width = width2 + "px"; - buffCanvas.style.height = height2 + "px"; - var buffCxt = buffCanvas.getContext("2d"); - if (width2 > 0 && height2 > 0) { - buffCxt.clearRect(0, 0, width2, height2); - buffCxt.globalCompositeOperation = "source-over"; - var zsortedEles = this.getCachedZSortedEles(); - if (options2.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 translation = { - x: pan.x * scale, - y: pan.y * scale - }; - scale *= cy.zoom(); - buffCxt.translate(translation.x, translation.y); - buffCxt.scale(scale, scale); - this.drawElements(buffCxt, zsortedEles); - buffCxt.scale(1 / scale, 1 / scale); - buffCxt.translate(-translation.x, -translation.y); + if (parent4 !== void 0) { + if (id27 === parent4) { + throw new Error(`The service [${id27}] cannot be placed within itself`); } - if (options2.bg) { - buffCxt.globalCompositeOperation = "destination-over"; - buffCxt.fillStyle = options2.bg; - buffCxt.rect(0, 0, width2, height2); - buffCxt.fill(); + if (state4.records.registeredIds[parent4] === void 0) { + throw new Error( + `The service [${id27}]'s parent does not exist. Please make sure the parent is created before this service` + ); + } + if (state4.records.registeredIds[parent4] === "node") { + throw new Error(`The service [${id27}]'s parent is not a group`); } } - 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"); - }; - CRp$2.jpg = function(options2) { - return output(options2, this.bufferCanvasImage(options2), "image/jpeg"); - }; - var CRp$1 = {}; - CRp$1.nodeShapeImpl = function(name2, context, centerX, centerY, width2, height2, points) { - switch (name2) { - case "ellipse": - return this.drawEllipsePath(context, centerX, centerY, width2, height2); - case "polygon": - return this.drawPolygonPath(context, centerX, centerY, width2, height2, points); - case "round-polygon": - return this.drawRoundPolygonPath(context, centerX, centerY, width2, height2, points); - case "roundrectangle": - case "round-rectangle": - return this.drawRoundRectanglePath(context, centerX, centerY, width2, height2); - case "cutrectangle": - case "cut-rectangle": - return this.drawCutRectanglePath(context, centerX, centerY, width2, height2); - case "bottomroundrectangle": - case "bottom-round-rectangle": - return this.drawBottomRoundRectanglePath(context, centerX, centerY, width2, height2); - case "barrel": - return this.drawBarrelPath(context, centerX, centerY, width2, height2); - } - }; - var CR = CanvasRenderer; - var CRp = CanvasRenderer.prototype; - CRp.CANVAS_LAYERS = 3; - CRp.SELECT_BOX = 0; - CRp.DRAG = 1; - CRp.NODE = 2; - CRp.BUFFER_COUNT = 3; - 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 styleMap = { - "-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()) { - styleMap["-ms-touch-action"] = "none"; - styleMap["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(styleMap).forEach(function(k) { - canvas.style[k] = styleMap[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)); + state4.records.registeredIds[id27] = "node"; + state4.records.nodes[id27] = { + id: id27, + type: "service", + icon, + iconText, + title: title2, + edges: [], + in: parent4 }; - var getTargetLabelRotationOffset = function getTargetLabelRotationOffset2(ele) { - return getCenterOffset(getTargetLabelBox(ele)); + }, "addService"); + getServices = /* @__PURE__ */ __name(() => Object.values(state4.records.nodes).filter(isArchitectureService), "getServices"); + addJunction = /* @__PURE__ */ __name(function({ id: id27, in: parent4 }) { + state4.records.registeredIds[id27] = "node"; + state4.records.nodes[id27] = { + id: id27, + type: "junction", + edges: [], + in: parent4 }; - 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; - } + }, "addJunction"); + getJunctions = /* @__PURE__ */ __name(() => Object.values(state4.records.nodes).filter(isArchitectureJunction), "getJunctions"); + getNodes2 = /* @__PURE__ */ __name(() => Object.values(state4.records.nodes), "getNodes"); + getNode = /* @__PURE__ */ __name((id27) => state4.records.nodes[id27], "getNode"); + addGroup = /* @__PURE__ */ __name(function({ id: id27, icon, in: parent4, title: title2 }) { + if (state4.records.registeredIds[id27] !== void 0) { + throw new Error( + `The group id [${id27}] is already in use by another ${state4.records.registeredIds[id27]}` + ); + } + if (parent4 !== void 0) { + if (id27 === parent4) { + throw new Error(`The group [${id27}] cannot be placed within itself`); } - 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 _i = 0; _i < eles.length; _i++) { - var _p = eles[_i]._private; - _p.oldBackgroundTimestamp = _p.backgroundTimestamp; + if (state4.records.registeredIds[parent4] === void 0) { + throw new Error( + `The group [${id27}]'s parent does not exist. Please make sure the parent is created before this group` + ); } - }); - var refineInLayers = function refineInLayers2(reqs) { - for (var i4 = 0; i4 < reqs.length; i4++) { - lyrTxrCache.enqueueElementRefinement(reqs[i4].ele); + if (state4.records.registeredIds[parent4] === "node") { + throw new Error(`The group [${id27}]'s parent is not a group`); } + } + state4.records.registeredIds[id27] = "group"; + state4.records.groups[id27] = { + id: id27, + icon, + title: title2, + in: parent4 }; - eleTxrCache.onDequeue(refineInLayers); - lblTxrCache.onDequeue(refineInLayers); - slbTxrCache.onDequeue(refineInLayers); - tlbTxrCache.onDequeue(refineInLayers); - } - CRp.redrawHint = function(group, bool2) { - var r = this; - switch (group) { - case "eles": - r.data.canvasNeedsRedraw[CRp.NODE] = bool2; - break; - case "drag": - r.data.canvasNeedsRedraw[CRp.DRAG] = bool2; - break; - case "select": - r.data.canvasNeedsRedraw[CRp.SELECT_BOX] = bool2; - break; + }, "addGroup"); + getGroups = /* @__PURE__ */ __name(() => { + return Object.values(state4.records.groups); + }, "getGroups"); + addEdge = /* @__PURE__ */ __name(function({ + lhsId, + rhsId, + lhsDir, + rhsDir, + lhsInto, + rhsInto, + lhsGroup, + rhsGroup, + title: title2 + }) { + if (!isArchitectureDirection(lhsDir)) { + throw new Error( + `Invalid direction given for left hand side of edge ${lhsId}--${rhsId}. Expected (L,R,T,B) got ${lhsDir}` + ); } - }; - var pathsImpld = typeof Path2D !== "undefined"; - CRp.path2dEnabled = function(on) { - if (on === void 0) { - return this.pathsEnabled; + if (!isArchitectureDirection(rhsDir)) { + throw new Error( + `Invalid direction given for right hand side of edge ${lhsId}--${rhsId}. Expected (L,R,T,B) got ${rhsDir}` + ); } - this.pathsEnabled = on ? true : false; - }; - CRp.usePaths = function() { - return pathsImpld && this.pathsEnabled; - }; - CRp.setImgSmoothing = function(context, bool2) { - if (context.imageSmoothingEnabled != null) { - context.imageSmoothingEnabled = bool2; - } else { - context.webkitImageSmoothingEnabled = bool2; - context.mozImageSmoothingEnabled = bool2; - context.msImageSmoothingEnabled = bool2; + if (state4.records.nodes[lhsId] === void 0 && state4.records.groups[lhsId] === void 0) { + throw new Error( + `The left-hand id [${lhsId}] does not yet exist. Please create the service/group before declaring an edge to it.` + ); } - }; - CRp.getImgSmoothing = function(context) { - if (context.imageSmoothingEnabled != null) { - return context.imageSmoothingEnabled; - } else { - return context.webkitImageSmoothingEnabled || context.mozImageSmoothingEnabled || context.msImageSmoothingEnabled; + if (state4.records.nodes[rhsId] === void 0 && state4.records.groups[lhsId] === void 0) { + throw new Error( + `The right-hand id [${rhsId}] does not yet exist. Please create the service/group before declaring an edge to it.` + ); } - }; - CRp.makeOffscreenCanvas = function(width2, height2) { - var canvas; - if ((typeof OffscreenCanvas === "undefined" ? "undefined" : _typeof(OffscreenCanvas)) !== "undefined") { - canvas = new OffscreenCanvas(width2, height2); - } else { - canvas = document.createElement("canvas"); - canvas.width = width2; - canvas.height = height2; + const lhsGroupId = state4.records.nodes[lhsId].in; + const rhsGroupId = state4.records.nodes[rhsId].in; + if (lhsGroup && lhsGroupId && rhsGroupId && lhsGroupId == rhsGroupId) { + throw new Error( + `The left-hand id [${lhsId}] is modified to traverse the group boundary, but the edge does not pass through two groups.` + ); } - 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 = [{ - name: "null", - impl: NullRenderer - }, { - name: "base", - impl: BR - }, { - name: "canvas", - impl: CR - }]; - var incExts = [{ - type: "layout", - extensions: layout2 - }, { - type: "renderer", - extensions: renderer2 - }]; - var extensions = {}; - var modules = {}; - function setExtension(type2, name2, registrant) { - var ext = registrant; - var overrideErr = function overrideErr2(field) { - warn("Can not register `" + name2 + "` for `" + type2 + "` since `" + field + "` already exists in the prototype and can not be overridden"); + if (rhsGroup && lhsGroupId && rhsGroupId && lhsGroupId == rhsGroupId) { + throw new Error( + `The right-hand id [${rhsId}] is modified to traverse the group boundary, but the edge does not pass through two groups.` + ); + } + const edge = { + lhsId, + lhsDir, + lhsInto, + lhsGroup, + rhsId, + rhsDir, + rhsInto, + rhsGroup, + title: title2 }; - if (type2 === "core") { - if (Core.prototype[name2]) { - return overrideErr(name2); - } else { - Core.prototype[name2] = registrant; - } - } else if (type2 === "collection") { - if (Collection.prototype[name2]) { - return overrideErr(name2); - } else { - Collection.prototype[name2] = 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 _i = 0; _i < anis.length; _i++) { - anis[_i].stop(); + state4.records.edges.push(edge); + if (state4.records.nodes[lhsId] && state4.records.nodes[rhsId]) { + state4.records.nodes[lhsId].edges.push(state4.records.edges[state4.records.edges.length - 1]); + state4.records.nodes[rhsId].edges.push(state4.records.edges[state4.records.edges.length - 1]); + } + }, "addEdge"); + getEdges3 = /* @__PURE__ */ __name(() => state4.records.edges, "getEdges"); + getDataStructures = /* @__PURE__ */ __name(() => { + if (state4.records.dataStructures === void 0) { + const adjList = Object.entries(state4.records.nodes).reduce((prevOuter, [id27, service]) => { + prevOuter[id27] = service.edges.reduce((prevInner, edge) => { + if (edge.lhsId === id27) { + const pair = getArchitectureDirectionPair(edge.lhsDir, edge.rhsDir); + if (pair) { + prevInner[pair] = edge.rhsId; } + } else { + const pair = getArchitectureDirectionPair(edge.rhsDir, edge.lhsDir); + if (pair) { + prevInner[pair] = edge.lhsId; + } + } + return prevInner; + }, {}); + return prevOuter; + }, {}); + const firstId = Object.keys(adjList)[0]; + const visited = { [firstId]: 1 }; + const notVisited = Object.keys(adjList).reduce( + (prev2, id27) => id27 === firstId ? prev2 : { ...prev2, [id27]: 1 }, + {} + ); + const BFS = /* @__PURE__ */ __name((startingId) => { + const spatialMap = { [startingId]: [0, 0] }; + const queue = [startingId]; + while (queue.length > 0) { + const id27 = queue.shift(); + if (id27) { + visited[id27] = 1; + delete notVisited[id27]; + const adj = adjList[id27]; + const [posX, posY] = spatialMap[id27]; + Object.entries(adj).forEach(([dir2, rhsId]) => { + if (!visited[rhsId]) { + spatialMap[rhsId] = shiftPositionByArchitectureDirectionPair( + [posX, posY], + dir2 + ); + queue.push(rhsId); + } + }); } } - if (regStop) { - regStop.call(this); - } else { - this.emit("layoutstop"); - } - return this; - }; - if (!layoutProto.destroy) { - layoutProto.destroy = function() { - return this; - }; + return spatialMap; + }, "BFS"); + const spatialMaps = [BFS(firstId)]; + while (Object.keys(notVisited).length > 0) { + spatialMaps.push(BFS(Object.keys(notVisited)[0])); } - 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" && name2 !== "null" && name2 !== "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); + state4.records.dataStructures = { + adjList, + spatialMaps }; - var proto2 = Renderer.prototype; - for (var pName in bProto) { - var pVal = bProto[pName]; - var existsInR = rProto[pName] != null; - if (existsInR) { - return overrideErr(pName); - } - proto2[pName] = pVal; - } - for (var _pName in rProto) { - proto2[_pName] = rProto[_pName]; - } - bProto.clientFunctions.forEach(function(name3) { - proto2[name3] = proto2[name3] || function() { - error("Renderer does not implement `renderer." + name3 + "()` 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, name2], - value: ext - }); - } - function getExtension(type2, name2) { - return getMap({ - map: extensions, - keys: [type2, name2] - }); - } - function setModule(type2, name2, moduleType, moduleName, registrant) { - return setMap({ - map: modules, - keys: [type2, name2, moduleType, moduleName], - value: registrant - }); - } - function getModule(type2, name2, moduleType, moduleName) { - return getMap({ - map: modules, - keys: [type2, name2, moduleType, moduleName] - }); - } - var extension2 = function extension3() { - if (arguments.length === 2) { - return getExtension.apply(null, arguments); - } else if (arguments.length === 3) { - return setExtension.apply(null, arguments); - } else if (arguments.length === 4) { - return getModule.apply(null, arguments); - } else if (arguments.length === 5) { - return setModule.apply(null, arguments); - } 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); - }); - }); - var Stylesheet = function Stylesheet2() { - if (!(this instanceof Stylesheet2)) { - return new Stylesheet2(); - } - this.length = 0; - }; - var sheetfn = Stylesheet.prototype; - sheetfn.instanceString = function() { - return "stylesheet"; - }; - sheetfn.selector = function(selector2) { - var i3 = this.length++; - this[i3] = { - selector: selector2, - properties: [] - }; - return this; - }; - sheetfn.css = function(name2, value) { - var i3 = this.length - 1; - if (string(name2)) { - this[i3].properties.push({ - name: name2, - value - }); - } else if (plainObject(name2)) { - var map2 = name2; - var propNames = Object.keys(map2); - for (var j = 0; j < propNames.length; j++) { - var key = propNames[j]; - var mapVal = map2[key]; - if (mapVal == null) { - continue; - } - var prop = Style.properties[key] || Style.properties[dash2camel(key)]; - if (prop == null) { - continue; - } - var _name = prop.name; - var _value = mapVal; - this[i3].properties.push({ - name: _name, - value: _value - }); - } - } - return this; - }; - sheetfn.style = sheetfn.css; - sheetfn.generateStyle = function(cy) { - var style = new Style(cy); - return this.appendToStyle(style); - }; - sheetfn.appendToStyle = function(style) { - for (var i3 = 0; i3 < this.length; i3++) { - var context = this[i3]; - var selector2 = 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); - } - } - return style; - }; - var version2 = "3.23.0"; - var cytoscape2 = function cytoscape3(options2) { - if (options2 === void 0) { - options2 = {}; - } - if (plainObject(options2)) { - return new Core(options2); - } else if (string(options2)) { - return extension2.apply(extension2, arguments); } - }; - cytoscape2.use = function(ext) { - var args = Array.prototype.slice.call(arguments, 1); - args.unshift(cytoscape2); - ext.apply(null, args); - return this; - }; - cytoscape2.warnings = function(bool2) { - return warnings(bool2); - }; - cytoscape2.version = version2; - cytoscape2.stylesheet = cytoscape2.Stylesheet = Stylesheet; - return cytoscape2; - }); - })(cytoscape_umd); - const cytoscape$1 = cytoscape_umdExports; - var cytoscapeCoseBilkentExports = {}; - var cytoscapeCoseBilkent = { - get exports() { - return cytoscapeCoseBilkentExports; - }, - set exports(v) { - cytoscapeCoseBilkentExports = v; + return state4.records.dataStructures; + }, "getDataStructures"); + setElementForId2 = /* @__PURE__ */ __name((id27, element3) => { + state4.records.elements[id27] = element3; + }, "setElementForId"); + getElementById3 = /* @__PURE__ */ __name((id27) => state4.records.elements[id27], "getElementById"); + db7 = { + clear: clear29, + setDiagramTitle, + getDiagramTitle, + setAccTitle, + getAccTitle, + setAccDescription, + getAccDescription, + addService, + getServices, + addJunction, + getJunctions, + getNodes: getNodes2, + getNode, + addGroup, + getGroups, + addEdge, + getEdges: getEdges3, + setElementForId: setElementForId2, + getElementById: getElementById3, + getDataStructures + }; + __name(getConfigField, "getConfigField"); } - }; - var coseBaseExports = {}; - var coseBase = { - get exports() { - return coseBaseExports; - }, - set exports(v) { - coseBaseExports = v; + }); + + // src/diagrams/architecture/architectureParser.ts + var populateDb2, parser21; + var init_architectureParser = __esm({ + "src/diagrams/architecture/architectureParser.ts"() { + "use strict"; + init_mermaid_parser_core(); + init_logger(); + init_populateCommonDb(); + init_architectureDb(); + populateDb2 = /* @__PURE__ */ __name((ast, db8) => { + populateCommonDb(ast, db8); + ast.groups.map(db8.addGroup); + ast.services.map((service) => db8.addService({ ...service, type: "service" })); + ast.junctions.map((service) => db8.addJunction({ ...service, type: "junction" })); + ast.edges.map(db8.addEdge); + }, "populateDb"); + parser21 = { + parse: /* @__PURE__ */ __name(async (input) => { + const ast = await parse2("architecture", input); + log.debug(ast); + populateDb2(ast, db7); + }, "parse") + }; } - }; - var layoutBaseExports = {}; - var layoutBase = { - get exports() { - return layoutBaseExports; - }, - set exports(v) { - layoutBaseExports = v; + }); + + // src/diagrams/architecture/architectureStyles.ts + var getStyles16, architectureStyles_default; + var init_architectureStyles = __esm({ + "src/diagrams/architecture/architectureStyles.ts"() { + "use strict"; + getStyles16 = /* @__PURE__ */ __name((options3) => ` + .edge { + stroke-width: ${options3.archEdgeWidth}; + stroke: ${options3.archEdgeColor}; + fill: none; + } + + .arrow { + fill: ${options3.archEdgeArrowColor}; + } + + .node-bkg { + fill: none; + stroke: ${options3.archGroupBorderColor}; + stroke-width: ${options3.archGroupBorderWidth}; + stroke-dasharray: 8; + } + .node-icon-text { + display: flex; + align-items: center; + } + + .node-icon-text > div { + color: #fff; + margin: 1px; + height: fit-content; + text-align: center; + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + } +`, "getStyles"); + architectureStyles_default = getStyles16; } - }; - var hasRequiredLayoutBase; - function requireLayoutBase() { - if (hasRequiredLayoutBase) - return layoutBaseExports; - hasRequiredLayoutBase = 1; - (function(module2, exports2) { - (function webpackUniversalModuleDefinition(root2, factory) { - module2.exports = factory(); - })(commonjsGlobal, function() { + }); + + // ../../node_modules/.pnpm/layout-base@2.0.1/node_modules/layout-base/layout-base.js + var require_layout_base2 = __commonJS({ + "../../node_modules/.pnpm/layout-base@2.0.1/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]) { @@ -163312,18 +130842,19 @@ 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(value) { - return value; + __webpack_require__.i = function(value2) { + return value2; }; - __webpack_require__.d = function(exports3, name2, getter) { - if (!__webpack_require__.o(exports3, name2)) { - Object.defineProperty(exports3, name2, { + __webpack_require__.d = function(exports3, name, getter) { + if (!__webpack_require__.o(exports3, name)) { + Object.defineProperty(exports3, name, { /******/ configurable: false, /******/ @@ -163337,29 +130868,31 @@ 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); + return __webpack_require__(__webpack_require__.s = 28); }([ /* 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; @@ -163382,6 +130915,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); @@ -163393,6 +130927,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]; @@ -163435,12 +130970,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(); @@ -163478,37 +131013,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) { + var PointD = __webpack_require__(5); + 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]; @@ -163525,8 +131061,8 @@ 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; @@ -163565,37 +131101,37 @@ 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; this.rect.y += dy; }; LNode.prototype.getEdgeListToNode = function(to) { - var edgeList = []; + var edgeList2 = []; + var edge; var self2 = this; - self2.edges.forEach(function(edge) { - if (edge.target == to) { - if (edge.source != self2) - throw "Incorrect edge source!"; - edgeList.push(edge); + self2.edges.forEach(function(edge2) { + if (edge2.target == to) { + if (edge2.source != self2) throw "Incorrect edge source!"; + edgeList2.push(edge2); } }); - return edgeList; + return edgeList2; }; LNode.prototype.getEdgesBetween = function(other) { - var edgeList = []; + 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) { - edgeList.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 edgeList; + return edgeList2; }; LNode.prototype.getNeighborsList = function() { var neighbors = /* @__PURE__ */ new Set(); @@ -163618,9 +131154,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); @@ -163635,9 +131171,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(); } } @@ -163686,19 +131222,29 @@ 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 width3 = childGraph.getRight() - childGraph.getLeft(); var height2 = childGraph.getBottom() - childGraph.getTop(); - if (this.labelWidth > width2) { - this.rect.x -= (this.labelWidth - width2) / 2; - this.setWidth(this.labelWidth); + if (this.labelWidth) { + if (this.labelPosHorizontal == "left") { + this.rect.x -= this.labelWidth; + this.setWidth(width3 + this.labelWidth); + } else if (this.labelPosHorizontal == "center" && this.labelWidth > width3) { + this.rect.x -= (this.labelWidth - width3) / 2; + this.setWidth(this.labelWidth); + } else if (this.labelPosHorizontal == "right") { + this.setWidth(width3 + this.labelWidth); + } } - if (this.labelHeight > height2) { - if (this.labelPos == "center") { + if (this.labelHeight) { + if (this.labelPosVertical == "top") { + this.rect.y -= this.labelHeight; + this.setHeight(height2 + this.labelHeight); + } else if (this.labelPosVertical == "center" && this.labelHeight > height2) { this.rect.y -= (this.labelHeight - height2) / 2; - } else if (this.labelPos == "top") { - this.rect.y -= this.labelHeight - height2; + this.setHeight(this.labelHeight); + } else if (this.labelPosVertical == "bottom") { + this.setHeight(height2 + this.labelHeight); } - this.setHeight(this.labelHeight); } } } @@ -163710,11 +131256,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) { @@ -163722,7 +131268,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); }; @@ -163749,26 +131295,62 @@ g.stateGroup line { /* 4 */ /***/ function(module3, exports3, __webpack_require__) { - function PointD(x2, y2) { - if (x2 == null && y2 == null) { + "use strict"; + var LayoutConstants = __webpack_require__(0); + function FDLayoutConstants() { + } + __name(FDLayoutConstants, "FDLayoutConstants"); + for (var prop in LayoutConstants) { + FDLayoutConstants[prop] = LayoutConstants[prop]; + } + FDLayoutConstants.MAX_ITERATIONS = 2500; + FDLayoutConstants.DEFAULT_EDGE_LENGTH = 50; + FDLayoutConstants.DEFAULT_SPRING_STRENGTH = 0.45; + FDLayoutConstants.DEFAULT_REPULSION_STRENGTH = 4500; + FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH = 0.4; + FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1; + FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8; + FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5; + FDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = true; + FDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = true; + FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3; + FDLayoutConstants.COOLING_ADAPTATION_FACTOR = 0.33; + FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT = 1e3; + FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT = 5e3; + FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100; + FDLayoutConstants.MAX_NODE_DISPLACEMENT = FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3; + FDLayoutConstants.MIN_REPULSION_DIST = FDLayoutConstants.DEFAULT_EDGE_LENGTH / 10; + FDLayoutConstants.CONVERGENCE_CHECK_PERIOD = 100; + FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1; + FDLayoutConstants.MIN_EDGE_LENGTH = 1; + FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD = 10; + module3.exports = FDLayoutConstants; + }, + /* 5 */ + /***/ + function(module3, exports3, __webpack_require__) { + "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); @@ -163783,32 +131365,34 @@ g.stateGroup line { }; module3.exports = PointD; }, - /* 5 */ + /* 6 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var LGraphObject = __webpack_require__(2); var Integer = __webpack_require__(10); var LayoutConstants = __webpack_require__(0); - var LGraphManager = __webpack_require__(6); + var LGraphManager = __webpack_require__(7); 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]; @@ -163888,8 +131472,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); @@ -163931,38 +131515,38 @@ g.stateGroup line { }; 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; @@ -163970,10 +131554,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(); } @@ -163981,11 +131565,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; @@ -163994,15 +131578,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; } @@ -164011,27 +131595,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; @@ -164040,7 +131624,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() { @@ -164057,17 +131641,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; }; @@ -164090,8 +131674,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)) { @@ -164118,22 +131702,24 @@ g.stateGroup line { }; module3.exports = LGraph; }, - /* 6 */ + /* 7 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var LGraph; var LEdge = __webpack_require__(1); - function LGraphManager(layout2) { - LGraph = __webpack_require__(5); - this.layout = layout2; + function LGraphManager(layout6) { + LGraph = __webpack_require__(6); + 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) { @@ -164204,16 +131790,16 @@ 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); } @@ -164261,8 +131847,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; @@ -164280,14 +131866,14 @@ g.stateGroup line { }; LGraphManager.prototype.getAllEdges = function() { if (this.allEdges == null) { - var edgeList = []; + var edgeList2 = []; var graphs = this.getGraphs(); - graphs.length; + var s2 = graphs.length; for (var i2 = 0; i2 < graphs.length; i2++) { - edgeList = edgeList.concat(graphs[i2].getEdges()); + edgeList2 = edgeList2.concat(graphs[i2].getEdges()); } - edgeList = edgeList.concat(this.edges); - this.allEdges = edgeList; + edgeList2 = edgeList2.concat(this.edges); + this.allEdges = edgeList2; } return this.allEdges; }; @@ -164359,10 +131945,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; @@ -164432,10 +132018,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); @@ -164444,55 +132030,29 @@ g.stateGroup line { }; LGraphManager.prototype.includesInvalidEdge = function() { var edge; - var s = this.edges.length; - for (var i2 = 0; i2 < s; i2++) { + var edgesToRemove = []; + 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; + edgesToRemove.push(edge); } } + for (var i2 = 0; i2 < edgesToRemove.length; i2++) { + this.remove(edgesToRemove[i2]); + } return false; }; module3.exports = LGraphManager; }, - /* 7 */ - /***/ - function(module3, exports3, __webpack_require__) { - var LayoutConstants = __webpack_require__(0); - function FDLayoutConstants() { - } - for (var prop in LayoutConstants) { - FDLayoutConstants[prop] = LayoutConstants[prop]; - } - FDLayoutConstants.MAX_ITERATIONS = 2500; - FDLayoutConstants.DEFAULT_EDGE_LENGTH = 50; - FDLayoutConstants.DEFAULT_SPRING_STRENGTH = 0.45; - FDLayoutConstants.DEFAULT_REPULSION_STRENGTH = 4500; - FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH = 0.4; - FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1; - FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8; - FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5; - FDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = true; - FDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = true; - FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3; - FDLayoutConstants.COOLING_ADAPTATION_FACTOR = 0.33; - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT = 1e3; - FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT = 5e3; - FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100; - FDLayoutConstants.MAX_NODE_DISPLACEMENT = FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3; - FDLayoutConstants.MIN_REPULSION_DIST = FDLayoutConstants.DEFAULT_EDGE_LENGTH / 10; - FDLayoutConstants.CONVERGENCE_CHECK_PERIOD = 100; - FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1; - FDLayoutConstants.MIN_EDGE_LENGTH = 1; - FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD = 10; - module3.exports = FDLayoutConstants; - }, /* 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"; @@ -164580,8 +132140,8 @@ g.stateGroup line { result[2] = p2x; result[3] = topLeftBy; return false; - } else - ; + } else { + } } else if (p1y === p2y) { if (p1x > p2x) { result[0] = topLeftAx; @@ -164595,8 +132155,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; @@ -164735,34 +132295,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; @@ -164780,24 +132340,42 @@ 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; } }; + IGeometry.findCircleLineIntersections = function(Ex, Ey, Lx, Ly, Cx, Cy, r2) { + var a2 = (Lx - Ex) * (Lx - Ex) + (Ly - Ey) * (Ly - Ey); + var b2 = 2 * ((Ex - Cx) * (Lx - Ex) + (Ey - Cy) * (Ly - Ey)); + var c3 = (Ex - Cx) * (Ex - Cx) + (Ey - Cy) * (Ey - Cy) - r2 * r2; + var disc = b2 * b2 - 4 * a2 * c3; + if (disc >= 0) { + var t13 = (-b2 + Math.sqrt(b2 * b2 - 4 * a2 * c3)) / (2 * a2); + var t22 = (-b2 - Math.sqrt(b2 * b2 - 4 * a2 * c3)) / (2 * a2); + var intersections = null; + if (t13 >= 0 && t13 <= 1) { + return [t13]; + } + if (t22 >= 0 && t22 <= 1) { + return [t22]; + } + return intersections; + } else return null; + }; IGeometry.HALF_PI = 0.5 * Math.PI; IGeometry.ONE_AND_HALF_PI = 1.5 * Math.PI; IGeometry.TWO_PI = 2 * Math.PI; @@ -164807,30 +132385,34 @@ g.stateGroup line { /* 9 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; function IMath() { } - IMath.sign = function(value) { - if (value > 0) { + __name(IMath, "IMath"); + IMath.sign = function(value2) { + if (value2 > 0) { return 1; - } else if (value < 0) { + } else if (value2 < 0) { return -1; } else { return 0; } }; - IMath.floor = function(value) { - return value < 0 ? Math.ceil(value) : Math.floor(value); + IMath.floor = function(value2) { + return value2 < 0 ? Math.ceil(value2) : Math.floor(value2); }; - IMath.ceil = function(value) { - return value < 0 ? Math.floor(value) : Math.ceil(value); + IMath.ceil = function(value2) { + return value2 < 0 ? Math.floor(value2) : Math.ceil(value2); }; module3.exports = IMath; }, /* 10 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; function Integer() { } + __name(Integer, "Integer"); Integer.MAX_VALUE = 2147483647; Integer.MIN_VALUE = -2147483648; module3.exports = Integer; @@ -164838,141 +132420,142 @@ 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(value) { - return { value, next: null, prev: null }; - }; - var add = function add2(prev2, node2, next2, list) { + __name(_classCallCheck2, "_classCallCheck"); + var nodeFrom = /* @__PURE__ */ __name(function nodeFrom2(value2) { + return { value: value2, next: null, prev: null }; + }, "nodeFrom"); + var add3 = /* @__PURE__ */ __name(function add4(prev2, node2, next3, list2) { if (prev2 !== null) { prev2.next = node2; } else { - list.head = node2; + list2.head = node2; } - if (next2 !== null) { - next2.prev = node2; + if (next3 !== null) { + next3.prev = node2; } else { - list.tail = node2; + list2.tail = node2; } node2.prev = prev2; - node2.next = next2; - list.length++; + node2.next = next3; + list2.length++; return node2; - }; - var _remove = function _remove2(node2, list) { - 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 { - list.head = next2; + list2.head = next3; } - if (next2 !== null) { - next2.prev = prev2; + if (next3 !== null) { + next3.prev = prev2; } else { - list.tail = prev2; + list2.tail = prev2; } node2.prev = node2.next = null; - list.length--; + 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 push(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(index) { + value: /* @__PURE__ */ __name(function get_object_at(index) { if (index <= this.length()) { var i2 = 1; var current = this.head; @@ -164982,10 +132565,10 @@ g.stateGroup line { } return current.value; } - } + }, "get_object_at") }, { key: "set_object_at", - value: function set_object_at(index, value) { + value: /* @__PURE__ */ __name(function set_object_at(index, value2) { if (index <= this.length()) { var i2 = 1; var current = this.head; @@ -164993,9 +132576,9 @@ g.stateGroup line { current = current.next; i2++; } - current.value = value; + current.value = value2; } - } + }, "set_object_at") }]); return LinkedList2; }(); @@ -165004,95 +132587,99 @@ 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, height2) { + "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 && height2 != null) { - this.x = x2; - this.y = y2; - this.width = width2; + 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; @@ -165106,17 +132693,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; @@ -165150,13 +132737,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)) { @@ -165169,20 +132758,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(id27) { + if (id27 == null) id27 = UniqueIDGeneretor.lastID; + return "Object#" + id27; }; 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++) { @@ -165193,16 +132782,17 @@ g.stateGroup line { return Array.from(arr); } } + __name(_toConsumableArray, "_toConsumableArray"); var LayoutConstants = __webpack_require__(0); - var LGraphManager = __webpack_require__(6); + var LGraphManager = __webpack_require__(7); var LNode = __webpack_require__(3); var LEdge = __webpack_require__(1); - var LGraph = __webpack_require__(5); - var PointD = __webpack_require__(4); + var LGraph = __webpack_require__(6); + var PointD = __webpack_require__(5); var Transform2 = __webpack_require__(17); - var Emitter = __webpack_require__(27); + var Emitter3 = __webpack_require__(29); 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; @@ -165219,8 +132809,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; }; @@ -165288,13 +132879,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()); } @@ -165305,9 +132898,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) { @@ -165353,10 +132946,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); } } @@ -165369,9 +132962,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(); @@ -165399,7 +132992,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) { @@ -165411,10 +133004,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; @@ -165428,14 +133021,14 @@ g.stateGroup line { var temp = [].concat(_toConsumableArray(visited)); flatForest.push(temp); for (var i2 = 0; i2 < temp.length; i2++) { - var value = temp[i2]; - var index = unProcessedNodes.indexOf(value); + var value2 = temp[i2]; + 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; @@ -165464,19 +133057,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); @@ -165485,40 +133078,40 @@ g.stateGroup line { }; Layout2.transform = function(sliderValue, defaultValue, minDiv, maxMul) { if (minDiv != void 0 && maxMul != void 0) { - var value = defaultValue; + var value2 = defaultValue; if (sliderValue <= 50) { var minValue = defaultValue / minDiv; - value -= (defaultValue - minValue) / 50 * (50 - sliderValue); + value2 -= (defaultValue - minValue) / 50 * (50 - sliderValue); } else { var maxValue = defaultValue * maxMul; - value += (maxValue - defaultValue) / 50 * (sliderValue - 50); + value2 += (maxValue - defaultValue) / 50 * (sliderValue - 50); } - return value; + 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) { - var list = []; - list = list.concat(nodes2); + Layout2.findCenterOfTree = function(nodes6) { + var list2 = []; + list2 = list2.concat(nodes6); var removedNodes = []; var remainingDegrees = /* @__PURE__ */ new Map(); var foundCenter = false; var centerNode = null; - if (list.length == 1 || list.length == 2) { + if (list2.length == 1 || list2.length == 2) { foundCenter = true; - centerNode = list[0]; + centerNode = list2[0]; } - for (var i2 = 0; i2 < list.length; i2++) { - var node2 = list[i2]; + for (var i2 = 0; i2 < list2.length; i2++) { + var node2 = list2[i2]; var degree = node2.getNeighborsList().size; remainingDegrees.set(node2, node2.getNeighborsList().size); if (degree == 1) { @@ -165531,11 +133124,11 @@ g.stateGroup line { var tempList2 = []; tempList2 = tempList2.concat(tempList); tempList = []; - for (var i2 = 0; i2 < list.length; i2++) { - var node2 = list[i2]; - var index = list.indexOf(node2); + for (var i2 = 0; i2 < list2.length; i2++) { + var node2 = list2[i2]; + var index = list2.indexOf(node2); if (index >= 0) { - list.splice(index, 1); + list2.splice(index, 1); } var neighbours = node2.getNeighborsList(); neighbours.forEach(function(neighbour) { @@ -165550,9 +133143,9 @@ g.stateGroup line { }); } removedNodes = removedNodes.concat(tempList); - if (list.length == 1 || list.length == 2) { + if (list2.length == 1 || list2.length == 2) { foundCenter = true; - centerNode = list[0]; + centerNode = list2[0]; } } return centerNode; @@ -165565,8 +133158,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() { @@ -165578,8 +133173,9 @@ g.stateGroup line { /* 17 */ /***/ function(module3, exports3, __webpack_require__) { - var PointD = __webpack_require__(4); - function Transform2(x2, y2) { + "use strict"; + var PointD = __webpack_require__(5); + function Transform2(x5, y5) { this.lworldOrgX = 0; this.lworldOrgY = 0; this.ldeviceOrgX = 0; @@ -165589,6 +133185,7 @@ g.stateGroup line { this.ldeviceExtX = 1; this.ldeviceExtY = 1; } + __name(Transform2, "Transform"); Transform2.prototype.getWorldOrgX = function() { return this.lworldOrgX; }; @@ -165637,35 +133234,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; }; @@ -165678,6 +133275,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++) { @@ -165688,17 +133286,15 @@ g.stateGroup line { return Array.from(arr); } } + __name(_toConsumableArray, "_toConsumableArray"); var Layout2 = __webpack_require__(15); - var FDLayoutConstants = __webpack_require__(7); + var FDLayoutConstants = __webpack_require__(4); var LayoutConstants = __webpack_require__(0); var IGeometry = __webpack_require__(8); var IMath = __webpack_require__(9); function FDLayout() { Layout2.call(this); this.useSmartIdealEdgeLengthCalculation = FDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION; - this.idealEdgeLength = FDLayoutConstants.DEFAULT_EDGE_LENGTH; - this.springConstant = FDLayoutConstants.DEFAULT_SPRING_STRENGTH; - this.repulsionConstant = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH; this.gravityConstant = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH; this.compoundGravityConstant = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH; this.gravityRangeFactor = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR; @@ -165710,6 +133306,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]; @@ -165723,6 +133320,7 @@ g.stateGroup line { }; FDLayout.prototype.calcIdealEdgeLengths = function() { var edge; + var originalIdealLength; var lcaDepth; var source; var target; @@ -165731,7 +133329,7 @@ g.stateGroup line { var allEdges = this.getGraphManager().getAllEdges(); for (var i2 = 0; i2 < allEdges.length; i2++) { edge = allEdges[i2]; - edge.idealLength = this.idealEdgeLength; + originalIdealLength = edge.idealLength; if (edge.isInterGraph) { source = edge.getSource(); target = edge.getTarget(); @@ -165741,20 +133339,20 @@ g.stateGroup line { edge.idealLength += sizeOfSourceInLca + sizeOfTargetInLca - 2 * LayoutConstants.SIMPLE_NODE_SIZE; } lcaDepth = edge.getLca().getInclusionTreeDepth(); - edge.idealLength += FDLayoutConstants.DEFAULT_EDGE_LENGTH * FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (source.getInclusionTreeDepth() + target.getInclusionTreeDepth() - 2 * lcaDepth); + edge.idealLength += originalIdealLength * FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (source.getInclusionTreeDepth() + target.getInclusionTreeDepth() - 2 * lcaDepth); } } }; 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; } @@ -165762,6 +133360,7 @@ g.stateGroup line { this.maxNodeDisplacement = FDLayoutConstants.MAX_NODE_DISPLACEMENT; } this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations); + this.displacementThresholdPerNode = 3 * FDLayoutConstants.DEFAULT_EDGE_LENGTH / 100; this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length; this.repulsionRange = this.calcRepulsionRange(); }; @@ -165776,7 +133375,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; @@ -165793,8 +133392,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; } @@ -165835,9 +133434,8 @@ g.stateGroup line { } } length2 = edge.getLength(); - if (length2 == 0) - return; - springForce = this.springConstant * (length2 - idealLength); + if (length2 == 0) return; + springForce = edge.edgeElasticity * (length2 - idealLength); springForceX = springForce * (edge.lengthX / length2); springForceY = springForce * (edge.lengthY / length2); sourceNode.springForceX += springForceX; @@ -165883,7 +133481,7 @@ g.stateGroup line { } distanceSquared = distanceX * distanceX + distanceY * distanceY; distance2 = Math.sqrt(distanceSquared); - repulsionForce = this.repulsionConstant * nodeA.noOfChildren * nodeB.noOfChildren / distanceSquared; + repulsionForce = (nodeA.nodeRepulsion / 2 + nodeB.nodeRepulsion / 2) * nodeA.noOfChildren * nodeB.noOfChildren / distanceSquared; repulsionForceX = repulsionForce * distanceX / distance2; repulsionForceY = repulsionForce * distanceY / distance2; nodeA.repulsionForceX -= repulsionForceX; @@ -165960,25 +133558,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); } } }; @@ -165999,10 +133597,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; } @@ -166031,12 +133629,15 @@ g.stateGroup line { /* 19 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var LEdge = __webpack_require__(1); - var FDLayoutConstants = __webpack_require__(7); + var FDLayoutConstants = __webpack_require__(4); function FDLayoutEdge(source, target, vEdge) { LEdge.call(this, source, target, vEdge); this.idealLength = FDLayoutConstants.DEFAULT_EDGE_LENGTH; + this.edgeElasticity = FDLayoutConstants.DEFAULT_SPRING_STRENGTH; } + __name(FDLayoutEdge, "FDLayoutEdge"); FDLayoutEdge.prototype = Object.create(LEdge.prototype); for (var prop in LEdge) { FDLayoutEdge[prop] = LEdge[prop]; @@ -166046,9 +133647,12 @@ 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); + var FDLayoutConstants = __webpack_require__(4); + function FDLayoutNode(gm, loc, size5, vNode) { + LNode.call(this, gm, loc, size5, vNode); + this.nodeRepulsion = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH; this.springForceX = 0; this.springForceY = 0; this.repulsionForceX = 0; @@ -166063,6 +133667,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]; @@ -166078,19 +133683,21 @@ g.stateGroup line { /* 21 */ /***/ function(module3, exports3, __webpack_require__) { - function DimensionD2(width2, height2) { + "use strict"; + function DimensionD2(width3, height2) { this.width = 0; this.height = 0; - if (width2 !== null && height2 !== null) { + if (width3 !== null && height2 !== null) { this.height = height2; - this.width = width2; + 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; @@ -166103,20 +133710,22 @@ g.stateGroup line { /* 22 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var UniqueIDGeneretor = __webpack_require__(14); function HashMap() { this.map = {}; this.keys = []; } - HashMap.prototype.put = function(key, value) { + __name(HashMap, "HashMap"); + HashMap.prototype.put = function(key, value2) { var theId = UniqueIDGeneretor.createID(key); if (!this.contains(theId)) { - this.map[theId] = value; + this.map[theId] = value2; this.keys.push(key); } }; HashMap.prototype.contains = function(key) { - UniqueIDGeneretor.createID(key); + var theId = UniqueIDGeneretor.createID(key); return this.map[key] != null; }; HashMap.prototype.get = function(key) { @@ -166131,14 +133740,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)]; @@ -166155,21 +133766,21 @@ g.stateGroup line { HashSet.prototype.size = function() { return Object.keys(this.set).length; }; - HashSet.prototype.addAllTo = function(list) { - var keys2 = Object.keys(this.set); - var length2 = keys2.length; + HashSet.prototype.addAllTo = function(list2) { + var keys3 = Object.keys(this.set); + var length2 = keys3.length; for (var i2 = 0; i2 < length2; i2++) { - list.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(list) { - var s = list.length; - for (var i2 = 0; i2 < s; i2++) { - var v = list[i2]; - this.add(v); + HashSet.prototype.addAll = function(list2) { + var s2 = list2.length; + for (var i2 = 0; i2 < s2; i2++) { + var v3 = list2[i2]; + this.add(v3); } }; module3.exports = HashSet; @@ -166177,139 +133788,700 @@ g.stateGroup line { /* 24 */ /***/ function(module3, exports3, __webpack_require__) { - var _createClass = function() { + "use strict"; + function Matrix() { + } + __name(Matrix, "Matrix"); + Matrix.multMat = function(array1, array22) { + var result = []; + for (var i2 = 0; i2 < array1.length; i2++) { + result[i2] = []; + for (var j2 = 0; j2 < array22[0].length; j2++) { + result[i2][j2] = 0; + for (var k2 = 0; k2 < array1[0].length; k2++) { + result[i2][j2] += array1[i2][k2] * array22[k2][j2]; + } + } + } + return result; + }; + Matrix.transpose = function(array4) { + var result = []; + for (var i2 = 0; i2 < array4[0].length; i2++) { + result[i2] = []; + for (var j2 = 0; j2 < array4.length; j2++) { + result[i2][j2] = array4[j2][i2]; + } + } + return result; + }; + Matrix.multCons = function(array4, constant3) { + var result = []; + for (var i2 = 0; i2 < array4.length; i2++) { + result[i2] = array4[i2] * constant3; + } + return result; + }; + Matrix.minusOp = function(array1, array22) { + var result = []; + for (var i2 = 0; i2 < array1.length; i2++) { + result[i2] = array1[i2] - array22[i2]; + } + return result; + }; + Matrix.dotProduct = function(array1, array22) { + var product = 0; + for (var i2 = 0; i2 < array1.length; i2++) { + product += array1[i2] * array22[i2]; + } + return product; + }; + Matrix.mag = function(array4) { + return Math.sqrt(this.dotProduct(array4, array4)); + }; + Matrix.normalize = function(array4) { + var result = []; + var magnitude = this.mag(array4); + for (var i2 = 0; i2 < array4.length; i2++) { + result[i2] = array4[i2] / magnitude; + } + return result; + }; + Matrix.multGamma = function(array4) { + var result = []; + var sum2 = 0; + for (var i2 = 0; i2 < array4.length; i2++) { + sum2 += array4[i2]; + } + sum2 *= -1 / array4.length; + for (var _i = 0; _i < array4.length; _i++) { + result[_i] = sum2 + array4[_i]; + } + return result; + }; + Matrix.multL = function(array4, C2, INV) { + var result = []; + var temp1 = []; + var temp2 = []; + for (var i2 = 0; i2 < C2[0].length; i2++) { + var sum2 = 0; + for (var j2 = 0; j2 < C2.length; j2++) { + sum2 += -0.5 * C2[j2][i2] * array4[j2]; + } + temp1[i2] = sum2; + } + for (var _i2 = 0; _i2 < INV.length; _i2++) { + var _sum = 0; + for (var _j = 0; _j < INV.length; _j++) { + _sum += INV[_i2][_j] * temp1[_j]; + } + temp2[_i2] = _sum; + } + for (var _i3 = 0; _i3 < C2.length; _i3++) { + var _sum2 = 0; + for (var _j2 = 0; _j2 < C2[0].length; _j2++) { + _sum2 += C2[_i3][_j2] * temp2[_j2]; + } + result[_i3] = _sum2; + } + return result; + }; + module3.exports = Matrix; + }, + /* 25 */ + /***/ + function(module3, exports3, __webpack_require__) { + "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, index) { - if (object2 instanceof LinkedList) - return object2.get_object_at(index); - else - return object2[index]; - } + 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, index, value) { - if (object2 instanceof LinkedList) - object2.set_object_at(index, value); - else - object2[index] = value; - } + 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; }(); module3.exports = Quicksort; }, - /* 25 */ + /* 26 */ /***/ function(module3, exports3, __webpack_require__) { - var _createClass = function() { + "use strict"; + function SVD() { + } + __name(SVD, "SVD"); + ; + SVD.svd = function(A2) { + this.U = null; + this.V = null; + this.s = null; + this.m = 0; + this.n = 0; + this.m = A2.length; + this.n = A2[0].length; + var nu = Math.min(this.m, this.n); + this.s = function(s2) { + var a2 = []; + while (s2-- > 0) { + a2.push(0); + } + return a2; + }(Math.min(this.m + 1, this.n)); + this.U = function(dims) { + var allocate = /* @__PURE__ */ __name(function allocate2(dims2) { + if (dims2.length == 0) { + return 0; + } else { + var array4 = []; + for (var i3 = 0; i3 < dims2[0]; i3++) { + array4.push(allocate2(dims2.slice(1))); + } + return array4; + } + }, "allocate"); + return allocate(dims); + }([this.m, nu]); + this.V = function(dims) { + var allocate = /* @__PURE__ */ __name(function allocate2(dims2) { + if (dims2.length == 0) { + return 0; + } else { + var array4 = []; + for (var i3 = 0; i3 < dims2[0]; i3++) { + array4.push(allocate2(dims2.slice(1))); + } + return array4; + } + }, "allocate"); + return allocate(dims); + }([this.n, this.n]); + var e3 = function(s2) { + var a2 = []; + while (s2-- > 0) { + a2.push(0); + } + return a2; + }(this.n); + var work = function(s2) { + var a2 = []; + while (s2-- > 0) { + a2.push(0); + } + return a2; + }(this.m); + var wantu = true; + var wantv = true; + var nct = Math.min(this.m - 1, this.n); + var nrt = Math.max(0, Math.min(this.n - 2, this.m)); + for (var k2 = 0; k2 < Math.max(nct, nrt); k2++) { + if (k2 < nct) { + this.s[k2] = 0; + for (var i2 = k2; i2 < this.m; i2++) { + this.s[k2] = SVD.hypot(this.s[k2], A2[i2][k2]); + } + ; + if (this.s[k2] !== 0) { + if (A2[k2][k2] < 0) { + this.s[k2] = -this.s[k2]; + } + for (var _i = k2; _i < this.m; _i++) { + A2[_i][k2] /= this.s[k2]; + } + ; + A2[k2][k2] += 1; + } + this.s[k2] = -this.s[k2]; + } + for (var j2 = k2 + 1; j2 < this.n; j2++) { + if (/* @__PURE__ */ function(lhs, rhs) { + return lhs && rhs; + }(k2 < nct, this.s[k2] !== 0)) { + var t4 = 0; + for (var _i2 = k2; _i2 < this.m; _i2++) { + t4 += A2[_i2][k2] * A2[_i2][j2]; + } + ; + t4 = -t4 / A2[k2][k2]; + for (var _i3 = k2; _i3 < this.m; _i3++) { + A2[_i3][j2] += t4 * A2[_i3][k2]; + } + ; + } + e3[j2] = A2[k2][j2]; + } + ; + if (/* @__PURE__ */ function(lhs, rhs) { + return lhs && rhs; + }(wantu, k2 < nct)) { + for (var _i4 = k2; _i4 < this.m; _i4++) { + this.U[_i4][k2] = A2[_i4][k2]; + } + ; + } + if (k2 < nrt) { + e3[k2] = 0; + for (var _i5 = k2 + 1; _i5 < this.n; _i5++) { + e3[k2] = SVD.hypot(e3[k2], e3[_i5]); + } + ; + if (e3[k2] !== 0) { + if (e3[k2 + 1] < 0) { + e3[k2] = -e3[k2]; + } + for (var _i6 = k2 + 1; _i6 < this.n; _i6++) { + e3[_i6] /= e3[k2]; + } + ; + e3[k2 + 1] += 1; + } + e3[k2] = -e3[k2]; + if (/* @__PURE__ */ function(lhs, rhs) { + return lhs && rhs; + }(k2 + 1 < this.m, e3[k2] !== 0)) { + for (var _i7 = k2 + 1; _i7 < this.m; _i7++) { + work[_i7] = 0; + } + ; + for (var _j = k2 + 1; _j < this.n; _j++) { + for (var _i8 = k2 + 1; _i8 < this.m; _i8++) { + work[_i8] += e3[_j] * A2[_i8][_j]; + } + ; + } + ; + for (var _j2 = k2 + 1; _j2 < this.n; _j2++) { + var _t = -e3[_j2] / e3[k2 + 1]; + for (var _i9 = k2 + 1; _i9 < this.m; _i9++) { + A2[_i9][_j2] += _t * work[_i9]; + } + ; + } + ; + } + if (wantv) { + for (var _i10 = k2 + 1; _i10 < this.n; _i10++) { + this.V[_i10][k2] = e3[_i10]; + } + ; + } + } + } + ; + var p3 = Math.min(this.n, this.m + 1); + if (nct < this.n) { + this.s[nct] = A2[nct][nct]; + } + if (this.m < p3) { + this.s[p3 - 1] = 0; + } + if (nrt + 1 < p3) { + e3[nrt] = A2[nrt][p3 - 1]; + } + e3[p3 - 1] = 0; + if (wantu) { + for (var _j3 = nct; _j3 < nu; _j3++) { + for (var _i11 = 0; _i11 < this.m; _i11++) { + this.U[_i11][_j3] = 0; + } + ; + this.U[_j3][_j3] = 1; + } + ; + for (var _k = nct - 1; _k >= 0; _k--) { + if (this.s[_k] !== 0) { + for (var _j4 = _k + 1; _j4 < nu; _j4++) { + var _t2 = 0; + for (var _i12 = _k; _i12 < this.m; _i12++) { + _t2 += this.U[_i12][_k] * this.U[_i12][_j4]; + } + ; + _t2 = -_t2 / this.U[_k][_k]; + for (var _i13 = _k; _i13 < this.m; _i13++) { + this.U[_i13][_j4] += _t2 * this.U[_i13][_k]; + } + ; + } + ; + for (var _i14 = _k; _i14 < this.m; _i14++) { + this.U[_i14][_k] = -this.U[_i14][_k]; + } + ; + this.U[_k][_k] = 1 + this.U[_k][_k]; + for (var _i15 = 0; _i15 < _k - 1; _i15++) { + this.U[_i15][_k] = 0; + } + ; + } else { + for (var _i16 = 0; _i16 < this.m; _i16++) { + this.U[_i16][_k] = 0; + } + ; + this.U[_k][_k] = 1; + } + } + ; + } + if (wantv) { + for (var _k2 = this.n - 1; _k2 >= 0; _k2--) { + if (/* @__PURE__ */ function(lhs, rhs) { + return lhs && rhs; + }(_k2 < nrt, e3[_k2] !== 0)) { + for (var _j5 = _k2 + 1; _j5 < nu; _j5++) { + var _t3 = 0; + for (var _i17 = _k2 + 1; _i17 < this.n; _i17++) { + _t3 += this.V[_i17][_k2] * this.V[_i17][_j5]; + } + ; + _t3 = -_t3 / this.V[_k2 + 1][_k2]; + for (var _i18 = _k2 + 1; _i18 < this.n; _i18++) { + this.V[_i18][_j5] += _t3 * this.V[_i18][_k2]; + } + ; + } + ; + } + for (var _i19 = 0; _i19 < this.n; _i19++) { + this.V[_i19][_k2] = 0; + } + ; + this.V[_k2][_k2] = 1; + } + ; + } + var pp = p3 - 1; + var iter = 0; + var eps = Math.pow(2, -52); + var tiny = Math.pow(2, -966); + while (p3 > 0) { + var _k3 = void 0; + var kase = void 0; + for (_k3 = p3 - 2; _k3 >= -1; _k3--) { + if (_k3 === -1) { + break; + } + if (Math.abs(e3[_k3]) <= tiny + eps * (Math.abs(this.s[_k3]) + Math.abs(this.s[_k3 + 1]))) { + e3[_k3] = 0; + break; + } + } + ; + if (_k3 === p3 - 2) { + kase = 4; + } else { + var ks = void 0; + for (ks = p3 - 1; ks >= _k3; ks--) { + if (ks === _k3) { + break; + } + var _t4 = (ks !== p3 ? Math.abs(e3[ks]) : 0) + (ks !== _k3 + 1 ? Math.abs(e3[ks - 1]) : 0); + if (Math.abs(this.s[ks]) <= tiny + eps * _t4) { + this.s[ks] = 0; + break; + } + } + ; + if (ks === _k3) { + kase = 3; + } else if (ks === p3 - 1) { + kase = 1; + } else { + kase = 2; + _k3 = ks; + } + } + _k3++; + switch (kase) { + case 1: + { + var f3 = e3[p3 - 2]; + e3[p3 - 2] = 0; + for (var _j6 = p3 - 2; _j6 >= _k3; _j6--) { + var _t5 = SVD.hypot(this.s[_j6], f3); + var cs = this.s[_j6] / _t5; + var sn = f3 / _t5; + this.s[_j6] = _t5; + if (_j6 !== _k3) { + f3 = -sn * e3[_j6 - 1]; + e3[_j6 - 1] = cs * e3[_j6 - 1]; + } + if (wantv) { + for (var _i20 = 0; _i20 < this.n; _i20++) { + _t5 = cs * this.V[_i20][_j6] + sn * this.V[_i20][p3 - 1]; + this.V[_i20][p3 - 1] = -sn * this.V[_i20][_j6] + cs * this.V[_i20][p3 - 1]; + this.V[_i20][_j6] = _t5; + } + ; + } + } + ; + } + ; + break; + case 2: + { + var _f = e3[_k3 - 1]; + e3[_k3 - 1] = 0; + for (var _j7 = _k3; _j7 < p3; _j7++) { + var _t6 = SVD.hypot(this.s[_j7], _f); + var _cs = this.s[_j7] / _t6; + var _sn = _f / _t6; + this.s[_j7] = _t6; + _f = -_sn * e3[_j7]; + e3[_j7] = _cs * e3[_j7]; + if (wantu) { + for (var _i21 = 0; _i21 < this.m; _i21++) { + _t6 = _cs * this.U[_i21][_j7] + _sn * this.U[_i21][_k3 - 1]; + this.U[_i21][_k3 - 1] = -_sn * this.U[_i21][_j7] + _cs * this.U[_i21][_k3 - 1]; + this.U[_i21][_j7] = _t6; + } + ; + } + } + ; + } + ; + break; + case 3: + { + var scale = Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[p3 - 1]), Math.abs(this.s[p3 - 2])), Math.abs(e3[p3 - 2])), Math.abs(this.s[_k3])), Math.abs(e3[_k3])); + var sp = this.s[p3 - 1] / scale; + var spm1 = this.s[p3 - 2] / scale; + var epm1 = e3[p3 - 2] / scale; + var sk = this.s[_k3] / scale; + var ek = e3[_k3] / scale; + var b2 = ((spm1 + sp) * (spm1 - sp) + epm1 * epm1) / 2; + var c3 = sp * epm1 * (sp * epm1); + var shift2 = 0; + if (/* @__PURE__ */ function(lhs, rhs) { + return lhs || rhs; + }(b2 !== 0, c3 !== 0)) { + shift2 = Math.sqrt(b2 * b2 + c3); + if (b2 < 0) { + shift2 = -shift2; + } + shift2 = c3 / (b2 + shift2); + } + var _f2 = (sk + sp) * (sk - sp) + shift2; + var g2 = sk * ek; + for (var _j8 = _k3; _j8 < p3 - 1; _j8++) { + var _t7 = SVD.hypot(_f2, g2); + var _cs2 = _f2 / _t7; + var _sn2 = g2 / _t7; + if (_j8 !== _k3) { + e3[_j8 - 1] = _t7; + } + _f2 = _cs2 * this.s[_j8] + _sn2 * e3[_j8]; + e3[_j8] = _cs2 * e3[_j8] - _sn2 * this.s[_j8]; + g2 = _sn2 * this.s[_j8 + 1]; + this.s[_j8 + 1] = _cs2 * this.s[_j8 + 1]; + if (wantv) { + for (var _i22 = 0; _i22 < this.n; _i22++) { + _t7 = _cs2 * this.V[_i22][_j8] + _sn2 * this.V[_i22][_j8 + 1]; + this.V[_i22][_j8 + 1] = -_sn2 * this.V[_i22][_j8] + _cs2 * this.V[_i22][_j8 + 1]; + this.V[_i22][_j8] = _t7; + } + ; + } + _t7 = SVD.hypot(_f2, g2); + _cs2 = _f2 / _t7; + _sn2 = g2 / _t7; + this.s[_j8] = _t7; + _f2 = _cs2 * e3[_j8] + _sn2 * this.s[_j8 + 1]; + this.s[_j8 + 1] = -_sn2 * e3[_j8] + _cs2 * this.s[_j8 + 1]; + g2 = _sn2 * e3[_j8 + 1]; + e3[_j8 + 1] = _cs2 * e3[_j8 + 1]; + if (wantu && _j8 < this.m - 1) { + for (var _i23 = 0; _i23 < this.m; _i23++) { + _t7 = _cs2 * this.U[_i23][_j8] + _sn2 * this.U[_i23][_j8 + 1]; + this.U[_i23][_j8 + 1] = -_sn2 * this.U[_i23][_j8] + _cs2 * this.U[_i23][_j8 + 1]; + this.U[_i23][_j8] = _t7; + } + ; + } + } + ; + e3[p3 - 2] = _f2; + iter = iter + 1; + } + ; + break; + case 4: + { + if (this.s[_k3] <= 0) { + this.s[_k3] = this.s[_k3] < 0 ? -this.s[_k3] : 0; + if (wantv) { + for (var _i24 = 0; _i24 <= pp; _i24++) { + this.V[_i24][_k3] = -this.V[_i24][_k3]; + } + ; + } + } + while (_k3 < pp) { + if (this.s[_k3] >= this.s[_k3 + 1]) { + break; + } + var _t8 = this.s[_k3]; + this.s[_k3] = this.s[_k3 + 1]; + this.s[_k3 + 1] = _t8; + if (wantv && _k3 < this.n - 1) { + for (var _i25 = 0; _i25 < this.n; _i25++) { + _t8 = this.V[_i25][_k3 + 1]; + this.V[_i25][_k3 + 1] = this.V[_i25][_k3]; + this.V[_i25][_k3] = _t8; + } + ; + } + if (wantu && _k3 < this.m - 1) { + for (var _i26 = 0; _i26 < this.m; _i26++) { + _t8 = this.U[_i26][_k3 + 1]; + this.U[_i26][_k3 + 1] = this.U[_i26][_k3]; + this.U[_i26][_k3] = _t8; + } + ; + } + _k3++; + } + ; + iter = 0; + p3--; + } + ; + break; + } + } + ; + var result = { U: this.U, V: this.V, S: this.s }; + return result; + }; + SVD.hypot = function(a2, b2) { + var r2 = void 0; + if (Math.abs(a2) > Math.abs(b2)) { + r2 = b2 / a2; + r2 = Math.abs(a2) * Math.sqrt(1 + r2 * r2); + } else if (b2 != 0) { + r2 = a2 / b2; + r2 = Math.abs(b2) * Math.sqrt(1 + r2 * r2); + } else { + r2 = 0; + } + return r2; + }; + module3.exports = SVD; + }, + /* 27 */ + /***/ + function(module3, exports3, __webpack_require__) { + "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; @@ -166320,8 +134492,8 @@ 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); @@ -166335,23 +134507,24 @@ g.stateGroup line { 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 getAlignments2() { 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; @@ -166360,24 +134533,22 @@ g.stateGroup line { for (var _i2 = 1; _i2 < this.iMax; _i2++) { for (var _j2 = 1; _j2 < this.jMax; _j2++) { var diag = void 0; - 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; + 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 left2 = this.grid[_i2][_j2 - 1] + this.gap_penalty; - var maxOf = [diag, up, left2]; + var left3 = this.grid[_i2][_j2 - 1] + this.gap_penalty; + var maxOf = [diag, up, left3]; var indices = this.arrayAllMaxIndexes(maxOf); 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], @@ -166408,1797 +134579,9018 @@ 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)); - } - }]); - return NeedlemanWunsch2; - }(); - module3.exports = NeedlemanWunsch; - }, - /* 26 */ - /***/ - function(module3, exports3, __webpack_require__) { - var layoutBase2 = function layoutBase3() { - 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; - }, - /* 27 */ - /***/ - function(module3, exports3, __webpack_require__) { - function Emitter() { - this.listeners = []; - } - var p = Emitter.prototype; - p.addListener = function(event, callback) { - this.listeners.push({ - event, - callback - }); - }; - p.removeListener = function(event, callback) { - for (var i2 = this.listeners.length; i2 >= 0; i2--) { - var l = this.listeners[i2]; - if (l.event === event && l.callback === callback) { - this.listeners.splice(i2, 1); - } - } - }; - p.emit = function(event, data) { - for (var i2 = 0; i2 < this.listeners.length; i2++) { - var l = this.listeners[i2]; - if (event === l.event) { - l.callback(data); - } - } - }; - module3.exports = Emitter; - } - /******/ - ]) - ); - }); - })(layoutBase); - return layoutBaseExports; - } - var hasRequiredCoseBase; - function requireCoseBase() { - if (hasRequiredCoseBase) - return coseBaseExports; - hasRequiredCoseBase = 1; - (function(module2, exports2) { - (function webpackUniversalModuleDefinition(root2, factory) { - module2.exports = factory(requireLayoutBase()); - })(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(value) { - return value; - }; - __webpack_require__.d = function(exports3, name2, getter) { - if (!__webpack_require__.o(exports3, name2)) { - Object.defineProperty(exports3, name2, { - /******/ - 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 = 7); - }([ - /* 0 */ - /***/ - function(module3, exports3) { - module3.exports = __WEBPACK_EXTERNAL_MODULE_0__; - }, - /* 1 */ - /***/ - function(module3, exports3, __webpack_require__) { - var FDLayoutConstants = __webpack_require__(0).FDLayoutConstants; - function CoSEConstants() { - } - for (var prop in FDLayoutConstants) { - CoSEConstants[prop] = FDLayoutConstants[prop]; - } - CoSEConstants.DEFAULT_USE_MULTI_LEVEL_SCALING = false; - CoSEConstants.DEFAULT_RADIAL_SEPARATION = FDLayoutConstants.DEFAULT_EDGE_LENGTH; - CoSEConstants.DEFAULT_COMPONENT_SEPERATION = 60; - CoSEConstants.TILE = true; - CoSEConstants.TILING_PADDING_VERTICAL = 10; - CoSEConstants.TILING_PADDING_HORIZONTAL = 10; - CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL = false; - module3.exports = CoSEConstants; - }, - /* 2 */ - /***/ - function(module3, exports3, __webpack_require__) { - var FDLayoutEdge = __webpack_require__(0).FDLayoutEdge; - function CoSEEdge(source, target, vEdge) { - FDLayoutEdge.call(this, source, target, vEdge); - } - CoSEEdge.prototype = Object.create(FDLayoutEdge.prototype); - for (var prop in FDLayoutEdge) { - CoSEEdge[prop] = FDLayoutEdge[prop]; - } - module3.exports = CoSEEdge; - }, - /* 3 */ - /***/ - function(module3, exports3, __webpack_require__) { - var LGraph = __webpack_require__(0).LGraph; - function CoSEGraph(parent, graphMgr, vGraph) { - LGraph.call(this, parent, graphMgr, vGraph); - } - CoSEGraph.prototype = Object.create(LGraph.prototype); - for (var prop in LGraph) { - CoSEGraph[prop] = LGraph[prop]; - } - module3.exports = CoSEGraph; - }, - /* 4 */ - /***/ - function(module3, exports3, __webpack_require__) { - var LGraphManager = __webpack_require__(0).LGraphManager; - function CoSEGraphManager(layout2) { - LGraphManager.call(this, layout2); - } - CoSEGraphManager.prototype = Object.create(LGraphManager.prototype); - for (var prop in LGraphManager) { - CoSEGraphManager[prop] = LGraphManager[prop]; - } - module3.exports = CoSEGraphManager; + key: "arrayAllMaxIndexes", + value: /* @__PURE__ */ __name(function arrayAllMaxIndexes(array4) { + return this.getAllIndexes(array4, Math.max.apply(null, array4)); + }, "arrayAllMaxIndexes") + }]); + return NeedlemanWunsch2; + }(); + module3.exports = NeedlemanWunsch; }, - /* 5 */ + /* 28 */ /***/ function(module3, exports3, __webpack_require__) { - 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); - } - 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); - } - if (Math.abs(this.displacementY) > layout2.coolingFactor * layout2.maxNodeDisplacement) { - this.displacementY = layout2.coolingFactor * layout2.maxNodeDisplacement * IMath.sign(this.displacementY); - } - if (this.child == null) { - this.moveBy(this.displacementX, this.displacementY); - } else if (this.child.getNodes().length == 0) { - this.moveBy(this.displacementX, this.displacementY); - } else { - this.propogateDisplacementToChildren(this.displacementX, this.displacementY); - } - layout2.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY); - this.springForceX = 0; - this.springForceY = 0; - this.repulsionForceX = 0; - this.repulsionForceY = 0; - this.gravitationForceX = 0; - this.gravitationForceY = 0; - this.displacementX = 0; - this.displacementY = 0; - }; - CoSENode.prototype.propogateDisplacementToChildren = function(dX, dY) { - var nodes2 = this.getChild().getNodes(); - var node2; - for (var i2 = 0; i2 < nodes2.length; i2++) { - node2 = nodes2[i2]; - if (node2.getChild() == null) { - node2.moveBy(dX, dY); - node2.displacementX += dX; - node2.displacementY += dY; - } else { - node2.propogateDisplacementToChildren(dX, dY); - } - } - }; - CoSENode.prototype.setPred1 = function(pred12) { - this.pred1 = pred12; - }; - CoSENode.prototype.getPred1 = function() { - return pred1; - }; - CoSENode.prototype.getPred2 = function() { - return pred2; - }; - CoSENode.prototype.setNext = function(next2) { - this.next = next2; - }; - CoSENode.prototype.getNext = function() { - return next; - }; - CoSENode.prototype.setProcessed = function(processed2) { - this.processed = processed2; - }; - CoSENode.prototype.isProcessed = function() { - return processed; - }; - module3.exports = CoSENode; + "use strict"; + var layoutBase = /* @__PURE__ */ __name(function layoutBase2() { + return; + }, "layoutBase"); + layoutBase.FDLayout = __webpack_require__(18); + layoutBase.FDLayoutConstants = __webpack_require__(4); + 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__(5); + layoutBase.RandomSeed = __webpack_require__(16); + layoutBase.RectangleD = __webpack_require__(13); + layoutBase.Transform = __webpack_require__(17); + layoutBase.UniqueIDGeneretor = __webpack_require__(14); + layoutBase.Quicksort = __webpack_require__(25); + layoutBase.LinkedList = __webpack_require__(11); + layoutBase.LGraphObject = __webpack_require__(2); + layoutBase.LGraph = __webpack_require__(6); + layoutBase.LEdge = __webpack_require__(1); + layoutBase.LGraphManager = __webpack_require__(7); + layoutBase.LNode = __webpack_require__(3); + layoutBase.Layout = __webpack_require__(15); + layoutBase.LayoutConstants = __webpack_require__(0); + layoutBase.NeedlemanWunsch = __webpack_require__(27); + layoutBase.Matrix = __webpack_require__(24); + layoutBase.SVD = __webpack_require__(26); + module3.exports = layoutBase; }, - /* 6 */ + /* 29 */ /***/ function(module3, exports3, __webpack_require__) { - var FDLayout = __webpack_require__(0).FDLayout; - var CoSEGraphManager = __webpack_require__(4); - var CoSEGraph = __webpack_require__(3); - var CoSENode = __webpack_require__(5); - var CoSEEdge = __webpack_require__(2); - var CoSEConstants = __webpack_require__(1); - var FDLayoutConstants = __webpack_require__(0).FDLayoutConstants; - var LayoutConstants = __webpack_require__(0).LayoutConstants; - var Point2 = __webpack_require__(0).Point; - var PointD = __webpack_require__(0).PointD; - var Layout2 = __webpack_require__(0).Layout; - var Integer = __webpack_require__(0).Integer; - var IGeometry = __webpack_require__(0).IGeometry; - var LGraph = __webpack_require__(0).LGraph; - var Transform2 = __webpack_require__(0).Transform; - function CoSELayout() { - FDLayout.call(this); - this.toBeTiled = {}; - } - CoSELayout.prototype = Object.create(FDLayout.prototype); - for (var prop in FDLayout) { - CoSELayout[prop] = FDLayout[prop]; + "use strict"; + function Emitter3() { + this.listeners = []; } - CoSELayout.prototype.newGraphManager = function() { - var gm = new CoSEGraphManager(this); - this.graphManager = gm; - return gm; - }; - CoSELayout.prototype.newGraph = function(vGraph) { - return new CoSEGraph(null, this.graphManager, vGraph); - }; - CoSELayout.prototype.newNode = function(vNode) { - return new CoSENode(this.graphManager, vNode); - }; - CoSELayout.prototype.newEdge = function(vEdge) { - return new CoSEEdge(null, null, vEdge); + __name(Emitter3, "Emitter"); + var p3 = Emitter3.prototype; + p3.addListener = function(event3, callback) { + this.listeners.push({ + event: event3, + callback + }); }; - CoSELayout.prototype.initParameters = function() { - FDLayout.prototype.initParameters.call(this, arguments); - if (!this.isSubLayout) { - if (CoSEConstants.DEFAULT_EDGE_LENGTH < 10) { - this.idealEdgeLength = 10; - } else { - this.idealEdgeLength = CoSEConstants.DEFAULT_EDGE_LENGTH; + p3.removeListener = function(event3, callback) { + for (var i2 = this.listeners.length; i2 >= 0; i2--) { + var l2 = this.listeners[i2]; + if (l2.event === event3 && l2.callback === callback) { + this.listeners.splice(i2, 1); } - this.useSmartIdealEdgeLengthCalculation = CoSEConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION; - this.springConstant = FDLayoutConstants.DEFAULT_SPRING_STRENGTH; - this.repulsionConstant = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH; - this.gravityConstant = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH; - this.compoundGravityConstant = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH; - this.gravityRangeFactor = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR; - this.compoundGravityRangeFactor = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR; - this.prunedNodesAll = []; - this.growTreeIterations = 0; - this.afterGrowthIterations = 0; - this.isTreeGrowing = false; - this.isGrowthFinished = false; - this.coolingCycle = 0; - this.maxCoolingCycle = this.maxIterations / FDLayoutConstants.CONVERGENCE_CHECK_PERIOD; - this.finalTemperature = FDLayoutConstants.CONVERGENCE_CHECK_PERIOD / this.maxIterations; - this.coolingAdjuster = 1; } }; - CoSELayout.prototype.layout = function() { - var createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED; - if (createBendsAsNeeded) { - this.createBendpoints(); - this.graphManager.resetAllEdges(); + p3.emit = function(event3, data5) { + for (var i2 = 0; i2 < this.listeners.length; i2++) { + var l2 = this.listeners[i2]; + if (event3 === l2.event) { + l2.callback(data5); + } } - this.level = 0; - return this.classicLayout(); }; - CoSELayout.prototype.classicLayout = function() { - this.nodesWithGravity = this.calculateNodesToApplyGravitationTo(); - this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity); - this.calcNoOfChildrenForAllNodes(); - this.graphManager.calcLowestCommonAncestors(); - this.graphManager.calcInclusionTreeDepths(); - this.graphManager.getRoot().calcEstimatedSize(); - this.calcIdealEdgeLengths(); - if (!this.incremental) { - var forest = this.getFlatForest(); - if (forest.length > 0) { - this.positionNodesRadially(forest); - } else { - this.reduceTrees(); - this.graphManager.resetAllNodesToApplyGravitation(); - var allNodes = new Set(this.getAllNodes()); - var intersection2 = this.nodesWithGravity.filter(function(x2) { - return allNodes.has(x2); + module3.exports = Emitter3; + } + /******/ + ]) + ); + }); + } + }); + + // ../../node_modules/.pnpm/cose-base@2.2.0/node_modules/cose-base/cose-base.js + var require_cose_base2 = __commonJS({ + "../../node_modules/.pnpm/cose-base@2.2.0/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_base2()); + else if (typeof define === "function" && define.amd) + define(["layout-base"], factory); + else if (typeof exports2 === "object") + exports2["coseBase"] = factory(require_layout_base2()); + else + root4["coseBase"] = factory(root4["layoutBase"]); + }, "webpackUniversalModuleDefinition"))(exports2, function(__WEBPACK_EXTERNAL_MODULE__551__) { + return ( + /******/ + (() => { + "use strict"; + var __webpack_modules__ = { + /***/ + 45: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var coseBase = {}; + coseBase.layoutBase = __webpack_require__2(551); + coseBase.CoSEConstants = __webpack_require__2(806); + coseBase.CoSEEdge = __webpack_require__2(767); + coseBase.CoSEGraph = __webpack_require__2(880); + coseBase.CoSEGraphManager = __webpack_require__2(578); + coseBase.CoSELayout = __webpack_require__2(765); + coseBase.CoSENode = __webpack_require__2(991); + coseBase.ConstraintHandler = __webpack_require__2(902); + module3.exports = coseBase; + } + ), + /***/ + 806: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var FDLayoutConstants = __webpack_require__2(551).FDLayoutConstants; + function CoSEConstants() { + } + __name(CoSEConstants, "CoSEConstants"); + for (var prop in FDLayoutConstants) { + CoSEConstants[prop] = FDLayoutConstants[prop]; + } + CoSEConstants.DEFAULT_USE_MULTI_LEVEL_SCALING = false; + CoSEConstants.DEFAULT_RADIAL_SEPARATION = FDLayoutConstants.DEFAULT_EDGE_LENGTH; + CoSEConstants.DEFAULT_COMPONENT_SEPERATION = 60; + CoSEConstants.TILE = true; + CoSEConstants.TILING_PADDING_VERTICAL = 10; + CoSEConstants.TILING_PADDING_HORIZONTAL = 10; + CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = true; + CoSEConstants.ENFORCE_CONSTRAINTS = true; + CoSEConstants.APPLY_LAYOUT = true; + CoSEConstants.RELAX_MOVEMENT_ON_CONSTRAINTS = true; + CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL = true; + CoSEConstants.PURE_INCREMENTAL = CoSEConstants.DEFAULT_INCREMENTAL; + module3.exports = CoSEConstants; + } + ), + /***/ + 767: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var FDLayoutEdge = __webpack_require__2(551).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]; + } + module3.exports = CoSEEdge; + } + ), + /***/ + 880: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var LGraph = __webpack_require__2(551).LGraph; + 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]; + } + module3.exports = CoSEGraph; + } + ), + /***/ + 578: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var LGraphManager = __webpack_require__2(551).LGraphManager; + 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]; + } + module3.exports = CoSEGraphManager; + } + ), + /***/ + 765: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var FDLayout = __webpack_require__2(551).FDLayout; + var CoSEGraphManager = __webpack_require__2(578); + var CoSEGraph = __webpack_require__2(880); + var CoSENode = __webpack_require__2(991); + var CoSEEdge = __webpack_require__2(767); + var CoSEConstants = __webpack_require__2(806); + var ConstraintHandler = __webpack_require__2(902); + var FDLayoutConstants = __webpack_require__2(551).FDLayoutConstants; + var LayoutConstants = __webpack_require__2(551).LayoutConstants; + var Point3 = __webpack_require__2(551).Point; + var PointD = __webpack_require__2(551).PointD; + var DimensionD2 = __webpack_require__2(551).DimensionD; + var Layout2 = __webpack_require__2(551).Layout; + var Integer = __webpack_require__2(551).Integer; + var IGeometry = __webpack_require__2(551).IGeometry; + var LGraph = __webpack_require__2(551).LGraph; + var Transform2 = __webpack_require__2(551).Transform; + var LinkedList = __webpack_require__2(551).LinkedList; + function CoSELayout() { + FDLayout.call(this); + this.toBeTiled = {}; + this.constraints = {}; + } + __name(CoSELayout, "CoSELayout"); + CoSELayout.prototype = Object.create(FDLayout.prototype); + for (var prop in FDLayout) { + CoSELayout[prop] = FDLayout[prop]; + } + CoSELayout.prototype.newGraphManager = function() { + var gm = new CoSEGraphManager(this); + this.graphManager = gm; + return gm; + }; + CoSELayout.prototype.newGraph = function(vGraph) { + return new CoSEGraph(null, this.graphManager, vGraph); + }; + CoSELayout.prototype.newNode = function(vNode) { + return new CoSENode(this.graphManager, vNode); + }; + CoSELayout.prototype.newEdge = function(vEdge) { + return new CoSEEdge(null, null, vEdge); + }; + CoSELayout.prototype.initParameters = function() { + FDLayout.prototype.initParameters.call(this, arguments); + if (!this.isSubLayout) { + if (CoSEConstants.DEFAULT_EDGE_LENGTH < 10) { + this.idealEdgeLength = 10; + } else { + this.idealEdgeLength = CoSEConstants.DEFAULT_EDGE_LENGTH; + } + this.useSmartIdealEdgeLengthCalculation = CoSEConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION; + this.gravityConstant = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH; + this.compoundGravityConstant = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH; + this.gravityRangeFactor = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR; + this.compoundGravityRangeFactor = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR; + this.prunedNodesAll = []; + this.growTreeIterations = 0; + this.afterGrowthIterations = 0; + this.isTreeGrowing = false; + this.isGrowthFinished = false; + } + }; + CoSELayout.prototype.initSpringEmbedder = function() { + FDLayout.prototype.initSpringEmbedder.call(this); + this.coolingCycle = 0; + this.maxCoolingCycle = this.maxIterations / FDLayoutConstants.CONVERGENCE_CHECK_PERIOD; + this.finalTemperature = 0.04; + this.coolingAdjuster = 1; + }; + CoSELayout.prototype.layout = function() { + var createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED; + if (createBendsAsNeeded) { + this.createBendpoints(); + this.graphManager.resetAllEdges(); + } + this.level = 0; + return this.classicLayout(); + }; + CoSELayout.prototype.classicLayout = function() { + this.nodesWithGravity = this.calculateNodesToApplyGravitationTo(); + this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity); + this.calcNoOfChildrenForAllNodes(); + this.graphManager.calcLowestCommonAncestors(); + this.graphManager.calcInclusionTreeDepths(); + this.graphManager.getRoot().calcEstimatedSize(); + this.calcIdealEdgeLengths(); + if (!this.incremental) { + var forest = this.getFlatForest(); + if (forest.length > 0) { + this.positionNodesRadially(forest); + } else { + this.reduceTrees(); + this.graphManager.resetAllNodesToApplyGravitation(); + var allNodes = new Set(this.getAllNodes()); + var intersection3 = this.nodesWithGravity.filter(function(x5) { + return allNodes.has(x5); + }); + this.graphManager.setAllNodesToApplyGravitation(intersection3); + this.positionNodesRandomly(); + } + } else { + if (CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL) { + this.reduceTrees(); + this.graphManager.resetAllNodesToApplyGravitation(); + var allNodes = new Set(this.getAllNodes()); + var intersection3 = this.nodesWithGravity.filter(function(x5) { + return allNodes.has(x5); + }); + this.graphManager.setAllNodesToApplyGravitation(intersection3); + } + } + if (Object.keys(this.constraints).length > 0) { + ConstraintHandler.handleConstraints(this); + this.initConstraintVariables(); + } + this.initSpringEmbedder(); + if (CoSEConstants.APPLY_LAYOUT) { + this.runSpringEmbedder(); + } + return true; + }; + CoSELayout.prototype.tick = function() { + this.totalIterations++; + if (this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) { + if (this.prunedNodesAll.length > 0) { + this.isTreeGrowing = true; + } else { + return true; + } + } + if (this.totalIterations % FDLayoutConstants.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) { + if (this.isConverged()) { + if (this.prunedNodesAll.length > 0) { + this.isTreeGrowing = true; + } else { + return true; + } + } + this.coolingCycle++; + if (this.layoutQuality == 0) { + this.coolingAdjuster = this.coolingCycle; + } else if (this.layoutQuality == 1) { + this.coolingAdjuster = this.coolingCycle / 3; + } + this.coolingFactor = Math.max(this.initialCoolingFactor - Math.pow(this.coolingCycle, Math.log(100 * (this.initialCoolingFactor - this.finalTemperature)) / Math.log(this.maxCoolingCycle)) / 100 * this.coolingAdjuster, this.finalTemperature); + this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor)); + } + if (this.isTreeGrowing) { + if (this.growTreeIterations % 10 == 0) { + if (this.prunedNodesAll.length > 0) { + this.graphManager.updateBounds(); + this.updateGrid(); + this.growTree(this.prunedNodesAll); + this.graphManager.resetAllNodesToApplyGravitation(); + var allNodes = new Set(this.getAllNodes()); + var intersection3 = this.nodesWithGravity.filter(function(x5) { + return allNodes.has(x5); + }); + this.graphManager.setAllNodesToApplyGravitation(intersection3); + this.graphManager.updateBounds(); + this.updateGrid(); + if (CoSEConstants.PURE_INCREMENTAL) this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2; + else this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL; + } else { + this.isTreeGrowing = false; + this.isGrowthFinished = true; + } + } + this.growTreeIterations++; + } + if (this.isGrowthFinished) { + if (this.isConverged()) { + return true; + } + if (this.afterGrowthIterations % 10 == 0) { + this.graphManager.updateBounds(); + this.updateGrid(); + } + if (CoSEConstants.PURE_INCREMENTAL) this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 * ((100 - this.afterGrowthIterations) / 100); + else this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100); + this.afterGrowthIterations++; + } + var gridUpdateAllowed = !this.isTreeGrowing && !this.isGrowthFinished; + var forceToNodeSurroundingUpdate = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished; + this.totalDisplacement = 0; + this.graphManager.updateBounds(); + this.calcSpringForces(); + this.calcRepulsionForces(gridUpdateAllowed, forceToNodeSurroundingUpdate); + this.calcGravitationalForces(); + this.moveNodes(); + this.animate(); + return false; + }; + CoSELayout.prototype.getPositionsData = function() { + var allNodes = this.graphManager.getAllNodes(); + var pData = {}; + for (var i2 = 0; i2 < allNodes.length; i2++) { + var rect4 = allNodes[i2].rect; + var id27 = allNodes[i2].id; + pData[id27] = { + id: id27, + x: rect4.getCenterX(), + y: rect4.getCenterY(), + w: rect4.width, + h: rect4.height + }; + } + return pData; + }; + CoSELayout.prototype.runSpringEmbedder = function() { + this.initialAnimationPeriod = 25; + this.animationPeriod = this.initialAnimationPeriod; + var layoutEnded = false; + if (FDLayoutConstants.ANIMATE === "during") { + this.emit("layoutstarted"); + } else { + while (!layoutEnded) { + layoutEnded = this.tick(); + } + this.graphManager.updateBounds(); + } + }; + CoSELayout.prototype.moveNodes = function() { + var lNodes = this.getAllNodes(); + var node2; + for (var i2 = 0; i2 < lNodes.length; i2++) { + node2 = lNodes[i2]; + node2.calculateDisplacement(); + } + if (Object.keys(this.constraints).length > 0) { + this.updateDisplacements(); + } + for (var i2 = 0; i2 < lNodes.length; i2++) { + node2 = lNodes[i2]; + node2.move(); + } + }; + CoSELayout.prototype.initConstraintVariables = function() { + var self2 = this; + this.idToNodeMap = /* @__PURE__ */ new Map(); + this.fixedNodeSet = /* @__PURE__ */ new Set(); + var allNodes = this.graphManager.getAllNodes(); + for (var i2 = 0; i2 < allNodes.length; i2++) { + var node2 = allNodes[i2]; + this.idToNodeMap.set(node2.id, node2); + } + var calculateCompoundWeight = /* @__PURE__ */ __name(function calculateCompoundWeight2(compoundNode) { + var nodes6 = compoundNode.getChild().getNodes(); + var node3; + var fixedNodeWeight2 = 0; + for (var i3 = 0; i3 < nodes6.length; i3++) { + node3 = nodes6[i3]; + if (node3.getChild() == null) { + if (self2.fixedNodeSet.has(node3.id)) { + fixedNodeWeight2 += 100; + } + } else { + fixedNodeWeight2 += calculateCompoundWeight2(node3); + } + } + return fixedNodeWeight2; + }, "calculateCompoundWeight"); + if (this.constraints.fixedNodeConstraint) { + this.constraints.fixedNodeConstraint.forEach(function(nodeData2) { + self2.fixedNodeSet.add(nodeData2.nodeId); + }); + var allNodes = this.graphManager.getAllNodes(); + var node2; + for (var i2 = 0; i2 < allNodes.length; i2++) { + node2 = allNodes[i2]; + if (node2.getChild() != null) { + var fixedNodeWeight = calculateCompoundWeight(node2); + if (fixedNodeWeight > 0) { + node2.fixedNodeWeight = fixedNodeWeight; + } + } + } + } + if (this.constraints.relativePlacementConstraint) { + var nodeToDummyForVerticalAlignment = /* @__PURE__ */ new Map(); + var nodeToDummyForHorizontalAlignment = /* @__PURE__ */ new Map(); + this.dummyToNodeForVerticalAlignment = /* @__PURE__ */ new Map(); + this.dummyToNodeForHorizontalAlignment = /* @__PURE__ */ new Map(); + this.fixedNodesOnHorizontal = /* @__PURE__ */ new Set(); + this.fixedNodesOnVertical = /* @__PURE__ */ new Set(); + this.fixedNodeSet.forEach(function(nodeId) { + self2.fixedNodesOnHorizontal.add(nodeId); + self2.fixedNodesOnVertical.add(nodeId); + }); + if (this.constraints.alignmentConstraint) { + if (this.constraints.alignmentConstraint.vertical) { + var verticalAlignment2 = this.constraints.alignmentConstraint.vertical; + for (var i2 = 0; i2 < verticalAlignment2.length; i2++) { + this.dummyToNodeForVerticalAlignment.set("dummy" + i2, []); + verticalAlignment2[i2].forEach(function(nodeId) { + nodeToDummyForVerticalAlignment.set(nodeId, "dummy" + i2); + self2.dummyToNodeForVerticalAlignment.get("dummy" + i2).push(nodeId); + if (self2.fixedNodeSet.has(nodeId)) { + self2.fixedNodesOnHorizontal.add("dummy" + i2); + } + }); + } + } + if (this.constraints.alignmentConstraint.horizontal) { + var horizontalAlignment = this.constraints.alignmentConstraint.horizontal; + for (var i2 = 0; i2 < horizontalAlignment.length; i2++) { + this.dummyToNodeForHorizontalAlignment.set("dummy" + i2, []); + horizontalAlignment[i2].forEach(function(nodeId) { + nodeToDummyForHorizontalAlignment.set(nodeId, "dummy" + i2); + self2.dummyToNodeForHorizontalAlignment.get("dummy" + i2).push(nodeId); + if (self2.fixedNodeSet.has(nodeId)) { + self2.fixedNodesOnVertical.add("dummy" + i2); + } + }); + } + } + } + if (CoSEConstants.RELAX_MOVEMENT_ON_CONSTRAINTS) { + this.shuffle = function(array4) { + var j2, x5, i3; + for (i3 = array4.length - 1; i3 >= 2 * array4.length / 3; i3--) { + j2 = Math.floor(Math.random() * (i3 + 1)); + x5 = array4[i3]; + array4[i3] = array4[j2]; + array4[j2] = x5; + } + return array4; + }; + this.nodesInRelativeHorizontal = []; + this.nodesInRelativeVertical = []; + this.nodeToRelativeConstraintMapHorizontal = /* @__PURE__ */ new Map(); + this.nodeToRelativeConstraintMapVertical = /* @__PURE__ */ new Map(); + this.nodeToTempPositionMapHorizontal = /* @__PURE__ */ new Map(); + this.nodeToTempPositionMapVertical = /* @__PURE__ */ new Map(); + this.constraints.relativePlacementConstraint.forEach(function(constraint) { + if (constraint.left) { + var nodeIdLeft = nodeToDummyForVerticalAlignment.has(constraint.left) ? nodeToDummyForVerticalAlignment.get(constraint.left) : constraint.left; + var nodeIdRight = nodeToDummyForVerticalAlignment.has(constraint.right) ? nodeToDummyForVerticalAlignment.get(constraint.right) : constraint.right; + if (!self2.nodesInRelativeHorizontal.includes(nodeIdLeft)) { + self2.nodesInRelativeHorizontal.push(nodeIdLeft); + self2.nodeToRelativeConstraintMapHorizontal.set(nodeIdLeft, []); + if (self2.dummyToNodeForVerticalAlignment.has(nodeIdLeft)) { + self2.nodeToTempPositionMapHorizontal.set(nodeIdLeft, self2.idToNodeMap.get(self2.dummyToNodeForVerticalAlignment.get(nodeIdLeft)[0]).getCenterX()); + } else { + self2.nodeToTempPositionMapHorizontal.set(nodeIdLeft, self2.idToNodeMap.get(nodeIdLeft).getCenterX()); + } + } + if (!self2.nodesInRelativeHorizontal.includes(nodeIdRight)) { + self2.nodesInRelativeHorizontal.push(nodeIdRight); + self2.nodeToRelativeConstraintMapHorizontal.set(nodeIdRight, []); + if (self2.dummyToNodeForVerticalAlignment.has(nodeIdRight)) { + self2.nodeToTempPositionMapHorizontal.set(nodeIdRight, self2.idToNodeMap.get(self2.dummyToNodeForVerticalAlignment.get(nodeIdRight)[0]).getCenterX()); + } else { + self2.nodeToTempPositionMapHorizontal.set(nodeIdRight, self2.idToNodeMap.get(nodeIdRight).getCenterX()); + } + } + self2.nodeToRelativeConstraintMapHorizontal.get(nodeIdLeft).push({ right: nodeIdRight, gap: constraint.gap }); + self2.nodeToRelativeConstraintMapHorizontal.get(nodeIdRight).push({ left: nodeIdLeft, gap: constraint.gap }); + } else { + var nodeIdTop = nodeToDummyForHorizontalAlignment.has(constraint.top) ? nodeToDummyForHorizontalAlignment.get(constraint.top) : constraint.top; + var nodeIdBottom = nodeToDummyForHorizontalAlignment.has(constraint.bottom) ? nodeToDummyForHorizontalAlignment.get(constraint.bottom) : constraint.bottom; + if (!self2.nodesInRelativeVertical.includes(nodeIdTop)) { + self2.nodesInRelativeVertical.push(nodeIdTop); + self2.nodeToRelativeConstraintMapVertical.set(nodeIdTop, []); + if (self2.dummyToNodeForHorizontalAlignment.has(nodeIdTop)) { + self2.nodeToTempPositionMapVertical.set(nodeIdTop, self2.idToNodeMap.get(self2.dummyToNodeForHorizontalAlignment.get(nodeIdTop)[0]).getCenterY()); + } else { + self2.nodeToTempPositionMapVertical.set(nodeIdTop, self2.idToNodeMap.get(nodeIdTop).getCenterY()); + } + } + if (!self2.nodesInRelativeVertical.includes(nodeIdBottom)) { + self2.nodesInRelativeVertical.push(nodeIdBottom); + self2.nodeToRelativeConstraintMapVertical.set(nodeIdBottom, []); + if (self2.dummyToNodeForHorizontalAlignment.has(nodeIdBottom)) { + self2.nodeToTempPositionMapVertical.set(nodeIdBottom, self2.idToNodeMap.get(self2.dummyToNodeForHorizontalAlignment.get(nodeIdBottom)[0]).getCenterY()); + } else { + self2.nodeToTempPositionMapVertical.set(nodeIdBottom, self2.idToNodeMap.get(nodeIdBottom).getCenterY()); + } + } + self2.nodeToRelativeConstraintMapVertical.get(nodeIdTop).push({ bottom: nodeIdBottom, gap: constraint.gap }); + self2.nodeToRelativeConstraintMapVertical.get(nodeIdBottom).push({ top: nodeIdTop, gap: constraint.gap }); + } + }); + } else { + var subGraphOnHorizontal = /* @__PURE__ */ new Map(); + var subGraphOnVertical = /* @__PURE__ */ new Map(); + this.constraints.relativePlacementConstraint.forEach(function(constraint) { + if (constraint.left) { + var left3 = nodeToDummyForVerticalAlignment.has(constraint.left) ? nodeToDummyForVerticalAlignment.get(constraint.left) : constraint.left; + var right3 = nodeToDummyForVerticalAlignment.has(constraint.right) ? nodeToDummyForVerticalAlignment.get(constraint.right) : constraint.right; + if (subGraphOnHorizontal.has(left3)) { + subGraphOnHorizontal.get(left3).push(right3); + } else { + subGraphOnHorizontal.set(left3, [right3]); + } + if (subGraphOnHorizontal.has(right3)) { + subGraphOnHorizontal.get(right3).push(left3); + } else { + subGraphOnHorizontal.set(right3, [left3]); + } + } else { + var top2 = nodeToDummyForHorizontalAlignment.has(constraint.top) ? nodeToDummyForHorizontalAlignment.get(constraint.top) : constraint.top; + var bottom2 = nodeToDummyForHorizontalAlignment.has(constraint.bottom) ? nodeToDummyForHorizontalAlignment.get(constraint.bottom) : constraint.bottom; + if (subGraphOnVertical.has(top2)) { + subGraphOnVertical.get(top2).push(bottom2); + } else { + subGraphOnVertical.set(top2, [bottom2]); + } + if (subGraphOnVertical.has(bottom2)) { + subGraphOnVertical.get(bottom2).push(top2); + } else { + subGraphOnVertical.set(bottom2, [top2]); + } + } + }); + var constructComponents = /* @__PURE__ */ __name(function constructComponents2(graph, fixedNodes) { + var components3 = []; + var isFixed = []; + var queue = new LinkedList(); + var visited = /* @__PURE__ */ new Set(); + var count = 0; + graph.forEach(function(value2, key) { + if (!visited.has(key)) { + components3[count] = []; + isFixed[count] = false; + var currentNode = key; + queue.push(currentNode); + visited.add(currentNode); + components3[count].push(currentNode); + while (queue.length != 0) { + currentNode = queue.shift(); + if (fixedNodes.has(currentNode)) { + isFixed[count] = true; + } + var neighbors = graph.get(currentNode); + neighbors.forEach(function(neighbor) { + if (!visited.has(neighbor)) { + queue.push(neighbor); + visited.add(neighbor); + components3[count].push(neighbor); + } + }); + } + count++; + } + }); + return { components: components3, isFixed }; + }, "constructComponents"); + var resultOnHorizontal = constructComponents(subGraphOnHorizontal, self2.fixedNodesOnHorizontal); + this.componentsOnHorizontal = resultOnHorizontal.components; + this.fixedComponentsOnHorizontal = resultOnHorizontal.isFixed; + var resultOnVertical = constructComponents(subGraphOnVertical, self2.fixedNodesOnVertical); + this.componentsOnVertical = resultOnVertical.components; + this.fixedComponentsOnVertical = resultOnVertical.isFixed; + } + } + }; + CoSELayout.prototype.updateDisplacements = function() { + var self2 = this; + if (this.constraints.fixedNodeConstraint) { + this.constraints.fixedNodeConstraint.forEach(function(nodeData2) { + var fixedNode = self2.idToNodeMap.get(nodeData2.nodeId); + fixedNode.displacementX = 0; + fixedNode.displacementY = 0; + }); + } + if (this.constraints.alignmentConstraint) { + if (this.constraints.alignmentConstraint.vertical) { + var allVerticalAlignments = this.constraints.alignmentConstraint.vertical; + for (var i2 = 0; i2 < allVerticalAlignments.length; i2++) { + var totalDisplacementX = 0; + for (var j2 = 0; j2 < allVerticalAlignments[i2].length; j2++) { + if (this.fixedNodeSet.has(allVerticalAlignments[i2][j2])) { + totalDisplacementX = 0; + break; + } + totalDisplacementX += this.idToNodeMap.get(allVerticalAlignments[i2][j2]).displacementX; + } + var averageDisplacementX = totalDisplacementX / allVerticalAlignments[i2].length; + for (var j2 = 0; j2 < allVerticalAlignments[i2].length; j2++) { + this.idToNodeMap.get(allVerticalAlignments[i2][j2]).displacementX = averageDisplacementX; + } + } + } + if (this.constraints.alignmentConstraint.horizontal) { + var allHorizontalAlignments = this.constraints.alignmentConstraint.horizontal; + for (var i2 = 0; i2 < allHorizontalAlignments.length; i2++) { + var totalDisplacementY = 0; + for (var j2 = 0; j2 < allHorizontalAlignments[i2].length; j2++) { + if (this.fixedNodeSet.has(allHorizontalAlignments[i2][j2])) { + totalDisplacementY = 0; + break; + } + totalDisplacementY += this.idToNodeMap.get(allHorizontalAlignments[i2][j2]).displacementY; + } + var averageDisplacementY = totalDisplacementY / allHorizontalAlignments[i2].length; + for (var j2 = 0; j2 < allHorizontalAlignments[i2].length; j2++) { + this.idToNodeMap.get(allHorizontalAlignments[i2][j2]).displacementY = averageDisplacementY; + } + } + } + } + if (this.constraints.relativePlacementConstraint) { + if (CoSEConstants.RELAX_MOVEMENT_ON_CONSTRAINTS) { + if (this.totalIterations % 10 == 0) { + this.shuffle(this.nodesInRelativeHorizontal); + this.shuffle(this.nodesInRelativeVertical); + } + this.nodesInRelativeHorizontal.forEach(function(nodeId) { + if (!self2.fixedNodesOnHorizontal.has(nodeId)) { + var displacement = 0; + if (self2.dummyToNodeForVerticalAlignment.has(nodeId)) { + displacement = self2.idToNodeMap.get(self2.dummyToNodeForVerticalAlignment.get(nodeId)[0]).displacementX; + } else { + displacement = self2.idToNodeMap.get(nodeId).displacementX; + } + self2.nodeToRelativeConstraintMapHorizontal.get(nodeId).forEach(function(constraint) { + if (constraint.right) { + var diff2 = self2.nodeToTempPositionMapHorizontal.get(constraint.right) - self2.nodeToTempPositionMapHorizontal.get(nodeId) - displacement; + if (diff2 < constraint.gap) { + displacement -= constraint.gap - diff2; + } + } else { + var diff2 = self2.nodeToTempPositionMapHorizontal.get(nodeId) - self2.nodeToTempPositionMapHorizontal.get(constraint.left) + displacement; + if (diff2 < constraint.gap) { + displacement += constraint.gap - diff2; + } + } + }); + self2.nodeToTempPositionMapHorizontal.set(nodeId, self2.nodeToTempPositionMapHorizontal.get(nodeId) + displacement); + if (self2.dummyToNodeForVerticalAlignment.has(nodeId)) { + self2.dummyToNodeForVerticalAlignment.get(nodeId).forEach(function(nodeId2) { + self2.idToNodeMap.get(nodeId2).displacementX = displacement; + }); + } else { + self2.idToNodeMap.get(nodeId).displacementX = displacement; + } + } + }); + this.nodesInRelativeVertical.forEach(function(nodeId) { + if (!self2.fixedNodesOnHorizontal.has(nodeId)) { + var displacement = 0; + if (self2.dummyToNodeForHorizontalAlignment.has(nodeId)) { + displacement = self2.idToNodeMap.get(self2.dummyToNodeForHorizontalAlignment.get(nodeId)[0]).displacementY; + } else { + displacement = self2.idToNodeMap.get(nodeId).displacementY; + } + self2.nodeToRelativeConstraintMapVertical.get(nodeId).forEach(function(constraint) { + if (constraint.bottom) { + var diff2 = self2.nodeToTempPositionMapVertical.get(constraint.bottom) - self2.nodeToTempPositionMapVertical.get(nodeId) - displacement; + if (diff2 < constraint.gap) { + displacement -= constraint.gap - diff2; + } + } else { + var diff2 = self2.nodeToTempPositionMapVertical.get(nodeId) - self2.nodeToTempPositionMapVertical.get(constraint.top) + displacement; + if (diff2 < constraint.gap) { + displacement += constraint.gap - diff2; + } + } + }); + self2.nodeToTempPositionMapVertical.set(nodeId, self2.nodeToTempPositionMapVertical.get(nodeId) + displacement); + if (self2.dummyToNodeForHorizontalAlignment.has(nodeId)) { + self2.dummyToNodeForHorizontalAlignment.get(nodeId).forEach(function(nodeId2) { + self2.idToNodeMap.get(nodeId2).displacementY = displacement; + }); + } else { + self2.idToNodeMap.get(nodeId).displacementY = displacement; + } + } + }); + } else { + for (var i2 = 0; i2 < this.componentsOnHorizontal.length; i2++) { + var component2 = this.componentsOnHorizontal[i2]; + if (this.fixedComponentsOnHorizontal[i2]) { + for (var j2 = 0; j2 < component2.length; j2++) { + if (this.dummyToNodeForVerticalAlignment.has(component2[j2])) { + this.dummyToNodeForVerticalAlignment.get(component2[j2]).forEach(function(nodeId) { + self2.idToNodeMap.get(nodeId).displacementX = 0; + }); + } else { + this.idToNodeMap.get(component2[j2]).displacementX = 0; + } + } + } else { + var sum2 = 0; + var count = 0; + for (var j2 = 0; j2 < component2.length; j2++) { + if (this.dummyToNodeForVerticalAlignment.has(component2[j2])) { + var actualNodes = this.dummyToNodeForVerticalAlignment.get(component2[j2]); + sum2 += actualNodes.length * this.idToNodeMap.get(actualNodes[0]).displacementX; + count += actualNodes.length; + } else { + sum2 += this.idToNodeMap.get(component2[j2]).displacementX; + count++; + } + } + var averageDisplacement = sum2 / count; + for (var j2 = 0; j2 < component2.length; j2++) { + if (this.dummyToNodeForVerticalAlignment.has(component2[j2])) { + this.dummyToNodeForVerticalAlignment.get(component2[j2]).forEach(function(nodeId) { + self2.idToNodeMap.get(nodeId).displacementX = averageDisplacement; + }); + } else { + this.idToNodeMap.get(component2[j2]).displacementX = averageDisplacement; + } + } + } + } + for (var i2 = 0; i2 < this.componentsOnVertical.length; i2++) { + var component2 = this.componentsOnVertical[i2]; + if (this.fixedComponentsOnVertical[i2]) { + for (var j2 = 0; j2 < component2.length; j2++) { + if (this.dummyToNodeForHorizontalAlignment.has(component2[j2])) { + this.dummyToNodeForHorizontalAlignment.get(component2[j2]).forEach(function(nodeId) { + self2.idToNodeMap.get(nodeId).displacementY = 0; + }); + } else { + this.idToNodeMap.get(component2[j2]).displacementY = 0; + } + } + } else { + var sum2 = 0; + var count = 0; + for (var j2 = 0; j2 < component2.length; j2++) { + if (this.dummyToNodeForHorizontalAlignment.has(component2[j2])) { + var actualNodes = this.dummyToNodeForHorizontalAlignment.get(component2[j2]); + sum2 += actualNodes.length * this.idToNodeMap.get(actualNodes[0]).displacementY; + count += actualNodes.length; + } else { + sum2 += this.idToNodeMap.get(component2[j2]).displacementY; + count++; + } + } + var averageDisplacement = sum2 / count; + for (var j2 = 0; j2 < component2.length; j2++) { + if (this.dummyToNodeForHorizontalAlignment.has(component2[j2])) { + this.dummyToNodeForHorizontalAlignment.get(component2[j2]).forEach(function(nodeId) { + self2.idToNodeMap.get(nodeId).displacementY = averageDisplacement; + }); + } else { + this.idToNodeMap.get(component2[j2]).displacementY = averageDisplacement; + } + } + } + } + } + } + }; + CoSELayout.prototype.calculateNodesToApplyGravitationTo = function() { + var nodeList = []; + var graph; + var graphs = this.graphManager.getGraphs(); + var size5 = graphs.length; + var i2; + for (i2 = 0; i2 < size5; i2++) { + graph = graphs[i2]; + graph.updateConnected(); + if (!graph.isConnected) { + nodeList = nodeList.concat(graph.getNodes()); + } + } + return nodeList; + }; + CoSELayout.prototype.createBendpoints = function() { + var edges5 = []; + edges5 = edges5.concat(this.graphManager.getAllEdges()); + var visited = /* @__PURE__ */ new Set(); + var i2; + for (i2 = 0; i2 < edges5.length; i2++) { + var edge = edges5[i2]; + if (!visited.has(edge)) { + var source = edge.getSource(); + var target = edge.getTarget(); + if (source == target) { + edge.getBendpoints().push(new PointD()); + edge.getBendpoints().push(new PointD()); + this.createDummyNodesForBendpoints(edge); + visited.add(edge); + } else { + var edgeList2 = []; + edgeList2 = edgeList2.concat(source.getEdgeListToNode(target)); + edgeList2 = edgeList2.concat(target.getEdgeListToNode(source)); + if (!visited.has(edgeList2[0])) { + if (edgeList2.length > 1) { + var k2; + for (k2 = 0; k2 < edgeList2.length; k2++) { + var multiEdge = edgeList2[k2]; + multiEdge.getBendpoints().push(new PointD()); + this.createDummyNodesForBendpoints(multiEdge); + } + } + edgeList2.forEach(function(edge2) { + visited.add(edge2); + }); + } + } + } + if (visited.size == edges5.length) { + break; + } + } + }; + CoSELayout.prototype.positionNodesRadially = function(forest) { + var currentStartingPoint = new Point3(0, 0); + var numberOfColumns = Math.ceil(Math.sqrt(forest.length)); + var height2 = 0; + var currentY = 0; + var currentX = 0; + var point8 = new PointD(0, 0); + for (var i2 = 0; i2 < forest.length; i2++) { + if (i2 % numberOfColumns == 0) { + currentX = 0; + currentY = height2; + if (i2 != 0) { + currentY += CoSEConstants.DEFAULT_COMPONENT_SEPERATION; + } + 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); + } + } }); - this.graphManager.setAllNodesToApplyGravitation(intersection2); - this.positionNodesRandomly(); - } - } else { - if (CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL) { - this.reduceTrees(); - this.graphManager.resetAllNodesToApplyGravitation(); - var allNodes = new Set(this.getAllNodes()); - var intersection2 = this.nodesWithGravity.filter(function(x2) { - return allNodes.has(x2); + }; + 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(id27) { + var compoundNode = self2.idToDummyNode[id27]; + tiledZeroDegreePack[id27] = self2.tileNodes(self2.memberGroups[id27], compoundNode.paddingLeft + compoundNode.paddingRight); + compoundNode.rect.width = tiledZeroDegreePack[id27].width; + compoundNode.rect.height = tiledZeroDegreePack[id27].height; + compoundNode.setCenter(tiledZeroDegreePack[id27].centerX, tiledZeroDegreePack[id27].centerY); + compoundNode.labelMarginLeft = 0; + compoundNode.labelMarginTop = 0; + if (CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS) { + var width3 = compoundNode.rect.width; + var height2 = compoundNode.rect.height; + if (compoundNode.labelWidth) { + if (compoundNode.labelPosHorizontal == "left") { + compoundNode.rect.x -= compoundNode.labelWidth; + compoundNode.setWidth(width3 + compoundNode.labelWidth); + compoundNode.labelMarginLeft = compoundNode.labelWidth; + } else if (compoundNode.labelPosHorizontal == "center" && compoundNode.labelWidth > width3) { + compoundNode.rect.x -= (compoundNode.labelWidth - width3) / 2; + compoundNode.setWidth(compoundNode.labelWidth); + compoundNode.labelMarginLeft = (compoundNode.labelWidth - width3) / 2; + } else if (compoundNode.labelPosHorizontal == "right") { + compoundNode.setWidth(width3 + compoundNode.labelWidth); + } + } + if (compoundNode.labelHeight) { + if (compoundNode.labelPosVertical == "top") { + compoundNode.rect.y -= compoundNode.labelHeight; + compoundNode.setHeight(height2 + compoundNode.labelHeight); + compoundNode.labelMarginTop = compoundNode.labelHeight; + } else if (compoundNode.labelPosVertical == "center" && compoundNode.labelHeight > height2) { + compoundNode.rect.y -= (compoundNode.labelHeight - height2) / 2; + compoundNode.setHeight(compoundNode.labelHeight); + compoundNode.labelMarginTop = (compoundNode.labelHeight - height2) / 2; + } else if (compoundNode.labelPosVertical == "bottom") { + compoundNode.setHeight(height2 + compoundNode.labelHeight); + } + } + } }); - this.graphManager.setAllNodesToApplyGravitation(intersection2); - } - } - this.initSpringEmbedder(); - this.runSpringEmbedder(); - return true; - }; - CoSELayout.prototype.tick = function() { - this.totalIterations++; - if (this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) { - if (this.prunedNodesAll.length > 0) { - this.isTreeGrowing = true; - } else { + }; + CoSELayout.prototype.repopulateCompounds = function() { + for (var i2 = this.compoundOrder.length - 1; i2 >= 0; i2--) { + var lCompoundNode = this.compoundOrder[i2]; + var id27 = lCompoundNode.id; + var horizontalMargin = lCompoundNode.paddingLeft; + var verticalMargin = lCompoundNode.paddingTop; + var labelMarginLeft = lCompoundNode.labelMarginLeft; + var labelMarginTop = lCompoundNode.labelMarginTop; + this.adjustLocations(this.tiledMemberPack[id27], lCompoundNode.rect.x, lCompoundNode.rect.y, horizontalMargin, verticalMargin, labelMarginLeft, labelMarginTop); + } + }; + CoSELayout.prototype.repopulateZeroDegreeMembers = function() { + var self2 = this; + var tiledPack = this.tiledZeroDegreePack; + Object.keys(tiledPack).forEach(function(id27) { + var compoundNode = self2.idToDummyNode[id27]; + var horizontalMargin = compoundNode.paddingLeft; + var verticalMargin = compoundNode.paddingTop; + var labelMarginLeft = compoundNode.labelMarginLeft; + var labelMarginTop = compoundNode.labelMarginTop; + self2.adjustLocations(tiledPack[id27], compoundNode.rect.x, compoundNode.rect.y, horizontalMargin, verticalMargin, labelMarginLeft, labelMarginTop); + }); + }; + CoSELayout.prototype.getToBeTiled = function(node2) { + var id27 = node2.id; + if (this.toBeTiled[id27] != null) { + return this.toBeTiled[id27]; + } + var childGraph = node2.getChild(); + if (childGraph == null) { + this.toBeTiled[id27] = 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[id27] = false; + return false; + } + if (theChild.getChild() == null) { + this.toBeTiled[theChild.id] = false; + continue; + } + if (!this.getToBeTiled(theChild)) { + this.toBeTiled[id27] = false; + return false; + } + } + this.toBeTiled[id27] = true; return true; - } - } - if (this.totalIterations % FDLayoutConstants.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) { - if (this.isConverged()) { - if (this.prunedNodesAll.length > 0) { - this.isTreeGrowing = true; + }; + CoSELayout.prototype.getNodeDegree = function(node2) { + var id27 = 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, compoundLabelMarginLeft, compoundLabelMarginTop) { + x5 += compoundHorizontalMargin + compoundLabelMarginLeft; + y5 += compoundVerticalMargin + compoundLabelMarginTop; + 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(id27) { + var compoundNode = idToNode[id27]; + self2.tiledMemberPack[id27] = self2.tileNodes(childGraphMap[id27], compoundNode.paddingLeft + compoundNode.paddingRight); + compoundNode.rect.width = self2.tiledMemberPack[id27].width; + compoundNode.rect.height = self2.tiledMemberPack[id27].height; + compoundNode.setCenter(self2.tiledMemberPack[id27].centerX, self2.tiledMemberPack[id27].centerY); + compoundNode.labelMarginLeft = 0; + compoundNode.labelMarginTop = 0; + if (CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS) { + var width3 = compoundNode.rect.width; + var height2 = compoundNode.rect.height; + if (compoundNode.labelWidth) { + if (compoundNode.labelPosHorizontal == "left") { + compoundNode.rect.x -= compoundNode.labelWidth; + compoundNode.setWidth(width3 + compoundNode.labelWidth); + compoundNode.labelMarginLeft = compoundNode.labelWidth; + } else if (compoundNode.labelPosHorizontal == "center" && compoundNode.labelWidth > width3) { + compoundNode.rect.x -= (compoundNode.labelWidth - width3) / 2; + compoundNode.setWidth(compoundNode.labelWidth); + compoundNode.labelMarginLeft = (compoundNode.labelWidth - width3) / 2; + } else if (compoundNode.labelPosHorizontal == "right") { + compoundNode.setWidth(width3 + compoundNode.labelWidth); + } + } + if (compoundNode.labelHeight) { + if (compoundNode.labelPosVertical == "top") { + compoundNode.rect.y -= compoundNode.labelHeight; + compoundNode.setHeight(height2 + compoundNode.labelHeight); + compoundNode.labelMarginTop = compoundNode.labelHeight; + } else if (compoundNode.labelPosVertical == "center" && compoundNode.labelHeight > height2) { + compoundNode.rect.y -= (compoundNode.labelHeight - height2) / 2; + compoundNode.setHeight(compoundNode.labelHeight); + compoundNode.labelMarginTop = (compoundNode.labelHeight - height2) / 2; + } else if (compoundNode.labelPosVertical == "bottom") { + compoundNode.setHeight(height2 + compoundNode.labelHeight); + } + } + } + }); + }; + CoSELayout.prototype.tileNodes = function(nodes6, minWidth) { + var horizontalOrg = this.tileNodesByFavoringDim(nodes6, minWidth, true); + var verticalOrg = this.tileNodesByFavoringDim(nodes6, minWidth, false); + var horizontalRatio = this.getOrgRatio(horizontalOrg); + var verticalRatio = this.getOrgRatio(verticalOrg); + var bestOrg; + if (verticalRatio < horizontalRatio) { + bestOrg = verticalOrg; + } else { + bestOrg = horizontalOrg; + } + return bestOrg; + }; + CoSELayout.prototype.getOrgRatio = function(organization) { + var width3 = organization.width; + var height2 = organization.height; + var ratio = width3 / height2; + if (ratio < 1) { + ratio = 1 / ratio; + } + return ratio; + }; + CoSELayout.prototype.calcIdealRowWidth = function(members, favorHorizontalDim) { + var verticalPadding = CoSEConstants.TILING_PADDING_VERTICAL; + var horizontalPadding = CoSEConstants.TILING_PADDING_HORIZONTAL; + var membersSize = members.length; + var totalWidth = 0; + var totalHeight = 0; + var maxWidth = 0; + members.forEach(function(node2) { + totalWidth += node2.getWidth(); + totalHeight += node2.getHeight(); + if (node2.getWidth() > maxWidth) { + maxWidth = node2.getWidth(); + } + }); + var averageWidth = totalWidth / membersSize; + var averageHeight = totalHeight / membersSize; + var delta = Math.pow(verticalPadding - horizontalPadding, 2) + 4 * (averageWidth + horizontalPadding) * (averageHeight + verticalPadding) * membersSize; + var horizontalCountDouble = (horizontalPadding - verticalPadding + Math.sqrt(delta)) / (2 * (averageWidth + horizontalPadding)); + var horizontalCount; + if (favorHorizontalDim) { + horizontalCount = Math.ceil(horizontalCountDouble); + if (horizontalCount == horizontalCountDouble) { + horizontalCount++; + } } else { + horizontalCount = Math.floor(horizontalCountDouble); + } + var idealWidth = horizontalCount * (averageWidth + horizontalPadding) - horizontalPadding; + if (maxWidth > idealWidth) { + idealWidth = maxWidth; + } + idealWidth += horizontalPadding * 2; + return idealWidth; + }; + CoSELayout.prototype.tileNodesByFavoringDim = function(nodes6, minWidth, favorHorizontalDim) { + var verticalPadding = CoSEConstants.TILING_PADDING_VERTICAL; + var horizontalPadding = CoSEConstants.TILING_PADDING_HORIZONTAL; + var tilingCompareBy = CoSEConstants.TILING_COMPARE_BY; + var organization = { + rows: [], + rowWidth: [], + rowHeight: [], + width: 0, + height: minWidth, + // assume minHeight equals to minWidth + verticalPadding, + horizontalPadding, + centerX: 0, + centerY: 0 + }; + if (tilingCompareBy) { + organization.idealRowWidth = this.calcIdealRowWidth(nodes6, favorHorizontalDim); + } + var getNodeArea = /* @__PURE__ */ __name(function getNodeArea2(n2) { + return n2.rect.width * n2.rect.height; + }, "getNodeArea"); + var areaCompareFcn = /* @__PURE__ */ __name(function areaCompareFcn2(n1, n2) { + return getNodeArea(n2) - getNodeArea(n1); + }, "areaCompareFcn"); + nodes6.sort(function(n1, n2) { + var cmpBy = areaCompareFcn; + if (organization.idealRowWidth) { + cmpBy = tilingCompareBy; + return cmpBy(n1.id, n2.id); + } + return cmpBy(n1, n2); + }); + var sumCenterX = 0; + var sumCenterY = 0; + for (var i2 = 0; i2 < nodes6.length; i2++) { + var lNode = nodes6[i2]; + sumCenterX += lNode.getCenterX(); + sumCenterY += lNode.getCenterY(); + } + organization.centerX = sumCenterX / nodes6.length; + organization.centerY = sumCenterY / nodes6.length; + 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)) { + var rowIndex = organization.rows.length - 1; + if (!organization.idealRowWidth) { + rowIndex = this.getShortestRowIndex(organization); + } + this.insertNodeToRow(organization, lNode, rowIndex, 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) { + if (organization.idealRowWidth) { + var lastRowIndex = organization.rows.length - 1; + var lastRowWidth = organization.rowWidth[lastRowIndex]; + return lastRowWidth + extraWidth + organization.horizontalPadding <= organization.idealRowWidth; + } + var sri = this.getShortestRowIndex(organization); + if (sri < 0) { return true; } - } - this.coolingCycle++; - if (this.layoutQuality == 0) { - this.coolingAdjuster = this.coolingCycle; - } else if (this.layoutQuality == 1) { - this.coolingAdjuster = this.coolingCycle / 3; - } - this.coolingFactor = Math.max(this.initialCoolingFactor - Math.pow(this.coolingCycle, Math.log(100 * (this.initialCoolingFactor - this.finalTemperature)) / Math.log(this.maxCoolingCycle)) / 100 * this.coolingAdjuster, this.finalTemperature); - this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor)); - } - if (this.isTreeGrowing) { - if (this.growTreeIterations % 10 == 0) { - if (this.prunedNodesAll.length > 0) { - this.graphManager.updateBounds(); - this.updateGrid(); - this.growTree(this.prunedNodesAll); - this.graphManager.resetAllNodesToApplyGravitation(); - var allNodes = new Set(this.getAllNodes()); - var intersection2 = this.nodesWithGravity.filter(function(x2) { - return allNodes.has(x2); - }); - this.graphManager.setAllNodesToApplyGravitation(intersection2); - this.graphManager.updateBounds(); - this.updateGrid(); - this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL; + 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 { - this.isTreeGrowing = false; - this.isGrowthFinished = true; + 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) { + if (CoSEConstants.PURE_INCREMENTAL) { + var otherEnd = node2.getEdges()[0].getOtherEnd(node2); + var relativePosition2 = new DimensionD2(node2.getCenterX() - otherEnd.getCenterX(), node2.getCenterY() - otherEnd.getCenterY()); + prunedNodesInStepTemp.push([node2, node2.getEdges()[0], node2.getOwner(), relativePosition2]); + } else { + prunedNodesInStepTemp.push([node2, node2.getEdges()[0], node2.getOwner()]); + } + containsLeaf = true; + } + } + 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(); + } } - } - this.growTreeIterations++; - } - if (this.isGrowthFinished) { - if (this.isConverged()) { - return true; - } - if (this.afterGrowthIterations % 10 == 0) { - this.graphManager.updateBounds(); - this.updateGrid(); - } - this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100); - this.afterGrowthIterations++; - } - var gridUpdateAllowed = !this.isTreeGrowing && !this.isGrowthFinished; - var forceToNodeSurroundingUpdate = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished; - this.totalDisplacement = 0; - this.graphManager.updateBounds(); - this.calcSpringForces(); - this.calcRepulsionForces(gridUpdateAllowed, forceToNodeSurroundingUpdate); - this.calcGravitationalForces(); - this.moveNodes(); - this.animate(); - return false; - }; - CoSELayout.prototype.getPositionsData = function() { - 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 + this.prunedNodesAll = prunedNodesAll; }; - } - return pData; - }; - CoSELayout.prototype.runSpringEmbedder = function() { - this.initialAnimationPeriod = 25; - this.animationPeriod = this.initialAnimationPeriod; - var layoutEnded = false; - if (FDLayoutConstants.ANIMATE === "during") { - this.emit("layoutstarted"); - } else { - while (!layoutEnded) { - layoutEnded = this.tick(); - } - this.graphManager.updateBounds(); - } - }; - CoSELayout.prototype.calculateNodesToApplyGravitationTo = function() { - var nodeList = []; - var graph; - var graphs = this.graphManager.getGraphs(); - var size2 = graphs.length; - var i2; - for (i2 = 0; i2 < size2; i2++) { - graph = graphs[i2]; - graph.updateConnected(); - if (!graph.isConnected) { - nodeList = nodeList.concat(graph.getNodes()); - } - } - return nodeList; - }; - CoSELayout.prototype.createBendpoints = function() { - var edges2 = []; - edges2 = edges2.concat(this.graphManager.getAllEdges()); - var visited = /* @__PURE__ */ new Set(); - var i2; - for (i2 = 0; i2 < edges2.length; i2++) { - var edge = edges2[i2]; - if (!visited.has(edge)) { - var source = edge.getSource(); - var target = edge.getTarget(); - if (source == target) { - edge.getBendpoints().push(new PointD()); - edge.getBendpoints().push(new PointD()); - this.createDummyNodesForBendpoints(edge); - visited.add(edge); + CoSELayout.prototype.growTree = function(prunedNodesAll) { + var lengthOfPrunedNodesInStep = prunedNodesAll.length; + var prunedNodesInStep = prunedNodesAll[lengthOfPrunedNodesInStep - 1]; + var nodeData2; + for (var i2 = 0; i2 < prunedNodesInStep.length; i2++) { + nodeData2 = prunedNodesInStep[i2]; + this.findPlaceforPrunedNode(nodeData2); + nodeData2[2].add(nodeData2[0]); + nodeData2[2].add(nodeData2[1], nodeData2[1].source, nodeData2[1].target); + } + prunedNodesAll.splice(prunedNodesAll.length - 1, 1); + this.graphManager.resetAllNodes(); + this.graphManager.resetAllEdges(); + }; + CoSELayout.prototype.findPlaceforPrunedNode = function(nodeData2) { + var gridForPrunedNode; + var nodeToConnect; + var prunedNode = nodeData2[0]; + if (prunedNode == nodeData2[1].source) { + nodeToConnect = nodeData2[1].target; } else { - var edgeList = []; - edgeList = edgeList.concat(source.getEdgeListToNode(target)); - edgeList = edgeList.concat(target.getEdgeListToNode(source)); - if (!visited.has(edgeList[0])) { - if (edgeList.length > 1) { - var k; - for (k = 0; k < edgeList.length; k++) { - var multiEdge = edgeList[k]; - multiEdge.getBendpoints().push(new PointD()); - this.createDummyNodesForBendpoints(multiEdge); + nodeToConnect = nodeData2[1].source; + } + if (CoSEConstants.PURE_INCREMENTAL) { + prunedNode.setCenter(nodeToConnect.getCenterX() + nodeData2[3].getWidth(), nodeToConnect.getCenterY() + nodeData2[3].getHeight()); + } else { + 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 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++; + } + } + 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; } } - edgeList.forEach(function(edge2) { - visited.add(edge2); - }); + } 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()); } } - } - if (visited.size == edges2.length) { - break; - } - } - }; - CoSELayout.prototype.positionNodesRadially = function(forest) { - var currentStartingPoint = new Point2(0, 0); - var numberOfColumns = Math.ceil(Math.sqrt(forest.length)); - var height2 = 0; - var currentY = 0; - var currentX = 0; - var point2 = new PointD(0, 0); - for (var i2 = 0; i2 < forest.length; i2++) { - if (i2 % numberOfColumns == 0) { - currentX = 0; - currentY = height2; - if (i2 != 0) { - currentY += CoSEConstants.DEFAULT_COMPONENT_SEPERATION; + }; + module3.exports = CoSELayout; + } + ), + /***/ + 991: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var FDLayoutNode = __webpack_require__2(551).FDLayoutNode; + var IMath = __webpack_require__2(551).IMath; + 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.calculateDisplacement = function() { + var layout6 = this.graphManager.getLayout(); + if (this.getChild() != null && this.fixedNodeWeight) { + this.displacementX += layout6.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.fixedNodeWeight; + this.displacementY += layout6.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.fixedNodeWeight; + } else { + this.displacementX += layout6.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren; + this.displacementY += layout6.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren; } - height2 = 0; - } - var tree = forest[i2]; - var centerNode = Layout2.findCenterOfTree(tree); - currentStartingPoint.x = currentX; - currentStartingPoint.y = currentY; - point2 = CoSELayout.radialLayout(tree, centerNode, currentStartingPoint); - if (point2.y > height2) { - height2 = Math.floor(point2.y); - } - 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)); - }; - 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); - } - var bottomRight = new PointD(bounds2.getMaxX(), bounds2.getMaxY()); - return transform.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 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 edges2 = node2.getEdgesBetween(parentOfNode); - while (edges2.length > 1) { - var temp = edges2[0]; - edges2.splice(0, 1); - var index = neighborEdges.indexOf(temp); - if (index >= 0) { - neighborEdges.splice(index, 1); - } - incEdgesCount--; - childCount--; - } - if (parentOfNode != null) { - startIndex = (neighborEdges.indexOf(edges2[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 parent = node2.getParent(); - if (this.getNodeDegreeWithChildren(node2) === 0 && (parent.id == void 0 || !this.getToBeTiled(parent))) { - 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 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); + if (Math.abs(this.displacementX) > layout6.coolingFactor * layout6.maxNodeDisplacement) { + this.displacementX = layout6.coolingFactor * layout6.maxNodeDisplacement * IMath.sign(this.displacementX); + } + if (Math.abs(this.displacementY) > layout6.coolingFactor * layout6.maxNodeDisplacement) { + this.displacementY = layout6.coolingFactor * layout6.maxNodeDisplacement * IMath.sign(this.displacementY); + } + if (this.child && this.child.getNodes().length > 0) { + this.propogateDisplacementToChildren(this.displacementX, this.displacementY); + } + }; + CoSENode.prototype.propogateDisplacementToChildren = function(dX, dY) { + var nodes6 = this.getChild().getNodes(); + var node2; + for (var i2 = 0; i2 < nodes6.length; i2++) { + node2 = nodes6[i2]; + if (node2.getChild() == null) { + node2.displacementX += dX; + node2.displacementY += dY; + } else { + node2.propogateDisplacementToChildren(dX, dY); + } + } + }; + CoSENode.prototype.move = function() { + var layout6 = this.graphManager.getLayout(); + if (this.child == null || this.child.getNodes().length == 0) { + this.moveBy(this.displacementX, this.displacementY); + layout6.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY); + } + this.springForceX = 0; + this.springForceY = 0; + this.repulsionForceX = 0; + this.repulsionForceY = 0; + this.gravitationForceX = 0; + this.gravitationForceY = 0; + this.displacementX = 0; + this.displacementY = 0; + }; + CoSENode.prototype.setPred1 = function(pred12) { + this.pred1 = pred12; + }; + CoSENode.prototype.getPred1 = function() { + return pred1; + }; + CoSENode.prototype.getPred2 = function() { + return pred2; + }; + CoSENode.prototype.setNext = function(next3) { + this.next = next3; + }; + CoSENode.prototype.getNext = function() { + return next; + }; + CoSENode.prototype.setProcessed = function(processed2) { + this.processed = processed2; + }; + CoSENode.prototype.isProcessed = function() { + return processed; + }; + module3.exports = CoSENode; + } + ), + /***/ + 902: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + function _toConsumableArray(arr) { + if (Array.isArray(arr)) { + for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) { + arr2[i2] = arr[i2]; + } + return arr2; + } else { + return Array.from(arr); } } - }); - }; - 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(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.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.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.getToBeTiled = function(node2) { - var id2 = node2.id; - if (this.toBeTiled[id2] != null) { - return this.toBeTiled[id2]; - } - var childGraph = node2.getChild(); - if (childGraph == null) { - this.toBeTiled[id2] = 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[id2] = false; - return false; - } - if (theChild.getChild() == null) { - this.toBeTiled[theChild.id] = false; - continue; - } - if (!this.getToBeTiled(theChild)) { - this.toBeTiled[id2] = false; - return false; - } - } - 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; - } - } - 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, 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; - } - 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; - }); - 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); - } 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]; - } - } - 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) - 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(); - } - }; - 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; + __name(_toConsumableArray, "_toConsumableArray"); + var CoSEConstants = __webpack_require__2(806); + var LinkedList = __webpack_require__2(551).LinkedList; + var Matrix = __webpack_require__2(551).Matrix; + var SVD = __webpack_require__2(551).SVD; + function ConstraintHandler() { + } + __name(ConstraintHandler, "ConstraintHandler"); + ConstraintHandler.handleConstraints = function(layout6) { + var constraints = {}; + constraints.fixedNodeConstraint = layout6.constraints.fixedNodeConstraint; + constraints.alignmentConstraint = layout6.constraints.alignmentConstraint; + constraints.relativePlacementConstraint = layout6.constraints.relativePlacementConstraint; + var idToNodeMap = /* @__PURE__ */ new Map(); + var nodeIndexes = /* @__PURE__ */ new Map(); + var xCoords = []; + var yCoords = []; + var allNodes = layout6.getAllNodes(); + var index = 0; + for (var i2 = 0; i2 < allNodes.length; i2++) { + var node2 = allNodes[i2]; + if (node2.getChild() == null) { + nodeIndexes.set(node2.id, index++); + xCoords.push(node2.getCenterX()); + yCoords.push(node2.getCenterY()); + idToNodeMap.set(node2.id, node2); + } + } + if (constraints.relativePlacementConstraint) { + constraints.relativePlacementConstraint.forEach(function(constraint) { + if (!constraint.gap && constraint.gap != 0) { + if (constraint.left) { + constraint.gap = CoSEConstants.DEFAULT_EDGE_LENGTH + idToNodeMap.get(constraint.left).getWidth() / 2 + idToNodeMap.get(constraint.right).getWidth() / 2; + } else { + constraint.gap = CoSEConstants.DEFAULT_EDGE_LENGTH + idToNodeMap.get(constraint.top).getHeight() / 2 + idToNodeMap.get(constraint.bottom).getHeight() / 2; + } + } + }); + } + var calculatePositionDiff = /* @__PURE__ */ __name(function calculatePositionDiff2(pos1, pos2) { + return { x: pos1.x - pos2.x, y: pos1.y - pos2.y }; + }, "calculatePositionDiff"); + var calculateAvgPosition = /* @__PURE__ */ __name(function calculateAvgPosition2(nodeIdSet) { + var xPosSum = 0; + var yPosSum = 0; + nodeIdSet.forEach(function(nodeId) { + xPosSum += xCoords[nodeIndexes.get(nodeId)]; + yPosSum += yCoords[nodeIndexes.get(nodeId)]; + }); + return { x: xPosSum / nodeIdSet.size, y: yPosSum / nodeIdSet.size }; + }, "calculateAvgPosition"); + var findAppropriatePositionForRelativePlacement = /* @__PURE__ */ __name(function findAppropriatePositionForRelativePlacement2(graph, direction4, fixedNodes2, dummyPositions, componentSources) { + function setUnion(setA, setB) { + var union2 = new Set(setA); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = void 0; + try { + for (var _iterator = setB[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var elem = _step.value; + union2.add(elem); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + return union2; + } + __name(setUnion, "setUnion"); + var inDegrees = /* @__PURE__ */ new Map(); + graph.forEach(function(value2, key) { + inDegrees.set(key, 0); + }); + graph.forEach(function(value2, key) { + value2.forEach(function(adjacent) { + inDegrees.set(adjacent.id, inDegrees.get(adjacent.id) + 1); + }); + }); + var positionMap = /* @__PURE__ */ new Map(); + var pastMap = /* @__PURE__ */ new Map(); + var queue = new LinkedList(); + inDegrees.forEach(function(value2, key) { + if (value2 == 0) { + queue.push(key); + if (!fixedNodes2) { + if (direction4 == "horizontal") { + positionMap.set(key, nodeIndexes.has(key) ? xCoords[nodeIndexes.get(key)] : dummyPositions.get(key)); + } else { + positionMap.set(key, nodeIndexes.has(key) ? yCoords[nodeIndexes.get(key)] : dummyPositions.get(key)); + } + } + } else { + positionMap.set(key, Number.NEGATIVE_INFINITY); + } + if (fixedNodes2) { + pastMap.set(key, /* @__PURE__ */ new Set([key])); + } + }); + if (fixedNodes2) { + componentSources.forEach(function(component2) { + var fixedIds = []; + component2.forEach(function(nodeId) { + if (fixedNodes2.has(nodeId)) { + fixedIds.push(nodeId); + } + }); + if (fixedIds.length > 0) { + var position5 = 0; + fixedIds.forEach(function(fixedId) { + if (direction4 == "horizontal") { + positionMap.set(fixedId, nodeIndexes.has(fixedId) ? xCoords[nodeIndexes.get(fixedId)] : dummyPositions.get(fixedId)); + position5 += positionMap.get(fixedId); + } else { + positionMap.set(fixedId, nodeIndexes.has(fixedId) ? yCoords[nodeIndexes.get(fixedId)] : dummyPositions.get(fixedId)); + position5 += positionMap.get(fixedId); + } + }); + position5 = position5 / fixedIds.length; + component2.forEach(function(nodeId) { + if (!fixedNodes2.has(nodeId)) { + positionMap.set(nodeId, position5); + } + }); + } else { + var _position = 0; + component2.forEach(function(nodeId) { + if (direction4 == "horizontal") { + _position += nodeIndexes.has(nodeId) ? xCoords[nodeIndexes.get(nodeId)] : dummyPositions.get(nodeId); + } else { + _position += nodeIndexes.has(nodeId) ? yCoords[nodeIndexes.get(nodeId)] : dummyPositions.get(nodeId); + } + }); + _position = _position / component2.length; + component2.forEach(function(nodeId) { + positionMap.set(nodeId, _position); + }); + } + }); + } + var _loop = /* @__PURE__ */ __name(function _loop2() { + var currentNode = queue.shift(); + var neighbors = graph.get(currentNode); + neighbors.forEach(function(neighbor) { + if (positionMap.get(neighbor.id) < positionMap.get(currentNode) + neighbor.gap) { + if (fixedNodes2 && fixedNodes2.has(neighbor.id)) { + var fixedPosition = void 0; + if (direction4 == "horizontal") { + fixedPosition = nodeIndexes.has(neighbor.id) ? xCoords[nodeIndexes.get(neighbor.id)] : dummyPositions.get(neighbor.id); + } else { + fixedPosition = nodeIndexes.has(neighbor.id) ? yCoords[nodeIndexes.get(neighbor.id)] : dummyPositions.get(neighbor.id); + } + positionMap.set(neighbor.id, fixedPosition); + if (fixedPosition < positionMap.get(currentNode) + neighbor.gap) { + var diff2 = positionMap.get(currentNode) + neighbor.gap - fixedPosition; + pastMap.get(currentNode).forEach(function(nodeId) { + positionMap.set(nodeId, positionMap.get(nodeId) - diff2); + }); + } + } else { + positionMap.set(neighbor.id, positionMap.get(currentNode) + neighbor.gap); + } + } + inDegrees.set(neighbor.id, inDegrees.get(neighbor.id) - 1); + if (inDegrees.get(neighbor.id) == 0) { + queue.push(neighbor.id); + } + if (fixedNodes2) { + pastMap.set(neighbor.id, setUnion(pastMap.get(currentNode), pastMap.get(neighbor.id))); + } + }); + }, "_loop"); + while (queue.length != 0) { + _loop(); + } + if (fixedNodes2) { + var sinkNodes = /* @__PURE__ */ new Set(); + graph.forEach(function(value2, key) { + if (value2.length == 0) { + sinkNodes.add(key); + } + }); + var _components = []; + pastMap.forEach(function(value2, key) { + if (sinkNodes.has(key)) { + var isFixedComponent = false; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = void 0; + try { + for (var _iterator2 = value2[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var nodeId = _step2.value; + if (fixedNodes2.has(nodeId)) { + isFixedComponent = true; + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + if (!isFixedComponent) { + var isExist = false; + var existAt = void 0; + _components.forEach(function(component2, index2) { + if (component2.has([].concat(_toConsumableArray(value2))[0])) { + isExist = true; + existAt = index2; + } + }); + if (!isExist) { + _components.push(new Set(value2)); + } else { + value2.forEach(function(ele) { + _components[existAt].add(ele); + }); + } + } + } + }); + _components.forEach(function(component2, index2) { + var minBefore = Number.POSITIVE_INFINITY; + var minAfter = Number.POSITIVE_INFINITY; + var maxBefore = Number.NEGATIVE_INFINITY; + var maxAfter = Number.NEGATIVE_INFINITY; + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = void 0; + try { + for (var _iterator3 = component2[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var nodeId = _step3.value; + var posBefore = void 0; + if (direction4 == "horizontal") { + posBefore = nodeIndexes.has(nodeId) ? xCoords[nodeIndexes.get(nodeId)] : dummyPositions.get(nodeId); + } else { + posBefore = nodeIndexes.has(nodeId) ? yCoords[nodeIndexes.get(nodeId)] : dummyPositions.get(nodeId); + } + var posAfter = positionMap.get(nodeId); + if (posBefore < minBefore) { + minBefore = posBefore; + } + if (posBefore > maxBefore) { + maxBefore = posBefore; + } + if (posAfter < minAfter) { + minAfter = posAfter; + } + if (posAfter > maxAfter) { + maxAfter = posAfter; + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + var diff2 = (minBefore + maxBefore) / 2 - (minAfter + maxAfter) / 2; + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = void 0; + try { + for (var _iterator4 = component2[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var _nodeId = _step4.value; + positionMap.set(_nodeId, positionMap.get(_nodeId) + diff2); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + }); + } + return positionMap; + }, "findAppropriatePositionForRelativePlacement"); + var applyReflectionForRelativePlacement = /* @__PURE__ */ __name(function applyReflectionForRelativePlacement2(relativePlacementConstraints) { + var reflectOnY = 0, notReflectOnY = 0; + var reflectOnX = 0, notReflectOnX = 0; + relativePlacementConstraints.forEach(function(constraint) { + if (constraint.left) { + xCoords[nodeIndexes.get(constraint.left)] - xCoords[nodeIndexes.get(constraint.right)] >= 0 ? reflectOnY++ : notReflectOnY++; + } else { + yCoords[nodeIndexes.get(constraint.top)] - yCoords[nodeIndexes.get(constraint.bottom)] >= 0 ? reflectOnX++ : notReflectOnX++; + } + }); + if (reflectOnY > notReflectOnY && reflectOnX > notReflectOnX) { + for (var _i = 0; _i < nodeIndexes.size; _i++) { + xCoords[_i] = -1 * xCoords[_i]; + yCoords[_i] = -1 * yCoords[_i]; + } + } else if (reflectOnY > notReflectOnY) { + for (var _i2 = 0; _i2 < nodeIndexes.size; _i2++) { + xCoords[_i2] = -1 * xCoords[_i2]; + } + } else if (reflectOnX > notReflectOnX) { + for (var _i3 = 0; _i3 < nodeIndexes.size; _i3++) { + yCoords[_i3] = -1 * yCoords[_i3]; + } + } + }, "applyReflectionForRelativePlacement"); + var findComponents = /* @__PURE__ */ __name(function findComponents2(graph) { + var components4 = []; + var queue = new LinkedList(); + var visited = /* @__PURE__ */ new Set(); + var count = 0; + graph.forEach(function(value2, key) { + if (!visited.has(key)) { + components4[count] = []; + var _currentNode = key; + queue.push(_currentNode); + visited.add(_currentNode); + components4[count].push(_currentNode); + while (queue.length != 0) { + _currentNode = queue.shift(); + var neighbors = graph.get(_currentNode); + neighbors.forEach(function(neighbor) { + if (!visited.has(neighbor.id)) { + queue.push(neighbor.id); + visited.add(neighbor.id); + components4[count].push(neighbor.id); + } + }); + } + count++; + } + }); + return components4; + }, "findComponents"); + var dagToUndirected = /* @__PURE__ */ __name(function dagToUndirected2(dag2) { + var undirected = /* @__PURE__ */ new Map(); + dag2.forEach(function(value2, key) { + undirected.set(key, []); + }); + dag2.forEach(function(value2, key) { + value2.forEach(function(adjacent) { + undirected.get(key).push(adjacent); + undirected.get(adjacent.id).push({ id: key, gap: adjacent.gap, direction: adjacent.direction }); + }); + }); + return undirected; + }, "dagToUndirected"); + var dagToReversed = /* @__PURE__ */ __name(function dagToReversed2(dag2) { + var reversed = /* @__PURE__ */ new Map(); + dag2.forEach(function(value2, key) { + reversed.set(key, []); + }); + dag2.forEach(function(value2, key) { + value2.forEach(function(adjacent) { + reversed.get(adjacent.id).push({ id: key, gap: adjacent.gap, direction: adjacent.direction }); + }); + }); + return reversed; + }, "dagToReversed"); + var targetMatrix = []; + var sourceMatrix = []; + var standardTransformation = false; + var reflectionType = false; + var fixedNodes = /* @__PURE__ */ new Set(); + var dag = /* @__PURE__ */ new Map(); + var dagUndirected = /* @__PURE__ */ new Map(); + var components3 = []; + if (constraints.fixedNodeConstraint) { + constraints.fixedNodeConstraint.forEach(function(nodeData2) { + fixedNodes.add(nodeData2.nodeId); + }); } - } - 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]); + if (constraints.relativePlacementConstraint) { + constraints.relativePlacementConstraint.forEach(function(constraint) { + if (constraint.left) { + if (dag.has(constraint.left)) { + dag.get(constraint.left).push({ id: constraint.right, gap: constraint.gap, direction: "horizontal" }); + } else { + dag.set(constraint.left, [{ id: constraint.right, gap: constraint.gap, direction: "horizontal" }]); + } + if (!dag.has(constraint.right)) { + dag.set(constraint.right, []); + } + } else { + if (dag.has(constraint.top)) { + dag.get(constraint.top).push({ id: constraint.bottom, gap: constraint.gap, direction: "vertical" }); + } else { + dag.set(constraint.top, [{ id: constraint.bottom, gap: constraint.gap, direction: "vertical" }]); + } + if (!dag.has(constraint.bottom)) { + dag.set(constraint.bottom, []); + } + } + }); + dagUndirected = dagToUndirected(dag); + components3 = findComponents(dagUndirected); + } + if (CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING) { + if (constraints.fixedNodeConstraint && constraints.fixedNodeConstraint.length > 1) { + constraints.fixedNodeConstraint.forEach(function(nodeData2, i3) { + targetMatrix[i3] = [nodeData2.position.x, nodeData2.position.y]; + sourceMatrix[i3] = [xCoords[nodeIndexes.get(nodeData2.nodeId)], yCoords[nodeIndexes.get(nodeData2.nodeId)]]; + }); + standardTransformation = true; + } else if (constraints.alignmentConstraint) { + (function() { + var count = 0; + if (constraints.alignmentConstraint.vertical) { + var verticalAlign = constraints.alignmentConstraint.vertical; + var _loop2 = /* @__PURE__ */ __name(function _loop22(_i42) { + var alignmentSet = /* @__PURE__ */ new Set(); + verticalAlign[_i42].forEach(function(nodeId) { + alignmentSet.add(nodeId); + }); + var intersection3 = new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x5) { + return fixedNodes.has(x5); + })); + var xPos = void 0; + if (intersection3.size > 0) xPos = xCoords[nodeIndexes.get(intersection3.values().next().value)]; + else xPos = calculateAvgPosition(alignmentSet).x; + verticalAlign[_i42].forEach(function(nodeId) { + targetMatrix[count] = [xPos, yCoords[nodeIndexes.get(nodeId)]]; + sourceMatrix[count] = [xCoords[nodeIndexes.get(nodeId)], yCoords[nodeIndexes.get(nodeId)]]; + count++; + }); + }, "_loop2"); + for (var _i4 = 0; _i4 < verticalAlign.length; _i4++) { + _loop2(_i4); + } + standardTransformation = true; + } + if (constraints.alignmentConstraint.horizontal) { + var horizontalAlign = constraints.alignmentConstraint.horizontal; + var _loop3 = /* @__PURE__ */ __name(function _loop32(_i52) { + var alignmentSet = /* @__PURE__ */ new Set(); + horizontalAlign[_i52].forEach(function(nodeId) { + alignmentSet.add(nodeId); + }); + var intersection3 = new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x5) { + return fixedNodes.has(x5); + })); + var yPos = void 0; + if (intersection3.size > 0) yPos = xCoords[nodeIndexes.get(intersection3.values().next().value)]; + else yPos = calculateAvgPosition(alignmentSet).y; + horizontalAlign[_i52].forEach(function(nodeId) { + targetMatrix[count] = [xCoords[nodeIndexes.get(nodeId)], yPos]; + sourceMatrix[count] = [xCoords[nodeIndexes.get(nodeId)], yCoords[nodeIndexes.get(nodeId)]]; + count++; + }); + }, "_loop3"); + for (var _i5 = 0; _i5 < horizontalAlign.length; _i5++) { + _loop3(_i5); + } + standardTransformation = true; + } + if (constraints.relativePlacementConstraint) { + reflectionType = true; + } + })(); + } else if (constraints.relativePlacementConstraint) { + var largestComponentSize = 0; + var largestComponentIndex = 0; + for (var _i6 = 0; _i6 < components3.length; _i6++) { + if (components3[_i6].length > largestComponentSize) { + largestComponentSize = components3[_i6].length; + largestComponentIndex = _i6; + } + } + if (largestComponentSize < dagUndirected.size / 2) { + applyReflectionForRelativePlacement(constraints.relativePlacementConstraint); + standardTransformation = false; + reflectionType = false; + } else { + var subGraphOnHorizontal = /* @__PURE__ */ new Map(); + var subGraphOnVertical = /* @__PURE__ */ new Map(); + var constraintsInlargestComponent = []; + components3[largestComponentIndex].forEach(function(nodeId) { + dag.get(nodeId).forEach(function(adjacent) { + if (adjacent.direction == "horizontal") { + if (subGraphOnHorizontal.has(nodeId)) { + subGraphOnHorizontal.get(nodeId).push(adjacent); + } else { + subGraphOnHorizontal.set(nodeId, [adjacent]); + } + if (!subGraphOnHorizontal.has(adjacent.id)) { + subGraphOnHorizontal.set(adjacent.id, []); + } + constraintsInlargestComponent.push({ left: nodeId, right: adjacent.id }); + } else { + if (subGraphOnVertical.has(nodeId)) { + subGraphOnVertical.get(nodeId).push(adjacent); + } else { + subGraphOnVertical.set(nodeId, [adjacent]); + } + if (!subGraphOnVertical.has(adjacent.id)) { + subGraphOnVertical.set(adjacent.id, []); + } + constraintsInlargestComponent.push({ top: nodeId, bottom: adjacent.id }); + } + }); + }); + applyReflectionForRelativePlacement(constraintsInlargestComponent); + reflectionType = false; + var positionMapHorizontal = findAppropriatePositionForRelativePlacement(subGraphOnHorizontal, "horizontal"); + var positionMapVertical = findAppropriatePositionForRelativePlacement(subGraphOnVertical, "vertical"); + components3[largestComponentIndex].forEach(function(nodeId, i3) { + sourceMatrix[i3] = [xCoords[nodeIndexes.get(nodeId)], yCoords[nodeIndexes.get(nodeId)]]; + targetMatrix[i3] = []; + if (positionMapHorizontal.has(nodeId)) { + targetMatrix[i3][0] = positionMapHorizontal.get(nodeId); + } else { + targetMatrix[i3][0] = xCoords[nodeIndexes.get(nodeId)]; + } + if (positionMapVertical.has(nodeId)) { + targetMatrix[i3][1] = positionMapVertical.get(nodeId); + } else { + targetMatrix[i3][1] = yCoords[nodeIndexes.get(nodeId)]; + } + }); + standardTransformation = true; + } + } + if (standardTransformation) { + var transformationMatrix = void 0; + var targetMatrixTranspose = Matrix.transpose(targetMatrix); + var sourceMatrixTranspose = Matrix.transpose(sourceMatrix); + for (var _i7 = 0; _i7 < targetMatrixTranspose.length; _i7++) { + targetMatrixTranspose[_i7] = Matrix.multGamma(targetMatrixTranspose[_i7]); + sourceMatrixTranspose[_i7] = Matrix.multGamma(sourceMatrixTranspose[_i7]); + } + var tempMatrix = Matrix.multMat(targetMatrixTranspose, Matrix.transpose(sourceMatrixTranspose)); + var SVDResult = SVD.svd(tempMatrix); + transformationMatrix = Matrix.multMat(SVDResult.V, Matrix.transpose(SVDResult.U)); + for (var _i8 = 0; _i8 < nodeIndexes.size; _i8++) { + var temp1 = [xCoords[_i8], yCoords[_i8]]; + var temp2 = [transformationMatrix[0][0], transformationMatrix[1][0]]; + var temp3 = [transformationMatrix[0][1], transformationMatrix[1][1]]; + xCoords[_i8] = Matrix.dotProduct(temp1, temp2); + yCoords[_i8] = Matrix.dotProduct(temp1, temp3); + } + if (reflectionType) { + applyReflectionForRelativePlacement(constraints.relativePlacementConstraint); + } } } - prunedNodesAll.push(prunedNodesInStep); - this.graphManager.resetAllNodes(); - this.graphManager.resetAllEdges(); - } + if (CoSEConstants.ENFORCE_CONSTRAINTS) { + if (constraints.fixedNodeConstraint && constraints.fixedNodeConstraint.length > 0) { + var translationAmount = { x: 0, y: 0 }; + constraints.fixedNodeConstraint.forEach(function(nodeData2, i3) { + var posInTheory = { x: xCoords[nodeIndexes.get(nodeData2.nodeId)], y: yCoords[nodeIndexes.get(nodeData2.nodeId)] }; + var posDesired = nodeData2.position; + var posDiff = calculatePositionDiff(posDesired, posInTheory); + translationAmount.x += posDiff.x; + translationAmount.y += posDiff.y; + }); + translationAmount.x /= constraints.fixedNodeConstraint.length; + translationAmount.y /= constraints.fixedNodeConstraint.length; + xCoords.forEach(function(value2, i3) { + xCoords[i3] += translationAmount.x; + }); + yCoords.forEach(function(value2, i3) { + yCoords[i3] += translationAmount.y; + }); + constraints.fixedNodeConstraint.forEach(function(nodeData2) { + xCoords[nodeIndexes.get(nodeData2.nodeId)] = nodeData2.position.x; + yCoords[nodeIndexes.get(nodeData2.nodeId)] = nodeData2.position.y; + }); + } + if (constraints.alignmentConstraint) { + if (constraints.alignmentConstraint.vertical) { + var xAlign = constraints.alignmentConstraint.vertical; + var _loop4 = /* @__PURE__ */ __name(function _loop42(_i92) { + var alignmentSet = /* @__PURE__ */ new Set(); + xAlign[_i92].forEach(function(nodeId) { + alignmentSet.add(nodeId); + }); + var intersection3 = new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x5) { + return fixedNodes.has(x5); + })); + var xPos = void 0; + if (intersection3.size > 0) xPos = xCoords[nodeIndexes.get(intersection3.values().next().value)]; + else xPos = calculateAvgPosition(alignmentSet).x; + alignmentSet.forEach(function(nodeId) { + if (!fixedNodes.has(nodeId)) xCoords[nodeIndexes.get(nodeId)] = xPos; + }); + }, "_loop4"); + for (var _i9 = 0; _i9 < xAlign.length; _i9++) { + _loop4(_i9); + } + } + if (constraints.alignmentConstraint.horizontal) { + var yAlign = constraints.alignmentConstraint.horizontal; + var _loop5 = /* @__PURE__ */ __name(function _loop52(_i102) { + var alignmentSet = /* @__PURE__ */ new Set(); + yAlign[_i102].forEach(function(nodeId) { + alignmentSet.add(nodeId); + }); + var intersection3 = new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x5) { + return fixedNodes.has(x5); + })); + var yPos = void 0; + if (intersection3.size > 0) yPos = yCoords[nodeIndexes.get(intersection3.values().next().value)]; + else yPos = calculateAvgPosition(alignmentSet).y; + alignmentSet.forEach(function(nodeId) { + if (!fixedNodes.has(nodeId)) yCoords[nodeIndexes.get(nodeId)] = yPos; + }); + }, "_loop5"); + for (var _i10 = 0; _i10 < yAlign.length; _i10++) { + _loop5(_i10); + } + } + } + if (constraints.relativePlacementConstraint) { + (function() { + var nodeToDummyForVerticalAlignment = /* @__PURE__ */ new Map(); + var nodeToDummyForHorizontalAlignment = /* @__PURE__ */ new Map(); + var dummyToNodeForVerticalAlignment = /* @__PURE__ */ new Map(); + var dummyToNodeForHorizontalAlignment = /* @__PURE__ */ new Map(); + var dummyPositionsForVerticalAlignment = /* @__PURE__ */ new Map(); + var dummyPositionsForHorizontalAlignment = /* @__PURE__ */ new Map(); + var fixedNodesOnHorizontal = /* @__PURE__ */ new Set(); + var fixedNodesOnVertical = /* @__PURE__ */ new Set(); + fixedNodes.forEach(function(nodeId2) { + fixedNodesOnHorizontal.add(nodeId2); + fixedNodesOnVertical.add(nodeId2); + }); + if (constraints.alignmentConstraint) { + if (constraints.alignmentConstraint.vertical) { + var verticalAlignment2 = constraints.alignmentConstraint.vertical; + var _loop6 = /* @__PURE__ */ __name(function _loop62(_i112) { + dummyToNodeForVerticalAlignment.set("dummy" + _i112, []); + verticalAlignment2[_i112].forEach(function(nodeId2) { + nodeToDummyForVerticalAlignment.set(nodeId2, "dummy" + _i112); + dummyToNodeForVerticalAlignment.get("dummy" + _i112).push(nodeId2); + if (fixedNodes.has(nodeId2)) { + fixedNodesOnHorizontal.add("dummy" + _i112); + } + }); + dummyPositionsForVerticalAlignment.set("dummy" + _i112, xCoords[nodeIndexes.get(verticalAlignment2[_i112][0])]); + }, "_loop6"); + for (var _i11 = 0; _i11 < verticalAlignment2.length; _i11++) { + _loop6(_i11); + } + } + if (constraints.alignmentConstraint.horizontal) { + var horizontalAlignment = constraints.alignmentConstraint.horizontal; + var _loop7 = /* @__PURE__ */ __name(function _loop72(_i122) { + dummyToNodeForHorizontalAlignment.set("dummy" + _i122, []); + horizontalAlignment[_i122].forEach(function(nodeId2) { + nodeToDummyForHorizontalAlignment.set(nodeId2, "dummy" + _i122); + dummyToNodeForHorizontalAlignment.get("dummy" + _i122).push(nodeId2); + if (fixedNodes.has(nodeId2)) { + fixedNodesOnVertical.add("dummy" + _i122); + } + }); + dummyPositionsForHorizontalAlignment.set("dummy" + _i122, yCoords[nodeIndexes.get(horizontalAlignment[_i122][0])]); + }, "_loop7"); + for (var _i12 = 0; _i12 < horizontalAlignment.length; _i12++) { + _loop7(_i12); + } + } + } + var dagOnHorizontal = /* @__PURE__ */ new Map(); + var dagOnVertical = /* @__PURE__ */ new Map(); + var _loop8 = /* @__PURE__ */ __name(function _loop82(nodeId2) { + dag.get(nodeId2).forEach(function(adjacent) { + var sourceId = void 0; + var targetNode = void 0; + if (adjacent["direction"] == "horizontal") { + sourceId = nodeToDummyForVerticalAlignment.get(nodeId2) ? nodeToDummyForVerticalAlignment.get(nodeId2) : nodeId2; + if (nodeToDummyForVerticalAlignment.get(adjacent.id)) { + targetNode = { id: nodeToDummyForVerticalAlignment.get(adjacent.id), gap: adjacent.gap, direction: adjacent.direction }; + } else { + targetNode = adjacent; + } + if (dagOnHorizontal.has(sourceId)) { + dagOnHorizontal.get(sourceId).push(targetNode); + } else { + dagOnHorizontal.set(sourceId, [targetNode]); + } + if (!dagOnHorizontal.has(targetNode.id)) { + dagOnHorizontal.set(targetNode.id, []); + } + } else { + sourceId = nodeToDummyForHorizontalAlignment.get(nodeId2) ? nodeToDummyForHorizontalAlignment.get(nodeId2) : nodeId2; + if (nodeToDummyForHorizontalAlignment.get(adjacent.id)) { + targetNode = { id: nodeToDummyForHorizontalAlignment.get(adjacent.id), gap: adjacent.gap, direction: adjacent.direction }; + } else { + targetNode = adjacent; + } + if (dagOnVertical.has(sourceId)) { + dagOnVertical.get(sourceId).push(targetNode); + } else { + dagOnVertical.set(sourceId, [targetNode]); + } + if (!dagOnVertical.has(targetNode.id)) { + dagOnVertical.set(targetNode.id, []); + } + } + }); + }, "_loop8"); + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = void 0; + try { + for (var _iterator5 = dag.keys()[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var nodeId = _step5.value; + _loop8(nodeId); + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + var undirectedOnHorizontal = dagToUndirected(dagOnHorizontal); + var undirectedOnVertical = dagToUndirected(dagOnVertical); + var componentsOnHorizontal = findComponents(undirectedOnHorizontal); + var componentsOnVertical = findComponents(undirectedOnVertical); + var reversedDagOnHorizontal = dagToReversed(dagOnHorizontal); + var reversedDagOnVertical = dagToReversed(dagOnVertical); + var componentSourcesOnHorizontal = []; + var componentSourcesOnVertical = []; + componentsOnHorizontal.forEach(function(component2, index2) { + componentSourcesOnHorizontal[index2] = []; + component2.forEach(function(nodeId2) { + if (reversedDagOnHorizontal.get(nodeId2).length == 0) { + componentSourcesOnHorizontal[index2].push(nodeId2); + } + }); + }); + componentsOnVertical.forEach(function(component2, index2) { + componentSourcesOnVertical[index2] = []; + component2.forEach(function(nodeId2) { + if (reversedDagOnVertical.get(nodeId2).length == 0) { + componentSourcesOnVertical[index2].push(nodeId2); + } + }); + }); + var positionMapHorizontal2 = findAppropriatePositionForRelativePlacement(dagOnHorizontal, "horizontal", fixedNodesOnHorizontal, dummyPositionsForVerticalAlignment, componentSourcesOnHorizontal); + var positionMapVertical2 = findAppropriatePositionForRelativePlacement(dagOnVertical, "vertical", fixedNodesOnVertical, dummyPositionsForHorizontalAlignment, componentSourcesOnVertical); + var _loop9 = /* @__PURE__ */ __name(function _loop92(key2) { + if (dummyToNodeForVerticalAlignment.get(key2)) { + dummyToNodeForVerticalAlignment.get(key2).forEach(function(nodeId2) { + xCoords[nodeIndexes.get(nodeId2)] = positionMapHorizontal2.get(key2); + }); + } else { + xCoords[nodeIndexes.get(key2)] = positionMapHorizontal2.get(key2); + } + }, "_loop9"); + var _iteratorNormalCompletion6 = true; + var _didIteratorError6 = false; + var _iteratorError6 = void 0; + try { + for (var _iterator6 = positionMapHorizontal2.keys()[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) { + var key = _step6.value; + _loop9(key); + } + } catch (err) { + _didIteratorError6 = true; + _iteratorError6 = err; + } finally { + try { + if (!_iteratorNormalCompletion6 && _iterator6.return) { + _iterator6.return(); + } + } finally { + if (_didIteratorError6) { + throw _iteratorError6; + } + } + } + var _loop10 = /* @__PURE__ */ __name(function _loop102(key2) { + if (dummyToNodeForHorizontalAlignment.get(key2)) { + dummyToNodeForHorizontalAlignment.get(key2).forEach(function(nodeId2) { + yCoords[nodeIndexes.get(nodeId2)] = positionMapVertical2.get(key2); + }); + } else { + yCoords[nodeIndexes.get(key2)] = positionMapVertical2.get(key2); + } + }, "_loop10"); + var _iteratorNormalCompletion7 = true; + var _didIteratorError7 = false; + var _iteratorError7 = void 0; + try { + for (var _iterator7 = positionMapVertical2.keys()[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) { + var key = _step7.value; + _loop10(key); + } + } catch (err) { + _didIteratorError7 = true; + _iteratorError7 = err; + } finally { + try { + if (!_iteratorNormalCompletion7 && _iterator7.return) { + _iterator7.return(); + } + } finally { + if (_didIteratorError7) { + throw _iteratorError7; + } + } + } + })(); + } + } + for (var _i13 = 0; _i13 < allNodes.length; _i13++) { + var _node = allNodes[_i13]; + if (_node.getChild() == null) { + _node.setCenter(xCoords[nodeIndexes.get(_node.id)], yCoords[nodeIndexes.get(_node.id)]); + } + } + }; + module3.exports = ConstraintHandler; } - this.prunedNodesAll = prunedNodesAll; - }; - 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); + ), + /***/ + 551: ( + /***/ + (module3) => { + module3.exports = __WEBPACK_EXTERNAL_MODULE__551__; } - prunedNodesAll.splice(prunedNodesAll.length - 1, 1); - this.graphManager.resetAllNodes(); - this.graphManager.resetAllEdges(); + ) + /******/ + }; + var __webpack_module_cache__ = {}; + function __webpack_require__(moduleId) { + var cachedModule = __webpack_module_cache__[moduleId]; + if (cachedModule !== void 0) { + return cachedModule.exports; + } + var module3 = __webpack_module_cache__[moduleId] = { + /******/ + // no module.id needed + /******/ + // no module.loaded needed + /******/ + exports: {} + /******/ }; - 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++; - } + __webpack_modules__[moduleId](module3, module3.exports, __webpack_require__); + return module3.exports; + } + __name(__webpack_require__, "__webpack_require__"); + var __webpack_exports__ = __webpack_require__(45); + return __webpack_exports__; + })() + ); + }); + } + }); + + // ../../node_modules/.pnpm/cytoscape-fcose@2.2.0_cytoscape@3.30.1/node_modules/cytoscape-fcose/cytoscape-fcose.js + var require_cytoscape_fcose = __commonJS({ + "../../node_modules/.pnpm/cytoscape-fcose@2.2.0_cytoscape@3.30.1/node_modules/cytoscape-fcose/cytoscape-fcose.js"(exports2, module2) { + "use strict"; + (/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root4, factory) { + if (typeof exports2 === "object" && typeof module2 === "object") + module2.exports = factory(require_cose_base2()); + else if (typeof define === "function" && define.amd) + define(["cose-base"], factory); + else if (typeof exports2 === "object") + exports2["cytoscapeFcose"] = factory(require_cose_base2()); + else + root4["cytoscapeFcose"] = factory(root4["coseBase"]); + }, "webpackUniversalModuleDefinition"))(exports2, function(__WEBPACK_EXTERNAL_MODULE__140__) { + return ( + /******/ + (() => { + "use strict"; + var __webpack_modules__ = { + /***/ + 658: ( + /***/ + (module3) => { + module3.exports = Object.assign != null ? Object.assign.bind(Object) : function(tgt) { + for (var _len = arguments.length, srcs = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + srcs[_key - 1] = arguments[_key]; + } + srcs.forEach(function(src) { + Object.keys(src).forEach(function(k2) { + return tgt[k2] = src[k2]; + }); + }); + return tgt; + }; } - 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; + ), + /***/ + 548: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var _slicedToArray2 = /* @__PURE__ */ function() { + function sliceIterator(arr, i2) { + var _arr = []; + var _n = true; + var _d = false; + var _e = void 0; + try { + for (var _i = arr[Symbol.iterator](), _s; !(_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"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } + return _arr; } - } else if (controlRegions[0] == 0 && controlRegions[2] == 0) { - if (random2 == 0) { - gridForPrunedNode = 0; - } else { - gridForPrunedNode = 2; + __name(sliceIterator, "sliceIterator"); + return function(arr, i2) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + return sliceIterator(arr, i2); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; + }(); + var LinkedList = __webpack_require__2(140).layoutBase.LinkedList; + var auxiliary = {}; + auxiliary.getTopMostNodes = function(nodes6) { + var nodesMap2 = {}; + for (var i2 = 0; i2 < nodes6.length; i2++) { + nodesMap2[nodes6[i2].id()] = true; } - } else if (controlRegions[0] == 0 && controlRegions[3] == 0) { - if (random2 == 0) { - gridForPrunedNode = 0; - } else { - gridForPrunedNode = 3; + 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; + }; + auxiliary.connectComponents = function(cy, eles, topMostNodes, dummyNodes) { + var queue = new LinkedList(); + var visited = /* @__PURE__ */ new Set(); + var visitedTopMostNodes = []; + var currentNeighbor = void 0; + var minDegreeNode = void 0; + var minDegree = void 0; + var isConnected = false; + var count = 1; + var nodesConnectedToDummy = []; + var components3 = []; + var _loop = /* @__PURE__ */ __name(function _loop2() { + var cmpt = cy.collection(); + components3.push(cmpt); + var currentNode = topMostNodes[0]; + var childrenOfCurrentNode = cy.collection(); + childrenOfCurrentNode.merge(currentNode).merge(currentNode.descendants().intersection(eles)); + visitedTopMostNodes.push(currentNode); + childrenOfCurrentNode.forEach(function(node2) { + queue.push(node2); + visited.add(node2); + cmpt.merge(node2); + }); + var _loop22 = /* @__PURE__ */ __name(function _loop23() { + currentNode = queue.shift(); + var neighborNodes = cy.collection(); + currentNode.neighborhood().nodes().forEach(function(node2) { + if (eles.intersection(currentNode.edgesWith(node2)).length > 0) { + neighborNodes.merge(node2); + } + }); + for (var i2 = 0; i2 < neighborNodes.length; i2++) { + var neighborNode = neighborNodes[i2]; + currentNeighbor = topMostNodes.intersection(neighborNode.union(neighborNode.ancestors())); + if (currentNeighbor != null && !visited.has(currentNeighbor[0])) { + var childrenOfNeighbor = currentNeighbor.union(currentNeighbor.descendants()); + childrenOfNeighbor.forEach(function(node2) { + queue.push(node2); + visited.add(node2); + cmpt.merge(node2); + if (topMostNodes.has(node2)) { + visitedTopMostNodes.push(node2); + } + }); + } + } + }, "_loop2"); + while (queue.length != 0) { + _loop22(); + } + cmpt.forEach(function(node2) { + eles.intersection(node2.connectedEdges()).forEach(function(e3) { + if (cmpt.has(e3.source()) && cmpt.has(e3.target())) { + cmpt.merge(e3); + } + }); + }); + if (visitedTopMostNodes.length == topMostNodes.length) { + isConnected = true; + } + if (!isConnected || isConnected && count > 1) { + minDegreeNode = visitedTopMostNodes[0]; + minDegree = minDegreeNode.connectedEdges().length; + visitedTopMostNodes.forEach(function(node2) { + if (node2.connectedEdges().length < minDegree) { + minDegree = node2.connectedEdges().length; + minDegreeNode = node2; + } + }); + nodesConnectedToDummy.push(minDegreeNode.id()); + var temp = cy.collection(); + temp.merge(visitedTopMostNodes[0]); + visitedTopMostNodes.forEach(function(node2) { + temp.merge(node2); + }); + visitedTopMostNodes = []; + topMostNodes = topMostNodes.difference(temp); + count++; + } + }, "_loop"); + do { + _loop(); + } while (!isConnected); + if (dummyNodes) { + if (nodesConnectedToDummy.length > 0) { + dummyNodes.set("dummy" + (dummyNodes.size + 1), nodesConnectedToDummy); + } } - } else if (controlRegions[1] == 0 && controlRegions[2] == 0) { - if (random2 == 0) { - gridForPrunedNode = 1; - } else { - gridForPrunedNode = 2; + return components3; + }; + auxiliary.relocateComponent = function(originalCenter, componentResult, options3) { + if (!options3.fixedNodeConstraint) { + var minXCoord = Number.POSITIVE_INFINITY; + var maxXCoord = Number.NEGATIVE_INFINITY; + var minYCoord = Number.POSITIVE_INFINITY; + var maxYCoord = Number.NEGATIVE_INFINITY; + if (options3.quality == "draft") { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = void 0; + try { + for (var _iterator = componentResult.nodeIndexes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _ref = _step.value; + var _ref2 = _slicedToArray2(_ref, 2); + var key = _ref2[0]; + var value2 = _ref2[1]; + var cyNode = options3.cy.getElementById(key); + if (cyNode) { + var nodeBB = cyNode.boundingBox(); + var leftX = componentResult.xCoords[value2] - nodeBB.w / 2; + var rightX = componentResult.xCoords[value2] + nodeBB.w / 2; + var topY = componentResult.yCoords[value2] - nodeBB.h / 2; + var bottomY = componentResult.yCoords[value2] + nodeBB.h / 2; + if (leftX < minXCoord) minXCoord = leftX; + if (rightX > maxXCoord) maxXCoord = rightX; + if (topY < minYCoord) minYCoord = topY; + if (bottomY > maxYCoord) maxYCoord = bottomY; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + var diffOnX = originalCenter.x - (maxXCoord + minXCoord) / 2; + var diffOnY = originalCenter.y - (maxYCoord + minYCoord) / 2; + componentResult.xCoords = componentResult.xCoords.map(function(x5) { + return x5 + diffOnX; + }); + componentResult.yCoords = componentResult.yCoords.map(function(y5) { + return y5 + diffOnY; + }); + } else { + Object.keys(componentResult).forEach(function(item) { + var node2 = componentResult[item]; + var leftX2 = node2.getRect().x; + var rightX2 = node2.getRect().x + node2.getRect().width; + var topY2 = node2.getRect().y; + var bottomY2 = node2.getRect().y + node2.getRect().height; + if (leftX2 < minXCoord) minXCoord = leftX2; + if (rightX2 > maxXCoord) maxXCoord = rightX2; + if (topY2 < minYCoord) minYCoord = topY2; + if (bottomY2 > maxYCoord) maxYCoord = bottomY2; + }); + var _diffOnX = originalCenter.x - (maxXCoord + minXCoord) / 2; + var _diffOnY = originalCenter.y - (maxYCoord + minYCoord) / 2; + Object.keys(componentResult).forEach(function(item) { + var node2 = componentResult[item]; + node2.setCenter(node2.getCenterX() + _diffOnX, node2.getCenterY() + _diffOnY); + }); + } } - } else if (controlRegions[1] == 0 && controlRegions[3] == 0) { - if (random2 == 0) { - gridForPrunedNode = 1; + }; + auxiliary.calcBoundingBox = function(parentNode, xCoords, yCoords, nodeIndexes) { + var left3 = Number.MAX_SAFE_INTEGER; + var right3 = Number.MIN_SAFE_INTEGER; + var top2 = Number.MAX_SAFE_INTEGER; + var bottom2 = Number.MIN_SAFE_INTEGER; + var nodeLeft = void 0; + var nodeRight = void 0; + var nodeTop = void 0; + var nodeBottom = void 0; + var nodes6 = parentNode.descendants().not(":parent"); + var s2 = nodes6.length; + for (var i2 = 0; i2 < s2; i2++) { + var node2 = nodes6[i2]; + nodeLeft = xCoords[nodeIndexes.get(node2.id())] - node2.width() / 2; + nodeRight = xCoords[nodeIndexes.get(node2.id())] + node2.width() / 2; + nodeTop = yCoords[nodeIndexes.get(node2.id())] - node2.height() / 2; + nodeBottom = yCoords[nodeIndexes.get(node2.id())] + node2.height() / 2; + if (left3 > nodeLeft) { + left3 = nodeLeft; + } + if (right3 < nodeRight) { + right3 = nodeRight; + } + if (top2 > nodeTop) { + top2 = nodeTop; + } + if (bottom2 < nodeBottom) { + bottom2 = nodeBottom; + } + } + var boundingBox3 = {}; + boundingBox3.topLeftX = left3; + boundingBox3.topLeftY = top2; + boundingBox3.width = right3 - left3; + boundingBox3.height = bottom2 - top2; + return boundingBox3; + }; + auxiliary.calcParentsWithoutChildren = function(cy, eles) { + var parentsWithoutChildren = cy.collection(); + eles.nodes(":parent").forEach(function(parent4) { + var check = false; + parent4.children().forEach(function(child) { + if (child.css("display") != "none") { + check = true; + } + }); + if (!check) { + parentsWithoutChildren.merge(parent4); + } + }); + return parentsWithoutChildren; + }; + module3.exports = auxiliary; + } + ), + /***/ + 816: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var aux = __webpack_require__2(548); + var CoSELayout = __webpack_require__2(140).CoSELayout; + var CoSENode = __webpack_require__2(140).CoSENode; + var PointD = __webpack_require__2(140).layoutBase.PointD; + var DimensionD2 = __webpack_require__2(140).layoutBase.DimensionD; + var LayoutConstants = __webpack_require__2(140).layoutBase.LayoutConstants; + var FDLayoutConstants = __webpack_require__2(140).layoutBase.FDLayoutConstants; + var CoSEConstants = __webpack_require__2(140).CoSEConstants; + var coseLayout = /* @__PURE__ */ __name(function coseLayout2(options3, spectralResult) { + var cy = options3.cy; + var eles = options3.eles; + var nodes6 = eles.nodes(); + var edges5 = eles.edges(); + var nodeIndexes = void 0; + var xCoords = void 0; + var yCoords = void 0; + var idToLNode = {}; + if (options3.randomize) { + nodeIndexes = spectralResult["nodeIndexes"]; + xCoords = spectralResult["xCoords"]; + yCoords = spectralResult["yCoords"]; + } + var isFn = /* @__PURE__ */ __name(function isFn2(fn3) { + return typeof fn3 === "function"; + }, "isFn"); + var optFn = /* @__PURE__ */ __name(function optFn2(opt, ele) { + if (isFn(opt)) { + return opt(ele); + } else { + return opt; + } + }, "optFn"); + var parentsWithoutChildren = aux.calcParentsWithoutChildren(cy, eles); + var processChildrenList = /* @__PURE__ */ __name(function processChildrenList2(parent4, children2, layout6, options4) { + var size5 = children2.length; + for (var i2 = 0; i2 < size5; i2++) { + var theChild = children2[i2]; + var children_of_children = null; + if (theChild.intersection(parentsWithoutChildren).length == 0) { + children_of_children = theChild.children(); + } + var theNode = void 0; + var dimensions2 = theChild.layoutDimensions({ + nodeDimensionsIncludeLabels: options4.nodeDimensionsIncludeLabels + }); + if (theChild.outerWidth() != null && theChild.outerHeight() != null) { + if (options4.randomize) { + if (!theChild.isParent()) { + theNode = parent4.add(new CoSENode(layout6.graphManager, new PointD(xCoords[nodeIndexes.get(theChild.id())] - dimensions2.w / 2, yCoords[nodeIndexes.get(theChild.id())] - dimensions2.h / 2), new DimensionD2(parseFloat(dimensions2.w), parseFloat(dimensions2.h)))); + } else { + var parentInfo = aux.calcBoundingBox(theChild, xCoords, yCoords, nodeIndexes); + if (theChild.intersection(parentsWithoutChildren).length == 0) { + theNode = parent4.add(new CoSENode(layout6.graphManager, new PointD(parentInfo.topLeftX, parentInfo.topLeftY), new DimensionD2(parentInfo.width, parentInfo.height))); + } else { + theNode = parent4.add(new CoSENode(layout6.graphManager, new PointD(parentInfo.topLeftX, parentInfo.topLeftY), new DimensionD2(parseFloat(dimensions2.w), parseFloat(dimensions2.h)))); + } + } + } else { + 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.nodeRepulsion = optFn(options4.nodeRepulsion, theChild); + 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 (options4.nodeDimensionsIncludeLabels) { + theNode.labelWidth = theChild.boundingBox({ includeLabels: true, includeNodes: false, includeOverlays: false }).w; + theNode.labelHeight = theChild.boundingBox({ includeLabels: true, includeNodes: false, includeOverlays: false }).h; + theNode.labelPosVertical = theChild.css("text-valign"); + theNode.labelPosHorizontal = theChild.css("text-halign"); + } + 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 = void 0; + theNewGraph = layout6.getGraphManager().add(layout6.newGraph(), theNode); + processChildrenList2(theNewGraph, children_of_children, layout6, options4); + } + } + }, "processChildrenList"); + var processEdges = /* @__PURE__ */ __name(function processEdges2(layout6, gm2, edges6) { + var idealLengthTotal = 0; + var edgeCount4 = 0; + for (var i2 = 0; i2 < edges6.length; i2++) { + var edge = edges6[i2]; + var sourceNode = idToLNode[edge.data("source")]; + var targetNode = idToLNode[edge.data("target")]; + if (sourceNode && targetNode && sourceNode !== targetNode && sourceNode.getEdgesBetween(targetNode).length == 0) { + var e1 = gm2.add(layout6.newEdge(), sourceNode, targetNode); + e1.id = edge.id(); + e1.idealLength = optFn(options3.idealEdgeLength, edge); + e1.edgeElasticity = optFn(options3.edgeElasticity, edge); + idealLengthTotal += e1.idealLength; + edgeCount4++; + } + } + if (options3.idealEdgeLength != null) { + if (edgeCount4 > 0) CoSEConstants.DEFAULT_EDGE_LENGTH = FDLayoutConstants.DEFAULT_EDGE_LENGTH = idealLengthTotal / edgeCount4; + else if (!isFn(options3.idealEdgeLength)) + CoSEConstants.DEFAULT_EDGE_LENGTH = FDLayoutConstants.DEFAULT_EDGE_LENGTH = options3.idealEdgeLength; + else + CoSEConstants.DEFAULT_EDGE_LENGTH = FDLayoutConstants.DEFAULT_EDGE_LENGTH = 50; + CoSEConstants.MIN_REPULSION_DIST = FDLayoutConstants.MIN_REPULSION_DIST = FDLayoutConstants.DEFAULT_EDGE_LENGTH / 10; + CoSEConstants.DEFAULT_RADIAL_SEPARATION = FDLayoutConstants.DEFAULT_EDGE_LENGTH; + } + }, "processEdges"); + var processConstraints = /* @__PURE__ */ __name(function processConstraints2(layout6, options4) { + if (options4.fixedNodeConstraint) { + layout6.constraints["fixedNodeConstraint"] = options4.fixedNodeConstraint; + } + if (options4.alignmentConstraint) { + layout6.constraints["alignmentConstraint"] = options4.alignmentConstraint; + } + if (options4.relativePlacementConstraint) { + layout6.constraints["relativePlacementConstraint"] = options4.relativePlacementConstraint; + } + }, "processConstraints"); + 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.tilingCompareBy != null) CoSEConstants.TILING_COMPARE_BY = options3.tilingCompareBy; + if (options3.quality == "proof") LayoutConstants.QUALITY = 2; + else LayoutConstants.QUALITY = 0; + 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; + CoSEConstants.DEFAULT_INCREMENTAL = FDLayoutConstants.DEFAULT_INCREMENTAL = LayoutConstants.DEFAULT_INCREMENTAL = true; + CoSEConstants.PURE_INCREMENTAL = !options3.randomize; + LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES = options3.uniformNodeDimensions; + if (options3.step == "transformed") { + CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = true; + CoSEConstants.ENFORCE_CONSTRAINTS = false; + CoSEConstants.APPLY_LAYOUT = false; + } + if (options3.step == "enforced") { + CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = false; + CoSEConstants.ENFORCE_CONSTRAINTS = true; + CoSEConstants.APPLY_LAYOUT = false; + } + if (options3.step == "cose") { + CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = false; + CoSEConstants.ENFORCE_CONSTRAINTS = false; + CoSEConstants.APPLY_LAYOUT = true; + } + if (options3.step == "all") { + if (options3.randomize) CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = true; + else CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = false; + CoSEConstants.ENFORCE_CONSTRAINTS = true; + CoSEConstants.APPLY_LAYOUT = true; + } + if (options3.fixedNodeConstraint || options3.alignmentConstraint || options3.relativePlacementConstraint) { + CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL = false; } else { - gridForPrunedNode = 3; + CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL = true; } - } else { - if (random2 == 0) { - gridForPrunedNode = 2; + var coseLayout3 = new CoSELayout(); + var gm = coseLayout3.newGraphManager(); + processChildrenList(gm.addRoot(), aux.getTopMostNodes(nodes6), coseLayout3, options3); + processEdges(coseLayout3, gm, edges5); + processConstraints(coseLayout3, options3); + coseLayout3.runLayout(); + return idToLNode; + }, "coseLayout"); + module3.exports = { coseLayout }; + } + ), + /***/ + 212: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + 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; + 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); + return Constructor; + }; + }(); + function _classCallCheck2(instance2, Constructor) { + if (!(instance2 instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + __name(_classCallCheck2, "_classCallCheck"); + var assign7 = __webpack_require__2(658); + var aux = __webpack_require__2(548); + var _require = __webpack_require__2(657), spectralLayout = _require.spectralLayout; + var _require2 = __webpack_require__2(816), coseLayout = _require2.coseLayout; + var defaults4 = Object.freeze({ + // 'draft', 'default' or 'proof' + // - 'draft' only applies spectral layout + // - 'default' improves the quality with subsequent CoSE layout (fast cooling rate) + // - 'proof' improves the quality with subsequent CoSE layout (slow cooling rate) + quality: "default", + // Use random node positions at beginning of layout + // if this is set to false, then quality option must be "proof" + randomize: true, + // Whether or not to animate the layout + animate: true, + // Duration of animation in ms, if enabled + animationDuration: 1e3, + // Easing of animation, if enabled + animationEasing: void 0, + // Fit the viewport to the repositioned nodes + fit: true, + // Padding around layout + padding: 30, + // Whether to include labels in node dimensions. Valid in "proof" quality + nodeDimensionsIncludeLabels: false, + // Whether or not simple nodes (non-compound nodes) are of uniform dimensions + uniformNodeDimensions: false, + // Whether to pack disconnected components - valid only if randomize: true + packComponents: true, + // Layout step - all, transformed, enforced, cose - for debug purpose only + step: "all", + /* spectral layout options */ + // False for random, true for greedy + samplingType: true, + // Sample size to construct distance matrix + sampleSize: 25, + // Separation amount between nodes + nodeSeparation: 75, + // Power iteration tolerance + piTol: 1e-7, + /* CoSE layout options */ + // Node repulsion (non overlapping) multiplier + nodeRepulsion: /* @__PURE__ */ __name(function nodeRepulsion4(node2) { + return 4500; + }, "nodeRepulsion"), + // Ideal edge (non nested) length + idealEdgeLength: /* @__PURE__ */ __name(function idealEdgeLength2(edge) { + return 50; + }, "idealEdgeLength"), + // Divisor to compute edge forces + edgeElasticity: /* @__PURE__ */ __name(function edgeElasticity2(edge) { + return 0.45; + }, "edgeElasticity"), + // 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, + // The function that specifies the criteria for comparing nodes while sorting them during tiling operation. + // Takes the node id as a parameter and the default tiling operation is perfomed when this option is not set. + tilingCompareBy: void 0, + // 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.3, + /* constraint options */ + // Fix required nodes to predefined positions + // [{nodeId: 'n1', position: {x: 100, y: 200}, {...}] + fixedNodeConstraint: void 0, + // Align required nodes in vertical/horizontal direction + // {vertical: [['n1', 'n2')], ['n3', 'n4']], horizontal: ['n2', 'n4']} + alignmentConstraint: void 0, + // Place two nodes relatively in vertical/horizontal direction + // [{top: 'n1', bottom: 'n2', gap: 100}, {left: 'n3', right: 'n4', gap: 75}] + relativePlacementConstraint: void 0, + /* layout event callbacks */ + ready: /* @__PURE__ */ __name(function ready4() { + }, "ready"), + // on layoutready + stop: /* @__PURE__ */ __name(function stop5() { + }, "stop") + // on layoutstop + }); + var Layout2 = function() { + function Layout3(options3) { + _classCallCheck2(this, Layout3); + this.options = assign7({}, defaults4, options3); + } + __name(Layout3, "Layout"); + _createClass2(Layout3, [{ + key: "run", + value: /* @__PURE__ */ __name(function run5() { + var layout6 = this; + var options3 = this.options; + var cy = options3.cy; + var eles = options3.eles; + var spectralResult = []; + var xCoords = void 0; + var yCoords = void 0; + var coseResult = []; + var components3 = void 0; + var componentCenters = []; + if (options3.fixedNodeConstraint && (!Array.isArray(options3.fixedNodeConstraint) || options3.fixedNodeConstraint.length == 0)) { + options3.fixedNodeConstraint = void 0; + } + if (options3.alignmentConstraint) { + if (options3.alignmentConstraint.vertical && (!Array.isArray(options3.alignmentConstraint.vertical) || options3.alignmentConstraint.vertical.length == 0)) { + options3.alignmentConstraint.vertical = void 0; + } + if (options3.alignmentConstraint.horizontal && (!Array.isArray(options3.alignmentConstraint.horizontal) || options3.alignmentConstraint.horizontal.length == 0)) { + options3.alignmentConstraint.horizontal = void 0; + } + } + if (options3.relativePlacementConstraint && (!Array.isArray(options3.relativePlacementConstraint) || options3.relativePlacementConstraint.length == 0)) { + options3.relativePlacementConstraint = void 0; + } + var constraintExist = options3.fixedNodeConstraint || options3.alignmentConstraint || options3.relativePlacementConstraint; + if (constraintExist) { + options3.tile = false; + options3.packComponents = false; + } + var layUtil = void 0; + var packingEnabled = false; + if (cy.layoutUtilities && options3.packComponents) { + layUtil = cy.layoutUtilities("get"); + if (!layUtil) layUtil = cy.layoutUtilities(); + packingEnabled = true; + } + if (eles.nodes().length > 0) { + if (!packingEnabled) { + var boundingBox3 = options3.eles.boundingBox(); + componentCenters.push({ x: boundingBox3.x1 + boundingBox3.w / 2, y: boundingBox3.y1 + boundingBox3.h / 2 }); + if (options3.randomize) { + var result = spectralLayout(options3); + spectralResult.push(result); + } + if (options3.quality == "default" || options3.quality == "proof") { + coseResult.push(coseLayout(options3, spectralResult[0])); + aux.relocateComponent(componentCenters[0], coseResult[0], options3); + } else { + aux.relocateComponent(componentCenters[0], spectralResult[0], options3); + } + } else { + var topMostNodes = aux.getTopMostNodes(options3.eles.nodes()); + components3 = aux.connectComponents(cy, options3.eles, topMostNodes); + components3.forEach(function(component2) { + var boundingBox4 = component2.boundingBox(); + componentCenters.push({ x: boundingBox4.x1 + boundingBox4.w / 2, y: boundingBox4.y1 + boundingBox4.h / 2 }); + }); + if (options3.randomize) { + components3.forEach(function(component2) { + options3.eles = component2; + spectralResult.push(spectralLayout(options3)); + }); + } + if (options3.quality == "default" || options3.quality == "proof") { + var toBeTiledNodes = cy.collection(); + if (options3.tile) { + var nodeIndexes = /* @__PURE__ */ new Map(); + var _xCoords = []; + var _yCoords = []; + var count = 0; + var tempSpectralResult = { nodeIndexes, xCoords: _xCoords, yCoords: _yCoords }; + var indexesToBeDeleted = []; + components3.forEach(function(component2, index) { + if (component2.edges().length == 0) { + component2.nodes().forEach(function(node2, i3) { + toBeTiledNodes.merge(component2.nodes()[i3]); + if (!node2.isParent()) { + tempSpectralResult.nodeIndexes.set(component2.nodes()[i3].id(), count++); + tempSpectralResult.xCoords.push(component2.nodes()[0].position().x); + tempSpectralResult.yCoords.push(component2.nodes()[0].position().y); + } + }); + indexesToBeDeleted.push(index); + } + }); + if (toBeTiledNodes.length > 1) { + var _boundingBox = toBeTiledNodes.boundingBox(); + componentCenters.push({ x: _boundingBox.x1 + _boundingBox.w / 2, y: _boundingBox.y1 + _boundingBox.h / 2 }); + components3.push(toBeTiledNodes); + spectralResult.push(tempSpectralResult); + for (var i2 = indexesToBeDeleted.length - 1; i2 >= 0; i2--) { + components3.splice(indexesToBeDeleted[i2], 1); + spectralResult.splice(indexesToBeDeleted[i2], 1); + componentCenters.splice(indexesToBeDeleted[i2], 1); + } + ; + } + } + components3.forEach(function(component2, index) { + options3.eles = component2; + coseResult.push(coseLayout(options3, spectralResult[index])); + aux.relocateComponent(componentCenters[index], coseResult[index], options3); + }); + } else { + components3.forEach(function(component2, index) { + aux.relocateComponent(componentCenters[index], spectralResult[index], options3); + }); + } + var componentsEvaluated = /* @__PURE__ */ new Set(); + if (components3.length > 1) { + var subgraphs = []; + var hiddenEles = eles.filter(function(ele) { + return ele.css("display") == "none"; + }); + components3.forEach(function(component2, index) { + var nodeIndexes2 = void 0; + if (options3.quality == "draft") { + nodeIndexes2 = spectralResult[index].nodeIndexes; + } + if (component2.nodes().not(hiddenEles).length > 0) { + var subgraph = {}; + subgraph.edges = []; + subgraph.nodes = []; + var nodeIndex = void 0; + component2.nodes().not(hiddenEles).forEach(function(node2) { + if (options3.quality == "draft") { + if (!node2.isParent()) { + nodeIndex = nodeIndexes2.get(node2.id()); + subgraph.nodes.push({ x: spectralResult[index].xCoords[nodeIndex] - node2.boundingbox().w / 2, y: spectralResult[index].yCoords[nodeIndex] - node2.boundingbox().h / 2, width: node2.boundingbox().w, height: node2.boundingbox().h }); + } else { + var parentInfo = aux.calcBoundingBox(node2, spectralResult[index].xCoords, spectralResult[index].yCoords, nodeIndexes2); + subgraph.nodes.push({ x: parentInfo.topLeftX, y: parentInfo.topLeftY, width: parentInfo.width, height: parentInfo.height }); + } + } else { + if (coseResult[index][node2.id()]) { + subgraph.nodes.push({ x: coseResult[index][node2.id()].getLeft(), y: coseResult[index][node2.id()].getTop(), width: coseResult[index][node2.id()].getWidth(), height: coseResult[index][node2.id()].getHeight() }); + } + } + }); + component2.edges().forEach(function(edge) { + var source = edge.source(); + var target = edge.target(); + if (source.css("display") != "none" && target.css("display") != "none") { + if (options3.quality == "draft") { + var sourceNodeIndex = nodeIndexes2.get(source.id()); + var targetNodeIndex = nodeIndexes2.get(target.id()); + var sourceCenter = []; + var targetCenter = []; + if (source.isParent()) { + var parentInfo = aux.calcBoundingBox(source, spectralResult[index].xCoords, spectralResult[index].yCoords, nodeIndexes2); + sourceCenter.push(parentInfo.topLeftX + parentInfo.width / 2); + sourceCenter.push(parentInfo.topLeftY + parentInfo.height / 2); + } else { + sourceCenter.push(spectralResult[index].xCoords[sourceNodeIndex]); + sourceCenter.push(spectralResult[index].yCoords[sourceNodeIndex]); + } + if (target.isParent()) { + var _parentInfo = aux.calcBoundingBox(target, spectralResult[index].xCoords, spectralResult[index].yCoords, nodeIndexes2); + targetCenter.push(_parentInfo.topLeftX + _parentInfo.width / 2); + targetCenter.push(_parentInfo.topLeftY + _parentInfo.height / 2); + } else { + targetCenter.push(spectralResult[index].xCoords[targetNodeIndex]); + targetCenter.push(spectralResult[index].yCoords[targetNodeIndex]); + } + subgraph.edges.push({ startX: sourceCenter[0], startY: sourceCenter[1], endX: targetCenter[0], endY: targetCenter[1] }); + } else { + if (coseResult[index][source.id()] && coseResult[index][target.id()]) { + subgraph.edges.push({ startX: coseResult[index][source.id()].getCenterX(), startY: coseResult[index][source.id()].getCenterY(), endX: coseResult[index][target.id()].getCenterX(), endY: coseResult[index][target.id()].getCenterY() }); + } + } + } + }); + if (subgraph.nodes.length > 0) { + subgraphs.push(subgraph); + componentsEvaluated.add(index); + } + } + }); + var shiftResult = layUtil.packComponents(subgraphs, options3.randomize).shifts; + if (options3.quality == "draft") { + spectralResult.forEach(function(result2, index) { + var newXCoords = result2.xCoords.map(function(x5) { + return x5 + shiftResult[index].dx; + }); + var newYCoords = result2.yCoords.map(function(y5) { + return y5 + shiftResult[index].dy; + }); + result2.xCoords = newXCoords; + result2.yCoords = newYCoords; + }); + } else { + var _count = 0; + componentsEvaluated.forEach(function(index) { + Object.keys(coseResult[index]).forEach(function(item) { + var nodeRectangle = coseResult[index][item]; + nodeRectangle.setCenter(nodeRectangle.getCenterX() + shiftResult[_count].dx, nodeRectangle.getCenterY() + shiftResult[_count].dy); + }); + _count++; + }); + } + } + } + } + var getPositions = /* @__PURE__ */ __name(function getPositions2(ele, i3) { + if (options3.quality == "default" || options3.quality == "proof") { + if (typeof ele === "number") { + ele = i3; + } + var pos = void 0; + var node2 = void 0; + var theId = ele.data("id"); + coseResult.forEach(function(result2) { + if (theId in result2) { + pos = { x: result2[theId].getRect().getCenterX(), y: result2[theId].getRect().getCenterY() }; + node2 = result2[theId]; + } + }); + if (options3.nodeDimensionsIncludeLabels) { + if (node2.labelWidth) { + if (node2.labelPosHorizontal == "left") { + pos.x += node2.labelWidth / 2; + } else if (node2.labelPosHorizontal == "right") { + pos.x -= node2.labelWidth / 2; + } + } + if (node2.labelHeight) { + if (node2.labelPosVertical == "top") { + pos.y += node2.labelHeight / 2; + } else if (node2.labelPosVertical == "bottom") { + pos.y -= node2.labelHeight / 2; + } + } + } + if (pos == void 0) pos = { x: ele.position("x"), y: ele.position("y") }; + return { + x: pos.x, + y: pos.y + }; + } else { + var _pos = void 0; + spectralResult.forEach(function(result2) { + var index = result2.nodeIndexes.get(ele.id()); + if (index != void 0) { + _pos = { x: result2.xCoords[index], y: result2.yCoords[index] }; + } + }); + if (_pos == void 0) _pos = { x: ele.position("x"), y: ele.position("y") }; + return { + x: _pos.x, + y: _pos.y + }; + } + }, "getPositions"); + if (options3.quality == "default" || options3.quality == "proof" || options3.randomize) { + var parentsWithoutChildren = aux.calcParentsWithoutChildren(cy, eles); + var _hiddenEles = eles.filter(function(ele) { + return ele.css("display") == "none"; + }); + options3.eles = eles.not(_hiddenEles); + eles.nodes().not(":parent").not(_hiddenEles).layoutPositions(layout6, options3, getPositions); + if (parentsWithoutChildren.length > 0) { + parentsWithoutChildren.forEach(function(ele) { + ele.position(getPositions(ele)); + }); + } + } else { + console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'."); + } + }, "run") + }]); + return Layout3; + }(); + module3.exports = Layout2; + } + ), + /***/ + 657: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var aux = __webpack_require__2(548); + var Matrix = __webpack_require__2(140).layoutBase.Matrix; + var SVD = __webpack_require__2(140).layoutBase.SVD; + var spectralLayout = /* @__PURE__ */ __name(function spectralLayout2(options3) { + var cy = options3.cy; + var eles = options3.eles; + var nodes6 = eles.nodes(); + var parentNodes = eles.nodes(":parent"); + var dummyNodes = /* @__PURE__ */ new Map(); + var nodeIndexes = /* @__PURE__ */ new Map(); + var parentChildMap = /* @__PURE__ */ new Map(); + var allNodesNeighborhood = []; + var xCoords = []; + var yCoords = []; + var samplesColumn = []; + var minDistancesColumn = []; + var C2 = []; + var PHI = []; + var INV = []; + var firstSample = void 0; + var nodeSize = void 0; + var infinity = 1e8; + var small = 1e-9; + var piTol = options3.piTol; + var samplingType = options3.samplingType; + var nodeSeparation = options3.nodeSeparation; + var sampleSize = void 0; + var randomSampleCR = /* @__PURE__ */ __name(function randomSampleCR2() { + var sample2 = 0; + var count = 0; + var flag = false; + while (count < sampleSize) { + sample2 = Math.floor(Math.random() * nodeSize); + flag = false; + for (var i3 = 0; i3 < count; i3++) { + if (samplesColumn[i3] == sample2) { + flag = true; + break; + } + } + if (!flag) { + samplesColumn[count] = sample2; + count++; + } else { + continue; + } + } + }, "randomSampleCR"); + var BFS = /* @__PURE__ */ __name(function BFS2(pivot, index2, samplingMethod) { + var path4 = []; + var front = 0; + var back = 0; + var current = 0; + var temp = void 0; + var distance2 = []; + var max_dist = 0; + var max_ind = 1; + for (var i3 = 0; i3 < nodeSize; i3++) { + distance2[i3] = infinity; + } + path4[back] = pivot; + distance2[pivot] = 0; + while (back >= front) { + current = path4[front++]; + var neighbors = allNodesNeighborhood[current]; + for (var _i = 0; _i < neighbors.length; _i++) { + temp = nodeIndexes.get(neighbors[_i]); + if (distance2[temp] == infinity) { + distance2[temp] = distance2[current] + 1; + path4[++back] = temp; + } + } + C2[current][index2] = distance2[current] * nodeSeparation; + } + if (samplingMethod) { + for (var _i2 = 0; _i2 < nodeSize; _i2++) { + if (C2[_i2][index2] < minDistancesColumn[_i2]) minDistancesColumn[_i2] = C2[_i2][index2]; + } + for (var _i3 = 0; _i3 < nodeSize; _i3++) { + if (minDistancesColumn[_i3] > max_dist) { + max_dist = minDistancesColumn[_i3]; + max_ind = _i3; + } + } + } + return max_ind; + }, "BFS"); + var allBFS = /* @__PURE__ */ __name(function allBFS2(samplingMethod) { + var sample2 = void 0; + if (!samplingMethod) { + randomSampleCR(); + for (var i3 = 0; i3 < sampleSize; i3++) { + BFS(samplesColumn[i3], i3, samplingMethod, false); + } + } else { + sample2 = Math.floor(Math.random() * nodeSize); + firstSample = sample2; + for (var _i4 = 0; _i4 < nodeSize; _i4++) { + minDistancesColumn[_i4] = infinity; + } + for (var _i5 = 0; _i5 < sampleSize; _i5++) { + samplesColumn[_i5] = sample2; + sample2 = BFS(sample2, _i5, samplingMethod); + } + } + for (var _i6 = 0; _i6 < nodeSize; _i6++) { + for (var j2 = 0; j2 < sampleSize; j2++) { + C2[_i6][j2] *= C2[_i6][j2]; + } + } + for (var _i7 = 0; _i7 < sampleSize; _i7++) { + PHI[_i7] = []; + } + for (var _i8 = 0; _i8 < sampleSize; _i8++) { + for (var _j = 0; _j < sampleSize; _j++) { + PHI[_i8][_j] = C2[samplesColumn[_j]][_i8]; + } + } + }, "allBFS"); + var sample = /* @__PURE__ */ __name(function sample2() { + var SVDResult = SVD.svd(PHI); + var a_q = SVDResult.S; + var a_u = SVDResult.U; + var a_v = SVDResult.V; + var max_s = a_q[0] * a_q[0] * a_q[0]; + var a_Sig = []; + for (var i3 = 0; i3 < sampleSize; i3++) { + a_Sig[i3] = []; + for (var j2 = 0; j2 < sampleSize; j2++) { + a_Sig[i3][j2] = 0; + if (i3 == j2) { + a_Sig[i3][j2] = a_q[i3] / (a_q[i3] * a_q[i3] + max_s / (a_q[i3] * a_q[i3])); + } + } + } + INV = Matrix.multMat(Matrix.multMat(a_v, a_Sig), Matrix.transpose(a_u)); + }, "sample"); + var powerIteration = /* @__PURE__ */ __name(function powerIteration2() { + var theta1 = void 0; + var theta2 = void 0; + var Y1 = []; + var Y22 = []; + var V1 = []; + var V2 = []; + for (var i3 = 0; i3 < nodeSize; i3++) { + Y1[i3] = Math.random(); + Y22[i3] = Math.random(); + } + Y1 = Matrix.normalize(Y1); + Y22 = Matrix.normalize(Y22); + var count = 0; + var current = small; + var previous = small; + var temp = void 0; + while (true) { + count++; + for (var _i9 = 0; _i9 < nodeSize; _i9++) { + V1[_i9] = Y1[_i9]; + } + Y1 = Matrix.multGamma(Matrix.multL(Matrix.multGamma(V1), C2, INV)); + theta1 = Matrix.dotProduct(V1, Y1); + Y1 = Matrix.normalize(Y1); + current = Matrix.dotProduct(V1, Y1); + temp = Math.abs(current / previous); + if (temp <= 1 + piTol && temp >= 1) { + break; + } + previous = current; + } + for (var _i10 = 0; _i10 < nodeSize; _i10++) { + V1[_i10] = Y1[_i10]; + } + count = 0; + previous = small; + while (true) { + count++; + for (var _i11 = 0; _i11 < nodeSize; _i11++) { + V2[_i11] = Y22[_i11]; + } + V2 = Matrix.minusOp(V2, Matrix.multCons(V1, Matrix.dotProduct(V1, V2))); + Y22 = Matrix.multGamma(Matrix.multL(Matrix.multGamma(V2), C2, INV)); + theta2 = Matrix.dotProduct(V2, Y22); + Y22 = Matrix.normalize(Y22); + current = Matrix.dotProduct(V2, Y22); + temp = Math.abs(current / previous); + if (temp <= 1 + piTol && temp >= 1) { + break; + } + previous = current; + } + for (var _i12 = 0; _i12 < nodeSize; _i12++) { + V2[_i12] = Y22[_i12]; + } + xCoords = Matrix.multCons(V1, Math.sqrt(Math.abs(theta1))); + yCoords = Matrix.multCons(V2, Math.sqrt(Math.abs(theta2))); + }, "powerIteration"); + aux.connectComponents(cy, eles, aux.getTopMostNodes(nodes6), dummyNodes); + parentNodes.forEach(function(ele) { + aux.connectComponents(cy, eles, aux.getTopMostNodes(ele.descendants().intersection(eles)), dummyNodes); + }); + var index = 0; + for (var i2 = 0; i2 < nodes6.length; i2++) { + if (!nodes6[i2].isParent()) { + nodeIndexes.set(nodes6[i2].id(), index++); + } + } + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = void 0; + try { + for (var _iterator = dummyNodes.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var key = _step.value; + nodeIndexes.set(key, index++); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + for (var _i13 = 0; _i13 < nodeIndexes.size; _i13++) { + allNodesNeighborhood[_i13] = []; + } + parentNodes.forEach(function(ele) { + var children2 = ele.children().intersection(eles); + while (children2.nodes(":childless").length == 0) { + children2 = children2.nodes()[0].children().intersection(eles); + } + var index2 = 0; + var min9 = children2.nodes(":childless")[0].connectedEdges().length; + children2.nodes(":childless").forEach(function(ele2, i3) { + if (ele2.connectedEdges().length < min9) { + min9 = ele2.connectedEdges().length; + index2 = i3; + } + }); + parentChildMap.set(ele.id(), children2.nodes(":childless")[index2].id()); + }); + nodes6.forEach(function(ele) { + var eleIndex = void 0; + if (ele.isParent()) eleIndex = nodeIndexes.get(parentChildMap.get(ele.id())); + else eleIndex = nodeIndexes.get(ele.id()); + ele.neighborhood().nodes().forEach(function(node2) { + if (eles.intersection(ele.edgesWith(node2)).length > 0) { + if (node2.isParent()) allNodesNeighborhood[eleIndex].push(parentChildMap.get(node2.id())); + else allNodesNeighborhood[eleIndex].push(node2.id()); + } + }); + }); + var _loop = /* @__PURE__ */ __name(function _loop2(_key2) { + var eleIndex = nodeIndexes.get(_key2); + var disconnectedId = void 0; + dummyNodes.get(_key2).forEach(function(id27) { + if (cy.getElementById(id27).isParent()) disconnectedId = parentChildMap.get(id27); + else disconnectedId = id27; + allNodesNeighborhood[eleIndex].push(disconnectedId); + allNodesNeighborhood[nodeIndexes.get(disconnectedId)].push(_key2); + }); + }, "_loop"); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = void 0; + try { + for (var _iterator2 = dummyNodes.keys()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var _key = _step2.value; + _loop(_key); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + nodeSize = nodeIndexes.size; + var spectralResult = void 0; + if (nodeSize > 2) { + sampleSize = nodeSize < options3.sampleSize ? nodeSize : options3.sampleSize; + for (var _i14 = 0; _i14 < nodeSize; _i14++) { + C2[_i14] = []; + } + for (var _i15 = 0; _i15 < sampleSize; _i15++) { + INV[_i15] = []; + } + if (options3.quality == "draft" || options3.step == "all") { + allBFS(samplingType); + sample(); + powerIteration(); + spectralResult = { nodeIndexes, xCoords, yCoords }; + } else { + nodeIndexes.forEach(function(value2, key2) { + xCoords.push(cy.getElementById(key2).position("x")); + yCoords.push(cy.getElementById(key2).position("y")); + }); + spectralResult = { nodeIndexes, xCoords, yCoords }; + } + return spectralResult; } else { - gridForPrunedNode = 3; + var iterator = nodeIndexes.keys(); + var firstNode = cy.getElementById(iterator.next().value); + var firstNodePos = firstNode.position(); + var firstNodeWidth = firstNode.outerWidth(); + xCoords.push(firstNodePos.x); + yCoords.push(firstNodePos.y); + if (nodeSize == 2) { + var secondNode = cy.getElementById(iterator.next().value); + var secondNodeWidth = secondNode.outerWidth(); + xCoords.push(firstNodePos.x + firstNodeWidth / 2 + secondNodeWidth / 2 + options3.idealEdgeLength); + yCoords.push(firstNodePos.y); + } + spectralResult = { nodeIndexes, xCoords, yCoords }; + return spectralResult; + } + }, "spectralLayout"); + module3.exports = { spectralLayout }; + } + ), + /***/ + 579: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var impl2 = __webpack_require__2(212); + var register = /* @__PURE__ */ __name(function register2(cytoscape4) { + if (!cytoscape4) { + return; } + cytoscape4("layout", "fcose", impl2); + }, "register"); + if (typeof cytoscape !== "undefined") { + register(cytoscape); + } + module3.exports = register; + } + ), + /***/ + 140: ( + /***/ + (module3) => { + module3.exports = __WEBPACK_EXTERNAL_MODULE__140__; + } + ) + /******/ + }; + var __webpack_module_cache__ = {}; + function __webpack_require__(moduleId) { + var cachedModule = __webpack_module_cache__[moduleId]; + if (cachedModule !== void 0) { + return cachedModule.exports; + } + var module3 = __webpack_module_cache__[moduleId] = { + /******/ + // no module.id needed + /******/ + // no module.loaded needed + /******/ + exports: {} + /******/ + }; + __webpack_modules__[moduleId](module3, module3.exports, __webpack_require__); + return module3.exports; + } + __name(__webpack_require__, "__webpack_require__"); + var __webpack_exports__ = __webpack_require__(579); + return __webpack_exports__; + })() + ); + }); + } + }); + + // src/diagrams/architecture/architectureIcons.ts + var wrapIcon, architectureIcons; + var init_architectureIcons = __esm({ + "src/diagrams/architecture/architectureIcons.ts"() { + "use strict"; + init_icons(); + wrapIcon = /* @__PURE__ */ __name((icon) => { + return `${icon}`; + }, "wrapIcon"); + architectureIcons = { + prefix: "mermaid-architecture", + height: 80, + width: 80, + icons: { + database: { + body: wrapIcon( + '' + ) + }, + server: { + body: wrapIcon( + '' + ) + }, + disk: { + body: wrapIcon( + '' + ) + }, + internet: { + body: wrapIcon( + '' + ) + }, + cloud: { + body: wrapIcon( + '' + ) + }, + unknown: unknownIcon, + blank: { + body: wrapIcon("") + } + } + }; + } + }); + + // src/diagrams/architecture/svgDraw.ts + var drawEdges2, drawGroups, drawServices, drawJunctions; + var init_svgDraw7 = __esm({ + "src/diagrams/architecture/svgDraw.ts"() { + "use strict"; + init_icons(); + init_diagramAPI(); + init_createText(); + init_architectureDb(); + init_architectureIcons(); + init_architectureTypes(); + drawEdges2 = /* @__PURE__ */ __name(async function(edgesEl, cy) { + const padding3 = getConfigField("padding"); + const iconSize = getConfigField("iconSize"); + const halfIconSize = iconSize / 2; + const arrowSize = iconSize / 6; + const halfArrowSize = arrowSize / 2; + await Promise.all( + cy.edges().map(async (edge) => { + const { + source, + sourceDir, + sourceArrow, + sourceGroup, + target, + targetDir, + targetArrow, + targetGroup, + label + } = edgeData(edge); + let { x: startX2, y: startY2 } = edge[0].sourceEndpoint(); + const { x: midX, y: midY } = edge[0].midpoint(); + let { x: endX, y: endY } = edge[0].targetEndpoint(); + const groupEdgeShift = padding3 + 4; + if (sourceGroup) { + if (isArchitectureDirectionX(sourceDir)) { + startX2 += sourceDir === "L" ? -groupEdgeShift : groupEdgeShift; + } else { + startY2 += sourceDir === "T" ? -groupEdgeShift : groupEdgeShift + 18; + } + } + if (targetGroup) { + if (isArchitectureDirectionX(targetDir)) { + endX += targetDir === "L" ? -groupEdgeShift : groupEdgeShift; + } else { + endY += targetDir === "T" ? -groupEdgeShift : groupEdgeShift + 18; + } + } + if (!sourceGroup && db7.getNode(source)?.type === "junction") { + if (isArchitectureDirectionX(sourceDir)) { + startX2 += sourceDir === "L" ? halfIconSize : -halfIconSize; + } else { + startY2 += sourceDir === "T" ? halfIconSize : -halfIconSize; + } + } + if (!targetGroup && db7.getNode(target)?.type === "junction") { + if (isArchitectureDirectionX(targetDir)) { + endX += targetDir === "L" ? halfIconSize : -halfIconSize; + } else { + endY += targetDir === "T" ? halfIconSize : -halfIconSize; + } + } + if (edge[0]._private.rscratch) { + const g2 = edgesEl.insert("g"); + g2.insert("path").attr("d", `M ${startX2},${startY2} L ${midX},${midY} L${endX},${endY} `).attr("class", "edge"); + if (sourceArrow) { + const xShift = isArchitectureDirectionX(sourceDir) ? ArchitectureDirectionArrowShift[sourceDir](startX2, arrowSize) : startX2 - halfArrowSize; + const yShift = isArchitectureDirectionY(sourceDir) ? ArchitectureDirectionArrowShift[sourceDir](startY2, arrowSize) : startY2 - halfArrowSize; + g2.insert("polygon").attr("points", ArchitectureDirectionArrow[sourceDir](arrowSize)).attr("transform", `translate(${xShift},${yShift})`).attr("class", "arrow"); + } + if (targetArrow) { + const xShift = isArchitectureDirectionX(targetDir) ? ArchitectureDirectionArrowShift[targetDir](endX, arrowSize) : endX - halfArrowSize; + const yShift = isArchitectureDirectionY(targetDir) ? ArchitectureDirectionArrowShift[targetDir](endY, arrowSize) : endY - halfArrowSize; + g2.insert("polygon").attr("points", ArchitectureDirectionArrow[targetDir](arrowSize)).attr("transform", `translate(${xShift},${yShift})`).attr("class", "arrow"); + } + if (label) { + const axis2 = !isArchitectureDirectionXY(sourceDir, targetDir) ? isArchitectureDirectionX(sourceDir) ? "X" : "Y" : "XY"; + let width3 = 0; + if (axis2 === "X") { + width3 = Math.abs(startX2 - endX); + } else if (axis2 === "Y") { + width3 = Math.abs(startY2 - endY) / 1.5; + } else { + width3 = Math.abs(startX2 - endX) / 2; + } + const textElem = g2.append("g"); + await createText( + textElem, + label, + { + useHtmlLabels: false, + width: width3, + classes: "architecture-service-label" + }, + getConfig2() + ); + textElem.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"); + if (axis2 === "X") { + textElem.attr("transform", "translate(" + midX + ", " + midY + ")"); + } else if (axis2 === "Y") { + textElem.attr("transform", "translate(" + midX + ", " + midY + ") rotate(-90)"); + } else if (axis2 === "XY") { + const pair = getArchitectureDirectionPair(sourceDir, targetDir); + if (pair && isArchitecturePairXY(pair)) { + const bboxOrig = textElem.node().getBoundingClientRect(); + const [x5, y5] = getArchitectureDirectionXYFactors(pair); + textElem.attr("dominant-baseline", "auto").attr("transform", `rotate(${-1 * x5 * y5 * 45})`); + const bboxNew = textElem.node().getBoundingClientRect(); + textElem.attr( + "transform", + ` + translate(${midX}, ${midY - bboxOrig.height / 2}) + translate(${x5 * bboxNew.width / 2}, ${y5 * bboxNew.height / 2}) + rotate(${-1 * x5 * y5 * 45}, 0, ${bboxOrig.height / 2}) + ` + ); + } + } + } + } + }) + ); + }, "drawEdges"); + drawGroups = /* @__PURE__ */ __name(async function(groupsEl, cy) { + const padding3 = getConfigField("padding"); + const groupIconSize = padding3 * 0.75; + const fontSize = getConfigField("fontSize"); + const iconSize = getConfigField("iconSize"); + const halfIconSize = iconSize / 2; + await Promise.all( + cy.nodes().map(async (node2) => { + const data5 = nodeData(node2); + if (data5.type === "group") { + const { h: h2, w: w3, x1, y1 } = node2.boundingBox(); + groupsEl.append("rect").attr("x", x1 + halfIconSize).attr("y", y1 + halfIconSize).attr("width", w3).attr("height", h2).attr("class", "node-bkg"); + const groupLabelContainer = groupsEl.append("g"); + let shiftedX1 = x1; + let shiftedY1 = y1; + if (data5.icon) { + const bkgElem = groupLabelContainer.append("g"); + bkgElem.html( + `${await getIconSVG(data5.icon, { height: groupIconSize, width: groupIconSize, fallbackPrefix: architectureIcons.prefix })}` + ); + bkgElem.attr( + "transform", + "translate(" + (shiftedX1 + halfIconSize + 1) + ", " + (shiftedY1 + halfIconSize + 1) + ")" + ); + shiftedX1 += groupIconSize; + shiftedY1 += fontSize / 2 - 1 - 2; + } + if (data5.label) { + const textElem = groupLabelContainer.append("g"); + await createText( + textElem, + data5.label, + { + useHtmlLabels: false, + width: w3, + classes: "architecture-service-label" + }, + getConfig2() + ); + textElem.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "start").attr("text-anchor", "start"); + textElem.attr( + "transform", + "translate(" + (shiftedX1 + halfIconSize + 4) + ", " + (shiftedY1 + halfIconSize + 2) + ")" + ); + } + } + }) + ); + }, "drawGroups"); + drawServices = /* @__PURE__ */ __name(async function(db8, elem, services) { + for (const service of services) { + const serviceElem = elem.append("g"); + const iconSize = getConfigField("iconSize"); + if (service.title) { + const textElem = serviceElem.append("g"); + await createText( + textElem, + service.title, + { + useHtmlLabels: false, + width: iconSize * 1.5, + classes: "architecture-service-label" + }, + getConfig2() + ); + textElem.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"); + textElem.attr("transform", "translate(" + iconSize / 2 + ", " + iconSize + ")"); + } + const bkgElem = serviceElem.append("g"); + if (service.icon) { + bkgElem.html( + `${await getIconSVG(service.icon, { height: iconSize, width: iconSize, fallbackPrefix: architectureIcons.prefix })}` + ); + } else if (service.iconText) { + bkgElem.html( + `${await getIconSVG("blank", { height: iconSize, width: iconSize, fallbackPrefix: architectureIcons.prefix })}` + ); + const textElemContainer = bkgElem.append("g"); + const fo = textElemContainer.append("foreignObject").attr("width", iconSize).attr("height", iconSize); + const divElem = fo.append("div").attr("class", "node-icon-text").attr("style", `height: ${iconSize}px;`).append("div").html(service.iconText); + const fontSize = parseInt( + window.getComputedStyle(divElem.node(), null).getPropertyValue("font-size").replace(/\D/g, "") + ) ?? 16; + divElem.attr("style", `-webkit-line-clamp: ${Math.floor((iconSize - 2) / fontSize)};`); + } else { + bkgElem.append("path").attr("class", "node-bkg").attr("id", "node-" + service.id).attr( + "d", + `M0 ${iconSize} v${-iconSize} q0,-5 5,-5 h${iconSize} q5,0 5,5 v${iconSize} H0 Z` + ); + } + serviceElem.attr("class", "architecture-service"); + const { width: width3, height: height2 } = serviceElem._groups[0][0].getBBox(); + service.width = width3; + service.height = height2; + db8.setElementForId(service.id, serviceElem); + } + return 0; + }, "drawServices"); + drawJunctions = /* @__PURE__ */ __name(function(db8, elem, junctions) { + junctions.forEach((junction) => { + const junctionElem = elem.append("g"); + const iconSize = getConfigField("iconSize"); + const bkgElem = junctionElem.append("g"); + bkgElem.append("rect").attr("id", "node-" + junction.id).attr("fill-opacity", "0").attr("width", iconSize).attr("height", iconSize); + junctionElem.attr("class", "architecture-junction"); + const { width: width3, height: height2 } = junctionElem._groups[0][0].getBBox(); + junctionElem.width = width3; + junctionElem.height = height2; + db8.setElementForId(junction.id, junctionElem); + }); + }, "drawJunctions"); + } + }); + + // src/diagrams/architecture/architectureRenderer.ts + function addServices(services, cy) { + services.forEach((service) => { + cy.add({ + group: "nodes", + data: { + type: "service", + id: service.id, + icon: service.icon, + label: service.title, + parent: service.in, + width: getConfigField("iconSize"), + height: getConfigField("iconSize") + }, + classes: "node-service" + }); + }); + } + function addJunctions(junctions, cy) { + junctions.forEach((junction) => { + cy.add({ + group: "nodes", + data: { + type: "junction", + id: junction.id, + parent: junction.in, + width: getConfigField("iconSize"), + height: getConfigField("iconSize") + }, + classes: "node-junction" + }); + }); + } + function positionNodes2(db8, cy) { + cy.nodes().map((node2) => { + const data5 = nodeData(node2); + if (data5.type === "group") { + return; + } + data5.x = node2.position().x; + data5.y = node2.position().y; + const nodeElem = db8.getElementById(data5.id); + nodeElem.attr("transform", "translate(" + (data5.x || 0) + "," + (data5.y || 0) + ")"); + }); + } + function addGroups(groups, cy) { + groups.forEach((group2) => { + cy.add({ + group: "nodes", + data: { + type: "group", + id: group2.id, + icon: group2.icon, + label: group2.title, + parent: group2.in + }, + classes: "node-group" + }); + }); + } + function addEdges(edges5, cy) { + edges5.forEach((parsedEdge) => { + const { lhsId, rhsId, lhsInto, lhsGroup, rhsInto, lhsDir, rhsDir, rhsGroup, title: title2 } = parsedEdge; + const edgeType = isArchitectureDirectionXY(parsedEdge.lhsDir, parsedEdge.rhsDir) ? "segments" : "straight"; + const edge = { + id: `${lhsId}-${rhsId}`, + label: title2, + source: lhsId, + sourceDir: lhsDir, + sourceArrow: lhsInto, + sourceGroup: lhsGroup, + sourceEndpoint: lhsDir === "L" ? "0 50%" : lhsDir === "R" ? "100% 50%" : lhsDir === "T" ? "50% 0" : "50% 100%", + target: rhsId, + targetDir: rhsDir, + targetArrow: rhsInto, + targetGroup: rhsGroup, + targetEndpoint: rhsDir === "L" ? "0 50%" : rhsDir === "R" ? "100% 50%" : rhsDir === "T" ? "50% 0" : "50% 100%" + }; + cy.add({ + group: "edges", + data: edge, + classes: edgeType + }); + }); + } + function getAlignments(spatialMaps) { + const alignments = spatialMaps.map((spatialMap) => { + const horizontalAlignments = {}; + const verticalAlignments = {}; + Object.entries(spatialMap).forEach(([id27, [x5, y5]]) => { + if (!horizontalAlignments[y5]) { + horizontalAlignments[y5] = []; + } + if (!verticalAlignments[x5]) { + verticalAlignments[x5] = []; + } + horizontalAlignments[y5].push(id27); + verticalAlignments[x5].push(id27); + }); + return { + horiz: Object.values(horizontalAlignments).filter((arr) => arr.length > 1), + vert: Object.values(verticalAlignments).filter((arr) => arr.length > 1) + }; + }); + const [horizontal, vertical] = alignments.reduce( + ([prevHoriz, prevVert], { horiz, vert }) => { + return [ + [...prevHoriz, ...horiz], + [...prevVert, ...vert] + ]; + }, + [[], []] + ); + return { + horizontal, + vertical + }; + } + function getRelativeConstraints(spatialMaps) { + const relativeConstraints = []; + const posToStr = /* @__PURE__ */ __name((pos) => `${pos[0]},${pos[1]}`, "posToStr"); + const strToPos = /* @__PURE__ */ __name((pos) => pos.split(",").map((p3) => parseInt(p3)), "strToPos"); + spatialMaps.forEach((spatialMap) => { + const invSpatialMap = Object.fromEntries( + Object.entries(spatialMap).map(([id27, pos]) => [posToStr(pos), id27]) + ); + const queue = [posToStr([0, 0])]; + const visited = {}; + const directions = { + L: [-1, 0], + R: [1, 0], + T: [0, 1], + B: [0, -1] + }; + while (queue.length > 0) { + const curr = queue.shift(); + if (curr) { + visited[curr] = 1; + const currId = invSpatialMap[curr]; + if (currId) { + const currPos = strToPos(curr); + Object.entries(directions).forEach(([dir2, shift2]) => { + const newPos = posToStr([currPos[0] + shift2[0], currPos[1] + shift2[1]]); + const newId2 = invSpatialMap[newPos]; + if (newId2 && !visited[newPos]) { + queue.push(newPos); + relativeConstraints.push({ + [ArchitectureDirectionName[dir2]]: newId2, + [ArchitectureDirectionName[getOppositeArchitectureDirection(dir2)]]: currId, + gap: 1.5 * getConfigField("iconSize") + }); + } + }); + } + } + } + }); + return relativeConstraints; + } + function layoutArchitecture(services, junctions, groups, edges5, { spatialMaps }) { + 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"), + style: [ + { + selector: "edge", + style: { + "curve-style": "straight", + label: "data(label)", + "source-endpoint": "data(sourceEndpoint)", + "target-endpoint": "data(targetEndpoint)" + } + }, + { + selector: "edge.segments", + style: { + "curve-style": "segments", + "segment-weights": "0", + "segment-distances": [0.5], + // @ts-ignore Incorrect library types + "edge-distances": "endpoints", + "source-endpoint": "data(sourceEndpoint)", + "target-endpoint": "data(targetEndpoint)" + } + }, + { + selector: "node", + style: { + // @ts-ignore Incorrect library types + "compound-sizing-wrt-labels": "include" + } + }, + { + selector: "node[label]", + style: { + "text-valign": "bottom", + "text-halign": "center", + "font-size": `${getConfigField("fontSize")}px` + } + }, + { + selector: ".node-service", + style: { + label: "data(label)", + width: "data(width)", + height: "data(height)" + } + }, + { + selector: ".node-junction", + style: { + width: "data(width)", + height: "data(height)" + } + }, + { + selector: ".node-group", + style: { + // @ts-ignore Incorrect library types + padding: `${getConfigField("padding")}px` + } + } + ] + }); + renderEl.remove(); + addGroups(groups, cy); + addServices(services, cy); + addJunctions(junctions, cy); + addEdges(edges5, cy); + const alignmentConstraint = getAlignments(spatialMaps); + const relativePlacementConstraint = getRelativeConstraints(spatialMaps); + const layout6 = cy.layout({ + name: "fcose", + quality: "proof", + styleEnabled: false, + animate: false, + nodeDimensionsIncludeLabels: false, + // Adjust the edge parameters if it passes through the border of a group + // Hacky fix for: https://github.com/iVis-at-Bilkent/cytoscape.js-fcose/issues/67 + idealEdgeLength(edge) { + const [nodeA, nodeB] = edge.connectedNodes(); + const { parent: parentA } = nodeData(nodeA); + const { parent: parentB } = nodeData(nodeB); + const elasticity = parentA === parentB ? 1.5 * getConfigField("iconSize") : 0.5 * getConfigField("iconSize"); + return elasticity; + }, + edgeElasticity(edge) { + const [nodeA, nodeB] = edge.connectedNodes(); + const { parent: parentA } = nodeData(nodeA); + const { parent: parentB } = nodeData(nodeB); + const elasticity = parentA === parentB ? 0.45 : 1e-3; + return elasticity; + }, + alignmentConstraint, + relativePlacementConstraint + }); + layout6.one("layoutstop", () => { + function getSegmentWeights(source, target, pointX, pointY) { + let W2, D3; + const { x: sX, y: sY } = source; + const { x: tX, y: tY } = target; + D3 = (pointY - sY + (sX - pointX) * (sY - tY) / (sX - tX)) / Math.sqrt(1 + Math.pow((sY - tY) / (sX - tX), 2)); + W2 = Math.sqrt(Math.pow(pointY - sY, 2) + Math.pow(pointX - sX, 2) - Math.pow(D3, 2)); + const distAB = Math.sqrt(Math.pow(tX - sX, 2) + Math.pow(tY - sY, 2)); + W2 = W2 / distAB; + let delta1 = (tX - sX) * (pointY - sY) - (tY - sY) * (pointX - sX); + switch (true) { + case delta1 >= 0: + delta1 = 1; + break; + case delta1 < 0: + delta1 = -1; + break; + } + let delta2 = (tX - sX) * (pointX - sX) + (tY - sY) * (pointY - sY); + switch (true) { + case delta2 >= 0: + delta2 = 1; + break; + case delta2 < 0: + delta2 = -1; + break; + } + D3 = Math.abs(D3) * delta1; + W2 = W2 * delta2; + return { + distances: D3, + weights: W2 + }; + } + __name(getSegmentWeights, "getSegmentWeights"); + cy.startBatch(); + for (const edge of Object.values(cy.edges())) { + if (edge.data?.()) { + const { x: sX, y: sY } = edge.source().position(); + const { x: tX, y: tY } = edge.target().position(); + if (sX !== tX && sY !== tY) { + const sEP = edge.sourceEndpoint(); + const tEP = edge.targetEndpoint(); + const { sourceDir } = edgeData(edge); + const [pointX, pointY] = isArchitectureDirectionY(sourceDir) ? [sEP.x, tEP.y] : [tEP.x, sEP.y]; + const { weights, distances: distances2 } = getSegmentWeights(sEP, tEP, pointX, pointY); + edge.style("segment-distances", distances2); + edge.style("segment-weights", weights); + } + } + } + cy.endBatch(); + layout6.run(); + }); + layout6.run(); + cy.ready((e3) => { + log.info("Ready", e3); + resolve3(cy); + }); + }); + } + var import_cytoscape_fcose, draw23, renderer7; + var init_architectureRenderer = __esm({ + "src/diagrams/architecture/architectureRenderer.ts"() { + "use strict"; + init_icons(); + init_cytoscape_esm(); + import_cytoscape_fcose = __toESM(require_cytoscape_fcose(), 1); + init_src32(); + init_logger(); + init_selectSvgElement(); + init_setupGraphViewbox(); + init_architectureDb(); + init_architectureIcons(); + init_architectureTypes(); + init_svgDraw7(); + registerIconPacks([ + { + name: architectureIcons.prefix, + icons: architectureIcons + } + ]); + cytoscape2.use(import_cytoscape_fcose.default); + __name(addServices, "addServices"); + __name(addJunctions, "addJunctions"); + __name(positionNodes2, "positionNodes"); + __name(addGroups, "addGroups"); + __name(addEdges, "addEdges"); + __name(getAlignments, "getAlignments"); + __name(getRelativeConstraints, "getRelativeConstraints"); + __name(layoutArchitecture, "layoutArchitecture"); + draw23 = /* @__PURE__ */ __name(async (text2, id27, _version, diagObj) => { + const db8 = diagObj.db; + const services = db8.getServices(); + const junctions = db8.getJunctions(); + const groups = db8.getGroups(); + const edges5 = db8.getEdges(); + const ds = db8.getDataStructures(); + const svg = selectSvgElement(id27); + const edgesElem = svg.append("g"); + edgesElem.attr("class", "architecture-edges"); + const servicesElem = svg.append("g"); + servicesElem.attr("class", "architecture-services"); + const groupElem = svg.append("g"); + groupElem.attr("class", "architecture-groups"); + await drawServices(db8, servicesElem, services); + drawJunctions(db8, servicesElem, junctions); + const cy = await layoutArchitecture(services, junctions, groups, edges5, ds); + await drawEdges2(edgesElem, cy); + await drawGroups(groupElem, cy); + positionNodes2(db8, cy); + setupGraphViewbox(void 0, svg, getConfigField("padding"), getConfigField("useMaxWidth")); + }, "draw"); + renderer7 = { draw: draw23 }; + } + }); + + // src/diagrams/architecture/architectureDiagram.ts + var architectureDiagram_exports = {}; + __export(architectureDiagram_exports, { + diagram: () => diagram23 + }); + var diagram23; + var init_architectureDiagram = __esm({ + "src/diagrams/architecture/architectureDiagram.ts"() { + "use strict"; + init_architectureParser(); + init_architectureDb(); + init_architectureStyles(); + init_architectureRenderer(); + diagram23 = { + parser: parser21, + db: db7, + renderer: renderer7, + styles: architectureStyles_default + }; + } + }); + + // src/mermaid.ts + var mermaid_exports = {}; + __export(mermaid_exports, { + default: () => mermaid_default + }); + init_icons(); + 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: diagram24 } = await Promise.resolve().then(() => (init_c4Diagram2(), c4Diagram_exports)); + return { id: id2, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_flowDiagram(), flowDiagram_exports)); + return { id: id3, diagram: diagram24 }; + }, "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") { + return false; + } + if (config6?.flowchart?.defaultRenderer === "elk") { + config6.layout = "elk"; + } + 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: diagram24 } = await Promise.resolve().then(() => (init_flowDiagram(), flowDiagram_exports)); + return { id: id4, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_erDiagram2(), erDiagram_exports)); + return { id: id5, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_gitGraphDiagram(), gitGraphDiagram_exports)); + return { id: id6, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_ganttDiagram(), ganttDiagram_exports)); + return { id: id7, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_infoDiagram(), infoDiagram_exports)); + return { id: id8, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_pieDiagram(), pieDiagram_exports)); + return { id: id9, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_quadrantDiagram(), quadrantDiagram_exports)); + return { id: id10, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_xychartDiagram(), xychartDiagram_exports)); + return { id: id11, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_requirementDiagram2(), requirementDiagram_exports)); + return { id: id12, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_sequenceDiagram2(), sequenceDiagram_exports)); + return { id: id13, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_classDiagram2(), classDiagram_exports)); + return { id: id14, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_classDiagram_v2(), classDiagram_v2_exports)); + return { id: id15, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_stateDiagram2(), stateDiagram_exports)); + return { id: id16, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_stateDiagram_v2(), stateDiagram_v2_exports)); + return { id: id17, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_journeyDiagram(), journeyDiagram_exports)); + return { id: id18, diagram: diagram24 }; + }, "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, id27, version4) => { + log.debug("rendering svg for syntax error\n"); + const svg = selectSvgElement(id27); + 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: diagram24 } = await Promise.resolve().then(() => (init_flowDiagram(), flowDiagram_exports)); + return { id: id19, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_timeline_definition(), timeline_definition_exports)); + return { id: id20, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_mindmap_definition(), mindmap_definition_exports)); + return { id: id22, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_sankeyDiagram(), sankeyDiagram_exports)); + return { id: id23, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_diagram(), diagram_exports)); + return { id: id24, diagram: diagram24 }; + }, "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: diagram24 } = await Promise.resolve().then(() => (init_blockDiagram(), blockDiagram_exports)); + return { id: id25, diagram: diagram24 }; + }, "loader"); + var plugin20 = { + id: id25, + detector: detector23, + loader: loader23 + }; + var blockDetector_default = plugin20; + + // src/diagrams/architecture/architectureDetector.ts + var id26 = "architecture"; + var detector24 = /* @__PURE__ */ __name((txt) => { + return /^\s*architecture/.test(txt); + }, "detector"); + var loader24 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_architectureDiagram(), architectureDiagram_exports)); + return { id: id26, diagram: diagram24 }; + }, "loader"); + var architecture = { + id: id26, + detector: detector24, + loader: loader24 + }; + var architectureDetector_default = architecture; + + // 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, + architectureDetector_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: detector25, loader: loader26 }]) => { + if (loader26) { + try { + getDiagram(key); + } catch { + try { + const { diagram: diagram24, id: id27 } = await loader26(); + registerDiagram(id27, diagram24, detector25); + } catch (err) { + log.error(`Failed to load external diagram with key ${key}. Removing from detectors.`); + delete detectors[key]; + throw err; + } + } + } + }) + ); + 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.4/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.4/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.4/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.4/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); + if ((token(previous || 1) == 5 || token(peek() || 1) == 5) && strlen(characters2) && substr(characters2, -1, void 0) !== " ") characters2 += " "; + 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 || variable === 0 && previous === 47)) + 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); } - } 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()); - } - }; - module3.exports = CoSELayout; - }, - /* 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; + } + 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.4/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 + var import_dompurify2 = __toESM(require_purify(), 1); + init_isEmpty(); + init_package(); + + // 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/mermaidAPI.ts + init_assignWithDepth(); + init_config(); + + // src/Diagram.ts + init_config(); + init_diagramAPI(); + init_detectType(); + init_errors(); + init_utils2(); + var Diagram = class _Diagram { + constructor(type3, text2, db8, parser22, renderer8) { + this.type = type3; + this.text = text2; + this.db = db8; + this.parser = parser22; + this.renderer = renderer8; + } + 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 loader26 = getDiagramLoader(type3); + if (!loader26) { + throw new UnknownDiagramError(`Diagram ${type3} not found.`); + } + const { id: id27, diagram: diagram24 } = await loader26(); + registerDiagram(id27, diagram24); + } + const { db: db8, parser: parser22, renderer: renderer8, init: init3 } = getDiagram(type3); + if (parser22.parser) { + parser22.parser.yy = db8; + } + db8.clear?.(); + init3?.(config6); + if (metadata.title) { + db8.setDiagramTitle?.(metadata.title); + } + await parser22.parse(text2); + return new _Diagram(type3, text2, db8, parser22, renderer8); + } + async render(id27, version4) { + await this.renderer.draw(this.text, id27, version4, this); + } + getParser() { + return this.parser; + } + getType() { + return this.type; + } + }; + + // src/mermaidAPI.ts + init_common(); + + // src/interactionDb.ts + var interactionFunctions = []; + var attachFunctions = /* @__PURE__ */ __name(() => { + interactionFunctions.forEach((f3) => { + f3(); + }); + interactionFunctions = []; + }, "attachFunctions"); + + // src/mermaidAPI.ts + init_logger(); + + // 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.'); + } + }); + 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; + }); + return result; + } + __name(compileList, "compileList"); + function compileMap() { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, index, length2; + function collectType(type3) { + if (type3.multi) { + result.multi[type3.kind].push(type3); + result.multi["fallback"].push(type3); + } else { + result[type3.kind][type3.tag] = result["fallback"][type3.tag] = type3; + } + } + __name(collectType, "collectType"); + for (index = 0, length2 = arguments.length; index < length2; index += 1) { + arguments[index].forEach(collectType); + } + return result; + } + __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."); + } + }); + 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."); + } + }); + 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"); + } + __name(resolveYamlNull, "resolveYamlNull"); + function constructYamlNull() { + return null; + } + __name(constructYamlNull, "constructYamlNull"); + function isNull(object3) { + return object3 === null; + } + __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 !== "_"; + } + } + if (ch === "_") return false; + for (; index < max10; index++) { + ch = data5[index]; + if (ch === "_") continue; + if (!isDecCode(data5.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + 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, ""); + } + ch = value2[0]; + if (ch === "-" || ch === "+") { + if (ch === "-") sign2 = -1; + value2 = value2.slice(1); + ch = value2[0]; + } + 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); + } + 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"] + } + }); + 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; + } + 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); + } + 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"; + } + res = object3.toString(10); + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res; + } + __name(representYamlFloat, "representYamlFloat"); + function isFloat(object3) { + return Object.prototype.toString.call(object3) === "[object Number]" && (object3 % 1 !== 0 || common.isNegativeZero(object3)); + } + __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; + } + __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; + } + __name(constructYamlTimestamp, "constructYamlTimestamp"); + function representYamlTimestamp(object3) { + return object3.toISOString(); + } + __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; + } + __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); + } + 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; + } + __name(resolveYamlOmap, "resolveYamlOmap"); + function constructYamlOmap(data5) { + return data5 !== null ? data5 : []; + } + __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 true; + } + __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 result; + } + __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 true; + } + __name(resolveYamlSet, "resolveYamlSet"); + function constructYamlSet(data5) { + return data5 !== null ? data5 : {}; + } + __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); + } + __name(_class, "_class"); + function is_EOL(c3) { + return c3 === 10 || c3 === 13; + } + __name(is_EOL, "is_EOL"); + function is_WHITE_SPACE(c3) { + return c3 === 9 || c3 === 32; + } + __name(is_WHITE_SPACE, "is_WHITE_SPACE"); + function is_WS_OR_EOL(c3) { + return c3 === 9 || c3 === 32 || c3 === 10 || c3 === 13; + } + __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; + } + __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; + } + __name(fromHexCode, "fromHexCode"); + function escapedHexLen(c3) { + if (c3 === 120) { + return 2; + } + if (c3 === 117) { + return 4; + } + if (c3 === 85) { + return 8; + } + return 0; + } + __name(escapedHexLen, "escapedHexLen"); + function fromDecimalCode(c3) { + if (48 <= c3 && c3 <= 57) { + return c3 - 48; + } + return -1; + } + __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" : ""; + } + __name(simpleEscapeSequence, "simpleEscapeSequence"); + function charFromCodepoint(c3) { + if (c3 <= 65535) { + return String.fromCharCode(c3); + } + return String.fromCharCode( + (c3 - 65536 >> 10) + 55296, + (c3 - 65536 & 1023) + 56320 + ); + } + __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); + } + 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 = []; + } + __name(State$1, "State$1"); + function generateError(state5, message) { + var mark = { + name: state5.filename, + buffer: state5.input.slice(0, -1), + // omit trailing \0 + position: state5.position, + line: state5.line, + column: state5.position - state5.lineStart + }; + mark.snippet = snippet(mark); + return new exception(message, mark); + } + __name(generateError, "generateError"); + function throwError(state5, message) { + throw generateError(state5, message); + } + __name(throwError, "throwError"); + function throwWarning(state5, message) { + if (state5.onWarning) { + state5.onWarning.call(null, generateError(state5, message)); + } + } + __name(throwWarning, "throwWarning"); + var directiveHandlers = { + YAML: /* @__PURE__ */ __name(function handleYamlDirective(state5, name, args) { + var match2, major, minor; + if (state5.version !== null) { + throwError(state5, "duplication of %YAML directive"); + } + if (args.length !== 1) { + throwError(state5, "YAML directive accepts exactly one argument"); + } + match2 = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + if (match2 === null) { + throwError(state5, "ill-formed argument of the YAML directive"); + } + major = parseInt(match2[1], 10); + minor = parseInt(match2[2], 10); + if (major !== 1) { + throwError(state5, "unacceptable YAML version of the document"); + } + state5.version = args[0]; + state5.checkLineBreaks = minor < 2; + if (minor !== 1 && minor !== 2) { + throwWarning(state5, "unsupported YAML version of the document"); + } + }, "handleYamlDirective"), + TAG: /* @__PURE__ */ __name(function handleTagDirective(state5, name, args) { + var handle, prefix; + if (args.length !== 2) { + throwError(state5, "TAG directive accepts exactly two arguments"); + } + handle = args[0]; + prefix = args[1]; + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state5, "ill-formed tag handle (first argument) of the TAG directive"); + } + if (_hasOwnProperty$1.call(state5.tagMap, handle)) { + throwError(state5, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state5, "ill-formed tag prefix (second argument) of the TAG directive"); + } + try { + prefix = decodeURIComponent(prefix); + } catch (err) { + throwError(state5, "tag prefix is malformed: " + prefix); + } + state5.tagMap[handle] = prefix; + }, "handleTagDirective") + }; + function captureSegment(state5, start3, end2, checkJson) { + var _position, _length, _character, _result; + if (start3 < end2) { + _result = state5.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(state5, "expected valid JSON character"); + } + } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state5, "the stream contains non-printable characters"); + } + state5.result += _result; + } + } + __name(captureSegment, "captureSegment"); + function mergeMappings(state5, destination, source, overridableKeys) { + var sourceKeys, key, index, quantity; + if (!common.isObject(source)) { + throwError(state5, "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; + } + } + } + __name(mergeMappings, "mergeMappings"); + function storeMappingPair(state5, _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(state5, "nested arrays are not supported inside keys"); + } + if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") { + keyNode[index] = "[object Object]"; + } + } + } + if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") { + keyNode = "[object Object]"; + } + keyNode = String(keyNode); + if (_result === null) { + _result = {}; + } + if (keyTag === "tag:yaml.org,2002:merge") { + if (Array.isArray(valueNode)) { + for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { + mergeMappings(state5, _result, valueNode[index], overridableKeys); + } + } else { + mergeMappings(state5, _result, valueNode, overridableKeys); + } + } else { + if (!state5.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) { + state5.line = startLine || state5.line; + state5.lineStart = startLineStart || state5.lineStart; + state5.position = startPos || state5.position; + throwError(state5, "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]; + } + return _result; + } + __name(storeMappingPair, "storeMappingPair"); + function readLineBreak(state5) { + var ch; + ch = state5.input.charCodeAt(state5.position); + if (ch === 10) { + state5.position++; + } else if (ch === 13) { + state5.position++; + if (state5.input.charCodeAt(state5.position) === 10) { + state5.position++; + } + } else { + throwError(state5, "a line break is expected"); + } + state5.line += 1; + state5.lineStart = state5.position; + state5.firstTabInLine = -1; + } + __name(readLineBreak, "readLineBreak"); + function skipSeparationSpace(state5, allowComments, checkIndent) { + var lineBreaks = 0, ch = state5.input.charCodeAt(state5.position); + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + if (ch === 9 && state5.firstTabInLine === -1) { + state5.firstTabInLine = state5.position; + } + ch = state5.input.charCodeAt(++state5.position); + } + if (allowComments && ch === 35) { + do { + ch = state5.input.charCodeAt(++state5.position); + } while (ch !== 10 && ch !== 13 && ch !== 0); + } + if (is_EOL(ch)) { + readLineBreak(state5); + ch = state5.input.charCodeAt(state5.position); + lineBreaks++; + state5.lineIndent = 0; + while (ch === 32) { + state5.lineIndent++; + ch = state5.input.charCodeAt(++state5.position); + } + } else { + break; + } + } + if (checkIndent !== -1 && lineBreaks !== 0 && state5.lineIndent < checkIndent) { + throwWarning(state5, "deficient indentation"); + } + return lineBreaks; + } + __name(skipSeparationSpace, "skipSeparationSpace"); + function testDocumentSeparator(state5) { + var _position = state5.position, ch; + ch = state5.input.charCodeAt(_position); + if ((ch === 45 || ch === 46) && ch === state5.input.charCodeAt(_position + 1) && ch === state5.input.charCodeAt(_position + 2)) { + _position += 3; + ch = state5.input.charCodeAt(_position); + if (ch === 0 || is_WS_OR_EOL(ch)) { + return true; + } + } + return false; + } + __name(testDocumentSeparator, "testDocumentSeparator"); + function writeFoldedLines(state5, count) { + if (count === 1) { + state5.result += " "; + } else if (count > 1) { + state5.result += common.repeat("\n", count - 1); + } + } + __name(writeFoldedLines, "writeFoldedLines"); + function readPlainScalar(state5, nodeIndent, withinFlowCollection) { + var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state5.kind, _result = state5.result, ch; + ch = state5.input.charCodeAt(state5.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 = state5.input.charCodeAt(state5.position + 1); + if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { + return false; + } + } + state5.kind = "scalar"; + state5.result = ""; + captureStart = captureEnd = state5.position; + hasPendingContent = false; + while (ch !== 0) { + if (ch === 58) { + following = state5.input.charCodeAt(state5.position + 1); + if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { + break; + } + } else if (ch === 35) { + preceding = state5.input.charCodeAt(state5.position - 1); + if (is_WS_OR_EOL(preceding)) { + break; + } + } else if (state5.position === state5.lineStart && testDocumentSeparator(state5) || withinFlowCollection && is_FLOW_INDICATOR(ch)) { + break; + } else if (is_EOL(ch)) { + _line = state5.line; + _lineStart = state5.lineStart; + _lineIndent = state5.lineIndent; + skipSeparationSpace(state5, false, -1); + if (state5.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state5.input.charCodeAt(state5.position); + continue; + } else { + state5.position = captureEnd; + state5.line = _line; + state5.lineStart = _lineStart; + state5.lineIndent = _lineIndent; + break; + } + } + if (hasPendingContent) { + captureSegment(state5, captureStart, captureEnd, false); + writeFoldedLines(state5, state5.line - _line); + captureStart = captureEnd = state5.position; + hasPendingContent = false; + } + if (!is_WHITE_SPACE(ch)) { + captureEnd = state5.position + 1; + } + ch = state5.input.charCodeAt(++state5.position); + } + captureSegment(state5, captureStart, captureEnd, false); + if (state5.result) { + return true; + } + state5.kind = _kind; + state5.result = _result; + return false; + } + __name(readPlainScalar, "readPlainScalar"); + function readSingleQuotedScalar(state5, nodeIndent) { + var ch, captureStart, captureEnd; + ch = state5.input.charCodeAt(state5.position); + if (ch !== 39) { + return false; + } + state5.kind = "scalar"; + state5.result = ""; + state5.position++; + captureStart = captureEnd = state5.position; + while ((ch = state5.input.charCodeAt(state5.position)) !== 0) { + if (ch === 39) { + captureSegment(state5, captureStart, state5.position, true); + ch = state5.input.charCodeAt(++state5.position); + if (ch === 39) { + captureStart = state5.position; + state5.position++; + captureEnd = state5.position; + } else { + return true; + } + } else if (is_EOL(ch)) { + captureSegment(state5, captureStart, captureEnd, true); + writeFoldedLines(state5, skipSeparationSpace(state5, false, nodeIndent)); + captureStart = captureEnd = state5.position; + } else if (state5.position === state5.lineStart && testDocumentSeparator(state5)) { + throwError(state5, "unexpected end of the document within a single quoted scalar"); + } else { + state5.position++; + captureEnd = state5.position; + } + } + throwError(state5, "unexpected end of the stream within a single quoted scalar"); + } + __name(readSingleQuotedScalar, "readSingleQuotedScalar"); + function readDoubleQuotedScalar(state5, nodeIndent) { + var captureStart, captureEnd, hexLength, hexResult, tmp, ch; + ch = state5.input.charCodeAt(state5.position); + if (ch !== 34) { + return false; + } + state5.kind = "scalar"; + state5.result = ""; + state5.position++; + captureStart = captureEnd = state5.position; + while ((ch = state5.input.charCodeAt(state5.position)) !== 0) { + if (ch === 34) { + captureSegment(state5, captureStart, state5.position, true); + state5.position++; + return true; + } else if (ch === 92) { + captureSegment(state5, captureStart, state5.position, true); + ch = state5.input.charCodeAt(++state5.position); + if (is_EOL(ch)) { + skipSeparationSpace(state5, false, nodeIndent); + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state5.result += simpleEscapeMap[ch]; + state5.position++; + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + for (; hexLength > 0; hexLength--) { + ch = state5.input.charCodeAt(++state5.position); + if ((tmp = fromHexCode(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + } else { + throwError(state5, "expected hexadecimal character"); } - /******/ - ]) - ); - }); - })(coseBase); - return coseBaseExports; - } - (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(value) { - return value; - }; - __webpack_require__.d = function(exports3, name2, getter) { - if (!__webpack_require__.o(exports3, name2)) { - Object.defineProperty(exports3, name2, { - /******/ - configurable: false, - /******/ - enumerable: true, - /******/ - get: getter - /******/ - }); + } + state5.result += charFromCodepoint(hexResult); + state5.position++; + } else { + throwError(state5, "unknown escape sequence"); + } + captureStart = captureEnd = state5.position; + } else if (is_EOL(ch)) { + captureSegment(state5, captureStart, captureEnd, true); + writeFoldedLines(state5, skipSeparationSpace(state5, false, nodeIndent)); + captureStart = captureEnd = state5.position; + } else if (state5.position === state5.lineStart && testDocumentSeparator(state5)) { + throwError(state5, "unexpected end of the document within a double quoted scalar"); + } else { + state5.position++; + captureEnd = state5.position; + } + } + throwError(state5, "unexpected end of the stream within a double quoted scalar"); + } + __name(readDoubleQuotedScalar, "readDoubleQuotedScalar"); + function readFlowCollection(state5, nodeIndent) { + var readNext = true, _line, _lineStart, _pos, _tag2 = state5.tag, _result, _anchor = state5.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = /* @__PURE__ */ Object.create(null), keyNode, keyTag, valueNode, ch; + ch = state5.input.charCodeAt(state5.position); + if (ch === 91) { + terminator = 93; + isMapping = false; + _result = []; + } else if (ch === 123) { + terminator = 125; + isMapping = true; + _result = {}; + } else { + return false; + } + if (state5.anchor !== null) { + state5.anchorMap[state5.anchor] = _result; + } + ch = state5.input.charCodeAt(++state5.position); + while (ch !== 0) { + skipSeparationSpace(state5, true, nodeIndent); + ch = state5.input.charCodeAt(state5.position); + if (ch === terminator) { + state5.position++; + state5.tag = _tag2; + state5.anchor = _anchor; + state5.kind = isMapping ? "mapping" : "sequence"; + state5.result = _result; + return true; + } else if (!readNext) { + throwError(state5, "missed comma between flow collection entries"); + } else if (ch === 44) { + throwError(state5, "expected the node content, but found ','"); + } + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; + if (ch === 63) { + following = state5.input.charCodeAt(state5.position + 1); + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state5.position++; + skipSeparationSpace(state5, true, nodeIndent); + } + } + _line = state5.line; + _lineStart = state5.lineStart; + _pos = state5.position; + composeNode(state5, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state5.tag; + keyNode = state5.result; + skipSeparationSpace(state5, true, nodeIndent); + ch = state5.input.charCodeAt(state5.position); + if ((isExplicitPair || state5.line === _line) && ch === 58) { + isPair = true; + ch = state5.input.charCodeAt(++state5.position); + skipSeparationSpace(state5, true, nodeIndent); + composeNode(state5, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state5.result; + } + if (isMapping) { + storeMappingPair(state5, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos); + } else if (isPair) { + _result.push(storeMappingPair(state5, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); + } else { + _result.push(keyNode); + } + skipSeparationSpace(state5, true, nodeIndent); + ch = state5.input.charCodeAt(state5.position); + if (ch === 44) { + readNext = true; + ch = state5.input.charCodeAt(++state5.position); + } else { + readNext = false; + } + } + throwError(state5, "unexpected end of the stream within a flow collection"); + } + __name(readFlowCollection, "readFlowCollection"); + function readBlockScalar(state5, nodeIndent) { + var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch; + ch = state5.input.charCodeAt(state5.position); + if (ch === 124) { + folding = false; + } else if (ch === 62) { + folding = true; + } else { + return false; + } + state5.kind = "scalar"; + state5.result = ""; + while (ch !== 0) { + ch = state5.input.charCodeAt(++state5.position); + if (ch === 43 || ch === 45) { + if (CHOMPING_CLIP === chomping) { + chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP; + } else { + throwError(state5, "repeat of a chomping mode identifier"); + } + } else if ((tmp = fromDecimalCode(ch)) >= 0) { + if (tmp === 0) { + throwError(state5, "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(state5, "repeat of an indentation width identifier"); + } + } else { + break; + } + } + if (is_WHITE_SPACE(ch)) { + do { + ch = state5.input.charCodeAt(++state5.position); + } while (is_WHITE_SPACE(ch)); + if (ch === 35) { + do { + ch = state5.input.charCodeAt(++state5.position); + } while (!is_EOL(ch) && ch !== 0); + } + } + while (ch !== 0) { + readLineBreak(state5); + state5.lineIndent = 0; + ch = state5.input.charCodeAt(state5.position); + while ((!detectedIndent || state5.lineIndent < textIndent) && ch === 32) { + state5.lineIndent++; + ch = state5.input.charCodeAt(++state5.position); + } + if (!detectedIndent && state5.lineIndent > textIndent) { + textIndent = state5.lineIndent; + } + if (is_EOL(ch)) { + emptyLines++; + continue; + } + if (state5.lineIndent < textIndent) { + if (chomping === CHOMPING_KEEP) { + state5.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP) { + if (didReadContent) { + state5.result += "\n"; + } + } + break; + } + if (folding) { + if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + state5.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + } else if (atMoreIndented) { + atMoreIndented = false; + state5.result += common.repeat("\n", emptyLines + 1); + } else if (emptyLines === 0) { + if (didReadContent) { + state5.result += " "; + } + } else { + state5.result += common.repeat("\n", emptyLines); + } + } else { + state5.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + } + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state5.position; + while (!is_EOL(ch) && ch !== 0) { + ch = state5.input.charCodeAt(++state5.position); + } + captureSegment(state5, captureStart, state5.position, false); + } + return true; + } + __name(readBlockScalar, "readBlockScalar"); + function readBlockSequence(state5, nodeIndent) { + var _line, _tag2 = state5.tag, _anchor = state5.anchor, _result = [], following, detected = false, ch; + if (state5.firstTabInLine !== -1) return false; + if (state5.anchor !== null) { + state5.anchorMap[state5.anchor] = _result; + } + ch = state5.input.charCodeAt(state5.position); + while (ch !== 0) { + if (state5.firstTabInLine !== -1) { + state5.position = state5.firstTabInLine; + throwError(state5, "tab characters must not be used in indentation"); + } + if (ch !== 45) { + break; + } + following = state5.input.charCodeAt(state5.position + 1); + if (!is_WS_OR_EOL(following)) { + break; + } + detected = true; + state5.position++; + if (skipSeparationSpace(state5, true, -1)) { + if (state5.lineIndent <= nodeIndent) { + _result.push(null); + ch = state5.input.charCodeAt(state5.position); + continue; + } + } + _line = state5.line; + composeNode(state5, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state5.result); + skipSeparationSpace(state5, true, -1); + ch = state5.input.charCodeAt(state5.position); + if ((state5.line === _line || state5.lineIndent > nodeIndent) && ch !== 0) { + throwError(state5, "bad indentation of a sequence entry"); + } else if (state5.lineIndent < nodeIndent) { + break; + } + } + if (detected) { + state5.tag = _tag2; + state5.anchor = _anchor; + state5.kind = "sequence"; + state5.result = _result; + return true; + } + return false; + } + __name(readBlockSequence, "readBlockSequence"); + function readBlockMapping(state5, nodeIndent, flowIndent) { + var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag2 = state5.tag, _anchor = state5.anchor, _result = {}, overridableKeys = /* @__PURE__ */ Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch; + if (state5.firstTabInLine !== -1) return false; + if (state5.anchor !== null) { + state5.anchorMap[state5.anchor] = _result; + } + ch = state5.input.charCodeAt(state5.position); + while (ch !== 0) { + if (!atExplicitKey && state5.firstTabInLine !== -1) { + state5.position = state5.firstTabInLine; + throwError(state5, "tab characters must not be used in indentation"); + } + following = state5.input.charCodeAt(state5.position + 1); + _line = state5.line; + if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) { + if (ch === 63) { + if (atExplicitKey) { + storeMappingPair(state5, _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(state5, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"); + } + state5.position += 1; + ch = following; + } else { + _keyLine = state5.line; + _keyLineStart = state5.lineStart; + _keyPos = state5.position; + if (!composeNode(state5, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + break; + } + if (state5.line === _line) { + ch = state5.input.charCodeAt(state5.position); + while (is_WHITE_SPACE(ch)) { + ch = state5.input.charCodeAt(++state5.position); + } + if (ch === 58) { + ch = state5.input.charCodeAt(++state5.position); + if (!is_WS_OR_EOL(ch)) { + throwError(state5, "a whitespace character is expected after the key-value separator within a block mapping"); } - }; - __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 nodesMap = {}; - for (var i2 = 0; i2 < nodes2.length; i2++) { - nodesMap[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 (nodesMap[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; - } - } - 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); + if (atExplicitKey) { + storeMappingPair(state5, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state5.tag; + keyNode = state5.result; + } else if (detected) { + throwError(state5, "can not read an implicit mapping pair; a colon is missed"); + } else { + state5.tag = _tag2; + state5.anchor = _anchor; + return true; + } + } else if (detected) { + throwError(state5, "can not read a block mapping entry; a multiline key may not be an implicit key"); + } else { + state5.tag = _tag2; + state5.anchor = _anchor; + return true; + } + } + if (state5.line === _line || state5.lineIndent > nodeIndent) { + if (atExplicitKey) { + _keyLine = state5.line; + _keyLineStart = state5.lineStart; + _keyPos = state5.position; + } + if (composeNode(state5, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state5.result; + } else { + valueNode = state5.result; + } + } + if (!atExplicitKey) { + storeMappingPair(state5, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + skipSeparationSpace(state5, true, -1); + ch = state5.input.charCodeAt(state5.position); + } + if ((state5.line === _line || state5.lineIndent > nodeIndent) && ch !== 0) { + throwError(state5, "bad indentation of a mapping entry"); + } else if (state5.lineIndent < nodeIndent) { + break; + } + } + if (atExplicitKey) { + storeMappingPair(state5, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + } + if (detected) { + state5.tag = _tag2; + state5.anchor = _anchor; + state5.kind = "mapping"; + state5.result = _result; + } + return detected; + } + __name(readBlockMapping, "readBlockMapping"); + function readTagProperty(state5) { + var _position, isVerbatim = false, isNamed2 = false, tagHandle, tagName, ch; + ch = state5.input.charCodeAt(state5.position); + if (ch !== 33) return false; + if (state5.tag !== null) { + throwError(state5, "duplication of a tag property"); + } + ch = state5.input.charCodeAt(++state5.position); + if (ch === 60) { + isVerbatim = true; + ch = state5.input.charCodeAt(++state5.position); + } else if (ch === 33) { + isNamed2 = true; + tagHandle = "!!"; + ch = state5.input.charCodeAt(++state5.position); + } else { + tagHandle = "!"; + } + _position = state5.position; + if (isVerbatim) { + do { + ch = state5.input.charCodeAt(++state5.position); + } while (ch !== 0 && ch !== 62); + if (state5.position < state5.length) { + tagName = state5.input.slice(_position, state5.position); + ch = state5.input.charCodeAt(++state5.position); + } else { + throwError(state5, "unexpected end of the stream within a verbatim tag"); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + if (ch === 33) { + if (!isNamed2) { + tagHandle = state5.input.slice(_position - 1, state5.position + 1); + if (!PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError(state5, "named tag handle cannot contain such characters"); + } + isNamed2 = true; + _position = state5.position + 1; + } else { + throwError(state5, "tag suffix cannot contain exclamation marks"); + } + } + ch = state5.input.charCodeAt(++state5.position); + } + tagName = state5.input.slice(_position, state5.position); + if (PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError(state5, "tag suffix cannot contain flow indicator characters"); + } + } + if (tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError(state5, "tag name cannot contain such characters: " + tagName); + } + try { + tagName = decodeURIComponent(tagName); + } catch (err) { + throwError(state5, "tag name is malformed: " + tagName); + } + if (isVerbatim) { + state5.tag = tagName; + } else if (_hasOwnProperty$1.call(state5.tagMap, tagHandle)) { + state5.tag = state5.tagMap[tagHandle] + tagName; + } else if (tagHandle === "!") { + state5.tag = "!" + tagName; + } else if (tagHandle === "!!") { + state5.tag = "tag:yaml.org,2002:" + tagName; + } else { + throwError(state5, 'undeclared tag handle "' + tagHandle + '"'); + } + return true; + } + __name(readTagProperty, "readTagProperty"); + function readAnchorProperty(state5) { + var _position, ch; + ch = state5.input.charCodeAt(state5.position); + if (ch !== 38) return false; + if (state5.anchor !== null) { + throwError(state5, "duplication of an anchor property"); + } + ch = state5.input.charCodeAt(++state5.position); + _position = state5.position; + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state5.input.charCodeAt(++state5.position); + } + if (state5.position === _position) { + throwError(state5, "name of an anchor node must contain at least one character"); + } + state5.anchor = state5.input.slice(_position, state5.position); + return true; + } + __name(readAnchorProperty, "readAnchorProperty"); + function readAlias(state5) { + var _position, alias, ch; + ch = state5.input.charCodeAt(state5.position); + if (ch !== 42) return false; + ch = state5.input.charCodeAt(++state5.position); + _position = state5.position; + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state5.input.charCodeAt(++state5.position); + } + if (state5.position === _position) { + throwError(state5, "name of an alias node must contain at least one character"); + } + alias = state5.input.slice(_position, state5.position); + if (!_hasOwnProperty$1.call(state5.anchorMap, alias)) { + throwError(state5, 'unidentified alias "' + alias + '"'); + } + state5.result = state5.anchorMap[alias]; + skipSeparationSpace(state5, true, -1); + return true; + } + __name(readAlias, "readAlias"); + function composeNode(state5, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type3, flowIndent, blockIndent; + if (state5.listener !== null) { + state5.listener("open", state5); + } + state5.tag = null; + state5.anchor = null; + state5.kind = null; + state5.result = null; + allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext; + if (allowToSeek) { + if (skipSeparationSpace(state5, true, -1)) { + atNewLine = true; + if (state5.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state5.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state5.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + if (indentStatus === 1) { + while (readTagProperty(state5) || readAnchorProperty(state5)) { + if (skipSeparationSpace(state5, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + if (state5.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state5.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state5.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 = state5.position - state5.lineStart; + if (indentStatus === 1) { + if (allowBlockCollections && (readBlockSequence(state5, blockIndent) || readBlockMapping(state5, blockIndent, flowIndent)) || readFlowCollection(state5, flowIndent)) { + hasContent = true; + } else { + if (allowBlockScalars && readBlockScalar(state5, flowIndent) || readSingleQuotedScalar(state5, flowIndent) || readDoubleQuotedScalar(state5, flowIndent)) { + hasContent = true; + } else if (readAlias(state5)) { + hasContent = true; + if (state5.tag !== null || state5.anchor !== null) { + throwError(state5, "alias node should not have any properties"); + } + } else if (readPlainScalar(state5, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + if (state5.tag === null) { + state5.tag = "?"; } - module3.exports = register; } - /******/ - ]) - ); - }); - })(cytoscapeCoseBilkent); - const coseBilkent = /* @__PURE__ */ getDefaultExportFromCjs(cytoscapeCoseBilkentExports); - cytoscape$1.use(coseBilkent); - function drawNodes(svg2, mindmap2, section, conf2) { - svgDraw.drawNode(svg2, mindmap2, section, conf2); - if (mindmap2.children) { - mindmap2.children.forEach((child, index) => { - drawNodes(svg2, child, section < 0 ? index : section, conf2); - }); + if (state5.anchor !== null) { + state5.anchorMap[state5.anchor] = state5.result; + } + } + } else if (indentStatus === 0) { + hasContent = allowBlockCollections && readBlockSequence(state5, blockIndent); + } + } + if (state5.tag === null) { + if (state5.anchor !== null) { + state5.anchorMap[state5.anchor] = state5.result; + } + } else if (state5.tag === "?") { + if (state5.result !== null && state5.kind !== "scalar") { + throwError(state5, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state5.kind + '"'); + } + for (typeIndex = 0, typeQuantity = state5.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type3 = state5.implicitTypes[typeIndex]; + if (type3.resolve(state5.result)) { + state5.result = type3.construct(state5.result); + state5.tag = type3.tag; + if (state5.anchor !== null) { + state5.anchorMap[state5.anchor] = state5.result; + } + break; + } + } + } else if (state5.tag !== "!") { + if (_hasOwnProperty$1.call(state5.typeMap[state5.kind || "fallback"], state5.tag)) { + type3 = state5.typeMap[state5.kind || "fallback"][state5.tag]; + } else { + type3 = null; + typeList = state5.typeMap.multi[state5.kind || "fallback"]; + for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { + if (state5.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + type3 = typeList[typeIndex]; + break; + } + } + } + if (!type3) { + throwError(state5, "unknown tag !<" + state5.tag + ">"); + } + if (state5.result !== null && type3.kind !== state5.kind) { + throwError(state5, "unacceptable node kind for !<" + state5.tag + '> tag; it should be "' + type3.kind + '", not "' + state5.kind + '"'); + } + if (!type3.resolve(state5.result, state5.tag)) { + throwError(state5, "cannot resolve a node with !<" + state5.tag + "> explicit tag"); + } else { + state5.result = type3.construct(state5.result, state5.tag); + if (state5.anchor !== null) { + state5.anchorMap[state5.anchor] = state5.result; + } + } } + if (state5.listener !== null) { + state5.listener("close", state5); + } + return state5.tag !== null || state5.anchor !== null || hasContent; } - 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(composeNode, "composeNode"); + function readDocument(state5) { + var documentStart = state5.position, _position, directiveName, directiveArgs, hasDirectives = false, ch; + state5.version = null; + state5.checkLineBreaks = state5.legacy; + state5.tagMap = /* @__PURE__ */ Object.create(null); + state5.anchorMap = /* @__PURE__ */ Object.create(null); + while ((ch = state5.input.charCodeAt(state5.position)) !== 0) { + skipSeparationSpace(state5, true, -1); + ch = state5.input.charCodeAt(state5.position); + if (state5.lineIndent > 0 || ch !== 37) { + break; } - }); + hasDirectives = true; + ch = state5.input.charCodeAt(++state5.position); + _position = state5.position; + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state5.input.charCodeAt(++state5.position); + } + directiveName = state5.input.slice(_position, state5.position); + directiveArgs = []; + if (directiveName.length < 1) { + throwError(state5, "directive name must not be less than one character in length"); + } + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state5.input.charCodeAt(++state5.position); + } + if (ch === 35) { + do { + ch = state5.input.charCodeAt(++state5.position); + } while (ch !== 0 && !is_EOL(ch)); + break; + } + if (is_EOL(ch)) break; + _position = state5.position; + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state5.input.charCodeAt(++state5.position); + } + directiveArgs.push(state5.input.slice(_position, state5.position)); + } + if (ch !== 0) readLineBreak(state5); + if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](state5, directiveName, directiveArgs); + } else { + throwWarning(state5, 'unknown document directive "' + directiveName + '"'); + } + } + skipSeparationSpace(state5, true, -1); + if (state5.lineIndent === 0 && state5.input.charCodeAt(state5.position) === 45 && state5.input.charCodeAt(state5.position + 1) === 45 && state5.input.charCodeAt(state5.position + 2) === 45) { + state5.position += 3; + skipSeparationSpace(state5, true, -1); + } else if (hasDirectives) { + throwError(state5, "directives end mark is expected"); + } + composeNode(state5, state5.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state5, true, -1); + if (state5.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state5.input.slice(documentStart, state5.position))) { + throwWarning(state5, "non-ASCII line breaks are interpreted as content"); + } + state5.documents.push(state5.result); + if (state5.position === state5.lineStart && testDocumentSeparator(state5)) { + if (state5.input.charCodeAt(state5.position) === 46) { + state5.position += 3; + skipSeparationSpace(state5, true, -1); + } + return; + } + if (state5.position < state5.length - 1) { + throwError(state5, "end of the stream or a document separator is expected"); + } else { + return; + } } - function addNodes(mindmap2, cy, conf2, level) { - cy.add({ - group: "nodes", - data: { - id: mindmap2.id, - 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 + __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 (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 - } - }); - }); + if (input.charCodeAt(0) === 65279) { + input = input.slice(1); + } + } + var state5 = new State$1(input, options3); + var nullpos = input.indexOf("\0"); + if (nullpos !== -1) { + state5.position = nullpos; + throwError(state5, "null byte is not allowed in input"); + } + state5.input += "\0"; + while (state5.input.charCodeAt(state5.position) === 32) { + state5.lineIndent += 1; + state5.position += 1; } + while (state5.position < state5.length - 1) { + readDocument(state5); + } + return state5.documents; } - function layoutMindmap(node2, conf2) { - return new Promise((resolve) => { - const renderEl = select("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", - quality: "proof", - // headless: true, - styleEnabled: false, - animate: false - }).run(); - cy.ready((e) => { - log$1.info("Ready", e); - resolve(cy); - }); - }); + __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]); + } } - function positionNodes(cy) { - cy.nodes().map((node2, id2) => { - const data = node2.data(); - data.x = node2.position().x; - data.y = node2.position().y; - svgDraw.positionNode(data); - const el = 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(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"); } - const draw = async (text2, id2, version2, diagObj) => { - const conf2 = getConfig$1(); - conf2.htmlLabels = false; - diagObj.db.clear(); - diagObj.parser.parse(text2); - log$1.debug("Rendering mindmap diagram\n" + text2, diagObj.parser); - const securityLevel = getConfig$1().securityLevel; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); - const svg2 = root2.select("#" + id2); - svg2.append("g"); - const mm = diagObj.db.getMindmap(); - const edgesElem = svg2.append("g"); - edgesElem.attr("class", "mindmap-edges"); - const nodesElem = svg2.append("g"); - nodesElem.attr("class", "mindmap-nodes"); - drawNodes(nodesElem, mm, -1, conf2); - const cy = await layoutMindmap(mm, conf2); - drawEdges(edgesElem, cy); - positionNodes(cy); - setupGraphViewbox$1(void 0, svg2, conf2.mindmap.padding, conf2.mindmap.useMaxWidth); - }; - const mindmapRenderer = { - draw + __name(load$1, "load$1"); + var loadAll_1 = loadAll$1; + var load_1 = load$1; + var loader25 = { + loadAll: loadAll_1, + load: load_1 }; - 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); + 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 { - options2["lineColor" + i2] = darken$1(options2["lineColor" + i2], 20); + line2 = string3.slice(position5, next3 + 1); + position5 = next3 + 1; } + if (line2.length && line2 !== "\n") result += ind; + result += line2; } - 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]}; + return result; + } + __name(indentString, "indentString"); + function generateNextLine(state5, level) { + return "\n" + common.repeat(" ", state5.indent * level); + } + __name(generateNextLine, "generateNextLine"); + function testImplicitResolving(state5, str2) { + var index, length2, type3; + for (index = 0, length2 = state5.implicitTypes.length; index < length2; index += 1) { + type3 = state5.implicitTypes[index]; + if (type3.resolve(str2)) { + return true; + } } - .section-${i2 - 1} text { - fill: ${options2["cScaleLabel" + i2]}; + return false; + } + __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(state5, string3, level, iskey, inblock) { + state5.dump = function() { + if (string3.length === 0) { + return state5.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"; + } + if (!state5.noCompatMode) { + if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string3) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string3)) { + return state5.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string3 + '"' : "'" + string3 + "'"; + } + } + var indent = state5.indent * Math.max(1, level); + var lineWidth = state5.lineWidth === -1 ? -1 : Math.max(Math.min(state5.lineWidth, 40), state5.lineWidth - indent); + var singleLineOnly = iskey || state5.flowLevel > -1 && level >= state5.flowLevel; + function testAmbiguity(string4) { + return testImplicitResolving(state5, string4); + } + __name(testAmbiguity, "testAmbiguity"); + switch (chooseScalarStyle( + string3, + singleLineOnly, + state5.indent, + lineWidth, + testAmbiguity, + state5.quotingType, + state5.forceQuotes && !iskey, + inblock + )) { + case STYLE_PLAIN: + return string3; + case STYLE_SINGLE: + return "'" + string3.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return "|" + blockHeader(string3, state5.indent) + dropEndingNewline(indentString(string3, indent)); + case STYLE_FOLDED: + return ">" + blockHeader(string3, state5.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; } - .node-icon-${i2 - 1} { - font-size: 40px; - color: ${options2["cScaleLabel" + i2]}; + 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); + } } - .section-edge-${i2 - 1}{ - stroke: ${options2["cScale" + i2]}; + return result; + } + __name(escapeString, "escapeString"); + function writeFlowSequence(state5, level, object3) { + var _result = "", _tag2 = state5.tag, index, length2, value2; + for (index = 0, length2 = object3.length; index < length2; index += 1) { + value2 = object3[index]; + if (state5.replacer) { + value2 = state5.replacer.call(object3, String(index), value2); + } + if (writeNode(state5, level, value2, false, false) || typeof value2 === "undefined" && writeNode(state5, level, null, false, false)) { + if (_result !== "") _result += "," + (!state5.condenseFlow ? " " : ""); + _result += state5.dump; + } } - .edge-depth-${i2 - 1}{ - stroke-width: ${sw}; + state5.tag = _tag2; + state5.dump = "[" + _result + "]"; + } + __name(writeFlowSequence, "writeFlowSequence"); + function writeBlockSequence(state5, level, object3, compact2) { + var _result = "", _tag2 = state5.tag, index, length2, value2; + for (index = 0, length2 = object3.length; index < length2; index += 1) { + value2 = object3[index]; + if (state5.replacer) { + value2 = state5.replacer.call(object3, String(index), value2); + } + if (writeNode(state5, level + 1, value2, true, true, false, true) || typeof value2 === "undefined" && writeNode(state5, level + 1, null, true, true, false, true)) { + if (!compact2 || _result !== "") { + _result += generateNextLine(state5, level); + } + if (state5.dump && CHAR_LINE_FEED === state5.dump.charCodeAt(0)) { + _result += "-"; + } else { + _result += "- "; + } + _result += state5.dump; + } } - .section-${i2 - 1} line { - stroke: ${options2["cScaleInv" + i2]} ; - stroke-width: 3; + state5.tag = _tag2; + state5.dump = _result || "[]"; + } + __name(writeBlockSequence, "writeBlockSequence"); + function writeFlowMapping(state5, level, object3) { + var _result = "", _tag2 = state5.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 (state5.condenseFlow) pairBuffer += '"'; + objectKey = objectKeyList[index]; + objectValue = object3[objectKey]; + if (state5.replacer) { + objectValue = state5.replacer.call(object3, objectKey, objectValue); + } + if (!writeNode(state5, level, objectKey, false, false)) { + continue; + } + if (state5.dump.length > 1024) pairBuffer += "? "; + pairBuffer += state5.dump + (state5.condenseFlow ? '"' : "") + ":" + (state5.condenseFlow ? "" : " "); + if (!writeNode(state5, level, objectValue, false, false)) { + continue; + } + pairBuffer += state5.dump; + _result += pairBuffer; + } + state5.tag = _tag2; + state5.dump = "{" + _result + "}"; + } + __name(writeFlowMapping, "writeFlowMapping"); + function writeBlockMapping(state5, level, object3, compact2) { + var _result = "", _tag2 = state5.tag, objectKeyList = Object.keys(object3), index, length2, objectKey, objectValue, explicitPair, pairBuffer; + if (state5.sortKeys === true) { + objectKeyList.sort(); + } else if (typeof state5.sortKeys === "function") { + objectKeyList.sort(state5.sortKeys); + } else if (state5.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(state5, level); + } + objectKey = objectKeyList[index]; + objectValue = object3[objectKey]; + if (state5.replacer) { + objectValue = state5.replacer.call(object3, objectKey, objectValue); + } + if (!writeNode(state5, level + 1, objectKey, true, true, true)) { + continue; + } + explicitPair = state5.tag !== null && state5.tag !== "?" || state5.dump && state5.dump.length > 1024; + if (explicitPair) { + if (state5.dump && CHAR_LINE_FEED === state5.dump.charCodeAt(0)) { + pairBuffer += "?"; + } else { + pairBuffer += "? "; + } + } + pairBuffer += state5.dump; + if (explicitPair) { + pairBuffer += generateNextLine(state5, level); + } + if (!writeNode(state5, level + 1, objectValue, true, explicitPair)) { + continue; + } + if (state5.dump && CHAR_LINE_FEED === state5.dump.charCodeAt(0)) { + pairBuffer += ":"; + } else { + pairBuffer += ": "; + } + pairBuffer += state5.dump; + _result += pairBuffer; + } + state5.tag = _tag2; + state5.dump = _result || "{}"; + } + __name(writeBlockMapping, "writeBlockMapping"); + function detectType2(state5, object3, explicit) { + var _result, typeList, index, length2, type3, style3; + typeList = explicit ? state5.explicitTypes : state5.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) { + state5.tag = type3.representName(object3); + } else { + state5.tag = type3.tag; + } + } else { + state5.tag = "?"; + } + if (type3.represent) { + style3 = state5.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'); + } + state5.dump = _result; + } + return true; + } } - - .disabled, .disabled circle, .disabled text { - fill: lightgray; + return false; + } + __name(detectType2, "detectType"); + function writeNode(state5, level, object3, block3, compact2, iskey, isblockseq) { + state5.tag = null; + state5.dump = object3; + if (!detectType2(state5, object3, false)) { + detectType2(state5, object3, true); + } + var type3 = _toString.call(state5.dump); + var inblock = block3; + var tagStr; + if (block3) { + block3 = state5.flowLevel < 0 || state5.flowLevel > level; + } + var objectOrArray = type3 === "[object Object]" || type3 === "[object Array]", duplicateIndex, duplicate; + if (objectOrArray) { + duplicateIndex = state5.duplicates.indexOf(object3); + duplicate = duplicateIndex !== -1; + } + if (state5.tag !== null && state5.tag !== "?" || duplicate || state5.indent !== 2 && level > 0) { + compact2 = false; + } + if (duplicate && state5.usedDuplicates[duplicateIndex]) { + state5.dump = "*ref_" + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state5.usedDuplicates[duplicateIndex]) { + state5.usedDuplicates[duplicateIndex] = true; + } + if (type3 === "[object Object]") { + if (block3 && Object.keys(state5.dump).length !== 0) { + writeBlockMapping(state5, level, state5.dump, compact2); + if (duplicate) { + state5.dump = "&ref_" + duplicateIndex + state5.dump; + } + } else { + writeFlowMapping(state5, level, state5.dump); + if (duplicate) { + state5.dump = "&ref_" + duplicateIndex + " " + state5.dump; + } + } + } else if (type3 === "[object Array]") { + if (block3 && state5.dump.length !== 0) { + if (state5.noArrayIndent && !isblockseq && level > 0) { + writeBlockSequence(state5, level - 1, state5.dump, compact2); + } else { + writeBlockSequence(state5, level, state5.dump, compact2); + } + if (duplicate) { + state5.dump = "&ref_" + duplicateIndex + state5.dump; + } + } else { + writeFlowSequence(state5, level, state5.dump); + if (duplicate) { + state5.dump = "&ref_" + duplicateIndex + " " + state5.dump; + } + } + } else if (type3 === "[object String]") { + if (state5.tag !== "?") { + writeScalar(state5, state5.dump, level, iskey, inblock); + } + } else if (type3 === "[object Undefined]") { + return false; + } else { + if (state5.skipInvalid) return false; + throw new exception("unacceptable kind of an object to dump " + type3); + } + if (state5.tag !== null && state5.tag !== "?") { + tagStr = encodeURI( + state5.tag[0] === "!" ? state5.tag.slice(1) : state5.tag + ).replace(/!/g, "%21"); + if (state5.tag[0] === "!") { + tagStr = "!" + tagStr; + } else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") { + tagStr = "!!" + tagStr.slice(18); + } else { + tagStr = "!<" + tagStr + ">"; + } + state5.dump = tagStr + " " + state5.dump; + } } - .disabled text { - fill: #efefef; + return true; + } + __name(writeNode, "writeNode"); + function getDuplicateReferences(object3, state5) { + var objects = [], duplicatesIndexes = [], index, length2; + inspectNode(object3, objects, duplicatesIndexes); + for (index = 0, length2 = duplicatesIndexes.length; index < length2; index += 1) { + state5.duplicates.push(objects[duplicatesIndexes[index]]); } - `; + state5.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); + } + } + } + } + } + __name(inspectNode, "inspectNode"); + function dump$1(input, options3) { + options3 = options3 || {}; + var state5 = new State(options3); + if (!state5.noRefs) getDuplicateReferences(input, state5); + var value2 = input; + if (state5.replacer) { + value2 = state5.replacer.call({ "": value2 }, "", value2); } - return sections2; + if (writeNode(state5, 0, value2, true, true)) return state5.dump + "\n"; + return ""; + } + __name(dump$1, "dump$1"); + var dump_1 = dump$1; + var dumper = { + dump: dump_1 }; - const getStyles = (options2) => ` - .edge { - stroke-width: 3; + 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."); + }; } - ${genSections(options2)} - .section-root rect, .section-root path, .section-root circle, .section-root polygon { - fill: ${options2.git0}; + __name(renamed, "renamed"); + var JSON_SCHEMA = json2; + var load = loader25.load; + var loadAll = loader25.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: {} + }; + } + 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 + }; } - .section-root text { - fill: ${options2.gitBranchLabel0}; + __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'") + ">" + ); + }, "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 + }; } - .icon-container { - height:100%; - display: flex; - justify-content: center; - align-items: center; + __name(preprocessDiagram, "preprocessDiagram"); + + // src/mermaidAPI.ts + init_styles(); + init_themes(); + 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); } - .edge { - fill: none; + __name(toBase64, "toBase64"); + + // src/mermaidAPI.ts + 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; } - .mindmap-node-label { - dy: 1em; - alignment-baseline: middle; - text-anchor: middle; - dominant-baseline: middle; - text-align: center; + __name(processAndSetConfigs, "processAndSetConfigs"); + async function parse6(text2, parseOptions) { + addDiagrams(); + try { + const { code, config: config6 } = processAndSetConfigs(text2); + const diagram24 = await getDiagramFromText(code); + return { diagramType: diagram24.type, config: config6 }; + } catch (error3) { + if (parseOptions?.suppressErrors) { + return false; + } + throw error3; + } } -`; - const mindmapStyles = getStyles; - const diagram = { - db: mindmapDb, - renderer: mindmapRenderer, - parser: mindmapParser, - styles: mindmapStyles - }; - const mindmapDefinition = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram - }, Symbol.toStringTag, { value: "Module" })); - return mermaid; -}); + __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); + }); + } + if (!isEmpty_default(styleClassDef.textStyles)) { + cssStyles += cssImportantStyles( + styleClassDef.id, + "tspan", + (styleClassDef?.textStyles || []).map((s2) => s2.replace("color", "fill")) + ); + } + }); + } + 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, id27, 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", id27).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, id27, divId, iFrameId) => { + doc.getElementById(id27)?.remove(); + doc.getElementById(divId)?.remove(); + doc.getElementById(iFrameId)?.remove(); + }, "removeExistingElements"); + var render6 = /* @__PURE__ */ __name(async function(id27, 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 = "#" + id27; + const iFrameID = "i" + id27; + const iFrameID_selector = "#" + iFrameID; + const enclosingDivID = "d" + id27; + 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, id27, enclosingDivID, `font-family: ${fontFamily}`, XMLNS_XLINK_STD); + } else { + removeExistingElements(document, id27, 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, id27, enclosingDivID); + } + 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, id27, version2, diag); + } catch (e3) { + if (config6.suppressErrorRendering) { + removeTempElements(); + } else { + errorRenderer_default.draw(text2, id27, 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="${id27}"]`).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")); + } + __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 + }); + } + } + }, "handleError"); + var run4 = /* @__PURE__ */ __name(async function(options3 = { + querySelector: ".mermaid" + }) { + try { + await runThrowsErrors(options3); + } catch (e3) { + if (isDetailedError(e3)) { + log.error(e3.str); + } + if (mermaid.parseError) { + mermaid.parseError(e3); + } + if (!options3.suppressErrors) { + log.error("Use the suppressErrors option to suppress these errors"); + throw e3; + } + } + }, "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 id27 = `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(id27, txt, element3); + element3.innerHTML = svg; + if (postRenderCallback) { + await postRenderCallback(id27); + } + if (bindFunctions4) { + bindFunctions4(element3); + } + } catch (error3) { + handleError(error3, errors, mermaid.parseError); + } + } + 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); + } + var setParseErrorHandler = /* @__PURE__ */ __name(function(parseErrorHandler) { + mermaid.parseError = parseErrorHandler; + }, "setParseErrorHandler"); + var executionQueue = []; + var executionQueueRunning = false; + var executeQueue = /* @__PURE__ */ __name(async () => { + if (executionQueueRunning) { + return; + } + executionQueueRunning = true; + while (executionQueue.length > 0) { + const f3 = executionQueue.shift(); + if (f3) { + try { + await f3(); + } catch (e3) { + log.error("Error executing queue", e3); + } + } + } + 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((id27, text2, container2) => { + return new Promise((resolve3, reject3) => { + const performCall = /* @__PURE__ */ __name(() => new Promise((res, rej) => { + mermaidAPI.render(id27, 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, + registerIconPacks + }; + 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/src/resources/formats/html/mermaid/mermaid.min.js b/src/resources/formats/html/mermaid/mermaid.min.js index 367f2e01eb..9f2882748c 100644 --- a/src/resources/formats/html/mermaid/mermaid.min.js +++ b/src/resources/formats/html/mermaid/mermaid.min.js @@ -1,43 +1,293 @@ -(function(mN,cA){typeof exports=="object"&&typeof module<"u"?module.exports=cA():typeof define=="function"&&define.amd?define(cA):(mN=typeof globalThis<"u"?globalThis:mN||self,mN.mermaid=cA())})(this,function(){"use strict";function mN(i){for(var a=[],f=1;f=f?a:""+Array(f+1-w.length).join(p)+a},a5t=function(a){var f=-a.utcOffset(),p=Math.abs(f),w=Math.floor(p/60),y=p%60;return(f<=0?"+":"-")+Ffe(w,2,"0")+":"+Ffe(y,2,"0")},o5t=function i(a,f){if(a.date()1)return i(b[0])}else{var E=a.name;NE[E]=a,w=E}return!p&&w&&(kN=w),w||!p&&kN},ru=function(a,f){if(jfe(a))return a.clone();var p=typeof f=="object"?f:{};return p.date=a,p.args=arguments,new cU(p)},f5t=function(a,f){return ru(a,{locale:f.$L,utc:f.$u,x:f.$x,$offset:f.$offset})},tl=h5t;tl.l=oU,tl.i=jfe,tl.w=f5t;var d5t=function(a){var f=a.date,p=a.utc;if(f===null)return new Date(NaN);if(tl.u(f))return new Date;if(f instanceof Date)return new Date(f);if(typeof f=="string"&&!/Z$/i.test(f)){var w=f.match(r5t);if(w){var y=w[2]-1||0,b=(w[7]||"0").substring(0,3);return p?new Date(Date.UTC(w[1],y,w[3]||1,w[4]||0,w[5]||0,w[6]||0,b)):new Date(w[1],y,w[3]||1,w[4]||0,w[5]||0,w[6]||0,b)}}return new Date(f)},cU=function(){function i(f){this.$L=oU(f.locale,null,!0),this.parse(f)}var a=i.prototype;return a.parse=function(p){this.$d=d5t(p),this.$x=p.x||{},this.init()},a.init=function(){var p=this.$d;this.$y=p.getFullYear(),this.$M=p.getMonth(),this.$D=p.getDate(),this.$W=p.getDay(),this.$H=p.getHours(),this.$m=p.getMinutes(),this.$s=p.getSeconds(),this.$ms=p.getMilliseconds()},a.$utils=function(){return tl},a.isValid=function(){return this.$d.toString()!==yLe},a.isSame=function(p,w){var y=ru(p);return this.startOf(w)<=y&&y<=this.endOf(w)},a.isAfter=function(p,w){return ru(p){},debug:(...i)=>{},info:(...i)=>{},warn:(...i)=>{},error:(...i)=>{},fatal:(...i)=>{}},$fe=function(i="fatal"){let a=c5.fatal;typeof i=="string"?(i=i.toLowerCase(),i in c5&&(a=c5[i])):typeof i=="number"&&(a=i),Fe.trace=()=>{},Fe.debug=()=>{},Fe.info=()=>{},Fe.warn=()=>{},Fe.error=()=>{},Fe.fatal=()=>{},a<=c5.fatal&&(Fe.fatal=console.error?console.error.bind(console,Gb("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Gb("FATAL"))),a<=c5.error&&(Fe.error=console.error?console.error.bind(console,Gb("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Gb("ERROR"))),a<=c5.warn&&(Fe.warn=console.warn?console.warn.bind(console,Gb("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Gb("WARN"))),a<=c5.info&&(Fe.info=console.info?console.info.bind(console,Gb("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Gb("INFO"))),a<=c5.debug&&(Fe.debug=console.debug?console.debug.bind(console,Gb("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Gb("DEBUG"))),a<=c5.trace&&(Fe.trace=console.debug?console.debug.bind(console,Gb("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Gb("TRACE")))},Gb=i=>`%c${ru().format("ss.SSS")} : ${i} : `;var Wk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xLe(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Hfe={};Object.defineProperty(Hfe,"__esModule",{value:!0});var u5=Hfe.sanitizeUrl=void 0,g5t=/^([^\w]*)(javascript|data|vbscript)/im,p5t=/&#(\w+)(^\w|;)?/g,b5t=/&(newline|tab);/gi,v5t=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,w5t=/^.+(:|:)/gim,m5t=[".","/"];function y5t(i){return m5t.indexOf(i[0])>-1}function k5t(i){return i.replace(p5t,function(a,f){return String.fromCharCode(f)})}function x5t(i){var a=k5t(i||"").replace(b5t,"").replace(v5t,"").trim();if(!a)return"about:blank";if(y5t(a))return a;var f=a.match(w5t);if(!f)return a;var p=f[0];return g5t.test(p)?"about:blank":a}u5=Hfe.sanitizeUrl=x5t;function uU(i,a){return i==null||a==null?NaN:ia?1:i>=a?0:NaN}function E5t(i,a){return i==null||a==null?NaN:ai?1:a>=i?0:NaN}function zfe(i){let a,f,p;i.length!==2?(a=uU,f=(E,S)=>uU(i(E),S),p=(E,S)=>i(E)-S):(a=i===uU||i===E5t?i:T5t,f=i,p=i);function w(E,S,N=0,B=E.length){if(N>>1;f(E[R],S)<0?N=R+1:B=R}while(N>>1;f(E[R],S)<=0?N=R+1:B=R}while(NN&&p(E[R-1],S)>-p(E[R],S)?R-1:R}return{left:w,center:b,right:y}}function T5t(){return 0}function _5t(i){return i===null?NaN:+i}const C5t=zfe(uU).right;zfe(_5t).center;const S5t=C5t;class ELe extends Map{constructor(a,f=M5t){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:f}}),a!=null)for(const[p,w]of a)this.set(p,w)}get(a){return super.get(TLe(this,a))}has(a){return super.has(TLe(this,a))}set(a,f){return super.set(A5t(this,a),f)}delete(a){return super.delete(L5t(this,a))}}function TLe({_intern:i,_key:a},f){const p=a(f);return i.has(p)?i.get(p):f}function A5t({_intern:i,_key:a},f){const p=a(f);return i.has(p)?i.get(p):(i.set(p,f),f)}function L5t({_intern:i,_key:a},f){const p=a(f);return i.has(p)&&(f=i.get(p),i.delete(p)),f}function M5t(i){return i!==null&&typeof i=="object"?i.valueOf():i}var Gfe=Math.sqrt(50),qfe=Math.sqrt(10),Vfe=Math.sqrt(2);function D5t(i,a,f){var p,w=-1,y,b,E;if(a=+a,i=+i,f=+f,i===a&&f>0)return[i];if((p=a0){let S=Math.round(i/E),N=Math.round(a/E);for(S*Ea&&--N,b=new Array(y=N-S+1);++wa&&--N,b=new Array(y=N-S+1);++w=0?(y>=Gfe?10:y>=qfe?5:y>=Vfe?2:1)*Math.pow(10,w):-Math.pow(10,-w)/(y>=Gfe?10:y>=qfe?5:y>=Vfe?2:1)}function Ufe(i,a,f){var p=Math.abs(a-i)/Math.max(0,f),w=Math.pow(10,Math.floor(Math.log(p)/Math.LN10)),y=p/w;return y>=Gfe?w*=10:y>=qfe?w*=5:y>=Vfe&&(w*=2),a=p)&&(f=p);else{let p=-1;for(let w of i)(w=a(w,++p,i))!=null&&(f=w)&&(f=w)}return f}function O5t(i,a){let f;if(a===void 0)for(const p of i)p!=null&&(f>p||f===void 0&&p>=p)&&(f=p);else{let p=-1;for(let w of i)(w=a(w,++p,i))!=null&&(f>w||f===void 0&&w>=w)&&(f=w)}return f}function N5t(i){return i}var lU=1,Wfe=2,Kfe=3,hU=4,CLe=1e-6;function P5t(i){return"translate("+i+",0)"}function B5t(i){return"translate(0,"+i+")"}function R5t(i){return a=>+i(a)}function F5t(i,a){return a=Math.max(0,i.bandwidth()-a*2)/2,i.round()&&(a=Math.round(a)),f=>+i(f)+a}function j5t(){return!this.__axis}function SLe(i,a){var f=[],p=null,w=null,y=6,b=6,E=3,S=typeof window<"u"&&window.devicePixelRatio>1?0:.5,N=i===lU||i===hU?-1:1,B=i===hU||i===Wfe?"x":"y",R=i===lU||i===Kfe?P5t:B5t;function j($){var V=p??(a.ticks?a.ticks.apply(a,f):a.domain()),Q=w??(a.tickFormat?a.tickFormat.apply(a,f):N5t),oe=Math.max(y,0)+E,ce=a.range(),se=+ce[0]+S,ge=+ce[ce.length-1]+S,ye=(a.bandwidth?F5t:R5t)(a.copy(),S),ke=$.selection?$.selection():$,Ae=ke.selectAll(".domain").data([null]),de=ke.selectAll(".tick").data(V,a).order(),ve=de.exit(),te=de.enter().append("g").attr("class","tick"),xe=de.select("line"),De=de.select("text");Ae=Ae.merge(Ae.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),de=de.merge(te),xe=xe.merge(te.append("line").attr("stroke","currentColor").attr(B+"2",N*y)),De=De.merge(te.append("text").attr("fill","currentColor").attr(B,N*oe).attr("dy",i===lU?"0em":i===Kfe?"0.71em":"0.32em")),$!==ke&&(Ae=Ae.transition($),de=de.transition($),xe=xe.transition($),De=De.transition($),ve=ve.transition($).attr("opacity",CLe).attr("transform",function(he){return isFinite(he=ye(he))?R(he+S):this.getAttribute("transform")}),te.attr("opacity",CLe).attr("transform",function(he){var Ie=this.parentNode.__axis;return R((Ie&&isFinite(Ie=Ie(he))?Ie:ye(he))+S)})),ve.remove(),Ae.attr("d",i===hU||i===Wfe?b?"M"+N*b+","+se+"H"+S+"V"+ge+"H"+N*b:"M"+S+","+se+"V"+ge:b?"M"+se+","+N*b+"V"+S+"H"+ge+"V"+N*b:"M"+se+","+S+"H"+ge),de.attr("opacity",1).attr("transform",function(he){return R(ye(he)+S)}),xe.attr(B+"2",N*y),De.attr(B,N*oe).text(Q),ke.filter(j5t).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",i===Wfe?"start":i===hU?"end":"middle"),ke.each(function(){this.__axis=ye})}return j.scale=function($){return arguments.length?(a=$,j):a},j.ticks=function(){return f=Array.from(arguments),j},j.tickArguments=function($){return arguments.length?(f=$==null?[]:Array.from($),j):f.slice()},j.tickValues=function($){return arguments.length?(p=$==null?null:Array.from($),j):p&&p.slice()},j.tickFormat=function($){return arguments.length?(w=$,j):w},j.tickSize=function($){return arguments.length?(y=b=+$,j):y},j.tickSizeInner=function($){return arguments.length?(y=+$,j):y},j.tickSizeOuter=function($){return arguments.length?(b=+$,j):b},j.tickPadding=function($){return arguments.length?(E=+$,j):E},j.offset=function($){return arguments.length?(S=+$,j):S},j}function $5t(i){return SLe(lU,i)}function H5t(i){return SLe(Kfe,i)}var z5t={value:()=>{}};function ALe(){for(var i=0,a=arguments.length,f={},p;i=0&&(p=f.slice(w+1),f=f.slice(0,w)),f&&!a.hasOwnProperty(f))throw new Error("unknown type: "+f);return{type:f,name:p}})}fU.prototype=ALe.prototype={constructor:fU,on:function(i,a){var f=this._,p=G5t(i+"",f),w,y=-1,b=p.length;if(arguments.length<2){for(;++y0)for(var f=new Array(w),p=0,w,y;p=0&&(a=i.slice(0,f))!=="xmlns"&&(i=i.slice(f+1)),MLe.hasOwnProperty(a)?{space:MLe[a],local:i}:i}function V5t(i){return function(){var a=this.ownerDocument,f=this.namespaceURI;return f===Yfe&&a.documentElement.namespaceURI===Yfe?a.createElement(i):a.createElementNS(f,i)}}function U5t(i){return function(){return this.ownerDocument.createElementNS(i.space,i.local)}}function DLe(i){var a=dU(i);return(a.local?U5t:V5t)(a)}function W5t(){}function Xfe(i){return i==null?W5t:function(){return this.querySelector(i)}}function K5t(i){typeof i!="function"&&(i=Xfe(i));for(var a=this._groups,f=a.length,p=new Array(f),w=0;w=ge&&(ge=se+1);!(ke=oe[ge])&&++ge=0;)(b=p[w])&&(y&&b.compareDocumentPosition(y)^4&&y.parentNode.insertBefore(b,y),y=b);return this}function w6t(i){i||(i=m6t);function a(R,j){return R&&j?i(R.__data__,j.__data__):!R-!j}for(var f=this._groups,p=f.length,w=new Array(p),y=0;ya?1:i>=a?0:NaN}function y6t(){var i=arguments[0];return arguments[0]=this,i.apply(null,arguments),this}function k6t(){return Array.from(this)}function x6t(){for(var i=this._groups,a=0,f=i.length;a1?this.each((a==null?O6t:typeof a=="function"?P6t:N6t)(i,a,f??"")):gA(this.node(),i)}function gA(i,a){return i.style.getPropertyValue(a)||RLe(i).getComputedStyle(i,null).getPropertyValue(a)}function R6t(i){return function(){delete this[i]}}function F6t(i,a){return function(){this[i]=a}}function j6t(i,a){return function(){var f=a.apply(this,arguments);f==null?delete this[i]:this[i]=f}}function $6t(i,a){return arguments.length>1?this.each((a==null?R6t:typeof a=="function"?j6t:F6t)(i,a)):this.node()[i]}function FLe(i){return i.trim().split(/^|\s+/)}function Qfe(i){return i.classList||new jLe(i)}function jLe(i){this._node=i,this._names=FLe(i.getAttribute("class")||"")}jLe.prototype={add:function(i){var a=this._names.indexOf(i);a<0&&(this._names.push(i),this._node.setAttribute("class",this._names.join(" ")))},remove:function(i){var a=this._names.indexOf(i);a>=0&&(this._names.splice(a,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(i){return this._names.indexOf(i)>=0}};function $Le(i,a){for(var f=Qfe(i),p=-1,w=a.length;++p=0&&(f=a.slice(p+1),a=a.slice(0,p)),{type:a,name:f}})}function gkt(i){return function(){var a=this.__on;if(a){for(var f=0,p=-1,w=a.length,y;f>8&15|a>>4&240,a>>4&15|a&240,(a&15)<<4|a&15,1):f===8?vU(a>>24&255,a>>16&255,a>>8&255,(a&255)/255):f===4?vU(a>>12&15|a>>8&240,a>>8&15|a>>4&240,a>>4&15|a&240,((a&15)<<4|a&15)/255):null):(a=Ekt.exec(i))?new v0(a[1],a[2],a[3],1):(a=Tkt.exec(i))?new v0(a[1]*255/100,a[2]*255/100,a[3]*255/100,1):(a=_kt.exec(i))?vU(a[1],a[2],a[3],a[4]):(a=Ckt.exec(i))?vU(a[1]*255/100,a[2]*255/100,a[3]*255/100,a[4]):(a=Skt.exec(i))?XLe(a[1],a[2]/100,a[3]/100,1):(a=Akt.exec(i))?XLe(a[1],a[2]/100,a[3]/100,a[4]):GLe.hasOwnProperty(i)?ULe(GLe[i]):i==="transparent"?new v0(NaN,NaN,NaN,0):null}function ULe(i){return new v0(i>>16&255,i>>8&255,i&255,1)}function vU(i,a,f,p){return p<=0&&(i=a=f=NaN),new v0(i,a,f,p)}function WLe(i){return i instanceof PE||(i=BE(i)),i?(i=i.rgb(),new v0(i.r,i.g,i.b,i.opacity)):new v0}function e1e(i,a,f,p){return arguments.length===1?WLe(i):new v0(i,a,f,p??1)}function v0(i,a,f,p){this.r=+i,this.g=+a,this.b=+f,this.opacity=+p}EN(v0,e1e,pU(PE,{brighter(i){return i=i==null?bU:Math.pow(bU,i),new v0(this.r*i,this.g*i,this.b*i,this.opacity)},darker(i){return i=i==null?TN:Math.pow(TN,i),new v0(this.r*i,this.g*i,this.b*i,this.opacity)},rgb(){return this},clamp(){return new v0(RE(this.r),RE(this.g),RE(this.b),wU(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:KLe,formatHex:KLe,formatHex8:Dkt,formatRgb:YLe,toString:YLe}));function KLe(){return`#${FE(this.r)}${FE(this.g)}${FE(this.b)}`}function Dkt(){return`#${FE(this.r)}${FE(this.g)}${FE(this.b)}${FE((isNaN(this.opacity)?1:this.opacity)*255)}`}function YLe(){const i=wU(this.opacity);return`${i===1?"rgb(":"rgba("}${RE(this.r)}, ${RE(this.g)}, ${RE(this.b)}${i===1?")":`, ${i})`}`}function wU(i){return isNaN(i)?1:Math.max(0,Math.min(1,i))}function RE(i){return Math.max(0,Math.min(255,Math.round(i)||0))}function FE(i){return i=RE(i),(i<16?"0":"")+i.toString(16)}function XLe(i,a,f,p){return p<=0?i=a=f=NaN:f<=0||f>=1?i=a=NaN:a<=0&&(i=NaN),new $w(i,a,f,p)}function QLe(i){if(i instanceof $w)return new $w(i.h,i.s,i.l,i.opacity);if(i instanceof PE||(i=BE(i)),!i)return new $w;if(i instanceof $w)return i;i=i.rgb();var a=i.r/255,f=i.g/255,p=i.b/255,w=Math.min(a,f,p),y=Math.max(a,f,p),b=NaN,E=y-w,S=(y+w)/2;return E?(a===y?b=(f-p)/E+(f0&&S<1?0:b,new $w(b,E,S,i.opacity)}function Ikt(i,a,f,p){return arguments.length===1?QLe(i):new $w(i,a,f,p??1)}function $w(i,a,f,p){this.h=+i,this.s=+a,this.l=+f,this.opacity=+p}EN($w,Ikt,pU(PE,{brighter(i){return i=i==null?bU:Math.pow(bU,i),new $w(this.h,this.s,this.l*i,this.opacity)},darker(i){return i=i==null?TN:Math.pow(TN,i),new $w(this.h,this.s,this.l*i,this.opacity)},rgb(){var i=this.h%360+(this.h<0)*360,a=isNaN(i)||isNaN(this.s)?0:this.s,f=this.l,p=f+(f<.5?f:1-f)*a,w=2*f-p;return new v0(t1e(i>=240?i-240:i+120,w,p),t1e(i,w,p),t1e(i<120?i+240:i-120,w,p),this.opacity)},clamp(){return new $w(ZLe(this.h),mU(this.s),mU(this.l),wU(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 i=wU(this.opacity);return`${i===1?"hsl(":"hsla("}${ZLe(this.h)}, ${mU(this.s)*100}%, ${mU(this.l)*100}%${i===1?")":`, ${i})`}`}}));function ZLe(i){return i=(i||0)%360,i<0?i+360:i}function mU(i){return Math.max(0,Math.min(1,i||0))}function t1e(i,a,f){return(i<60?a+(f-a)*i/60:i<180?f:i<240?a+(f-a)*(240-i)/60:a)*255}const Okt=Math.PI/180,Nkt=180/Math.PI,yU=18,JLe=.96422,eMe=1,tMe=.82521,nMe=4/29,bA=6/29,rMe=3*bA*bA,Pkt=bA*bA*bA;function iMe(i){if(i instanceof Jy)return new Jy(i.l,i.a,i.b,i.opacity);if(i instanceof l5)return sMe(i);i instanceof v0||(i=WLe(i));var a=s1e(i.r),f=s1e(i.g),p=s1e(i.b),w=n1e((.2225045*a+.7168786*f+.0606169*p)/eMe),y,b;return a===f&&f===p?y=b=w:(y=n1e((.4360747*a+.3850649*f+.1430804*p)/JLe),b=n1e((.0139322*a+.0971045*f+.7141733*p)/tMe)),new Jy(116*w-16,500*(y-w),200*(w-b),i.opacity)}function Bkt(i,a,f,p){return arguments.length===1?iMe(i):new Jy(i,a,f,p??1)}function Jy(i,a,f,p){this.l=+i,this.a=+a,this.b=+f,this.opacity=+p}EN(Jy,Bkt,pU(PE,{brighter(i){return new Jy(this.l+yU*(i??1),this.a,this.b,this.opacity)},darker(i){return new Jy(this.l-yU*(i??1),this.a,this.b,this.opacity)},rgb(){var i=(this.l+16)/116,a=isNaN(this.a)?i:i+this.a/500,f=isNaN(this.b)?i:i-this.b/200;return a=JLe*r1e(a),i=eMe*r1e(i),f=tMe*r1e(f),new v0(i1e(3.1338561*a-1.6168667*i-.4906146*f),i1e(-.9787684*a+1.9161415*i+.033454*f),i1e(.0719453*a-.2289914*i+1.4052427*f),this.opacity)}}));function n1e(i){return i>Pkt?Math.pow(i,1/3):i/rMe+nMe}function r1e(i){return i>bA?i*i*i:rMe*(i-nMe)}function i1e(i){return 255*(i<=.0031308?12.92*i:1.055*Math.pow(i,1/2.4)-.055)}function s1e(i){return(i/=255)<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function Rkt(i){if(i instanceof l5)return new l5(i.h,i.c,i.l,i.opacity);if(i instanceof Jy||(i=iMe(i)),i.a===0&&i.b===0)return new l5(NaN,0()=>i;function aMe(i,a){return function(f){return i+f*a}}function Fkt(i,a,f){return i=Math.pow(i,f),a=Math.pow(a,f)-i,f=1/f,function(p){return Math.pow(i+p*a,f)}}function jkt(i,a){var f=a-i;return f?aMe(i,f>180||f<-180?f-360*Math.round(f/360):f):kU(isNaN(i)?a:i)}function $kt(i){return(i=+i)==1?CN:function(a,f){return f-a?Fkt(a,f,i):kU(isNaN(a)?f:a)}}function CN(i,a){var f=a-i;return f?aMe(i,f):kU(isNaN(i)?a:i)}const xU=function i(a){var f=$kt(a);function p(w,y){var b=f((w=e1e(w)).r,(y=e1e(y)).r),E=f(w.g,y.g),S=f(w.b,y.b),N=CN(w.opacity,y.opacity);return function(B){return w.r=b(B),w.g=E(B),w.b=S(B),w.opacity=N(B),w+""}}return p.gamma=i,p}(1);function Hkt(i,a){a||(a=[]);var f=i?Math.min(a.length,i.length):0,p=a.slice(),w;return function(y){for(w=0;wf&&(y=a.slice(f,y),E[b]?E[b]+=y:E[++b]=y),(p=p[0])===(w=w[0])?E[b]?E[b]+=w:E[++b]=w:(E[++b]=null,S.push({i:b,x:Hw(p,w)})),f=c1e.lastIndex;return f180?B+=360:B-N>180&&(N+=360),j.push({i:R.push(w(R)+"rotate(",null,p)-2,x:Hw(N,B)})):B&&R.push(w(R)+"rotate("+B+p)}function E(N,B,R,j){N!==B?j.push({i:R.push(w(R)+"skewX(",null,p)-2,x:Hw(N,B)}):B&&R.push(w(R)+"skewX("+B+p)}function S(N,B,R,j,$,V){if(N!==R||B!==j){var Q=$.push(w($)+"scale(",null,",",null,")");V.push({i:Q-4,x:Hw(N,R)},{i:Q-2,x:Hw(B,j)})}else(R!==1||j!==1)&&$.push(w($)+"scale("+R+","+j+")")}return function(N,B){var R=[],j=[];return N=i(N),B=i(B),y(N.translateX,N.translateY,B.translateX,B.translateY,R,j),b(N.rotate,B.rotate,R,j),E(N.skewX,B.skewX,R,j),S(N.scaleX,N.scaleY,B.scaleX,B.scaleY,R,j),N=B=null,function($){for(var V=-1,Q=j.length,oe;++V=0&&i._call.call(void 0,a),i=i._next;--vA}function gMe(){jE=(_U=MN.now())+CU,vA=SN=0;try{nxt()}finally{vA=0,ixt(),jE=0}}function rxt(){var i=MN.now(),a=i-_U;a>hMe&&(CU-=a,_U=i)}function ixt(){for(var i,a=TU,f,p=1/0;a;)a._call?(p>a._time&&(p=a._time),i=a,a=a._next):(f=a._next,a._next=null,a=i?i._next=f:TU=f);LN=i,f1e(p)}function f1e(i){if(!vA){SN&&(SN=clearTimeout(SN));var a=i-jE;a>24?(i<1/0&&(SN=setTimeout(gMe,i-MN.now()-CU)),AN&&(AN=clearInterval(AN))):(AN||(_U=MN.now(),AN=setInterval(rxt,hMe)),vA=1,fMe(gMe))}}function pMe(i,a,f){var p=new SU;return a=a==null?0:+a,p.restart(w=>{p.stop(),i(w+a)},a,f),p}var sxt=ALe("start","end","cancel","interrupt"),axt=[],bMe=0,vMe=1,d1e=2,AU=3,wMe=4,g1e=5,LU=6;function MU(i,a,f,p,w,y){var b=i.__transition;if(!b)i.__transition={};else if(f in b)return;oxt(i,f,{name:a,index:p,group:w,on:sxt,tween:axt,time:y.time,delay:y.delay,duration:y.duration,ease:y.ease,timer:null,state:bMe})}function p1e(i,a){var f=zw(i,a);if(f.state>bMe)throw new Error("too late; already scheduled");return f}function e3(i,a){var f=zw(i,a);if(f.state>AU)throw new Error("too late; already running");return f}function zw(i,a){var f=i.__transition;if(!f||!(f=f[a]))throw new Error("transition not found");return f}function oxt(i,a,f){var p=i.__transition,w;p[a]=f,f.timer=dMe(y,0,f.time);function y(N){f.state=vMe,f.timer.restart(b,f.delay,f.time),f.delay<=N&&b(N-f.delay)}function b(N){var B,R,j,$;if(f.state!==vMe)return S();for(B in p)if($=p[B],$.name===f.name){if($.state===AU)return pMe(b);$.state===wMe?($.state=LU,$.timer.stop(),$.on.call("interrupt",i,i.__data__,$.index,$.group),delete p[B]):+Bd1e&&p.state=0&&(a=a.slice(0,f)),!a||a==="start"})}function Fxt(i,a,f){var p,w,y=Rxt(a)?p1e:e3;return function(){var b=y(this,i),E=b.on;E!==p&&(w=(p=E).copy()).on(a,f),b.on=w}}function jxt(i,a){var f=this._id;return arguments.length<2?zw(this.node(),f).on.on(i):this.each(Fxt(f,i,a))}function $xt(i){return function(){var a=this.parentNode;for(var f in this.__transition)if(+f!==i)return;a&&a.removeChild(this)}}function Hxt(){return this.on("end.remove",$xt(this._id))}function zxt(i){var a=this._name,f=this._id;typeof i!="function"&&(i=Xfe(i));for(var p=this._groups,w=p.length,y=new Array(w),b=0;b$E)if(!(Math.abs(B*E-S*N)>$E)||!w)this._+="L"+(this._x1=i)+","+(this._y1=a);else{var j=f-y,$=p-b,V=E*E+S*S,Q=j*j+$*$,oe=Math.sqrt(V),ce=Math.sqrt(R),se=w*Math.tan((v1e-Math.acos((V+R-Q)/(2*oe*ce)))/2),ge=se/ce,ye=se/oe;Math.abs(ge-1)>$E&&(this._+="L"+(i+ge*N)+","+(a+ge*B)),this._+="A"+w+","+w+",0,0,"+ +(B*j>N*$)+","+(this._x1=i+ye*E)+","+(this._y1=a+ye*S)}},arc:function(i,a,f,p,w,y){i=+i,a=+a,f=+f,y=!!y;var b=f*Math.cos(p),E=f*Math.sin(p),S=i+b,N=a+E,B=1^y,R=y?p-w:w-p;if(f<0)throw new Error("negative radius: "+f);this._x1===null?this._+="M"+S+","+N:(Math.abs(this._x1-S)>$E||Math.abs(this._y1-N)>$E)&&(this._+="L"+S+","+N),f&&(R<0&&(R=R%w1e+w1e),R>d8t?this._+="A"+f+","+f+",0,1,"+B+","+(i-b)+","+(a-E)+"A"+f+","+f+",0,1,"+B+","+(this._x1=S)+","+(this._y1=N):R>$E&&(this._+="A"+f+","+f+",0,"+ +(R>=v1e)+","+B+","+(this._x1=i+f*Math.cos(w))+","+(this._y1=a+f*Math.sin(w))))},rect:function(i,a,f,p){this._+="M"+(this._x0=this._x1=+i)+","+(this._y0=this._y1=+a)+"h"+ +f+"v"+ +p+"h"+-f+"Z"},toString:function(){return this._}};function g8t(i){if(!i.ok)throw new Error(i.status+" "+i.statusText);return i.text()}function p8t(i,a){return fetch(i,a).then(g8t)}function b8t(i){return(a,f)=>p8t(a,f).then(p=>new DOMParser().parseFromString(p,i))}var v8t=b8t("image/svg+xml");function w8t(i){return Math.abs(i=Math.round(i))>=1e21?i.toLocaleString("en").replace(/,/g,""):i.toString(10)}function DU(i,a){if((f=(i=a?i.toExponential(a-1):i.toExponential()).indexOf("e"))<0)return null;var f,p=i.slice(0,f);return[p.length>1?p[0]+p.slice(2):p,+i.slice(f+1)]}function wA(i){return i=DU(Math.abs(i)),i?i[1]:NaN}function m8t(i,a){return function(f,p){for(var w=f.length,y=[],b=0,E=i[0],S=0;w>0&&E>0&&(S+E+1>p&&(E=Math.max(1,p-S)),y.push(f.substring(w-=E,w+E)),!((S+=E+1)>p));)E=i[b=(b+1)%i.length];return y.reverse().join(a)}}function y8t(i){return function(a){return a.replace(/[0-9]/g,function(f){return i[+f]})}}var k8t=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function IU(i){if(!(a=k8t.exec(i)))throw new Error("invalid format: "+i);var a;return new k1e({fill:a[1],align:a[2],sign:a[3],symbol:a[4],zero:a[5],width:a[6],comma:a[7],precision:a[8]&&a[8].slice(1),trim:a[9],type:a[10]})}IU.prototype=k1e.prototype;function k1e(i){this.fill=i.fill===void 0?" ":i.fill+"",this.align=i.align===void 0?">":i.align+"",this.sign=i.sign===void 0?"-":i.sign+"",this.symbol=i.symbol===void 0?"":i.symbol+"",this.zero=!!i.zero,this.width=i.width===void 0?void 0:+i.width,this.comma=!!i.comma,this.precision=i.precision===void 0?void 0:+i.precision,this.trim=!!i.trim,this.type=i.type===void 0?"":i.type+""}k1e.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 x8t(i){e:for(var a=i.length,f=1,p=-1,w;f0&&(p=0);break}return p>0?i.slice(0,p)+i.slice(w+1):i}var xMe;function E8t(i,a){var f=DU(i,a);if(!f)return i+"";var p=f[0],w=f[1],y=w-(xMe=Math.max(-8,Math.min(8,Math.floor(w/3)))*3)+1,b=p.length;return y===b?p:y>b?p+new Array(y-b+1).join("0"):y>0?p.slice(0,y)+"."+p.slice(y):"0."+new Array(1-y).join("0")+DU(i,Math.max(0,a+y-1))[0]}function EMe(i,a){var f=DU(i,a);if(!f)return i+"";var p=f[0],w=f[1];return w<0?"0."+new Array(-w).join("0")+p:p.length>w+1?p.slice(0,w+1)+"."+p.slice(w+1):p+new Array(w-p.length+2).join("0")}const TMe={"%":(i,a)=>(i*100).toFixed(a),b:i=>Math.round(i).toString(2),c:i=>i+"",d:w8t,e:(i,a)=>i.toExponential(a),f:(i,a)=>i.toFixed(a),g:(i,a)=>i.toPrecision(a),o:i=>Math.round(i).toString(8),p:(i,a)=>EMe(i*100,a),r:EMe,s:E8t,X:i=>Math.round(i).toString(16).toUpperCase(),x:i=>Math.round(i).toString(16)};function _Me(i){return i}var CMe=Array.prototype.map,SMe=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function T8t(i){var a=i.grouping===void 0||i.thousands===void 0?_Me:m8t(CMe.call(i.grouping,Number),i.thousands+""),f=i.currency===void 0?"":i.currency[0]+"",p=i.currency===void 0?"":i.currency[1]+"",w=i.decimal===void 0?".":i.decimal+"",y=i.numerals===void 0?_Me:y8t(CMe.call(i.numerals,String)),b=i.percent===void 0?"%":i.percent+"",E=i.minus===void 0?"−":i.minus+"",S=i.nan===void 0?"NaN":i.nan+"";function N(R){R=IU(R);var j=R.fill,$=R.align,V=R.sign,Q=R.symbol,oe=R.zero,ce=R.width,se=R.comma,ge=R.precision,ye=R.trim,ke=R.type;ke==="n"?(se=!0,ke="g"):TMe[ke]||(ge===void 0&&(ge=12),ye=!0,ke="g"),(oe||j==="0"&&$==="=")&&(oe=!0,j="0",$="=");var Ae=Q==="$"?f:Q==="#"&&/[boxX]/.test(ke)?"0"+ke.toLowerCase():"",de=Q==="$"?p:/[%p]/.test(ke)?b:"",ve=TMe[ke],te=/[defgprs%]/.test(ke);ge=ge===void 0?6:/[gprs]/.test(ke)?Math.max(1,Math.min(21,ge)):Math.max(0,Math.min(20,ge));function xe(De){var he=Ae,Ie=de,ee,rt,me;if(ke==="c")Ie=ve(De)+Ie,De="";else{De=+De;var gt=De<0||1/De<0;if(De=isNaN(De)?S:ve(Math.abs(De),ge),ye&&(De=x8t(De)),gt&&+De==0&&V!=="+"&&(gt=!1),he=(gt?V==="("?V:E:V==="-"||V==="("?"":V)+he,Ie=(ke==="s"?SMe[8+xMe/3]:"")+Ie+(gt&&V==="("?")":""),te){for(ee=-1,rt=De.length;++eeme||me>57){Ie=(me===46?w+De.slice(ee+1):De.slice(ee))+Ie,De=De.slice(0,ee);break}}}se&&!oe&&(De=a(De,1/0));var pe=he.length+De.length+Ie.length,Et=pe>1)+he+De+Ie+Et.slice(pe);break;default:De=Et+he+De+Ie;break}return y(De)}return xe.toString=function(){return R+""},xe}function B(R,j){var $=N((R=IU(R),R.type="f",R)),V=Math.max(-8,Math.min(8,Math.floor(wA(j)/3)))*3,Q=Math.pow(10,-V),oe=SMe[8+V/3];return function(ce){return $(Q*ce)+oe}}return{format:N,formatPrefix:B}}var OU,AMe,LMe;_8t({thousands:",",grouping:[3],currency:["$",""]});function _8t(i){return OU=T8t(i),AMe=OU.format,LMe=OU.formatPrefix,OU}function C8t(i){return Math.max(0,-wA(Math.abs(i)))}function S8t(i,a){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(wA(a)/3)))*3-wA(Math.abs(i)))}function A8t(i,a){return i=Math.abs(i),a=Math.abs(a)-i,Math.max(0,wA(a)-wA(i))+1}function x1e(i,a){switch(arguments.length){case 0:break;case 1:this.range(i);break;default:this.range(a).domain(i);break}return this}const MMe=Symbol("implicit");function DMe(){var i=new ELe,a=[],f=[],p=MMe;function w(y){let b=i.get(y);if(b===void 0){if(p!==MMe)return p;i.set(y,b=a.push(y)-1)}return f[b%f.length]}return w.domain=function(y){if(!arguments.length)return a.slice();a=[],i=new ELe;for(const b of y)i.has(b)||i.set(b,a.push(b)-1);return w},w.range=function(y){return arguments.length?(f=Array.from(y),w):f.slice()},w.unknown=function(y){return arguments.length?(p=y,w):p},w.copy=function(){return DMe(a,f).unknown(p)},x1e.apply(w,arguments),w}function L8t(i){return function(){return i}}function M8t(i){return+i}var IMe=[0,1];function mA(i){return i}function E1e(i,a){return(a-=i=+i)?function(f){return(f-i)/a}:L8t(isNaN(a)?NaN:.5)}function D8t(i,a){var f;return i>a&&(f=i,i=a,a=f),function(p){return Math.max(i,Math.min(a,p))}}function I8t(i,a,f){var p=i[0],w=i[1],y=a[0],b=a[1];return w2?O8t:I8t,S=N=null,R}function R(j){return j==null||isNaN(j=+j)?y:(S||(S=E(i.map(p),a,f)))(p(b(j)))}return R.invert=function(j){return b(w((N||(N=E(a,i.map(p),Hw)))(j)))},R.domain=function(j){return arguments.length?(i=Array.from(j,M8t),B()):i.slice()},R.range=function(j){return arguments.length?(a=Array.from(j),B()):a.slice()},R.rangeRound=function(j){return a=Array.from(j),f=Kkt,B()},R.clamp=function(j){return arguments.length?(b=j?!0:mA,B()):b!==mA},R.interpolate=function(j){return arguments.length?(f=j,B()):f},R.unknown=function(j){return arguments.length?(y=j,R):y},function(j,$){return p=j,w=$,B()}}function NMe(){return N8t()(mA,mA)}function P8t(i,a,f,p){var w=Ufe(i,a,f),y;switch(p=IU(p??",f"),p.type){case"s":{var b=Math.max(Math.abs(i),Math.abs(a));return p.precision==null&&!isNaN(y=S8t(w,b))&&(p.precision=y),LMe(p,b)}case"":case"e":case"g":case"p":case"r":{p.precision==null&&!isNaN(y=A8t(w,Math.max(Math.abs(i),Math.abs(a))))&&(p.precision=y-(p.type==="e"));break}case"f":case"%":{p.precision==null&&!isNaN(y=C8t(w))&&(p.precision=y-(p.type==="%")*2);break}}return AMe(p)}function B8t(i){var a=i.domain;return i.ticks=function(f){var p=a();return D5t(p[0],p[p.length-1],f??10)},i.tickFormat=function(f,p){var w=a();return P8t(w[0],w[w.length-1],f??10,p)},i.nice=function(f){f==null&&(f=10);var p=a(),w=0,y=p.length-1,b=p[w],E=p[y],S,N,B=10;for(E0;){if(N=_Le(b,E,f),N===S)return p[w]=b,p[y]=E,a(p);if(N>0)b=Math.floor(b/N)*N,E=Math.ceil(E/N)*N;else if(N<0)b=Math.ceil(b*N)/N,E=Math.floor(E*N)/N;else break;S=N}return i},i}function PMe(){var i=NMe();return i.copy=function(){return OMe(i,PMe())},x1e.apply(i,arguments),B8t(i)}function R8t(i,a){i=i.slice();var f=0,p=i.length-1,w=i[f],y=i[p],b;return y0))return S;do S.push(N=new Date(+y)),a(y,E),i(y);while(N=b)for(;i(b),!y(b);)b.setTime(b-1)},function(b,E){if(b>=b)if(E<0)for(;++E<=0;)for(;a(b,-1),!y(b););else for(;--E>=0;)for(;a(b,1),!y(b););})},f&&(w.count=function(y,b){return T1e.setTime(+y),_1e.setTime(+b),i(T1e),i(_1e),Math.floor(f(T1e,_1e))},w.every=function(y){return y=Math.floor(y),!isFinite(y)||!(y>0)?null:y>1?w.filter(p?function(b){return p(b)%y===0}:function(b){return w.count(0,b)%y===0}):w}),w}var NU=tg(function(){},function(i,a){i.setTime(+i+a)},function(i,a){return a-i});NU.every=function(i){return i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?tg(function(a){a.setTime(Math.floor(a/i)*i)},function(a,f){a.setTime(+a+f*i)},function(a,f){return(f-a)/i}):NU};const F8t=NU;NU.range;const d5=1e3,t3=d5*60,HE=t3*60,zE=HE*24,C1e=zE*7,BMe=zE*30,S1e=zE*365;var RMe=tg(function(i){i.setTime(i-i.getMilliseconds())},function(i,a){i.setTime(+i+a*d5)},function(i,a){return(a-i)/d5},function(i){return i.getUTCSeconds()});const DN=RMe;RMe.range;var FMe=tg(function(i){i.setTime(i-i.getMilliseconds()-i.getSeconds()*d5)},function(i,a){i.setTime(+i+a*t3)},function(i,a){return(a-i)/t3},function(i){return i.getMinutes()});const PU=FMe;FMe.range;var jMe=tg(function(i){i.setTime(i-i.getMilliseconds()-i.getSeconds()*d5-i.getMinutes()*t3)},function(i,a){i.setTime(+i+a*HE)},function(i,a){return(a-i)/HE},function(i){return i.getHours()});const BU=jMe;jMe.range;var $Me=tg(i=>i.setHours(0,0,0,0),(i,a)=>i.setDate(i.getDate()+a),(i,a)=>(a-i-(a.getTimezoneOffset()-i.getTimezoneOffset())*t3)/zE,i=>i.getDate()-1);const yA=$Me;$Me.range;function GE(i){return tg(function(a){a.setDate(a.getDate()-(a.getDay()+7-i)%7),a.setHours(0,0,0,0)},function(a,f){a.setDate(a.getDate()+f*7)},function(a,f){return(f-a-(f.getTimezoneOffset()-a.getTimezoneOffset())*t3)/C1e})}var kA=GE(0),RU=GE(1),j8t=GE(2),$8t=GE(3),xA=GE(4),H8t=GE(5),z8t=GE(6);kA.range,RU.range,j8t.range,$8t.range,xA.range,H8t.range,z8t.range;var HMe=tg(function(i){i.setDate(1),i.setHours(0,0,0,0)},function(i,a){i.setMonth(i.getMonth()+a)},function(i,a){return a.getMonth()-i.getMonth()+(a.getFullYear()-i.getFullYear())*12},function(i){return i.getMonth()});const FU=HMe;HMe.range;var A1e=tg(function(i){i.setMonth(0,1),i.setHours(0,0,0,0)},function(i,a){i.setFullYear(i.getFullYear()+a)},function(i,a){return a.getFullYear()-i.getFullYear()},function(i){return i.getFullYear()});A1e.every=function(i){return!isFinite(i=Math.floor(i))||!(i>0)?null:tg(function(a){a.setFullYear(Math.floor(a.getFullYear()/i)*i),a.setMonth(0,1),a.setHours(0,0,0,0)},function(a,f){a.setFullYear(a.getFullYear()+f*i)})};const qE=A1e;A1e.range;var zMe=tg(function(i){i.setUTCHours(0,0,0,0)},function(i,a){i.setUTCDate(i.getUTCDate()+a)},function(i,a){return(a-i)/zE},function(i){return i.getUTCDate()-1});const GMe=zMe;zMe.range;function VE(i){return tg(function(a){a.setUTCDate(a.getUTCDate()-(a.getUTCDay()+7-i)%7),a.setUTCHours(0,0,0,0)},function(a,f){a.setUTCDate(a.getUTCDate()+f*7)},function(a,f){return(f-a)/C1e})}var qMe=VE(0),jU=VE(1),G8t=VE(2),q8t=VE(3),EA=VE(4),V8t=VE(5),U8t=VE(6);qMe.range,jU.range,G8t.range,q8t.range,EA.range,V8t.range,U8t.range;var L1e=tg(function(i){i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0)},function(i,a){i.setUTCFullYear(i.getUTCFullYear()+a)},function(i,a){return a.getUTCFullYear()-i.getUTCFullYear()},function(i){return i.getUTCFullYear()});L1e.every=function(i){return!isFinite(i=Math.floor(i))||!(i>0)?null:tg(function(a){a.setUTCFullYear(Math.floor(a.getUTCFullYear()/i)*i),a.setUTCMonth(0,1),a.setUTCHours(0,0,0,0)},function(a,f){a.setUTCFullYear(a.getUTCFullYear()+f*i)})};const IN=L1e;L1e.range;function W8t(i,a,f,p,w,y){const b=[[DN,1,d5],[DN,5,5*d5],[DN,15,15*d5],[DN,30,30*d5],[y,1,t3],[y,5,5*t3],[y,15,15*t3],[y,30,30*t3],[w,1,HE],[w,3,3*HE],[w,6,6*HE],[w,12,12*HE],[p,1,zE],[p,2,2*zE],[f,1,C1e],[a,1,BMe],[a,3,3*BMe],[i,1,S1e]];function E(N,B,R){const j=Boe).right(b,j);if($===b.length)return i.every(Ufe(N/S1e,B/S1e,R));if($===0)return F8t.every(Math.max(Ufe(N,B,R),1));const[V,Q]=b[j/b[$-1][2]53)return null;"w"in ze||(ze.w=1),"Z"in ze?(Lt=D1e(ON(ze.y,0,1)),Ge=Lt.getUTCDay(),Lt=Ge>4||Ge===0?jU.ceil(Lt):jU(Lt),Lt=GMe.offset(Lt,(ze.V-1)*7),ze.y=Lt.getUTCFullYear(),ze.m=Lt.getUTCMonth(),ze.d=Lt.getUTCDate()+(ze.w+6)%7):(Lt=M1e(ON(ze.y,0,1)),Ge=Lt.getDay(),Lt=Ge>4||Ge===0?RU.ceil(Lt):RU(Lt),Lt=yA.offset(Lt,(ze.V-1)*7),ze.y=Lt.getFullYear(),ze.m=Lt.getMonth(),ze.d=Lt.getDate()+(ze.w+6)%7)}else("W"in ze||"U"in ze)&&("w"in ze||(ze.w="u"in ze?ze.u%7:"W"in ze?1:0),Ge="Z"in ze?D1e(ON(ze.y,0,1)).getUTCDay():M1e(ON(ze.y,0,1)).getDay(),ze.m=0,ze.d="W"in ze?(ze.w+6)%7+ze.W*7-(Ge+5)%7:ze.w+ze.U*7-(Ge+6)%7);return"Z"in ze?(ze.H+=ze.Z/100|0,ze.M+=ze.Z%100,D1e(ze)):M1e(ze)}}function ve(Dt,vt,Nt,ze){for(var Xe=0,Lt=vt.length,Ge=Nt.length,Bn,Oe;Xe=Ge)return-1;if(Bn=vt.charCodeAt(Xe++),Bn===37){if(Bn=vt.charAt(Xe++),Oe=ke[Bn in VMe?vt.charAt(Xe++):Bn],!Oe||(ze=Oe(Dt,Nt,ze))<0)return-1}else if(Bn!=Nt.charCodeAt(ze++))return-1}return ze}function te(Dt,vt,Nt){var ze=N.exec(vt.slice(Nt));return ze?(Dt.p=B.get(ze[0].toLowerCase()),Nt+ze[0].length):-1}function xe(Dt,vt,Nt){var ze=$.exec(vt.slice(Nt));return ze?(Dt.w=V.get(ze[0].toLowerCase()),Nt+ze[0].length):-1}function De(Dt,vt,Nt){var ze=R.exec(vt.slice(Nt));return ze?(Dt.w=j.get(ze[0].toLowerCase()),Nt+ze[0].length):-1}function he(Dt,vt,Nt){var ze=ce.exec(vt.slice(Nt));return ze?(Dt.m=se.get(ze[0].toLowerCase()),Nt+ze[0].length):-1}function Ie(Dt,vt,Nt){var ze=Q.exec(vt.slice(Nt));return ze?(Dt.m=oe.get(ze[0].toLowerCase()),Nt+ze[0].length):-1}function ee(Dt,vt,Nt){return ve(Dt,a,vt,Nt)}function rt(Dt,vt,Nt){return ve(Dt,f,vt,Nt)}function me(Dt,vt,Nt){return ve(Dt,p,vt,Nt)}function gt(Dt){return b[Dt.getDay()]}function pe(Dt){return y[Dt.getDay()]}function Et(Dt){return S[Dt.getMonth()]}function wt(Dt){return E[Dt.getMonth()]}function jt(Dt){return w[+(Dt.getHours()>=12)]}function At(Dt){return 1+~~(Dt.getMonth()/3)}function Bt(Dt){return b[Dt.getUTCDay()]}function cn(Dt){return y[Dt.getUTCDay()]}function Nn(Dt){return S[Dt.getUTCMonth()]}function Ot(Dt){return E[Dt.getUTCMonth()]}function oi(Dt){return w[+(Dt.getUTCHours()>=12)]}function kt(Dt){return 1+~~(Dt.getUTCMonth()/3)}return{format:function(Dt){var vt=Ae(Dt+="",ge);return vt.toString=function(){return Dt},vt},parse:function(Dt){var vt=de(Dt+="",!1);return vt.toString=function(){return Dt},vt},utcFormat:function(Dt){var vt=Ae(Dt+="",ye);return vt.toString=function(){return Dt},vt},utcParse:function(Dt){var vt=de(Dt+="",!0);return vt.toString=function(){return Dt},vt}}}var VMe={"-":"",_:" ",0:"0"},td=/^\s*\d+/,Q8t=/^%/,Z8t=/[\\^$*+?|[\]().{}]/g;function zc(i,a,f){var p=i<0?"-":"",w=(p?-i:i)+"",y=w.length;return p+(y[a.toLowerCase(),f]))}function e7t(i,a,f){var p=td.exec(a.slice(f,f+1));return p?(i.w=+p[0],f+p[0].length):-1}function t7t(i,a,f){var p=td.exec(a.slice(f,f+1));return p?(i.u=+p[0],f+p[0].length):-1}function n7t(i,a,f){var p=td.exec(a.slice(f,f+2));return p?(i.U=+p[0],f+p[0].length):-1}function r7t(i,a,f){var p=td.exec(a.slice(f,f+2));return p?(i.V=+p[0],f+p[0].length):-1}function i7t(i,a,f){var p=td.exec(a.slice(f,f+2));return p?(i.W=+p[0],f+p[0].length):-1}function UMe(i,a,f){var p=td.exec(a.slice(f,f+4));return p?(i.y=+p[0],f+p[0].length):-1}function WMe(i,a,f){var p=td.exec(a.slice(f,f+2));return p?(i.y=+p[0]+(+p[0]>68?1900:2e3),f+p[0].length):-1}function s7t(i,a,f){var p=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(a.slice(f,f+6));return p?(i.Z=p[1]?0:-(p[2]+(p[3]||"00")),f+p[0].length):-1}function a7t(i,a,f){var p=td.exec(a.slice(f,f+1));return p?(i.q=p[0]*3-3,f+p[0].length):-1}function o7t(i,a,f){var p=td.exec(a.slice(f,f+2));return p?(i.m=p[0]-1,f+p[0].length):-1}function KMe(i,a,f){var p=td.exec(a.slice(f,f+2));return p?(i.d=+p[0],f+p[0].length):-1}function c7t(i,a,f){var p=td.exec(a.slice(f,f+3));return p?(i.m=0,i.d=+p[0],f+p[0].length):-1}function YMe(i,a,f){var p=td.exec(a.slice(f,f+2));return p?(i.H=+p[0],f+p[0].length):-1}function u7t(i,a,f){var p=td.exec(a.slice(f,f+2));return p?(i.M=+p[0],f+p[0].length):-1}function l7t(i,a,f){var p=td.exec(a.slice(f,f+2));return p?(i.S=+p[0],f+p[0].length):-1}function h7t(i,a,f){var p=td.exec(a.slice(f,f+3));return p?(i.L=+p[0],f+p[0].length):-1}function f7t(i,a,f){var p=td.exec(a.slice(f,f+6));return p?(i.L=Math.floor(p[0]/1e3),f+p[0].length):-1}function d7t(i,a,f){var p=Q8t.exec(a.slice(f,f+1));return p?f+p[0].length:-1}function g7t(i,a,f){var p=td.exec(a.slice(f));return p?(i.Q=+p[0],f+p[0].length):-1}function p7t(i,a,f){var p=td.exec(a.slice(f));return p?(i.s=+p[0],f+p[0].length):-1}function XMe(i,a){return zc(i.getDate(),a,2)}function b7t(i,a){return zc(i.getHours(),a,2)}function v7t(i,a){return zc(i.getHours()%12||12,a,2)}function w7t(i,a){return zc(1+yA.count(qE(i),i),a,3)}function QMe(i,a){return zc(i.getMilliseconds(),a,3)}function m7t(i,a){return QMe(i,a)+"000"}function y7t(i,a){return zc(i.getMonth()+1,a,2)}function k7t(i,a){return zc(i.getMinutes(),a,2)}function x7t(i,a){return zc(i.getSeconds(),a,2)}function E7t(i){var a=i.getDay();return a===0?7:a}function T7t(i,a){return zc(kA.count(qE(i)-1,i),a,2)}function ZMe(i){var a=i.getDay();return a>=4||a===0?xA(i):xA.ceil(i)}function _7t(i,a){return i=ZMe(i),zc(xA.count(qE(i),i)+(qE(i).getDay()===4),a,2)}function C7t(i){return i.getDay()}function S7t(i,a){return zc(RU.count(qE(i)-1,i),a,2)}function A7t(i,a){return zc(i.getFullYear()%100,a,2)}function L7t(i,a){return i=ZMe(i),zc(i.getFullYear()%100,a,2)}function M7t(i,a){return zc(i.getFullYear()%1e4,a,4)}function D7t(i,a){var f=i.getDay();return i=f>=4||f===0?xA(i):xA.ceil(i),zc(i.getFullYear()%1e4,a,4)}function I7t(i){var a=i.getTimezoneOffset();return(a>0?"-":(a*=-1,"+"))+zc(a/60|0,"0",2)+zc(a%60,"0",2)}function JMe(i,a){return zc(i.getUTCDate(),a,2)}function O7t(i,a){return zc(i.getUTCHours(),a,2)}function N7t(i,a){return zc(i.getUTCHours()%12||12,a,2)}function P7t(i,a){return zc(1+GMe.count(IN(i),i),a,3)}function eDe(i,a){return zc(i.getUTCMilliseconds(),a,3)}function B7t(i,a){return eDe(i,a)+"000"}function R7t(i,a){return zc(i.getUTCMonth()+1,a,2)}function F7t(i,a){return zc(i.getUTCMinutes(),a,2)}function j7t(i,a){return zc(i.getUTCSeconds(),a,2)}function $7t(i){var a=i.getUTCDay();return a===0?7:a}function H7t(i,a){return zc(qMe.count(IN(i)-1,i),a,2)}function tDe(i){var a=i.getUTCDay();return a>=4||a===0?EA(i):EA.ceil(i)}function z7t(i,a){return i=tDe(i),zc(EA.count(IN(i),i)+(IN(i).getUTCDay()===4),a,2)}function G7t(i){return i.getUTCDay()}function q7t(i,a){return zc(jU.count(IN(i)-1,i),a,2)}function V7t(i,a){return zc(i.getUTCFullYear()%100,a,2)}function U7t(i,a){return i=tDe(i),zc(i.getUTCFullYear()%100,a,2)}function W7t(i,a){return zc(i.getUTCFullYear()%1e4,a,4)}function K7t(i,a){var f=i.getUTCDay();return i=f>=4||f===0?EA(i):EA.ceil(i),zc(i.getUTCFullYear()%1e4,a,4)}function Y7t(){return"+0000"}function nDe(){return"%"}function rDe(i){return+i}function iDe(i){return Math.floor(+i/1e3)}var TA,$U;X7t({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 X7t(i){return TA=X8t(i),$U=TA.format,TA.parse,TA.utcFormat,TA.utcParse,TA}function Q7t(i){return new Date(i)}function Z7t(i){return i instanceof Date?+i:+new Date(+i)}function sDe(i,a,f,p,w,y,b,E,S,N){var B=NMe(),R=B.invert,j=B.domain,$=N(".%L"),V=N(":%S"),Q=N("%I:%M"),oe=N("%I %p"),ce=N("%a %d"),se=N("%b %d"),ge=N("%B"),ye=N("%Y");function ke(Ae){return(S(Ae)1?0:i<-1?BN:Math.acos(i)}function oDe(i){return i>=1?HU:i<=-1?-HU:Math.asin(i)}function nEt(i){return i.innerRadius}function rEt(i){return i.outerRadius}function iEt(i){return i.startAngle}function sEt(i){return i.endAngle}function aEt(i){return i&&i.padAngle}function oEt(i,a,f,p,w,y,b,E){var S=f-i,N=p-a,B=b-w,R=E-y,j=R*S-B*N;if(!(j*jee*ee+rt*rt&&(ve=xe,te=De),{cx:ve,cy:te,x01:-B,y01:-R,x11:ve*(w/ke-1),y11:te*(w/ke-1)}}function CA(){var i=nEt,a=rEt,f=of(0),p=null,w=iEt,y=sEt,b=aEt,E=null;function S(){var N,B,R=+i.apply(this,arguments),j=+a.apply(this,arguments),$=w.apply(this,arguments)-HU,V=y.apply(this,arguments)-HU,Q=aDe(V-$),oe=V>$;if(E||(E=N=y1e()),jm0))E.moveTo(0,0);else if(Q>zU-m0)E.moveTo(j*UE($),j*n3($)),E.arc(0,0,j,$,V,!oe),R>m0&&(E.moveTo(R*UE(V),R*n3(V)),E.arc(0,0,R,V,$,oe));else{var ce=$,se=V,ge=$,ye=V,ke=Q,Ae=Q,de=b.apply(this,arguments)/2,ve=de>m0&&(p?+p.apply(this,arguments):_A(R*R+j*j)),te=I1e(aDe(j-R)/2,+f.apply(this,arguments)),xe=te,De=te,he,Ie;if(ve>m0){var ee=oDe(ve/R*n3(de)),rt=oDe(ve/j*n3(de));(ke-=ee*2)>m0?(ee*=oe?1:-1,ge+=ee,ye-=ee):(ke=0,ge=ye=($+V)/2),(Ae-=rt*2)>m0?(rt*=oe?1:-1,ce+=rt,se-=rt):(Ae=0,ce=se=($+V)/2)}var me=j*UE(ce),gt=j*n3(ce),pe=R*UE(ye),Et=R*n3(ye);if(te>m0){var wt=j*UE(se),jt=j*n3(se),At=R*UE(ge),Bt=R*n3(ge),cn;if(Qm0?De>m0?(he=GU(At,Bt,me,gt,j,De,oe),Ie=GU(wt,jt,pe,Et,j,De,oe),E.moveTo(he.cx+he.x01,he.cy+he.y01),Dem0)||!(ke>m0)?E.lineTo(pe,Et):xe>m0?(he=GU(pe,Et,wt,jt,R,-xe,oe),Ie=GU(me,gt,At,Bt,R,-xe,oe),E.lineTo(he.cx+he.x01,he.cy+he.y01),xei?1:a>=i?0:NaN}function hEt(i){return i}function fEt(){var i=hEt,a=lEt,f=null,p=of(0),w=of(zU),y=of(0);function b(E){var S,N=(E=cDe(E)).length,B,R,j=0,$=new Array(N),V=new Array(N),Q=+p.apply(this,arguments),oe=Math.min(zU,Math.max(-zU,w.apply(this,arguments)-Q)),ce,se=Math.min(Math.abs(oe)/N,y.apply(this,arguments)),ge=se*(oe<0?-1:1),ye;for(S=0;S0&&(j+=ye);for(a!=null?$.sort(function(ke,Ae){return a(V[ke],V[Ae])}):f!=null&&$.sort(function(ke,Ae){return f(E[ke],E[Ae])}),S=0,R=j?(oe-N*ge)/j:0;S0?ye*R:0)+ge,V[B]={data:E[B],index:S,value:ye,startAngle:Q,endAngle:ce,padAngle:se};return V}return b.value=function(E){return arguments.length?(i=typeof E=="function"?E:of(+E),b):i},b.sortValues=function(E){return arguments.length?(a=E,f=null,b):a},b.sort=function(E){return arguments.length?(f=E,a=null,b):f},b.startAngle=function(E){return arguments.length?(p=typeof E=="function"?E:of(+E),b):p},b.endAngle=function(E){return arguments.length?(w=typeof E=="function"?E:of(+E),b):w},b.padAngle=function(E){return arguments.length?(y=typeof E=="function"?E:of(+E),b):y},b}class lDe{constructor(a,f){this._context=a,this._x=f}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(a,f){switch(a=+a,f=+f,this._point){case 0:{this._point=1,this._line?this._context.lineTo(a,f):this._context.moveTo(a,f);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+a)/2,this._y0,this._x0,f,a,f):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+f)/2,a,this._y0,a,f);break}}this._x0=a,this._y0=f}}function dEt(i){return new lDe(i,!0)}function gEt(i){return new lDe(i,!1)}function Kk(){}function qU(i,a,f){i._context.bezierCurveTo((2*i._x0+i._x1)/3,(2*i._y0+i._y1)/3,(i._x0+2*i._x1)/3,(i._y0+2*i._y1)/3,(i._x0+4*i._x1+a)/6,(i._y0+4*i._y1+f)/6)}function VU(i){this._context=i}VU.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:qU(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(i,a){switch(i=+i,a=+a,this._point){case 0:this._point=1,this._line?this._context.lineTo(i,a):this._context.moveTo(i,a);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:qU(this,i,a);break}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=a}};function SA(i){return new VU(i)}function hDe(i){this._context=i}hDe.prototype={areaStart:Kk,areaEnd:Kk,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}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}}},point:function(i,a){switch(i=+i,a=+a,this._point){case 0:this._point=1,this._x2=i,this._y2=a;break;case 1:this._point=2,this._x3=i,this._y3=a;break;case 2:this._point=3,this._x4=i,this._y4=a,this._context.moveTo((this._x0+4*this._x1+i)/6,(this._y0+4*this._y1+a)/6);break;default:qU(this,i,a);break}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=a}};function pEt(i){return new hDe(i)}function fDe(i){this._context=i}fDe.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(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(i,a){switch(i=+i,a=+a,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var f=(this._x0+4*this._x1+i)/6,p=(this._y0+4*this._y1+a)/6;this._line?this._context.lineTo(f,p):this._context.moveTo(f,p);break;case 3:this._point=4;default:qU(this,i,a);break}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=a}};function bEt(i){return new fDe(i)}function dDe(i,a){this._basis=new VU(i),this._beta=a}dDe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var i=this._x,a=this._y,f=i.length-1;if(f>0)for(var p=i[0],w=a[0],y=i[f]-p,b=a[f]-w,E=-1,S;++E<=f;)S=E/f,this._basis.point(this._beta*i[E]+(1-this._beta)*(p+S*y),this._beta*a[E]+(1-this._beta)*(w+S*b));this._x=this._y=null,this._basis.lineEnd()},point:function(i,a){this._x.push(+i),this._y.push(+a)}};const vEt=function i(a){function f(p){return a===1?new VU(p):new dDe(p,a)}return f.beta=function(p){return i(+p)},f}(.85);function UU(i,a,f){i._context.bezierCurveTo(i._x1+i._k*(i._x2-i._x0),i._y1+i._k*(i._y2-i._y0),i._x2+i._k*(i._x1-a),i._y2+i._k*(i._y1-f),i._x2,i._y2)}function O1e(i,a){this._context=i,this._k=(1-a)/6}O1e.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:UU(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(i,a){switch(i=+i,a=+a,this._point){case 0:this._point=1,this._line?this._context.lineTo(i,a):this._context.moveTo(i,a);break;case 1:this._point=2,this._x1=i,this._y1=a;break;case 2:this._point=3;default:UU(this,i,a);break}this._x0=this._x1,this._x1=this._x2,this._x2=i,this._y0=this._y1,this._y1=this._y2,this._y2=a}};const wEt=function i(a){function f(p){return new O1e(p,a)}return f.tension=function(p){return i(+p)},f}(0);function N1e(i,a){this._context=i,this._k=(1-a)/6}N1e.prototype={areaStart:Kk,areaEnd:Kk,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}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}}},point:function(i,a){switch(i=+i,a=+a,this._point){case 0:this._point=1,this._x3=i,this._y3=a;break;case 1:this._point=2,this._context.moveTo(this._x4=i,this._y4=a);break;case 2:this._point=3,this._x5=i,this._y5=a;break;default:UU(this,i,a);break}this._x0=this._x1,this._x1=this._x2,this._x2=i,this._y0=this._y1,this._y1=this._y2,this._y2=a}};const mEt=function i(a){function f(p){return new N1e(p,a)}return f.tension=function(p){return i(+p)},f}(0);function P1e(i,a){this._context=i,this._k=(1-a)/6}P1e.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(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(i,a){switch(i=+i,a=+a,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:UU(this,i,a);break}this._x0=this._x1,this._x1=this._x2,this._x2=i,this._y0=this._y1,this._y1=this._y2,this._y2=a}};const yEt=function i(a){function f(p){return new P1e(p,a)}return f.tension=function(p){return i(+p)},f}(0);function B1e(i,a,f){var p=i._x1,w=i._y1,y=i._x2,b=i._y2;if(i._l01_a>m0){var E=2*i._l01_2a+3*i._l01_a*i._l12_a+i._l12_2a,S=3*i._l01_a*(i._l01_a+i._l12_a);p=(p*E-i._x0*i._l12_2a+i._x2*i._l01_2a)/S,w=(w*E-i._y0*i._l12_2a+i._y2*i._l01_2a)/S}if(i._l23_a>m0){var N=2*i._l23_2a+3*i._l23_a*i._l12_a+i._l12_2a,B=3*i._l23_a*(i._l23_a+i._l12_a);y=(y*N+i._x1*i._l23_2a-a*i._l12_2a)/B,b=(b*N+i._y1*i._l23_2a-f*i._l12_2a)/B}i._context.bezierCurveTo(p,w,y,b,i._x2,i._y2)}function gDe(i,a){this._context=i,this._alpha=a}gDe.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}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(i,a){if(i=+i,a=+a,this._point){var f=this._x2-i,p=this._y2-a;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(f*f+p*p,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(i,a):this._context.moveTo(i,a);break;case 1:this._point=2;break;case 2:this._point=3;default:B1e(this,i,a);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=i,this._y0=this._y1,this._y1=this._y2,this._y2=a}};const kEt=function i(a){function f(p){return a?new gDe(p,a):new O1e(p,0)}return f.alpha=function(p){return i(+p)},f}(.5);function pDe(i,a){this._context=i,this._alpha=a}pDe.prototype={areaStart:Kk,areaEnd:Kk,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}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(i,a){if(i=+i,a=+a,this._point){var f=this._x2-i,p=this._y2-a;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(f*f+p*p,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=i,this._y3=a;break;case 1:this._point=2,this._context.moveTo(this._x4=i,this._y4=a);break;case 2:this._point=3,this._x5=i,this._y5=a;break;default:B1e(this,i,a);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=i,this._y0=this._y1,this._y1=this._y2,this._y2=a}};const xEt=function i(a){function f(p){return a?new pDe(p,a):new N1e(p,0)}return f.alpha=function(p){return i(+p)},f}(.5);function bDe(i,a){this._context=i,this._alpha=a}bDe.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(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(i,a){if(i=+i,a=+a,this._point){var f=this._x2-i,p=this._y2-a;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(f*f+p*p,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:B1e(this,i,a);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=i,this._y0=this._y1,this._y1=this._y2,this._y2=a}};const EEt=function i(a){function f(p){return a?new bDe(p,a):new P1e(p,0)}return f.alpha=function(p){return i(+p)},f}(.5);function vDe(i){this._context=i}vDe.prototype={areaStart:Kk,areaEnd:Kk,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(i,a){i=+i,a=+a,this._point?this._context.lineTo(i,a):(this._point=1,this._context.moveTo(i,a))}};function TEt(i){return new vDe(i)}function wDe(i){return i<0?-1:1}function mDe(i,a,f){var p=i._x1-i._x0,w=a-i._x1,y=(i._y1-i._y0)/(p||w<0&&-0),b=(f-i._y1)/(w||p<0&&-0),E=(y*w+b*p)/(p+w);return(wDe(y)+wDe(b))*Math.min(Math.abs(y),Math.abs(b),.5*Math.abs(E))||0}function yDe(i,a){var f=i._x1-i._x0;return f?(3*(i._y1-i._y0)/f-a)/2:a}function R1e(i,a,f){var p=i._x0,w=i._y0,y=i._x1,b=i._y1,E=(y-p)/3;i._context.bezierCurveTo(p+E,w+E*a,y-E,b-E*f,y,b)}function WU(i){this._context=i}WU.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:R1e(this,this._t0,yDe(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(i,a){var f=NaN;if(i=+i,a=+a,!(i===this._x1&&a===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(i,a):this._context.moveTo(i,a);break;case 1:this._point=2;break;case 2:this._point=3,R1e(this,yDe(this,f=mDe(this,i,a)),f);break;default:R1e(this,this._t0,f=mDe(this,i,a));break}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=a,this._t0=f}}};function kDe(i){this._context=new xDe(i)}(kDe.prototype=Object.create(WU.prototype)).point=function(i,a){WU.prototype.point.call(this,a,i)};function xDe(i){this._context=i}xDe.prototype={moveTo:function(i,a){this._context.moveTo(a,i)},closePath:function(){this._context.closePath()},lineTo:function(i,a){this._context.lineTo(a,i)},bezierCurveTo:function(i,a,f,p,w,y){this._context.bezierCurveTo(a,i,p,f,y,w)}};function _Et(i){return new WU(i)}function CEt(i){return new kDe(i)}function EDe(i){this._context=i}EDe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var i=this._x,a=this._y,f=i.length;if(f)if(this._line?this._context.lineTo(i[0],a[0]):this._context.moveTo(i[0],a[0]),f===2)this._context.lineTo(i[1],a[1]);else for(var p=TDe(i),w=TDe(a),y=0,b=1;b=0;--a)w[a]=(b[a]-w[a+1])/y[a];for(y[f-1]=(i[f]+w[f-1])/2,a=0;a=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(i,a){switch(i=+i,a=+a,this._point){case 0:this._point=1,this._line?this._context.lineTo(i,a):this._context.moveTo(i,a);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,a),this._context.lineTo(i,a);else{var f=this._x*(1-this._t)+i*this._t;this._context.lineTo(f,this._y),this._context.lineTo(f,a)}break}}this._x=i,this._y=a}};function AEt(i){return new KU(i,.5)}function LEt(i){return new KU(i,0)}function MEt(i){return new KU(i,1)}function RN(i,a,f){this.k=i,this.x=a,this.y=f}RN.prototype={constructor:RN,scale:function(i){return i===1?this:new RN(this.k*i,this.x,this.y)},translate:function(i,a){return i===0&a===0?this:new RN(this.k,this.x+this.k*i,this.y+this.k*a)},apply:function(i){return[i[0]*this.k+this.x,i[1]*this.k+this.y]},applyX:function(i){return i*this.k+this.x},applyY:function(i){return i*this.k+this.y},invert:function(i){return[(i[0]-this.x)/this.k,(i[1]-this.y)/this.k]},invertX:function(i){return(i-this.x)/this.k},invertY:function(i){return(i-this.y)/this.k},rescaleX:function(i){return i.copy().domain(i.range().map(this.invertX,this).map(i.invert,i))},rescaleY:function(i){return i.copy().domain(i.range().map(this.invertY,this).map(i.invert,i))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},RN.prototype;/*! @license DOMPurify 3.0.2 | (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.2/LICENSE */const{entries:_De,setPrototypeOf:CDe,isFrozen:DEt,getPrototypeOf:IEt,getOwnPropertyDescriptor:OEt}=Object;let{freeze:rg,seal:Gw,create:NEt}=Object,{apply:F1e,construct:j1e}=typeof Reflect<"u"&&Reflect;F1e||(F1e=function(a,f,p){return a.apply(f,p)}),rg||(rg=function(a){return a}),Gw||(Gw=function(a){return a}),j1e||(j1e=function(a,f){return new a(...f)});const PEt=qb(Array.prototype.forEach),SDe=qb(Array.prototype.pop),FN=qb(Array.prototype.push),YU=qb(String.prototype.toLowerCase),$1e=qb(String.prototype.toString),BEt=qb(String.prototype.match),qw=qb(String.prototype.replace),REt=qb(String.prototype.indexOf),FEt=qb(String.prototype.trim),A2=qb(RegExp.prototype.test),H1e=jEt(TypeError);function qb(i){return function(a){for(var f=arguments.length,p=new Array(f>1?f-1:0),w=1;w/gm),qEt=Gw(/\${[\w\W]*}/gm),VEt=Gw(/^data-[\-\w.\u00B7-\uFFFF]/),UEt=Gw(/^aria-[\-\w]+$/),IDe=Gw(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),WEt=Gw(/^(?:\w+script|data):/i),KEt=Gw(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ODe=Gw(/^html$/i);var NDe=Object.freeze({__proto__:null,MUSTACHE_EXPR:zEt,ERB_EXPR:GEt,TMPLIT_EXPR:qEt,DATA_ATTR:VEt,ARIA_ATTR:UEt,IS_ALLOWED_URI:IDe,IS_SCRIPT_OR_DATA:WEt,ATTR_WHITESPACE:KEt,DOCTYPE_NAME:ODe});const YEt=()=>typeof window>"u"?null:window,XEt=function(a,f){if(typeof a!="object"||typeof a.createPolicy!="function")return null;let p=null;const w="data-tt-policy-suffix";f.currentScript&&f.currentScript.hasAttribute(w)&&(p=f.currentScript.getAttribute(w));const y="dompurify"+(p?"#"+p:"");try{return a.createPolicy(y,{createHTML(b){return b},createScriptURL(b){return b}})}catch{return console.warn("TrustedTypes policy "+y+" could not be created."),null}};function PDe(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:YEt();const a=Ai=>PDe(Ai);if(a.version="3.0.2",a.removed=[],!i||!i.document||i.document.nodeType!==9)return a.isSupported=!1,a;const f=i.document;let{document:p}=i;const{DocumentFragment:w,HTMLTemplateElement:y,Node:b,Element:E,NodeFilter:S,NamedNodeMap:N=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:B,DOMParser:R,trustedTypes:j}=i,$=E.prototype,V=XU($,"cloneNode"),Q=XU($,"nextSibling"),oe=XU($,"childNodes"),ce=XU($,"parentNode");if(typeof y=="function"){const Ai=p.createElement("template");Ai.content&&Ai.content.ownerDocument&&(p=Ai.content.ownerDocument)}const se=XEt(j,f),ge=se?se.createHTML(""):"",{implementation:ye,createNodeIterator:ke,createDocumentFragment:Ae,getElementsByTagName:de}=p,{importNode:ve}=f;let te={};a.isSupported=typeof _De=="function"&&typeof ce=="function"&&ye&&typeof ye.createHTMLDocument<"u";const{MUSTACHE_EXPR:xe,ERB_EXPR:De,TMPLIT_EXPR:he,DATA_ATTR:Ie,ARIA_ATTR:ee,IS_SCRIPT_OR_DATA:rt,ATTR_WHITESPACE:me}=NDe;let{IS_ALLOWED_URI:gt}=NDe,pe=null;const Et=Lo({},[...ADe,...z1e,...G1e,...q1e,...LDe]);let wt=null;const jt=Lo({},[...MDe,...V1e,...DDe,...QU]);let At=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Bt=null,cn=null,Nn=!0,Ot=!0,oi=!1,kt=!0,Dt=!1,vt=!1,Nt=!1,ze=!1,Xe=!1,Lt=!1,Ge=!1,Bn=!0,Oe=!1;const Ri="user-content-";let tn=!0,hi=!1,Sr={},Zn=null;const Xn=Lo({},["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 ir=null;const Hn=Lo({},["audio","video","img","source","image","track"]);let tr=null;const ha=Lo({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Zs="http://www.w3.org/1998/Math/MathML",ns="http://www.w3.org/2000/svg",Hi="http://www.w3.org/1999/xhtml";let Js=Hi,Pc=!1,Ga=null;const ws=Lo({},[Zs,ns,Hi],$1e);let Oi;const Er=["application/xhtml+xml","text/html"],br="text/html";let Dr,Vn=null;const qi=p.createElement("form"),yn=function(nn){return nn instanceof RegExp||nn instanceof Function},Bc=function(nn){Vn&&Vn===nn||((!nn||typeof nn!="object")&&(nn={}),nn=AA(nn),Oi=Er.indexOf(nn.PARSER_MEDIA_TYPE)===-1?Oi=br:Oi=nn.PARSER_MEDIA_TYPE,Dr=Oi==="application/xhtml+xml"?$1e:YU,pe="ALLOWED_TAGS"in nn?Lo({},nn.ALLOWED_TAGS,Dr):Et,wt="ALLOWED_ATTR"in nn?Lo({},nn.ALLOWED_ATTR,Dr):jt,Ga="ALLOWED_NAMESPACES"in nn?Lo({},nn.ALLOWED_NAMESPACES,$1e):ws,tr="ADD_URI_SAFE_ATTR"in nn?Lo(AA(ha),nn.ADD_URI_SAFE_ATTR,Dr):ha,ir="ADD_DATA_URI_TAGS"in nn?Lo(AA(Hn),nn.ADD_DATA_URI_TAGS,Dr):Hn,Zn="FORBID_CONTENTS"in nn?Lo({},nn.FORBID_CONTENTS,Dr):Xn,Bt="FORBID_TAGS"in nn?Lo({},nn.FORBID_TAGS,Dr):{},cn="FORBID_ATTR"in nn?Lo({},nn.FORBID_ATTR,Dr):{},Sr="USE_PROFILES"in nn?nn.USE_PROFILES:!1,Nn=nn.ALLOW_ARIA_ATTR!==!1,Ot=nn.ALLOW_DATA_ATTR!==!1,oi=nn.ALLOW_UNKNOWN_PROTOCOLS||!1,kt=nn.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Dt=nn.SAFE_FOR_TEMPLATES||!1,vt=nn.WHOLE_DOCUMENT||!1,Xe=nn.RETURN_DOM||!1,Lt=nn.RETURN_DOM_FRAGMENT||!1,Ge=nn.RETURN_TRUSTED_TYPE||!1,ze=nn.FORCE_BODY||!1,Bn=nn.SANITIZE_DOM!==!1,Oe=nn.SANITIZE_NAMED_PROPS||!1,tn=nn.KEEP_CONTENT!==!1,hi=nn.IN_PLACE||!1,gt=nn.ALLOWED_URI_REGEXP||IDe,Js=nn.NAMESPACE||Hi,At=nn.CUSTOM_ELEMENT_HANDLING||{},nn.CUSTOM_ELEMENT_HANDLING&&yn(nn.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(At.tagNameCheck=nn.CUSTOM_ELEMENT_HANDLING.tagNameCheck),nn.CUSTOM_ELEMENT_HANDLING&&yn(nn.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(At.attributeNameCheck=nn.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),nn.CUSTOM_ELEMENT_HANDLING&&typeof nn.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(At.allowCustomizedBuiltInElements=nn.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Dt&&(Ot=!1),Lt&&(Xe=!0),Sr&&(pe=Lo({},[...LDe]),wt=[],Sr.html===!0&&(Lo(pe,ADe),Lo(wt,MDe)),Sr.svg===!0&&(Lo(pe,z1e),Lo(wt,V1e),Lo(wt,QU)),Sr.svgFilters===!0&&(Lo(pe,G1e),Lo(wt,V1e),Lo(wt,QU)),Sr.mathMl===!0&&(Lo(pe,q1e),Lo(wt,DDe),Lo(wt,QU))),nn.ADD_TAGS&&(pe===Et&&(pe=AA(pe)),Lo(pe,nn.ADD_TAGS,Dr)),nn.ADD_ATTR&&(wt===jt&&(wt=AA(wt)),Lo(wt,nn.ADD_ATTR,Dr)),nn.ADD_URI_SAFE_ATTR&&Lo(tr,nn.ADD_URI_SAFE_ATTR,Dr),nn.FORBID_CONTENTS&&(Zn===Xn&&(Zn=AA(Zn)),Lo(Zn,nn.FORBID_CONTENTS,Dr)),tn&&(pe["#text"]=!0),vt&&Lo(pe,["html","head","body"]),pe.table&&(Lo(pe,["tbody"]),delete Bt.tbody),rg&&rg(nn),Vn=nn)},jn=Lo({},["mi","mo","mn","ms","mtext"]),Ms=Lo({},["foreignobject","desc","title","annotation-xml"]),Pa=Lo({},["title","style","font","a","script"]),Ta=Lo({},z1e);Lo(Ta,G1e),Lo(Ta,$Et);const _a=Lo({},q1e);Lo(_a,HEt);const ka=function(nn){let Tr=ce(nn);(!Tr||!Tr.tagName)&&(Tr={namespaceURI:Js,tagName:"template"});const ai=YU(nn.tagName),Ns=YU(Tr.tagName);return Ga[nn.namespaceURI]?nn.namespaceURI===ns?Tr.namespaceURI===Hi?ai==="svg":Tr.namespaceURI===Zs?ai==="svg"&&(Ns==="annotation-xml"||jn[Ns]):!!Ta[ai]:nn.namespaceURI===Zs?Tr.namespaceURI===Hi?ai==="math":Tr.namespaceURI===ns?ai==="math"&&Ms[Ns]:!!_a[ai]:nn.namespaceURI===Hi?Tr.namespaceURI===ns&&!Ms[Ns]||Tr.namespaceURI===Zs&&!jn[Ns]?!1:!_a[ai]&&(Pa[ai]||!Ta[ai]):!!(Oi==="application/xhtml+xml"&&Ga[nn.namespaceURI]):!1},Qi=function(nn){FN(a.removed,{element:nn});try{nn.parentNode.removeChild(nn)}catch{nn.remove()}},ea=function(nn,Tr){try{FN(a.removed,{attribute:Tr.getAttributeNode(nn),from:Tr})}catch{FN(a.removed,{attribute:null,from:Tr})}if(Tr.removeAttribute(nn),nn==="is"&&!wt[nn])if(Xe||Lt)try{Qi(Tr)}catch{}else try{Tr.setAttribute(nn,"")}catch{}},Ca=function(nn){let Tr,ai;if(ze)nn=""+nn;else{const yu=BEt(nn,/^[\r\n\t ]+/);ai=yu&&yu[0]}Oi==="application/xhtml+xml"&&Js===Hi&&(nn=''+nn+"");const Ns=se?se.createHTML(nn):nn;if(Js===Hi)try{Tr=new R().parseFromString(Ns,Oi)}catch{}if(!Tr||!Tr.documentElement){Tr=ye.createDocument(Js,"template",null);try{Tr.documentElement.innerHTML=Pc?ge:Ns}catch{}}const mc=Tr.body||Tr.documentElement;return nn&&ai&&mc.insertBefore(p.createTextNode(ai),mc.childNodes[0]||null),Js===Hi?de.call(Tr,vt?"html":"body")[0]:vt?Tr.documentElement:mc},Sa=function(nn){return ke.call(nn.ownerDocument||nn,nn,S.SHOW_ELEMENT|S.SHOW_COMMENT|S.SHOW_TEXT,null,!1)},Ka=function(nn){return nn instanceof B&&(typeof nn.nodeName!="string"||typeof nn.textContent!="string"||typeof nn.removeChild!="function"||!(nn.attributes instanceof N)||typeof nn.removeAttribute!="function"||typeof nn.setAttribute!="function"||typeof nn.namespaceURI!="string"||typeof nn.insertBefore!="function"||typeof nn.hasChildNodes!="function")},cg=function(nn){return typeof b=="object"?nn instanceof b:nn&&typeof nn=="object"&&typeof nn.nodeType=="number"&&typeof nn.nodeName=="string"},Gc=function(nn,Tr,ai){te[nn]&&PEt(te[nn],Ns=>{Ns.call(a,Tr,ai,Vn)})},Dh=function(nn){let Tr;if(Gc("beforeSanitizeElements",nn,null),Ka(nn))return Qi(nn),!0;const ai=Dr(nn.nodeName);if(Gc("uponSanitizeElement",nn,{tagName:ai,allowedTags:pe}),nn.hasChildNodes()&&!cg(nn.firstElementChild)&&(!cg(nn.content)||!cg(nn.content.firstElementChild))&&A2(/<[/\w]/g,nn.innerHTML)&&A2(/<[/\w]/g,nn.textContent))return Qi(nn),!0;if(!pe[ai]||Bt[ai]){if(!Bt[ai]&&lp(ai)&&(At.tagNameCheck instanceof RegExp&&A2(At.tagNameCheck,ai)||At.tagNameCheck instanceof Function&&At.tagNameCheck(ai)))return!1;if(tn&&!Zn[ai]){const Ns=ce(nn)||nn.parentNode,mc=oe(nn)||nn.childNodes;if(mc&&Ns){const yu=mc.length;for(let Mo=yu-1;Mo>=0;--Mo)Ns.insertBefore(V(mc[Mo],!0),Q(nn))}}return Qi(nn),!0}return nn instanceof E&&!ka(nn)||(ai==="noscript"||ai==="noembed")&&A2(/<\/no(script|embed)/i,nn.innerHTML)?(Qi(nn),!0):(Dt&&nn.nodeType===3&&(Tr=nn.textContent,Tr=qw(Tr,xe," "),Tr=qw(Tr,De," "),Tr=qw(Tr,he," "),nn.textContent!==Tr&&(FN(a.removed,{element:nn.cloneNode()}),nn.textContent=Tr)),Gc("afterSanitizeElements",nn,null),!1)},Es=function(nn,Tr,ai){if(Bn&&(Tr==="id"||Tr==="name")&&(ai in p||ai in qi))return!1;if(!(Ot&&!cn[Tr]&&A2(Ie,Tr))){if(!(Nn&&A2(ee,Tr))){if(!wt[Tr]||cn[Tr]){if(!(lp(nn)&&(At.tagNameCheck instanceof RegExp&&A2(At.tagNameCheck,nn)||At.tagNameCheck instanceof Function&&At.tagNameCheck(nn))&&(At.attributeNameCheck instanceof RegExp&&A2(At.attributeNameCheck,Tr)||At.attributeNameCheck instanceof Function&&At.attributeNameCheck(Tr))||Tr==="is"&&At.allowCustomizedBuiltInElements&&(At.tagNameCheck instanceof RegExp&&A2(At.tagNameCheck,ai)||At.tagNameCheck instanceof Function&&At.tagNameCheck(ai))))return!1}else if(!tr[Tr]){if(!A2(gt,qw(ai,me,""))){if(!((Tr==="src"||Tr==="xlink:href"||Tr==="href")&&nn!=="script"&&REt(ai,"data:")===0&&ir[nn])){if(!(oi&&!A2(rt,qw(ai,me,"")))){if(ai)return!1}}}}}}return!0},lp=function(nn){return nn.indexOf("-")>0},sd=function(nn){let Tr,ai,Ns,mc;Gc("beforeSanitizeAttributes",nn,null);const{attributes:yu}=nn;if(!yu)return;const Mo={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:wt};for(mc=yu.length;mc--;){Tr=yu[mc];const{name:ku,namespaceURI:Ih}=Tr;if(ai=ku==="value"?Tr.value:FEt(Tr.value),Ns=Dr(ku),Mo.attrName=Ns,Mo.attrValue=ai,Mo.keepAttr=!0,Mo.forceKeepAttr=void 0,Gc("uponSanitizeAttribute",nn,Mo),ai=Mo.attrValue,Mo.forceKeepAttr||(ea(ku,nn),!Mo.keepAttr))continue;if(!kt&&A2(/\/>/i,ai)){ea(ku,nn);continue}Dt&&(ai=qw(ai,xe," "),ai=qw(ai,De," "),ai=qw(ai,he," "));const qf=Dr(nn.nodeName);if(Es(qf,Ns,ai)){if(Oe&&(Ns==="id"||Ns==="name")&&(ea(ku,nn),ai=Ri+ai),se&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!Ih)switch(j.getAttributeType(qf,Ns)){case"TrustedHTML":ai=se.createHTML(ai);break;case"TrustedScriptURL":ai=se.createScriptURL(ai);break}try{Ih?nn.setAttributeNS(Ih,ku,ai):nn.setAttribute(ku,ai),SDe(a.removed)}catch{}}}Gc("afterSanitizeAttributes",nn,null)},sh=function Ai(nn){let Tr;const ai=Sa(nn);for(Gc("beforeSanitizeShadowDOM",nn,null);Tr=ai.nextNode();)Gc("uponSanitizeShadowNode",Tr,null),!Dh(Tr)&&(Tr.content instanceof w&&Ai(Tr.content),sd(Tr));Gc("afterSanitizeShadowDOM",nn,null)};return a.sanitize=function(Ai){let nn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Tr,ai,Ns,mc;if(Pc=!Ai,Pc&&(Ai=""),typeof Ai!="string"&&!cg(Ai)){if(typeof Ai.toString!="function")throw H1e("toString is not a function");if(Ai=Ai.toString(),typeof Ai!="string")throw H1e("dirty is not a string, aborting")}if(!a.isSupported)return Ai;if(Nt||Bc(nn),a.removed=[],typeof Ai=="string"&&(hi=!1),hi){if(Ai.nodeName){const ku=Dr(Ai.nodeName);if(!pe[ku]||Bt[ku])throw H1e("root node is forbidden and cannot be sanitized in-place")}}else if(Ai instanceof b)Tr=Ca(""),ai=Tr.ownerDocument.importNode(Ai,!0),ai.nodeType===1&&ai.nodeName==="BODY"||ai.nodeName==="HTML"?Tr=ai:Tr.appendChild(ai);else{if(!Xe&&!Dt&&!vt&&Ai.indexOf("<")===-1)return se&&Ge?se.createHTML(Ai):Ai;if(Tr=Ca(Ai),!Tr)return Xe?null:Ge?ge:""}Tr&&ze&&Qi(Tr.firstChild);const yu=Sa(hi?Ai:Tr);for(;Ns=yu.nextNode();)Dh(Ns)||(Ns.content instanceof w&&sh(Ns.content),sd(Ns));if(hi)return Ai;if(Xe){if(Lt)for(mc=Ae.call(Tr.ownerDocument);Tr.firstChild;)mc.appendChild(Tr.firstChild);else mc=Tr;return(wt.shadowroot||wt.shadowrootmod)&&(mc=ve.call(f,mc,!0)),mc}let Mo=vt?Tr.outerHTML:Tr.innerHTML;return vt&&pe["!doctype"]&&Tr.ownerDocument&&Tr.ownerDocument.doctype&&Tr.ownerDocument.doctype.name&&A2(ODe,Tr.ownerDocument.doctype.name)&&(Mo=" -`+Mo),Dt&&(Mo=qw(Mo,xe," "),Mo=qw(Mo,De," "),Mo=qw(Mo,he," ")),se&&Ge?se.createHTML(Mo):Mo},a.setConfig=function(Ai){Bc(Ai),Nt=!0},a.clearConfig=function(){Vn=null,Nt=!1},a.isValidAttribute=function(Ai,nn,Tr){Vn||Bc({});const ai=Dr(Ai),Ns=Dr(nn);return Es(ai,Ns,Tr)},a.addHook=function(Ai,nn){typeof nn=="function"&&(te[Ai]=te[Ai]||[],FN(te[Ai],nn))},a.removeHook=function(Ai){if(te[Ai])return SDe(te[Ai])},a.removeHooks=function(Ai){te[Ai]&&(te[Ai]=[])},a.removeAllHooks=function(){te={}},a}var ZU=PDe();const JU=//gi,QEt=i=>i?FDe(i).replace(/\\n/g,"#br#").split("#br#"):[""],BDe=i=>ZU.sanitize(i),RDe=(i,a)=>{var f;if(((f=a.flowchart)==null?void 0:f.htmlLabels)!==!1){const p=a.securityLevel;p==="antiscript"||p==="strict"?i=BDe(i):p!=="loose"&&(i=FDe(i),i=i.replace(//g,">"),i=i.replace(/=/g,"="),i=t9t(i))}return i},ep=(i,a)=>i&&(a.dompurifyConfig?i=ZU.sanitize(RDe(i,a),a.dompurifyConfig).toString():i=ZU.sanitize(RDe(i,a),{FORBID_TAGS:["style"]}).toString(),i),ZEt=(i,a)=>typeof i=="string"?ep(i,a):i.flat().map(f=>ep(f,a)),JEt=i=>JU.test(i),e9t=i=>i.split(JU),t9t=i=>i.replace(/#br#/g,"
    "),FDe=i=>i.replace(JU,"#br#"),n9t=i=>{let a="";return i&&(a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,a=a.replaceAll(/\(/g,"\\("),a=a.replaceAll(/\)/g,"\\)")),a},d1=i=>!(i===!1||["false","null","0"].includes(String(i).trim().toLowerCase())),Yk=function(i){let a=i;if(i.split("~").length-1>=2){let f=a;do a=f,f=a.replace(/~([^\s,:;]+)~/,"<$1>");while(f!=a);return Yk(f)}else return a},Wa={getRows:QEt,sanitizeText:ep,sanitizeTextOrArray:ZEt,hasBreaks:JEt,splitBreaks:e9t,lineBreakRegex:JU,removeScript:BDe,getUrl:n9t,evaluate:d1},eW={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:i=>i>=255?255:i<0?0:i,g:i=>i>=255?255:i<0?0:i,b:i=>i>=255?255:i<0?0:i,h:i=>i%360,s:i=>i>=100?100:i<0?0:i,l:i=>i>=100?100:i<0?0:i,a:i=>i>=1?1:i<0?0:i},toLinear:i=>{const a=i/255;return i>.03928?Math.pow((a+.055)/1.055,2.4):a/12.92},hue2rgb:(i,a,f)=>(f<0&&(f+=1),f>1&&(f-=1),f<1/6?i+(a-i)*6*f:f<1/2?a:f<2/3?i+(a-i)*(2/3-f)*6:i),hsl2rgb:({h:i,s:a,l:f},p)=>{if(!a)return f*2.55;i/=360,a/=100,f/=100;const w=f<.5?f*(1+a):f+a-f*a,y=2*f-w;switch(p){case"r":return eW.hue2rgb(y,w,i+1/3)*255;case"g":return eW.hue2rgb(y,w,i)*255;case"b":return eW.hue2rgb(y,w,i-1/3)*255}},rgb2hsl:({r:i,g:a,b:f},p)=>{i/=255,a/=255,f/=255;const w=Math.max(i,a,f),y=Math.min(i,a,f),b=(w+y)/2;if(p==="l")return b*100;if(w===y)return 0;const E=w-y,S=b>.5?E/(2-w-y):E/(w+y);if(p==="s")return S*100;switch(w){case i:return((a-f)/E+(aa>f?Math.min(a,Math.max(f,i)):Math.min(f,Math.max(a,i)),round:i=>Math.round(i*1e10)/1e10},unit:{dec2hex:i=>{const a=Math.round(i).toString(16);return a.length>1?a:`0${a}`}}},Xk={};for(let i=0;i<=255;i++)Xk[i]=Na.unit.dec2hex(i);const y0={ALL:0,RGB:1,HSL:2};class r9t{constructor(){this.type=y0.ALL}get(){return this.type}set(a){if(this.type&&this.type!==a)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=a}reset(){this.type=y0.ALL}is(a){return this.type===a}}const i9t=r9t;class s9t{constructor(a,f){this.color=f,this.changed=!1,this.data=a,this.type=new i9t}set(a,f){return this.color=f,this.changed=!1,this.data=a,this.type.type=y0.ALL,this}_ensureHSL(){const a=this.data,{h:f,s:p,l:w}=a;f===void 0&&(a.h=Na.channel.rgb2hsl(a,"h")),p===void 0&&(a.s=Na.channel.rgb2hsl(a,"s")),w===void 0&&(a.l=Na.channel.rgb2hsl(a,"l"))}_ensureRGB(){const a=this.data,{r:f,g:p,b:w}=a;f===void 0&&(a.r=Na.channel.hsl2rgb(a,"r")),p===void 0&&(a.g=Na.channel.hsl2rgb(a,"g")),w===void 0&&(a.b=Na.channel.hsl2rgb(a,"b"))}get r(){const a=this.data,f=a.r;return!this.type.is(y0.HSL)&&f!==void 0?f:(this._ensureHSL(),Na.channel.hsl2rgb(a,"r"))}get g(){const a=this.data,f=a.g;return!this.type.is(y0.HSL)&&f!==void 0?f:(this._ensureHSL(),Na.channel.hsl2rgb(a,"g"))}get b(){const a=this.data,f=a.b;return!this.type.is(y0.HSL)&&f!==void 0?f:(this._ensureHSL(),Na.channel.hsl2rgb(a,"b"))}get h(){const a=this.data,f=a.h;return!this.type.is(y0.RGB)&&f!==void 0?f:(this._ensureRGB(),Na.channel.rgb2hsl(a,"h"))}get s(){const a=this.data,f=a.s;return!this.type.is(y0.RGB)&&f!==void 0?f:(this._ensureRGB(),Na.channel.rgb2hsl(a,"s"))}get l(){const a=this.data,f=a.l;return!this.type.is(y0.RGB)&&f!==void 0?f:(this._ensureRGB(),Na.channel.rgb2hsl(a,"l"))}get a(){return this.data.a}set r(a){this.type.set(y0.RGB),this.changed=!0,this.data.r=a}set g(a){this.type.set(y0.RGB),this.changed=!0,this.data.g=a}set b(a){this.type.set(y0.RGB),this.changed=!0,this.data.b=a}set h(a){this.type.set(y0.HSL),this.changed=!0,this.data.h=a}set s(a){this.type.set(y0.HSL),this.changed=!0,this.data.s=a}set l(a){this.type.set(y0.HSL),this.changed=!0,this.data.l=a}set a(a){this.changed=!0,this.data.a=a}}const a9t=s9t,tW=new a9t({r:0,g:0,b:0,a:0},"transparent"),jDe={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:i=>{if(i.charCodeAt(0)!==35)return;const a=i.match(jDe.re);if(!a)return;const f=a[1],p=parseInt(f,16),w=f.length,y=w%4===0,b=w>4,E=b?1:17,S=b?8:4,N=y?0:-1,B=b?255:15;return tW.set({r:(p>>S*(N+3)&B)*E,g:(p>>S*(N+2)&B)*E,b:(p>>S*(N+1)&B)*E,a:y?(p&B)*E/255:1},i)},stringify:i=>{const{r:a,g:f,b:p,a:w}=i;return w<1?`#${Xk[Math.round(a)]}${Xk[Math.round(f)]}${Xk[Math.round(p)]}${Xk[Math.round(w*255)]}`:`#${Xk[Math.round(a)]}${Xk[Math.round(f)]}${Xk[Math.round(p)]}`}},jN=jDe,nW={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,_hue2deg:i=>{const a=i.match(nW.hueRe);if(a){const[,f,p]=a;switch(p){case"grad":return Na.channel.clamp.h(parseFloat(f)*.9);case"rad":return Na.channel.clamp.h(parseFloat(f)*180/Math.PI);case"turn":return Na.channel.clamp.h(parseFloat(f)*360)}}return Na.channel.clamp.h(parseFloat(i))},parse:i=>{const a=i.charCodeAt(0);if(a!==104&&a!==72)return;const f=i.match(nW.re);if(!f)return;const[,p,w,y,b,E]=f;return tW.set({h:nW._hue2deg(p),s:Na.channel.clamp.s(parseFloat(w)),l:Na.channel.clamp.l(parseFloat(y)),a:b?Na.channel.clamp.a(E?parseFloat(b)/100:parseFloat(b)):1},i)},stringify:i=>{const{h:a,s:f,l:p,a:w}=i;return w<1?`hsla(${Na.lang.round(a)}, ${Na.lang.round(f)}%, ${Na.lang.round(p)}%, ${w})`:`hsl(${Na.lang.round(a)}, ${Na.lang.round(f)}%, ${Na.lang.round(p)}%)`}},rW=nW,iW={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"},parse:i=>{i=i.toLowerCase();const a=iW.colors[i];if(a)return jN.parse(a)},stringify:i=>{const a=jN.stringify(i);for(const f in iW.colors)if(iW.colors[f]===a)return f}},$De=iW,HDe={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,parse:i=>{const a=i.charCodeAt(0);if(a!==114&&a!==82)return;const f=i.match(HDe.re);if(!f)return;const[,p,w,y,b,E,S,N,B]=f;return tW.set({r:Na.channel.clamp.r(w?parseFloat(p)*2.55:parseFloat(p)),g:Na.channel.clamp.g(b?parseFloat(y)*2.55:parseFloat(y)),b:Na.channel.clamp.b(S?parseFloat(E)*2.55:parseFloat(E)),a:N?Na.channel.clamp.a(B?parseFloat(N)/100:parseFloat(N)):1},i)},stringify:i=>{const{r:a,g:f,b:p,a:w}=i;return w<1?`rgba(${Na.lang.round(a)}, ${Na.lang.round(f)}, ${Na.lang.round(p)}, ${Na.lang.round(w)})`:`rgb(${Na.lang.round(a)}, ${Na.lang.round(f)}, ${Na.lang.round(p)})`}},sW=HDe,r3={format:{keyword:$De,hex:jN,rgb:sW,rgba:sW,hsl:rW,hsla:rW},parse:i=>{if(typeof i!="string")return i;const a=jN.parse(i)||sW.parse(i)||rW.parse(i)||$De.parse(i);if(a)return a;throw new Error(`Unsupported color format: "${i}"`)},stringify:i=>!i.changed&&i.color?i.color:i.type.is(y0.HSL)||i.data.r===void 0?rW.stringify(i):i.a<1||!Number.isInteger(i.r)||!Number.isInteger(i.g)||!Number.isInteger(i.b)?sW.stringify(i):jN.stringify(i)},zDe=(i,a)=>{const f=r3.parse(i);for(const p in a)f[p]=Na.channel.clamp[p](a[p]);return r3.stringify(f)},$N=(i,a,f=0,p=1)=>{if(typeof i!="number")return zDe(i,{a});const w=tW.set({r:Na.channel.clamp.r(i),g:Na.channel.clamp.g(a),b:Na.channel.clamp.b(f),a:Na.channel.clamp.a(p)});return r3.stringify(w)},o9t=i=>{const{r:a,g:f,b:p}=r3.parse(i),w=.2126*Na.channel.toLinear(a)+.7152*Na.channel.toLinear(f)+.0722*Na.channel.toLinear(p);return Na.lang.round(w)},c9t=i=>o9t(i)>=.5,GDe=i=>!c9t(i),qDe=(i,a,f)=>{const p=r3.parse(i),w=p[a],y=Na.channel.clamp[a](w+f);return w!==y&&(p[a]=y),r3.stringify(p)},Qs=(i,a)=>qDe(i,"l",a),ya=(i,a)=>qDe(i,"l",-a),Gn=(i,a)=>{const f=r3.parse(i),p={};for(const w in a)a[w]&&(p[w]=f[w]+a[w]);return zDe(i,p)},u9t=(i,a,f=50)=>{const{r:p,g:w,b:y,a:b}=r3.parse(i),{r:E,g:S,b:N,a:B}=r3.parse(a),R=f/100,j=R*2-1,$=b-B,Q=((j*$===-1?j:(j+$)/(1+j*$))+1)/2,oe=1-Q,ce=p*Q+E*oe,se=w*Q+S*oe,ge=y*Q+N*oe,ye=b*R+B*(1-R);return $N(ce,se,ge,ye)},Bi=(i,a=100)=>{const f=r3.parse(i);return f.r=255-f.r,f.g=255-f.g,f.b=255-f.b,u9t(f,i,a)},ig=(i,a)=>a?Gn(i,{s:-40,l:10}):Gn(i,{s:-40,l:-10}),aW="#ffffff",oW="#f2f2f2";let l9t=class{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(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||Gn(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Gn(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ig(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ig(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ig(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ig(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Bi(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Bi(this.tertiaryColor),this.lineColor=this.lineColor||Bi(this.background),this.arrowheadColor=this.arrowheadColor||Bi(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?ya(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||ya(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Bi(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||Qs(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||Gn(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Gn(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Gn(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Gn(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Gn(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Gn(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||Gn(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Gn(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Gn(this.primaryColor,{h:330}),this.darkMode)for(let f=0;f{this[p]=a[p]}),this.updateColors(),f.forEach(p=>{this[p]=a[p]})}};const h9t=i=>{const a=new l9t;return a.calculate(i),a};let f9t=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Qs(this.primaryColor,16),this.tertiaryColor=Gn(this.primaryColor,{h:-160}),this.primaryBorderColor=Bi(this.background),this.secondaryBorderColor=ig(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ig(this.tertiaryColor,this.darkMode),this.primaryTextColor=Bi(this.primaryColor),this.secondaryTextColor=Bi(this.secondaryColor),this.tertiaryTextColor=Bi(this.tertiaryColor),this.lineColor=Bi(this.background),this.textColor=Bi(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Qs(Bi("#323D47"),10),this.lineColor="calculated",this.border1="#81B1DB",this.border2=$N(255,255,255,.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=ya("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=ya(this.sectionBkgColor,10),this.taskBorderColor=$N(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=$N(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=Qs(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=Qs(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=Qs(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=Gn(this.primaryColor,{h:64}),this.fillType3=Gn(this.secondaryColor,{h:64}),this.fillType4=Gn(this.primaryColor,{h:-64}),this.fillType5=Gn(this.secondaryColor,{h:-64}),this.fillType6=Gn(this.primaryColor,{h:128}),this.fillType7=Gn(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||Gn(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Gn(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Gn(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Gn(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Gn(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Gn(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Gn(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Gn(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Gn(this.primaryColor,{h:330});for(let a=0;a{this[p]=a[p]}),this.updateColors(),f.forEach(p=>{this[p]=a[p]})}};const d9t=i=>{const a=new f9t;return a.calculate(i),a};let g9t=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=Gn(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=Gn(this.primaryColor,{h:-160}),this.primaryBorderColor=ig(this.primaryColor,this.darkMode),this.secondaryBorderColor=ig(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ig(this.tertiaryColor,this.darkMode),this.primaryTextColor=Bi(this.primaryColor),this.secondaryTextColor=Bi(this.secondaryColor),this.tertiaryTextColor=Bi(this.tertiaryColor),this.lineColor=Bi(this.background),this.textColor=Bi(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=$N(102,102,255,.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||Gn(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Gn(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Gn(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Gn(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Gn(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Gn(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Gn(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Gn(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Gn(this.primaryColor,{h:330}),this["cScalePeer1"]=this["cScalePeer1"]||ya(this.secondaryColor,45),this["cScalePeer2"]=this["cScalePeer2"]||ya(this.tertiaryColor,40);for(let a=0;a{this[p]=a[p]}),this.updateColors(),f.forEach(p=>{this[p]=a[p]})}};const p9t=i=>{const a=new g9t;return a.calculate(i),a};let b9t=class{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=Qs("#cde498",10),this.primaryBorderColor=ig(this.primaryColor,this.darkMode),this.secondaryBorderColor=ig(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ig(this.tertiaryColor,this.darkMode),this.primaryTextColor=Bi(this.primaryColor),this.secondaryTextColor=Bi(this.secondaryColor),this.tertiaryTextColor=Bi(this.primaryColor),this.lineColor=Bi(this.background),this.textColor=Bi(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(){this.actorBorder=ya(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||Gn(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Gn(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Gn(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Gn(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Gn(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Gn(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Gn(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Gn(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Gn(this.primaryColor,{h:330}),this["cScalePeer1"]=this["cScalePeer1"]||ya(this.secondaryColor,45),this["cScalePeer2"]=this["cScalePeer2"]||ya(this.tertiaryColor,40);for(let a=0;a{this[p]=a[p]}),this.updateColors(),f.forEach(p=>{this[p]=a[p]})}};const v9t=i=>{const a=new b9t;return a.calculate(i),a};class w9t{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=Qs(this.contrast,55),this.background="#ffffff",this.tertiaryColor=Gn(this.primaryColor,{h:-160}),this.primaryBorderColor=ig(this.primaryColor,this.darkMode),this.secondaryBorderColor=ig(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ig(this.tertiaryColor,this.darkMode),this.primaryTextColor=Bi(this.primaryColor),this.secondaryTextColor=Bi(this.secondaryColor),this.tertiaryTextColor=Bi(this.tertiaryColor),this.lineColor=Bi(this.background),this.textColor=Bi(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(){this.secondBkg=Qs(this.contrast,55),this.border2=this.contrast,this.actorBorder=Qs(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 a=0;a{this[p]=a[p]}),this.updateColors(),f.forEach(p=>{this[p]=a[p]})}}const g5={base:{getThemeVariables:h9t},dark:{getThemeVariables:d9t},default:{getThemeVariables:p9t},forest:{getThemeVariables:v9t},neutral:{getThemeVariables:i=>{const a=new w9t;return a.calculate(i),a}}},Qk={theme:"default",themeVariables:g5.default.getThemeVariables(),themeCSS:void 0,maxTextSize:5e4,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize"],deterministicIds:!1,deterministicIDSeed:void 0,flowchart:{titleTopMargin:25,diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,useMaxWidth:!0,defaultRenderer:"dagre-wrapper",wrappingWidth:200},sequence:{hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1,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:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20,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:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,displayMode:"",axisFormat:"%Y-%m-%d",tickInterval:void 0,useMaxWidth:!0,topAxis:!1,useWidth:void 0},journey:{diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,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"]},timeline:{diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,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:!1},class:{titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,useMaxWidth:!0,defaultRenderer:"dagre-wrapper"},state:{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,useMaxWidth:!0,defaultRenderer:"dagre-wrapper"},er:{titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,stroke:"gray",fill:"honeydew",fontSize:12,useMaxWidth:!0},pie:{useWidth:void 0,useMaxWidth:!0,textPosition:.75},requirement:{useWidth:void 0,useMaxWidth:!0,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},gitGraph:{titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0},c4:{useWidth:void 0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,useMaxWidth:!0,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:!0,wrapPadding:10,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}},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"},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200},fontSize:16};Qk.class&&(Qk.class.arrowMarkerAbsolute=Qk.arrowMarkerAbsolute),Qk.gitGraph&&(Qk.gitGraph.arrowMarkerAbsolute=Qk.arrowMarkerAbsolute);const VDe=(i,a="")=>Object.keys(i).reduce((f,p)=>Array.isArray(i[p])?f:typeof i[p]=="object"&&i[p]!==null?[...f,a+p,...VDe(i[p],"")]:[...f,a+p],[]),m9t=VDe(Qk,""),y9t=Qk;/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function UDe(i){return typeof i>"u"||i===null}function k9t(i){return typeof i=="object"&&i!==null}function x9t(i){return Array.isArray(i)?i:UDe(i)?[]:[i]}function E9t(i,a){var f,p,w,y;if(a)for(y=Object.keys(a),f=0,p=y.length;fE&&(y=" ... ",a=p-E+y.length),f-p>E&&(b=" ...",f=p+E-b.length),{str:y+i.slice(a,f).replace(/\t/g,"→")+b,pos:p-a+y.length}}function W1e(i,a){return sg.repeat(" ",a-i.length)+i}function I9t(i,a){if(a=Object.create(a||null),!i.buffer)return null;a.maxLength||(a.maxLength=79),typeof a.indent!="number"&&(a.indent=1),typeof a.linesBefore!="number"&&(a.linesBefore=3),typeof a.linesAfter!="number"&&(a.linesAfter=2);for(var f=/\r?\n|\r|\0/g,p=[0],w=[],y,b=-1;y=f.exec(i.buffer);)w.push(y.index),p.push(y.index+y[0].length),i.position<=y.index&&b<0&&(b=p.length-2);b<0&&(b=p.length-1);var E="",S,N,B=Math.min(i.line+a.linesAfter,w.length).toString().length,R=a.maxLength-(a.indent+B+3);for(S=1;S<=a.linesBefore&&!(b-S<0);S++)N=U1e(i.buffer,p[b-S],w[b-S],i.position-(p[b]-p[b-S]),R),E=sg.repeat(" ",a.indent)+W1e((i.line-S+1).toString(),B)+" | "+N.str+` -`+E;for(N=U1e(i.buffer,p[b],w[b],i.position,R),E+=sg.repeat(" ",a.indent)+W1e((i.line+1).toString(),B)+" | "+N.str+` -`,E+=sg.repeat("-",a.indent+B+3+N.pos)+`^ -`,S=1;S<=a.linesAfter&&!(b+S>=w.length);S++)N=U1e(i.buffer,p[b+S],w[b+S],i.position-(p[b]-p[b+S]),R),E+=sg.repeat(" ",a.indent)+W1e((i.line+S+1).toString(),B)+" | "+N.str+` -`;return E.replace(/\n$/,"")}var O9t=I9t,N9t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],P9t=["scalar","sequence","mapping"];function B9t(i){var a={};return i!==null&&Object.keys(i).forEach(function(f){i[f].forEach(function(p){a[String(p)]=f})}),a}function R9t(i,a){if(a=a||{},Object.keys(a).forEach(function(f){if(N9t.indexOf(f)===-1)throw new p5('Unknown option "'+f+'" is met in definition of "'+i+'" YAML type.')}),this.options=a,this.tag=i,this.kind=a.kind||null,this.resolve=a.resolve||function(){return!0},this.construct=a.construct||function(f){return f},this.instanceOf=a.instanceOf||null,this.predicate=a.predicate||null,this.represent=a.represent||null,this.representName=a.representName||null,this.defaultStyle=a.defaultStyle||null,this.multi=a.multi||!1,this.styleAliases=B9t(a.styleAliases||null),P9t.indexOf(this.kind)===-1)throw new p5('Unknown kind "'+this.kind+'" is specified for "'+i+'" YAML type.')}var k0=R9t;function KDe(i,a){var f=[];return i[a].forEach(function(p){var w=f.length;f.forEach(function(y,b){y.tag===p.tag&&y.kind===p.kind&&y.multi===p.multi&&(w=b)}),f[w]=p}),f}function F9t(){var i={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},a,f;function p(w){w.multi?(i.multi[w.kind].push(w),i.multi.fallback.push(w)):i[w.kind][w.tag]=i.fallback[w.tag]=w}for(a=0,f=arguments.length;a=0?"0b"+i.toString(2):"-0b"+i.toString(2).slice(1)},octal:function(i){return i>=0?"0o"+i.toString(8):"-0o"+i.toString(8).slice(1)},decimal:function(i){return i.toString(10)},hexadecimal:function(i){return i>=0?"0x"+i.toString(16).toUpperCase():"-0x"+i.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),iTt=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function sTt(i){return!(i===null||!iTt.test(i)||i[i.length-1]==="_")}function aTt(i){var a,f;return a=i.replace(/_/g,"").toLowerCase(),f=a[0]==="-"?-1:1,"+-".indexOf(a[0])>=0&&(a=a.slice(1)),a===".inf"?f===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:a===".nan"?NaN:f*parseFloat(a,10)}var oTt=/^[-+]?[0-9]+e/;function cTt(i,a){var f;if(isNaN(i))switch(a){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===i)switch(a){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===i)switch(a){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(sg.isNegativeZero(i))return"-0.0";return f=i.toString(10),oTt.test(f)?f.replace("e",".e"):f}function uTt(i){return Object.prototype.toString.call(i)==="[object Number]"&&(i%1!==0||sg.isNegativeZero(i))}var lTt=new k0("tag:yaml.org,2002:float",{kind:"scalar",resolve:sTt,construct:aTt,predicate:uTt,represent:cTt,defaultStyle:"lowercase"}),hTt=YDe.extend({implicit:[U9t,X9t,rTt,lTt]}),fTt=hTt,XDe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),QDe=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 dTt(i){return i===null?!1:XDe.exec(i)!==null||QDe.exec(i)!==null}function gTt(i){var a,f,p,w,y,b,E,S=0,N=null,B,R,j;if(a=XDe.exec(i),a===null&&(a=QDe.exec(i)),a===null)throw new Error("Date resolve error");if(f=+a[1],p=+a[2]-1,w=+a[3],!a[4])return new Date(Date.UTC(f,p,w));if(y=+a[4],b=+a[5],E=+a[6],a[7]){for(S=a[7].slice(0,3);S.length<3;)S+="0";S=+S}return a[9]&&(B=+a[10],R=+(a[11]||0),N=(B*60+R)*6e4,a[9]==="-"&&(N=-N)),j=new Date(Date.UTC(f,p,w,y,b,E,S)),N&&j.setTime(j.getTime()-N),j}function pTt(i){return i.toISOString()}var bTt=new k0("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:dTt,construct:gTt,instanceOf:Date,represent:pTt});function vTt(i){return i==="<<"||i===null}var wTt=new k0("tag:yaml.org,2002:merge",{kind:"scalar",resolve:vTt}),Y1e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function mTt(i){if(i===null)return!1;var a,f,p=0,w=i.length,y=Y1e;for(f=0;f64)){if(a<0)return!1;p+=6}return p%8===0}function yTt(i){var a,f,p=i.replace(/[\r\n=]/g,""),w=p.length,y=Y1e,b=0,E=[];for(a=0;a>16&255),E.push(b>>8&255),E.push(b&255)),b=b<<6|y.indexOf(p.charAt(a));return f=w%4*6,f===0?(E.push(b>>16&255),E.push(b>>8&255),E.push(b&255)):f===18?(E.push(b>>10&255),E.push(b>>2&255)):f===12&&E.push(b>>4&255),new Uint8Array(E)}function kTt(i){var a="",f=0,p,w,y=i.length,b=Y1e;for(p=0;p>18&63],a+=b[f>>12&63],a+=b[f>>6&63],a+=b[f&63]),f=(f<<8)+i[p];return w=y%3,w===0?(a+=b[f>>18&63],a+=b[f>>12&63],a+=b[f>>6&63],a+=b[f&63]):w===2?(a+=b[f>>10&63],a+=b[f>>4&63],a+=b[f<<2&63],a+=b[64]):w===1&&(a+=b[f>>2&63],a+=b[f<<4&63],a+=b[64],a+=b[64]),a}function xTt(i){return Object.prototype.toString.call(i)==="[object Uint8Array]"}var ETt=new k0("tag:yaml.org,2002:binary",{kind:"scalar",resolve:mTt,construct:yTt,predicate:xTt,represent:kTt}),TTt=Object.prototype.hasOwnProperty,_Tt=Object.prototype.toString;function CTt(i){if(i===null)return!0;var a=[],f,p,w,y,b,E=i;for(f=0,p=E.length;f>10)+55296,(i-65536&1023)+56320)}for(var sIe=new Array(256),aIe=new Array(256),MA=0;MA<256;MA++)sIe[MA]=iIe(MA)?1:0,aIe[MA]=iIe(MA);function UTt(i,a){this.input=i,this.filename=a.filename||null,this.schema=a.schema||RTt,this.onWarning=a.onWarning||null,this.legacy=a.legacy||!1,this.json=a.json||!1,this.listener=a.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=i.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function oIe(i,a){var f={name:i.filename,buffer:i.input.slice(0,-1),position:i.position,line:i.line,column:i.position-i.lineStart};return f.snippet=O9t(f),new p5(a,f)}function Os(i,a){throw oIe(i,a)}function lW(i,a){i.onWarning&&i.onWarning.call(null,oIe(i,a))}var cIe={YAML:function(a,f,p){var w,y,b;a.version!==null&&Os(a,"duplication of %YAML directive"),p.length!==1&&Os(a,"YAML directive accepts exactly one argument"),w=/^([0-9]+)\.([0-9]+)$/.exec(p[0]),w===null&&Os(a,"ill-formed argument of the YAML directive"),y=parseInt(w[1],10),b=parseInt(w[2],10),y!==1&&Os(a,"unacceptable YAML version of the document"),a.version=p[0],a.checkLineBreaks=b<2,b!==1&&b!==2&&lW(a,"unsupported YAML version of the document")},TAG:function(a,f,p){var w,y;p.length!==2&&Os(a,"TAG directive accepts exactly two arguments"),w=p[0],y=p[1],tIe.test(w)||Os(a,"ill-formed tag handle (first argument) of the TAG directive"),Zk.call(a.tagMap,w)&&Os(a,'there is a previously declared suffix for "'+w+'" tag handle'),nIe.test(y)||Os(a,"ill-formed tag prefix (second argument) of the TAG directive");try{y=decodeURIComponent(y)}catch{Os(a,"tag prefix is malformed: "+y)}a.tagMap[w]=y}};function Jk(i,a,f,p){var w,y,b,E;if(a1&&(i.result+=sg.repeat(` -`,a-1))}function WTt(i,a,f){var p,w,y,b,E,S,N,B,R=i.kind,j=i.result,$;if($=i.input.charCodeAt(i.position),tp($)||LA($)||$===35||$===38||$===42||$===33||$===124||$===62||$===39||$===34||$===37||$===64||$===96||($===63||$===45)&&(w=i.input.charCodeAt(i.position+1),tp(w)||f&&LA(w)))return!1;for(i.kind="scalar",i.result="",y=b=i.position,E=!1;$!==0;){if($===58){if(w=i.input.charCodeAt(i.position+1),tp(w)||f&&LA(w))break}else if($===35){if(p=i.input.charCodeAt(i.position-1),tp(p))break}else{if(i.position===i.lineStart&&hW(i)||f&&LA($))break;if(i3($))if(S=i.line,N=i.lineStart,B=i.lineIndent,Ff(i,!1,-1),i.lineIndent>=a){E=!0,$=i.input.charCodeAt(i.position);continue}else{i.position=b,i.line=S,i.lineStart=N,i.lineIndent=B;break}}E&&(Jk(i,y,b,!1),Z1e(i,i.line-S),y=b=i.position,E=!1),KE($)||(b=i.position+1),$=i.input.charCodeAt(++i.position)}return Jk(i,y,b,!1),i.result?!0:(i.kind=R,i.result=j,!1)}function KTt(i,a){var f,p,w;if(f=i.input.charCodeAt(i.position),f!==39)return!1;for(i.kind="scalar",i.result="",i.position++,p=w=i.position;(f=i.input.charCodeAt(i.position))!==0;)if(f===39)if(Jk(i,p,i.position,!0),f=i.input.charCodeAt(++i.position),f===39)p=i.position,i.position++,w=i.position;else return!0;else i3(f)?(Jk(i,p,w,!0),Z1e(i,Ff(i,!1,a)),p=w=i.position):i.position===i.lineStart&&hW(i)?Os(i,"unexpected end of the document within a single quoted scalar"):(i.position++,w=i.position);Os(i,"unexpected end of the stream within a single quoted scalar")}function YTt(i,a){var f,p,w,y,b,E;if(E=i.input.charCodeAt(i.position),E!==34)return!1;for(i.kind="scalar",i.result="",i.position++,f=p=i.position;(E=i.input.charCodeAt(i.position))!==0;){if(E===34)return Jk(i,f,i.position,!0),i.position++,!0;if(E===92){if(Jk(i,f,i.position,!0),E=i.input.charCodeAt(++i.position),i3(E))Ff(i,!1,a);else if(E<256&&sIe[E])i.result+=aIe[E],i.position++;else if((b=GTt(E))>0){for(w=b,y=0;w>0;w--)E=i.input.charCodeAt(++i.position),(b=zTt(E))>=0?y=(y<<4)+b:Os(i,"expected hexadecimal character");i.result+=VTt(y),i.position++}else Os(i,"unknown escape sequence");f=p=i.position}else i3(E)?(Jk(i,f,p,!0),Z1e(i,Ff(i,!1,a)),f=p=i.position):i.position===i.lineStart&&hW(i)?Os(i,"unexpected end of the document within a double quoted scalar"):(i.position++,p=i.position)}Os(i,"unexpected end of the stream within a double quoted scalar")}function XTt(i,a){var f=!0,p,w,y,b=i.tag,E,S=i.anchor,N,B,R,j,$,V=Object.create(null),Q,oe,ce,se;if(se=i.input.charCodeAt(i.position),se===91)B=93,$=!1,E=[];else if(se===123)B=125,$=!0,E={};else return!1;for(i.anchor!==null&&(i.anchorMap[i.anchor]=E),se=i.input.charCodeAt(++i.position);se!==0;){if(Ff(i,!0,a),se=i.input.charCodeAt(i.position),se===B)return i.position++,i.tag=b,i.anchor=S,i.kind=$?"mapping":"sequence",i.result=E,!0;f?se===44&&Os(i,"expected the node content, but found ','"):Os(i,"missed comma between flow collection entries"),oe=Q=ce=null,R=j=!1,se===63&&(N=i.input.charCodeAt(i.position+1),tp(N)&&(R=j=!0,i.position++,Ff(i,!0,a))),p=i.line,w=i.lineStart,y=i.position,IA(i,a,cW,!1,!0),oe=i.tag,Q=i.result,Ff(i,!0,a),se=i.input.charCodeAt(i.position),(j||i.line===p)&&se===58&&(R=!0,se=i.input.charCodeAt(++i.position),Ff(i,!0,a),IA(i,a,cW,!1,!0),ce=i.result),$?DA(i,E,V,oe,Q,ce,p,w,y):R?E.push(DA(i,null,V,oe,Q,ce,p,w,y)):E.push(Q),Ff(i,!0,a),se=i.input.charCodeAt(i.position),se===44?(f=!0,se=i.input.charCodeAt(++i.position)):f=!1}Os(i,"unexpected end of the stream within a flow collection")}function QTt(i,a){var f,p,w=X1e,y=!1,b=!1,E=a,S=0,N=!1,B,R;if(R=i.input.charCodeAt(i.position),R===124)p=!1;else if(R===62)p=!0;else return!1;for(i.kind="scalar",i.result="";R!==0;)if(R=i.input.charCodeAt(++i.position),R===43||R===45)X1e===w?w=R===43?eIe:FTt:Os(i,"repeat of a chomping mode identifier");else if((B=qTt(R))>=0)B===0?Os(i,"bad explicit indentation width of a block scalar; it cannot be less than one"):b?Os(i,"repeat of an indentation width identifier"):(E=a+B-1,b=!0);else break;if(KE(R)){do R=i.input.charCodeAt(++i.position);while(KE(R));if(R===35)do R=i.input.charCodeAt(++i.position);while(!i3(R)&&R!==0)}for(;R!==0;){for(Q1e(i),i.lineIndent=0,R=i.input.charCodeAt(i.position);(!b||i.lineIndentE&&(E=i.lineIndent),i3(R)){S++;continue}if(i.lineIndenta)&&S!==0)Os(i,"bad indentation of a sequence entry");else if(i.lineIndenta)&&(oe&&(b=i.line,E=i.lineStart,S=i.position),IA(i,a,uW,!0,w)&&(oe?V=i.result:Q=i.result),oe||(DA(i,R,j,$,V,Q,b,E,S),$=V=Q=null),Ff(i,!0,-1),se=i.input.charCodeAt(i.position)),(i.line===y||i.lineIndent>a)&&se!==0)Os(i,"bad indentation of a mapping entry");else if(i.lineIndenta?S=1:i.lineIndent===a?S=0:i.lineIndenta?S=1:i.lineIndent===a?S=0:i.lineIndent tag; it should be "scalar", not "'+i.kind+'"'),R=0,j=i.implicitTypes.length;R"),i.result!==null&&V.kind!==i.kind&&Os(i,"unacceptable node kind for !<"+i.tag+'> tag; it should be "'+V.kind+'", not "'+i.kind+'"'),V.resolve(i.result,i.tag)?(i.result=V.construct(i.result,i.tag),i.anchor!==null&&(i.anchorMap[i.anchor]=i.result)):Os(i,"cannot resolve a node with !<"+i.tag+"> explicit tag")}return i.listener!==null&&i.listener("close",i),i.tag!==null||i.anchor!==null||B}function n_t(i){var a=i.position,f,p,w,y=!1,b;for(i.version=null,i.checkLineBreaks=i.legacy,i.tagMap=Object.create(null),i.anchorMap=Object.create(null);(b=i.input.charCodeAt(i.position))!==0&&(Ff(i,!0,-1),b=i.input.charCodeAt(i.position),!(i.lineIndent>0||b!==37));){for(y=!0,b=i.input.charCodeAt(++i.position),f=i.position;b!==0&&!tp(b);)b=i.input.charCodeAt(++i.position);for(p=i.input.slice(f,i.position),w=[],p.length<1&&Os(i,"directive name must not be less than one character in length");b!==0;){for(;KE(b);)b=i.input.charCodeAt(++i.position);if(b===35){do b=i.input.charCodeAt(++i.position);while(b!==0&&!i3(b));break}if(i3(b))break;for(f=i.position;b!==0&&!tp(b);)b=i.input.charCodeAt(++i.position);w.push(i.input.slice(f,i.position))}b!==0&&Q1e(i),Zk.call(cIe,p)?cIe[p](i,p,w):lW(i,'unknown document directive "'+p+'"')}if(Ff(i,!0,-1),i.lineIndent===0&&i.input.charCodeAt(i.position)===45&&i.input.charCodeAt(i.position+1)===45&&i.input.charCodeAt(i.position+2)===45?(i.position+=3,Ff(i,!0,-1)):y&&Os(i,"directives end mark is expected"),IA(i,i.lineIndent-1,uW,!1,!0),Ff(i,!0,-1),i.checkLineBreaks&&$Tt.test(i.input.slice(a,i.position))&&lW(i,"non-ASCII line breaks are interpreted as content"),i.documents.push(i.result),i.position===i.lineStart&&hW(i)){i.input.charCodeAt(i.position)===46&&(i.position+=3,Ff(i,!0,-1));return}if(i.position"u"&&(f=a,a=null);var p=hIe(i,f);if(typeof a!="function")return p;for(var w=0,y=p.length;wJ1e(i,y,f)),i):Array.isArray(a)&&Array.isArray(i)?(a.forEach(y=>{i.includes(y)||i.push(y)}),i):i===void 0||p<=0?i!=null&&typeof i=="object"&&typeof a=="object"?Object.assign(i,a):a:(a!==void 0&&typeof i=="object"&&typeof a=="object"&&Object.keys(a).forEach(y=>{typeof a[y]=="object"&&(i[y]===void 0||typeof i[y]=="object")?(i[y]===void 0&&(i[y]=Array.isArray(a[y])?[]:{}),i[y]=J1e(i[y],a[y],{depth:p-1,clobber:w})):(w||typeof i[y]!="object"&&typeof a[y]!="object")&&(i[y]=a[y])}),i)},nd=J1e,OA=Object.freeze(y9t);let np=nd({},OA),dIe,NA=[],zN=nd({},OA);const fW=(i,a)=>{let f=nd({},i),p={};for(const w of a)bIe(w),p=nd(p,w);if(f=nd(f,p),p.theme&&p.theme in g5){const w=nd({},dIe),y=nd(w.themeVariables||{},p.themeVariables);f.theme&&f.theme in g5&&(f.themeVariables=g5[f.theme].getThemeVariables(y))}return zN=f,yIe(zN),zN},h_t=i=>(np=nd({},OA),np=nd(np,i),i.theme&&g5[i.theme]&&(np.themeVariables=g5[i.theme].getThemeVariables(i.themeVariables)),fW(np,NA),np),f_t=i=>{dIe=nd({},i)},d_t=i=>(np=nd(np,i),fW(np,NA),np),gIe=()=>nd({},np),pIe=i=>(yIe(i),nd(zN,i),Tt()),Tt=()=>nd({},zN),bIe=i=>{["secure",...np.secure??[]].forEach(a=>{i[a]!==void 0&&(Fe.debug(`Denied attempt to modify a secure key ${a}`,i[a]),delete i[a])}),Object.keys(i).forEach(a=>{a.indexOf("__")===0&&delete i[a]}),Object.keys(i).forEach(a=>{typeof i[a]=="string"&&(i[a].includes("<")||i[a].includes(">")||i[a].includes("url(data:"))&&delete i[a],typeof i[a]=="object"&&bIe(i[a])})},vIe=i=>{i.fontFamily&&(i.themeVariables?i.themeVariables.fontFamily||(i.themeVariables={fontFamily:i.fontFamily}):i.themeVariables={fontFamily:i.fontFamily}),NA.push(i),fW(np,NA)},dW=(i=np)=>{NA=[],fW(i,NA)};var wIe=(i=>(i.LAZY_LOAD_DEPRECATED="The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",i))(wIe||{});const mIe={},g_t=i=>{mIe[i]||(Fe.warn(wIe[i]),mIe[i]=!0)},yIe=i=>{i&&(i.lazyLoadedDiagrams||i.loadExternalDiagramsAtStartup)&&g_t("LAZY_LOAD_DEPRECATED")},p_t=function(i,a){for(let f of a)i.attr(f[0],f[1])},b_t=function(i,a,f){let p=new Map;return f?(p.set("width","100%"),p.set("style",`max-width: ${a}px;`)):(p.set("height",i),p.set("width",a)),p},Vw=function(i,a,f,p){const w=b_t(a,f,p);p_t(i,w)},YE=function(i,a,f,p){const w=a.node().getBBox(),y=w.width,b=w.height;Fe.info(`SVG bounds: ${y}x${b}`,w);let E=0,S=0;Fe.info(`Graph bounds: ${E}x${S}`,i),E=y+f*2,S=b+f*2,Fe.info(`Calculated bounds: ${E}x${S}`),Vw(a,S,E,p);const N=`${w.x-f} ${w.y-f} ${w.width+2*f} ${w.height+2*f}`;a.attr("viewBox",N)},gW={},v_t=(i,a,f)=>{let p="";return i in gW&&gW[i]?p=gW[i](f):Fe.warn(`No theme found for ${i}`),` & { - font-family: ${f.fontFamily}; - font-size: ${f.fontSize}; - fill: ${f.textColor} +"use strict";var __esbuild_esm_mermaid=(()=>{var Pve=Object.create;var G1=Object.defineProperty;var Bve=Object.getOwnPropertyDescriptor;var Fve=Object.getOwnPropertyNames;var zve=Object.getPrototypeOf,Gve=Object.prototype.hasOwnProperty;var o=(t,e)=>G1(t,"name",{value:e,configurable:!0});var R=(t,e)=>()=>(t&&(e=t(t=0)),e);var gi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),hr=(t,e)=>{for(var r in e)G1(t,r,{get:e[r],enumerable:!0})},Rb=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Fve(e))!Gve.call(t,i)&&i!==r&&G1(t,i,{get:()=>e[i],enumerable:!(n=Bve(e,i))||n.enumerable});return t},dr=(t,e,r)=>(Rb(t,e,"default"),r&&Rb(r,e,"default")),Xi=(t,e,r)=>(r=t!=null?Pve(zve(t)):{},Rb(e||!t||!t.__esModule?G1(r,"default",{value:t,enumerable:!0}):r,t)),$ve=t=>Rb(G1({},"__esModule",{value:!0}),t);var Nb=gi((AC,_C)=>{"use strict";(function(t,e){typeof AC=="object"&&typeof _C<"u"?_C.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(AC,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",a="minute",s="hour",l="day",u="week",h="month",f="quarter",d="year",p="date",m="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|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,v={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:o(function(k){var I=["th","st","nd","rd"],C=k%100;return"["+k+(I[(C-20)%10]||I[C]||I[0])+"]"},"ordinal")},x=o(function(k,I,C){var O=String(k);return!O||O.length>=I?k:""+Array(I+1-O.length).join(C)+k},"m"),b={s:x,z:o(function(k){var I=-k.utcOffset(),C=Math.abs(I),O=Math.floor(C/60),D=C%60;return(I<=0?"+":"-")+x(O,2,"0")+":"+x(D,2,"0")},"z"),m:o(function k(I,C){if(I.date()1)return k(F[0])}else{var B=I.name;S[B]=I,D=B}return!O&&D&&(w=D),D||!O&&w},"t"),A=o(function(k,I){if(E(k))return k.clone();var C=typeof I=="object"?I:{};return C.date=k,C.args=arguments,new M(C)},"O"),L=b;L.l=_,L.i=E,L.w=function(k,I){return A(k,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var M=function(){function k(C){this.$L=_(C.locale,null,!0),this.parse(C),this.$x=this.$x||C.x||{},this[T]=!0}o(k,"M");var I=k.prototype;return I.parse=function(C){this.$d=function(O){var D=O.date,P=O.utc;if(D===null)return new Date(NaN);if(L.u(D))return new Date;if(D instanceof Date)return new Date(D);if(typeof D=="string"&&!/Z$/i.test(D)){var F=D.match(g);if(F){var B=F[2]-1||0,$=(F[7]||"0").substring(0,3);return P?new Date(Date.UTC(F[1],B,F[3]||1,F[4]||0,F[5]||0,F[6]||0,$)):new Date(F[1],B,F[3]||1,F[4]||0,F[5]||0,F[6]||0,$)}}return new Date(D)}(C),this.init()},I.init=function(){var C=this.$d;this.$y=C.getFullYear(),this.$M=C.getMonth(),this.$D=C.getDate(),this.$W=C.getDay(),this.$H=C.getHours(),this.$m=C.getMinutes(),this.$s=C.getSeconds(),this.$ms=C.getMilliseconds()},I.$utils=function(){return L},I.isValid=function(){return this.$d.toString()!==m},I.isSame=function(C,O){var D=A(C);return this.startOf(O)<=D&&D<=this.endOf(O)},I.isAfter=function(C,O){return A(C){"use strict";LF=Xi(Nb(),1),Zc={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},V={trace:o((...t)=>{},"trace"),debug:o((...t)=>{},"debug"),info:o((...t)=>{},"info"),warn:o((...t)=>{},"warn"),error:o((...t)=>{},"error"),fatal:o((...t)=>{},"fatal")},$1=o(function(t="fatal"){let e=Zc.fatal;typeof t=="string"?t.toLowerCase()in Zc&&(e=Zc[t]):typeof t=="number"&&(e=t),V.trace=()=>{},V.debug=()=>{},V.info=()=>{},V.warn=()=>{},V.error=()=>{},V.fatal=()=>{},e<=Zc.fatal&&(V.fatal=console.error?console.error.bind(console,Eo("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Eo("FATAL"))),e<=Zc.error&&(V.error=console.error?console.error.bind(console,Eo("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Eo("ERROR"))),e<=Zc.warn&&(V.warn=console.warn?console.warn.bind(console,Eo("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Eo("WARN"))),e<=Zc.info&&(V.info=console.info?console.info.bind(console,Eo("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Eo("INFO"))),e<=Zc.debug&&(V.debug=console.debug?console.debug.bind(console,Eo("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Eo("DEBUG"))),e<=Zc.trace&&(V.trace=console.debug?console.debug.bind(console,Eo("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Eo("TRACE")))},"setLogLevel"),Eo=o(t=>`%c${(0,LF.default)().format("ss.SSS")} : ${t} : `,"format")});var Vve,np,LC,DF,Mb=R(()=>{"use strict";Vve=Object.freeze({left:0,top:0,width:16,height:16}),np=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),LC=Object.freeze({...Vve,...np}),DF=Object.freeze({...LC,body:"",hidden:!1})});var Uve,RF,NF=R(()=>{"use strict";Mb();Uve=Object.freeze({width:null,height:null}),RF=Object.freeze({...Uve,...np})});var Ib,DC,Ob,MF=R(()=>{"use strict";Ib=/^[a-z0-9]+(-[a-z0-9]+)*$/,DC=o((t,e,r,n="")=>{let i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let l=i.pop(),u=i.pop(),h={provider:i.length>0?i[0]:n,prefix:u,name:l};return e&&!Ob(h)?null:h}let a=i[0],s=a.split("-");if(s.length>1){let l={provider:n,prefix:s.shift(),name:s.join("-")};return e&&!Ob(l)?null:l}if(r&&n===""){let l={provider:n,prefix:"",name:a};return e&&!Ob(l,r)?null:l}return null},"stringToIcon"),Ob=o((t,e)=>t?!!((t.provider===""||t.provider.match(Ib))&&(e&&t.prefix===""||t.prefix.match(Ib))&&t.name.match(Ib)):!1,"validateIconName")});function IF(t,e){let r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);let n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}var OF=R(()=>{"use strict";o(IF,"mergeIconTransformations")});function RC(t,e){let r=IF(t,e);for(let n in DF)n in np?n in t&&!(n in r)&&(r[n]=np[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}var PF=R(()=>{"use strict";Mb();OF();o(RC,"mergeIconData")});function BF(t,e){let r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(s){if(r[s])return i[s]=[];if(!(s in i)){i[s]=null;let l=n[s]&&n[s].parent,u=l&&a(l);u&&(i[s]=[l].concat(u))}return i[s]}return o(a,"resolve"),(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}var FF=R(()=>{"use strict";o(BF,"getIconsTree")});function zF(t,e,r){let n=t.icons,i=t.aliases||Object.create(null),a={};function s(l){a=RC(n[l]||i[l],a)}return o(s,"parse"),s(e),r.forEach(s),RC(t,a)}function NC(t,e){if(t.icons[e])return zF(t,e,[]);let r=BF(t,[e])[e];return r?zF(t,e,r):null}var GF=R(()=>{"use strict";PF();FF();o(zF,"internalGetIconData");o(NC,"getIconData")});function MC(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;let n=t.split(Hve);if(n===null||!n.length)return t;let i=[],a=n.shift(),s=Yve.test(a);for(;;){if(s){let l=parseFloat(a);isNaN(l)?i.push(a):i.push(Math.ceil(l*e*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");s=!s}}var Hve,Yve,$F=R(()=>{"use strict";Hve=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Yve=/^-?[0-9.]*[0-9]+[0-9.]*$/g;o(MC,"calculateSize")});function Wve(t,e="defs"){let r="",n=t.indexOf("<"+e);for(;n>=0;){let i=t.indexOf(">",n),a=t.indexOf("",a);if(s===-1)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(s+1)}return{defs:r,content:t}}function qve(t,e){return t?""+t+""+e:e}function VF(t,e,r){let n=Wve(t);return qve(n.defs,e+n.content+r)}var UF=R(()=>{"use strict";o(Wve,"splitSVGDefs");o(qve,"mergeDefsAndContent");o(VF,"wrapSVGContent")});function IC(t,e){let r={...LC,...t},n={...RF,...e},i={left:r.left,top:r.top,width:r.width,height:r.height},a=r.body;[r,n].forEach(y=>{let v=[],x=y.hFlip,b=y.vFlip,w=y.rotate;x?b?w+=2:(v.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),v.push("scale(-1 1)"),i.top=i.left=0):b&&(v.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),v.push("scale(1 -1)"),i.top=i.left=0);let S;switch(w<0&&(w-=Math.floor(w/4)*4),w=w%4,w){case 1:S=i.height/2+i.top,v.unshift("rotate(90 "+S.toString()+" "+S.toString()+")");break;case 2:v.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:S=i.width/2+i.left,v.unshift("rotate(-90 "+S.toString()+" "+S.toString()+")");break}w%2===1&&(i.left!==i.top&&(S=i.left,i.left=i.top,i.top=S),i.width!==i.height&&(S=i.width,i.width=i.height,i.height=S)),v.length&&(a=VF(a,'',""))});let s=n.width,l=n.height,u=i.width,h=i.height,f,d;s===null?(d=l===null?"1em":l==="auto"?h:l,f=MC(d,u/h)):(f=s==="auto"?u:s,d=l===null?MC(f,h/u):l==="auto"?h:l);let p={},m=o((y,v)=>{Xve(v)||(p[y]=v.toString())},"setAttr");m("width",f),m("height",d);let g=[i.left,i.top,u,h];return p.viewBox=g.join(" "),{attributes:p,viewBox:g,body:a}}var Xve,HF=R(()=>{"use strict";Mb();NF();$F();UF();Xve=o(t=>t==="unset"||t==="undefined"||t==="none","isUnsetKeyword");o(IC,"iconToSVG")});function OC(t,e=Kve){let r=[],n;for(;n=jve.exec(t);)r.push(n[1]);if(!r.length)return t;let i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return r.forEach(a=>{let s=typeof e=="function"?e(a):e+(Qve++).toString(),l=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+l+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),t=t.replace(new RegExp(i,"g"),""),t}var jve,Kve,Qve,YF=R(()=>{"use strict";jve=/\sid="(\S+)"/g,Kve="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16),Qve=0;o(OC,"replaceIDs")});function PC(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(let n in e)r+=" "+n+'="'+e[n]+'"';return'"+t+""}var WF=R(()=>{"use strict";o(PC,"iconToHTML")});var XF=gi((ait,qF)=>{"use strict";var ip=1e3,ap=ip*60,sp=ap*60,$f=sp*24,Zve=$f*7,Jve=$f*365.25;qF.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return e2e(t);if(r==="number"&&isFinite(t))return e.long?r2e(t):t2e(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function e2e(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Jve;case"weeks":case"week":case"w":return r*Zve;case"days":case"day":case"d":return r*$f;case"hours":case"hour":case"hrs":case"hr":case"h":return r*sp;case"minutes":case"minute":case"mins":case"min":case"m":return r*ap;case"seconds":case"second":case"secs":case"sec":case"s":return r*ip;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}o(e2e,"parse");function t2e(t){var e=Math.abs(t);return e>=$f?Math.round(t/$f)+"d":e>=sp?Math.round(t/sp)+"h":e>=ap?Math.round(t/ap)+"m":e>=ip?Math.round(t/ip)+"s":t+"ms"}o(t2e,"fmtShort");function r2e(t){var e=Math.abs(t);return e>=$f?Pb(t,e,$f,"day"):e>=sp?Pb(t,e,sp,"hour"):e>=ap?Pb(t,e,ap,"minute"):e>=ip?Pb(t,e,ip,"second"):t+" ms"}o(r2e,"fmtLong");function Pb(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}o(Pb,"plural")});var KF=gi((oit,jF)=>{"use strict";function n2e(t){r.debug=r,r.default=r,r.coerce=u,r.disable=a,r.enable=i,r.enabled=s,r.humanize=XF(),r.destroy=h,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let d=0;for(let p=0;p{if(E==="%%")return"%";S++;let A=r.formatters[_];if(typeof A=="function"){let L=v[S];E=A.call(x,L),v.splice(S,1),S--}return E}),r.formatArgs.call(x,v),(x.log||r.log).apply(x,v)}return o(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:o(()=>p!==null?p:(m!==r.namespaces&&(m=r.namespaces,g=r.enabled(f)),g),"get"),set:o(v=>{p=v},"set")}),typeof r.init=="function"&&r.init(y),y}o(r,"createDebug");function n(f,d){let p=r(this.namespace+(typeof d>"u"?":":d)+f);return p.log=this.log,p}o(n,"extend");function i(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let d,p=(typeof f=="string"?f:"").split(/[\s,]+/),m=p.length;for(d=0;d"-"+d)].join(",");return r.enable(""),f}o(a,"disable");function s(f){if(f[f.length-1]==="*")return!0;let d,p;for(d=0,p=r.skips.length;d{"use strict";Ys.formatArgs=a2e;Ys.save=s2e;Ys.load=o2e;Ys.useColors=i2e;Ys.storage=l2e();Ys.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Ys.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function i2e(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}o(i2e,"useColors");function a2e(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Bb.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}o(a2e,"formatArgs");Ys.log=console.debug||console.log||(()=>{});function s2e(t){try{t?Ys.storage.setItem("debug",t):Ys.storage.removeItem("debug")}catch{}}o(s2e,"save");function o2e(){let t;try{t=Ys.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}o(o2e,"load");function l2e(){try{return localStorage}catch{}}o(l2e,"localstorage");Bb.exports=KF()(Ys);var{formatters:c2e}=Bb.exports;c2e.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var uit,ZF=R(()=>{"use strict";MF();GF();HF();YF();WF();uit=Xi(QF(),1)});var FC,BC,JF,Fb,u2e,zb,V1=R(()=>{"use strict";ut();ZF();FC={body:'?',height:80,width:80},BC=new Map,JF=new Map,Fb=o(t=>{for(let e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(V.debug("Registering icon pack:",e.name),"loader"in e)JF.set(e.name,e.loader);else if("icons"in e)BC.set(e.name,e.icons);else throw V.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),u2e=o(async(t,e)=>{let r=DC(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);let n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=BC.get(n);if(!i){let s=JF.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},BC.set(n,i)}catch(l){throw V.error(l),new Error(`Failed to load icon set: ${r.prefix}`)}}let a=NC(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),zb=o(async(t,e)=>{let r;try{r=await u2e(t,e?.fallbackPrefix)}catch(a){V.error(a),r=FC}let n=IC(r,e);return PC(OC(n.body),n.attributes)},"getIconSVG")});function Gb(t){for(var e=[],r=1;r{"use strict";o(Gb,"dedent")});var $b,Vf,ez,Vb=R(()=>{"use strict";$b=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,Vf=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,ez=/\s*%%.*\n/gm});var op,GC=R(()=>{"use strict";op=class extends Error{static{o(this,"UnknownDiagramError")}constructor(e){super(e),this.name="UnknownDiagramError"}}});var Uf,lp,Ub,$C,tz,Hf=R(()=>{"use strict";ut();Vb();GC();Uf={},lp=o(function(t,e){t=t.replace($b,"").replace(Vf,"").replace(ez,` +`);for(let[r,{detector:n}]of Object.entries(Uf))if(n(t,e))return r;throw new op(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),Ub=o((...t)=>{for(let{id:e,detector:r,loader:n}of t)$C(e,r,n)},"registerLazyLoadedDiagrams"),$C=o((t,e,r)=>{Uf[t]&&V.warn(`Detector with key ${t} already exists. Overwriting.`),Uf[t]={detector:e,loader:r},V.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),tz=o(t=>Uf[t].loader,"getDiagramLoader")});var U1,rz,VC=R(()=>{"use strict";U1=function(){var t=o(function(_e,me,W,fe){for(W=W||{},fe=_e.length;fe--;W[_e[fe]]=me);return W},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],s=[1,63],l=[1,64],u=[1,65],h=[1,66],f=[1,67],d=[1,68],p=[1,69],m=[1,29],g=[1,30],y=[1,31],v=[1,32],x=[1,33],b=[1,34],w=[1,35],S=[1,36],T=[1,37],E=[1,38],_=[1,39],A=[1,40],L=[1,41],M=[1,42],N=[1,43],k=[1,44],I=[1,45],C=[1,46],O=[1,47],D=[1,48],P=[1,50],F=[1,51],B=[1,52],$=[1,53],z=[1,54],Y=[1,55],Q=[1,56],X=[1,57],ie=[1,58],j=[1,59],J=[1,60],Z=[14,42],H=[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],q=[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],K=[1,82],se=[1,83],ce=[1,84],ue=[1,85],te=[12,14,42],De=[12,14,33,42],oe=[12,14,33,42,76,77,79,80],ke=[12,33],Ie=[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],Se={trace:o(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:o(function(me,W,fe,ge,re,he,ne){var ae=he.length-1;switch(re){case 3:ge.setDirection("TB");break;case 4:ge.setDirection("BT");break;case 5:ge.setDirection("RL");break;case 6:ge.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:ge.setC4Type(he[ae-3]);break;case 19:ge.setTitle(he[ae].substring(6)),this.$=he[ae].substring(6);break;case 20:ge.setAccDescription(he[ae].substring(15)),this.$=he[ae].substring(15);break;case 21:this.$=he[ae].trim(),ge.setTitle(this.$);break;case 22:case 23:this.$=he[ae].trim(),ge.setAccDescription(this.$);break;case 28:he[ae].splice(2,0,"ENTERPRISE"),ge.addPersonOrSystemBoundary(...he[ae]),this.$=he[ae];break;case 29:he[ae].splice(2,0,"SYSTEM"),ge.addPersonOrSystemBoundary(...he[ae]),this.$=he[ae];break;case 30:ge.addPersonOrSystemBoundary(...he[ae]),this.$=he[ae];break;case 31:he[ae].splice(2,0,"CONTAINER"),ge.addContainerBoundary(...he[ae]),this.$=he[ae];break;case 32:ge.addDeploymentNode("node",...he[ae]),this.$=he[ae];break;case 33:ge.addDeploymentNode("nodeL",...he[ae]),this.$=he[ae];break;case 34:ge.addDeploymentNode("nodeR",...he[ae]),this.$=he[ae];break;case 35:ge.popBoundaryParseStack();break;case 39:ge.addPersonOrSystem("person",...he[ae]),this.$=he[ae];break;case 40:ge.addPersonOrSystem("external_person",...he[ae]),this.$=he[ae];break;case 41:ge.addPersonOrSystem("system",...he[ae]),this.$=he[ae];break;case 42:ge.addPersonOrSystem("system_db",...he[ae]),this.$=he[ae];break;case 43:ge.addPersonOrSystem("system_queue",...he[ae]),this.$=he[ae];break;case 44:ge.addPersonOrSystem("external_system",...he[ae]),this.$=he[ae];break;case 45:ge.addPersonOrSystem("external_system_db",...he[ae]),this.$=he[ae];break;case 46:ge.addPersonOrSystem("external_system_queue",...he[ae]),this.$=he[ae];break;case 47:ge.addContainer("container",...he[ae]),this.$=he[ae];break;case 48:ge.addContainer("container_db",...he[ae]),this.$=he[ae];break;case 49:ge.addContainer("container_queue",...he[ae]),this.$=he[ae];break;case 50:ge.addContainer("external_container",...he[ae]),this.$=he[ae];break;case 51:ge.addContainer("external_container_db",...he[ae]),this.$=he[ae];break;case 52:ge.addContainer("external_container_queue",...he[ae]),this.$=he[ae];break;case 53:ge.addComponent("component",...he[ae]),this.$=he[ae];break;case 54:ge.addComponent("component_db",...he[ae]),this.$=he[ae];break;case 55:ge.addComponent("component_queue",...he[ae]),this.$=he[ae];break;case 56:ge.addComponent("external_component",...he[ae]),this.$=he[ae];break;case 57:ge.addComponent("external_component_db",...he[ae]),this.$=he[ae];break;case 58:ge.addComponent("external_component_queue",...he[ae]),this.$=he[ae];break;case 60:ge.addRel("rel",...he[ae]),this.$=he[ae];break;case 61:ge.addRel("birel",...he[ae]),this.$=he[ae];break;case 62:ge.addRel("rel_u",...he[ae]),this.$=he[ae];break;case 63:ge.addRel("rel_d",...he[ae]),this.$=he[ae];break;case 64:ge.addRel("rel_l",...he[ae]),this.$=he[ae];break;case 65:ge.addRel("rel_r",...he[ae]),this.$=he[ae];break;case 66:ge.addRel("rel_b",...he[ae]),this.$=he[ae];break;case 67:he[ae].splice(0,1),ge.addRel("rel",...he[ae]),this.$=he[ae];break;case 68:ge.updateElStyle("update_el_style",...he[ae]),this.$=he[ae];break;case 69:ge.updateRelStyle("update_rel_style",...he[ae]),this.$=he[ae];break;case 70:ge.updateLayoutConfig("update_layout_config",...he[ae]),this.$=he[ae];break;case 71:this.$=[he[ae]];break;case 72:he[ae].unshift(he[ae-1]),this.$=he[ae];break;case 73:case 75:this.$=he[ae].trim();break;case 74:let we={};we[he[ae-1].trim()]=he[ae].trim(),this.$=we;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:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:u,38:h,39:f,40:d,41:p,43:23,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:S,52:T,53:E,54:_,55:A,56:L,57:M,58:N,59:k,60:I,61:C,62:O,63:D,64:P,65:F,66:B,67:$,68:z,69:Y,70:Q,71:X,72:ie,73:j,74:J},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:u,38:h,39:f,40:d,41:p,43:23,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:S,52:T,53:E,54:_,55:A,56:L,57:M,58:N,59:k,60:I,61:C,62:O,63:D,64:P,65:F,66:B,67:$,68:z,69:Y,70:Q,71:X,72:ie,73:j,74:J},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:u,38:h,39:f,40:d,41:p,43:23,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:S,52:T,53:E,54:_,55:A,56:L,57:M,58:N,59:k,60:I,61:C,62:O,63:D,64:P,65:F,66:B,67:$,68:z,69:Y,70:Q,71:X,72:ie,73:j,74:J},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:u,38:h,39:f,40:d,41:p,43:23,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:S,52:T,53:E,54:_,55:A,56:L,57:M,58:N,59:k,60:I,61:C,62:O,63:D,64:P,65:F,66:B,67:$,68:z,69:Y,70:Q,71:X,72:ie,73:j,74:J},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:l,37:u,38:h,39:f,40:d,41:p,43:23,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:S,52:T,53:E,54:_,55:A,56:L,57:M,58:N,59:k,60:I,61:C,62:O,63:D,64:P,65:F,66:B,67:$,68:z,69:Y,70:Q,71:X,72:ie,73:j,74:J},{14:[1,74]},t(Z,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:l,37:u,38:h,39:f,40:d,41:p,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:S,52:T,53:E,54:_,55:A,56:L,57:M,58:N,59:k,60:I,61:C,62:O,63:D,64:P,65:F,66:B,67:$,68:z,69:Y,70:Q,71:X,72:ie,73:j,74:J}),t(Z,[2,14]),t(H,[2,16],{12:[1,76]}),t(Z,[2,36],{12:[1,77]}),t(q,[2,19]),t(q,[2,20]),{25:[1,78]},{27:[1,79]},t(q,[2,23]),{35:80,75:81,76:K,77:se,79:ce,80:ue},{35:86,75:81,76:K,77:se,79:ce,80:ue},{35:87,75:81,76:K,77:se,79:ce,80:ue},{35:88,75:81,76:K,77:se,79:ce,80:ue},{35:89,75:81,76:K,77:se,79:ce,80:ue},{35:90,75:81,76:K,77:se,79:ce,80:ue},{35:91,75:81,76:K,77:se,79:ce,80:ue},{35:92,75:81,76:K,77:se,79:ce,80:ue},{35:93,75:81,76:K,77:se,79:ce,80:ue},{35:94,75:81,76:K,77:se,79:ce,80:ue},{35:95,75:81,76:K,77:se,79:ce,80:ue},{35:96,75:81,76:K,77:se,79:ce,80:ue},{35:97,75:81,76:K,77:se,79:ce,80:ue},{35:98,75:81,76:K,77:se,79:ce,80:ue},{35:99,75:81,76:K,77:se,79:ce,80:ue},{35:100,75:81,76:K,77:se,79:ce,80:ue},{35:101,75:81,76:K,77:se,79:ce,80:ue},{35:102,75:81,76:K,77:se,79:ce,80:ue},{35:103,75:81,76:K,77:se,79:ce,80:ue},{35:104,75:81,76:K,77:se,79:ce,80:ue},t(te,[2,59]),{35:105,75:81,76:K,77:se,79:ce,80:ue},{35:106,75:81,76:K,77:se,79:ce,80:ue},{35:107,75:81,76:K,77:se,79:ce,80:ue},{35:108,75:81,76:K,77:se,79:ce,80:ue},{35:109,75:81,76:K,77:se,79:ce,80:ue},{35:110,75:81,76:K,77:se,79:ce,80:ue},{35:111,75:81,76:K,77:se,79:ce,80:ue},{35:112,75:81,76:K,77:se,79:ce,80:ue},{35:113,75:81,76:K,77:se,79:ce,80:ue},{35:114,75:81,76:K,77:se,79:ce,80:ue},{35:115,75:81,76:K,77:se,79:ce,80:ue},{20:116,29:49,30:61,32:62,34:s,36:l,37:u,38:h,39:f,40:d,41:p,43:23,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:S,52:T,53:E,54:_,55:A,56:L,57:M,58:N,59:k,60:I,61:C,62:O,63:D,64:P,65:F,66:B,67:$,68:z,69:Y,70:Q,71:X,72:ie,73:j,74:J},{12:[1,118],33:[1,117]},{35:119,75:81,76:K,77:se,79:ce,80:ue},{35:120,75:81,76:K,77:se,79:ce,80:ue},{35:121,75:81,76:K,77:se,79:ce,80:ue},{35:122,75:81,76:K,77:se,79:ce,80:ue},{35:123,75:81,76:K,77:se,79:ce,80:ue},{35:124,75:81,76:K,77:se,79:ce,80:ue},{35:125,75:81,76:K,77:se,79:ce,80:ue},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(Z,[2,15]),t(H,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(Z,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:a,34:s,36:l,37:u,38:h,39:f,40:d,41:p,44:m,45:g,46:y,47:v,48:x,49:b,50:w,51:S,52:T,53:E,54:_,55:A,56:L,57:M,58:N,59:k,60:I,61:C,62:O,63:D,64:P,65:F,66:B,67:$,68:z,69:Y,70:Q,71:X,72:ie,73:j,74:J}),t(q,[2,21]),t(q,[2,22]),t(te,[2,39]),t(De,[2,71],{75:81,35:132,76:K,77:se,79:ce,80:ue}),t(oe,[2,73]),{78:[1,133]},t(oe,[2,75]),t(oe,[2,76]),t(te,[2,40]),t(te,[2,41]),t(te,[2,42]),t(te,[2,43]),t(te,[2,44]),t(te,[2,45]),t(te,[2,46]),t(te,[2,47]),t(te,[2,48]),t(te,[2,49]),t(te,[2,50]),t(te,[2,51]),t(te,[2,52]),t(te,[2,53]),t(te,[2,54]),t(te,[2,55]),t(te,[2,56]),t(te,[2,57]),t(te,[2,58]),t(te,[2,60]),t(te,[2,61]),t(te,[2,62]),t(te,[2,63]),t(te,[2,64]),t(te,[2,65]),t(te,[2,66]),t(te,[2,67]),t(te,[2,68]),t(te,[2,69]),t(te,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(ke,[2,28]),t(ke,[2,29]),t(ke,[2,30]),t(ke,[2,31]),t(ke,[2,32]),t(ke,[2,33]),t(ke,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(H,[2,18]),t(Z,[2,38]),t(De,[2,72]),t(oe,[2,74]),t(te,[2,24]),t(te,[2,35]),t(Ie,[2,25]),t(Ie,[2,26],{12:[1,138]}),t(Ie,[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:o(function(me,W){if(W.recoverable)this.trace(me);else{var fe=new Error(me);throw fe.hash=W,fe}},"parseError"),parse:o(function(me){var W=this,fe=[0],ge=[],re=[null],he=[],ne=this.table,ae="",we=0,Te=0,Ce=0,Ae=2,Ge=1,Me=he.slice.call(arguments,1),ye=Object.create(this.lexer),He={yy:{}};for(var ze in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ze)&&(He.yy[ze]=this.yy[ze]);ye.setInput(me,He.yy),He.yy.lexer=ye,He.yy.parser=this,typeof ye.yylloc>"u"&&(ye.yylloc={});var Ze=ye.yylloc;he.push(Ze);var gt=ye.options&&ye.options.ranges;typeof He.yy.parseError=="function"?this.parseError=He.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function yt(St){fe.length=fe.length-2*St,re.length=re.length-St,he.length=he.length-St}o(yt,"popStack");function tt(){var St;return St=ge.pop()||ye.lex()||Ge,typeof St!="number"&&(St instanceof Array&&(ge=St,St=ge.pop()),St=W.symbols_[St]||St),St}o(tt,"lex");for(var Ye,Je,Ve,je,kt,at,xt={},it,dt,lt,It;;){if(Ve=fe[fe.length-1],this.defaultActions[Ve]?je=this.defaultActions[Ve]:((Ye===null||typeof Ye>"u")&&(Ye=tt()),je=ne[Ve]&&ne[Ve][Ye]),typeof je>"u"||!je.length||!je[0]){var mt="";It=[];for(it in ne[Ve])this.terminals_[it]&&it>Ae&&It.push("'"+this.terminals_[it]+"'");ye.showPosition?mt="Parse error on line "+(we+1)+`: +`+ye.showPosition()+` +Expecting `+It.join(", ")+", got '"+(this.terminals_[Ye]||Ye)+"'":mt="Parse error on line "+(we+1)+": Unexpected "+(Ye==Ge?"end of input":"'"+(this.terminals_[Ye]||Ye)+"'"),this.parseError(mt,{text:ye.match,token:this.terminals_[Ye]||Ye,line:ye.yylineno,loc:Ze,expected:It})}if(je[0]instanceof Array&&je.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ve+", token: "+Ye);switch(je[0]){case 1:fe.push(Ye),re.push(ye.yytext),he.push(ye.yylloc),fe.push(je[1]),Ye=null,Je?(Ye=Je,Je=null):(Te=ye.yyleng,ae=ye.yytext,we=ye.yylineno,Ze=ye.yylloc,Ce>0&&Ce--);break;case 2:if(dt=this.productions_[je[1]][1],xt.$=re[re.length-dt],xt._$={first_line:he[he.length-(dt||1)].first_line,last_line:he[he.length-1].last_line,first_column:he[he.length-(dt||1)].first_column,last_column:he[he.length-1].last_column},gt&&(xt._$.range=[he[he.length-(dt||1)].range[0],he[he.length-1].range[1]]),at=this.performAction.apply(xt,[ae,Te,we,He.yy,je[1],re,he].concat(Me)),typeof at<"u")return at;dt&&(fe=fe.slice(0,-1*dt*2),re=re.slice(0,-1*dt),he=he.slice(0,-1*dt)),fe.push(this.productions_[je[1]][0]),re.push(xt.$),he.push(xt._$),lt=ne[fe[fe.length-2]][fe[fe.length-1]],fe.push(lt);break;case 3:return!0}}return!0},"parse")},Ue=function(){var _e={EOF:1,parseError:o(function(W,fe){if(this.yy.parser)this.yy.parser.parseError(W,fe);else throw new Error(W)},"parseError"),setInput:o(function(me,W){return this.yy=W||this.yy||{},this._input=me,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var me=this._input[0];this.yytext+=me,this.yyleng++,this.offset++,this.match+=me,this.matched+=me;var W=me.match(/(?:\r\n?|\n).*/g);return W?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),me},"input"),unput:o(function(me){var W=me.length,fe=me.split(/(?:\r\n?|\n)/g);this._input=me+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-W),this.offset-=W;var ge=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),fe.length-1&&(this.yylineno-=fe.length-1);var re=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:fe?(fe.length===ge.length?this.yylloc.first_column:0)+ge[ge.length-fe.length].length-fe[0].length:this.yylloc.first_column-W},this.options.ranges&&(this.yylloc.range=[re[0],re[0]+this.yyleng-W]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(me){this.unput(this.match.slice(me))},"less"),pastInput:o(function(){var me=this.matched.substr(0,this.matched.length-this.match.length);return(me.length>20?"...":"")+me.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var me=this.match;return me.length<20&&(me+=this._input.substr(0,20-me.length)),(me.substr(0,20)+(me.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var me=this.pastInput(),W=new Array(me.length+1).join("-");return me+this.upcomingInput()+` +`+W+"^"},"showPosition"),test_match:o(function(me,W){var fe,ge,re;if(this.options.backtrack_lexer&&(re={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},this.options.ranges&&(re.yylloc.range=this.yylloc.range.slice(0))),ge=me[0].match(/(?:\r\n?|\n).*/g),ge&&(this.yylineno+=ge.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ge?ge[ge.length-1].length-ge[ge.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+me[0].length},this.yytext+=me[0],this.match+=me[0],this.matches=me,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(me[0].length),this.matched+=me[0],fe=this.performAction.call(this,this.yy,this,W,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),fe)return fe;if(this._backtrack){for(var he in re)this[he]=re[he];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var me,W,fe,ge;this._more||(this.yytext="",this.match="");for(var re=this._currentRules(),he=0;heW[0].length)){if(W=fe,ge=he,this.options.backtrack_lexer){if(me=this.test_match(fe,re[he]),me!==!1)return me;if(this._backtrack){W=!1;continue}else return!1}else if(!this.options.flex)break}return W?(me=this.test_match(W,re[ge]),me!==!1?me:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var W=this.next();return W||this.lex()},"lex"),begin:o(function(W){this.conditionStack.push(W)},"begin"),popState:o(function(){var W=this.conditionStack.length-1;return W>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(W){return W=this.conditionStack.length-1-Math.abs(W||0),W>=0?this.conditionStack[W]:"INITIAL"},"topState"),pushState:o(function(W){this.begin(W)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:o(function(W,fe,ge,re){var he=re;switch(ge){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:return this.begin("acc_title"),24;break;case 7:return this.popState(),"acc_title_value";break;case 8:return this.begin("acc_descr"),26;break;case 9:return this.popState(),"acc_descr_value";break;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:return this.begin("person_ext"),45;break;case 23:return this.begin("person"),44;break;case 24:return this.begin("system_ext_queue"),51;break;case 25:return this.begin("system_ext_db"),50;break;case 26:return this.begin("system_ext"),49;break;case 27:return this.begin("system_queue"),48;break;case 28:return this.begin("system_db"),47;break;case 29:return this.begin("system"),46;break;case 30:return this.begin("boundary"),37;break;case 31:return this.begin("enterprise_boundary"),34;break;case 32:return this.begin("system_boundary"),36;break;case 33:return this.begin("container_ext_queue"),57;break;case 34:return this.begin("container_ext_db"),56;break;case 35:return this.begin("container_ext"),55;break;case 36:return this.begin("container_queue"),54;break;case 37:return this.begin("container_db"),53;break;case 38:return this.begin("container"),52;break;case 39:return this.begin("container_boundary"),38;break;case 40:return this.begin("component_ext_queue"),63;break;case 41:return this.begin("component_ext_db"),62;break;case 42:return this.begin("component_ext"),61;break;case 43:return this.begin("component_queue"),60;break;case 44:return this.begin("component_db"),59;break;case 45:return this.begin("component"),58;break;case 46:return this.begin("node"),39;break;case 47:return this.begin("node"),39;break;case 48:return this.begin("node_l"),40;break;case 49:return this.begin("node_r"),41;break;case 50:return this.begin("rel"),64;break;case 51:return this.begin("birel"),65;break;case 52:return this.begin("rel_u"),66;break;case 53:return this.begin("rel_u"),66;break;case 54:return this.begin("rel_d"),67;break;case 55:return this.begin("rel_d"),67;break;case 56:return this.begin("rel_l"),68;break;case 57:return this.begin("rel_l"),68;break;case 58:return this.begin("rel_r"),69;break;case 59:return this.begin("rel_r"),69;break;case 60:return this.begin("rel_b"),70;break;case 61:return this.begin("rel_index"),71;break;case 62:return this.begin("update_el_style"),72;break;case 63:return this.begin("update_rel_style"),73;break;case 64:return this.begin("update_layout_config"),74;break;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";break;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");break;case 76:return this.begin("string_kv_key"),"STR_KEY";break;case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();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}},"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:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},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:!0}}};return _e}();Se.lexer=Ue;function Pe(){this.yy={}}return o(Pe,"Parser"),Pe.prototype=Se,Se.Parser=Pe,new Pe}();U1.parser=U1;rz=U1});var UC,On,cp=R(()=>{"use strict";UC=o((t,e,{depth:r=2,clobber:n=!1}={})=>{let i={depth:r,clobber:n};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach(a=>UC(t,a,i)),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach(a=>{t.includes(a)||t.push(a)}),t):t===void 0||r<=0?t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e:(e!==void 0&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(a=>{typeof e[a]=="object"&&(t[a]===void 0||typeof t[a]=="object")?(t[a]===void 0&&(t[a]=Array.isArray(e[a])?[]:{}),t[a]=UC(t[a],e[a],{depth:r-1,clobber:n})):(n||typeof t[a]!="object"&&typeof e[a]!="object")&&(t[a]=e[a])}),t)},"assignWithDepth"),On=UC});var Hb,nz,iz=R(()=>{"use strict";Hb={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:o(t=>t>=255?255:t<0?0:t,"r"),g:o(t=>t>=255?255:t<0?0:t,"g"),b:o(t=>t>=255?255:t<0?0:t,"b"),h:o(t=>t%360,"h"),s:o(t=>t>=100?100:t<0?0:t,"s"),l:o(t=>t>=100?100:t<0?0:t,"l"),a:o(t=>t>=1?1:t<0?0:t,"a")},toLinear:o(t=>{let e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},"toLinear"),hue2rgb:o((t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<.16666666666666666?t+(e-t)*6*r:r<.5?e:r<.6666666666666666?t+(e-t)*(.6666666666666666-r)*6:t),"hue2rgb"),hsl2rgb:o(({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;let i=r<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return Hb.hue2rgb(a,i,t+.3333333333333333)*255;case"g":return Hb.hue2rgb(a,i,t)*255;case"b":return Hb.hue2rgb(a,i,t-.3333333333333333)*255}},"hsl2rgb"),rgb2hsl:o(({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;let i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if(n==="l")return s*100;if(i===a)return 0;let l=i-a,u=s>.5?l/(2-i-a):l/(i+a);if(n==="s")return u*100;switch(i){case t:return((e-r)/l+(e{"use strict";h2e={clamp:o((t,e,r)=>e>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),"clamp"),round:o(t=>Math.round(t*1e10)/1e10,"round")},az=h2e});var f2e,oz,lz=R(()=>{"use strict";f2e={dec2hex:o(t=>{let e=Math.round(t).toString(16);return e.length>1?e:`0${e}`},"dec2hex")},oz=f2e});var d2e,Bt,jl=R(()=>{"use strict";iz();sz();lz();d2e={channel:nz,lang:az,unit:oz},Bt=d2e});var Jc,Li,H1=R(()=>{"use strict";jl();Jc={};for(let t=0;t<=255;t++)Jc[t]=Bt.unit.dec2hex(t);Li={ALL:0,RGB:1,HSL:2}});var HC,cz,uz=R(()=>{"use strict";H1();HC=class{static{o(this,"Type")}constructor(){this.type=Li.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=Li.ALL}is(e){return this.type===e}},cz=HC});var YC,hz,fz=R(()=>{"use strict";jl();uz();H1();YC=class{static{o(this,"Channels")}constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new cz}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=Li.ALL,this}_ensureHSL(){let e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=Bt.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=Bt.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Bt.channel.rgb2hsl(e,"l"))}_ensureRGB(){let e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=Bt.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=Bt.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Bt.channel.hsl2rgb(e,"b"))}get r(){let e=this.data,r=e.r;return!this.type.is(Li.HSL)&&r!==void 0?r:(this._ensureHSL(),Bt.channel.hsl2rgb(e,"r"))}get g(){let e=this.data,r=e.g;return!this.type.is(Li.HSL)&&r!==void 0?r:(this._ensureHSL(),Bt.channel.hsl2rgb(e,"g"))}get b(){let e=this.data,r=e.b;return!this.type.is(Li.HSL)&&r!==void 0?r:(this._ensureHSL(),Bt.channel.hsl2rgb(e,"b"))}get h(){let e=this.data,r=e.h;return!this.type.is(Li.RGB)&&r!==void 0?r:(this._ensureRGB(),Bt.channel.rgb2hsl(e,"h"))}get s(){let e=this.data,r=e.s;return!this.type.is(Li.RGB)&&r!==void 0?r:(this._ensureRGB(),Bt.channel.rgb2hsl(e,"s"))}get l(){let e=this.data,r=e.l;return!this.type.is(Li.RGB)&&r!==void 0?r:(this._ensureRGB(),Bt.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(Li.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(Li.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(Li.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(Li.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(Li.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(Li.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}},hz=YC});var p2e,oh,Y1=R(()=>{"use strict";fz();p2e=new hz({r:0,g:0,b:0,a:0},"transparent"),oh=p2e});var dz,Yf,WC=R(()=>{"use strict";Y1();H1();dz={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:o(t=>{if(t.charCodeAt(0)!==35)return;let e=t.match(dz.re);if(!e)return;let r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,s=i>4,l=s?1:17,u=s?8:4,h=a?0:-1,f=s?255:15;return oh.set({r:(n>>u*(h+3)&f)*l,g:(n>>u*(h+2)&f)*l,b:(n>>u*(h+1)&f)*l,a:a?(n&f)*l/255:1},t)},"parse"),stringify:o(t=>{let{r:e,g:r,b:n,a:i}=t;return i<1?`#${Jc[Math.round(e)]}${Jc[Math.round(r)]}${Jc[Math.round(n)]}${Jc[Math.round(i*255)]}`:`#${Jc[Math.round(e)]}${Jc[Math.round(r)]}${Jc[Math.round(n)]}`},"stringify")},Yf=dz});var Yb,W1,pz=R(()=>{"use strict";jl();Y1();Yb={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,_hue2deg:o(t=>{let e=t.match(Yb.hueRe);if(e){let[,r,n]=e;switch(n){case"grad":return Bt.channel.clamp.h(parseFloat(r)*.9);case"rad":return Bt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return Bt.channel.clamp.h(parseFloat(r)*360)}}return Bt.channel.clamp.h(parseFloat(t))},"_hue2deg"),parse:o(t=>{let e=t.charCodeAt(0);if(e!==104&&e!==72)return;let r=t.match(Yb.re);if(!r)return;let[,n,i,a,s,l]=r;return oh.set({h:Yb._hue2deg(n),s:Bt.channel.clamp.s(parseFloat(i)),l:Bt.channel.clamp.l(parseFloat(a)),a:s?Bt.channel.clamp.a(l?parseFloat(s)/100:parseFloat(s)):1},t)},"parse"),stringify:o(t=>{let{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${Bt.lang.round(e)}, ${Bt.lang.round(r)}%, ${Bt.lang.round(n)}%, ${i})`:`hsl(${Bt.lang.round(e)}, ${Bt.lang.round(r)}%, ${Bt.lang.round(n)}%)`},"stringify")},W1=Yb});var Wb,qC,mz=R(()=>{"use strict";WC();Wb={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"},parse:o(t=>{t=t.toLowerCase();let e=Wb.colors[t];if(e)return Yf.parse(e)},"parse"),stringify:o(t=>{let e=Yf.stringify(t);for(let r in Wb.colors)if(Wb.colors[r]===e)return r},"stringify")},qC=Wb});var gz,q1,yz=R(()=>{"use strict";jl();Y1();gz={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,parse:o(t=>{let e=t.charCodeAt(0);if(e!==114&&e!==82)return;let r=t.match(gz.re);if(!r)return;let[,n,i,a,s,l,u,h,f]=r;return oh.set({r:Bt.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:Bt.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:Bt.channel.clamp.b(u?parseFloat(l)*2.55:parseFloat(l)),a:h?Bt.channel.clamp.a(f?parseFloat(h)/100:parseFloat(h)):1},t)},"parse"),stringify:o(t=>{let{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${Bt.lang.round(e)}, ${Bt.lang.round(r)}, ${Bt.lang.round(n)}, ${Bt.lang.round(i)})`:`rgb(${Bt.lang.round(e)}, ${Bt.lang.round(r)}, ${Bt.lang.round(n)})`},"stringify")},q1=gz});var m2e,Di,eu=R(()=>{"use strict";WC();pz();mz();yz();H1();m2e={format:{keyword:qC,hex:Yf,rgb:q1,rgba:q1,hsl:W1,hsla:W1},parse:o(t=>{if(typeof t!="string")return t;let e=Yf.parse(t)||q1.parse(t)||W1.parse(t)||qC.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},"parse"),stringify:o(t=>!t.changed&&t.color?t.color:t.type.is(Li.HSL)||t.data.r===void 0?W1.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?q1.stringify(t):Yf.stringify(t),"stringify")},Di=m2e});var g2e,qb,XC=R(()=>{"use strict";jl();eu();g2e=o((t,e)=>{let r=Di.parse(t);for(let n in e)r[n]=Bt.channel.clamp[n](e[n]);return Di.stringify(r)},"change"),qb=g2e});var y2e,Ws,jC=R(()=>{"use strict";jl();Y1();eu();XC();y2e=o((t,e,r=0,n=1)=>{if(typeof t!="number")return qb(t,{a:e});let i=oh.set({r:Bt.channel.clamp.r(t),g:Bt.channel.clamp.g(e),b:Bt.channel.clamp.b(r),a:Bt.channel.clamp.a(n)});return Di.stringify(i)},"rgba"),Ws=y2e});var v2e,X1,vz=R(()=>{"use strict";jl();eu();v2e=o((t,e)=>Bt.lang.round(Di.parse(t)[e]),"channel"),X1=v2e});var x2e,xz,bz=R(()=>{"use strict";jl();eu();x2e=o(t=>{let{r:e,g:r,b:n}=Di.parse(t),i=.2126*Bt.channel.toLinear(e)+.7152*Bt.channel.toLinear(r)+.0722*Bt.channel.toLinear(n);return Bt.lang.round(i)},"luminance"),xz=x2e});var b2e,wz,Tz=R(()=>{"use strict";bz();b2e=o(t=>xz(t)>=.5,"isLight"),wz=b2e});var w2e,Wa,kz=R(()=>{"use strict";Tz();w2e=o(t=>!wz(t),"isDark"),Wa=w2e});var T2e,Xb,KC=R(()=>{"use strict";jl();eu();T2e=o((t,e,r)=>{let n=Di.parse(t),i=n[e],a=Bt.channel.clamp[e](i+r);return i!==a&&(n[e]=a),Di.stringify(n)},"adjustChannel"),Xb=T2e});var k2e,Et,Ez=R(()=>{"use strict";KC();k2e=o((t,e)=>Xb(t,"l",e),"lighten"),Et=k2e});var E2e,Dt,Cz=R(()=>{"use strict";KC();E2e=o((t,e)=>Xb(t,"l",-e),"darken"),Dt=E2e});var C2e,Oe,Sz=R(()=>{"use strict";eu();XC();C2e=o((t,e)=>{let r=Di.parse(t),n={};for(let i in e)e[i]&&(n[i]=r[i]+e[i]);return qb(t,n)},"adjust"),Oe=C2e});var S2e,Az,_z=R(()=>{"use strict";eu();jC();S2e=o((t,e,r=50)=>{let{r:n,g:i,b:a,a:s}=Di.parse(t),{r:l,g:u,b:h,a:f}=Di.parse(e),d=r/100,p=d*2-1,m=s-f,y=((p*m===-1?p:(p+m)/(1+p*m))+1)/2,v=1-y,x=n*y+l*v,b=i*y+u*v,w=a*y+h*v,S=s*d+f*(1-d);return Ws(x,b,w,S)},"mix"),Az=S2e});var A2e,ot,Lz=R(()=>{"use strict";eu();_z();A2e=o((t,e=100)=>{let r=Di.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,Az(r,t,e)},"invert"),ot=A2e});var Dz=R(()=>{"use strict";jC();vz();kz();Ez();Cz();Sz();Lz()});var al=R(()=>{"use strict";Dz()});var lh,ch,j1=R(()=>{"use strict";lh="#ffffff",ch="#f2f2f2"});var yi,up=R(()=>{"use strict";al();yi=o((t,e)=>e?Oe(t,{s:-40,l:10}):Oe(t,{s:-40,l:-10}),"mkBorder")});var QC,Nz,Mz=R(()=>{"use strict";al();j1();up();QC=class{static{o(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(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||Oe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Oe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||yi(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||yi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||yi(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||yi(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||ot(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||ot(this.tertiaryColor),this.lineColor=this.lineColor||ot(this.background),this.arrowheadColor=this.arrowheadColor||ot(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?Dt(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||Dt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||ot(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||Et(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||Oe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Oe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Oe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Oe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Oe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Oe(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||Oe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Oe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Oe(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},Nz=o(t=>{let e=new QC;return e.calculate(t),e},"getThemeVariables")});var ZC,Iz,Oz=R(()=>{"use strict";al();up();ZC=class{static{o(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Et(this.primaryColor,16),this.tertiaryColor=Oe(this.primaryColor,{h:-160}),this.primaryBorderColor=ot(this.background),this.secondaryBorderColor=yi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=yi(this.tertiaryColor,this.darkMode),this.primaryTextColor=ot(this.primaryColor),this.secondaryTextColor=ot(this.secondaryColor),this.tertiaryTextColor=ot(this.tertiaryColor),this.lineColor=ot(this.background),this.textColor=ot(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Et(ot("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Ws(255,255,255,.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=Dt("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=Dt(this.sectionBkgColor,10),this.taskBorderColor=Ws(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Ws(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.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=Et(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=Et(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=Et(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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,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=Oe(this.primaryColor,{h:64}),this.fillType3=Oe(this.secondaryColor,{h:64}),this.fillType4=Oe(this.primaryColor,{h:-64}),this.fillType5=Oe(this.secondaryColor,{h:-64}),this.fillType6=Oe(this.primaryColor,{h:128}),this.fillType7=Oe(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||Oe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Oe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Oe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Oe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Oe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Oe(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Oe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Oe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Oe(this.primaryColor,{h:330});for(let e=0;e{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},Iz=o(t=>{let e=new ZC;return e.calculate(t),e},"getThemeVariables")});var JC,hp,jb=R(()=>{"use strict";al();up();j1();JC=class{static{o(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=Oe(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=Oe(this.primaryColor,{h:-160}),this.primaryBorderColor=yi(this.primaryColor,this.darkMode),this.secondaryBorderColor=yi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=yi(this.tertiaryColor,this.darkMode),this.primaryTextColor=ot(this.primaryColor),this.secondaryTextColor=ot(this.secondaryColor),this.tertiaryTextColor=ot(this.tertiaryColor),this.lineColor=ot(this.background),this.textColor=ot(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=Ws(102,102,255,.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.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",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||Oe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Oe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Oe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Oe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Oe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Oe(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Oe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Oe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Oe(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Dt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Dt(this.tertiaryColor,40);for(let e=0;e{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},hp=o(t=>{let e=new JC;return e.calculate(t),e},"getThemeVariables")});var e7,Pz,Bz=R(()=>{"use strict";al();j1();up();e7=class{static{o(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=Et("#cde498",10),this.primaryBorderColor=yi(this.primaryColor,this.darkMode),this.secondaryBorderColor=yi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=yi(this.tertiaryColor,this.darkMode),this.primaryTextColor=ot(this.primaryColor),this.secondaryTextColor=ot(this.secondaryColor),this.tertiaryTextColor=ot(this.primaryColor),this.lineColor=ot(this.background),this.textColor=ot(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.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.actorBorder=Dt(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||Oe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Oe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Oe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Oe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Oe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Oe(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Oe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Oe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Oe(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Dt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Dt(this.tertiaryColor,40);for(let e=0;e{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},Pz=o(t=>{let e=new e7;return e.calculate(t),e},"getThemeVariables")});var t7,Fz,zz=R(()=>{"use strict";al();up();j1();t7=class{static{o(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=Et(this.contrast,55),this.background="#ffffff",this.tertiaryColor=Oe(this.primaryColor,{h:-160}),this.primaryBorderColor=yi(this.primaryColor,this.darkMode),this.secondaryBorderColor=yi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=yi(this.tertiaryColor,this.darkMode),this.primaryTextColor=ot(this.primaryColor),this.secondaryTextColor=ot(this.secondaryColor),this.tertiaryTextColor=ot(this.tertiaryColor),this.lineColor=ot(this.background),this.textColor=ot(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.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.secondBkg=Et(this.contrast,55),this.border2=this.contrast,this.actorBorder=Et(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 e=0;e{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},Fz=o(t=>{let e=new t7;return e.calculate(t),e},"getThemeVariables")});var Co,Kb=R(()=>{"use strict";Mz();Oz();jb();Bz();zz();Co={base:{getThemeVariables:Nz},dark:{getThemeVariables:Iz},default:{getThemeVariables:hp},forest:{getThemeVariables:Pz},neutral:{getThemeVariables:Fz}}});var tu,Gz=R(()=>{"use strict";tu={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,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:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,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:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,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:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1},state:{useMaxWidth:!0,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:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,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:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,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:!0,padding:10,maxNodeWidth:200},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,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:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,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:!0,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:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1}});var $z,Vz,Uz,mr,sl=R(()=>{"use strict";Kb();Gz();$z={...tu,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"SIMPLE"},themeCSS:void 0,themeVariables:Co.default.getThemeVariables(),sequence:{...tu.sequence,messageFont:o(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:o(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:o(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},gantt:{...tu.gantt,tickInterval:void 0,useWidth:void 0},c4:{...tu.c4,useWidth:void 0,personFont:o(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),external_personFont:o(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:o(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:o(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:o(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:o(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:o(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:o(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:o(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:o(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:o(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:o(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:o(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:o(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:o(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:o(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:o(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:o(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:o(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:o(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:o(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:o(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...tu.pie,useWidth:984},xyChart:{...tu.xyChart,useWidth:void 0},requirement:{...tu.requirement,useWidth:void 0},packet:{...tu.packet}},Vz=o((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...Vz(t[n],"")]:[...r,e+n],[]),"keyify"),Uz=new Set(Vz($z,"")),mr=$z});var fp,_2e,r7=R(()=>{"use strict";sl();ut();fp=o(t=>{if(V.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>fp(e));return}for(let e of Object.keys(t)){if(V.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!Uz.has(e)||t[e]==null){V.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){V.debug("sanitizing object",e),fp(t[e]);continue}let r=["themeCSS","fontFamily","altFontFamily"];for(let n of r)e.includes(n)&&(V.debug("sanitizing css option",e),t[e]=_2e(t[e]))}if(t.themeVariables)for(let e of Object.keys(t.themeVariables)){let r=t.themeVariables[e];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}V.debug("After sanitization",t)}},"sanitizeDirective"),_2e=o(t=>{let e=0,r=0;for(let n of t){if(e{"use strict";cp();ut();Kb();sl();r7();uh=Object.freeze(mr),fs=On({},uh),dp=[],K1=On({},uh),Qb=o((t,e)=>{let r=On({},t),n={};for(let i of e)Xz(i),n=On(n,i);if(r=On(r,n),n.theme&&n.theme in Co){let i=On({},Yz),a=On(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in Co&&(r.themeVariables=Co[r.theme].getThemeVariables(a))}return K1=r,Kz(K1),K1},"updateCurrentConfig"),n7=o(t=>(fs=On({},uh),fs=On(fs,t),t.theme&&Co[t.theme]&&(fs.themeVariables=Co[t.theme].getThemeVariables(t.themeVariables)),Qb(fs,dp),fs),"setSiteConfig"),Wz=o(t=>{Yz=On({},t)},"saveConfigFromInitialize"),qz=o(t=>(fs=On(fs,t),Qb(fs,dp),fs),"updateSiteConfig"),i7=o(()=>On({},fs),"getSiteConfig"),Zb=o(t=>(Kz(t),On(K1,t),Or()),"setConfig"),Or=o(()=>On({},K1),"getConfig"),Xz=o(t=>{t&&(["secure",...fs.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(V.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&Xz(t[e])}))},"sanitize"),jz=o(t=>{fp(t),t.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),dp.push(t),Qb(fs,dp)},"addDirective"),Q1=o((t=fs)=>{dp=[],Qb(t,dp)},"reset"),L2e={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},Hz={},D2e=o(t=>{Hz[t]||(V.warn(L2e[t]),Hz[t]=!0)},"issueWarning"),Kz=o(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&D2e("LAZY_LOAD_DEPRECATED")},"checkConfig")});var o7=gi((a7,s7)=>{"use strict";(function(t,e){typeof a7=="object"&&typeof s7<"u"?s7.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.DOMPurify=e())})(a7,function(){"use strict";let{entries:t,setPrototypeOf:e,isFrozen:r,getPrototypeOf:n,getOwnPropertyDescriptor:i}=Object,{freeze:a,seal:s,create:l}=Object,{apply:u,construct:h}=typeof Reflect<"u"&&Reflect;a||(a=o(function(Se){return Se},"freeze")),s||(s=o(function(Se){return Se},"seal")),u||(u=o(function(Se,Ue,Pe){return Se.apply(Ue,Pe)},"apply")),h||(h=o(function(Se,Ue){return new Se(...Ue)},"construct"));let f=E(Array.prototype.forEach),d=E(Array.prototype.pop),p=E(Array.prototype.push),m=E(String.prototype.toLowerCase),g=E(String.prototype.toString),y=E(String.prototype.match),v=E(String.prototype.replace),x=E(String.prototype.indexOf),b=E(String.prototype.trim),w=E(Object.prototype.hasOwnProperty),S=E(RegExp.prototype.test),T=_(TypeError);function E(Ie){return function(Se){for(var Ue=arguments.length,Pe=new Array(Ue>1?Ue-1:0),_e=1;_e2&&arguments[2]!==void 0?arguments[2]:m;e&&e(Ie,null);let Pe=Se.length;for(;Pe--;){let _e=Se[Pe];if(typeof _e=="string"){let me=Ue(_e);me!==_e&&(r(Se)||(Se[Pe]=me),_e=me)}Ie[_e]=!0}return Ie}o(A,"addToSet");function L(Ie){for(let Se=0;Se/gm),ie=s(/\${[\w\W]*}/gm),j=s(/^data-[\-\w.\u00B7-\uFFFF]/),J=s(/^aria-[\-\w]+$/),Z=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),H=s(/^(?:\w+script|data):/i),q=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=s(/^html$/i),se=s(/^[a-z][.\w]*(-[.\w]+)+$/i);var ce=Object.freeze({__proto__:null,MUSTACHE_EXPR:Q,ERB_EXPR:X,TMPLIT_EXPR:ie,DATA_ATTR:j,ARIA_ATTR:J,IS_ALLOWED_URI:Z,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:q,DOCTYPE_NAME:K,CUSTOM_ELEMENT:se});let ue={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},te=o(function(){return typeof window>"u"?null:window},"getGlobal"),De=o(function(Se,Ue){if(typeof Se!="object"||typeof Se.createPolicy!="function")return null;let Pe=null,_e="data-tt-policy-suffix";Ue&&Ue.hasAttribute(_e)&&(Pe=Ue.getAttribute(_e));let me="dompurify"+(Pe?"#"+Pe:"");try{return Se.createPolicy(me,{createHTML(W){return W},createScriptURL(W){return W}})}catch{return console.warn("TrustedTypes policy "+me+" could not be created."),null}},"_createTrustedTypesPolicy");function oe(){let Ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:te(),Se=o(Ft=>oe(Ft),"DOMPurify");if(Se.version="3.1.6",Se.removed=[],!Ie||!Ie.document||Ie.document.nodeType!==ue.document)return Se.isSupported=!1,Se;let{document:Ue}=Ie,Pe=Ue,_e=Pe.currentScript,{DocumentFragment:me,HTMLTemplateElement:W,Node:fe,Element:ge,NodeFilter:re,NamedNodeMap:he=Ie.NamedNodeMap||Ie.MozNamedAttrMap,HTMLFormElement:ne,DOMParser:ae,trustedTypes:we}=Ie,Te=ge.prototype,Ce=N(Te,"cloneNode"),Ae=N(Te,"remove"),Ge=N(Te,"nextSibling"),Me=N(Te,"childNodes"),ye=N(Te,"parentNode");if(typeof W=="function"){let Ft=Ue.createElement("template");Ft.content&&Ft.content.ownerDocument&&(Ue=Ft.content.ownerDocument)}let He,ze="",{implementation:Ze,createNodeIterator:gt,createDocumentFragment:yt,getElementsByTagName:tt}=Ue,{importNode:Ye}=Pe,Je={};Se.isSupported=typeof t=="function"&&typeof ye=="function"&&Ze&&Ze.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Ve,ERB_EXPR:je,TMPLIT_EXPR:kt,DATA_ATTR:at,ARIA_ATTR:xt,IS_SCRIPT_OR_DATA:it,ATTR_WHITESPACE:dt,CUSTOM_ELEMENT:lt}=ce,{IS_ALLOWED_URI:It}=ce,mt=null,St=A({},[...k,...I,...C,...D,...F]),gr=null,xn=A({},[...B,...$,...z,...Y]),jt=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),rn=null,Er=null,Kn=!0,hn=!0,Qn=!1,on=!0,Rn=!1,Ha=!0,_a=!1,To=!1,qi=!1,ht=!1,At=!1,$t=!1,rt=!0,Ot=!1,pe="user-content-",ur=!0,be=!1,Ir={},Xc=null,M1=A({},["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"]),_b=null,I1=A({},["audio","video","img","source","image","track"]),O1=null,ci=A({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ko="http://www.w3.org/1998/Math/MathML",ih="http://www.w3.org/2000/svg",Us="http://www.w3.org/1999/xhtml",ah=Us,Lb=!1,P1=null,sa=A({},[ko,ih,Us],g),jc=null,Kc=["application/xhtml+xml","text/html"],us="text/html",_i=null,Wl=null,sh=Ue.createElement("form"),zf=o(function(Re){return Re instanceof RegExp||Re instanceof Function},"isRegexOrFunction"),Hs=o(function(){let Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Wl&&Wl===Re)){if((!Re||typeof Re!="object")&&(Re={}),Re=M(Re),jc=Kc.indexOf(Re.PARSER_MEDIA_TYPE)===-1?us:Re.PARSER_MEDIA_TYPE,_i=jc==="application/xhtml+xml"?g:m,mt=w(Re,"ALLOWED_TAGS")?A({},Re.ALLOWED_TAGS,_i):St,gr=w(Re,"ALLOWED_ATTR")?A({},Re.ALLOWED_ATTR,_i):xn,P1=w(Re,"ALLOWED_NAMESPACES")?A({},Re.ALLOWED_NAMESPACES,g):sa,O1=w(Re,"ADD_URI_SAFE_ATTR")?A(M(ci),Re.ADD_URI_SAFE_ATTR,_i):ci,_b=w(Re,"ADD_DATA_URI_TAGS")?A(M(I1),Re.ADD_DATA_URI_TAGS,_i):I1,Xc=w(Re,"FORBID_CONTENTS")?A({},Re.FORBID_CONTENTS,_i):M1,rn=w(Re,"FORBID_TAGS")?A({},Re.FORBID_TAGS,_i):{},Er=w(Re,"FORBID_ATTR")?A({},Re.FORBID_ATTR,_i):{},Ir=w(Re,"USE_PROFILES")?Re.USE_PROFILES:!1,Kn=Re.ALLOW_ARIA_ATTR!==!1,hn=Re.ALLOW_DATA_ATTR!==!1,Qn=Re.ALLOW_UNKNOWN_PROTOCOLS||!1,on=Re.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Rn=Re.SAFE_FOR_TEMPLATES||!1,Ha=Re.SAFE_FOR_XML!==!1,_a=Re.WHOLE_DOCUMENT||!1,ht=Re.RETURN_DOM||!1,At=Re.RETURN_DOM_FRAGMENT||!1,$t=Re.RETURN_TRUSTED_TYPE||!1,qi=Re.FORCE_BODY||!1,rt=Re.SANITIZE_DOM!==!1,Ot=Re.SANITIZE_NAMED_PROPS||!1,ur=Re.KEEP_CONTENT!==!1,be=Re.IN_PLACE||!1,It=Re.ALLOWED_URI_REGEXP||Z,ah=Re.NAMESPACE||Us,jt=Re.CUSTOM_ELEMENT_HANDLING||{},Re.CUSTOM_ELEMENT_HANDLING&&zf(Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(jt.tagNameCheck=Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&zf(Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(jt.attributeNameCheck=Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&typeof Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(jt.allowCustomizedBuiltInElements=Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Rn&&(hn=!1),At&&(ht=!0),Ir&&(mt=A({},F),gr=[],Ir.html===!0&&(A(mt,k),A(gr,B)),Ir.svg===!0&&(A(mt,I),A(gr,$),A(gr,Y)),Ir.svgFilters===!0&&(A(mt,C),A(gr,$),A(gr,Y)),Ir.mathMl===!0&&(A(mt,D),A(gr,z),A(gr,Y))),Re.ADD_TAGS&&(mt===St&&(mt=M(mt)),A(mt,Re.ADD_TAGS,_i)),Re.ADD_ATTR&&(gr===xn&&(gr=M(gr)),A(gr,Re.ADD_ATTR,_i)),Re.ADD_URI_SAFE_ATTR&&A(O1,Re.ADD_URI_SAFE_ATTR,_i),Re.FORBID_CONTENTS&&(Xc===M1&&(Xc=M(Xc)),A(Xc,Re.FORBID_CONTENTS,_i)),ur&&(mt["#text"]=!0),_a&&A(mt,["html","head","body"]),mt.table&&(A(mt,["tbody"]),delete rn.tbody),Re.TRUSTED_TYPES_POLICY){if(typeof Re.TRUSTED_TYPES_POLICY.createHTML!="function")throw T('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Re.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw T('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');He=Re.TRUSTED_TYPES_POLICY,ze=He.createHTML("")}else He===void 0&&(He=De(we,_e)),He!==null&&typeof ze=="string"&&(ze=He.createHTML(""));a&&a(Re),Wl=Re}},"_parseConfig"),B1=A({},["mi","mo","mn","ms","mtext"]),Gf=A({},["foreignobject","annotation-xml"]),F1=A({},["title","style","font","a","script"]),La=A({},[...I,...C,...O]),vF=A({},[...D,...P]),Ive=o(function(Re){let st=ye(Re);(!st||!st.tagName)&&(st={namespaceURI:ah,tagName:"template"});let Rt=m(Re.tagName),bn=m(st.tagName);return P1[Re.namespaceURI]?Re.namespaceURI===ih?st.namespaceURI===Us?Rt==="svg":st.namespaceURI===ko?Rt==="svg"&&(bn==="annotation-xml"||B1[bn]):!!La[Rt]:Re.namespaceURI===ko?st.namespaceURI===Us?Rt==="math":st.namespaceURI===ih?Rt==="math"&&Gf[bn]:!!vF[Rt]:Re.namespaceURI===Us?st.namespaceURI===ih&&!Gf[bn]||st.namespaceURI===ko&&!B1[bn]?!1:!vF[Rt]&&(F1[Rt]||!La[Rt]):!!(jc==="application/xhtml+xml"&&P1[Re.namespaceURI]):!1},"_checkValidNamespace"),ql=o(function(Re){p(Se.removed,{element:Re});try{ye(Re).removeChild(Re)}catch{Ae(Re)}},"_forceRemove"),Db=o(function(Re,st){try{p(Se.removed,{attribute:st.getAttributeNode(Re),from:st})}catch{p(Se.removed,{attribute:null,from:st})}if(st.removeAttribute(Re),Re==="is"&&!gr[Re])if(ht||At)try{ql(st)}catch{}else try{st.setAttribute(Re,"")}catch{}},"_removeAttribute"),xF=o(function(Re){let st=null,Rt=null;if(qi)Re=""+Re;else{let oa=y(Re,/^[\r\n\t ]+/);Rt=oa&&oa[0]}jc==="application/xhtml+xml"&&ah===Us&&(Re=''+Re+"");let bn=He?He.createHTML(Re):Re;if(ah===Us)try{st=new ae().parseFromString(bn,jc)}catch{}if(!st||!st.documentElement){st=Ze.createDocument(ah,"template",null);try{st.documentElement.innerHTML=Lb?ze:bn}catch{}}let Da=st.body||st.documentElement;return Re&&Rt&&Da.insertBefore(Ue.createTextNode(Rt),Da.childNodes[0]||null),ah===Us?tt.call(st,_a?"html":"body")[0]:_a?st.documentElement:Da},"_initDocument"),bF=o(function(Re){return gt.call(Re.ownerDocument||Re,Re,re.SHOW_ELEMENT|re.SHOW_COMMENT|re.SHOW_TEXT|re.SHOW_PROCESSING_INSTRUCTION|re.SHOW_CDATA_SECTION,null)},"_createNodeIterator"),wF=o(function(Re){return Re instanceof ne&&(typeof Re.nodeName!="string"||typeof Re.textContent!="string"||typeof Re.removeChild!="function"||!(Re.attributes instanceof he)||typeof Re.removeAttribute!="function"||typeof Re.setAttribute!="function"||typeof Re.namespaceURI!="string"||typeof Re.insertBefore!="function"||typeof Re.hasChildNodes!="function")},"_isClobbered"),TF=o(function(Re){return typeof fe=="function"&&Re instanceof fe},"_isNode"),Qc=o(function(Re,st,Rt){Je[Re]&&f(Je[Re],bn=>{bn.call(Se,st,Rt,Wl)})},"_executeHook"),kF=o(function(Re){let st=null;if(Qc("beforeSanitizeElements",Re,null),wF(Re))return ql(Re),!0;let Rt=_i(Re.nodeName);if(Qc("uponSanitizeElement",Re,{tagName:Rt,allowedTags:mt}),Re.hasChildNodes()&&!TF(Re.firstElementChild)&&S(/<[/\w]/g,Re.innerHTML)&&S(/<[/\w]/g,Re.textContent)||Re.nodeType===ue.progressingInstruction||Ha&&Re.nodeType===ue.comment&&S(/<[/\w]/g,Re.data))return ql(Re),!0;if(!mt[Rt]||rn[Rt]){if(!rn[Rt]&&CF(Rt)&&(jt.tagNameCheck instanceof RegExp&&S(jt.tagNameCheck,Rt)||jt.tagNameCheck instanceof Function&&jt.tagNameCheck(Rt)))return!1;if(ur&&!Xc[Rt]){let bn=ye(Re)||Re.parentNode,Da=Me(Re)||Re.childNodes;if(Da&&bn){let oa=Da.length;for(let hs=oa-1;hs>=0;--hs){let Xl=Ce(Da[hs],!0);Xl.__removalCount=(Re.__removalCount||0)+1,bn.insertBefore(Xl,Ge(Re))}}}return ql(Re),!0}return Re instanceof ge&&!Ive(Re)||(Rt==="noscript"||Rt==="noembed"||Rt==="noframes")&&S(/<\/no(script|embed|frames)/i,Re.innerHTML)?(ql(Re),!0):(Rn&&Re.nodeType===ue.text&&(st=Re.textContent,f([Ve,je,kt],bn=>{st=v(st,bn," ")}),Re.textContent!==st&&(p(Se.removed,{element:Re.cloneNode()}),Re.textContent=st)),Qc("afterSanitizeElements",Re,null),!1)},"_sanitizeElements"),EF=o(function(Re,st,Rt){if(rt&&(st==="id"||st==="name")&&(Rt in Ue||Rt in sh))return!1;if(!(hn&&!Er[st]&&S(at,st))){if(!(Kn&&S(xt,st))){if(!gr[st]||Er[st]){if(!(CF(Re)&&(jt.tagNameCheck instanceof RegExp&&S(jt.tagNameCheck,Re)||jt.tagNameCheck instanceof Function&&jt.tagNameCheck(Re))&&(jt.attributeNameCheck instanceof RegExp&&S(jt.attributeNameCheck,st)||jt.attributeNameCheck instanceof Function&&jt.attributeNameCheck(st))||st==="is"&&jt.allowCustomizedBuiltInElements&&(jt.tagNameCheck instanceof RegExp&&S(jt.tagNameCheck,Rt)||jt.tagNameCheck instanceof Function&&jt.tagNameCheck(Rt))))return!1}else if(!O1[st]){if(!S(It,v(Rt,dt,""))){if(!((st==="src"||st==="xlink:href"||st==="href")&&Re!=="script"&&x(Rt,"data:")===0&&_b[Re])){if(!(Qn&&!S(it,v(Rt,dt,"")))){if(Rt)return!1}}}}}}return!0},"_isValidAttribute"),CF=o(function(Re){return Re!=="annotation-xml"&&y(Re,lt)},"_isBasicCustomElement"),SF=o(function(Re){Qc("beforeSanitizeAttributes",Re,null);let{attributes:st}=Re;if(!st)return;let Rt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:gr},bn=st.length;for(;bn--;){let Da=st[bn],{name:oa,namespaceURI:hs,value:Xl}=Da,z1=_i(oa),Ya=oa==="value"?Xl:b(Xl);if(Rt.attrName=z1,Rt.attrValue=Ya,Rt.keepAttr=!0,Rt.forceKeepAttr=void 0,Qc("uponSanitizeAttribute",Re,Rt),Ya=Rt.attrValue,Ha&&S(/((--!?|])>)|<\/(style|title)/i,Ya)){Db(oa,Re);continue}if(Rt.forceKeepAttr||(Db(oa,Re),!Rt.keepAttr))continue;if(!on&&S(/\/>/i,Ya)){Db(oa,Re);continue}Rn&&f([Ve,je,kt],_F=>{Ya=v(Ya,_F," ")});let AF=_i(Re.nodeName);if(EF(AF,z1,Ya)){if(Ot&&(z1==="id"||z1==="name")&&(Db(oa,Re),Ya=pe+Ya),He&&typeof we=="object"&&typeof we.getAttributeType=="function"&&!hs)switch(we.getAttributeType(AF,z1)){case"TrustedHTML":{Ya=He.createHTML(Ya);break}case"TrustedScriptURL":{Ya=He.createScriptURL(Ya);break}}try{hs?Re.setAttributeNS(hs,oa,Ya):Re.setAttribute(oa,Ya),wF(Re)?ql(Re):d(Se.removed)}catch{}}}Qc("afterSanitizeAttributes",Re,null)},"_sanitizeAttributes"),Ove=o(function Ft(Re){let st=null,Rt=bF(Re);for(Qc("beforeSanitizeShadowDOM",Re,null);st=Rt.nextNode();)Qc("uponSanitizeShadowNode",st,null),!kF(st)&&(st.content instanceof me&&Ft(st.content),SF(st));Qc("afterSanitizeShadowDOM",Re,null)},"_sanitizeShadowDOM");return Se.sanitize=function(Ft){let Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},st=null,Rt=null,bn=null,Da=null;if(Lb=!Ft,Lb&&(Ft=""),typeof Ft!="string"&&!TF(Ft))if(typeof Ft.toString=="function"){if(Ft=Ft.toString(),typeof Ft!="string")throw T("dirty is not a string, aborting")}else throw T("toString is not a function");if(!Se.isSupported)return Ft;if(To||Hs(Re),Se.removed=[],typeof Ft=="string"&&(be=!1),be){if(Ft.nodeName){let Xl=_i(Ft.nodeName);if(!mt[Xl]||rn[Xl])throw T("root node is forbidden and cannot be sanitized in-place")}}else if(Ft instanceof fe)st=xF(""),Rt=st.ownerDocument.importNode(Ft,!0),Rt.nodeType===ue.element&&Rt.nodeName==="BODY"||Rt.nodeName==="HTML"?st=Rt:st.appendChild(Rt);else{if(!ht&&!Rn&&!_a&&Ft.indexOf("<")===-1)return He&&$t?He.createHTML(Ft):Ft;if(st=xF(Ft),!st)return ht?null:$t?ze:""}st&&qi&&ql(st.firstChild);let oa=bF(be?Ft:st);for(;bn=oa.nextNode();)kF(bn)||(bn.content instanceof me&&Ove(bn.content),SF(bn));if(be)return Ft;if(ht){if(At)for(Da=yt.call(st.ownerDocument);st.firstChild;)Da.appendChild(st.firstChild);else Da=st;return(gr.shadowroot||gr.shadowrootmode)&&(Da=Ye.call(Pe,Da,!0)),Da}let hs=_a?st.outerHTML:st.innerHTML;return _a&&mt["!doctype"]&&st.ownerDocument&&st.ownerDocument.doctype&&st.ownerDocument.doctype.name&&S(K,st.ownerDocument.doctype.name)&&(hs=" +`+hs),Rn&&f([Ve,je,kt],Xl=>{hs=v(hs,Xl," ")}),He&&$t?He.createHTML(hs):hs},Se.setConfig=function(){let Ft=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Hs(Ft),To=!0},Se.clearConfig=function(){Wl=null,To=!1},Se.isValidAttribute=function(Ft,Re,st){Wl||Hs({});let Rt=_i(Ft),bn=_i(Re);return EF(Rt,bn,st)},Se.addHook=function(Ft,Re){typeof Re=="function"&&(Je[Ft]=Je[Ft]||[],p(Je[Ft],Re))},Se.removeHook=function(Ft){if(Je[Ft])return d(Je[Ft])},Se.removeHooks=function(Ft){Je[Ft]&&(Je[Ft]=[])},Se.removeAllHooks=function(){Je={}},Se}o(oe,"createDOMPurify");var ke=oe();return ke})});var k$={};hr(k$,{default:()=>Ebe});function B2e(t){return String(t).replace(P2e,e=>O2e[e])}function $2e(t){if(t.default)return t.default;var e=t.type,r=Array.isArray(e)?e[0]:e;if(typeof r!="string")return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}function X2e(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}function LG(t){for(var e=0;e=h4[e]&&t<=h4[e+1])return!0;return!1}function axe(t,e){Zl[t]=e}function M7(t,e,r){if(!Zl[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=Zl[e][n];if(!i&&t[0]in Zz&&(n=Zz[t[0]].charCodeAt(0),i=Zl[e][n]),!i&&r==="text"&&LG(n)&&(i=Zl[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}function sxe(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!l7[e]){var r=l7[e]={cssEmPerMu:Jb.quad[e]/18};for(var n in Jb)Jb.hasOwnProperty(n)&&(r[n]=Jb[n][e])}return l7[e]}function tG(t){if(t instanceof ms)return t;throw new Error("Expected symbolNode but got "+String(t)+".")}function uxe(t){if(t instanceof jf)return t;throw new Error("Expected span but got "+String(t)+".")}function G(t,e,r,n,i,a){wn[t][i]={font:e,group:r,replace:n},a&&n&&(wn[t][n]=wn[t][i])}function vt(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,l={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},u=0;u0&&(a.push(s4(s,e)),s=[]),a.push(n[l]));s.length>0&&a.push(s4(s,e));var h;r?(h=s4(Ri(r,e,!0)),h.classes=["tag"],a.push(h)):i&&a.push(i);var f=su(["katex-html"],a);if(f.setAttribute("aria-hidden","true"),h){var d=h.children[0];d.style.height=ct(f.height+f.depth),f.depth&&(d.style.verticalAlign=ct(-f.depth))}return f}function $G(t){return new Xf(t)}function sG(t,e,r,n,i){var a=gs(t,r),s;a.length===1&&a[0]instanceof ps&&Vt.contains(["mrow","mtable"],a[0].type)?s=a[0]:s=new et.MathNode("mrow",a);var l=new et.MathNode("annotation",[new et.TextNode(e)]);l.setAttribute("encoding","application/x-tex");var u=new et.MathNode("semantics",[s,l]),h=new et.MathNode("math",[u]);h.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&h.setAttribute("display","block");var f=i?"katex":"katex-mathml";return Be.makeSpan([f],[h])}function ir(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function B7(t){var e=T4(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function T4(t){return t&&(t.type==="atom"||fxe.hasOwnProperty(t.type))?t:null}function YG(t,e){var r=Ri(t.body,e,!0);return Vxe([t.mclass],r,e)}function WG(t,e){var r,n=gs(t.body,e);return t.mclass==="minner"?r=new et.MathNode("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new et.MathNode("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new et.MathNode("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}function Yxe(t,e,r){var n=Uxe[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},s=r.callFunction("\\Big",[a],[]),l=r.callFunction("\\\\cdright",[e[1]],[]),u={type:"ordgroup",mode:"math",body:[i,s,l]};return r.callFunction("\\\\cdparent",[u],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var h={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[h],[])}default:return{type:"textord",text:" ",mode:"math"}}}function Wxe(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new nt("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],a=0;a-1))if("<>AV".indexOf(h)>-1)for(var d=0;d<2;d++){for(var p=!0,m=u+1;mAV=|." after @',s[u]);var g=Yxe(h,f,t),y={type:"styling",body:[g],mode:"math",style:"display"};n.push(y),l=oG()}a%2===0?n.push(l):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var v=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}function E4(t,e){var r=T4(t);if(r&&Vt.contains(abe,r.text))return r;throw r?new nt("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new nt("Invalid delimiter type '"+t.type+"'",t)}function uG(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}function ec(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,l={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},u=0;u1||!f)&&y.pop(),x.length{"use strict";Xs=class t{static{o(this,"SourceLocation")}constructor(e,r,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=r,this.end=n}static range(e,r){return r?!e||!e.loc||!r.loc||e.loc.lexer!==r.loc.lexer?null:new t(e.loc.lexer,e.loc.start,r.loc.end):e&&e.loc}},Ao=class t{static{o(this,"Token")}constructor(e,r){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=r}range(e,r){return new t(r,Xs.range(this,e))}},nt=class t{static{o(this,"ParseError")}constructor(e,r){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n="KaTeX parse error: "+e,i,a,s=r&&r.loc;if(s&&s.start<=s.end){var l=s.lexer.input;i=s.start,a=s.end,i===l.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var u=l.slice(i,a).replace(/[^]/g,"$&\u0332"),h;i>15?h="\u2026"+l.slice(i-15,i):h=l.slice(0,i);var f;a+15":">","<":"<",'"':""","'":"'"},P2e=/[&><"']/g;o(B2e,"escape");_G=o(function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},"getBaseElem"),F2e=o(function(e){var r=_G(e);return r.type==="mathord"||r.type==="textord"||r.type==="atom"},"isCharacterBox"),z2e=o(function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},"assert"),G2e=o(function(e){var r=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return r?r[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(r[1])?null:r[1].toLowerCase():"_relative"},"protocolFromUrl"),Vt={contains:R2e,deflt:N2e,escape:B2e,hyphenate:I2e,getBaseElem:_G,isCharacterBox:F2e,protocolFromUrl:G2e},u4={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:!0,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:o(t=>"#"+t,"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:o((t,e)=>(e.push(t),e),"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:o(t=>Math.max(0,t),"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:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,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:o(t=>Math.max(0,t),"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:o(t=>Math.max(0,t),"processor"),cli:"-e, --max-expand ",cliProcessor:o(t=>t==="Infinity"?1/0:parseInt(t),"cliProcessor")},globalGroup:{type:"boolean",cli:!1}};o($2e,"getDefaultValue");ry=class{static{o(this,"Settings")}constructor(e){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,e=e||{};for(var r in u4)if(u4.hasOwnProperty(r)){var n=u4[r];this[r]=e[r]!==void 0?n.processor?n.processor(e[r]):e[r]:$2e(n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new nt("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var r=Vt.protocolFromUrl(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}},Kl=class{static{o(this,"Style")}constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return Ql[V2e[this.id]]}sub(){return Ql[U2e[this.id]]}fracNum(){return Ql[H2e[this.id]]}fracDen(){return Ql[Y2e[this.id]]}cramp(){return Ql[W2e[this.id]]}text(){return Ql[q2e[this.id]]}isTight(){return this.size>=2}},N7=0,f4=1,gp=2,iu=3,ny=4,So=5,yp=6,qa=7,Ql=[new Kl(N7,0,!1),new Kl(f4,0,!0),new Kl(gp,1,!1),new Kl(iu,1,!0),new Kl(ny,2,!1),new Kl(So,2,!0),new Kl(yp,3,!1),new Kl(qa,3,!0)],V2e=[ny,So,ny,So,yp,qa,yp,qa],U2e=[So,So,So,So,qa,qa,qa,qa],H2e=[gp,iu,ny,So,yp,qa,yp,qa],Y2e=[iu,iu,So,So,qa,qa,qa,qa],W2e=[f4,f4,iu,iu,So,So,qa,qa],q2e=[N7,f4,gp,iu,gp,iu,gp,iu],Ht={DISPLAY:Ql[N7],TEXT:Ql[gp],SCRIPT:Ql[ny],SCRIPTSCRIPT:Ql[yp]},b7=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];o(X2e,"scriptFromCodepoint");h4=[];b7.forEach(t=>t.blocks.forEach(e=>h4.push(...e)));o(LG,"supportedCodepoint");mp=80,j2e=o(function(e,r){return"M95,"+(622+e+r)+` +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.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 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l`+e/2.075+" -"+e+` +c5.3,-9.3,12,-14,20,-14 +H400000v`+(40+e)+`H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},"sqrtMain"),K2e=o(function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119 +c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 +c340,-704.7,510.7,-1060.3,512,-1067 +l`+e/2.084+" -"+e+` +c4.7,-7.3,11,-11,19,-11 +H40000v`+(40+e)+`H1012.3 +s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 +c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 +s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 +c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},"sqrtSize1"),Q2e=o(function(e,r){return"M983 "+(10+e+r)+` +l`+e/3.13+" -"+e+` +c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+` +H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 +s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 +c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 +c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 +c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 +c53.7,-170.3,84.5,-266.8,92.5,-289.5z +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},"sqrtSize2"),Z2e=o(function(e,r){return"M424,"+(2398+e+r)+` +c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 +c0,-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 +s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 +s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 +l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000 +v`+(40+e)+`H1014.6 +s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 +c-2,6,-10,9,-24,9 +c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+r+` +h400000v`+(40+e)+"h-400000z"},"sqrtSize3"),J2e=o(function(e,r){return"M473,"+(2713+e+r)+` +c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+` +c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7 +s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 +c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 +c0,-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 +s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, +606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},"sqrtSize4"),exe=o(function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},"phasePath"),txe=o(function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+` +H742v`+i+`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 +h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 +c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 +219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},"sqrtTall"),rxe=o(function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=j2e(r,mp);break;case"sqrtSize1":i=K2e(r,mp);break;case"sqrtSize2":i=Q2e(r,mp);break;case"sqrtSize3":i=Z2e(r,mp);break;case"sqrtSize4":i=J2e(r,mp);break;case"sqrtTall":i=txe(r,mp,n)}return i},"sqrtPath"),nxe=o(function(e,r){switch(e){case"\u239C":return"M291 0 H417 V"+r+" H291z M291 0 H417 V"+r+" H291z";case"\u2223":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z";case"\u2225":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z"+("M367 0 H410 V"+r+" H367z M367 0 H410 V"+r+" H367z");case"\u239F":return"M457 0 H583 V"+r+" H457z M457 0 H583 V"+r+" H457z";case"\u23A2":return"M319 0 H403 V"+r+" H319z M319 0 H403 V"+r+" H319z";case"\u23A5":return"M263 0 H347 V"+r+" H263z M263 0 H347 V"+r+" H263z";case"\u23AA":return"M384 0 H504 V"+r+" H384z M384 0 H504 V"+r+" H384z";case"\u23D0":return"M312 0 H355 V"+r+" H312z M312 0 H355 V"+r+" H312z";case"\u2016":return"M257 0 H300 V"+r+" H257z M257 0 H300 V"+r+" H257z"+("M478 0 H521 V"+r+" H478z M478 0 H521 V"+r+" H478z");default:return""}},"innerPath"),Qz={doubleleftarrow:`M262 157 +l10-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 + 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 + 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 +c2 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 + 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 +-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 +-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z +m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l +-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 + 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 +-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 +-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 +-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 +c-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 +-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 + 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 +-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 +c-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 + 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 + 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 + l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 +-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 + 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 + 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 + 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 +-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80 +H435C64 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 + 435 0h399565z`,leftgroupunder:`M400000 262 +H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 + 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 +-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 +-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 +-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 + 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 +-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 +-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z +m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 + 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 + 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 +-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 + 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 +-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 +v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 +-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 +-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 + 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z +M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z +M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 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-70-101l-7-8h399905v-40H95l7-8 +c28.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 + 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z +M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334 +c-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 +-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 + 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 + 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 +c100.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 + 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 + 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 +-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 +-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z +m368.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 +60.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 +-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z +m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 +c0 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 +-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z +m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 +85.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 +-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z +m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 +c0 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 +-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 + 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 + 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 +-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 +-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 + 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l +-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 +s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 +c124.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 + 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 +-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 + 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 + 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 +-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 +-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 + 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 +-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 + 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 +m0 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 + 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 +-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 +-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 + 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 + 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 +-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z +m0-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 + 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 +-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 + 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 +M399960 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 + 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 +-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 +-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 + 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 +-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 +-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 +-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 + 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 +c-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 + 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 + 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 +-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 + 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:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 +-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 + 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 + 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 +-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 +-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 + 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 +c1 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 + 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 +-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 + 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 + 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 + -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 +-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 + 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 + 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 + -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 +3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 +10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 +-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 +-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 +H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 +c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 +c-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`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 +-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 +-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 +-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, +-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, +-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, +-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, +-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 +c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 +c-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 +s-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 +121.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 +s2.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 +c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z +M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-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 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 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-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 +-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 +151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 +c2,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 +c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 +c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z +M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-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 +c-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 +M0 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 +c1.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, +1c0,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, +-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z +M93 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 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-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 +c-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 +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},ixe=o(function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 h347 v-84 +H403z M403 1759 V0 H319 V1759 v`+r+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v1759 H0 v84 H347z +M347 1759 V0 H263 V1759 v`+r+" v1759 h84z";case"vert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+" v585 h43z";case"doublevert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+` v585 h43z +M367 15 v585 v`+r+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+r+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+r+` v1715 h263 v84 H319z +MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+r+` v1799 H0 v-84 H319z +MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v602 h84z +M403 1759 V0 H319 V1759 v`+r+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v602 h84z +M347 1759 V0 h-84 V1759 v`+r+" 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 +c-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, +-36,557 l0,`+(r+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, +949.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 +c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, +-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 +l0,-`+(r+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, +-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, +63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 +c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(r+9)+` +c-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 +c-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 +c0,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 +c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 +l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, +-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"),Xf=class{static{o(this,"DocumentFragment")}constructor(e){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=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return Vt.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),r=0;rr.toText(),"toText");return this.children.map(e).join("")}},Zl={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Jb={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Zz={\u00C5:"A",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00F0:"d",\u00FE:"o",\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"};o(axe,"setFontMetrics");o(M7,"getCharacterMetrics");l7={};o(sxe,"getGlobalMetrics");oxe=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Jz=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],eG=o(function(e,r){return r.size<2?e:oxe[e-1][r.size-1]},"sizeAtStyle"),d4=class t{static{o(this,"Options")}constructor(e){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=e.style,this.color=e.color,this.size=e.size||t.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=Jz[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={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 n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return new t(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:eG(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Jz[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=eG(t.BASESIZE,e);return this.size===r&&this.textSize===t.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==t.BASESIZE?["sizing","reset-size"+this.size,"size"+t.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=sxe(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};d4.BASESIZE=6;w7={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},lxe={ex:!0,em:!0,mu:!0},DG=o(function(e){return typeof e!="string"&&(e=e.unit),e in w7||e in lxe||e==="ex"},"validUnit"),Hn=o(function(e,r){var n;if(e.unit in w7)n=w7[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new nt("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},"calculateSize"),ct=o(function(e){return+e.toFixed(4)+"em"},"makeEm"),dh=o(function(e){return e.filter(r=>r).join(" ")},"createClass"),RG=o(function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},"initNode"),NG=o(function(e){var r=document.createElement(e);r.className=dh(this.classes);for(var n in this.style)this.style.hasOwnProperty(n)&&(r.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&r.setAttribute(i,this.attributes[i]);for(var a=0;a",r},"toMarkup"),jf=class{static{o(this,"Span")}constructor(e,r,n,i){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,RG.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return Vt.contains(this.classes,e)}toNode(){return NG.call(this,"span")}toMarkup(){return MG.call(this,"span")}},iy=class{static{o(this,"Anchor")}constructor(e,r,n,i){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,RG.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return Vt.contains(this.classes,e)}toNode(){return NG.call(this,"a")}toMarkup(){return MG.call(this,"a")}},T7=class{static{o(this,"Img")}constructor(e,r,n){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=r,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return Vt.contains(this.classes,e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var r in this.style)this.style.hasOwnProperty(r)&&(e.style[r]=this.style[r]);return e}toMarkup(){var e=''+Vt.escape(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=ct(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=dh(this.classes));for(var n in this.style)this.style.hasOwnProperty(n)&&(r=r||document.createElement("span"),r.style[n]=this.style[n]);return r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="0&&(n+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=Vt.hyphenate(i)+":"+this.style[i]+";");n&&(e=!0,r+=' style="'+Vt.escape(n)+'"');var a=Vt.escape(this.text);return e?(r+=">",r+=a,r+="",r):a}},ll=class{static{o(this,"SvgNode")}constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}},ay=class{static{o(this,"LineNode")}constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e="","\\gt",!0);G(U,ee,xe,"\u2208","\\in",!0);G(U,ee,xe,"\uE020","\\@not");G(U,ee,xe,"\u2282","\\subset",!0);G(U,ee,xe,"\u2283","\\supset",!0);G(U,ee,xe,"\u2286","\\subseteq",!0);G(U,ee,xe,"\u2287","\\supseteq",!0);G(U,ve,xe,"\u2288","\\nsubseteq",!0);G(U,ve,xe,"\u2289","\\nsupseteq",!0);G(U,ee,xe,"\u22A8","\\models");G(U,ee,xe,"\u2190","\\leftarrow",!0);G(U,ee,xe,"\u2264","\\le");G(U,ee,xe,"\u2264","\\leq",!0);G(U,ee,xe,"<","\\lt",!0);G(U,ee,xe,"\u2192","\\rightarrow",!0);G(U,ee,xe,"\u2192","\\to");G(U,ve,xe,"\u2271","\\ngeq",!0);G(U,ve,xe,"\u2270","\\nleq",!0);G(U,ee,lu,"\xA0","\\ ");G(U,ee,lu,"\xA0","\\space");G(U,ee,lu,"\xA0","\\nobreakspace");G(Qe,ee,lu,"\xA0","\\ ");G(Qe,ee,lu,"\xA0"," ");G(Qe,ee,lu,"\xA0","\\space");G(Qe,ee,lu,"\xA0","\\nobreakspace");G(U,ee,lu,null,"\\nobreak");G(U,ee,lu,null,"\\allowbreak");G(U,ee,b4,",",",");G(U,ee,b4,";",";");G(U,ve,bt,"\u22BC","\\barwedge",!0);G(U,ve,bt,"\u22BB","\\veebar",!0);G(U,ee,bt,"\u2299","\\odot",!0);G(U,ee,bt,"\u2295","\\oplus",!0);G(U,ee,bt,"\u2297","\\otimes",!0);G(U,ee,Le,"\u2202","\\partial",!0);G(U,ee,bt,"\u2298","\\oslash",!0);G(U,ve,bt,"\u229A","\\circledcirc",!0);G(U,ve,bt,"\u22A1","\\boxdot",!0);G(U,ee,bt,"\u25B3","\\bigtriangleup");G(U,ee,bt,"\u25BD","\\bigtriangledown");G(U,ee,bt,"\u2020","\\dagger");G(U,ee,bt,"\u22C4","\\diamond");G(U,ee,bt,"\u22C6","\\star");G(U,ee,bt,"\u25C3","\\triangleleft");G(U,ee,bt,"\u25B9","\\triangleright");G(U,ee,js,"{","\\{");G(Qe,ee,Le,"{","\\{");G(Qe,ee,Le,"{","\\textbraceleft");G(U,ee,Xa,"}","\\}");G(Qe,ee,Le,"}","\\}");G(Qe,ee,Le,"}","\\textbraceright");G(U,ee,js,"{","\\lbrace");G(U,ee,Xa,"}","\\rbrace");G(U,ee,js,"[","\\lbrack",!0);G(Qe,ee,Le,"[","\\lbrack",!0);G(U,ee,Xa,"]","\\rbrack",!0);G(Qe,ee,Le,"]","\\rbrack",!0);G(U,ee,js,"(","\\lparen",!0);G(U,ee,Xa,")","\\rparen",!0);G(Qe,ee,Le,"<","\\textless",!0);G(Qe,ee,Le,">","\\textgreater",!0);G(U,ee,js,"\u230A","\\lfloor",!0);G(U,ee,Xa,"\u230B","\\rfloor",!0);G(U,ee,js,"\u2308","\\lceil",!0);G(U,ee,Xa,"\u2309","\\rceil",!0);G(U,ee,Le,"\\","\\backslash");G(U,ee,Le,"\u2223","|");G(U,ee,Le,"\u2223","\\vert");G(Qe,ee,Le,"|","\\textbar",!0);G(U,ee,Le,"\u2225","\\|");G(U,ee,Le,"\u2225","\\Vert");G(Qe,ee,Le,"\u2225","\\textbardbl");G(Qe,ee,Le,"~","\\textasciitilde");G(Qe,ee,Le,"\\","\\textbackslash");G(Qe,ee,Le,"^","\\textasciicircum");G(U,ee,xe,"\u2191","\\uparrow",!0);G(U,ee,xe,"\u21D1","\\Uparrow",!0);G(U,ee,xe,"\u2193","\\downarrow",!0);G(U,ee,xe,"\u21D3","\\Downarrow",!0);G(U,ee,xe,"\u2195","\\updownarrow",!0);G(U,ee,xe,"\u21D5","\\Updownarrow",!0);G(U,ee,xi,"\u2210","\\coprod");G(U,ee,xi,"\u22C1","\\bigvee");G(U,ee,xi,"\u22C0","\\bigwedge");G(U,ee,xi,"\u2A04","\\biguplus");G(U,ee,xi,"\u22C2","\\bigcap");G(U,ee,xi,"\u22C3","\\bigcup");G(U,ee,xi,"\u222B","\\int");G(U,ee,xi,"\u222B","\\intop");G(U,ee,xi,"\u222C","\\iint");G(U,ee,xi,"\u222D","\\iiint");G(U,ee,xi,"\u220F","\\prod");G(U,ee,xi,"\u2211","\\sum");G(U,ee,xi,"\u2A02","\\bigotimes");G(U,ee,xi,"\u2A01","\\bigoplus");G(U,ee,xi,"\u2A00","\\bigodot");G(U,ee,xi,"\u222E","\\oint");G(U,ee,xi,"\u222F","\\oiint");G(U,ee,xi,"\u2230","\\oiiint");G(U,ee,xi,"\u2A06","\\bigsqcup");G(U,ee,xi,"\u222B","\\smallint");G(Qe,ee,vp,"\u2026","\\textellipsis");G(U,ee,vp,"\u2026","\\mathellipsis");G(Qe,ee,vp,"\u2026","\\ldots",!0);G(U,ee,vp,"\u2026","\\ldots",!0);G(U,ee,vp,"\u22EF","\\@cdots",!0);G(U,ee,vp,"\u22F1","\\ddots",!0);G(U,ee,Le,"\u22EE","\\varvdots");G(U,ee,Pn,"\u02CA","\\acute");G(U,ee,Pn,"\u02CB","\\grave");G(U,ee,Pn,"\xA8","\\ddot");G(U,ee,Pn,"~","\\tilde");G(U,ee,Pn,"\u02C9","\\bar");G(U,ee,Pn,"\u02D8","\\breve");G(U,ee,Pn,"\u02C7","\\check");G(U,ee,Pn,"^","\\hat");G(U,ee,Pn,"\u20D7","\\vec");G(U,ee,Pn,"\u02D9","\\dot");G(U,ee,Pn,"\u02DA","\\mathring");G(U,ee,Ut,"\uE131","\\@imath");G(U,ee,Ut,"\uE237","\\@jmath");G(U,ee,Le,"\u0131","\u0131");G(U,ee,Le,"\u0237","\u0237");G(Qe,ee,Le,"\u0131","\\i",!0);G(Qe,ee,Le,"\u0237","\\j",!0);G(Qe,ee,Le,"\xDF","\\ss",!0);G(Qe,ee,Le,"\xE6","\\ae",!0);G(Qe,ee,Le,"\u0153","\\oe",!0);G(Qe,ee,Le,"\xF8","\\o",!0);G(Qe,ee,Le,"\xC6","\\AE",!0);G(Qe,ee,Le,"\u0152","\\OE",!0);G(Qe,ee,Le,"\xD8","\\O",!0);G(Qe,ee,Pn,"\u02CA","\\'");G(Qe,ee,Pn,"\u02CB","\\`");G(Qe,ee,Pn,"\u02C6","\\^");G(Qe,ee,Pn,"\u02DC","\\~");G(Qe,ee,Pn,"\u02C9","\\=");G(Qe,ee,Pn,"\u02D8","\\u");G(Qe,ee,Pn,"\u02D9","\\.");G(Qe,ee,Pn,"\xB8","\\c");G(Qe,ee,Pn,"\u02DA","\\r");G(Qe,ee,Pn,"\u02C7","\\v");G(Qe,ee,Pn,"\xA8",'\\"');G(Qe,ee,Pn,"\u02DD","\\H");G(Qe,ee,Pn,"\u25EF","\\textcircled");IG={"--":!0,"---":!0,"``":!0,"''":!0};G(Qe,ee,Le,"\u2013","--",!0);G(Qe,ee,Le,"\u2013","\\textendash");G(Qe,ee,Le,"\u2014","---",!0);G(Qe,ee,Le,"\u2014","\\textemdash");G(Qe,ee,Le,"\u2018","`",!0);G(Qe,ee,Le,"\u2018","\\textquoteleft");G(Qe,ee,Le,"\u2019","'",!0);G(Qe,ee,Le,"\u2019","\\textquoteright");G(Qe,ee,Le,"\u201C","``",!0);G(Qe,ee,Le,"\u201C","\\textquotedblleft");G(Qe,ee,Le,"\u201D","''",!0);G(Qe,ee,Le,"\u201D","\\textquotedblright");G(U,ee,Le,"\xB0","\\degree",!0);G(Qe,ee,Le,"\xB0","\\degree");G(Qe,ee,Le,"\xB0","\\textdegree",!0);G(U,ee,Le,"\xA3","\\pounds");G(U,ee,Le,"\xA3","\\mathsterling",!0);G(Qe,ee,Le,"\xA3","\\pounds");G(Qe,ee,Le,"\xA3","\\textsterling",!0);G(U,ve,Le,"\u2720","\\maltese");G(Qe,ve,Le,"\u2720","\\maltese");rG='0123456789/@."';for(e4=0;e40)return ol(a,h,i,r,s.concat(f));if(u){var d,p;if(u==="boldsymbol"){var m=mxe(a,i,r,s,n);d=m.fontName,p=[m.fontClass]}else l?(d=BG[u].fontName,p=[u]):(d=a4(u,r.fontWeight,r.fontShape),p=[u,r.fontWeight,r.fontShape]);if(w4(a,d,i).metrics)return ol(a,d,i,r,s.concat(p));if(IG.hasOwnProperty(a)&&d.slice(0,10)==="Typewriter"){for(var g=[],y=0;y{if(dh(t.classes)!==dh(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n in t.style)if(t.style.hasOwnProperty(n)&&t.style[n]!==e.style[n])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&t.style[i]!==e.style[i])return!1;return!0},"canCombine"),vxe=o(t=>{for(var e=0;er&&(r=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},"sizeElementFromChildren"),ds=o(function(e,r,n,i){var a=new jf(e,r,n,i);return I7(a),a},"makeSpan"),OG=o((t,e,r,n)=>new jf(t,e,r,n),"makeSvgSpan"),xxe=o(function(e,r,n){var i=ds([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=ct(i.height),i.maxFontSize=1,i},"makeLineSpan"),bxe=o(function(e,r,n,i){var a=new iy(e,r,n,i);return I7(a),a},"makeAnchor"),PG=o(function(e){var r=new Xf(e);return I7(r),r},"makeFragment"),wxe=o(function(e,r){return e instanceof Xf?ds([],[e],r):e},"wrapFragment"),Txe=o(function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,a=i,s=1;s{var r=ds(["mspace"],[],e),n=Hn(t,e);return r.style.marginRight=ct(n),r},"makeGlue"),a4=o(function(e,r,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}var a;return r==="textbf"&&n==="textit"?a="BoldItalic":r==="textbf"?a="Bold":r==="textit"?a="Italic":a="Regular",i+"-"+a},"retrieveTextFontName"),BG={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"},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"}},FG={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Cxe=o(function(e,r){var[n,i,a]=FG[e],s=new Jl(n),l=new ll([s],{width:ct(i),height:ct(a),style:"width:"+ct(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),u=OG(["overlay"],[l],r);return u.height=a,u.style.height=ct(a),u.style.width=ct(i),u},"staticSvg"),Be={fontMap:BG,makeSymbol:ol,mathsym:pxe,makeSpan:ds,makeSvgSpan:OG,makeLineSpan:xxe,makeAnchor:bxe,makeFragment:PG,wrapFragment:wxe,makeVList:kxe,makeOrd:gxe,makeGlue:Exe,staticSvg:Cxe,svgData:FG,tryCombineChars:vxe},Un={number:3,unit:"mu"},Wf={number:4,unit:"mu"},nu={number:5,unit:"mu"},Sxe={mord:{mop:Un,mbin:Wf,mrel:nu,minner:Un},mop:{mord:Un,mop:Un,mrel:nu,minner:Un},mbin:{mord:Wf,mop:Wf,mopen:Wf,minner:Wf},mrel:{mord:nu,mop:nu,mopen:nu,minner:nu},mopen:{},mclose:{mop:Un,mbin:Wf,mrel:nu,minner:Un},mpunct:{mord:Un,mop:Un,mrel:nu,mopen:Un,mclose:Un,mpunct:Un,minner:Un},minner:{mord:Un,mop:Un,mbin:Wf,mrel:nu,mopen:Un,mpunct:Un,minner:Un}},Axe={mord:{mop:Un},mop:{mord:Un,mop:Un},mbin:{},mrel:{},mopen:{},mclose:{mop:Un},mpunct:{},minner:{mop:Un}},zG={},m4={},g4={};o(vt,"defineFunction");o(Kf,"defineFunctionBuilders");y4=o(function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},"normalizeArgument"),ui=o(function(e){return e.type==="ordgroup"?e.body:[e]},"ordargument"),su=Be.makeSpan,_xe=["leftmost","mbin","mopen","mrel","mop","mpunct"],Lxe=["rightmost","mrel","mclose","mpunct"],Dxe={display:Ht.DISPLAY,text:Ht.TEXT,script:Ht.SCRIPT,scriptscript:Ht.SCRIPTSCRIPT},Rxe={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Ri=o(function(e,r,n,i){i===void 0&&(i=[null,null]);for(var a=[],s=0;s{var v=y.classes[0],x=g.classes[0];v==="mbin"&&Vt.contains(Lxe,x)?y.classes[0]="mord":x==="mbin"&&Vt.contains(_xe,v)&&(g.classes[0]="mord")},{node:d},p,m),aG(a,(g,y)=>{var v=E7(y),x=E7(g),b=v&&x?g.hasClass("mtight")?Axe[v][x]:Sxe[v][x]:null;if(b)return Be.makeGlue(b,h)},{node:d},p,m),a},"buildExpression"),aG=o(function t(e,r,n,i,a){i&&e.push(i);for(var s=0;sp=>{e.splice(d+1,0,p),s++})(s)}i&&e.pop()},"traverseNonSpaceNodes"),GG=o(function(e){return e instanceof Xf||e instanceof iy||e instanceof jf&&e.hasClass("enclosing")?e:null},"checkPartialGroup"),Nxe=o(function t(e,r){var n=GG(e);if(n){var i=n.children;if(i.length){if(r==="right")return t(i[i.length-1],"right");if(r==="left")return t(i[0],"left")}}return e},"getOutermostNode"),E7=o(function(e,r){return e?(r&&(e=Nxe(e,r)),Rxe[e.classes[0]]||null):null},"getTypeOfDomTree"),sy=o(function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return su(r.concat(n))},"makeNullDelimiter"),Cr=o(function(e,r,n){if(!e)return su();if(m4[e.type]){var i=m4[e.type](e,r);if(n&&r.size!==n.size){i=su(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new nt("Got group of unknown type: '"+e.type+"'")},"buildGroup");o(s4,"buildHTMLUnbreakable");o(C7,"buildHTML");o($G,"newDocumentFragment");ps=class{static{o(this,"MathNode")}constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=dh(this.classes));for(var n=0;n0&&(e+=' class ="'+Vt.escape(dh(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}},qf=class{static{o(this,"TextNode")}constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Vt.escape(this.toText())}toText(){return this.text}},S7=class{static{o(this,"SpaceNode")}constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character="\u200A":e>=.1666&&e<=.1667?this.character="\u2009":e>=.2222&&e<=.2223?this.character="\u2005":e>=.2777&&e<=.2778?this.character="\u2005\u200A":e>=-.05556&&e<=-.05555?this.character="\u200A\u2063":e>=-.1667&&e<=-.1666?this.character="\u2009\u2063":e>=-.2223&&e<=-.2222?this.character="\u205F\u2063":e>=-.2778&&e<=-.2777?this.character="\u2005\u2063":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",ct(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}},et={MathNode:ps,TextNode:qf,SpaceNode:S7,newDocumentFragment:$G},_o=o(function(e,r,n){return wn[r][e]&&wn[r][e].replace&&e.charCodeAt(0)!==55349&&!(IG.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=wn[r][e].replace),new et.TextNode(e)},"makeText"),O7=o(function(e){return e.length===1?e[0]:new et.MathNode("mrow",e)},"makeRow"),P7=o(function(e,r){if(r.fontFamily==="texttt")return"monospace";if(r.fontFamily==="textsf")return r.fontShape==="textit"&&r.fontWeight==="textbf"?"sans-serif-bold-italic":r.fontShape==="textit"?"sans-serif-italic":r.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(r.fontShape==="textit"&&r.fontWeight==="textbf")return"bold-italic";if(r.fontShape==="textit")return"italic";if(r.fontWeight==="textbf")return"bold";var n=r.font;if(!n||n==="mathnormal")return null;var i=e.mode;if(n==="mathit")return"italic";if(n==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(n==="mathbf")return"bold";if(n==="mathbb")return"double-struck";if(n==="mathfrak")return"fraktur";if(n==="mathscr"||n==="mathcal")return"script";if(n==="mathsf")return"sans-serif";if(n==="mathtt")return"monospace";var a=e.text;if(Vt.contains(["\\imath","\\jmath"],a))return null;wn[i][a]&&wn[i][a].replace&&(a=wn[i][a].replace);var s=Be.fontMap[n].fontName;return M7(a,s,i)?Be.fontMap[n].variant:null},"getVariant"),gs=o(function(e,r,n){if(e.length===1){var i=fn(e[0],r);return n&&i instanceof ps&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,l=0;l0&&(d.text=d.text.slice(0,1)+"\u0338"+d.text.slice(1),a.pop())}}}a.push(u),s=u}return a},"buildExpression"),ph=o(function(e,r,n){return O7(gs(e,r,n))},"buildExpressionRow"),fn=o(function(e,r){if(!e)return new et.MathNode("mrow");if(g4[e.type]){var n=g4[e.type](e,r);return n}else throw new nt("Got group of unknown type: '"+e.type+"'")},"buildGroup");o(sG,"buildMathML");VG=o(function(e){return new d4({style:e.displayMode?Ht.DISPLAY:Ht.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},"optionsFromSettings"),UG=o(function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=Be.makeSpan(n,[e])}return e},"displayWrap"),Mxe=o(function(e,r,n){var i=VG(n),a;if(n.output==="mathml")return sG(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=C7(e,i);a=Be.makeSpan(["katex"],[s])}else{var l=sG(e,r,i,n.displayMode,!1),u=C7(e,i);a=Be.makeSpan(["katex"],[l,u])}return UG(a,n)},"buildTree"),Ixe=o(function(e,r,n){var i=VG(n),a=C7(e,i),s=Be.makeSpan(["katex"],[a]);return UG(s,n)},"buildHTMLTree"),Oxe={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",xleftequilibrium:"\u21CB","\\cdrightarrow":"\u2192","\\cdleftarrow":"\u2190","\\cdlongequal":"="},Pxe=o(function(e){var r=new et.MathNode("mo",[new et.TextNode(Oxe[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},"mathMLnode"),Bxe={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.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"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Fxe=o(function(e){return e.type==="ordgroup"?e.body.length:1},"groupLength"),zxe=o(function(e,r){function n(){var l=4e5,u=e.label.slice(1);if(Vt.contains(["widehat","widecheck","widetilde","utilde"],u)){var h=e,f=Fxe(h.base),d,p,m;if(f>5)u==="widehat"||u==="widecheck"?(d=420,l=2364,m=.42,p=u+"4"):(d=312,l=2340,m=.34,p="tilde4");else{var g=[1,1,2,2,3,3][f];u==="widehat"||u==="widecheck"?(l=[0,1062,2364,2364,2364][g],d=[0,239,300,360,420][g],m=[0,.24,.3,.3,.36,.42][g],p=u+g):(l=[0,600,1033,2339,2340][g],d=[0,260,286,306,312][g],m=[0,.26,.286,.3,.306,.34][g],p="tilde"+g)}var y=new Jl(p),v=new ll([y],{width:"100%",height:ct(m),viewBox:"0 0 "+l+" "+d,preserveAspectRatio:"none"});return{span:Be.makeSvgSpan([],[v],r),minWidth:0,height:m}}else{var x=[],b=Bxe[u],[w,S,T]=b,E=T/1e3,_=w.length,A,L;if(_===1){var M=b[3];A=["hide-tail"],L=[M]}else if(_===2)A=["halfarrow-left","halfarrow-right"],L=["xMinYMin","xMaxYMin"];else if(_===3)A=["brace-left","brace-center","brace-right"],L=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+_+" children.");for(var N=0;N<_;N++){var k=new Jl(w[N]),I=new ll([k],{width:"400em",height:ct(E),viewBox:"0 0 "+l+" "+T,preserveAspectRatio:L[N]+" slice"}),C=Be.makeSvgSpan([A[N]],[I],r);if(_===1)return{span:C,minWidth:S,height:E};C.style.height=ct(E),x.push(C)}return{span:Be.makeSpan(["stretchy"],x,r),minWidth:S,height:E}}}o(n,"buildSvgSpan_");var{span:i,minWidth:a,height:s}=n();return i.height=s,i.style.height=ct(s),a>0&&(i.style.minWidth=ct(a)),i},"svgSpan"),Gxe=o(function(e,r,n,i,a){var s,l=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=Be.makeSpan(["stretchy",r],[],a),r==="fbox"){var u=a.color&&a.getColor();u&&(s.style.borderColor=u)}}else{var h=[];/^[bx]cancel$/.test(r)&&h.push(new ay({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&h.push(new ay({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var f=new ll(h,{width:"100%",height:ct(l)});s=Be.makeSvgSpan([],[f],a)}return s.height=l,s.style.height=ct(l),s},"encloseSpan"),ou={encloseSpan:Gxe,mathMLnode:Pxe,svgSpan:zxe};o(ir,"assertNodeType");o(B7,"assertSymbolNodeType");o(T4,"checkSymbolNodeType");F7=o((t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=ir(t.base,"accent"),r=n.base,t.base=r,i=uxe(Cr(t,e)),t.base=n):(n=ir(t,"accent"),r=n.base);var a=Cr(r,e.havingCrampedStyle()),s=n.isShifty&&Vt.isCharacterBox(r),l=0;if(s){var u=Vt.getBaseElem(r),h=Cr(u,e.havingCrampedStyle());l=tG(h).skew}var f=n.label==="\\c",d=f?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),p;if(n.isStretchy)p=ou.svgSpan(n,e),p=Be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+ct(2*l)+")",marginLeft:ct(2*l)}:void 0}]},e);else{var m,g;n.label==="\\vec"?(m=Be.staticSvg("vec",e),g=Be.svgData.vec[1]):(m=Be.makeOrd({mode:n.mode,text:n.label},e,"textord"),m=tG(m),m.italic=0,g=m.width,f&&(d+=m.depth)),p=Be.makeSpan(["accent-body"],[m]);var y=n.label==="\\textcircled";y&&(p.classes.push("accent-full"),d=a.height);var v=l;y||(v-=g/2),p.style.left=ct(v),n.label==="\\textcircled"&&(p.style.top=".2em"),p=Be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:p}]},e)}var x=Be.makeSpan(["mord","accent"],[p],e);return i?(i.children[0]=x,i.height=Math.max(x.height,i.height),i.classes[0]="mord",i):x},"htmlBuilder$a"),HG=o((t,e)=>{var r=t.isStretchy?ou.mathMLnode(t.label):new et.MathNode("mo",[_o(t.label,t.mode)]),n=new et.MathNode("mover",[fn(t.base,e),r]);return n.setAttribute("accent","true"),n},"mathmlBuilder$9"),$xe=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));vt({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:o((t,e)=>{var r=y4(e[0]),n=!$xe.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},"handler"),htmlBuilder:F7,mathmlBuilder:HG});vt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:o((t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},"handler"),htmlBuilder:F7,mathmlBuilder:HG});vt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},"handler"),htmlBuilder:o((t,e)=>{var r=Cr(t.base,e),n=ou.svgSpan(t,e),i=t.label==="\\utilde"?.12:0,a=Be.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]},e);return Be.makeSpan(["mord","accentunder"],[a],e)},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=ou.mathMLnode(t.label),n=new et.MathNode("munder",[fn(t.base,e),r]);return n.setAttribute("accentunder","true"),n},"mathmlBuilder")});o4=o(t=>{var e=new et.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e},"paddedNode");vt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=Be.wrapFragment(Cr(t.body,n,e),e),a=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var s;t.below&&(n=e.havingStyle(r.sub()),s=Be.wrapFragment(Cr(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var l=ou.svgSpan(t,e),u=-e.fontMetrics().axisHeight+.5*l.height,h=-e.fontMetrics().axisHeight-.5*l.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(h-=i.depth);var f;if(s){var d=-e.fontMetrics().axisHeight+s.height+.5*l.height+.111;f=Be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:h},{type:"elem",elem:l,shift:u},{type:"elem",elem:s,shift:d}]},e)}else f=Be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:h},{type:"elem",elem:l,shift:u}]},e);return f.children[0].children[0].children[1].classes.push("svg-align"),Be.makeSpan(["mrel","x-arrow"],[f],e)},mathmlBuilder(t,e){var r=ou.mathMLnode(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=o4(fn(t.body,e));if(t.below){var a=o4(fn(t.below,e));n=new et.MathNode("munderover",[r,a,i])}else n=new et.MathNode("mover",[r,i])}else if(t.below){var s=o4(fn(t.below,e));n=new et.MathNode("munder",[r,s])}else n=o4(),n=new et.MathNode("mover",[r,n]);return n}});Vxe=Be.makeSpan;o(YG,"htmlBuilder$9");o(WG,"mathmlBuilder$8");vt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:ui(i),isCharacterBox:Vt.isCharacterBox(i)}},htmlBuilder:YG,mathmlBuilder:WG});k4=o(t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"},"binrelClass");vt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:k4(e[0]),body:ui(e[1]),isCharacterBox:Vt.isCharacterBox(e[1])}}});vt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],a=e[0],s;n!=="\\stackrel"?s=k4(i):s="mrel";var l={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:ui(i)},u={type:"supsub",mode:a.mode,base:l,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:r.mode,mclass:s,body:[u],isCharacterBox:Vt.isCharacterBox(u)}},htmlBuilder:YG,mathmlBuilder:WG});vt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:k4(e[0]),body:ui(e[0])}},htmlBuilder(t,e){var r=Ri(t.body,e,!0),n=Be.makeSpan([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=gs(t.body,e),n=new et.MathNode("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});Uxe={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},oG=o(()=>({type:"styling",body:[],mode:"math",style:"display"}),"newCell"),lG=o(t=>t.type==="textord"&&t.text==="@","isStartOfArrow"),Hxe=o((t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e,"isLabelEnd");o(Yxe,"cdArrow");o(Wxe,"parseCD");vt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=Be.wrapFragment(Cr(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=ct(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new et.MathNode("mrow",[fn(t.label,e)]);return r=new et.MathNode("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new et.MathNode("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});vt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=Be.wrapFragment(Cr(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new et.MathNode("mrow",[fn(t.fragment,e)])}});vt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=ir(e[0],"ordgroup"),i=n.body,a="",s=0;s=1114111)throw new nt("\\@char with invalid code point "+a);return u<=65535?h=String.fromCharCode(u):(u-=65536,h=String.fromCharCode((u>>10)+55296,(u&1023)+56320)),{type:"textord",mode:r.mode,text:h}}});qG=o((t,e)=>{var r=Ri(t.body,e.withColor(t.color),!1);return Be.makeFragment(r)},"htmlBuilder$8"),XG=o((t,e)=>{var r=gs(t.body,e.withColor(t.color)),n=new et.MathNode("mstyle",r);return n.setAttribute("mathcolor",t.color),n},"mathmlBuilder$7");vt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=ir(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:ui(i)}},htmlBuilder:qG,mathmlBuilder:XG});vt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=ir(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var a=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:a}},htmlBuilder:qG,mathmlBuilder:XG});vt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&ir(i,"size").value}},htmlBuilder(t,e){var r=Be.makeSpan(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=ct(Hn(t.size,e)))),r},mathmlBuilder(t,e){var r=new et.MathNode("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",ct(Hn(t.size,e)))),r}});A7={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},jG=o(t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new nt("Expected a control sequence",t);return e},"checkControlSequence"),qxe=o(t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},"getRHS"),KG=o((t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)},"letCommand");vt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(A7[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=A7[n.text]),ir(e.parseFunction(),"internal");throw new nt("Invalid token after macro prefix",n)}});vt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new nt("Expected a control sequence",n);for(var a=0,s,l=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){s=e.gullet.future(),l[a].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new nt('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new nt('Argument number "'+n.text+'" out of order');a++,l.push([])}else{if(n.text==="EOF")throw new nt("Expected a macro definition");l[a].push(n.text)}var{tokens:u}=e.gullet.consumeArg();return s&&u.unshift(s),(r==="\\edef"||r==="\\xdef")&&(u=e.gullet.expandTokens(u),u.reverse()),e.gullet.macros.set(i,{tokens:u,numArgs:a,delimiters:l},r===A7[r]),{type:"internal",mode:e.mode}}});vt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=jG(e.gullet.popToken());e.gullet.consumeSpaces();var i=qxe(e);return KG(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});vt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=jG(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return KG(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});ey=o(function(e,r,n){var i=wn.math[e]&&wn.math[e].replace,a=M7(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},"getMetrics"),z7=o(function(e,r,n,i){var a=n.havingBaseStyle(r),s=Be.makeSpan(i.concat(a.sizingClasses(n)),[e],n),l=a.sizeMultiplier/n.sizeMultiplier;return s.height*=l,s.depth*=l,s.maxFontSize=a.sizeMultiplier,s},"styleWrap"),QG=o(function(e,r,n){var i=r.havingBaseStyle(n),a=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=ct(a),e.height-=a,e.depth+=a},"centerSpan"),Xxe=o(function(e,r,n,i,a,s){var l=Be.makeSymbol(e,"Main-Regular",a,i),u=z7(l,r,i,s);return n&&QG(u,i,r),u},"makeSmallDelim"),jxe=o(function(e,r,n,i){return Be.makeSymbol(e,"Size"+r+"-Regular",n,i)},"mathrmSize"),ZG=o(function(e,r,n,i,a,s){var l=jxe(e,r,a,i),u=z7(Be.makeSpan(["delimsizing","size"+r],[l],i),Ht.TEXT,i,s);return n&&QG(u,i,Ht.TEXT),u},"makeLargeDelim"),h7=o(function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Be.makeSpan(["delimsizinginner",i],[Be.makeSpan([],[Be.makeSymbol(e,r,n)])]);return{type:"elem",elem:a}},"makeGlyphSpan"),f7=o(function(e,r,n){var i=Zl["Size4-Regular"][e.charCodeAt(0)]?Zl["Size4-Regular"][e.charCodeAt(0)][4]:Zl["Size1-Regular"][e.charCodeAt(0)][4],a=new Jl("inner",nxe(e,Math.round(1e3*r))),s=new ll([a],{width:ct(i),height:ct(r),style:"width:"+ct(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),l=Be.makeSvgSpan([],[s],n);return l.height=r,l.style.height=ct(r),l.style.width=ct(i),{type:"elem",elem:l}},"makeInner"),_7=.008,l4={type:"kern",size:-1*_7},Kxe=["|","\\lvert","\\rvert","\\vert"],Qxe=["\\|","\\lVert","\\rVert","\\Vert"],JG=o(function(e,r,n,i,a,s){var l,u,h,f,d="",p=0;l=h=f=e,u=null;var m="Size1-Regular";e==="\\uparrow"?h=f="\u23D0":e==="\\Uparrow"?h=f="\u2016":e==="\\downarrow"?l=h="\u23D0":e==="\\Downarrow"?l=h="\u2016":e==="\\updownarrow"?(l="\\uparrow",h="\u23D0",f="\\downarrow"):e==="\\Updownarrow"?(l="\\Uparrow",h="\u2016",f="\\Downarrow"):Vt.contains(Kxe,e)?(h="\u2223",d="vert",p=333):Vt.contains(Qxe,e)?(h="\u2225",d="doublevert",p=556):e==="["||e==="\\lbrack"?(l="\u23A1",h="\u23A2",f="\u23A3",m="Size4-Regular",d="lbrack",p=667):e==="]"||e==="\\rbrack"?(l="\u23A4",h="\u23A5",f="\u23A6",m="Size4-Regular",d="rbrack",p=667):e==="\\lfloor"||e==="\u230A"?(h=l="\u23A2",f="\u23A3",m="Size4-Regular",d="lfloor",p=667):e==="\\lceil"||e==="\u2308"?(l="\u23A1",h=f="\u23A2",m="Size4-Regular",d="lceil",p=667):e==="\\rfloor"||e==="\u230B"?(h=l="\u23A5",f="\u23A6",m="Size4-Regular",d="rfloor",p=667):e==="\\rceil"||e==="\u2309"?(l="\u23A4",h=f="\u23A5",m="Size4-Regular",d="rceil",p=667):e==="("||e==="\\lparen"?(l="\u239B",h="\u239C",f="\u239D",m="Size4-Regular",d="lparen",p=875):e===")"||e==="\\rparen"?(l="\u239E",h="\u239F",f="\u23A0",m="Size4-Regular",d="rparen",p=875):e==="\\{"||e==="\\lbrace"?(l="\u23A7",u="\u23A8",f="\u23A9",h="\u23AA",m="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(l="\u23AB",u="\u23AC",f="\u23AD",h="\u23AA",m="Size4-Regular"):e==="\\lgroup"||e==="\u27EE"?(l="\u23A7",f="\u23A9",h="\u23AA",m="Size4-Regular"):e==="\\rgroup"||e==="\u27EF"?(l="\u23AB",f="\u23AD",h="\u23AA",m="Size4-Regular"):e==="\\lmoustache"||e==="\u23B0"?(l="\u23A7",f="\u23AD",h="\u23AA",m="Size4-Regular"):(e==="\\rmoustache"||e==="\u23B1")&&(l="\u23AB",f="\u23A9",h="\u23AA",m="Size4-Regular");var g=ey(l,m,a),y=g.height+g.depth,v=ey(h,m,a),x=v.height+v.depth,b=ey(f,m,a),w=b.height+b.depth,S=0,T=1;if(u!==null){var E=ey(u,m,a);S=E.height+E.depth,T=2}var _=y+w+S,A=Math.max(0,Math.ceil((r-_)/(T*x))),L=_+A*T*x,M=i.fontMetrics().axisHeight;n&&(M*=i.sizeMultiplier);var N=L/2-M,k=[];if(d.length>0){var I=L-y-w,C=Math.round(L*1e3),O=ixe(d,Math.round(I*1e3)),D=new Jl(d,O),P=(p/1e3).toFixed(3)+"em",F=(C/1e3).toFixed(3)+"em",B=new ll([D],{width:P,height:F,viewBox:"0 0 "+p+" "+C}),$=Be.makeSvgSpan([],[B],i);$.height=C/1e3,$.style.width=P,$.style.height=F,k.push({type:"elem",elem:$})}else{if(k.push(h7(f,m,a)),k.push(l4),u===null){var z=L-y-w+2*_7;k.push(f7(h,z,i))}else{var Y=(L-y-w-S)/2+2*_7;k.push(f7(h,Y,i)),k.push(l4),k.push(h7(u,m,a)),k.push(l4),k.push(f7(h,Y,i))}k.push(l4),k.push(h7(l,m,a))}var Q=i.havingBaseStyle(Ht.TEXT),X=Be.makeVList({positionType:"bottom",positionData:N,children:k},Q);return z7(Be.makeSpan(["delimsizing","mult"],[X],Q),Ht.TEXT,i,s)},"makeStackedDelim"),d7=80,p7=.08,m7=o(function(e,r,n,i,a){var s=rxe(e,i,n),l=new Jl(e,s),u=new ll([l],{width:"400em",height:ct(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Be.makeSvgSpan(["hide-tail"],[u],a)},"sqrtSvg"),Zxe=o(function(e,r){var n=r.havingBaseSizing(),i=n$("\\surd",e*n.sizeMultiplier,r$,n),a=n.sizeMultiplier,s=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),l,u=0,h=0,f=0,d;return i.type==="small"?(f=1e3+1e3*s+d7,e<1?a=1:e<1.4&&(a=.7),u=(1+s+p7)/a,h=(1+s)/a,l=m7("sqrtMain",u,f,s,r),l.style.minWidth="0.853em",d=.833/a):i.type==="large"?(f=(1e3+d7)*ty[i.size],h=(ty[i.size]+s)/a,u=(ty[i.size]+s+p7)/a,l=m7("sqrtSize"+i.size,u,f,s,r),l.style.minWidth="1.02em",d=1/a):(u=e+s+p7,h=e+s,f=Math.floor(1e3*e+s)+d7,l=m7("sqrtTall",u,f,s,r),l.style.minWidth="0.742em",d=1.056),l.height=h,l.style.height=ct(u),{span:l,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},"makeSqrtImage"),e$=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","\\surd"],Jxe=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1"],t$=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],ty=[0,1.2,1.8,2.4,3],ebe=o(function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle"),Vt.contains(e$,e)||Vt.contains(t$,e))return ZG(e,r,!1,n,i,a);if(Vt.contains(Jxe,e))return JG(e,ty[r],!1,n,i,a);throw new nt("Illegal delimiter: '"+e+"'")},"makeSizedDelim"),tbe=[{type:"small",style:Ht.SCRIPTSCRIPT},{type:"small",style:Ht.SCRIPT},{type:"small",style:Ht.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],rbe=[{type:"small",style:Ht.SCRIPTSCRIPT},{type:"small",style:Ht.SCRIPT},{type:"small",style:Ht.TEXT},{type:"stack"}],r$=[{type:"small",style:Ht.SCRIPTSCRIPT},{type:"small",style:Ht.SCRIPT},{type:"small",style:Ht.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],nbe=o(function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},"delimTypeToFont"),n$=o(function(e,r,n,i){for(var a=Math.min(2,3-i.style.size),s=a;sr)return n[s]}return n[n.length-1]},"traverseSequence"),i$=o(function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle");var l;Vt.contains(t$,e)?l=tbe:Vt.contains(e$,e)?l=r$:l=rbe;var u=n$(e,r,l,i);return u.type==="small"?Xxe(e,u.style,n,i,a,s):u.type==="large"?ZG(e,u.size,n,i,a,s):JG(e,r,n,i,a,s)},"makeCustomSizedDelim"),ibe=o(function(e,r,n,i,a,s){var l=i.fontMetrics().axisHeight*i.sizeMultiplier,u=901,h=5/i.fontMetrics().ptPerEm,f=Math.max(r-l,n+l),d=Math.max(f/500*u,2*f-h);return i$(e,d,!0,i,a,s)},"makeLeftRightDelim"),au={sqrtImage:Zxe,sizedDelim:ebe,sizeToMaxHeight:ty,customSizedDelim:i$,leftRightDelim:ibe},cG={"\\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}},abe=["(","\\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","."];o(E4,"checkDelimiter");vt({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:o((t,e)=>{var r=E4(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:cG[t.funcName].size,mclass:cG[t.funcName].mclass,delim:r.text}},"handler"),htmlBuilder:o((t,e)=>t.delim==="."?Be.makeSpan([t.mclass]):au.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass]),"htmlBuilder"),mathmlBuilder:o(t=>{var e=[];t.delim!=="."&&e.push(_o(t.delim,t.mode));var r=new et.MathNode("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=ct(au.sizeToMaxHeight[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r},"mathmlBuilder")});o(uG,"assertParsed");vt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:o((t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new nt("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:E4(e[0],t).text,color:r}},"handler")});vt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:o((t,e)=>{var r=E4(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=ir(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},"handler"),htmlBuilder:o((t,e)=>{uG(t);for(var r=Ri(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{uG(t);var r=gs(t.body,e);if(t.left!=="."){var n=new et.MathNode("mo",[_o(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new et.MathNode("mo",[_o(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return O7(r)},"mathmlBuilder")});vt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:o((t,e)=>{var r=E4(e[0],t);if(!t.parser.leftrightDepth)throw new nt("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},"handler"),htmlBuilder:o((t,e)=>{var r;if(t.delim===".")r=sy(e,[]);else{r=au.sizedDelim(t.delim,1,e,t.mode,[]);var n={delim:t.delim,options:e};r.isMiddle=n}return r},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?_o("|","text"):_o(t.delim,t.mode),n=new et.MathNode("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n},"mathmlBuilder")});G7=o((t,e)=>{var r=Be.wrapFragment(Cr(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s=0,l=Vt.isCharacterBox(t.body);if(n==="sout")a=Be.makeSpan(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var u=Hn({number:.6,unit:"pt"},e),h=Hn({number:.35,unit:"ex"},e),f=e.havingBaseSizing();i=i/f.sizeMultiplier;var d=r.height+r.depth+u+h;r.style.paddingLeft=ct(d/2+u);var p=Math.floor(1e3*d*i),m=exe(p),g=new ll([new Jl("phase",m)],{width:"400em",height:ct(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});a=Be.makeSvgSpan(["hide-tail"],[g],e),a.style.height=ct(d),s=r.depth+u+h}else{/cancel/.test(n)?l||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var y=0,v=0,x=0;/box/.test(n)?(x=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),y=e.fontMetrics().fboxsep+(n==="colorbox"?0:x),v=y):n==="angl"?(x=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),y=4*x,v=Math.max(0,.25-r.depth)):(y=l?.2:0,v=y),a=ou.encloseSpan(r,n,y,v,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=ct(x)):n==="angl"&&x!==.049&&(a.style.borderTopWidth=ct(x),a.style.borderRightWidth=ct(x)),s=r.depth+v,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var b;if(t.backgroundColor)b=Be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]},e);else{var w=/cancel|phase/.test(n)?["svg-align"]:[];b=Be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:w}]},e)}return/cancel/.test(n)&&(b.height=r.height,b.depth=r.depth),/cancel/.test(n)&&!l?Be.makeSpan(["mord","cancel-lap"],[b],e):Be.makeSpan(["mord"],[b],e)},"htmlBuilder$7"),$7=o((t,e)=>{var r=0,n=new et.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[fn(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+i+"em solid "+String(t.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n},"mathmlBuilder$6");vt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=ir(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:G7,mathmlBuilder:$7});vt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=ir(e[0],"color-token").color,s=ir(e[1],"color-token").color,l=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:l}},htmlBuilder:G7,mathmlBuilder:$7});vt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}});vt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:G7,mathmlBuilder:$7});vt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});a$={};o(ec,"defineEnvironment");s$={};o(le,"defineMacro");o(hG,"getHLines");C4=o(t=>{var e=t.parser.settings;if(!e.displayMode)throw new nt("{"+t.envName+"} can be used only in display mode.")},"validateAmsEnvironmentContext");o(V7,"getAutoTag");o(mh,"parseArray");o(U7,"dCellStyle");tc=o(function(e,r){var n,i,a=e.body.length,s=e.hLinesBeforeRow,l=0,u=new Array(a),h=[],f=Math.max(r.fontMetrics().arrayRuleWidth,r.minRuleThickness),d=1/r.fontMetrics().ptPerEm,p=5*d;if(e.colSeparationType&&e.colSeparationType==="small"){var m=r.havingStyle(Ht.SCRIPT).sizeMultiplier;p=.2778*(m/r.sizeMultiplier)}var g=e.colSeparationType==="CD"?Hn({number:3,unit:"ex"},r):12*d,y=3*d,v=e.arraystretch*g,x=.7*v,b=.3*v,w=0;function S(ke){for(var Ie=0;Ie0&&(w+=.25),h.push({pos:w,isDashed:ke[Ie]})}for(o(S,"setHLinePos"),S(s[0]),n=0;n0&&(N+=b,_ke))for(n=0;n=l)){var J=void 0;(i>0||e.hskipBeforeAndAfter)&&(J=Vt.deflt(Y.pregap,p),J!==0&&(O=Be.makeSpan(["arraycolsep"],[]),O.style.width=ct(J),C.push(O)));var Z=[];for(n=0;n0){for(var se=Be.makeLineSpan("hline",r,f),ce=Be.makeLineSpan("hdashline",r,f),ue=[{type:"elem",elem:u,shift:0}];h.length>0;){var te=h.pop(),De=te.pos-k;te.isDashed?ue.push({type:"elem",elem:ce,shift:De}):ue.push({type:"elem",elem:se,shift:De})}u=Be.makeVList({positionType:"individualShift",children:ue},r)}if(P.length===0)return Be.makeSpan(["mord"],[u],r);var oe=Be.makeVList({positionType:"individualShift",children:P},r);return oe=Be.makeSpan(["tag"],[oe],r),Be.makeFragment([u,oe])},"htmlBuilder"),sbe={c:"center ",l:"left ",r:"right "},rc=o(function(e,r){for(var n=[],i=new et.MathNode("mtd",[],["mtr-glue"]),a=new et.MathNode("mtd",[],["mml-eqn-num"]),s=0;s0){var g=e.cols,y="",v=!1,x=0,b=g.length;g[0].type==="separator"&&(p+="top ",x=1),g[g.length-1].type==="separator"&&(p+="bottom ",b-=1);for(var w=x;w0?"left ":"",p+=A[A.length-1].length>0?"right ":"";for(var L=1;L-1?"alignat":"align",a=e.envName==="split",s=mh(e.parser,{cols:n,addJot:!0,autoTag:a?void 0:V7(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:a?2:void 0,leqno:e.parser.settings.leqno},"display"),l,u=0,h={type:"ordgroup",mode:e.mode,body:[]};if(r[0]&&r[0].type==="ordgroup"){for(var f="",d=0;d0&&m&&(v=1),n[g]={type:"align",align:y,pregap:v,postgap:0}}return s.colSeparationType=m?"align":"alignat",s},"alignedHandler");ec({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=T4(e[0]),n=r?[e[0]]:ir(e[0],"ordgroup").body,i=n.map(function(s){var l=B7(s),u=l.text;if("lcr".indexOf(u)!==-1)return{type:"align",align:u};if(u==="|")return{type:"separator",separator:"|"};if(u===":")return{type:"separator",separator:":"};throw new nt("Unknown column alignment: "+u,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return mh(t.parser,a,U7(t.envName))},htmlBuilder:tc,mathmlBuilder:rc});ec({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,"lcr".indexOf(r)===-1)throw new nt("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=mh(t.parser,n,U7(t.envName)),s=Math.max(0,...a.body.map(l=>l.length));return a.cols=new Array(s).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:tc,mathmlBuilder:rc});ec({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=mh(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:tc,mathmlBuilder:rc});ec({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=T4(e[0]),n=r?[e[0]]:ir(e[0],"ordgroup").body,i=n.map(function(s){var l=B7(s),u=l.text;if("lc".indexOf(u)!==-1)return{type:"align",align:u};throw new nt("Unknown column alignment: "+u,s)});if(i.length>1)throw new nt("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(a=mh(t.parser,a,"script"),a.body.length>0&&a.body[0].length>1)throw new nt("{subarray} can contain only one column");return a},htmlBuilder:tc,mathmlBuilder:rc});ec({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=mh(t.parser,e,U7(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:tc,mathmlBuilder:rc});ec({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:o$,htmlBuilder:tc,mathmlBuilder:rc});ec({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){Vt.contains(["gather","gather*"],t.envName)&&C4(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:V7(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return mh(t.parser,e,"display")},htmlBuilder:tc,mathmlBuilder:rc});ec({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:o$,htmlBuilder:tc,mathmlBuilder:rc});ec({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){C4(t);var e={autoTag:V7(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return mh(t.parser,e,"display")},htmlBuilder:tc,mathmlBuilder:rc});ec({type:"array",names:["CD"],props:{numArgs:0},handler(t){return C4(t),Wxe(t.parser)},htmlBuilder:tc,mathmlBuilder:rc});le("\\nonumber","\\gdef\\@eqnsw{0}");le("\\notag","\\nonumber");vt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new nt(t.funcName+" valid only within array environment")}});fG=a$;vt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new nt("Invalid environment name",i);for(var a="",s=0;s{var r=t.font,n=e.withFont(r);return Cr(t.body,n)},"htmlBuilder$5"),c$=o((t,e)=>{var r=t.font,n=e.withFont(r);return fn(t.body,n)},"mathmlBuilder$4"),dG={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};vt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=y4(e[0]),a=n;return a in dG&&(a=dG[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},"handler"),htmlBuilder:l$,mathmlBuilder:c$});vt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:o((t,e)=>{var{parser:r}=t,n=e[0],i=Vt.isCharacterBox(n);return{type:"mclass",mode:r.mode,mclass:k4(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:i}},"handler")});vt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:o((t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:a}=r,s=r.parseExpression(!0,i),l="math"+n.slice(1);return{type:"font",mode:a,font:l,body:{type:"ordgroup",mode:r.mode,body:s}}},"handler"),htmlBuilder:l$,mathmlBuilder:c$});u$=o((t,e)=>{var r=e;return t==="display"?r=r.id>=Ht.SCRIPT.id?r.text():Ht.DISPLAY:t==="text"&&r.size===Ht.DISPLAY.size?r=Ht.TEXT:t==="script"?r=Ht.SCRIPT:t==="scriptscript"&&(r=Ht.SCRIPTSCRIPT),r},"adjustStyle"),H7=o((t,e)=>{var r=u$(t.size,e.style),n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=Cr(t.numer,a,e);if(t.continued){var l=8.5/e.fontMetrics().ptPerEm,u=3.5/e.fontMetrics().ptPerEm;s.height=s.height0?g=3*p:g=7*p,y=e.fontMetrics().denom1):(d>0?(m=e.fontMetrics().num2,g=p):(m=e.fontMetrics().num3,g=3*p),y=e.fontMetrics().denom2);var v;if(f){var b=e.fontMetrics().axisHeight;m-s.depth-(b+.5*d){var r=new et.MathNode("mfrac",[fn(t.numer,e),fn(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=Hn(t.barSize,e);r.setAttribute("linethickness",ct(n))}var i=u$(t.size,e.style);if(i.size!==e.style.size){r=new et.MathNode("mstyle",[r]);var a=i.size===Ht.DISPLAY.size?"true":"false";r.setAttribute("displaystyle",a),r.setAttribute("scriptlevel","0")}if(t.leftDelim!=null||t.rightDelim!=null){var s=[];if(t.leftDelim!=null){var l=new et.MathNode("mo",[new et.TextNode(t.leftDelim.replace("\\",""))]);l.setAttribute("fence","true"),s.push(l)}if(s.push(r),t.rightDelim!=null){var u=new et.MathNode("mo",[new et.TextNode(t.rightDelim.replace("\\",""))]);u.setAttribute("fence","true"),s.push(u)}return O7(s)}return r},"mathmlBuilder$3");vt({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1],s,l=null,u=null,h="auto";switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,l="(",u=")";break;case"\\\\bracefrac":s=!1,l="\\{",u="\\}";break;case"\\\\brackfrac":s=!1,l="[",u="]";break;default:throw new Error("Unrecognized genfrac command")}switch(n){case"\\dfrac":case"\\dbinom":h="display";break;case"\\tfrac":case"\\tbinom":h="text";break}return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:a,hasBarLine:s,leftDelim:l,rightDelim:u,size:h,barSize:null}},"handler"),htmlBuilder:H7,mathmlBuilder:Y7});vt({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1];return{type:"genfrac",mode:r.mode,continued:!0,numer:i,denom:a,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}},"handler")});vt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});pG=["display","text","script","scriptscript"],mG=o(function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r},"delimFromValue");vt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],a=y4(e[0]),s=a.type==="atom"&&a.family==="open"?mG(a.text):null,l=y4(e[1]),u=l.type==="atom"&&l.family==="close"?mG(l.text):null,h=ir(e[2],"size"),f,d=null;h.isBlank?f=!0:(d=h.value,f=d.number>0);var p="auto",m=e[3];if(m.type==="ordgroup"){if(m.body.length>0){var g=ir(m.body[0],"textord");p=pG[Number(g.text)]}}else m=ir(m,"textord"),p=pG[Number(m.text)];return{type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:f,barSize:d,leftDelim:s,rightDelim:u,size:p}},htmlBuilder:H7,mathmlBuilder:Y7});vt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:ir(e[0],"size").value,token:i}}});vt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=z2e(ir(e[1],"infix").size),s=e[2],l=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:l,barSize:a,leftDelim:null,rightDelim:null,size:"auto"}},"handler"),htmlBuilder:H7,mathmlBuilder:Y7});h$=o((t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?Cr(t.sup,e.havingStyle(r.sup()),e):Cr(t.sub,e.havingStyle(r.sub()),e),i=ir(t.base,"horizBrace")):i=ir(t,"horizBrace");var a=Cr(i.base,e.havingBaseStyle(Ht.DISPLAY)),s=ou.svgSpan(i,e),l;if(i.isOver?(l=Be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]},e),l.children[0].children[0].children[1].classes.push("svg-align")):(l=Be.makeVList({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a}]},e),l.children[0].children[0].children[0].classes.push("svg-align")),n){var u=Be.makeSpan(["mord",i.isOver?"mover":"munder"],[l],e);i.isOver?l=Be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:u},{type:"kern",size:.2},{type:"elem",elem:n}]},e):l=Be.makeVList({positionType:"bottom",positionData:u.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:u}]},e)}return Be.makeSpan(["mord",i.isOver?"mover":"munder"],[l],e)},"htmlBuilder$3"),obe=o((t,e)=>{var r=ou.mathMLnode(t.label);return new et.MathNode(t.isOver?"mover":"munder",[fn(t.base,e),r])},"mathmlBuilder$2");vt({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:e[0]}},htmlBuilder:h$,mathmlBuilder:obe});vt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:o((t,e)=>{var{parser:r}=t,n=e[1],i=ir(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:ui(n)}:r.formatUnsupportedCmd("\\href")},"handler"),htmlBuilder:o((t,e)=>{var r=Ri(t.body,e,!1);return Be.makeAnchor(t.href,[],r,e)},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=ph(t.body,e);return r instanceof ps||(r=new ps("mrow",[r])),r.setAttribute("href",t.href),r},"mathmlBuilder")});vt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:o((t,e)=>{var{parser:r}=t,n=ir(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:r,funcName:n,token:i}=t,a=ir(e[0],"raw").string,s=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l,u={};switch(n){case"\\htmlClass":u.class=a,l={command:"\\htmlClass",class:a};break;case"\\htmlId":u.id=a,l={command:"\\htmlId",id:a};break;case"\\htmlStyle":u.style=a,l={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var h=a.split(","),f=0;f{var r=Ri(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=Be.makeSpan(n,r,e);for(var a in t.attributes)a!=="class"&&t.attributes.hasOwnProperty(a)&&i.setAttribute(a,t.attributes[a]);return i},"htmlBuilder"),mathmlBuilder:o((t,e)=>ph(t.body,e),"mathmlBuilder")});vt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:o((t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:ui(e[0]),mathml:ui(e[1])}},"handler"),htmlBuilder:o((t,e)=>{var r=Ri(t.html,e,!1);return Be.makeFragment(r)},"htmlBuilder"),mathmlBuilder:o((t,e)=>ph(t.mathml,e),"mathmlBuilder")});g7=o(function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new nt("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!DG(n))throw new nt("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n},"sizeData");vt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:o((t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},l="";if(r[0])for(var u=ir(r[0],"raw").string,h=u.split(","),f=0;f{var r=Hn(t.height,e),n=0;t.totalheight.number>0&&(n=Hn(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=Hn(t.width,e));var a={height:ct(r+n)};i>0&&(a.width=ct(i)),n>0&&(a.verticalAlign=ct(-n));var s=new T7(t.src,t.alt,a);return s.height=r,s.depth=n,s},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=new et.MathNode("mglyph",[]);r.setAttribute("alt",t.alt);var n=Hn(t.height,e),i=0;if(t.totalheight.number>0&&(i=Hn(t.totalheight,e)-n,r.setAttribute("valign",ct(-i))),r.setAttribute("height",ct(n+i)),t.width.number>0){var a=Hn(t.width,e);r.setAttribute("width",ct(a))}return r.setAttribute("src",t.src),r},"mathmlBuilder")});vt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=ir(e[0],"size");if(r.settings.strict){var a=n[1]==="m",s=i.value.unit==="mu";a?(s||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return Be.makeGlue(t.dimension,e)},mathmlBuilder(t,e){var r=Hn(t.dimension,e);return new et.SpaceNode(r)}});vt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},"handler"),htmlBuilder:o((t,e)=>{var r;t.alignment==="clap"?(r=Be.makeSpan([],[Cr(t.body,e)]),r=Be.makeSpan(["inner"],[r],e)):r=Be.makeSpan(["inner"],[Cr(t.body,e)]);var n=Be.makeSpan(["fix"],[]),i=Be.makeSpan([t.alignment],[r,n],e),a=Be.makeSpan(["strut"]);return a.style.height=ct(i.height+i.depth),i.depth&&(a.style.verticalAlign=ct(-i.depth)),i.children.unshift(a),i=Be.makeSpan(["thinbox"],[i],e),Be.makeSpan(["mord","vbox"],[i],e)},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=new et.MathNode("mpadded",[fn(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r},"mathmlBuilder")});vt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var a=r==="\\("?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",body:s}}});vt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new nt("Mismatched "+t.funcName)}});gG=o((t,e)=>{switch(e.style.size){case Ht.DISPLAY.size:return t.display;case Ht.TEXT.size:return t.text;case Ht.SCRIPT.size:return t.script;case Ht.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}},"chooseMathStyle");vt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:o((t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:ui(e[0]),text:ui(e[1]),script:ui(e[2]),scriptscript:ui(e[3])}},"handler"),htmlBuilder:o((t,e)=>{var r=gG(t,e),n=Ri(r,e,!1);return Be.makeFragment(n)},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=gG(t,e);return ph(r,e)},"mathmlBuilder")});f$=o((t,e,r,n,i,a,s)=>{t=Be.makeSpan([],[t]);var l=r&&Vt.isCharacterBox(r),u,h;if(e){var f=Cr(e,n.havingStyle(i.sup()),n);h={elem:f,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-f.depth)}}if(r){var d=Cr(r,n.havingStyle(i.sub()),n);u={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var p;if(h&&u){var m=n.fontMetrics().bigOpSpacing5+u.elem.height+u.elem.depth+u.kern+t.depth+s;p=Be.makeVList({positionType:"bottom",positionData:m,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:ct(-a)},{type:"kern",size:u.kern},{type:"elem",elem:t},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:ct(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(u){var g=t.height-s;p=Be.makeVList({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:ct(-a)},{type:"kern",size:u.kern},{type:"elem",elem:t}]},n)}else if(h){var y=t.depth+s;p=Be.makeVList({positionType:"bottom",positionData:y,children:[{type:"elem",elem:t},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:ct(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else return t;var v=[p];if(u&&a!==0&&!l){var x=Be.makeSpan(["mspace"],[],n);x.style.marginRight=ct(a),v.unshift(x)}return Be.makeSpan(["mop","op-limits"],v,n)},"assembleSupSub"),d$=["\\smallint"],xp=o((t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=ir(t.base,"op"),i=!0):a=ir(t,"op");var s=e.style,l=!1;s.size===Ht.DISPLAY.size&&a.symbol&&!Vt.contains(d$,a.name)&&(l=!0);var u;if(a.symbol){var h=l?"Size2-Regular":"Size1-Regular",f="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(f=a.name.slice(1),a.name=f==="oiint"?"\\iint":"\\iiint"),u=Be.makeSymbol(a.name,h,"math",e,["mop","op-symbol",l?"large-op":"small-op"]),f.length>0){var d=u.italic,p=Be.staticSvg(f+"Size"+(l?"2":"1"),e);u=Be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:u,shift:0},{type:"elem",elem:p,shift:l?.08:0}]},e),a.name="\\"+f,u.classes.unshift("mop"),u.italic=d}}else if(a.body){var m=Ri(a.body,e,!0);m.length===1&&m[0]instanceof ms?(u=m[0],u.classes[0]="mop"):u=Be.makeSpan(["mop"],m,e)}else{for(var g=[],y=1;y{var r;if(t.symbol)r=new ps("mo",[_o(t.name,t.mode)]),Vt.contains(d$,t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new ps("mo",gs(t.body,e));else{r=new ps("mi",[new qf(t.name.slice(1))]);var n=new ps("mo",[_o("\u2061","text")]);t.parentIsSupSub?r=new ps("mrow",[r,n]):r=$G([r,n])}return r},"mathmlBuilder$1"),lbe={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A06":"\\bigsqcup"};vt({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:o((t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=lbe[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},"handler"),htmlBuilder:xp,mathmlBuilder:oy});vt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:o((t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ui(n)}},"handler"),htmlBuilder:xp,mathmlBuilder:oy});cbe={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint"};vt({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(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:xp,mathmlBuilder:oy});vt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:xp,mathmlBuilder:oy});vt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=cbe[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:xp,mathmlBuilder:oy});p$=o((t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=ir(t.base,"operatorname"),i=!0):a=ir(t,"operatorname");var s;if(a.body.length>0){for(var l=a.body.map(d=>{var p=d.text;return typeof p=="string"?{type:"textord",mode:d.mode,text:p}:d}),u=Ri(l,e.withFont("mathrm"),!0),h=0;h{for(var r=gs(t.body,e.withFont("mathrm")),n=!0,i=0;if.toText()).join("");r=[new et.TextNode(l)]}var u=new et.MathNode("mi",r);u.setAttribute("mathvariant","normal");var h=new et.MathNode("mo",[_o("\u2061","text")]);return t.parentIsSupSub?new et.MathNode("mrow",[u,h]):et.newDocumentFragment([u,h])},"mathmlBuilder");vt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:o((t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:ui(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},"handler"),htmlBuilder:p$,mathmlBuilder:ube});le("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Kf({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Be.makeFragment(Ri(t.body,e,!1)):Be.makeSpan(["mord"],Ri(t.body,e,!0),e)},mathmlBuilder(t,e){return ph(t.body,e,!0)}});vt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=Cr(t.body,e.havingCrampedStyle()),n=Be.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]},e);return Be.makeSpan(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new et.MathNode("mo",[new et.TextNode("\u203E")]);r.setAttribute("stretchy","true");var n=new et.MathNode("mover",[fn(t.body,e),r]);return n.setAttribute("accent","true"),n}});vt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:o((t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:ui(n)}},"handler"),htmlBuilder:o((t,e)=>{var r=Ri(t.body,e.withPhantom(),!1);return Be.makeFragment(r)},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=gs(t.body,e);return new et.MathNode("mphantom",r)},"mathmlBuilder")});vt({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:o((t,e)=>{var{parser:r}=t,n=e[0];return{type:"hphantom",mode:r.mode,body:n}},"handler"),htmlBuilder:o((t,e)=>{var r=Be.makeSpan([],[Cr(t.body,e.withPhantom())]);if(r.height=0,r.depth=0,r.children)for(var n=0;n{var r=gs(ui(t.body),e),n=new et.MathNode("mphantom",r),i=new et.MathNode("mpadded",[n]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i},"mathmlBuilder")});vt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:o((t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},"handler"),htmlBuilder:o((t,e)=>{var r=Be.makeSpan(["inner"],[Cr(t.body,e.withPhantom())]),n=Be.makeSpan(["fix"],[]);return Be.makeSpan(["mord","rlap"],[r,n],e)},"htmlBuilder"),mathmlBuilder:o((t,e)=>{var r=gs(ui(t.body),e),n=new et.MathNode("mphantom",r),i=new et.MathNode("mpadded",[n]);return i.setAttribute("width","0px"),i},"mathmlBuilder")});vt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=ir(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=Cr(t.body,e),n=Hn(t.dy,e);return Be.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){var r=new et.MathNode("mpadded",[fn(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});vt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});vt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],a=ir(e[0],"size"),s=ir(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&ir(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=Be.makeSpan(["mord","rule"],[],e),n=Hn(t.width,e),i=Hn(t.height,e),a=t.shift?Hn(t.shift,e):0;return r.style.borderRightWidth=ct(n),r.style.borderTopWidth=ct(i),r.style.bottom=ct(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=Hn(t.width,e),n=Hn(t.height,e),i=t.shift?Hn(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new et.MathNode("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",ct(r)),s.setAttribute("height",ct(n));var l=new et.MathNode("mpadded",[s]);return i>=0?l.setAttribute("height",ct(i)):(l.setAttribute("height",ct(i)),l.setAttribute("depth",ct(-i))),l.setAttribute("voffset",ct(i)),l}});o(m$,"sizingGroup");yG=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],hbe=o((t,e)=>{var r=e.havingSize(t.size);return m$(t.body,r,e)},"htmlBuilder");vt({type:"sizing",names:yG,props:{numArgs:0,allowedInText:!0},handler:o((t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:yG.indexOf(n)+1,body:a}},"handler"),htmlBuilder:hbe,mathmlBuilder:o((t,e)=>{var r=e.havingSize(t.size),n=gs(t.body,r),i=new et.MathNode("mstyle",n);return i.setAttribute("mathsize",ct(r.sizeMultiplier)),i},"mathmlBuilder")});vt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:o((t,e,r)=>{var{parser:n}=t,i=!1,a=!1,s=r[0]&&ir(r[0],"ordgroup");if(s)for(var l="",u=0;u{var r=Be.makeSpan([],[Cr(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0,r.children))for(var n=0;n{var r=new et.MathNode("mpadded",[fn(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r},"mathmlBuilder")});vt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(t,e){var r=Cr(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=Be.wrapFragment(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.idr.height+r.depth+s&&(s=(s+d-r.height-r.depth)/2);var p=u.height-r.height-s-h;r.style.paddingLeft=ct(f);var m=Be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+p)},{type:"elem",elem:u},{type:"kern",size:h}]},e);if(t.index){var g=e.havingStyle(Ht.SCRIPTSCRIPT),y=Cr(t.index,g,e),v=.6*(m.height-m.depth),x=Be.makeVList({positionType:"shift",positionData:-v,children:[{type:"elem",elem:y}]},e),b=Be.makeSpan(["root"],[x]);return Be.makeSpan(["mord","sqrt"],[b,m],e)}else return Be.makeSpan(["mord","sqrt"],[m],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new et.MathNode("mroot",[fn(r,e),fn(n,e)]):new et.MathNode("msqrt",[fn(r,e)])}});vG={display:Ht.DISPLAY,text:Ht.TEXT,script:Ht.SCRIPT,scriptscript:Ht.SCRIPTSCRIPT};vt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!0,r),s=n.slice(1,n.length-5);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=vG[t.style],n=e.havingStyle(r).withFont("");return m$(t.body,n,e)},mathmlBuilder(t,e){var r=vG[t.style],n=e.havingStyle(r),i=gs(t.body,n),a=new et.MathNode("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},l=s[t.style];return a.setAttribute("scriptlevel",l[0]),a.setAttribute("displaystyle",l[1]),a}});fbe=o(function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Ht.DISPLAY.size||n.alwaysHandleSupSub);return i?xp:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Ht.DISPLAY.size||n.limits);return a?p$:null}else{if(n.type==="accent")return Vt.isCharacterBox(n.base)?F7:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?h$:null}else return null}else return null},"htmlBuilderDelegate");Kf({type:"supsub",htmlBuilder(t,e){var r=fbe(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=Cr(n,e),l,u,h=e.fontMetrics(),f=0,d=0,p=n&&Vt.isCharacterBox(n);if(i){var m=e.havingStyle(e.style.sup());l=Cr(i,m,e),p||(f=s.height-m.fontMetrics().supDrop*m.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());u=Cr(a,g,e),p||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var y;e.style===Ht.DISPLAY?y=h.sup1:e.style.cramped?y=h.sup3:y=h.sup2;var v=e.sizeMultiplier,x=ct(.5/h.ptPerEm/v),b=null;if(u){var w=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");(s instanceof ms||w)&&(b=ct(-s.italic))}var S;if(l&&u){f=Math.max(f,y,l.depth+.25*h.xHeight),d=Math.max(d,h.sub2);var T=h.defaultRuleThickness,E=4*T;if(f-l.depth-(u.height-d)0&&(f+=_,d-=_)}var A=[{type:"elem",elem:u,shift:d,marginRight:x,marginLeft:b},{type:"elem",elem:l,shift:-f,marginRight:x}];S=Be.makeVList({positionType:"individualShift",children:A},e)}else if(u){d=Math.max(d,h.sub1,u.height-.8*h.xHeight);var L=[{type:"elem",elem:u,marginLeft:b,marginRight:x}];S=Be.makeVList({positionType:"shift",positionData:d,children:L},e)}else if(l)f=Math.max(f,y,l.depth+.25*h.xHeight),S=Be.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:l,marginRight:x}]},e);else throw new Error("supsub must have either sup or sub.");var M=E7(s,"right")||"mord";return Be.makeSpan([M],[s,Be.makeSpan(["msupsub"],[S])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var a=[fn(t.base,e)];t.sub&&a.push(fn(t.sub,e)),t.sup&&a.push(fn(t.sup,e));var s;if(r)s=n?"mover":"munder";else if(t.sub)if(t.sup){var h=t.base;h&&h.type==="op"&&h.limits&&e.style===Ht.DISPLAY||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(e.style===Ht.DISPLAY||h.limits)?s="munderover":s="msubsup"}else{var u=t.base;u&&u.type==="op"&&u.limits&&(e.style===Ht.DISPLAY||u.alwaysHandleSupSub)||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(u.limits||e.style===Ht.DISPLAY)?s="munder":s="msub"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Ht.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Ht.DISPLAY)?s="mover":s="msup"}return new et.MathNode(s,a)}});Kf({type:"atom",htmlBuilder(t,e){return Be.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new et.MathNode("mo",[_o(t.text,t.mode)]);if(t.family==="bin"){var n=P7(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});g$={mi:"italic",mn:"normal",mtext:"normal"};Kf({type:"mathord",htmlBuilder(t,e){return Be.makeOrd(t,e,"mathord")},mathmlBuilder(t,e){var r=new et.MathNode("mi",[_o(t.text,t.mode,e)]),n=P7(t,e)||"italic";return n!==g$[r.type]&&r.setAttribute("mathvariant",n),r}});Kf({type:"textord",htmlBuilder(t,e){return Be.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var r=_o(t.text,t.mode,e),n=P7(t,e)||"normal",i;return t.mode==="text"?i=new et.MathNode("mtext",[r]):/[0-9]/.test(t.text)?i=new et.MathNode("mn",[r]):t.text==="\\prime"?i=new et.MathNode("mo",[r]):i=new et.MathNode("mi",[r]),n!==g$[i.type]&&i.setAttribute("mathvariant",n),i}});y7={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},v7={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Kf({type:"spacing",htmlBuilder(t,e){if(v7.hasOwnProperty(t.text)){var r=v7[t.text].className||"";if(t.mode==="text"){var n=Be.makeOrd(t,e,"textord");return n.classes.push(r),n}else return Be.makeSpan(["mspace",r],[Be.mathsym(t.text,t.mode,e)],e)}else{if(y7.hasOwnProperty(t.text))return Be.makeSpan(["mspace",y7[t.text]],[],e);throw new nt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(v7.hasOwnProperty(t.text))r=new et.MathNode("mtext",[new et.TextNode("\xA0")]);else{if(y7.hasOwnProperty(t.text))return new et.MathNode("mspace");throw new nt('Unknown type of space "'+t.text+'"')}return r}});xG=o(()=>{var t=new et.MathNode("mtd",[]);return t.setAttribute("width","50%"),t},"pad");Kf({type:"tag",mathmlBuilder(t,e){var r=new et.MathNode("mtable",[new et.MathNode("mtr",[xG(),new et.MathNode("mtd",[ph(t.body,e)]),xG(),new et.MathNode("mtd",[ph(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});bG={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},wG={"\\textbf":"textbf","\\textmd":"textmd"},dbe={"\\textit":"textit","\\textup":"textup"},TG=o((t,e)=>{var r=t.font;if(r){if(bG[r])return e.withTextFontFamily(bG[r]);if(wG[r])return e.withTextFontWeight(wG[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(dbe[r])},"optionsWithFont");vt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:ui(i),font:n}},htmlBuilder(t,e){var r=TG(t,e),n=Ri(t.body,r,!0);return Be.makeSpan(["mord","text"],n,r)},mathmlBuilder(t,e){var r=TG(t,e);return ph(t.body,r)}});vt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=Cr(t.body,e),n=Be.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Be.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]},e);return Be.makeSpan(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new et.MathNode("mo",[new et.TextNode("\u203E")]);r.setAttribute("stretchy","true");var n=new et.MathNode("munder",[fn(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});vt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=Cr(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return Be.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){return new et.MathNode("mpadded",[fn(t.body,e)],["vcenter"])}});vt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new nt("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=kG(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"\u2423":"\xA0"),"makeVerb"),fh=zG,y$=`[ \r + ]`,pbe="\\\\[a-zA-Z@]+",mbe="\\\\[^\uD800-\uDFFF]",gbe="("+pbe+")"+y$+"*",ybe=`\\\\( +|[ \r ]+ +?)[ \r ]*`,L7="[\u0300-\u036F]",vbe=new RegExp(L7+"+$"),xbe="("+y$+"+)|"+(ybe+"|")+"([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]"+(L7+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(L7+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+gbe)+("|"+mbe+")"),v4=class{static{o(this,"Lexer")}constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(xbe,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new Ao("EOF",new Xs(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new nt("Unexpected character: '"+e[r]+"'",new Ao(e[r],new Xs(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=e.indexOf(` +`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new Ao(i,new Xs(this,r,this.tokenRegex.lastIndex))}},D7=class{static{o(this,"Namespace")}constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new nt("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}},bbe=s$;le("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});le("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});le("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});le("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});le("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});le("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");le("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});EG={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};le("\\char",function(t){var e=t.popToken(),r,n="";if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new nt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=EG[e.text],n==null||n>=r)throw new nt("Invalid base-"+r+" digit "+e.text);for(var i;(i=EG[t.future().text])!=null&&i{var n=t.consumeArg().tokens;if(n.length!==1)throw new nt("\\newcommand's first argument must be a macro name");var i=n[0].text,a=t.isDefined(i);if(a&&!e)throw new nt("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!r)throw new nt("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var s=0;if(n=t.consumeArg().tokens,n.length===1&&n[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new nt("Invalid number of arguments: "+l);s=parseInt(l),n=t.consumeArg().tokens}return t.macros.set(i,{tokens:n,numArgs:s}),""},"newcommand");le("\\newcommand",t=>W7(t,!1,!0));le("\\renewcommand",t=>W7(t,!0,!1));le("\\providecommand",t=>W7(t,!0,!0));le("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});le("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});le("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),fh[r],wn.math[r],wn.text[r]),""});le("\\bgroup","{");le("\\egroup","}");le("~","\\nobreakspace");le("\\lq","`");le("\\rq","'");le("\\aa","\\r a");le("\\AA","\\r A");le("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xA9}");le("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");le("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}");le("\u212C","\\mathscr{B}");le("\u2130","\\mathscr{E}");le("\u2131","\\mathscr{F}");le("\u210B","\\mathscr{H}");le("\u2110","\\mathscr{I}");le("\u2112","\\mathscr{L}");le("\u2133","\\mathscr{M}");le("\u211B","\\mathscr{R}");le("\u212D","\\mathfrak{C}");le("\u210C","\\mathfrak{H}");le("\u2128","\\mathfrak{Z}");le("\\Bbbk","\\Bbb{k}");le("\xB7","\\cdotp");le("\\llap","\\mathllap{\\textrm{#1}}");le("\\rlap","\\mathrlap{\\textrm{#1}}");le("\\clap","\\mathclap{\\textrm{#1}}");le("\\mathstrut","\\vphantom{(}");le("\\underbar","\\underline{\\text{#1}}");le("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');le("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}");le("\\ne","\\neq");le("\u2260","\\neq");le("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}");le("\u2209","\\notin");le("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}");le("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}");le("\u225A","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}");le("\u225B","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}");le("\u225D","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}");le("\u225E","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}");le("\u225F","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}");le("\u27C2","\\perp");le("\u203C","\\mathclose{!\\mkern-0.8mu!}");le("\u220C","\\notni");le("\u231C","\\ulcorner");le("\u231D","\\urcorner");le("\u231E","\\llcorner");le("\u231F","\\lrcorner");le("\xA9","\\copyright");le("\xAE","\\textregistered");le("\uFE0F","\\textregistered");le("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');le("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');le("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');le("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');le("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}");le("\u22EE","\\vdots");le("\\varGamma","\\mathit{\\Gamma}");le("\\varDelta","\\mathit{\\Delta}");le("\\varTheta","\\mathit{\\Theta}");le("\\varLambda","\\mathit{\\Lambda}");le("\\varXi","\\mathit{\\Xi}");le("\\varPi","\\mathit{\\Pi}");le("\\varSigma","\\mathit{\\Sigma}");le("\\varUpsilon","\\mathit{\\Upsilon}");le("\\varPhi","\\mathit{\\Phi}");le("\\varPsi","\\mathit{\\Psi}");le("\\varOmega","\\mathit{\\Omega}");le("\\substack","\\begin{subarray}{c}#1\\end{subarray}");le("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");le("\\boxed","\\fbox{$\\displaystyle{#1}$}");le("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");le("\\implies","\\DOTSB\\;\\Longrightarrow\\;");le("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");CG={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\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","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};le("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in CG?e=CG[r]:(r.slice(0,4)==="\\not"||r in wn.math&&Vt.contains(["bin","rel"],wn.math[r].group))&&(e="\\dotsb"),e});q7={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};le("\\dotso",function(t){var e=t.future().text;return e in q7?"\\ldots\\,":"\\ldots"});le("\\dotsc",function(t){var e=t.future().text;return e in q7&&e!==","?"\\ldots\\,":"\\ldots"});le("\\cdots",function(t){var e=t.future().text;return e in q7?"\\@cdots\\,":"\\@cdots"});le("\\dotsb","\\cdots");le("\\dotsm","\\cdots");le("\\dotsi","\\!\\cdots");le("\\dotsx","\\ldots\\,");le("\\DOTSI","\\relax");le("\\DOTSB","\\relax");le("\\DOTSX","\\relax");le("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");le("\\,","\\tmspace+{3mu}{.1667em}");le("\\thinspace","\\,");le("\\>","\\mskip{4mu}");le("\\:","\\tmspace+{4mu}{.2222em}");le("\\medspace","\\:");le("\\;","\\tmspace+{5mu}{.2777em}");le("\\thickspace","\\;");le("\\!","\\tmspace-{3mu}{.1667em}");le("\\negthinspace","\\!");le("\\negmedspace","\\tmspace-{4mu}{.2222em}");le("\\negthickspace","\\tmspace-{5mu}{.277em}");le("\\enspace","\\kern.5em ");le("\\enskip","\\hskip.5em\\relax");le("\\quad","\\hskip1em\\relax");le("\\qquad","\\hskip2em\\relax");le("\\tag","\\@ifstar\\tag@literal\\tag@paren");le("\\tag@paren","\\tag@literal{({#1})}");le("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new nt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});le("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");le("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");le("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");le("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");le("\\newline","\\\\\\relax");le("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");v$=ct(Zl["Main-Regular"][84][1]-.7*Zl["Main-Regular"][65][1]);le("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+v$+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");le("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+v$+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");le("\\hspace","\\@ifstar\\@hspacer\\@hspace");le("\\@hspace","\\hskip #1\\relax");le("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");le("\\ordinarycolon",":");le("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");le("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');le("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');le("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');le("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');le("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');le("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');le("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');le("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');le("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');le("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');le("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');le("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');le("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');le("\u2237","\\dblcolon");le("\u2239","\\eqcolon");le("\u2254","\\coloneqq");le("\u2255","\\eqqcolon");le("\u2A74","\\Coloneqq");le("\\ratio","\\vcentcolon");le("\\coloncolon","\\dblcolon");le("\\colonequals","\\coloneqq");le("\\coloncolonequals","\\Coloneqq");le("\\equalscolon","\\eqqcolon");le("\\equalscoloncolon","\\Eqqcolon");le("\\colonminus","\\coloneq");le("\\coloncolonminus","\\Coloneq");le("\\minuscolon","\\eqcolon");le("\\minuscoloncolon","\\Eqcolon");le("\\coloncolonapprox","\\Colonapprox");le("\\coloncolonsim","\\Colonsim");le("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");le("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");le("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");le("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");le("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}");le("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");le("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");le("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");le("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");le("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");le("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");le("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");le("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");le("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}");le("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}");le("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}");le("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}");le("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}");le("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}");le("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}");le("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}");le("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}");le("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}");le("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228A}");le("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2ACB}");le("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228B}");le("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2ACC}");le("\\imath","\\html@mathml{\\@imath}{\u0131}");le("\\jmath","\\html@mathml{\\@jmath}{\u0237}");le("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}");le("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}");le("\u27E6","\\llbracket");le("\u27E7","\\rrbracket");le("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}");le("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}");le("\u2983","\\lBrace");le("\u2984","\\rBrace");le("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`\u29B5}}");le("\u29B5","\\minuso");le("\\darr","\\downarrow");le("\\dArr","\\Downarrow");le("\\Darr","\\Downarrow");le("\\lang","\\langle");le("\\rang","\\rangle");le("\\uarr","\\uparrow");le("\\uArr","\\Uparrow");le("\\Uarr","\\Uparrow");le("\\N","\\mathbb{N}");le("\\R","\\mathbb{R}");le("\\Z","\\mathbb{Z}");le("\\alef","\\aleph");le("\\alefsym","\\aleph");le("\\Alpha","\\mathrm{A}");le("\\Beta","\\mathrm{B}");le("\\bull","\\bullet");le("\\Chi","\\mathrm{X}");le("\\clubs","\\clubsuit");le("\\cnums","\\mathbb{C}");le("\\Complex","\\mathbb{C}");le("\\Dagger","\\ddagger");le("\\diamonds","\\diamondsuit");le("\\empty","\\emptyset");le("\\Epsilon","\\mathrm{E}");le("\\Eta","\\mathrm{H}");le("\\exist","\\exists");le("\\harr","\\leftrightarrow");le("\\hArr","\\Leftrightarrow");le("\\Harr","\\Leftrightarrow");le("\\hearts","\\heartsuit");le("\\image","\\Im");le("\\infin","\\infty");le("\\Iota","\\mathrm{I}");le("\\isin","\\in");le("\\Kappa","\\mathrm{K}");le("\\larr","\\leftarrow");le("\\lArr","\\Leftarrow");le("\\Larr","\\Leftarrow");le("\\lrarr","\\leftrightarrow");le("\\lrArr","\\Leftrightarrow");le("\\Lrarr","\\Leftrightarrow");le("\\Mu","\\mathrm{M}");le("\\natnums","\\mathbb{N}");le("\\Nu","\\mathrm{N}");le("\\Omicron","\\mathrm{O}");le("\\plusmn","\\pm");le("\\rarr","\\rightarrow");le("\\rArr","\\Rightarrow");le("\\Rarr","\\Rightarrow");le("\\real","\\Re");le("\\reals","\\mathbb{R}");le("\\Reals","\\mathbb{R}");le("\\Rho","\\mathrm{P}");le("\\sdot","\\cdot");le("\\sect","\\S");le("\\spades","\\spadesuit");le("\\sub","\\subset");le("\\sube","\\subseteq");le("\\supe","\\supseteq");le("\\Tau","\\mathrm{T}");le("\\thetasym","\\vartheta");le("\\weierp","\\wp");le("\\Zeta","\\mathrm{Z}");le("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");le("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");le("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");le("\\bra","\\mathinner{\\langle{#1}|}");le("\\ket","\\mathinner{|{#1}\\rangle}");le("\\braket","\\mathinner{\\langle{#1}\\rangle}");le("\\Bra","\\left\\langle#1\\right|");le("\\Ket","\\left|#1\\right\\rangle");x$=o(t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),l=e.macros.get("\\|");e.macros.beginGroup();var u=o(d=>p=>{t&&(p.macros.set("|",s),i.length&&p.macros.set("\\|",l));var m=d;if(!d&&i.length){var g=p.future();g.text==="|"&&(p.popToken(),m=!0)}return{tokens:m?i:n,numArgs:0}},"midMacro");e.macros.set("|",u(!1)),i.length&&e.macros.set("\\|",u(!0));var h=e.consumeArg().tokens,f=e.expandTokens([...a,...h,...r]);return e.macros.endGroup(),{tokens:f.reverse(),numArgs:0}},"braketHelper");le("\\bra@ket",x$(!1));le("\\bra@set",x$(!0));le("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");le("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");le("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");le("\\angln","{\\angl n}");le("\\blue","\\textcolor{##6495ed}{#1}");le("\\orange","\\textcolor{##ffa500}{#1}");le("\\pink","\\textcolor{##ff00af}{#1}");le("\\red","\\textcolor{##df0030}{#1}");le("\\green","\\textcolor{##28ae7b}{#1}");le("\\gray","\\textcolor{gray}{#1}");le("\\purple","\\textcolor{##9d38bd}{#1}");le("\\blueA","\\textcolor{##ccfaff}{#1}");le("\\blueB","\\textcolor{##80f6ff}{#1}");le("\\blueC","\\textcolor{##63d9ea}{#1}");le("\\blueD","\\textcolor{##11accd}{#1}");le("\\blueE","\\textcolor{##0c7f99}{#1}");le("\\tealA","\\textcolor{##94fff5}{#1}");le("\\tealB","\\textcolor{##26edd5}{#1}");le("\\tealC","\\textcolor{##01d1c1}{#1}");le("\\tealD","\\textcolor{##01a995}{#1}");le("\\tealE","\\textcolor{##208170}{#1}");le("\\greenA","\\textcolor{##b6ffb0}{#1}");le("\\greenB","\\textcolor{##8af281}{#1}");le("\\greenC","\\textcolor{##74cf70}{#1}");le("\\greenD","\\textcolor{##1fab54}{#1}");le("\\greenE","\\textcolor{##0d923f}{#1}");le("\\goldA","\\textcolor{##ffd0a9}{#1}");le("\\goldB","\\textcolor{##ffbb71}{#1}");le("\\goldC","\\textcolor{##ff9c39}{#1}");le("\\goldD","\\textcolor{##e07d10}{#1}");le("\\goldE","\\textcolor{##a75a05}{#1}");le("\\redA","\\textcolor{##fca9a9}{#1}");le("\\redB","\\textcolor{##ff8482}{#1}");le("\\redC","\\textcolor{##f9685d}{#1}");le("\\redD","\\textcolor{##e84d39}{#1}");le("\\redE","\\textcolor{##bc2612}{#1}");le("\\maroonA","\\textcolor{##ffbde0}{#1}");le("\\maroonB","\\textcolor{##ff92c6}{#1}");le("\\maroonC","\\textcolor{##ed5fa6}{#1}");le("\\maroonD","\\textcolor{##ca337c}{#1}");le("\\maroonE","\\textcolor{##9e034e}{#1}");le("\\purpleA","\\textcolor{##ddd7ff}{#1}");le("\\purpleB","\\textcolor{##c6b9fc}{#1}");le("\\purpleC","\\textcolor{##aa87ff}{#1}");le("\\purpleD","\\textcolor{##7854ab}{#1}");le("\\purpleE","\\textcolor{##543b78}{#1}");le("\\mintA","\\textcolor{##f5f9e8}{#1}");le("\\mintB","\\textcolor{##edf2df}{#1}");le("\\mintC","\\textcolor{##e0e5cc}{#1}");le("\\grayA","\\textcolor{##f6f7f7}{#1}");le("\\grayB","\\textcolor{##f0f1f2}{#1}");le("\\grayC","\\textcolor{##e3e5e6}{#1}");le("\\grayD","\\textcolor{##d6d8da}{#1}");le("\\grayE","\\textcolor{##babec2}{#1}");le("\\grayF","\\textcolor{##888d93}{#1}");le("\\grayG","\\textcolor{##626569}{#1}");le("\\grayH","\\textcolor{##3b3e40}{#1}");le("\\grayI","\\textcolor{##21242c}{#1}");le("\\kaBlue","\\textcolor{##314453}{#1}");le("\\kaGreen","\\textcolor{##71B307}{#1}");b$={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},R7=class{static{o(this,"MacroExpander")}constructor(e,r,n){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=r,this.expansionCount=0,this.feed(e),this.macros=new D7(bbe,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new v4(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new Ao("EOF",n.loc)),this.pushTokens(i),r.range(n,"")}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),a,s=0,l=0;do{if(a=this.popToken(),r.push(a),a.text==="{")++s;else if(a.text==="}"){if(--s,s===-1)throw new nt("Extra }",a)}else if(a.text==="EOF")throw new nt("Unexpected end of input in a macro argument, expected '"+(e&&n?e[l]:"}")+"'",a);if(e&&n)if((s===0||s===1&&e[l]==="{")&&a.text===e[l]){if(++l,l===e.length){r.splice(-l,l);break}}else l=0}while(s!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:a}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new nt("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new nt("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new nt("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var a=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var l=a.length-1;l>=0;--l){var u=a[l];if(u.text==="#"){if(l===0)throw new nt("Incomplete placeholder at end of macro body",u);if(u=a[--l],u.text==="#")a.splice(l+1,1);else if(/^[1-9]$/.test(u.text))a.splice(l,2,...s[+u.text-1]);else throw new nt("Not a valid argument number",u)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Ao(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var a=0;if(i.indexOf("#")!==-1)for(var s=i.replace(/##/g,"");s.indexOf("#"+(a+1))!==-1;)++a;for(var l=new v4(i,this.settings),u=[],h=l.lex();h.text!=="EOF";)u.push(h),h=l.lex();u.reverse();var f={tokens:u,numArgs:a};return f}return i}isDefined(e){return this.macros.has(e)||fh.hasOwnProperty(e)||wn.math.hasOwnProperty(e)||wn.text.hasOwnProperty(e)||b$.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:fh.hasOwnProperty(e)&&!fh[e].primitive}},SG=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,c4=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"}),x7={"\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"}},AG={\u00E1:"a\u0301",\u00E0:"a\u0300",\u00E4:"a\u0308",\u01DF:"a\u0308\u0304",\u00E3:"a\u0303",\u0101:"a\u0304",\u0103:"a\u0306",\u1EAF:"a\u0306\u0301",\u1EB1:"a\u0306\u0300",\u1EB5:"a\u0306\u0303",\u01CE:"a\u030C",\u00E2:"a\u0302",\u1EA5:"a\u0302\u0301",\u1EA7:"a\u0302\u0300",\u1EAB:"a\u0302\u0303",\u0227:"a\u0307",\u01E1:"a\u0307\u0304",\u00E5:"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",\u00E7:"c\u0327",\u010F:"d\u030C",\u1E0B:"d\u0307",\u1E11:"d\u0327",\u00E9:"e\u0301",\u00E8:"e\u0300",\u00EB:"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",\u00EA:"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",\u00ED:"i\u0301",\u00EC:"i\u0300",\u00EF:"i\u0308",\u1E2F:"i\u0308\u0301",\u0129:"i\u0303",\u012B:"i\u0304",\u012D:"i\u0306",\u01D0:"i\u030C",\u00EE:"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",\u00F1:"n\u0303",\u0148:"n\u030C",\u1E45:"n\u0307",\u0146:"n\u0327",\u00F3:"o\u0301",\u00F2:"o\u0300",\u00F6:"o\u0308",\u022B:"o\u0308\u0304",\u00F5:"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",\u00F4:"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",\u00FA:"u\u0301",\u00F9:"u\u0300",\u00FC:"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",\u00FB:"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",\u00FD:"y\u0301",\u1EF3:"y\u0300",\u00FF:"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",\u00C1:"A\u0301",\u00C0:"A\u0300",\u00C4:"A\u0308",\u01DE:"A\u0308\u0304",\u00C3:"A\u0303",\u0100:"A\u0304",\u0102:"A\u0306",\u1EAE:"A\u0306\u0301",\u1EB0:"A\u0306\u0300",\u1EB4:"A\u0306\u0303",\u01CD:"A\u030C",\u00C2:"A\u0302",\u1EA4:"A\u0302\u0301",\u1EA6:"A\u0302\u0300",\u1EAA:"A\u0302\u0303",\u0226:"A\u0307",\u01E0:"A\u0307\u0304",\u00C5:"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",\u00C7:"C\u0327",\u010E:"D\u030C",\u1E0A:"D\u0307",\u1E10:"D\u0327",\u00C9:"E\u0301",\u00C8:"E\u0300",\u00CB:"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",\u00CA:"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",\u00CD:"I\u0301",\u00CC:"I\u0300",\u00CF:"I\u0308",\u1E2E:"I\u0308\u0301",\u0128:"I\u0303",\u012A:"I\u0304",\u012C:"I\u0306",\u01CF:"I\u030C",\u00CE:"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",\u00D1:"N\u0303",\u0147:"N\u030C",\u1E44:"N\u0307",\u0145:"N\u0327",\u00D3:"O\u0301",\u00D2:"O\u0300",\u00D6:"O\u0308",\u022A:"O\u0308\u0304",\u00D5:"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",\u00D4:"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",\u00DA:"U\u0301",\u00D9:"U\u0300",\u00DC:"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",\u00DB:"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",\u00DD:"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"},x4=class t{static{o(this,"Parser")}constructor(e,r){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 R7(e,r,this.mode),this.settings=r,this.leftrightDepth=0}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new nt("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new Ao("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(t.endOfExpression.indexOf(i.text)!==-1||r&&i.text===r||e&&fh[i.text]&&fh[i.text].infix)break;var a=this.parseAtom(r);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',e);var l=wn[this.mode][r].group,u=Xs.range(e),h;if(hxe.hasOwnProperty(l)){var f=l;h={type:"atom",mode:this.mode,family:f,loc:u,text:r}}else h={type:l,mode:this.mode,loc:u,text:r};s=h}else if(r.charCodeAt(0)>=128)this.settings.strict&&(LG(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:Xs.range(e),text:r};else return null;if(this.consume(),a)for(var d=0;d{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),bp.default.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}var bp,Qf,Cbe,Sbe,A$,C$,qr,_be,Lbe,Dbe,Rbe,_$,Nbe,yr,Mbe,Ibe,gh,K7,Obe,Pbe,S$,Q7,Ni,Zf,yh,We,rr=R(()=>{"use strict";bp=Xi(o7(),1),Qf=//gi,Cbe=o(t=>t?_$(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),Sbe=(()=>{let t=!1;return()=>{t||(Abe(),t=!0)}})();o(Abe,"setupDompurifyHooks");A$=o(t=>(Sbe(),bp.default.sanitize(t)),"removeScript"),C$=o((t,e)=>{if(e.flowchart?.htmlLabels!==!1){let r=e.securityLevel;r==="antiscript"||r==="strict"?t=A$(t):r!=="loose"&&(t=_$(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=Rbe(t))}return t},"sanitizeMore"),qr=o((t,e)=>t&&(e.dompurifyConfig?t=bp.default.sanitize(C$(t,e),e.dompurifyConfig).toString():t=bp.default.sanitize(C$(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),_be=o((t,e)=>typeof t=="string"?qr(t,e):t.flat().map(r=>qr(r,e)),"sanitizeTextOrArray"),Lbe=o(t=>Qf.test(t),"hasBreaks"),Dbe=o(t=>t.split(Qf),"splitBreaks"),Rbe=o(t=>t.replace(/#br#/g,"
    "),"placeholderToBreak"),_$=o(t=>t.replace(Qf,"#br#"),"breakToPlaceholder"),Nbe=o(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=e.replaceAll(/\(/g,"\\("),e=e.replaceAll(/\)/g,"\\)")),e},"getUrl"),yr=o(t=>!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),Mbe=o(function(...t){let e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),Ibe=o(function(...t){let e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),gh=o(function(t){let e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),Obe=o((t,e)=>{let r=K7(t,"~"),n=K7(e,"~");return r===1&&n===1},"shouldCombineSets"),Pbe=o(t=>{let e=K7(t,"~"),r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);let n=[...t],i=n.indexOf("~"),a=n.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),S$=o(()=>window.MathMLElement!==void 0,"isMathMLSupported"),Q7=/\$\$(.*)\$\$/g,Ni=o(t=>(t.match(Q7)?.length??0)>0,"hasKatex"),Zf=o(async(t,e)=>{t=await yh(t,e);let r=document.createElement("div");r.innerHTML=t,r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);let i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),yh=o(async(t,e)=>{if(!Ni(t))return t;if(!(S$()||e.legacyMathML||e.forceLegacyMathML))return t.replace(Q7,"MathML is unsupported in this environment.");let{default:r}=await Promise.resolve().then(()=>(E$(),k$)),n=e.forceLegacyMathML||!S$()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(Qf).map(i=>Ni(i)?`
    ${i}
    `:`
    ${i}
    `).join("").replace(Q7,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))},"renderKatex"),We={getRows:Cbe,sanitizeText:qr,sanitizeTextOrArray:_be,hasBreaks:Lbe,splitBreaks:Dbe,lineBreakRegex:Qf,removeScript:A$,getUrl:Nbe,evaluate:yr,getMax:Mbe,getMin:Ibe}});var Bbe,Fbe,Sr,Lo,Yn=R(()=>{"use strict";ut();Bbe=o(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),Fbe=o(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),Sr=o(function(t,e,r,n){let i=Fbe(e,r,n);Bbe(t,i)},"configureSvgSize"),Lo=o(function(t,e,r,n){let i=e.node().getBBox(),a=i.width,s=i.height;V.info(`SVG bounds: ${a}x${s}`,i);let l=0,u=0;V.info(`Graph bounds: ${l}x${u}`,t),l=a+r*2,u=s+r*2,V.info(`Calculated bounds: ${l}x${u}`),Sr(e,u,l,n);let h=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",h)},"setupGraphViewbox")});var S4,zbe,L$,D$,Z7=R(()=>{"use strict";ut();S4={},zbe=o((t,e,r)=>{let n="";return t in S4&&S4[t]?n=S4[t](r):V.warn(`No theme found for ${t}`),` & { + font-family: ${r.fontFamily}; + font-size: ${r.fontSize}; + fill: ${r.textColor} } /* Classes common for multiple diagrams */ & .error-icon { - fill: ${f.errorBkgColor}; + fill: ${r.errorBkgColor}; } & .error-text { - fill: ${f.errorTextColor}; - stroke: ${f.errorTextColor}; + fill: ${r.errorTextColor}; + stroke: ${r.errorTextColor}; } & .edge-thickness-normal { - stroke-width: 2px; + stroke-width: 1px; } & .edge-thickness-thick { stroke-width: 3.5px @@ -45,7 +295,10 @@ & .edge-pattern-solid { stroke-dasharray: 0; } - + & .edge-thickness-invisible { + stroke-width: 0; + fill: none; + } & .edge-pattern-dashed{ stroke-dasharray: 3; } @@ -54,91 +307,127 @@ } & .marker { - fill: ${f.lineColor}; - stroke: ${f.lineColor}; + fill: ${r.lineColor}; + stroke: ${r.lineColor}; } & .marker.cross { - stroke: ${f.lineColor}; + stroke: ${r.lineColor}; } & svg { - font-family: ${f.fontFamily}; - font-size: ${f.fontSize}; - } - - ${p} - - ${a} -`},w_t=(i,a)=>{gW[i]=a},m_t=v_t;let ede="",pW="",tde="";const nde=i=>ep(i,Tt()),rp=function(){ede="",tde="",pW=""},ip=function(i){ede=nde(i).replace(/^\s+/g,"")},L2=function(){return ede||pW},M2=function(i){tde=nde(i).replace(/\n\s+/g,` -`)},D2=function(){return tde},Uw=function(i){pW=nde(i)},Ww=function(){return pW},kIe=Object.freeze(Object.defineProperty({__proto__:null,clear:rp,default:{getAccTitle:L2,setAccTitle:ip,getDiagramTitle:Ww,setDiagramTitle:Uw,getAccDescription:D2,setAccDescription:M2,clear:rp},getAccDescription:D2,getAccTitle:L2,getDiagramTitle:Ww,setAccDescription:M2,setAccTitle:ip,setDiagramTitle:Uw},Symbol.toStringTag,{value:"Module"}));let XE={};const rde=function(i,a,f,p){Fe.debug("parseDirective is being called",a,f,p);try{if(a!==void 0)switch(a=a.trim(),f){case"open_directive":XE={};break;case"type_directive":if(!XE)throw new Error("currentDirective is undefined");XE.type=a.toLowerCase();break;case"arg_directive":if(!XE)throw new Error("currentDirective is undefined");XE.args=JSON.parse(a);break;case"close_directive":y_t(i,XE,p),XE=void 0;break}}catch(w){Fe.error(`Error while rendering sequenceDiagram directive: ${a} jison context: ${f}`),Fe.error(w.message)}},y_t=function(i,a,f){switch(Fe.info(`Directive type=${a.type} with args:`,a.args),a.type){case"init":case"initialize":{["config"].forEach(p=>{a.args[p]!==void 0&&(f==="flowchart-v2"&&(f="flowchart"),a.args[f]=a.args[p],delete a.args[p])}),Fe.info("sanitize in handleDirective",a.args),jA(a.args),Fe.info("sanitize in handleDirective (done)",a.args),vIe(a.args);break}case"wrap":case"nowrap":i&&i.setWrap&&i.setWrap(a.type==="wrap");break;case"themeCss":Fe.warn("themeCss encountered");break;default:Fe.warn(`Unhandled directive: source: '%%{${a.type}: ${JSON.stringify(a.args?a.args:{})}}%%`,a);break}},k_t=Fe,x_t=$fe,GN=Tt,E_t=i=>ep(i,GN()),xIe=YE,T_t=()=>kIe,__t=(i,a,f,p)=>rde(i,a,f,p),bW={},vW=(i,a,f)=>{if(bW[i])throw new Error(`Diagram ${i} already registered.`);bW[i]=a,f&&_Ie(i,f),w_t(i,a.styles),a.injectUtils&&a.injectUtils(k_t,x_t,GN,E_t,xIe,T_t(),__t)},ide=i=>{if(i in bW)return bW[i];throw new Error(`Diagram ${i} not found.`)};class EIe extends Error{constructor(a){super(a),this.name="UnknownDiagramError"}}const C_t=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,S_t=/\s*%%.*\n/gm,PA={},wW=function(i,a){i=i.replace(fIe,"").replace(C_t,"").replace(S_t,` -`);for(const[f,{detector:p}]of Object.entries(PA))if(p(i,a))return f;throw new EIe(`No diagram type detected matching given configuration for text: ${i}`)},TIe=(...i)=>{for(const{id:a,detector:f,loader:p}of i)_Ie(a,f,p)},A_t=async()=>{Fe.debug("Loading registered diagrams");const a=(await Promise.allSettled(Object.entries(PA).map(async([f,{detector:p,loader:w}])=>{if(w)try{ide(f)}catch{try{const{diagram:b,id:E}=await w();vW(E,b,p)}catch(b){throw Fe.error(`Failed to load external diagram with key ${f}. Removing from detectors.`),delete PA[f],b}}}))).filter(f=>f.status==="rejected");if(a.length>0){Fe.error(`Failed to load ${a.length} external diagrams`);for(const f of a)Fe.error(f);throw new Error(`Failed to load ${a.length} external diagrams`)}},_Ie=(i,a,f)=>{PA[i]?Fe.error(`Detector with key ${i} already exists`):PA[i]={detector:a,loader:f},Fe.debug(`Detector with key ${i} added${f?" with loader":""}`)},L_t=i=>PA[i].loader;var M_t=typeof global=="object"&&global&&global.Object===Object&&global;const CIe=M_t;var D_t=typeof self=="object"&&self&&self.Object===Object&&self,I_t=CIe||D_t||Function("return this")();const Kw=I_t;var O_t=Kw.Symbol;const Vb=O_t;var SIe=Object.prototype,N_t=SIe.hasOwnProperty,P_t=SIe.toString,qN=Vb?Vb.toStringTag:void 0;function B_t(i){var a=N_t.call(i,qN),f=i[qN];try{i[qN]=void 0;var p=!0}catch{}var w=P_t.call(i);return p&&(a?i[qN]=f:delete i[qN]),w}var R_t=Object.prototype,F_t=R_t.toString;function j_t(i){return F_t.call(i)}var $_t="[object Null]",H_t="[object Undefined]",AIe=Vb?Vb.toStringTag:void 0;function QE(i){return i==null?i===void 0?H_t:$_t:AIe&&AIe in Object(i)?B_t(i):j_t(i)}function I2(i){var a=typeof i;return i!=null&&(a=="object"||a=="function")}var z_t="[object AsyncFunction]",G_t="[object Function]",q_t="[object GeneratorFunction]",V_t="[object Proxy]";function BA(i){if(!I2(i))return!1;var a=QE(i);return a==G_t||a==q_t||a==z_t||a==V_t}var U_t=Kw["__core-js_shared__"];const sde=U_t;var LIe=function(){var i=/[^.]+$/.exec(sde&&sde.keys&&sde.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}();function W_t(i){return!!LIe&&LIe in i}var K_t=Function.prototype,Y_t=K_t.toString;function ZE(i){if(i!=null){try{return Y_t.call(i)}catch{}try{return i+""}catch{}}return""}var X_t=/[\\^$.*+?()[\]{}|]/g,Q_t=/^\[object .+?Constructor\]$/,Z_t=Function.prototype,J_t=Object.prototype,eCt=Z_t.toString,tCt=J_t.hasOwnProperty,nCt=RegExp("^"+eCt.call(tCt).replace(X_t,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function rCt(i){if(!I2(i)||W_t(i))return!1;var a=BA(i)?nCt:Q_t;return a.test(ZE(i))}function iCt(i,a){return i==null?void 0:i[a]}function JE(i,a){var f=iCt(i,a);return rCt(f)?f:void 0}var sCt=JE(Object,"create");const VN=sCt;function aCt(){this.__data__=VN?VN(null):{},this.size=0}function oCt(i){var a=this.has(i)&&delete this.__data__[i];return this.size-=a?1:0,a}var cCt="__lodash_hash_undefined__",uCt=Object.prototype,lCt=uCt.hasOwnProperty;function hCt(i){var a=this.__data__;if(VN){var f=a[i];return f===cCt?void 0:f}return lCt.call(a,i)?a[i]:void 0}var fCt=Object.prototype,dCt=fCt.hasOwnProperty;function gCt(i){var a=this.__data__;return VN?a[i]!==void 0:dCt.call(a,i)}var pCt="__lodash_hash_undefined__";function bCt(i,a){var f=this.__data__;return this.size+=this.has(i)?0:1,f[i]=VN&&a===void 0?pCt:a,this}function e9(i){var a=-1,f=i==null?0:i.length;for(this.clear();++a-1}function ECt(i,a){var f=this.__data__,p=mW(f,i);return p<0?(++this.size,f.push([i,a])):f[p][1]=a,this}function b5(i){var a=-1,f=i==null?0:i.length;for(this.clear();++ay.args);jA(w),p=nd(p,[...w])}else p=f.args;if(p){let w=wW(i,a);["config"].forEach(y=>{p[y]!==void 0&&(w==="flowchart-v2"&&(w="flowchart"),p[w]=p[y],delete p[y])})}return p},MIe=function(i,a=null){try{const f=new RegExp(`[%]{2}(?![{]${OCt.source})(?=[}][%]{2}).* -`,"ig");i=i.trim().replace(f,"").replace(/'/gm,'"'),Fe.debug(`Detecting diagram directive${a!==null?" type:"+a:""} based on the text:${i}`);let p;const w=[];for(;(p=ade.exec(i))!==null;)if(p.index===ade.lastIndex&&ade.lastIndex++,p&&!a||a&&p[1]&&p[1].match(a)||a&&p[2]&&p[2].match(a)){const y=p[1]?p[1]:p[2],b=p[3]?p[3].trim():p[4]?JSON.parse(p[4].trim()):null;w.push({type:y,args:b})}return w.length===0&&w.push({type:i,args:null}),w.length===1?w[0]:w}catch(f){return Fe.error(`ERROR: ${f.message} - Unable to parse directive - ${a!==null?" type:"+a:""} based on the text:${i}`),{type:null,args:null}}},PCt=function(i,a){for(const[f,p]of a.entries())if(p.match(i))return f;return-1};function Ub(i,a){if(!i)return a;const f=`curve${i.charAt(0).toUpperCase()+i.slice(1)}`;return ICt[f]||a}function BCt(i,a){const f=i.trim();if(f)return a.securityLevel!=="loose"?u5(f):f}const RCt=(i,...a)=>{const f=i.split("."),p=f.length-1,w=f[p];let y=window;for(let b=0;b{f+=kW(y,a),a=y});let p=f/2,w;return a=void 0,i.forEach(y=>{if(a&&!w){const b=kW(y,a);if(b=1&&(w={x:y.x,y:y.y}),E>0&&E<1&&(w={x:(1-E)*a.x+E*y.x,y:(1-E)*a.y+E*y.y})}}a=y}),w}function jCt(i){return i.length===1?i[0]:FCt(i)}const $Ct=(i,a,f)=>{let p;Fe.info(`our points ${JSON.stringify(a)}`),a[0]!==f&&(a=a.reverse());let y=25,b;p=void 0,a.forEach(B=>{if(p&&!b){const R=kW(B,p);if(R=1&&(b={x:B.x,y:B.y}),j>0&&j<1&&(b={x:(1-j)*p.x+j*B.x,y:(1-j)*p.y+j*B.y})}}p=B});const E=i?10:5,S=Math.atan2(a[0].y-b.y,a[0].x-b.x),N={x:0,y:0};return N.x=Math.sin(S)*E+(a[0].x+b.x)/2,N.y=-Math.cos(S)*E+(a[0].y+b.y)/2,N};function HCt(i,a,f){let p=JSON.parse(JSON.stringify(f)),w;Fe.info("our points",p),a!=="start_left"&&a!=="start_right"&&(p=p.reverse()),p.forEach(R=>{w=R});let b=25+i,E;w=void 0,p.forEach(R=>{if(w&&!E){const j=kW(R,w);if(j=1&&(E={x:R.x,y:R.y}),$>0&&$<1&&(E={x:(1-$)*w.x+$*R.x,y:(1-$)*w.y+$*R.y})}}w=R});const S=10+i*.5,N=Math.atan2(p[0].y-E.y,p[0].x-E.x),B={x:0,y:0};return B.x=Math.sin(N)*S+(p[0].x+E.x)/2,B.y=-Math.cos(N)*S+(p[0].y+E.y)/2,a==="start_left"&&(B.x=Math.sin(N+Math.PI)*S+(p[0].x+E.x)/2,B.y=-Math.cos(N+Math.PI)*S+(p[0].y+E.y)/2),a==="end_right"&&(B.x=Math.sin(N-Math.PI)*S+(p[0].x+E.x)/2-5,B.y=-Math.cos(N-Math.PI)*S+(p[0].y+E.y)/2-5),a==="end_left"&&(B.x=Math.sin(N)*S+(p[0].x+E.x)/2-5,B.y=-Math.cos(N)*S+(p[0].y+E.y)/2-5),B}function Yw(i){let a="",f="";for(const p of i)p!==void 0&&(p.startsWith("color:")||p.startsWith("text-align:")?f=f+p+";":a=a+p+";");return{style:a,labelStyle:f}}let DIe=0;const IIe=()=>(DIe++,"id-"+Math.random().toString(36).substr(2,12)+"-"+DIe);function zCt(i){let a="";const f="0123456789abcdef",p=f.length;for(let w=0;wzCt(i.length),GCt=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}},qCt=function(i,a){const f=a.text.replace(Wa.lineBreakRegex," "),[,p]=$A(a.fontSize),w=i.append("text");w.attr("x",a.x),w.attr("y",a.y),w.style("text-anchor",a.anchor),w.style("font-family",a.fontFamily),w.style("font-size",p),w.style("font-weight",a.fontWeight),w.attr("fill",a.fill),a.class!==void 0&&w.attr("class",a.class);const y=w.append("tspan");return y.attr("x",a.x+a.textMargin*2),y.attr("fill",a.fill),y.text(f),w},NIe=FA((i,a,f)=>{if(!i||(f=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
    "},f),Wa.lineBreakRegex.test(i)))return i;const p=i.split(" "),w=[];let y="";return p.forEach((b,E)=>{const S=s3(`${b} `,f),N=s3(y,f);if(S>a){const{hyphenatedStrings:j,remainingWord:$}=VCt(b,a,"-",f);w.push(y,...j),y=$}else N+S>=a?(w.push(y),y=b):y=[y,b].filter(Boolean).join(" ");E+1===p.length&&w.push(y)}),w.filter(b=>b!=="").join(f.joinWith)},(i,a,f)=>`${i}${a}${f.fontSize}${f.fontWeight}${f.fontFamily}${f.joinWith}`),VCt=FA((i,a,f="-",p)=>{p=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},p);const w=[...i],y=[];let b="";return w.forEach((E,S)=>{const N=`${b}${E}`;if(s3(N,p)>=a){const R=S+1,j=w.length===R,$=`${N}${f}`;y.push(j?N:$),b=""}else b=N}),{hyphenatedStrings:y,remainingWord:b}},(i,a,f="-",p)=>`${i}${a}${f}${p.fontSize}${p.fontWeight}${p.fontFamily}`);function ode(i,a){return a=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:15},a),cde(i,a).height}function s3(i,a){return a=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial"},a),cde(i,a).width}const cde=FA((i,a)=>{a=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial"},a);const{fontSize:f,fontFamily:p,fontWeight:w}=a;if(!i)return{width:0,height:0};const[,y]=$A(f),b=["sans-serif",p],E=i.split(Wa.lineBreakRegex),S=[],N=Cr("body");if(!N.remove)return{width:0,height:0,lineHeight:0};const B=N.append("svg");for(const j of b){let $=0;const V={width:0,height:0,lineHeight:0};for(const Q of E){const oe=GCt();oe.text=Q;const ce=qCt(B,oe).style("font-size",y).style("font-weight",w).style("font-family",j),se=(ce._groups||ce)[0][0].getBBox();if(se.width===0&&se.height===0)throw new Error("svg element not in render tree");V.width=Math.round(Math.max(V.width,se.width)),$=Math.round(se.height),V.height+=$,V.lineHeight=Math.round(Math.max(V.lineHeight,$))}S.push(V)}B.remove();const R=isNaN(S[1].height)||isNaN(S[1].width)||isNaN(S[1].lineHeight)||S[0].height>S[1].height&&S[0].width>S[1].width&&S[0].lineHeight>S[1].lineHeight?0:1;return S[R]},(i,a)=>`${i}${a.fontSize}${a.fontWeight}${a.fontFamily}`),UCt=class{constructor(a,f){this.deterministic=a,this.seed=f,this.count=f?f.length:0}next(){return this.deterministic?this.count++:Date.now()}};let xW;const WCt=function(i){return xW=xW||document.createElement("div"),i=escape(i).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),xW.innerHTML=i,unescape(xW.textContent)},jA=i=>{if(Fe.debug("directiveSanitizer called with",i),typeof i=="object"&&(i.length?i.forEach(a=>jA(a)):Object.keys(i).forEach(a=>{Fe.debug("Checking key",a),a.startsWith("__")&&(Fe.debug("sanitize deleting __ option",a),delete i[a]),a.includes("proto")&&(Fe.debug("sanitize deleting proto option",a),delete i[a]),a.includes("constr")&&(Fe.debug("sanitize deleting constr option",a),delete i[a]),a.includes("themeCSS")&&(Fe.debug("sanitizing themeCss option"),i[a]=EW(i[a])),a.includes("fontFamily")&&(Fe.debug("sanitizing fontFamily option"),i[a]=EW(i[a])),a.includes("altFontFamily")&&(Fe.debug("sanitizing altFontFamily option"),i[a]=EW(i[a])),m9t.includes(a)?typeof i[a]=="object"&&(Fe.debug("sanitize deleting object",a),jA(i[a])):(Fe.debug("sanitize deleting option",a),delete i[a])})),i.themeVariables){const a=Object.keys(i.themeVariables);for(const f of a){const p=i.themeVariables[f];p&&p.match&&!p.match(/^[\d "#%(),.;A-Za-z]+$/)&&(i.themeVariables[f]="")}}Fe.debug("After sanitization",i)},EW=i=>{let a=0,f=0;for(const p of i){if(a{if(!p)return;const w=i.node().getBBox();i.append("text").text(p).attr("x",w.x+w.width/2).attr("y",-f).attr("class",a)},$A=i=>{if(typeof i=="number")return[i,i+"px"];const a=parseInt(i,10);return Number.isNaN(a)?[void 0,void 0]:i===String(a)?[a,i+"px"]:[a,i]},co={assignWithDepth:nd,wrapLabel:NIe,calculateTextHeight:ode,calculateTextWidth:s3,calculateTextDimensions:cde,detectInit:NCt,detectDirective:MIe,isSubstringInArray:PCt,interpolateToCurve:Ub,calcLabelPosition:jCt,calcCardinalityPosition:$Ct,calcTerminalLabelPosition:HCt,formatUrl:BCt,getStylesFromArray:Yw,generateId:IIe,random:OIe,runFunc:RCt,entityDecode:WCt,initIdGenerator:UCt,directiveSanitizer:jA,sanitizeCss:EW,insertTitle:YCt,parseFontSize:$A};var BIe="comm",RIe="rule",FIe="decl",XCt="@import",QCt="@keyframes",ZCt=Math.abs,ude=String.fromCharCode;function jIe(i){return i.trim()}function lde(i,a,f){return i.replace(a,f)}function JCt(i,a){return i.indexOf(a)}function WN(i,a){return i.charCodeAt(a)|0}function KN(i,a,f){return i.slice(a,f)}function ex(i){return i.length}function $Ie(i){return i.length}function TW(i,a){return a.push(i),i}var _W=1,HA=1,HIe=0,Wb=0,jf=0,zA="";function hde(i,a,f,p,w,y,b){return{value:i,root:a,parent:f,type:p,props:w,children:y,line:_W,column:HA,length:b,return:""}}function eSt(){return jf}function tSt(){return jf=Wb>0?WN(zA,--Wb):0,HA--,jf===10&&(HA=1,_W--),jf}function Xw(){return jf=Wb2||fde(jf)>3?"":" "}function sSt(i,a){for(;--a&&Xw()&&!(jf<48||jf>102||jf>57&&jf<65||jf>70&&jf<97););return SW(i,CW()+(a<6&&t9()==32&&Xw()==32))}function gde(i){for(;Xw();)switch(jf){case i:return Wb;case 34:case 39:i!==34&&i!==39&&gde(jf);break;case 40:i===41&&gde(i);break;case 92:Xw();break}return Wb}function aSt(i,a){for(;Xw()&&i+jf!==47+10;)if(i+jf===42+42&&t9()===47)break;return"/*"+SW(a,Wb-1)+"*"+ude(i===47?i:Xw())}function oSt(i){for(;!fde(t9());)Xw();return SW(i,Wb)}function cSt(i){return rSt(AW("",null,null,null,[""],i=nSt(i),0,[0],i))}function AW(i,a,f,p,w,y,b,E,S){for(var N=0,B=0,R=b,j=0,$=0,V=0,Q=1,oe=1,ce=1,se=0,ge="",ye=w,ke=y,Ae=p,de=ge;oe;)switch(V=se,se=Xw()){case 40:if(V!=108&&WN(de,R-1)==58){JCt(de+=lde(dde(se),"&","&\f"),"&\f")!=-1&&(ce=-1);break}case 34:case 39:case 91:de+=dde(se);break;case 9:case 10:case 13:case 32:de+=iSt(V);break;case 92:de+=sSt(CW()-1,7);continue;case 47:switch(t9()){case 42:case 47:TW(uSt(aSt(Xw(),CW()),a,f),S);break;default:de+="/"}break;case 123*Q:E[N++]=ex(de)*ce;case 125*Q:case 59:case 0:switch(se){case 0:case 125:oe=0;case 59+B:$>0&&ex(de)-R&&TW($>32?GIe(de+";",p,f,R-1):GIe(lde(de," ","")+";",p,f,R-2),S);break;case 59:de+=";";default:if(TW(Ae=zIe(de,a,f,N,B,w,E,ge,ye=[],ke=[],R),y),se===123)if(B===0)AW(de,a,Ae,Ae,ye,y,R,E,ke);else switch(j===99&&WN(de,3)===110?100:j){case 100:case 109:case 115:AW(i,Ae,Ae,p&&TW(zIe(i,Ae,Ae,0,0,w,E,ge,w,ye=[],R),ke),w,ke,R,E,p?ye:ke);break;default:AW(de,Ae,Ae,Ae,[""],ke,0,E,ke)}}N=B=$=0,Q=ce=1,ge=de="",R=b;break;case 58:R=1+ex(de),$=V;default:if(Q<1){if(se==123)--Q;else if(se==125&&Q++==0&&tSt()==125)continue}switch(de+=ude(se),se*Q){case 38:ce=B>0?1:(de+="\f",-1);break;case 44:E[N++]=(ex(de)-1)*ce,ce=1;break;case 64:t9()===45&&(de+=dde(Xw())),j=t9(),B=R=ex(ge=de+=oSt(CW())),se++;break;case 45:V===45&&ex(de)==2&&(Q=0)}}return y}function zIe(i,a,f,p,w,y,b,E,S,N,B){for(var R=w-1,j=w===0?y:[""],$=$Ie(j),V=0,Q=0,oe=0;V0?j[ce]+" "+se:lde(se,/&\f/g,j[ce])))&&(S[oe++]=ge);return hde(i,a,f,w===0?RIe:E,S,N,B)}function uSt(i,a,f){return hde(i,a,f,BIe,ude(eSt()),KN(i,2,-2),0)}function GIe(i,a,f,p){return hde(i,a,f,FIe,KN(i,0,p),KN(i,p+1,-1),p)}function pde(i,a){for(var f="",p=$Ie(i),w=0;wi.match(/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/)!==null,loader:async()=>{const{diagram:i}=await Promise.resolve().then(()=>rMt);return{id:VIe,diagram:i}}},UIe="flowchart",fSt={id:UIe,detector:(i,a)=>{var f,p;return((f=a==null?void 0:a.flowchart)==null?void 0:f.defaultRenderer)==="dagre-wrapper"||((p=a==null?void 0:a.flowchart)==null?void 0:p.defaultRenderer)==="elk"?!1:i.match(/^\s*graph/)!==null},loader:async()=>{const{diagram:i}=await Promise.resolve().then(()=>kFt);return{id:UIe,diagram:i}}},WIe="flowchart-v2",dSt={id:WIe,detector:(i,a)=>{var f,p,w;return((f=a==null?void 0:a.flowchart)==null?void 0:f.defaultRenderer)==="dagre-d3"||((p=a==null?void 0:a.flowchart)==null?void 0:p.defaultRenderer)==="elk"?!1:i.match(/^\s*graph/)!==null&&((w=a==null?void 0:a.flowchart)==null?void 0:w.defaultRenderer)==="dagre-wrapper"?!0:i.match(/^\s*flowchart/)!==null},loader:async()=>{const{diagram:i}=await Promise.resolve().then(()=>xFt);return{id:WIe,diagram:i}}},KIe="er",gSt={id:KIe,detector:i=>i.match(/^\s*erDiagram/)!==null,loader:async()=>{const{diagram:i}=await Promise.resolve().then(()=>YFt);return{id:KIe,diagram:i}}},YIe="gitGraph",pSt={id:YIe,detector:i=>i.match(/^\s*gitGraph/)!==null,loader:async()=>{const{diagram:i}=await Promise.resolve().then(()=>xjt);return{id:YIe,diagram:i}}},XIe="gantt",bSt={id:XIe,detector:i=>i.match(/^\s*gantt/)!==null,loader:async()=>{const{diagram:i}=await Promise.resolve().then(()=>x$t);return{id:XIe,diagram:i}}},QIe="info",vSt={id:QIe,detector:i=>i.match(/^\s*info/)!==null,loader:async()=>{const{diagram:i}=await Promise.resolve().then(()=>T$t);return{id:QIe,diagram:i}}},ZIe="pie",wSt={id:ZIe,detector:i=>i.match(/^\s*pie/)!==null,loader:async()=>{const{diagram:i}=await Promise.resolve().then(()=>A$t);return{id:ZIe,diagram:i}}},JIe="requirement",mSt={id:JIe,detector:i=>i.match(/^\s*requirement(Diagram)?/)!==null,loader:async()=>{const{diagram:i}=await Promise.resolve().then(()=>F$t);return{id:JIe,diagram:i}}},eOe="sequence",ySt={id:eOe,detector:i=>i.match(/^\s*sequenceDiagram/)!==null,loader:async()=>{const{diagram:i}=await Promise.resolve().then(()=>$Ht);return{id:eOe,diagram:i}}},tOe="class",kSt={id:tOe,detector:(i,a)=>{var f;return((f=a==null?void 0:a.class)==null?void 0:f.defaultRenderer)==="dagre-wrapper"?!1:i.match(/^\s*classDiagram/)!==null},loader:async()=>{const{diagram:i}=await Promise.resolve().then(()=>czt);return{id:tOe,diagram:i}}},nOe="classDiagram",xSt={id:nOe,detector:(i,a)=>{var f;return i.match(/^\s*classDiagram/)!==null&&((f=a==null?void 0:a.class)==null?void 0:f.defaultRenderer)==="dagre-wrapper"?!0:i.match(/^\s*classDiagram-v2/)!==null},loader:async()=>{const{diagram:i}=await Promise.resolve().then(()=>gzt);return{id:nOe,diagram:i}}},rOe="state",ESt={id:rOe,detector:(i,a)=>{var f;return((f=a==null?void 0:a.state)==null?void 0:f.defaultRenderer)==="dagre-wrapper"?!1:i.match(/^\s*stateDiagram/)!==null},loader:async()=>{const{diagram:i}=await Promise.resolve().then(()=>nGt);return{id:rOe,diagram:i}}},iOe="stateDiagram",TSt={id:iOe,detector:(i,a)=>{var f,p;return!!(i.match(/^\s*stateDiagram-v2/)!==null||i.match(/^\s*stateDiagram/)&&((f=a==null?void 0:a.state)==null?void 0:f.defaultRenderer)==="dagre-wrapper"||i.match(/^\s*stateDiagram/)&&((p=a==null?void 0:a.state)==null?void 0:p.defaultRenderer)==="dagre-wrapper")},loader:async()=>{const{diagram:i}=await Promise.resolve().then(()=>kGt);return{id:iOe,diagram:i}}},sOe="journey",_St={id:sOe,detector:i=>i.match(/^\s*journey/)!==null,loader:async()=>{const{diagram:i}=await Promise.resolve().then(()=>zGt);return{id:sOe,diagram:i}}},CSt=()=>"",aOe={setConf:function(){},draw:(i,a,f)=>{try{Fe.debug(`Renering svg for syntax error -`);const p=Cr("#"+a),w=p.append("g");w.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"),w.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"),w.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"),w.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"),w.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"),w.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"),w.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"),w.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text("mermaid version "+f),p.attr("height",100),p.attr("width",500),p.attr("viewBox","768 0 912 512")}catch(p){Fe.error("Error while rendering info diagram"),Fe.error(KCt(p))}}},SSt={db:{clear:()=>{}},styles:CSt,renderer:aOe,parser:{parser:{yy:{}},parse:()=>{}},init:()=>{}},oOe="flowchart-elk",ASt={id:oOe,detector:(i,a)=>{var f;return!!(i.match(/^\s*flowchart-elk/)||i.match(/^\s*flowchart|graph/)&&((f=a==null?void 0:a.flowchart)==null?void 0:f.defaultRenderer)==="elk")},loader:async()=>{const{diagram:i}=await Promise.resolve().then(()=>iqt);return{id:oOe,diagram:i}}},cOe="timeline",LSt={id:cOe,detector:i=>i.match(/^\s*timeline/)!==null,loader:async()=>{const{diagram:i}=await Promise.resolve().then(()=>Eqt);return{id:cOe,diagram:i}}},uOe="mindmap",MSt={id:uOe,detector:i=>i.match(/^\s*mindmap/)!==null,loader:async()=>{const{diagram:i}=await Promise.resolve().then(()=>tVt);return{id:uOe,diagram:i}}};let lOe=!1;const bde=()=>{lOe||(lOe=!0,vW("error",SSt,i=>i.toLowerCase().trim()==="error"),vW("---",{db:{clear:()=>{}},styles:{},renderer:{},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")}},init:()=>null},i=>i.toLowerCase().trimStart().startsWith("---")),TIe(hSt,xSt,kSt,gSt,bSt,vSt,wSt,mSt,ySt,ASt,dSt,fSt,MSt,LSt,pSt,TSt,ESt,_St))},DSt=i=>i.trimStart().replace(/^\s*%%(?!{)[^\n]+\n?/gm,"");class hOe{constructor(a){var y,b;this.text=a,this.type="graph",this.text+=` -`;const f=Tt();try{this.type=wW(a,f)}catch(E){this.type="error",this.detectError=E}const p=ide(this.type);Fe.debug("Type "+this.type),this.db=p.db,(b=(y=this.db).clear)==null||b.call(y),this.renderer=p.renderer,this.parser=p.parser;const w=this.parser.parse.bind(this.parser);this.parser.parse=E=>w(DSt(l_t(E,this.db))),this.parser.parser.yy=this.db,p.init&&(p.init(f),Fe.info("Initialized diagram "+this.type,f)),this.parse()}parse(){var a,f;if(this.detectError)throw this.detectError;(f=(a=this.db).clear)==null||f.call(a),this.parser.parse(this.text)}async render(a,f){await this.renderer.draw(this.text,a,f,this)}getParser(){return this.parser}getType(){return this.type}}const vde=async i=>{const a=wW(i,Tt());try{ide(a)}catch{const p=L_t(a);if(!p)throw new EIe(`Diagram ${a} not found.`);const{id:w,diagram:y}=await p();vW(w,y)}return new hOe(i)};let wde=[];const ISt=i=>{wde.push(i)},OSt=()=>{wde.forEach(i=>{i()}),wde=[]};var NSt=Object.prototype;function LW(i){var a=i&&i.constructor,f=typeof a=="function"&&a.prototype||NSt;return i===f}function fOe(i,a){return function(f){return i(a(f))}}var PSt=fOe(Object.keys,Object);const BSt=PSt;var RSt=Object.prototype,FSt=RSt.hasOwnProperty;function dOe(i){if(!LW(i))return BSt(i);var a=[];for(var f in Object(i))FSt.call(i,f)&&f!="constructor"&&a.push(f);return a}var jSt=JE(Kw,"DataView");const mde=jSt;var $St=JE(Kw,"Promise");const yde=$St;var HSt=JE(Kw,"Set");const GA=HSt;var zSt=JE(Kw,"WeakMap");const kde=zSt;var gOe="[object Map]",GSt="[object Object]",pOe="[object Promise]",bOe="[object Set]",vOe="[object WeakMap]",wOe="[object DataView]",qSt=ZE(mde),VSt=ZE(UN),USt=ZE(yde),WSt=ZE(GA),KSt=ZE(kde),n9=QE;(mde&&n9(new mde(new ArrayBuffer(1)))!=wOe||UN&&n9(new UN)!=gOe||yde&&n9(yde.resolve())!=pOe||GA&&n9(new GA)!=bOe||kde&&n9(new kde)!=vOe)&&(n9=function(i){var a=QE(i),f=a==GSt?i.constructor:void 0,p=f?ZE(f):"";if(p)switch(p){case qSt:return wOe;case VSt:return gOe;case USt:return pOe;case WSt:return bOe;case KSt:return vOe}return a});const qA=n9;function a3(i){return i!=null&&typeof i=="object"}var YSt="[object Arguments]";function mOe(i){return a3(i)&&QE(i)==YSt}var yOe=Object.prototype,XSt=yOe.hasOwnProperty,QSt=yOe.propertyIsEnumerable,ZSt=mOe(function(){return arguments}())?mOe:function(i){return a3(i)&&XSt.call(i,"callee")&&!QSt.call(i,"callee")};const VA=ZSt;var JSt=Array.isArray;const $f=JSt;var eAt=9007199254740991;function xde(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=eAt}function tx(i){return i!=null&&xde(i.length)&&!BA(i)}function tAt(){return!1}var kOe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,xOe=kOe&&typeof module=="object"&&module&&!module.nodeType&&module,nAt=xOe&&xOe.exports===kOe,EOe=nAt?Kw.Buffer:void 0,rAt=EOe?EOe.isBuffer:void 0,iAt=rAt||tAt;const UA=iAt;var sAt="[object Arguments]",aAt="[object Array]",oAt="[object Boolean]",cAt="[object Date]",uAt="[object Error]",lAt="[object Function]",hAt="[object Map]",fAt="[object Number]",dAt="[object Object]",gAt="[object RegExp]",pAt="[object Set]",bAt="[object String]",vAt="[object WeakMap]",wAt="[object ArrayBuffer]",mAt="[object DataView]",yAt="[object Float32Array]",kAt="[object Float64Array]",xAt="[object Int8Array]",EAt="[object Int16Array]",TAt="[object Int32Array]",_At="[object Uint8Array]",CAt="[object Uint8ClampedArray]",SAt="[object Uint16Array]",AAt="[object Uint32Array]",Tl={};Tl[yAt]=Tl[kAt]=Tl[xAt]=Tl[EAt]=Tl[TAt]=Tl[_At]=Tl[CAt]=Tl[SAt]=Tl[AAt]=!0,Tl[sAt]=Tl[aAt]=Tl[wAt]=Tl[oAt]=Tl[mAt]=Tl[cAt]=Tl[uAt]=Tl[lAt]=Tl[hAt]=Tl[fAt]=Tl[dAt]=Tl[gAt]=Tl[pAt]=Tl[bAt]=Tl[vAt]=!1;function LAt(i){return a3(i)&&xde(i.length)&&!!Tl[QE(i)]}function MW(i){return function(a){return i(a)}}var TOe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,YN=TOe&&typeof module=="object"&&module&&!module.nodeType&&module,MAt=YN&&YN.exports===TOe,Ede=MAt&&CIe.process,DAt=function(){try{var i=YN&&YN.require&&YN.require("util").types;return i||Ede&&Ede.binding&&Ede.binding("util")}catch{}}();const WA=DAt;var _Oe=WA&&WA.isTypedArray,IAt=_Oe?MW(_Oe):LAt;const DW=IAt;var OAt="[object Map]",NAt="[object Set]",PAt=Object.prototype,BAt=PAt.hasOwnProperty;function KA(i){if(i==null)return!0;if(tx(i)&&($f(i)||typeof i=="string"||typeof i.splice=="function"||UA(i)||DW(i)||VA(i)))return!i.length;var a=qA(i);if(a==OAt||a==NAt)return!i.size;if(LW(i))return!dOe(i).length;for(var f in i)if(BAt.call(i,f))return!1;return!0}const RAt="graphics-document document";function FAt(i,a){i.attr("role",RAt),KA(a)||i.attr("aria-roledescription",a)}function jAt(i,a,f,p){if(i.insert!==void 0)if(a||f){if(f){const w="chart-desc-"+p;i.attr("aria-describedby",w),i.insert("desc",":first-child").attr("id",w).text(f)}if(a){const w="chart-title-"+p;i.attr("aria-labelledby",w),i.insert("title",":first-child").attr("id",w).text(a)}}else return}const COe=["graph","flowchart","flowchart-v2","flowchart-elk","stateDiagram","stateDiagram-v2"],$At=5e4,HAt="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",zAt="sandbox",GAt="loose",qAt="http://www.w3.org/2000/svg",VAt="http://www.w3.org/1999/xlink",UAt="http://www.w3.org/1999/xhtml",WAt="100%",KAt="100%",YAt="border:0;margin:0;",XAt="margin:0",QAt="allow-top-navigation-by-user-activation allow-popups",ZAt='The "iframe" tag is not supported by your browser.',JAt=["foreignobject"],eLt=["dominant-baseline"];async function tLt(i,a){bde();try{(await vde(i)).parse()}catch(f){if(a!=null&&a.suppressErrors)return!1;throw f}return!0}const nLt=function(i){let a=i;return a=a.replace(/style.*:\S*#.*;/g,function(f){return f.substring(0,f.length-1)}),a=a.replace(/classDef.*:\S*#.*;/g,function(f){return f.substring(0,f.length-1)}),a=a.replace(/#\w+;/g,function(f){const p=f.substring(1,f.length-1);return/^\+?\d+$/.test(p)?"fl°°"+p+"¶ß":"fl°"+p+"¶ß"}),a},XN=function(i){let a=i;return a=a.replace(/fl°°/g,"&#"),a=a.replace(/fl°/g,"&"),a=a.replace(/¶ß/g,";"),a},SOe=(i,a,f=[])=>` -.${i} ${a} { ${f.join(" !important; ")} !important; }`,rLt=(i,a,f={})=>{var w;let p="";if(i.themeCSS!==void 0&&(p+=` -${i.themeCSS}`),i.fontFamily!==void 0&&(p+=` -:root { --mermaid-font-family: ${i.fontFamily}}`),i.altFontFamily!==void 0&&(p+=` -:root { --mermaid-alt-font-family: ${i.altFontFamily}}`),!KA(f)&&COe.includes(a)){const S=i.htmlLabels||((w=i.flowchart)==null?void 0:w.htmlLabels)?["> *","span"]:["rect","polygon","ellipse","circle","path"];for(const N in f){const B=f[N];KA(B.styles)||S.forEach(R=>{p+=SOe(B.id,R,B.styles)}),KA(B.textStyles)||(p+=SOe(B.id,"tspan",B.textStyles))}}return p},iLt=(i,a,f,p)=>{const w=rLt(i,a,f),y=m_t(a,w,i.themeVariables);return pde(cSt(`${p}{${y}}`),lSt)},sLt=(i="",a,f)=>{let p=i;return!f&&!a&&(p=p.replace(/marker-end="url\(.*?#/g,'marker-end="url(#')),p=XN(p),p=p.replace(/
    /g,"
    "),p},aLt=(i="",a)=>{const f=a?a.viewBox.baseVal.height+"px":KAt,p=btoa(''+i+"");return``},AOe=(i,a,f,p,w)=>{const y=i.append("div");y.attr("id",f),p&&y.attr("style",p);const b=y.append("svg").attr("id",a).attr("width","100%").attr("xmlns",qAt);return w&&b.attr("xmlns:xlink",w),b.append("g"),i};function LOe(i,a){return i.append("iframe").attr("id",a).attr("style","width: 100%; height: 100%;").attr("sandbox","")}const oLt=(i,a,f,p)=>{var w,y,b;(w=i.getElementById(a))==null||w.remove(),(y=i.getElementById(f))==null||y.remove(),(b=i.getElementById(p))==null||b.remove()},cLt=async function(i,a,f){var Ie,ee,rt,me;bde(),dW();const p=co.detectInit(a);p&&(jA(p),vIe(p));const w=Tt();Fe.debug(w),a.length>((w==null?void 0:w.maxTextSize)??$At)&&(a=HAt),a=a.replace(/\r\n?/g,` -`),a=a.replace(/<(\w+)([^>]*)>/g,(gt,pe,Et)=>"<"+pe+Et.replace(/="([^"]*)"/g,"='$1'")+">");const y="#"+i,b="i"+i,E="#"+b,S="d"+i,N="#"+S;let B=Cr("body");const R=w.securityLevel===zAt,j=w.securityLevel===GAt,$=w.fontFamily;if(f!==void 0){if(f&&(f.innerHTML=""),R){const gt=LOe(Cr(f),b);B=Cr(gt.nodes()[0].contentDocument.body),B.node().style.margin=0}else B=Cr(f);AOe(B,i,S,`font-family: ${$}`,VAt)}else{if(oLt(document,i,S,b),R){const gt=LOe(Cr("body"),b);B=Cr(gt.nodes()[0].contentDocument.body),B.node().style.margin=0}else B=Cr("body");AOe(B,i,S)}a=nLt(a);let V,Q;try{V=await vde(a)}catch(gt){V=new hOe("error"),Q=gt}const oe=B.select(N).node(),ce=V.type,se=oe.firstChild,ge=se.firstChild,ye=COe.includes(ce)?V.renderer.getClasses(a,V):{},ke=iLt(w,ce,ye,y),Ae=document.createElement("style");Ae.innerHTML=ke,se.insertBefore(Ae,ge);try{await V.renderer.draw(a,i,qIe,V)}catch(gt){throw aOe.draw(a,i,qIe),gt}const de=B.select(`${N} svg`),ve=(ee=(Ie=V.db).getAccTitle)==null?void 0:ee.call(Ie),te=(me=(rt=V.db).getAccDescription)==null?void 0:me.call(rt);lLt(ce,de,ve,te),B.select(`[id="${i}"]`).selectAll("foreignobject > *").attr("xmlns",UAt);let xe=B.select(N).node().innerHTML;if(Fe.debug("config.arrowMarkerAbsolute",w.arrowMarkerAbsolute),xe=sLt(xe,R,d1(w.arrowMarkerAbsolute)),R){const gt=B.select(N+" svg").node();xe=aLt(xe,gt)}else j||(xe=ZU.sanitize(xe,{ADD_TAGS:JAt,ADD_ATTR:eLt}));if(OSt(),Q)throw Q;const he=Cr(R?E:N).node();return he&&"remove"in he&&he.remove(),{svg:xe,bindFunctions:V.db.bindFunctions}};function uLt(i={}){var f;i!=null&&i.fontFamily&&!((f=i.themeVariables)!=null&&f.fontFamily)&&(i.themeVariables||(i.themeVariables={}),i.themeVariables.fontFamily=i.fontFamily),f_t(i),i!=null&&i.theme&&i.theme in g5?i.themeVariables=g5[i.theme].getThemeVariables(i.themeVariables):i&&(i.themeVariables=g5.default.getThemeVariables(i.themeVariables));const a=typeof i=="object"?h_t(i):gIe();$fe(a.logLevel),bde()}function lLt(i,a,f,p){FAt(a,i),jAt(a,f,p,a.attr("id"))}const rd=Object.freeze({render:cLt,parse:tLt,parseDirective:rde,getDiagramFromText:vde,initialize:uLt,getConfig:Tt,setConfig:pIe,getSiteConfig:gIe,updateSiteConfig:d_t,reset:()=>{dW()},globalReset:()=>{dW(OA)},defaultConfig:OA});$fe(Tt().logLevel),dW(Tt());const hLt=(i,a,f)=>{Fe.warn(i),PIe(i)?(f&&f(i.str,i.hash),a.push({...i,message:i.str,error:i})):(f&&f(i),i instanceof Error&&a.push({str:i.message,message:i.message,hash:i.name,error:i}))},MOe=async function(i={querySelector:".mermaid"}){try{await fLt(i)}catch(a){if(PIe(a)&&Fe.error(a.str),O2.parseError&&O2.parseError(a),!i.suppressErrors)throw Fe.error("Use the suppressErrors option to suppress these errors"),a}},fLt=async function({postRenderCallback:i,querySelector:a,nodes:f}={querySelector:".mermaid"}){const p=rd.getConfig();Fe.debug(`${i?"":"No "}Callback function found`);let w;if(f)w=f;else if(a)w=document.querySelectorAll(a);else throw new Error("Nodes and querySelector are both undefined");Fe.debug(`Found ${w.length} diagrams`),(p==null?void 0:p.startOnLoad)!==void 0&&(Fe.debug("Start On Load: "+(p==null?void 0:p.startOnLoad)),rd.updateSiteConfig({startOnLoad:p==null?void 0:p.startOnLoad}));const y=new co.initIdGenerator(p.deterministicIds,p.deterministicIDSeed);let b;const E=[];for(const S of Array.from(w)){Fe.info("Rendering diagram: "+S.id);/*! Check if previously processed */if(S.getAttribute("data-processed"))continue;S.setAttribute("data-processed","true");const N=`mermaid-${y.next()}`;b=S.innerHTML,b=mN(co.entityDecode(b)).trim().replace(//gi,"
    ");const B=co.detectInit(b);B&&Fe.debug("Detected early reinit: ",B);try{const{svg:R,bindFunctions:j}=await NOe(N,b,S);S.innerHTML=R,i&&await i(N),j&&j(S)}catch(R){hLt(R,E,O2.parseError)}}if(E.length>0)throw E[0]},DOe=function(i){rd.initialize(i)},dLt=async function(i,a,f){Fe.warn("mermaid.init is deprecated. Please use run instead."),i&&DOe(i);const p={postRenderCallback:f,querySelector:".mermaid"};typeof a=="string"?p.querySelector=a:a&&(a instanceof HTMLElement?p.nodes=[a]:p.nodes=a),await MOe(p)},gLt=async(i,{lazyLoad:a=!0}={})=>{TIe(...i),a===!1&&await A_t()},IOe=function(){if(O2.startOnLoad){const{startOnLoad:i}=rd.getConfig();i&&O2.run().catch(a=>Fe.error("Mermaid failed to initialize",a))}};if(typeof document<"u"){/*! - * Wait for document loaded before starting the execution - */window.addEventListener("load",IOe,!1)}const pLt=function(i){O2.parseError=i},IW=[];let Tde=!1;const OOe=async()=>{if(!Tde){for(Tde=!0;IW.length>0;){const i=IW.shift();if(i)try{await i()}catch(a){Fe.error("Error executing queue",a)}}Tde=!1}},bLt=async(i,a)=>new Promise((f,p)=>{const w=()=>new Promise((y,b)=>{rd.parse(i,a).then(E=>{y(E),f(E)},E=>{var S;Fe.error("Error parsing",E),(S=O2.parseError)==null||S.call(O2,E),b(E),p(E)})});IW.push(w),OOe().catch(p)}),NOe=(i,a,f)=>new Promise((p,w)=>{const y=()=>new Promise((b,E)=>{rd.render(i,a,f).then(S=>{b(S),p(S)},S=>{var N;Fe.error("Error parsing",S),(N=O2.parseError)==null||N.call(O2,S),E(S),w(S)})});IW.push(y),OOe().catch(w)}),O2={startOnLoad:!0,mermaidAPI:rd,parse:bLt,render:NOe,init:dLt,run:MOe,registerExternalDiagrams:gLt,initialize:DOe,parseError:void 0,contentLoaded:IOe,setParseErrorHandler:pLt,detectType:wW};var OW=function(){var i=function(Oi,Er,br,Dr){for(br=br||{},Dr=Oi.length;Dr--;br[Oi[Dr]]=Er);return br},a=[1,6],f=[1,7],p=[1,8],w=[1,9],y=[1,16],b=[1,11],E=[1,12],S=[1,13],N=[1,14],B=[1,15],R=[1,27],j=[1,33],$=[1,34],V=[1,35],Q=[1,36],oe=[1,37],ce=[1,72],se=[1,73],ge=[1,74],ye=[1,75],ke=[1,76],Ae=[1,77],de=[1,78],ve=[1,38],te=[1,39],xe=[1,40],De=[1,41],he=[1,42],Ie=[1,43],ee=[1,44],rt=[1,45],me=[1,46],gt=[1,47],pe=[1,48],Et=[1,49],wt=[1,50],jt=[1,51],At=[1,52],Bt=[1,53],cn=[1,54],Nn=[1,55],Ot=[1,56],oi=[1,57],kt=[1,59],Dt=[1,60],vt=[1,61],Nt=[1,62],ze=[1,63],Xe=[1,64],Lt=[1,65],Ge=[1,66],Bn=[1,67],Oe=[1,68],Ri=[1,69],tn=[24,52],hi=[24,44,46,47,48,49,50,51,52,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],Sr=[15,24,44,46,47,48,49,50,51,52,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],Zn=[1,94],Xn=[1,95],ir=[1,96],Hn=[1,97],tr=[15,24,52],ha=[7,8,9,10,18,22,25,26,27,28],Zs=[15,24,43,52],ns=[15,24,43,52,86,87,89,90],Hi=[15,43],Js=[44,46,47,48,49,50,51,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],Pc={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,directive:6,direction_tb:7,direction_bt:8,direction_rl:9,direction_lr:10,graphConfig:11,openDirective:12,typeDirective:13,closeDirective:14,NEWLINE:15,":":16,argDirective:17,open_directive:18,type_directive:19,arg_directive:20,close_directive:21,C4_CONTEXT:22,statements:23,EOF:24,C4_CONTAINER:25,C4_COMPONENT:26,C4_DYNAMIC:27,C4_DEPLOYMENT:28,otherStatements:29,diagramStatements:30,otherStatement:31,title:32,accDescription:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,boundaryStatement:39,boundaryStartStatement:40,boundaryStopStatement:41,boundaryStart:42,LBRACE:43,ENTERPRISE_BOUNDARY:44,attributes:45,SYSTEM_BOUNDARY:46,BOUNDARY:47,CONTAINER_BOUNDARY:48,NODE:49,NODE_L:50,NODE_R:51,RBRACE:52,diagramStatement:53,PERSON:54,PERSON_EXT:55,SYSTEM:56,SYSTEM_DB:57,SYSTEM_QUEUE:58,SYSTEM_EXT:59,SYSTEM_EXT_DB:60,SYSTEM_EXT_QUEUE:61,CONTAINER:62,CONTAINER_DB:63,CONTAINER_QUEUE:64,CONTAINER_EXT:65,CONTAINER_EXT_DB:66,CONTAINER_EXT_QUEUE:67,COMPONENT:68,COMPONENT_DB:69,COMPONENT_QUEUE:70,COMPONENT_EXT:71,COMPONENT_EXT_DB:72,COMPONENT_EXT_QUEUE:73,REL:74,BIREL:75,REL_U:76,REL_D:77,REL_L:78,REL_R:79,REL_B:80,REL_INDEX:81,UPDATE_EL_STYLE:82,UPDATE_REL_STYLE:83,UPDATE_LAYOUT_CONFIG:84,attribute:85,STR:86,STR_KEY:87,STR_VALUE:88,ATTRIBUTE:89,ATTRIBUTE_EMPTY:90,$accept:0,$end:1},terminals_:{2:"error",7:"direction_tb",8:"direction_bt",9:"direction_rl",10:"direction_lr",15:"NEWLINE",16:":",18:"open_directive",19:"type_directive",20:"arg_directive",21:"close_directive",22:"C4_CONTEXT",24:"EOF",25:"C4_CONTAINER",26:"C4_COMPONENT",27:"C4_DYNAMIC",28:"C4_DEPLOYMENT",32:"title",33:"accDescription",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",43:"LBRACE",44:"ENTERPRISE_BOUNDARY",46:"SYSTEM_BOUNDARY",47:"BOUNDARY",48:"CONTAINER_BOUNDARY",49:"NODE",50:"NODE_L",51:"NODE_R",52:"RBRACE",54:"PERSON",55:"PERSON_EXT",56:"SYSTEM",57:"SYSTEM_DB",58:"SYSTEM_QUEUE",59:"SYSTEM_EXT",60:"SYSTEM_EXT_DB",61:"SYSTEM_EXT_QUEUE",62:"CONTAINER",63:"CONTAINER_DB",64:"CONTAINER_QUEUE",65:"CONTAINER_EXT",66:"CONTAINER_EXT_DB",67:"CONTAINER_EXT_QUEUE",68:"COMPONENT",69:"COMPONENT_DB",70:"COMPONENT_QUEUE",71:"COMPONENT_EXT",72:"COMPONENT_EXT_DB",73:"COMPONENT_EXT_QUEUE",74:"REL",75:"BIREL",76:"REL_U",77:"REL_D",78:"REL_L",79:"REL_R",80:"REL_B",81:"REL_INDEX",82:"UPDATE_EL_STYLE",83:"UPDATE_REL_STYLE",84:"UPDATE_LAYOUT_CONFIG",86:"STR",87:"STR_KEY",88:"STR_VALUE",89:"ATTRIBUTE",90:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[3,2],[5,1],[5,1],[5,1],[5,1],[4,1],[6,4],[6,6],[12,1],[13,1],[17,1],[14,1],[11,4],[11,4],[11,4],[11,4],[11,4],[23,1],[23,1],[23,2],[29,1],[29,2],[29,3],[31,1],[31,1],[31,2],[31,2],[31,1],[39,3],[40,3],[40,3],[40,4],[42,2],[42,2],[42,2],[42,2],[42,2],[42,2],[42,2],[41,1],[30,1],[30,2],[30,3],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,1],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[45,1],[45,2],[85,1],[85,2],[85,1],[85,1]],performAction:function(Er,br,Dr,Vn,qi,yn,Bc){var jn=yn.length-1;switch(qi){case 4:Vn.setDirection("TB");break;case 5:Vn.setDirection("BT");break;case 6:Vn.setDirection("RL");break;case 7:Vn.setDirection("LR");break;case 11:Vn.parseDirective("%%{","open_directive");break;case 12:break;case 13:yn[jn]=yn[jn].trim().replace(/'/g,'"'),Vn.parseDirective(yn[jn],"arg_directive");break;case 14:Vn.parseDirective("}%%","close_directive","c4Context");break;case 15:case 16:case 17:case 18:case 19:Vn.setC4Type(yn[jn-3]);break;case 26:Vn.setTitle(yn[jn].substring(6)),this.$=yn[jn].substring(6);break;case 27:Vn.setAccDescription(yn[jn].substring(15)),this.$=yn[jn].substring(15);break;case 28:this.$=yn[jn].trim(),Vn.setTitle(this.$);break;case 29:case 30:this.$=yn[jn].trim(),Vn.setAccDescription(this.$);break;case 35:case 36:yn[jn].splice(2,0,"ENTERPRISE"),Vn.addPersonOrSystemBoundary(...yn[jn]),this.$=yn[jn];break;case 37:Vn.addPersonOrSystemBoundary(...yn[jn]),this.$=yn[jn];break;case 38:yn[jn].splice(2,0,"CONTAINER"),Vn.addContainerBoundary(...yn[jn]),this.$=yn[jn];break;case 39:Vn.addDeploymentNode("node",...yn[jn]),this.$=yn[jn];break;case 40:Vn.addDeploymentNode("nodeL",...yn[jn]),this.$=yn[jn];break;case 41:Vn.addDeploymentNode("nodeR",...yn[jn]),this.$=yn[jn];break;case 42:Vn.popBoundaryParseStack();break;case 46:Vn.addPersonOrSystem("person",...yn[jn]),this.$=yn[jn];break;case 47:Vn.addPersonOrSystem("external_person",...yn[jn]),this.$=yn[jn];break;case 48:Vn.addPersonOrSystem("system",...yn[jn]),this.$=yn[jn];break;case 49:Vn.addPersonOrSystem("system_db",...yn[jn]),this.$=yn[jn];break;case 50:Vn.addPersonOrSystem("system_queue",...yn[jn]),this.$=yn[jn];break;case 51:Vn.addPersonOrSystem("external_system",...yn[jn]),this.$=yn[jn];break;case 52:Vn.addPersonOrSystem("external_system_db",...yn[jn]),this.$=yn[jn];break;case 53:Vn.addPersonOrSystem("external_system_queue",...yn[jn]),this.$=yn[jn];break;case 54:Vn.addContainer("container",...yn[jn]),this.$=yn[jn];break;case 55:Vn.addContainer("container_db",...yn[jn]),this.$=yn[jn];break;case 56:Vn.addContainer("container_queue",...yn[jn]),this.$=yn[jn];break;case 57:Vn.addContainer("external_container",...yn[jn]),this.$=yn[jn];break;case 58:Vn.addContainer("external_container_db",...yn[jn]),this.$=yn[jn];break;case 59:Vn.addContainer("external_container_queue",...yn[jn]),this.$=yn[jn];break;case 60:Vn.addComponent("component",...yn[jn]),this.$=yn[jn];break;case 61:Vn.addComponent("component_db",...yn[jn]),this.$=yn[jn];break;case 62:Vn.addComponent("component_queue",...yn[jn]),this.$=yn[jn];break;case 63:Vn.addComponent("external_component",...yn[jn]),this.$=yn[jn];break;case 64:Vn.addComponent("external_component_db",...yn[jn]),this.$=yn[jn];break;case 65:Vn.addComponent("external_component_queue",...yn[jn]),this.$=yn[jn];break;case 67:Vn.addRel("rel",...yn[jn]),this.$=yn[jn];break;case 68:Vn.addRel("birel",...yn[jn]),this.$=yn[jn];break;case 69:Vn.addRel("rel_u",...yn[jn]),this.$=yn[jn];break;case 70:Vn.addRel("rel_d",...yn[jn]),this.$=yn[jn];break;case 71:Vn.addRel("rel_l",...yn[jn]),this.$=yn[jn];break;case 72:Vn.addRel("rel_r",...yn[jn]),this.$=yn[jn];break;case 73:Vn.addRel("rel_b",...yn[jn]),this.$=yn[jn];break;case 74:yn[jn].splice(0,1),Vn.addRel("rel",...yn[jn]),this.$=yn[jn];break;case 75:Vn.updateElStyle("update_el_style",...yn[jn]),this.$=yn[jn];break;case 76:Vn.updateRelStyle("update_rel_style",...yn[jn]),this.$=yn[jn];break;case 77:Vn.updateLayoutConfig("update_layout_config",...yn[jn]),this.$=yn[jn];break;case 78:this.$=[yn[jn]];break;case 79:yn[jn].unshift(yn[jn-1]),this.$=yn[jn];break;case 80:case 82:this.$=yn[jn].trim();break;case 81:let Ms={};Ms[yn[jn-1].trim()]=yn[jn].trim(),this.$=Ms;break;case 83:this.$="";break}},table:[{3:1,4:2,5:3,6:4,7:a,8:f,9:p,10:w,11:5,12:10,18:y,22:b,25:E,26:S,27:N,28:B},{1:[3]},{1:[2,1]},{1:[2,2]},{3:17,4:2,5:3,6:4,7:a,8:f,9:p,10:w,11:5,12:10,18:y,22:b,25:E,26:S,27:N,28:B},{1:[2,8]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{1:[2,7]},{13:18,19:[1,19]},{15:[1,20]},{15:[1,21]},{15:[1,22]},{15:[1,23]},{15:[1,24]},{19:[2,11]},{1:[2,3]},{14:25,16:[1,26],21:R},i([16,21],[2,12]),{23:28,29:29,30:30,31:31,32:j,33:$,34:V,36:Q,38:oe,39:58,40:70,42:71,44:ce,46:se,47:ge,48:ye,49:ke,50:Ae,51:de,53:32,54:ve,55:te,56:xe,57:De,58:he,59:Ie,60:ee,61:rt,62:me,63:gt,64:pe,65:Et,66:wt,67:jt,68:At,69:Bt,70:cn,71:Nn,72:Ot,73:oi,74:kt,75:Dt,76:vt,77:Nt,78:ze,79:Xe,80:Lt,81:Ge,82:Bn,83:Oe,84:Ri},{23:79,29:29,30:30,31:31,32:j,33:$,34:V,36:Q,38:oe,39:58,40:70,42:71,44:ce,46:se,47:ge,48:ye,49:ke,50:Ae,51:de,53:32,54:ve,55:te,56:xe,57:De,58:he,59:Ie,60:ee,61:rt,62:me,63:gt,64:pe,65:Et,66:wt,67:jt,68:At,69:Bt,70:cn,71:Nn,72:Ot,73:oi,74:kt,75:Dt,76:vt,77:Nt,78:ze,79:Xe,80:Lt,81:Ge,82:Bn,83:Oe,84:Ri},{23:80,29:29,30:30,31:31,32:j,33:$,34:V,36:Q,38:oe,39:58,40:70,42:71,44:ce,46:se,47:ge,48:ye,49:ke,50:Ae,51:de,53:32,54:ve,55:te,56:xe,57:De,58:he,59:Ie,60:ee,61:rt,62:me,63:gt,64:pe,65:Et,66:wt,67:jt,68:At,69:Bt,70:cn,71:Nn,72:Ot,73:oi,74:kt,75:Dt,76:vt,77:Nt,78:ze,79:Xe,80:Lt,81:Ge,82:Bn,83:Oe,84:Ri},{23:81,29:29,30:30,31:31,32:j,33:$,34:V,36:Q,38:oe,39:58,40:70,42:71,44:ce,46:se,47:ge,48:ye,49:ke,50:Ae,51:de,53:32,54:ve,55:te,56:xe,57:De,58:he,59:Ie,60:ee,61:rt,62:me,63:gt,64:pe,65:Et,66:wt,67:jt,68:At,69:Bt,70:cn,71:Nn,72:Ot,73:oi,74:kt,75:Dt,76:vt,77:Nt,78:ze,79:Xe,80:Lt,81:Ge,82:Bn,83:Oe,84:Ri},{23:82,29:29,30:30,31:31,32:j,33:$,34:V,36:Q,38:oe,39:58,40:70,42:71,44:ce,46:se,47:ge,48:ye,49:ke,50:Ae,51:de,53:32,54:ve,55:te,56:xe,57:De,58:he,59:Ie,60:ee,61:rt,62:me,63:gt,64:pe,65:Et,66:wt,67:jt,68:At,69:Bt,70:cn,71:Nn,72:Ot,73:oi,74:kt,75:Dt,76:vt,77:Nt,78:ze,79:Xe,80:Lt,81:Ge,82:Bn,83:Oe,84:Ri},{15:[1,83]},{17:84,20:[1,85]},{15:[2,14]},{24:[1,86]},i(tn,[2,20],{53:32,39:58,40:70,42:71,30:87,44:ce,46:se,47:ge,48:ye,49:ke,50:Ae,51:de,54:ve,55:te,56:xe,57:De,58:he,59:Ie,60:ee,61:rt,62:me,63:gt,64:pe,65:Et,66:wt,67:jt,68:At,69:Bt,70:cn,71:Nn,72:Ot,73:oi,74:kt,75:Dt,76:vt,77:Nt,78:ze,79:Xe,80:Lt,81:Ge,82:Bn,83:Oe,84:Ri}),i(tn,[2,21]),i(hi,[2,23],{15:[1,88]}),i(tn,[2,43],{15:[1,89]}),i(Sr,[2,26]),i(Sr,[2,27]),{35:[1,90]},{37:[1,91]},i(Sr,[2,30]),{45:92,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:98,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:99,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:100,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:101,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:102,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:103,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:104,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:105,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:106,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:107,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:108,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:109,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:110,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:111,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:112,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:113,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:114,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:115,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:116,85:93,86:Zn,87:Xn,89:ir,90:Hn},i(tr,[2,66]),{45:117,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:118,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:119,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:120,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:121,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:122,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:123,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:124,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:125,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:126,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:127,85:93,86:Zn,87:Xn,89:ir,90:Hn},{30:128,39:58,40:70,42:71,44:ce,46:se,47:ge,48:ye,49:ke,50:Ae,51:de,53:32,54:ve,55:te,56:xe,57:De,58:he,59:Ie,60:ee,61:rt,62:me,63:gt,64:pe,65:Et,66:wt,67:jt,68:At,69:Bt,70:cn,71:Nn,72:Ot,73:oi,74:kt,75:Dt,76:vt,77:Nt,78:ze,79:Xe,80:Lt,81:Ge,82:Bn,83:Oe,84:Ri},{15:[1,130],43:[1,129]},{45:131,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:132,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:133,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:134,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:135,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:136,85:93,86:Zn,87:Xn,89:ir,90:Hn},{45:137,85:93,86:Zn,87:Xn,89:ir,90:Hn},{24:[1,138]},{24:[1,139]},{24:[1,140]},{24:[1,141]},i(ha,[2,9]),{14:142,21:R},{21:[2,13]},{1:[2,15]},i(tn,[2,22]),i(hi,[2,24],{31:31,29:143,32:j,33:$,34:V,36:Q,38:oe}),i(tn,[2,44],{29:29,30:30,31:31,53:32,39:58,40:70,42:71,23:144,32:j,33:$,34:V,36:Q,38:oe,44:ce,46:se,47:ge,48:ye,49:ke,50:Ae,51:de,54:ve,55:te,56:xe,57:De,58:he,59:Ie,60:ee,61:rt,62:me,63:gt,64:pe,65:Et,66:wt,67:jt,68:At,69:Bt,70:cn,71:Nn,72:Ot,73:oi,74:kt,75:Dt,76:vt,77:Nt,78:ze,79:Xe,80:Lt,81:Ge,82:Bn,83:Oe,84:Ri}),i(Sr,[2,28]),i(Sr,[2,29]),i(tr,[2,46]),i(Zs,[2,78],{85:93,45:145,86:Zn,87:Xn,89:ir,90:Hn}),i(ns,[2,80]),{88:[1,146]},i(ns,[2,82]),i(ns,[2,83]),i(tr,[2,47]),i(tr,[2,48]),i(tr,[2,49]),i(tr,[2,50]),i(tr,[2,51]),i(tr,[2,52]),i(tr,[2,53]),i(tr,[2,54]),i(tr,[2,55]),i(tr,[2,56]),i(tr,[2,57]),i(tr,[2,58]),i(tr,[2,59]),i(tr,[2,60]),i(tr,[2,61]),i(tr,[2,62]),i(tr,[2,63]),i(tr,[2,64]),i(tr,[2,65]),i(tr,[2,67]),i(tr,[2,68]),i(tr,[2,69]),i(tr,[2,70]),i(tr,[2,71]),i(tr,[2,72]),i(tr,[2,73]),i(tr,[2,74]),i(tr,[2,75]),i(tr,[2,76]),i(tr,[2,77]),{41:147,52:[1,148]},{15:[1,149]},{43:[1,150]},i(Hi,[2,35]),i(Hi,[2,36]),i(Hi,[2,37]),i(Hi,[2,38]),i(Hi,[2,39]),i(Hi,[2,40]),i(Hi,[2,41]),{1:[2,16]},{1:[2,17]},{1:[2,18]},{1:[2,19]},{15:[1,151]},i(hi,[2,25]),i(tn,[2,45]),i(Zs,[2,79]),i(ns,[2,81]),i(tr,[2,31]),i(tr,[2,42]),i(Js,[2,32]),i(Js,[2,33],{15:[1,152]}),i(ha,[2,10]),i(Js,[2,34])],defaultActions:{2:[2,1],3:[2,2],5:[2,8],6:[2,4],7:[2,5],8:[2,6],9:[2,7],16:[2,11],17:[2,3],27:[2,14],85:[2,13],86:[2,15],138:[2,16],139:[2,17],140:[2,18],141:[2,19]},parseError:function(Er,br){if(br.recoverable)this.trace(Er);else{var Dr=new Error(Er);throw Dr.hash=br,Dr}},parse:function(Er){var br=this,Dr=[0],Vn=[],qi=[null],yn=[],Bc=this.table,jn="",Ms=0,Pa=0,Ta=2,_a=1,ka=yn.slice.call(arguments,1),Qi=Object.create(this.lexer),ea={yy:{}};for(var Ca in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ca)&&(ea.yy[Ca]=this.yy[Ca]);Qi.setInput(Er,ea.yy),ea.yy.lexer=Qi,ea.yy.parser=this,typeof Qi.yylloc>"u"&&(Qi.yylloc={});var Sa=Qi.yylloc;yn.push(Sa);var Ka=Qi.options&&Qi.options.ranges;typeof ea.yy.parseError=="function"?this.parseError=ea.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function cg(){var Ns;return Ns=Vn.pop()||Qi.lex()||_a,typeof Ns!="number"&&(Ns instanceof Array&&(Vn=Ns,Ns=Vn.pop()),Ns=br.symbols_[Ns]||Ns),Ns}for(var Gc,Dh,Es,lp,sd={},sh,Ai,nn,Tr;;){if(Dh=Dr[Dr.length-1],this.defaultActions[Dh]?Es=this.defaultActions[Dh]:((Gc===null||typeof Gc>"u")&&(Gc=cg()),Es=Bc[Dh]&&Bc[Dh][Gc]),typeof Es>"u"||!Es.length||!Es[0]){var ai="";Tr=[];for(sh in Bc[Dh])this.terminals_[sh]&&sh>Ta&&Tr.push("'"+this.terminals_[sh]+"'");Qi.showPosition?ai="Parse error on line "+(Ms+1)+`: -`+Qi.showPosition()+` -Expecting `+Tr.join(", ")+", got '"+(this.terminals_[Gc]||Gc)+"'":ai="Parse error on line "+(Ms+1)+": Unexpected "+(Gc==_a?"end of input":"'"+(this.terminals_[Gc]||Gc)+"'"),this.parseError(ai,{text:Qi.match,token:this.terminals_[Gc]||Gc,line:Qi.yylineno,loc:Sa,expected:Tr})}if(Es[0]instanceof Array&&Es.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Dh+", token: "+Gc);switch(Es[0]){case 1:Dr.push(Gc),qi.push(Qi.yytext),yn.push(Qi.yylloc),Dr.push(Es[1]),Gc=null,Pa=Qi.yyleng,jn=Qi.yytext,Ms=Qi.yylineno,Sa=Qi.yylloc;break;case 2:if(Ai=this.productions_[Es[1]][1],sd.$=qi[qi.length-Ai],sd._$={first_line:yn[yn.length-(Ai||1)].first_line,last_line:yn[yn.length-1].last_line,first_column:yn[yn.length-(Ai||1)].first_column,last_column:yn[yn.length-1].last_column},Ka&&(sd._$.range=[yn[yn.length-(Ai||1)].range[0],yn[yn.length-1].range[1]]),lp=this.performAction.apply(sd,[jn,Pa,Ms,ea.yy,Es[1],qi,yn].concat(ka)),typeof lp<"u")return lp;Ai&&(Dr=Dr.slice(0,-1*Ai*2),qi=qi.slice(0,-1*Ai),yn=yn.slice(0,-1*Ai)),Dr.push(this.productions_[Es[1]][0]),qi.push(sd.$),yn.push(sd._$),nn=Bc[Dr[Dr.length-2]][Dr[Dr.length-1]],Dr.push(nn);break;case 3:return!0}}return!0}},Ga=function(){var Oi={EOF:1,parseError:function(br,Dr){if(this.yy.parser)this.yy.parser.parseError(br,Dr);else throw new Error(br)},setInput:function(Er,br){return this.yy=br||this.yy||{},this._input=Er,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var Er=this._input[0];this.yytext+=Er,this.yyleng++,this.offset++,this.match+=Er,this.matched+=Er;var br=Er.match(/(?:\r\n?|\n).*/g);return br?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Er},unput:function(Er){var br=Er.length,Dr=Er.split(/(?:\r\n?|\n)/g);this._input=Er+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-br),this.offset-=br;var Vn=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),Dr.length-1&&(this.yylineno-=Dr.length-1);var qi=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Dr?(Dr.length===Vn.length?this.yylloc.first_column:0)+Vn[Vn.length-Dr.length].length-Dr[0].length:this.yylloc.first_column-br},this.options.ranges&&(this.yylloc.range=[qi[0],qi[0]+this.yyleng-br]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(Er){this.unput(this.match.slice(Er))},pastInput:function(){var Er=this.matched.substr(0,this.matched.length-this.match.length);return(Er.length>20?"...":"")+Er.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var Er=this.match;return Er.length<20&&(Er+=this._input.substr(0,20-Er.length)),(Er.substr(0,20)+(Er.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var Er=this.pastInput(),br=new Array(Er.length+1).join("-");return Er+this.upcomingInput()+` -`+br+"^"},test_match:function(Er,br){var Dr,Vn,qi;if(this.options.backtrack_lexer&&(qi={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},this.options.ranges&&(qi.yylloc.range=this.yylloc.range.slice(0))),Vn=Er[0].match(/(?:\r\n?|\n).*/g),Vn&&(this.yylineno+=Vn.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Vn?Vn[Vn.length-1].length-Vn[Vn.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Er[0].length},this.yytext+=Er[0],this.match+=Er[0],this.matches=Er,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Er[0].length),this.matched+=Er[0],Dr=this.performAction.call(this,this.yy,this,br,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Dr)return Dr;if(this._backtrack){for(var yn in qi)this[yn]=qi[yn];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Er,br,Dr,Vn;this._more||(this.yytext="",this.match="");for(var qi=this._currentRules(),yn=0;ynbr[0].length)){if(br=Dr,Vn=yn,this.options.backtrack_lexer){if(Er=this.test_match(Dr,qi[yn]),Er!==!1)return Er;if(this._backtrack){br=!1;continue}else return!1}else if(!this.options.flex)break}return br?(Er=this.test_match(br,qi[Vn]),Er!==!1?Er:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var br=this.next();return br||this.lex()},begin:function(br){this.conditionStack.push(br)},popState:function(){var br=this.conditionStack.length-1;return br>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(br){return br=this.conditionStack.length-1-Math.abs(br||0),br>=0?this.conditionStack[br]:"INITIAL"},pushState:function(br){this.begin(br)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(br,Dr,Vn,qi){switch(Vn){case 0:return this.begin("open_directive"),18;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 10;case 5:return this.begin("type_directive"),19;case 6:return this.popState(),this.begin("arg_directive"),16;case 7:return this.popState(),this.popState(),21;case 8:return 20;case 9:return 32;case 10:return 33;case 11:return this.begin("acc_title"),34;case 12:return this.popState(),"acc_title_value";case 13:return this.begin("acc_descr"),36;case 14:return this.popState(),"acc_descr_value";case 15:this.begin("acc_descr_multiline");break;case 16:this.popState();break;case 17:return"acc_descr_multiline_value";case 18:break;case 19:c;break;case 20:return 15;case 21:break;case 22:return 22;case 23:return 25;case 24:return 26;case 25:return 27;case 26:return 28;case 27:return this.begin("person_ext"),55;case 28:return this.begin("person"),54;case 29:return this.begin("system_ext_queue"),61;case 30:return this.begin("system_ext_db"),60;case 31:return this.begin("system_ext"),59;case 32:return this.begin("system_queue"),58;case 33:return this.begin("system_db"),57;case 34:return this.begin("system"),56;case 35:return this.begin("boundary"),47;case 36:return this.begin("enterprise_boundary"),44;case 37:return this.begin("system_boundary"),46;case 38:return this.begin("container_ext_queue"),67;case 39:return this.begin("container_ext_db"),66;case 40:return this.begin("container_ext"),65;case 41:return this.begin("container_queue"),64;case 42:return this.begin("container_db"),63;case 43:return this.begin("container"),62;case 44:return this.begin("container_boundary"),48;case 45:return this.begin("component_ext_queue"),73;case 46:return this.begin("component_ext_db"),72;case 47:return this.begin("component_ext"),71;case 48:return this.begin("component_queue"),70;case 49:return this.begin("component_db"),69;case 50:return this.begin("component"),68;case 51:return this.begin("node"),49;case 52:return this.begin("node"),49;case 53:return this.begin("node_l"),50;case 54:return this.begin("node_r"),51;case 55:return this.begin("rel"),74;case 56:return this.begin("birel"),75;case 57:return this.begin("rel_u"),76;case 58:return this.begin("rel_u"),76;case 59:return this.begin("rel_d"),77;case 60:return this.begin("rel_d"),77;case 61:return this.begin("rel_l"),78;case 62:return this.begin("rel_l"),78;case 63:return this.begin("rel_r"),79;case 64:return this.begin("rel_r"),79;case 65:return this.begin("rel_b"),80;case 66:return this.begin("rel_index"),81;case 67:return this.begin("update_el_style"),82;case 68:return this.begin("update_rel_style"),83;case 69:return this.begin("update_layout_config"),84;case 70:return"EOF_IN_STRUCT";case 71:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 72:this.begin("attribute");break;case 73:this.popState(),this.popState();break;case 74:return 90;case 75:break;case 76:return 90;case 77:this.begin("string");break;case 78:this.popState();break;case 79:return"STR";case 80:this.begin("string_kv");break;case 81:return this.begin("string_kv_key"),"STR_KEY";case 82:this.popState(),this.begin("string_kv_value");break;case 83:return"STR_VALUE";case 84:this.popState(),this.popState();break;case 85:return"STR";case 86:return"LBRACE";case 87:return"RBRACE";case 88:return"SPACE";case 89:return"EOL";case 90:return 24}},rules:[/^(?:%%\{)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\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:[16,17],inclusive:!1},acc_descr:{rules:[14],inclusive:!1},acc_title:{rules:[12],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[7,8],inclusive:!1},type_directive:{rules:[6,7],inclusive:!1},open_directive:{rules:[5],inclusive:!1},string_kv_value:{rules:[83,84],inclusive:!1},string_kv_key:{rules:[82],inclusive:!1},string_kv:{rules:[81],inclusive:!1},string:{rules:[78,79],inclusive:!1},attribute:{rules:[73,74,75,76,77,80,85],inclusive:!1},update_layout_config:{rules:[70,71,72,73],inclusive:!1},update_rel_style:{rules:[70,71,72,73],inclusive:!1},update_el_style:{rules:[70,71,72,73],inclusive:!1},rel_b:{rules:[70,71,72,73],inclusive:!1},rel_r:{rules:[70,71,72,73],inclusive:!1},rel_l:{rules:[70,71,72,73],inclusive:!1},rel_d:{rules:[70,71,72,73],inclusive:!1},rel_u:{rules:[70,71,72,73],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[70,71,72,73],inclusive:!1},node_r:{rules:[70,71,72,73],inclusive:!1},node_l:{rules:[70,71,72,73],inclusive:!1},node:{rules:[70,71,72,73],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[70,71,72,73],inclusive:!1},component_ext_queue:{rules:[],inclusive:!1},component_ext_db:{rules:[70,71,72,73],inclusive:!1},component_ext:{rules:[70,71,72,73],inclusive:!1},component_queue:{rules:[70,71,72,73],inclusive:!1},component_db:{rules:[70,71,72,73],inclusive:!1},component:{rules:[70,71,72,73],inclusive:!1},container_boundary:{rules:[70,71,72,73],inclusive:!1},container_ext_queue:{rules:[],inclusive:!1},container_ext_db:{rules:[70,71,72,73],inclusive:!1},container_ext:{rules:[70,71,72,73],inclusive:!1},container_queue:{rules:[70,71,72,73],inclusive:!1},container_db:{rules:[70,71,72,73],inclusive:!1},container:{rules:[70,71,72,73],inclusive:!1},birel:{rules:[70,71,72,73],inclusive:!1},system_boundary:{rules:[70,71,72,73],inclusive:!1},enterprise_boundary:{rules:[70,71,72,73],inclusive:!1},boundary:{rules:[70,71,72,73],inclusive:!1},system_ext_queue:{rules:[70,71,72,73],inclusive:!1},system_ext_db:{rules:[70,71,72,73],inclusive:!1},system_ext:{rules:[70,71,72,73],inclusive:!1},system_queue:{rules:[70,71,72,73],inclusive:!1},system_db:{rules:[70,71,72,73],inclusive:!1},system:{rules:[70,71,72,73],inclusive:!1},person_ext:{rules:[70,71,72,73],inclusive:!1},person:{rules:[70,71,72,73],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,9,10,11,13,15,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,65,66,67,68,69,86,87,88,89,90],inclusive:!0}}};return Oi}();Pc.lexer=Ga;function ws(){this.yy={}}return ws.prototype=Pc,Pc.Parser=ws,new ws}();OW.parser=OW;const vLt=OW;let Qw=[],nx=[""],ag="global",Zw="",o3=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],QN=[],_de="",Cde=!1,NW=4,PW=2;var POe;const wLt=function(){return POe},mLt=function(i){POe=ep(i,Tt())},yLt=function(i,a,f){rd.parseDirective(this,i,a,f)},kLt=function(i,a,f,p,w,y,b,E,S){if(i==null||a===void 0||a===null||f===void 0||f===null||p===void 0||p===null)return;let N={};const B=QN.find(R=>R.from===a&&R.to===f);if(B?N=B:QN.push(N),N.type=i,N.from=a,N.to=f,N.label={text:p},w==null)N.techn={text:""};else if(typeof w=="object"){let[R,j]=Object.entries(w)[0];N[R]={text:j}}else N.techn={text:w};if(y==null)N.descr={text:""};else if(typeof y=="object"){let[R,j]=Object.entries(y)[0];N[R]={text:j}}else N.descr={text:y};if(typeof b=="object"){let[R,j]=Object.entries(b)[0];N[R]=j}else N.sprite=b;if(typeof E=="object"){let[R,j]=Object.entries(E)[0];N[R]=j}else N.tags=E;if(typeof S=="object"){let[R,j]=Object.entries(S)[0];N[R]=j}else N.link=S;N.wrap=rx()},xLt=function(i,a,f,p,w,y,b){if(a===null||f===null)return;let E={};const S=Qw.find(N=>N.alias===a);if(S&&a===S.alias?E=S:(E.alias=a,Qw.push(E)),f==null?E.label={text:""}:E.label={text:f},p==null)E.descr={text:""};else if(typeof p=="object"){let[N,B]=Object.entries(p)[0];E[N]={text:B}}else E.descr={text:p};if(typeof w=="object"){let[N,B]=Object.entries(w)[0];E[N]=B}else E.sprite=w;if(typeof y=="object"){let[N,B]=Object.entries(y)[0];E[N]=B}else E.tags=y;if(typeof b=="object"){let[N,B]=Object.entries(b)[0];E[N]=B}else E.link=b;E.typeC4Shape={text:i},E.parentBoundary=ag,E.wrap=rx()},ELt=function(i,a,f,p,w,y,b,E){if(a===null||f===null)return;let S={};const N=Qw.find(B=>B.alias===a);if(N&&a===N.alias?S=N:(S.alias=a,Qw.push(S)),f==null?S.label={text:""}:S.label={text:f},p==null)S.techn={text:""};else if(typeof p=="object"){let[B,R]=Object.entries(p)[0];S[B]={text:R}}else S.techn={text:p};if(w==null)S.descr={text:""};else if(typeof w=="object"){let[B,R]=Object.entries(w)[0];S[B]={text:R}}else S.descr={text:w};if(typeof y=="object"){let[B,R]=Object.entries(y)[0];S[B]=R}else S.sprite=y;if(typeof b=="object"){let[B,R]=Object.entries(b)[0];S[B]=R}else S.tags=b;if(typeof E=="object"){let[B,R]=Object.entries(E)[0];S[B]=R}else S.link=E;S.wrap=rx(),S.typeC4Shape={text:i},S.parentBoundary=ag},TLt=function(i,a,f,p,w,y,b,E){if(a===null||f===null)return;let S={};const N=Qw.find(B=>B.alias===a);if(N&&a===N.alias?S=N:(S.alias=a,Qw.push(S)),f==null?S.label={text:""}:S.label={text:f},p==null)S.techn={text:""};else if(typeof p=="object"){let[B,R]=Object.entries(p)[0];S[B]={text:R}}else S.techn={text:p};if(w==null)S.descr={text:""};else if(typeof w=="object"){let[B,R]=Object.entries(w)[0];S[B]={text:R}}else S.descr={text:w};if(typeof y=="object"){let[B,R]=Object.entries(y)[0];S[B]=R}else S.sprite=y;if(typeof b=="object"){let[B,R]=Object.entries(b)[0];S[B]=R}else S.tags=b;if(typeof E=="object"){let[B,R]=Object.entries(E)[0];S[B]=R}else S.link=E;S.wrap=rx(),S.typeC4Shape={text:i},S.parentBoundary=ag},_Lt=function(i,a,f,p,w){if(i===null||a===null)return;let y={};const b=o3.find(E=>E.alias===i);if(b&&i===b.alias?y=b:(y.alias=i,o3.push(y)),a==null?y.label={text:""}:y.label={text:a},f==null)y.type={text:"system"};else if(typeof f=="object"){let[E,S]=Object.entries(f)[0];y[E]={text:S}}else y.type={text:f};if(typeof p=="object"){let[E,S]=Object.entries(p)[0];y[E]=S}else y.tags=p;if(typeof w=="object"){let[E,S]=Object.entries(w)[0];y[E]=S}else y.link=w;y.parentBoundary=ag,y.wrap=rx(),Zw=ag,ag=i,nx.push(Zw)},CLt=function(i,a,f,p,w){if(i===null||a===null)return;let y={};const b=o3.find(E=>E.alias===i);if(b&&i===b.alias?y=b:(y.alias=i,o3.push(y)),a==null?y.label={text:""}:y.label={text:a},f==null)y.type={text:"container"};else if(typeof f=="object"){let[E,S]=Object.entries(f)[0];y[E]={text:S}}else y.type={text:f};if(typeof p=="object"){let[E,S]=Object.entries(p)[0];y[E]=S}else y.tags=p;if(typeof w=="object"){let[E,S]=Object.entries(w)[0];y[E]=S}else y.link=w;y.parentBoundary=ag,y.wrap=rx(),Zw=ag,ag=i,nx.push(Zw)},SLt=function(i,a,f,p,w,y,b,E){if(a===null||f===null)return;let S={};const N=o3.find(B=>B.alias===a);if(N&&a===N.alias?S=N:(S.alias=a,o3.push(S)),f==null?S.label={text:""}:S.label={text:f},p==null)S.type={text:"node"};else if(typeof p=="object"){let[B,R]=Object.entries(p)[0];S[B]={text:R}}else S.type={text:p};if(w==null)S.descr={text:""};else if(typeof w=="object"){let[B,R]=Object.entries(w)[0];S[B]={text:R}}else S.descr={text:w};if(typeof b=="object"){let[B,R]=Object.entries(b)[0];S[B]=R}else S.tags=b;if(typeof E=="object"){let[B,R]=Object.entries(E)[0];S[B]=R}else S.link=E;S.nodeType=i,S.parentBoundary=ag,S.wrap=rx(),Zw=ag,ag=a,nx.push(Zw)},ALt=function(){ag=Zw,nx.pop(),Zw=nx.pop(),nx.push(Zw)},LLt=function(i,a,f,p,w,y,b,E,S,N,B){let R=Qw.find(j=>j.alias===a);if(!(R===void 0&&(R=o3.find(j=>j.alias===a),R===void 0))){if(f!=null)if(typeof f=="object"){let[j,$]=Object.entries(f)[0];R[j]=$}else R.bgColor=f;if(p!=null)if(typeof p=="object"){let[j,$]=Object.entries(p)[0];R[j]=$}else R.fontColor=p;if(w!=null)if(typeof w=="object"){let[j,$]=Object.entries(w)[0];R[j]=$}else R.borderColor=w;if(y!=null)if(typeof y=="object"){let[j,$]=Object.entries(y)[0];R[j]=$}else R.shadowing=y;if(b!=null)if(typeof b=="object"){let[j,$]=Object.entries(b)[0];R[j]=$}else R.shape=b;if(E!=null)if(typeof E=="object"){let[j,$]=Object.entries(E)[0];R[j]=$}else R.sprite=E;if(S!=null)if(typeof S=="object"){let[j,$]=Object.entries(S)[0];R[j]=$}else R.techn=S;if(N!=null)if(typeof N=="object"){let[j,$]=Object.entries(N)[0];R[j]=$}else R.legendText=N;if(B!=null)if(typeof B=="object"){let[j,$]=Object.entries(B)[0];R[j]=$}else R.legendSprite=B}},MLt=function(i,a,f,p,w,y,b){const E=QN.find(S=>S.from===a&&S.to===f);if(E!==void 0){if(p!=null)if(typeof p=="object"){let[S,N]=Object.entries(p)[0];E[S]=N}else E.textColor=p;if(w!=null)if(typeof w=="object"){let[S,N]=Object.entries(w)[0];E[S]=N}else E.lineColor=w;if(y!=null)if(typeof y=="object"){let[S,N]=Object.entries(y)[0];E[S]=parseInt(N)}else E.offsetX=parseInt(y);if(b!=null)if(typeof b=="object"){let[S,N]=Object.entries(b)[0];E[S]=parseInt(N)}else E.offsetY=parseInt(b)}},DLt=function(i,a,f){let p=NW,w=PW;if(typeof a=="object"){const y=Object.values(a)[0];p=parseInt(y)}else p=parseInt(a);if(typeof f=="object"){const y=Object.values(f)[0];w=parseInt(y)}else w=parseInt(f);p>=1&&(NW=p),w>=1&&(PW=w)},ILt=function(){return NW},OLt=function(){return PW},NLt=function(){return ag},PLt=function(){return Zw},BOe=function(i){return i==null?Qw:Qw.filter(a=>a.parentBoundary===i)},BLt=function(i){return Qw.find(a=>a.alias===i)},RLt=function(i){return Object.keys(BOe(i))},FLt=function(i){return i==null?o3:o3.filter(a=>a.parentBoundary===i)},jLt=function(){return QN},$Lt=function(){return _de},HLt=function(i){Cde=i},rx=function(){return Cde},ROe={addPersonOrSystem:xLt,addPersonOrSystemBoundary:_Lt,addContainer:ELt,addContainerBoundary:CLt,addComponent:TLt,addDeploymentNode:SLt,popBoundaryParseStack:ALt,addRel:kLt,updateElStyle:LLt,updateRelStyle:MLt,updateLayoutConfig:DLt,autoWrap:rx,setWrap:HLt,getC4ShapeArray:BOe,getC4Shape:BLt,getC4ShapeKeys:RLt,getBoundarys:FLt,getCurrentBoundaryParse:NLt,getParentBoundaryParse:PLt,getRels:jLt,getTitle:$Lt,getC4Type:wLt,getC4ShapeInRow:ILt,getC4BoundaryInRow:OLt,setAccTitle:ip,getAccTitle:L2,getAccDescription:D2,setAccDescription:M2,parseDirective:yLt,getConfig:()=>Tt().c4,clear:function(){Qw=[],o3=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Zw="",ag="global",nx=[""],QN=[],nx=[""],_de="",Cde=!1,NW=4,PW=2},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:function(i){_de=ep(i,Tt())},setC4Type:mLt},Sde=function(i,a){const f=i.append("rect");if(f.attr("x",a.x),f.attr("y",a.y),f.attr("fill",a.fill),f.attr("stroke",a.stroke),f.attr("width",a.width),f.attr("height",a.height),f.attr("rx",a.rx),f.attr("ry",a.ry),a.attrs!=="undefined"&&a.attrs!==null)for(let p in a.attrs)f.attr(p,a.attrs[p]);return a.class!=="undefined"&&f.attr("class",a.class),f},FOe=function(i,a,f,p,w,y){const b=i.append("image");b.attr("width",a),b.attr("height",f),b.attr("x",p),b.attr("y",w);let E=y.startsWith("data:image/png;base64")?y:u5(y);b.attr("xlink:href",E)},zLt=(i,a,f)=>{const p=i.append("g");let w=0;for(let y of a){let b=y.textColor?y.textColor:"#444444",E=y.lineColor?y.lineColor:"#444444",S=y.offsetX?parseInt(y.offsetX):0,N=y.offsetY?parseInt(y.offsetY):0,B="";if(w===0){let j=p.append("line");j.attr("x1",y.startPoint.x),j.attr("y1",y.startPoint.y),j.attr("x2",y.endPoint.x),j.attr("y2",y.endPoint.y),j.attr("stroke-width","1"),j.attr("stroke",E),j.style("fill","none"),y.type!=="rel_b"&&j.attr("marker-end","url("+B+"#arrowhead)"),(y.type==="birel"||y.type==="rel_b")&&j.attr("marker-start","url("+B+"#arrowend)"),w=-1}else{let j=p.append("path");j.attr("fill","none").attr("stroke-width","1").attr("stroke",E).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",y.startPoint.x).replaceAll("starty",y.startPoint.y).replaceAll("controlx",y.startPoint.x+(y.endPoint.x-y.startPoint.x)/2-(y.endPoint.x-y.startPoint.x)/4).replaceAll("controly",y.startPoint.y+(y.endPoint.y-y.startPoint.y)/2).replaceAll("stopx",y.endPoint.x).replaceAll("stopy",y.endPoint.y)),y.type!=="rel_b"&&j.attr("marker-end","url("+B+"#arrowhead)"),(y.type==="birel"||y.type==="rel_b")&&j.attr("marker-start","url("+B+"#arrowend)")}let R=f.messageFont();w5(f)(y.label.text,p,Math.min(y.startPoint.x,y.endPoint.x)+Math.abs(y.endPoint.x-y.startPoint.x)/2+S,Math.min(y.startPoint.y,y.endPoint.y)+Math.abs(y.endPoint.y-y.startPoint.y)/2+N,y.label.width,y.label.height,{fill:b},R),y.techn&&y.techn.text!==""&&(R=f.messageFont(),w5(f)("["+y.techn.text+"]",p,Math.min(y.startPoint.x,y.endPoint.x)+Math.abs(y.endPoint.x-y.startPoint.x)/2+S,Math.min(y.startPoint.y,y.endPoint.y)+Math.abs(y.endPoint.y-y.startPoint.y)/2+f.messageFontSize+5+N,Math.max(y.label.width,y.techn.width),y.techn.height,{fill:b,"font-style":"italic"},R))}},GLt=function(i,a,f){const p=i.append("g");let w=a.bgColor?a.bgColor:"none",y=a.borderColor?a.borderColor:"#444444",b=a.fontColor?a.fontColor:"black",E={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};a.nodeType&&(E={"stroke-width":1});let S={x:a.x,y:a.y,fill:w,stroke:y,width:a.width,height:a.height,rx:2.5,ry:2.5,attrs:E};Sde(p,S);let N=f.boundaryFont();N.fontWeight="bold",N.fontSize=N.fontSize+2,N.fontColor=b,w5(f)(a.label.text,p,a.x,a.y+a.label.Y,a.width,a.height,{fill:"#444444"},N),a.type&&a.type.text!==""&&(N=f.boundaryFont(),N.fontColor=b,w5(f)(a.type.text,p,a.x,a.y+a.type.Y,a.width,a.height,{fill:"#444444"},N)),a.descr&&a.descr.text!==""&&(N=f.boundaryFont(),N.fontSize=N.fontSize-2,N.fontColor=b,w5(f)(a.descr.text,p,a.x,a.y+a.descr.Y,a.width,a.height,{fill:"#444444"},N))},qLt=function(i,a,f){var R;let p=a.bgColor?a.bgColor:f[a.typeC4Shape.text+"_bg_color"],w=a.borderColor?a.borderColor:f[a.typeC4Shape.text+"_border_color"],y=a.fontColor?a.fontColor:"#FFFFFF",b="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(a.typeC4Shape.text){case"person":b="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":b="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 E=i.append("g");E.attr("class","person-man");const S=jOe();switch(a.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":S.x=a.x,S.y=a.y,S.fill=p,S.width=a.width,S.height=a.height,S.stroke=w,S.rx=2.5,S.ry=2.5,S.attrs={"stroke-width":.5},Sde(E,S);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":E.append("path").attr("fill",p).attr("stroke-width","0.5").attr("stroke",w).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",a.x).replaceAll("starty",a.y).replaceAll("half",a.width/2).replaceAll("height",a.height)),E.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",w).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",a.x).replaceAll("starty",a.y).replaceAll("half",a.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":E.append("path").attr("fill",p).attr("stroke-width","0.5").attr("stroke",w).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",a.x).replaceAll("starty",a.y).replaceAll("width",a.width).replaceAll("half",a.height/2)),E.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",w).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",a.x+a.width).replaceAll("starty",a.y).replaceAll("half",a.height/2));break}let N=JLt(f,a.typeC4Shape.text);switch(E.append("text").attr("fill",y).attr("font-family",N.fontFamily).attr("font-size",N.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",a.typeC4Shape.width).attr("x",a.x+a.width/2-a.typeC4Shape.width/2).attr("y",a.y+a.typeC4Shape.Y).text("<<"+a.typeC4Shape.text+">>"),a.typeC4Shape.text){case"person":case"external_person":FOe(E,48,48,a.x+a.width/2-24,a.y+a.image.Y,b);break}let B=f[a.typeC4Shape.text+"Font"]();return B.fontWeight="bold",B.fontSize=B.fontSize+2,B.fontColor=y,w5(f)(a.label.text,E,a.x,a.y+a.label.Y,a.width,a.height,{fill:y},B),B=f[a.typeC4Shape.text+"Font"](),B.fontColor=y,a.techn&&((R=a.techn)==null?void 0:R.text)!==""?w5(f)(a.techn.text,E,a.x,a.y+a.techn.Y,a.width,a.height,{fill:y,"font-style":"italic"},B):a.type&&a.type.text!==""&&w5(f)(a.type.text,E,a.x,a.y+a.type.Y,a.width,a.height,{fill:y,"font-style":"italic"},B),a.descr&&a.descr.text!==""&&(B=f.personFont(),B.fontColor=y,w5(f)(a.descr.text,E,a.x,a.y+a.descr.Y,a.width,a.height,{fill:y},B)),a.height},VLt=function(i){i.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")},ULt=function(i){i.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")},WLt=function(i){i.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")},KLt=function(i){i.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")},YLt=function(i){i.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")},XLt=function(i){i.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")},QLt=function(i){i.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)},ZLt=function(i){const f=i.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);f.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"),f.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")},jOe=function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},JLt=(i,a)=>({fontFamily:i[a+"FontFamily"],fontSize:i[a+"FontSize"],fontWeight:i[a+"FontWeight"]}),w5=function(){function i(w,y,b,E,S,N,B){const R=y.append("text").attr("x",b+S/2).attr("y",E+N/2+5).style("text-anchor","middle").text(w);p(R,B)}function a(w,y,b,E,S,N,B,R){const{fontSize:j,fontFamily:$,fontWeight:V}=R,Q=w.split(Wa.lineBreakRegex);for(let oe=0;oe=this.data.widthLimit||p>=this.data.widthLimit||this.nextData.cnt>$Oe)&&(f=this.nextData.startx+a.margin+xs.nextLinePaddingX,w=this.nextData.stopy+a.margin*2,this.nextData.stopx=p=f+a.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=y=w+a.height,this.nextData.cnt=1),a.x=f,a.y=w,this.updateVal(this.data,"startx",f,Math.min),this.updateVal(this.data,"starty",w,Math.min),this.updateVal(this.data,"stopx",p,Math.max),this.updateVal(this.data,"stopy",y,Math.max),this.updateVal(this.nextData,"startx",f,Math.min),this.updateVal(this.nextData,"starty",w,Math.min),this.updateVal(this.nextData,"stopx",p,Math.max),this.updateVal(this.nextData,"stopy",y,Math.max)}init(a){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},Lde(a.db.getConfig())}bumpLastMargin(a){this.data.stopx+=a,this.data.stopy+=a}}const Lde=function(i){nd(xs,i),i.fontFamily&&(xs.personFontFamily=xs.systemFontFamily=xs.messageFontFamily=i.fontFamily),i.fontSize&&(xs.personFontSize=xs.systemFontSize=xs.messageFontSize=i.fontSize),i.fontWeight&&(xs.personFontWeight=xs.systemFontWeight=xs.messageFontWeight=i.fontWeight)},ZN=(i,a)=>({fontFamily:i[a+"FontFamily"],fontSize:i[a+"FontSize"],fontWeight:i[a+"FontWeight"]}),FW=i=>({fontFamily:i.boundaryFontFamily,fontSize:i.boundaryFontSize,fontWeight:i.boundaryFontWeight}),eMt=i=>({fontFamily:i.messageFontFamily,fontSize:i.messageFontSize,fontWeight:i.messageFontWeight});function Jw(i,a,f,p,w){if(!a[i].width)if(f)a[i].text=NIe(a[i].text,w,p),a[i].textLines=a[i].text.split(Wa.lineBreakRegex).length,a[i].width=w,a[i].height=ode(a[i].text,p);else{let y=a[i].text.split(Wa.lineBreakRegex);a[i].textLines=y.length;let b=0;a[i].height=0,a[i].width=0;for(const E of y)a[i].width=Math.max(s3(E,p),a[i].width),b=ode(E,p),a[i].height=a[i].height+b}}const zOe=function(i,a,f){a.x=f.data.startx,a.y=f.data.starty,a.width=f.data.stopx-f.data.startx,a.height=f.data.stopy-f.data.starty,a.label.y=xs.c4ShapeMargin-35;let p=a.wrap&&xs.wrap,w=FW(xs);w.fontSize=w.fontSize+2,w.fontWeight="bold";let y=s3(a.label.text,w);Jw("label",a,p,w,y),c3.drawBoundary(i,a,xs)},GOe=function(i,a,f,p){let w=0;for(const y of p){w=0;const b=f[y];let E=ZN(xs,b.typeC4Shape.text);switch(E.fontSize=E.fontSize-2,b.typeC4Shape.width=s3("<<"+b.typeC4Shape.text+">>",E),b.typeC4Shape.height=E.fontSize+2,b.typeC4Shape.Y=xs.c4ShapePadding,w=b.typeC4Shape.Y+b.typeC4Shape.height-4,b.image={width:0,height:0,Y:0},b.typeC4Shape.text){case"person":case"external_person":b.image.width=48,b.image.height=48,b.image.Y=w,w=b.image.Y+b.image.height;break}b.sprite&&(b.image.width=48,b.image.height=48,b.image.Y=w,w=b.image.Y+b.image.height);let S=b.wrap&&xs.wrap,N=xs.width-xs.c4ShapePadding*2,B=ZN(xs,b.typeC4Shape.text);if(B.fontSize=B.fontSize+2,B.fontWeight="bold",Jw("label",b,S,B,N),b.label.Y=w+8,w=b.label.Y+b.label.height,b.type&&b.type.text!==""){b.type.text="["+b.type.text+"]";let $=ZN(xs,b.typeC4Shape.text);Jw("type",b,S,$,N),b.type.Y=w+5,w=b.type.Y+b.type.height}else if(b.techn&&b.techn.text!==""){b.techn.text="["+b.techn.text+"]";let $=ZN(xs,b.techn.text);Jw("techn",b,S,$,N),b.techn.Y=w+5,w=b.techn.Y+b.techn.height}let R=w,j=b.label.width;if(b.descr&&b.descr.text!==""){let $=ZN(xs,b.typeC4Shape.text);Jw("descr",b,S,$,N),b.descr.Y=w+20,w=b.descr.Y+b.descr.height,j=Math.max(b.label.width,b.descr.width),R=w-b.descr.textLines*5}j=j+xs.c4ShapePadding,b.width=Math.max(b.width||xs.width,j,xs.width),b.height=Math.max(b.height||xs.height,R,xs.height),b.margin=b.margin||xs.c4ShapeMargin,i.insert(b),c3.drawC4Shape(a,b,xs)}i.bumpLastMargin(xs.c4ShapeMargin)};let Kb=class{constructor(a,f){this.x=a,this.y=f}},qOe=function(i,a){let f=i.x,p=i.y,w=a.x,y=a.y,b=f+i.width/2,E=p+i.height/2,S=Math.abs(f-w),N=Math.abs(p-y),B=N/S,R=i.height/i.width,j=null;return p==y&&fw?j=new Kb(f,E):f==w&&py&&(j=new Kb(b,p)),f>w&&p=B?j=new Kb(f,E+B*i.width/2):j=new Kb(b-S/N*i.height/2,p+i.height):f=B?j=new Kb(f+i.width,E+B*i.width/2):j=new Kb(b+S/N*i.height/2,p+i.height):fy?R>=B?j=new Kb(f+i.width,E-B*i.width/2):j=new Kb(b+i.height/2*S/N,p):f>w&&p>y&&(R>=B?j=new Kb(f,E-i.width/2*B):j=new Kb(b-i.height/2*S/N,p)),j},tMt=function(i,a){let f={x:0,y:0};f.x=a.x+a.width/2,f.y=a.y+a.height/2;let p=qOe(i,f);f.x=i.x+i.width/2,f.y=i.y+i.height/2;let w=qOe(a,f);return{startPoint:p,endPoint:w}};const nMt=function(i,a,f,p){let w=0;for(let y of a){w=w+1;let b=y.wrap&&xs.wrap,E=eMt(xs);p.db.getC4Type()==="C4Dynamic"&&(y.label.text=w+": "+y.label.text);let N=s3(y.label.text,E);Jw("label",y,b,E,N),y.techn&&y.techn.text!==""&&(N=s3(y.techn.text,E),Jw("techn",y,b,E,N)),y.descr&&y.descr.text!==""&&(N=s3(y.descr.text,E),Jw("descr",y,b,E,N));let B=f(y.from),R=f(y.to),j=tMt(B,R);y.startPoint=j.startPoint,y.endPoint=j.endPoint}c3.drawRels(i,a,xs)};function VOe(i,a,f,p,w){let y=new HOe(w);y.data.widthLimit=f.data.widthLimit/Math.min(Ade,p.length);for(let[b,E]of p.entries()){let S=0;E.image={width:0,height:0,Y:0},E.sprite&&(E.image.width=48,E.image.height=48,E.image.Y=S,S=E.image.Y+E.image.height);let N=E.wrap&&xs.wrap,B=FW(xs);if(B.fontSize=B.fontSize+2,B.fontWeight="bold",Jw("label",E,N,B,y.data.widthLimit),E.label.Y=S+8,S=E.label.Y+E.label.height,E.type&&E.type.text!==""){E.type.text="["+E.type.text+"]";let V=FW(xs);Jw("type",E,N,V,y.data.widthLimit),E.type.Y=S+5,S=E.type.Y+E.type.height}if(E.descr&&E.descr.text!==""){let V=FW(xs);V.fontSize=V.fontSize-2,Jw("descr",E,N,V,y.data.widthLimit),E.descr.Y=S+20,S=E.descr.Y+E.descr.height}if(b==0||b%Ade===0){let V=f.data.startx+xs.diagramMarginX,Q=f.data.stopy+xs.diagramMarginY+S;y.setData(V,V,Q,Q)}else{let V=y.data.stopx!==y.data.startx?y.data.stopx+xs.diagramMarginX:y.data.startx,Q=y.data.starty;y.setData(V,V,Q,Q)}y.name=E.alias;let R=w.db.getC4ShapeArray(E.alias),j=w.db.getC4ShapeKeys(E.alias);j.length>0&&GOe(y,i,R,j),a=E.alias;let $=w.db.getBoundarys(a);$.length>0&&VOe(i,a,y,$,w),E.alias!=="global"&&zOe(i,E,y),f.data.stopy=Math.max(y.data.stopy+xs.c4ShapeMargin,f.data.stopy),f.data.stopx=Math.max(y.data.stopx+xs.c4ShapeMargin,f.data.stopx),BW=Math.max(BW,f.data.stopx),RW=Math.max(RW,f.data.stopy)}}const UOe={drawPersonOrSystemArray:GOe,drawBoundary:zOe,setConf:Lde,draw:function(i,a,f,p){xs=Tt().c4;const w=Tt().securityLevel;let y;w==="sandbox"&&(y=Cr("#i"+a));const b=Cr(w==="sandbox"?y.nodes()[0].contentDocument.body:"body");let E=p.db;p.db.setWrap(xs.wrap),$Oe=E.getC4ShapeInRow(),Ade=E.getC4BoundaryInRow(),Fe.debug(`C:${JSON.stringify(xs,null,2)}`);const S=w==="sandbox"?b.select(`[id="${a}"]`):Cr(`[id="${a}"]`);c3.insertComputerIcon(S),c3.insertDatabaseIcon(S),c3.insertClockIcon(S);let N=new HOe(p);N.setData(xs.diagramMarginX,xs.diagramMarginX,xs.diagramMarginY,xs.diagramMarginY),N.data.widthLimit=screen.availWidth,BW=xs.diagramMarginX,RW=xs.diagramMarginY;const B=p.db.getTitle();let R=p.db.getBoundarys("");VOe(S,"",N,R,p),c3.insertArrowHead(S),c3.insertArrowEnd(S),c3.insertArrowCrossHead(S),c3.insertArrowFilledHead(S),nMt(S,p.db.getRels(),p.db.getC4Shape,p),N.data.stopx=BW,N.data.stopy=RW;const j=N.data;let V=j.stopy-j.starty+2*xs.diagramMarginY;const oe=j.stopx-j.startx+2*xs.diagramMarginX;B&&S.append("text").text(B).attr("x",(j.stopx-j.startx)/2-4*xs.diagramMarginX).attr("y",j.starty+xs.diagramMarginY),Vw(S,V,oe,xs.useMaxWidth);const ce=B?60:0;S.attr("viewBox",j.startx-xs.diagramMarginX+" -"+(xs.diagramMarginY+ce)+" "+oe+" "+(V+ce)),Fe.debug("models:",j)}},rMt=Object.freeze(Object.defineProperty({__proto__:null,diagram:{parser:vLt,db:ROe,renderer:UOe,styles:i=>`.person { - stroke: ${i.personBorder}; - fill: ${i.personBkg}; - } -`,init:i=>{UOe.setConf(i.c4)}}},Symbol.toStringTag,{value:"Module"}));var Mde=function(){var i=function(ug,rs,Ps,Aa){for(Ps=Ps||{},Aa=ug.length;Aa--;Ps[ug[Aa]]=rs);return Ps},a=[1,9],f=[1,7],p=[1,6],w=[1,8],y=[1,20,21,22,23,38,44,46,48,52,66,67,87,88,89,90,91,92,96,106,107,110,112,113,119,120,121,122,123,124,125,126,127,128],b=[2,10],E=[1,20],S=[1,21],N=[1,22],B=[1,23],R=[1,30],j=[1,32],$=[1,33],V=[1,34],Q=[1,62],oe=[1,48],ce=[1,52],se=[1,36],ge=[1,37],ye=[1,38],ke=[1,39],Ae=[1,40],de=[1,56],ve=[1,63],te=[1,51],xe=[1,53],De=[1,55],he=[1,59],Ie=[1,60],ee=[1,41],rt=[1,42],me=[1,43],gt=[1,44],pe=[1,61],Et=[1,50],wt=[1,54],jt=[1,57],At=[1,58],Bt=[1,49],cn=[1,66],Nn=[1,71],Ot=[1,20,21,22,23,38,42,44,46,48,52,66,67,87,88,89,90,91,92,96,106,107,110,112,113,119,120,121,122,123,124,125,126,127,128],oi=[1,75],kt=[1,74],Dt=[1,76],vt=[20,21,23,81,82],Nt=[1,99],ze=[1,104],Xe=[1,107],Lt=[1,108],Ge=[1,101],Bn=[1,106],Oe=[1,109],Ri=[1,102],tn=[1,114],hi=[1,113],Sr=[1,103],Zn=[1,105],Xn=[1,110],ir=[1,111],Hn=[1,112],tr=[1,115],ha=[20,21,22,23,81,82],Zs=[20,21,22,23,53,81,82],ns=[20,21,22,23,40,52,53,55,57,59,61,63,65,66,67,69,71,73,74,76,81,82,92,96,106,107,110,112,113,123,124,125,126,127,128],Hi=[20,21,23],Js=[20,21,23,52,66,67,81,82,92,96,106,107,110,112,113,123,124,125,126,127,128],Pc=[1,12,20,21,22,23,24,38,42,44,46,48,52,66,67,87,88,89,90,91,92,96,106,107,110,112,113,119,120,121,122,123,124,125,126,127,128],Ga=[52,66,67,92,96,106,107,110,112,113,123,124,125,126,127,128],ws=[1,150],Oi=[1,158],Er=[1,159],br=[1,160],Dr=[1,161],Vn=[1,145],qi=[1,146],yn=[1,141],Bc=[1,142],jn=[1,153],Ms=[1,154],Pa=[1,155],Ta=[1,156],_a=[1,157],ka=[1,162],Qi=[1,163],ea=[1,148],Ca=[1,151],Sa=[1,147],Ka=[1,144],cg=[20,21,22,23,38,42,44,46,48,52,66,67,87,88,89,90,91,92,96,106,107,110,112,113,119,120,121,122,123,124,125,126,127,128],Gc=[1,166],Dh=[20,21,22,23,26,52,66,67,92,106,107,110,112,113,123,124,125,126,127,128],Es=[20,21,22,23,24,26,38,40,41,42,52,56,58,60,62,64,66,67,68,70,72,73,75,77,81,82,87,88,89,90,91,92,93,96,106,107,110,112,113,114,115,123,124,125,126,127,128],lp=[12,21,22,24],sd=[22,107],sh=[1,251],Ai=[1,246],nn=[1,247],Tr=[1,255],ai=[1,252],Ns=[1,249],mc=[1,248],yu=[1,250],Mo=[1,253],ku=[1,254],Ih=[1,256],qf=[1,274],lx=[20,21,23,107],ad=[20,21,22,23,66,67,87,103,106,107,110,111,112,113,114],b3={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,directive:5,openDirective:6,typeDirective:7,closeDirective:8,separator:9,":":10,argDirective:11,open_directive:12,type_directive:13,arg_directive:14,close_directive:15,graphConfig:16,document:17,line:18,statement:19,SEMI:20,NEWLINE:21,SPACE:22,EOF:23,GRAPH:24,NODIR:25,DIR:26,FirstStmtSeperator:27,ending:28,endToken:29,spaceList:30,spaceListNewline:31,verticeStatement:32,styleStatement:33,linkStyleStatement:34,classDefStatement:35,classStatement:36,clickStatement:37,subgraph:38,text:39,SQS:40,SQE:41,end:42,direction:43,acc_title:44,acc_title_value:45,acc_descr:46,acc_descr_value:47,acc_descr_multiline_value:48,link:49,node:50,vertex:51,AMP:52,STYLE_SEPARATOR:53,idString:54,DOUBLECIRCLESTART:55,DOUBLECIRCLEEND:56,PS:57,PE:58,"(-":59,"-)":60,STADIUMSTART:61,STADIUMEND:62,SUBROUTINESTART:63,SUBROUTINEEND:64,VERTEX_WITH_PROPS_START:65,ALPHA:66,COLON:67,PIPE:68,CYLINDERSTART:69,CYLINDEREND:70,DIAMOND_START:71,DIAMOND_STOP:72,TAGEND:73,TRAPSTART:74,TRAPEND:75,INVTRAPSTART:76,INVTRAPEND:77,linkStatement:78,arrowText:79,TESTSTR:80,START_LINK:81,LINK:82,textToken:83,STR:84,MD_STR:85,keywords:86,STYLE:87,LINKSTYLE:88,CLASSDEF:89,CLASS:90,CLICK:91,DOWN:92,UP:93,textNoTags:94,textNoTagsToken:95,DEFAULT:96,stylesOpt:97,alphaNum:98,CALLBACKNAME:99,CALLBACKARGS:100,HREF:101,LINK_TARGET:102,HEX:103,numList:104,INTERPOLATE:105,NUM:106,COMMA:107,style:108,styleComponent:109,MINUS:110,UNIT:111,BRKT:112,DOT:113,PCT:114,TAGSTART:115,alphaNumToken:116,idStringToken:117,alphaNumStatement:118,direction_tb:119,direction_bt:120,direction_rl:121,direction_lr:122,PUNCTUATION:123,UNICODE_TEXT:124,PLUS:125,EQUALS:126,MULT:127,UNDERSCORE:128,graphCodeTokens:129,ARROW_CROSS:130,ARROW_POINT:131,ARROW_CIRCLE:132,ARROW_OPEN:133,QUOTE:134,$accept:0,$end:1},terminals_:{2:"error",10:":",12:"open_directive",13:"type_directive",14:"arg_directive",15:"close_directive",20:"SEMI",21:"NEWLINE",22:"SPACE",23:"EOF",24:"GRAPH",25:"NODIR",26:"DIR",38:"subgraph",40:"SQS",41:"SQE",42:"end",44:"acc_title",45:"acc_title_value",46:"acc_descr",47:"acc_descr_value",48:"acc_descr_multiline_value",52:"AMP",53:"STYLE_SEPARATOR",55:"DOUBLECIRCLESTART",56:"DOUBLECIRCLEEND",57:"PS",58:"PE",59:"(-",60:"-)",61:"STADIUMSTART",62:"STADIUMEND",63:"SUBROUTINESTART",64:"SUBROUTINEEND",65:"VERTEX_WITH_PROPS_START",66:"ALPHA",67:"COLON",68:"PIPE",69:"CYLINDERSTART",70:"CYLINDEREND",71:"DIAMOND_START",72:"DIAMOND_STOP",73:"TAGEND",74:"TRAPSTART",75:"TRAPEND",76:"INVTRAPSTART",77:"INVTRAPEND",80:"TESTSTR",81:"START_LINK",82:"LINK",84:"STR",85:"MD_STR",87:"STYLE",88:"LINKSTYLE",89:"CLASSDEF",90:"CLASS",91:"CLICK",92:"DOWN",93:"UP",96:"DEFAULT",99:"CALLBACKNAME",100:"CALLBACKARGS",101:"HREF",102:"LINK_TARGET",103:"HEX",105:"INTERPOLATE",106:"NUM",107:"COMMA",110:"MINUS",111:"UNIT",112:"BRKT",113:"DOT",114:"PCT",115:"TAGSTART",119:"direction_tb",120:"direction_bt",121:"direction_rl",122:"direction_lr",123:"PUNCTUATION",124:"UNICODE_TEXT",125:"PLUS",126:"EQUALS",127:"MULT",128:"UNDERSCORE",130:"ARROW_CROSS",131:"ARROW_POINT",132:"ARROW_CIRCLE",133:"ARROW_OPEN",134:"QUOTE"},productions_:[0,[3,1],[3,2],[5,4],[5,6],[6,1],[7,1],[11,1],[8,1],[4,2],[17,0],[17,2],[18,1],[18,1],[18,1],[18,1],[18,1],[16,2],[16,2],[16,2],[16,3],[28,2],[28,1],[29,1],[29,1],[29,1],[27,1],[27,1],[27,2],[31,2],[31,2],[31,1],[31,1],[30,2],[30,1],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,9],[19,6],[19,4],[19,1],[19,2],[19,2],[19,1],[9,1],[9,1],[9,1],[32,3],[32,4],[32,2],[32,1],[50,1],[50,5],[50,3],[51,4],[51,4],[51,6],[51,4],[51,4],[51,4],[51,8],[51,4],[51,4],[51,4],[51,6],[51,4],[51,4],[51,4],[51,4],[51,4],[51,1],[49,2],[49,3],[49,3],[49,1],[49,3],[78,1],[79,3],[39,1],[39,2],[39,1],[39,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[94,1],[94,2],[35,5],[35,5],[36,5],[37,2],[37,4],[37,3],[37,5],[37,2],[37,4],[37,4],[37,6],[37,2],[37,4],[37,2],[37,4],[37,4],[37,6],[33,5],[33,5],[34,5],[34,5],[34,9],[34,9],[34,7],[34,7],[104,1],[104,3],[97,1],[97,3],[108,1],[108,2],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[95,1],[95,1],[95,1],[95,1],[54,1],[54,2],[98,1],[98,2],[118,1],[118,1],[118,1],[118,1],[43,1],[43,1],[43,1],[43,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[117,1],[117,1],[117,1],[117,1],[117,1],[117,1],[117,1],[117,1],[117,1],[117,1],[117,1],[117,1],[117,1],[117,1],[117,1],[117,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1],[129,1]],performAction:function(rs,Ps,Aa,pi,Rc,_t,hp){var Gt=_t.length-1;switch(Rc){case 5:pi.parseDirective("%%{","open_directive");break;case 6:pi.parseDirective(_t[Gt],"type_directive");break;case 7:_t[Gt]=_t[Gt].trim().replace(/'/g,'"'),pi.parseDirective(_t[Gt],"arg_directive");break;case 8:pi.parseDirective("}%%","close_directive","flowchart");break;case 10:this.$=[];break;case 11:(!Array.isArray(_t[Gt])||_t[Gt].length>0)&&_t[Gt-1].push(_t[Gt]),this.$=_t[Gt-1];break;case 12:case 97:case 153:case 155:case 156:this.$=_t[Gt];break;case 19:pi.setDirection("TB"),this.$="TB";break;case 20:pi.setDirection(_t[Gt-1]),this.$=_t[Gt-1];break;case 35:this.$=_t[Gt-1].nodes;break;case 36:case 37:case 38:case 39:case 40:this.$=[];break;case 41:this.$=pi.addSubGraph(_t[Gt-6],_t[Gt-1],_t[Gt-4]);break;case 42:this.$=pi.addSubGraph(_t[Gt-3],_t[Gt-1],_t[Gt-3]);break;case 43:this.$=pi.addSubGraph(void 0,_t[Gt-1],void 0);break;case 45:this.$=_t[Gt].trim(),pi.setAccTitle(this.$);break;case 46:case 47:this.$=_t[Gt].trim(),pi.setAccDescription(this.$);break;case 51:pi.addLink(_t[Gt-2].stmt,_t[Gt],_t[Gt-1]),this.$={stmt:_t[Gt],nodes:_t[Gt].concat(_t[Gt-2].nodes)};break;case 52:pi.addLink(_t[Gt-3].stmt,_t[Gt-1],_t[Gt-2]),this.$={stmt:_t[Gt-1],nodes:_t[Gt-1].concat(_t[Gt-3].nodes)};break;case 53:this.$={stmt:_t[Gt-1],nodes:_t[Gt-1]};break;case 54:this.$={stmt:_t[Gt],nodes:_t[Gt]};break;case 55:this.$=[_t[Gt]];break;case 56:this.$=_t[Gt-4].concat(_t[Gt]);break;case 57:this.$=[_t[Gt-2]],pi.setClass(_t[Gt-2],_t[Gt]);break;case 58:this.$=_t[Gt-3],pi.addVertex(_t[Gt-3],_t[Gt-1],"square");break;case 59:this.$=_t[Gt-3],pi.addVertex(_t[Gt-3],_t[Gt-1],"doublecircle");break;case 60:this.$=_t[Gt-5],pi.addVertex(_t[Gt-5],_t[Gt-2],"circle");break;case 61:this.$=_t[Gt-3],pi.addVertex(_t[Gt-3],_t[Gt-1],"ellipse");break;case 62:this.$=_t[Gt-3],pi.addVertex(_t[Gt-3],_t[Gt-1],"stadium");break;case 63:this.$=_t[Gt-3],pi.addVertex(_t[Gt-3],_t[Gt-1],"subroutine");break;case 64:this.$=_t[Gt-7],pi.addVertex(_t[Gt-7],_t[Gt-1],"rect",void 0,void 0,void 0,Object.fromEntries([[_t[Gt-5],_t[Gt-3]]]));break;case 65:this.$=_t[Gt-3],pi.addVertex(_t[Gt-3],_t[Gt-1],"cylinder");break;case 66:this.$=_t[Gt-3],pi.addVertex(_t[Gt-3],_t[Gt-1],"round");break;case 67:this.$=_t[Gt-3],pi.addVertex(_t[Gt-3],_t[Gt-1],"diamond");break;case 68:this.$=_t[Gt-5],pi.addVertex(_t[Gt-5],_t[Gt-2],"hexagon");break;case 69:this.$=_t[Gt-3],pi.addVertex(_t[Gt-3],_t[Gt-1],"odd");break;case 70:this.$=_t[Gt-3],pi.addVertex(_t[Gt-3],_t[Gt-1],"trapezoid");break;case 71:this.$=_t[Gt-3],pi.addVertex(_t[Gt-3],_t[Gt-1],"inv_trapezoid");break;case 72:this.$=_t[Gt-3],pi.addVertex(_t[Gt-3],_t[Gt-1],"lean_right");break;case 73:this.$=_t[Gt-3],pi.addVertex(_t[Gt-3],_t[Gt-1],"lean_left");break;case 74:this.$=_t[Gt],pi.addVertex(_t[Gt]);break;case 75:_t[Gt-1].text=_t[Gt],this.$=_t[Gt-1];break;case 76:case 77:_t[Gt-2].text=_t[Gt-1],this.$=_t[Gt-2];break;case 78:this.$=_t[Gt];break;case 79:var ff=pi.destructLink(_t[Gt],_t[Gt-2]);this.$={type:ff.type,stroke:ff.stroke,length:ff.length,text:_t[Gt-1]};break;case 80:var ff=pi.destructLink(_t[Gt]);this.$={type:ff.type,stroke:ff.stroke,length:ff.length};break;case 81:this.$=_t[Gt-1];break;case 82:this.$={text:_t[Gt],type:"text"};break;case 83:this.$={text:_t[Gt-1].text+""+_t[Gt],type:_t[Gt-1].type};break;case 84:this.$={text:_t[Gt],type:"text"};break;case 85:this.$={text:_t[Gt],type:"markdown"};break;case 98:case 154:this.$=_t[Gt-1]+""+_t[Gt];break;case 99:case 100:this.$=_t[Gt-4],pi.addClass(_t[Gt-2],_t[Gt]);break;case 101:this.$=_t[Gt-4],pi.setClass(_t[Gt-2],_t[Gt]);break;case 102:case 110:this.$=_t[Gt-1],pi.setClickEvent(_t[Gt-1],_t[Gt]);break;case 103:case 111:this.$=_t[Gt-3],pi.setClickEvent(_t[Gt-3],_t[Gt-2]),pi.setTooltip(_t[Gt-3],_t[Gt]);break;case 104:this.$=_t[Gt-2],pi.setClickEvent(_t[Gt-2],_t[Gt-1],_t[Gt]);break;case 105:this.$=_t[Gt-4],pi.setClickEvent(_t[Gt-4],_t[Gt-3],_t[Gt-2]),pi.setTooltip(_t[Gt-4],_t[Gt]);break;case 106:case 112:this.$=_t[Gt-1],pi.setLink(_t[Gt-1],_t[Gt]);break;case 107:case 113:this.$=_t[Gt-3],pi.setLink(_t[Gt-3],_t[Gt-2]),pi.setTooltip(_t[Gt-3],_t[Gt]);break;case 108:case 114:this.$=_t[Gt-3],pi.setLink(_t[Gt-3],_t[Gt-2],_t[Gt]);break;case 109:case 115:this.$=_t[Gt-5],pi.setLink(_t[Gt-5],_t[Gt-4],_t[Gt]),pi.setTooltip(_t[Gt-5],_t[Gt-2]);break;case 116:this.$=_t[Gt-4],pi.addVertex(_t[Gt-2],void 0,void 0,_t[Gt]);break;case 117:case 119:this.$=_t[Gt-4],pi.updateLink(_t[Gt-2],_t[Gt]);break;case 118:this.$=_t[Gt-4],pi.updateLink([_t[Gt-2]],_t[Gt]);break;case 120:this.$=_t[Gt-8],pi.updateLinkInterpolate([_t[Gt-6]],_t[Gt-2]),pi.updateLink([_t[Gt-6]],_t[Gt]);break;case 121:this.$=_t[Gt-8],pi.updateLinkInterpolate(_t[Gt-6],_t[Gt-2]),pi.updateLink(_t[Gt-6],_t[Gt]);break;case 122:this.$=_t[Gt-6],pi.updateLinkInterpolate([_t[Gt-4]],_t[Gt]);break;case 123:this.$=_t[Gt-6],pi.updateLinkInterpolate(_t[Gt-4],_t[Gt]);break;case 124:case 126:this.$=[_t[Gt]];break;case 125:case 127:_t[Gt-2].push(_t[Gt]),this.$=_t[Gt-2];break;case 129:this.$=_t[Gt-1]+_t[Gt];break;case 151:this.$=_t[Gt];break;case 152:this.$=_t[Gt-1]+""+_t[Gt];break;case 157:this.$="v";break;case 158:this.$="-";break;case 159:this.$={stmt:"dir",value:"TB"};break;case 160:this.$={stmt:"dir",value:"BT"};break;case 161:this.$={stmt:"dir",value:"RL"};break;case 162:this.$={stmt:"dir",value:"LR"};break}},table:[{3:1,4:2,5:3,6:5,12:a,16:4,21:f,22:p,24:w},{1:[3]},{1:[2,1]},{3:10,4:2,5:3,6:5,12:a,16:4,21:f,22:p,24:w},i(y,b,{17:11}),{7:12,13:[1,13]},{16:14,21:f,22:p,24:w},{16:15,21:f,22:p,24:w},{25:[1,16],26:[1,17]},{13:[2,5]},{1:[2,2]},{1:[2,9],18:18,19:19,20:E,21:S,22:N,23:B,32:24,33:25,34:26,35:27,36:28,37:29,38:R,43:31,44:j,46:$,48:V,50:35,51:45,52:Q,54:46,66:oe,67:ce,87:se,88:ge,89:ye,90:ke,91:Ae,92:de,96:ve,106:te,107:xe,110:De,112:he,113:Ie,117:47,119:ee,120:rt,121:me,122:gt,123:pe,124:Et,125:wt,126:jt,127:At,128:Bt},{8:64,10:[1,65],15:cn},i([10,15],[2,6]),i(y,[2,17]),i(y,[2,18]),i(y,[2,19]),{20:[1,68],21:[1,69],22:Nn,27:67,30:70},i(Ot,[2,11]),i(Ot,[2,12]),i(Ot,[2,13]),i(Ot,[2,14]),i(Ot,[2,15]),i(Ot,[2,16]),{9:72,20:oi,21:kt,23:Dt,49:73,78:77,81:[1,78],82:[1,79]},{9:80,20:oi,21:kt,23:Dt},{9:81,20:oi,21:kt,23:Dt},{9:82,20:oi,21:kt,23:Dt},{9:83,20:oi,21:kt,23:Dt},{9:84,20:oi,21:kt,23:Dt},{9:86,20:oi,21:kt,22:[1,85],23:Dt},i(Ot,[2,44]),{45:[1,87]},{47:[1,88]},i(Ot,[2,47]),i(vt,[2,54],{30:89,22:Nn}),{22:[1,90]},{22:[1,91]},{22:[1,92]},{22:[1,93]},{26:Nt,52:ze,66:Xe,67:Lt,84:[1,97],92:Ge,98:96,99:[1,94],101:[1,95],106:Bn,107:Oe,110:Ri,112:tn,113:hi,116:100,118:98,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},i(Ot,[2,159]),i(Ot,[2,160]),i(Ot,[2,161]),i(Ot,[2,162]),i(ha,[2,55],{53:[1,116]}),i(Zs,[2,74],{117:129,40:[1,117],52:Q,55:[1,118],57:[1,119],59:[1,120],61:[1,121],63:[1,122],65:[1,123],66:oe,67:ce,69:[1,124],71:[1,125],73:[1,126],74:[1,127],76:[1,128],92:de,96:ve,106:te,107:xe,110:De,112:he,113:Ie,123:pe,124:Et,125:wt,126:jt,127:At,128:Bt}),i(ns,[2,151]),i(ns,[2,176]),i(ns,[2,177]),i(ns,[2,178]),i(ns,[2,179]),i(ns,[2,180]),i(ns,[2,181]),i(ns,[2,182]),i(ns,[2,183]),i(ns,[2,184]),i(ns,[2,185]),i(ns,[2,186]),i(ns,[2,187]),i(ns,[2,188]),i(ns,[2,189]),i(ns,[2,190]),i(ns,[2,191]),{9:130,20:oi,21:kt,23:Dt},{11:131,14:[1,132]},i(Hi,[2,8]),i(y,[2,20]),i(y,[2,26]),i(y,[2,27]),{21:[1,133]},i(Js,[2,34],{30:134,22:Nn}),i(Ot,[2,35]),{50:135,51:45,52:Q,54:46,66:oe,67:ce,92:de,96:ve,106:te,107:xe,110:De,112:he,113:Ie,117:47,123:pe,124:Et,125:wt,126:jt,127:At,128:Bt},i(Pc,[2,48]),i(Pc,[2,49]),i(Pc,[2,50]),i(Ga,[2,78],{79:136,68:[1,138],80:[1,137]}),{22:ws,24:Oi,26:Er,38:br,39:139,42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:140,84:yn,85:Bc,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},i([52,66,67,68,80,92,96,106,107,110,112,113,123,124,125,126,127,128],[2,80]),i(Ot,[2,36]),i(Ot,[2,37]),i(Ot,[2,38]),i(Ot,[2,39]),i(Ot,[2,40]),{22:ws,24:Oi,26:Er,38:br,39:164,42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:140,84:yn,85:Bc,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},i(cg,b,{17:165}),i(Ot,[2,45]),i(Ot,[2,46]),i(vt,[2,53],{52:Gc}),{26:Nt,52:ze,66:Xe,67:Lt,92:Ge,98:167,103:[1,168],106:Bn,107:Oe,110:Ri,112:tn,113:hi,116:100,118:98,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{96:[1,169],104:170,106:[1,171]},{26:Nt,52:ze,66:Xe,67:Lt,92:Ge,96:[1,172],98:173,106:Bn,107:Oe,110:Ri,112:tn,113:hi,116:100,118:98,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{26:Nt,52:ze,66:Xe,67:Lt,92:Ge,98:174,106:Bn,107:Oe,110:Ri,112:tn,113:hi,116:100,118:98,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},i(Hi,[2,102],{22:[1,175],100:[1,176]}),i(Hi,[2,106],{22:[1,177]}),i(Hi,[2,110],{116:100,118:179,22:[1,178],26:Nt,52:ze,66:Xe,67:Lt,92:Ge,106:Bn,107:Oe,110:Ri,112:tn,113:hi,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr}),i(Hi,[2,112],{22:[1,180]}),i(Dh,[2,153]),i(Dh,[2,155]),i(Dh,[2,156]),i(Dh,[2,157]),i(Dh,[2,158]),i(Es,[2,163]),i(Es,[2,164]),i(Es,[2,165]),i(Es,[2,166]),i(Es,[2,167]),i(Es,[2,168]),i(Es,[2,169]),i(Es,[2,170]),i(Es,[2,171]),i(Es,[2,172]),i(Es,[2,173]),i(Es,[2,174]),i(Es,[2,175]),{52:Q,54:181,66:oe,67:ce,92:de,96:ve,106:te,107:xe,110:De,112:he,113:Ie,117:47,123:pe,124:Et,125:wt,126:jt,127:At,128:Bt},{22:ws,24:Oi,26:Er,38:br,39:182,42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:140,84:yn,85:Bc,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,39:183,42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:140,84:yn,85:Bc,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,39:185,42:Dr,52:ze,57:[1,184],66:Xe,67:Lt,73:Vn,81:qi,83:140,84:yn,85:Bc,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,39:186,42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:140,84:yn,85:Bc,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,39:187,42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:140,84:yn,85:Bc,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,39:188,42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:140,84:yn,85:Bc,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{66:[1,189]},{22:ws,24:Oi,26:Er,38:br,39:190,42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:140,84:yn,85:Bc,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,39:191,42:Dr,52:ze,66:Xe,67:Lt,71:[1,192],73:Vn,81:qi,83:140,84:yn,85:Bc,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,39:193,42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:140,84:yn,85:Bc,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,39:194,42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:140,84:yn,85:Bc,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,39:195,42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:140,84:yn,85:Bc,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},i(ns,[2,152]),i(lp,[2,3]),{8:196,15:cn},{15:[2,7]},i(y,[2,28]),i(Js,[2,33]),i(vt,[2,51],{30:197,22:Nn}),i(Ga,[2,75],{22:[1,198]}),{22:[1,199]},{22:ws,24:Oi,26:Er,38:br,39:200,42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:140,84:yn,85:Bc,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,82:[1,201],83:202,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},i(Es,[2,82]),i(Es,[2,84]),i(Es,[2,85]),i(Es,[2,141]),i(Es,[2,142]),i(Es,[2,143]),i(Es,[2,144]),i(Es,[2,145]),i(Es,[2,146]),i(Es,[2,147]),i(Es,[2,148]),i(Es,[2,149]),i(Es,[2,150]),i(Es,[2,86]),i(Es,[2,87]),i(Es,[2,88]),i(Es,[2,89]),i(Es,[2,90]),i(Es,[2,91]),i(Es,[2,92]),i(Es,[2,93]),i(Es,[2,94]),i(Es,[2,95]),i(Es,[2,96]),{9:204,20:oi,21:kt,22:ws,23:Dt,24:Oi,26:Er,38:br,40:[1,203],42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:202,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{18:18,19:19,20:E,21:S,22:N,23:B,32:24,33:25,34:26,35:27,36:28,37:29,38:R,42:[1,205],43:31,44:j,46:$,48:V,50:35,51:45,52:Q,54:46,66:oe,67:ce,87:se,88:ge,89:ye,90:ke,91:Ae,92:de,96:ve,106:te,107:xe,110:De,112:he,113:Ie,117:47,119:ee,120:rt,121:me,122:gt,123:pe,124:Et,125:wt,126:jt,127:At,128:Bt},{22:Nn,30:206},{22:[1,207],26:Nt,52:ze,66:Xe,67:Lt,92:Ge,106:Bn,107:Oe,110:Ri,112:tn,113:hi,116:100,118:179,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:[1,208]},{22:[1,209]},{22:[1,210],107:[1,211]},i(sd,[2,124]),{22:[1,212]},{22:[1,213],26:Nt,52:ze,66:Xe,67:Lt,92:Ge,106:Bn,107:Oe,110:Ri,112:tn,113:hi,116:100,118:179,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:[1,214],26:Nt,52:ze,66:Xe,67:Lt,92:Ge,106:Bn,107:Oe,110:Ri,112:tn,113:hi,116:100,118:179,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{84:[1,215]},i(Hi,[2,104],{22:[1,216]}),{84:[1,217],102:[1,218]},{84:[1,219]},i(Dh,[2,154]),{84:[1,220],102:[1,221]},i(ha,[2,57],{117:129,52:Q,66:oe,67:ce,92:de,96:ve,106:te,107:xe,110:De,112:he,113:Ie,123:pe,124:Et,125:wt,126:jt,127:At,128:Bt}),{22:ws,24:Oi,26:Er,38:br,41:[1,222],42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:202,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,42:Dr,52:ze,56:[1,223],66:Xe,67:Lt,73:Vn,81:qi,83:202,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,39:224,42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:140,84:yn,85:Bc,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,42:Dr,52:ze,58:[1,225],66:Xe,67:Lt,73:Vn,81:qi,83:202,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,42:Dr,52:ze,60:[1,226],66:Xe,67:Lt,73:Vn,81:qi,83:202,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,42:Dr,52:ze,62:[1,227],66:Xe,67:Lt,73:Vn,81:qi,83:202,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,42:Dr,52:ze,64:[1,228],66:Xe,67:Lt,73:Vn,81:qi,83:202,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{67:[1,229]},{22:ws,24:Oi,26:Er,38:br,42:Dr,52:ze,66:Xe,67:Lt,70:[1,230],73:Vn,81:qi,83:202,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,42:Dr,52:ze,66:Xe,67:Lt,72:[1,231],73:Vn,81:qi,83:202,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,39:232,42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:140,84:yn,85:Bc,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,41:[1,233],42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:202,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,42:Dr,52:ze,66:Xe,67:Lt,73:Vn,75:[1,234],77:[1,235],81:qi,83:202,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{22:ws,24:Oi,26:Er,38:br,42:Dr,52:ze,66:Xe,67:Lt,73:Vn,75:[1,237],77:[1,236],81:qi,83:202,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{9:238,20:oi,21:kt,23:Dt},i(vt,[2,52],{52:Gc}),i(Ga,[2,77]),i(Ga,[2,76]),{22:ws,24:Oi,26:Er,38:br,42:Dr,52:ze,66:Xe,67:Lt,68:[1,239],73:Vn,81:qi,83:202,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},i(Ga,[2,79]),i(Es,[2,83]),{22:ws,24:Oi,26:Er,38:br,39:240,42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:140,84:yn,85:Bc,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},i(cg,b,{17:241}),i(Ot,[2,43]),{51:242,52:Q,54:46,66:oe,67:ce,92:de,96:ve,106:te,107:xe,110:De,112:he,113:Ie,117:47,123:pe,124:Et,125:wt,126:jt,127:At,128:Bt},{22:sh,66:Ai,67:nn,87:Tr,97:243,103:ai,106:Ns,108:244,109:245,110:mc,111:yu,112:Mo,113:ku,114:Ih},{22:sh,66:Ai,67:nn,87:Tr,97:257,103:ai,106:Ns,108:244,109:245,110:mc,111:yu,112:Mo,113:ku,114:Ih},{22:sh,66:Ai,67:nn,87:Tr,97:258,103:ai,105:[1,259],106:Ns,108:244,109:245,110:mc,111:yu,112:Mo,113:ku,114:Ih},{22:sh,66:Ai,67:nn,87:Tr,97:260,103:ai,105:[1,261],106:Ns,108:244,109:245,110:mc,111:yu,112:Mo,113:ku,114:Ih},{106:[1,262]},{22:sh,66:Ai,67:nn,87:Tr,97:263,103:ai,106:Ns,108:244,109:245,110:mc,111:yu,112:Mo,113:ku,114:Ih},{22:sh,66:Ai,67:nn,87:Tr,97:264,103:ai,106:Ns,108:244,109:245,110:mc,111:yu,112:Mo,113:ku,114:Ih},{26:Nt,52:ze,66:Xe,67:Lt,92:Ge,98:265,106:Bn,107:Oe,110:Ri,112:tn,113:hi,116:100,118:98,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},i(Hi,[2,103]),{84:[1,266]},i(Hi,[2,107],{22:[1,267]}),i(Hi,[2,108]),i(Hi,[2,111]),i(Hi,[2,113],{22:[1,268]}),i(Hi,[2,114]),i(Zs,[2,58]),i(Zs,[2,59]),{22:ws,24:Oi,26:Er,38:br,42:Dr,52:ze,58:[1,269],66:Xe,67:Lt,73:Vn,81:qi,83:202,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},i(Zs,[2,66]),i(Zs,[2,61]),i(Zs,[2,62]),i(Zs,[2,63]),{66:[1,270]},i(Zs,[2,65]),i(Zs,[2,67]),{22:ws,24:Oi,26:Er,38:br,42:Dr,52:ze,66:Xe,67:Lt,72:[1,271],73:Vn,81:qi,83:202,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},i(Zs,[2,69]),i(Zs,[2,70]),i(Zs,[2,72]),i(Zs,[2,71]),i(Zs,[2,73]),i(lp,[2,4]),i([22,52,66,67,92,96,106,107,110,112,113,123,124,125,126,127,128],[2,81]),{22:ws,24:Oi,26:Er,38:br,41:[1,272],42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:202,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{18:18,19:19,20:E,21:S,22:N,23:B,32:24,33:25,34:26,35:27,36:28,37:29,38:R,42:[1,273],43:31,44:j,46:$,48:V,50:35,51:45,52:Q,54:46,66:oe,67:ce,87:se,88:ge,89:ye,90:ke,91:Ae,92:de,96:ve,106:te,107:xe,110:De,112:he,113:Ie,117:47,119:ee,120:rt,121:me,122:gt,123:pe,124:Et,125:wt,126:jt,127:At,128:Bt},i(ha,[2,56]),i(Hi,[2,116],{107:qf}),i(lx,[2,126],{109:275,22:sh,66:Ai,67:nn,87:Tr,103:ai,106:Ns,110:mc,111:yu,112:Mo,113:ku,114:Ih}),i(ad,[2,128]),i(ad,[2,130]),i(ad,[2,131]),i(ad,[2,132]),i(ad,[2,133]),i(ad,[2,134]),i(ad,[2,135]),i(ad,[2,136]),i(ad,[2,137]),i(ad,[2,138]),i(ad,[2,139]),i(ad,[2,140]),i(Hi,[2,117],{107:qf}),i(Hi,[2,118],{107:qf}),{22:[1,276]},i(Hi,[2,119],{107:qf}),{22:[1,277]},i(sd,[2,125]),i(Hi,[2,99],{107:qf}),i(Hi,[2,100],{107:qf}),i(Hi,[2,101],{116:100,118:179,26:Nt,52:ze,66:Xe,67:Lt,92:Ge,106:Bn,107:Oe,110:Ri,112:tn,113:hi,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr}),i(Hi,[2,105]),{102:[1,278]},{102:[1,279]},{58:[1,280]},{68:[1,281]},{72:[1,282]},{9:283,20:oi,21:kt,23:Dt},i(Ot,[2,42]),{22:sh,66:Ai,67:nn,87:Tr,103:ai,106:Ns,108:284,109:245,110:mc,111:yu,112:Mo,113:ku,114:Ih},i(ad,[2,129]),{26:Nt,52:ze,66:Xe,67:Lt,92:Ge,98:285,106:Bn,107:Oe,110:Ri,112:tn,113:hi,116:100,118:98,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{26:Nt,52:ze,66:Xe,67:Lt,92:Ge,98:286,106:Bn,107:Oe,110:Ri,112:tn,113:hi,116:100,118:98,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},i(Hi,[2,109]),i(Hi,[2,115]),i(Zs,[2,60]),{22:ws,24:Oi,26:Er,38:br,39:287,42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:140,84:yn,85:Bc,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},i(Zs,[2,68]),i(cg,b,{17:288}),i(lx,[2,127],{109:275,22:sh,66:Ai,67:nn,87:Tr,103:ai,106:Ns,110:mc,111:yu,112:Mo,113:ku,114:Ih}),i(Hi,[2,122],{116:100,118:179,22:[1,289],26:Nt,52:ze,66:Xe,67:Lt,92:Ge,106:Bn,107:Oe,110:Ri,112:tn,113:hi,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr}),i(Hi,[2,123],{116:100,118:179,22:[1,290],26:Nt,52:ze,66:Xe,67:Lt,92:Ge,106:Bn,107:Oe,110:Ri,112:tn,113:hi,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr}),{22:ws,24:Oi,26:Er,38:br,41:[1,291],42:Dr,52:ze,66:Xe,67:Lt,73:Vn,81:qi,83:202,86:152,87:jn,88:Ms,89:Pa,90:Ta,91:_a,92:ka,93:Qi,95:143,96:ea,106:Bn,107:Oe,110:Ca,112:tn,113:hi,114:Sa,115:Ka,116:149,123:Sr,124:Zn,125:Xn,126:ir,127:Hn,128:tr},{18:18,19:19,20:E,21:S,22:N,23:B,32:24,33:25,34:26,35:27,36:28,37:29,38:R,42:[1,292],43:31,44:j,46:$,48:V,50:35,51:45,52:Q,54:46,66:oe,67:ce,87:se,88:ge,89:ye,90:ke,91:Ae,92:de,96:ve,106:te,107:xe,110:De,112:he,113:Ie,117:47,119:ee,120:rt,121:me,122:gt,123:pe,124:Et,125:wt,126:jt,127:At,128:Bt},{22:sh,66:Ai,67:nn,87:Tr,97:293,103:ai,106:Ns,108:244,109:245,110:mc,111:yu,112:Mo,113:ku,114:Ih},{22:sh,66:Ai,67:nn,87:Tr,97:294,103:ai,106:Ns,108:244,109:245,110:mc,111:yu,112:Mo,113:ku,114:Ih},i(Zs,[2,64]),i(Ot,[2,41]),i(Hi,[2,120],{107:qf}),i(Hi,[2,121],{107:qf})],defaultActions:{2:[2,1],9:[2,5],10:[2,2],132:[2,7]},parseError:function(rs,Ps){if(Ps.recoverable)this.trace(rs);else{var Aa=new Error(rs);throw Aa.hash=Ps,Aa}},parse:function(rs){var Ps=this,Aa=[0],pi=[],Rc=[null],_t=[],hp=this.table,Gt="",ff=0,sm=0,m9=2,fp=1,N5=_t.slice.call(arguments,1),ah=Object.create(this.lexer),od={yy:{}};for(var P5 in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P5)&&(od.yy[P5]=this.yy[P5]);ah.setInput(rs,od.yy),od.yy.lexer=ah,od.yy.parser=this,typeof ah.yylloc>"u"&&(ah.yylloc={});var B5=ah.yylloc;_t.push(B5);var y9=ah.options&&ah.options.ranges;typeof od.yy.parseError=="function"?this.parseError=od.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function vL(){var oh;return oh=pi.pop()||ah.lex()||fp,typeof oh!="number"&&(oh instanceof Array&&(pi=oh,oh=pi.pop()),oh=Ps.symbols_[oh]||oh),oh}for(var v1,dp,cd,am,ev={},om,yc,hx,Vo;;){if(dp=Aa[Aa.length-1],this.defaultActions[dp]?cd=this.defaultActions[dp]:((v1===null||typeof v1>"u")&&(v1=vL()),cd=hp[dp]&&hp[dp][v1]),typeof cd>"u"||!cd.length||!cd[0]){var fx="";Vo=[];for(om in hp[dp])this.terminals_[om]&&om>m9&&Vo.push("'"+this.terminals_[om]+"'");ah.showPosition?fx="Parse error on line "+(ff+1)+`: -`+ah.showPosition()+` -Expecting `+Vo.join(", ")+", got '"+(this.terminals_[v1]||v1)+"'":fx="Parse error on line "+(ff+1)+": Unexpected "+(v1==fp?"end of input":"'"+(this.terminals_[v1]||v1)+"'"),this.parseError(fx,{text:ah.match,token:this.terminals_[v1]||v1,line:ah.yylineno,loc:B5,expected:Vo})}if(cd[0]instanceof Array&&cd.length>1)throw new Error("Parse Error: multiple actions possible at state: "+dp+", token: "+v1);switch(cd[0]){case 1:Aa.push(v1),Rc.push(ah.yytext),_t.push(ah.yylloc),Aa.push(cd[1]),v1=null,sm=ah.yyleng,Gt=ah.yytext,ff=ah.yylineno,B5=ah.yylloc;break;case 2:if(yc=this.productions_[cd[1]][1],ev.$=Rc[Rc.length-yc],ev._$={first_line:_t[_t.length-(yc||1)].first_line,last_line:_t[_t.length-1].last_line,first_column:_t[_t.length-(yc||1)].first_column,last_column:_t[_t.length-1].last_column},y9&&(ev._$.range=[_t[_t.length-(yc||1)].range[0],_t[_t.length-1].range[1]]),am=this.performAction.apply(ev,[Gt,sm,ff,od.yy,cd[1],Rc,_t].concat(N5)),typeof am<"u")return am;yc&&(Aa=Aa.slice(0,-1*yc*2),Rc=Rc.slice(0,-1*yc),_t=_t.slice(0,-1*yc)),Aa.push(this.productions_[cd[1]][0]),Rc.push(ev.$),_t.push(ev._$),hx=hp[Aa[Aa.length-2]][Aa[Aa.length-1]],Aa.push(hx);break;case 3:return!0}}return!0}},bL=function(){var ug={EOF:1,parseError:function(Ps,Aa){if(this.yy.parser)this.yy.parser.parseError(Ps,Aa);else throw new Error(Ps)},setInput:function(rs,Ps){return this.yy=Ps||this.yy||{},this._input=rs,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var rs=this._input[0];this.yytext+=rs,this.yyleng++,this.offset++,this.match+=rs,this.matched+=rs;var Ps=rs.match(/(?:\r\n?|\n).*/g);return Ps?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),rs},unput:function(rs){var Ps=rs.length,Aa=rs.split(/(?:\r\n?|\n)/g);this._input=rs+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ps),this.offset-=Ps;var pi=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),Aa.length-1&&(this.yylineno-=Aa.length-1);var Rc=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Aa?(Aa.length===pi.length?this.yylloc.first_column:0)+pi[pi.length-Aa.length].length-Aa[0].length:this.yylloc.first_column-Ps},this.options.ranges&&(this.yylloc.range=[Rc[0],Rc[0]+this.yyleng-Ps]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(rs){this.unput(this.match.slice(rs))},pastInput:function(){var rs=this.matched.substr(0,this.matched.length-this.match.length);return(rs.length>20?"...":"")+rs.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var rs=this.match;return rs.length<20&&(rs+=this._input.substr(0,20-rs.length)),(rs.substr(0,20)+(rs.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var rs=this.pastInput(),Ps=new Array(rs.length+1).join("-");return rs+this.upcomingInput()+` -`+Ps+"^"},test_match:function(rs,Ps){var Aa,pi,Rc;if(this.options.backtrack_lexer&&(Rc={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},this.options.ranges&&(Rc.yylloc.range=this.yylloc.range.slice(0))),pi=rs[0].match(/(?:\r\n?|\n).*/g),pi&&(this.yylineno+=pi.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:pi?pi[pi.length-1].length-pi[pi.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+rs[0].length},this.yytext+=rs[0],this.match+=rs[0],this.matches=rs,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(rs[0].length),this.matched+=rs[0],Aa=this.performAction.call(this,this.yy,this,Ps,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Aa)return Aa;if(this._backtrack){for(var _t in Rc)this[_t]=Rc[_t];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var rs,Ps,Aa,pi;this._more||(this.yytext="",this.match="");for(var Rc=this._currentRules(),_t=0;_tPs[0].length)){if(Ps=Aa,pi=_t,this.options.backtrack_lexer){if(rs=this.test_match(Aa,Rc[_t]),rs!==!1)return rs;if(this._backtrack){Ps=!1;continue}else return!1}else if(!this.options.flex)break}return Ps?(rs=this.test_match(Ps,Rc[pi]),rs!==!1?rs:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var Ps=this.next();return Ps||this.lex()},begin:function(Ps){this.conditionStack.push(Ps)},popState:function(){var Ps=this.conditionStack.length-1;return Ps>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(Ps){return Ps=this.conditionStack.length-1-Math.abs(Ps||0),Ps>=0?this.conditionStack[Ps]:"INITIAL"},pushState:function(Ps){this.begin(Ps)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(Ps,Aa,pi,Rc){switch(pi){case 0:return this.begin("open_directive"),12;case 1:return this.begin("type_directive"),13;case 2:return this.popState(),this.begin("arg_directive"),10;case 3:return this.popState(),this.popState(),15;case 4:return 14;case 5:return this.begin("acc_title"),44;case 6:return this.popState(),"acc_title_value";case 7:return this.begin("acc_descr"),46;case 8:return this.popState(),"acc_descr_value";case 9:this.begin("acc_descr_multiline");break;case 10:this.popState();break;case 11:return"acc_descr_multiline_value";case 12:this.begin("md_string");break;case 13:return"MD_STR";case 14:this.popState();break;case 15:this.begin("string");break;case 16:this.popState();break;case 17:return"STR";case 18:return 87;case 19:return 96;case 20:return 88;case 21:return 105;case 22:return 89;case 23:return 90;case 24:this.begin("href");break;case 25:this.popState();break;case 26:return 101;case 27:this.begin("callbackname");break;case 28:this.popState();break;case 29:this.popState(),this.begin("callbackargs");break;case 30:return 99;case 31:this.popState();break;case 32:return 100;case 33:this.begin("click");break;case 34:this.popState();break;case 35:return 91;case 36:return Ps.lex.firstGraph()&&this.begin("dir"),24;case 37:return Ps.lex.firstGraph()&&this.begin("dir"),24;case 38:return Ps.lex.firstGraph()&&this.begin("dir"),24;case 39:return 38;case 40:return 42;case 41:return 102;case 42:return 102;case 43:return 102;case 44:return 102;case 45:return this.popState(),25;case 46:return this.popState(),26;case 47:return this.popState(),26;case 48:return this.popState(),26;case 49:return this.popState(),26;case 50:return this.popState(),26;case 51:return this.popState(),26;case 52:return this.popState(),26;case 53:return this.popState(),26;case 54:return this.popState(),26;case 55:return this.popState(),26;case 56:return 119;case 57:return 120;case 58:return 121;case 59:return 122;case 60:return 106;case 61:return 112;case 62:return 53;case 63:return 67;case 64:return 52;case 65:return 20;case 66:return 107;case 67:return 127;case 68:return 82;case 69:return 82;case 70:return 82;case 71:return 82;case 72:return 81;case 73:return 81;case 74:return 81;case 75:return 59;case 76:return 60;case 77:return 61;case 78:return 62;case 79:return 63;case 80:return 64;case 81:return 65;case 82:return 69;case 83:return 70;case 84:return 55;case 85:return 56;case 86:return 110;case 87:return 113;case 88:return 128;case 89:return 125;case 90:return 114;case 91:return 126;case 92:return 126;case 93:return 115;case 94:return 73;case 95:return 93;case 96:return"SEP";case 97:return 92;case 98:return 66;case 99:return 75;case 100:return 74;case 101:return 77;case 102:return 76;case 103:return 123;case 104:return 124;case 105:return 68;case 106:return 57;case 107:return 58;case 108:return 40;case 109:return 41;case 110:return 71;case 111:return 72;case 112:return 134;case 113:return 21;case 114:return 22;case 115:return 23}},rules:[/^(?:%%\{)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s]+["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:call[\s]+)/,/^(?:\([\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<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\[)/,/^(?:\]\))/,/^(?:\[\[)/,/^(?:\]\])/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\])/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:-)/,/^(?:\.)/,/^(?:[\_])/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:[A-Za-z]+)/,/^(?:\\\])/,/^(?:\[\/)/,/^(?:\/\])/,/^(?:\[\\)/,/^(?:[!"#$%&'*+,-.`?\\_/])/,/^(?:[\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:{close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},callbackargs:{rules:[31,32],inclusive:!1},callbackname:{rules:[28,29,30],inclusive:!1},href:{rules:[25,26],inclusive:!1},click:{rules:[34,35],inclusive:!1},vertex:{rules:[],inclusive:!1},dir:{rules:[45,46,47,48,49,50,51,52,53,54,55],inclusive:!1},acc_descr_multiline:{rules:[10,11],inclusive:!1},acc_descr:{rules:[8],inclusive:!1},acc_title:{rules:[6],inclusive:!1},md_string:{rules:[13,14],inclusive:!1},string:{rules:[16,17],inclusive:!1},INITIAL:{rules:[0,5,7,9,12,15,18,19,20,21,22,23,24,27,33,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,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,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115],inclusive:!0}}};return ug}();b3.lexer=bL;function im(){this.yy={}}return im.prototype=b3,b3.Parser=im,new im}();Mde.parser=Mde;const Dde=Mde,iMt="flowchart-";let WOe=0,Ide=Tt(),_l={},r9=[],YA={},m5=[],jW={},Ode={},$W=0,Nde=!0,Yb,HW,zW=[];const GW=i=>Wa.sanitizeText(i,Ide),KOe=function(i,a,f){rd.parseDirective(this,i,a,f)},JN=function(i){const a=Object.keys(_l);for(const f of a)if(_l[f].id===i)return _l[f].domId;return i},YOe=function(i,a,f,p,w,y,b={}){let E,S=i;S!==void 0&&S.trim().length!==0&&(_l[S]===void 0&&(_l[S]={id:S,labelType:"text",domId:iMt+S+"-"+WOe,styles:[],classes:[]}),WOe++,a!==void 0?(Ide=Tt(),E=GW(a.text.trim()),_l[S].labelType=a.type,E[0]==='"'&&E[E.length-1]==='"'&&(E=E.substring(1,E.length-1)),_l[S].text=E):_l[S].text===void 0&&(_l[S].text=i),f!==void 0&&(_l[S].type=f),p!=null&&p.forEach(function(N){_l[S].styles.push(N)}),w!=null&&w.forEach(function(N){_l[S].classes.push(N)}),y!==void 0&&(_l[S].dir=y),_l[S].props===void 0?_l[S].props=b:b!==void 0&&Object.assign(_l[S].props,b))},XOe=function(i,a,f){const y={start:i,end:a,type:void 0,text:"",labelType:"text"};Fe.info("abc78 Got edge...",y);const b=f.text;b!==void 0&&(y.text=GW(b.text.trim()),y.text[0]==='"'&&y.text[y.text.length-1]==='"'&&(y.text=y.text.substring(1,y.text.length-1)),y.labelType=b.type),f!==void 0&&(y.type=f.type,y.stroke=f.stroke,y.length=f.length),r9.push(y)},QOe=function(i,a,f){Fe.info("addLink (abc78)",i,a,f);let p,w;for(p=0;p/)&&(Yb="LR"),Yb.match(/.*v/)&&(Yb="TB"),Yb==="TD"&&(Yb="TB")},qW=function(i,a){i.split(",").forEach(function(f){let p=f;_l[p]!==void 0&&_l[p].classes.push(a),jW[p]!==void 0&&jW[p].classes.push(a)})},sMt=function(i,a){i.split(",").forEach(function(f){a!==void 0&&(Ode[HW==="gen-1"?JN(f):f]=GW(a))})},aMt=function(i,a,f){let p=JN(i);if(Tt().securityLevel!=="loose"||a===void 0)return;let w=[];if(typeof f=="string"){w=f.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let y=0;y")),w.classed("hover",!0)}).on("mouseout",function(){a.transition().duration(500).style("opacity",0),Cr(this).classed("hover",!1)})};zW.push(lNe);const hNe=function(i="gen-1"){_l={},YA={},r9=[],zW=[lNe],m5=[],jW={},$W=0,Ode=[],Nde=!0,HW=i,rp()},fNe=i=>{HW=i||"gen-2"},dNe=function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},gNe=function(i,a,f){let p=i.text.trim(),w=f.text;i===f&&f.text.match(/\s/)&&(p=void 0);function y(B){const R={boolean:{},number:{},string:{}},j=[];let $;return{nodeList:B.filter(function(Q){const oe=typeof Q;return Q.stmt&&Q.stmt==="dir"?($=Q.value,!1):Q.trim()===""?!1:oe in R?R[oe].hasOwnProperty(Q)?!1:R[oe][Q]=!0:j.includes(Q)?!1:j.push(Q)}),dir:$}}let b=[];const{nodeList:E,dir:S}=y(b.concat.apply(b,a));if(b=E,HW==="gen-1")for(let B=0;B2e3)return;if(pNe[eP]=a,m5[a].id===i)return{result:!0,count:0};let p=0,w=1;for(;p=0){const b=bNe(i,y);if(b.result)return{result:!0,count:w+b.count};w=w+b.count}p=p+1}return{result:!1,count:w}},vNe=function(i){return pNe[i]},wNe=function(){eP=-1,m5.length>0&&bNe("none",m5.length-1)},mNe=function(){return m5},yNe=()=>Nde?(Nde=!1,!0):!1,cMt=i=>{let a=i.trim(),f="arrow_open";switch(a[0]){case"<":f="arrow_point",a=a.slice(1);break;case"x":f="arrow_cross",a=a.slice(1);break;case"o":f="arrow_circle",a=a.slice(1);break}let p="normal";return a.includes("=")&&(p="thick"),a.includes(".")&&(p="dotted"),{type:f,stroke:p}},uMt=(i,a)=>{const f=a.length;let p=0;for(let w=0;w{const a=i.trim();let f=a.slice(0,-1),p="arrow_open";switch(a.slice(-1)){case"x":p="arrow_cross",a[0]==="x"&&(p="double_"+p,f=f.slice(1));break;case">":p="arrow_point",a[0]==="<"&&(p="double_"+p,f=f.slice(1));break;case"o":p="arrow_circle",a[0]==="o"&&(p="double_"+p,f=f.slice(1));break}let w="normal",y=f.length-1;f[0]==="="&&(w="thick"),f[0]==="~"&&(w="invisible");let b=uMt(".",f);return b&&(w="dotted",y=b),{type:p,stroke:w,length:y}},kNe=(i,a)=>{const f=lMt(i);let p;if(a){if(p=cMt(a),p.stroke!==f.stroke)return{type:"INVALID",stroke:"INVALID"};if(p.type==="arrow_open")p.type=f.type;else{if(p.type!==f.type)return{type:"INVALID",stroke:"INVALID"};p.type="double_"+p.type}return p.type==="double_arrow"&&(p.type="double_arrow_point"),p.length=f.length,p}return f},xNe=(i,a)=>{let f=!1;return i.forEach(p=>{p.nodes.indexOf(a)>=0&&(f=!0)}),f},ENe=(i,a)=>{const f=[];return i.nodes.forEach((p,w)=>{xNe(a,p)||f.push(i.nodes[w])}),{nodes:f}},TNe={firstGraph:yNe},ix={parseDirective:KOe,defaultConfig:()=>OA.flowchart,setAccTitle:ip,getAccTitle:L2,getAccDescription:D2,setAccDescription:M2,addVertex:YOe,lookUpDomId:JN,addLink:QOe,updateLinkInterpolate:ZOe,updateLink:JOe,addClass:eNe,setDirection:tNe,setClass:qW,setTooltip:sMt,getTooltip:rNe,setClickEvent:iNe,setLink:nNe,bindFunctions:sNe,getDirection:aNe,getVertices:oNe,getEdges:cNe,getClasses:uNe,clear:hNe,setGen:fNe,defaultStyle:dNe,addSubGraph:gNe,getDepthFirstPos:vNe,indexNodes:wNe,getSubGraphs:mNe,destructLink:kNe,lex:TNe,exists:xNe,makeUniq:ENe,setDiagramTitle:Uw,getDiagramTitle:Ww},hMt=Object.freeze(Object.defineProperty({__proto__:null,addClass:eNe,addLink:QOe,addSingleLink:XOe,addSubGraph:gNe,addVertex:YOe,bindFunctions:sNe,clear:hNe,default:ix,defaultStyle:dNe,destructLink:kNe,firstGraph:yNe,getClasses:uNe,getDepthFirstPos:vNe,getDirection:aNe,getEdges:cNe,getSubGraphs:mNe,getTooltip:rNe,getVertices:oNe,indexNodes:wNe,lex:TNe,lookUpDomId:JN,parseDirective:KOe,setClass:qW,setClickEvent:iNe,setDirection:tNe,setGen:fNe,setLink:nNe,updateLink:JOe,updateLinkInterpolate:ZOe},Symbol.toStringTag,{value:"Module"}));var fMt="[object Symbol]";function i9(i){return typeof i=="symbol"||a3(i)&&QE(i)==fMt}function XA(i,a){for(var f=-1,p=i==null?0:i.length,w=Array(p);++f0){if(++a>=LMt)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}function QA(i){return function(){return i}}var OMt=function(){try{var i=JE(Object,"defineProperty");return i({},"",{}),i}catch{}}();const UW=OMt;var NMt=UW?function(i,a){return UW(i,"toString",{configurable:!0,enumerable:!1,value:QA(a),writable:!0})}:s9,PMt=IMt(NMt);const INe=PMt;function ONe(i,a){for(var f=-1,p=i==null?0:i.length;++f-1}var $Mt=9007199254740991,HMt=/^(?:0|[1-9]\d*)$/;function WW(i,a){var f=typeof i;return a=a??$Mt,!!a&&(f=="number"||f!="symbol"&&HMt.test(i))&&i>-1&&i%1==0&&i1?f[w-1]:void 0,b=w>2?f[2]:void 0;for(y=i.length>3&&typeof y=="function"?(w--,y):void 0,b&&nP(f[0],f[1],b)&&(y=w<3?void 0:y,w=1),a=Object(a);++p0&&f(E)?a>1?JW(E,a-1,f,p,w):Bde(w,E):p||(w[w.length]=E)}return w}function ZA(i){var a=i==null?0:i.length;return a?JW(i,1):[]}function uDt(i){return INe(BNe(i,void 0,ZA),i+"")}var lDt=fOe(Object.getPrototypeOf,Object);const Rde=lDt;var hDt="[object Object]",fDt=Function.prototype,dDt=Object.prototype,$Ne=fDt.toString,gDt=dDt.hasOwnProperty,pDt=$Ne.call(Object);function HNe(i){if(!a3(i)||QE(i)!=hDt)return!1;var a=Rde(i);if(a===null)return!0;var f=gDt.call(a,"constructor")&&a.constructor;return typeof f=="function"&&f instanceof f&&$Ne.call(f)==pDt}function bDt(i,a,f,p){var w=-1,y=i==null?0:i.length;for(p&&y&&(f=i[++w]);++wE))return!1;var N=y.get(i),B=y.get(a);if(N&&B)return N==a&&B==i;var R=-1,j=!0,$=f&ZIt?new sP:void 0;for(y.set(i,a),y.set(a,i);++R2?a[2]:void 0;for(w&&nP(a[0],a[1],w)&&(p=1);++f-1?w[y?a[b]:b]:void 0}}var VOt=Math.max;function UOt(i,a,f){var p=i==null?0:i.length;if(!p)return-1;var w=f==null?0:TMt(f);return w<0&&(w=VOt(p+w,0)),NNe(i,sx(a),w)}var WOt=qOt(UOt);const Yde=WOt;function kPe(i,a){var f=-1,p=tx(i)?Array(i.length):[];return nK(i,function(w,y,b){p[++f]=a(w,y,b)}),p}function Hf(i,a){var f=$f(i)?XA:kPe;return f(i,sx(a))}function KOt(i,a){return i==null?i:qde(i,Kde(a),a9)}function YOt(i,a){return i&&Vde(i,Kde(a))}function XOt(i,a){return i>a}var QOt=Object.prototype,ZOt=QOt.hasOwnProperty;function JOt(i,a){return i!=null&&ZOt.call(i,a)}function Ja(i,a){return i!=null&&pPe(i,a,JOt)}function eNt(i,a){return XA(a,function(f){return i[f]})}function k5(i){return i==null?[]:eNt(i,N2(i))}function cf(i){return i===void 0}function xPe(i,a){return ia||y&&b&&S&&!E&&!N||p&&b&&S||!f&&S||!w)return 1;if(!p&&!y&&!N&&i=E)return S;var N=f[p];return S*(N=="desc"?-1:1)}}return i.index-a.index}function oNt(i,a,f){a.length?a=XA(a,function(y){return $f(y)?function(b){return ZW(b,y.length===1?y[0]:y)}:y}):a=[s9];var p=-1;a=XA(a,MW(sx));var w=kPe(i,function(y,b,E){var S=XA(a,function(N){return N(y)});return{criteria:S,index:++p,value:y}});return iNt(w,function(y,b){return aNt(y,b,f)})}function cNt(i,a){return rNt(i,a,function(f,p){return bPe(i,p)})}var uNt=uDt(function(i,a){return i==null?{}:cNt(i,a)});const oP=uNt;var lNt=Math.ceil,hNt=Math.max;function fNt(i,a,f,p){for(var w=-1,y=hNt(lNt((a-i)/(f||1)),0),b=Array(y);y--;)b[p?y:++w]=i,i+=f;return b}function dNt(i){return function(a,f,p){return p&&typeof p!="number"&&nP(a,f,p)&&(f=p=void 0),a=VW(a),f===void 0?(f=a,a=0):f=VW(f),p=p===void 0?a1&&nP(i,a[0],a[1])?a=[]:f>2&&nP(a[0],a[1],a[2])&&(a=[a[0]]),oNt(i,JW(a,1),[])});const uP=bNt;var vNt=1/0,wNt=GA&&1/Hde(new GA([,-0]))[1]==vNt?function(i){return new GA(i)}:AMt;const mNt=wNt;var yNt=200;function kNt(i,a,f){var p=-1,w=jMt,y=i.length,b=!0,E=[],S=E;if(f)b=!1,w=zOt;else if(y>=yNt){var N=a?null:mNt(i);if(N)return Hde(N);b=!1,w=oPe,S=new sP}else S=a?[]:E;e:for(;++p1?w.setNode(y,f):w.setNode(y)}),this}setNode(a,f){return Ja(this._nodes,a)?(arguments.length>1&&(this._nodes[a]=f),this):(this._nodes[a]=arguments.length>1?f:this._defaultNodeLabelFn(a),this._isCompound&&(this._parent[a]=u9,this._children[a]={},this._children[u9][a]=!0),this._in[a]={},this._preds[a]={},this._out[a]={},this._sucs[a]={},++this._nodeCount,this)}node(a){return this._nodes[a]}hasNode(a){return Ja(this._nodes,a)}removeNode(a){var f=this;if(Ja(this._nodes,a)){var p=function(w){f.removeEdge(f._edgeObjs[w])};delete this._nodes[a],this._isCompound&&(this._removeFromParentsChildList(a),delete this._parent[a],lr(this.children(a),function(w){f.setParent(w)}),delete this._children[a]),lr(N2(this._in[a]),p),delete this._in[a],delete this._preds[a],lr(N2(this._out[a]),p),delete this._out[a],delete this._sucs[a],--this._nodeCount}return this}setParent(a,f){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(cf(f))f=u9;else{f+="";for(var p=f;!cf(p);p=this.parent(p))if(p===a)throw new Error("Setting "+f+" as parent of "+a+" would create a cycle");this.setNode(f)}return this.setNode(a),this._removeFromParentsChildList(a),this._parent[a]=f,this._children[f][a]=!0,this}_removeFromParentsChildList(a){delete this._children[this._parent[a]][a]}parent(a){if(this._isCompound){var f=this._parent[a];if(f!==u9)return f}}children(a){if(cf(a)&&(a=u9),this._isCompound){var f=this._children[a];if(f)return N2(f)}else{if(a===u9)return this.nodes();if(this.hasNode(a))return[]}}predecessors(a){var f=this._preds[a];if(f)return N2(f)}successors(a){var f=this._sucs[a];if(f)return N2(f)}neighbors(a){var f=this.predecessors(a);if(f)return ENt(f,this.successors(a))}isLeaf(a){var f;return this.isDirected()?f=this.successors(a):f=this.neighbors(a),f.length===0}filterNodes(a){var f=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});f.setGraph(this.graph());var p=this;lr(this._nodes,function(b,E){a(E)&&f.setNode(E,b)}),lr(this._edgeObjs,function(b){f.hasNode(b.v)&&f.hasNode(b.w)&&f.setEdge(b,p.edge(b))});var w={};function y(b){var E=p.parent(b);return E===void 0||f.hasNode(E)?(w[b]=E,E):E in w?w[E]:y(E)}return this._isCompound&&lr(f.nodes(),function(b){f.setParent(b,y(b))}),f}setDefaultEdgeLabel(a){return BA(a)||(a=QA(a)),this._defaultEdgeLabelFn=a,this}edgeCount(){return this._edgeCount}edges(){return k5(this._edgeObjs)}setPath(a,f){var p=this,w=arguments;return cP(a,function(y,b){return w.length>1?p.setEdge(y,b,f):p.setEdge(y,b),b}),this}setEdge(){var a,f,p,w,y=!1,b=arguments[0];typeof b=="object"&&b!==null&&"v"in b?(a=b.v,f=b.w,p=b.name,arguments.length===2&&(w=arguments[1],y=!0)):(a=b,f=arguments[1],p=arguments[3],arguments.length>2&&(w=arguments[2],y=!0)),a=""+a,f=""+f,cf(p)||(p=""+p);var E=lP(this._isDirected,a,f,p);if(Ja(this._edgeLabels,E))return y&&(this._edgeLabels[E]=w),this;if(!cf(p)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(a),this.setNode(f),this._edgeLabels[E]=y?w:this._defaultEdgeLabelFn(a,f,p);var S=ANt(this._isDirected,a,f,p);return a=S.v,f=S.w,Object.freeze(S),this._edgeObjs[E]=S,TPe(this._preds[f],a),TPe(this._sucs[a],f),this._in[f][E]=S,this._out[a][E]=S,this._edgeCount++,this}edge(a,f,p){var w=arguments.length===1?Jde(this._isDirected,arguments[0]):lP(this._isDirected,a,f,p);return this._edgeLabels[w]}hasEdge(a,f,p){var w=arguments.length===1?Jde(this._isDirected,arguments[0]):lP(this._isDirected,a,f,p);return Ja(this._edgeLabels,w)}removeEdge(a,f,p){var w=arguments.length===1?Jde(this._isDirected,arguments[0]):lP(this._isDirected,a,f,p),y=this._edgeObjs[w];return y&&(a=y.v,f=y.w,delete this._edgeLabels[w],delete this._edgeObjs[w],_Pe(this._preds[f],a),_Pe(this._sucs[a],f),delete this._in[f][w],delete this._out[a][w],this._edgeCount--),this}inEdges(a,f){var p=this._in[a];if(p){var w=k5(p);return f?y5(w,function(y){return y.v===f}):w}}outEdges(a,f){var p=this._out[a];if(p){var w=k5(p);return f?y5(w,function(y){return y.w===f}):w}}nodeEdges(a,f){var p=this.inEdges(a,f);if(p)return p.concat(this.outEdges(a,f))}}zf.prototype._nodeCount=0,zf.prototype._edgeCount=0;function TPe(i,a){i[a]?i[a]++:i[a]=1}function _Pe(i,a){--i[a]||delete i[a]}function lP(i,a,f,p){var w=""+a,y=""+f;if(!i&&w>y){var b=w;w=y,y=b}return w+EPe+y+EPe+(cf(p)?SNt:p)}function ANt(i,a,f,p){var w=""+a,y=""+f;if(!i&&w>y){var b=w;w=y,y=b}var E={v:w,w:y};return p&&(E.name=p),E}function Jde(i,a){return lP(i,a.v,a.w,a.name)}class LNt{constructor(){var a={};a._next=a._prev=a,this._sentinel=a}dequeue(){var a=this._sentinel,f=a._prev;if(f!==a)return CPe(f),f}enqueue(a){var f=this._sentinel;a._prev&&a._next&&CPe(a),a._next=f._next,f._next._prev=a,f._next=a,a._prev=f}toString(){for(var a=[],f=this._sentinel,p=f._prev;p!==f;)a.push(JSON.stringify(p,MNt)),p=p._prev;return"["+a.join(", ")+"]"}}function CPe(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function MNt(i,a){if(i!=="_next"&&i!=="_prev")return a}var DNt=QA(1);function INt(i,a){if(i.nodeCount()<=1)return[];var f=NNt(i,a||DNt),p=ONt(f.graph,f.buckets,f.zeroIdx);return ZA(Hf(p,function(w){return i.outEdges(w.v,w.w)}))}function ONt(i,a,f){for(var p=[],w=a[a.length-1],y=a[0],b;i.nodeCount();){for(;b=y.dequeue();)e0e(i,a,f,b);for(;b=w.dequeue();)e0e(i,a,f,b);if(i.nodeCount()){for(var E=a.length-2;E>0;--E)if(b=a[E].dequeue(),b){p=p.concat(e0e(i,a,f,b,!0));break}}}return p}function e0e(i,a,f,p,w){var y=w?[]:void 0;return lr(i.inEdges(p.v),function(b){var E=i.edge(b),S=i.node(b.v);w&&y.push({v:b.v,w:b.w}),S.out-=E,t0e(a,f,S)}),lr(i.outEdges(p.v),function(b){var E=i.edge(b),S=b.w,N=i.node(S);N.in-=E,t0e(a,f,N)}),i.removeNode(p.v),y}function NNt(i,a){var f=new zf,p=0,w=0;lr(i.nodes(),function(E){f.setNode(E,{v:E,in:0,out:0})}),lr(i.edges(),function(E){var S=f.edge(E.v,E.w)||0,N=a(E),B=S+N;f.setEdge(E.v,E.w,B),w=Math.max(w,f.node(E.v).out+=N),p=Math.max(p,f.node(E.w).in+=N)});var y=c9(w+p+3).map(function(){return new LNt}),b=p+1;return lr(f.nodes(),function(E){t0e(y,b,f.node(E))}),{graph:f,buckets:y,zeroIdx:b}}function t0e(i,a,f){f.out?f.in?i[f.out-f.in+a].enqueue(f):i[i.length-1].enqueue(f):i[0].enqueue(f)}function PNt(i){var a=i.graph().acyclicer==="greedy"?INt(i,f(i)):BNt(i);lr(a,function(p){var w=i.edge(p);i.removeEdge(p),w.forwardName=p.name,w.reversed=!0,i.setEdge(p.w,p.v,w,sK("rev"))});function f(p){return function(w){return p.edge(w).weight}}}function BNt(i){var a=[],f={},p={};function w(y){Ja(p,y)||(p[y]=!0,f[y]=!0,lr(i.outEdges(y),function(b){Ja(f,b.w)?a.push(b):w(b.w)}),delete f[y])}return lr(i.nodes(),w),a}function RNt(i){lr(i.edges(),function(a){var f=i.edge(a);if(f.reversed){i.removeEdge(a);var p=f.forwardName;delete f.reversed,delete f.forwardName,i.setEdge(a.w,a.v,f,p)}})}function eL(i,a,f,p){var w;do w=sK(p);while(i.hasNode(w));return f.dummy=a,i.setNode(w,f),w}function FNt(i){var a=new zf().setGraph(i.graph());return lr(i.nodes(),function(f){a.setNode(f,i.node(f))}),lr(i.edges(),function(f){var p=a.edge(f.v,f.w)||{weight:0,minlen:1},w=i.edge(f);a.setEdge(f.v,f.w,{weight:p.weight+w.weight,minlen:Math.max(p.minlen,w.minlen)})}),a}function SPe(i){var a=new zf({multigraph:i.isMultigraph()}).setGraph(i.graph());return lr(i.nodes(),function(f){i.children(f).length||a.setNode(f,i.node(f))}),lr(i.edges(),function(f){a.setEdge(f,i.edge(f))}),a}function APe(i,a){var f=i.x,p=i.y,w=a.x-f,y=a.y-p,b=i.width/2,E=i.height/2;if(!w&&!y)throw new Error("Not possible to find intersection inside of the rectangle");var S,N;return Math.abs(y)*b>Math.abs(w)*E?(y<0&&(E=-E),S=E*w/y,N=E):(w<0&&(b=-b),S=b,N=b*y/w),{x:f+S,y:p+N}}function aK(i){var a=Hf(c9(MPe(i)+1),function(){return[]});return lr(i.nodes(),function(f){var p=i.node(f),w=p.rank;cf(w)||(a[w][p.order]=f)}),a}function jNt(i){var a=aP(Hf(i.nodes(),function(f){return i.node(f).rank}));lr(i.nodes(),function(f){var p=i.node(f);Ja(p,"rank")&&(p.rank-=a)})}function $Nt(i){var a=aP(Hf(i.nodes(),function(y){return i.node(y).rank})),f=[];lr(i.nodes(),function(y){var b=i.node(y).rank-a;f[b]||(f[b]=[]),f[b].push(y)});var p=0,w=i.graph().nodeRankFactor;lr(f,function(y,b){cf(y)&&b%w!==0?--p:p&&lr(y,function(E){i.node(E).rank+=p})})}function LPe(i,a,f,p){var w={width:0,height:0};return arguments.length>=4&&(w.rank=f,w.order=p),eL(i,"border",w,a)}function MPe(i){return o9(Hf(i.nodes(),function(a){var f=i.node(a).rank;if(!cf(f))return f}))}function HNt(i,a){var f={lhs:[],rhs:[]};return lr(i,function(p){a(p)?f.lhs.push(p):f.rhs.push(p)}),f}function zNt(i,a){var f=vPe();try{return a()}finally{console.log(i+" time: "+(vPe()-f)+"ms")}}function GNt(i,a){return a()}function qNt(i){function a(f){var p=i.children(f),w=i.node(f);if(p.length&&lr(p,a),Ja(w,"minRank")){w.borderLeft=[],w.borderRight=[];for(var y=w.minRank,b=w.maxRank+1;yb.lim&&(E=b,S=!0);var N=y5(a.edges(),function(B){return S===zPe(i,i.node(B.v),E)&&S!==zPe(i,i.node(B.w),E)});return Zde(N,function(B){return hP(a,B)})}function HPe(i,a,f,p){var w=f.v,y=f.w;i.removeEdge(w,y),i.setEdge(p.v,p.w,{}),a0e(i),s0e(i,a),sPt(i,a)}function sPt(i,a){var f=Yde(i.nodes(),function(w){return!a.node(w).parent}),p=rPt(i,f);p=p.slice(1),lr(p,function(w){var y=i.node(w).parent,b=a.edge(w,y),E=!1;b||(b=a.edge(y,w),E=!0),a.node(w).rank=a.node(y).rank+(E?b.minlen:-b.minlen)})}function aPt(i,a,f){return i.hasEdge(a,f)}function zPe(i,a,f){return f.low<=a.lim&&a.lim<=f.lim}function oPt(i){switch(i.graph().ranker){case"network-simplex":GPe(i);break;case"tight-tree":uPt(i);break;case"longest-path":cPt(i);break;default:GPe(i)}}var cPt=i0e;function uPt(i){i0e(i),NPe(i)}function GPe(i){l9(i)}function lPt(i){var a=eL(i,"root",{},"_root"),f=hPt(i),p=o9(k5(f))-1,w=2*p+1;i.graph().nestingRoot=a,lr(i.edges(),function(b){i.edge(b).minlen*=w});var y=fPt(i)+1;lr(i.children(),function(b){qPe(i,a,w,y,p,f,b)}),i.graph().nodeRankFactor=w}function qPe(i,a,f,p,w,y,b){var E=i.children(b);if(!E.length){b!==a&&i.setEdge(a,b,{weight:0,minlen:f});return}var S=LPe(i,"_bt"),N=LPe(i,"_bb"),B=i.node(b);i.setParent(S,b),B.borderTop=S,i.setParent(N,b),B.borderBottom=N,lr(E,function(R){qPe(i,a,f,p,w,y,R);var j=i.node(R),$=j.borderTop?j.borderTop:R,V=j.borderBottom?j.borderBottom:R,Q=j.borderTop?p:2*p,oe=$!==V?1:w-y[b]+1;i.setEdge(S,$,{weight:Q,minlen:oe,nestingEdge:!0}),i.setEdge(V,N,{weight:Q,minlen:oe,nestingEdge:!0})}),i.parent(b)||i.setEdge(a,S,{weight:0,minlen:w+y[b]})}function hPt(i){var a={};function f(p,w){var y=i.children(p);y&&y.length&&lr(y,function(b){f(b,w+1)}),a[p]=w}return lr(i.children(),function(p){f(p,1)}),a}function fPt(i){return cP(i.edges(),function(a,f){return a+i.edge(f).weight},0)}function dPt(i){var a=i.graph();i.removeNode(a.nestingRoot),delete a.nestingRoot,lr(i.edges(),function(f){var p=i.edge(f);p.nestingEdge&&i.removeEdge(f)})}function gPt(i,a,f){var p={},w;lr(f,function(y){for(var b=i.parent(y),E,S;b;){if(E=i.parent(b),E?(S=p[E],p[E]=b):(S=w,w=b),S&&S!==b){a.setEdge(S,b);return}b=E}})}function pPt(i,a,f){var p=bPt(i),w=new zf({compound:!0}).setGraph({root:p}).setDefaultNodeLabel(function(y){return i.node(y)});return lr(i.nodes(),function(y){var b=i.node(y),E=i.parent(y);(b.rank===a||b.minRank<=a&&a<=b.maxRank)&&(w.setNode(y),w.setParent(y,E||p),lr(i[f](y),function(S){var N=S.v===y?S.w:S.v,B=w.edge(N,y),R=cf(B)?0:B.weight;w.setEdge(N,y,{weight:i.edge(S).weight+R})}),Ja(b,"minRank")&&w.setNode(y,{borderLeft:b.borderLeft[a],borderRight:b.borderRight[a]}))}),w}function bPt(i){for(var a;i.hasNode(a=sK("_root")););return a}function vPt(i,a){for(var f=0,p=1;p0;)B%2&&(R+=E[B+1]),B=B-1>>1,E[B]+=N.weight;S+=N.weight*R})),S}function mPt(i){var a={},f=y5(i.nodes(),function(E){return!i.children(E).length}),p=o9(Hf(f,function(E){return i.node(E).rank})),w=Hf(c9(p+1),function(){return[]});function y(E){if(!Ja(a,E)){a[E]=!0;var S=i.node(E);w[S.rank].push(E),lr(i.successors(E),y)}}var b=uP(f,function(E){return i.node(E).rank});return lr(b,y),w}function yPt(i,a){return Hf(a,function(f){var p=i.inEdges(f);if(p.length){var w=cP(p,function(y,b){var E=i.edge(b),S=i.node(b.v);return{sum:y.sum+E.weight*S.order,weight:y.weight+E.weight}},{sum:0,weight:0});return{v:f,barycenter:w.sum/w.weight,weight:w.weight}}else return{v:f}})}function kPt(i,a){var f={};lr(i,function(w,y){var b=f[w.v]={indegree:0,in:[],out:[],vs:[w.v],i:y};cf(w.barycenter)||(b.barycenter=w.barycenter,b.weight=w.weight)}),lr(a.edges(),function(w){var y=f[w.v],b=f[w.w];!cf(y)&&!cf(b)&&(b.indegree++,y.out.push(f[w.w]))});var p=y5(f,function(w){return!w.indegree});return xPt(p)}function xPt(i){var a=[];function f(y){return function(b){b.merged||(cf(b.barycenter)||cf(y.barycenter)||b.barycenter>=y.barycenter)&&EPt(y,b)}}function p(y){return function(b){b.in.push(y),--b.indegree===0&&i.push(b)}}for(;i.length;){var w=i.pop();a.push(w),lr(w.in.reverse(),f(w)),lr(w.out,p(w))}return Hf(y5(a,function(y){return!y.merged}),function(y){return oP(y,["vs","i","barycenter","weight"])})}function EPt(i,a){var f=0,p=0;i.weight&&(f+=i.barycenter*i.weight,p+=i.weight),a.weight&&(f+=a.barycenter*a.weight,p+=a.weight),i.vs=a.vs.concat(i.vs),i.barycenter=f/p,i.weight=p,i.i=Math.min(a.i,i.i),a.merged=!0}function TPt(i,a){var f=HNt(i,function(B){return Ja(B,"barycenter")}),p=f.lhs,w=uP(f.rhs,function(B){return-B.i}),y=[],b=0,E=0,S=0;p.sort(_Pt(!!a)),S=VPe(y,w,S),lr(p,function(B){S+=B.vs.length,y.push(B.vs),b+=B.barycenter*B.weight,E+=B.weight,S=VPe(y,w,S)});var N={vs:ZA(y)};return E&&(N.barycenter=b/E,N.weight=E),N}function VPe(i,a,f){for(var p;a.length&&(p=rK(a)).i<=f;)a.pop(),i.push(p.vs),f++;return f}function _Pt(i){return function(a,f){return a.barycenterf.barycenter?1:i?f.i-a.i:a.i-f.i}}function UPe(i,a,f,p){var w=i.children(a),y=i.node(a),b=y?y.borderLeft:void 0,E=y?y.borderRight:void 0,S={};b&&(w=y5(w,function(V){return V!==b&&V!==E}));var N=yPt(i,w);lr(N,function(V){if(i.children(V.v).length){var Q=UPe(i,V.v,f,p);S[V.v]=Q,Ja(Q,"barycenter")&&SPt(V,Q)}});var B=kPt(N,f);CPt(B,S);var R=TPt(B,p);if(b&&(R.vs=ZA([b,R.vs,E]),i.predecessors(b).length)){var j=i.node(i.predecessors(b)[0]),$=i.node(i.predecessors(E)[0]);Ja(R,"barycenter")||(R.barycenter=0,R.weight=0),R.barycenter=(R.barycenter*R.weight+j.order+$.order)/(R.weight+2),R.weight+=2}return R}function CPt(i,a){lr(i,function(f){f.vs=ZA(f.vs.map(function(p){return a[p]?a[p].vs:p}))})}function SPt(i,a){cf(i.barycenter)?(i.barycenter=a.barycenter,i.weight=a.weight):(i.barycenter=(i.barycenter*i.weight+a.barycenter*a.weight)/(i.weight+a.weight),i.weight+=a.weight)}function APt(i){var a=MPe(i),f=WPe(i,c9(1,a+1),"inEdges"),p=WPe(i,c9(a-1,-1,-1),"outEdges"),w=mPt(i);KPe(i,w);for(var y=Number.POSITIVE_INFINITY,b,E=0,S=0;S<4;++E,++S){LPt(E%2?f:p,E%4>=2),w=aK(i);var N=vPt(i,w);Nb||E>a[S].lim));for(N=S,S=p;(S=i.parent(S))!==N;)y.push(S);return{path:w.concat(y.reverse()),lca:N}}function IPt(i){var a={},f=0;function p(w){var y=f;lr(i.children(w),p),a[w]={low:y,lim:f++}}return lr(i.children(),p),a}function OPt(i,a){var f={};function p(w,y){var b=0,E=0,S=w.length,N=rK(y);return lr(y,function(B,R){var j=PPt(i,B),$=j?i.node(j).order:S;(j||B===N)&&(lr(y.slice(E,R+1),function(V){lr(i.predecessors(V),function(Q){var oe=i.node(Q),ce=oe.order;(ceN)&&YPe(f,j,B)})})}function w(y,b){var E=-1,S,N=0;return lr(b,function(B,R){if(i.node(B).dummy==="border"){var j=i.predecessors(B);j.length&&(S=i.node(j[0]).order,p(b,N,R,E,S),N=R,E=S)}p(b,N,b.length,S,y.length)}),b}return cP(a,w),f}function PPt(i,a){if(i.node(a).dummy)return Yde(i.predecessors(a),function(f){return i.node(f).dummy})}function YPe(i,a,f){if(a>f){var p=a;a=f,f=p}var w=i[a];w||(i[a]=w={}),w[f]=!0}function BPt(i,a,f){if(a>f){var p=a;a=f,f=p}return Ja(i[a],f)}function RPt(i,a,f,p){var w={},y={},b={};return lr(a,function(E){lr(E,function(S,N){w[S]=S,y[S]=S,b[S]=N})}),lr(a,function(E){var S=-1;lr(E,function(N){var B=p(N);if(B.length){B=uP(B,function(Q){return b[Q]});for(var R=(B.length-1)/2,j=Math.floor(R),$=Math.ceil(R);j<=$;++j){var V=B[j];y[N]===N&&S0}function l3(i,a,f){var p=i.x,w=i.y,y=[],b=Number.POSITIVE_INFINITY,E=Number.POSITIVE_INFINITY;a.forEach(function(V){b=Math.min(b,V.x),E=Math.min(E,V.y)});for(var S=p-i.width/2-b,N=w-i.height/2-E,B=0;B1&&y.sort(function(V,Q){var oe=V.x-f.x,ce=V.y-f.y,se=Math.sqrt(oe*oe+ce*ce),ge=Q.x-f.x,ye=Q.y-f.y,ke=Math.sqrt(ge*ge+ye*ye);return seMath.abs(w)*E?(y<0&&(E=-E),S=y===0?0:E*w/y,N=E):(w<0&&(b=-b),S=b,N=w===0?0:b*y/w),{x:f+S,y:p+N}}var w0e={rect:$Bt,ellipse:HBt,circle:zBt,diamond:GBt};function jBt(i){w0e=i}function $Bt(i,a,f){var p=i.insert("rect",":first-child").attr("rx",f.rx).attr("ry",f.ry).attr("x",-a.width/2).attr("y",-a.height/2).attr("width",a.width).attr("height",a.height);return f.intersect=function(w){return v0e(f,w)},p}function HBt(i,a,f){var p=a.width/2,w=a.height/2,y=i.insert("ellipse",":first-child").attr("x",-a.width/2).attr("y",-a.height/2).attr("rx",p).attr("ry",w);return f.intersect=function(b){return tBe(f,p,w,b)},y}function zBt(i,a,f){var p=Math.max(a.width,a.height)/2,w=i.insert("circle",":first-child").attr("x",-a.width/2).attr("y",-a.height/2).attr("r",p);return f.intersect=function(y){return RBt(f,p,y)},w}function GBt(i,a,f){var p=a.width*Math.SQRT2/2,w=a.height*Math.SQRT2/2,y=[{x:0,y:-w},{x:-p,y:0},{x:0,y:w},{x:p,y:0}],b=i.insert("polygon",":first-child").attr("points",y.map(function(E){return E.x+","+E.y}).join(" "));return f.intersect=function(E){return l3(f,y,E)},b}function qBt(){var i=function(a,f){WBt(f);var p=fP(a,"output"),w=fP(p,"clusters"),y=fP(p,"edgePaths"),b=g0e(fP(p,"edgeLabels"),f),E=b0e(fP(p,"nodes"),f,w0e);tL(f),BBt(E,f),PBt(b,f),p0e(y,f,l0e);var S=d0e(w,f);NBt(S,f),KBt(f)};return i.createNodes=function(a){return arguments.length?(OBt(a),i):b0e},i.createClusters=function(a){return arguments.length?(_Bt(a),i):d0e},i.createEdgeLabels=function(a){return arguments.length?(CBt(a),i):g0e},i.createEdgePaths=function(a){return arguments.length?(SBt(a),i):p0e},i.shapes=function(a){return arguments.length?(jBt(a),i):w0e},i.arrows=function(a){return arguments.length?(wBt(a),i):l0e},i}var VBt={paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10,rx:0,ry:0,shape:"rect"},UBt={arrowhead:"normal",curve:ng};function WBt(i){i.nodes().forEach(function(a){var f=i.node(a);!Ja(f,"label")&&!i.children(a).length&&(f.label=a),Ja(f,"paddingX")&&JA(f,{paddingLeft:f.paddingX,paddingRight:f.paddingX}),Ja(f,"paddingY")&&JA(f,{paddingTop:f.paddingY,paddingBottom:f.paddingY}),Ja(f,"padding")&&JA(f,{paddingLeft:f.padding,paddingRight:f.padding,paddingTop:f.padding,paddingBottom:f.padding}),JA(f,VBt),lr(["paddingLeft","paddingRight","paddingTop","paddingBottom"],function(p){f[p]=Number(f[p])}),Ja(f,"width")&&(f._prevWidth=f.width),Ja(f,"height")&&(f._prevHeight=f.height)}),i.edges().forEach(function(a){var f=i.edge(a);Ja(f,"label")||(f.label=""),JA(f,UBt)})}function KBt(i){lr(i.nodes(),function(a){var f=i.node(a);Ja(f,"_prevWidth")?f.width=f._prevWidth:delete f.width,Ja(f,"_prevHeight")?f.height=f._prevHeight:delete f.height,delete f._prevWidth,delete f._prevHeight})}function fP(i,a){var f=i.select("g."+a);return f.empty()&&(f=i.append("g").attr("class",a)),f}function rBe(i,a,f){const p=a.width,w=a.height,y=(p+w)*.9,b=[{x:y/2,y:0},{x:y,y:-y/2},{x:y/2,y:-y},{x:0,y:-y/2}],E=x5(i,y,y,b);return f.intersect=function(S){return l3(f,b,S)},E}function iBe(i,a,f){const w=a.height,y=w/4,b=a.width+2*y,E=[{x:y,y:0},{x:b-y,y:0},{x:b,y:-w/2},{x:b-y,y:-w},{x:y,y:-w},{x:0,y:-w/2}],S=x5(i,b,w,E);return f.intersect=function(N){return l3(f,E,N)},S}function sBe(i,a,f){const p=a.width,w=a.height,y=[{x:-w/2,y:0},{x:p,y:0},{x:p,y:-w},{x:-w/2,y:-w},{x:0,y:-w/2}],b=x5(i,p,w,y);return f.intersect=function(E){return l3(f,y,E)},b}function aBe(i,a,f){const p=a.width,w=a.height,y=[{x:-2*w/6,y:0},{x:p-w/6,y:0},{x:p+2*w/6,y:-w},{x:w/6,y:-w}],b=x5(i,p,w,y);return f.intersect=function(E){return l3(f,y,E)},b}function oBe(i,a,f){const p=a.width,w=a.height,y=[{x:2*w/6,y:0},{x:p+w/6,y:0},{x:p-2*w/6,y:-w},{x:-w/6,y:-w}],b=x5(i,p,w,y);return f.intersect=function(E){return l3(f,y,E)},b}function cBe(i,a,f){const p=a.width,w=a.height,y=[{x:-2*w/6,y:0},{x:p+2*w/6,y:0},{x:p-w/6,y:-w},{x:w/6,y:-w}],b=x5(i,p,w,y);return f.intersect=function(E){return l3(f,y,E)},b}function uBe(i,a,f){const p=a.width,w=a.height,y=[{x:w/6,y:0},{x:p-w/6,y:0},{x:p+2*w/6,y:-w},{x:-2*w/6,y:-w}],b=x5(i,p,w,y);return f.intersect=function(E){return l3(f,y,E)},b}function lBe(i,a,f){const p=a.width,w=a.height,y=[{x:0,y:0},{x:p+w/2,y:0},{x:p,y:-w/2},{x:p+w/2,y:-w},{x:0,y:-w}],b=x5(i,p,w,y);return f.intersect=function(E){return l3(f,y,E)},b}function hBe(i,a,f){const p=a.height,w=a.width+p/4,y=i.insert("rect",":first-child").attr("rx",p/2).attr("ry",p/2).attr("x",-w/2).attr("y",-p/2).attr("width",w).attr("height",p);return f.intersect=function(b){return v0e(f,b)},y}function fBe(i,a,f){const p=a.width,w=a.height,y=[{x:0,y:0},{x:p,y:0},{x:p,y:-w},{x:0,y:-w},{x:0,y:0},{x:-8,y:0},{x:p+8,y:0},{x:p+8,y:-w},{x:-8,y:-w},{x:-8,y:0}],b=x5(i,p,w,y);return f.intersect=function(E){return l3(f,y,E)},b}function dBe(i,a,f){const p=a.width,w=p/2,y=w/(2.5+p/50),b=a.height+y,E="M 0,"+y+" a "+w+","+y+" 0,0,0 "+p+" 0 a "+w+","+y+" 0,0,0 "+-p+" 0 l 0,"+b+" a "+w+","+y+" 0,0,0 "+p+" 0 l 0,"+-b,S=i.attr("label-offset-y",y).insert("path",":first-child").attr("d",E).attr("transform","translate("+-p/2+","+-(b/2+y)+")");return f.intersect=function(N){const B=v0e(f,N),R=B.x-f.x;if(w!=0&&(Math.abs(R)f.height/2-y)){let j=y*y*(1-R*R/(w*w));j!=0&&(j=Math.sqrt(j)),j=y-j,N.y-f.y>0&&(j=-j),B.y+=j}return B},S}function YBt(i){i.shapes().question=rBe,i.shapes().hexagon=iBe,i.shapes().stadium=hBe,i.shapes().subroutine=fBe,i.shapes().cylinder=dBe,i.shapes().rect_left_inv_arrow=sBe,i.shapes().lean_right=aBe,i.shapes().lean_left=oBe,i.shapes().trapezoid=cBe,i.shapes().inv_trapezoid=uBe,i.shapes().rect_right_inv_arrow=lBe}function XBt(i){i({question:rBe}),i({hexagon:iBe}),i({stadium:hBe}),i({subroutine:fBe}),i({cylinder:dBe}),i({rect_left_inv_arrow:sBe}),i({lean_right:aBe}),i({lean_left:oBe}),i({trapezoid:cBe}),i({inv_trapezoid:uBe}),i({rect_right_inv_arrow:lBe})}function x5(i,a,f,p){return i.insert("polygon",":first-child").attr("points",p.map(function(w){return w.x+","+w.y}).join(" ")).attr("transform","translate("+-a/2+","+f/2+")")}const QBt={addToRender:YBt,addToRenderV2:XBt},gBe={},ZBt=function(i){const a=Object.keys(i);for(const f of a)gBe[f]=i[f]},pBe=function(i,a,f,p,w,y){const b=p?p.select(`[id="${f}"]`):Cr(`[id="${f}"]`),E=w||document;Object.keys(i).forEach(function(N){const B=i[N];let R="default";B.classes.length>0&&(R=B.classes.join(" "));const j=Yw(B.styles);let $=B.text!==void 0?B.text:B.id,V;if(d1(Tt().flowchart.htmlLabels)){const ce={label:$.replace(/fa[blrs]?:fa-[\w-]+/g,se=>``)};V=h0e(b,ce).node(),V.parentNode.removeChild(V)}else{const ce=E.createElementNS("http://www.w3.org/2000/svg","text");ce.setAttribute("style",j.labelStyle.replace("color:","fill:"));const se=$.split(Wa.lineBreakRegex);for(const ge of se){const ye=E.createElementNS("http://www.w3.org/2000/svg","tspan");ye.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),ye.setAttribute("dy","1em"),ye.setAttribute("x","1"),ye.textContent=ge,ce.appendChild(ye)}V=ce}let Q=0,oe="";switch(B.type){case"round":Q=5,oe="rect";break;case"square":oe="rect";break;case"diamond":oe="question";break;case"hexagon":oe="hexagon";break;case"odd":oe="rect_left_inv_arrow";break;case"lean_right":oe="lean_right";break;case"lean_left":oe="lean_left";break;case"trapezoid":oe="trapezoid";break;case"inv_trapezoid":oe="inv_trapezoid";break;case"odd_right":oe="rect_left_inv_arrow";break;case"circle":oe="circle";break;case"ellipse":oe="ellipse";break;case"stadium":oe="stadium";break;case"subroutine":oe="subroutine";break;case"cylinder":oe="cylinder";break;case"group":oe="rect";break;default:oe="rect"}Fe.warn("Adding node",B.id,B.domId),a.setNode(y.db.lookUpDomId(B.id),{labelType:"svg",labelStyle:j.labelStyle,shape:oe,label:V,rx:Q,ry:Q,class:R,style:j.style,id:y.db.lookUpDomId(B.id)})})},bBe=function(i,a,f){let p=0,w,y;if(i.defaultStyle!==void 0){const b=Yw(i.defaultStyle);w=b.style,y=b.labelStyle}i.forEach(function(b){p++;var E="L-"+b.start+"-"+b.end,S="LS-"+b.start,N="LE-"+b.end;const B={};b.type==="arrow_open"?B.arrowhead="none":B.arrowhead="normal";let R="",j="";if(b.style!==void 0){const $=Yw(b.style);R=$.style,j=$.labelStyle}else switch(b.stroke){case"normal":R="fill:none",w!==void 0&&(R=w),y!==void 0&&(j=y);break;case"dotted":R="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":R=" stroke-width: 3.5px;fill:none";break}B.style=R,B.labelStyle=j,b.interpolate!==void 0?B.curve=Ub(b.interpolate,ng):i.defaultInterpolate!==void 0?B.curve=Ub(i.defaultInterpolate,ng):B.curve=Ub(gBe.curve,ng),b.text===void 0?b.style!==void 0&&(B.arrowheadStyle="fill: #333"):(B.arrowheadStyle="fill: #333",B.labelpos="c",d1(Tt().flowchart.htmlLabels)?(B.labelType="html",B.label=`${b.text.replace(/fa[blrs]?:fa-[\w-]+/g,$=>``)}`):(B.labelType="text",B.label=b.text.replace(Wa.lineBreakRegex,` -`),b.style===void 0&&(B.style=B.style||"stroke: #333; stroke-width: 1.5px;fill:none"),B.labelStyle=B.labelStyle.replace("color:","fill:"))),B.id=E,B.class=S+" "+N,B.minlen=b.length||1,a.setEdge(f.db.lookUpDomId(b.start),f.db.lookUpDomId(b.end),B,p)})},JBt={setConf:ZBt,addVertices:pBe,addEdges:bBe,getClasses:function(i,a){Fe.info("Extracting classes"),a.db.clear();try{return a.parse(i),a.db.getClasses()}catch(f){return Fe.error(f),{}}},draw:function(i,a,f,p){Fe.info("Drawing flowchart"),p.db.clear();const{securityLevel:w,flowchart:y}=Tt();let b;w==="sandbox"&&(b=Cr("#i"+a));const E=Cr(w==="sandbox"?b.nodes()[0].contentDocument.body:"body"),S=w==="sandbox"?b.nodes()[0].contentDocument:document;try{p.parser.parse(i)}catch{Fe.debug("Parsing failed")}let N=p.db.getDirection();N===void 0&&(N="TD");const B=y.nodeSpacing||50,R=y.rankSpacing||50,j=new zf({multigraph:!0,compound:!0}).setGraph({rankdir:N,nodesep:B,ranksep:R,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});let $;const V=p.db.getSubGraphs();for(let Ae=V.length-1;Ae>=0;Ae--)$=V[Ae],p.db.addVertex($.id,$.title,"group",void 0,$.classes);const Q=p.db.getVertices();Fe.warn("Get vertices",Q);const oe=p.db.getEdges();let ce=0;for(ce=V.length-1;ce>=0;ce--){$=V[ce],Jfe("cluster").append("text");for(let Ae=0;Ae<$.nodes.length;Ae++)Fe.warn("Setting subgraph",$.nodes[Ae],p.db.lookUpDomId($.nodes[Ae]),p.db.lookUpDomId($.id)),j.setParent(p.db.lookUpDomId($.nodes[Ae]),p.db.lookUpDomId($.id))}pBe(Q,j,a,E,S,p),bBe(oe,j,p);const se=new qBt;QBt.addToRender(se),se.arrows().none=function(de,ve,te,xe){const he=de.append("marker").attr("id",ve).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 0 0 L 0 0 L 0 0 z");u3(he,te[xe+"Style"])},se.arrows().normal=function(de,ve){de.append("marker").attr("id",ve).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto").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 ge=E.select(`[id="${a}"]`),ye=E.select("#"+a+" g");for(se(ye,j),ye.selectAll("g.node").attr("title",function(){return p.db.getTooltip(this.id)}),p.db.indexNodes("subGraph"+ce),ce=0;ce{a.forEach(w=>{rRt[w](i,f,p)})},rRt={extension:(i,a,f)=>{Fe.trace("Making markers for ",f),i.append("defs").append("marker").attr("id",a+"-extensionStart").attr("class","marker extension "+a).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"),i.append("defs").append("marker").attr("id",a+"-extensionEnd").attr("class","marker extension "+a).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")},composition:(i,a)=>{i.append("defs").append("marker").attr("id",a+"-compositionStart").attr("class","marker composition "+a).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"),i.append("defs").append("marker").attr("id",a+"-compositionEnd").attr("class","marker composition "+a).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")},aggregation:(i,a)=>{i.append("defs").append("marker").attr("id",a+"-aggregationStart").attr("class","marker aggregation "+a).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"),i.append("defs").append("marker").attr("id",a+"-aggregationEnd").attr("class","marker aggregation "+a).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")},dependency:(i,a)=>{i.append("defs").append("marker").attr("id",a+"-dependencyStart").attr("class","marker dependency "+a).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"),i.append("defs").append("marker").attr("id",a+"-dependencyEnd").attr("class","marker dependency "+a).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")},lollipop:(i,a)=>{i.append("defs").append("marker").attr("id",a+"-lollipopStart").attr("class","marker lollipop "+a).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","white").attr("cx",6).attr("cy",7).attr("r",6)},point:(i,a)=>{i.append("marker").attr("id",a+"-pointEnd").attr("class","marker "+a).attr("viewBox","0 0 10 10").attr("refX",10).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"),i.append("marker").attr("id",a+"-pointStart").attr("class","marker "+a).attr("viewBox","0 0 10 10").attr("refX",0).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")},circle:(i,a)=>{i.append("marker").attr("id",a+"-circleEnd").attr("class","marker "+a).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"),i.append("marker").attr("id",a+"-circleStart").attr("class","marker "+a).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")},cross:(i,a)=>{i.append("marker").attr("id",a+"-crossEnd").attr("class","marker cross "+a).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"),i.append("marker").attr("id",a+"-crossStart").attr("class","marker cross "+a).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")},barb:(i,a)=>{i.append("defs").append("marker").attr("id",a+"-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")}},vBe=nRt;function iRt(i,a){a&&i.attr("style",a)}function sRt(i){const a=Cr(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),f=a.append("xhtml:div"),p=i.label,w=i.isNode?"nodeLabel":"edgeLabel";return f.html('"+p+""),iRt(f,i.labelStyle),f.style("display","inline-block"),f.style("white-space","nowrap"),f.attr("xmlns","http://www.w3.org/1999/xhtml"),a.node()}const sp=(i,a,f,p)=>{let w=i||"";if(typeof w=="object"&&(w=w[0]),d1(Tt().flowchart.htmlLabels)){w=w.replace(/\\n|\n/g,"
    "),Fe.info("vertexText"+w);const y={isNode:p,label:XN(w).replace(/fa[blrs]?:fa-[\w-]+/g,E=>``),labelStyle:a.replace("fill:","color:")};return sRt(y)}else{const y=document.createElementNS("http://www.w3.org/2000/svg","text");y.setAttribute("style",a.replace("color:","fill:"));let b=[];typeof w=="string"?b=w.split(/\\n|\n|/gi):Array.isArray(w)?b=w:b=[];for(const E of b){const S=document.createElementNS("http://www.w3.org/2000/svg","tspan");S.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),S.setAttribute("dy","1em"),S.setAttribute("x","0"),f?S.setAttribute("class","title-row"):S.setAttribute("class","row"),S.textContent=E.trim(),y.appendChild(S)}return y}};var aRt=/\r\n?/g,oRt=/\t/g,cRt=/\f/g,wBe=function(a){return a.replace(aRt,` -`).replace(cRt,"").replace(oRt," ")},mBe=function(a,f){var p=a||{};if(f!=null)for(var w in f)Object.prototype.hasOwnProperty.call(f,w)&&(p[w]=f[w]);return p},yBe=function(a,f){var p=Object.keys(a).filter(function(E){var S=a[E];if(S==null||S.match==null)return!1;var N=S.order;return(typeof N!="number"||!isFinite(N))&&typeof console<"u"&&console.warn("simple-markdown: Invalid order for rule `"+E+"`: "+String(N)),!0});p.sort(function(E,S){var N=a[E],B=a[S],R=N.order,j=B.order;if(R!==j)return R-j;var $=N.quality?0:1,V=B.quality?0:1;return $!==V?$-V:ES?1:0});var w,y=function E(S,N){var B=[];for(N=N||w,w=N;S;){var R=null,j=null,$=null,V=NaN,Q=0,oe=p[0],ce=a[oe];do{var se=ce.order,ge=N.prevCapture==null?"":N.prevCapture[0],ye=ce.match(S,N,ge);if(ye){var ke=ce.quality?ce.quality(ye,N,ge):0;ke<=V||(R=oe,j=ce,$=ye,V=ke)}Q++,oe=p[Q],ce=a[oe]}while(ce&&(!$||ce.order===se&&ce.quality));if(j==null||$==null)throw new Error("Could not find a matching rule for the below content. The rule with highest `order` should always match content provided to it. Check the definition of `match` for '"+p[p.length-1]+`'. It seems to not match the following source: -`+S);if($.index)throw new Error("`match` must return a capture starting at index 0 (the current parse index). Did you forget a ^ at the start of the RegExp?");var Ae=j.parse($,E,N);if(Array.isArray(Ae))Array.prototype.push.apply(B,Ae);else{if(Ae==null||typeof Ae!="object")throw new Error(`parse() function returned invalid parse result: '${Ae}'`);Ae.type==null&&(Ae.type=R),B.push(Ae)}N.prevCapture=$,S=S.substring(N.prevCapture[0].length)}return B},b=function(S,N){return w=mBe(N,f),!w.inline&&!w.disableAutoBlockNewlines&&(S=S+` - -`),w.prevCapture=null,y(wBe(S),w)};return b},ap=function(a){var f=function(w,y,b){return y.inline?a.exec(w):null};return f.regex=a,f},Xb=function(a){var f=function(w,y){return y.inline?null:a.exec(w)};return f.regex=a,f},m0e=function(a){var f=function(w,y){return a.exec(w)};return f.regex=a,f},uRt=typeof Symbol=="function"&&Symbol.for&&Symbol.for("react.element")||60103,Cl=function(a,f,p){var w={$$typeof:uRt,type:a,key:f??void 0,ref:null,props:p,_owner:null};return w},Ah=function(a,f,p,w){p=p||{},w=typeof w<"u"?w:!0;var y="";for(var b in p){var E=p[b];Object.prototype.hasOwnProperty.call(p,b)&&E&&(y+=" "+nL(b)+'="'+nL(E)+'"')}var S="<"+a+y+">";return w?S+f+"":S},kBe={},dP=function(a){if(a==null)return null;try{var f=new URL(a,"https://localhost").protocol;if(f.indexOf("javascript:")===0||f.indexOf("vbscript:")===0||f.indexOf("data:")===0)return null}catch{return null}return a},lRt=/[<>&"']/g,hRt={"<":"<",">":">","&":"&",'"':""","'":"'","/":"/","`":"`"},nL=function(a){return String(a).replace(lRt,function(f){return hRt[f]})},fRt=/\\([^0-9A-Za-z\s])/g,y0e=function(a){return a.replace(fRt,"$1")},oK=function(a,f,p){var w=p.inline||!1;p.inline=!0;var y=a(f,p);return p.inline=w,y},dRt=function(a,f,p){var w=p.inline||!1;p.inline=!1;var y=a(f+` - -`,p);return p.inline=w,y},cK=function(a,f,p){return{content:oK(f,a[1],p)}},k0e=function(){return{}},uK="(?:[*+-]|\\d+\\.)",xBe="( *)("+uK+") +",EBe=new RegExp("^"+xBe),gRt=new RegExp(xBe+"[^\\n]*(?:\\n(?!\\1"+uK+` )[^\\n]*)*( -|$)`,"gm"),TBe=/\n{2,}$/,pRt=/^ (?= *`)|(` *) $/g,bRt=TBe,_Be=/ *\n+$/,vRt=new RegExp("^( *)("+uK+`) [\\s\\S]+?(?: -{2,}(?! )(?!\\1`+uK+` )\\n*|\\s* -*$)`),wRt=/(?:^|\n)( *)$/,lK=function(){var i=/^ *\| *| *\| *$/g,a=/ *$/,f=/^ *-+: *$/,p=/^ *:-+: *$/,w=/^ *:-+ *$/,y=function(R){return f.test(R)?"right":p.test(R)?"center":w.test(R)?"left":null},b=function(R,j,$,V){V&&(R=R.replace(i,""));var Q=R.trim().split("|");return Q.map(y)},E=function(R,j,$,V){var Q=$.inTable;$.inTable=!0;var oe=j(R.trim(),$);$.inTable=Q;var ce=[[]];return oe.forEach(function(se,ge){se.type==="tableSeparator"?(!V||ge!==0&&ge!==oe.length-1)&&ce.push([]):(se.type==="text"&&(oe[ge+1]==null||oe[ge+1].type==="tableSeparator")&&(se.content=se.content.replace(a,"")),ce[ce.length-1].push(se))}),ce},S=function(R,j,$,V){var Q=R.trim().split(` -`);return Q.map(function(oe){return E(oe,j,$,V)})},N=function(R){return function(j,$,V){V.inline=!0;var Q=E(j[1],$,V,R),oe=b(j[2],$,V,R),ce=S(j[3],$,V,R);return V.inline=!1,{type:"table",header:Q,align:oe,cells:ce}}};return{parseTable:N(!0),parseNpTable:N(!1),TABLE_REGEX:/^ *(\|.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/,NPTABLE_REGEX:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/}}(),hK="(?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*",CBe=`\\s*?(?:\\s+['"]([\\s\\S]*?)['"])?\\s*`,mRt=/mailto:/i,SBe=function(a,f,p){var w=(a[2]||a[1]).replace(/\s+/g," ").toLowerCase();if(f._defs&&f._defs[w]){var y=f._defs[w];p.target=y.target,p.title=y.title}return f._refs=f._refs||{},f._refs[w]=f._refs[w]||[],f._refs[w].push(p),p},$u=0,gP={Array:{react:function(i,a,f){for(var p=f.key,w=[],y=0,b=0;y"}},codeBlock:{order:$u++,match:Xb(/^(?: [^\n]+\n*)+(?:\n *)+\n/),parse:function(i,a,f){var p=i[0].replace(/^ /gm,"").replace(/\n+$/,"");return{lang:void 0,content:p}},react:function(i,a,f){var p=i.lang?"markdown-code-"+i.lang:void 0;return Cl("pre",f.key,{children:Cl("code",null,{className:p,children:i.content})})},html:function(i,a,f){var p=i.lang?"markdown-code-"+i.lang:void 0,w=Ah("code",nL(i.content),{class:p});return Ah("pre",w)}},fence:{order:$u++,match:Xb(/^ *(`{3,}|~{3,}) *(?:(\S+) *)?\n([\s\S]+?)\n?\1 *(?:\n *)+\n/),parse:function(i,a,f){return{type:"codeBlock",lang:i[2]||void 0,content:i[3]}},react:null,html:null},blockQuote:{order:$u++,match:Xb(/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/),parse:function(i,a,f){var p=i[0].replace(/^ *> ?/gm,"");return{content:a(p,f)}},react:function(i,a,f){return Cl("blockquote",f.key,{children:a(i.content,f)})},html:function(i,a,f){return Ah("blockquote",a(i.content,f))}},list:{order:$u++,match:function(i,a){var f=a.prevCapture==null?"":a.prevCapture[0],p=wRt.exec(f),w=a._list||!a.inline;return p&&w?(i=p[1]+i,vRt.exec(i)):null},parse:function(i,a,f){var p=i[2],w=p.length>1,y=w?+p:void 0,b=i[0].replace(bRt,` -`).match(gRt),E=!1,S=b.map(function(N,B){var R=EBe.exec(N),j=R?R[0].length:0,$=new RegExp("^ {1,"+j+"}","gm"),V=N.replace($,"").replace(EBe,""),Q=B===b.length-1,oe=V.indexOf(` - -`)!==-1,ce=oe||Q&&E;E=ce;var se=f.inline,ge=f._list;f._list=!0;var ye;ce?(f.inline=!1,ye=V.replace(_Be,` - -`)):(f.inline=!0,ye=V.replace(_Be,""));var ke=a(ye,f);return f.inline=se,f._list=ge,ke});return{ordered:w,start:y,items:S}},react:function(i,a,f){var p=i.ordered?"ol":"ul";return Cl(p,f.key,{start:i.start,children:i.items.map(function(w,y){return Cl("li",""+y,{children:a(w,f)})})})},html:function(i,a,f){var p=i.items.map(function(b){return Ah("li",a(b,f))}).join(""),w=i.ordered?"ol":"ul",y={start:i.start};return Ah(w,p,y)}},def:{order:$u++,match:Xb(/^ *\[([^\]]+)\]: *]*)>?(?: +["(]([^\n]+)[")])? *\n(?: *\n)*/),parse:function(i,a,f){var p=i[1].replace(/\s+/g," ").toLowerCase(),w=i[2],y=i[3];return f._refs&&f._refs[p]&&f._refs[p].forEach(function(b){b.target=w,b.title=y}),f._defs=f._defs||{},f._defs[p]={target:w,title:y},{def:p,target:w,title:y}},react:function(){return null},html:function(){return""}},table:{order:$u++,match:Xb(lK.TABLE_REGEX),parse:lK.parseTable,react:function(i,a,f){var p=function(E){return i.align[E]==null?{}:{textAlign:i.align[E]}},w=i.header.map(function(b,E){return Cl("th",""+E,{style:p(E),scope:"col",children:a(b,f)})}),y=i.cells.map(function(b,E){return Cl("tr",""+E,{children:b.map(function(S,N){return Cl("td",""+N,{style:p(N),children:a(S,f)})})})});return Cl("table",f.key,{children:[Cl("thead","thead",{children:Cl("tr",null,{children:w})}),Cl("tbody","tbody",{children:y})]})},html:function(i,a,f){var p=function(N){return i.align[N]==null?"":"text-align:"+i.align[N]+";"},w=i.header.map(function(S,N){return Ah("th",a(S,f),{style:p(N),scope:"col"})}).join(""),y=i.cells.map(function(S){var N=S.map(function(B,R){return Ah("td",a(B,f),{style:p(R)})}).join("");return Ah("tr",N)}).join(""),b=Ah("thead",Ah("tr",w)),E=Ah("tbody",y);return Ah("table",b+E)}},newline:{order:$u++,match:Xb(/^(?:\n *)*\n/),parse:k0e,react:function(i,a,f){return` -`},html:function(i,a,f){return` -`}},paragraph:{order:$u++,match:Xb(/^((?:[^\n]|\n(?! *\n))+)(?:\n *)+\n/),parse:cK,react:function(i,a,f){return Cl("div",f.key,{className:"paragraph",children:a(i.content,f)})},html:function(i,a,f){var p={class:"paragraph"};return Ah("div",a(i.content,f),p)}},escape:{order:$u++,match:ap(/^\\([^0-9A-Za-z\s])/),parse:function(i,a,f){return{type:"text",content:i[1]}},react:null,html:null},tableSeparator:{order:$u++,match:function(i,a){return a.inTable?/^ *\| */.exec(i):null},parse:function(){return{type:"tableSeparator"}},react:function(){return" | "},html:function(){return" | "}},autolink:{order:$u++,match:ap(/^<([^: >]+:\/[^ >]+)>/),parse:function(i,a,f){return{type:"link",content:[{type:"text",content:i[1]}],target:i[1]}},react:null,html:null},mailto:{order:$u++,match:ap(/^<([^ >]+@[^ >]+)>/),parse:function(i,a,f){var p=i[1],w=i[1];return mRt.test(w)||(w="mailto:"+w),{type:"link",content:[{type:"text",content:p}],target:w}},react:null,html:null},url:{order:$u++,match:ap(/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/),parse:function(i,a,f){return{type:"link",content:[{type:"text",content:i[1]}],target:i[1],title:void 0}},react:null,html:null},link:{order:$u++,match:ap(new RegExp("^\\[("+hK+")\\]\\("+CBe+"\\)")),parse:function(i,a,f){var p={content:a(i[1],f),target:y0e(i[2]),title:i[3]};return p},react:function(i,a,f){return Cl("a",f.key,{href:dP(i.target),title:i.title,children:a(i.content,f)})},html:function(i,a,f){var p={href:dP(i.target),title:i.title};return Ah("a",a(i.content,f),p)}},image:{order:$u++,match:ap(new RegExp("^!\\[("+hK+")\\]\\("+CBe+"\\)")),parse:function(i,a,f){var p={alt:i[1],target:y0e(i[2]),title:i[3]};return p},react:function(i,a,f){return Cl("img",f.key,{src:dP(i.target),alt:i.alt,title:i.title})},html:function(i,a,f){var p={src:dP(i.target),alt:i.alt,title:i.title};return Ah("img","",p,!1)}},reflink:{order:$u++,match:ap(new RegExp("^\\[("+hK+")\\]\\s*\\[([^\\]]*)\\]")),parse:function(i,a,f){return SBe(i,f,{type:"link",content:a(i[1],f)})},react:null,html:null},refimage:{order:$u++,match:ap(new RegExp("^!\\[("+hK+")\\]\\s*\\[([^\\]]*)\\]")),parse:function(i,a,f){return SBe(i,f,{type:"image",alt:i[1]})},react:null,html:null},em:{order:$u,match:ap(new RegExp("^\\b_((?:__|\\\\[\\s\\S]|[^\\\\_])+?)_\\b|^\\*(?=\\S)((?:\\*\\*|\\\\[\\s\\S]|\\s+(?:\\\\[\\s\\S]|[^\\s\\*\\\\]|\\*\\*)|[^\\s\\*\\\\])+?)\\*(?!\\*)")),quality:function(i){return i[0].length+.2},parse:function(i,a,f){return{content:a(i[2]||i[1],f)}},react:function(i,a,f){return Cl("em",f.key,{children:a(i.content,f)})},html:function(i,a,f){return Ah("em",a(i.content,f))}},strong:{order:$u,match:ap(/^\*\*((?:\\[\s\S]|[^\\])+?)\*\*(?!\*)/),quality:function(i){return i[0].length+.1},parse:cK,react:function(i,a,f){return Cl("strong",f.key,{children:a(i.content,f)})},html:function(i,a,f){return Ah("strong",a(i.content,f))}},u:{order:$u++,match:ap(/^__((?:\\[\s\S]|[^\\])+?)__(?!_)/),quality:function(i){return i[0].length},parse:cK,react:function(i,a,f){return Cl("u",f.key,{children:a(i.content,f)})},html:function(i,a,f){return Ah("u",a(i.content,f))}},del:{order:$u++,match:ap(/^~~(?=\S)((?:\\[\s\S]|~(?!~)|[^\s~\\]|\s(?!~~))+?)~~/),parse:cK,react:function(i,a,f){return Cl("del",f.key,{children:a(i.content,f)})},html:function(i,a,f){return Ah("del",a(i.content,f))}},inlineCode:{order:$u++,match:ap(/^(`+)([\s\S]*?[^`])\1(?!`)/),parse:function(i,a,f){return{content:i[2].replace(pRt,"$1")}},react:function(i,a,f){return Cl("code",f.key,{children:i.content})},html:function(i,a,f){return Ah("code",nL(i.content))}},br:{order:$u++,match:m0e(/^ {2,}\n/),parse:k0e,react:function(i,a,f){return Cl("br",f.key,kBe)},html:function(i,a,f){return"
    "}},text:{order:$u++,match:m0e(/^[\s\S]+?(?=[^0-9A-Za-z\s\u00c0-\uffff]|\n\n| {2,}\n|\w+:\S|$)/),parse:function(i,a,f){return{content:i[0]}},react:function(i,a,f){return i.content},html:function(i,a,f){return nL(i.content)}}},yRt=function(a,f){!f&&typeof console<"u"&&console.warn("simple-markdown ruleOutput should take 'react' or 'html' as the second argument.");var p=function(y,b,E){return a[y.type][f](y,b,E)};return p},kRt=function(a){var f=function p(w,y){if(y=y||{},Array.isArray(w)){for(var b=y.key,E=[],S=null,N=0;N{R!==0&&(y++,w.push([])),B.split(" ").forEach(j=>{j&&w[y].push({content:j,type:S||"normal"})})}):(E.type==="strong"||E.type==="em")&&E.content.forEach(N=>{b(N,E.type)})}return p.forEach(E=>{E.type==="paragraph"&&E.content.forEach(S=>{b(S)})}),w}function ARt(i){const a=DBe.defaultBlockParse,f=a(i);function p(w){return w.type==="text"?w.content.replace(/\n/g,"
    "):w.type==="strong"?`${w.content.map(p).join("")}`:w.type==="em"?`${w.content.map(p).join("")}`:w.type==="paragraph"?`

    ${w.content.map(p).join("")}

    `:""}return f.map(p).join("")}function LRt(i,a){a&&i.attr("style",a)}function MRt(i,a,f,p){const w=i.append("foreignObject"),y=w.append("xhtml:div"),b=a.label,E=a.isNode?"nodeLabel":"edgeLabel";y.html(`"+b+""),LRt(y,a.labelStyle),y.style("display","table-cell"),y.style("white-space","nowrap"),y.style("max-width",f+"px"),y.attr("xmlns","http://www.w3.org/1999/xhtml");let S=y.node().getBoundingClientRect();return S.width===f&&(y.style("display","table"),y.style("white-space","break-spaces"),y.style("width",f+"px"),S=y.node().getBoundingClientRect()),w.style("width",S.width),w.style("height",S.height),w.node()}function IBe(i,a,f){return i.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",a*f-.1+"em").attr("dy",f+"em")}function DRt(i,a,f,p=!1){const y=a.append("g");let b=y.insert("rect").attr("class","background");const E=y.append("text").attr("y","-10.1");let S=-1;if(f.forEach(N=>{S++;let B=IBe(E,S,1.1),R=[...N].reverse(),j,$=[];for(;R.length;)j=R.pop(),$.push(j),OBe(B,$),B.node().getComputedTextLength()>i&&($.pop(),R.push(j),OBe(B,$),$=[],S++,B=IBe(E,S,1.1))}),p){const N=E.node().getBBox(),B=2;return b.attr("x",-B).attr("y",-B).attr("width",N.width+2*B).attr("height",N.height+2*B),y.node()}else return E.node()}function OBe(i,a){i.text(""),a.forEach((f,p)=>{const w=i.append("tspan").attr("font-style",f.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",f.type==="strong"?"bold":"normal");p===0?w.text(f.content):w.text(" "+f.content)})}const dK=(i,a="",{style:f="",isTitle:p=!1,classes:w="",useHtmlLabels:y=!0,isNode:b=!0,width:E,addSvgBackground:S=!1}={})=>{if(Fe.info("createText",a,f,p,w,y,b,S),y){const N=ARt(a),B={isNode:b,label:XN(N).replace(/fa[blrs]?:fa-[\w-]+/g,j=>``),labelStyle:f.replace("fill:","color:")};return MRt(i,B,E,w)}else{const N=SRt(a),B=['"',"'",".",",",":",";","!","?","(",")","[","]","{","}"];let R;return N.forEach($=>{$.forEach(V=>{B.includes(V.content)&&R&&(R.content+=V.content,V.content=""),R=V})}),DRt(E,i,N,S)}},jd=async(i,a,f,p)=>{let w;const y=a.useHtmlLabels||d1(Tt().flowchart.htmlLabels);f?w=f:w="node default";const b=i.insert("g").attr("class",w).attr("id",a.domId||a.id),E=b.insert("g").attr("class","label").attr("style",a.labelStyle);let S;a.labelText===void 0?S="":S=typeof a.labelText=="string"?a.labelText:a.labelText[0];const N=E.node();let B;a.labelType==="markdown"?B=dK(E,ep(XN(S),Tt()),{useHtmlLabels:y,width:a.width||Tt().flowchart.wrappingWidth,classes:"markdown-node-label"}):B=N.appendChild(sp(ep(XN(S),Tt()),a.labelStyle,!1,p));let R=B.getBBox();const j=a.padding/2;if(d1(Tt().flowchart.htmlLabels)){const $=B.children[0],V=Cr(B),Q=$.getElementsByTagName("img");if(Q){const oe=S.replace(/]*>/g,"").trim()==="";await Promise.all([...Q].map(ce=>new Promise(se=>ce.addEventListener("load",function(){if(ce.style.display="flex",ce.style.flexDirection="column",oe){const ge=Tt().fontSize?Tt().fontSize:window.getComputedStyle(document.body).fontSize,ye=5;ce.style.width=parseInt(ge,10)*ye+"px"}else ce.style.width="100%";se(ce)}))))}R=$.getBoundingClientRect(),V.attr("width",R.width),V.attr("height",R.height)}return y?E.attr("transform","translate("+-R.width/2+", "+-R.height/2+")"):E.attr("transform","translate(0, "+-R.height/2+")"),a.centerLabel&&E.attr("transform","translate("+-R.width/2+", "+-R.height/2+")"),E.insert("rect",":first-child"),{shapeSvg:b,bbox:R,halfPadding:j,label:E}},uf=(i,a)=>{const f=a.node().getBBox();i.width=f.width,i.height=f.height};function T5(i,a,f,p){return i.insert("polygon",":first-child").attr("points",p.map(function(w){return w.x+","+w.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-a/2+","+f/2+")")}let ec={},nm={},NBe={};const IRt=()=>{nm={},NBe={},ec={}},gK=(i,a)=>(Fe.trace("In isDecendant",a," ",i," = ",nm[a].includes(i)),!!nm[a].includes(i)),ORt=(i,a)=>(Fe.info("Decendants of ",a," is ",nm[a]),Fe.info("Edge is ",i),i.v===a||i.w===a?!1:nm[a]?nm[a].includes(i.v)||gK(i.v,a)||gK(i.w,a)||nm[a].includes(i.w):(Fe.debug("Tilt, ",a,",not in decendants"),!1)),PBe=(i,a,f,p)=>{Fe.warn("Copying children of ",i,"root",p,"data",a.node(i),p);const w=a.children(i)||[];i!==p&&w.push(i),Fe.warn("Copying (nodes) clusterId",i,"nodes",w),w.forEach(y=>{if(a.children(y).length>0)PBe(y,a,f,p);else{const b=a.node(y);Fe.info("cp ",y," to ",p," with parent ",i),f.setNode(y,b),p!==a.parent(y)&&(Fe.warn("Setting parent",y,a.parent(y)),f.setParent(y,a.parent(y))),i!==p&&y!==i?(Fe.debug("Setting parent",y,i),f.setParent(y,i)):(Fe.info("In copy ",i,"root",p,"data",a.node(i),p),Fe.debug("Not Setting parent for node=",y,"cluster!==rootId",i!==p,"node!==clusterId",y!==i));const E=a.edges(y);Fe.debug("Copying Edges",E),E.forEach(S=>{Fe.info("Edge",S);const N=a.edge(S.v,S.w,S.name);Fe.info("Edge data",N,p);try{ORt(S,p)?(Fe.info("Copying as ",S.v,S.w,N,S.name),f.setEdge(S.v,S.w,N,S.name),Fe.info("newGraph edges ",f.edges(),f.edge(f.edges()[0]))):Fe.info("Skipping copy of edge ",S.v,"-->",S.w," rootId: ",p," clusterId:",i)}catch(B){Fe.error(B)}})}Fe.debug("Removing node",y),a.removeNode(y)})},BBe=(i,a)=>{const f=a.children(i);let p=[...f];for(const w of f)NBe[w]=i,p=[...p,...BBe(w,a)];return p},pP=(i,a)=>{Fe.trace("Searching",i);const f=a.children(i);if(Fe.trace("Searching children of id ",i,f),f.length<1)return Fe.trace("This is a valid node",i),i;for(const p of f){const w=pP(p,a);if(w)return Fe.trace("Found replacement for",i," => ",w),w}},pK=i=>!ec[i]||!ec[i].externalConnections?i:ec[i]?ec[i].id:i,NRt=(i,a)=>{if(!i||a>10){Fe.debug("Opting out, no graph ");return}else Fe.debug("Opting in, graph ");i.nodes().forEach(function(f){i.children(f).length>0&&(Fe.warn("Cluster identified",f," Replacement id in edges: ",pP(f,i)),nm[f]=BBe(f,i),ec[f]={id:pP(f,i),clusterData:i.node(f)})}),i.nodes().forEach(function(f){const p=i.children(f),w=i.edges();p.length>0?(Fe.debug("Cluster identified",f,nm),w.forEach(y=>{if(y.v!==f&&y.w!==f){const b=gK(y.v,f),E=gK(y.w,f);b^E&&(Fe.warn("Edge: ",y," leaves cluster ",f),Fe.warn("Decendants of XXX ",f,": ",nm[f]),ec[f].externalConnections=!0)}})):Fe.debug("Not a cluster ",f,nm)}),i.edges().forEach(function(f){const p=i.edge(f);Fe.warn("Edge "+f.v+" -> "+f.w+": "+JSON.stringify(f)),Fe.warn("Edge "+f.v+" -> "+f.w+": "+JSON.stringify(i.edge(f)));let w=f.v,y=f.w;if(Fe.warn("Fix XXX",ec,"ids:",f.v,f.w,"Translating: ",ec[f.v]," --- ",ec[f.w]),ec[f.v]&&ec[f.w]&&ec[f.v]===ec[f.w]){Fe.warn("Fixing and trixing link to self - removing XXX",f.v,f.w,f.name),Fe.warn("Fixing and trixing - removing XXX",f.v,f.w,f.name),w=pK(f.v),y=pK(f.w),i.removeEdge(f.v,f.w,f.name);const b=f.w+"---"+f.v;i.setNode(b,{domId:b,id:b,labelStyle:"",labelText:p.label,padding:0,shape:"labelRect",style:""});const E=JSON.parse(JSON.stringify(p)),S=JSON.parse(JSON.stringify(p));E.label="",E.arrowTypeEnd="none",S.label="",E.fromCluster=f.v,S.toCluster=f.v,i.setEdge(w,b,E,f.name+"-cyclic-special"),i.setEdge(b,y,S,f.name+"-cyclic-special")}else(ec[f.v]||ec[f.w])&&(Fe.warn("Fixing and trixing - removing XXX",f.v,f.w,f.name),w=pK(f.v),y=pK(f.w),i.removeEdge(f.v,f.w,f.name),w!==f.v&&(p.fromCluster=f.v),y!==f.w&&(p.toCluster=f.w),Fe.warn("Fix Replacing with XXX",w,y,f.name),i.setEdge(w,y,p,f.name))}),Fe.warn("Adjusted Graph",E5(i)),RBe(i,0),Fe.trace(ec)},RBe=(i,a)=>{if(Fe.warn("extractor - ",a,E5(i),i.children("D")),a>10){Fe.error("Bailing out");return}let f=i.nodes(),p=!1;for(const w of f){const y=i.children(w);p=p||y.length>0}if(!p){Fe.debug("Done, no node has children",i.nodes());return}Fe.debug("Nodes = ",f,a);for(const w of f)if(Fe.debug("Extracting node",w,ec,ec[w]&&!ec[w].externalConnections,!i.parent(w),i.node(w),i.children("D")," Depth ",a),!ec[w])Fe.debug("Not a cluster",w,a);else if(!ec[w].externalConnections&&i.children(w)&&i.children(w).length>0){Fe.warn("Cluster without external connections, without a parent and with children",w,a);let b=i.graph().rankdir==="TB"?"LR":"TB";ec[w]&&ec[w].clusterData&&ec[w].clusterData.dir&&(b=ec[w].clusterData.dir,Fe.warn("Fixing dir",ec[w].clusterData.dir,b));const E=new zf({multigraph:!0,compound:!0}).setGraph({rankdir:b,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});Fe.warn("Old graph before copy",E5(i)),PBe(w,i,E,w),i.setNode(w,{clusterNode:!0,id:w,clusterData:ec[w].clusterData,labelText:ec[w].labelText,graph:E}),Fe.warn("New graph after copy node: (",w,")",E5(E)),Fe.debug("Old graph after copy",E5(i))}else Fe.warn("Cluster ** ",w," **not meeting the criteria !externalConnections:",!ec[w].externalConnections," no parent: ",!i.parent(w)," children ",i.children(w)&&i.children(w).length>0,i.children("D"),a),Fe.debug(ec);f=i.nodes(),Fe.warn("New list of nodes",f);for(const w of f){const y=i.node(w);Fe.warn(" Now next level",w,y),y.clusterNode&&RBe(y.graph,a+1)}},FBe=(i,a)=>{if(a.length===0)return[];let f=Object.assign(a);return a.forEach(p=>{const w=i.children(p),y=FBe(i,w);f=[...f,...y]}),f},PRt=i=>FBe(i,i.children());function BRt(i,a){return i.intersect(a)}function jBe(i,a,f,p){var w=i.x,y=i.y,b=w-p.x,E=y-p.y,S=Math.sqrt(a*a*E*E+f*f*b*b),N=Math.abs(a*f*b/S);p.x0}function jRt(i,a,f){var p=i.x,w=i.y,y=[],b=Number.POSITIVE_INFINITY,E=Number.POSITIVE_INFINITY;typeof a.forEach=="function"?a.forEach(function(V){b=Math.min(b,V.x),E=Math.min(E,V.y)}):(b=Math.min(b,a.x),E=Math.min(E,a.y));for(var S=p-i.width/2-b,N=w-i.height/2-E,B=0;B1&&y.sort(function(V,Q){var oe=V.x-f.x,ce=V.y-f.y,se=Math.sqrt(oe*oe+ce*ce),ge=Q.x-f.x,ye=Q.y-f.y,ke=Math.sqrt(ge*ge+ye*ye);return se{var f=i.x,p=i.y,w=a.x-f,y=a.y-p,b=i.width/2,E=i.height/2,S,N;return Math.abs(y)*b>Math.abs(w)*E?(y<0&&(E=-E),S=y===0?0:E*w/y,N=E):(w<0&&(b=-b),S=b,N=w===0?0:b*y/w),{x:f+S,y:p+N}},Lh={node:BRt,circle:RRt,ellipse:jBe,polygon:jRt,rect:bP},$Rt=async(i,a)=>{a.useHtmlLabels||Tt().flowchart.htmlLabels||(a.centerLabel=!0);const{shapeSvg:p,bbox:w,halfPadding:y}=await jd(i,a,"node "+a.classes,!0);Fe.info("Classes = ",a.classes);const b=p.insert("rect",":first-child");return b.attr("rx",a.rx).attr("ry",a.ry).attr("x",-w.width/2-y).attr("y",-w.height/2-y).attr("width",w.width+a.padding).attr("height",w.height+a.padding),uf(a,b),a.intersect=function(E){return Lh.rect(a,E)},p};let HBe=0;const HRt=function(i,a,f,p,w){const y=function(se){switch(se){case w.db.relationType.AGGREGATION:return"aggregation";case w.db.relationType.EXTENSION:return"extension";case w.db.relationType.COMPOSITION:return"composition";case w.db.relationType.DEPENDENCY:return"dependency";case w.db.relationType.LOLLIPOP:return"lollipop"}};a.points=a.points.filter(se=>!Number.isNaN(se.y));const b=a.points,E=WE().x(function(se){return se.x}).y(function(se){return se.y}).curve(SA),S=i.append("path").attr("d",E(b)).attr("id","edge"+HBe).attr("class","relation");let N="";p.arrowMarkerAbsolute&&(N=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,N=N.replace(/\(/g,"\\("),N=N.replace(/\)/g,"\\)")),f.relation.lineType==1&&S.attr("class","relation dashed-line"),f.relation.lineType==10&&S.attr("class","relation dotted-line"),f.relation.type1!=="none"&&S.attr("marker-start","url("+N+"#"+y(f.relation.type1)+"Start)"),f.relation.type2!=="none"&&S.attr("marker-end","url("+N+"#"+y(f.relation.type2)+"End)");let B,R;const j=a.points.length;let $=co.calcLabelPosition(a.points);B=$.x,R=$.y;let V,Q,oe,ce;if(j%2!==0&&j>1){let se=co.calcCardinalityPosition(f.relation.type1!=="none",a.points,a.points[0]),ge=co.calcCardinalityPosition(f.relation.type2!=="none",a.points,a.points[j-1]);Fe.debug("cardinality_1_point "+JSON.stringify(se)),Fe.debug("cardinality_2_point "+JSON.stringify(ge)),V=se.x,Q=se.y,oe=ge.x,ce=ge.y}if(f.title!==void 0){const se=i.append("g").attr("class","classLabel"),ge=se.append("text").attr("class","label").attr("x",B).attr("y",R).attr("fill","red").attr("text-anchor","middle").text(f.title);window.label=ge;const ye=ge.node().getBBox();se.insert("rect",":first-child").attr("class","box").attr("x",ye.x-p.padding/2).attr("y",ye.y-p.padding/2).attr("width",ye.width+p.padding).attr("height",ye.height+p.padding)}Fe.info("Rendering relation "+JSON.stringify(f)),f.relationTitle1!==void 0&&f.relationTitle1!=="none"&&i.append("g").attr("class","cardinality").append("text").attr("class","type1").attr("x",V).attr("y",Q).attr("fill","black").attr("font-size","6").text(f.relationTitle1),f.relationTitle2!==void 0&&f.relationTitle2!=="none"&&i.append("g").attr("class","cardinality").append("text").attr("class","type2").attr("x",oe).attr("y",ce).attr("fill","black").attr("font-size","6").text(f.relationTitle2),HBe++},zRt=function(i,a,f,p){Fe.debug("Rendering class ",a,f);const w=a.id,y={id:w,label:a.id,width:0,height:0},b=i.append("g").attr("id",p.db.lookUpDomId(w)).attr("class","classGroup");let E;a.link?E=b.append("svg:a").attr("xlink:href",a.link).attr("target",a.linkTarget).append("text").attr("y",f.textHeight+f.padding).attr("x",0):E=b.append("text").attr("y",f.textHeight+f.padding).attr("x",0);let S=!0;a.annotations.forEach(function(ke){const Ae=E.append("tspan").text("«"+ke+"»");S||Ae.attr("dy",f.textHeight),S=!1});let N=zBe(a);const B=E.append("tspan").text(N).attr("class","title");S||B.attr("dy",f.textHeight);const R=E.node().getBBox().height,j=b.append("line").attr("x1",0).attr("y1",f.padding+R+f.dividerMargin/2).attr("y2",f.padding+R+f.dividerMargin/2),$=b.append("text").attr("x",f.padding).attr("y",R+f.dividerMargin+f.textHeight).attr("fill","white").attr("class","classText");S=!0,a.members.forEach(function(ke){GBe($,ke,S,f),S=!1});const V=$.node().getBBox(),Q=b.append("line").attr("x1",0).attr("y1",f.padding+R+f.dividerMargin+V.height).attr("y2",f.padding+R+f.dividerMargin+V.height),oe=b.append("text").attr("x",f.padding).attr("y",R+2*f.dividerMargin+V.height+f.textHeight).attr("fill","white").attr("class","classText");S=!0,a.methods.forEach(function(ke){GBe(oe,ke,S,f),S=!1});const ce=b.node().getBBox();var se=" ";a.cssClasses.length>0&&(se=se+a.cssClasses.join(" "));const ye=b.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",ce.width+2*f.padding).attr("height",ce.height+f.padding+.5*f.dividerMargin).attr("class",se).node().getBBox().width;return E.node().childNodes.forEach(function(ke){ke.setAttribute("x",(ye-ke.getBBox().width)/2)}),a.tooltip&&E.insert("title").text(a.tooltip),j.attr("x2",ye),Q.attr("x2",ye),y.width=ye,y.height=ce.height+f.padding+.5*f.dividerMargin,y},zBe=function(i){let a=i.id;return i.type&&(a+="<"+i.type+">"),a},GRt=function(i,a,f,p){Fe.debug("Rendering note ",a,f);const w=a.id,y={id:w,text:a.text,width:0,height:0},b=i.append("g").attr("id",w).attr("class","classGroup");let E=b.append("text").attr("y",f.textHeight+f.padding).attr("x",0);const S=JSON.parse(`"${a.text}"`).split(` -`);S.forEach(function(j){Fe.debug(`Adding line: ${j}`),E.append("tspan").text(j).attr("class","title").attr("dy",f.textHeight)});const N=b.node().getBBox(),R=b.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",N.width+2*f.padding).attr("height",N.height+S.length*f.textHeight+f.padding+.5*f.dividerMargin).node().getBBox().width;return E.node().childNodes.forEach(function(j){j.setAttribute("x",(R-j.getBBox().width)/2)}),y.width=R,y.height=N.height+S.length*f.textHeight+f.padding+.5*f.dividerMargin,y},bK=function(i){const a=/^([#+~-])?(\w+)(~\w+~|\[])?\s+(\w+) *([$*])?$/,f=/^([#+|~-])?(\w+) *\( *(.*)\) *([$*])? *(\w*[[\]|~]*\s*\w*~?)$/;let p=i.match(a),w=i.match(f);return p&&!w?qRt(p):w?VRt(w):URt(i)},qRt=function(i){let a="",f="";try{let p=i[1]?i[1].trim():"",w=i[2]?i[2].trim():"",y=i[3]?Yk(i[3].trim()):"",b=i[4]?i[4].trim():"",E=i[5]?i[5].trim():"";f=p+w+y+" "+b,a=vK(E)}catch{f=i}return{displayText:f,cssStyle:a}},VRt=function(i){let a="",f="";try{let p=i[1]?i[1].trim():"",w=i[2]?i[2].trim():"",y=i[3]?Yk(i[3].trim()):"",b=i[4]?i[4].trim():"",E=i[5]?" : "+Yk(i[5]).trim():"";f=p+w+"("+y+")"+E,a=vK(b)}catch{f=i}return{displayText:f,cssStyle:a}},URt=function(i){let a="",f="",p="",w="",y=i.substring(0,1),b=i.substring(i.length-1,i.length);y.match(/[#+~-]/)&&(w=y);let E=/[\s\w)~]/;b.match(E)||(f=vK(b));let S=w===""?0:1,N=f===""?i.length:i.length-1;i=i.substring(S,N);let B=i.indexOf("("),R=i.indexOf(")");if(B>1&&R>B&&R<=i.length){let j=i.substring(0,B).trim();const $=i.substring(B+1,R);if(a=w+j+"("+Yk($.trim())+")",R{const{shapeSvg:f,bbox:p}=await jd(i,a,void 0,!0),w=p.width+a.padding,y=p.height+a.padding,b=w+y,E=[{x:b/2,y:0},{x:b,y:-b/2},{x:b/2,y:-b},{x:0,y:-b/2}];Fe.info("Question main (Circle)");const S=T5(f,b,b,E);return S.attr("style",a.style),uf(a,S),a.intersect=function(N){return Fe.warn("Intersect called"),Lh.polygon(a,E,N)},f},WRt=(i,a)=>{const f=i.insert("g").attr("class","node default").attr("id",a.domId||a.id),p=28,w=[{x:0,y:p/2},{x:p/2,y:0},{x:0,y:-p/2},{x:-p/2,y:0}];return f.insert("polygon",":first-child").attr("points",w.map(function(b){return b.x+","+b.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),a.width=28,a.height=28,a.intersect=function(b){return Lh.circle(a,14,b)},f},KRt=async(i,a)=>{const{shapeSvg:f,bbox:p}=await jd(i,a,void 0,!0),w=4,y=p.height+a.padding,b=y/w,E=p.width+2*b+a.padding,S=[{x:b,y:0},{x:E-b,y:0},{x:E,y:-y/2},{x:E-b,y:-y},{x:b,y:-y},{x:0,y:-y/2}],N=T5(f,E,y,S);return N.attr("style",a.style),uf(a,N),a.intersect=function(B){return Lh.polygon(a,S,B)},f},YRt=async(i,a)=>{const{shapeSvg:f,bbox:p}=await jd(i,a,void 0,!0),w=p.width+a.padding,y=p.height+a.padding,b=[{x:-y/2,y:0},{x:w,y:0},{x:w,y:-y},{x:-y/2,y:-y},{x:0,y:-y/2}];return T5(f,w,y,b).attr("style",a.style),a.width=w+y,a.height=y,a.intersect=function(S){return Lh.polygon(a,b,S)},f},XRt=async(i,a)=>{const{shapeSvg:f,bbox:p}=await jd(i,a,void 0,!0),w=p.width+a.padding,y=p.height+a.padding,b=[{x:-2*y/6,y:0},{x:w-y/6,y:0},{x:w+2*y/6,y:-y},{x:y/6,y:-y}],E=T5(f,w,y,b);return E.attr("style",a.style),uf(a,E),a.intersect=function(S){return Lh.polygon(a,b,S)},f},QRt=async(i,a)=>{const{shapeSvg:f,bbox:p}=await jd(i,a,void 0,!0),w=p.width+a.padding,y=p.height+a.padding,b=[{x:2*y/6,y:0},{x:w+y/6,y:0},{x:w-2*y/6,y:-y},{x:-y/6,y:-y}],E=T5(f,w,y,b);return E.attr("style",a.style),uf(a,E),a.intersect=function(S){return Lh.polygon(a,b,S)},f},ZRt=async(i,a)=>{const{shapeSvg:f,bbox:p}=await jd(i,a,void 0,!0),w=p.width+a.padding,y=p.height+a.padding,b=[{x:-2*y/6,y:0},{x:w+2*y/6,y:0},{x:w-y/6,y:-y},{x:y/6,y:-y}],E=T5(f,w,y,b);return E.attr("style",a.style),uf(a,E),a.intersect=function(S){return Lh.polygon(a,b,S)},f},JRt=async(i,a)=>{const{shapeSvg:f,bbox:p}=await jd(i,a,void 0,!0),w=p.width+a.padding,y=p.height+a.padding,b=[{x:y/6,y:0},{x:w-y/6,y:0},{x:w+2*y/6,y:-y},{x:-2*y/6,y:-y}],E=T5(f,w,y,b);return E.attr("style",a.style),uf(a,E),a.intersect=function(S){return Lh.polygon(a,b,S)},f},eFt=async(i,a)=>{const{shapeSvg:f,bbox:p}=await jd(i,a,void 0,!0),w=p.width+a.padding,y=p.height+a.padding,b=[{x:0,y:0},{x:w+y/2,y:0},{x:w,y:-y/2},{x:w+y/2,y:-y},{x:0,y:-y}],E=T5(f,w,y,b);return E.attr("style",a.style),uf(a,E),a.intersect=function(S){return Lh.polygon(a,b,S)},f},tFt=async(i,a)=>{const{shapeSvg:f,bbox:p}=await jd(i,a,void 0,!0),w=p.width+a.padding,y=w/2,b=y/(2.5+w/50),E=p.height+b+a.padding,S="M 0,"+b+" a "+y+","+b+" 0,0,0 "+w+" 0 a "+y+","+b+" 0,0,0 "+-w+" 0 l 0,"+E+" a "+y+","+b+" 0,0,0 "+w+" 0 l 0,"+-E,N=f.attr("label-offset-y",b).insert("path",":first-child").attr("style",a.style).attr("d",S).attr("transform","translate("+-w/2+","+-(E/2+b)+")");return uf(a,N),a.intersect=function(B){const R=Lh.rect(a,B),j=R.x-a.x;if(y!=0&&(Math.abs(j)a.height/2-b)){let $=b*b*(1-j*j/(y*y));$!=0&&($=Math.sqrt($)),$=b-$,B.y-a.y>0&&($=-$),R.y+=$}return R},f},nFt=async(i,a)=>{const{shapeSvg:f,bbox:p,halfPadding:w}=await jd(i,a,"node "+a.classes,!0),y=f.insert("rect",":first-child"),b=p.width+a.padding,E=p.height+a.padding;if(y.attr("class","basic label-container").attr("style",a.style).attr("rx",a.rx).attr("ry",a.ry).attr("x",-p.width/2-w).attr("y",-p.height/2-w).attr("width",b).attr("height",E),a.props){const S=new Set(Object.keys(a.props));a.props.borders&&(VBe(y,a.props.borders,b,E),S.delete("borders")),S.forEach(N=>{Fe.warn(`Unknown node property ${N}`)})}return uf(a,y),a.intersect=function(S){return Lh.rect(a,S)},f},rFt=async(i,a)=>{const{shapeSvg:f}=await jd(i,a,"label",!0);Fe.trace("Classes = ",a.classes);const p=f.insert("rect",":first-child"),w=0,y=0;if(p.attr("width",w).attr("height",y),f.attr("class","label edgeLabel"),a.props){const b=new Set(Object.keys(a.props));a.props.borders&&(VBe(p,a.props.borders,w,y),b.delete("borders")),b.forEach(E=>{Fe.warn(`Unknown node property ${E}`)})}return uf(a,p),a.intersect=function(b){return Lh.rect(a,b)},f};function VBe(i,a,f,p){const w=[],y=E=>{w.push(E,0)},b=E=>{w.push(0,E)};a.includes("t")?(Fe.debug("add top border"),y(f)):b(f),a.includes("r")?(Fe.debug("add right border"),y(p)):b(p),a.includes("b")?(Fe.debug("add bottom border"),y(f)):b(f),a.includes("l")?(Fe.debug("add left border"),y(p)):b(p),i.attr("stroke-dasharray",w.join(" "))}const iFt=(i,a)=>{let f;a.classes?f="node "+a.classes:f="node default";const p=i.insert("g").attr("class",f).attr("id",a.domId||a.id),w=p.insert("rect",":first-child"),y=p.insert("line"),b=p.insert("g").attr("class","label"),E=a.labelText.flat?a.labelText.flat():a.labelText;let S="";typeof E=="object"?S=E[0]:S=E,Fe.info("Label text abc79",S,E,typeof E=="object");const N=b.node().appendChild(sp(S,a.labelStyle,!0,!0));let B={width:0,height:0};if(d1(Tt().flowchart.htmlLabels)){const Q=N.children[0],oe=Cr(N);B=Q.getBoundingClientRect(),oe.attr("width",B.width),oe.attr("height",B.height)}Fe.info("Text 2",E);const R=E.slice(1,E.length);let j=N.getBBox();const $=b.node().appendChild(sp(R.join?R.join("
    "):R,a.labelStyle,!0,!0));if(d1(Tt().flowchart.htmlLabels)){const Q=$.children[0],oe=Cr($);B=Q.getBoundingClientRect(),oe.attr("width",B.width),oe.attr("height",B.height)}const V=a.padding/2;return Cr($).attr("transform","translate( "+(B.width>j.width?0:(j.width-B.width)/2)+", "+(j.height+V+5)+")"),Cr(N).attr("transform","translate( "+(B.width{const{shapeSvg:f,bbox:p}=await jd(i,a,void 0,!0),w=p.height+a.padding,y=p.width+w/4+a.padding,b=f.insert("rect",":first-child").attr("style",a.style).attr("rx",w/2).attr("ry",w/2).attr("x",-y/2).attr("y",-w/2).attr("width",y).attr("height",w);return uf(a,b),a.intersect=function(E){return Lh.rect(a,E)},f},aFt=async(i,a)=>{const{shapeSvg:f,bbox:p,halfPadding:w}=await jd(i,a,void 0,!0),y=f.insert("circle",":first-child");return y.attr("style",a.style).attr("rx",a.rx).attr("ry",a.ry).attr("r",p.width/2+w).attr("width",p.width+a.padding).attr("height",p.height+a.padding),Fe.info("Circle main"),uf(a,y),a.intersect=function(b){return Fe.info("Circle intersect",a,p.width/2+w,b),Lh.circle(a,p.width/2+w,b)},f},oFt=async(i,a)=>{const{shapeSvg:f,bbox:p,halfPadding:w}=await jd(i,a,void 0,!0),y=5,b=f.insert("g",":first-child"),E=b.insert("circle"),S=b.insert("circle");return E.attr("style",a.style).attr("rx",a.rx).attr("ry",a.ry).attr("r",p.width/2+w+y).attr("width",p.width+a.padding+y*2).attr("height",p.height+a.padding+y*2),S.attr("style",a.style).attr("rx",a.rx).attr("ry",a.ry).attr("r",p.width/2+w).attr("width",p.width+a.padding).attr("height",p.height+a.padding),Fe.info("DoubleCircle main"),uf(a,E),a.intersect=function(N){return Fe.info("DoubleCircle intersect",a,p.width/2+w+y,N),Lh.circle(a,p.width/2+w+y,N)},f},cFt=async(i,a)=>{const{shapeSvg:f,bbox:p}=await jd(i,a,void 0,!0),w=p.width+a.padding,y=p.height+a.padding,b=[{x:0,y:0},{x:w,y:0},{x:w,y:-y},{x:0,y:-y},{x:0,y:0},{x:-8,y:0},{x:w+8,y:0},{x:w+8,y:-y},{x:-8,y:-y},{x:-8,y:0}],E=T5(f,w,y,b);return E.attr("style",a.style),uf(a,E),a.intersect=function(S){return Lh.polygon(a,b,S)},f},uFt=(i,a)=>{const f=i.insert("g").attr("class","node default").attr("id",a.domId||a.id),p=f.insert("circle",":first-child");return p.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),uf(a,p),a.intersect=function(w){return Lh.circle(a,7,w)},f},UBe=(i,a,f)=>{const p=i.insert("g").attr("class","node default").attr("id",a.domId||a.id);let w=70,y=10;f==="LR"&&(w=10,y=70);const b=p.append("rect").attr("x",-1*w/2).attr("y",-1*y/2).attr("width",w).attr("height",y).attr("class","fork-join");return uf(a,b),a.height=a.height+a.padding/2,a.width=a.width+a.padding/2,a.intersect=function(E){return Lh.rect(a,E)},p},WBe={rhombus:qBe,question:qBe,rect:nFt,labelRect:rFt,rectWithTitle:iFt,choice:WRt,circle:aFt,doublecircle:oFt,stadium:sFt,hexagon:KRt,rect_left_inv_arrow:YRt,lean_right:XRt,lean_left:QRt,trapezoid:ZRt,inv_trapezoid:JRt,rect_right_inv_arrow:eFt,cylinder:tFt,start:uFt,end:(i,a)=>{const f=i.insert("g").attr("class","node default").attr("id",a.domId||a.id),p=f.insert("circle",":first-child"),w=f.insert("circle",":first-child");return w.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),p.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),uf(a,w),a.intersect=function(y){return Lh.circle(a,7,y)},f},note:$Rt,subroutine:cFt,fork:UBe,join:UBe,class_box:(i,a)=>{const f=a.padding/2,p=4,w=8;let y;a.classes?y="node "+a.classes:y="node default";const b=i.insert("g").attr("class",y).attr("id",a.domId||a.id),E=b.insert("rect",":first-child"),S=b.insert("line"),N=b.insert("line");let B=0,R=p;const j=b.insert("g").attr("class","label");let $=0;const V=a.classData.annotations&&a.classData.annotations[0],Q=a.classData.annotations[0]?"«"+a.classData.annotations[0]+"»":"",oe=j.node().appendChild(sp(Q,a.labelStyle,!0,!0));let ce=oe.getBBox();if(d1(Tt().flowchart.htmlLabels)){const ve=oe.children[0],te=Cr(oe);ce=ve.getBoundingClientRect(),te.attr("width",ce.width),te.attr("height",ce.height)}a.classData.annotations[0]&&(R+=ce.height+p,B+=ce.width);let se=a.classData.label;a.classData.type!==void 0&&a.classData.type!==""&&(Tt().flowchart.htmlLabels?se+="<"+a.classData.type+">":se+="<"+a.classData.type+">");const ge=j.node().appendChild(sp(se,a.labelStyle,!0,!0));Cr(ge).attr("class","classTitle");let ye=ge.getBBox();if(d1(Tt().flowchart.htmlLabels)){const ve=ge.children[0],te=Cr(ge);ye=ve.getBoundingClientRect(),te.attr("width",ye.width),te.attr("height",ye.height)}R+=ye.height+p,ye.width>B&&(B=ye.width);const ke=[];a.classData.members.forEach(ve=>{const te=bK(ve);let xe=te.displayText;Tt().flowchart.htmlLabels&&(xe=xe.replace(//g,">"));const De=j.node().appendChild(sp(xe,te.cssStyle?te.cssStyle:a.labelStyle,!0,!0));let he=De.getBBox();if(d1(Tt().flowchart.htmlLabels)){const Ie=De.children[0],ee=Cr(De);he=Ie.getBoundingClientRect(),ee.attr("width",he.width),ee.attr("height",he.height)}he.width>B&&(B=he.width),R+=he.height+p,ke.push(De)}),R+=w;const Ae=[];if(a.classData.methods.forEach(ve=>{const te=bK(ve);let xe=te.displayText;Tt().flowchart.htmlLabels&&(xe=xe.replace(//g,">"));const De=j.node().appendChild(sp(xe,te.cssStyle?te.cssStyle:a.labelStyle,!0,!0));let he=De.getBBox();if(d1(Tt().flowchart.htmlLabels)){const Ie=De.children[0],ee=Cr(De);he=Ie.getBoundingClientRect(),ee.attr("width",he.width),ee.attr("height",he.height)}he.width>B&&(B=he.width),R+=he.height+p,Ae.push(De)}),R+=w,V){let ve=(B-ce.width)/2;Cr(oe).attr("transform","translate( "+(-1*B/2+ve)+", "+-1*R/2+")"),$=ce.height+p}let de=(B-ye.width)/2;return Cr(ge).attr("transform","translate( "+(-1*B/2+de)+", "+(-1*R/2+$)+")"),$+=ye.height+p,S.attr("class","divider").attr("x1",-B/2-f).attr("x2",B/2+f).attr("y1",-R/2-f+w+$).attr("y2",-R/2-f+w+$),$+=w,ke.forEach(ve=>{Cr(ve).attr("transform","translate( "+-B/2+", "+(-1*R/2+$+w/2)+")"),$+=ye.height+p}),$+=w,N.attr("class","divider").attr("x1",-B/2-f).attr("x2",B/2+f).attr("y1",-R/2-f+w+$).attr("y2",-R/2-f+w+$),$+=w,Ae.forEach(ve=>{Cr(ve).attr("transform","translate( "+-B/2+", "+(-1*R/2+$)+")"),$+=ye.height+p}),E.attr("class","outer title-state").attr("x",-B/2-f).attr("y",-(R/2)-f).attr("width",B+a.padding).attr("height",R+a.padding),uf(a,E),a.intersect=function(ve){return Lh.rect(a,ve)},b}};let rL={};const KBe=async(i,a,f)=>{let p,w;if(a.link){let y;Tt().securityLevel==="sandbox"?y="_top":a.linkTarget&&(y=a.linkTarget||"_blank"),p=i.insert("svg:a").attr("xlink:href",a.link).attr("target",y),w=await WBe[a.shape](p,a,f)}else w=await WBe[a.shape](i,a,f),p=w;return a.tooltip&&w.attr("title",a.tooltip),a.class&&w.attr("class","node default "+a.class),rL[a.id]=p,a.haveCallback&&rL[a.id].attr("class",rL[a.id].attr("class")+" clickable"),p},lFt=(i,a)=>{rL[a.id]=i},hFt=()=>{rL={}},YBe=i=>{const a=rL[i.id];Fe.trace("Transforming node",i.diff,i,"translate("+(i.x-i.width/2-5)+", "+i.width/2+")");const f=8,p=i.diff||0;return i.clusterNode?a.attr("transform","translate("+(i.x+p-i.width/2)+", "+(i.y-i.height/2-f)+")"):a.attr("transform","translate("+i.x+", "+i.y+")"),p},fFt={rect:(i,a)=>{Fe.info("Creating subgraph rect for ",a.id,a);const f=i.insert("g").attr("class","cluster"+(a.class?" "+a.class:"")).attr("id",a.id),p=f.insert("rect",":first-child"),w=d1(Tt().flowchart.htmlLabels),y=f.insert("g").attr("class","cluster-label"),b=a.labelType==="markdown"?dK(y,a.labelText,{style:a.labelStyle,useHtmlLabels:w}):y.node().appendChild(sp(a.labelText,a.labelStyle,void 0,!0));let E=b.getBBox();if(d1(Tt().flowchart.htmlLabels)){const j=b.children[0],$=Cr(b);E=j.getBoundingClientRect(),$.attr("width",E.width),$.attr("height",E.height)}const S=0*a.padding,N=S/2,B=a.width<=E.width+S?E.width+S:a.width;a.width<=E.width+S?a.diff=(E.width-a.width)/2-a.padding/2:a.diff=-a.padding/2,Fe.trace("Data ",a,JSON.stringify(a)),p.attr("style",a.style).attr("rx",a.rx).attr("ry",a.ry).attr("x",a.x-B/2).attr("y",a.y-a.height/2-N).attr("width",B).attr("height",a.height+S),w?y.attr("transform","translate("+(a.x-E.width/2)+", "+(a.y-a.height/2)+")"):y.attr("transform","translate("+a.x+", "+(a.y-a.height/2)+")");const R=p.node().getBBox();return a.width=R.width,a.height=R.height,a.intersect=function(j){return bP(a,j)},f},roundedWithTitle:(i,a)=>{const f=i.insert("g").attr("class",a.classes).attr("id",a.id),p=f.insert("rect",":first-child"),w=f.insert("g").attr("class","cluster-label"),y=f.append("rect"),b=w.node().appendChild(sp(a.labelText,a.labelStyle,void 0,!0));let E=b.getBBox();if(d1(Tt().flowchart.htmlLabels)){const j=b.children[0],$=Cr(b);E=j.getBoundingClientRect(),$.attr("width",E.width),$.attr("height",E.height)}E=b.getBBox();const S=0*a.padding,N=S/2,B=a.width<=E.width+a.padding?E.width+a.padding:a.width;a.width<=E.width+a.padding?a.diff=(E.width+a.padding*0-a.width)/2:a.diff=-a.padding/2,p.attr("class","outer").attr("x",a.x-B/2-N).attr("y",a.y-a.height/2-N).attr("width",B+S).attr("height",a.height+S),y.attr("class","inner").attr("x",a.x-B/2-N).attr("y",a.y-a.height/2-N+E.height-1).attr("width",B+S).attr("height",a.height+S-E.height-3),w.attr("transform","translate("+(a.x-E.width/2)+", "+(a.y-a.height/2-a.padding/3+(d1(Tt().flowchart.htmlLabels)?5:3))+")");const R=p.node().getBBox();return a.height=R.height,a.intersect=function(j){return bP(a,j)},f},noteGroup:(i,a)=>{const f=i.insert("g").attr("class","note-cluster").attr("id",a.id),p=f.insert("rect",":first-child"),w=0*a.padding,y=w/2;p.attr("rx",a.rx).attr("ry",a.ry).attr("x",a.x-a.width/2-y).attr("y",a.y-a.height/2-y).attr("width",a.width+w).attr("height",a.height+w).attr("fill","none");const b=p.node().getBBox();return a.width=b.width,a.height=b.height,a.intersect=function(E){return bP(a,E)},f},divider:(i,a)=>{const f=i.insert("g").attr("class",a.classes).attr("id",a.id),p=f.insert("rect",":first-child"),w=0*a.padding,y=w/2;p.attr("class","divider").attr("x",a.x-a.width/2-y).attr("y",a.y-a.height/2).attr("width",a.width+w).attr("height",a.height+w);const b=p.node().getBBox();return a.width=b.width,a.height=b.height,a.diff=-a.padding/2,a.intersect=function(E){return bP(a,E)},f}};let XBe={};const dFt=(i,a)=>{Fe.trace("Inserting cluster");const f=a.shape||"rect";XBe[a.id]=fFt[f](i,a)},gFt=()=>{XBe={}};let wK={},$d={};const pFt=()=>{wK={},$d={}},QBe=(i,a)=>{const f=d1(Tt().flowchart.htmlLabels),p=a.labelType==="markdown"?dK(i,a.label,{style:a.labelStyle,useHtmlLabels:f,addSvgBackground:!0}):sp(a.label,a.labelStyle);Fe.info("abc82",a,a.labelType);const w=i.insert("g").attr("class","edgeLabel"),y=w.insert("g").attr("class","label");y.node().appendChild(p);let b=p.getBBox();if(f){const S=p.children[0],N=Cr(p);b=S.getBoundingClientRect(),N.attr("width",b.width),N.attr("height",b.height)}y.attr("transform","translate("+-b.width/2+", "+-b.height/2+")"),wK[a.id]=w,a.width=b.width,a.height=b.height;let E;if(a.startLabelLeft){const S=sp(a.startLabelLeft,a.labelStyle),N=i.insert("g").attr("class","edgeTerminals"),B=N.insert("g").attr("class","inner");E=B.node().appendChild(S);const R=S.getBBox();B.attr("transform","translate("+-R.width/2+", "+-R.height/2+")"),$d[a.id]||($d[a.id]={}),$d[a.id].startLeft=N,mK(E,a.startLabelLeft)}if(a.startLabelRight){const S=sp(a.startLabelRight,a.labelStyle),N=i.insert("g").attr("class","edgeTerminals"),B=N.insert("g").attr("class","inner");E=N.node().appendChild(S),B.node().appendChild(S);const R=S.getBBox();B.attr("transform","translate("+-R.width/2+", "+-R.height/2+")"),$d[a.id]||($d[a.id]={}),$d[a.id].startRight=N,mK(E,a.startLabelRight)}if(a.endLabelLeft){const S=sp(a.endLabelLeft,a.labelStyle),N=i.insert("g").attr("class","edgeTerminals"),B=N.insert("g").attr("class","inner");E=B.node().appendChild(S);const R=S.getBBox();B.attr("transform","translate("+-R.width/2+", "+-R.height/2+")"),N.node().appendChild(S),$d[a.id]||($d[a.id]={}),$d[a.id].endLeft=N,mK(E,a.endLabelLeft)}if(a.endLabelRight){const S=sp(a.endLabelRight,a.labelStyle),N=i.insert("g").attr("class","edgeTerminals"),B=N.insert("g").attr("class","inner");E=B.node().appendChild(S);const R=S.getBBox();B.attr("transform","translate("+-R.width/2+", "+-R.height/2+")"),N.node().appendChild(S),$d[a.id]||($d[a.id]={}),$d[a.id].endRight=N,mK(E,a.endLabelRight)}return p};function mK(i,a){Tt().flowchart.htmlLabels&&i&&(i.style.width=a.length*9+"px",i.style.height="12px")}const bFt=(i,a)=>{Fe.info("Moving label abc78 ",i.id,i.label,wK[i.id]);let f=a.updatedPath?a.updatedPath:a.originalPath;if(i.label){const p=wK[i.id];let w=i.x,y=i.y;if(f){const b=co.calcLabelPosition(f);Fe.info("Moving label "+i.label+" from (",w,",",y,") to (",b.x,",",b.y,") abc78"),a.updatedPath&&(w=b.x,y=b.y)}p.attr("transform","translate("+w+", "+y+")")}if(i.startLabelLeft){const p=$d[i.id].startLeft;let w=i.x,y=i.y;if(f){const b=co.calcTerminalLabelPosition(i.arrowTypeStart?10:0,"start_left",f);w=b.x,y=b.y}p.attr("transform","translate("+w+", "+y+")")}if(i.startLabelRight){const p=$d[i.id].startRight;let w=i.x,y=i.y;if(f){const b=co.calcTerminalLabelPosition(i.arrowTypeStart?10:0,"start_right",f);w=b.x,y=b.y}p.attr("transform","translate("+w+", "+y+")")}if(i.endLabelLeft){const p=$d[i.id].endLeft;let w=i.x,y=i.y;if(f){const b=co.calcTerminalLabelPosition(i.arrowTypeEnd?10:0,"end_left",f);w=b.x,y=b.y}p.attr("transform","translate("+w+", "+y+")")}if(i.endLabelRight){const p=$d[i.id].endRight;let w=i.x,y=i.y;if(f){const b=co.calcTerminalLabelPosition(i.arrowTypeEnd?10:0,"end_right",f);w=b.x,y=b.y}p.attr("transform","translate("+w+", "+y+")")}},vFt=(i,a)=>{const f=i.x,p=i.y,w=Math.abs(a.x-f),y=Math.abs(a.y-p),b=i.width/2,E=i.height/2;return w>=b||y>=E},wFt=(i,a,f)=>{Fe.warn(`intersection calc abc89: - outsidePoint: ${JSON.stringify(a)} - insidePoint : ${JSON.stringify(f)} - node : x:${i.x} y:${i.y} w:${i.width} h:${i.height}`);const p=i.x,w=i.y,y=Math.abs(p-f.x),b=i.width/2;let E=f.xMath.abs(p-a.x)*S){let R=f.y{Fe.warn("abc88 cutPathAtIntersect",i,a);let f=[],p=i[0],w=!1;return i.forEach(y=>{if(Fe.info("abc88 checking point",y,a),!vFt(a,y)&&!w){const b=wFt(a,p,y);Fe.warn("abc88 inside",y,p,b),Fe.warn("abc88 intersection",b);let E=!1;f.forEach(S=>{E=E||S.x===b.x&&S.y===b.y}),f.some(S=>S.x===b.x&&S.y===b.y)?Fe.warn("abc88 no intersect",b,f):f.push(b),w=!0}else Fe.warn("abc88 outside",y,p),p=y,w||f.push(y)}),Fe.warn("abc88 returning points",f),f},mFt=function(i,a,f,p,w,y){let b=f.points,E=!1;const S=y.node(a.v);var N=y.node(a.w);Fe.info("abc88 InsertEdge: ",f),N.intersect&&S.intersect&&(b=b.slice(1,f.points.length-1),b.unshift(S.intersect(b[0])),Fe.info("Last point",b[b.length-1],N,N.intersect(b[b.length-1])),b.push(N.intersect(b[b.length-1]))),f.toCluster&&(Fe.info("to cluster abc88",p[f.toCluster]),b=ZBe(f.points,p[f.toCluster].node),E=!0),f.fromCluster&&(Fe.info("from cluster abc88",p[f.fromCluster]),b=ZBe(b.reverse(),p[f.fromCluster].node).reverse(),E=!0);const B=b.filter(ce=>!Number.isNaN(ce.y));let R;w==="graph"||w==="flowchart"?R=f.curve||SA:R=SA;const j=WE().x(function(ce){return ce.x}).y(function(ce){return ce.y}).curve(R);let $;switch(f.thickness){case"normal":$="edge-thickness-normal";break;case"thick":$="edge-thickness-thick";break;case"invisible":$="edge-thickness-thick";break;default:$=""}switch(f.pattern){case"solid":$+=" edge-pattern-solid";break;case"dotted":$+=" edge-pattern-dotted";break;case"dashed":$+=" edge-pattern-dashed";break}const V=i.append("path").attr("d",j(B)).attr("id",f.id).attr("class"," "+$+(f.classes?" "+f.classes:"")).attr("style",f.style);let Q="";switch((Tt().flowchart.arrowMarkerAbsolute||Tt().state.arrowMarkerAbsolute)&&(Q=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,Q=Q.replace(/\(/g,"\\("),Q=Q.replace(/\)/g,"\\)")),Fe.info("arrowTypeStart",f.arrowTypeStart),Fe.info("arrowTypeEnd",f.arrowTypeEnd),f.arrowTypeStart){case"arrow_cross":V.attr("marker-start","url("+Q+"#"+w+"-crossStart)");break;case"arrow_point":V.attr("marker-start","url("+Q+"#"+w+"-pointStart)");break;case"arrow_barb":V.attr("marker-start","url("+Q+"#"+w+"-barbStart)");break;case"arrow_circle":V.attr("marker-start","url("+Q+"#"+w+"-circleStart)");break;case"aggregation":V.attr("marker-start","url("+Q+"#"+w+"-aggregationStart)");break;case"extension":V.attr("marker-start","url("+Q+"#"+w+"-extensionStart)");break;case"composition":V.attr("marker-start","url("+Q+"#"+w+"-compositionStart)");break;case"dependency":V.attr("marker-start","url("+Q+"#"+w+"-dependencyStart)");break;case"lollipop":V.attr("marker-start","url("+Q+"#"+w+"-lollipopStart)");break}switch(f.arrowTypeEnd){case"arrow_cross":V.attr("marker-end","url("+Q+"#"+w+"-crossEnd)");break;case"arrow_point":V.attr("marker-end","url("+Q+"#"+w+"-pointEnd)");break;case"arrow_barb":V.attr("marker-end","url("+Q+"#"+w+"-barbEnd)");break;case"arrow_circle":V.attr("marker-end","url("+Q+"#"+w+"-circleEnd)");break;case"aggregation":V.attr("marker-end","url("+Q+"#"+w+"-aggregationEnd)");break;case"extension":V.attr("marker-end","url("+Q+"#"+w+"-extensionEnd)");break;case"composition":V.attr("marker-end","url("+Q+"#"+w+"-compositionEnd)");break;case"dependency":V.attr("marker-end","url("+Q+"#"+w+"-dependencyEnd)");break;case"lollipop":V.attr("marker-end","url("+Q+"#"+w+"-lollipopEnd)");break}let oe={};return E&&(oe.updatedPath=b),oe.originalPath=f.points,oe},JBe=async(i,a,f,p)=>{Fe.info("Graph in recursive render: XXX",E5(a),p);const w=a.graph().rankdir;Fe.trace("Dir in recursive render - dir:",w);const y=i.insert("g").attr("class","root");a.nodes()?Fe.info("Recursive render XXX",a.nodes()):Fe.info("No nodes found for",a),a.edges().length>0&&Fe.trace("Recursive edges",a.edge(a.edges()[0]));const b=y.insert("g").attr("class","clusters"),E=y.insert("g").attr("class","edgePaths"),S=y.insert("g").attr("class","edgeLabels"),N=y.insert("g").attr("class","nodes");await Promise.all(a.nodes().map(async function(R){const j=a.node(R);if(p!==void 0){const $=JSON.parse(JSON.stringify(p.clusterData));Fe.info("Setting data for cluster XXX (",R,") ",$,p),a.setNode(p.id,$),a.parent(R)||(Fe.trace("Setting parent",R,p.id),a.setParent(R,p.id,$))}if(Fe.info("(Insert) Node XXX"+R+": "+JSON.stringify(a.node(R))),j&&j.clusterNode){Fe.info("Cluster identified",R,j.width,a.node(R));const $=await JBe(N,j.graph,f,a.node(R)),V=$.elem;uf(j,V),j.diff=$.diff||0,Fe.info("Node bounds (abc123)",R,j,j.width,j.x,j.y),lFt(V,j),Fe.warn("Recursive render complete ",V,j)}else a.children(R).length>0?(Fe.info("Cluster - the non recursive path XXX",R,j.id,j,a),Fe.info(pP(j.id,a)),ec[j.id]={id:pP(j.id,a),node:j}):(Fe.info("Node - the non recursive path",R,j.id,j),await KBe(N,a.node(R),w))})),a.edges().forEach(function(R){const j=a.edge(R.v,R.w,R.name);Fe.info("Edge "+R.v+" -> "+R.w+": "+JSON.stringify(R)),Fe.info("Edge "+R.v+" -> "+R.w+": ",R," ",JSON.stringify(a.edge(R))),Fe.info("Fix",ec,"ids:",R.v,R.w,"Translateing: ",ec[R.v],ec[R.w]),QBe(S,j)}),a.edges().forEach(function(R){Fe.info("Edge "+R.v+" -> "+R.w+": "+JSON.stringify(R))}),Fe.info("#############################################"),Fe.info("### Layout ###"),Fe.info("#############################################"),Fe.info(a),tL(a),Fe.info("Graph after layout:",E5(a));let B=0;return PRt(a).forEach(function(R){const j=a.node(R);Fe.info("Position "+R+": "+JSON.stringify(a.node(R))),Fe.info("Position "+R+": ("+j.x,","+j.y,") width: ",j.width," height: ",j.height),j&&j.clusterNode?YBe(j):a.children(R).length>0?(dFt(b,j),ec[j.id].node=j):YBe(j)}),a.edges().forEach(function(R){const j=a.edge(R);Fe.info("Edge "+R.v+" -> "+R.w+": "+JSON.stringify(j),j);const $=mFt(E,R,j,ec,f,a);bFt(j,$)}),a.nodes().forEach(function(R){const j=a.node(R);Fe.info(R,j.type,j.diff),j.type==="group"&&(B=j.diff)}),{elem:y,diff:B}},C0e=async(i,a,f,p,w)=>{vBe(i,f,p,w),hFt(),pFt(),gFt(),IRt(),Fe.warn("Graph at first:",E5(a)),NRt(a),Fe.warn("Graph after:",E5(a)),await JBe(i,a,p)},eRe={},yFt=function(i){const a=Object.keys(i);for(const f of a)eRe[f]=i[f]},tRe=function(i,a,f,p,w,y){const b=p.select(`[id="${f}"]`);Object.keys(i).forEach(function(S){const N=i[S];let B="default";N.classes.length>0&&(B=N.classes.join(" ")),B=B+" flowchart-label";const R=Yw(N.styles);let j=N.text!==void 0?N.text:N.id,$;if(Fe.info("vertex",N,N.labelType),N.labelType==="markdown")Fe.info("vertex",N,N.labelType);else if(d1(Tt().flowchart.htmlLabels)){const oe={label:j.replace(/fa[blrs]?:fa-[\w-]+/g,ce=>``)};$=h0e(b,oe).node(),$.parentNode.removeChild($)}else{const oe=w.createElementNS("http://www.w3.org/2000/svg","text");oe.setAttribute("style",R.labelStyle.replace("color:","fill:"));const ce=j.split(Wa.lineBreakRegex);for(const se of ce){const ge=w.createElementNS("http://www.w3.org/2000/svg","tspan");ge.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),ge.setAttribute("dy","1em"),ge.setAttribute("x","1"),ge.textContent=se,oe.appendChild(ge)}$=oe}let V=0,Q="";switch(N.type){case"round":V=5,Q="rect";break;case"square":Q="rect";break;case"diamond":Q="question";break;case"hexagon":Q="hexagon";break;case"odd":Q="rect_left_inv_arrow";break;case"lean_right":Q="lean_right";break;case"lean_left":Q="lean_left";break;case"trapezoid":Q="trapezoid";break;case"inv_trapezoid":Q="inv_trapezoid";break;case"odd_right":Q="rect_left_inv_arrow";break;case"circle":Q="circle";break;case"ellipse":Q="ellipse";break;case"stadium":Q="stadium";break;case"subroutine":Q="subroutine";break;case"cylinder":Q="cylinder";break;case"group":Q="rect";break;case"doublecircle":Q="doublecircle";break;default:Q="rect"}a.setNode(N.id,{labelStyle:R.labelStyle,shape:Q,labelText:j,labelType:N.labelType,rx:V,ry:V,class:B,style:R.style,id:N.id,link:N.link,linkTarget:N.linkTarget,tooltip:y.db.getTooltip(N.id)||"",domId:y.db.lookUpDomId(N.id),haveCallback:N.haveCallback,width:N.type==="group"?500:void 0,dir:N.dir,type:N.type,props:N.props,padding:Tt().flowchart.padding}),Fe.info("setNode",{labelStyle:R.labelStyle,labelType:N.labelType,shape:Q,labelText:j,rx:V,ry:V,class:B,style:R.style,id:N.id,domId:y.db.lookUpDomId(N.id),width:N.type==="group"?500:void 0,type:N.type,dir:N.dir,props:N.props,padding:Tt().flowchart.padding})})},nRe=function(i,a,f){Fe.info("abc78 edges = ",i);let p=0,w={},y,b;if(i.defaultStyle!==void 0){const E=Yw(i.defaultStyle);y=E.style,b=E.labelStyle}i.forEach(function(E){p++;var S="L-"+E.start+"-"+E.end;w[S]===void 0?(w[S]=0,Fe.info("abc78 new entry",S,w[S])):(w[S]++,Fe.info("abc78 new entry",S,w[S]));let N=S+"-"+w[S];Fe.info("abc78 new link id to be used is",S,N,w[S]);var B="LS-"+E.start,R="LE-"+E.end;const j={style:"",labelStyle:""};switch(j.minlen=E.length||1,E.type==="arrow_open"?j.arrowhead="none":j.arrowhead="normal",j.arrowTypeStart="arrow_open",j.arrowTypeEnd="arrow_open",E.type){case"double_arrow_cross":j.arrowTypeStart="arrow_cross";case"arrow_cross":j.arrowTypeEnd="arrow_cross";break;case"double_arrow_point":j.arrowTypeStart="arrow_point";case"arrow_point":j.arrowTypeEnd="arrow_point";break;case"double_arrow_circle":j.arrowTypeStart="arrow_circle";case"arrow_circle":j.arrowTypeEnd="arrow_circle";break}let $="",V="";switch(E.stroke){case"normal":$="fill:none;",y!==void 0&&($=y),b!==void 0&&(V=b),j.thickness="normal",j.pattern="solid";break;case"dotted":j.thickness="normal",j.pattern="dotted",j.style="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":j.thickness="thick",j.pattern="solid",j.style="stroke-width: 3.5px;fill:none;";break;case"invisible":j.thickness="invisible",j.pattern="solid",j.style="stroke-width: 0;fill:none;";break}if(E.style!==void 0){const Q=Yw(E.style);$=Q.style,V=Q.labelStyle}j.style=j.style+=$,j.labelStyle=j.labelStyle+=V,E.interpolate!==void 0?j.curve=Ub(E.interpolate,ng):i.defaultInterpolate!==void 0?j.curve=Ub(i.defaultInterpolate,ng):j.curve=Ub(eRe.curve,ng),E.text===void 0?E.style!==void 0&&(j.arrowheadStyle="fill: #333"):(j.arrowheadStyle="fill: #333",j.labelpos="c"),j.labelType=E.labelType,j.label=E.text.replace(Wa.lineBreakRegex,` -`),E.style===void 0&&(j.style=j.style||"stroke: #333; stroke-width: 1.5px;fill:none;"),j.labelStyle=j.labelStyle.replace("color:","fill:"),j.id=N,j.classes="flowchart-link "+B+" "+R,a.setEdge(E.start,E.end,j,p)})},S0e={setConf:yFt,addVertices:tRe,addEdges:nRe,getClasses:function(i,a){Fe.info("Extracting classes"),a.db.clear();try{return a.parse(i),a.db.getClasses()}catch{return}},draw:async function(i,a,f,p){Fe.info("Drawing flowchart"),p.db.clear(),ix.setGen("gen-2"),p.parser.parse(i);let w=p.db.getDirection();w===void 0&&(w="TD");const{securityLevel:y,flowchart:b}=Tt(),E=b.nodeSpacing||50,S=b.rankSpacing||50;let N;y==="sandbox"&&(N=Cr("#i"+a));const B=Cr(y==="sandbox"?N.nodes()[0].contentDocument.body:"body"),R=y==="sandbox"?N.nodes()[0].contentDocument:document,j=new zf({multigraph:!0,compound:!0}).setGraph({rankdir:w,nodesep:E,ranksep:S,marginx:0,marginy:0}).setDefaultEdgeLabel(function(){return{}});let $;const V=p.db.getSubGraphs();Fe.info("Subgraphs - ",V);for(let ke=V.length-1;ke>=0;ke--)$=V[ke],Fe.info("Subgraph - ",$),p.db.addVertex($.id,{text:$.title,type:$.labelType},"group",void 0,$.classes,$.dir);const Q=p.db.getVertices(),oe=p.db.getEdges();Fe.info("Edges",oe);let ce=0;for(ce=V.length-1;ce>=0;ce--){$=V[ce],Jfe("cluster").append("text");for(let ke=0;ke<$.nodes.length;ke++)Fe.info("Setting up subgraphs",$.nodes[ke],$.id),j.setParent($.nodes[ke],$.id)}tRe(Q,j,a,B,R,p),nRe(oe,j);const se=B.select(`[id="${a}"]`),ge=B.select("#"+a+" g");if(await C0e(ge,j,["point","circle","cross"],"flowchart",a),co.insertTitle(se,"flowchartTitleText",b.titleTopMargin,p.db.getDiagramTitle()),YE(j,se,b.diagramPadding,b.useMaxWidth),p.db.indexNodes("subGraph"+ce),!b.htmlLabels){const ke=R.querySelectorAll('[id="'+a+'"] .edgeLabel .label');for(const Ae of ke){const de=Ae.getBBox(),ve=R.createElementNS("http://www.w3.org/2000/svg","rect");ve.setAttribute("rx",0),ve.setAttribute("ry",0),ve.setAttribute("width",de.width),ve.setAttribute("height",de.height),Ae.insertBefore(ve,Ae.firstChild)}}Object.keys(Q).forEach(function(ke){const Ae=Q[ke];if(Ae.link){const de=Cr("#"+a+' [id="'+ke+'"]');if(de){const ve=R.createElementNS("http://www.w3.org/2000/svg","a");ve.setAttributeNS("http://www.w3.org/2000/svg","class",Ae.classes.join(" ")),ve.setAttributeNS("http://www.w3.org/2000/svg","href",Ae.link),ve.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),y==="sandbox"?ve.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):Ae.linkTarget&&ve.setAttributeNS("http://www.w3.org/2000/svg","target",Ae.linkTarget);const te=de.insert(function(){return ve},":first-child"),xe=de.select(".label-container");xe&&te.append(function(){return xe.node()});const De=de.select(".label");De&&te.append(function(){return De.node()})}}})}},rRe=i=>`.label { - font-family: ${i.fontFamily}; - color: ${i.nodeTextColor||i.textColor}; + font-family: ${r.fontFamily}; + font-size: ${r.fontSize}; + } + & p { + margin: 0 + } + + ${n} + + ${e} +`},"getStyles"),L$=o((t,e)=>{e!==void 0&&(S4[t]=e)},"addStylesForDiagram"),D$=zbe});var ly={};hr(ly,{clear:()=>vr,getAccDescription:()=>Lr,getAccTitle:()=>Ar,getDiagramTitle:()=>Xr,setAccDescription:()=>_r,setAccTitle:()=>kr,setDiagramTitle:()=>nn});var J7,eS,tS,rS,vr,kr,Ar,_r,Lr,nn,Xr,bi=R(()=>{"use strict";rr();qs();J7="",eS="",tS="",rS=o(t=>qr(t,Or()),"sanitizeText"),vr=o(()=>{J7="",tS="",eS=""},"clear"),kr=o(t=>{J7=rS(t).replace(/^\s+/g,"")},"setAccTitle"),Ar=o(()=>J7,"getAccTitle"),_r=o(t=>{tS=rS(t).replace(/\n\s+/g,` +`)},"setAccDescription"),Lr=o(()=>tS,"getAccDescription"),nn=o(t=>{eS=rS(t)},"setDiagramTitle"),Xr=o(()=>eS,"getDiagramTitle")});var R$,Gbe,de,iS,_4,$be,aS,Vbe,A4,Jf,cy,nS,_t=R(()=>{"use strict";Hf();ut();qs();rr();Yn();Z7();bi();R$=V,Gbe=$1,de=Or,iS=Zb,_4=uh,$be=o(t=>qr(t,de()),"sanitizeText"),aS=Lo,Vbe=o(()=>ly,"getCommonDb"),A4={},Jf=o((t,e,r)=>{A4[t]&&R$.warn(`Diagram with id ${t} already registered. Overwriting.`),A4[t]=e,r&&$C(t,r),L$(t,e.styles),e.injectUtils?.(R$,Gbe,de,$be,aS,Vbe(),()=>{})},"registerDiagram"),cy=o(t=>{if(t in A4)return A4[t];throw new nS(t)},"getDiagram"),nS=class extends Error{static{o(this,"DiagramNotFoundError")}constructor(e){super(`Diagram ${e} not found.`)}}});var ul,vh,ja,cl,nc,uy,sS,oS,L4,D4,N$,Ube,Hbe,Ybe,Wbe,qbe,Xbe,jbe,Kbe,Qbe,Zbe,Jbe,e4e,t4e,r4e,n4e,i4e,a4e,M$,s4e,o4e,I$,l4e,c4e,u4e,h4e,xh,f4e,d4e,p4e,m4e,g4e,hy,lS=R(()=>{"use strict";_t();rr();bi();ul=[],vh=[""],ja="global",cl="",nc=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],uy=[],sS="",oS=!1,L4=4,D4=2,Ube=o(function(){return N$},"getC4Type"),Hbe=o(function(t){N$=qr(t,de())},"setC4Type"),Ybe=o(function(t,e,r,n,i,a,s,l,u){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let h={},f=uy.find(d=>d.from===e&&d.to===r);if(f?h=f:uy.push(h),h.type=t,h.from=e,h.to=r,h.label={text:n},i==null)h.techn={text:""};else if(typeof i=="object"){let[d,p]=Object.entries(i)[0];h[d]={text:p}}else h.techn={text:i};if(a==null)h.descr={text:""};else if(typeof a=="object"){let[d,p]=Object.entries(a)[0];h[d]={text:p}}else h.descr={text:a};if(typeof s=="object"){let[d,p]=Object.entries(s)[0];h[d]=p}else h.sprite=s;if(typeof l=="object"){let[d,p]=Object.entries(l)[0];h[d]=p}else h.tags=l;if(typeof u=="object"){let[d,p]=Object.entries(u)[0];h[d]=p}else h.link=u;h.wrap=xh()},"addRel"),Wbe=o(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let l={},u=ul.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,ul.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.descr={text:""};else if(typeof n=="object"){let[h,f]=Object.entries(n)[0];l[h]={text:f}}else l.descr={text:n};if(typeof i=="object"){let[h,f]=Object.entries(i)[0];l[h]=f}else l.sprite=i;if(typeof a=="object"){let[h,f]=Object.entries(a)[0];l[h]=f}else l.tags=a;if(typeof s=="object"){let[h,f]=Object.entries(s)[0];l[h]=f}else l.link=s;l.typeC4Shape={text:t},l.parentBoundary=ja,l.wrap=xh()},"addPersonOrSystem"),qbe=o(function(t,e,r,n,i,a,s,l){if(e===null||r===null)return;let u={},h=ul.find(f=>f.alias===e);if(h&&e===h.alias?u=h:(u.alias=e,ul.push(u)),r==null?u.label={text:""}:u.label={text:r},n==null)u.techn={text:""};else if(typeof n=="object"){let[f,d]=Object.entries(n)[0];u[f]={text:d}}else u.techn={text:n};if(i==null)u.descr={text:""};else if(typeof i=="object"){let[f,d]=Object.entries(i)[0];u[f]={text:d}}else u.descr={text:i};if(typeof a=="object"){let[f,d]=Object.entries(a)[0];u[f]=d}else u.sprite=a;if(typeof s=="object"){let[f,d]=Object.entries(s)[0];u[f]=d}else u.tags=s;if(typeof l=="object"){let[f,d]=Object.entries(l)[0];u[f]=d}else u.link=l;u.wrap=xh(),u.typeC4Shape={text:t},u.parentBoundary=ja},"addContainer"),Xbe=o(function(t,e,r,n,i,a,s,l){if(e===null||r===null)return;let u={},h=ul.find(f=>f.alias===e);if(h&&e===h.alias?u=h:(u.alias=e,ul.push(u)),r==null?u.label={text:""}:u.label={text:r},n==null)u.techn={text:""};else if(typeof n=="object"){let[f,d]=Object.entries(n)[0];u[f]={text:d}}else u.techn={text:n};if(i==null)u.descr={text:""};else if(typeof i=="object"){let[f,d]=Object.entries(i)[0];u[f]={text:d}}else u.descr={text:i};if(typeof a=="object"){let[f,d]=Object.entries(a)[0];u[f]=d}else u.sprite=a;if(typeof s=="object"){let[f,d]=Object.entries(s)[0];u[f]=d}else u.tags=s;if(typeof l=="object"){let[f,d]=Object.entries(l)[0];u[f]=d}else u.link=l;u.wrap=xh(),u.typeC4Shape={text:t},u.parentBoundary=ja},"addComponent"),jbe=o(function(t,e,r,n,i){if(t===null||e===null)return;let a={},s=nc.find(l=>l.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,nc.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){let[l,u]=Object.entries(r)[0];a[l]={text:u}}else a.type={text:r};if(typeof n=="object"){let[l,u]=Object.entries(n)[0];a[l]=u}else a.tags=n;if(typeof i=="object"){let[l,u]=Object.entries(i)[0];a[l]=u}else a.link=i;a.parentBoundary=ja,a.wrap=xh(),cl=ja,ja=t,vh.push(cl)},"addPersonOrSystemBoundary"),Kbe=o(function(t,e,r,n,i){if(t===null||e===null)return;let a={},s=nc.find(l=>l.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,nc.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){let[l,u]=Object.entries(r)[0];a[l]={text:u}}else a.type={text:r};if(typeof n=="object"){let[l,u]=Object.entries(n)[0];a[l]=u}else a.tags=n;if(typeof i=="object"){let[l,u]=Object.entries(i)[0];a[l]=u}else a.link=i;a.parentBoundary=ja,a.wrap=xh(),cl=ja,ja=t,vh.push(cl)},"addContainerBoundary"),Qbe=o(function(t,e,r,n,i,a,s,l){if(e===null||r===null)return;let u={},h=nc.find(f=>f.alias===e);if(h&&e===h.alias?u=h:(u.alias=e,nc.push(u)),r==null?u.label={text:""}:u.label={text:r},n==null)u.type={text:"node"};else if(typeof n=="object"){let[f,d]=Object.entries(n)[0];u[f]={text:d}}else u.type={text:n};if(i==null)u.descr={text:""};else if(typeof i=="object"){let[f,d]=Object.entries(i)[0];u[f]={text:d}}else u.descr={text:i};if(typeof s=="object"){let[f,d]=Object.entries(s)[0];u[f]=d}else u.tags=s;if(typeof l=="object"){let[f,d]=Object.entries(l)[0];u[f]=d}else u.link=l;u.nodeType=t,u.parentBoundary=ja,u.wrap=xh(),cl=ja,ja=e,vh.push(cl)},"addDeploymentNode"),Zbe=o(function(){ja=cl,vh.pop(),cl=vh.pop(),vh.push(cl)},"popBoundaryParseStack"),Jbe=o(function(t,e,r,n,i,a,s,l,u,h,f){let d=ul.find(p=>p.alias===e);if(!(d===void 0&&(d=nc.find(p=>p.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){let[p,m]=Object.entries(r)[0];d[p]=m}else d.bgColor=r;if(n!=null)if(typeof n=="object"){let[p,m]=Object.entries(n)[0];d[p]=m}else d.fontColor=n;if(i!=null)if(typeof i=="object"){let[p,m]=Object.entries(i)[0];d[p]=m}else d.borderColor=i;if(a!=null)if(typeof a=="object"){let[p,m]=Object.entries(a)[0];d[p]=m}else d.shadowing=a;if(s!=null)if(typeof s=="object"){let[p,m]=Object.entries(s)[0];d[p]=m}else d.shape=s;if(l!=null)if(typeof l=="object"){let[p,m]=Object.entries(l)[0];d[p]=m}else d.sprite=l;if(u!=null)if(typeof u=="object"){let[p,m]=Object.entries(u)[0];d[p]=m}else d.techn=u;if(h!=null)if(typeof h=="object"){let[p,m]=Object.entries(h)[0];d[p]=m}else d.legendText=h;if(f!=null)if(typeof f=="object"){let[p,m]=Object.entries(f)[0];d[p]=m}else d.legendSprite=f}},"updateElStyle"),e4e=o(function(t,e,r,n,i,a,s){let l=uy.find(u=>u.from===e&&u.to===r);if(l!==void 0){if(n!=null)if(typeof n=="object"){let[u,h]=Object.entries(n)[0];l[u]=h}else l.textColor=n;if(i!=null)if(typeof i=="object"){let[u,h]=Object.entries(i)[0];l[u]=h}else l.lineColor=i;if(a!=null)if(typeof a=="object"){let[u,h]=Object.entries(a)[0];l[u]=parseInt(h)}else l.offsetX=parseInt(a);if(s!=null)if(typeof s=="object"){let[u,h]=Object.entries(s)[0];l[u]=parseInt(h)}else l.offsetY=parseInt(s)}},"updateRelStyle"),t4e=o(function(t,e,r){let n=L4,i=D4;if(typeof e=="object"){let a=Object.values(e)[0];n=parseInt(a)}else n=parseInt(e);if(typeof r=="object"){let a=Object.values(r)[0];i=parseInt(a)}else i=parseInt(r);n>=1&&(L4=n),i>=1&&(D4=i)},"updateLayoutConfig"),r4e=o(function(){return L4},"getC4ShapeInRow"),n4e=o(function(){return D4},"getC4BoundaryInRow"),i4e=o(function(){return ja},"getCurrentBoundaryParse"),a4e=o(function(){return cl},"getParentBoundaryParse"),M$=o(function(t){return t==null?ul:ul.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),s4e=o(function(t){return ul.find(e=>e.alias===t)},"getC4Shape"),o4e=o(function(t){return Object.keys(M$(t))},"getC4ShapeKeys"),I$=o(function(t){return t==null?nc:nc.filter(e=>e.parentBoundary===t)},"getBoundaries"),l4e=I$,c4e=o(function(){return uy},"getRels"),u4e=o(function(){return sS},"getTitle"),h4e=o(function(t){oS=t},"setWrap"),xh=o(function(){return oS},"autoWrap"),f4e=o(function(){ul=[],nc=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],cl="",ja="global",vh=[""],uy=[],vh=[""],sS="",oS=!1,L4=4,D4=2},"clear"),d4e={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},p4e={FILLED:0,OPEN:1},m4e={LEFTOF:0,RIGHTOF:1,OVER:2},g4e=o(function(t){sS=qr(t,de())},"setTitle"),hy={addPersonOrSystem:Wbe,addPersonOrSystemBoundary:jbe,addContainer:qbe,addContainerBoundary:Kbe,addComponent:Xbe,addDeploymentNode:Qbe,popBoundaryParseStack:Zbe,addRel:Ybe,updateElStyle:Jbe,updateRelStyle:e4e,updateLayoutConfig:t4e,autoWrap:xh,setWrap:h4e,getC4ShapeArray:M$,getC4Shape:s4e,getC4ShapeKeys:o4e,getBoundaries:I$,getBoundarys:l4e,getCurrentBoundaryParse:i4e,getParentBoundaryParse:a4e,getRels:c4e,getTitle:u4e,getC4Type:Ube,getC4ShapeInRow:r4e,getC4BoundaryInRow:n4e,setAccTitle:kr,getAccTitle:Ar,getAccDescription:Lr,setAccDescription:_r,getConfig:o(()=>de().c4,"getConfig"),clear:f4e,LINETYPE:d4e,ARROWTYPE:p4e,PLACEMENT:m4e,setTitle:g4e,setC4Type:Hbe}});function ed(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}var cS=R(()=>{"use strict";o(ed,"ascending")});function uS(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}var O$=R(()=>{"use strict";o(uS,"descending")});function td(t){let e,r,n;t.length!==2?(e=ed,r=o((l,u)=>ed(t(l),u),"compare2"),n=o((l,u)=>t(l)-u,"delta")):(e=t===ed||t===uS?t:y4e,r=t,n=t);function i(l,u,h=0,f=l.length){if(h>>1;r(l[d],u)<0?h=d+1:f=d}while(h>>1;r(l[d],u)<=0?h=d+1:f=d}while(hh&&n(l[d-1],u)>-n(l[d],u)?d-1:d}return o(s,"center"),{left:i,center:s,right:a}}function y4e(){return 0}var hS=R(()=>{"use strict";cS();O$();o(td,"bisector");o(y4e,"zero")});function fS(t){return t===null?NaN:+t}var P$=R(()=>{"use strict";o(fS,"number")});var B$,F$,v4e,x4e,dS,z$=R(()=>{"use strict";cS();hS();P$();B$=td(ed),F$=B$.right,v4e=B$.left,x4e=td(fS).center,dS=F$});function G$({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):r}function b4e({_intern:t,_key:e},r){let n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function w4e({_intern:t,_key:e},r){let n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function T4e(t){return t!==null&&typeof t=="object"?t.valueOf():t}var wp,$$=R(()=>{"use strict";wp=class extends Map{static{o(this,"InternMap")}constructor(e,r=T4e){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(let[n,i]of e)this.set(n,i)}get(e){return super.get(G$(this,e))}has(e){return super.has(G$(this,e))}set(e,r){return super.set(b4e(this,e),r)}delete(e){return super.delete(w4e(this,e))}};o(G$,"intern_get");o(b4e,"intern_set");o(w4e,"intern_delete");o(T4e,"keyof")});function R4(t,e,r){let n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=k4e?10:a>=E4e?5:a>=C4e?2:1,l,u,h;return i<0?(h=Math.pow(10,-i)/s,l=Math.round(t*h),u=Math.round(e*h),l/he&&--u,h=-h):(h=Math.pow(10,i)*s,l=Math.round(t/h),u=Math.round(e/h),l*he&&--u),u0))return[];if(t===e)return[t];let n=e=i))return[];let l=a-i+1,u=new Array(l);if(n)if(s<0)for(let h=0;h{"use strict";k4e=Math.sqrt(50),E4e=Math.sqrt(10),C4e=Math.sqrt(2);o(R4,"tickSpec");o(N4,"ticks");o(fy,"tickIncrement");o(Tp,"tickStep")});function M4(t,e){let r;if(e===void 0)for(let n of t)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}var U$=R(()=>{"use strict";o(M4,"max")});function I4(t,e){let r;if(e===void 0)for(let n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}var H$=R(()=>{"use strict";o(I4,"min")});function O4(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,a=new Array(i);++n{"use strict";o(O4,"range")});var bh=R(()=>{"use strict";z$();hS();U$();H$();Y$();V$();$$()});function pS(t){return t}var W$=R(()=>{"use strict";o(pS,"default")});function S4e(t){return"translate("+t+",0)"}function A4e(t){return"translate(0,"+t+")"}function _4e(t){return e=>+t(e)}function L4e(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function D4e(){return!this.__axis}function X$(t,e){var r=[],n=null,i=null,a=6,s=6,l=3,u=typeof window<"u"&&window.devicePixelRatio>1?0:.5,h=t===B4||t===P4?-1:1,f=t===P4||t===mS?"x":"y",d=t===B4||t===gS?S4e:A4e;function p(m){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),y=i??(e.tickFormat?e.tickFormat.apply(e,r):pS),v=Math.max(a,0)+l,x=e.range(),b=+x[0]+u,w=+x[x.length-1]+u,S=(e.bandwidth?L4e:_4e)(e.copy(),u),T=m.selection?m.selection():m,E=T.selectAll(".domain").data([null]),_=T.selectAll(".tick").data(g,e).order(),A=_.exit(),L=_.enter().append("g").attr("class","tick"),M=_.select("line"),N=_.select("text");E=E.merge(E.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),_=_.merge(L),M=M.merge(L.append("line").attr("stroke","currentColor").attr(f+"2",h*a)),N=N.merge(L.append("text").attr("fill","currentColor").attr(f,h*v).attr("dy",t===B4?"0em":t===gS?"0.71em":"0.32em")),m!==T&&(E=E.transition(m),_=_.transition(m),M=M.transition(m),N=N.transition(m),A=A.transition(m).attr("opacity",q$).attr("transform",function(k){return isFinite(k=S(k))?d(k+u):this.getAttribute("transform")}),L.attr("opacity",q$).attr("transform",function(k){var I=this.parentNode.__axis;return d((I&&isFinite(I=I(k))?I:S(k))+u)})),A.remove(),E.attr("d",t===P4||t===mS?s?"M"+h*s+","+b+"H"+u+"V"+w+"H"+h*s:"M"+u+","+b+"V"+w:s?"M"+b+","+h*s+"V"+u+"H"+w+"V"+h*s:"M"+b+","+u+"H"+w),_.attr("opacity",1).attr("transform",function(k){return d(S(k)+u)}),M.attr(f+"2",h*a),N.attr(f,h*v).text(y),T.filter(D4e).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===mS?"start":t===P4?"end":"middle"),T.each(function(){this.__axis=S})}return o(p,"axis"),p.scale=function(m){return arguments.length?(e=m,p):e},p.ticks=function(){return r=Array.from(arguments),p},p.tickArguments=function(m){return arguments.length?(r=m==null?[]:Array.from(m),p):r.slice()},p.tickValues=function(m){return arguments.length?(n=m==null?null:Array.from(m),p):n&&n.slice()},p.tickFormat=function(m){return arguments.length?(i=m,p):i},p.tickSize=function(m){return arguments.length?(a=s=+m,p):a},p.tickSizeInner=function(m){return arguments.length?(a=+m,p):a},p.tickSizeOuter=function(m){return arguments.length?(s=+m,p):s},p.tickPadding=function(m){return arguments.length?(l=+m,p):l},p.offset=function(m){return arguments.length?(u=+m,p):u},p}function yS(t){return X$(B4,t)}function vS(t){return X$(gS,t)}var B4,mS,gS,P4,q$,j$=R(()=>{"use strict";W$();B4=1,mS=2,gS=3,P4=4,q$=1e-6;o(S4e,"translateX");o(A4e,"translateY");o(_4e,"number");o(L4e,"center");o(D4e,"entering");o(X$,"axis");o(yS,"axisTop");o(vS,"axisBottom")});var K$=R(()=>{"use strict";j$()});function Z$(){for(var t=0,e=arguments.length,r={},n;t=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}function M4e(t,e){for(var r=0,n=t.length,i;r{"use strict";R4e={value:o(()=>{},"value")};o(Z$,"dispatch");o(F4,"Dispatch");o(N4e,"parseTypenames");F4.prototype=Z$.prototype={constructor:F4,on:o(function(t,e){var r=this._,n=N4e(t+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a0)for(var r=new Array(i),n=0,i,a;n{"use strict";J$()});var z4,wS,TS=R(()=>{"use strict";z4="http://www.w3.org/1999/xhtml",wS={svg:"http://www.w3.org/2000/svg",xhtml:z4,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}});function ic(t){var e=t+="",r=e.indexOf(":");return r>=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),wS.hasOwnProperty(e)?{space:wS[e],local:t}:t}var G4=R(()=>{"use strict";TS();o(ic,"default")});function I4e(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===z4&&e.documentElement.namespaceURI===z4?e.createElement(t):e.createElementNS(r,t)}}function O4e(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function dy(t){var e=ic(t);return(e.local?O4e:I4e)(e)}var kS=R(()=>{"use strict";G4();TS();o(I4e,"creatorInherit");o(O4e,"creatorFixed");o(dy,"default")});function P4e(){}function wh(t){return t==null?P4e:function(){return this.querySelector(t)}}var $4=R(()=>{"use strict";o(P4e,"none");o(wh,"default")});function ES(t){typeof t!="function"&&(t=wh(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i{"use strict";hl();$4();o(ES,"default")});function CS(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}var tV=R(()=>{"use strict";o(CS,"array")});function B4e(){return[]}function kp(t){return t==null?B4e:function(){return this.querySelectorAll(t)}}var SS=R(()=>{"use strict";o(B4e,"empty");o(kp,"default")});function F4e(t){return function(){return CS(t.apply(this,arguments))}}function AS(t){typeof t=="function"?t=F4e(t):t=kp(t);for(var e=this._groups,r=e.length,n=[],i=[],a=0;a{"use strict";hl();tV();SS();o(F4e,"arrayAll");o(AS,"default")});function Ep(t){return function(){return this.matches(t)}}function V4(t){return function(e){return e.matches(t)}}var py=R(()=>{"use strict";o(Ep,"default");o(V4,"childMatcher")});function G4e(t){return function(){return z4e.call(this.children,t)}}function $4e(){return this.firstElementChild}function _S(t){return this.select(t==null?$4e:G4e(typeof t=="function"?t:V4(t)))}var z4e,nV=R(()=>{"use strict";py();z4e=Array.prototype.find;o(G4e,"childFind");o($4e,"childFirst");o(_S,"default")});function U4e(){return Array.from(this.children)}function H4e(t){return function(){return V4e.call(this.children,t)}}function LS(t){return this.selectAll(t==null?U4e:H4e(typeof t=="function"?t:V4(t)))}var V4e,iV=R(()=>{"use strict";py();V4e=Array.prototype.filter;o(U4e,"children");o(H4e,"childrenFilter");o(LS,"default")});function DS(t){typeof t!="function"&&(t=Ep(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i{"use strict";hl();py();o(DS,"default")});function my(t){return new Array(t.length)}var RS=R(()=>{"use strict";o(my,"default")});function NS(){return new Zn(this._enter||this._groups.map(my),this._parents)}function gy(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}var MS=R(()=>{"use strict";RS();hl();o(NS,"default");o(gy,"EnterNode");gy.prototype={constructor:gy,appendChild:o(function(t){return this._parent.insertBefore(t,this._next)},"appendChild"),insertBefore:o(function(t,e){return this._parent.insertBefore(t,e)},"insertBefore"),querySelector:o(function(t){return this._parent.querySelector(t)},"querySelector"),querySelectorAll:o(function(t){return this._parent.querySelectorAll(t)},"querySelectorAll")}});function IS(t){return function(){return t}}var sV=R(()=>{"use strict";o(IS,"default")});function Y4e(t,e,r,n,i,a){for(var s=0,l,u=e.length,h=a.length;s=w&&(w=b+1);!(T=v[w])&&++w{"use strict";hl();MS();sV();o(Y4e,"bindIndex");o(W4e,"bindKey");o(q4e,"datum");o(OS,"default");o(X4e,"arraylike")});function PS(){return new Zn(this._exit||this._groups.map(my),this._parents)}var lV=R(()=>{"use strict";RS();hl();o(PS,"default")});function BS(t,e,r){var n=this.enter(),i=this,a=this.exit();return typeof t=="function"?(n=t(n),n&&(n=n.selection())):n=n.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),r==null?a.remove():r(a),n&&i?n.merge(i).order():i}var cV=R(()=>{"use strict";o(BS,"default")});function FS(t){for(var e=t.selection?t.selection():t,r=this._groups,n=e._groups,i=r.length,a=n.length,s=Math.min(i,a),l=new Array(i),u=0;u{"use strict";hl();o(FS,"default")});function zS(){for(var t=this._groups,e=-1,r=t.length;++e=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}var hV=R(()=>{"use strict";o(zS,"default")});function GS(t){t||(t=j4e);function e(d,p){return d&&p?t(d.__data__,p.__data__):!d-!p}o(e,"compareNode");for(var r=this._groups,n=r.length,i=new Array(n),a=0;ae?1:t>=e?0:NaN}var fV=R(()=>{"use strict";hl();o(GS,"default");o(j4e,"ascending")});function $S(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}var dV=R(()=>{"use strict";o($S,"default")});function VS(){return Array.from(this)}var pV=R(()=>{"use strict";o(VS,"default")});function US(){for(var t=this._groups,e=0,r=t.length;e{"use strict";o(US,"default")});function HS(){let t=0;for(let e of this)++t;return t}var gV=R(()=>{"use strict";o(HS,"default")});function YS(){return!this.node()}var yV=R(()=>{"use strict";o(YS,"default")});function WS(t){for(var e=this._groups,r=0,n=e.length;r{"use strict";o(WS,"default")});function K4e(t){return function(){this.removeAttribute(t)}}function Q4e(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Z4e(t,e){return function(){this.setAttribute(t,e)}}function J4e(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function e3e(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttribute(t):this.setAttribute(t,r)}}function t3e(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function qS(t,e){var r=ic(t);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((e==null?r.local?Q4e:K4e:typeof e=="function"?r.local?t3e:e3e:r.local?J4e:Z4e)(r,e))}var xV=R(()=>{"use strict";G4();o(K4e,"attrRemove");o(Q4e,"attrRemoveNS");o(Z4e,"attrConstant");o(J4e,"attrConstantNS");o(e3e,"attrFunction");o(t3e,"attrFunctionNS");o(qS,"default")});function yy(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}var XS=R(()=>{"use strict";o(yy,"default")});function r3e(t){return function(){this.style.removeProperty(t)}}function n3e(t,e,r){return function(){this.style.setProperty(t,e,r)}}function i3e(t,e,r){return function(){var n=e.apply(this,arguments);n==null?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function jS(t,e,r){return arguments.length>1?this.each((e==null?r3e:typeof e=="function"?i3e:n3e)(t,e,r??"")):Th(this.node(),t)}function Th(t,e){return t.style.getPropertyValue(e)||yy(t).getComputedStyle(t,null).getPropertyValue(e)}var KS=R(()=>{"use strict";XS();o(r3e,"styleRemove");o(n3e,"styleConstant");o(i3e,"styleFunction");o(jS,"default");o(Th,"styleValue")});function a3e(t){return function(){delete this[t]}}function s3e(t,e){return function(){this[t]=e}}function o3e(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function QS(t,e){return arguments.length>1?this.each((e==null?a3e:typeof e=="function"?o3e:s3e)(t,e)):this.node()[t]}var bV=R(()=>{"use strict";o(a3e,"propertyRemove");o(s3e,"propertyConstant");o(o3e,"propertyFunction");o(QS,"default")});function wV(t){return t.trim().split(/^|\s+/)}function ZS(t){return t.classList||new TV(t)}function TV(t){this._node=t,this._names=wV(t.getAttribute("class")||"")}function kV(t,e){for(var r=ZS(t),n=-1,i=e.length;++n{"use strict";o(wV,"classArray");o(ZS,"classList");o(TV,"ClassList");TV.prototype={add:o(function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},"add"),remove:o(function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},"remove"),contains:o(function(t){return this._names.indexOf(t)>=0},"contains")};o(kV,"classedAdd");o(EV,"classedRemove");o(l3e,"classedTrue");o(c3e,"classedFalse");o(u3e,"classedFunction");o(JS,"default")});function h3e(){this.textContent=""}function f3e(t){return function(){this.textContent=t}}function d3e(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function eA(t){return arguments.length?this.each(t==null?h3e:(typeof t=="function"?d3e:f3e)(t)):this.node().textContent}var SV=R(()=>{"use strict";o(h3e,"textRemove");o(f3e,"textConstant");o(d3e,"textFunction");o(eA,"default")});function p3e(){this.innerHTML=""}function m3e(t){return function(){this.innerHTML=t}}function g3e(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function tA(t){return arguments.length?this.each(t==null?p3e:(typeof t=="function"?g3e:m3e)(t)):this.node().innerHTML}var AV=R(()=>{"use strict";o(p3e,"htmlRemove");o(m3e,"htmlConstant");o(g3e,"htmlFunction");o(tA,"default")});function y3e(){this.nextSibling&&this.parentNode.appendChild(this)}function rA(){return this.each(y3e)}var _V=R(()=>{"use strict";o(y3e,"raise");o(rA,"default")});function v3e(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function nA(){return this.each(v3e)}var LV=R(()=>{"use strict";o(v3e,"lower");o(nA,"default")});function iA(t){var e=typeof t=="function"?t:dy(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}var DV=R(()=>{"use strict";kS();o(iA,"default")});function x3e(){return null}function aA(t,e){var r=typeof t=="function"?t:dy(t),n=e==null?x3e:typeof e=="function"?e:wh(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}var RV=R(()=>{"use strict";kS();$4();o(x3e,"constantNull");o(aA,"default")});function b3e(){var t=this.parentNode;t&&t.removeChild(this)}function sA(){return this.each(b3e)}var NV=R(()=>{"use strict";o(b3e,"remove");o(sA,"default")});function w3e(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function T3e(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function oA(t){return this.select(t?T3e:w3e)}var MV=R(()=>{"use strict";o(w3e,"selection_cloneShallow");o(T3e,"selection_cloneDeep");o(oA,"default")});function lA(t){return arguments.length?this.property("__data__",t):this.node().__data__}var IV=R(()=>{"use strict";o(lA,"default")});function k3e(t){return function(e){t.call(this,e,this.__data__)}}function E3e(t){return t.trim().split(/^|\s+/).map(function(e){var r="",n=e.indexOf(".");return n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function C3e(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,a;r{"use strict";o(k3e,"contextListener");o(E3e,"parseTypenames");o(C3e,"onRemove");o(S3e,"onAdd");o(cA,"default")});function PV(t,e,r){var n=yy(t),i=n.CustomEvent;typeof i=="function"?i=new i(e,r):(i=n.document.createEvent("Event"),r?(i.initEvent(e,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function A3e(t,e){return function(){return PV(this,t,e)}}function _3e(t,e){return function(){return PV(this,t,e.apply(this,arguments))}}function uA(t,e){return this.each((typeof e=="function"?_3e:A3e)(t,e))}var BV=R(()=>{"use strict";XS();o(PV,"dispatchEvent");o(A3e,"dispatchConstant");o(_3e,"dispatchFunction");o(uA,"default")});function*hA(){for(var t=this._groups,e=0,r=t.length;e{"use strict";o(hA,"default")});function Zn(t,e){this._groups=t,this._parents=e}function zV(){return new Zn([[document.documentElement]],fA)}function L3e(){return this}var fA,cu,hl=R(()=>{"use strict";eV();rV();nV();iV();aV();oV();MS();lV();cV();uV();hV();fV();dV();pV();mV();gV();yV();vV();xV();KS();bV();CV();SV();AV();_V();LV();DV();RV();NV();MV();IV();OV();BV();FV();fA=[null];o(Zn,"Selection");o(zV,"selection");o(L3e,"selection_selection");Zn.prototype=zV.prototype={constructor:Zn,select:ES,selectAll:AS,selectChild:_S,selectChildren:LS,filter:DS,data:OS,enter:NS,exit:PS,join:BS,merge:FS,selection:L3e,order:zS,sort:GS,call:$S,nodes:VS,node:US,size:HS,empty:YS,each:WS,attr:qS,style:jS,property:QS,classed:JS,text:eA,html:tA,raise:rA,lower:nA,append:iA,insert:aA,remove:sA,clone:oA,datum:lA,on:cA,dispatch:uA,[Symbol.iterator]:hA};cu=zV});function $e(t){return typeof t=="string"?new Zn([[document.querySelector(t)]],[document.documentElement]):new Zn([[t]],fA)}var GV=R(()=>{"use strict";hl();o($e,"default")});var fl=R(()=>{"use strict";py();G4();GV();hl();$4();SS();KS()});var $V=R(()=>{"use strict"});function kh(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function Cp(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}var dA=R(()=>{"use strict";o(kh,"default");o(Cp,"extend")});function Eh(){}function UV(){return this.rgb().formatHex()}function B3e(){return this.rgb().formatHex8()}function F3e(){return KV(this).formatHsl()}function HV(){return this.rgb().formatRgb()}function pl(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=D3e.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?YV(e):r===3?new la(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?U4(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?U4(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=R3e.exec(t))?new la(e[1],e[2],e[3],1):(e=N3e.exec(t))?new la(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=M3e.exec(t))?U4(e[1],e[2],e[3],e[4]):(e=I3e.exec(t))?U4(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=O3e.exec(t))?XV(e[1],e[2]/100,e[3]/100,1):(e=P3e.exec(t))?XV(e[1],e[2]/100,e[3]/100,e[4]):VV.hasOwnProperty(t)?YV(VV[t]):t==="transparent"?new la(NaN,NaN,NaN,0):null}function YV(t){return new la(t>>16&255,t>>8&255,t&255,1)}function U4(t,e,r,n){return n<=0&&(t=e=r=NaN),new la(t,e,r,n)}function mA(t){return t instanceof Eh||(t=pl(t)),t?(t=t.rgb(),new la(t.r,t.g,t.b,t.opacity)):new la}function Ap(t,e,r,n){return arguments.length===1?mA(t):new la(t,e,r,n??1)}function la(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function WV(){return`#${rd(this.r)}${rd(this.g)}${rd(this.b)}`}function z3e(){return`#${rd(this.r)}${rd(this.g)}${rd(this.b)}${rd((isNaN(this.opacity)?1:this.opacity)*255)}`}function qV(){let t=W4(this.opacity);return`${t===1?"rgb(":"rgba("}${nd(this.r)}, ${nd(this.g)}, ${nd(this.b)}${t===1?")":`, ${t})`}`}function W4(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function nd(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function rd(t){return t=nd(t),(t<16?"0":"")+t.toString(16)}function XV(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new dl(t,e,r,n)}function KV(t){if(t instanceof dl)return new dl(t.h,t.s,t.l,t.opacity);if(t instanceof Eh||(t=pl(t)),!t)return new dl;if(t instanceof dl)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=NaN,l=a-i,u=(a+i)/2;return l?(e===a?s=(r-n)/l+(r0&&u<1?0:s,new dl(s,l,u,t.opacity)}function QV(t,e,r,n){return arguments.length===1?KV(t):new dl(t,e,r,n??1)}function dl(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function jV(t){return t=(t||0)%360,t<0?t+360:t}function H4(t){return Math.max(0,Math.min(1,t||0))}function pA(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}var vy,Y4,Sp,xy,ac,D3e,R3e,N3e,M3e,I3e,O3e,P3e,VV,gA=R(()=>{"use strict";dA();o(Eh,"Color");vy=.7,Y4=1/vy,Sp="\\s*([+-]?\\d+)\\s*",xy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ac="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",D3e=/^#([0-9a-f]{3,8})$/,R3e=new RegExp(`^rgb\\(${Sp},${Sp},${Sp}\\)$`),N3e=new RegExp(`^rgb\\(${ac},${ac},${ac}\\)$`),M3e=new RegExp(`^rgba\\(${Sp},${Sp},${Sp},${xy}\\)$`),I3e=new RegExp(`^rgba\\(${ac},${ac},${ac},${xy}\\)$`),O3e=new RegExp(`^hsl\\(${xy},${ac},${ac}\\)$`),P3e=new RegExp(`^hsla\\(${xy},${ac},${ac},${xy}\\)$`),VV={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};kh(Eh,pl,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:UV,formatHex:UV,formatHex8:B3e,formatHsl:F3e,formatRgb:HV,toString:HV});o(UV,"color_formatHex");o(B3e,"color_formatHex8");o(F3e,"color_formatHsl");o(HV,"color_formatRgb");o(pl,"color");o(YV,"rgbn");o(U4,"rgba");o(mA,"rgbConvert");o(Ap,"rgb");o(la,"Rgb");kh(la,Ap,Cp(Eh,{brighter(t){return t=t==null?Y4:Math.pow(Y4,t),new la(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?vy:Math.pow(vy,t),new la(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new la(nd(this.r),nd(this.g),nd(this.b),W4(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:WV,formatHex:WV,formatHex8:z3e,formatRgb:qV,toString:qV}));o(WV,"rgb_formatHex");o(z3e,"rgb_formatHex8");o(qV,"rgb_formatRgb");o(W4,"clampa");o(nd,"clampi");o(rd,"hex");o(XV,"hsla");o(KV,"hslConvert");o(QV,"hsl");o(dl,"Hsl");kh(dl,QV,Cp(Eh,{brighter(t){return t=t==null?Y4:Math.pow(Y4,t),new dl(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?vy:Math.pow(vy,t),new dl(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new la(pA(t>=240?t-240:t+120,i,n),pA(t,i,n),pA(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new dl(jV(this.h),H4(this.s),H4(this.l),W4(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(){let t=W4(this.opacity);return`${t===1?"hsl(":"hsla("}${jV(this.h)}, ${H4(this.s)*100}%, ${H4(this.l)*100}%${t===1?")":`, ${t})`}`}}));o(jV,"clamph");o(H4,"clampt");o(pA,"hsl2rgb")});var ZV,JV,eU=R(()=>{"use strict";ZV=Math.PI/180,JV=180/Math.PI});function sU(t){if(t instanceof sc)return new sc(t.l,t.a,t.b,t.opacity);if(t instanceof uu)return oU(t);t instanceof la||(t=mA(t));var e=bA(t.r),r=bA(t.g),n=bA(t.b),i=yA((.2225045*e+.7168786*r+.0606169*n)/rU),a,s;return e===r&&r===n?a=s=i:(a=yA((.4360747*e+.3850649*r+.1430804*n)/tU),s=yA((.0139322*e+.0971045*r+.7141733*n)/nU)),new sc(116*i-16,500*(a-i),200*(i-s),t.opacity)}function wA(t,e,r,n){return arguments.length===1?sU(t):new sc(t,e,r,n??1)}function sc(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function yA(t){return t>G3e?Math.pow(t,1/3):t/aU+iU}function vA(t){return t>_p?t*t*t:aU*(t-iU)}function xA(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function bA(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $3e(t){if(t instanceof uu)return new uu(t.h,t.c,t.l,t.opacity);if(t instanceof sc||(t=sU(t)),t.a===0&&t.b===0)return new uu(NaN,0{"use strict";dA();gA();eU();q4=18,tU=.96422,rU=1,nU=.82521,iU=4/29,_p=6/29,aU=3*_p*_p,G3e=_p*_p*_p;o(sU,"labConvert");o(wA,"lab");o(sc,"Lab");kh(sc,wA,Cp(Eh,{brighter(t){return new sc(this.l+q4*(t??1),this.a,this.b,this.opacity)},darker(t){return new sc(this.l-q4*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=tU*vA(e),t=rU*vA(t),r=nU*vA(r),new la(xA(3.1338561*e-1.6168667*t-.4906146*r),xA(-.9787684*e+1.9161415*t+.033454*r),xA(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));o(yA,"xyz2lab");o(vA,"lab2xyz");o(xA,"lrgb2rgb");o(bA,"rgb2lrgb");o($3e,"hclConvert");o(by,"hcl");o(uu,"Hcl");o(oU,"hcl2lab");kh(uu,by,Cp(Eh,{brighter(t){return new uu(this.h,this.c,this.l+q4*(t??1),this.opacity)},darker(t){return new uu(this.h,this.c,this.l-q4*(t??1),this.opacity)},rgb(){return oU(this).rgb()}}))});var Lp=R(()=>{"use strict";gA();lU()});function TA(t,e,r,n,i){var a=t*t,s=a*t;return((1-3*t+3*a-s)*e+(4-6*a+3*s)*r+(1+3*t+3*a-3*s)*n+s*i)/6}function kA(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),i=t[n],a=t[n+1],s=n>0?t[n-1]:2*i-a,l=n{"use strict";o(TA,"basis");o(kA,"default")});function CA(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),i=t[(n+e-1)%e],a=t[n%e],s=t[(n+1)%e],l=t[(n+2)%e];return TA((r-n/e)*e,i,a,s,l)}}var cU=R(()=>{"use strict";EA();o(CA,"default")});var Dp,SA=R(()=>{"use strict";Dp=o(t=>()=>t,"default")});function uU(t,e){return function(r){return t+r*e}}function V3e(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function hU(t,e){var r=e-t;return r?uU(t,r>180||r<-180?r-360*Math.round(r/360):r):Dp(isNaN(t)?e:t)}function fU(t){return(t=+t)==1?hu:function(e,r){return r-e?V3e(e,r,t):Dp(isNaN(e)?r:e)}}function hu(t,e){var r=e-t;return r?uU(t,r):Dp(isNaN(t)?e:t)}var AA=R(()=>{"use strict";SA();o(uU,"linear");o(V3e,"exponential");o(hU,"hue");o(fU,"gamma");o(hu,"nogamma")});function dU(t){return function(e){var r=e.length,n=new Array(r),i=new Array(r),a=new Array(r),s,l;for(s=0;s{"use strict";Lp();EA();cU();AA();id=o(function t(e){var r=fU(e);function n(i,a){var s=r((i=Ap(i)).r,(a=Ap(a)).r),l=r(i.g,a.g),u=r(i.b,a.b),h=hu(i.opacity,a.opacity);return function(f){return i.r=s(f),i.g=l(f),i.b=u(f),i.opacity=h(f),i+""}}return o(n,"rgb"),n.gamma=t,n},"rgbGamma")(1);o(dU,"rgbSpline");U3e=dU(kA),H3e=dU(CA)});function LA(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;i{"use strict";o(LA,"default");o(pU,"isNumberArray")});function gU(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,i=new Array(n),a=new Array(r),s;for(s=0;s{"use strict";X4();o(gU,"genericArray")});function DA(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}var vU=R(()=>{"use strict";o(DA,"default")});function ji(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}var wy=R(()=>{"use strict";o(ji,"default")});function RA(t,e){var r={},n={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?r[i]=Ch(t[i],e[i]):n[i]=e[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var xU=R(()=>{"use strict";X4();o(RA,"default")});function Y3e(t){return function(){return t}}function W3e(t){return function(e){return t(e)+""}}function Rp(t,e){var r=MA.lastIndex=NA.lastIndex=0,n,i,a,s=-1,l=[],u=[];for(t=t+"",e=e+"";(n=MA.exec(t))&&(i=NA.exec(e));)(a=i.index)>r&&(a=e.slice(r,a),l[s]?l[s]+=a:l[++s]=a),(n=n[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,u.push({i:s,x:ji(n,i)})),r=NA.lastIndex;return r{"use strict";wy();MA=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,NA=new RegExp(MA.source,"g");o(Y3e,"zero");o(W3e,"one");o(Rp,"default")});function Ch(t,e){var r=typeof e,n;return e==null||r==="boolean"?Dp(e):(r==="number"?ji:r==="string"?(n=pl(e))?(e=n,id):Rp:e instanceof pl?id:e instanceof Date?DA:pU(e)?LA:Array.isArray(e)?gU:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?RA:ji)(t,e)}var X4=R(()=>{"use strict";Lp();_A();yU();vU();wy();xU();IA();SA();mU();o(Ch,"default")});function j4(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}var bU=R(()=>{"use strict";o(j4,"default")});function Q4(t,e,r,n,i,a){var s,l,u;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(u=t*r+e*n)&&(r-=t*u,n-=e*u),(l=Math.sqrt(r*r+n*n))&&(r/=l,n/=l,u/=l),t*n{"use strict";wU=180/Math.PI,K4={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};o(Q4,"default")});function kU(t){let e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?K4:Q4(e.a,e.b,e.c,e.d,e.e,e.f)}function EU(t){return t==null?K4:(Z4||(Z4=document.createElementNS("http://www.w3.org/2000/svg","g")),Z4.setAttribute("transform",t),(t=Z4.transform.baseVal.consolidate())?(t=t.matrix,Q4(t.a,t.b,t.c,t.d,t.e,t.f)):K4)}var Z4,CU=R(()=>{"use strict";TU();o(kU,"parseCss");o(EU,"parseSvg")});function SU(t,e,r,n){function i(h){return h.length?h.pop()+" ":""}o(i,"pop");function a(h,f,d,p,m,g){if(h!==d||f!==p){var y=m.push("translate(",null,e,null,r);g.push({i:y-4,x:ji(h,d)},{i:y-2,x:ji(f,p)})}else(d||p)&&m.push("translate("+d+e+p+r)}o(a,"translate");function s(h,f,d,p){h!==f?(h-f>180?f+=360:f-h>180&&(h+=360),p.push({i:d.push(i(d)+"rotate(",null,n)-2,x:ji(h,f)})):f&&d.push(i(d)+"rotate("+f+n)}o(s,"rotate");function l(h,f,d,p){h!==f?p.push({i:d.push(i(d)+"skewX(",null,n)-2,x:ji(h,f)}):f&&d.push(i(d)+"skewX("+f+n)}o(l,"skewX");function u(h,f,d,p,m,g){if(h!==d||f!==p){var y=m.push(i(m)+"scale(",null,",",null,")");g.push({i:y-4,x:ji(h,d)},{i:y-2,x:ji(f,p)})}else(d!==1||p!==1)&&m.push(i(m)+"scale("+d+","+p+")")}return o(u,"scale"),function(h,f){var d=[],p=[];return h=t(h),f=t(f),a(h.translateX,h.translateY,f.translateX,f.translateY,d,p),s(h.rotate,f.rotate,d,p),l(h.skewX,f.skewX,d,p),u(h.scaleX,h.scaleY,f.scaleX,f.scaleY,d,p),h=f=null,function(m){for(var g=-1,y=p.length,v;++g{"use strict";wy();CU();o(SU,"interpolateTransform");OA=SU(kU,"px, ","px)","deg)"),PA=SU(EU,", ",")",")")});function _U(t){return function(e,r){var n=t((e=by(e)).h,(r=by(r)).h),i=hu(e.c,r.c),a=hu(e.l,r.l),s=hu(e.opacity,r.opacity);return function(l){return e.h=n(l),e.c=i(l),e.l=a(l),e.opacity=s(l),e+""}}}var BA,q3e,LU=R(()=>{"use strict";Lp();AA();o(_U,"hcl");BA=_U(hU),q3e=_U(hu)});var Np=R(()=>{"use strict";X4();wy();bU();IA();AU();_A();LU()});function Ay(){return ad||(NU(X3e),ad=Cy.now()+t3)}function X3e(){ad=0}function Sy(){this._call=this._time=this._next=null}function r3(t,e,r){var n=new Sy;return n.restart(t,e,r),n}function MU(){Ay(),++Mp;for(var t=J4,e;t;)(e=ad-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Mp}function DU(){ad=(e3=Cy.now())+t3,Mp=ky=0;try{MU()}finally{Mp=0,K3e(),ad=0}}function j3e(){var t=Cy.now(),e=t-e3;e>RU&&(t3-=e,e3=t)}function K3e(){for(var t,e=J4,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:J4=r);Ey=t,FA(n)}function FA(t){if(!Mp){ky&&(ky=clearTimeout(ky));var e=t-ad;e>24?(t<1/0&&(ky=setTimeout(DU,t-Cy.now()-t3)),Ty&&(Ty=clearInterval(Ty))):(Ty||(e3=Cy.now(),Ty=setInterval(j3e,RU)),Mp=1,NU(DU))}}var Mp,ky,Ty,RU,J4,Ey,e3,ad,t3,Cy,NU,zA=R(()=>{"use strict";Mp=0,ky=0,Ty=0,RU=1e3,e3=0,ad=0,t3=0,Cy=typeof performance=="object"&&performance.now?performance:Date,NU=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};o(Ay,"now");o(X3e,"clearNow");o(Sy,"Timer");Sy.prototype=r3.prototype={constructor:Sy,restart:o(function(t,e,r){if(typeof t!="function")throw new TypeError("callback is not a function");r=(r==null?Ay():+r)+(e==null?0:+e),!this._next&&Ey!==this&&(Ey?Ey._next=this:J4=this,Ey=this),this._call=t,this._time=r,FA()},"restart"),stop:o(function(){this._call&&(this._call=null,this._time=1/0,FA())},"stop")};o(r3,"timer");o(MU,"timerFlush");o(DU,"wake");o(j3e,"poke");o(K3e,"nap");o(FA,"sleep")});function _y(t,e,r){var n=new Sy;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var IU=R(()=>{"use strict";zA();o(_y,"default")});var n3=R(()=>{"use strict";zA();IU()});function fu(t,e,r,n,i,a){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;J3e(t,r,{name:e,index:n,group:i,on:Q3e,tween:Z3e,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:BU})}function Dy(t,e){var r=Mi(t,e);if(r.state>BU)throw new Error("too late; already scheduled");return r}function ca(t,e){var r=Mi(t,e);if(r.state>i3)throw new Error("too late; already running");return r}function Mi(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function J3e(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=r3(a,0,r.time);function a(h){r.state=OU,r.timer.restart(s,r.delay,r.time),r.delay<=h&&s(h-r.delay)}o(a,"schedule");function s(h){var f,d,p,m;if(r.state!==OU)return u();for(f in n)if(m=n[f],m.name===r.name){if(m.state===i3)return _y(s);m.state===PU?(m.state=Ly,m.timer.stop(),m.on.call("interrupt",t,t.__data__,m.index,m.group),delete n[f]):+f{"use strict";bS();n3();Q3e=xS("start","end","cancel","interrupt"),Z3e=[],BU=0,OU=1,a3=2,i3=3,PU=4,s3=5,Ly=6;o(fu,"default");o(Dy,"init");o(ca,"set");o(Mi,"get");o(J3e,"create")});function Ry(t,e){var r=t.__transition,n,i,a=!0,s;if(r){e=e==null?null:e+"";for(s in r){if((n=r[s]).name!==e){a=!1;continue}i=n.state>a3&&n.state{"use strict";ys();o(Ry,"default")});function GA(t){return this.each(function(){Ry(this,t)})}var zU=R(()=>{"use strict";FU();o(GA,"default")});function e5e(t,e){var r,n;return function(){var i=ca(this,t),a=i.tween;if(a!==r){n=r=a;for(var s=0,l=n.length;s{"use strict";ys();o(e5e,"tweenRemove");o(t5e,"tweenFunction");o($A,"default");o(Ip,"tweenValue")});function My(t,e){var r;return(typeof e=="number"?ji:e instanceof pl?id:(r=pl(e))?(e=r,id):Rp)(t,e)}var VA=R(()=>{"use strict";Lp();Np();o(My,"default")});function r5e(t){return function(){this.removeAttribute(t)}}function n5e(t){return function(){this.removeAttributeNS(t.space,t.local)}}function i5e(t,e,r){var n,i=r+"",a;return function(){var s=this.getAttribute(t);return s===i?null:s===n?a:a=e(n=s,r)}}function a5e(t,e,r){var n,i=r+"",a;return function(){var s=this.getAttributeNS(t.space,t.local);return s===i?null:s===n?a:a=e(n=s,r)}}function s5e(t,e,r){var n,i,a;return function(){var s,l=r(this),u;return l==null?void this.removeAttribute(t):(s=this.getAttribute(t),u=l+"",s===u?null:s===n&&u===i?a:(i=u,a=e(n=s,l)))}}function o5e(t,e,r){var n,i,a;return function(){var s,l=r(this),u;return l==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),u=l+"",s===u?null:s===n&&u===i?a:(i=u,a=e(n=s,l)))}}function UA(t,e){var r=ic(t),n=r==="transform"?PA:My;return this.attrTween(t,typeof e=="function"?(r.local?o5e:s5e)(r,n,Ip(this,"attr."+t,e)):e==null?(r.local?n5e:r5e)(r):(r.local?a5e:i5e)(r,n,e))}var GU=R(()=>{"use strict";Np();fl();Ny();VA();o(r5e,"attrRemove");o(n5e,"attrRemoveNS");o(i5e,"attrConstant");o(a5e,"attrConstantNS");o(s5e,"attrFunction");o(o5e,"attrFunctionNS");o(UA,"default")});function l5e(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}function c5e(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}function u5e(t,e){var r,n;function i(){var a=e.apply(this,arguments);return a!==n&&(r=(n=a)&&c5e(t,a)),r}return o(i,"tween"),i._value=e,i}function h5e(t,e){var r,n;function i(){var a=e.apply(this,arguments);return a!==n&&(r=(n=a)&&l5e(t,a)),r}return o(i,"tween"),i._value=e,i}function HA(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;var n=ic(t);return this.tween(r,(n.local?u5e:h5e)(n,e))}var $U=R(()=>{"use strict";fl();o(l5e,"attrInterpolate");o(c5e,"attrInterpolateNS");o(u5e,"attrTweenNS");o(h5e,"attrTween");o(HA,"default")});function f5e(t,e){return function(){Dy(this,t).delay=+e.apply(this,arguments)}}function d5e(t,e){return e=+e,function(){Dy(this,t).delay=e}}function YA(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?f5e:d5e)(e,t)):Mi(this.node(),e).delay}var VU=R(()=>{"use strict";ys();o(f5e,"delayFunction");o(d5e,"delayConstant");o(YA,"default")});function p5e(t,e){return function(){ca(this,t).duration=+e.apply(this,arguments)}}function m5e(t,e){return e=+e,function(){ca(this,t).duration=e}}function WA(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?p5e:m5e)(e,t)):Mi(this.node(),e).duration}var UU=R(()=>{"use strict";ys();o(p5e,"durationFunction");o(m5e,"durationConstant");o(WA,"default")});function g5e(t,e){if(typeof e!="function")throw new Error;return function(){ca(this,t).ease=e}}function qA(t){var e=this._id;return arguments.length?this.each(g5e(e,t)):Mi(this.node(),e).ease}var HU=R(()=>{"use strict";ys();o(g5e,"easeConstant");o(qA,"default")});function y5e(t,e){return function(){var r=e.apply(this,arguments);if(typeof r!="function")throw new Error;ca(this,t).ease=r}}function XA(t){if(typeof t!="function")throw new Error;return this.each(y5e(this._id,t))}var YU=R(()=>{"use strict";ys();o(y5e,"easeVarying");o(XA,"default")});function jA(t){typeof t!="function"&&(t=Ep(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i{"use strict";fl();sd();o(jA,"default")});function KA(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,n=e.length,i=r.length,a=Math.min(n,i),s=new Array(n),l=0;l{"use strict";sd();o(KA,"default")});function v5e(t){return(t+"").trim().split(/^|\s+/).every(function(e){var r=e.indexOf(".");return r>=0&&(e=e.slice(0,r)),!e||e==="start"})}function x5e(t,e,r){var n,i,a=v5e(e)?Dy:ca;return function(){var s=a(this,t),l=s.on;l!==n&&(i=(n=l).copy()).on(e,r),s.on=i}}function QA(t,e){var r=this._id;return arguments.length<2?Mi(this.node(),r).on.on(t):this.each(x5e(r,t,e))}var XU=R(()=>{"use strict";ys();o(v5e,"start");o(x5e,"onFunction");o(QA,"default")});function b5e(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function ZA(){return this.on("end.remove",b5e(this._id))}var jU=R(()=>{"use strict";o(b5e,"removeFunction");o(ZA,"default")});function JA(t){var e=this._name,r=this._id;typeof t!="function"&&(t=wh(t));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s{"use strict";fl();sd();ys();o(JA,"default")});function e8(t){var e=this._name,r=this._id;typeof t!="function"&&(t=kp(t));for(var n=this._groups,i=n.length,a=[],s=[],l=0;l{"use strict";fl();sd();ys();o(e8,"default")});function t8(){return new w5e(this._groups,this._parents)}var w5e,ZU=R(()=>{"use strict";fl();w5e=cu.prototype.constructor;o(t8,"default")});function T5e(t,e){var r,n,i;return function(){var a=Th(this,t),s=(this.style.removeProperty(t),Th(this,t));return a===s?null:a===r&&s===n?i:i=e(r=a,n=s)}}function JU(t){return function(){this.style.removeProperty(t)}}function k5e(t,e,r){var n,i=r+"",a;return function(){var s=Th(this,t);return s===i?null:s===n?a:a=e(n=s,r)}}function E5e(t,e,r){var n,i,a;return function(){var s=Th(this,t),l=r(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(t),Th(this,t))),s===u?null:s===n&&u===i?a:(i=u,a=e(n=s,l))}}function C5e(t,e){var r,n,i,a="style."+e,s="end."+a,l;return function(){var u=ca(this,t),h=u.on,f=u.value[a]==null?l||(l=JU(e)):void 0;(h!==r||i!==f)&&(n=(r=h).copy()).on(s,i=f),u.on=n}}function r8(t,e,r){var n=(t+="")=="transform"?OA:My;return e==null?this.styleTween(t,T5e(t,n)).on("end.style."+t,JU(t)):typeof e=="function"?this.styleTween(t,E5e(t,n,Ip(this,"style."+t,e))).each(C5e(this._id,t)):this.styleTween(t,k5e(t,n,e),r).on("end.style."+t,null)}var eH=R(()=>{"use strict";Np();fl();ys();Ny();VA();o(T5e,"styleNull");o(JU,"styleRemove");o(k5e,"styleConstant");o(E5e,"styleFunction");o(C5e,"styleMaybeRemove");o(r8,"default")});function S5e(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}function A5e(t,e,r){var n,i;function a(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&S5e(t,s,r)),n}return o(a,"tween"),a._value=e,a}function n8(t,e,r){var n="style."+(t+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,A5e(t,e,r??""))}var tH=R(()=>{"use strict";o(S5e,"styleInterpolate");o(A5e,"styleTween");o(n8,"default")});function _5e(t){return function(){this.textContent=t}}function L5e(t){return function(){var e=t(this);this.textContent=e??""}}function i8(t){return this.tween("text",typeof t=="function"?L5e(Ip(this,"text",t)):_5e(t==null?"":t+""))}var rH=R(()=>{"use strict";Ny();o(_5e,"textConstant");o(L5e,"textFunction");o(i8,"default")});function D5e(t){return function(e){this.textContent=t.call(this,e)}}function R5e(t){var e,r;function n(){var i=t.apply(this,arguments);return i!==r&&(e=(r=i)&&D5e(i)),e}return o(n,"tween"),n._value=t,n}function a8(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,R5e(t))}var nH=R(()=>{"use strict";o(D5e,"textInterpolate");o(R5e,"textTween");o(a8,"default")});function s8(){for(var t=this._name,e=this._id,r=o3(),n=this._groups,i=n.length,a=0;a{"use strict";sd();ys();o(s8,"default")});function o8(){var t,e,r=this,n=r._id,i=r.size();return new Promise(function(a,s){var l={value:s},u={value:o(function(){--i===0&&a()},"value")};r.each(function(){var h=ca(this,n),f=h.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(u)),h.on=e}),i===0&&a()})}var aH=R(()=>{"use strict";ys();o(o8,"default")});function Ka(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function sH(t){return cu().transition(t)}function o3(){return++N5e}var N5e,du,sd=R(()=>{"use strict";fl();GU();$U();VU();UU();HU();YU();WU();qU();XU();jU();KU();QU();ZU();eH();tH();rH();nH();iH();Ny();aH();N5e=0;o(Ka,"Transition");o(sH,"transition");o(o3,"newId");du=cu.prototype;Ka.prototype=sH.prototype={constructor:Ka,select:JA,selectAll:e8,selectChild:du.selectChild,selectChildren:du.selectChildren,filter:jA,merge:KA,selection:t8,transition:s8,call:du.call,nodes:du.nodes,node:du.node,size:du.size,empty:du.empty,each:du.each,on:QA,attr:UA,attrTween:HA,style:r8,styleTween:n8,text:i8,textTween:a8,remove:ZA,tween:$A,delay:YA,duration:WA,ease:qA,easeVarying:XA,end:o8,[Symbol.iterator]:du[Symbol.iterator]}});function l3(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var oH=R(()=>{"use strict";o(l3,"cubicInOut")});var l8=R(()=>{"use strict";oH()});function I5e(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}function c8(t){var e,r;t instanceof Ka?(e=t._id,t=t._name):(e=o3(),(r=M5e).time=Ay(),t=t==null?null:t+"");for(var n=this._groups,i=n.length,a=0;a{"use strict";sd();ys();l8();n3();M5e={time:null,delay:0,duration:250,ease:l3};o(I5e,"inherit");o(c8,"default")});var cH=R(()=>{"use strict";fl();zU();lH();cu.prototype.interrupt=GA;cu.prototype.transition=c8});var c3=R(()=>{"use strict";cH()});var uH=R(()=>{"use strict"});var hH=R(()=>{"use strict"});var fH=R(()=>{"use strict"});function dH(t){return[+t[0],+t[1]]}function O5e(t){return[dH(t[0]),dH(t[1])]}function u8(t){return{type:t}}var Kpt,Qpt,Zpt,Jpt,emt,tmt,pH=R(()=>{"use strict";c3();uH();hH();fH();({abs:Kpt,max:Qpt,min:Zpt}=Math);o(dH,"number1");o(O5e,"number2");Jpt={name:"x",handles:["w","e"].map(u8),input:o(function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},"input"),output:o(function(t){return t&&[t[0][0],t[1][0]]},"output")},emt={name:"y",handles:["n","s"].map(u8),input:o(function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},"input"),output:o(function(t){return t&&[t[0][1],t[1][1]]},"output")},tmt={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(u8),input:o(function(t){return t==null?null:O5e(t)},"input"),output:o(function(t){return t},"output")};o(u8,"type")});var mH=R(()=>{"use strict";pH()});function gH(t){this._+=t[0];for(let e=1,r=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return gH;let r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;i{"use strict";h8=Math.PI,f8=2*h8,od=1e-6,P5e=f8-od;o(gH,"append");o(B5e,"appendRound");ld=class{static{o(this,"Path")}constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?gH:B5e(e)}moveTo(e,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,r){this._append`L${this._x1=+e},${this._y1=+r}`}quadraticCurveTo(e,r,n,i){this._append`Q${+e},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(e,r,n,i,a,s){this._append`C${+e},${+r},${+n},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(e,r,n,i,a){if(e=+e,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,l=this._y1,u=n-e,h=i-r,f=s-e,d=l-r,p=f*f+d*d;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(p>od)if(!(Math.abs(d*u-h*f)>od)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let m=n-s,g=i-l,y=u*u+h*h,v=m*m+g*g,x=Math.sqrt(y),b=Math.sqrt(p),w=a*Math.tan((h8-Math.acos((y+p-v)/(2*x*b)))/2),S=w/b,T=w/x;Math.abs(S-1)>od&&this._append`L${e+S*f},${r+S*d}`,this._append`A${a},${a},0,0,${+(d*m>f*g)},${this._x1=e+T*u},${this._y1=r+T*h}`}}arc(e,r,n,i,a,s){if(e=+e,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),u=n*Math.sin(i),h=e+l,f=r+u,d=1^s,p=s?i-a:a-i;this._x1===null?this._append`M${h},${f}`:(Math.abs(this._x1-h)>od||Math.abs(this._y1-f)>od)&&this._append`L${h},${f}`,n&&(p<0&&(p=p%f8+f8),p>P5e?this._append`A${n},${n},0,1,${d},${e-l},${r-u}A${n},${n},0,1,${d},${this._x1=h},${this._y1=f}`:p>od&&this._append`A${n},${n},0,${+(p>=h8)},${d},${this._x1=e+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};o(yH,"path");yH.prototype=ld.prototype});var d8=R(()=>{"use strict";vH()});var xH=R(()=>{"use strict"});var bH=R(()=>{"use strict"});var wH=R(()=>{"use strict"});var TH=R(()=>{"use strict"});var kH=R(()=>{"use strict"});var EH=R(()=>{"use strict"});var CH=R(()=>{"use strict"});function p8(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function cd(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}var Iy=R(()=>{"use strict";o(p8,"default");o(cd,"formatDecimalParts")});function ml(t){return t=cd(Math.abs(t)),t?t[1]:NaN}var Oy=R(()=>{"use strict";Iy();o(ml,"default")});function m8(t,e){return function(r,n){for(var i=r.length,a=[],s=0,l=t[0],u=0;i>0&&l>0&&(u+l+1>n&&(l=Math.max(1,n-u)),a.push(r.substring(i-=l,i+l)),!((u+=l+1)>n));)l=t[s=(s+1)%t.length];return a.reverse().join(e)}}var SH=R(()=>{"use strict";o(m8,"default")});function g8(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var AH=R(()=>{"use strict";o(g8,"default")});function Sh(t){if(!(e=F5e.exec(t)))throw new Error("invalid format: "+t);var e;return new u3({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function u3(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}var F5e,y8=R(()=>{"use strict";F5e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;o(Sh,"formatSpecifier");Sh.prototype=u3.prototype;o(u3,"FormatSpecifier");u3.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 v8(t){e:for(var e=t.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var _H=R(()=>{"use strict";o(v8,"default")});function b8(t,e){var r=cd(t,e);if(!r)return t+"";var n=r[0],i=r[1],a=i-(x8=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+cd(t,Math.max(0,e+a-1))[0]}var x8,w8=R(()=>{"use strict";Iy();o(b8,"default")});function h3(t,e){var r=cd(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}var LH=R(()=>{"use strict";Iy();o(h3,"default")});var T8,DH=R(()=>{"use strict";Iy();w8();LH();T8={"%":o((t,e)=>(t*100).toFixed(e),"%"),b:o(t=>Math.round(t).toString(2),"b"),c:o(t=>t+"","c"),d:p8,e:o((t,e)=>t.toExponential(e),"e"),f:o((t,e)=>t.toFixed(e),"f"),g:o((t,e)=>t.toPrecision(e),"g"),o:o(t=>Math.round(t).toString(8),"o"),p:o((t,e)=>h3(t*100,e),"p"),r:h3,s:b8,X:o(t=>Math.round(t).toString(16).toUpperCase(),"X"),x:o(t=>Math.round(t).toString(16),"x")}});function f3(t){return t}var RH=R(()=>{"use strict";o(f3,"default")});function k8(t){var e=t.grouping===void 0||t.thousands===void 0?f3:m8(NH.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?f3:g8(NH.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",l=t.minus===void 0?"\u2212":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function h(d){d=Sh(d);var p=d.fill,m=d.align,g=d.sign,y=d.symbol,v=d.zero,x=d.width,b=d.comma,w=d.precision,S=d.trim,T=d.type;T==="n"?(b=!0,T="g"):T8[T]||(w===void 0&&(w=12),S=!0,T="g"),(v||p==="0"&&m==="=")&&(v=!0,p="0",m="=");var E=y==="$"?r:y==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():"",_=y==="$"?n:/[%p]/.test(T)?s:"",A=T8[T],L=/[defgprs%]/.test(T);w=w===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function M(N){var k=E,I=_,C,O,D;if(T==="c")I=A(N)+I,N="";else{N=+N;var P=N<0||1/N<0;if(N=isNaN(N)?u:A(Math.abs(N),w),S&&(N=v8(N)),P&&+N==0&&g!=="+"&&(P=!1),k=(P?g==="("?g:l:g==="-"||g==="("?"":g)+k,I=(T==="s"?MH[8+x8/3]:"")+I+(P&&g==="("?")":""),L){for(C=-1,O=N.length;++CD||D>57){I=(D===46?i+N.slice(C+1):N.slice(C))+I,N=N.slice(0,C);break}}}b&&!v&&(N=e(N,1/0));var F=k.length+N.length+I.length,B=F>1)+k+N+I+B.slice(F);break;default:N=B+k+N+I;break}return a(N)}return o(M,"format"),M.toString=function(){return d+""},M}o(h,"newFormat");function f(d,p){var m=h((d=Sh(d),d.type="f",d)),g=Math.max(-8,Math.min(8,Math.floor(ml(p)/3)))*3,y=Math.pow(10,-g),v=MH[8+g/3];return function(x){return m(y*x)+v}}return o(f,"formatPrefix"),{format:h,formatPrefix:f}}var NH,MH,IH=R(()=>{"use strict";Oy();SH();AH();y8();_H();DH();w8();RH();NH=Array.prototype.map,MH=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];o(k8,"default")});function E8(t){return d3=k8(t),p3=d3.format,m3=d3.formatPrefix,d3}var d3,p3,m3,OH=R(()=>{"use strict";IH();E8({thousands:",",grouping:[3],currency:["$",""]});o(E8,"defaultLocale")});function g3(t){return Math.max(0,-ml(Math.abs(t)))}var PH=R(()=>{"use strict";Oy();o(g3,"default")});function y3(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ml(e)/3)))*3-ml(Math.abs(t)))}var BH=R(()=>{"use strict";Oy();o(y3,"default")});function v3(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,ml(e)-ml(t))+1}var FH=R(()=>{"use strict";Oy();o(v3,"default")});var C8=R(()=>{"use strict";OH();y8();PH();BH();FH()});var zH=R(()=>{"use strict"});var GH=R(()=>{"use strict"});var $H=R(()=>{"use strict"});var VH=R(()=>{"use strict"});function Ah(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}var Py=R(()=>{"use strict";o(Ah,"initRange")});function pu(){var t=new wp,e=[],r=[],n=S8;function i(a){let s=t.get(a);if(s===void 0){if(n!==S8)return n;t.set(a,s=e.push(a)-1)}return r[s%r.length]}return o(i,"scale"),i.domain=function(a){if(!arguments.length)return e.slice();e=[],t=new wp;for(let s of a)t.has(s)||t.set(s,e.push(s)-1);return i},i.range=function(a){return arguments.length?(r=Array.from(a),i):r.slice()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return pu(e,r).unknown(n)},Ah.apply(i,arguments),i}var S8,A8=R(()=>{"use strict";bh();Py();S8=Symbol("implicit");o(pu,"ordinal")});function Op(){var t=pu().unknown(void 0),e=t.domain,r=t.range,n=0,i=1,a,s,l=!1,u=0,h=0,f=.5;delete t.unknown;function d(){var p=e().length,m=i{"use strict";bh();Py();A8();o(Op,"band")});function _8(t){return function(){return t}}var HH=R(()=>{"use strict";o(_8,"constants")});function L8(t){return+t}var YH=R(()=>{"use strict";o(L8,"number")});function Pp(t){return t}function D8(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:_8(isNaN(e)?NaN:.5)}function z5e(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function G5e(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i2?$5e:G5e,u=h=null,d}o(f,"rescale");function d(p){return p==null||isNaN(p=+p)?a:(u||(u=l(t.map(n),e,r)))(n(s(p)))}return o(d,"scale"),d.invert=function(p){return s(i((h||(h=l(e,t.map(n),ji)))(p)))},d.domain=function(p){return arguments.length?(t=Array.from(p,L8),f()):t.slice()},d.range=function(p){return arguments.length?(e=Array.from(p),f()):e.slice()},d.rangeRound=function(p){return e=Array.from(p),r=j4,f()},d.clamp=function(p){return arguments.length?(s=p?!0:Pp,f()):s!==Pp},d.interpolate=function(p){return arguments.length?(r=p,f()):r},d.unknown=function(p){return arguments.length?(a=p,d):a},function(p,m){return n=p,i=m,f()}}function By(){return V5e()(Pp,Pp)}var WH,R8=R(()=>{"use strict";bh();Np();HH();YH();WH=[0,1];o(Pp,"identity");o(D8,"normalize");o(z5e,"clamper");o(G5e,"bimap");o($5e,"polymap");o(x3,"copy");o(V5e,"transformer");o(By,"continuous")});function N8(t,e,r,n){var i=Tp(t,e,r),a;switch(n=Sh(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=y3(i,s))&&(n.precision=a),m3(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=v3(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=g3(i))&&(n.precision=a-(n.type==="%")*2);break}}return p3(n)}var qH=R(()=>{"use strict";bh();C8();o(N8,"tickFormat")});function U5e(t){var e=t.domain;return t.ticks=function(r){var n=e();return N4(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return N8(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,a=n.length-1,s=n[i],l=n[a],u,h,f=10;for(l0;){if(h=fy(s,l,r),h===u)return n[i]=s,n[a]=l,e(n);if(h>0)s=Math.floor(s/h)*h,l=Math.ceil(l/h)*h;else if(h<0)s=Math.ceil(s*h)/h,l=Math.floor(l*h)/h;else break;u=h}return t},t}function gl(){var t=By();return t.copy=function(){return x3(t,gl())},Ah.apply(t,arguments),U5e(t)}var XH=R(()=>{"use strict";bh();R8();Py();qH();o(U5e,"linearish");o(gl,"linear")});function M8(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a{"use strict";o(M8,"nice")});function dn(t,e,r,n){function i(a){return t(a=arguments.length===0?new Date:new Date(+a)),a}return o(i,"interval"),i.floor=a=>(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{let s=i(a),l=i.ceil(a);return a-s(e(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,l)=>{let u=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a0))return u;let h;do u.push(h=new Date(+a)),e(a,l),t(a);while(hdn(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;e(s,-1),!a(s););else for(;--l>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>(I8.setTime(+a),O8.setTime(+s),t(I8),t(O8),Math.floor(r(I8,O8))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}var I8,O8,mu=R(()=>{"use strict";I8=new Date,O8=new Date;o(dn,"timeInterval")});var oc,KH,P8=R(()=>{"use strict";mu();oc=dn(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);oc.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?dn(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):oc);KH=oc.range});var Ks,QH,B8=R(()=>{"use strict";mu();Ks=dn(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),QH=Ks.range});var gu,H5e,b3,Y5e,F8=R(()=>{"use strict";mu();gu=dn(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),H5e=gu.range,b3=dn(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),Y5e=b3.range});var yu,W5e,w3,q5e,z8=R(()=>{"use strict";mu();yu=dn(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),W5e=yu.range,w3=dn(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),q5e=w3.range});var Do,X5e,zy,j5e,T3,K5e,G8=R(()=>{"use strict";mu();Do=dn(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),X5e=Do.range,zy=dn(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),j5e=zy.range,T3=dn(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),K5e=T3.range});function fd(t){return dn(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}function dd(t){return dn(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/6048e5)}var yl,_h,k3,E3,cc,C3,S3,JH,Q5e,Z5e,J5e,ewe,twe,rwe,pd,Bp,eY,tY,Lh,rY,nY,iY,nwe,iwe,awe,swe,owe,lwe,$8=R(()=>{"use strict";mu();o(fd,"timeWeekday");yl=fd(0),_h=fd(1),k3=fd(2),E3=fd(3),cc=fd(4),C3=fd(5),S3=fd(6),JH=yl.range,Q5e=_h.range,Z5e=k3.range,J5e=E3.range,ewe=cc.range,twe=C3.range,rwe=S3.range;o(dd,"utcWeekday");pd=dd(0),Bp=dd(1),eY=dd(2),tY=dd(3),Lh=dd(4),rY=dd(5),nY=dd(6),iY=pd.range,nwe=Bp.range,iwe=eY.range,awe=tY.range,swe=Lh.range,owe=rY.range,lwe=nY.range});var vu,cwe,A3,uwe,V8=R(()=>{"use strict";mu();vu=dn(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),cwe=vu.range,A3=dn(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),uwe=A3.range});var Qs,hwe,vl,fwe,U8=R(()=>{"use strict";mu();Qs=dn(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Qs.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:dn(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});hwe=Qs.range,vl=dn(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());vl.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:dn(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});fwe=vl.range});function sY(t,e,r,n,i,a){let s=[[Ks,1,1e3],[Ks,5,5*1e3],[Ks,15,15*1e3],[Ks,30,30*1e3],[a,1,6e4],[a,5,5*6e4],[a,15,15*6e4],[a,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[n,1,864e5],[n,2,2*864e5],[r,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function l(h,f,d){let p=fv).right(s,p);if(m===s.length)return t.every(Tp(h/31536e6,f/31536e6,d));if(m===0)return oc.every(Math.max(Tp(h,f,d),1));let[g,y]=s[p/s[m-1][2]{"use strict";bh();P8();B8();F8();z8();G8();$8();V8();U8();o(sY,"ticker");[pwe,mwe]=sY(vl,A3,pd,T3,w3,b3),[H8,Y8]=sY(Qs,vu,yl,Do,yu,gu)});var _3=R(()=>{"use strict";P8();B8();F8();z8();G8();$8();V8();U8();oY()});function W8(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function q8(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Gy(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function X8(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,a=t.days,s=t.shortDays,l=t.months,u=t.shortMonths,h=$y(i),f=Vy(i),d=$y(a),p=Vy(a),m=$y(s),g=Vy(s),y=$y(l),v=Vy(l),x=$y(u),b=Vy(u),w={a:P,A:F,b:B,B:$,c:null,d:dY,e:dY,f:Fwe,g:Xwe,G:Kwe,H:Owe,I:Pwe,j:Bwe,L:vY,m:zwe,M:Gwe,p:z,q:Y,Q:gY,s:yY,S:$we,u:Vwe,U:Uwe,V:Hwe,w:Ywe,W:Wwe,x:null,X:null,y:qwe,Y:jwe,Z:Qwe,"%":mY},S={a:Q,A:X,b:ie,B:j,c:null,d:pY,e:pY,f:tTe,g:hTe,G:dTe,H:Zwe,I:Jwe,j:eTe,L:bY,m:rTe,M:nTe,p:J,q:Z,Q:gY,s:yY,S:iTe,u:aTe,U:sTe,V:oTe,w:lTe,W:cTe,x:null,X:null,y:uTe,Y:fTe,Z:pTe,"%":mY},T={a:M,A:N,b:k,B:I,c:C,d:hY,e:hY,f:Rwe,g:uY,G:cY,H:fY,I:fY,j:Awe,L:Dwe,m:Swe,M:_we,p:L,q:Cwe,Q:Mwe,s:Iwe,S:Lwe,u:bwe,U:wwe,V:Twe,w:xwe,W:kwe,x:O,X:D,y:uY,Y:cY,Z:Ewe,"%":Nwe};w.x=E(r,w),w.X=E(n,w),w.c=E(e,w),S.x=E(r,S),S.X=E(n,S),S.c=E(e,S);function E(H,q){return function(K){var se=[],ce=-1,ue=0,te=H.length,De,oe,ke;for(K instanceof Date||(K=new Date(+K));++ce53)return null;"w"in se||(se.w=1),"Z"in se?(ue=q8(Gy(se.y,0,1)),te=ue.getUTCDay(),ue=te>4||te===0?Bp.ceil(ue):Bp(ue),ue=zy.offset(ue,(se.V-1)*7),se.y=ue.getUTCFullYear(),se.m=ue.getUTCMonth(),se.d=ue.getUTCDate()+(se.w+6)%7):(ue=W8(Gy(se.y,0,1)),te=ue.getDay(),ue=te>4||te===0?_h.ceil(ue):_h(ue),ue=Do.offset(ue,(se.V-1)*7),se.y=ue.getFullYear(),se.m=ue.getMonth(),se.d=ue.getDate()+(se.w+6)%7)}else("W"in se||"U"in se)&&("w"in se||(se.w="u"in se?se.u%7:"W"in se?1:0),te="Z"in se?q8(Gy(se.y,0,1)).getUTCDay():W8(Gy(se.y,0,1)).getDay(),se.m=0,se.d="W"in se?(se.w+6)%7+se.W*7-(te+5)%7:se.w+se.U*7-(te+6)%7);return"Z"in se?(se.H+=se.Z/100|0,se.M+=se.Z%100,q8(se)):W8(se)}}o(_,"newParse");function A(H,q,K,se){for(var ce=0,ue=q.length,te=K.length,De,oe;ce=te)return-1;if(De=q.charCodeAt(ce++),De===37){if(De=q.charAt(ce++),oe=T[De in lY?q.charAt(ce++):De],!oe||(se=oe(H,K,se))<0)return-1}else if(De!=K.charCodeAt(se++))return-1}return se}o(A,"parseSpecifier");function L(H,q,K){var se=h.exec(q.slice(K));return se?(H.p=f.get(se[0].toLowerCase()),K+se[0].length):-1}o(L,"parsePeriod");function M(H,q,K){var se=m.exec(q.slice(K));return se?(H.w=g.get(se[0].toLowerCase()),K+se[0].length):-1}o(M,"parseShortWeekday");function N(H,q,K){var se=d.exec(q.slice(K));return se?(H.w=p.get(se[0].toLowerCase()),K+se[0].length):-1}o(N,"parseWeekday");function k(H,q,K){var se=x.exec(q.slice(K));return se?(H.m=b.get(se[0].toLowerCase()),K+se[0].length):-1}o(k,"parseShortMonth");function I(H,q,K){var se=y.exec(q.slice(K));return se?(H.m=v.get(se[0].toLowerCase()),K+se[0].length):-1}o(I,"parseMonth");function C(H,q,K){return A(H,e,q,K)}o(C,"parseLocaleDateTime");function O(H,q,K){return A(H,r,q,K)}o(O,"parseLocaleDate");function D(H,q,K){return A(H,n,q,K)}o(D,"parseLocaleTime");function P(H){return s[H.getDay()]}o(P,"formatShortWeekday");function F(H){return a[H.getDay()]}o(F,"formatWeekday");function B(H){return u[H.getMonth()]}o(B,"formatShortMonth");function $(H){return l[H.getMonth()]}o($,"formatMonth");function z(H){return i[+(H.getHours()>=12)]}o(z,"formatPeriod");function Y(H){return 1+~~(H.getMonth()/3)}o(Y,"formatQuarter");function Q(H){return s[H.getUTCDay()]}o(Q,"formatUTCShortWeekday");function X(H){return a[H.getUTCDay()]}o(X,"formatUTCWeekday");function ie(H){return u[H.getUTCMonth()]}o(ie,"formatUTCShortMonth");function j(H){return l[H.getUTCMonth()]}o(j,"formatUTCMonth");function J(H){return i[+(H.getUTCHours()>=12)]}o(J,"formatUTCPeriod");function Z(H){return 1+~~(H.getUTCMonth()/3)}return o(Z,"formatUTCQuarter"),{format:o(function(H){var q=E(H+="",w);return q.toString=function(){return H},q},"format"),parse:o(function(H){var q=_(H+="",!1);return q.toString=function(){return H},q},"parse"),utcFormat:o(function(H){var q=E(H+="",S);return q.toString=function(){return H},q},"utcFormat"),utcParse:o(function(H){var q=_(H+="",!0);return q.toString=function(){return H},q},"utcParse")}}function Pr(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function xwe(t,e,r){var n=Ki.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function bwe(t,e,r){var n=Ki.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function wwe(t,e,r){var n=Ki.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function Twe(t,e,r){var n=Ki.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function kwe(t,e,r){var n=Ki.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function cY(t,e,r){var n=Ki.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function uY(t,e,r){var n=Ki.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Ewe(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Cwe(t,e,r){var n=Ki.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function Swe(t,e,r){var n=Ki.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function hY(t,e,r){var n=Ki.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Awe(t,e,r){var n=Ki.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function fY(t,e,r){var n=Ki.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function _we(t,e,r){var n=Ki.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Lwe(t,e,r){var n=Ki.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Dwe(t,e,r){var n=Ki.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Rwe(t,e,r){var n=Ki.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Nwe(t,e,r){var n=gwe.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Mwe(t,e,r){var n=Ki.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function Iwe(t,e,r){var n=Ki.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function dY(t,e){return Pr(t.getDate(),e,2)}function Owe(t,e){return Pr(t.getHours(),e,2)}function Pwe(t,e){return Pr(t.getHours()%12||12,e,2)}function Bwe(t,e){return Pr(1+Do.count(Qs(t),t),e,3)}function vY(t,e){return Pr(t.getMilliseconds(),e,3)}function Fwe(t,e){return vY(t,e)+"000"}function zwe(t,e){return Pr(t.getMonth()+1,e,2)}function Gwe(t,e){return Pr(t.getMinutes(),e,2)}function $we(t,e){return Pr(t.getSeconds(),e,2)}function Vwe(t){var e=t.getDay();return e===0?7:e}function Uwe(t,e){return Pr(yl.count(Qs(t)-1,t),e,2)}function xY(t){var e=t.getDay();return e>=4||e===0?cc(t):cc.ceil(t)}function Hwe(t,e){return t=xY(t),Pr(cc.count(Qs(t),t)+(Qs(t).getDay()===4),e,2)}function Ywe(t){return t.getDay()}function Wwe(t,e){return Pr(_h.count(Qs(t)-1,t),e,2)}function qwe(t,e){return Pr(t.getFullYear()%100,e,2)}function Xwe(t,e){return t=xY(t),Pr(t.getFullYear()%100,e,2)}function jwe(t,e){return Pr(t.getFullYear()%1e4,e,4)}function Kwe(t,e){var r=t.getDay();return t=r>=4||r===0?cc(t):cc.ceil(t),Pr(t.getFullYear()%1e4,e,4)}function Qwe(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Pr(e/60|0,"0",2)+Pr(e%60,"0",2)}function pY(t,e){return Pr(t.getUTCDate(),e,2)}function Zwe(t,e){return Pr(t.getUTCHours(),e,2)}function Jwe(t,e){return Pr(t.getUTCHours()%12||12,e,2)}function eTe(t,e){return Pr(1+zy.count(vl(t),t),e,3)}function bY(t,e){return Pr(t.getUTCMilliseconds(),e,3)}function tTe(t,e){return bY(t,e)+"000"}function rTe(t,e){return Pr(t.getUTCMonth()+1,e,2)}function nTe(t,e){return Pr(t.getUTCMinutes(),e,2)}function iTe(t,e){return Pr(t.getUTCSeconds(),e,2)}function aTe(t){var e=t.getUTCDay();return e===0?7:e}function sTe(t,e){return Pr(pd.count(vl(t)-1,t),e,2)}function wY(t){var e=t.getUTCDay();return e>=4||e===0?Lh(t):Lh.ceil(t)}function oTe(t,e){return t=wY(t),Pr(Lh.count(vl(t),t)+(vl(t).getUTCDay()===4),e,2)}function lTe(t){return t.getUTCDay()}function cTe(t,e){return Pr(Bp.count(vl(t)-1,t),e,2)}function uTe(t,e){return Pr(t.getUTCFullYear()%100,e,2)}function hTe(t,e){return t=wY(t),Pr(t.getUTCFullYear()%100,e,2)}function fTe(t,e){return Pr(t.getUTCFullYear()%1e4,e,4)}function dTe(t,e){var r=t.getUTCDay();return t=r>=4||r===0?Lh(t):Lh.ceil(t),Pr(t.getUTCFullYear()%1e4,e,4)}function pTe(){return"+0000"}function mY(){return"%"}function gY(t){return+t}function yY(t){return Math.floor(+t/1e3)}var lY,Ki,gwe,ywe,TY=R(()=>{"use strict";_3();o(W8,"localDate");o(q8,"utcDate");o(Gy,"newDate");o(X8,"formatLocale");lY={"-":"",_:" ",0:"0"},Ki=/^\s*\d+/,gwe=/^%/,ywe=/[\\^$*+?|[\]().{}]/g;o(Pr,"pad");o(vwe,"requote");o($y,"formatRe");o(Vy,"formatLookup");o(xwe,"parseWeekdayNumberSunday");o(bwe,"parseWeekdayNumberMonday");o(wwe,"parseWeekNumberSunday");o(Twe,"parseWeekNumberISO");o(kwe,"parseWeekNumberMonday");o(cY,"parseFullYear");o(uY,"parseYear");o(Ewe,"parseZone");o(Cwe,"parseQuarter");o(Swe,"parseMonthNumber");o(hY,"parseDayOfMonth");o(Awe,"parseDayOfYear");o(fY,"parseHour24");o(_we,"parseMinutes");o(Lwe,"parseSeconds");o(Dwe,"parseMilliseconds");o(Rwe,"parseMicroseconds");o(Nwe,"parseLiteralPercent");o(Mwe,"parseUnixTimestamp");o(Iwe,"parseUnixTimestampSeconds");o(dY,"formatDayOfMonth");o(Owe,"formatHour24");o(Pwe,"formatHour12");o(Bwe,"formatDayOfYear");o(vY,"formatMilliseconds");o(Fwe,"formatMicroseconds");o(zwe,"formatMonthNumber");o(Gwe,"formatMinutes");o($we,"formatSeconds");o(Vwe,"formatWeekdayNumberMonday");o(Uwe,"formatWeekNumberSunday");o(xY,"dISO");o(Hwe,"formatWeekNumberISO");o(Ywe,"formatWeekdayNumberSunday");o(Wwe,"formatWeekNumberMonday");o(qwe,"formatYear");o(Xwe,"formatYearISO");o(jwe,"formatFullYear");o(Kwe,"formatFullYearISO");o(Qwe,"formatZone");o(pY,"formatUTCDayOfMonth");o(Zwe,"formatUTCHour24");o(Jwe,"formatUTCHour12");o(eTe,"formatUTCDayOfYear");o(bY,"formatUTCMilliseconds");o(tTe,"formatUTCMicroseconds");o(rTe,"formatUTCMonthNumber");o(nTe,"formatUTCMinutes");o(iTe,"formatUTCSeconds");o(aTe,"formatUTCWeekdayNumberMonday");o(sTe,"formatUTCWeekNumberSunday");o(wY,"UTCdISO");o(oTe,"formatUTCWeekNumberISO");o(lTe,"formatUTCWeekdayNumberSunday");o(cTe,"formatUTCWeekNumberMonday");o(uTe,"formatUTCYear");o(hTe,"formatUTCYearISO");o(fTe,"formatUTCFullYear");o(dTe,"formatUTCFullYearISO");o(pTe,"formatUTCZone");o(mY,"formatLiteralPercent");o(gY,"formatUnixTimestamp");o(yY,"formatUnixTimestampSeconds")});function j8(t){return Fp=X8(t),md=Fp.format,kY=Fp.parse,EY=Fp.utcFormat,CY=Fp.utcParse,Fp}var Fp,md,kY,EY,CY,SY=R(()=>{"use strict";TY();j8({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"]});o(j8,"defaultLocale")});var K8=R(()=>{"use strict";SY()});function mTe(t){return new Date(t)}function gTe(t){return t instanceof Date?+t:+new Date(+t)}function AY(t,e,r,n,i,a,s,l,u,h){var f=By(),d=f.invert,p=f.domain,m=h(".%L"),g=h(":%S"),y=h("%I:%M"),v=h("%I %p"),x=h("%a %d"),b=h("%b %d"),w=h("%B"),S=h("%Y");function T(E){return(u(E){"use strict";_3();K8();R8();Py();jH();o(mTe,"date");o(gTe,"number");o(AY,"calendar");o(L3,"time")});var LY=R(()=>{"use strict";UH();XH();A8();_Y()});function Q8(t){for(var e=t.length/6|0,r=new Array(e),n=0;n{"use strict";o(Q8,"default")});var Z8,RY=R(()=>{"use strict";DY();Z8=Q8("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab")});var NY=R(()=>{"use strict";RY()});function Nn(t){return o(function(){return t},"constant")}var D3=R(()=>{"use strict";o(Nn,"default")});function IY(t){return t>1?0:t<-1?zp:Math.acos(t)}function e_(t){return t>=1?Uy:t<=-1?-Uy:Math.asin(t)}var J8,ua,Dh,MY,R3,xl,gd,Qi,zp,Uy,Gp,N3=R(()=>{"use strict";J8=Math.abs,ua=Math.atan2,Dh=Math.cos,MY=Math.max,R3=Math.min,xl=Math.sin,gd=Math.sqrt,Qi=1e-12,zp=Math.PI,Uy=zp/2,Gp=2*zp;o(IY,"acos");o(e_,"asin")});function M3(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{let n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new ld(e)}var t_=R(()=>{"use strict";d8();o(M3,"withPath")});function yTe(t){return t.innerRadius}function vTe(t){return t.outerRadius}function xTe(t){return t.startAngle}function bTe(t){return t.endAngle}function wTe(t){return t&&t.padAngle}function TTe(t,e,r,n,i,a,s,l){var u=r-t,h=n-e,f=s-i,d=l-a,p=d*u-f*h;if(!(p*pC*C+O*O&&(A=M,L=N),{cx:A,cy:L,x01:-f,y01:-d,x11:A*(i/T-1),y11:L*(i/T-1)}}function bl(){var t=yTe,e=vTe,r=Nn(0),n=null,i=xTe,a=bTe,s=wTe,l=null,u=M3(h);function h(){var f,d,p=+t.apply(this,arguments),m=+e.apply(this,arguments),g=i.apply(this,arguments)-Uy,y=a.apply(this,arguments)-Uy,v=J8(y-g),x=y>g;if(l||(l=f=u()),mQi))l.moveTo(0,0);else if(v>Gp-Qi)l.moveTo(m*Dh(g),m*xl(g)),l.arc(0,0,m,g,y,!x),p>Qi&&(l.moveTo(p*Dh(y),p*xl(y)),l.arc(0,0,p,y,g,x));else{var b=g,w=y,S=g,T=y,E=v,_=v,A=s.apply(this,arguments)/2,L=A>Qi&&(n?+n.apply(this,arguments):gd(p*p+m*m)),M=R3(J8(m-p)/2,+r.apply(this,arguments)),N=M,k=M,I,C;if(L>Qi){var O=e_(L/p*xl(A)),D=e_(L/m*xl(A));(E-=O*2)>Qi?(O*=x?1:-1,S+=O,T-=O):(E=0,S=T=(g+y)/2),(_-=D*2)>Qi?(D*=x?1:-1,b+=D,w-=D):(_=0,b=w=(g+y)/2)}var P=m*Dh(b),F=m*xl(b),B=p*Dh(T),$=p*xl(T);if(M>Qi){var z=m*Dh(w),Y=m*xl(w),Q=p*Dh(S),X=p*xl(S),ie;if(vQi?k>Qi?(I=I3(Q,X,P,F,m,k,x),C=I3(z,Y,B,$,m,k,x),l.moveTo(I.cx+I.x01,I.cy+I.y01),kQi)||!(E>Qi)?l.lineTo(B,$):N>Qi?(I=I3(B,$,z,Y,p,-N,x),C=I3(P,F,Q,X,p,-N,x),l.lineTo(I.cx+I.x01,I.cy+I.y01),N{"use strict";D3();N3();t_();o(yTe,"arcInnerRadius");o(vTe,"arcOuterRadius");o(xTe,"arcStartAngle");o(bTe,"arcEndAngle");o(wTe,"arcPadAngle");o(TTe,"intersect");o(I3,"cornerTangents");o(bl,"default")});function Hy(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}var Dyt,r_=R(()=>{"use strict";Dyt=Array.prototype.slice;o(Hy,"default")});function PY(t){this._context=t}function xu(t){return new PY(t)}var n_=R(()=>{"use strict";o(PY,"Linear");PY.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(function(){this._point=0},"lineStart"),lineEnd:o(function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:o(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}},"point")};o(xu,"default")});function BY(t){return t[0]}function FY(t){return t[1]}var zY=R(()=>{"use strict";o(BY,"x");o(FY,"y")});function ha(t,e){var r=Nn(!0),n=null,i=xu,a=null,s=M3(l);t=typeof t=="function"?t:t===void 0?BY:Nn(t),e=typeof e=="function"?e:e===void 0?FY:Nn(e);function l(u){var h,f=(u=Hy(u)).length,d,p=!1,m;for(n==null&&(a=i(m=s())),h=0;h<=f;++h)!(h{"use strict";r_();D3();n_();t_();zY();o(ha,"default")});function i_(t,e){return et?1:e>=t?0:NaN}var $Y=R(()=>{"use strict";o(i_,"default")});function a_(t){return t}var VY=R(()=>{"use strict";o(a_,"default")});function O3(){var t=a_,e=i_,r=null,n=Nn(0),i=Nn(Gp),a=Nn(0);function s(l){var u,h=(l=Hy(l)).length,f,d,p=0,m=new Array(h),g=new Array(h),y=+n.apply(this,arguments),v=Math.min(Gp,Math.max(-Gp,i.apply(this,arguments)-y)),x,b=Math.min(Math.abs(v)/h,a.apply(this,arguments)),w=b*(v<0?-1:1),S;for(u=0;u0&&(p+=S);for(e!=null?m.sort(function(T,E){return e(g[T],g[E])}):r!=null&&m.sort(function(T,E){return r(l[T],l[E])}),u=0,d=p?(v-h*w)/p:0;u0?S*d:0)+w,g[f]={data:l[f],index:u,value:S,startAngle:y,endAngle:x,padAngle:b};return g}return o(s,"pie"),s.value=function(l){return arguments.length?(t=typeof l=="function"?l:Nn(+l),s):t},s.sortValues=function(l){return arguments.length?(e=l,r=null,s):e},s.sort=function(l){return arguments.length?(r=l,e=null,s):r},s.startAngle=function(l){return arguments.length?(n=typeof l=="function"?l:Nn(+l),s):n},s.endAngle=function(l){return arguments.length?(i=typeof l=="function"?l:Nn(+l),s):i},s.padAngle=function(l){return arguments.length?(a=typeof l=="function"?l:Nn(+l),s):a},s}var UY=R(()=>{"use strict";r_();D3();$Y();VY();N3();o(O3,"default")});function s_(t){return new P3(t,!0)}function o_(t){return new P3(t,!1)}var P3,HY=R(()=>{"use strict";P3=class{static{o(this,"Bump")}constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}};o(s_,"bumpX");o(o_,"bumpY")});function Zs(){}var Yy=R(()=>{"use strict";o(Zs,"default")});function $p(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function Wy(t){this._context=t}function vs(t){return new Wy(t)}var qy=R(()=>{"use strict";o($p,"point");o(Wy,"Basis");Wy.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:o(function(){switch(this._point){case 3:$p(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:o(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);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:$p(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")};o(vs,"default")});function YY(t){this._context=t}function B3(t){return new YY(t)}var WY=R(()=>{"use strict";Yy();qy();o(YY,"BasisClosed");YY.prototype={areaStart:Zs,areaEnd:Zs,lineStart:o(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:o(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:o(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:$p(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")};o(B3,"default")});function qY(t){this._context=t}function F3(t){return new qY(t)}var XY=R(()=>{"use strict";qy();o(qY,"BasisOpen");qY.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:o(function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:o(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:$p(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")};o(F3,"default")});function jY(t,e){this._basis=new Wy(t),this._beta=e}var l_,KY=R(()=>{"use strict";qy();o(jY,"Bundle");jY.prototype={lineStart:o(function(){this._x=[],this._y=[],this._basis.lineStart()},"lineStart"),lineEnd:o(function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n=t[0],i=e[0],a=t[r]-n,s=e[r]-i,l=-1,u;++l<=r;)u=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(n+u*a),this._beta*e[l]+(1-this._beta)*(i+u*s));this._x=this._y=null,this._basis.lineEnd()},"lineEnd"),point:o(function(t,e){this._x.push(+t),this._y.push(+e)},"point")};l_=o(function t(e){function r(n){return e===1?new Wy(n):new jY(n,e)}return o(r,"bundle"),r.beta=function(n){return t(+n)},r},"custom")(.85)});function Vp(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function z3(t,e){this._context=t,this._k=(1-e)/6}var c_,Xy=R(()=>{"use strict";o(Vp,"point");o(z3,"Cardinal");z3.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:o(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Vp(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:o(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Vp(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};c_=o(function t(e){function r(n){return new z3(n,e)}return o(r,"cardinal"),r.tension=function(n){return t(+n)},r},"custom")(0)});function G3(t,e){this._context=t,this._k=(1-e)/6}var u_,h_=R(()=>{"use strict";Yy();Xy();o(G3,"CardinalClosed");G3.prototype={areaStart:Zs,areaEnd:Zs,lineStart:o(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:o(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:o(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Vp(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};u_=o(function t(e){function r(n){return new G3(n,e)}return o(r,"cardinal"),r.tension=function(n){return t(+n)},r},"custom")(0)});function $3(t,e){this._context=t,this._k=(1-e)/6}var f_,d_=R(()=>{"use strict";Xy();o($3,"CardinalOpen");$3.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:o(function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:o(function(t,e){switch(t=+t,e=+e,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:Vp(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};f_=o(function t(e){function r(n){return new $3(n,e)}return o(r,"cardinal"),r.tension=function(n){return t(+n)},r},"custom")(0)});function jy(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>Qi){var l=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*l-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*l-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>Qi){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,f=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*h+t._x1*t._l23_2a-e*t._l12_2a)/f,s=(s*h+t._y1*t._l23_2a-r*t._l12_2a)/f}t._context.bezierCurveTo(n,i,a,s,t._x2,t._y2)}function QY(t,e){this._context=t,this._alpha=e}var p_,V3=R(()=>{"use strict";N3();Xy();o(jy,"point");o(QY,"CatmullRom");QY.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(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:o(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:o(function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:jy(this,t,e);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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};p_=o(function t(e){function r(n){return e?new QY(n,e):new z3(n,0)}return o(r,"catmullRom"),r.alpha=function(n){return t(+n)},r},"custom")(.5)});function ZY(t,e){this._context=t,this._alpha=e}var m_,JY=R(()=>{"use strict";h_();Yy();V3();o(ZY,"CatmullRomClosed");ZY.prototype={areaStart:Zs,areaEnd:Zs,lineStart:o(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:o(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:o(function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:jy(this,t,e);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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};m_=o(function t(e){function r(n){return e?new ZY(n,e):new G3(n,0)}return o(r,"catmullRom"),r.alpha=function(n){return t(+n)},r},"custom")(.5)});function eW(t,e){this._context=t,this._alpha=e}var g_,tW=R(()=>{"use strict";d_();V3();o(eW,"CatmullRomOpen");eW.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(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:o(function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:o(function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:jy(this,t,e);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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};g_=o(function t(e){function r(n){return e?new eW(n,e):new $3(n,0)}return o(r,"catmullRom"),r.alpha=function(n){return t(+n)},r},"custom")(.5)});function rW(t){this._context=t}function U3(t){return new rW(t)}var nW=R(()=>{"use strict";Yy();o(rW,"LinearClosed");rW.prototype={areaStart:Zs,areaEnd:Zs,lineStart:o(function(){this._point=0},"lineStart"),lineEnd:o(function(){this._point&&this._context.closePath()},"lineEnd"),point:o(function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))},"point")};o(U3,"default")});function iW(t){return t<0?-1:1}function aW(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),s=(r-t._y1)/(i||n<0&&-0),l=(a*i+s*n)/(n+i);return(iW(a)+iW(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(l))||0}function sW(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function y_(t,e,r){var n=t._x0,i=t._y0,a=t._x1,s=t._y1,l=(a-n)/3;t._context.bezierCurveTo(n+l,i+l*e,a-l,s-l*r,a,s)}function H3(t){this._context=t}function oW(t){this._context=new lW(t)}function lW(t){this._context=t}function v_(t){return new H3(t)}function x_(t){return new oW(t)}var cW=R(()=>{"use strict";o(iW,"sign");o(aW,"slope3");o(sW,"slope2");o(y_,"point");o(H3,"MonotoneX");H3.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},"lineStart"),lineEnd:o(function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:y_(this,this._t0,sW(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:o(function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,y_(this,sW(this,r=aW(this,t,e)),r);break;default:y_(this,this._t0,r=aW(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}},"point")};o(oW,"MonotoneY");(oW.prototype=Object.create(H3.prototype)).point=function(t,e){H3.prototype.point.call(this,e,t)};o(lW,"ReflectContext");lW.prototype={moveTo:o(function(t,e){this._context.moveTo(e,t)},"moveTo"),closePath:o(function(){this._context.closePath()},"closePath"),lineTo:o(function(t,e){this._context.lineTo(e,t)},"lineTo"),bezierCurveTo:o(function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)},"bezierCurveTo")};o(v_,"monotoneX");o(x_,"monotoneY")});function hW(t){this._context=t}function uW(t){var e,r=t.length-1,n,i=new Array(r),a=new Array(r),s=new Array(r);for(i[0]=0,a[0]=2,s[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(s[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e{"use strict";o(hW,"Natural");hW.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(function(){this._x=[],this._y=[]},"lineStart"),lineEnd:o(function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=uW(t),i=uW(e),a=0,s=1;s{"use strict";o(W3,"Step");W3.prototype={areaStart:o(function(){this._line=0},"areaStart"),areaEnd:o(function(){this._line=NaN},"areaEnd"),lineStart:o(function(){this._x=this._y=NaN,this._point=0},"lineStart"),lineEnd:o(function(){0=0&&(this._t=1-this._t,this._line=1-this._line)},"lineEnd"),point:o(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e},"point")};o(q3,"default");o(b_,"stepBefore");o(w_,"stepAfter")});var pW=R(()=>{"use strict";OY();GY();UY();WY();XY();qy();HY();KY();h_();d_();Xy();JY();tW();V3();nW();n_();cW();fW();dW()});var mW=R(()=>{"use strict"});var gW=R(()=>{"use strict"});function Rh(t,e,r){this.k=t,this.x=e,this.y=r}function k_(t){for(;!t.__zoom;)if(!(t=t.parentNode))return T_;return t.__zoom}var T_,E_=R(()=>{"use strict";o(Rh,"Transform");Rh.prototype={constructor:Rh,scale:o(function(t){return t===1?this:new Rh(this.k*t,this.x,this.y)},"scale"),translate:o(function(t,e){return t===0&e===0?this:new Rh(this.k,this.x+this.k*t,this.y+this.k*e)},"translate"),apply:o(function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},"apply"),applyX:o(function(t){return t*this.k+this.x},"applyX"),applyY:o(function(t){return t*this.k+this.y},"applyY"),invert:o(function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},"invert"),invertX:o(function(t){return(t-this.x)/this.k},"invertX"),invertY:o(function(t){return(t-this.y)/this.k},"invertY"),rescaleX:o(function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},"rescaleX"),rescaleY:o(function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},"rescaleY"),toString:o(function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"},"toString")};T_=new Rh(1,0,0);k_.prototype=Rh.prototype;o(k_,"transform")});var yW=R(()=>{"use strict"});var vW=R(()=>{"use strict";c3();mW();gW();E_();yW()});var xW=R(()=>{"use strict";vW();E_()});var Zt=R(()=>{"use strict";bh();K$();mH();xH();Lp();bH();wH();bS();$V();TH();l8();kH();CH();C8();zH();GH();Np();d8();$H();EH();VH();LY();NY();fl();pW();_3();K8();n3();c3();xW()});var bW=gi(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.BLANK_URL=Zi.relativeFirstCharacters=Zi.whitespaceEscapeCharsRegex=Zi.urlSchemeRegex=Zi.ctrlCharactersRegex=Zi.htmlCtrlEntityRegex=Zi.htmlEntitiesRegex=Zi.invalidProtocolRegex=void 0;Zi.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im;Zi.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g;Zi.htmlCtrlEntityRegex=/&(newline|tab);/gi;Zi.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim;Zi.urlSchemeRegex=/^.+(:|:)/gim;Zi.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g;Zi.relativeFirstCharacters=[".","/"];Zi.BLANK_URL="about:blank"});var Up=gi(X3=>{"use strict";Object.defineProperty(X3,"__esModule",{value:!0});X3.sanitizeUrl=void 0;var Na=bW();function kTe(t){return Na.relativeFirstCharacters.indexOf(t[0])>-1}o(kTe,"isRelativeUrlWithoutProtocol");function ETe(t){var e=t.replace(Na.ctrlCharactersRegex,"");return e.replace(Na.htmlEntitiesRegex,function(r,n){return String.fromCharCode(n)})}o(ETe,"decodeHtmlCharacters");function CTe(t){return URL.canParse(t)}o(CTe,"isValidUrl");function wW(t){try{return decodeURIComponent(t)}catch{return t}}o(wW,"decodeURI");function STe(t){if(!t)return Na.BLANK_URL;var e,r=wW(t.trim());do r=ETe(r).replace(Na.htmlCtrlEntityRegex,"").replace(Na.ctrlCharactersRegex,"").replace(Na.whitespaceEscapeCharsRegex,"").trim(),r=wW(r),e=r.match(Na.ctrlCharactersRegex)||r.match(Na.htmlEntitiesRegex)||r.match(Na.htmlCtrlEntityRegex)||r.match(Na.whitespaceEscapeCharsRegex);while(e&&e.length>0);var n=r;if(!n)return Na.BLANK_URL;if(kTe(n))return n;var i=n.trimStart(),a=i.match(Na.urlSchemeRegex);if(!a)return n;var s=a[0].toLowerCase().trim();if(Na.invalidProtocolRegex.test(s))return Na.BLANK_URL;var l=i.replace(/\\/g,"/");if(s==="mailto:"||s.includes("://"))return l;if(s==="http:"||s==="https:"){if(!CTe(l))return Na.BLANK_URL;var u=new URL(l);return u.protocol=u.protocol.toLowerCase(),u.hostname=u.hostname.toLowerCase(),u.toString()}return l}o(STe,"sanitizeUrl");X3.sanitizeUrl=STe});var C_,yd,j3,TW,kW,EW,wl,Ky,Qy=R(()=>{"use strict";C_=Xi(Up(),1);rr();yd=o((t,e)=>{let r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),e.attrs!==void 0)for(let n in e.attrs)r.attr(n,e.attrs[n]);return e.class&&r.attr("class",e.class),r},"drawRect"),j3=o((t,e)=>{let r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};yd(t,r).lower()},"drawBackgroundRect"),TW=o((t,e)=>{let r=e.text.replace(Qf," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);let i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),kW=o((t,e,r,n)=>{let i=t.append("image");i.attr("x",e),i.attr("y",r);let a=(0,C_.sanitizeUrl)(n);i.attr("xlink:href",a)},"drawImage"),EW=o((t,e,r,n)=>{let i=t.append("use");i.attr("x",e),i.attr("y",r);let a=(0,C_.sanitizeUrl)(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),wl=o(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),Ky=o(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj")});var CW,S_,SW,ATe,_Te,LTe,DTe,RTe,NTe,MTe,ITe,OTe,PTe,BTe,FTe,bu,Tl,AW=R(()=>{"use strict";rr();Qy();CW=Xi(Up(),1),S_=o(function(t,e){return yd(t,e)},"drawRect"),SW=o(function(t,e,r,n,i,a){let s=t.append("image");s.attr("width",e),s.attr("height",r),s.attr("x",n),s.attr("y",i);let l=a.startsWith("data:image/png;base64")?a:(0,CW.sanitizeUrl)(a);s.attr("xlink:href",l)},"drawImage"),ATe=o((t,e,r)=>{let n=t.append("g"),i=0;for(let a of e){let s=a.textColor?a.textColor:"#444444",l=a.lineColor?a.lineColor:"#444444",u=a.offsetX?parseInt(a.offsetX):0,h=a.offsetY?parseInt(a.offsetY):0,f="";if(i===0){let p=n.append("line");p.attr("x1",a.startPoint.x),p.attr("y1",a.startPoint.y),p.attr("x2",a.endPoint.x),p.attr("y2",a.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",l),p.style("fill","none"),a.type!=="rel_b"&&p.attr("marker-end","url("+f+"#arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&p.attr("marker-start","url("+f+"#arrowend)"),i=-1}else{let p=n.append("path");p.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",a.startPoint.x).replaceAll("starty",a.startPoint.y).replaceAll("controlx",a.startPoint.x+(a.endPoint.x-a.startPoint.x)/2-(a.endPoint.x-a.startPoint.x)/4).replaceAll("controly",a.startPoint.y+(a.endPoint.y-a.startPoint.y)/2).replaceAll("stopx",a.endPoint.x).replaceAll("stopy",a.endPoint.y)),a.type!=="rel_b"&&p.attr("marker-end","url("+f+"#arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&p.attr("marker-start","url("+f+"#arrowend)")}let d=r.messageFont();bu(r)(a.label.text,n,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+h,a.label.width,a.label.height,{fill:s},d),a.techn&&a.techn.text!==""&&(d=r.messageFont(),bu(r)("["+a.techn.text+"]",n,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+r.messageFontSize+5+h,Math.max(a.label.width,a.techn.width),a.techn.height,{fill:s,"font-style":"italic"},d))}},"drawRels"),_Te=o(function(t,e,r){let n=t.append("g"),i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",s=e.fontColor?e.fontColor:"black",l={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(l={"stroke-width":1});let u={x:e.x,y:e.y,fill:i,stroke:a,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:l};S_(n,u);let h=r.boundaryFont();h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=s,bu(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},h),e.type&&e.type.text!==""&&(h=r.boundaryFont(),h.fontColor=s,bu(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},h)),e.descr&&e.descr.text!==""&&(h=r.boundaryFont(),h.fontSize=h.fontSize-2,h.fontColor=s,bu(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},h))},"drawBoundary"),LTe=o(function(t,e,r){let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:r[e.typeC4Shape.text+"_border_color"],a=e.fontColor?e.fontColor:"#FFFFFF",s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":s="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":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}let l=t.append("g");l.attr("class","person-man");let u=wl();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":u.x=e.x,u.y=e.y,u.fill=n,u.width=e.width,u.height=e.height,u.stroke=i,u.rx=2.5,u.ry=2.5,u.attrs={"stroke-width":.5},S_(l,u);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":l.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).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",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),l.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":l.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).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",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),l.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2));break}let h=FTe(r,e.typeC4Shape.text);switch(l.append("text").attr("fill",a).attr("font-family",h.fontFamily).attr("font-size",h.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":SW(l,48,48,e.x+e.width/2-24,e.y+e.image.Y,s);break}let f=r[e.typeC4Shape.text+"Font"]();return f.fontWeight="bold",f.fontSize=f.fontSize+2,f.fontColor=a,bu(r)(e.label.text,l,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},f),f=r[e.typeC4Shape.text+"Font"](),f.fontColor=a,e.techn&&e.techn?.text!==""?bu(r)(e.techn.text,l,e.x,e.y+e.techn.Y,e.width,e.height,{fill:a,"font-style":"italic"},f):e.type&&e.type.text!==""&&bu(r)(e.type.text,l,e.x,e.y+e.type.Y,e.width,e.height,{fill:a,"font-style":"italic"},f),e.descr&&e.descr.text!==""&&(f=r.personFont(),f.fontColor=a,bu(r)(e.descr.text,l,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},f)),e.height},"drawC4Shape"),DTe=o(function(t){t.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"),RTe=o(function(t){t.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"),NTe=o(function(t){t.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"),MTe=o(function(t){t.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"),ITe=o(function(t){t.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"),OTe=o(function(t){t.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"),PTe=o(function(t){t.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"),BTe=o(function(t){let r=t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);r.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"),r.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"),FTe=o((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),bu=function(){function t(i,a,s,l,u,h,f){let d=a.append("text").attr("x",s+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(i);n(d,f)}o(t,"byText");function e(i,a,s,l,u,h,f,d){let{fontSize:p,fontFamily:m,fontWeight:g}=d,y=i.split(We.lineBreakRegex);for(let v=0;v{"use strict";zTe=typeof global=="object"&&global&&global.Object===Object&&global,Q3=zTe});var GTe,$Te,Jn,Ro=R(()=>{"use strict";A_();GTe=typeof self=="object"&&self&&self.Object===Object&&self,$Te=Q3||GTe||Function("return this")(),Jn=$Te});var VTe,Ji,vd=R(()=>{"use strict";Ro();VTe=Jn.Symbol,Ji=VTe});function YTe(t){var e=UTe.call(t,Zy),r=t[Zy];try{t[Zy]=void 0;var n=!0}catch{}var i=HTe.call(t);return n&&(e?t[Zy]=r:delete t[Zy]),i}var _W,UTe,HTe,Zy,LW,DW=R(()=>{"use strict";vd();_W=Object.prototype,UTe=_W.hasOwnProperty,HTe=_W.toString,Zy=Ji?Ji.toStringTag:void 0;o(YTe,"getRawTag");LW=YTe});function XTe(t){return qTe.call(t)}var WTe,qTe,RW,NW=R(()=>{"use strict";WTe=Object.prototype,qTe=WTe.toString;o(XTe,"objectToString");RW=XTe});function QTe(t){return t==null?t===void 0?KTe:jTe:MW&&MW in Object(t)?LW(t):RW(t)}var jTe,KTe,MW,fa,wu=R(()=>{"use strict";vd();DW();NW();jTe="[object Null]",KTe="[object Undefined]",MW=Ji?Ji.toStringTag:void 0;o(QTe,"baseGetTag");fa=QTe});function ZTe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var pn,Js=R(()=>{"use strict";o(ZTe,"isObject");pn=ZTe});function nke(t){if(!pn(t))return!1;var e=fa(t);return e==eke||e==tke||e==JTe||e==rke}var JTe,eke,tke,rke,wi,Jy=R(()=>{"use strict";wu();Js();JTe="[object AsyncFunction]",eke="[object Function]",tke="[object GeneratorFunction]",rke="[object Proxy]";o(nke,"isFunction");wi=nke});var ike,Z3,IW=R(()=>{"use strict";Ro();ike=Jn["__core-js_shared__"],Z3=ike});function ake(t){return!!OW&&OW in t}var OW,PW,BW=R(()=>{"use strict";IW();OW=function(){var t=/[^.]+$/.exec(Z3&&Z3.keys&&Z3.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();o(ake,"isMasked");PW=ake});function lke(t){if(t!=null){try{return oke.call(t)}catch{}try{return t+""}catch{}}return""}var ske,oke,Tu,__=R(()=>{"use strict";ske=Function.prototype,oke=ske.toString;o(lke,"toSource");Tu=lke});function gke(t){if(!pn(t)||PW(t))return!1;var e=wi(t)?mke:uke;return e.test(Tu(t))}var cke,uke,hke,fke,dke,pke,mke,FW,zW=R(()=>{"use strict";Jy();BW();Js();__();cke=/[\\^$.*+?()[\]{}|]/g,uke=/^\[object .+?Constructor\]$/,hke=Function.prototype,fke=Object.prototype,dke=hke.toString,pke=fke.hasOwnProperty,mke=RegExp("^"+dke.call(pke).replace(cke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");o(gke,"baseIsNative");FW=gke});function yke(t,e){return t?.[e]}var GW,$W=R(()=>{"use strict";o(yke,"getValue");GW=yke});function vke(t,e){var r=GW(t,e);return FW(r)?r:void 0}var xs,Nh=R(()=>{"use strict";zW();$W();o(vke,"getNative");xs=vke});var xke,ku,ev=R(()=>{"use strict";Nh();xke=xs(Object,"create"),ku=xke});function bke(){this.__data__=ku?ku(null):{},this.size=0}var VW,UW=R(()=>{"use strict";ev();o(bke,"hashClear");VW=bke});function wke(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var HW,YW=R(()=>{"use strict";o(wke,"hashDelete");HW=wke});function Cke(t){var e=this.__data__;if(ku){var r=e[t];return r===Tke?void 0:r}return Eke.call(e,t)?e[t]:void 0}var Tke,kke,Eke,WW,qW=R(()=>{"use strict";ev();Tke="__lodash_hash_undefined__",kke=Object.prototype,Eke=kke.hasOwnProperty;o(Cke,"hashGet");WW=Cke});function _ke(t){var e=this.__data__;return ku?e[t]!==void 0:Ake.call(e,t)}var Ske,Ake,XW,jW=R(()=>{"use strict";ev();Ske=Object.prototype,Ake=Ske.hasOwnProperty;o(_ke,"hashHas");XW=_ke});function Dke(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ku&&e===void 0?Lke:e,this}var Lke,KW,QW=R(()=>{"use strict";ev();Lke="__lodash_hash_undefined__";o(Dke,"hashSet");KW=Dke});function Hp(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{"use strict";UW();YW();qW();jW();QW();o(Hp,"Hash");Hp.prototype.clear=VW;Hp.prototype.delete=HW;Hp.prototype.get=WW;Hp.prototype.has=XW;Hp.prototype.set=KW;L_=Hp});function Rke(){this.__data__=[],this.size=0}var JW,eq=R(()=>{"use strict";o(Rke,"listCacheClear");JW=Rke});function Nke(t,e){return t===e||t!==t&&e!==e}var No,xd=R(()=>{"use strict";o(Nke,"eq");No=Nke});function Mke(t,e){for(var r=t.length;r--;)if(No(t[r][0],e))return r;return-1}var Mh,tv=R(()=>{"use strict";xd();o(Mke,"assocIndexOf");Mh=Mke});function Pke(t){var e=this.__data__,r=Mh(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Oke.call(e,r,1),--this.size,!0}var Ike,Oke,tq,rq=R(()=>{"use strict";tv();Ike=Array.prototype,Oke=Ike.splice;o(Pke,"listCacheDelete");tq=Pke});function Bke(t){var e=this.__data__,r=Mh(e,t);return r<0?void 0:e[r][1]}var nq,iq=R(()=>{"use strict";tv();o(Bke,"listCacheGet");nq=Bke});function Fke(t){return Mh(this.__data__,t)>-1}var aq,sq=R(()=>{"use strict";tv();o(Fke,"listCacheHas");aq=Fke});function zke(t,e){var r=this.__data__,n=Mh(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var oq,lq=R(()=>{"use strict";tv();o(zke,"listCacheSet");oq=zke});function Yp(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{"use strict";eq();rq();iq();sq();lq();o(Yp,"ListCache");Yp.prototype.clear=JW;Yp.prototype.delete=tq;Yp.prototype.get=nq;Yp.prototype.has=aq;Yp.prototype.set=oq;Ih=Yp});var Gke,Oh,J3=R(()=>{"use strict";Nh();Ro();Gke=xs(Jn,"Map"),Oh=Gke});function $ke(){this.size=0,this.__data__={hash:new L_,map:new(Oh||Ih),string:new L_}}var cq,uq=R(()=>{"use strict";ZW();rv();J3();o($ke,"mapCacheClear");cq=$ke});function Vke(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var hq,fq=R(()=>{"use strict";o(Vke,"isKeyable");hq=Vke});function Uke(t,e){var r=t.__data__;return hq(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Ph,nv=R(()=>{"use strict";fq();o(Uke,"getMapData");Ph=Uke});function Hke(t){var e=Ph(this,t).delete(t);return this.size-=e?1:0,e}var dq,pq=R(()=>{"use strict";nv();o(Hke,"mapCacheDelete");dq=Hke});function Yke(t){return Ph(this,t).get(t)}var mq,gq=R(()=>{"use strict";nv();o(Yke,"mapCacheGet");mq=Yke});function Wke(t){return Ph(this,t).has(t)}var yq,vq=R(()=>{"use strict";nv();o(Wke,"mapCacheHas");yq=Wke});function qke(t,e){var r=Ph(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var xq,bq=R(()=>{"use strict";nv();o(qke,"mapCacheSet");xq=qke});function Wp(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{"use strict";uq();pq();gq();vq();bq();o(Wp,"MapCache");Wp.prototype.clear=cq;Wp.prototype.delete=dq;Wp.prototype.get=mq;Wp.prototype.has=yq;Wp.prototype.set=xq;bd=Wp});function D_(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Xke);var r=o(function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s)||a,s},"memoized");return r.cache=new(D_.Cache||bd),r}var Xke,qp,R_=R(()=>{"use strict";e5();Xke="Expected a function";o(D_,"memoize");D_.Cache=bd;qp=D_});function jke(){this.__data__=new Ih,this.size=0}var wq,Tq=R(()=>{"use strict";rv();o(jke,"stackClear");wq=jke});function Kke(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var kq,Eq=R(()=>{"use strict";o(Kke,"stackDelete");kq=Kke});function Qke(t){return this.__data__.get(t)}var Cq,Sq=R(()=>{"use strict";o(Qke,"stackGet");Cq=Qke});function Zke(t){return this.__data__.has(t)}var Aq,_q=R(()=>{"use strict";o(Zke,"stackHas");Aq=Zke});function eEe(t,e){var r=this.__data__;if(r instanceof Ih){var n=r.__data__;if(!Oh||n.length{"use strict";rv();J3();e5();Jke=200;o(eEe,"stackSet");Lq=eEe});function Xp(t){var e=this.__data__=new Ih(t);this.size=e.size}var uc,iv=R(()=>{"use strict";rv();Tq();Eq();Sq();_q();Dq();o(Xp,"Stack");Xp.prototype.clear=wq;Xp.prototype.delete=kq;Xp.prototype.get=Cq;Xp.prototype.has=Aq;Xp.prototype.set=Lq;uc=Xp});var tEe,jp,N_=R(()=>{"use strict";Nh();tEe=function(){try{var t=xs(Object,"defineProperty");return t({},"",{}),t}catch{}}(),jp=tEe});function rEe(t,e,r){e=="__proto__"&&jp?jp(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var hc,Kp=R(()=>{"use strict";N_();o(rEe,"baseAssignValue");hc=rEe});function nEe(t,e,r){(r!==void 0&&!No(t[e],r)||r===void 0&&!(e in t))&&hc(t,e,r)}var av,M_=R(()=>{"use strict";Kp();xd();o(nEe,"assignMergeValue");av=nEe});function iEe(t){return function(e,r,n){for(var i=-1,a=Object(e),s=n(e),l=s.length;l--;){var u=s[t?l:++i];if(r(a[u],u,a)===!1)break}return e}}var Rq,Nq=R(()=>{"use strict";o(iEe,"createBaseFor");Rq=iEe});var aEe,Qp,t5=R(()=>{"use strict";Nq();aEe=Rq(),Qp=aEe});function oEe(t,e){if(e)return t.slice();var r=t.length,n=Oq?Oq(r):new t.constructor(r);return t.copy(n),n}var Pq,Mq,sEe,Iq,Oq,r5,I_=R(()=>{"use strict";Ro();Pq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mq=Pq&&typeof module=="object"&&module&&!module.nodeType&&module,sEe=Mq&&Mq.exports===Pq,Iq=sEe?Jn.Buffer:void 0,Oq=Iq?Iq.allocUnsafe:void 0;o(oEe,"cloneBuffer");r5=oEe});var lEe,Zp,O_=R(()=>{"use strict";Ro();lEe=Jn.Uint8Array,Zp=lEe});function cEe(t){var e=new t.constructor(t.byteLength);return new Zp(e).set(new Zp(t)),e}var Jp,n5=R(()=>{"use strict";O_();o(cEe,"cloneArrayBuffer");Jp=cEe});function uEe(t,e){var r=e?Jp(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var i5,P_=R(()=>{"use strict";n5();o(uEe,"cloneTypedArray");i5=uEe});function hEe(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r{"use strict";o(hEe,"copyArray");a5=hEe});var Bq,fEe,Fq,zq=R(()=>{"use strict";Js();Bq=Object.create,fEe=function(){function t(){}return o(t,"object"),function(e){if(!pn(e))return{};if(Bq)return Bq(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),Fq=fEe});function dEe(t,e){return function(r){return t(e(r))}}var s5,F_=R(()=>{"use strict";o(dEe,"overArg");s5=dEe});var pEe,em,o5=R(()=>{"use strict";F_();pEe=s5(Object.getPrototypeOf,Object),em=pEe});function gEe(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||mEe;return t===r}var mEe,fc,tm=R(()=>{"use strict";mEe=Object.prototype;o(gEe,"isPrototype");fc=gEe});function yEe(t){return typeof t.constructor=="function"&&!fc(t)?Fq(em(t)):{}}var l5,z_=R(()=>{"use strict";zq();o5();tm();o(yEe,"initCloneObject");l5=yEe});function vEe(t){return t!=null&&typeof t=="object"}var Wn,Mo=R(()=>{"use strict";o(vEe,"isObjectLike");Wn=vEe});function bEe(t){return Wn(t)&&fa(t)==xEe}var xEe,G_,Gq=R(()=>{"use strict";wu();Mo();xEe="[object Arguments]";o(bEe,"baseIsArguments");G_=bEe});var $q,wEe,TEe,kEe,kl,rm=R(()=>{"use strict";Gq();Mo();$q=Object.prototype,wEe=$q.hasOwnProperty,TEe=$q.propertyIsEnumerable,kEe=G_(function(){return arguments}())?G_:function(t){return Wn(t)&&wEe.call(t,"callee")&&!TEe.call(t,"callee")},kl=kEe});var EEe,wt,Bn=R(()=>{"use strict";EEe=Array.isArray,wt=EEe});function SEe(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=CEe}var CEe,nm,c5=R(()=>{"use strict";CEe=9007199254740991;o(SEe,"isLength");nm=SEe});function AEe(t){return t!=null&&nm(t.length)&&!wi(t)}var ei,Io=R(()=>{"use strict";Jy();c5();o(AEe,"isArrayLike");ei=AEe});function _Ee(t){return Wn(t)&&ei(t)}var wd,u5=R(()=>{"use strict";Io();Mo();o(_Ee,"isArrayLikeObject");wd=_Ee});function LEe(){return!1}var Vq,Uq=R(()=>{"use strict";o(LEe,"stubFalse");Vq=LEe});var Wq,Hq,DEe,Yq,REe,NEe,El,im=R(()=>{"use strict";Ro();Uq();Wq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Hq=Wq&&typeof module=="object"&&module&&!module.nodeType&&module,DEe=Hq&&Hq.exports===Wq,Yq=DEe?Jn.Buffer:void 0,REe=Yq?Yq.isBuffer:void 0,NEe=REe||Vq,El=NEe});function FEe(t){if(!Wn(t)||fa(t)!=MEe)return!1;var e=em(t);if(e===null)return!0;var r=PEe.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&qq.call(r)==BEe}var MEe,IEe,OEe,qq,PEe,BEe,Xq,jq=R(()=>{"use strict";wu();o5();Mo();MEe="[object Object]",IEe=Function.prototype,OEe=Object.prototype,qq=IEe.toString,PEe=OEe.hasOwnProperty,BEe=qq.call(Object);o(FEe,"isPlainObject");Xq=FEe});function c6e(t){return Wn(t)&&nm(t.length)&&!!Mn[fa(t)]}var zEe,GEe,$Ee,VEe,UEe,HEe,YEe,WEe,qEe,XEe,jEe,KEe,QEe,ZEe,JEe,e6e,t6e,r6e,n6e,i6e,a6e,s6e,o6e,l6e,Mn,Kq,Qq=R(()=>{"use strict";wu();c5();Mo();zEe="[object Arguments]",GEe="[object Array]",$Ee="[object Boolean]",VEe="[object Date]",UEe="[object Error]",HEe="[object Function]",YEe="[object Map]",WEe="[object Number]",qEe="[object Object]",XEe="[object RegExp]",jEe="[object Set]",KEe="[object String]",QEe="[object WeakMap]",ZEe="[object ArrayBuffer]",JEe="[object DataView]",e6e="[object Float32Array]",t6e="[object Float64Array]",r6e="[object Int8Array]",n6e="[object Int16Array]",i6e="[object Int32Array]",a6e="[object Uint8Array]",s6e="[object Uint8ClampedArray]",o6e="[object Uint16Array]",l6e="[object Uint32Array]",Mn={};Mn[e6e]=Mn[t6e]=Mn[r6e]=Mn[n6e]=Mn[i6e]=Mn[a6e]=Mn[s6e]=Mn[o6e]=Mn[l6e]=!0;Mn[zEe]=Mn[GEe]=Mn[ZEe]=Mn[$Ee]=Mn[JEe]=Mn[VEe]=Mn[UEe]=Mn[HEe]=Mn[YEe]=Mn[WEe]=Mn[qEe]=Mn[XEe]=Mn[jEe]=Mn[KEe]=Mn[QEe]=!1;o(c6e,"baseIsTypedArray");Kq=c6e});function u6e(t){return function(e){return t(e)}}var Oo,Td=R(()=>{"use strict";o(u6e,"baseUnary");Oo=u6e});var Zq,sv,h6e,$_,f6e,Po,ov=R(()=>{"use strict";A_();Zq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,sv=Zq&&typeof module=="object"&&module&&!module.nodeType&&module,h6e=sv&&sv.exports===Zq,$_=h6e&&Q3.process,f6e=function(){try{var t=sv&&sv.require&&sv.require("util").types;return t||$_&&$_.binding&&$_.binding("util")}catch{}}(),Po=f6e});var Jq,d6e,Bh,lv=R(()=>{"use strict";Qq();Td();ov();Jq=Po&&Po.isTypedArray,d6e=Jq?Oo(Jq):Kq,Bh=d6e});function p6e(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var cv,V_=R(()=>{"use strict";o(p6e,"safeGet");cv=p6e});function y6e(t,e,r){var n=t[e];(!(g6e.call(t,e)&&No(n,r))||r===void 0&&!(e in t))&&hc(t,e,r)}var m6e,g6e,dc,am=R(()=>{"use strict";Kp();xd();m6e=Object.prototype,g6e=m6e.hasOwnProperty;o(y6e,"assignValue");dc=y6e});function v6e(t,e,r,n){var i=!r;r||(r={});for(var a=-1,s=e.length;++a{"use strict";am();Kp();o(v6e,"copyObject");Bo=v6e});function x6e(t,e){for(var r=-1,n=Array(t);++r{"use strict";o(x6e,"baseTimes");eX=x6e});function T6e(t,e){var r=typeof t;return e=e??b6e,!!e&&(r=="number"||r!="symbol"&&w6e.test(t))&&t>-1&&t%1==0&&t{"use strict";b6e=9007199254740991,w6e=/^(?:0|[1-9]\d*)$/;o(T6e,"isIndex");Fh=T6e});function C6e(t,e){var r=wt(t),n=!r&&kl(t),i=!r&&!n&&El(t),a=!r&&!n&&!i&&Bh(t),s=r||n||i||a,l=s?eX(t.length,String):[],u=l.length;for(var h in t)(e||E6e.call(t,h))&&!(s&&(h=="length"||i&&(h=="offset"||h=="parent")||a&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Fh(h,u)))&&l.push(h);return l}var k6e,E6e,h5,U_=R(()=>{"use strict";tX();rm();Bn();im();uv();lv();k6e=Object.prototype,E6e=k6e.hasOwnProperty;o(C6e,"arrayLikeKeys");h5=C6e});function S6e(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var rX,nX=R(()=>{"use strict";o(S6e,"nativeKeysIn");rX=S6e});function L6e(t){if(!pn(t))return rX(t);var e=fc(t),r=[];for(var n in t)n=="constructor"&&(e||!_6e.call(t,n))||r.push(n);return r}var A6e,_6e,iX,aX=R(()=>{"use strict";Js();tm();nX();A6e=Object.prototype,_6e=A6e.hasOwnProperty;o(L6e,"baseKeysIn");iX=L6e});function D6e(t){return ei(t)?h5(t,!0):iX(t)}var bs,zh=R(()=>{"use strict";U_();aX();Io();o(D6e,"keysIn");bs=D6e});function R6e(t){return Bo(t,bs(t))}var sX,oX=R(()=>{"use strict";kd();zh();o(R6e,"toPlainObject");sX=R6e});function N6e(t,e,r,n,i,a,s){var l=cv(t,r),u=cv(e,r),h=s.get(u);if(h){av(t,r,h);return}var f=a?a(l,u,r+"",t,e,s):void 0,d=f===void 0;if(d){var p=wt(u),m=!p&&El(u),g=!p&&!m&&Bh(u);f=u,p||m||g?wt(l)?f=l:wd(l)?f=a5(l):m?(d=!1,f=r5(u,!0)):g?(d=!1,f=i5(u,!0)):f=[]:Xq(u)||kl(u)?(f=l,kl(l)?f=sX(l):(!pn(l)||wi(l))&&(f=l5(u))):d=!1}d&&(s.set(u,f),i(f,u,n,a,s),s.delete(u)),av(t,r,f)}var lX,cX=R(()=>{"use strict";M_();I_();P_();B_();z_();rm();Bn();u5();im();Jy();Js();jq();lv();V_();oX();o(N6e,"baseMergeDeep");lX=N6e});function uX(t,e,r,n,i){t!==e&&Qp(e,function(a,s){if(i||(i=new uc),pn(a))lX(t,e,s,r,uX,n,i);else{var l=n?n(cv(t,s),a,s+"",t,e,i):void 0;l===void 0&&(l=a),av(t,s,l)}},bs)}var hX,fX=R(()=>{"use strict";iv();M_();t5();cX();Js();zh();V_();o(uX,"baseMerge");hX=uX});function M6e(t){return t}var ea,Eu=R(()=>{"use strict";o(M6e,"identity");ea=M6e});function I6e(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var dX,pX=R(()=>{"use strict";o(I6e,"apply");dX=I6e});function O6e(t,e,r){return e=mX(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,a=mX(n.length-e,0),s=Array(a);++i{"use strict";pX();mX=Math.max;o(O6e,"overRest");f5=O6e});function P6e(t){return function(){return t}}var ws,Y_=R(()=>{"use strict";o(P6e,"constant");ws=P6e});var B6e,gX,yX=R(()=>{"use strict";Y_();N_();Eu();B6e=jp?function(t,e){return jp(t,"toString",{configurable:!0,enumerable:!1,value:ws(e),writable:!0})}:ea,gX=B6e});function $6e(t){var e=0,r=0;return function(){var n=G6e(),i=z6e-(n-r);if(r=n,i>0){if(++e>=F6e)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var F6e,z6e,G6e,vX,xX=R(()=>{"use strict";F6e=800,z6e=16,G6e=Date.now;o($6e,"shortOut");vX=$6e});var V6e,d5,W_=R(()=>{"use strict";yX();xX();V6e=vX(gX),d5=V6e});function U6e(t,e){return d5(f5(t,e,ea),t+"")}var pc,sm=R(()=>{"use strict";Eu();H_();W_();o(U6e,"baseRest");pc=U6e});function H6e(t,e,r){if(!pn(r))return!1;var n=typeof e;return(n=="number"?ei(r)&&Fh(e,r.length):n=="string"&&e in r)?No(r[e],t):!1}var eo,Ed=R(()=>{"use strict";xd();Io();uv();Js();o(H6e,"isIterateeCall");eo=H6e});function Y6e(t){return pc(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&eo(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n{"use strict";sm();Ed();o(Y6e,"createAssigner");p5=Y6e});var W6e,Gh,X_=R(()=>{"use strict";fX();q_();W6e=p5(function(t,e,r){hX(t,e,r)}),Gh=W6e});function om(t,e){if(!t)return e;let r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return q6e[r]??e}function Q6e(t,e){let r=t.trim();if(r)return e.securityLevel!=="loose"?(0,TX.sanitizeUrl)(r):r}function CX(t,e){return!t||!e?0:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function J6e(t){let e,r=0;t.forEach(i=>{r+=CX(i,e),e=i});let n=r/2;return Q_(t,n)}function eCe(t){return t.length===1?t[0]:J6e(t)}function rCe(t,e,r){let n=structuredClone(r);V.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();let i=25+t,a=Q_(n,i),s=10+t*.5,l=Math.atan2(n[0].y-a.y,n[0].x-a.x),u={x:0,y:0};return e==="start_left"?(u.x=Math.sin(l+Math.PI)*s+(n[0].x+a.x)/2,u.y=-Math.cos(l+Math.PI)*s+(n[0].y+a.y)/2):e==="end_right"?(u.x=Math.sin(l-Math.PI)*s+(n[0].x+a.x)/2-5,u.y=-Math.cos(l-Math.PI)*s+(n[0].y+a.y)/2-5):e==="end_left"?(u.x=Math.sin(l)*s+(n[0].x+a.x)/2-5,u.y=-Math.cos(l)*s+(n[0].y+a.y)/2-5):(u.x=Math.sin(l)*s+(n[0].x+a.x)/2,u.y=-Math.cos(l)*s+(n[0].y+a.y)/2),u}function lm(t){let e="",r="";for(let n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}function nCe(t){let e="",r="0123456789abcdef",n=r.length;for(let i=0;i{"use strict";TX=Xi(Up(),1);Zt();rr();r7();ut();Hf();cp();R_();X_();Vb();K_="\u200B",q6e={curveBasis:vs,curveBasisClosed:B3,curveBasisOpen:F3,curveBumpX:s_,curveBumpY:o_,curveBundle:l_,curveCardinalClosed:u_,curveCardinalOpen:f_,curveCardinal:c_,curveCatmullRomClosed:m_,curveCatmullRomOpen:g_,curveCatmullRom:p_,curveLinear:xu,curveLinearClosed:U3,curveMonotoneX:v_,curveMonotoneY:x_,curveNatural:Y3,curveStep:q3,curveStepAfter:w_,curveStepBefore:b_},X6e=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,j6e=o(function(t,e){let r=kX(t,/(?:init\b)|(?:initialize\b)/),n={};if(Array.isArray(r)){let s=r.map(l=>l.args);fp(s),n=On(n,[...s])}else n=r.args;if(!n)return;let i=lp(t,e),a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),kX=o(function(t,e=null){try{let r=new RegExp(`[%]{2}(?![{]${X6e.source})(?=[}][%]{2}).* +`,"ig");t=t.trim().replace(r,"").replace(/'/gm,'"'),V.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let n,i=[];for(;(n=Vf.exec(t))!==null;)if(n.index===Vf.lastIndex&&Vf.lastIndex++,n&&!e||e&&n[1]?.match(e)||e&&n[2]?.match(e)){let a=n[1]?n[1]:n[2],s=n[3]?n[3].trim():n[4]?JSON.parse(n[4].trim()):null;i.push({type:a,args:s})}return i.length===0?{type:t,args:null}:i.length===1?i[0]:i}catch(r){return V.error(`ERROR: ${r.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),EX=o(function(t){return t.replace(Vf,"")},"removeDirectives"),K6e=o(function(t,e){for(let[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");o(om,"interpolateToCurve");o(Q6e,"formatUrl");Z6e=o((t,...e)=>{let r=t.split("."),n=r.length-1,i=r[n],a=window;for(let s=0;s{let r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),Q_=o((t,e)=>{let r,n=e;for(let i of t){if(r){let a=CX(i,r);if(a=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:bX((1-s)*r.x+s*i.x,5),y:bX((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),tCe=o((t,e,r)=>{V.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());let i=Q_(e,25),a=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),l={x:0,y:0};return l.x=Math.sin(s)*a+(e[0].x+i.x)/2,l.y=-Math.cos(s)*a+(e[0].y+i.y)/2,l},"calcCardinalityPosition");o(rCe,"calcTerminalLabelPosition");o(lm,"getStylesFromArray");wX=0,Z_=o(()=>(wX++,"id-"+Math.random().toString(36).substr(2,12)+"-"+wX),"generateId");o(nCe,"makeRandomHex");J_=o(t=>nCe(t.length),"random"),iCe=o(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"),aCe=o(function(t,e){let r=e.text.replace(We.lineBreakRegex," "),[,n]=mc(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),e.class!==void 0&&i.attr("class",e.class);let a=i.append("tspan");return a.attr("x",e.x+e.textMargin*2),a.attr("fill",e.fill),a.text(r),i},"drawSimpleText"),e9=qp((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
    "},r),We.lineBreakRegex.test(t)))return t;let n=t.split(" ").filter(Boolean),i=[],a="";return n.forEach((s,l)=>{let u=Cl(`${s} `,r),h=Cl(a,r);if(u>e){let{hyphenatedStrings:p,remainingWord:m}=sCe(s,e,"-",r);i.push(a,...p),a=m}else h+u>=e?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");l+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),sCe=qp((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);let i=[...t],a=[],s="";return i.forEach((l,u)=>{let h=`${s}${l}`;if(Cl(h,n)>=e){let d=u+1,p=i.length===d,m=`${h}${r}`;a.push(p?h:m),s=""}else s=h}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);o(g5,"calculateTextHeight");o(Cl,"calculateTextWidth");t9=qp((t,e)=>{let{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};let[,a]=mc(r),s=["sans-serif",n],l=t.split(We.lineBreakRegex),u=[],h=$e("body");if(!h.remove)return{width:0,height:0,lineHeight:0};let f=h.append("svg");for(let p of s){let m=0,g={width:0,height:0,lineHeight:0};for(let y of l){let v=iCe();v.text=y||K_;let x=aCe(f,v).style("font-size",a).style("font-weight",i).style("font-family",p),b=(x._groups||x)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,b.width)),m=Math.round(b.height),g.height+=m,g.lineHeight=Math.round(Math.max(g.lineHeight,m))}u.push(g)}f.remove();let d=isNaN(u[1].height)||isNaN(u[1].width)||isNaN(u[1].lineHeight)||u[0].height>u[1].height&&u[0].width>u[1].width&&u[0].lineHeight>u[1].lineHeight?0:1;return u[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),j_=class{constructor(e=!1,r){this.count=0;this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{o(this,"InitIDGenerator")}},oCe=o(function(t){return m5=m5||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),m5.innerHTML=t,unescape(m5.textContent)},"entityDecode");o(r9,"isDetailedError");lCe=o((t,e,r,n)=>{if(!n)return;let i=t.node()?.getBBox();i&&t.append("text").text(n).attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),mc=o(t=>{if(typeof t=="number")return[t,t+"px"];let e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");o(Ts,"cleanAndMerge");Lt={assignWithDepth:On,wrapLabel:e9,calculateTextHeight:g5,calculateTextWidth:Cl,calculateTextDimensions:t9,cleanAndMerge:Ts,detectInit:j6e,detectDirective:kX,isSubstringInArray:K6e,interpolateToCurve:om,calcLabelPosition:eCe,calcCardinalityPosition:tCe,calcTerminalLabelPosition:rCe,formatUrl:Q6e,getStylesFromArray:lm,generateId:Z_,random:J_,runFunc:Z6e,entityDecode:oCe,insertTitle:lCe,parseFontSize:mc,InitIDGenerator:j_},SX=o(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){let n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"\uFB02\xB0\xB0"+n+"\xB6\xDF":"\uFB02\xB0"+n+"\xB6\xDF"}),e},"encodeEntities"),to=o(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),y5=o((t,e,{counter:r=0,prefix:n,suffix:i})=>`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId")});function Sl(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=e9(e[t].text,i,n),e[t].textLines=e[t].text.split(We.lineBreakRegex).length,e[t].width=i,e[t].height=g5(e[t].text,n);else{let a=e[t].text.split(We.lineBreakRegex);e[t].textLines=a.length;let s=0;e[t].height=0,e[t].width=0;for(let l of a)e[t].width=Math.max(Cl(l,n),e[t].width),s=g5(l,n),e[t].height=e[t].height+s}}function RX(t,e,r,n,i){let a=new w5(i);a.data.widthLimit=r.data.widthLimit/Math.min(n9,n.length);for(let[s,l]of n.entries()){let u=0;l.image={width:0,height:0,Y:0},l.sprite&&(l.image.width=48,l.image.height=48,l.image.Y=u,u=l.image.Y+l.image.height);let h=l.wrap&&Nt.wrap,f=v5(Nt);if(f.fontSize=f.fontSize+2,f.fontWeight="bold",Sl("label",l,h,f,a.data.widthLimit),l.label.Y=u+8,u=l.label.Y+l.label.height,l.type&&l.type.text!==""){l.type.text="["+l.type.text+"]";let g=v5(Nt);Sl("type",l,h,g,a.data.widthLimit),l.type.Y=u+5,u=l.type.Y+l.type.height}if(l.descr&&l.descr.text!==""){let g=v5(Nt);g.fontSize=g.fontSize-2,Sl("descr",l,h,g,a.data.widthLimit),l.descr.Y=u+20,u=l.descr.Y+l.descr.height}if(s==0||s%n9===0){let g=r.data.startx+Nt.diagramMarginX,y=r.data.stopy+Nt.diagramMarginY+u;a.setData(g,g,y,y)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+Nt.diagramMarginX:a.data.startx,y=a.data.starty;a.setData(g,g,y,y)}a.name=l.alias;let d=i.db.getC4ShapeArray(l.alias),p=i.db.getC4ShapeKeys(l.alias);p.length>0&&DX(a,t,d,p),e=l.alias;let m=i.db.getBoundarys(e);m.length>0&&RX(t,e,a,m,i),l.alias!=="global"&&LX(t,l,a),r.data.stopy=Math.max(a.data.stopy+Nt.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+Nt.c4ShapeMargin,r.data.stopx),x5=Math.max(x5,r.data.stopx),b5=Math.max(b5,r.data.stopy)}}var x5,b5,_X,n9,Nt,w5,i9,hv,v5,cCe,LX,DX,ks,AX,uCe,hCe,fCe,a9,NX=R(()=>{"use strict";Zt();AW();ut();VC();rr();lS();_t();cp();xr();Yn();x5=0,b5=0,_X=4,n9=2;U1.yy=hy;Nt={},w5=class{static{o(this,"Bounds")}constructor(e){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,i9(e.db.getConfig())}setData(e,r,n,i){this.nextData.startx=this.data.startx=e,this.nextData.stopx=this.data.stopx=r,this.nextData.starty=this.data.starty=n,this.nextData.stopy=this.data.stopy=i}updateVal(e,r,n,i){e[r]===void 0?e[r]=n:e[r]=i(n,e[r])}insert(e){this.nextData.cnt=this.nextData.cnt+1;let r=this.nextData.startx===this.nextData.stopx?this.nextData.stopx+e.margin:this.nextData.stopx+e.margin*2,n=r+e.width,i=this.nextData.starty+e.margin*2,a=i+e.height;(r>=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>_X)&&(r=this.nextData.startx+e.margin+Nt.nextLinePaddingX,i=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=a=i+e.height,this.nextData.cnt=1),e.x=r,e.y=i,this.updateVal(this.data,"startx",r,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",a,Math.max),this.updateVal(this.nextData,"startx",r,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",a,Math.max)}init(e){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},i9(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},i9=o(function(t){On(Nt,t),t.fontFamily&&(Nt.personFontFamily=Nt.systemFontFamily=Nt.messageFontFamily=t.fontFamily),t.fontSize&&(Nt.personFontSize=Nt.systemFontSize=Nt.messageFontSize=t.fontSize),t.fontWeight&&(Nt.personFontWeight=Nt.systemFontWeight=Nt.messageFontWeight=t.fontWeight)},"setConf"),hv=o((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),v5=o(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),cCe=o(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");o(Sl,"calcC4ShapeTextWH");LX=o(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=Nt.c4ShapeMargin-35;let n=e.wrap&&Nt.wrap,i=v5(Nt);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=Cl(e.label.text,i);Sl("label",e,n,i,a),Tl.drawBoundary(t,e,Nt)},"drawBoundary"),DX=o(function(t,e,r,n){let i=0;for(let a of n){i=0;let s=r[a],l=hv(Nt,s.typeC4Shape.text);switch(l.fontSize=l.fontSize-2,s.typeC4Shape.width=Cl("\xAB"+s.typeC4Shape.text+"\xBB",l),s.typeC4Shape.height=l.fontSize+2,s.typeC4Shape.Y=Nt.c4ShapePadding,i=s.typeC4Shape.Y+s.typeC4Shape.height-4,s.image={width:0,height:0,Y:0},s.typeC4Shape.text){case"person":case"external_person":s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height;break}s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height);let u=s.wrap&&Nt.wrap,h=Nt.width-Nt.c4ShapePadding*2,f=hv(Nt,s.typeC4Shape.text);if(f.fontSize=f.fontSize+2,f.fontWeight="bold",Sl("label",s,u,f,h),s.label.Y=i+8,i=s.label.Y+s.label.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let m=hv(Nt,s.typeC4Shape.text);Sl("type",s,u,m,h),s.type.Y=i+5,i=s.type.Y+s.type.height}else if(s.techn&&s.techn.text!==""){s.techn.text="["+s.techn.text+"]";let m=hv(Nt,s.techn.text);Sl("techn",s,u,m,h),s.techn.Y=i+5,i=s.techn.Y+s.techn.height}let d=i,p=s.label.width;if(s.descr&&s.descr.text!==""){let m=hv(Nt,s.typeC4Shape.text);Sl("descr",s,u,m,h),s.descr.Y=i+20,i=s.descr.Y+s.descr.height,p=Math.max(s.label.width,s.descr.width),d=i-s.descr.textLines*5}p=p+Nt.c4ShapePadding,s.width=Math.max(s.width||Nt.width,p,Nt.width),s.height=Math.max(s.height||Nt.height,d,Nt.height),s.margin=s.margin||Nt.c4ShapeMargin,t.insert(s),Tl.drawC4Shape(e,s,Nt)}t.bumpLastMargin(Nt.c4ShapeMargin)},"drawC4ShapeArray"),ks=class{static{o(this,"Point")}constructor(e,r){this.x=e,this.y=r}},AX=o(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,l=n+t.height/2,u=Math.abs(r-i),h=Math.abs(n-a),f=h/u,d=t.height/t.width,p=null;return n==a&&ri?p=new ks(r,l):r==i&&na&&(p=new ks(s,n)),r>i&&n=f?p=new ks(r,l+f*t.width/2):p=new ks(s-u/h*t.height/2,n+t.height):r=f?p=new ks(r+t.width,l+f*t.width/2):p=new ks(s+u/h*t.height/2,n+t.height):ra?d>=f?p=new ks(r+t.width,l-f*t.width/2):p=new ks(s+t.height/2*u/h,n):r>i&&n>a&&(d>=f?p=new ks(r,l-t.width/2*f):p=new ks(s-t.height/2*u/h,n)),p},"getIntersectPoint"),uCe=o(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=AX(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=AX(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),hCe=o(function(t,e,r,n){let i=0;for(let a of e){i=i+1;let s=a.wrap&&Nt.wrap,l=cCe(Nt);n.db.getC4Type()==="C4Dynamic"&&(a.label.text=i+": "+a.label.text);let h=Cl(a.label.text,l);Sl("label",a,s,l,h),a.techn&&a.techn.text!==""&&(h=Cl(a.techn.text,l),Sl("techn",a,s,l,h)),a.descr&&a.descr.text!==""&&(h=Cl(a.descr.text,l),Sl("descr",a,s,l,h));let f=r(a.from),d=r(a.to),p=uCe(f,d);a.startPoint=p.startPoint,a.endPoint=p.endPoint}Tl.drawRels(t,e,Nt)},"drawRels");o(RX,"drawInsideBoundary");fCe=o(function(t,e,r,n){Nt=de().c4;let i=de().securityLevel,a;i==="sandbox"&&(a=$e("#i"+e));let s=i==="sandbox"?$e(a.nodes()[0].contentDocument.body):$e("body"),l=n.db;n.db.setWrap(Nt.wrap),_X=l.getC4ShapeInRow(),n9=l.getC4BoundaryInRow(),V.debug(`C:${JSON.stringify(Nt,null,2)}`);let u=i==="sandbox"?s.select(`[id="${e}"]`):$e(`[id="${e}"]`);Tl.insertComputerIcon(u),Tl.insertDatabaseIcon(u),Tl.insertClockIcon(u);let h=new w5(n);h.setData(Nt.diagramMarginX,Nt.diagramMarginX,Nt.diagramMarginY,Nt.diagramMarginY),h.data.widthLimit=screen.availWidth,x5=Nt.diagramMarginX,b5=Nt.diagramMarginY;let f=n.db.getTitle(),d=n.db.getBoundarys("");RX(u,"",h,d,n),Tl.insertArrowHead(u),Tl.insertArrowEnd(u),Tl.insertArrowCrossHead(u),Tl.insertArrowFilledHead(u),hCe(u,n.db.getRels(),n.db.getC4Shape,n),h.data.stopx=x5,h.data.stopy=b5;let p=h.data,g=p.stopy-p.starty+2*Nt.diagramMarginY,v=p.stopx-p.startx+2*Nt.diagramMarginX;f&&u.append("text").text(f).attr("x",(p.stopx-p.startx)/2-4*Nt.diagramMarginX).attr("y",p.starty+Nt.diagramMarginY),Sr(u,g,v,Nt.useMaxWidth);let x=f?60:0;u.attr("viewBox",p.startx-Nt.diagramMarginX+" -"+(Nt.diagramMarginY+x)+" "+v+" "+(g+x)),V.debug("models:",p)},"draw"),a9={drawPersonOrSystemArray:DX,drawBoundary:LX,setConf:i9,draw:fCe}});var dCe,MX,IX=R(()=>{"use strict";dCe=o(t=>`.person { + stroke: ${t.personBorder}; + fill: ${t.personBkg}; + } +`,"getStyles"),MX=dCe});var OX={};hr(OX,{diagram:()=>pCe});var pCe,PX=R(()=>{"use strict";VC();lS();NX();IX();pCe={parser:rz,db:hy,renderer:a9,styles:MX,init:o(({c4:t,wrap:e})=>{a9.setConf(t),hy.setWrap(e)},"init")}});function o9(t){let e=[];for(let r of t){let n=dv.get(r);n?.styles&&(e=[...e,...n.styles??[]].map(i=>i.trim())),n?.textStyles&&(e=[...e,...n.textStyles??[]].map(i=>i.trim()))}return e}var vCe,zX,cm,$h,Es,dv,Cu,l9,c9,T5,s9,Fo,k5,E5,C5,S5,xCe,bCe,wCe,TCe,kCe,ECe,CCe,u9,SCe,ACe,_Ce,GX,LCe,DCe,h9,$X,VX,RCe,UX,NCe,MCe,ICe,OCe,PCe,fv,HX,YX,BCe,FCe,WX,zCe,GCe,$Ce,VCe,UCe,qX,XX,HCe,YCe,WCe,qCe,XCe,jCe,A5,f9=R(()=>{"use strict";Zt();xr();_t();rr();ut();bi();vCe="flowchart-",zX=0,cm=de(),$h=new Map,Es=[],dv=new Map,Cu=[],l9=new Map,c9=new Map,T5=0,s9=!0,E5=[],C5=o(t=>We.sanitizeText(t,cm),"sanitizeText"),S5=o(function(t){for(let e of $h.values())if(e.id===t)return e.domId;return t},"lookUpDomId"),xCe=o(function(t,e,r,n,i,a,s={}){if(!t||t.trim().length===0)return;let l,u=$h.get(t);u===void 0&&(u={id:t,labelType:"text",domId:vCe+t+"-"+zX,styles:[],classes:[]},$h.set(t,u)),zX++,e!==void 0?(cm=de(),l=C5(e.text.trim()),u.labelType=e.type,l.startsWith('"')&&l.endsWith('"')&&(l=l.substring(1,l.length-1)),u.text=l):u.text===void 0&&(u.text=t),r!==void 0&&(u.type=r),n?.forEach(function(h){u.styles.push(h)}),i?.forEach(function(h){u.classes.push(h)}),a!==void 0&&(u.dir=a),u.props===void 0?u.props=s:s!==void 0&&Object.assign(u.props,s)},"addVertex"),bCe=o(function(t,e,r){let a={start:t,end:e,type:void 0,text:"",labelType:"text"};V.info("abc78 Got edge...",a);let s=r.text;if(s!==void 0&&(a.text=C5(s.text.trim()),a.text.startsWith('"')&&a.text.endsWith('"')&&(a.text=a.text.substring(1,a.text.length-1)),a.labelType=s.type),r!==void 0&&(a.type=r.type,a.stroke=r.stroke,a.length=r.length>10?10:r.length),Es.length<(cm.maxEdges??500))V.info("Pushing edge..."),Es.push(a);else throw new Error(`Edge limit exceeded. ${Es.length} edges found, but the limit is ${cm.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"),wCe=o(function(t,e,r){V.info("addLink",t,e,r);for(let n of t)for(let i of e)bCe(n,i,r)},"addLink"),TCe=o(function(t,e){t.forEach(function(r){r==="default"?Es.defaultInterpolate=e:Es[r].interpolate=e})},"updateLinkInterpolate"),kCe=o(function(t,e){t.forEach(function(r){if(typeof r=="number"&&r>=Es.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${Es.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);r==="default"?Es.defaultStyle=e:(Es[r].style=e,(Es[r]?.style?.length??0)>0&&!Es[r]?.style?.some(n=>n?.startsWith("fill"))&&Es[r]?.style?.push("fill:none"))})},"updateLink"),ECe=o(function(t,e){t.split(",").forEach(function(r){let n=dv.get(r);n===void 0&&(n={id:r,styles:[],textStyles:[]},dv.set(r,n)),e?.forEach(function(i){if(/color/.exec(i)){let a=i.replace("fill","bgFill");n.textStyles.push(a)}n.styles.push(i)})})},"addClass"),CCe=o(function(t){Fo=t,/.*/.exec(Fo)&&(Fo="LR"),/.*v/.exec(Fo)&&(Fo="TB"),Fo==="TD"&&(Fo="TB")},"setDirection"),u9=o(function(t,e){for(let r of t.split(",")){let n=$h.get(r);n&&n.classes.push(e);let i=l9.get(r);i&&i.classes.push(e)}},"setClass"),SCe=o(function(t,e){if(e!==void 0){e=C5(e);for(let r of t.split(","))c9.set(k5==="gen-1"?S5(r):r,e)}},"setTooltip"),ACe=o(function(t,e,r){let n=S5(t);if(de().securityLevel!=="loose"||e===void 0)return;let i=[];if(typeof r=="string"){i=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s")),i.classed("hover",!0)}).on("mouseout",function(){e.transition().duration(500).style("opacity",0),$e(this).classed("hover",!1)})},"setupToolTips");E5.push(UX);NCe=o(function(t="gen-1"){$h=new Map,dv=new Map,Es=[],E5=[UX],Cu=[],l9=new Map,T5=0,c9=new Map,s9=!0,k5=t,cm=de(),vr()},"clear"),MCe=o(t=>{k5=t||"gen-2"},"setGen"),ICe=o(function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},"defaultStyle"),OCe=o(function(t,e,r){let n=t.text.trim(),i=r.text;t===r&&/\s/.exec(r.text)&&(n=void 0);function a(h){let f={boolean:{},number:{},string:{}},d=[],p;return{nodeList:h.filter(function(g){let y=typeof g;return g.stmt&&g.stmt==="dir"?(p=g.value,!1):g.trim()===""?!1:y in f?f[y].hasOwnProperty(g)?!1:f[y][g]=!0:d.includes(g)?!1:d.push(g)}),dir:p}}o(a,"uniq");let{nodeList:s,dir:l}=a(e.flat());if(k5==="gen-1")for(let h=0;h2e3)return{result:!1,count:0};if(HX[fv]=e,Cu[e].id===t)return{result:!0,count:0};let n=0,i=1;for(;n=0){let s=YX(t,a);if(s.result)return{result:!0,count:i+s.count};i=i+s.count}n=n+1}return{result:!1,count:i}},"indexNodes2"),BCe=o(function(t){return HX[t]},"getDepthFirstPos"),FCe=o(function(){fv=-1,Cu.length>0&&YX("none",Cu.length-1)},"indexNodes"),WX=o(function(){return Cu},"getSubGraphs"),zCe=o(()=>s9?(s9=!1,!0):!1,"firstGraph"),GCe=o(t=>{let e=t.trim(),r="arrow_open";switch(e[0]){case"<":r="arrow_point",e=e.slice(1);break;case"x":r="arrow_cross",e=e.slice(1);break;case"o":r="arrow_circle",e=e.slice(1);break}let n="normal";return e.includes("=")&&(n="thick"),e.includes(".")&&(n="dotted"),{type:r,stroke:n}},"destructStartLink"),$Ce=o((t,e)=>{let r=e.length,n=0;for(let i=0;i{let e=t.trim(),r=e.slice(0,-1),n="arrow_open";switch(e.slice(-1)){case"x":n="arrow_cross",e.startsWith("x")&&(n="double_"+n,r=r.slice(1));break;case">":n="arrow_point",e.startsWith("<")&&(n="double_"+n,r=r.slice(1));break;case"o":n="arrow_circle",e.startsWith("o")&&(n="double_"+n,r=r.slice(1));break}let i="normal",a=r.length-1;r.startsWith("=")&&(i="thick"),r.startsWith("~")&&(i="invisible");let s=$Ce(".",r);return s&&(i="dotted",a=s),{type:n,stroke:i,length:a}},"destructEndLink"),UCe=o((t,e)=>{let r=VCe(t),n;if(e){if(n=GCe(e),n.stroke!==r.stroke)return{type:"INVALID",stroke:"INVALID"};if(n.type==="arrow_open")n.type=r.type;else{if(n.type!==r.type)return{type:"INVALID",stroke:"INVALID"};n.type="double_"+n.type}return n.type==="double_arrow"&&(n.type="double_arrow_point"),n.length=r.length,n}return r},"destructLink"),qX=o((t,e)=>{for(let r of t)if(r.nodes.includes(e))return!0;return!1},"exists"),XX=o((t,e)=>{let r=[];return t.nodes.forEach((n,i)=>{qX(e,n)||r.push(t.nodes[i])}),{nodes:r}},"makeUniq"),HCe={firstGraph:zCe},YCe=o(t=>t.type==="square"?"squareRect":t.type==="round"?"roundedRect":t.type??"squareRect","getTypeFromVertex"),WCe=o((t,e)=>t.find(r=>r.id===e),"findNode"),qCe=o(t=>{let e="none",r="arrow_point";switch(t){case"arrow_point":case"arrow_circle":case"arrow_cross":r=t;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":e=t.replace("double_",""),r=e;break}return{arrowTypeStart:e,arrowTypeEnd:r}},"destructEdgeType"),XCe=o((t,e,r,n,i,a)=>{let s=r.get(t.id),l=n.get(t.id)??!1,u=WCe(e,t.id);u?(u.cssStyles=t.styles,u.cssCompiledStyles=o9(t.classes),u.cssClasses=t.classes.join(" ")):e.push({id:t.id,label:t.text,labelStyle:"",parentId:s,padding:i.flowchart?.padding||8,cssStyles:t.styles,cssCompiledStyles:o9(["default","node",...t.classes]),cssClasses:"default "+t.classes.join(" "),shape:YCe(t),dir:t.dir,domId:t.domId,isGroup:l,look:a,link:t.link,linkTarget:t.linkTarget,tooltip:GX(t.id)})},"addNodeFromVertex");o(o9,"getCompiledStyles");jCe=o(()=>{let t=de(),e=[],r=[],n=WX(),i=new Map,a=new Map;for(let u=n.length-1;u>=0;u--){let h=n[u];h.nodes.length>0&&a.set(h.id,!0);for(let f of h.nodes)i.set(f,h.id)}for(let u=n.length-1;u>=0;u--){let h=n[u];e.push({id:h.id,label:h.title,labelStyle:"",parentId:i.get(h.id),padding:8,cssCompiledStyles:o9(h.classes),cssClasses:h.classes.join(" "),shape:"rect",dir:h.dir,isGroup:!0,look:t.look})}$X().forEach(u=>{XCe(u,e,i,a,t,t.look||"classic")});let l=VX();return l.forEach((u,h)=>{let{arrowTypeStart:f,arrowTypeEnd:d}=qCe(u.type),p=[...l.defaultStyle??[]];u.style&&p.push(...u.style);let m={id:y5(u.start,u.end,{counter:h,prefix:"L"}),start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:u?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:u?.stroke==="invisible"?"none":f,arrowTypeEnd:u?.stroke==="invisible"?"none":d,arrowheadStyle:"fill: #333",labelStyle:p,style:p,pattern:u.stroke,look:t.look};r.push(m)}),{nodes:e,edges:r,other:{},config:t}},"getData"),A5={defaultConfig:o(()=>_4.flowchart,"defaultConfig"),setAccTitle:kr,getAccTitle:Ar,getAccDescription:Lr,getData:jCe,setAccDescription:_r,addVertex:xCe,lookUpDomId:S5,addLink:wCe,updateLinkInterpolate:TCe,updateLink:kCe,addClass:ECe,setDirection:CCe,setClass:u9,setTooltip:SCe,getTooltip:GX,setClickEvent:LCe,setLink:_Ce,bindFunctions:DCe,getDirection:h9,getVertices:$X,getEdges:VX,getClasses:RCe,clear:NCe,setGen:MCe,defaultStyle:ICe,addSubGraph:OCe,getDepthFirstPos:BCe,indexNodes:FCe,getSubGraphs:WX,destructLink:UCe,lex:HCe,exists:qX,makeUniq:XX,setDiagramTitle:nn,getDiagramTitle:Xr}});var KCe,jX,KX=R(()=>{"use strict";KCe=o(t=>{let e=new Set;for(let r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),jX=o((t,e,r)=>{let n=KCe(t),i=2,a=e.height+2*r.padding,s=a/i,l=e.width+2*s+r.padding,u=r.padding/2;return n.has("right")&&n.has("left")&&n.has("up")&&n.has("down")?[{x:0,y:0},{x:s,y:0},{x:l/2,y:2*u},{x:l-s,y:0},{x:l,y:0},{x:l,y:-a/3},{x:l+2*u,y:-a/2},{x:l,y:-2*a/3},{x:l,y:-a},{x:l-s,y:-a},{x:l/2,y:-a-2*u},{x:s,y:-a},{x:0,y:-a},{x:0,y:-2*a/3},{x:-2*u,y:-a/2},{x:0,y:-a/3}]:n.has("right")&&n.has("left")&&n.has("up")?[{x:s,y:0},{x:l-s,y:0},{x:l,y:-a/2},{x:l-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}]:n.has("right")&&n.has("left")&&n.has("down")?[{x:0,y:0},{x:s,y:-a},{x:l-s,y:-a},{x:l,y:0}]:n.has("right")&&n.has("up")&&n.has("down")?[{x:0,y:0},{x:l,y:-s},{x:l,y:-a+s},{x:0,y:-a}]:n.has("left")&&n.has("up")&&n.has("down")?[{x:l,y:0},{x:0,y:-s},{x:0,y:-a+s},{x:l,y:-a}]:n.has("right")&&n.has("left")?[{x:s,y:0},{x:s,y:-u},{x:l-s,y:-u},{x:l-s,y:0},{x:l,y:-a/2},{x:l-s,y:-a},{x:l-s,y:-a+u},{x:s,y:-a+u},{x:s,y:-a},{x:0,y:-a/2}]:n.has("up")&&n.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:s,y:-u},{x:s,y:-a+u},{x:0,y:-a+u},{x:l/2,y:-a},{x:l,y:-a+u},{x:l-s,y:-a+u},{x:l-s,y:-u},{x:l,y:-u}]:n.has("right")&&n.has("up")?[{x:0,y:0},{x:l,y:-s},{x:0,y:-a}]:n.has("right")&&n.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-a}]:n.has("left")&&n.has("up")?[{x:l,y:0},{x:0,y:-s},{x:l,y:-a}]:n.has("left")&&n.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-a}]:n.has("right")?[{x:s,y:-u},{x:s,y:-u},{x:l-s,y:-u},{x:l-s,y:0},{x:l,y:-a/2},{x:l-s,y:-a},{x:l-s,y:-a+u},{x:s,y:-a+u},{x:s,y:-a+u}]:n.has("left")?[{x:s,y:0},{x:s,y:-u},{x:l-s,y:-u},{x:l-s,y:-a+u},{x:s,y:-a+u},{x:s,y:-a},{x:0,y:-a/2}]:n.has("up")?[{x:s,y:-u},{x:s,y:-a+u},{x:0,y:-a+u},{x:l/2,y:-a},{x:l,y:-a+u},{x:l-s,y:-a+u},{x:l-s,y:-u}]:n.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:s,y:-u},{x:s,y:-a+u},{x:l-s,y:-a+u},{x:l-s,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints")});function m9(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function rj(t){Sd=t}function ro(t,e){if(e){if(nj.test(t))return t.replace(QCe,QX)}else if(ij.test(t))return t.replace(ZCe,QX);return t}function t7e(t){return t.replace(e7e,(e,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}function ln(t,e){let r=typeof t=="string"?t:t.source;e=e||"";let n={replace:o((i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(r7e,"$1"),r=r.replace(i,s),n},"replace"),getRegex:o(()=>new RegExp(r,e),"getRegex")};return n}function ZX(t){try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}function JX(t,e){let r=t.replace(/\|/g,(a,s,l)=>{let u=!1,h=s;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(/ \|/),i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length{let a=i.match(/^\s+/);if(a===null)return i;let[s]=a;return s.length>=n.length?i.slice(n.length):i}).join(` +`)}function jr(t,e){return Cd.parse(t,e)}var Sd,nj,QCe,ij,ZCe,JCe,QX,e7e,r7e,gv,hm,a7e,s7e,o7e,vv,l7e,aj,sj,g9,c7e,y9,u7e,h7e,D5,v9,f7e,oj,d7e,x9,tj,p7e,m7e,lj,g7e,cj,y7e,xv,v7e,x7e,b7e,w7e,T7e,k7e,E7e,C7e,S7e,L5,A7e,uj,hj,_7e,b9,L7e,d9,D7e,_5,mv,Su,fm,yv,Au,um,p9,Cd,mkt,gkt,ykt,vkt,xkt,bkt,wkt,fj=R(()=>{"use strict";o(m9,"_getDefaults");Sd=m9();o(rj,"changeDefaults");nj=/[&<>"']/,QCe=new RegExp(nj.source,"g"),ij=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ZCe=new RegExp(ij.source,"g"),JCe={"&":"&","<":"<",">":">",'"':""","'":"'"},QX=o(t=>JCe[t],"getEscapeReplacement");o(ro,"escape$1");e7e=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;o(t7e,"unescape");r7e=/(^|[^\[])\^/g;o(ln,"edit");o(ZX,"cleanUrl");gv={exec:o(()=>null,"exec")};o(JX,"splitCells");o(pv,"rtrim");o(n7e,"findClosingBracket");o(ej,"outputLink");o(i7e,"indentCodeCompensation");hm=class{static{o(this,"_Tokenizer")}options;rules;lexer;constructor(e){this.options=e||Sd}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:pv(n,` +`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=i7e(n,r[3]||"");return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(/#$/.test(n)){let i=pv(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:pv(r[0],` +`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=pv(r[0],` +`).split(` +`),i="",a="",s=[];for(;n.length>0;){let l=!1,u=[],h;for(h=0;h/.test(n[h]))u.push(n[h]),l=!0;else if(!l)u.push(n[h]);else break;n=n.slice(h);let f=u.join(` +`),d=f.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,` + $1`).replace(/^ {0,3}>[ \t]?/gm,"");i=i?`${i} +${f}`:f,a=a?`${a} +${d}`:d;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,s,!0),this.lexer.state.top=p,n.length===0)break;let m=s[s.length-1];if(m?.type==="code")break;if(m?.type==="blockquote"){let g=m,y=g.raw+` +`+n.join(` +`),v=this.blockquote(y);s[s.length-1]=v,i=i.substring(0,i.length-g.raw.length)+v.raw,a=a.substring(0,a.length-g.text.length)+v.text;break}else if(m?.type==="list"){let g=m,y=g.raw+` +`+n.join(` +`),v=this.list(y);s[s.length-1]=v,i=i.substring(0,i.length-m.raw.length)+v.raw,a=a.substring(0,a.length-g.raw.length)+v.raw,n=y.substring(s[s.length-1].raw.length).split(` +`);continue}}return{type:"blockquote",raw:i,tokens:s,text:a}}}list(e){let r=this.rules.block.list.exec(e);if(r){let n=r[1].trim(),i=n.length>1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let s=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),l=!1;for(;e;){let u=!1,h="",f="";if(!(r=s.exec(e))||this.rules.block.hr.test(e))break;h=r[0],e=e.substring(h.length);let d=r[2].split(` +`,1)[0].replace(/^\t+/,x=>" ".repeat(3*x.length)),p=e.split(` +`,1)[0],m=!d.trim(),g=0;if(this.options.pedantic?(g=2,f=d.trimStart()):m?g=r[1].length+1:(g=r[2].search(/[^ ]/),g=g>4?1:g,f=d.slice(g),g+=r[1].length),m&&/^ *$/.test(p)&&(h+=p+` +`,e=e.substring(p.length+1),u=!0),!u){let x=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),b=new RegExp(`^ {0,${Math.min(3,g-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),w=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:\`\`\`|~~~)`),S=new RegExp(`^ {0,${Math.min(3,g-1)}}#`);for(;e;){let T=e.split(` +`,1)[0];if(p=T,this.options.pedantic&&(p=p.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),w.test(p)||S.test(p)||x.test(p)||b.test(e))break;if(p.search(/[^ ]/)>=g||!p.trim())f+=` +`+p.slice(g);else{if(m||d.search(/[^ ]/)>=4||w.test(d)||S.test(d)||b.test(d))break;f+=` +`+p}!m&&!p.trim()&&(m=!0),h+=T+` +`,e=e.substring(T.length+1),d=p.slice(g)}}a.loose||(l?a.loose=!0:/\n *\n *$/.test(h)&&(l=!0));let y=null,v;this.options.gfm&&(y=/^\[[ xX]\] /.exec(f),y&&(v=y[0]!=="[ ] ",f=f.replace(/^\[[ xX]\] +/,""))),a.items.push({type:"list_item",raw:h,task:!!y,checked:v,loose:!1,text:f,tokens:[]}),a.raw+=h}a.items[a.items.length-1].raw=a.items[a.items.length-1].raw.trimEnd(),a.items[a.items.length-1].text=a.items[a.items.length-1].text.trimEnd(),a.raw=a.raw.trimEnd();for(let u=0;ud.type==="space"),f=h.length>0&&h.some(d=>/\n.*\n/.test(d.raw));a.loose=f}if(a.loose)for(let u=0;u$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:i,title:a}}}table(e){let r=this.rules.block.table.exec(e);if(!r||!/[:|]/.test(r[2]))return;let n=JX(r[1]),i=r[2].replace(/^\||\| *$/g,"").split("|"),a=r[3]&&r[3].trim()?r[3].replace(/\n[ \t]*$/,"").split(` +`):[],s={type:"table",raw:r[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let l of i)/^ *-+: *$/.test(l)?s.align.push("right"):/^ *:-+: *$/.test(l)?s.align.push("center"):/^ *:-+ *$/.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l({text:u,tokens:this.lexer.inline(u),header:!1,align:s.align[h]})));return s}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===` +`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:ro(r[1])}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&/^
    /i.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;let s=pv(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=n7e(r[2],"()");if(s>-1){let u=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,u).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),/^$/.test(n)?i=i.slice(1):i=i.slice(1,-1)),ej(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(/\s+/g," "),a=r[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return ej(n,a,n[0],this.lexer)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let s=[...i[0]].length-1,l,u,h=s,f=0,d=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,r=r.slice(-1*e.length+s);(i=d.exec(r))!=null;){if(l=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!l)continue;if(u=[...l].length,i[3]||i[4]){h+=u;continue}else if((i[5]||i[6])&&s%3&&!((s+u)%3)){f+=u;continue}if(h-=u,h>0)continue;u=Math.min(u,u+h+f);let p=[...i[0]][0].length,m=e.slice(0,s+i.index+p+u);if(Math.min(s,u)%2){let y=m.slice(1,-1);return{type:"em",raw:m,text:y,tokens:this.lexer.inlineTokens(y)}}let g=m.slice(2,-2);return{type:"strong",raw:m,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(/\n/g," "),i=/[^ ]/.test(n),a=/^ /.test(n)&&/ $/.test(n);return i&&a&&(n=n.substring(1,n.length-1)),n=ro(n,!0),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){let r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=ro(r[1]),i="mailto:"+n):(n=ro(r[1]),i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let r;if(r=this.rules.inline.url.exec(e)){let n,i;if(r[2]==="@")n=ro(r[0]),i="mailto:"+n;else{let a;do a=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(a!==r[0]);n=ro(r[0]),r[1]==="www."?i="http://"+r[0]:i=r[0]}return{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n;return this.lexer.state.inRawBlock?n=r[0]:n=ro(r[0]),{type:"text",raw:r[0],text:n}}}},a7e=/^(?: *(?:\n|$))+/,s7e=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,o7e=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,vv=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,l7e=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,aj=/(?:[*+-]|\d{1,9}[.)])/,sj=ln(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,aj).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(),g9=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,c7e=/^[^\n]+/,y9=/(?!\s*\])(?:\\.|[^\[\]\\])+/,u7e=ln(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",y9).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),h7e=ln(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,aj).getRegex(),D5="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",v9=/|$))/,f7e=ln("^ {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",v9).replace("tag",D5).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oj=ln(g9).replace("hr",vv).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",D5).getRegex(),d7e=ln(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",oj).getRegex(),x9={blockquote:d7e,code:s7e,def:u7e,fences:o7e,heading:l7e,hr:vv,html:f7e,lheading:sj,list:h7e,newline:a7e,paragraph:oj,table:gv,text:c7e},tj=ln("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",vv).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",D5).getRegex(),p7e={...x9,table:tj,paragraph:ln(g9).replace("hr",vv).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",tj).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",D5).getRegex()},m7e={...x9,html:ln(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",v9).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:gv,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ln(g9).replace("hr",vv).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",sj).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},lj=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,g7e=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,cj=/^( {2,}|\\)\n(?!\s*$)/,y7e=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,b7e=ln(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,xv).getRegex(),w7e=ln("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,xv).getRegex(),T7e=ln("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,xv).getRegex(),k7e=ln(/\\([punct])/,"gu").replace(/punct/g,xv).getRegex(),E7e=ln(/^<(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(),C7e=ln(v9).replace("(?:-->|$)","-->").getRegex(),S7e=ln("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",C7e).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),L5=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,A7e=ln(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",L5).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),uj=ln(/^!?\[(label)\]\[(ref)\]/).replace("label",L5).replace("ref",y9).getRegex(),hj=ln(/^!?\[(ref)\](?:\[\])?/).replace("ref",y9).getRegex(),_7e=ln("reflink|nolink(?!\\()","g").replace("reflink",uj).replace("nolink",hj).getRegex(),b9={_backpedal:gv,anyPunctuation:k7e,autolink:E7e,blockSkip:x7e,br:cj,code:g7e,del:gv,emStrongLDelim:b7e,emStrongRDelimAst:w7e,emStrongRDelimUnd:T7e,escape:lj,link:A7e,nolink:hj,punctuation:v7e,reflink:uj,reflinkSearch:_7e,tag:S7e,text:y7e,url:gv},L7e={...b9,link:ln(/^!?\[(label)\]\((.*?)\)/).replace("label",L5).getRegex(),reflink:ln(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",L5).getRegex()},d9={...b9,escape:ln(lj).replace("])","~|])").getRegex(),url:ln(/^((?: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]*?(?:(?=[\\u+" ".repeat(h.length));let i,a,s;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(l=>(i=l.call({lexer:this},e,r))?(e=e.substring(i.raw.length),r.push(i),!0):!1))){if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length),i.raw.length===1&&r.length>0?r[r.length-1].raw+=` +`:r.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length),a=r[r.length-1],a&&(a.type==="paragraph"||a.type==="text")?(a.raw+=` +`+i.raw,a.text+=` +`+i.text,this.inlineQueue[this.inlineQueue.length-1].src=a.text):r.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length),a=r[r.length-1],a&&(a.type==="paragraph"||a.type==="text")?(a.raw+=` +`+i.raw,a.text+=` +`+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=a.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),r.push(i);continue}if(s=e,this.options.extensions&&this.options.extensions.startBlock){let l=1/0,u=e.slice(1),h;this.options.extensions.startBlock.forEach(f=>{h=f.call({lexer:this},u),typeof h=="number"&&h>=0&&(l=Math.min(l,h))}),l<1/0&&l>=0&&(s=e.substring(0,l+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){a=r[r.length-1],n&&a?.type==="paragraph"?(a.raw+=` +`+i.raw,a.text+=` +`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=a.text):r.push(i),n=s.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length),a=r[r.length-1],a&&a.type==="text"?(a.raw+=` +`+i.raw,a.text+=` +`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=a.text):r.push(i);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){let n,i,a,s=e,l,u,h;if(this.tokens.links){let f=Object.keys(this.tokens.links);if(f.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)f.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,l.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(u||(h=""),u=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(f=>(n=f.call({lexer:this},e,r))?(e=e.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),i=r[r.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):r.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),i=r[r.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):r.push(n);continue}if(n=this.tokenizer.emStrong(e,s,h)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),r.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),r.push(n);continue}if(a=e,this.options.extensions&&this.options.extensions.startInline){let f=1/0,d=e.slice(1),p;this.options.extensions.startInline.forEach(m=>{p=m.call({lexer:this},d),typeof p=="number"&&p>=0&&(f=Math.min(f,p))}),f<1/0&&f>=0&&(a=e.substring(0,f+1))}if(n=this.tokenizer.inlineText(a)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(h=n.raw.slice(-1)),u=!0,i=r[r.length-1],i&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):r.push(n);continue}if(e){let f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return r}},fm=class{static{o(this,"_Renderer")}options;parser;constructor(e){this.options=e||Sd}space(e){return""}code({text:e,lang:r,escaped:n}){let i=(r||"").match(/^\S*/)?.[0],a=e.replace(/\n$/,"")+` +`;return i?'
    '+(n?a:ro(a,!0))+`
    +`:"
    "+(n?a:ro(a,!0))+`
    +`}blockquote({tokens:e}){return`
    +${this.parser.parse(e)}
    +`}html({text:e}){return e}heading({tokens:e,depth:r}){return`${this.parser.parseInline(e)} +`}hr(e){return`
    +`}list(e){let r=e.ordered,n=e.start,i="";for(let l=0;l +`+i+" +`}listitem(e){let r="";if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&e.tokens[0].type==="paragraph"?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=n+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):r+=n+" "}return r+=this.parser.parse(e.tokens,!!e.loose),`
  • ${r}
  • +`}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    +`}table(e){let r="",n="";for(let a=0;a${i}`),` + +`+r+` +`+i+`
    +`}tablerow({text:e}){return` +${e} +`}tablecell(e){let r=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+r+` +`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${e}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),a=ZX(e);if(a===null)return i;e=a;let s='
    ",s}image({href:e,title:r,text:n}){let i=ZX(e);if(i===null)return n;e=i;let a=`${n}{let l=a[s].flat(1/0);n=n.concat(this.walkTokens(l,r))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let s=r.renderers[a.name];s?r.renderers[a.name]=function(...l){let u=a.renderer.apply(this,l);return u===!1&&(u=s.apply(this,l)),u}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[a.level];s?s.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),i.extensions=r),n.renderer){let a=this.defaults.renderer||new fm(this.defaults);for(let s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let l=s,u=n.renderer[l];n.useNewRenderer||(u=this.#t(u,l,a));let h=a[l];a[l]=(...f)=>{let d=u.apply(a,f);return d===!1&&(d=h.apply(a,f)),d||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new hm(this.defaults);for(let s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let l=s,u=n.tokenizer[l],h=a[l];a[l]=(...f)=>{let d=u.apply(a,f);return d===!1&&(d=h.apply(a,f)),d}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new um;for(let s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(s==="options")continue;let l=s,u=n.hooks[l],h=a[l];um.passThroughHooks.has(s)?a[l]=f=>{if(this.defaults.async)return Promise.resolve(u.call(a,f)).then(p=>h.call(a,p));let d=u.call(a,f);return h.call(a,d)}:a[l]=(...f)=>{let d=u.apply(a,f);return d===!1&&(d=h.apply(a,f)),d}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(l){let u=[];return u.push(s.call(this,l)),a&&(u=u.concat(a.call(this,l))),u}}this.defaults={...this.defaults,...i}}),this}#t(e,r,n){switch(r){case"heading":return function(i){return!i.type||i.type!==r?e.apply(this,arguments):e.call(this,n.parser.parseInline(i.tokens),i.depth,t7e(n.parser.parseInline(i.tokens,n.parser.textRenderer)))};case"code":return function(i){return!i.type||i.type!==r?e.apply(this,arguments):e.call(this,i.text,i.lang,!!i.escaped)};case"table":return function(i){if(!i.type||i.type!==r)return e.apply(this,arguments);let a="",s="";for(let u=0;u0&&f.tokens[0].type==="paragraph"?(f.tokens[0].text=g+" "+f.tokens[0].text,f.tokens[0].tokens&&f.tokens[0].tokens.length>0&&f.tokens[0].tokens[0].type==="text"&&(f.tokens[0].tokens[0].text=g+" "+f.tokens[0].tokens[0].text)):f.tokens.unshift({type:"text",text:g+" "}):m+=g+" "}m+=this.parser.parse(f.tokens,l),u+=this.listitem({type:"list_item",raw:m,text:m,task:p,checked:!!d,loose:l,tokens:f.tokens})}return e.call(this,u,a,s)};case"html":return function(i){return!i.type||i.type!==r?e.apply(this,arguments):e.call(this,i.text,i.block)};case"paragraph":return function(i){return!i.type||i.type!==r?e.apply(this,arguments):e.call(this,this.parser.parseInline(i.tokens))};case"escape":return function(i){return!i.type||i.type!==r?e.apply(this,arguments):e.call(this,i.text)};case"link":return function(i){return!i.type||i.type!==r?e.apply(this,arguments):e.call(this,i.href,i.title,this.parser.parseInline(i.tokens))};case"image":return function(i){return!i.type||i.type!==r?e.apply(this,arguments):e.call(this,i.href,i.title,i.text)};case"strong":return function(i){return!i.type||i.type!==r?e.apply(this,arguments):e.call(this,this.parser.parseInline(i.tokens))};case"em":return function(i){return!i.type||i.type!==r?e.apply(this,arguments):e.call(this,this.parser.parseInline(i.tokens))};case"codespan":return function(i){return!i.type||i.type!==r?e.apply(this,arguments):e.call(this,i.text)};case"del":return function(i){return!i.type||i.type!==r?e.apply(this,arguments):e.call(this,this.parser.parseInline(i.tokens))};case"text":return function(i){return!i.type||i.type!==r?e.apply(this,arguments):e.call(this,i.text)}}return e}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return Su.lex(e,r??this.defaults)}parser(e,r){return Au.parse(e,r??this.defaults)}#e(e,r){return(n,i)=>{let a={...i},s={...this.defaults,...a};this.defaults.async===!0&&a.async===!1&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);let l=this.#r(!!s.silent,!!s.async);if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(u=>e(u,s)).then(u=>s.hooks?s.hooks.processAllTokens(u):u).then(u=>s.walkTokens?Promise.all(this.walkTokens(u,s.walkTokens)).then(()=>u):u).then(u=>r(u,s)).then(u=>s.hooks?s.hooks.postprocess(u):u).catch(l);try{s.hooks&&(n=s.hooks.preprocess(n));let u=e(n,s);s.hooks&&(u=s.hooks.processAllTokens(u)),s.walkTokens&&this.walkTokens(u,s.walkTokens);let h=r(u,s);return s.hooks&&(h=s.hooks.postprocess(h)),h}catch(u){return l(u)}}}#r(e,r){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error occurred:

    "+ro(n.message+"",!0)+"
    ";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},Cd=new p9;o(jr,"marked");jr.options=jr.setOptions=function(t){return Cd.setOptions(t),jr.defaults=Cd.defaults,rj(jr.defaults),jr};jr.getDefaults=m9;jr.defaults=Sd;jr.use=function(...t){return Cd.use(...t),jr.defaults=Cd.defaults,rj(jr.defaults),jr};jr.walkTokens=function(t,e){return Cd.walkTokens(t,e)};jr.parseInline=Cd.parseInline;jr.Parser=Au;jr.parser=Au.parse;jr.Renderer=fm;jr.TextRenderer=yv;jr.Lexer=Su;jr.lexer=Su.lex;jr.Tokenizer=hm;jr.Hooks=um;jr.parse=jr;mkt=jr.options,gkt=jr.setOptions,ykt=jr.use,vkt=jr.walkTokens,xkt=jr.parseInline,bkt=Au.parse,wkt=Su.lex});function R7e(t,{markdownAutoWrap:e}){let n=t.replace(//g,` +`).replace(/\n{2,}/g,` +`),i=Gb(n);return e===!1?i.replace(/ /g," "):i}function dj(t,e={}){let r=R7e(t,e),n=jr.lexer(r),i=[[]],a=0;function s(l,u="normal"){l.type==="text"?l.text.split(` +`).forEach((f,d)=>{d!==0&&(a++,i.push([])),f.split(" ").forEach(p=>{p&&i[a].push({content:p,type:u})})}):l.type==="strong"||l.type==="em"?l.tokens.forEach(h=>{s(h,l.type)}):l.type==="html"&&i[a].push({content:l.text,type:"normal"})}return o(s,"processNode"),n.forEach(l=>{l.type==="paragraph"?l.tokens?.forEach(u=>{s(u)}):l.type==="html"&&i[a].push({content:l.text,type:"normal"})}),i}function pj(t,{markdownAutoWrap:e}={}){let r=jr.lexer(t);function n(i){return i.type==="text"?e===!1?i.text.replace(/\n */g,"
    ").replace(/ /g," "):i.text.replace(/\n */g,"
    "):i.type==="strong"?`${i.tokens?.map(n).join("")}`:i.type==="em"?`${i.tokens?.map(n).join("")}`:i.type==="paragraph"?`

    ${i.tokens?.map(n).join("")}

    `:i.type==="space"?"":i.type==="html"?`${i.text}`:`Unsupported markdown: ${i.type}`}return o(n,"output"),r.map(n).join("")}var mj=R(()=>{"use strict";fj();zC();o(R7e,"preprocessMarkdown");o(dj,"markdownToLines");o(pj,"markdownToHTML")});function N7e(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}function M7e(t,e){let r=N7e(e.content);return gj(t,[],r,e.type)}function gj(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];let[i,...a]=r,s=[...e,i];return t([{content:s.join(""),type:n}])?gj(t,s,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}function yj(t,e){if(t.some(({content:r})=>r.includes(` +`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return w9(t,e)}function w9(t,e,r=[],n=[]){if(t.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";t[0].content===" "&&(i=" ",t.shift());let a=t.shift()??{content:" ",type:"normal"},s=[...n];if(i!==""&&s.push({content:i,type:"normal"}),s.push(a),e(s))return w9(t,e,r,s);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){let[l,u]=M7e(e,a);r.push([l]),u.content&&t.unshift(u)}return w9(t,e,r)}var vj=R(()=>{"use strict";o(N7e,"splitTextToChars");o(M7e,"splitWordToFitWidth");o(gj,"splitWordToFitWidthRecursion");o(yj,"splitLineToFitWidth");o(w9,"splitLineToFitWidthRecursion")});function xj(t,e){e&&t.attr("style",e)}async function I7e(t,e,r,n,i=!1){let a=t.append("foreignObject"),s=a.append("xhtml:div"),l=e.label;e.label&&Ni(e.label)&&(l=await yh(e.label.replace(We.lineBreakRegex,` +`),de()));let u=e.isNode?"nodeLabel":"edgeLabel",h=s.append("span");h.html(l),xj(h,e.labelStyle),h.attr("class",`${u} ${n}`),xj(s,e.labelStyle),s.style("display","table-cell"),s.style("white-space","nowrap"),s.style("line-height","1.5"),s.style("max-width",r+"px"),s.style("text-align","center"),s.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&s.attr("class","labelBkg");let f=s.node().getBoundingClientRect();return f.width===r&&(s.style("display","table"),s.style("white-space","break-spaces"),s.style("width",r+"px"),f=s.node().getBoundingClientRect()),a.node()}function T9(t,e,r){return t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em")}function O7e(t,e,r){let n=t.append("text"),i=T9(n,1,e);k9(i,r);let a=i.node().getComputedTextLength();return n.remove(),a}function bj(t,e,r){let n=t.append("text"),i=T9(n,1,e);k9(i,[{content:r,type:"normal"}]);let a=i.node()?.getBoundingClientRect();return a&&n.remove(),a}function P7e(t,e,r,n=!1){let a=e.append("g"),s=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1"),u=0;for(let h of r){let f=o(p=>O7e(a,1.1,p)<=t,"checkWidth"),d=f(h)?[h]:yj(h,f);for(let p of d){let m=T9(l,u,1.1);k9(m,p),u++}}if(n){let h=l.node().getBBox(),f=2;return s.attr("x",-f).attr("y",-f).attr("width",h.width+2*f).attr("height",h.height+2*f),a.node()}else return l.node()}function k9(t,e){t.text(""),e.forEach((r,n)=>{let i=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(r.content):i.text(" "+r.content)})}function E9(t){return t.replace(/fa[bklrs]?:fa-[\w-]+/g,e=>``)}var ta,Al=R(()=>{"use strict";_t();rr();Zt();ut();mj();xr();vj();o(xj,"applyStyle");o(I7e,"addHtmlSpan");o(T9,"createTspan");o(O7e,"computeWidthOfText");o(bj,"computeDimensionOfText");o(P7e,"createFormattedText");o(k9,"updateTextContentAndStyles");o(E9,"replaceIconSubstring");ta=o(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,isNode:s=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(V.info("XYZ createText",e,r,n,i,a,s,"addSvgBackground: ",u),a){let f=pj(e,h),d=E9(to(f)),p=e.replace(/\\\\/g,"\\"),m={isNode:s,label:Ni(e)?p:d,labelStyle:r.replace("fill:","color:")};return await I7e(t,m,l,i,u)}else{let f=e.replace(//g,"
    "),d=dj(f.replace("
    ","
    "),h),p=P7e(l,t,d,e?u:!1);if(s){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));let m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");$e(p).attr("style",m)}else{let m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");$e(p).select("rect").attr("style",m.replace(/background:/g,"fill:"));let g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");$e(p).select("text").attr("style",g)}return p}},"createText")});function wj(t,e){e&&t.attr("style",e)}function B7e(t){let e=$e(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=e.append("xhtml:div"),n=t.label,i=t.isNode?"nodeLabel":"edgeLabel",a=r.append("span");return a.html(n),wj(a,t.labelStyle),a.attr("class",i),wj(r,t.labelStyle),r.style("display","inline-block"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}var F7e,ra,bv=R(()=>{"use strict";Zt();ut();_t();rr();xr();Al();o(wj,"applyStyle");o(B7e,"addHtmlLabel");F7e=o((t,e,r,n)=>{let i=t||"";if(typeof i=="object"&&(i=i[0]),yr(de().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"
    "),V.debug("vertexText"+i);let a={isNode:n,label:E9(to(i)),labelStyle:e.replace("fill:","color:")};return B7e(a)}else{let a=document.createElementNS("http://www.w3.org/2000/svg","text");a.setAttribute("style",e.replace("color:","fill:"));let s=[];typeof i=="string"?s=i.split(/\\n|\n|/gi):Array.isArray(i)?s=i:s=[];for(let l of s){let u=document.createElementNS("http://www.w3.org/2000/svg","tspan");u.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),u.setAttribute("dy","1em"),u.setAttribute("x","0"),r?u.setAttribute("class","title-row"):u.setAttribute("class","row"),u.textContent=l.trim(),a.appendChild(u)}return a}},"createLabel"),ra=F7e});function z7e(t,e){return t.intersect(e)}var Tj,kj=R(()=>{"use strict";o(z7e,"intersectNode");Tj=z7e});function G7e(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,l=a-n.y,u=Math.sqrt(e*e*l*l+r*r*s*s),h=Math.abs(e*r*s/u);n.x{"use strict";o(G7e,"intersectEllipse");R5=G7e});function $7e(t,e,r){return R5(t,e,e,r)}var Ej,Cj=R(()=>{"use strict";C9();o($7e,"intersectCircle");Ej=$7e});function V7e(t,e,r,n){var i,a,s,l,u,h,f,d,p,m,g,y,v,x,b;if(i=e.y-t.y,s=t.x-e.x,u=e.x*t.y-t.x*e.y,p=i*r.x+s*r.y+u,m=i*n.x+s*n.y+u,!(p!==0&&m!==0&&Sj(p,m))&&(a=n.y-r.y,l=r.x-n.x,h=n.x*r.y-r.x*n.y,f=a*t.x+l*t.y+h,d=a*e.x+l*e.y+h,!(f!==0&&d!==0&&Sj(f,d))&&(g=i*l-a*s,g!==0)))return y=Math.abs(g/2),v=s*h-l*u,x=v<0?(v-y)/g:(v+y)/g,v=a*u-i*h,b=v<0?(v-y)/g:(v+y)/g,{x,y:b}}function Sj(t,e){return t*e>0}var Aj,_j=R(()=>{"use strict";o(V7e,"intersectLine");o(Sj,"sameSign");Aj=V7e});function U7e(t,e,r){var n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){s=Math.min(s,g.x),l=Math.min(l,g.y)}):(s=Math.min(s,e.x),l=Math.min(l,e.y));for(var u=n-t.width/2-s,h=i-t.height/2-l,f=0;f1&&a.sort(function(g,y){var v=g.x-r.x,x=g.y-r.y,b=Math.sqrt(v*v+x*x),w=y.x-r.x,S=y.y-r.y,T=Math.sqrt(w*w+S*S);return b{"use strict";_j();Lj=U7e;o(U7e,"intersectPolygon")});var H7e,Ad,S9=R(()=>{"use strict";H7e=o((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,l=t.height/2,u,h;return Math.abs(a)*s>Math.abs(i)*l?(a<0&&(l=-l),u=a===0?0:l*i/a,h=l):(i<0&&(s=-s),u=s,h=i===0?0:s*a/i),{x:r+u,y:n+h}},"intersectRect"),Ad=H7e});var Tn,A9=R(()=>{"use strict";kj();Cj();C9();Dj();S9();Tn={node:Tj,circle:Ej,ellipse:R5,polygon:Lj,rect:Ad}});function _l(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}var Ti,kn,N5=R(()=>{"use strict";bv();Al();_t();Zt();rr();xr();Ti=o(async(t,e,r,n)=>{let i=de(),a,s=e.useHtmlLabels||yr(i.flowchart.htmlLabels);r?a=r:a="node default";let l=t.insert("g").attr("class",a).attr("id",e.domId||e.id),u=l.insert("g").attr("class","label").attr("style",e.labelStyle),h;e.labelText===void 0?h="":h=typeof e.labelText=="string"?e.labelText:e.labelText[0];let f=u.node(),d;e.labelType==="markdown"?d=ta(u,qr(to(h),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):d=f.appendChild(ra(qr(to(h),i),e.labelStyle,!1,n));let p=d.getBBox(),m=e.padding/2;if(yr(i.flowchart.htmlLabels)){let g=d.children[0],y=$e(d),v=g.getElementsByTagName("img");if(v){let x=h.replace(/]*>/g,"").trim()==="";await Promise.all([...v].map(b=>new Promise(w=>{function S(){if(b.style.display="flex",b.style.flexDirection="column",x){let T=i.fontSize?i.fontSize:window.getComputedStyle(document.body).fontSize,_=parseInt(T,10)*5+"px";b.style.minWidth=_,b.style.maxWidth=_}else b.style.width="100%";w(b)}o(S,"setupImage"),setTimeout(()=>{b.complete&&S()}),b.addEventListener("error",S),b.addEventListener("load",S)})))}p=g.getBoundingClientRect(),y.attr("width",p.width),y.attr("height",p.height)}return s?u.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):u.attr("transform","translate(0, "+-p.height/2+")"),e.centerLabel&&u.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),u.insert("rect",":first-child"),{shapeSvg:l,bbox:p,halfPadding:m,label:u}},"labelHelper"),kn=o((t,e)=>{let r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");o(_l,"insertPolygonShape")});var Y7e,Rj,Nj=R(()=>{"use strict";N5();ut();_t();A9();Y7e=o(async(t,e)=>{e.useHtmlLabels||de().flowchart.htmlLabels||(e.centerLabel=!0);let{shapeSvg:n,bbox:i,halfPadding:a}=await Ti(t,e,"node "+e.classes,!0);V.info("Classes = ",e.classes);let s=n.insert("rect",":first-child");return s.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-a).attr("y",-i.height/2-a).attr("width",i.width+e.padding).attr("height",i.height+e.padding),kn(e,s),e.intersect=function(l){return Tn.rect(e,l)},n},"note"),Rj=Y7e});function _9(t,e,r,n){let i=[],a=o(l=>{i.push(l,0)},"addBorder"),s=o(l=>{i.push(0,l)},"skipBorder");e.includes("t")?(V.debug("add top border"),a(r)):s(r),e.includes("r")?(V.debug("add right border"),a(n)):s(n),e.includes("b")?(V.debug("add bottom border"),a(r)):s(r),e.includes("l")?(V.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}var Mj,no,Ij,W7e,q7e,X7e,j7e,K7e,Q7e,Z7e,J7e,eSe,tSe,rSe,nSe,iSe,aSe,sSe,oSe,lSe,cSe,uSe,Oj,hSe,fSe,Pj,dm,pm,Bj,Fj,wv,M5=R(()=>{"use strict";Zt();_t();rr();ut();KX();bv();A9();Nj();N5();Mj=o(t=>t?" "+t:"","formatClass"),no=o((t,e)=>`${e||"node default"}${Mj(t.classes)} ${Mj(t.class)}`,"getClassesFromNode"),Ij=o(async(t,e)=>{let{shapeSvg:r,bbox:n}=await Ti(t,e,no(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=i+a,l=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];V.info("Question main (Circle)");let u=_l(r,s,s,l);return u.attr("style",e.style),kn(e,u),e.intersect=function(h){return V.warn("Intersect called"),Tn.polygon(e,l,h)},r},"question"),W7e=o((t,e)=>{let r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=28,i=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}];return r.insert("polygon",":first-child").attr("points",i.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(s){return Tn.circle(e,14,s)},r},"choice"),q7e=o(async(t,e)=>{let{shapeSvg:r,bbox:n}=await Ti(t,e,no(e,void 0),!0),i=4,a=n.height+e.padding,s=a/i,l=n.width+2*s+e.padding,u=[{x:s,y:0},{x:l-s,y:0},{x:l,y:-a/2},{x:l-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}],h=_l(r,l,a,u);return h.attr("style",e.style),kn(e,h),e.intersect=function(f){return Tn.polygon(e,u,f)},r},"hexagon"),X7e=o(async(t,e)=>{let{shapeSvg:r,bbox:n}=await Ti(t,e,void 0,!0),i=2,a=n.height+2*e.padding,s=a/i,l=n.width+2*s+e.padding,u=jX(e.directions,n,e),h=_l(r,l,a,u);return h.attr("style",e.style),kn(e,h),e.intersect=function(f){return Tn.polygon(e,u,f)},r},"block_arrow"),j7e=o(async(t,e)=>{let{shapeSvg:r,bbox:n}=await Ti(t,e,no(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return _l(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(u){return Tn.polygon(e,s,u)},r},"rect_left_inv_arrow"),K7e=o(async(t,e)=>{let{shapeSvg:r,bbox:n}=await Ti(t,e,no(e),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],l=_l(r,i,a,s);return l.attr("style",e.style),kn(e,l),e.intersect=function(u){return Tn.polygon(e,s,u)},r},"lean_right"),Q7e=o(async(t,e)=>{let{shapeSvg:r,bbox:n}=await Ti(t,e,no(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],l=_l(r,i,a,s);return l.attr("style",e.style),kn(e,l),e.intersect=function(u){return Tn.polygon(e,s,u)},r},"lean_left"),Z7e=o(async(t,e)=>{let{shapeSvg:r,bbox:n}=await Ti(t,e,no(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],l=_l(r,i,a,s);return l.attr("style",e.style),kn(e,l),e.intersect=function(u){return Tn.polygon(e,s,u)},r},"trapezoid"),J7e=o(async(t,e)=>{let{shapeSvg:r,bbox:n}=await Ti(t,e,no(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],l=_l(r,i,a,s);return l.attr("style",e.style),kn(e,l),e.intersect=function(u){return Tn.polygon(e,s,u)},r},"inv_trapezoid"),eSe=o(async(t,e)=>{let{shapeSvg:r,bbox:n}=await Ti(t,e,no(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],l=_l(r,i,a,s);return l.attr("style",e.style),kn(e,l),e.intersect=function(u){return Tn.polygon(e,s,u)},r},"rect_right_inv_arrow"),tSe=o(async(t,e)=>{let{shapeSvg:r,bbox:n}=await Ti(t,e,no(e,void 0),!0),i=n.width+e.padding,a=i/2,s=a/(2.5+i/50),l=n.height+s+e.padding,u="M 0,"+s+" a "+a+","+s+" 0,0,0 "+i+" 0 a "+a+","+s+" 0,0,0 "+-i+" 0 l 0,"+l+" a "+a+","+s+" 0,0,0 "+i+" 0 l 0,"+-l,h=r.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",u).attr("transform","translate("+-i/2+","+-(l/2+s)+")");return kn(e,h),e.intersect=function(f){let d=Tn.rect(e,f),p=d.x-e.x;if(a!=0&&(Math.abs(p)e.height/2-s)){let m=s*s*(1-p*p/(a*a));m!=0&&(m=Math.sqrt(m)),m=s-m,f.y-e.y>0&&(m=-m),d.y+=m}return d},r},"cylinder"),rSe=o(async(t,e)=>{let{shapeSvg:r,bbox:n,halfPadding:i}=await Ti(t,e,"node "+e.classes+" "+e.class,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,l=e.positioned?e.height:n.height+e.padding,u=e.positioned?-s/2:-n.width/2-i,h=e.positioned?-l/2:-n.height/2-i;if(a.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",u).attr("y",h).attr("width",s).attr("height",l),e.props){let f=new Set(Object.keys(e.props));e.props.borders&&(_9(a,e.props.borders,s,l),f.delete("borders")),f.forEach(d=>{V.warn(`Unknown node property ${d}`)})}return kn(e,a),e.intersect=function(f){return Tn.rect(e,f)},r},"rect"),nSe=o(async(t,e)=>{let{shapeSvg:r,bbox:n,halfPadding:i}=await Ti(t,e,"node "+e.classes,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,l=e.positioned?e.height:n.height+e.padding,u=e.positioned?-s/2:-n.width/2-i,h=e.positioned?-l/2:-n.height/2-i;if(a.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",u).attr("y",h).attr("width",s).attr("height",l),e.props){let f=new Set(Object.keys(e.props));e.props.borders&&(_9(a,e.props.borders,s,l),f.delete("borders")),f.forEach(d=>{V.warn(`Unknown node property ${d}`)})}return kn(e,a),e.intersect=function(f){return Tn.rect(e,f)},r},"composite"),iSe=o(async(t,e)=>{let{shapeSvg:r}=await Ti(t,e,"label",!0);V.trace("Classes = ",e.class);let n=r.insert("rect",":first-child"),i=0,a=0;if(n.attr("width",i).attr("height",a),r.attr("class","label edgeLabel"),e.props){let s=new Set(Object.keys(e.props));e.props.borders&&(_9(n,e.props.borders,i,a),s.delete("borders")),s.forEach(l=>{V.warn(`Unknown node property ${l}`)})}return kn(e,n),e.intersect=function(s){return Tn.rect(e,s)},r},"labelRect");o(_9,"applyNodePropertyBorders");aSe=o((t,e)=>{let r;e.classes?r="node "+e.classes:r="node default";let n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=n.insert("rect",":first-child"),a=n.insert("line"),s=n.insert("g").attr("class","label"),l=e.labelText.flat?e.labelText.flat():e.labelText,u="";typeof l=="object"?u=l[0]:u=l,V.info("Label text abc79",u,l,typeof l=="object");let h=s.node().appendChild(ra(u,e.labelStyle,!0,!0)),f={width:0,height:0};if(yr(de().flowchart.htmlLabels)){let y=h.children[0],v=$e(h);f=y.getBoundingClientRect(),v.attr("width",f.width),v.attr("height",f.height)}V.info("Text 2",l);let d=l.slice(1,l.length),p=h.getBBox(),m=s.node().appendChild(ra(d.join?d.join("
    "):d,e.labelStyle,!0,!0));if(yr(de().flowchart.htmlLabels)){let y=m.children[0],v=$e(m);f=y.getBoundingClientRect(),v.attr("width",f.width),v.attr("height",f.height)}let g=e.padding/2;return $e(m).attr("transform","translate( "+(f.width>p.width?0:(p.width-f.width)/2)+", "+(p.height+g+5)+")"),$e(h).attr("transform","translate( "+(f.width{let{shapeSvg:r,bbox:n}=await Ti(t,e,no(e,void 0),!0),i=n.height+e.padding,a=n.width+i/4+e.padding,s=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-a/2).attr("y",-i/2).attr("width",a).attr("height",i);return kn(e,s),e.intersect=function(l){return Tn.rect(e,l)},r},"stadium"),oSe=o(async(t,e)=>{let{shapeSvg:r,bbox:n,halfPadding:i}=await Ti(t,e,no(e,void 0),!0),a=r.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),V.info("Circle main"),kn(e,a),e.intersect=function(s){return V.info("Circle intersect",e,n.width/2+i,s),Tn.circle(e,n.width/2+i,s)},r},"circle"),lSe=o(async(t,e)=>{let{shapeSvg:r,bbox:n,halfPadding:i}=await Ti(t,e,no(e,void 0),!0),a=5,s=r.insert("g",":first-child"),l=s.insert("circle"),u=s.insert("circle");return s.attr("class",e.class),l.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+a).attr("width",n.width+e.padding+a*2).attr("height",n.height+e.padding+a*2),u.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),V.info("DoubleCircle main"),kn(e,l),e.intersect=function(h){return V.info("DoubleCircle intersect",e,n.width/2+i+a,h),Tn.circle(e,n.width/2+i+a,h)},r},"doublecircle"),cSe=o(async(t,e)=>{let{shapeSvg:r,bbox:n}=await Ti(t,e,no(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],l=_l(r,i,a,s);return l.attr("style",e.style),kn(e,l),e.intersect=function(u){return Tn.polygon(e,s,u)},r},"subroutine"),uSe=o((t,e)=>{let r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),kn(e,n),e.intersect=function(i){return Tn.circle(e,7,i)},r},"start"),Oj=o((t,e,r)=>{let n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),i=70,a=10;r==="LR"&&(i=10,a=70);let s=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return kn(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(l){return Tn.rect(e,l)},n},"forkJoin"),hSe=o((t,e)=>{let r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),kn(e,i),e.intersect=function(a){return Tn.circle(e,7,a)},r},"end"),fSe=o((t,e)=>{let r=e.padding/2,n=4,i=8,a;e.classes?a="node "+e.classes:a="node default";let s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),l=s.insert("rect",":first-child"),u=s.insert("line"),h=s.insert("line"),f=0,d=n,p=s.insert("g").attr("class","label"),m=0,g=e.classData.annotations?.[0],y=e.classData.annotations[0]?"\xAB"+e.classData.annotations[0]+"\xBB":"",v=p.node().appendChild(ra(y,e.labelStyle,!0,!0)),x=v.getBBox();if(yr(de().flowchart.htmlLabels)){let A=v.children[0],L=$e(v);x=A.getBoundingClientRect(),L.attr("width",x.width),L.attr("height",x.height)}e.classData.annotations[0]&&(d+=x.height+n,f+=x.width);let b=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(de().flowchart.htmlLabels?b+="<"+e.classData.type+">":b+="<"+e.classData.type+">");let w=p.node().appendChild(ra(b,e.labelStyle,!0,!0));$e(w).attr("class","classTitle");let S=w.getBBox();if(yr(de().flowchart.htmlLabels)){let A=w.children[0],L=$e(w);S=A.getBoundingClientRect(),L.attr("width",S.width),L.attr("height",S.height)}d+=S.height+n,S.width>f&&(f=S.width);let T=[];e.classData.members.forEach(A=>{let L=A.getDisplayDetails(),M=L.displayText;de().flowchart.htmlLabels&&(M=M.replace(//g,">"));let N=p.node().appendChild(ra(M,L.cssStyle?L.cssStyle:e.labelStyle,!0,!0)),k=N.getBBox();if(yr(de().flowchart.htmlLabels)){let I=N.children[0],C=$e(N);k=I.getBoundingClientRect(),C.attr("width",k.width),C.attr("height",k.height)}k.width>f&&(f=k.width),d+=k.height+n,T.push(N)}),d+=i;let E=[];if(e.classData.methods.forEach(A=>{let L=A.getDisplayDetails(),M=L.displayText;de().flowchart.htmlLabels&&(M=M.replace(//g,">"));let N=p.node().appendChild(ra(M,L.cssStyle?L.cssStyle:e.labelStyle,!0,!0)),k=N.getBBox();if(yr(de().flowchart.htmlLabels)){let I=N.children[0],C=$e(N);k=I.getBoundingClientRect(),C.attr("width",k.width),C.attr("height",k.height)}k.width>f&&(f=k.width),d+=k.height+n,E.push(N)}),d+=i,g){let A=(f-x.width)/2;$e(v).attr("transform","translate( "+(-1*f/2+A)+", "+-1*d/2+")"),m=x.height+n}let _=(f-S.width)/2;return $e(w).attr("transform","translate( "+(-1*f/2+_)+", "+(-1*d/2+m)+")"),m+=S.height+n,u.attr("class","divider").attr("x1",-f/2-r).attr("x2",f/2+r).attr("y1",-d/2-r+i+m).attr("y2",-d/2-r+i+m),m+=i,T.forEach(A=>{$e(A).attr("transform","translate( "+-f/2+", "+(-1*d/2+m+i/2)+")");let L=A?.getBBox();m+=(L?.height??0)+n}),m+=i,h.attr("class","divider").attr("x1",-f/2-r).attr("x2",f/2+r).attr("y1",-d/2-r+i+m).attr("y2",-d/2-r+i+m),m+=i,E.forEach(A=>{$e(A).attr("transform","translate( "+-f/2+", "+(-1*d/2+m)+")");let L=A?.getBBox();m+=(L?.height??0)+n}),l.attr("style",e.style).attr("class","outer title-state").attr("x",-f/2-r).attr("y",-(d/2)-r).attr("width",f+e.padding).attr("height",d+e.padding),kn(e,l),e.intersect=function(A){return Tn.rect(e,A)},s},"class_box"),Pj={rhombus:Ij,composite:nSe,question:Ij,rect:rSe,labelRect:iSe,rectWithTitle:aSe,choice:W7e,circle:oSe,doublecircle:lSe,stadium:sSe,hexagon:q7e,block_arrow:X7e,rect_left_inv_arrow:j7e,lean_right:K7e,lean_left:Q7e,trapezoid:Z7e,inv_trapezoid:J7e,rect_right_inv_arrow:eSe,cylinder:tSe,start:uSe,end:hSe,note:Rj,subroutine:cSe,fork:Oj,join:Oj,class_box:fSe},dm={},pm=o(async(t,e,r)=>{let n,i;if(e.link){let a;de().securityLevel==="sandbox"?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await Pj[e.shape](n,e,r)}else i=await Pj[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),dm[e.id]=n,e.haveCallback&&dm[e.id].attr("class",dm[e.id].attr("class")+" clickable"),n},"insertNode"),Bj=o((t,e)=>{dm[e.id]=t},"setNodeElem"),Fj=o(()=>{dm={}},"clear"),wv=o(t=>{let e=dm[t.id];V.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");let r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode")});var I5,L9=R(()=>{"use strict";Zt();M5();I5=o((t,e)=>{let r;return e==="sandbox"&&(r=$e("#i"+t)),(e==="sandbox"?$e(r.nodes()[0].contentDocument.body):$e("body")).select(`[id="${t}"]`)},"getDiagramElement")});var io,_d=R(()=>{"use strict";io=o(({flowchart:t})=>{let e=t?.subGraphTitleMargin?.top??0,r=t?.subGraphTitleMargin?.bottom??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins")});function D9(t,e,r){if(t&&t.length){let[n,i]=e,a=Math.PI/180*r,s=Math.cos(a),l=Math.sin(a);for(let u of t){let[h,f]=u;u[0]=(h-n)*s-(f-i)*l+n,u[1]=(h-n)*l+(f-i)*s+i}}}function dSe(t,e){return t[0]===e[0]&&t[1]===e[1]}function pSe(t,e,r,n=1){let i=r,a=Math.max(e,.1),s=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,l=[0,0];if(i)for(let h of s)D9(h,l,i);let u=function(h,f,d){let p=[];for(let b of h){let w=[...b];dSe(w[0],w[w.length-1])||w.push([w[0][0],w[0][1]]),w.length>2&&p.push(w)}let m=[];f=Math.max(f,.1);let g=[];for(let b of p)for(let w=0;wb.yminw.ymin?1:b.xw.x?1:b.ymax===w.ymax?0:(b.ymax-w.ymax)/Math.abs(b.ymax-w.ymax)),!g.length)return m;let y=[],v=g[0].ymin,x=0;for(;y.length||g.length;){if(g.length){let b=-1;for(let w=0;wv);w++)b=w;g.splice(0,b+1).forEach(w=>{y.push({s:v,edge:w})})}if(y=y.filter(b=>!(b.edge.ymax<=v)),y.sort((b,w)=>b.edge.x===w.edge.x?0:(b.edge.x-w.edge.x)/Math.abs(b.edge.x-w.edge.x)),(d!==1||x%f==0)&&y.length>1)for(let b=0;b=y.length)break;let S=y[b].edge,T=y[w].edge;m.push([[Math.round(S.x),v],[Math.round(T.x),v]])}v+=d,y.forEach(b=>{b.edge.x=b.edge.x+d*b.edge.islope}),x++}return m}(s,a,n);if(i){for(let h of s)D9(h,l,-i);(function(h,f,d){let p=[];h.forEach(m=>p.push(...m)),D9(p,f,d)})(u,l,-i)}return u}function Cv(t,e){var r;let n=e.hachureAngle+90,i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),pSe(t,i,n,a||1)}function U5(t){let e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}function N9(t,e){return t.type===e}function W9(t){let e=[],r=function(s){let l=new Array;for(;s!=="";)if(s.match(/^([ \t\r\n,]+)/))s=s.substr(RegExp.$1.length);else if(s.match(/^([aAcChHlLmMqQsStTvVzZ])/))l[l.length]={type:mSe,text:RegExp.$1},s=s.substr(RegExp.$1.length);else{if(!s.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];l[l.length]={type:R9,text:`${parseFloat(RegExp.$1)}`},s=s.substr(RegExp.$1.length)}return l[l.length]={type:zj,text:""},l}(t),n="BOD",i=0,a=r[i];for(;!N9(a,zj);){let s=0,l=[];if(n==="BOD"){if(a.text!=="M"&&a.text!=="m")return W9("M0,0"+t);i++,s=O5[a.text],n=a.text}else N9(a,R9)?s=O5[n]:(i++,s=O5[a.text],n=a.text);if(!(i+sf%2?h+r:h+e);a.push({key:"C",data:u}),e=u[4],r=u[5];break}case"Q":a.push({key:"Q",data:[...l]}),e=l[2],r=l[3];break;case"q":{let u=l.map((h,f)=>f%2?h+r:h+e);a.push({key:"Q",data:u}),e=u[2],r=u[3];break}case"A":a.push({key:"A",data:[...l]}),e=l[5],r=l[6];break;case"a":e+=l[5],r+=l[6],a.push({key:"A",data:[l[0],l[1],l[2],l[3],l[4],e,r]});break;case"H":a.push({key:"H",data:[...l]}),e=l[0];break;case"h":e+=l[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...l]}),r=l[0];break;case"v":r+=l[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...l]}),e=l[2],r=l[3];break;case"s":{let u=l.map((h,f)=>f%2?h+r:h+e);a.push({key:"S",data:u}),e=u[2],r=u[3];break}case"T":a.push({key:"T",data:[...l]}),e=l[0],r=l[1];break;case"t":e+=l[0],r+=l[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,r=i}return a}function Xj(t){let e=[],r="",n=0,i=0,a=0,s=0,l=0,u=0;for(let{key:h,data:f}of t){switch(h){case"M":e.push({key:"M",data:[...f]}),[n,i]=f,[a,s]=f;break;case"C":e.push({key:"C",data:[...f]}),n=f[4],i=f[5],l=f[2],u=f[3];break;case"L":e.push({key:"L",data:[...f]}),[n,i]=f;break;case"H":n=f[0],e.push({key:"L",data:[n,i]});break;case"V":i=f[0],e.push({key:"L",data:[n,i]});break;case"S":{let d=0,p=0;r==="C"||r==="S"?(d=n+(n-l),p=i+(i-u)):(d=n,p=i),e.push({key:"C",data:[d,p,...f]}),l=f[0],u=f[1],n=f[2],i=f[3];break}case"T":{let[d,p]=f,m=0,g=0;r==="Q"||r==="T"?(m=n+(n-l),g=i+(i-u)):(m=n,g=i);let y=n+2*(m-n)/3,v=i+2*(g-i)/3,x=d+2*(m-d)/3,b=p+2*(g-p)/3;e.push({key:"C",data:[y,v,x,b,d,p]}),l=m,u=g,n=d,i=p;break}case"Q":{let[d,p,m,g]=f,y=n+2*(d-n)/3,v=i+2*(p-i)/3,x=m+2*(d-m)/3,b=g+2*(p-g)/3;e.push({key:"C",data:[y,v,x,b,m,g]}),l=d,u=p,n=m,i=g;break}case"A":{let d=Math.abs(f[0]),p=Math.abs(f[1]),m=f[2],g=f[3],y=f[4],v=f[5],x=f[6];d===0||p===0?(e.push({key:"C",data:[n,i,v,x,v,x]}),n=v,i=x):(n!==v||i!==x)&&(jj(n,i,v,x,d,p,m,g,y).forEach(function(b){e.push({key:"C",data:b})}),n=v,i=x);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=h}return e}function Tv(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function jj(t,e,r,n,i,a,s,l,u,h){let f=(d=s,Math.PI*d/180);var d;let p=[],m=0,g=0,y=0,v=0;if(h)[m,g,y,v]=h;else{[t,e]=Tv(t,e,-f),[r,n]=Tv(r,n,-f);let I=(t-r)/2,C=(e-n)/2,O=I*I/(i*i)+C*C/(a*a);O>1&&(O=Math.sqrt(O),i*=O,a*=O);let D=i*i,P=a*a,F=D*P-D*C*C-P*I*I,B=D*C*C+P*I*I,$=(l===u?-1:1)*Math.sqrt(Math.abs(F/B));y=$*i*C/a+(t+r)/2,v=$*-a*I/i+(e+n)/2,m=Math.asin(parseFloat(((e-v)/a).toFixed(9))),g=Math.asin(parseFloat(((n-v)/a).toFixed(9))),tg&&(m-=2*Math.PI),!u&&g>m&&(g-=2*Math.PI)}let x=g-m;if(Math.abs(x)>120*Math.PI/180){let I=g,C=r,O=n;g=u&&g>m?m+120*Math.PI/180*1:m+120*Math.PI/180*-1,p=jj(r=y+i*Math.cos(g),n=v+a*Math.sin(g),C,O,i,a,s,0,u,[g,I,y,v])}x=g-m;let b=Math.cos(m),w=Math.sin(m),S=Math.cos(g),T=Math.sin(g),E=Math.tan(x/4),_=4/3*i*E,A=4/3*a*E,L=[t,e],M=[t+_*w,e-A*b],N=[r+_*T,n-A*S],k=[r,n];if(M[0]=2*L[0]-M[0],M[1]=2*L[1]-M[1],h)return[M,N,k].concat(p);{p=[M,N,k].concat(p);let I=[];for(let C=0;C2){let i=[];for(let a=0;a2*Math.PI&&(m=0,g=2*Math.PI);let y=2*Math.PI/u.curveStepCount,v=Math.min(y/2,(g-m)/2),x=Yj(v,h,f,d,p,m,g,1,u);if(!u.disableMultiStroke){let b=Yj(v,h,f,d,p,m,g,1.5,u);x.push(...b)}return s&&(l?x.push(...Vh(h,f,h+d*Math.cos(m),f+p*Math.sin(m),u),...Vh(h,f,h+d*Math.cos(g),f+p*Math.sin(g),u)):x.push({op:"lineTo",data:[h,f]},{op:"lineTo",data:[h+d*Math.cos(m),f+p*Math.sin(m)]})),{type:"path",ops:x}}function Vj(t,e){let r=Xj(qj(W9(t))),n=[],i=[0,0],a=[0,0];for(let{key:s,data:l}of r)switch(s){case"M":a=[l[0],l[1]],i=[l[0],l[1]];break;case"L":n.push(...Vh(a[0],a[1],l[0],l[1],e)),a=[l[0],l[1]];break;case"C":{let[u,h,f,d,p,m]=l;n.push(...vSe(u,h,f,d,p,m,a,e)),a=[p,m];break}case"Z":n.push(...Vh(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function M9(t,e){let r=[];for(let n of t)if(n.length){let i=e.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+Yt(i,e),n[0][1]+Yt(i,e)]});for(let s=1;s500?.4:-.0016668*u+1.233334;let f=i.maxRandomnessOffset||0;f*f*100>l&&(f=u/10);let d=f/2,p=.2+.2*Zj(i),m=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;m=Yt(m,i,h),g=Yt(g,i,h);let y=[],v=o(()=>Yt(d,i,h),"M"),x=o(()=>Yt(f,i,h),"k"),b=i.preserveVertices;return a&&(s?y.push({op:"move",data:[t+(b?0:v()),e+(b?0:v())]}):y.push({op:"move",data:[t+(b?0:Yt(f,i,h)),e+(b?0:Yt(f,i,h))]})),s?y.push({op:"bcurveTo",data:[m+t+(r-t)*p+v(),g+e+(n-e)*p+v(),m+t+2*(r-t)*p+v(),g+e+2*(n-e)*p+v(),r+(b?0:v()),n+(b?0:v())]}):y.push({op:"bcurveTo",data:[m+t+(r-t)*p+x(),g+e+(n-e)*p+x(),m+t+2*(r-t)*p+x(),g+e+2*(n-e)*p+x(),r+(b?0:x()),n+(b?0:x())]}),y}function P5(t,e,r){if(!t.length)return[];let n=[];n.push([t[0][0]+Yt(e,r),t[0][1]+Yt(e,r)]),n.push([t[0][0]+Yt(e,r),t[0][1]+Yt(e,r)]);for(let i=1;i3){let a=[],s=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let l=1;l+21&&i.push(l)):i.push(l),i.push(t[e+3])}else{let u=t[e+0],h=t[e+1],f=t[e+2],d=t[e+3],p=Ld(u,h,.5),m=Ld(h,f,.5),g=Ld(f,d,.5),y=Ld(p,m,.5),v=Ld(m,g,.5),x=Ld(y,v,.5);U9([u,p,y,x],0,r,i),U9([x,v,g,d],0,r,i)}var a,s;return i}function bSe(t,e){return V5(t,0,t.length,e)}function V5(t,e,r,n,i){let a=i||[],s=t[e],l=t[r-1],u=0,h=1;for(let f=e+1;fu&&(u=d,h=f)}return Math.sqrt(u)>n?(V5(t,e,h+1,n,a),V5(t,h,r,n,a)):(a.length||a.push(s),a.push(l)),a}function I9(t,e=.15,r){let n=[],i=(t.length-1)/3;for(let a=0;a0?V5(n,0,n.length,r):n}var Ev,O9,P9,B9,F9,z9,Cs,G9,mSe,R9,zj,O5,gSe,ao,gm,H9,B5,Y9,Jt,ti=R(()=>{"use strict";o(D9,"t");o(dSe,"e");o(pSe,"s");o(Cv,"n");Ev=class{static{o(this,"o")}constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){let n=Cv(e,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(e,r){let n=[];for(let i of e)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}};o(U5,"a");O9=class extends Ev{static{o(this,"h")}fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);let i=Cv(e,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,s=[],l=.5*n*Math.cos(a),u=.5*n*Math.sin(a);for(let[h,f]of i)U5([h,f])&&s.push([[h[0]-l,h[1]+u],[...f]],[[h[0]+l,h[1]-u],[...f]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}},P9=class extends Ev{static{o(this,"r")}fillPolygons(e,r){let n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(e,i);return n.ops=n.ops.concat(a.ops),n}},B9=class{static{o(this,"i")}constructor(e){this.helper=e}fillPolygons(e,r){let n=Cv(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(e,r){let n=[],i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);let s=i/4;for(let l of e){let u=U5(l),h=u/i,f=Math.ceil(h)-1,d=u-f*i,p=(l[0][0]+l[1][0])/2-i/4,m=Math.min(l[0][1],l[1][1]);for(let g=0;g{let l=U5(s),u=Math.floor(l/(n+i)),h=(l+i-u*(n+i))/2,f=s[0],d=s[1];f[0]>d[0]&&(f=s[1],d=s[0]);let p=Math.atan((d[1]-f[1])/(d[0]-f[0]));for(let m=0;m{let s=U5(a),l=Math.round(s/(2*r)),u=a[0],h=a[1];u[0]>h[0]&&(u=a[1],h=a[0]);let f=Math.atan((h[1]-u[1])/(h[0]-u[0]));for(let d=0;d2*Math.PI&&(_=0,A=2*Math.PI);let L=(A-_)/b.curveStepCount,M=[];for(let N=_;N<=A;N+=L)M.push([w+T*Math.cos(N),S+E*Math.sin(N)]);return M.push([w+T*Math.cos(A),S+E*Math.sin(A)]),M.push([w,S]),mm([M],b)}(e,r,n,i,a,s,h));return h.stroke!==ao&&f.push(d),this._d("arc",f,h)}curve(e,r){let n=this._o(r),i=[],a=Gj(e,n);if(n.fill&&n.fill!==ao)if(n.fillStyle==="solid"){let s=Gj(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{let s=[],l=e;if(l.length){let u=typeof l[0][0]=="number"?[l]:l;for(let h of u)h.length<3?s.push(...h):h.length===3?s.push(...I9(Wj([h[0],h[0],h[1],h[2]]),10,(1+n.roughness)/2)):s.push(...I9(Wj(h),10,(1+n.roughness)/2))}s.length&&i.push(mm([s],n))}return n.stroke!==ao&&i.push(a),this._d("curve",i,n)}polygon(e,r){let n=this._o(r),i=[],a=F5(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(M9([e],n)):i.push(mm([e],n))),n.stroke!==ao&&i.push(a),this._d("polygon",i,n)}path(e,r){let n=this._o(r),i=[];if(!e)return this._d("path",i,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let a=n.fill&&n.fill!=="transparent"&&n.fill!==ao,s=n.stroke!==ao,l=!!(n.simplification&&n.simplification<1),u=function(f,d,p){let m=Xj(qj(W9(f))),g=[],y=[],v=[0,0],x=[],b=o(()=>{x.length>=4&&y.push(...I9(x,d)),x=[]},"i"),w=o(()=>{b(),y.length&&(g.push(y),y=[])},"c");for(let{key:T,data:E}of m)switch(T){case"M":w(),v=[E[0],E[1]],y.push(v);break;case"L":b(),y.push([E[0],E[1]]);break;case"C":if(!x.length){let _=y.length?y[y.length-1]:v;x.push([_[0],_[1]])}x.push([E[0],E[1]]),x.push([E[2],E[3]]),x.push([E[4],E[5]]);break;case"Z":b(),y.push([v[0],v[1]])}if(w(),!p)return g;let S=[];for(let T of g){let E=bSe(T,p);E.length&&S.push(E)}return S}(e,1,l?4-4*(n.simplification||1):(1+n.roughness)/2),h=Vj(e,n);if(a)if(n.fillStyle==="solid")if(u.length===1){let f=Vj(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(f.ops)})}else i.push(M9(u,n));else i.push(mm(u,n));return s&&(l?u.forEach(f=>{i.push(F5(f,!1,n))}):i.push(h)),this._d("path",i,n)}opsToPath(e,r){let n="";for(let i of e.ops){let a=typeof r=="number"&&r>=0?i.data.map(s=>+s.toFixed(r)):i.data;switch(i.op){case"move":n+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":n+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":n+=`L${a[0]} ${a[1]} `}}return n.trim()}toPaths(e){let r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(let a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:ao};break;case"fillPath":s={d:this.opsToPath(a),stroke:ao,strokeWidth:0,fill:n.fill||ao};break;case"fillSketch":s=this.fillSketch(a,n)}s&&i.push(s)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||ao,strokeWidth:n,fill:ao}}_mergedShape(e){return e.filter((r,n)=>n===0||r.op!=="move")}},H9=class{static{o(this,"st")}constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new gm(r)}draw(e){let r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,a=e.options.fixedDecimalPlaceDigits;for(let s of r)switch(s.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,s,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";let l=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,a,l),i.restore();break}case"fillSketch":this.fillSketch(i,s,n)}}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=i,this._drawToContext(e,r,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,n,i="nonzero"){e.beginPath();for(let a of r.ops){let s=typeof n=="number"&&n>=0?a.data.map(l=>+l.toFixed(n)):a.data;switch(a.op){case"move":e.moveTo(s[0],s[1]);break;case"bcurveTo":e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":e.lineTo(s[0],s[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,a){let s=this.gen.line(e,r,n,i,a);return this.draw(s),s}rectangle(e,r,n,i,a){let s=this.gen.rectangle(e,r,n,i,a);return this.draw(s),s}ellipse(e,r,n,i,a){let s=this.gen.ellipse(e,r,n,i,a);return this.draw(s),s}circle(e,r,n,i){let a=this.gen.circle(e,r,n,i);return this.draw(a),a}linearPath(e,r){let n=this.gen.linearPath(e,r);return this.draw(n),n}polygon(e,r){let n=this.gen.polygon(e,r);return this.draw(n),n}arc(e,r,n,i,a,s,l=!1,u){let h=this.gen.arc(e,r,n,i,a,s,l,u);return this.draw(h),h}curve(e,r){let n=this.gen.curve(e,r);return this.draw(n),n}path(e,r){let n=this.gen.path(e,r);return this.draw(n),n}},B5="http://www.w3.org/2000/svg",Y9=class{static{o(this,"ot")}constructor(e,r){this.svg=e,this.gen=new gm(r)}draw(e){let r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(B5,"g"),s=e.options.fixedDecimalPlaceDigits;for(let l of r){let u=null;switch(l.type){case"path":u=i.createElementNS(B5,"path"),u.setAttribute("d",this.opsToPath(l,s)),u.setAttribute("stroke",n.stroke),u.setAttribute("stroke-width",n.strokeWidth+""),u.setAttribute("fill","none"),n.strokeLineDash&&u.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&u.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":u=i.createElementNS(B5,"path"),u.setAttribute("d",this.opsToPath(l,s)),u.setAttribute("stroke","none"),u.setAttribute("stroke-width","0"),u.setAttribute("fill",n.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||u.setAttribute("fill-rule","evenodd");break;case"fillSketch":u=this.fillSketch(i,l,n)}u&&a.appendChild(u)}return a}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);let a=e.createElementNS(B5,"path");return a.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),a.setAttribute("stroke",n.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),n.fillLineDash&&a.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,a){let s=this.gen.line(e,r,n,i,a);return this.draw(s)}rectangle(e,r,n,i,a){let s=this.gen.rectangle(e,r,n,i,a);return this.draw(s)}ellipse(e,r,n,i,a){let s=this.gen.ellipse(e,r,n,i,a);return this.draw(s)}circle(e,r,n,i){let a=this.gen.circle(e,r,n,i);return this.draw(a)}linearPath(e,r){let n=this.gen.linearPath(e,r);return this.draw(n)}polygon(e,r){let n=this.gen.polygon(e,r);return this.draw(n)}arc(e,r,n,i,a,s,l=!1,u){let h=this.gen.arc(e,r,n,i,a,s,l,u);return this.draw(h)}curve(e,r){let n=this.gen.curve(e,r);return this.draw(n)}path(e,r){let n=this.gen.path(e,r);return this.draw(n)}},Jt={canvas:o((t,e)=>new H9(t,e),"canvas"),svg:o((t,e)=>new Y9(t,e),"svg"),generator:o(t=>new gm(t),"generator"),newSeed:o(()=>gm.newSeed(),"newSeed")}});var wSe,Dd,q9=R(()=>{"use strict";wSe=o((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,l=t.height/2,u,h;return Math.abs(a)*s>Math.abs(i)*l?(a<0&&(l=-l),u=a===0?0:l*i/a,h=l):(i<0&&(s=-s),u=s,h=i===0?0:s*a/i),{x:r+u,y:n+h}},"intersectRect"),Dd=wSe});function TSe(t,e){e&&t.attr("style",e)}async function kSe(t){let e=$e(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=e.append("xhtml:div"),n=t.label;t.label&&Ni(t.label)&&(n=await yh(t.label.replace(We.lineBreakRegex,` +`),de()));let i=t.isNode?"nodeLabel":"edgeLabel";return r.html('"+n+""),TSe(r,t.labelStyle),r.style("display","inline-block"),r.style("padding-right","1px"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}var ESe,gc,H5=R(()=>{"use strict";Zt();ut();_t();rr();xr();o(TSe,"applyStyle");o(kSe,"addHtmlLabel");ESe=o(async(t,e,r,n)=>{let i=t||"";if(typeof i=="object"&&(i=i[0]),yr(de().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"
    "),V.info("vertexText"+i);let a={isNode:n,label:to(i).replace(/fa[blrs]?:fa-[\w-]+/g,l=>``),labelStyle:e&&e.replace("fill:","color:")};return await kSe(a)}else{let a=document.createElementNS("http://www.w3.org/2000/svg","text");a.setAttribute("style",e.replace("color:","fill:"));let s=[];typeof i=="string"?s=i.split(/\\n|\n|/gi):Array.isArray(i)?s=i:s=[];for(let l of s){let u=document.createElementNS("http://www.w3.org/2000/svg","tspan");u.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),u.setAttribute("dy","1em"),u.setAttribute("x","0"),r?u.setAttribute("class","title-row"):u.setAttribute("class","row"),u.textContent=l.trim(),a.appendChild(u)}return a}},"createLabel"),gc=ESe});var _u,Sv=R(()=>{"use strict";_u=o((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD")});var Lu,Jj,CSe,Br,Fr,ki=R(()=>{"use strict";_t();Lu=o(t=>{let{handDrawnSeed:e}=de();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),Jj=o(t=>{let e=CSe([...t.cssCompiledStyles||[],...t.cssStyles||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),CSe=o(t=>{let e=new Map;return t.forEach(r=>{let[n,i]=r.split(":");e.set(n.trim(),i?.trim())}),e},"styles2Map"),Br=o(t=>{let{stylesArray:e}=Jj(t),r=[],n=[],i=[],a=[];return e.forEach(s=>{let l=s[0];l==="color"||l==="font-size"||l==="font-family"||l==="font-weight"||l==="font-style"||l==="text-decoration"||l==="text-align"||l==="text-transform"||l==="line-height"||l==="letter-spacing"||l==="word-spacing"||l==="text-shadow"||l==="text-overflow"||l==="white-space"||l==="word-wrap"||l==="word-break"||l==="overflow-wrap"||l==="hyphens"?r.push(s.join(":")+" !important"):(n.push(s.join(":")+" !important"),l.includes("stroke")&&i.push(s.join(":")+" !important"),l==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}},"styles2String"),Fr=o((t,e)=>{let{themeVariables:r,handDrawnSeed:n}=de(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=Jj(t);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,stroke:s.get("stroke")||i,seed:n,strokeWidth:1.3},e)},"userNodeOverrides")});var eK,SSe,ASe,_Se,LSe,DSe,tK,Y5,rK,X9=R(()=>{"use strict";_t();rr();ut();_d();Zt();ti();Al();q9();H5();Sv();ki();eK=o(async(t,e)=>{V.info("Creating subgraph rect for ",e.id,e);let r=de(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:f}=Br(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),p=yr(r.flowchart.htmlLabels),m=d.insert("g").attr("class","cluster-label "),g=await ta(m,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0}),y=g.getBBox();if(yr(r.flowchart.htmlLabels)){let _=g.children[0],A=$e(g);y=_.getBoundingClientRect(),A.attr("width",y.width),A.attr("height",y.height)}let v=e.width<=y.width+e.padding?y.width+e.padding:e.width;e.width<=y.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;let x=e.height,b=e.x-v/2,w=e.y-x/2;V.trace("Data ",e,JSON.stringify(e));let S;if(e.look==="handDrawn"){let _=Jt.svg(d),A=Fr(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),L=_.path(_u(b,w,v,x,0),A);S=d.insert(()=>(V.debug("Rough node insert CXC",L),L),":first-child"),S.select("path:nth-child(2)").attr("style",h.join(";")),S.select("path").attr("style",f.join(";").replace("fill","stroke"))}else S=d.insert("rect",":first-child"),S.attr("style",u).attr("rx",e.rx).attr("ry",e.ry).attr("x",b).attr("y",w).attr("width",v).attr("height",x);let{subGraphTitleTopMargin:T}=io(r);if(m.attr("transform",`translate(${e.x-y.width/2}, ${e.y-e.height/2+T})`),l){let _=m.select("span");_&&_.attr("style",l)}let E=S.node().getBBox();return e.offsetX=0,e.width=E.width,e.height=E.height,e.offsetY=y.height-e.padding/2,e.intersect=function(_){return Dd(e,_)},{cluster:d,labelBBox:y}},"rect"),SSe=o((t,e)=>{let r=t.insert("g").attr("class","note-cluster").attr("id",e.id),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");let s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(l){return Dd(e,l)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),ASe=o(async(t,e)=>{let r=de(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:l,nodeBorder:u}=n,h=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-id",e.id).attr("data-look",e.look),f=h.insert("g",":first-child"),d=h.insert("g").attr("class","cluster-label"),p=h.append("rect"),m=d.node().appendChild(await gc(e.label,e.labelStyle,void 0,!0)),g=m.getBBox();if(yr(r.flowchart.htmlLabels)){let L=m.children[0],M=$e(m);g=L.getBoundingClientRect(),M.attr("width",g.width),M.attr("height",g.height)}let y=0*e.padding,v=y/2,x=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+y;e.width<=g.width+e.padding?e.diff=(x-e.width)/2-e.padding:e.diff=-e.padding;let b=e.height+y,w=e.height+y-g.height-6,S=e.x-x/2,T=e.y-b/2;e.width=x;let E=e.y-e.height/2-v+g.height+2,_;if(e.look==="handDrawn"){let L=e.cssClasses.includes("statediagram-cluster-alt"),M=Jt.svg(h),N=e.rx||e.ry?M.path(_u(S,T,x,b,10),{roughness:.7,fill:l,fillStyle:"solid",stroke:u,seed:i}):M.rectangle(S,T,x,b,{seed:i});_=h.insert(()=>N,":first-child");let k=M.rectangle(S,E,x,w,{fill:L?a:s,fillStyle:L?"hachure":"solid",stroke:u,seed:i});_=h.insert(()=>N,":first-child"),p=h.insert(()=>k)}else _=f.insert("rect",":first-child"),_.attr("class","outer").attr("x",S).attr("y",T).attr("width",x).attr("height",b).attr("data-look",e.look),p.attr("class","inner").attr("x",S).attr("y",E).attr("width",x).attr("height",w);d.attr("transform",`translate(${e.x-g.width/2}, ${T+1-(yr(r.flowchart.htmlLabels)?0:3)})`);let A=_.node().getBBox();return e.height=A.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(L){return Dd(e,L)},{cluster:h,labelBBox:g}},"roundedWithTitle"),_Se=o((t,e)=>{let r=de(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-look",e.look),l=s.insert("g",":first-child"),u=0*e.padding,h=e.width+u;e.diff=-e.padding;let f=e.height+u,d=e.x-h/2,p=e.y-f/2;e.width=h;let m;if(e.look==="handDrawn"){let v=Jt.svg(s).rectangle(d,p,h,f,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});m=s.insert(()=>v,":first-child")}else m=l.insert("rect",":first-child"),m.attr("class","divider").attr("x",d).attr("y",p).attr("width",h).attr("height",f).attr("data-look",e.look);let g=m.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(y){return Dd(e,y)},{cluster:s,labelBBox:{}}},"divider"),LSe=eK,DSe={rect:eK,squareRect:LSe,roundedWithTitle:ASe,noteGroup:SSe,divider:_Se},tK=new Map,Y5=o(async(t,e)=>{let r=e.shape||"rect",n=await DSe[r](t,e);return tK.set(e.id,n),n},"insertCluster"),rK=o(()=>{tK=new Map},"clear")});function W5(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=q5(t),e=q5(e);let[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-r,l=a-n;return{angle:Math.atan(l/s),deltaX:s,deltaY:l}}var Uh,q5,X5,j9=R(()=>{"use strict";Uh={aggregation:18,extension:18,composition:18,dependency:6,lollipop:13.5,arrow_point:4};o(W5,"calculateDeltaAndAngle");q5=o(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),X5=o(t=>({x:o(function(e,r,n){let i=0;if(r===0&&Object.hasOwn(Uh,t.arrowTypeStart)){let{angle:a,deltaX:s}=W5(n[0],n[1]);i=Uh[t.arrowTypeStart]*Math.cos(a)*(s>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Uh,t.arrowTypeEnd)){let{angle:a,deltaX:s}=W5(n[n.length-1],n[n.length-2]);i=Uh[t.arrowTypeEnd]*Math.cos(a)*(s>=0?1:-1)}return q5(e).x+i},"x"),y:o(function(e,r,n){let i=0;if(r===0&&Object.hasOwn(Uh,t.arrowTypeStart)){let{angle:a,deltaY:s}=W5(n[0],n[1]);i=Uh[t.arrowTypeStart]*Math.abs(Math.sin(a))*(s>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Uh,t.arrowTypeEnd)){let{angle:a,deltaY:s}=W5(n[n.length-1],n[n.length-2]);i=Uh[t.arrowTypeEnd]*Math.abs(Math.sin(a))*(s>=0?1:-1)}return q5(e).y+i},"y")}),"getLineFunctionsWithOffset")});var iK,RSe,nK,aK=R(()=>{"use strict";ut();iK=o((t,e,r,n,i)=>{e.arrowTypeStart&&nK(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&nK(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),RSe={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},nK=o((t,e,r,n,i,a)=>{let s=RSe[r];if(!s){V.warn(`Unknown arrow type: ${r}`);return}let l=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${l})`)},"addEdgeMarker")});function j5(t,e){de().flowchart.htmlLabels&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}function ISe(t){let e=[],r=[];for(let n=1;n5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}var K5,da,lK,Av,Q5,Z5,NSe,MSe,sK,oK,OSe,J5,K9=R(()=>{"use strict";_t();rr();ut();Al();xr();j9();_d();Zt();ti();H5();aK();K5=new Map,da=new Map,lK=o(()=>{K5.clear(),da.clear()},"clear"),Av=o(t=>t?t.reduce((r,n)=>r+";"+n,""):"","getLabelStyles"),Q5=o(async(t,e)=>{let r=yr(de().flowchart.htmlLabels),n=await ta(t,e.label,{style:Av(e.labelStyle),useHtmlLabels:r,addSvgBackground:!0,isNode:!1});V.info("abc82",e,e.labelType);let i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label");a.node().appendChild(n);let s=n.getBBox();if(r){let u=n.children[0],h=$e(n);s=u.getBoundingClientRect(),h.attr("width",s.width),h.attr("height",s.height)}a.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),K5.set(e.id,i),e.width=s.width,e.height=s.height;let l;if(e.startLabelLeft){let u=await gc(e.startLabelLeft,Av(e.labelStyle)),h=t.insert("g").attr("class","edgeTerminals"),f=h.insert("g").attr("class","inner");l=f.node().appendChild(u);let d=u.getBBox();f.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),da.get(e.id)||da.set(e.id,{}),da.get(e.id).startLeft=h,j5(l,e.startLabelLeft)}if(e.startLabelRight){let u=await gc(e.startLabelRight,Av(e.labelStyle)),h=t.insert("g").attr("class","edgeTerminals"),f=h.insert("g").attr("class","inner");l=h.node().appendChild(u),f.node().appendChild(u);let d=u.getBBox();f.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),da.get(e.id)||da.set(e.id,{}),da.get(e.id).startRight=h,j5(l,e.startLabelRight)}if(e.endLabelLeft){let u=await gc(e.endLabelLeft,Av(e.labelStyle)),h=t.insert("g").attr("class","edgeTerminals"),f=h.insert("g").attr("class","inner");l=f.node().appendChild(u);let d=u.getBBox();f.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),h.node().appendChild(u),da.get(e.id)||da.set(e.id,{}),da.get(e.id).endLeft=h,j5(l,e.endLabelLeft)}if(e.endLabelRight){let u=await gc(e.endLabelRight,Av(e.labelStyle)),h=t.insert("g").attr("class","edgeTerminals"),f=h.insert("g").attr("class","inner");l=f.node().appendChild(u);let d=u.getBBox();f.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),h.node().appendChild(u),da.get(e.id)||da.set(e.id,{}),da.get(e.id).endRight=h,j5(l,e.endLabelRight)}return n},"insertEdgeLabel");o(j5,"setTerminalWidth");Z5=o((t,e)=>{V.debug("Moving label abc88 ",t.id,t.label,K5.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath,n=de(),{subGraphTitleTotalMargin:i}=io(n);if(t.label){let a=K5.get(t.id),s=t.x,l=t.y;if(r){let u=Lt.calcLabelPosition(r);V.debug("Moving label "+t.label+" from (",s,",",l,") to (",u.x,",",u.y,") abc88"),e.updatedPath&&(s=u.x,l=u.y)}a.attr("transform",`translate(${s}, ${l+i/2})`)}if(t.startLabelLeft){let a=da.get(t.id).startLeft,s=t.x,l=t.y;if(r){let u=Lt.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}if(t.startLabelRight){let a=da.get(t.id).startRight,s=t.x,l=t.y;if(r){let u=Lt.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}if(t.endLabelLeft){let a=da.get(t.id).endLeft,s=t.x,l=t.y;if(r){let u=Lt.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}if(t.endLabelRight){let a=da.get(t.id).endRight,s=t.x,l=t.y;if(r){let u=Lt.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}},"positionEdgeLabel"),NSe=o((t,e)=>{let r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,l=t.height/2;return i>=s||a>=l},"outsideNode"),MSe=o((t,e,r)=>{V.debug(`intersection calc abc89: + outsidePoint: ${JSON.stringify(e)} + insidePoint : ${JSON.stringify(r)} + node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);let n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2,l=r.xMath.abs(n-e.x)*u){let d=r.y{V.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(V.info("abc88 checking point",a,e),!NSe(e,a)&&!i){let s=MSe(e,n,a);V.debug("abc88 inside",a,n,s),V.debug("abc88 intersection",s,e);let l=!1;r.forEach(u=>{l=l||u.x===s.x&&u.y===s.y}),r.some(u=>u.x===s.x&&u.y===s.y)?V.warn("abc88 no intersect",s,r):r.push(s),i=!0}else V.warn("abc88 outside",a,n),n=a,i||r.push(a)}),V.debug("returning points",r),r},"cutPathAtIntersect");o(ISe,"extractCornerPoints");oK=o(function(t,e,r){let n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),s=r/a;return{x:e.x-s*n,y:e.y-s*i}},"findAdjacentPoint"),OSe=o(function(t){let{cornerPointPositions:e}=ISe(t),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){V.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));let m=5;s.x===l.x?p={x:h<0?l.x-m+d:l.x+m-d,y:f<0?l.y-d:l.y+d}:p={x:h<0?l.x-d:l.x+d,y:f<0?l.y-m+d:l.y+m-d}}else V.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(p,u)}else r.push(t[n]);return r},"fixCorners"),J5=o(function(t,e,r,n,i,a,s){let{handDrawnSeed:l}=de(),u=e.points,h=!1,f=i;var d=a;d.intersect&&f.intersect&&(u=u.slice(1,e.points.length-1),u.unshift(f.intersect(u[0])),V.debug("Last point APA12",e.start,"-->",e.end,u[u.length-1],d,d.intersect(u[u.length-1])),u.push(d.intersect(u[u.length-1]))),e.toCluster&&(V.info("to cluster abc88",r.get(e.toCluster)),u=sK(e.points,r.get(e.toCluster).node),h=!0),e.fromCluster&&(V.debug("from cluster abc88",r.get(e.fromCluster),JSON.stringify(u,null,2)),u=sK(u.reverse(),r.get(e.fromCluster).node).reverse(),h=!0);let p=u.filter(A=>!Number.isNaN(A.y));p=OSe(p);let m=p[p.length-1];if(p.length>1){m=p[p.length-1];let A=p[p.length-2],L=(m.x-A.x)/2,M=(m.y-A.y)/2,N={x:A.x+L,y:A.y+M};p.splice(-1,0,N)}let g=vs;e.curve&&(g=e.curve);let{x:y,y:v}=X5(e),x=ha().x(y).y(v).curve(g),b;switch(e.thickness){case"normal":b="edge-thickness-normal";break;case"thick":b="edge-thickness-thick";break;case"invisible":b="edge-thickness-invisible";break;default:b="edge-thickness-normal"}switch(e.pattern){case"solid":b+=" edge-pattern-solid";break;case"dotted":b+=" edge-pattern-dotted";break;case"dashed":b+=" edge-pattern-dashed";break;default:b+=" edge-pattern-solid"}let w,S=x(p),T=Array.isArray(e.style)?e.style:[e.style];if(e.look==="handDrawn"){let A=Jt.svg(t);Object.assign([],p);let L=A.path(S,{roughness:.3,seed:l});b+=" transition",w=$e(L).select("path").attr("id",e.id).attr("class"," "+b+(e.classes?" "+e.classes:"")).attr("style",T?T.reduce((N,k)=>N+";"+k,""):"");let M=w.attr("d");w.attr("d",M),t.node().appendChild(w.node())}else w=t.append("path").attr("d",S).attr("id",e.id).attr("class"," "+b+(e.classes?" "+e.classes:"")).attr("style",T?T.reduce((A,L)=>A+";"+L,""):"");let E="";(de().flowchart.arrowMarkerAbsolute||de().state.arrowMarkerAbsolute)&&(E=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,E=E.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),V.info("arrowTypeStart",e.arrowTypeStart),V.info("arrowTypeEnd",e.arrowTypeEnd),iK(w,e,E,s,n);let _={};return h&&(_.updatedPath=u),_.originalPath=e.points,_},"insertEdge")});var PSe,BSe,FSe,zSe,GSe,$Se,VSe,USe,HSe,YSe,WSe,ew,Q9=R(()=>{"use strict";ut();PSe=o((t,e,r,n)=>{e.forEach(i=>{WSe[i](t,r,n)})},"insertMarkers"),BSe=o((t,e,r)=>{V.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).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"),FSe=o((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).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"),zSe=o((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).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"),GSe=o((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).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"),$Se=o((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).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),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).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"),VSe=o((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).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"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).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"),USe=o((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).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"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).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"),HSe=o((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).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"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).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"),YSe=o((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-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"),WSe={extension:BSe,composition:FSe,aggregation:zSe,dependency:GSe,lollipop:$Se,point:VSe,circle:USe,cross:HSe,barb:YSe},ew=PSe});var zr,ar,En,ri=R(()=>{"use strict";Al();_t();Zt();rr();xr();zr=o(async(t,e,r)=>{let n,i=e.useHtmlLabels||yr(de().flowchart.htmlLabels);r?n=r:n="node default";let a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",e.labelStyle),l;e.label===void 0?l="":l=typeof e.label=="string"?e.label:e.label[0];let u;u=await ta(s,qr(to(l),de()),{useHtmlLabels:i,width:e.width||de().flowchart.wrappingWidth,cssClasses:"markdown-node-label",style:e.labelStyle});let h=u.getBBox(),f=e.padding/2;if(yr(de().flowchart.htmlLabels)){let d=u.children[0],p=$e(u),m=d.getElementsByTagName("img");if(m){let g=l.replace(/]*>/g,"").trim()==="";await Promise.all([...m].map(y=>new Promise(v=>{function x(){if(y.style.display="flex",y.style.flexDirection="column",g){let b=de().fontSize?de().fontSize:window.getComputedStyle(document.body).fontSize,S=parseInt(b,10)*5+"px";y.style.minWidth=S,y.style.maxWidth=S}else y.style.width="100%";v(y)}o(x,"setupImage"),setTimeout(()=>{y.complete&&x()}),y.addEventListener("error",x),y.addEventListener("load",x)})))}h=d.getBoundingClientRect(),p.attr("width",h.width),p.attr("height",h.height)}return i?s.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"):s.attr("transform","translate(0, "+-h.height/2+")"),e.centerLabel&&s.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:h,halfPadding:f,label:s}},"labelHelper"),ar=o((t,e)=>{let r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),En=o((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses")});function qSe(t,e){return t.intersect(e)}var cK,uK=R(()=>{"use strict";o(qSe,"intersectNode");cK=qSe});function XSe(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,l=a-n.y,u=Math.sqrt(e*e*l*l+r*r*s*s),h=Math.abs(e*r*s/u);n.x{"use strict";o(XSe,"intersectEllipse");tw=XSe});function jSe(t,e,r){return tw(t,e,e,r)}var hK,fK=R(()=>{"use strict";Z9();o(jSe,"intersectCircle");hK=jSe});function KSe(t,e,r,n){var i,a,s,l,u,h,f,d,p,m,g,y,v,x,b;if(i=e.y-t.y,s=t.x-e.x,u=e.x*t.y-t.x*e.y,p=i*r.x+s*r.y+u,m=i*n.x+s*n.y+u,!(p!==0&&m!==0&&dK(p,m))&&(a=n.y-r.y,l=r.x-n.x,h=n.x*r.y-r.x*n.y,f=a*t.x+l*t.y+h,d=a*e.x+l*e.y+h,!(f!==0&&d!==0&&dK(f,d))&&(g=i*l-a*s,g!==0)))return y=Math.abs(g/2),v=s*h-l*u,x=v<0?(v-y)/g:(v+y)/g,v=a*u-i*h,b=v<0?(v-y)/g:(v+y)/g,{x,y:b}}function dK(t,e){return t*e>0}var pK,mK=R(()=>{"use strict";o(KSe,"intersectLine");o(dK,"sameSign");pK=KSe});function QSe(t,e,r){let n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(f){s=Math.min(s,f.x),l=Math.min(l,f.y)}):(s=Math.min(s,e.x),l=Math.min(l,e.y));let u=n-t.width/2-s,h=i-t.height/2-l;for(let f=0;f1&&a.sort(function(f,d){let p=f.x-r.x,m=f.y-r.y,g=Math.sqrt(p*p+m*m),y=d.x-r.x,v=d.y-r.y,x=Math.sqrt(y*y+v*v);return g{"use strict";mK();o(QSe,"intersectPolygon");gK=QSe});var sr,hi=R(()=>{"use strict";uK();fK();Z9();yK();q9();sr={node:cK,circle:hK,ellipse:tw,polygon:gK,rect:Dd}});var Rd,_v=R(()=>{"use strict";ri();hi();Sv();ki();ti();Rd=o(async(t,e,r)=>{let{labelStyles:n,nodeStyles:i}=Br(e);e.labelStyle=n;let{shapeSvg:a,bbox:s}=await zr(t,e,En(e)),l=Math.max(s.width+r.labelPaddingX*2,e?.width||0),u=Math.max(s.height+r.labelPaddingY*2,e?.height||0),h=-l/2,f=-u/2,d,{rx:p,ry:m}=e,{cssStyles:g}=e;if(r?.rx&&r.ry&&(p=r.rx,m=r.ry),e.look==="handDrawn"){let y=Jt.svg(a),v=Fr(e,{}),x=p||m?y.path(_u(h,f,l,u,p||0),v):y.rectangle(h,f,l,u,v);d=a.insert(()=>x,":first-child"),d.attr("class","basic label-container").attr("style",g)}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",p).attr("data-id","abc").attr("data-et","node").attr("ry",m).attr("x",h).attr("y",f).attr("width",l).attr("height",u);return ar(e,d),e.intersect=function(y){return sr.rect(e,y)},a},"drawRect")});var vK,xK=R(()=>{"use strict";_v();vK=o(async(t,e)=>Rd(t,e,{rx:5,ry:5,classes:"flowchart-node"}),"state")});var bK,wK=R(()=>{"use strict";_v();bK=o(async(t,e)=>{let r={rx:5,ry:5,classes:"",labelPaddingX:(e?.padding||0)*1,labelPaddingY:(e?.padding||0)*1};return Rd(t,e,r)},"roundedRect")});var TK,kK=R(()=>{"use strict";_v();TK=o(async(t,e)=>{let r={rx:0,ry:0,classes:"",labelPaddingX:(e?.padding||0)*2,labelPaddingY:(e?.padding||0)*1};return Rd(t,e,r)},"squareRect")});var EK,CK=R(()=>{"use strict";ri();hi();ti();ki();_t();EK=o((t,e)=>{let{themeVariables:r}=de(),{lineColor:n}=r,i=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a;if(e.look==="handDrawn"){let l=Jt.svg(i).circle(0,0,14,Lu(n));a=i.insert(()=>l)}else a=i.insert("circle",":first-child");return a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),ar(e,a),e.intersect=function(s){return sr.circle(e,7,s)},i},"stateStart")});var SK,AK=R(()=>{"use strict";ri();hi();ti();ki();_t();SK=o((t,e)=>{let{themeVariables:r}=de(),{lineColor:n}=r,i=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a,s;if(e.look==="handDrawn"){let l=Jt.svg(i),u=l.circle(0,0,14,{...Lu(n),roughness:.5}),h=l.circle(0,0,5,{...Lu(n),fillStyle:"solid"});a=i.insert(()=>u),s=i.insert(()=>h)}else s=i.insert("circle",":first-child"),a=i.insert("circle",":first-child"),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),s.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10);return ar(e,a),e.intersect=function(l){return sr.circle(e,7,l)},i},"stateEnd")});var J9,_K=R(()=>{"use strict";ri();hi();ti();ki();_t();J9=o((t,e,r)=>{let{themeVariables:n}=de(),{lineColor:i}=n,a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),s=70,l=10;r==="LR"&&(s=10,l=70);let u=-1*s/2,h=-1*l/2,f;if(e.look==="handDrawn"){let y=Jt.svg(a).rectangle(u,h,s,l,Lu(i));f=a.insert(()=>y)}else f=a.append("rect").attr("x",u).attr("y",h).attr("width",s).attr("height",l).attr("class","fork-join");ar(e,f);let d=0,p=0,m=10;return e.height&&(d=e.height),e.width&&(p=e.width),e.padding&&(m=e.padding),e.height=d+m/2,e.width=p+m/2,e.intersect=function(g){return sr.rect(e,g)},a},"forkJoin")});var LK,DK=R(()=>{"use strict";hi();ti();ki();_t();LK=o((t,e)=>{let{labelStyles:r,nodeStyles:n}=Br(e);e.labelStyle=r;let{themeVariables:i}=de(),{lineColor:a}=i,s=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),l=28,u=[{x:0,y:l/2},{x:l/2,y:0},{x:0,y:-l/2},{x:-l/2,y:0}],h;if(e.look==="handDrawn"){let f=Jt.svg(s),d=u.map(function(m){return[m.x,m.y]}),p=f.polygon(d,Lu(a));h=s.insert(()=>p)}else h=s.insert("polygon",":first-child").attr("points",u.map(function(f){return f.x+","+f.y}).join(" "));return h.attr("class","state-start").attr("r",7).attr("width",28).attr("height",28).attr("style",n),e.width=28,e.height=28,e.intersect=function(f){return sr.circle(e,14,f)},s},"choice")});var RK,NK=R(()=>{"use strict";ut();ri();hi();_t();ti();RK=o(async(t,e)=>{let{themeVariables:r,handDrawnSeed:n}=de(),{noteBorderColor:i,noteBkgColor:a}=r;e.useHtmlLabels||(e.centerLabel=!0);let{shapeSvg:l,bbox:u}=await zr(t,e,"node "+e.cssClasses);V.info("Classes = ",e.cssClasses);let{cssStyles:h}=e,f,d=u.width+e.padding,p=u.height+e.padding,m=-d/2,g=-p/2;if(e.look==="handDrawn"){let v=Jt.svg(l).rectangle(m,g,d,p,{roughness:.7,fill:a,fillWeight:3,seed:n,stroke:i});f=l.insert(()=>v,":first-child"),f.attr("class","basic label-container").attr("style",h)}else f=l.insert("rect",":first-child"),f.attr("rx",e.rx).attr("ry",e.ry).attr("x",m).attr("y",g).attr("width",d).attr("height",p);return ar(e,f),e.intersect=function(y){return sr.rect(e,y)},l},"note")});var MK,IK=R(()=>{"use strict";ri();hi();ki();ti();Sv();MK=o(async(t,e)=>{let{labelStyles:r,nodeStyles:n}=Br(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await zr(t,e,En(e)),s=a.height+e.padding,l=a.width+s/4+e.padding,u,{cssStyles:h}=e;if(e.look==="handDrawn"){let f=Jt.svg(i),d=Fr(e,{}),p=_u(-l/2,-s/2,l,s,s/2),m=f.path(p,d);u=i.insert(()=>m,":first-child"),u.attr("class","basic label-container").attr("style",h)}else u=i.insert("rect",":first-child"),u.attr("class","basic label-container").attr("style",n).attr("rx",s/2).attr("ry",s/2).attr("x",-l/2).attr("y",-s/2).attr("width",l).attr("height",s);return ar(e,u),e.intersect=function(f){return sr.rect(e,f)},i},"stadium")});var OK,PK=R(()=>{"use strict";Zt();rr();ri();H5();hi();ki();ti();_t();Sv();ut();OK=o(async(t,e)=>{let{labelStyles:r,nodeStyles:n}=Br(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";let a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=a.insert("g"),l=a.insert("g").attr("class","label").attr("style",n),u=e.description,h=e.label,f=l.node().appendChild(await gc(h,e.labelStyle,!0,!0)),d={width:0,height:0};if(yr(de()?.flowchart?.htmlLabels)){let A=f.children[0],L=$e(f);d=A.getBoundingClientRect(),L.attr("width",d.width),L.attr("height",d.height)}V.info("Text 2",u);let p=u||[],m=f.getBBox(),g=l.node().appendChild(await gc(p.join?p.join("
    "):p,e.labelStyle,!0,!0)),y=g.children[0],v=$e(g);d=y.getBoundingClientRect(),v.attr("width",d.width),v.attr("height",d.height);let x=(e.padding||0)/2;$e(g).attr("transform","translate( "+(d.width>m.width?0:(m.width-d.width)/2)+", "+(m.height+x+5)+")"),$e(f).attr("transform","translate( "+(d.width(V.debug("Rough node insert CXC",M),N),":first-child"),E=a.insert(()=>(V.debug("Rough node insert CXC",M),M),":first-child")}else E=s.insert("rect",":first-child"),_=s.insert("line"),E.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-x).attr("y",-d.height/2-x).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),_.attr("class","divider").attr("x1",-d.width/2-x).attr("x2",d.width/2+x).attr("y1",-d.height/2-x+m.height+x).attr("y2",-d.height/2-x+m.height+x);return ar(e,E),e.intersect=function(A){return sr.rect(e,A)},a},"rectWithTitle")});function Ma(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}var Du=R(()=>{"use strict";o(Ma,"insertPolygonShape")});var BK,FK=R(()=>{"use strict";ri();hi();ki();ti();Du();BK=o(async(t,e)=>{let{labelStyles:r,nodeStyles:n}=Br(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await zr(t,e,En(e)),s=(e?.padding||0)/2,l=a.width+e.padding,u=a.height+e.padding,h=-a.width/2-s,f=-a.height/2-s,d=[{x:0,y:0},{x:l,y:0},{x:l,y:-u},{x:0,y:-u},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-u},{x:-8,y:-u},{x:-8,y:0}];if(e.look==="handDrawn"){let p=Jt.svg(i),m=Fr(e,{}),g=p.rectangle(h-8,f,l+16,u,m),y=p.line(h,f,h,f+u,m),v=p.line(h+l,f,h+l,f+u,m);i.insert(()=>y,":first-child"),i.insert(()=>v,":first-child");let x=i.insert(()=>g,":first-child"),{cssStyles:b}=e;x.attr("class","basic label-container").attr("style",b),ar(e,x)}else{let p=Ma(i,l,u,d);n&&p.attr("style",n),ar(e,p)}return e.intersect=function(p){return sr.polygon(e,d,p)},i},"subroutine")});var ZSe,JSe,eAe,zK,GK=R(()=>{"use strict";ri();hi();ki();ti();ZSe=o((t,e,r,n,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),JSe=o((t,e,r,n,i,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),eAe=o((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),zK=o(async(t,e)=>{let{labelStyles:r,nodeStyles:n}=Br(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await zr(t,e,En(e)),s=a.width+e.padding,l=s/2,u=l/(2.5+s/50),h=a.height+u+e.padding,f,{cssStyles:d}=e;if(e.look==="handDrawn"){let p=Jt.svg(i),m=JSe(0,0,s,h,l,u),g=eAe(0,u,s,h,l,u),y=p.path(m,Fr(e,{})),v=p.path(g,Fr(e,{fill:"none"}));f=i.insert(()=>v,":first-child"),f=i.insert(()=>y,":first-child"),f.attr("class","basic label-container"),d&&f.attr("style",d)}else{let p=ZSe(0,0,s,h,l,u);f=i.insert("path",":first-child").attr("d",p).attr("class","basic label-container").attr("style",d).attr("style",n)}return f.attr("label-offset-y",u),f.attr("transform",`translate(${-s/2}, ${-(h/2+u)})`),ar(e,f),e.intersect=function(p){let m=sr.rect(e,p),g=m.x-(e.x??0);if(l!=0&&(Math.abs(g)<(e.width??0)/2||Math.abs(g)==(e.width??0)/2&&Math.abs(m.y-(e.y??0))>(e.height??0)/2-u)){let y=u*u*(1-g*g/(l*l));y>0&&(y=Math.sqrt(y)),y=u-y,p.y-(e.y??0)>0&&(y=-y),m.y+=y}return m},i},"cylinder")});var $K,VK=R(()=>{"use strict";ut();ri();hi();ki();ti();$K=o(async(t,e)=>{let{labelStyles:r,nodeStyles:n}=Br(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,halfPadding:s}=await zr(t,e,En(e)),l=a.width/2+s,u,{cssStyles:h}=e;if(e.look==="handDrawn"){let f=Jt.svg(i),d=Fr(e,{}),p=f.circle(0,0,l*2,d);u=i.insert(()=>p,":first-child"),u.attr("class","basic label-container").attr("style",h)}else u=i.insert("circle",":first-child").attr("class","basic label-container").attr("style",n).attr("r",l).attr("cx",0).attr("cy",0);return ar(e,u),e.intersect=function(f){return V.info("Circle intersect",e,l,f),sr.circle(e,l,f)},i},"circle")});var UK,HK=R(()=>{"use strict";ut();ri();hi();ki();ti();UK=o(async(t,e)=>{let{labelStyles:r,nodeStyles:n}=Br(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,halfPadding:s}=await zr(t,e,En(e)),u=a.width/2+s+5,h=a.width/2+s,f,{cssStyles:d}=e;if(e.look==="handDrawn"){let p=Jt.svg(i),m=Fr(e,{roughness:.2,strokeWidth:2.5}),g=Fr(e,{roughness:.2,strokeWidth:1.5}),y=p.circle(0,0,u*2,m),v=p.circle(0,0,h*2,g);f=i.insert("g",":first-child"),f.attr("class",e.cssClasses).attr("style",d),f.node()?.appendChild(y),f.node()?.appendChild(v)}else{f=i.insert("g",":first-child");let p=f.insert("circle",":first-child"),m=f.insert("circle");f.attr("class","basic label-container").attr("style",n),p.attr("class","outer-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0),m.attr("class","inner-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0)}return ar(e,f),e.intersect=function(p){return V.info("DoubleCircle intersect",e,u,p),sr.circle(e,u,p)},i},"doublecircle")});var tAe,YK,WK=R(()=>{"use strict";ri();hi();ki();ti();Du();tAe=o((t,e,r,n)=>[`M${t-n/2},${e}`,`L${t+r},${e}`,`L${t+r},${e-n}`,`L${t-n/2},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" "),"createPolygonPathD"),YK=o(async(t,e)=>{let{labelStyles:r,nodeStyles:n}=Br(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await zr(t,e,En(e)),s=a.width+e.padding,l=a.height+e.padding,u=[{x:-l/2,y:0},{x:s,y:0},{x:s,y:-l},{x:-l/2,y:-l},{x:0,y:-l/2}],h,{cssStyles:f}=e;if(e.look==="handDrawn"){let d=Jt.svg(i),p=Fr(e,{}),m=tAe(0,0,s,l),g=d.path(m,p);h=i.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${l/2})`),f&&h.attr("style",f)}else h=Ma(i,s,l,u);return n&&h.attr("style",n),e.width=s+l,e.height=l,ar(e,h),e.intersect=function(d){return sr.polygon(e,u,d)},i},"rect_left_inv_arrow")});var rAe,qK,XK=R(()=>{"use strict";ut();ri();hi();ki();ti();Du();rAe=o((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD"),qK=o(async(t,e)=>{let{labelStyles:r,nodeStyles:n}=Br(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await zr(t,e,En(e)),s=a.width+e.padding,l=a.height+e.padding,u=s+l,h=[{x:u/2,y:0},{x:u,y:-u/2},{x:u/2,y:-u},{x:0,y:-u/2}],f,{cssStyles:d}=e;if(e.look==="handDrawn"){let p=Jt.svg(i),m=Fr(e,{}),g=rAe(0,0,u),y=p.path(g,m);f=i.insert(()=>y,":first-child").attr("transform",`translate(${-u/2}, ${u/2})`),d&&f.attr("style",d)}else f=Ma(i,u,u,h);return n&&f.attr("style",n),ar(e,f),e.intersect=function(p){return V.debug(`APA12 Intersect called SPLIT +point:`,p,` +node: +`,e,` +res:`,sr.polygon(e,h,p)),sr.polygon(e,h,p)},i},"question")});var nAe,jK,KK=R(()=>{"use strict";ri();hi();ki();ti();Du();nAe=o((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" "),"createHexagonPathD"),jK=o(async(t,e)=>{let{labelStyles:r,nodeStyles:n}=Br(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await zr(t,e,En(e)),s=4,l=a.height+e.padding,u=l/s,h=a.width+2*u+e.padding,f=[{x:u,y:0},{x:h-u,y:0},{x:h,y:-l/2},{x:h-u,y:-l},{x:u,y:-l},{x:0,y:-l/2}],d,{cssStyles:p}=e;if(e.look==="handDrawn"){let m=Jt.svg(i),g=Fr(e,{}),y=nAe(0,0,h,l,u),v=m.path(y,g);d=i.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${l/2})`),p&&d.attr("style",p)}else d=Ma(i,h,l,f);return n&&d.attr("style",n),e.width=h,e.height=l,ar(e,d),e.intersect=function(m){return sr.polygon(e,f,m)},i},"hexagon")});var iAe,QK,ZK=R(()=>{"use strict";ri();hi();ki();ti();Du();iAe=o((t,e,r,n)=>[`M${t-2*n/6},${e}`,`L${t+r-n/6},${e}`,`L${t+r+2*n/6},${e-n}`,`L${t+n/6},${e-n}`,"Z"].join(" "),"createLeanRightPathD"),QK=o(async(t,e)=>{let{labelStyles:r,nodeStyles:n}=Br(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await zr(t,e,En(e)),s=a.width+e.padding,l=a.height+e.padding,u=[{x:-2*l/6,y:0},{x:s-l/6,y:0},{x:s+2*l/6,y:-l},{x:l/6,y:-l}],h,{cssStyles:f}=e;if(e.look==="handDrawn"){let d=Jt.svg(i),p=Fr(e,{}),m=iAe(0,0,s,l),g=d.path(m,p);h=i.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${l/2})`),f&&h.attr("style",f)}else h=Ma(i,s,l,u);return n&&h.attr("style",n),e.width=s,e.height=l,ar(e,h),e.intersect=function(d){return sr.polygon(e,u,d)},i},"lean_right")});var aAe,JK,eQ=R(()=>{"use strict";ri();hi();ki();ti();Du();aAe=o((t,e,r,n)=>[`M${t+2*n/6},${e}`,`L${t+r+n/6},${e}`,`L${t+r-2*n/6},${e-n}`,`L${t-n/6},${e-n}`,"Z"].join(" "),"createLeanLeftPathD"),JK=o(async(t,e)=>{let{labelStyles:r,nodeStyles:n}=Br(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await zr(t,e,En(e)),s=a.width+e.padding,l=a.height+e.padding,u=[{x:2*l/6,y:0},{x:s+l/6,y:0},{x:s-2*l/6,y:-l},{x:-l/6,y:-l}],h,{cssStyles:f}=e;if(e.look==="handDrawn"){let d=Jt.svg(i),p=Fr(e,{}),m=aAe(0,0,s,l),g=d.path(m,p);h=i.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${l/2})`),f&&h.attr("style",f)}else h=Ma(i,s,l,u);return n&&h.attr("style",n),e.width=s,e.height=l,ar(e,h),e.intersect=function(d){return sr.polygon(e,u,d)},i},"lean_left")});var sAe,tQ,rQ=R(()=>{"use strict";ri();hi();ki();ti();Du();sAe=o((t,e,r,n)=>[`M${t-2*n/6},${e}`,`L${t+r+2*n/6},${e}`,`L${t+r-n/6},${e-n}`,`L${t+n/6},${e-n}`,"Z"].join(" "),"createTrapezoidPathD"),tQ=o(async(t,e)=>{let{labelStyles:r,nodeStyles:n}=Br(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await zr(t,e,En(e)),s=a.width+e.padding,l=a.height+e.padding,u=[{x:-2*l/6,y:0},{x:s+2*l/6,y:0},{x:s-l/6,y:-l},{x:l/6,y:-l}],h,{cssStyles:f}=e;if(e.look==="handDrawn"){let d=Jt.svg(i),p=Fr(e,{}),m=sAe(0,0,s,l),g=d.path(m,p);h=i.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${l/2})`),f&&h.attr("style",f)}else h=Ma(i,s,l,u);return n&&h.attr("style",n),e.width=s,e.height=l,ar(e,h),e.intersect=function(d){return sr.polygon(e,u,d)},i},"trapezoid")});var oAe,nQ,iQ=R(()=>{"use strict";ri();hi();ki();ti();Du();oAe=o((t,e,r,n)=>[`M${t+n/6},${e}`,`L${t+r-n/6},${e}`,`L${t+r+2*n/6},${e-n}`,`L${t-2*n/6},${e-n}`,"Z"].join(" "),"createInvertedTrapezoidPathD"),nQ=o(async(t,e)=>{let{labelStyles:r,nodeStyles:n}=Br(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await zr(t,e,En(e)),s=a.width+e.padding,l=a.height+e.padding,u=[{x:l/6,y:0},{x:s-l/6,y:0},{x:s+2*l/6,y:-l},{x:-2*l/6,y:-l}],h,{cssStyles:f}=e;if(e.look==="handDrawn"){let d=Jt.svg(i),p=Fr(e,{}),m=oAe(0,0,s,l),g=d.path(m,p);h=i.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${l/2})`),f&&h.attr("style",f)}else h=Ma(i,s,l,u);return n&&h.attr("style",n),e.width=s,e.height=l,ar(e,h),e.intersect=function(d){return sr.polygon(e,u,d)},i},"inv_trapezoid")});var aQ,sQ=R(()=>{"use strict";_v();ri();hi();aQ=o(async(t,e)=>{let{shapeSvg:r}=await zr(t,e,"label"),n=r.insert("rect",":first-child");return n.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),ar(e,n),e.intersect=function(s){return sr.rect(e,s)},r},"labelRect")});var oQ,ym,rw,lQ,cQ,eL,tL=R(()=>{"use strict";ut();xK();wK();kK();CK();AK();_K();DK();NK();IK();PK();_t();FK();GK();VK();HK();WK();XK();KK();ZK();eQ();rQ();iQ();sQ();oQ={state:vK,stateStart:EK,stateEnd:SK,fork:J9,join:J9,choice:LK,note:RK,roundedRect:bK,rectWithTitle:OK,squareRect:TK,stadium:MK,subroutine:BK,cylinder:zK,circle:$K,doublecircle:UK,odd:YK,diamond:qK,hexagon:jK,lean_right:QK,lean_left:JK,trapezoid:tQ,inv_trapezoid:nQ,labelRect:aQ},ym=new Map,rw=o(async(t,e,r)=>{let n,i;if(e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect"),e.link){let a;de().securityLevel==="sandbox"?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await oQ[e.shape](n,e,r)}else i=await oQ[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),ym.set(e.id,n),e.haveCallback&&ym.get(e.id).attr("class",ym.get(e.id).attr("class")+" clickable"),n},"insertNode"),lQ=o((t,e)=>{ym.set(e.id,t)},"setNodeElem"),cQ=o(()=>{ym.clear()},"clear"),eL=o(t=>{let e=ym.get(t.id);V.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");let r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode")});var uQ,hQ=R(()=>{"use strict";qs();rr();ut();X9();K9();Q9();tL();ri();xr();uQ={common:We,getConfig:Or,insertCluster:Y5,insertEdge:J5,insertEdgeLabel:Q5,insertMarkers:ew,insertNode:rw,interpolateToCurve:om,labelHelper:zr,log:V,positionEdgeLabel:Z5}});function cAe(t){return typeof t=="symbol"||Wn(t)&&fa(t)==lAe}var lAe,so,Nd=R(()=>{"use strict";wu();Mo();lAe="[object Symbol]";o(cAe,"isSymbol");so=cAe});function uAe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r{"use strict";o(uAe,"arrayMap");Ss=uAe});function pQ(t){if(typeof t=="string")return t;if(wt(t))return Ss(t,pQ)+"";if(so(t))return dQ?dQ.call(t):"";var e=t+"";return e=="0"&&1/t==-hAe?"-0":e}var hAe,fQ,dQ,mQ,gQ=R(()=>{"use strict";vd();Md();Bn();Nd();hAe=1/0,fQ=Ji?Ji.prototype:void 0,dQ=fQ?fQ.toString:void 0;o(pQ,"baseToString");mQ=pQ});function dAe(t){for(var e=t.length;e--&&fAe.test(t.charAt(e)););return e}var fAe,yQ,vQ=R(()=>{"use strict";fAe=/\s/;o(dAe,"trimmedEndIndex");yQ=dAe});function mAe(t){return t&&t.slice(0,yQ(t)+1).replace(pAe,"")}var pAe,xQ,bQ=R(()=>{"use strict";vQ();pAe=/^\s+/;o(mAe,"baseTrim");xQ=mAe});function bAe(t){if(typeof t=="number")return t;if(so(t))return wQ;if(pn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=pn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=xQ(t);var r=yAe.test(t);return r||vAe.test(t)?xAe(t.slice(2),r?2:8):gAe.test(t)?wQ:+t}var wQ,gAe,yAe,vAe,xAe,TQ,kQ=R(()=>{"use strict";bQ();Js();Nd();wQ=NaN,gAe=/^[-+]0x[0-9a-f]+$/i,yAe=/^0b[01]+$/i,vAe=/^0o[0-7]+$/i,xAe=parseInt;o(bAe,"toNumber");TQ=bAe});function TAe(t){if(!t)return t===0?t:0;if(t=TQ(t),t===EQ||t===-EQ){var e=t<0?-1:1;return e*wAe}return t===t?t:0}var EQ,wAe,vm,rL=R(()=>{"use strict";kQ();EQ=1/0,wAe=17976931348623157e292;o(TAe,"toFinite");vm=TAe});function kAe(t){var e=vm(t),r=e%1;return e===e?r?e-r:e:0}var yc,xm=R(()=>{"use strict";rL();o(kAe,"toInteger");yc=kAe});var EAe,nw,CQ=R(()=>{"use strict";Nh();Ro();EAe=xs(Jn,"WeakMap"),nw=EAe});function CAe(){}var qn,nL=R(()=>{"use strict";o(CAe,"noop");qn=CAe});function SAe(t,e){for(var r=-1,n=t==null?0:t.length;++r{"use strict";o(SAe,"arrayEach");iw=SAe});function AAe(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a{"use strict";o(AAe,"baseFindIndex");aw=AAe});function _Ae(t){return t!==t}var SQ,AQ=R(()=>{"use strict";o(_Ae,"baseIsNaN");SQ=_Ae});function LAe(t,e,r){for(var n=r-1,i=t.length;++n{"use strict";o(LAe,"strictIndexOf");_Q=LAe});function DAe(t,e,r){return e===e?_Q(t,e,r):aw(t,SQ,r)}var bm,sw=R(()=>{"use strict";aL();AQ();LQ();o(DAe,"baseIndexOf");bm=DAe});function RAe(t,e){var r=t==null?0:t.length;return!!r&&bm(t,e,0)>-1}var ow,sL=R(()=>{"use strict";sw();o(RAe,"arrayIncludes");ow=RAe});var NAe,DQ,RQ=R(()=>{"use strict";F_();NAe=s5(Object.keys,Object),DQ=NAe});function OAe(t){if(!fc(t))return DQ(t);var e=[];for(var r in Object(t))IAe.call(t,r)&&r!="constructor"&&e.push(r);return e}var MAe,IAe,wm,lw=R(()=>{"use strict";tm();RQ();MAe=Object.prototype,IAe=MAe.hasOwnProperty;o(OAe,"baseKeys");wm=OAe});function PAe(t){return ei(t)?h5(t):wm(t)}var Dr,vc=R(()=>{"use strict";U_();lw();Io();o(PAe,"keys");Dr=PAe});var BAe,FAe,zAe,pa,NQ=R(()=>{"use strict";am();kd();q_();Io();tm();vc();BAe=Object.prototype,FAe=BAe.hasOwnProperty,zAe=p5(function(t,e){if(fc(e)||ei(e)){Bo(e,Dr(e),t);return}for(var r in e)FAe.call(e,r)&&dc(t,r,e[r])}),pa=zAe});function VAe(t,e){if(wt(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||so(t)?!0:$Ae.test(t)||!GAe.test(t)||e!=null&&t in Object(e)}var GAe,$Ae,Tm,cw=R(()=>{"use strict";Bn();Nd();GAe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$Ae=/^\w*$/;o(VAe,"isKey");Tm=VAe});function HAe(t){var e=qp(t,function(n){return r.size===UAe&&r.clear(),n}),r=e.cache;return e}var UAe,MQ,IQ=R(()=>{"use strict";R_();UAe=500;o(HAe,"memoizeCapped");MQ=HAe});var YAe,WAe,qAe,OQ,PQ=R(()=>{"use strict";IQ();YAe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,WAe=/\\(\\)?/g,qAe=MQ(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(YAe,function(r,n,i,a){e.push(i?a.replace(WAe,"$1"):n||r)}),e}),OQ=qAe});function XAe(t){return t==null?"":mQ(t)}var uw,oL=R(()=>{"use strict";gQ();o(XAe,"toString");uw=XAe});function jAe(t,e){return wt(t)?t:Tm(t,e)?[t]:OQ(uw(t))}var Hh,Lv=R(()=>{"use strict";Bn();cw();PQ();oL();o(jAe,"castPath");Hh=jAe});function QAe(t){if(typeof t=="string"||so(t))return t;var e=t+"";return e=="0"&&1/t==-KAe?"-0":e}var KAe,xc,km=R(()=>{"use strict";Nd();KAe=1/0;o(QAe,"toKey");xc=QAe});function ZAe(t,e){e=Hh(e,t);for(var r=0,n=e.length;t!=null&&r{"use strict";Lv();km();o(ZAe,"baseGet");Yh=ZAe});function JAe(t,e,r){var n=t==null?void 0:Yh(t,e);return n===void 0?r:n}var BQ,FQ=R(()=>{"use strict";Dv();o(JAe,"get");BQ=JAe});function e8e(t,e){for(var r=-1,n=e.length,i=t.length;++r{"use strict";o(e8e,"arrayPush");Em=e8e});function t8e(t){return wt(t)||kl(t)||!!(zQ&&t&&t[zQ])}var zQ,GQ,$Q=R(()=>{"use strict";vd();rm();Bn();zQ=Ji?Ji.isConcatSpreadable:void 0;o(t8e,"isFlattenable");GQ=t8e});function VQ(t,e,r,n,i){var a=-1,s=t.length;for(r||(r=GQ),i||(i=[]);++a0&&r(l)?e>1?VQ(l,e-1,r,n,i):Em(i,l):n||(i[i.length]=l)}return i}var bc,Cm=R(()=>{"use strict";hw();$Q();o(VQ,"baseFlatten");bc=VQ});function r8e(t){var e=t==null?0:t.length;return e?bc(t,1):[]}var Gr,fw=R(()=>{"use strict";Cm();o(r8e,"flatten");Gr=r8e});function n8e(t){return d5(f5(t,void 0,Gr),t+"")}var UQ,HQ=R(()=>{"use strict";fw();H_();W_();o(n8e,"flatRest");UQ=n8e});function i8e(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++n{"use strict";o(i8e,"baseSlice");dw=i8e});function d8e(t){return f8e.test(t)}var a8e,s8e,o8e,l8e,c8e,u8e,h8e,f8e,YQ,WQ=R(()=>{"use strict";a8e="\\ud800-\\udfff",s8e="\\u0300-\\u036f",o8e="\\ufe20-\\ufe2f",l8e="\\u20d0-\\u20ff",c8e=s8e+o8e+l8e,u8e="\\ufe0e\\ufe0f",h8e="\\u200d",f8e=RegExp("["+h8e+a8e+c8e+u8e+"]");o(d8e,"hasUnicode");YQ=d8e});function p8e(t,e,r,n){var i=-1,a=t==null?0:t.length;for(n&&a&&(r=t[++i]);++i{"use strict";o(p8e,"arrayReduce");qQ=p8e});function m8e(t,e){return t&&Bo(e,Dr(e),t)}var jQ,KQ=R(()=>{"use strict";kd();vc();o(m8e,"baseAssign");jQ=m8e});function g8e(t,e){return t&&Bo(e,bs(e),t)}var QQ,ZQ=R(()=>{"use strict";kd();zh();o(g8e,"baseAssignIn");QQ=g8e});function y8e(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r{"use strict";o(y8e,"arrayFilter");Sm=y8e});function v8e(){return[]}var mw,cL=R(()=>{"use strict";o(v8e,"stubArray");mw=v8e});var x8e,b8e,JQ,w8e,Am,gw=R(()=>{"use strict";pw();cL();x8e=Object.prototype,b8e=x8e.propertyIsEnumerable,JQ=Object.getOwnPropertySymbols,w8e=JQ?function(t){return t==null?[]:(t=Object(t),Sm(JQ(t),function(e){return b8e.call(t,e)}))}:mw,Am=w8e});function T8e(t,e){return Bo(t,Am(t),e)}var eZ,tZ=R(()=>{"use strict";kd();gw();o(T8e,"copySymbols");eZ=T8e});var k8e,E8e,yw,uL=R(()=>{"use strict";hw();o5();gw();cL();k8e=Object.getOwnPropertySymbols,E8e=k8e?function(t){for(var e=[];t;)Em(e,Am(t)),t=em(t);return e}:mw,yw=E8e});function C8e(t,e){return Bo(t,yw(t),e)}var rZ,nZ=R(()=>{"use strict";kd();uL();o(C8e,"copySymbolsIn");rZ=C8e});function S8e(t,e,r){var n=e(t);return wt(t)?n:Em(n,r(t))}var vw,hL=R(()=>{"use strict";hw();Bn();o(S8e,"baseGetAllKeys");vw=S8e});function A8e(t){return vw(t,Dr,Am)}var Rv,fL=R(()=>{"use strict";hL();gw();vc();o(A8e,"getAllKeys");Rv=A8e});function _8e(t){return vw(t,bs,yw)}var xw,dL=R(()=>{"use strict";hL();uL();zh();o(_8e,"getAllKeysIn");xw=_8e});var L8e,bw,iZ=R(()=>{"use strict";Nh();Ro();L8e=xs(Jn,"DataView"),bw=L8e});var D8e,ww,aZ=R(()=>{"use strict";Nh();Ro();D8e=xs(Jn,"Promise"),ww=D8e});var R8e,Wh,pL=R(()=>{"use strict";Nh();Ro();R8e=xs(Jn,"Set"),Wh=R8e});var sZ,N8e,oZ,lZ,cZ,uZ,M8e,I8e,O8e,P8e,B8e,Id,oo,Od=R(()=>{"use strict";iZ();J3();aZ();pL();CQ();wu();__();sZ="[object Map]",N8e="[object Object]",oZ="[object Promise]",lZ="[object Set]",cZ="[object WeakMap]",uZ="[object DataView]",M8e=Tu(bw),I8e=Tu(Oh),O8e=Tu(ww),P8e=Tu(Wh),B8e=Tu(nw),Id=fa;(bw&&Id(new bw(new ArrayBuffer(1)))!=uZ||Oh&&Id(new Oh)!=sZ||ww&&Id(ww.resolve())!=oZ||Wh&&Id(new Wh)!=lZ||nw&&Id(new nw)!=cZ)&&(Id=o(function(t){var e=fa(t),r=e==N8e?t.constructor:void 0,n=r?Tu(r):"";if(n)switch(n){case M8e:return uZ;case I8e:return sZ;case O8e:return oZ;case P8e:return lZ;case B8e:return cZ}return e},"getTag"));oo=Id});function G8e(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&z8e.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var F8e,z8e,hZ,fZ=R(()=>{"use strict";F8e=Object.prototype,z8e=F8e.hasOwnProperty;o(G8e,"initCloneArray");hZ=G8e});function $8e(t,e){var r=e?Jp(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var dZ,pZ=R(()=>{"use strict";n5();o($8e,"cloneDataView");dZ=$8e});function U8e(t){var e=new t.constructor(t.source,V8e.exec(t));return e.lastIndex=t.lastIndex,e}var V8e,mZ,gZ=R(()=>{"use strict";V8e=/\w*$/;o(U8e,"cloneRegExp");mZ=U8e});function H8e(t){return vZ?Object(vZ.call(t)):{}}var yZ,vZ,xZ,bZ=R(()=>{"use strict";vd();yZ=Ji?Ji.prototype:void 0,vZ=yZ?yZ.valueOf:void 0;o(H8e,"cloneSymbol");xZ=H8e});function u_e(t,e,r){var n=t.constructor;switch(e){case J8e:return Jp(t);case Y8e:case W8e:return new n(+t);case e_e:return dZ(t,r);case t_e:case r_e:case n_e:case i_e:case a_e:case s_e:case o_e:case l_e:case c_e:return i5(t,r);case q8e:return new n;case X8e:case Q8e:return new n(t);case j8e:return mZ(t);case K8e:return new n;case Z8e:return xZ(t)}}var Y8e,W8e,q8e,X8e,j8e,K8e,Q8e,Z8e,J8e,e_e,t_e,r_e,n_e,i_e,a_e,s_e,o_e,l_e,c_e,wZ,TZ=R(()=>{"use strict";n5();pZ();gZ();bZ();P_();Y8e="[object Boolean]",W8e="[object Date]",q8e="[object Map]",X8e="[object Number]",j8e="[object RegExp]",K8e="[object Set]",Q8e="[object String]",Z8e="[object Symbol]",J8e="[object ArrayBuffer]",e_e="[object DataView]",t_e="[object Float32Array]",r_e="[object Float64Array]",n_e="[object Int8Array]",i_e="[object Int16Array]",a_e="[object Int32Array]",s_e="[object Uint8Array]",o_e="[object Uint8ClampedArray]",l_e="[object Uint16Array]",c_e="[object Uint32Array]";o(u_e,"initCloneByTag");wZ=u_e});function f_e(t){return Wn(t)&&oo(t)==h_e}var h_e,kZ,EZ=R(()=>{"use strict";Od();Mo();h_e="[object Map]";o(f_e,"baseIsMap");kZ=f_e});var CZ,d_e,SZ,AZ=R(()=>{"use strict";EZ();Td();ov();CZ=Po&&Po.isMap,d_e=CZ?Oo(CZ):kZ,SZ=d_e});function m_e(t){return Wn(t)&&oo(t)==p_e}var p_e,_Z,LZ=R(()=>{"use strict";Od();Mo();p_e="[object Set]";o(m_e,"baseIsSet");_Z=m_e});var DZ,g_e,RZ,NZ=R(()=>{"use strict";LZ();Td();ov();DZ=Po&&Po.isSet,g_e=DZ?Oo(DZ):_Z,RZ=g_e});function Tw(t,e,r,n,i,a){var s,l=e&y_e,u=e&v_e,h=e&x_e;if(r&&(s=i?r(t,n,i,a):r(t)),s!==void 0)return s;if(!pn(t))return t;var f=wt(t);if(f){if(s=hZ(t),!l)return a5(t,s)}else{var d=oo(t),p=d==IZ||d==E_e;if(El(t))return r5(t,l);if(d==OZ||d==MZ||p&&!i){if(s=u||p?{}:l5(t),!l)return u?rZ(t,QQ(s,t)):eZ(t,jQ(s,t))}else{if(!Cn[d])return i?t:{};s=wZ(t,d,l)}}a||(a=new uc);var m=a.get(t);if(m)return m;a.set(t,s),RZ(t)?t.forEach(function(v){s.add(Tw(v,e,r,v,t,a))}):SZ(t)&&t.forEach(function(v,x){s.set(x,Tw(v,e,r,x,t,a))});var g=h?u?xw:Rv:u?bs:Dr,y=f?void 0:g(t);return iw(y||t,function(v,x){y&&(x=v,v=t[x]),dc(s,x,Tw(v,e,r,x,t,a))}),s}var y_e,v_e,x_e,MZ,b_e,w_e,T_e,k_e,IZ,E_e,C_e,S_e,OZ,A_e,__e,L_e,D_e,R_e,N_e,M_e,I_e,O_e,P_e,B_e,F_e,z_e,G_e,$_e,V_e,Cn,kw,mL=R(()=>{"use strict";iv();iL();am();KQ();ZQ();I_();B_();tZ();nZ();fL();dL();Od();fZ();TZ();z_();Bn();im();AZ();Js();NZ();vc();zh();y_e=1,v_e=2,x_e=4,MZ="[object Arguments]",b_e="[object Array]",w_e="[object Boolean]",T_e="[object Date]",k_e="[object Error]",IZ="[object Function]",E_e="[object GeneratorFunction]",C_e="[object Map]",S_e="[object Number]",OZ="[object Object]",A_e="[object RegExp]",__e="[object Set]",L_e="[object String]",D_e="[object Symbol]",R_e="[object WeakMap]",N_e="[object ArrayBuffer]",M_e="[object DataView]",I_e="[object Float32Array]",O_e="[object Float64Array]",P_e="[object Int8Array]",B_e="[object Int16Array]",F_e="[object Int32Array]",z_e="[object Uint8Array]",G_e="[object Uint8ClampedArray]",$_e="[object Uint16Array]",V_e="[object Uint32Array]",Cn={};Cn[MZ]=Cn[b_e]=Cn[N_e]=Cn[M_e]=Cn[w_e]=Cn[T_e]=Cn[I_e]=Cn[O_e]=Cn[P_e]=Cn[B_e]=Cn[F_e]=Cn[C_e]=Cn[S_e]=Cn[OZ]=Cn[A_e]=Cn[__e]=Cn[L_e]=Cn[D_e]=Cn[z_e]=Cn[G_e]=Cn[$_e]=Cn[V_e]=!0;Cn[k_e]=Cn[IZ]=Cn[R_e]=!1;o(Tw,"baseClone");kw=Tw});function H_e(t){return kw(t,U_e)}var U_e,Qr,gL=R(()=>{"use strict";mL();U_e=4;o(H_e,"clone");Qr=H_e});function q_e(t){return kw(t,Y_e|W_e)}var Y_e,W_e,yL,PZ=R(()=>{"use strict";mL();Y_e=1,W_e=4;o(q_e,"cloneDeep");yL=q_e});function X_e(t){for(var e=-1,r=t==null?0:t.length,n=0,i=[];++e{"use strict";o(X_e,"compact");wc=X_e});function K_e(t){return this.__data__.set(t,j_e),this}var j_e,FZ,zZ=R(()=>{"use strict";j_e="__lodash_hash_undefined__";o(K_e,"setCacheAdd");FZ=K_e});function Q_e(t){return this.__data__.has(t)}var GZ,$Z=R(()=>{"use strict";o(Q_e,"setCacheHas");GZ=Q_e});function Ew(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new bd;++e{"use strict";e5();zZ();$Z();o(Ew,"SetCache");Ew.prototype.add=Ew.prototype.push=FZ;Ew.prototype.has=GZ;_m=Ew});function Z_e(t,e){for(var r=-1,n=t==null?0:t.length;++r{"use strict";o(Z_e,"arraySome");Sw=Z_e});function J_e(t,e){return t.has(e)}var Lm,Aw=R(()=>{"use strict";o(J_e,"cacheHas");Lm=J_e});function r9e(t,e,r,n,i,a){var s=r&e9e,l=t.length,u=e.length;if(l!=u&&!(s&&u>l))return!1;var h=a.get(t),f=a.get(e);if(h&&f)return h==e&&f==t;var d=-1,p=!0,m=r&t9e?new _m:void 0;for(a.set(t,e),a.set(e,t);++d{"use strict";Cw();vL();Aw();e9e=1,t9e=2;o(r9e,"equalArrays");_w=r9e});function n9e(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var VZ,UZ=R(()=>{"use strict";o(n9e,"mapToArray");VZ=n9e});function i9e(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Dm,Lw=R(()=>{"use strict";o(i9e,"setToArray");Dm=i9e});function v9e(t,e,r,n,i,a,s){switch(r){case y9e:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case g9e:return!(t.byteLength!=e.byteLength||!a(new Zp(t),new Zp(e)));case o9e:case l9e:case h9e:return No(+t,+e);case c9e:return t.name==e.name&&t.message==e.message;case f9e:case p9e:return t==e+"";case u9e:var l=VZ;case d9e:var u=n&a9e;if(l||(l=Dm),t.size!=e.size&&!u)return!1;var h=s.get(t);if(h)return h==e;n|=s9e,s.set(t,e);var f=_w(l(t),l(e),n,i,a,s);return s.delete(t),f;case m9e:if(bL)return bL.call(t)==bL.call(e)}return!1}var a9e,s9e,o9e,l9e,c9e,u9e,h9e,f9e,d9e,p9e,m9e,g9e,y9e,HZ,bL,YZ,WZ=R(()=>{"use strict";vd();O_();xd();xL();UZ();Lw();a9e=1,s9e=2,o9e="[object Boolean]",l9e="[object Date]",c9e="[object Error]",u9e="[object Map]",h9e="[object Number]",f9e="[object RegExp]",d9e="[object Set]",p9e="[object String]",m9e="[object Symbol]",g9e="[object ArrayBuffer]",y9e="[object DataView]",HZ=Ji?Ji.prototype:void 0,bL=HZ?HZ.valueOf:void 0;o(v9e,"equalByTag");YZ=v9e});function T9e(t,e,r,n,i,a){var s=r&x9e,l=Rv(t),u=l.length,h=Rv(e),f=h.length;if(u!=f&&!s)return!1;for(var d=u;d--;){var p=l[d];if(!(s?p in e:w9e.call(e,p)))return!1}var m=a.get(t),g=a.get(e);if(m&&g)return m==e&&g==t;var y=!0;a.set(t,e),a.set(e,t);for(var v=s;++d{"use strict";fL();x9e=1,b9e=Object.prototype,w9e=b9e.hasOwnProperty;o(T9e,"equalObjects");qZ=T9e});function C9e(t,e,r,n,i,a){var s=wt(t),l=wt(e),u=s?KZ:oo(t),h=l?KZ:oo(e);u=u==jZ?Dw:u,h=h==jZ?Dw:h;var f=u==Dw,d=h==Dw,p=u==h;if(p&&El(t)){if(!El(e))return!1;s=!0,f=!1}if(p&&!f)return a||(a=new uc),s||Bh(t)?_w(t,e,r,n,i,a):YZ(t,e,u,r,n,i,a);if(!(r&k9e)){var m=f&&QZ.call(t,"__wrapped__"),g=d&&QZ.call(e,"__wrapped__");if(m||g){var y=m?t.value():t,v=g?e.value():e;return a||(a=new uc),i(y,v,r,n,a)}}return p?(a||(a=new uc),qZ(t,e,r,n,i,a)):!1}var k9e,jZ,KZ,Dw,E9e,QZ,ZZ,JZ=R(()=>{"use strict";iv();xL();WZ();XZ();Od();Bn();im();lv();k9e=1,jZ="[object Arguments]",KZ="[object Array]",Dw="[object Object]",E9e=Object.prototype,QZ=E9e.hasOwnProperty;o(C9e,"baseIsEqualDeep");ZZ=C9e});function eJ(t,e,r,n,i){return t===e?!0:t==null||e==null||!Wn(t)&&!Wn(e)?t!==t&&e!==e:ZZ(t,e,r,n,eJ,i)}var Rw,wL=R(()=>{"use strict";JZ();Mo();o(eJ,"baseIsEqual");Rw=eJ});function _9e(t,e,r,n){var i=r.length,a=i,s=!n;if(t==null)return!a;for(t=Object(t);i--;){var l=r[i];if(s&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++i{"use strict";iv();wL();S9e=1,A9e=2;o(_9e,"baseIsMatch");tJ=_9e});function L9e(t){return t===t&&!pn(t)}var Nw,TL=R(()=>{"use strict";Js();o(L9e,"isStrictComparable");Nw=L9e});function D9e(t){for(var e=Dr(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,Nw(i)]}return e}var nJ,iJ=R(()=>{"use strict";TL();vc();o(D9e,"getMatchData");nJ=D9e});function R9e(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var Mw,kL=R(()=>{"use strict";o(R9e,"matchesStrictComparable");Mw=R9e});function N9e(t){var e=nJ(t);return e.length==1&&e[0][2]?Mw(e[0][0],e[0][1]):function(r){return r===t||tJ(r,t,e)}}var aJ,sJ=R(()=>{"use strict";rJ();iJ();kL();o(N9e,"baseMatches");aJ=N9e});function M9e(t,e){return t!=null&&e in Object(t)}var oJ,lJ=R(()=>{"use strict";o(M9e,"baseHasIn");oJ=M9e});function I9e(t,e,r){e=Hh(e,t);for(var n=-1,i=e.length,a=!1;++n{"use strict";Lv();rm();Bn();uv();c5();km();o(I9e,"hasPath");Iw=I9e});function O9e(t,e){return t!=null&&Iw(t,e,oJ)}var Ow,CL=R(()=>{"use strict";lJ();EL();o(O9e,"hasIn");Ow=O9e});function F9e(t,e){return Tm(t)&&Nw(e)?Mw(xc(t),e):function(r){var n=BQ(r,t);return n===void 0&&n===e?Ow(r,t):Rw(e,n,P9e|B9e)}}var P9e,B9e,cJ,uJ=R(()=>{"use strict";wL();FQ();CL();cw();TL();kL();km();P9e=1,B9e=2;o(F9e,"baseMatchesProperty");cJ=F9e});function z9e(t){return function(e){return e?.[t]}}var Pw,SL=R(()=>{"use strict";o(z9e,"baseProperty");Pw=z9e});function G9e(t){return function(e){return Yh(e,t)}}var hJ,fJ=R(()=>{"use strict";Dv();o(G9e,"basePropertyDeep");hJ=G9e});function $9e(t){return Tm(t)?Pw(xc(t)):hJ(t)}var dJ,pJ=R(()=>{"use strict";SL();fJ();cw();km();o($9e,"property");dJ=$9e});function V9e(t){return typeof t=="function"?t:t==null?ea:typeof t=="object"?wt(t)?cJ(t[0],t[1]):aJ(t):dJ(t)}var cn,Qa=R(()=>{"use strict";sJ();uJ();Eu();Bn();pJ();o(V9e,"baseIteratee");cn=V9e});function U9e(t,e,r,n){for(var i=-1,a=t==null?0:t.length;++i{"use strict";o(U9e,"arrayAggregator");mJ=U9e});function H9e(t,e){return t&&Qp(t,e,Dr)}var Rm,Bw=R(()=>{"use strict";t5();vc();o(H9e,"baseForOwn");Rm=H9e});function Y9e(t,e){return function(r,n){if(r==null)return r;if(!ei(r))return t(r,n);for(var i=r.length,a=e?i:-1,s=Object(r);(e?a--:++a{"use strict";Io();o(Y9e,"createBaseEach");yJ=Y9e});var W9e,As,qh=R(()=>{"use strict";Bw();vJ();W9e=yJ(Rm),As=W9e});function q9e(t,e,r,n){return As(t,function(i,a,s){e(n,i,r(i),s)}),n}var xJ,bJ=R(()=>{"use strict";qh();o(q9e,"baseAggregator");xJ=q9e});function X9e(t,e){return function(r,n){var i=wt(r)?mJ:xJ,a=e?e():{};return i(r,t,cn(n,2),a)}}var wJ,TJ=R(()=>{"use strict";gJ();bJ();Qa();Bn();o(X9e,"createAggregator");wJ=X9e});var j9e,Fw,kJ=R(()=>{"use strict";Ro();j9e=o(function(){return Jn.Date.now()},"now"),Fw=j9e});var EJ,K9e,Q9e,Xh,CJ=R(()=>{"use strict";sm();xd();Ed();zh();EJ=Object.prototype,K9e=EJ.hasOwnProperty,Q9e=pc(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&eo(e[0],e[1],i)&&(n=1);++r{"use strict";o(Z9e,"arrayIncludesWith");zw=Z9e});function eLe(t,e,r,n){var i=-1,a=ow,s=!0,l=t.length,u=[],h=e.length;if(!l)return u;r&&(e=Ss(e,Oo(r))),n?(a=zw,s=!1):e.length>=J9e&&(a=Lm,s=!1,e=new _m(e));e:for(;++i{"use strict";Cw();sL();AL();Md();Td();Aw();J9e=200;o(eLe,"baseDifference");SJ=eLe});var tLe,jh,_J=R(()=>{"use strict";AJ();Cm();sm();u5();tLe=pc(function(t,e){return wd(t)?SJ(t,bc(e,1,wd,!0)):[]}),jh=tLe});function rLe(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var ma,LJ=R(()=>{"use strict";o(rLe,"last");ma=rLe});function nLe(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:yc(e),dw(t,e<0?0:e,n)):[]}var fi,DJ=R(()=>{"use strict";lL();xm();o(nLe,"drop");fi=nLe});function iLe(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:yc(e),e=n-e,dw(t,0,e<0?0:e)):[]}var Ru,RJ=R(()=>{"use strict";lL();xm();o(iLe,"dropRight");Ru=iLe});function aLe(t){return typeof t=="function"?t:ea}var Nm,Gw=R(()=>{"use strict";Eu();o(aLe,"castFunction");Nm=aLe});function sLe(t,e){var r=wt(t)?iw:As;return r(t,Nm(e))}var Ee,$w=R(()=>{"use strict";iL();qh();Gw();Bn();o(sLe,"forEach");Ee=sLe});var NJ=R(()=>{"use strict";$w()});function oLe(t,e){for(var r=-1,n=t==null?0:t.length;++r{"use strict";o(oLe,"arrayEvery");MJ=oLe});function lLe(t,e){var r=!0;return As(t,function(n,i,a){return r=!!e(n,i,a),r}),r}var OJ,PJ=R(()=>{"use strict";qh();o(lLe,"baseEvery");OJ=lLe});function cLe(t,e,r){var n=wt(t)?MJ:OJ;return r&&eo(t,e,r)&&(e=void 0),n(t,cn(e,3))}var Ia,BJ=R(()=>{"use strict";IJ();PJ();Qa();Bn();Ed();o(cLe,"every");Ia=cLe});function uLe(t,e){var r=[];return As(t,function(n,i,a){e(n,i,a)&&r.push(n)}),r}var Vw,_L=R(()=>{"use strict";qh();o(uLe,"baseFilter");Vw=uLe});function hLe(t,e){var r=wt(t)?Sm:Vw;return r(t,cn(e,3))}var $r,LL=R(()=>{"use strict";pw();_L();Qa();Bn();o(hLe,"filter");$r=hLe});function fLe(t){return function(e,r,n){var i=Object(e);if(!ei(e)){var a=cn(r,3);e=Dr(e),r=o(function(l){return a(i[l],l,i)},"predicate")}var s=t(e,r,n);return s>-1?i[a?e[s]:s]:void 0}}var FJ,zJ=R(()=>{"use strict";Qa();Io();vc();o(fLe,"createFind");FJ=fLe});function pLe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:yc(r);return i<0&&(i=dLe(n+i,0)),aw(t,cn(e,3),i)}var dLe,GJ,$J=R(()=>{"use strict";aL();Qa();xm();dLe=Math.max;o(pLe,"findIndex");GJ=pLe});var mLe,Za,VJ=R(()=>{"use strict";zJ();$J();mLe=FJ(GJ),Za=mLe});function gLe(t){return t&&t.length?t[0]:void 0}var na,UJ=R(()=>{"use strict";o(gLe,"head");na=gLe});var HJ=R(()=>{"use strict";UJ()});function yLe(t,e){var r=-1,n=ei(t)?Array(t.length):[];return As(t,function(i,a,s){n[++r]=e(i,a,s)}),n}var Uw,DL=R(()=>{"use strict";qh();Io();o(yLe,"baseMap");Uw=yLe});function vLe(t,e){var r=wt(t)?Ss:Uw;return r(t,cn(e,3))}var qe,Mm=R(()=>{"use strict";Md();Qa();DL();Bn();o(vLe,"map");qe=vLe});function xLe(t,e){return bc(qe(t,e),1)}var ga,RL=R(()=>{"use strict";Cm();Mm();o(xLe,"flatMap");ga=xLe});function bLe(t,e){return t==null?t:Qp(t,Nm(e),bs)}var NL,YJ=R(()=>{"use strict";t5();Gw();zh();o(bLe,"forIn");NL=bLe});function wLe(t,e){return t&&Rm(t,Nm(e))}var ML,WJ=R(()=>{"use strict";Bw();Gw();o(wLe,"forOwn");ML=wLe});var TLe,kLe,ELe,IL,qJ=R(()=>{"use strict";Kp();TJ();TLe=Object.prototype,kLe=TLe.hasOwnProperty,ELe=wJ(function(t,e,r){kLe.call(t,r)?t[r].push(e):hc(t,r,[e])}),IL=ELe});function CLe(t,e){return t>e}var XJ,jJ=R(()=>{"use strict";o(CLe,"baseGt");XJ=CLe});function _Le(t,e){return t!=null&&ALe.call(t,e)}var SLe,ALe,KJ,QJ=R(()=>{"use strict";SLe=Object.prototype,ALe=SLe.hasOwnProperty;o(_Le,"baseHas");KJ=_Le});function LLe(t,e){return t!=null&&Iw(t,e,KJ)}var Xe,ZJ=R(()=>{"use strict";QJ();EL();o(LLe,"has");Xe=LLe});function RLe(t){return typeof t=="string"||!wt(t)&&Wn(t)&&fa(t)==DLe}var DLe,di,Hw=R(()=>{"use strict";wu();Bn();Mo();DLe="[object String]";o(RLe,"isString");di=RLe});function NLe(t,e){return Ss(e,function(r){return t[r]})}var JJ,eee=R(()=>{"use strict";Md();o(NLe,"baseValues");JJ=NLe});function MLe(t){return t==null?[]:JJ(t,Dr(t))}var or,OL=R(()=>{"use strict";eee();vc();o(MLe,"values");or=MLe});function OLe(t,e,r,n){t=ei(t)?t:or(t),r=r&&!n?yc(r):0;var i=t.length;return r<0&&(r=ILe(i+r,0)),di(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&bm(t,e,r)>-1}var ILe,Fn,tee=R(()=>{"use strict";sw();Io();Hw();xm();OL();ILe=Math.max;o(OLe,"includes");Fn=OLe});function BLe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:yc(r);return i<0&&(i=PLe(n+i,0)),bm(t,e,i)}var PLe,Yw,ree=R(()=>{"use strict";sw();xm();PLe=Math.max;o(BLe,"indexOf");Yw=BLe});function VLe(t){if(t==null)return!0;if(ei(t)&&(wt(t)||typeof t=="string"||typeof t.splice=="function"||El(t)||Bh(t)||kl(t)))return!t.length;var e=oo(t);if(e==FLe||e==zLe)return!t.size;if(fc(t))return!wm(t).length;for(var r in t)if($Le.call(t,r))return!1;return!0}var FLe,zLe,GLe,$Le,Qt,Ww=R(()=>{"use strict";lw();Od();rm();Bn();Io();im();tm();lv();FLe="[object Map]",zLe="[object Set]",GLe=Object.prototype,$Le=GLe.hasOwnProperty;o(VLe,"isEmpty");Qt=VLe});function HLe(t){return Wn(t)&&fa(t)==ULe}var ULe,nee,iee=R(()=>{"use strict";wu();Mo();ULe="[object RegExp]";o(HLe,"baseIsRegExp");nee=HLe});var aee,YLe,zo,see=R(()=>{"use strict";iee();Td();ov();aee=Po&&Po.isRegExp,YLe=aee?Oo(aee):nee,zo=YLe});function WLe(t){return t===void 0}var er,oee=R(()=>{"use strict";o(WLe,"isUndefined");er=WLe});function qLe(t,e){return t{"use strict";o(qLe,"baseLt");qw=qLe});function XLe(t,e){var r={};return e=cn(e,3),Rm(t,function(n,i,a){hc(r,i,e(n,i,a))}),r}var Pd,lee=R(()=>{"use strict";Kp();Bw();Qa();o(XLe,"mapValues");Pd=XLe});function jLe(t,e,r){for(var n=-1,i=t.length;++n{"use strict";Nd();o(jLe,"baseExtremum");Im=jLe});function KLe(t){return t&&t.length?Im(t,ea,XJ):void 0}var _s,cee=R(()=>{"use strict";Xw();jJ();Eu();o(KLe,"max");_s=KLe});function QLe(t){return t&&t.length?Im(t,ea,qw):void 0}var Ll,BL=R(()=>{"use strict";Xw();PL();Eu();o(QLe,"min");Ll=QLe});function ZLe(t,e){return t&&t.length?Im(t,cn(e,2),qw):void 0}var Bd,uee=R(()=>{"use strict";Xw();Qa();PL();o(ZLe,"minBy");Bd=ZLe});function eDe(t){if(typeof t!="function")throw new TypeError(JLe);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var JLe,hee,fee=R(()=>{"use strict";JLe="Expected a function";o(eDe,"negate");hee=eDe});function tDe(t,e,r,n){if(!pn(t))return t;e=Hh(e,t);for(var i=-1,a=e.length,s=a-1,l=t;l!=null&&++i{"use strict";am();Lv();uv();Js();km();o(tDe,"baseSet");dee=tDe});function rDe(t,e,r){for(var n=-1,i=e.length,a={};++n{"use strict";Dv();pee();Lv();o(rDe,"basePickBy");jw=rDe});function nDe(t,e){if(t==null)return{};var r=Ss(xw(t),function(n){return[n]});return e=cn(e),jw(t,r,function(n,i){return e(n,i[0])})}var Ls,mee=R(()=>{"use strict";Md();Qa();FL();dL();o(nDe,"pickBy");Ls=nDe});function iDe(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}var gee,yee=R(()=>{"use strict";o(iDe,"baseSortBy");gee=iDe});function aDe(t,e){if(t!==e){var r=t!==void 0,n=t===null,i=t===t,a=so(t),s=e!==void 0,l=e===null,u=e===e,h=so(e);if(!l&&!h&&!a&&t>e||a&&s&&u&&!l&&!h||n&&s&&u||!r&&u||!i)return 1;if(!n&&!a&&!h&&t{"use strict";Nd();o(aDe,"compareAscending");vee=aDe});function sDe(t,e,r){for(var n=-1,i=t.criteria,a=e.criteria,s=i.length,l=r.length;++n=l)return u;var h=r[n];return u*(h=="desc"?-1:1)}}return t.index-e.index}var bee,wee=R(()=>{"use strict";xee();o(sDe,"compareMultiple");bee=sDe});function oDe(t,e,r){e.length?e=Ss(e,function(a){return wt(a)?function(s){return Yh(s,a.length===1?a[0]:a)}:a}):e=[ea];var n=-1;e=Ss(e,Oo(cn));var i=Uw(t,function(a,s,l){var u=Ss(e,function(h){return h(a)});return{criteria:u,index:++n,value:a}});return gee(i,function(a,s){return bee(a,s,r)})}var Tee,kee=R(()=>{"use strict";Md();Dv();Qa();DL();yee();Td();wee();Eu();Bn();o(oDe,"baseOrderBy");Tee=oDe});var lDe,Eee,Cee=R(()=>{"use strict";SL();lDe=Pw("length"),Eee=lDe});function bDe(t){for(var e=See.lastIndex=0;See.test(t);)++e;return e}var Aee,cDe,uDe,hDe,fDe,dDe,pDe,zL,GL,mDe,_ee,Lee,Dee,gDe,Ree,Nee,yDe,vDe,xDe,See,Mee,Iee=R(()=>{"use strict";Aee="\\ud800-\\udfff",cDe="\\u0300-\\u036f",uDe="\\ufe20-\\ufe2f",hDe="\\u20d0-\\u20ff",fDe=cDe+uDe+hDe,dDe="\\ufe0e\\ufe0f",pDe="["+Aee+"]",zL="["+fDe+"]",GL="\\ud83c[\\udffb-\\udfff]",mDe="(?:"+zL+"|"+GL+")",_ee="[^"+Aee+"]",Lee="(?:\\ud83c[\\udde6-\\uddff]){2}",Dee="[\\ud800-\\udbff][\\udc00-\\udfff]",gDe="\\u200d",Ree=mDe+"?",Nee="["+dDe+"]?",yDe="(?:"+gDe+"(?:"+[_ee,Lee,Dee].join("|")+")"+Nee+Ree+")*",vDe=Nee+Ree+yDe,xDe="(?:"+[_ee+zL+"?",zL,Lee,Dee,pDe].join("|")+")",See=RegExp(GL+"(?="+GL+")|"+xDe+vDe,"g");o(bDe,"unicodeSize");Mee=bDe});function wDe(t){return YQ(t)?Mee(t):Eee(t)}var Oee,Pee=R(()=>{"use strict";Cee();WQ();Iee();o(wDe,"stringSize");Oee=wDe});function TDe(t,e){return jw(t,e,function(r,n){return Ow(t,n)})}var Bee,Fee=R(()=>{"use strict";FL();CL();o(TDe,"basePick");Bee=TDe});var kDe,Fd,zee=R(()=>{"use strict";Fee();HQ();kDe=UQ(function(t,e){return t==null?{}:Bee(t,e)}),Fd=kDe});function SDe(t,e,r,n){for(var i=-1,a=CDe(EDe((e-t)/(r||1)),0),s=Array(a);a--;)s[n?a:++i]=t,t+=r;return s}var EDe,CDe,Gee,$ee=R(()=>{"use strict";EDe=Math.ceil,CDe=Math.max;o(SDe,"baseRange");Gee=SDe});function ADe(t){return function(e,r,n){return n&&typeof n!="number"&&eo(e,r,n)&&(r=n=void 0),e=vm(e),r===void 0?(r=e,e=0):r=vm(r),n=n===void 0?e{"use strict";$ee();Ed();rL();o(ADe,"createRange");Vee=ADe});var _De,Go,Hee=R(()=>{"use strict";Uee();_De=Vee(),Go=_De});function LDe(t,e,r,n,i){return i(t,function(a,s,l){r=n?(n=!1,a):e(r,a,s,l)}),r}var Yee,Wee=R(()=>{"use strict";o(LDe,"baseReduce");Yee=LDe});function DDe(t,e,r){var n=wt(t)?qQ:Yee,i=arguments.length<3;return n(t,cn(e,4),r,i,As)}var Vr,$L=R(()=>{"use strict";XQ();qh();Qa();Wee();Bn();o(DDe,"reduce");Vr=DDe});function RDe(t,e){var r=wt(t)?Sm:Vw;return r(t,hee(cn(e,3)))}var Kh,qee=R(()=>{"use strict";pw();_L();Qa();Bn();fee();o(RDe,"reject");Kh=RDe});function IDe(t){if(t==null)return 0;if(ei(t))return di(t)?Oee(t):t.length;var e=oo(t);return e==NDe||e==MDe?t.size:wm(t).length}var NDe,MDe,VL,Xee=R(()=>{"use strict";lw();Od();Io();Hw();Pee();NDe="[object Map]",MDe="[object Set]";o(IDe,"size");VL=IDe});function ODe(t,e){var r;return As(t,function(n,i,a){return r=e(n,i,a),!r}),!!r}var jee,Kee=R(()=>{"use strict";qh();o(ODe,"baseSome");jee=ODe});function PDe(t,e,r){var n=wt(t)?Sw:jee;return r&&eo(t,e,r)&&(e=void 0),n(t,cn(e,3))}var Nv,Qee=R(()=>{"use strict";vL();Qa();Kee();Bn();Ed();o(PDe,"some");Nv=PDe});var BDe,Tc,Zee=R(()=>{"use strict";Cm();kee();sm();Ed();BDe=pc(function(t,e){if(t==null)return[];var r=e.length;return r>1&&eo(t,e[0],e[1])?e=[]:r>2&&eo(e[0],e[1],e[2])&&(e=[e[0]]),Tee(t,bc(e,1),[])}),Tc=BDe});var FDe,zDe,Jee,ete=R(()=>{"use strict";pL();nL();Lw();FDe=1/0,zDe=Wh&&1/Dm(new Wh([,-0]))[1]==FDe?function(t){return new Wh(t)}:qn,Jee=zDe});function $De(t,e,r){var n=-1,i=ow,a=t.length,s=!0,l=[],u=l;if(r)s=!1,i=zw;else if(a>=GDe){var h=e?null:Jee(t);if(h)return Dm(h);s=!1,i=Lm,u=new _m}else u=e?[]:l;e:for(;++n{"use strict";Cw();sL();AL();Aw();ete();Lw();GDe=200;o($De,"baseUniq");Om=$De});var VDe,UL,tte=R(()=>{"use strict";Cm();sm();Kw();u5();VDe=pc(function(t){return Om(bc(t,1,wd,!0))}),UL=VDe});function UDe(t){return t&&t.length?Om(t):[]}var Pm,rte=R(()=>{"use strict";Kw();o(UDe,"uniq");Pm=UDe});function HDe(t,e){return t&&t.length?Om(t,cn(e,2)):[]}var nte,ite=R(()=>{"use strict";Qa();Kw();o(HDe,"uniqBy");nte=HDe});function WDe(t){var e=++YDe;return uw(t)+e}var YDe,zd,ate=R(()=>{"use strict";oL();YDe=0;o(WDe,"uniqueId");zd=WDe});function qDe(t,e,r){for(var n=-1,i=t.length,a=e.length,s={};++n{"use strict";o(qDe,"baseZipObject");ste=qDe});function XDe(t,e){return ste(t||[],e||[],dc)}var Qw,lte=R(()=>{"use strict";am();ote();o(XDe,"zipObject");Qw=XDe});var Pt=R(()=>{"use strict";NQ();gL();PZ();BZ();Y_();CJ();_J();DJ();RJ();NJ();BJ();LL();VJ();HJ();RL();fw();$w();YJ();WJ();qJ();ZJ();Eu();tee();ree();Bn();Ww();Jy();Js();see();Hw();oee();vc();LJ();Mm();lee();cee();X_();BL();uee();nL();kJ();zee();mee();Hee();$L();qee();Xee();Qee();Zee();tte();rte();ate();OL();lte();});function ute(t,e){t[e]?t[e]++:t[e]=1}function hte(t,e){--t[e]||delete t[e]}function Mv(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+cte+a+cte+(er(n)?jDe:n)}function KDe(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}var l={v:i,w:a};return n&&(l.name=n),l}function HL(t,e){return Mv(t,e.v,e.w,e.name)}var jDe,Gd,cte,lr,Zw=R(()=>{"use strict";Pt();jDe="\0",Gd="\0",cte="",lr=class{static{o(this,"Graph")}constructor(e={}){this._isDirected=Xe(e,"directed")?e.directed:!0,this._isMultigraph=Xe(e,"multigraph")?e.multigraph:!1,this._isCompound=Xe(e,"compound")?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=ws(void 0),this._defaultEdgeLabelFn=ws(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[Gd]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return wi(e)||(e=ws(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return Dr(this._nodes)}sources(){var e=this;return $r(this.nodes(),function(r){return Qt(e._in[r])})}sinks(){var e=this;return $r(this.nodes(),function(r){return Qt(e._out[r])})}setNodes(e,r){var n=arguments,i=this;return Ee(e,function(a){n.length>1?i.setNode(a,r):i.setNode(a)}),this}setNode(e,r){return Xe(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Gd,this._children[e]={},this._children[Gd][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Xe(this._nodes,e)}removeNode(e){var r=this;if(Xe(this._nodes,e)){var n=o(function(i){r.removeEdge(r._edgeObjs[i])},"removeEdge");delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],Ee(this.children(e),function(i){r.setParent(i)}),delete this._children[e]),Ee(Dr(this._in[e]),n),delete this._in[e],delete this._preds[e],Ee(Dr(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(er(r))r=Gd;else{r+="";for(var n=r;!er(n);n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==Gd)return r}}children(e){if(er(e)&&(e=Gd),this._isCompound){var r=this._children[e];if(r)return Dr(r)}else{if(e===Gd)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return Dr(r)}successors(e){var r=this._sucs[e];if(r)return Dr(r)}neighbors(e){var r=this.predecessors(e);if(r)return UL(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;Ee(this._nodes,function(s,l){e(l)&&r.setNode(l,s)}),Ee(this._edgeObjs,function(s){r.hasNode(s.v)&&r.hasNode(s.w)&&r.setEdge(s,n.edge(s))});var i={};function a(s){var l=n.parent(s);return l===void 0||r.hasNode(l)?(i[s]=l,l):l in i?i[l]:a(l)}return o(a,"findParent"),this._isCompound&&Ee(r.nodes(),function(s){r.setParent(s,a(s))}),r}setDefaultEdgeLabel(e){return wi(e)||(e=ws(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return or(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return Vr(e,function(a,s){return i.length>1?n.setEdge(a,s,r):n.setEdge(a,s),s}),this}setEdge(){var e,r,n,i,a=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,r=s.w,n=s.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=s,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,er(n)||(n=""+n);var l=Mv(this._isDirected,e,r,n);if(Xe(this._edgeLabels,l))return a&&(this._edgeLabels[l]=i),this;if(!er(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[l]=a?i:this._defaultEdgeLabelFn(e,r,n);var u=KDe(this._isDirected,e,r,n);return e=u.v,r=u.w,Object.freeze(u),this._edgeObjs[l]=u,ute(this._preds[r],e),ute(this._sucs[e],r),this._in[r][l]=u,this._out[e][l]=u,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?HL(this._isDirected,arguments[0]):Mv(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?HL(this._isDirected,arguments[0]):Mv(this._isDirected,e,r,n);return Xe(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?HL(this._isDirected,arguments[0]):Mv(this._isDirected,e,r,n),a=this._edgeObjs[i];return a&&(e=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],hte(this._preds[r],e),hte(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=or(n);return r?$r(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=or(n);return r?$r(i,function(a){return a.w===r}):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}};lr.prototype._nodeCount=0;lr.prototype._edgeCount=0;o(ute,"incrementOrInitEntry");o(hte,"decrementOrRemoveEntry");o(Mv,"edgeArgsToId");o(KDe,"edgeArgsToObj");o(HL,"edgeObjToId")});var ya=R(()=>{"use strict";Zw()});function fte(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function QDe(t,e){if(t!=="_next"&&t!=="_prev")return e}var Jw,dte=R(()=>{"use strict";Jw=class{static{o(this,"List")}constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return fte(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&fte(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,n=r._prev;n!==r;)e.push(JSON.stringify(n,QDe)),n=n._prev;return"["+e.join(", ")+"]"}};o(fte,"unlink");o(QDe,"filterOutLinks")});function pte(t,e){if(t.nodeCount()<=1)return[];var r=eRe(t,e||ZDe),n=JDe(r.graph,r.buckets,r.zeroIdx);return Gr(qe(n,function(i){return t.outEdges(i.v,i.w)}))}function JDe(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],s;t.nodeCount();){for(;s=a.dequeue();)YL(t,e,r,s);for(;s=i.dequeue();)YL(t,e,r,s);if(t.nodeCount()){for(var l=e.length-2;l>0;--l)if(s=e[l].dequeue(),s){n=n.concat(YL(t,e,r,s,!0));break}}}return n}function YL(t,e,r,n,i){var a=i?[]:void 0;return Ee(t.inEdges(n.v),function(s){var l=t.edge(s),u=t.node(s.v);i&&a.push({v:s.v,w:s.w}),u.out-=l,WL(e,r,u)}),Ee(t.outEdges(n.v),function(s){var l=t.edge(s),u=s.w,h=t.node(u);h.in-=l,WL(e,r,h)}),t.removeNode(n.v),a}function eRe(t,e){var r=new lr,n=0,i=0;Ee(t.nodes(),function(l){r.setNode(l,{v:l,in:0,out:0})}),Ee(t.edges(),function(l){var u=r.edge(l.v,l.w)||0,h=e(l),f=u+h;r.setEdge(l.v,l.w,f),i=Math.max(i,r.node(l.v).out+=h),n=Math.max(n,r.node(l.w).in+=h)});var a=Go(i+n+3).map(function(){return new Jw}),s=n+1;return Ee(r.nodes(),function(l){WL(a,s,r.node(l))}),{graph:r,buckets:a,zeroIdx:s}}function WL(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}var ZDe,mte=R(()=>{"use strict";Pt();ya();dte();ZDe=ws(1);o(pte,"greedyFAS");o(JDe,"doGreedyFAS");o(YL,"removeNode");o(eRe,"buildState");o(WL,"assignBucket")});function gte(t){var e=t.graph().acyclicer==="greedy"?pte(t,r(t)):tRe(t);Ee(e,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,zd("rev"))});function r(n){return function(i){return n.edge(i).weight}}o(r,"weightFn")}function tRe(t){var e=[],r={},n={};function i(a){Xe(n,a)||(n[a]=!0,r[a]=!0,Ee(t.outEdges(a),function(s){Xe(r,s.w)?e.push(s):i(s.w)}),delete r[a])}return o(i,"dfs"),Ee(t.nodes(),i),e}function yte(t){Ee(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}var qL=R(()=>{"use strict";Pt();mte();o(gte,"run");o(tRe,"dfsFAS");o(yte,"undo")});function kc(t,e,r,n){var i;do i=zd(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function xte(t){var e=new lr().setGraph(t.graph());return Ee(t.nodes(),function(r){e.setNode(r,t.node(r))}),Ee(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function eT(t){var e=new lr({multigraph:t.isMultigraph()}).setGraph(t.graph());return Ee(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),Ee(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function XL(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,l=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var u,h;return Math.abs(a)*s>Math.abs(i)*l?(a<0&&(l=-l),u=l*i/a,h=l):(i<0&&(s=-s),u=s,h=s*a/i),{x:r+u,y:n+h}}function Qh(t){var e=qe(Go(KL(t)+1),function(){return[]});return Ee(t.nodes(),function(r){var n=t.node(r),i=n.rank;er(i)||(e[i][n.order]=r)}),e}function bte(t){var e=Ll(qe(t.nodes(),function(r){return t.node(r).rank}));Ee(t.nodes(),function(r){var n=t.node(r);Xe(n,"rank")&&(n.rank-=e)})}function wte(t){var e=Ll(qe(t.nodes(),function(a){return t.node(a).rank})),r=[];Ee(t.nodes(),function(a){var s=t.node(a).rank-e;r[s]||(r[s]=[]),r[s].push(a)});var n=0,i=t.graph().nodeRankFactor;Ee(r,function(a,s){er(a)&&s%i!==0?--n:n&&Ee(a,function(l){t.node(l).rank+=n})})}function jL(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),kc(t,"border",i,e)}function KL(t){return _s(qe(t.nodes(),function(e){var r=t.node(e).rank;if(!er(r))return r}))}function Tte(t,e){var r={lhs:[],rhs:[]};return Ee(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function kte(t,e){var r=Fw();try{return e()}finally{console.log(t+" time: "+(Fw()-r)+"ms")}}function Ete(t,e){return e()}var Ec=R(()=>{"use strict";Pt();ya();o(kc,"addDummyNode");o(xte,"simplify");o(eT,"asNonCompoundGraph");o(XL,"intersectRect");o(Qh,"buildLayerMatrix");o(bte,"normalizeRanks");o(wte,"removeEmptyRanks");o(jL,"addBorderNode");o(KL,"maxRank");o(Tte,"partition");o(kte,"time");o(Ete,"notime")});function Ste(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&&Ee(n,e),Xe(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;a{"use strict";Pt();Ec();o(Ste,"addBorderSegments");o(Cte,"addBorderNode")});function Lte(t){var e=t.graph().rankdir.toLowerCase();(e==="lr"||e==="rl")&&Rte(t)}function Dte(t){var e=t.graph().rankdir.toLowerCase();(e==="bt"||e==="rl")&&rRe(t),(e==="lr"||e==="rl")&&(nRe(t),Rte(t))}function Rte(t){Ee(t.nodes(),function(e){_te(t.node(e))}),Ee(t.edges(),function(e){_te(t.edge(e))})}function _te(t){var e=t.width;t.width=t.height,t.height=e}function rRe(t){Ee(t.nodes(),function(e){QL(t.node(e))}),Ee(t.edges(),function(e){var r=t.edge(e);Ee(r.points,QL),Xe(r,"y")&&QL(r)})}function QL(t){t.y=-t.y}function nRe(t){Ee(t.nodes(),function(e){ZL(t.node(e))}),Ee(t.edges(),function(e){var r=t.edge(e);Ee(r.points,ZL),Xe(r,"x")&&ZL(r)})}function ZL(t){var e=t.x;t.x=t.y,t.y=e}var Nte=R(()=>{"use strict";Pt();o(Lte,"adjust");o(Dte,"undo");o(Rte,"swapWidthHeight");o(_te,"swapWidthHeightOne");o(rRe,"reverseY");o(QL,"reverseYOne");o(nRe,"swapXY");o(ZL,"swapXYOne")});function Mte(t){t.graph().dummyChains=[],Ee(t.edges(),function(e){aRe(t,e)})}function aRe(t,e){var r=e.v,n=t.node(r).rank,i=e.w,a=t.node(i).rank,s=e.name,l=t.edge(e),u=l.labelRank;if(a!==n+1){t.removeEdge(e);var h,f,d;for(d=0,++n;n{"use strict";Pt();Ec();o(Mte,"run");o(aRe,"normalizeEdge");o(Ite,"undo")});function Iv(t){var e={};function r(n){var i=t.node(n);if(Xe(e,n))return i.rank;e[n]=!0;var a=Ll(qe(t.outEdges(n),function(s){return r(s.w)-t.edge(s).minlen}));return(a===Number.POSITIVE_INFINITY||a===void 0||a===null)&&(a=0),i.rank=a}o(r,"dfs"),Ee(t.sources(),r)}function $d(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}var tT=R(()=>{"use strict";Pt();o(Iv,"longestPath");o($d,"slack")});function rT(t){var e=new lr({directed:!1}),r=t.nodes()[0],n=t.nodeCount();e.setNode(r,{});for(var i,a;sRe(e,t){"use strict";Pt();ya();tT();o(rT,"feasibleTree");o(sRe,"tightTree");o(oRe,"findMinSlackEdge");o(lRe,"shiftRanks")});var Pte=R(()=>{"use strict"});var tD=R(()=>{"use strict"});var tGt,rD=R(()=>{"use strict";Pt();tD();tGt=ws(1)});var Bte=R(()=>{"use strict";rD()});var nD=R(()=>{"use strict"});var Fte=R(()=>{"use strict";nD()});var fGt,zte=R(()=>{"use strict";Pt();fGt=ws(1)});function iD(t){var e={},r={},n=[];function i(a){if(Xe(r,a))throw new Ov;Xe(e,a)||(r[a]=!0,e[a]=!0,Ee(t.predecessors(a),i),delete r[a],n.push(a))}if(o(i,"visit"),Ee(t.sinks(),i),VL(e)!==t.nodeCount())throw new Ov;return n}function Ov(){}var aD=R(()=>{"use strict";Pt();iD.CycleException=Ov;o(iD,"topsort");o(Ov,"CycleException");Ov.prototype=new Error});var Gte=R(()=>{"use strict";aD()});function nT(t,e,r){wt(e)||(e=[e]);var n=(t.isDirected()?t.successors:t.neighbors).bind(t),i=[],a={};return Ee(e,function(s){if(!t.hasNode(s))throw new Error("Graph does not have node: "+s);$te(t,s,r==="post",a,n,i)}),i}function $te(t,e,r,n,i,a){Xe(n,e)||(n[e]=!0,r||a.push(e),Ee(i(e),function(s){$te(t,s,r,n,i,a)}),r&&a.push(e))}var sD=R(()=>{"use strict";Pt();o(nT,"dfs");o($te,"doDfs")});function oD(t,e){return nT(t,e,"post")}var Vte=R(()=>{"use strict";sD();o(oD,"postorder")});function lD(t,e){return nT(t,e,"pre")}var Ute=R(()=>{"use strict";sD();o(lD,"preorder")});var Hte=R(()=>{"use strict";tD();Zw()});var Yte=R(()=>{"use strict";Pte();rD();Bte();Fte();zte();Gte();Vte();Ute();Hte();nD();aD()});function Jh(t){t=xte(t),Iv(t);var e=rT(t);uD(e),cD(e,t);for(var r,n;r=jte(e);)n=Kte(e,t,r),Qte(e,t,r,n)}function cD(t,e){var r=oD(t,t.nodes());r=r.slice(0,r.length-1),Ee(r,function(n){dRe(t,e,n)})}function dRe(t,e,r){var n=t.node(r),i=n.parent;t.edge(r,i).cutvalue=qte(t,e,r)}function qte(t,e,r){var n=t.node(r),i=n.parent,a=!0,s=e.edge(r,i),l=0;return s||(a=!1,s=e.edge(i,r)),l=s.weight,Ee(e.nodeEdges(r),function(u){var h=u.v===r,f=h?u.w:u.v;if(f!==i){var d=h===a,p=e.edge(u).weight;if(l+=d?p:-p,mRe(t,r,f)){var m=t.edge(r,f).cutvalue;l+=d?-m:m}}}),l}function uD(t,e){arguments.length<2&&(e=t.nodes()[0]),Xte(t,{},1,e)}function Xte(t,e,r,n,i){var a=r,s=t.node(n);return e[n]=!0,Ee(t.neighbors(n),function(l){Xe(e,l)||(r=Xte(t,e,r,l,n))}),s.low=a,s.lim=r++,i?s.parent=i:delete s.parent,r}function jte(t){return Za(t.edges(),function(e){return t.edge(e).cutvalue<0})}function Kte(t,e,r){var n=r.v,i=r.w;e.hasEdge(n,i)||(n=r.w,i=r.v);var a=t.node(n),s=t.node(i),l=a,u=!1;a.lim>s.lim&&(l=s,u=!0);var h=$r(e.edges(),function(f){return u===Wte(t,t.node(f.v),l)&&u!==Wte(t,t.node(f.w),l)});return Bd(h,function(f){return $d(e,f)})}function Qte(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),uD(t),cD(t,e),pRe(t,e)}function pRe(t,e){var r=Za(t.nodes(),function(i){return!e.node(i).parent}),n=lD(t,r);n=n.slice(1),Ee(n,function(i){var a=t.node(i).parent,s=e.edge(i,a),l=!1;s||(s=e.edge(a,i),l=!0),e.node(i).rank=e.node(a).rank+(l?s.minlen:-s.minlen)})}function mRe(t,e,r){return t.hasEdge(e,r)}function Wte(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}var Zte=R(()=>{"use strict";Pt();Yte();Ec();eD();tT();Jh.initLowLimValues=uD;Jh.initCutValues=cD;Jh.calcCutValue=qte;Jh.leaveEdge=jte;Jh.enterEdge=Kte;Jh.exchangeEdges=Qte;o(Jh,"networkSimplex");o(cD,"initCutValues");o(dRe,"assignCutValue");o(qte,"calcCutValue");o(uD,"initLowLimValues");o(Xte,"dfsAssignLowLim");o(jte,"leaveEdge");o(Kte,"enterEdge");o(Qte,"exchangeEdges");o(pRe,"updateRanks");o(mRe,"isTreeEdge");o(Wte,"isDescendant")});function hD(t){switch(t.graph().ranker){case"network-simplex":Jte(t);break;case"tight-tree":yRe(t);break;case"longest-path":gRe(t);break;default:Jte(t)}}function yRe(t){Iv(t),rT(t)}function Jte(t){Jh(t)}var gRe,fD=R(()=>{"use strict";eD();Zte();tT();o(hD,"rank");gRe=Iv;o(yRe,"tightTreeRanker");o(Jte,"networkSimplexRanker")});function ere(t){var e=kc(t,"root",{},"_root"),r=vRe(t),n=_s(or(r))-1,i=2*n+1;t.graph().nestingRoot=e,Ee(t.edges(),function(s){t.edge(s).minlen*=i});var a=xRe(t)+1;Ee(t.children(),function(s){tre(t,e,i,a,n,r,s)}),t.graph().nodeRankFactor=i}function tre(t,e,r,n,i,a,s){var l=t.children(s);if(!l.length){s!==e&&t.setEdge(e,s,{weight:0,minlen:r});return}var u=jL(t,"_bt"),h=jL(t,"_bb"),f=t.node(s);t.setParent(u,s),f.borderTop=u,t.setParent(h,s),f.borderBottom=h,Ee(l,function(d){tre(t,e,r,n,i,a,d);var p=t.node(d),m=p.borderTop?p.borderTop:d,g=p.borderBottom?p.borderBottom:d,y=p.borderTop?n:2*n,v=m!==g?1:i-a[s]+1;t.setEdge(u,m,{weight:y,minlen:v,nestingEdge:!0}),t.setEdge(g,h,{weight:y,minlen:v,nestingEdge:!0})}),t.parent(s)||t.setEdge(e,u,{weight:0,minlen:i+a[s]})}function vRe(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&&Ee(a,function(s){r(s,i+1)}),e[n]=i}return o(r,"dfs"),Ee(t.children(),function(n){r(n,1)}),e}function xRe(t){return Vr(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function rre(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,Ee(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}var nre=R(()=>{"use strict";Pt();Ec();o(ere,"run");o(tre,"dfs");o(vRe,"treeDepths");o(xRe,"sumWeights");o(rre,"cleanup")});function ire(t,e,r){var n={},i;Ee(r,function(a){for(var s=t.parent(a),l,u;s;){if(l=t.parent(s),l?(u=n[l],n[l]=s):(u=i,i=s),u&&u!==s){e.setEdge(u,s);return}s=l}})}var are=R(()=>{"use strict";Pt();o(ire,"addSubgraphConstraints")});function sre(t,e,r){var n=wRe(t),i=new lr({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return Ee(t.nodes(),function(a){var s=t.node(a),l=t.parent(a);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(i.setNode(a),i.setParent(a,l||n),Ee(t[r](a),function(u){var h=u.v===a?u.w:u.v,f=i.edge(h,a),d=er(f)?0:f.weight;i.setEdge(h,a,{weight:t.edge(u).weight+d})}),Xe(s,"minRank")&&i.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),i}function wRe(t){for(var e;t.hasNode(e=zd("_root")););return e}var ore=R(()=>{"use strict";Pt();ya();o(sre,"buildLayerGraph");o(wRe,"createRootNode")});function lre(t,e){for(var r=0,n=1;n0;)f%2&&(d+=l[f+1]),f=f-1>>1,l[f]+=h.weight;u+=h.weight*d})),u}var cre=R(()=>{"use strict";Pt();o(lre,"crossCount");o(TRe,"twoLayerCrossCount")});function ure(t){var e={},r=$r(t.nodes(),function(l){return!t.children(l).length}),n=_s(qe(r,function(l){return t.node(l).rank})),i=qe(Go(n+1),function(){return[]});function a(l){if(!Xe(e,l)){e[l]=!0;var u=t.node(l);i[u.rank].push(l),Ee(t.successors(l),a)}}o(a,"dfs");var s=Tc(r,function(l){return t.node(l).rank});return Ee(s,a),i}var hre=R(()=>{"use strict";Pt();o(ure,"initOrder")});function fre(t,e){return qe(e,function(r){var n=t.inEdges(r);if(n.length){var i=Vr(n,function(a,s){var l=t.edge(s),u=t.node(s.v);return{sum:a.sum+l.weight*u.order,weight:a.weight+l.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}var dre=R(()=>{"use strict";Pt();o(fre,"barycenter")});function pre(t,e){var r={};Ee(t,function(i,a){var s=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};er(i.barycenter)||(s.barycenter=i.barycenter,s.weight=i.weight)}),Ee(e.edges(),function(i){var a=r[i.v],s=r[i.w];!er(a)&&!er(s)&&(s.indegree++,a.out.push(r[i.w]))});var n=$r(r,function(i){return!i.indegree});return kRe(n)}function kRe(t){var e=[];function r(a){return function(s){s.merged||(er(s.barycenter)||er(a.barycenter)||s.barycenter>=a.barycenter)&&ERe(a,s)}}o(r,"handleIn");function n(a){return function(s){s.in.push(a),--s.indegree===0&&t.push(s)}}for(o(n,"handleOut");t.length;){var i=t.pop();e.push(i),Ee(i.in.reverse(),r(i)),Ee(i.out,n(i))}return qe($r(e,function(a){return!a.merged}),function(a){return Fd(a,["vs","i","barycenter","weight"])})}function ERe(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}var mre=R(()=>{"use strict";Pt();o(pre,"resolveConflicts");o(kRe,"doResolveConflicts");o(ERe,"mergeEntries")});function yre(t,e){var r=Tte(t,function(f){return Xe(f,"barycenter")}),n=r.lhs,i=Tc(r.rhs,function(f){return-f.i}),a=[],s=0,l=0,u=0;n.sort(CRe(!!e)),u=gre(a,i,u),Ee(n,function(f){u+=f.vs.length,a.push(f.vs),s+=f.barycenter*f.weight,l+=f.weight,u=gre(a,i,u)});var h={vs:Gr(a)};return l&&(h.barycenter=s/l,h.weight=l),h}function gre(t,e,r){for(var n;e.length&&(n=ma(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function CRe(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}var vre=R(()=>{"use strict";Pt();Ec();o(yre,"sort");o(gre,"consumeUnsortable");o(CRe,"compareWithBias")});function dD(t,e,r,n){var i=t.children(e),a=t.node(e),s=a?a.borderLeft:void 0,l=a?a.borderRight:void 0,u={};s&&(i=$r(i,function(g){return g!==s&&g!==l}));var h=fre(t,i);Ee(h,function(g){if(t.children(g.v).length){var y=dD(t,g.v,r,n);u[g.v]=y,Xe(y,"barycenter")&&ARe(g,y)}});var f=pre(h,r);SRe(f,u);var d=yre(f,n);if(s&&(d.vs=Gr([s,d.vs,l]),t.predecessors(s).length)){var p=t.node(t.predecessors(s)[0]),m=t.node(t.predecessors(l)[0]);Xe(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+p.order+m.order)/(d.weight+2),d.weight+=2}return d}function SRe(t,e){Ee(t,function(r){r.vs=Gr(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function ARe(t,e){er(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}var xre=R(()=>{"use strict";Pt();dre();mre();vre();o(dD,"sortSubgraph");o(SRe,"expandSubgraphs");o(ARe,"mergeBarycenters")});function Tre(t){var e=KL(t),r=bre(t,Go(1,e+1),"inEdges"),n=bre(t,Go(e-1,-1,-1),"outEdges"),i=ure(t);wre(t,i);for(var a=Number.POSITIVE_INFINITY,s,l=0,u=0;u<4;++l,++u){_Re(l%2?r:n,l%4>=2),i=Qh(t);var h=lre(t,i);h{"use strict";Pt();ya();Ec();are();ore();cre();hre();xre();o(Tre,"order");o(bre,"buildLayerGraphs");o(_Re,"sweepLayerGraphs");o(wre,"assignOrder")});function Ere(t){var e=DRe(t);Ee(t.graph().dummyChains,function(r){for(var n=t.node(r),i=n.edgeObj,a=LRe(t,e,i.v,i.w),s=a.path,l=a.lca,u=0,h=s[u],f=!0;r!==i.w;){if(n=t.node(r),f){for(;(h=s[u])!==l&&t.node(h).maxRanks||l>e[u].lim));for(h=u,u=n;(u=t.parent(u))!==h;)a.push(u);return{path:i.concat(a.reverse()),lca:h}}function DRe(t){var e={},r=0;function n(i){var a=r;Ee(t.children(i),n),e[i]={low:a,lim:r++}}return o(n,"dfs"),Ee(t.children(),n),e}var Cre=R(()=>{"use strict";Pt();o(Ere,"parentDummyChains");o(LRe,"findPath");o(DRe,"postorder")});function RRe(t,e){var r={};function n(i,a){var s=0,l=0,u=i.length,h=ma(a);return Ee(a,function(f,d){var p=MRe(t,f),m=p?t.node(p).order:u;(p||f===h)&&(Ee(a.slice(l,d+1),function(g){Ee(t.predecessors(g),function(y){var v=t.node(y),x=v.order;(xh)&&Sre(r,p,f)})})}o(n,"scan");function i(a,s){var l=-1,u,h=0;return Ee(s,function(f,d){if(t.node(f).dummy==="border"){var p=t.predecessors(f);p.length&&(u=t.node(p[0]).order,n(s,h,d,l,u),h=d,l=u)}n(s,h,s.length,u,a.length)}),s}return o(i,"visitLayer"),Vr(e,i),r}function MRe(t,e){if(t.node(e).dummy)return Za(t.predecessors(e),function(r){return t.node(r).dummy})}function Sre(t,e,r){if(e>r){var n=e;e=r,r=n}var i=t[e];i||(t[e]=i={}),i[r]=!0}function IRe(t,e,r){if(e>r){var n=e;e=r,r=n}return Xe(t[e],r)}function ORe(t,e,r,n){var i={},a={},s={};return Ee(e,function(l){Ee(l,function(u,h){i[u]=u,a[u]=u,s[u]=h})}),Ee(e,function(l){var u=-1;Ee(l,function(h){var f=n(h);if(f.length){f=Tc(f,function(y){return s[y]});for(var d=(f.length-1)/2,p=Math.floor(d),m=Math.ceil(d);p<=m;++p){var g=f[p];a[h]===h&&u{"use strict";Pt();ya();Ec();o(RRe,"findType1Conflicts");o(NRe,"findType2Conflicts");o(MRe,"findOtherInnerSegmentNode");o(Sre,"addConflict");o(IRe,"hasConflict");o(ORe,"verticalAlignment");o(PRe,"horizontalCompaction");o(BRe,"buildBlockGraph");o(FRe,"findSmallestWidthAlignment");o(zRe,"alignCoordinates");o(GRe,"balance");o(Are,"positionX");o($Re,"sep");o(VRe,"width")});function Lre(t){t=eT(t),URe(t),ML(Are(t),function(e,r){t.node(r).x=e})}function URe(t){var e=Qh(t),r=t.graph().ranksep,n=0;Ee(e,function(i){var a=_s(qe(i,function(s){return t.node(s).height}));Ee(i,function(s){t.node(s).y=n+a/2}),n+=a+r})}var Dre=R(()=>{"use strict";Pt();Ec();_re();o(Lre,"position");o(URe,"positionY")});function lo(t,e){var r=e&&e.debugTiming?kte:Ete;r("layout",function(){var n=r(" buildLayoutGraph",function(){return eNe(t)});r(" runLayout",function(){HRe(n,r)}),r(" updateInputGraph",function(){YRe(t,n)})})}function HRe(t,e){e(" makeSpaceForEdgeLabels",function(){tNe(t)}),e(" removeSelfEdges",function(){uNe(t)}),e(" acyclic",function(){gte(t)}),e(" nestingGraph.run",function(){ere(t)}),e(" rank",function(){hD(eT(t))}),e(" injectEdgeLabelProxies",function(){rNe(t)}),e(" removeEmptyRanks",function(){wte(t)}),e(" nestingGraph.cleanup",function(){rre(t)}),e(" normalizeRanks",function(){bte(t)}),e(" assignRankMinMax",function(){nNe(t)}),e(" removeEdgeLabelProxies",function(){iNe(t)}),e(" normalize.run",function(){Mte(t)}),e(" parentDummyChains",function(){Ere(t)}),e(" addBorderSegments",function(){Ste(t)}),e(" order",function(){Tre(t)}),e(" insertSelfEdges",function(){hNe(t)}),e(" adjustCoordinateSystem",function(){Lte(t)}),e(" position",function(){Lre(t)}),e(" positionSelfEdges",function(){fNe(t)}),e(" removeBorderNodes",function(){cNe(t)}),e(" normalize.undo",function(){Ite(t)}),e(" fixupEdgeLabelCoords",function(){oNe(t)}),e(" undoCoordinateSystem",function(){Dte(t)}),e(" translateGraph",function(){aNe(t)}),e(" assignNodeIntersects",function(){sNe(t)}),e(" reversePoints",function(){lNe(t)}),e(" acyclic.undo",function(){yte(t)})}function YRe(t,e){Ee(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),Ee(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Xe(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}function eNe(t){var e=new lr({multigraph:!0,compound:!0}),r=mD(t.graph());return e.setGraph(Gh({},qRe,pD(r,WRe),Fd(r,XRe))),Ee(t.nodes(),function(n){var i=mD(t.node(n));e.setNode(n,Xh(pD(i,jRe),KRe)),e.setParent(n,t.parent(n))}),Ee(t.edges(),function(n){var i=mD(t.edge(n));e.setEdge(n,Gh({},ZRe,pD(i,QRe),Fd(i,JRe)))}),e}function tNe(t){var e=t.graph();e.ranksep/=2,Ee(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function rNe(t){Ee(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-n.rank)/2+n.rank,e};kc(t,"edge-proxy",a,"_ep")}})}function nNe(t){var e=0;Ee(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=_s(e,n.maxRank))}),t.graph().maxRank=e}function iNe(t){Ee(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function aNe(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),s=a.marginx||0,l=a.marginy||0;function u(h){var f=h.x,d=h.y,p=h.width,m=h.height;e=Math.min(e,f-p/2),r=Math.max(r,f+p/2),n=Math.min(n,d-m/2),i=Math.max(i,d+m/2)}o(u,"getExtremes"),Ee(t.nodes(),function(h){u(t.node(h))}),Ee(t.edges(),function(h){var f=t.edge(h);Xe(f,"x")&&u(f)}),e-=s,n-=l,Ee(t.nodes(),function(h){var f=t.node(h);f.x-=e,f.y-=n}),Ee(t.edges(),function(h){var f=t.edge(h);Ee(f.points,function(d){d.x-=e,d.y-=n}),Xe(f,"x")&&(f.x-=e),Xe(f,"y")&&(f.y-=n)}),a.width=r-e+s,a.height=i-n+l}function sNe(t){Ee(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=i,s=n),r.points.unshift(XL(n,a)),r.points.push(XL(i,s))})}function oNe(t){Ee(t.edges(),function(e){var r=t.edge(e);if(Xe(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function lNe(t){Ee(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function cNe(t){Ee(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(ma(r.borderLeft)),s=t.node(ma(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),Ee(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function uNe(t){Ee(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function hNe(t){var e=Qh(t);Ee(e,function(r){var n=0;Ee(r,function(i,a){var s=t.node(i);s.order=a+n,Ee(s.selfEdges,function(l){kc(t,"selfedge",{width:l.label.width,height:l.label.height,rank:s.rank,order:a+ ++n,e:l.e,label:l.label},"_se")}),delete s.selfEdges})})}function fNe(t){Ee(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,l=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*s/3,y:a-l},{x:i+5*s/6,y:a-l},{x:i+s,y:a},{x:i+5*s/6,y:a+l},{x:i+2*s/3,y:a+l}],r.label.x=r.x,r.label.y=r.y}})}function pD(t,e){return Pd(Fd(t,e),Number)}function mD(t){var e={};return Ee(t,function(r,n){e[n.toLowerCase()]=r}),e}var WRe,qRe,XRe,jRe,KRe,QRe,ZRe,JRe,Rre=R(()=>{"use strict";Pt();ya();Ate();Nte();qL();JL();fD();nre();kre();Cre();Dre();Ec();o(lo,"layout");o(HRe,"runLayout");o(YRe,"updateInputGraph");WRe=["nodesep","edgesep","ranksep","marginx","marginy"],qRe={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},XRe=["acyclicer","ranker","rankdir","align"],jRe=["width","height"],KRe={width:0,height:0},QRe=["minlen","weight","width","height","labeloffset"],ZRe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},JRe=["labelpos"];o(eNe,"buildLayoutGraph");o(tNe,"makeSpaceForEdgeLabels");o(rNe,"injectEdgeLabelProxies");o(nNe,"assignRankMinMax");o(iNe,"removeEdgeLabelProxies");o(aNe,"translateGraph");o(sNe,"assignNodeIntersects");o(oNe,"fixupEdgeLabelCoords");o(lNe,"reversePointsForReversedEdges");o(cNe,"removeBorderNodes");o(uNe,"removeSelfEdges");o(hNe,"insertSelfEdges");o(fNe,"positionSelfEdges");o(pD,"selectNumberAttrs");o(mD,"canonicalize")});var Vd=R(()=>{"use strict";qL();Rre();JL();fD()});function zn(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:dNe(t),edges:pNe(t)};return er(t.graph())||(e.value=Qr(t.graph())),e}function dNe(t){return qe(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return er(r)||(i.value=r),er(n)||(i.parent=n),i})}function pNe(t){return qe(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return er(e.name)||(n.name=e.name),er(r)||(n.value=r),n})}var Pv=R(()=>{"use strict";Pt();Zw();o(zn,"write");o(dNe,"writeNodes");o(pNe,"writeEdges")});var cr,Ud,Mre,Ire,aT,mNe,Ore,Pre,gNe,Bm,Nre,Bre,Fre,zre,Gre,$re=R(()=>{"use strict";ut();ya();Pv();cr=new Map,Ud=new Map,Mre=new Map,Ire=o(()=>{Ud.clear(),Mre.clear(),cr.clear()},"clear"),aT=o((t,e)=>{let r=Ud.get(e)||[];return V.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),mNe=o((t,e)=>{let r=Ud.get(e)||[];return V.info("Descendants of ",e," is ",r),V.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||aT(t.v,e)||aT(t.w,e)||r.includes(t.w):(V.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),Ore=o((t,e,r,n)=>{V.warn("Copying children of ",t,"root",n,"data",e.node(t),n);let i=e.children(t)||[];t!==n&&i.push(t),V.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)Ore(a,e,r,n);else{let s=e.node(a);V.info("cp ",a," to ",n," with parent ",t),r.setNode(a,s),n!==e.parent(a)&&(V.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(V.debug("Setting parent",a,t),r.setParent(a,t)):(V.info("In copy ",t,"root",n,"data",e.node(t),n),V.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));let l=e.edges(a);V.debug("Copying Edges",l),l.forEach(u=>{V.info("Edge",u);let h=e.edge(u.v,u.w,u.name);V.info("Edge data",h,n);try{mNe(u,n)?(V.info("Copying as ",u.v,u.w,h,u.name),r.setEdge(u.v,u.w,h,u.name),V.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):V.info("Skipping copy of edge ",u.v,"-->",u.w," rootId: ",n," clusterId:",t)}catch(f){V.error(f)}})}V.debug("Removing node",a),e.removeNode(a)})},"copy"),Pre=o((t,e)=>{let r=e.children(t),n=[...r];for(let i of r)Mre.set(i,t),n=[...n,...Pre(i,e)];return n},"extractDescendants"),gNe=o((t,e,r)=>{let n=t.edges().filter(u=>u.v===e||u.w===e),i=t.edges().filter(u=>u.v===r||u.w===r),a=n.map(u=>({v:u.v===e?r:u.v,w:u.w===e?e:u.w})),s=i.map(u=>({v:u.v,w:u.w}));return a.filter(u=>s.some(h=>u.v===h.v&&u.w===h.w))},"findCommonEdges"),Bm=o((t,e,r)=>{let n=e.children(t);if(V.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(let a of n){let s=Bm(a,e,r),l=gNe(e,r,s);if(s)if(l.length>0)i=s;else return s}return i},"findNonClusterChild"),Nre=o(t=>!cr.has(t)||!cr.get(t).externalConnections?t:cr.has(t)?cr.get(t).id:t,"getAnchorId"),Bre=o((t,e)=>{if(!t||e>10){V.debug("Opting out, no graph ");return}else V.debug("Opting in, graph ");t.nodes().forEach(function(r){t.children(r).length>0&&(V.warn("Cluster identified",r," Replacement id in edges: ",Bm(r,t,r)),Ud.set(r,Pre(r,t)),cr.set(r,{id:Bm(r,t,r),clusterData:t.node(r)}))}),t.nodes().forEach(function(r){let n=t.children(r),i=t.edges();n.length>0?(V.debug("Cluster identified",r,Ud),i.forEach(a=>{let s=aT(a.v,r),l=aT(a.w,r);s^l&&(V.warn("Edge: ",a," leaves cluster ",r),V.warn("Descendants of XXX ",r,": ",Ud.get(r)),cr.get(r).externalConnections=!0)})):V.debug("Not a cluster ",r,Ud)});for(let r of cr.keys()){let n=cr.get(r).id,i=t.parent(n);i!==r&&cr.has(i)&&!cr.get(i).externalConnections&&(cr.get(r).id=i)}t.edges().forEach(function(r){let n=t.edge(r);V.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),V.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(t.edge(r)));let i=r.v,a=r.w;if(V.warn("Fix XXX",cr,"ids:",r.v,r.w,"Translating: ",cr.get(r.v)," --- ",cr.get(r.w)),cr.get(r.v)||cr.get(r.w)){if(V.warn("Fixing and trying - removing XXX",r.v,r.w,r.name),i=Nre(r.v),a=Nre(r.w),t.removeEdge(r.v,r.w,r.name),i!==r.v){let s=t.parent(i);cr.get(s).externalConnections=!0,n.fromCluster=r.v}if(a!==r.w){let s=t.parent(a);cr.get(s).externalConnections=!0,n.toCluster=r.w}V.warn("Fix Replacing with XXX",i,a,r.name),t.setEdge(i,a,n,r.name)}}),V.warn("Adjusted Graph",zn(t)),Fre(t,0),V.trace(cr)},"adjustClustersAndEdges"),Fre=o((t,e)=>{if(V.warn("extractor - ",e,zn(t),t.children("D")),e>10){V.error("Bailing out");return}let r=t.nodes(),n=!1;for(let i of r){let a=t.children(i);n=n||a.length>0}if(!n){V.debug("Done, no node has children",t.nodes());return}V.debug("Nodes = ",r,e);for(let i of r)if(V.debug("Extracting node",i,cr,cr.has(i)&&!cr.get(i).externalConnections,!t.parent(i),t.node(i),t.children("D")," Depth ",e),!cr.has(i))V.debug("Not a cluster",i,e);else if(!cr.get(i).externalConnections&&t.children(i)&&t.children(i).length>0){V.warn("Cluster without external connections, without a parent and with children",i,e);let s=t.graph().rankdir==="TB"?"LR":"TB";cr.get(i)?.clusterData?.dir&&(s=cr.get(i).clusterData.dir,V.warn("Fixing dir",cr.get(i).clusterData.dir,s));let l=new lr({multigraph:!0,compound:!0}).setGraph({rankdir:s,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});V.warn("Old graph before copy",zn(t)),Ore(i,t,l,i),t.setNode(i,{clusterNode:!0,id:i,clusterData:cr.get(i).clusterData,label:cr.get(i).label,graph:l}),V.warn("New graph after copy node: (",i,")",zn(l)),V.debug("Old graph after copy",zn(t))}else V.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!cr.get(i).externalConnections," no parent: ",!t.parent(i)," children ",t.children(i)&&t.children(i).length>0,t.children("D"),e),V.debug(cr);r=t.nodes(),V.warn("New list of nodes",r);for(let i of r){let a=t.node(i);V.warn(" Now next level",i,a),a?.clusterNode&&Fre(a.graph,e+1)}},"extractor"),zre=o((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{let i=t.children(n),a=zre(t,i);r=[...r,...a]}),r},"sorter"),Gre=o(t=>zre(t,t.children()),"sortNodesByHierarchy")});var Ure={};hr(Ure,{render:()=>yNe});var Vre,yNe,Hre=R(()=>{"use strict";Vd();Pv();ya();Q9();ri();$re();tL();X9();K9();ut();_d();_t();Vre=o(async(t,e,r,n,i,a)=>{V.warn("Graph in recursive render:XAX",zn(e),i);let s=e.graph().rankdir;V.trace("Dir in recursive render - dir:",s);let l=t.insert("g").attr("class","root");e.nodes()?V.info("Recursive render XXX",e.nodes()):V.info("No nodes found for",e),e.edges().length>0&&V.info("Recursive edges",e.edge(e.edges()[0]));let u=l.insert("g").attr("class","clusters"),h=l.insert("g").attr("class","edgePaths"),f=l.insert("g").attr("class","edgeLabels"),d=l.insert("g").attr("class","nodes");await Promise.all(e.nodes().map(async function(y){let v=e.node(y);if(i!==void 0){let x=JSON.parse(JSON.stringify(i.clusterData));V.trace(`Setting data for parent cluster XXX + Node.id = `,y,` + data=`,x.height,` +Parent cluster`,i.height),e.setNode(i.id,x),e.parent(y)||(V.trace("Setting parent",y,i.id),e.setParent(y,i.id,x))}if(V.info("(Insert) Node XXX"+y+": "+JSON.stringify(e.node(y))),v?.clusterNode){V.info("Cluster identified XBX",y,v.width,e.node(y));let{ranksep:x,nodesep:b}=e.graph();v.graph.setGraph({...v.graph.graph(),ranksep:x+25,nodesep:b});let w=await Vre(d,v.graph,r,n,e.node(y),a),S=w.elem;ar(v,S),v.diff=w.diff||0,V.info("New compound node after recursive render XAX",y,"width",v.width,"height",v.height),lQ(S,v)}else e.children(y).length>0?(V.trace("Cluster - the non recursive path XBX",y,v.id,v,v.width,"Graph:",e),V.trace(Bm(v.id,e)),cr.set(v.id,{id:Bm(v.id,e),node:v})):(V.trace("Node - the non recursive path XAX",y,d,e.node(y),s),await rw(d,e.node(y),s))})),await o(async()=>{let y=e.edges().map(async function(v){let x=e.edge(v.v,v.w,v.name);V.info("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(v)),V.info("Edge "+v.v+" -> "+v.w+": ",v," ",JSON.stringify(e.edge(v))),V.info("Fix",cr,"ids:",v.v,v.w,"Translating: ",cr.get(v.v),cr.get(v.w)),await Q5(f,x)});await Promise.all(y)},"processEdges")(),V.info("Graph before layout:",JSON.stringify(zn(e))),V.info("############################################# XXX"),V.info("### Layout ### XXX"),V.info("############################################# XXX"),lo(e),V.info("Graph after layout:",JSON.stringify(zn(e)));let m=0,{subGraphTitleTotalMargin:g}=io(a);return await Promise.all(Gre(e).map(async function(y){let v=e.node(y);if(V.info("Position XBX => "+y+": ("+v.x,","+v.y,") width: ",v.width," height: ",v.height),v?.clusterNode)v.y+=g,V.info("A tainted cluster node XBX1",y,v.id,v.width,v.height,v.x,v.y,e.parent(y)),cr.get(v.id).node=v,eL(v);else if(e.children(y).length>0){V.info("A pure cluster node XBX1",y,v.id,v.x,v.y,v.width,v.height,e.parent(y)),v.height+=g,e.node(v.parentId);let x=v?.padding/2||0,b=v?.labelBBox?.height||0,w=b-x||0;V.debug("OffsetY",w,"labelHeight",b,"halfPadding",x),await Y5(u,v),cr.get(v.id).node=v}else{let x=e.node(v.parentId);v.y+=g/2,V.info("A regular node XBX1 - using the padding",v.id,"parent",v.parentId,v.width,v.height,v.x,v.y,"offsetY",v.offsetY,"parent",x,x?.offsetY,v),eL(v)}})),e.edges().forEach(function(y){let v=e.edge(y);V.info("Edge "+y.v+" -> "+y.w+": "+JSON.stringify(v),v),v.points.forEach(S=>S.y+=g/2);let x=e.node(y.v);var b=e.node(y.w);let w=J5(h,v,cr,r,x,b,n);Z5(v,w)}),e.nodes().forEach(function(y){let v=e.node(y);V.info(y,v.type,v.diff),v.isGroup&&(m=v.diff)}),V.warn("Returning from recursive render XAX",l,m),{elem:l,diff:m}},"recursiveRender"),yNe=o(async(t,e)=>{let r=new lr({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:t.config?.nodeSpacing||t.config?.flowchart?.nodeSpacing||t.nodeSpacing,ranksep:t.config?.rankSpacing||t.config?.flowchart?.rankSpacing||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=e.select("g");ew(n,t.markers,t.type,t.diagramId),cQ(),lK(),rK(),Ire(),t.nodes.forEach(a=>{r.setNode(a.id,{...a}),a.parentId&&r.setParent(a.id,a.parentId)}),V.debug("Edges:",t.edges),t.edges.forEach(a=>{if(a.start===a.end){let s=a.start,l=s+"---"+s+"---1",u=s+"---"+s+"---2",h=r.node(s);r.setNode(l,{domId:l,id:l,parentId:h.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(l,h.parentId),r.setNode(u,{domId:u,id:u,parentId:h.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(u,h.parentId);let f=structuredClone(a),d=structuredClone(a),p=structuredClone(a);f.label="",f.arrowTypeEnd="none",f.id=s+"-cyclic-special-1",d.arrowTypeEnd="none",d.id=s+"-cyclic-special-mid",p.label="",h.isGroup&&(f.fromCluster=s,p.toCluster=s),p.id=s+"-cyclic-special-2",r.setEdge(s,l,f,s+"-cyclic-special-0"),r.setEdge(l,u,d,s+"-cyclic-special-1"),r.setEdge(u,s,p,s+"-cyc{"use strict";hQ();ut();Bv={},gD=o(t=>{for(let e of t)Bv[e.name]=e},"registerLayoutLoaders"),vNe=o(()=>{gD([{name:"dagre",loader:o(async()=>await Promise.resolve().then(()=>(Hre(),Ure)),"loader")}])},"registerDefaultLayoutLoaders");vNe();sT=o(async(t,e)=>{if(!(t.layoutAlgorithm in Bv))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);let r=Bv[t.layoutAlgorithm];return(await r.loader()).render(t,e,uQ,{algorithm:r.algorithm})},"render"),Yre=o((t="",{fallback:e="dagre"}={})=>{if(t in Bv)return t;if(e in Bv)return V.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm")});var lT,xNe,bNe,yD=R(()=>{"use strict";Yn();ut();lT=o((t,e,r,n)=>{t.attr("class",r);let{width:i,height:a,x:s,y:l}=xNe(t,e);Sr(t,a,i,n);let u=bNe(s,l,i,a,e);t.attr("viewBox",u),V.debug(`viewBox configured: ${u} with padding: ${e}`)},"setupViewPortForSVG"),xNe=o((t,e)=>{let r=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:r.width+e*2,height:r.height+e*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),bNe=o((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox")});var wNe,TNe,Wre,qre=R(()=>{"use strict";Zt();_t();ut();L9();oT();yD();xr();f9();wNe=o(function(t,e){return e.db.getClasses()},"getClasses"),TNe=o(async function(t,e,r,n){V.info("REF0:"),V.info("Drawing state diagram (v2)",e);let{securityLevel:i,flowchart:a,layout:s}=de(),l;i==="sandbox"&&(l=$e("#i"+e));let u=i==="sandbox"?l.nodes()[0].contentDocument:document;V.debug("Before getData: ");let h=n.db.getData();V.debug("Data: ",h);let f=I5(e,i),d=h9();h.type=n.type,h.layoutAlgorithm=Yre(s),h.layoutAlgorithm==="dagre"&&s==="elk"&&V.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."),h.direction=d,h.nodeSpacing=a?.nodeSpacing||50,h.rankSpacing=a?.rankSpacing||50,h.markers=["point","circle","cross"],h.diagramId=e,V.debug("REF1:",h),await sT(h,f);let p=h.config.flowchart?.diagramPadding??8;Lt.insertTitle(f,"flowchartTitleText",a?.titleTopMargin||0,n.db.getDiagramTitle()),lT(f,p,"flowchart",a?.useMaxWidth||!1);for(let m of h.nodes){let g=$e(`#${e} [id="${m.id}"]`);if(!g||!m.link)continue;let y=u.createElementNS("http://www.w3.org/2000/svg","a");y.setAttributeNS("http://www.w3.org/2000/svg","class",m.cssClasses),y.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),i==="sandbox"?y.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):m.linkTarget&&y.setAttributeNS("http://www.w3.org/2000/svg","target",m.linkTarget);let v=g.insert(function(){return y},":first-child"),x=g.select(".label-container");x&&v.append(function(){return x.node()});let b=g.select(".label");b&&v.append(function(){return b.node()})}},"draw"),Wre={getClasses:wNe,draw:TNe}});var vD,Xre,jre=R(()=>{"use strict";vD=function(){var t=o(function(qi,ht,At,$t){for(At=At||{},$t=qi.length;$t--;At[qi[$t]]=ht);return At},"o"),e=[1,4],r=[1,3],n=[1,5],i=[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],a=[2,2],s=[1,13],l=[1,14],u=[1,15],h=[1,16],f=[1,23],d=[1,25],p=[1,26],m=[1,27],g=[1,49],y=[1,48],v=[1,29],x=[1,30],b=[1,31],w=[1,32],S=[1,33],T=[1,44],E=[1,46],_=[1,42],A=[1,47],L=[1,43],M=[1,50],N=[1,45],k=[1,51],I=[1,52],C=[1,34],O=[1,35],D=[1,36],P=[1,37],F=[1,57],B=[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],$=[1,61],z=[1,60],Y=[1,62],Q=[8,9,11,73,75],X=[1,88],ie=[1,93],j=[1,92],J=[1,89],Z=[1,85],H=[1,91],q=[1,87],K=[1,94],se=[1,90],ce=[1,95],ue=[1,86],te=[8,9,10,11,73,75],De=[8,9,10,11,44,73,75],oe=[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],ke=[8,9,11,42,58,73,75,86,99,102,103,106,108,111,112,113],Ie=[42,58,86,99,102,103,106,108,111,112,113],Se=[1,121],Ue=[1,120],Pe=[1,128],_e=[1,142],me=[1,143],W=[1,144],fe=[1,145],ge=[1,130],re=[1,132],he=[1,136],ne=[1,137],ae=[1,138],we=[1,139],Te=[1,140],Ce=[1,141],Ae=[1,146],Ge=[1,147],Me=[1,126],ye=[1,127],He=[1,134],ze=[1,129],Ze=[1,133],gt=[1,131],yt=[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],tt=[1,149],Ye=[8,9,11],Je=[8,9,10,11,14,42,58,86,102,103,106,108,111,112,113],Ve=[1,169],je=[1,165],kt=[1,166],at=[1,170],xt=[1,167],it=[1,168],dt=[75,113,116],lt=[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],It=[10,103],mt=[31,47,49,51,53,55,60,62,64,65,67,69,113,114,115],St=[1,235],gr=[1,233],xn=[1,237],jt=[1,231],rn=[1,232],Er=[1,234],Kn=[1,236],hn=[1,238],Qn=[1,255],on=[8,9,11,103],Rn=[8,9,10,11,58,81,102,103,106,107,108,109],Ha={trace:o(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:o(function(ht,At,$t,rt,Ot,pe,ur){var be=pe.length-1;switch(Ot){case 2:this.$=[];break;case 3:(!Array.isArray(pe[be])||pe[be].length>0)&&pe[be-1].push(pe[be]),this.$=pe[be-1];break;case 4:case 176:this.$=pe[be];break;case 11:rt.setDirection("TB"),this.$="TB";break;case 12:rt.setDirection(pe[be-1]),this.$=pe[be-1];break;case 27:this.$=pe[be-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=rt.addSubGraph(pe[be-6],pe[be-1],pe[be-4]);break;case 34:this.$=rt.addSubGraph(pe[be-3],pe[be-1],pe[be-3]);break;case 35:this.$=rt.addSubGraph(void 0,pe[be-1],void 0);break;case 37:this.$=pe[be].trim(),rt.setAccTitle(this.$);break;case 38:case 39:this.$=pe[be].trim(),rt.setAccDescription(this.$);break;case 43:rt.addLink(pe[be-2].stmt,pe[be],pe[be-1]),this.$={stmt:pe[be],nodes:pe[be].concat(pe[be-2].nodes)};break;case 44:rt.addLink(pe[be-3].stmt,pe[be-1],pe[be-2]),this.$={stmt:pe[be-1],nodes:pe[be-1].concat(pe[be-3].nodes)};break;case 45:this.$={stmt:pe[be-1],nodes:pe[be-1]};break;case 46:this.$={stmt:pe[be],nodes:pe[be]};break;case 47:this.$=[pe[be]];break;case 48:this.$=pe[be-4].concat(pe[be]);break;case 49:this.$=pe[be];break;case 50:this.$=pe[be-2],rt.setClass(pe[be-2],pe[be]);break;case 51:this.$=pe[be-3],rt.addVertex(pe[be-3],pe[be-1],"square");break;case 52:this.$=pe[be-3],rt.addVertex(pe[be-3],pe[be-1],"doublecircle");break;case 53:this.$=pe[be-5],rt.addVertex(pe[be-5],pe[be-2],"circle");break;case 54:this.$=pe[be-3],rt.addVertex(pe[be-3],pe[be-1],"ellipse");break;case 55:this.$=pe[be-3],rt.addVertex(pe[be-3],pe[be-1],"stadium");break;case 56:this.$=pe[be-3],rt.addVertex(pe[be-3],pe[be-1],"subroutine");break;case 57:this.$=pe[be-7],rt.addVertex(pe[be-7],pe[be-1],"rect",void 0,void 0,void 0,Object.fromEntries([[pe[be-5],pe[be-3]]]));break;case 58:this.$=pe[be-3],rt.addVertex(pe[be-3],pe[be-1],"cylinder");break;case 59:this.$=pe[be-3],rt.addVertex(pe[be-3],pe[be-1],"round");break;case 60:this.$=pe[be-3],rt.addVertex(pe[be-3],pe[be-1],"diamond");break;case 61:this.$=pe[be-5],rt.addVertex(pe[be-5],pe[be-2],"hexagon");break;case 62:this.$=pe[be-3],rt.addVertex(pe[be-3],pe[be-1],"odd");break;case 63:this.$=pe[be-3],rt.addVertex(pe[be-3],pe[be-1],"trapezoid");break;case 64:this.$=pe[be-3],rt.addVertex(pe[be-3],pe[be-1],"inv_trapezoid");break;case 65:this.$=pe[be-3],rt.addVertex(pe[be-3],pe[be-1],"lean_right");break;case 66:this.$=pe[be-3],rt.addVertex(pe[be-3],pe[be-1],"lean_left");break;case 67:this.$=pe[be],rt.addVertex(pe[be]);break;case 68:pe[be-1].text=pe[be],this.$=pe[be-1];break;case 69:case 70:pe[be-2].text=pe[be-1],this.$=pe[be-2];break;case 71:this.$=pe[be];break;case 72:var Ir=rt.destructLink(pe[be],pe[be-2]);this.$={type:Ir.type,stroke:Ir.stroke,length:Ir.length,text:pe[be-1]};break;case 73:this.$={text:pe[be],type:"text"};break;case 74:this.$={text:pe[be-1].text+""+pe[be],type:pe[be-1].type};break;case 75:this.$={text:pe[be],type:"string"};break;case 76:this.$={text:pe[be],type:"markdown"};break;case 77:var Ir=rt.destructLink(pe[be]);this.$={type:Ir.type,stroke:Ir.stroke,length:Ir.length};break;case 78:this.$=pe[be-1];break;case 79:this.$={text:pe[be],type:"text"};break;case 80:this.$={text:pe[be-1].text+""+pe[be],type:pe[be-1].type};break;case 81:this.$={text:pe[be],type:"string"};break;case 82:case 97:this.$={text:pe[be],type:"markdown"};break;case 94:this.$={text:pe[be],type:"text"};break;case 95:this.$={text:pe[be-1].text+""+pe[be],type:pe[be-1].type};break;case 96:this.$={text:pe[be],type:"text"};break;case 98:this.$=pe[be-4],rt.addClass(pe[be-2],pe[be]);break;case 99:this.$=pe[be-4],rt.setClass(pe[be-2],pe[be]);break;case 100:case 108:this.$=pe[be-1],rt.setClickEvent(pe[be-1],pe[be]);break;case 101:case 109:this.$=pe[be-3],rt.setClickEvent(pe[be-3],pe[be-2]),rt.setTooltip(pe[be-3],pe[be]);break;case 102:this.$=pe[be-2],rt.setClickEvent(pe[be-2],pe[be-1],pe[be]);break;case 103:this.$=pe[be-4],rt.setClickEvent(pe[be-4],pe[be-3],pe[be-2]),rt.setTooltip(pe[be-4],pe[be]);break;case 104:this.$=pe[be-2],rt.setLink(pe[be-2],pe[be]);break;case 105:this.$=pe[be-4],rt.setLink(pe[be-4],pe[be-2]),rt.setTooltip(pe[be-4],pe[be]);break;case 106:this.$=pe[be-4],rt.setLink(pe[be-4],pe[be-2],pe[be]);break;case 107:this.$=pe[be-6],rt.setLink(pe[be-6],pe[be-4],pe[be]),rt.setTooltip(pe[be-6],pe[be-2]);break;case 110:this.$=pe[be-1],rt.setLink(pe[be-1],pe[be]);break;case 111:this.$=pe[be-3],rt.setLink(pe[be-3],pe[be-2]),rt.setTooltip(pe[be-3],pe[be]);break;case 112:this.$=pe[be-3],rt.setLink(pe[be-3],pe[be-2],pe[be]);break;case 113:this.$=pe[be-5],rt.setLink(pe[be-5],pe[be-4],pe[be]),rt.setTooltip(pe[be-5],pe[be-2]);break;case 114:this.$=pe[be-4],rt.addVertex(pe[be-2],void 0,void 0,pe[be]);break;case 115:this.$=pe[be-4],rt.updateLink([pe[be-2]],pe[be]);break;case 116:this.$=pe[be-4],rt.updateLink(pe[be-2],pe[be]);break;case 117:this.$=pe[be-8],rt.updateLinkInterpolate([pe[be-6]],pe[be-2]),rt.updateLink([pe[be-6]],pe[be]);break;case 118:this.$=pe[be-8],rt.updateLinkInterpolate(pe[be-6],pe[be-2]),rt.updateLink(pe[be-6],pe[be]);break;case 119:this.$=pe[be-6],rt.updateLinkInterpolate([pe[be-4]],pe[be]);break;case 120:this.$=pe[be-6],rt.updateLinkInterpolate(pe[be-4],pe[be]);break;case 121:case 123:this.$=[pe[be]];break;case 122:case 124:pe[be-2].push(pe[be]),this.$=pe[be-2];break;case 126:this.$=pe[be-1]+pe[be];break;case 174:this.$=pe[be];break;case 175:this.$=pe[be-1]+""+pe[be];break;case 177:this.$=pe[be-1]+""+pe[be];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:e,10:r,12:n},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:l,10:u,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:f,33:24,34:d,36:p,38:m,40:28,41:38,42:g,43:39,45:40,58:y,81:v,82:x,83:b,84:w,85:S,86:T,99:E,102:_,103:A,106:L,108:M,110:41,111:N,112:k,113:I,118:C,119:O,120:D,121:P},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,54],9:[1,55],10:F,15:53,18:56},t(B,[2,3]),t(B,[2,4]),t(B,[2,5]),t(B,[2,6]),t(B,[2,7]),t(B,[2,8]),{8:$,9:z,11:Y,21:58,39:59,70:63,73:[1,64],75:[1,65]},{8:$,9:z,11:Y,21:66},{8:$,9:z,11:Y,21:67},{8:$,9:z,11:Y,21:68},{8:$,9:z,11:Y,21:69},{8:$,9:z,11:Y,21:70},{8:$,9:z,10:[1,71],11:Y,21:72},t(B,[2,36]),{35:[1,73]},{37:[1,74]},t(B,[2,39]),t(Q,[2,46],{18:75,10:F}),{10:[1,76]},{10:[1,77]},{10:[1,78]},{10:[1,79]},{14:X,42:ie,58:j,77:[1,83],86:J,92:[1,80],94:[1,81],98:82,102:Z,103:H,106:q,108:K,111:se,112:ce,113:ue,117:84},t(B,[2,178]),t(B,[2,179]),t(B,[2,180]),t(B,[2,181]),t(te,[2,47]),t(te,[2,49],{44:[1,96]}),t(De,[2,67],{110:109,29:[1,97],42:g,46:[1,98],48:[1,99],50:[1,100],52:[1,101],54:[1,102],56:[1,103],58:y,61:[1,104],63:[1,105],65:[1,106],66:[1,107],68:[1,108],86:T,99:E,102:_,103:A,106:L,108:M,111:N,112:k,113:I}),t(oe,[2,174]),t(oe,[2,135]),t(oe,[2,136]),t(oe,[2,137]),t(oe,[2,138]),t(oe,[2,139]),t(oe,[2,140]),t(oe,[2,141]),t(oe,[2,142]),t(oe,[2,143]),t(oe,[2,144]),t(oe,[2,145]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,110]},t(ke,[2,26],{18:111,10:F}),t(B,[2,27]),{40:112,41:38,42:g,43:39,45:40,58:y,86:T,99:E,102:_,103:A,106:L,108:M,110:41,111:N,112:k,113:I},t(B,[2,40]),t(B,[2,41]),t(B,[2,42]),t(Ie,[2,71],{71:113,60:[1,115],72:[1,114]}),{74:116,76:117,77:[1,118],78:[1,119],113:Se,116:Ue},t([42,58,60,72,86,99,102,103,106,108,111,112,113],[2,77]),t(B,[2,28]),t(B,[2,29]),t(B,[2,30]),t(B,[2,31]),t(B,[2,32]),{10:Pe,12:_e,14:me,27:W,28:122,32:fe,42:ge,58:re,73:he,77:[1,124],78:[1,125],80:135,81:ne,82:ae,83:we,84:Te,85:Ce,86:Ae,87:Ge,88:123,102:Me,106:ye,108:He,111:ze,112:Ze,113:gt},t(yt,a,{5:148}),t(B,[2,37]),t(B,[2,38]),t(Q,[2,45],{42:tt}),{42:g,45:150,58:y,86:T,99:E,102:_,103:A,106:L,108:M,110:41,111:N,112:k,113:I},{99:[1,151],100:152,102:[1,153]},{42:g,45:154,58:y,86:T,99:E,102:_,103:A,106:L,108:M,110:41,111:N,112:k,113:I},{42:g,45:155,58:y,86:T,99:E,102:_,103:A,106:L,108:M,110:41,111:N,112:k,113:I},t(Ye,[2,100],{10:[1,156],93:[1,157]}),{77:[1,158]},t(Ye,[2,108],{117:160,10:[1,159],14:X,42:ie,58:j,86:J,102:Z,103:H,106:q,108:K,111:se,112:ce,113:ue}),t(Ye,[2,110],{10:[1,161]}),t(Je,[2,176]),t(Je,[2,163]),t(Je,[2,164]),t(Je,[2,165]),t(Je,[2,166]),t(Je,[2,167]),t(Je,[2,168]),t(Je,[2,169]),t(Je,[2,170]),t(Je,[2,171]),t(Je,[2,172]),t(Je,[2,173]),{42:g,45:162,58:y,86:T,99:E,102:_,103:A,106:L,108:M,110:41,111:N,112:k,113:I},{30:163,65:Ve,77:je,78:kt,79:164,113:at,114:xt,115:it},{30:171,65:Ve,77:je,78:kt,79:164,113:at,114:xt,115:it},{30:173,48:[1,172],65:Ve,77:je,78:kt,79:164,113:at,114:xt,115:it},{30:174,65:Ve,77:je,78:kt,79:164,113:at,114:xt,115:it},{30:175,65:Ve,77:je,78:kt,79:164,113:at,114:xt,115:it},{30:176,65:Ve,77:je,78:kt,79:164,113:at,114:xt,115:it},{106:[1,177]},{30:178,65:Ve,77:je,78:kt,79:164,113:at,114:xt,115:it},{30:179,63:[1,180],65:Ve,77:je,78:kt,79:164,113:at,114:xt,115:it},{30:181,65:Ve,77:je,78:kt,79:164,113:at,114:xt,115:it},{30:182,65:Ve,77:je,78:kt,79:164,113:at,114:xt,115:it},{30:183,65:Ve,77:je,78:kt,79:164,113:at,114:xt,115:it},t(oe,[2,175]),t(i,[2,20]),t(ke,[2,25]),t(Q,[2,43],{18:184,10:F}),t(Ie,[2,68],{10:[1,185]}),{10:[1,186]},{30:187,65:Ve,77:je,78:kt,79:164,113:at,114:xt,115:it},{75:[1,188],76:189,113:Se,116:Ue},t(dt,[2,73]),t(dt,[2,75]),t(dt,[2,76]),t(dt,[2,161]),t(dt,[2,162]),{8:$,9:z,10:Pe,11:Y,12:_e,14:me,21:191,27:W,29:[1,190],32:fe,42:ge,58:re,73:he,80:135,81:ne,82:ae,83:we,84:Te,85:Ce,86:Ae,87:Ge,88:192,102:Me,106:ye,108:He,111:ze,112:Ze,113:gt},t(lt,[2,94]),t(lt,[2,96]),t(lt,[2,97]),t(lt,[2,150]),t(lt,[2,151]),t(lt,[2,152]),t(lt,[2,153]),t(lt,[2,154]),t(lt,[2,155]),t(lt,[2,156]),t(lt,[2,157]),t(lt,[2,158]),t(lt,[2,159]),t(lt,[2,160]),t(lt,[2,83]),t(lt,[2,84]),t(lt,[2,85]),t(lt,[2,86]),t(lt,[2,87]),t(lt,[2,88]),t(lt,[2,89]),t(lt,[2,90]),t(lt,[2,91]),t(lt,[2,92]),t(lt,[2,93]),{6:11,7:12,8:s,9:l,10:u,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:f,32:[1,193],33:24,34:d,36:p,38:m,40:28,41:38,42:g,43:39,45:40,58:y,81:v,82:x,83:b,84:w,85:S,86:T,99:E,102:_,103:A,106:L,108:M,110:41,111:N,112:k,113:I,118:C,119:O,120:D,121:P},{10:F,18:194},{10:[1,195],42:g,58:y,86:T,99:E,102:_,103:A,106:L,108:M,110:109,111:N,112:k,113:I},{10:[1,196]},{10:[1,197],103:[1,198]},t(It,[2,121]),{10:[1,199],42:g,58:y,86:T,99:E,102:_,103:A,106:L,108:M,110:109,111:N,112:k,113:I},{10:[1,200],42:g,58:y,86:T,99:E,102:_,103:A,106:L,108:M,110:109,111:N,112:k,113:I},{77:[1,201]},t(Ye,[2,102],{10:[1,202]}),t(Ye,[2,104],{10:[1,203]}),{77:[1,204]},t(Je,[2,177]),{77:[1,205],95:[1,206]},t(te,[2,50],{110:109,42:g,58:y,86:T,99:E,102:_,103:A,106:L,108:M,111:N,112:k,113:I}),{31:[1,207],65:Ve,79:208,113:at,114:xt,115:it},t(mt,[2,79]),t(mt,[2,81]),t(mt,[2,82]),t(mt,[2,146]),t(mt,[2,147]),t(mt,[2,148]),t(mt,[2,149]),{47:[1,209],65:Ve,79:208,113:at,114:xt,115:it},{30:210,65:Ve,77:je,78:kt,79:164,113:at,114:xt,115:it},{49:[1,211],65:Ve,79:208,113:at,114:xt,115:it},{51:[1,212],65:Ve,79:208,113:at,114:xt,115:it},{53:[1,213],65:Ve,79:208,113:at,114:xt,115:it},{55:[1,214],65:Ve,79:208,113:at,114:xt,115:it},{58:[1,215]},{62:[1,216],65:Ve,79:208,113:at,114:xt,115:it},{64:[1,217],65:Ve,79:208,113:at,114:xt,115:it},{30:218,65:Ve,77:je,78:kt,79:164,113:at,114:xt,115:it},{31:[1,219],65:Ve,79:208,113:at,114:xt,115:it},{65:Ve,67:[1,220],69:[1,221],79:208,113:at,114:xt,115:it},{65:Ve,67:[1,223],69:[1,222],79:208,113:at,114:xt,115:it},t(Q,[2,44],{42:tt}),t(Ie,[2,70]),t(Ie,[2,69]),{60:[1,224],65:Ve,79:208,113:at,114:xt,115:it},t(Ie,[2,72]),t(dt,[2,74]),{30:225,65:Ve,77:je,78:kt,79:164,113:at,114:xt,115:it},t(yt,a,{5:226}),t(lt,[2,95]),t(B,[2,35]),{41:227,42:g,43:39,45:40,58:y,86:T,99:E,102:_,103:A,106:L,108:M,110:41,111:N,112:k,113:I},{10:St,58:gr,81:xn,89:228,102:jt,104:229,105:230,106:rn,107:Er,108:Kn,109:hn},{10:St,58:gr,81:xn,89:239,101:[1,240],102:jt,104:229,105:230,106:rn,107:Er,108:Kn,109:hn},{10:St,58:gr,81:xn,89:241,101:[1,242],102:jt,104:229,105:230,106:rn,107:Er,108:Kn,109:hn},{102:[1,243]},{10:St,58:gr,81:xn,89:244,102:jt,104:229,105:230,106:rn,107:Er,108:Kn,109:hn},{42:g,45:245,58:y,86:T,99:E,102:_,103:A,106:L,108:M,110:41,111:N,112:k,113:I},t(Ye,[2,101]),{77:[1,246]},{77:[1,247],95:[1,248]},t(Ye,[2,109]),t(Ye,[2,111],{10:[1,249]}),t(Ye,[2,112]),t(De,[2,51]),t(mt,[2,80]),t(De,[2,52]),{49:[1,250],65:Ve,79:208,113:at,114:xt,115:it},t(De,[2,59]),t(De,[2,54]),t(De,[2,55]),t(De,[2,56]),{106:[1,251]},t(De,[2,58]),t(De,[2,60]),{64:[1,252],65:Ve,79:208,113:at,114:xt,115:it},t(De,[2,62]),t(De,[2,63]),t(De,[2,65]),t(De,[2,64]),t(De,[2,66]),t([10,42,58,86,99,102,103,106,108,111,112,113],[2,78]),{31:[1,253],65:Ve,79:208,113:at,114:xt,115:it},{6:11,7:12,8:s,9:l,10:u,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:f,32:[1,254],33:24,34:d,36:p,38:m,40:28,41:38,42:g,43:39,45:40,58:y,81:v,82:x,83:b,84:w,85:S,86:T,99:E,102:_,103:A,106:L,108:M,110:41,111:N,112:k,113:I,118:C,119:O,120:D,121:P},t(te,[2,48]),t(Ye,[2,114],{103:Qn}),t(on,[2,123],{105:256,10:St,58:gr,81:xn,102:jt,106:rn,107:Er,108:Kn,109:hn}),t(Rn,[2,125]),t(Rn,[2,127]),t(Rn,[2,128]),t(Rn,[2,129]),t(Rn,[2,130]),t(Rn,[2,131]),t(Rn,[2,132]),t(Rn,[2,133]),t(Rn,[2,134]),t(Ye,[2,115],{103:Qn}),{10:[1,257]},t(Ye,[2,116],{103:Qn}),{10:[1,258]},t(It,[2,122]),t(Ye,[2,98],{103:Qn}),t(Ye,[2,99],{110:109,42:g,58:y,86:T,99:E,102:_,103:A,106:L,108:M,111:N,112:k,113:I}),t(Ye,[2,103]),t(Ye,[2,105],{10:[1,259]}),t(Ye,[2,106]),{95:[1,260]},{49:[1,261]},{60:[1,262]},{64:[1,263]},{8:$,9:z,11:Y,21:264},t(B,[2,34]),{10:St,58:gr,81:xn,102:jt,104:265,105:230,106:rn,107:Er,108:Kn,109:hn},t(Rn,[2,126]),{14:X,42:ie,58:j,86:J,98:266,102:Z,103:H,106:q,108:K,111:se,112:ce,113:ue,117:84},{14:X,42:ie,58:j,86:J,98:267,102:Z,103:H,106:q,108:K,111:se,112:ce,113:ue,117:84},{95:[1,268]},t(Ye,[2,113]),t(De,[2,53]),{30:269,65:Ve,77:je,78:kt,79:164,113:at,114:xt,115:it},t(De,[2,61]),t(yt,a,{5:270}),t(on,[2,124],{105:256,10:St,58:gr,81:xn,102:jt,106:rn,107:Er,108:Kn,109:hn}),t(Ye,[2,119],{117:160,10:[1,271],14:X,42:ie,58:j,86:J,102:Z,103:H,106:q,108:K,111:se,112:ce,113:ue}),t(Ye,[2,120],{117:160,10:[1,272],14:X,42:ie,58:j,86:J,102:Z,103:H,106:q,108:K,111:se,112:ce,113:ue}),t(Ye,[2,107]),{31:[1,273],65:Ve,79:208,113:at,114:xt,115:it},{6:11,7:12,8:s,9:l,10:u,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:f,32:[1,274],33:24,34:d,36:p,38:m,40:28,41:38,42:g,43:39,45:40,58:y,81:v,82:x,83:b,84:w,85:S,86:T,99:E,102:_,103:A,106:L,108:M,110:41,111:N,112:k,113:I,118:C,119:O,120:D,121:P},{10:St,58:gr,81:xn,89:275,102:jt,104:229,105:230,106:rn,107:Er,108:Kn,109:hn},{10:St,58:gr,81:xn,89:276,102:jt,104:229,105:230,106:rn,107:Er,108:Kn,109:hn},t(De,[2,57]),t(B,[2,33]),t(Ye,[2,117],{103:Qn}),t(Ye,[2,118],{103:Qn})],defaultActions:{},parseError:o(function(ht,At){if(At.recoverable)this.trace(ht);else{var $t=new Error(ht);throw $t.hash=At,$t}},"parseError"),parse:o(function(ht){var At=this,$t=[0],rt=[],Ot=[null],pe=[],ur=this.table,be="",Ir=0,Xc=0,M1=0,_b=2,I1=1,O1=pe.slice.call(arguments,1),ci=Object.create(this.lexer),ko={yy:{}};for(var ih in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ih)&&(ko.yy[ih]=this.yy[ih]);ci.setInput(ht,ko.yy),ko.yy.lexer=ci,ko.yy.parser=this,typeof ci.yylloc>"u"&&(ci.yylloc={});var Us=ci.yylloc;pe.push(Us);var ah=ci.options&&ci.options.ranges;typeof ko.yy.parseError=="function"?this.parseError=ko.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Lb(La){$t.length=$t.length-2*La,Ot.length=Ot.length-La,pe.length=pe.length-La}o(Lb,"popStack");function P1(){var La;return La=rt.pop()||ci.lex()||I1,typeof La!="number"&&(La instanceof Array&&(rt=La,La=rt.pop()),La=At.symbols_[La]||La),La}o(P1,"lex");for(var sa,jc,Kc,us,_i,Wl,sh={},zf,Hs,B1,Gf;;){if(Kc=$t[$t.length-1],this.defaultActions[Kc]?us=this.defaultActions[Kc]:((sa===null||typeof sa>"u")&&(sa=P1()),us=ur[Kc]&&ur[Kc][sa]),typeof us>"u"||!us.length||!us[0]){var F1="";Gf=[];for(zf in ur[Kc])this.terminals_[zf]&&zf>_b&&Gf.push("'"+this.terminals_[zf]+"'");ci.showPosition?F1="Parse error on line "+(Ir+1)+`: +`+ci.showPosition()+` +Expecting `+Gf.join(", ")+", got '"+(this.terminals_[sa]||sa)+"'":F1="Parse error on line "+(Ir+1)+": Unexpected "+(sa==I1?"end of input":"'"+(this.terminals_[sa]||sa)+"'"),this.parseError(F1,{text:ci.match,token:this.terminals_[sa]||sa,line:ci.yylineno,loc:Us,expected:Gf})}if(us[0]instanceof Array&&us.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Kc+", token: "+sa);switch(us[0]){case 1:$t.push(sa),Ot.push(ci.yytext),pe.push(ci.yylloc),$t.push(us[1]),sa=null,jc?(sa=jc,jc=null):(Xc=ci.yyleng,be=ci.yytext,Ir=ci.yylineno,Us=ci.yylloc,M1>0&&M1--);break;case 2:if(Hs=this.productions_[us[1]][1],sh.$=Ot[Ot.length-Hs],sh._$={first_line:pe[pe.length-(Hs||1)].first_line,last_line:pe[pe.length-1].last_line,first_column:pe[pe.length-(Hs||1)].first_column,last_column:pe[pe.length-1].last_column},ah&&(sh._$.range=[pe[pe.length-(Hs||1)].range[0],pe[pe.length-1].range[1]]),Wl=this.performAction.apply(sh,[be,Xc,Ir,ko.yy,us[1],Ot,pe].concat(O1)),typeof Wl<"u")return Wl;Hs&&($t=$t.slice(0,-1*Hs*2),Ot=Ot.slice(0,-1*Hs),pe=pe.slice(0,-1*Hs)),$t.push(this.productions_[us[1]][0]),Ot.push(sh.$),pe.push(sh._$),B1=ur[$t[$t.length-2]][$t[$t.length-1]],$t.push(B1);break;case 3:return!0}}return!0},"parse")},_a=function(){var qi={EOF:1,parseError:o(function(At,$t){if(this.yy.parser)this.yy.parser.parseError(At,$t);else throw new Error(At)},"parseError"),setInput:o(function(ht,At){return this.yy=At||this.yy||{},this._input=ht,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var ht=this._input[0];this.yytext+=ht,this.yyleng++,this.offset++,this.match+=ht,this.matched+=ht;var At=ht.match(/(?:\r\n?|\n).*/g);return At?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ht},"input"),unput:o(function(ht){var At=ht.length,$t=ht.split(/(?:\r\n?|\n)/g);this._input=ht+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-At),this.offset-=At;var rt=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),$t.length-1&&(this.yylineno-=$t.length-1);var Ot=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:$t?($t.length===rt.length?this.yylloc.first_column:0)+rt[rt.length-$t.length].length-$t[0].length:this.yylloc.first_column-At},this.options.ranges&&(this.yylloc.range=[Ot[0],Ot[0]+this.yyleng-At]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(ht){this.unput(this.match.slice(ht))},"less"),pastInput:o(function(){var ht=this.matched.substr(0,this.matched.length-this.match.length);return(ht.length>20?"...":"")+ht.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var ht=this.match;return ht.length<20&&(ht+=this._input.substr(0,20-ht.length)),(ht.substr(0,20)+(ht.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var ht=this.pastInput(),At=new Array(ht.length+1).join("-");return ht+this.upcomingInput()+` +`+At+"^"},"showPosition"),test_match:o(function(ht,At){var $t,rt,Ot;if(this.options.backtrack_lexer&&(Ot={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},this.options.ranges&&(Ot.yylloc.range=this.yylloc.range.slice(0))),rt=ht[0].match(/(?:\r\n?|\n).*/g),rt&&(this.yylineno+=rt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:rt?rt[rt.length-1].length-rt[rt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+ht[0].length},this.yytext+=ht[0],this.match+=ht[0],this.matches=ht,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(ht[0].length),this.matched+=ht[0],$t=this.performAction.call(this,this.yy,this,At,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),$t)return $t;if(this._backtrack){for(var pe in Ot)this[pe]=Ot[pe];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var ht,At,$t,rt;this._more||(this.yytext="",this.match="");for(var Ot=this._currentRules(),pe=0;peAt[0].length)){if(At=$t,rt=pe,this.options.backtrack_lexer){if(ht=this.test_match($t,Ot[pe]),ht!==!1)return ht;if(this._backtrack){At=!1;continue}else return!1}else if(!this.options.flex)break}return At?(ht=this.test_match(At,Ot[rt]),ht!==!1?ht:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var At=this.next();return At||this.lex()},"lex"),begin:o(function(At){this.conditionStack.push(At)},"begin"),popState:o(function(){var At=this.conditionStack.length-1;return At>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(At){return At=this.conditionStack.length-1-Math.abs(At||0),At>=0?this.conditionStack[At]:"INITIAL"},"topState"),pushState:o(function(At){this.begin(At)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:o(function(At,$t,rt,Ot){var pe=Ot;switch(rt){case 0:return this.begin("acc_title"),34;break;case 1:return this.popState(),"acc_title_value";break;case 2:return this.begin("acc_descr"),36;break;case 3:return this.popState(),"acc_descr_value";break;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:return At.lex.firstGraph()&&this.begin("dir"),12;break;case 30:return At.lex.firstGraph()&&this.begin("dir"),12;break;case 31:return At.lex.firstGraph()&&this.begin("dir"),12;break;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:return this.popState(),13;break;case 39:return this.popState(),14;break;case 40:return this.popState(),14;break;case 41:return this.popState(),14;break;case 42:return this.popState(),14;break;case 43:return this.popState(),14;break;case 44:return this.popState(),14;break;case 45:return this.popState(),14;break;case 46:return this.popState(),14;break;case 47:return this.popState(),14;break;case 48:return this.popState(),14;break;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:return this.popState(),75;break;case 62:return this.pushState("edgeText"),73;break;case 63:return 116;case 64:return this.popState(),75;break;case 65:return this.pushState("thickEdgeText"),73;break;case 66:return 116;case 67:return this.popState(),75;break;case 68:return this.pushState("dottedEdgeText"),73;break;case 69:return 116;case 70:return 75;case 71:return this.popState(),51;break;case 72:return"TEXT";case 73:return this.pushState("ellipseText"),50;break;case 74:return this.popState(),53;break;case 75:return this.pushState("text"),52;break;case 76:return this.popState(),55;break;case 77:return this.pushState("text"),54;break;case 78:return 56;case 79:return this.pushState("text"),65;break;case 80:return this.popState(),62;break;case 81:return this.pushState("text"),61;break;case 82:return this.popState(),47;break;case 83:return this.pushState("text"),46;break;case 84:return this.popState(),67;break;case 85:return this.popState(),69;break;case 86:return 114;case 87:return this.pushState("trapText"),66;break;case 88:return this.pushState("trapText"),68;break;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:return this.popState(),60;break;case 101:return this.pushState("text"),60;break;case 102:return this.popState(),49;break;case 103:return this.pushState("text"),48;break;case 104:return this.popState(),31;break;case 105:return this.pushState("text"),29;break;case 106:return this.popState(),64;break;case 107:return this.pushState("text"),63;break;case 108:return"TEXT";case 109:return"QUOTE";case 110:return 9;case 111:return 10;case 112:return 11}},"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:!1},callbackname:{rules:[8,9,10,15,18,70,73,75,77,81,83,87,88,101,103,105,107],inclusive:!1},href:{rules:[15,18,70,73,75,77,81,83,87,88,101,103,105,107],inclusive:!1},click:{rules:[15,18,27,28,70,73,75,77,81,83,87,88,101,103,105,107],inclusive:!1},dottedEdgeText:{rules:[15,18,67,69,70,73,75,77,81,83,87,88,101,103,105,107],inclusive:!1},thickEdgeText:{rules:[15,18,64,66,70,73,75,77,81,83,87,88,101,103,105,107],inclusive:!1},edgeText:{rules:[15,18,61,63,70,73,75,77,81,83,87,88,101,103,105,107],inclusive:!1},trapText:{rules:[15,18,70,73,75,77,81,83,84,85,86,87,88,101,103,105,107],inclusive:!1},ellipseText:{rules:[15,18,70,71,72,73,75,77,81,83,87,88,101,103,105,107],inclusive:!1},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:!1},vertex:{rules:[15,18,70,73,75,77,81,83,87,88,101,103,105,107],inclusive:!1},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:!1},acc_descr_multiline:{rules:[5,6,15,18,70,73,75,77,81,83,87,88,101,103,105,107],inclusive:!1},acc_descr:{rules:[3,15,18,70,73,75,77,81,83,87,88,101,103,105,107],inclusive:!1},acc_title:{rules:[1,15,18,70,73,75,77,81,83,87,88,101,103,105,107],inclusive:!1},md_string:{rules:[13,14,15,18,70,73,75,77,81,83,87,88,101,103,105,107],inclusive:!1},string:{rules:[15,16,17,18,70,73,75,77,81,83,87,88,101,103,105,107],inclusive:!1},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:!0}}};return qi}();Ha.lexer=_a;function To(){this.yy={}}return o(To,"Parser"),To.prototype=Ha,Ha.Parser=To,new To}();vD.parser=vD;Xre=vD});var kNe,ENe,Kre,Qre=R(()=>{"use strict";al();kNe=o((t,e)=>{let r=X1,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ws(n,i,a,e)},"fade"),ENe=o(t=>`.label { + font-family: ${t.fontFamily}; + color: ${t.nodeTextColor||t.textColor}; } .cluster-label text { - fill: ${i.titleColor}; + fill: ${t.titleColor}; } - .cluster-label span,p { - color: ${i.titleColor}; + .cluster-label span { + color: ${t.titleColor}; + } + .cluster-label span p { + background-color: transparent; } - .label text,span,p { - fill: ${i.nodeTextColor||i.textColor}; - color: ${i.nodeTextColor||i.textColor}; + .label text,span { + fill: ${t.nodeTextColor||t.textColor}; + color: ${t.nodeTextColor||t.textColor}; } .node rect, @@ -146,11 +435,11 @@ Expecting `+Vo.join(", ")+", got '"+(this.terminals_[v1]||v1)+"'":fx="Parse erro .node ellipse, .node polygon, .node path { - fill: ${i.mainBkg}; - stroke: ${i.nodeBorder}; + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; stroke-width: 1px; } - .flowchart-label text { + .rough-node .label text , .node .label text { text-anchor: middle; } // .flowchart-label .text-outer-tspan { @@ -160,6 +449,12 @@ Expecting `+Vo.join(", ")+", got '"+(this.terminals_[v1]||v1)+"'":fx="Parse erro // text-anchor: start; // } + .node .katex path { + fill: #000; + stroke: #000; + stroke-width: 1px; + } + .node .label { text-align: center; } @@ -168,44 +463,53 @@ Expecting `+Vo.join(", ")+", got '"+(this.terminals_[v1]||v1)+"'":fx="Parse erro } .arrowheadPath { - fill: ${i.arrowheadColor}; + fill: ${t.arrowheadColor}; } .edgePath .path { - stroke: ${i.lineColor}; + stroke: ${t.lineColor}; stroke-width: 2.0px; } .flowchart-link { - stroke: ${i.lineColor}; + stroke: ${t.lineColor}; fill: none; } .edgeLabel { - background-color: ${i.edgeLabelBackground}; + background-color: ${t.edgeLabelBackground}; + p { + background-color: ${t.edgeLabelBackground}; + } rect { opacity: 0.5; - background-color: ${i.edgeLabelBackground}; - fill: ${i.edgeLabelBackground}; + background-color: ${t.edgeLabelBackground}; + fill: ${t.edgeLabelBackground}; } text-align: center; } + /* For html labels only */ + .labelBkg { + background-color: ${kNe(t.edgeLabelBackground,.5)}; + // background-color: + } + .cluster rect { - fill: ${i.clusterBkg}; - stroke: ${i.clusterBorder}; + fill: ${t.clusterBkg}; + stroke: ${t.clusterBorder}; stroke-width: 1px; } .cluster text { - fill: ${i.titleColor}; + fill: ${t.titleColor}; } - .cluster span,p { - color: ${i.titleColor}; + .cluster span { + color: ${t.titleColor}; } /* .cluster div { - color: ${i.titleColor}; + color: ${t.titleColor}; } */ div.mermaidTooltip { @@ -213,10 +517,10 @@ Expecting `+Vo.join(", ")+", got '"+(this.terminals_[v1]||v1)+"'":fx="Parse erro text-align: center; max-width: 200px; padding: 2px; - font-family: ${i.fontFamily}; + font-family: ${t.fontFamily}; font-size: 12px; - background: ${i.tertiaryColor}; - border: 1px solid ${i.border2}; + background: ${t.tertiaryColor}; + border: 1px solid ${t.border2}; border-radius: 2px; pointer-events: none; z-index: 100; @@ -225,60 +529,198 @@ Expecting `+Vo.join(", ")+", got '"+(this.terminals_[v1]||v1)+"'":fx="Parse erro .flowchartTitleText { text-anchor: middle; font-size: 18px; - fill: ${i.textColor}; - } -`,kFt=Object.freeze(Object.defineProperty({__proto__:null,diagram:{parser:Dde,db:ix,renderer:S0e,styles:rRe,init:i=>{i.flowchart||(i.flowchart={}),i.flowchart.arrowMarkerAbsolute=i.arrowMarkerAbsolute,JBt.setConf(i.flowchart),ix.clear(),ix.setGen("gen-1")}}},Symbol.toStringTag,{value:"Module"})),xFt=Object.freeze(Object.defineProperty({__proto__:null,diagram:{parser:Dde,db:ix,renderer:S0e,styles:rRe,init:i=>{i.flowchart||(i.flowchart={}),i.flowchart.arrowMarkerAbsolute=i.arrowMarkerAbsolute,pIe({flowchart:{arrowMarkerAbsolute:i.arrowMarkerAbsolute}}),S0e.setConf(i.flowchart),ix.clear(),ix.setGen("gen-2")}}},Symbol.toStringTag,{value:"Module"}));var A0e=function(){var i=function(De,he,Ie,ee){for(Ie=Ie||{},ee=De.length;ee--;Ie[De[ee]]=he);return Ie},a=[1,2],f=[1,5],p=[6,9,11,23,25,27,29,30,31,51],w=[1,17],y=[1,18],b=[1,19],E=[1,20],S=[1,21],N=[1,22],B=[1,25],R=[1,30],j=[1,31],$=[1,32],V=[1,33],Q=[6,9,11,15,20,23,25,27,29,30,31,44,45,46,47,51],oe=[1,45],ce=[30,31,48,49],se=[4,6,9,11,23,25,27,29,30,31,51],ge=[44,45,46,47],ye=[22,37],ke=[1,65],Ae=[1,64],de=[22,37,39,41],ve={trace:function(){},yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,directive:7,line:8,SPACE:9,statement:10,NEWLINE:11,openDirective:12,typeDirective:13,closeDirective:14,":":15,argDirective:16,entityName:17,relSpec:18,role:19,BLOCK_START:20,attributes:21,BLOCK_STOP:22,title:23,title_value:24,acc_title:25,acc_title_value:26,acc_descr:27,acc_descr_value:28,acc_descr_multiline_value:29,ALPHANUM:30,ENTITY_NAME:31,attribute:32,attributeType:33,attributeName:34,attributeKeyTypeList:35,attributeComment:36,ATTRIBUTE_WORD:37,attributeKeyType:38,COMMA:39,ATTRIBUTE_KEY:40,COMMENT:41,cardinality:42,relType:43,ZERO_OR_ONE:44,ZERO_OR_MORE:45,ONE_OR_MORE:46,ONLY_ONE:47,NON_IDENTIFYING:48,IDENTIFYING:49,WORD:50,open_directive:51,type_directive:52,arg_directive:53,close_directive:54,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",20:"BLOCK_START",22:"BLOCK_STOP",23:"title",24:"title_value",25:"acc_title",26:"acc_title_value",27:"acc_descr",28:"acc_descr_value",29:"acc_descr_multiline_value",30:"ALPHANUM",31:"ENTITY_NAME",37:"ATTRIBUTE_WORD",39:"COMMA",40:"ATTRIBUTE_KEY",41:"COMMENT",44:"ZERO_OR_ONE",45:"ZERO_OR_MORE",46:"ONE_OR_MORE",47:"ONLY_ONE",48:"NON_IDENTIFYING",49:"IDENTIFYING",50:"WORD",51:"open_directive",52:"type_directive",53:"arg_directive",54:"close_directive"},productions_:[0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,5],[10,4],[10,3],[10,1],[10,2],[10,2],[10,2],[10,1],[17,1],[17,1],[21,1],[21,2],[32,2],[32,3],[32,3],[32,4],[33,1],[34,1],[35,1],[35,3],[38,1],[36,1],[18,3],[42,1],[42,1],[42,1],[42,1],[43,1],[43,1],[19,1],[19,1],[19,1],[12,1],[13,1],[16,1],[14,1]],performAction:function(he,Ie,ee,rt,me,gt,pe){var Et=gt.length-1;switch(me){case 1:break;case 3:this.$=[];break;case 4:gt[Et-1].push(gt[Et]),this.$=gt[Et-1];break;case 5:case 6:this.$=gt[Et];break;case 7:case 8:this.$=[];break;case 12:rt.addEntity(gt[Et-4]),rt.addEntity(gt[Et-2]),rt.addRelationship(gt[Et-4],gt[Et],gt[Et-2],gt[Et-3]);break;case 13:rt.addEntity(gt[Et-3]),rt.addAttributes(gt[Et-3],gt[Et-1]);break;case 14:rt.addEntity(gt[Et-2]);break;case 15:rt.addEntity(gt[Et]);break;case 16:case 17:this.$=gt[Et].trim(),rt.setAccTitle(this.$);break;case 18:case 19:this.$=gt[Et].trim(),rt.setAccDescription(this.$);break;case 20:case 43:this.$=gt[Et];break;case 21:case 41:case 42:this.$=gt[Et].replace(/"/g,"");break;case 22:case 30:this.$=[gt[Et]];break;case 23:gt[Et].push(gt[Et-1]),this.$=gt[Et];break;case 24:this.$={attributeType:gt[Et-1],attributeName:gt[Et]};break;case 25:this.$={attributeType:gt[Et-2],attributeName:gt[Et-1],attributeKeyTypeList:gt[Et]};break;case 26:this.$={attributeType:gt[Et-2],attributeName:gt[Et-1],attributeComment:gt[Et]};break;case 27:this.$={attributeType:gt[Et-3],attributeName:gt[Et-2],attributeKeyTypeList:gt[Et-1],attributeComment:gt[Et]};break;case 28:case 29:case 32:this.$=gt[Et];break;case 31:gt[Et-2].push(gt[Et]),this.$=gt[Et-2];break;case 33:this.$=gt[Et].replace(/"/g,"");break;case 34:this.$={cardA:gt[Et],relType:gt[Et-1],cardB:gt[Et-2]};break;case 35:this.$=rt.Cardinality.ZERO_OR_ONE;break;case 36:this.$=rt.Cardinality.ZERO_OR_MORE;break;case 37:this.$=rt.Cardinality.ONE_OR_MORE;break;case 38:this.$=rt.Cardinality.ONLY_ONE;break;case 39:this.$=rt.Identification.NON_IDENTIFYING;break;case 40:this.$=rt.Identification.IDENTIFYING;break;case 44:rt.parseDirective("%%{","open_directive");break;case 45:rt.parseDirective(gt[Et],"type_directive");break;case 46:gt[Et]=gt[Et].trim().replace(/'/g,'"'),rt.parseDirective(gt[Et],"arg_directive");break;case 47:rt.parseDirective("}%%","close_directive","er");break}},table:[{3:1,4:a,7:3,12:4,51:f},{1:[3]},i(p,[2,3],{5:6}),{3:7,4:a,7:3,12:4,51:f},{13:8,52:[1,9]},{52:[2,44]},{6:[1,10],7:15,8:11,9:[1,12],10:13,11:[1,14],12:4,17:16,23:w,25:y,27:b,29:E,30:S,31:N,51:f},{1:[2,2]},{14:23,15:[1,24],54:B},i([15,54],[2,45]),i(p,[2,8],{1:[2,1]}),i(p,[2,4]),{7:15,10:26,12:4,17:16,23:w,25:y,27:b,29:E,30:S,31:N,51:f},i(p,[2,6]),i(p,[2,7]),i(p,[2,11]),i(p,[2,15],{18:27,42:29,20:[1,28],44:R,45:j,46:$,47:V}),{24:[1,34]},{26:[1,35]},{28:[1,36]},i(p,[2,19]),i(Q,[2,20]),i(Q,[2,21]),{11:[1,37]},{16:38,53:[1,39]},{11:[2,47]},i(p,[2,5]),{17:40,30:S,31:N},{21:41,22:[1,42],32:43,33:44,37:oe},{43:46,48:[1,47],49:[1,48]},i(ce,[2,35]),i(ce,[2,36]),i(ce,[2,37]),i(ce,[2,38]),i(p,[2,16]),i(p,[2,17]),i(p,[2,18]),i(se,[2,9]),{14:49,54:B},{54:[2,46]},{15:[1,50]},{22:[1,51]},i(p,[2,14]),{21:52,22:[2,22],32:43,33:44,37:oe},{34:53,37:[1,54]},{37:[2,28]},{42:55,44:R,45:j,46:$,47:V},i(ge,[2,39]),i(ge,[2,40]),{11:[1,56]},{19:57,30:[1,60],31:[1,59],50:[1,58]},i(p,[2,13]),{22:[2,23]},i(ye,[2,24],{35:61,36:62,38:63,40:ke,41:Ae}),i([22,37,40,41],[2,29]),i([30,31],[2,34]),i(se,[2,10]),i(p,[2,12]),i(p,[2,41]),i(p,[2,42]),i(p,[2,43]),i(ye,[2,25],{36:66,39:[1,67],41:Ae}),i(ye,[2,26]),i(de,[2,30]),i(ye,[2,33]),i(de,[2,32]),i(ye,[2,27]),{38:68,40:ke},i(de,[2,31])],defaultActions:{5:[2,44],7:[2,2],25:[2,47],39:[2,46],45:[2,28],52:[2,23]},parseError:function(he,Ie){if(Ie.recoverable)this.trace(he);else{var ee=new Error(he);throw ee.hash=Ie,ee}},parse:function(he){var Ie=this,ee=[0],rt=[],me=[null],gt=[],pe=this.table,Et="",wt=0,jt=0,At=2,Bt=1,cn=gt.slice.call(arguments,1),Nn=Object.create(this.lexer),Ot={yy:{}};for(var oi in this.yy)Object.prototype.hasOwnProperty.call(this.yy,oi)&&(Ot.yy[oi]=this.yy[oi]);Nn.setInput(he,Ot.yy),Ot.yy.lexer=Nn,Ot.yy.parser=this,typeof Nn.yylloc>"u"&&(Nn.yylloc={});var kt=Nn.yylloc;gt.push(kt);var Dt=Nn.options&&Nn.options.ranges;typeof Ot.yy.parseError=="function"?this.parseError=Ot.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function vt(){var Sr;return Sr=rt.pop()||Nn.lex()||Bt,typeof Sr!="number"&&(Sr instanceof Array&&(rt=Sr,Sr=rt.pop()),Sr=Ie.symbols_[Sr]||Sr),Sr}for(var Nt,ze,Xe,Lt,Ge={},Bn,Oe,Ri,tn;;){if(ze=ee[ee.length-1],this.defaultActions[ze]?Xe=this.defaultActions[ze]:((Nt===null||typeof Nt>"u")&&(Nt=vt()),Xe=pe[ze]&&pe[ze][Nt]),typeof Xe>"u"||!Xe.length||!Xe[0]){var hi="";tn=[];for(Bn in pe[ze])this.terminals_[Bn]&&Bn>At&&tn.push("'"+this.terminals_[Bn]+"'");Nn.showPosition?hi="Parse error on line "+(wt+1)+`: -`+Nn.showPosition()+` -Expecting `+tn.join(", ")+", got '"+(this.terminals_[Nt]||Nt)+"'":hi="Parse error on line "+(wt+1)+": Unexpected "+(Nt==Bt?"end of input":"'"+(this.terminals_[Nt]||Nt)+"'"),this.parseError(hi,{text:Nn.match,token:this.terminals_[Nt]||Nt,line:Nn.yylineno,loc:kt,expected:tn})}if(Xe[0]instanceof Array&&Xe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ze+", token: "+Nt);switch(Xe[0]){case 1:ee.push(Nt),me.push(Nn.yytext),gt.push(Nn.yylloc),ee.push(Xe[1]),Nt=null,jt=Nn.yyleng,Et=Nn.yytext,wt=Nn.yylineno,kt=Nn.yylloc;break;case 2:if(Oe=this.productions_[Xe[1]][1],Ge.$=me[me.length-Oe],Ge._$={first_line:gt[gt.length-(Oe||1)].first_line,last_line:gt[gt.length-1].last_line,first_column:gt[gt.length-(Oe||1)].first_column,last_column:gt[gt.length-1].last_column},Dt&&(Ge._$.range=[gt[gt.length-(Oe||1)].range[0],gt[gt.length-1].range[1]]),Lt=this.performAction.apply(Ge,[Et,jt,wt,Ot.yy,Xe[1],me,gt].concat(cn)),typeof Lt<"u")return Lt;Oe&&(ee=ee.slice(0,-1*Oe*2),me=me.slice(0,-1*Oe),gt=gt.slice(0,-1*Oe)),ee.push(this.productions_[Xe[1]][0]),me.push(Ge.$),gt.push(Ge._$),Ri=pe[ee[ee.length-2]][ee[ee.length-1]],ee.push(Ri);break;case 3:return!0}}return!0}},te=function(){var De={EOF:1,parseError:function(Ie,ee){if(this.yy.parser)this.yy.parser.parseError(Ie,ee);else throw new Error(Ie)},setInput:function(he,Ie){return this.yy=Ie||this.yy||{},this._input=he,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var he=this._input[0];this.yytext+=he,this.yyleng++,this.offset++,this.match+=he,this.matched+=he;var Ie=he.match(/(?:\r\n?|\n).*/g);return Ie?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),he},unput:function(he){var Ie=he.length,ee=he.split(/(?:\r\n?|\n)/g);this._input=he+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ie),this.offset-=Ie;var rt=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),ee.length-1&&(this.yylineno-=ee.length-1);var me=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:ee?(ee.length===rt.length?this.yylloc.first_column:0)+rt[rt.length-ee.length].length-ee[0].length:this.yylloc.first_column-Ie},this.options.ranges&&(this.yylloc.range=[me[0],me[0]+this.yyleng-Ie]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(he){this.unput(this.match.slice(he))},pastInput:function(){var he=this.matched.substr(0,this.matched.length-this.match.length);return(he.length>20?"...":"")+he.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var he=this.match;return he.length<20&&(he+=this._input.substr(0,20-he.length)),(he.substr(0,20)+(he.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var he=this.pastInput(),Ie=new Array(he.length+1).join("-");return he+this.upcomingInput()+` -`+Ie+"^"},test_match:function(he,Ie){var ee,rt,me;if(this.options.backtrack_lexer&&(me={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},this.options.ranges&&(me.yylloc.range=this.yylloc.range.slice(0))),rt=he[0].match(/(?:\r\n?|\n).*/g),rt&&(this.yylineno+=rt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:rt?rt[rt.length-1].length-rt[rt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+he[0].length},this.yytext+=he[0],this.match+=he[0],this.matches=he,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(he[0].length),this.matched+=he[0],ee=this.performAction.call(this,this.yy,this,Ie,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ee)return ee;if(this._backtrack){for(var gt in me)this[gt]=me[gt];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var he,Ie,ee,rt;this._more||(this.yytext="",this.match="");for(var me=this._currentRules(),gt=0;gtIe[0].length)){if(Ie=ee,rt=gt,this.options.backtrack_lexer){if(he=this.test_match(ee,me[gt]),he!==!1)return he;if(this._backtrack){Ie=!1;continue}else return!1}else if(!this.options.flex)break}return Ie?(he=this.test_match(Ie,me[rt]),he!==!1?he:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var Ie=this.next();return Ie||this.lex()},begin:function(Ie){this.conditionStack.push(Ie)},popState:function(){var Ie=this.conditionStack.length-1;return Ie>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(Ie){return Ie=this.conditionStack.length-1-Math.abs(Ie||0),Ie>=0?this.conditionStack[Ie]:"INITIAL"},pushState:function(Ie){this.begin(Ie)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(Ie,ee,rt,me){switch(rt){case 0:return this.begin("acc_title"),25;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),27;case 3:return this.popState(),"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 this.begin("open_directive"),51;case 8:return this.begin("type_directive"),52;case 9:return this.popState(),this.begin("arg_directive"),15;case 10:return this.popState(),this.popState(),54;case 11:return 53;case 12:return 11;case 13:break;case 14:return 9;case 15:return 31;case 16:return 50;case 17:return 4;case 18:return this.begin("block"),20;case 19:return 39;case 20:break;case 21:return 40;case 22:return 37;case 23:return 37;case 24:return 41;case 25:break;case 26:return this.popState(),22;case 27:return ee.yytext[0];case 28:return 44;case 29:return 46;case 30:return 46;case 31:return 46;case 32:return 44;case 33:return 44;case 34:return 45;case 35:return 45;case 36:return 45;case 37:return 45;case 38:return 45;case 39:return 46;case 40:return 45;case 41:return 46;case 42:return 47;case 43:return 47;case 44:return 47;case 45:return 47;case 46:return 44;case 47:return 45;case 48:return 46;case 49:return 48;case 50:return 49;case 51:return 49;case 52:return 48;case 53:return 48;case 54:return 48;case 55:return 30;case 56:return ee.yytext[0];case 57:return 6}},rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/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,/^(?: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,/^(?:\.\.)/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:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},open_directive:{rules:[8],inclusive:!1},type_directive:{rules:[9,10],inclusive:!1},arg_directive:{rules:[10,11],inclusive:!1},block:{rules:[19,20,21,22,23,24,25,26,27],inclusive:!1},INITIAL:{rules:[0,2,4,7,12,13,14,15,16,17,18,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],inclusive:!0}}};return De}();ve.lexer=te;function xe(){this.yy={}}return xe.prototype=ve,ve.Parser=xe,new xe}();A0e.parser=A0e;const EFt=A0e;let vP={},L0e=[];const TFt={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE"},_Ft={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},CFt=function(i,a,f){rd.parseDirective(this,i,a,f)},iRe=function(i){return vP[i]===void 0&&(vP[i]={attributes:[]},Fe.info("Added new entity :",i)),vP[i]},SFt={Cardinality:TFt,Identification:_Ft,parseDirective:CFt,getConfig:()=>Tt().er,addEntity:iRe,addAttributes:function(i,a){let f=iRe(i),p;for(p=a.length-1;p>=0;p--)f.attributes.push(a[p]),Fe.debug("Added attribute ",a[p].attributeName)},getEntities:()=>vP,addRelationship:function(i,a,f,p){let w={entityA:i,roleA:a,entityB:f,relSpec:p};L0e.push(w),Fe.debug("Added new relationship :",w)},getRelationships:()=>L0e,clear:function(){vP={},L0e=[],rp()},setAccTitle:ip,getAccTitle:L2,setAccDescription:M2,getAccDescription:D2,setDiagramTitle:Uw,getDiagramTitle:Ww},_5={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"},C5={ERMarkers:_5,insertMarkers:function(i,a){let f;i.append("defs").append("marker").attr("id",_5.ONLY_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",a.stroke).attr("fill","none").attr("d","M9,0 L9,18 M15,0 L15,18"),i.append("defs").append("marker").attr("id",_5.ONLY_ONE_END).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",a.stroke).attr("fill","none").attr("d","M3,0 L3,18 M9,0 L9,18"),f=i.append("defs").append("marker").attr("id",_5.ZERO_OR_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),f.append("circle").attr("stroke",a.stroke).attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),f.append("path").attr("stroke",a.stroke).attr("fill","none").attr("d","M9,0 L9,18"),f=i.append("defs").append("marker").attr("id",_5.ZERO_OR_ONE_END).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),f.append("circle").attr("stroke",a.stroke).attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),f.append("path").attr("stroke",a.stroke).attr("fill","none").attr("d","M21,0 L21,18"),i.append("defs").append("marker").attr("id",_5.ONE_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",a.stroke).attr("fill","none").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),i.append("defs").append("marker").attr("id",_5.ONE_OR_MORE_END).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",a.stroke).attr("fill","none").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18"),f=i.append("defs").append("marker").attr("id",_5.ZERO_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),f.append("circle").attr("stroke",a.stroke).attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),f.append("path").attr("stroke",a.stroke).attr("fill","none").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18"),f=i.append("defs").append("marker").attr("id",_5.ZERO_OR_MORE_END).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),f.append("circle").attr("stroke",a.stroke).attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),f.append("path").attr("stroke",a.stroke).attr("fill","none").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")}},AFt=/^(?:[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 LFt(i){return typeof i=="string"&&AFt.test(i)}const Hd=[];for(let i=0;i<256;++i)Hd.push((i+256).toString(16).slice(1));function MFt(i,a=0){return(Hd[i[a+0]]+Hd[i[a+1]]+Hd[i[a+2]]+Hd[i[a+3]]+"-"+Hd[i[a+4]]+Hd[i[a+5]]+"-"+Hd[i[a+6]]+Hd[i[a+7]]+"-"+Hd[i[a+8]]+Hd[i[a+9]]+"-"+Hd[i[a+10]]+Hd[i[a+11]]+Hd[i[a+12]]+Hd[i[a+13]]+Hd[i[a+14]]+Hd[i[a+15]]).toLowerCase()}function DFt(i){if(!LFt(i))throw TypeError("Invalid UUID");let a;const f=new Uint8Array(16);return f[0]=(a=parseInt(i.slice(0,8),16))>>>24,f[1]=a>>>16&255,f[2]=a>>>8&255,f[3]=a&255,f[4]=(a=parseInt(i.slice(9,13),16))>>>8,f[5]=a&255,f[6]=(a=parseInt(i.slice(14,18),16))>>>8,f[7]=a&255,f[8]=(a=parseInt(i.slice(19,23),16))>>>8,f[9]=a&255,f[10]=(a=parseInt(i.slice(24,36),16))/1099511627776&255,f[11]=a/4294967296&255,f[12]=a>>>24&255,f[13]=a>>>16&255,f[14]=a>>>8&255,f[15]=a&255,f}function IFt(i){i=unescape(encodeURIComponent(i));const a=[];for(let f=0;f>>32-a}function RFt(i){const a=[1518500249,1859775393,2400959708,3395469782],f=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof i=="string"){const b=unescape(encodeURIComponent(i));i=[];for(let E=0;E>>0;j=R,R=B,B=M0e(N,30)>>>0,N=S,S=Q}f[0]=f[0]+S>>>0,f[1]=f[1]+N>>>0,f[2]=f[2]+B>>>0,f[3]=f[3]+R>>>0,f[4]=f[4]+j>>>0}return[f[0]>>24&255,f[0]>>16&255,f[0]>>8&255,f[0]&255,f[1]>>24&255,f[1]>>16&255,f[1]>>8&255,f[1]&255,f[2]>>24&255,f[2]>>16&255,f[2]>>8&255,f[2]&255,f[3]>>24&255,f[3]>>16&255,f[3]>>8&255,f[3]&255,f[4]>>24&255,f[4]>>16&255,f[4]>>8&255,f[4]&255]}const FFt=PFt("v5",80,RFt),jFt=/[^\dA-Za-z](\W)*/g;let g1={},wP=new Map;const $Ft=function(i){const a=Object.keys(i);for(const f of a)g1[f]=i[f]},HFt=(i,a,f)=>{const p=g1.entityPadding/3,w=g1.entityPadding/3,y=g1.fontSize*.85,b=a.node().getBBox(),E=[];let S=!1,N=!1,B=0,R=0,j=0,$=0,V=b.height+p*2,Q=1;f.forEach(ge=>{ge.attributeKeyTypeList!==void 0&&ge.attributeKeyTypeList.length>0&&(S=!0),ge.attributeComment!==void 0&&(N=!0)}),f.forEach(ge=>{const ye=`${a.node().id}-attr-${Q}`;let ke=0;const Ae=Yk(ge.attributeType),de=i.append("text").classed("er entityLabel",!0).attr("id",`${ye}-type`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",Tt().fontFamily).style("font-size",y+"px").text(Ae),ve=i.append("text").classed("er entityLabel",!0).attr("id",`${ye}-name`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",Tt().fontFamily).style("font-size",y+"px").text(ge.attributeName),te={};te.tn=de,te.nn=ve;const xe=de.node().getBBox(),De=ve.node().getBBox();if(B=Math.max(B,xe.width),R=Math.max(R,De.width),ke=Math.max(xe.height,De.height),S){const he=ge.attributeKeyTypeList!==void 0?ge.attributeKeyTypeList.join(","):"",Ie=i.append("text").classed("er entityLabel",!0).attr("id",`${ye}-key`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",Tt().fontFamily).style("font-size",y+"px").text(he);te.kn=Ie;const ee=Ie.node().getBBox();j=Math.max(j,ee.width),ke=Math.max(ke,ee.height)}if(N){const he=i.append("text").classed("er entityLabel",!0).attr("id",`${ye}-comment`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",Tt().fontFamily).style("font-size",y+"px").text(ge.attributeComment||"");te.cn=he;const Ie=he.node().getBBox();$=Math.max($,Ie.width),ke=Math.max(ke,Ie.height)}te.height=ke,E.push(te),V+=ke+p*2,Q+=1});let oe=4;S&&(oe+=2),N&&(oe+=2);const ce=B+R+j+$,se={width:Math.max(g1.minEntityWidth,Math.max(b.width+g1.entityPadding*2,ce+w*oe)),height:f.length>0?V:Math.max(g1.minEntityHeight,b.height+g1.entityPadding*2)};if(f.length>0){const ge=Math.max(0,(se.width-ce-w*oe)/(oe/2));a.attr("transform","translate("+se.width/2+","+(p+b.height/2)+")");let ye=b.height+p*2,ke="attributeBoxOdd";E.forEach(Ae=>{const de=ye+p+Ae.height/2;Ae.tn.attr("transform","translate("+w+","+de+")");const ve=i.insert("rect","#"+Ae.tn.node().id).classed(`er ${ke}`,!0).attr("x",0).attr("y",ye).attr("width",B+w*2+ge).attr("height",Ae.height+p*2),te=parseFloat(ve.attr("x"))+parseFloat(ve.attr("width"));Ae.nn.attr("transform","translate("+(te+w)+","+de+")");const xe=i.insert("rect","#"+Ae.nn.node().id).classed(`er ${ke}`,!0).attr("x",te).attr("y",ye).attr("width",R+w*2+ge).attr("height",Ae.height+p*2);let De=parseFloat(xe.attr("x"))+parseFloat(xe.attr("width"));if(S){Ae.kn.attr("transform","translate("+(De+w)+","+de+")");const he=i.insert("rect","#"+Ae.kn.node().id).classed(`er ${ke}`,!0).attr("x",De).attr("y",ye).attr("width",j+w*2+ge).attr("height",Ae.height+p*2);De=parseFloat(he.attr("x"))+parseFloat(he.attr("width"))}N&&(Ae.cn.attr("transform","translate("+(De+w)+","+de+")"),i.insert("rect","#"+Ae.cn.node().id).classed(`er ${ke}`,"true").attr("x",De).attr("y",ye).attr("width",$+w*2+ge).attr("height",Ae.height+p*2)),ye+=Ae.height+p*2,ke=ke==="attributeBoxOdd"?"attributeBoxEven":"attributeBoxOdd"})}else se.height=Math.max(g1.minEntityHeight,V),a.attr("transform","translate("+se.width/2+","+se.height/2+")");return se},zFt=function(i,a,f){const p=Object.keys(a);let w;return p.forEach(function(y){const b=KFt(y,"entity");wP.set(y,b);const E=i.append("g").attr("id",b);w=w===void 0?b:w;const S="text-"+b,N=E.append("text").classed("er entityLabel",!0).attr("id",S).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","middle").style("font-family",Tt().fontFamily).style("font-size",g1.fontSize+"px").text(y),{width:B,height:R}=HFt(E,N,a[y].attributes),$=E.insert("rect","#"+S).classed("er entityBox",!0).attr("x",0).attr("y",0).attr("width",B).attr("height",R).node().getBBox();f.setNode(b,{width:$.width,height:$.height,shape:"rect",id:b})}),w},GFt=function(i,a){a.nodes().forEach(function(f){f!==void 0&&a.node(f)!==void 0&&i.select("#"+f).attr("transform","translate("+(a.node(f).x-a.node(f).width/2)+","+(a.node(f).y-a.node(f).height/2)+" )")})},sRe=function(i){return(i.entityA+i.roleA+i.entityB).replace(/\s/g,"")},qFt=function(i,a){return i.forEach(function(f){a.setEdge(wP.get(f.entityA),wP.get(f.entityB),{relationship:f},sRe(f))}),i};let aRe=0;const VFt=function(i,a,f,p,w){aRe++;const y=f.edge(wP.get(a.entityA),wP.get(a.entityB),sRe(a)),b=WE().x(function(V){return V.x}).y(function(V){return V.y}).curve(SA),E=i.insert("path","#"+p).classed("er relationshipLine",!0).attr("d",b(y.points)).style("stroke",g1.stroke).style("fill","none");a.relSpec.relType===w.db.Identification.NON_IDENTIFYING&&E.attr("stroke-dasharray","8,8");let S="";switch(g1.arrowMarkerAbsolute&&(S=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,S=S.replace(/\(/g,"\\("),S=S.replace(/\)/g,"\\)")),a.relSpec.cardA){case w.db.Cardinality.ZERO_OR_ONE:E.attr("marker-end","url("+S+"#"+C5.ERMarkers.ZERO_OR_ONE_END+")");break;case w.db.Cardinality.ZERO_OR_MORE:E.attr("marker-end","url("+S+"#"+C5.ERMarkers.ZERO_OR_MORE_END+")");break;case w.db.Cardinality.ONE_OR_MORE:E.attr("marker-end","url("+S+"#"+C5.ERMarkers.ONE_OR_MORE_END+")");break;case w.db.Cardinality.ONLY_ONE:E.attr("marker-end","url("+S+"#"+C5.ERMarkers.ONLY_ONE_END+")");break}switch(a.relSpec.cardB){case w.db.Cardinality.ZERO_OR_ONE:E.attr("marker-start","url("+S+"#"+C5.ERMarkers.ZERO_OR_ONE_START+")");break;case w.db.Cardinality.ZERO_OR_MORE:E.attr("marker-start","url("+S+"#"+C5.ERMarkers.ZERO_OR_MORE_START+")");break;case w.db.Cardinality.ONE_OR_MORE:E.attr("marker-start","url("+S+"#"+C5.ERMarkers.ONE_OR_MORE_START+")");break;case w.db.Cardinality.ONLY_ONE:E.attr("marker-start","url("+S+"#"+C5.ERMarkers.ONLY_ONE_START+")");break}const N=E.node().getTotalLength(),B=E.node().getPointAtLength(N*.5),R="rel"+aRe,$=i.append("text").classed("er relationshipLabel",!0).attr("id",R).attr("x",B.x).attr("y",B.y).style("text-anchor","middle").style("dominant-baseline","middle").style("font-family",Tt().fontFamily).style("font-size",g1.fontSize+"px").text(a.roleA).node().getBBox();i.insert("rect","#"+R).classed("er relationshipLabelBox",!0).attr("x",B.x-$.width/2).attr("y",B.y-$.height/2).attr("width",$.width).attr("height",$.height)},UFt=function(i,a,f,p){g1=Tt().er,Fe.info("Drawing ER diagram");const w=Tt().securityLevel;let y;w==="sandbox"&&(y=Cr("#i"+a));const E=Cr(w==="sandbox"?y.nodes()[0].contentDocument.body:"body").select(`[id='${a}']`);C5.insertMarkers(E,g1);let S;S=new zf({multigraph:!0,directed:!0,compound:!1}).setGraph({rankdir:g1.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel(function(){return{}});const N=zFt(E,p.db.getEntities(),S),B=qFt(p.db.getRelationships(),S);tL(S),GFt(E,S),B.forEach(function(Q){VFt(E,Q,S,N,p)});const R=g1.diagramPadding;co.insertTitle(E,"entityTitleText",g1.titleTopMargin,p.db.getDiagramTitle());const j=E.node().getBBox(),$=j.width+R*2,V=j.height+R*2;Vw(E,V,$,g1.useMaxWidth),E.attr("viewBox",`${j.x-R} ${j.y-R} ${$} ${V}`)},WFt="28e9f9db-3c8d-5aa5-9faf-44286ae5937c";function KFt(i="",a=""){const f=i.replace(jFt,"");return`${oRe(a)}${oRe(f)}${FFt(i,WFt)}`}function oRe(i=""){return i.length>0?`${i}-`:""}const YFt=Object.freeze(Object.defineProperty({__proto__:null,diagram:{parser:EFt,db:SFt,renderer:{setConf:$Ft,draw:UFt},styles:i=>` + fill: ${t.textColor}; + } +`,"getStyles"),Kre=ENe});var cT={};hr(cT,{diagram:()=>CNe});var CNe,uT=R(()=>{"use strict";_t();f9();qre();jre();Qre();CNe={parser:Xre,db:A5,renderer:Wre,styles:Kre,init:o(t=>{t.flowchart||(t.flowchart={}),t.layout&&iS({layout:t.layout}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,iS({flowchart:{arrowMarkerAbsolute:t.arrowMarkerAbsolute}}),A5.clear(),A5.setGen("gen-2")},"init")}});var xD,rne,nne=R(()=>{"use strict";xD=function(){var t=o(function(A,L,M,N){for(M=M||{},N=A.length;N--;M[A[N]]=L);return M},"o"),e=[6,8,10,20,22,24,26,27,28],r=[1,10],n=[1,11],i=[1,12],a=[1,13],s=[1,14],l=[1,15],u=[1,21],h=[1,22],f=[1,23],d=[1,24],p=[1,25],m=[6,8,10,13,15,18,19,20,22,24,26,27,28,41,42,43,44,45],g=[1,34],y=[27,28,46,47],v=[41,42,43,44,45],x=[17,34],b=[1,54],w=[1,53],S=[17,34,36,38],T={trace:o(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:o(function(L,M,N,k,I,C,O){var D=C.length-1;switch(I){case 1:break;case 2:this.$=[];break;case 3:C[D-1].push(C[D]),this.$=C[D-1];break;case 4:case 5:this.$=C[D];break;case 6:case 7:this.$=[];break;case 8:k.addEntity(C[D-4]),k.addEntity(C[D-2]),k.addRelationship(C[D-4],C[D],C[D-2],C[D-3]);break;case 9:k.addEntity(C[D-3]),k.addAttributes(C[D-3],C[D-1]);break;case 10:k.addEntity(C[D-2]);break;case 11:k.addEntity(C[D]);break;case 12:k.addEntity(C[D-6],C[D-4]),k.addAttributes(C[D-6],C[D-1]);break;case 13:k.addEntity(C[D-5],C[D-3]);break;case 14:k.addEntity(C[D-3],C[D-1]);break;case 15:case 16:this.$=C[D].trim(),k.setAccTitle(this.$);break;case 17:case 18:this.$=C[D].trim(),k.setAccDescription(this.$);break;case 19:case 43:this.$=C[D];break;case 20:case 41:case 42:this.$=C[D].replace(/"/g,"");break;case 21:case 29:this.$=[C[D]];break;case 22:C[D].push(C[D-1]),this.$=C[D];break;case 23:this.$={attributeType:C[D-1],attributeName:C[D]};break;case 24:this.$={attributeType:C[D-2],attributeName:C[D-1],attributeKeyTypeList:C[D]};break;case 25:this.$={attributeType:C[D-2],attributeName:C[D-1],attributeComment:C[D]};break;case 26:this.$={attributeType:C[D-3],attributeName:C[D-2],attributeKeyTypeList:C[D-1],attributeComment:C[D]};break;case 27:case 28:case 31:this.$=C[D];break;case 30:C[D-2].push(C[D]),this.$=C[D-2];break;case 32:this.$=C[D].replace(/"/g,"");break;case 33:this.$={cardA:C[D],relType:C[D-1],cardB:C[D-2]};break;case 34:this.$=k.Cardinality.ZERO_OR_ONE;break;case 35:this.$=k.Cardinality.ZERO_OR_MORE;break;case 36:this.$=k.Cardinality.ONE_OR_MORE;break;case 37:this.$=k.Cardinality.ONLY_ONE;break;case 38:this.$=k.Cardinality.MD_PARENT;break;case 39:this.$=k.Identification.NON_IDENTIFYING;break;case 40:this.$=k.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,20:r,22:n,24:i,26:a,27:s,28:l},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:16,11:9,20:r,22:n,24:i,26:a,27:s,28:l},t(e,[2,5]),t(e,[2,6]),t(e,[2,11],{12:17,39:20,15:[1,18],18:[1,19],41:u,42:h,43:f,44:d,45:p}),{21:[1,26]},{23:[1,27]},{25:[1,28]},t(e,[2,18]),t(m,[2,19]),t(m,[2,20]),t(e,[2,4]),{11:29,27:s,28:l},{16:30,17:[1,31],29:32,30:33,34:g},{11:35,27:s,28:l},{40:36,46:[1,37],47:[1,38]},t(y,[2,34]),t(y,[2,35]),t(y,[2,36]),t(y,[2,37]),t(y,[2,38]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),{13:[1,39]},{17:[1,40]},t(e,[2,10]),{16:41,17:[2,21],29:32,30:33,34:g},{31:42,34:[1,43]},{34:[2,27]},{19:[1,44]},{39:45,41:u,42:h,43:f,44:d,45:p},t(v,[2,39]),t(v,[2,40]),{14:46,27:[1,49],28:[1,48],48:[1,47]},t(e,[2,9]),{17:[2,22]},t(x,[2,23],{32:50,33:51,35:52,37:b,38:w}),t([17,34,37,38],[2,28]),t(e,[2,14],{15:[1,55]}),t([27,28],[2,33]),t(e,[2,8]),t(e,[2,41]),t(e,[2,42]),t(e,[2,43]),t(x,[2,24],{33:56,36:[1,57],38:w}),t(x,[2,25]),t(S,[2,29]),t(x,[2,32]),t(S,[2,31]),{16:58,17:[1,59],29:32,30:33,34:g},t(x,[2,26]),{35:60,37:b},{17:[1,61]},t(e,[2,13]),t(S,[2,30]),t(e,[2,12])],defaultActions:{34:[2,27],41:[2,22]},parseError:o(function(L,M){if(M.recoverable)this.trace(L);else{var N=new Error(L);throw N.hash=M,N}},"parseError"),parse:o(function(L){var M=this,N=[0],k=[],I=[null],C=[],O=this.table,D="",P=0,F=0,B=0,$=2,z=1,Y=C.slice.call(arguments,1),Q=Object.create(this.lexer),X={yy:{}};for(var ie in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ie)&&(X.yy[ie]=this.yy[ie]);Q.setInput(L,X.yy),X.yy.lexer=Q,X.yy.parser=this,typeof Q.yylloc>"u"&&(Q.yylloc={});var j=Q.yylloc;C.push(j);var J=Q.options&&Q.options.ranges;typeof X.yy.parseError=="function"?this.parseError=X.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Z(Pe){N.length=N.length-2*Pe,I.length=I.length-Pe,C.length=C.length-Pe}o(Z,"popStack");function H(){var Pe;return Pe=k.pop()||Q.lex()||z,typeof Pe!="number"&&(Pe instanceof Array&&(k=Pe,Pe=k.pop()),Pe=M.symbols_[Pe]||Pe),Pe}o(H,"lex");for(var q,K,se,ce,ue,te,De={},oe,ke,Ie,Se;;){if(se=N[N.length-1],this.defaultActions[se]?ce=this.defaultActions[se]:((q===null||typeof q>"u")&&(q=H()),ce=O[se]&&O[se][q]),typeof ce>"u"||!ce.length||!ce[0]){var Ue="";Se=[];for(oe in O[se])this.terminals_[oe]&&oe>$&&Se.push("'"+this.terminals_[oe]+"'");Q.showPosition?Ue="Parse error on line "+(P+1)+`: +`+Q.showPosition()+` +Expecting `+Se.join(", ")+", got '"+(this.terminals_[q]||q)+"'":Ue="Parse error on line "+(P+1)+": Unexpected "+(q==z?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(Ue,{text:Q.match,token:this.terminals_[q]||q,line:Q.yylineno,loc:j,expected:Se})}if(ce[0]instanceof Array&&ce.length>1)throw new Error("Parse Error: multiple actions possible at state: "+se+", token: "+q);switch(ce[0]){case 1:N.push(q),I.push(Q.yytext),C.push(Q.yylloc),N.push(ce[1]),q=null,K?(q=K,K=null):(F=Q.yyleng,D=Q.yytext,P=Q.yylineno,j=Q.yylloc,B>0&&B--);break;case 2:if(ke=this.productions_[ce[1]][1],De.$=I[I.length-ke],De._$={first_line:C[C.length-(ke||1)].first_line,last_line:C[C.length-1].last_line,first_column:C[C.length-(ke||1)].first_column,last_column:C[C.length-1].last_column},J&&(De._$.range=[C[C.length-(ke||1)].range[0],C[C.length-1].range[1]]),te=this.performAction.apply(De,[D,F,P,X.yy,ce[1],I,C].concat(Y)),typeof te<"u")return te;ke&&(N=N.slice(0,-1*ke*2),I=I.slice(0,-1*ke),C=C.slice(0,-1*ke)),N.push(this.productions_[ce[1]][0]),I.push(De.$),C.push(De._$),Ie=O[N[N.length-2]][N[N.length-1]],N.push(Ie);break;case 3:return!0}}return!0},"parse")},E=function(){var A={EOF:1,parseError:o(function(M,N){if(this.yy.parser)this.yy.parser.parseError(M,N);else throw new Error(M)},"parseError"),setInput:o(function(L,M){return this.yy=M||this.yy||{},this._input=L,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var L=this._input[0];this.yytext+=L,this.yyleng++,this.offset++,this.match+=L,this.matched+=L;var M=L.match(/(?:\r\n?|\n).*/g);return M?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),L},"input"),unput:o(function(L){var M=L.length,N=L.split(/(?:\r\n?|\n)/g);this._input=L+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-M),this.offset-=M;var k=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),N.length-1&&(this.yylineno-=N.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:N?(N.length===k.length?this.yylloc.first_column:0)+k[k.length-N.length].length-N[0].length:this.yylloc.first_column-M},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-M]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(L){this.unput(this.match.slice(L))},"less"),pastInput:o(function(){var L=this.matched.substr(0,this.matched.length-this.match.length);return(L.length>20?"...":"")+L.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var L=this.match;return L.length<20&&(L+=this._input.substr(0,20-L.length)),(L.substr(0,20)+(L.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var L=this.pastInput(),M=new Array(L.length+1).join("-");return L+this.upcomingInput()+` +`+M+"^"},"showPosition"),test_match:o(function(L,M){var N,k,I;if(this.options.backtrack_lexer&&(I={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},this.options.ranges&&(I.yylloc.range=this.yylloc.range.slice(0))),k=L[0].match(/(?:\r\n?|\n).*/g),k&&(this.yylineno+=k.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:k?k[k.length-1].length-k[k.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+L[0].length},this.yytext+=L[0],this.match+=L[0],this.matches=L,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(L[0].length),this.matched+=L[0],N=this.performAction.call(this,this.yy,this,M,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),N)return N;if(this._backtrack){for(var C in I)this[C]=I[C];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var L,M,N,k;this._more||(this.yytext="",this.match="");for(var I=this._currentRules(),C=0;CM[0].length)){if(M=N,k=C,this.options.backtrack_lexer){if(L=this.test_match(N,I[C]),L!==!1)return L;if(this._backtrack){M=!1;continue}else return!1}else if(!this.options.flex)break}return M?(L=this.test_match(M,I[k]),L!==!1?L:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var M=this.next();return M||this.lex()},"lex"),begin:o(function(M){this.conditionStack.push(M)},"begin"),popState:o(function(){var M=this.conditionStack.length-1;return M>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(M){return M=this.conditionStack.length-1-Math.abs(M||0),M>=0?this.conditionStack[M]:"INITIAL"},"topState"),pushState:o(function(M){this.begin(M)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(M,N,k,I){var C=I;switch(k){case 0:return this.begin("acc_title"),22;break;case 1:return this.popState(),"acc_title_value";break;case 2:return this.begin("acc_descr"),24;break;case 3:return this.popState(),"acc_descr_value";break;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:return this.begin("block"),15;break;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:return this.popState(),17;break;case 22:return N.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 N.yytext[0];case 55:return 6}},"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:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[14,15,16,17,18,19,20,21,22],inclusive:!1},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:!0}}};return A}();T.lexer=E;function _(){this.yy={}}return o(_,"Parser"),_.prototype=T,T.Parser=_,new _}();xD.parser=xD;rne=xD});var Hd,bD,NNe,MNe,ine,INe,ONe,PNe,BNe,FNe,ane,sne=R(()=>{"use strict";ut();_t();bi();Hd=new Map,bD=[],NNe={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"},MNe={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},ine=o(function(t,e=void 0){return Hd.has(t)?!Hd.get(t).alias&&e&&(Hd.get(t).alias=e,V.info(`Add alias '${e}' to entity '${t}'`)):(Hd.set(t,{attributes:[],alias:e}),V.info("Added new entity :",t)),Hd.get(t)},"addEntity"),INe=o(()=>Hd,"getEntities"),ONe=o(function(t,e){let r=ine(t),n;for(n=e.length-1;n>=0;n--)r.attributes.push(e[n]),V.debug("Added attribute ",e[n].attributeName)},"addAttributes"),PNe=o(function(t,e,r,n){let i={entityA:t,roleA:e,entityB:r,relSpec:n};bD.push(i),V.debug("Added new relationship :",i)},"addRelationship"),BNe=o(()=>bD,"getRelationships"),FNe=o(function(){Hd=new Map,bD=[],vr()},"clear"),ane={Cardinality:NNe,Identification:MNe,getConfig:o(()=>de().er,"getConfig"),addEntity:ine,addAttributes:ONe,getEntities:INe,addRelationship:PNe,getRelationships:BNe,clear:FNe,setAccTitle:kr,getAccTitle:Ar,setAccDescription:_r,getAccDescription:Lr,setDiagramTitle:nn,getDiagramTitle:Xr}});var Dl,zNe,$o,one=R(()=>{"use strict";Dl={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"},zNe=o(function(t,e){let r;t.append("defs").append("marker").attr("id",Dl.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"),t.append("defs").append("marker").attr("id",Dl.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"),t.append("defs").append("marker").attr("id",Dl.ONLY_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",Dl.ONLY_ONE_END).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M3,0 L3,18 M9,0 L9,18"),r=t.append("defs").append("marker").attr("id",Dl.ZERO_OR_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),r.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),r.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M9,0 L9,18"),r=t.append("defs").append("marker").attr("id",Dl.ZERO_OR_ONE_END).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),r.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),r.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,0 L21,18"),t.append("defs").append("marker").attr("id",Dl.ONE_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",Dl.ONE_OR_MORE_END).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18"),r=t.append("defs").append("marker").attr("id",Dl.ZERO_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),r.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),r.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18"),r=t.append("defs").append("marker").attr("id",Dl.ZERO_OR_MORE_END).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),r.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),r.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"insertMarkers"),$o={ERMarkers:Dl,insertMarkers:zNe}});var lne,cne=R(()=>{"use strict";lne=/^(?:[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 GNe(t){return typeof t=="string"&&lne.test(t)}var une,hne=R(()=>{"use strict";cne();o(GNe,"validate");une=GNe});function fne(t,e=0){return va[t[e+0]]+va[t[e+1]]+va[t[e+2]]+va[t[e+3]]+"-"+va[t[e+4]]+va[t[e+5]]+"-"+va[t[e+6]]+va[t[e+7]]+"-"+va[t[e+8]]+va[t[e+9]]+"-"+va[t[e+10]]+va[t[e+11]]+va[t[e+12]]+va[t[e+13]]+va[t[e+14]]+va[t[e+15]]}var va,dne=R(()=>{"use strict";va=[];for(let t=0;t<256;++t)va.push((t+256).toString(16).slice(1));o(fne,"unsafeStringify")});function $Ne(t){if(!une(t))throw TypeError("Invalid UUID");let e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=e&255,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=e&255,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=e&255,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=e&255,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=e&255,r}var pne,mne=R(()=>{"use strict";hne();o($Ne,"parse");pne=$Ne});function VNe(t){t=unescape(encodeURIComponent(t));let e=[];for(let r=0;r{"use strict";dne();mne();o(VNe,"stringToBytes");UNe="6ba7b810-9dad-11d1-80b4-00c04fd430c8",HNe="6ba7b811-9dad-11d1-80b4-00c04fd430c8";o(wD,"v35")});function YNe(t,e,r,n){switch(t){case 0:return e&r^~e&n;case 1:return e^r^n;case 2:return e&r^e&n^r&n;case 3:return e^r^n}}function TD(t,e){return t<>>32-e}function WNe(t){let e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){let s=unescape(encodeURIComponent(t));t=[];for(let l=0;l>>0;p=d,d=f,f=TD(h,30)>>>0,h=u,u=y}r[0]=r[0]+u>>>0,r[1]=r[1]+h>>>0,r[2]=r[2]+f>>>0,r[3]=r[3]+d>>>0,r[4]=r[4]+p>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var yne,vne=R(()=>{"use strict";o(YNe,"f");o(TD,"ROTL");o(WNe,"sha1");yne=WNe});var qNe,kD,xne=R(()=>{"use strict";gne();vne();qNe=wD("v5",80,yne),kD=qNe});var bne=R(()=>{"use strict";xne()});function nMe(t="",e=""){let r=t.replace(XNe,"");return`${Tne(e)}${Tne(r)}${kD(t,rMe)}`}function Tne(t=""){return t.length>0?`${t}-`:""}var XNe,Ii,Fv,jNe,KNe,QNe,ZNe,kne,JNe,wne,eMe,tMe,rMe,Ene,Cne=R(()=>{"use strict";ya();Zt();Vd();_t();ut();xr();one();Yn();rr();bne();XNe=/[^\dA-Za-z](\W)*/g,Ii={},Fv=new Map,jNe=o(function(t){let e=Object.keys(t);for(let r of e)Ii[r]=t[r]},"setConf"),KNe=o((t,e,r)=>{let n=Ii.entityPadding/3,i=Ii.entityPadding/3,a=Ii.fontSize*.85,s=e.node().getBBox(),l=[],u=!1,h=!1,f=0,d=0,p=0,m=0,g=s.height+n*2,y=1;r.forEach(w=>{w.attributeKeyTypeList!==void 0&&w.attributeKeyTypeList.length>0&&(u=!0),w.attributeComment!==void 0&&(h=!0)}),r.forEach(w=>{let S=`${e.node().id}-attr-${y}`,T=0,E=gh(w.attributeType),_=t.append("text").classed("er entityLabel",!0).attr("id",`${S}-type`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",de().fontFamily).style("font-size",a+"px").text(E),A=t.append("text").classed("er entityLabel",!0).attr("id",`${S}-name`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",de().fontFamily).style("font-size",a+"px").text(w.attributeName),L={};L.tn=_,L.nn=A;let M=_.node().getBBox(),N=A.node().getBBox();if(f=Math.max(f,M.width),d=Math.max(d,N.width),T=Math.max(M.height,N.height),u){let k=w.attributeKeyTypeList!==void 0?w.attributeKeyTypeList.join(","):"",I=t.append("text").classed("er entityLabel",!0).attr("id",`${S}-key`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",de().fontFamily).style("font-size",a+"px").text(k);L.kn=I;let C=I.node().getBBox();p=Math.max(p,C.width),T=Math.max(T,C.height)}if(h){let k=t.append("text").classed("er entityLabel",!0).attr("id",`${S}-comment`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",de().fontFamily).style("font-size",a+"px").text(w.attributeComment||"");L.cn=k;let I=k.node().getBBox();m=Math.max(m,I.width),T=Math.max(T,I.height)}L.height=T,l.push(L),g+=T+n*2,y+=1});let v=4;u&&(v+=2),h&&(v+=2);let x=f+d+p+m,b={width:Math.max(Ii.minEntityWidth,Math.max(s.width+Ii.entityPadding*2,x+i*v)),height:r.length>0?g:Math.max(Ii.minEntityHeight,s.height+Ii.entityPadding*2)};if(r.length>0){let w=Math.max(0,(b.width-x-i*v)/(v/2));e.attr("transform","translate("+b.width/2+","+(n+s.height/2)+")");let S=s.height+n*2,T="attributeBoxOdd";l.forEach(E=>{let _=S+n+E.height/2;E.tn.attr("transform","translate("+i+","+_+")");let A=t.insert("rect","#"+E.tn.node().id).classed(`er ${T}`,!0).attr("x",0).attr("y",S).attr("width",f+i*2+w).attr("height",E.height+n*2),L=parseFloat(A.attr("x"))+parseFloat(A.attr("width"));E.nn.attr("transform","translate("+(L+i)+","+_+")");let M=t.insert("rect","#"+E.nn.node().id).classed(`er ${T}`,!0).attr("x",L).attr("y",S).attr("width",d+i*2+w).attr("height",E.height+n*2),N=parseFloat(M.attr("x"))+parseFloat(M.attr("width"));if(u){E.kn.attr("transform","translate("+(N+i)+","+_+")");let k=t.insert("rect","#"+E.kn.node().id).classed(`er ${T}`,!0).attr("x",N).attr("y",S).attr("width",p+i*2+w).attr("height",E.height+n*2);N=parseFloat(k.attr("x"))+parseFloat(k.attr("width"))}h&&(E.cn.attr("transform","translate("+(N+i)+","+_+")"),t.insert("rect","#"+E.cn.node().id).classed(`er ${T}`,"true").attr("x",N).attr("y",S).attr("width",m+i*2+w).attr("height",E.height+n*2)),S+=E.height+n*2,T=T==="attributeBoxOdd"?"attributeBoxEven":"attributeBoxOdd"})}else b.height=Math.max(Ii.minEntityHeight,g),e.attr("transform","translate("+b.width/2+","+b.height/2+")");return b},"drawAttributes"),QNe=o(function(t,e,r){let n=[...e.keys()],i;return n.forEach(function(a){let s=nMe(a,"entity");Fv.set(a,s);let l=t.append("g").attr("id",s);i=i===void 0?s:i;let u="text-"+s,h=l.append("text").classed("er entityLabel",!0).attr("id",u).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","middle").style("font-family",de().fontFamily).style("font-size",Ii.fontSize+"px").text(e.get(a).alias??a),{width:f,height:d}=KNe(l,h,e.get(a).attributes),m=l.insert("rect","#"+u).classed("er entityBox",!0).attr("x",0).attr("y",0).attr("width",f).attr("height",d).node().getBBox();r.setNode(s,{width:m.width,height:m.height,shape:"rect",id:s})}),i},"drawEntities"),ZNe=o(function(t,e){e.nodes().forEach(function(r){r!==void 0&&e.node(r)!==void 0&&t.select("#"+r).attr("transform","translate("+(e.node(r).x-e.node(r).width/2)+","+(e.node(r).y-e.node(r).height/2)+" )")})},"adjustEntities"),kne=o(function(t){return(t.entityA+t.roleA+t.entityB).replace(/\s/g,"")},"getEdgeName"),JNe=o(function(t,e){return t.forEach(function(r){e.setEdge(Fv.get(r.entityA),Fv.get(r.entityB),{relationship:r},kne(r))}),t},"addRelationships"),wne=0,eMe=o(function(t,e,r,n,i){wne++;let a=r.edge(Fv.get(e.entityA),Fv.get(e.entityB),kne(e)),s=ha().x(function(y){return y.x}).y(function(y){return y.y}).curve(vs),l=t.insert("path","#"+n).classed("er relationshipLine",!0).attr("d",s(a.points)).style("stroke",Ii.stroke).style("fill","none");e.relSpec.relType===i.db.Identification.NON_IDENTIFYING&&l.attr("stroke-dasharray","8,8");let u="";switch(Ii.arrowMarkerAbsolute&&(u=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,u=u.replace(/\(/g,"\\("),u=u.replace(/\)/g,"\\)")),e.relSpec.cardA){case i.db.Cardinality.ZERO_OR_ONE:l.attr("marker-end","url("+u+"#"+$o.ERMarkers.ZERO_OR_ONE_END+")");break;case i.db.Cardinality.ZERO_OR_MORE:l.attr("marker-end","url("+u+"#"+$o.ERMarkers.ZERO_OR_MORE_END+")");break;case i.db.Cardinality.ONE_OR_MORE:l.attr("marker-end","url("+u+"#"+$o.ERMarkers.ONE_OR_MORE_END+")");break;case i.db.Cardinality.ONLY_ONE:l.attr("marker-end","url("+u+"#"+$o.ERMarkers.ONLY_ONE_END+")");break;case i.db.Cardinality.MD_PARENT:l.attr("marker-end","url("+u+"#"+$o.ERMarkers.MD_PARENT_END+")");break}switch(e.relSpec.cardB){case i.db.Cardinality.ZERO_OR_ONE:l.attr("marker-start","url("+u+"#"+$o.ERMarkers.ZERO_OR_ONE_START+")");break;case i.db.Cardinality.ZERO_OR_MORE:l.attr("marker-start","url("+u+"#"+$o.ERMarkers.ZERO_OR_MORE_START+")");break;case i.db.Cardinality.ONE_OR_MORE:l.attr("marker-start","url("+u+"#"+$o.ERMarkers.ONE_OR_MORE_START+")");break;case i.db.Cardinality.ONLY_ONE:l.attr("marker-start","url("+u+"#"+$o.ERMarkers.ONLY_ONE_START+")");break;case i.db.Cardinality.MD_PARENT:l.attr("marker-start","url("+u+"#"+$o.ERMarkers.MD_PARENT_START+")");break}let h=l.node().getTotalLength(),f=l.node().getPointAtLength(h*.5),d="rel"+wne,p=e.roleA.split(/
    /g),m=t.append("text").classed("er relationshipLabel",!0).attr("id",d).attr("x",f.x).attr("y",f.y).style("text-anchor","middle").style("dominant-baseline","middle").style("font-family",de().fontFamily).style("font-size",Ii.fontSize+"px");if(p.length==1)m.text(e.roleA);else{let y=-(p.length-1)*.5;p.forEach((v,x)=>{m.append("tspan").attr("x",f.x).attr("dy",`${x===0?y:1}em`).text(v)})}let g=m.node().getBBox();t.insert("rect","#"+d).classed("er relationshipLabelBox",!0).attr("x",f.x-g.width/2).attr("y",f.y-g.height/2).attr("width",g.width).attr("height",g.height)},"drawRelationshipFromLayout"),tMe=o(function(t,e,r,n){Ii=de().er,V.info("Drawing ER diagram");let i=de().securityLevel,a;i==="sandbox"&&(a=$e("#i"+e));let l=(i==="sandbox"?$e(a.nodes()[0].contentDocument.body):$e("body")).select(`[id='${e}']`);$o.insertMarkers(l,Ii);let u;u=new lr({multigraph:!0,directed:!0,compound:!1}).setGraph({rankdir:Ii.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel(function(){return{}});let h=QNe(l,n.db.getEntities(),u),f=JNe(n.db.getRelationships(),u);lo(u),ZNe(l,u),f.forEach(function(y){eMe(l,y,u,h,n)});let d=Ii.diagramPadding;Lt.insertTitle(l,"entityTitleText",Ii.titleTopMargin,n.db.getDiagramTitle());let p=l.node().getBBox(),m=p.width+d*2,g=p.height+d*2;Sr(l,g,m,Ii.useMaxWidth),l.attr("viewBox",`${p.x-d} ${p.y-d} ${m} ${g}`)},"draw"),rMe="28e9f9db-3c8d-5aa5-9faf-44286ae5937c";o(nMe,"generateId");o(Tne,"strWithHyphen");Ene={setConf:jNe,draw:tMe}});var iMe,Sne,Ane=R(()=>{"use strict";iMe=o(t=>` .entityBox { - fill: ${i.mainBkg}; - stroke: ${i.nodeBorder}; + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; } .attributeBoxOdd { - fill: ${i.attributeBackgroundColorOdd}; - stroke: ${i.nodeBorder}; + fill: ${t.attributeBackgroundColorOdd}; + stroke: ${t.nodeBorder}; } .attributeBoxEven { - fill: ${i.attributeBackgroundColorEven}; - stroke: ${i.nodeBorder}; + fill: ${t.attributeBackgroundColorEven}; + stroke: ${t.nodeBorder}; } .relationshipLabelBox { - fill: ${i.tertiaryColor}; + fill: ${t.tertiaryColor}; opacity: 0.7; - background-color: ${i.tertiaryColor}; + background-color: ${t.tertiaryColor}; rect { opacity: 0.5; } } .relationshipLine { - stroke: ${i.lineColor}; + stroke: ${t.lineColor}; } .entityTitleText { text-anchor: middle; font-size: 18px; - fill: ${i.textColor}; + fill: ${t.textColor}; } -`}},Symbol.toStringTag,{value:"Module"}));var D0e=function(){var i=function(ve,te,xe,De){for(xe=xe||{},De=ve.length;De--;xe[ve[De]]=te);return xe},a=[1,4],f=[1,7],p=[1,5],w=[1,9],y=[1,6],b=[2,6],E=[1,16],S=[6,8,14,20,22,24,25,27,29,32,37,40,50,55],N=[8,14,20,22,24,25,27,29,32,37,40],B=[8,13,14,20,22,24,25,27,29,32,37,40],R=[1,26],j=[6,8,14,50,55],$=[8,14,55],V=[1,53],Q=[1,52],oe=[8,14,30,33,35,38,55],ce=[1,67],se=[1,68],ge=[1,69],ye=[8,14,33,35,42,55],ke={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,directive:5,GG:6,document:7,EOF:8,":":9,DIR:10,options:11,body:12,OPT:13,NL:14,line:15,statement:16,commitStatement:17,mergeStatement:18,cherryPickStatement:19,acc_title:20,acc_title_value:21,acc_descr:22,acc_descr_value:23,acc_descr_multiline_value:24,section:25,branchStatement:26,CHECKOUT:27,ref:28,BRANCH:29,ORDER:30,NUM:31,CHERRY_PICK:32,COMMIT_ID:33,STR: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,openDirective:46,typeDirective:47,closeDirective:48,argDirective:49,open_directive:50,type_directive:51,arg_directive:52,close_directive:53,ID:54,";":55,$accept:0,$end:1},terminals_:{2:"error",6:"GG",8:"EOF",9:":",10:"DIR",13:"OPT",14:"NL",20:"acc_title",21:"acc_title_value",22:"acc_descr",23:"acc_descr_value",24:"acc_descr_multiline_value",25:"section",27:"CHECKOUT",29:"BRANCH",30:"ORDER",31:"NUM",32:"CHERRY_PICK",33:"COMMIT_ID",34:"STR",35:"COMMIT_TAG",36:"EMPTYSTR",37:"MERGE",38:"COMMIT_TYPE",40:"COMMIT",42:"COMMIT_MSG",43:"NORMAL",44:"REVERSE",45:"HIGHLIGHT",50:"open_directive",51:"type_directive",52:"arg_directive",53:"close_directive",54:"ID",55:";"},productions_:[0,[3,2],[3,2],[3,3],[3,4],[3,5],[7,0],[7,2],[11,2],[11,1],[12,0],[12,2],[15,2],[15,1],[16,1],[16,1],[16,1],[16,2],[16,2],[16,1],[16,1],[16,1],[16,2],[26,2],[26,4],[19,3],[19,5],[19,5],[19,5],[19,5],[18,2],[18,4],[18,4],[18,4],[18,6],[18,6],[18,6],[18,6],[18,6],[18,6],[18,8],[18,8],[18,8],[18,8],[18,8],[18,8],[17,2],[17,3],[17,3],[17,5],[17,5],[17,3],[17,5],[17,5],[17,5],[17,5],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,3],[17,5],[17,5],[17,5],[17,5],[17,5],[17,5],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[41,0],[41,1],[39,1],[39,1],[39,1],[5,3],[5,5],[46,1],[47,1],[49,1],[48,1],[28,1],[28,1],[4,1],[4,1],[4,1]],performAction:function(te,xe,De,he,Ie,ee,rt){var me=ee.length-1;switch(Ie){case 3:return ee[me];case 4:return ee[me-1];case 5:return he.setDirection(ee[me-3]),ee[me-1];case 7:he.setOptions(ee[me-1]),this.$=ee[me];break;case 8:ee[me-1]+=ee[me],this.$=ee[me-1];break;case 10:this.$=[];break;case 11:ee[me-1].push(ee[me]),this.$=ee[me-1];break;case 12:this.$=ee[me-1];break;case 17:this.$=ee[me].trim(),he.setAccTitle(this.$);break;case 18:case 19:this.$=ee[me].trim(),he.setAccDescription(this.$);break;case 20:he.addSection(ee[me].substr(8)),this.$=ee[me].substr(8);break;case 22:he.checkout(ee[me]);break;case 23:he.branch(ee[me]);break;case 24:he.branch(ee[me-2],ee[me]);break;case 25:he.cherryPick(ee[me],"",void 0);break;case 26:he.cherryPick(ee[me-2],"",ee[me]);break;case 27:case 29:he.cherryPick(ee[me-2],"","");break;case 28:he.cherryPick(ee[me],"",ee[me-2]);break;case 30:he.merge(ee[me],"","","");break;case 31:he.merge(ee[me-2],ee[me],"","");break;case 32:he.merge(ee[me-2],"",ee[me],"");break;case 33:he.merge(ee[me-2],"","",ee[me]);break;case 34:he.merge(ee[me-4],ee[me],"",ee[me-2]);break;case 35:he.merge(ee[me-4],"",ee[me],ee[me-2]);break;case 36:he.merge(ee[me-4],"",ee[me-2],ee[me]);break;case 37:he.merge(ee[me-4],ee[me-2],ee[me],"");break;case 38:he.merge(ee[me-4],ee[me-2],"",ee[me]);break;case 39:he.merge(ee[me-4],ee[me],ee[me-2],"");break;case 40:he.merge(ee[me-6],ee[me-4],ee[me-2],ee[me]);break;case 41:he.merge(ee[me-6],ee[me],ee[me-4],ee[me-2]);break;case 42:he.merge(ee[me-6],ee[me-4],ee[me],ee[me-2]);break;case 43:he.merge(ee[me-6],ee[me-2],ee[me-4],ee[me]);break;case 44:he.merge(ee[me-6],ee[me],ee[me-2],ee[me-4]);break;case 45:he.merge(ee[me-6],ee[me-2],ee[me],ee[me-4]);break;case 46:he.commit(ee[me]);break;case 47:he.commit("","",he.commitType.NORMAL,ee[me]);break;case 48:he.commit("","",ee[me],"");break;case 49:he.commit("","",ee[me],ee[me-2]);break;case 50:he.commit("","",ee[me-2],ee[me]);break;case 51:he.commit("",ee[me],he.commitType.NORMAL,"");break;case 52:he.commit("",ee[me-2],he.commitType.NORMAL,ee[me]);break;case 53:he.commit("",ee[me],he.commitType.NORMAL,ee[me-2]);break;case 54:he.commit("",ee[me-2],ee[me],"");break;case 55:he.commit("",ee[me],ee[me-2],"");break;case 56:he.commit("",ee[me-4],ee[me-2],ee[me]);break;case 57:he.commit("",ee[me-4],ee[me],ee[me-2]);break;case 58:he.commit("",ee[me-2],ee[me-4],ee[me]);break;case 59:he.commit("",ee[me],ee[me-4],ee[me-2]);break;case 60:he.commit("",ee[me],ee[me-2],ee[me-4]);break;case 61:he.commit("",ee[me-2],ee[me],ee[me-4]);break;case 62:he.commit(ee[me],"",he.commitType.NORMAL,"");break;case 63:he.commit(ee[me],"",he.commitType.NORMAL,ee[me-2]);break;case 64:he.commit(ee[me-2],"",he.commitType.NORMAL,ee[me]);break;case 65:he.commit(ee[me-2],"",ee[me],"");break;case 66:he.commit(ee[me],"",ee[me-2],"");break;case 67:he.commit(ee[me],ee[me-2],he.commitType.NORMAL,"");break;case 68:he.commit(ee[me-2],ee[me],he.commitType.NORMAL,"");break;case 69:he.commit(ee[me-4],"",ee[me-2],ee[me]);break;case 70:he.commit(ee[me-4],"",ee[me],ee[me-2]);break;case 71:he.commit(ee[me-2],"",ee[me-4],ee[me]);break;case 72:he.commit(ee[me],"",ee[me-4],ee[me-2]);break;case 73:he.commit(ee[me],"",ee[me-2],ee[me-4]);break;case 74:he.commit(ee[me-2],"",ee[me],ee[me-4]);break;case 75:he.commit(ee[me-4],ee[me],ee[me-2],"");break;case 76:he.commit(ee[me-4],ee[me-2],ee[me],"");break;case 77:he.commit(ee[me-2],ee[me],ee[me-4],"");break;case 78:he.commit(ee[me],ee[me-2],ee[me-4],"");break;case 79:he.commit(ee[me],ee[me-4],ee[me-2],"");break;case 80:he.commit(ee[me-2],ee[me-4],ee[me],"");break;case 81:he.commit(ee[me-4],ee[me],he.commitType.NORMAL,ee[me-2]);break;case 82:he.commit(ee[me-4],ee[me-2],he.commitType.NORMAL,ee[me]);break;case 83:he.commit(ee[me-2],ee[me],he.commitType.NORMAL,ee[me-4]);break;case 84:he.commit(ee[me],ee[me-2],he.commitType.NORMAL,ee[me-4]);break;case 85:he.commit(ee[me],ee[me-4],he.commitType.NORMAL,ee[me-2]);break;case 86:he.commit(ee[me-2],ee[me-4],he.commitType.NORMAL,ee[me]);break;case 87:he.commit(ee[me-6],ee[me-4],ee[me-2],ee[me]);break;case 88:he.commit(ee[me-6],ee[me-4],ee[me],ee[me-2]);break;case 89:he.commit(ee[me-6],ee[me-2],ee[me-4],ee[me]);break;case 90:he.commit(ee[me-6],ee[me],ee[me-4],ee[me-2]);break;case 91:he.commit(ee[me-6],ee[me-2],ee[me],ee[me-4]);break;case 92:he.commit(ee[me-6],ee[me],ee[me-2],ee[me-4]);break;case 93:he.commit(ee[me-4],ee[me-6],ee[me-2],ee[me]);break;case 94:he.commit(ee[me-4],ee[me-6],ee[me],ee[me-2]);break;case 95:he.commit(ee[me-2],ee[me-6],ee[me-4],ee[me]);break;case 96:he.commit(ee[me],ee[me-6],ee[me-4],ee[me-2]);break;case 97:he.commit(ee[me-2],ee[me-6],ee[me],ee[me-4]);break;case 98:he.commit(ee[me],ee[me-6],ee[me-2],ee[me-4]);break;case 99:he.commit(ee[me],ee[me-4],ee[me-2],ee[me-6]);break;case 100:he.commit(ee[me-2],ee[me-4],ee[me],ee[me-6]);break;case 101:he.commit(ee[me],ee[me-2],ee[me-4],ee[me-6]);break;case 102:he.commit(ee[me-2],ee[me],ee[me-4],ee[me-6]);break;case 103:he.commit(ee[me-4],ee[me-2],ee[me],ee[me-6]);break;case 104:he.commit(ee[me-4],ee[me],ee[me-2],ee[me-6]);break;case 105:he.commit(ee[me-2],ee[me-4],ee[me-6],ee[me]);break;case 106:he.commit(ee[me],ee[me-4],ee[me-6],ee[me-2]);break;case 107:he.commit(ee[me-2],ee[me],ee[me-6],ee[me-4]);break;case 108:he.commit(ee[me],ee[me-2],ee[me-6],ee[me-4]);break;case 109:he.commit(ee[me-4],ee[me-2],ee[me-6],ee[me]);break;case 110:he.commit(ee[me-4],ee[me],ee[me-6],ee[me-2]);break;case 111:this.$="";break;case 112:this.$=ee[me];break;case 113:this.$=he.commitType.NORMAL;break;case 114:this.$=he.commitType.REVERSE;break;case 115:this.$=he.commitType.HIGHLIGHT;break;case 118:he.parseDirective("%%{","open_directive");break;case 119:he.parseDirective(ee[me],"type_directive");break;case 120:ee[me]=ee[me].trim().replace(/'/g,'"'),he.parseDirective(ee[me],"arg_directive");break;case 121:he.parseDirective("}%%","close_directive","gitGraph");break}},table:[{3:1,4:2,5:3,6:a,8:f,14:p,46:8,50:w,55:y},{1:[3]},{3:10,4:2,5:3,6:a,8:f,14:p,46:8,50:w,55:y},{3:11,4:2,5:3,6:a,8:f,14:p,46:8,50:w,55:y},{7:12,8:b,9:[1,13],10:[1,14],11:15,14:E},i(S,[2,124]),i(S,[2,125]),i(S,[2,126]),{47:17,51:[1,18]},{51:[2,118]},{1:[2,1]},{1:[2,2]},{8:[1,19]},{7:20,8:b,11:15,14:E},{9:[1,21]},i(N,[2,10],{12:22,13:[1,23]}),i(B,[2,9]),{9:[1,25],48:24,53:R},i([9,53],[2,119]),{1:[2,3]},{8:[1,27]},{7:28,8:b,11:15,14:E},{8:[2,7],14:[1,31],15:29,16:30,17:32,18:33,19:34,20:[1,35],22:[1,36],24:[1,37],25:[1,38],26:39,27:[1,40],29:[1,44],32:[1,43],37:[1,42],40:[1,41]},i(B,[2,8]),i(j,[2,116]),{49:45,52:[1,46]},i(j,[2,121]),{1:[2,4]},{8:[1,47]},i(N,[2,11]),{4:48,8:f,14:p,55:y},i(N,[2,13]),i($,[2,14]),i($,[2,15]),i($,[2,16]),{21:[1,49]},{23:[1,50]},i($,[2,19]),i($,[2,20]),i($,[2,21]),{28:51,34:V,54:Q},i($,[2,111],{41:54,33:[1,57],34:[1,59],35:[1,55],38:[1,56],42:[1,58]}),{28:60,34:V,54:Q},{33:[1,61],35:[1,62]},{28:63,34:V,54:Q},{48:64,53:R},{53:[2,120]},{1:[2,5]},i(N,[2,12]),i($,[2,17]),i($,[2,18]),i($,[2,22]),i(oe,[2,122]),i(oe,[2,123]),i($,[2,46]),{34:[1,65]},{39:66,43:ce,44:se,45:ge},{34:[1,70]},{34:[1,71]},i($,[2,112]),i($,[2,30],{33:[1,72],35:[1,74],38:[1,73]}),{34:[1,75]},{34:[1,76],36:[1,77]},i($,[2,23],{30:[1,78]}),i(j,[2,117]),i($,[2,47],{33:[1,80],38:[1,79],42:[1,81]}),i($,[2,48],{33:[1,83],35:[1,82],42:[1,84]}),i(ye,[2,113]),i(ye,[2,114]),i(ye,[2,115]),i($,[2,51],{35:[1,85],38:[1,86],42:[1,87]}),i($,[2,62],{33:[1,90],35:[1,88],38:[1,89]}),{34:[1,91]},{39:92,43:ce,44:se,45:ge},{34:[1,93]},i($,[2,25],{35:[1,94]}),{33:[1,95]},{33:[1,96]},{31:[1,97]},{39:98,43:ce,44:se,45:ge},{34:[1,99]},{34:[1,100]},{34:[1,101]},{34:[1,102]},{34:[1,103]},{34:[1,104]},{39:105,43:ce,44:se,45:ge},{34:[1,106]},{34:[1,107]},{39:108,43:ce,44:se,45:ge},{34:[1,109]},i($,[2,31],{35:[1,111],38:[1,110]}),i($,[2,32],{33:[1,113],35:[1,112]}),i($,[2,33],{33:[1,114],38:[1,115]}),{34:[1,116],36:[1,117]},{34:[1,118]},{34:[1,119]},i($,[2,24]),i($,[2,49],{33:[1,120],42:[1,121]}),i($,[2,53],{38:[1,122],42:[1,123]}),i($,[2,63],{33:[1,125],38:[1,124]}),i($,[2,50],{33:[1,126],42:[1,127]}),i($,[2,55],{35:[1,128],42:[1,129]}),i($,[2,66],{33:[1,131],35:[1,130]}),i($,[2,52],{38:[1,132],42:[1,133]}),i($,[2,54],{35:[1,134],42:[1,135]}),i($,[2,67],{35:[1,137],38:[1,136]}),i($,[2,64],{33:[1,139],38:[1,138]}),i($,[2,65],{33:[1,141],35:[1,140]}),i($,[2,68],{35:[1,143],38:[1,142]}),{39:144,43:ce,44:se,45:ge},{34:[1,145]},{34:[1,146]},{34:[1,147]},{34:[1,148]},{39:149,43:ce,44:se,45:ge},i($,[2,26]),i($,[2,27]),i($,[2,28]),i($,[2,29]),{34:[1,150]},{34:[1,151]},{39:152,43:ce,44:se,45:ge},{34:[1,153]},{39:154,43:ce,44:se,45:ge},{34:[1,155]},{34:[1,156]},{34:[1,157]},{34:[1,158]},{34:[1,159]},{34:[1,160]},{34:[1,161]},{39:162,43:ce,44:se,45:ge},{34:[1,163]},{34:[1,164]},{34:[1,165]},{39:166,43:ce,44:se,45:ge},{34:[1,167]},{39:168,43:ce,44:se,45:ge},{34:[1,169]},{34:[1,170]},{34:[1,171]},{39:172,43:ce,44:se,45:ge},{34:[1,173]},i($,[2,37],{35:[1,174]}),i($,[2,38],{38:[1,175]}),i($,[2,36],{33:[1,176]}),i($,[2,39],{35:[1,177]}),i($,[2,34],{38:[1,178]}),i($,[2,35],{33:[1,179]}),i($,[2,60],{42:[1,180]}),i($,[2,73],{33:[1,181]}),i($,[2,61],{42:[1,182]}),i($,[2,84],{38:[1,183]}),i($,[2,74],{33:[1,184]}),i($,[2,83],{38:[1,185]}),i($,[2,59],{42:[1,186]}),i($,[2,72],{33:[1,187]}),i($,[2,58],{42:[1,188]}),i($,[2,78],{35:[1,189]}),i($,[2,71],{33:[1,190]}),i($,[2,77],{35:[1,191]}),i($,[2,57],{42:[1,192]}),i($,[2,85],{38:[1,193]}),i($,[2,56],{42:[1,194]}),i($,[2,79],{35:[1,195]}),i($,[2,80],{35:[1,196]}),i($,[2,86],{38:[1,197]}),i($,[2,70],{33:[1,198]}),i($,[2,81],{38:[1,199]}),i($,[2,69],{33:[1,200]}),i($,[2,75],{35:[1,201]}),i($,[2,76],{35:[1,202]}),i($,[2,82],{38:[1,203]}),{34:[1,204]},{39:205,43:ce,44:se,45:ge},{34:[1,206]},{34:[1,207]},{39:208,43:ce,44:se,45:ge},{34:[1,209]},{34:[1,210]},{34:[1,211]},{34:[1,212]},{39:213,43:ce,44:se,45:ge},{34:[1,214]},{39:215,43:ce,44:se,45:ge},{34:[1,216]},{34:[1,217]},{34:[1,218]},{34:[1,219]},{34:[1,220]},{34:[1,221]},{34:[1,222]},{39:223,43:ce,44:se,45:ge},{34:[1,224]},{34:[1,225]},{34:[1,226]},{39:227,43:ce,44:se,45:ge},{34:[1,228]},{39:229,43:ce,44:se,45:ge},{34:[1,230]},{34:[1,231]},{34:[1,232]},{39:233,43:ce,44:se,45:ge},i($,[2,40]),i($,[2,42]),i($,[2,41]),i($,[2,43]),i($,[2,45]),i($,[2,44]),i($,[2,101]),i($,[2,102]),i($,[2,99]),i($,[2,100]),i($,[2,104]),i($,[2,103]),i($,[2,108]),i($,[2,107]),i($,[2,106]),i($,[2,105]),i($,[2,110]),i($,[2,109]),i($,[2,98]),i($,[2,97]),i($,[2,96]),i($,[2,95]),i($,[2,93]),i($,[2,94]),i($,[2,92]),i($,[2,91]),i($,[2,90]),i($,[2,89]),i($,[2,87]),i($,[2,88])],defaultActions:{9:[2,118],10:[2,1],11:[2,2],19:[2,3],27:[2,4],46:[2,120],47:[2,5]},parseError:function(te,xe){if(xe.recoverable)this.trace(te);else{var De=new Error(te);throw De.hash=xe,De}},parse:function(te){var xe=this,De=[0],he=[],Ie=[null],ee=[],rt=this.table,me="",gt=0,pe=0,Et=2,wt=1,jt=ee.slice.call(arguments,1),At=Object.create(this.lexer),Bt={yy:{}};for(var cn in this.yy)Object.prototype.hasOwnProperty.call(this.yy,cn)&&(Bt.yy[cn]=this.yy[cn]);At.setInput(te,Bt.yy),Bt.yy.lexer=At,Bt.yy.parser=this,typeof At.yylloc>"u"&&(At.yylloc={});var Nn=At.yylloc;ee.push(Nn);var Ot=At.options&&At.options.ranges;typeof Bt.yy.parseError=="function"?this.parseError=Bt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function oi(){var Ri;return Ri=he.pop()||At.lex()||wt,typeof Ri!="number"&&(Ri instanceof Array&&(he=Ri,Ri=he.pop()),Ri=xe.symbols_[Ri]||Ri),Ri}for(var kt,Dt,vt,Nt,ze={},Xe,Lt,Ge,Bn;;){if(Dt=De[De.length-1],this.defaultActions[Dt]?vt=this.defaultActions[Dt]:((kt===null||typeof kt>"u")&&(kt=oi()),vt=rt[Dt]&&rt[Dt][kt]),typeof vt>"u"||!vt.length||!vt[0]){var Oe="";Bn=[];for(Xe in rt[Dt])this.terminals_[Xe]&&Xe>Et&&Bn.push("'"+this.terminals_[Xe]+"'");At.showPosition?Oe="Parse error on line "+(gt+1)+`: -`+At.showPosition()+` -Expecting `+Bn.join(", ")+", got '"+(this.terminals_[kt]||kt)+"'":Oe="Parse error on line "+(gt+1)+": Unexpected "+(kt==wt?"end of input":"'"+(this.terminals_[kt]||kt)+"'"),this.parseError(Oe,{text:At.match,token:this.terminals_[kt]||kt,line:At.yylineno,loc:Nn,expected:Bn})}if(vt[0]instanceof Array&&vt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Dt+", token: "+kt);switch(vt[0]){case 1:De.push(kt),Ie.push(At.yytext),ee.push(At.yylloc),De.push(vt[1]),kt=null,pe=At.yyleng,me=At.yytext,gt=At.yylineno,Nn=At.yylloc;break;case 2:if(Lt=this.productions_[vt[1]][1],ze.$=Ie[Ie.length-Lt],ze._$={first_line:ee[ee.length-(Lt||1)].first_line,last_line:ee[ee.length-1].last_line,first_column:ee[ee.length-(Lt||1)].first_column,last_column:ee[ee.length-1].last_column},Ot&&(ze._$.range=[ee[ee.length-(Lt||1)].range[0],ee[ee.length-1].range[1]]),Nt=this.performAction.apply(ze,[me,pe,gt,Bt.yy,vt[1],Ie,ee].concat(jt)),typeof Nt<"u")return Nt;Lt&&(De=De.slice(0,-1*Lt*2),Ie=Ie.slice(0,-1*Lt),ee=ee.slice(0,-1*Lt)),De.push(this.productions_[vt[1]][0]),Ie.push(ze.$),ee.push(ze._$),Ge=rt[De[De.length-2]][De[De.length-1]],De.push(Ge);break;case 3:return!0}}return!0}},Ae=function(){var ve={EOF:1,parseError:function(xe,De){if(this.yy.parser)this.yy.parser.parseError(xe,De);else throw new Error(xe)},setInput:function(te,xe){return this.yy=xe||this.yy||{},this._input=te,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var te=this._input[0];this.yytext+=te,this.yyleng++,this.offset++,this.match+=te,this.matched+=te;var xe=te.match(/(?:\r\n?|\n).*/g);return xe?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),te},unput:function(te){var xe=te.length,De=te.split(/(?:\r\n?|\n)/g);this._input=te+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-xe),this.offset-=xe;var he=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),De.length-1&&(this.yylineno-=De.length-1);var Ie=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:De?(De.length===he.length?this.yylloc.first_column:0)+he[he.length-De.length].length-De[0].length:this.yylloc.first_column-xe},this.options.ranges&&(this.yylloc.range=[Ie[0],Ie[0]+this.yyleng-xe]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(te){this.unput(this.match.slice(te))},pastInput:function(){var te=this.matched.substr(0,this.matched.length-this.match.length);return(te.length>20?"...":"")+te.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var te=this.match;return te.length<20&&(te+=this._input.substr(0,20-te.length)),(te.substr(0,20)+(te.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var te=this.pastInput(),xe=new Array(te.length+1).join("-");return te+this.upcomingInput()+` -`+xe+"^"},test_match:function(te,xe){var De,he,Ie;if(this.options.backtrack_lexer&&(Ie={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},this.options.ranges&&(Ie.yylloc.range=this.yylloc.range.slice(0))),he=te[0].match(/(?:\r\n?|\n).*/g),he&&(this.yylineno+=he.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:he?he[he.length-1].length-he[he.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+te[0].length},this.yytext+=te[0],this.match+=te[0],this.matches=te,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(te[0].length),this.matched+=te[0],De=this.performAction.call(this,this.yy,this,xe,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),De)return De;if(this._backtrack){for(var ee in Ie)this[ee]=Ie[ee];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var te,xe,De,he;this._more||(this.yytext="",this.match="");for(var Ie=this._currentRules(),ee=0;eexe[0].length)){if(xe=De,he=ee,this.options.backtrack_lexer){if(te=this.test_match(De,Ie[ee]),te!==!1)return te;if(this._backtrack){xe=!1;continue}else return!1}else if(!this.options.flex)break}return xe?(te=this.test_match(xe,Ie[he]),te!==!1?te:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var xe=this.next();return xe||this.lex()},begin:function(xe){this.conditionStack.push(xe)},popState:function(){var xe=this.conditionStack.length-1;return xe>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(xe){return xe=this.conditionStack.length-1-Math.abs(xe||0),xe>=0?this.conditionStack[xe]:"INITIAL"},pushState:function(xe){this.begin(xe)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(xe,De,he,Ie){switch(he){case 0:return this.begin("open_directive"),50;case 1:return this.begin("type_directive"),51;case 2:return this.popState(),this.begin("arg_directive"),9;case 3:return this.popState(),this.popState(),53;case 4:return 52;case 5:return this.begin("acc_title"),20;case 6:return this.popState(),"acc_title_value";case 7:return this.begin("acc_descr"),22;case 8:return this.popState(),"acc_descr_value";case 9:this.begin("acc_descr_multiline");break;case 10:this.popState();break;case 11:return"acc_descr_multiline_value";case 12:return 14;case 13:break;case 14:break;case 15:return 6;case 16:return 40;case 17:return 33;case 18:return 38;case 19:return 42;case 20:return 43;case 21:return 44;case 22:return 45;case 23:return 35;case 24:return 29;case 25:return 30;case 26:return 37;case 27:return 32;case 28:return 27;case 29:return 10;case 30:return 10;case 31:return 9;case 32:return"CARET";case 33:this.begin("options");break;case 34:this.popState();break;case 35:return 13;case 36:return 36;case 37:this.begin("string");break;case 38:this.popState();break;case 39:return 34;case 40:return 31;case 41:return 54;case 42:return 8}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\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,/^(?:#[^\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,/^(?:checkout(?=\s|$))/i,/^(?:LR\b)/i,/^(?:BT\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:[10,11],inclusive:!1},acc_descr:{rules:[8],inclusive:!1},acc_title:{rules:[6],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},options:{rules:[34,35],inclusive:!1},string:{rules:[38,39],inclusive:!1},INITIAL:{rules:[0,5,7,9,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,36,37,40,41,42,43],inclusive:!0}}};return ve}();ke.lexer=Ae;function de(){this.yy={}}return de.prototype=ke,ke.Parser=de,new de}();D0e.parser=D0e;const XFt=D0e;let yK=Tt().gitGraph.mainBranchName,QFt=Tt().gitGraph.mainBranchOrder,p1={},og=null,mP={};mP[yK]={name:yK,order:QFt};let Gf={};Gf[yK]=og;let id=yK,cRe="LR",h9=0;function I0e(){return OIe({length:7})}const ZFt=function(i,a,f){rd.parseDirective(this,i,a,f)};function JFt(i,a){const f=Object.create(null);return i.reduce((p,w)=>{const y=a(w);return f[y]||(f[y]=!0,p.push(w)),p},[])}const ejt=function(i){cRe=i};let uRe={};const tjt=function(i){Fe.debug("options str",i),i=i&&i.trim(),i=i||"{}";try{uRe=JSON.parse(i)}catch(a){Fe.error("error while parsing gitGraph options",a.message)}},njt=function(){return uRe},rjt=function(i,a,f,p){Fe.debug("Entering commit:",i,a,f,p),a=Wa.sanitizeText(a,Tt()),i=Wa.sanitizeText(i,Tt()),p=Wa.sanitizeText(p,Tt());const w={id:a||h9+"-"+I0e(),message:i,seq:h9++,type:f||yP.NORMAL,tag:p||"",parents:og==null?[]:[og.id],branch:id};og=w,p1[w.id]=w,Gf[id]=w.id,Fe.debug("in pushCommit "+w.id)},ijt=function(i,a){if(i=Wa.sanitizeText(i,Tt()),Gf[i]===void 0)Gf[i]=og!=null?og.id:null,mP[i]={name:i,order:a?parseInt(a,10):null},lRe(i),Fe.debug("in createBranch");else{let f=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 '+i+'")');throw f.hash={text:"branch "+i,token:"branch "+i,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"checkout '+i+'"']},f}},sjt=function(i,a,f,p){i=Wa.sanitizeText(i,Tt()),a=Wa.sanitizeText(a,Tt());const w=p1[Gf[id]],y=p1[Gf[i]];if(id===i){let E=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw E.hash={text:"merge "+i,token:"merge "+i,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["branch abc"]},E}else if(w===void 0||!w){let E=new Error('Incorrect usage of "merge". Current branch ('+id+")has no commits");throw E.hash={text:"merge "+i,token:"merge "+i,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["commit"]},E}else if(Gf[i]===void 0){let E=new Error('Incorrect usage of "merge". Branch to be merged ('+i+") does not exist");throw E.hash={text:"merge "+i,token:"merge "+i,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["branch "+i]},E}else if(y===void 0||!y){let E=new Error('Incorrect usage of "merge". Branch to be merged ('+i+") has no commits");throw E.hash={text:"merge "+i,token:"merge "+i,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"commit"']},E}else if(w===y){let E=new Error('Incorrect usage of "merge". Both branches have same head');throw E.hash={text:"merge "+i,token:"merge "+i,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["branch abc"]},E}else if(a&&p1[a]!==void 0){let E=new Error('Incorrect usage of "merge". Commit with id:'+a+" already exists, use different custom Id");throw E.hash={text:"merge "+i+a+f+p,token:"merge "+i+a+f+p,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["merge "+i+" "+a+"_UNIQUE "+f+" "+p]},E}const b={id:a||h9+"-"+I0e(),message:"merged branch "+i+" into "+id,seq:h9++,parents:[og==null?null:og.id,Gf[i]],branch:id,type:yP.MERGE,customType:f,customId:!!a,tag:p||""};og=b,p1[b.id]=b,Gf[id]=b.id,Fe.debug(Gf),Fe.debug("in mergeBranch")},ajt=function(i,a,f){if(Fe.debug("Entering cherryPick:",i,a,f),i=Wa.sanitizeText(i,Tt()),a=Wa.sanitizeText(a,Tt()),f=Wa.sanitizeText(f,Tt()),!i||p1[i]===void 0){let y=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw y.hash={text:"cherryPick "+i+" "+a,token:"cherryPick "+i+" "+a,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},y}let p=p1[i],w=p.branch;if(p.type===yP.MERGE){let y=new Error('Incorrect usage of "cherryPick". Source commit should not be a merge commit');throw y.hash={text:"cherryPick "+i+" "+a,token:"cherryPick "+i+" "+a,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},y}if(!a||p1[a]===void 0){if(w===id){let E=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw E.hash={text:"cherryPick "+i+" "+a,token:"cherryPick "+i+" "+a,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},E}const y=p1[Gf[id]];if(y===void 0||!y){let E=new Error('Incorrect usage of "cherry-pick". Current branch ('+id+")has no commits");throw E.hash={text:"cherryPick "+i+" "+a,token:"cherryPick "+i+" "+a,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},E}const b={id:h9+"-"+I0e(),message:"cherry-picked "+p+" into "+id,seq:h9++,parents:[og==null?null:og.id,p.id],branch:id,type:yP.CHERRY_PICK,tag:f??"cherry-pick:"+p.id};og=b,p1[b.id]=b,Gf[id]=b.id,Fe.debug(Gf),Fe.debug("in cherryPick")}},lRe=function(i){if(i=Wa.sanitizeText(i,Tt()),Gf[i]===void 0){let a=new Error('Trying to checkout branch which is not yet created. (Help try using "branch '+i+'")');throw a.hash={text:"checkout "+i,token:"checkout "+i,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"branch '+i+'"']},a}else{id=i;const a=Gf[id];og=p1[a]}};function hRe(i,a,f){const p=i.indexOf(a);p===-1?i.push(f):i.splice(p,1,f)}function fRe(i){const a=i.reduce((w,y)=>w.seq>y.seq?w:y,i[0]);let f="";i.forEach(function(w){w===a?f+=" *":f+=" |"});const p=[f,a.id,a.seq];for(let w in Gf)Gf[w]===a.id&&p.push(w);if(Fe.debug(p.join(" ")),a.parents&&a.parents.length==2){const w=p1[a.parents[0]];hRe(i,a,w),i.push(p1[a.parents[1]])}else{if(a.parents.length==0)return;{const w=p1[a.parents];hRe(i,a,w)}}i=JFt(i,w=>w.id),fRe(i)}const ojt=function(){Fe.debug(p1);const i=dRe()[0];fRe([i])},cjt=function(){p1={},og=null;let i=Tt().gitGraph.mainBranchName,a=Tt().gitGraph.mainBranchOrder;Gf={},Gf[i]=null,mP={},mP[i]={name:i,order:a},id=i,h9=0,rp()},ujt=function(){return Object.values(mP).map((a,f)=>a.order!==null?a:{...a,order:parseFloat(`0.${f}`,10)}).sort((a,f)=>a.order-f.order).map(({name:a})=>({name:a}))},ljt=function(){return Gf},hjt=function(){return p1},dRe=function(){const i=Object.keys(p1).map(function(a){return p1[a]});return i.forEach(function(a){Fe.debug(a.id)}),i.sort((a,f)=>a.seq-f.seq),i},fjt=function(){return id},djt=function(){return cRe},gjt=function(){return og},yP={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},pjt={parseDirective:ZFt,getConfig:()=>Tt().gitGraph,setDirection:ejt,setOptions:tjt,getOptions:njt,commit:rjt,branch:ijt,merge:sjt,cherryPick:ajt,checkout:lRe,prettyPrint:ojt,clear:cjt,getBranchesAsObjArray:ujt,getBranches:ljt,getCommits:hjt,getCommitsArray:dRe,getCurrentBranch:fjt,getDirection:djt,getHead:gjt,setAccTitle:ip,getAccTitle:L2,getAccDescription:D2,setAccDescription:M2,setDiagramTitle:Uw,getDiagramTitle:Ww,commitType:yP};let kP={};const P2={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},f9=8;let op={},kK={},xK=[],EK=0;const bjt=()=>{op={},kK={},kP={},EK=0,xK=[]},vjt=i=>{const a=document.createElementNS("http://www.w3.org/2000/svg","text");let f=[];typeof i=="string"?f=i.split(/\\n|\n|/gi):Array.isArray(i)?f=i:f=[];for(const p of f){const w=document.createElementNS("http://www.w3.org/2000/svg","tspan");w.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),w.setAttribute("dy","1em"),w.setAttribute("x","0"),w.setAttribute("class","row"),w.textContent=p.trim(),a.appendChild(w)}return a},gRe=(i,a,f)=>{const p=GN().gitGraph,w=i.append("g").attr("class","commit-bullets"),y=i.append("g").attr("class","commit-labels");let b=0;Object.keys(a).sort((N,B)=>a[N].seq-a[B].seq).forEach(N=>{const B=a[N],R=op[B.branch].pos,j=b+10;if(f){let $,V=B.customType!==void 0&&B.customType!==""?B.customType:B.type;switch(V){case P2.NORMAL:$="commit-normal";break;case P2.REVERSE:$="commit-reverse";break;case P2.HIGHLIGHT:$="commit-highlight";break;case P2.MERGE:$="commit-merge";break;case P2.CHERRY_PICK:$="commit-cherry-pick";break;default:$="commit-normal"}if(V===P2.HIGHLIGHT){const Q=w.append("rect");Q.attr("x",j-10),Q.attr("y",R-10),Q.attr("height",20),Q.attr("width",20),Q.attr("class",`commit ${B.id} commit-highlight${op[B.branch].index%f9} ${$}-outer`),w.append("rect").attr("x",j-6).attr("y",R-6).attr("height",12).attr("width",12).attr("class",`commit ${B.id} commit${op[B.branch].index%f9} ${$}-inner`)}else if(V===P2.CHERRY_PICK)w.append("circle").attr("cx",j).attr("cy",R).attr("r",10).attr("class",`commit ${B.id} ${$}`),w.append("circle").attr("cx",j-3).attr("cy",R+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${B.id} ${$}`),w.append("circle").attr("cx",j+3).attr("cy",R+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${B.id} ${$}`),w.append("line").attr("x1",j+3).attr("y1",R+1).attr("x2",j).attr("y2",R-5).attr("stroke","#fff").attr("class",`commit ${B.id} ${$}`),w.append("line").attr("x1",j-3).attr("y1",R+1).attr("x2",j).attr("y2",R-5).attr("stroke","#fff").attr("class",`commit ${B.id} ${$}`);else{const Q=w.append("circle");if(Q.attr("cx",j),Q.attr("cy",R),Q.attr("r",B.type===P2.MERGE?9:10),Q.attr("class",`commit ${B.id} commit${op[B.branch].index%f9}`),V===P2.MERGE){const oe=w.append("circle");oe.attr("cx",j),oe.attr("cy",R),oe.attr("r",6),oe.attr("class",`commit ${$} ${B.id} commit${op[B.branch].index%f9}`)}V===P2.REVERSE&&w.append("path").attr("d",`M ${j-5},${R-5}L${j+5},${R+5}M${j-5},${R+5}L${j+5},${R-5}`).attr("class",`commit ${$} ${B.id} commit${op[B.branch].index%f9}`)}}if(kK[B.id]={x:b+10,y:R},f){if(B.type!==P2.CHERRY_PICK&&(B.customId&&B.type===P2.MERGE||B.type!==P2.MERGE)&&p.showCommitLabel){const Q=y.append("g"),oe=Q.insert("rect").attr("class","commit-label-bkg"),ce=Q.append("text").attr("x",b).attr("y",R+25).attr("class","commit-label").text(B.id);let se=ce.node().getBBox();if(oe.attr("x",b+10-se.width/2-2).attr("y",R+13.5).attr("width",se.width+2*2).attr("height",se.height+2*2),ce.attr("x",b+10-se.width/2),p.rotateCommitLabel){let ge=-7.5-(se.width+10)/25*9.5,ye=10+se.width/25*8.5;Q.attr("transform","translate("+ge+", "+ye+") rotate(-45, "+b+", "+R+")")}}if(B.tag){const Q=y.insert("polygon"),oe=y.append("circle"),ce=y.append("text").attr("y",R-16).attr("class","tag-label").text(B.tag);let se=ce.node().getBBox();ce.attr("x",b+10-se.width/2);const ge=se.height/2,ye=R-19.2;Q.attr("class","tag-label-bkg").attr("points",` - ${b-se.width/2-4/2},${ye+2} - ${b-se.width/2-4/2},${ye-2} - ${b+10-se.width/2-4},${ye-ge-2} - ${b+10+se.width/2+4},${ye-ge-2} - ${b+10+se.width/2+4},${ye+ge+2} - ${b+10-se.width/2-4},${ye+ge+2}`),oe.attr("cx",b-se.width/2+4/2).attr("cy",ye).attr("r",1.5).attr("class","tag-hole")}}b+=50,b>EK&&(EK=b)})},wjt=(i,a,f)=>Object.keys(f).filter(y=>f[y].branch===a.branch&&f[y].seq>i.seq&&f[y].seq0,O0e=(i,a,f=0)=>{const p=i+Math.abs(i-a)/2;if(f>5)return p;if(xK.every(b=>Math.abs(b-p)>=10))return xK.push(p),p;const y=Math.abs(i-a);return O0e(i,a-y/5,f+1)},mjt=(i,a,f,p)=>{const w=kK[a.id],y=kK[f.id],b=wjt(a,f,p);let E="",S="",N=0,B=0,R=op[f.branch].index,j;if(b){E="A 10 10, 0, 0, 0,",S="A 10 10, 0, 0, 1,",N=10,B=10,R=op[f.branch].index;const $=w.yy.y&&(E="A 20 20, 0, 0, 0,",N=20,B=20,R=op[a.branch].index,j=`M ${w.x} ${w.y} L ${y.x-N} ${w.y} ${E} ${y.x} ${w.y-B} L ${y.x} ${y.y}`),w.y===y.y&&(R=op[a.branch].index,j=`M ${w.x} ${w.y} L ${w.x} ${y.y-N} ${E} ${w.x+B} ${y.y} L ${y.x} ${y.y}`);i.append("path").attr("d",j).attr("class","arrow arrow"+R%f9)},yjt=(i,a)=>{const f=i.append("g").attr("class","commit-arrows");Object.keys(a).forEach(p=>{const w=a[p];w.parents&&w.parents.length>0&&w.parents.forEach(y=>{mjt(f,a[y],w,a)})})},kjt=(i,a)=>{const f=GN().gitGraph,p=i.append("g");a.forEach((w,y)=>{const b=y%f9,E=op[w.name].pos,S=p.append("line");S.attr("x1",0),S.attr("y1",E),S.attr("x2",EK),S.attr("y2",E),S.attr("class","branch branch"+b),xK.push(E);let N=w.name;const B=vjt(N),R=p.insert("rect"),$=p.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+b);$.node().appendChild(B);let V=B.getBBox();R.attr("class","branchLabelBkg label"+b).attr("rx",4).attr("ry",4).attr("x",-V.width-4-(f.rotateCommitLabel===!0?30:0)).attr("y",-V.height/2+8).attr("width",V.width+18).attr("height",V.height+4),$.attr("transform","translate("+(-V.width-14-(f.rotateCommitLabel===!0?30:0))+", "+(E-V.height/2-1)+")"),R.attr("transform","translate(-19, "+(E-V.height/2)+")")})},xjt=Object.freeze(Object.defineProperty({__proto__:null,diagram:{parser:XFt,db:pjt,renderer:{draw:function(i,a,f,p){bjt();const w=GN(),y=w.gitGraph;Fe.debug("in gitgraph renderer",i+` -`,"id:",a,f),kP=p.db.getCommits();const b=p.db.getBranchesAsObjArray();let E=0;b.forEach((N,B)=>{op[N.name]={pos:E,index:B},E+=50+(y.rotateCommitLabel?40:0)});const S=Cr(`[id="${a}"]`);gRe(S,kP,!1),y.showBranches&&kjt(S,b),yjt(S,kP),gRe(S,kP,!0),co.insertTitle(S,"gitTitleText",y.titleTopMargin,p.db.getDiagramTitle()),xIe(void 0,S,y.diagramPadding,y.useMaxWidth??w.useMaxWidth)}},styles:i=>` + #MD_PARENT_START { + fill: #f5f5f5 !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; + } + #MD_PARENT_END { + fill: #f5f5f5 !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; + } + +`,"getStyles"),Sne=iMe});var _ne={};hr(_ne,{diagram:()=>aMe});var aMe,Lne=R(()=>{"use strict";nne();sne();Cne();Ane();aMe={parser:rne,db:ane,renderer:Ene,styles:Sne}});function Xn(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function xa(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function ED(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function Wd(t){return typeof t=="object"&&t!==null&&Xn(t.container)&&xa(t.reference)&&typeof t.message=="string"}function co(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function ef(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function zv(t){return co(t)&&typeof t.fullText=="string"}var Yd,Vo=R(()=>{"use strict";o(Xn,"isAstNode");o(xa,"isReference");o(ED,"isAstNodeDescription");o(Wd,"isLinkingError");Yd=class{static{o(this,"AbstractAstReflection")}constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,r){return Xn(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});let i=n[r];if(i!==void 0)return i;{let a=this.computeIsSubtype(e,r);return n[r]=a,a}}getAllSubTypes(e){let r=this.allSubtypes[e];if(r)return r;{let n=this.getAllTypes(),i=[];for(let a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}};o(co,"isCompositeCstNode");o(ef,"isLeafCstNode");o(zv,"isRootCstNode")});function cMe(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function hT(t){return!!t&&typeof t[Symbol.iterator]=="function"}function Kr(...t){if(t.length===1){let e=t[0];if(e instanceof uo)return e;if(hT(e))return new uo(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new uo(()=>({index:0}),r=>r.index1?new uo(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){let r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex{"use strict";uo=class t{static{o(this,"StreamImpl")}constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){let e={state:this.startFn(),next:o(()=>this.nextFn(e.state),"next"),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){let e=this.iterator(),r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){let e=[],r=this.iterator(),n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){let n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){let r=e[Symbol.iterator]();return new t(()=>({first:this.startFn(),firstDone:!1}),n=>{let i;if(!n.firstDone){do if(i=this.nextFn(n.first),!i.done)return i;while(!i.done);n.firstDone=!0}do if(i=r.next(),!i.done)return i;while(!i.done);return Ja})}join(e=","){let r=this.iterator(),n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=cMe(i.value)),a=!0;while(!i.done);return n}indexOf(e,r=0){let n=this.iterator(),i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===e)return i;a=n.next(),i++}return-1}every(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new t(this.startFn,r=>{let{done:n,value:i}=this.nextFn(r);return n?Ja:{done:!1,value:e(i)}})}filter(e){return new t(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return Ja})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){let n=this.iterator(),i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=e(i,a.value),a=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){let i=e.next();if(i.done)return n;let a=this.recursiveReduce(e,r,n);return a===void 0?i.value:r(a,i.value)}find(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new t(()=>({this:this.startFn()}),r=>{do{if(r.iterator){let a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}let{done:n,value:i}=this.nextFn(r.this);if(!n){let a=e(i);if(hT(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return Ja})}flat(e){if(e===void 0&&(e=1),e<=0)return this;let r=e>1?this.flat(e-1):this;return new t(()=>({this:r.startFn()}),n=>{do{if(n.iterator){let s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}let{done:i,value:a}=r.nextFn(n.this);if(!i)if(hT(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return Ja})}head(){let r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new t(()=>{let r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?Ja:this.nextFn(r.state)))}distinct(e){let r=new Set;return this.filter(n=>{let i=e?e(n):n;return r.has(i)?!1:(r.add(i),!0)})}exclude(e,r){let n=new Set;for(let i of e){let a=r?r(i):i;n.add(a)}return this.filter(i=>{let a=r?r(i):i;return!n.has(a)})}};o(cMe,"toString");o(hT,"isIterable");Gv=new uo(()=>{},()=>Ja),Ja=Object.freeze({done:!0,value:void 0});o(Kr,"stream");Cc=class extends uo{static{o(this,"TreeStreamImpl")}constructor(e,r,n){super(()=>({iterators:n?.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){let s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return Ja})}iterator(){let e={state:this.startFn(),next:o(()=>this.nextFn(e.state),"next"),prune:o(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}};(function(t){function e(a){return a.reduce((s,l)=>s+l,0)}o(e,"sum"),t.sum=e;function r(a){return a.reduce((s,l)=>s*l,0)}o(r,"product"),t.product=r;function n(a){return a.reduce((s,l)=>Math.min(s,l))}o(n,"min"),t.min=n;function i(a){return a.reduce((s,l)=>Math.max(s,l))}o(i,"max"),t.max=i})(Fm||(Fm={}))});var dT={};hr(dT,{DefaultNameRegexp:()=>fT,RangeComparison:()=>Mu,compareRange:()=>Mne,findCommentNode:()=>_D,findDeclarationNodeAtOffset:()=>hMe,findLeafNodeAtOffset:()=>LD,findLeafNodeBeforeOffset:()=>Ine,flattenCst:()=>uMe,getInteriorNodes:()=>pMe,getNextNode:()=>fMe,getPreviousNode:()=>Pne,getStartlineNode:()=>dMe,inRange:()=>AD,isChildNode:()=>SD,isCommentNode:()=>CD,streamCst:()=>qd,toDocumentSegment:()=>Xd,tokenToRange:()=>zm});function qd(t){return new Cc(t,e=>co(e)?e.content:[],{includeRoot:!0})}function uMe(t){return qd(t).filter(ef)}function SD(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function zm(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function Xd(t){if(!t)return;let{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}function Mne(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>e.end.character)return Mu.After;let r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.lineMu.After}function hMe(t,e,r=fT){if(t){if(e>0){let n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return LD(t,e)}}function _D(t,e){if(t){let r=Pne(t,!0);if(r&&CD(r,e))return r;if(zv(t)){let n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){let a=t.content[i];if(CD(a,e))return a}}}}function CD(t,e){return ef(t)&&e.includes(t.tokenType.name)}function LD(t,e){if(ef(t))return t;if(co(t)){let r=One(t,e,!1);if(r)return LD(r,e)}}function Ine(t,e){if(ef(t))return t;if(co(t)){let r=One(t,e,!0);if(r)return Ine(r,e)}}function One(t,e,r){let n=0,i=t.content.length-1,a;for(;n<=i;){let s=Math.floor((n+i)/2),l=t.content[s];if(l.offset<=e&&l.end>e)return l;l.end<=e?(a=r?l:void 0,n=s+1):i=s-1}return a}function Pne(t,e=!0){for(;t.container;){let r=t.container,n=r.content.indexOf(t);for(;n>0;){n--;let i=r.content[n];if(e||!i.hidden)return i}t=r}}function fMe(t,e=!0){for(;t.container;){let r=t.container,n=r.content.indexOf(t),i=r.content.length-1;for(;n{"use strict";Vo();Ds();o(qd,"streamCst");o(uMe,"flattenCst");o(SD,"isChildNode");o(zm,"tokenToRange");o(Xd,"toDocumentSegment");(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside"})(Mu||(Mu={}));o(Mne,"compareRange");o(AD,"inRange");fT=/^[\w\p{L}]$/u;o(hMe,"findDeclarationNodeAtOffset");o(_D,"findCommentNode");o(CD,"isCommentNode");o(LD,"findLeafNodeAtOffset");o(Ine,"findLeafNodeBeforeOffset");o(One,"binarySearch");o(Pne,"getPreviousNode");o(fMe,"getNextNode");o(dMe,"getStartlineNode");o(pMe,"getInteriorNodes");o(mMe,"getCommonParent");o(Nne,"getParentChain")});function tf(t){throw new Error("Error! The input value was not handled.")}var jd,pT=R(()=>{"use strict";jd=class extends Error{static{o(this,"ErrorWithLocation")}constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}};o(tf,"assertUnreachable")});var Yv={};hr(Yv,{AbstractElement:()=>RD,AbstractRule:()=>$v,AbstractType:()=>Vv,Action:()=>aR,Alternatives:()=>sR,ArrayLiteral:()=>ND,ArrayType:()=>MD,Assignment:()=>oR,BooleanLiteral:()=>OD,CharacterRange:()=>lR,Condition:()=>mT,Conjunction:()=>BD,CrossReference:()=>uR,Disjunction:()=>zD,EndOfFile:()=>hR,Grammar:()=>$D,GrammarImport:()=>Fne,Group:()=>dR,InferredType:()=>VD,Interface:()=>UD,Keyword:()=>pR,LangiumGrammarAstReflection:()=>Gm,LangiumGrammarTerminals:()=>gMe,NamedArgument:()=>zne,NegatedToken:()=>mR,Negation:()=>HD,NumberLiteral:()=>WD,Parameter:()=>qD,ParameterReference:()=>XD,ParserRule:()=>KD,ReferenceType:()=>QD,RegexToken:()=>yR,ReturnType:()=>Gne,RuleCall:()=>xR,SimpleType:()=>eR,StringLiteral:()=>tR,TerminalAlternatives:()=>bR,TerminalGroup:()=>TR,TerminalRule:()=>yT,TerminalRuleCall:()=>ER,Type:()=>rR,TypeAttribute:()=>$ne,TypeDefinition:()=>DD,UnionType:()=>nR,UnorderedGroup:()=>CR,UntilToken:()=>SR,ValueLiteral:()=>gT,Wildcard:()=>_R,isAbstractElement:()=>Uv,isAbstractRule:()=>yMe,isAbstractType:()=>vMe,isAction:()=>Iu,isAlternatives:()=>wT,isArrayLiteral:()=>kMe,isArrayType:()=>ID,isAssignment:()=>Nl,isBooleanLiteral:()=>PD,isCharacterRange:()=>cR,isCondition:()=>xMe,isConjunction:()=>FD,isCrossReference:()=>Kd,isDisjunction:()=>GD,isEndOfFile:()=>fR,isFeatureName:()=>bMe,isGrammar:()=>EMe,isGrammarImport:()=>CMe,isGroup:()=>rf,isInferredType:()=>vT,isInterface:()=>xT,isKeyword:()=>Ho,isNamedArgument:()=>SMe,isNegatedToken:()=>gR,isNegation:()=>YD,isNumberLiteral:()=>AMe,isParameter:()=>_Me,isParameterReference:()=>jD,isParserRule:()=>Oa,isPrimitiveType:()=>Bne,isReferenceType:()=>ZD,isRegexToken:()=>vR,isReturnType:()=>JD,isRuleCall:()=>Ml,isSimpleType:()=>bT,isStringLiteral:()=>LMe,isTerminalAlternatives:()=>wR,isTerminalGroup:()=>kR,isTerminalRule:()=>Uo,isTerminalRuleCall:()=>TT,isType:()=>Hv,isTypeAttribute:()=>DMe,isTypeDefinition:()=>wMe,isUnionType:()=>iR,isUnorderedGroup:()=>kT,isUntilToken:()=>AR,isValueLiteral:()=>TMe,isWildcard:()=>LR,reflection:()=>Kt});function yMe(t){return Kt.isInstance(t,$v)}function vMe(t){return Kt.isInstance(t,Vv)}function xMe(t){return Kt.isInstance(t,mT)}function bMe(t){return Bne(t)||t==="current"||t==="entry"||t==="extends"||t==="false"||t==="fragment"||t==="grammar"||t==="hidden"||t==="import"||t==="interface"||t==="returns"||t==="terminal"||t==="true"||t==="type"||t==="infer"||t==="infers"||t==="with"||typeof t=="string"&&/\^?[_a-zA-Z][\w_]*/.test(t)}function Bne(t){return t==="string"||t==="number"||t==="boolean"||t==="Date"||t==="bigint"}function wMe(t){return Kt.isInstance(t,DD)}function TMe(t){return Kt.isInstance(t,gT)}function Uv(t){return Kt.isInstance(t,RD)}function kMe(t){return Kt.isInstance(t,ND)}function ID(t){return Kt.isInstance(t,MD)}function PD(t){return Kt.isInstance(t,OD)}function FD(t){return Kt.isInstance(t,BD)}function GD(t){return Kt.isInstance(t,zD)}function EMe(t){return Kt.isInstance(t,$D)}function CMe(t){return Kt.isInstance(t,Fne)}function vT(t){return Kt.isInstance(t,VD)}function xT(t){return Kt.isInstance(t,UD)}function SMe(t){return Kt.isInstance(t,zne)}function YD(t){return Kt.isInstance(t,HD)}function AMe(t){return Kt.isInstance(t,WD)}function _Me(t){return Kt.isInstance(t,qD)}function jD(t){return Kt.isInstance(t,XD)}function Oa(t){return Kt.isInstance(t,KD)}function ZD(t){return Kt.isInstance(t,QD)}function JD(t){return Kt.isInstance(t,Gne)}function bT(t){return Kt.isInstance(t,eR)}function LMe(t){return Kt.isInstance(t,tR)}function Uo(t){return Kt.isInstance(t,yT)}function Hv(t){return Kt.isInstance(t,rR)}function DMe(t){return Kt.isInstance(t,$ne)}function iR(t){return Kt.isInstance(t,nR)}function Iu(t){return Kt.isInstance(t,aR)}function wT(t){return Kt.isInstance(t,sR)}function Nl(t){return Kt.isInstance(t,oR)}function cR(t){return Kt.isInstance(t,lR)}function Kd(t){return Kt.isInstance(t,uR)}function fR(t){return Kt.isInstance(t,hR)}function rf(t){return Kt.isInstance(t,dR)}function Ho(t){return Kt.isInstance(t,pR)}function gR(t){return Kt.isInstance(t,mR)}function vR(t){return Kt.isInstance(t,yR)}function Ml(t){return Kt.isInstance(t,xR)}function wR(t){return Kt.isInstance(t,bR)}function kR(t){return Kt.isInstance(t,TR)}function TT(t){return Kt.isInstance(t,ER)}function kT(t){return Kt.isInstance(t,CR)}function AR(t){return Kt.isInstance(t,SR)}function LR(t){return Kt.isInstance(t,_R)}var gMe,$v,Vv,mT,DD,gT,RD,ND,MD,OD,BD,zD,$D,Fne,VD,UD,zne,HD,WD,qD,XD,KD,QD,Gne,eR,tR,yT,rR,$ne,nR,aR,sR,oR,lR,uR,hR,dR,pR,mR,yR,xR,bR,TR,ER,CR,SR,_R,Gm,Kt,Sc=R(()=>{"use strict";Vo();gMe={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]*/},$v="AbstractRule";o(yMe,"isAbstractRule");Vv="AbstractType";o(vMe,"isAbstractType");mT="Condition";o(xMe,"isCondition");o(bMe,"isFeatureName");o(Bne,"isPrimitiveType");DD="TypeDefinition";o(wMe,"isTypeDefinition");gT="ValueLiteral";o(TMe,"isValueLiteral");RD="AbstractElement";o(Uv,"isAbstractElement");ND="ArrayLiteral";o(kMe,"isArrayLiteral");MD="ArrayType";o(ID,"isArrayType");OD="BooleanLiteral";o(PD,"isBooleanLiteral");BD="Conjunction";o(FD,"isConjunction");zD="Disjunction";o(GD,"isDisjunction");$D="Grammar";o(EMe,"isGrammar");Fne="GrammarImport";o(CMe,"isGrammarImport");VD="InferredType";o(vT,"isInferredType");UD="Interface";o(xT,"isInterface");zne="NamedArgument";o(SMe,"isNamedArgument");HD="Negation";o(YD,"isNegation");WD="NumberLiteral";o(AMe,"isNumberLiteral");qD="Parameter";o(_Me,"isParameter");XD="ParameterReference";o(jD,"isParameterReference");KD="ParserRule";o(Oa,"isParserRule");QD="ReferenceType";o(ZD,"isReferenceType");Gne="ReturnType";o(JD,"isReturnType");eR="SimpleType";o(bT,"isSimpleType");tR="StringLiteral";o(LMe,"isStringLiteral");yT="TerminalRule";o(Uo,"isTerminalRule");rR="Type";o(Hv,"isType");$ne="TypeAttribute";o(DMe,"isTypeAttribute");nR="UnionType";o(iR,"isUnionType");aR="Action";o(Iu,"isAction");sR="Alternatives";o(wT,"isAlternatives");oR="Assignment";o(Nl,"isAssignment");lR="CharacterRange";o(cR,"isCharacterRange");uR="CrossReference";o(Kd,"isCrossReference");hR="EndOfFile";o(fR,"isEndOfFile");dR="Group";o(rf,"isGroup");pR="Keyword";o(Ho,"isKeyword");mR="NegatedToken";o(gR,"isNegatedToken");yR="RegexToken";o(vR,"isRegexToken");xR="RuleCall";o(Ml,"isRuleCall");bR="TerminalAlternatives";o(wR,"isTerminalAlternatives");TR="TerminalGroup";o(kR,"isTerminalGroup");ER="TerminalRuleCall";o(TT,"isTerminalRuleCall");CR="UnorderedGroup";o(kT,"isUnorderedGroup");SR="UntilToken";o(AR,"isUntilToken");_R="Wildcard";o(LR,"isWildcard");Gm=class extends Yd{static{o(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(e,r){switch(e){case aR:case sR:case oR:case lR:case uR:case hR:case dR:case pR:case mR:case yR:case xR:case bR:case TR:case ER:case CR:case SR:case _R:return this.isSubtype(RD,r);case ND:case WD:case tR:return this.isSubtype(gT,r);case MD:case QD:case eR:case nR:return this.isSubtype(DD,r);case OD:return this.isSubtype(mT,r)||this.isSubtype(gT,r);case BD:case zD:case HD:case XD:return this.isSubtype(mT,r);case VD:case UD:case rR:return this.isSubtype(Vv,r);case KD:return this.isSubtype($v,r)||this.isSubtype(Vv,r);case yT:return this.isSubtype($v,r);default:return!1}}getReferenceType(e){let r=`${e.container.$type}:${e.property}`;switch(r){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return Vv;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return $v;case"Grammar:usedGrammars":return $D;case"NamedArgument:parameter":case"ParameterReference:parameter":return qD;case"TerminalRuleCall:rule":return yT;default:throw new Error(`${r} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case"AbstractElement":return{name:"AbstractElement",properties:[{name:"cardinality"},{name:"lookahead"}]};case"ArrayLiteral":return{name:"ArrayLiteral",properties:[{name:"elements",defaultValue:[]}]};case"ArrayType":return{name:"ArrayType",properties:[{name:"elementType"}]};case"BooleanLiteral":return{name:"BooleanLiteral",properties:[{name:"true",defaultValue:!1}]};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:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{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:!1},{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:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};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:!1},{name:"hidden",defaultValue:!1},{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:!1},{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:!1},{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:e,properties:[]}}}},Kt=new Gm});var CT={};hr(CT,{assignMandatoryProperties:()=>NR,copyAstNode:()=>RR,findLocalReferences:()=>NMe,findRootNode:()=>Vne,getContainerOfType:()=>Qd,getDocument:()=>Oi,hasContainerOfType:()=>RMe,linkContentToContainer:()=>ET,streamAllContents:()=>Ac,streamAst:()=>Yo,streamContents:()=>Wv,streamReferences:()=>$m});function ET(t){for(let[e,r]of Object.entries(t))e.startsWith("$")||(Array.isArray(r)?r.forEach((n,i)=>{Xn(n)&&(n.$container=t,n.$containerProperty=e,n.$containerIndex=i)}):Xn(r)&&(r.$container=t,r.$containerProperty=e))}function Qd(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function RMe(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}function Oi(t){let r=Vne(t).$document;if(!r)throw new Error("AST node has no document.");return r}function Vne(t){for(;t.$container;)t=t.$container;return t}function Wv(t,e){if(!t)throw new Error("Node must be an AstNode.");let r=e?.range;return new uo(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexWv(r,e))}function Yo(t,e){if(t){if(e?.range&&!DR(t,e.range))return new Cc(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new Cc(t,r=>Wv(r,e),{includeRoot:!0})}function DR(t,e){var r;if(!e)return!0;let n=(r=t.$cstNode)===null||r===void 0?void 0:r.range;return n?AD(n,e):!1}function $m(t){return new uo(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex{$m(n).forEach(i=>{i.reference.ref===t&&r.push(i.reference)})}),Kr(r)}function NR(t,e){let r=t.getTypeMetaData(e.$type),n=e;for(let i of r.properties)i.defaultValue!==void 0&&n[i.name]===void 0&&(n[i.name]=Une(i.defaultValue))}function Une(t){return Array.isArray(t)?[...t.map(Une)]:t}function RR(t,e){let r={$type:t.$type};for(let[n,i]of Object.entries(t))if(!n.startsWith("$"))if(Xn(i))r[n]=RR(i,e);else if(xa(i))r[n]=e(r,n,i.$refNode,i.$refText);else if(Array.isArray(i)){let a=[];for(let s of i)Xn(s)?a.push(RR(s,e)):xa(s)?a.push(e(r,n,s.$refNode,s.$refText)):a.push(s);r[n]=a}else r[n]=i;return ET(r),r}var es=R(()=>{"use strict";Vo();Ds();Rl();o(ET,"linkContentToContainer");o(Qd,"getContainerOfType");o(RMe,"hasContainerOfType");o(Oi,"getDocument");o(Vne,"findRootNode");o(Wv,"streamContents");o(Ac,"streamAllContents");o(Yo,"streamAst");o(DR,"isAstNodeInRange");o($m,"streamReferences");o(NMe,"findLocalReferences");o(NR,"assignMandatoryProperties");o(Une,"copyDefaultValue");o(RR,"copyAstNode")});function qt(t){return t.charCodeAt(0)}function ST(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function Vm(t,e){if(t[e]===!0)throw"duplicate flag "+e;let r=t[e];t[e]=!0}function Zd(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function qv(){throw Error("Internal Error - Should never get here!")}function MR(t){return t.type==="Character"}var IR=R(()=>{"use strict";o(qt,"cc");o(ST,"insertToSet");o(Vm,"addFlag");o(Zd,"ASSERT_EXISTS");o(qv,"ASSERT_NEVER_REACH_HERE");o(MR,"isCharacter")});var Xv,jv,OR,Hne=R(()=>{"use strict";IR();Xv=[];for(let t=qt("0");t<=qt("9");t++)Xv.push(t);jv=[qt("_")].concat(Xv);for(let t=qt("a");t<=qt("z");t++)jv.push(t);for(let t=qt("A");t<=qt("Z");t++)jv.push(t);OR=[qt(" "),qt("\f"),qt(` +`),qt("\r"),qt(" "),qt("\v"),qt(" "),qt("\xA0"),qt("\u1680"),qt("\u2000"),qt("\u2001"),qt("\u2002"),qt("\u2003"),qt("\u2004"),qt("\u2005"),qt("\u2006"),qt("\u2007"),qt("\u2008"),qt("\u2009"),qt("\u200A"),qt("\u2028"),qt("\u2029"),qt("\u202F"),qt("\u205F"),qt("\u3000"),qt("\uFEFF")]});var MMe,AT,IMe,Jd,Yne=R(()=>{"use strict";IR();Hne();MMe=/[0-9a-fA-F]/,AT=/[0-9]/,IMe=/[1-9]/,Jd=class{static{o(this,"RegExpParser")}constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");let r=this.disjunction();this.consumeChar("/");let n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Vm(n,"global");break;case"i":Vm(n,"ignoreCase");break;case"m":Vm(n,"multiLine");break;case"u":Vm(n,"unicode");break;case"y":Vm(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){let e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){let e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break}Zd(r);let n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return qv()}quantifier(e=!1){let r,n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),r={atLeast:i,atMost:a}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;Zd(r);break}if(!(e===!0&&r===void 0)&&Zd(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e,r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Zd(e)?(e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):qv()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[qt(` +`),qt("\r"),qt("\u2028"),qt("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),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()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=Xv;break;case"D":e=Xv,r=!0;break;case"s":e=OR;break;case"S":e=OR,r=!0;break;case"w":e=jv;break;case"W":e=jv,r=!0;break}return Zd(e)?{type:"Set",value:e,complement:r}:qv()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=qt("\f");break;case"n":e=qt(` +`);break;case"r":e=qt("\r");break;case"t":e=qt(" ");break;case"v":e=qt("\v");break}return Zd(e)?{type:"Character",value:e}:qv()}controlLetterEscapeAtom(){this.consumeChar("c");let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:qt("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let e=this.popChar();return{type:"Character",value:qt(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case` +`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let e=this.popChar();return{type:"Character",value:qt(e)}}}characterClass(){let e=[],r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){let n=this.classAtom(),i=n.type==="Character";if(MR(n)&&this.isRangeDash()){this.consumeChar("-");let a=this.classAtom(),s=a.type==="Character";if(MR(a)){if(a.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}}});var _c,Wne=R(()=>{"use strict";_c=class{static{o(this,"BaseRegExpVisitor")}visitChildren(e){for(let r in e){let n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}});var Kv=R(()=>{"use strict";Yne();Wne()});var LT={};hr(LT,{NEWLINE_REGEXP:()=>BR,escapeRegExp:()=>t0,getCaseInsensitivePattern:()=>zR,getTerminalParts:()=>OMe,isMultilineComment:()=>FR,isWhitespace:()=>_T,partialMatches:()=>GR,partialRegExp:()=>Xne});function OMe(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;let e=qne.pattern(t),r=[];for(let n of e.value.value)e0.reset(t),e0.visit(n),r.push({start:e0.startRegexp,end:e0.endRegex});return r}catch{return[]}}function FR(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),e0.reset(t),e0.visit(qne.pattern(t)),e0.multiline}catch{return!1}}function _T(t){return(typeof t=="string"?new RegExp(t):t).test(" ")}function t0(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function zR(t){return Array.prototype.map.call(t,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:t0(e)).join("")}function GR(t,e){let r=Xne(t),n=e.match(r);return!!n&&n[0].length>0}function Xne(t){typeof t=="string"&&(t=new RegExp(t));let e=t,r=t.source,n=0;function i(){let a="",s;function l(h){a+=r.substr(n,h),n+=h}o(l,"appendRaw");function u(h){a+="(?:"+r.substr(n,h)+"|$)",n+=h}for(o(u,"appendOptional");n",n)-n+1);break;default:u(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],u(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":l(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?l(s[0].length):u(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":s=n,n+=3,i(),a+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),a+=r.substr(s,n-s);break;default:l(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else l(1),a+=i()+"|$)";break;case")":return++n,a;default:u(1);break}return a}return o(i,"process"),new RegExp(i(),t.flags)}var BR,qne,PR,e0,Um=R(()=>{"use strict";Kv();BR=/\r?\n/gm,qne=new Jd,PR=class extends _c{static{o(this,"TerminalRegExpVisitor")}constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){let r=String.fromCharCode(e.value);if(!this.multiline&&r===` +`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let n=t0(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){let r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!` +`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},e0=new PR;o(OMe,"getTerminalParts");o(FR,"isMultilineComment");o(_T,"isWhitespace");o(t0,"escapeRegExp");o(zR,"getCaseInsensitivePattern");o(GR,"partialMatches");o(Xne,"partialRegExp")});var RT={};hr(RT,{findAssignment:()=>jR,findNameAssignment:()=>DT,findNodeForKeyword:()=>qR,findNodeForProperty:()=>Zv,findNodesForKeyword:()=>PMe,findNodesForKeywordInternal:()=>XR,findNodesForProperty:()=>YR,getActionAtElement:()=>Jne,getActionType:()=>tie,getAllReachableRules:()=>Qv,getCrossReferenceTerminal:()=>UR,getEntryRule:()=>jne,getExplicitRuleType:()=>KR,getHiddenRules:()=>Kne,getRuleType:()=>QR,getTypeName:()=>r0,isArrayCardinality:()=>FMe,isArrayOperator:()=>zMe,isCommentTerminal:()=>HR,isDataType:()=>GMe,isDataTypeRule:()=>Jv,isOptionalCardinality:()=>BMe,terminalRegex:()=>Hm});function jne(t){return t.rules.find(e=>Oa(e)&&e.entry)}function Kne(t){return t.rules.filter(e=>Uo(e)&&e.hidden)}function Qv(t,e){let r=new Set,n=jne(t);if(!n)return new Set(t.rules);let i=[n].concat(Kne(t));for(let s of i)Qne(s,r,e);let a=new Set;for(let s of t.rules)(r.has(s.name)||Uo(s)&&s.hidden)&&a.add(s);return a}function Qne(t,e,r){e.add(t.name),Ac(t).forEach(n=>{if(Ml(n)||r&&TT(n)){let i=n.rule.ref;i&&!e.has(i.name)&&Qne(i,e,r)}})}function UR(t){if(t.terminal)return t.terminal;if(t.type.ref){let e=DT(t.type.ref);return e?.terminal}}function HR(t){return t.hidden&&!Hm(t).test(" ")}function YR(t,e){return!t||!e?[]:WR(t,e,t.astNode,!0)}function Zv(t,e,r){if(!t||!e)return;let n=WR(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function WR(t,e,r,n){if(!n){let i=Qd(t.grammarSource,Nl);if(i&&i.feature===e)return[t]}return co(t)&&t.astNode===r?t.content.flatMap(i=>WR(i,e,r,!1)):[]}function PMe(t,e){return t?XR(t,e,t?.astNode):[]}function qR(t,e,r){if(!t)return;let n=XR(t,e,t?.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function XR(t,e,r){if(t.astNode!==r)return[];if(Ho(t.grammarSource)&&t.grammarSource.value===e)return[t];let n=qd(t).iterator(),i,a=[];do if(i=n.next(),!i.done){let s=i.value;s.astNode===r?Ho(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}function jR(t){var e;let r=t.astNode;for(;r===((e=t.container)===null||e===void 0?void 0:e.astNode);){let n=Qd(t.grammarSource,Nl);if(n)return n;t=t.container}}function DT(t){let e=t;return vT(e)&&(Iu(e.$container)?e=e.$container.$container:Oa(e.$container)?e=e.$container:tf(e.$container)),Zne(t,e,new Map)}function Zne(t,e,r){var n;function i(a,s){let l;return Qd(a,Nl)||(l=Zne(s,s,r)),r.set(t,l),l}if(o(i,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(let a of Ac(e)){if(Nl(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Ml(a)&&Oa(a.rule.ref))return i(a,a.rule.ref);if(bT(a)&&(!((n=a.typeRef)===null||n===void 0)&&n.ref))return i(a,a.typeRef.ref)}}function Jne(t){let e=t.$container;if(rf(e)){let r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){let a=r[i];if(Iu(a))return a;{let s=Ac(r[i]).find(Iu);if(s)return s}}}if(Uv(e))return Jne(e)}function BMe(t,e){return t==="?"||t==="*"||rf(e)&&!!e.guardCondition}function FMe(t){return t==="*"||t==="+"}function zMe(t){return t==="+="}function Jv(t){return eie(t,new Set)}function eie(t,e){if(e.has(t))return!0;e.add(t);for(let r of Ac(t))if(Ml(r)){if(!r.rule.ref||Oa(r.rule.ref)&&!eie(r.rule.ref,e))return!1}else{if(Nl(r))return!1;if(Iu(r))return!1}return!!t.definition}function GMe(t){return VR(t.type,new Set)}function VR(t,e){if(e.has(t))return!0;if(e.add(t),ID(t))return!1;if(ZD(t))return!1;if(iR(t))return t.types.every(r=>VR(r,e));if(bT(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){let r=t.typeRef.ref;return Hv(r)?VR(r.type,e):!1}else return!1}else return!1}function KR(t){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){let e=t.returnType.ref;if(e){if(Oa(e))return e.name;if(xT(e)||Hv(e))return e.name}}}function r0(t){var e;if(Oa(t))return Jv(t)?t.name:(e=KR(t))!==null&&e!==void 0?e:t.name;if(xT(t)||Hv(t)||JD(t))return t.name;if(Iu(t)){let r=tie(t);if(r)return r}else if(vT(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function tie(t){var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return r0(t.type.ref)}function QR(t){var e,r,n;return Uo(t)?(r=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&r!==void 0?r:"string":Jv(t)?t.name:(n=KR(t))!==null&&n!==void 0?n:t.name}function Hm(t){let e={s:!1,i:!1,u:!1},r=Ym(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}function Ym(t,e){if(wR(t))return $Me(t);if(kR(t))return VMe(t);if(cR(t))return YMe(t);if(TT(t)){let r=t.rule.ref;if(!r)throw new Error("Missing rule reference.");return Ou(Ym(r.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}else{if(gR(t))return HMe(t);if(AR(t))return UMe(t);if(vR(t)){let r=t.regex.lastIndexOf("/"),n=t.regex.substring(1,r),i=t.regex.substring(r+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),Ou(n,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}else{if(LR(t))return Ou(ZR,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${t?.$type}`)}}}function $Me(t){return Ou(t.elements.map(e=>Ym(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function VMe(t){return Ou(t.elements.map(e=>Ym(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function UMe(t){return Ou(`${ZR}*?${Ym(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function HMe(t){return Ou(`(?!${Ym(t.terminal)})${ZR}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function YMe(t){return t.right?Ou(`[${$R(t.left)}-${$R(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):Ou($R(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function $R(t){return t0(t.value)}function Ou(t,e){var r;return(e.wrap!==!1||e.lookahead)&&(t=`(${(r=e.lookahead)!==null&&r!==void 0?r:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}var ZR,Il=R(()=>{"use strict";pT();Sc();Vo();es();Rl();Um();o(jne,"getEntryRule");o(Kne,"getHiddenRules");o(Qv,"getAllReachableRules");o(Qne,"ruleDfs");o(UR,"getCrossReferenceTerminal");o(HR,"isCommentTerminal");o(YR,"findNodesForProperty");o(Zv,"findNodeForProperty");o(WR,"findNodesForPropertyInternal");o(PMe,"findNodesForKeyword");o(qR,"findNodeForKeyword");o(XR,"findNodesForKeywordInternal");o(jR,"findAssignment");o(DT,"findNameAssignment");o(Zne,"findNameAssignmentInternal");o(Jne,"getActionAtElement");o(BMe,"isOptionalCardinality");o(FMe,"isArrayCardinality");o(zMe,"isArrayOperator");o(Jv,"isDataTypeRule");o(eie,"isDataTypeRuleInternal");o(GMe,"isDataType");o(VR,"isDataTypeInternal");o(KR,"getExplicitRuleType");o(r0,"getTypeName");o(tie,"getActionType");o(QR,"getRuleType");o(Hm,"terminalRegex");ZR=/[\s\S]/.source;o(Ym,"abstractElementToRegex");o($Me,"terminalAlternativesToRegex");o(VMe,"terminalGroupToRegex");o(UMe,"untilTokenToRegex");o(HMe,"negateTokenToRegex");o(YMe,"characterRangeToRegex");o($R,"keywordToRegex");o(Ou,"withCardinality")});function JR(t){let e=[],r=t.Grammar;for(let n of r.rules)Uo(n)&&HR(n)&&FR(Hm(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:fT}}var eN=R(()=>{"use strict";Rl();Il();Um();Sc();o(JR,"createGrammarConfig")});var tN=R(()=>{"use strict"});function Wm(t){console&&console.error&&console.error(`Error: ${t}`)}function e2(t){console&&console.warn&&console.warn(`Warning: ${t}`)}var rie=R(()=>{"use strict";o(Wm,"PRINT_ERROR");o(e2,"PRINT_WARNING")});function t2(t){let e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}var nie=R(()=>{"use strict";o(t2,"timer")});function r2(t){function e(){}o(e,"FakeConstructor"),e.prototype=t;let r=new e;function n(){return typeof r.bar}return o(n,"fakeAccess"),n(),n(),t;(0,eval)(t)}var iie=R(()=>{"use strict";o(r2,"toFastProperties")});var qm=R(()=>{"use strict";rie();nie();iie()});function WMe(t){return qMe(t)?t.LABEL:t.name}function qMe(t){return di(t.LABEL)&&t.LABEL!==""}function NT(t){return qe(t,Xm)}function Xm(t){function e(r){return qe(r,Xm)}if(o(e,"convertDefinition"),t instanceof Zr){let r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return di(t.label)&&(r.label=t.label),r}else{if(t instanceof Sn)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Jr)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof An)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof _n)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Xm(new fr({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof mn)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Xm(new fr({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof br)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof gn)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof fr){let r={type:"Terminal",name:t.terminalType.name,label:WMe(t.terminalType),idx:t.idx};di(t.label)&&(r.terminalLabel=t.label);let n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=zo(n)?n.source:n),r}else{if(t instanceof ts)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}var ho,Zr,ts,Sn,Jr,An,_n,br,mn,gn,fr,MT=R(()=>{"use strict";Pt();o(WMe,"tokenLabel");o(qMe,"hasTokenLabel");ho=class{static{o(this,"AbstractProduction")}get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),Ee(this.definition,r=>{r.accept(e)})}},Zr=class extends ho{static{o(this,"NonTerminal")}constructor(e){super([]),this.idx=1,pa(this,Ls(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},ts=class extends ho{static{o(this,"Rule")}constructor(e){super(e.definition),this.orgText="",pa(this,Ls(e,r=>r!==void 0))}},Sn=class extends ho{static{o(this,"Alternative")}constructor(e){super(e.definition),this.ignoreAmbiguities=!1,pa(this,Ls(e,r=>r!==void 0))}},Jr=class extends ho{static{o(this,"Option")}constructor(e){super(e.definition),this.idx=1,pa(this,Ls(e,r=>r!==void 0))}},An=class extends ho{static{o(this,"RepetitionMandatory")}constructor(e){super(e.definition),this.idx=1,pa(this,Ls(e,r=>r!==void 0))}},_n=class extends ho{static{o(this,"RepetitionMandatoryWithSeparator")}constructor(e){super(e.definition),this.idx=1,pa(this,Ls(e,r=>r!==void 0))}},br=class extends ho{static{o(this,"Repetition")}constructor(e){super(e.definition),this.idx=1,pa(this,Ls(e,r=>r!==void 0))}},mn=class extends ho{static{o(this,"RepetitionWithSeparator")}constructor(e){super(e.definition),this.idx=1,pa(this,Ls(e,r=>r!==void 0))}},gn=class extends ho{static{o(this,"Alternation")}get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,pa(this,Ls(e,r=>r!==void 0))}},fr=class{static{o(this,"Terminal")}constructor(e){this.idx=1,pa(this,Ls(e,r=>r!==void 0))}accept(e){e.visit(this)}};o(NT,"serializeGrammar");o(Xm,"serializeProduction")});var rs,aie=R(()=>{"use strict";MT();rs=class{static{o(this,"GAstVisitor")}visit(e){let r=e;switch(r.constructor){case Zr:return this.visitNonTerminal(r);case Sn:return this.visitAlternative(r);case Jr:return this.visitOption(r);case An:return this.visitRepetitionMandatory(r);case _n:return this.visitRepetitionMandatoryWithSeparator(r);case mn:return this.visitRepetitionWithSeparator(r);case br:return this.visitRepetition(r);case gn:return this.visitAlternation(r);case fr:return this.visitTerminal(r);case ts:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}});function rN(t){return t instanceof Sn||t instanceof Jr||t instanceof br||t instanceof An||t instanceof _n||t instanceof mn||t instanceof fr||t instanceof ts}function n0(t,e=[]){return t instanceof Jr||t instanceof br||t instanceof mn?!0:t instanceof gn?Nv(t.definition,n=>n0(n,e)):t instanceof Zr&&Fn(e,t)?!1:t instanceof ho?(t instanceof Zr&&e.push(t),Ia(t.definition,n=>n0(n,e))):!1}function nN(t){return t instanceof gn}function Rs(t){if(t instanceof Zr)return"SUBRULE";if(t instanceof Jr)return"OPTION";if(t instanceof gn)return"OR";if(t instanceof An)return"AT_LEAST_ONE";if(t instanceof _n)return"AT_LEAST_ONE_SEP";if(t instanceof mn)return"MANY_SEP";if(t instanceof br)return"MANY";if(t instanceof fr)return"CONSUME";throw Error("non exhaustive match")}var sie=R(()=>{"use strict";Pt();MT();o(rN,"isSequenceProd");o(n0,"isOptionalProd");o(nN,"isBranchingProd");o(Rs,"getProductionDslName")});var ns=R(()=>{"use strict";MT();aie();sie()});function oie(t,e,r){return[new Jr({definition:[new fr({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}var Pu,IT=R(()=>{"use strict";Pt();ns();Pu=class{static{o(this,"RestWalker")}walk(e,r=[]){Ee(e.definition,(n,i)=>{let a=fi(e.definition,i+1);if(n instanceof Zr)this.walkProdRef(n,a,r);else if(n instanceof fr)this.walkTerminal(n,a,r);else if(n instanceof Sn)this.walkFlat(n,a,r);else if(n instanceof Jr)this.walkOption(n,a,r);else if(n instanceof An)this.walkAtLeastOne(n,a,r);else if(n instanceof _n)this.walkAtLeastOneSep(n,a,r);else if(n instanceof mn)this.walkManySep(n,a,r);else if(n instanceof br)this.walkMany(n,a,r);else if(n instanceof gn)this.walkOr(n,a,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){let i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){let i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){let i=[new Jr({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){let i=oie(e,r,n);this.walk(e,i)}walkMany(e,r,n){let i=[new Jr({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){let i=oie(e,r,n);this.walk(e,i)}walkOr(e,r,n){let i=r.concat(n);Ee(e.definition,a=>{let s=new Sn({definition:[a]});this.walk(s,i)})}};o(oie,"restForRepetitionWithSeparator")});function i0(t){if(t instanceof Zr)return i0(t.referencedRule);if(t instanceof fr)return KMe(t);if(rN(t))return XMe(t);if(nN(t))return jMe(t);throw Error("non exhaustive match")}function XMe(t){let e=[],r=t.definition,n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=n0(a),e=e.concat(i0(a)),n=n+1,i=r.length>n;return Pm(e)}function jMe(t){let e=qe(t.definition,r=>i0(r));return Pm(Gr(e))}function KMe(t){return[t.terminalType]}var iN=R(()=>{"use strict";Pt();ns();o(i0,"first");o(XMe,"firstForSequence");o(jMe,"firstForBranching");o(KMe,"firstForTerminal")});var OT,aN=R(()=>{"use strict";OT="_~IN~_"});function lie(t){let e={};return Ee(t,r=>{let n=new sN(r).startWalking();pa(e,n)}),e}function QMe(t,e){return t.name+e+OT}var sN,cie=R(()=>{"use strict";IT();iN();Pt();aN();ns();sN=class extends Pu{static{o(this,"ResyncFollowsWalker")}constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){let i=QMe(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new Sn({definition:a}),l=i0(s);this.follows[i]=l}};o(lie,"computeAllProdsFollows");o(QMe,"buildBetweenProdsFollowPrefix")});function jm(t){let e=t.toString();if(PT.hasOwnProperty(e))return PT[e];{let r=ZMe.pattern(e);return PT[e]=r,r}}function uie(){PT={}}var PT,ZMe,BT=R(()=>{"use strict";Kv();PT={},ZMe=new Jd;o(jm,"getRegExpAst");o(uie,"clearRegExpParserCache")});function die(t,e=!1){try{let r=jm(t);return oN(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===fie)e&&e2(`${n2} Unable to optimize: < ${t.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.`);else{let n="";e&&(n=` + This will disable the lexer's first char optimizations. + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Wm(`${n2} + Failed parsing: < ${t.toString()} > + Using the @chevrotain/regexp-to-ast library + Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function oN(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof u=="number")FT(u,e,r);else{let h=u;if(r===!0)for(let f=h.from;f<=h.to;f++)FT(f,e,r);else{for(let f=h.from;f<=h.to&&f=Km){let f=h.from>=Km?h.from:Km,d=h.to,p=Lc(f),m=Lc(d);for(let g=p;g<=m;g++)e[g]=g}}}});break;case"Group":oN(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}let l=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&lN(s)===!1||s.type!=="Group"&&l===!1)break}break;default:throw Error("non exhaustive match!")}return or(e)}function FT(t,e,r){let n=Lc(t);e[n]=n,r===!0&&JMe(t,e)}function JMe(t,e){let r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){let i=Lc(n.charCodeAt(0));e[i]=i}else{let i=r.toLowerCase();if(i!==r){let a=Lc(i.charCodeAt(0));e[a]=a}}}function hie(t,e){return Za(t.value,r=>{if(typeof r=="number")return Fn(e,r);{let n=r;return Za(e,i=>n.from<=i&&i<=n.to)!==void 0}})}function lN(t){let e=t.quantifier;return e&&e.atLeast===0?!0:t.value?wt(t.value)?Ia(t.value,lN):lN(t.value):!1}function zT(t,e){if(e instanceof RegExp){let r=jm(e),n=new cN(t);return n.visit(r),n.found}else return Za(e,r=>Fn(t,r.charCodeAt(0)))!==void 0}var fie,n2,cN,pie=R(()=>{"use strict";Kv();Pt();qm();BT();uN();fie="Complement Sets are not supported for first char optimization",n2=`Unable to use "first char" lexer optimizations: +`;o(die,"getOptimizedStartCodesIndices");o(oN,"firstCharOptimizedIndices");o(FT,"addOptimizedIdxToResult");o(JMe,"handleIgnoreCase");o(hie,"findCode");o(lN,"isWholeOptional");cN=class extends _c{static{o(this,"CharCodeFinder")}constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){Fn(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?hie(e,this.targetCharCodes)===void 0&&(this.found=!0):hie(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};o(zT,"canMatchCharCode")});function yie(t,e){e=Xh(e,{useSticky:fN,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` +`],tracer:o((b,w)=>w(),"tracer")});let r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{yIe()});let n;r("Reject Lexer.NA",()=>{n=Kh(t,b=>b[a0]===ni.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=qe(n,b=>{let w=b[a0];if(zo(w)){let S=w.source;return S.length===1&&S!=="^"&&S!=="$"&&S!=="."&&!w.ignoreCase?S:S.length===2&&S[0]==="\\"&&!Fn(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],S[1])?S[1]:e.useSticky?gie(w):mie(w)}else{if(wi(w))return i=!0,{exec:w};if(typeof w=="object")return i=!0,w;if(typeof w=="string"){if(w.length===1)return w;{let S=w.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),T=new RegExp(S);return e.useSticky?gie(T):mie(T)}}else throw Error("non exhaustive match")}})});let s,l,u,h,f;r("misc mapping",()=>{s=qe(n,b=>b.tokenTypeIdx),l=qe(n,b=>{let w=b.GROUP;if(w!==ni.SKIPPED){if(di(w))return w;if(er(w))return!1;throw Error("non exhaustive match")}}),u=qe(n,b=>{let w=b.LONGER_ALT;if(w)return wt(w)?qe(w,T=>Yw(n,T)):[Yw(n,w)]}),h=qe(n,b=>b.PUSH_MODE),f=qe(n,b=>Xe(b,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{let b=Cie(e.lineTerminatorCharacters);d=qe(n,w=>!1),e.positionTracking!=="onlyOffset"&&(d=qe(n,w=>Xe(w,"LINE_BREAKS")?!!w.LINE_BREAKS:Eie(w,b)===!1&&zT(b,w.PATTERN)))});let p,m,g,y;r("Misc Mapping #2",()=>{p=qe(n,Tie),m=qe(a,mIe),g=Vr(n,(b,w)=>{let S=w.GROUP;return di(S)&&S!==ni.SKIPPED&&(b[S]=[]),b},{}),y=qe(a,(b,w)=>({pattern:a[w],longerAlt:u[w],canLineTerminator:d[w],isCustom:p[w],short:m[w],group:l[w],push:h[w],pop:f[w],tokenTypeIdx:s[w],tokenType:n[w]}))});let v=!0,x=[];return e.safeMode||r("First Char Optimization",()=>{x=Vr(n,(b,w,S)=>{if(typeof w.PATTERN=="string"){let T=w.PATTERN.charCodeAt(0),E=Lc(T);hN(b,E,y[S])}else if(wt(w.START_CHARS_HINT)){let T;Ee(w.START_CHARS_HINT,E=>{let _=typeof E=="string"?E.charCodeAt(0):E,A=Lc(_);T!==A&&(T=A,hN(b,A,y[S]))})}else if(zo(w.PATTERN))if(w.PATTERN.unicode)v=!1,e.ensureOptimizations&&Wm(`${n2} Unable to analyze < ${w.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{let T=die(w.PATTERN,e.ensureOptimizations);Qt(T)&&(v=!1),Ee(T,E=>{hN(b,E,y[S])})}else e.ensureOptimizations&&Wm(`${n2} TokenType: <${w.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`),v=!1;return b},[])}),{emptyGroups:g,patternIdxToConfig:y,charCodeToPatternIdxToConfig:x,hasCustom:i,canBeOptimized:v}}function vie(t,e){let r=[],n=tIe(t);r=r.concat(n.errors);let i=rIe(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(eIe(a)),r=r.concat(uIe(a)),r=r.concat(hIe(a,e)),r=r.concat(fIe(a)),r}function eIe(t){let e=[],r=$r(t,n=>zo(n[a0]));return e=e.concat(iIe(r)),e=e.concat(oIe(r)),e=e.concat(lIe(r)),e=e.concat(cIe(r)),e=e.concat(aIe(r)),e}function tIe(t){let e=$r(t,i=>!Xe(i,a0)),r=qe(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Gn.MISSING_PATTERN,tokenTypes:[i]})),n=jh(t,e);return{errors:r,valid:n}}function rIe(t){let e=$r(t,i=>{let a=i[a0];return!zo(a)&&!wi(a)&&!Xe(a,"exec")&&!di(a)}),r=qe(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Gn.INVALID_PATTERN,tokenTypes:[i]})),n=jh(t,e);return{errors:r,valid:n}}function iIe(t){class e extends _c{static{o(this,"EndAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitEndAnchor(a){this.found=!0}}let r=$r(t,i=>{let a=i.PATTERN;try{let s=jm(a),l=new e;return l.visit(s),l.found}catch{return nIe.test(a.source)}});return qe(r,i=>({message:`Unexpected RegExp Anchor Error: + Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$' + See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Gn.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function aIe(t){let e=$r(t,n=>n.PATTERN.test(""));return qe(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Gn.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}function oIe(t){class e extends _c{static{o(this,"StartAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitStartAnchor(a){this.found=!0}}let r=$r(t,i=>{let a=i.PATTERN;try{let s=jm(a),l=new e;return l.visit(s),l.found}catch{return sIe.test(a.source)}});return qe(r,i=>({message:`Unexpected RegExp Anchor Error: + Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^' + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Gn.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function lIe(t){let e=$r(t,n=>{let i=n[a0];return i instanceof RegExp&&(i.multiline||i.global)});return qe(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Gn.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function cIe(t){let e=[],r=qe(t,a=>Vr(t,(s,l)=>(a.PATTERN.source===l.PATTERN.source&&!Fn(e,l)&&l.PATTERN!==ni.NA&&(e.push(l),s.push(l)),s),[]));r=wc(r);let n=$r(r,a=>a.length>1);return qe(n,a=>{let s=qe(a,u=>u.name);return{message:`The same RegExp pattern ->${na(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:Gn.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}function uIe(t){let e=$r(t,n=>{if(!Xe(n,"GROUP"))return!1;let i=n.GROUP;return i!==ni.SKIPPED&&i!==ni.NA&&!di(i)});return qe(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Gn.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function hIe(t,e){let r=$r(t,i=>i.PUSH_MODE!==void 0&&!Fn(e,i.PUSH_MODE));return qe(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:Gn.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function fIe(t){let e=[],r=Vr(t,(n,i,a)=>{let s=i.PATTERN;return s===ni.NA||(di(s)?n.push({str:s,idx:a,tokenType:i}):zo(s)&&pIe(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return Ee(t,(n,i)=>{Ee(r,({str:a,idx:s,tokenType:l})=>{if(i${l.name}<- can never be matched. +Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition. +See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:u,type:Gn.UNREACHABLE_PATTERN,tokenTypes:[n,l]})}})}),e}function dIe(t,e){if(zo(e)){let r=e.exec(t);return r!==null&&r.index===0}else{if(wi(e))return e(t,0,[],{});if(Xe(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function pIe(t){return Za([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}function mie(t){let e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function gie(t){let e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function xie(t,e,r){let n=[];return Xe(t,Qm)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Qm+`> property in its definition +`,type:Gn.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Xe(t,GT)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+GT+`> property in its definition +`,type:Gn.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Xe(t,GT)&&Xe(t,Qm)&&!Xe(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Qm}: <${t.defaultMode}>which does not exist +`,type:Gn.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Xe(t,GT)&&Ee(t.modes,(i,a)=>{Ee(i,(s,l)=>{if(er(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${l}> +`,type:Gn.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Xe(s,"LONGER_ALT")){let u=wt(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];Ee(u,h=>{!er(h)&&!Fn(i,h)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${h.name}> on token <${s.name}> outside of mode <${a}> +`,type:Gn.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function bie(t,e,r){let n=[],i=!1,a=wc(Gr(or(t.modes))),s=Kh(a,u=>u[a0]===ni.NA),l=Cie(r);return e&&Ee(s,u=>{let h=Eie(u,l);if(h!==!1){let d={message:gIe(u,h),type:h.issue,tokenType:u};n.push(d)}else Xe(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(i=!0):zT(l,u.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. + This Lexer has been defined to track line and column information, + But none of the Token Types can be identified as matching a line terminator. + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS + for details.`,type:Gn.NO_LINE_BREAKS_FLAGS}),n}function wie(t){let e={},r=Dr(t);return Ee(r,n=>{let i=t[n];if(wt(i))e[n]=[];else throw Error("non exhaustive match")}),e}function Tie(t){let e=t.PATTERN;if(zo(e))return!1;if(wi(e))return!0;if(Xe(e,"exec"))return!0;if(di(e))return!1;throw Error("non exhaustive match")}function mIe(t){return di(t)&&t.length===1?t.charCodeAt(0):!1}function Eie(t,e){if(Xe(t,"LINE_BREAKS"))return!1;if(zo(t.PATTERN)){try{zT(e,t.PATTERN)}catch(r){return{issue:Gn.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(di(t.PATTERN))return!1;if(Tie(t))return{issue:Gn.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function gIe(t,e){if(e.issue===Gn.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern. + The problem is in the <${t.name}> Token Type + Root cause: ${e.errMsg}. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Gn.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. + The problem is in the <${t.name}> Token Type + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function Cie(t){return qe(t,r=>di(r)?r.charCodeAt(0):r)}function hN(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}function Lc(t){return t255?255+~~(t/255):t}}var a0,Qm,GT,fN,nIe,sIe,kie,Km,$T,uN=R(()=>{"use strict";Kv();i2();Pt();qm();pie();BT();a0="PATTERN",Qm="defaultMode",GT="modes",fN=typeof new RegExp("(?:)").sticky=="boolean";o(yie,"analyzeTokenTypes");o(vie,"validatePatterns");o(eIe,"validateRegExpPattern");o(tIe,"findMissingPatterns");o(rIe,"findInvalidPatterns");nIe=/[^\\][$]/;o(iIe,"findEndOfInputAnchor");o(aIe,"findEmptyMatchRegExps");sIe=/[^\\[][\^]|^\^/;o(oIe,"findStartOfInputAnchor");o(lIe,"findUnsupportedFlags");o(cIe,"findDuplicatePatterns");o(uIe,"findInvalidGroupType");o(hIe,"findModesThatDoNotExist");o(fIe,"findUnreachablePatterns");o(dIe,"testTokenType");o(pIe,"noMetaChar");o(mie,"addStartOfInput");o(gie,"addStickyFlag");o(xie,"performRuntimeChecks");o(bie,"performWarningRuntimeChecks");o(wie,"cloneEmptyGroups");o(Tie,"isCustomPattern");o(mIe,"isShortPattern");kie={test:o(function(t){let e=t.length;for(let r=this.lastIndex;r{r.isParent=r.categoryMatches.length>0})}function vIe(t){let e=Qr(t),r=t,n=!0;for(;n;){r=wc(Gr(qe(r,a=>a.CATEGORIES)));let i=jh(r,e);e=e.concat(i),Qt(i)?n=!1:r=i}return e}function xIe(t){Ee(t,e=>{dN(e)||(_ie[Sie]=e,e.tokenTypeIdx=Sie++),Aie(e)&&!wt(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Aie(e)||(e.CATEGORIES=[]),TIe(e)||(e.categoryMatches=[]),kIe(e)||(e.categoryMatchesMap={})})}function bIe(t){Ee(t,e=>{e.categoryMatches=[],Ee(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(_ie[n].tokenTypeIdx)})})}function wIe(t){Ee(t,e=>{Lie([],e)})}function Lie(t,e){Ee(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),Ee(e.CATEGORIES,r=>{let n=t.concat(e);Fn(n,r)||Lie(n,r)})}function dN(t){return Xe(t,"tokenTypeIdx")}function Aie(t){return Xe(t,"CATEGORIES")}function TIe(t){return Xe(t,"categoryMatches")}function kIe(t){return Xe(t,"categoryMatchesMap")}function Die(t){return Xe(t,"tokenTypeIdx")}var Sie,_ie,s0=R(()=>{"use strict";Pt();o(Bu,"tokenStructuredMatcher");o(Zm,"tokenStructuredMatcherNoCategories");Sie=1,_ie={};o(Fu,"augmentTokenTypes");o(vIe,"expandCategories");o(xIe,"assignTokenDefaultProps");o(bIe,"assignCategoriesTokensProp");o(wIe,"assignCategoriesMapProp");o(Lie,"singleAssignCategoriesToksMap");o(dN,"hasShortKeyProperty");o(Aie,"hasCategoriesProperty");o(TIe,"hasExtendingTokensTypesProperty");o(kIe,"hasExtendingTokensTypesMapProperty");o(Die,"isTokenType")});var pN,mN=R(()=>{"use strict";pN={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}}});var Gn,a2,ni,i2=R(()=>{"use strict";uN();Pt();qm();s0();mN();BT();(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(Gn||(Gn={}));a2={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` +`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:pN,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(a2);ni=class{static{o(this,"Lexer")}constructor(e,r=a2){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${i}>`);let{time:l,value:u}=t2(a),h=l>10?console.warn:console.log;return this.traceInitIndent time: ${l}ms`),this.traceInitIndent--,u}else return a()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. +a boolean 2nd argument is no longer supported`);this.config=pa({},a2,r);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===a2.lineTerminatorsPattern)this.config.lineTerminatorsPattern=kie;else if(this.config.lineTerminatorCharacters===a2.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.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),wt(e)?i={modes:{defaultMode:Qr(e)},defaultMode:Qm}:(a=!1,i=Qr(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(xie(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(bie(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Ee(i.modes,(l,u)=>{i.modes[u]=Kh(l,h=>er(h))});let s=Dr(i.modes);if(Ee(i.modes,(l,u)=>{this.TRACE_INIT(`Mode: <${u}> processing`,()=>{if(this.modes.push(u),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(vie(l,s))}),Qt(this.lexerDefinitionErrors)){Fu(l);let h;this.TRACE_INIT("analyzeTokenTypes",()=>{h=yie(l,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[u]=h.patternIdxToConfig,this.charCodeToPatternIdxToConfig[u]=h.charCodeToPatternIdxToConfig,this.emptyGroups=pa({},this.emptyGroups,h.emptyGroups),this.hasCustom=h.hasCustom||this.hasCustom,this.canModeBeOptimized[u]=h.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Qt(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let u=qe(this.lexerDefinitionErrors,h=>h.message).join(`----------------------- +`);throw new Error(`Errors detected in definition of Lexer: +`+u)}Ee(this.lexerDefinitionWarning,l=>{e2(l.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(fN?(this.chopInput=ea,this.match=this.matchWithTest):(this.updateLastIndex=qn,this.match=this.matchWithExec),a&&(this.handleModes=qn),this.trackStartLines===!1&&(this.computeNewColumn=ea),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=qn),/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}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{let l=Vr(this.canModeBeOptimized,(u,h,f)=>(h===!1&&u.push(f),u),[]);if(r.ensureOptimizations&&!Qt(l))throw Error(`Lexer Modes: < ${l.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",()=>{uie()}),this.TRACE_INIT("toFastProperties",()=>{r2(this)})})}tokenize(e,r=this.defaultMode){if(!Qt(this.lexerDefinitionErrors)){let i=qe(this.lexerDefinitionErrors,a=>a.message).join(`----------------------- +`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: +`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,s,l,u,h,f,d,p,m,g,y,v,x,b,w=e,S=w.length,T=0,E=0,_=this.hasCustom?0:Math.floor(e.length/10),A=new Array(_),L=[],M=this.trackStartLines?1:void 0,N=this.trackStartLines?1:void 0,k=wie(this.emptyGroups),I=this.trackStartLines,C=this.config.lineTerminatorsPattern,O=0,D=[],P=[],F=[],B=[];Object.freeze(B);let $;function z(){return D}o(z,"getPossiblePatternsSlow");function Y(J){let Z=Lc(J),H=P[Z];return H===void 0?B:H}o(Y,"getPossiblePatternsOptimized");let Q=o(J=>{if(F.length===1&&J.tokenType.PUSH_MODE===void 0){let Z=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(J);L.push({offset:J.startOffset,line:J.startLine,column:J.startColumn,length:J.image.length,message:Z})}else{F.pop();let Z=ma(F);D=this.patternIdxToConfig[Z],P=this.charCodeToPatternIdxToConfig[Z],O=D.length;let H=this.canModeBeOptimized[Z]&&this.config.safeMode===!1;P&&H?$=Y:$=z}},"pop_mode");function X(J){F.push(J),P=this.charCodeToPatternIdxToConfig[J],D=this.patternIdxToConfig[J],O=D.length,O=D.length;let Z=this.canModeBeOptimized[J]&&this.config.safeMode===!1;P&&Z?$=Y:$=z}o(X,"push_mode"),X.call(this,r);let ie,j=this.config.recoveryEnabled;for(;Tu.length){u=s,h=f,ie=ce;break}}}break}}if(u!==null){if(d=u.length,p=ie.group,p!==void 0&&(m=ie.tokenTypeIdx,g=this.createTokenInstance(u,T,m,ie.tokenType,M,N,d),this.handlePayload(g,h),p===!1?E=this.addToken(A,E,g):k[p].push(g)),e=this.chopInput(e,d),T=T+d,N=this.computeNewColumn(N,d),I===!0&&ie.canLineTerminator===!0){let q=0,K,se;C.lastIndex=0;do K=C.test(u),K===!0&&(se=C.lastIndex-1,q++);while(K===!0);q!==0&&(M=M+q,N=d-se,this.updateTokenEndLineColumnLocation(g,p,se,q,M,N,d))}this.handleModes(ie,Q,X,g)}else{let q=T,K=M,se=N,ce=j===!1;for(;ce===!1&&T{"use strict";Pt();i2();s0();o(zu,"tokenLabel");o(gN,"hasTokenLabel");EIe="parent",Rie="categories",Nie="label",Mie="group",Iie="push_mode",Oie="pop_mode",Pie="longer_alt",Bie="line_breaks",Fie="start_chars_hint";o(VT,"createToken");o(CIe,"createTokenInternal");fo=VT({name:"EOF",pattern:ni.NA});Fu([fo]);o(o0,"createTokenInstance");o(s2,"tokenMatcher")});var Gu,zie,Ol,Jm=R(()=>{"use strict";l0();Pt();ns();Gu={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${gN(t)?`--> ${zu(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){let a="Expecting: ",l=` +but found: '`+na(e).image+"'";if(n)return a+n+l;{let u=Vr(t,(p,m)=>p.concat(m),[]),h=qe(u,p=>`[${qe(p,m=>zu(m)).join(", ")}]`),d=`one of these possible Token sequences: +${qe(h,(p,m)=>` ${m+1}. ${p}`).join(` +`)}`;return a+d+l}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){let i="Expecting: ",s=` +but found: '`+na(e).image+"'";if(r)return i+r+s;{let u=`expecting at least one iteration which starts with one of these possible Token sequences:: + <${qe(t,h=>`[${qe(h,f=>zu(f)).join(",")}]`).join(" ,")}>`;return i+u+s}}};Object.freeze(Gu);zie={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- +inside top level rule: ->`+t.name+"<-"}},Ol={buildDuplicateFoundError(t,e){function r(f){return f instanceof fr?f.terminalType.name:f instanceof Zr?f.nonTerminalName:""}o(r,"getExtraProductionArgument");let n=t.name,i=na(e),a=i.idx,s=Rs(i),l=r(i),u=a>0,h=`->${s}${u?a:""}<- ${l?`with argument: ->${l}<-`:""} + appears more than once (${e.length} times) in the top level rule: ->${n}<-. + For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES + `;return h=h.replace(/[ \t]+/g," "),h=h.replace(/\s\s+/g,` +`),h},buildNamespaceConflictError(t){return`Namespace conflict found in grammar. +The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.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.`},buildAlternationPrefixAmbiguityError(t){let e=qe(t.prefixPath,i=>zu(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix +in inside <${t.topLevelRule.name}> Rule, +<${e}> 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.`},buildAlternationAmbiguityError(t){let e=qe(t.prefixPath,i=>zu(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in inside <${t.topLevelRule.name}> Rule, +<${e}> may appears as a prefix path in all these alternatives. +`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES +For Further details.`,n},buildEmptyRepetitionError(t){let e=Rs(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens. +This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in inside <${t.topLevelRule.name}> Rule. +Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives: + inside <${t.topLevelRule.name}> Rule. + has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){let e=t.topLevelRule.name,r=qe(t.leftRecursionPath,a=>a.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar. +rule: <${e}> can be invoked from itself (directly or indirectly) +without consuming any Tokens. The grammar path that causes this is: + ${n} + To fix this refactor your grammar to remove the left recursion. +see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof ts?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}}});function Gie(t,e){let r=new yN(t,e);return r.resolveRefs(),r.errors}var yN,$ie=R(()=>{"use strict";Ns();Pt();ns();o(Gie,"resolveGrammar");yN=class extends rs{static{o(this,"GastRefResolverVisitor")}constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){Ee(or(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:Pi.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}});function WT(t,e,r=[]){r=Qr(r);let n=[],i=0;function a(l){return l.concat(fi(t,i+1))}o(a,"remainingPathWith");function s(l){let u=WT(a(l),e,r);return n.concat(u)}for(o(s,"getAlternativesForProd");r.length{Qt(u.definition)===!1&&(n=s(u.definition))}),n;if(l instanceof fr)r.push(l.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:fi(t,i)}),n}function qT(t,e,r,n){let i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE",l=!1,u=e.length,h=u-n-1,f=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Qt(d);){let p=d.pop();if(p===s){l&&ma(d).idx<=h&&d.pop();continue}let m=p.def,g=p.idx,y=p.ruleStack,v=p.occurrenceStack;if(Qt(m))continue;let x=m[0];if(x===i){let b={idx:g,def:fi(m),ruleStack:Ru(y),occurrenceStack:Ru(v)};d.push(b)}else if(x instanceof fr)if(g=0;b--){let w=x.definition[b],S={idx:g,def:w.definition.concat(fi(m)),ruleStack:y,occurrenceStack:v};d.push(S),d.push(s)}else if(x instanceof Sn)d.push({idx:g,def:x.definition.concat(fi(m)),ruleStack:y,occurrenceStack:v});else if(x instanceof ts)d.push(SIe(x,g,y,v));else throw Error("non exhaustive match")}return f}function SIe(t,e,r,n){let i=Qr(r);i.push(t.name);let a=Qr(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}var vN,UT,eg,HT,o2,YT,l2,c2=R(()=>{"use strict";Pt();iN();IT();ns();vN=class extends Pu{static{o(this,"AbstractNextPossibleTokensWalker")}constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Qr(this.path.ruleStack).reverse(),this.occurrenceStack=Qr(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){Qt(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},UT=class extends vN{static{o(this,"NextAfterTokenWalker")}constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let i=r.concat(n),a=new Sn({definition:i});this.possibleTokTypes=i0(a),this.found=!0}}},eg=class extends Pu{static{o(this,"AbstractNextTerminalAfterProductionWalker")}constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},HT=class extends eg{static{o(this,"NextTerminalAfterManyWalker")}walkMany(e,r,n){if(e.idx===this.occurrence){let i=na(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof fr&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},o2=class extends eg{static{o(this,"NextTerminalAfterManySepWalker")}walkManySep(e,r,n){if(e.idx===this.occurrence){let i=na(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof fr&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},YT=class extends eg{static{o(this,"NextTerminalAfterAtLeastOneWalker")}walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=na(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof fr&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},l2=class extends eg{static{o(this,"NextTerminalAfterAtLeastOneSepWalker")}walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=na(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof fr&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};o(WT,"possiblePathsFrom");o(qT,"nextPossibleTokensAfter");o(SIe,"expandTopLevelRule")});function u2(t){if(t instanceof Jr||t==="Option")return $n.OPTION;if(t instanceof br||t==="Repetition")return $n.REPETITION;if(t instanceof An||t==="RepetitionMandatory")return $n.REPETITION_MANDATORY;if(t instanceof _n||t==="RepetitionMandatoryWithSeparator")return $n.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof mn||t==="RepetitionWithSeparator")return $n.REPETITION_WITH_SEPARATOR;if(t instanceof gn||t==="Alternation")return $n.ALTERNATION;throw Error("non exhaustive match")}function jT(t){let{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=u2(n);return a===$n.ALTERNATION?tg(e,r,i):rg(e,r,a,i)}function Uie(t,e,r,n,i,a){let s=tg(t,e,r),l=jie(s)?Zm:Bu;return a(s,n,l,i)}function Hie(t,e,r,n,i,a){let s=rg(t,e,i,r),l=jie(s)?Zm:Bu;return a(s[0],l,n)}function Yie(t,e,r,n){let i=t.length,a=Ia(t,s=>Ia(s,l=>l.length===1));if(e)return function(s){let l=qe(s,u=>u.GATE);for(let u=0;uGr(u)),l=Vr(s,(u,h,f)=>(Ee(h,d=>{Xe(u,d.tokenTypeIdx)||(u[d.tokenTypeIdx]=f),Ee(d.categoryMatches,p=>{Xe(u,p)||(u[p]=f)})}),u),{});return function(){let u=this.LA(1);return l[u.tokenTypeIdx]}}else return function(){for(let s=0;sa.length===1),i=t.length;if(n&&!r){let a=Gr(t);if(a.length===1&&Qt(a[0].categoryMatches)){let l=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===l}}else{let s=Vr(a,(l,u,h)=>(l[u.tokenTypeIdx]=!0,Ee(u.categoryMatches,f=>{l[f]=!0}),l),[]);return function(){let l=this.LA(1);return s[l.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;aWT([s],1)),n=Vie(r.length),i=qe(r,s=>{let l={};return Ee(s,u=>{let h=xN(u.partialPath);Ee(h,f=>{l[f]=!0})}),l}),a=r;for(let s=1;s<=e;s++){let l=a;a=Vie(l.length);for(let u=0;u{let x=xN(v.partialPath);Ee(x,b=>{i[u][b]=!0})})}}}}return n}function tg(t,e,r,n){let i=new XT(t,$n.ALTERNATION,n);return e.accept(i),qie(i.result,r)}function rg(t,e,r,n){let i=new XT(t,r);e.accept(i);let a=i.result,l=new bN(e,t,r).startWalking(),u=new Sn({definition:a}),h=new Sn({definition:l});return qie([u,h],n)}function KT(t,e){e:for(let r=0;r{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function jie(t){return Ia(t,e=>Ia(e,r=>Ia(r,n=>Qt(n.categoryMatches))))}var $n,bN,XT,ng=R(()=>{"use strict";Pt();c2();IT();s0();ns();(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})($n||($n={}));o(u2,"getProdType");o(jT,"getLookaheadPaths");o(Uie,"buildLookaheadFuncForOr");o(Hie,"buildLookaheadFuncForOptionalProd");o(Yie,"buildAlternativesLookAheadFunc");o(Wie,"buildSingleAlternativeLookaheadFunction");bN=class extends Pu{static{o(this,"RestDefinitionFinderWalker")}constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,$n.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,$n.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,$n.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,$n.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,$n.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},XT=class extends rs{static{o(this,"InsideDefinitionFinderVisitor")}constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,$n.OPTION)}visitRepetition(e){this.checkIsTarget(e,$n.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,$n.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,$n.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,$n.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,$n.ALTERNATION)}};o(Vie,"initializeArrayOfArrays");o(xN,"pathToHashKeys");o(AIe,"isUniquePrefixHash");o(qie,"lookAheadSequenceFromAlternatives");o(tg,"getLookaheadPathsForOr");o(rg,"getLookaheadPathsForOptionalProd");o(KT,"containsPath");o(Xie,"isStrictPrefixOfPath");o(jie,"areTokenCategoriesNotUsed")});function Kie(t){let e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return qe(e,r=>Object.assign({type:Pi.CUSTOM_LOOKAHEAD_VALIDATION},r))}function Qie(t,e,r,n){let i=ga(t,u=>_Ie(u,r)),a=IIe(t,e,r),s=ga(t,u=>RIe(u,r)),l=ga(t,u=>DIe(u,t,n,r));return i.concat(a,s,l)}function _Ie(t,e){let r=new wN;t.accept(r);let n=r.allProductions,i=IL(n,LIe),a=Ls(i,l=>l.length>1);return qe(or(a),l=>{let u=na(l),h=e.buildDuplicateFoundError(t,l),f=Rs(u),d={message:h,type:Pi.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:f,occurrence:u.idx},p=Zie(u);return p&&(d.parameter=p),d})}function LIe(t){return`${Rs(t)}_#_${t.idx}_#_${Zie(t)}`}function Zie(t){return t instanceof fr?t.terminalType.name:t instanceof Zr?t.nonTerminalName:""}function DIe(t,e,r,n){let i=[];if(Vr(e,(s,l)=>l.name===t.name?s+1:s,0)>1){let s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:Pi.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function Jie(t,e,r){let n=[],i;return Fn(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:Pi.INVALID_RULE_OVERRIDE,ruleName:t})),n}function kN(t,e,r,n=[]){let i=[],a=QT(e.definition);if(Qt(a))return[];{let s=t.name;Fn(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:Pi.LEFT_RECURSION,ruleName:s});let u=jh(a,n.concat([t])),h=ga(u,f=>{let d=Qr(n);return d.push(f),kN(t,f,r,d)});return i.concat(h)}}function QT(t){let e=[];if(Qt(t))return e;let r=na(t);if(r instanceof Zr)e.push(r.referencedRule);else if(r instanceof Sn||r instanceof Jr||r instanceof An||r instanceof _n||r instanceof mn||r instanceof br)e=e.concat(QT(r.definition));else if(r instanceof gn)e=Gr(qe(r.definition,a=>QT(a.definition)));else if(!(r instanceof fr))throw Error("non exhaustive match");let n=n0(r),i=t.length>1;if(n&&i){let a=fi(t);return e.concat(QT(a))}else return e}function eae(t,e){let r=new h2;t.accept(r);let n=r.alternations;return ga(n,a=>{let s=Ru(a.definition);return ga(s,(l,u)=>{let h=qT([l],[],Bu,1);return Qt(h)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:u}),type:Pi.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:u+1}]:[]})})}function tae(t,e,r){let n=new h2;t.accept(n);let i=n.alternations;return i=Kh(i,s=>s.ignoreAmbiguities===!0),ga(i,s=>{let l=s.idx,u=s.maxLookahead||e,h=tg(l,t,u,s),f=NIe(h,s,t,r),d=MIe(h,s,t,r);return f.concat(d)})}function RIe(t,e){let r=new h2;t.accept(r);let n=r.alternations;return ga(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:Pi.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}function rae(t,e,r){let n=[];return Ee(t,i=>{let a=new TN;i.accept(a);let s=a.allProductions;Ee(s,l=>{let u=u2(l),h=l.maxLookahead||e,f=l.idx,p=rg(f,i,u,h)[0];if(Qt(Gr(p))){let m=r.buildEmptyRepetitionError({topLevelRule:i,repetition:l});n.push({message:m,type:Pi.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function NIe(t,e,r,n){let i=[],a=Vr(t,(l,u,h)=>(e.definition[h].ignoreAmbiguities===!0||Ee(u,f=>{let d=[h];Ee(t,(p,m)=>{h!==m&&KT(p,f)&&e.definition[m].ignoreAmbiguities!==!0&&d.push(m)}),d.length>1&&!KT(i,f)&&(i.push(f),l.push({alts:d,path:f}))}),l),[]);return qe(a,l=>{let u=qe(l.alts,f=>f+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:u,prefixPath:l.path}),type:Pi.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:l.alts}})}function MIe(t,e,r,n){let i=Vr(t,(s,l,u)=>{let h=qe(l,f=>({idx:u,path:f}));return s.concat(h)},[]);return wc(ga(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];let u=s.idx,h=s.path,f=$r(i,p=>e.definition[p.idx].ignoreAmbiguities!==!0&&p.idx{let m=[p.idx+1,u+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:m,prefixPath:p.path}),type:Pi.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:m}})}))}function IIe(t,e,r){let n=[],i=qe(e,a=>a.name);return Ee(t,a=>{let s=a.name;if(Fn(i,s)){let l=r.buildNamespaceConflictError(a);n.push({message:l,type:Pi.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}var wN,h2,TN,f2=R(()=>{"use strict";Pt();Ns();ns();ng();c2();s0();o(Kie,"validateLookahead");o(Qie,"validateGrammar");o(_Ie,"validateDuplicateProductions");o(LIe,"identifyProductionForDuplicates");o(Zie,"getExtraProductionArgument");wN=class extends rs{static{o(this,"OccurrenceValidationCollector")}constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};o(DIe,"validateRuleDoesNotAlreadyExist");o(Jie,"validateRuleIsOverridden");o(kN,"validateNoLeftRecursion");o(QT,"getFirstNoneTerminal");h2=class extends rs{static{o(this,"OrCollector")}constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};o(eae,"validateEmptyOrAlternative");o(tae,"validateAmbiguousAlternationAlternatives");TN=class extends rs{static{o(this,"RepetitionCollector")}constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};o(RIe,"validateTooManyAlts");o(rae,"validateSomeNonEmptyLookaheadPath");o(NIe,"checkAlternativesAmbiguities");o(MIe,"checkPrefixAlternativesAmbiguities");o(IIe,"checkTerminalAndNoneTerminalsNameSpace")});function nae(t){let e=Xh(t,{errMsgProvider:zie}),r={};return Ee(t.rules,n=>{r[n.name]=n}),Gie(r,e.errMsgProvider)}function iae(t){return t=Xh(t,{errMsgProvider:Ol}),Qie(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}var aae=R(()=>{"use strict";Pt();$ie();f2();Jm();o(nae,"resolveGrammar");o(iae,"validateGrammar")});function nf(t){return Fn(uae,t.name)}var sae,oae,lae,cae,uae,ig,c0,d2,p2,m2,ag=R(()=>{"use strict";Pt();sae="MismatchedTokenException",oae="NoViableAltException",lae="EarlyExitException",cae="NotAllInputParsedException",uae=[sae,oae,lae,cae];Object.freeze(uae);o(nf,"isRecognitionException");ig=class extends Error{static{o(this,"RecognitionException")}constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},c0=class extends ig{static{o(this,"MismatchedTokenException")}constructor(e,r,n){super(e,r),this.previousToken=n,this.name=sae}},d2=class extends ig{static{o(this,"NoViableAltException")}constructor(e,r,n){super(e,r),this.previousToken=n,this.name=oae}},p2=class extends ig{static{o(this,"NotAllInputParsedException")}constructor(e,r){super(e,r),this.name=cae}},m2=class extends ig{static{o(this,"EarlyExitException")}constructor(e,r,n){super(e,r),this.previousToken=n,this.name=lae}}});function OIe(t,e,r,n,i,a,s){let l=this.getKeyForAutomaticLookahead(n,i),u=this.firstAfterRepMap[l];if(u===void 0){let p=this.getCurrRuleFullName(),m=this.getGAstProductions()[p];u=new a(m,i).startWalking(),this.firstAfterRepMap[l]=u}let h=u.token,f=u.occurrence,d=u.isEndOfRule;this.RULE_STACK.length===1&&d&&h===void 0&&(h=fo,f=1),!(h===void 0||f===void 0)&&this.shouldInRepetitionRecoveryBeTried(h,f,s)&&this.tryInRepetitionRecovery(t,e,r,h)}var EN,SN,CN,ZT,AN=R(()=>{"use strict";l0();Pt();ag();aN();Ns();EN={},SN="InRuleRecoveryException",CN=class extends Error{static{o(this,"InRuleRecoveryException")}constructor(e){super(e),this.name=SN}},ZT=class{static{o(this,"Recoverable")}initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Xe(e,"recoveryEnabled")?e.recoveryEnabled:is.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=OIe)}getTokenToInsert(e){let r=o0(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){let a=this.findReSyncTokenType(),s=this.exportLexerState(),l=[],u=!1,h=this.LA(1),f=this.LA(1),d=o(()=>{let p=this.LA(0),m=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:h,previous:p,ruleName:this.getCurrRuleFullName()}),g=new c0(m,h,this.LA(0));g.resyncedTokens=Ru(l),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!u;)if(this.tokenMatcher(f,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(f,a)?u=!0:(f=this.SKIP_TOKEN(),this.addToResyncTokens(f,l));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){let n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new CN("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Qt(r))return!1;let n=this.LA(1);return Za(r,a=>this.tokenMatcher(n,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return Fn(n,e)}findReSyncTokenType(){let e=this.flattenFollowSet(),r=this.LA(1),n=2;for(;;){let i=Za(e,a=>s2(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return EN;let e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return qe(e,(n,i)=>i===0?EN:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){let e=qe(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Gr(e)}getFollowSetFromFollowKey(e){if(e===EN)return[fo];let r=e.ruleName+e.idxInCallingRule+OT+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,fo)||r.push(e),r}reSyncTo(e){let r=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return Ru(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,l){}getCurrentGrammarPath(e,r){let n=this.getHumanReadableRuleStack(),i=Qr(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return qe(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};o(OIe,"attemptInRepetitionRecovery")});function JT(t,e,r){return r|e|t}var ek=R(()=>{"use strict";o(JT,"getKeyForAutomaticLookahead")});var $u,_N=R(()=>{"use strict";Pt();Jm();Ns();f2();ng();$u=class{static{o(this,"LLkLookaheadStrategy")}constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:is.maxLookahead}validate(e){let r=this.validateNoLeftRecursion(e.rules);if(Qt(r)){let n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),a=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...a]}return r}validateNoLeftRecursion(e){return ga(e,r=>kN(r,r,Ol))}validateEmptyOrAlternatives(e){return ga(e,r=>eae(r,Ol))}validateAmbiguousAlternationAlternatives(e,r){return ga(e,n=>tae(n,r,Ol))}validateSomeNonEmptyLookaheadPath(e,r){return rae(e,r,Ol)}buildLookaheadForAlternation(e){return Uie(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Yie)}buildLookaheadForOptional(e){return Hie(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,u2(e.prodType),Wie)}}});function PIe(t){tk.reset(),t.accept(tk);let e=tk.dslMethods;return tk.reset(),e}var rk,LN,tk,hae=R(()=>{"use strict";Pt();Ns();ek();ns();_N();rk=class{static{o(this,"LooksAhead")}initLooksAhead(e){this.dynamicTokensEnabled=Xe(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:is.dynamicTokensEnabled,this.maxLookahead=Xe(e,"maxLookahead")?e.maxLookahead:is.maxLookahead,this.lookaheadStrategy=Xe(e,"lookaheadStrategy")?e.lookaheadStrategy:new $u({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){Ee(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:l,repetitionWithSeparator:u}=PIe(r);Ee(n,h=>{let f=h.idx===0?"":h.idx;this.TRACE_INIT(`${Rs(h)}${f}`,()=>{let d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:h.idx,rule:r,maxLookahead:h.maxLookahead||this.maxLookahead,hasPredicates:h.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),p=JT(this.fullRuleNameToShort[r.name],256,h.idx);this.setLaFuncCache(p,d)})}),Ee(i,h=>{this.computeLookaheadFunc(r,h.idx,768,"Repetition",h.maxLookahead,Rs(h))}),Ee(a,h=>{this.computeLookaheadFunc(r,h.idx,512,"Option",h.maxLookahead,Rs(h))}),Ee(s,h=>{this.computeLookaheadFunc(r,h.idx,1024,"RepetitionMandatory",h.maxLookahead,Rs(h))}),Ee(l,h=>{this.computeLookaheadFunc(r,h.idx,1536,"RepetitionMandatoryWithSeparator",h.maxLookahead,Rs(h))}),Ee(u,h=>{this.computeLookaheadFunc(r,h.idx,1280,"RepetitionWithSeparator",h.maxLookahead,Rs(h))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{let l=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),u=JT(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(u,l)})}getKeyForAutomaticLookahead(e,r){let n=this.getLastExplicitRuleShortName();return JT(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},LN=class extends rs{static{o(this,"DslMethodsCollectorVisitor")}constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},tk=new LN;o(PIe,"collectMethods")});function NN(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset{"use strict";o(NN,"setNodeLocationOnlyOffset");o(MN,"setNodeLocationFull");o(fae,"addTerminalToCst");o(dae,"addNoneTerminalToCst")});function IN(t,e){Object.defineProperty(t,BIe,{enumerable:!1,configurable:!0,writable:!1,value:e})}var BIe,mae=R(()=>{"use strict";BIe="name";o(IN,"defineNameProp")});function FIe(t,e){let r=Dr(t),n=r.length;for(let i=0;is.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: + ${a.join(` + +`).replace(/\n/g,` + `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function yae(t,e,r){let n=o(function(){},"derivedConstructor");IN(n,t+"BaseSemanticsWithDefaults");let i=Object.create(r.prototype);return Ee(e,a=>{i[a]=FIe}),n.prototype=i,n.prototype.constructor=n,n}function zIe(t,e){return GIe(t,e)}function GIe(t,e){let r=$r(e,i=>wi(t[i])===!1),n=qe(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:ON.MISSING_METHOD,methodName:i}));return wc(n)}var ON,vae=R(()=>{"use strict";Pt();mae();o(FIe,"defaultVisit");o(gae,"createBaseSemanticVisitorConstructor");o(yae,"createBaseVisitorConstructorWithDefaults");(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(ON||(ON={}));o(zIe,"validateVisitor");o(GIe,"validateMissingCstMethods")});var sk,xae=R(()=>{"use strict";pae();Pt();vae();Ns();sk=class{static{o(this,"TreeBuilder")}initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Xe(e,"nodeLocationTracking")?e.nodeLocationTracking:is.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=qn,this.cstFinallyStateUpdate=qn,this.cstPostTerminal=qn,this.cstPostNonTerminal=qn,this.cstPostRule=qn;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=MN,this.setNodeLocationFromNode=MN,this.cstPostRule=qn,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=qn,this.setNodeLocationFromNode=qn,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=NN,this.setNodeLocationFromNode=NN,this.cstPostRule=qn,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=qn,this.setNodeLocationFromNode=qn,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=qn,this.setNodeLocationFromNode=qn,this.cstPostRule=qn,this.setInitialNodeLocation=qn;else throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];fae(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];dae(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(er(this.baseCstVisitorConstructor)){let e=gae(this.className,Dr(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(er(this.baseCstVisitorWithDefaultsConstructor)){let e=yae(this.className,Dr(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){let e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}}});var ok,bae=R(()=>{"use strict";Ns();ok=class{static{o(this,"LexerAdapter")}initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):sg}LA(e){let r=this.currIdx+e;return r<0||this.tokVectorLength<=r?sg:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}});var lk,wae=R(()=>{"use strict";Pt();ag();Ns();Jm();f2();ns();lk=class{static{o(this,"RecognizerApi")}ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=og){if(Fn(this.definedRulesNames,e)){let s={message:Ol.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Pi.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);let i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=og){let i=Jie(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let a=this.defineRule(e,r,n);return this[e]=a,a}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(nf(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return NT(or(this.gastProductionsCache))}}});var ck,Tae=R(()=>{"use strict";Pt();ek();ag();ng();c2();Ns();AN();l0();s0();ck=class{static{o(this,"RecognizerEngine")}initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Zm,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Xe(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. + See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 + For Further details.`);if(wt(e)){if(Qt(e))throw Error(`A Token Vocabulary cannot be empty. + Note that the first argument for the parser constructor + is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. + See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 + For Further details.`)}if(wt(e))this.tokensMap=Vr(e,(a,s)=>(a[s.name]=s,a),{});else if(Xe(e,"modes")&&Ia(Gr(or(e.modes)),Die)){let a=Gr(or(e.modes)),s=Pm(a);this.tokensMap=Vr(s,(l,u)=>(l[u.name]=u,l),{})}else if(pn(e))this.tokensMap=Qr(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=fo;let n=Xe(e,"modes")?Gr(or(e.modes)):or(e),i=Ia(n,a=>Qt(a.categoryMatches));this.tokenMatcher=i?Zm:Bu,Fu(or(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' +Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=Xe(n,"resyncEnabled")?n.resyncEnabled:og.resyncEnabled,a=Xe(n,"recoveryValueFunc")?n.recoveryValueFunc:og.recoveryValueFunc,s=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let l;return this.outputCst===!0?l=o(function(...f){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,f);let d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,i,a)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTry"):l=o(function(...f){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,f)}catch(d){return this.invokeRuleCatch(d,i,a)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTryCst"),Object.assign(l,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){let i=this.RULE_STACK.length===1,a=r&&!this.isBackTracking()&&this.recoveryEnabled;if(nf(e)){let s=e;if(a){let l=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(l))if(s.resyncedTokens=this.reSyncTo(l),this.outputCst){let u=this.CST_STACK[this.CST_STACK.length-1];return u.recoveredNode=!0,u}else return n(e);else{if(this.outputCst){let u=this.CST_STACK[this.CST_STACK.length-1];u.recoveredNode=!0,s.partialCstResult=u}throw s}}else{if(i)return this.moveToTerminatedState(),n(e);throw s}}else throw e}optionInternal(e,r){let n=this.getKeyForAutomaticLookahead(512,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof e!="function"){a=e.DEF;let s=e.GATE;if(s!==void 0){let l=i;i=o(()=>s.call(this)&&l.call(this),"lookAheadFunc")}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;let s=r.GATE;if(s!==void 0){let l=i;i=o(()=>s.call(this)&&l.call(this),"lookAheadFunc")}}else a=r;if(i.call(this)===!0){let s=this.doSingleRepetition(a);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,$n.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,1024,e,YT)}atLeastOneSepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){let i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let l=o(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,l,i,l2],l,1536,e,l2)}else throw this.raiseEarlyExitException(e,$n.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;let l=r.GATE;if(l!==void 0){let u=i;i=o(()=>l.call(this)&&u.call(this),"lookaheadFunction")}}else a=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,768,e,HT,s)}manySepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){let i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let l=o(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,l,i,o2],l,1280,e,o2)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,1536,e,a)}doSingleRepetition(e){let r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){let n=this.getKeyForAutomaticLookahead(256,r),i=wt(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new p2(r,e))}}subruleInternal(e,r,n){let i;try{let a=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,a),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(a){throw this.subruleInternalError(a,n,e.ruleName)}}subruleInternalError(e,r,n){throw nf(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{let a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),i=a):this.consumeInternalError(e,a,n)}catch(a){i=this.consumeInternalRecovery(e,r,a)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i,a=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new c0(i,r,a))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(a){throw a.name===SN?n:a}}else throw n}saveRecogState(){let e=this.errors,r=Qr(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),fo)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}});var uk,kae=R(()=>{"use strict";ag();Pt();ng();Ns();uk=class{static{o(this,"ErrorHandler")}initErrorHandler(e){this._errors=[],this.errorMessageProvider=Xe(e,"errorMessageProvider")?e.errorMessageProvider:is.errorMessageProvider}SAVE_ERROR(e){if(nf(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Qr(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Qr(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){let i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],l=rg(e,a,r,this.maxLookahead)[0],u=[];for(let f=1;f<=this.maxLookahead;f++)u.push(this.LA(f));let h=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:l,actual:u,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new m2(h,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=tg(e,i,this.maxLookahead),s=[];for(let h=1;h<=this.maxLookahead;h++)s.push(this.LA(h));let l=this.LA(0),u=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:l,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new d2(u,this.LA(1),l))}}});var hk,Eae=R(()=>{"use strict";c2();Pt();hk=class{static{o(this,"ContentAssist")}initContentAssist(){}computeContentAssist(e,r){let n=this.gastProductionsCache[e];if(er(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return qT([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let r=na(e.ruleStack),i=this.getGAstProductions()[r];return new UT(i,e).startWalking()}}});function y2(t,e,r,n=!1){dk(r);let i=ma(this.recordingProdStack),a=wi(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),Xe(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),pk}function UIe(t,e){dk(e);let r=ma(this.recordingProdStack),n=wt(t)===!1,i=n===!1?t:t.DEF,a=new gn({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});Xe(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);let s=Nv(i,l=>wi(l.GATE));return a.hasPredicates=s,r.definition.push(a),Ee(i,l=>{let u=new Sn({definition:[]});a.definition.push(u),Xe(l,"IGNORE_AMBIGUITIES")?u.ignoreAmbiguities=l.IGNORE_AMBIGUITIES:Xe(l,"GATE")&&(u.ignoreAmbiguities=!0),this.recordingProdStack.push(u),l.ALT.call(this),this.recordingProdStack.pop()}),pk}function Aae(t){return t===0?"":`${t}`}function dk(t){if(t<0||t>Sae){let e=new Error(`Invalid DSL Method idx value: <${t}> + Idx value must be a none negative value smaller than ${Sae+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}var pk,Cae,Sae,_ae,Lae,VIe,fk,Dae=R(()=>{"use strict";Pt();ns();i2();s0();l0();Ns();ek();pk={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(pk);Cae=!0,Sae=Math.pow(2,8)-1,_ae=VT({name:"RECORDING_PHASE_TOKEN",pattern:ni.NA});Fu([_ae]);Lae=o0(_ae,`This IToken indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(Lae);VIe={name:`This CSTNode indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},fk=class{static{o(this,"GastRecorder")}initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){let r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{let e=this;for(let r=0;r<10;r++){let n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return sg}topLevelRuleRecord(e,r){try{let n=new ts({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+` + This error was thrown during the "grammar recording phase" For more info see: + https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return y2.call(this,Jr,e,r)}atLeastOneInternalRecord(e,r){y2.call(this,An,r,e)}atLeastOneSepFirstInternalRecord(e,r){y2.call(this,_n,r,e,Cae)}manyInternalRecord(e,r){y2.call(this,br,r,e)}manySepFirstInternalRecord(e,r){y2.call(this,mn,r,e,Cae)}orInternalRecord(e,r){return UIe.call(this,e,r)}subruleInternalRecord(e,r,n){if(dk(r),!e||Xe(e,"ruleName")===!1){let l=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw l.KNOWN_RECORDER_ERROR=!0,l}let i=ma(this.recordingProdStack),a=e.ruleName,s=new Zr({idx:r,nonTerminalName:a,label:n?.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?VIe:pk}consumeInternalRecord(e,r,n){if(dk(r),!dN(e)){let s=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}let i=ma(this.recordingProdStack),a=new fr({idx:r,terminalType:e,label:n?.LABEL});return i.definition.push(a),Lae}};o(y2,"recordProd");o(UIe,"recordOrProd");o(Aae,"getIdxSuffix");o(dk,"assertMethodIdxIsValid")});var mk,Rae=R(()=>{"use strict";Pt();qm();Ns();mk=class{static{o(this,"PerformanceTracer")}initPerformanceTracer(e){if(Xe(e,"traceInitPerf")){let r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=is.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);let{time:i,value:a}=t2(r),s=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,a}else return r()}}});function Nae(t,e){e.forEach(r=>{let n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;let a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(t.prototype,i,a):t.prototype[i]=r.prototype[i]})})}var Mae=R(()=>{"use strict";o(Nae,"applyMixins")});function gk(t=void 0){return function(){return t}}var sg,is,og,Pi,v2,x2,Ns=R(()=>{"use strict";Pt();qm();cie();l0();Jm();aae();AN();hae();xae();bae();wae();Tae();kae();Eae();Dae();Rae();Mae();f2();sg=o0(fo,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(sg);is=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Gu,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),og=Object.freeze({recoveryValueFunc:o(()=>{},"recoveryValueFunc"),resyncEnabled:!0});(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(Pi||(Pi={}));o(gk,"EMPTY_ALT");v2=class t{static{o(this,"Parser")}static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;let r=this.className;this.TRACE_INIT("toFastProps",()=>{r2(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),Ee(this.definedRulesNames,i=>{let s=this[i].originalGrammarAction,l;this.TRACE_INIT(`${i} Rule`,()=>{l=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=l})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=nae({rules:or(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Qt(n)&&this.skipValidations===!1){let i=iae({rules:or(this.gastProductionsCache),tokenTypes:or(this.tokensMap),errMsgProvider:Ol,grammarName:r}),a=Kie({lookaheadStrategy:this.lookaheadStrategy,rules:or(this.gastProductionsCache),tokenTypes:or(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),Qt(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let i=lie(or(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:or(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(or(this.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!Qt(this.definitionErrors))throw e=qe(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected: + ${e.join(` +------------------------------- +`)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),Xe(r,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. + Please use the flag on the relevant DSL method instead. + See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES + For further details.`);this.skipValidations=Xe(r,"skipValidations")?r.skipValidations:is.skipValidations}};v2.DEFER_DEFINITION_ERRORS_HANDLING=!1;Nae(v2,[ZT,rk,sk,ok,ck,lk,uk,hk,fk,mk]);x2=class extends v2{static{o(this,"EmbeddedActionsParser")}constructor(e,r=is){let n=Qr(r);n.outputCst=!1,super(e,n)}}});var Iae=R(()=>{"use strict";ns()});var Oae=R(()=>{"use strict"});var Pae=R(()=>{"use strict";Iae();Oae()});var Bae=R(()=>{"use strict";tN()});var u0=R(()=>{"use strict";tN();Ns();i2();l0();ng();_N();Jm();ag();mN();ns();ns();Pae();Bae()});function h0(t,e,r){return`${t.name}_${e}_${r}`}function $ae(t){let e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};KIe(e,t);let r=t.length;for(let n=0;nVae(t,e,s));return hg(t,e,n,r,...i)}function rOe(t,e,r){let n=ia(t,e,r,{type:af});sf(t,n);let i=hg(t,e,n,r,f0(t,e,r));return nOe(t,e,r,i)}function f0(t,e,r){let n=$r(qe(r.definition,i=>Vae(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:aOe(t,n)}function Uae(t,e,r,n,i){let a=n.left,s=n.right,l=ia(t,e,r,{type:jIe});sf(t,l);let u=ia(t,e,r,{type:Gae});return a.loopback=l,u.loopback=l,t.decisionMap[h0(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=l,Ei(s,l),i===void 0?(Ei(l,a),Ei(l,u)):(Ei(l,u),Ei(l,i.left),Ei(i.right,a)),{left:a,right:u}}function Hae(t,e,r,n,i){let a=n.left,s=n.right,l=ia(t,e,r,{type:XIe});sf(t,l);let u=ia(t,e,r,{type:Gae}),h=ia(t,e,r,{type:qIe});return l.loopback=h,u.loopback=h,Ei(l,a),Ei(l,u),Ei(s,h),i!==void 0?(Ei(h,u),Ei(h,i.left),Ei(i.right,a)):Ei(h,l),t.decisionMap[h0(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=l,{left:l,right:u}}function nOe(t,e,r,n){let i=n.left,a=n.right;return Ei(i,a),t.decisionMap[h0(e,"Option",r.idx)]=i,n}function sf(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function hg(t,e,r,n,...i){let a=ia(t,e,n,{type:WIe,start:r});r.end=a;for(let l of i)l!==void 0?(Ei(r,l.left),Ei(l.right,a)):Ei(r,a);let s={left:r,right:a};return t.decisionMap[h0(e,iOe(n),n.idx)]=r,s}function iOe(t){if(t instanceof gn)return"Alternation";if(t instanceof Jr)return"Option";if(t instanceof br)return"Repetition";if(t instanceof mn)return"RepetitionWithSeparator";if(t instanceof An)return"RepetitionMandatory";if(t instanceof _n)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function aOe(t,e){let r=e.length;for(let a=0;a{"use strict";Mm();LL();u0();o(h0,"buildATNKey");af=1,YIe=2,Fae=4,zae=5,ug=7,WIe=8,qIe=9,XIe=10,jIe=11,Gae=12,b2=class{static{o(this,"AbstractTransition")}constructor(e){this.target=e}isEpsilon(){return!1}},lg=class extends b2{static{o(this,"AtomTransition")}constructor(e,r){super(e),this.tokenType=r}},w2=class extends b2{static{o(this,"EpsilonTransition")}constructor(e){super(e)}isEpsilon(){return!0}},cg=class extends b2{static{o(this,"RuleTransition")}constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}};o($ae,"createATN");o(KIe,"createRuleStartAndStopATNStates");o(Vae,"atom");o(QIe,"repetition");o(ZIe,"repetitionSep");o(JIe,"repetitionMandatory");o(eOe,"repetitionMandatorySep");o(tOe,"alternation");o(rOe,"option");o(f0,"block");o(Uae,"plus");o(Hae,"star");o(nOe,"optional");o(sf,"defineDecisionState");o(hg,"makeAlts");o(iOe,"getProdType");o(aOe,"makeBlock");o(BN,"tokenRef");o(sOe,"ruleRef");o(oOe,"buildRuleHandle");o(Ei,"epsilon");o(ia,"newState");o(FN,"addTransition");o(lOe,"removeState")});function zN(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}var T2,fg,Wae=R(()=>{"use strict";Mm();T2={},fg=class{static{o(this,"ATNConfigSet")}constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){let r=zN(e);r in this.map||(this.map[r]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return qe(this.configs,e=>e.alt)}get key(){let e="";for(let r in this.map)e+=r+":";return e}};o(zN,"getATNConfigKey")});function cOe(t,e){let r={};return n=>{let i=n.toString(),a=r[i];return a!==void 0||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}function Xae(t,e=!0){let r=new Set;for(let n of t){let i=new Set;for(let a of n){if(a===void 0){if(e)break;return!1}let s=[a.tokenTypeIdx].concat(a.categoryMatches);for(let l of s)if(r.has(l)){if(!i.has(l))return!1}else r.add(l),i.add(l)}}return!0}function uOe(t){let e=t.decisionStates.length,r=Array(e);for(let n=0;nzu(i)).join(", "),r=t.production.idx===0?"":t.production.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${mOe(t.production)}${r}> inside <${t.topLevelRule.name}> Rule, +<${e}> may appears as a prefix path in all these alternatives. +`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES +For Further details.`,n}function mOe(t){if(t instanceof Zr)return"SUBRULE";if(t instanceof Jr)return"OPTION";if(t instanceof gn)return"OR";if(t instanceof An)return"AT_LEAST_ONE";if(t instanceof _n)return"AT_LEAST_ONE_SEP";if(t instanceof mn)return"MANY_SEP";if(t instanceof br)return"MANY";if(t instanceof fr)return"CONSUME";throw Error("non exhaustive match")}function gOe(t,e,r){let n=ga(e.configs.elements,a=>a.state.transitions),i=nte(n.filter(a=>a instanceof lg).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function yOe(t,e){return t.edges[e.tokenTypeIdx]}function vOe(t,e,r){let n=new fg,i=[];for(let s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===ug){i.push(s);continue}let l=s.state.transitions.length;for(let u=0;u0&&!kOe(a))for(let s of i)a.add(s);return a}function xOe(t,e){if(t instanceof lg&&s2(e,t.tokenType))return t.target}function bOe(t,e){let r;for(let n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}function Kae(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function jae(t,e,r,n){return n=Qae(t,n),e.edges[r.tokenTypeIdx]=n,n}function Qae(t,e){if(e===T2)return e;let r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}function wOe(t){let e=new fg,r=t.transitions.length;for(let n=0;n0){let i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};vk(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);let n=r.transitions.length;for(let i=0;i1)return!0;return!1}function _Oe(t){for(let e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var yk,qae,k2,Zae=R(()=>{"use strict";u0();Yae();Wae();BL();RL();ite();Mm();fw();$w();Ww();$L();o(cOe,"createDFACache");yk=class{static{o(this,"PredicateSet")}constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="",r=this.predicates.length;for(let n=0;nconsole.log(n)}initialize(e){this.atn=$ae(e.rules),this.dfas=uOe(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){let{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,s=this.dfas,l=this.logging,u=h0(n,"Alternation",r),f=this.atn.decisionMap[u].decision,d=qe(jT({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),p=>qe(p,m=>m[0]));if(Xae(d,!1)&&!a){let p=Vr(d,(m,g,y)=>(Ee(g,v=>{v&&(m[v.tokenTypeIdx]=y,Ee(v.categoryMatches,x=>{m[x]=y}))}),m),{});return i?function(m){var g;let y=this.LA(1),v=p[y.tokenTypeIdx];if(m!==void 0&&v!==void 0){let x=(g=m[v])===null||g===void 0?void 0:g.GATE;if(x!==void 0&&x.call(this)===!1)return}return v}:function(){let m=this.LA(1);return p[m.tokenTypeIdx]}}else return i?function(p){let m=new yk,g=p===void 0?0:p.length;for(let v=0;vqe(p,m=>m[0]));if(Xae(d)&&d[0][0]&&!a){let p=d[0],m=Gr(p);if(m.length===1&&Qt(m[0].categoryMatches)){let y=m[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===y}}else{let g=Vr(m,(y,v)=>(v!==void 0&&(y[v.tokenTypeIdx]=!0,Ee(v.categoryMatches,x=>{y[x]=!0})),y),{});return function(){let y=this.LA(1);return g[y.tokenTypeIdx]===!0}}}return function(){let p=GN.call(this,s,f,qae,l);return typeof p=="object"?!1:p===0}}};o(Xae,"isLL1Sequence");o(uOe,"initATNSimulator");o(GN,"adaptivePredict");o(hOe,"performLookahead");o(fOe,"computeLookaheadTarget");o(dOe,"reportLookaheadAmbiguity");o(pOe,"buildAmbiguityError");o(mOe,"getProductionDslName");o(gOe,"buildAdaptivePredictError");o(yOe,"getExistingTargetState");o(vOe,"computeReachSet");o(xOe,"getReachableTarget");o(bOe,"getUniqueAlt");o(Kae,"newDFAState");o(jae,"addDFAEdge");o(Qae,"addDFAState");o(wOe,"computeStartState");o(vk,"closure");o(TOe,"getEpsilonTarget");o(kOe,"hasConfigInRuleStopState");o(EOe,"allConfigsInRuleStopStates");o(COe,"hasConflictTerminatingPrediction");o(SOe,"getConflictingAltSets");o(AOe,"hasConflictingAltSet");o(_Oe,"hasStateAssociatedWithOneAlt")});var Jae=R(()=>{"use strict";Zae()});var ese,$N,tse,xk,Ur,wr,bk,rse,VN,nse,ise,ase,sse,UN,ose,lse,cse,wk,dg,pg,HN,mg,use,YN,WN,qN,XN,jN,hse,fse,KN,dse,QN,E2,pse,mse,gse,yse,vse,xse,bse,wse,Tk,Tse,kse,Ese,Cse,Sse,Ase,_se,Lse,Dse,Rse,Nse,kk,Mse,Ise,Ose,Pse,Bse,Fse,zse,Gse,$se,Vse,Use,Hse,Yse,ZN,JN,Wse,qse,Xse,jse,Kse,Qse,Zse,Jse,eoe,eM,Fe,tM=R(()=>{"use strict";(function(t){function e(r){return typeof r=="string"}o(e,"is"),t.is=e})(ese||(ese={}));(function(t){function e(r){return typeof r=="string"}o(e,"is"),t.is=e})($N||($N={}));(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}o(e,"is"),t.is=e})(tse||(tse={}));(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}o(e,"is"),t.is=e})(xk||(xk={}));(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=xk.MAX_VALUE),i===Number.MAX_VALUE&&(i=xk.MAX_VALUE),{line:n,character:i}}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.objectLiteral(i)&&Fe.uinteger(i.line)&&Fe.uinteger(i.character)}o(r,"is"),t.is=r})(Ur||(Ur={}));(function(t){function e(n,i,a,s){if(Fe.uinteger(n)&&Fe.uinteger(i)&&Fe.uinteger(a)&&Fe.uinteger(s))return{start:Ur.create(n,i),end:Ur.create(a,s)};if(Ur.is(n)&&Ur.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${a}, ${s}]`)}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.objectLiteral(i)&&Ur.is(i.start)&&Ur.is(i.end)}o(r,"is"),t.is=r})(wr||(wr={}));(function(t){function e(n,i){return{uri:n,range:i}}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.objectLiteral(i)&&wr.is(i.range)&&(Fe.string(i.uri)||Fe.undefined(i.uri))}o(r,"is"),t.is=r})(bk||(bk={}));(function(t){function e(n,i,a,s){return{targetUri:n,targetRange:i,targetSelectionRange:a,originSelectionRange:s}}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.objectLiteral(i)&&wr.is(i.targetRange)&&Fe.string(i.targetUri)&&wr.is(i.targetSelectionRange)&&(wr.is(i.originSelectionRange)||Fe.undefined(i.originSelectionRange))}o(r,"is"),t.is=r})(rse||(rse={}));(function(t){function e(n,i,a,s){return{red:n,green:i,blue:a,alpha:s}}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.objectLiteral(i)&&Fe.numberRange(i.red,0,1)&&Fe.numberRange(i.green,0,1)&&Fe.numberRange(i.blue,0,1)&&Fe.numberRange(i.alpha,0,1)}o(r,"is"),t.is=r})(VN||(VN={}));(function(t){function e(n,i){return{range:n,color:i}}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.objectLiteral(i)&&wr.is(i.range)&&VN.is(i.color)}o(r,"is"),t.is=r})(nse||(nse={}));(function(t){function e(n,i,a){return{label:n,textEdit:i,additionalTextEdits:a}}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.objectLiteral(i)&&Fe.string(i.label)&&(Fe.undefined(i.textEdit)||pg.is(i))&&(Fe.undefined(i.additionalTextEdits)||Fe.typedArray(i.additionalTextEdits,pg.is))}o(r,"is"),t.is=r})(ise||(ise={}));(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(ase||(ase={}));(function(t){function e(n,i,a,s,l,u){let h={startLine:n,endLine:i};return Fe.defined(a)&&(h.startCharacter=a),Fe.defined(s)&&(h.endCharacter=s),Fe.defined(l)&&(h.kind=l),Fe.defined(u)&&(h.collapsedText=u),h}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.objectLiteral(i)&&Fe.uinteger(i.startLine)&&Fe.uinteger(i.startLine)&&(Fe.undefined(i.startCharacter)||Fe.uinteger(i.startCharacter))&&(Fe.undefined(i.endCharacter)||Fe.uinteger(i.endCharacter))&&(Fe.undefined(i.kind)||Fe.string(i.kind))}o(r,"is"),t.is=r})(sse||(sse={}));(function(t){function e(n,i){return{location:n,message:i}}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.defined(i)&&bk.is(i.location)&&Fe.string(i.message)}o(r,"is"),t.is=r})(UN||(UN={}));(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(ose||(ose={}));(function(t){t.Unnecessary=1,t.Deprecated=2})(lse||(lse={}));(function(t){function e(r){let n=r;return Fe.objectLiteral(n)&&Fe.string(n.href)}o(e,"is"),t.is=e})(cse||(cse={}));(function(t){function e(n,i,a,s,l,u){let h={range:n,message:i};return Fe.defined(a)&&(h.severity=a),Fe.defined(s)&&(h.code=s),Fe.defined(l)&&(h.source=l),Fe.defined(u)&&(h.relatedInformation=u),h}o(e,"create"),t.create=e;function r(n){var i;let a=n;return Fe.defined(a)&&wr.is(a.range)&&Fe.string(a.message)&&(Fe.number(a.severity)||Fe.undefined(a.severity))&&(Fe.integer(a.code)||Fe.string(a.code)||Fe.undefined(a.code))&&(Fe.undefined(a.codeDescription)||Fe.string((i=a.codeDescription)===null||i===void 0?void 0:i.href))&&(Fe.string(a.source)||Fe.undefined(a.source))&&(Fe.undefined(a.relatedInformation)||Fe.typedArray(a.relatedInformation,UN.is))}o(r,"is"),t.is=r})(wk||(wk={}));(function(t){function e(n,i,...a){let s={title:n,command:i};return Fe.defined(a)&&a.length>0&&(s.arguments=a),s}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.defined(i)&&Fe.string(i.title)&&Fe.string(i.command)}o(r,"is"),t.is=r})(dg||(dg={}));(function(t){function e(a,s){return{range:a,newText:s}}o(e,"replace"),t.replace=e;function r(a,s){return{range:{start:a,end:a},newText:s}}o(r,"insert"),t.insert=r;function n(a){return{range:a,newText:""}}o(n,"del"),t.del=n;function i(a){let s=a;return Fe.objectLiteral(s)&&Fe.string(s.newText)&&wr.is(s.range)}o(i,"is"),t.is=i})(pg||(pg={}));(function(t){function e(n,i,a){let s={label:n};return i!==void 0&&(s.needsConfirmation=i),a!==void 0&&(s.description=a),s}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.objectLiteral(i)&&Fe.string(i.label)&&(Fe.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(Fe.string(i.description)||i.description===void 0)}o(r,"is"),t.is=r})(HN||(HN={}));(function(t){function e(r){let n=r;return Fe.string(n)}o(e,"is"),t.is=e})(mg||(mg={}));(function(t){function e(a,s,l){return{range:a,newText:s,annotationId:l}}o(e,"replace"),t.replace=e;function r(a,s,l){return{range:{start:a,end:a},newText:s,annotationId:l}}o(r,"insert"),t.insert=r;function n(a,s){return{range:a,newText:"",annotationId:s}}o(n,"del"),t.del=n;function i(a){let s=a;return pg.is(s)&&(HN.is(s.annotationId)||mg.is(s.annotationId))}o(i,"is"),t.is=i})(use||(use={}));(function(t){function e(n,i){return{textDocument:n,edits:i}}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.defined(i)&&KN.is(i.textDocument)&&Array.isArray(i.edits)}o(r,"is"),t.is=r})(YN||(YN={}));(function(t){function e(n,i,a){let s={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(s.options=i),a!==void 0&&(s.annotationId=a),s}o(e,"create"),t.create=e;function r(n){let i=n;return i&&i.kind==="create"&&Fe.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||Fe.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||Fe.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||mg.is(i.annotationId))}o(r,"is"),t.is=r})(WN||(WN={}));(function(t){function e(n,i,a,s){let l={kind:"rename",oldUri:n,newUri:i};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(l.options=a),s!==void 0&&(l.annotationId=s),l}o(e,"create"),t.create=e;function r(n){let i=n;return i&&i.kind==="rename"&&Fe.string(i.oldUri)&&Fe.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||Fe.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||Fe.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||mg.is(i.annotationId))}o(r,"is"),t.is=r})(qN||(qN={}));(function(t){function e(n,i,a){let s={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(s.options=i),a!==void 0&&(s.annotationId=a),s}o(e,"create"),t.create=e;function r(n){let i=n;return i&&i.kind==="delete"&&Fe.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||Fe.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||Fe.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||mg.is(i.annotationId))}o(r,"is"),t.is=r})(XN||(XN={}));(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(i=>Fe.string(i.kind)?WN.is(i)||qN.is(i)||XN.is(i):YN.is(i)))}o(e,"is"),t.is=e})(jN||(jN={}));(function(t){function e(n){return{uri:n}}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.defined(i)&&Fe.string(i.uri)}o(r,"is"),t.is=r})(hse||(hse={}));(function(t){function e(n,i){return{uri:n,version:i}}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.defined(i)&&Fe.string(i.uri)&&Fe.integer(i.version)}o(r,"is"),t.is=r})(fse||(fse={}));(function(t){function e(n,i){return{uri:n,version:i}}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.defined(i)&&Fe.string(i.uri)&&(i.version===null||Fe.integer(i.version))}o(r,"is"),t.is=r})(KN||(KN={}));(function(t){function e(n,i,a,s){return{uri:n,languageId:i,version:a,text:s}}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.defined(i)&&Fe.string(i.uri)&&Fe.string(i.languageId)&&Fe.integer(i.version)&&Fe.string(i.text)}o(r,"is"),t.is=r})(dse||(dse={}));(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}o(e,"is"),t.is=e})(QN||(QN={}));(function(t){function e(r){let n=r;return Fe.objectLiteral(r)&&QN.is(n.kind)&&Fe.string(n.value)}o(e,"is"),t.is=e})(E2||(E2={}));(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(pse||(pse={}));(function(t){t.PlainText=1,t.Snippet=2})(mse||(mse={}));(function(t){t.Deprecated=1})(gse||(gse={}));(function(t){function e(n,i,a){return{newText:n,insert:i,replace:a}}o(e,"create"),t.create=e;function r(n){let i=n;return i&&Fe.string(i.newText)&&wr.is(i.insert)&&wr.is(i.replace)}o(r,"is"),t.is=r})(yse||(yse={}));(function(t){t.asIs=1,t.adjustIndentation=2})(vse||(vse={}));(function(t){function e(r){let n=r;return n&&(Fe.string(n.detail)||n.detail===void 0)&&(Fe.string(n.description)||n.description===void 0)}o(e,"is"),t.is=e})(xse||(xse={}));(function(t){function e(r){return{label:r}}o(e,"create"),t.create=e})(bse||(bse={}));(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}o(e,"create"),t.create=e})(wse||(wse={}));(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}o(e,"fromPlainText"),t.fromPlainText=e;function r(n){let i=n;return Fe.string(i)||Fe.objectLiteral(i)&&Fe.string(i.language)&&Fe.string(i.value)}o(r,"is"),t.is=r})(Tk||(Tk={}));(function(t){function e(r){let n=r;return!!n&&Fe.objectLiteral(n)&&(E2.is(n.contents)||Tk.is(n.contents)||Fe.typedArray(n.contents,Tk.is))&&(r.range===void 0||wr.is(r.range))}o(e,"is"),t.is=e})(Tse||(Tse={}));(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}o(e,"create"),t.create=e})(kse||(kse={}));(function(t){function e(r,n,...i){let a={label:r};return Fe.defined(n)&&(a.documentation=n),Fe.defined(i)?a.parameters=i:a.parameters=[],a}o(e,"create"),t.create=e})(Ese||(Ese={}));(function(t){t.Text=1,t.Read=2,t.Write=3})(Cse||(Cse={}));(function(t){function e(r,n){let i={range:r};return Fe.number(n)&&(i.kind=n),i}o(e,"create"),t.create=e})(Sse||(Sse={}));(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(Ase||(Ase={}));(function(t){t.Deprecated=1})(_se||(_se={}));(function(t){function e(r,n,i,a,s){let l={name:r,kind:n,location:{uri:a,range:i}};return s&&(l.containerName=s),l}o(e,"create"),t.create=e})(Lse||(Lse={}));(function(t){function e(r,n,i,a){return a!==void 0?{name:r,kind:n,location:{uri:i,range:a}}:{name:r,kind:n,location:{uri:i}}}o(e,"create"),t.create=e})(Dse||(Dse={}));(function(t){function e(n,i,a,s,l,u){let h={name:n,detail:i,kind:a,range:s,selectionRange:l};return u!==void 0&&(h.children=u),h}o(e,"create"),t.create=e;function r(n){let i=n;return i&&Fe.string(i.name)&&Fe.number(i.kind)&&wr.is(i.range)&&wr.is(i.selectionRange)&&(i.detail===void 0||Fe.string(i.detail))&&(i.deprecated===void 0||Fe.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}o(r,"is"),t.is=r})(Rse||(Rse={}));(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(Nse||(Nse={}));(function(t){t.Invoked=1,t.Automatic=2})(kk||(kk={}));(function(t){function e(n,i,a){let s={diagnostics:n};return i!=null&&(s.only=i),a!=null&&(s.triggerKind=a),s}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.defined(i)&&Fe.typedArray(i.diagnostics,wk.is)&&(i.only===void 0||Fe.typedArray(i.only,Fe.string))&&(i.triggerKind===void 0||i.triggerKind===kk.Invoked||i.triggerKind===kk.Automatic)}o(r,"is"),t.is=r})(Mse||(Mse={}));(function(t){function e(n,i,a){let s={title:n},l=!0;return typeof i=="string"?(l=!1,s.kind=i):dg.is(i)?s.command=i:s.edit=i,l&&a!==void 0&&(s.kind=a),s}o(e,"create"),t.create=e;function r(n){let i=n;return i&&Fe.string(i.title)&&(i.diagnostics===void 0||Fe.typedArray(i.diagnostics,wk.is))&&(i.kind===void 0||Fe.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||dg.is(i.command))&&(i.isPreferred===void 0||Fe.boolean(i.isPreferred))&&(i.edit===void 0||jN.is(i.edit))}o(r,"is"),t.is=r})(Ise||(Ise={}));(function(t){function e(n,i){let a={range:n};return Fe.defined(i)&&(a.data=i),a}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.defined(i)&&wr.is(i.range)&&(Fe.undefined(i.command)||dg.is(i.command))}o(r,"is"),t.is=r})(Ose||(Ose={}));(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.defined(i)&&Fe.uinteger(i.tabSize)&&Fe.boolean(i.insertSpaces)}o(r,"is"),t.is=r})(Pse||(Pse={}));(function(t){function e(n,i,a){return{range:n,target:i,data:a}}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.defined(i)&&wr.is(i.range)&&(Fe.undefined(i.target)||Fe.string(i.target))}o(r,"is"),t.is=r})(Bse||(Bse={}));(function(t){function e(n,i){return{range:n,parent:i}}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.objectLiteral(i)&&wr.is(i.range)&&(i.parent===void 0||t.is(i.parent))}o(r,"is"),t.is=r})(Fse||(Fse={}));(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(zse||(zse={}));(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(Gse||(Gse={}));(function(t){function e(r){let n=r;return Fe.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}o(e,"is"),t.is=e})($se||($se={}));(function(t){function e(n,i){return{range:n,text:i}}o(e,"create"),t.create=e;function r(n){let i=n;return i!=null&&wr.is(i.range)&&Fe.string(i.text)}o(r,"is"),t.is=r})(Vse||(Vse={}));(function(t){function e(n,i,a){return{range:n,variableName:i,caseSensitiveLookup:a}}o(e,"create"),t.create=e;function r(n){let i=n;return i!=null&&wr.is(i.range)&&Fe.boolean(i.caseSensitiveLookup)&&(Fe.string(i.variableName)||i.variableName===void 0)}o(r,"is"),t.is=r})(Use||(Use={}));(function(t){function e(n,i){return{range:n,expression:i}}o(e,"create"),t.create=e;function r(n){let i=n;return i!=null&&wr.is(i.range)&&(Fe.string(i.expression)||i.expression===void 0)}o(r,"is"),t.is=r})(Hse||(Hse={}));(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.defined(i)&&wr.is(n.stoppedLocation)}o(r,"is"),t.is=r})(Yse||(Yse={}));(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}o(e,"is"),t.is=e})(ZN||(ZN={}));(function(t){function e(n){return{value:n}}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.objectLiteral(i)&&(i.tooltip===void 0||Fe.string(i.tooltip)||E2.is(i.tooltip))&&(i.location===void 0||bk.is(i.location))&&(i.command===void 0||dg.is(i.command))}o(r,"is"),t.is=r})(JN||(JN={}));(function(t){function e(n,i,a){let s={position:n,label:i};return a!==void 0&&(s.kind=a),s}o(e,"create"),t.create=e;function r(n){let i=n;return Fe.objectLiteral(i)&&Ur.is(i.position)&&(Fe.string(i.label)||Fe.typedArray(i.label,JN.is))&&(i.kind===void 0||ZN.is(i.kind))&&i.textEdits===void 0||Fe.typedArray(i.textEdits,pg.is)&&(i.tooltip===void 0||Fe.string(i.tooltip)||E2.is(i.tooltip))&&(i.paddingLeft===void 0||Fe.boolean(i.paddingLeft))&&(i.paddingRight===void 0||Fe.boolean(i.paddingRight))}o(r,"is"),t.is=r})(Wse||(Wse={}));(function(t){function e(r){return{kind:"snippet",value:r}}o(e,"createSnippet"),t.createSnippet=e})(qse||(qse={}));(function(t){function e(r,n,i,a){return{insertText:r,filterText:n,range:i,command:a}}o(e,"create"),t.create=e})(Xse||(Xse={}));(function(t){function e(r){return{items:r}}o(e,"create"),t.create=e})(jse||(jse={}));(function(t){t.Invoked=0,t.Automatic=1})(Kse||(Kse={}));(function(t){function e(r,n){return{range:r,text:n}}o(e,"create"),t.create=e})(Qse||(Qse={}));(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}o(e,"create"),t.create=e})(Zse||(Zse={}));(function(t){function e(r){let n=r;return Fe.objectLiteral(n)&&$N.is(n.uri)&&Fe.string(n.name)}o(e,"is"),t.is=e})(Jse||(Jse={}));(function(t){function e(a,s,l,u){return new eM(a,s,l,u)}o(e,"create"),t.create=e;function r(a){let s=a;return!!(Fe.defined(s)&&Fe.string(s.uri)&&(Fe.undefined(s.languageId)||Fe.string(s.languageId))&&Fe.uinteger(s.lineCount)&&Fe.func(s.getText)&&Fe.func(s.positionAt)&&Fe.func(s.offsetAt))}o(r,"is"),t.is=r;function n(a,s){let l=a.getText(),u=i(s,(f,d)=>{let p=f.range.start.line-d.range.start.line;return p===0?f.range.start.character-d.range.start.character:p}),h=l.length;for(let f=u.length-1;f>=0;f--){let d=u[f],p=a.offsetAt(d.range.start),m=a.offsetAt(d.range.end);if(m<=h)l=l.substring(0,p)+d.newText+l.substring(m,l.length);else throw new Error("Overlapping edit");h=p}return l}o(n,"applyEdits"),t.applyEdits=n;function i(a,s){if(a.length<=1)return a;let l=a.length/2|0,u=a.slice(0,l),h=a.slice(l);i(u,s),i(h,s);let f=0,d=0,p=0;for(;f0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return Ur.create(0,e);for(;ne?i=s:n=s+1}let a=n-1;return Ur.create(a,e-r[a])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1"u"}o(n,"undefined"),t.undefined=n;function i(m){return m===!0||m===!1}o(i,"boolean"),t.boolean=i;function a(m){return e.call(m)==="[object String]"}o(a,"string"),t.string=a;function s(m){return e.call(m)==="[object Number]"}o(s,"number"),t.number=s;function l(m,g,y){return e.call(m)==="[object Number]"&&g<=m&&m<=y}o(l,"numberRange"),t.numberRange=l;function u(m){return e.call(m)==="[object Number]"&&-2147483648<=m&&m<=2147483647}o(u,"integer"),t.integer=u;function h(m){return e.call(m)==="[object Number]"&&0<=m&&m<=2147483647}o(h,"uinteger"),t.uinteger=h;function f(m){return e.call(m)==="[object Function]"}o(f,"func"),t.func=f;function d(m){return m!==null&&typeof m=="object"}o(d,"objectLiteral"),t.objectLiteral=d;function p(m,g){return Array.isArray(m)&&m.every(g)}o(p,"typedArray"),t.typedArray=p})(Fe||(Fe={}))});var C2,S2,d0,p0,rM,gg,Ek=R(()=>{"use strict";tM();Vo();Rl();C2=class{static{o(this,"CstNodeBuilder")}constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]}buildRootNode(e){return this.rootNode=new gg(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){let r=new p0;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){let n=new d0(e.startOffset,e.image.length,zm(e),e.tokenType,!1);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){let r=e.container;if(r){let n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}construct(e){let r=this.current;typeof e.$type=="string"&&(this.current.astNode=e),e.$cstNode=r;let n=this.nodeStack.pop();n?.content.length===0&&this.removeNode(n)}addHiddenTokens(e){for(let r of e){let n=new d0(r.startOffset,r.image.length,zm(r),r.tokenType,!0);n.root=this.rootNode,this.addHiddenToken(this.rootNode,n)}}addHiddenToken(e,r){let{offset:n,end:i}=r;for(let a=0;al&&i=0;e--){let r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},rM=class t extends Array{static{o(this,"CstNodeContainer")}constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,t.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(let r of e)r.container=this.parent}},gg=class extends p0{static{o(this,"RootCstNodeImpl")}get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}});function nM(t){return t.$type===Ck}var Ck,toe,roe,A2,_2,Sk,yg,L2,LOe,iM,D2=R(()=>{"use strict";u0();Jae();Sc();Il();es();Ek();Ck=Symbol("Datatype");o(nM,"isDataTypeNode");toe="\u200B",roe=o(t=>t.endsWith(toe)?t:t+toe,"withRuleSuffix"),A2=class{static{o(this,"AbstractLangiumParser")}constructor(e){this._unorderedGroups=new Map,this.lexer=e.parser.Lexer;let r=this.lexer.definition;this.wrapper=new iM(r,Object.assign(Object.assign({},e.parser.ParserConfig),{errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},_2=class extends A2{static{o(this,"LangiumParser")}get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new C2,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){let n=e.fragment?void 0:Jv(e)?Ck:r0(e),i=this.wrapper.DEFINE_RULE(roe(e.name),this.startImplementation(n,r).bind(this));return e.entry&&(this.mainRule=i),i}parse(e){this.nodeBuilder.buildRootNode(e);let r=this.lexer.tokenize(e);this.wrapper.input=r.tokens;let n=this.mainRule.call(this.wrapper,{});return this.nodeBuilder.addHiddenTokens(r.hidden),this.unorderedGroups.clear(),{value:n,lexerErrors:r.errors,parserErrors:this.wrapper.errors}}startImplementation(e,r){return n=>{if(!this.isRecording()){let a={$type:e};this.stack.push(a),e===Ck&&(a.value="")}let i;try{i=r(n)}catch{i=void 0}return!this.isRecording()&&i===void 0&&(i=this.construct()),i}}consume(e,r,n){let i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){let a=this.nodeBuilder.buildLeafNode(i,n),{assignment:s,isCrossRef:l}=this.getAssignment(n),u=this.current;if(s){let h=Ho(n)?i.image:this.converter.convert(i.image,a);this.assign(s.operator,s.feature,h,a,l)}else if(nM(u)){let h=i.image;Ho(n)||(h=this.converter.convert(h,a).toString()),u.value+=h}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i){let a;this.isRecording()||(a=this.nodeBuilder.buildCompositeNode(n));let s=this.wrapper.wrapSubrule(e,r,i);!this.isRecording()&&a&&a.length>0&&this.performSubruleAssignment(s,n,a)}performSubruleAssignment(e,r,n){let{assignment:i,isCrossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){let s=this.current;if(nM(s))s.value+=e.toString();else if(typeof e=="object"&&e){let l=e.$type,u=this.assignWithoutOverride(e,s);l&&(u.$type=l);let h=u;this.stack.pop(),this.stack.push(h)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(!n.$cstNode&&r.feature&&r.operator){n=this.construct(!1);let a=n.$cstNode.feature;this.nodeBuilder.buildCompositeNode(a)}let i={$type:e};this.stack.pop(),this.stack.push(i),r.feature&&r.operator&&this.assign(r.operator,r.feature,n,n.$cstNode,!1)}}construct(e=!0){if(this.isRecording())return;let r=this.current;return ET(r),this.nodeBuilder.construct(r),e&&this.stack.pop(),nM(r)?this.converter.convert(r.value,r.$cstNode):(NR(this.astReflection,r),r)}getAssignment(e){if(!this.assignmentMap.has(e)){let r=Qd(e,Nl);this.assignmentMap.set(e,{assignment:r,isCrossRef:r?Kd(r.terminal):!1})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){let s=this.current,l;switch(a&&typeof n=="string"?l=this.linker.buildReference(s,r,i,n):l=n,e){case"=":{s[r]=l;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(l)}}assignWithoutOverride(e,r){for(let[n,i]of Object.entries(r)){let a=e[n];a===void 0?e[n]=i:Array.isArray(a)&&Array.isArray(i)&&(i.push(...a),e[n]=i)}return e}get definitionErrors(){return this.wrapper.definitionErrors}},Sk=class{static{o(this,"AbstractParserErrorMessageProvider")}buildMismatchTokenMessage(e){return Gu.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Gu.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Gu.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Gu.buildEarlyExitMessage(e)}},yg=class extends Sk{static{o(this,"LangiumParserErrorMessageProvider")}buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},L2=class extends A2{static{o(this,"LangiumCompletionParser")}constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();let r=this.lexer.tokenize(e);return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){let n=this.wrapper.DEFINE_RULE(roe(e.name),this.startImplementation(r).bind(this));return e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{let n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){let e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i){this.before(n),this.wrapper.wrapSubrule(e,r,i),this.after(n)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){let r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},LOe={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new yg},iM=class extends x2{static{o(this,"ChevrotainWrapper")}constructor(e,r){let n=r&&"maxLookahead"in r;super(e,Object.assign(Object.assign(Object.assign({},LOe),{lookaheadStrategy:n?new $u({maxLookahead:r.maxLookahead}):new k2}),r))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r){return this.RULE(e,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}}});function _k(t,e,r){return DOe({parser:e,tokens:r,rules:new Map,ruleNames:new Map},t),e}function DOe(t,e){let r=Qv(e,!1),n=Kr(e.rules).filter(Oa).filter(i=>r.has(i));for(let i of n){let a=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});a.rules.set(i.name,t.parser.rule(i,m0(a,i.definition)))}}function m0(t,e,r=!1){let n;if(Ho(e))n=BOe(t,e);else if(Iu(e))n=ROe(t,e);else if(Nl(e))n=m0(t,e.terminal);else if(Kd(e))n=noe(t,e);else if(Ml(e))n=NOe(t,e);else if(wT(e))n=IOe(t,e);else if(kT(e))n=OOe(t,e);else if(rf(e))n=POe(t,e);else if(fR(e)){let i=t.consume++;n=o(()=>t.parser.consume(i,fo,e),"method")}else throw new jd(e.$cstNode,`Unexpected element type: ${e.$type}`);return ioe(t,r?void 0:Ak(e),n,e.cardinality)}function ROe(t,e){let r=r0(e);return()=>t.parser.action(r,e)}function NOe(t,e){let r=e.rule.ref;if(Oa(r)){let n=t.subrule++,i=e.arguments.length>0?MOe(r,e.arguments):()=>({});return a=>t.parser.subrule(n,aoe(t,r),e,i(a))}else if(Uo(r)){let n=t.consume++,i=aM(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)tf(r);else throw new jd(e.$cstNode,`Undefined rule type: ${e.$type}`)}function MOe(t,e){let r=e.map(n=>Vu(n.value));return n=>{let i={};for(let a=0;ae(n)||r(n)}else if(FD(t)){let e=Vu(t.left),r=Vu(t.right);return n=>e(n)&&r(n)}else if(YD(t)){let e=Vu(t.value);return r=>!e(r)}else if(jD(t)){let e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(PD(t)){let e=!!t.true;return()=>e}tf(t)}function IOe(t,e){if(e.elements.length===1)return m0(t,e.elements[0]);{let r=[];for(let i of e.elements){let a={ALT:m0(t,i,!0)},s=Ak(i);s&&(a.GATE=Vu(s)),r.push(a)}let n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{let s={ALT:o(()=>a.ALT(i),"ALT")},l=a.GATE;return l&&(s.GATE=()=>l(i)),s}))}}function OOe(t,e){if(e.elements.length===1)return m0(t,e.elements[0]);let r=[];for(let l of e.elements){let u={ALT:m0(t,l,!0)},h=Ak(l);h&&(u.GATE=Vu(h)),r.push(u)}let n=t.or++,i=o((l,u)=>{let h=u.getRuleStack().join("-");return`uGroup_${l}_${h}`},"idFunc"),a=o(l=>t.parser.alternatives(n,r.map((u,h)=>{let f={ALT:o(()=>!0,"ALT")},d=t.parser;f.ALT=()=>{if(u.ALT(l),!d.isRecording()){let m=i(n,d);d.unorderedGroups.get(m)||d.unorderedGroups.set(m,[]);let g=d.unorderedGroups.get(m);typeof g?.[h]>"u"&&(g[h]=!0)}};let p=u.GATE;return p?f.GATE=()=>p(l):f.GATE=()=>{let m=d.unorderedGroups.get(i(n,d));return!m?.[h]},f})),"alternatives"),s=ioe(t,Ak(e),a,"*");return l=>{s(l),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function POe(t,e){let r=e.elements.map(n=>m0(t,n));return n=>r.forEach(i=>i(n))}function Ak(t){if(rf(t))return t.guardCondition}function noe(t,e,r=e.terminal){if(r)if(Ml(r)&&Oa(r.rule.ref)){let n=t.subrule++;return i=>t.parser.subrule(n,aoe(t,r.rule.ref),e,i)}else if(Ml(r)&&Uo(r.rule.ref)){let n=t.consume++,i=aM(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Ho(r)){let n=t.consume++,i=aM(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);let n=DT(e.type.ref),i=n?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+r0(e.type.ref));return noe(t,e,i)}}function BOe(t,e){let r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}function ioe(t,e,r,n){let i=e&&Vu(e);if(!n)if(i){let a=t.or++;return s=>t.parser.alternatives(a,[{ALT:o(()=>r(s),"ALT"),GATE:o(()=>i(s),"GATE")},{ALT:gk(),GATE:o(()=>!i(s),"GATE")}])}else return r;if(n==="*"){let a=t.many++;return s=>t.parser.many(a,{DEF:o(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else if(n==="+"){let a=t.many++;if(i){let s=t.or++;return l=>t.parser.alternatives(s,[{ALT:o(()=>t.parser.atLeastOne(a,{DEF:o(()=>r(l),"DEF")}),"ALT"),GATE:o(()=>i(l),"GATE")},{ALT:gk(),GATE:o(()=>!i(l),"GATE")}])}else return s=>t.parser.atLeastOne(a,{DEF:o(()=>r(s),"DEF")})}else if(n==="?"){let a=t.optional++;return s=>t.parser.optional(a,{DEF:o(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else tf(n)}function aoe(t,e){let r=FOe(t,e),n=t.rules.get(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function FOe(t,e){if(Oa(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Oa(n);)(rf(n)||wT(n)||kT(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}function aM(t,e){let r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}var sM=R(()=>{"use strict";u0();Sc();pT();Ds();Il();o(_k,"createParser");o(DOe,"buildRules");o(m0,"buildElement");o(ROe,"buildAction");o(NOe,"buildRuleCall");o(MOe,"buildRuleCallPredicate");o(Vu,"buildPredicate");o(IOe,"buildAlternatives");o(OOe,"buildUnorderedGroup");o(POe,"buildGroup");o(Ak,"getGuardCondition");o(noe,"buildCrossReference");o(BOe,"buildKeyword");o(ioe,"wrap");o(aoe,"getRule");o(FOe,"getRuleName");o(aM,"getToken")});function oM(t){let e=t.Grammar,r=t.parser.Lexer,n=new L2(t);return _k(e,n,r.definition),n.finalize(),n}var lM=R(()=>{"use strict";D2();sM();o(oM,"createCompletionParser")});function cM(t){let e=soe(t);return e.finalize(),e}function soe(t){let e=t.Grammar,r=t.parser.Lexer,n=new _2(t);return _k(e,n,r.definition)}var uM=R(()=>{"use strict";D2();sM();o(cM,"createLangiumParser");o(soe,"prepareLangiumParser")});var g0,hM=R(()=>{"use strict";u0();Sc();es();Il();Um();Ds();g0=class{static{o(this,"DefaultTokenBuilder")}buildTokens(e,r){let n=Kr(Qv(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return i.forEach(s=>{let l=s.PATTERN;typeof l=="object"&&l&&"test"in l&&_T(l)?a.unshift(s):a.push(s)}),a}buildTerminalTokens(e){return e.filter(Uo).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){let r=Hm(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n,LINE_BREAKS:!0};return e.hidden&&(i.GROUP=_T(r)?ni.SKIPPED:"hidden"),i}requiresCustomPattern(e){return e.flags.includes("u")?!0:!!(e.source.includes("?<=")||e.source.includes("?(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(Oa).flatMap(i=>Ac(i).filter(Ho)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!n?.caseInsensitive))}buildKeywordToken(e,r,n){return{name:e.value,PATTERN:this.buildKeywordPattern(e,n),LONGER_ALT:this.findLongerAlt(e,r)}}buildKeywordPattern(e,r){return r?new RegExp(zR(e.value)):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{let a=i?.PATTERN;return a?.source&&GR("^"+a.source+"$",e.value)&&n.push(i),n},[])}}});var y0,Dc,fM=R(()=>{"use strict";Sc();Il();y0=class{static{o(this,"DefaultValueConverter")}convert(e,r){let n=r.grammarSource;if(Kd(n)&&(n=UR(n)),Ml(n)){let i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return Dc.convertInt(r);case"STRING":return Dc.convertString(r);case"ID":return Dc.convertID(r)}switch((i=QR(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return Dc.convertNumber(r);case"boolean":return Dc.convertBoolean(r);case"bigint":return Dc.convertBigint(r);case"date":return Dc.convertDate(r);default:return r}}};(function(t){function e(h){let f="";for(let d=1;d{"use strict";Object.defineProperty(mM,"__esModule",{value:!0});var dM;function pM(){if(dM===void 0)throw new Error("No runtime abstraction layer installed");return dM}o(pM,"RAL");(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");dM=r}o(e,"install"),t.install=e})(pM||(pM={}));mM.default=pM});var coe=gi(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.stringArray=Pa.array=Pa.func=Pa.error=Pa.number=Pa.string=Pa.boolean=void 0;function zOe(t){return t===!0||t===!1}o(zOe,"boolean");Pa.boolean=zOe;function ooe(t){return typeof t=="string"||t instanceof String}o(ooe,"string");Pa.string=ooe;function GOe(t){return typeof t=="number"||t instanceof Number}o(GOe,"number");Pa.number=GOe;function $Oe(t){return t instanceof Error}o($Oe,"error");Pa.error=$Oe;function VOe(t){return typeof t=="function"}o(VOe,"func");Pa.func=VOe;function loe(t){return Array.isArray(t)}o(loe,"array");Pa.array=loe;function UOe(t){return loe(t)&&t.every(e=>ooe(e))}o(UOe,"stringArray");Pa.stringArray=UOe});var vM=gi(vg=>{"use strict";Object.defineProperty(vg,"__esModule",{value:!0});vg.Emitter=vg.Event=void 0;var HOe=gM(),uoe;(function(t){let e={dispose(){}};t.None=function(){return e}})(uoe||(vg.Event=uoe={}));var yM=class{static{o(this,"CallbackList")}add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:o(()=>this.remove(e,r),"dispose")})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,a=this._callbacks.length;i{this._callbacks||(this._callbacks=new yM),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:o(()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};vg.Emitter=Lk;Lk._noop=function(){}});var hoe=gi(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:!0});xg.CancellationTokenSource=xg.CancellationToken=void 0;var YOe=gM(),WOe=coe(),xM=vM(),Dk;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:xM.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:xM.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||WOe.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}o(e,"is"),t.is=e})(Dk||(xg.CancellationToken=Dk={}));var qOe=Object.freeze(function(t,e){let r=(0,YOe.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),Rk=class{static{o(this,"MutableToken")}constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?qOe:(this._emitter||(this._emitter=new xM.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},bM=class{static{o(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new Rk),this._token}cancel(){this._token?this._token.cancel():this._token=Dk.Cancelled}dispose(){this._token?this._token instanceof Rk&&this._token.dispose():this._token=Dk.None}};xg.CancellationTokenSource=bM});var pr={};var Wo=R(()=>{"use strict";dr(pr,Xi(hoe(),1))});function TM(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}function doe(){return wM=Date.now(),new pr.CancellationTokenSource}function poe(t){foe=t}function of(t){return t===Rc}async function Bi(t){if(t===pr.CancellationToken.None)return;let e=Date.now();if(e-wM>=foe&&(wM=e,await TM()),t.isCancellationRequested)throw Rc}var wM,foe,Rc,as,qo=R(()=>{"use strict";Wo();o(TM,"delayNextTick");wM=0,foe=10;o(doe,"startCancelableOperation");o(poe,"setInterruptionPeriod");Rc=Symbol("OperationCancelled");o(of,"isOperationCancelled");o(Bi,"interruptAndCheck");as=class{static{o(this,"Deferred")}constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}}});function kM(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);kM(n,e),kM(i,e);let a=0,s=0,l=0;for(;ar.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function XOe(t){let e=yoe(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Nk,bg,voe=R(()=>{"use strict";Nk=class t{static{o(this,"FullTextDocument")}constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(t.isIncremental(n)){let i=yoe(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);let l=Math.max(i.start.line,0),u=Math.max(i.end.line,0),h=this._lineOffsets,f=moe(n.text,!1,a);if(u-l===f.length)for(let p=0,m=f.length;pe?i=s:n=s+1}let a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line];if(e.character<=0)return n;let i=e.line+1r&&goe(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}};(function(t){function e(i,a,s,l){return new Nk(i,a,s,l)}o(e,"create"),t.create=e;function r(i,a,s){if(i instanceof Nk)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}o(r,"update"),t.update=r;function n(i,a){let s=i.getText(),l=kM(a.map(XOe),(f,d)=>{let p=f.range.start.line-d.range.start.line;return p===0?f.range.start.character-d.range.start.character:p}),u=0,h=[];for(let f of l){let d=i.offsetAt(f.range.start);if(du&&h.push(s.substring(u,d)),f.newText.length&&h.push(f.newText),u=i.offsetAt(f.range.end)}return h.push(s.substr(u)),h.join("")}o(n,"applyEdits"),t.applyEdits=n})(bg||(bg={}));o(kM,"mergeSort");o(moe,"computeLineOffsets");o(goe,"isEOL");o(yoe,"getWellformedRange");o(XOe,"getWellformedEdit")});var xoe,Ms,wg,EM=R(()=>{"use strict";(()=>{"use strict";var t={470:i=>{function a(u){if(typeof u!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(u))}o(a,"e");function s(u,h){for(var f,d="",p=0,m=-1,g=0,y=0;y<=u.length;++y){if(y2){var v=d.lastIndexOf("/");if(v!==d.length-1){v===-1?(d="",p=0):p=(d=d.slice(0,v)).length-1-d.lastIndexOf("/"),m=y,g=0;continue}}else if(d.length===2||d.length===1){d="",p=0,m=y,g=0;continue}}h&&(d.length>0?d+="/..":d="..",p=2)}else d.length>0?d+="/"+u.slice(m+1,y):d=u.slice(m+1,y),p=y-m-1;m=y,g=0}else f===46&&g!==-1?++g:g=-1}return d}o(s,"r");var l={resolve:o(function(){for(var u,h="",f=!1,d=arguments.length-1;d>=-1&&!f;d--){var p;d>=0?p=arguments[d]:(u===void 0&&(u=process.cwd()),p=u),a(p),p.length!==0&&(h=p+"/"+h,f=p.charCodeAt(0)===47)}return h=s(h,!f),f?h.length>0?"/"+h:"/":h.length>0?h:"."},"resolve"),normalize:o(function(u){if(a(u),u.length===0)return".";var h=u.charCodeAt(0)===47,f=u.charCodeAt(u.length-1)===47;return(u=s(u,!h)).length!==0||h||(u="."),u.length>0&&f&&(u+="/"),h?"/"+u:u},"normalize"),isAbsolute:o(function(u){return a(u),u.length>0&&u.charCodeAt(0)===47},"isAbsolute"),join:o(function(){if(arguments.length===0)return".";for(var u,h=0;h0&&(u===void 0?u=f:u+="/"+f)}return u===void 0?".":l.normalize(u)},"join"),relative:o(function(u,h){if(a(u),a(h),u===h||(u=l.resolve(u))===(h=l.resolve(h)))return"";for(var f=1;fy){if(h.charCodeAt(m+x)===47)return h.slice(m+x+1);if(x===0)return h.slice(m+x)}else p>y&&(u.charCodeAt(f+x)===47?v=x:x===0&&(v=0));break}var b=u.charCodeAt(f+x);if(b!==h.charCodeAt(m+x))break;b===47&&(v=x)}var w="";for(x=f+v+1;x<=d;++x)x!==d&&u.charCodeAt(x)!==47||(w.length===0?w+="..":w+="/..");return w.length>0?w+h.slice(m+v):(m+=v,h.charCodeAt(m)===47&&++m,h.slice(m))},"relative"),_makeLong:o(function(u){return u},"_makeLong"),dirname:o(function(u){if(a(u),u.length===0)return".";for(var h=u.charCodeAt(0),f=h===47,d=-1,p=!0,m=u.length-1;m>=1;--m)if((h=u.charCodeAt(m))===47){if(!p){d=m;break}}else p=!1;return d===-1?f?"/":".":f&&d===1?"//":u.slice(0,d)},"dirname"),basename:o(function(u,h){if(h!==void 0&&typeof h!="string")throw new TypeError('"ext" argument must be a string');a(u);var f,d=0,p=-1,m=!0;if(h!==void 0&&h.length>0&&h.length<=u.length){if(h.length===u.length&&h===u)return"";var g=h.length-1,y=-1;for(f=u.length-1;f>=0;--f){var v=u.charCodeAt(f);if(v===47){if(!m){d=f+1;break}}else y===-1&&(m=!1,y=f+1),g>=0&&(v===h.charCodeAt(g)?--g==-1&&(p=f):(g=-1,p=y))}return d===p?p=y:p===-1&&(p=u.length),u.slice(d,p)}for(f=u.length-1;f>=0;--f)if(u.charCodeAt(f)===47){if(!m){d=f+1;break}}else p===-1&&(m=!1,p=f+1);return p===-1?"":u.slice(d,p)},"basename"),extname:o(function(u){a(u);for(var h=-1,f=0,d=-1,p=!0,m=0,g=u.length-1;g>=0;--g){var y=u.charCodeAt(g);if(y!==47)d===-1&&(p=!1,d=g+1),y===46?h===-1?h=g:m!==1&&(m=1):h!==-1&&(m=-1);else if(!p){f=g+1;break}}return h===-1||d===-1||m===0||m===1&&h===d-1&&h===f+1?"":u.slice(h,d)},"extname"),format:o(function(u){if(u===null||typeof u!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof u);return function(h,f){var d=f.dir||f.root,p=f.base||(f.name||"")+(f.ext||"");return d?d===f.root?d+p:d+"/"+p:p}(0,u)},"format"),parse:o(function(u){a(u);var h={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return h;var f,d=u.charCodeAt(0),p=d===47;p?(h.root="/",f=1):f=0;for(var m=-1,g=0,y=-1,v=!0,x=u.length-1,b=0;x>=f;--x)if((d=u.charCodeAt(x))!==47)y===-1&&(v=!1,y=x+1),d===46?m===-1?m=x:b!==1&&(b=1):m!==-1&&(b=-1);else if(!v){g=x+1;break}return m===-1||y===-1||b===0||b===1&&m===y-1&&m===g+1?y!==-1&&(h.base=h.name=g===0&&p?u.slice(1,y):u.slice(g,y)):(g===0&&p?(h.name=u.slice(1,m),h.base=u.slice(1,y)):(h.name=u.slice(g,m),h.base=u.slice(g,y)),h.ext=u.slice(m,y)),g>0?h.dir=u.slice(0,g-1):p&&(h.dir="/"),h},"parse"),sep:"/",delimiter:":",win32:null,posix:null};l.posix=l,i.exports=l}},e={};function r(i){var a=e[i];if(a!==void 0)return a.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,r),s.exports}o(r,"r"),r.d=(i,a)=>{for(var s in a)r.o(a,s)&&!r.o(i,s)&&Object.defineProperty(i,s,{enumerable:!0,get:a[s]})},r.o=(i,a)=>Object.prototype.hasOwnProperty.call(i,a),r.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var n={};(()=>{let i;r.r(n),r.d(n,{URI:o(()=>p,"URI"),Utils:o(()=>M,"Utils")}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);let a=/^\w[\w\d+.-]*$/,s=/^\//,l=/^\/\//;function u(N,k){if(!N.scheme&&k)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${N.authority}", path: "${N.path}", query: "${N.query}", fragment: "${N.fragment}"}`);if(N.scheme&&!a.test(N.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(N.path){if(N.authority){if(!s.test(N.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(l.test(N.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}o(u,"s");let h="",f="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class p{static{o(this,"f")}static isUri(k){return k instanceof p||!!k&&typeof k.authority=="string"&&typeof k.fragment=="string"&&typeof k.path=="string"&&typeof k.query=="string"&&typeof k.scheme=="string"&&typeof k.fsPath=="string"&&typeof k.with=="function"&&typeof k.toString=="function"}scheme;authority;path;query;fragment;constructor(k,I,C,O,D,P=!1){typeof k=="object"?(this.scheme=k.scheme||h,this.authority=k.authority||h,this.path=k.path||h,this.query=k.query||h,this.fragment=k.fragment||h):(this.scheme=function(F,B){return F||B?F:"file"}(k,P),this.authority=I||h,this.path=function(F,B){switch(F){case"https":case"http":case"file":B?B[0]!==f&&(B=f+B):B=f}return B}(this.scheme,C||h),this.query=O||h,this.fragment=D||h,u(this,P))}get fsPath(){return b(this,!1)}with(k){if(!k)return this;let{scheme:I,authority:C,path:O,query:D,fragment:P}=k;return I===void 0?I=this.scheme:I===null&&(I=h),C===void 0?C=this.authority:C===null&&(C=h),O===void 0?O=this.path:O===null&&(O=h),D===void 0?D=this.query:D===null&&(D=h),P===void 0?P=this.fragment:P===null&&(P=h),I===this.scheme&&C===this.authority&&O===this.path&&D===this.query&&P===this.fragment?this:new g(I,C,O,D,P)}static parse(k,I=!1){let C=d.exec(k);return C?new g(C[2]||h,E(C[4]||h),E(C[5]||h),E(C[7]||h),E(C[9]||h),I):new g(h,h,h,h,h)}static file(k){let I=h;if(i&&(k=k.replace(/\\/g,f)),k[0]===f&&k[1]===f){let C=k.indexOf(f,2);C===-1?(I=k.substring(2),k=f):(I=k.substring(2,C),k=k.substring(C)||f)}return new g("file",I,k,h,h)}static from(k){let I=new g(k.scheme,k.authority,k.path,k.query,k.fragment);return u(I,!0),I}toString(k=!1){return w(this,k)}toJSON(){return this}static revive(k){if(k){if(k instanceof p)return k;{let I=new g(k);return I._formatted=k.external,I._fsPath=k._sep===m?k.fsPath:null,I}}return k}}let m=i?1:void 0;class g extends p{static{o(this,"l")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=b(this,!1)),this._fsPath}toString(k=!1){return k?w(this,!0):(this._formatted||(this._formatted=w(this,!1)),this._formatted)}toJSON(){let k={$mid:1};return this._fsPath&&(k.fsPath=this._fsPath,k._sep=m),this._formatted&&(k.external=this._formatted),this.path&&(k.path=this.path),this.scheme&&(k.scheme=this.scheme),this.authority&&(k.authority=this.authority),this.query&&(k.query=this.query),this.fragment&&(k.fragment=this.fragment),k}}let y={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 v(N,k,I){let C,O=-1;for(let D=0;D=97&&P<=122||P>=65&&P<=90||P>=48&&P<=57||P===45||P===46||P===95||P===126||k&&P===47||I&&P===91||I&&P===93||I&&P===58)O!==-1&&(C+=encodeURIComponent(N.substring(O,D)),O=-1),C!==void 0&&(C+=N.charAt(D));else{C===void 0&&(C=N.substr(0,D));let F=y[P];F!==void 0?(O!==-1&&(C+=encodeURIComponent(N.substring(O,D)),O=-1),C+=F):O===-1&&(O=D)}}return O!==-1&&(C+=encodeURIComponent(N.substring(O))),C!==void 0?C:N}o(v,"d");function x(N){let k;for(let I=0;I1&&N.scheme==="file"?`//${N.authority}${N.path}`:N.path.charCodeAt(0)===47&&(N.path.charCodeAt(1)>=65&&N.path.charCodeAt(1)<=90||N.path.charCodeAt(1)>=97&&N.path.charCodeAt(1)<=122)&&N.path.charCodeAt(2)===58?k?N.path.substr(1):N.path[1].toLowerCase()+N.path.substr(2):N.path,i&&(I=I.replace(/\//g,"\\")),I}o(b,"m");function w(N,k){let I=k?x:v,C="",{scheme:O,authority:D,path:P,query:F,fragment:B}=N;if(O&&(C+=O,C+=":"),(D||O==="file")&&(C+=f,C+=f),D){let $=D.indexOf("@");if($!==-1){let z=D.substr(0,$);D=D.substr($+1),$=z.lastIndexOf(":"),$===-1?C+=I(z,!1,!1):(C+=I(z.substr(0,$),!1,!1),C+=":",C+=I(z.substr($+1),!1,!0)),C+="@"}D=D.toLowerCase(),$=D.lastIndexOf(":"),$===-1?C+=I(D,!1,!0):(C+=I(D.substr(0,$),!1,!0),C+=D.substr($))}if(P){if(P.length>=3&&P.charCodeAt(0)===47&&P.charCodeAt(2)===58){let $=P.charCodeAt(1);$>=65&&$<=90&&(P=`/${String.fromCharCode($+32)}:${P.substr(3)}`)}else if(P.length>=2&&P.charCodeAt(1)===58){let $=P.charCodeAt(0);$>=65&&$<=90&&(P=`${String.fromCharCode($+32)}:${P.substr(2)}`)}C+=I(P,!0,!1)}return F&&(C+="?",C+=I(F,!1,!1)),B&&(C+="#",C+=k?B:v(B,!1,!1)),C}o(w,"y");function S(N){try{return decodeURIComponent(N)}catch{return N.length>3?N.substr(0,3)+S(N.substr(3)):N}}o(S,"v");let T=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function E(N){return N.match(T)?N.replace(T,k=>S(k)):N}o(E,"C");var _=r(470);let A=_.posix||_,L="/";var M;(function(N){N.joinPath=function(k,...I){return k.with({path:A.join(k.path,...I)})},N.resolvePath=function(k,...I){let C=k.path,O=!1;C[0]!==L&&(C=L+C,O=!0);let D=A.resolve(C,...I);return O&&D[0]===L&&!k.authority&&(D=D.substring(1)),k.with({path:D})},N.dirname=function(k){if(k.path.length===0||k.path===L)return k;let I=A.dirname(k.path);return I.length===1&&I.charCodeAt(0)===46&&(I=""),k.with({path:I})},N.basename=function(k){return A.basename(k.path)},N.extname=function(k){return A.extname(k.path)}})(M||(M={}))})(),xoe=n})();({URI:Ms,Utils:wg}=xoe)});var ss,Nc=R(()=>{"use strict";EM();(function(t){t.basename=wg.basename,t.dirname=wg.dirname,t.extname=wg.extname,t.joinPath=wg.joinPath,t.resolvePath=wg.resolvePath;function e(n,i){return n?.toString()===i?.toString()}o(e,"equals"),t.equals=e;function r(n,i){let a=typeof n=="string"?n:n.path,s=typeof i=="string"?i:i.path,l=a.split("/").filter(p=>p.length>0),u=s.split("/").filter(p=>p.length>0),h=0;for(;h{"use strict";voe();Tg();Wo();Ds();Nc();(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(yn||(yn={}));R2=class{static{o(this,"DefaultLangiumDocumentFactory")}constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=pr.CancellationToken.None){let n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??Ms.parse(e.uri),n?this.createAsync(r,e,n):this.create(r,e)}fromString(e,r,n){return n?this.createAsync(r,e,n):this.create(r,e)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r){if(typeof r=="string"){let n=this.parse(e,r);return this.createLangiumDocument(n,e,void 0,r)}else if("$model"in r){let n={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(n,e)}else{let n=this.parse(e,r.getText());return this.createLangiumDocument(n,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){let i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{let i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:yn.Parsed,references:[],textDocument:n};else{let s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:yn.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var n,i;let a=(n=e.parseResult.value.$cstNode)===null||n===void 0?void 0:n.root.fullText,s=(i=this.textDocuments)===null||i===void 0?void 0:i.get(e.uri.toString()),l=s?s.getText():await this.fileSystemProvider.readFile(e.uri);if(s)Object.defineProperty(e,"textDocument",{value:s});else{let u=this.createTextDocumentGetter(e.uri,l);Object.defineProperty(e,"textDocument",{get:u})}return a!==l&&(e.parseResult=await this.parseAsync(e.uri,l,r),e.parseResult.value.$document=e),e.state=yn.Parsed,e}parse(e,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){let n=this.serviceRegistry,i;return()=>i??(i=bg.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},N2=class{static{o(this,"DefaultLangiumDocuments")}constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory}get all(){return Kr(this.documentMap.values())}addDocument(e){let r=e.uri.toString();if(this.documentMap.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentMap.set(r,e)}getDocument(e){let r=e.toString();return this.documentMap.get(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{let i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){let r=e.toString(),n=this.documentMap.get(r);return n&&(n.state=yn.Changed,n.precomputedScopes=void 0,n.references=[],n.diagnostics=void 0),n}deleteDocument(e){let r=e.toString(),n=this.documentMap.get(r);return n&&(n.state=yn.Changed,this.documentMap.delete(r)),n}}});var M2,CM=R(()=>{"use strict";Wo();Vo();es();qo();Tg();M2=class{static{o(this,"DefaultLinker")}constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,r=pr.CancellationToken.None){for(let n of Yo(e.parseResult.value))await Bi(r),$m(n).forEach(i=>this.doLink(i,e))}doLink(e,r){let n=e.reference;if(n._ref===void 0)try{let i=this.getCandidate(e);if(Wd(i))n._ref=i;else if(n._nodeDescription=i,this.langiumDocuments().hasDocument(i.documentUri)){let a=this.loadAstNode(i);n._ref=a??this.createLinkingError(e,i)}}catch(i){n._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${n.$refText}': ${i}`})}r.references.push(n)}unlink(e){for(let r of e.references)delete r._ref,delete r._nodeDescription;e.references=[]}getCandidate(e){let n=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return n??this.createLinkingError(e)}buildReference(e,r,n,i){let a=this,s={$refNode:n,$refText:i,get ref(){var l;if(Xn(this._ref))return this._ref;if(ED(this._nodeDescription)){let u=a.loadAstNode(this._nodeDescription);this._ref=u??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){let u=a.getLinkedNode({reference:s,container:e,property:r});if(u.error&&Oi(e).state{"use strict";Il();o(boe,"isNamed");I2=class{static{o(this,"DefaultNameProvider")}getName(e){if(boe(e))return e.name}getNameNode(e){return Zv(e.$cstNode,"name")}}});var O2,AM=R(()=>{"use strict";Il();Vo();es();Rl();Ds();Nc();O2=class{static{o(this,"DefaultReferences")}constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){let r=jR(e),n=e.astNode;if(r&&n){let i=n[r.feature];if(xa(i))return i.ref;if(Array.isArray(i)){for(let a of i)if(xa(a)&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return a.ref}}if(n){let i=this.nameProvider.getNameNode(n);if(i&&(i===e||SD(e,i)))return n}}}findDeclarationNode(e){let r=this.findDeclaration(e);if(r?.$cstNode){let n=this.nameProvider.getNameNode(r);return n??r.$cstNode}}findReferences(e,r){let n=[];if(r.includeDeclaration){let a=this.getReferenceToSelf(e);a&&n.push(a)}let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>ss.equals(a.sourceUri,r.documentUri))),n.push(...i),Kr(n)}getReferenceToSelf(e){let r=this.nameProvider.getNameNode(e);if(r){let n=Oi(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:n.uri,sourcePath:i,targetUri:n.uri,targetPath:i,segment:Xd(r),local:!0}}}}});var Mc,v0,kg=R(()=>{"use strict";Ds();Mc=class{static{o(this,"MultiMap")}constructor(e){if(this.map=new Map,e)for(let[r,n]of e)this.add(r,n)}get size(){return Fm.sum(Kr(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{let n=this.map.get(e);if(n){let i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){var r;return(r=this.map.get(e))!==null&&r!==void 0?r:[]}has(e,r){if(r===void 0)return this.map.has(e);{let n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return Kr(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return Kr(this.map.keys())}values(){return Kr(this.map.values()).flat()}entriesGroupedByKey(){return Kr(this.map.entries())}},v0=class{static{o(this,"BiMap")}get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(let[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){let r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}}});var P2,_M=R(()=>{"use strict";Wo();es();kg();qo();P2=class{static{o(this,"DefaultScopeComputation")}constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,r=pr.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,r)}async computeExportsForNode(e,r,n=Wv,i=pr.CancellationToken.None){let a=[];this.exportNode(e,a,r);for(let s of n(e))await Bi(i),this.exportNode(s,a,r);return a}exportNode(e,r,n){let i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async computeLocalScopes(e,r=pr.CancellationToken.None){let n=e.parseResult.value,i=new Mc;for(let a of Ac(n))await Bi(r),this.processNode(a,e,i);return i}processNode(e,r,n){let i=e.$container;if(i){let a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}}});var Eg,B2,jOe,LM=R(()=>{"use strict";Ds();Eg=class{static{o(this,"StreamScope")}constructor(e,r,n){var i;this.elements=e,this.outerScope=r,this.caseInsensitive=(i=n?.caseInsensitive)!==null&&i!==void 0?i:!1}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){let r=this.caseInsensitive?this.elements.find(n=>n.name.toLowerCase()===e.toLowerCase()):this.elements.find(n=>n.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}},B2=class{static{o(this,"MapScope")}constructor(e,r,n){var i;this.elements=new Map,this.caseInsensitive=(i=n?.caseInsensitive)!==null&&i!==void 0?i:!1;for(let a of e){let s=this.caseInsensitive?a.name.toLowerCase():a.name;this.elements.set(s,a)}this.outerScope=r}getElement(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getAllElements(){let e=Kr(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},jOe={getElement(){},getAllElements(){return Gv}}});var Cg,F2,x0,Mk,Sg,Ik=R(()=>{"use strict";Cg=class{static{o(this,"DisposableCache")}constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},F2=class extends Cg{static{o(this,"SimpleCache")}constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){let n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},x0=class extends Cg{static{o(this,"ContextCache")}constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();let i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){let a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){let r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){let r=this.converter(e),n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},Mk=class extends x0{static{o(this,"DocumentCache")}constructor(e){super(r=>r.toString()),this.onDispose(e.workspace.DocumentBuilder.onUpdate((r,n)=>{let i=r.concat(n);for(let a of i)this.clear(a)}))}},Sg=class extends F2{static{o(this,"WorkspaceCache")}constructor(e){super(),this.onDispose(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}});var z2,DM=R(()=>{"use strict";LM();es();Ds();Ik();z2=class{static{o(this,"DefaultScopeProvider")}constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new Sg(e.shared)}getScope(e){let r=[],n=this.reflection.getReferenceType(e),i=Oi(e.container).precomputedScopes;if(i){let s=e.container;do{let l=i.get(s);l.length>0&&r.push(Kr(l).filter(u=>this.reflection.isSubtype(u.type,n))),s=s.$container}while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new Eg(Kr(e),r,n)}createScopeForNodes(e,r,n){let i=Kr(e).map(a=>{let s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new Eg(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new B2(this.indexManager.allElements(e)))}}});function RM(t){return typeof t.$comment=="string"}function woe(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}var G2,Ok=R(()=>{"use strict";EM();Vo();es();Il();o(RM,"isAstNodeWithComment");o(woe,"isIntermediateReference");G2=class{static{o(this,"DefaultJsonSerializer")}constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r={}){let n=r?.replacer,i=o((s,l)=>this.replacer(s,l,r),"defaultReplacer"),a=n?(s,l)=>n(s,l,i):i;try{return this.currentDocument=Oi(e),JSON.stringify(e,a,r?.space)}finally{this.currentDocument=void 0}}deserialize(e,r={}){let n=JSON.parse(e);return this.linkNode(n,n,r),n}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:l}){var u,h,f,d;if(!this.ignoreProperties.has(e))if(xa(r)){let p=r.ref,m=n?r.$refText:void 0;if(p){let g=Oi(p),y="";this.currentDocument&&this.currentDocument!==g&&(l?y=l(g.uri,r):y=g.uri.toString());let v=this.astNodeLocator.getAstNodePath(p);return{$ref:`${y}#${v}`,$refText:m}}else return{$error:(h=(u=r.error)===null||u===void 0?void 0:u.message)!==null&&h!==void 0?h:"Could not resolve reference",$refText:m}}else if(Xn(r)){let p;if(a&&(p=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},r)),(!e||r.$document)&&p?.$textRegion&&(p.$textRegion.documentURI=(f=this.currentDocument)===null||f===void 0?void 0:f.uri.toString())),i&&!e&&(p??(p=Object.assign({},r)),p.$sourceText=(d=r.$cstNode)===null||d===void 0?void 0:d.text),s){p??(p=Object.assign({},r));let m=this.commentProvider.getComment(r);m&&(p.$comment=m.replace(/\r/g,""))}return p??r}else return r}addAstNodeRegionWithAssignmentsTo(e){let r=o(n=>({offset:n.offset,end:n.end,length:n.length,range:n.range}),"createDocumentSegment");if(e.$cstNode){let n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{let s=YR(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(let[u,h]of Object.entries(e))if(Array.isArray(h))for(let f=0;f{"use strict";Nc();$2=class{static{o(this,"DefaultServiceRegistry")}register(e){if(!this.singleton&&!this.map){this.singleton=e;return}if(!this.map&&(this.map={},this.singleton)){for(let r of this.singleton.LanguageMetaData.fileExtensions)this.map[r]=this.singleton;this.singleton=void 0}for(let r of e.LanguageMetaData.fileExtensions)this.map[r]!==void 0&&this.map[r]!==e&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${e.LanguageMetaData.languageId}'.`),this.map[r]=e}getServices(e){if(this.singleton!==void 0)return this.singleton;if(this.map===void 0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");let r=ss.extname(e),n=this.map[r];if(!n)throw new Error(`The service registry contains no services for the extension '${r}'.`);return n}get all(){return this.singleton!==void 0?[this.singleton]:this.map!==void 0?Object.values(this.map):[]}}});function Pk(t){return{code:t}}var Ag,V2,U2=R(()=>{"use strict";kg();qo();Ds();o(Pk,"diagnosticData");(function(t){t.all=["fast","slow","built-in"]})(Ag||(Ag={}));V2=class{static{o(this,"ValidationRegistry")}constructor(e){this.entries=new Mc,this.reflection=e.shared.AstReflection}register(e,r=this,n="fast"){if(n==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(let[i,a]of Object.entries(e)){let s=a;if(Array.isArray(s))for(let l of s){let u={check:this.wrapValidationException(l,r),category:n};this.addEntry(i,u)}else if(typeof s=="function"){let l={check:this.wrapValidationException(s,r),category:n};this.addEntry(i,l)}}}wrapValidationException(e,r){return async(n,i,a)=>{try{await e.call(r,n,i,a)}catch(s){if(of(s))throw s;console.error("An error occurred during validation:",s);let l=s instanceof Error?s.message:String(s);s instanceof Error&&s.stack&&console.error(s.stack),i("error","An error occurred during validation: "+l,{node:n})}}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(let n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=Kr(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}}});function Toe(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=Zv(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=qR(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function Bk(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}var H2,Uu,MM=R(()=>{"use strict";Wo();Il();es();Rl();qo();U2();H2=class{static{o(this,"DefaultDocumentValidator")}constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,r={},n=pr.CancellationToken.None){let i=e.parseResult,a=[];if(await Bi(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var l;return((l=s.data)===null||l===void 0?void 0:l.code)===Uu.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var l;return((l=s.data)===null||l===void 0?void 0:l.code)===Uu.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var l;return((l=s.data)===null||l===void 0?void 0:l.code)===Uu.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(of(s))throw s;console.error("An error occurred during validation:",s)}return await Bi(n),a}processLexingErrors(e,r,n){for(let i of e.lexerErrors){let a={severity:Bk("error"),range:{start:{line:i.line-1,character:i.column-1},end:{line:i.line-1,character:i.column+i.length-1}},message:i.message,data:Pk(Uu.LexingError),source:this.getSource()};r.push(a)}}processParsingErrors(e,r,n){for(let i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){let s=i.previousToken;if(isNaN(s.startOffset)){let l={line:0,character:0};a={start:l,end:l}}else{let l={line:s.endLine-1,character:s.endColumn};a={start:l,end:l}}}}else a=zm(i.token);if(a){let s={severity:Bk("error"),range:a,message:i.message,data:Pk(Uu.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){for(let i of e.references){let a=i.error;if(a){let s={node:a.container,property:a.property,index:a.index,data:{code:Uu.LinkingError,containerType:a.container.$type,property:a.property,refText:a.reference.$refText}};r.push(this.toDiagnostic("error",a.message,s))}}}async validateAst(e,r,n=pr.CancellationToken.None){let i=[],a=o((s,l,u)=>{i.push(this.toDiagnostic(s,l,u))},"acceptor");return await Promise.all(Yo(e).map(async s=>{await Bi(n);let l=this.validationRegistry.getChecks(s.$type,r.categories);for(let u of l)await u(s,a,n)})),i}toDiagnostic(e,r,n){return{message:r,range:Toe(n),severity:Bk(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};o(Toe,"getDiagnosticRange");o(Bk,"toDiagnosticSeverity");(function(t){t.LexingError="lexing-error",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(Uu||(Uu={}))});var Y2,W2,IM=R(()=>{"use strict";Wo();Vo();es();Rl();qo();Nc();Y2=class{static{o(this,"DefaultAstNodeDescriptionProvider")}constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n=Oi(e)){r??(r=this.nameProvider.getName(e));let i=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${i} has no name.`);let a,s=o(()=>{var l;return a??(a=Xd((l=this.nameProvider.getNameNode(e))!==null&&l!==void 0?l:e.$cstNode))},"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return s()},selectionSegment:Xd(e.$cstNode),type:e.$type,documentUri:n.uri,path:i}}},W2=class{static{o(this,"DefaultReferenceDescriptionProvider")}constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=pr.CancellationToken.None){let n=[],i=e.parseResult.value;for(let a of Yo(i))await Bi(r),$m(a).filter(s=>!Wd(s)).forEach(s=>{let l=this.createDescription(s);l&&n.push(l)});return n}createDescription(e){let r=e.reference.$nodeDescription,n=e.reference.$refNode;if(!r||!n)return;let i=Oi(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:r.documentUri,targetPath:r.path,segment:Xd(n),local:ss.equals(r.documentUri,i)}}}});var q2,OM=R(()=>{"use strict";q2=class{static{o(this,"DefaultAstNodeLocator")}constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){let r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,a)=>{if(!i||a.length===0)return i;let s=a.indexOf(this.indexSeparator);if(s>0){let l=a.substring(0,s),u=parseInt(a.substring(s+1)),h=i[l];return h?.[u]}return i[a]},e)}}});var X2,PM=R(()=>{"use strict";qo();X2=class{static{o(this,"DefaultConfigurationProvider")}constructor(e){this._ready=new as,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r,n;this.workspaceConfig=(n=(r=e.capabilities.workspace)===null||r===void 0?void 0:r.configuration)!==null&&n!==void 0?n:!1}async initialized(e){if(this.workspaceConfig){if(e.register){let r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){let r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(r=>{this.updateSectionConfiguration(r,e.settings[r])})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;let n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}}});var b0,BM=R(()=>{"use strict";(function(t){function e(r){return{dispose:o(async()=>await r(),"dispose")}}o(e,"create"),t.create=e})(b0||(b0={}))});var j2,FM=R(()=>{"use strict";Wo();BM();kg();qo();Ds();U2();Tg();j2=class{static{o(this,"DefaultDocumentBuilder")}constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Mc,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=yn.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=pr.CancellationToken.None){var i,a;for(let s of e){let l=s.uri.toString();if(s.state===yn.Validated){if(typeof r.validation=="boolean"&&r.validation)s.state=yn.IndexedReferences,s.diagnostics=void 0,this.buildState.delete(l);else if(typeof r.validation=="object"){let u=this.buildState.get(l),h=(i=u?.result)===null||i===void 0?void 0:i.validationChecks;if(h){let d=((a=r.validation.categories)!==null&&a!==void 0?a:Ag.all).filter(p=>!h.includes(p));d.length>0&&(this.buildState.set(l,{completed:!1,options:{validation:Object.assign(Object.assign({},r.validation),{categories:d})},result:u.result}),s.state=yn.IndexedReferences)}}}else this.buildState.delete(l)}this.currentState=yn.Changed,await this.emitUpdate(e.map(s=>s.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=pr.CancellationToken.None){this.currentState=yn.Changed;for(let s of r)this.langiumDocuments.deleteDocument(s),this.buildState.delete(s.toString()),this.indexManager.remove(s);for(let s of e){if(!this.langiumDocuments.invalidateDocument(s)){let u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},s);u.state=yn.Changed,this.langiumDocuments.addDocument(u)}this.buildState.delete(s.toString())}let i=Kr(e).concat(r).map(s=>s.toString()).toSet();this.langiumDocuments.all.filter(s=>!i.has(s.uri.toString())&&this.shouldRelink(s,i)).forEach(s=>{this.serviceRegistry.getServices(s.uri).references.Linker.unlink(s),s.state=Math.min(s.state,yn.ComputedScopes),s.diagnostics=void 0}),await this.emitUpdate(e,r),await Bi(n);let a=this.langiumDocuments.all.filter(s=>{var l;return s.staten(e,r)))}shouldRelink(e,r){return e.references.some(n=>n.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),b0.create(()=>{let r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,yn.Parsed,n,a=>this.langiumDocumentFactory.update(a,n)),await this.runCancelable(e,yn.IndexedContent,n,a=>this.indexManager.updateContent(a,n)),await this.runCancelable(e,yn.ComputedScopes,n,async a=>{let s=this.serviceRegistry.getServices(a.uri).references.ScopeComputation;a.precomputedScopes=await s.computeLocalScopes(a,n)}),await this.runCancelable(e,yn.Linked,n,a=>this.serviceRegistry.getServices(a.uri).references.Linker.link(a,n)),await this.runCancelable(e,yn.IndexedReferences,n,a=>this.indexManager.updateReferences(a,n));let i=e.filter(a=>this.shouldValidate(a));await this.runCancelable(i,yn.Validated,n,a=>this.validate(a,n));for(let a of e){let s=this.buildState.get(a.uri.toString());s&&(s.completed=!0)}}prepareBuild(e,r){for(let n of e){let i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a?.result})}}async runCancelable(e,r,n,i){let a=e.filter(s=>s.state{this.buildPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;if(r&&"path"in r?i=r:n=r,n??(n=pr.CancellationToken.None),i){let a=this.langiumDocuments.getDocument(i);if(a&&a.state>e)return Promise.resolve(i)}return this.currentState>=e?Promise.resolve(void 0):n.isCancellationRequested?Promise.reject(Rc):new Promise((a,s)=>{let l=this.onBuildPhase(e,()=>{if(l.dispose(),u.dispose(),i){let h=this.langiumDocuments.getDocument(i);a(h?.uri)}else a(void 0)}),u=n.onCancellationRequested(()=>{l.dispose(),u.dispose(),s(Rc)})})}async notifyBuildPhase(e,r,n){if(e.length===0)return;let i=this.buildPhaseListeners.get(r);for(let a of i)await Bi(n),await a(e,n)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){var n,i;let a=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,s=this.getBuildOptions(e).validation,l=typeof s=="object"?s:void 0,u=await a.validateDocument(e,l,r);e.diagnostics?e.diagnostics.push(...u):e.diagnostics=u;let h=this.buildState.get(e.uri.toString());if(h){(n=h.result)!==null&&n!==void 0||(h.result={});let f=(i=l?.categories)!==null&&i!==void 0?i:Ag.all;h.result.validationChecks?h.result.validationChecks.push(...f):h.result.validationChecks=[...f]}}getBuildOptions(e){var r,n;return(n=(r=this.buildState.get(e.uri.toString()))===null||r===void 0?void 0:r.options)!==null&&n!==void 0?n:{}}}});var K2,zM=R(()=>{"use strict";es();Ik();Wo();Ds();Nc();K2=class{static{o(this,"DefaultIndexManager")}constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new x0,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){let n=Oi(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{ss.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),Kr(i)}allElements(e,r){let n=Kr(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){var n;return r?this.symbolByTypeIndex.get(e,r,()=>{var a;return((a=this.symbolIndex.get(e))!==null&&a!==void 0?a:[]).filter(l=>this.astReflection.isSubtype(l.type,r))}):(n=this.symbolIndex.get(e))!==null&&n!==void 0?n:[]}remove(e){let r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r),this.referenceIndex.delete(r)}async updateContent(e,r=pr.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,r),a=e.uri.toString();this.symbolIndex.set(a,i),this.symbolByTypeIndex.clear(a)}async updateReferences(e,r=pr.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){let n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}}});var Q2,GM=R(()=>{"use strict";Wo();qo();Nc();Q2=class{static{o(this,"DefaultWorkspaceManager")}constructor(e){this.initialBuildOptions={},this._ready=new as,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}initialize(e){var r;this.folders=(r=e.workspaceFolders)!==null&&r!==void 0?r:void 0}initialized(e){return this.mutex.write(r=>{var n;return this.initializeWorkspace((n=this.folders)!==null&&n!==void 0?n:[],r)})}async initializeWorkspace(e,r=pr.CancellationToken.None){let n=await this.performStartup(e);await Bi(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){let r=this.serviceRegistry.all.flatMap(a=>a.LanguageMetaData.fileExtensions),n=[],i=o(a=>{n.push(a),this.langiumDocuments.hasDocument(a.uri)||this.langiumDocuments.addDocument(a)},"collector");return await this.loadAdditionalDocuments(e,i),await Promise.all(e.map(a=>[a,this.getRootFolder(a)]).map(async a=>this.traverseFolder(...a,r,i))),this._ready.resolve(),n}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return Ms.parse(e.uri)}async traverseFolder(e,r,n,i){let a=await this.fileSystemProvider.readDirectory(r);await Promise.all(a.map(async s=>{if(this.includeEntry(e,s,n)){if(s.isDirectory)await this.traverseFolder(e,s.uri,n,i);else if(s.isFile){let l=await this.langiumDocuments.getOrCreateDocument(s.uri);i(l)}}}))}includeEntry(e,r,n){let i=ss.basename(r.uri);if(i.startsWith("."))return!1;if(r.isDirectory)return i!=="node_modules"&&i!=="out";if(r.isFile){let a=ss.extname(r.uri);return n.includes(a)}return!1}}});function koe(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function VM(t){return t&&"modes"in t&&"defaultMode"in t}function $M(t){return!koe(t)&&!VM(t)}var Z2,UM=R(()=>{"use strict";u0();Z2=class{static{o(this,"DefaultLexer")}constructor(e){let r=e.parser.TokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);let n=$M(r)?Object.values(r):r;this.chevrotainLexer=new ni(n,{positionTracking:"full"})}get definition(){return this.tokenTypes}tokenize(e){var r;let n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:(r=n.groups.hidden)!==null&&r!==void 0?r:[]}}toTokenTypeDictionary(e){if($M(e))return e;let r=VM(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}};o(koe,"isTokenTypeArray");o(VM,"isIMultiModeLexerDefinition");o($M,"isTokenTypeDictionary")});function WM(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=Ur.create(0,0));let a=Soe(t),s=XM(n),l=QOe({lines:a,position:i,options:s});return rPe({index:0,tokens:l,position:i})}function qM(t,e){let r=XM(e),n=Soe(t);if(n.length===0)return!1;let i=n[0],a=n[n.length-1],s=r.start,l=r.end;return!!s?.exec(i)&&!!l?.exec(a)}function Soe(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(BR)}function QOe(t){var e,r,n;let i=[],a=t.position.line,s=t.position.character;for(let l=0;l=f.length){if(i.length>0){let m=Ur.create(a,s);i.push({type:"break",content:"",range:wr.create(m,m)})}}else{Eoe.lastIndex=d;let m=Eoe.exec(f);if(m){let g=m[0],y=m[1],v=Ur.create(a,s+d),x=Ur.create(a,s+d+g.length);i.push({type:"tag",content:y,range:wr.create(v,x)}),d+=g.length,d=YM(f,d)}if(d0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function ZOe(t,e,r,n){let i=[];if(t.length===0){let a=Ur.create(r,n),s=Ur.create(r,n+e.length);i.push({type:"text",content:e,range:wr.create(a,s)})}else{let a=0;for(let l of t){let u=l.index,h=e.substring(a,u);h.length>0&&i.push({type:"text",content:e.substring(a,u),range:wr.create(Ur.create(r,a+n),Ur.create(r,u+n))});let f=h.length+1,d=l[1];if(i.push({type:"inline-tag",content:d,range:wr.create(Ur.create(r,a+f+n),Ur.create(r,a+f+d.length+n))}),f+=d.length,l.length===4){f+=l[2].length;let p=l[3];i.push({type:"text",content:p,range:wr.create(Ur.create(r,a+f+n),Ur.create(r,a+f+p.length+n))})}else i.push({type:"text",content:"",range:wr.create(Ur.create(r,a+f+n),Ur.create(r,a+f+n))});a=u+l[0].length}let s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:wr.create(Ur.create(r,a+n),Ur.create(r,a+n+s.length))})}return i}function YM(t,e){let r=t.substring(e).match(JOe);return r?e+r.index:t.length}function tPe(t){let e=t.match(ePe);if(e&&typeof e.index=="number")return e.index}function rPe(t){var e,r,n,i;let a=Ur.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Fk([],wr.create(a,a));let s=[];for(;t.index0){let u=YM(e,a);s=e.substring(u),e=e.substring(0,a)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(s=`\`${s}\``),(i=(n=r.renderLink)===null||n===void 0?void 0:n.call(r,e,s))!==null&&i!==void 0?i:oPe(e,s)}}function oPe(t,e){try{return Ms.parse(t,!0),`[${e}](${t})`}catch{return t}}function Coe(t){return t.endsWith(` +`)?` +`:` + +`}var Eoe,KOe,JOe,ePe,Fk,J2,ex,zk,jM=R(()=>{"use strict";tM();Um();Nc();o(WM,"parseJSDoc");o(qM,"isJSDoc");o(Soe,"getLines");Eoe=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,KOe=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;o(QOe,"tokenize");o(ZOe,"buildInlineTokens");JOe=/\S/,ePe=/\s*$/;o(YM,"skipWhitespace");o(tPe,"lastCharacter");o(rPe,"parseJSDocComment");o(nPe,"parseJSDocElement");o(iPe,"appendEmptyLine");o(Aoe,"parseJSDocText");o(aPe,"parseJSDocInline");o(_oe,"parseJSDocTag");o(Loe,"parseJSDocLine");o(XM,"normalizeOptions");o(HM,"normalizeOption");Fk=class{static{o(this,"JSDocCommentImpl")}constructor(e,r){this.elements=e,this.range=r}getTag(e){return this.getAllTags().find(r=>r.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(let r of this.elements)if(e.length===0)e=r.toString();else{let n=r.toString();e+=Coe(e)+n}return e.trim()}toMarkdown(e){let r="";for(let n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{let i=n.toMarkdown(e);r+=Coe(r)+i}return r.trim()}},J2=class{static{o(this,"JSDocTagImpl")}constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`,r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e} +${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r,n;return(n=(r=e?.renderTag)===null||r===void 0?void 0:r.call(e,this))!==null&&n!==void 0?n:this.toMarkdownDefault(e)}toMarkdownDefault(e){let r=this.content.toMarkdown(e);if(this.inline){let a=sPe(this.name,r,e??{});if(typeof a=="string")return a}let n="";e?.tag==="italic"||e?.tag===void 0?n="*":e?.tag==="bold"?n="**":e?.tag==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} \u2014 ${r}`:this.content.inlines.length>1&&(i=`${i} +${r}`),this.inline?`{${i}}`:i}};o(sPe,"renderInlineTag");o(oPe,"renderLinkDefault");ex=class{static{o(this,"JSDocTextImpl")}constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;rn.range.start.line&&(e+=` +`)}return e}toMarkdown(e){let r="";for(let n=0;ni.range.start.line&&(r+=` +`)}return r}},zk=class{static{o(this,"JSDocLineImpl")}constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}};o(Coe,"fillNewlines")});var tx,KM=R(()=>{"use strict";es();jM();tx=class{static{o(this,"JSDocDocumentationProvider")}constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){let r=this.commentProvider.getComment(e);if(r&&qM(r))return WM(r).toMarkdown({renderLink:o((i,a)=>this.documentationLinkRenderer(e,i,a),"renderLink"),renderTag:o(i=>this.documentationTagRenderer(e,i),"renderTag")})}documentationLinkRenderer(e,r,n){var i;let a=(i=this.findNameInPrecomputedScopes(e,r))!==null&&i!==void 0?i:this.findNameInGlobalScope(e,r);if(a&&a.nameSegment){let s=a.nameSegment.range.start.line+1,l=a.nameSegment.range.start.character+1,u=a.documentUri.with({fragment:`L${s},${l}`});return`[${n}](${u.toString()})`}else return}documentationTagRenderer(e,r){}findNameInPrecomputedScopes(e,r){let i=Oi(e).precomputedScopes;if(!i)return;let a=e;do{let l=i.get(a).find(u=>u.name===r);if(l)return l;a=a.$container}while(a)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}}});var rx,QM=R(()=>{"use strict";Ok();Rl();rx=class{static{o(this,"DefaultCommentProvider")}constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return RM(e)?e.$comment:(r=_D(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||r===void 0?void 0:r.text}}});var ii={};var ZM=R(()=>{"use strict";dr(ii,Xi(vM(),1))});var nx,JM,eI,tI=R(()=>{"use strict";qo();ZM();nx=class{static{o(this,"DefaultAsyncParser")}constructor(e){this.syncParser=e.parser.LangiumParser}parse(e){return Promise.resolve(this.syncParser.parse(e))}},JM=class{static{o(this,"AbstractThreadedAsyncParser")}constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){let r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){let n=await this.acquireParserWorker(r),i=new as,a,s=r.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(l=>{let u=this.hydrator.hydrate(l);i.resolve(u)}).catch(l=>{i.reject(l)}).finally(()=>{s.dispose(),clearTimeout(a)}),i.promise}terminateWorker(e){e.terminate();let r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(let n of this.workerPool)if(n.ready)return n.lock(),n;let r=new as;return e.onCancellationRequested(()=>{let n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(Rc)}),this.queue.push(r),r.promise}},eI=class{static{o(this,"ParserWorker")}get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new ii.Emitter,this.deferred=new as,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(a=>{let s=a;this.deferred.resolve(s),this.unlock()}),n(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(Rc),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new as,this.sendMessage(e),this.deferred.promise}}});var ix,rI=R(()=>{"use strict";Wo();qo();ix=class{static{o(this,"DefaultWorkspaceLock")}constructor(){this.previousTokenSource=new pr.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();let r=new pr.CancellationTokenSource;return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n){let i=new as,a={action:r,deferred:i,cancellationToken:n??pr.CancellationToken.None};return e.push(a),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;let e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{let a=await Promise.resolve().then(()=>r(i));n.resolve(a)}catch(a){of(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}});var ax,nI=R(()=>{"use strict";Ek();Sc();Vo();es();kg();Rl();ax=class{static{o(this,"DefaultHydrator")}constructor(e){this.grammarElementIdMap=new v0,this.tokenTypeIdMap=new v0,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors.map(r=>Object.assign({},r)),parserErrors:e.parserErrors.map(r=>Object.assign({},r)),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}createDehyrationContext(e){let r=new Map,n=new Map;for(let i of Yo(e))r.set(i,{});if(e.$cstNode)for(let i of qd(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){let n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(let[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){let s=[];n[i]=s;for(let l of a)Xn(l)?s.push(this.dehydrateAstNode(l,r)):xa(l)?s.push(this.dehydrateReference(l,r)):s.push(l)}else Xn(a)?n[i]=this.dehydrateAstNode(a,r):xa(a)?n[i]=this.dehydrateReference(a,r):a!==void 0&&(n[i]=a);return n}dehydrateReference(e,r){let n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){let n=r.cstNodes.get(e);return zv(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),co(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):ef(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){let r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){let r=new Map,n=new Map;for(let a of Yo(e))r.set(a,{});let i;if(e.$cstNode)for(let a of qd(e.$cstNode)){let s;"fullText"in a?(s=new gg(a.fullText),i=s):"content"in a?s=new p0:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(n.set(a,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){let n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(let[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){let s=[];n[i]=s;for(let l of a)Xn(l)?s.push(this.setParent(this.hydrateAstNode(l,r),n)):xa(l)?s.push(this.hydrateReference(l,n,i,r)):s.push(l)}else Xn(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):xa(a)?n[i]=this.hydrateReference(a,n,i,r):a!==void 0&&(n[i]=a);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){let i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),co(i))for(let a of e.content){let s=this.hydrateCstNode(a,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){let r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,s=e.startColumn,l=e.endLine,u=e.endColumn,h=e.hidden;return new d0(n,i,{start:{line:a,character:s},end:{line:l,character:u}},r,h)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap();let r=this.grammarElementIdMap.getKey(e);if(r)return r;throw new Error("Invalid grammar element id: "+e)}createGrammarElementIdMap(){let e=0;for(let r of Yo(this.grammar))Uv(r)&&this.grammarElementIdMap.set(r,e++)}}});function po(t){return{documentation:{CommentProvider:o(e=>new rx(e),"CommentProvider"),DocumentationProvider:o(e=>new tx(e),"DocumentationProvider")},parser:{AsyncParser:o(e=>new nx(e),"AsyncParser"),GrammarConfig:o(e=>JR(e),"GrammarConfig"),LangiumParser:o(e=>cM(e),"LangiumParser"),CompletionParser:o(e=>oM(e),"CompletionParser"),ValueConverter:o(()=>new y0,"ValueConverter"),TokenBuilder:o(()=>new g0,"TokenBuilder"),Lexer:o(e=>new Z2(e),"Lexer"),ParserErrorMessageProvider:o(()=>new yg,"ParserErrorMessageProvider")},workspace:{AstNodeLocator:o(()=>new q2,"AstNodeLocator"),AstNodeDescriptionProvider:o(e=>new Y2(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:o(e=>new W2(e),"ReferenceDescriptionProvider")},references:{Linker:o(e=>new M2(e),"Linker"),NameProvider:o(()=>new I2,"NameProvider"),ScopeProvider:o(e=>new z2(e),"ScopeProvider"),ScopeComputation:o(e=>new P2(e),"ScopeComputation"),References:o(e=>new O2(e),"References")},serializer:{Hydrator:o(e=>new ax(e),"Hydrator"),JsonSerializer:o(e=>new G2(e),"JsonSerializer")},validation:{DocumentValidator:o(e=>new H2(e),"DocumentValidator"),ValidationRegistry:o(e=>new V2(e),"ValidationRegistry")},shared:o(()=>t.shared,"shared")}}function mo(t){return{ServiceRegistry:o(()=>new $2,"ServiceRegistry"),workspace:{LangiumDocuments:o(e=>new N2(e),"LangiumDocuments"),LangiumDocumentFactory:o(e=>new R2(e),"LangiumDocumentFactory"),DocumentBuilder:o(e=>new j2(e),"DocumentBuilder"),IndexManager:o(e=>new K2(e),"IndexManager"),WorkspaceManager:o(e=>new Q2(e),"WorkspaceManager"),FileSystemProvider:o(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:o(()=>new ix,"WorkspaceLock"),ConfigurationProvider:o(e=>new X2(e),"ConfigurationProvider")}}}var iI=R(()=>{"use strict";eN();lM();uM();hM();fM();CM();SM();AM();_M();DM();Ok();NM();MM();U2();IM();OM();PM();FM();Tg();zM();GM();UM();KM();QM();D2();tI();rI();nI();o(po,"createDefaultCoreModule");o(mo,"createDefaultSharedCoreModule")});function Fi(t,e,r,n,i,a,s,l,u){let h=[t,e,r,n,i,a,s,l,u].reduce(Gk,{});return Moe(h)}function Noe(t){if(t&&t[sI])for(let e of Object.values(t))Noe(e);return t}function Moe(t,e){let r=new Proxy({},{deleteProperty:o(()=>!1,"deleteProperty"),get:o((n,i)=>Roe(n,i,t,e||r),"get"),getOwnPropertyDescriptor:o((n,i)=>(Roe(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:o((n,i)=>i in t,"has"),ownKeys:o(()=>[...Reflect.ownKeys(t),sI],"ownKeys")});return r[sI]=!0,r}function Roe(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:t[e]});if(t[e]===Doe)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. See https://langium.org/docs/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){let i=r[e];t[e]=Doe;try{t[e]=typeof i=="function"?i(n):Moe(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}function Gk(t,e){if(e){for(let[r,n]of Object.entries(e))if(n!==void 0){let i=t[r];i!==null&&n!==null&&typeof i=="object"&&typeof n=="object"?t[r]=Gk(i,n):t[r]=n}}return t}var aI,sI,Doe,oI=R(()=>{"use strict";(function(t){t.merge=(e,r)=>Gk(Gk({},e),r)})(aI||(aI={}));o(Fi,"inject");sI=Symbol("isProxy");o(Noe,"eagerLoad");o(Moe,"_inject");Doe=Symbol();o(Roe,"_resolve");o(Gk,"_merge")});var Ioe=R(()=>{"use strict"});var Ooe=R(()=>{"use strict";QM();KM();jM()});var Poe=R(()=>{"use strict"});var Boe=R(()=>{"use strict";eN();Poe()});var Foe=R(()=>{"use strict"});var zoe=R(()=>{"use strict";tI();lM();Ek();uM();D2();UM();Foe();hM();fM()});var Goe=R(()=>{"use strict";CM();SM();AM();LM();_M();DM()});var $oe=R(()=>{"use strict";nI();Ok()});var $k,go,lI=R(()=>{"use strict";$k=class{static{o(this,"EmptyFileSystemProvider")}readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}},go={fileSystemProvider:o(()=>new $k,"fileSystemProvider")}});function uPe(){let t=Fi(mo(go),cPe),e=Fi(po({shared:t}),lPe);return t.ServiceRegistry.register(e),e}function lf(t){var e;let r=uPe(),n=r.serializer.JsonSerializer.deserialize(t);return r.shared.workspace.LangiumDocumentFactory.fromModel(n,Ms.parse(`memory://${(e=n.name)!==null&&e!==void 0?e:"grammar"}.langium`)),n}var lPe,cPe,Voe=R(()=>{"use strict";iI();oI();Sc();lI();Nc();lPe={Grammar:o(()=>{},"Grammar"),LanguageMetaData:o(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},cPe={AstReflection:o(()=>new Gm,"AstReflection")};o(uPe,"createMinimalGrammarServices");o(lf,"loadGrammarFromJson")});var Rr={};hr(Rr,{AstUtils:()=>CT,BiMap:()=>v0,Cancellation:()=>pr,ContextCache:()=>x0,CstUtils:()=>dT,DONE_RESULT:()=>Ja,Deferred:()=>as,Disposable:()=>b0,DisposableCache:()=>Cg,DocumentCache:()=>Mk,EMPTY_STREAM:()=>Gv,ErrorWithLocation:()=>jd,GrammarUtils:()=>RT,MultiMap:()=>Mc,OperationCancelled:()=>Rc,Reduction:()=>Fm,RegExpUtils:()=>LT,SimpleCache:()=>F2,StreamImpl:()=>uo,TreeStreamImpl:()=>Cc,URI:()=>Ms,UriUtils:()=>ss,WorkspaceCache:()=>Sg,assertUnreachable:()=>tf,delayNextTick:()=>TM,interruptAndCheck:()=>Bi,isOperationCancelled:()=>of,loadGrammarFromJson:()=>lf,setInterruptionPeriod:()=>poe,startCancelableOperation:()=>doe,stream:()=>Kr});var Uoe=R(()=>{"use strict";Ik();ZM();dr(Rr,ii);kg();BM();pT();Voe();qo();Ds();Nc();es();Wo();Rl();Il();Um()});var Hoe=R(()=>{"use strict";MM();U2()});var Yoe=R(()=>{"use strict";IM();OM();PM();FM();Tg();lI();zM();rI();GM()});var ba={};hr(ba,{AbstractAstReflection:()=>Yd,AbstractCstNode:()=>S2,AbstractLangiumParser:()=>A2,AbstractParserErrorMessageProvider:()=>Sk,AbstractThreadedAsyncParser:()=>JM,AstUtils:()=>CT,BiMap:()=>v0,Cancellation:()=>pr,CompositeCstNodeImpl:()=>p0,ContextCache:()=>x0,CstNodeBuilder:()=>C2,CstUtils:()=>dT,DONE_RESULT:()=>Ja,DatatypeSymbol:()=>Ck,DefaultAstNodeDescriptionProvider:()=>Y2,DefaultAstNodeLocator:()=>q2,DefaultAsyncParser:()=>nx,DefaultCommentProvider:()=>rx,DefaultConfigurationProvider:()=>X2,DefaultDocumentBuilder:()=>j2,DefaultDocumentValidator:()=>H2,DefaultHydrator:()=>ax,DefaultIndexManager:()=>K2,DefaultJsonSerializer:()=>G2,DefaultLangiumDocumentFactory:()=>R2,DefaultLangiumDocuments:()=>N2,DefaultLexer:()=>Z2,DefaultLinker:()=>M2,DefaultNameProvider:()=>I2,DefaultReferenceDescriptionProvider:()=>W2,DefaultReferences:()=>O2,DefaultScopeComputation:()=>P2,DefaultScopeProvider:()=>z2,DefaultServiceRegistry:()=>$2,DefaultTokenBuilder:()=>g0,DefaultValueConverter:()=>y0,DefaultWorkspaceLock:()=>ix,DefaultWorkspaceManager:()=>Q2,Deferred:()=>as,Disposable:()=>b0,DisposableCache:()=>Cg,DocumentCache:()=>Mk,DocumentState:()=>yn,DocumentValidator:()=>Uu,EMPTY_SCOPE:()=>jOe,EMPTY_STREAM:()=>Gv,EmptyFileSystem:()=>go,EmptyFileSystemProvider:()=>$k,ErrorWithLocation:()=>jd,GrammarAST:()=>Yv,GrammarUtils:()=>RT,JSDocDocumentationProvider:()=>tx,LangiumCompletionParser:()=>L2,LangiumParser:()=>_2,LangiumParserErrorMessageProvider:()=>yg,LeafCstNodeImpl:()=>d0,MapScope:()=>B2,Module:()=>aI,MultiMap:()=>Mc,OperationCancelled:()=>Rc,ParserWorker:()=>eI,Reduction:()=>Fm,RegExpUtils:()=>LT,RootCstNodeImpl:()=>gg,SimpleCache:()=>F2,StreamImpl:()=>uo,StreamScope:()=>Eg,TextDocument:()=>bg,TreeStreamImpl:()=>Cc,URI:()=>Ms,UriUtils:()=>ss,ValidationCategory:()=>Ag,ValidationRegistry:()=>V2,ValueConverter:()=>Dc,WorkspaceCache:()=>Sg,assertUnreachable:()=>tf,createCompletionParser:()=>oM,createDefaultCoreModule:()=>po,createDefaultSharedCoreModule:()=>mo,createGrammarConfig:()=>JR,createLangiumParser:()=>cM,delayNextTick:()=>TM,diagnosticData:()=>Pk,eagerLoad:()=>Noe,getDiagnosticRange:()=>Toe,inject:()=>Fi,interruptAndCheck:()=>Bi,isAstNode:()=>Xn,isAstNodeDescription:()=>ED,isAstNodeWithComment:()=>RM,isCompositeCstNode:()=>co,isIMultiModeLexerDefinition:()=>VM,isJSDoc:()=>qM,isLeafCstNode:()=>ef,isLinkingError:()=>Wd,isNamed:()=>boe,isOperationCancelled:()=>of,isReference:()=>xa,isRootCstNode:()=>zv,isTokenTypeArray:()=>koe,isTokenTypeDictionary:()=>$M,loadGrammarFromJson:()=>lf,parseJSDoc:()=>WM,prepareLangiumParser:()=>soe,setInterruptionPeriod:()=>poe,startCancelableOperation:()=>doe,stream:()=>Kr,toDiagnosticSeverity:()=>Bk});var Ic=R(()=>{"use strict";iI();oI();NM();Ioe();Vo();Ooe();Boe();zoe();Goe();$oe();Uoe();dr(ba,Rr);Hoe();Yoe();Sc()});function Joe(t){return Pl.isInstance(t,Zoe)}function ele(t){return Pl.isInstance(t,cI)}function tle(t){return Pl.isInstance(t,uI)}function rle(t){return Pl.isInstance(t,pPe)}function nle(t){return Pl.isInstance(t,hI)}function ale(t){return Pl.isInstance(t,ile)}function sle(t){return Pl.isInstance(t,fI)}function lle(t){return Pl.isInstance(t,ole)}function ule(t){return Pl.isInstance(t,cle)}function fle(t){return Pl.isInstance(t,hle)}function ple(t){return Pl.isInstance(t,dle)}var hPe,Tt,Qoe,Zoe,cI,fPe,dPe,uI,pPe,hI,ile,fI,ole,cle,hle,dle,mPe,mle,Pl,Woe,gPe,qoe,yPe,Xoe,vPe,joe,xPe,Koe,bPe,wPe,TPe,kPe,EPe,CPe,Bl,dI,pI,mI,gI,yI,SPe,APe,_Pe,LPe,_g,w0,Xo,DPe,jo=R(()=>{"use strict";Ic();Ic();Ic();Ic();hPe=Object.defineProperty,Tt=o((t,e)=>hPe(t,"name",{value:e,configurable:!0}),"__name"),Qoe="Statement",Zoe="Architecture";o(Joe,"isArchitecture");Tt(Joe,"isArchitecture");cI="Branch";o(ele,"isBranch");Tt(ele,"isBranch");fPe="Checkout",dPe="CherryPicking",uI="Commit";o(tle,"isCommit");Tt(tle,"isCommit");pPe="Common";o(rle,"isCommon");Tt(rle,"isCommon");hI="GitGraph";o(nle,"isGitGraph");Tt(nle,"isGitGraph");ile="Info";o(ale,"isInfo");Tt(ale,"isInfo");fI="Merge";o(sle,"isMerge");Tt(sle,"isMerge");ole="Packet";o(lle,"isPacket");Tt(lle,"isPacket");cle="PacketBlock";o(ule,"isPacketBlock");Tt(ule,"isPacketBlock");hle="Pie";o(fle,"isPie");Tt(fle,"isPie");dle="PieSection";o(ple,"isPieSection");Tt(ple,"isPieSection");mPe="Direction",mle=class extends Yd{static{o(this,"MermaidAstReflection")}static{Tt(this,"MermaidAstReflection")}getAllTypes(){return["Architecture","Branch","Checkout","CherryPicking","Commit","Common","Direction","Edge","GitGraph","Group","Info","Junction","Merge","Packet","PacketBlock","Pie","PieSection","Service","Statement"]}computeIsSubtype(t,e){switch(t){case cI:case fPe:case dPe:case uI:case fI:return this.isSubtype(Qoe,e);case mPe:return this.isSubtype(hI,e);default:return!1}}getReferenceType(t){let e=`${t.container.$type}:${t.property}`;switch(e){default:throw new Error(`${e} is not a valid reference id.`)}}getTypeMetaData(t){switch(t){case"Architecture":return{name:"Architecture",properties:[{name:"accDescr"},{name:"accTitle"},{name:"edges",defaultValue:[]},{name:"groups",defaultValue:[]},{name:"junctions",defaultValue:[]},{name:"services",defaultValue:[]},{name:"title"}]};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"Edge":return{name:"Edge",properties:[{name:"lhsDir"},{name:"lhsGroup",defaultValue:!1},{name:"lhsId"},{name:"lhsInto",defaultValue:!1},{name:"rhsDir"},{name:"rhsGroup",defaultValue:!1},{name:"rhsId"},{name:"rhsInto",defaultValue:!1},{name:"title"}]};case"GitGraph":return{name:"GitGraph",properties:[{name:"accDescr"},{name:"accTitle"},{name:"statements",defaultValue:[]},{name:"title"}]};case"Group":return{name:"Group",properties:[{name:"icon"},{name:"id"},{name:"in"},{name:"title"}]};case"Info":return{name:"Info",properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case"Junction":return{name:"Junction",properties:[{name:"id"},{name:"in"}]};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:!1},{name:"title"}]};case"PieSection":return{name:"PieSection",properties:[{name:"label"},{name:"value"}]};case"Service":return{name:"Service",properties:[{name:"icon"},{name:"iconText"},{name:"id"},{name:"in"},{name:"title"}]};case"Direction":return{name:"Direction",properties:[{name:"accDescr"},{name:"accTitle"},{name:"dir"},{name:"statements",defaultValue:[]},{name:"title"}]};default:return{name:t,properties:[]}}}},Pl=new mle,gPe=Tt(()=>Woe??(Woe=lf('{"$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"),yPe=Tt(()=>qoe??(qoe=lf(`{"$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"),vPe=Tt(()=>Xoe??(Xoe=lf('{"$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"),xPe=Tt(()=>joe??(joe=lf('{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","name":"Architecture","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","fragment":true,"definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LeftPort","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RightPort","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Arrow","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ID","definition":{"$type":"RegexToken","regex":"/[\\\\w]+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TEXT_ICON","definition":{"$type":"RegexToken","regex":"/\\\\(\\"[^\\"]+\\"\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","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@19"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"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@18"},"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":[]}')),"ArchitectureGrammar"),bPe=Tt(()=>Koe??(Koe=lf(`{"$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"),wPe={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},TPe={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},kPe={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},EPe={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},CPe={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1},Bl={AstReflection:Tt(()=>new mle,"AstReflection")},dI={Grammar:Tt(()=>gPe(),"Grammar"),LanguageMetaData:Tt(()=>wPe,"LanguageMetaData"),parser:{}},pI={Grammar:Tt(()=>yPe(),"Grammar"),LanguageMetaData:Tt(()=>TPe,"LanguageMetaData"),parser:{}},mI={Grammar:Tt(()=>vPe(),"Grammar"),LanguageMetaData:Tt(()=>kPe,"LanguageMetaData"),parser:{}},gI={Grammar:Tt(()=>xPe(),"Grammar"),LanguageMetaData:Tt(()=>EPe,"LanguageMetaData"),parser:{}},yI={Grammar:Tt(()=>bPe(),"Grammar"),LanguageMetaData:Tt(()=>CPe,"LanguageMetaData"),parser:{}},SPe=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,APe=/accTitle[\t ]*:([^\n\r]*)/,_Pe=/title([\t ][^\n\r]*|)/,LPe={ACC_DESCR:SPe,ACC_TITLE:APe,TITLE:_Pe},_g=class extends y0{static{o(this,"AbstractMermaidValueConverter")}static{Tt(this,"AbstractMermaidValueConverter")}runConverter(t,e,r){let n=this.runCommonConverter(t,e,r);return n===void 0&&(n=this.runCustomConverter(t,e,r)),n===void 0?super.runConverter(t,e,r):n}runCommonConverter(t,e,r){let n=LPe[t.name];if(n===void 0)return;let i=n.exec(e);if(i!==null){if(i[1]!==void 0)return i[1].trim().replace(/[\t ]{2,}/gm," ");if(i[2]!==void 0)return i[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` +`)}}},w0=class extends _g{static{o(this,"CommonValueConverter")}static{Tt(this,"CommonValueConverter")}runCustomConverter(t,e,r){}},Xo=class extends g0{static{o(this,"AbstractMermaidTokenBuilder")}static{Tt(this,"AbstractMermaidTokenBuilder")}constructor(t){super(),this.keywords=new Set(t)}buildKeywordTokens(t,e,r){let n=super.buildKeywordTokens(t,e,r);return n.forEach(i=>{this.keywords.has(i.name)&&i.PATTERN!==void 0&&(i.PATTERN=new RegExp(i.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),n}},DPe=class extends Xo{static{o(this,"CommonTokenBuilder")}static{Tt(this,"CommonTokenBuilder")}}});function Uk(t=go){let e=Fi(mo(t),Bl),r=Fi(po({shared:e}),yI,Vk);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}var RPe,Vk,vI=R(()=>{"use strict";jo();Ic();RPe=class extends Xo{static{o(this,"GitGraphTokenBuilder")}static{Tt(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},Vk={parser:{TokenBuilder:Tt(()=>new RPe,"TokenBuilder"),ValueConverter:Tt(()=>new w0,"ValueConverter")}};o(Uk,"createGitGraphServices");Tt(Uk,"createGitGraphServices")});function Yk(t=go){let e=Fi(mo(t),Bl),r=Fi(po({shared:e}),dI,Hk);return e.ServiceRegistry.register(r),{shared:e,Info:r}}var NPe,Hk,xI=R(()=>{"use strict";jo();Ic();NPe=class extends Xo{static{o(this,"InfoTokenBuilder")}static{Tt(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},Hk={parser:{TokenBuilder:Tt(()=>new NPe,"TokenBuilder"),ValueConverter:Tt(()=>new w0,"ValueConverter")}};o(Yk,"createInfoServices");Tt(Yk,"createInfoServices")});function qk(t=go){let e=Fi(mo(t),Bl),r=Fi(po({shared:e}),pI,Wk);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}var MPe,Wk,bI=R(()=>{"use strict";jo();Ic();MPe=class extends Xo{static{o(this,"PacketTokenBuilder")}static{Tt(this,"PacketTokenBuilder")}constructor(){super(["packet-beta"])}},Wk={parser:{TokenBuilder:Tt(()=>new MPe,"TokenBuilder"),ValueConverter:Tt(()=>new w0,"ValueConverter")}};o(qk,"createPacketServices");Tt(qk,"createPacketServices")});function jk(t=go){let e=Fi(mo(t),Bl),r=Fi(po({shared:e}),mI,Xk);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}var IPe,OPe,Xk,wI=R(()=>{"use strict";jo();Ic();IPe=class extends Xo{static{o(this,"PieTokenBuilder")}static{Tt(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}},OPe=class extends _g{static{o(this,"PieValueConverter")}static{Tt(this,"PieValueConverter")}runCustomConverter(t,e,r){if(t.name==="PIE_SECTION_LABEL")return e.replace(/"/g,"").trim()}},Xk={parser:{TokenBuilder:Tt(()=>new IPe,"TokenBuilder"),ValueConverter:Tt(()=>new OPe,"ValueConverter")}};o(jk,"createPieServices");Tt(jk,"createPieServices")});function Qk(t=go){let e=Fi(mo(t),Bl),r=Fi(po({shared:e}),gI,Kk);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}var PPe,BPe,Kk,TI=R(()=>{"use strict";jo();Ic();PPe=class extends Xo{static{o(this,"ArchitectureTokenBuilder")}static{Tt(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}},BPe=class extends _g{static{o(this,"ArchitectureValueConverter")}static{Tt(this,"ArchitectureValueConverter")}runCustomConverter(t,e,r){if(t.name==="ARCH_ICON")return e.replace(/[()]/g,"").trim();if(t.name==="ARCH_TEXT_ICON")return e.replace(/["()]/g,"");if(t.name==="ARCH_TITLE")return e.replace(/[[\]]/g,"").trim()}},Kk={parser:{TokenBuilder:Tt(()=>new PPe,"TokenBuilder"),ValueConverter:Tt(()=>new BPe,"ValueConverter")}};o(Qk,"createArchitectureServices");Tt(Qk,"createArchitectureServices")});var gle={};hr(gle,{InfoModule:()=>Hk,createInfoServices:()=>Yk});var yle=R(()=>{"use strict";xI();jo()});var vle={};hr(vle,{PacketModule:()=>Wk,createPacketServices:()=>qk});var xle=R(()=>{"use strict";bI();jo()});var ble={};hr(ble,{PieModule:()=>Xk,createPieServices:()=>jk});var wle=R(()=>{"use strict";wI();jo()});var Tle={};hr(Tle,{ArchitectureModule:()=>Kk,createArchitectureServices:()=>Qk});var kle=R(()=>{"use strict";TI();jo()});var Ele={};hr(Ele,{GitGraphModule:()=>Vk,createGitGraphServices:()=>Uk});var Cle=R(()=>{"use strict";vI();jo()});async function Fl(t,e){let r=FPe[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);T0[t]||await r();let i=T0[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new zPe(i);return i.value}var T0,FPe,zPe,Lg=R(()=>{"use strict";vI();xI();bI();wI();TI();jo();T0={},FPe={info:Tt(async()=>{let{createInfoServices:t}=await Promise.resolve().then(()=>(yle(),gle)),e=t().Info.parser.LangiumParser;T0.info=e},"info"),packet:Tt(async()=>{let{createPacketServices:t}=await Promise.resolve().then(()=>(xle(),vle)),e=t().Packet.parser.LangiumParser;T0.packet=e},"packet"),pie:Tt(async()=>{let{createPieServices:t}=await Promise.resolve().then(()=>(wle(),ble)),e=t().Pie.parser.LangiumParser;T0.pie=e},"pie"),architecture:Tt(async()=>{let{createArchitectureServices:t}=await Promise.resolve().then(()=>(kle(),Tle)),e=t().Architecture.parser.LangiumParser;T0.architecture=e},"architecture"),gitGraph:Tt(async()=>{let{createGitGraphServices:t}=await Promise.resolve().then(()=>(Cle(),Ele)),e=t().GitGraph.parser.LangiumParser;T0.gitGraph=e},"gitGraph")};o(Fl,"parse");Tt(Fl,"parse");zPe=class extends Error{static{o(this,"MermaidParseError")}constructor(t){let e=t.lexerErrors.map(n=>n.message).join(` +`),r=t.parserErrors.map(n=>n.message).join(` +`);super(`Parsing failed: ${e} ${r}`),this.result=t}static{Tt(this,"MermaidParseError")}}});function cf(t,e){t.accDescr&&e.setAccDescription?.(t.accDescr),t.accTitle&&e.setAccTitle?.(t.accTitle),t.title&&e.setDiagramTitle?.(t.title)}var sx=R(()=>{"use strict";o(cf,"populateCommonDb")});var Hr,Zk=R(()=>{"use strict";Hr={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4}});var uf,Jk=R(()=>{"use strict";uf=class{constructor(e){this.init=e;this.records=this.init()}static{o(this,"ImperativeState")}reset(){this.records=this.init()}}});function kI(){return J_({length:7})}function $Pe(t,e){let r=Object.create(null);return t.reduce((n,i)=>{let a=e(i);return r[a]||(r[a]=!0,n.push(i)),n},[])}function Sle(t,e,r){let n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}function _le(t){let e=t.reduce((i,a)=>i.seq>a.seq?i:a,t[0]),r="";t.forEach(function(i){i===e?r+=" *":r+=" |"});let n=[r,e.id,e.seq];for(let i in pt.records.branches)pt.records.branches.get(i)===e.id&&n.push(i);if(V.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){let i=pt.records.commits.get(e.parents[0]);Sle(t,e,i),e.parents[1]&&t.push(pt.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){let i=pt.records.commits.get(e.parents[0]);Sle(t,e,i)}}t=$Pe(t,i=>i.id),_le(t)}var GPe,k0,pt,VPe,UPe,HPe,YPe,WPe,qPe,XPe,Ale,jPe,KPe,QPe,ZPe,JPe,Lle,eBe,tBe,rBe,eE,EI=R(()=>{"use strict";ut();xr();qs();rr();bi();Zk();Jk();sl();GPe=mr.gitGraph,k0=o(()=>Ts({...GPe,...Or().gitGraph}),"getConfig"),pt=new uf(()=>{let t=k0(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});o(kI,"getID");o($Pe,"uniqBy");VPe=o(function(t){pt.records.direction=t},"setDirection"),UPe=o(function(t){V.debug("options str",t),t=t?.trim(),t=t||"{}";try{pt.records.options=JSON.parse(t)}catch(e){V.error("error while parsing gitGraph options",e.message)}},"setOptions"),HPe=o(function(){return pt.records.options},"getOptions"),YPe=o(function(t){let e=t.msg,r=t.id,n=t.type,i=t.tags;V.info("commit",e,r,n,i),V.debug("Entering commit:",e,r,n,i);let a=k0();r=We.sanitizeText(r,a),e=We.sanitizeText(e,a),i=i?.map(l=>We.sanitizeText(l,a));let s={id:r||pt.records.seq+"-"+kI(),message:e,seq:pt.records.seq++,type:n??Hr.NORMAL,tags:i??[],parents:pt.records.head==null?[]:[pt.records.head.id],branch:pt.records.currBranch};pt.records.head=s,V.info("main branch",a.mainBranchName),pt.records.commits.set(s.id,s),pt.records.branches.set(pt.records.currBranch,s.id),V.debug("in pushCommit "+s.id)},"commit"),WPe=o(function(t){let e=t.name,r=t.order;if(e=We.sanitizeText(e,k0()),pt.records.branches.has(e))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 ${e}")`);pt.records.branches.set(e,pt.records.head!=null?pt.records.head.id:null),pt.records.branchConfig.set(e,{name:e,order:r}),Ale(e),V.debug("in createBranch")},"branch"),qPe=o(t=>{let e=t.branch,r=t.id,n=t.type,i=t.tags,a=k0();e=We.sanitizeText(e,a),r&&(r=We.sanitizeText(r,a));let s=pt.records.branches.get(pt.records.currBranch),l=pt.records.branches.get(e),u=s?pt.records.commits.get(s):void 0,h=l?pt.records.commits.get(l):void 0;if(u&&h&&u.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(pt.records.currBranch===e){let p=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw p.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},p}if(u===void 0||!u){let p=new Error(`Incorrect usage of "merge". Current branch (${pt.records.currBranch})has no commits`);throw p.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},p}if(!pt.records.branches.has(e)){let p=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw p.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},p}if(h===void 0||!h){let p=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw p.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},p}if(u===h){let p=new Error('Incorrect usage of "merge". Both branches have same head');throw p.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},p}if(r&&pt.records.commits.has(r)){let p=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom Id");throw p.hash={text:`merge ${e} ${r} ${n} ${i?.join(" ")}`,token:`merge ${e} ${r} ${n} ${i?.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i?.join(" ")}`]},p}let f=l||"",d={id:r||`${pt.records.seq}-${kI()}`,message:`merged branch ${e} into ${pt.records.currBranch}`,seq:pt.records.seq++,parents:pt.records.head==null?[]:[pt.records.head.id,f],branch:pt.records.currBranch,type:Hr.MERGE,customType:n,customId:!!r,tags:i??[]};pt.records.head=d,pt.records.commits.set(d.id,d),pt.records.branches.set(pt.records.currBranch,d.id),V.debug(pt.records.branches),V.debug("in mergeBranch")},"merge"),XPe=o(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;V.debug("Entering cherryPick:",e,r,n);let a=k0();if(e=We.sanitizeText(e,a),r=We.sanitizeText(r,a),n=n?.map(u=>We.sanitizeText(u,a)),i=We.sanitizeText(i,a),!e||!pt.records.commits.has(e)){let u=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw u.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},u}let s=pt.records.commits.get(e);if(s===void 0||!s)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(s.parents)&&s.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");let l=s.branch;if(s.type===Hr.MERGE&&!i)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!r||!pt.records.commits.has(r)){if(l===pt.records.currBranch){let d=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}let u=pt.records.branches.get(pt.records.currBranch);if(u===void 0||!u){let d=new Error(`Incorrect usage of "cherry-pick". Current branch (${pt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}let h=pt.records.commits.get(u);if(h===void 0||!h){let d=new Error(`Incorrect usage of "cherry-pick". Current branch (${pt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}let f={id:pt.records.seq+"-"+kI(),message:`cherry-picked ${s?.message} into ${pt.records.currBranch}`,seq:pt.records.seq++,parents:pt.records.head==null?[]:[pt.records.head.id,s.id],branch:pt.records.currBranch,type:Hr.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${s.id}${s.type===Hr.MERGE?`|parent:${i}`:""}`]};pt.records.head=f,pt.records.commits.set(f.id,f),pt.records.branches.set(pt.records.currBranch,f.id),V.debug(pt.records.branches),V.debug("in cherryPick")}},"cherryPick"),Ale=o(function(t){if(t=We.sanitizeText(t,k0()),pt.records.branches.has(t)){pt.records.currBranch=t;let e=pt.records.branches.get(pt.records.currBranch);e===void 0||!e?pt.records.head=null:pt.records.head=pt.records.commits.get(e)??null}else{let e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");o(Sle,"upsert");o(_le,"prettyPrintCommitHistory");jPe=o(function(){V.debug(pt.records.commits);let t=Lle()[0];_le([t])},"prettyPrint"),KPe=o(function(){pt.reset(),vr()},"clear"),QPe=o(function(){return[...pt.records.branchConfig.values()].map((e,r)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${r}`)}).sort((e,r)=>(e.order??0)-(r.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),ZPe=o(function(){return pt.records.branches},"getBranches"),JPe=o(function(){return pt.records.commits},"getCommits"),Lle=o(function(){let t=[...pt.records.commits.values()];return t.forEach(function(e){V.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),eBe=o(function(){return pt.records.currBranch},"getCurrentBranch"),tBe=o(function(){return pt.records.direction},"getDirection"),rBe=o(function(){return pt.records.head},"getHead"),eE={commitType:Hr,getConfig:k0,setDirection:VPe,setOptions:UPe,getOptions:HPe,commit:YPe,branch:WPe,merge:qPe,cherryPick:XPe,checkout:Ale,prettyPrint:jPe,clear:KPe,getBranchesAsObjArray:QPe,getBranches:ZPe,getCommits:JPe,getCommitsArray:Lle,getCurrentBranch:eBe,getDirection:tBe,getHead:rBe,setAccTitle:kr,getAccTitle:Ar,getAccDescription:Lr,setAccDescription:_r,setDiagramTitle:nn,getDiagramTitle:Xr}});var nBe,iBe,aBe,sBe,oBe,lBe,cBe,Dle,Rle=R(()=>{"use strict";Lg();ut();sx();EI();Zk();nBe=o((t,e)=>{cf(t,e),t.dir&&e.setDirection(t.dir);for(let r of t.statements)iBe(r,e)},"populate"),iBe=o((t,e)=>{let n={Commit:o(i=>e.commit(aBe(i)),"Commit"),Branch:o(i=>e.branch(sBe(i)),"Branch"),Merge:o(i=>e.merge(oBe(i)),"Merge"),Checkout:o(i=>e.checkout(lBe(i)),"Checkout"),CherryPicking:o(i=>e.cherryPick(cBe(i)),"CherryPicking")}[t.$type];n?n(t):V.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),aBe=o(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?Hr[t.type]:Hr.NORMAL,tags:t.tags??void 0}),"parseCommit"),sBe=o(t=>({name:t.name,order:t.order??0}),"parseBranch"),oBe=o(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?Hr[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),lBe=o(t=>t.branch,"parseCheckout"),cBe=o(t=>({id:t.id,targetId:"",tags:t.tags?.length===0?void 0:t.tags,parent:t.parent}),"parseCherryPicking"),Dle={parse:o(async t=>{let e=await Fl("gitGraph",t);V.debug(e),nBe(e,eE)},"parse")}});var uBe,Ko,ff,df,Oc,Hu,E0,Is,Os,tE,ox,rE,hf,Tr,hBe,Mle,Ile,fBe,dBe,pBe,mBe,gBe,yBe,vBe,xBe,bBe,wBe,TBe,kBe,Nle,EBe,lx,CBe,SBe,ABe,_Be,LBe,Ole,Ple=R(()=>{"use strict";Zt();_t();ut();xr();Zk();uBe=de(),Ko=uBe?.gitGraph,ff=10,df=40,Oc=4,Hu=2,E0=8,Is=new Map,Os=new Map,tE=30,ox=new Map,rE=[],hf=0,Tr="LR",hBe=o(()=>{Is.clear(),Os.clear(),ox.clear(),hf=0,rE=[],Tr="LR"},"clear"),Mle=o(t=>{let e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|/gi):t).forEach(n=>{let i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),e.appendChild(i)}),e},"drawText"),Ile=o(t=>{let e,r,n;return Tr==="BT"?(r=o((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=o((i,a)=>i>=a,"comparisonFunc"),n=0),t.forEach(i=>{let a=Tr==="TB"||Tr=="BT"?Os.get(i)?.y:Os.get(i)?.x;a!==void 0&&r(a,n)&&(e=i,n=a)}),e},"findClosestParent"),fBe=o(t=>{let e="",r=1/0;return t.forEach(n=>{let i=Os.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),dBe=o((t,e,r)=>{let n=r,i=r,a=[];t.forEach(s=>{let l=e.get(s);if(!l)throw new Error(`Commit not found for key ${s}`);l.parents.length?(n=mBe(l),i=Math.max(n,i)):a.push(l),gBe(l,n)}),n=i,a.forEach(s=>{yBe(s,n,r)}),t.forEach(s=>{let l=e.get(s);if(l?.parents.length){let u=fBe(l.parents);n=Os.get(u).y-df,n<=i&&(i=n);let h=Is.get(l.branch).pos,f=n-ff;Os.set(l.id,{x:h,y:f})}})},"setParallelBTPos"),pBe=o(t=>{let e=Ile(t.parents.filter(n=>n!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);let r=Os.get(e)?.y;if(r===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return r},"findClosestParentPos"),mBe=o(t=>pBe(t)+df,"calculateCommitPosition"),gBe=o((t,e)=>{let r=Is.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);let n=r.pos,i=e+ff;return Os.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),yBe=o((t,e,r)=>{let n=Is.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);let i=e+r,a=n.pos;Os.set(t.id,{x:a,y:i})},"setRootPosition"),vBe=o((t,e,r,n,i,a)=>{if(a===Hr.HIGHLIGHT)t.append("rect").attr("x",r.x-10).attr("y",r.y-10).attr("width",20).attr("height",20).attr("class",`commit ${e.id} commit-highlight${i%E0} ${n}-outer`),t.append("rect").attr("x",r.x-6).attr("y",r.y-6).attr("width",12).attr("height",12).attr("class",`commit ${e.id} commit${i%E0} ${n}-inner`);else if(a===Hr.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${n}`);else{let s=t.append("circle");if(s.attr("cx",r.x),s.attr("cy",r.y),s.attr("r",e.type===Hr.MERGE?9:10),s.attr("class",`commit ${e.id} commit${i%E0}`),a===Hr.MERGE){let l=t.append("circle");l.attr("cx",r.x),l.attr("cy",r.y),l.attr("r",6),l.attr("class",`commit ${n} ${e.id} commit${i%E0}`)}a===Hr.REVERSE&&t.append("path").attr("d",`M ${r.x-5},${r.y-5}L${r.x+5},${r.y+5}M${r.x-5},${r.y+5}L${r.x+5},${r.y-5}`).attr("class",`commit ${n} ${e.id} commit${i%E0}`)}},"drawCommitBullet"),xBe=o((t,e,r,n)=>{if(e.type!==Hr.CHERRY_PICK&&(e.customId&&e.type===Hr.MERGE||e.type!==Hr.MERGE)&&Ko?.showCommitLabel){let i=t.append("g"),a=i.insert("rect").attr("class","commit-label-bkg"),s=i.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),l=s.node()?.getBBox();if(l&&(a.attr("x",r.posWithOffset-l.width/2-Hu).attr("y",r.y+13.5).attr("width",l.width+2*Hu).attr("height",l.height+2*Hu),Tr==="TB"||Tr==="BT"?(a.attr("x",r.x-(l.width+4*Oc+5)).attr("y",r.y-12),s.attr("x",r.x-(l.width+4*Oc)).attr("y",r.y+l.height-12)):s.attr("x",r.posWithOffset-l.width/2),Ko.rotateCommitLabel))if(Tr==="TB"||Tr==="BT")s.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),a.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{let u=-7.5-(l.width+10)/25*9.5,h=10+l.width/25*8.5;i.attr("transform","translate("+u+", "+h+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),bBe=o((t,e,r,n)=>{if(e.tags.length>0){let i=0,a=0,s=0,l=[];for(let u of e.tags.reverse()){let h=t.insert("polygon"),f=t.append("circle"),d=t.append("text").attr("y",r.y-16-i).attr("class","tag-label").text(u),p=d.node()?.getBBox();if(!p)throw new Error("Tag bbox not found");a=Math.max(a,p.width),s=Math.max(s,p.height),d.attr("x",r.posWithOffset-p.width/2),l.push({tag:d,hole:f,rect:h,yOffset:i}),i+=20}for(let{tag:u,hole:h,rect:f,yOffset:d}of l){let p=s/2,m=r.y-19.2-d;if(f.attr("class","tag-label-bkg").attr("points",` + ${n-a/2-Oc/2},${m+Hu} + ${n-a/2-Oc/2},${m-Hu} + ${r.posWithOffset-a/2-Oc},${m-p-Hu} + ${r.posWithOffset+a/2+Oc},${m-p-Hu} + ${r.posWithOffset+a/2+Oc},${m+p+Hu} + ${r.posWithOffset-a/2-Oc},${m+p+Hu}`),h.attr("cy",m).attr("cx",n-a/2+Oc/2).attr("r",1.5).attr("class","tag-hole"),Tr==="TB"||Tr==="BT"){let g=n+d;f.attr("class","tag-label-bkg").attr("points",` + ${r.x},${g+2} + ${r.x},${g-2} + ${r.x+ff},${g-p-2} + ${r.x+ff+a+4},${g-p-2} + ${r.x+ff+a+4},${g+p+2} + ${r.x+ff},${g+p+2}`).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),h.attr("cx",r.x+Oc/2).attr("cy",g).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),u.attr("x",r.x+5).attr("y",g+3).attr("transform","translate(14,14) rotate(45, "+r.x+","+n+")")}}}},"drawCommitTags"),wBe=o(t=>{switch(t.customType??t.type){case Hr.NORMAL:return"commit-normal";case Hr.REVERSE:return"commit-reverse";case Hr.HIGHLIGHT:return"commit-highlight";case Hr.MERGE:return"commit-merge";case Hr.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),TBe=o((t,e,r,n)=>{let i={x:0,y:0};if(t.parents.length>0){let a=Ile(t.parents);if(a){let s=n.get(a)??i;return e==="TB"?s.y+df:e==="BT"?(n.get(t.id)??i).y-df:s.x+df}}else return e==="TB"?tE:e==="BT"?(n.get(t.id)??i).y-df:0;return 0},"calculatePosition"),kBe=o((t,e,r)=>{let n=Tr==="BT"&&r?e:e+ff,i=Tr==="TB"||Tr==="BT"?n:Is.get(t.branch)?.pos,a=Tr==="TB"||Tr==="BT"?Is.get(t.branch)?.pos:n;if(a===void 0||i===void 0)throw new Error(`Position were undefined for commit ${t.id}`);return{x:a,y:i,posWithOffset:n}},"getCommitPosition"),Nle=o((t,e,r)=>{if(!Ko)throw new Error("GitGraph config not found");let n=t.append("g").attr("class","commit-bullets"),i=t.append("g").attr("class","commit-labels"),a=Tr==="TB"||Tr==="BT"?tE:0,s=[...e.keys()],l=Ko?.parallelCommits??!1,u=o((f,d)=>{let p=e.get(f)?.seq,m=e.get(d)?.seq;return p!==void 0&&m!==void 0?p-m:0},"sortKeys"),h=s.sort(u);Tr==="BT"&&(l&&dBe(h,e,a),h=h.reverse()),h.forEach(f=>{let d=e.get(f);if(!d)throw new Error(`Commit not found for key ${f}`);l&&(a=TBe(d,Tr,a,Os));let p=kBe(d,a,l);if(r){let m=wBe(d),g=d.customType??d.type,y=Is.get(d.branch)?.index??0;vBe(n,d,p,m,y,g),xBe(i,d,p,a),bBe(i,d,p,a)}Tr==="TB"||Tr==="BT"?Os.set(d.id,{x:p.x,y:p.posWithOffset}):Os.set(d.id,{x:p.posWithOffset,y:p.y}),a=Tr==="BT"&&l?a+df:a+df+ff,a>hf&&(hf=a)})},"drawCommits"),EBe=o((t,e,r,n,i)=>{let s=(Tr==="TB"||Tr==="BT"?r.xh.branch===s,"isOnBranchToGetCurve"),u=o(h=>h.seq>t.seq&&h.sequ(h)&&l(h))},"shouldRerouteArrow"),lx=o((t,e,r=0)=>{let n=t+Math.abs(t-e)/2;if(r>5)return n;if(rE.every(s=>Math.abs(s-n)>=10))return rE.push(n),n;let a=Math.abs(t-e);return lx(t,e-a/5,r+1)},"findLane"),CBe=o((t,e,r,n)=>{let i=Os.get(e.id),a=Os.get(r.id);if(i===void 0||a===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);let s=EBe(e,r,i,a,n),l="",u="",h=0,f=0,d=Is.get(r.branch)?.index;r.type===Hr.MERGE&&e.id!==r.parents[0]&&(d=Is.get(e.branch)?.index);let p;if(s){l="A 10 10, 0, 0, 0,",u="A 10 10, 0, 0, 1,",h=10,f=10;let m=i.ya.x&&(l="A 20 20, 0, 0, 0,",u="A 20 20, 0, 0, 1,",h=20,f=20,r.type===Hr.MERGE&&e.id!==r.parents[0]?p=`M ${i.x} ${i.y} L ${i.x} ${a.y-h} ${u} ${i.x-f} ${a.y} L ${a.x} ${a.y}`:p=`M ${i.x} ${i.y} L ${a.x+h} ${i.y} ${l} ${a.x} ${i.y+f} L ${a.x} ${a.y}`),i.x===a.x&&(p=`M ${i.x} ${i.y} L ${a.x} ${a.y}`)):Tr==="BT"?(i.xa.x&&(l="A 20 20, 0, 0, 0,",u="A 20 20, 0, 0, 1,",h=20,f=20,r.type===Hr.MERGE&&e.id!==r.parents[0]?p=`M ${i.x} ${i.y} L ${i.x} ${a.y+h} ${l} ${i.x-f} ${a.y} L ${a.x} ${a.y}`:p=`M ${i.x} ${i.y} L ${a.x-h} ${i.y} ${l} ${a.x} ${i.y-f} L ${a.x} ${a.y}`),i.x===a.x&&(p=`M ${i.x} ${i.y} L ${a.x} ${a.y}`)):(i.ya.y&&(r.type===Hr.MERGE&&e.id!==r.parents[0]?p=`M ${i.x} ${i.y} L ${a.x-h} ${i.y} ${l} ${a.x} ${i.y-f} L ${a.x} ${a.y}`:p=`M ${i.x} ${i.y} L ${i.x} ${a.y+h} ${u} ${i.x+f} ${a.y} L ${a.x} ${a.y}`),i.y===a.y&&(p=`M ${i.x} ${i.y} L ${a.x} ${a.y}`));if(p===void 0)throw new Error("Line definition not found");t.append("path").attr("d",p).attr("class","arrow arrow"+d%E0)},"drawArrow"),SBe=o((t,e)=>{let r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach(n=>{let i=e.get(n);i.parents&&i.parents.length>0&&i.parents.forEach(a=>{CBe(r,e.get(a),i,e)})})},"drawArrows"),ABe=o((t,e)=>{let r=t.append("g");e.forEach((n,i)=>{let a=i%E0,s=Is.get(n.name)?.pos;if(s===void 0)throw new Error(`Position not found for branch ${n.name}`);let l=r.append("line");l.attr("x1",0),l.attr("y1",s),l.attr("x2",hf),l.attr("y2",s),l.attr("class","branch branch"+a),Tr==="TB"?(l.attr("y1",tE),l.attr("x1",s),l.attr("y2",hf),l.attr("x2",s)):Tr==="BT"&&(l.attr("y1",hf),l.attr("x1",s),l.attr("y2",tE),l.attr("x2",s)),rE.push(s);let u=n.name,h=Mle(u),f=r.insert("rect"),p=r.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+a);p.node().appendChild(h);let m=h.getBBox();f.attr("class","branchLabelBkg label"+a).attr("rx",4).attr("ry",4).attr("x",-m.width-4-(Ko?.rotateCommitLabel===!0?30:0)).attr("y",-m.height/2+8).attr("width",m.width+18).attr("height",m.height+4),p.attr("transform","translate("+(-m.width-14-(Ko?.rotateCommitLabel===!0?30:0))+", "+(s-m.height/2-1)+")"),Tr==="TB"?(f.attr("x",s-m.width/2-10).attr("y",0),p.attr("transform","translate("+(s-m.width/2-5)+", 0)")):Tr==="BT"?(f.attr("x",s-m.width/2-10).attr("y",hf),p.attr("transform","translate("+(s-m.width/2-5)+", "+hf+")")):f.attr("transform","translate(-19, "+(s-m.height/2)+")")})},"drawBranches"),_Be=o(function(t,e,r,n,i){return Is.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(Tr==="TB"||Tr==="BT"?n.width/2:0),e},"setBranchPosition"),LBe=o(function(t,e,r,n){if(hBe(),V.debug("in gitgraph renderer",t+` +`,"id:",e,r),!Ko)throw new Error("GitGraph config not found");let i=Ko.rotateCommitLabel??!1,a=n.db;ox=a.getCommits();let s=a.getBranchesAsObjArray();Tr=a.getDirection();let l=$e(`[id="${e}"]`),u=0;s.forEach((h,f)=>{let d=Mle(h.name),p=l.append("g"),m=p.insert("g").attr("class","branchLabel"),g=m.insert("g").attr("class","label branch-label");g.node()?.appendChild(d);let y=d.getBBox();u=_Be(h.name,u,f,y,i),g.remove(),m.remove(),p.remove()}),Nle(l,ox,!1),Ko.showBranches&&ABe(l,s),SBe(l,ox),Nle(l,ox,!0),Lt.insertTitle(l,"gitTitleText",Ko.titleTopMargin??0,a.getDiagramTitle()),aS(void 0,l,Ko.diagramPadding,Ko.useMaxWidth)},"draw"),Ole={draw:LBe}});var DBe,Ble,Fle=R(()=>{"use strict";DBe=o(t=>` .commit-id, .commit-msg, .branch-label { @@ -287,60 +729,60 @@ Expecting `+Bn.join(", ")+", got '"+(this.terminals_[kt]||kt)+"'":Oe="Parse erro font-family: 'trebuchet ms', verdana, arial, sans-serif; font-family: var(--mermaid-font-family); } - ${[0,1,2,3,4,5,6,7].map(a=>` - .branch-label${a} { fill: ${i["gitBranchLabel"+a]}; } - .commit${a} { stroke: ${i["git"+a]}; fill: ${i["git"+a]}; } - .commit-highlight${a} { stroke: ${i["gitInv"+a]}; fill: ${i["gitInv"+a]}; } - .label${a} { fill: ${i["git"+a]}; } - .arrow${a} { stroke: ${i["git"+a]}; } + ${[0,1,2,3,4,5,6,7].map(e=>` + .branch-label${e} { fill: ${t["gitBranchLabel"+e]}; } + .commit${e} { stroke: ${t["git"+e]}; fill: ${t["git"+e]}; } + .commit-highlight${e} { stroke: ${t["gitInv"+e]}; fill: ${t["gitInv"+e]}; } + .label${e} { fill: ${t["git"+e]}; } + .arrow${e} { stroke: ${t["git"+e]}; } `).join(` `)} .branch { stroke-width: 1; - stroke: ${i.lineColor}; + stroke: ${t.lineColor}; stroke-dasharray: 2; } - .commit-label { font-size: ${i.commitLabelFontSize}; fill: ${i.commitLabelColor};} - .commit-label-bkg { font-size: ${i.commitLabelFontSize}; fill: ${i.commitLabelBackground}; opacity: 0.5; } - .tag-label { font-size: ${i.tagLabelFontSize}; fill: ${i.tagLabelColor};} - .tag-label-bkg { fill: ${i.tagLabelBackground}; stroke: ${i.tagLabelBorder}; } - .tag-hole { fill: ${i.textColor}; } + .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};} + .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; } + .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};} + .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; } + .tag-hole { fill: ${t.textColor}; } .commit-merge { - stroke: ${i.primaryColor}; - fill: ${i.primaryColor}; + stroke: ${t.primaryColor}; + fill: ${t.primaryColor}; } .commit-reverse { - stroke: ${i.primaryColor}; - fill: ${i.primaryColor}; + stroke: ${t.primaryColor}; + fill: ${t.primaryColor}; stroke-width: 3; } .commit-highlight-outer { } .commit-highlight-inner { - stroke: ${i.primaryColor}; - fill: ${i.primaryColor}; + stroke: ${t.primaryColor}; + fill: ${t.primaryColor}; } .arrow { stroke-width: 8; stroke-linecap: round; fill: none} .gitTitleText { text-anchor: middle; font-size: 18px; - fill: ${i.textColor}; - } -`}},Symbol.toStringTag,{value:"Module"}));var N0e=function(){var i=function(ve,te,xe,De){for(xe=xe||{},De=ve.length;De--;xe[ve[De]]=te);return xe},a=[1,3],f=[1,5],p=[7,9,11,12,13,14,15,16,17,18,19,20,21,23,25,26,28,35,40],w=[1,15],y=[1,16],b=[1,17],E=[1,18],S=[1,19],N=[1,20],B=[1,21],R=[1,22],j=[1,23],$=[1,24],V=[1,25],Q=[1,26],oe=[1,27],ce=[1,29],se=[1,31],ge=[1,34],ye=[5,7,9,11,12,13,14,15,16,17,18,19,20,21,23,25,26,28,35,40],ke={trace:function(){},yy:{},symbols_:{error:2,start:3,directive:4,gantt:5,document:6,EOF:7,line:8,SPACE:9,statement:10,NL:11,dateFormat:12,inclusiveEndDates:13,topAxis:14,axisFormat:15,tickInterval:16,excludes:17,includes:18,todayMarker:19,title:20,acc_title:21,acc_title_value:22,acc_descr:23,acc_descr_value:24,acc_descr_multiline_value:25,section:26,clickStatement:27,taskTxt:28,taskData:29,openDirective:30,typeDirective:31,closeDirective:32,":":33,argDirective:34,click:35,callbackname:36,callbackargs:37,href:38,clickStatementDebug:39,open_directive:40,type_directive:41,arg_directive:42,close_directive:43,$accept:0,$end:1},terminals_:{2:"error",5:"gantt",7:"EOF",9:"SPACE",11:"NL",12:"dateFormat",13:"inclusiveEndDates",14:"topAxis",15:"axisFormat",16:"tickInterval",17:"excludes",18:"includes",19:"todayMarker",20:"title",21:"acc_title",22:"acc_title_value",23:"acc_descr",24:"acc_descr_value",25:"acc_descr_multiline_value",26:"section",28:"taskTxt",29:"taskData",33:":",35:"click",36:"callbackname",37:"callbackargs",38:"href",40:"open_directive",41:"type_directive",42:"arg_directive",43:"close_directive"},productions_:[0,[3,2],[3,3],[6,0],[6,2],[8,2],[8,1],[8,1],[8,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[10,1],[10,1],[10,2],[10,1],[4,4],[4,6],[27,2],[27,3],[27,3],[27,4],[27,3],[27,4],[27,2],[39,2],[39,3],[39,3],[39,4],[39,3],[39,4],[39,2],[30,1],[31,1],[34,1],[32,1]],performAction:function(te,xe,De,he,Ie,ee,rt){var me=ee.length-1;switch(Ie){case 2:return ee[me-1];case 3:this.$=[];break;case 4:ee[me-1].push(ee[me]),this.$=ee[me-1];break;case 5:case 6:this.$=ee[me];break;case 7:case 8:this.$=[];break;case 9:he.setDateFormat(ee[me].substr(11)),this.$=ee[me].substr(11);break;case 10:he.enableInclusiveEndDates(),this.$=ee[me].substr(18);break;case 11:he.TopAxis(),this.$=ee[me].substr(8);break;case 12:he.setAxisFormat(ee[me].substr(11)),this.$=ee[me].substr(11);break;case 13:he.setTickInterval(ee[me].substr(13)),this.$=ee[me].substr(13);break;case 14:he.setExcludes(ee[me].substr(9)),this.$=ee[me].substr(9);break;case 15:he.setIncludes(ee[me].substr(9)),this.$=ee[me].substr(9);break;case 16:he.setTodayMarker(ee[me].substr(12)),this.$=ee[me].substr(12);break;case 17:he.setDiagramTitle(ee[me].substr(6)),this.$=ee[me].substr(6);break;case 18:this.$=ee[me].trim(),he.setAccTitle(this.$);break;case 19:case 20:this.$=ee[me].trim(),he.setAccDescription(this.$);break;case 21:he.addSection(ee[me].substr(8)),this.$=ee[me].substr(8);break;case 23:he.addTask(ee[me-1],ee[me]),this.$="task";break;case 27:this.$=ee[me-1],he.setClickEvent(ee[me-1],ee[me],null);break;case 28:this.$=ee[me-2],he.setClickEvent(ee[me-2],ee[me-1],ee[me]);break;case 29:this.$=ee[me-2],he.setClickEvent(ee[me-2],ee[me-1],null),he.setLink(ee[me-2],ee[me]);break;case 30:this.$=ee[me-3],he.setClickEvent(ee[me-3],ee[me-2],ee[me-1]),he.setLink(ee[me-3],ee[me]);break;case 31:this.$=ee[me-2],he.setClickEvent(ee[me-2],ee[me],null),he.setLink(ee[me-2],ee[me-1]);break;case 32:this.$=ee[me-3],he.setClickEvent(ee[me-3],ee[me-1],ee[me]),he.setLink(ee[me-3],ee[me-2]);break;case 33:this.$=ee[me-1],he.setLink(ee[me-1],ee[me]);break;case 34:case 40:this.$=ee[me-1]+" "+ee[me];break;case 35:case 36:case 38:this.$=ee[me-2]+" "+ee[me-1]+" "+ee[me];break;case 37:case 39:this.$=ee[me-3]+" "+ee[me-2]+" "+ee[me-1]+" "+ee[me];break;case 41:he.parseDirective("%%{","open_directive");break;case 42:he.parseDirective(ee[me],"type_directive");break;case 43:ee[me]=ee[me].trim().replace(/'/g,'"'),he.parseDirective(ee[me],"arg_directive");break;case 44:he.parseDirective("}%%","close_directive","gantt");break}},table:[{3:1,4:2,5:a,30:4,40:f},{1:[3]},{3:6,4:2,5:a,30:4,40:f},i(p,[2,3],{6:7}),{31:8,41:[1,9]},{41:[2,41]},{1:[2,1]},{4:30,7:[1,10],8:11,9:[1,12],10:13,11:[1,14],12:w,13:y,14:b,15:E,16:S,17:N,18:B,19:R,20:j,21:$,23:V,25:Q,26:oe,27:28,28:ce,30:4,35:se,40:f},{32:32,33:[1,33],43:ge},i([33,43],[2,42]),i(p,[2,8],{1:[2,2]}),i(p,[2,4]),{4:30,10:35,12:w,13:y,14:b,15:E,16:S,17:N,18:B,19:R,20:j,21:$,23:V,25:Q,26:oe,27:28,28:ce,30:4,35:se,40:f},i(p,[2,6]),i(p,[2,7]),i(p,[2,9]),i(p,[2,10]),i(p,[2,11]),i(p,[2,12]),i(p,[2,13]),i(p,[2,14]),i(p,[2,15]),i(p,[2,16]),i(p,[2,17]),{22:[1,36]},{24:[1,37]},i(p,[2,20]),i(p,[2,21]),i(p,[2,22]),{29:[1,38]},i(p,[2,24]),{36:[1,39],38:[1,40]},{11:[1,41]},{34:42,42:[1,43]},{11:[2,44]},i(p,[2,5]),i(p,[2,18]),i(p,[2,19]),i(p,[2,23]),i(p,[2,27],{37:[1,44],38:[1,45]}),i(p,[2,33],{36:[1,46]}),i(ye,[2,25]),{32:47,43:ge},{43:[2,43]},i(p,[2,28],{38:[1,48]}),i(p,[2,29]),i(p,[2,31],{37:[1,49]}),{11:[1,50]},i(p,[2,30]),i(p,[2,32]),i(ye,[2,26])],defaultActions:{5:[2,41],6:[2,1],34:[2,44],43:[2,43]},parseError:function(te,xe){if(xe.recoverable)this.trace(te);else{var De=new Error(te);throw De.hash=xe,De}},parse:function(te){var xe=this,De=[0],he=[],Ie=[null],ee=[],rt=this.table,me="",gt=0,pe=0,Et=2,wt=1,jt=ee.slice.call(arguments,1),At=Object.create(this.lexer),Bt={yy:{}};for(var cn in this.yy)Object.prototype.hasOwnProperty.call(this.yy,cn)&&(Bt.yy[cn]=this.yy[cn]);At.setInput(te,Bt.yy),Bt.yy.lexer=At,Bt.yy.parser=this,typeof At.yylloc>"u"&&(At.yylloc={});var Nn=At.yylloc;ee.push(Nn);var Ot=At.options&&At.options.ranges;typeof Bt.yy.parseError=="function"?this.parseError=Bt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function oi(){var Ri;return Ri=he.pop()||At.lex()||wt,typeof Ri!="number"&&(Ri instanceof Array&&(he=Ri,Ri=he.pop()),Ri=xe.symbols_[Ri]||Ri),Ri}for(var kt,Dt,vt,Nt,ze={},Xe,Lt,Ge,Bn;;){if(Dt=De[De.length-1],this.defaultActions[Dt]?vt=this.defaultActions[Dt]:((kt===null||typeof kt>"u")&&(kt=oi()),vt=rt[Dt]&&rt[Dt][kt]),typeof vt>"u"||!vt.length||!vt[0]){var Oe="";Bn=[];for(Xe in rt[Dt])this.terminals_[Xe]&&Xe>Et&&Bn.push("'"+this.terminals_[Xe]+"'");At.showPosition?Oe="Parse error on line "+(gt+1)+`: -`+At.showPosition()+` -Expecting `+Bn.join(", ")+", got '"+(this.terminals_[kt]||kt)+"'":Oe="Parse error on line "+(gt+1)+": Unexpected "+(kt==wt?"end of input":"'"+(this.terminals_[kt]||kt)+"'"),this.parseError(Oe,{text:At.match,token:this.terminals_[kt]||kt,line:At.yylineno,loc:Nn,expected:Bn})}if(vt[0]instanceof Array&&vt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Dt+", token: "+kt);switch(vt[0]){case 1:De.push(kt),Ie.push(At.yytext),ee.push(At.yylloc),De.push(vt[1]),kt=null,pe=At.yyleng,me=At.yytext,gt=At.yylineno,Nn=At.yylloc;break;case 2:if(Lt=this.productions_[vt[1]][1],ze.$=Ie[Ie.length-Lt],ze._$={first_line:ee[ee.length-(Lt||1)].first_line,last_line:ee[ee.length-1].last_line,first_column:ee[ee.length-(Lt||1)].first_column,last_column:ee[ee.length-1].last_column},Ot&&(ze._$.range=[ee[ee.length-(Lt||1)].range[0],ee[ee.length-1].range[1]]),Nt=this.performAction.apply(ze,[me,pe,gt,Bt.yy,vt[1],Ie,ee].concat(jt)),typeof Nt<"u")return Nt;Lt&&(De=De.slice(0,-1*Lt*2),Ie=Ie.slice(0,-1*Lt),ee=ee.slice(0,-1*Lt)),De.push(this.productions_[vt[1]][0]),Ie.push(ze.$),ee.push(ze._$),Ge=rt[De[De.length-2]][De[De.length-1]],De.push(Ge);break;case 3:return!0}}return!0}},Ae=function(){var ve={EOF:1,parseError:function(xe,De){if(this.yy.parser)this.yy.parser.parseError(xe,De);else throw new Error(xe)},setInput:function(te,xe){return this.yy=xe||this.yy||{},this._input=te,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var te=this._input[0];this.yytext+=te,this.yyleng++,this.offset++,this.match+=te,this.matched+=te;var xe=te.match(/(?:\r\n?|\n).*/g);return xe?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),te},unput:function(te){var xe=te.length,De=te.split(/(?:\r\n?|\n)/g);this._input=te+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-xe),this.offset-=xe;var he=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),De.length-1&&(this.yylineno-=De.length-1);var Ie=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:De?(De.length===he.length?this.yylloc.first_column:0)+he[he.length-De.length].length-De[0].length:this.yylloc.first_column-xe},this.options.ranges&&(this.yylloc.range=[Ie[0],Ie[0]+this.yyleng-xe]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(te){this.unput(this.match.slice(te))},pastInput:function(){var te=this.matched.substr(0,this.matched.length-this.match.length);return(te.length>20?"...":"")+te.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var te=this.match;return te.length<20&&(te+=this._input.substr(0,20-te.length)),(te.substr(0,20)+(te.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var te=this.pastInput(),xe=new Array(te.length+1).join("-");return te+this.upcomingInput()+` -`+xe+"^"},test_match:function(te,xe){var De,he,Ie;if(this.options.backtrack_lexer&&(Ie={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},this.options.ranges&&(Ie.yylloc.range=this.yylloc.range.slice(0))),he=te[0].match(/(?:\r\n?|\n).*/g),he&&(this.yylineno+=he.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:he?he[he.length-1].length-he[he.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+te[0].length},this.yytext+=te[0],this.match+=te[0],this.matches=te,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(te[0].length),this.matched+=te[0],De=this.performAction.call(this,this.yy,this,xe,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),De)return De;if(this._backtrack){for(var ee in Ie)this[ee]=Ie[ee];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var te,xe,De,he;this._more||(this.yytext="",this.match="");for(var Ie=this._currentRules(),ee=0;eexe[0].length)){if(xe=De,he=ee,this.options.backtrack_lexer){if(te=this.test_match(De,Ie[ee]),te!==!1)return te;if(this._backtrack){xe=!1;continue}else return!1}else if(!this.options.flex)break}return xe?(te=this.test_match(xe,Ie[he]),te!==!1?te:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var xe=this.next();return xe||this.lex()},begin:function(xe){this.conditionStack.push(xe)},popState:function(){var xe=this.conditionStack.length-1;return xe>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(xe){return xe=this.conditionStack.length-1-Math.abs(xe||0),xe>=0?this.conditionStack[xe]:"INITIAL"},pushState:function(xe){this.begin(xe)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(xe,De,he,Ie){switch(he){case 0:return this.begin("open_directive"),40;case 1:return this.begin("type_directive"),41;case 2:return this.popState(),this.begin("arg_directive"),33;case 3:return this.popState(),this.popState(),43;case 4:return 42;case 5:return this.begin("acc_title"),21;case 6:return this.popState(),"acc_title_value";case 7:return this.begin("acc_descr"),23;case 8:return this.popState(),"acc_descr_value";case 9:this.begin("acc_descr_multiline");break;case 10:this.popState();break;case 11:return"acc_descr_multiline_value";case 12:break;case 13:break;case 14:break;case 15:return 11;case 16:break;case 17:break;case 18:break;case 19:this.begin("href");break;case 20:this.popState();break;case 21:return 38;case 22:this.begin("callbackname");break;case 23:this.popState();break;case 24:this.popState(),this.begin("callbackargs");break;case 25:return 36;case 26:this.popState();break;case 27:return 37;case 28:this.begin("click");break;case 29:this.popState();break;case 30:return 35;case 31:return 5;case 32:return 12;case 33:return 13;case 34:return 14;case 35:return 15;case 36:return 16;case 37:return 18;case 38:return 17;case 39:return 19;case 40:return"date";case 41:return 20;case 42:return"accDescription";case 43:return 26;case 44:return 28;case 45:return 29;case 46:return 33;case 47:return 7;case 48:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/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,/^(?:%[^\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,/^(?:\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:[10,11],inclusive:!1},acc_descr:{rules:[8],inclusive:!1},acc_title:{rules:[6],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},callbackargs:{rules:[26,27],inclusive:!1},callbackname:{rules:[23,24,25],inclusive:!1},href:{rules:[20,21],inclusive:!1},click:{rules:[29,30],inclusive:!1},INITIAL:{rules:[0,5,7,9,12,13,14,15,16,17,18,19,22,28,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],inclusive:!0}}};return ve}();ke.lexer=Ae;function de(){this.yy={}}return de.prototype=ke,ke.Parser=de,new de}();N0e.parser=N0e;const Ejt=N0e;var Tjt="isoweek";const _jt=function(i,a,f){var p=function(S,N){var B=(N?f.utc:f)().year(S).startOf(o5),R=4-B.isoWeekday();return B.isoWeekday()>4&&(R+=7),B.add(R,Fw)},w=function(S){return S.add(4-S.isoWeekday(),Fw)},y=a.prototype;y.isoWeekYear=function(){var E=w(this);return E.year()},y.isoWeek=function(E){if(!this.$utils().u(E))return this.add((E-this.isoWeek())*7,Fw);var S=w(this),N=p(this.isoWeekYear(),this.$u);return S.diff(N,yN)+1},y.isoWeekday=function(E){return this.$utils().u(E)?this.day()||7:this.day(this.day()%7?E:E-7)};var b=y.startOf;y.startOf=function(E,S){var N=this.$utils(),B=N.u(S)?!0:S,R=N.p(E);return R===Tjt?B?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):b.bind(this)(E,S)}};var Cjt=function(a){return a.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(f,p,w){return p||w.slice(1)})},Sjt={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"},Ajt=function(a,f){return a.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(p,w,y){var b=y&&y.toUpperCase();return w||f[y]||Sjt[y]||Cjt(f[b])})},Ljt=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,Mjt=/\d/,TK=/\d\d/,Djt=/\d{3}/,Ijt=/\d{4}/,h3=/\d\d?/,Ojt=/[+-]?\d+/,Njt=/[+-]\d\d:?(\d\d)?|Z/,xP=/\d*[^-_:/,()\s\d]+/,ax={},pRe=function(a){return a=+a,a+(a>68?1900:2e3)};function Pjt(i){if(!i||i==="Z")return 0;var a=i.match(/([+-]|\d\d)/g),f=+(a[1]*60)+(+a[2]||0);return f===0?0:a[0]==="+"?-f:f}var cp=function(a){return function(f){this[a]=+f}},bRe=[Njt,function(i){var a=this.zone||(this.zone={});a.offset=Pjt(i)}],P0e=function(a){var f=ax[a];return f&&(f.indexOf?f:f.s.concat(f.f))},vRe=function(a,f){var p,w=ax,y=w.meridiem;if(!y)p=a===(f?"pm":"PM");else for(var b=1;b<=24;b+=1)if(a.indexOf(y(b,0,f))>-1){p=b>12;break}return p},Bjt={A:[xP,function(i){this.afternoon=vRe(i,!1)}],a:[xP,function(i){this.afternoon=vRe(i,!0)}],S:[Mjt,function(i){this.milliseconds=+i*100}],SS:[TK,function(i){this.milliseconds=+i*10}],SSS:[Djt,function(i){this.milliseconds=+i}],s:[h3,cp("seconds")],ss:[h3,cp("seconds")],m:[h3,cp("minutes")],mm:[h3,cp("minutes")],H:[h3,cp("hours")],h:[h3,cp("hours")],HH:[h3,cp("hours")],hh:[h3,cp("hours")],D:[h3,cp("day")],DD:[TK,cp("day")],Do:[xP,function(i){var a=ax,f=a.ordinal,p=i.match(/\d+/);if(this.day=p[0],!!f)for(var w=1;w<=31;w+=1)f(w).replace(/\[|\]/g,"")===i&&(this.day=w)}],M:[h3,cp("month")],MM:[TK,cp("month")],MMM:[xP,function(i){var a=P0e("months"),f=P0e("monthsShort"),p=(f||a.map(function(w){return w.slice(0,3)})).indexOf(i)+1;if(p<1)throw new Error;this.month=p%12||p}],MMMM:[xP,function(i){var a=P0e("months"),f=a.indexOf(i)+1;if(f<1)throw new Error;this.month=f%12||f}],Y:[Ojt,cp("year")],YY:[TK,function(i){this.year=pRe(i)}],YYYY:[Ijt,cp("year")],Z:bRe,ZZ:bRe};function Rjt(i){var a=i.afternoon;if(a!==void 0){var f=i.hours;a?f<12&&(i.hours+=12):f===12&&(i.hours=0),delete i.afternoon}}function Fjt(i){i=Ajt(i,ax&&ax.formats);for(var a=i.match(Ljt),f=a.length,p=0;p-1)return new Date((f==="X"?1e3:1)*a);var w=Fjt(f),y=w(a),b=y.year,E=y.month,S=y.day,N=y.hours,B=y.minutes,R=y.seconds,j=y.milliseconds,$=y.zone,V=new Date,Q=S||(!b&&!E?V.getDate():1),oe=b||V.getFullYear(),ce=0;b&&!E||(ce=E>0?E-1:V.getMonth());var se=N||0,ge=B||0,ye=R||0,ke=j||0;return $?new Date(Date.UTC(oe,ce,Q,se,ge,ye,ke+$.offset*60*1e3)):p?new Date(Date.UTC(oe,ce,Q,se,ge,ye,ke)):new Date(oe,ce,Q,se,ge,ye,ke)}catch{return new Date("")}};const $jt=function(i,a,f){f.p.customParseFormat=!0,i&&i.parseTwoDigitYear&&(pRe=i.parseTwoDigitYear);var p=a.prototype,w=p.parse;p.parse=function(y){var b=y.date,E=y.utc,S=y.args;this.$u=E;var N=S[1];if(typeof N=="string"){var B=S[2]===!0,R=S[3]===!0,j=B||R,$=S[2];R&&($=S[2]),ax=this.$locale(),!B&&$&&(ax=f.Ls[$]),this.$d=jjt(b,N,E),this.init(),$&&$!==!0&&(this.$L=this.locale($).$L),j&&b!=this.format(N)&&(this.$d=new Date("")),ax={}}else if(N instanceof Array)for(var V=N.length,Q=1;Q<=V;Q+=1){S[1]=N[Q-1];var oe=f.apply(this,S);if(oe.isValid()){this.$d=oe.$d,this.$L=oe.$L,this.init();break}Q===V&&(this.$d=new Date(""))}else w.call(this,y)}},Hjt=function(i,a){var f=a.prototype,p=f.format;f.format=function(w){var y=this,b=this.$locale();if(!this.isValid())return p.bind(this)(w);var E=this.$utils(),S=w||mLe,N=S.replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(B){switch(B){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return b.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return b.ordinal(y.week(),"W");case"w":case"ww":return E.s(y.week(),B==="w"?1:2,"0");case"W":case"WW":return E.s(y.isoWeek(),B==="W"?1:2,"0");case"k":case"kk":return E.s(String(y.$H===0?24:y.$H),B==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return B}});return p.bind(this)(N)}};ru.extend(_jt),ru.extend($jt),ru.extend(Hjt);let f3="",B0e="",R0e,F0e="",EP=[],TP=[],j0e={},$0e=[],_K=[],iL="",H0e="";const wRe=["active","done","crit","milestone"];let z0e=[],_P=!1,G0e=!1,q0e=0;const zjt=function(i,a,f){rd.parseDirective(this,i,a,f)},Gjt=function(){$0e=[],_K=[],iL="",z0e=[],CK=0,U0e=void 0,SK=void 0,b1=[],f3="",B0e="",H0e="",R0e=void 0,F0e="",EP=[],TP=[],_P=!1,G0e=!1,q0e=0,j0e={},rp()},qjt=function(i){B0e=i},Vjt=function(){return B0e},Ujt=function(i){R0e=i},Wjt=function(){return R0e},Kjt=function(i){F0e=i},Yjt=function(){return F0e},Xjt=function(i){f3=i},Qjt=function(){_P=!0},Zjt=function(){return _P},Jjt=function(){G0e=!0},e$t=function(){return G0e},t$t=function(i){H0e=i},n$t=function(){return H0e},r$t=function(){return f3},i$t=function(i){EP=i.toLowerCase().split(/[\s,]+/)},s$t=function(){return EP},a$t=function(i){TP=i.toLowerCase().split(/[\s,]+/)},o$t=function(){return TP},c$t=function(){return j0e},u$t=function(i){iL=i,$0e.push(i)},l$t=function(){return $0e},h$t=function(){let i=TRe();const a=10;let f=0;for(;!i&&f=6&&f.includes("weekends")||f.includes(i.format("dddd").toLowerCase())?!0:f.includes(i.format(a.trim()))},yRe=function(i,a,f,p){if(!f.length||i.manualEndTime)return;let w;i.startTime instanceof Date?w=ru(i.startTime):w=ru(i.startTime,a,!0),w=w.add(1,"d");let y;i.endTime instanceof Date?y=ru(i.endTime):y=ru(i.endTime,a,!0);const[b,E]=f$t(w,y,a,f,p);i.endTime=b.toDate(),i.renderEndTime=E},f$t=function(i,a,f,p,w){let y=!1,b=null;for(;i<=a;)y||(b=a.toDate()),y=mRe(i,f,p,w),y&&(a=a.add(1,"d")),i=i.add(1,"d");return[a,b]},V0e=function(i,a,f){f=f.trim();const w=/^after\s+([\d\w- ]+)/.exec(f.trim());if(w!==null){let b=null;if(w[1].split(" ").forEach(function(E){let S=aL(E);S!==void 0&&(b?S.endTime>b.endTime&&(b=S):b=S)}),b)return b.endTime;{const E=new Date;return E.setHours(0,0,0,0),E}}let y=ru(f,a.trim(),!0);if(y.isValid())return y.toDate();{Fe.debug("Invalid date:"+f),Fe.debug("With date format:"+a.trim());const b=new Date(f);if(b===void 0||isNaN(b.getTime()))throw new Error("Invalid date:"+f);return b}},kRe=function(i){const a=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(i.trim());return a!==null?[Number.parseFloat(a[1]),a[2]]:[NaN,"ms"]},xRe=function(i,a,f,p=!1){f=f.trim();let w=ru(f,a.trim(),!0);if(w.isValid())return p&&(w=w.add(1,"d")),w.toDate();let y=ru(i);const[b,E]=kRe(f);if(!Number.isNaN(b)){const S=y.add(b,E);S.isValid()&&(y=S)}return y.toDate()};let CK=0;const sL=function(i){return i===void 0?(CK=CK+1,"task"+CK):i},d$t=function(i,a){let f;a.substr(0,1)===":"?f=a.substr(1,a.length):f=a;const p=f.split(","),w={};SRe(p,w,wRe);for(let b=0;b{window.open(f,"_self")}),j0e[p]=f)}),_Re(i,"clickable")},_Re=function(i,a){i.split(",").forEach(function(f){let p=aL(f);p!==void 0&&p.classes.push(a)})},w$t=function(i,a,f){if(Tt().securityLevel!=="loose"||a===void 0)return;let p=[];if(typeof f=="string"){p=f.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let y=0;y{co.runFunc(a,...p)})},CRe=function(i,a){z0e.push(function(){const f=document.querySelector(`[id="${i}"]`);f!==null&&f.addEventListener("click",function(){a()})},function(){const f=document.querySelector(`[id="${i}-text"]`);f!==null&&f.addEventListener("click",function(){a()})})},m$t={parseDirective:zjt,getConfig:()=>Tt().gantt,clear:Gjt,setDateFormat:Xjt,getDateFormat:r$t,enableInclusiveEndDates:Qjt,endDatesAreInclusive:Zjt,enableTopAxis:Jjt,topAxisEnabled:e$t,setAxisFormat:qjt,getAxisFormat:Vjt,setTickInterval:Ujt,getTickInterval:Wjt,setTodayMarker:Kjt,getTodayMarker:Yjt,setAccTitle:ip,getAccTitle:L2,setDiagramTitle:Uw,getDiagramTitle:Ww,setDisplayMode:t$t,getDisplayMode:n$t,setAccDescription:M2,getAccDescription:D2,addSection:u$t,getSections:l$t,getTasks:h$t,addTask:p$t,findTaskById:aL,addTaskOrg:b$t,setIncludes:i$t,getIncludes:s$t,setExcludes:a$t,getExcludes:o$t,setClickEvent:function(i,a,f){i.split(",").forEach(function(p){w$t(p,a,f)}),_Re(i,"clickable")},setLink:v$t,getLinks:c$t,bindFunctions:function(i){z0e.forEach(function(a){a(i)})},parseDuration:kRe,isInvalidDate:mRe};function SRe(i,a,f){let p=!0;for(;p;)p=!1,f.forEach(function(w){const y="^\\s*"+w+"\\s*$",b=new RegExp(y);i[0].match(b)&&(a[w]=!0,i.shift(1),p=!0)})}const y$t=function(){Fe.debug("Something is calling, setConf, remove the call")},k$t=(i,a)=>{let f=[...i].map(()=>-1/0),p=[...i].sort((y,b)=>y.startTime-b.startTime||y.order-b.order),w=0;for(const y of p)for(let b=0;b=f[b]){f[b]=y.endTime,y.order=b+a,b>w&&(w=b);break}return w};let S5;const x$t=Object.freeze(Object.defineProperty({__proto__:null,diagram:{parser:Ejt,db:m$t,renderer:{setConf:y$t,draw:function(i,a,f,p){const w=Tt().gantt,y=Tt().securityLevel;let b;y==="sandbox"&&(b=Cr("#i"+a));const E=Cr(y==="sandbox"?b.nodes()[0].contentDocument.body:"body"),S=y==="sandbox"?b.nodes()[0].contentDocument:document,N=S.getElementById(a);S5=N.parentElement.offsetWidth,S5===void 0&&(S5=1200),w.useWidth!==void 0&&(S5=w.useWidth);const B=p.db.getTasks();let R=[];for(const ve of B)R.push(ve.type);R=de(R);const j={};let $=2*w.topPadding;if(p.db.getDisplayMode()==="compact"||w.displayMode==="compact"){const ve={};for(const xe of B)ve[xe.section]===void 0?ve[xe.section]=[xe]:ve[xe.section].push(xe);let te=0;for(const xe of Object.keys(ve)){const De=k$t(ve[xe],te)+1;te+=De,$+=De*(w.barHeight+w.barGap),j[xe]=De}}else{$+=B.length*(w.barHeight+w.barGap);for(const ve of R)j[ve]=B.filter(te=>te.type===ve).length}N.setAttribute("viewBox","0 0 "+S5+" "+$);const V=E.select(`[id="${a}"]`),Q=J7t().domain([O5t(B,function(ve){return ve.startTime}),I5t(B,function(ve){return ve.endTime})]).rangeRound([0,S5-w.leftPadding-w.rightPadding]);function oe(ve,te){const xe=ve.startTime,De=te.startTime;let he=0;return xe>De?he=1:xewt.order))].map(wt=>ve.find(jt=>jt.order===wt));V.append("g").selectAll("rect").data(me).enter().append("rect").attr("x",0).attr("y",function(wt,jt){return jt=wt.order,jt*te+xe-2}).attr("width",function(){return ee-w.rightPadding/2}).attr("height",te).attr("class",function(wt){for(const[jt,At]of R.entries())if(wt.type===At)return"section section"+jt%w.numberSectionStyles;return"section section0"});const gt=V.append("g").selectAll("rect").data(ve).enter(),pe=p.db.getLinks();if(gt.append("rect").attr("id",function(wt){return wt.id}).attr("rx",3).attr("ry",3).attr("x",function(wt){return wt.milestone?Q(wt.startTime)+De+.5*(Q(wt.endTime)-Q(wt.startTime))-.5*he:Q(wt.startTime)+De}).attr("y",function(wt,jt){return jt=wt.order,jt*te+xe}).attr("width",function(wt){return wt.milestone?he:Q(wt.renderEndTime||wt.endTime)-Q(wt.startTime)}).attr("height",he).attr("transform-origin",function(wt,jt){return jt=wt.order,(Q(wt.startTime)+De+.5*(Q(wt.endTime)-Q(wt.startTime))).toString()+"px "+(jt*te+xe+.5*he).toString()+"px"}).attr("class",function(wt){const jt="task";let At="";wt.classes.length>0&&(At=wt.classes.join(" "));let Bt=0;for(const[Nn,Ot]of R.entries())wt.type===Ot&&(Bt=Nn%w.numberSectionStyles);let cn="";return wt.active?wt.crit?cn+=" activeCrit":cn=" active":wt.done?wt.crit?cn=" doneCrit":cn=" done":wt.crit&&(cn+=" crit"),cn.length===0&&(cn=" task"),wt.milestone&&(cn=" milestone "+cn),cn+=Bt,cn+=" "+At,jt+cn}),gt.append("text").attr("id",function(wt){return wt.id+"-text"}).text(function(wt){return wt.task}).attr("font-size",w.fontSize).attr("x",function(wt){let jt=Q(wt.startTime),At=Q(wt.renderEndTime||wt.endTime);wt.milestone&&(jt+=.5*(Q(wt.endTime)-Q(wt.startTime))-.5*he),wt.milestone&&(At=jt+he);const Bt=this.getBBox().width;return Bt>At-jt?At+Bt+1.5*w.leftPadding>ee?jt+De-5:At+De+5:(At-jt)/2+jt+De}).attr("y",function(wt,jt){return jt=wt.order,jt*te+w.barHeight/2+(w.fontSize/2-2)+xe}).attr("text-height",he).attr("class",function(wt){const jt=Q(wt.startTime);let At=Q(wt.endTime);wt.milestone&&(At=jt+he);const Bt=this.getBBox().width;let cn="";wt.classes.length>0&&(cn=wt.classes.join(" "));let Nn=0;for(const[oi,kt]of R.entries())wt.type===kt&&(Nn=oi%w.numberSectionStyles);let Ot="";return wt.active&&(wt.crit?Ot="activeCritText"+Nn:Ot="activeText"+Nn),wt.done?wt.crit?Ot=Ot+" doneCritText"+Nn:Ot=Ot+" doneText"+Nn:wt.crit&&(Ot=Ot+" critText"+Nn),wt.milestone&&(Ot+=" milestoneText"),Bt>At-jt?At+Bt+1.5*w.leftPadding>ee?cn+" taskTextOutsideLeft taskTextOutside"+Nn+" "+Ot:cn+" taskTextOutsideRight taskTextOutside"+Nn+" "+Ot+" width-"+Bt:cn+" taskText taskText"+Nn+" "+Ot+" width-"+Bt}),Tt().securityLevel==="sandbox"){let wt;wt=Cr("#i"+a);const jt=wt.nodes()[0].contentDocument;gt.filter(function(At){return pe[At.id]!==void 0}).each(function(At){var Bt=jt.querySelector("#"+At.id),cn=jt.querySelector("#"+At.id+"-text");const Nn=Bt.parentNode;var Ot=jt.createElement("a");Ot.setAttribute("xlink:href",pe[At.id]),Ot.setAttribute("target","_top"),Nn.appendChild(Ot),Ot.appendChild(Bt),Ot.appendChild(cn)})}}function ge(ve,te,xe,De,he,Ie,ee,rt){const me=Ie.reduce((Bt,{startTime:cn})=>Bt?Math.min(Bt,cn):cn,0),gt=Ie.reduce((Bt,{endTime:cn})=>Bt?Math.max(Bt,cn):cn,0),pe=p.db.getDateFormat();if(!me||!gt)return;const Et=[];let wt=null,jt=ru(me);for(;jt.valueOf()<=gt;)p.db.isInvalidDate(jt,pe,ee,rt)?wt?wt.end=jt:wt={start:jt,end:jt}:wt&&(Et.push(wt),wt=null),jt=jt.add(1,"d");V.append("g").selectAll("rect").data(Et).enter().append("rect").attr("id",function(Bt){return"exclude-"+Bt.start.format("YYYY-MM-DD")}).attr("x",function(Bt){return Q(Bt.start)+xe}).attr("y",w.gridLineStartPadding).attr("width",function(Bt){const cn=Bt.end.add(1,"day");return Q(cn)-Q(Bt.start)}).attr("height",he-te-w.gridLineStartPadding).attr("transform-origin",function(Bt,cn){return(Q(Bt.start)+xe+.5*(Q(Bt.end)-Q(Bt.start))).toString()+"px "+(cn*ve+.5*he).toString()+"px"}).attr("class","exclude-range")}function ye(ve,te,xe,De){let he=H5t(Q).tickSize(-De+te+w.gridLineStartPadding).tickFormat($U(p.db.getAxisFormat()||w.axisFormat||"%Y-%m-%d"));const ee=/^([1-9]\d*)(minute|hour|day|week|month)$/.exec(p.db.getTickInterval()||w.tickInterval);if(ee!==null){const rt=ee[1];switch(ee[2]){case"minute":he.ticks(PU.every(rt));break;case"hour":he.ticks(BU.every(rt));break;case"day":he.ticks(yA.every(rt));break;case"week":he.ticks(kA.every(rt));break;case"month":he.ticks(FU.every(rt));break}}if(V.append("g").attr("class","grid").attr("transform","translate("+ve+", "+(De-50)+")").call(he).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),p.db.topAxisEnabled()||w.topAxis){let rt=$5t(Q).tickSize(-De+te+w.gridLineStartPadding).tickFormat($U(p.db.getAxisFormat()||w.axisFormat||"%Y-%m-%d"));if(ee!==null){const me=ee[1];switch(ee[2]){case"minute":rt.ticks(PU.every(me));break;case"hour":rt.ticks(BU.every(me));break;case"day":rt.ticks(yA.every(me));break;case"week":rt.ticks(kA.every(me));break;case"month":rt.ticks(FU.every(me));break}}V.append("g").attr("class","grid").attr("transform","translate("+ve+", "+te+")").call(rt).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}function ke(ve,te){let xe=0;const De=Object.keys(j).map(he=>[he,j[he]]);V.append("g").selectAll("text").data(De).enter().append(function(he){const Ie=he[0].split(Wa.lineBreakRegex),ee=-(Ie.length-1)/2,rt=S.createElementNS("http://www.w3.org/2000/svg","text");rt.setAttribute("dy",ee+"em");for(const[me,gt]of Ie.entries()){const pe=S.createElementNS("http://www.w3.org/2000/svg","tspan");pe.setAttribute("alignment-baseline","central"),pe.setAttribute("x","10"),me>0&&pe.setAttribute("dy","1em"),pe.textContent=gt,rt.appendChild(pe)}return rt}).attr("x",10).attr("y",function(he,Ie){if(Ie>0)for(let ee=0;ee` + fill: ${t.textColor}; + } +`,"getStyles"),Ble=DBe});var zle={};hr(zle,{diagram:()=>RBe});var RBe,Gle=R(()=>{"use strict";Rle();EI();Ple();Fle();RBe={parser:Dle,db:eE,renderer:Ole,styles:Ble}});var CI,Ule,Hle=R(()=>{"use strict";CI=function(){var t=o(function(I,C,O,D){for(O=O||{},D=I.length;D--;O[I[D]]=C);return O},"o"),e=[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],r=[1,26],n=[1,27],i=[1,28],a=[1,29],s=[1,30],l=[1,31],u=[1,32],h=[1,33],f=[1,34],d=[1,9],p=[1,10],m=[1,11],g=[1,12],y=[1,13],v=[1,14],x=[1,15],b=[1,16],w=[1,19],S=[1,20],T=[1,21],E=[1,22],_=[1,23],A=[1,25],L=[1,35],M={trace:o(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,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:o(function(C,O,D,P,F,B,$){var z=B.length-1;switch(F){case 1:return B[z-1];case 2:this.$=[];break;case 3:B[z-1].push(B[z]),this.$=B[z-1];break;case 4:case 5:this.$=B[z];break;case 6:case 7:this.$=[];break;case 8:P.setWeekday("monday");break;case 9:P.setWeekday("tuesday");break;case 10:P.setWeekday("wednesday");break;case 11:P.setWeekday("thursday");break;case 12:P.setWeekday("friday");break;case 13:P.setWeekday("saturday");break;case 14:P.setWeekday("sunday");break;case 15:P.setWeekend("friday");break;case 16:P.setWeekend("saturday");break;case 17:P.setDateFormat(B[z].substr(11)),this.$=B[z].substr(11);break;case 18:P.enableInclusiveEndDates(),this.$=B[z].substr(18);break;case 19:P.TopAxis(),this.$=B[z].substr(8);break;case 20:P.setAxisFormat(B[z].substr(11)),this.$=B[z].substr(11);break;case 21:P.setTickInterval(B[z].substr(13)),this.$=B[z].substr(13);break;case 22:P.setExcludes(B[z].substr(9)),this.$=B[z].substr(9);break;case 23:P.setIncludes(B[z].substr(9)),this.$=B[z].substr(9);break;case 24:P.setTodayMarker(B[z].substr(12)),this.$=B[z].substr(12);break;case 27:P.setDiagramTitle(B[z].substr(6)),this.$=B[z].substr(6);break;case 28:this.$=B[z].trim(),P.setAccTitle(this.$);break;case 29:case 30:this.$=B[z].trim(),P.setAccDescription(this.$);break;case 31:P.addSection(B[z].substr(8)),this.$=B[z].substr(8);break;case 33:P.addTask(B[z-1],B[z]),this.$="task";break;case 34:this.$=B[z-1],P.setClickEvent(B[z-1],B[z],null);break;case 35:this.$=B[z-2],P.setClickEvent(B[z-2],B[z-1],B[z]);break;case 36:this.$=B[z-2],P.setClickEvent(B[z-2],B[z-1],null),P.setLink(B[z-2],B[z]);break;case 37:this.$=B[z-3],P.setClickEvent(B[z-3],B[z-2],B[z-1]),P.setLink(B[z-3],B[z]);break;case 38:this.$=B[z-2],P.setClickEvent(B[z-2],B[z],null),P.setLink(B[z-2],B[z-1]);break;case 39:this.$=B[z-3],P.setClickEvent(B[z-3],B[z-1],B[z]),P.setLink(B[z-3],B[z-2]);break;case 40:this.$=B[z-1],P.setLink(B[z-1],B[z]);break;case 41:case 47:this.$=B[z-1]+" "+B[z];break;case 42:case 43:case 45:this.$=B[z-2]+" "+B[z-1]+" "+B[z];break;case 44:case 46:this.$=B[z-3]+" "+B[z-2]+" "+B[z-1]+" "+B[z];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:r,13:n,14:i,15:a,16:s,17:l,18:u,19:18,20:h,21:f,22:d,23:p,24:m,25:g,26:y,27:v,28:x,29:b,30:w,31:S,33:T,35:E,36:_,37:24,38:A,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:r,13:n,14:i,15:a,16:s,17:l,18:u,19:18,20:h,21:f,22:d,23:p,24:m,25:g,26:y,27:v,28:x,29:b,30:w,31:S,33:T,35:E,36:_,37:24,38:A,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:o(function(C,O){if(O.recoverable)this.trace(C);else{var D=new Error(C);throw D.hash=O,D}},"parseError"),parse:o(function(C){var O=this,D=[0],P=[],F=[null],B=[],$=this.table,z="",Y=0,Q=0,X=0,ie=2,j=1,J=B.slice.call(arguments,1),Z=Object.create(this.lexer),H={yy:{}};for(var q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,q)&&(H.yy[q]=this.yy[q]);Z.setInput(C,H.yy),H.yy.lexer=Z,H.yy.parser=this,typeof Z.yylloc>"u"&&(Z.yylloc={});var K=Z.yylloc;B.push(K);var se=Z.options&&Z.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(ge){D.length=D.length-2*ge,F.length=F.length-ge,B.length=B.length-ge}o(ce,"popStack");function ue(){var ge;return ge=P.pop()||Z.lex()||j,typeof ge!="number"&&(ge instanceof Array&&(P=ge,ge=P.pop()),ge=O.symbols_[ge]||ge),ge}o(ue,"lex");for(var te,De,oe,ke,Ie,Se,Ue={},Pe,_e,me,W;;){if(oe=D[D.length-1],this.defaultActions[oe]?ke=this.defaultActions[oe]:((te===null||typeof te>"u")&&(te=ue()),ke=$[oe]&&$[oe][te]),typeof ke>"u"||!ke.length||!ke[0]){var fe="";W=[];for(Pe in $[oe])this.terminals_[Pe]&&Pe>ie&&W.push("'"+this.terminals_[Pe]+"'");Z.showPosition?fe="Parse error on line "+(Y+1)+`: +`+Z.showPosition()+` +Expecting `+W.join(", ")+", got '"+(this.terminals_[te]||te)+"'":fe="Parse error on line "+(Y+1)+": Unexpected "+(te==j?"end of input":"'"+(this.terminals_[te]||te)+"'"),this.parseError(fe,{text:Z.match,token:this.terminals_[te]||te,line:Z.yylineno,loc:K,expected:W})}if(ke[0]instanceof Array&&ke.length>1)throw new Error("Parse Error: multiple actions possible at state: "+oe+", token: "+te);switch(ke[0]){case 1:D.push(te),F.push(Z.yytext),B.push(Z.yylloc),D.push(ke[1]),te=null,De?(te=De,De=null):(Q=Z.yyleng,z=Z.yytext,Y=Z.yylineno,K=Z.yylloc,X>0&&X--);break;case 2:if(_e=this.productions_[ke[1]][1],Ue.$=F[F.length-_e],Ue._$={first_line:B[B.length-(_e||1)].first_line,last_line:B[B.length-1].last_line,first_column:B[B.length-(_e||1)].first_column,last_column:B[B.length-1].last_column},se&&(Ue._$.range=[B[B.length-(_e||1)].range[0],B[B.length-1].range[1]]),Se=this.performAction.apply(Ue,[z,Q,Y,H.yy,ke[1],F,B].concat(J)),typeof Se<"u")return Se;_e&&(D=D.slice(0,-1*_e*2),F=F.slice(0,-1*_e),B=B.slice(0,-1*_e)),D.push(this.productions_[ke[1]][0]),F.push(Ue.$),B.push(Ue._$),me=$[D[D.length-2]][D[D.length-1]],D.push(me);break;case 3:return!0}}return!0},"parse")},N=function(){var I={EOF:1,parseError:o(function(O,D){if(this.yy.parser)this.yy.parser.parseError(O,D);else throw new Error(O)},"parseError"),setInput:o(function(C,O){return this.yy=O||this.yy||{},this._input=C,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var C=this._input[0];this.yytext+=C,this.yyleng++,this.offset++,this.match+=C,this.matched+=C;var O=C.match(/(?:\r\n?|\n).*/g);return O?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),C},"input"),unput:o(function(C){var O=C.length,D=C.split(/(?:\r\n?|\n)/g);this._input=C+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-O),this.offset-=O;var P=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),D.length-1&&(this.yylineno-=D.length-1);var F=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:D?(D.length===P.length?this.yylloc.first_column:0)+P[P.length-D.length].length-D[0].length:this.yylloc.first_column-O},this.options.ranges&&(this.yylloc.range=[F[0],F[0]+this.yyleng-O]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(C){this.unput(this.match.slice(C))},"less"),pastInput:o(function(){var C=this.matched.substr(0,this.matched.length-this.match.length);return(C.length>20?"...":"")+C.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var C=this.match;return C.length<20&&(C+=this._input.substr(0,20-C.length)),(C.substr(0,20)+(C.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var C=this.pastInput(),O=new Array(C.length+1).join("-");return C+this.upcomingInput()+` +`+O+"^"},"showPosition"),test_match:o(function(C,O){var D,P,F;if(this.options.backtrack_lexer&&(F={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},this.options.ranges&&(F.yylloc.range=this.yylloc.range.slice(0))),P=C[0].match(/(?:\r\n?|\n).*/g),P&&(this.yylineno+=P.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:P?P[P.length-1].length-P[P.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+C[0].length},this.yytext+=C[0],this.match+=C[0],this.matches=C,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(C[0].length),this.matched+=C[0],D=this.performAction.call(this,this.yy,this,O,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),D)return D;if(this._backtrack){for(var B in F)this[B]=F[B];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var C,O,D,P;this._more||(this.yytext="",this.match="");for(var F=this._currentRules(),B=0;BO[0].length)){if(O=D,P=B,this.options.backtrack_lexer){if(C=this.test_match(D,F[B]),C!==!1)return C;if(this._backtrack){O=!1;continue}else return!1}else if(!this.options.flex)break}return O?(C=this.test_match(O,F[P]),C!==!1?C:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var O=this.next();return O||this.lex()},"lex"),begin:o(function(O){this.conditionStack.push(O)},"begin"),popState:o(function(){var O=this.conditionStack.length-1;return O>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(O){return O=this.conditionStack.length-1-Math.abs(O||0),O>=0?this.conditionStack[O]:"INITIAL"},"topState"),pushState:o(function(O){this.begin(O)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(O,D,P,F){var B=F;switch(P){case 0:return this.begin("open_directive"),"open_directive";break;case 1:return this.begin("acc_title"),31;break;case 2:return this.popState(),"acc_title_value";break;case 3:return this.begin("acc_descr"),33;break;case 4:return this.popState(),"acc_descr_value";break;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 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;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 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"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:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},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:!0}}};return I}();M.lexer=N;function k(){this.yy={}}return o(k,"Parser"),k.prototype=M,M.Parser=k,new k}();CI.parser=CI;Ule=CI});var Yle=gi((SI,AI)=>{"use strict";(function(t,e){typeof SI=="object"&&typeof AI<"u"?AI.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_isoWeek=e()})(SI,function(){"use strict";var t="day";return function(e,r,n){var i=o(function(l){return l.add(4-l.isoWeekday(),t)},"a"),a=r.prototype;a.isoWeekYear=function(){return i(this).year()},a.isoWeek=function(l){if(!this.$utils().u(l))return this.add(7*(l-this.isoWeek()),t);var u,h,f,d,p=i(this),m=(u=this.isoWeekYear(),h=this.$u,f=(h?n.utc:n)().year(u).startOf("year"),d=4-f.isoWeekday(),f.isoWeekday()>4&&(d+=7),f.add(d,t));return p.diff(m,"week")+1},a.isoWeekday=function(l){return this.$utils().u(l)?this.day()||7:this.day(this.day()%7?l:l-7)};var s=a.startOf;a.startOf=function(l,u){var h=this.$utils(),f=!!h.u(u)||u;return h.p(l)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):s.bind(this)(l,u)}}})});var Wle=gi((_I,LI)=>{"use strict";(function(t,e){typeof _I=="object"&&typeof LI<"u"?LI.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(_I,function(){"use strict";var t={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"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,s={},l=o(function(g){return(g=+g)+(g>68?1900:2e3)},"a"),u=o(function(g){return function(y){this[g]=+y}},"f"),h=[/[+-]\d\d:?(\d\d)?|Z/,function(g){(this.zone||(this.zone={})).offset=function(y){if(!y||y==="Z")return 0;var v=y.match(/([+-]|\d\d)/g),x=60*v[1]+(+v[2]||0);return x===0?0:v[0]==="+"?-x:x}(g)}],f=o(function(g){var y=s[g];return y&&(y.indexOf?y:y.s.concat(y.f))},"u"),d=o(function(g,y){var v,x=s.meridiem;if(x){for(var b=1;b<=24;b+=1)if(g.indexOf(x(b,0,y))>-1){v=b>12;break}}else v=g===(y?"pm":"PM");return v},"d"),p={A:[a,function(g){this.afternoon=d(g,!1)}],a:[a,function(g){this.afternoon=d(g,!0)}],Q:[r,function(g){this.month=3*(g-1)+1}],S:[r,function(g){this.milliseconds=100*+g}],SS:[n,function(g){this.milliseconds=10*+g}],SSS:[/\d{3}/,function(g){this.milliseconds=+g}],s:[i,u("seconds")],ss:[i,u("seconds")],m:[i,u("minutes")],mm:[i,u("minutes")],H:[i,u("hours")],h:[i,u("hours")],HH:[i,u("hours")],hh:[i,u("hours")],D:[i,u("day")],DD:[n,u("day")],Do:[a,function(g){var y=s.ordinal,v=g.match(/\d+/);if(this.day=v[0],y)for(var x=1;x<=31;x+=1)y(x).replace(/\[|\]/g,"")===g&&(this.day=x)}],w:[i,u("week")],ww:[n,u("week")],M:[i,u("month")],MM:[n,u("month")],MMM:[a,function(g){var y=f("months"),v=(f("monthsShort")||y.map(function(x){return x.slice(0,3)})).indexOf(g)+1;if(v<1)throw new Error;this.month=v%12||v}],MMMM:[a,function(g){var y=f("months").indexOf(g)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,u("year")],YY:[n,function(g){this.year=l(g)}],YYYY:[/\d{4}/,u("year")],Z:h,ZZ:h};function m(g){var y,v;y=g,v=s&&s.formats;for(var x=(g=y.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(A,L,M){var N=M&&M.toUpperCase();return L||v[M]||t[M]||v[N].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(k,I,C){return I||C.slice(1)})})).match(e),b=x.length,w=0;w-1)return new Date((D==="X"?1e3:1)*O);var B=m(D)(O),$=B.year,z=B.month,Y=B.day,Q=B.hours,X=B.minutes,ie=B.seconds,j=B.milliseconds,J=B.zone,Z=B.week,H=new Date,q=Y||($||z?1:H.getDate()),K=$||H.getFullYear(),se=0;$&&!z||(se=z>0?z-1:H.getMonth());var ce,ue=Q||0,te=X||0,De=ie||0,oe=j||0;return J?new Date(Date.UTC(K,se,q,ue,te,De,oe+60*J.offset*1e3)):P?new Date(Date.UTC(K,se,q,ue,te,De,oe)):(ce=new Date(K,se,q,ue,te,De,oe),Z&&(ce=F(ce).week(Z).toDate()),ce)}catch{return new Date("")}}(S,_,T,v),this.init(),N&&N!==!0&&(this.$L=this.locale(N).$L),M&&S!=this.format(_)&&(this.$d=new Date("")),s={}}else if(_ instanceof Array)for(var k=_.length,I=1;I<=k;I+=1){E[1]=_[I-1];var C=v.apply(this,E);if(C.isValid()){this.$d=C.$d,this.$L=C.$L,this.init();break}I===k&&(this.$d=new Date(""))}else b.call(this,w)}}})});var qle=gi((DI,RI)=>{"use strict";(function(t,e){typeof DI=="object"&&typeof RI<"u"?RI.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_advancedFormat=e()})(DI,function(){"use strict";return function(t,e){var r=e.prototype,n=r.format;r.format=function(i){var a=this,s=this.$locale();if(!this.isValid())return n.bind(this)(i);var l=this.$utils(),u=(i||"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(h){switch(h){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return s.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return s.ordinal(a.week(),"W");case"w":case"ww":return l.s(a.week(),h==="w"?1:2,"0");case"W":case"WW":return l.s(a.isoWeek(),h==="W"?1:2,"0");case"k":case"kk":return l.s(String(a.$H===0?24:a.$H),h==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return h}});return n.bind(this)(u)}}})});function cce(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){let a="^\\s*"+i+"\\s*$",s=new RegExp(a);t[0].match(s)&&(e[i]=!0,t.shift(1),n=!0)})}var Kle,yo,Qle,Zle,Jle,Xle,Pc,OI,PI,BI,cx,ux,FI,zI,aE,Rg,GI,ece,$I,hx,VI,UI,sE,NI,OBe,PBe,BBe,FBe,zBe,GBe,$Be,VBe,UBe,HBe,YBe,WBe,qBe,XBe,jBe,KBe,QBe,ZBe,JBe,eFe,tFe,rFe,nFe,tce,iFe,aFe,sFe,rce,oFe,MI,nce,ice,nE,Dg,lFe,cFe,II,iE,zi,ace,uFe,C0,hFe,jle,fFe,sce,dFe,oce,pFe,mFe,lce,uce=R(()=>{"use strict";Kle=Xi(Up(),1),yo=Xi(Nb(),1),Qle=Xi(Yle(),1),Zle=Xi(Wle(),1),Jle=Xi(qle(),1);ut();_t();xr();bi();yo.default.extend(Qle.default);yo.default.extend(Zle.default);yo.default.extend(Jle.default);Xle={friday:5,saturday:6},Pc="",OI="",BI="",cx=[],ux=[],FI=new Map,zI=[],aE=[],Rg="",GI="",ece=["active","done","crit","milestone"],$I=[],hx=!1,VI=!1,UI="sunday",sE="saturday",NI=0,OBe=o(function(){zI=[],aE=[],Rg="",$I=[],nE=0,II=void 0,iE=void 0,zi=[],Pc="",OI="",GI="",PI=void 0,BI="",cx=[],ux=[],hx=!1,VI=!1,NI=0,FI=new Map,vr(),UI="sunday",sE="saturday"},"clear"),PBe=o(function(t){OI=t},"setAxisFormat"),BBe=o(function(){return OI},"getAxisFormat"),FBe=o(function(t){PI=t},"setTickInterval"),zBe=o(function(){return PI},"getTickInterval"),GBe=o(function(t){BI=t},"setTodayMarker"),$Be=o(function(){return BI},"getTodayMarker"),VBe=o(function(t){Pc=t},"setDateFormat"),UBe=o(function(){hx=!0},"enableInclusiveEndDates"),HBe=o(function(){return hx},"endDatesAreInclusive"),YBe=o(function(){VI=!0},"enableTopAxis"),WBe=o(function(){return VI},"topAxisEnabled"),qBe=o(function(t){GI=t},"setDisplayMode"),XBe=o(function(){return GI},"getDisplayMode"),jBe=o(function(){return Pc},"getDateFormat"),KBe=o(function(t){cx=t.toLowerCase().split(/[\s,]+/)},"setIncludes"),QBe=o(function(){return cx},"getIncludes"),ZBe=o(function(t){ux=t.toLowerCase().split(/[\s,]+/)},"setExcludes"),JBe=o(function(){return ux},"getExcludes"),eFe=o(function(){return FI},"getLinks"),tFe=o(function(t){Rg=t,zI.push(t)},"addSection"),rFe=o(function(){return zI},"getSections"),nFe=o(function(){let t=jle(),e=10,r=0;for(;!t&&r[\d\w- ]+)/.exec(r);if(i!==null){let s=null;for(let u of i.groups.ids.split(" ")){let h=C0(u);h!==void 0&&(!s||h.endTime>s.endTime)&&(s=h)}if(s)return s.endTime;let l=new Date;return l.setHours(0,0,0,0),l}let a=(0,yo.default)(r,e.trim(),!0);if(a.isValid())return a.toDate();{V.debug("Invalid date:"+r),V.debug("With date format:"+e.trim());let s=new Date(r);if(s===void 0||isNaN(s.getTime())||s.getFullYear()<-1e4||s.getFullYear()>1e4)throw new Error("Invalid date:"+r);return s}},"getStartDate"),nce=o(function(t){let e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),ice=o(function(t,e,r,n=!1){r=r.trim();let a=/^until\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let f=null;for(let p of a.groups.ids.split(" ")){let m=C0(p);m!==void 0&&(!f||m.startTime{window.open(r,"_self")}),FI.set(n,r))}),sce(t,"clickable")},"setLink"),sce=o(function(t,e){t.split(",").forEach(function(r){let n=C0(r);n!==void 0&&n.classes.push(e)})},"setClass"),dFe=o(function(t,e,r){if(de().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{Lt.runFunc(e,...n)})},"setClickFun"),oce=o(function(t,e){$I.push(function(){let r=document.querySelector(`[id="${t}"]`);r!==null&&r.addEventListener("click",function(){e()})},function(){let r=document.querySelector(`[id="${t}-text"]`);r!==null&&r.addEventListener("click",function(){e()})})},"pushFun"),pFe=o(function(t,e,r){t.split(",").forEach(function(n){dFe(n,e,r)}),sce(t,"clickable")},"setClickEvent"),mFe=o(function(t){$I.forEach(function(e){e(t)})},"bindFunctions"),lce={getConfig:o(()=>de().gantt,"getConfig"),clear:OBe,setDateFormat:VBe,getDateFormat:jBe,enableInclusiveEndDates:UBe,endDatesAreInclusive:HBe,enableTopAxis:YBe,topAxisEnabled:WBe,setAxisFormat:PBe,getAxisFormat:BBe,setTickInterval:FBe,getTickInterval:zBe,setTodayMarker:GBe,getTodayMarker:$Be,setAccTitle:kr,getAccTitle:Ar,setDiagramTitle:nn,getDiagramTitle:Xr,setDisplayMode:qBe,getDisplayMode:XBe,setAccDescription:_r,getAccDescription:Lr,addSection:tFe,getSections:rFe,getTasks:nFe,addTask:uFe,findTaskById:C0,addTaskOrg:hFe,setIncludes:KBe,getIncludes:QBe,setExcludes:ZBe,getExcludes:JBe,setClickEvent:pFe,setLink:fFe,getLinks:eFe,bindFunctions:mFe,parseDuration:nce,isInvalidDate:tce,setWeekday:iFe,getWeekday:aFe,setWeekend:sFe};o(cce,"getTaskTags")});var oE,gFe,hce,yFe,Yu,vFe,fce,dce=R(()=>{"use strict";oE=Xi(Nb(),1);ut();Zt();rr();_t();Yn();gFe=o(function(){V.debug("Something is calling, setConf, remove the call")},"setConf"),hce={monday:_h,tuesday:k3,wednesday:E3,thursday:cc,friday:C3,saturday:S3,sunday:yl},yFe=o((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((a,s)=>a.startTime-s.startTime||a.order-s.order),i=0;for(let a of n)for(let s=0;s=r[s]){r[s]=a.endTime,a.order=s+e,s>i&&(i=s);break}return i},"getMaxIntersections"),vFe=o(function(t,e,r,n){let i=de().gantt,a=de().securityLevel,s;a==="sandbox"&&(s=$e("#i"+e));let l=a==="sandbox"?$e(s.nodes()[0].contentDocument.body):$e("body"),u=a==="sandbox"?s.nodes()[0].contentDocument:document,h=u.getElementById(e);Yu=h.parentElement.offsetWidth,Yu===void 0&&(Yu=1200),i.useWidth!==void 0&&(Yu=i.useWidth);let f=n.db.getTasks(),d=[];for(let A of f)d.push(A.type);d=_(d);let p={},m=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){let A={};for(let M of f)A[M.section]===void 0?A[M.section]=[M]:A[M.section].push(M);let L=0;for(let M of Object.keys(A)){let N=yFe(A[M],L)+1;L+=N,m+=N*(i.barHeight+i.barGap),p[M]=N}}else{m+=f.length*(i.barHeight+i.barGap);for(let A of d)p[A]=f.filter(L=>L.type===A).length}h.setAttribute("viewBox","0 0 "+Yu+" "+m);let g=l.select(`[id="${e}"]`),y=L3().domain([I4(f,function(A){return A.startTime}),M4(f,function(A){return A.endTime})]).rangeRound([0,Yu-i.leftPadding-i.rightPadding]);function v(A,L){let M=A.startTime,N=L.startTime,k=0;return M>N?k=1:M$.order))].map($=>A.find(z=>z.order===$));g.append("g").selectAll("rect").data(D).enter().append("rect").attr("x",0).attr("y",function($,z){return z=$.order,z*L+M-2}).attr("width",function(){return C-i.rightPadding/2}).attr("height",L).attr("class",function($){for(let[z,Y]of d.entries())if($.type===Y)return"section section"+z%i.numberSectionStyles;return"section section0"});let P=g.append("g").selectAll("rect").data(A).enter(),F=n.db.getLinks();if(P.append("rect").attr("id",function($){return $.id}).attr("rx",3).attr("ry",3).attr("x",function($){return $.milestone?y($.startTime)+N+.5*(y($.endTime)-y($.startTime))-.5*k:y($.startTime)+N}).attr("y",function($,z){return z=$.order,z*L+M}).attr("width",function($){return $.milestone?k:y($.renderEndTime||$.endTime)-y($.startTime)}).attr("height",k).attr("transform-origin",function($,z){return z=$.order,(y($.startTime)+N+.5*(y($.endTime)-y($.startTime))).toString()+"px "+(z*L+M+.5*k).toString()+"px"}).attr("class",function($){let z="task",Y="";$.classes.length>0&&(Y=$.classes.join(" "));let Q=0;for(let[ie,j]of d.entries())$.type===j&&(Q=ie%i.numberSectionStyles);let X="";return $.active?$.crit?X+=" activeCrit":X=" active":$.done?$.crit?X=" doneCrit":X=" done":$.crit&&(X+=" crit"),X.length===0&&(X=" task"),$.milestone&&(X=" milestone "+X),X+=Q,X+=" "+Y,z+X}),P.append("text").attr("id",function($){return $.id+"-text"}).text(function($){return $.task}).attr("font-size",i.fontSize).attr("x",function($){let z=y($.startTime),Y=y($.renderEndTime||$.endTime);$.milestone&&(z+=.5*(y($.endTime)-y($.startTime))-.5*k),$.milestone&&(Y=z+k);let Q=this.getBBox().width;return Q>Y-z?Y+Q+1.5*i.leftPadding>C?z+N-5:Y+N+5:(Y-z)/2+z+N}).attr("y",function($,z){return z=$.order,z*L+i.barHeight/2+(i.fontSize/2-2)+M}).attr("text-height",k).attr("class",function($){let z=y($.startTime),Y=y($.endTime);$.milestone&&(Y=z+k);let Q=this.getBBox().width,X="";$.classes.length>0&&(X=$.classes.join(" "));let ie=0;for(let[J,Z]of d.entries())$.type===Z&&(ie=J%i.numberSectionStyles);let j="";return $.active&&($.crit?j="activeCritText"+ie:j="activeText"+ie),$.done?$.crit?j=j+" doneCritText"+ie:j=j+" doneText"+ie:$.crit&&(j=j+" critText"+ie),$.milestone&&(j+=" milestoneText"),Q>Y-z?Y+Q+1.5*i.leftPadding>C?X+" taskTextOutsideLeft taskTextOutside"+ie+" "+j:X+" taskTextOutsideRight taskTextOutside"+ie+" "+j+" width-"+Q:X+" taskText taskText"+ie+" "+j+" width-"+Q}),de().securityLevel==="sandbox"){let $;$=$e("#i"+e);let z=$.nodes()[0].contentDocument;P.filter(function(Y){return F.has(Y.id)}).each(function(Y){var Q=z.querySelector("#"+Y.id),X=z.querySelector("#"+Y.id+"-text");let ie=Q.parentNode;var j=z.createElement("a");j.setAttribute("xlink:href",F.get(Y.id)),j.setAttribute("target","_top"),ie.appendChild(j),j.appendChild(Q),j.appendChild(X)})}}o(b,"drawRects");function w(A,L,M,N,k,I,C,O){if(C.length===0&&O.length===0)return;let D,P;for(let{startTime:Q,endTime:X}of I)(D===void 0||QP)&&(P=X);if(!D||!P)return;if((0,oE.default)(P).diff((0,oE.default)(D),"year")>5){V.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}let F=n.db.getDateFormat(),B=[],$=null,z=(0,oE.default)(D);for(;z.valueOf()<=P;)n.db.isInvalidDate(z,F,C,O)?$?$.end=z:$={start:z,end:z}:$&&(B.push($),$=null),z=z.add(1,"d");g.append("g").selectAll("rect").data(B).enter().append("rect").attr("id",function(Q){return"exclude-"+Q.start.format("YYYY-MM-DD")}).attr("x",function(Q){return y(Q.start)+M}).attr("y",i.gridLineStartPadding).attr("width",function(Q){let X=Q.end.add(1,"day");return y(X)-y(Q.start)}).attr("height",k-L-i.gridLineStartPadding).attr("transform-origin",function(Q,X){return(y(Q.start)+M+.5*(y(Q.end)-y(Q.start))).toString()+"px "+(X*A+.5*k).toString()+"px"}).attr("class","exclude-range")}o(w,"drawExcludeDays");function S(A,L,M,N){let k=vS(y).tickSize(-N+L+i.gridLineStartPadding).tickFormat(md(n.db.getAxisFormat()||i.axisFormat||"%Y-%m-%d")),C=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(C!==null){let O=C[1],D=C[2],P=n.db.getWeekday()||i.weekday;switch(D){case"millisecond":k.ticks(oc.every(O));break;case"second":k.ticks(Ks.every(O));break;case"minute":k.ticks(gu.every(O));break;case"hour":k.ticks(yu.every(O));break;case"day":k.ticks(Do.every(O));break;case"week":k.ticks(hce[P].every(O));break;case"month":k.ticks(vu.every(O));break}}if(g.append("g").attr("class","grid").attr("transform","translate("+A+", "+(N-50)+")").call(k).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let O=yS(y).tickSize(-N+L+i.gridLineStartPadding).tickFormat(md(n.db.getAxisFormat()||i.axisFormat||"%Y-%m-%d"));if(C!==null){let D=C[1],P=C[2],F=n.db.getWeekday()||i.weekday;switch(P){case"millisecond":O.ticks(oc.every(D));break;case"second":O.ticks(Ks.every(D));break;case"minute":O.ticks(gu.every(D));break;case"hour":O.ticks(yu.every(D));break;case"day":O.ticks(Do.every(D));break;case"week":O.ticks(hce[F].every(D));break;case"month":O.ticks(vu.every(D));break}}g.append("g").attr("class","grid").attr("transform","translate("+A+", "+L+")").call(O).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}o(S,"makeGrid");function T(A,L){let M=0,N=Object.keys(p).map(k=>[k,p[k]]);g.append("g").selectAll("text").data(N).enter().append(function(k){let I=k[0].split(We.lineBreakRegex),C=-(I.length-1)/2,O=u.createElementNS("http://www.w3.org/2000/svg","text");O.setAttribute("dy",C+"em");for(let[D,P]of I.entries()){let F=u.createElementNS("http://www.w3.org/2000/svg","tspan");F.setAttribute("alignment-baseline","central"),F.setAttribute("x","10"),D>0&&F.setAttribute("dy","1em"),F.textContent=P,O.appendChild(F)}return O}).attr("x",10).attr("y",function(k,I){if(I>0)for(let C=0;C{"use strict";xFe=o(t=>` .mermaid-main-font { - font-family: "trebuchet ms", verdana, arial, sans-serif; - font-family: var(--mermaid-font-family); + font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif); } + .exclude-range { - fill: ${i.excludeBkgColor}; + fill: ${t.excludeBkgColor}; } .section { @@ -349,55 +791,52 @@ Expecting `+Bn.join(", ")+", got '"+(this.terminals_[kt]||kt)+"'":Oe="Parse erro } .section0 { - fill: ${i.sectionBkgColor}; + fill: ${t.sectionBkgColor}; } .section2 { - fill: ${i.sectionBkgColor2}; + fill: ${t.sectionBkgColor2}; } .section1, .section3 { - fill: ${i.altSectionBkgColor}; + fill: ${t.altSectionBkgColor}; opacity: 0.2; } .sectionTitle0 { - fill: ${i.titleColor}; + fill: ${t.titleColor}; } .sectionTitle1 { - fill: ${i.titleColor}; + fill: ${t.titleColor}; } .sectionTitle2 { - fill: ${i.titleColor}; + fill: ${t.titleColor}; } .sectionTitle3 { - fill: ${i.titleColor}; + fill: ${t.titleColor}; } .sectionTitle { text-anchor: start; - // font-size: ${i.ganttFontSize}; - // text-height: 14px; - font-family: 'trebuchet ms', verdana, arial, sans-serif; - font-family: var(--mermaid-font-family); - + font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif); } /* Grid and axis */ .grid .tick { - stroke: ${i.gridColor}; + stroke: ${t.gridColor}; opacity: 0.8; shape-rendering: crispEdges; - text { - font-family: ${i.fontFamily}; - fill: ${i.textColor}; - } + } + + .grid .tick text { + font-family: ${t.fontFamily}; + fill: ${t.textColor}; } .grid path { @@ -409,7 +848,7 @@ Expecting `+Bn.join(", ")+", got '"+(this.terminals_[kt]||kt)+"'":Oe="Parse erro .today { fill: none; - stroke: ${i.todayLineColor}; + stroke: ${t.todayLineColor}; stroke-width: 2px; } @@ -424,77 +863,72 @@ Expecting `+Bn.join(", ")+", got '"+(this.terminals_[kt]||kt)+"'":Oe="Parse erro .taskText { text-anchor: middle; - font-family: 'trebuchet ms', verdana, arial, sans-serif; - font-family: var(--mermaid-font-family); + font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif); } - // .taskText:not([font-size]) { - // font-size: ${i.ganttFontSize}; - // } - .taskTextOutsideRight { - fill: ${i.taskTextDarkColor}; + fill: ${t.taskTextDarkColor}; text-anchor: start; - // font-size: ${i.ganttFontSize}; - font-family: 'trebuchet ms', verdana, arial, sans-serif; - font-family: var(--mermaid-font-family); - + font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif); } .taskTextOutsideLeft { - fill: ${i.taskTextDarkColor}; + fill: ${t.taskTextDarkColor}; text-anchor: end; - // font-size: ${i.ganttFontSize}; } + /* Special case clickable */ + .task.clickable { cursor: pointer; } + .taskText.clickable { cursor: pointer; - fill: ${i.taskTextClickableColor} !important; + fill: ${t.taskTextClickableColor} !important; font-weight: bold; } .taskTextOutsideLeft.clickable { cursor: pointer; - fill: ${i.taskTextClickableColor} !important; + fill: ${t.taskTextClickableColor} !important; font-weight: bold; } .taskTextOutsideRight.clickable { cursor: pointer; - fill: ${i.taskTextClickableColor} !important; + fill: ${t.taskTextClickableColor} !important; font-weight: bold; } + /* Specific task settings for the sections*/ .taskText0, .taskText1, .taskText2, .taskText3 { - fill: ${i.taskTextColor}; + fill: ${t.taskTextColor}; } .task0, .task1, .task2, .task3 { - fill: ${i.taskBkgColor}; - stroke: ${i.taskBorderColor}; + fill: ${t.taskBkgColor}; + stroke: ${t.taskBorderColor}; } .taskTextOutside0, .taskTextOutside2 { - fill: ${i.taskTextOutsideColor}; + fill: ${t.taskTextOutsideColor}; } .taskTextOutside1, .taskTextOutside3 { - fill: ${i.taskTextOutsideColor}; + fill: ${t.taskTextOutsideColor}; } @@ -504,15 +938,15 @@ Expecting `+Bn.join(", ")+", got '"+(this.terminals_[kt]||kt)+"'":Oe="Parse erro .active1, .active2, .active3 { - fill: ${i.activeTaskBkgColor}; - stroke: ${i.activeTaskBorderColor}; + fill: ${t.activeTaskBkgColor}; + stroke: ${t.activeTaskBorderColor}; } .activeText0, .activeText1, .activeText2, .activeText3 { - fill: ${i.taskTextDarkColor} !important; + fill: ${t.taskTextDarkColor} !important; } @@ -522,8 +956,8 @@ Expecting `+Bn.join(", ")+", got '"+(this.terminals_[kt]||kt)+"'":Oe="Parse erro .done1, .done2, .done3 { - stroke: ${i.doneTaskBorderColor}; - fill: ${i.doneTaskBkgColor}; + stroke: ${t.doneTaskBorderColor}; + fill: ${t.doneTaskBkgColor}; stroke-width: 2; } @@ -531,7 +965,7 @@ Expecting `+Bn.join(", ")+", got '"+(this.terminals_[kt]||kt)+"'":Oe="Parse erro .doneText1, .doneText2, .doneText3 { - fill: ${i.taskTextDarkColor} !important; + fill: ${t.taskTextDarkColor} !important; } @@ -541,8 +975,8 @@ Expecting `+Bn.join(", ")+", got '"+(this.terminals_[kt]||kt)+"'":Oe="Parse erro .crit1, .crit2, .crit3 { - stroke: ${i.critBorderColor}; - fill: ${i.critBkgColor}; + stroke: ${t.critBorderColor}; + fill: ${t.critBkgColor}; stroke-width: 2; } @@ -550,8 +984,8 @@ Expecting `+Bn.join(", ")+", got '"+(this.terminals_[kt]||kt)+"'":Oe="Parse erro .activeCrit1, .activeCrit2, .activeCrit3 { - stroke: ${i.critBorderColor}; - fill: ${i.activeTaskBkgColor}; + stroke: ${t.critBorderColor}; + fill: ${t.activeTaskBkgColor}; stroke-width: 2; } @@ -559,8 +993,8 @@ Expecting `+Bn.join(", ")+", got '"+(this.terminals_[kt]||kt)+"'":Oe="Parse erro .doneCrit1, .doneCrit2, .doneCrit3 { - stroke: ${i.critBorderColor}; - fill: ${i.doneTaskBkgColor}; + stroke: ${t.critBorderColor}; + fill: ${t.doneTaskBkgColor}; stroke-width: 2; cursor: pointer; shape-rendering: crispEdges; @@ -577,214 +1011,215 @@ Expecting `+Bn.join(", ")+", got '"+(this.terminals_[kt]||kt)+"'":Oe="Parse erro .doneCritText1, .doneCritText2, .doneCritText3 { - fill: ${i.taskTextDarkColor} !important; + fill: ${t.taskTextDarkColor} !important; } .activeCritText0, .activeCritText1, .activeCritText2, .activeCritText3 { - fill: ${i.taskTextDarkColor} !important; + fill: ${t.taskTextDarkColor} !important; } .titleText { text-anchor: middle; font-size: 18px; - fill: ${i.textColor} ; - font-family: 'trebuchet ms', verdana, arial, sans-serif; - font-family: var(--mermaid-font-family); + fill: ${t.titleColor||t.textColor}; + font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif); } -`}},Symbol.toStringTag,{value:"Module"}));var W0e=function(){var i=function(y,b,E,S){for(E=E||{},S=y.length;S--;E[y[S]]=b);return E},a=[6,9,10],f={trace:function(){},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(b,E,S,N,B,R,j){switch(R.length-1,B){case 1:return N;case 4:break;case 6:N.setInfo(!0);break}},table:[{3:1,4:[1,2]},{1:[3]},i(a,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8]},{1:[2,1]},i(a,[2,3]),i(a,[2,4]),i(a,[2,5]),i(a,[2,6])],defaultActions:{4:[2,1]},parseError:function(b,E){if(E.recoverable)this.trace(b);else{var S=new Error(b);throw S.hash=E,S}},parse:function(b){var E=this,S=[0],N=[],B=[null],R=[],j=this.table,$="",V=0,Q=0,oe=2,ce=1,se=R.slice.call(arguments,1),ge=Object.create(this.lexer),ye={yy:{}};for(var ke in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ke)&&(ye.yy[ke]=this.yy[ke]);ge.setInput(b,ye.yy),ye.yy.lexer=ge,ye.yy.parser=this,typeof ge.yylloc>"u"&&(ge.yylloc={});var Ae=ge.yylloc;R.push(Ae);var de=ge.options&&ge.options.ranges;typeof ye.yy.parseError=="function"?this.parseError=ye.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ve(){var Et;return Et=N.pop()||ge.lex()||ce,typeof Et!="number"&&(Et instanceof Array&&(N=Et,Et=N.pop()),Et=E.symbols_[Et]||Et),Et}for(var te,xe,De,he,Ie={},ee,rt,me,gt;;){if(xe=S[S.length-1],this.defaultActions[xe]?De=this.defaultActions[xe]:((te===null||typeof te>"u")&&(te=ve()),De=j[xe]&&j[xe][te]),typeof De>"u"||!De.length||!De[0]){var pe="";gt=[];for(ee in j[xe])this.terminals_[ee]&&ee>oe&>.push("'"+this.terminals_[ee]+"'");ge.showPosition?pe="Parse error on line "+(V+1)+`: -`+ge.showPosition()+` -Expecting `+gt.join(", ")+", got '"+(this.terminals_[te]||te)+"'":pe="Parse error on line "+(V+1)+": Unexpected "+(te==ce?"end of input":"'"+(this.terminals_[te]||te)+"'"),this.parseError(pe,{text:ge.match,token:this.terminals_[te]||te,line:ge.yylineno,loc:Ae,expected:gt})}if(De[0]instanceof Array&&De.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xe+", token: "+te);switch(De[0]){case 1:S.push(te),B.push(ge.yytext),R.push(ge.yylloc),S.push(De[1]),te=null,Q=ge.yyleng,$=ge.yytext,V=ge.yylineno,Ae=ge.yylloc;break;case 2:if(rt=this.productions_[De[1]][1],Ie.$=B[B.length-rt],Ie._$={first_line:R[R.length-(rt||1)].first_line,last_line:R[R.length-1].last_line,first_column:R[R.length-(rt||1)].first_column,last_column:R[R.length-1].last_column},de&&(Ie._$.range=[R[R.length-(rt||1)].range[0],R[R.length-1].range[1]]),he=this.performAction.apply(Ie,[$,Q,V,ye.yy,De[1],B,R].concat(se)),typeof he<"u")return he;rt&&(S=S.slice(0,-1*rt*2),B=B.slice(0,-1*rt),R=R.slice(0,-1*rt)),S.push(this.productions_[De[1]][0]),B.push(Ie.$),R.push(Ie._$),me=j[S[S.length-2]][S[S.length-1]],S.push(me);break;case 3:return!0}}return!0}},p=function(){var y={EOF:1,parseError:function(E,S){if(this.yy.parser)this.yy.parser.parseError(E,S);else throw new Error(E)},setInput:function(b,E){return this.yy=E||this.yy||{},this._input=b,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var E=b.match(/(?:\r\n?|\n).*/g);return E?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),b},unput:function(b){var E=b.length,S=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-E),this.offset-=E;var N=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),S.length-1&&(this.yylineno-=S.length-1);var B=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:S?(S.length===N.length?this.yylloc.first_column:0)+N[N.length-S.length].length-S[0].length:this.yylloc.first_column-E},this.options.ranges&&(this.yylloc.range=[B[0],B[0]+this.yyleng-E]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(b){this.unput(this.match.slice(b))},pastInput:function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var b=this.match;return b.length<20&&(b+=this._input.substr(0,20-b.length)),(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var b=this.pastInput(),E=new Array(b.length+1).join("-");return b+this.upcomingInput()+` -`+E+"^"},test_match:function(b,E){var S,N,B;if(this.options.backtrack_lexer&&(B={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},this.options.ranges&&(B.yylloc.range=this.yylloc.range.slice(0))),N=b[0].match(/(?:\r\n?|\n).*/g),N&&(this.yylineno+=N.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:N?N[N.length-1].length-N[N.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],S=this.performAction.call(this,this.yy,this,E,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),S)return S;if(this._backtrack){for(var R in B)this[R]=B[R];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var b,E,S,N;this._more||(this.yytext="",this.match="");for(var B=this._currentRules(),R=0;RE[0].length)){if(E=S,N=R,this.options.backtrack_lexer){if(b=this.test_match(S,B[R]),b!==!1)return b;if(this._backtrack){E=!1;continue}else return!1}else if(!this.options.flex)break}return E?(b=this.test_match(E,B[N]),b!==!1?b:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var E=this.next();return E||this.lex()},begin:function(E){this.conditionStack.push(E)},popState:function(){var E=this.conditionStack.length-1;return E>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(E){return E=this.conditionStack.length-1-Math.abs(E||0),E>=0?this.conditionStack[E]:"INITIAL"},pushState:function(E){this.begin(E)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(E,S,N,B){switch(N){case 0:return 4;case 1:return 9;case 2:return"space";case 3:return 10;case 4:return 6;case 5:return"TXT"}},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:!0}}};return y}();f.lexer=p;function w(){this.yy={}}return w.prototype=f,f.Parser=w,new w}();W0e.parser=W0e;const E$t=W0e;var ARe="",LRe=!1;const T$t=Object.freeze(Object.defineProperty({__proto__:null,diagram:{parser:E$t,db:{setMessage:i=>{Fe.debug("Setting message to: "+i),ARe=i},getMessage:()=>ARe,setInfo:i=>{LRe=i},getInfo:()=>LRe,clear:rp},renderer:{draw:(i,a,f)=>{try{Fe.debug(`Rendering info diagram -`+i);const p=Tt().securityLevel;let w;p==="sandbox"&&(w=Cr("#i"+a));const b=Cr(p==="sandbox"?w.nodes()[0].contentDocument.body:"body").select("#"+a);b.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size","32px").style("text-anchor","middle").text("v "+f),b.attr("height",100),b.attr("width",400)}catch(p){Fe.error("Error while rendering info diagram"),Fe.error(p.message)}}},styles:()=>""}},Symbol.toStringTag,{value:"Module"}));var K0e=function(){var i=function(Ae,de,ve,te){for(ve=ve||{},te=Ae.length;te--;ve[Ae[te]]=de);return ve},a=[1,4],f=[1,5],p=[1,6],w=[1,7],y=[1,9],b=[1,11,13,15,17,19,20,26,27,28,29],E=[2,5],S=[1,6,11,13,15,17,19,20,26,27,28,29],N=[26,27,28],B=[2,8],R=[1,18],j=[1,19],$=[1,20],V=[1,21],Q=[1,22],oe=[1,23],ce=[1,28],se=[6,26,27,28,29],ge={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,directive:5,PIE:6,document:7,showData:8,line:9,statement: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,openDirective:21,typeDirective:22,closeDirective:23,":":24,argDirective:25,NEWLINE:26,";":27,EOF:28,open_directive:29,type_directive:30,arg_directive:31,close_directive:32,$accept:0,$end:1},terminals_:{2:"error",6:"PIE",8:"showData",11:"txt",12:"value",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",24:":",26:"NEWLINE",27:";",28:"EOF",29:"open_directive",30:"type_directive",31:"arg_directive",32:"close_directive"},productions_:[0,[3,2],[3,2],[3,2],[3,3],[7,0],[7,2],[9,2],[10,0],[10,2],[10,2],[10,2],[10,2],[10,1],[10,1],[10,1],[5,3],[5,5],[4,1],[4,1],[4,1],[21,1],[22,1],[25,1],[23,1]],performAction:function(de,ve,te,xe,De,he,Ie){var ee=he.length-1;switch(De){case 4:xe.setShowData(!0);break;case 7:this.$=he[ee-1];break;case 9:xe.addSection(he[ee-1],xe.cleanupValue(he[ee]));break;case 10:this.$=he[ee].trim(),xe.setDiagramTitle(this.$);break;case 11:this.$=he[ee].trim(),xe.setAccTitle(this.$);break;case 12:case 13:this.$=he[ee].trim(),xe.setAccDescription(this.$);break;case 14:xe.addSection(he[ee].substr(8)),this.$=he[ee].substr(8);break;case 21:xe.parseDirective("%%{","open_directive");break;case 22:xe.parseDirective(he[ee],"type_directive");break;case 23:he[ee]=he[ee].trim().replace(/'/g,'"'),xe.parseDirective(he[ee],"arg_directive");break;case 24:xe.parseDirective("}%%","close_directive","pie");break}},table:[{3:1,4:2,5:3,6:a,21:8,26:f,27:p,28:w,29:y},{1:[3]},{3:10,4:2,5:3,6:a,21:8,26:f,27:p,28:w,29:y},{3:11,4:2,5:3,6:a,21:8,26:f,27:p,28:w,29:y},i(b,E,{7:12,8:[1,13]}),i(S,[2,18]),i(S,[2,19]),i(S,[2,20]),{22:14,30:[1,15]},{30:[2,21]},{1:[2,1]},{1:[2,2]},i(N,B,{21:8,9:16,10:17,5:24,1:[2,3],11:R,13:j,15:$,17:V,19:Q,20:oe,29:y}),i(b,E,{7:25}),{23:26,24:[1,27],32:ce},i([24,32],[2,22]),i(b,[2,6]),{4:29,26:f,27:p,28:w},{12:[1,30]},{14:[1,31]},{16:[1,32]},{18:[1,33]},i(N,[2,13]),i(N,[2,14]),i(N,[2,15]),i(N,B,{21:8,9:16,10:17,5:24,1:[2,4],11:R,13:j,15:$,17:V,19:Q,20:oe,29:y}),i(se,[2,16]),{25:34,31:[1,35]},i(se,[2,24]),i(b,[2,7]),i(N,[2,9]),i(N,[2,10]),i(N,[2,11]),i(N,[2,12]),{23:36,32:ce},{32:[2,23]},i(se,[2,17])],defaultActions:{9:[2,21],10:[2,1],11:[2,2],35:[2,23]},parseError:function(de,ve){if(ve.recoverable)this.trace(de);else{var te=new Error(de);throw te.hash=ve,te}},parse:function(de){var ve=this,te=[0],xe=[],De=[null],he=[],Ie=this.table,ee="",rt=0,me=0,gt=2,pe=1,Et=he.slice.call(arguments,1),wt=Object.create(this.lexer),jt={yy:{}};for(var At in this.yy)Object.prototype.hasOwnProperty.call(this.yy,At)&&(jt.yy[At]=this.yy[At]);wt.setInput(de,jt.yy),jt.yy.lexer=wt,jt.yy.parser=this,typeof wt.yylloc>"u"&&(wt.yylloc={});var Bt=wt.yylloc;he.push(Bt);var cn=wt.options&&wt.options.ranges;typeof jt.yy.parseError=="function"?this.parseError=jt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Nn(){var Bn;return Bn=xe.pop()||wt.lex()||pe,typeof Bn!="number"&&(Bn instanceof Array&&(xe=Bn,Bn=xe.pop()),Bn=ve.symbols_[Bn]||Bn),Bn}for(var Ot,oi,kt,Dt,vt={},Nt,ze,Xe,Lt;;){if(oi=te[te.length-1],this.defaultActions[oi]?kt=this.defaultActions[oi]:((Ot===null||typeof Ot>"u")&&(Ot=Nn()),kt=Ie[oi]&&Ie[oi][Ot]),typeof kt>"u"||!kt.length||!kt[0]){var Ge="";Lt=[];for(Nt in Ie[oi])this.terminals_[Nt]&&Nt>gt&&Lt.push("'"+this.terminals_[Nt]+"'");wt.showPosition?Ge="Parse error on line "+(rt+1)+`: -`+wt.showPosition()+` -Expecting `+Lt.join(", ")+", got '"+(this.terminals_[Ot]||Ot)+"'":Ge="Parse error on line "+(rt+1)+": Unexpected "+(Ot==pe?"end of input":"'"+(this.terminals_[Ot]||Ot)+"'"),this.parseError(Ge,{text:wt.match,token:this.terminals_[Ot]||Ot,line:wt.yylineno,loc:Bt,expected:Lt})}if(kt[0]instanceof Array&&kt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+oi+", token: "+Ot);switch(kt[0]){case 1:te.push(Ot),De.push(wt.yytext),he.push(wt.yylloc),te.push(kt[1]),Ot=null,me=wt.yyleng,ee=wt.yytext,rt=wt.yylineno,Bt=wt.yylloc;break;case 2:if(ze=this.productions_[kt[1]][1],vt.$=De[De.length-ze],vt._$={first_line:he[he.length-(ze||1)].first_line,last_line:he[he.length-1].last_line,first_column:he[he.length-(ze||1)].first_column,last_column:he[he.length-1].last_column},cn&&(vt._$.range=[he[he.length-(ze||1)].range[0],he[he.length-1].range[1]]),Dt=this.performAction.apply(vt,[ee,me,rt,jt.yy,kt[1],De,he].concat(Et)),typeof Dt<"u")return Dt;ze&&(te=te.slice(0,-1*ze*2),De=De.slice(0,-1*ze),he=he.slice(0,-1*ze)),te.push(this.productions_[kt[1]][0]),De.push(vt.$),he.push(vt._$),Xe=Ie[te[te.length-2]][te[te.length-1]],te.push(Xe);break;case 3:return!0}}return!0}},ye=function(){var Ae={EOF:1,parseError:function(ve,te){if(this.yy.parser)this.yy.parser.parseError(ve,te);else throw new Error(ve)},setInput:function(de,ve){return this.yy=ve||this.yy||{},this._input=de,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var de=this._input[0];this.yytext+=de,this.yyleng++,this.offset++,this.match+=de,this.matched+=de;var ve=de.match(/(?:\r\n?|\n).*/g);return ve?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),de},unput:function(de){var ve=de.length,te=de.split(/(?:\r\n?|\n)/g);this._input=de+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ve),this.offset-=ve;var xe=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),te.length-1&&(this.yylineno-=te.length-1);var De=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:te?(te.length===xe.length?this.yylloc.first_column:0)+xe[xe.length-te.length].length-te[0].length:this.yylloc.first_column-ve},this.options.ranges&&(this.yylloc.range=[De[0],De[0]+this.yyleng-ve]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(de){this.unput(this.match.slice(de))},pastInput:function(){var de=this.matched.substr(0,this.matched.length-this.match.length);return(de.length>20?"...":"")+de.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var de=this.match;return de.length<20&&(de+=this._input.substr(0,20-de.length)),(de.substr(0,20)+(de.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var de=this.pastInput(),ve=new Array(de.length+1).join("-");return de+this.upcomingInput()+` -`+ve+"^"},test_match:function(de,ve){var te,xe,De;if(this.options.backtrack_lexer&&(De={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},this.options.ranges&&(De.yylloc.range=this.yylloc.range.slice(0))),xe=de[0].match(/(?:\r\n?|\n).*/g),xe&&(this.yylineno+=xe.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:xe?xe[xe.length-1].length-xe[xe.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+de[0].length},this.yytext+=de[0],this.match+=de[0],this.matches=de,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(de[0].length),this.matched+=de[0],te=this.performAction.call(this,this.yy,this,ve,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),te)return te;if(this._backtrack){for(var he in De)this[he]=De[he];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var de,ve,te,xe;this._more||(this.yytext="",this.match="");for(var De=this._currentRules(),he=0;heve[0].length)){if(ve=te,xe=he,this.options.backtrack_lexer){if(de=this.test_match(te,De[he]),de!==!1)return de;if(this._backtrack){ve=!1;continue}else return!1}else if(!this.options.flex)break}return ve?(de=this.test_match(ve,De[xe]),de!==!1?de:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var ve=this.next();return ve||this.lex()},begin:function(ve){this.conditionStack.push(ve)},popState:function(){var ve=this.conditionStack.length-1;return ve>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(ve){return ve=this.conditionStack.length-1-Math.abs(ve||0),ve>=0?this.conditionStack[ve]:"INITIAL"},pushState:function(ve){this.begin(ve)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(ve,te,xe,De){switch(xe){case 0:return this.begin("open_directive"),29;case 1:return this.begin("type_directive"),30;case 2:return this.popState(),this.begin("arg_directive"),24;case 3:return this.popState(),this.popState(),32;case 4:return 31;case 5:break;case 6:break;case 7:return 26;case 8:break;case 9:break;case 10:return this.begin("title"),13;case 11:return this.popState(),"title_value";case 12:return this.begin("acc_title"),15;case 13:return this.popState(),"acc_title_value";case 14:return this.begin("acc_descr"),17;case 15:return this.popState(),"acc_descr_value";case 16:this.begin("acc_descr_multiline");break;case 17:this.popState();break;case 18:return"acc_descr_multiline_value";case 19:this.begin("string");break;case 20:this.popState();break;case 21:return"txt";case 22:return 6;case 23:return 8;case 24:return"value";case 25:return 28}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\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:[17,18],inclusive:!1},acc_descr:{rules:[15],inclusive:!1},acc_title:{rules:[13],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},title:{rules:[11],inclusive:!1},string:{rules:[20,21],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,9,10,12,14,16,19,22,23,24,25],inclusive:!0}}};return Ae}();ge.lexer=ye;function ke(){this.yy={}}return ke.prototype=ge,ge.Parser=ke,new ke}();K0e.parser=K0e;const _$t=K0e;let AK={},Y0e=!1;const C$t={parseDirective:function(i,a,f){rd.parseDirective(this,i,a,f)},getConfig:()=>Tt().pie,addSection:function(i,a){i=Wa.sanitizeText(i,Tt()),AK[i]===void 0&&(AK[i]=a,Fe.debug("Added new section :",i))},getSections:()=>AK,cleanupValue:function(i){return i.substring(0,1)===":"&&(i=i.substring(1).trim()),Number(i.trim())},clear:function(){AK={},Y0e=!1,rp()},setAccTitle:ip,getAccTitle:L2,setDiagramTitle:Uw,getDiagramTitle:Ww,setShowData:function(i){Y0e=i},getShowData:function(){return Y0e},getAccDescription:D2,setAccDescription:M2},S$t=i=>` +`,"getStyles"),pce=xFe});var gce={};hr(gce,{diagram:()=>bFe});var bFe,yce=R(()=>{"use strict";Hle();uce();dce();mce();bFe={parser:Ule,db:lce,renderer:fce,styles:pce}});var bce,wce=R(()=>{"use strict";Lg();ut();bce={parse:o(async t=>{let e=await Fl("info",t);V.debug(e)},"parse")}});var fx,HI=R(()=>{fx="11.2.0"});var CFe,SFe,Tce,kce=R(()=>{"use strict";HI();CFe={version:fx},SFe=o(()=>CFe.version,"getVersion"),Tce={getVersion:SFe}});var Ps,pf=R(()=>{"use strict";Zt();_t();Ps=o(t=>{let{securityLevel:e}=de(),r=$e("body");if(e==="sandbox"){let a=$e(`#i${t}`).node()?.contentDocument??document;r=$e(a.body)}return r.select(`#${t}`)},"selectSvgElement")});var AFe,Ece,Cce=R(()=>{"use strict";ut();pf();Yn();AFe=o((t,e,r)=>{V.debug(`rendering info diagram +`+t);let n=Ps(e);Sr(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)},"draw"),Ece={draw:AFe}});var Sce={};hr(Sce,{diagram:()=>_Fe});var _Fe,Ace=R(()=>{"use strict";wce();kce();Cce();_Fe={parser:bce,db:Tce,renderer:Ece}});var Dce,YI,lE,WI,RFe,NFe,MFe,IFe,OFe,PFe,BFe,cE,qI=R(()=>{"use strict";ut();bi();sl();Dce=mr.pie,YI={sections:new Map,showData:!1,config:Dce},lE=YI.sections,WI=YI.showData,RFe=structuredClone(Dce),NFe=o(()=>structuredClone(RFe),"getConfig"),MFe=o(()=>{lE=new Map,WI=YI.showData,vr()},"clear"),IFe=o(({label:t,value:e})=>{lE.has(t)||(lE.set(t,e),V.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),OFe=o(()=>lE,"getSections"),PFe=o(t=>{WI=t},"setShowData"),BFe=o(()=>WI,"getShowData"),cE={getConfig:NFe,clear:MFe,setDiagramTitle:nn,getDiagramTitle:Xr,setAccTitle:kr,getAccTitle:Ar,setAccDescription:_r,getAccDescription:Lr,addSection:IFe,getSections:OFe,setShowData:PFe,getShowData:BFe}});var FFe,Rce,Nce=R(()=>{"use strict";Lg();ut();sx();qI();FFe=o((t,e)=>{cf(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),Rce={parse:o(async t=>{let e=await Fl("pie",t);V.debug(e),FFe(e,cE)},"parse")}});var zFe,Mce,Ice=R(()=>{"use strict";zFe=o(t=>` .pieCircle{ - stroke: ${i.pieStrokeColor}; - stroke-width : ${i.pieStrokeWidth}; - opacity : ${i.pieOpacity}; + stroke: ${t.pieStrokeColor}; + stroke-width : ${t.pieStrokeWidth}; + opacity : ${t.pieOpacity}; } .pieOuterCircle{ - stroke: ${i.pieOuterStrokeColor}; - stroke-width: ${i.pieOuterStrokeWidth}; + stroke: ${t.pieOuterStrokeColor}; + stroke-width: ${t.pieOuterStrokeWidth}; fill: none; } .pieTitleText { text-anchor: middle; - font-size: ${i.pieTitleTextSize}; - fill: ${i.pieTitleTextColor}; - font-family: ${i.fontFamily}; + font-size: ${t.pieTitleTextSize}; + fill: ${t.pieTitleTextColor}; + font-family: ${t.fontFamily}; } .slice { - font-family: ${i.fontFamily}; - fill: ${i.pieSectionTextColor}; - font-size:${i.pieSectionTextSize}; + font-family: ${t.fontFamily}; + fill: ${t.pieSectionTextColor}; + font-size:${t.pieSectionTextSize}; // fill: white; } .legend text { - fill: ${i.pieLegendTextColor}; - font-family: ${i.fontFamily}; - font-size: ${i.pieLegendTextSize}; - } -`;let d3=Tt(),A5;const CP=450,A$t=Object.freeze(Object.defineProperty({__proto__:null,diagram:{parser:_$t,db:C$t,renderer:{draw:(i,a,f,p)=>{var ge;try{d3=Tt(),Fe.debug(`Rendering info diagram -`+i);const ye=Tt().securityLevel;let ke;ye==="sandbox"&&(ke=Cr("#i"+a));const Ae=Cr(ye==="sandbox"?ke.nodes()[0].contentDocument.body:"body"),de=ye==="sandbox"?ke.nodes()[0].contentDocument:document;p.db.clear(),p.parser.parse(i),Fe.debug("Parsed info diagram");const ve=de.getElementById(a);A5=ve.parentElement.offsetWidth,A5===void 0&&(A5=1200),d3.useWidth!==void 0&&(A5=d3.useWidth),d3.pie.useWidth!==void 0&&(A5=d3.pie.useWidth);const te=Ae.select("#"+a);Vw(te,CP,A5,d3.pie.useMaxWidth),ve.setAttribute("viewBox","0 0 "+A5+" "+CP);var w=40,y=18,b=4,E=Math.min(A5,CP)/2-w,S=te.append("g").attr("transform","translate("+A5/2+","+CP/2+")"),N=p.db.getSections(),B=0;Object.keys(N).forEach(function(Ie){B+=N[Ie]});const xe=d3.themeVariables;var R=[xe.pie1,xe.pie2,xe.pie3,xe.pie4,xe.pie5,xe.pie6,xe.pie7,xe.pie8,xe.pie9,xe.pie10,xe.pie11,xe.pie12];const De=((ge=d3.pie)==null?void 0:ge.textPosition)??.75;let[he]=$A(xe.pieOuterStrokeWidth);he??(he=2);var j=DMe().range(R),$=Object.entries(N).map(function(Ie,ee){return{order:ee,name:Ie[0],value:Ie[1]}}),V=fEt().value(function(Ie){return Ie.value}).sort(function(Ie,ee){return Ie.order-ee.order}),Q=V($),oe=CA().innerRadius(0).outerRadius(E),ce=CA().innerRadius(E*De).outerRadius(E*De);S.append("circle").attr("cx",0).attr("cy",0).attr("r",E+he/2).attr("class","pieOuterCircle"),S.selectAll("mySlices").data(Q).enter().append("path").attr("d",oe).attr("fill",function(Ie){return j(Ie.data.name)}).attr("class","pieCircle"),S.selectAll("mySlices").data(Q).enter().append("text").text(function(Ie){return(Ie.data.value/B*100).toFixed(0)+"%"}).attr("transform",function(Ie){return"translate("+ce.centroid(Ie)+")"}).style("text-anchor","middle").attr("class","slice"),S.append("text").text(p.db.getDiagramTitle()).attr("x",0).attr("y",-(CP-50)/2).attr("class","pieTitleText");var se=S.selectAll(".legend").data(j.domain()).enter().append("g").attr("class","legend").attr("transform",function(Ie,ee){const rt=y+b,me=rt*j.domain().length/2,gt=12*y,pe=ee*rt-me;return"translate("+gt+","+pe+")"});se.append("rect").attr("width",y).attr("height",y).style("fill",j).style("stroke",j),se.data(Q).append("text").attr("x",y+b).attr("y",y-b).text(function(Ie){return p.db.getShowData()||d3.showData||d3.pie.showData?Ie.data.name+" ["+Ie.data.value+"]":Ie.data.name})}catch(ye){Fe.error("Error while rendering info diagram"),Fe.error(ye)}}},styles:S$t}},Symbol.toStringTag,{value:"Module"}));var X0e=function(){var i=function(oi,kt,Dt,vt){for(Dt=Dt||{},vt=oi.length;vt--;Dt[oi[vt]]=kt);return Dt},a=[1,3],f=[1,5],p=[1,6],w=[1,7],y=[1,8],b=[5,6,8,14,16,18,19,40,41,42,43,44,45,53,71,72],E=[1,22],S=[2,13],N=[1,26],B=[1,27],R=[1,28],j=[1,29],$=[1,30],V=[1,31],Q=[1,24],oe=[1,32],ce=[1,33],se=[1,36],ge=[71,72],ye=[5,8,14,16,18,19,40,41,42,43,44,45,53,60,62,71,72],ke=[1,56],Ae=[1,57],de=[1,58],ve=[1,59],te=[1,60],xe=[1,61],De=[1,62],he=[62,63],Ie=[1,74],ee=[1,70],rt=[1,71],me=[1,72],gt=[1,73],pe=[1,75],Et=[1,79],wt=[1,80],jt=[1,77],At=[1,78],Bt=[5,8,14,16,18,19,40,41,42,43,44,45,53,71,72],cn={trace:function(){},yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,openDirective:9,typeDirective:10,closeDirective:11,":":12,argDirective:13,acc_title:14,acc_title_value:15,acc_descr:16,acc_descr_value:17,acc_descr_multiline_value:18,open_directive:19,type_directive:20,arg_directive:21,close_directive:22,requirementDef:23,elementDef:24,relationshipDef:25,requirementType:26,requirementName:27,STRUCT_START:28,requirementBody:29,ID:30,COLONSEP:31,id:32,TEXT:33,text:34,RISK:35,riskLevel:36,VERIFYMTHD:37,verifyType:38,STRUCT_STOP:39,REQUIREMENT:40,FUNCTIONAL_REQUIREMENT:41,INTERFACE_REQUIREMENT:42,PERFORMANCE_REQUIREMENT:43,PHYSICAL_REQUIREMENT:44,DESIGN_CONSTRAINT:45,LOW_RISK:46,MED_RISK:47,HIGH_RISK:48,VERIFY_ANALYSIS:49,VERIFY_DEMONSTRATION:50,VERIFY_INSPECTION:51,VERIFY_TEST:52,ELEMENT:53,elementName:54,elementBody:55,TYPE:56,type:57,DOCREF:58,ref:59,END_ARROW_L:60,relationship:61,LINE:62,END_ARROW_R:63,CONTAINS:64,COPIES:65,DERIVES:66,SATISFIES:67,VERIFIES:68,REFINES:69,TRACES:70,unqString:71,qString:72,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",12:":",14:"acc_title",15:"acc_title_value",16:"acc_descr",17:"acc_descr_value",18:"acc_descr_multiline_value",19:"open_directive",20:"type_directive",21:"arg_directive",22:"close_directive",28:"STRUCT_START",30:"ID",31:"COLONSEP",33:"TEXT",35:"RISK",37:"VERIFYMTHD",39:"STRUCT_STOP",40:"REQUIREMENT",41:"FUNCTIONAL_REQUIREMENT",42:"INTERFACE_REQUIREMENT",43:"PERFORMANCE_REQUIREMENT",44:"PHYSICAL_REQUIREMENT",45:"DESIGN_CONSTRAINT",46:"LOW_RISK",47:"MED_RISK",48:"HIGH_RISK",49:"VERIFY_ANALYSIS",50:"VERIFY_DEMONSTRATION",51:"VERIFY_INSPECTION",52:"VERIFY_TEST",53:"ELEMENT",56:"TYPE",58:"DOCREF",60:"END_ARROW_L",62:"LINE",63:"END_ARROW_R",64:"CONTAINS",65:"COPIES",66:"DERIVES",67:"SATISFIES",68:"VERIFIES",69:"REFINES",70:"TRACES",71:"unqString",72:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,3],[4,5],[4,2],[4,2],[4,1],[9,1],[10,1],[13,1],[11,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[23,5],[29,5],[29,5],[29,5],[29,5],[29,2],[29,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[36,1],[36,1],[36,1],[38,1],[38,1],[38,1],[38,1],[24,5],[55,5],[55,5],[55,2],[55,1],[25,5],[25,5],[61,1],[61,1],[61,1],[61,1],[61,1],[61,1],[61,1],[27,1],[27,1],[32,1],[32,1],[34,1],[34,1],[54,1],[54,1],[57,1],[57,1],[59,1],[59,1]],performAction:function(kt,Dt,vt,Nt,ze,Xe,Lt){var Ge=Xe.length-1;switch(ze){case 6:this.$=Xe[Ge].trim(),Nt.setAccTitle(this.$);break;case 7:case 8:this.$=Xe[Ge].trim(),Nt.setAccDescription(this.$);break;case 9:Nt.parseDirective("%%{","open_directive");break;case 10:Nt.parseDirective(Xe[Ge],"type_directive");break;case 11:Xe[Ge]=Xe[Ge].trim().replace(/'/g,'"'),Nt.parseDirective(Xe[Ge],"arg_directive");break;case 12:Nt.parseDirective("}%%","close_directive","pie");break;case 13:this.$=[];break;case 19:Nt.addRequirement(Xe[Ge-3],Xe[Ge-4]);break;case 20:Nt.setNewReqId(Xe[Ge-2]);break;case 21:Nt.setNewReqText(Xe[Ge-2]);break;case 22:Nt.setNewReqRisk(Xe[Ge-2]);break;case 23:Nt.setNewReqVerifyMethod(Xe[Ge-2]);break;case 26:this.$=Nt.RequirementType.REQUIREMENT;break;case 27:this.$=Nt.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 28:this.$=Nt.RequirementType.INTERFACE_REQUIREMENT;break;case 29:this.$=Nt.RequirementType.PERFORMANCE_REQUIREMENT;break;case 30:this.$=Nt.RequirementType.PHYSICAL_REQUIREMENT;break;case 31:this.$=Nt.RequirementType.DESIGN_CONSTRAINT;break;case 32:this.$=Nt.RiskLevel.LOW_RISK;break;case 33:this.$=Nt.RiskLevel.MED_RISK;break;case 34:this.$=Nt.RiskLevel.HIGH_RISK;break;case 35:this.$=Nt.VerifyType.VERIFY_ANALYSIS;break;case 36:this.$=Nt.VerifyType.VERIFY_DEMONSTRATION;break;case 37:this.$=Nt.VerifyType.VERIFY_INSPECTION;break;case 38:this.$=Nt.VerifyType.VERIFY_TEST;break;case 39:Nt.addElement(Xe[Ge-3]);break;case 40:Nt.setNewElementType(Xe[Ge-2]);break;case 41:Nt.setNewElementDocRef(Xe[Ge-2]);break;case 44:Nt.addRelationship(Xe[Ge-2],Xe[Ge],Xe[Ge-4]);break;case 45:Nt.addRelationship(Xe[Ge-2],Xe[Ge-4],Xe[Ge]);break;case 46:this.$=Nt.Relationships.CONTAINS;break;case 47:this.$=Nt.Relationships.COPIES;break;case 48:this.$=Nt.Relationships.DERIVES;break;case 49:this.$=Nt.Relationships.SATISFIES;break;case 50:this.$=Nt.Relationships.VERIFIES;break;case 51:this.$=Nt.Relationships.REFINES;break;case 52:this.$=Nt.Relationships.TRACES;break}},table:[{3:1,4:2,6:a,9:4,14:f,16:p,18:w,19:y},{1:[3]},{3:10,4:2,5:[1,9],6:a,9:4,14:f,16:p,18:w,19:y},{5:[1,11]},{10:12,20:[1,13]},{15:[1,14]},{17:[1,15]},i(b,[2,8]),{20:[2,9]},{3:16,4:2,6:a,9:4,14:f,16:p,18:w,19:y},{1:[2,2]},{4:21,5:E,7:17,8:S,9:4,14:f,16:p,18:w,19:y,23:18,24:19,25:20,26:23,32:25,40:N,41:B,42:R,43:j,44:$,45:V,53:Q,71:oe,72:ce},{11:34,12:[1,35],22:se},i([12,22],[2,10]),i(b,[2,6]),i(b,[2,7]),{1:[2,1]},{8:[1,37]},{4:21,5:E,7:38,8:S,9:4,14:f,16:p,18:w,19:y,23:18,24:19,25:20,26:23,32:25,40:N,41:B,42:R,43:j,44:$,45:V,53:Q,71:oe,72:ce},{4:21,5:E,7:39,8:S,9:4,14:f,16:p,18:w,19:y,23:18,24:19,25:20,26:23,32:25,40:N,41:B,42:R,43:j,44:$,45:V,53:Q,71:oe,72:ce},{4:21,5:E,7:40,8:S,9:4,14:f,16:p,18:w,19:y,23:18,24:19,25:20,26:23,32:25,40:N,41:B,42:R,43:j,44:$,45:V,53:Q,71:oe,72:ce},{4:21,5:E,7:41,8:S,9:4,14:f,16:p,18:w,19:y,23:18,24:19,25:20,26:23,32:25,40:N,41:B,42:R,43:j,44:$,45:V,53:Q,71:oe,72:ce},{4:21,5:E,7:42,8:S,9:4,14:f,16:p,18:w,19:y,23:18,24:19,25:20,26:23,32:25,40:N,41:B,42:R,43:j,44:$,45:V,53:Q,71:oe,72:ce},{27:43,71:[1,44],72:[1,45]},{54:46,71:[1,47],72:[1,48]},{60:[1,49],62:[1,50]},i(ge,[2,26]),i(ge,[2,27]),i(ge,[2,28]),i(ge,[2,29]),i(ge,[2,30]),i(ge,[2,31]),i(ye,[2,55]),i(ye,[2,56]),i(b,[2,4]),{13:51,21:[1,52]},i(b,[2,12]),{1:[2,3]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{8:[2,17]},{8:[2,18]},{28:[1,53]},{28:[2,53]},{28:[2,54]},{28:[1,54]},{28:[2,59]},{28:[2,60]},{61:55,64:ke,65:Ae,66:de,67:ve,68:te,69:xe,70:De},{61:63,64:ke,65:Ae,66:de,67:ve,68:te,69:xe,70:De},{11:64,22:se},{22:[2,11]},{5:[1,65]},{5:[1,66]},{62:[1,67]},i(he,[2,46]),i(he,[2,47]),i(he,[2,48]),i(he,[2,49]),i(he,[2,50]),i(he,[2,51]),i(he,[2,52]),{63:[1,68]},i(b,[2,5]),{5:Ie,29:69,30:ee,33:rt,35:me,37:gt,39:pe},{5:Et,39:wt,55:76,56:jt,58:At},{32:81,71:oe,72:ce},{32:82,71:oe,72:ce},i(Bt,[2,19]),{31:[1,83]},{31:[1,84]},{31:[1,85]},{31:[1,86]},{5:Ie,29:87,30:ee,33:rt,35:me,37:gt,39:pe},i(Bt,[2,25]),i(Bt,[2,39]),{31:[1,88]},{31:[1,89]},{5:Et,39:wt,55:90,56:jt,58:At},i(Bt,[2,43]),i(Bt,[2,44]),i(Bt,[2,45]),{32:91,71:oe,72:ce},{34:92,71:[1,93],72:[1,94]},{36:95,46:[1,96],47:[1,97],48:[1,98]},{38:99,49:[1,100],50:[1,101],51:[1,102],52:[1,103]},i(Bt,[2,24]),{57:104,71:[1,105],72:[1,106]},{59:107,71:[1,108],72:[1,109]},i(Bt,[2,42]),{5:[1,110]},{5:[1,111]},{5:[2,57]},{5:[2,58]},{5:[1,112]},{5:[2,32]},{5:[2,33]},{5:[2,34]},{5:[1,113]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[2,38]},{5:[1,114]},{5:[2,61]},{5:[2,62]},{5:[1,115]},{5:[2,63]},{5:[2,64]},{5:Ie,29:116,30:ee,33:rt,35:me,37:gt,39:pe},{5:Ie,29:117,30:ee,33:rt,35:me,37:gt,39:pe},{5:Ie,29:118,30:ee,33:rt,35:me,37:gt,39:pe},{5:Ie,29:119,30:ee,33:rt,35:me,37:gt,39:pe},{5:Et,39:wt,55:120,56:jt,58:At},{5:Et,39:wt,55:121,56:jt,58:At},i(Bt,[2,20]),i(Bt,[2,21]),i(Bt,[2,22]),i(Bt,[2,23]),i(Bt,[2,40]),i(Bt,[2,41])],defaultActions:{8:[2,9],10:[2,2],16:[2,1],37:[2,3],38:[2,14],39:[2,15],40:[2,16],41:[2,17],42:[2,18],44:[2,53],45:[2,54],47:[2,59],48:[2,60],52:[2,11],93:[2,57],94:[2,58],96:[2,32],97:[2,33],98:[2,34],100:[2,35],101:[2,36],102:[2,37],103:[2,38],105:[2,61],106:[2,62],108:[2,63],109:[2,64]},parseError:function(kt,Dt){if(Dt.recoverable)this.trace(kt);else{var vt=new Error(kt);throw vt.hash=Dt,vt}},parse:function(kt){var Dt=this,vt=[0],Nt=[],ze=[null],Xe=[],Lt=this.table,Ge="",Bn=0,Oe=0,Ri=2,tn=1,hi=Xe.slice.call(arguments,1),Sr=Object.create(this.lexer),Zn={yy:{}};for(var Xn in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Xn)&&(Zn.yy[Xn]=this.yy[Xn]);Sr.setInput(kt,Zn.yy),Zn.yy.lexer=Sr,Zn.yy.parser=this,typeof Sr.yylloc>"u"&&(Sr.yylloc={});var ir=Sr.yylloc;Xe.push(ir);var Hn=Sr.options&&Sr.options.ranges;typeof Zn.yy.parseError=="function"?this.parseError=Zn.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tr(){var br;return br=Nt.pop()||Sr.lex()||tn,typeof br!="number"&&(br instanceof Array&&(Nt=br,br=Nt.pop()),br=Dt.symbols_[br]||br),br}for(var ha,Zs,ns,Hi,Js={},Pc,Ga,ws,Oi;;){if(Zs=vt[vt.length-1],this.defaultActions[Zs]?ns=this.defaultActions[Zs]:((ha===null||typeof ha>"u")&&(ha=tr()),ns=Lt[Zs]&&Lt[Zs][ha]),typeof ns>"u"||!ns.length||!ns[0]){var Er="";Oi=[];for(Pc in Lt[Zs])this.terminals_[Pc]&&Pc>Ri&&Oi.push("'"+this.terminals_[Pc]+"'");Sr.showPosition?Er="Parse error on line "+(Bn+1)+`: -`+Sr.showPosition()+` -Expecting `+Oi.join(", ")+", got '"+(this.terminals_[ha]||ha)+"'":Er="Parse error on line "+(Bn+1)+": Unexpected "+(ha==tn?"end of input":"'"+(this.terminals_[ha]||ha)+"'"),this.parseError(Er,{text:Sr.match,token:this.terminals_[ha]||ha,line:Sr.yylineno,loc:ir,expected:Oi})}if(ns[0]instanceof Array&&ns.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Zs+", token: "+ha);switch(ns[0]){case 1:vt.push(ha),ze.push(Sr.yytext),Xe.push(Sr.yylloc),vt.push(ns[1]),ha=null,Oe=Sr.yyleng,Ge=Sr.yytext,Bn=Sr.yylineno,ir=Sr.yylloc;break;case 2:if(Ga=this.productions_[ns[1]][1],Js.$=ze[ze.length-Ga],Js._$={first_line:Xe[Xe.length-(Ga||1)].first_line,last_line:Xe[Xe.length-1].last_line,first_column:Xe[Xe.length-(Ga||1)].first_column,last_column:Xe[Xe.length-1].last_column},Hn&&(Js._$.range=[Xe[Xe.length-(Ga||1)].range[0],Xe[Xe.length-1].range[1]]),Hi=this.performAction.apply(Js,[Ge,Oe,Bn,Zn.yy,ns[1],ze,Xe].concat(hi)),typeof Hi<"u")return Hi;Ga&&(vt=vt.slice(0,-1*Ga*2),ze=ze.slice(0,-1*Ga),Xe=Xe.slice(0,-1*Ga)),vt.push(this.productions_[ns[1]][0]),ze.push(Js.$),Xe.push(Js._$),ws=Lt[vt[vt.length-2]][vt[vt.length-1]],vt.push(ws);break;case 3:return!0}}return!0}},Nn=function(){var oi={EOF:1,parseError:function(Dt,vt){if(this.yy.parser)this.yy.parser.parseError(Dt,vt);else throw new Error(Dt)},setInput:function(kt,Dt){return this.yy=Dt||this.yy||{},this._input=kt,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var kt=this._input[0];this.yytext+=kt,this.yyleng++,this.offset++,this.match+=kt,this.matched+=kt;var Dt=kt.match(/(?:\r\n?|\n).*/g);return Dt?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),kt},unput:function(kt){var Dt=kt.length,vt=kt.split(/(?:\r\n?|\n)/g);this._input=kt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Dt),this.offset-=Dt;var Nt=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),vt.length-1&&(this.yylineno-=vt.length-1);var ze=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:vt?(vt.length===Nt.length?this.yylloc.first_column:0)+Nt[Nt.length-vt.length].length-vt[0].length:this.yylloc.first_column-Dt},this.options.ranges&&(this.yylloc.range=[ze[0],ze[0]+this.yyleng-Dt]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(kt){this.unput(this.match.slice(kt))},pastInput:function(){var kt=this.matched.substr(0,this.matched.length-this.match.length);return(kt.length>20?"...":"")+kt.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var kt=this.match;return kt.length<20&&(kt+=this._input.substr(0,20-kt.length)),(kt.substr(0,20)+(kt.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var kt=this.pastInput(),Dt=new Array(kt.length+1).join("-");return kt+this.upcomingInput()+` -`+Dt+"^"},test_match:function(kt,Dt){var vt,Nt,ze;if(this.options.backtrack_lexer&&(ze={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},this.options.ranges&&(ze.yylloc.range=this.yylloc.range.slice(0))),Nt=kt[0].match(/(?:\r\n?|\n).*/g),Nt&&(this.yylineno+=Nt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Nt?Nt[Nt.length-1].length-Nt[Nt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+kt[0].length},this.yytext+=kt[0],this.match+=kt[0],this.matches=kt,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(kt[0].length),this.matched+=kt[0],vt=this.performAction.call(this,this.yy,this,Dt,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),vt)return vt;if(this._backtrack){for(var Xe in ze)this[Xe]=ze[Xe];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var kt,Dt,vt,Nt;this._more||(this.yytext="",this.match="");for(var ze=this._currentRules(),Xe=0;XeDt[0].length)){if(Dt=vt,Nt=Xe,this.options.backtrack_lexer){if(kt=this.test_match(vt,ze[Xe]),kt!==!1)return kt;if(this._backtrack){Dt=!1;continue}else return!1}else if(!this.options.flex)break}return Dt?(kt=this.test_match(Dt,ze[Nt]),kt!==!1?kt:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var Dt=this.next();return Dt||this.lex()},begin:function(Dt){this.conditionStack.push(Dt)},popState:function(){var Dt=this.conditionStack.length-1;return Dt>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(Dt){return Dt=this.conditionStack.length-1-Math.abs(Dt||0),Dt>=0?this.conditionStack[Dt]:"INITIAL"},pushState:function(Dt){this.begin(Dt)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(Dt,vt,Nt,ze){switch(Nt){case 0:return this.begin("open_directive"),19;case 1:return this.begin("type_directive"),20;case 2:return this.popState(),this.begin("arg_directive"),12;case 3:return this.popState(),this.popState(),22;case 4:return 21;case 5:return"title";case 6:return this.begin("acc_title"),14;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),16;case 9:return this.popState(),"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 5;case 14:break;case 15:break;case 16:break;case 17:return 8;case 18:return 6;case 19:return 28;case 20:return 39;case 21:return 31;case 22:return 30;case 23:return 33;case 24:return 35;case 25:return 37;case 26:return 40;case 27:return 41;case 28:return 42;case 29:return 43;case 30:return 44;case 31:return 45;case 32:return 46;case 33:return 47;case 34:return 48;case 35:return 49;case 36:return 50;case 37:return 51;case 38:return 52;case 39:return 53;case 40:return 64;case 41:return 65;case 42:return 66;case 43:return 67;case 44:return 68;case 45:return 69;case 46:return 70;case 47:return 56;case 48:return 58;case 49:return 60;case 50:return 63;case 51:return 62;case 52:this.begin("string");break;case 53:this.popState();break;case 54:return"qString";case 55:return vt.yytext=vt.yytext.trim(),71}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\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,/^(?:(\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:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},unqString:{rules:[],inclusive:!1},token:{rules:[],inclusive:!1},string:{rules:[53,54],inclusive:!1},INITIAL:{rules:[0,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,55],inclusive:!0}}};return oi}();cn.lexer=Nn;function Ot(){this.yy={}}return Ot.prototype=cn,cn.Parser=Ot,new Ot}();X0e.parser=X0e;const L$t=X0e;let Q0e=[],up={},SP={},ox={},AP={};const M$t={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"},parseDirective:function(i,a,f){rd.parseDirective(this,i,a,f)},getConfig:()=>Tt().req,addRequirement:(i,a)=>(SP[i]===void 0&&(SP[i]={name:i,type:a,id:up.id,text:up.text,risk:up.risk,verifyMethod:up.verifyMethod}),up={},SP[i]),getRequirements:()=>SP,setNewReqId:i=>{up!==void 0&&(up.id=i)},setNewReqText:i=>{up!==void 0&&(up.text=i)},setNewReqRisk:i=>{up!==void 0&&(up.risk=i)},setNewReqVerifyMethod:i=>{up!==void 0&&(up.verifyMethod=i)},setAccTitle:ip,getAccTitle:L2,setAccDescription:M2,getAccDescription:D2,addElement:i=>(AP[i]===void 0&&(AP[i]={name:i,type:ox.type,docRef:ox.docRef},Fe.info("Added new requirement: ",i)),ox={},AP[i]),getElements:()=>AP,setNewElementType:i=>{ox!==void 0&&(ox.type=i)},setNewElementDocRef:i=>{ox!==void 0&&(ox.docRef=i)},addRelationship:(i,a,f)=>{Q0e.push({type:i,src:a,dst:f})},getRelationships:()=>Q0e,clear:()=>{Q0e=[],up={},SP={},ox={},AP={},rp()}},D$t=i=>` + fill: ${t.pieLegendTextColor}; + font-family: ${t.fontFamily}; + font-size: ${t.pieLegendTextSize}; + } +`,"getStyles"),Mce=zFe});var GFe,$Fe,Oce,Pce=R(()=>{"use strict";Zt();_t();ut();pf();Yn();xr();GFe=o(t=>{let e=[...t.entries()].map(n=>({label:n[0],value:n[1]})).sort((n,i)=>i.value-n.value);return O3().value(n=>n.value)(e)},"createPieArcs"),$Fe=o((t,e,r,n)=>{V.debug(`rendering pie chart +`+t);let i=n.db,a=de(),s=Ts(i.getConfig(),a.pie),l=40,u=18,h=4,f=450,d=f,p=Ps(e),m=p.append("g");m.attr("transform","translate("+d/2+","+f/2+")");let{themeVariables:g}=a,[y]=mc(g.pieOuterStrokeWidth);y??=2;let v=s.textPosition,x=Math.min(d,f)/2-l,b=bl().innerRadius(0).outerRadius(x),w=bl().innerRadius(x*v).outerRadius(x*v);m.append("circle").attr("cx",0).attr("cy",0).attr("r",x+y/2).attr("class","pieOuterCircle");let S=i.getSections(),T=GFe(S),E=[g.pie1,g.pie2,g.pie3,g.pie4,g.pie5,g.pie6,g.pie7,g.pie8,g.pie9,g.pie10,g.pie11,g.pie12],_=pu(E);m.selectAll("mySlices").data(T).enter().append("path").attr("d",b).attr("fill",k=>_(k.data.label)).attr("class","pieCircle");let A=0;S.forEach(k=>{A+=k}),m.selectAll("mySlices").data(T).enter().append("text").text(k=>(k.data.value/A*100).toFixed(0)+"%").attr("transform",k=>"translate("+w.centroid(k)+")").style("text-anchor","middle").attr("class","slice"),m.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-(f-50)/2).attr("class","pieTitleText");let L=m.selectAll(".legend").data(_.domain()).enter().append("g").attr("class","legend").attr("transform",(k,I)=>{let C=u+h,O=C*_.domain().length/2,D=12*u,P=I*C-O;return"translate("+D+","+P+")"});L.append("rect").attr("width",u).attr("height",u).style("fill",_).style("stroke",_),L.data(T).append("text").attr("x",u+h).attr("y",u-h).text(k=>{let{label:I,value:C}=k.data;return i.getShowData()?`${I} [${C}]`:I});let M=Math.max(...L.selectAll("text").nodes().map(k=>k?.getBoundingClientRect().width??0)),N=d+l+u+h+M;p.attr("viewBox",`0 0 ${N} ${f}`),Sr(p,f,N,s.useMaxWidth)},"draw"),Oce={draw:$Fe}});var Bce={};hr(Bce,{diagram:()=>VFe});var VFe,Fce=R(()=>{"use strict";Nce();qI();Ice();Pce();VFe={parser:Rce,db:cE,renderer:Oce,styles:Mce}});var XI,$ce,Vce=R(()=>{"use strict";XI=function(){var t=o(function(we,Te,Ce,Ae){for(Ce=Ce||{},Ae=we.length;Ae--;Ce[we[Ae]]=Te);return Ce},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[1,7],s=[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],l=[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],u=[55,56,57],h=[2,36],f=[1,37],d=[1,36],p=[1,38],m=[1,35],g=[1,43],y=[1,41],v=[1,14],x=[1,23],b=[1,18],w=[1,19],S=[1,20],T=[1,21],E=[1,22],_=[1,24],A=[1,25],L=[1,26],M=[1,27],N=[1,28],k=[1,29],I=[1,32],C=[1,33],O=[1,34],D=[1,39],P=[1,40],F=[1,42],B=[1,44],$=[1,62],z=[1,61],Y=[4,5,8,10,12,13,14,18,44,47,49,55,56,57,63,64,65,66,67],Q=[1,65],X=[1,66],ie=[1,67],j=[1,68],J=[1,69],Z=[1,70],H=[1,71],q=[1,72],K=[1,73],se=[1,74],ce=[1,75],ue=[1,76],te=[4,5,6,7,8,9,10,11,12,13,14,15,18],De=[1,90],oe=[1,91],ke=[1,92],Ie=[1,99],Se=[1,93],Ue=[1,96],Pe=[1,94],_e=[1,95],me=[1,97],W=[1,98],fe=[1,102],ge=[10,55,56,57],re=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],he={trace:o(function(){},"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:o(function(Te,Ce,Ae,Ge,Me,ye,He){var ze=ye.length-1;switch(Me){case 23:this.$=ye[ze];break;case 24:this.$=ye[ze-1]+""+ye[ze];break;case 26:this.$=ye[ze-1]+ye[ze];break;case 27:this.$=[ye[ze].trim()];break;case 28:ye[ze-2].push(ye[ze].trim()),this.$=ye[ze-2];break;case 29:this.$=ye[ze-4],Ge.addClass(ye[ze-2],ye[ze]);break;case 37:this.$=[];break;case 42:this.$=ye[ze].trim(),Ge.setDiagramTitle(this.$);break;case 43:this.$=ye[ze].trim(),Ge.setAccTitle(this.$);break;case 44:case 45:this.$=ye[ze].trim(),Ge.setAccDescription(this.$);break;case 46:Ge.addSection(ye[ze].substr(8)),this.$=ye[ze].substr(8);break;case 47:Ge.addPoint(ye[ze-3],"",ye[ze-1],ye[ze],[]);break;case 48:Ge.addPoint(ye[ze-4],ye[ze-3],ye[ze-1],ye[ze],[]);break;case 49:Ge.addPoint(ye[ze-4],"",ye[ze-2],ye[ze-1],ye[ze]);break;case 50:Ge.addPoint(ye[ze-5],ye[ze-4],ye[ze-2],ye[ze-1],ye[ze]);break;case 51:Ge.setXAxisLeftText(ye[ze-2]),Ge.setXAxisRightText(ye[ze]);break;case 52:ye[ze-1].text+=" \u27F6 ",Ge.setXAxisLeftText(ye[ze-1]);break;case 53:Ge.setXAxisLeftText(ye[ze]);break;case 54:Ge.setYAxisBottomText(ye[ze-2]),Ge.setYAxisTopText(ye[ze]);break;case 55:ye[ze-1].text+=" \u27F6 ",Ge.setYAxisBottomText(ye[ze-1]);break;case 56:Ge.setYAxisBottomText(ye[ze]);break;case 57:Ge.setQuadrant1Text(ye[ze]);break;case 58:Ge.setQuadrant2Text(ye[ze]);break;case 59:Ge.setQuadrant3Text(ye[ze]);break;case 60:Ge.setQuadrant4Text(ye[ze]);break;case 64:this.$={text:ye[ze],type:"text"};break;case 65:this.$={text:ye[ze-1].text+""+ye[ze],type:ye[ze-1].type};break;case 66:this.$={text:ye[ze],type:"text"};break;case 67:this.$={text:ye[ze],type:"markdown"};break;case 68:this.$=ye[ze];break;case 69:this.$=ye[ze-1]+""+ye[ze];break}},"anonymous"),table:[{18:e,26:1,27:2,28:r,55:n,56:i,57:a},{1:[3]},{18:e,26:8,27:2,28:r,55:n,56:i,57:a},{18:e,26:9,27:2,28:r,55:n,56:i,57:a},t(s,[2,33],{29:10}),t(l,[2,61]),t(l,[2,62]),t(l,[2,63]),{1:[2,30]},{1:[2,31]},t(u,h,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:f,5:d,10:p,12:m,13:g,14:y,18:v,25:x,35:b,37:w,39:S,41:T,42:E,48:_,50:A,51:L,52:M,53:N,54:k,60:I,61:C,63:O,64:D,65:P,66:F,67:B}),t(s,[2,34]),{27:45,55:n,56:i,57:a},t(u,[2,37]),t(u,h,{24:13,32:15,33:16,34:17,43:30,58:31,31:46,4:f,5:d,10:p,12:m,13:g,14:y,18:v,25:x,35:b,37:w,39:S,41:T,42:E,48:_,50:A,51:L,52:M,53:N,54:k,60:I,61:C,63:O,64:D,65:P,66:F,67:B}),t(u,[2,39]),t(u,[2,40]),t(u,[2,41]),{36:[1,47]},{38:[1,48]},{40:[1,49]},t(u,[2,45]),t(u,[2,46]),{18:[1,50]},{4:f,5:d,10:p,12:m,13:g,14:y,43:51,58:31,60:I,61:C,63:O,64:D,65:P,66:F,67:B},{4:f,5:d,10:p,12:m,13:g,14:y,43:52,58:31,60:I,61:C,63:O,64:D,65:P,66:F,67:B},{4:f,5:d,10:p,12:m,13:g,14:y,43:53,58:31,60:I,61:C,63:O,64:D,65:P,66:F,67:B},{4:f,5:d,10:p,12:m,13:g,14:y,43:54,58:31,60:I,61:C,63:O,64:D,65:P,66:F,67:B},{4:f,5:d,10:p,12:m,13:g,14:y,43:55,58:31,60:I,61:C,63:O,64:D,65:P,66:F,67:B},{4:f,5:d,10:p,12:m,13:g,14:y,43:56,58:31,60:I,61:C,63:O,64:D,65:P,66:F,67:B},{4:f,5:d,8:$,10:p,12:m,13:g,14:y,18:z,44:[1,57],47:[1,58],58:60,59:59,63:O,64:D,65:P,66:F,67:B},t(Y,[2,64]),t(Y,[2,66]),t(Y,[2,67]),t(Y,[2,70]),t(Y,[2,71]),t(Y,[2,72]),t(Y,[2,73]),t(Y,[2,74]),t(Y,[2,75]),t(Y,[2,76]),t(Y,[2,77]),t(Y,[2,78]),t(Y,[2,79]),t(Y,[2,80]),t(s,[2,35]),t(u,[2,38]),t(u,[2,42]),t(u,[2,43]),t(u,[2,44]),{3:64,4:Q,5:X,6:ie,7:j,8:J,9:Z,10:H,11:q,12:K,13:se,14:ce,15:ue,21:63},t(u,[2,53],{59:59,58:60,4:f,5:d,8:$,10:p,12:m,13:g,14:y,18:z,49:[1,77],63:O,64:D,65:P,66:F,67:B}),t(u,[2,56],{59:59,58:60,4:f,5:d,8:$,10:p,12:m,13:g,14:y,18:z,49:[1,78],63:O,64:D,65:P,66:F,67:B}),t(u,[2,57],{59:59,58:60,4:f,5:d,8:$,10:p,12:m,13:g,14:y,18:z,63:O,64:D,65:P,66:F,67:B}),t(u,[2,58],{59:59,58:60,4:f,5:d,8:$,10:p,12:m,13:g,14:y,18:z,63:O,64:D,65:P,66:F,67:B}),t(u,[2,59],{59:59,58:60,4:f,5:d,8:$,10:p,12:m,13:g,14:y,18:z,63:O,64:D,65:P,66:F,67:B}),t(u,[2,60],{59:59,58:60,4:f,5:d,8:$,10:p,12:m,13:g,14:y,18:z,63:O,64:D,65:P,66:F,67:B}),{45:[1,79]},{44:[1,80]},t(Y,[2,65]),t(Y,[2,81]),t(Y,[2,82]),t(Y,[2,83]),{3:82,4:Q,5:X,6:ie,7:j,8:J,9:Z,10:H,11:q,12:K,13:se,14:ce,15:ue,18:[1,81]},t(te,[2,23]),t(te,[2,1]),t(te,[2,2]),t(te,[2,3]),t(te,[2,4]),t(te,[2,5]),t(te,[2,6]),t(te,[2,7]),t(te,[2,8]),t(te,[2,9]),t(te,[2,10]),t(te,[2,11]),t(te,[2,12]),t(u,[2,52],{58:31,43:83,4:f,5:d,10:p,12:m,13:g,14:y,60:I,61:C,63:O,64:D,65:P,66:F,67:B}),t(u,[2,55],{58:31,43:84,4:f,5:d,10:p,12:m,13:g,14:y,60:I,61:C,63:O,64:D,65:P,66:F,67:B}),{46:[1,85]},{45:[1,86]},{4:De,5:oe,6:ke,8:Ie,11:Se,13:Ue,16:89,17:Pe,18:_e,19:me,20:W,22:88,23:87},t(te,[2,24]),t(u,[2,51],{59:59,58:60,4:f,5:d,8:$,10:p,12:m,13:g,14:y,18:z,63:O,64:D,65:P,66:F,67:B}),t(u,[2,54],{59:59,58:60,4:f,5:d,8:$,10:p,12:m,13:g,14:y,18:z,63:O,64:D,65:P,66:F,67:B}),t(u,[2,47],{22:88,16:89,23:100,4:De,5:oe,6:ke,8:Ie,11:Se,13:Ue,17:Pe,18:_e,19:me,20:W}),{46:[1,101]},t(u,[2,29],{10:fe}),t(ge,[2,27],{16:103,4:De,5:oe,6:ke,8:Ie,11:Se,13:Ue,17:Pe,18:_e,19:me,20:W}),t(re,[2,25]),t(re,[2,13]),t(re,[2,14]),t(re,[2,15]),t(re,[2,16]),t(re,[2,17]),t(re,[2,18]),t(re,[2,19]),t(re,[2,20]),t(re,[2,21]),t(re,[2,22]),t(u,[2,49],{10:fe}),t(u,[2,48],{22:88,16:89,23:104,4:De,5:oe,6:ke,8:Ie,11:Se,13:Ue,17:Pe,18:_e,19:me,20:W}),{4:De,5:oe,6:ke,8:Ie,11:Se,13:Ue,16:89,17:Pe,18:_e,19:me,20:W,22:105},t(re,[2,26]),t(u,[2,50],{10:fe}),t(ge,[2,28],{16:103,4:De,5:oe,6:ke,8:Ie,11:Se,13:Ue,17:Pe,18:_e,19:me,20:W})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(Te,Ce){if(Ce.recoverable)this.trace(Te);else{var Ae=new Error(Te);throw Ae.hash=Ce,Ae}},"parseError"),parse:o(function(Te){var Ce=this,Ae=[0],Ge=[],Me=[null],ye=[],He=this.table,ze="",Ze=0,gt=0,yt=0,tt=2,Ye=1,Je=ye.slice.call(arguments,1),Ve=Object.create(this.lexer),je={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(je.yy[kt]=this.yy[kt]);Ve.setInput(Te,je.yy),je.yy.lexer=Ve,je.yy.parser=this,typeof Ve.yylloc>"u"&&(Ve.yylloc={});var at=Ve.yylloc;ye.push(at);var xt=Ve.options&&Ve.options.ranges;typeof je.yy.parseError=="function"?this.parseError=je.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function it(on){Ae.length=Ae.length-2*on,Me.length=Me.length-on,ye.length=ye.length-on}o(it,"popStack");function dt(){var on;return on=Ge.pop()||Ve.lex()||Ye,typeof on!="number"&&(on instanceof Array&&(Ge=on,on=Ge.pop()),on=Ce.symbols_[on]||on),on}o(dt,"lex");for(var lt,It,mt,St,gr,xn,jt={},rn,Er,Kn,hn;;){if(mt=Ae[Ae.length-1],this.defaultActions[mt]?St=this.defaultActions[mt]:((lt===null||typeof lt>"u")&&(lt=dt()),St=He[mt]&&He[mt][lt]),typeof St>"u"||!St.length||!St[0]){var Qn="";hn=[];for(rn in He[mt])this.terminals_[rn]&&rn>tt&&hn.push("'"+this.terminals_[rn]+"'");Ve.showPosition?Qn="Parse error on line "+(Ze+1)+`: +`+Ve.showPosition()+` +Expecting `+hn.join(", ")+", got '"+(this.terminals_[lt]||lt)+"'":Qn="Parse error on line "+(Ze+1)+": Unexpected "+(lt==Ye?"end of input":"'"+(this.terminals_[lt]||lt)+"'"),this.parseError(Qn,{text:Ve.match,token:this.terminals_[lt]||lt,line:Ve.yylineno,loc:at,expected:hn})}if(St[0]instanceof Array&&St.length>1)throw new Error("Parse Error: multiple actions possible at state: "+mt+", token: "+lt);switch(St[0]){case 1:Ae.push(lt),Me.push(Ve.yytext),ye.push(Ve.yylloc),Ae.push(St[1]),lt=null,It?(lt=It,It=null):(gt=Ve.yyleng,ze=Ve.yytext,Ze=Ve.yylineno,at=Ve.yylloc,yt>0&&yt--);break;case 2:if(Er=this.productions_[St[1]][1],jt.$=Me[Me.length-Er],jt._$={first_line:ye[ye.length-(Er||1)].first_line,last_line:ye[ye.length-1].last_line,first_column:ye[ye.length-(Er||1)].first_column,last_column:ye[ye.length-1].last_column},xt&&(jt._$.range=[ye[ye.length-(Er||1)].range[0],ye[ye.length-1].range[1]]),xn=this.performAction.apply(jt,[ze,gt,Ze,je.yy,St[1],Me,ye].concat(Je)),typeof xn<"u")return xn;Er&&(Ae=Ae.slice(0,-1*Er*2),Me=Me.slice(0,-1*Er),ye=ye.slice(0,-1*Er)),Ae.push(this.productions_[St[1]][0]),Me.push(jt.$),ye.push(jt._$),Kn=He[Ae[Ae.length-2]][Ae[Ae.length-1]],Ae.push(Kn);break;case 3:return!0}}return!0},"parse")},ne=function(){var we={EOF:1,parseError:o(function(Ce,Ae){if(this.yy.parser)this.yy.parser.parseError(Ce,Ae);else throw new Error(Ce)},"parseError"),setInput:o(function(Te,Ce){return this.yy=Ce||this.yy||{},this._input=Te,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var Te=this._input[0];this.yytext+=Te,this.yyleng++,this.offset++,this.match+=Te,this.matched+=Te;var Ce=Te.match(/(?:\r\n?|\n).*/g);return Ce?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Te},"input"),unput:o(function(Te){var Ce=Te.length,Ae=Te.split(/(?:\r\n?|\n)/g);this._input=Te+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ce),this.offset-=Ce;var Ge=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),Ae.length-1&&(this.yylineno-=Ae.length-1);var Me=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Ae?(Ae.length===Ge.length?this.yylloc.first_column:0)+Ge[Ge.length-Ae.length].length-Ae[0].length:this.yylloc.first_column-Ce},this.options.ranges&&(this.yylloc.range=[Me[0],Me[0]+this.yyleng-Ce]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(Te){this.unput(this.match.slice(Te))},"less"),pastInput:o(function(){var Te=this.matched.substr(0,this.matched.length-this.match.length);return(Te.length>20?"...":"")+Te.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var Te=this.match;return Te.length<20&&(Te+=this._input.substr(0,20-Te.length)),(Te.substr(0,20)+(Te.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var Te=this.pastInput(),Ce=new Array(Te.length+1).join("-");return Te+this.upcomingInput()+` +`+Ce+"^"},"showPosition"),test_match:o(function(Te,Ce){var Ae,Ge,Me;if(this.options.backtrack_lexer&&(Me={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},this.options.ranges&&(Me.yylloc.range=this.yylloc.range.slice(0))),Ge=Te[0].match(/(?:\r\n?|\n).*/g),Ge&&(this.yylineno+=Ge.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Ge?Ge[Ge.length-1].length-Ge[Ge.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Te[0].length},this.yytext+=Te[0],this.match+=Te[0],this.matches=Te,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Te[0].length),this.matched+=Te[0],Ae=this.performAction.call(this,this.yy,this,Ce,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Ae)return Ae;if(this._backtrack){for(var ye in Me)this[ye]=Me[ye];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Te,Ce,Ae,Ge;this._more||(this.yytext="",this.match="");for(var Me=this._currentRules(),ye=0;yeCe[0].length)){if(Ce=Ae,Ge=ye,this.options.backtrack_lexer){if(Te=this.test_match(Ae,Me[ye]),Te!==!1)return Te;if(this._backtrack){Ce=!1;continue}else return!1}else if(!this.options.flex)break}return Ce?(Te=this.test_match(Ce,Me[Ge]),Te!==!1?Te:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var Ce=this.next();return Ce||this.lex()},"lex"),begin:o(function(Ce){this.conditionStack.push(Ce)},"begin"),popState:o(function(){var Ce=this.conditionStack.length-1;return Ce>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(Ce){return Ce=this.conditionStack.length-1-Math.abs(Ce||0),Ce>=0?this.conditionStack[Ce]:"INITIAL"},"topState"),pushState:o(function(Ce){this.begin(Ce)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(Ce,Ae,Ge,Me){var ye=Me;switch(Ge){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;break;case 5:return this.popState(),"title_value";break;case 6:return this.begin("acc_title"),37;break;case 7:return this.popState(),"acc_title_value";break;case 8:return this.begin("acc_descr"),39;break;case 9:return this.popState(),"acc_descr_value";break;case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;break;case 29:return this.begin("point_start"),44;break;case 30:return this.begin("point_x"),45;break;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;break;case 34:return 28;case 35:return 4;case 36:return 11;case 37:return 64;case 38:return 10;case 39:return 65;case 40:return 65;case 41:return 14;case 42:return 13;case 43:return 67;case 44:return 66;case 45:return 12;case 46:return 8;case 47:return 5;case 48:return 18;case 49:return 56;case 50:return 63;case 51:return 57}},"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:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},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:!0}}};return we}();he.lexer=ne;function ae(){this.yy={}}return o(ae,"Parser"),ae.prototype=he,he.Parser=ae,new ae}();XI.parser=XI;$ce=XI});var os,uE,Uce=R(()=>{"use strict";Zt();sl();ut();jb();os=hp(),uE=class{constructor(){this.classes=new Map;this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}static{o(this,"QuadrantBuilder")}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:mr.quadrantChart?.chartWidth||500,chartWidth:mr.quadrantChart?.chartHeight||500,titlePadding:mr.quadrantChart?.titlePadding||10,titleFontSize:mr.quadrantChart?.titleFontSize||20,quadrantPadding:mr.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:mr.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:mr.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:mr.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:mr.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:mr.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:mr.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:mr.quadrantChart?.pointTextPadding||5,pointLabelFontSize:mr.quadrantChart?.pointLabelFontSize||12,pointRadius:mr.quadrantChart?.pointRadius||5,xAxisPosition:mr.quadrantChart?.xAxisPosition||"top",yAxisPosition:mr.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:mr.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:mr.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:os.quadrant1Fill,quadrant2Fill:os.quadrant2Fill,quadrant3Fill:os.quadrant3Fill,quadrant4Fill:os.quadrant4Fill,quadrant1TextFill:os.quadrant1TextFill,quadrant2TextFill:os.quadrant2TextFill,quadrant3TextFill:os.quadrant3TextFill,quadrant4TextFill:os.quadrant4TextFill,quadrantPointFill:os.quadrantPointFill,quadrantPointTextFill:os.quadrantPointTextFill,quadrantXAxisTextFill:os.quadrantXAxisTextFill,quadrantYAxisTextFill:os.quadrantYAxisTextFill,quadrantTitleFill:os.quadrantTitleFill,quadrantInternalBorderStrokeFill:os.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:os.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,V.info("clear called")}setData(e){this.data={...this.data,...e}}addPoints(e){this.data.points=[...e,...this.data.points]}addClass(e,r){this.classes.set(e,r)}setConfig(e){V.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){V.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,r,n,i){let a=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,s={top:e==="top"&&r?a:0,bottom:e==="bottom"&&r?a:0},l=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,u={left:this.config.yAxisPosition==="left"&&n?l:0,right:this.config.yAxisPosition==="right"&&n?l:0},h=this.config.titleFontSize+this.config.titlePadding*2,f={top:i?h:0},d=this.config.quadrantPadding+u.left,p=this.config.quadrantPadding+s.top+f.top,m=this.config.chartWidth-this.config.quadrantPadding*2-u.left-u.right,g=this.config.chartHeight-this.config.quadrantPadding*2-s.top-s.bottom-f.top,y=m/2,v=g/2;return{xAxisSpace:s,yAxisSpace:u,titleSpace:f,quadrantSpace:{quadrantLeft:d,quadrantTop:p,quadrantWidth:m,quadrantHalfWidth:y,quadrantHeight:g,quadrantHalfHeight:v}}}getAxisLabels(e,r,n,i){let{quadrantSpace:a,titleSpace:s}=i,{quadrantHalfHeight:l,quadrantHeight:u,quadrantLeft:h,quadrantHalfWidth:f,quadrantTop:d,quadrantWidth:p}=a,m=!!this.data.xAxisRightText,g=!!this.data.yAxisTopText,y=[];return this.data.xAxisLeftText&&r&&y.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:h+(m?f/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+u+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:m?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&r&&y.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:h+f+(m?f/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+u+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:m?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&n&&y.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+h+p+this.config.quadrantPadding,y:d+u-(g?l/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&n&&y.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+h+p+this.config.quadrantPadding,y:d+l-(g?l/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),y}getQuadrants(e){let{quadrantSpace:r}=e,{quadrantHalfHeight:n,quadrantLeft:i,quadrantHalfWidth:a,quadrantTop:s}=r,l=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s,width:a,height:n,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:i,y:s,width:a,height:n,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:i,y:s+n,width:a,height:n,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:i+a,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant4Fill}];for(let u of l)u.text.x=u.x+u.width/2,this.data.points.length===0?(u.text.y=u.y+u.height/2,u.text.horizontalPos="middle"):(u.text.y=u.y+this.config.quadrantTextTopPadding,u.text.horizontalPos="top");return l}getQuadrantPoints(e){let{quadrantSpace:r}=e,{quadrantHeight:n,quadrantLeft:i,quadrantTop:a,quadrantWidth:s}=r,l=gl().domain([0,1]).range([i,s+i]),u=gl().domain([0,1]).range([n+a,a]);return this.data.points.map(f=>{let d=this.classes.get(f.className);return d&&(f={...d,...f}),{x:l(f.x),y:u(f.y),fill:f.color??this.themeConfig.quadrantPointFill,radius:f.radius??this.config.pointRadius,text:{text:f.text,fill:this.themeConfig.quadrantPointTextFill,x:l(f.x),y:u(f.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:f.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:f.strokeWidth??"0px"}})}getBorders(e){let r=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=e,{quadrantHalfHeight:i,quadrantHeight:a,quadrantLeft:s,quadrantHalfWidth:l,quadrantTop:u,quadrantWidth:h}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:u,x2:s+h+r,y2:u},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s+h,y1:u+r,x2:s+h,y2:u+a-r},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:u+a,x2:s+h+r,y2:u+a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s,y1:u+r,x2:s,y2:u+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+l,y1:u+r,x2:s+l,y2:u+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+r,y1:u+i,x2:s+h-r,y2:u+i}]}getTitle(e){if(e)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}}build(){let e=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),r=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,i=this.data.points.length>0?"bottom":this.config.xAxisPosition,a=this.calculateSpace(i,e,r,n);return{points:this.getQuadrantPoints(a),quadrants:this.getQuadrants(a),axisLabels:this.getAxisLabels(i,e,r,a),borderLines:this.getBorders(a),title:this.getTitle(n)}}}});function jI(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}function Hce(t){return!/^\d+$/.test(t)}function Yce(t){return!/^\d+px$/.test(t)}var S0,Wce=R(()=>{"use strict";S0=class extends Error{static{o(this,"InvalidStyleError")}constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}};o(jI,"validateHexCode");o(Hce,"validateNumber");o(Yce,"validateSizeInPixels")});function Wu(t){return qr(t.trim(),YFe)}function WFe(t){wa.setData({quadrant1Text:Wu(t.text)})}function qFe(t){wa.setData({quadrant2Text:Wu(t.text)})}function XFe(t){wa.setData({quadrant3Text:Wu(t.text)})}function jFe(t){wa.setData({quadrant4Text:Wu(t.text)})}function KFe(t){wa.setData({xAxisLeftText:Wu(t.text)})}function QFe(t){wa.setData({xAxisRightText:Wu(t.text)})}function ZFe(t){wa.setData({yAxisTopText:Wu(t.text)})}function JFe(t){wa.setData({yAxisBottomText:Wu(t.text)})}function KI(t){let e={};for(let r of t){let[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(Hce(i))throw new S0(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(jI(i))throw new S0(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(jI(i))throw new S0(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(Yce(i))throw new S0(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}function eze(t,e,r,n,i){let a=KI(i);wa.addPoints([{x:r,y:n,text:Wu(t.text),className:e,...a}])}function tze(t,e){wa.addClass(t,KI(e))}function rze(t){wa.setConfig({chartWidth:t})}function nze(t){wa.setConfig({chartHeight:t})}function ize(){let t=de(),{themeVariables:e,quadrantChart:r}=t;return r&&wa.setConfig(r),wa.setThemeConfig({quadrant1Fill:e.quadrant1Fill,quadrant2Fill:e.quadrant2Fill,quadrant3Fill:e.quadrant3Fill,quadrant4Fill:e.quadrant4Fill,quadrant1TextFill:e.quadrant1TextFill,quadrant2TextFill:e.quadrant2TextFill,quadrant3TextFill:e.quadrant3TextFill,quadrant4TextFill:e.quadrant4TextFill,quadrantPointFill:e.quadrantPointFill,quadrantPointTextFill:e.quadrantPointTextFill,quadrantXAxisTextFill:e.quadrantXAxisTextFill,quadrantYAxisTextFill:e.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:e.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:e.quadrantInternalBorderStrokeFill,quadrantTitleFill:e.quadrantTitleFill}),wa.setData({titleText:Xr()}),wa.build()}var YFe,wa,aze,qce,Xce=R(()=>{"use strict";_t();rr();bi();Uce();Wce();YFe=de();o(Wu,"textSanitizer");wa=new uE;o(WFe,"setQuadrant1Text");o(qFe,"setQuadrant2Text");o(XFe,"setQuadrant3Text");o(jFe,"setQuadrant4Text");o(KFe,"setXAxisLeftText");o(QFe,"setXAxisRightText");o(ZFe,"setYAxisTopText");o(JFe,"setYAxisBottomText");o(KI,"parseStyles");o(eze,"addPoint");o(tze,"addClass");o(rze,"setWidth");o(nze,"setHeight");o(ize,"getQuadrantData");aze=o(function(){wa.clear(),vr()},"clear"),qce={setWidth:rze,setHeight:nze,setQuadrant1Text:WFe,setQuadrant2Text:qFe,setQuadrant3Text:XFe,setQuadrant4Text:jFe,setXAxisLeftText:KFe,setXAxisRightText:QFe,setYAxisTopText:ZFe,setYAxisBottomText:JFe,parseStyles:KI,addPoint:eze,addClass:tze,getQuadrantData:ize,clear:aze,setAccTitle:kr,getAccTitle:Ar,setDiagramTitle:nn,getDiagramTitle:Xr,getAccDescription:Lr,setAccDescription:_r}});var sze,jce,Kce=R(()=>{"use strict";Zt();_t();ut();Yn();sze=o((t,e,r,n)=>{function i(A){return A==="top"?"hanging":"middle"}o(i,"getDominantBaseLine");function a(A){return A==="left"?"start":"middle"}o(a,"getTextAnchor");function s(A){return`translate(${A.x}, ${A.y}) rotate(${A.rotation||0})`}o(s,"getTransformation");let l=de();V.debug(`Rendering quadrant chart +`+t);let u=l.securityLevel,h;u==="sandbox"&&(h=$e("#i"+e));let d=(u==="sandbox"?$e(h.nodes()[0].contentDocument.body):$e("body")).select(`[id="${e}"]`),p=d.append("g").attr("class","main"),m=l.quadrantChart?.chartWidth??500,g=l.quadrantChart?.chartHeight??500;Sr(d,g,m,l.quadrantChart?.useMaxWidth??!0),d.attr("viewBox","0 0 "+m+" "+g),n.db.setHeight(g),n.db.setWidth(m);let y=n.db.getQuadrantData(),v=p.append("g").attr("class","quadrants"),x=p.append("g").attr("class","border"),b=p.append("g").attr("class","data-points"),w=p.append("g").attr("class","labels"),S=p.append("g").attr("class","title");y.title&&S.append("text").attr("x",0).attr("y",0).attr("fill",y.title.fill).attr("font-size",y.title.fontSize).attr("dominant-baseline",i(y.title.horizontalPos)).attr("text-anchor",a(y.title.verticalPos)).attr("transform",s(y.title)).text(y.title.text),y.borderLines&&x.selectAll("line").data(y.borderLines).enter().append("line").attr("x1",A=>A.x1).attr("y1",A=>A.y1).attr("x2",A=>A.x2).attr("y2",A=>A.y2).style("stroke",A=>A.strokeFill).style("stroke-width",A=>A.strokeWidth);let T=v.selectAll("g.quadrant").data(y.quadrants).enter().append("g").attr("class","quadrant");T.append("rect").attr("x",A=>A.x).attr("y",A=>A.y).attr("width",A=>A.width).attr("height",A=>A.height).attr("fill",A=>A.fill),T.append("text").attr("x",0).attr("y",0).attr("fill",A=>A.text.fill).attr("font-size",A=>A.text.fontSize).attr("dominant-baseline",A=>i(A.text.horizontalPos)).attr("text-anchor",A=>a(A.text.verticalPos)).attr("transform",A=>s(A.text)).text(A=>A.text.text),w.selectAll("g.label").data(y.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(A=>A.text).attr("fill",A=>A.fill).attr("font-size",A=>A.fontSize).attr("dominant-baseline",A=>i(A.horizontalPos)).attr("text-anchor",A=>a(A.verticalPos)).attr("transform",A=>s(A));let _=b.selectAll("g.data-point").data(y.points).enter().append("g").attr("class","data-point");_.append("circle").attr("cx",A=>A.x).attr("cy",A=>A.y).attr("r",A=>A.radius).attr("fill",A=>A.fill).attr("stroke",A=>A.strokeColor).attr("stroke-width",A=>A.strokeWidth),_.append("text").attr("x",0).attr("y",0).text(A=>A.text.text).attr("fill",A=>A.text.fill).attr("font-size",A=>A.text.fontSize).attr("dominant-baseline",A=>i(A.text.horizontalPos)).attr("text-anchor",A=>a(A.text.verticalPos)).attr("transform",A=>s(A.text))},"draw"),jce={draw:sze}});var Qce={};hr(Qce,{diagram:()=>oze});var oze,Zce=R(()=>{"use strict";Vce();Xce();Kce();oze={parser:$ce,db:qce,renderer:jce,styles:o(()=>"","styles")}});var QI,tue,rue=R(()=>{"use strict";QI=function(){var t=o(function(O,D,P,F){for(P=P||{},F=O.length;F--;P[O[F]]=D);return P},"o"),e=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],a=[1,6],s=[1,7],l=[1,5,10,12,14,16,18,19,21,23,34,35,36],u=[1,25],h=[1,26],f=[1,28],d=[1,29],p=[1,30],m=[1,31],g=[1,32],y=[1,33],v=[1,34],x=[1,35],b=[1,36],w=[1,37],S=[1,43],T=[1,42],E=[1,47],_=[1,50],A=[1,10,12,14,16,18,19,21,23,34,35,36],L=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],M=[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],N=[1,64],k={trace:o(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:o(function(D,P,F,B,$,z,Y){var Q=z.length-1;switch($){case 5:B.setOrientation(z[Q]);break;case 9:B.setDiagramTitle(z[Q].text.trim());break;case 12:B.setLineData({text:"",type:"text"},z[Q]);break;case 13:B.setLineData(z[Q-1],z[Q]);break;case 14:B.setBarData({text:"",type:"text"},z[Q]);break;case 15:B.setBarData(z[Q-1],z[Q]);break;case 16:this.$=z[Q].trim(),B.setAccTitle(this.$);break;case 17:case 18:this.$=z[Q].trim(),B.setAccDescription(this.$);break;case 19:this.$=z[Q-1];break;case 20:this.$=[Number(z[Q-2]),...z[Q]];break;case 21:this.$=[Number(z[Q])];break;case 22:B.setXAxisTitle(z[Q]);break;case 23:B.setXAxisTitle(z[Q-1]);break;case 24:B.setXAxisTitle({type:"text",text:""});break;case 25:B.setXAxisBand(z[Q]);break;case 26:B.setXAxisRangeData(Number(z[Q-2]),Number(z[Q]));break;case 27:this.$=z[Q-1];break;case 28:this.$=[z[Q-2],...z[Q]];break;case 29:this.$=[z[Q]];break;case 30:B.setYAxisTitle(z[Q]);break;case 31:B.setYAxisTitle(z[Q-1]);break;case 32:B.setYAxisTitle({type:"text",text:""});break;case 33:B.setYAxisRangeData(Number(z[Q-2]),Number(z[Q]));break;case 37:this.$={text:z[Q],type:"text"};break;case 38:this.$={text:z[Q],type:"text"};break;case 39:this.$={text:z[Q],type:"markdown"};break;case 40:this.$=z[Q];break;case 41:this.$=z[Q-1]+""+z[Q];break}},"anonymous"),table:[t(e,r,{3:1,4:2,7:4,5:n,34:i,35:a,36:s}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,34:i,35:a,36:s}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],34:i,35:a,36:s}),{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]},t(l,[2,34]),t(l,[2,35]),t(l,[2,36]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,34:i,35:a,36:s}),{1:[2,3]},t(l,[2,5]),t(e,[2,7],{4:22,34:i,35:a,36:s}),{11:23,37:24,38:u,39:h,40:27,41:f,42:d,43:p,44:m,45:g,46:y,47:v,48:x,49:b,50:w},{11:39,13:38,24:S,27:T,29:40,30:41,37:24,38:u,39:h,40:27,41:f,42:d,43:p,44:m,45:g,46:y,47:v,48:x,49:b,50:w},{11:45,15:44,27:E,33:46,37:24,38:u,39:h,40:27,41:f,42:d,43:p,44:m,45:g,46:y,47:v,48:x,49:b,50:w},{11:49,17:48,24:_,37:24,38:u,39:h,40:27,41:f,42:d,43:p,44:m,45:g,46:y,47:v,48:x,49:b,50:w},{11:52,17:51,24:_,37:24,38:u,39:h,40:27,41:f,42:d,43:p,44:m,45:g,46:y,47:v,48:x,49:b,50:w},{20:[1,53]},{22:[1,54]},t(A,[2,18]),{1:[2,2]},t(A,[2,8]),t(A,[2,9]),t(L,[2,37],{40:55,41:f,42:d,43:p,44:m,45:g,46:y,47:v,48:x,49:b,50:w}),t(L,[2,38]),t(L,[2,39]),t(M,[2,40]),t(M,[2,42]),t(M,[2,43]),t(M,[2,44]),t(M,[2,45]),t(M,[2,46]),t(M,[2,47]),t(M,[2,48]),t(M,[2,49]),t(M,[2,50]),t(M,[2,51]),t(A,[2,10]),t(A,[2,22],{30:41,29:56,24:S,27:T}),t(A,[2,24]),t(A,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:u,39:h,40:27,41:f,42:d,43:p,44:m,45:g,46:y,47:v,48:x,49:b,50:w},t(A,[2,11]),t(A,[2,30],{33:60,27:E}),t(A,[2,32]),{31:[1,61]},t(A,[2,12]),{17:62,24:_},{25:63,27:N},t(A,[2,14]),{17:65,24:_},t(A,[2,16]),t(A,[2,17]),t(M,[2,41]),t(A,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(A,[2,31]),{27:[1,69]},t(A,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(A,[2,15]),t(A,[2,26]),t(A,[2,27]),{11:59,32:72,37:24,38:u,39:h,40:27,41:f,42:d,43:p,44:m,45:g,46:y,47:v,48:x,49:b,50:w},t(A,[2,33]),t(A,[2,19]),{25:73,27:N},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:o(function(D,P){if(P.recoverable)this.trace(D);else{var F=new Error(D);throw F.hash=P,F}},"parseError"),parse:o(function(D){var P=this,F=[0],B=[],$=[null],z=[],Y=this.table,Q="",X=0,ie=0,j=0,J=2,Z=1,H=z.slice.call(arguments,1),q=Object.create(this.lexer),K={yy:{}};for(var se in this.yy)Object.prototype.hasOwnProperty.call(this.yy,se)&&(K.yy[se]=this.yy[se]);q.setInput(D,K.yy),K.yy.lexer=q,K.yy.parser=this,typeof q.yylloc>"u"&&(q.yylloc={});var ce=q.yylloc;z.push(ce);var ue=q.options&&q.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function te(he){F.length=F.length-2*he,$.length=$.length-he,z.length=z.length-he}o(te,"popStack");function De(){var he;return he=B.pop()||q.lex()||Z,typeof he!="number"&&(he instanceof Array&&(B=he,he=B.pop()),he=P.symbols_[he]||he),he}o(De,"lex");for(var oe,ke,Ie,Se,Ue,Pe,_e={},me,W,fe,ge;;){if(Ie=F[F.length-1],this.defaultActions[Ie]?Se=this.defaultActions[Ie]:((oe===null||typeof oe>"u")&&(oe=De()),Se=Y[Ie]&&Y[Ie][oe]),typeof Se>"u"||!Se.length||!Se[0]){var re="";ge=[];for(me in Y[Ie])this.terminals_[me]&&me>J&&ge.push("'"+this.terminals_[me]+"'");q.showPosition?re="Parse error on line "+(X+1)+`: +`+q.showPosition()+` +Expecting `+ge.join(", ")+", got '"+(this.terminals_[oe]||oe)+"'":re="Parse error on line "+(X+1)+": Unexpected "+(oe==Z?"end of input":"'"+(this.terminals_[oe]||oe)+"'"),this.parseError(re,{text:q.match,token:this.terminals_[oe]||oe,line:q.yylineno,loc:ce,expected:ge})}if(Se[0]instanceof Array&&Se.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ie+", token: "+oe);switch(Se[0]){case 1:F.push(oe),$.push(q.yytext),z.push(q.yylloc),F.push(Se[1]),oe=null,ke?(oe=ke,ke=null):(ie=q.yyleng,Q=q.yytext,X=q.yylineno,ce=q.yylloc,j>0&&j--);break;case 2:if(W=this.productions_[Se[1]][1],_e.$=$[$.length-W],_e._$={first_line:z[z.length-(W||1)].first_line,last_line:z[z.length-1].last_line,first_column:z[z.length-(W||1)].first_column,last_column:z[z.length-1].last_column},ue&&(_e._$.range=[z[z.length-(W||1)].range[0],z[z.length-1].range[1]]),Pe=this.performAction.apply(_e,[Q,ie,X,K.yy,Se[1],$,z].concat(H)),typeof Pe<"u")return Pe;W&&(F=F.slice(0,-1*W*2),$=$.slice(0,-1*W),z=z.slice(0,-1*W)),F.push(this.productions_[Se[1]][0]),$.push(_e.$),z.push(_e._$),fe=Y[F[F.length-2]][F[F.length-1]],F.push(fe);break;case 3:return!0}}return!0},"parse")},I=function(){var O={EOF:1,parseError:o(function(P,F){if(this.yy.parser)this.yy.parser.parseError(P,F);else throw new Error(P)},"parseError"),setInput:o(function(D,P){return this.yy=P||this.yy||{},this._input=D,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var D=this._input[0];this.yytext+=D,this.yyleng++,this.offset++,this.match+=D,this.matched+=D;var P=D.match(/(?:\r\n?|\n).*/g);return P?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),D},"input"),unput:o(function(D){var P=D.length,F=D.split(/(?:\r\n?|\n)/g);this._input=D+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-P),this.offset-=P;var B=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),F.length-1&&(this.yylineno-=F.length-1);var $=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:F?(F.length===B.length?this.yylloc.first_column:0)+B[B.length-F.length].length-F[0].length:this.yylloc.first_column-P},this.options.ranges&&(this.yylloc.range=[$[0],$[0]+this.yyleng-P]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(D){this.unput(this.match.slice(D))},"less"),pastInput:o(function(){var D=this.matched.substr(0,this.matched.length-this.match.length);return(D.length>20?"...":"")+D.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var D=this.match;return D.length<20&&(D+=this._input.substr(0,20-D.length)),(D.substr(0,20)+(D.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var D=this.pastInput(),P=new Array(D.length+1).join("-");return D+this.upcomingInput()+` +`+P+"^"},"showPosition"),test_match:o(function(D,P){var F,B,$;if(this.options.backtrack_lexer&&($={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},this.options.ranges&&($.yylloc.range=this.yylloc.range.slice(0))),B=D[0].match(/(?:\r\n?|\n).*/g),B&&(this.yylineno+=B.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:B?B[B.length-1].length-B[B.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+D[0].length},this.yytext+=D[0],this.match+=D[0],this.matches=D,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(D[0].length),this.matched+=D[0],F=this.performAction.call(this,this.yy,this,P,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),F)return F;if(this._backtrack){for(var z in $)this[z]=$[z];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var D,P,F,B;this._more||(this.yytext="",this.match="");for(var $=this._currentRules(),z=0;z<$.length;z++)if(F=this._input.match(this.rules[$[z]]),F&&(!P||F[0].length>P[0].length)){if(P=F,B=z,this.options.backtrack_lexer){if(D=this.test_match(F,$[z]),D!==!1)return D;if(this._backtrack){P=!1;continue}else return!1}else if(!this.options.flex)break}return P?(D=this.test_match(P,$[B]),D!==!1?D:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var P=this.next();return P||this.lex()},"lex"),begin:o(function(P){this.conditionStack.push(P)},"begin"),popState:o(function(){var P=this.conditionStack.length-1;return P>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(P){return P=this.conditionStack.length-1-Math.abs(P||0),P>=0?this.conditionStack[P]:"INITIAL"},"topState"),pushState:o(function(P){this.begin(P)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(P,F,B,$){var z=$;switch(B){case 0:break;case 1:break;case 2:return this.popState(),34;break;case 3:return this.popState(),34;break;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.pushState("acc_descr"),21;break;case 10:return this.popState(),"acc_descr_value";break;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:return this.pushState("axis_data"),"X_AXIS";break;case 17:return this.pushState("axis_data"),"Y_AXIS";break;case 18:return this.pushState("axis_band_data"),24;break;case 19:return 31;case 20:return this.pushState("data"),16;break;case 21:return this.pushState("data"),18;break;case 22:return this.pushState("data_inner"),24;break;case 23:return 27;case 24:return this.popState(),26;break;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}},"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:!0},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:!0},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:!0},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:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[27,28],inclusive:!1},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:!0}}};return O}();k.lexer=I;function C(){this.yy={}}return o(C,"Parser"),C.prototype=k,k.Parser=C,new C}();QI.parser=QI;tue=QI});function ZI(t){return t.type==="bar"}function hE(t){return t.type==="band"}function Ng(t){return t.type==="linear"}var fE=R(()=>{"use strict";o(ZI,"isBarPlot");o(hE,"isBandAxisData");o(Ng,"isLinearAxisData")});var Mg,JI=R(()=>{"use strict";Al();Mg=class{constructor(e){this.parentGroup=e}static{o(this,"TextDimensionCalculatorWithFont")}getMaxDimension(e,r){if(!this.parentGroup)return{width:e.reduce((a,s)=>Math.max(s.length,a),0)*r,height:r};let n={width:0,height:0},i=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",r);for(let a of e){let s=bj(i,1,a),l=s?s.width:a.length*r,u=s?s.height:r;n.width=Math.max(n.width,l),n.height=Math.max(n.height,u)}return i.remove(),n}}});var Ig,eO=R(()=>{"use strict";Ig=class{constructor(e,r,n,i){this.axisConfig=e;this.title=r;this.textDimensionCalculator=n;this.axisThemeConfig=i;this.boundingRect={x:0,y:0,width:0,height:0};this.axisPosition="left";this.showTitle=!1;this.showLabel=!1;this.showTick=!1;this.showAxisLine=!1;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{o(this,"BaseAxis")}setRange(e){this.range=e,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){.7*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(.7*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let r=e.height;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),i=.2*e.width;this.outerPadding=Math.min(n.width/2,i);let a=n.height+this.axisConfig.labelPadding*2;this.labelTextHeight=n.height,a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-r}calculateSpaceIfDrawnVertical(e){let r=e.width;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),i=.2*e.height;this.outerPadding=Math.min(n.height/2,i);let a=n.width+this.axisConfig.labelPadding*2;a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width-r,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let r=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${r},${this.boundingRect.y} L ${r},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(r=>({text:r.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(r),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){let r=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${r},${this.getScaleValue(n)} L ${r-this.axisConfig.tickLength},${this.getScaleValue(n)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.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"}]}),e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let r=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),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"}))}),this.showTick){let r=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r} L ${this.getScaleValue(n)},${r+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.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"}]}),e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let r=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),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"}))}),this.showTick){let r=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(n)},${r+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.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"}]}),e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}}});var dE,nue=R(()=>{"use strict";Zt();ut();eO();dE=class extends Ig{static{o(this,"BandAxis")}constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=Op().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=Op().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),V.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}}});var pE,iue=R(()=>{"use strict";Zt();eO();pE=class extends Ig{static{o(this,"LinearAxis")}constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=gl().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=gl().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}}});function tO(t,e,r,n){let i=new Mg(n);return hE(t)?new dE(e,r,t.categories,t.title,i):new pE(e,r,[t.min,t.max],t.title,i)}var aue=R(()=>{"use strict";fE();JI();nue();iue();o(tO,"getAxis")});function sue(t,e,r,n){let i=new Mg(n);return new rO(i,t,e,r)}var rO,oue=R(()=>{"use strict";JI();rO=class{constructor(e,r,n,i){this.textDimensionCalculator=e;this.chartConfig=r;this.chartData=n;this.chartThemeConfig=i;this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{o(this,"ChartTitle")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let r=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(r.width,e.width),i=r.height+2*this.chartConfig.titlePadding;return r.width<=n&&r.height<=i&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=i,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let e=[];return this.showChartTitle&&e.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}]}),e}};o(sue,"getChartTitleComponent")});var mE,lue=R(()=>{"use strict";Zt();mE=class{constructor(e,r,n,i,a){this.plotData=e;this.xAxis=r;this.yAxis=n;this.orientation=i;this.plotIndex=a}static{o(this,"LinePlot")}getDrawableElement(){let e=this.plotData.data.map(n=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),r;return this.orientation==="horizontal"?r=ha().y(n=>n[0]).x(n=>n[1])(e):r=ha().x(n=>n[0]).y(n=>n[1])(e),r?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:r,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}}});var gE,cue=R(()=>{"use strict";gE=class{constructor(e,r,n,i,a,s){this.barData=e;this.boundingRect=r;this.xAxis=n;this.yAxis=i;this.orientation=a;this.plotIndex=s}static{o(this,"BarPlot")}getDrawableElement(){let e=this.barData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),n=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),i=n/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:this.boundingRect.x,y:a[0]-i,height:n,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:a[0]-i,y:a[1],width:n,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}}});function uue(t,e,r){return new nO(t,e,r)}var nO,hue=R(()=>{"use strict";lue();cue();nO=class{constructor(e,r,n){this.chartConfig=e;this.chartData=r;this.chartThemeConfig=n;this.boundingRect={x:0,y:0,width:0,height:0}}static{o(this,"BasePlot")}setAxes(e,r){this.xAxis=e,this.yAxis=r}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");let e=[];for(let[r,n]of this.chartData.plots.entries())switch(n.type){case"line":{let i=new mE(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{let i=new gE(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}};o(uue,"getPlotComponent")});var yE,fue=R(()=>{"use strict";aue();oue();hue();fE();yE=class{constructor(e,r,n,i){this.chartConfig=e;this.chartData=r;this.componentStore={title:sue(e,r,n,i),plot:uue(e,r,n),xAxis:tO(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:tO(r.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},i)}}static{o(this,"Orchestrator")}calculateVerticalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:a,height:s});e-=l.width,r-=l.height,l=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),i=l.height,r-=l.height,this.componentStore.xAxis.setAxisPosition("bottom"),l=this.componentStore.xAxis.calculateSpace({width:e,height:r}),r-=l.height,this.componentStore.yAxis.setAxisPosition("left"),l=this.componentStore.yAxis.calculateSpace({width:e,height:r}),n=l.width,e-=l.width,e>0&&(a+=e,e=0),r>0&&(s+=r,r=0),this.componentStore.plot.calculateSpace({width:a,height:s}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.xAxis.setRange([n,n+a]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:i+s}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(u=>ZI(u))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=0,s=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),l=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),u=this.componentStore.plot.calculateSpace({width:s,height:l});e-=u.width,r-=u.height,u=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),n=u.height,r-=u.height,this.componentStore.xAxis.setAxisPosition("left"),u=this.componentStore.xAxis.calculateSpace({width:e,height:r}),e-=u.width,i=u.width,this.componentStore.yAxis.setAxisPosition("top"),u=this.componentStore.yAxis.calculateSpace({width:e,height:r}),r-=u.height,a=n+u.height,e>0&&(s+=e,e=0),r>0&&(l+=r,r=0),this.componentStore.plot.calculateSpace({width:s,height:l}),this.componentStore.plot.setBoundingBoxXY({x:i,y:a}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:i,y:n}),this.componentStore.xAxis.setRange([a,a+l]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(h=>ZI(h))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let r of Object.values(this.componentStore))e.push(...r.getDrawableElements());return e}}});var vE,due=R(()=>{"use strict";fue();vE=class{static{o(this,"XYChartBuilder")}static build(e,r,n,i){return new yE(e,r,n,i).getDrawableElement()}}});function mue(){let t=hp(),e=Or();return Ts(t.xyChart,e.themeVariables.xyChart)}function gue(){let t=Or();return Ts(mr.xyChart,t.xyChart)}function yue(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function sO(t){let e=Or();return qr(t.trim(),e)}function hze(t){pue=t}function fze(t){t==="horizontal"?px.chartOrientation="horizontal":px.chartOrientation="vertical"}function dze(t){sn.xAxis.title=sO(t.text)}function vue(t,e){sn.xAxis={type:"linear",title:sn.xAxis.title,min:t,max:e},xE=!0}function pze(t){sn.xAxis={type:"band",title:sn.xAxis.title,categories:t.map(e=>sO(e.text))},xE=!0}function mze(t){sn.yAxis.title=sO(t.text)}function gze(t,e){sn.yAxis={type:"linear",title:sn.yAxis.title,min:t,max:e},aO=!0}function yze(t){let e=Math.min(...t),r=Math.max(...t),n=Ng(sn.yAxis)?sn.yAxis.min:1/0,i=Ng(sn.yAxis)?sn.yAxis.max:-1/0;sn.yAxis={type:"linear",title:sn.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}function xue(t){let e=[];if(t.length===0)return e;if(!xE){let r=Ng(sn.xAxis)?sn.xAxis.min:1/0,n=Ng(sn.xAxis)?sn.xAxis.max:-1/0;vue(Math.min(r,1),Math.max(n,t.length))}if(aO||yze(t),hE(sn.xAxis)&&(e=sn.xAxis.categories.map((r,n)=>[r,t[n]])),Ng(sn.xAxis)){let r=sn.xAxis.min,n=sn.xAxis.max,i=(n-r)/(t.length-1),a=[];for(let s=r;s<=n;s+=i)a.push(`${s}`);e=a.map((s,l)=>[s,t[l]])}return e}function bue(t){return iO[t===0?0:t%iO.length]}function vze(t,e){let r=xue(e);sn.plots.push({type:"line",strokeFill:bue(dx),strokeWidth:2,data:r}),dx++}function xze(t,e){let r=xue(e);sn.plots.push({type:"bar",fill:bue(dx),data:r}),dx++}function bze(){if(sn.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return sn.title=Xr(),vE.build(px,sn,mx,pue)}function wze(){return mx}function Tze(){return px}var dx,pue,px,mx,sn,iO,xE,aO,kze,wue,Tue=R(()=>{"use strict";qs();sl();jb();xr();rr();bi();due();fE();dx=0,px=gue(),mx=mue(),sn=yue(),iO=mx.plotColorPalette.split(",").map(t=>t.trim()),xE=!1,aO=!1;o(mue,"getChartDefaultThemeConfig");o(gue,"getChartDefaultConfig");o(yue,"getChartDefaultData");o(sO,"textSanitizer");o(hze,"setTmpSVGG");o(fze,"setOrientation");o(dze,"setXAxisTitle");o(vue,"setXAxisRangeData");o(pze,"setXAxisBand");o(mze,"setYAxisTitle");o(gze,"setYAxisRangeData");o(yze,"setYAxisRangeFromPlotData");o(xue,"transformDataWithoutCategory");o(bue,"getPlotColorFromPalette");o(vze,"setLineData");o(xze,"setBarData");o(bze,"getDrawableElem");o(wze,"getChartThemeConfig");o(Tze,"getChartConfig");kze=o(function(){vr(),dx=0,px=gue(),sn=yue(),mx=mue(),iO=mx.plotColorPalette.split(",").map(t=>t.trim()),xE=!1,aO=!1},"clear"),wue={getDrawableElem:bze,clear:kze,setAccTitle:kr,getAccTitle:Ar,setDiagramTitle:nn,getDiagramTitle:Xr,getAccDescription:Lr,setAccDescription:_r,setOrientation:fze,setXAxisTitle:dze,setXAxisRangeData:vue,setXAxisBand:pze,setYAxisTitle:mze,setYAxisRangeData:gze,setLineData:vze,setBarData:xze,setTmpSVGG:hze,getChartThemeConfig:wze,getChartConfig:Tze}});var Eze,kue,Eue=R(()=>{"use strict";ut();pf();Yn();Eze=o((t,e,r,n)=>{let i=n.db,a=i.getChartThemeConfig(),s=i.getChartConfig();function l(v){return v==="top"?"text-before-edge":"middle"}o(l,"getDominantBaseLine");function u(v){return v==="left"?"start":v==="right"?"end":"middle"}o(u,"getTextAnchor");function h(v){return`translate(${v.x}, ${v.y}) rotate(${v.rotation||0})`}o(h,"getTextTransformation"),V.debug(`Rendering xychart chart +`+t);let f=Ps(e),d=f.append("g").attr("class","main"),p=d.append("rect").attr("width",s.width).attr("height",s.height).attr("class","background");Sr(f,s.height,s.width,!0),f.attr("viewBox",`0 0 ${s.width} ${s.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(f.append("g").attr("class","mermaid-tmp-group"));let m=i.getDrawableElem(),g={};function y(v){let x=d,b="";for(let[w]of v.entries()){let S=d;w>0&&g[b]&&(S=g[b]),b+=v[w],x=g[b],x||(x=g[b]=S.append("g").attr("class",v[w]))}return x}o(y,"getGroup");for(let v of m){if(v.data.length===0)continue;let x=y(v.groupTexts);switch(v.type){case"rect":x.selectAll("rect").data(v.data).enter().append("rect").attr("x",b=>b.x).attr("y",b=>b.y).attr("width",b=>b.width).attr("height",b=>b.height).attr("fill",b=>b.fill).attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth);break;case"text":x.selectAll("text").data(v.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",b=>b.fill).attr("font-size",b=>b.fontSize).attr("dominant-baseline",b=>l(b.verticalPos)).attr("text-anchor",b=>u(b.horizontalPos)).attr("transform",b=>h(b)).text(b=>b.text);break;case"path":x.selectAll("path").data(v.data).enter().append("path").attr("d",b=>b.path).attr("fill",b=>b.fill?b.fill:"none").attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth);break}}},"draw"),kue={draw:Eze}});var Cue={};hr(Cue,{diagram:()=>Cze});var Cze,Sue=R(()=>{"use strict";rue();Tue();Eue();Cze={parser:tue,db:wue,renderer:kue}});var oO,Lue,Due=R(()=>{"use strict";oO=function(){var t=o(function(ie,j,J,Z){for(J=J||{},Z=ie.length;Z--;J[ie[Z]]=j);return J},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[5,6,8,9,11,13,31,32,33,34,35,36,44,62,63],s=[1,18],l=[2,7],u=[1,22],h=[1,23],f=[1,24],d=[1,25],p=[1,26],m=[1,27],g=[1,20],y=[1,28],v=[1,29],x=[62,63],b=[5,8,9,11,13,31,32,33,34,35,36,44,51,53,62,63],w=[1,47],S=[1,48],T=[1,49],E=[1,50],_=[1,51],A=[1,52],L=[1,53],M=[53,54],N=[1,64],k=[1,60],I=[1,61],C=[1,62],O=[1,63],D=[1,65],P=[1,69],F=[1,70],B=[1,67],$=[1,68],z=[5,8,9,11,13,31,32,33,34,35,36,44,62,63],Y={trace:o(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:o(function(j,J,Z,H,q,K,se){var ce=K.length-1;switch(q){case 4:this.$=K[ce].trim(),H.setAccTitle(this.$);break;case 5:case 6:this.$=K[ce].trim(),H.setAccDescription(this.$);break;case 7:this.$=[];break;case 13:H.addRequirement(K[ce-3],K[ce-4]);break;case 14:H.setNewReqId(K[ce-2]);break;case 15:H.setNewReqText(K[ce-2]);break;case 16:H.setNewReqRisk(K[ce-2]);break;case 17:H.setNewReqVerifyMethod(K[ce-2]);break;case 20:this.$=H.RequirementType.REQUIREMENT;break;case 21:this.$=H.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 22:this.$=H.RequirementType.INTERFACE_REQUIREMENT;break;case 23:this.$=H.RequirementType.PERFORMANCE_REQUIREMENT;break;case 24:this.$=H.RequirementType.PHYSICAL_REQUIREMENT;break;case 25:this.$=H.RequirementType.DESIGN_CONSTRAINT;break;case 26:this.$=H.RiskLevel.LOW_RISK;break;case 27:this.$=H.RiskLevel.MED_RISK;break;case 28:this.$=H.RiskLevel.HIGH_RISK;break;case 29:this.$=H.VerifyType.VERIFY_ANALYSIS;break;case 30:this.$=H.VerifyType.VERIFY_DEMONSTRATION;break;case 31:this.$=H.VerifyType.VERIFY_INSPECTION;break;case 32:this.$=H.VerifyType.VERIFY_TEST;break;case 33:H.addElement(K[ce-3]);break;case 34:H.setNewElementType(K[ce-2]);break;case 35:H.setNewElementDocRef(K[ce-2]);break;case 38:H.addRelationship(K[ce-2],K[ce],K[ce-4]);break;case 39:H.addRelationship(K[ce-2],K[ce-4],K[ce]);break;case 40:this.$=H.Relationships.CONTAINS;break;case 41:this.$=H.Relationships.COPIES;break;case 42:this.$=H.Relationships.DERIVES;break;case 43:this.$=H.Relationships.SATISFIES;break;case 44:this.$=H.Relationships.VERIFIES;break;case 45:this.$=H.Relationships.REFINES;break;case 46:this.$=H.Relationships.TRACES;break}},"anonymous"),table:[{3:1,4:2,6:e,9:r,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:r,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:r,11:n,13:i},{1:[2,2]},{4:17,5:s,7:13,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:19,23:21,31:u,32:h,33:f,34:d,35:p,36:m,44:g,62:y,63:v},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,30]},{4:17,5:s,7:31,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:19,23:21,31:u,32:h,33:f,34:d,35:p,36:m,44:g,62:y,63:v},{4:17,5:s,7:32,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:19,23:21,31:u,32:h,33:f,34:d,35:p,36:m,44:g,62:y,63:v},{4:17,5:s,7:33,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:19,23:21,31:u,32:h,33:f,34:d,35:p,36:m,44:g,62:y,63:v},{4:17,5:s,7:34,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:19,23:21,31:u,32:h,33:f,34:d,35:p,36:m,44:g,62:y,63:v},{4:17,5:s,7:35,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:19,23:21,31:u,32:h,33:f,34:d,35:p,36:m,44:g,62:y,63:v},{18:36,62:[1,37],63:[1,38]},{45:39,62:[1,40],63:[1,41]},{51:[1,42],53:[1,43]},t(x,[2,20]),t(x,[2,21]),t(x,[2,22]),t(x,[2,23]),t(x,[2,24]),t(x,[2,25]),t(b,[2,49]),t(b,[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:w,56:S,57:T,58:E,59:_,60:A,61:L},{52:54,55:w,56:S,57:T,58:E,59:_,60:A,61:L},{5:[1,55]},{5:[1,56]},{53:[1,57]},t(M,[2,40]),t(M,[2,41]),t(M,[2,42]),t(M,[2,43]),t(M,[2,44]),t(M,[2,45]),t(M,[2,46]),{54:[1,58]},{5:N,20:59,21:k,24:I,26:C,28:O,30:D},{5:P,30:F,46:66,47:B,49:$},{23:71,62:y,63:v},{23:72,62:y,63:v},t(z,[2,13]),{22:[1,73]},{22:[1,74]},{22:[1,75]},{22:[1,76]},{5:N,20:77,21:k,24:I,26:C,28:O,30:D},t(z,[2,19]),t(z,[2,33]),{22:[1,78]},{22:[1,79]},{5:P,30:F,46:80,47:B,49:$},t(z,[2,37]),t(z,[2,38]),t(z,[2,39]),{23:81,62:y,63:v},{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]},t(z,[2,18]),{48:94,62:[1,95],63:[1,96]},{50:97,62:[1,98],63:[1,99]},t(z,[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:N,20:106,21:k,24:I,26:C,28:O,30:D},{5:N,20:107,21:k,24:I,26:C,28:O,30:D},{5:N,20:108,21:k,24:I,26:C,28:O,30:D},{5:N,20:109,21:k,24:I,26:C,28:O,30:D},{5:P,30:F,46:110,47:B,49:$},{5:P,30:F,46:111,47:B,49:$},t(z,[2,14]),t(z,[2,15]),t(z,[2,16]),t(z,[2,17]),t(z,[2,34]),t(z,[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:o(function(j,J){if(J.recoverable)this.trace(j);else{var Z=new Error(j);throw Z.hash=J,Z}},"parseError"),parse:o(function(j){var J=this,Z=[0],H=[],q=[null],K=[],se=this.table,ce="",ue=0,te=0,De=0,oe=2,ke=1,Ie=K.slice.call(arguments,1),Se=Object.create(this.lexer),Ue={yy:{}};for(var Pe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Pe)&&(Ue.yy[Pe]=this.yy[Pe]);Se.setInput(j,Ue.yy),Ue.yy.lexer=Se,Ue.yy.parser=this,typeof Se.yylloc>"u"&&(Se.yylloc={});var _e=Se.yylloc;K.push(_e);var me=Se.options&&Se.options.ranges;typeof Ue.yy.parseError=="function"?this.parseError=Ue.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function W(He){Z.length=Z.length-2*He,q.length=q.length-He,K.length=K.length-He}o(W,"popStack");function fe(){var He;return He=H.pop()||Se.lex()||ke,typeof He!="number"&&(He instanceof Array&&(H=He,He=H.pop()),He=J.symbols_[He]||He),He}o(fe,"lex");for(var ge,re,he,ne,ae,we,Te={},Ce,Ae,Ge,Me;;){if(he=Z[Z.length-1],this.defaultActions[he]?ne=this.defaultActions[he]:((ge===null||typeof ge>"u")&&(ge=fe()),ne=se[he]&&se[he][ge]),typeof ne>"u"||!ne.length||!ne[0]){var ye="";Me=[];for(Ce in se[he])this.terminals_[Ce]&&Ce>oe&&Me.push("'"+this.terminals_[Ce]+"'");Se.showPosition?ye="Parse error on line "+(ue+1)+`: +`+Se.showPosition()+` +Expecting `+Me.join(", ")+", got '"+(this.terminals_[ge]||ge)+"'":ye="Parse error on line "+(ue+1)+": Unexpected "+(ge==ke?"end of input":"'"+(this.terminals_[ge]||ge)+"'"),this.parseError(ye,{text:Se.match,token:this.terminals_[ge]||ge,line:Se.yylineno,loc:_e,expected:Me})}if(ne[0]instanceof Array&&ne.length>1)throw new Error("Parse Error: multiple actions possible at state: "+he+", token: "+ge);switch(ne[0]){case 1:Z.push(ge),q.push(Se.yytext),K.push(Se.yylloc),Z.push(ne[1]),ge=null,re?(ge=re,re=null):(te=Se.yyleng,ce=Se.yytext,ue=Se.yylineno,_e=Se.yylloc,De>0&&De--);break;case 2:if(Ae=this.productions_[ne[1]][1],Te.$=q[q.length-Ae],Te._$={first_line:K[K.length-(Ae||1)].first_line,last_line:K[K.length-1].last_line,first_column:K[K.length-(Ae||1)].first_column,last_column:K[K.length-1].last_column},me&&(Te._$.range=[K[K.length-(Ae||1)].range[0],K[K.length-1].range[1]]),we=this.performAction.apply(Te,[ce,te,ue,Ue.yy,ne[1],q,K].concat(Ie)),typeof we<"u")return we;Ae&&(Z=Z.slice(0,-1*Ae*2),q=q.slice(0,-1*Ae),K=K.slice(0,-1*Ae)),Z.push(this.productions_[ne[1]][0]),q.push(Te.$),K.push(Te._$),Ge=se[Z[Z.length-2]][Z[Z.length-1]],Z.push(Ge);break;case 3:return!0}}return!0},"parse")},Q=function(){var ie={EOF:1,parseError:o(function(J,Z){if(this.yy.parser)this.yy.parser.parseError(J,Z);else throw new Error(J)},"parseError"),setInput:o(function(j,J){return this.yy=J||this.yy||{},this._input=j,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var j=this._input[0];this.yytext+=j,this.yyleng++,this.offset++,this.match+=j,this.matched+=j;var J=j.match(/(?:\r\n?|\n).*/g);return J?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),j},"input"),unput:o(function(j){var J=j.length,Z=j.split(/(?:\r\n?|\n)/g);this._input=j+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-J),this.offset-=J;var H=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),Z.length-1&&(this.yylineno-=Z.length-1);var q=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Z?(Z.length===H.length?this.yylloc.first_column:0)+H[H.length-Z.length].length-Z[0].length:this.yylloc.first_column-J},this.options.ranges&&(this.yylloc.range=[q[0],q[0]+this.yyleng-J]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(j){this.unput(this.match.slice(j))},"less"),pastInput:o(function(){var j=this.matched.substr(0,this.matched.length-this.match.length);return(j.length>20?"...":"")+j.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var j=this.match;return j.length<20&&(j+=this._input.substr(0,20-j.length)),(j.substr(0,20)+(j.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var j=this.pastInput(),J=new Array(j.length+1).join("-");return j+this.upcomingInput()+` +`+J+"^"},"showPosition"),test_match:o(function(j,J){var Z,H,q;if(this.options.backtrack_lexer&&(q={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},this.options.ranges&&(q.yylloc.range=this.yylloc.range.slice(0))),H=j[0].match(/(?:\r\n?|\n).*/g),H&&(this.yylineno+=H.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:H?H[H.length-1].length-H[H.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+j[0].length},this.yytext+=j[0],this.match+=j[0],this.matches=j,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(j[0].length),this.matched+=j[0],Z=this.performAction.call(this,this.yy,this,J,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Z)return Z;if(this._backtrack){for(var K in q)this[K]=q[K];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var j,J,Z,H;this._more||(this.yytext="",this.match="");for(var q=this._currentRules(),K=0;KJ[0].length)){if(J=Z,H=K,this.options.backtrack_lexer){if(j=this.test_match(Z,q[K]),j!==!1)return j;if(this._backtrack){J=!1;continue}else return!1}else if(!this.options.flex)break}return J?(j=this.test_match(J,q[H]),j!==!1?j:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var J=this.next();return J||this.lex()},"lex"),begin:o(function(J){this.conditionStack.push(J)},"begin"),popState:o(function(){var J=this.conditionStack.length-1;return J>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(J){return J=this.conditionStack.length-1-Math.abs(J||0),J>=0?this.conditionStack[J]:"INITIAL"},"topState"),pushState:o(function(J){this.begin(J)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(J,Z,H,q){var K=q;switch(H){case 0:return"title";case 1:return this.begin("acc_title"),9;break;case 2:return this.popState(),"acc_title_value";break;case 3:return this.begin("acc_descr"),11;break;case 4:return this.popState(),"acc_descr_value";break;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");break;case 48:this.popState();break;case 49:return"qString";case 50:return Z.yytext=Z.yytext.trim(),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:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},unqString:{rules:[],inclusive:!1},token:{rules:[],inclusive:!1},string:{rules:[48,49],inclusive:!1},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:!0}}};return ie}();Y.lexer=Q;function X(){this.yy={}}return o(X,"Parser"),X.prototype=Y,Y.Parser=X,new X}();oO.parser=oO;Lue=oO});var lO,Bs,gx,mf,yx,Lze,Dze,Rze,Nze,Mze,Ize,Oze,Pze,Bze,Fze,zze,Gze,$ze,Vze,Uze,Hze,Yze,Rue,Nue=R(()=>{"use strict";_t();ut();bi();lO=[],Bs={},gx=new Map,mf={},yx=new Map,Lze={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},Dze={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},Rze={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},Nze={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},Mze=o((t,e)=>(gx.has(t)||gx.set(t,{name:t,type:e,id:Bs.id,text:Bs.text,risk:Bs.risk,verifyMethod:Bs.verifyMethod}),Bs={},gx.get(t)),"addRequirement"),Ize=o(()=>gx,"getRequirements"),Oze=o(t=>{Bs!==void 0&&(Bs.id=t)},"setNewReqId"),Pze=o(t=>{Bs!==void 0&&(Bs.text=t)},"setNewReqText"),Bze=o(t=>{Bs!==void 0&&(Bs.risk=t)},"setNewReqRisk"),Fze=o(t=>{Bs!==void 0&&(Bs.verifyMethod=t)},"setNewReqVerifyMethod"),zze=o(t=>(yx.has(t)||(yx.set(t,{name:t,type:mf.type,docRef:mf.docRef}),V.info("Added new requirement: ",t)),mf={},yx.get(t)),"addElement"),Gze=o(()=>yx,"getElements"),$ze=o(t=>{mf!==void 0&&(mf.type=t)},"setNewElementType"),Vze=o(t=>{mf!==void 0&&(mf.docRef=t)},"setNewElementDocRef"),Uze=o((t,e,r)=>{lO.push({type:t,src:e,dst:r})},"addRelationship"),Hze=o(()=>lO,"getRelationships"),Yze=o(()=>{lO=[],Bs={},gx=new Map,mf={},yx=new Map,vr()},"clear"),Rue={RequirementType:Lze,RiskLevel:Dze,VerifyType:Rze,Relationships:Nze,getConfig:o(()=>de().req,"getConfig"),addRequirement:Mze,getRequirements:Ize,setNewReqId:Oze,setNewReqText:Pze,setNewReqRisk:Bze,setNewReqVerifyMethod:Fze,setAccTitle:kr,getAccTitle:Ar,setAccDescription:_r,getAccDescription:Lr,addElement:zze,getElements:Gze,setNewElementType:$ze,setNewElementDocRef:Vze,addRelationship:Uze,getRelationships:Hze,clear:Yze}});var Wze,Mue,Iue=R(()=>{"use strict";Wze=o(t=>` marker { - fill: ${i.relationColor}; - stroke: ${i.relationColor}; + fill: ${t.relationColor}; + stroke: ${t.relationColor}; } marker.cross { - stroke: ${i.lineColor}; + stroke: ${t.lineColor}; } svg { - font-family: ${i.fontFamily}; - font-size: ${i.fontSize}; + font-family: ${t.fontFamily}; + font-size: ${t.fontSize}; } .reqBox { - fill: ${i.requirementBackground}; + fill: ${t.requirementBackground}; fill-opacity: 1.0; - stroke: ${i.requirementBorderColor}; - stroke-width: ${i.requirementBorderSize}; + stroke: ${t.requirementBorderColor}; + stroke-width: ${t.requirementBorderSize}; } .reqTitle, .reqLabel{ - fill: ${i.requirementTextColor}; + fill: ${t.requirementTextColor}; } .reqLabelBox { - fill: ${i.relationLabelBackground}; + fill: ${t.relationLabelBackground}; fill-opacity: 1.0; } .req-title-line { - stroke: ${i.requirementBorderColor}; - stroke-width: ${i.requirementBorderSize}; + stroke: ${t.requirementBorderColor}; + stroke-width: ${t.requirementBorderSize}; } .relationshipLine { - stroke: ${i.relationColor}; + stroke: ${t.relationColor}; stroke-width: 1; } .relationshipLabel { - fill: ${i.relationLabelColor}; + fill: ${t.relationLabelColor}; } -`,Z0e={CONTAINS:"contains",ARROW:"arrow"},MRe={ReqMarkers:Z0e,insertLineEndings:(i,a)=>{let f=i.append("defs").append("marker").attr("id",Z0e.CONTAINS+"_line_ending").attr("refX",0).attr("refY",a.line_height/2).attr("markerWidth",a.line_height).attr("markerHeight",a.line_height).attr("orient","auto").append("g");f.append("circle").attr("cx",a.line_height/2).attr("cy",a.line_height/2).attr("r",a.line_height/2).attr("fill","none"),f.append("line").attr("x1",0).attr("x2",a.line_height).attr("y1",a.line_height/2).attr("y2",a.line_height/2).attr("stroke-width",1),f.append("line").attr("y1",0).attr("y2",a.line_height).attr("x1",a.line_height/2).attr("x2",a.line_height/2).attr("stroke-width",1),i.append("defs").append("marker").attr("id",Z0e.ARROW+"_line_ending").attr("refX",a.line_height).attr("refY",.5*a.line_height).attr("markerWidth",a.line_height).attr("markerHeight",a.line_height).attr("orient","auto").append("path").attr("d",`M0,0 - L${a.line_height},${a.line_height/2} - M${a.line_height},${a.line_height/2} - L0,${a.line_height}`).attr("stroke-width",1)}};let Mh={},DRe=0;const IRe=(i,a)=>i.insert("rect","#"+a).attr("class","req reqBox").attr("x",0).attr("y",0).attr("width",Mh.rect_min_width+"px").attr("height",Mh.rect_min_height+"px"),ORe=(i,a,f)=>{let p=Mh.rect_min_width/2,w=i.append("text").attr("class","req reqLabel reqTitle").attr("id",a).attr("x",p).attr("y",Mh.rect_padding).attr("dominant-baseline","hanging"),y=0;f.forEach(N=>{y==0?w.append("tspan").attr("text-anchor","middle").attr("x",Mh.rect_min_width/2).attr("dy",0).text(N):w.append("tspan").attr("text-anchor","middle").attr("x",Mh.rect_min_width/2).attr("dy",Mh.line_height*.75).text(N),y++});let b=1.5*Mh.rect_padding,E=y*Mh.line_height*.75,S=b+E;return i.append("line").attr("class","req-title-line").attr("x1","0").attr("x2",Mh.rect_min_width).attr("y1",S).attr("y2",S),{titleNode:w,y:S}},NRe=(i,a,f,p)=>{let w=i.append("text").attr("class","req reqLabel").attr("id",a).attr("x",Mh.rect_padding).attr("y",p).attr("dominant-baseline","hanging"),y=0;const b=30;let E=[];return f.forEach(S=>{let N=S.length;for(;N>b&&y<3;){let B=S.substring(0,b);S=S.substring(b,S.length),N=S.length,E[E.length]=B,y++}if(y==3){let B=E[E.length-1];E[E.length-1]=B.substring(0,B.length-4)+"..."}else E[E.length]=S;y=0}),E.forEach(S=>{w.append("tspan").attr("x",Mh.rect_padding).attr("dy",Mh.line_height).text(S)}),w},I$t=(i,a,f,p)=>{const w=a.node().getTotalLength(),y=a.node().getPointAtLength(w*.5),b="rel"+DRe;DRe++;const S=i.append("text").attr("class","req relationshipLabel").attr("id",b).attr("x",y.x).attr("y",y.y).attr("text-anchor","middle").attr("dominant-baseline","middle").text(p).node().getBBox();i.insert("rect","#"+b).attr("class","req reqLabelBox").attr("x",y.x-S.width/2).attr("y",y.y-S.height/2).attr("width",S.width).attr("height",S.height).attr("fill","white").attr("fill-opacity","85%")},O$t=function(i,a,f,p,w){const y=f.edge(oL(a.src),oL(a.dst)),b=WE().x(function(S){return S.x}).y(function(S){return S.y}),E=i.insert("path","#"+p).attr("class","er relationshipLine").attr("d",b(y.points)).attr("fill","none");a.type==w.db.Relationships.CONTAINS?E.attr("marker-start","url("+Wa.getUrl(Mh.arrowMarkerAbsolute)+"#"+a.type+"_line_ending)"):(E.attr("stroke-dasharray","10,7"),E.attr("marker-end","url("+Wa.getUrl(Mh.arrowMarkerAbsolute)+"#"+MRe.ReqMarkers.ARROW+"_line_ending)")),I$t(i,E,Mh,`<<${a.type}>>`)},N$t=(i,a,f)=>{Object.keys(i).forEach(p=>{let w=i[p];p=oL(p),Fe.info("Added new requirement: ",p);const y=f.append("g").attr("id",p),b="req-"+p,E=IRe(y,b);let S=ORe(y,p+"_title",[`<<${w.type}>>`,`${w.name}`]);NRe(y,p+"_body",[`Id: ${w.id}`,`Text: ${w.text}`,`Risk: ${w.risk}`,`Verification: ${w.verifyMethod}`],S.y);const N=E.node().getBBox();a.setNode(p,{width:N.width,height:N.height,shape:"rect",id:p})})},P$t=(i,a,f)=>{Object.keys(i).forEach(p=>{let w=i[p];const y=oL(p),b=f.append("g").attr("id",y),E="element-"+y,S=IRe(b,E);let N=ORe(b,E+"_title",["<>",`${p}`]);NRe(b,E+"_body",[`Type: ${w.type||"Not Specified"}`,`Doc Ref: ${w.docRef||"None"}`],N.y);const B=S.node().getBBox();a.setNode(y,{width:B.width,height:B.height,shape:"rect",id:y})})},B$t=(i,a)=>(i.forEach(function(f){let p=oL(f.src),w=oL(f.dst);a.setEdge(p,w,{relationship:f})}),i),R$t=function(i,a){a.nodes().forEach(function(f){f!==void 0&&a.node(f)!==void 0&&(i.select("#"+f),i.select("#"+f).attr("transform","translate("+(a.node(f).x-a.node(f).width/2)+","+(a.node(f).y-a.node(f).height/2)+" )"))})},oL=i=>i.replace(/\s/g,"").replace(/\./g,"_"),F$t=Object.freeze(Object.defineProperty({__proto__:null,diagram:{parser:L$t,db:M$t,renderer:{draw:(i,a,f,p)=>{Mh=Tt().requirement,p.db.clear(),p.parser.parse(i);const w=Mh.securityLevel;let y;w==="sandbox"&&(y=Cr("#i"+a));const E=Cr(w==="sandbox"?y.nodes()[0].contentDocument.body:"body").select(`[id='${a}']`);MRe.insertLineEndings(E,Mh);const S=new zf({multigraph:!1,compound:!1,directed:!0}).setGraph({rankdir:Mh.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel(function(){return{}});let N=p.db.getRequirements(),B=p.db.getElements(),R=p.db.getRelationships();N$t(N,S,E),P$t(B,S,E),B$t(R,S),tL(S),R$t(E,S),R.forEach(function(oe){O$t(E,oe,S,a,p)});const j=Mh.rect_padding,$=E.node().getBBox(),V=$.width+j*2,Q=$.height+j*2;Vw(E,Q,V,Mh.useMaxWidth),E.attr("viewBox",`${$.x-j} ${$.y-j} ${V} ${Q}`)}},styles:D$t}},Symbol.toStringTag,{value:"Module"}));var J0e=function(){var i=function(Dt,vt,Nt,ze){for(Nt=Nt||{},ze=Dt.length;ze--;Nt[Dt[ze]]=vt);return Nt},a=[1,2],f=[1,3],p=[1,5],w=[1,7],y=[2,5],b=[1,15],E=[1,17],S=[1,19],N=[1,21],B=[1,22],R=[1,23],j=[1,29],$=[1,30],V=[1,31],Q=[1,32],oe=[1,33],ce=[1,34],se=[1,35],ge=[1,36],ye=[1,37],ke=[1,38],Ae=[1,39],de=[1,40],ve=[1,42],te=[1,43],xe=[1,45],De=[1,46],he=[1,47],Ie=[1,48],ee=[1,49],rt=[1,50],me=[1,53],gt=[1,4,5,19,21,23,26,28,34,35,36,38,40,41,42,43,44,46,48,50,51,52,53,54,56,57,62,63,64,65,73,83],pe=[4,5,21,54,56],Et=[4,5,19,21,23,26,28,34,35,36,38,40,41,42,43,44,46,48,50,54,56,57,62,63,64,65,73,83],wt=[4,5,19,21,23,26,28,34,35,36,38,40,41,42,43,44,46,48,50,53,54,56,57,62,63,64,65,73,83],jt=[4,5,19,21,23,26,28,34,35,36,38,40,41,42,43,44,46,48,50,52,54,56,57,62,63,64,65,73,83],At=[4,5,19,21,23,26,28,34,35,36,38,40,41,42,43,44,46,48,50,51,54,56,57,62,63,64,65,73,83],Bt=[71,72,73],cn=[1,125],Nn=[1,4,5,7,19,21,23,26,28,34,35,36,38,40,41,42,43,44,46,48,50,51,52,53,54,56,57,62,63,64,65,73,83],Ot={trace:function(){},yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,directive:6,SD:7,document:8,line:9,statement:10,box_section:11,box_line:12,participant_statement:13,openDirective:14,typeDirective:15,closeDirective:16,":":17,argDirective:18,box:19,restOfLine:20,end:21,signal:22,autonumber:23,NUM:24,off:25,activate:26,actor:27,deactivate:28,note_statement:29,links_statement:30,link_statement:31,properties_statement:32,details_statement:33,title:34,legacy_title:35,acc_title:36,acc_title_value:37,acc_descr:38,acc_descr_value:39,acc_descr_multiline_value:40,loop:41,rect:42,opt:43,alt:44,else_sections:45,par:46,par_sections:47,critical:48,option_sections:49,break:50,option:51,and:52,else:53,participant:54,AS:55,participant_actor:56,note:57,placement:58,text2:59,over:60,actor_pair:61,links:62,link:63,properties:64,details:65,spaceList:66,",":67,left_of:68,right_of:69,signaltype:70,"+":71,"-":72,ACTOR:73,SOLID_OPEN_ARROW:74,DOTTED_OPEN_ARROW:75,SOLID_ARROW:76,DOTTED_ARROW:77,SOLID_CROSS:78,DOTTED_CROSS:79,SOLID_POINT:80,DOTTED_POINT:81,TXT:82,open_directive:83,type_directive:84,arg_directive:85,close_directive:86,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",7:"SD",17:":",19:"box",20:"restOfLine",21:"end",23:"autonumber",24:"NUM",25:"off",26:"activate",28:"deactivate",34:"title",35:"legacy_title",36:"acc_title",37:"acc_title_value",38:"acc_descr",39:"acc_descr_value",40:"acc_descr_multiline_value",41:"loop",42:"rect",43:"opt",44:"alt",46:"par",48:"critical",50:"break",51:"option",52:"and",53:"else",54:"participant",55:"AS",56:"participant_actor",57:"note",60:"over",62:"links",63:"link",64:"properties",65:"details",67:",",68:"left_of",69:"right_of",71:"+",72:"-",73:"ACTOR",74:"SOLID_OPEN_ARROW",75:"DOTTED_OPEN_ARROW",76:"SOLID_ARROW",77:"DOTTED_ARROW",78:"SOLID_CROSS",79:"DOTTED_CROSS",80:"SOLID_POINT",81:"DOTTED_POINT",82:"TXT",83:"open_directive",84:"type_directive",85:"arg_directive",86:"close_directive"},productions_:[0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[11,0],[11,2],[12,2],[12,1],[12,1],[6,4],[6,6],[10,1],[10,4],[10,2],[10,4],[10,3],[10,3],[10,2],[10,3],[10,3],[10,2],[10,2],[10,2],[10,2],[10,2],[10,1],[10,1],[10,2],[10,2],[10,1],[10,4],[10,4],[10,4],[10,4],[10,4],[10,4],[10,4],[10,1],[49,1],[49,4],[47,1],[47,4],[45,1],[45,4],[13,5],[13,3],[13,5],[13,3],[29,4],[29,4],[30,3],[31,3],[32,3],[33,3],[66,2],[66,1],[61,3],[61,1],[58,1],[58,1],[22,5],[22,5],[22,4],[27,1],[70,1],[70,1],[70,1],[70,1],[70,1],[70,1],[70,1],[70,1],[59,1],[14,1],[15,1],[18,1],[16,1]],performAction:function(vt,Nt,ze,Xe,Lt,Ge,Bn){var Oe=Ge.length-1;switch(Lt){case 4:return Xe.apply(Ge[Oe]),Ge[Oe];case 5:case 10:this.$=[];break;case 6:case 11:Ge[Oe-1].push(Ge[Oe]),this.$=Ge[Oe-1];break;case 7:case 8:case 12:case 13:this.$=Ge[Oe];break;case 9:case 14:this.$=[];break;case 18:Ge[Oe-1].unshift({type:"boxStart",boxData:Xe.parseBoxData(Ge[Oe-2])}),Ge[Oe-1].push({type:"boxEnd",boxText:Ge[Oe-2]}),this.$=Ge[Oe-1];break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(Ge[Oe-2]),sequenceIndexStep:Number(Ge[Oe-1]),sequenceVisible:!0,signalType:Xe.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceIndex:Number(Ge[Oe-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:Xe.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:Xe.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:Xe.LINETYPE.AUTONUMBER};break;case 24:this.$={type:"activeStart",signalType:Xe.LINETYPE.ACTIVE_START,actor:Ge[Oe-1]};break;case 25:this.$={type:"activeEnd",signalType:Xe.LINETYPE.ACTIVE_END,actor:Ge[Oe-1]};break;case 31:Xe.setDiagramTitle(Ge[Oe].substring(6)),this.$=Ge[Oe].substring(6);break;case 32:Xe.setDiagramTitle(Ge[Oe].substring(7)),this.$=Ge[Oe].substring(7);break;case 33:this.$=Ge[Oe].trim(),Xe.setAccTitle(this.$);break;case 34:case 35:this.$=Ge[Oe].trim(),Xe.setAccDescription(this.$);break;case 36:Ge[Oe-1].unshift({type:"loopStart",loopText:Xe.parseMessage(Ge[Oe-2]),signalType:Xe.LINETYPE.LOOP_START}),Ge[Oe-1].push({type:"loopEnd",loopText:Ge[Oe-2],signalType:Xe.LINETYPE.LOOP_END}),this.$=Ge[Oe-1];break;case 37:Ge[Oe-1].unshift({type:"rectStart",color:Xe.parseMessage(Ge[Oe-2]),signalType:Xe.LINETYPE.RECT_START}),Ge[Oe-1].push({type:"rectEnd",color:Xe.parseMessage(Ge[Oe-2]),signalType:Xe.LINETYPE.RECT_END}),this.$=Ge[Oe-1];break;case 38:Ge[Oe-1].unshift({type:"optStart",optText:Xe.parseMessage(Ge[Oe-2]),signalType:Xe.LINETYPE.OPT_START}),Ge[Oe-1].push({type:"optEnd",optText:Xe.parseMessage(Ge[Oe-2]),signalType:Xe.LINETYPE.OPT_END}),this.$=Ge[Oe-1];break;case 39:Ge[Oe-1].unshift({type:"altStart",altText:Xe.parseMessage(Ge[Oe-2]),signalType:Xe.LINETYPE.ALT_START}),Ge[Oe-1].push({type:"altEnd",signalType:Xe.LINETYPE.ALT_END}),this.$=Ge[Oe-1];break;case 40:Ge[Oe-1].unshift({type:"parStart",parText:Xe.parseMessage(Ge[Oe-2]),signalType:Xe.LINETYPE.PAR_START}),Ge[Oe-1].push({type:"parEnd",signalType:Xe.LINETYPE.PAR_END}),this.$=Ge[Oe-1];break;case 41:Ge[Oe-1].unshift({type:"criticalStart",criticalText:Xe.parseMessage(Ge[Oe-2]),signalType:Xe.LINETYPE.CRITICAL_START}),Ge[Oe-1].push({type:"criticalEnd",signalType:Xe.LINETYPE.CRITICAL_END}),this.$=Ge[Oe-1];break;case 42:Ge[Oe-1].unshift({type:"breakStart",breakText:Xe.parseMessage(Ge[Oe-2]),signalType:Xe.LINETYPE.BREAK_START}),Ge[Oe-1].push({type:"breakEnd",optText:Xe.parseMessage(Ge[Oe-2]),signalType:Xe.LINETYPE.BREAK_END}),this.$=Ge[Oe-1];break;case 45:this.$=Ge[Oe-3].concat([{type:"option",optionText:Xe.parseMessage(Ge[Oe-1]),signalType:Xe.LINETYPE.CRITICAL_OPTION},Ge[Oe]]);break;case 47:this.$=Ge[Oe-3].concat([{type:"and",parText:Xe.parseMessage(Ge[Oe-1]),signalType:Xe.LINETYPE.PAR_AND},Ge[Oe]]);break;case 49:this.$=Ge[Oe-3].concat([{type:"else",altText:Xe.parseMessage(Ge[Oe-1]),signalType:Xe.LINETYPE.ALT_ELSE},Ge[Oe]]);break;case 50:Ge[Oe-3].type="addParticipant",Ge[Oe-3].description=Xe.parseMessage(Ge[Oe-1]),this.$=Ge[Oe-3];break;case 51:Ge[Oe-1].type="addParticipant",this.$=Ge[Oe-1];break;case 52:Ge[Oe-3].type="addActor",Ge[Oe-3].description=Xe.parseMessage(Ge[Oe-1]),this.$=Ge[Oe-3];break;case 53:Ge[Oe-1].type="addActor",this.$=Ge[Oe-1];break;case 54:this.$=[Ge[Oe-1],{type:"addNote",placement:Ge[Oe-2],actor:Ge[Oe-1].actor,text:Ge[Oe]}];break;case 55:Ge[Oe-2]=[].concat(Ge[Oe-1],Ge[Oe-1]).slice(0,2),Ge[Oe-2][0]=Ge[Oe-2][0].actor,Ge[Oe-2][1]=Ge[Oe-2][1].actor,this.$=[Ge[Oe-1],{type:"addNote",placement:Xe.PLACEMENT.OVER,actor:Ge[Oe-2].slice(0,2),text:Ge[Oe]}];break;case 56:this.$=[Ge[Oe-1],{type:"addLinks",actor:Ge[Oe-1].actor,text:Ge[Oe]}];break;case 57:this.$=[Ge[Oe-1],{type:"addALink",actor:Ge[Oe-1].actor,text:Ge[Oe]}];break;case 58:this.$=[Ge[Oe-1],{type:"addProperties",actor:Ge[Oe-1].actor,text:Ge[Oe]}];break;case 59:this.$=[Ge[Oe-1],{type:"addDetails",actor:Ge[Oe-1].actor,text:Ge[Oe]}];break;case 62:this.$=[Ge[Oe-2],Ge[Oe]];break;case 63:this.$=Ge[Oe];break;case 64:this.$=Xe.PLACEMENT.LEFTOF;break;case 65:this.$=Xe.PLACEMENT.RIGHTOF;break;case 66:this.$=[Ge[Oe-4],Ge[Oe-1],{type:"addMessage",from:Ge[Oe-4].actor,to:Ge[Oe-1].actor,signalType:Ge[Oe-3],msg:Ge[Oe]},{type:"activeStart",signalType:Xe.LINETYPE.ACTIVE_START,actor:Ge[Oe-1]}];break;case 67:this.$=[Ge[Oe-4],Ge[Oe-1],{type:"addMessage",from:Ge[Oe-4].actor,to:Ge[Oe-1].actor,signalType:Ge[Oe-3],msg:Ge[Oe]},{type:"activeEnd",signalType:Xe.LINETYPE.ACTIVE_END,actor:Ge[Oe-4]}];break;case 68:this.$=[Ge[Oe-3],Ge[Oe-1],{type:"addMessage",from:Ge[Oe-3].actor,to:Ge[Oe-1].actor,signalType:Ge[Oe-2],msg:Ge[Oe]}];break;case 69:this.$={type:"addParticipant",actor:Ge[Oe]};break;case 70:this.$=Xe.LINETYPE.SOLID_OPEN;break;case 71:this.$=Xe.LINETYPE.DOTTED_OPEN;break;case 72:this.$=Xe.LINETYPE.SOLID;break;case 73:this.$=Xe.LINETYPE.DOTTED;break;case 74:this.$=Xe.LINETYPE.SOLID_CROSS;break;case 75:this.$=Xe.LINETYPE.DOTTED_CROSS;break;case 76:this.$=Xe.LINETYPE.SOLID_POINT;break;case 77:this.$=Xe.LINETYPE.DOTTED_POINT;break;case 78:this.$=Xe.parseMessage(Ge[Oe].trim().substring(1));break;case 79:Xe.parseDirective("%%{","open_directive");break;case 80:Xe.parseDirective(Ge[Oe],"type_directive");break;case 81:Ge[Oe]=Ge[Oe].trim().replace(/'/g,'"'),Xe.parseDirective(Ge[Oe],"arg_directive");break;case 82:Xe.parseDirective("}%%","close_directive","sequence");break}},table:[{3:1,4:a,5:f,6:4,7:p,14:6,83:w},{1:[3]},{3:8,4:a,5:f,6:4,7:p,14:6,83:w},{3:9,4:a,5:f,6:4,7:p,14:6,83:w},{3:10,4:a,5:f,6:4,7:p,14:6,83:w},i([1,4,5,19,23,26,28,34,35,36,38,40,41,42,43,44,46,48,50,54,56,57,62,63,64,65,73,83],y,{8:11}),{15:12,84:[1,13]},{84:[2,79]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:b,5:E,6:41,9:14,10:16,13:18,14:6,19:S,22:20,23:N,26:B,27:44,28:R,29:24,30:25,31:26,32:27,33:28,34:j,35:$,36:V,38:Q,40:oe,41:ce,42:se,43:ge,44:ye,46:ke,48:Ae,50:de,54:ve,56:te,57:xe,62:De,63:he,64:Ie,65:ee,73:rt,83:w},{16:51,17:[1,52],86:me},i([17,86],[2,80]),i(gt,[2,6]),{6:41,10:54,13:18,14:6,19:S,22:20,23:N,26:B,27:44,28:R,29:24,30:25,31:26,32:27,33:28,34:j,35:$,36:V,38:Q,40:oe,41:ce,42:se,43:ge,44:ye,46:ke,48:Ae,50:de,54:ve,56:te,57:xe,62:De,63:he,64:Ie,65:ee,73:rt,83:w},i(gt,[2,8]),i(gt,[2,9]),i(gt,[2,17]),{20:[1,55]},{5:[1,56]},{5:[1,59],24:[1,57],25:[1,58]},{27:60,73:rt},{27:61,73:rt},{5:[1,62]},{5:[1,63]},{5:[1,64]},{5:[1,65]},{5:[1,66]},i(gt,[2,31]),i(gt,[2,32]),{37:[1,67]},{39:[1,68]},i(gt,[2,35]),{20:[1,69]},{20:[1,70]},{20:[1,71]},{20:[1,72]},{20:[1,73]},{20:[1,74]},{20:[1,75]},i(gt,[2,43]),{27:76,73:rt},{27:77,73:rt},{70:78,74:[1,79],75:[1,80],76:[1,81],77:[1,82],78:[1,83],79:[1,84],80:[1,85],81:[1,86]},{58:87,60:[1,88],68:[1,89],69:[1,90]},{27:91,73:rt},{27:92,73:rt},{27:93,73:rt},{27:94,73:rt},i([5,55,67,74,75,76,77,78,79,80,81,82],[2,69]),{5:[1,95]},{18:96,85:[1,97]},{5:[2,82]},i(gt,[2,7]),i(pe,[2,10],{11:98}),i(gt,[2,19]),{5:[1,100],24:[1,99]},{5:[1,101]},i(gt,[2,23]),{5:[1,102]},{5:[1,103]},i(gt,[2,26]),i(gt,[2,27]),i(gt,[2,28]),i(gt,[2,29]),i(gt,[2,30]),i(gt,[2,33]),i(gt,[2,34]),i(Et,y,{8:104}),i(Et,y,{8:105}),i(Et,y,{8:106}),i(wt,y,{45:107,8:108}),i(jt,y,{47:109,8:110}),i(At,y,{49:111,8:112}),i(Et,y,{8:113}),{5:[1,115],55:[1,114]},{5:[1,117],55:[1,116]},{27:120,71:[1,118],72:[1,119],73:rt},i(Bt,[2,70]),i(Bt,[2,71]),i(Bt,[2,72]),i(Bt,[2,73]),i(Bt,[2,74]),i(Bt,[2,75]),i(Bt,[2,76]),i(Bt,[2,77]),{27:121,73:rt},{27:123,61:122,73:rt},{73:[2,64]},{73:[2,65]},{59:124,82:cn},{59:126,82:cn},{59:127,82:cn},{59:128,82:cn},i(Nn,[2,15]),{16:129,86:me},{86:[2,81]},{4:[1,132],5:[1,134],12:131,13:133,21:[1,130],54:ve,56:te},{5:[1,135]},i(gt,[2,21]),i(gt,[2,22]),i(gt,[2,24]),i(gt,[2,25]),{4:b,5:E,6:41,9:14,10:16,13:18,14:6,19:S,21:[1,136],22:20,23:N,26:B,27:44,28:R,29:24,30:25,31:26,32:27,33:28,34:j,35:$,36:V,38:Q,40:oe,41:ce,42:se,43:ge,44:ye,46:ke,48:Ae,50:de,54:ve,56:te,57:xe,62:De,63:he,64:Ie,65:ee,73:rt,83:w},{4:b,5:E,6:41,9:14,10:16,13:18,14:6,19:S,21:[1,137],22:20,23:N,26:B,27:44,28:R,29:24,30:25,31:26,32:27,33:28,34:j,35:$,36:V,38:Q,40:oe,41:ce,42:se,43:ge,44:ye,46:ke,48:Ae,50:de,54:ve,56:te,57:xe,62:De,63:he,64:Ie,65:ee,73:rt,83:w},{4:b,5:E,6:41,9:14,10:16,13:18,14:6,19:S,21:[1,138],22:20,23:N,26:B,27:44,28:R,29:24,30:25,31:26,32:27,33:28,34:j,35:$,36:V,38:Q,40:oe,41:ce,42:se,43:ge,44:ye,46:ke,48:Ae,50:de,54:ve,56:te,57:xe,62:De,63:he,64:Ie,65:ee,73:rt,83:w},{21:[1,139]},{4:b,5:E,6:41,9:14,10:16,13:18,14:6,19:S,21:[2,48],22:20,23:N,26:B,27:44,28:R,29:24,30:25,31:26,32:27,33:28,34:j,35:$,36:V,38:Q,40:oe,41:ce,42:se,43:ge,44:ye,46:ke,48:Ae,50:de,53:[1,140],54:ve,56:te,57:xe,62:De,63:he,64:Ie,65:ee,73:rt,83:w},{21:[1,141]},{4:b,5:E,6:41,9:14,10:16,13:18,14:6,19:S,21:[2,46],22:20,23:N,26:B,27:44,28:R,29:24,30:25,31:26,32:27,33:28,34:j,35:$,36:V,38:Q,40:oe,41:ce,42:se,43:ge,44:ye,46:ke,48:Ae,50:de,52:[1,142],54:ve,56:te,57:xe,62:De,63:he,64:Ie,65:ee,73:rt,83:w},{21:[1,143]},{4:b,5:E,6:41,9:14,10:16,13:18,14:6,19:S,21:[2,44],22:20,23:N,26:B,27:44,28:R,29:24,30:25,31:26,32:27,33:28,34:j,35:$,36:V,38:Q,40:oe,41:ce,42:se,43:ge,44:ye,46:ke,48:Ae,50:de,51:[1,144],54:ve,56:te,57:xe,62:De,63:he,64:Ie,65:ee,73:rt,83:w},{4:b,5:E,6:41,9:14,10:16,13:18,14:6,19:S,21:[1,145],22:20,23:N,26:B,27:44,28:R,29:24,30:25,31:26,32:27,33:28,34:j,35:$,36:V,38:Q,40:oe,41:ce,42:se,43:ge,44:ye,46:ke,48:Ae,50:de,54:ve,56:te,57:xe,62:De,63:he,64:Ie,65:ee,73:rt,83:w},{20:[1,146]},i(gt,[2,51]),{20:[1,147]},i(gt,[2,53]),{27:148,73:rt},{27:149,73:rt},{59:150,82:cn},{59:151,82:cn},{59:152,82:cn},{67:[1,153],82:[2,63]},{5:[2,56]},{5:[2,78]},{5:[2,57]},{5:[2,58]},{5:[2,59]},{5:[1,154]},i(gt,[2,18]),i(pe,[2,11]),{13:155,54:ve,56:te},i(pe,[2,13]),i(pe,[2,14]),i(gt,[2,20]),i(gt,[2,36]),i(gt,[2,37]),i(gt,[2,38]),i(gt,[2,39]),{20:[1,156]},i(gt,[2,40]),{20:[1,157]},i(gt,[2,41]),{20:[1,158]},i(gt,[2,42]),{5:[1,159]},{5:[1,160]},{59:161,82:cn},{59:162,82:cn},{5:[2,68]},{5:[2,54]},{5:[2,55]},{27:163,73:rt},i(Nn,[2,16]),i(pe,[2,12]),i(wt,y,{8:108,45:164}),i(jt,y,{8:110,47:165}),i(At,y,{8:112,49:166}),i(gt,[2,50]),i(gt,[2,52]),{5:[2,66]},{5:[2,67]},{82:[2,62]},{21:[2,49]},{21:[2,47]},{21:[2,45]}],defaultActions:{7:[2,79],8:[2,1],9:[2,2],10:[2,3],53:[2,82],89:[2,64],90:[2,65],97:[2,81],124:[2,56],125:[2,78],126:[2,57],127:[2,58],128:[2,59],150:[2,68],151:[2,54],152:[2,55],161:[2,66],162:[2,67],163:[2,62],164:[2,49],165:[2,47],166:[2,45]},parseError:function(vt,Nt){if(Nt.recoverable)this.trace(vt);else{var ze=new Error(vt);throw ze.hash=Nt,ze}},parse:function(vt){var Nt=this,ze=[0],Xe=[],Lt=[null],Ge=[],Bn=this.table,Oe="",Ri=0,tn=0,hi=2,Sr=1,Zn=Ge.slice.call(arguments,1),Xn=Object.create(this.lexer),ir={yy:{}};for(var Hn in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Hn)&&(ir.yy[Hn]=this.yy[Hn]);Xn.setInput(vt,ir.yy),ir.yy.lexer=Xn,ir.yy.parser=this,typeof Xn.yylloc>"u"&&(Xn.yylloc={});var tr=Xn.yylloc;Ge.push(tr);var ha=Xn.options&&Xn.options.ranges;typeof ir.yy.parseError=="function"?this.parseError=ir.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zs(){var Vn;return Vn=Xe.pop()||Xn.lex()||Sr,typeof Vn!="number"&&(Vn instanceof Array&&(Xe=Vn,Vn=Xe.pop()),Vn=Nt.symbols_[Vn]||Vn),Vn}for(var ns,Hi,Js,Pc,Ga={},ws,Oi,Er,br;;){if(Hi=ze[ze.length-1],this.defaultActions[Hi]?Js=this.defaultActions[Hi]:((ns===null||typeof ns>"u")&&(ns=Zs()),Js=Bn[Hi]&&Bn[Hi][ns]),typeof Js>"u"||!Js.length||!Js[0]){var Dr="";br=[];for(ws in Bn[Hi])this.terminals_[ws]&&ws>hi&&br.push("'"+this.terminals_[ws]+"'");Xn.showPosition?Dr="Parse error on line "+(Ri+1)+`: -`+Xn.showPosition()+` -Expecting `+br.join(", ")+", got '"+(this.terminals_[ns]||ns)+"'":Dr="Parse error on line "+(Ri+1)+": Unexpected "+(ns==Sr?"end of input":"'"+(this.terminals_[ns]||ns)+"'"),this.parseError(Dr,{text:Xn.match,token:this.terminals_[ns]||ns,line:Xn.yylineno,loc:tr,expected:br})}if(Js[0]instanceof Array&&Js.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Hi+", token: "+ns);switch(Js[0]){case 1:ze.push(ns),Lt.push(Xn.yytext),Ge.push(Xn.yylloc),ze.push(Js[1]),ns=null,tn=Xn.yyleng,Oe=Xn.yytext,Ri=Xn.yylineno,tr=Xn.yylloc;break;case 2:if(Oi=this.productions_[Js[1]][1],Ga.$=Lt[Lt.length-Oi],Ga._$={first_line:Ge[Ge.length-(Oi||1)].first_line,last_line:Ge[Ge.length-1].last_line,first_column:Ge[Ge.length-(Oi||1)].first_column,last_column:Ge[Ge.length-1].last_column},ha&&(Ga._$.range=[Ge[Ge.length-(Oi||1)].range[0],Ge[Ge.length-1].range[1]]),Pc=this.performAction.apply(Ga,[Oe,tn,Ri,ir.yy,Js[1],Lt,Ge].concat(Zn)),typeof Pc<"u")return Pc;Oi&&(ze=ze.slice(0,-1*Oi*2),Lt=Lt.slice(0,-1*Oi),Ge=Ge.slice(0,-1*Oi)),ze.push(this.productions_[Js[1]][0]),Lt.push(Ga.$),Ge.push(Ga._$),Er=Bn[ze[ze.length-2]][ze[ze.length-1]],ze.push(Er);break;case 3:return!0}}return!0}},oi=function(){var Dt={EOF:1,parseError:function(Nt,ze){if(this.yy.parser)this.yy.parser.parseError(Nt,ze);else throw new Error(Nt)},setInput:function(vt,Nt){return this.yy=Nt||this.yy||{},this._input=vt,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var vt=this._input[0];this.yytext+=vt,this.yyleng++,this.offset++,this.match+=vt,this.matched+=vt;var Nt=vt.match(/(?:\r\n?|\n).*/g);return Nt?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),vt},unput:function(vt){var Nt=vt.length,ze=vt.split(/(?:\r\n?|\n)/g);this._input=vt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Nt),this.offset-=Nt;var Xe=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),ze.length-1&&(this.yylineno-=ze.length-1);var Lt=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:ze?(ze.length===Xe.length?this.yylloc.first_column:0)+Xe[Xe.length-ze.length].length-ze[0].length:this.yylloc.first_column-Nt},this.options.ranges&&(this.yylloc.range=[Lt[0],Lt[0]+this.yyleng-Nt]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(vt){this.unput(this.match.slice(vt))},pastInput:function(){var vt=this.matched.substr(0,this.matched.length-this.match.length);return(vt.length>20?"...":"")+vt.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var vt=this.match;return vt.length<20&&(vt+=this._input.substr(0,20-vt.length)),(vt.substr(0,20)+(vt.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var vt=this.pastInput(),Nt=new Array(vt.length+1).join("-");return vt+this.upcomingInput()+` -`+Nt+"^"},test_match:function(vt,Nt){var ze,Xe,Lt;if(this.options.backtrack_lexer&&(Lt={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},this.options.ranges&&(Lt.yylloc.range=this.yylloc.range.slice(0))),Xe=vt[0].match(/(?:\r\n?|\n).*/g),Xe&&(this.yylineno+=Xe.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Xe?Xe[Xe.length-1].length-Xe[Xe.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+vt[0].length},this.yytext+=vt[0],this.match+=vt[0],this.matches=vt,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(vt[0].length),this.matched+=vt[0],ze=this.performAction.call(this,this.yy,this,Nt,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ze)return ze;if(this._backtrack){for(var Ge in Lt)this[Ge]=Lt[Ge];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var vt,Nt,ze,Xe;this._more||(this.yytext="",this.match="");for(var Lt=this._currentRules(),Ge=0;GeNt[0].length)){if(Nt=ze,Xe=Ge,this.options.backtrack_lexer){if(vt=this.test_match(ze,Lt[Ge]),vt!==!1)return vt;if(this._backtrack){Nt=!1;continue}else return!1}else if(!this.options.flex)break}return Nt?(vt=this.test_match(Nt,Lt[Xe]),vt!==!1?vt:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var Nt=this.next();return Nt||this.lex()},begin:function(Nt){this.conditionStack.push(Nt)},popState:function(){var Nt=this.conditionStack.length-1;return Nt>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(Nt){return Nt=this.conditionStack.length-1-Math.abs(Nt||0),Nt>=0?this.conditionStack[Nt]:"INITIAL"},pushState:function(Nt){this.begin(Nt)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(Nt,ze,Xe,Lt){switch(Xe){case 0:return this.begin("open_directive"),83;case 1:return this.begin("type_directive"),84;case 2:return this.popState(),this.begin("arg_directive"),17;case 3:return this.popState(),this.popState(),86;case 4:return 85;case 5:return 5;case 6:break;case 7:break;case 8:break;case 9:break;case 10:break;case 11:return 24;case 12:return this.begin("LINE"),19;case 13:return this.begin("ID"),54;case 14:return this.begin("ID"),56;case 15:return ze.yytext=ze.yytext.trim(),this.begin("ALIAS"),73;case 16:return this.popState(),this.popState(),this.begin("LINE"),55;case 17:return this.popState(),this.popState(),5;case 18:return this.begin("LINE"),41;case 19:return this.begin("LINE"),42;case 20:return this.begin("LINE"),43;case 21:return this.begin("LINE"),44;case 22:return this.begin("LINE"),53;case 23:return this.begin("LINE"),46;case 24:return this.begin("LINE"),52;case 25:return this.begin("LINE"),48;case 26:return this.begin("LINE"),51;case 27:return this.begin("LINE"),50;case 28:return this.popState(),20;case 29:return 21;case 30:return 68;case 31:return 69;case 32:return 62;case 33:return 63;case 34:return 64;case 35:return 65;case 36:return 60;case 37:return 57;case 38:return this.begin("ID"),26;case 39:return this.begin("ID"),28;case 40:return 34;case 41:return 35;case 42:return this.begin("acc_title"),36;case 43:return this.popState(),"acc_title_value";case 44:return this.begin("acc_descr"),38;case 45:return this.popState(),"acc_descr_value";case 46:this.begin("acc_descr_multiline");break;case 47:this.popState();break;case 48:return"acc_descr_multiline_value";case 49:return 7;case 50:return 23;case 51:return 25;case 52:return 67;case 53:return 5;case 54:return ze.yytext=ze.yytext.trim(),73;case 55:return 76;case 56:return 77;case 57:return 74;case 58:return 75;case 59:return 78;case 60:return 79;case 61:return 80;case 62:return 81;case 63:return 82;case 64:return 71;case 65:return 72;case 66:return 5;case 67:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:[\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,/^(?:[^\->:\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,/^(?: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:[47,48],inclusive:!1},acc_descr:{rules:[45],inclusive:!1},acc_title:{rules:[43],inclusive:!1},open_directive:{rules:[1,8],inclusive:!1},type_directive:{rules:[2,3,8],inclusive:!1},arg_directive:{rules:[3,4,8],inclusive:!1},ID:{rules:[7,8,15],inclusive:!1},ALIAS:{rules:[7,8,16,17],inclusive:!1},LINE:{rules:[7,8,28],inclusive:!1},INITIAL:{rules:[0,5,6,8,9,10,11,12,13,14,18,19,20,21,22,23,24,25,26,27,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,46,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67],inclusive:!0}}};return Dt}();Ot.lexer=oi;function kt(){this.yy={}}return kt.prototype=Ot,Ot.Parser=kt,new kt}();J0e.parser=J0e;const j$t=J0e;let LP,cx={},cL=[],rm=[],LK=!1,ege,L5;const $$t=function(i,a,f){rd.parseDirective(this,i,a,f)},H$t=function(i){cL.push({name:i.text,wrap:i.wrap===void 0&&d9()||!!i.wrap,fill:i.color,actorKeys:[]}),L5=cL.slice(-1)[0]},tge=function(i,a,f,p){let w=L5;const y=cx[i];if(y){if(L5&&y.box&&L5!==y.box)throw new Error("A same participant should only be defined in one Box: "+y.name+" can't be in '"+y.box.name+"' and in '"+L5.name+"' at the same time.");if(w=y.box?y.box:L5,y.box=w,y&&a===y.name&&f==null)return}(f==null||f.text==null)&&(f={text:a,wrap:null,type:p}),(p==null||f.text==null)&&(f={text:a,wrap:null,type:p}),cx[i]={box:w,name:a,description:f.text,wrap:f.wrap===void 0&&d9()||!!f.wrap,prevActor:LP,links:{},properties:{},actorCnt:null,rectData:null,type:p||"participant"},LP&&cx[LP]&&(cx[LP].nextActor=i),L5&&L5.actorKeys.push(i),LP=i},z$t=i=>{let a,f=0;for(a=0;a>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},y}return rm.push({from:i,to:a,message:f.text,wrap:f.wrap===void 0&&d9()||!!f.wrap,type:p}),!0},q$t=function(){return cL.length>0},V$t=function(){return cL.some(i=>i.name)},U$t=function(){return rm},W$t=function(){return cL},K$t=function(){return cx},MP=function(i){return cx[i]},Y$t=function(){return Object.keys(cx)},X$t=function(){LK=!0},Q$t=function(){LK=!1},Z$t=()=>LK,J$t=function(i){ege=i},d9=()=>ege!==void 0?ege:Tt().sequence.wrap,eHt=function(){cx={},cL=[],rm=[],LK=!1,rp()},tHt=function(i){const a=i.trim(),f={text:a.replace(/^:?(?:no)?wrap:/,"").trim(),wrap:a.match(/^:?wrap:/)!==null?!0:a.match(/^:?nowrap:/)!==null?!1:void 0};return Fe.debug("parseMessage:",f),f},nHt=function(i){const a=i.match(/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/);let f=a!=null&&a[1]?a[1].trim():"transparent",p=a!=null&&a[2]?a[2].trim():void 0;if(window&&window.CSS)window.CSS.supports("color",f)||(f="transparent",p=i.trim());else{const y=new Option().style;y.color=f,y.color!==f&&(f="transparent",p=i.trim())}return{color:f,text:p!==void 0?ep(p.replace(/^:?(?:no)?wrap:/,""),Tt()):void 0,wrap:p!==void 0?p.match(/^:?wrap:/)!==null?!0:p.match(/^:?nowrap:/)!==null?!1:void 0:void 0}},DP={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},rHt={FILLED:0,OPEN:1},iHt={LEFTOF:0,RIGHTOF:1,OVER:2},PRe=function(i,a,f){f.text,f.wrap===void 0&&d9()||f.wrap;const p=[].concat(i,i);rm.push({from:p[0],to:p[1],message:f.text,wrap:f.wrap===void 0&&d9()||!!f.wrap,type:DP.NOTE,placement:a})},BRe=function(i,a){const f=MP(i);try{let p=ep(a.text,Tt());p=p.replace(/&/g,"&"),p=p.replace(/=/g,"=");const w=JSON.parse(p);nge(f,w)}catch(p){Fe.error("error while parsing actor link text",p)}},sHt=function(i,a){const f=MP(i);try{const b={};let E=ep(a.text,Tt());var p=E.indexOf("@");E=E.replace(/&/g,"&"),E=E.replace(/=/g,"=");var w=E.slice(0,p-1).trim(),y=E.slice(p+1).trim();b[w]=y,nge(f,b)}catch(b){Fe.error("error while parsing actor link text",b)}};function nge(i,a){if(i.links==null)i.links=a;else for(let f in a)i.links[f]=a[f]}const RRe=function(i,a){const f=MP(i);try{let p=ep(a.text,Tt());const w=JSON.parse(p);FRe(f,w)}catch(p){Fe.error("error while parsing actor properties text",p)}};function FRe(i,a){if(i.properties==null)i.properties=a;else for(let f in a)i.properties[f]=a[f]}function aHt(){L5=void 0}const jRe=function(i,a){const f=MP(i),p=document.getElementById(a.text);try{const w=p.innerHTML,y=JSON.parse(w);y.properties&&FRe(f,y.properties),y.links&&nge(f,y.links)}catch(w){Fe.error("error while parsing actor details text",w)}},oHt=function(i,a){if(i!==void 0&&i.properties!==void 0)return i.properties[a]},$Re=function(i){if(Array.isArray(i))i.forEach(function(a){$Re(a)});else switch(i.type){case"sequenceIndex":rm.push({from:void 0,to:void 0,message:{start:i.sequenceIndex,step:i.sequenceIndexStep,visible:i.sequenceVisible},wrap:!1,type:i.signalType});break;case"addParticipant":tge(i.actor,i.actor,i.description,"participant");break;case"addActor":tge(i.actor,i.actor,i.description,"actor");break;case"activeStart":lf(i.actor,void 0,void 0,i.signalType);break;case"activeEnd":lf(i.actor,void 0,void 0,i.signalType);break;case"addNote":PRe(i.actor,i.placement,i.text);break;case"addLinks":BRe(i.actor,i.text);break;case"addALink":sHt(i.actor,i.text);break;case"addProperties":RRe(i.actor,i.text);break;case"addDetails":jRe(i.actor,i.text);break;case"addMessage":lf(i.from,i.to,i.msg,i.signalType);break;case"boxStart":H$t(i.boxData);break;case"boxEnd":aHt();break;case"loopStart":lf(void 0,void 0,i.loopText,i.signalType);break;case"loopEnd":lf(void 0,void 0,void 0,i.signalType);break;case"rectStart":lf(void 0,void 0,i.color,i.signalType);break;case"rectEnd":lf(void 0,void 0,void 0,i.signalType);break;case"optStart":lf(void 0,void 0,i.optText,i.signalType);break;case"optEnd":lf(void 0,void 0,void 0,i.signalType);break;case"altStart":lf(void 0,void 0,i.altText,i.signalType);break;case"else":lf(void 0,void 0,i.altText,i.signalType);break;case"altEnd":lf(void 0,void 0,void 0,i.signalType);break;case"setAccTitle":ip(i.text);break;case"parStart":lf(void 0,void 0,i.parText,i.signalType);break;case"and":lf(void 0,void 0,i.parText,i.signalType);break;case"parEnd":lf(void 0,void 0,void 0,i.signalType);break;case"criticalStart":lf(void 0,void 0,i.criticalText,i.signalType);break;case"option":lf(void 0,void 0,i.optionText,i.signalType);break;case"criticalEnd":lf(void 0,void 0,void 0,i.signalType);break;case"breakStart":lf(void 0,void 0,i.breakText,i.signalType);break;case"breakEnd":lf(void 0,void 0,void 0,i.signalType);break}},cHt={addActor:tge,addMessage:G$t,addSignal:lf,addLinks:BRe,addDetails:jRe,addProperties:RRe,autoWrap:d9,setWrap:J$t,enableSequenceNumbers:X$t,disableSequenceNumbers:Q$t,showSequenceNumbers:Z$t,getMessages:U$t,getActors:K$t,getActor:MP,getActorKeys:Y$t,getActorProperty:oHt,getAccTitle:L2,getBoxes:W$t,getDiagramTitle:Ww,setDiagramTitle:Uw,parseDirective:$$t,getConfig:()=>Tt().sequence,clear:eHt,parseMessage:tHt,parseBoxData:nHt,LINETYPE:DP,ARROWTYPE:rHt,PLACEMENT:iHt,addNote:PRe,setAccTitle:ip,apply:$Re,setAccDescription:M2,getAccDescription:D2,hasAtLeastOneBox:q$t,hasAtLeastOneBoxWithTitle:V$t},uHt=i=>`.actor { - stroke: ${i.actorBorder}; - fill: ${i.actorBkg}; +`,"getStyles"),Mue=Wze});var cO,qze,uO,Oue=R(()=>{"use strict";cO={CONTAINS:"contains",ARROW:"arrow"},qze=o((t,e)=>{let r=t.append("defs").append("marker").attr("id",cO.CONTAINS+"_line_ending").attr("refX",0).attr("refY",e.line_height/2).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("g");r.append("circle").attr("cx",e.line_height/2).attr("cy",e.line_height/2).attr("r",e.line_height/2).attr("fill","none"),r.append("line").attr("x1",0).attr("x2",e.line_height).attr("y1",e.line_height/2).attr("y2",e.line_height/2).attr("stroke-width",1),r.append("line").attr("y1",0).attr("y2",e.line_height).attr("x1",e.line_height/2).attr("x2",e.line_height/2).attr("stroke-width",1),t.append("defs").append("marker").attr("id",cO.ARROW+"_line_ending").attr("refX",e.line_height).attr("refY",.5*e.line_height).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("path").attr("d",`M0,0 + L${e.line_height},${e.line_height/2} + M${e.line_height},${e.line_height/2} + L0,${e.line_height}`).attr("stroke-width",1)},"insertLineEndings"),uO={ReqMarkers:cO,insertLineEndings:qze}});var ai,Pue,Bue,Fue,zue,Xze,jze,Kze,Qze,Zze,Jze,Og,eGe,Gue,$ue=R(()=>{"use strict";Zt();Vd();ya();_t();ut();Yn();rr();Oue();ai={},Pue=0,Bue=o((t,e)=>t.insert("rect","#"+e).attr("class","req reqBox").attr("x",0).attr("y",0).attr("width",ai.rect_min_width+"px").attr("height",ai.rect_min_height+"px"),"newRectNode"),Fue=o((t,e,r)=>{let n=ai.rect_min_width/2,i=t.append("text").attr("class","req reqLabel reqTitle").attr("id",e).attr("x",n).attr("y",ai.rect_padding).attr("dominant-baseline","hanging"),a=0;r.forEach(h=>{a==0?i.append("tspan").attr("text-anchor","middle").attr("x",ai.rect_min_width/2).attr("dy",0).text(h):i.append("tspan").attr("text-anchor","middle").attr("x",ai.rect_min_width/2).attr("dy",ai.line_height*.75).text(h),a++});let s=1.5*ai.rect_padding,l=a*ai.line_height*.75,u=s+l;return t.append("line").attr("class","req-title-line").attr("x1","0").attr("x2",ai.rect_min_width).attr("y1",u).attr("y2",u),{titleNode:i,y:u}},"newTitleNode"),zue=o((t,e,r,n)=>{let i=t.append("text").attr("class","req reqLabel").attr("id",e).attr("x",ai.rect_padding).attr("y",n).attr("dominant-baseline","hanging"),a=0,s=30,l=[];return r.forEach(u=>{let h=u.length;for(;h>s&&a<3;){let f=u.substring(0,s);u=u.substring(s,u.length),h=u.length,l[l.length]=f,a++}if(a==3){let f=l[l.length-1];l[l.length-1]=f.substring(0,f.length-4)+"..."}else l[l.length]=u;a=0}),l.forEach(u=>{i.append("tspan").attr("x",ai.rect_padding).attr("dy",ai.line_height).text(u)}),i},"newBodyNode"),Xze=o((t,e,r,n)=>{let i=e.node().getTotalLength(),a=e.node().getPointAtLength(i*.5),s="rel"+Pue;Pue++;let u=t.append("text").attr("class","req relationshipLabel").attr("id",s).attr("x",a.x).attr("y",a.y).attr("text-anchor","middle").attr("dominant-baseline","middle").text(n).node().getBBox();t.insert("rect","#"+s).attr("class","req reqLabelBox").attr("x",a.x-u.width/2).attr("y",a.y-u.height/2).attr("width",u.width).attr("height",u.height).attr("fill","white").attr("fill-opacity","85%")},"addEdgeLabel"),jze=o(function(t,e,r,n,i){let a=r.edge(Og(e.src),Og(e.dst)),s=ha().x(function(u){return u.x}).y(function(u){return u.y}),l=t.insert("path","#"+n).attr("class","er relationshipLine").attr("d",s(a.points)).attr("fill","none");e.type==i.db.Relationships.CONTAINS?l.attr("marker-start","url("+We.getUrl(ai.arrowMarkerAbsolute)+"#"+e.type+"_line_ending)"):(l.attr("stroke-dasharray","10,7"),l.attr("marker-end","url("+We.getUrl(ai.arrowMarkerAbsolute)+"#"+uO.ReqMarkers.ARROW+"_line_ending)")),Xze(t,l,ai,`<<${e.type}>>`)},"drawRelationshipFromLayout"),Kze=o((t,e,r)=>{t.forEach((n,i)=>{i=Og(i),V.info("Added new requirement: ",i);let a=r.append("g").attr("id",i),s="req-"+i,l=Bue(a,s),u=[],h=Fue(a,i+"_title",[`<<${n.type}>>`,`${n.name}`]);u.push(h.titleNode);let f=zue(a,i+"_body",[`Id: ${n.id}`,`Text: ${n.text}`,`Risk: ${n.risk}`,`Verification: ${n.verifyMethod}`],h.y);u.push(f);let d=l.node().getBBox();e.setNode(i,{width:d.width,height:d.height,shape:"rect",id:i})})},"drawReqs"),Qze=o((t,e,r)=>{t.forEach((n,i)=>{let a=Og(i),s=r.append("g").attr("id",a),l="element-"+a,u=Bue(s,l),h=[],f=Fue(s,l+"_title",["<>",`${i}`]);h.push(f.titleNode);let d=zue(s,l+"_body",[`Type: ${n.type||"Not Specified"}`,`Doc Ref: ${n.docRef||"None"}`],f.y);h.push(d);let p=u.node().getBBox();e.setNode(a,{width:p.width,height:p.height,shape:"rect",id:a})})},"drawElements"),Zze=o((t,e)=>(t.forEach(function(r){let n=Og(r.src),i=Og(r.dst);e.setEdge(n,i,{relationship:r})}),t),"addRelationships"),Jze=o(function(t,e){e.nodes().forEach(function(r){r!==void 0&&e.node(r)!==void 0&&(t.select("#"+r),t.select("#"+r).attr("transform","translate("+(e.node(r).x-e.node(r).width/2)+","+(e.node(r).y-e.node(r).height/2)+" )"))})},"adjustEntities"),Og=o(t=>t.replace(/\s/g,"").replace(/\./g,"_"),"elementString"),eGe=o((t,e,r,n)=>{ai=de().requirement;let i=ai.securityLevel,a;i==="sandbox"&&(a=$e("#i"+e));let l=(i==="sandbox"?$e(a.nodes()[0].contentDocument.body):$e("body")).select(`[id='${e}']`);uO.insertLineEndings(l,ai);let u=new lr({multigraph:!1,compound:!1,directed:!0}).setGraph({rankdir:ai.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel(function(){return{}}),h=n.db.getRequirements(),f=n.db.getElements(),d=n.db.getRelationships();Kze(h,u,l),Qze(f,u,l),Zze(d,u),lo(u),Jze(l,u),d.forEach(function(v){jze(l,v,u,e,n)});let p=ai.rect_padding,m=l.node().getBBox(),g=m.width+p*2,y=m.height+p*2;Sr(l,y,g,ai.useMaxWidth),l.attr("viewBox",`${m.x-p} ${m.y-p} ${g} ${y}`)},"draw"),Gue={draw:eGe}});var Vue={};hr(Vue,{diagram:()=>tGe});var tGe,Uue=R(()=>{"use strict";Due();Nue();Iue();$ue();tGe={parser:Lue,db:Rue,renderer:Gue,styles:Mue}});var hO,Wue,que=R(()=>{"use strict";hO=function(){var t=o(function(H,q,K,se){for(K=K||{},se=H.length;se--;K[H[se]]=q);return K},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],l=[1,13],u=[1,14],h=[1,16],f=[1,17],d=[1,18],p=[1,24],m=[1,25],g=[1,26],y=[1,27],v=[1,28],x=[1,29],b=[1,30],w=[1,31],S=[1,32],T=[1,33],E=[1,34],_=[1,35],A=[1,36],L=[1,37],M=[1,38],N=[1,39],k=[1,41],I=[1,42],C=[1,43],O=[1,44],D=[1,45],P=[1,46],F=[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],B=[4,5,16,50,52,53],$=[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],z=[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],Y=[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],Q=[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],X=[68,69,70],ie=[1,122],j={trace:o(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,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:o(function(q,K,se,ce,ue,te,De){var oe=te.length-1;switch(ue){case 3:return ce.apply(te[oe]),te[oe];break;case 4:case 9:this.$=[];break;case 5:case 10:te[oe-1].push(te[oe]),this.$=te[oe-1];break;case 6:case 7:case 11:case 12:this.$=te[oe];break;case 8:case 13:this.$=[];break;case 15:te[oe].type="createParticipant",this.$=te[oe];break;case 16:te[oe-1].unshift({type:"boxStart",boxData:ce.parseBoxData(te[oe-2])}),te[oe-1].push({type:"boxEnd",boxText:te[oe-2]}),this.$=te[oe-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(te[oe-2]),sequenceIndexStep:Number(te[oe-1]),sequenceVisible:!0,signalType:ce.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(te[oe-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:ce.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:ce.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:ce.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:ce.LINETYPE.ACTIVE_START,actor:te[oe-1].actor};break;case 23:this.$={type:"activeEnd",signalType:ce.LINETYPE.ACTIVE_END,actor:te[oe-1].actor};break;case 29:ce.setDiagramTitle(te[oe].substring(6)),this.$=te[oe].substring(6);break;case 30:ce.setDiagramTitle(te[oe].substring(7)),this.$=te[oe].substring(7);break;case 31:this.$=te[oe].trim(),ce.setAccTitle(this.$);break;case 32:case 33:this.$=te[oe].trim(),ce.setAccDescription(this.$);break;case 34:te[oe-1].unshift({type:"loopStart",loopText:ce.parseMessage(te[oe-2]),signalType:ce.LINETYPE.LOOP_START}),te[oe-1].push({type:"loopEnd",loopText:te[oe-2],signalType:ce.LINETYPE.LOOP_END}),this.$=te[oe-1];break;case 35:te[oe-1].unshift({type:"rectStart",color:ce.parseMessage(te[oe-2]),signalType:ce.LINETYPE.RECT_START}),te[oe-1].push({type:"rectEnd",color:ce.parseMessage(te[oe-2]),signalType:ce.LINETYPE.RECT_END}),this.$=te[oe-1];break;case 36:te[oe-1].unshift({type:"optStart",optText:ce.parseMessage(te[oe-2]),signalType:ce.LINETYPE.OPT_START}),te[oe-1].push({type:"optEnd",optText:ce.parseMessage(te[oe-2]),signalType:ce.LINETYPE.OPT_END}),this.$=te[oe-1];break;case 37:te[oe-1].unshift({type:"altStart",altText:ce.parseMessage(te[oe-2]),signalType:ce.LINETYPE.ALT_START}),te[oe-1].push({type:"altEnd",signalType:ce.LINETYPE.ALT_END}),this.$=te[oe-1];break;case 38:te[oe-1].unshift({type:"parStart",parText:ce.parseMessage(te[oe-2]),signalType:ce.LINETYPE.PAR_START}),te[oe-1].push({type:"parEnd",signalType:ce.LINETYPE.PAR_END}),this.$=te[oe-1];break;case 39:te[oe-1].unshift({type:"parStart",parText:ce.parseMessage(te[oe-2]),signalType:ce.LINETYPE.PAR_OVER_START}),te[oe-1].push({type:"parEnd",signalType:ce.LINETYPE.PAR_END}),this.$=te[oe-1];break;case 40:te[oe-1].unshift({type:"criticalStart",criticalText:ce.parseMessage(te[oe-2]),signalType:ce.LINETYPE.CRITICAL_START}),te[oe-1].push({type:"criticalEnd",signalType:ce.LINETYPE.CRITICAL_END}),this.$=te[oe-1];break;case 41:te[oe-1].unshift({type:"breakStart",breakText:ce.parseMessage(te[oe-2]),signalType:ce.LINETYPE.BREAK_START}),te[oe-1].push({type:"breakEnd",optText:ce.parseMessage(te[oe-2]),signalType:ce.LINETYPE.BREAK_END}),this.$=te[oe-1];break;case 43:this.$=te[oe-3].concat([{type:"option",optionText:ce.parseMessage(te[oe-1]),signalType:ce.LINETYPE.CRITICAL_OPTION},te[oe]]);break;case 45:this.$=te[oe-3].concat([{type:"and",parText:ce.parseMessage(te[oe-1]),signalType:ce.LINETYPE.PAR_AND},te[oe]]);break;case 47:this.$=te[oe-3].concat([{type:"else",altText:ce.parseMessage(te[oe-1]),signalType:ce.LINETYPE.ALT_ELSE},te[oe]]);break;case 48:te[oe-3].draw="participant",te[oe-3].type="addParticipant",te[oe-3].description=ce.parseMessage(te[oe-1]),this.$=te[oe-3];break;case 49:te[oe-1].draw="participant",te[oe-1].type="addParticipant",this.$=te[oe-1];break;case 50:te[oe-3].draw="actor",te[oe-3].type="addParticipant",te[oe-3].description=ce.parseMessage(te[oe-1]),this.$=te[oe-3];break;case 51:te[oe-1].draw="actor",te[oe-1].type="addParticipant",this.$=te[oe-1];break;case 52:te[oe-1].type="destroyParticipant",this.$=te[oe-1];break;case 53:this.$=[te[oe-1],{type:"addNote",placement:te[oe-2],actor:te[oe-1].actor,text:te[oe]}];break;case 54:te[oe-2]=[].concat(te[oe-1],te[oe-1]).slice(0,2),te[oe-2][0]=te[oe-2][0].actor,te[oe-2][1]=te[oe-2][1].actor,this.$=[te[oe-1],{type:"addNote",placement:ce.PLACEMENT.OVER,actor:te[oe-2].slice(0,2),text:te[oe]}];break;case 55:this.$=[te[oe-1],{type:"addLinks",actor:te[oe-1].actor,text:te[oe]}];break;case 56:this.$=[te[oe-1],{type:"addALink",actor:te[oe-1].actor,text:te[oe]}];break;case 57:this.$=[te[oe-1],{type:"addProperties",actor:te[oe-1].actor,text:te[oe]}];break;case 58:this.$=[te[oe-1],{type:"addDetails",actor:te[oe-1].actor,text:te[oe]}];break;case 61:this.$=[te[oe-2],te[oe]];break;case 62:this.$=te[oe];break;case 63:this.$=ce.PLACEMENT.LEFTOF;break;case 64:this.$=ce.PLACEMENT.RIGHTOF;break;case 65:this.$=[te[oe-4],te[oe-1],{type:"addMessage",from:te[oe-4].actor,to:te[oe-1].actor,signalType:te[oe-3],msg:te[oe],activate:!0},{type:"activeStart",signalType:ce.LINETYPE.ACTIVE_START,actor:te[oe-1].actor}];break;case 66:this.$=[te[oe-4],te[oe-1],{type:"addMessage",from:te[oe-4].actor,to:te[oe-1].actor,signalType:te[oe-3],msg:te[oe]},{type:"activeEnd",signalType:ce.LINETYPE.ACTIVE_END,actor:te[oe-4].actor}];break;case 67:this.$=[te[oe-3],te[oe-1],{type:"addMessage",from:te[oe-3].actor,to:te[oe-1].actor,signalType:te[oe-2],msg:te[oe]}];break;case 68:this.$={type:"addParticipant",actor:te[oe]};break;case 69:this.$=ce.LINETYPE.SOLID_OPEN;break;case 70:this.$=ce.LINETYPE.DOTTED_OPEN;break;case 71:this.$=ce.LINETYPE.SOLID;break;case 72:this.$=ce.LINETYPE.BIDIRECTIONAL_SOLID;break;case 73:this.$=ce.LINETYPE.DOTTED;break;case 74:this.$=ce.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 75:this.$=ce.LINETYPE.SOLID_CROSS;break;case 76:this.$=ce.LINETYPE.DOTTED_CROSS;break;case 77:this.$=ce.LINETYPE.SOLID_POINT;break;case 78:this.$=ce.LINETYPE.DOTTED_POINT;break;case 79:this.$=ce.parseMessage(te[oe].trim().substring(1));break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([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],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,12:12,13:l,14:u,17:15,18:h,21:f,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:m,31:g,33:y,35:v,36:x,37:b,38:w,39:S,41:T,43:E,44:_,46:A,50:L,52:M,53:N,54:k,59:I,60:C,61:O,62:D,70:P},t(F,[2,5]),{9:47,12:12,13:l,14:u,17:15,18:h,21:f,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:m,31:g,33:y,35:v,36:x,37:b,38:w,39:S,41:T,43:E,44:_,46:A,50:L,52:M,53:N,54:k,59:I,60:C,61:O,62:D,70:P},t(F,[2,7]),t(F,[2,8]),t(F,[2,14]),{12:48,50:L,52:M,53:N},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:P},{22:55,70:P},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(F,[2,29]),t(F,[2,30]),{32:[1,61]},{34:[1,62]},t(F,[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:P},{22:72,70:P},{22:73,70:P},{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:P},{22:90,70:P},{22:91,70:P},{22:92,70:P},t([5,51,64,71,72,73,74,75,76,77,78,79,80,81],[2,68]),t(F,[2,6]),t(F,[2,15]),t(B,[2,9],{10:93}),t(F,[2,17]),{5:[1,95],19:[1,94]},{5:[1,96]},t(F,[2,21]),{5:[1,97]},{5:[1,98]},t(F,[2,24]),t(F,[2,25]),t(F,[2,26]),t(F,[2,27]),t(F,[2,28]),t(F,[2,31]),t(F,[2,32]),t($,i,{7:99}),t($,i,{7:100}),t($,i,{7:101}),t(z,i,{40:102,7:103}),t(Y,i,{42:104,7:105}),t(Y,i,{7:105,42:106}),t(Q,i,{45:107,7:108}),t($,i,{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:P},t(X,[2,69]),t(X,[2,70]),t(X,[2,71]),t(X,[2,72]),t(X,[2,73]),t(X,[2,74]),t(X,[2,75]),t(X,[2,76]),t(X,[2,77]),t(X,[2,78]),{22:118,70:P},{22:120,58:119,70:P},{70:[2,63]},{70:[2,64]},{56:121,81:ie},{56:123,81:ie},{56:124,81:ie},{56:125,81:ie},{4:[1,128],5:[1,130],11:127,12:129,16:[1,126],50:L,52:M,53:N},{5:[1,131]},t(F,[2,19]),t(F,[2,20]),t(F,[2,22]),t(F,[2,23]),{4:a,5:s,8:8,9:10,12:12,13:l,14:u,16:[1,132],17:15,18:h,21:f,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:m,31:g,33:y,35:v,36:x,37:b,38:w,39:S,41:T,43:E,44:_,46:A,50:L,52:M,53:N,54:k,59:I,60:C,61:O,62:D,70:P},{4:a,5:s,8:8,9:10,12:12,13:l,14:u,16:[1,133],17:15,18:h,21:f,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:m,31:g,33:y,35:v,36:x,37:b,38:w,39:S,41:T,43:E,44:_,46:A,50:L,52:M,53:N,54:k,59:I,60:C,61:O,62:D,70:P},{4:a,5:s,8:8,9:10,12:12,13:l,14:u,16:[1,134],17:15,18:h,21:f,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:m,31:g,33:y,35:v,36:x,37:b,38:w,39:S,41:T,43:E,44:_,46:A,50:L,52:M,53:N,54:k,59:I,60:C,61:O,62:D,70:P},{16:[1,135]},{4:a,5:s,8:8,9:10,12:12,13:l,14:u,16:[2,46],17:15,18:h,21:f,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:m,31:g,33:y,35:v,36:x,37:b,38:w,39:S,41:T,43:E,44:_,46:A,49:[1,136],50:L,52:M,53:N,54:k,59:I,60:C,61:O,62:D,70:P},{16:[1,137]},{4:a,5:s,8:8,9:10,12:12,13:l,14:u,16:[2,44],17:15,18:h,21:f,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:m,31:g,33:y,35:v,36:x,37:b,38:w,39:S,41:T,43:E,44:_,46:A,48:[1,138],50:L,52:M,53:N,54:k,59:I,60:C,61:O,62:D,70:P},{16:[1,139]},{16:[1,140]},{4:a,5:s,8:8,9:10,12:12,13:l,14:u,16:[2,42],17:15,18:h,21:f,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:m,31:g,33:y,35:v,36:x,37:b,38:w,39:S,41:T,43:E,44:_,46:A,47:[1,141],50:L,52:M,53:N,54:k,59:I,60:C,61:O,62:D,70:P},{4:a,5:s,8:8,9:10,12:12,13:l,14:u,16:[1,142],17:15,18:h,21:f,22:40,23:d,24:19,25:20,26:21,27:22,28:23,29:p,30:m,31:g,33:y,35:v,36:x,37:b,38:w,39:S,41:T,43:E,44:_,46:A,50:L,52:M,53:N,54:k,59:I,60:C,61:O,62:D,70:P},{15:[1,143]},t(F,[2,49]),{15:[1,144]},t(F,[2,51]),t(F,[2,52]),{22:145,70:P},{22:146,70:P},{56:147,81:ie},{56:148,81:ie},{56:149,81:ie},{64:[1,150],81:[2,62]},{5:[2,55]},{5:[2,79]},{5:[2,56]},{5:[2,57]},{5:[2,58]},t(F,[2,16]),t(B,[2,10]),{12:151,50:L,52:M,53:N},t(B,[2,12]),t(B,[2,13]),t(F,[2,18]),t(F,[2,34]),t(F,[2,35]),t(F,[2,36]),t(F,[2,37]),{15:[1,152]},t(F,[2,38]),{15:[1,153]},t(F,[2,39]),t(F,[2,40]),{15:[1,154]},t(F,[2,41]),{5:[1,155]},{5:[1,156]},{56:157,81:ie},{56:158,81:ie},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:159,70:P},t(B,[2,11]),t(z,i,{7:103,40:160}),t(Y,i,{7:105,42:161}),t(Q,i,{7:108,45:162}),t(F,[2,48]),t(F,[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:o(function(q,K){if(K.recoverable)this.trace(q);else{var se=new Error(q);throw se.hash=K,se}},"parseError"),parse:o(function(q){var K=this,se=[0],ce=[],ue=[null],te=[],De=this.table,oe="",ke=0,Ie=0,Se=0,Ue=2,Pe=1,_e=te.slice.call(arguments,1),me=Object.create(this.lexer),W={yy:{}};for(var fe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,fe)&&(W.yy[fe]=this.yy[fe]);me.setInput(q,W.yy),W.yy.lexer=me,W.yy.parser=this,typeof me.yylloc>"u"&&(me.yylloc={});var ge=me.yylloc;te.push(ge);var re=me.options&&me.options.ranges;typeof W.yy.parseError=="function"?this.parseError=W.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function he(yt){se.length=se.length-2*yt,ue.length=ue.length-yt,te.length=te.length-yt}o(he,"popStack");function ne(){var yt;return yt=ce.pop()||me.lex()||Pe,typeof yt!="number"&&(yt instanceof Array&&(ce=yt,yt=ce.pop()),yt=K.symbols_[yt]||yt),yt}o(ne,"lex");for(var ae,we,Te,Ce,Ae,Ge,Me={},ye,He,ze,Ze;;){if(Te=se[se.length-1],this.defaultActions[Te]?Ce=this.defaultActions[Te]:((ae===null||typeof ae>"u")&&(ae=ne()),Ce=De[Te]&&De[Te][ae]),typeof Ce>"u"||!Ce.length||!Ce[0]){var gt="";Ze=[];for(ye in De[Te])this.terminals_[ye]&&ye>Ue&&Ze.push("'"+this.terminals_[ye]+"'");me.showPosition?gt="Parse error on line "+(ke+1)+`: +`+me.showPosition()+` +Expecting `+Ze.join(", ")+", got '"+(this.terminals_[ae]||ae)+"'":gt="Parse error on line "+(ke+1)+": Unexpected "+(ae==Pe?"end of input":"'"+(this.terminals_[ae]||ae)+"'"),this.parseError(gt,{text:me.match,token:this.terminals_[ae]||ae,line:me.yylineno,loc:ge,expected:Ze})}if(Ce[0]instanceof Array&&Ce.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Te+", token: "+ae);switch(Ce[0]){case 1:se.push(ae),ue.push(me.yytext),te.push(me.yylloc),se.push(Ce[1]),ae=null,we?(ae=we,we=null):(Ie=me.yyleng,oe=me.yytext,ke=me.yylineno,ge=me.yylloc,Se>0&&Se--);break;case 2:if(He=this.productions_[Ce[1]][1],Me.$=ue[ue.length-He],Me._$={first_line:te[te.length-(He||1)].first_line,last_line:te[te.length-1].last_line,first_column:te[te.length-(He||1)].first_column,last_column:te[te.length-1].last_column},re&&(Me._$.range=[te[te.length-(He||1)].range[0],te[te.length-1].range[1]]),Ge=this.performAction.apply(Me,[oe,Ie,ke,W.yy,Ce[1],ue,te].concat(_e)),typeof Ge<"u")return Ge;He&&(se=se.slice(0,-1*He*2),ue=ue.slice(0,-1*He),te=te.slice(0,-1*He)),se.push(this.productions_[Ce[1]][0]),ue.push(Me.$),te.push(Me._$),ze=De[se[se.length-2]][se[se.length-1]],se.push(ze);break;case 3:return!0}}return!0},"parse")},J=function(){var H={EOF:1,parseError:o(function(K,se){if(this.yy.parser)this.yy.parser.parseError(K,se);else throw new Error(K)},"parseError"),setInput:o(function(q,K){return this.yy=K||this.yy||{},this._input=q,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var q=this._input[0];this.yytext+=q,this.yyleng++,this.offset++,this.match+=q,this.matched+=q;var K=q.match(/(?:\r\n?|\n).*/g);return K?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),q},"input"),unput:o(function(q){var K=q.length,se=q.split(/(?:\r\n?|\n)/g);this._input=q+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-K),this.offset-=K;var ce=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),se.length-1&&(this.yylineno-=se.length-1);var ue=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:se?(se.length===ce.length?this.yylloc.first_column:0)+ce[ce.length-se.length].length-se[0].length:this.yylloc.first_column-K},this.options.ranges&&(this.yylloc.range=[ue[0],ue[0]+this.yyleng-K]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(q){this.unput(this.match.slice(q))},"less"),pastInput:o(function(){var q=this.matched.substr(0,this.matched.length-this.match.length);return(q.length>20?"...":"")+q.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var q=this.match;return q.length<20&&(q+=this._input.substr(0,20-q.length)),(q.substr(0,20)+(q.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var q=this.pastInput(),K=new Array(q.length+1).join("-");return q+this.upcomingInput()+` +`+K+"^"},"showPosition"),test_match:o(function(q,K){var se,ce,ue;if(this.options.backtrack_lexer&&(ue={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},this.options.ranges&&(ue.yylloc.range=this.yylloc.range.slice(0))),ce=q[0].match(/(?:\r\n?|\n).*/g),ce&&(this.yylineno+=ce.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ce?ce[ce.length-1].length-ce[ce.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+q[0].length},this.yytext+=q[0],this.match+=q[0],this.matches=q,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(q[0].length),this.matched+=q[0],se=this.performAction.call(this,this.yy,this,K,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),se)return se;if(this._backtrack){for(var te in ue)this[te]=ue[te];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var q,K,se,ce;this._more||(this.yytext="",this.match="");for(var ue=this._currentRules(),te=0;teK[0].length)){if(K=se,ce=te,this.options.backtrack_lexer){if(q=this.test_match(se,ue[te]),q!==!1)return q;if(this._backtrack){K=!1;continue}else return!1}else if(!this.options.flex)break}return K?(q=this.test_match(K,ue[ce]),q!==!1?q:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var K=this.next();return K||this.lex()},"lex"),begin:o(function(K){this.conditionStack.push(K)},"begin"),popState:o(function(){var K=this.conditionStack.length-1;return K>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(K){return K=this.conditionStack.length-1-Math.abs(K||0),K>=0?this.conditionStack[K]:"INITIAL"},"topState"),pushState:o(function(K){this.begin(K)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(K,se,ce,ue){var te=ue;switch(ce){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:return this.begin("LINE"),14;break;case 8:return this.begin("ID"),50;break;case 9:return this.begin("ID"),52;break;case 10:return 13;case 11:return this.begin("ID"),53;break;case 12:return se.yytext=se.yytext.trim(),this.begin("ALIAS"),70;break;case 13:return this.popState(),this.popState(),this.begin("LINE"),51;break;case 14:return this.popState(),this.popState(),5;break;case 15:return this.begin("LINE"),36;break;case 16:return this.begin("LINE"),37;break;case 17:return this.begin("LINE"),38;break;case 18:return this.begin("LINE"),39;break;case 19:return this.begin("LINE"),49;break;case 20:return this.begin("LINE"),41;break;case 21:return this.begin("LINE"),43;break;case 22:return this.begin("LINE"),48;break;case 23:return this.begin("LINE"),44;break;case 24:return this.begin("LINE"),47;break;case 25:return this.begin("LINE"),46;break;case 26:return this.popState(),15;break;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:return this.begin("ID"),21;break;case 37:return this.begin("ID"),23;break;case 38:return 29;case 39:return 30;case 40:return this.begin("acc_title"),31;break;case 41:return this.popState(),"acc_title_value";break;case 42:return this.begin("acc_descr"),33;break;case 43:return this.popState(),"acc_descr_value";break;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:return se.yytext=se.yytext.trim(),70;break;case 53:return 73;case 54:return 74;case 55:return 75;case 56:return 76;case 57:return 71;case 58:return 72;case 59:return 77;case 60:return 78;case 61:return 79;case 62:return 80;case 63:return 81;case 64:return 68;case 65:return 69;case 66:return 5;case 67:return"INVALID"}},"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:!1},acc_descr:{rules:[43],inclusive:!1},acc_title:{rules:[41],inclusive:!1},ID:{rules:[2,3,12],inclusive:!1},ALIAS:{rules:[2,3,13,14],inclusive:!1},LINE:{rules:[2,3,26],inclusive:!1},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:!0}}};return H}();j.lexer=J;function Z(){this.yy={}}return o(Z,"Parser"),Z.prototype=j,j.Parser=Z,new Z}();hO.parser=hO;Wue=hO});function dO(t,e){if(t.links==null)t.links=e;else for(let r in e)t.links[r]=e[r]}function Zue(t,e){if(t.properties==null)t.properties=e;else for(let r in e)t.properties[r]=e[r]}function SGe(){Mt.records.currentBox=void 0}var Mt,aGe,fO,sGe,oGe,pi,lGe,cGe,uGe,hGe,fGe,dGe,pGe,xx,mGe,gGe,yGe,vGe,xGe,Xue,A0,bGe,wGe,TGe,vx,kGe,EGe,jue,Kue,CGe,Que,Jue,AGe,ehe,pO,the=R(()=>{"use strict";_t();ut();Jk();rr();bi();Mt=new uf(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),aGe=o(function(t){Mt.records.boxes.push({name:t.text,wrap:t.wrap??A0(),fill:t.color,actorKeys:[]}),Mt.records.currentBox=Mt.records.boxes.slice(-1)[0]},"addBox"),fO=o(function(t,e,r,n){let i=Mt.records.currentBox,a=Mt.records.actors.get(t);if(a){if(Mt.records.currentBox&&a.box&&Mt.records.currentBox!==a.box)throw new Error(`A same participant should only be defined in one Box: ${a.name} can't be in '${a.box.name}' and in '${Mt.records.currentBox.name}' at the same time.`);if(i=a.box?a.box:Mt.records.currentBox,a.box=i,a&&e===a.name&&r==null)return}if(r?.text==null&&(r={text:e,type:n}),(n==null||r.text==null)&&(r={text:e,type:n}),Mt.records.actors.set(t,{box:i,name:e,description:r.text,wrap:r.wrap??A0(),prevActor:Mt.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:n??"participant"}),Mt.records.prevActor){let s=Mt.records.actors.get(Mt.records.prevActor);s&&(s.nextActor=t)}Mt.records.currentBox&&Mt.records.currentBox.actorKeys.push(t),Mt.records.prevActor=t},"addActor"),sGe=o(t=>{let e,r=0;if(!t)return 0;for(e=0;e>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},s}return Mt.records.messages.push({from:t,to:e,message:r?.text??"",wrap:r?.wrap??A0(),type:n,activate:i}),!0},"addSignal"),lGe=o(function(){return Mt.records.boxes.length>0},"hasAtLeastOneBox"),cGe=o(function(){return Mt.records.boxes.some(t=>t.name)},"hasAtLeastOneBoxWithTitle"),uGe=o(function(){return Mt.records.messages},"getMessages"),hGe=o(function(){return Mt.records.boxes},"getBoxes"),fGe=o(function(){return Mt.records.actors},"getActors"),dGe=o(function(){return Mt.records.createdActors},"getCreatedActors"),pGe=o(function(){return Mt.records.destroyedActors},"getDestroyedActors"),xx=o(function(t){return Mt.records.actors.get(t)},"getActor"),mGe=o(function(){return[...Mt.records.actors.keys()]},"getActorKeys"),gGe=o(function(){Mt.records.sequenceNumbersEnabled=!0},"enableSequenceNumbers"),yGe=o(function(){Mt.records.sequenceNumbersEnabled=!1},"disableSequenceNumbers"),vGe=o(()=>Mt.records.sequenceNumbersEnabled,"showSequenceNumbers"),xGe=o(function(t){Mt.records.wrapEnabled=t},"setWrap"),Xue=o(t=>{if(t===void 0)return{};t=t.trim();let e=/^:?wrap:/.exec(t)!==null?!0:/^:?nowrap:/.exec(t)!==null?!1:void 0;return{cleanedText:(e===void 0?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:e}},"extractWrap"),A0=o(()=>Mt.records.wrapEnabled!==void 0?Mt.records.wrapEnabled:de().sequence?.wrap??!1,"autoWrap"),bGe=o(function(){Mt.reset(),vr()},"clear"),wGe=o(function(t){let e=t.trim(),{wrap:r,cleanedText:n}=Xue(e),i={text:n,wrap:r};return V.debug(`parseMessage: ${JSON.stringify(i)}`),i},"parseMessage"),TGe=o(function(t){let e=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t),r=e?.[1]?e[1].trim():"transparent",n=e?.[2]?e[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",r)||(r="transparent",n=t.trim());else{let s=new Option().style;s.color=r,s.color!==r&&(r="transparent",n=t.trim())}let{wrap:i,cleanedText:a}=Xue(n);return{text:a?qr(a,de()):void 0,color:r,wrap:i}},"parseBoxData"),vx={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},kGe={FILLED:0,OPEN:1},EGe={LEFTOF:0,RIGHTOF:1,OVER:2},jue=o(function(t,e,r){let n={actor:t,placement:e,message:r.text,wrap:r.wrap??A0()},i=[].concat(t,t);Mt.records.notes.push(n),Mt.records.messages.push({from:i[0],to:i[1],message:r.text,wrap:r.wrap??A0(),type:vx.NOTE,placement:e})},"addNote"),Kue=o(function(t,e){let r=xx(t);try{let n=qr(e.text,de());n=n.replace(/&/g,"&"),n=n.replace(/=/g,"=");let i=JSON.parse(n);dO(r,i)}catch(n){V.error("error while parsing actor link text",n)}},"addLinks"),CGe=o(function(t,e){let r=xx(t);try{let n={},i=qr(e.text,de()),a=i.indexOf("@");i=i.replace(/&/g,"&"),i=i.replace(/=/g,"=");let s=i.slice(0,a-1).trim(),l=i.slice(a+1).trim();n[s]=l,dO(r,n)}catch(n){V.error("error while parsing actor link text",n)}},"addALink");o(dO,"insertLinks");Que=o(function(t,e){let r=xx(t);try{let n=qr(e.text,de()),i=JSON.parse(n);Zue(r,i)}catch(n){V.error("error while parsing actor properties text",n)}},"addProperties");o(Zue,"insertProperties");o(SGe,"boxEnd");Jue=o(function(t,e){let r=xx(t),n=document.getElementById(e.text);try{let i=n.innerHTML,a=JSON.parse(i);a.properties&&Zue(r,a.properties),a.links&&dO(r,a.links)}catch(i){V.error("error while parsing actor details text",i)}},"addDetails"),AGe=o(function(t,e){if(t?.properties!==void 0)return t.properties[e]},"getActorProperty"),ehe=o(function(t){if(Array.isArray(t))t.forEach(function(e){ehe(e)});else switch(t.type){case"sequenceIndex":Mt.records.messages.push({from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":fO(t.actor,t.actor,t.description,t.draw);break;case"createParticipant":if(Mt.records.actors.has(t.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");Mt.records.lastCreated=t.actor,fO(t.actor,t.actor,t.description,t.draw),Mt.records.createdActors.set(t.actor,Mt.records.messages.length);break;case"destroyParticipant":Mt.records.lastDestroyed=t.actor,Mt.records.destroyedActors.set(t.actor,Mt.records.messages.length);break;case"activeStart":pi(t.actor,void 0,void 0,t.signalType);break;case"activeEnd":pi(t.actor,void 0,void 0,t.signalType);break;case"addNote":jue(t.actor,t.placement,t.text);break;case"addLinks":Kue(t.actor,t.text);break;case"addALink":CGe(t.actor,t.text);break;case"addProperties":Que(t.actor,t.text);break;case"addDetails":Jue(t.actor,t.text);break;case"addMessage":if(Mt.records.lastCreated){if(t.to!==Mt.records.lastCreated)throw new Error("The created participant "+Mt.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");Mt.records.lastCreated=void 0}else if(Mt.records.lastDestroyed){if(t.to!==Mt.records.lastDestroyed&&t.from!==Mt.records.lastDestroyed)throw new Error("The destroyed participant "+Mt.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");Mt.records.lastDestroyed=void 0}pi(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":aGe(t.boxData);break;case"boxEnd":SGe();break;case"loopStart":pi(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":pi(void 0,void 0,void 0,t.signalType);break;case"rectStart":pi(void 0,void 0,t.color,t.signalType);break;case"rectEnd":pi(void 0,void 0,void 0,t.signalType);break;case"optStart":pi(void 0,void 0,t.optText,t.signalType);break;case"optEnd":pi(void 0,void 0,void 0,t.signalType);break;case"altStart":pi(void 0,void 0,t.altText,t.signalType);break;case"else":pi(void 0,void 0,t.altText,t.signalType);break;case"altEnd":pi(void 0,void 0,void 0,t.signalType);break;case"setAccTitle":kr(t.text);break;case"parStart":pi(void 0,void 0,t.parText,t.signalType);break;case"and":pi(void 0,void 0,t.parText,t.signalType);break;case"parEnd":pi(void 0,void 0,void 0,t.signalType);break;case"criticalStart":pi(void 0,void 0,t.criticalText,t.signalType);break;case"option":pi(void 0,void 0,t.optionText,t.signalType);break;case"criticalEnd":pi(void 0,void 0,void 0,t.signalType);break;case"breakStart":pi(void 0,void 0,t.breakText,t.signalType);break;case"breakEnd":pi(void 0,void 0,void 0,t.signalType);break}},"apply"),pO={addActor:fO,addMessage:oGe,addSignal:pi,addLinks:Kue,addDetails:Jue,addProperties:Que,autoWrap:A0,setWrap:xGe,enableSequenceNumbers:gGe,disableSequenceNumbers:yGe,showSequenceNumbers:vGe,getMessages:uGe,getActors:fGe,getCreatedActors:dGe,getDestroyedActors:pGe,getActor:xx,getActorKeys:mGe,getActorProperty:AGe,getAccTitle:Ar,getBoxes:hGe,getDiagramTitle:Xr,setDiagramTitle:nn,getConfig:o(()=>de().sequence,"getConfig"),clear:bGe,parseMessage:wGe,parseBoxData:TGe,LINETYPE:vx,ARROWTYPE:kGe,PLACEMENT:EGe,addNote:jue,setAccTitle:kr,apply:ehe,setAccDescription:_r,getAccDescription:Lr,hasAtLeastOneBox:lGe,hasAtLeastOneBoxWithTitle:cGe}});var _Ge,rhe,nhe=R(()=>{"use strict";_Ge=o(t=>`.actor { + stroke: ${t.actorBorder}; + fill: ${t.actorBkg}; } text.actor > tspan { - fill: ${i.actorTextColor}; + fill: ${t.actorTextColor}; stroke: none; } .actor-line { - stroke: ${i.actorLineColor}; + stroke: ${t.actorLineColor}; } .messageLine0 { stroke-width: 1.5; stroke-dasharray: none; - stroke: ${i.signalColor}; + stroke: ${t.signalColor}; } .messageLine1 { stroke-width: 1.5; stroke-dasharray: 2, 2; - stroke: ${i.signalColor}; + stroke: ${t.signalColor}; } #arrowhead path { - fill: ${i.signalColor}; - stroke: ${i.signalColor}; + fill: ${t.signalColor}; + stroke: ${t.signalColor}; } .sequenceNumber { - fill: ${i.sequenceNumberColor}; + fill: ${t.sequenceNumberColor}; } #sequencenumber { - fill: ${i.signalColor}; + fill: ${t.signalColor}; } #crosshead path { - fill: ${i.signalColor}; - stroke: ${i.signalColor}; + fill: ${t.signalColor}; + stroke: ${t.signalColor}; } .messageText { - fill: ${i.signalTextColor}; + fill: ${t.signalTextColor}; stroke: none; } .labelBox { - stroke: ${i.labelBoxBorderColor}; - fill: ${i.labelBoxBkgColor}; + stroke: ${t.labelBoxBorderColor}; + fill: ${t.labelBoxBkgColor}; } .labelText, .labelText > tspan { - fill: ${i.labelTextColor}; + fill: ${t.labelTextColor}; stroke: none; } .loopText, .loopText > tspan { - fill: ${i.loopTextColor}; + fill: ${t.loopTextColor}; stroke: none; } .loopLine { stroke-width: 2px; stroke-dasharray: 2, 2; - stroke: ${i.labelBoxBorderColor}; - fill: ${i.labelBoxBorderColor}; + stroke: ${t.labelBoxBorderColor}; + fill: ${t.labelBoxBorderColor}; } .note { //stroke: #decc93; - stroke: ${i.noteBorderColor}; - fill: ${i.noteBkgColor}; + stroke: ${t.noteBorderColor}; + fill: ${t.noteBkgColor}; } .noteText, .noteText > tspan { - fill: ${i.noteTextColor}; + fill: ${t.noteTextColor}; stroke: none; } .activation0 { - fill: ${i.activationBkgColor}; - stroke: ${i.activationBorderColor}; + fill: ${t.activationBkgColor}; + stroke: ${t.activationBorderColor}; } .activation1 { - fill: ${i.activationBkgColor}; - stroke: ${i.activationBorderColor}; + fill: ${t.activationBkgColor}; + stroke: ${t.activationBorderColor}; } .activation2 { - fill: ${i.activationBkgColor}; - stroke: ${i.activationBorderColor}; + fill: ${t.activationBkgColor}; + stroke: ${t.activationBorderColor}; } .actorPopupMenu { @@ -793,29 +1228,28 @@ Expecting `+br.join(", ")+", got '"+(this.terminals_[ns]||ns)+"'":Dr="Parse erro .actorPopupMenuPanel { position: absolute; - fill: ${i.actorBkg}; + fill: ${t.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: ${i.actorBorder}; - fill: ${i.actorBkg}; + stroke: ${t.actorBorder}; + fill: ${t.actorBkg}; } .actor-man circle, line { - stroke: ${i.actorBorder}; - fill: ${i.actorBkg}; + stroke: ${t.actorBorder}; + fill: ${t.actorBkg}; stroke-width: 2px; } -`,MK=function(i,a){const f=i.append("rect");return f.attr("x",a.x),f.attr("y",a.y),f.attr("fill",a.fill),f.attr("stroke",a.stroke),f.attr("width",a.width),f.attr("height",a.height),f.attr("rx",a.rx),f.attr("ry",a.ry),a.class!==void 0&&f.attr("class",a.class),f},HRe=(i,a)=>{ISt(()=>{const f=document.querySelectorAll(i);f.length!==0&&(f[0].addEventListener("mouseover",function(){dHt("actor"+a+"_popup")}),f[0].addEventListener("mouseout",function(){gHt("actor"+a+"_popup")}))})},lHt=function(i,a,f,p,w){if(a.links===void 0||a.links===null||Object.keys(a.links).length===0)return{height:0,width:0};const y=a.links,b=a.actorCnt,E=a.rectData;var S="none";w&&(S="block !important");const N=i.append("g");N.attr("id","actor"+b+"_popup"),N.attr("class","actorPopupMenu"),N.attr("display",S),HRe("#actor"+b+"_popup",b);var B="";E.class!==void 0&&(B=" "+E.class);let R=E.width>f?E.width:f;const j=N.append("rect");if(j.attr("class","actorPopupMenuPanel"+B),j.attr("x",E.x),j.attr("y",E.height),j.attr("fill",E.fill),j.attr("stroke",E.stroke),j.attr("width",R),j.attr("height",E.height),j.attr("rx",E.rx),j.attr("ry",E.ry),y!=null){var $=20;for(let oe in y){var V=N.append("a"),Q=u5(y[oe]);V.attr("xlink:href",Q),V.attr("target","_blank"),LHt(p)(oe,V,E.x+10,E.height+$,R,20,{class:"actor"},p),$+=30}}return j.attr("height",$),{height:E.height+$,width:R}},zRe=function(i,a,f,p){const w=i.append("image");w.attr("x",a),w.attr("y",f);var y=u5(p);w.attr("xlink:href",y)},GRe=function(i,a,f,p){const w=i.append("use");w.attr("x",a),w.attr("y",f);var y=u5(p);w.attr("xlink:href","#"+y)},hHt=function(i){return"var pu = document.getElementById('"+i+"'); if (pu != null) { pu.style.display = 'block'; }"},fHt=function(i){return"var pu = document.getElementById('"+i+"'); if (pu != null) { pu.style.display = 'none'; }"},dHt=function(i){var a=document.getElementById(i);a!=null&&(a.style.display="block")},gHt=function(i){var a=document.getElementById(i);a!=null&&(a.style.display="none")},uL=function(i,a){let f=0,p=0;const w=a.text.split(Wa.lineBreakRegex),[y,b]=$A(a.fontSize);let E=[],S=0,N=()=>a.y;if(a.valign!==void 0&&a.textMargin!==void 0&&a.textMargin>0)switch(a.valign){case"top":case"start":N=()=>Math.round(a.y+a.textMargin);break;case"middle":case"center":N=()=>Math.round(a.y+(f+p+a.textMargin)/2);break;case"bottom":case"end":N=()=>Math.round(a.y+(f+p+2*a.textMargin)-a.textMargin);break}if(a.anchor!==void 0&&a.textMargin!==void 0&&a.width!==void 0)switch(a.anchor){case"left":case"start":a.x=Math.round(a.x+a.textMargin),a.anchor="start",a.dominantBaseline="middle",a.alignmentBaseline="middle";break;case"middle":case"center":a.x=Math.round(a.x+a.width/2),a.anchor="middle",a.dominantBaseline="middle",a.alignmentBaseline="middle";break;case"right":case"end":a.x=Math.round(a.x+a.width-a.textMargin),a.anchor="end",a.dominantBaseline="middle",a.alignmentBaseline="middle";break}for(let[B,R]of w.entries()){a.textMargin!==void 0&&a.textMargin===0&&y!==void 0&&(S=B*y);const j=i.append("text");if(j.attr("x",a.x),j.attr("y",N()),a.anchor!==void 0&&j.attr("text-anchor",a.anchor).attr("dominant-baseline",a.dominantBaseline).attr("alignment-baseline",a.alignmentBaseline),a.fontFamily!==void 0&&j.style("font-family",a.fontFamily),b!==void 0&&j.style("font-size",b),a.fontWeight!==void 0&&j.style("font-weight",a.fontWeight),a.fill!==void 0&&j.attr("fill",a.fill),a.class!==void 0&&j.attr("class",a.class),a.dy!==void 0?j.attr("dy",a.dy):S!==0&&j.attr("dy",S),a.tspan){const $=j.append("tspan");$.attr("x",a.x),a.fill!==void 0&&$.attr("fill",a.fill),$.text(R)}else j.text(R);a.valign!==void 0&&a.textMargin!==void 0&&a.textMargin>0&&(p+=(j._groups||j)[0][0].getBBox().height,f=p),E.push(j)}return E},qRe=function(i,a){function f(w,y,b,E,S){return w+","+y+" "+(w+b)+","+y+" "+(w+b)+","+(y+E-S)+" "+(w+b-S*1.2)+","+(y+E)+" "+w+","+(y+E)}const p=i.append("polygon");return p.attr("points",f(a.x,a.y,a.width,a.height,7)),p.attr("class","labelBox"),a.y=a.y+a.height/2,uL(i,a),p};let g3=-1;const VRe=(i,a)=>{i.selectAll&&i.selectAll(".actor-line").attr("class","200").attr("y2",a-55)},pHt=function(i,a,f,p){const w=a.x+a.width/2,y=a.y+5,b=i.append("g");var E=b;p||(g3++,E.append("line").attr("id","actor"+g3).attr("x1",w).attr("y1",y).attr("x2",w).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999"),E=b.append("g"),a.actorCnt=g3,a.links!=null&&(E.attr("id","root-"+g3),HRe("#root-"+g3,g3)));const S=DK();var N="actor";a.properties!=null&&a.properties.class?N=a.properties.class:S.fill="#eaeaea",S.x=a.x,S.y=a.y,S.width=a.width,S.height=a.height,S.class=N,S.rx=3,S.ry=3;const B=MK(E,S);if(a.rectData=S,a.properties!=null&&a.properties.icon){const j=a.properties.icon.trim();j.charAt(0)==="@"?GRe(E,S.x+S.width-20,S.y+10,j.substr(1)):zRe(E,S.x+S.width-20,S.y+10,j)}ige(f)(a.description,E,S.x,S.y,S.width,S.height,{class:"actor"},f);let R=a.height;if(B.node){const j=B.node().getBBox();a.height=j.height,R=j.height}return R},bHt=function(i,a,f,p){const w=a.x+a.width/2,y=a.y+80;p||(g3++,i.append("line").attr("id","actor"+g3).attr("x1",w).attr("y1",y).attr("x2",w).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999"));const b=i.append("g");b.attr("class","actor-man");const E=DK();E.x=a.x,E.y=a.y,E.fill="#eaeaea",E.width=a.width,E.height=a.height,E.class="actor",E.rx=3,E.ry=3,b.append("line").attr("id","actor-man-torso"+g3).attr("x1",w).attr("y1",a.y+25).attr("x2",w).attr("y2",a.y+45),b.append("line").attr("id","actor-man-arms"+g3).attr("x1",w-18).attr("y1",a.y+33).attr("x2",w+18).attr("y2",a.y+33),b.append("line").attr("x1",w-18).attr("y1",a.y+60).attr("x2",w).attr("y2",a.y+45),b.append("line").attr("x1",w).attr("y1",a.y+45).attr("x2",w+16).attr("y2",a.y+60);const S=b.append("circle");S.attr("cx",a.x+a.width/2),S.attr("cy",a.y+10),S.attr("r",15),S.attr("width",a.width),S.attr("height",a.height);const N=b.node().getBBox();return a.height=N.height,ige(f)(a.description,b,E.x,E.y+35,E.width,E.height,{class:"actor"},f),a.height},vHt=function(i,a,f,p){switch(a.type){case"actor":return bHt(i,a,f,p);case"participant":return pHt(i,a,f,p)}},wHt=function(i,a,f){const w=i.append("g");URe(w,a),a.name&&ige(f)(a.name,w,a.x,a.y+(a.textMaxHeight||0)/2,a.width,0,{class:"text"},f),w.lower()},mHt=function(i){return i.append("g")},yHt=function(i,a,f,p,w){const y=DK(),b=a.anchored;y.x=a.startx,y.y=a.starty,y.class="activation"+w%3,y.width=a.stopx-a.startx,y.height=f-a.starty,MK(b,y)},kHt=function(i,a,f,p){const{boxMargin:w,boxTextMargin:y,labelBoxHeight:b,labelBoxWidth:E,messageFontFamily:S,messageFontSize:N,messageFontWeight:B}=p,R=i.append("g"),j=function(Q,oe,ce,se){return R.append("line").attr("x1",Q).attr("y1",oe).attr("x2",ce).attr("y2",se).attr("class","loopLine")};j(a.startx,a.starty,a.stopx,a.starty),j(a.stopx,a.starty,a.stopx,a.stopy),j(a.startx,a.stopy,a.stopx,a.stopy),j(a.startx,a.starty,a.startx,a.stopy),a.sections!==void 0&&a.sections.forEach(function(Q){j(a.startx,Q.y,a.stopx,Q.y).style("stroke-dasharray","3, 3")});let $=rge();$.text=f,$.x=a.startx,$.y=a.starty,$.fontFamily=S,$.fontSize=N,$.fontWeight=B,$.anchor="middle",$.valign="middle",$.tspan=!1,$.width=E||50,$.height=b||20,$.textMargin=y,$.class="labelText",qRe(R,$),$=rge(),$.text=a.title,$.x=a.startx+E/2+(a.stopx-a.startx)/2,$.y=a.starty+w+y,$.anchor="middle",$.valign="middle",$.textMargin=y,$.class="loopText",$.fontFamily=S,$.fontSize=N,$.fontWeight=B,$.wrap=!0;let V=uL(R,$);return a.sectionTitles!==void 0&&a.sectionTitles.forEach(function(Q,oe){if(Q.message){$.text=Q.message,$.x=a.startx+(a.stopx-a.startx)/2,$.y=a.sections[oe].y+w+y,$.class="loopText",$.anchor="middle",$.valign="middle",$.tspan=!1,$.fontFamily=S,$.fontSize=N,$.fontWeight=B,$.wrap=a.wrap,V=uL(R,$);let ce=Math.round(V.map(se=>(se._groups||se)[0][0].getBBox().height).reduce((se,ge)=>se+ge));a.sections[oe].height+=ce-(w+y)}}),a.height=Math.round(a.stopy-a.starty),R},URe=function(i,a){MK(i,{x:a.startx,y:a.starty,width:a.stopx-a.startx,height:a.stopy-a.starty,fill:a.fill,stroke:a.stroke,class:"rect"}).lower()},xHt=function(i){i.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")},EHt=function(i){i.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")},THt=function(i){i.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")},_Ht=function(i){i.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")},CHt=function(i){i.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")},SHt=function(i){i.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)},AHt=function(i){i.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",5).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")},rge=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:!0,valign:void 0}},DK=function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},ige=function(){function i(w,y,b,E,S,N,B){const R=y.append("text").attr("x",b+S/2).attr("y",E+N/2+5).style("text-anchor","middle").text(w);p(R,B)}function a(w,y,b,E,S,N,B,R){const{actorFontSize:j,actorFontFamily:$,actorFontWeight:V}=R,[Q,oe]=$A(j),ce=w.split(Wa.lineBreakRegex);for(let se=0;sei.height||0))+(this.loops.length===0?0:this.loops.map(i=>i.height||0).reduce((i,a)=>i+a))+(this.messages.length===0?0:this.messages.map(i=>i.height||0).reduce((i,a)=>i+a))+(this.notes.length===0?0:this.notes.map(i=>i.height||0).reduce((i,a)=>i+a))},clear:function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},addBox:function(i){this.boxes.push(i)},addActor:function(i){this.actors.push(i)},addLoop:function(i){this.loops.push(i)},addMessage:function(i){this.messages.push(i)},addNote:function(i){this.notes.push(i)},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,KRe(Tt())},updateVal:function(i,a,f,p){i[a]===void 0?i[a]=f:i[a]=p(f,i[a])},updateBounds:function(i,a,f,p){const w=this;let y=0;function b(E){return function(N){y++;const B=w.sequenceItems.length-y+1;w.updateVal(N,"starty",a-B*ln.boxMargin,Math.min),w.updateVal(N,"stopy",p+B*ln.boxMargin,Math.max),w.updateVal(si.data,"startx",i-B*ln.boxMargin,Math.min),w.updateVal(si.data,"stopx",f+B*ln.boxMargin,Math.max),E!=="activation"&&(w.updateVal(N,"startx",i-B*ln.boxMargin,Math.min),w.updateVal(N,"stopx",f+B*ln.boxMargin,Math.max),w.updateVal(si.data,"starty",a-B*ln.boxMargin,Math.min),w.updateVal(si.data,"stopy",p+B*ln.boxMargin,Math.max))}}this.sequenceItems.forEach(b()),this.activations.forEach(b("activation"))},insert:function(i,a,f,p){const w=Math.min(i,f),y=Math.max(i,f),b=Math.min(a,p),E=Math.max(a,p);this.updateVal(si.data,"startx",w,Math.min),this.updateVal(si.data,"starty",b,Math.min),this.updateVal(si.data,"stopx",y,Math.max),this.updateVal(si.data,"stopy",E,Math.max),this.updateBounds(w,b,y,E)},newActivation:function(i,a,f){const p=f[i.from.actor],w=IK(i.from.actor).length||0,y=p.x+p.width/2+(w-1)*ln.activationWidth/2;this.activations.push({startx:y,starty:this.verticalPos+2,stopx:y+ln.activationWidth,stopy:void 0,actor:i.from.actor,anchored:ih.anchorElement(a)})},endActivation:function(i){const a=this.activations.map(function(f){return f.actor}).lastIndexOf(i.from.actor);return this.activations.splice(a,1)[0]},createLoop:function(i={message:void 0,wrap:!1,width:void 0},a){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:i.message,wrap:i.wrap,width:i.width,height:0,fill:a}},newLoop:function(i={message:void 0,wrap:!1,width:void 0},a){this.sequenceItems.push(this.createLoop(i,a))},endLoop:function(){return this.sequenceItems.pop()},addSectionToLoop:function(i){const a=this.sequenceItems.pop();a.sections=a.sections||[],a.sectionTitles=a.sectionTitles||[],a.sections.push({y:si.getVerticalPos(),height:0}),a.sectionTitles.push(i),this.sequenceItems.push(a)},bumpVerticalPos:function(i){this.verticalPos=this.verticalPos+i,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return{bounds:this.data,models:this.models}}},MHt=function(i,a){si.bumpVerticalPos(ln.boxMargin),a.height=ln.boxMargin,a.starty=si.getVerticalPos();const f=ih.getNoteRect();f.x=a.startx,f.y=a.starty,f.width=a.width||ln.width,f.class="note";const p=i.append("g"),w=ih.drawRect(p,f),y=ih.getTextObj();y.x=a.startx,y.y=a.starty,y.width=f.width,y.dy="1em",y.text=a.message,y.class="noteText",y.fontFamily=ln.noteFontFamily,y.fontSize=ln.noteFontSize,y.fontWeight=ln.noteFontWeight,y.anchor=ln.noteAlign,y.textMargin=ln.noteMargin,y.valign="center";const b=uL(p,y),E=Math.round(b.map(S=>(S._groups||S)[0][0].getBBox().height).reduce((S,N)=>S+N));w.attr("height",E+2*ln.noteMargin),a.height+=E+2*ln.noteMargin,si.bumpVerticalPos(E+2*ln.noteMargin),a.stopy=a.starty+E+2*ln.noteMargin,a.stopx=a.startx+f.width,si.insert(a.startx,a.starty,a.stopx,a.stopy),si.models.addNote(a)},g9=i=>({fontFamily:i.messageFontFamily,fontSize:i.messageFontSize,fontWeight:i.messageFontWeight}),lL=i=>({fontFamily:i.noteFontFamily,fontSize:i.noteFontSize,fontWeight:i.noteFontWeight}),sge=i=>({fontFamily:i.actorFontFamily,fontSize:i.actorFontSize,fontWeight:i.actorFontWeight});function DHt(i,a){si.bumpVerticalPos(10);const{startx:f,stopx:p,message:w}=a,y=Wa.splitBreaks(w).length,b=co.calculateTextDimensions(w,g9(ln)),E=b.height/y;a.height+=E,si.bumpVerticalPos(E);let S,N=b.height-10;const B=b.width;if(f===p){S=si.getVerticalPos()+N,ln.rightAngles||(N+=ln.boxMargin,S=si.getVerticalPos()+N),N+=30;const R=Math.max(B/2,ln.width/2);si.insert(f-R,si.getVerticalPos()-10+N,p+R,si.getVerticalPos()+30+N)}else N+=ln.boxMargin,S=si.getVerticalPos()+N,si.insert(f,S-10,p,S);return si.bumpVerticalPos(N),a.height+=N,a.stopy=a.starty+a.height,si.insert(a.fromBounds,a.starty,a.toBounds,a.stopy),S}const IHt=function(i,a,f,p){const{startx:w,stopx:y,starty:b,message:E,type:S,sequenceIndex:N,sequenceVisible:B}=a,R=co.calculateTextDimensions(E,g9(ln)),j=ih.getTextObj();j.x=w,j.y=b+10,j.width=y-w,j.class="messageText",j.dy="1em",j.text=E,j.fontFamily=ln.messageFontFamily,j.fontSize=ln.messageFontSize,j.fontWeight=ln.messageFontWeight,j.anchor=ln.messageAlign,j.valign="center",j.textMargin=ln.wrapPadding,j.tspan=!1,uL(i,j);const $=R.width;let V;w===y?ln.rightAngles?V=i.append("path").attr("d",`M ${w},${f} H ${w+Math.max(ln.width/2,$/2)} V ${f+25} H ${w}`):V=i.append("path").attr("d","M "+w+","+f+" C "+(w+60)+","+(f-10)+" "+(w+60)+","+(f+30)+" "+w+","+(f+20)):(V=i.append("line"),V.attr("x1",w),V.attr("y1",f),V.attr("x2",y),V.attr("y2",f)),S===p.db.LINETYPE.DOTTED||S===p.db.LINETYPE.DOTTED_CROSS||S===p.db.LINETYPE.DOTTED_POINT||S===p.db.LINETYPE.DOTTED_OPEN?(V.style("stroke-dasharray","3, 3"),V.attr("class","messageLine1")):V.attr("class","messageLine0");let Q="";ln.arrowMarkerAbsolute&&(Q=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,Q=Q.replace(/\(/g,"\\("),Q=Q.replace(/\)/g,"\\)")),V.attr("stroke-width",2),V.attr("stroke","none"),V.style("fill","none"),(S===p.db.LINETYPE.SOLID||S===p.db.LINETYPE.DOTTED)&&V.attr("marker-end","url("+Q+"#arrowhead)"),(S===p.db.LINETYPE.SOLID_POINT||S===p.db.LINETYPE.DOTTED_POINT)&&V.attr("marker-end","url("+Q+"#filled-head)"),(S===p.db.LINETYPE.SOLID_CROSS||S===p.db.LINETYPE.DOTTED_CROSS)&&V.attr("marker-end","url("+Q+"#crosshead)"),(B||ln.showSequenceNumbers)&&(V.attr("marker-start","url("+Q+"#sequencenumber)"),i.append("text").attr("x",w).attr("y",f+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(N))},age=function(i,a,f,p,w,y,b){if(w.hideUnusedParticipants===!0){const R=new Set;y.forEach(j=>{R.add(j.from),R.add(j.to)}),f=f.filter(j=>R.has(j))}let E=0,S=0,N=0,B;for(const R of f){const j=a[R],$=j.box;B&&B!=$&&(b||si.models.addBox(B),S+=ln.boxMargin+B.margin),$&&$!=B&&(b||($.x=E+S,$.y=p),S+=$.margin),j.width=j.width||ln.width,j.height=Math.max(j.height||ln.height,ln.height),j.margin=j.margin||ln.actorMargin,j.x=E+S,j.y=si.getVerticalPos();const V=ih.drawActor(i,j,ln,b);N=Math.max(N,V),si.insert(j.x,p,j.x+j.width,j.height),E+=j.width+S,j.box&&(j.box.width=E+$.margin-j.box.x),S=j.margin,B=j.box,si.models.addActor(j)}B&&!b&&si.models.addBox(B),si.bumpVerticalPos(N)},WRe=function(i,a,f,p){let w=0,y=0;for(const b of f){const E=a[b],S=PHt(E),N=ih.drawPopup(i,E,S,ln,ln.forceMenus,p);N.height>w&&(w=N.height),N.width+E.x>y&&(y=N.width+E.x)}return{maxHeight:w,maxWidth:y}},KRe=function(i){nd(ln,i),i.fontFamily&&(ln.actorFontFamily=ln.noteFontFamily=ln.messageFontFamily=i.fontFamily),i.fontSize&&(ln.actorFontSize=ln.noteFontSize=ln.messageFontSize=i.fontSize),i.fontWeight&&(ln.actorFontWeight=ln.noteFontWeight=ln.messageFontWeight=i.fontWeight)},IK=function(i){return si.activations.filter(function(a){return a.actor===i})},YRe=function(i,a){const f=a[i],p=IK(i),w=p.reduce(function(b,E){return Math.min(b,E.startx)},f.x+f.width/2),y=p.reduce(function(b,E){return Math.max(b,E.stopx)},f.x+f.width/2);return[w,y]};function p3(i,a,f,p,w){si.bumpVerticalPos(f);let y=p;if(a.id&&a.message&&i[a.id]){const b=i[a.id].width,E=g9(ln);a.message=co.wrapLabel(`[${a.message}]`,b-2*ln.wrapPadding,E),a.width=b,a.wrap=!0;const S=co.calculateTextDimensions(a.message,E),N=Math.max(S.height,ln.labelBoxHeight);y=p+N,Fe.debug(`${N} - ${a.message}`)}w(a),si.bumpVerticalPos(y)}const OHt=function(i,a,f,p){const{securityLevel:w,sequence:y}=Tt();ln=y,p.db.clear(),p.parser.parse(i);let b;w==="sandbox"&&(b=Cr("#i"+a));const E=Cr(w==="sandbox"?b.nodes()[0].contentDocument.body:"body"),S=w==="sandbox"?b.nodes()[0].contentDocument:document;si.init(),Fe.debug(p.db);const N=w==="sandbox"?E.select(`[id="${a}"]`):Cr(`[id="${a}"]`),B=p.db.getActors(),R=p.db.getBoxes(),j=p.db.getActorKeys(),$=p.db.getMessages(),V=p.db.getDiagramTitle(),Q=p.db.hasAtLeastOneBox(),oe=p.db.hasAtLeastOneBoxWithTitle(),ce=NHt(B,$,p);ln.height=BHt(B,ce,R),ih.insertComputerIcon(N),ih.insertDatabaseIcon(N),ih.insertClockIcon(N),Q&&(si.bumpVerticalPos(ln.boxMargin),oe&&si.bumpVerticalPos(R[0].textMaxHeight)),age(N,B,j,0,ln,$,!1);const se=jHt($,B,ce,p);ih.insertArrowHead(N),ih.insertArrowCrossHead(N),ih.insertArrowFilledHead(N),ih.insertSequenceNumber(N);function ge(rt,me){const gt=si.endActivation(rt);gt.starty+18>me&&(gt.starty=me-6,me+=12),ih.drawActivation(N,gt,me,ln,IK(rt.from.actor).length),si.insert(gt.startx,me-10,gt.stopx,me)}let ye=1,ke=1;const Ae=[];$.forEach(function(rt){let me,gt,pe;switch(rt.type){case p.db.LINETYPE.NOTE:gt=rt.noteModel,MHt(N,gt);break;case p.db.LINETYPE.ACTIVE_START:si.newActivation(rt,N,B);break;case p.db.LINETYPE.ACTIVE_END:ge(rt,si.getVerticalPos());break;case p.db.LINETYPE.LOOP_START:p3(se,rt,ln.boxMargin,ln.boxMargin+ln.boxTextMargin,Et=>si.newLoop(Et));break;case p.db.LINETYPE.LOOP_END:me=si.endLoop(),ih.drawLoop(N,me,"loop",ln),si.bumpVerticalPos(me.stopy-si.getVerticalPos()),si.models.addLoop(me);break;case p.db.LINETYPE.RECT_START:p3(se,rt,ln.boxMargin,ln.boxMargin,Et=>si.newLoop(void 0,Et.message));break;case p.db.LINETYPE.RECT_END:me=si.endLoop(),ih.drawBackgroundRect(N,me),si.models.addLoop(me),si.bumpVerticalPos(me.stopy-si.getVerticalPos());break;case p.db.LINETYPE.OPT_START:p3(se,rt,ln.boxMargin,ln.boxMargin+ln.boxTextMargin,Et=>si.newLoop(Et));break;case p.db.LINETYPE.OPT_END:me=si.endLoop(),ih.drawLoop(N,me,"opt",ln),si.bumpVerticalPos(me.stopy-si.getVerticalPos()),si.models.addLoop(me);break;case p.db.LINETYPE.ALT_START:p3(se,rt,ln.boxMargin,ln.boxMargin+ln.boxTextMargin,Et=>si.newLoop(Et));break;case p.db.LINETYPE.ALT_ELSE:p3(se,rt,ln.boxMargin+ln.boxTextMargin,ln.boxMargin,Et=>si.addSectionToLoop(Et));break;case p.db.LINETYPE.ALT_END:me=si.endLoop(),ih.drawLoop(N,me,"alt",ln),si.bumpVerticalPos(me.stopy-si.getVerticalPos()),si.models.addLoop(me);break;case p.db.LINETYPE.PAR_START:p3(se,rt,ln.boxMargin,ln.boxMargin+ln.boxTextMargin,Et=>si.newLoop(Et));break;case p.db.LINETYPE.PAR_AND:p3(se,rt,ln.boxMargin+ln.boxTextMargin,ln.boxMargin,Et=>si.addSectionToLoop(Et));break;case p.db.LINETYPE.PAR_END:me=si.endLoop(),ih.drawLoop(N,me,"par",ln),si.bumpVerticalPos(me.stopy-si.getVerticalPos()),si.models.addLoop(me);break;case p.db.LINETYPE.AUTONUMBER:ye=rt.message.start||ye,ke=rt.message.step||ke,rt.message.visible?p.db.enableSequenceNumbers():p.db.disableSequenceNumbers();break;case p.db.LINETYPE.CRITICAL_START:p3(se,rt,ln.boxMargin,ln.boxMargin+ln.boxTextMargin,Et=>si.newLoop(Et));break;case p.db.LINETYPE.CRITICAL_OPTION:p3(se,rt,ln.boxMargin+ln.boxTextMargin,ln.boxMargin,Et=>si.addSectionToLoop(Et));break;case p.db.LINETYPE.CRITICAL_END:me=si.endLoop(),ih.drawLoop(N,me,"critical",ln),si.bumpVerticalPos(me.stopy-si.getVerticalPos()),si.models.addLoop(me);break;case p.db.LINETYPE.BREAK_START:p3(se,rt,ln.boxMargin,ln.boxMargin+ln.boxTextMargin,Et=>si.newLoop(Et));break;case p.db.LINETYPE.BREAK_END:me=si.endLoop(),ih.drawLoop(N,me,"break",ln),si.bumpVerticalPos(me.stopy-si.getVerticalPos()),si.models.addLoop(me);break;default:try{pe=rt.msgModel,pe.starty=si.getVerticalPos(),pe.sequenceIndex=ye,pe.sequenceVisible=p.db.showSequenceNumbers();const Et=DHt(N,pe);Ae.push({messageModel:pe,lineStartY:Et}),si.models.addMessage(pe)}catch(Et){Fe.error("error while drawing message",Et)}}[p.db.LINETYPE.SOLID_OPEN,p.db.LINETYPE.DOTTED_OPEN,p.db.LINETYPE.SOLID,p.db.LINETYPE.DOTTED,p.db.LINETYPE.SOLID_CROSS,p.db.LINETYPE.DOTTED_CROSS,p.db.LINETYPE.SOLID_POINT,p.db.LINETYPE.DOTTED_POINT].includes(rt.type)&&(ye=ye+ke)}),Ae.forEach(rt=>IHt(N,rt.messageModel,rt.lineStartY,p)),ln.mirrorActors&&(si.bumpVerticalPos(ln.boxMargin*2),age(N,B,j,si.getVerticalPos(),ln,$,!0),si.bumpVerticalPos(ln.boxMargin),VRe(N,si.getVerticalPos())),si.models.boxes.forEach(function(rt){rt.height=si.getVerticalPos()-rt.y,si.insert(rt.x,rt.y,rt.x+rt.width,rt.height),rt.startx=rt.x,rt.starty=rt.y,rt.stopx=rt.startx+rt.width,rt.stopy=rt.starty+rt.height,rt.stroke="rgb(0,0,0, 0.5)",ih.drawBox(N,rt,ln)}),Q&&si.bumpVerticalPos(ln.boxMargin);const de=WRe(N,B,j,S),{bounds:ve}=si.getBounds();Fe.debug("For line height fix Querying: #"+a+" .actor-line"),Jfe("#"+a+" .actor-line").attr("y2",ve.stopy);let xe=ve.stopy-ve.starty;xe{const b=i[y];b.wrap&&(b.description=co.wrapLabel(b.description,ln.width-2*ln.wrapPadding,sge(ln)));const E=co.calculateTextDimensions(b.description,sge(ln));b.width=b.wrap?ln.width:Math.max(ln.width,E.width+2*ln.wrapPadding),b.height=b.wrap?Math.max(E.height,ln.height):ln.height,p=Math.max(p,b.height)});for(const y in a){const b=i[y];if(!b)continue;const E=i[b.nextActor];if(!E){const R=a[y]+ln.actorMargin-b.width/2;b.margin=Math.max(R,ln.actorMargin);continue}const N=a[y]+ln.actorMargin-b.width/2-E.width/2;b.margin=Math.max(N,ln.actorMargin)}let w=0;return f.forEach(y=>{const b=g9(ln);let E=y.actorKeys.reduce((B,R)=>B+=i[R].width+(i[R].margin||0),0);E-=2*ln.boxTextMargin,y.wrap&&(y.name=co.wrapLabel(y.name,E-2*ln.wrapPadding,b));const S=co.calculateTextDimensions(y.name,b);w=Math.max(S.height,w);const N=Math.max(E,S.width+2*ln.wrapPadding);if(y.margin=ln.boxTextMargin,Ey.textMaxHeight=w),Math.max(p,ln.height)}const RHt=function(i,a,f){const p=a[i.from].x,w=a[i.to].x,y=i.wrap&&i.message;let b=co.calculateTextDimensions(y?co.wrapLabel(i.message,ln.width,lL(ln)):i.message,lL(ln));const E={width:y?ln.width:Math.max(ln.width,b.width+2*ln.noteMargin),height:0,startx:a[i.from].x,stopx:0,starty:0,stopy:0,message:i.message};return i.placement===f.db.PLACEMENT.RIGHTOF?(E.width=y?Math.max(ln.width,b.width):Math.max(a[i.from].width/2+a[i.to].width/2,b.width+2*ln.noteMargin),E.startx=p+(a[i.from].width+ln.actorMargin)/2):i.placement===f.db.PLACEMENT.LEFTOF?(E.width=Math.max(y?ln.width:a[i.from].width/2+a[i.to].width/2,b.width+2*ln.noteMargin),E.startx=p-E.width+(a[i.from].width-ln.actorMargin)/2):i.to===i.from?(b=co.calculateTextDimensions(y?co.wrapLabel(i.message,Math.max(ln.width,a[i.from].width),lL(ln)):i.message,lL(ln)),E.width=y?Math.max(ln.width,a[i.from].width):Math.max(a[i.from].width,ln.width,b.width+2*ln.noteMargin),E.startx=p+(a[i.from].width-E.width)/2):(E.width=Math.abs(p+a[i.from].width/2-(w+a[i.to].width/2))+ln.actorMargin,E.startx=pj.actor).lastIndexOf(N.from.actor);delete si.activations.splice(R,1)[0]}break}N.placement!==void 0?(E=RHt(N,a,p),N.noteModel=E,y.forEach(R=>{b=R,b.from=Math.min(b.from,E.startx),b.to=Math.max(b.to,E.startx+E.width),b.width=Math.max(b.width,Math.abs(b.from-b.to))-ln.labelBoxWidth})):(S=FHt(N,a,p),N.msgModel=S,S.startx&&S.stopx&&y.length>0&&y.forEach(R=>{if(b=R,S.startx===S.stopx){const j=a[N.from],$=a[N.to];b.from=Math.min(j.x-S.width/2,j.x-j.width/2,b.from),b.to=Math.max($.x+S.width/2,$.x+j.width/2,b.to),b.width=Math.max(b.width,Math.abs(b.to-b.from))-ln.labelBoxWidth}else b.from=Math.min(S.startx,b.from),b.to=Math.max(S.stopx,b.to),b.width=Math.max(b.width,S.width)-ln.labelBoxWidth}))}),si.activations=[],Fe.debug("Loop type widths:",w),w},$Ht=Object.freeze(Object.defineProperty({__proto__:null,diagram:{parser:j$t,db:cHt,renderer:{bounds:si,drawActors:age,drawActorsPopup:WRe,setConf:KRe,draw:OHt},styles:uHt}},Symbol.toStringTag,{value:"Module"}));var oge=function(){var i=function(Nt,ze,Xe,Lt){for(Xe=Xe||{},Lt=Nt.length;Lt--;Xe[Nt[Lt]]=ze);return Xe},a=[1,32],f=[1,33],p=[1,34],w=[1,35],y=[1,9],b=[1,8],E=[1,18],S=[1,19],N=[1,20],B=[1,38],R=[1,25],j=[1,23],$=[1,24],V=[1,30],Q=[1,31],oe=[1,26],ce=[1,27],se=[1,28],ge=[1,29],ye=[1,42],ke=[1,39],Ae=[1,40],de=[1,41],ve=[1,43],te=[1,16,24],xe=[1,57],De=[1,58],he=[1,59],Ie=[1,60],ee=[1,61],rt=[1,62],me=[1,63],gt=[1,73],pe=[1,16,24,27,28,35,48,49,63,64,65,66,67,68,69,74,76],Et=[1,16,24,27,28,33,35,48,49,54,63,64,65,66,67,68,69,74,76,89,91,92,93,94],wt=[1,80],jt=[28,89,91,92,93,94],At=[28,68,69,89,91,92,93,94],Bt=[28,63,64,65,66,67,89,91,92,93,94],cn=[1,90],Nn=[1,16,24,48,49],Ot=[1,16,24,35],oi=[8,9,10,11,19,23,42,44,46,52,53,55,56,58,60,70,71,73,77,89,91,92,93,94],kt={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,directive:5,statements:6,direction:7,direction_tb:8,direction_bt:9,direction_rl:10,direction_lr:11,graphConfig:12,openDirective:13,typeDirective:14,closeDirective:15,NEWLINE:16,":":17,argDirective:18,open_directive:19,type_directive:20,arg_directive:21,close_directive:22,CLASS_DIAGRAM:23,EOF:24,statement:25,classLabel:26,SQS:27,STR:28,SQE:29,className:30,alphaNumToken:31,classLiteralName:32,GENERICTYPE:33,relationStatement:34,LABEL:35,classStatement:36,methodStatement:37,annotationStatement:38,clickStatement:39,cssClassStatement:40,noteStatement:41,acc_title:42,acc_title_value:43,acc_descr:44,acc_descr_value:45,acc_descr_multiline_value:46,classIdentifier:47,STYLE_SEPARATOR:48,STRUCT_START:49,members:50,STRUCT_STOP:51,CLASS:52,ANNOTATION_START:53,ANNOTATION_END:54,MEMBER:55,SEPARATOR:56,relation:57,NOTE_FOR:58,noteText:59,NOTE:60,relationType:61,lineType:62,AGGREGATION:63,EXTENSION:64,COMPOSITION:65,DEPENDENCY:66,LOLLIPOP:67,LINE:68,DOTTED_LINE:69,CALLBACK:70,LINK:71,LINK_TARGET:72,CLICK:73,CALLBACK_NAME:74,CALLBACK_ARGS:75,HREF:76,CSSCLASS:77,commentToken:78,textToken:79,graphCodeTokens:80,textNoTagsToken:81,TAGSTART:82,TAGEND:83,"==":84,"--":85,PCT:86,DEFAULT:87,SPACE:88,MINUS:89,keywords:90,UNICODE_TEXT:91,NUM:92,ALPHA:93,BQUOTE_STR:94,$accept:0,$end:1},terminals_:{2:"error",8:"direction_tb",9:"direction_bt",10:"direction_rl",11:"direction_lr",16:"NEWLINE",17:":",19:"open_directive",20:"type_directive",21:"arg_directive",22:"close_directive",23:"CLASS_DIAGRAM",24:"EOF",27:"SQS",28:"STR",29:"SQE",33:"GENERICTYPE",35:"LABEL",42:"acc_title",43:"acc_title_value",44:"acc_descr",45:"acc_descr_value",46:"acc_descr_multiline_value",48:"STYLE_SEPARATOR",49:"STRUCT_START",51:"STRUCT_STOP",52:"CLASS",53:"ANNOTATION_START",54:"ANNOTATION_END",55:"MEMBER",56:"SEPARATOR",58:"NOTE_FOR",60:"NOTE",63:"AGGREGATION",64:"EXTENSION",65:"COMPOSITION",66:"DEPENDENCY",67:"LOLLIPOP",68:"LINE",69:"DOTTED_LINE",70:"CALLBACK",71:"LINK",72:"LINK_TARGET",73:"CLICK",74:"CALLBACK_NAME",75:"CALLBACK_ARGS",76:"HREF",77:"CSSCLASS",80:"graphCodeTokens",82:"TAGSTART",83:"TAGEND",84:"==",85:"--",86:"PCT",87:"DEFAULT",88:"SPACE",89:"MINUS",90:"keywords",91:"UNICODE_TEXT",92:"NUM",93:"ALPHA",94:"BQUOTE_STR"},productions_:[0,[3,1],[3,2],[3,1],[7,1],[7,1],[7,1],[7,1],[4,1],[5,4],[5,6],[13,1],[14,1],[18,1],[15,1],[12,4],[6,1],[6,2],[6,3],[26,3],[30,1],[30,1],[30,2],[30,2],[30,2],[25,1],[25,2],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,2],[25,2],[25,1],[36,1],[36,3],[36,4],[36,6],[47,2],[47,3],[38,4],[50,1],[50,2],[37,1],[37,2],[37,1],[37,1],[34,3],[34,4],[34,4],[34,5],[41,3],[41,2],[57,3],[57,2],[57,2],[57,1],[61,1],[61,1],[61,1],[61,1],[61,1],[62,1],[62,1],[39,3],[39,4],[39,3],[39,4],[39,4],[39,5],[39,3],[39,4],[39,4],[39,5],[39,3],[39,4],[39,4],[39,5],[40,3],[78,1],[78,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[81,1],[81,1],[81,1],[81,1],[31,1],[31,1],[31,1],[31,1],[32,1],[59,1]],performAction:function(ze,Xe,Lt,Ge,Bn,Oe,Ri){var tn=Oe.length-1;switch(Bn){case 4:Ge.setDirection("TB");break;case 5:Ge.setDirection("BT");break;case 6:Ge.setDirection("RL");break;case 7:Ge.setDirection("LR");break;case 11:Ge.parseDirective("%%{","open_directive");break;case 12:Ge.parseDirective(Oe[tn],"type_directive");break;case 13:Oe[tn]=Oe[tn].trim().replace(/'/g,'"'),Ge.parseDirective(Oe[tn],"arg_directive");break;case 14:Ge.parseDirective("}%%","close_directive","class");break;case 19:this.$=Oe[tn-1];break;case 20:case 21:this.$=Oe[tn];break;case 22:this.$=Oe[tn-1]+Oe[tn];break;case 23:case 24:this.$=Oe[tn-1]+"~"+Oe[tn]+"~";break;case 25:Ge.addRelation(Oe[tn]);break;case 26:Oe[tn-1].title=Ge.cleanupLabel(Oe[tn]),Ge.addRelation(Oe[tn-1]);break;case 34:this.$=Oe[tn].trim(),Ge.setAccTitle(this.$);break;case 35:case 36:this.$=Oe[tn].trim(),Ge.setAccDescription(this.$);break;case 38:Ge.setCssClass(Oe[tn-2],Oe[tn]);break;case 39:Ge.addMembers(Oe[tn-3],Oe[tn-1]);break;case 40:Ge.setCssClass(Oe[tn-5],Oe[tn-3]),Ge.addMembers(Oe[tn-5],Oe[tn-1]);break;case 41:this.$=Oe[tn],Ge.addClass(Oe[tn]);break;case 42:this.$=Oe[tn-1],Ge.addClass(Oe[tn-1]),Ge.setClassLabel(Oe[tn-1],Oe[tn]);break;case 43:Ge.addAnnotation(Oe[tn],Oe[tn-2]);break;case 44:this.$=[Oe[tn]];break;case 45:Oe[tn].push(Oe[tn-1]),this.$=Oe[tn];break;case 46:break;case 47:Ge.addMember(Oe[tn-1],Ge.cleanupLabel(Oe[tn]));break;case 48:break;case 49:break;case 50:this.$={id1:Oe[tn-2],id2:Oe[tn],relation:Oe[tn-1],relationTitle1:"none",relationTitle2:"none"};break;case 51:this.$={id1:Oe[tn-3],id2:Oe[tn],relation:Oe[tn-1],relationTitle1:Oe[tn-2],relationTitle2:"none"};break;case 52:this.$={id1:Oe[tn-3],id2:Oe[tn],relation:Oe[tn-2],relationTitle1:"none",relationTitle2:Oe[tn-1]};break;case 53:this.$={id1:Oe[tn-4],id2:Oe[tn],relation:Oe[tn-2],relationTitle1:Oe[tn-3],relationTitle2:Oe[tn-1]};break;case 54:Ge.addNote(Oe[tn],Oe[tn-1]);break;case 55:Ge.addNote(Oe[tn]);break;case 56:this.$={type1:Oe[tn-2],type2:Oe[tn],lineType:Oe[tn-1]};break;case 57:this.$={type1:"none",type2:Oe[tn],lineType:Oe[tn-1]};break;case 58:this.$={type1:Oe[tn-1],type2:"none",lineType:Oe[tn]};break;case 59:this.$={type1:"none",type2:"none",lineType:Oe[tn]};break;case 60:this.$=Ge.relationType.AGGREGATION;break;case 61:this.$=Ge.relationType.EXTENSION;break;case 62:this.$=Ge.relationType.COMPOSITION;break;case 63:this.$=Ge.relationType.DEPENDENCY;break;case 64:this.$=Ge.relationType.LOLLIPOP;break;case 65:this.$=Ge.lineType.LINE;break;case 66:this.$=Ge.lineType.DOTTED_LINE;break;case 67:case 73:this.$=Oe[tn-2],Ge.setClickEvent(Oe[tn-1],Oe[tn]);break;case 68:case 74:this.$=Oe[tn-3],Ge.setClickEvent(Oe[tn-2],Oe[tn-1]),Ge.setTooltip(Oe[tn-2],Oe[tn]);break;case 69:case 77:this.$=Oe[tn-2],Ge.setLink(Oe[tn-1],Oe[tn]);break;case 70:this.$=Oe[tn-3],Ge.setLink(Oe[tn-2],Oe[tn-1],Oe[tn]);break;case 71:case 79:this.$=Oe[tn-3],Ge.setLink(Oe[tn-2],Oe[tn-1]),Ge.setTooltip(Oe[tn-2],Oe[tn]);break;case 72:case 80:this.$=Oe[tn-4],Ge.setLink(Oe[tn-3],Oe[tn-2],Oe[tn]),Ge.setTooltip(Oe[tn-3],Oe[tn-1]);break;case 75:this.$=Oe[tn-3],Ge.setClickEvent(Oe[tn-2],Oe[tn-1],Oe[tn]);break;case 76:this.$=Oe[tn-4],Ge.setClickEvent(Oe[tn-3],Oe[tn-2],Oe[tn-1]),Ge.setTooltip(Oe[tn-3],Oe[tn]);break;case 78:this.$=Oe[tn-3],Ge.setLink(Oe[tn-2],Oe[tn-1],Oe[tn]);break;case 81:Ge.setCssClass(Oe[tn-1],Oe[tn]);break}},table:[{3:1,4:2,5:3,6:4,7:17,8:a,9:f,10:p,11:w,12:5,13:6,19:y,23:b,25:7,30:21,31:36,32:37,34:10,36:11,37:12,38:13,39:14,40:15,41:16,42:E,44:S,46:N,47:22,52:B,53:R,55:j,56:$,58:V,60:Q,70:oe,71:ce,73:se,77:ge,89:ye,91:ke,92:Ae,93:de,94:ve},{1:[3]},{1:[2,1]},{3:44,4:2,5:3,6:4,7:17,8:a,9:f,10:p,11:w,12:5,13:6,19:y,23:b,25:7,30:21,31:36,32:37,34:10,36:11,37:12,38:13,39:14,40:15,41:16,42:E,44:S,46:N,47:22,52:B,53:R,55:j,56:$,58:V,60:Q,70:oe,71:ce,73:se,77:ge,89:ye,91:ke,92:Ae,93:de,94:ve},{1:[2,3]},{1:[2,8]},{14:45,20:[1,46]},i($,[2,16],{16:[1,47]}),{16:[1,48]},{20:[2,11]},i(te,[2,25],{35:[1,49]}),i(te,[2,27]),i(te,[2,28]),i(te,[2,29]),i(te,[2,30]),i(te,[2,31]),i(te,[2,32]),i(te,[2,33]),{43:[1,50]},{45:[1,51]},i(te,[2,36]),i(te,[2,46],{57:52,61:55,62:56,28:[1,53],35:[1,54],63:xe,64:De,65:he,66:Ie,67:ee,68:rt,69:me}),i(te,[2,37],{48:[1,64],49:[1,65]}),i(te,[2,48]),i(te,[2,49]),{31:66,89:ye,91:ke,92:Ae,93:de},{30:67,31:36,32:37,89:ye,91:ke,92:Ae,93:de,94:ve},{30:68,31:36,32:37,89:ye,91:ke,92:Ae,93:de,94:ve},{30:69,31:36,32:37,89:ye,91:ke,92:Ae,93:de,94:ve},{28:[1,70]},{30:71,31:36,32:37,89:ye,91:ke,92:Ae,93:de,94:ve},{28:gt,59:72},i(te,[2,4]),i(te,[2,5]),i(te,[2,6]),i(te,[2,7]),i(pe,[2,20],{31:36,32:37,30:74,33:[1,75],89:ye,91:ke,92:Ae,93:de,94:ve}),i(pe,[2,21],{33:[1,76]}),{30:77,31:36,32:37,89:ye,91:ke,92:Ae,93:de,94:ve},i(Et,[2,95]),i(Et,[2,96]),i(Et,[2,97]),i(Et,[2,98]),i([1,16,24,27,28,33,35,48,49,63,64,65,66,67,68,69,74,76],[2,99]),{1:[2,2]},{15:78,17:[1,79],22:wt},i([17,22],[2,12]),i($,[2,17],{25:7,34:10,36:11,37:12,38:13,39:14,40:15,41:16,7:17,30:21,47:22,31:36,32:37,6:81,8:a,9:f,10:p,11:w,42:E,44:S,46:N,52:B,53:R,55:j,56:$,58:V,60:Q,70:oe,71:ce,73:se,77:ge,89:ye,91:ke,92:Ae,93:de,94:ve}),{6:82,7:17,8:a,9:f,10:p,11:w,25:7,30:21,31:36,32:37,34:10,36:11,37:12,38:13,39:14,40:15,41:16,42:E,44:S,46:N,47:22,52:B,53:R,55:j,56:$,58:V,60:Q,70:oe,71:ce,73:se,77:ge,89:ye,91:ke,92:Ae,93:de,94:ve},i(te,[2,26]),i(te,[2,34]),i(te,[2,35]),{28:[1,84],30:83,31:36,32:37,89:ye,91:ke,92:Ae,93:de,94:ve},{57:85,61:55,62:56,63:xe,64:De,65:he,66:Ie,67:ee,68:rt,69:me},i(te,[2,47]),{62:86,68:rt,69:me},i(jt,[2,59],{61:87,63:xe,64:De,65:he,66:Ie,67:ee}),i(At,[2,60]),i(At,[2,61]),i(At,[2,62]),i(At,[2,63]),i(At,[2,64]),i(Bt,[2,65]),i(Bt,[2,66]),{31:88,89:ye,91:ke,92:Ae,93:de},{50:89,55:cn},{54:[1,91]},{28:[1,92]},{28:[1,93]},{74:[1,94],76:[1,95]},{31:96,89:ye,91:ke,92:Ae,93:de},{28:gt,59:97},i(te,[2,55]),i(te,[2,100]),i(pe,[2,22]),i(pe,[2,23]),i(pe,[2,24]),i(Nn,[2,41],{26:98,27:[1,99]}),{16:[1,100]},{18:101,21:[1,102]},{16:[2,14]},i($,[2,18]),{24:[1,103]},i(Ot,[2,50]),{30:104,31:36,32:37,89:ye,91:ke,92:Ae,93:de,94:ve},{28:[1,106],30:105,31:36,32:37,89:ye,91:ke,92:Ae,93:de,94:ve},i(jt,[2,58],{61:107,63:xe,64:De,65:he,66:Ie,67:ee}),i(jt,[2,57]),i(te,[2,38],{49:[1,108]}),{51:[1,109]},{50:110,51:[2,44],55:cn},{30:111,31:36,32:37,89:ye,91:ke,92:Ae,93:de,94:ve},i(te,[2,67],{28:[1,112]}),i(te,[2,69],{28:[1,114],72:[1,113]}),i(te,[2,73],{28:[1,115],75:[1,116]}),i(te,[2,77],{28:[1,118],72:[1,117]}),i(te,[2,81]),i(te,[2,54]),i(Nn,[2,42]),{28:[1,119]},i(oi,[2,9]),{15:120,22:wt},{22:[2,13]},{1:[2,15]},i(Ot,[2,52]),i(Ot,[2,51]),{30:121,31:36,32:37,89:ye,91:ke,92:Ae,93:de,94:ve},i(jt,[2,56]),{50:122,55:cn},i(te,[2,39]),{51:[2,45]},i(te,[2,43]),i(te,[2,68]),i(te,[2,70]),i(te,[2,71],{72:[1,123]}),i(te,[2,74]),i(te,[2,75],{28:[1,124]}),i(te,[2,78]),i(te,[2,79],{72:[1,125]}),{29:[1,126]},{16:[1,127]},i(Ot,[2,53]),{51:[1,128]},i(te,[2,72]),i(te,[2,76]),i(te,[2,80]),i(Nn,[2,19]),i(oi,[2,10]),i(te,[2,40])],defaultActions:{2:[2,1],4:[2,3],5:[2,8],9:[2,11],44:[2,2],80:[2,14],102:[2,13],103:[2,15],110:[2,45]},parseError:function(ze,Xe){if(Xe.recoverable)this.trace(ze);else{var Lt=new Error(ze);throw Lt.hash=Xe,Lt}},parse:function(ze){var Xe=this,Lt=[0],Ge=[],Bn=[null],Oe=[],Ri=this.table,tn="",hi=0,Sr=0,Zn=2,Xn=1,ir=Oe.slice.call(arguments,1),Hn=Object.create(this.lexer),tr={yy:{}};for(var ha in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ha)&&(tr.yy[ha]=this.yy[ha]);Hn.setInput(ze,tr.yy),tr.yy.lexer=Hn,tr.yy.parser=this,typeof Hn.yylloc>"u"&&(Hn.yylloc={});var Zs=Hn.yylloc;Oe.push(Zs);var ns=Hn.options&&Hn.options.ranges;typeof tr.yy.parseError=="function"?this.parseError=tr.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Hi(){var yn;return yn=Ge.pop()||Hn.lex()||Xn,typeof yn!="number"&&(yn instanceof Array&&(Ge=yn,yn=Ge.pop()),yn=Xe.symbols_[yn]||yn),yn}for(var Js,Pc,Ga,ws,Oi={},Er,br,Dr,Vn;;){if(Pc=Lt[Lt.length-1],this.defaultActions[Pc]?Ga=this.defaultActions[Pc]:((Js===null||typeof Js>"u")&&(Js=Hi()),Ga=Ri[Pc]&&Ri[Pc][Js]),typeof Ga>"u"||!Ga.length||!Ga[0]){var qi="";Vn=[];for(Er in Ri[Pc])this.terminals_[Er]&&Er>Zn&&Vn.push("'"+this.terminals_[Er]+"'");Hn.showPosition?qi="Parse error on line "+(hi+1)+`: -`+Hn.showPosition()+` -Expecting `+Vn.join(", ")+", got '"+(this.terminals_[Js]||Js)+"'":qi="Parse error on line "+(hi+1)+": Unexpected "+(Js==Xn?"end of input":"'"+(this.terminals_[Js]||Js)+"'"),this.parseError(qi,{text:Hn.match,token:this.terminals_[Js]||Js,line:Hn.yylineno,loc:Zs,expected:Vn})}if(Ga[0]instanceof Array&&Ga.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Pc+", token: "+Js);switch(Ga[0]){case 1:Lt.push(Js),Bn.push(Hn.yytext),Oe.push(Hn.yylloc),Lt.push(Ga[1]),Js=null,Sr=Hn.yyleng,tn=Hn.yytext,hi=Hn.yylineno,Zs=Hn.yylloc;break;case 2:if(br=this.productions_[Ga[1]][1],Oi.$=Bn[Bn.length-br],Oi._$={first_line:Oe[Oe.length-(br||1)].first_line,last_line:Oe[Oe.length-1].last_line,first_column:Oe[Oe.length-(br||1)].first_column,last_column:Oe[Oe.length-1].last_column},ns&&(Oi._$.range=[Oe[Oe.length-(br||1)].range[0],Oe[Oe.length-1].range[1]]),ws=this.performAction.apply(Oi,[tn,Sr,hi,tr.yy,Ga[1],Bn,Oe].concat(ir)),typeof ws<"u")return ws;br&&(Lt=Lt.slice(0,-1*br*2),Bn=Bn.slice(0,-1*br),Oe=Oe.slice(0,-1*br)),Lt.push(this.productions_[Ga[1]][0]),Bn.push(Oi.$),Oe.push(Oi._$),Dr=Ri[Lt[Lt.length-2]][Lt[Lt.length-1]],Lt.push(Dr);break;case 3:return!0}}return!0}},Dt=function(){var Nt={EOF:1,parseError:function(Xe,Lt){if(this.yy.parser)this.yy.parser.parseError(Xe,Lt);else throw new Error(Xe)},setInput:function(ze,Xe){return this.yy=Xe||this.yy||{},this._input=ze,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var ze=this._input[0];this.yytext+=ze,this.yyleng++,this.offset++,this.match+=ze,this.matched+=ze;var Xe=ze.match(/(?:\r\n?|\n).*/g);return Xe?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ze},unput:function(ze){var Xe=ze.length,Lt=ze.split(/(?:\r\n?|\n)/g);this._input=ze+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Xe),this.offset-=Xe;var Ge=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),Lt.length-1&&(this.yylineno-=Lt.length-1);var Bn=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Lt?(Lt.length===Ge.length?this.yylloc.first_column:0)+Ge[Ge.length-Lt.length].length-Lt[0].length:this.yylloc.first_column-Xe},this.options.ranges&&(this.yylloc.range=[Bn[0],Bn[0]+this.yyleng-Xe]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(ze){this.unput(this.match.slice(ze))},pastInput:function(){var ze=this.matched.substr(0,this.matched.length-this.match.length);return(ze.length>20?"...":"")+ze.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var ze=this.match;return ze.length<20&&(ze+=this._input.substr(0,20-ze.length)),(ze.substr(0,20)+(ze.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var ze=this.pastInput(),Xe=new Array(ze.length+1).join("-");return ze+this.upcomingInput()+` -`+Xe+"^"},test_match:function(ze,Xe){var Lt,Ge,Bn;if(this.options.backtrack_lexer&&(Bn={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},this.options.ranges&&(Bn.yylloc.range=this.yylloc.range.slice(0))),Ge=ze[0].match(/(?:\r\n?|\n).*/g),Ge&&(this.yylineno+=Ge.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Ge?Ge[Ge.length-1].length-Ge[Ge.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+ze[0].length},this.yytext+=ze[0],this.match+=ze[0],this.matches=ze,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(ze[0].length),this.matched+=ze[0],Lt=this.performAction.call(this,this.yy,this,Xe,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Lt)return Lt;if(this._backtrack){for(var Oe in Bn)this[Oe]=Bn[Oe];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var ze,Xe,Lt,Ge;this._more||(this.yytext="",this.match="");for(var Bn=this._currentRules(),Oe=0;OeXe[0].length)){if(Xe=Lt,Ge=Oe,this.options.backtrack_lexer){if(ze=this.test_match(Lt,Bn[Oe]),ze!==!1)return ze;if(this._backtrack){Xe=!1;continue}else return!1}else if(!this.options.flex)break}return Xe?(ze=this.test_match(Xe,Bn[Ge]),ze!==!1?ze:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var Xe=this.next();return Xe||this.lex()},begin:function(Xe){this.conditionStack.push(Xe)},popState:function(){var Xe=this.conditionStack.length-1;return Xe>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(Xe){return Xe=this.conditionStack.length-1-Math.abs(Xe||0),Xe>=0?this.conditionStack[Xe]:"INITIAL"},pushState:function(Xe){this.begin(Xe)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(Xe,Lt,Ge,Bn){switch(Ge){case 0:return this.begin("open_directive"),19;case 1:return 8;case 2:return 9;case 3:return 10;case 4:return 11;case 5:return this.begin("type_directive"),20;case 6:return this.popState(),this.begin("arg_directive"),17;case 7:return this.popState(),this.popState(),22;case 8:return 21;case 9:break;case 10:break;case 11:return this.begin("acc_title"),42;case 12:return this.popState(),"acc_title_value";case 13:return this.begin("acc_descr"),44;case 14:return this.popState(),"acc_descr_value";case 15:this.begin("acc_descr_multiline");break;case 16:this.popState();break;case 17:return"acc_descr_multiline_value";case 18:return 16;case 19:break;case 20:return 23;case 21:return 23;case 22:return this.begin("struct"),49;case 23:return"EDGE_STATE";case 24:return"EOF_IN_STRUCT";case 25:return"OPEN_IN_STRUCT";case 26:return this.popState(),51;case 27:break;case 28:return"MEMBER";case 29:return 52;case 30:return 77;case 31:return 70;case 32:return 71;case 33:return 73;case 34:return 58;case 35:return 60;case 36:return 53;case 37:return 54;case 38:this.begin("generic");break;case 39:this.popState();break;case 40:return"GENERICTYPE";case 41:this.begin("string");break;case 42:this.popState();break;case 43:return"STR";case 44:this.begin("bqstring");break;case 45:this.popState();break;case 46:return"BQUOTE_STR";case 47:this.begin("href");break;case 48:this.popState();break;case 49:return 76;case 50:this.begin("callback_name");break;case 51:this.popState();break;case 52:this.popState(),this.begin("callback_args");break;case 53:return 74;case 54:this.popState();break;case 55:return 75;case 56:return 72;case 57:return 72;case 58:return 72;case 59:return 72;case 60:return 64;case 61:return 64;case 62:return 66;case 63:return 66;case 64:return 65;case 65:return 63;case 66:return 67;case 67:return 68;case 68:return 69;case 69:return 35;case 70:return 48;case 71:return 89;case 72:return"DOT";case 73:return"PLUS";case 74:return 86;case 75:return"EQUALS";case 76:return"EQUALS";case 77:return 93;case 78:return 27;case 79:return 29;case 80:return"PUNCTUATION";case 81:return 92;case 82:return 91;case 83:return 88;case 84:return 24}},rules:[/^(?:%%\{)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\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)/,/^(?:[{])/,/^(?:\[\*\])/,/^(?:$)/,/^(?:[{])/,/^(?:[}])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:class\b)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:[~])/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[`])/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:href[\s]+["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:_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)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[16,17],inclusive:!1},acc_descr:{rules:[14],inclusive:!1},acc_title:{rules:[12],inclusive:!1},arg_directive:{rules:[7,8],inclusive:!1},type_directive:{rules:[6,7],inclusive:!1},open_directive:{rules:[5],inclusive:!1},callback_args:{rules:[54,55],inclusive:!1},callback_name:{rules:[51,52,53],inclusive:!1},href:{rules:[48,49],inclusive:!1},struct:{rules:[23,24,25,26,27,28],inclusive:!1},generic:{rules:[39,40],inclusive:!1},bqstring:{rules:[45,46],inclusive:!1},string:{rules:[42,43],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,9,10,11,13,15,18,19,20,21,22,23,29,30,31,32,33,34,35,36,37,38,41,44,47,50,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],inclusive:!0}}};return Nt}();kt.lexer=Dt;function vt(){this.yy={}}return vt.prototype=kt,kt.Parser=vt,new vt}();oge.parser=oge;const XRe=oge,cge="classId-";let uge=[],hf={},OK=[],QRe=0,IP=[];const M5=i=>Wa.sanitizeText(i,Tt()),HHt=function(i,a,f){rd.parseDirective(this,i,a,f)},hL=function(i){let a="",f=i;if(i.indexOf("~")>0){const p=i.split("~");f=M5(p[0]),a=M5(p[1])}return{className:f,type:a}},zHt=function(i,a){a&&(a=M5(a));const{className:f}=hL(i);hf[f].label=a},lge=function(i){const a=hL(i);hf[a.className]===void 0&&(hf[a.className]={id:a.className,type:a.type,label:a.className,cssClasses:[],methods:[],members:[],annotations:[],domId:cge+a.className+"-"+QRe},QRe++)},ZRe=function(i){if(i in hf)return hf[i].domId;throw new Error("Class not found: "+i)},GHt=function(){uge=[],hf={},OK=[],IP=[],IP.push(eFe),rp()},qHt=function(i){return hf[i]},VHt=function(){return hf},UHt=function(){return uge},WHt=function(){return OK},KHt=function(i){Fe.debug("Adding relation: "+JSON.stringify(i)),lge(i.id1),lge(i.id2),i.id1=hL(i.id1).className,i.id2=hL(i.id2).className,i.relationTitle1=Wa.sanitizeText(i.relationTitle1.trim(),Tt()),i.relationTitle2=Wa.sanitizeText(i.relationTitle2.trim(),Tt()),uge.push(i)},YHt=function(i,a){const f=hL(i).className;hf[f].annotations.push(a)},JRe=function(i,a){const f=hL(i).className,p=hf[f];if(typeof a=="string"){const w=a.trim();w.startsWith("<<")&&w.endsWith(">>")?p.annotations.push(M5(w.substring(2,w.length-2))):w.indexOf(")")>0?p.methods.push(M5(w)):w&&p.members.push(M5(w))}},XHt=function(i,a){Array.isArray(a)&&(a.reverse(),a.forEach(f=>JRe(i,f)))},QHt=function(i,a){const f={id:`note${OK.length}`,class:a,text:i};OK.push(f)},ZHt=function(i){return i.startsWith(":")&&(i=i.substring(1)),M5(i.trim())},hge=function(i,a){i.split(",").forEach(function(f){let p=f;f[0].match(/\d/)&&(p=cge+p),hf[p]!==void 0&&hf[p].cssClasses.push(a)})},JHt=function(i,a){i.split(",").forEach(function(f){a!==void 0&&(hf[f].tooltip=M5(a))})},ezt=function(i){return hf[i].tooltip},tzt=function(i,a,f){const p=Tt();i.split(",").forEach(function(w){let y=w;w[0].match(/\d/)&&(y=cge+y),hf[y]!==void 0&&(hf[y].link=co.formatUrl(a,p),p.securityLevel==="sandbox"?hf[y].linkTarget="_top":typeof f=="string"?hf[y].linkTarget=M5(f):hf[y].linkTarget="_blank")}),hge(i,"clickable")},nzt=function(i,a,f){i.split(",").forEach(function(p){rzt(p,a,f),hf[p].haveCallback=!0}),hge(i,"clickable")},rzt=function(i,a,f){if(Tt().securityLevel!=="loose"||a===void 0)return;const w=i;if(hf[w]!==void 0){const y=ZRe(w);let b=[];if(typeof f=="string"){b=f.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let E=0;E")),w.classed("hover",!0)}).on("mouseout",function(){a.transition().duration(500).style("opacity",0),Cr(this).classed("hover",!1)})};IP.push(eFe);let tFe="TB";const NK={parseDirective:HHt,setAccTitle:ip,getAccTitle:L2,getAccDescription:D2,setAccDescription:M2,getConfig:()=>Tt().class,addClass:lge,bindFunctions:izt,clear:GHt,getClass:qHt,getClasses:VHt,getNotes:WHt,addAnnotation:YHt,addNote:QHt,getRelations:UHt,addRelation:KHt,getDirection:()=>tFe,setDirection:i=>{tFe=i},addMember:JRe,addMembers:XHt,cleanupLabel:ZHt,lineType:szt,relationType:azt,setClickEvent:nzt,setCssClass:hge,setLink:tzt,getTooltip:ezt,setTooltip:JHt,lookUpDomId:ZRe,setDiagramTitle:Uw,getDiagramTitle:Ww,setClassLabel:zHt},nFe=i=>`g.classGroup text { - fill: ${i.nodeBorder}; - fill: ${i.classText}; +`,"getStyles"),rhe=_Ge});var mO,gf,ahe,she,LGe,ihe,gO,DGe,RGe,bx,_0,ohe,Bc,yO,NGe,MGe,IGe,OGe,PGe,BGe,FGe,lhe,zGe,GGe,$Ge,VGe,UGe,HGe,YGe,che,WGe,vO,qGe,si,uhe=R(()=>{"use strict";rr();Qy();xr();mO=Xi(Up(),1);qs();gf=18*2,ahe="actor-top",she="actor-bottom",LGe="actor-box",ihe="actor-man",gO=o(function(t,e){return yd(t,e)},"drawRect"),DGe=o(function(t,e,r,n,i){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};let a=e.links,s=e.actorCnt,l=e.rectData;var u="none";i&&(u="block !important");let h=t.append("g");h.attr("id","actor"+s+"_popup"),h.attr("class","actorPopupMenu"),h.attr("display",u);var f="";l.class!==void 0&&(f=" "+l.class);let d=l.width>r?l.width:r,p=h.append("rect");if(p.attr("class","actorPopupMenuPanel"+f),p.attr("x",l.x),p.attr("y",l.height),p.attr("fill",l.fill),p.attr("stroke",l.stroke),p.attr("width",d),p.attr("height",l.height),p.attr("rx",l.rx),p.attr("ry",l.ry),a!=null){var m=20;for(let v in a){var g=h.append("a"),y=(0,mO.sanitizeUrl)(a[v]);g.attr("xlink:href",y),g.attr("target","_blank"),qGe(n)(v,g,l.x+10,l.height+m,d,20,{class:"actor"},n),m+=30}}return p.attr("height",m),{height:l.height+m,width:d}},"drawPopup"),RGe=o(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),bx=o(async function(t,e,r=null){let n=t.append("foreignObject"),i=await yh(e.text,Or()),s=n.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(n.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),e.class==="noteText"){let l=t.node().firstChild;l.setAttribute("height",s.height+2*e.textMargin);let u=l.getBBox();n.attr("x",Math.round(u.x+u.width/2-s.width/2)).attr("y",Math.round(u.y+u.height/2-s.height/2))}else if(r){let{startx:l,stopx:u,starty:h}=r;if(l>u){let f=l;l=u,u=f}n.attr("x",Math.round(l+Math.abs(l-u)/2-s.width/2)),e.class==="loopText"?n.attr("y",Math.round(h)):n.attr("y",Math.round(h-s.height))}return[n]},"drawKatex"),_0=o(function(t,e){let r=0,n=0,i=e.text.split(We.lineBreakRegex),[a,s]=mc(e.fontSize),l=[],u=0,h=o(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":h=o(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":h=o(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":h=o(()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin),"yfunc");break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[f,d]of i.entries()){e.textMargin!==void 0&&e.textMargin===0&&a!==void 0&&(u=f*a);let p=t.append("text");p.attr("x",e.x),p.attr("y",h()),e.anchor!==void 0&&p.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&p.style("font-family",e.fontFamily),s!==void 0&&p.style("font-size",s),e.fontWeight!==void 0&&p.style("font-weight",e.fontWeight),e.fill!==void 0&&p.attr("fill",e.fill),e.class!==void 0&&p.attr("class",e.class),e.dy!==void 0?p.attr("dy",e.dy):u!==0&&p.attr("dy",u);let m=d||K_;if(e.tspan){let g=p.append("tspan");g.attr("x",e.x),e.fill!==void 0&&g.attr("fill",e.fill),g.text(m)}else p.text(m);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(n+=(p._groups||p)[0][0].getBBox().height,r=n),l.push(p)}return l},"drawText"),ohe=o(function(t,e){function r(i,a,s,l,u){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+l-u)+" "+(i+s-u*1.2)+","+(a+l)+" "+i+","+(a+l)}o(r,"genPoints");let n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,_0(t,e),n},"drawLabel"),Bc=-1,yO=o((t,e,r,n)=>{t.select&&r.forEach(i=>{let a=e.get(i),s=t.select("#actor"+a.actorCnt);!n.mirrorActors&&a.stopy?s.attr("y2",a.stopy+a.height/2):n.mirrorActors&&s.attr("y2",a.stopy)})},"fixLifeLineHeights"),NGe=o(function(t,e,r,n){let i=n?e.stopy:e.starty,a=e.x+e.width/2,s=i+5,l=t.append("g").lower();var u=l;n||(Bc++,Object.keys(e.links||{}).length&&!r.forceMenus&&u.attr("onclick",RGe(`actor${Bc}_popup`)).attr("cursor","pointer"),u.append("line").attr("id","actor"+Bc).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),u=l.append("g"),e.actorCnt=Bc,e.links!=null&&u.attr("id","root-"+Bc));let h=wl();var f="actor";e.properties?.class?f=e.properties.class:h.fill="#eaeaea",n?f+=` ${she}`:f+=` ${ahe}`,h.x=e.x,h.y=i,h.width=e.width,h.height=e.height,h.class=f,h.rx=3,h.ry=3,h.name=e.name;let d=gO(u,h);if(e.rectData=h,e.properties?.icon){let m=e.properties.icon.trim();m.charAt(0)==="@"?EW(u,h.x+h.width-20,h.y+10,m.substr(1)):kW(u,h.x+h.width-20,h.y+10,m)}vO(r,Ni(e.description))(e.description,u,h.x,h.y,h.width,h.height,{class:`actor ${LGe}`},r);let p=e.height;if(d.node){let m=d.node().getBBox();e.height=m.height,p=m.height}return p},"drawActorTypeParticipant"),MGe=o(function(t,e,r,n){let i=n?e.stopy:e.starty,a=e.x+e.width/2,s=i+80,l=t.append("g").lower();n||(Bc++,l.append("line").attr("id","actor"+Bc).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=Bc);let u=t.append("g"),h=ihe;n?h+=` ${she}`:h+=` ${ahe}`,u.attr("class",h),u.attr("name",e.name);let f=wl();f.x=e.x,f.y=i,f.fill="#eaeaea",f.width=e.width,f.height=e.height,f.class="actor",f.rx=3,f.ry=3,u.append("line").attr("id","actor-man-torso"+Bc).attr("x1",a).attr("y1",i+25).attr("x2",a).attr("y2",i+45),u.append("line").attr("id","actor-man-arms"+Bc).attr("x1",a-gf/2).attr("y1",i+33).attr("x2",a+gf/2).attr("y2",i+33),u.append("line").attr("x1",a-gf/2).attr("y1",i+60).attr("x2",a).attr("y2",i+45),u.append("line").attr("x1",a).attr("y1",i+45).attr("x2",a+gf/2-2).attr("y2",i+60);let d=u.append("circle");d.attr("cx",e.x+e.width/2),d.attr("cy",i+10),d.attr("r",15),d.attr("width",e.width),d.attr("height",e.height);let p=u.node().getBBox();return e.height=p.height,vO(r,Ni(e.description))(e.description,u,f.x,f.y+35,f.width,f.height,{class:`actor ${ihe}`},r),e.height},"drawActorTypeActor"),IGe=o(async function(t,e,r,n){switch(e.type){case"actor":return await MGe(t,e,r,n);case"participant":return await NGe(t,e,r,n)}},"drawActor"),OGe=o(function(t,e,r){let i=t.append("g");lhe(i,e),e.name&&vO(r)(e.name,i,e.x,e.y+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),PGe=o(function(t){return t.append("g")},"anchorElement"),BGe=o(function(t,e,r,n,i){let a=wl(),s=e.anchored;a.x=e.startx,a.y=e.starty,a.class="activation"+i%3,a.width=e.stopx-e.startx,a.height=r-e.starty,gO(s,a)},"drawActivation"),FGe=o(async function(t,e,r,n){let{boxMargin:i,boxTextMargin:a,labelBoxHeight:s,labelBoxWidth:l,messageFontFamily:u,messageFontSize:h,messageFontWeight:f}=n,d=t.append("g"),p=o(function(y,v,x,b){return d.append("line").attr("x1",y).attr("y1",v).attr("x2",x).attr("y2",b).attr("class","loopLine")},"drawLoopLine");p(e.startx,e.starty,e.stopx,e.starty),p(e.stopx,e.starty,e.stopx,e.stopy),p(e.startx,e.stopy,e.stopx,e.stopy),p(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(y){p(e.startx,y.y,e.stopx,y.y).style("stroke-dasharray","3, 3")});let m=Ky();m.text=r,m.x=e.startx,m.y=e.starty,m.fontFamily=u,m.fontSize=h,m.fontWeight=f,m.anchor="middle",m.valign="middle",m.tspan=!1,m.width=l||50,m.height=s||20,m.textMargin=a,m.class="labelText",ohe(d,m),m=che(),m.text=e.title,m.x=e.startx+l/2+(e.stopx-e.startx)/2,m.y=e.starty+i+a,m.anchor="middle",m.valign="middle",m.textMargin=a,m.class="loopText",m.fontFamily=u,m.fontSize=h,m.fontWeight=f,m.wrap=!0;let g=Ni(m.text)?await bx(d,m,e):_0(d,m);if(e.sectionTitles!==void 0){for(let[y,v]of Object.entries(e.sectionTitles))if(v.message){m.text=v.message,m.x=e.startx+(e.stopx-e.startx)/2,m.y=e.sections[y].y+i+a,m.class="loopText",m.anchor="middle",m.valign="middle",m.tspan=!1,m.fontFamily=u,m.fontSize=h,m.fontWeight=f,m.wrap=e.wrap,Ni(m.text)?(e.starty=e.sections[y].y,await bx(d,m,e)):_0(d,m);let x=Math.round(g.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,w)=>b+w));e.sections[y].height+=x-(i+a)}}return e.height=Math.round(e.stopy-e.starty),d},"drawLoop"),lhe=o(function(t,e){j3(t,e)},"drawBackgroundRect"),zGe=o(function(t){t.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"),GGe=o(function(t){t.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"),$Ge=o(function(t){t.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"),VGe=o(function(t){t.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"),UGe=o(function(t){t.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"),HGe=o(function(t){t.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"),YGe=o(function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).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"),che=o(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:!0,valign:void 0}},"getTextObj"),WGe=o(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),vO=function(){function t(a,s,l,u,h,f,d){let p=s.append("text").attr("x",l+h/2).attr("y",u+f/2+5).style("text-anchor","middle").text(a);i(p,d)}o(t,"byText");function e(a,s,l,u,h,f,d,p){let{actorFontSize:m,actorFontFamily:g,actorFontWeight:y}=p,[v,x]=mc(m),b=a.split(We.lineBreakRegex);for(let w=0;w{let s=L0(Ne),l=a.actorKeys.reduce((f,d)=>f+=t.get(d).width+(t.get(d).margin||0),0);l-=2*Ne.boxTextMargin,a.wrap&&(a.name=Lt.wrapLabel(a.name,l-2*Ne.wrapPadding,s));let u=Lt.calculateTextDimensions(a.name,s);i=We.getMax(u.height,i);let h=We.getMax(l,u.width+2*Ne.wrapPadding);if(a.margin=Ne.boxTextMargin,la.textMaxHeight=i),We.getMax(n,Ne.height)}var Ne,Ke,XGe,L0,Pg,xO,KGe,QGe,bO,fhe,dhe,bE,hhe,JGe,t$e,n$e,i$e,a$e,phe,mhe=R(()=>{"use strict";Zt();uhe();ut();rr();Qy();_t();cp();xr();Yn();Ne={},Ke={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:o(function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map(t=>t.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:o(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:o(function(t){this.boxes.push(t)},"addBox"),addActor:o(function(t){this.actors.push(t)},"addActor"),addLoop:o(function(t){this.loops.push(t)},"addLoop"),addMessage:o(function(t){this.messages.push(t)},"addMessage"),addNote:o(function(t){this.notes.push(t)},"addNote"),lastActor:o(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:o(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:o(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:o(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:o(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,dhe(de())},"init"),updateVal:o(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:o(function(t,e,r,n){let i=this,a=0;function s(l){return o(function(h){a++;let f=i.sequenceItems.length-a+1;i.updateVal(h,"starty",e-f*Ne.boxMargin,Math.min),i.updateVal(h,"stopy",n+f*Ne.boxMargin,Math.max),i.updateVal(Ke.data,"startx",t-f*Ne.boxMargin,Math.min),i.updateVal(Ke.data,"stopx",r+f*Ne.boxMargin,Math.max),l!=="activation"&&(i.updateVal(h,"startx",t-f*Ne.boxMargin,Math.min),i.updateVal(h,"stopx",r+f*Ne.boxMargin,Math.max),i.updateVal(Ke.data,"starty",e-f*Ne.boxMargin,Math.min),i.updateVal(Ke.data,"stopy",n+f*Ne.boxMargin,Math.max))},"updateItemBounds")}o(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:o(function(t,e,r,n){let i=We.getMin(t,r),a=We.getMax(t,r),s=We.getMin(e,n),l=We.getMax(e,n);this.updateVal(Ke.data,"startx",i,Math.min),this.updateVal(Ke.data,"starty",s,Math.min),this.updateVal(Ke.data,"stopx",a,Math.max),this.updateVal(Ke.data,"stopy",l,Math.max),this.updateBounds(i,s,a,l)},"insert"),newActivation:o(function(t,e,r){let n=r.get(t.from),i=bE(t.from).length||0,a=n.x+n.width/2+(i-1)*Ne.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Ne.activationWidth,stopy:void 0,actor:t.from,anchored:si.anchorElement(e)})},"newActivation"),endActivation:o(function(t){let e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:o(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:o(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:o(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:o(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:o(function(t){let e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Ke.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:o(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:o(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:o(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=We.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:o(function(){return this.verticalPos},"getVerticalPos"),getBounds:o(function(){return{bounds:this.data,models:this.models}},"getBounds")},XGe=o(async function(t,e){Ke.bumpVerticalPos(Ne.boxMargin),e.height=Ne.boxMargin,e.starty=Ke.getVerticalPos();let r=wl();r.x=e.startx,r.y=e.starty,r.width=e.width||Ne.width,r.class="note";let n=t.append("g"),i=si.drawRect(n,r),a=Ky();a.x=e.startx,a.y=e.starty,a.width=r.width,a.dy="1em",a.text=e.message,a.class="noteText",a.fontFamily=Ne.noteFontFamily,a.fontSize=Ne.noteFontSize,a.fontWeight=Ne.noteFontWeight,a.anchor=Ne.noteAlign,a.textMargin=Ne.noteMargin,a.valign="center";let s=Ni(a.text)?await bx(n,a):_0(n,a),l=Math.round(s.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,h)=>u+h));i.attr("height",l+2*Ne.noteMargin),e.height+=l+2*Ne.noteMargin,Ke.bumpVerticalPos(l+2*Ne.noteMargin),e.stopy=e.starty+l+2*Ne.noteMargin,e.stopx=e.startx+r.width,Ke.insert(e.startx,e.starty,e.stopx,e.stopy),Ke.models.addNote(e)},"drawNote"),L0=o(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),Pg=o(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),xO=o(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");o(jGe,"boundMessage");KGe=o(async function(t,e,r,n){let{startx:i,stopx:a,starty:s,message:l,type:u,sequenceIndex:h,sequenceVisible:f}=e,d=Lt.calculateTextDimensions(l,L0(Ne)),p=Ky();p.x=i,p.y=s+10,p.width=a-i,p.class="messageText",p.dy="1em",p.text=l,p.fontFamily=Ne.messageFontFamily,p.fontSize=Ne.messageFontSize,p.fontWeight=Ne.messageFontWeight,p.anchor=Ne.messageAlign,p.valign="center",p.textMargin=Ne.wrapPadding,p.tspan=!1,Ni(p.text)?await bx(t,p,{startx:i,stopx:a,starty:r}):_0(t,p);let m=d.width,g;i===a?Ne.rightAngles?g=t.append("path").attr("d",`M ${i},${r} H ${i+We.getMax(Ne.width/2,m/2)} V ${r+25} H ${i}`):g=t.append("path").attr("d","M "+i+","+r+" C "+(i+60)+","+(r-10)+" "+(i+60)+","+(r+30)+" "+i+","+(r+20)):(g=t.append("line"),g.attr("x1",i),g.attr("y1",r),g.attr("x2",a),g.attr("y2",r)),u===n.db.LINETYPE.DOTTED||u===n.db.LINETYPE.DOTTED_CROSS||u===n.db.LINETYPE.DOTTED_POINT||u===n.db.LINETYPE.DOTTED_OPEN||u===n.db.LINETYPE.BIDIRECTIONAL_DOTTED?(g.style("stroke-dasharray","3, 3"),g.attr("class","messageLine1")):g.attr("class","messageLine0");let y="";Ne.arrowMarkerAbsolute&&(y=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,y=y.replace(/\(/g,"\\("),y=y.replace(/\)/g,"\\)")),g.attr("stroke-width",2),g.attr("stroke","none"),g.style("fill","none"),(u===n.db.LINETYPE.SOLID||u===n.db.LINETYPE.DOTTED)&&g.attr("marker-end","url("+y+"#arrowhead)"),(u===n.db.LINETYPE.BIDIRECTIONAL_SOLID||u===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(g.attr("marker-start","url("+y+"#arrowhead)"),g.attr("marker-end","url("+y+"#arrowhead)")),(u===n.db.LINETYPE.SOLID_POINT||u===n.db.LINETYPE.DOTTED_POINT)&&g.attr("marker-end","url("+y+"#filled-head)"),(u===n.db.LINETYPE.SOLID_CROSS||u===n.db.LINETYPE.DOTTED_CROSS)&&g.attr("marker-end","url("+y+"#crosshead)"),(f||Ne.showSequenceNumbers)&&(g.attr("marker-start","url("+y+"#sequencenumber)"),t.append("text").attr("x",i).attr("y",r+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(h))},"drawMessage"),QGe=o(function(t,e,r,n,i,a,s){let l=0,u=0,h,f=0;for(let d of n){let p=e.get(d),m=p.box;h&&h!=m&&(s||Ke.models.addBox(h),u+=Ne.boxMargin+h.margin),m&&m!=h&&(s||(m.x=l+u,m.y=i),u+=m.margin),p.width=p.width||Ne.width,p.height=We.getMax(p.height||Ne.height,Ne.height),p.margin=p.margin||Ne.actorMargin,f=We.getMax(f,p.height),r.get(p.name)&&(u+=p.width/2),p.x=l+u,p.starty=Ke.getVerticalPos(),Ke.insert(p.x,i,p.x+p.width,p.height),l+=p.width+u,p.box&&(p.box.width=l+m.margin-p.box.x),u=p.margin,h=p.box,Ke.models.addActor(p)}h&&!s&&Ke.models.addBox(h),Ke.bumpVerticalPos(f)},"addActorRenderingData"),bO=o(async function(t,e,r,n){if(n){let i=0;Ke.bumpVerticalPos(Ne.boxMargin*2);for(let a of r){let s=e.get(a);s.stopy||(s.stopy=Ke.getVerticalPos());let l=await si.drawActor(t,s,Ne,!0);i=We.getMax(i,l)}Ke.bumpVerticalPos(i+Ne.boxMargin)}else for(let i of r){let a=e.get(i);await si.drawActor(t,a,Ne,!1)}},"drawActors"),fhe=o(function(t,e,r,n){let i=0,a=0;for(let s of r){let l=e.get(s),u=t$e(l),h=si.drawPopup(t,l,u,Ne,Ne.forceMenus,n);h.height>i&&(i=h.height),h.width+l.x>a&&(a=h.width+l.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),dhe=o(function(t){On(Ne,t),t.fontFamily&&(Ne.actorFontFamily=Ne.noteFontFamily=Ne.messageFontFamily=t.fontFamily),t.fontSize&&(Ne.actorFontSize=Ne.noteFontSize=Ne.messageFontSize=t.fontSize),t.fontWeight&&(Ne.actorFontWeight=Ne.noteFontWeight=Ne.messageFontWeight=t.fontWeight)},"setConf"),bE=o(function(t){return Ke.activations.filter(function(e){return e.actor===t})},"actorActivations"),hhe=o(function(t,e){let r=e.get(t),n=bE(t),i=n.reduce(function(s,l){return We.getMin(s,l.startx)},r.x+r.width/2-1),a=n.reduce(function(s,l){return We.getMax(s,l.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");o(Fc,"adjustLoopHeightForWrap");o(ZGe,"adjustCreatedDestroyedData");JGe=o(async function(t,e,r,n){let{securityLevel:i,sequence:a}=de();Ne=a;let s;i==="sandbox"&&(s=$e("#i"+e));let l=i==="sandbox"?$e(s.nodes()[0].contentDocument.body):$e("body"),u=i==="sandbox"?s.nodes()[0].contentDocument:document;Ke.init(),V.debug(n.db);let h=i==="sandbox"?l.select(`[id="${e}"]`):$e(`[id="${e}"]`),f=n.db.getActors(),d=n.db.getCreatedActors(),p=n.db.getDestroyedActors(),m=n.db.getBoxes(),g=n.db.getActorKeys(),y=n.db.getMessages(),v=n.db.getDiagramTitle(),x=n.db.hasAtLeastOneBox(),b=n.db.hasAtLeastOneBoxWithTitle(),w=await e$e(f,y,n);if(Ne.height=await r$e(f,w,m),si.insertComputerIcon(h),si.insertDatabaseIcon(h),si.insertClockIcon(h),x&&(Ke.bumpVerticalPos(Ne.boxMargin),b&&Ke.bumpVerticalPos(m[0].textMaxHeight)),Ne.hideUnusedParticipants===!0){let F=new Set;y.forEach(B=>{F.add(B.from),F.add(B.to)}),g=g.filter(B=>F.has(B))}QGe(h,f,d,g,0,y,!1);let S=await a$e(y,f,w,n);si.insertArrowHead(h),si.insertArrowCrossHead(h),si.insertArrowFilledHead(h),si.insertSequenceNumber(h);function T(F,B){let $=Ke.endActivation(F);$.starty+18>B&&($.starty=B-6,B+=12),si.drawActivation(h,$,B,Ne,bE(F.from).length),Ke.insert($.startx,B-10,$.stopx,B)}o(T,"activeEnd");let E=1,_=1,A=[],L=[],M=0;for(let F of y){let B,$,z;switch(F.type){case n.db.LINETYPE.NOTE:Ke.resetVerticalPos(),$=F.noteModel,await XGe(h,$);break;case n.db.LINETYPE.ACTIVE_START:Ke.newActivation(F,h,f);break;case n.db.LINETYPE.ACTIVE_END:T(F,Ke.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:Fc(S,F,Ne.boxMargin,Ne.boxMargin+Ne.boxTextMargin,Y=>Ke.newLoop(Y));break;case n.db.LINETYPE.LOOP_END:B=Ke.endLoop(),await si.drawLoop(h,B,"loop",Ne),Ke.bumpVerticalPos(B.stopy-Ke.getVerticalPos()),Ke.models.addLoop(B);break;case n.db.LINETYPE.RECT_START:Fc(S,F,Ne.boxMargin,Ne.boxMargin,Y=>Ke.newLoop(void 0,Y.message));break;case n.db.LINETYPE.RECT_END:B=Ke.endLoop(),L.push(B),Ke.models.addLoop(B),Ke.bumpVerticalPos(B.stopy-Ke.getVerticalPos());break;case n.db.LINETYPE.OPT_START:Fc(S,F,Ne.boxMargin,Ne.boxMargin+Ne.boxTextMargin,Y=>Ke.newLoop(Y));break;case n.db.LINETYPE.OPT_END:B=Ke.endLoop(),await si.drawLoop(h,B,"opt",Ne),Ke.bumpVerticalPos(B.stopy-Ke.getVerticalPos()),Ke.models.addLoop(B);break;case n.db.LINETYPE.ALT_START:Fc(S,F,Ne.boxMargin,Ne.boxMargin+Ne.boxTextMargin,Y=>Ke.newLoop(Y));break;case n.db.LINETYPE.ALT_ELSE:Fc(S,F,Ne.boxMargin+Ne.boxTextMargin,Ne.boxMargin,Y=>Ke.addSectionToLoop(Y));break;case n.db.LINETYPE.ALT_END:B=Ke.endLoop(),await si.drawLoop(h,B,"alt",Ne),Ke.bumpVerticalPos(B.stopy-Ke.getVerticalPos()),Ke.models.addLoop(B);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:Fc(S,F,Ne.boxMargin,Ne.boxMargin+Ne.boxTextMargin,Y=>Ke.newLoop(Y)),Ke.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:Fc(S,F,Ne.boxMargin+Ne.boxTextMargin,Ne.boxMargin,Y=>Ke.addSectionToLoop(Y));break;case n.db.LINETYPE.PAR_END:B=Ke.endLoop(),await si.drawLoop(h,B,"par",Ne),Ke.bumpVerticalPos(B.stopy-Ke.getVerticalPos()),Ke.models.addLoop(B);break;case n.db.LINETYPE.AUTONUMBER:E=F.message.start||E,_=F.message.step||_,F.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:Fc(S,F,Ne.boxMargin,Ne.boxMargin+Ne.boxTextMargin,Y=>Ke.newLoop(Y));break;case n.db.LINETYPE.CRITICAL_OPTION:Fc(S,F,Ne.boxMargin+Ne.boxTextMargin,Ne.boxMargin,Y=>Ke.addSectionToLoop(Y));break;case n.db.LINETYPE.CRITICAL_END:B=Ke.endLoop(),await si.drawLoop(h,B,"critical",Ne),Ke.bumpVerticalPos(B.stopy-Ke.getVerticalPos()),Ke.models.addLoop(B);break;case n.db.LINETYPE.BREAK_START:Fc(S,F,Ne.boxMargin,Ne.boxMargin+Ne.boxTextMargin,Y=>Ke.newLoop(Y));break;case n.db.LINETYPE.BREAK_END:B=Ke.endLoop(),await si.drawLoop(h,B,"break",Ne),Ke.bumpVerticalPos(B.stopy-Ke.getVerticalPos()),Ke.models.addLoop(B);break;default:try{z=F.msgModel,z.starty=Ke.getVerticalPos(),z.sequenceIndex=E,z.sequenceVisible=n.db.showSequenceNumbers();let Y=await jGe(h,z);ZGe(F,z,Y,M,f,d,p),A.push({messageModel:z,lineStartY:Y}),Ke.models.addMessage(z)}catch(Y){V.error("error while drawing message",Y)}}[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT,n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(F.type)&&(E=E+_),M++}V.debug("createdActors",d),V.debug("destroyedActors",p),await bO(h,f,g,!1);for(let F of A)await KGe(h,F.messageModel,F.lineStartY,n);Ne.mirrorActors&&await bO(h,f,g,!0),L.forEach(F=>si.drawBackgroundRect(h,F)),yO(h,f,g,Ne);for(let F of Ke.models.boxes)F.height=Ke.getVerticalPos()-F.y,Ke.insert(F.x,F.y,F.x+F.width,F.height),F.startx=F.x,F.starty=F.y,F.stopx=F.startx+F.width,F.stopy=F.starty+F.height,F.stroke="rgb(0,0,0, 0.5)",si.drawBox(h,F,Ne);x&&Ke.bumpVerticalPos(Ne.boxMargin);let N=fhe(h,f,g,u),{bounds:k}=Ke.getBounds();k.startx===void 0&&(k.startx=0),k.starty===void 0&&(k.starty=0),k.stopx===void 0&&(k.stopx=0),k.stopy===void 0&&(k.stopy=0);let I=k.stopy-k.starty;I2,d=o(y=>l?-y:y,"adjustValue");t.from===t.to?h=u:(t.activate&&!f&&(h+=d(Ne.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(h+=d(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(u-=d(3)));let p=[n,i,a,s],m=Math.abs(u-h);t.wrap&&t.message&&(t.message=Lt.wrapLabel(t.message,We.getMax(m+2*Ne.wrapPadding,Ne.width),L0(Ne)));let g=Lt.calculateTextDimensions(t.message,L0(Ne));return{width:We.getMax(t.wrap?0:g.width+2*Ne.wrapPadding,m+2*Ne.wrapPadding,Ne.width),height:0,startx:u,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}},"buildMessageModel"),a$e=o(async function(t,e,r,n){let i={},a=[],s,l,u;for(let h of t){switch(h.id=Lt.random({length:10}),h.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:a.push({id:h.id,msg:h.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:h.message&&(s=a.pop(),i[s.id]=s,i[h.id]=s,a.push(s));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:s=a.pop(),i[s.id]=s;break;case n.db.LINETYPE.ACTIVE_START:{let d=e.get(h.from?h.from:h.to.actor),p=bE(h.from?h.from:h.to.actor).length,m=d.x+d.width/2+(p-1)*Ne.activationWidth/2,g={startx:m,stopx:m+Ne.activationWidth,actor:h.from,enabled:!0};Ke.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{let d=Ke.activations.map(p=>p.actor).lastIndexOf(h.from);Ke.activations.splice(d,1).splice(0,1)}break}h.placement!==void 0?(l=await n$e(h,e,n),h.noteModel=l,a.forEach(d=>{s=d,s.from=We.getMin(s.from,l.startx),s.to=We.getMax(s.to,l.startx+l.width),s.width=We.getMax(s.width,Math.abs(s.from-s.to))-Ne.labelBoxWidth})):(u=i$e(h,e,n),h.msgModel=u,u.startx&&u.stopx&&a.length>0&&a.forEach(d=>{if(s=d,u.startx===u.stopx){let p=e.get(h.from),m=e.get(h.to);s.from=We.getMin(p.x-u.width/2,p.x-p.width/2,s.from),s.to=We.getMax(m.x+u.width/2,m.x+p.width/2,s.to),s.width=We.getMax(s.width,Math.abs(s.to-s.from))-Ne.labelBoxWidth}else s.from=We.getMin(u.startx,s.from),s.to=We.getMax(u.stopx,s.to),s.width=We.getMax(s.width,u.width)-Ne.labelBoxWidth}))}return Ke.activations=[],V.debug("Loop type widths:",i),i},"calculateLoopBounds"),phe={bounds:Ke,drawActors:bO,drawActorsPopup:fhe,setConf:dhe,draw:JGe}});var ghe={};hr(ghe,{diagram:()=>s$e});var s$e,yhe=R(()=>{"use strict";que();the();nhe();mhe();s$e={parser:Wue,db:pO,renderer:phe,styles:rhe,init:o(({wrap:t})=>{pO.setWrap(t)},"init")}});var wO,wE,TO=R(()=>{"use strict";wO=function(){var t=o(function(Pe,_e,me,W){for(me=me||{},W=Pe.length;W--;me[Pe[W]]=_e);return me},"o"),e=[1,17],r=[1,18],n=[1,19],i=[1,39],a=[1,40],s=[1,25],l=[1,23],u=[1,24],h=[1,31],f=[1,32],d=[1,33],p=[1,34],m=[1,35],g=[1,36],y=[1,26],v=[1,27],x=[1,28],b=[1,29],w=[1,43],S=[1,30],T=[1,42],E=[1,44],_=[1,41],A=[1,45],L=[1,9],M=[1,8,9],N=[1,56],k=[1,57],I=[1,58],C=[1,59],O=[1,60],D=[1,61],P=[1,62],F=[1,8,9,39],B=[1,74],$=[1,8,9,12,13,21,37,39,42,59,60,61,62,63,64,65,70,72],z=[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],Y=[13,74,80,95,97,98],Q=[13,64,65,74,80,95,97,98],X=[13,59,60,61,62,63,74,80,95,97,98],ie=[1,93],j=[1,110],J=[1,108],Z=[1,102],H=[1,103],q=[1,104],K=[1,105],se=[1,106],ce=[1,107],ue=[1,109],te=[1,8,9,37,39,42],De=[1,8,9,21],oe=[1,8,9,78],ke=[1,8,9,21,73,74,78,80,81,82,83,84,85],Ie={trace:o(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:o(function(_e,me,W,fe,ge,re,he){var ne=re.length-1;switch(ge){case 8:this.$=re[ne-1];break;case 9:case 11:case 12:this.$=re[ne];break;case 10:case 13:this.$=re[ne-1]+re[ne];break;case 14:case 15:this.$=re[ne-1]+"~"+re[ne]+"~";break;case 16:fe.addRelation(re[ne]);break;case 17:re[ne-1].title=fe.cleanupLabel(re[ne]),fe.addRelation(re[ne-1]);break;case 27:this.$=re[ne].trim(),fe.setAccTitle(this.$);break;case 28:case 29:this.$=re[ne].trim(),fe.setAccDescription(this.$);break;case 30:fe.addClassesToNamespace(re[ne-3],re[ne-1]);break;case 31:fe.addClassesToNamespace(re[ne-4],re[ne-1]);break;case 32:this.$=re[ne],fe.addNamespace(re[ne]);break;case 33:this.$=[re[ne]];break;case 34:this.$=[re[ne-1]];break;case 35:re[ne].unshift(re[ne-2]),this.$=re[ne];break;case 37:fe.setCssClass(re[ne-2],re[ne]);break;case 38:fe.addMembers(re[ne-3],re[ne-1]);break;case 39:fe.setCssClass(re[ne-5],re[ne-3]),fe.addMembers(re[ne-5],re[ne-1]);break;case 40:this.$=re[ne],fe.addClass(re[ne]);break;case 41:this.$=re[ne-1],fe.addClass(re[ne-1]),fe.setClassLabel(re[ne-1],re[ne]);break;case 42:fe.addAnnotation(re[ne],re[ne-2]);break;case 43:this.$=[re[ne]];break;case 44:re[ne].push(re[ne-1]),this.$=re[ne];break;case 45:break;case 46:fe.addMember(re[ne-1],fe.cleanupLabel(re[ne]));break;case 47:break;case 48:break;case 49:this.$={id1:re[ne-2],id2:re[ne],relation:re[ne-1],relationTitle1:"none",relationTitle2:"none"};break;case 50:this.$={id1:re[ne-3],id2:re[ne],relation:re[ne-1],relationTitle1:re[ne-2],relationTitle2:"none"};break;case 51:this.$={id1:re[ne-3],id2:re[ne],relation:re[ne-2],relationTitle1:"none",relationTitle2:re[ne-1]};break;case 52:this.$={id1:re[ne-4],id2:re[ne],relation:re[ne-2],relationTitle1:re[ne-3],relationTitle2:re[ne-1]};break;case 53:fe.addNote(re[ne],re[ne-1]);break;case 54:fe.addNote(re[ne]);break;case 55:fe.setDirection("TB");break;case 56:fe.setDirection("BT");break;case 57:fe.setDirection("RL");break;case 58:fe.setDirection("LR");break;case 59:this.$={type1:re[ne-2],type2:re[ne],lineType:re[ne-1]};break;case 60:this.$={type1:"none",type2:re[ne],lineType:re[ne-1]};break;case 61:this.$={type1:re[ne-1],type2:"none",lineType:re[ne]};break;case 62:this.$={type1:"none",type2:"none",lineType:re[ne]};break;case 63:this.$=fe.relationType.AGGREGATION;break;case 64:this.$=fe.relationType.EXTENSION;break;case 65:this.$=fe.relationType.COMPOSITION;break;case 66:this.$=fe.relationType.DEPENDENCY;break;case 67:this.$=fe.relationType.LOLLIPOP;break;case 68:this.$=fe.lineType.LINE;break;case 69:this.$=fe.lineType.DOTTED_LINE;break;case 70:case 76:this.$=re[ne-2],fe.setClickEvent(re[ne-1],re[ne]);break;case 71:case 77:this.$=re[ne-3],fe.setClickEvent(re[ne-2],re[ne-1]),fe.setTooltip(re[ne-2],re[ne]);break;case 72:this.$=re[ne-2],fe.setLink(re[ne-1],re[ne]);break;case 73:this.$=re[ne-3],fe.setLink(re[ne-2],re[ne-1],re[ne]);break;case 74:this.$=re[ne-3],fe.setLink(re[ne-2],re[ne-1]),fe.setTooltip(re[ne-2],re[ne]);break;case 75:this.$=re[ne-4],fe.setLink(re[ne-3],re[ne-2],re[ne]),fe.setTooltip(re[ne-3],re[ne-1]);break;case 78:this.$=re[ne-3],fe.setClickEvent(re[ne-2],re[ne-1],re[ne]);break;case 79:this.$=re[ne-4],fe.setClickEvent(re[ne-3],re[ne-2],re[ne-1]),fe.setTooltip(re[ne-3],re[ne]);break;case 80:this.$=re[ne-3],fe.setLink(re[ne-2],re[ne]);break;case 81:this.$=re[ne-4],fe.setLink(re[ne-3],re[ne-1],re[ne]);break;case 82:this.$=re[ne-4],fe.setLink(re[ne-3],re[ne-1]),fe.setTooltip(re[ne-3],re[ne]);break;case 83:this.$=re[ne-5],fe.setLink(re[ne-4],re[ne-2],re[ne]),fe.setTooltip(re[ne-4],re[ne-1]);break;case 84:this.$=re[ne-2],fe.setCssStyle(re[ne-1],re[ne]);break;case 85:fe.setCssClass(re[ne-1],re[ne]);break;case 86:this.$=[re[ne]];break;case 87:re[ne-2].push(re[ne]),this.$=re[ne-2];break;case 89:this.$=re[ne-1]+re[ne];break}},"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:e,33:r,35:n,36:21,40:i,41:22,44:a,45:s,47:l,48:u,50:h,52:f,53:d,54:p,55:m,56:g,66:y,67:v,69:x,73:b,74:w,76:S,80:T,95:E,97:_,98:A},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(L,[2,5],{8:[1,46]}),{8:[1,47]},t(M,[2,16],{21:[1,48]}),t(M,[2,18]),t(M,[2,19]),t(M,[2,20]),t(M,[2,21]),t(M,[2,22]),t(M,[2,23]),t(M,[2,24]),t(M,[2,25]),t(M,[2,26]),{32:[1,49]},{34:[1,50]},t(M,[2,29]),t(M,[2,45],{49:51,57:54,58:55,13:[1,52],21:[1,53],59:N,60:k,61:I,62:C,63:O,64:D,65:P}),{37:[1,63]},t(F,[2,36],{37:[1,65],42:[1,64]}),t(M,[2,47]),t(M,[2,48]),{16:66,74:w,80:T,95:E,97:_},{16:37,17:67,18:38,74:w,80:T,95:E,97:_,98:A},{16:37,17:68,18:38,74:w,80:T,95:E,97:_,98:A},{16:37,17:69,18:38,74:w,80:T,95:E,97:_,98:A},{74:[1,70]},{13:[1,71]},{16:37,17:72,18:38,74:w,80:T,95:E,97:_,98:A},{13:B,51:73},t(M,[2,55]),t(M,[2,56]),t(M,[2,57]),t(M,[2,58]),t($,[2,11],{16:37,18:38,17:75,19:[1,76],74:w,80:T,95:E,97:_,98:A}),t($,[2,12],{19:[1,77]}),{15:78,16:79,74:w,80:T,95:E,97:_},{16:37,17:80,18:38,74:w,80:T,95:E,97:_,98:A},t(z,[2,112]),t(z,[2,113]),t(z,[2,114]),t(z,[2,115]),t([1,8,9,12,13,19,21,37,39,42,59,60,61,62,63,64,65,70,72],[2,116]),t(L,[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:e,33:r,35:n,40:i,44:a,45:s,47:l,48:u,50:h,52:f,53:d,54:p,55:m,56:g,66:y,67:v,69:x,73:b,74:w,76:S,80:T,95:E,97:_,98:A}),{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:e,33:r,35:n,36:21,40:i,41:22,44:a,45:s,47:l,48:u,50:h,52:f,53:d,54:p,55:m,56:g,66:y,67:v,69:x,73:b,74:w,76:S,80:T,95:E,97:_,98:A},t(M,[2,17]),t(M,[2,27]),t(M,[2,28]),{13:[1,84],16:37,17:83,18:38,74:w,80:T,95:E,97:_,98:A},{49:85,57:54,58:55,59:N,60:k,61:I,62:C,63:O,64:D,65:P},t(M,[2,46]),{58:86,64:D,65:P},t(Y,[2,62],{57:87,59:N,60:k,61:I,62:C,63:O}),t(Q,[2,63]),t(Q,[2,64]),t(Q,[2,65]),t(Q,[2,66]),t(Q,[2,67]),t(X,[2,68]),t(X,[2,69]),{8:[1,89],23:90,38:88,41:22,44:a},{16:91,74:w,80:T,95:E,97:_},{43:92,47:ie},{46:[1,94]},{13:[1,95]},{13:[1,96]},{70:[1,97],72:[1,98]},{21:j,73:J,74:Z,75:99,77:100,79:101,80:H,81:q,82:K,83:se,84:ce,85:ue},{74:[1,111]},{13:B,51:112},t(M,[2,54]),t(M,[2,117]),t($,[2,13]),t($,[2,14]),t($,[2,15]),{37:[2,32]},{15:113,16:79,37:[2,9],74:w,80:T,95:E,97:_},t(te,[2,40],{11:114,12:[1,115]}),t(L,[2,7]),{9:[1,116]},t(De,[2,49]),{16:37,17:117,18:38,74:w,80:T,95:E,97:_,98:A},{13:[1,119],16:37,17:118,18:38,74:w,80:T,95:E,97:_,98:A},t(Y,[2,61],{57:120,59:N,60:k,61:I,62:C,63:O}),t(Y,[2,60]),{39:[1,121]},{23:90,38:122,41:22,44:a},{8:[1,123],39:[2,33]},t(F,[2,37],{37:[1,124]}),{39:[1,125]},{39:[2,43],43:126,47:ie},{16:37,17:127,18:38,74:w,80:T,95:E,97:_,98:A},t(M,[2,70],{13:[1,128]}),t(M,[2,72],{13:[1,130],68:[1,129]}),t(M,[2,76],{13:[1,131],71:[1,132]}),{13:[1,133]},t(M,[2,84],{78:[1,134]}),t(oe,[2,86],{79:135,21:j,73:J,74:Z,80:H,81:q,82:K,83:se,84:ce,85:ue}),t(ke,[2,88]),t(ke,[2,90]),t(ke,[2,91]),t(ke,[2,92]),t(ke,[2,93]),t(ke,[2,94]),t(ke,[2,95]),t(ke,[2,96]),t(ke,[2,97]),t(ke,[2,98]),t(M,[2,85]),t(M,[2,53]),{37:[2,10]},t(te,[2,41]),{13:[1,136]},{1:[2,4]},t(De,[2,51]),t(De,[2,50]),{16:37,17:137,18:38,74:w,80:T,95:E,97:_,98:A},t(Y,[2,59]),t(M,[2,30]),{39:[1,138]},{23:90,38:139,39:[2,34],41:22,44:a},{43:140,47:ie},t(F,[2,38]),{39:[2,44]},t(M,[2,42]),t(M,[2,71]),t(M,[2,73]),t(M,[2,74],{68:[1,141]}),t(M,[2,77]),t(M,[2,78],{13:[1,142]}),t(M,[2,80],{13:[1,144],68:[1,143]}),{21:j,73:J,74:Z,77:145,79:101,80:H,81:q,82:K,83:se,84:ce,85:ue},t(ke,[2,89]),{14:[1,146]},t(De,[2,52]),t(M,[2,31]),{39:[2,35]},{39:[1,147]},t(M,[2,75]),t(M,[2,79]),t(M,[2,81]),t(M,[2,82],{68:[1,148]}),t(oe,[2,87],{79:135,21:j,73:J,74:Z,80:H,81:q,82:K,83:se,84:ce,85:ue}),t(te,[2,8]),t(F,[2,39]),t(M,[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:o(function(_e,me){if(me.recoverable)this.trace(_e);else{var W=new Error(_e);throw W.hash=me,W}},"parseError"),parse:o(function(_e){var me=this,W=[0],fe=[],ge=[null],re=[],he=this.table,ne="",ae=0,we=0,Te=0,Ce=2,Ae=1,Ge=re.slice.call(arguments,1),Me=Object.create(this.lexer),ye={yy:{}};for(var He in this.yy)Object.prototype.hasOwnProperty.call(this.yy,He)&&(ye.yy[He]=this.yy[He]);Me.setInput(_e,ye.yy),ye.yy.lexer=Me,ye.yy.parser=this,typeof Me.yylloc>"u"&&(Me.yylloc={});var ze=Me.yylloc;re.push(ze);var Ze=Me.options&&Me.options.ranges;typeof ye.yy.parseError=="function"?this.parseError=ye.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function gt(mt){W.length=W.length-2*mt,ge.length=ge.length-mt,re.length=re.length-mt}o(gt,"popStack");function yt(){var mt;return mt=fe.pop()||Me.lex()||Ae,typeof mt!="number"&&(mt instanceof Array&&(fe=mt,mt=fe.pop()),mt=me.symbols_[mt]||mt),mt}o(yt,"lex");for(var tt,Ye,Je,Ve,je,kt,at={},xt,it,dt,lt;;){if(Je=W[W.length-1],this.defaultActions[Je]?Ve=this.defaultActions[Je]:((tt===null||typeof tt>"u")&&(tt=yt()),Ve=he[Je]&&he[Je][tt]),typeof Ve>"u"||!Ve.length||!Ve[0]){var It="";lt=[];for(xt in he[Je])this.terminals_[xt]&&xt>Ce&<.push("'"+this.terminals_[xt]+"'");Me.showPosition?It="Parse error on line "+(ae+1)+`: +`+Me.showPosition()+` +Expecting `+lt.join(", ")+", got '"+(this.terminals_[tt]||tt)+"'":It="Parse error on line "+(ae+1)+": Unexpected "+(tt==Ae?"end of input":"'"+(this.terminals_[tt]||tt)+"'"),this.parseError(It,{text:Me.match,token:this.terminals_[tt]||tt,line:Me.yylineno,loc:ze,expected:lt})}if(Ve[0]instanceof Array&&Ve.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Je+", token: "+tt);switch(Ve[0]){case 1:W.push(tt),ge.push(Me.yytext),re.push(Me.yylloc),W.push(Ve[1]),tt=null,Ye?(tt=Ye,Ye=null):(we=Me.yyleng,ne=Me.yytext,ae=Me.yylineno,ze=Me.yylloc,Te>0&&Te--);break;case 2:if(it=this.productions_[Ve[1]][1],at.$=ge[ge.length-it],at._$={first_line:re[re.length-(it||1)].first_line,last_line:re[re.length-1].last_line,first_column:re[re.length-(it||1)].first_column,last_column:re[re.length-1].last_column},Ze&&(at._$.range=[re[re.length-(it||1)].range[0],re[re.length-1].range[1]]),kt=this.performAction.apply(at,[ne,we,ae,ye.yy,Ve[1],ge,re].concat(Ge)),typeof kt<"u")return kt;it&&(W=W.slice(0,-1*it*2),ge=ge.slice(0,-1*it),re=re.slice(0,-1*it)),W.push(this.productions_[Ve[1]][0]),ge.push(at.$),re.push(at._$),dt=he[W[W.length-2]][W[W.length-1]],W.push(dt);break;case 3:return!0}}return!0},"parse")},Se=function(){var Pe={EOF:1,parseError:o(function(me,W){if(this.yy.parser)this.yy.parser.parseError(me,W);else throw new Error(me)},"parseError"),setInput:o(function(_e,me){return this.yy=me||this.yy||{},this._input=_e,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var _e=this._input[0];this.yytext+=_e,this.yyleng++,this.offset++,this.match+=_e,this.matched+=_e;var me=_e.match(/(?:\r\n?|\n).*/g);return me?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),_e},"input"),unput:o(function(_e){var me=_e.length,W=_e.split(/(?:\r\n?|\n)/g);this._input=_e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-me),this.offset-=me;var fe=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),W.length-1&&(this.yylineno-=W.length-1);var ge=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:W?(W.length===fe.length?this.yylloc.first_column:0)+fe[fe.length-W.length].length-W[0].length:this.yylloc.first_column-me},this.options.ranges&&(this.yylloc.range=[ge[0],ge[0]+this.yyleng-me]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(_e){this.unput(this.match.slice(_e))},"less"),pastInput:o(function(){var _e=this.matched.substr(0,this.matched.length-this.match.length);return(_e.length>20?"...":"")+_e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var _e=this.match;return _e.length<20&&(_e+=this._input.substr(0,20-_e.length)),(_e.substr(0,20)+(_e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var _e=this.pastInput(),me=new Array(_e.length+1).join("-");return _e+this.upcomingInput()+` +`+me+"^"},"showPosition"),test_match:o(function(_e,me){var W,fe,ge;if(this.options.backtrack_lexer&&(ge={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},this.options.ranges&&(ge.yylloc.range=this.yylloc.range.slice(0))),fe=_e[0].match(/(?:\r\n?|\n).*/g),fe&&(this.yylineno+=fe.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:fe?fe[fe.length-1].length-fe[fe.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+_e[0].length},this.yytext+=_e[0],this.match+=_e[0],this.matches=_e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(_e[0].length),this.matched+=_e[0],W=this.performAction.call(this,this.yy,this,me,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),W)return W;if(this._backtrack){for(var re in ge)this[re]=ge[re];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var _e,me,W,fe;this._more||(this.yytext="",this.match="");for(var ge=this._currentRules(),re=0;reme[0].length)){if(me=W,fe=re,this.options.backtrack_lexer){if(_e=this.test_match(W,ge[re]),_e!==!1)return _e;if(this._backtrack){me=!1;continue}else return!1}else if(!this.options.flex)break}return me?(_e=this.test_match(me,ge[fe]),_e!==!1?_e:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var me=this.next();return me||this.lex()},"lex"),begin:o(function(me){this.conditionStack.push(me)},"begin"),popState:o(function(){var me=this.conditionStack.length-1;return me>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(me){return me=this.conditionStack.length-1-Math.abs(me||0),me>=0?this.conditionStack[me]:"INITIAL"},"topState"),pushState:o(function(me){this.begin(me)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:o(function(me,W,fe,ge){var re=ge;switch(fe){case 0:return 53;case 1:return 54;case 2:return 55;case 3:return 56;case 4:break;case 5:break;case 6:return this.begin("acc_title"),31;break;case 7:return this.popState(),"acc_title_value";break;case 8:return this.begin("acc_descr"),33;break;case 9:return this.popState(),"acc_descr_value";break;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:return this.begin("namespace"),40;break;case 29:return this.popState(),8;break;case 30:break;case 31:return this.begin("namespace-body"),37;break;case 32:return this.popState(),39;break;case 33:return"EOF_IN_STRUCT";case 34:return 8;case 35:break;case 36:return"EDGE_STATE";case 37:return this.begin("class"),44;break;case 38:return this.popState(),8;break;case 39:break;case 40:return this.popState(),this.popState(),39;break;case 41:return this.begin("class-body"),37;break;case 42:return this.popState(),39;break;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}},"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:!1},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:!1},"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:!1},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:!1},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:!1},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:!1},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:!1},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:!1},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:!1},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:!1},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:!1},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:!1},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:!1},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:!1},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:!0}}};return Pe}();Ie.lexer=Se;function Ue(){this.yy={}}return o(Ue,"Parser"),Ue.prototype=Ie,Ie.Parser=Ue,new Ue}();wO.parser=wO;wE=wO});var bhe,wx,whe=R(()=>{"use strict";_t();rr();bhe=["#","+","~","-",""],wx=class{static{o(this,"ClassMember")}constructor(e,r){this.memberType=r,this.visibility="",this.classifier="";let n=qr(e,de());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+gh(this.id);this.memberType==="method"&&(e+=`(${gh(this.parameters.trim())})`,this.returnType&&(e+=" : "+gh(this.returnType))),e=e.trim();let r=this.parseClassifier();return{displayText:e,cssStyle:r}}parseMember(e){let r="";if(this.memberType==="method"){let i=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(i){let a=i[1]?i[1].trim():"";if(bhe.includes(a)&&(this.visibility=a),this.id=i[2].trim(),this.parameters=i[3]?i[3].trim():"",r=i[4]?i[4].trim():"",this.returnType=i[5]?i[5].trim():"",r===""){let s=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(s)&&(r=s,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{let n=e.length,i=e.substring(0,1),a=e.substring(n-1);bhe.includes(i)&&(this.visibility=i),/[$*]/.exec(a)&&(r=a),this.id=e.substring(this.visibility===""?0:1,r===""?n:n-1)}this.classifier=r}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}}});var EE,EO,Gi,TE,The,qu,kO,Tx,D0,R0,u$e,kE,khe,h$e,f$e,d$e,p$e,m$e,g$e,y$e,Ehe,v$e,x$e,b$e,CO,w$e,T$e,k$e,E$e,C$e,S$e,A$e,_$e,Che,SO,L$e,D$e,R$e,N$e,M$e,I$e,O$e,Bg,AO=R(()=>{"use strict";Zt();ut();_t();rr();xr();bi();whe();EE="classId-",EO=[],Gi=new Map,TE=[],The=0,qu=new Map,kO=0,Tx=[],D0=o(t=>We.sanitizeText(t,de()),"sanitizeText"),R0=o(function(t){let e=We.sanitizeText(t,de()),r="",n=e;if(e.indexOf("~")>0){let i=e.split("~");n=D0(i[0]),r=D0(i[1])}return{className:n,type:r}},"splitClassNameAndType"),u$e=o(function(t,e){let r=We.sanitizeText(t,de());e&&(e=D0(e));let{className:n}=R0(r);Gi.get(n).label=e},"setClassLabel"),kE=o(function(t){let e=We.sanitizeText(t,de()),{className:r,type:n}=R0(e);if(Gi.has(r))return;let i=We.sanitizeText(r,de());Gi.set(i,{id:i,type:n,label:i,cssClasses:[],methods:[],members:[],annotations:[],styles:[],domId:EE+i+"-"+The}),The++},"addClass"),khe=o(function(t){let e=We.sanitizeText(t,de());if(Gi.has(e))return Gi.get(e).domId;throw new Error("Class not found: "+e)},"lookUpDomId"),h$e=o(function(){EO=[],Gi=new Map,TE=[],Tx=[],Tx.push(Che),qu=new Map,kO=0,SO="TB",vr()},"clear"),f$e=o(function(t){return Gi.get(t)},"getClass"),d$e=o(function(){return Gi},"getClasses"),p$e=o(function(){return EO},"getRelations"),m$e=o(function(){return TE},"getNotes"),g$e=o(function(t){V.debug("Adding relation: "+JSON.stringify(t)),kE(t.id1),kE(t.id2),t.id1=R0(t.id1).className,t.id2=R0(t.id2).className,t.relationTitle1=We.sanitizeText(t.relationTitle1.trim(),de()),t.relationTitle2=We.sanitizeText(t.relationTitle2.trim(),de()),EO.push(t)},"addRelation"),y$e=o(function(t,e){let r=R0(t).className;Gi.get(r).annotations.push(e)},"addAnnotation"),Ehe=o(function(t,e){kE(t);let r=R0(t).className,n=Gi.get(r);if(typeof e=="string"){let i=e.trim();i.startsWith("<<")&&i.endsWith(">>")?n.annotations.push(D0(i.substring(2,i.length-2))):i.indexOf(")")>0?n.methods.push(new wx(i,"method")):i&&n.members.push(new wx(i,"attribute"))}},"addMember"),v$e=o(function(t,e){Array.isArray(e)&&(e.reverse(),e.forEach(r=>Ehe(t,r)))},"addMembers"),x$e=o(function(t,e){let r={id:`note${TE.length}`,class:e,text:t};TE.push(r)},"addNote"),b$e=o(function(t){return t.startsWith(":")&&(t=t.substring(1)),D0(t.trim())},"cleanupLabel"),CO=o(function(t,e){t.split(",").forEach(function(r){let n=r;/\d/.exec(r[0])&&(n=EE+n);let i=Gi.get(n);i&&i.cssClasses.push(e)})},"setCssClass"),w$e=o(function(t,e){t.split(",").forEach(function(r){e!==void 0&&(Gi.get(r).tooltip=D0(e))})},"setTooltip"),T$e=o(function(t,e){return e&&qu.has(e)?qu.get(e).classes.get(t).tooltip:Gi.get(t).tooltip},"getTooltip"),k$e=o(function(t,e,r){let n=de();t.split(",").forEach(function(i){let a=i;/\d/.exec(i[0])&&(a=EE+a);let s=Gi.get(a);s&&(s.link=Lt.formatUrl(e,n),n.securityLevel==="sandbox"?s.linkTarget="_top":typeof r=="string"?s.linkTarget=D0(r):s.linkTarget="_blank")}),CO(t,"clickable")},"setLink"),E$e=o(function(t,e,r){t.split(",").forEach(function(n){C$e(n,e,r),Gi.get(n).haveCallback=!0}),CO(t,"clickable")},"setClickEvent"),C$e=o(function(t,e,r){let n=We.sanitizeText(t,de());if(de().securityLevel!=="loose"||e===void 0)return;let a=n;if(Gi.has(a)){let s=khe(a),l=[];if(typeof r=="string"){l=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let u=0;u")),i.classed("hover",!0)}).on("mouseout",function(){e.transition().duration(500).style("opacity",0),$e(this).classed("hover",!1)})},"setupToolTips");Tx.push(Che);SO="TB",L$e=o(()=>SO,"getDirection"),D$e=o(t=>{SO=t},"setDirection"),R$e=o(function(t){qu.has(t)||(qu.set(t,{id:t,classes:new Map,children:{},domId:EE+t+"-"+kO}),kO++)},"addNamespace"),N$e=o(function(t){return qu.get(t)},"getNamespace"),M$e=o(function(){return qu},"getNamespaces"),I$e=o(function(t,e){if(qu.has(t))for(let r of e){let{className:n}=R0(r);Gi.get(n).parent=t,qu.get(t).classes.set(n,Gi.get(n))}},"addClassesToNamespace"),O$e=o(function(t,e){let r=Gi.get(t);if(!(!e||!r))for(let n of e)n.includes(",")?r.styles.push(...n.split(",")):r.styles.push(n)},"setCssStyle"),Bg={setAccTitle:kr,getAccTitle:Ar,getAccDescription:Lr,setAccDescription:_r,getConfig:o(()=>de().class,"getConfig"),addClass:kE,bindFunctions:S$e,clear:h$e,getClass:f$e,getClasses:d$e,getNotes:m$e,addAnnotation:y$e,addNote:x$e,getRelations:p$e,addRelation:g$e,getDirection:L$e,setDirection:D$e,addMember:Ehe,addMembers:v$e,cleanupLabel:b$e,lineType:A$e,relationType:_$e,setClickEvent:E$e,setCssClass:CO,setLink:k$e,getTooltip:T$e,setTooltip:w$e,lookUpDomId:khe,setDiagramTitle:nn,getDiagramTitle:Xr,setClassLabel:u$e,addNamespace:R$e,addClassesToNamespace:I$e,getNamespace:N$e,getNamespaces:M$e,setCssStyle:O$e}});var P$e,CE,_O=R(()=>{"use strict";P$e=o(t=>`g.classGroup text { + fill: ${t.nodeBorder||t.classText}; stroke: none; - font-family: ${i.fontFamily}; + font-family: ${t.fontFamily}; font-size: 10px; .title { @@ -825,16 +1259,16 @@ Expecting `+Vn.join(", ")+", got '"+(this.terminals_[Js]||Js)+"'":qi="Parse erro } .nodeLabel, .edgeLabel { - color: ${i.classText}; + color: ${t.classText}; } .edgeLabel .label rect { - fill: ${i.mainBkg}; + fill: ${t.mainBkg}; } .label text { - fill: ${i.classText}; + fill: ${t.classText}; } .edgeLabel .label span { - background: ${i.mainBkg}; + background: ${t.mainBkg}; } .classTitle { @@ -845,14 +1279,14 @@ Expecting `+Vn.join(", ")+", got '"+(this.terminals_[Js]||Js)+"'":qi="Parse erro .node ellipse, .node polygon, .node path { - fill: ${i.mainBkg}; - stroke: ${i.nodeBorder}; + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; stroke-width: 1px; } .divider { - stroke: ${i.nodeBorder}; + stroke: ${t.nodeBorder}; stroke-width: 1; } @@ -861,29 +1295,29 @@ g.clickable { } g.classGroup rect { - fill: ${i.mainBkg}; - stroke: ${i.nodeBorder}; + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; } g.classGroup line { - stroke: ${i.nodeBorder}; + stroke: ${t.nodeBorder}; stroke-width: 1; } .classLabel .box { stroke: none; stroke-width: 0; - fill: ${i.mainBkg}; + fill: ${t.mainBkg}; opacity: 0.5; } .classLabel .label { - fill: ${i.nodeBorder}; + fill: ${t.nodeBorder}; font-size: 10px; } .relation { - stroke: ${i.lineColor}; + stroke: ${t.lineColor}; stroke-width: 1; fill: none; } @@ -897,119 +1331,124 @@ g.classGroup line { } #compositionStart, .composition { - fill: ${i.lineColor} !important; - stroke: ${i.lineColor} !important; + fill: ${t.lineColor} !important; + stroke: ${t.lineColor} !important; stroke-width: 1; } #compositionEnd, .composition { - fill: ${i.lineColor} !important; - stroke: ${i.lineColor} !important; + fill: ${t.lineColor} !important; + stroke: ${t.lineColor} !important; stroke-width: 1; } #dependencyStart, .dependency { - fill: ${i.lineColor} !important; - stroke: ${i.lineColor} !important; + fill: ${t.lineColor} !important; + stroke: ${t.lineColor} !important; stroke-width: 1; } #dependencyStart, .dependency { - fill: ${i.lineColor} !important; - stroke: ${i.lineColor} !important; + fill: ${t.lineColor} !important; + stroke: ${t.lineColor} !important; stroke-width: 1; } #extensionStart, .extension { - fill: ${i.mainBkg} !important; - stroke: ${i.lineColor} !important; + fill: transparent !important; + stroke: ${t.lineColor} !important; stroke-width: 1; } #extensionEnd, .extension { - fill: ${i.mainBkg} !important; - stroke: ${i.lineColor} !important; + fill: transparent !important; + stroke: ${t.lineColor} !important; stroke-width: 1; } #aggregationStart, .aggregation { - fill: ${i.mainBkg} !important; - stroke: ${i.lineColor} !important; + fill: transparent !important; + stroke: ${t.lineColor} !important; stroke-width: 1; } #aggregationEnd, .aggregation { - fill: ${i.mainBkg} !important; - stroke: ${i.lineColor} !important; + fill: transparent !important; + stroke: ${t.lineColor} !important; stroke-width: 1; } #lollipopStart, .lollipop { - fill: ${i.mainBkg} !important; - stroke: ${i.lineColor} !important; + fill: ${t.mainBkg} !important; + stroke: ${t.lineColor} !important; stroke-width: 1; } #lollipopEnd, .lollipop { - fill: ${i.mainBkg} !important; - stroke: ${i.lineColor} !important; + fill: ${t.mainBkg} !important; + stroke: ${t.lineColor} !important; stroke-width: 1; } .edgeTerminals { font-size: 11px; + line-height: initial; } .classTitleText { text-anchor: middle; font-size: 18px; - fill: ${i.textColor}; -} -`;let PK={};const BK=20,OP=function(i){const a=Object.entries(PK).find(f=>f[1].label===i);if(a)return a[0]},ozt=function(i){i.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"),i.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"),i.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"),i.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"),i.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"),i.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"),i.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"),i.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")},czt=Object.freeze(Object.defineProperty({__proto__:null,diagram:{parser:XRe,db:NK,renderer:{draw:function(i,a,f,p){const w=Tt().class;PK={},Fe.info("Rendering diagram "+i);const y=Tt().securityLevel;let b;y==="sandbox"&&(b=Cr("#i"+a));const E=Cr(y==="sandbox"?b.nodes()[0].contentDocument.body:"body"),S=E.select(`[id='${a}']`);ozt(S);const N=new zf({multigraph:!0});N.setGraph({isMultiGraph:!0}),N.setDefaultEdgeLabel(function(){return{}});const B=p.db.getClasses(),R=Object.keys(B);for(const se of R){const ge=B[se],ye=_0e.drawClass(S,ge,w,p);PK[ye.id]=ye,N.setNode(ye.id,ye),Fe.info("Org height: "+ye.height)}p.db.getRelations().forEach(function(se){Fe.info("tjoho"+OP(se.id1)+OP(se.id2)+JSON.stringify(se)),N.setEdge(OP(se.id1),OP(se.id2),{relation:se},se.title||"DEFAULT")}),p.db.getNotes().forEach(function(se){Fe.debug(`Adding note: ${JSON.stringify(se)}`);const ge=_0e.drawNote(S,se,w,p);PK[ge.id]=ge,N.setNode(ge.id,ge),se.class&&se.class in B&&N.setEdge(se.id,OP(se.class),{relation:{id1:se.id,id2:se.class,relation:{type1:"none",type2:"none",lineType:10}}},"DEFAULT")}),tL(N),N.nodes().forEach(function(se){se!==void 0&&N.node(se)!==void 0&&(Fe.debug("Node "+se+": "+JSON.stringify(N.node(se))),E.select("#"+(p.db.lookUpDomId(se)||se)).attr("transform","translate("+(N.node(se).x-N.node(se).width/2)+","+(N.node(se).y-N.node(se).height/2)+" )"))}),N.edges().forEach(function(se){se!==void 0&&N.edge(se)!==void 0&&(Fe.debug("Edge "+se.v+" -> "+se.w+": "+JSON.stringify(N.edge(se))),_0e.drawEdge(S,N.edge(se),N.edge(se).relation,w,p))});const V=S.node().getBBox(),Q=V.width+BK*2,oe=V.height+BK*2;Vw(S,oe,Q,w.useMaxWidth);const ce=`${V.x-BK} ${V.y-BK} ${Q} ${oe}`;Fe.debug(`viewBox ${ce}`),S.attr("viewBox",ce)}},styles:nFe,init:i=>{i.class||(i.class={}),i.class.arrowMarkerAbsolute=i.arrowMarkerAbsolute,NK.clear()}}},Symbol.toStringTag,{value:"Module"})),rFe=i=>Wa.sanitizeText(i,Tt());let fge={dividerMargin:10,padding:5,textHeight:10,curve:void 0};const uzt=function(i,a,f,p){const w=Object.keys(i);Fe.info("keys:",w),Fe.info(i),w.forEach(function(y){var $,V;const b=i[y];let E="";b.cssClasses.length>0&&(E=E+" "+b.cssClasses.join(" "));const S={labelStyle:"",style:""},N=b.label??b.id,B=0,R="class_box",j={labelStyle:S.labelStyle,shape:R,labelText:rFe(N),classData:b,rx:B,ry:B,class:E,style:S.style,id:b.id,domId:b.domId,tooltip:p.db.getTooltip(b.id)||"",haveCallback:b.haveCallback,link:b.link,width:b.type==="group"?500:void 0,type:b.type,padding:(($=Tt().flowchart)==null?void 0:$.padding)??((V=Tt().class)==null?void 0:V.padding)};a.setNode(b.id,j),Fe.info("setNode",j)})},lzt=function(i,a,f,p){Fe.info(i),i.forEach(function(w,y){var Q,oe;const b=w,E="",S={labelStyle:"",style:""},N=b.text,B=0,R="note",j={labelStyle:S.labelStyle,shape:R,labelText:rFe(N),noteData:b,rx:B,ry:B,class:E,style:S.style,id:b.id,domId:b.id,tooltip:"",type:"note",padding:((Q=Tt().flowchart)==null?void 0:Q.padding)??((oe=Tt().class)==null?void 0:oe.padding)};if(a.setNode(b.id,j),Fe.info("setNode",j),!b.class||!(b.class in p))return;const $=f+y,V={id:`edgeNote${$}`,classes:"relation",pattern:"dotted",arrowhead:"none",startLabelRight:"",endLabelLeft:"",arrowTypeStart:"none",arrowTypeEnd:"none",style:"fill:none",labelStyle:"",curve:Ub(fge.curve,ng)};a.setEdge(b.id,b.class,V,$)})},hzt=function(i,a){const f=Tt().flowchart;let p=0;i.forEach(function(w){var b;p++;const y={classes:"relation",pattern:w.relation.lineType==1?"dashed":"solid",id:"id"+p,arrowhead:w.type==="arrow_open"?"none":"normal",startLabelRight:w.relationTitle1==="none"?"":w.relationTitle1,endLabelLeft:w.relationTitle2==="none"?"":w.relationTitle2,arrowTypeStart:iFe(w.relation.type1),arrowTypeEnd:iFe(w.relation.type2),style:"fill:none",labelStyle:"",curve:Ub(f==null?void 0:f.curve,ng)};if(Fe.info(y,w),w.style!==void 0){const E=Yw(w.style);y.style=E.style,y.labelStyle=E.labelStyle}w.text=w.title,w.text===void 0?w.style!==void 0&&(y.arrowheadStyle="fill: #333"):(y.arrowheadStyle="fill: #333",y.labelpos="c",((b=Tt().flowchart)==null?void 0:b.htmlLabels)??Tt().htmlLabels?(y.labelType="html",y.label=''+w.text+""):(y.labelType="text",y.label=w.text.replace(Wa.lineBreakRegex,` -`),w.style===void 0&&(y.style=y.style||"stroke: #333; stroke-width: 1.5px;fill:none"),y.labelStyle=y.labelStyle.replace("color:","fill:"))),a.setEdge(w.id1,w.id2,y,p)})},fzt=function(i){fge={...fge,...i}},dzt=async function(i,a,f,p){Fe.info("Drawing class - ",a);const w=Tt().flowchart??Tt().class,y=Tt().securityLevel;Fe.info("config:",w);const b=(w==null?void 0:w.nodeSpacing)??50,E=(w==null?void 0:w.rankSpacing)??50,S=new zf({multigraph:!0,compound:!0}).setGraph({rankdir:p.db.getDirection(),nodesep:b,ranksep:E,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),N=p.db.getClasses(),B=p.db.getRelations(),R=p.db.getNotes();Fe.info(B),uzt(N,S,a,p),hzt(B,S),lzt(R,S,B.length+1,N);let j;y==="sandbox"&&(j=Cr("#i"+a));const $=Cr(y==="sandbox"?j.nodes()[0].contentDocument.body:"body"),V=$.select(`[id="${a}"]`),Q=$.select("#"+a+" g");if(await C0e(Q,S,["aggregation","extension","composition","dependency","lollipop"],"classDiagram",a),co.insertTitle(V,"classTitleText",(w==null?void 0:w.titleTopMargin)??5,p.db.getDiagramTitle()),YE(S,V,w==null?void 0:w.diagramPadding,w==null?void 0:w.useMaxWidth),!(w!=null&&w.htmlLabels)){const oe=y==="sandbox"?j.nodes()[0].contentDocument:document,ce=oe.querySelectorAll('[id="'+a+'"] .edgeLabel .label');for(const se of ce){const ge=se.getBBox(),ye=oe.createElementNS("http://www.w3.org/2000/svg","rect");ye.setAttribute("rx",0),ye.setAttribute("ry",0),ye.setAttribute("width",ge.width),ye.setAttribute("height",ge.height),se.insertBefore(ye,se.firstChild)}}};function iFe(i){let a;switch(i){case 0:a="aggregation";break;case 1:a="extension";break;case 2:a="composition";break;case 3:a="dependency";break;case 4:a="lollipop";break;default:a="none"}return a}const gzt=Object.freeze(Object.defineProperty({__proto__:null,diagram:{parser:XRe,db:NK,renderer:{setConf:fzt,draw:dzt},styles:nFe,init:i=>{i.class||(i.class={}),i.class.arrowMarkerAbsolute=i.arrowMarkerAbsolute,NK.clear()}}},Symbol.toStringTag,{value:"Module"}));var dge=function(){var i=function(wt,jt,At,Bt){for(At=At||{},Bt=wt.length;Bt--;At[wt[Bt]]=jt);return At},a=[1,2],f=[1,3],p=[1,5],w=[1,7],y=[2,5],b=[1,15],E=[1,17],S=[1,21],N=[1,22],B=[1,23],R=[1,24],j=[1,37],$=[1,25],V=[1,26],Q=[1,27],oe=[1,28],ce=[1,29],se=[1,32],ge=[1,33],ye=[1,34],ke=[1,35],Ae=[1,36],de=[1,39],ve=[1,40],te=[1,41],xe=[1,42],De=[1,38],he=[1,45],Ie=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,50,51,52,53,56,60],ee=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,50,51,52,53,56,60],rt=[1,4,5,7,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,50,51,52,53,56,60],me=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,50,51,52,53,56,60],gt={trace:function(){},yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,directive:6,SD:7,document:8,line:9,statement:10,classDefStatement: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,class:42,CLASSENTITY_IDS:43,STYLECLASS:44,openDirective:45,typeDirective:46,closeDirective:47,":":48,argDirective:49,direction_tb:50,direction_bt:51,direction_rl:52,direction_lr:53,eol:54,";":55,EDGE_STATE:56,STYLE_SEPARATOR:57,left_of:58,right_of:59,open_directive:60,type_directive:61,arg_directive:62,close_directive:63,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",7:"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:"class",43:"CLASSENTITY_IDS",44:"STYLECLASS",48:":",50:"direction_tb",51:"direction_bt",52:"direction_rl",53:"direction_lr",55:";",56:"EDGE_STATE",57:"STYLE_SEPARATOR",58:"left_of",59:"right_of",60:"open_directive",61:"type_directive",62:"arg_directive",63:"close_directive"},productions_:[0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[10,1],[10,1],[10,1],[10,2],[10,3],[10,4],[10,1],[10,2],[10,1],[10,4],[10,3],[10,6],[10,1],[10,1],[10,1],[10,1],[10,4],[10,4],[10,1],[10,1],[10,2],[10,2],[10,1],[11,3],[11,3],[12,3],[6,3],[6,5],[32,1],[32,1],[32,1],[32,1],[54,1],[54,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1],[45,1],[46,1],[49,1],[47,1]],performAction:function(jt,At,Bt,cn,Nn,Ot,oi){var kt=Ot.length-1;switch(Nn){case 4:return cn.setRootDoc(Ot[kt]),Ot[kt];case 5:this.$=[];break;case 6:Ot[kt]!="nl"&&(Ot[kt-1].push(Ot[kt]),this.$=Ot[kt-1]);break;case 7:case 8:this.$=Ot[kt];break;case 9:this.$="nl";break;case 12:this.$=Ot[kt];break;case 13:const ze=Ot[kt-1];ze.description=cn.trimColon(Ot[kt]),this.$=ze;break;case 14:this.$={stmt:"relation",state1:Ot[kt-2],state2:Ot[kt]};break;case 15:const Xe=cn.trimColon(Ot[kt]);this.$={stmt:"relation",state1:Ot[kt-3],state2:Ot[kt-1],description:Xe};break;case 19:this.$={stmt:"state",id:Ot[kt-3],type:"default",description:"",doc:Ot[kt-1]};break;case 20:var Dt=Ot[kt],vt=Ot[kt-2].trim();if(Ot[kt].match(":")){var Nt=Ot[kt].split(":");Dt=Nt[0],vt=[vt,Nt[1]]}this.$={stmt:"state",id:Dt,type:"default",description:vt};break;case 21:this.$={stmt:"state",id:Ot[kt-3],type:"default",description:Ot[kt-5],doc:Ot[kt-1]};break;case 22:this.$={stmt:"state",id:Ot[kt],type:"fork"};break;case 23:this.$={stmt:"state",id:Ot[kt],type:"join"};break;case 24:this.$={stmt:"state",id:Ot[kt],type:"choice"};break;case 25:this.$={stmt:"state",id:cn.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:Ot[kt-1].trim(),note:{position:Ot[kt-2].trim(),text:Ot[kt].trim()}};break;case 30:this.$=Ot[kt].trim(),cn.setAccTitle(this.$);break;case 31:case 32:this.$=Ot[kt].trim(),cn.setAccDescription(this.$);break;case 33:case 34:this.$={stmt:"classDef",id:Ot[kt-1].trim(),classes:Ot[kt].trim()};break;case 35:this.$={stmt:"applyClass",id:Ot[kt-1].trim(),styleClass:Ot[kt].trim()};break;case 38:cn.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:cn.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:cn.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:cn.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:Ot[kt].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:Ot[kt-2].trim(),classes:[Ot[kt].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:Ot[kt-2].trim(),classes:[Ot[kt].trim()],type:"default",description:""};break;case 50:cn.parseDirective("%%{","open_directive");break;case 51:cn.parseDirective(Ot[kt],"type_directive");break;case 52:Ot[kt]=Ot[kt].trim().replace(/'/g,'"'),cn.parseDirective(Ot[kt],"arg_directive");break;case 53:cn.parseDirective("}%%","close_directive","state");break}},table:[{3:1,4:a,5:f,6:4,7:p,45:6,60:w},{1:[3]},{3:8,4:a,5:f,6:4,7:p,45:6,60:w},{3:9,4:a,5:f,6:4,7:p,45:6,60:w},{3:10,4:a,5:f,6:4,7:p,45:6,60:w},i([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,42,50,51,52,53,56,60],y,{8:11}),{46:12,61:[1,13]},{61:[2,50]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:b,5:E,6:30,9:14,10:16,11:18,12:19,13:20,16:S,17:N,19:B,22:R,24:j,25:$,26:V,27:Q,28:oe,29:ce,32:31,33:se,35:ge,37:ye,38:ke,42:Ae,45:6,50:de,51:ve,52:te,53:xe,56:De,60:w},{47:43,48:[1,44],63:he},i([48,63],[2,51]),i(Ie,[2,6]),{6:30,10:46,11:18,12:19,13:20,16:S,17:N,19:B,22:R,24:j,25:$,26:V,27:Q,28:oe,29:ce,32:31,33:se,35:ge,37:ye,38:ke,42:Ae,45:6,50:de,51:ve,52:te,53:xe,56:De,60:w},i(Ie,[2,8]),i(Ie,[2,9]),i(Ie,[2,10]),i(Ie,[2,11]),i(Ie,[2,12],{14:[1,47],15:[1,48]}),i(Ie,[2,16]),{18:[1,49]},i(Ie,[2,18],{20:[1,50]}),{23:[1,51]},i(Ie,[2,22]),i(Ie,[2,23]),i(Ie,[2,24]),i(Ie,[2,25]),{30:52,31:[1,53],58:[1,54],59:[1,55]},i(Ie,[2,28]),i(Ie,[2,29]),{34:[1,56]},{36:[1,57]},i(Ie,[2,32]),{39:[1,58],41:[1,59]},{43:[1,60]},i(ee,[2,44],{57:[1,61]}),i(ee,[2,45],{57:[1,62]}),i(Ie,[2,38]),i(Ie,[2,39]),i(Ie,[2,40]),i(Ie,[2,41]),i(rt,[2,36]),{49:63,62:[1,64]},i(rt,[2,53]),i(Ie,[2,7]),i(Ie,[2,13]),{13:65,24:j,56:De},i(Ie,[2,17]),i(me,y,{8:66}),{24:[1,67]},{24:[1,68]},{23:[1,69]},{24:[2,48]},{24:[2,49]},i(Ie,[2,30]),i(Ie,[2,31]),{40:[1,70]},{40:[1,71]},{44:[1,72]},{24:[1,73]},{24:[1,74]},{47:75,63:he},{63:[2,52]},i(Ie,[2,14],{14:[1,76]}),{4:b,5:E,6:30,9:14,10:16,11:18,12:19,13:20,16:S,17:N,19:B,21:[1,77],22:R,24:j,25:$,26:V,27:Q,28:oe,29:ce,32:31,33:se,35:ge,37:ye,38:ke,42:Ae,45:6,50:de,51:ve,52:te,53:xe,56:De,60:w},i(Ie,[2,20],{20:[1,78]}),{31:[1,79]},{24:[1,80]},i(Ie,[2,33]),i(Ie,[2,34]),i(Ie,[2,35]),i(ee,[2,46]),i(ee,[2,47]),i(rt,[2,37]),i(Ie,[2,15]),i(Ie,[2,19]),i(me,y,{8:81}),i(Ie,[2,26]),i(Ie,[2,27]),{4:b,5:E,6:30,9:14,10:16,11:18,12:19,13:20,16:S,17:N,19:B,21:[1,82],22:R,24:j,25:$,26:V,27:Q,28:oe,29:ce,32:31,33:se,35:ge,37:ye,38:ke,42:Ae,45:6,50:de,51:ve,52:te,53:xe,56:De,60:w},i(Ie,[2,21])],defaultActions:{7:[2,50],8:[2,1],9:[2,2],10:[2,3],54:[2,48],55:[2,49],64:[2,52]},parseError:function(jt,At){if(At.recoverable)this.trace(jt);else{var Bt=new Error(jt);throw Bt.hash=At,Bt}},parse:function(jt){var At=this,Bt=[0],cn=[],Nn=[null],Ot=[],oi=this.table,kt="",Dt=0,vt=0,Nt=2,ze=1,Xe=Ot.slice.call(arguments,1),Lt=Object.create(this.lexer),Ge={yy:{}};for(var Bn in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Bn)&&(Ge.yy[Bn]=this.yy[Bn]);Lt.setInput(jt,Ge.yy),Ge.yy.lexer=Lt,Ge.yy.parser=this,typeof Lt.yylloc>"u"&&(Lt.yylloc={});var Oe=Lt.yylloc;Ot.push(Oe);var Ri=Lt.options&&Lt.options.ranges;typeof Ge.yy.parseError=="function"?this.parseError=Ge.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tn(){var Hi;return Hi=cn.pop()||Lt.lex()||ze,typeof Hi!="number"&&(Hi instanceof Array&&(cn=Hi,Hi=cn.pop()),Hi=At.symbols_[Hi]||Hi),Hi}for(var hi,Sr,Zn,Xn,ir={},Hn,tr,ha,Zs;;){if(Sr=Bt[Bt.length-1],this.defaultActions[Sr]?Zn=this.defaultActions[Sr]:((hi===null||typeof hi>"u")&&(hi=tn()),Zn=oi[Sr]&&oi[Sr][hi]),typeof Zn>"u"||!Zn.length||!Zn[0]){var ns="";Zs=[];for(Hn in oi[Sr])this.terminals_[Hn]&&Hn>Nt&&Zs.push("'"+this.terminals_[Hn]+"'");Lt.showPosition?ns="Parse error on line "+(Dt+1)+`: -`+Lt.showPosition()+` -Expecting `+Zs.join(", ")+", got '"+(this.terminals_[hi]||hi)+"'":ns="Parse error on line "+(Dt+1)+": Unexpected "+(hi==ze?"end of input":"'"+(this.terminals_[hi]||hi)+"'"),this.parseError(ns,{text:Lt.match,token:this.terminals_[hi]||hi,line:Lt.yylineno,loc:Oe,expected:Zs})}if(Zn[0]instanceof Array&&Zn.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Sr+", token: "+hi);switch(Zn[0]){case 1:Bt.push(hi),Nn.push(Lt.yytext),Ot.push(Lt.yylloc),Bt.push(Zn[1]),hi=null,vt=Lt.yyleng,kt=Lt.yytext,Dt=Lt.yylineno,Oe=Lt.yylloc;break;case 2:if(tr=this.productions_[Zn[1]][1],ir.$=Nn[Nn.length-tr],ir._$={first_line:Ot[Ot.length-(tr||1)].first_line,last_line:Ot[Ot.length-1].last_line,first_column:Ot[Ot.length-(tr||1)].first_column,last_column:Ot[Ot.length-1].last_column},Ri&&(ir._$.range=[Ot[Ot.length-(tr||1)].range[0],Ot[Ot.length-1].range[1]]),Xn=this.performAction.apply(ir,[kt,vt,Dt,Ge.yy,Zn[1],Nn,Ot].concat(Xe)),typeof Xn<"u")return Xn;tr&&(Bt=Bt.slice(0,-1*tr*2),Nn=Nn.slice(0,-1*tr),Ot=Ot.slice(0,-1*tr)),Bt.push(this.productions_[Zn[1]][0]),Nn.push(ir.$),Ot.push(ir._$),ha=oi[Bt[Bt.length-2]][Bt[Bt.length-1]],Bt.push(ha);break;case 3:return!0}}return!0}},pe=function(){var wt={EOF:1,parseError:function(At,Bt){if(this.yy.parser)this.yy.parser.parseError(At,Bt);else throw new Error(At)},setInput:function(jt,At){return this.yy=At||this.yy||{},this._input=jt,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var jt=this._input[0];this.yytext+=jt,this.yyleng++,this.offset++,this.match+=jt,this.matched+=jt;var At=jt.match(/(?:\r\n?|\n).*/g);return At?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),jt},unput:function(jt){var At=jt.length,Bt=jt.split(/(?:\r\n?|\n)/g);this._input=jt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-At),this.offset-=At;var cn=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),Bt.length-1&&(this.yylineno-=Bt.length-1);var Nn=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Bt?(Bt.length===cn.length?this.yylloc.first_column:0)+cn[cn.length-Bt.length].length-Bt[0].length:this.yylloc.first_column-At},this.options.ranges&&(this.yylloc.range=[Nn[0],Nn[0]+this.yyleng-At]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(jt){this.unput(this.match.slice(jt))},pastInput:function(){var jt=this.matched.substr(0,this.matched.length-this.match.length);return(jt.length>20?"...":"")+jt.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var jt=this.match;return jt.length<20&&(jt+=this._input.substr(0,20-jt.length)),(jt.substr(0,20)+(jt.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var jt=this.pastInput(),At=new Array(jt.length+1).join("-");return jt+this.upcomingInput()+` -`+At+"^"},test_match:function(jt,At){var Bt,cn,Nn;if(this.options.backtrack_lexer&&(Nn={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},this.options.ranges&&(Nn.yylloc.range=this.yylloc.range.slice(0))),cn=jt[0].match(/(?:\r\n?|\n).*/g),cn&&(this.yylineno+=cn.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:cn?cn[cn.length-1].length-cn[cn.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+jt[0].length},this.yytext+=jt[0],this.match+=jt[0],this.matches=jt,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(jt[0].length),this.matched+=jt[0],Bt=this.performAction.call(this,this.yy,this,At,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Bt)return Bt;if(this._backtrack){for(var Ot in Nn)this[Ot]=Nn[Ot];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var jt,At,Bt,cn;this._more||(this.yytext="",this.match="");for(var Nn=this._currentRules(),Ot=0;OtAt[0].length)){if(At=Bt,cn=Ot,this.options.backtrack_lexer){if(jt=this.test_match(Bt,Nn[Ot]),jt!==!1)return jt;if(this._backtrack){At=!1;continue}else return!1}else if(!this.options.flex)break}return At?(jt=this.test_match(At,Nn[cn]),jt!==!1?jt:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var At=this.next();return At||this.lex()},begin:function(At){this.conditionStack.push(At)},popState:function(){var At=this.conditionStack.length-1;return At>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(At){return At=this.conditionStack.length-1-Math.abs(At||0),At>=0?this.conditionStack[At]:"INITIAL"},pushState:function(At){this.begin(At)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(At,Bt,cn,Nn){switch(cn){case 0:return 41;case 1:return 50;case 2:return 51;case 3:return 52;case 4:return 53;case 5:return this.begin("open_directive"),60;case 6:return this.begin("type_directive"),61;case 7:return this.popState(),this.begin("arg_directive"),48;case 8:return this.popState(),this.popState(),63;case 9:return 62;case 10:break;case 11:break;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:break;case 17:return this.pushState("SCALE"),17;case 18:return 18;case 19:this.popState();break;case 20:return this.begin("acc_title"),33;case 21:return this.popState(),"acc_title_value";case 22:return this.begin("acc_descr"),35;case 23:return this.popState(),"acc_descr_value";case 24:this.begin("acc_descr_multiline");break;case 25:this.popState();break;case 26:return"acc_descr_multiline_value";case 27:return this.pushState("CLASSDEF"),38;case 28:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 29:return this.popState(),this.pushState("CLASSDEFID"),39;case 30:return this.popState(),40;case 31:return this.pushState("CLASS"),42;case 32:return this.popState(),this.pushState("CLASS_STYLE"),43;case 33:return this.popState(),44;case 34:return this.pushState("SCALE"),17;case 35:return 18;case 36:this.popState();break;case 37:this.pushState("STATE");break;case 38:return this.popState(),Bt.yytext=Bt.yytext.slice(0,-8).trim(),25;case 39:return this.popState(),Bt.yytext=Bt.yytext.slice(0,-8).trim(),26;case 40:return this.popState(),Bt.yytext=Bt.yytext.slice(0,-10).trim(),27;case 41:return this.popState(),Bt.yytext=Bt.yytext.slice(0,-8).trim(),25;case 42:return this.popState(),Bt.yytext=Bt.yytext.slice(0,-8).trim(),26;case 43:return this.popState(),Bt.yytext=Bt.yytext.slice(0,-10).trim(),27;case 44:return 50;case 45:return 51;case 46:return 52;case 47:return 53;case 48:this.pushState("STATE_STRING");break;case 49:return this.pushState("STATE_ID"),"AS";case 50:return this.popState(),"ID";case 51:this.popState();break;case 52:return"STATE_DESCR";case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;case 56:break;case 57:return this.popState(),21;case 58:break;case 59:return this.begin("NOTE"),29;case 60:return this.popState(),this.pushState("NOTE_ID"),58;case 61:return this.popState(),this.pushState("NOTE_ID"),59;case 62:this.popState(),this.pushState("FLOATING_NOTE");break;case 63:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 64:break;case 65:return"NOTE_TEXT";case 66:return this.popState(),"ID";case 67:return this.popState(),this.pushState("NOTE_TEXT"),24;case 68:return this.popState(),Bt.yytext=Bt.yytext.substr(2).trim(),31;case 69:return this.popState(),Bt.yytext=Bt.yytext.slice(0,-8).trim(),31;case 70:return 7;case 71:return 7;case 72:return 16;case 73:return 56;case 74:return 24;case 75:return Bt.yytext=Bt.yytext.trim(),14;case 76:return 15;case 77:return 28;case 78:return 57;case 79:return 5;case 80:return"INVALID"}},rules:[/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\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:[14,15],inclusive:!1},close_directive:{rules:[14,15],inclusive:!1},arg_directive:{rules:[8,9,14,15],inclusive:!1},type_directive:{rules:[7,8,14,15],inclusive:!1},open_directive:{rules:[6,14,15],inclusive:!1},struct:{rules:[14,15,27,31,37,44,45,46,47,56,57,58,59,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[66],inclusive:!1},FLOATING_NOTE:{rules:[63,64,65],inclusive:!1},NOTE_TEXT:{rules:[68,69],inclusive:!1},NOTE_ID:{rules:[67],inclusive:!1},NOTE:{rules:[60,61,62],inclusive:!1},CLASS_STYLE:{rules:[33],inclusive:!1},CLASS:{rules:[32],inclusive:!1},CLASSDEFID:{rules:[30],inclusive:!1},CLASSDEF:{rules:[28,29],inclusive:!1},acc_descr_multiline:{rules:[25,26],inclusive:!1},acc_descr:{rules:[23],inclusive:!1},acc_title:{rules:[21],inclusive:!1},SCALE:{rules:[18,19,35,36],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[50],inclusive:!1},STATE_STRING:{rules:[51,52],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[14,15,38,39,40,41,42,43,48,49,53,54,55],inclusive:!1},ID:{rules:[14,15],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,10,11,12,13,15,16,17,20,22,24,27,31,34,37,55,59,70,71,72,73,74,75,76,78,79,80],inclusive:!0}}};return wt}();gt.lexer=pe;function Et(){this.yy={}}return Et.prototype=gt,gt.Parser=Et,new Et}();dge.parser=dge;const sFe=dge,pzt="LR",bzt="TB",RK="state",gge="relation",vzt="classDef",wzt="applyClass",NP="default",aFe="divider",pge="[*]",oFe="start",cFe=pge,uFe="end",lFe="color",hFe="fill",mzt="bgFill",yzt=",";function fFe(){return{}}let dFe=pzt,FK=[],PP=fFe();const gFe=()=>({relations:[],states:{},documents:{}});let jK={root:gFe()},x0=jK.root,BP=0,pFe=0;const kzt={LINE:0,DOTTED_LINE:1},xzt={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},$K=i=>JSON.parse(JSON.stringify(i)),Ezt=function(i,a,f){rd.parseDirective(this,i,a,f)},Tzt=i=>{Fe.info("Setting root doc",i),FK=i},_zt=()=>FK,HK=(i,a,f)=>{if(a.stmt===gge)HK(i,a.state1,!0),HK(i,a.state2,!1);else if(a.stmt===RK&&(a.id==="[*]"?(a.id=f?i.id+"_start":i.id+"_end",a.start=f):a.id=a.id.trim()),a.doc){const p=[];let w=[],y;for(y=0;y0&&w.length>0){const b={stmt:RK,id:IIe(),type:"divider",doc:$K(w)};p.push($K(b)),a.doc=p}a.doc.forEach(b=>HK(a,b,!0))}},Czt=()=>(HK({id:"root"},{id:"root",doc:FK},!0),{id:"root",doc:FK}),Szt=i=>{let a;i.doc?a=i.doc:a=i,Fe.info(a),bFe(!0),Fe.info("Extract",a),a.forEach(f=>{switch(f.stmt){case RK:p9(f.id.trim(),f.type,f.doc,f.description,f.note,f.classes,f.styles,f.textStyles);break;case gge:vFe(f.state1,f.state2,f.description);break;case vzt:wFe(f.id.trim(),f.classes);break;case wzt:mge(f.id.trim(),f.styleClass);break}})},p9=function(i,a=NP,f=null,p=null,w=null,y=null,b=null,E=null){const S=i==null?void 0:i.trim();x0.states[S]===void 0?(Fe.info("Adding state ",S,p),x0.states[S]={id:S,descriptions:[],type:a,doc:f,note:w,classes:[],styles:[],textStyles:[]}):(x0.states[S].doc||(x0.states[S].doc=f),x0.states[S].type||(x0.states[S].type=a)),p&&(Fe.info("Setting state description",S,p),typeof p=="string"&&wge(S,p.trim()),typeof p=="object"&&p.forEach(N=>wge(S,N.trim()))),w&&(x0.states[S].note=w,x0.states[S].note.text=Wa.sanitizeText(x0.states[S].note.text,Tt())),y&&(Fe.info("Setting state classes",S,y),(typeof y=="string"?[y]:y).forEach(B=>mge(S,B.trim()))),b&&(Fe.info("Setting state styles",S,b),(typeof b=="string"?[b]:b).forEach(B=>Rzt(S,B.trim()))),E&&(Fe.info("Setting state styles",S,b),(typeof E=="string"?[E]:E).forEach(B=>Fzt(S,B.trim())))},bFe=function(i){jK={root:gFe()},x0=jK.root,BP=0,PP=fFe(),i||rp()},RP=function(i){return x0.states[i]},Azt=function(){return x0.states},Lzt=function(){Fe.info("Documents = ",jK)},Mzt=function(){return x0.relations};function bge(i=""){let a=i;return i===pge&&(BP++,a=`${oFe}${BP}`),a}function vge(i="",a=NP){return i===pge?oFe:a}function Dzt(i=""){let a=i;return i===cFe&&(BP++,a=`${uFe}${BP}`),a}function Izt(i="",a=NP){return i===cFe?uFe:a}function Ozt(i,a,f){let p=bge(i.id.trim()),w=vge(i.id.trim(),i.type),y=bge(a.id.trim()),b=vge(a.id.trim(),a.type);p9(p,w,i.doc,i.description,i.note,i.classes,i.styles,i.textStyles),p9(y,b,a.doc,a.description,a.note,a.classes,a.styles,a.textStyles),x0.relations.push({id1:p,id2:y,relationTitle:Wa.sanitizeText(f,Tt())})}const vFe=function(i,a,f){if(typeof i=="object")Ozt(i,a,f);else{const p=bge(i.trim()),w=vge(i),y=Dzt(a.trim()),b=Izt(a);p9(p,w),p9(y,b),x0.relations.push({id1:p,id2:y,title:Wa.sanitizeText(f,Tt())})}},wge=function(i,a){const f=x0.states[i],p=a.startsWith(":")?a.replace(":","").trim():a;f.descriptions.push(Wa.sanitizeText(p,Tt()))},Nzt=function(i){return i.substring(0,1)===":"?i.substr(2).trim():i.trim()},Pzt=()=>(pFe++,"divider-id-"+pFe),wFe=function(i,a=""){PP[i]===void 0&&(PP[i]={id:i,styles:[],textStyles:[]});const f=PP[i];a!=null&&a.split(yzt).forEach(p=>{const w=p.replace(/([^;]*);/,"$1").trim();if(p.match(lFe)){const b=w.replace(hFe,mzt).replace(lFe,hFe);f.textStyles.push(b)}f.styles.push(w)})},Bzt=function(){return PP},mge=function(i,a){i.split(",").forEach(function(f){let p=RP(f);if(p===void 0){const w=f.trim();p9(w),p=RP(w)}p.classes.push(a)})},Rzt=function(i,a){const f=RP(i);f!==void 0&&f.textStyles.push(a)},Fzt=function(i,a){const f=RP(i);f!==void 0&&f.textStyles.push(a)},D5={parseDirective:Ezt,getConfig:()=>Tt().state,addState:p9,clear:bFe,getState:RP,getStates:Azt,getRelations:Mzt,getClasses:Bzt,getDirection:()=>dFe,addRelation:vFe,getDividerId:Pzt,setDirection:i=>{dFe=i},cleanupLabel:Nzt,lineType:kzt,relationType:xzt,logDocuments:Lzt,getRootDoc:_zt,setRootDoc:Tzt,getRootDocV2:Czt,extract:Szt,trimColon:i=>i&&i[0]===":"?i.substr(1).trim():i.trim(),getAccTitle:L2,setAccTitle:ip,getAccDescription:D2,setAccDescription:M2,addStyleClass:wFe,setCssClass:mge,addDescription:wge,setDiagramTitle:Uw,getDiagramTitle:Ww},mFe=i=>` + fill: ${t.textColor}; +} +`,"getStyles"),CE=P$e});var She,B$e,F$e,_he,z$e,Ahe,SE,Lhe=R(()=>{"use strict";Zt();xr();ut();rr();She=0,B$e=o(function(t,e,r,n,i){let a=o(function(b){switch(b){case i.db.relationType.AGGREGATION:return"aggregation";case i.db.relationType.EXTENSION:return"extension";case i.db.relationType.COMPOSITION:return"composition";case i.db.relationType.DEPENDENCY:return"dependency";case i.db.relationType.LOLLIPOP:return"lollipop"}},"getRelationType");e.points=e.points.filter(b=>!Number.isNaN(b.y));let s=e.points,l=ha().x(function(b){return b.x}).y(function(b){return b.y}).curve(vs),u=t.append("path").attr("d",l(s)).attr("id","edge"+She).attr("class","relation"),h="";n.arrowMarkerAbsolute&&(h=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,h=h.replace(/\(/g,"\\("),h=h.replace(/\)/g,"\\)")),r.relation.lineType==1&&u.attr("class","relation dashed-line"),r.relation.lineType==10&&u.attr("class","relation dotted-line"),r.relation.type1!=="none"&&u.attr("marker-start","url("+h+"#"+a(r.relation.type1)+"Start)"),r.relation.type2!=="none"&&u.attr("marker-end","url("+h+"#"+a(r.relation.type2)+"End)");let f,d,p=e.points.length,m=Lt.calcLabelPosition(e.points);f=m.x,d=m.y;let g,y,v,x;if(p%2!==0&&p>1){let b=Lt.calcCardinalityPosition(r.relation.type1!=="none",e.points,e.points[0]),w=Lt.calcCardinalityPosition(r.relation.type2!=="none",e.points,e.points[p-1]);V.debug("cardinality_1_point "+JSON.stringify(b)),V.debug("cardinality_2_point "+JSON.stringify(w)),g=b.x,y=b.y,v=w.x,x=w.y}if(r.title!==void 0){let b=t.append("g").attr("class","classLabel"),w=b.append("text").attr("class","label").attr("x",f).attr("y",d).attr("fill","red").attr("text-anchor","middle").text(r.title);window.label=w;let S=w.node().getBBox();b.insert("rect",":first-child").attr("class","box").attr("x",S.x-n.padding/2).attr("y",S.y-n.padding/2).attr("width",S.width+n.padding).attr("height",S.height+n.padding)}V.info("Rendering relation "+JSON.stringify(r)),r.relationTitle1!==void 0&&r.relationTitle1!=="none"&&t.append("g").attr("class","cardinality").append("text").attr("class","type1").attr("x",g).attr("y",y).attr("fill","black").attr("font-size","6").text(r.relationTitle1),r.relationTitle2!==void 0&&r.relationTitle2!=="none"&&t.append("g").attr("class","cardinality").append("text").attr("class","type2").attr("x",v).attr("y",x).attr("fill","black").attr("font-size","6").text(r.relationTitle2),She++},"drawEdge"),F$e=o(function(t,e,r,n){V.debug("Rendering class ",e,r);let i=e.id,a={id:i,label:e.id,width:0,height:0},s=t.append("g").attr("id",n.db.lookUpDomId(i)).attr("class","classGroup"),l;e.link?l=s.append("svg:a").attr("xlink:href",e.link).attr("target",e.linkTarget).append("text").attr("y",r.textHeight+r.padding).attr("x",0):l=s.append("text").attr("y",r.textHeight+r.padding).attr("x",0);let u=!0;e.annotations.forEach(function(w){let S=l.append("tspan").text("\xAB"+w+"\xBB");u||S.attr("dy",r.textHeight),u=!1});let h=_he(e),f=l.append("tspan").text(h).attr("class","title");u||f.attr("dy",r.textHeight);let d=l.node().getBBox().height,p,m,g;if(e.members.length>0){p=s.append("line").attr("x1",0).attr("y1",r.padding+d+r.dividerMargin/2).attr("y2",r.padding+d+r.dividerMargin/2);let w=s.append("text").attr("x",r.padding).attr("y",d+r.dividerMargin+r.textHeight).attr("fill","white").attr("class","classText");u=!0,e.members.forEach(function(S){Ahe(w,S,u,r),u=!1}),m=w.node().getBBox()}if(e.methods.length>0){g=s.append("line").attr("x1",0).attr("y1",r.padding+d+r.dividerMargin+m.height).attr("y2",r.padding+d+r.dividerMargin+m.height);let w=s.append("text").attr("x",r.padding).attr("y",d+2*r.dividerMargin+m.height+r.textHeight).attr("fill","white").attr("class","classText");u=!0,e.methods.forEach(function(S){Ahe(w,S,u,r),u=!1})}let y=s.node().getBBox();var v=" ";e.cssClasses.length>0&&(v=v+e.cssClasses.join(" "));let b=s.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",y.width+2*r.padding).attr("height",y.height+r.padding+.5*r.dividerMargin).attr("class",v).node().getBBox().width;return l.node().childNodes.forEach(function(w){w.setAttribute("x",(b-w.getBBox().width)/2)}),e.tooltip&&l.insert("title").text(e.tooltip),p&&p.attr("x2",b),g&&g.attr("x2",b),a.width=b,a.height=y.height+r.padding+.5*r.dividerMargin,a},"drawClass"),_he=o(function(t){let e=t.id;return t.type&&(e+="<"+gh(t.type)+">"),e},"getClassTitleString"),z$e=o(function(t,e,r,n){V.debug("Rendering note ",e,r);let i=e.id,a={id:i,text:e.text,width:0,height:0},s=t.append("g").attr("id",i).attr("class","classGroup"),l=s.append("text").attr("y",r.textHeight+r.padding).attr("x",0),u=JSON.parse(`"${e.text}"`).split(` +`);u.forEach(function(p){V.debug(`Adding line: ${p}`),l.append("tspan").text(p).attr("class","title").attr("dy",r.textHeight)});let h=s.node().getBBox(),d=s.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",h.width+2*r.padding).attr("height",h.height+u.length*r.textHeight+r.padding+.5*r.dividerMargin).node().getBBox().width;return l.node().childNodes.forEach(function(p){p.setAttribute("x",(d-p.getBBox().width)/2)}),a.width=d,a.height=h.height+u.length*r.textHeight+r.padding+.5*r.dividerMargin,a},"drawNote"),Ahe=o(function(t,e,r,n){let{displayText:i,cssStyle:a}=e.getDisplayDetails(),s=t.append("tspan").attr("x",n.padding).text(i);a!==""&&s.attr("style",e.cssStyle),r||s.attr("dy",n.textHeight)},"addTspan"),SE={getClassTitleString:_he,drawClass:F$e,drawEdge:B$e,drawNote:z$e}});var _E,AE,kx,G$e,$$e,Dhe,Rhe=R(()=>{"use strict";Zt();Vd();ya();ut();Lhe();Yn();_t();_E={},AE=20,kx=o(function(t){let e=Object.entries(_E).find(r=>r[1].label===t);if(e)return e[0]},"getGraphId"),G$e=o(function(t){t.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"),t.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"),t.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"),t.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"),t.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"),t.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"),t.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"),t.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"),$$e=o(function(t,e,r,n){let i=de().class;_E={},V.info("Rendering diagram "+t);let a=de().securityLevel,s;a==="sandbox"&&(s=$e("#i"+e));let l=a==="sandbox"?$e(s.nodes()[0].contentDocument.body):$e("body"),u=l.select(`[id='${e}']`);G$e(u);let h=new lr({multigraph:!0});h.setGraph({isMultiGraph:!0}),h.setDefaultEdgeLabel(function(){return{}});let f=n.db.getClasses(),d=[...f.keys()];for(let b of d){let w=f.get(b),S=SE.drawClass(u,w,i,n);_E[S.id]=S,h.setNode(S.id,S),V.info("Org height: "+S.height)}n.db.getRelations().forEach(function(b){V.info("tjoho"+kx(b.id1)+kx(b.id2)+JSON.stringify(b)),h.setEdge(kx(b.id1),kx(b.id2),{relation:b},b.title||"DEFAULT")}),n.db.getNotes().forEach(function(b){V.debug(`Adding note: ${JSON.stringify(b)}`);let w=SE.drawNote(u,b,i,n);_E[w.id]=w,h.setNode(w.id,w),b.class&&f.has(b.class)&&h.setEdge(b.id,kx(b.class),{relation:{id1:b.id,id2:b.class,relation:{type1:"none",type2:"none",lineType:10}}},"DEFAULT")}),lo(h),h.nodes().forEach(function(b){b!==void 0&&h.node(b)!==void 0&&(V.debug("Node "+b+": "+JSON.stringify(h.node(b))),l.select("#"+(n.db.lookUpDomId(b)||b)).attr("transform","translate("+(h.node(b).x-h.node(b).width/2)+","+(h.node(b).y-h.node(b).height/2)+" )"))}),h.edges().forEach(function(b){b!==void 0&&h.edge(b)!==void 0&&(V.debug("Edge "+b.v+" -> "+b.w+": "+JSON.stringify(h.edge(b))),SE.drawEdge(u,h.edge(b),h.edge(b).relation,i,n))});let g=u.node().getBBox(),y=g.width+AE*2,v=g.height+AE*2;Sr(u,v,y,i.useMaxWidth);let x=`${g.x-AE} ${g.y-AE} ${y} ${v}`;V.debug(`viewBox ${x}`),u.attr("viewBox",x)},"draw"),Dhe={draw:$$e}});var Nhe={};hr(Nhe,{diagram:()=>V$e});var V$e,Mhe=R(()=>{"use strict";TO();AO();_O();Rhe();V$e={parser:wE,db:Bg,renderer:Dhe,styles:CE,init:o(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute,Bg.clear()},"init")}});var W$e,q$e,X$e,j$e,K$e,Q$e,Z$e,J$e,eVe,tVe,rVe,LE,LO=R(()=>{"use strict";ut();W$e=o((t,e,r,n)=>{e.forEach(i=>{rVe[i](t,r,n)})},"insertMarkers"),q$e=o((t,e,r)=>{V.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).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"),X$e=o((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).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"),j$e=o((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).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"),K$e=o((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).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"),Q$e=o((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).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),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).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"),Z$e=o((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).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"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).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"),J$e=o((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).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"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).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"),eVe=o((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).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"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).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"),tVe=o((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-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"),rVe={extension:q$e,composition:X$e,aggregation:j$e,dependency:K$e,lollipop:Q$e,point:Z$e,circle:J$e,cross:eVe,barb:tVe},LE=W$e});var tr,zl,Phe,Bhe,RE,nVe,Fhe,zhe,Fg,DE,Ghe,$he,Vhe,Uhe,Hhe=R(()=>{"use strict";ut();Pv();ya();tr={},zl={},Phe={},Bhe=o(()=>{zl={},Phe={},tr={}},"clear"),RE=o((t,e)=>(V.trace("In isDescendant",e," ",t," = ",zl[e].includes(t)),!!zl[e].includes(t)),"isDescendant"),nVe=o((t,e)=>(V.info("Descendants of ",e," is ",zl[e]),V.info("Edge is ",t),t.v===e||t.w===e?!1:zl[e]?zl[e].includes(t.v)||RE(t.v,e)||RE(t.w,e)||zl[e].includes(t.w):(V.debug("Tilt, ",e,",not in descendants"),!1)),"edgeInCluster"),Fhe=o((t,e,r,n)=>{V.warn("Copying children of ",t,"root",n,"data",e.node(t),n);let i=e.children(t)||[];t!==n&&i.push(t),V.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)Fhe(a,e,r,n);else{let s=e.node(a);V.info("cp ",a," to ",n," with parent ",t),r.setNode(a,s),n!==e.parent(a)&&(V.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(V.debug("Setting parent",a,t),r.setParent(a,t)):(V.info("In copy ",t,"root",n,"data",e.node(t),n),V.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));let l=e.edges(a);V.debug("Copying Edges",l),l.forEach(u=>{V.info("Edge",u);let h=e.edge(u.v,u.w,u.name);V.info("Edge data",h,n);try{nVe(u,n)?(V.info("Copying as ",u.v,u.w,h,u.name),r.setEdge(u.v,u.w,h,u.name),V.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):V.info("Skipping copy of edge ",u.v,"-->",u.w," rootId: ",n," clusterId:",t)}catch(f){V.error(f)}})}V.debug("Removing node",a),e.removeNode(a)})},"copy"),zhe=o((t,e)=>{let r=e.children(t),n=[...r];for(let i of r)Phe[i]=t,n=[...n,...zhe(i,e)];return n},"extractDescendants"),Fg=o((t,e)=>{V.trace("Searching",t);let r=e.children(t);if(V.trace("Searching children of id ",t,r),r.length<1)return V.trace("This is a valid node",t),t;for(let n of r){let i=Fg(n,e);if(i)return V.trace("Found replacement for",t," => ",i),i}},"findNonClusterChild"),DE=o(t=>!tr[t]||!tr[t].externalConnections?t:tr[t]?tr[t].id:t,"getAnchorId"),Ghe=o((t,e)=>{if(!t||e>10){V.debug("Opting out, no graph ");return}else V.debug("Opting in, graph ");t.nodes().forEach(function(r){t.children(r).length>0&&(V.warn("Cluster identified",r," Replacement id in edges: ",Fg(r,t)),zl[r]=zhe(r,t),tr[r]={id:Fg(r,t),clusterData:t.node(r)})}),t.nodes().forEach(function(r){let n=t.children(r),i=t.edges();n.length>0?(V.debug("Cluster identified",r,zl),i.forEach(a=>{if(a.v!==r&&a.w!==r){let s=RE(a.v,r),l=RE(a.w,r);s^l&&(V.warn("Edge: ",a," leaves cluster ",r),V.warn("Descendants of XXX ",r,": ",zl[r]),tr[r].externalConnections=!0)}})):V.debug("Not a cluster ",r,zl)});for(let r of Object.keys(tr)){let n=tr[r].id,i=t.parent(n);i!==r&&tr[i]&&!tr[i].externalConnections&&(tr[r].id=i)}t.edges().forEach(function(r){let n=t.edge(r);V.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),V.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(t.edge(r)));let i=r.v,a=r.w;if(V.warn("Fix XXX",tr,"ids:",r.v,r.w,"Translating: ",tr[r.v]," --- ",tr[r.w]),tr[r.v]&&tr[r.w]&&tr[r.v]===tr[r.w]){V.warn("Fixing and trixing link to self - removing XXX",r.v,r.w,r.name),V.warn("Fixing and trixing - removing XXX",r.v,r.w,r.name),i=DE(r.v),a=DE(r.w),t.removeEdge(r.v,r.w,r.name);let s=r.w+"---"+r.v;t.setNode(s,{domId:s,id:s,labelStyle:"",labelText:n.label,padding:0,shape:"labelRect",style:""});let l=structuredClone(n),u=structuredClone(n);l.label="",l.arrowTypeEnd="none",u.label="",l.fromCluster=r.v,u.toCluster=r.v,t.setEdge(i,s,l,r.name+"-cyclic-special"),t.setEdge(s,a,u,r.name+"-cyclic-special")}else if(tr[r.v]||tr[r.w]){if(V.warn("Fixing and trixing - removing XXX",r.v,r.w,r.name),i=DE(r.v),a=DE(r.w),t.removeEdge(r.v,r.w,r.name),i!==r.v){let s=t.parent(i);tr[s].externalConnections=!0,n.fromCluster=r.v}if(a!==r.w){let s=t.parent(a);tr[s].externalConnections=!0,n.toCluster=r.w}V.warn("Fix Replacing with XXX",i,a,r.name),t.setEdge(i,a,n,r.name)}}),V.warn("Adjusted Graph",zn(t)),$he(t,0),V.trace(tr)},"adjustClustersAndEdges"),$he=o((t,e)=>{if(V.warn("extractor - ",e,zn(t),t.children("D")),e>10){V.error("Bailing out");return}let r=t.nodes(),n=!1;for(let i of r){let a=t.children(i);n=n||a.length>0}if(!n){V.debug("Done, no node has children",t.nodes());return}V.debug("Nodes = ",r,e);for(let i of r)if(V.debug("Extracting node",i,tr,tr[i]&&!tr[i].externalConnections,!t.parent(i),t.node(i),t.children("D")," Depth ",e),!tr[i])V.debug("Not a cluster",i,e);else if(!tr[i].externalConnections&&t.children(i)&&t.children(i).length>0){V.warn("Cluster without external connections, without a parent and with children",i,e);let s=t.graph().rankdir==="TB"?"LR":"TB";tr[i]?.clusterData?.dir&&(s=tr[i].clusterData.dir,V.warn("Fixing dir",tr[i].clusterData.dir,s));let l=new lr({multigraph:!0,compound:!0}).setGraph({rankdir:s,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});V.warn("Old graph before copy",zn(t)),Fhe(i,t,l,i),t.setNode(i,{clusterNode:!0,id:i,clusterData:tr[i].clusterData,labelText:tr[i].labelText,graph:l}),V.warn("New graph after copy node: (",i,")",zn(l)),V.debug("Old graph after copy",zn(t))}else V.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!tr[i].externalConnections," no parent: ",!t.parent(i)," children ",t.children(i)&&t.children(i).length>0,t.children("D"),e),V.debug(tr);r=t.nodes(),V.warn("New list of nodes",r);for(let i of r){let a=t.node(i);V.warn(" Now next level",i,a),a.clusterNode&&$he(a.graph,e+1)}},"extractor"),Vhe=o((t,e)=>{if(e.length===0)return[];let r=Object.assign(e);return e.forEach(n=>{let i=t.children(n),a=Vhe(t,i);r=[...r,...a]}),r},"sorter"),Uhe=o(t=>Vhe(t,t.children()),"sortNodesByHierarchy")});var iVe,aVe,sVe,oVe,lVe,Yhe,Whe,qhe,Xhe=R(()=>{"use strict";S9();ut();bv();Al();Zt();_t();rr();_d();iVe=o((t,e)=>{V.info("Creating subgraph rect for ",e.id,e);let r=de(),n=t.insert("g").attr("class","cluster"+(e.class?" "+e.class:"")).attr("id",e.id),i=n.insert("rect",":first-child"),a=yr(r.flowchart.htmlLabels),s=n.insert("g").attr("class","cluster-label"),l=e.labelType==="markdown"?ta(s,e.labelText,{style:e.labelStyle,useHtmlLabels:a},r):s.node().appendChild(ra(e.labelText,e.labelStyle,void 0,!0)),u=l.getBBox();if(yr(r.flowchart.htmlLabels)){let g=l.children[0],y=$e(l);u=g.getBoundingClientRect(),y.attr("width",u.width),y.attr("height",u.height)}let h=0*e.padding,f=h/2,d=e.width<=u.width+h?u.width+h:e.width;e.width<=u.width+h?e.diff=(u.width-e.width)/2-e.padding/2:e.diff=-e.padding/2,V.trace("Data ",e,JSON.stringify(e)),i.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-d/2).attr("y",e.y-e.height/2-f).attr("width",d).attr("height",e.height+h);let{subGraphTitleTopMargin:p}=io(r);a?s.attr("transform",`translate(${e.x-u.width/2}, ${e.y-e.height/2+p})`):s.attr("transform",`translate(${e.x}, ${e.y-e.height/2+p})`);let m=i.node().getBBox();return e.width=m.width,e.height=m.height,e.intersect=function(g){return Ad(e,g)},n},"rect"),aVe=o((t,e)=>{let r=t.insert("g").attr("class","note-cluster").attr("id",e.id),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");let s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(l){return Ad(e,l)},r},"noteGroup"),sVe=o((t,e)=>{let r=de(),n=t.insert("g").attr("class",e.classes).attr("id",e.id),i=n.insert("rect",":first-child"),a=n.insert("g").attr("class","cluster-label"),s=n.append("rect"),l=a.node().appendChild(ra(e.labelText,e.labelStyle,void 0,!0)),u=l.getBBox();if(yr(r.flowchart.htmlLabels)){let g=l.children[0],y=$e(l);u=g.getBoundingClientRect(),y.attr("width",u.width),y.attr("height",u.height)}u=l.getBBox();let h=0*e.padding,f=h/2,d=e.width<=u.width+e.padding?u.width+e.padding:e.width;e.width<=u.width+e.padding?e.diff=(u.width+e.padding*0-e.width)/2:e.diff=-e.padding/2,i.attr("class","outer").attr("x",e.x-d/2-f).attr("y",e.y-e.height/2-f).attr("width",d+h).attr("height",e.height+h),s.attr("class","inner").attr("x",e.x-d/2-f).attr("y",e.y-e.height/2-f+u.height-1).attr("width",d+h).attr("height",e.height+h-u.height-3);let{subGraphTitleTopMargin:p}=io(r);a.attr("transform",`translate(${e.x-u.width/2}, ${e.y-e.height/2-e.padding/3+(yr(r.flowchart.htmlLabels)?5:3)+p})`);let m=i.node().getBBox();return e.height=m.height,e.intersect=function(g){return Ad(e,g)},n},"roundedWithTitle"),oVe=o((t,e)=>{let r=t.insert("g").attr("class",e.classes).attr("id",e.id),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("class","divider").attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2).attr("width",e.width+i).attr("height",e.height+i);let s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.diff=-e.padding/2,e.intersect=function(l){return Ad(e,l)},r},"divider"),lVe={rect:iVe,roundedWithTitle:sVe,noteGroup:aVe,divider:oVe},Yhe={},Whe=o((t,e)=>{V.trace("Inserting cluster");let r=e.shape||"rect";Yhe[e.id]=lVe[r](t,e)},"insertCluster"),qhe=o(()=>{Yhe={}},"clear")});var Khe,cVe,jhe,Qhe=R(()=>{"use strict";ut();Khe=o((t,e,r,n,i)=>{e.arrowTypeStart&&jhe(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&jhe(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),cVe={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},jhe=o((t,e,r,n,i,a)=>{let s=cVe[r];if(!s){V.warn(`Unknown arrow type: ${r}`);return}let l=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${l})`)},"addEdgeMarker")});function NE(t,e){de().flowchart.htmlLabels&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}var ME,Ta,Jhe,IE,OE,uVe,hVe,Zhe,PE,DO=R(()=>{"use strict";ut();bv();Al();Zt();_t();xr();rr();j9();_d();Qhe();ME={},Ta={},Jhe=o(()=>{ME={},Ta={}},"clear"),IE=o((t,e)=>{let r=de(),n=yr(r.flowchart.htmlLabels),i=e.labelType==="markdown"?ta(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:!0},r):ra(e.label,e.labelStyle),a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label");s.node().appendChild(i);let l=i.getBBox();if(n){let h=i.children[0],f=$e(i);l=h.getBoundingClientRect(),f.attr("width",l.width),f.attr("height",l.height)}s.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),ME[e.id]=a,e.width=l.width,e.height=l.height;let u;if(e.startLabelLeft){let h=ra(e.startLabelLeft,e.labelStyle),f=t.insert("g").attr("class","edgeTerminals"),d=f.insert("g").attr("class","inner");u=d.node().appendChild(h);let p=h.getBBox();d.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),Ta[e.id]||(Ta[e.id]={}),Ta[e.id].startLeft=f,NE(u,e.startLabelLeft)}if(e.startLabelRight){let h=ra(e.startLabelRight,e.labelStyle),f=t.insert("g").attr("class","edgeTerminals"),d=f.insert("g").attr("class","inner");u=f.node().appendChild(h),d.node().appendChild(h);let p=h.getBBox();d.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),Ta[e.id]||(Ta[e.id]={}),Ta[e.id].startRight=f,NE(u,e.startLabelRight)}if(e.endLabelLeft){let h=ra(e.endLabelLeft,e.labelStyle),f=t.insert("g").attr("class","edgeTerminals"),d=f.insert("g").attr("class","inner");u=d.node().appendChild(h);let p=h.getBBox();d.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),f.node().appendChild(h),Ta[e.id]||(Ta[e.id]={}),Ta[e.id].endLeft=f,NE(u,e.endLabelLeft)}if(e.endLabelRight){let h=ra(e.endLabelRight,e.labelStyle),f=t.insert("g").attr("class","edgeTerminals"),d=f.insert("g").attr("class","inner");u=d.node().appendChild(h);let p=h.getBBox();d.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),f.node().appendChild(h),Ta[e.id]||(Ta[e.id]={}),Ta[e.id].endRight=f,NE(u,e.endLabelRight)}return i},"insertEdgeLabel");o(NE,"setTerminalWidth");OE=o((t,e)=>{V.debug("Moving label abc88 ",t.id,t.label,ME[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath,n=de(),{subGraphTitleTotalMargin:i}=io(n);if(t.label){let a=ME[t.id],s=t.x,l=t.y;if(r){let u=Lt.calcLabelPosition(r);V.debug("Moving label "+t.label+" from (",s,",",l,") to (",u.x,",",u.y,") abc88"),e.updatedPath&&(s=u.x,l=u.y)}a.attr("transform",`translate(${s}, ${l+i/2})`)}if(t.startLabelLeft){let a=Ta[t.id].startLeft,s=t.x,l=t.y;if(r){let u=Lt.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}if(t.startLabelRight){let a=Ta[t.id].startRight,s=t.x,l=t.y;if(r){let u=Lt.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}if(t.endLabelLeft){let a=Ta[t.id].endLeft,s=t.x,l=t.y;if(r){let u=Lt.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}if(t.endLabelRight){let a=Ta[t.id].endRight,s=t.x,l=t.y;if(r){let u=Lt.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}},"positionEdgeLabel"),uVe=o((t,e)=>{let r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,l=t.height/2;return i>=s||a>=l},"outsideNode"),hVe=o((t,e,r)=>{V.debug(`intersection calc abc89: + outsidePoint: ${JSON.stringify(e)} + insidePoint : ${JSON.stringify(r)} + node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);let n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2,l=r.xMath.abs(n-e.x)*u){let d=r.y{V.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!uVe(e,a)&&!i){let s=hVe(e,n,a),l=!1;r.forEach(u=>{l=l||u.x===s.x&&u.y===s.y}),r.some(u=>u.x===s.x&&u.y===s.y)||r.push(s),i=!0}else n=a,i||r.push(a)}),r},"cutPathAtIntersect"),PE=o(function(t,e,r,n,i,a,s){let l=r.points;V.debug("abc88 InsertEdge: edge=",r,"e=",e);let u=!1,h=a.node(e.v);var f=a.node(e.w);f?.intersect&&h?.intersect&&(l=l.slice(1,r.points.length-1),l.unshift(h.intersect(l[0])),l.push(f.intersect(l[l.length-1]))),r.toCluster&&(V.debug("to cluster abc88",n[r.toCluster]),l=Zhe(r.points,n[r.toCluster].node),u=!0),r.fromCluster&&(V.debug("from cluster abc88",n[r.fromCluster]),l=Zhe(l.reverse(),n[r.fromCluster].node).reverse(),u=!0);let d=l.filter(S=>!Number.isNaN(S.y)),p=vs;r.curve&&(i==="graph"||i==="flowchart")&&(p=r.curve);let{x:m,y:g}=X5(r),y=ha().x(m).y(g).curve(p),v;switch(r.thickness){case"normal":v="edge-thickness-normal";break;case"thick":v="edge-thickness-thick";break;case"invisible":v="edge-thickness-thick";break;default:v=""}switch(r.pattern){case"solid":v+=" edge-pattern-solid";break;case"dotted":v+=" edge-pattern-dotted";break;case"dashed":v+=" edge-pattern-dashed";break}let x=t.append("path").attr("d",y(d)).attr("id",r.id).attr("class"," "+v+(r.classes?" "+r.classes:"")).attr("style",r.style),b="";(de().flowchart.arrowMarkerAbsolute||de().state.arrowMarkerAbsolute)&&(b=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,b=b.replace(/\(/g,"\\("),b=b.replace(/\)/g,"\\)")),Khe(x,r,b,s,i);let w={};return u&&(w.updatedPath=l),w.originalPath=r.points,w},"insertEdge")});var efe,tfe,rfe=R(()=>{"use strict";Vd();Pv();LO();N5();Hhe();M5();Xhe();DO();ut();_d();_t();efe=o(async(t,e,r,n,i,a)=>{V.info("Graph in recursive render: XXX",zn(e),i);let s=e.graph().rankdir;V.trace("Dir in recursive render - dir:",s);let l=t.insert("g").attr("class","root");e.nodes()?V.info("Recursive render XXX",e.nodes()):V.info("No nodes found for",e),e.edges().length>0&&V.trace("Recursive edges",e.edge(e.edges()[0]));let u=l.insert("g").attr("class","clusters"),h=l.insert("g").attr("class","edgePaths"),f=l.insert("g").attr("class","edgeLabels"),d=l.insert("g").attr("class","nodes");await Promise.all(e.nodes().map(async function(g){let y=e.node(g);if(i!==void 0){let v=JSON.parse(JSON.stringify(i.clusterData));V.info("Setting data for cluster XXX (",g,") ",v,i),e.setNode(i.id,v),e.parent(g)||(V.trace("Setting parent",g,i.id),e.setParent(g,i.id,v))}if(V.info("(Insert) Node XXX"+g+": "+JSON.stringify(e.node(g))),y?.clusterNode){V.info("Cluster identified",g,y.width,e.node(g));let{ranksep:v,nodesep:x}=e.graph();y.graph.setGraph({...y.graph.graph(),ranksep:v,nodesep:x});let b=await efe(d,y.graph,r,n,e.node(g),a),w=b.elem;kn(y,w),y.diff=b.diff||0,V.info("Node bounds (abc123)",g,y,y.width,y.x,y.y),Bj(w,y),V.warn("Recursive render complete ",w,y)}else e.children(g).length>0?(V.info("Cluster - the non recursive path XXX",g,y.id,y,e),V.info(Fg(y.id,e)),tr[y.id]={id:Fg(y.id,e),node:y}):(V.info("Node - the non recursive path",g,y.id,y),await pm(d,e.node(g),s))})),e.edges().forEach(async function(g){let y=e.edge(g.v,g.w,g.name);V.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(g)),V.info("Edge "+g.v+" -> "+g.w+": ",g," ",JSON.stringify(e.edge(g))),V.info("Fix",tr,"ids:",g.v,g.w,"Translating: ",tr[g.v],tr[g.w]),await IE(f,y)}),e.edges().forEach(function(g){V.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(g))}),V.info("Graph before layout:",JSON.stringify(zn(e))),V.info("#############################################"),V.info("### Layout ###"),V.info("#############################################"),V.info(e),lo(e),V.info("Graph after layout:",JSON.stringify(zn(e)));let p=0,{subGraphTitleTotalMargin:m}=io(a);return Uhe(e).forEach(function(g){let y=e.node(g);V.info("Position "+g+": "+JSON.stringify(e.node(g))),V.info("Position "+g+": ("+y.x,","+y.y,") width: ",y.width," height: ",y.height),y?.clusterNode?(y.y+=m,wv(y)):e.children(g).length>0?(y.height+=m,Whe(u,y),tr[y.id].node=y):(y.y+=m/2,wv(y))}),e.edges().forEach(function(g){let y=e.edge(g);V.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(y),y),y.points.forEach(x=>x.y+=m/2);let v=PE(h,g,y,tr,r,e,n);OE(y,v)}),e.nodes().forEach(function(g){let y=e.node(g);V.info(g,y.type,y.diff),y.type==="group"&&(p=y.diff)}),{elem:l,diff:p}},"recursiveRender"),tfe=o(async(t,e,r,n,i)=>{LE(t,r,n,i),Fj(),Jhe(),qhe(),Bhe(),V.warn("Graph at first:",JSON.stringify(zn(e))),Ghe(e),V.warn("Graph after:",JSON.stringify(zn(e)));let a=de();await efe(t,e,n,i,void 0,a)},"render")});function nfe(t){let e;switch(t){case 0:e="aggregation";break;case 1:e="extension";break;case 2:e="composition";break;case 3:e="dependency";break;case 4:e="lollipop";break;default:e="none"}return e}var NO,RO,fVe,ife,dVe,pVe,mVe,gVe,afe,sfe=R(()=>{"use strict";Zt();ya();ut();_t();rfe();xr();xr();Yn();rr();NO=o(t=>We.sanitizeText(t,de()),"sanitizeText"),RO={dividerMargin:10,padding:5,textHeight:10,curve:void 0},fVe=o(function(t,e,r,n){V.info("keys:",[...t.keys()]),V.info(t),t.forEach(function(i){let s={shape:"rect",id:i.id,domId:i.domId,labelText:NO(i.id),labelStyle:"",style:"fill: none; stroke: black",padding:de().flowchart?.padding??de().class?.padding};e.setNode(i.id,s),ife(i.classes,e,r,n,i.id),V.info("setNode",s)})},"addNamespaces"),ife=o(function(t,e,r,n,i){V.info("keys:",[...t.keys()]),V.info(t),[...t.values()].filter(a=>a.parent===i).forEach(function(a){let s=a.cssClasses.join(" "),l=lm(a.styles),u=a.label??a.id,h=0,d={labelStyle:l.labelStyle,shape:"class_box",labelText:NO(u),classData:a,rx:h,ry:h,class:s,style:l.style,id:a.id,domId:a.domId,tooltip:n.db.getTooltip(a.id,i)||"",haveCallback:a.haveCallback,link:a.link,width:a.type==="group"?500:void 0,type:a.type,padding:de().flowchart?.padding??de().class?.padding};e.setNode(a.id,d),i&&e.setParent(a.id,i),V.info("setNode",d)})},"addClasses"),dVe=o(function(t,e,r,n){V.info(t),t.forEach(function(i,a){let s=i,l="",u={labelStyle:"",style:""},h=s.text,f=0,p={labelStyle:u.labelStyle,shape:"note",labelText:NO(h),noteData:s,rx:f,ry:f,class:l,style:u.style,id:s.id,domId:s.id,tooltip:"",type:"note",padding:de().flowchart?.padding??de().class?.padding};if(e.setNode(s.id,p),V.info("setNode",p),!s.class||!n.has(s.class))return;let m=r+a,g={id:`edgeNote${m}`,classes:"relation",pattern:"dotted",arrowhead:"none",startLabelRight:"",endLabelLeft:"",arrowTypeStart:"none",arrowTypeEnd:"none",style:"fill:none",labelStyle:"",curve:om(RO.curve,xu)};e.setEdge(s.id,s.class,g,m)})},"addNotes"),pVe=o(function(t,e){let r=de().flowchart,n=0;t.forEach(function(i){n++;let a={classes:"relation",pattern:i.relation.lineType==1?"dashed":"solid",id:y5(i.id1,i.id2,{prefix:"id",counter:n}),arrowhead:i.type==="arrow_open"?"none":"normal",startLabelRight:i.relationTitle1==="none"?"":i.relationTitle1,endLabelLeft:i.relationTitle2==="none"?"":i.relationTitle2,arrowTypeStart:nfe(i.relation.type1),arrowTypeEnd:nfe(i.relation.type2),style:"fill:none",labelStyle:"",curve:om(r?.curve,xu)};if(V.info(a,i),i.style!==void 0){let s=lm(i.style);a.style=s.style,a.labelStyle=s.labelStyle}i.text=i.title,i.text===void 0?i.style!==void 0&&(a.arrowheadStyle="fill: #333"):(a.arrowheadStyle="fill: #333",a.labelpos="c",de().flowchart?.htmlLabels??de().htmlLabels?(a.labelType="html",a.label=''+i.text+""):(a.labelType="text",a.label=i.text.replace(We.lineBreakRegex,` +`),i.style===void 0&&(a.style=a.style||"stroke: #333; stroke-width: 1.5px;fill:none"),a.labelStyle=a.labelStyle.replace("color:","fill:"))),e.setEdge(i.id1,i.id2,a,n)})},"addRelations"),mVe=o(function(t){RO={...RO,...t}},"setConf"),gVe=o(async function(t,e,r,n){V.info("Drawing class - ",e);let i=de().flowchart??de().class,a=de().securityLevel;V.info("config:",i);let s=i?.nodeSpacing??50,l=i?.rankSpacing??50,u=new lr({multigraph:!0,compound:!0}).setGraph({rankdir:n.db.getDirection(),nodesep:s,ranksep:l,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),h=n.db.getNamespaces(),f=n.db.getClasses(),d=n.db.getRelations(),p=n.db.getNotes();V.info(d),fVe(h,u,e,n),ife(f,u,e,n),pVe(d,u),dVe(p,u,d.length+1,f);let m;a==="sandbox"&&(m=$e("#i"+e));let g=a==="sandbox"?$e(m.nodes()[0].contentDocument.body):$e("body"),y=g.select(`[id="${e}"]`),v=g.select("#"+e+" g");if(await tfe(v,u,["aggregation","extension","composition","dependency","lollipop"],"classDiagram",e),Lt.insertTitle(y,"classTitleText",i?.titleTopMargin??5,n.db.getDiagramTitle()),Lo(u,y,i?.diagramPadding,i?.useMaxWidth),!i?.htmlLabels){let x=a==="sandbox"?m.nodes()[0].contentDocument:document,b=x.querySelectorAll('[id="'+e+'"] .edgeLabel .label');for(let w of b){let S=w.getBBox(),T=x.createElementNS("http://www.w3.org/2000/svg","rect");T.setAttribute("rx",0),T.setAttribute("ry",0),T.setAttribute("width",S.width),T.setAttribute("height",S.height),w.insertBefore(T,w.firstChild)}}},"draw");o(nfe,"getArrowMarker");afe={setConf:mVe,draw:gVe}});var ofe={};hr(ofe,{diagram:()=>yVe});var yVe,lfe=R(()=>{"use strict";TO();AO();_O();sfe();yVe={parser:wE,db:Bg,renderer:afe,styles:CE,init:o(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute,Bg.clear()},"init")}});var MO,BE,IO=R(()=>{"use strict";MO=function(){var t=o(function(F,B,$,z){for($=$||{},z=F.length;z--;$[F[z]]=B);return $},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],l=[1,16],u=[1,17],h=[1,18],f=[1,19],d=[1,32],p=[1,20],m=[1,21],g=[1,22],y=[1,23],v=[1,24],x=[1,26],b=[1,27],w=[1,28],S=[1,29],T=[1,30],E=[1,31],_=[1,34],A=[1,35],L=[1,36],M=[1,37],N=[1,33],k=[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],I=[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],C=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],O={trace:o(function(){},"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:o(function(B,$,z,Y,Q,X,ie){var j=X.length-1;switch(Q){case 3:return Y.setRootDoc(X[j]),X[j];break;case 4:this.$=[];break;case 5:X[j]!="nl"&&(X[j-1].push(X[j]),this.$=X[j-1]);break;case 6:case 7:this.$=X[j];break;case 8:this.$="nl";break;case 12:this.$=X[j];break;case 13:let q=X[j-1];q.description=Y.trimColon(X[j]),this.$=q;break;case 14:this.$={stmt:"relation",state1:X[j-2],state2:X[j]};break;case 15:let K=Y.trimColon(X[j]);this.$={stmt:"relation",state1:X[j-3],state2:X[j-1],description:K};break;case 19:this.$={stmt:"state",id:X[j-3],type:"default",description:"",doc:X[j-1]};break;case 20:var J=X[j],Z=X[j-2].trim();if(X[j].match(":")){var H=X[j].split(":");J=H[0],Z=[Z,H[1]]}this.$={stmt:"state",id:J,type:"default",description:Z};break;case 21:this.$={stmt:"state",id:X[j-3],type:"default",description:X[j-5],doc:X[j-1]};break;case 22:this.$={stmt:"state",id:X[j],type:"fork"};break;case 23:this.$={stmt:"state",id:X[j],type:"join"};break;case 24:this.$={stmt:"state",id:X[j],type:"choice"};break;case 25:this.$={stmt:"state",id:Y.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:X[j-1].trim(),note:{position:X[j-2].trim(),text:X[j].trim()}};break;case 29:this.$=X[j].trim(),Y.setAccTitle(this.$);break;case 30:case 31:this.$=X[j].trim(),Y.setAccDescription(this.$);break;case 32:case 33:this.$={stmt:"classDef",id:X[j-1].trim(),classes:X[j].trim()};break;case 34:this.$={stmt:"style",id:X[j-1].trim(),styleClass:X[j].trim()};break;case 35:this.$={stmt:"applyClass",id:X[j-1].trim(),styleClass:X[j].trim()};break;case 36:Y.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 37:Y.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 38:Y.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 39:Y.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 42:case 43:this.$={stmt:"state",id:X[j].trim(),type:"default",description:""};break;case 44:this.$={stmt:"state",id:X[j-2].trim(),classes:[X[j].trim()],type:"default",description:""};break;case 45:this.$={stmt:"state",id:X[j-2].trim(),classes:[X[j].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:u,19:h,22:f,24:d,25:p,26:m,27:g,28:y,29:v,32:25,33:x,35:b,37:w,38:S,42:T,45:E,48:_,49:A,50:L,51:M,54:N},t(k,[2,5]),{9:38,10:12,11:13,12:14,13:15,16:l,17:u,19:h,22:f,24:d,25:p,26:m,27:g,28:y,29:v,32:25,33:x,35:b,37:w,38:S,42:T,45:E,48:_,49:A,50:L,51:M,54:N},t(k,[2,7]),t(k,[2,8]),t(k,[2,9]),t(k,[2,10]),t(k,[2,11]),t(k,[2,12],{14:[1,39],15:[1,40]}),t(k,[2,16]),{18:[1,41]},t(k,[2,18],{20:[1,42]}),{23:[1,43]},t(k,[2,22]),t(k,[2,23]),t(k,[2,24]),t(k,[2,25]),{30:44,31:[1,45],56:[1,46],57:[1,47]},t(k,[2,28]),{34:[1,48]},{36:[1,49]},t(k,[2,31]),{39:[1,50],41:[1,51]},{43:[1,52]},{46:[1,53]},t(I,[2,42],{55:[1,54]}),t(I,[2,43],{55:[1,55]}),t(k,[2,36]),t(k,[2,37]),t(k,[2,38]),t(k,[2,39]),t(k,[2,6]),t(k,[2,13]),{13:56,24:d,54:N},t(k,[2,17]),t(C,i,{7:57}),{24:[1,58]},{24:[1,59]},{23:[1,60]},{24:[2,46]},{24:[2,47]},t(k,[2,29]),t(k,[2,30]),{40:[1,61]},{40:[1,62]},{44:[1,63]},{47:[1,64]},{24:[1,65]},{24:[1,66]},t(k,[2,14],{14:[1,67]}),{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:u,19:h,21:[1,68],22:f,24:d,25:p,26:m,27:g,28:y,29:v,32:25,33:x,35:b,37:w,38:S,42:T,45:E,48:_,49:A,50:L,51:M,54:N},t(k,[2,20],{20:[1,69]}),{31:[1,70]},{24:[1,71]},t(k,[2,32]),t(k,[2,33]),t(k,[2,34]),t(k,[2,35]),t(I,[2,44]),t(I,[2,45]),t(k,[2,15]),t(k,[2,19]),t(C,i,{7:72}),t(k,[2,26]),t(k,[2,27]),{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:u,19:h,21:[1,73],22:f,24:d,25:p,26:m,27:g,28:y,29:v,32:25,33:x,35:b,37:w,38:S,42:T,45:E,48:_,49:A,50:L,51:M,54:N},t(k,[2,21])],defaultActions:{5:[2,1],6:[2,2],46:[2,46],47:[2,47]},parseError:o(function(B,$){if($.recoverable)this.trace(B);else{var z=new Error(B);throw z.hash=$,z}},"parseError"),parse:o(function(B){var $=this,z=[0],Y=[],Q=[null],X=[],ie=this.table,j="",J=0,Z=0,H=0,q=2,K=1,se=X.slice.call(arguments,1),ce=Object.create(this.lexer),ue={yy:{}};for(var te in this.yy)Object.prototype.hasOwnProperty.call(this.yy,te)&&(ue.yy[te]=this.yy[te]);ce.setInput(B,ue.yy),ue.yy.lexer=ce,ue.yy.parser=this,typeof ce.yylloc>"u"&&(ce.yylloc={});var De=ce.yylloc;X.push(De);var oe=ce.options&&ce.options.ranges;typeof ue.yy.parseError=="function"?this.parseError=ue.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ke(we){z.length=z.length-2*we,Q.length=Q.length-we,X.length=X.length-we}o(ke,"popStack");function Ie(){var we;return we=Y.pop()||ce.lex()||K,typeof we!="number"&&(we instanceof Array&&(Y=we,we=Y.pop()),we=$.symbols_[we]||we),we}o(Ie,"lex");for(var Se,Ue,Pe,_e,me,W,fe={},ge,re,he,ne;;){if(Pe=z[z.length-1],this.defaultActions[Pe]?_e=this.defaultActions[Pe]:((Se===null||typeof Se>"u")&&(Se=Ie()),_e=ie[Pe]&&ie[Pe][Se]),typeof _e>"u"||!_e.length||!_e[0]){var ae="";ne=[];for(ge in ie[Pe])this.terminals_[ge]&&ge>q&&ne.push("'"+this.terminals_[ge]+"'");ce.showPosition?ae="Parse error on line "+(J+1)+`: +`+ce.showPosition()+` +Expecting `+ne.join(", ")+", got '"+(this.terminals_[Se]||Se)+"'":ae="Parse error on line "+(J+1)+": Unexpected "+(Se==K?"end of input":"'"+(this.terminals_[Se]||Se)+"'"),this.parseError(ae,{text:ce.match,token:this.terminals_[Se]||Se,line:ce.yylineno,loc:De,expected:ne})}if(_e[0]instanceof Array&&_e.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Pe+", token: "+Se);switch(_e[0]){case 1:z.push(Se),Q.push(ce.yytext),X.push(ce.yylloc),z.push(_e[1]),Se=null,Ue?(Se=Ue,Ue=null):(Z=ce.yyleng,j=ce.yytext,J=ce.yylineno,De=ce.yylloc,H>0&&H--);break;case 2:if(re=this.productions_[_e[1]][1],fe.$=Q[Q.length-re],fe._$={first_line:X[X.length-(re||1)].first_line,last_line:X[X.length-1].last_line,first_column:X[X.length-(re||1)].first_column,last_column:X[X.length-1].last_column},oe&&(fe._$.range=[X[X.length-(re||1)].range[0],X[X.length-1].range[1]]),W=this.performAction.apply(fe,[j,Z,J,ue.yy,_e[1],Q,X].concat(se)),typeof W<"u")return W;re&&(z=z.slice(0,-1*re*2),Q=Q.slice(0,-1*re),X=X.slice(0,-1*re)),z.push(this.productions_[_e[1]][0]),Q.push(fe.$),X.push(fe._$),he=ie[z[z.length-2]][z[z.length-1]],z.push(he);break;case 3:return!0}}return!0},"parse")},D=function(){var F={EOF:1,parseError:o(function($,z){if(this.yy.parser)this.yy.parser.parseError($,z);else throw new Error($)},"parseError"),setInput:o(function(B,$){return this.yy=$||this.yy||{},this._input=B,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var B=this._input[0];this.yytext+=B,this.yyleng++,this.offset++,this.match+=B,this.matched+=B;var $=B.match(/(?:\r\n?|\n).*/g);return $?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),B},"input"),unput:o(function(B){var $=B.length,z=B.split(/(?:\r\n?|\n)/g);this._input=B+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-$),this.offset-=$;var Y=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),z.length-1&&(this.yylineno-=z.length-1);var Q=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:z?(z.length===Y.length?this.yylloc.first_column:0)+Y[Y.length-z.length].length-z[0].length:this.yylloc.first_column-$},this.options.ranges&&(this.yylloc.range=[Q[0],Q[0]+this.yyleng-$]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(B){this.unput(this.match.slice(B))},"less"),pastInput:o(function(){var B=this.matched.substr(0,this.matched.length-this.match.length);return(B.length>20?"...":"")+B.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var B=this.match;return B.length<20&&(B+=this._input.substr(0,20-B.length)),(B.substr(0,20)+(B.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var B=this.pastInput(),$=new Array(B.length+1).join("-");return B+this.upcomingInput()+` +`+$+"^"},"showPosition"),test_match:o(function(B,$){var z,Y,Q;if(this.options.backtrack_lexer&&(Q={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},this.options.ranges&&(Q.yylloc.range=this.yylloc.range.slice(0))),Y=B[0].match(/(?:\r\n?|\n).*/g),Y&&(this.yylineno+=Y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Y?Y[Y.length-1].length-Y[Y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+B[0].length},this.yytext+=B[0],this.match+=B[0],this.matches=B,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(B[0].length),this.matched+=B[0],z=this.performAction.call(this,this.yy,this,$,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),z)return z;if(this._backtrack){for(var X in Q)this[X]=Q[X];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var B,$,z,Y;this._more||(this.yytext="",this.match="");for(var Q=this._currentRules(),X=0;X$[0].length)){if($=z,Y=X,this.options.backtrack_lexer){if(B=this.test_match(z,Q[X]),B!==!1)return B;if(this._backtrack){$=!1;continue}else return!1}else if(!this.options.flex)break}return $?(B=this.test_match($,Q[Y]),B!==!1?B:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var $=this.next();return $||this.lex()},"lex"),begin:o(function($){this.conditionStack.push($)},"begin"),popState:o(function(){var $=this.conditionStack.length-1;return $>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function($){return $=this.conditionStack.length-1-Math.abs($||0),$>=0?this.conditionStack[$]:"INITIAL"},"topState"),pushState:o(function($){this.begin($)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function($,z,Y,Q){var X=Q;switch(Y){case 0:return 41;case 1:return 48;case 2:return 49;case 3:return 50;case 4:return 51;case 5:break;case 6:break;case 7:return 5;case 8:break;case 9:break;case 10:break;case 11:break;case 12:return this.pushState("SCALE"),17;break;case 13:return 18;case 14:this.popState();break;case 15:return this.begin("acc_title"),33;break;case 16:return this.popState(),"acc_title_value";break;case 17:return this.begin("acc_descr"),35;break;case 18:return this.popState(),"acc_descr_value";break;case 19:this.begin("acc_descr_multiline");break;case 20:this.popState();break;case 21:return"acc_descr_multiline_value";case 22:return this.pushState("CLASSDEF"),38;break;case 23:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";break;case 24:return this.popState(),this.pushState("CLASSDEFID"),39;break;case 25:return this.popState(),40;break;case 26:return this.pushState("CLASS"),45;break;case 27:return this.popState(),this.pushState("CLASS_STYLE"),46;break;case 28:return this.popState(),47;break;case 29:return this.pushState("STYLE"),42;break;case 30:return this.popState(),this.pushState("STYLEDEF_STYLES"),43;break;case 31:return this.popState(),44;break;case 32:return this.pushState("SCALE"),17;break;case 33:return 18;case 34:this.popState();break;case 35:this.pushState("STATE");break;case 36:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),25;break;case 37:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),26;break;case 38:return this.popState(),z.yytext=z.yytext.slice(0,-10).trim(),27;break;case 39:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),25;break;case 40:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),26;break;case 41:return this.popState(),z.yytext=z.yytext.slice(0,-10).trim(),27;break;case 42:return 48;case 43:return 49;case 44:return 50;case 45:return 51;case 46:this.pushState("STATE_STRING");break;case 47:return this.pushState("STATE_ID"),"AS";break;case 48:return this.popState(),"ID";break;case 49:this.popState();break;case 50:return"STATE_DESCR";case 51:return 19;case 52:this.popState();break;case 53:return this.popState(),this.pushState("struct"),20;break;case 54:break;case 55:return this.popState(),21;break;case 56:break;case 57:return this.begin("NOTE"),29;break;case 58:return this.popState(),this.pushState("NOTE_ID"),56;break;case 59:return this.popState(),this.pushState("NOTE_ID"),57;break;case 60:this.popState(),this.pushState("FLOATING_NOTE");break;case 61:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";break;case 62:break;case 63:return"NOTE_TEXT";case 64:return this.popState(),"ID";break;case 65:return this.popState(),this.pushState("NOTE_TEXT"),24;break;case 66:return this.popState(),z.yytext=z.yytext.substr(2).trim(),31;break;case 67:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),31;break;case 68:return 6;case 69:return 6;case 70:return 16;case 71:return 54;case 72:return 24;case 73:return z.yytext=z.yytext.trim(),14;break;case 74:return 15;case 75:return 28;case 76:return 55;case 77:return 5;case 78:return"INVALID"}},"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:!1},struct:{rules:[9,10,22,26,29,35,42,43,44,45,54,55,56,57,71,72,73,74,75],inclusive:!1},FLOATING_NOTE_ID:{rules:[64],inclusive:!1},FLOATING_NOTE:{rules:[61,62,63],inclusive:!1},NOTE_TEXT:{rules:[66,67],inclusive:!1},NOTE_ID:{rules:[65],inclusive:!1},NOTE:{rules:[58,59,60],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[31],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[30],inclusive:!1},CLASS_STYLE:{rules:[28],inclusive:!1},CLASS:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[25],inclusive:!1},CLASSDEF:{rules:[23,24],inclusive:!1},acc_descr_multiline:{rules:[20,21],inclusive:!1},acc_descr:{rules:[18],inclusive:!1},acc_title:{rules:[16],inclusive:!1},SCALE:{rules:[13,14,33,34],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[48],inclusive:!1},STATE_STRING:{rules:[49,50],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[9,10,36,37,38,39,40,41,46,47,51,52,53],inclusive:!1},ID:{rules:[9,10],inclusive:!1},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:!0}}};return F}();O.lexer=D;function P(){this.yy={}}return o(P,"Parser"),P.prototype=O,O.Parser=P,new P}();MO.parser=MO;BE=MO});var hfe,FE,zg,Ex,ffe,dfe,pfe,N0,zE,OO,PO,BO,FO,zO,GE,$E,mfe,gfe,GO,$O,yfe,vfe,Gg,wVe,xfe,VO,TVe,kVe,bfe,wfe,EVe,Tfe,CVe,kfe,UO,HO,Efe,VE,Cfe,YO,UE=R(()=>{"use strict";hfe="LR",FE="TB",zg="state",Ex="relation",ffe="classDef",dfe="style",pfe="applyClass",N0="default",zE="divider",OO="fill:none",PO="fill: #333",BO="c",FO="text",zO="normal",GE="rect",$E="rectWithTitle",mfe="stateStart",gfe="stateEnd",GO="divider",$O="roundedWithTitle",yfe="note",vfe="noteGroup",Gg="statediagram",wVe="state",xfe=`${Gg}-${wVe}`,VO="transition",TVe="note",kVe="note-edge",bfe=`${VO} ${kVe}`,wfe=`${Gg}-${TVe}`,EVe="cluster",Tfe=`${Gg}-${EVe}`,CVe="cluster-alt",kfe=`${Gg}-${CVe}`,UO="parent",HO="note",Efe="state",VE="----",Cfe=`${VE}${HO}`,YO=`${VE}${UO}`});function WO(t="",e=0,r="",n=VE){let i=r!==null&&r.length>0?`${n}${r}`:"";return`${Efe}-${t}${i}-${e}`}function HE(t,e,r){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{if(r.get(i)){let a=r.get(i);e.cssCompiledStyles=[...e.cssCompiledStyles,...a.styles]}}));let n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}function AVe(t){return t?.classes?.join(" ")??""}function _Ve(t){return t?.styles??[]}var YE,yf,SVe,Sfe,$g,Afe,_fe=R(()=>{"use strict";_t();ut();rr();UE();YE=new Map,yf=0;o(WO,"stateDomId");SVe=o((t,e,r,n,i,a,s,l)=>{V.trace("items",e),e.forEach(u=>{switch(u.stmt){case zg:$g(t,u,r,n,i,a,s,l);break;case N0:$g(t,u,r,n,i,a,s,l);break;case Ex:{$g(t,u.state1,r,n,i,a,s,l),$g(t,u.state2,r,n,i,a,s,l);let h={id:"edge"+yf,start:u.state1.id,end:u.state2.id,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:OO,labelStyle:"",label:We.sanitizeText(u.description,de()),arrowheadStyle:PO,labelpos:BO,labelType:FO,thickness:zO,classes:VO,look:s};i.push(h),yf++}break}})},"setupDoc"),Sfe=o((t,e=FE)=>{let r=e;if(t.doc)for(let n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");o(HE,"insertOrUpdateNode");o(AVe,"getClassesFromDbInfo");o(_Ve,"getStylesFromDbInfo");$g=o((t,e,r,n,i,a,s,l)=>{let u=e.id,h=r.get(u),f=AVe(h),d=_Ve(h);if(V.info("dataFetcher parsedItem",e,h,d),u!=="root"){let p=GE;e.start===!0?p=mfe:e.start===!1&&(p=gfe),e.type!==N0&&(p=e.type),YE.get(u)||YE.set(u,{id:u,shape:p,description:We.sanitizeText(u,de()),cssClasses:`${f} ${xfe}`,cssStyles:d});let m=YE.get(u);e.description&&(Array.isArray(m.description)?(m.shape=$E,m.description.push(e.description)):m.description?.length>0?(m.shape=$E,m.description===u?m.description=[e.description]:m.description=[m.description,e.description]):(m.shape=GE,m.description=e.description),m.description=We.sanitizeTextOrArray(m.description,de())),m.description?.length===1&&m.shape===$E&&(m.type==="group"?m.shape=$O:m.shape=GE),!m.type&&e.doc&&(V.info("Setting cluster for XCX",u,Sfe(e)),m.type="group",m.isGroup=!0,m.dir=Sfe(e),m.shape=e.type===zE?GO:$O,m.cssClasses=`${m.cssClasses} ${Tfe} ${a?kfe:""}`);let g={labelStyle:"",shape:m.shape,label:m.description,cssClasses:m.cssClasses,cssCompiledStyles:[],cssStyles:m.cssStyles,id:u,dir:m.dir,domId:WO(u,yf),type:m.type,isGroup:m.type==="group",padding:8,rx:10,ry:10,look:s};if(g.shape===GO&&(g.label=""),t&&t.id!=="root"&&(V.trace("Setting node ",u," to be child of its parent ",t.id),g.parentId=t.id),g.centerLabel=!0,e.note){let y={labelStyle:"",shape:yfe,label:e.note.text,cssClasses:wfe,cssStyles:[],cssCompilesStyles:[],id:u+Cfe+"-"+yf,domId:WO(u,yf,HO),type:m.type,isGroup:m.type==="group",padding:de().flowchart.padding,look:s,position:e.note.position},v=u+YO,x={labelStyle:"",shape:vfe,label:e.note.text,cssClasses:m.cssClasses,cssStyles:[],id:u+YO,domId:WO(u,yf,UO),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};yf++,x.id=v,y.parentId=v,HE(n,x,l),HE(n,y,l),HE(n,g,l);let b=u,w=y.id;e.note.position==="left of"&&(b=y.id,w=u),i.push({id:b+"-"+w,start:b,end:w,arrowhead:"none",arrowTypeEnd:"",style:OO,labelStyle:"",classes:bfe,arrowheadStyle:PO,labelpos:BO,labelType:FO,thickness:zO,look:s})}else HE(n,g,l)}e.doc&&(V.trace("Adding nodes children "),SVe(e,e.doc,r,n,i,!a,s,l))},"dataFetcher"),Afe=o(()=>{YE.clear(),yf=0},"reset")});var qO,LVe,DVe,Lfe,XO=R(()=>{"use strict";_t();ut();L9();oT();yD();xr();UE();qO=o((t,e=FE)=>{if(!t.doc)return e;let r=e;for(let n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),LVe=o(function(t,e){return e.db.extract(e.db.getRootDocV2()),e.db.getClasses()},"getClasses"),DVe=o(async function(t,e,r,n){V.info("REF0:"),V.info("Drawing state diagram (v2)",e);let{securityLevel:i,state:a,layout:s}=de();n.db.extract(n.db.getRootDocV2());let l=n.db.getData(),u=I5(e,i);l.type=n.type,l.layoutAlgorithm=s,l.nodeSpacing=a?.nodeSpacing||50,l.rankSpacing=a?.rankSpacing||50,l.markers=["barb"],l.diagramId=e,await sT(l,u);let h=8;Lt.insertTitle(u,"statediagramTitleText",a?.titleTopMargin??25,n.db.getDiagramTitle()),lT(u,h,Gg,a?.useMaxWidth??!0)},"draw"),Lfe={getClasses:LVe,draw:DVe,getDir:qO}});function Pfe(){return new Map}function jO(t=""){let e=t;return t===ZO&&(Cx++,e=`${Mfe}${Cx}`),e}function KO(t="",e=N0){return t===ZO?Mfe:e}function GVe(t=""){let e=t;return t===Ife&&(Cx++,e=`${Ofe}${Cx}`),e}function $Ve(t="",e=N0){return t===Ife?Ofe:e}function VVe(t,e,r){let n=jO(t.id.trim()),i=KO(t.id.trim(),t.type),a=jO(e.id.trim()),s=KO(e.id.trim(),e.type);vf(n,i,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),vf(a,s,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),Fs.relations.push({id1:n,id2:a,relationTitle:We.sanitizeText(r,de())})}var ZO,Mfe,Ife,Ofe,Dfe,Rfe,RVe,NVe,XE,JO,Bfe,jE,Vg,Ffe,KE,Fs,Cx,Nfe,MVe,IVe,WE,OVe,PVe,qE,eP,BVe,vf,zfe,M0,Gfe,FVe,zVe,$fe,QO,UVe,HVe,Vfe,YVe,tP,WVe,qVe,XVe,jVe,KVe,QVe,Qo,QE=R(()=>{"use strict";ut();xr();rr();_t();bi();_fe();XO();UE();ZO="[*]",Mfe="start",Ife=ZO,Ofe="end",Dfe="color",Rfe="fill",RVe="bgFill",NVe=",";o(Pfe,"newClassesList");XE=[],JO=[],Bfe=hfe,jE=[],Vg=Pfe(),Ffe=o(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),KE={root:Ffe()},Fs=KE.root,Cx=0,Nfe=0,MVe={LINE:0,DOTTED_LINE:1},IVe={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},WE=o(t=>JSON.parse(JSON.stringify(t)),"clone"),OVe=o(t=>{V.info("Setting root doc",t),jE=t},"setRootDoc"),PVe=o(()=>jE,"getRootDoc"),qE=o((t,e,r)=>{if(e.stmt===Ex)qE(t,e.state1,!0),qE(t,e.state2,!1);else if(e.stmt===zg&&(e.id==="[*]"?(e.id=r?t.id+"_start":t.id+"_end",e.start=r):e.id=e.id.trim()),e.doc){let n=[],i=[],a;for(a=0;a0&&i.length>0){let s={stmt:zg,id:Z_(),type:"divider",doc:WE(i)};n.push(WE(s)),e.doc=n}e.doc.forEach(s=>qE(e,s,!0))}},"docTranslator"),eP=o(()=>(qE({id:"root"},{id:"root",doc:jE},!0),{id:"root",doc:jE}),"getRootDocV2"),BVe=o(t=>{let e;t.doc?e=t.doc:e=t,V.info(e),zfe(!0),V.info("Extract initial document:",e),e.forEach(a=>{switch(V.warn("Statement",a.stmt),a.stmt){case zg:vf(a.id.trim(),a.type,a.doc,a.description,a.note,a.classes,a.styles,a.textStyles);break;case Ex:$fe(a.state1,a.state2,a.description);break;case ffe:Vfe(a.id.trim(),a.classes);break;case dfe:{let s=a.id.trim().split(","),l=a.styleClass.split(",");s.forEach(u=>{let h=M0(u);if(h===void 0){let f=u.trim();vf(f),h=M0(f)}h.styles=l.map(f=>f.replace(/;/g,"")?.trim())})}break;case pfe:tP(a.id.trim(),a.styleClass);break}});let r=Gfe(),i=de().look;Afe(),$g(void 0,eP(),r,XE,JO,!0,i,Vg),XE.forEach(a=>{if(Array.isArray(a.label)){if(a.description=a.label.slice(1),a.isGroup&&a.description.length>0)throw new Error("Group nodes can only have label. Remove the additional description for node ["+a.id+"]");a.label=a.label[0]}})},"extract"),vf=o(function(t,e=N0,r=null,n=null,i=null,a=null,s=null,l=null){let u=t?.trim();if(Fs.states.has(u)?(Fs.states.get(u).doc||(Fs.states.get(u).doc=r),Fs.states.get(u).type||(Fs.states.get(u).type=e)):(V.info("Adding state ",u,n),Fs.states.set(u,{id:u,descriptions:[],type:e,doc:r,note:i,classes:[],styles:[],textStyles:[]})),n&&(V.info("Setting state description",u,n),typeof n=="string"&&QO(u,n.trim()),typeof n=="object"&&n.forEach(h=>QO(u,h.trim()))),i){let h=Fs.states.get(u);h.note=i,h.note.text=We.sanitizeText(h.note.text,de())}a&&(V.info("Setting state classes",u,a),(typeof a=="string"?[a]:a).forEach(f=>tP(u,f.trim()))),s&&(V.info("Setting state styles",u,s),(typeof s=="string"?[s]:s).forEach(f=>WVe(u,f.trim()))),l&&(V.info("Setting state styles",u,s),(typeof l=="string"?[l]:l).forEach(f=>qVe(u,f.trim())))},"addState"),zfe=o(function(t){XE=[],JO=[],KE={root:Ffe()},Fs=KE.root,Cx=0,Vg=Pfe(),t||vr()},"clear"),M0=o(function(t){return Fs.states.get(t)},"getState"),Gfe=o(function(){return Fs.states},"getStates"),FVe=o(function(){V.info("Documents = ",KE)},"logDocuments"),zVe=o(function(){return Fs.relations},"getRelations");o(jO,"startIdIfNeeded");o(KO,"startTypeIfNeeded");o(GVe,"endIdIfNeeded");o($Ve,"endTypeIfNeeded");o(VVe,"addRelationObjs");$fe=o(function(t,e,r){if(typeof t=="object")VVe(t,e,r);else{let n=jO(t.trim()),i=KO(t),a=GVe(e.trim()),s=$Ve(e);vf(n,i),vf(a,s),Fs.relations.push({id1:n,id2:a,title:We.sanitizeText(r,de())})}},"addRelation"),QO=o(function(t,e){let r=Fs.states.get(t),n=e.startsWith(":")?e.replace(":","").trim():e;r.descriptions.push(We.sanitizeText(n,de()))},"addDescription"),UVe=o(function(t){return t.substring(0,1)===":"?t.substr(2).trim():t.trim()},"cleanupLabel"),HVe=o(()=>(Nfe++,"divider-id-"+Nfe),"getDividerId"),Vfe=o(function(t,e=""){Vg.has(t)||Vg.set(t,{id:t,styles:[],textStyles:[]});let r=Vg.get(t);e?.split(NVe).forEach(n=>{let i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(Dfe).exec(n)){let s=i.replace(Rfe,RVe).replace(Dfe,Rfe);r.textStyles.push(s)}r.styles.push(i)})},"addStyleClass"),YVe=o(function(){return Vg},"getClasses"),tP=o(function(t,e){t.split(",").forEach(function(r){let n=M0(r);if(n===void 0){let i=r.trim();vf(i),n=M0(i)}n.classes.push(e)})},"setCssClass"),WVe=o(function(t,e){let r=M0(t);r!==void 0&&r.styles.push(e)},"setStyle"),qVe=o(function(t,e){let r=M0(t);r!==void 0&&r.textStyles.push(e)},"setTextStyle"),XVe=o(()=>Bfe,"getDirection"),jVe=o(t=>{Bfe=t},"setDirection"),KVe=o(t=>t&&t[0]===":"?t.substr(1).trim():t.trim(),"trimColon"),QVe=o(()=>{let t=de();return{nodes:XE,edges:JO,other:{},config:t,direction:qO(eP())}},"getData"),Qo={getConfig:o(()=>de().state,"getConfig"),getData:QVe,addState:vf,clear:zfe,getState:M0,getStates:Gfe,getRelations:zVe,getClasses:YVe,getDirection:XVe,addRelation:$fe,getDividerId:HVe,setDirection:jVe,cleanupLabel:UVe,lineType:MVe,relationType:IVe,logDocuments:FVe,getRootDoc:PVe,setRootDoc:OVe,getRootDocV2:eP,extract:BVe,trimColon:KVe,getAccTitle:Ar,setAccTitle:kr,getAccDescription:Lr,setAccDescription:_r,addStyleClass:Vfe,setCssClass:tP,addDescription:QO,setDiagramTitle:nn,getDiagramTitle:Xr}});var ZVe,ZE,rP=R(()=>{"use strict";ZVe=o(t=>` defs #statediagram-barbEnd { - fill: ${i.transitionColor}; - stroke: ${i.transitionColor}; + fill: ${t.transitionColor}; + stroke: ${t.transitionColor}; } g.stateGroup text { - fill: ${i.nodeBorder}; + fill: ${t.nodeBorder}; stroke: none; font-size: 10px; } g.stateGroup text { - fill: ${i.textColor}; + fill: ${t.textColor}; stroke: none; font-size: 10px; } g.stateGroup .state-title { font-weight: bolder; - fill: ${i.stateLabelColor}; + fill: ${t.stateLabelColor}; } g.stateGroup rect { - fill: ${i.mainBkg}; - stroke: ${i.nodeBorder}; + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; } g.stateGroup line { - stroke: ${i.lineColor}; + stroke: ${t.lineColor}; stroke-width: 1; } .transition { - stroke: ${i.transitionColor}; + stroke: ${t.transitionColor}; stroke-width: 1; fill: none; } .stateGroup .composit { - fill: ${i.background}; + fill: ${t.background}; border-bottom: 1px } @@ -1019,11 +1458,11 @@ g.stateGroup line { } .state-note { - stroke: ${i.noteBorderColor}; - fill: ${i.noteBkgColor}; + stroke: ${t.noteBorderColor}; + fill: ${t.noteBkgColor}; text { - fill: ${i.noteTextColor}; + fill: ${t.noteTextColor}; stroke: none; font-size: 10px; } @@ -1032,70 +1471,83 @@ g.stateGroup line { .stateLabel .box { stroke: none; stroke-width: 0; - fill: ${i.mainBkg}; + fill: ${t.mainBkg}; opacity: 0.5; } .edgeLabel .label rect { - fill: ${i.labelBackgroundColor}; + fill: ${t.labelBackgroundColor}; opacity: 0.5; } +.edgeLabel { + background-color: ${t.edgeLabelBackground}; + p { + background-color: ${t.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${t.edgeLabelBackground}; + fill: ${t.edgeLabelBackground}; + } + text-align: center; +} .edgeLabel .label text { - fill: ${i.transitionLabelColor||i.tertiaryTextColor}; + fill: ${t.transitionLabelColor||t.tertiaryTextColor}; } .label div .edgeLabel { - color: ${i.transitionLabelColor||i.tertiaryTextColor}; + color: ${t.transitionLabelColor||t.tertiaryTextColor}; } .stateLabel text { - fill: ${i.stateLabelColor}; + fill: ${t.stateLabelColor}; font-size: 10px; font-weight: bold; } .node circle.state-start { - fill: ${i.specialStateColor}; - stroke: ${i.specialStateColor}; + fill: ${t.specialStateColor}; + stroke: ${t.specialStateColor}; } .node .fork-join { - fill: ${i.specialStateColor}; - stroke: ${i.specialStateColor}; + fill: ${t.specialStateColor}; + stroke: ${t.specialStateColor}; } .node circle.state-end { - fill: ${i.innerEndBackground}; - stroke: ${i.background}; + fill: ${t.innerEndBackground}; + stroke: ${t.background}; stroke-width: 1.5 } .end-state-inner { - fill: ${i.compositeBackground||i.background}; - // stroke: ${i.background}; + fill: ${t.compositeBackground||t.background}; + // stroke: ${t.background}; stroke-width: 1.5 } .node rect { - fill: ${i.stateBkg||i.mainBkg}; - stroke: ${i.stateBorder||i.nodeBorder}; + fill: ${t.stateBkg||t.mainBkg}; + stroke: ${t.stateBorder||t.nodeBorder}; stroke-width: 1px; } .node polygon { - fill: ${i.mainBkg}; - stroke: ${i.stateBorder||i.nodeBorder};; + fill: ${t.mainBkg}; + stroke: ${t.stateBorder||t.nodeBorder};; stroke-width: 1px; } #statediagram-barbEnd { - fill: ${i.lineColor}; + fill: ${t.lineColor}; } .statediagram-cluster rect { - fill: ${i.compositeTitleBackground}; - stroke: ${i.stateBorder||i.nodeBorder}; + fill: ${t.compositeTitleBackground}; + stroke: ${t.stateBorder||t.nodeBorder}; stroke-width: 1px; } .cluster-label, .nodeLabel { - color: ${i.stateLabelColor}; + color: ${t.stateLabelColor}; + // line-height: 1; } .statediagram-cluster rect.outer { @@ -1103,7 +1555,7 @@ g.stateGroup line { ry: 5px; } .statediagram-state .divider { - stroke: ${i.stateBorder||i.nodeBorder}; + stroke: ${t.stateBorder||t.nodeBorder}; } .statediagram-state .title-state { @@ -1111,10 +1563,10 @@ g.stateGroup line { ry: 5px; } .statediagram-cluster.statediagram-cluster .inner { - fill: ${i.compositeBackground||i.background}; + fill: ${t.compositeBackground||t.background}; } .statediagram-cluster.statediagram-cluster-alt .inner { - fill: ${i.altBackground?i.altBackground:"#efefef"}; + fill: ${t.altBackground?t.altBackground:"#efefef"}; } .statediagram-cluster .inner { @@ -1128,7 +1580,7 @@ g.stateGroup line { } .statediagram-state rect.divider { stroke-dasharray: 10,10; - fill: ${i.altBackground?i.altBackground:"#efefef"}; + fill: ${t.altBackground?t.altBackground:"#efefef"}; } .note-edge { @@ -1136,73 +1588,73 @@ g.stateGroup line { } .statediagram-note rect { - fill: ${i.noteBkgColor}; - stroke: ${i.noteBorderColor}; + fill: ${t.noteBkgColor}; + stroke: ${t.noteBorderColor}; stroke-width: 1px; rx: 0; ry: 0; } .statediagram-note rect { - fill: ${i.noteBkgColor}; - stroke: ${i.noteBorderColor}; + fill: ${t.noteBkgColor}; + stroke: ${t.noteBorderColor}; stroke-width: 1px; rx: 0; ry: 0; } .statediagram-note text { - fill: ${i.noteTextColor}; + fill: ${t.noteTextColor}; } .statediagram-note .nodeLabel { - color: ${i.noteTextColor}; + color: ${t.noteTextColor}; } .statediagram .edgeLabel { - color: red; // ${i.noteTextColor}; + color: red; // ${t.noteTextColor}; } #dependencyStart, #dependencyEnd { - fill: ${i.lineColor}; - stroke: ${i.lineColor}; + fill: ${t.lineColor}; + stroke: ${t.lineColor}; stroke-width: 1; } .statediagramTitleText { text-anchor: middle; font-size: 18px; - fill: ${i.textColor}; -} -`,yge={},jzt=(i,a)=>{yge[i]=a},$zt=i=>yge[i],yFe=()=>Object.keys(yge),Hzt={get:$zt,set:jzt,keys:yFe,size:()=>yFe().length},zzt=i=>i.append("circle").attr("class","start-state").attr("r",Tt().state.sizeUnit).attr("cx",Tt().state.padding+Tt().state.sizeUnit).attr("cy",Tt().state.padding+Tt().state.sizeUnit),Gzt=i=>i.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Tt().state.textHeight).attr("class","divider").attr("x2",Tt().state.textHeight*2).attr("y1",0).attr("y2",0),qzt=(i,a)=>{const f=i.append("text").attr("x",2*Tt().state.padding).attr("y",Tt().state.textHeight+2*Tt().state.padding).attr("font-size",Tt().state.fontSize).attr("class","state-title").text(a.id),p=f.node().getBBox();return i.insert("rect",":first-child").attr("x",Tt().state.padding).attr("y",Tt().state.padding).attr("width",p.width+2*Tt().state.padding).attr("height",p.height+2*Tt().state.padding).attr("rx",Tt().state.radius),f},Vzt=(i,a)=>{const f=function(j,$,V){const Q=j.append("tspan").attr("x",2*Tt().state.padding).text($);V||Q.attr("dy",Tt().state.textHeight)},w=i.append("text").attr("x",2*Tt().state.padding).attr("y",Tt().state.textHeight+1.3*Tt().state.padding).attr("font-size",Tt().state.fontSize).attr("class","state-title").text(a.descriptions[0]).node().getBBox(),y=w.height,b=i.append("text").attr("x",Tt().state.padding).attr("y",y+Tt().state.padding*.4+Tt().state.dividerMargin+Tt().state.textHeight).attr("class","state-description");let E=!0,S=!0;a.descriptions.forEach(function(j){E||(f(b,j,S),S=!1),E=!1});const N=i.append("line").attr("x1",Tt().state.padding).attr("y1",Tt().state.padding+y+Tt().state.dividerMargin/2).attr("y2",Tt().state.padding+y+Tt().state.dividerMargin/2).attr("class","descr-divider"),B=b.node().getBBox(),R=Math.max(B.width,w.width);return N.attr("x2",R+3*Tt().state.padding),i.insert("rect",":first-child").attr("x",Tt().state.padding).attr("y",Tt().state.padding).attr("width",R+2*Tt().state.padding).attr("height",B.height+y+2*Tt().state.padding).attr("rx",Tt().state.radius),i},Uzt=(i,a,f)=>{const p=Tt().state.padding,w=2*Tt().state.padding,y=i.node().getBBox(),b=y.width,E=y.x,S=i.append("text").attr("x",0).attr("y",Tt().state.titleShift).attr("font-size",Tt().state.fontSize).attr("class","state-title").text(a.id),B=S.node().getBBox().width+w;let R=Math.max(B,b);R===b&&(R=R+w);let j;const $=i.node().getBBox();a.doc,j=E-p,B>b&&(j=(b-R)/2+p),Math.abs(E-$.x)b&&(j=E-(B-b)/2);const V=1-Tt().state.textHeight;return i.insert("rect",":first-child").attr("x",j).attr("y",V).attr("class",f?"alt-composit":"composit").attr("width",R).attr("height",$.height+Tt().state.textHeight+Tt().state.titleShift+1).attr("rx","0"),S.attr("x",j+p),B<=b&&S.attr("x",E+(R-w)/2-B/2+p),i.insert("rect",":first-child").attr("x",j).attr("y",Tt().state.titleShift-Tt().state.textHeight-Tt().state.padding).attr("width",R).attr("height",Tt().state.textHeight*3).attr("rx",Tt().state.radius),i.insert("rect",":first-child").attr("x",j).attr("y",Tt().state.titleShift-Tt().state.textHeight-Tt().state.padding).attr("width",R).attr("height",$.height+3+2*Tt().state.textHeight).attr("rx",Tt().state.radius),i},Wzt=i=>(i.append("circle").attr("class","end-state-outer").attr("r",Tt().state.sizeUnit+Tt().state.miniPadding).attr("cx",Tt().state.padding+Tt().state.sizeUnit+Tt().state.miniPadding).attr("cy",Tt().state.padding+Tt().state.sizeUnit+Tt().state.miniPadding),i.append("circle").attr("class","end-state-inner").attr("r",Tt().state.sizeUnit).attr("cx",Tt().state.padding+Tt().state.sizeUnit+2).attr("cy",Tt().state.padding+Tt().state.sizeUnit+2)),Kzt=(i,a)=>{let f=Tt().state.forkWidth,p=Tt().state.forkHeight;if(a.parentId){let w=f;f=p,p=w}return i.append("rect").style("stroke","black").style("fill","black").attr("width",f).attr("height",p).attr("x",Tt().state.padding).attr("y",Tt().state.padding)},Yzt=(i,a,f,p)=>{let w=0;const y=p.append("text");y.style("text-anchor","start"),y.attr("class","noteText");let b=i.replace(/\r\n/g,"
    ");b=b.replace(/\n/g,"
    ");const E=b.split(Wa.lineBreakRegex);let S=1.25*Tt().state.noteMargin;for(const N of E){const B=N.trim();if(B.length>0){const R=y.append("tspan");if(R.text(B),S===0){const j=R.node().getBBox();S+=j.height}w+=S,R.attr("x",a+Tt().state.noteMargin),R.attr("y",f+w+1.25*Tt().state.noteMargin)}}return{textWidth:y.node().getBBox().width,textHeight:w}},Xzt=(i,a)=>{a.attr("class","state-note");const f=a.append("rect").attr("x",0).attr("y",Tt().state.padding),p=a.append("g"),{textWidth:w,textHeight:y}=Yzt(i,0,0,p);return f.attr("height",y+2*Tt().state.noteMargin),f.attr("width",w+Tt().state.noteMargin*2),f},kFe=function(i,a){const f=a.id,p={id:f,label:a.id,width:0,height:0},w=i.append("g").attr("id",f).attr("class","stateGroup");a.type==="start"&&zzt(w),a.type==="end"&&Wzt(w),(a.type==="fork"||a.type==="join")&&Kzt(w,a),a.type==="note"&&Xzt(a.note.text,w),a.type==="divider"&&Gzt(w),a.type==="default"&&a.descriptions.length===0&&qzt(w,a),a.type==="default"&&a.descriptions.length>0&&Vzt(w,a);const y=w.node().getBBox();return p.width=y.width+2*Tt().state.padding,p.height=y.height+2*Tt().state.padding,Hzt.set(f,p),p};let xFe=0;const Qzt=function(i,a,f){const p=function(S){switch(S){case D5.relationType.AGGREGATION:return"aggregation";case D5.relationType.EXTENSION:return"extension";case D5.relationType.COMPOSITION:return"composition";case D5.relationType.DEPENDENCY:return"dependency"}};a.points=a.points.filter(S=>!Number.isNaN(S.y));const w=a.points,y=WE().x(function(S){return S.x}).y(function(S){return S.y}).curve(SA),b=i.append("path").attr("d",y(w)).attr("id","edge"+xFe).attr("class","transition");let E="";if(Tt().state.arrowMarkerAbsolute&&(E=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,E=E.replace(/\(/g,"\\("),E=E.replace(/\)/g,"\\)")),b.attr("marker-end","url("+E+"#"+p(D5.relationType.DEPENDENCY)+"End)"),f.title!==void 0){const S=i.append("g").attr("class","stateLabel"),{x:N,y:B}=co.calcLabelPosition(a.points),R=Wa.getRows(f.title);let j=0;const $=[];let V=0,Q=0;for(let se=0;se<=R.length;se++){const ge=S.append("text").attr("text-anchor","middle").text(R[se]).attr("x",N).attr("y",B+j),ye=ge.node().getBBox();V=Math.max(V,ye.width),Q=Math.min(Q,ye.x),Fe.info(ye.x,N,B+j),j===0&&(j=ge.node().getBBox().height,Fe.info("Title height",j,B)),$.push(ge)}let oe=j*R.length;if(R.length>1){const se=(R.length-1)*j*.5;$.forEach((ge,ye)=>ge.attr("y",B+ye*j-se)),oe=j*R.length}const ce=S.node().getBBox();S.insert("rect",":first-child").attr("class","box").attr("x",N-V/2-Tt().state.padding/2).attr("y",B-oe/2-Tt().state.padding/2-3.5).attr("width",V+Tt().state.padding).attr("height",oe+Tt().state.padding),Fe.info(ce)}xFe++};let B2;const kge={},Zzt=function(){},Jzt=function(i){i.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")},eGt=function(i,a,f,p){B2=Tt().state;const w=Tt().securityLevel;let y;w==="sandbox"&&(y=Cr("#i"+a));const b=Cr(w==="sandbox"?y.nodes()[0].contentDocument.body:"body"),E=w==="sandbox"?y.nodes()[0].contentDocument:document;Fe.debug("Rendering diagram "+i);const S=b.select(`[id='${a}']`);Jzt(S),new zf({multigraph:!0,compound:!0,rankdir:"RL"}).setDefaultEdgeLabel(function(){return{}});const B=p.db.getRootDoc();EFe(B,S,void 0,!1,b,E,p);const R=B2.padding,j=S.node().getBBox(),$=j.width+R*2,V=j.height+R*2,Q=$*1.75;Vw(S,V,Q,B2.useMaxWidth),S.attr("viewBox",`${j.x-B2.padding} ${j.y-B2.padding} `+$+" "+V)},tGt=i=>i?i.length*B2.fontSizeFactor:1,EFe=(i,a,f,p,w,y,b)=>{const E=new zf({compound:!0,multigraph:!0});let S,N=!0;for(S=0;S{const ye=ge.parentElement;let ke=0,Ae=0;ye&&(ye.parentElement&&(ke=ye.parentElement.getBBox().width),Ae=parseInt(ye.getAttribute("data-x-shift"),10),Number.isNaN(Ae)&&(Ae=0)),ge.setAttribute("x1",0-Ae+8),ge.setAttribute("x2",ke-Ae-8)})):Fe.debug("No Node "+ce+": "+JSON.stringify(E.node(ce)))});let Q=V.getBBox();E.edges().forEach(function(ce){ce!==void 0&&E.edge(ce)!==void 0&&(Fe.debug("Edge "+ce.v+" -> "+ce.w+": "+JSON.stringify(E.edge(ce))),Qzt(a,E.edge(ce),E.edge(ce).relation))}),Q=V.getBBox();const oe={id:f||"root",label:f||"root",width:0,height:0};return oe.width=Q.width+2*B2.padding,oe.height=Q.height+2*B2.padding,Fe.debug("Doc rendered",oe,E),oe},nGt=Object.freeze(Object.defineProperty({__proto__:null,diagram:{parser:sFe,db:D5,renderer:{setConf:Zzt,draw:eGt},styles:mFe,init:i=>{i.state||(i.state={}),i.state.arrowMarkerAbsolute=i.arrowMarkerAbsolute,D5.clear()}}},Symbol.toStringTag,{value:"Module"})),zK="rect",xge="rectWithTitle",rGt="start",iGt="end",sGt="divider",aGt="roundedWithTitle",oGt="note",cGt="noteGroup",fL="statediagram",uGt=`${fL}-state`,TFe="transition",lGt="note",hGt=`${TFe} note-edge`,fGt=`${fL}-${lGt}`,dGt=`${fL}-cluster`,gGt=`${fL}-cluster-alt`,_Fe="parent",CFe="note",pGt="state",Ege="----",bGt=`${Ege}${CFe}`,SFe=`${Ege}${_Fe}`,AFe="fill:none",LFe="fill: #333",MFe="c",DFe="text",IFe="normal";let GK={},ux=0;const vGt=function(i){const a=Object.keys(i);for(const f of a)i[f]},wGt=function(i,a){Fe.trace("Extracting classes"),a.db.clear();try{return a.parser.parse(i),a.db.extract(a.db.getRootDocV2()),a.db.getClasses()}catch(f){return f}};function mGt(i){return i==null?"":i.classes?i.classes.join(" "):""}function Tge(i="",a=0,f="",p=Ege){const w=f!==null&&f.length>0?`${p}${f}`:"";return`${pGt}-${i}${w}-${a}`}const FP=(i,a,f,p,w,y)=>{const b=f.id,E=mGt(p[b]);if(b!=="root"){let S=zK;f.start===!0&&(S=rGt),f.start===!1&&(S=iGt),f.type!==NP&&(S=f.type),GK[b]||(GK[b]={id:b,shape:S,description:Wa.sanitizeText(b,Tt()),classes:`${E} ${uGt}`});const N=GK[b];f.description&&(Array.isArray(N.description)?(N.shape=xge,N.description.push(f.description)):N.description.length>0?(N.shape=xge,N.description===b?N.description=[f.description]:N.description=[N.description,f.description]):(N.shape=zK,N.description=f.description),N.description=Wa.sanitizeTextOrArray(N.description,Tt())),N.description.length===1&&N.shape===xge&&(N.shape=zK),!N.type&&f.doc&&(Fe.info("Setting cluster for ",b,_ge(f)),N.type="group",N.dir=_ge(f),N.shape=f.type===aFe?sGt:aGt,N.classes=N.classes+" "+dGt+" "+(y?gGt:""));const B={labelStyle:"",shape:N.shape,labelText:N.description,classes:N.classes,style:"",id:b,dir:N.dir,domId:Tge(b,ux),type:N.type,padding:15};if(B.centerLabel=!0,f.note){const R={labelStyle:"",shape:oGt,labelText:f.note.text,classes:fGt,style:"",id:b+bGt+"-"+ux,domId:Tge(b,ux,CFe),type:N.type,padding:15},j={labelStyle:"",shape:cGt,labelText:f.note.text,classes:N.classes,style:"",id:b+SFe,domId:Tge(b,ux,_Fe),type:"group",padding:0};ux++;const $=b+SFe;i.setNode($,j),i.setNode(R.id,R),i.setNode(b,B),i.setParent(b,$),i.setParent(R.id,$);let V=b,Q=R.id;f.note.position==="left of"&&(V=R.id,Q=b),i.setEdge(V,Q,{arrowhead:"none",arrowType:"",style:AFe,labelStyle:"",classes:hGt,arrowheadStyle:LFe,labelpos:MFe,labelType:DFe,thickness:IFe})}else i.setNode(b,B)}a&&a.id!=="root"&&(Fe.trace("Setting node ",b," to be child of its parent ",a.id),i.setParent(b,a.id)),f.doc&&(Fe.trace("Adding nodes children "),yGt(i,f,f.doc,p,w,!y))},yGt=(i,a,f,p,w,y)=>{Fe.trace("items",f),f.forEach(b=>{switch(b.stmt){case RK:FP(i,a,b,p,w,y);break;case NP:FP(i,a,b,p,w,y);break;case gge:{FP(i,a,b.state1,p,w,y),FP(i,a,b.state2,p,w,y);const E={id:"edge"+ux,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:AFe,labelStyle:"",label:Wa.sanitizeText(b.description,Tt()),arrowheadStyle:LFe,labelpos:MFe,labelType:DFe,thickness:IFe,classes:TFe};i.setEdge(b.state1.id,b.state2.id,E,ux),ux++}break}})},_ge=(i,a=bzt)=>{let f=a;if(i.doc)for(let p=0;p{i.state||(i.state={}),i.state.arrowMarkerAbsolute=i.arrowMarkerAbsolute,D5.clear()}}},Symbol.toStringTag,{value:"Module"}));var Cge=function(){var i=function(Q,oe,ce,se){for(ce=ce||{},se=Q.length;se--;ce[Q[se]]=oe);return ce},a=[1,2],f=[1,5],p=[6,9,11,17,18,20,22,23,24,26],w=[1,15],y=[1,16],b=[1,17],E=[1,18],S=[1,19],N=[1,20],B=[1,24],R=[4,6,9,11,17,18,20,22,23,24,26],j={trace:function(){},yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,directive:7,line:8,SPACE:9,statement:10,NEWLINE:11,openDirective:12,typeDirective:13,closeDirective:14,":":15,argDirective:16,title:17,acc_title:18,acc_title_value:19,acc_descr:20,acc_descr_value:21,acc_descr_multiline_value:22,section:23,taskName:24,taskData:25,open_directive:26,type_directive:27,arg_directive:28,close_directive:29,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",17:"title",18:"acc_title",19:"acc_title_value",20:"acc_descr",21:"acc_descr_value",22:"acc_descr_multiline_value",23:"section",24:"taskName",25:"taskData",26:"open_directive",27:"type_directive",28:"arg_directive",29:"close_directive"},productions_:[0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,2],[10,2],[10,1],[10,1],[10,2],[10,1],[12,1],[13,1],[16,1],[14,1]],performAction:function(oe,ce,se,ge,ye,ke,Ae){var de=ke.length-1;switch(ye){case 1:return ke[de-1];case 3:this.$=[];break;case 4:ke[de-1].push(ke[de]),this.$=ke[de-1];break;case 5:case 6:this.$=ke[de];break;case 7:case 8:this.$=[];break;case 11:ge.setDiagramTitle(ke[de].substr(6)),this.$=ke[de].substr(6);break;case 12:this.$=ke[de].trim(),ge.setAccTitle(this.$);break;case 13:case 14:this.$=ke[de].trim(),ge.setAccDescription(this.$);break;case 15:ge.addSection(ke[de].substr(8)),this.$=ke[de].substr(8);break;case 16:ge.addTask(ke[de-1],ke[de]),this.$="task";break;case 18:ge.parseDirective("%%{","open_directive");break;case 19:ge.parseDirective(ke[de],"type_directive");break;case 20:ke[de]=ke[de].trim().replace(/'/g,'"'),ge.parseDirective(ke[de],"arg_directive");break;case 21:ge.parseDirective("}%%","close_directive","journey");break}},table:[{3:1,4:a,7:3,12:4,26:f},{1:[3]},i(p,[2,3],{5:6}),{3:7,4:a,7:3,12:4,26:f},{13:8,27:[1,9]},{27:[2,18]},{6:[1,10],7:21,8:11,9:[1,12],10:13,11:[1,14],12:4,17:w,18:y,20:b,22:E,23:S,24:N,26:f},{1:[2,2]},{14:22,15:[1,23],29:B},i([15,29],[2,19]),i(p,[2,8],{1:[2,1]}),i(p,[2,4]),{7:21,10:25,12:4,17:w,18:y,20:b,22:E,23:S,24:N,26:f},i(p,[2,6]),i(p,[2,7]),i(p,[2,11]),{19:[1,26]},{21:[1,27]},i(p,[2,14]),i(p,[2,15]),{25:[1,28]},i(p,[2,17]),{11:[1,29]},{16:30,28:[1,31]},{11:[2,21]},i(p,[2,5]),i(p,[2,12]),i(p,[2,13]),i(p,[2,16]),i(R,[2,9]),{14:32,29:B},{29:[2,20]},{11:[1,33]},i(R,[2,10])],defaultActions:{5:[2,18],7:[2,2],24:[2,21],31:[2,20]},parseError:function(oe,ce){if(ce.recoverable)this.trace(oe);else{var se=new Error(oe);throw se.hash=ce,se}},parse:function(oe){var ce=this,se=[0],ge=[],ye=[null],ke=[],Ae=this.table,de="",ve=0,te=0,xe=2,De=1,he=ke.slice.call(arguments,1),Ie=Object.create(this.lexer),ee={yy:{}};for(var rt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,rt)&&(ee.yy[rt]=this.yy[rt]);Ie.setInput(oe,ee.yy),ee.yy.lexer=Ie,ee.yy.parser=this,typeof Ie.yylloc>"u"&&(Ie.yylloc={});var me=Ie.yylloc;ke.push(me);var gt=Ie.options&&Ie.options.ranges;typeof ee.yy.parseError=="function"?this.parseError=ee.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(){var Dt;return Dt=ge.pop()||Ie.lex()||De,typeof Dt!="number"&&(Dt instanceof Array&&(ge=Dt,Dt=ge.pop()),Dt=ce.symbols_[Dt]||Dt),Dt}for(var Et,wt,jt,At,Bt={},cn,Nn,Ot,oi;;){if(wt=se[se.length-1],this.defaultActions[wt]?jt=this.defaultActions[wt]:((Et===null||typeof Et>"u")&&(Et=pe()),jt=Ae[wt]&&Ae[wt][Et]),typeof jt>"u"||!jt.length||!jt[0]){var kt="";oi=[];for(cn in Ae[wt])this.terminals_[cn]&&cn>xe&&oi.push("'"+this.terminals_[cn]+"'");Ie.showPosition?kt="Parse error on line "+(ve+1)+`: -`+Ie.showPosition()+` -Expecting `+oi.join(", ")+", got '"+(this.terminals_[Et]||Et)+"'":kt="Parse error on line "+(ve+1)+": Unexpected "+(Et==De?"end of input":"'"+(this.terminals_[Et]||Et)+"'"),this.parseError(kt,{text:Ie.match,token:this.terminals_[Et]||Et,line:Ie.yylineno,loc:me,expected:oi})}if(jt[0]instanceof Array&&jt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+wt+", token: "+Et);switch(jt[0]){case 1:se.push(Et),ye.push(Ie.yytext),ke.push(Ie.yylloc),se.push(jt[1]),Et=null,te=Ie.yyleng,de=Ie.yytext,ve=Ie.yylineno,me=Ie.yylloc;break;case 2:if(Nn=this.productions_[jt[1]][1],Bt.$=ye[ye.length-Nn],Bt._$={first_line:ke[ke.length-(Nn||1)].first_line,last_line:ke[ke.length-1].last_line,first_column:ke[ke.length-(Nn||1)].first_column,last_column:ke[ke.length-1].last_column},gt&&(Bt._$.range=[ke[ke.length-(Nn||1)].range[0],ke[ke.length-1].range[1]]),At=this.performAction.apply(Bt,[de,te,ve,ee.yy,jt[1],ye,ke].concat(he)),typeof At<"u")return At;Nn&&(se=se.slice(0,-1*Nn*2),ye=ye.slice(0,-1*Nn),ke=ke.slice(0,-1*Nn)),se.push(this.productions_[jt[1]][0]),ye.push(Bt.$),ke.push(Bt._$),Ot=Ae[se[se.length-2]][se[se.length-1]],se.push(Ot);break;case 3:return!0}}return!0}},$=function(){var Q={EOF:1,parseError:function(ce,se){if(this.yy.parser)this.yy.parser.parseError(ce,se);else throw new Error(ce)},setInput:function(oe,ce){return this.yy=ce||this.yy||{},this._input=oe,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var oe=this._input[0];this.yytext+=oe,this.yyleng++,this.offset++,this.match+=oe,this.matched+=oe;var ce=oe.match(/(?:\r\n?|\n).*/g);return ce?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),oe},unput:function(oe){var ce=oe.length,se=oe.split(/(?:\r\n?|\n)/g);this._input=oe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ce),this.offset-=ce;var ge=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),se.length-1&&(this.yylineno-=se.length-1);var ye=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:se?(se.length===ge.length?this.yylloc.first_column:0)+ge[ge.length-se.length].length-se[0].length:this.yylloc.first_column-ce},this.options.ranges&&(this.yylloc.range=[ye[0],ye[0]+this.yyleng-ce]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(oe){this.unput(this.match.slice(oe))},pastInput:function(){var oe=this.matched.substr(0,this.matched.length-this.match.length);return(oe.length>20?"...":"")+oe.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var oe=this.match;return oe.length<20&&(oe+=this._input.substr(0,20-oe.length)),(oe.substr(0,20)+(oe.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var oe=this.pastInput(),ce=new Array(oe.length+1).join("-");return oe+this.upcomingInput()+` -`+ce+"^"},test_match:function(oe,ce){var se,ge,ye;if(this.options.backtrack_lexer&&(ye={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},this.options.ranges&&(ye.yylloc.range=this.yylloc.range.slice(0))),ge=oe[0].match(/(?:\r\n?|\n).*/g),ge&&(this.yylineno+=ge.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ge?ge[ge.length-1].length-ge[ge.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+oe[0].length},this.yytext+=oe[0],this.match+=oe[0],this.matches=oe,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(oe[0].length),this.matched+=oe[0],se=this.performAction.call(this,this.yy,this,ce,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),se)return se;if(this._backtrack){for(var ke in ye)this[ke]=ye[ke];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var oe,ce,se,ge;this._more||(this.yytext="",this.match="");for(var ye=this._currentRules(),ke=0;kece[0].length)){if(ce=se,ge=ke,this.options.backtrack_lexer){if(oe=this.test_match(se,ye[ke]),oe!==!1)return oe;if(this._backtrack){ce=!1;continue}else return!1}else if(!this.options.flex)break}return ce?(oe=this.test_match(ce,ye[ge]),oe!==!1?oe:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var ce=this.next();return ce||this.lex()},begin:function(ce){this.conditionStack.push(ce)},popState:function(){var ce=this.conditionStack.length-1;return ce>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(ce){return ce=this.conditionStack.length-1-Math.abs(ce||0),ce>=0?this.conditionStack[ce]:"INITIAL"},pushState:function(ce){this.begin(ce)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(ce,se,ge,ye){switch(ge){case 0:return this.begin("open_directive"),26;case 1:return this.begin("type_directive"),27;case 2:return this.popState(),this.begin("arg_directive"),15;case 3:return this.popState(),this.popState(),29;case 4:return 28;case 5:break;case 6:break;case 7:return 11;case 8:break;case 9:break;case 10:return 4;case 11:return 17;case 12:return this.begin("acc_title"),18;case 13:return this.popState(),"acc_title_value";case 14:return this.begin("acc_descr"),20;case 15:return this.popState(),"acc_descr_value";case 16:this.begin("acc_descr_multiline");break;case 17:this.popState();break;case 18:return"acc_descr_multiline_value";case 19:return 23;case 20:return 24;case 21:return 25;case 22:return 15;case 23:return 6;case 24:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\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:{open_directive:{rules:[1],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},acc_descr_multiline:{rules:[17,18],inclusive:!1},acc_descr:{rules:[15],inclusive:!1},acc_title:{rules:[13],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,9,10,11,12,14,16,19,20,21,22,23,24],inclusive:!0}}};return Q}();j.lexer=$;function V(){this.yy={}}return V.prototype=j,j.Parser=V,new V}();Cge.parser=Cge;const xGt=Cge;let dL="";const Sge=[],jP=[],$P=[],EGt=function(i,a,f){rd.parseDirective(this,i,a,f)},TGt=function(){Sge.length=0,jP.length=0,dL="",$P.length=0,rp()},_Gt=function(i){dL=i,Sge.push(i)},CGt=function(){return Sge},SGt=function(){let i=OFe();const a=100;let f=0;for(;!i&&f{f.people&&i.push(...f.people)}),[...new Set(i)].sort()},LGt=function(i,a){const f=a.substr(1).split(":");let p=0,w=[];f.length===1?(p=Number(f[0]),w=[]):(p=Number(f[0]),w=f[1].split(","));const y=w.map(E=>E.trim()),b={section:dL,type:dL,people:y,task:i,score:p};$P.push(b)},MGt=function(i){const a={section:dL,type:dL,description:i,task:i,classes:[]};jP.push(a)},OFe=function(){const i=function(f){return $P[f].processed};let a=!0;for(const[f,p]of $P.entries())i(f),a=a&&p.processed;return a},NFe={parseDirective:EGt,getConfig:()=>Tt().journey,clear:TGt,setDiagramTitle:Uw,getDiagramTitle:Ww,setAccTitle:ip,getAccTitle:L2,setAccDescription:M2,getAccDescription:D2,addSection:_Gt,getSections:CGt,getTasks:SGt,addTask:LGt,addTaskOrg:MGt,getActors:function(){return AGt()}},DGt=i=>`.label { + fill: ${t.textColor}; +} +`,"getStyles"),ZE=ZVe});var nP,JVe,eUe,Ufe,tUe,Hfe,Yfe=R(()=>{"use strict";nP={},JVe=o((t,e)=>{nP[t]=e},"set"),eUe=o(t=>nP[t],"get"),Ufe=o(()=>Object.keys(nP),"keys"),tUe=o(()=>Ufe().length,"size"),Hfe={get:eUe,set:JVe,keys:Ufe,size:tUe}});var rUe,nUe,iUe,aUe,qfe,sUe,oUe,lUe,cUe,iP,Wfe,Xfe,jfe=R(()=>{"use strict";Zt();Yfe();QE();xr();rr();_t();ut();rUe=o(t=>t.append("circle").attr("class","start-state").attr("r",de().state.sizeUnit).attr("cx",de().state.padding+de().state.sizeUnit).attr("cy",de().state.padding+de().state.sizeUnit),"drawStartState"),nUe=o(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",de().state.textHeight).attr("class","divider").attr("x2",de().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),iUe=o((t,e)=>{let r=t.append("text").attr("x",2*de().state.padding).attr("y",de().state.textHeight+2*de().state.padding).attr("font-size",de().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",de().state.padding).attr("y",de().state.padding).attr("width",n.width+2*de().state.padding).attr("height",n.height+2*de().state.padding).attr("rx",de().state.radius),r},"drawSimpleState"),aUe=o((t,e)=>{let r=o(function(p,m,g){let y=p.append("tspan").attr("x",2*de().state.padding).text(m);g||y.attr("dy",de().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*de().state.padding).attr("y",de().state.textHeight+1.3*de().state.padding).attr("font-size",de().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),a=i.height,s=t.append("text").attr("x",de().state.padding).attr("y",a+de().state.padding*.4+de().state.dividerMargin+de().state.textHeight).attr("class","state-description"),l=!0,u=!0;e.descriptions.forEach(function(p){l||(r(s,p,u),u=!1),l=!1});let h=t.append("line").attr("x1",de().state.padding).attr("y1",de().state.padding+a+de().state.dividerMargin/2).attr("y2",de().state.padding+a+de().state.dividerMargin/2).attr("class","descr-divider"),f=s.node().getBBox(),d=Math.max(f.width,i.width);return h.attr("x2",d+3*de().state.padding),t.insert("rect",":first-child").attr("x",de().state.padding).attr("y",de().state.padding).attr("width",d+2*de().state.padding).attr("height",f.height+a+2*de().state.padding).attr("rx",de().state.radius),t},"drawDescrState"),qfe=o((t,e,r)=>{let n=de().state.padding,i=2*de().state.padding,a=t.node().getBBox(),s=a.width,l=a.x,u=t.append("text").attr("x",0).attr("y",de().state.titleShift).attr("font-size",de().state.fontSize).attr("class","state-title").text(e.id),f=u.node().getBBox().width+i,d=Math.max(f,s);d===s&&(d=d+i);let p,m=t.node().getBBox();e.doc,p=l-n,f>s&&(p=(s-d)/2+n),Math.abs(l-m.x)s&&(p=l-(f-s)/2);let g=1-de().state.textHeight;return t.insert("rect",":first-child").attr("x",p).attr("y",g).attr("class",r?"alt-composit":"composit").attr("width",d).attr("height",m.height+de().state.textHeight+de().state.titleShift+1).attr("rx","0"),u.attr("x",p+n),f<=s&&u.attr("x",l+(d-i)/2-f/2+n),t.insert("rect",":first-child").attr("x",p).attr("y",de().state.titleShift-de().state.textHeight-de().state.padding).attr("width",d).attr("height",de().state.textHeight*3).attr("rx",de().state.radius),t.insert("rect",":first-child").attr("x",p).attr("y",de().state.titleShift-de().state.textHeight-de().state.padding).attr("width",d).attr("height",m.height+3+2*de().state.textHeight).attr("rx",de().state.radius),t},"addTitleAndBox"),sUe=o(t=>(t.append("circle").attr("class","end-state-outer").attr("r",de().state.sizeUnit+de().state.miniPadding).attr("cx",de().state.padding+de().state.sizeUnit+de().state.miniPadding).attr("cy",de().state.padding+de().state.sizeUnit+de().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",de().state.sizeUnit).attr("cx",de().state.padding+de().state.sizeUnit+2).attr("cy",de().state.padding+de().state.sizeUnit+2)),"drawEndState"),oUe=o((t,e)=>{let r=de().state.forkWidth,n=de().state.forkHeight;if(e.parentId){let i=r;r=n,n=i}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",de().state.padding).attr("y",de().state.padding)},"drawForkJoinState"),lUe=o((t,e,r,n)=>{let i=0,a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let s=t.replace(/\r\n/g,"
    ");s=s.replace(/\n/g,"
    ");let l=s.split(We.lineBreakRegex),u=1.25*de().state.noteMargin;for(let h of l){let f=h.trim();if(f.length>0){let d=a.append("tspan");if(d.text(f),u===0){let p=d.node().getBBox();u+=p.height}i+=u,d.attr("x",e+de().state.noteMargin),d.attr("y",r+i+1.25*de().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),cUe=o((t,e)=>{e.attr("class","state-note");let r=e.append("rect").attr("x",0).attr("y",de().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=lUe(t,0,0,n);return r.attr("height",a+2*de().state.noteMargin),r.attr("width",i+de().state.noteMargin*2),r},"drawNote"),iP=o(function(t,e){let r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");e.type==="start"&&rUe(i),e.type==="end"&&sUe(i),(e.type==="fork"||e.type==="join")&&oUe(i,e),e.type==="note"&&cUe(e.note.text,i),e.type==="divider"&&nUe(i),e.type==="default"&&e.descriptions.length===0&&iUe(i,e),e.type==="default"&&e.descriptions.length>0&&aUe(i,e);let a=i.node().getBBox();return n.width=a.width+2*de().state.padding,n.height=a.height+2*de().state.padding,Hfe.set(r,n),n},"drawState"),Wfe=0,Xfe=o(function(t,e,r){let n=o(function(u){switch(u){case Qo.relationType.AGGREGATION:return"aggregation";case Qo.relationType.EXTENSION:return"extension";case Qo.relationType.COMPOSITION:return"composition";case Qo.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(u=>!Number.isNaN(u.y));let i=e.points,a=ha().x(function(u){return u.x}).y(function(u){return u.y}).curve(vs),s=t.append("path").attr("d",a(i)).attr("id","edge"+Wfe).attr("class","transition"),l="";if(de().state.arrowMarkerAbsolute&&(l=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,l=l.replace(/\(/g,"\\("),l=l.replace(/\)/g,"\\)")),s.attr("marker-end","url("+l+"#"+n(Qo.relationType.DEPENDENCY)+"End)"),r.title!==void 0){let u=t.append("g").attr("class","stateLabel"),{x:h,y:f}=Lt.calcLabelPosition(e.points),d=We.getRows(r.title),p=0,m=[],g=0,y=0;for(let b=0;b<=d.length;b++){let w=u.append("text").attr("text-anchor","middle").text(d[b]).attr("x",h).attr("y",f+p),S=w.node().getBBox();g=Math.max(g,S.width),y=Math.min(y,S.x),V.info(S.x,h,f+p),p===0&&(p=w.node().getBBox().height,V.info("Title height",p,f)),m.push(w)}let v=p*d.length;if(d.length>1){let b=(d.length-1)*p*.5;m.forEach((w,S)=>w.attr("y",f+S*p-b)),v=p*d.length}let x=u.node().getBBox();u.insert("rect",":first-child").attr("class","box").attr("x",h-g/2-de().state.padding/2).attr("y",f-v/2-de().state.padding/2-3.5).attr("width",g+de().state.padding).attr("height",v+de().state.padding),V.info(x)}Wfe++},"drawEdge")});var vo,aP,uUe,hUe,fUe,dUe,Kfe,Qfe,Zfe=R(()=>{"use strict";Zt();Vd();ya();ut();rr();jfe();_t();Yn();aP={},uUe=o(function(){},"setConf"),hUe=o(function(t){t.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"),fUe=o(function(t,e,r,n){vo=de().state;let i=de().securityLevel,a;i==="sandbox"&&(a=$e("#i"+e));let s=i==="sandbox"?$e(a.nodes()[0].contentDocument.body):$e("body"),l=i==="sandbox"?a.nodes()[0].contentDocument:document;V.debug("Rendering diagram "+t);let u=s.select(`[id='${e}']`);hUe(u);let h=n.db.getRootDoc();Kfe(h,u,void 0,!1,s,l,n);let f=vo.padding,d=u.node().getBBox(),p=d.width+f*2,m=d.height+f*2,g=p*1.75;Sr(u,m,g,vo.useMaxWidth),u.attr("viewBox",`${d.x-vo.padding} ${d.y-vo.padding} `+p+" "+m)},"draw"),dUe=o(t=>t?t.length*vo.fontSizeFactor:1,"getLabelWidth"),Kfe=o((t,e,r,n,i,a,s)=>{let l=new lr({compound:!0,multigraph:!0}),u,h=!0;for(u=0;u{let T=S.parentElement,E=0,_=0;T&&(T.parentElement&&(E=T.parentElement.getBBox().width),_=parseInt(T.getAttribute("data-x-shift"),10),Number.isNaN(_)&&(_=0)),S.setAttribute("x1",0-_+8),S.setAttribute("x2",E-_-8)})):V.debug("No Node "+b+": "+JSON.stringify(l.node(b)))});let v=y.getBBox();l.edges().forEach(function(b){b!==void 0&&l.edge(b)!==void 0&&(V.debug("Edge "+b.v+" -> "+b.w+": "+JSON.stringify(l.edge(b))),Xfe(e,l.edge(b),l.edge(b).relation))}),v=y.getBBox();let x={id:r||"root",label:r||"root",width:0,height:0};return x.width=v.width+2*vo.padding,x.height=v.height+2*vo.padding,V.debug("Doc rendered",x,l),x},"renderDoc"),Qfe={setConf:uUe,draw:fUe}});var Jfe={};hr(Jfe,{diagram:()=>pUe});var pUe,ede=R(()=>{"use strict";IO();QE();rP();Zfe();pUe={parser:BE,db:Qo,renderer:Qfe,styles:ZE,init:o(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,Qo.clear()},"init")}});var nde={};hr(nde,{diagram:()=>vUe});var vUe,ide=R(()=>{"use strict";IO();QE();rP();XO();vUe={parser:BE,db:Qo,renderer:Lfe,styles:ZE,init:o(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,Qo.clear()},"init")}});var sP,ode,lde=R(()=>{"use strict";sP=function(){var t=o(function(d,p,m,g){for(m=m||{},g=d.length;g--;m[d[g]]=p);return m},"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],l=[1,14],u={trace:o(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:o(function(p,m,g,y,v,x,b){var w=x.length-1;switch(v){case 1:return x[w-1];case 2:this.$=[];break;case 3:x[w-1].push(x[w]),this.$=x[w-1];break;case 4:case 5:this.$=x[w];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(x[w].substr(6)),this.$=x[w].substr(6);break;case 9:this.$=x[w].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=x[w].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(x[w].substr(8)),this.$=x[w].substr(8);break;case 13:y.addTask(x[w-1],x[w]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:a,17:s,18:l},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:a,17:s,18:l},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:o(function(p,m){if(m.recoverable)this.trace(p);else{var g=new Error(p);throw g.hash=m,g}},"parseError"),parse:o(function(p){var m=this,g=[0],y=[],v=[null],x=[],b=this.table,w="",S=0,T=0,E=0,_=2,A=1,L=x.slice.call(arguments,1),M=Object.create(this.lexer),N={yy:{}};for(var k in this.yy)Object.prototype.hasOwnProperty.call(this.yy,k)&&(N.yy[k]=this.yy[k]);M.setInput(p,N.yy),N.yy.lexer=M,N.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var I=M.yylloc;x.push(I);var C=M.options&&M.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function O(H){g.length=g.length-2*H,v.length=v.length-H,x.length=x.length-H}o(O,"popStack");function D(){var H;return H=y.pop()||M.lex()||A,typeof H!="number"&&(H instanceof Array&&(y=H,H=y.pop()),H=m.symbols_[H]||H),H}o(D,"lex");for(var P,F,B,$,z,Y,Q={},X,ie,j,J;;){if(B=g[g.length-1],this.defaultActions[B]?$=this.defaultActions[B]:((P===null||typeof P>"u")&&(P=D()),$=b[B]&&b[B][P]),typeof $>"u"||!$.length||!$[0]){var Z="";J=[];for(X in b[B])this.terminals_[X]&&X>_&&J.push("'"+this.terminals_[X]+"'");M.showPosition?Z="Parse error on line "+(S+1)+`: +`+M.showPosition()+` +Expecting `+J.join(", ")+", got '"+(this.terminals_[P]||P)+"'":Z="Parse error on line "+(S+1)+": Unexpected "+(P==A?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(Z,{text:M.match,token:this.terminals_[P]||P,line:M.yylineno,loc:I,expected:J})}if($[0]instanceof Array&&$.length>1)throw new Error("Parse Error: multiple actions possible at state: "+B+", token: "+P);switch($[0]){case 1:g.push(P),v.push(M.yytext),x.push(M.yylloc),g.push($[1]),P=null,F?(P=F,F=null):(T=M.yyleng,w=M.yytext,S=M.yylineno,I=M.yylloc,E>0&&E--);break;case 2:if(ie=this.productions_[$[1]][1],Q.$=v[v.length-ie],Q._$={first_line:x[x.length-(ie||1)].first_line,last_line:x[x.length-1].last_line,first_column:x[x.length-(ie||1)].first_column,last_column:x[x.length-1].last_column},C&&(Q._$.range=[x[x.length-(ie||1)].range[0],x[x.length-1].range[1]]),Y=this.performAction.apply(Q,[w,T,S,N.yy,$[1],v,x].concat(L)),typeof Y<"u")return Y;ie&&(g=g.slice(0,-1*ie*2),v=v.slice(0,-1*ie),x=x.slice(0,-1*ie)),g.push(this.productions_[$[1]][0]),v.push(Q.$),x.push(Q._$),j=b[g[g.length-2]][g[g.length-1]],g.push(j);break;case 3:return!0}}return!0},"parse")},h=function(){var d={EOF:1,parseError:o(function(m,g){if(this.yy.parser)this.yy.parser.parseError(m,g);else throw new Error(m)},"parseError"),setInput:o(function(p,m){return this.yy=m||this.yy||{},this._input=p,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var p=this._input[0];this.yytext+=p,this.yyleng++,this.offset++,this.match+=p,this.matched+=p;var m=p.match(/(?:\r\n?|\n).*/g);return m?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),p},"input"),unput:o(function(p){var m=p.length,g=p.split(/(?:\r\n?|\n)/g);this._input=p+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-m),this.offset-=m;var y=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),g.length-1&&(this.yylineno-=g.length-1);var v=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===y.length?this.yylloc.first_column:0)+y[y.length-g.length].length-g[0].length:this.yylloc.first_column-m},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-m]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(p){this.unput(this.match.slice(p))},"less"),pastInput:o(function(){var p=this.matched.substr(0,this.matched.length-this.match.length);return(p.length>20?"...":"")+p.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var p=this.match;return p.length<20&&(p+=this._input.substr(0,20-p.length)),(p.substr(0,20)+(p.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var p=this.pastInput(),m=new Array(p.length+1).join("-");return p+this.upcomingInput()+` +`+m+"^"},"showPosition"),test_match:o(function(p,m){var g,y,v;if(this.options.backtrack_lexer&&(v={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},this.options.ranges&&(v.yylloc.range=this.yylloc.range.slice(0))),y=p[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+p[0].length},this.yytext+=p[0],this.match+=p[0],this.matches=p,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(p[0].length),this.matched+=p[0],g=this.performAction.call(this,this.yy,this,m,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var x in v)this[x]=v[x];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var p,m,g,y;this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),x=0;xm[0].length)){if(m=g,y=x,this.options.backtrack_lexer){if(p=this.test_match(g,v[x]),p!==!1)return p;if(this._backtrack){m=!1;continue}else return!1}else if(!this.options.flex)break}return m?(p=this.test_match(m,v[y]),p!==!1?p:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var m=this.next();return m||this.lex()},"lex"),begin:o(function(m){this.conditionStack.push(m)},"begin"),popState:o(function(){var m=this.conditionStack.length-1;return m>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(m){return m=this.conditionStack.length-1-Math.abs(m||0),m>=0?this.conditionStack[m]:"INITIAL"},"topState"),pushState:o(function(m){this.begin(m)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(m,g,y,v){var x=v;switch(y){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:return this.begin("acc_title"),12;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.begin("acc_descr"),14;break;case 10:return this.popState(),"acc_descr_value";break;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"}},"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:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return d}();u.lexer=h;function f(){this.yy={}}return o(f,"Parser"),f.prototype=u,u.Parser=f,new f}();sP.parser=sP;ode=sP});var Ug,oP,Sx,Ax,TUe,kUe,EUe,CUe,SUe,AUe,_Ue,cde,LUe,lP,ude=R(()=>{"use strict";_t();bi();Ug="",oP=[],Sx=[],Ax=[],TUe=o(function(){oP.length=0,Sx.length=0,Ug="",Ax.length=0,vr()},"clear"),kUe=o(function(t){Ug=t,oP.push(t)},"addSection"),EUe=o(function(){return oP},"getSections"),CUe=o(function(){let t=cde(),e=100,r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),AUe=o(function(t,e){let r=e.substr(1).split(":"),n=0,i=[];r.length===1?(n=Number(r[0]),i=[]):(n=Number(r[0]),i=r[1].split(","));let a=i.map(l=>l.trim()),s={section:Ug,type:Ug,people:a,task:t,score:n};Ax.push(s)},"addTask"),_Ue=o(function(t){let e={section:Ug,type:Ug,description:t,task:t,classes:[]};Sx.push(e)},"addTaskOrg"),cde=o(function(){let t=o(function(r){return Ax[r].processed},"compileTask"),e=!0;for(let[r,n]of Ax.entries())t(r),e=e&&n.processed;return e},"compileTasks"),LUe=o(function(){return SUe()},"getActors"),lP={getConfig:o(()=>de().journey,"getConfig"),clear:TUe,setDiagramTitle:nn,getDiagramTitle:Xr,setAccTitle:kr,getAccTitle:Ar,setAccDescription:_r,getAccDescription:Lr,addSection:kUe,getSections:EUe,getTasks:CUe,addTask:AUe,addTaskOrg:_Ue,getActors:LUe}});var DUe,hde,fde=R(()=>{"use strict";DUe=o(t=>`.label { font-family: 'trebuchet ms', verdana, arial, sans-serif; font-family: var(--mermaid-font-family); - color: ${i.textColor}; + color: ${t.textColor}; } .mouth { stroke: #666; } line { - stroke: ${i.textColor} + stroke: ${t.textColor} } .legend { - fill: ${i.textColor}; + fill: ${t.textColor}; } .label text { fill: #333; } .label { - color: ${i.textColor} + color: ${t.textColor} } .face { - ${i.faceColor?`fill: ${i.faceColor}`:"fill: #FFF8DC"}; + ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"}; stroke: #999; } @@ -1211,8 +1663,8 @@ Expecting `+oi.join(", ")+", got '"+(this.terminals_[Et]||Et)+"'":kt="Parse erro .node ellipse, .node polygon, .node path { - fill: ${i.mainBkg}; - stroke: ${i.nodeBorder}; + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; stroke-width: 1px; } @@ -1224,21 +1676,21 @@ Expecting `+oi.join(", ")+", got '"+(this.terminals_[Et]||Et)+"'":kt="Parse erro } .arrowheadPath { - fill: ${i.arrowheadColor}; + fill: ${t.arrowheadColor}; } .edgePath .path { - stroke: ${i.lineColor}; + stroke: ${t.lineColor}; stroke-width: 1.5px; } .flowchart-link { - stroke: ${i.lineColor}; + stroke: ${t.lineColor}; fill: none; } .edgeLabel { - background-color: ${i.edgeLabelBackground}; + background-color: ${t.edgeLabelBackground}; rect { opacity: 0.5; } @@ -1249,7 +1701,7 @@ Expecting `+oi.join(", ")+", got '"+(this.terminals_[Et]||Et)+"'":kt="Parse erro } .cluster text { - fill: ${i.titleColor}; + fill: ${t.titleColor}; } div.mermaidTooltip { @@ -1260,225 +1712,85 @@ Expecting `+oi.join(", ")+", got '"+(this.terminals_[Et]||Et)+"'":kt="Parse erro font-family: 'trebuchet ms', verdana, arial, sans-serif; font-family: var(--mermaid-font-family); font-size: 12px; - background: ${i.tertiaryColor}; - border: 1px solid ${i.border2}; + background: ${t.tertiaryColor}; + border: 1px solid ${t.border2}; border-radius: 2px; pointer-events: none; z-index: 100; } .task-type-0, .section-type-0 { - ${i.fillType0?`fill: ${i.fillType0}`:""}; + ${t.fillType0?`fill: ${t.fillType0}`:""}; } .task-type-1, .section-type-1 { - ${i.fillType0?`fill: ${i.fillType1}`:""}; + ${t.fillType0?`fill: ${t.fillType1}`:""}; } .task-type-2, .section-type-2 { - ${i.fillType0?`fill: ${i.fillType2}`:""}; + ${t.fillType0?`fill: ${t.fillType2}`:""}; } .task-type-3, .section-type-3 { - ${i.fillType0?`fill: ${i.fillType3}`:""}; + ${t.fillType0?`fill: ${t.fillType3}`:""}; } .task-type-4, .section-type-4 { - ${i.fillType0?`fill: ${i.fillType4}`:""}; + ${t.fillType0?`fill: ${t.fillType4}`:""}; } .task-type-5, .section-type-5 { - ${i.fillType0?`fill: ${i.fillType5}`:""}; + ${t.fillType0?`fill: ${t.fillType5}`:""}; } .task-type-6, .section-type-6 { - ${i.fillType0?`fill: ${i.fillType6}`:""}; + ${t.fillType0?`fill: ${t.fillType6}`:""}; } .task-type-7, .section-type-7 { - ${i.fillType0?`fill: ${i.fillType7}`:""}; + ${t.fillType0?`fill: ${t.fillType7}`:""}; } .actor-0 { - ${i.actor0?`fill: ${i.actor0}`:""}; + ${t.actor0?`fill: ${t.actor0}`:""}; } .actor-1 { - ${i.actor1?`fill: ${i.actor1}`:""}; + ${t.actor1?`fill: ${t.actor1}`:""}; } .actor-2 { - ${i.actor2?`fill: ${i.actor2}`:""}; + ${t.actor2?`fill: ${t.actor2}`:""}; } .actor-3 { - ${i.actor3?`fill: ${i.actor3}`:""}; + ${t.actor3?`fill: ${t.actor3}`:""}; } .actor-4 { - ${i.actor4?`fill: ${i.actor4}`:""}; + ${t.actor4?`fill: ${t.actor4}`:""}; } .actor-5 { - ${i.actor5?`fill: ${i.actor5}`:""}; - } -`,qK=function(i,a){const f=i.append("rect");return f.attr("x",a.x),f.attr("y",a.y),f.attr("fill",a.fill),f.attr("stroke",a.stroke),f.attr("width",a.width),f.attr("height",a.height),f.attr("rx",a.rx),f.attr("ry",a.ry),a.class!==void 0&&f.attr("class",a.class),f},IGt=function(i,a){const p=i.append("circle").attr("cx",a.cx).attr("cy",a.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),w=i.append("g");w.append("circle").attr("cx",a.cx-15/3).attr("cy",a.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),w.append("circle").attr("cx",a.cx+15/3).attr("cy",a.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function y(S){const N=CA().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);S.append("path").attr("class","mouth").attr("d",N).attr("transform","translate("+a.cx+","+(a.cy+2)+")")}function b(S){const N=CA().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);S.append("path").attr("class","mouth").attr("d",N).attr("transform","translate("+a.cx+","+(a.cy+7)+")")}function E(S){S.append("line").attr("class","mouth").attr("stroke",2).attr("x1",a.cx-5).attr("y1",a.cy+7).attr("x2",a.cx+5).attr("y2",a.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return a.score>3?y(w):a.score<3?b(w):E(w),p},PFe=function(i,a){const f=i.append("circle");return f.attr("cx",a.cx),f.attr("cy",a.cy),f.attr("class","actor-"+a.pos),f.attr("fill",a.fill),f.attr("stroke",a.stroke),f.attr("r",a.r),f.class!==void 0&&f.attr("class",f.class),a.title!==void 0&&f.append("title").text(a.title),f},BFe=function(i,a){const f=a.text.replace(//gi," "),p=i.append("text");p.attr("x",a.x),p.attr("y",a.y),p.attr("class","legend"),p.style("text-anchor",a.anchor),a.class!==void 0&&p.attr("class",a.class);const w=p.append("tspan");return w.attr("x",a.x+a.textMargin*2),w.text(f),p},OGt=function(i,a){function f(w,y,b,E,S){return w+","+y+" "+(w+b)+","+y+" "+(w+b)+","+(y+E-S)+" "+(w+b-S*1.2)+","+(y+E)+" "+w+","+(y+E)}const p=i.append("polygon");p.attr("points",f(a.x,a.y,50,20,7)),p.attr("class","labelBox"),a.y=a.y+a.labelMargin,a.x=a.x+.5*a.labelMargin,BFe(i,a)},NGt=function(i,a,f){const p=i.append("g"),w=Age();w.x=a.x,w.y=a.y,w.fill=a.fill,w.width=f.width*a.taskCount+f.diagramMarginX*(a.taskCount-1),w.height=f.height,w.class="journey-section section-type-"+a.num,w.rx=3,w.ry=3,qK(p,w),FFe(f)(a.text,p,w.x,w.y,w.width,w.height,{class:"journey-section section-type-"+a.num},f,a.colour)};let RFe=-1;const PGt=function(i,a,f){const p=a.x+f.width/2,w=i.append("g");RFe++;const y=300+5*30;w.append("line").attr("id","task"+RFe).attr("x1",p).attr("y1",a.y).attr("x2",p).attr("y2",y).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),IGt(w,{cx:p,cy:300+(5-a.score)*30,score:a.score});const b=Age();b.x=a.x,b.y=a.y,b.fill=a.fill,b.width=f.width,b.height=f.height,b.class="task task-type-"+a.num,b.rx=3,b.ry=3,qK(w,b);let E=a.x+14;a.people.forEach(S=>{const N=a.actors[S].color,B={cx:E,cy:a.y,r:7,fill:N,stroke:"#000",title:S,pos:a.actors[S].position};PFe(w,B),E+=10}),FFe(f)(a.task,w,b.x,b.y,b.width,b.height,{class:"task"},f,a.colour)},BGt=function(i,a){qK(i,{x:a.startx,y:a.starty,width:a.stopx-a.startx,height:a.stopy-a.starty,fill:a.fill,class:"rect"}).lower()},RGt=function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},Age=function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},FFe=function(){function i(w,y,b,E,S,N,B,R){const j=y.append("text").attr("x",b+S/2).attr("y",E+N/2+5).style("font-color",R).style("text-anchor","middle").text(w);p(j,B)}function a(w,y,b,E,S,N,B,R,j){const{taskFontSize:$,taskFontFamily:V}=R,Q=w.split(//gi);for(let oe=0;oe{const w=I5[p].color,y={cx:20,cy:f,r:7,fill:w,stroke:"#000",pos:I5[p].position};HP.drawCircle(i,y);const b={x:40,y:f+7,fill:"#666",text:p,textMargin:a.boxTextMargin|5};HP.drawText(i,b),f+=20})}const VK=Tt().journey,b9=VK.leftMargin,$Gt=function(i,a,f,p){const w=Tt().journey;p.db.clear(),p.parser.parse(i+` -`);const y=Tt().securityLevel;let b;y==="sandbox"&&(b=Cr("#i"+a));const E=Cr(y==="sandbox"?b.nodes()[0].contentDocument.body:"body");Qb.init();const S=E.select("#"+a);HP.initGraphics(S);const N=p.db.getTasks(),B=p.db.getDiagramTitle(),R=p.db.getActors();for(const ce in I5)delete I5[ce];let j=0;R.forEach(ce=>{I5[ce]={color:w.actorColours[j%w.actorColours.length],position:j},j++}),jGt(S),Qb.insert(0,0,b9,Object.keys(I5).length*50),HGt(S,N,0);const $=Qb.getBounds();B&&S.append("text").text(B).attr("x",b9).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const V=$.stopy-$.starty+2*w.diagramMarginY,Q=b9+$.stopx+2*w.diagramMarginX;Vw(S,V,Q,w.useMaxWidth),S.append("line").attr("x1",b9).attr("y1",w.height*4).attr("x2",Q-b9-4).attr("y2",w.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const oe=B?70:0;S.attr("viewBox",`${$.startx} -25 ${Q} ${V+oe}`),S.attr("preserveAspectRatio","xMinYMin meet"),S.attr("height",V+oe+25)},Qb={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(i,a,f,p){i[a]===void 0?i[a]=f:i[a]=p(f,i[a])},updateBounds:function(i,a,f,p){const w=Tt().journey,y=this;let b=0;function E(S){return function(B){b++;const R=y.sequenceItems.length-b+1;y.updateVal(B,"starty",a-R*w.boxMargin,Math.min),y.updateVal(B,"stopy",p+R*w.boxMargin,Math.max),y.updateVal(Qb.data,"startx",i-R*w.boxMargin,Math.min),y.updateVal(Qb.data,"stopx",f+R*w.boxMargin,Math.max),S!=="activation"&&(y.updateVal(B,"startx",i-R*w.boxMargin,Math.min),y.updateVal(B,"stopx",f+R*w.boxMargin,Math.max),y.updateVal(Qb.data,"starty",a-R*w.boxMargin,Math.min),y.updateVal(Qb.data,"stopy",p+R*w.boxMargin,Math.max))}}this.sequenceItems.forEach(E())},insert:function(i,a,f,p){const w=Math.min(i,f),y=Math.max(i,f),b=Math.min(a,p),E=Math.max(a,p);this.updateVal(Qb.data,"startx",w,Math.min),this.updateVal(Qb.data,"starty",b,Math.min),this.updateVal(Qb.data,"stopx",y,Math.max),this.updateVal(Qb.data,"stopy",E,Math.max),this.updateBounds(w,b,y,E)},bumpVerticalPos:function(i){this.verticalPos=this.verticalPos+i,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}},Lge=VK.sectionFills,jFe=VK.sectionColours,HGt=function(i,a,f){const p=Tt().journey;let w="";const y=p.height*2+p.diagramMarginY,b=f+y;let E=0,S="#CCC",N="black",B=0;for(const[R,j]of a.entries()){if(w!==j.section){S=Lge[E%Lge.length],B=E%Lge.length,N=jFe[E%jFe.length];let V=0;const Q=j.section;for(let ce=R;ce(I5[Q]&&(V[Q]=I5[Q]),V),{});j.x=R*p.taskMargin+R*p.width+b9,j.y=b,j.width=p.diagramMarginX,j.height=p.diagramMarginY,j.colour=N,j.fill=S,j.num=B,j.actors=$,HP.drawTask(i,j,p),Qb.insert(j.x,j.y,j.x+j.width+p.taskMargin,300+5*30)}},$Fe={setConf:FGt,draw:$Gt},zGt=Object.freeze(Object.defineProperty({__proto__:null,diagram:{parser:xGt,db:NFe,renderer:$Fe,styles:DGt,init:i=>{$Fe.setConf(i.journey),NFe.clear()}}},Symbol.toStringTag,{value:"Module"})),GGt=(i,a,f)=>{const{parentById:p}=f,w=new Set;let y=i;for(;y;){if(w.add(y),y===a)return y;y=p[y]}for(y=a;y;){if(w.has(y))return y;y=p[y]}return"root"};function UK(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Mge={},qGt={get exports(){return Mge},set exports(i){Mge=i}};(function(i,a){(function(f){i.exports=f()})(function(){return function(){function f(p,w,y){function b(N,B){if(!w[N]){if(!p[N]){var R=typeof UK=="function"&&UK;if(!B&&R)return R(N,!0);if(E)return E(N,!0);var j=new Error("Cannot find module '"+N+"'");throw j.code="MODULE_NOT_FOUND",j}var $=w[N]={exports:{}};p[N][0].call($.exports,function(V){var Q=p[N][1][V];return b(Q||V)},$,$.exports,f,p,w,y)}return w[N].exports}for(var E=typeof UK=="function"&&UK,S=0;S0&&arguments[0]!==void 0?arguments[0]:{},j=R.defaultLayoutOptions,$=j===void 0?{}:j,V=R.algorithms,Q=V===void 0?["layered","stress","mrtree","radial","force","disco","sporeOverlap","sporeCompaction","rectpacking"]:V,oe=R.workerFactory,ce=R.workerUrl;if(b(this,N),this.defaultLayoutOptions=$,this.initialized=!1,typeof ce>"u"&&typeof oe>"u")throw new Error("Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.");var se=oe;typeof ce<"u"&&typeof oe>"u"&&(se=function(ke){return new Worker(ke)});var ge=se(ce);if(typeof ge.postMessage!="function")throw new TypeError("Created worker does not provide the required 'postMessage' function.");this.worker=new S(ge),this.worker.postMessage({cmd:"register",algorithms:Q}).then(function(ye){return B.initialized=!0}).catch(console.err)}return y(N,[{key:"layout",value:function(R){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=j.layoutOptions,V=$===void 0?this.defaultLayoutOptions:$,Q=j.logging,oe=Q===void 0?!1:Q,ce=j.measureExecutionTime,se=ce===void 0?!1:ce;return R?this.worker.postMessage({cmd:"layout",graph:R,layoutOptions:V,options:{logging:oe,measureExecutionTime:se}}):Promise.reject(new Error("Missing mandatory parameter 'graph'."))}},{key:"knownLayoutAlgorithms",value:function(){return this.worker.postMessage({cmd:"algorithms"})}},{key:"knownLayoutOptions",value:function(){return this.worker.postMessage({cmd:"options"})}},{key:"knownLayoutCategories",value:function(){return this.worker.postMessage({cmd:"categories"})}},{key:"terminateWorker",value:function(){this.worker.terminate()}}]),N}();w.default=E;var S=function(){function N(B){var R=this;if(b(this,N),B===void 0)throw new Error("Missing mandatory parameter 'worker'.");this.resolvers={},this.worker=B,this.worker.onmessage=function(j){setTimeout(function(){R.receive(R,j)},0)}}return y(N,[{key:"postMessage",value:function(R){var j=this.id||0;this.id=j+1,R.id=j;var $=this;return new Promise(function(V,Q){$.resolvers[j]=function(oe,ce){oe?($.convertGwtStyleError(oe),Q(oe)):V(ce)},$.worker.postMessage(R)})}},{key:"receive",value:function(R,j){var $=j.data,V=R.resolvers[$.id];V&&(delete R.resolvers[$.id],$.error?V($.error):V(null,$.data))}},{key:"terminate",value:function(){this.worker.terminate&&this.worker.terminate()}},{key:"convertGwtStyleError",value:function(R){if(R){var j=R.__java$exception;j&&(j.cause&&j.cause.backingJsObject&&(R.cause=j.cause.backingJsObject,this.convertGwtStyleError(R.cause)),delete R.__java$exception)}}}]),N}()},{}],2:[function(f,p,w){(function(y){(function(){var b;typeof window<"u"?b=window:typeof y<"u"?b=y:typeof self<"u"&&(b=self);var E;function S(){}function N(){}function B(){}function R(){}function j(){}function $(){}function V(){}function Q(){}function oe(){}function ce(){}function se(){}function ge(){}function ye(){}function ke(){}function Ae(){}function de(){}function ve(){}function te(){}function xe(){}function De(){}function he(){}function Ie(){}function ee(){}function rt(){}function me(){}function gt(){}function pe(){}function Et(){}function wt(){}function jt(){}function At(){}function Bt(){}function cn(){}function Nn(){}function Ot(){}function oi(){}function kt(){}function Dt(){}function vt(){}function Nt(){}function ze(){}function Xe(){}function Lt(){}function Ge(){}function Bn(){}function Oe(){}function Ri(){}function tn(){}function hi(){}function Sr(){}function Zn(){}function Xn(){}function ir(){}function Hn(){}function tr(){}function ha(){}function Zs(){}function ns(){}function Hi(){}function Js(){}function Pc(){}function Ga(){}function ws(){}function Oi(){}function Er(){}function br(){}function Dr(){}function Vn(){}function qi(){}function yn(){}function Bc(){}function jn(){}function Ms(){}function Pa(){}function Ta(){}function _a(){}function ka(){}function Qi(){}function ea(){}function Ca(){}function Sa(){}function Ka(){}function cg(){}function Gc(){}function Dh(){}function Es(){}function lp(){}function sd(){}function sh(){}function Ai(){}function nn(){}function Tr(){}function ai(){}function Ns(){}function mc(){}function yu(){}function Mo(){}function ku(){}function Ih(){}function qf(){}function lx(){}function ad(){}function b3(){}function bL(){}function im(){}function ug(){}function rs(){}function Ps(){}function Aa(){}function pi(){}function Rc(){}function _t(){}function hp(){}function Gt(){}function ff(){}function sm(){}function m9(){}function fp(){}function N5(){}function ah(){}function od(){}function P5(){}function B5(){}function y9(){}function vL(){}function v1(){}function dp(){}function cd(){}function am(){}function ev(){}function om(){}function yc(){}function hx(){}function Vo(){}function fx(){}function oh(){}function QK(){}function k9(){}function ZK(){}function GP(){}function Vf(){}function cm(){}function wL(){}function qP(){}function gp(){}function um(){}function JK(){}function R2(){}function eY(){}function tY(){}function R5(){}function x9(){}function VP(){}function dx(){}function nY(){}function gx(){}function rY(){}function iY(){}function sY(){}function aY(){}function oY(){}function cY(){}function uY(){}function lY(){}function hY(){}function fY(){}function dY(){}function mL(){}function gY(){}function pY(){}function E9(){}function UP(){}function F5(){}function bY(){}function vY(){}function wY(){}function mY(){}function yY(){}function T9(){}function yL(){}function WP(){}function v3(){}function w3(){}function kY(){}function df(){}function j5(){}function xY(){}function px(){}function zd(){}function EY(){}function TY(){}function _Y(){}function CY(){}function _9(){}function kL(){}function KP(){}function xL(){}function $5(){}function SY(){}function YP(){}function XP(){}function AY(){}function LY(){}function MY(){}function DY(){}function IY(){}function OY(){}function Gd(){}function tv(){}function NY(){}function QP(){}function ZP(){}function PY(){}function m3(){}function bx(){}function EL(){}function lm(){}function vx(){}function BY(){}function C9(){}function ud(){}function JP(){}function TL(){}function wx(){}function _L(){}function eB(){}function RY(){}function CL(){}function FY(){}function jY(){}function tB(){}function H5(){}function nB(){}function z5(){}function $Y(){}function SL(){}function HY(){}function zY(){}function GY(){}function qY(){}function rB(){}function VY(){}function UY(){}function WY(){}function iB(){}function KY(){}function YY(){}function XY(){}function sB(){}function QY(){}function ZY(){}function aB(){}function oB(){}function cB(){}function JY(){}function eX(){}function mx(){}function G5(){}function S9(){}function tX(){}function AL(){}function A9(){}function LL(){}function uB(){}function lB(){}function nX(){}function rX(){}function iX(){}function hB(){}function fB(){}function sX(){}function aX(){}function oX(){}function cX(){}function uX(){}function dB(){}function lX(){}function hX(){}function fX(){}function dX(){}function gB(){}function L9(){}function gX(){}function pX(){}function pB(){}function bX(){}function vX(){}function wX(){}function mX(){}function yX(){}function kX(){}function bB(){}function xX(){}function vB(){}function EX(){}function TX(){}function _X(){}function M9(){}function CX(){}function D9(){}function SX(){}function wB(){}function mB(){}function yB(){}function kB(){}function nv(){}function xB(){}function EB(){}function TB(){}function _B(){}function AX(){}function q5(){}function I9(){}function y3(){}function LX(){}function MX(){}function O9(){}function DX(){}function IX(){}function OX(){}function NX(){}function PX(){}function BX(){}function RX(){}function FX(){}function jX(){}function $X(){}function HX(){}function ML(){}function CB(){}function zX(){}function GX(){}function qX(){}function SB(){}function VX(){}function UX(){}function WX(){}function KX(){}function YX(){}function XX(){}function AB(){}function LB(){}function QX(){}function MB(){}function DB(){}function ZX(){}function JX(){}function eQ(){}function DL(){}function tQ(){}function yx(){}function nQ(){}function rQ(){}function iQ(){}function IB(){}function sQ(){}function aQ(){}function oQ(){}function cQ(){}function uQ(){}function lQ(){}function hQ(){}function fQ(){}function dQ(){}function gQ(){}function pQ(){}function bQ(){}function V5(){}function OB(){}function vQ(){}function wQ(){}function mQ(){}function NB(){}function yQ(){}function N9(){}function kQ(){}function xQ(){}function EQ(){}function TQ(){}function _Q(){}function CQ(){}function SQ(){}function AQ(){}function LQ(){}function MQ(){}function U5(){}function DQ(){}function IQ(){}function OQ(){}function NQ(){}function PQ(){}function BQ(){}function RQ(){}function FQ(){}function P9(){}function jQ(){}function $Q(){}function HQ(){}function zQ(){}function GQ(){}function qQ(){}function VQ(){}function UQ(){}function W5(){}function PB(){}function WQ(){}function IL(){}function KQ(){}function YQ(){}function XQ(){}function QQ(){}function ZQ(){}function JQ(){}function eZ(){}function BB(){}function tZ(){}function RB(){}function nZ(){}function FB(){}function jB(){}function $B(){}function rZ(){}function iZ(){}function B9(){}function OL(){}function R9(){}function sZ(){}function aZ(){}function NL(){}function oZ(){}function cZ(){}function HB(){}function uZ(){}function lZ(){}function hZ(){}function fZ(){}function dZ(){}function gZ(){}function pZ(){}function bZ(){}function vZ(){}function wZ(){}function lg(){}function mZ(){}function hm(){}function zB(){}function yZ(){}function kZ(){}function xZ(){}function EZ(){}function TZ(){}function _Z(){}function CZ(){}function SZ(){}function AZ(){}function Fc(){}function LZ(){}function F9(){}function lc(){}function iu(){}function Ki(){}function PL(){}function MZ(){}function DZ(){}function IZ(){}function K5(){}function fm(){}function Ht(){}function OZ(){}function NZ(){}function PZ(){}function BZ(){}function RZ(){}function GB(){}function FZ(){}function jZ(){}function BL(){}function $Z(){}function rl(){}function Hu(){}function HZ(){}function zZ(){}function GZ(){}function dm(){}function rv(){}function pp(){}function ld(){}function Y5(){}function j9(){}function kx(){}function qB(){}function qZ(){}function xx(){}function VB(){}function VZ(){}function $9(){}function X5(){}function Q5(){}function bp(){}function UB(){}function Ex(){}function WB(){}function KB(){}function Z5(){}function F2(){}function E0(){}function vp(){}function k3(){}function Tx(){}function H9(){}function YB(){}function UZ(){}function XB(){}function QB(){}function ZB(){}function _x(){}function JB(){}function eR(){}function WZ(){}function Cx(){}function Sx(){}function gm(){}function RL(){}function KZ(){}function YZ(){}function XZ(){}function QZ(){}function ZZ(){}function JZ(){}function eJ(){}function tJ(){}function tR(){}function nJ(){}function rJ(){}function iJ(){}function nR(){}function Ax(){}function z9(){}function rR(){}function sJ(){}function iR(){}function sR(){}function aJ(){}function G9(){}function pm(){}function aR(){}function oR(){}function oJ(){}function cJ(){}function q9(){}function cR(){}function uR(){}function kc(){}function uJ(){}function lR(){}function V9(){}function lJ(){}function hJ(){}function U9(){}function hR(){}function W9(){}function K9(){}function Uf(){}function FL(){}function jL(){}function J5(){}function fJ(){}function dJ(){}function gJ(){}function pJ(){}function bm(){}function fR(){}function e6(){}function w1(){}function dR(){}function gR(){}function pR(){}function bR(){}function vR(){}function wR(){}function Wf(){}function xu(){}function bJ(){}function vJ(){}function wJ(){}function Eu(){}function Y9(){}function mR(){}function yR(){}function t6(){}function mJ(){}function Lx(){}function yJ(){}function kR(){}function kJ(){}function xJ(){}function X9(){}function xR(){}function $L(){}function Q9(){}function EJ(){}function TJ(){}function HL(){}function Z9(){}function m1(){}function Mx(){}function _J(){}function Dx(){}function zL(){}function j2(){}function J9(){}function GL(){}function Kf(){}function eT(){}function y1(){}function k1(){}function CJ(){}function SJ(){}function x3(){}function Ix(){}function Ox(){}function tT(){}function AJ(){}function n6(){}function qL(){}function ER(){}function LJ(){}function nT(){kT()}function MJ(){Tie()}function TR(){K_()}function VL(){GH()}function DJ(){m4e()}function rT(){a1()}function IJ(){M3e()}function OJ(){ZD()}function NJ(){vM()}function PJ(){bM()}function BJ(){GM()}function _R(){AGe()}function RJ(){U6()}function FJ(){TF()}function jJ(){jZe()}function CR(){ett()}function $J(){vJe()}function HJ(){NXe()}function iT(){X8()}function zJ(){Xp()}function GJ(){ttt()}function qJ(){SQe()}function VJ(){f6e()}function UJ(){zit()}function WJ(){PXe()}function SR(){pt()}function KJ(){OXe()}function AR(){ntt()}function YJ(){snt()}function UL(){RXe()}function XJ(){xJe()}function LR(){LGe()}function QJ(){e5e()}function MR(){Jm()}function ZJ(){Ltt()}function DR(){nI()}function IR(){Jse()}function OR(){ase()}function WL(){nw()}function E3(){Xme()}function sT(){BXe()}function hd(){Xct()}function NR(){Q4e()}function Nx(){Vse()}function KL(){A$()}function JJ(){XH()}function wp(){bi()}function PR(){hH()}function BR(){i3e()}function RR(){pz()}function ch(){EWe()}function YL(){cie()}function FR(){F5e()}function Px(e){Sn(e)}function aT(e){this.a=e}function Bx(e){this.a=e}function jR(e){this.a=e}function r6(e){this.a=e}function iv(e){this.a=e}function Rx(e){this.a=e}function $R(e){this.a=e}function eee(e){this.a=e}function XL(e){this.a=e}function T3(e){this.a=e}function QL(e){this.a=e}function oT(e){this.a=e}function tee(e){this.a=e}function cT(e){this.a=e}function uT(e){this.a=e}function i6(e){this.a=e}function ZL(e){this.a=e}function JL(e){this.a=e}function nee(e){this.a=e}function ree(e){this.a=e}function iee(e){this.a=e}function HR(e){this.b=e}function see(e){this.c=e}function aee(e){this.a=e}function oee(e){this.a=e}function cee(e){this.a=e}function uee(e){this.a=e}function lee(e){this.a=e}function hee(e){this.a=e}function fee(e){this.a=e}function dee(e){this.a=e}function s6(e){this.a=e}function gee(e){this.a=e}function Fx(e){this.a=e}function Oh(e){this.a=e}function pee(e){this.a=e}function a6(e){this.a=e}function jx(e){this.a=e}function lT(e){this.a=e}function $x(e){this.a=e}function hg(){this.a=[]}function bee(e,t){e.a=t}function jge(e,t){e.a=t}function $ge(e,t){e.b=t}function Hge(e,t){e.b=t}function zge(e,t){e.b=t}function eM(e,t){e.j=t}function Gge(e,t){e.g=t}function qge(e,t){e.i=t}function vee(e,t){e.c=t}function x1(e,t){e.d=t}function wee(e,t){e.d=t}function Vge(e,t){e.c=t}function T0(e,t){e.k=t}function mee(e,t){e.c=t}function zR(e,t){e.c=t}function GR(e,t){e.a=t}function yee(e,t){e.a=t}function Uge(e,t){e.f=t}function Wge(e,t){e.a=t}function sv(e,t){e.b=t}function tM(e,t){e.d=t}function hT(e,t){e.i=t}function qR(e,t){e.o=t}function Kge(e,t){e.r=t}function Yge(e,t){e.a=t}function VR(e,t){e.b=t}function av(e,t){e.e=t}function kee(e,t){e.f=t}function fT(e,t){e.g=t}function o6(e,t){e.e=t}function Xge(e,t){e.f=t}function Hx(e,t){e.f=t}function xee(e,t){e.n=t}function fg(e,t){e.a=t}function Qge(e,t){e.a=t}function _3(e,t){e.c=t}function Eee(e,t){e.c=t}function Tee(e,t){e.d=t}function UR(e,t){e.e=t}function WR(e,t){e.g=t}function _ee(e,t){e.a=t}function zx(e,t){e.c=t}function dT(e,t){e.d=t}function Zge(e,t){e.e=t}function Cee(e,t){e.f=t}function See(e,t){e.j=t}function Aee(e,t){e.a=t}function Jge(e,t){e.b=t}function Ac(e,t){e.a=t}function KR(e){e.b=e.a}function Lee(e){e.c=e.d.d}function c6(e){this.d=e}function dg(e){this.a=e}function vm(e){this.a=e}function nM(e){this.a=e}function E1(e){this.a=e}function u6(e){this.a=e}function Mee(e){this.a=e}function YR(e){this.a=e}function C3(e){this.a=e}function rM(e){this.a=e}function wm(e){this.a=e}function XR(e){this.a=e}function T1(e){this.a=e}function m(e){this.a=e}function g(e){this.a=e}function k(e){this.b=e}function T(e){this.b=e}function A(e){this.b=e}function D(e){this.a=e}function I(e){this.a=e}function F(e){this.a=e}function H(e){this.c=e}function C(e){this.c=e}function G(e){this.c=e}function U(e){this.a=e}function Z(e){this.a=e}function ne(e){this.a=e}function ae(e){this.a=e}function ue(e){this.a=e}function _e(e){this.a=e}function be(e){this.a=e}function Se(e){this.a=e}function Le(e){this.a=e}function Be(e){this.a=e}function Ke(e){this.a=e}function qe(e){this.a=e}function Re(e){this.a=e}function Ze(e){this.a=e}function $e(e){this.a=e}function ot(e){this.a=e}function ut(e){this.a=e}function Je(e){this.a=e}function Ct(e){this.a=e}function lt(e){this.a=e}function un(e){this.a=e}function Rt(e){this.a=e}function $t(e){this.a=e}function bn(e){this.a=e}function Cn(e){this.a=e}function Kn(e){this.a=e}function kn(e){this.a=e}function Wn(e){this.a=e}function sr(e){this.a=e}function yr(e){this.a=e}function hr(e){this.a=e}function nr(e){this.a=e}function fn(e){this.a=e}function vr(e){this.a=e}function gr(e){this.a=e}function ni(e){this.a=e}function Ti(e){this.a=e}function ia(e){this.a=e}function Ba(e){this.a=e}function Li(e){this.a=e}function wi(e){this.a=e}function Ts(e){this.a=e}function Yi(e){this.a=e}function Di(e){this.a=e}function es(e){this.a=e}function eo(e){this.e=e}function sa(e){this.a=e}function Ks(e){this.a=e}function Ar(e){this.a=e}function We(e){this.a=e}function On(e){this.a=e}function Ir(e){this.a=e}function ar(e){this.a=e}function or(e){this.a=e}function qa(e){this.a=e}function qr(e){this.a=e}function is(e){this.a=e}function Uo(e){this.a=e}function qc(e){this.a=e}function uo(e){this.a=e}function Lc(e){this.a=e}function Ra(e){this.a=e}function lo(e){this.a=e}function Sl(e){this.a=e}function Yf(e){this.a=e}function mp(e){this.a=e}function yp(e){this.a=e}function Xf(e){this.a=e}function gg(e){this.a=e}function fd(e){this.a=e}function ov(e){this.a=e}function mm(e){this.a=e}function l6(e){this.a=e}function S3(e){this.a=e}function h6(e){this.a=e}function gT(e){this.a=e}function A3(e){this.a=e}function qd(e){this.a=e}function _1(e){this.a=e}function Vd(e){this.a=e}function pT(e){this.a=e}function $2(e){this.a=e}function QR(e){this.a=e}function Dee(e){this.a=e}function Iee(e){this.a=e}function Oee(e){this.a=e}function Nee(e){this.a=e}function Pee(e){this.a=e}function Bee(e){this.a=e}function Ree(e){this.a=e}function Gx(e){this.a=e}function iM(e){this.a=e}function bT(e){this.a=e}function ZR(e){this.a=e}function JR(e){this.a=e}function Fee(e){this.a=e}function kp(e){this.a=e}function sM(e){this.a=e}function eF(e){this.a=e}function qx(e){this.c=e}function xp(e){this.b=e}function jee(e){this.a=e}function wje(e){this.a=e}function mje(e){this.a=e}function yje(e){this.a=e}function kje(e){this.a=e}function xje(e){this.a=e}function Eje(e){this.a=e}function Tje(e){this.a=e}function _je(e){this.a=e}function Cje(e){this.a=e}function Sje(e){this.a=e}function Aje(e){this.a=e}function Lje(e){this.a=e}function Mje(e){this.a=e}function Dje(e){this.a=e}function Ije(e){this.a=e}function Oje(e){this.a=e}function Nje(e){this.a=e}function Pje(e){this.a=e}function Bje(e){this.a=e}function Rje(e){this.a=e}function Fje(e){this.a=e}function jje(e){this.a=e}function $je(e){this.a=e}function Ep(e){this.a=e}function f6(e){this.a=e}function Hje(e){this.a=e}function zje(e){this.a=e}function Gje(e){this.a=e}function qje(e){this.a=e}function Vje(e){this.a=e}function Uje(e){this.a=e}function Wje(e){this.a=e}function Kje(e){this.a=e}function Yje(e){this.a=e}function Xje(e){this.a=e}function Qje(e){this.a=e}function Zje(e){this.a=e}function Jje(e){this.a=e}function e$e(e){this.a=e}function t$e(e){this.a=e}function n$e(e){this.a=e}function tF(e){this.a=e}function r$e(e){this.a=e}function i$e(e){this.a=e}function s$e(e){this.a=e}function a$e(e){this.a=e}function o$e(e){this.a=e}function c$e(e){this.a=e}function u$e(e){this.a=e}function l$e(e){this.a=e}function h$e(e){this.a=e}function f$e(e){this.a=e}function d$e(e){this.a=e}function g$e(e){this.a=e}function p$e(e){this.a=e}function b$e(e){this.a=e}function v$e(e){this.a=e}function w$e(e){this.a=e}function m$e(e){this.a=e}function y$e(e){this.a=e}function k$e(e){this.a=e}function x$e(e){this.a=e}function E$e(e){this.a=e}function T$e(e){this.a=e}function _$e(e){this.a=e}function C$e(e){this.a=e}function S$e(e){this.a=e}function A$e(e){this.a=e}function L$e(e){this.a=e}function M$e(e){this.a=e}function epe(e){this.a=e}function Zi(e){this.b=e}function D$e(e){this.f=e}function tpe(e){this.a=e}function I$e(e){this.a=e}function O$e(e){this.a=e}function N$e(e){this.a=e}function P$e(e){this.a=e}function B$e(e){this.a=e}function R$e(e){this.a=e}function F$e(e){this.a=e}function j$e(e){this.a=e}function aM(e){this.a=e}function $$e(e){this.a=e}function H$e(e){this.b=e}function npe(e){this.c=e}function nF(e){this.e=e}function z$e(e){this.a=e}function rF(e){this.a=e}function iF(e){this.a=e}function $ee(e){this.a=e}function G$e(e){this.a=e}function q$e(e){this.d=e}function rpe(e){this.a=e}function ipe(e){this.a=e}function cv(e){this.e=e}function nVt(){this.a=0}function L3(){EVe(this)}function st(){Ute(this)}function Mr(){sl(this)}function Hee(){SYe(this)}function V$e(){}function uv(){this.c=FAe}function rVt(e,t){t.Wb(e)}function U$e(e,t){e.b+=t}function W$e(e){e.b=new ite}function J(e){return e.e}function iVt(e){return e.a}function sVt(e){return e.a}function aVt(e){return e.a}function oVt(e){return e.a}function cVt(e){return e.a}function uVt(){return null}function lVt(){return null}function hVt(){qpe(),xyn()}function fVt(e){e.b.tf(e.e)}function vT(e,t){e.b=t-e.b}function wT(e,t){e.a=t-e.a}function K$e(e,t){t.ad(e.a)}function dVt(e,t){Vs(t,e)}function gVt(e,t,n){e.Od(n,t)}function oM(e,t){e.e=t,t.b=e}function spe(e){wd(),this.a=e}function Y$e(e){wd(),this.a=e}function X$e(e){wd(),this.a=e}function ape(e){Rm(),this.a=e}function Q$e(e){k8(),mue.be(e)}function H2(){aUe.call(this)}function ope(){aUe.call(this)}function cpe(){H2.call(this)}function zee(){H2.call(this)}function Z$e(){H2.call(this)}function cM(){H2.call(this)}function zu(){H2.call(this)}function mT(){H2.call(this)}function Fr(){H2.call(this)}function uh(){H2.call(this)}function J$e(){H2.call(this)}function xc(){H2.call(this)}function eHe(){H2.call(this)}function tHe(){this.a=this}function sF(){this.Bb|=256}function nHe(){this.b=new iVe}function upe(){upe=pe,new Mr}function lpe(){cpe.call(this)}function rHe(e,t){e.length=t}function aF(e,t){it(e.a,t)}function pVt(e,t){k4e(e.c,t)}function bVt(e,t){Gs(e.b,t)}function vVt(e,t){RH(e.a,t)}function wVt(e,t){Oie(e.a,t)}function Vx(e,t){_i(e.e,t)}function d6(e){JH(e.c,e.b)}function mVt(e,t){e.kc().Nb(t)}function hpe(e){this.a=von(e)}function Ys(){this.a=new Mr}function iHe(){this.a=new Mr}function oF(){this.a=new st}function Gee(){this.a=new st}function fpe(){this.a=new st}function Nh(){this.a=new Bc}function z2(){this.a=new PZe}function dpe(){this.a=new m9}function gpe(){this.a=new yGe}function sHe(){this.a=new cQe}function ppe(){this.a=new TXe}function bpe(){this.a=new KUe}function aHe(){this.a=new st}function vpe(){this.a=new st}function oHe(){this.a=new st}function cHe(){this.a=new st}function uHe(){this.d=new st}function lHe(){this.a=new Ys}function hHe(){this.a=new Mr}function fHe(){this.b=new Mr}function dHe(){this.b=new st}function wpe(){this.e=new st}function gHe(){this.d=new st}function pHe(){this.a=new zJ}function bHe(){st.call(this)}function mpe(){oF.call(this)}function vHe(){bj.call(this)}function wHe(){vpe.call(this)}function qee(){yT.call(this)}function yT(){V$e.call(this)}function g6(){V$e.call(this)}function ype(){g6.call(this)}function mHe(){tXe.call(this)}function yHe(){tXe.call(this)}function kHe(){Spe.call(this)}function xHe(){Spe.call(this)}function EHe(){Spe.call(this)}function THe(){Ape.call(this)}function Gu(){as.call(this)}function kpe(){dm.call(this)}function xpe(){dm.call(this)}function _He(){HHe.call(this)}function CHe(){HHe.call(this)}function SHe(){Mr.call(this)}function AHe(){Mr.call(this)}function LHe(){Mr.call(this)}function MHe(){Ys.call(this)}function Vee(){Qet.call(this)}function DHe(){sF.call(this)}function Uee(){Z2e.call(this)}function Wee(){Z2e.call(this)}function Epe(){Mr.call(this)}function Kee(){Mr.call(this)}function IHe(){Mr.call(this)}function Tpe(){Ex.call(this)}function OHe(){Ex.call(this)}function NHe(){Tpe.call(this)}function PHe(){qL.call(this)}function BHe(e){ket.call(this,e)}function RHe(e){ket.call(this,e)}function _pe(e){XL.call(this,e)}function Cpe(e){lGe.call(this,e)}function yVt(e){Cpe.call(this,e)}function kVt(e){lGe.call(this,e)}function Ux(){this.a=new as}function Spe(){this.a=new Ys}function Ape(){this.a=new Mr}function FHe(){this.a=new st}function jHe(){this.j=new st}function Lpe(){this.a=new $B}function $He(){this.a=new Pze}function HHe(){this.a=new UB}function Yee(){Yee=pe,due=new sze}function Xee(){Xee=pe,fue=new ize}function kT(){kT=pe,hue=new N}function cF(){cF=pe,bue=new iUe}function xVt(e){Cpe.call(this,e)}function EVt(e){Cpe.call(this,e)}function zHe(e){Cre.call(this,e)}function GHe(e){Cre.call(this,e)}function qHe(e){bWe.call(this,e)}function Qee(e){Gfn.call(this,e)}function lv(e){Em.call(this,e)}function xT(e){yF.call(this,e)}function Mpe(e){yF.call(this,e)}function VHe(e){yF.call(this,e)}function tc(e){MKe.call(this,e)}function UHe(e){tc.call(this,e)}function p6(){$x.call(this,{})}function uF(e){a8(),this.a=e}function ET(e){e.b=null,e.c=0}function TVt(e,t){e.e=t,Yot(e,t)}function _Vt(e,t){e.a=t,L1n(e)}function Zee(e,t,n){e.a[t.g]=n}function CVt(e,t,n){Vln(n,e,t)}function SVt(e,t){ZKt(t.i,e.n)}function WHe(e,t){Jsn(e).td(t)}function AVt(e,t){return e*e/t}function KHe(e,t){return e.g-t.g}function LVt(e){return new lT(e)}function MVt(e){return new Bm(e)}function lF(e){tc.call(this,e)}function Do(e){tc.call(this,e)}function YHe(e){tc.call(this,e)}function Jee(e){MKe.call(this,e)}function ete(e){Kme(),this.a=e}function XHe(e){xWe(),this.a=e}function ym(e){Mne(),this.f=e}function tte(e){Mne(),this.f=e}function Wx(e){tc.call(this,e)}function Ln(e){tc.call(this,e)}function Wo(e){tc.call(this,e)}function QHe(e){tc.call(this,e)}function b6(e){tc.call(this,e)}function It(e){return Sn(e),e}function Ue(e){return Sn(e),e}function uM(e){return Sn(e),e}function Dpe(e){return Sn(e),e}function DVt(e){return Sn(e),e}function TT(e){return e.b==e.c}function km(e){return!!e&&e.b}function IVt(e){return!!e&&e.k}function OVt(e){return!!e&&e.j}function Al(e){Sn(e),this.a=e}function Ipe(e){return ab(e),e}function _T(e){qve(e,e.length)}function pg(e){tc.call(this,e)}function dd(e){tc.call(this,e)}function nte(e){tc.call(this,e)}function M3(e){tc.call(this,e)}function CT(e){tc.call(this,e)}function $r(e){tc.call(this,e)}function rte(e){bbe.call(this,e,0)}function ite(){Twe.call(this,12,3)}function Ope(){Ope=pe,N8e=new xe}function ZHe(){ZHe=pe,O8e=new S}function hF(){hF=pe,YC=new ye}function JHe(){JHe=pe,M0t=new Ae}function eze(){throw J(new Fr)}function Npe(){throw J(new Fr)}function tze(){throw J(new Fr)}function NVt(){throw J(new Fr)}function PVt(){throw J(new Fr)}function BVt(){throw J(new Fr)}function ste(){this.a=Hr(Nr(io))}function v6(e){wd(),this.a=Nr(e)}function nze(e,t){e.Td(t),t.Sd(e)}function RVt(e,t){e.a.ec().Mc(t)}function FVt(e,t,n){e.c.lf(t,n)}function Ppe(e){Do.call(this,e)}function gd(e){Ln.call(this,e)}function bg(){u6.call(this,"")}function ST(){u6.call(this,"")}function Tp(){u6.call(this,"")}function xm(){u6.call(this,"")}function Bpe(e){Do.call(this,e)}function Kx(e){T.call(this,e)}function ate(e){oj.call(this,e)}function rze(e){Kx.call(this,e)}function ize(){cT.call(this,null)}function sze(){cT.call(this,null)}function fF(){fF=pe,k8()}function aze(){aze=pe,$0t=whn()}function oze(e){return e.a?e.b:0}function jVt(e){return e.a?e.b:0}function $Vt(e,t){return e.a-t.a}function HVt(e,t){return e.a-t.a}function zVt(e,t){return e.a-t.a}function dF(e,t){return gme(e,t)}function re(e,t){return SXe(e,t)}function GVt(e,t){return t in e.a}function cze(e,t){return e.f=t,e}function qVt(e,t){return e.b=t,e}function uze(e,t){return e.c=t,e}function VVt(e,t){return e.g=t,e}function Rpe(e,t){return e.a=t,e}function Fpe(e,t){return e.f=t,e}function UVt(e,t){return e.k=t,e}function jpe(e,t){return e.a=t,e}function WVt(e,t){return e.e=t,e}function $pe(e,t){return e.e=t,e}function KVt(e,t){return e.f=t,e}function YVt(e,t){e.b=!0,e.d=t}function XVt(e,t){e.b=new Io(t)}function QVt(e,t,n){t.td(e.a[n])}function ZVt(e,t,n){t.we(e.a[n])}function JVt(e,t){return e.b-t.b}function eUt(e,t){return e.g-t.g}function tUt(e,t){return e.s-t.s}function nUt(e,t){return e?0:t-1}function lze(e,t){return e?0:t-1}function rUt(e,t){return e?t-1:0}function iUt(e,t){return t.Yf(e)}function hv(e,t){return e.b=t,e}function gF(e,t){return e.a=t,e}function fv(e,t){return e.c=t,e}function dv(e,t){return e.d=t,e}function gv(e,t){return e.e=t,e}function Hpe(e,t){return e.f=t,e}function AT(e,t){return e.a=t,e}function Yx(e,t){return e.b=t,e}function Xx(e,t){return e.c=t,e}function Wt(e,t){return e.c=t,e}function pn(e,t){return e.b=t,e}function Kt(e,t){return e.d=t,e}function Yt(e,t){return e.e=t,e}function sUt(e,t){return e.f=t,e}function Xt(e,t){return e.g=t,e}function Qt(e,t){return e.a=t,e}function Zt(e,t){return e.i=t,e}function Jt(e,t){return e.j=t,e}function hze(e,t){return e.k=t,e}function aUt(e,t){return e.j=t,e}function oUt(e,t){Xp(),rc(t,e)}function cUt(e,t,n){nZt(e.a,t,n)}function fze(e){LYe.call(this,e)}function zpe(e){LYe.call(this,e)}function pF(e){dne.call(this,e)}function dze(e){_on.call(this,e)}function _p(e){jv.call(this,e)}function gze(e){tre.call(this,e)}function pze(e){tre.call(this,e)}function bze(){W2e.call(this,"")}function Fa(){this.a=0,this.b=0}function vze(){this.b=0,this.a=0}function wze(e,t){e.b=0,Wm(e,t)}function uUt(e,t){e.c=t,e.b=!0}function mze(e,t){return e.c._b(t)}function Qf(e){return e.e&&e.e()}function ote(e){return e?e.d:null}function yze(e,t){return Knt(e.b,t)}function lUt(e){return e?e.g:null}function hUt(e){return e?e.i:null}function Cp(e){return S0(e),e.o}function pv(){pv=pe,F3t=Lln()}function kze(){kze=pe,la=Hhn()}function Qx(){Qx=pe,RAe=Dln()}function xze(){xze=pe,x4t=Mln()}function Gpe(){Gpe=pe,Sc=C1n()}function qpe(){qpe=pe,x2=F8()}function Eze(){throw J(new Fr)}function Tze(){throw J(new Fr)}function _ze(){throw J(new Fr)}function Cze(){throw J(new Fr)}function Sze(){throw J(new Fr)}function Aze(){throw J(new Fr)}function bF(e){this.a=new w6(e)}function Vpe(e){_lt(),Pyn(this,e)}function Sp(e){this.a=new Nne(e)}function D3(e,t){for(;e.ye(t););}function Upe(e,t){for(;e.sd(t););}function I3(e,t){return e.a+=t,e}function cte(e,t){return e.a+=t,e}function vg(e,t){return e.a+=t,e}function bv(e,t){return e.a+=t,e}function LT(e){return Fp(e),e.a}function vF(e){return e.b!=e.d.c}function Lze(e){return e.l|e.m<<22}function Wpe(e,t){return e.d[t.p]}function Mze(e,t){return ppn(e,t)}function Kpe(e,t,n){e.splice(t,n)}function Dze(e){e.c?bct(e):vct(e)}function wF(e){this.a=0,this.b=e}function Ize(){this.a=new fI(X_e)}function Oze(){this.b=new fI(B_e)}function Nze(){this.b=new fI(Fhe)}function Pze(){this.b=new fI(Fhe)}function Bze(){throw J(new Fr)}function Rze(){throw J(new Fr)}function Fze(){throw J(new Fr)}function jze(){throw J(new Fr)}function $ze(){throw J(new Fr)}function Hze(){throw J(new Fr)}function zze(){throw J(new Fr)}function Gze(){throw J(new Fr)}function qze(){throw J(new Fr)}function Vze(){throw J(new Fr)}function fUt(){throw J(new xc)}function dUt(){throw J(new xc)}function lM(e){this.a=new Uze(e)}function Uze(e){Tin(this,e,Thn())}function hM(e){return!e||dYe(e)}function fM(e){return J1[e]!=-1}function gUt(){BG!=0&&(BG=0),RG=-1}function Wze(){lue==null&&(lue=[])}function pUt(e,t){$se(He(e.a),t)}function bUt(e,t){$se(He(e.a),t)}function dM(e,t){H3.call(this,e,t)}function Zx(e,t){dM.call(this,e,t)}function Ype(e,t){this.b=e,this.c=t}function Kze(e,t){this.b=e,this.a=t}function Yze(e,t){this.a=e,this.b=t}function Xze(e,t){this.a=e,this.b=t}function Qze(e,t){this.a=e,this.b=t}function Zze(e,t){this.a=e,this.b=t}function Jze(e,t){this.a=e,this.b=t}function eGe(e,t){this.a=e,this.b=t}function tGe(e,t){this.a=e,this.b=t}function nGe(e,t){this.a=e,this.b=t}function rGe(e,t){this.b=e,this.a=t}function iGe(e,t){this.b=e,this.a=t}function sGe(e,t){this.b=e,this.a=t}function aGe(e,t){this.b=e,this.a=t}function Kr(e,t){this.f=e,this.g=t}function Jx(e,t){this.e=e,this.d=t}function vv(e,t){this.g=e,this.i=t}function ute(e,t){this.a=e,this.b=t}function oGe(e,t){this.a=e,this.f=t}function cGe(e,t){this.b=e,this.c=t}function vUt(e,t){this.a=e,this.b=t}function uGe(e,t){this.a=e,this.b=t}function lte(e,t){this.a=e,this.b=t}function lGe(e){sbe(e.dc()),this.c=e}function mF(e){this.b=u(Nr(e),83)}function hGe(e){this.a=u(Nr(e),83)}function Em(e){this.a=u(Nr(e),15)}function fGe(e){this.a=u(Nr(e),15)}function yF(e){this.b=u(Nr(e),47)}function kF(){this.q=new b.Date}function Ud(){Ud=pe,Y8e=new Et}function e8(){e8=pe,Y7=new rt}function MT(e){return e.f.c+e.g.c}function gM(e,t){return e.b.Hc(t)}function dGe(e,t){return e.b.Ic(t)}function gGe(e,t){return e.b.Qc(t)}function pGe(e,t){return e.b.Hc(t)}function bGe(e,t){return e.c.uc(t)}function _0(e,t){return e.a._b(t)}function vGe(e,t){return Ci(e.c,t)}function wGe(e,t){return Il(e.b,t)}function mGe(e,t){return e>t&&t0}function fte(e,t){return Mc(e,t)<0}function BT(e,t){return e.a.get(t)}function MUt(e,t){return t.split(e)}function FGe(e,t){return Il(e.e,t)}function r2e(e){return Sn(e),!1}function DF(e){mn.call(this,e,21)}function DUt(e,t){pXe.call(this,e,t)}function IF(e,t){Kr.call(this,e,t)}function dte(e,t){Kr.call(this,e,t)}function i2e(e){Wne(),bWe.call(this,e)}function s2e(e,t){mKe(e,e.length,t)}function mM(e,t){KKe(e,e.length,t)}function IUt(e,t,n){t.ud(e.a.Ge(n))}function OUt(e,t,n){t.we(e.a.Fe(n))}function NUt(e,t,n){t.td(e.a.Kb(n))}function PUt(e,t,n){e.Mb(n)&&t.td(n)}function RT(e,t,n){e.splice(t,0,n)}function BUt(e,t){return Vu(e.e,t)}function OF(e,t){this.d=e,this.e=t}function jGe(e,t){this.b=e,this.a=t}function $Ge(e,t){this.b=e,this.a=t}function a2e(e,t){this.b=e,this.a=t}function HGe(e,t){this.a=e,this.b=t}function zGe(e,t){this.a=e,this.b=t}function GGe(e,t){this.a=e,this.b=t}function qGe(e,t){this.a=e,this.b=t}function y6(e,t){this.a=e,this.b=t}function o2e(e,t){this.b=e,this.a=t}function c2e(e,t){this.b=e,this.a=t}function NF(e,t){Kr.call(this,e,t)}function PF(e,t){Kr.call(this,e,t)}function u2e(e,t){Kr.call(this,e,t)}function l2e(e,t){Kr.call(this,e,t)}function O3(e,t){Kr.call(this,e,t)}function gte(e,t){Kr.call(this,e,t)}function pte(e,t){Kr.call(this,e,t)}function bte(e,t){Kr.call(this,e,t)}function BF(e,t){Kr.call(this,e,t)}function h2e(e,t){Kr.call(this,e,t)}function vte(e,t){Kr.call(this,e,t)}function yM(e,t){Kr.call(this,e,t)}function RF(e,t){Kr.call(this,e,t)}function wte(e,t){Kr.call(this,e,t)}function FT(e,t){Kr.call(this,e,t)}function f2e(e,t){Kr.call(this,e,t)}function Cs(e,t){Kr.call(this,e,t)}function FF(e,t){Kr.call(this,e,t)}function VGe(e,t){this.a=e,this.b=t}function UGe(e,t){this.a=e,this.b=t}function WGe(e,t){this.a=e,this.b=t}function KGe(e,t){this.a=e,this.b=t}function YGe(e,t){this.a=e,this.b=t}function XGe(e,t){this.a=e,this.b=t}function QGe(e,t){this.a=e,this.b=t}function ZGe(e,t){this.a=e,this.b=t}function JGe(e,t){this.a=e,this.b=t}function d2e(e,t){this.b=e,this.a=t}function eqe(e,t){this.b=e,this.a=t}function tqe(e,t){this.b=e,this.a=t}function nqe(e,t){this.b=e,this.a=t}function r8(e,t){this.c=e,this.d=t}function rqe(e,t){this.e=e,this.d=t}function iqe(e,t){this.a=e,this.b=t}function sqe(e,t){this.b=t,this.c=e}function jF(e,t){Kr.call(this,e,t)}function kM(e,t){Kr.call(this,e,t)}function mte(e,t){Kr.call(this,e,t)}function jT(e,t){Kr.call(this,e,t)}function g2e(e,t){Kr.call(this,e,t)}function yte(e,t){Kr.call(this,e,t)}function kte(e,t){Kr.call(this,e,t)}function xM(e,t){Kr.call(this,e,t)}function p2e(e,t){Kr.call(this,e,t)}function xte(e,t){Kr.call(this,e,t)}function $T(e,t){Kr.call(this,e,t)}function b2e(e,t){Kr.call(this,e,t)}function HT(e,t){Kr.call(this,e,t)}function zT(e,t){Kr.call(this,e,t)}function _m(e,t){Kr.call(this,e,t)}function Ete(e,t){Kr.call(this,e,t)}function Tte(e,t){Kr.call(this,e,t)}function v2e(e,t){Kr.call(this,e,t)}function GT(e,t){Kr.call(this,e,t)}function _te(e,t){Kr.call(this,e,t)}function $F(e,t){Kr.call(this,e,t)}function EM(e,t){Kr.call(this,e,t)}function TM(e,t){Kr.call(this,e,t)}function k6(e,t){Kr.call(this,e,t)}function Cte(e,t){Kr.call(this,e,t)}function w2e(e,t){Kr.call(this,e,t)}function Ste(e,t){Kr.call(this,e,t)}function Ate(e,t){Kr.call(this,e,t)}function m2e(e,t){Kr.call(this,e,t)}function Lte(e,t){Kr.call(this,e,t)}function Mte(e,t){Kr.call(this,e,t)}function Dte(e,t){Kr.call(this,e,t)}function Ite(e,t){Kr.call(this,e,t)}function y2e(e,t){Kr.call(this,e,t)}function aqe(e,t){this.b=e,this.a=t}function oqe(e,t){this.a=e,this.b=t}function cqe(e,t){this.a=e,this.b=t}function uqe(e,t){this.a=e,this.b=t}function lqe(e,t){this.a=e,this.b=t}function k2e(e,t){Kr.call(this,e,t)}function x2e(e,t){Kr.call(this,e,t)}function hqe(e,t){this.b=e,this.d=t}function E2e(e,t){Kr.call(this,e,t)}function T2e(e,t){Kr.call(this,e,t)}function fqe(e,t){this.a=e,this.b=t}function dqe(e,t){this.a=e,this.b=t}function HF(e,t){Kr.call(this,e,t)}function qT(e,t){Kr.call(this,e,t)}function _2e(e,t){Kr.call(this,e,t)}function C2e(e,t){Kr.call(this,e,t)}function S2e(e,t){Kr.call(this,e,t)}function Ote(e,t){Kr.call(this,e,t)}function A2e(e,t){Kr.call(this,e,t)}function Nte(e,t){Kr.call(this,e,t)}function zF(e,t){Kr.call(this,e,t)}function Pte(e,t){Kr.call(this,e,t)}function Bte(e,t){Kr.call(this,e,t)}function _M(e,t){Kr.call(this,e,t)}function Rte(e,t){Kr.call(this,e,t)}function L2e(e,t){Kr.call(this,e,t)}function CM(e,t){Kr.call(this,e,t)}function M2e(e,t){Kr.call(this,e,t)}function RUt(e,t){return Vu(e.c,t)}function FUt(e,t){return Vu(t.b,e)}function jUt(e,t){return-e.b.Je(t)}function D2e(e,t){return Vu(e.g,t)}function SM(e,t){Kr.call(this,e,t)}function x6(e,t){Kr.call(this,e,t)}function gqe(e,t){this.a=e,this.b=t}function pqe(e,t){this.a=e,this.b=t}function Pt(e,t){this.a=e,this.b=t}function VT(e,t){Kr.call(this,e,t)}function UT(e,t){Kr.call(this,e,t)}function AM(e,t){Kr.call(this,e,t)}function Fte(e,t){Kr.call(this,e,t)}function GF(e,t){Kr.call(this,e,t)}function WT(e,t){Kr.call(this,e,t)}function jte(e,t){Kr.call(this,e,t)}function qF(e,t){Kr.call(this,e,t)}function N3(e,t){Kr.call(this,e,t)}function LM(e,t){Kr.call(this,e,t)}function KT(e,t){Kr.call(this,e,t)}function YT(e,t){Kr.call(this,e,t)}function MM(e,t){Kr.call(this,e,t)}function VF(e,t){Kr.call(this,e,t)}function P3(e,t){Kr.call(this,e,t)}function UF(e,t){Kr.call(this,e,t)}function bqe(e,t){this.a=e,this.b=t}function vqe(e,t){this.a=e,this.b=t}function wqe(e,t){this.a=e,this.b=t}function mqe(e,t){this.a=e,this.b=t}function yqe(e,t){this.a=e,this.b=t}function kqe(e,t){this.a=e,this.b=t}function xa(e,t){this.a=e,this.b=t}function WF(e,t){Kr.call(this,e,t)}function xqe(e,t){this.a=e,this.b=t}function Eqe(e,t){this.a=e,this.b=t}function Tqe(e,t){this.a=e,this.b=t}function _qe(e,t){this.a=e,this.b=t}function Cqe(e,t){this.a=e,this.b=t}function Sqe(e,t){this.a=e,this.b=t}function Aqe(e,t){this.b=e,this.a=t}function Lqe(e,t){this.b=e,this.a=t}function Mqe(e,t){this.b=e,this.a=t}function Dqe(e,t){this.b=e,this.a=t}function Iqe(e,t){this.a=e,this.b=t}function Oqe(e,t){this.a=e,this.b=t}function $Ut(e,t){bgn(e.a,u(t,56))}function Nqe(e,t){Arn(e.a,u(t,11))}function HUt(e,t){return h8(),t!=e}function Pqe(){return aze(),new $0t}function Bqe(){fre(),this.b=new Ys}function Rqe(){az(),this.a=new Ys}function Fqe(){Ewe(),Ive.call(this)}function E6(e,t){Kr.call(this,e,t)}function jqe(e,t){this.a=e,this.b=t}function $qe(e,t){this.a=e,this.b=t}function KF(e,t){this.a=e,this.b=t}function Hqe(e,t){this.a=e,this.b=t}function zqe(e,t){this.a=e,this.b=t}function Gqe(e,t){this.a=e,this.b=t}function qqe(e,t){this.d=e,this.b=t}function I2e(e,t){this.d=e,this.e=t}function Vqe(e,t){this.f=e,this.c=t}function DM(e,t){this.b=e,this.c=t}function O2e(e,t){this.i=e,this.g=t}function Uqe(e,t){this.e=e,this.a=t}function Wqe(e,t){this.a=e,this.b=t}function N2e(e,t){e.i=null,X$(e,t)}function zUt(e,t){e&&Si(oN,e,t)}function Kqe(e,t){return qie(e.a,t)}function YF(e){return qD(e.c,e.b)}function hc(e){return e?e.dd():null}function je(e){return e??null}function Cm(e){return typeof e===sk}function Sm(e){return typeof e===d6e}function fa(e){return typeof e===Mae}function Mp(e,t){return e.Hd().Xb(t)}function XF(e,t){return isn(e.Kc(),t)}function mv(e,t){return Mc(e,t)==0}function GUt(e,t){return Mc(e,t)>=0}function XT(e,t){return Mc(e,t)!=0}function qUt(e){return""+(Sn(e),e)}function IM(e,t){return e.substr(t)}function Yqe(e){return bl(e),e.d.gc()}function $te(e){return $dn(e,e.c),e}function QF(e){return u_(e==null),e}function QT(e,t){return e.a+=""+t,e}function To(e,t){return e.a+=""+t,e}function ZT(e,t){return e.a+=""+t,e}function Ec(e,t){return e.a+=""+t,e}function Yr(e,t){return e.a+=""+t,e}function P2e(e,t){return e.a+=""+t,e}function Xqe(e,t){ks(e,t,e.a,e.a.a)}function q2(e,t){ks(e,t,e.c.b,e.c)}function VUt(e,t,n){ost(t,Ose(e,n))}function UUt(e,t,n){ost(t,Ose(e,n))}function WUt(e,t){jrn(new rr(e),t)}function Qqe(e,t){e.q.setTime(Bv(t))}function Zqe(e,t){Hve.call(this,e,t)}function Jqe(e,t){Hve.call(this,e,t)}function Hte(e,t){Hve.call(this,e,t)}function eVe(e){sl(this),P_(this,e)}function B2e(e){return xn(e,0),null}function Zf(e){return e.a=0,e.b=0,e}function tVe(e,t){return e.a=t.g+1,e}function KUt(e,t){return e.j[t.p]==2}function R2e(e){return MZt(u(e,79))}function nVe(){nVe=pe,Ngt=Qr(Xie())}function rVe(){rVe=pe,Qpt=Qr(Hot())}function iVe(){this.b=new w6(qm(12))}function sVe(){this.b=0,this.a=!1}function aVe(){this.b=0,this.a=!1}function JT(e){this.a=e,nT.call(this)}function oVe(e){this.a=e,nT.call(this)}function dn(e,t){zs.call(this,e,t)}function zte(e,t){Im.call(this,e,t)}function B3(e,t){O2e.call(this,e,t)}function Gte(e,t){G8.call(this,e,t)}function cVe(e,t){OM.call(this,e,t)}function ui(e,t){LF(),Si(QV,e,t)}function qte(e,t){return jl(e.a,0,t)}function uVe(e,t){return e.a.a.a.cc(t)}function lVe(e,t){return je(e)===je(t)}function YUt(e,t){return Fs(e.a,t.a)}function XUt(e,t){return Tu(e.a,t.a)}function QUt(e,t){return VKe(e.a,t.a)}function pd(e,t){return e.indexOf(t)}function yv(e,t){return e==t?0:e?1:-1}function ZF(e){return e<10?"0"+e:""+e}function ZUt(e){return Nr(e),new JT(e)}function hVe(e){return fu(e.l,e.m,e.h)}function i8(e){return _s((Sn(e),e))}function JUt(e){return _s((Sn(e),e))}function fVe(e,t){return Tu(e.g,t.g)}function Ko(e){return typeof e===d6e}function eWt(e){return e==vw||e==_y}function tWt(e){return e==vw||e==Ty}function F2e(e){return Yo(e.b.b,e,0)}function dVe(e){this.a=Pqe(),this.b=e}function gVe(e){this.a=Pqe(),this.b=e}function nWt(e,t){return it(e.a,t),t}function rWt(e,t){return it(e.c,t),e}function pVe(e,t){return Vl(e.a,t),e}function iWt(e,t){return mf(),t.a+=e}function sWt(e,t){return mf(),t.a+=e}function aWt(e,t){return mf(),t.c+=e}function j2e(e,t){L8(e,0,e.length,t)}function C0(){be.call(this,new Z2)}function bVe(){Dj.call(this,0,0,0,0)}function T6(){fh.call(this,0,0,0,0)}function Io(e){this.a=e.a,this.b=e.b}function Dp(e){return e==Xh||e==Df}function s8(e){return e==X0||e==Y0}function vVe(e){return e==K4||e==W4}function R3(e){return e!=X1&&e!=w2}function Ll(e){return e.Lg()&&e.Mg()}function wVe(e){return Wj(u(e,118))}function JF(e){return Vl(new Xs,e)}function mVe(e,t){return new G8(t,e)}function oWt(e,t){return new G8(t,e)}function $2e(e,t,n){z$(e,t),G$(e,n)}function ej(e,t,n){zv(e,t),Hv(e,n)}function C1(e,t,n){Du(e,t),Iu(e,n)}function tj(e,t,n){O8(e,t),P8(e,n)}function nj(e,t,n){N8(e,t),B8(e,n)}function Vte(e,t){Y8(e,t),R8(e,e.D)}function H2e(e){Vqe.call(this,e,!0)}function yVe(e,t,n){Mbe.call(this,e,t,n)}function Ip(e){Qp(),csn.call(this,e)}function kVe(){IF.call(this,"Head",1)}function xVe(){IF.call(this,"Tail",3)}function Ute(e){e.c=Me(Yn,yt,1,0,5,1)}function EVe(e){e.a=Me(Yn,yt,1,8,5,1)}function TVe(e){Mu(e.xf(),new hr(e))}function F3(e){return e!=null?Xi(e):0}function cWt(e,t){return Vm(t,L1(e))}function uWt(e,t){return Vm(t,L1(e))}function lWt(e,t){return e[e.length]=t}function hWt(e,t){return e[e.length]=t}function z2e(e){return lQt(e.b.Kc(),e.a)}function fWt(e,t){return Y$(Vne(e.d),t)}function dWt(e,t){return Y$(Vne(e.g),t)}function gWt(e,t){return Y$(Vne(e.j),t)}function fo(e,t){zs.call(this,e.b,t)}function kv(e){Dj.call(this,e,e,e,e)}function G2e(e){return e.b&&dae(e),e.a}function q2e(e){return e.b&&dae(e),e.c}function pWt(e,t){V1||(e.b=t)}function Wte(e,t,n){return cs(e,t,n),n}function _Ve(e,t,n){cs(e.c[t.g],t.g,n)}function bWt(e,t,n){u(e.c,69).Xh(t,n)}function vWt(e,t,n){C1(n,n.i+e,n.j+t)}function wWt(e,t){Br(jc(e.a),jXe(t))}function mWt(e,t){Br(gl(e.a),$Xe(t))}function e_(e){yi(),cv.call(this,e)}function yWt(e){return e==null?0:Xi(e)}function CVe(){CVe=pe,vhe=new V_(ffe)}function jr(){jr=pe,new SVe,new st}function SVe(){new Mr,new Mr,new Mr}function V2e(){V2e=pe,upe(),P8e=new Mr}function S1(){S1=pe,b.Math.log(2)}function lh(){lh=pe,b0=(OGe(),q3t)}function kWt(){throw J(new pg(p0t))}function xWt(){throw J(new pg(p0t))}function EWt(){throw J(new pg(b0t))}function TWt(){throw J(new pg(b0t))}function AVe(e){this.a=e,uve.call(this,e)}function Kte(e){this.a=e,mF.call(this,e)}function Yte(e){this.a=e,mF.call(this,e)}function aa(e,t){Cne(e.c,e.c.length,t)}function nc(e){return e.at?1:0}function MVe(e,t){return Mc(e,t)>0?e:t}function fu(e,t,n){return{l:e,m:t,h:n}}function _Wt(e,t){e.a!=null&&Nqe(t,e.a)}function DVe(e){e.a=new wt,e.c=new wt}function rj(e){this.b=e,this.a=new st}function IVe(e){this.b=new ug,this.a=e}function W2e(e){jbe.call(this),this.a=e}function OVe(){IF.call(this,"Range",2)}function NVe(){H3e(),this.a=new fI(uEe)}function CWt(e,t){Nr(t),G3(e).Jc(new ce)}function SWt(e,t){return $l(),t.n.b+=e}function AWt(e,t,n){return Si(e.g,n,t)}function LWt(e,t,n){return Si(e.k,n,t)}function MWt(e,t){return Si(e.a,t.a,t)}function j3(e,t,n){return o3e(t,n,e.c)}function K2e(e){return new Pt(e.c,e.d)}function DWt(e){return new Pt(e.c,e.d)}function fc(e){return new Pt(e.a,e.b)}function PVe(e,t){return emn(e.a,t,null)}function IWt(e){Va(e,null),ba(e,null)}function BVe(e){gre(e,null),pre(e,null)}function RVe(){OM.call(this,null,null)}function FVe(){hj.call(this,null,null)}function Y2e(e){this.a=e,Mr.call(this)}function OWt(e){this.b=(hn(),new H(e))}function ij(e){e.j=Me(K8e,Qe,310,0,0,1)}function NWt(e,t,n){e.c.Vc(t,u(n,133))}function PWt(e,t,n){e.c.ji(t,u(n,133))}function jVe(e,t){_r(e),e.Gc(u(t,15))}function t_(e,t){return bwn(e.c,e.b,t)}function BWt(e,t){return new oUe(e.Kc(),t)}function Xte(e,t){return Psn(e.Kc(),t)!=-1}function X2e(e,t){return e.a.Bc(t)!=null}function sj(e){return e.Ob()?e.Pb():null}function $Ve(e){return jh(e,0,e.length)}function we(e,t){return e!=null&&ese(e,t)}function RWt(e,t){e.q.setHours(t),lC(e,t)}function HVe(e,t){e.c&&(yve(t),dXe(t))}function FWt(e,t,n){u(e.Kb(n),164).Nb(t)}function jWt(e,t,n){return Wwn(e,t,n),n}function zVe(e,t,n){e.a=t^1502,e.b=n^uoe}function Qte(e,t,n){return e.a[t.g][n.g]}function A1(e,t){return e.a[t.c.p][t.p]}function $Wt(e,t){return e.e[t.c.p][t.p]}function HWt(e,t){return e.c[t.c.p][t.p]}function zWt(e,t){return e.j[t.p]=Q0n(t)}function GWt(e,t){return Jwe(e.f,t.tg())}function qWt(e,t){return Jwe(e.b,t.tg())}function VWt(e,t){return e.a0?t*t/e:t*t*100}function bKt(e,t){return e>0?t/(e*e):t*100}function vKt(e,t,n){return it(t,drt(e,n))}function wKt(e,t,n){A$(),e.Xe(t)&&n.td(e)}function c8(e,t,n){var r;r=e.Zc(t),r.Rb(n)}function Lm(e,t,n){return e.a+=t,e.b+=n,e}function mKt(e,t,n){return e.a*=t,e.b*=n,e}function BM(e,t,n){return e.a-=t,e.b-=n,e}function ybe(e,t){return e.a=t.a,e.b=t.b,e}function gj(e){return e.a=-e.a,e.b=-e.b,e}function mUe(e){this.c=e,this.a=1,this.b=1}function yUe(e){this.c=e,Du(e,0),Iu(e,0)}function kUe(e){as.call(this),D_(this,e)}function xUe(e){Aae(),W$e(this),this.mf(e)}function EUe(e,t){PT(),OM.call(this,e,t)}function kbe(e,t){wg(),hj.call(this,e,t)}function TUe(e,t){wg(),hj.call(this,e,t)}function _Ue(e,t){wg(),kbe.call(this,e,t)}function Ml(e,t,n){Nl.call(this,e,t,n,2)}function ine(e,t){lh(),Mj.call(this,e,t)}function CUe(e,t){lh(),ine.call(this,e,t)}function xbe(e,t){lh(),ine.call(this,e,t)}function SUe(e,t){lh(),xbe.call(this,e,t)}function Ebe(e,t){lh(),Mj.call(this,e,t)}function AUe(e,t){lh(),Ebe.call(this,e,t)}function LUe(e,t){lh(),Mj.call(this,e,t)}function yKt(e,t){return e.c.Fc(u(t,133))}function Tbe(e,t,n){return wz(wD(e,t),n)}function kKt(e,t,n){return t.Qk(e.e,e.c,n)}function xKt(e,t,n){return t.Rk(e.e,e.c,n)}function sne(e,t){return Up(e.e,u(t,49))}function EKt(e,t,n){G_(gl(e.a),t,$Xe(n))}function TKt(e,t,n){G_(jc(e.a),t,jXe(n))}function _be(e,t){t.$modCount=e.$modCount}function a_(){a_=pe,MS=new Zi("root")}function u8(){u8=pe,uN=new _He,new CHe}function MUe(){this.a=new Nv,this.b=new Nv}function Cbe(){Qet.call(this),this.Bb|=so}function DUe(){Kr.call(this,"GROW_TREE",0)}function _Kt(e){return e==null?null:Gmn(e)}function CKt(e){return e==null?null:Qfn(e)}function SKt(e){return e==null?null:Qo(e)}function AKt(e){return e==null?null:Qo(e)}function S0(e){e.o==null&&_0n(e)}function Mt(e){return u_(e==null||Cm(e)),e}function ft(e){return u_(e==null||Sm(e)),e}function Hr(e){return u_(e==null||fa(e)),e}function Sbe(e){this.q=new b.Date(Bv(e))}function RM(e,t){this.c=e,Jx.call(this,e,t)}function pj(e,t){this.a=e,RM.call(this,e,t)}function LKt(e,t){this.d=e,Lee(this),this.b=t}function Abe(e,t){Bre.call(this,e),this.a=t}function Lbe(e,t){Bre.call(this,e),this.a=t}function MKt(e){n3e.call(this,0,0),this.f=e}function Mbe(e,t,n){C$.call(this,e,t,n,null)}function IUe(e,t,n){C$.call(this,e,t,n,null)}function DKt(e,t,n){return e.ue(t,n)<=0?n:t}function IKt(e,t,n){return e.ue(t,n)<=0?t:n}function OKt(e,t){return u(Fv(e.b,t),149)}function NKt(e,t){return u(Fv(e.c,t),229)}function ane(e){return u(St(e.a,e.b),287)}function OUe(e){return new Pt(e.c,e.d+e.a)}function NUe(e){return $l(),vVe(u(e,197))}function Mm(){Mm=pe,F7e=rn((Bl(),Hb))}function PKt(e,t){t.a?ypn(e,t):Zte(e.a,t.b)}function PUe(e,t){V1||it(e.a,t)}function BKt(e,t){return bM(),z8(t.d.i,e)}function RKt(e,t){return U6(),new jct(t,e)}function vd(e,t){return JM(t,O6e),e.f=t,e}function Dbe(e,t,n){return n=Kl(e,t,3,n),n}function Ibe(e,t,n){return n=Kl(e,t,6,n),n}function Obe(e,t,n){return n=Kl(e,t,9,n),n}function FM(e,t,n){++e.j,e.Ki(),Nre(e,t,n)}function BUe(e,t,n){++e.j,e.Hi(t,e.oi(t,n))}function RUe(e,t,n){var r;r=e.Zc(t),r.Rb(n)}function FUe(e,t,n){return W5e(e.c,e.b,t,n)}function Nbe(e,t){return(t&Ei)%e.d.length}function zs(e,t){Zi.call(this,e),this.a=t}function Pbe(e,t){npe.call(this,e),this.a=t}function one(e,t){npe.call(this,e),this.a=t}function jUe(e,t){this.c=e,jv.call(this,t)}function $Ue(e,t){this.a=e,H$e.call(this,t)}function jM(e,t){this.a=e,H$e.call(this,t)}function HUe(e){this.a=(ql(e,fy),new su(e))}function zUe(e){this.a=(ql(e,fy),new su(e))}function $M(e){return!e.a&&(e.a=new se),e.a}function GUe(e){return e>8?0:e+1}function FKt(e,t){return Mn(),e==t?0:e?1:-1}function Bbe(e,t,n){return M6(e,u(t,22),n)}function jKt(e,t,n){return e.apply(t,n)}function qUe(e,t,n){return e.a+=jh(t,0,n),e}function Rbe(e,t){var n;return n=e.e,e.e=t,n}function $Kt(e,t){var n;n=e[coe],n.call(e,t)}function HKt(e,t){var n;n=e[coe],n.call(e,t)}function Dm(e,t){e.a.Vc(e.b,t),++e.b,e.c=-1}function VUe(e){sl(e.e),e.d.b=e.d,e.d.a=e.d}function HM(e){e.b?HM(e.b):e.f.c.zc(e.e,e.d)}function zKt(e,t,n){G2(),bee(e,t.Ce(e.a,n))}function GKt(e,t){return ote(Lrt(e.a,t,!0))}function qKt(e,t){return ote(Mrt(e.a,t,!0))}function wf(e,t){return dF(new Array(t),e)}function cne(e){return String.fromCharCode(e)}function VKt(e){return e==null?null:e.message}function UUe(){this.a=new st,this.b=new st}function WUe(){this.a=new m9,this.b=new nHe}function KUe(){this.b=new Fa,this.c=new st}function Fbe(){this.d=new Fa,this.e=new Fa}function jbe(){this.n=new Fa,this.o=new Fa}function bj(){this.n=new g6,this.i=new T6}function YUe(){this.a=new FJ,this.b=new $X}function XUe(){this.a=new st,this.d=new st}function QUe(){this.b=new Ys,this.a=new Ys}function ZUe(){this.b=new Mr,this.a=new Mr}function JUe(){this.b=new Oze,this.a=new OQ}function eWe(){bj.call(this),this.a=new Fa}function o_(e){bsn.call(this,e,(M$(),_ue))}function $be(e,t,n,r){Dj.call(this,e,t,n,r)}function UKt(e,t,n){n!=null&&W$(t,hse(e,n))}function WKt(e,t,n){n!=null&&K$(t,hse(e,n))}function Hbe(e,t,n){return n=Kl(e,t,11,n),n}function Ni(e,t){return e.a+=t.a,e.b+=t.b,e}function da(e,t){return e.a-=t.a,e.b-=t.b,e}function KKt(e,t){return e.n.a=(Sn(t),t+10)}function YKt(e,t){return e.n.a=(Sn(t),t+10)}function XKt(e,t){return t==e||u7(rz(t),e)}function tWe(e,t){return Si(e.a,t,"")==null}function QKt(e,t){return bM(),!z8(t.d.i,e)}function ZKt(e,t){Dp(e.f)?p0n(e,t):Jhn(e,t)}function JKt(e,t){var n;return n=t.Hh(e.a),n}function Im(e,t){Do.call(this,$C+e+Eb+t)}function S6(e,t,n,r){at.call(this,e,t,n,r)}function zbe(e,t,n,r){at.call(this,e,t,n,r)}function nWe(e,t,n,r){zbe.call(this,e,t,n,r)}function rWe(e,t,n,r){Hj.call(this,e,t,n,r)}function une(e,t,n,r){Hj.call(this,e,t,n,r)}function Gbe(e,t,n,r){Hj.call(this,e,t,n,r)}function iWe(e,t,n,r){une.call(this,e,t,n,r)}function qbe(e,t,n,r){une.call(this,e,t,n,r)}function wn(e,t,n,r){Gbe.call(this,e,t,n,r)}function sWe(e,t,n,r){qbe.call(this,e,t,n,r)}function aWe(e,t,n,r){zve.call(this,e,t,n,r)}function oWe(e,t,n){this.a=e,bbe.call(this,t,n)}function cWe(e,t,n){this.c=t,this.b=n,this.a=e}function eYt(e,t,n){return e.d=u(t.Kb(n),164)}function Vbe(e,t){return e.Aj().Nh().Kh(e,t)}function Ube(e,t){return e.Aj().Nh().Ih(e,t)}function uWe(e,t){return Sn(e),je(e)===je(t)}function an(e,t){return Sn(e),je(e)===je(t)}function lne(e,t){return ote(Lrt(e.a,t,!1))}function hne(e,t){return ote(Mrt(e.a,t,!1))}function tYt(e,t){return e.b.sd(new zGe(e,t))}function nYt(e,t){return e.b.sd(new GGe(e,t))}function lWe(e,t){return e.b.sd(new qGe(e,t))}function Wbe(e,t,n){return e.lastIndexOf(t,n)}function rYt(e,t,n){return Fs(e[t.b],e[n.b])}function iYt(e,t){return Ye(t,(pt(),_O),e)}function sYt(e,t){return Tu(t.a.d.p,e.a.d.p)}function aYt(e,t){return Tu(e.a.d.p,t.a.d.p)}function oYt(e,t){return Fs(e.c-e.s,t.c-t.s)}function hWe(e){return e.c?Yo(e.c.a,e,0):-1}function cYt(e){return e<100?null:new _p(e)}function A6(e){return e==$b||e==p0||e==tu}function fWe(e,t){return we(t,15)&&yct(e.c,t)}function uYt(e,t){V1||t&&(e.d=t)}function fne(e,t){var n;return n=t,!!bye(e,n)}function Kbe(e,t){this.c=e,jne.call(this,e,t)}function dWe(e){this.c=e,Hte.call(this,Cz,0)}function gWe(e,t){gQt.call(this,e,e.length,t)}function lYt(e,t,n){return u(e.c,69).lk(t,n)}function vj(e,t,n){return u(e.c,69).mk(t,n)}function hYt(e,t,n){return kKt(e,u(t,332),n)}function Ybe(e,t,n){return xKt(e,u(t,332),n)}function fYt(e,t,n){return gst(e,u(t,332),n)}function pWe(e,t,n){return lfn(e,u(t,332),n)}function c_(e,t){return t==null?null:Ym(e.b,t)}function Xbe(e){return Sm(e)?(Sn(e),e):e.ke()}function wj(e){return!isNaN(e)&&!isFinite(e)}function bWe(e){wd(),this.a=(hn(),new Kx(e))}function zM(e){h8(),this.d=e,this.a=new L3}function hh(e,t,n){this.a=e,this.b=t,this.c=n}function vWe(e,t,n){this.a=e,this.b=t,this.c=n}function wWe(e,t,n){this.d=e,this.b=n,this.a=t}function dne(e){DVe(this),Rh(this),no(this,e)}function Uu(e){Ute(this),hve(this.c,0,e.Pc())}function mWe(e){Ol(e.a),bJe(e.c,e.b),e.b=null}function yWe(e){this.a=e,Ud(),Ou(Date.now())}function kWe(){kWe=pe,p7e=new S,qG=new S}function gne(){gne=pe,a7e=new jt,H0t=new At}function xWe(){xWe=pe,Y3t=Me(Yn,yt,1,0,5,1)}function EWe(){EWe=pe,d4t=Me(Yn,yt,1,0,5,1)}function Qbe(){Qbe=pe,g4t=Me(Yn,yt,1,0,5,1)}function wd(){wd=pe,new spe((hn(),hn(),bo))}function dYt(e){return M$(),Xr((SJe(),q0t),e)}function gYt(e){return F1(),Xr((UZe(),X0t),e)}function pYt(e){return LH(),Xr((JQe(),ngt),e)}function bYt(e){return P$(),Xr((eZe(),rgt),e)}function vYt(e){return uz(),Xr((ztt(),igt),e)}function wYt(e){return n1(),Xr((GZe(),ogt),e)}function mYt(e){return al(),Xr((qZe(),ugt),e)}function yYt(e){return Lu(),Xr((VZe(),hgt),e)}function kYt(e){return Tz(),Xr((nVe(),Ngt),e)}function xYt(e){return Vv(),Xr((LJe(),Bgt),e)}function EYt(e){return Z6(),Xr((MJe(),Fgt),e)}function TYt(e){return Y_(),Xr((DJe(),Hgt),e)}function _Yt(e){return EF(),Xr((DQe(),zgt),e)}function CYt(e){return B$(),Xr((tZe(),spt),e)}function SYt(e){return L_(),Xr((WZe(),Cpt),e)}function AYt(e){return ro(),Xr((oet(),Mpt),e)}function LYt(e){return V8(),Xr((AJe(),Ppt),e)}function MYt(e){return Uv(),Xr((KZe(),Hpt),e)}function Zbe(e,t){if(!e)throw J(new Ln(t))}function DYt(e){return zn(),Xr((Met(),Vpt),e)}function Jbe(e){Dj.call(this,e.d,e.c,e.a,e.b)}function pne(e){Dj.call(this,e.d,e.c,e.a,e.b)}function eve(e,t,n){this.b=e,this.c=t,this.a=n}function mj(e,t,n){this.b=e,this.a=t,this.c=n}function TWe(e,t,n){this.a=e,this.b=t,this.c=n}function tve(e,t,n){this.a=e,this.b=t,this.c=n}function _We(e,t,n){this.a=e,this.b=t,this.c=n}function nve(e,t,n){this.a=e,this.b=t,this.c=n}function CWe(e,t,n){this.b=e,this.a=t,this.c=n}function yj(e,t,n){this.e=t,this.b=e,this.d=n}function IYt(e,t,n){return G2(),e.a.Od(t,n),t}function bne(e){var t;return t=new jn,t.e=e,t}function rve(e){var t;return t=new uHe,t.b=e,t}function GM(){GM=pe,rq=new _Y,iq=new CY}function mf(){mf=pe,s2t=new pX,a2t=new pB}function OYt(e){return cH(),Xr((OJe(),e2t),e)}function NYt(e){return R1(),Xr((PJe(),u2t),e)}function PYt(e){return oz(),Xr((Dtt(),v2t),e)}function BYt(e){return ek(),Xr((Oet(),w2t),e)}function RYt(e){return S$(),Xr((oZe(),m2t),e)}function FYt(e){return V6(),Xr((YZe(),y2t),e)}function jYt(e){return c4(),Xr((net(),h2t),e)}function $Yt(e){return qv(),Xr((ZZe(),b2t),e)}function HYt(e){return V$(),Xr((XZe(),k2t),e)}function zYt(e){return db(),Xr((eet(),x2t),e)}function GYt(e){return ED(),Xr((rZe(),E2t),e)}function qYt(e){return sb(),Xr((QZe(),_2t),e)}function VYt(e){return QH(),Xr((Ret(),C2t),e)}function UYt(e){return pD(),Xr((iZe(),S2t),e)}function WYt(e){return tI(),Xr((Pet(),A2t),e)}function KYt(e){return h7(),Xr((Net(),L2t),e)}function YYt(e){return mo(),Xr((rnt(),M2t),e)}function XYt(e){return q8(),Xr((eJe(),D2t),e)}function QYt(e){return P0(),Xr((JZe(),O2t),e)}function ZYt(e){return b$(),Xr((cZe(),N2t),e)}function JYt(e){return mh(),Xr((ret(),P2t),e)}function eXt(e){return WH(),Xr((Bet(),Xvt),e)}function tXt(e){return j_(),Xr((tJe(),Qvt),e)}function nXt(e){return Zm(),Xr((BJe(),Zvt),e)}function rXt(e){return vo(),Xr((iJe(),iwt),e)}function iXt(e){return f4(),Xr((Mtt(),ewt),e)}function sXt(e){return R0(),Xr((rJe(),twt),e)}function aXt(e){return mD(),Xr((aZe(),nwt),e)}function oXt(e){return iH(),Xr((nJe(),swt),e)}function cXt(e){return X_(),Xr((tet(),Jvt),e)}function uXt(e){return uD(),Xr((sZe(),awt),e)}function lXt(e){return Q8(),Xr((aJe(),owt),e)}function hXt(e){return nH(),Xr((oJe(),cwt),e)}function fXt(e){return uH(),Xr((sJe(),uwt),e)}function dXt(e){return Gv(),Xr((cJe(),xwt),e)}function gXt(e){return S_(),Xr((lZe(),Swt),e)}function pXt(e){return yd(),Xr((hZe(),Nwt),e)}function bXt(e){return M1(),Xr((fZe(),Bwt),e)}function vXt(e){return Jf(),Xr((uZe(),Qwt),e)}function wXt(e){return Ov(),Xr((dZe(),imt),e)}function mXt(e){return a7(),Xr((IJe(),smt),e)}function yXt(e){return nC(),Xr((Fet(),omt),e)}function kXt(e){return c$(),Xr((bZe(),kmt),e)}function xXt(e){return J$(),Xr((pZe(),Smt),e)}function EXt(e){return f$(),Xr((gZe(),xmt),e)}function TXt(e){return yH(),Xr((uJe(),Lmt),e)}function _Xt(e){return L$(),Xr((vZe(),Mmt),e)}function CXt(e){return RD(),Xr((lJe(),Dmt),e)}function SXt(e){return jH(),Xr((NJe(),Umt),e)}function AXt(e){return rH(),Xr((fJe(),Wmt),e)}function LXt(e){return mH(),Xr((hJe(),Kmt),e)}function MXt(e){return v7(),Xr((aet(),gyt),e)}function DXt(e){return GD(),Xr((dJe(),pyt),e)}function IXt(e){return _F(),Xr((LQe(),byt),e)}function OXt(e){return CF(),Xr((AQe(),wyt),e)}function NXt(e){return lD(),Xr((mZe(),myt),e)}function PXt(e){return rI(),Xr((iet(),yyt),e)}function BXt(e){return OT(),Xr((MQe(),Byt),e)}function RXt(e){return OD(),Xr((wZe(),Ryt),e)}function FXt(e){return i1(),Xr((set(),Gyt),e)}function jXt(e){return Ng(),Xr((Itt(),Vyt),e)}function $Xt(e){return t0(),Xr((Iet(),Uyt),e)}function HXt(e){return ty(),Xr((Det(),Zyt),e)}function zXt(e){return po(),Xr((rVe(),Qpt),e)}function GXt(e){return j8(),Xr((nZe(),Xpt),e)}function qXt(e){return wo(),Xr((cet(),d3t),e)}function VXt(e){return P1(),Xr((pJe(),g3t),e)}function UXt(e){return $0(),Xr((jJe(),p3t),e)}function WXt(e){return YH(),Xr(($et(),b3t),e)}function KXt(e){return F0(),Xr((gJe(),w3t),e)}function YXt(e){return Ul(),Xr((FJe(),y3t),e)}function XXt(e){return sy(),Xr((Htt(),k3t),e)}function QXt(e){return n4(),Xr((uet(),x3t),e)}function ZXt(e){return wa(),Xr((_et(),E3t),e)}function JXt(e){return ol(),Xr((jet(),T3t),e)}function eQt(e){return Bl(),Xr((HJe(),M3t),e)}function tQt(e){return wl(),Xr((int(),D3t),e)}function nQt(e){return ht(),Xr((het(),_3t),e)}function rQt(e){return EH(),Xr(($Je(),I3t),e)}function iQt(e){return Pl(),Xr((RJe(),P3t),e)}function sQt(e){return g7(),Xr((Ott(),K3t),e)}function aQt(e,t){return Sn(e),e+(Sn(t),t)}function oQt(e,t){return Ud(),Br(He(e.a),t)}function cQt(e,t){return Ud(),Br(He(e.a),t)}function vne(e,t){this.c=e,this.a=t,this.b=t-e}function SWe(e,t,n){this.a=e,this.b=t,this.c=n}function ive(e,t,n){this.a=e,this.b=t,this.c=n}function sve(e,t,n){this.a=e,this.b=t,this.c=n}function AWe(e,t,n){this.a=e,this.b=t,this.c=n}function LWe(e,t,n){this.a=e,this.b=t,this.c=n}function yg(e,t,n){this.e=e,this.a=t,this.c=n}function MWe(e,t,n){lh(),vwe.call(this,e,t,n)}function wne(e,t,n){lh(),twe.call(this,e,t,n)}function ave(e,t,n){lh(),twe.call(this,e,t,n)}function ove(e,t,n){lh(),twe.call(this,e,t,n)}function DWe(e,t,n){lh(),wne.call(this,e,t,n)}function cve(e,t,n){lh(),wne.call(this,e,t,n)}function IWe(e,t,n){lh(),cve.call(this,e,t,n)}function OWe(e,t,n){lh(),ave.call(this,e,t,n)}function NWe(e,t,n){lh(),ove.call(this,e,t,n)}function qM(e,t){return Nr(e),Nr(t),new tGe(e,t)}function L6(e,t){return Nr(e),Nr(t),new WWe(e,t)}function uQt(e,t){return Nr(e),Nr(t),new KWe(e,t)}function lQt(e,t){return Nr(e),Nr(t),new rGe(e,t)}function u(e,t){return u_(e==null||ese(e,t)),e}function l8(e){var t;return t=new st,Wre(t,e),t}function hQt(e){var t;return t=new Ys,Wre(t,e),t}function PWe(e){var t;return t=new gpe,oie(t,e),t}function VM(e){var t;return t=new as,oie(t,e),t}function fQt(e){return!e.e&&(e.e=new st),e.e}function dQt(e){return!e.c&&(e.c=new gm),e.c}function it(e,t){return e.c[e.c.length]=t,!0}function BWe(e,t){this.c=e,this.b=t,this.a=!1}function uve(e){this.d=e,Lee(this),this.b=sZt(e.d)}function RWe(){this.a=";,;",this.b="",this.c=""}function gQt(e,t,n){FKe.call(this,t,n),this.a=e}function FWe(e,t,n){this.b=e,Zqe.call(this,t,n)}function lve(e,t,n){this.c=e,OF.call(this,t,n)}function hve(e,t,n){O4e(n,0,e,t,n.length,!1)}function Kd(e,t,n,r,s){e.b=t,e.c=n,e.d=r,e.a=s}function pQt(e,t){t&&(e.b=t,e.a=(Fp(t),t.a))}function fve(e,t,n,r,s){e.d=t,e.c=n,e.a=r,e.b=s}function dve(e){var t,n;t=e.b,n=e.c,e.b=n,e.c=t}function gve(e){var t,n;n=e.d,t=e.a,e.d=t,e.a=n}function pve(e){return Gp(kZt(Ko(e)?Fh(e):e))}function bQt(e,t){return Tu(eKe(e.d),eKe(t.d))}function vQt(e,t){return t==(ht(),Dn)?e.c:e.d}function h8(){h8=pe,N_e=(ht(),Dn),uV=$n}function jWe(){this.b=Ue(ft(xt((a1(),zue))))}function $We(e){return G2(),Me(Yn,yt,1,e,5,1)}function wQt(e){return new Pt(e.c+e.b,e.d+e.a)}function mQt(e,t){return TF(),Tu(e.d.p,t.d.p)}function mne(e){return Qn(e.b!=0),bh(e,e.a.a)}function yQt(e){return Qn(e.b!=0),bh(e,e.c.b)}function bve(e,t){if(!e)throw J(new YHe(t))}function kj(e,t){if(!e)throw J(new Ln(t))}function vve(e,t,n){r8.call(this,e,t),this.b=n}function UM(e,t,n){I2e.call(this,e,t),this.c=n}function HWe(e,t,n){met.call(this,t,n),this.d=e}function wve(e){Qbe(),Ex.call(this),this.th(e)}function zWe(e,t,n){this.a=e,B3.call(this,t,n)}function GWe(e,t,n){this.a=e,B3.call(this,t,n)}function xj(e,t,n){I2e.call(this,e,t),this.c=n}function qWe(){C8(),jZt.call(this,(Ap(),rf))}function VWe(e){return e!=null&&!$ie(e,KS,YS)}function kQt(e,t){return(nrt(e)<<4|nrt(t))&Ss}function xQt(e,t){return Uj(),cse(e,t),new wYe(e,t)}function V2(e,t){var n;e.n&&(n=t,it(e.f,n))}function f8(e,t,n){var r;r=new Bm(n),t1(e,t,r)}function EQt(e,t){var n;return n=e.c,Bme(e,t),n}function mve(e,t){return t<0?e.g=-1:e.g=t,e}function Ej(e,t){return oin(e),e.a*=t,e.b*=t,e}function UWe(e,t,n,r,s){e.c=t,e.d=n,e.b=r,e.a=s}function ci(e,t){return ks(e,t,e.c.b,e.c),!0}function yve(e){e.a.b=e.b,e.b.a=e.a,e.a=e.b=null}function yne(e){this.b=e,this.a=Cv(this.b.a).Ed()}function WWe(e,t){this.b=e,this.a=t,nT.call(this)}function KWe(e,t){this.a=e,this.b=t,nT.call(this)}function YWe(e,t){FKe.call(this,t,1040),this.a=e}function WM(e){return e==0||isNaN(e)?e:e<0?-1:1}function TQt(e){return P6(),n0(e)==us(Kp(e))}function _Qt(e){return P6(),Kp(e)==us(n0(e))}function _v(e,t){return eC(e,new r8(t.a,t.b))}function CQt(e){return!to(e)&&e.c.i.c==e.d.i.c}function Tj(e){var t;return t=e.n,e.a.b+t.d+t.a}function XWe(e){var t;return t=e.n,e.e.b+t.d+t.a}function kve(e){var t;return t=e.n,e.e.a+t.b+t.c}function QWe(e){return yi(),new Yd(0,e)}function SQt(e){return e.a?e.a:ere(e)}function u_(e){if(!e)throw J(new Wx(null))}function ZWe(){ZWe=pe,Cfe=(hn(),new D(tue))}function _j(){_j=pe,new w3e((Yee(),due),(Xee(),fue))}function JWe(){JWe=pe,G8e=Me(Za,Qe,19,256,0,1)}function kne(e,t,n,r){Wye.call(this,e,t,n,r,0,0)}function AQt(e,t,n){return Si(e.b,u(n.b,17),t)}function LQt(e,t,n){return Si(e.b,u(n.b,17),t)}function MQt(e,t){return it(e,new Pt(t.a,t.b))}function DQt(e,t){return e.c=t)throw J(new lpe)}function dZt(e,t,n){return cs(t,0,_ve(t[0],n[0])),t}function gZt(e,t,n){t.Ye(n,Ue(ft(er(e.b,n)))*e.a)}function RKe(e,t,n){return g4(),$8(e,t)&&$8(e,n)}function g_(e){return ol(),!e.Hc(Z0)&&!e.Hc(m2)}function jj(e){return new Pt(e.c+e.b/2,e.d+e.a/2)}function One(e,t){return t.kh()?Up(e.b,u(t,49)):t}function Hve(e,t){this.e=e,this.d=t&64?t|Ed:t}function FKe(e,t){this.c=0,this.d=e,this.b=t|64|Ed}function $j(e){this.b=new su(11),this.a=(q3(),e)}function Nne(e){this.b=null,this.a=(q3(),e||r7e)}function jKe(e){this.a=lit(e.a),this.b=new Uu(e.b)}function $Ke(e){this.b=e,_6.call(this,e),GVe(this)}function HKe(e){this.b=e,NM.call(this,e),qVe(this)}function Pm(e,t,n){this.a=e,S6.call(this,t,n,5,6)}function zve(e,t,n,r){this.b=e,Bs.call(this,t,n,r)}function oa(e,t,n,r,s){jre.call(this,e,t,n,r,s,-1)}function p_(e,t,n,r,s){dD.call(this,e,t,n,r,s,-1)}function at(e,t,n,r){Bs.call(this,e,t,n),this.b=r}function Hj(e,t,n,r){UM.call(this,e,t,n),this.b=r}function zKe(e){Vqe.call(this,e,!1),this.a=!1}function GKe(e,t){this.b=e,see.call(this,e.b),this.a=t}function qKe(e,t){Rm(),vUt.call(this,e,pH(new Al(t)))}function zj(e,t){return yi(),new nwe(e,t,0)}function Pne(e,t){return yi(),new nwe(6,e,t)}function pZt(e,t){return an(e.substr(0,t.length),t)}function Il(e,t){return fa(t)?rre(e,t):!!$o(e.f,t)}function La(e,t){for(Sn(t);e.Ob();)t.td(e.Pb())}function z3(e,t,n){Qp(),this.e=e,this.d=t,this.a=n}function kg(e,t,n,r){var s;s=e.i,s.i=t,s.a=n,s.b=r}function Gve(e){var t;for(t=e;t.f;)t=t.f;return t}function I6(e){var t;return t=F_(e),Qn(t!=null),t}function bZt(e){var t;return t=ton(e),Qn(t!=null),t}function g8(e,t){var n;return n=e.a.gc(),eme(t,n),n-t}function qve(e,t){var n;for(n=0;n0?b.Math.log(e/t):-100}function VKe(e,t){return Mc(e,t)<0?-1:Mc(e,t)>0?1:0}function Yve(e,t,n){return Fut(e,u(t,46),u(n,167))}function UKe(e,t){return u(jve(Cv(e.a)).Xb(t),42).cd()}function _Zt(e,t){return Krn(t,e.length),new YWe(e,t)}function jne(e,t){this.d=e,rr.call(this,e),this.e=t}function Sv(e){this.d=(Sn(e),e),this.a=0,this.c=Cz}function Xve(e,t){cv.call(this,1),this.a=e,this.b=t}function WKe(e,t){return e.c?WKe(e.c,t):it(e.b,t),e}function CZt(e,t,n){var r;return r=Gm(e,t),Ere(e,t,n),r}function Qve(e,t){var n;return n=e.slice(0,t),gme(n,e)}function KKe(e,t,n){var r;for(r=0;r=e.g}function Kne(e,t,n){var r;return r=sie(e,t,n),_5e(e,r)}function O6(e,t){var n;n=e.a.length,Gm(e,n),Ere(e,n,t)}function uYe(e,t){var n;n=console[e],n.call(console,t)}function lYe(e,t){var n;++e.j,n=e.Vi(),e.Ii(e.oi(n,t))}function FZt(e,t,n){u(t.b,65),Mu(t.a,new ive(e,n,t))}function twe(e,t,n){nF.call(this,t),this.a=e,this.b=n}function nwe(e,t,n){cv.call(this,e),this.a=t,this.b=n}function rwe(e,t,n){this.a=e,npe.call(this,t),this.b=n}function hYe(e,t,n){this.a=e,Owe.call(this,8,t,null,n)}function jZt(e){this.a=(Sn(Zr),Zr),this.b=e,new Epe}function fYe(e){this.c=e,this.b=this.c.a,this.a=this.c.e}function iwe(e){this.c=e,this.b=e.a.d.a,_be(e.a.e,this)}function Ol(e){Am(e.c!=-1),e.d.$c(e.c),e.b=e.c,e.c=-1}function w_(e){return b.Math.sqrt(e.a*e.a+e.b*e.b)}function Lv(e,t){return d8(t,e.a.c.length),St(e.a,t)}function md(e,t){return je(e)===je(t)||e!=null&&Ci(e,t)}function $Zt(e){return 0>=e?new Xpe:Cin(e-1)}function HZt(e){return Yy?rre(Yy,e):!1}function dYe(e){return e?e.dc():!e.Kc().Ob()}function Ya(e){return!e.a&&e.c?e.c.b:e.a}function zZt(e){return!e.a&&(e.a=new Bs(y2,e,4)),e.a}function Mv(e){return!e.d&&(e.d=new Bs(Eo,e,1)),e.d}function Sn(e){if(e==null)throw J(new mT);return e}function m_(e){e.c?e.c.He():(e.d=!0,Wgn(e))}function Fp(e){e.c?Fp(e.c):(ub(e),e.d=!0)}function gYe(e){cwe(e.a),e.b=Me(Yn,yt,1,e.b.length,5,1)}function GZt(e,t){return Tu(t.j.c.length,e.j.c.length)}function qZt(e,t){e.c<0||e.b.b=0?e.Bh(n):P4e(e,t)}function pYe(e){var t,n;return t=e.c.i.c,n=e.d.i.c,t==n}function UZt(e){if(e.p!=4)throw J(new zu);return e.e}function WZt(e){if(e.p!=3)throw J(new zu);return e.e}function KZt(e){if(e.p!=6)throw J(new zu);return e.f}function YZt(e){if(e.p!=6)throw J(new zu);return e.k}function XZt(e){if(e.p!=3)throw J(new zu);return e.j}function QZt(e){if(e.p!=4)throw J(new zu);return e.j}function swe(e){return!e.b&&(e.b=new rF(new Kee)),e.b}function Dv(e){return e.c==-2&&zx(e,pfn(e.g,e.b)),e.c}function v8(e,t){var n;return n=Gne("",e),n.n=t,n.i=1,n}function ZZt(e,t){Ane(u(t.b,65),e),Mu(t.a,new ni(e))}function JZt(e,t){Br((!e.a&&(e.a=new jM(e,e)),e.a),t)}function bYe(e,t){this.b=e,jne.call(this,e,t),GVe(this)}function vYe(e,t){this.b=e,Kbe.call(this,e,t),qVe(this)}function awe(e,t,n,r){vv.call(this,e,t),this.d=n,this.a=r}function Vj(e,t,n,r){vv.call(this,e,n),this.a=t,this.f=r}function wYe(e,t){OWt.call(this,Sin(Nr(e),Nr(t))),this.a=t}function mYe(){d4e.call(this,_b,(xze(),x4t)),kwn(this)}function yYe(){d4e.call(this,Uh,(Qx(),RAe)),Mvn(this)}function kYe(){Kr.call(this,"DELAUNAY_TRIANGULATION",0)}function eJt(e){return String.fromCharCode.apply(null,e)}function Si(e,t,n){return fa(t)?Oo(e,t,n):gu(e.f,t,n)}function owe(e){return hn(),e?e.ve():(q3(),q3(),s7e)}function tJt(e,t,n){return W6(),n.pg(e,u(t.cd(),146))}function xYe(e,t){return _j(),new w3e(new rUe(e),new nUe(t))}function nJt(e){return ql(e,Nae),R$(Ua(Ua(5,e),e/10|0))}function Uj(){Uj=pe,k0t=new Qee(ie(re(Cb,1),Sz,42,0,[]))}function EYe(e){return!e.d&&(e.d=new T(e.c.Cc())),e.d}function w8(e){return!e.a&&(e.a=new rze(e.c.vc())),e.a}function TYe(e){return!e.b&&(e.b=new Kx(e.c.ec())),e.b}function Qd(e,t){for(;t-- >0;)e=e<<1|(e<0?1:0);return e}function Vc(e,t){return je(e)===je(t)||e!=null&&Ci(e,t)}function rJt(e,t){return Mn(),u(t.b,19).ar&&++r,r}function L0(e){var t,n;return n=(t=new uv,t),I8(n,e),n}function Jne(e){var t,n;return n=(t=new uv,t),b4e(n,e),n}function wJt(e,t){var n;return n=er(e.f,t),Wme(t,n),null}function ere(e){var t;return t=Lin(e),t||null}function NYe(e){return!e.b&&(e.b=new at(ra,e,12,3)),e.b}function mJt(e){return e!=null&&gM(ZV,e.toLowerCase())}function yJt(e,t){return Fs(Wu(e)*Dl(e),Wu(t)*Dl(t))}function kJt(e,t){return Fs(Wu(e)*Dl(e),Wu(t)*Dl(t))}function xJt(e,t){return Fs(e.d.c+e.d.b/2,t.d.c+t.d.b/2)}function EJt(e,t){return Fs(e.g.c+e.g.b/2,t.g.c+t.g.b/2)}function PYe(e,t,n){n.a?Iu(e,t.b-e.f/2):Du(e,t.a-e.g/2)}function BYe(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function RYe(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function K2(e,t,n,r){this.e=e,this.a=t,this.c=n,this.d=r}function FYe(e,t,n,r){this.a=e,this.c=t,this.d=n,this.b=r}function jYe(e,t,n,r){lh(),DZe.call(this,t,n,r),this.a=e}function $Ye(e,t,n,r){lh(),DZe.call(this,t,n,r),this.a=e}function HYe(e,t){this.a=e,LKt.call(this,e,u(e.d,15).Zc(t))}function tre(e){this.f=e,this.c=this.f.e,e.f>0&&tst(this)}function zYe(e,t,n,r){this.b=e,this.c=r,Hte.call(this,t,n)}function GYe(e){return Qn(e.b=0&&an(e.substr(n,t.length),t)}function jp(e,t,n,r,s,o,h){return new _re(e.e,t,n,r,s,o,h)}function aXe(e,t,n,r,s,o){this.a=e,Zre.call(this,t,n,r,s,o)}function oXe(e,t,n,r,s,o){this.a=e,Zre.call(this,t,n,r,s,o)}function cXe(e,t){this.g=e,this.d=ie(re(h0,1),Bg,10,0,[t])}function xg(e,t){this.e=e,this.a=Yn,this.b=Oct(t),this.c=t}function uXe(e,t){bj.call(this),xme(this),this.a=e,this.c=t}function eD(e,t,n,r){cs(e.c[t.g],n.g,r),cs(e.c[n.g],t.g,r)}function are(e,t,n,r){cs(e.c[t.g],t.g,n),cs(e.b[t.g],t.g,r)}function VJt(){return uD(),ie(re(__e,1),tt,376,0,[dhe,DO])}function UJt(){return pD(),ie(re(v9e,1),tt,479,0,[b9e,Dq])}function WJt(){return ED(),ie(re(g9e,1),tt,419,0,[Lq,d9e])}function KJt(){return S$(),ie(re(a9e,1),tt,422,0,[s9e,gle])}function YJt(){return b$(),ie(re(M9e,1),tt,420,0,[Lle,L9e])}function XJt(){return mD(),ie(re(k_e,1),tt,421,0,[lhe,hhe])}function QJt(){return S_(),ie(re(Cwt,1),tt,523,0,[TS,ES])}function ZJt(){return Jf(),ie(re(Xwt,1),tt,520,0,[jy,d2])}function JJt(){return yd(),ie(re(Owt,1),tt,516,0,[Lw,Gg])}function een(){return M1(),ie(re(Pwt,1),tt,515,0,[Pb,K1])}function ten(){return Ov(),ie(re(rmt,1),tt,455,0,[g2,Y4])}function nen(){return f$(),ie(re(Y_e,1),tt,425,0,[Ahe,K_e])}function ren(){return c$(),ie(re(W_e,1),tt,480,0,[She,U_e])}function ien(){return J$(),ie(re(X_e,1),tt,495,0,[mV,yE])}function sen(){return L$(),ie(re(Z_e,1),tt,426,0,[Q_e,Ihe])}function aen(){return OD(),ie(re(tSe,1),tt,429,0,[AV,eSe])}function oen(){return lD(),ie(re(OCe,1),tt,430,0,[Hhe,CV])}function cen(){return LH(),ie(re(w7e,1),tt,428,0,[Aue,v7e])}function uen(){return P$(),ie(re(y7e,1),tt,427,0,[m7e,Lue])}function len(){return B$(),ie(re(K7e,1),tt,424,0,[$ue,ZG])}function hen(){return j8(),ie(re(Ypt,1),tt,511,0,[gO,Jue])}function r$(e,t,n,r){return n>=0?e.jh(t,n,r):e.Sg(null,n,r)}function ore(e){return e.b.b==0?e.a.$e():mne(e.b)}function fen(e){if(e.p!=5)throw J(new zu);return Or(e.f)}function den(e){if(e.p!=5)throw J(new zu);return Or(e.k)}function bwe(e){return je(e.a)===je((cie(),Efe))&&gwn(e),e.a}function lXe(e){this.a=u(Nr(e),271),this.b=(hn(),new ube(e))}function hXe(e,t){Yge(this,new Pt(e.a,e.b)),VR(this,VM(t))}function Ov(){Ov=pe,g2=new T2e(uk,0),Y4=new T2e(lk,1)}function yd(){yd=pe,Lw=new x2e(lk,0),Gg=new x2e(uk,1)}function Nv(){EVt.call(this,new w6(qm(12))),sbe(!0),this.a=2}function cre(e,t,n){yi(),cv.call(this,e),this.b=t,this.a=n}function vwe(e,t,n){lh(),nF.call(this,t),this.a=e,this.b=n}function fXe(e){bj.call(this),xme(this),this.a=e,this.c=!0}function dXe(e){var t;t=e.c.d.b,e.b=t,e.a=e.c.d,t.a=e.c.d.b=e}function i$(e){var t;yin(e.a),TVe(e.a),t=new nr(e.a),Uye(t)}function gen(e,t){Tct(e,!0),Mu(e.e.wf(),new eve(e,!0,t))}function s$(e,t){return UQe(t),vin(e,Me(Lr,Jr,25,t,15,1),t)}function pen(e,t){return P6(),e==us(n0(t))||e==us(Kp(t))}function Uc(e,t){return t==null?hc($o(e.f,null)):BT(e.g,t)}function ben(e){return e.b==0?null:(Qn(e.b!=0),bh(e,e.a.a))}function _s(e){return Math.max(Math.min(e,Ei),-2147483648)|0}function ven(e,t){var n=wue[e.charCodeAt(0)];return n??e}function a$(e,t){return Zj(e,"set1"),Zj(t,"set2"),new uGe(e,t)}function wen(e,t){var n;return n=fin(e.f,t),Ni(gj(n),e.f.d)}function k_(e,t){var n,r;return n=t,r=new Nt,flt(e,n,r),r.d}function ure(e,t,n,r){var s;s=new eWe,t.a[n.g]=s,M6(e.b,r,s)}function wwe(e,t,n){var r;r=e.Yg(t),r>=0?e.sh(r,n):o5e(e,t,n)}function V3(e,t,n){u$(),e&&Si(yfe,e,t),e&&Si(oN,e,n)}function gXe(e,t,n){this.i=new st,this.b=e,this.g=t,this.a=n}function o$(e,t,n){this.c=new st,this.e=e,this.f=t,this.b=n}function mwe(e,t,n){this.a=new st,this.e=e,this.f=t,this.c=n}function pXe(e,t){ij(this),this.f=t,this.g=e,Qj(this),this._d()}function tD(e,t){var n;n=e.q.getHours(),e.q.setDate(t),lC(e,n)}function bXe(e,t){var n;for(Nr(t),n=e.a;n;n=n.c)t.Od(n.g,n.i)}function vXe(e){var t;return t=new bF(qm(e.length)),lye(t,e),t}function men(e){function t(){}return t.prototype=e||{},new t}function yen(e,t){return Ktt(e,t)?(Uet(e),!0):!1}function M0(e,t){if(t==null)throw J(new mT);return vcn(e,t)}function ken(e){if(e.qe())return null;var t=e.n;return PG[t]}function nD(e){return e.Db>>16!=3?null:u(e.Cb,33)}function L1(e){return e.Db>>16!=9?null:u(e.Cb,33)}function wXe(e){return e.Db>>16!=6?null:u(e.Cb,79)}function mXe(e){return e.Db>>16!=7?null:u(e.Cb,235)}function yXe(e){return e.Db>>16!=7?null:u(e.Cb,160)}function us(e){return e.Db>>16!=11?null:u(e.Cb,33)}function kXe(e,t){var n;return n=e.Yg(t),n>=0?e.lh(n):Fse(e,t)}function xXe(e,t){var n;return n=new Tve(t),_st(n,e),new Uu(n)}function ywe(e){var t;return t=e.d,t=e.si(e.f),Br(e,t),t.Ob()}function EXe(e,t){return e.b+=t.b,e.c+=t.c,e.d+=t.d,e.a+=t.a,e}function lre(e,t){return b.Math.abs(e)0}function TXe(){this.a=new C0,this.e=new Ys,this.g=0,this.i=0}function _Xe(e){this.a=e,this.b=Me(Ewt,Qe,1944,e.e.length,0,2)}function hre(e,t,n){var r;r=gnt(e,t,n),e.b=new Z$(r.c.length)}function M1(){M1=pe,Pb=new k2e(voe,0),K1=new k2e("UP",1)}function c$(){c$=pe,She=new _2e(Hft,0),U_e=new _2e("FAN",1)}function u$(){u$=pe,yfe=new Mr,oN=new Mr,zUt(j0t,new $9)}function Een(e){if(e.p!=0)throw J(new zu);return XT(e.f,0)}function Ten(e){if(e.p!=0)throw J(new zu);return XT(e.k,0)}function CXe(e){return e.Db>>16!=3?null:u(e.Cb,147)}function x8(e){return e.Db>>16!=6?null:u(e.Cb,235)}function Fm(e){return e.Db>>16!=17?null:u(e.Cb,26)}function SXe(e,t){var n=e.a=e.a||[];return n[t]||(n[t]=e.le(t))}function _en(e,t){var n;return n=e.a.get(t),n??new Array}function Cen(e,t){var n;n=e.q.getHours(),e.q.setMonth(t),lC(e,n)}function Oo(e,t,n){return t==null?gu(e.f,null,n):Wv(e.g,t,n)}function x_(e,t,n,r,s,o){return new N0(e.e,t,e.aj(),n,r,s,o)}function rD(e,t,n){return e.a=jl(e.a,0,t)+(""+n)+IM(e.a,t),e}function Sen(e,t,n){return it(e.a,(Uj(),cse(t,n),new vv(t,n))),e}function kwe(e){return obe(e.c),e.e=e.a=e.c,e.c=e.c.c,++e.d,e.a.f}function AXe(e){return obe(e.e),e.c=e.a=e.e,e.e=e.e.e,--e.d,e.a.f}function ba(e,t){e.d&&Au(e.d.e,e),e.d=t,e.d&&it(e.d.e,e)}function Va(e,t){e.c&&Au(e.c.g,e),e.c=t,e.c&&it(e.c.g,e)}function No(e,t){e.c&&Au(e.c.a,e),e.c=t,e.c&&it(e.c.a,e)}function rc(e,t){e.i&&Au(e.i.j,e),e.i=t,e.i&&it(e.i.j,e)}function LXe(e,t,n){this.a=t,this.c=e,this.b=(Nr(n),new Uu(n))}function MXe(e,t,n){this.a=t,this.c=e,this.b=(Nr(n),new Uu(n))}function DXe(e,t){this.a=e,this.c=fc(this.a),this.b=new n$(t)}function Aen(e){var t;return ub(e),t=new Ys,Vi(e,new $t(t))}function jm(e,t){if(e<0||e>t)throw J(new Do(C6e+e+S6e+t))}function xwe(e,t){return kKe(e.a,t)?Uve(e,u(t,22).g,null):null}function Len(e){return Aie(),Mn(),u(e.a,81).d.e!=0}function IXe(){IXe=pe,T0t=Qr((cF(),ie(re(E0t,1),tt,538,0,[bue])))}function OXe(){OXe=pe,lwt=il(new Xs,(ro(),Go),(po(),pO))}function Ewe(){Ewe=pe,hwt=il(new Xs,(ro(),Go),(po(),pO))}function NXe(){NXe=pe,dwt=il(new Xs,(ro(),Go),(po(),pO))}function PXe(){PXe=pe,Awt=xi(new Xs,(ro(),Go),(po(),nS))}function $l(){$l=pe,Dwt=xi(new Xs,(ro(),Go),(po(),nS))}function BXe(){BXe=pe,Iwt=xi(new Xs,(ro(),Go),(po(),nS))}function fre(){fre=pe,Rwt=xi(new Xs,(ro(),Go),(po(),nS))}function RXe(){RXe=pe,Emt=il(new Xs,(a7(),CS),(nC(),whe))}function X2(e,t,n,r){this.c=e,this.d=r,gre(this,t),pre(this,n)}function R6(e){this.c=new as,this.b=e.b,this.d=e.c,this.a=e.a}function dre(e){this.a=b.Math.cos(e),this.b=b.Math.sin(e)}function gre(e,t){e.a&&Au(e.a.k,e),e.a=t,e.a&&it(e.a.k,e)}function pre(e,t){e.b&&Au(e.b.f,e),e.b=t,e.b&&it(e.b.f,e)}function FXe(e,t){FZt(e,e.b,e.c),u(e.b.b,65),t&&u(t.b,65).b}function Men(e,t){jye(e,t),we(e.Cb,88)&&iy(dl(u(e.Cb,88)),2)}function bre(e,t){we(e.Cb,88)&&iy(dl(u(e.Cb,88)),4),au(e,t)}function l$(e,t){we(e.Cb,179)&&(u(e.Cb,179).tb=null),au(e,t)}function Wc(e,t){return ho(),Ure(t)?new Cj(t,e):new DM(t,e)}function Den(e,t){var n,r;n=t.c,r=n!=null,r&&O6(e,new Bm(t.c))}function jXe(e){var t,n;return n=(Qx(),t=new uv,t),I8(n,e),n}function $Xe(e){var t,n;return n=(Qx(),t=new uv,t),I8(n,e),n}function HXe(e,t){var n;return n=new Bh(e),t.c[t.c.length]=n,n}function zXe(e,t){var n;return n=u(Ym(B6(e.a),t),14),n?n.gc():0}function GXe(e){var t;return ub(e),t=(q3(),q3(),i7e),j$(e,t)}function qXe(e){for(var t;;)if(t=e.Pb(),!e.Ob())return t}function Twe(e,t){kVt.call(this,new w6(qm(e))),ql(t,sht),this.a=t}function Zd(e,t,n){Jnt(t,n,e.gc()),this.c=e,this.a=t,this.b=n-t}function VXe(e,t,n){var r;Jnt(t,n,e.c.length),r=n-t,Kpe(e.c,t,r)}function Ien(e,t){zVe(e,Or(qs(Np(t,24),Mz)),Or(qs(t,Mz)))}function xn(e,t){if(e<0||e>=t)throw J(new Do(C6e+e+S6e+t))}function zr(e,t){if(e<0||e>=t)throw J(new Bpe(C6e+e+S6e+t))}function mn(e,t){this.b=(Sn(e),e),this.a=t&dy?t:t|64|Ed}function UXe(e){EVe(this),rHe(this.a,cye(b.Math.max(8,e))<<1)}function D1(e){return sc(ie(re(na,1),Qe,8,0,[e.i.n,e.n,e.a]))}function Oen(){return F1(),ie(re(yl,1),tt,132,0,[g7e,Ql,xy])}function Nen(){return n1(),ie(re(Ey,1),tt,232,0,[pc,lu,bc])}function Pen(){return al(),ie(re(cgt,1),tt,461,0,[Nd,a2,Af])}function Ben(){return Lu(),ie(re(lgt,1),tt,462,0,[u1,o2,Lf])}function Ren(){return Uv(),ie(re(fEe,1),tt,423,0,[N4,hEe,Xue])}function Fen(){return L_(),ie(re(cEe,1),tt,379,0,[que,Gue,Vue])}function jen(){return j_(),ie(re(h_e,1),tt,378,0,[ihe,l_e,iV])}function $en(){return V6(),ie(re(c9e,1),tt,314,0,[Ek,vO,o9e])}function Hen(){return V$(),ie(re(l9e,1),tt,337,0,[u9e,Aq,ple])}function zen(){return sb(),ie(re(T2t,1),tt,450,0,[wle,aE,F4])}function Gen(){return qv(),ie(re(sle,1),tt,361,0,[mw,u2,ww])}function qen(){return P0(),ie(re(I2t,1),tt,303,0,[mO,$4,Tk])}function Ven(){return q8(),ie(re(Ale,1),tt,292,0,[Cle,Sle,wO])}function Uen(){return vo(),ie(re(rwt,1),tt,452,0,[yS,ul,hu])}function Wen(){return R0(),ie(re(y_e,1),tt,339,0,[f2,m_e,uhe])}function Ken(){return iH(),ie(re(T_e,1),tt,375,0,[x_e,fhe,E_e])}function Yen(){return uH(),ie(re(D_e,1),tt,377,0,[bhe,wE,Fy])}function Xen(){return Q8(),ie(re(S_e,1),tt,336,0,[ghe,C_e,kS])}function Qen(){return nH(),ie(re(M_e,1),tt,338,0,[L_e,phe,A_e])}function Zen(){return Gv(),ie(re(kwt,1),tt,454,0,[IO,xS,cV])}function Jen(){return yH(),ie(re(Amt,1),tt,442,0,[Dhe,Lhe,Mhe])}function etn(){return RD(),ie(re(tCe,1),tt,380,0,[yV,J_e,eCe])}function ttn(){return mH(),ie(re(mCe,1),tt,381,0,[wCe,Rhe,vCe])}function ntn(){return rH(),ie(re(pCe,1),tt,293,0,[Bhe,gCe,dCe])}function rtn(){return GD(),ie(re(Fhe,1),tt,437,0,[EV,TV,_V])}function itn(){return F0(),ie(re(cAe,1),tt,334,0,[FV,Wg,jS])}function stn(){return P1(),ie(re(XSe,1),tt,272,0,[EE,zy,TE])}function atn(e,t){return S0n(e,t,we(t,99)&&(u(t,18).Bb&so)!=0)}function otn(e,t,n){var r;return r=dC(e,t,!1),r.b<=t&&r.a<=n}function WXe(e,t,n){var r;r=new TQ,r.b=t,r.a=n,++t.b,it(e.d,r)}function ctn(e,t){var n;return n=(Sn(e),e).g,mbe(!!n),Sn(t),n(t)}function _we(e,t){var n,r;return r=g8(e,t),n=e.a.Zc(r),new cGe(e,n)}function utn(e){return e.Db>>16!=6?null:u(Hse(e),235)}function ltn(e){if(e.p!=2)throw J(new zu);return Or(e.f)&Ss}function htn(e){if(e.p!=2)throw J(new zu);return Or(e.k)&Ss}function ftn(e){return e.a==(C8(),nU)&&_ee(e,G0n(e.g,e.b)),e.a}function F6(e){return e.d==(C8(),nU)&&dT(e,B2n(e.g,e.b)),e.d}function Y(e){return Qn(e.ar?1:0}function KXe(e,t){var n,r;return n=Hre(t),r=n,u(er(e.c,r),19).a}function YXe(e,t){var n;for(n=e+"";n.length0&&e.a[--e.d]==0;);e.a[e.d++]==0&&(e.e=0)}function gQe(e){return e.a?e.e.length==0?e.a.a:e.a.a+(""+e.e):e.c}function Etn(e){return!!e.a&&gl(e.a.a).i!=0&&!(e.b&&sse(e.b))}function Ttn(e){return!!e.u&&jc(e.u.a).i!=0&&!(e.n&&ise(e.n))}function pQe(e){return Ene(e.e.Hd().gc()*e.c.Hd().gc(),16,new r6(e))}function _tn(e,t){return VKe(Ou(e.q.getTime()),Ou(t.q.getTime()))}function kd(e){return u(j1(e,Me(Que,Ooe,17,e.c.length,0,1)),474)}function iD(e){return u(j1(e,Me(h0,Bg,10,e.c.length,0,1)),193)}function Ctn(e){return $l(),!to(e)&&!(!to(e)&&e.c.i.c==e.d.i.c)}function bQe(e,t,n){var r;r=(Nr(e),new Uu(e)),nln(new LXe(r,t,n))}function sD(e,t,n){var r;r=(Nr(e),new Uu(e)),rln(new MXe(r,t,n))}function vQe(e,t){var n;return n=1-t,e.a[n]=Q$(e.a[n],n),Q$(e,t)}function wQe(e,t){var n;e.e=new Lpe,n=oy(t),aa(n,e.c),dct(e,n,0)}function va(e,t,n,r){var s;s=new zB,s.a=t,s.b=n,s.c=r,ci(e.a,s)}function dt(e,t,n,r){var s;s=new zB,s.a=t,s.b=n,s.c=r,ci(e.b,s)}function kf(e){var t,n,r;return t=new ZKe,n=aae(t,e),hmn(t),r=n,r}function Dwe(){var e,t,n;return t=(n=(e=new uv,e),n),it(WAe,t),t}function d$(e){return e.j.c=Me(Yn,yt,1,0,5,1),cwe(e.c),aJt(e.a),e}function U3(e){return IT(),we(e.g,10)?u(e.g,10):null}function Stn(e){return G3(e).dc()?!1:(CWt(e,new de),!0)}function Atn(e){if(!("stack"in e))try{throw e}catch{}return e}function aD(e,t){if(e<0||e>=t)throw J(new Do(H1n(e,t)));return e}function mQe(e,t,n){if(e<0||tn)throw J(new Do(f1n(e,t,n)))}function yre(e,t){if(Gs(e.a,t),t.d)throw J(new tc(Sht));t.d=e}function kre(e,t){if(t.$modCount!=e.$modCount)throw J(new uh)}function yQe(e,t){return we(t,42)?lse(e.a,u(t,42)):!1}function kQe(e,t){return we(t,42)?lse(e.a,u(t,42)):!1}function xQe(e,t){return we(t,42)?lse(e.a,u(t,42)):!1}function Ltn(e,t){return e.a<=e.b?(t.ud(e.a++),!0):!1}function Bv(e){var t;return Ko(e)?(t=e,t==-0?0:t):Frn(e)}function g$(e){var t;return Fp(e),t=new kt,D3(e.a,new un(t)),t}function EQe(e){var t;return Fp(e),t=new oi,D3(e.a,new lt(t)),t}function Ea(e,t){this.a=e,c6.call(this,e),jm(t,e.gc()),this.b=t}function Iwe(e){this.e=e,this.b=this.e.a.entries(),this.a=new Array}function Mtn(e){return Ene(e.e.Hd().gc()*e.c.Hd().gc(),273,new jR(e))}function p$(e){return new su((ql(e,Nae),R$(Ua(Ua(5,e),e/10|0))))}function TQe(e){return u(j1(e,Me(Upt,ift,11,e.c.length,0,1)),1943)}function Dtn(e,t,n){return n.f.c.length>0?Yve(e.a,t,n):Yve(e.b,t,n)}function Itn(e,t,n){e.d&&Au(e.d.e,e),e.d=t,e.d&&Om(e.d.e,n,e)}function xre(e,t){_yn(t,e),gve(e.d),gve(u(K(e,(pt(),Qq)),207))}function T_(e,t){Tyn(t,e),dve(e.d),dve(u(K(e,(pt(),Qq)),207))}function Rv(e,t){var n,r;return n=M0(e,t),r=null,n&&(r=n.fe()),r}function E8(e,t){var n,r;return n=Gm(e,t),r=null,n&&(r=n.ie()),r}function __(e,t){var n,r;return n=M0(e,t),r=null,n&&(r=n.ie()),r}function D0(e,t){var n,r;return n=M0(e,t),r=null,n&&(r=E4e(n)),r}function Otn(e,t,n){var r;return r=i7(n),fz(e.g,r,t),fz(e.i,t,n),t}function Ntn(e,t,n){var r;r=ccn();try{return jKt(e,t,n)}finally{Vtn(r)}}function _Qe(e){var t;t=e.Wg(),this.a=we(t,69)?u(t,69).Zh():t.Kc()}function Xs(){jHe.call(this),this.j.c=Me(Yn,yt,1,0,5,1),this.a=-1}function Owe(e,t,n,r){this.d=e,this.n=t,this.g=n,this.o=r,this.p=-1}function CQe(e,t,n,r){this.e=r,this.d=null,this.c=e,this.a=t,this.b=n}function Nwe(e,t,n){this.d=new eF(this),this.e=e,this.i=t,this.f=n}function b$(){b$=pe,Lle=new v2e(D7,0),L9e=new v2e("TOP_LEFT",1)}function SQe(){SQe=pe,O_e=xYe(ct(1),ct(4)),I_e=xYe(ct(1),ct(2))}function AQe(){AQe=pe,wyt=Qr((CF(),ie(re(vyt,1),tt,551,0,[$he])))}function LQe(){LQe=pe,byt=Qr((_F(),ie(re(ICe,1),tt,482,0,[jhe])))}function MQe(){MQe=pe,Byt=Qr((OT(),ie(re(JCe,1),tt,530,0,[FO])))}function DQe(){DQe=pe,zgt=Qr((EF(),ie(re(H7e,1),tt,481,0,[Pue])))}function Ptn(){return Vv(),ie(re(Pgt,1),tt,406,0,[sO,iO,Oue,Nue])}function Btn(){return M$(),ie(re(GG,1),tt,297,0,[_ue,l7e,h7e,f7e])}function Rtn(){return Y_(),ie(re($gt,1),tt,394,0,[lO,KG,YG,hO])}function Ftn(){return Z6(),ie(re(Rgt,1),tt,323,0,[oO,aO,cO,uO])}function jtn(){return V8(),ie(re(Npt,1),tt,405,0,[vw,_y,Ty,O4])}function $tn(){return cH(),ie(re(Jpt,1),tt,360,0,[rle,kq,xq,bO])}function IQe(e,t,n,r){return we(n,54)?new wUe(e,t,n,r):new Fve(e,t,n,r)}function Htn(){return R1(),ie(re(c2t,1),tt,411,0,[xk,tE,nE,ile])}function ztn(e){var t;return e.j==(ht(),xr)&&(t=not(e),Vu(t,$n))}function Gtn(e,t){var n;n=t.a,Va(n,t.c.d),ba(n,t.d.d),Um(n.a,e.n)}function OQe(e,t){return u(Tv(Rj(u(Ii(e.k,t),15).Oc(),P4)),113)}function NQe(e,t){return u(Tv(Fj(u(Ii(e.k,t),15).Oc(),P4)),113)}function qtn(e){return new mn(Hin(u(e.a.dd(),14).gc(),e.a.cd()),16)}function T8(e){return we(e,14)?u(e,14).dc():!e.Kc().Ob()}function j6(e){return IT(),we(e.g,145)?u(e.g,145):null}function PQe(e){if(e.e.g!=e.b)throw J(new uh);return!!e.c&&e.d>0}function ri(e){return Qn(e.b!=e.d.c),e.c=e.b,e.b=e.b.a,++e.a,e.c.c}function Pwe(e,t){Sn(t),cs(e.a,e.c,t),e.c=e.c+1&e.a.length-1,Fit(e)}function $p(e,t){Sn(t),e.b=e.b-1&e.a.length-1,cs(e.a,e.b,t),Fit(e)}function BQe(e,t){var n;for(n=e.j.c.length;n0&&Hc(e.g,0,t,0,e.i),t}function $Qe(e,t){LF();var n;return n=u(er(QV,e),55),!n||n.wj(t)}function rnn(e){if(e.p!=1)throw J(new zu);return Or(e.f)<<24>>24}function inn(e){if(e.p!=1)throw J(new zu);return Or(e.k)<<24>>24}function snn(e){if(e.p!=7)throw J(new zu);return Or(e.k)<<16>>16}function ann(e){if(e.p!=7)throw J(new zu);return Or(e.f)<<16>>16}function I0(e){var t;for(t=0;e.Ob();)e.Pb(),t=Ua(t,1);return R$(t)}function HQe(e,t){var n;return n=new xm,e.xd(n),n.a+="..",t.yd(n),n.a}function onn(e,t,n){var r;r=u(er(e.g,n),57),it(e.a.c,new xa(t,r))}function cnn(e,t,n){return Ine(ft(hc($o(e.f,t))),ft(hc($o(e.f,n))))}function v$(e,t,n){return gz(e,t,n,we(t,99)&&(u(t,18).Bb&so)!=0)}function unn(e,t,n){return y7(e,t,n,we(t,99)&&(u(t,18).Bb&so)!=0)}function lnn(e,t,n){return O0n(e,t,n,we(t,99)&&(u(t,18).Bb&so)!=0)}function Fwe(e,t){return e==(zn(),Hs)&&t==Hs?4:e==Hs||t==Hs?8:32}function zQe(e,t){return je(t)===je(e)?"(this Map)":t==null?Pu:Qo(t)}function hnn(e,t){return u(t==null?hc($o(e.f,null)):BT(e.g,t),281)}function GQe(e,t,n){var r;return r=i7(n),Si(e.b,r,t),Si(e.c,t,n),t}function qQe(e,t){var n;for(n=t;n;)Lm(e,n.i,n.j),n=us(n);return e}function jwe(e,t){var n;return n=ZM(l8(new zre(e,t))),Aj(new zre(e,t)),n}function Jd(e,t){ho();var n;return n=u(e,66).Mj(),Vfn(n,t),n.Ok(t)}function fnn(e,t,n,r,s){var o;o=F0n(s,n,r),it(t,B1n(s,o)),Sfn(e,s,t)}function VQe(e,t,n){e.i=0,e.e=0,t!=n&&(wnt(e,t,n),vnt(e,t,n))}function $we(e,t){var n;n=e.q.getHours(),e.q.setFullYear(t+e2),lC(e,n)}function dnn(e,t,n){if(n){var r=n.ee();e.a[t]=r(n)}else delete e.a[t]}function Ere(e,t,n){if(n){var r=n.ee();n=r(n)}else n=void 0;e.a[t]=n}function UQe(e){if(e<0)throw J(new QHe("Negative array size: "+e))}function jc(e){return e.n||(dl(e),e.n=new _Ke(e,Eo,e),jo(e)),e.n}function C_(e){return Qn(e.a=0&&e.a[n]===t[n];n--);return n<0}function QQe(e,t){X8();var n;return n=e.j.g-t.j.g,n!=0?n:0}function ZQe(e,t){return Sn(t),e.a!=null?ZQt(t.Kb(e.a)):zG}function w$(e){var t;return e?new Tve(e):(t=new C0,oie(t,e),t)}function zl(e,t){var n;return t.b.Kb(qJe(e,t.c.Ee(),(n=new Cn(t),n)))}function m$(e){o4e(),zVe(this,Or(qs(Np(e,24),Mz)),Or(qs(e,Mz)))}function JQe(){JQe=pe,ngt=Qr((LH(),ie(re(w7e,1),tt,428,0,[Aue,v7e])))}function eZe(){eZe=pe,rgt=Qr((P$(),ie(re(y7e,1),tt,427,0,[m7e,Lue])))}function tZe(){tZe=pe,spt=Qr((B$(),ie(re(K7e,1),tt,424,0,[$ue,ZG])))}function nZe(){nZe=pe,Xpt=Qr((j8(),ie(re(Ypt,1),tt,511,0,[gO,Jue])))}function rZe(){rZe=pe,E2t=Qr((ED(),ie(re(g9e,1),tt,419,0,[Lq,d9e])))}function iZe(){iZe=pe,S2t=Qr((pD(),ie(re(v9e,1),tt,479,0,[b9e,Dq])))}function sZe(){sZe=pe,awt=Qr((uD(),ie(re(__e,1),tt,376,0,[dhe,DO])))}function aZe(){aZe=pe,nwt=Qr((mD(),ie(re(k_e,1),tt,421,0,[lhe,hhe])))}function oZe(){oZe=pe,m2t=Qr((S$(),ie(re(a9e,1),tt,422,0,[s9e,gle])))}function cZe(){cZe=pe,N2t=Qr((b$(),ie(re(M9e,1),tt,420,0,[Lle,L9e])))}function uZe(){uZe=pe,Qwt=Qr((Jf(),ie(re(Xwt,1),tt,520,0,[jy,d2])))}function lZe(){lZe=pe,Swt=Qr((S_(),ie(re(Cwt,1),tt,523,0,[TS,ES])))}function hZe(){hZe=pe,Nwt=Qr((yd(),ie(re(Owt,1),tt,516,0,[Lw,Gg])))}function fZe(){fZe=pe,Bwt=Qr((M1(),ie(re(Pwt,1),tt,515,0,[Pb,K1])))}function dZe(){dZe=pe,imt=Qr((Ov(),ie(re(rmt,1),tt,455,0,[g2,Y4])))}function gZe(){gZe=pe,xmt=Qr((f$(),ie(re(Y_e,1),tt,425,0,[Ahe,K_e])))}function pZe(){pZe=pe,Smt=Qr((J$(),ie(re(X_e,1),tt,495,0,[mV,yE])))}function bZe(){bZe=pe,kmt=Qr((c$(),ie(re(W_e,1),tt,480,0,[She,U_e])))}function vZe(){vZe=pe,Mmt=Qr((L$(),ie(re(Z_e,1),tt,426,0,[Q_e,Ihe])))}function wZe(){wZe=pe,Ryt=Qr((OD(),ie(re(tSe,1),tt,429,0,[AV,eSe])))}function mZe(){mZe=pe,myt=Qr((lD(),ie(re(OCe,1),tt,430,0,[Hhe,CV])))}function S_(){S_=pe,TS=new y2e("UPPER",0),ES=new y2e("LOWER",1)}function vnn(e,t){var n;n=new p6,Y2(n,"x",t.a),Y2(n,"y",t.b),O6(e,n)}function wnn(e,t){var n;n=new p6,Y2(n,"x",t.a),Y2(n,"y",t.b),O6(e,n)}function mnn(e,t){var n,r;r=!1;do n=unt(e,t),r=r|n;while(n);return r}function Gwe(e,t){var n,r;for(n=t,r=0;n>0;)r+=e.a[n],n-=n&-n;return r}function yZe(e,t){var n;for(n=t;n;)Lm(e,-n.i,-n.j),n=us(n);return e}function Da(e,t){var n,r;for(Sn(t),r=e.Kc();r.Ob();)n=r.Pb(),t.td(n)}function kZe(e,t){var n;return n=t.cd(),new vv(n,e.e.pc(n,u(t.dd(),14)))}function ks(e,t,n,r){var s;s=new wt,s.c=t,s.b=n,s.a=r,r.b=n.a=s,++e.b}function gh(e,t,n){var r;return r=(xn(t,e.c.length),e.c[t]),e.c[t]=n,r}function ynn(e,t,n){return u(t==null?gu(e.f,null,n):Wv(e.g,t,n),281)}function Sre(e){return e.c&&e.d?Cwe(e.c)+"->"+Cwe(e.d):"e_"+xv(e)}function _8(e,t){return(ub(e),LT(new vn(e,new dme(t,e.a)))).sd(X7)}function knn(){return ro(),ie(re(uEe,1),tt,356,0,[Pd,c2,bu,Zc,Go])}function xnn(){return ht(),ie(re(ao,1),Dc,61,0,[uc,An,$n,xr,Dn])}function Enn(e){return fF(),function(){return Ntn(e,this,arguments)}}function Tnn(){return Date.now?Date.now():new Date().getTime()}function to(e){return!e.c||!e.d?!1:!!e.c.i&&e.c.i==e.d.i}function xZe(e){if(!e.c.Sb())throw J(new xc);return e.a=!0,e.c.Ub()}function oD(e){e.i=0,mM(e.b,null),mM(e.c,null),e.a=null,e.e=null,++e.g}function qwe(e){DUt.call(this,e==null?Pu:Qo(e),we(e,78)?u(e,78):null)}function EZe(e){Xlt(),W$e(this),this.a=new as,vye(this,e),ci(this.a,e)}function TZe(){Ute(this),this.b=new Pt(gs,gs),this.a=new Pt(Ds,Ds)}function _Ze(e,t){this.c=0,this.b=t,Jqe.call(this,e,17493),this.a=this.c}function Are(e){y$(),!V1&&(this.c=e,this.e=!0,this.a=new st)}function y$(){y$=pe,V1=!0,U0t=!1,W0t=!1,Y0t=!1,K0t=!1}function Vwe(e,t){return we(t,149)?an(e.c,u(t,149).c):!1}function Uwe(e,t){var n;return n=0,e&&(n+=e.f.a/2),t&&(n+=t.f.a/2),n}function Lre(e,t){var n;return n=u(Fv(e.d,t),23),n||u(Fv(e.e,t),23)}function CZe(e){this.b=e,rr.call(this,e),this.a=u(_n(this.b.a,4),126)}function SZe(e){this.b=e,C6.call(this,e),this.a=u(_n(this.b.a,4),126)}function dl(e){return e.t||(e.t=new R$e(e),G_(new XHe(e),0,e.t)),e.t}function _nn(){return wo(),ie(re(RS,1),tt,103,0,[f0,Df,Xh,Y0,X0])}function Cnn(){return n4(),ie(re(HS,1),tt,249,0,[v2,ZO,uAe,$S,lAe])}function Snn(){return i1(),ie(re(Ug,1),tt,175,0,[Fn,ua,Fd,Bb,Vg])}function Ann(){return rI(),ie(re(RCe,1),tt,316,0,[NCe,zhe,BCe,Ghe,PCe])}function Lnn(){return X_(),ie(re(d_e,1),tt,315,0,[f_e,ohe,che,wS,mS])}function Mnn(){return db(),ie(re(f9e,1),tt,335,0,[ble,h9e,vle,sS,iS])}function Dnn(){return v7(),ie(re(dyt,1),tt,355,0,[X4,Nk,IS,DS,OS])}function Inn(){return c4(),ie(re(l2t,1),tt,363,0,[Tq,Cq,Sq,_q,Eq])}function Onn(){return mh(),ie(re(G9e,1),tt,163,0,[TO,lS,l2,hS,Ly])}function C8(){C8=pe;var e,t;tU=(Qx(),t=new sF,t),nU=(e=new Vee,e)}function AZe(e){var t;return e.c||(t=e.r,we(t,88)&&(e.c=u(t,26))),e.c}function Nnn(e){return e.e=3,e.d=e.Yb(),e.e!=2?(e.e=0,!0):!1}function Mre(e){var t,n,r;return t=e&ml,n=e>>22&ml,r=e<0?V0:0,fu(t,n,r)}function Pnn(e){var t,n,r,s;for(n=e,r=0,s=n.length;r0?Art(e,t):Xot(e,-t)}function Wwe(e,t){return t==0||e.e==0?e:t>0?Xot(e,t):Art(e,-t)}function Pr(e){if(Vr(e))return e.c=e.a,e.a.Pb();throw J(new xc)}function MZe(e){var t,n;return t=e.c.i,n=e.d.i,t.k==(zn(),Ls)&&n.k==Ls}function Dre(e){var t;return t=new Iv,Ho(t,e),Ye(t,(pt(),Fo),null),t}function Ire(e,t,n){var r;return r=e.Yg(t),r>=0?e._g(r,n,!0):tw(e,t,n)}function Kwe(e,t,n,r){var s;for(s=0;st)throw J(new Do(M4e(e,t,"index")));return e}function Ore(e,t,n,r){var s;return s=Me(Lr,Jr,25,t,15,1),Khn(s,e,t,n,r),s}function Rnn(e,t){var n;n=e.q.getHours()+(t/60|0),e.q.setMinutes(t),lC(e,n)}function Fnn(e,t){return b.Math.min(Hp(t.a,e.d.d.c),Hp(t.b,e.d.d.c))}function z6(e,t){return fa(t)?t==null?W4e(e.f,null):Vtt(e.g,t):W4e(e.f,t)}function N1(e){this.c=e,this.a=new C(this.c.a),this.b=new C(this.c.b)}function k$(){this.e=new st,this.c=new st,this.d=new st,this.b=new st}function PZe(){this.g=new fpe,this.b=new fpe,this.a=new st,this.k=new st}function BZe(e,t,n){this.a=e,this.c=t,this.d=n,it(t.e,this),it(n.b,this)}function RZe(e,t){Zqe.call(this,t.rd(),t.qd()&-6),Sn(e),this.a=e,this.b=t}function FZe(e,t){Jqe.call(this,t.rd(),t.qd()&-6),Sn(e),this.a=e,this.b=t}function tme(e,t){Hte.call(this,t.rd(),t.qd()&-6),Sn(e),this.a=e,this.b=t}function x$(e,t,n){this.a=e,this.b=t,this.c=n,it(e.t,this),it(t.i,this)}function E$(){this.b=new as,this.a=new as,this.b=new as,this.a=new as}function T$(){T$=pe,NS=new Zi("org.eclipse.elk.labels.labelManager")}function jZe(){jZe=pe,e9e=new zs("separateLayerConnections",(cH(),rle))}function Jf(){Jf=pe,jy=new E2e("REGULAR",0),d2=new E2e("CRITICAL",1)}function uD(){uD=pe,dhe=new m2e("STACKED",0),DO=new m2e("SEQUENCED",1)}function lD(){lD=pe,Hhe=new L2e("FIXED",0),CV=new L2e("CENTER_NODE",1)}function jnn(e,t){var n;return n=Gwn(e,t),e.b=new Z$(n.c.length),twn(e,n)}function $nn(e,t,n){var r;return++e.e,--e.f,r=u(e.d[t].$c(n),133),r.dd()}function $Ze(e){var t;return e.a||(t=e.r,we(t,148)&&(e.a=u(t,148))),e.a}function nme(e){if(e.a){if(e.e)return nme(e.e)}else return e;return null}function Hnn(e,t){return e.pt.p?-1:0}function _$(e,t){return Sn(t),e.c=0,"Initial capacity must not be negative")}function GZe(){GZe=pe,ogt=Qr((n1(),ie(re(Ey,1),tt,232,0,[pc,lu,bc])))}function qZe(){qZe=pe,ugt=Qr((al(),ie(re(cgt,1),tt,461,0,[Nd,a2,Af])))}function VZe(){VZe=pe,hgt=Qr((Lu(),ie(re(lgt,1),tt,462,0,[u1,o2,Lf])))}function UZe(){UZe=pe,X0t=Qr((F1(),ie(re(yl,1),tt,132,0,[g7e,Ql,xy])))}function WZe(){WZe=pe,Cpt=Qr((L_(),ie(re(cEe,1),tt,379,0,[que,Gue,Vue])))}function KZe(){KZe=pe,Hpt=Qr((Uv(),ie(re(fEe,1),tt,423,0,[N4,hEe,Xue])))}function YZe(){YZe=pe,y2t=Qr((V6(),ie(re(c9e,1),tt,314,0,[Ek,vO,o9e])))}function XZe(){XZe=pe,k2t=Qr((V$(),ie(re(l9e,1),tt,337,0,[u9e,Aq,ple])))}function QZe(){QZe=pe,_2t=Qr((sb(),ie(re(T2t,1),tt,450,0,[wle,aE,F4])))}function ZZe(){ZZe=pe,b2t=Qr((qv(),ie(re(sle,1),tt,361,0,[mw,u2,ww])))}function JZe(){JZe=pe,O2t=Qr((P0(),ie(re(I2t,1),tt,303,0,[mO,$4,Tk])))}function eJe(){eJe=pe,D2t=Qr((q8(),ie(re(Ale,1),tt,292,0,[Cle,Sle,wO])))}function tJe(){tJe=pe,Qvt=Qr((j_(),ie(re(h_e,1),tt,378,0,[ihe,l_e,iV])))}function nJe(){nJe=pe,swt=Qr((iH(),ie(re(T_e,1),tt,375,0,[x_e,fhe,E_e])))}function rJe(){rJe=pe,twt=Qr((R0(),ie(re(y_e,1),tt,339,0,[f2,m_e,uhe])))}function iJe(){iJe=pe,iwt=Qr((vo(),ie(re(rwt,1),tt,452,0,[yS,ul,hu])))}function sJe(){sJe=pe,uwt=Qr((uH(),ie(re(D_e,1),tt,377,0,[bhe,wE,Fy])))}function aJe(){aJe=pe,owt=Qr((Q8(),ie(re(S_e,1),tt,336,0,[ghe,C_e,kS])))}function oJe(){oJe=pe,cwt=Qr((nH(),ie(re(M_e,1),tt,338,0,[L_e,phe,A_e])))}function cJe(){cJe=pe,xwt=Qr((Gv(),ie(re(kwt,1),tt,454,0,[IO,xS,cV])))}function uJe(){uJe=pe,Lmt=Qr((yH(),ie(re(Amt,1),tt,442,0,[Dhe,Lhe,Mhe])))}function lJe(){lJe=pe,Dmt=Qr((RD(),ie(re(tCe,1),tt,380,0,[yV,J_e,eCe])))}function hJe(){hJe=pe,Kmt=Qr((mH(),ie(re(mCe,1),tt,381,0,[wCe,Rhe,vCe])))}function fJe(){fJe=pe,Wmt=Qr((rH(),ie(re(pCe,1),tt,293,0,[Bhe,gCe,dCe])))}function dJe(){dJe=pe,pyt=Qr((GD(),ie(re(Fhe,1),tt,437,0,[EV,TV,_V])))}function gJe(){gJe=pe,w3t=Qr((F0(),ie(re(cAe,1),tt,334,0,[FV,Wg,jS])))}function pJe(){pJe=pe,g3t=Qr((P1(),ie(re(XSe,1),tt,272,0,[EE,zy,TE])))}function Knn(){return wa(),ie(re(hAe,1),tt,98,0,[w2,X1,CE,$b,p0,tu])}function J2(e,t){return!e.o&&(e.o=new Nl((cu(),k2),Dw,e,0)),qie(e.o,t)}function Ynn(e){return!e.g&&(e.g=new kx),!e.g.d&&(e.g.d=new N$e(e)),e.g.d}function Xnn(e){return!e.g&&(e.g=new kx),!e.g.a&&(e.g.a=new P$e(e)),e.g.a}function Qnn(e){return!e.g&&(e.g=new kx),!e.g.b&&(e.g.b=new O$e(e)),e.g.b}function hD(e){return!e.g&&(e.g=new kx),!e.g.c&&(e.g.c=new B$e(e)),e.g.c}function Znn(e,t,n){var r,s;for(s=new G8(t,e),r=0;rn||t=0?e._g(n,!0,!0):tw(e,t,!0)}function prn(e,t){return Fs(Ue(ft(K(e,(et(),Ew)))),Ue(ft(K(t,Ew))))}function xJe(){xJe=pe,Tmt=Qv(Qv(AF(new Xs,(a7(),_S)),(nC(),dV)),mhe)}function brn(e,t,n){var r;return r=gnt(e,t,n),e.b=new Z$(r.c.length),w5e(e,r)}function vrn(e){if(e.b<=0)throw J(new xc);return--e.b,e.a-=e.c.c,ct(e.a)}function wrn(e){var t;if(!e.a)throw J(new CYe);return t=e.a,e.a=us(e.a),t}function mrn(e){for(;!e.a;)if(!lWe(e.c,new Rt(e)))return!1;return!0}function q6(e){var t;return Nr(e),we(e,198)?(t=u(e,198),t):new iee(e)}function yrn(e){A$(),u(e.We((bi(),Hy)),174).Fc((ol(),JO)),e.Ye(cfe,null)}function A$(){A$=pe,$yt=new vZ,zyt=new wZ,Hyt=ian((bi(),cfe),$yt,p2,zyt)}function L$(){L$=pe,Q_e=new A2e("LEAF_NUMBER",0),Ihe=new A2e("NODE_SIZE",1)}function krn(e,t,n){e.a=t,e.c=n,e.b.a.$b(),Rh(e.d),e.e.a.c=Me(Yn,yt,1,0,5,1)}function $re(e){e.a=Me(Lr,Jr,25,e.b+1,15,1),e.c=Me(Lr,Jr,25,e.b,15,1),e.d=0}function xrn(e,t){e.a.ue(t.d,e.b)>0&&(it(e.c,new vve(t.c,t.d,e.d)),e.b=t.d)}function fme(e,t){if(e.g==null||t>=e.i)throw J(new zte(t,e.i));return e.g[t]}function EJe(e,t,n){if(K8(e,n),n!=null&&!e.wj(n))throw J(new zee);return n}function TJe(e){var t;if(e.Ek())for(t=e.i-1;t>=0;--t)Te(e,t);return Rwe(e)}function Ern(e){var t,n;if(!e.b)return null;for(n=e.b;t=n.a[0];)n=t;return n}function Trn(e,t){var n,r;return UQe(t),n=(r=e.slice(0,t),gme(r,e)),n.length=t,n}function L8(e,t,n,r){var s;r=(q3(),r||r7e),s=e.slice(t,n),D4e(s,e,t,n,-t,r)}function ph(e,t,n,r,s){return t<0?tw(e,n,r):u(n,66).Nj().Pj(e,e.yh(),t,r,s)}function _rn(e){return we(e,172)?""+u(e,172).a:e==null?null:Qo(e)}function Crn(e){return we(e,172)?""+u(e,172).a:e==null?null:Qo(e)}function _Je(e,t){if(t.a)throw J(new tc(Sht));Gs(e.a,t),t.a=e,!e.j&&(e.j=t)}function dme(e,t){Hte.call(this,t.rd(),t.qd()&-16449),Sn(e),this.a=e,this.c=t}function CJe(e,t){var n,r;return r=t/e.c.Hd().gc()|0,n=t%e.c.Hd().gc(),G6(e,r,n)}function al(){al=pe,Nd=new pte(uk,0),a2=new pte(D7,1),Af=new pte(lk,2)}function M$(){M$=pe,_ue=new IF("All",0),l7e=new kVe,h7e=new OVe,f7e=new xVe}function SJe(){SJe=pe,q0t=Qr((M$(),ie(re(GG,1),tt,297,0,[_ue,l7e,h7e,f7e])))}function AJe(){AJe=pe,Ppt=Qr((V8(),ie(re(Npt,1),tt,405,0,[vw,_y,Ty,O4])))}function LJe(){LJe=pe,Bgt=Qr((Vv(),ie(re(Pgt,1),tt,406,0,[sO,iO,Oue,Nue])))}function MJe(){MJe=pe,Fgt=Qr((Z6(),ie(re(Rgt,1),tt,323,0,[oO,aO,cO,uO])))}function DJe(){DJe=pe,Hgt=Qr((Y_(),ie(re($gt,1),tt,394,0,[lO,KG,YG,hO])))}function IJe(){IJe=pe,smt=Qr((a7(),ie(re(B_e,1),tt,393,0,[fV,_S,NO,CS])))}function OJe(){OJe=pe,e2t=Qr((cH(),ie(re(Jpt,1),tt,360,0,[rle,kq,xq,bO])))}function NJe(){NJe=pe,Umt=Qr((jH(),ie(re(fCe,1),tt,340,0,[Phe,lCe,hCe,uCe])))}function PJe(){PJe=pe,u2t=Qr((R1(),ie(re(c2t,1),tt,411,0,[xk,tE,nE,ile])))}function BJe(){BJe=pe,Zvt=Qr((Zm(),ie(re(ahe,1),tt,197,0,[sV,she,K4,W4])))}function RJe(){RJe=pe,P3t=Qr((Pl(),ie(re(N3t,1),tt,396,0,[nh,mAe,wAe,yAe])))}function FJe(){FJe=pe,y3t=Qr((Ul(),ie(re(m3t,1),tt,285,0,[QO,d0,b2,XO])))}function jJe(){jJe=pe,p3t=Qr(($0(),ie(re(ffe,1),tt,218,0,[hfe,YO,_E,jk])))}function $Je(){$Je=pe,I3t=Qr((EH(),ie(re(vAe,1),tt,311,0,[pfe,gAe,bAe,pAe])))}function HJe(){HJe=pe,M3t=Qr((Bl(),ie(re(qS,1),tt,374,0,[tN,Hb,eN,Gy])))}function zJe(){zJe=pe,pz(),tLe=gs,R4t=Ds,nLe=new C3(gs),F4t=new C3(Ds)}function pD(){pD=pe,b9e=new b2e(U0,0),Dq=new b2e("IMPROVE_STRAIGHTNESS",1)}function Srn(e,t){return h8(),it(e,new xa(t,ct(t.e.c.length+t.g.c.length)))}function Arn(e,t){return h8(),it(e,new xa(t,ct(t.e.c.length+t.g.c.length)))}function gme(e,t){return yD(t)!=10&&ie(pl(t),t.hm,t.__elementTypeId$,yD(t),e),e}function Au(e,t){var n;return n=Yo(e,t,0),n==-1?!1:(Eg(e,n),!0)}function GJe(e,t){var n;return n=u(z6(e.e,t),387),n?(yve(n),n.e):null}function M8(e){var t;return Ko(e)&&(t=0-e,!isNaN(t))?t:Gp(U8(e))}function Yo(e,t,n){for(;n=0?NH(e,n,!0,!0):tw(e,t,!0)}function mme(e,t){IT();var n,r;return n=j6(e),r=j6(t),!!n&&!!r&&!oit(n.k,r.k)}function Drn(e,t){Du(e,t==null||wj((Sn(t),t))||isNaN((Sn(t),t))?0:(Sn(t),t))}function Irn(e,t){Iu(e,t==null||wj((Sn(t),t))||isNaN((Sn(t),t))?0:(Sn(t),t))}function Orn(e,t){zv(e,t==null||wj((Sn(t),t))||isNaN((Sn(t),t))?0:(Sn(t),t))}function Nrn(e,t){Hv(e,t==null||wj((Sn(t),t))||isNaN((Sn(t),t))?0:(Sn(t),t))}function KJe(e){(this.q?this.q:(hn(),hn(),l0)).Ac(e.q?e.q:(hn(),hn(),l0))}function Prn(e,t){return we(t,99)&&u(t,18).Bb&so?new Gte(t,e):new G8(t,e)}function Brn(e,t){return we(t,99)&&u(t,18).Bb&so?new Gte(t,e):new G8(t,e)}function YJe(e,t){j7e=new rs,jgt=t,ZC=e,u(ZC.b,65),sme(ZC,j7e,null),qut(ZC)}function Vre(e,t,n){var r;return r=e.g[t],n_(e,t,e.oi(t,n)),e.gi(t,n,r),e.ci(),r}function N$(e,t){var n;return n=e.Xc(t),n>=0?(e.$c(n),!0):!1}function Ure(e){var t;return e.d!=e.r&&(t=$h(e),e.e=!!t&&t.Cj()==Idt,e.d=t),e.e}function Wre(e,t){var n;for(Nr(e),Nr(t),n=!1;t.Ob();)n=n|e.Fc(t.Pb());return n}function Fv(e,t){var n;return n=u(er(e.e,t),387),n?(HVe(e,n),n.e):null}function XJe(e){var t,n;return t=e/60|0,n=e%60,n==0?""+t:""+t+":"+(""+n)}function ic(e,t){var n,r;return ub(e),r=new tme(t,e.a),n=new dWe(r),new vn(e,n)}function Gm(e,t){var n=e.a[t],r=(fie(),yue)[typeof n];return r?r(n):Eye(typeof n)}function Rrn(e){switch(e.g){case 0:return Ei;case 1:return-1;default:return 0}}function Frn(e){return $3e(e,(D8(),F8e))<0?-eKt(U8(e)):e.l+e.m*ck+e.h*vb}function yD(e){return e.__elementTypeCategory$==null?10:e.__elementTypeCategory$}function Kre(e){var t;return t=e.b.c.length==0?null:St(e.b,0),t!=null&&iie(e,0),t}function QJe(e,t){for(;t[0]=0;)++t[0]}function kD(e,t){this.e=t,this.a=Utt(e),this.a<54?this.f=Bv(e):this.c=WD(e)}function ZJe(e,t,n,r){yi(),cv.call(this,26),this.c=e,this.a=t,this.d=n,this.b=r}function e0(e,t,n){var r,s;for(r=10,s=0;se.a[r]&&(r=n);return r}function qrn(e,t){var n;return n=Kv(e.e.c,t.e.c),n==0?Fs(e.e.d,t.e.d):n}function W3(e,t){return t.e==0||e.e==0?K7:(d7(),Yse(e,t))}function Vrn(e,t){if(!e)throw J(new Ln(Kgn("Enum constant undefined: %s",t)))}function M_(){M_=pe,Fpt=new ev,jpt=new cd,Bpt=new fx,Rpt=new oh,$pt=new QK}function P$(){P$=pe,m7e=new l2e("BY_SIZE",0),Lue=new l2e("BY_SIZE_AND_SHAPE",1)}function B$(){B$=pe,$ue=new h2e("EADES",0),ZG=new h2e("FRUCHTERMAN_REINGOLD",1)}function ED(){ED=pe,Lq=new p2e("READING_DIRECTION",0),d9e=new p2e("ROTATION",1)}function eet(){eet=pe,x2t=Qr((db(),ie(re(f9e,1),tt,335,0,[ble,h9e,vle,sS,iS])))}function tet(){tet=pe,Jvt=Qr((X_(),ie(re(d_e,1),tt,315,0,[f_e,ohe,che,wS,mS])))}function net(){net=pe,h2t=Qr((c4(),ie(re(l2t,1),tt,363,0,[Tq,Cq,Sq,_q,Eq])))}function ret(){ret=pe,P2t=Qr((mh(),ie(re(G9e,1),tt,163,0,[TO,lS,l2,hS,Ly])))}function iet(){iet=pe,yyt=Qr((rI(),ie(re(RCe,1),tt,316,0,[NCe,zhe,BCe,Ghe,PCe])))}function set(){set=pe,Gyt=Qr((i1(),ie(re(Ug,1),tt,175,0,[Fn,ua,Fd,Bb,Vg])))}function aet(){aet=pe,gyt=Qr((v7(),ie(re(dyt,1),tt,355,0,[X4,Nk,IS,DS,OS])))}function oet(){oet=pe,Mpt=Qr((ro(),ie(re(uEe,1),tt,356,0,[Pd,c2,bu,Zc,Go])))}function cet(){cet=pe,d3t=Qr((wo(),ie(re(RS,1),tt,103,0,[f0,Df,Xh,Y0,X0])))}function uet(){uet=pe,x3t=Qr((n4(),ie(re(HS,1),tt,249,0,[v2,ZO,uAe,$S,lAe])))}function het(){het=pe,_3t=Qr((ht(),ie(re(ao,1),Dc,61,0,[uc,An,$n,xr,Dn])))}function Yre(e,t){var n;return n=u(er(e.a,t),134),n||(n=new b3,Si(e.a,t,n)),n}function fet(e){var t;return t=u(K(e,(et(),yw)),305),t?t.a==e:!1}function det(e){var t;return t=u(K(e,(et(),yw)),305),t?t.i==e:!1}function get(e,t){return Sn(t),$ve(e),e.d.Ob()?(t.td(e.d.Pb()),!0):!1}function R$(e){return Mc(e,Ei)>0?Ei:Mc(e,$a)<0?$a:Or(e)}function qm(e){return e<3?(ql(e,uht),e+1):e=0&&t=-.01&&e.a<=z1&&(e.a=0),e.b>=-.01&&e.b<=z1&&(e.b=0),e}function bet(e,t){return t==(gne(),gne(),H0t)?e.toLocaleLowerCase():e.toLowerCase()}function kme(e){return(e.i&2?"interface ":e.i&1?"":"class ")+(S0(e),e.o)}function Bo(e){var t,n;n=(t=new Uee,t),Br((!e.q&&(e.q=new at(nf,e,11,10)),e.q),n)}function Urn(e,t){var n;return n=t>0?t-1:t,hze(aUt(zet(mve(new Ux,n),e.n),e.j),e.k)}function Wrn(e,t,n,r){var s;e.j=-1,q4e(e,T4e(e,t,n),(ho(),s=u(t,66).Mj(),s.Ok(r)))}function vet(e){this.g=e,this.f=new st,this.a=b.Math.min(this.g.c.c,this.g.d.c)}function wet(e){this.b=new st,this.a=new st,this.c=new st,this.d=new st,this.e=e}function met(e,t){this.a=new Mr,this.e=new Mr,this.b=(j_(),iV),this.c=e,this.b=t}function yet(e,t,n){bj.call(this),xme(this),this.a=e,this.c=n,this.b=t.d,this.f=t.e}function ket(e){this.d=e,this.c=e.c.vc().Kc(),this.b=null,this.a=null,this.e=(cF(),bue)}function jv(e){if(e<0)throw J(new Ln("Illegal Capacity: "+e));this.g=this.ri(e)}function Krn(e,t){if(0>e||e>t)throw J(new Ppe("fromIndex: 0, toIndex: "+e+E6e+t))}function Yrn(e){var t;if(e.a==e.b.a)throw J(new xc);return t=e.a,e.c=t,e.a=e.a.e,t}function F$(e){var t;Am(!!e.c),t=e.c.a,bh(e.d,e.c),e.b==e.c?e.b=t:--e.a,e.c=null}function j$(e,t){var n;return ub(e),n=new zYe(e,e.a.rd(),e.a.qd()|4,t),new vn(e,n)}function Xrn(e,t){var n,r;return n=u(Ym(e.d,t),14),n?(r=t,e.e.pc(r,n)):null}function $$(e,t){var n,r;for(r=e.Kc();r.Ob();)n=u(r.Pb(),70),Ye(n,(et(),Ak),t)}function Qrn(e){var t;return t=Ue(ft(K(e,(pt(),Hg)))),t<0&&(t=0,Ye(e,Hg,t)),t}function Zrn(e,t,n){var r;r=b.Math.max(0,e.b/2-.5),Z_(n,r,1),it(t,new UGe(n,r))}function Jrn(e,t,n){var r;return r=e.a.e[u(t.a,10).p]-e.a.e[u(n.a,10).p],_s(WM(r))}function xet(e,t,n,r,s,o){var h;h=Dre(r),Va(h,s),ba(h,o),sn(e.a,r,new mj(h,t,n.f))}function Eet(e,t){var n;if(n=dI(e.Tg(),t),!n)throw J(new Ln(i2+t+Oce));return n}function Vm(e,t){var n;for(n=e;us(n);)if(n=us(n),n==t)return!0;return!1}function ein(e,t){var n,r,s;for(r=t.a.cd(),n=u(t.a.dd(),14).gc(),s=0;s0&&(e.a/=t,e.b/=t),e}function Gl(e){var t;return e.w?e.w:(t=utn(e),t&&!t.kh()&&(e.w=t),t)}function cin(e){var t;return e==null?null:(t=u(e,190),ufn(t,t.length))}function Te(e,t){if(e.g==null||t>=e.i)throw J(new zte(t,e.i));return e.li(t,e.g[t])}function uin(e){var t,n;for(t=e.a.d.j,n=e.c.d.j;t!=n;)Tf(e.b,t),t=vH(t);Tf(e.b,t)}function lin(e){var t;for(t=0;t=14&&t<=16))),e}function Aet(e,t,n){var r=function(){return e.apply(r,arguments)};return t.apply(r,n),r}function Let(e,t,n){var r,s;r=t;do s=Ue(e.p[r.p])+n,e.p[r.p]=s,r=e.a[r.p];while(r!=t)}function I8(e,t){var n,r;r=e.a,n=qan(e,t,null),r!=t&&!e.e&&(n=E7(e,t,n)),n&&n.Fi()}function Eme(e,t){return S1(),Ef(Jp),b.Math.abs(e-t)<=Jp||e==t||isNaN(e)&&isNaN(t)}function Tme(e,t){return S1(),Ef(Jp),b.Math.abs(e-t)<=Jp||e==t||isNaN(e)&&isNaN(t)}function din(e,t){return Xp(),Tu(e.b.c.length-e.e.c.length,t.b.c.length-t.e.c.length)}function K3(e,t){return hUt(O_(e,t,Or(ja(s0,Qd(Or(ja(t==null?0:Xi(t),a0)),15)))))}function Met(){Met=pe,Vpt=Qr((zn(),ie(re(Zue,1),tt,267,0,[Hs,ca,Ls,Jc,Rl,U1])))}function Det(){Det=pe,Zyt=Qr((ty(),ie(re(Jhe,1),tt,291,0,[Zhe,qO,GO,Qhe,HO,zO])))}function Iet(){Iet=pe,Uyt=Qr((t0(),ie(re(aSe,1),tt,248,0,[Yhe,jO,$O,DV,LV,MV])))}function Oet(){Oet=pe,w2t=Qr((ek(),ie(re(sE,1),tt,227,0,[iE,rS,rE,Cy,R4,B4])))}function Net(){Net=pe,L2t=Qr((h7(),ie(re(A9e,1),tt,275,0,[aS,T9e,S9e,C9e,_9e,E9e])))}function Pet(){Pet=pe,A2t=Qr((tI(),ie(re(x9e,1),tt,274,0,[Iq,m9e,k9e,w9e,y9e,Tle])))}function Bet(){Bet=pe,Xvt=Qr((WH(),ie(re(u_e,1),tt,313,0,[rhe,o_e,nhe,a_e,c_e,rV])))}function Ret(){Ret=pe,C2t=Qr((QH(),ie(re(p9e,1),tt,276,0,[yle,mle,xle,kle,Ele,Mq])))}function Fet(){Fet=pe,omt=Qr((nC(),ie(re(amt,1),tt,327,0,[dV,mhe,khe,yhe,xhe,whe])))}function jet(){jet=pe,T3t=Qr((ol(),ie(re(jV,1),tt,273,0,[m2,Z0,JO,GS,zS,$k])))}function $et(){$et=pe,b3t=Qr((YH(),ie(re(nAe,1),tt,312,0,[dfe,JSe,tAe,QSe,eAe,ZSe])))}function gin(){return sy(),ie(re(xo,1),tt,93,0,[If,Q0,Of,Pf,g0,Zh,Jl,Nf,Qh])}function z$(e,t){var n;n=e.a,e.a=t,e.Db&4&&!(e.Db&1)&&_i(e,new Hm(e,0,n,e.a))}function G$(e,t){var n;n=e.b,e.b=t,e.Db&4&&!(e.Db&1)&&_i(e,new Hm(e,1,n,e.b))}function O8(e,t){var n;n=e.b,e.b=t,e.Db&4&&!(e.Db&1)&&_i(e,new Hm(e,3,n,e.b))}function Hv(e,t){var n;n=e.f,e.f=t,e.Db&4&&!(e.Db&1)&&_i(e,new Hm(e,3,n,e.f))}function zv(e,t){var n;n=e.g,e.g=t,e.Db&4&&!(e.Db&1)&&_i(e,new Hm(e,4,n,e.g))}function Du(e,t){var n;n=e.i,e.i=t,e.Db&4&&!(e.Db&1)&&_i(e,new Hm(e,5,n,e.i))}function Iu(e,t){var n;n=e.j,e.j=t,e.Db&4&&!(e.Db&1)&&_i(e,new Hm(e,6,n,e.j))}function N8(e,t){var n;n=e.j,e.j=t,e.Db&4&&!(e.Db&1)&&_i(e,new Hm(e,1,n,e.j))}function P8(e,t){var n;n=e.c,e.c=t,e.Db&4&&!(e.Db&1)&&_i(e,new Hm(e,4,n,e.c))}function B8(e,t){var n;n=e.k,e.k=t,e.Db&4&&!(e.Db&1)&&_i(e,new Hm(e,2,n,e.k))}function Qre(e,t){var n;n=e.d,e.d=t,e.Db&4&&!(e.Db&1)&&_i(e,new Tre(e,2,n,e.d))}function Cg(e,t){var n;n=e.s,e.s=t,e.Db&4&&!(e.Db&1)&&_i(e,new Tre(e,4,n,e.s))}function Wm(e,t){var n;n=e.t,e.t=t,e.Db&4&&!(e.Db&1)&&_i(e,new Tre(e,5,n,e.t))}function R8(e,t){var n;n=e.F,e.F=t,e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,5,n,t))}function TD(e,t){var n;return n=u(er((LF(),QV),e),55),n?n.xj(t):Me(Yn,yt,1,t,5,1)}function B0(e,t){var n,r;return n=t in e.a,n&&(r=M0(e,t).he(),r)?r.a:null}function pin(e,t){var n,r,s;return n=(r=(pv(),s=new j9,s),t&&f5e(r,t),r),Ome(n,e),n}function Het(e,t,n){if(K8(e,n),!e.Bk()&&n!=null&&!e.wj(n))throw J(new zee);return n}function zet(e,t){return e.n=t,e.n?(e.f=new st,e.e=new st):(e.f=null,e.e=null),e}function Gr(e,t,n,r,s,o){var h;return h=Gne(e,t),qet(n,h),h.i=s?8:0,h.f=r,h.e=s,h.g=o,h}function _me(e,t,n,r,s){this.d=t,this.k=r,this.f=s,this.o=-1,this.p=1,this.c=e,this.a=n}function Cme(e,t,n,r,s){this.d=t,this.k=r,this.f=s,this.o=-1,this.p=2,this.c=e,this.a=n}function Sme(e,t,n,r,s){this.d=t,this.k=r,this.f=s,this.o=-1,this.p=6,this.c=e,this.a=n}function Ame(e,t,n,r,s){this.d=t,this.k=r,this.f=s,this.o=-1,this.p=7,this.c=e,this.a=n}function Lme(e,t,n,r,s){this.d=t,this.j=r,this.e=s,this.o=-1,this.p=4,this.c=e,this.a=n}function Get(e,t){var n,r,s,o;for(r=t,s=0,o=r.length;s=0),pcn(e.d,e.c)<0&&(e.a=e.a-1&e.d.a.length-1,e.b=e.d.c),e.c=-1}function Mme(e){return e.a<54?e.f<0?-1:e.f>0?1:0:(!e.c&&(e.c=FD(e.f)),e.c).e}function Ef(e){if(!(e>=0))throw J(new Ln("tolerance ("+e+") must be >= 0"));return e}function F8(){return Whe||(Whe=new Ict,J3(Whe,ie(re(I4,1),yt,130,0,[new wp]))),Whe}function vo(){vo=pe,yS=new Ste(EC,0),ul=new Ste("INPUT",1),hu=new Ste("OUTPUT",2)}function V$(){V$=pe,u9e=new kte("ARD",0),Aq=new kte("MSD",1),ple=new kte("MANUAL",2)}function Gv(){Gv=pe,IO=new Ite("BARYCENTER",0),xS=new Ite(bft,1),cV=new Ite(vft,2)}function _D(e,t){var n;if(n=e.gc(),t<0||t>n)throw J(new Im(t,n));return new Kbe(e,t)}function Wet(e,t){var n;return we(t,42)?e.c.Mc(t):(n=qie(e,t),CH(e,t),n)}function Co(e,t,n){return cb(e,t),au(e,n),Cg(e,0),Wm(e,1),Mg(e,!0),Lg(e,!0),e}function ql(e,t){if(e<0)throw J(new Ln(t+" cannot be negative but was: "+e));return e}function Ket(e,t){var n,r;for(n=0,r=e.gc();n0?u(St(n.a,r-1),10):null}function I_(e,t){var n;n=e.k,e.k=t,e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,2,n,e.k))}function W$(e,t){var n;n=e.f,e.f=t,e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,8,n,e.f))}function K$(e,t){var n;n=e.i,e.i=t,e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,7,n,e.i))}function Ome(e,t){var n;n=e.a,e.a=t,e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,8,n,e.a))}function Nme(e,t){var n;n=e.b,e.b=t,e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,0,n,e.b))}function Pme(e,t){var n;n=e.b,e.b=t,e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,0,n,e.b))}function Bme(e,t){var n;n=e.c,e.c=t,e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,1,n,e.c))}function Rme(e,t){var n;n=e.c,e.c=t,e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,1,n,e.c))}function Jre(e,t){var n;n=e.c,e.c=t,e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,4,n,e.c))}function Fme(e,t){var n;n=e.d,e.d=t,e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,1,n,e.d))}function eie(e,t){var n;n=e.D,e.D=t,e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,2,n,e.D))}function tie(e,t){e.r>0&&e.c0&&e.g!=0&&tie(e.i,t/e.r*e.i.d))}function Tin(e,t,n){var r;e.b=t,e.a=n,r=(e.a&512)==512?new PHe:new qL,e.c=$pn(r,e.b,e.a)}function rtt(e,t){return G0(e.e,t)?(ho(),Ure(t)?new Cj(t,e):new DM(t,e)):new Wqe(t,e)}function Y$(e,t){return lUt(N_(e.a,t,Or(ja(s0,Qd(Or(ja(t==null?0:Xi(t),a0)),15)))))}function _in(e,t,n){return zm(e,new ot(t),new Zs,new ut(n),ie(re(yl,1),tt,132,0,[]))}function Cin(e){var t,n;return 0>e?new Xpe:(t=e+1,n=new _Ze(t,e),new Lbe(null,n))}function Sin(e,t){hn();var n;return n=new w6(1),fa(e)?Oo(n,e,t):gu(n.f,e,t),new H(n)}function Ain(e,t){var n,r;return n=e.o+e.p,r=t.o+t.p,nt?(t<<=1,t>0?t:wC):t}function nie(e){switch(abe(e.e!=3),e.e){case 2:return!1;case 0:return!0}return Nnn(e)}function stt(e,t){var n;return we(t,8)?(n=u(t,8),e.a==n.a&&e.b==n.b):!1}function rie(e,t,n){var r,s,o;return o=t>>5,s=t&31,r=qs(Nm(e.n[n][o],Or(A0(s,1))),3),r}function Min(e,t){var n,r;for(r=t.vc().Kc();r.Ob();)n=u(r.Pb(),42),qH(e,n.cd(),n.dd())}function Din(e,t){var n;n=new rs,u(t.b,65),u(t.b,65),u(t.b,65),Mu(t.a,new sve(e,n,t))}function jme(e,t){var n;n=e.b,e.b=t,e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,21,n,e.b))}function $me(e,t){var n;n=e.d,e.d=t,e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,11,n,e.d))}function X$(e,t){var n;n=e.j,e.j=t,e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,13,n,e.j))}function att(e,t,n){var r,s,o;for(o=e.a.length-1,s=e.b,r=0;r>>31;r!=0&&(e[n]=r)}function Hin(e,t){hn();var n,r;for(r=new st,n=0;n0&&(this.g=this.ri(this.i+(this.i/8|0)+1),e.Qc(this.g))}function ds(e,t){xj.call(this,b4t,e,t),this.b=this,this.a=pu(e.Tg(),gn(this.e.Tg(),this.c))}function P_(e,t){var n,r;for(Sn(t),r=t.vc().Kc();r.Ob();)n=u(r.Pb(),42),e.zc(n.cd(),n.dd())}function Qin(e,t,n){var r;for(r=n.Kc();r.Ob();)if(!v$(e,t,r.Pb()))return!1;return!0}function Zin(e,t,n,r,s){var o;return n&&(o=Ji(t.Tg(),e.c),s=n.gh(t,-1-(o==-1?r:o),null,s)),s}function Jin(e,t,n,r,s){var o;return n&&(o=Ji(t.Tg(),e.c),s=n.ih(t,-1-(o==-1?r:o),null,s)),s}function _tt(e){var t;if(e.b==-2){if(e.e==0)t=-1;else for(t=0;e.a[t]==0;t++);e.b=t}return e.b}function Ctt(e){switch(e.g){case 2:return ht(),Dn;case 4:return ht(),$n;default:return e}}function Stt(e){switch(e.g){case 1:return ht(),xr;case 3:return ht(),An;default:return e}}function esn(e){var t,n,r;return e.j==(ht(),An)&&(t=not(e),n=Vu(t,$n),r=Vu(t,Dn),r||r&&n)}function tsn(e){var t,n;return t=u(e.e&&e.e(),9),n=u(Qve(t,t.length),9),new hh(t,n,t.length)}function nsn(e,t){kr(t,pft,1),Uye(xUt(new nr((DT(),new Qne(e,!1,!1,new qP))))),ur(t)}function CD(e,t){return Mn(),fa(e)?Jwe(e,Hr(t)):Sm(e)?Ine(e,ft(t)):Cm(e)?aZt(e,Mt(t)):e.wd(t)}function Ume(e,t){t.q=e,e.d=b.Math.max(e.d,t.r),e.b+=t.d+(e.a.c.length==0?0:e.c),it(e.a,t)}function $8(e,t){var n,r,s,o;return s=e.c,n=e.c+e.b,o=e.d,r=e.d+e.a,t.a>s&&t.ao&&t.b1||e.Ob())return++e.a,e.g=0,t=e.i,e.Ob(),t;throw J(new xc)}function gsn(e){CVe();var t;return BGe(vhe,e)||(t=new CQ,t.a=e,Bbe(vhe,e,t)),u(_o(vhe,e),635)}function Fh(e){var t,n,r,s;return s=e,r=0,s<0&&(s+=vb,r=V0),n=_s(s/ck),t=_s(s-n*ck),fu(t,n,r)}function SD(e){var t,n,r;for(r=0,n=new m6(e.a);n.a>22),s=e.h+t.h+(r>>22),fu(n&ml,r&ml,s&V0)}function Wtt(e,t){var n,r,s;return n=e.l-t.l,r=e.m-t.m+(n>>22),s=e.h-t.h+(r>>22),fu(n&ml,r&ml,s&V0)}function DD(e){var t;return e<128?(t=(aKe(),z8e)[e],!t&&(t=z8e[e]=new YR(e)),t):new YR(e)}function ts(e){var t;return we(e,78)?e:(t=e&&e.__java$exception,t||(t=new Bnt(e),Q$e(t)),t)}function ID(e){if(we(e,186))return u(e,118);if(e)return null;throw J(new b6(z1t))}function Ktt(e,t){if(t==null)return!1;for(;e.a!=e.b;)if(Ci(t,gH(e)))return!0;return!1}function Zme(e){return e.a.Ob()?!0:e.a!=e.d?!1:(e.a=new Iwe(e.e.f),e.a.Ob())}function Rs(e,t){var n,r;return n=t.Pc(),r=n.length,r==0?!1:(hve(e.c,e.c.length,n),!0)}function Lsn(e,t,n){var r,s;for(s=t.vc().Kc();s.Ob();)r=u(s.Pb(),42),e.yc(r.cd(),r.dd(),n);return e}function Ytt(e,t){var n,r;for(r=new C(e.b);r.a=0,"Negative initial capacity"),kj(t>=0,"Non-positive load factor"),sl(this)}function die(e,t,n){return e>=128?!1:e<64?XT(qs(A0(1,e),n),0):XT(qs(A0(1,e-64),t),0)}function Fsn(e,t){return!e||!t||e==t?!1:Kv(e.b.c,t.b.c+t.b.b)<0&&Kv(t.b.c,e.b.c+e.b.b)<0}function ont(e){var t,n,r;return n=e.n,r=e.o,t=e.d,new fh(n.a-t.b,n.b-t.d,r.a+(t.b+t.c),r.b+(t.d+t.a))}function jsn(e){var t,n,r,s;for(n=e.a,r=0,s=n.length;rr)throw J(new Im(t,r));return e.hi()&&(n=xXe(e,n)),e.Vh(t,n)}function PD(e,t,n){return n==null?(!e.q&&(e.q=new Mr),z6(e.q,t)):(!e.q&&(e.q=new Mr),Si(e.q,t,n)),e}function Ye(e,t,n){return n==null?(!e.q&&(e.q=new Mr),z6(e.q,t)):(!e.q&&(e.q=new Mr),Si(e.q,t,n)),e}function cnt(e){var t,n;return n=new k$,Ho(n,e),Ye(n,(zp(),kk),e),t=new Mr,Gbn(e,n,t),pmn(e,n,t),n}function zsn(e){g4();var t,n,r;for(n=Me(na,Qe,8,2,0,1),r=0,t=0;t<2;t++)r+=.5,n[t]=Eun(r,e);return n}function unt(e,t){var n,r,s,o;for(n=!1,r=e.a[t].length,o=0;o>=1);return t}function hnt(e){var t,n;return n=uI(e.h),n==32?(t=uI(e.m),t==32?uI(e.l)+32:t+20-10):n-12}function F_(e){var t;return t=e.a[e.b],t==null?null:(cs(e.a,e.b,null),e.b=e.b+1&e.a.length-1,t)}function fnt(e){var t,n;return t=e.t-e.k[e.o.p]*e.d+e.j[e.o.p]>e.f,n=e.u+e.e[e.o.p]*e.d>e.f*e.s*e.d,t||n}function lH(e,t,n){var r,s;return r=new Rre(t,n),s=new Nt,e.b=rct(e,e.b,r,s),s.b||++e.c,e.b.b=!1,s.d}function dnt(e,t,n){var r,s,o,h;for(h=H_(t,n),o=0,s=h.Kc();s.Ob();)r=u(s.Pb(),11),Si(e.c,r,ct(o++))}function qp(e){var t,n;for(n=new C(e.a.b);n.an&&(n=e[t]);return n}function gnt(e,t,n){var r;return r=new st,p5e(e,t,r,(ht(),$n),!0,!1),p5e(e,n,r,Dn,!1,!1),r}function pie(e,t,n){var r,s,o,h;return o=null,h=t,s=Rv(h,"labels"),r=new Iqe(e,n),o=(o0n(r.a,r.b,s),s),o}function qsn(e,t,n,r){var s;return s=n5e(e,t,n,r),!s&&(s=Van(e,n,r),s&&!v4(e,t,s))?null:s}function Vsn(e,t,n,r){var s;return s=r5e(e,t,n,r),!s&&(s=Iie(e,n,r),s&&!v4(e,t,s))?null:s}function pnt(e,t){var n;for(n=0;n1||t>=0&&e.b<3)}function BD(e){var t,n,r;for(t=new Gu,r=ii(e,0);r.b!=r.d.c;)n=u(ri(r),8),c8(t,0,new Io(n));return t}function ab(e){var t,n;for(n=new C(e.a.b);n.ar?1:0}function vye(e,t){return jot(e,t)?(sn(e.b,u(K(t,(et(),Sy)),21),t),ci(e.a,t),!0):!1}function ran(e){var t,n;t=u(K(e,(et(),cl)),10),t&&(n=t.c,Au(n.a,t),n.a.c.length==0&&Au(Ya(t).b,n))}function knt(e){return V1?Me(V0t,Eht,572,0,0,1):u(j1(e.a,Me(V0t,Eht,572,e.a.c.length,0,1)),842)}function ian(e,t,n,r){return Uj(),new Qee(ie(re(Cb,1),Sz,42,0,[(cse(e,t),new vv(e,t)),(cse(n,r),new vv(n,r))]))}function Z3(e,t,n){var r,s;return s=(r=new Uee,r),Co(s,t,n),Br((!e.q&&(e.q=new at(nf,e,11,10)),e.q),s),s}function mie(e){var t,n,r,s;for(s=MUt(V3t,e),n=s.length,r=Me(mt,Qe,2,n,6,1),t=0;t=e.b.c.length||(wye(e,2*t+1),n=2*t+2,n=0&&e[r]===t[r];r--);return r<0?0:fte(qs(e[r],yo),qs(t[r],yo))?-1:1}function san(e,t){var n,r;for(r=ii(e,0);r.b!=r.d.c;)n=u(ri(r),214),n.e.length>0&&(t.td(n),n.i&&Jan(n))}function kie(e,t){var n,r;return r=u(_n(e.a,4),126),n=Me(kfe,Xce,415,t,0,1),r!=null&&Hc(r,0,n,0,r.length),n}function Ent(e,t){var n;return n=new Zse((e.f&256)!=0,e.i,e.a,e.d,(e.f&16)!=0,e.j,e.g,t),e.e!=null||(n.c=e),n}function aan(e,t){var n,r;for(r=e.Zb().Cc().Kc();r.Ob();)if(n=u(r.Pb(),14),n.Hc(t))return!0;return!1}function xie(e,t,n,r,s){var o,h;for(h=n;h<=s;h++)for(o=t;o<=r;o++)if(i4(e,o,h))return!0;return!1}function Tnt(e,t,n){var r,s,o,h;for(Sn(n),h=!1,o=e.Zc(t),s=n.Kc();s.Ob();)r=s.Pb(),o.Rb(r),h=!0;return h}function oan(e,t){var n;return e===t?!0:we(t,83)?(n=u(t,83),y4e(Cv(e),n.vc())):!1}function _nt(e,t,n){var r,s;for(s=n.Kc();s.Ob();)if(r=u(s.Pb(),42),e.re(t,r.dd()))return!0;return!1}function Cnt(e,t,n){return e.d[t.p][n.p]||(run(e,t,n),e.d[t.p][n.p]=!0,e.d[n.p][t.p]=!0),e.a[t.p][n.p]}function K8(e,t){if(!e.ai()&&t==null)throw J(new Ln("The 'no null' constraint is violated"));return t}function Y8(e,t){e.D==null&&e.B!=null&&(e.D=e.B,e.B=null),eie(e,t==null?null:(Sn(t),t)),e.C&&e.yk(null)}function can(e,t){var n;return!e||e==t||!ta(t,(et(),xw))?!1:(n=u(K(t,(et(),xw)),10),n!=e)}function Eie(e){switch(e.i){case 2:return!0;case 1:return!1;case-1:++e.c;default:return e.pl()}}function Snt(e){switch(e.i){case-2:return!0;case-1:return!1;case 1:--e.c;default:return e.ql()}}function Ant(e){pXe.call(this,"The given string does not match the expected format for individual spacings.",e)}function Pl(){Pl=pe,nh=new WF("ELK",0),mAe=new WF("JSON",1),wAe=new WF("DOT",2),yAe=new WF("SVG",3)}function RD(){RD=pe,yV=new Nte(U0,0),J_e=new Nte("RADIAL_COMPACTION",1),eCe=new Nte("WEDGE_COMPACTION",2)}function F1(){F1=pe,g7e=new dte("CONCURRENT",0),Ql=new dte("IDENTITY_FINISH",1),xy=new dte("UNORDERED",2)}function Tie(){Tie=pe,G7e=(EF(),Pue),z7e=new dn(F6e,G7e),Ggt=new Zi(j6e),qgt=new Zi($6e),Vgt=new Zi(H6e)}function X8(){X8=pe,n9e=new z5,r9e=new $Y,r2t=new SL,n2t=new HY,t2t=new zY,t9e=(Sn(t2t),new cn)}function Q8(){Q8=pe,ghe=new Lte("CONSERVATIVE",0),C_e=new Lte("CONSERVATIVE_SOFT",1),kS=new Lte("SLOPPY",2)}function hH(){hH=pe,oAe=new kv(15),v3t=new fo((bi(),Fb),oAe),FS=Rk,rAe=e3t,iAe=Rb,aAe=e5,sAe=NV}function _ie(e,t,n){var r,s,o;for(r=new as,o=ii(n,0);o.b!=o.d.c;)s=u(ri(o),8),ci(r,new Io(s));Tnt(e,t,r)}function uan(e){var t,n,r;for(t=0,r=Me(na,Qe,8,e.b,0,1),n=ii(e,0);n.b!=n.d.c;)r[t++]=u(ri(n),8);return r}function yye(e){var t;return t=(!e.a&&(e.a=new at(J0,e,9,5)),e.a),t.i!=0?SUt(u(Te(t,0),678)):null}function lan(e,t){var n;return n=Ua(e,t),fte(vre(e,t),0)|GUt(vre(e,n),0)?n:Ua(Cz,vre(Nm(n,63),1))}function han(e,t){var n;n=xt((zie(),nV))!=null&&t.wg()!=null?Ue(ft(t.wg()))/Ue(ft(xt(nV))):1,Si(e.b,t,n)}function fan(e,t){var n,r;return n=u(e.d.Bc(t),14),n?(r=e.e.hc(),r.Gc(n),e.e.d-=n.gc(),n.$b(),r):null}function kye(e,t){var n,r;if(r=e.c[t],r!=0)for(e.c[t]=0,e.d-=r,n=t+1;n0)return d8(t-1,e.a.c.length),Eg(e.a,t-1);throw J(new J$e)}function dan(e,t,n){if(t<0)throw J(new Do(Zft+t));tt)throw J(new Ln(Dz+e+Tht+t));if(e<0||t>n)throw J(new Ppe(Dz+e+_6e+t+E6e+n))}function Dnt(e){if(!e.a||!(e.a.i&8))throw J(new Wo("Enumeration class expected for layout option "+e.f))}function Km(e){var t;++e.j,e.i==0?e.g=null:e.iaG?e-n>aG:n-e>aG}function Sie(e,t){return!e||t&&!e.j||we(e,124)&&u(e,124).a.b==0?0:e.Re()}function dH(e,t){return!e||t&&!e.k||we(e,124)&&u(e,124).a.a==0?0:e.Se()}function FD(e){return Qp(),e<0?e!=-1?new b3e(-1,-e):Eue:e<=10?n7e[_s(e)]:new b3e(1,e)}function Eye(e){throw fie(),J(new UHe("Unexpected typeof result '"+e+"'; please report this bug to the GWT team"))}function Bnt(e){ZHe(),ij(this),Qj(this),this.e=e,Yot(this,e),this.g=e==null?Pu:Qo(e),this.a="",this.b=e,this.a=""}function Tye(){this.a=new aZ,this.f=new Hje(this),this.b=new zje(this),this.i=new Gje(this),this.e=new qje(this)}function Rnt(){xVt.call(this,new ome(qm(16))),ql(2,sht),this.b=2,this.a=new awe(null,null,0,null),oM(this.a,this.a)}function j_(){j_=pe,ihe=new _te("DUMMY_NODE_OVER",0),l_e=new _te("DUMMY_NODE_UNDER",1),iV=new _te("EQUAL",2)}function Aie(){Aie=pe,Wue=vXe(ie(re(RS,1),tt,103,0,[(wo(),Xh),Df])),Kue=vXe(ie(re(RS,1),tt,103,0,[X0,Y0]))}function Lie(e){return(ht(),Ru).Hc(e.j)?Ue(ft(K(e,(et(),hE)))):sc(ie(re(na,1),Qe,8,0,[e.i.n,e.n,e.a])).b}function wan(e){var t,n,r,s;for(r=e.b.a,n=r.a.ec().Kc();n.Ob();)t=u(n.Pb(),561),s=new Lot(t,e.e,e.f),it(e.g,s)}function cb(e,t){var n,r,s;r=e.nk(t,null),s=null,t&&(s=(Qx(),n=new uv,n),I8(s,e.r)),r=$1(e,s,r),r&&r.Fi()}function man(e,t){var n,r;for(r=vl(e.d,1)!=0,n=!0;n;)n=!1,n=t.c.Tf(t.e,r),n=n|gI(e,t,r,!1),r=!r;zme(e)}function _ye(e,t){var n,r,s;return r=!1,n=t.q.d,t.ds&&(ust(t.q,s),r=n!=t.q.d)),r}function Fnt(e,t){var n,r,s,o,h,d,v,x;return v=t.i,x=t.j,r=e.f,s=r.i,o=r.j,h=v-s,d=x-o,n=b.Math.sqrt(h*h+d*d),n}function Cye(e,t){var n,r;return r=SH(e),r||(n=(kae(),lat(t)),r=new q$e(n),Br(r.Vk(),e)),r}function jD(e,t){var n,r;return n=u(e.c.Bc(t),14),n?(r=e.hc(),r.Gc(n),e.d-=n.gc(),n.$b(),e.mc(r)):e.jc()}function jnt(e,t){var n;for(n=0;n=e.c.b:e.a<=e.c.b))throw J(new xc);return t=e.a,e.a+=e.c.c,++e.b,ct(t)}function xan(e){var t;return t=new vet(e),sD(e.a,$pt,new Al(ie(re(dO,1),yt,369,0,[t]))),t.d&&it(t.f,t.d),t.f}function Mie(e){var t;return t=new W2e(e.a),Ho(t,e),Ye(t,(et(),Mi),e),t.o.a=e.g,t.o.b=e.f,t.n.a=e.i,t.n.b=e.j,t}function Ean(e,t,n,r){var s,o;for(o=e.Kc();o.Ob();)s=u(o.Pb(),70),s.n.a=t.a+(r.a-s.o.a)/2,s.n.b=t.b,t.b+=s.o.b+n}function Tan(e,t,n){var r,s;for(s=t.a.a.ec().Kc();s.Ob();)if(r=u(s.Pb(),57),XYe(e,r,n))return!0;return!1}function _an(e){var t,n;for(n=new C(e.r);n.a=0?t:-t;r>0;)r%2==0?(n*=n,r=r/2|0):(s*=n,r-=1);return t<0?1/s:s}function Lan(e,t){var n,r,s;for(s=1,n=e,r=t>=0?t:-t;r>0;)r%2==0?(n*=n,r=r/2|0):(s*=n,r-=1);return t<0?1/s:s}function Unt(e){var t,n;if(e!=null)for(n=0;n0&&(n=u(St(e.a,e.a.c.length-1),570),vye(n,t))||it(e.a,new EZe(t))}function Nan(e){mf();var t,n;t=e.d.c-e.e.c,n=u(e.g,145),Mu(n.b,new pT(t)),Mu(n.c,new $2(t)),Da(n.i,new QR(t))}function Xnt(e){var t;return t=new Tp,t.a+="VerticalSegment ",Ec(t,e.e),t.a+=" ",Yr(t,rbe(new ste,new C(e.k))),t.a}function Pan(e){var t;return t=u(Fv(e.c.c,""),229),t||(t=new R6(Xx(Yx(new hm,""),"Other")),hb(e.c.c,"",t)),t}function $_(e){var t;return e.Db&64?_f(e):(t=new Ph(_f(e)),t.a+=" (name: ",To(t,e.zb),t.a+=")",t.a)}function Dye(e,t,n){var r,s;return s=e.sb,e.sb=t,e.Db&4&&!(e.Db&1)&&(r=new oa(e,1,4,s,t),n?n.Ei(r):n=r),n}function Die(e,t){var n,r,s;for(n=0,s=ac(e,t).Kc();s.Ob();)r=u(s.Pb(),11),n+=K(r,(et(),cl))!=null?1:0;return n}function e4(e,t,n){var r,s,o;for(r=0,o=ii(e,0);o.b!=o.d.c&&(s=Ue(ft(ri(o))),!(s>n));)s>=t&&++r;return r}function Ban(e,t,n){var r,s;return r=new N0(e.e,3,13,null,(s=t.c,s||(on(),Z1)),Dg(e,t),!1),n?n.Ei(r):n=r,n}function Ran(e,t,n){var r,s;return r=new N0(e.e,4,13,(s=t.c,s||(on(),Z1)),null,Dg(e,t),!1),n?n.Ei(r):n=r,n}function Iye(e,t,n){var r,s;return s=e.r,e.r=t,e.Db&4&&!(e.Db&1)&&(r=new oa(e,1,8,s,e.r),n?n.Ei(r):n=r),n}function Ag(e,t){var n,r;return n=u(t,676),r=n.vk(),!r&&n.wk(r=we(t,88)?new qqe(e,u(t,26)):new hQe(e,u(t,148))),r}function $D(e,t,n){var r;e.qi(e.i+1),r=e.oi(t,n),t!=e.i&&Hc(e.g,t,e.g,t+1,e.i-t),cs(e.g,t,r),++e.i,e.bi(t,n),e.ci()}function Fan(e,t){var n;return t.a&&(n=t.a.a.length,e.a?Yr(e.a,e.b):e.a=new Fl(e.d),dQe(e.a,t.a,t.d.length,n)),e}function jan(e,t){var n,r,s,o;if(t.vi(e.a),o=u(_n(e.a,8),1936),o!=null)for(n=o,r=0,s=n.length;rn)throw J(new Do(Dz+e+_6e+t+", size: "+n));if(e>t)throw J(new Ln(Dz+e+Tht+t))}function wh(e,t,n){if(t<0)P4e(e,n);else{if(!n.Ij())throw J(new Ln(i2+n.ne()+RC));u(n,66).Nj().Vj(e,e.yh(),t)}}function zan(e,t,n,r,s,o,h,d){var v;for(v=n;o=r||t=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e>=48&&e<=57?e-48:0}function rrt(e){var t;return e.Db&64?_f(e):(t=new Ph(_f(e)),t.a+=" (source: ",To(t,e.d),t.a+=")",t.a)}function qan(e,t,n){var r,s;return s=e.a,e.a=t,e.Db&4&&!(e.Db&1)&&(r=new oa(e,1,5,s,e.a),n?t4e(n,r):n=r),n}function Lg(e,t){var n;n=(e.Bb&256)!=0,t?e.Bb|=256:e.Bb&=-257,e.Db&4&&!(e.Db&1)&&_i(e,new xf(e,1,2,n,t))}function Nye(e,t){var n;n=(e.Bb&256)!=0,t?e.Bb|=256:e.Bb&=-257,e.Db&4&&!(e.Db&1)&&_i(e,new xf(e,1,8,n,t))}function bH(e,t){var n;n=(e.Bb&256)!=0,t?e.Bb|=256:e.Bb&=-257,e.Db&4&&!(e.Db&1)&&_i(e,new xf(e,1,8,n,t))}function Mg(e,t){var n;n=(e.Bb&512)!=0,t?e.Bb|=512:e.Bb&=-513,e.Db&4&&!(e.Db&1)&&_i(e,new xf(e,1,3,n,t))}function Pye(e,t){var n;n=(e.Bb&512)!=0,t?e.Bb|=512:e.Bb&=-513,e.Db&4&&!(e.Db&1)&&_i(e,new xf(e,1,9,n,t))}function z_(e,t){var n;return e.b==-1&&e.a&&(n=e.a.Gj(),e.b=n?e.c.Xg(e.a.aj(),n):Ji(e.c.Tg(),e.a)),e.c.Og(e.b,t)}function ct(e){var t,n;return e>-129&&e<128?(t=e+128,n=(JWe(),G8e)[t],!n&&(n=G8e[t]=new rM(e)),n):new rM(e)}function Z8(e){var t,n;return e>-129&&e<128?(t=e+128,n=(sKe(),W8e)[t],!n&&(n=W8e[t]=new XR(e)),n):new XR(e)}function Bye(e){var t,n;return t=e.k,t==(zn(),Ls)?(n=u(K(e,(et(),vc)),61),n==(ht(),An)||n==xr):!1}function Van(e,t,n){var r,s,o;return o=(s=p7(e.b,t),s),o&&(r=u(wz(wD(e,o),""),26),r)?n5e(e,r,t,n):null}function Iie(e,t,n){var r,s,o;return o=(s=p7(e.b,t),s),o&&(r=u(wz(wD(e,o),""),26),r)?r5e(e,r,t,n):null}function irt(e,t){var n,r;for(r=new rr(e);r.e!=r.i.gc();)if(n=u(pr(r),138),je(t)===je(n))return!0;return!1}function G_(e,t,n){var r;if(r=e.gc(),t>r)throw J(new Im(t,r));if(e.hi()&&e.Hc(n))throw J(new Ln(YI));e.Xh(t,n)}function Uan(e,t){var n;if(n=K3(e.i,t),n==null)throw J(new dd("Node did not exist in input."));return Wme(t,n),null}function Wan(e,t){var n;if(n=dI(e,t),we(n,322))return u(n,34);throw J(new Ln(i2+t+"' is not a valid attribute"))}function Kan(e,t,n){var r,s;for(s=we(t,99)&&u(t,18).Bb&so?new Gte(t,e):new G8(t,e),r=0;rt?1:e==t?e==0?Fs(1/e,1/t):0:isNaN(e)?isNaN(t)?0:1:-1}function ron(e,t){kr(t,"Sort end labels",1),ms(Vi(ic(new vn(null,new mn(e.b,16)),new UP),new F5),new bY),ur(t)}function q_(e,t,n){var r,s;return e.ej()?(s=e.fj(),r=jse(e,t,n),e.$i(e.Zi(7,ct(n),r,t,s)),r):jse(e,t,n)}function Oie(e,t){var n,r,s;e.d==null?(++e.e,--e.f):(s=t.cd(),n=t.Sh(),r=(n&Ei)%e.d.length,$nn(e,r,xot(e,r,n,s)))}function J8(e,t){var n;n=(e.Bb&Sf)!=0,t?e.Bb|=Sf:e.Bb&=-1025,e.Db&4&&!(e.Db&1)&&_i(e,new xf(e,1,10,n,t))}function e7(e,t){var n;n=(e.Bb&dy)!=0,t?e.Bb|=dy:e.Bb&=-4097,e.Db&4&&!(e.Db&1)&&_i(e,new xf(e,1,12,n,t))}function t7(e,t){var n;n=(e.Bb&Zu)!=0,t?e.Bb|=Zu:e.Bb&=-8193,e.Db&4&&!(e.Db&1)&&_i(e,new xf(e,1,15,n,t))}function n7(e,t){var n;n=(e.Bb&ky)!=0,t?e.Bb|=ky:e.Bb&=-2049,e.Db&4&&!(e.Db&1)&&_i(e,new xf(e,1,11,n,t))}function ion(e,t){var n;return n=Fs(e.b.c,t.b.c),n!=0||(n=Fs(e.a.a,t.a.a),n!=0)?n:Fs(e.a.b,t.a.b)}function son(e,t){var n;if(n=er(e.k,t),n==null)throw J(new dd("Port did not exist in input."));return Wme(t,n),null}function aon(e){var t,n;for(n=Sot(Gl(e)).Kc();n.Ob();)if(t=Hr(n.Pb()),uC(e,t))return gnn((NGe(),r4t),t);return null}function oon(e,t){var n,r,s,o,h;for(h=pu(e.e.Tg(),t),o=0,n=u(e.g,119),s=0;s>10)+II&Ss,t[1]=(e&1023)+56320&Ss,jh(t,0,t.length)}function wH(e){var t,n;return n=u(K(e,(pt(),Zl)),103),n==(wo(),f0)?(t=Ue(ft(K(e,Hq))),t>=1?Df:Y0):n}function lon(e){switch(u(K(e,(pt(),K0)),218).g){case 1:return new BX;case 3:return new HX;default:return new PX}}function ub(e){if(e.c)ub(e.c);else if(e.d)throw J(new Wo("Stream already terminated, can't be modified or used"))}function Bie(e){var t;return e.Db&64?_f(e):(t=new Ph(_f(e)),t.a+=" (identifier: ",To(t,e.k),t.a+=")",t.a)}function crt(e,t,n){var r,s;return r=(pv(),s=new pp,s),z$(r,t),G$(r,n),e&&Br((!e.a&&(e.a=new Bs(ef,e,5)),e.a),r),r}function Rie(e,t,n,r){var s,o;return Sn(r),Sn(n),s=e.xc(t),o=s==null?n:kGe(u(s,15),u(n,14)),o==null?e.Bc(t):e.zc(t,o),o}function rn(e){var t,n,r,s;return n=(t=u(Qf((r=e.gm,s=r.f,s==Wr?r:s)),9),new hh(t,u(wf(t,t.length),9),0)),Tf(n,e),n}function hon(e,t,n){var r,s;for(s=e.a.ec().Kc();s.Ob();)if(r=u(s.Pb(),10),MD(n,u(St(t,r.p),14)))return r;return null}function fon(e,t,n){var r;try{Usn(e,t,n)}catch(s){throw s=ts(s),we(s,597)?(r=s,J(new qwe(r))):J(s)}return t}function Wp(e,t){var n;return Ko(e)&&Ko(t)&&(n=e-t,DI>1,e.k=n-1>>1}function Fie(){o4e();var e,t,n;n=c3n+++Date.now(),e=_s(b.Math.floor(n*NI))&Mz,t=_s(n-e*x6e),this.a=e^1502,this.b=t^uoe}function j0(e){var t,n,r;for(t=new st,r=new C(e.j);r.a34028234663852886e22?gs:t<-34028234663852886e22?Ds:t}function urt(e){return e-=e>>1&1431655765,e=(e>>2&858993459)+(e&858993459),e=(e>>4)+e&252645135,e+=e>>8,e+=e>>16,e&63}function lrt(e){var t,n,r,s;for(t=new zUe(e.Hd().gc()),s=0,r=q6(e.Hd().Kc());r.Ob();)n=r.Pb(),Sen(t,n,ct(s++));return Zfn(t.a)}function won(e,t){var n,r,s;for(s=new Mr,r=t.vc().Kc();r.Ob();)n=u(r.Pb(),42),Si(s,n.cd(),usn(e,u(n.dd(),15)));return s}function zye(e,t){e.n.c.length==0&&it(e.n,new o$(e.s,e.t,e.i)),it(e.b,t),T3e(u(St(e.n,e.n.c.length-1),211),t),yut(e,t)}function t4(e){return(e.c!=e.b.b||e.i!=e.g.b)&&(e.a.c=Me(Yn,yt,1,0,5,1),Rs(e.a,e.b),Rs(e.a,e.g),e.c=e.b.b,e.i=e.g.b),e.a}function jie(e,t){var n,r,s;for(s=0,r=u(t.Kb(e),20).Kc();r.Ob();)n=u(r.Pb(),17),It(Mt(K(n,(et(),W1))))||++s;return s}function mon(e,t){var n,r,s;r=U3(t),s=Ue(ft(Qm(r,(pt(),Mf)))),n=b.Math.max(0,s/2-.5),Z_(t,n,1),it(e,new eqe(t,n))}function mh(){mh=pe,TO=new TM(U0,0),lS=new TM("FIRST",1),l2=new TM(wft,2),hS=new TM("LAST",3),Ly=new TM(mft,4)}function $0(){$0=pe,hfe=new GF(EC,0),YO=new GF("POLYLINE",1),_E=new GF("ORTHOGONAL",2),jk=new GF("SPLINES",3)}function mH(){mH=pe,wCe=new Bte("ASPECT_RATIO_DRIVEN",0),Rhe=new Bte("MAX_SCALE_DRIVEN",1),vCe=new Bte("AREA_DRIVEN",2)}function GD(){GD=pe,EV=new Rte("P1_STRUCTURE",0),TV=new Rte("P2_PROCESSING_ORDER",1),_V=new Rte("P3_EXECUTION",2)}function yH(){yH=pe,Dhe=new Ote("OVERLAP_REMOVAL",0),Lhe=new Ote("COMPACTION",1),Mhe=new Ote("GRAPH_SIZE_CALCULATION",2)}function Kv(e,t){return S1(),Ef(Jp),b.Math.abs(e-t)<=Jp||e==t||isNaN(e)&&isNaN(t)?0:et?1:yv(isNaN(e),isNaN(t))}function hrt(e,t){var n,r;for(n=ii(e,0);n.b!=n.d.c;){if(r=uM(ft(ri(n))),r==t)return;if(r>t){mre(n);break}}YM(n,t)}function en(e,t){var n,r,s,o,h;if(n=t.f,hb(e.c.d,n,t),t.g!=null)for(s=t.g,o=0,h=s.length;ot&&r.ue(e[o-1],e[o])>0;--o)h=e[o],cs(e,o,e[o-1]),cs(e,o-1,h)}function yh(e,t,n,r){if(t<0)o5e(e,n,r);else{if(!n.Ij())throw J(new Ln(i2+n.ne()+RC));u(n,66).Nj().Tj(e,e.yh(),t,r)}}function kH(e,t){if(t==e.d)return e.e;if(t==e.e)return e.d;throw J(new Ln("Node "+t+" not part of edge "+e))}function kon(e,t){switch(t.g){case 2:return e.b;case 1:return e.c;case 4:return e.d;case 3:return e.a;default:return!1}}function frt(e,t){switch(t.g){case 2:return e.b;case 1:return e.c;case 4:return e.d;case 3:return e.a;default:return!1}}function Gye(e,t,n,r){switch(t){case 3:return e.f;case 4:return e.g;case 5:return e.i;case 6:return e.j}return Oye(e,t,n,r)}function xon(e){return e.k!=(zn(),Hs)?!1:_8(new vn(null,new Sv(new cr(fr(js(e).a.Kc(),new V)))),new TB)}function Eon(e){return e.e==null?e:(!e.c&&(e.c=new Zse((e.f&256)!=0,e.i,e.a,e.d,(e.f&16)!=0,e.j,e.g,null)),e.c)}function Ton(e,t){return e.h==MI&&e.m==0&&e.l==0?(t&&(s2=fu(0,0,0)),hVe((D8(),R8e))):(t&&(s2=fu(e.l,e.m,e.h)),fu(0,0,0))}function Qo(e){var t;return Array.isArray(e)&&e.im===gt?Cp(pl(e))+"@"+(t=Xi(e)>>>0,t.toString(16)):e.toString()}function V_(e){var t;this.a=(t=u(e.e&&e.e(),9),new hh(t,u(wf(t,t.length),9),0)),this.b=Me(Yn,yt,1,this.a.a.length,5,1)}function _on(e){var t,n,r;for(this.a=new C0,r=new C(e);r.a0&&(zr(t-1,e.length),e.charCodeAt(t-1)==58)&&!$ie(e,KS,YS))}function $ie(e,t,n){var r,s;for(r=0,s=e.length;r=s)return t.c+n;return t.c+t.b.gc()}function Mon(e,t){u8();var n,r,s,o;for(r=TJe(e),s=t,L8(r,0,r.length,s),n=0;n0&&(r+=s,++n);return n>1&&(r+=e.d*(n-1)),r}function Vye(e){var t,n,r;for(r=new bg,r.a+="[",t=0,n=e.gc();t0&&this.b>0&&Cve(this.c,this.b,this.a)}function Kye(e){zie(),this.c=O1(ie(re(C3n,1),yt,831,0,[Kvt])),this.b=new Mr,this.a=e,Si(this.b,nV,1),Mu(Yvt,new Jje(this))}function drt(e,t){var n;return e.d?Il(e.b,t)?u(er(e.b,t),51):(n=t.Kf(),Si(e.b,t,n),n):t.Kf()}function Yye(e,t){var n;return je(e)===je(t)?!0:we(t,91)?(n=u(t,91),e.e==n.e&&e.d==n.d&&bnn(e,n.a)):!1}function Y6(e){switch(ht(),e.g){case 4:return An;case 1:return $n;case 3:return xr;case 2:return Dn;default:return uc}}function Xye(e,t){switch(t){case 3:return e.f!=0;case 4:return e.g!=0;case 5:return e.i!=0;case 6:return e.j!=0}return Yme(e,t)}function Bon(e){switch(e.g){case 0:return new nZ;case 1:return new FB;default:throw J(new Ln(wce+(e.f!=null?e.f:""+e.g)))}}function grt(e){switch(e.g){case 0:return new RB;case 1:return new jB;default:throw J(new Ln(Noe+(e.f!=null?e.f:""+e.g)))}}function prt(e){switch(e.g){case 0:return new Ape;case 1:return new THe;default:throw J(new Ln(lG+(e.f!=null?e.f:""+e.g)))}}function Ron(e){switch(e.g){case 1:return new QQ;case 2:return new MUe;default:throw J(new Ln(wce+(e.f!=null?e.f:""+e.g)))}}function Fon(e){var t,n;if(e.b)return e.b;for(n=V1?null:e.d;n;){if(t=V1?null:n.b,t)return t;n=V1?null:n.d}return n8(),d7e}function jon(e){var t,n,r;return e.e==0?0:(t=e.d<<5,n=e.a[e.d-1],e.e<0&&(r=_tt(e),r==e.d-1&&(--n,n=n|0)),t-=uI(n),t)}function $on(e){var t,n,r;return e<$G.length?$G[e]:(n=e>>5,t=e&31,r=Me(Lr,Jr,25,n+1,15,1),r[n]=1<3;)s*=10,--o;e=(e+(s>>1))/s|0}return r.i=e,!0}function zon(e){return Aie(),Mn(),!!(frt(u(e.a,81).j,u(e.b,103))||u(e.a,81).d.e!=0&&frt(u(e.a,81).j,u(e.b,103)))}function Gon(e){A$(),u(e.We((bi(),p2)),174).Hc((wl(),zV))&&(u(e.We(Hy),174).Fc((ol(),$k)),u(e.We(p2),174).Mc(zV))}function vrt(e,t){var n,r;if(t){for(n=0;n=0;--r)for(t=n[r],s=0;s>1,this.k=t-1>>1}function Yon(e,t){kr(t,"End label post-processing",1),ms(Vi(ic(new vn(null,new mn(e.b,16)),new lY),new hY),new fY),ur(t)}function Xon(e,t,n){var r,s;return r=Ue(e.p[t.i.p])+Ue(e.d[t.i.p])+t.n.b+t.a.b,s=Ue(e.p[n.i.p])+Ue(e.d[n.i.p])+n.n.b+n.a.b,s-r}function Qon(e,t,n){var r,s;for(r=qs(n,yo),s=0;Mc(r,0)!=0&&s0&&(zr(0,t.length),t.charCodeAt(0)==43)?t.substr(1):t))}function Jon(e){var t;return e==null?null:new Ip((t=Xc(e,!0),t.length>0&&(zr(0,t.length),t.charCodeAt(0)==43)?t.substr(1):t))}function r3e(e,t){var n;return e.i>0&&(t.lengthe.i&&cs(t,e.i,null),t}function ou(e,t,n){var r,s,o;return e.ej()?(r=e.i,o=e.fj(),$D(e,r,t),s=e.Zi(3,null,t,r,o),n?n.Ei(s):n=s):$D(e,e.i,t),n}function ecn(e,t,n){var r,s;return r=new N0(e.e,4,10,(s=t.c,we(s,88)?u(s,26):(on(),sf)),null,Dg(e,t),!1),n?n.Ei(r):n=r,n}function tcn(e,t,n){var r,s;return r=new N0(e.e,3,10,null,(s=t.c,we(s,88)?u(s,26):(on(),sf)),Dg(e,t),!1),n?n.Ei(r):n=r,n}function yrt(e){Mm();var t;return t=new Io(u(e.e.We((bi(),e5)),8)),e.B.Hc((wl(),SE))&&(t.a<=0&&(t.a=20),t.b<=0&&(t.b=20)),t}function krt(e){Zm();var t;return(e.q?e.q:(hn(),hn(),l0))._b((pt(),_w))?t=u(K(e,_w),197):t=u(K(Ya(e),pS),197),t}function Qm(e,t){var n,r;return r=null,ta(e,(pt(),eV))&&(n=u(K(e,eV),94),n.Xe(t)&&(r=n.We(t))),r==null&&(r=K(Ya(e),t)),r}function xrt(e,t){var n,r,s;return we(t,42)?(n=u(t,42),r=n.cd(),s=Ym(e.Rc(),r),md(s,n.dd())&&(s!=null||e.Rc()._b(r))):!1}function qie(e,t){var n,r,s;return e.f>0?(e.qj(),r=t==null?0:Xi(t),s=(r&Ei)%e.d.length,n=xot(e,s,r,t),n!=-1):!1}function r1(e,t){var n,r,s;return e.f>0&&(e.qj(),r=t==null?0:Xi(t),s=(r&Ei)%e.d.length,n=H4e(e,s,r,t),n)?n.dd():null}function qD(e,t){var n,r,s,o;for(o=pu(e.e.Tg(),t),n=u(e.g,119),s=0;s1?I1(A0(t.a[1],32),qs(t.a[0],yo)):qs(t.a[0],yo),Bv(ja(t.e,n))))}function VD(e,t){var n;return Ko(e)&&Ko(t)&&(n=e%t,DI>5,t&=31,s=e.d+n+(t==0?0:1),r=Me(Lr,Jr,25,s,15,1),nfn(r,e.a,n,t),o=new z3(e.e,s,r),E_(o),o}function s3e(e,t,n){var r,s;r=u(Uc(ME,t),117),s=u(Uc(tA,t),117),n?(Oo(ME,e,r),Oo(tA,e,s)):(Oo(tA,e,r),Oo(ME,e,s))}function Lrt(e,t,n){var r,s,o;for(s=null,o=e.b;o;){if(r=e.a.ue(t,o.d),n&&r==0)return o;r>=0?o=o.a[1]:(s=o,o=o.a[0])}return s}function Mrt(e,t,n){var r,s,o;for(s=null,o=e.b;o;){if(r=e.a.ue(t,o.d),n&&r==0)return o;r<=0?o=o.a[0]:(s=o,o=o.a[1])}return s}function acn(e,t,n,r){var s,o,h;return s=!1,Hwn(e.f,n,r)&&(Dcn(e.f,e.a[t][n],e.a[t][r]),o=e.a[t],h=o[r],o[r]=o[n],o[n]=h,s=!0),s}function a3e(e,t,n,r,s){var o,h,d;for(h=s;t.b!=t.c;)o=u(I6(t),10),d=u(ac(o,r).Xb(0),11),e.d[d.p]=h++,n.c[n.c.length]=d;return h}function o3e(e,t,n){var r,s,o,h,d;return h=e.k,d=t.k,r=n[h.g][d.g],s=ft(Qm(e,r)),o=ft(Qm(t,r)),b.Math.max((Sn(s),s),(Sn(o),o))}function ocn(e,t,n){var r,s,o,h;for(r=n/e.c.length,s=0,h=new C(e);h.a2e3&&(S0t=e,RG=b.setTimeout(gUt,10))),BG++==0?(zrn((Ope(),N8e)),!0):!1}function ucn(e,t){var n,r,s;for(r=new cr(fr(js(e).a.Kc(),new V));Vr(r);)if(n=u(Pr(r),17),s=n.d.i,s.c==t)return!1;return!0}function c3e(e,t){var n,r;if(we(t,245)){r=u(t,245);try{return n=e.vd(r),n==0}catch(s){if(s=ts(s),!we(s,205))throw J(s)}}return!1}function lcn(){return Error.stackTraceLimit>0?(b.Error.stackTraceLimit=Error.stackTraceLimit=64,!0):"stack"in new Error}function hcn(e,t){return S1(),S1(),Ef(Jp),(b.Math.abs(e-t)<=Jp||e==t||isNaN(e)&&isNaN(t)?0:et?1:yv(isNaN(e),isNaN(t)))>0}function u3e(e,t){return S1(),S1(),Ef(Jp),(b.Math.abs(e-t)<=Jp||e==t||isNaN(e)&&isNaN(t)?0:et?1:yv(isNaN(e),isNaN(t)))<0}function Ort(e,t){return S1(),S1(),Ef(Jp),(b.Math.abs(e-t)<=Jp||e==t||isNaN(e)&&isNaN(t)?0:et?1:yv(isNaN(e),isNaN(t)))<=0}function Uie(e,t){for(var n=0;!t[n]||t[n]=="";)n++;for(var r=t[n++];nioe)return n.fh();if(r=n.Zg(),r||n==e)break}return r}function l3e(e){return u$(),we(e,156)?u(er(oN,j0t),288).vg(e):Il(oN,pl(e))?u(er(oN,pl(e)),288).vg(e):null}function dcn(e){if(AH(j7,e))return Mn(),U7;if(AH(Mce,e))return Mn(),Sb;throw J(new Ln("Expecting true or false"))}function gcn(e,t){if(t.c==e)return t.d;if(t.d==e)return t.c;throw J(new Ln("Input edge is not connected to the input port."))}function jrt(e,t){return e.e>t.e?1:e.et.d?e.e:e.d=48&&e<48+b.Math.min(10,10)?e-48:e>=97&&e<97?e-97+10:e>=65&&e<65?e-65+10:-1}function Hrt(e,t){var n;return je(t)===je(e)?!0:!we(t,21)||(n=u(t,21),n.gc()!=e.gc())?!1:e.Ic(n)}function pcn(e,t){var n,r,s,o;return r=e.a.length-1,n=t-e.b&r,o=e.c-t&r,s=e.c-e.b&r,pUe(n=o?(gan(e,t),-1):(pan(e,t),1)}function bcn(e,t){var n,r;for(n=(zr(t,e.length),e.charCodeAt(t)),r=t+1;rt.e?1:e.ft.f?1:Xi(e)-Xi(t)}function AH(e,t){return Sn(e),t==null?!1:an(e,t)?!0:e.length==t.length&&an(e.toLowerCase(),t.toLowerCase())}function _cn(e,t){var n,r,s,o;for(r=0,s=t.gc();r0&&Mc(e,128)<0?(t=Or(e)+128,n=(iKe(),q8e)[t],!n&&(n=q8e[t]=new wm(e)),n):new wm(e)}function Grt(e,t){var n,r;return n=t.Hh(e.a),n&&(r=Hr(r1((!n.b&&(n.b=new Ml((on(),oo),wc,n)),n.b),gi)),r!=null)?r:t.ne()}function Ccn(e,t){var n,r;return n=t.Hh(e.a),n&&(r=Hr(r1((!n.b&&(n.b=new Ml((on(),oo),wc,n)),n.b),gi)),r!=null)?r:t.ne()}function Scn(e,t){fre();var n,r;for(r=new cr(fr(j0(e).a.Kc(),new V));Vr(r);)if(n=u(Pr(r),17),n.d.i==t||n.c.i==t)return n;return null}function d3e(e,t,n){this.c=e,this.f=new st,this.e=new Fa,this.j=new xve,this.n=new xve,this.b=t,this.g=new fh(t.c,t.d,t.b,t.a),this.a=n}function Wie(e){var t,n,r,s;for(this.a=new C0,this.d=new Ys,this.e=0,n=e,r=0,s=n.length;r0):!1}function Urt(e){var t;je(Ft(e,(bi(),Q4)))===je((F0(),FV))&&(us(e)?(t=u(Ft(us(e),Q4),334),So(e,Q4,t)):So(e,Q4,jS))}function Dcn(e,t,n){var r,s;Ase(e.e,t,n,(ht(),Dn)),Ase(e.i,t,n,$n),e.a&&(s=u(K(t,(et(),Mi)),11),r=u(K(n,Mi),11),wre(e.g,s,r))}function Wrt(e,t,n){var r,s,o;r=t.c.p,o=t.p,e.b[r][o]=new cXe(e,t),n&&(e.a[r][o]=new qx(t),s=u(K(t,(et(),xw)),10),s&&sn(e.d,s,t))}function Krt(e,t){var n,r,s;if(it(QG,e),t.Fc(e),n=u(er(jue,e),21),n)for(s=n.Kc();s.Ob();)r=u(s.Pb(),33),Yo(QG,r,0)!=-1||Krt(r,t)}function Icn(e,t,n){var r;(U0t?(Fon(e),!0):W0t||Y0t?(n8(),!0):K0t&&(n8(),!1))&&(r=new yWe(t),r.b=n,Pfn(e,r))}function Kie(e,t){var n;n=!e.A.Hc((Bl(),Hb))||e.q==(wa(),tu),e.u.Hc((ol(),Z0))?n?eyn(e,t):Tlt(e,t):e.u.Hc(m2)&&(n?mmn(e,t):Flt(e,t))}function s7(e,t){var n,r;if(++e.j,t!=null&&(n=(r=e.a.Cb,we(r,97)?u(r,97).Jg():null),Sdn(t,n))){X6(e.a,4,n);return}X6(e.a,4,u(t,126))}function Yrt(e,t,n){return new fh(b.Math.min(e.a,t.a)-n/2,b.Math.min(e.b,t.b)-n/2,b.Math.abs(e.a-t.a)+n,b.Math.abs(e.b-t.b)+n)}function Ocn(e,t){var n,r;return n=Tu(e.a.c.p,t.a.c.p),n!=0?n:(r=Tu(e.a.d.i.p,t.a.d.i.p),r!=0?r:Tu(t.a.d.p,e.a.d.p))}function Ncn(e,t,n){var r,s,o,h;return o=t.j,h=n.j,o!=h?o.g-h.g:(r=e.f[t.p],s=e.f[n.p],r==0&&s==0?0:r==0?-1:s==0?1:Fs(r,s))}function Xrt(e,t,n){var r,s,o;if(!n[t.d])for(n[t.d]=!0,s=new C(t4(t));s.a=s)return s;for(t=t>0?t:0;tr&&cs(t,r,null),t}function Zrt(e,t){var n,r;for(r=e.a.length,t.lengthr&&cs(t,r,null),t}function hb(e,t,n){var r,s,o;return s=u(er(e.e,t),387),s?(o=Rbe(s,n),HVe(e,s),o):(r=new lve(e,t,n),Si(e.e,t,r),dXe(r),null)}function Rcn(e){var t;if(e==null)return null;if(t=D0n(Xc(e,!0)),t==null)throw J(new nte("Invalid hexBinary value: '"+e+"'"));return t}function WD(e){return Qp(),Mc(e,0)<0?Mc(e,-1)!=0?new Z3e(-1,M8(e)):Eue:Mc(e,10)<=0?n7e[Or(e)]:new Z3e(1,e)}function Xie(){return Tz(),ie(re(Ogt,1),tt,159,0,[Dgt,Mgt,Igt,xgt,kgt,Egt,Cgt,_gt,Tgt,Lgt,Agt,Sgt,mgt,wgt,ygt,bgt,pgt,vgt,dgt,fgt,ggt,Iue])}function Jrt(e){var t;this.d=new st,this.j=new Fa,this.g=new Fa,t=e.g.b,this.f=u(K(Ya(t),(pt(),Zl)),103),this.e=Ue(ft(DH(t,Ry)))}function eit(e){this.b=new st,this.e=new st,this.d=e,this.a=!LT(Vi(new vn(null,new Sv(new N1(e.b))),new Ke(new _B))).sd((G2(),X7))}function i1(){i1=pe,Fn=new SM("PARENTS",0),ua=new SM("NODES",1),Fd=new SM("EDGES",2),Bb=new SM("PORTS",3),Vg=new SM("LABELS",4)}function n4(){n4=pe,v2=new LM("DISTRIBUTED",0),ZO=new LM("JUSTIFIED",1),uAe=new LM("BEGIN",2),$S=new LM(D7,3),lAe=new LM("END",4)}function Fcn(e){var t;switch(t=e.yi(null),t){case 10:return 0;case 15:return 1;case 14:return 2;case 11:return 3;case 21:return 4}return-1}function Qie(e){switch(e.g){case 1:return wo(),X0;case 4:return wo(),Xh;case 2:return wo(),Df;case 3:return wo(),Y0}return wo(),f0}function jcn(e,t,n){var r;switch(r=n.q.getFullYear()-e2+e2,r<0&&(r=-r),t){case 1:e.a+=r;break;case 2:e0(e,r%100,2);break;default:e0(e,r,t)}}function ii(e,t){var n,r;if(jm(t,e.b),t>=e.b>>1)for(r=e.c,n=e.b;n>t;--n)r=r.b;else for(r=e.a.a,n=0;n=64&&t<128&&(s=I1(s,A0(1,t-64)));return s}function DH(e,t){var n,r;return r=null,ta(e,(bi(),Fk))&&(n=u(K(e,Fk),94),n.Xe(t)&&(r=n.We(t))),r==null&&Ya(e)&&(r=K(Ya(e),t)),r}function rit(e,t){var n,r,s;s=t.d.i,r=s.k,!(r==(zn(),Hs)||r==U1)&&(n=new cr(fr(js(s).a.Kc(),new V)),Vr(n)&&Si(e.k,t,u(Pr(n),17)))}function Zie(e,t){var n,r,s;return r=gn(e.Tg(),t),n=t-e.Ah(),n<0?(s=e.Yg(r),s>=0?e.lh(s):Fse(e,r)):n<0?Fse(e,r):u(r,66).Nj().Sj(e,e.yh(),n)}function xt(e){var t;if(we(e.a,4)){if(t=l3e(e.a),t==null)throw J(new Wo(e1t+e.b+"'. "+Jft+(S0(cN),cN.k)+qxe));return t}else return e.a}function zcn(e){var t;if(e==null)return null;if(t=cyn(Xc(e,!0)),t==null)throw J(new nte("Invalid base64Binary value: '"+e+"'"));return t}function pr(e){var t;try{return t=e.i.Xb(e.e),e.mj(),e.g=e.e++,t}catch(n){throw n=ts(n),we(n,73)?(e.mj(),J(new xc)):J(n)}}function Jie(e){var t;try{return t=e.c.ki(e.e),e.mj(),e.g=e.e++,t}catch(n){throw n=ts(n),we(n,73)?(e.mj(),J(new xc)):J(n)}}function K_(){K_=pe,U7e=(bi(),zSe),Rue=ySe,Ugt=Bk,V7e=Fb,Xgt=(GH(),T7e),Ygt=x7e,Qgt=C7e,Kgt=k7e,Wgt=(Tie(),z7e),Bue=Ggt,q7e=qgt,XG=Vgt}function IH(e){switch(Jpe(),this.c=new st,this.d=e,e.g){case 0:case 2:this.a=owe(lEe),this.b=gs;break;case 3:case 1:this.a=lEe,this.b=Ds}}function iit(e,t,n){var r,s;if(e.c)Du(e.c,e.c.i+t),Iu(e.c,e.c.j+n);else for(s=new C(e.b);s.a0&&(it(e.b,new BWe(t.a,n)),r=t.a.length,0r&&(t.a+=$Ve(Me(Sh,Td,25,-r,15,1))))}function sit(e,t){var n,r,s;for(n=e.o,s=u(u(Ii(e.r,t),21),84).Kc();s.Ob();)r=u(s.Pb(),111),r.e.a=Vun(r,n.a),r.e.b=n.b*Ue(ft(r.b.We(WG)))}function qcn(e,t){var n,r,s,o;return s=e.k,n=Ue(ft(K(e,(et(),Ew)))),o=t.k,r=Ue(ft(K(t,Ew))),o!=(zn(),Ls)?-1:s!=Ls?1:n==r?0:n=0?e.hh(t,n,r):(e.eh()&&(r=(s=e.Vg(),s>=0?e.Qg(r):e.eh().ih(e,-1-s,null,r))),e.Sg(t,n,r))}function p3e(e,t){switch(t){case 7:!e.e&&(e.e=new wn(ra,e,7,4)),_r(e.e);return;case 8:!e.d&&(e.d=new wn(ra,e,8,5)),_r(e.d);return}t3e(e,t)}function s1(e,t){var n;n=e.Zc(t);try{return n.Pb()}catch(r){throw r=ts(r),we(r,109)?J(new Do("Can't get element "+t)):J(r)}}function b3e(e,t){this.e=e,t=0&&(n.d=e.t);break;case 3:e.t>=0&&(n.a=e.t)}e.C&&(n.b=e.C.b,n.c=e.C.c)}function Z6(){Z6=pe,oO=new PF(Oz,0),aO=new PF(woe,1),cO=new PF(moe,2),uO=new PF(yoe,3),oO.a=!1,aO.a=!0,cO.a=!1,uO.a=!0}function Y_(){Y_=pe,lO=new NF(Oz,0),KG=new NF(woe,1),YG=new NF(moe,2),hO=new NF(yoe,3),lO.a=!1,KG.a=!0,YG.a=!1,hO.a=!0}function Ycn(e){var t;t=e.a;do t=u(Pr(new cr(fr(Xo(t).a.Kc(),new V))),17).c.i,t.k==(zn(),ca)&&e.b.Fc(t);while(t.k==(zn(),ca));e.b=nb(e.b)}function Xcn(e){var t,n,r;for(r=e.c.a,e.p=(Nr(r),new Uu(r)),n=new C(r);n.an.b)return!0}return!1}function ese(e,t){return fa(e)?!!y0t[t]:e.hm?!!e.hm[t]:Sm(e)?!!m0t[t]:Cm(e)?!!w0t[t]:!1}function So(e,t,n){return n==null?(!e.o&&(e.o=new Nl((cu(),k2),Dw,e,0)),CH(e.o,t)):(!e.o&&(e.o=new Nl((cu(),k2),Dw,e,0)),qH(e.o,t,n)),e}function eun(e,t,n,r){var s,o;o=t.Xe((bi(),J4))?u(t.We(J4),21):e.j,s=Gan(o),s!=(Tz(),Iue)&&(n&&!h3e(s)||k4e(I0n(e,s,r),t))}function NH(e,t,n,r){var s,o,h;return o=gn(e.Tg(),t),s=t-e.Ah(),s<0?(h=e.Yg(o),h>=0?e._g(h,n,!0):tw(e,o,n)):u(o,66).Nj().Pj(e,e.yh(),s,n,r)}function tun(e,t,n,r){var s,o,h;n.mh(t)&&(ho(),Ure(t)?(s=u(n.ah(t),153),_cn(e,s)):(o=(h=t,h?u(r,49).xh(h):null),o&&rVt(n.ah(t),o)))}function nun(e){switch(e.g){case 1:return Vv(),sO;case 3:return Vv(),iO;case 2:return Vv(),Nue;case 4:return Vv(),Oue;default:return null}}function v3e(e){switch(typeof e){case Mae:return Ig(e);case d6e:return _s(e);case sk:return Mn(),e?1231:1237;default:return e==null?0:xv(e)}}function run(e,t,n){if(e.e)switch(e.b){case 1:IJt(e.c,t,n);break;case 0:OJt(e.c,t,n)}else VQe(e.c,t,n);e.a[t.p][n.p]=e.c.i,e.a[n.p][t.p]=e.c.e}function lit(e){var t,n;if(e==null)return null;for(n=Me(h0,Qe,193,e.length,0,2),t=0;t=0)return s;if(e.Fk()){for(r=0;r=s)throw J(new Im(t,s));if(e.hi()&&(r=e.Xc(n),r>=0&&r!=t))throw J(new Ln(YI));return e.mi(t,n)}function w3e(e,t){if(this.a=u(Nr(e),245),this.b=u(Nr(t),245),e.vd(t)>0||e==(Xee(),fue)||t==(Yee(),due))throw J(new Ln("Invalid range: "+HQe(e,t)))}function hit(e){var t,n;for(this.b=new st,this.c=e,this.a=!1,n=new C(e.a);n.a0),(t&-t)==t)return _s(t*vl(e,31)*4656612873077393e-25);do n=vl(e,31),r=n%t;while(n-r+(t-1)<0);return _s(r)}function Ig(e){kWe();var t,n,r;return n=":"+e,r=qG[n],r!=null?_s((Sn(r),r)):(r=p7e[n],t=r==null?Ygn(e):_s((Sn(r),r)),TJt(),qG[n]=t,t)}function dit(e,t,n){kr(n,"Compound graph preprocessor",1),e.a=new Nv,mlt(e,t,null),Bvn(e,t),wgn(e),Ye(t,(et(),N9e),e.a),e.a=null,sl(e.b),ur(n)}function aun(e,t,n){switch(n.g){case 1:e.a=t.a/2,e.b=0;break;case 2:e.a=t.a,e.b=t.b/2;break;case 3:e.a=t.a/2,e.b=t.b;break;case 4:e.a=0,e.b=t.b/2}}function oun(e){var t,n,r;for(r=u(Ii(e.a,(c4(),Cq)),15).Kc();r.Ob();)n=u(r.Pb(),101),t=D3e(n),p8(e,n,t[0],(qv(),ww),0),p8(e,n,t[1],mw,1)}function cun(e){var t,n,r;for(r=u(Ii(e.a,(c4(),Sq)),15).Kc();r.Ob();)n=u(r.Pb(),101),t=D3e(n),p8(e,n,t[0],(qv(),ww),0),p8(e,n,t[1],mw,1)}function tse(e){switch(e.g){case 0:return null;case 1:return new dtt;case 2:return new Lpe;default:throw J(new Ln(wce+(e.f!=null?e.f:""+e.g)))}}function KD(e,t,n){var r,s;for(Msn(e,t-e.s,n-e.t),s=new C(e.n);s.a1&&(o=sun(e,t)),o}function nse(e){var t;return e.f&&e.f.kh()&&(t=u(e.f,49),e.f=u(Up(e,t),82),e.f!=t&&e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,9,8,t,e.f))),e.f}function rse(e){var t;return e.i&&e.i.kh()&&(t=u(e.i,49),e.i=u(Up(e,t),82),e.i!=t&&e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,9,7,t,e.i))),e.i}function go(e){var t;return e.b&&e.b.Db&64&&(t=e.b,e.b=u(Up(e,t),18),e.b!=t&&e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,9,21,t,e.b))),e.b}function RH(e,t){var n,r,s;e.d==null?(++e.e,++e.f):(r=t.Sh(),_gn(e,e.f+1),s=(r&Ei)%e.d.length,n=e.d[s],!n&&(n=e.d[s]=e.uj()),n.Fc(t),++e.f)}function k3e(e,t,n){var r;return t.Kj()?!1:t.Zj()!=-2?(r=t.zj(),r==null?n==null:Ci(r,n)):t.Hj()==e.e.Tg()&&n==null}function FH(){var e;ql(16,uht),e=itt(16),this.b=Me(pue,AI,317,e,0,1),this.c=Me(pue,AI,317,e,0,1),this.a=null,this.e=null,this.i=0,this.f=e-1,this.g=0}function H0(e){jbe.call(this),this.k=(zn(),Hs),this.j=(ql(6,fy),new su(6)),this.b=(ql(2,fy),new su(2)),this.d=new qee,this.f=new ype,this.a=e}function lun(e){var t,n;e.c.length<=1||(t=hct(e,(ht(),xr)),Jst(e,u(t.a,19).a,u(t.b,19).a),n=hct(e,Dn),Jst(e,u(n.a,19).a,u(n.b,19).a))}function X_(){X_=pe,f_e=new EM("SIMPLE",0),ohe=new EM(Boe,1),che=new EM("LINEAR_SEGMENTS",2),wS=new EM("BRANDES_KOEPF",3),mS=new EM(Pft,4)}function x3e(e,t,n){A6(u(K(t,(pt(),bs)),98))||(bme(e,t,Og(t,n)),bme(e,t,Og(t,(ht(),xr))),bme(e,t,Og(t,An)),hn(),aa(t.j,new sM(e)))}function git(e,t,n,r){var s,o,h;for(s=u(Ii(r?e.a:e.b,t),21),h=s.Kc();h.Ob();)if(o=u(h.Pb(),33),cz(e,n,o))return!0;return!1}function ise(e){var t,n;for(n=new rr(e);n.e!=n.i.gc();)if(t=u(pr(n),87),t.e||(!t.d&&(t.d=new Bs(Eo,t,1)),t.d).i!=0)return!0;return!1}function sse(e){var t,n;for(n=new rr(e);n.e!=n.i.gc();)if(t=u(pr(n),87),t.e||(!t.d&&(t.d=new Bs(Eo,t,1)),t.d).i!=0)return!0;return!1}function hun(e){var t,n,r;for(t=0,r=new C(e.c.a);r.a102?-1:e<=57?e-48:e<65?-1:e<=70?e-65+10:e<97?-1:e-97+10}function cse(e,t){if(e==null)throw J(new b6("null key in entry: null="+t));if(t==null)throw J(new b6("null value in entry: "+e+"=null"))}function fun(e,t){for(var n,r;e.Ob();)if(!t.Ob()||(n=e.Pb(),r=t.Pb(),!(je(n)===je(r)||n!=null&&Ci(n,r))))return!1;return!t.Ob()}function bit(e,t){var n;return n=ie(re(pa,1),Ao,25,15,[Sie(e.a[0],t),Sie(e.a[1],t),Sie(e.a[2],t)]),e.d&&(n[0]=b.Math.max(n[0],n[2]),n[2]=n[0]),n}function vit(e,t){var n;return n=ie(re(pa,1),Ao,25,15,[dH(e.a[0],t),dH(e.a[1],t),dH(e.a[2],t)]),e.d&&(n[0]=b.Math.max(n[0],n[2]),n[2]=n[0]),n}function db(){db=pe,ble=new xM("GREEDY",0),h9e=new xM(kft,1),vle=new xM(Boe,2),sS=new xM("MODEL_ORDER",3),iS=new xM("GREEDY_MODEL_ORDER",4)}function wit(e,t){var n,r,s;for(e.b[t.g]=1,r=ii(t.d,0);r.b!=r.d.c;)n=u(ri(r),188),s=n.c,e.b[s.g]==1?ci(e.a,n):e.b[s.g]==2?e.b[s.g]=1:wit(e,s)}function dun(e,t){var n,r,s;for(s=new su(t.gc()),r=t.Kc();r.Ob();)n=u(r.Pb(),286),n.c==n.f?f7(e,n,n.c):h1n(e,n)||(s.c[s.c.length]=n);return s}function gun(e,t,n){var r,s,o,h,d;for(d=e.r+t,e.r+=t,e.d+=n,r=n/e.n.c.length,s=0,h=new C(e.n);h.ao&&cs(t,o,null),t}function Aun(e,t){var n,r;if(r=e.gc(),t==null){for(n=0;n0&&(v+=s),x[_]=h,h+=d*(v+r)}function Cit(e){var t,n,r;for(r=e.f,e.n=Me(pa,Ao,25,r,15,1),e.d=Me(pa,Ao,25,r,15,1),t=0;t0?e.c:0),++s;e.b=r,e.d=o}function Pun(e,t){var n,r,s,o,h;for(r=0,s=0,n=0,h=new C(t);h.a0?e.g:0),++n;e.c=s,e.d=r}function Dit(e,t){var n;return n=ie(re(pa,1),Ao,25,15,[y3e(e,(n1(),pc),t),y3e(e,lu,t),y3e(e,bc,t)]),e.f&&(n[0]=b.Math.max(n[0],n[2]),n[2]=n[0]),n}function Bun(e,t,n){var r;try{hz(e,t+e.j,n+e.k,!1,!0)}catch(s){throw s=ts(s),we(s,73)?(r=s,J(new Do(r.g+Pz+t+io+n+")."))):J(s)}}function Run(e,t,n){var r;try{hz(e,t+e.j,n+e.k,!0,!1)}catch(s){throw s=ts(s),we(s,73)?(r=s,J(new Do(r.g+Pz+t+io+n+")."))):J(s)}}function Iit(e){var t;ta(e,(pt(),Tw))&&(t=u(K(e,Tw),21),t.Hc((sy(),If))?(t.Mc(If),t.Fc(Of)):t.Hc(Of)&&(t.Mc(Of),t.Fc(If)))}function Oit(e){var t;ta(e,(pt(),Tw))&&(t=u(K(e,Tw),21),t.Hc((sy(),Pf))?(t.Mc(Pf),t.Fc(Zh)):t.Hc(Zh)&&(t.Mc(Zh),t.Fc(Pf)))}function Fun(e,t,n){kr(n,"Self-Loop ordering",1),ms(Cu(Vi(Vi(ic(new vn(null,new mn(t.b,16)),new rB),new VY),new UY),new WY),new mm(e)),ur(n)}function XD(e,t,n,r){var s,o;for(s=t;s0&&(s.b+=t),s}function HH(e,t){var n,r,s;for(s=new Fa,r=e.Kc();r.Ob();)n=u(r.Pb(),37),cC(n,0,s.b),s.b+=n.f.b+t,s.a=b.Math.max(s.a,n.f.a);return s.a>0&&(s.a+=t),s}function Pit(e){var t,n,r;for(r=Ei,n=new C(e.a);n.a>16==6?e.Cb.ih(e,5,h1,t):(r=go(u(gn((n=u(_n(e,16),26),n||e.zh()),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function Gun(e){k8();var t=e.e;if(t&&t.stack){var n=t.stack,r=t+` -`;return n.substring(0,r.length)==r&&(n=n.substring(r.length)),n.split(` -`)}return[]}function qun(e){var t;return t=(Zet(),I0t),t[e>>>28]|t[e>>24&15]<<4|t[e>>20&15]<<8|t[e>>16&15]<<12|t[e>>12&15]<<16|t[e>>8&15]<<20|t[e>>4&15]<<24|t[e&15]<<28}function Fit(e){var t,n,r;e.b==e.c&&(r=e.a.length,n=cye(b.Math.max(8,r))<<1,e.b!=0?(t=wf(e.a,n),att(e,t,r),e.a=t,e.b=0):rHe(e.a,n),e.c=r)}function Vun(e,t){var n;return n=e.b,n.Xe((bi(),kl))?n.Hf()==(ht(),Dn)?-n.rf().a-Ue(ft(n.We(kl))):t+Ue(ft(n.We(kl))):n.Hf()==(ht(),Dn)?-n.rf().a:t}function QD(e){var t;return e.b.c.length!=0&&u(St(e.b,0),70).a?u(St(e.b,0),70).a:(t=ere(e),t??""+(e.c?Yo(e.c.a,e,0):-1))}function zH(e){var t;return e.f.c.length!=0&&u(St(e.f,0),70).a?u(St(e.f,0),70).a:(t=ere(e),t??""+(e.i?Yo(e.i.j,e,0):-1))}function Uun(e,t){var n,r;if(t<0||t>=e.gc())return null;for(n=t;n0?e.c:0),s=b.Math.max(s,t.d),++r;e.e=o,e.b=s}function Kun(e){var t,n;if(!e.b)for(e.b=p$(u(e.f,118).Ag().i),n=new rr(u(e.f,118).Ag());n.e!=n.i.gc();)t=u(pr(n),137),it(e.b,new tte(t));return e.b}function Yun(e,t){var n,r,s;if(t.dc())return u8(),u8(),uN;for(n=new jUe(e,t.gc()),s=new rr(e);s.e!=s.i.gc();)r=pr(s),t.Hc(r)&&Br(n,r);return n}function L3e(e,t,n,r){return t==0?r?(!e.o&&(e.o=new Nl((cu(),k2),Dw,e,0)),e.o):(!e.o&&(e.o=new Nl((cu(),k2),Dw,e,0)),hD(e.o)):NH(e,t,n,r)}function bse(e){var t,n;if(e.rb)for(t=0,n=e.rb.i;t>22),s+=r>>22,s<0)?!1:(e.l=n&ml,e.m=r&ml,e.h=s&V0,!0)}function Jun(e,t,n,r,s,o,h){var d,v;return!(t.Ae()&&(v=e.a.ue(n,r),v<0||!s&&v==0)||t.Be()&&(d=e.a.ue(n,o),d>0||!h&&d==0))}function eln(e,t){X8();var n;if(n=e.j.g-t.j.g,n!=0)return 0;switch(e.j.g){case 2:return jie(t,r9e)-jie(e,r9e);case 4:return jie(e,n9e)-jie(t,n9e)}return 0}function tln(e){switch(e.g){case 0:return mle;case 1:return yle;case 2:return kle;case 3:return xle;case 4:return Mq;case 5:return Ele;default:return null}}function Ro(e,t,n){var r,s;return r=(s=new Wee,cb(s,t),au(s,n),Br((!e.c&&(e.c=new at(Iw,e,12,10)),e.c),s),s),Cg(r,0),Wm(r,1),Mg(r,!0),Lg(r,!0),r}function J6(e,t){var n,r;if(t>=e.i)throw J(new zte(t,e.i));return++e.j,n=e.g[t],r=e.i-t-1,r>0&&Hc(e.g,t+1,e.g,t,r),cs(e.g,--e.i,null),e.fi(t,n),e.ci(),n}function jit(e,t){var n,r;return e.Db>>16==17?e.Cb.ih(e,21,tf,t):(r=go(u(gn((n=u(_n(e,16),26),n||e.zh()),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function nln(e){var t,n,r,s;for(hn(),aa(e.c,e.a),s=new C(e.c);s.an.a.c.length))throw J(new Ln("index must be >= 0 and <= layer node count"));e.c&&Au(e.c.a,e),e.c=n,n&&Om(n.a,t,e)}function qit(e,t){var n,r,s;for(r=new cr(fr(j0(e).a.Kc(),new V));Vr(r);)return n=u(Pr(r),17),s=u(t.Kb(n),10),new Bx(Nr(s.n.b+s.o.b/2));return kT(),kT(),hue}function Vit(e,t){this.c=new Mr,this.a=e,this.b=t,this.d=u(K(e,(et(),G4)),304),je(K(e,(pt(),zTe)))===je((pD(),Dq))?this.e=new yHe:this.e=new mHe}function cln(e,t){var n,r,s,o;for(o=0,r=new C(e);r.a>16==6?e.Cb.ih(e,6,ra,t):(r=go(u(gn((n=u(_n(e,16),26),n||(cu(),qV)),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function P3e(e,t){var n,r;return e.Db>>16==7?e.Cb.ih(e,1,iN,t):(r=go(u(gn((n=u(_n(e,16),26),n||(cu(),xAe)),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function B3e(e,t){var n,r;return e.Db>>16==9?e.Cb.ih(e,9,hs,t):(r=go(u(gn((n=u(_n(e,16),26),n||(cu(),TAe)),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function Wit(e,t){var n,r;return e.Db>>16==5?e.Cb.ih(e,9,JV,t):(r=go(u(gn((n=u(_n(e,16),26),n||(on(),Yg)),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function R3e(e,t){var n,r;return e.Db>>16==3?e.Cb.ih(e,0,aN,t):(r=go(u(gn((n=u(_n(e,16),26),n||(on(),Kg)),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function Kit(e,t){var n,r;return e.Db>>16==7?e.Cb.ih(e,6,h1,t):(r=go(u(gn((n=u(_n(e,16),26),n||(on(),Qg)),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function Yit(){this.a=new VB,this.g=new FH,this.j=new FH,this.b=new Mr,this.d=new FH,this.i=new FH,this.k=new Mr,this.c=new Mr,this.e=new Mr,this.f=new Mr}function fln(e,t,n){var r,s,o;for(n<0&&(n=0),o=e.i,s=n;sioe)return o7(e,r);if(r==e)return!0}}return!1}function gln(e){switch(uj(),e.q.g){case 5:Oat(e,(ht(),An)),Oat(e,xr);break;case 4:Aot(e,(ht(),An)),Aot(e,xr);break;default:Alt(e,(ht(),An)),Alt(e,xr)}}function pln(e){switch(uj(),e.q.g){case 5:Kat(e,(ht(),$n)),Kat(e,Dn);break;case 4:sit(e,(ht(),$n)),sit(e,Dn);break;default:Llt(e,(ht(),$n)),Llt(e,Dn)}}function bln(e){var t,n;t=u(K(e,(a1(),dpt)),19),t?(n=t.a,n==0?Ye(e,(zp(),tq),new Fie):Ye(e,(zp(),tq),new m$(n))):Ye(e,(zp(),tq),new m$(1))}function vln(e,t){var n;switch(n=e.i,t.g){case 1:return-(e.n.b+e.o.b);case 2:return e.n.a-n.o.a;case 3:return e.n.b-n.o.b;case 4:return-(e.n.a+e.o.a)}return 0}function wln(e,t){switch(e.g){case 0:return t==(mh(),l2)?kq:xq;case 1:return t==(mh(),l2)?kq:bO;case 2:return t==(mh(),l2)?bO:xq;default:return bO}}function JD(e,t){var n,r,s;for(Au(e.a,t),e.e-=t.r+(e.a.c.length==0?0:e.c),s=Exe,r=new C(e.a);r.a>16==3?e.Cb.ih(e,12,hs,t):(r=go(u(gn((n=u(_n(e,16),26),n||(cu(),kAe)),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function j3e(e,t){var n,r;return e.Db>>16==11?e.Cb.ih(e,10,hs,t):(r=go(u(gn((n=u(_n(e,16),26),n||(cu(),EAe)),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function Xit(e,t){var n,r;return e.Db>>16==10?e.Cb.ih(e,11,tf,t):(r=go(u(gn((n=u(_n(e,16),26),n||(on(),Xg)),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function Qit(e,t){var n,r;return e.Db>>16==10?e.Cb.ih(e,12,nf,t):(r=go(u(gn((n=u(_n(e,16),26),n||(on(),Ky)),e.Db>>16),18)),e.Cb.ih(e,r.n,r.f,t))}function $h(e){var t;return!(e.Bb&1)&&e.r&&e.r.kh()&&(t=u(e.r,49),e.r=u(Up(e,t),138),e.r!=t&&e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,9,8,t,e.r))),e.r}function wse(e,t,n){var r;return r=ie(re(pa,1),Ao,25,15,[l4e(e,(n1(),pc),t,n),l4e(e,lu,t,n),l4e(e,bc,t,n)]),e.f&&(r[0]=b.Math.max(r[0],r[2]),r[2]=r[0]),r}function mln(e,t){var n,r,s;if(s=dun(e,t),s.c.length!=0)for(aa(s,new PY),n=s.c.length,r=0;r>19,x=t.h>>19,v!=x?x-v:(s=e.h,d=t.h,s!=d?s-d:(r=e.m,h=t.m,r!=h?r-h:(n=e.l,o=t.l,n-o)))}function GH(){GH=pe,S7e=(uz(),Mue),C7e=new dn(A6e,S7e),_7e=(P$(),Lue),T7e=new dn(L6e,_7e),E7e=(LH(),Aue),x7e=new dn(M6e,E7e),k7e=new dn(D6e,(Mn(),!0))}function Z_(e,t,n){var r,s;r=t*n,we(e.g,145)?(s=j6(e),s.f.d?s.f.a||(e.d.a+=r+z1):(e.d.d-=r+z1,e.d.a+=r+z1)):we(e.g,10)&&(e.d.d-=r,e.d.a+=2*r)}function Zit(e,t,n){var r,s,o,h,d;for(s=e[n.g],d=new C(t.d);d.a0?e.g:0),++n;t.b=r,t.e=s}function Jit(e){var t,n,r;if(r=e.b,mGe(e.i,r.length)){for(n=r.length*2,e.b=Me(pue,AI,317,n,0,1),e.c=Me(pue,AI,317,n,0,1),e.f=n-1,e.i=0,t=e.a;t;t=t.c)aI(e,t,t);++e.g}}function Sln(e,t,n,r){var s,o,h,d;for(s=0;sh&&(d=h/r),s>o&&(v=o/s),bd(e,b.Math.min(d,v)),e}function Lln(){pz();var e,t;try{if(t=u(X3e((Ap(),rf),H7),2014),t)return t}catch(n){if(n=ts(n),we(n,102))e=n,Rve((jr(),e));else throw J(n)}return new Y5}function Mln(){zJe();var e,t;try{if(t=u(X3e((Ap(),rf),_b),2024),t)return t}catch(n){if(n=ts(n),we(n,102))e=n,Rve((jr(),e));else throw J(n)}return new bm}function Dln(){pz();var e,t;try{if(t=u(X3e((Ap(),rf),Uh),1941),t)return t}catch(n){if(n=ts(n),we(n,102))e=n,Rve((jr(),e));else throw J(n)}return new KZ}function Iln(e,t,n){var r,s;return s=e.e,e.e=t,e.Db&4&&!(e.Db&1)&&(r=new oa(e,1,4,s,t),n?n.Ei(r):n=r),s!=t&&(t?n=E7(e,nz(e,t),n):n=E7(e,e.a,n)),n}function est(){kF.call(this),this.e=-1,this.a=!1,this.p=$a,this.k=-1,this.c=-1,this.b=-1,this.g=!1,this.f=-1,this.j=-1,this.n=-1,this.i=-1,this.d=-1,this.o=$a}function Oln(e,t){var n,r,s;if(r=e.b.d.d,e.a||(r+=e.b.d.a),s=t.b.d.d,t.a||(s+=t.b.d.a),n=Fs(r,s),n==0){if(!e.a&&t.a)return-1;if(!t.a&&e.a)return 1}return n}function Nln(e,t){var n,r,s;if(r=e.b.b.d,e.a||(r+=e.b.b.a),s=t.b.b.d,t.a||(s+=t.b.b.a),n=Fs(r,s),n==0){if(!e.a&&t.a)return-1;if(!t.a&&e.a)return 1}return n}function Pln(e,t){var n,r,s;if(r=e.b.g.d,e.a||(r+=e.b.g.a),s=t.b.g.d,t.a||(s+=t.b.g.a),n=Fs(r,s),n==0){if(!e.a&&t.a)return-1;if(!t.a&&e.a)return 1}return n}function H3e(){H3e=pe,Spt=il(xi(xi(xi(new Xs,(ro(),Zc),(po(),zEe)),Zc,GEe),Go,qEe),Go,DEe),Lpt=xi(xi(new Xs,Zc,TEe),Zc,IEe),Apt=il(new Xs,Go,NEe)}function Bln(e){var t,n,r,s,o;for(t=u(K(e,(et(),uS)),83),o=e.n,r=t.Cc().Kc();r.Ob();)n=u(r.Pb(),306),s=n.i,s.c+=o.a,s.d+=o.b,n.c?bct(n):vct(n);Ye(e,uS,null)}function Rln(e,t,n){var r,s;switch(s=e.b,r=s.d,t.g){case 1:return-r.d-n;case 2:return s.o.a+r.c+n;case 3:return s.o.b+r.a+n;case 4:return-r.b-n;default:return-1}}function Fln(e){var t,n,r,s,o;if(r=0,s=O7,e.b)for(t=0;t<360;t++)n=t*.017453292519943295,D5e(e,e.d,0,0,_4,n),o=e.b.ig(e.d),o0&&(h=(o&Ei)%e.d.length,s=H4e(e,h,o,t),s)?(d=s.ed(n),d):(r=e.tj(o,t,n),e.c.Fc(r),null)}function q3e(e,t){var n,r,s,o;switch(Ag(e,t)._k()){case 3:case 2:{for(n=b4(t),s=0,o=n.i;s=0;r--)if(an(e[r].d,t)||an(e[r].d,n)){e.length>=r+1&&e.splice(0,r+1);break}return e}function eI(e,t){var n;return Ko(e)&&Ko(t)&&(n=e/t,DI0&&(e.b+=2,e.a+=r):(e.b+=1,e.a+=b.Math.min(r,s))}function ost(e,t){var n,r;if(r=!1,fa(t)&&(r=!0,O6(e,new Bm(Hr(t)))),r||we(t,236)&&(r=!0,O6(e,(n=Xbe(u(t,236)),new lT(n)))),!r)throw J(new Jee(s8e))}function nhn(e,t,n,r){var s,o,h;return s=new N0(e.e,1,10,(h=t.c,we(h,88)?u(h,26):(on(),sf)),(o=n.c,we(o,88)?u(o,26):(on(),sf)),Dg(e,t),!1),r?r.Ei(s):r=s,r}function W3e(e){var t,n;switch(u(K(Ya(e),(pt(),NTe)),420).g){case 0:return t=e.n,n=e.o,new Pt(t.a+n.a/2,t.b+n.b/2);case 1:return new Io(e.n);default:return null}}function tI(){tI=pe,Iq=new HT(U0,0),m9e=new HT("LEFTUP",1),k9e=new HT("RIGHTUP",2),w9e=new HT("LEFTDOWN",3),y9e=new HT("RIGHTDOWN",4),Tle=new HT("BALANCED",5)}function rhn(e,t,n){var r,s,o;if(r=Fs(e.a[t.p],e.a[n.p]),r==0){if(s=u(K(t,(et(),Sk)),15),o=u(K(n,Sk),15),s.Hc(n))return-1;if(o.Hc(t))return 1}return r}function ihn(e){switch(e.g){case 1:return new JQ;case 2:return new eZ;case 3:return new ZQ;case 0:return null;default:throw J(new Ln(wce+(e.f!=null?e.f:""+e.g)))}}function K3e(e,t,n){switch(t){case 1:!e.n&&(e.n=new at(Jo,e,1,7)),_r(e.n),!e.n&&(e.n=new at(Jo,e,1,7)),fs(e.n,u(n,14));return;case 2:I_(e,Hr(n));return}gye(e,t,n)}function Y3e(e,t,n){switch(t){case 3:Hv(e,Ue(ft(n)));return;case 4:zv(e,Ue(ft(n)));return;case 5:Du(e,Ue(ft(n)));return;case 6:Iu(e,Ue(ft(n)));return}K3e(e,t,n)}function VH(e,t,n){var r,s,o;o=(r=new Wee,r),s=$1(o,t,null),s&&s.Fi(),au(o,n),Br((!e.c&&(e.c=new at(Iw,e,12,10)),e.c),o),Cg(o,0),Wm(o,1),Mg(o,!0),Lg(o,!0)}function X3e(e,t){var n,r,s;return n=BT(e.g,t),we(n,235)?(s=u(n,235),s.Qh()==null,s.Nh()):we(n,498)?(r=u(n,1938),s=r.b,s):null}function shn(e,t,n,r){var s,o;return Nr(t),Nr(n),o=u(c_(e.d,t),19),WJe(!!o,"Row %s not in %s",t,e.e),s=u(c_(e.b,n),19),WJe(!!s,"Column %s not in %s",n,e.c),ent(e,o.a,s.a,r)}function cst(e,t,n,r,s,o,h){var d,v,x,_,L;if(_=s[o],x=o==h-1,d=x?r:0,L=Lit(d,_),r!=10&&ie(re(e,h-o),t[o],n[o],d,L),!x)for(++o,v=0;v<_;++v)L[v]=cst(e,t,n,r,s,o,h);return L}function J_(e){if(e.g==-1)throw J(new zu);e.mj();try{e.i.$c(e.g),e.f=e.i.j,e.g1||d==-1?(o=u(v,15),s.Wb(fcn(e,o))):s.Wb(aae(e,u(v,56)))))}function fhn(e,t,n,r){Wze();var s=lue;function o(){for(var h=0;hpce)return n;s>-1e-6&&++n}return n}function J3e(e,t){var n;t!=e.b?(n=null,e.b&&(n=r$(e.b,e,-4,n)),t&&(n=Q6(t,e,-4,n)),n=qnt(e,t,n),n&&n.Fi()):e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,3,t,t))}function hst(e,t){var n;t!=e.f?(n=null,e.f&&(n=r$(e.f,e,-1,n)),t&&(n=Q6(t,e,-1,n)),n=Vnt(e,t,n),n&&n.Fi()):e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,0,t,t))}function fst(e){var t,n,r;if(e==null)return null;if(n=u(e,15),n.dc())return"";for(r=new bg,t=n.Kc();t.Ob();)To(r,(Fi(),Hr(t.Pb()))),r.a+=" ";return qte(r,r.a.length-1)}function dst(e){var t,n,r;if(e==null)return null;if(n=u(e,15),n.dc())return"";for(r=new bg,t=n.Kc();t.Ob();)To(r,(Fi(),Hr(t.Pb()))),r.a+=" ";return qte(r,r.a.length-1)}function yhn(e,t,n){var r,s;return r=e.c[t.c.p][t.p],s=e.c[n.c.p][n.p],r.a!=null&&s.a!=null?Ine(r.a,s.a):r.a!=null?-1:s.a!=null?1:0}function khn(e,t){var n,r,s,o,h,d;if(t)for(o=t.a.length,n=new W2(o),d=(n.b-n.a)*n.c<0?(Lp(),C2):new Op(n);d.Ob();)h=u(d.Pb(),19),s=E8(t,h.a),r=new f$e(e),lJt(r.a,s)}function xhn(e,t){var n,r,s,o,h,d;if(t)for(o=t.a.length,n=new W2(o),d=(n.b-n.a)*n.c<0?(Lp(),C2):new Op(n);d.Ob();)h=u(d.Pb(),19),s=E8(t,h.a),r=new r$e(e),uJt(r.a,s)}function Ehn(e){var t;if(e!=null&&e.length>0&&Ma(e,e.length-1)==33)try{return t=lat(jl(e,0,e.length-1)),t.e==null}catch(n){if(n=ts(n),!we(n,32))throw J(n)}return!1}function gst(e,t,n){var r,s,o;return r=t.ak(),o=t.dd(),s=r.$j()?jp(e,3,r,null,o,y7(e,r,o,we(r,99)&&(u(r,18).Bb&so)!=0),!0):jp(e,1,r,r.zj(),o,-1,!0),n?n.Ei(s):n=s,n}function Thn(){var e,t,n;for(t=0,e=0;e<1;e++){if(n=V4e((zr(e,1),"X".charCodeAt(e))),n==0)throw J(new $r("Unknown Option: "+"X".substr(e)));t|=n}return t}function _hn(e,t,n){var r,s,o;switch(r=Ya(t),s=wH(r),o=new $c,rc(o,t),n.g){case 1:Vs(o,zD(Y6(s)));break;case 2:Vs(o,Y6(s))}return Ye(o,(pt(),Ny),ft(K(e,Ny))),o}function e4e(e){var t,n;return t=u(Pr(new cr(fr(Xo(e.a).a.Kc(),new V))),17),n=u(Pr(new cr(fr(js(e.a).a.Kc(),new V))),17),It(Mt(K(t,(et(),W1))))||It(Mt(K(n,W1)))}function c4(){c4=pe,Tq=new kM("ONE_SIDE",0),Cq=new kM("TWO_SIDES_CORNER",1),Sq=new kM("TWO_SIDES_OPPOSING",2),_q=new kM("THREE_SIDES",3),Eq=new kM("FOUR_SIDES",4)}function xse(e,t,n,r,s){var o,h;o=u(zl(Vi(t.Oc(),new IX),eb(new vt,new Dt,new Hn,ie(re(yl,1),tt,132,0,[(F1(),Ql)]))),15),h=u(rb(e.b,n,r),15),s==0?h.Wc(0,o):h.Gc(o)}function Chn(e,t){var n,r,s,o,h;for(o=new C(t.a);o.a0&&$it(this,this.c-1,(ht(),$n)),this.c0&&e[0].length>0&&(this.c=It(Mt(K(Ya(e[0][0]),(et(),B9e))))),this.a=Me(vwt,Qe,2018,e.length,0,2),this.b=Me(wwt,Qe,2019,e.length,0,2),this.d=new Rnt}function Dhn(e){return e.c.length==0?!1:(xn(0,e.c.length),u(e.c[0],17)).c.i.k==(zn(),ca)?!0:_8(Cu(new vn(null,new mn(e,16)),new oQ),new cQ)}function Ihn(e,t,n){return kr(n,"Tree layout",1),d$(e.b),Xd(e.b,(a7(),fV),fV),Xd(e.b,_S,_S),Xd(e.b,NO,NO),Xd(e.b,CS,CS),e.a=mz(e.b,t),opn(e,t,Kc(n,1)),ur(n),t}function bst(e,t){var n,r,s,o,h,d,v;for(d=oy(t),o=t.f,v=t.g,h=b.Math.sqrt(o*o+v*v),s=0,r=new C(d);r.a=0?(n=eI(e,Lz),r=VD(e,Lz)):(t=Nm(e,1),n=eI(t,5e8),r=VD(t,5e8),r=Ua(A0(r,1),qs(e,1))),I1(A0(r,32),qs(n,yo))}function mst(e,t,n){var r,s;switch(r=(Qn(t.b!=0),u(bh(t,t.a.a),8)),n.g){case 0:r.b=0;break;case 2:r.b=e.f;break;case 3:r.a=0;break;default:r.a=e.g}return s=ii(t,0),YM(s,r),t}function yst(e,t,n,r){var s,o,h,d,v;switch(v=e.b,o=t.d,h=o.j,d=g3e(h,v.d[h.g],n),s=Ni(fc(o.n),o.a),o.j.g){case 1:case 3:d.a+=s.a;break;case 2:case 4:d.b+=s.b}ks(r,d,r.c.b,r.c)}function qhn(e,t,n){var r,s,o,h;for(h=Yo(e.e,t,0),o=new wpe,o.b=n,r=new Ea(e.e,h);r.b1;t>>=1)t&1&&(r=W3(r,n)),n.d==1?n=W3(n,n):n=new qrt(Jct(n.a,n.d,Me(Lr,Jr,25,n.d<<1,15,1)));return r=W3(r,n),r}function o4e(){o4e=pe;var e,t,n,r;for(c7e=Me(pa,Ao,25,25,15,1),u7e=Me(pa,Ao,25,33,15,1),r=152587890625e-16,t=32;t>=0;t--)u7e[t]=r,r*=.5;for(n=1,e=24;e>=0;e--)c7e[e]=n,n*=.5}function Xhn(e){var t,n;if(It(Mt(Ft(e,(pt(),Oy))))){for(n=new cr(fr(z0(e).a.Kc(),new V));Vr(n);)if(t=u(Pr(n),79),ew(t)&&It(Mt(Ft(t,Db))))return!0}return!1}function kst(e,t){var n,r,s;Gs(e.f,t)&&(t.b=e,r=t.c,Yo(e.j,r,0)!=-1||it(e.j,r),s=t.d,Yo(e.j,s,0)!=-1||it(e.j,s),n=t.a.b,n.c.length!=0&&(!e.i&&(e.i=new Jrt(e)),fsn(e.i,n)))}function Qhn(e){var t,n,r,s,o;return n=e.c.d,r=n.j,s=e.d.d,o=s.j,r==o?n.p=0&&an(e.substr(t,3),"GMT")||t>=0&&an(e.substr(t,3),"UTC"))&&(n[0]=t+3),N5e(e,n,r)}function Jhn(e,t){var n,r,s,o,h;for(o=e.g.a,h=e.g.b,r=new C(e.d);r.an;o--)e[o]|=t[o-n-1]>>>h,e[o-1]=t[o-n-1]<=e.f)break;o.c[o.c.length]=n}return o}function u4e(e){var t,n,r,s;for(t=null,s=new C(e.wf());s.a0&&Hc(e.g,t,e.g,t+r,d),h=n.Kc(),e.i+=r,s=0;so&&pZt(x,bet(n[d],a7e))&&(s=d,o=v);return s>=0&&(r[0]=t+o),s}function afn(e,t){var n;if(n=fVe(e.b.Hf(),t.b.Hf()),n!=0)return n;switch(e.b.Hf().g){case 1:case 2:return Tu(e.b.sf(),t.b.sf());case 3:case 4:return Tu(t.b.sf(),e.b.sf())}return 0}function ofn(e){var t,n,r;for(r=e.e.c.length,e.a=U2(Lr,[Qe,Jr],[48,25],15,[r,r],2),n=new C(e.c);n.a>4&15,o=e[r]&15,h[s++]=_Ae[n],h[s++]=_Ae[o];return jh(h,0,h.length)}function lfn(e,t,n){var r,s,o;return r=t.ak(),o=t.dd(),s=r.$j()?jp(e,4,r,o,null,y7(e,r,o,we(r,99)&&(u(r,18).Bb&so)!=0),!0):jp(e,r.Kj()?2:1,r,o,r.zj(),-1,!0),n?n.Ei(s):n=s,n}function Nu(e){var t,n;return e>=so?(t=II+(e-so>>10&1023)&Ss,n=56320+(e-so&1023)&Ss,String.fromCharCode(t)+(""+String.fromCharCode(n))):String.fromCharCode(e&Ss)}function hfn(e,t){Mm();var n,r,s,o;return s=u(u(Ii(e.r,t),21),84),s.gc()>=2?(r=u(s.Kc().Pb(),111),n=e.u.Hc((ol(),GS)),o=e.u.Hc($k),!r.a&&!n&&(s.gc()==2||o)):!1}function Tst(e,t,n,r,s){var o,h,d;for(o=oct(e,t,n,r,s),d=!1;!o;)ez(e,s,!0),d=!0,o=oct(e,t,n,r,s);d&&ez(e,s,!1),h=hie(s),h.c.length!=0&&(e.d&&e.d.lg(h),Tst(e,s,n,r,h))}function YH(){YH=pe,dfe=new WT(U0,0),JSe=new WT("DIRECTED",1),tAe=new WT("UNDIRECTED",2),QSe=new WT("ASSOCIATION",3),eAe=new WT("GENERALIZATION",4),ZSe=new WT("DEPENDENCY",5)}function ffn(e,t){var n;if(!L1(e))throw J(new Wo(m1t));switch(n=L1(e),t.g){case 1:return-(e.j+e.f);case 2:return e.i-n.g;case 3:return e.j-n.f;case 4:return-(e.i+e.g)}return 0}function l7(e,t){var n,r;for(Sn(t),r=e.b.c.length,it(e.b,t);r>0;){if(n=r,r=(r-1)/2|0,e.a.ue(St(e.b,r),t)<=0)return gh(e.b,n,t),!0;gh(e.b,n,St(e.b,r))}return gh(e.b,r,t),!0}function l4e(e,t,n,r){var s,o;if(s=0,n)s=dH(e.a[n.g][t.g],r);else for(o=0;o=d)}function h4e(e,t,n,r){var s;if(s=!1,fa(r)&&(s=!0,f8(t,n,Hr(r))),s||Cm(r)&&(s=!0,h4e(e,t,n,r)),s||we(r,236)&&(s=!0,Y2(t,n,u(r,236))),!s)throw J(new Jee(s8e))}function gfn(e,t){var n,r,s;if(n=t.Hh(e.a),n&&(s=r1((!n.b&&(n.b=new Ml((on(),oo),wc,n)),n.b),Vh),s!=null)){for(r=1;r<(Yu(),YAe).length;++r)if(an(YAe[r],s))return r}return 0}function pfn(e,t){var n,r,s;if(n=t.Hh(e.a),n&&(s=r1((!n.b&&(n.b=new Ml((on(),oo),wc,n)),n.b),Vh),s!=null)){for(r=1;r<(Yu(),XAe).length;++r)if(an(XAe[r],s))return r}return 0}function _st(e,t){var n,r,s,o;if(Sn(t),o=e.a.gc(),o0?1:0;o.a[s]!=n;)o=o.a[s],s=e.a.ue(n.d,o.d)>0?1:0;o.a[s]=r,r.b=n.b,r.a[0]=n.a[0],r.a[1]=n.a[1],n.a[0]=null,n.a[1]=null}function wfn(e){ol();var t,n;return t=Ui(Z0,ie(re(jV,1),tt,273,0,[m2])),!(SD(a$(t,e))>1||(n=Ui(GS,ie(re(jV,1),tt,273,0,[zS,$k])),SD(a$(n,e))>1))}function d4e(e,t){var n;n=Uc((Ap(),rf),e),we(n,498)?Oo(rf,e,new zqe(this,t)):Oo(rf,e,this),Lse(this,t),t==(Qx(),RAe)?(this.wb=u(this,1939),u(t,1941)):this.wb=(Rp(),En)}function mfn(e){var t,n,r;if(e==null)return null;for(t=null,n=0;n=Pg?"error":r>=900?"warn":r>=800?"info":"log"),uYe(n,e.a),e.b&&d5e(t,n,e.b,"Exception: ",!0))}function K(e,t){var n,r;return r=(!e.q&&(e.q=new Mr),er(e.q,t)),r??(n=t.wg(),we(n,4)&&(n==null?(!e.q&&(e.q=new Mr),z6(e.q,t)):(!e.q&&(e.q=new Mr),Si(e.q,t,n))),n)}function ro(){ro=pe,Pd=new yM("P1_CYCLE_BREAKING",0),c2=new yM("P2_LAYERING",1),bu=new yM("P3_NODE_ORDERING",2),Zc=new yM("P4_NODE_PLACEMENT",3),Go=new yM("P5_EDGE_ROUTING",4)}function Lst(e,t){var n,r,s,o,h;for(s=t==1?Kue:Wue,r=s.a.ec().Kc();r.Ob();)for(n=u(r.Pb(),103),h=u(Ii(e.f.c,n),21).Kc();h.Ob();)o=u(h.Pb(),46),Au(e.b.b,o.b),Au(e.b.a,u(o.b,81).d)}function yfn(e,t){M_();var n;if(e.c==t.c){if(e.b==t.b||Vin(e.b,t.b)){if(n=eWt(e.b)?1:-1,e.a&&!t.a)return n;if(!e.a&&t.a)return-n}return Tu(e.b.g,t.b.g)}else return Fs(e.c,t.c)}function kfn(e,t){var n;kr(t,"Hierarchical port position processing",1),n=e.b,n.c.length>0&&Kct((xn(0,n.c.length),u(n.c[0],29)),e),n.c.length>1&&Kct(u(St(n,n.c.length-1),29),e),ur(t)}function Mst(e,t){var n,r,s;if(p4e(e,t))return!0;for(r=new C(t);r.a=s||t<0)throw J(new Do(qce+t+Eb+s));if(n>=s||n<0)throw J(new Do(Vce+n+Eb+s));return t!=n?r=(o=e.Ti(n),e.Hi(t,o),o):r=e.Oi(n),r}function Ost(e){var t,n,r;if(r=e,e)for(t=0,n=e.Ug();n;n=n.Ug()){if(++t>ioe)return Ost(n);if(r=n,n==e)throw J(new Wo("There is a cycle in the containment hierarchy of "+e))}return r}function Yp(e){var t,n,r;for(r=new ib(io,"[","]"),n=e.Kc();n.Ob();)t=n.Pb(),O0(r,je(t)===je(e)?"(this Collection)":t==null?Pu:Qo(t));return r.a?r.e.length==0?r.a.a:r.a.a+(""+r.e):r.c}function p4e(e,t){var n,r;if(r=!1,t.gc()<2)return!1;for(n=0;nr&&(zr(t-1,e.length),e.charCodeAt(t-1)<=32);)--t;return r>0||t1&&(e.j.b+=e.e)):(e.j.a+=n.a,e.j.b=b.Math.max(e.j.b,n.b),e.d.c.length>1&&(e.j.a+=e.e))}function Xp(){Xp=pe,d2t=ie(re(ao,1),Dc,61,0,[(ht(),An),$n,xr]),f2t=ie(re(ao,1),Dc,61,0,[$n,xr,Dn]),g2t=ie(re(ao,1),Dc,61,0,[xr,Dn,An]),p2t=ie(re(ao,1),Dc,61,0,[Dn,An,$n])}function Efn(e,t,n,r){var s,o,h,d,v,x,_;if(h=e.c.d,d=e.d.d,h.j!=d.j)for(_=e.b,s=h.j,v=null;s!=d.j;)v=t==0?vH(s):Fye(s),o=g3e(s,_.d[s.g],n),x=g3e(v,_.d[v.g],n),ci(r,Ni(o,x)),s=v}function Tfn(e,t,n,r){var s,o,h,d,v;return h=Hit(e.a,t,n),d=u(h.a,19).a,o=u(h.b,19).a,r&&(v=u(K(t,(et(),cl)),10),s=u(K(n,cl),10),v&&s&&(VQe(e.b,v,s),d+=e.b.i,o+=e.b.e)),d>o}function Pst(e){var t,n,r,s,o,h,d,v,x;for(this.a=lit(e),this.b=new st,n=e,r=0,s=n.length;rane(e.d).c?(e.i+=e.g.c,Vie(e.d)):ane(e.d).c>ane(e.g).c?(e.e+=e.d.c,Vie(e.g)):(e.i+=lKe(e.g),e.e+=lKe(e.d),Vie(e.g),Vie(e.d))}function Sfn(e,t,n){var r,s,o,h;for(o=t.q,h=t.r,new X2((Jf(),d2),t,o,1),new X2(d2,o,h,1),s=new C(n);s.ad&&(v=d/r),s>o&&(x=o/s),h=b.Math.min(v,x),e.a+=h*(t.a-e.a),e.b+=h*(t.b-e.b)}function Dfn(e,t,n,r,s){var o,h;for(h=!1,o=u(St(n.b,0),33);Ubn(e,t,o,r,s)&&(h=!0,lhn(n,o),n.b.c.length!=0);)o=u(St(n.b,0),33);return n.b.c.length==0&&JD(n.j,n),h&&$H(t.q),h}function Ifn(e,t){g4();var n,r,s,o;if(t.b<2)return!1;for(o=ii(t,0),n=u(ri(o),8),r=n;o.b!=o.d.c;){if(s=u(ri(o),8),Kse(e,r,s))return!0;r=s}return!!Kse(e,r,n)}function v4e(e,t,n,r){var s,o;return n==0?(!e.o&&(e.o=new Nl((cu(),k2),Dw,e,0)),vj(e.o,t,r)):(o=u(gn((s=u(_n(e,16),26),s||e.zh()),n),66),o.Nj().Rj(e,du(e),n-Jn(e.zh()),t,r))}function Lse(e,t){var n;t!=e.sb?(n=null,e.sb&&(n=u(e.sb,49).ih(e,1,US,n)),t&&(n=u(t,49).gh(e,1,US,n)),n=Dye(e,t,n),n&&n.Fi()):e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,4,t,t))}function Ofn(e,t){var n,r,s,o;if(t)s=B0(t,"x"),n=new u$e(e),O8(n.a,(Sn(s),s)),o=B0(t,"y"),r=new l$e(e),P8(r.a,(Sn(o),o));else throw J(new dd("All edge sections need an end point."))}function Nfn(e,t){var n,r,s,o;if(t)s=B0(t,"x"),n=new a$e(e),N8(n.a,(Sn(s),s)),o=B0(t,"y"),r=new o$e(e),B8(r.a,(Sn(o),o));else throw J(new dd("All edge sections need a start point."))}function Pfn(e,t){var n,r,s,o,h,d,v;for(r=knt(e),o=0,d=r.length;o>22-t,s=e.h<>22-t):t<44?(n=0,r=e.l<>44-t):(n=0,r=0,s=e.l<e)throw J(new Ln("k must be smaller than n"));return t==0||t==e?1:e==0?0:V3e(e)/(V3e(t)*V3e(e-t))}function w4e(e,t){var n,r,s,o;for(n=new H2e(e);n.g==null&&!n.c?ywe(n):n.g==null||n.i!=0&&u(n.g[n.i-1],47).Ob();)if(o=u(tz(n),56),we(o,160))for(r=u(o,160),s=0;s>4],t[n*2+1]=iU[o&15];return jh(t,0,t.length)}function Zfn(e){Uj();var t,n,r;switch(r=e.c.length,r){case 0:return k0t;case 1:return t=u(_at(new C(e)),42),xQt(t.cd(),t.dd());default:return n=u(j1(e,Me(Cb,Sz,42,e.c.length,0,1)),165),new Qee(n)}}function Jfn(e){var t,n,r,s,o,h;for(t=new L3,n=new L3,$p(t,e),$p(n,e);n.b!=n.c;)for(s=u(I6(n),37),h=new C(s.a);h.a0&&bI(e,n,t),s):Pdn(e,t,n)}function Gst(e,t,n){var r,s,o,h;if(t.b!=0){for(r=new as,h=ii(t,0);h.b!=h.d.c;)o=u(ri(h),86),no(r,eye(o)),s=o.e,s.a=u(K(o,(Tc(),Che)),19).a,s.b=u(K(o,F_e),19).a;Gst(e,r,Kc(n,r.b/e.a|0))}}function qst(e,t){var n,r,s,o,h;if(e.e<=t||otn(e,e.g,t))return e.g;for(o=e.r,r=e.g,h=e.r,s=(o-r)/2+r;r+11&&(e.e.b+=e.a)):(e.e.a+=n.a,e.e.b=b.Math.max(e.e.b,n.b),e.d.c.length>1&&(e.e.a+=e.a))}function i1n(e){var t,n,r,s;switch(s=e.i,t=s.b,r=s.j,n=s.g,s.a.g){case 0:n.a=(e.g.b.o.a-r.a)/2;break;case 1:n.a=t.d.n.a+t.d.a.a;break;case 2:n.a=t.d.n.a+t.d.a.a-r.a;break;case 3:n.b=t.d.n.b+t.d.a.b}}function Vst(e,t,n,r,s){if(rr&&(e.a=r),e.bs&&(e.b=s),e}function s1n(e){if(we(e,149))return Ngn(u(e,149));if(we(e,229))return Don(u(e,229));if(we(e,23))return Ffn(u(e,23));throw J(new Ln(a8e+Yp(new Al(ie(re(Yn,1),yt,1,5,[e])))))}function a1n(e,t,n,r,s){var o,h,d;for(o=!0,h=0;h>>s|n[h+r+1]<>>s,++h}return o}function x4e(e,t,n,r){var s,o,h;if(t.k==(zn(),ca)){for(o=new cr(fr(Xo(t).a.Kc(),new V));Vr(o);)if(s=u(Pr(o),17),h=s.c.i.k,h==ca&&e.c.a[s.c.i.c.p]==r&&e.c.a[t.c.p]==n)return!0}return!1}function o1n(e,t){var n,r,s,o;return t&=63,n=e.h&V0,t<22?(o=n>>>t,s=e.m>>t|n<<22-t,r=e.l>>t|e.m<<22-t):t<44?(o=0,s=n>>>t-22,r=e.m>>t-22|e.h<<44-t):(o=0,s=0,r=n>>>t-44),fu(r&ml,s&ml,o&V0)}function Ust(e,t,n,r){var s;this.b=r,this.e=e==(Gv(),xS),s=t[n],this.d=U2(El,[Qe,c0],[177,25],16,[s.length,s.length],2),this.a=U2(Lr,[Qe,Jr],[48,25],15,[s.length,s.length],2),this.c=new i4e(t,n)}function c1n(e){var t,n,r;for(e.k=new Twe((ht(),ie(re(ao,1),Dc,61,0,[uc,An,$n,xr,Dn])).length,e.j.c.length),r=new C(e.j);r.a=n)return f7(e,t,r.p),!0;return!1}function Kst(e){var t;return e.Db&64?Mse(e):(t=new Fl(Yxe),!e.a||Yr(Yr((t.a+=' "',t),e.a),'"'),Yr(bv(Yr(bv(Yr(bv(Yr(bv((t.a+=" (",t),e.i),","),e.j)," | "),e.g),","),e.f),")"),t.a)}function Yst(e,t,n){var r,s,o,h,d;for(d=pu(e.e.Tg(),t),s=u(e.g,119),r=0,h=0;hn?M4e(e,n,"start index"):t<0||t>n?M4e(t,n,"end index"):oC("end index (%s) must not be less than start index (%s)",ie(re(Yn,1),yt,1,5,[ct(t),ct(e)]))}function Qst(e,t){var n,r,s,o;for(r=0,s=e.length;r0&&Zst(e,o,n));t.p=0}function Vt(e){var t;this.c=new as,this.f=e.e,this.e=e.d,this.i=e.g,this.d=e.c,this.b=e.b,this.k=e.j,this.a=e.a,e.i?this.j=e.i:this.j=(t=u(Qf(Ug),9),new hh(t,u(wf(t,t.length),9),0)),this.g=e.f}function g1n(e){var t,n,r,s;for(t=Bp(Yr(new Fl("Predicates."),"and"),40),n=!0,s=new c6(e);s.b0?d[h-1]:Me(h0,Bg,10,0,0,1),s=d[h],x=h=0?e.Bh(s):P4e(e,r);else throw J(new Ln(i2+r.ne()+RC));else throw J(new Ln(M1t+t+D1t));else wh(e,n,r)}function E4e(e){var t,n;if(n=null,t=!1,we(e,204)&&(t=!0,n=u(e,204).a),t||we(e,258)&&(t=!0,n=""+u(e,258).a),t||we(e,483)&&(t=!0,n=""+u(e,483).a),!t)throw J(new Jee(s8e));return n}function nat(e,t){var n,r;if(e.f){for(;t.Ob();)if(n=u(t.Pb(),72),r=n.ak(),we(r,99)&&u(r,18).Bb&_c&&(!e.e||r.Gj()!=AE||r.aj()!=0)&&n.dd()!=null)return t.Ub(),!0;return!1}else return t.Ob()}function rat(e,t){var n,r;if(e.f){for(;t.Sb();)if(n=u(t.Ub(),72),r=n.ak(),we(r,99)&&u(r,18).Bb&_c&&(!e.e||r.Gj()!=AE||r.aj()!=0)&&n.dd()!=null)return t.Pb(),!0;return!1}else return t.Sb()}function T4e(e,t,n){var r,s,o,h,d,v;for(v=pu(e.e.Tg(),t),r=0,d=e.i,s=u(e.g,119),h=0;h1&&(t.c[t.c.length]=o))}function w1n(e){var t,n,r,s;for(n=new as,no(n,e.o),r=new mpe;n.b!=0;)t=u(n.b==0?null:(Qn(n.b!=0),bh(n,n.a.a)),508),s=Blt(e,t,!0),s&&it(r.a,t);for(;r.a.c.length!=0;)t=u(Lnt(r),508),Blt(e,t,!1)}function Ng(){Ng=pe,rSe=new x6(EC,0),za=new x6("BOOLEAN",1),Cc=new x6("INT",2),kE=new x6("STRING",3),qo=new x6("DOUBLE",4),vs=new x6("ENUM",5),Pk=new x6("ENUMSET",6),Y1=new x6("OBJECT",7)}function tC(e,t){var n,r,s,o,h;r=b.Math.min(e.c,t.c),o=b.Math.min(e.d,t.d),s=b.Math.max(e.c+e.b,t.c+t.b),h=b.Math.max(e.d+e.a,t.d+t.a),s=(s/2|0))for(this.e=r?r.c:null,this.d=s;n++0;)kwe(this);this.b=t,this.a=null}function k1n(e,t){var n,r;t.a?qgn(e,t):(n=u(hne(e.b,t.b),57),n&&n==e.a[t.b.f]&&n.a&&n.a!=t.b.a&&n.c.Fc(t.b),r=u(lne(e.b,t.b),57),r&&e.a[r.f]==t.b&&r.a&&r.a!=t.b.a&&t.b.c.Fc(r),Zte(e.b,t.b))}function sat(e,t){var n,r;if(n=u(_o(e.b,t),124),u(u(Ii(e.r,t),21),84).dc()){n.n.b=0,n.n.c=0;return}n.n.b=e.C.b,n.n.c=e.C.c,e.A.Hc((Bl(),Hb))&&Lct(e,t),r=Qcn(e,t),Xse(e,t)==(n4(),v2)&&(r+=2*e.w),n.a.a=r}function aat(e,t){var n,r;if(n=u(_o(e.b,t),124),u(u(Ii(e.r,t),21),84).dc()){n.n.d=0,n.n.a=0;return}n.n.d=e.C.d,n.n.a=e.C.a,e.A.Hc((Bl(),Hb))&&Mct(e,t),r=Zcn(e,t),Xse(e,t)==(n4(),v2)&&(r+=2*e.w),n.a.b=r}function x1n(e,t){var n,r,s,o;for(o=new st,r=new C(t);r.an.a&&(r.Hc((ty(),HO))?s=(t.a-n.a)/2:r.Hc(zO)&&(s=t.a-n.a)),t.b>n.b&&(r.Hc((ty(),qO))?o=(t.b-n.b)/2:r.Hc(GO)&&(o=t.b-n.b)),f4e(e,s,o)}function gat(e,t,n,r,s,o,h,d,v,x,_,L,P){we(e.Cb,88)&&iy(dl(u(e.Cb,88)),4),au(e,n),e.f=h,e7(e,d),n7(e,v),J8(e,x),t7(e,_),Mg(e,L),r7(e,P),Lg(e,!0),Cg(e,s),e.ok(o),cb(e,t),r!=null&&(e.i=null,X$(e,r))}function pat(e){var t,n;if(e.f){for(;e.n>0;){if(t=u(e.k.Xb(e.n-1),72),n=t.ak(),we(n,99)&&u(n,18).Bb&_c&&(!e.e||n.Gj()!=AE||n.aj()!=0)&&t.dd()!=null)return!0;--e.n}return!1}else return e.n>0}function M4e(e,t,n){if(e<0)return oC(Jlt,ie(re(Yn,1),yt,1,5,[n,ct(e)]));if(t<0)throw J(new Ln(eht+t));return oC("%s (%s) must not be greater than size (%s)",ie(re(Yn,1),yt,1,5,[n,ct(e),ct(t)]))}function D4e(e,t,n,r,s,o){var h,d,v,x;if(h=r-n,h<7){yon(t,n,r,o);return}if(v=n+s,d=r+s,x=v+(d-v>>1),D4e(t,e,v,x,-s,o),D4e(t,e,x,d,-s,o),o.ue(e[x-1],e[x])<=0){for(;n=0?e.sh(o,n):o5e(e,s,n);else throw J(new Ln(i2+s.ne()+RC));else throw J(new Ln(M1t+t+D1t));else yh(e,r,s,n)}function bat(e){var t,n,r,s;if(n=u(e,49).qh(),n)try{if(r=null,t=p7((Ap(),rf),Zct(Eon(n))),t&&(s=t.rh(),s&&(r=s.Wk(DVt(n.e)))),r&&r!=e)return bat(r)}catch(o){if(o=ts(o),!we(o,60))throw J(o)}return e}function gu(e,t,n){var r,s,o,h;if(h=t==null?0:e.b.se(t),s=(r=e.a.get(h),r??new Array),s.length==0)e.a.set(h,s);else if(o=Int(e,t,s),o)return o.ed(n);return cs(s,s.length,new OF(t,n)),++e.c,t$(e.b),null}function vat(e,t){var n,r;return d$(e.a),Xd(e.a,(J$(),mV),mV),Xd(e.a,yE,yE),r=new Xs,xi(r,yE,(yH(),Dhe)),je(Ft(t,(Jm(),Nhe)))!==je((RD(),yV))&&xi(r,yE,Lhe),xi(r,yE,Mhe),pVe(e.a,r),n=mz(e.a,t),n}function wat(e){if(!e)return JHe(),M0t;var t=e.valueOf?e.valueOf():e;if(t!==e){var n=yue[typeof t];return n?n(t):Eye(typeof t)}else return e instanceof Array||e instanceof b.Array?new a6(e):new $x(e)}function mat(e,t,n){var r,s,o;switch(o=e.o,r=u(_o(e.p,n),244),s=r.i,s.b=cI(r),s.a=oI(r),s.b=b.Math.max(s.b,o.a),s.b>o.a&&!t&&(s.b=o.a),s.c=-(s.b-o.a)/2,n.g){case 1:s.d=-s.a;break;case 3:s.d=o.b}uae(r),lae(r)}function yat(e,t,n){var r,s,o;switch(o=e.o,r=u(_o(e.p,n),244),s=r.i,s.b=cI(r),s.a=oI(r),s.a=b.Math.max(s.a,o.b),s.a>o.b&&!t&&(s.a=o.b),s.d=-(s.a-o.b)/2,n.g){case 4:s.c=-s.b;break;case 2:s.c=o.a}uae(r),lae(r)}function R1n(e,t){var n,r,s,o,h;if(!t.dc()){if(s=u(t.Xb(0),128),t.gc()==1){Wot(e,s,s,1,0,t);return}for(n=1;n0)try{s=Wl(t,$a,Ei)}catch(o){throw o=ts(o),we(o,127)?(r=o,J(new D$(r))):J(o)}return n=(!e.a&&(e.a=new $ee(e)),e.a),s=0?u(Te(n,s),56):null}function H1n(e,t){if(e<0)return oC(Jlt,ie(re(Yn,1),yt,1,5,["index",ct(e)]));if(t<0)throw J(new Ln(eht+t));return oC("%s (%s) must be less than size (%s)",ie(re(Yn,1),yt,1,5,["index",ct(e),ct(t)]))}function z1n(e){var t,n,r,s,o;if(e==null)return Pu;for(o=new ib(io,"[","]"),n=e,r=0,s=n.length;r0)for(h=e.c.d,d=e.d.d,s=bd(da(new Pt(d.a,d.b),h),1/(r+1)),o=new Pt(h.a,h.b),n=new C(e.a);n.a=0?e._g(n,!0,!0):tw(e,s,!0),153)),u(r,215).ol(t);else throw J(new Ln(i2+t.ne()+RC))}function B4e(e){var t,n;return e>-0x800000000000&&e<0x800000000000?e==0?0:(t=e<0,t&&(e=-e),n=_s(b.Math.floor(b.Math.log(e)/.6931471805599453)),(!t||e!=b.Math.pow(2,n))&&++n,n):Utt(Ou(e))}function tdn(e){var t,n,r,s,o,h,d;for(o=new C0,n=new C(e);n.a2&&d.e.b+d.j.b<=2&&(s=d,r=h),o.a.zc(s,o),s.q=r);return o}function Aat(e,t){var n,r,s;return r=new H0(e),Ho(r,t),Ye(r,(et(),jq),t),Ye(r,(pt(),bs),(wa(),tu)),Ye(r,Bd,(t0(),MV)),T0(r,(zn(),Ls)),n=new $c,rc(n,r),Vs(n,(ht(),Dn)),s=new $c,rc(s,r),Vs(s,$n),r}function Lat(e){switch(e.g){case 0:return new ete((Gv(),IO));case 1:return new AR;case 2:return new ZJ;default:throw J(new Ln("No implementation is available for the crossing minimizer "+(e.f!=null?e.f:""+e.g)))}}function Mat(e,t){var n,r,s,o,h;for(e.c[t.p]=!0,it(e.a,t),h=new C(t.j);h.a=o)h.$b();else for(s=h.Kc(),r=0;r0?Npe():h<0&&Nat(e,t,-h),!0):!1}function oI(e){var t,n,r,s,o,h,d;if(d=0,e.b==0){for(h=bit(e,!0),t=0,r=h,s=0,o=r.length;s0&&(d+=n,++t);t>1&&(d+=e.c*(t-1))}else d=oze(ytt(Kj(Vi(Rne(e.a),new Ta),new _a)));return d>0?d+e.n.d+e.n.a:0}function cI(e){var t,n,r,s,o,h,d;if(d=0,e.b==0)d=oze(ytt(Kj(Vi(Rne(e.a),new Ms),new Pa)));else{for(h=vit(e,!0),t=0,r=h,s=0,o=r.length;s0&&(d+=n,++t);t>1&&(d+=e.c*(t-1))}return d>0?d+e.n.b+e.n.c:0}function udn(e,t){var n,r,s,o;for(o=u(_o(e.b,t),124),n=o.a,s=u(u(Ii(e.r,t),21),84).Kc();s.Ob();)r=u(s.Pb(),111),r.c&&(n.a=b.Math.max(n.a,kve(r.c)));if(n.a>0)switch(t.g){case 2:o.n.c=e.s;break;case 4:o.n.b=e.s}}function ldn(e,t){var n,r,s;return n=u(K(t,(a1(),Q7)),19).a-u(K(e,Q7),19).a,n==0?(r=da(fc(u(K(e,(zp(),fO)),8)),u(K(e,eS),8)),s=da(fc(u(K(t,fO),8)),u(K(t,eS),8)),Fs(r.a*r.b,s.a*s.b)):n}function hdn(e,t){var n,r,s;return n=u(K(t,(nw(),wV)),19).a-u(K(e,wV),19).a,n==0?(r=da(fc(u(K(e,(Tc(),PO)),8)),u(K(e,SS),8)),s=da(fc(u(K(t,PO),8)),u(K(t,SS),8)),Fs(r.a*r.b,s.a*s.b)):n}function Pat(e){var t,n;return n=new Tp,n.a+="e_",t=ysn(e),t!=null&&(n.a+=""+t),e.c&&e.d&&(Yr((n.a+=" ",n),zH(e.c)),Yr(Ec((n.a+="[",n),e.c.i),"]"),Yr((n.a+=Ioe,n),zH(e.d)),Yr(Ec((n.a+="[",n),e.d.i),"]")),n.a}function Bat(e){switch(e.g){case 0:return new UL;case 1:return new XJ;case 2:return new YJ;case 3:return new LR;default:throw J(new Ln("No implementation is available for the layout phase "+(e.f!=null?e.f:""+e.g)))}}function F4e(e,t,n,r,s){var o;switch(o=0,s.g){case 1:o=b.Math.max(0,t.b+e.b-(n.b+r));break;case 3:o=b.Math.max(0,-e.b-r);break;case 2:o=b.Math.max(0,-e.a-r);break;case 4:o=b.Math.max(0,t.a+e.a-(n.a+r))}return o}function fdn(e,t,n){var r,s,o,h,d;if(n)for(s=n.a.length,r=new W2(s),d=(r.b-r.a)*r.c<0?(Lp(),C2):new Op(r);d.Ob();)h=u(d.Pb(),19),o=E8(n,h.a),Jxe in o.a||zce in o.a?E2n(e,o,t):Lyn(e,o,t),XWt(u(er(e.b,i7(o)),79))}function j4e(e){var t,n;switch(e.b){case-1:return!0;case 0:return n=e.t,n>1||n==-1?(e.b=-1,!0):(t=$h(e),t&&(ho(),t.Cj()==Idt)?(e.b=-1,!0):(e.b=1,!1));default:case 1:return!1}}function ddn(e,t){var n,r,s,o,h;for(r=(!t.s&&(t.s=new at(ju,t,21,17)),t.s),o=null,s=0,h=r.i;s=0&&r=0?e._g(n,!0,!0):tw(e,s,!0),153)),u(r,215).ll(t);throw J(new Ln(i2+t.ne()+Oce))}function wdn(){t2e();var e;return v4t?u(p7((Ap(),rf),Uh),1939):(ui(Cb,new Uf),Jwn(),e=u(we(Uc((Ap(),rf),Uh),547)?Uc(rf,Uh):new yYe,547),v4t=!0,Yyn(e),e3n(e),Si((e2e(),BAe),e,new YZ),Oo(rf,Uh,e),e)}function mdn(e,t){var n,r,s,o;e.j=-1,Ll(e.e)?(n=e.i,o=e.i!=0,cD(e,t),r=new N0(e.e,3,e.c,null,t,n,o),s=t.Qk(e.e,e.c,null),s=gst(e,t,s),s?(s.Ei(r),s.Fi()):_i(e.e,r)):(cD(e,t),s=t.Qk(e.e,e.c,null),s&&s.Fi())}function ZH(e,t){var n,r,s;if(s=0,r=t[0],r>=e.length)return-1;for(n=(zr(r,e.length),e.charCodeAt(r));n>=48&&n<=57&&(s=s*10+(n-48),++r,!(r>=e.length));)n=(zr(r,e.length),e.charCodeAt(r));return r>t[0]?t[0]=r:s=-1,s}function ydn(e){var t,n,r,s,o;return s=u(e.a,19).a,o=u(e.b,19).a,n=s,r=o,t=b.Math.max(b.Math.abs(s),b.Math.abs(o)),s<=0&&s==o?(n=0,r=o-1):s==-t&&o!=t?(n=o,r=s,o>=0&&++n):(n=-o,r=s),new xa(ct(n),ct(r))}function kdn(e,t,n,r){var s,o,h,d,v,x;for(s=0;s=0&&x>=0&&v=e.i)throw J(new Do(qce+t+Eb+e.i));if(n>=e.i)throw J(new Do(Vce+n+Eb+e.i));return r=e.g[n],t!=n&&(t>16),t=r>>16&16,n=16-t,e=e>>t,r=e-256,t=r>>16&8,n+=t,e<<=t,r=e-dy,t=r>>16&4,n+=t,e<<=t,r=e-Ed,t=r>>16&2,n+=t,e<<=t,r=e>>14,t=r&~(r>>1),n+2-t)}function Edn(e){P6();var t,n,r,s;for(QG=new st,jue=new Mr,Fue=new st,t=(!e.a&&(e.a=new at(hs,e,10,11)),e.a),tyn(t),s=new rr(t);s.e!=s.i.gc();)r=u(pr(s),33),Yo(QG,r,0)==-1&&(n=new st,it(Fue,n),Krt(r,n));return Fue}function Tdn(e,t,n){var r,s,o,h;e.a=n.b.d,we(t,352)?(s=d4(u(t,79),!1,!1),o=iI(s),r=new Ba(e),Da(o,r),mI(o,s),t.We((bi(),Z4))!=null&&Da(u(t.We(Z4),74),r)):(h=u(t,470),h.Hg(h.Dg()+e.a.a),h.Ig(h.Eg()+e.a.b))}function Fat(e,t){var n,r,s,o,h,d,v,x;for(x=Ue(ft(K(t,(pt(),bS)))),v=e[0].n.a+e[0].o.a+e[0].d.c+x,d=1;d=0?n:(d=w_(da(new Pt(h.c+h.b/2,h.d+h.a/2),new Pt(o.c+o.b/2,o.d+o.a/2))),-(aut(o,h)-1)*d)}function Cdn(e,t,n){var r;ms(new vn(null,(!n.a&&(n.a=new at(os,n,6,6)),new mn(n.a,16))),new yqe(e,t)),ms(new vn(null,(!n.n&&(n.n=new at(Jo,n,1,7)),new mn(n.n,16))),new kqe(e,t)),r=u(Ft(n,(bi(),Z4)),74),r&&qme(r,e,t)}function tw(e,t,n){var r,s,o;if(o=v4((Yu(),Oa),e.Tg(),t),o)return ho(),u(o,66).Oj()||(o=F6(Po(Oa,o))),s=(r=e.Yg(o),u(r>=0?e._g(r,!0,!0):tw(e,o,!0),153)),u(s,215).hl(t,n);throw J(new Ln(i2+t.ne()+Oce))}function H4e(e,t,n,r){var s,o,h,d,v;if(s=e.d[t],s){if(o=s.g,v=s.i,r!=null){for(d=0;d=n&&(r=t,x=(v.c+v.a)/2,h=x-n,v.c<=x-n&&(s=new vne(v.c,h),Om(e,r++,s)),d=x+n,d<=v.a&&(o=new vne(d,v.a),jm(r,e.c.length),RT(e.c,r,o)))}function z4e(e){var t;if(!e.c&&e.g==null)e.d=e.si(e.f),Br(e,e.d),t=e.d;else{if(e.g==null)return!0;if(e.i==0)return!1;t=u(e.g[e.i-1],47)}return t==e.b&&null.km>=null.jm()?(tz(e),z4e(e)):t.Ob()}function Mdn(e,t,n){var r,s,o,h,d;if(d=n,!d&&(d=mve(new Ux,0)),kr(d,tft,1),alt(e.c,t),h=qwn(e.a,t),h.gc()==1)zut(u(h.Xb(0),37),d);else for(o=1/h.gc(),s=h.Kc();s.Ob();)r=u(s.Pb(),37),zut(r,Kc(d,o));FVt(e.a,h,t),qpn(t),ur(d)}function Hat(e){if(this.a=e,e.c.i.k==(zn(),Ls))this.c=e.c,this.d=u(K(e.c.i,(et(),vc)),61);else if(e.d.i.k==Ls)this.c=e.d,this.d=u(K(e.d.i,(et(),vc)),61);else throw J(new Ln("Edge "+e+" is not an external edge."))}function zat(e,t){var n,r,s;s=e.b,e.b=t,e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,3,s,e.b)),t?t!=e&&(au(e,t.zb),Qre(e,t.d),n=(r=t.c,r??t.zb),Jre(e,n==null||an(n,t.zb)?null:n)):(au(e,null),Qre(e,0),Jre(e,null))}function Gat(e){var t,n;if(e.f){for(;e.n=h)throw J(new Im(t,h));return s=n[t],h==1?r=null:(r=Me(kfe,Xce,415,h-1,0,1),Hc(n,0,r,0,t),o=h-t-1,o>0&&Hc(n,t+1,r,t,o)),s7(e,r),fat(e,t,s),s}function nk(){nk=pe,Gk=u(Te(He((Gpe(),Sc).qb),6),34),zk=u(Te(He(Sc.qb),3),34),Sfe=u(Te(He(Sc.qb),4),34),Afe=u(Te(He(Sc.qb),5),18),UH(Gk),UH(zk),UH(Sfe),UH(Afe),k4t=new Al(ie(re(ju,1),L4,170,0,[Gk,zk]))}function Wat(e,t){var n;this.d=new yT,this.b=t,this.e=new Io(t.qf()),n=e.u.Hc((ol(),JO)),e.u.Hc(Z0)?e.D?this.a=n&&!t.If():this.a=!0:e.u.Hc(m2)?n?this.a=!(t.zf().Kc().Ob()||t.Bf().Kc().Ob()):this.a=!1:this.a=!1}function Kat(e,t){var n,r,s,o;for(n=e.o.a,o=u(u(Ii(e.r,t),21),84).Kc();o.Ob();)s=u(o.Pb(),111),s.e.a=(r=s.b,r.Xe((bi(),kl))?r.Hf()==(ht(),Dn)?-r.rf().a-Ue(ft(r.We(kl))):n+Ue(ft(r.We(kl))):r.Hf()==(ht(),Dn)?-r.rf().a:n)}function Yat(e,t){var n,r,s,o;n=u(K(e,(pt(),Zl)),103),o=u(Ft(t,gE),61),s=u(K(e,bs),98),s!=(wa(),X1)&&s!=w2?o==(ht(),uc)&&(o=$5e(t,n),o==uc&&(o=Y6(n))):(r=Hut(t),r>0?o=Y6(n):o=zD(Y6(n))),So(t,gE,o)}function Ndn(e,t){var n,r,s,o,h;for(h=e.j,t.a!=t.b&&aa(h,new q5),s=h.c.length/2|0,r=0;r0&&bI(e,n,t),o):r.a!=null?(bI(e,t,n),-1):s.a!=null?(bI(e,n,t),1):0}function Xat(e,t){var n,r,s,o;e.ej()?(n=e.Vi(),o=e.fj(),++e.j,e.Hi(n,e.oi(n,t)),r=e.Zi(3,null,t,n,o),e.bj()?(s=e.cj(t,null),s?(s.Ei(r),s.Fi()):e.$i(r)):e.$i(r)):(lYe(e,t),e.bj()&&(s=e.cj(t,null),s&&s.Fi()))}function JH(e,t){var n,r,s,o,h;for(h=pu(e.e.Tg(),t),s=new X5,n=u(e.g,119),o=e.i;--o>=0;)r=n[o],h.rl(r.ak())&&Br(s,r);!jlt(e,s)&&Ll(e.e)&&Vx(e,t.$j()?jp(e,6,t,(hn(),bo),null,-1,!1):jp(e,t.Kj()?2:1,t,null,null,-1,!1))}function d7(){d7=pe;var e,t;for(yk=Me(D4,Qe,91,32,0,1),QC=Me(D4,Qe,91,32,0,1),e=1,t=0;t<=18;t++)yk[t]=WD(e),QC[t]=WD(A0(e,t)),e=ja(e,5);for(;th)||t.q&&(r=t.C,h=r.c.c.a-r.o.a/2,s=r.n.a-n,s>h)))}function Rdn(e,t){var n;kr(t,"Partition preprocessing",1),n=u(zl(Vi(ic(Vi(new vn(null,new mn(e.a,16)),new jY),new tB),new H5),eb(new vt,new Dt,new Hn,ie(re(yl,1),tt,132,0,[(F1(),Ql)]))),15),ms(n.Oc(),new nB),ur(t)}function Qat(e){fre();var t,n,r,s,o,h,d;for(n=new Z2,s=new C(e.e.b);s.a1?e.e*=Ue(e.a):e.f/=Ue(e.a),wan(e),Ecn(e),s2n(e),Ye(e.b,(K_(),XG),e.g)}function tot(e,t,n){var r,s,o,h,d,v;for(r=0,v=n,t||(r=n*(e.c.length-1),v*=-1),o=new C(e);o.a=0?(t||(t=new ST,r>0&&To(t,e.substr(0,r))),t.a+="\\",b8(t,n&Ss)):t&&b8(t,n&Ss);return t?t.a:e}function Udn(e){var t;if(!e.a)throw J(new Wo("IDataType class expected for layout option "+e.f));if(t=enn(e.a),t==null)throw J(new Wo("Couldn't create new instance of property '"+e.f+"'. "+Jft+(S0(cN),cN.k)+qxe));return u(t,414)}function Hse(e){var t,n,r,s,o;return o=e.eh(),o&&o.kh()&&(s=Up(e,o),s!=o)?(n=e.Vg(),r=(t=e.Vg(),t>=0?e.Qg(null):e.eh().ih(e,-1-t,null,null)),e.Rg(u(s,49),n),r&&r.Fi(),e.Lg()&&e.Mg()&&n>-1&&_i(e,new oa(e,9,n,o,s)),s):o}function aot(e){var t,n,r,s,o,h,d,v;for(h=0,o=e.f.e,r=0;r>5,s>=e.d)return e.e<0;if(n=e.a[s],t=1<<(t&31),e.e<0){if(r=_tt(e),s>16)),15).Xc(o),d0&&(!(Dp(e.a.c)&&t.n.d)&&!(s8(e.a.c)&&t.n.b)&&(t.g.d+=b.Math.max(0,r/2-.5)),!(Dp(e.a.c)&&t.n.a)&&!(s8(e.a.c)&&t.n.c)&&(t.g.a-=r-1))}function uot(e){var t,n,r,s,o;if(s=new st,o=nut(e,s),t=u(K(e,(et(),cl)),10),t)for(r=new C(t.j);r.a>t,o=e.m>>t|n<<22-t,s=e.l>>t|e.m<<22-t):t<44?(h=r?V0:0,o=n>>t-22,s=e.m>>t-22|n<<44-t):(h=r?V0:0,o=r?ml:0,s=n>>t-44),fu(s&ml,o&ml,h&V0)}function zse(e){var t,n,r,s,o,h;for(this.c=new st,this.d=e,r=gs,s=gs,t=Ds,n=Ds,h=ii(e,0);h.b!=h.d.c;)o=u(ri(h),8),r=b.Math.min(r,o.a),s=b.Math.min(s,o.b),t=b.Math.max(t,o.a),n=b.Math.max(n,o.b);this.a=new fh(r,s,t-r,n-s)}function fot(e,t){var n,r,s,o,h,d;for(o=new C(e.b);o.a0&&we(t,42)&&(e.a.qj(),x=u(t,42),v=x.cd(),o=v==null?0:Xi(v),h=Nbe(e.a,o),n=e.a.d[h],n)){for(r=u(n.g,367),_=n.i,d=0;d<_;++d)if(s=r[d],s.Sh()==o&&s.Fb(x))return dot(e,x),!0}return!1}function Jdn(e){var t,n,r,s;for(s=u(Ii(e.a,(c4(),_q)),15).Kc();s.Ob();)r=u(s.Pb(),101),n=(t=D6(r.k),t.Hc((ht(),An))?t.Hc($n)?t.Hc(xr)?t.Hc(Dn)?null:d2t:p2t:g2t:f2t),p8(e,r,n[0],(qv(),ww),0),p8(e,r,n[1],u2,1),p8(e,r,n[2],mw,1)}function e0n(e,t){var n,r;n=A2n(t),Cpn(e,t,n),wst(e.a,u(K(Ya(t.b),(et(),Lk)),230)),J2n(e),Shn(e,t),r=Me(Lr,Jr,25,t.b.j.c.length,15,1),Tae(e,t,(ht(),An),r,n),Tae(e,t,$n,r,n),Tae(e,t,xr,r,n),Tae(e,t,Dn,r,n),e.a=null,e.c=null,e.b=null}function Q4e(){Q4e=pe,yCe=(mH(),Rhe),eyt=new dn(Dxe,yCe),Zmt=new dn(Ixe,(Mn(),!0)),ct(-1),Ymt=new dn(Oxe,ct(-1)),ct(-1),Xmt=new dn(Nxe,ct(-1)),Jmt=new dn(Pxe,!1),tyt=new dn(Bxe,!0),Qmt=new dn(xce,!1),nyt=new dn(Rxe,-1)}function Z4e(e,t,n){switch(t){case 7:!e.e&&(e.e=new wn(ra,e,7,4)),_r(e.e),!e.e&&(e.e=new wn(ra,e,7,4)),fs(e.e,u(n,14));return;case 8:!e.d&&(e.d=new wn(ra,e,8,5)),_r(e.d),!e.d&&(e.d=new wn(ra,e,8,5)),fs(e.d,u(n,14));return}Y3e(e,t,n)}function J4e(e,t){var n,r,s,o,h;if(je(t)===je(e))return!0;if(!we(t,15)||(h=u(t,15),e.gc()!=h.gc()))return!1;for(o=h.Kc(),r=e.Kc();r.Ob();)if(n=r.Pb(),s=o.Pb(),!(je(n)===je(s)||n!=null&&Ci(n,s)))return!1;return!0}function t0n(e,t){var n,r,s,o;for(o=u(zl(ic(ic(new vn(null,new mn(t.b,16)),new kL),new KP),eb(new vt,new Dt,new Hn,ie(re(yl,1),tt,132,0,[(F1(),Ql)]))),15),o.Jc(new xL),n=0,s=o.Kc();s.Ob();)r=u(s.Pb(),11),r.p==-1&&t5e(e,r,n++)}function got(e){switch(e.g){case 0:return new sT;case 1:return new WJ;case 2:return new UJ;case 3:return new Bqe;case 4:return new EKe;default:throw J(new Ln("No implementation is available for the node placer "+(e.f!=null?e.f:""+e.g)))}}function pot(e){switch(e.g){case 0:return new Ive;case 1:return new KJ;case 2:return new $J;case 3:return new HJ;case 4:return new Fqe;default:throw J(new Ln("No implementation is available for the cycle breaker "+(e.f!=null?e.f:""+e.g)))}}function e5e(){e5e=pe,Pmt=new dn(_xe,ct(0)),Bmt=new dn(Cxe,0),nCe=(RD(),yV),Omt=new dn(mce,nCe),ct(0),Imt=new dn(yce,ct(1)),iCe=(rH(),Bhe),Rmt=new dn(Sxe,iCe),sCe=(L$(),Ihe),Fmt=new dn(Axe,sCe),rCe=(jH(),Phe),Nmt=new dn(Lxe,rCe)}function n0n(e,t,n){var r;r=null,t&&(r=t.d),eC(e,new r8(t.n.a-r.b+n.a,t.n.b-r.d+n.b)),eC(e,new r8(t.n.a-r.b+n.a,t.n.b+t.o.b+r.a+n.b)),eC(e,new r8(t.n.a+t.o.a+r.c+n.a,t.n.b-r.d+n.b)),eC(e,new r8(t.n.a+t.o.a+r.c+n.a,t.n.b+t.o.b+r.a+n.b))}function t5e(e,t,n){var r,s,o;for(t.p=n,o=Pp(B1(ie(re(q1,1),yt,20,0,[new sa(t),new Ar(t)])));Vr(o);)r=u(Pr(o),11),r.p==-1&&t5e(e,r,n);if(t.i.k==(zn(),ca))for(s=new C(t.i.j);s.a=2)for(n=s.Kc(),t=ft(n.Pb());n.Ob();)o=t,t=ft(n.Pb()),r=b.Math.min(r,(Sn(t),t-(Sn(o),o)));return r}function r0n(e,t){var n,r,s,o,h;r=new as,ks(r,t,r.c.b,r.c);do for(n=(Qn(r.b!=0),u(bh(r,r.a.a),86)),e.b[n.g]=1,o=ii(n.d,0);o.b!=o.d.c;)s=u(ri(o),188),h=s.c,e.b[h.g]==1?ci(e.a,s):e.b[h.g]==2?e.b[h.g]=1:ks(r,h,r.c.b,r.c);while(r.b!=0)}function i0n(e,t){var n,r,s;if(je(t)===je(Nr(e)))return!0;if(!we(t,15)||(r=u(t,15),s=e.gc(),s!=r.gc()))return!1;if(we(r,54)){for(n=0;n0&&(s=n),h=new C(e.f.e);h.a0?(t-=1,n-=1):r>=0&&s<0?(t+=1,n+=1):r>0&&s>=0?(t-=1,n+=1):(t+=1,n-=1),new xa(ct(t),ct(n))}function x0n(e,t){return e.ct.c?1:e.bt.b?1:e.a!=t.a?Xi(e.a)-Xi(t.a):e.d==(S_(),TS)&&t.d==ES?-1:e.d==ES&&t.d==TS?1:0}function mot(e,t){var n,r,s,o,h;return o=t.a,o.c.i==t.b?h=o.d:h=o.c,o.c.i==t.b?r=o.c:r=o.d,s=Xon(e.a,h,r),s>0&&s0):s<0&&-s0):!1}function E0n(e,t,n,r){var s,o,h,d,v,x,_,L;for(s=(t-e.d)/e.c.c.length,o=0,e.a+=n,e.d=t,L=new C(e.c);L.a>24;return h}function _0n(e){if(e.pe()){var t=e.c;t.qe()?e.o="["+t.n:t.pe()?e.o="["+t.ne():e.o="[L"+t.ne()+";",e.b=t.me()+"[]",e.k=t.oe()+"[]";return}var n=e.j,r=e.d;r=r.split("/"),e.o=Uie(".",[n,Uie("$",r)]),e.b=Uie(".",[n,Uie(".",r)]),e.k=r[r.length-1]}function C0n(e,t){var n,r,s,o,h;for(h=null,o=new C(e.e.a);o.a=0;t-=2)for(n=0;n<=t;n+=2)(e.b[n]>e.b[n+2]||e.b[n]===e.b[n+2]&&e.b[n+1]>e.b[n+3])&&(r=e.b[n+2],e.b[n+2]=e.b[n],e.b[n]=r,r=e.b[n+3],e.b[n+3]=e.b[n+1],e.b[n+1]=r);e.c=!0}}function yot(e,t){var n,r,s,o,h,d,v,x;for(h=t==1?Kue:Wue,o=h.a.ec().Kc();o.Ob();)for(s=u(o.Pb(),103),v=u(Ii(e.f.c,s),21).Kc();v.Ob();)switch(d=u(v.Pb(),46),r=u(d.b,81),x=u(d.a,189),n=x.c,s.g){case 2:case 1:r.g.d+=n;break;case 4:case 3:r.g.c+=n}}function L0n(e,t){var n,r,s,o,h,d,v,x,_;for(x=-1,_=0,h=e,d=0,v=h.length;d0&&++_;++x}return _}function _f(e){var t,n;return n=new Fl(Cp(e.gm)),n.a+="@",Yr(n,(t=Xi(e)>>>0,t.toString(16))),e.kh()?(n.a+=" (eProxyURI: ",Ec(n,e.qh()),e.$g()&&(n.a+=" eClass: ",Ec(n,e.$g())),n.a+=")"):e.$g()&&(n.a+=" (eClass: ",Ec(n,e.$g()),n.a+=")"),n.a}function sC(e){var t,n,r,s;if(e.e)throw J(new Wo((S0(Sue),doe+Sue.k+goe)));for(e.d==(wo(),f0)&&kz(e,Xh),n=new C(e.a.a);n.a>24}return n}function I0n(e,t,n){var r,s,o;if(s=u(_o(e.i,t),306),!s)if(s=new yet(e.d,t,n),M6(e.i,t,s),h3e(t))KWt(e.a,t.c,t.b,s);else switch(o=m1n(t),r=u(_o(e.p,o),244),o.g){case 1:case 3:s.j=!0,Zee(r,t.b,s);break;case 4:case 2:s.k=!0,Zee(r,t.c,s)}return s}function O0n(e,t,n,r){var s,o,h,d,v,x;if(d=new X5,v=pu(e.e.Tg(),t),s=u(e.g,119),ho(),u(t,66).Oj())for(h=0;h=0)return s;for(o=1,d=new C(t.j);d.a0&&t.ue((xn(s-1,e.c.length),u(e.c[s-1],10)),o)>0;)gh(e,s,(xn(s-1,e.c.length),u(e.c[s-1],10))),--s;xn(s,e.c.length),e.c[s]=o}n.a=new Mr,n.b=new Mr}function N0n(e,t,n){var r,s,o,h,d,v,x,_;for(_=(r=u(t.e&&t.e(),9),new hh(r,u(wf(r,r.length),9),0)),v=cy(n,"[\\[\\]\\s,]+"),o=v,h=0,d=o.length;h0&&(!(Dp(e.a.c)&&t.n.d)&&!(s8(e.a.c)&&t.n.b)&&(t.g.d-=b.Math.max(0,r/2-.5)),!(Dp(e.a.c)&&t.n.a)&&!(s8(e.a.c)&&t.n.c)&&(t.g.a+=b.Math.max(0,r-1)))}function _ot(e,t,n){var r,s;if((e.c-e.b&e.a.length-1)==2)t==(ht(),An)||t==$n?($$(u(F_(e),15),(Ul(),d0)),$$(u(F_(e),15),b2)):($$(u(F_(e),15),(Ul(),b2)),$$(u(F_(e),15),d0));else for(s=new y_(e);s.a!=s.b;)r=u(gH(s),15),$$(r,n)}function B0n(e,t){var n,r,s,o,h,d,v;for(s=l8(new tpe(e)),d=new Ea(s,s.c.length),o=l8(new tpe(t)),v=new Ea(o,o.c.length),h=null;d.b>0&&v.b>0&&(n=(Qn(d.b>0),u(d.a.Xb(d.c=--d.b),33)),r=(Qn(v.b>0),u(v.a.Xb(v.c=--v.b),33)),n==r);)h=n;return h}function vl(e,t){var n,r,s,o,h,d;return o=e.a*uoe+e.b*1502,d=e.b*uoe+11,n=b.Math.floor(d*NI),o+=n,d-=n*x6e,o%=x6e,e.a=o,e.b=d,t<=24?b.Math.floor(e.a*c7e[t]):(s=e.a*(1<=2147483648&&(r-=soe),r)}function Cot(e,t,n){var r,s,o,h;KXe(e,t)>KXe(e,n)?(r=ac(n,(ht(),$n)),e.d=r.dc()?0:xne(u(r.Xb(0),11)),h=ac(t,Dn),e.b=h.dc()?0:xne(u(h.Xb(0),11))):(s=ac(n,(ht(),Dn)),e.d=s.dc()?0:xne(u(s.Xb(0),11)),o=ac(t,$n),e.b=o.dc()?0:xne(u(o.Xb(0),11)))}function Sot(e){var t,n,r,s,o,h,d;if(e&&(t=e.Hh(Uh),t&&(h=Hr(r1((!t.b&&(t.b=new Ml((on(),oo),wc,t)),t.b),"conversionDelegates")),h!=null))){for(d=new st,r=cy(h,"\\w+"),s=0,o=r.length;se.c));h++)s.a>=e.s&&(o<0&&(o=h),d=h);return v=(e.s+e.c)/2,o>=0&&(r=m2n(e,t,o,d),v=AUt((xn(r,t.c.length),u(t.c[r],329))),Ldn(t,r,n)),v}function Vse(){Vse=pe,ryt=new fo((bi(),Bk),1.3),xCe=xSe,LCe=new kv(15),lyt=new fo(Fb,LCe),fyt=new fo(jb,15),iyt=IV,oyt=Rb,cyt=e5,uyt=p2,ayt=J4,CCe=KO,hyt=Hy,ACe=(Q4e(),eyt),_Ce=Zmt,SCe=Jmt,MCe=tyt,ECe=Qmt,TCe=OV,syt=TSe,RO=Xmt,kCe=Ymt,DCe=nyt}function Rr(e,t,n){var r,s,o,h,d,v,x;for(h=(o=new KB,o),Fme(h,(Sn(t),t)),x=(!h.b&&(h.b=new Ml((on(),oo),wc,h)),h.b),v=1;v0&&fwn(this,s)}function i5e(e,t,n,r,s,o){var h,d,v;if(!s[t.b]){for(s[t.b]=!0,h=r,!h&&(h=new k$),it(h.e,t),v=o[t.b].Kc();v.Ob();)d=u(v.Pb(),282),!(d.d==n||d.c==n)&&(d.c!=t&&i5e(e,d.c,t,h,s,o),d.d!=t&&i5e(e,d.d,t,h,s,o),it(h.c,d),Rs(h.d,d.b));return h}return null}function j0n(e){var t,n,r,s,o,h,d;for(t=0,s=new C(e.e);s.a=2}function $0n(e,t){var n,r,s,o;for(kr(t,"Self-Loop pre-processing",1),r=new C(e.a);r.a1||(t=Ui(If,ie(re(xo,1),tt,93,0,[Q0,Of])),SD(a$(t,e))>1)||(r=Ui(Pf,ie(re(xo,1),tt,93,0,[g0,Zh])),SD(a$(r,e))>1))}function G0n(e,t){var n,r,s;return n=t.Hh(e.a),n&&(s=Hr(r1((!n.b&&(n.b=new Ml((on(),oo),wc,n)),n.b),"affiliation")),s!=null)?(r=cj(s,Nu(35)),r==-1?Iie(e,f_(e,Gl(t.Hj())),s):r==0?Iie(e,null,s.substr(1)):Iie(e,s.substr(0,r),s.substr(r+1))):null}function q0n(e){var t,n,r;try{return e==null?Pu:Qo(e)}catch(s){if(s=ts(s),we(s,102))return t=s,r=Cp(pl(e))+"@"+(n=(Ud(),v3e(e)>>>0),n.toString(16)),Icn(Dsn(),(n8(),"Exception during lenientFormat for "+r),t),"<"+r+" threw "+Cp(t.gm)+">";throw J(s)}}function Mot(e){switch(e.g){case 0:return new GJ;case 1:return new CR;case 2:return new MGe;case 3:return new DL;case 4:return new QUe;case 5:return new qJ;default:throw J(new Ln("No implementation is available for the layerer "+(e.f!=null?e.f:""+e.g)))}}function s5e(e,t,n){var r,s,o;for(o=new C(e.t);o.a0&&(r.b.n-=r.c,r.b.n<=0&&r.b.u>0&&ci(t,r.b));for(s=new C(e.i);s.a0&&(r.a.u-=r.c,r.a.u<=0&&r.a.n>0&&ci(n,r.a))}function tz(e){var t,n,r,s,o;if(e.g==null&&(e.d=e.si(e.f),Br(e,e.d),e.c))return o=e.f,o;if(t=u(e.g[e.i-1],47),s=t.Pb(),e.e=t,n=e.si(s),n.Ob())e.d=n,Br(e,n);else for(e.d=null;!t.Ob()&&(cs(e.g,--e.i,null),e.i!=0);)r=u(e.g[e.i-1],47),t=r;return s}function V0n(e,t){var n,r,s,o,h,d;if(r=t,s=r.ak(),G0(e.e,s)){if(s.hi()&&v$(e,s,r.dd()))return!1}else for(d=pu(e.e.Tg(),s),n=u(e.g,119),o=0;o1||n>1)return 2;return t+n==1?2:0}function Iot(e,t,n){var r,s,o,h,d;for(kr(n,"ELK Force",1),It(Mt(Ft(t,(a1(),Q7e))))||i$((r=new sr((Tm(),new ym(t))),r)),d=cnt(t),bln(d),Ysn(e,u(K(d,X7e),424)),h=kut(e.a,d),o=h.Kc();o.Ob();)s=u(o.Pb(),231),D2n(e.b,s,Kc(n,1/h.gc()));d=Nlt(h),Dlt(d),ur(n)}function Z0n(e,t){var n,r,s,o,h;if(kr(t,"Breaking Point Processor",1),wmn(e),It(Mt(K(e,(pt(),i_e))))){for(s=new C(e.b);s.a=0?e._g(r,!0,!0):tw(e,o,!0),153)),u(s,215).ml(t,n)}else throw J(new Ln(i2+t.ne()+RC))}function ngn(e,t){var n,r,s,o,h;for(n=new st,s=ic(new vn(null,new mn(e,16)),new $Q),o=ic(new vn(null,new mn(e,16)),new HQ),h=Lrn(qnn(Kj(Pgn(ie(re(h3n,1),yt,833,0,[s,o])),new zQ))),r=1;r=2*t&&it(n,new vne(h[r-1]+t,h[r]-t));return n}function rgn(e,t,n){kr(n,"Eades radial",1),n.n&&t&&yf(n,kf(t),(Pl(),nh)),e.d=u(Ft(t,(a_(),MS)),33),e.c=Ue(ft(Ft(t,(Jm(),xV)))),e.e=tse(u(Ft(t,BO),293)),e.a=Bon(u(Ft(t,cCe),426)),e.b=ihn(u(Ft(t,oCe),340)),Fln(e),n.n&&t&&yf(n,kf(t),(Pl(),nh))}function ign(e,t,n){var r,s,o,h,d,v,x,_;if(n)for(o=n.a.length,r=new W2(o),d=(r.b-r.a)*r.c<0?(Lp(),C2):new Op(r);d.Ob();)h=u(d.Pb(),19),s=E8(n,h.a),s&&(v=nnn(e,(x=(pv(),_=new xpe,_),t&&c5e(x,t),x),s),I_(v,D0(s,Id)),KH(s,v),I4e(s,v),pie(e,s,v))}function rz(e){var t,n,r,s,o,h;if(!e.j){if(h=new H9,t=XS,o=t.a.zc(e,t),o==null){for(r=new rr(jo(e));r.e!=r.i.gc();)n=u(pr(r),26),s=rz(n),fs(h,s),Br(h,n);t.a.Bc(e)!=null}Km(h),e.j=new B3((u(Te(He((Rp(),En).o),11),18),h.i),h.g),dl(e).b&=-33}return e.j}function sgn(e){var t,n,r,s;if(e==null)return null;if(r=Xc(e,!0),s=tO.length,an(r.substr(r.length-s,s),tO)){if(n=r.length,n==4){if(t=(zr(0,r.length),r.charCodeAt(0)),t==43)return nLe;if(t==45)return F4t}else if(n==3)return nLe}return new hpe(r)}function agn(e){var t,n,r;return n=e.l,n&n-1||(r=e.m,r&r-1)||(t=e.h,t&t-1)||t==0&&r==0&&n==0?-1:t==0&&r==0&&n!=0?Dme(n):t==0&&r!=0&&n==0?Dme(r)+22:t!=0&&r==0&&n==0?Dme(t)+44:-1}function ogn(e,t){var n,r,s,o,h;for(kr(t,"Edge joining",1),n=It(Mt(K(e,(pt(),Jle)))),s=new C(e.b);s.a1)for(s=new C(e.a);s.a0),o.a.Xb(o.c=--o.b),Dm(o,s),Qn(o.b3&&e0(e,0,t-3))}function hgn(e){var t,n,r,s;return je(K(e,(pt(),Iy)))===je((F0(),Wg))?!e.e&&je(K(e,_O))!==je((q8(),wO)):(r=u(K(e,Hle),292),s=It(Mt(K(e,zle)))||je(K(e,dS))===je((V6(),vO)),t=u(K(e,kTe),19).a,n=e.a.c.length,!s&&r!=(q8(),wO)&&(t==0||t>n))}function fgn(e){var t,n;for(n=0;n0);n++);if(n>0&&n0);t++);return t>0&&n>16!=6&&t){if(o7(e,t))throw J(new Ln(FC+Zat(e)));r=null,e.Cb&&(r=(n=e.Db>>16,n>=0?N3e(e,r):e.Cb.ih(e,-1-n,null,r))),t&&(r=Q6(t,e,6,r)),r=Ibe(e,t,r),r&&r.Fi()}else e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,6,t,t))}function c5e(e,t){var n,r;if(t!=e.Cb||e.Db>>16!=9&&t){if(o7(e,t))throw J(new Ln(FC+Nct(e)));r=null,e.Cb&&(r=(n=e.Db>>16,n>=0?B3e(e,r):e.Cb.ih(e,-1-n,null,r))),t&&(r=Q6(t,e,9,r)),r=Obe(e,t,r),r&&r.Fi()}else e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,9,t,t))}function Wse(e,t){var n,r;if(t!=e.Cb||e.Db>>16!=3&&t){if(o7(e,t))throw J(new Ln(FC+Out(e)));r=null,e.Cb&&(r=(n=e.Db>>16,n>=0?F3e(e,r):e.Cb.ih(e,-1-n,null,r))),t&&(r=Q6(t,e,12,r)),r=Dbe(e,t,r),r&&r.Fi()}else e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,3,t,t))}function b7(e){var t,n,r,s,o;if(r=$h(e),o=e.j,o==null&&r)return e.$j()?null:r.zj();if(we(r,148)){if(n=r.Aj(),n&&(s=n.Nh(),s!=e.i)){if(t=u(r,148),t.Ej())try{e.g=s.Kh(t,o)}catch(h){if(h=ts(h),we(h,78))e.g=null;else throw J(h)}e.i=s}return e.g}return null}function Pot(e){var t;return t=new st,it(t,new y6(new Pt(e.c,e.d),new Pt(e.c+e.b,e.d))),it(t,new y6(new Pt(e.c,e.d),new Pt(e.c,e.d+e.a))),it(t,new y6(new Pt(e.c+e.b,e.d+e.a),new Pt(e.c+e.b,e.d))),it(t,new y6(new Pt(e.c+e.b,e.d+e.a),new Pt(e.c,e.d+e.a))),t}function Bot(e,t,n,r){var s,o,h;if(h=U3e(t,n),r.c[r.c.length]=t,e.j[h.p]==-1||e.j[h.p]==2||e.a[t.p])return r;for(e.j[h.p]=-1,o=new cr(fr(j0(h).a.Kc(),new V));Vr(o);)if(s=u(Pr(o),17),!(!(!to(s)&&!(!to(s)&&s.c.i.c==s.d.i.c))||s==t))return Bot(e,s,h,r);return r}function dgn(e,t,n){var r,s,o;for(o=t.a.ec().Kc();o.Ob();)s=u(o.Pb(),79),r=u(er(e.b,s),266),!r&&(us(n0(s))==us(Kp(s))?Apn(e,s,n):n0(s)==us(Kp(s))?er(e.c,s)==null&&er(e.b,Kp(s))!=null&&plt(e,s,n,!1):er(e.d,s)==null&&er(e.b,n0(s))!=null&&plt(e,s,n,!0))}function ggn(e,t){var n,r,s,o,h,d,v;for(s=e.Kc();s.Ob();)for(r=u(s.Pb(),10),d=new $c,rc(d,r),Vs(d,(ht(),$n)),Ye(d,(et(),$q),(Mn(),!0)),h=t.Kc();h.Ob();)o=u(h.Pb(),10),v=new $c,rc(v,o),Vs(v,Dn),Ye(v,$q,!0),n=new Iv,Ye(n,$q,!0),Va(n,d),ba(n,v)}function pgn(e,t,n,r){var s,o,h,d;s=Drt(e,t,n),o=Drt(e,n,t),h=u(er(e.c,t),112),d=u(er(e.c,n),112),sr.b.g&&(o.c[o.c.length]=r);return o}function v7(){v7=pe,X4=new _M("CANDIDATE_POSITION_LAST_PLACED_RIGHT",0),Nk=new _M("CANDIDATE_POSITION_LAST_PLACED_BELOW",1),IS=new _M("CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT",2),DS=new _M("CANDIDATE_POSITION_WHOLE_DRAWING_BELOW",3),OS=new _M("WHOLE_DRAWING",4)}function bgn(e,t){if(we(t,239))return Uan(e,u(t,33));if(we(t,186))return son(e,u(t,118));if(we(t,354))return wJt(e,u(t,137));if(we(t,352))return zbn(e,u(t,79));if(t)return null;throw J(new Ln(a8e+Yp(new Al(ie(re(Yn,1),yt,1,5,[t])))))}function vgn(e){var t,n,r,s,o,h,d;for(o=new as,s=new C(e.d.a);s.a1)for(t=Ev((n=new z2,++e.b,n),e.d),d=ii(o,0);d.b!=d.d.c;)h=u(ri(d),121),Cf(bf(pf(vf(gf(new Nh,1),0),t),h))}function u5e(e,t){var n,r;if(t!=e.Cb||e.Db>>16!=11&&t){if(o7(e,t))throw J(new Ln(FC+S5e(e)));r=null,e.Cb&&(r=(n=e.Db>>16,n>=0?j3e(e,r):e.Cb.ih(e,-1-n,null,r))),t&&(r=Q6(t,e,10,r)),r=Hbe(e,t,r),r&&r.Fi()}else e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,11,t,t))}function wgn(e){var t,n,r,s;for(r=new ob(new dg(e.b).a);r.b;)n=$v(r),s=u(n.cd(),11),t=u(n.dd(),10),Ye(t,(et(),Mi),s),Ye(s,cl,t),Ye(s,kO,(Mn(),!0)),Vs(s,u(K(t,vc),61)),K(t,vc),Ye(s.i,(pt(),bs),(wa(),CE)),u(K(Ya(s.i),eu),21).Fc((mo(),uE))}function mgn(e,t,n){var r,s,o,h,d,v;if(o=0,h=0,e.c)for(v=new C(e.d.i.j);v.ao.a?-1:s.av){for(_=e.d,e.d=Me(SAe,p8e,63,2*v+4,0,1),o=0;o=9223372036854776e3?(D8(),B8e):(s=!1,e<0&&(s=!0,e=-e),r=0,e>=vb&&(r=_s(e/vb),e-=r*vb),n=0,e>=ck&&(n=_s(e/ck),e-=n*ck),t=_s(e),o=fu(t,n,r),s&&gie(o),o)}function Lgn(e,t){var n,r,s,o;for(n=!t||!e.u.Hc((ol(),Z0)),o=0,s=new C(e.e.Cf());s.a=-t&&r==t?new xa(ct(n-1),ct(r)):new xa(ct(n),ct(r-1))}function Hot(){return po(),ie(re(m3n,1),tt,77,0,[MEe,SEe,tS,ele,YEe,uq,mq,eE,WEe,FEe,VEe,J7,KEe,PEe,XEe,kEe,dq,tle,oq,bq,ZEe,pq,xEe,UEe,JEe,vq,QEe,cq,IEe,GEe,zEe,yq,_Ee,aq,hq,TEe,Z7,$Ee,BEe,qEe,nS,AEe,CEe,HEe,REe,fq,wq,EEe,gq,jEe,lq,OEe,DEe,pO,sq,NEe,LEe])}function Ogn(e,t,n){e.d=0,e.b=0,t.k==(zn(),Jc)&&n.k==Jc&&u(K(t,(et(),Mi)),10)==u(K(n,Mi),10)&&(Hre(t).j==(ht(),An)?Cot(e,t,n):Cot(e,n,t)),t.k==Jc&&n.k==ca?Hre(t).j==(ht(),An)?e.d=1:e.b=1:n.k==Jc&&t.k==ca&&(Hre(n).j==(ht(),An)?e.b=1:e.d=1),yun(e,t,n)}function Ngn(e){var t,n,r,s,o,h,d,v,x,_,L;return L=c4e(e),t=e.a,v=t!=null,v&&f8(L,"category",e.a),s=hM(new vm(e.d)),h=!s,h&&(x=new hg,t1(L,"knownOptions",x),n=new S$e(x),Da(new vm(e.d),n)),o=hM(e.g),d=!o,d&&(_=new hg,t1(L,"supportedFeatures",_),r=new A$e(_),Da(e.g,r)),L}function Pgn(e){var t,n,r,s,o,h,d,v,x;for(r=!1,t=336,n=0,o=new HUe(e.length),d=e,v=0,x=d.length;v>16!=7&&t){if(o7(e,t))throw J(new Ln(FC+Kst(e)));r=null,e.Cb&&(r=(n=e.Db>>16,n>=0?P3e(e,r):e.Cb.ih(e,-1-n,null,r))),t&&(r=u(t,49).gh(e,1,iN,r)),r=Ove(e,t,r),r&&r.Fi()}else e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,7,t,t))}function zot(e,t){var n,r;if(t!=e.Cb||e.Db>>16!=3&&t){if(o7(e,t))throw J(new Ln(FC+rrt(e)));r=null,e.Cb&&(r=(n=e.Db>>16,n>=0?R3e(e,r):e.Cb.ih(e,-1-n,null,r))),t&&(r=u(t,49).gh(e,0,aN,r)),r=Nve(e,t,r),r&&r.Fi()}else e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,3,t,t))}function Yse(e,t){d7();var n,r,s,o,h,d,v,x,_;return t.d>e.d&&(d=e,e=t,t=d),t.d<63?_pn(e,t):(h=(e.d&-2)<<4,x=Wwe(e,h),_=Wwe(t,h),r=hae(e,$6(x,h)),s=hae(t,$6(_,h)),v=Yse(x,_),n=Yse(r,s),o=Yse(hae(x,r),hae(s,_)),o=mae(mae(o,v),n),o=$6(o,h),v=$6(v,h<<1),mae(mae(v,o),n))}function Rgn(e,t,n){var r,s,o,h,d;for(h=H_(e,n),d=Me(h0,Bg,10,t.length,0,1),r=0,o=h.Kc();o.Ob();)s=u(o.Pb(),11),It(Mt(K(s,(et(),kO))))&&(d[r++]=u(K(s,cl),10));if(r=0;o+=n?1:-1)h=h|t.c.Sf(v,o,n,r&&!It(Mt(K(t.j,(et(),kw))))&&!It(Mt(K(t.j,(et(),z4))))),h=h|t.q._f(v,o,n),h=h|Sct(e,v[o],n,r);return Gs(e.c,t),h}function sz(e,t,n){var r,s,o,h,d,v,x,_,L,P;for(_=TQe(e.j),L=0,P=_.length;L1&&(e.a=!0),JQt(u(n.b,65),Ni(fc(u(t.b,65).c),bd(da(fc(u(n.b,65).a),u(t.b,65).a),s))),FXe(e,t),Got(e,n)}function qot(e){var t,n,r,s,o,h,d;for(o=new C(e.a.a);o.a0&&o>0?h.p=t++:r>0?h.p=n++:o>0?h.p=s++:h.p=n++}hn(),aa(e.j,new _L)}function zgn(e){var t,n;n=null,t=u(St(e.g,0),17);do{if(n=t.d.i,ta(n,(et(),Yh)))return u(K(n,Yh),11).i;if(n.k!=(zn(),Hs)&&Vr(new cr(fr(js(n).a.Kc(),new V))))t=u(Pr(new cr(fr(js(n).a.Kc(),new V))),17);else if(n.k!=Hs)return null}while(n&&n.k!=(zn(),Hs));return n}function Ggn(e,t){var n,r,s,o,h,d,v,x,_;for(d=t.j,h=t.g,v=u(St(d,d.c.length-1),113),_=(xn(0,d.c.length),u(d.c[0],113)),x=gse(e,h,v,_),o=1;ox&&(v=n,_=s,x=r);t.a=_,t.c=v}function qgn(e,t){var n,r;if(r=KM(e.b,t.b),!r)throw J(new Wo("Invalid hitboxes for scanline constraint calculation."));(Qtt(t.b,u(qKt(e.b,t.b),57))||Qtt(t.b,u(GKt(e.b,t.b),57)))&&(Ud(),t.b+""),e.a[t.b.f]=u(hne(e.b,t.b),57),n=u(lne(e.b,t.b),57),n&&(e.a[n.f]=t.b)}function Cf(e){if(!e.a.d||!e.a.e)throw J(new Wo((S0(sgt),sgt.k+" must have a source and target "+(S0(R7e),R7e.k)+" specified.")));if(e.a.d==e.a.e)throw J(new Wo("Network simplex does not support self-loops: "+e.a+" "+e.a.d+" "+e.a.e));return lj(e.a.d.g,e.a),lj(e.a.e.b,e.a),e.a}function Vgn(e,t,n){var r,s,o,h,d,v,x;for(x=new Sp(new Cje(e)),h=ie(re(Upt,1),ift,11,0,[t,n]),d=0,v=h.length;dv-e.b&&dv-e.a&&d0&&++z;++P}return z}function tpn(e,t){var n,r,s,o,h;for(h=u(K(t,(nw(),q_e)),425),o=ii(t.b,0);o.b!=o.d.c;)if(s=u(ri(o),86),e.b[s.g]==0){switch(h.g){case 0:wit(e,s);break;case 1:r0n(e,s)}e.b[s.g]=2}for(r=ii(e.a,0);r.b!=r.d.c;)n=u(ri(r),188),Xm(n.b.d,n,!0),Xm(n.c.b,n,!0);Ye(t,(Tc(),R_e),e.a)}function pu(e,t){ho();var n,r,s,o;return t?t==(Fi(),B4t)||(t==T4t||t==zb||t==E4t)&&e!=eLe?new s6e(e,t):(r=u(t,677),n=r.pk(),n||(m8(Po((Yu(),Oa),t)),n=r.pk()),o=(!n.i&&(n.i=new Mr),n.i),s=u(hc($o(o.f,e)),1942),!s&&Si(o,e,s=new s6e(e,t)),s):y4t}function npn(e,t){var n,r,s,o,h,d,v,x,_;for(v=u(K(e,(et(),Mi)),11),x=sc(ie(re(na,1),Qe,8,0,[v.i.n,v.n,v.a])).a,_=e.i.n.b,n=kd(e.e),s=n,o=0,h=s.length;o0?o.a?(d=o.b.rf().a,n>d&&(s=(n-d)/2,o.d.b=s,o.d.c=s)):o.d.c=e.s+n:g_(e.u)&&(r=u4e(o.b),r.c<0&&(o.d.b=-r.c),r.c+r.b>o.b.rf().a&&(o.d.c=r.c+r.b-o.b.rf().a))}function apn(e,t){var n,r,s,o;for(kr(t,"Semi-Interactive Crossing Minimization Processor",1),n=!1,s=new C(e.b);s.a=0){if(t==n)return new xa(ct(-t-1),ct(-t-1));if(t==-n)return new xa(ct(-t),ct(n+1))}return b.Math.abs(t)>b.Math.abs(n)?t<0?new xa(ct(-t),ct(n)):new xa(ct(-t),ct(n+1)):new xa(ct(t+1),ct(n))}function upn(e){var t,n;n=u(K(e,(pt(),vu)),163),t=u(K(e,(et(),Lb)),303),n==(mh(),l2)?(Ye(e,vu,TO),Ye(e,Lb,(P0(),$4))):n==Ly?(Ye(e,vu,TO),Ye(e,Lb,(P0(),Tk))):t==(P0(),$4)?(Ye(e,vu,l2),Ye(e,Lb,mO)):t==Tk&&(Ye(e,vu,Ly),Ye(e,Lb,mO))}function az(){az=pe,OO=new SQ,Vwt=xi(new Xs,(ro(),bu),(po(),oq)),Kwt=il(xi(new Xs,bu,pq),Go,gq),Ywt=Qv(Qv(AF(il(xi(new Xs,Pd,mq),Go,wq),Zc),vq),yq),Uwt=il(xi(xi(xi(new Xs,c2,uq),Zc,hq),Zc,Z7),Go,lq),Wwt=il(xi(xi(new Xs,Zc,Z7),Zc,aq),Go,sq)}function aC(){aC=pe,Zwt=xi(il(new Xs,(ro(),Go),(po(),OEe)),bu,oq),nmt=Qv(Qv(AF(il(xi(new Xs,Pd,mq),Go,wq),Zc),vq),yq),Jwt=il(xi(xi(xi(new Xs,c2,uq),Zc,hq),Zc,Z7),Go,lq),tmt=xi(xi(new Xs,bu,pq),Go,gq),emt=il(xi(xi(new Xs,Zc,Z7),Zc,aq),Go,sq)}function lpn(e,t,n,r,s){var o,h;(!to(t)&&t.c.i.c==t.d.i.c||!stt(sc(ie(re(na,1),Qe,8,0,[s.i.n,s.n,s.a])),n))&&!to(t)&&(t.c==s?c8(t.a,0,new Io(n)):ci(t.a,new Io(n)),r&&!_0(e.a,n)&&(h=u(K(t,(pt(),Fo)),74),h||(h=new Gu,Ye(t,Fo,h)),o=new Io(n),ks(h,o,h.c.b,h.c),Gs(e.a,o)))}function hpn(e){var t,n;for(n=new cr(fr(Xo(e).a.Kc(),new V));Vr(n);)if(t=u(Pr(n),17),t.c.i.k!=(zn(),Rl))throw J(new M3(Poe+QD(e)+"' 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 fpn(e,t,n){var r,s,o,h,d,v,x;if(s=urt(e.Db&254),s==0)e.Eb=n;else{if(s==1)d=Me(Yn,yt,1,2,5,1),o=dse(e,t),o==0?(d[0]=n,d[1]=e.Eb):(d[0]=e.Eb,d[1]=n);else for(d=Me(Yn,yt,1,s+1,5,1),h=tb(e.Eb),r=2,v=0,x=0;r<=128;r<<=1)r==t?d[x++]=n:e.Db&r&&(d[x++]=h[v++]);e.Eb=d}e.Db|=t}function Uot(e,t,n){var r,s,o,h;for(this.b=new st,s=0,r=0,h=new C(e);h.a0&&(o=u(St(this.b,0),167),s+=o.o,r+=o.p),s*=2,r*=2,t>1?s=_s(b.Math.ceil(s*t)):r=_s(b.Math.ceil(r/t)),this.a=new n3e(s,r)}function Wot(e,t,n,r,s,o){var h,d,v,x,_,L,P,z,q,W,X,le;for(_=r,t.j&&t.o?(z=u(er(e.f,t.A),57),W=z.d.c+z.d.b,--_):W=t.a.c+t.a.b,L=s,n.q&&n.o?(z=u(er(e.f,n.C),57),x=z.d.c,++L):x=n.a.c,X=x-W,v=b.Math.max(2,L-_),d=X/v,q=W+d,P=_;P=0;h+=s?1:-1){for(d=t[h],v=r==(ht(),$n)?s?ac(d,r):nb(ac(d,r)):s?nb(ac(d,r)):ac(d,r),o&&(e.c[d.p]=v.gc()),L=v.Kc();L.Ob();)_=u(L.Pb(),11),e.d[_.p]=x++;Rs(n,v)}}function Kot(e,t,n){var r,s,o,h,d,v,x,_;for(o=Ue(ft(e.b.Kc().Pb())),x=Ue(ft(ksn(t.b))),r=bd(fc(e.a),x-n),s=bd(fc(t.a),n-o),_=Ni(r,s),bd(_,1/(x-o)),this.a=_,this.b=new st,d=!0,h=e.b.Kc(),h.Pb();h.Ob();)v=Ue(ft(h.Pb())),d&&v-n>pce&&(this.b.Fc(n),d=!1),this.b.Fc(v);d&&this.b.Fc(n)}function dpn(e){var t,n,r,s;if(T2n(e,e.n),e.d.c.length>0){for(_T(e.c);K4e(e,u(Y(new C(e.e.a)),121))>5,t&=31,r>=e.d)return e.e<0?(Qp(),Eue):(Qp(),K7);if(o=e.d-r,s=Me(Lr,Jr,25,o+1,15,1),a1n(s,o,e.a,r,t),e.e<0){for(n=0;n0&&e.a[n]<<32-t){for(n=0;n=0?!1:(n=v4((Yu(),Oa),s,t),n?(r=n.Zj(),(r>1||r==-1)&&Dv(Po(Oa,n))!=3):!0)):!1}function vpn(e,t,n,r){var s,o,h,d,v;return d=zo(u(Te((!t.b&&(t.b=new wn(mr,t,4,7)),t.b),0),82)),v=zo(u(Te((!t.c&&(t.c=new wn(mr,t,5,8)),t.c),0),82)),us(d)==us(v)||Vm(v,d)?null:(h=nD(t),h==n?r:(o=u(er(e.a,h),10),o&&(s=o.e,s)?s:null))}function wpn(e,t){var n;switch(n=u(K(e,(pt(),Wq)),276),kr(t,"Label side selection ("+n+")",1),n.g){case 0:fot(e,(Ul(),d0));break;case 1:fot(e,(Ul(),b2));break;case 2:Sut(e,(Ul(),d0));break;case 3:Sut(e,(Ul(),b2));break;case 4:cct(e,(Ul(),d0));break;case 5:cct(e,(Ul(),b2))}ur(t)}function b5e(e,t,n){var r,s,o,h,d,v;if(r=rUt(n,e.length),h=e[r],h[0].k==(zn(),Ls))for(o=lze(n,h.length),v=t.j,s=0;s0&&(n[0]+=e.d,h-=n[0]),n[2]>0&&(n[2]+=e.d,h-=n[2]),o=b.Math.max(0,h),n[1]=b.Math.max(n[1],h),Ywe(e,lu,s.c+r.b+n[0]-(n[1]-h)/2,n),t==lu&&(e.c.b=o,e.c.c=s.c+r.b+(o-h)/2)}function sct(){this.c=Me(pa,Ao,25,(ht(),ie(re(ao,1),Dc,61,0,[uc,An,$n,xr,Dn])).length,15,1),this.b=Me(pa,Ao,25,ie(re(ao,1),Dc,61,0,[uc,An,$n,xr,Dn]).length,15,1),this.a=Me(pa,Ao,25,ie(re(ao,1),Dc,61,0,[uc,An,$n,xr,Dn]).length,15,1),s2e(this.c,gs),s2e(this.b,Ds),s2e(this.a,Ds)}function Yc(e,t,n){var r,s,o,h;if(t<=n?(s=t,o=n):(s=n,o=t),r=0,e.b==null)e.b=Me(Lr,Jr,25,2,15,1),e.b[0]=s,e.b[1]=o,e.c=!0;else{if(r=e.b.length,e.b[r-1]+1==s){e.b[r-1]=o;return}h=Me(Lr,Jr,25,r+2,15,1),Hc(e.b,0,h,0,r),e.b=h,e.b[r-1]>=s&&(e.c=!1,e.a=!1),e.b[r++]=s,e.b[r]=o,e.c||l4(e)}}function Cpn(e,t,n){var r,s,o,h,d,v,x;for(x=t.d,e.a=new su(x.c.length),e.c=new Mr,d=new C(x);d.a=0?e._g(x,!1,!0):tw(e,n,!1),58));e:for(o=L.Kc();o.Ob();){for(s=u(o.Pb(),56),_=0;_1;)ay(s,s.i-1);return r}function Dpn(e,t){var n,r,s,o,h,d,v;for(kr(t,"Comment post-processing",1),o=new C(e.b);o.ae.d[h.p]&&(n+=Gwe(e.b,o),$p(e.a,ct(o)));for(;!TT(e.a);)yme(e.b,u(I6(e.a),19).a)}return n}function uct(e,t,n){var r,s,o,h;for(o=(!t.a&&(t.a=new at(hs,t,10,11)),t.a).i,s=new rr((!t.a&&(t.a=new at(hs,t,10,11)),t.a));s.e!=s.i.gc();)r=u(pr(s),33),(!r.a&&(r.a=new at(hs,r,10,11)),r.a).i==0||(o+=uct(e,r,!1));if(n)for(h=us(t);h;)o+=(!h.a&&(h.a=new at(hs,h,10,11)),h.a).i,h=us(h);return o}function ay(e,t){var n,r,s,o;return e.ej()?(r=null,s=e.fj(),e.ij()&&(r=e.kj(e.pi(t),null)),n=e.Zi(4,o=J6(e,t),null,t,s),e.bj()&&o!=null&&(r=e.dj(o,r)),r?(r.Ei(n),r.Fi()):e.$i(n),o):(o=J6(e,t),e.bj()&&o!=null&&(r=e.dj(o,null),r&&r.Fi()),o)}function Opn(e){var t,n,r,s,o,h,d,v,x,_;for(x=e.a,t=new Ys,v=0,r=new C(e.d);r.ad.d&&(_=d.d+d.a+x));n.c.d=_,t.a.zc(n,t),v=b.Math.max(v,n.c.d+n.c.a)}return v}function mo(){mo=pe,Oq=new _m("COMMENTS",0),Th=new _m("EXTERNAL_PORTS",1),oS=new _m("HYPEREDGES",2),Nq=new _m("HYPERNODES",3),uE=new _m("NON_FREE_PORTS",4),j4=new _m("NORTH_SOUTH_PORTS",5),cS=new _m(Eft,6),oE=new _m("CENTER_LABELS",7),cE=new _m("END_LABELS",8),Pq=new _m("PARTITIONS",9)}function oy(e){var t,n,r,s,o;for(s=new st,t=new l_((!e.a&&(e.a=new at(hs,e,10,11)),e.a)),r=new cr(fr(z0(e).a.Kc(),new V));Vr(r);)n=u(Pr(r),79),we(Te((!n.b&&(n.b=new wn(mr,n,4,7)),n.b),0),186)||(o=zo(u(Te((!n.c&&(n.c=new wn(mr,n,5,8)),n.c),0),82)),t.a._b(o)||(s.c[s.c.length]=o));return s}function Npn(e){var t,n,r,s,o,h;for(o=new Ys,t=new l_((!e.a&&(e.a=new at(hs,e,10,11)),e.a)),s=new cr(fr(z0(e).a.Kc(),new V));Vr(s);)r=u(Pr(s),79),we(Te((!r.b&&(r.b=new wn(mr,r,4,7)),r.b),0),186)||(h=zo(u(Te((!r.c&&(r.c=new wn(mr,r,5,8)),r.c),0),82)),t.a._b(h)||(n=o.a.zc(h,o),n==null));return o}function Ppn(e,t,n,r,s){return r<0?(r=u4(e,s,ie(re(mt,1),Qe,2,6,[Rae,Fae,jae,$ae,ak,Hae,zae,Gae,qae,Vae,Uae,Wae]),t),r<0&&(r=u4(e,s,ie(re(mt,1),Qe,2,6,["Jan","Feb","Mar","Apr",ak,"Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),t)),r<0?!1:(n.k=r,!0)):r>0?(n.k=r-1,!0):!1}function Bpn(e,t,n,r,s){return r<0?(r=u4(e,s,ie(re(mt,1),Qe,2,6,[Rae,Fae,jae,$ae,ak,Hae,zae,Gae,qae,Vae,Uae,Wae]),t),r<0&&(r=u4(e,s,ie(re(mt,1),Qe,2,6,["Jan","Feb","Mar","Apr",ak,"Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),t)),r<0?!1:(n.k=r,!0)):r>0?(n.k=r-1,!0):!1}function Rpn(e,t,n,r,s,o){var h,d,v,x;if(d=32,r<0){if(t[0]>=e.length||(d=Ma(e,t[0]),d!=43&&d!=45)||(++t[0],r=ZH(e,t),r<0))return!1;d==45&&(r=-r)}return d==32&&t[0]-n==2&&s.b==2&&(v=new kF,x=v.q.getFullYear()-e2+e2-80,h=x%100,o.a=r==h,r+=(x/100|0)*100+(r=x&&(v=r);v&&(_=b.Math.max(_,v.a.o.a)),_>P&&(L=x,P=_)}return L}function $pn(e,t,n){var r,s,o;if(e.e=n,e.d=0,e.b=0,e.f=1,e.i=t,(e.e&16)==16&&(e.i=C2n(e.i)),e.j=e.i.length,mi(e),o=Xv(e),e.d!=e.j)throw J(new $r(Ur((jr(),V1t))));if(e.g){for(r=0;rUft?aa(v,e.b):r<=Uft&&r>Wft?aa(v,e.d):r<=Wft&&r>Kft?aa(v,e.c):r<=Kft&&aa(v,e.a),o=dct(e,v,o);return s}function Qp(){Qp=pe;var e;for(jG=new Tg(1,1),Tue=new Tg(1,10),K7=new Tg(0,0),Eue=new Tg(-1,1),n7e=ie(re(D4,1),Qe,91,0,[K7,jG,new Tg(1,2),new Tg(1,3),new Tg(1,4),new Tg(1,5),new Tg(1,6),new Tg(1,7),new Tg(1,8),new Tg(1,9),Tue]),$G=Me(D4,Qe,91,32,0,1),e=0;e<$G.length;e++)$G[e]=WD(A0(1,e))}function zpn(e,t,n,r,s,o){var h,d,v,x;for(d=!LT(Vi(e.Oc(),new Ke(new NY))).sd((G2(),X7)),h=e,o==(wo(),X0)&&(h=we(h,152)?H6(u(h,152)):we(h,131)?u(h,131).a:we(h,54)?new lv(h):new Em(h)),x=h.Kc();x.Ob();)v=u(x.Pb(),70),v.n.a=t.a,d?v.n.b=t.b+(r.b-v.o.b)/2:s?v.n.b=t.b:v.n.b=t.b+r.b-v.o.b,t.a+=v.o.a+n}function gct(e,t,n,r){var s,o,h,d,v,x;for(s=(r.c+r.a)/2,Rh(t.j),ci(t.j,s),Rh(n.e),ci(n.e,s),x=new vze,d=new C(e.f);d.a1,d&&(r=new Pt(s,n.b),ci(t.a,r)),D_(t.a,ie(re(na,1),Qe,8,0,[P,L]))}function wct(e){wv(e,new gb(gv(hv(dv(fv(new lg,fG),"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 $Z))),dt(e,fG,uw,fAe),dt(e,fG,py,15),dt(e,fG,Fz,ct(0)),dt(e,fG,fk,N7)}function m5e(){m5e=pe;var e,t,n,r,s,o;for(eA=Me(el,A4,25,255,15,1),iU=Me(Sh,Td,25,16,15,1),t=0;t<255;t++)eA[t]=-1;for(n=57;n>=48;n--)eA[n]=n-48<<24>>24;for(r=70;r>=65;r--)eA[r]=r-65+10<<24>>24;for(s=102;s>=97;s--)eA[s]=s-97+10<<24>>24;for(o=0;o<10;o++)iU[o]=48+o&Ss;for(e=10;e<=15;e++)iU[e]=65+e-10&Ss}function cz(e,t,n){var r,s,o,h,d,v,x,_;return d=t.i-e.g/2,v=n.i-e.g/2,x=t.j-e.g/2,_=n.j-e.g/2,o=t.g+e.g/2,h=n.g+e.g/2,r=t.f+e.g/2,s=n.f+e.g/2,d>19)return"-"+mct(U8(e));for(n=e,r="";!(n.l==0&&n.m==0&&n.h==0);){if(s=Mre(Lz),n=Q5e(n,s,!0),t=""+Lze(s2),!(n.l==0&&n.m==0&&n.h==0))for(o=9-t.length;o>0;o--)t="0"+t;r=t+r}return r}function Upn(){if(!Object.create||!Object.getOwnPropertyNames)return!1;var e="__proto__",t=Object.create(null);if(t[e]!==void 0)return!1;var n=Object.getOwnPropertyNames(t);return!(n.length!=0||(t[e]=42,t[e]!==42)||Object.getOwnPropertyNames(t).length==0)}function Wpn(e){var t,n,r,s,o,h,d;for(t=!1,n=0,s=new C(e.d.b);s.a=e.a||!a4e(t,n))return-1;if(T8(u(r.Kb(t),20)))return 1;for(s=0,h=u(r.Kb(t),20).Kc();h.Ob();)if(o=u(h.Pb(),17),v=o.c.i==t?o.d.i:o.c.i,d=k5e(e,v,n,r),d==-1||(s=b.Math.max(s,d),s>e.c-1))return-1;return s+1}function yct(e,t){var n,r,s,o,h,d;if(je(t)===je(e))return!0;if(!we(t,15)||(r=u(t,15),d=e.gc(),r.gc()!=d))return!1;if(h=r.Kc(),e.ni()){for(n=0;n0){if(e.qj(),t!=null){for(o=0;o>24;case 97:case 98:case 99:case 100:case 101:case 102:return e-97+10<<24>>24;case 65:case 66:case 67:case 68:case 69:case 70:return e-65+10<<24>>24;default:throw J(new gd("Invalid hexadecimal"))}}function Qpn(e,t,n){var r,s,o,h;for(kr(n,"Processor order nodes",2),e.a=Ue(ft(K(t,(nw(),V_e)))),s=new as,h=ii(t.b,0);h.b!=h.d.c;)o=u(ri(h),86),It(Mt(K(o,(Tc(),$y))))&&ks(s,o,s.c.b,s.c);r=(Qn(s.b!=0),u(s.a.a.c,86)),$ut(e,r),!n.b&&tie(n,1),C5e(e,r,0-Ue(ft(K(r,(Tc(),bV))))/2,0),!n.b&&tie(n,1),ur(n)}function uz(){uz=pe,P7e=new O3("SPIRAL",0),D7e=new O3("LINE_BY_LINE",1),I7e=new O3("MANHATTAN",2),M7e=new O3("JITTER",3),Mue=new O3("QUADRANTS_LINE_BY_LINE",4),N7e=new O3("QUADRANTS_MANHATTAN",5),O7e=new O3("QUADRANTS_JITTER",6),L7e=new O3("COMBINE_LINE_BY_LINE_MANHATTAN",7),A7e=new O3("COMBINE_JITTER_MANHATTAN",8)}function xct(e,t,n,r){var s,o,h,d,v,x;for(v=mse(e,n),x=mse(t,n),s=!1;v&&x&&(r||Wun(v,x,n));)h=mse(v,n),d=mse(x,n),bD(t),bD(e),o=v.c,Eae(v,!1),Eae(x,!1),n?(ey(t,x.p,o),t.p=x.p,ey(e,v.p+1,o),e.p=v.p):(ey(e,v.p,o),e.p=v.p,ey(t,x.p+1,o),t.p=x.p),No(v,null),No(x,null),v=h,x=d,s=!0;return s}function Zpn(e,t,n,r){var s,o,h,d,v;for(s=!1,o=!1,d=new C(r.j);d.a=t.length)throw J(new Do("Greedy SwitchDecider: Free layer not in graph."));this.c=t[e],this.e=new zM(r),sie(this.e,this.c,(ht(),Dn)),this.i=new zM(r),sie(this.i,this.c,$n),this.f=new wKe(this.c),this.a=!o&&s.i&&!s.s&&this.c[0].k==(zn(),Ls),this.a&&p1n(this,e,t.length)}function Tct(e,t){var n,r,s,o,h,d;o=!e.B.Hc((wl(),nN)),h=e.B.Hc(gfe),e.a=new mrt(h,o,e.c),e.n&&hwe(e.a.n,e.n),Zee(e.g,(n1(),lu),e.a),t||(r=new W_(1,o,e.c),r.n.a=e.k,M6(e.p,(ht(),An),r),s=new W_(1,o,e.c),s.n.d=e.k,M6(e.p,xr,s),d=new W_(0,o,e.c),d.n.c=e.k,M6(e.p,Dn,d),n=new W_(0,o,e.c),n.n.b=e.k,M6(e.p,$n,n))}function e2n(e){var t,n,r;switch(t=u(K(e.d,(pt(),K0)),218),t.g){case 2:n=Myn(e);break;case 3:n=(r=new st,ms(Vi(Cu(ic(ic(new vn(null,new mn(e.d.b,16)),new TX),new _X),new M9),new gX),new Nee(r)),r);break;default:throw J(new Wo("Compaction not supported for "+t+" edges."))}Zvn(e,n),Da(new vm(e.g),new Iee(e))}function t2n(e,t){var n;return n=new b3,t&&Ho(n,u(er(e.a,iN),94)),we(t,470)&&Ho(n,u(er(e.a,sN),94)),we(t,354)?(Ho(n,u(er(e.a,Jo),94)),n):(we(t,82)&&Ho(n,u(er(e.a,mr),94)),we(t,239)?(Ho(n,u(er(e.a,hs),94)),n):we(t,186)?(Ho(n,u(er(e.a,xl),94)),n):(we(t,352)&&Ho(n,u(er(e.a,ra),94)),n))}function a1(){a1=pe,Q7=new fo((bi(),BV),ct(1)),eq=new fo(jb,80),ppt=new fo(GSe,5),apt=new fo(Bk,N7),dpt=new fo(ufe,ct(1)),gpt=new fo(lfe,(Mn(),!0)),Z7e=new kv(50),hpt=new fo(Fb,Z7e),Y7e=OV,J7e=BS,opt=new fo(efe,!1),Q7e=KO,lpt=p2,upt=Rb,cpt=J4,fpt=Hy,X7e=(m4e(),Jgt),zue=rpt,JG=Zgt,Hue=ept,eEe=npt}function n2n(e){var t,n,r,s,o,h,d,v;for(v=new TZe,d=new C(e.a);d.a0&&t=0)return!1;if(t.p=n.b,it(n.e,t),s==(zn(),ca)||s==Jc){for(h=new C(t.j);h.a1||h==-1)&&(o|=16),s.Bb&_c&&(o|=64)),n.Bb&so&&(o|=ky),o|=Sf):we(t,457)?o|=512:(r=t.Bj(),r&&r.i&1&&(o|=256)),e.Bb&512&&(o|=128),o}function oC(e,t){var n,r,s,o,h;for(e=e==null?Pu:(Sn(e),e),s=0;se.d[d.p]&&(n+=Gwe(e.b,o),$p(e.a,ct(o)))):++h;for(n+=e.b.d*h;!TT(e.a);)yme(e.b,u(I6(e.a),19).a)}return n}function h2n(e,t){var n;return e.f==Cfe?(n=Dv(Po((Yu(),Oa),t)),e.e?n==4&&t!=(nk(),Gk)&&t!=(nk(),zk)&&t!=(nk(),Sfe)&&t!=(nk(),Afe):n==2):e.d&&(e.d.Hc(t)||e.d.Hc(F6(Po((Yu(),Oa),t)))||e.d.Hc(v4((Yu(),Oa),e.b,t)))?!0:e.f&&l5e((Yu(),e.f),QM(Po(Oa,t)))?(n=Dv(Po(Oa,t)),e.e?n==4:n==2):!1}function f2n(e,t,n,r){var s,o,h,d,v,x,_,L;return h=u(Ft(n,(bi(),Rk)),8),v=h.a,_=h.b+e,s=b.Math.atan2(_,v),s<0&&(s+=_4),s+=t,s>_4&&(s-=_4),d=u(Ft(r,Rk),8),x=d.a,L=d.b+e,o=b.Math.atan2(L,x),o<0&&(o+=_4),o+=t,o>_4&&(o-=_4),S1(),Ef(1e-10),b.Math.abs(s-o)<=1e-10||s==o||isNaN(s)&&isNaN(o)?0:so?1:yv(isNaN(s),isNaN(o))}function eae(e){var t,n,r,s,o,h,d;for(d=new Mr,r=new C(e.a.b);r.a=e.o)throw J(new lpe);d=t>>5,h=t&31,o=A0(1,Or(A0(h,1))),s?e.n[n][d]=I1(e.n[n][d],o):e.n[n][d]=qs(e.n[n][d],pve(o)),o=A0(o,1),r?e.n[n][d]=I1(e.n[n][d],o):e.n[n][d]=qs(e.n[n][d],pve(o))}catch(v){throw v=ts(v),we(v,320)?J(new Do(koe+e.o+"*"+e.p+xoe+t+io+n+Eoe)):J(v)}}function C5e(e,t,n,r){var s,o,h;t&&(o=Ue(ft(K(t,(Tc(),qg))))+r,h=n+Ue(ft(K(t,bV)))/2,Ye(t,Che,ct(Or(Ou(b.Math.round(o))))),Ye(t,F_e,ct(Or(Ou(b.Math.round(h))))),t.d.b==0||C5e(e,u(sj((s=ii(new Ep(t).a.d,0),new f6(s))),86),n+Ue(ft(K(t,bV)))+e.a,r+Ue(ft(K(t,mE)))),K(t,_he)!=null&&C5e(e,u(K(t,_he),86),n,r))}function g2n(e,t){var n,r,s,o,h,d,v,x,_,L,P;for(v=Ya(t.a),s=Ue(ft(K(v,(pt(),Nb))))*2,_=Ue(ft(K(v,U4))),x=b.Math.max(s,_),o=Me(pa,Ao,25,t.f-t.c+1,15,1),r=-x,n=0,d=t.b.Kc();d.Ob();)h=u(d.Pb(),10),r+=e.a[h.c.p]+x,o[n++]=r;for(r+=e.a[t.a.c.p]+x,o[n++]=r,P=new C(t.e);P.a0&&(r=(!e.n&&(e.n=new at(Jo,e,1,7)),u(Te(e.n,0),137)).a,!r||Yr(Yr((t.a+=' "',t),r),'"'))),Yr(bv(Yr(bv(Yr(bv(Yr(bv((t.a+=" (",t),e.i),","),e.j)," | "),e.g),","),e.f),")"),t.a)}function Nct(e){var t,n,r;return e.Db&64?Mse(e):(t=new Fl(Qxe),n=e.k,n?Yr(Yr((t.a+=' "',t),n),'"'):(!e.n&&(e.n=new at(Jo,e,1,7)),e.n.i>0&&(r=(!e.n&&(e.n=new at(Jo,e,1,7)),u(Te(e.n,0),137)).a,!r||Yr(Yr((t.a+=' "',t),r),'"'))),Yr(bv(Yr(bv(Yr(bv(Yr(bv((t.a+=" (",t),e.i),","),e.j)," | "),e.g),","),e.f),")"),t.a)}function nae(e,t){var n,r,s,o,h,d,v;if(t==null||t.length==0)return null;if(s=u(Uc(e.a,t),149),!s){for(r=(d=new E1(e.b).a.vc().Kc(),new T1(d));r.a.Ob();)if(n=(o=u(r.a.Pb(),42),u(o.dd(),149)),h=n.c,v=t.length,an(h.substr(h.length-v,v),t)&&(t.length==h.length||Ma(h,h.length-t.length-1)==46)){if(s)return null;s=n}s&&Oo(e.a,t,s)}return s}function v2n(e,t){var n,r,s,o;return n=new Dh,r=u(zl(Cu(new vn(null,new mn(e.f,16)),n),zm(new Ri,new tn,new tr,new ha,ie(re(yl,1),tt,132,0,[(F1(),xy),Ql]))),21),s=r.gc(),r=u(zl(Cu(new vn(null,new mn(t.f,16)),n),zm(new Ri,new tn,new tr,new ha,ie(re(yl,1),tt,132,0,[xy,Ql]))),21),o=r.gc(),ss.p?(Vs(o,xr),o.d&&(d=o.o.b,t=o.a.b,o.a.b=d-t)):o.j==xr&&s.p>e.p&&(Vs(o,An),o.d&&(d=o.o.b,t=o.a.b,o.a.b=-(d-t)));break}return s}function m2n(e,t,n,r){var s,o,h,d,v,x,_,L,P,z,q;if(o=n,n1,d&&(r=new Pt(s,n.b),ci(t.a,r)),D_(t.a,ie(re(na,1),Qe,8,0,[P,L]))}function rae(e,t,n){var r,s,o,h,d,v;if(t)if(n<=-1){if(r=gn(t.Tg(),-1-n),we(r,99))return u(r,18);for(h=u(t.ah(r),153),d=0,v=h.gc();d0){for(s=v.length;s>0&&v[s-1]=="";)--s;s=40,h&&Mbn(e),Nvn(e),dpn(e),n=srt(e),r=0;n&&r0&&ci(e.f,o)):(e.c[h]-=x+1,e.c[h]<=0&&e.a[h]>0&&ci(e.e,o))))}function V2n(e){var t,n,r,s,o,h,d,v,x;for(d=new Sp(u(Nr(new lp),62)),x=Ds,n=new C(e.d);n.a=0&&vn?t:n;x<=L;++x)x==n?d=r++:(o=s[x],_=q.rl(o.ak()),x==t&&(v=x==L&&!_?r-1:r),_&&++r);return P=u(q_(e,t,n),72),d!=v&&Vx(e,new dD(e.e,7,h,ct(d),z.dd(),v)),P}}else return u(jse(e,t,n),72);return u(q_(e,t,n),72)}function Y2n(e,t){var n,r,s,o,h,d,v;for(kr(t,"Port order processing",1),v=u(K(e,(pt(),YTe)),421),r=new C(e.b);r.a=0&&(d=Zun(e,h),!(d&&(x<22?v.l|=1<>>1,h.m=_>>>1|(L&1)<<21,h.l=P>>>1|(_&1)<<21,--x;return n&&gie(v),o&&(r?(s2=U8(e),s&&(s2=Wtt(s2,(D8(),R8e)))):s2=fu(e.l,e.m,e.h)),v}function Z2n(e,t){var n,r,s,o,h,d,v,x,_,L;for(x=e.e[t.c.p][t.p]+1,v=t.c.a.c.length+1,d=new C(e.a);d.a0&&(zr(0,e.length),e.charCodeAt(0)==45||(zr(0,e.length),e.charCodeAt(0)==43))?1:0,r=h;rn)throw J(new gd(cw+e+'"'));return d}function J2n(e){var t,n,r,s,o,h,d;for(h=new as,o=new C(e.a);o.a1)&&t==1&&u(e.a[e.b],10).k==(zn(),Rl)?ik(u(e.a[e.b],10),(Ul(),d0)):r&&(!n||(e.c-e.b&e.a.length-1)>1)&&t==1&&u(e.a[e.c-1&e.a.length-1],10).k==(zn(),Rl)?ik(u(e.a[e.c-1&e.a.length-1],10),(Ul(),b2)):(e.c-e.b&e.a.length-1)==2?(ik(u(F_(e),10),(Ul(),d0)),ik(u(F_(e),10),b2)):W0n(e,s),Hwe(e)}function nbn(e,t,n){var r,s,o,h,d;for(o=0,s=new rr((!e.a&&(e.a=new at(hs,e,10,11)),e.a));s.e!=s.i.gc();)r=u(pr(s),33),h="",(!r.n&&(r.n=new at(Jo,r,1,7)),r.n).i==0||(h=u(Te((!r.n&&(r.n=new at(Jo,r,1,7)),r.n),0),137).a),d=new vie(o++,t,h),Ho(d,r),Ye(d,(Tc(),LS),r),d.e.b=r.j+r.f/2,d.f.a=b.Math.max(r.g,1),d.e.a=r.i+r.g/2,d.f.b=b.Math.max(r.f,1),ci(t.b,d),gu(n.f,r,d)}function rbn(e){var t,n,r,s,o;r=u(K(e,(et(),Mi)),33),o=u(Ft(r,(pt(),Ib)),174).Hc((Bl(),Hb)),e.e||(s=u(K(e,eu),21),t=new Pt(e.f.a+e.d.b+e.d.c,e.f.b+e.d.d+e.d.a),s.Hc((mo(),Th))?(So(r,bs,(wa(),tu)),sw(r,t.a,t.b,!1,!0)):It(Mt(Ft(r,Yle)))||sw(r,t.a,t.b,!0,!0)),o?So(r,Ib,rn(Hb)):So(r,Ib,(n=u(Qf(qS),9),new hh(n,u(wf(n,n.length),9),0)))}function N5e(e,t,n){var r,s,o,h;if(t[0]>=e.length)return n.o=0,!0;switch(Ma(e,t[0])){case 43:s=1;break;case 45:s=-1;break;default:return n.o=0,!0}if(++t[0],o=t[0],h=ZH(e,t),h==0&&t[0]==o)return!1;if(t[0]=0&&d!=n&&(o=new oa(e,1,d,h,null),r?r.Ei(o):r=o),n>=0&&(o=new oa(e,1,n,d==n?h:null,t),r?r.Ei(o):r=o)),r}function Zct(e){var t,n,r;if(e.b==null){if(r=new bg,e.i!=null&&(To(r,e.i),r.a+=":"),e.f&256){for(e.f&256&&e.a!=null&&(mJt(e.i)||(r.a+="//"),To(r,e.a)),e.d!=null&&(r.a+="/",To(r,e.d)),e.f&16&&(r.a+="/"),t=0,n=e.j.length;tP?!1:(L=(v=dC(r,P,!1),v.a),_+d+L<=t.b&&(fD(n,o-n.s),n.c=!0,fD(r,o-n.s),KD(r,n.s,n.t+n.d+d),r.k=!0,Ume(n.q,r),z=!0,s&&(q$(t,r),r.j=t,e.c.length>h&&(JD((xn(h,e.c.length),u(e.c[h],200)),r),(xn(h,e.c.length),u(e.c[h],200)).a.c.length==0&&Eg(e,h)))),z)}function hbn(e,t){var n,r,s,o,h,d;if(kr(t,"Partition midprocessing",1),s=new Nv,ms(Vi(new vn(null,new mn(e.a,16)),new RY),new ov(s)),s.d!=0){for(d=u(zl(GXe((o=s.i,new vn(null,(o||(s.i=new H3(s,s.c))).Nc()))),eb(new vt,new Dt,new Hn,ie(re(yl,1),tt,132,0,[(F1(),Ql)]))),15),r=d.Kc(),n=u(r.Pb(),19);r.Ob();)h=u(r.Pb(),19),ggn(u(Ii(s,n),21),u(Ii(s,h),21)),n=h;ur(t)}}function tut(e,t,n){var r,s,o,h,d,v,x,_;if(t.p==0){for(t.p=1,h=n,h||(s=new st,o=(r=u(Qf(ao),9),new hh(r,u(wf(r,r.length),9),0)),h=new xa(s,o)),u(h.a,15).Fc(t),t.k==(zn(),Ls)&&u(h.b,21).Fc(u(K(t,(et(),vc)),61)),v=new C(t.j);v.a0){if(s=u(e.Ab.g,1934),t==null){for(o=0;o1)for(r=new C(s);r.an.s&&dd&&(d=s,_.c=Me(Yn,yt,1,0,5,1)),s==d&&it(_,new xa(n.c.i,n)));hn(),aa(_,e.c),Om(e.b,v.p,_)}}function vbn(e,t){var n,r,s,o,h,d,v,x,_;for(h=new C(t.b);h.ad&&(d=s,_.c=Me(Yn,yt,1,0,5,1)),s==d&&it(_,new xa(n.d.i,n)));hn(),aa(_,e.c),Om(e.f,v.p,_)}}function rut(e){wv(e,new gb(gv(hv(dv(fv(new lg,fw),"ELK Box"),"Algorithm for packing of unconnected boxes, i.e. graphs without edges."),new MZ))),dt(e,fw,uw,hSe),dt(e,fw,py,15),dt(e,fw,FI,ct(0)),dt(e,fw,uG,xt(cSe)),dt(e,fw,E4,xt(Kyt)),dt(e,fw,dk,xt(Yyt)),dt(e,fw,fk,t1t),dt(e,fw,jI,xt(uSe)),dt(e,fw,gk,xt(lSe)),dt(e,fw,Vxe,xt(Xhe)),dt(e,fw,rG,xt(Wyt))}function iut(e,t){var n,r,s,o,h,d,v,x,_;if(s=e.i,h=s.o.a,o=s.o.b,h<=0&&o<=0)return ht(),uc;switch(x=e.n.a,_=e.n.b,d=e.o.a,n=e.o.b,t.g){case 2:case 1:if(x<0)return ht(),Dn;if(x+d>h)return ht(),$n;break;case 4:case 3:if(_<0)return ht(),An;if(_+n>o)return ht(),xr}return v=(x+d/2)/h,r=(_+n/2)/o,v+r<=1&&v-r<=0?(ht(),Dn):v+r>=1&&v-r>=0?(ht(),$n):r<.5?(ht(),An):(ht(),xr)}function wbn(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W;for(n=!1,_=Ue(ft(K(t,(pt(),Aw)))),q=Jp*_,s=new C(t.b);s.av+q&&(W=L.g+P.g,P.a=(P.g*P.a+L.g*L.a)/W,P.g=W,L.f=P,n=!0)),o=d,L=P;return n}function sut(e,t,n,r,s,o,h){var d,v,x,_,L,P;for(P=new T6,x=t.Kc();x.Ob();)for(d=u(x.Pb(),839),L=new C(d.wf());L.a0?d.a?(x=d.b.rf().b,s>x&&(e.v||d.c.d.c.length==1?(h=(s-x)/2,d.d.d=h,d.d.a=h):(n=u(St(d.c.d,0),181).rf().b,r=(n-x)/2,d.d.d=b.Math.max(0,r),d.d.a=s-r-x))):d.d.a=e.t+s:g_(e.u)&&(o=u4e(d.b),o.d<0&&(d.d.d=-o.d),o.d+o.a>d.b.rf().b&&(d.d.a=o.d+o.a-d.b.rf().b))}function kbn(e,t){var n;switch(yD(e)){case 6:return fa(t);case 7:return Sm(t);case 8:return Cm(t);case 3:return Array.isArray(t)&&(n=yD(t),!(n>=14&&n<=16));case 11:return t!=null&&typeof t===Dae;case 12:return t!=null&&(typeof t===TI||typeof t==Dae);case 0:return ese(t,e.__elementTypeId$);case 2:return Fne(t)&&t.im!==gt;case 1:return Fne(t)&&t.im!==gt||ese(t,e.__elementTypeId$);default:return!0}}function aut(e,t){var n,r,s,o;return r=b.Math.min(b.Math.abs(e.c-(t.c+t.b)),b.Math.abs(e.c+e.b-t.c)),o=b.Math.min(b.Math.abs(e.d-(t.d+t.a)),b.Math.abs(e.d+e.a-t.d)),n=b.Math.abs(e.c+e.b/2-(t.c+t.b/2)),n>e.b/2+t.b/2||(s=b.Math.abs(e.d+e.a/2-(t.d+t.a/2)),s>e.a/2+t.a/2)?1:n==0&&s==0?0:n==0?o/s+1:s==0?r/n+1:b.Math.min(r/n,o/s)+1}function out(e,t){var n,r,s,o,h,d;return s=Mme(e),d=Mme(t),s==d?e.e==t.e&&e.a<54&&t.a<54?e.ft.f?1:0:(r=e.e-t.e,n=(e.d>0?e.d:b.Math.floor((e.a-1)*wht)+1)-(t.d>0?t.d:b.Math.floor((t.a-1)*wht)+1),n>r+1?s:n0&&(h=W3(h,Lut(r))),jrt(o,h))):s0&&e.d!=(L_(),Vue)&&(d+=h*(r.d.a+e.a[t.b][r.b]*(t.d.a-r.d.a)/n)),n>0&&e.d!=(L_(),Gue)&&(v+=h*(r.d.b+e.a[t.b][r.b]*(t.d.b-r.d.b)/n)));switch(e.d.g){case 1:return new Pt(d/o,t.d.b);case 2:return new Pt(t.d.a,v/o);default:return new Pt(d/o,v/o)}}function cut(e,t){X8();var n,r,s,o,h;if(h=u(K(e.i,(pt(),bs)),98),o=e.j.g-t.j.g,o!=0||!(h==(wa(),$b)||h==p0||h==tu))return 0;if(h==(wa(),$b)&&(n=u(K(e,zg),19),r=u(K(t,zg),19),n&&r&&(s=n.a-r.a,s!=0)))return s;switch(e.j.g){case 1:return Fs(e.n.a,t.n.a);case 2:return Fs(e.n.b,t.n.b);case 3:return Fs(t.n.a,e.n.a);case 4:return Fs(t.n.b,e.n.b);default:throw J(new Wo(eke))}}function uut(e){var t,n,r,s,o,h;for(n=(!e.a&&(e.a=new Bs(ef,e,5)),e.a).i+2,h=new su(n),it(h,new Pt(e.j,e.k)),ms(new vn(null,(!e.a&&(e.a=new Bs(ef,e,5)),new mn(e.a,16))),new t$e(h)),it(h,new Pt(e.b,e.c)),t=1;t0&&(ND(v,!1,(wo(),Xh)),ND(v,!0,Df)),Mu(t.g,new ZGe(e,n)),Si(e.g,t,n)}function hut(){hut=pe;var e;for(V8e=ie(re(Lr,1),Jr,25,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]),kue=Me(Lr,Jr,25,37,15,1),O0t=ie(re(Lr,1),Jr,25,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]),U8e=Me(S2,roe,25,37,14,1),e=2;e<=36;e++)kue[e]=_s(b.Math.pow(e,V8e[e])),U8e[e]=eI(Cz,kue[e])}function Ebn(e){var t;if((!e.a&&(e.a=new at(os,e,6,6)),e.a).i!=1)throw J(new Ln(y1t+(!e.a&&(e.a=new at(os,e,6,6)),e.a).i));return t=new Gu,ID(u(Te((!e.b&&(e.b=new wn(mr,e,4,7)),e.b),0),82))&&no(t,Wlt(e,ID(u(Te((!e.b&&(e.b=new wn(mr,e,4,7)),e.b),0),82)),!1)),ID(u(Te((!e.c&&(e.c=new wn(mr,e,5,8)),e.c),0),82))&&no(t,Wlt(e,ID(u(Te((!e.c&&(e.c=new wn(mr,e,5,8)),e.c),0),82)),!0)),t}function fut(e,t){var n,r,s,o,h;for(t.d?s=e.a.c==(yd(),Lw)?Xo(t.b):js(t.b):s=e.a.c==(yd(),Gg)?Xo(t.b):js(t.b),o=!1,r=new cr(fr(s.a.Kc(),new V));Vr(r);)if(n=u(Pr(r),17),h=It(e.a.f[e.a.g[t.b.p].p]),!(!h&&!to(n)&&n.c.i.c==n.d.i.c)&&!(It(e.a.n[e.a.g[t.b.p].p])||It(e.a.n[e.a.g[t.b.p].p]))&&(o=!0,_0(e.b,e.a.g[Oun(n,t.b).p])))return t.c=!0,t.a=n,t;return t.c=o,t.a=null,t}function Tbn(e,t,n,r,s){var o,h,d,v,x,_,L;for(hn(),aa(e,new FZ),d=new Ea(e,0),L=new st,o=0;d.bo*2?(_=new H$(L),x=Wu(h)/Dl(h),v=Sae(_,t,new g6,n,r,s,x),Ni(Zf(_.e),v),L.c=Me(Yn,yt,1,0,5,1),o=0,L.c[L.c.length]=_,L.c[L.c.length]=h,o=Wu(_)*Dl(_)+Wu(h)*Dl(h)):(L.c[L.c.length]=h,o+=Wu(h)*Dl(h));return L}function B5e(e,t,n){var r,s,o,h,d,v,x;if(r=n.gc(),r==0)return!1;if(e.ej())if(v=e.fj(),Qye(e,t,n),h=r==1?e.Zi(3,null,n.Kc().Pb(),t,v):e.Zi(5,null,n,t,v),e.bj()){for(d=r<100?null:new _p(r),o=t+r,s=t;s0){for(h=0;h>16==-15&&e.Cb.nh()&&Gre(new jre(e.Cb,9,13,n,e.c,Dg(gl(u(e.Cb,59)),e))):we(e.Cb,88)&&e.Db>>16==-23&&e.Cb.nh()&&(t=e.c,we(t,88)||(t=(on(),sf)),we(n,88)||(n=(on(),sf)),Gre(new jre(e.Cb,9,10,n,t,Dg(jc(u(e.Cb,26)),e)))))),e.c}function _bn(e,t){var n,r,s,o,h,d,v,x,_,L;for(kr(t,"Hypernodes processing",1),s=new C(e.b);s.an);return s}function gut(e,t){var n,r,s;r=vl(e.d,1)!=0,!It(Mt(K(t.j,(et(),kw))))&&!It(Mt(K(t.j,z4)))||je(K(t.j,(pt(),h2)))===je((R0(),f2))?t.c.Tf(t.e,r):r=It(Mt(K(t.j,kw))),gI(e,t,r,!0),It(Mt(K(t.j,z4)))&&Ye(t.j,z4,(Mn(),!1)),It(Mt(K(t.j,kw)))&&(Ye(t.j,kw,(Mn(),!1)),Ye(t.j,z4,!0)),n=Pse(e,t);do{if(zme(e),n==0)return 0;r=!r,s=n,gI(e,t,r,!1),n=Pse(e,t)}while(s>n);return s}function put(e,t,n){var r,s,o,h,d,v,x,_,L,P,z,q;if(t==n)return!0;if(t=U4e(e,t),n=U4e(e,n),r=ose(t),r){if(_=ose(n),_!=r)return _?(v=r.Dj(),q=_.Dj(),v==q&&v!=null):!1;if(h=(!t.d&&(t.d=new Bs(Eo,t,1)),t.d),o=h.i,P=(!n.d&&(n.d=new Bs(Eo,n,1)),n.d),o==P.i){for(x=0;x0,d=kH(t,o),dbe(n?d.b:d.g,t),t4(d).c.length==1&&ks(r,d,r.c.b,r.c),s=new xa(o,t),$p(e.o,s),Au(e.e.a,o))}function mut(e,t){var n,r,s,o,h,d,v;return r=b.Math.abs(jj(e.b).a-jj(t.b).a),d=b.Math.abs(jj(e.b).b-jj(t.b).b),s=0,v=0,n=1,h=1,r>e.b.b/2+t.b.b/2&&(s=b.Math.min(b.Math.abs(e.b.c-(t.b.c+t.b.b)),b.Math.abs(e.b.c+e.b.b-t.b.c)),n=1-s/r),d>e.b.a/2+t.b.a/2&&(v=b.Math.min(b.Math.abs(e.b.d-(t.b.d+t.b.a)),b.Math.abs(e.b.d+e.b.a-t.b.d)),h=1-v/d),o=b.Math.min(n,h),(1-o)*b.Math.sqrt(r*r+d*d)}function Dbn(e){var t,n,r,s;for(Cae(e,e.e,e.f,(Ov(),g2),!0,e.c,e.i),Cae(e,e.e,e.f,g2,!1,e.c,e.i),Cae(e,e.e,e.f,Y4,!0,e.c,e.i),Cae(e,e.e,e.f,Y4,!1,e.c,e.i),Obn(e,e.c,e.e,e.f,e.i),r=new Ea(e.i,0);r.b=65;n--)J1[n]=n-65<<24>>24;for(r=122;r>=97;r--)J1[r]=r-97+26<<24>>24;for(s=57;s>=48;s--)J1[s]=s-48+52<<24>>24;for(J1[43]=62,J1[47]=63,o=0;o<=25;o++)Zg[o]=65+o&Ss;for(h=26,v=0;h<=51;++h,v++)Zg[h]=97+v&Ss;for(e=52,d=0;e<=61;++e,d++)Zg[e]=48+d&Ss;Zg[62]=43,Zg[63]=47}function Ibn(e,t){var n,r,s,o,h,d,v,x,_,L,P,z;if(e.dc())return new Fa;for(x=0,L=0,s=e.Kc();s.Ob();)r=u(s.Pb(),37),o=r.f,x=b.Math.max(x,o.a),L+=o.a*o.b;for(x=b.Math.max(x,b.Math.sqrt(L)*Ue(ft(K(u(e.Kc().Pb(),37),(pt(),Hq))))),P=0,z=0,v=0,n=t,d=e.Kc();d.Ob();)h=u(d.Pb(),37),_=h.f,P+_.a>x&&(P=0,z+=v+t,v=0),cC(h,P,z),n=b.Math.max(n,P+_.a),v=b.Math.max(v,_.b),P+=_.a+t;return new Pt(n+t,z+v+t)}function Obn(e,t,n,r,s){var o,h,d,v,x,_,L;for(h=new C(t);h.ao)return ht(),$n;break;case 4:case 3:if(v<0)return ht(),An;if(v+e.f>s)return ht(),xr}return h=(d+e.g/2)/o,n=(v+e.f/2)/s,h+n<=1&&h-n<=0?(ht(),Dn):h+n>=1&&h-n>=0?(ht(),$n):n<.5?(ht(),An):(ht(),xr)}function Nbn(e,t,n,r,s){var o,h;if(o=Ua(qs(t[0],yo),qs(r[0],yo)),e[0]=Or(o),o=Np(o,32),n>=s){for(h=1;h0&&(s.b[h++]=0,s.b[h++]=o.b[0]-1),t=1;t0&&(tM(v,v.d-s.d),s.c==(Jf(),d2)&&Wge(v,v.a-s.d),v.d<=0&&v.i>0&&ks(t,v,t.c.b,t.c)));for(o=new C(e.f);o.a0&&(hT(d,d.i-s.d),s.c==(Jf(),d2)&&sv(d,d.b-s.d),d.i<=0&&d.d>0&&ks(n,d,n.c.b,n.c)))}function Pbn(e,t,n){var r,s,o,h,d,v,x,_;for(kr(n,"Processor compute fanout",1),sl(e.b),sl(e.a),d=null,o=ii(t.b,0);!d&&o.b!=o.d.c;)x=u(ri(o),86),It(Mt(K(x,(Tc(),$y))))&&(d=x);for(v=new as,ks(v,d,v.c.b,v.c),Mlt(e,v),_=ii(t.b,0);_.b!=_.d.c;)x=u(ri(_),86),h=Hr(K(x,(Tc(),AS))),s=Uc(e.b,h)!=null?u(Uc(e.b,h),19).a:0,Ye(x,gV,ct(s)),r=1+(Uc(e.a,h)!=null?u(Uc(e.a,h),19).a:0),Ye(x,cmt,ct(r));ur(n)}function Bbn(e,t,n,r,s){var o,h,d,v,x,_,L,P,z,q;for(P=mhn(e,n),v=0;v0),r.a.Xb(r.c=--r.b),L>P+v&&Ol(r);for(h=new C(z);h.a0),r.a.Xb(r.c=--r.b)}}function Rbn(){yi();var e,t,n,r,s,o;if(Mfe)return Mfe;for(e=new Hl(4),ly(e,Zp(cue,!0)),bC(e,Zp("M",!0)),bC(e,Zp("C",!0)),o=new Hl(4),r=0;r<11;r++)Yc(o,r,r);return t=new Hl(4),ly(t,Zp("M",!0)),Yc(t,4448,4607),Yc(t,65438,65439),s=new e_(2),pb(s,e),pb(s,nA),n=new e_(2),n.$l(Ij(o,Zp("L",!0))),n.$l(t),n=new $m(3,n),n=new Xve(s,n),Mfe=n,Mfe}function Fbn(e){var t,n;if(t=Hr(Ft(e,(bi(),PS))),!Ptt(t,e)&&!J2(e,xE)&&((!e.a&&(e.a=new at(hs,e,10,11)),e.a).i!=0||It(Mt(Ft(e,UO)))))if(t==null||ny(t).length==0){if(!Ptt(qn,e))throw n=Yr(Yr(new Fl("Unable to load default layout algorithm "),qn)," for unconfigured node "),yz(e,n),J(new M3(n.a))}else throw n=Yr(Yr(new Fl("Layout algorithm '"),t),"' not found for "),yz(e,n),J(new M3(n.a))}function uae(e){var t,n,r,s,o,h,d,v,x,_,L,P,z;if(n=e.i,t=e.n,e.b==0)for(z=n.c+t.b,P=n.b-t.b-t.c,h=e.a,v=0,_=h.length;v<_;++v)s=h[v],Nj(s,z,P);else r=vit(e,!1),Nj(e.a[0],n.c+t.b,r[0]),Nj(e.a[2],n.c+n.b-t.c-r[2],r[2]),L=n.b-t.b-t.c,r[0]>0&&(L-=r[0]+e.c,r[0]+=e.c),r[2]>0&&(L-=r[2]+e.c),r[1]=b.Math.max(r[1],L),Nj(e.a[1],n.c+t.b+r[0]-(r[1]-L)/2,r[1]);for(o=e.a,d=0,x=o.length;d0?(e.n.c.length-1)*e.i:0,r=new C(e.n);r.a1)for(r=ii(s,0);r.b!=r.d.c;)for(n=u(ri(r),231),o=0,v=new C(n.e);v.a0&&(t[0]+=e.c,L-=t[0]),t[2]>0&&(L-=t[2]+e.c),t[1]=b.Math.max(t[1],L),Pj(e.a[1],r.d+n.d+t[0]-(t[1]-L)/2,t[1]);else for(q=r.d+n.d,z=r.a-n.d-n.a,h=e.a,v=0,_=h.length;v<_;++v)s=h[v],Pj(s,q,z);for(o=e.a,d=0,x=o.length;d=0&&o!=n))throw J(new Ln(YI));for(s=0,v=0;v0||Kv(s.b.d,e.b.d+e.b.a)==0&&r.b<0||Kv(s.b.d+s.b.a,e.b.d)==0&&r.b>0){d=0;break}}else d=b.Math.min(d,Eat(e,s,r));d=b.Math.min(d,Eut(e,o,d,r))}return d}function mI(e,t){var n,r,s,o,h,d,v;if(e.b<2)throw J(new Ln("The vector chain must contain at least a source and a target point."));for(s=(Qn(e.b!=0),u(e.a.a.c,8)),nj(t,s.a,s.b),v=new _6((!t.a&&(t.a=new Bs(ef,t,5)),t.a)),h=ii(e,1);h.aUe(A1(h.g,h.d[0]).a)?(Qn(v.b>0),v.a.Xb(v.c=--v.b),Dm(v,h),s=!0):d.e&&d.e.gc()>0&&(o=(!d.e&&(d.e=new st),d.e).Mc(t),x=(!d.e&&(d.e=new st),d.e).Mc(n),(o||x)&&((!d.e&&(d.e=new st),d.e).Fc(h),++h.c));s||(r.c[r.c.length]=h)}function Cut(e){var t,n,r;if(R3(u(K(e,(pt(),bs)),98)))for(n=new C(e.j);n.a>>0,"0"+t.toString(16)),r="\\x"+jl(n,n.length-2,n.length)):e>=so?(n=(t=e>>>0,"0"+t.toString(16)),r="\\v"+jl(n,n.length-6,n.length)):r=""+String.fromCharCode(e&Ss)}return r}function hae(e,t){var n,r,s,o,h,d,v,x,_,L;if(h=e.e,v=t.e,v==0)return e;if(h==0)return t.e==0?t:new z3(-t.e,t.d,t.a);if(o=e.d,d=t.d,o+d==2)return n=qs(e.a[0],yo),r=qs(t.a[0],yo),h<0&&(n=M8(n)),v<0&&(r=M8(r)),WD(Wp(n,r));if(s=o!=d?o>d?1:-1:mye(e.a,t.a,o),s==-1)L=-v,_=h==v?Ore(t.a,d,e.a,o):Pre(t.a,d,e.a,o);else if(L=h,h==v){if(s==0)return Qp(),K7;_=Ore(e.a,o,t.a,d)}else _=Pre(e.a,o,t.a,d);return x=new z3(L,_.length,_),E_(x),x}function G5e(e){var t,n,r,s,o,h;for(this.e=new st,this.a=new st,n=e.b-1;n<3;n++)c8(e,0,u(s1(e,0),8));if(e.b<4)throw J(new Ln("At (least dimension + 1) control points are necessary!"));for(this.b=3,this.d=!0,this.c=!1,M0n(this,e.b+this.b-1),h=new st,o=new C(this.e),t=0;t=t.o&&n.f<=t.f||t.a*.5<=n.f&&t.a*1.5>=n.f){if(h=u(St(t.n,t.n.c.length-1),211),h.e+h.d+n.g+s<=r&&(o=u(St(t.n,t.n.c.length-1),211),o.f-e.f+n.f<=e.b||e.a.c.length==1))return zye(t,n),!0;if(t.s+n.g<=r&&(t.t+t.d+n.f+s<=e.b||e.a.c.length==1))return it(t.b,n),d=u(St(t.n,t.n.c.length-1),211),it(t.n,new o$(t.s,d.f+d.a+t.i,t.i)),T3e(u(St(t.n,t.n.c.length-1),211),n),yut(t,n),!0}return!1}function Aut(e,t,n){var r,s,o,h;return e.ej()?(s=null,o=e.fj(),r=e.Zi(1,h=Vre(e,t,n),n,t,o),e.bj()&&!(e.ni()&&h!=null?Ci(h,n):je(h)===je(n))?(h!=null&&(s=e.dj(h,s)),s=e.cj(n,s),e.ij()&&(s=e.lj(h,n,s)),s?(s.Ei(r),s.Fi()):e.$i(r)):(e.ij()&&(s=e.lj(h,n,s)),s?(s.Ei(r),s.Fi()):e.$i(r)),h):(h=Vre(e,t,n),e.bj()&&!(e.ni()&&h!=null?Ci(h,n):je(h)===je(n))&&(s=null,h!=null&&(s=e.dj(h,null)),s=e.cj(n,s),s&&s.Fi()),h)}function lC(e,t){var n,r,s,o,h,d,v,x;t%=24,e.q.getHours()!=t&&(r=new b.Date(e.q.getTime()),r.setDate(r.getDate()+1),d=e.q.getTimezoneOffset()-r.getTimezoneOffset(),d>0&&(v=d/60|0,x=d%60,s=e.q.getDate(),n=e.q.getHours(),n+v>=24&&++s,o=new b.Date(e.q.getFullYear(),e.q.getMonth(),s,t+v,e.q.getMinutes()+x,e.q.getSeconds(),e.q.getMilliseconds()),e.q.setTime(o.getTime()))),h=e.q.getTime(),e.q.setTime(h+36e5),e.q.getHours()!=t&&e.q.setTime(h)}function Wbn(e,t){var n,r,s,o,h;if(kr(t,"Path-Like Graph Wrapping",1),e.b.c.length==0){ur(t);return}if(s=new X4e(e),h=(s.i==null&&(s.i=Gme(s,new AB)),Ue(s.i)*s.f),n=h/(s.i==null&&(s.i=Gme(s,new AB)),Ue(s.i)),s.b>n){ur(t);return}switch(u(K(e,(pt(),ehe)),337).g){case 2:o=new MB;break;case 0:o=new SB;break;default:o=new DB}if(r=o.Vf(e,s),!o.Wf())switch(u(K(e,tV),338).g){case 2:r=Tat(s,r);break;case 1:r=Est(s,r)}qvn(e,s,r),ur(t)}function Kbn(e,t){var n,r,s,o;if(Ien(e.d,e.e),e.c.a.$b(),Ue(ft(K(t.j,(pt(),qq))))!=0||Ue(ft(K(t.j,qq)))!=0)for(n=O7,je(K(t.j,h2))!==je((R0(),f2))&&Ye(t.j,(et(),kw),(Mn(),!0)),o=u(K(t.j,vS),19).a,s=0;ss&&++x,it(h,(xn(d+x,t.c.length),u(t.c[d+x],19))),v+=(xn(d+x,t.c.length),u(t.c[d+x],19)).a-r,++n;n1&&(v>Wu(d)*Dl(d)/2||h.b==0)&&(L=new H$(P),_=Wu(d)/Dl(d),x=Sae(L,t,new g6,n,r,s,_),Ni(Zf(L.e),x),d=L,z.c[z.c.length]=L,v=0,P.c=Me(Yn,yt,1,0,5,1)));return Rs(z,P),z}function Qbn(e,t,n,r){var s,o,h,d,v,x,_,L,P,z,q,W;if(n.mh(t)&&(_=(z=t,z?u(r,49).xh(z):null),_))if(W=n.bh(t,e.a),q=t.t,q>1||q==-1)if(L=u(W,69),P=u(_,69),L.dc())P.$b();else for(h=!!go(t),o=0,d=e.a?L.Kc():L.Zh();d.Ob();)x=u(d.Pb(),56),s=u(Fv(e,x),56),s?(h?(v=P.Xc(s),v==-1?P.Xh(o,s):o!=v&&P.ji(o,s)):P.Xh(o,s),++o):e.b&&!h&&(P.Xh(o,x),++o);else W==null?_.Wb(null):(s=Fv(e,W),s==null?e.b&&!go(t)&&_.Wb(W):_.Wb(s))}function Zbn(e,t){var n,r,s,o,h,d,v,x;for(n=new TY,s=new cr(fr(Xo(t).a.Kc(),new V));Vr(s);)if(r=u(Pr(s),17),!to(r)&&(d=r.c.i,a4e(d,iq))){if(x=k5e(e,d,iq,rq),x==-1)continue;n.b=b.Math.max(n.b,x),!n.a&&(n.a=new st),it(n.a,d)}for(h=new cr(fr(js(t).a.Kc(),new V));Vr(h);)if(o=u(Pr(h),17),!to(o)&&(v=o.d.i,a4e(v,rq))){if(x=k5e(e,v,rq,iq),x==-1)continue;n.d=b.Math.max(n.d,x),!n.c&&(n.c=new st),it(n.c,v)}return n}function Lut(e){d7();var t,n,r,s;if(t=_s(e),e1e6)throw J(new lF("power of ten too big"));if(e<=Ei)return $6(lI(yk[1],t),t);for(r=lI(yk[1],Ei),s=r,n=Ou(e-Ei),t=_s(e%Ei);Mc(n,Ei)>0;)s=W3(s,r),n=Wp(n,Ei);for(s=W3(s,lI(yk[1],t)),s=$6(s,Ei),n=Ou(e-Ei);Mc(n,Ei)>0;)s=$6(s,Ei),n=Wp(n,Ei);return s=$6(s,t),s}function Jbn(e,t){var n,r,s,o,h,d,v,x,_;for(kr(t,"Hierarchical port dummy size processing",1),v=new st,_=new st,r=Ue(ft(K(e,(pt(),V4)))),n=r*2,o=new C(e.b);o.ax&&r>x)_=d,x=Ue(t.p[d.p])+Ue(t.d[d.p])+d.o.b+d.d.a;else{s=!1,n.n&&V2(n,"bk node placement breaks on "+d+" which should have been after "+_);break}if(!s)break}return n.n&&V2(n,t+" is feasible: "+s),s}function ivn(e,t,n,r){var s,o,h,d,v,x,_;for(d=-1,_=new C(e);_.a<_.c.c.length;)x=u(Y(_),112),x.g=d--,s=Or(g$(Yj(Vi(new vn(null,new mn(x.f,16)),new AQ),new LQ)).d),o=Or(g$(Yj(Vi(new vn(null,new mn(x.k,16)),new MQ),new U5)).d),h=s,v=o,r||(h=Or(g$(Yj(new vn(null,new mn(x.f,16)),new DQ)).d),v=Or(g$(Yj(new vn(null,new mn(x.k,16)),new IQ)).d)),x.d=h,x.a=s,x.i=v,x.b=o,v==0?ks(n,x,n.c.b,n.c):h==0&&ks(t,x,t.c.b,t.c)}function svn(e,t,n,r){var s,o,h,d,v,x,_;if(n.d.i!=t.i){for(s=new H0(e),T0(s,(zn(),ca)),Ye(s,(et(),Mi),n),Ye(s,(pt(),bs),(wa(),tu)),r.c[r.c.length]=s,h=new $c,rc(h,s),Vs(h,(ht(),Dn)),d=new $c,rc(d,s),Vs(d,$n),_=n.d,ba(n,h),o=new Iv,Ho(o,n),Ye(o,Fo,null),Va(o,d),ba(o,_),x=new Ea(n.b,0);x.b=X&&e.e[v.p]>q*e.b||Ee>=n*X)&&(P.c[P.c.length]=d,d=new st,no(h,o),o.a.$b(),x-=_,z=b.Math.max(z,x*e.b+W),x+=Ee,Ce=Ee,Ee=0,_=0,W=0);return new xa(z,P)}function cvn(e){var t,n,r,s,o,h,d,v,x,_,L,P,z;for(n=(x=new E1(e.c.b).a.vc().Kc(),new T1(x));n.a.Ob();)t=(d=u(n.a.Pb(),42),u(d.dd(),149)),s=t.a,s==null&&(s=""),r=NKt(e.c,s),!r&&s.length==0&&(r=Pan(e)),r&&!Xm(r.c,t,!1)&&ci(r.c,t);for(h=ii(e.a,0);h.b!=h.d.c;)o=u(ri(h),478),_=Lre(e.c,o.a),z=Lre(e.c,o.b),_&&z&&ci(_.c,new xa(z,o.c));for(Rh(e.a),P=ii(e.b,0);P.b!=P.d.c;)L=u(ri(P),478),t=OKt(e.c,L.a),v=Lre(e.c,L.b),t&&v&&EUt(t,v,L.c);Rh(e.b)}function uvn(e,t,n){var r,s,o,h,d,v,x,_,L,P,z;o=new $x(e),h=new Yit,s=(oD(h.g),oD(h.j),sl(h.b),oD(h.d),oD(h.i),sl(h.k),sl(h.c),sl(h.e),z=Iat(h,o,null),kot(h,o),z),t&&(x=new $x(t),d=mvn(x),w4e(s,ie(re(nSe,1),yt,527,0,[d]))),P=!1,L=!1,n&&(x=new $x(n),bG in x.a&&(P=M0(x,bG).ge().a),q1t in x.a&&(L=M0(x,q1t).ge().a)),_=hze(zet(new Ux,P),L),n1n(new dZ,s,_),bG in o.a&&t1(o,bG,null),(P||L)&&(v=new p6,_ut(_,v,P,L),t1(o,bG,v)),r=new w$e(h),Xsn(new H2e(s),r)}function lvn(e,t,n){var r,s,o,h,d,v,x,_,L;for(h=new est,x=ie(re(Lr,1),Jr,25,15,[0]),s=-1,o=0,r=0,v=0;v0){if(s<0&&_.a&&(s=v,o=x[0],r=0),s>=0){if(d=_.b,v==s&&(d-=r++,d==0))return 0;if(!Ilt(t,x,_,d,h)){v=s-1,x[0]=o;continue}}else if(s=-1,!Ilt(t,x,_,0,h))return 0}else{if(s=-1,Ma(_.c,0)==32){if(L=x[0],QJe(t,x),x[0]>L)continue}else if(qJt(t,_.c,x[0])){x[0]+=_.c.length;continue}return 0}return qmn(h,n)?x[0]:0}function fC(e){var t,n,r,s,o,h,d,v;if(!e.f){if(v=new E0,d=new E0,t=XS,h=t.a.zc(e,t),h==null){for(o=new rr(jo(e));o.e!=o.i.gc();)s=u(pr(o),26),fs(v,fC(s));t.a.Bc(e)!=null,t.a.gc()==0}for(r=(!e.s&&(e.s=new at(ju,e,21,17)),new rr(e.s));r.e!=r.i.gc();)n=u(pr(r),170),we(n,99)&&Br(d,u(n,18));Km(d),e.r=new GWe(e,(u(Te(He((Rp(),En).o),6),18),d.i),d.g),fs(v,e.r),Km(v),e.f=new B3((u(Te(He(En.o),5),18),v.i),v.g),dl(e).b&=-3}return e.f}function hvn(e){var t,n,r,s,o,h,d,v,x,_,L,P,z,q;for(h=e.o,r=Me(Lr,Jr,25,h,15,1),s=Me(Lr,Jr,25,h,15,1),n=e.p,t=Me(Lr,Jr,25,n,15,1),o=Me(Lr,Jr,25,n,15,1),x=0;x=0&&!i4(e,_,L);)--L;s[_]=L}for(z=0;z=0&&!i4(e,d,q);)--d;o[q]=d}for(v=0;vt[P]&&Pr[v]&&hz(e,v,P,!1,!0)}function q5e(e){var t,n,r,s,o,h,d,v;n=It(Mt(K(e,(a1(),opt)))),o=e.a.c.d,d=e.a.d.d,n?(h=bd(da(new Pt(d.a,d.b),o),.5),v=bd(fc(e.e),.5),t=da(Ni(new Pt(o.a,o.b),h),v),ybe(e.d,t)):(s=Ue(ft(K(e.a,ppt))),r=e.d,o.a>=d.a?o.b>=d.b?(r.a=d.a+(o.a-d.a)/2+s,r.b=d.b+(o.b-d.b)/2-s-e.e.b):(r.a=d.a+(o.a-d.a)/2+s,r.b=o.b+(d.b-o.b)/2+s):o.b>=d.b?(r.a=o.a+(d.a-o.a)/2+s,r.b=d.b+(o.b-d.b)/2+s):(r.a=o.a+(d.a-o.a)/2+s,r.b=o.b+(d.b-o.b)/2-s-e.e.b))}function Xc(e,t){var n,r,s,o,h,d,v;if(e==null)return null;if(o=e.length,o==0)return"";for(v=Me(Sh,Td,25,o,15,1),ame(0,o,e.length),ame(0,o,v.length),YKe(e,0,o,v,0),n=null,d=t,s=0,h=0;s0?jl(n.a,0,o-1):""):e.substr(0,o-1):n?n.a:e}function Iut(e){wv(e,new gb(gv(hv(dv(fv(new lg,yb),"ELK DisCo"),"Layouter for arranging unconnected subgraphs. The subgraphs themselves are, by default, not laid out."),new pi))),dt(e,yb,_oe,xt(U7e)),dt(e,yb,Coe,xt(Rue)),dt(e,yb,fk,xt(Ugt)),dt(e,yb,uw,xt(V7e)),dt(e,yb,L6e,xt(Xgt)),dt(e,yb,M6e,xt(Ygt)),dt(e,yb,A6e,xt(Qgt)),dt(e,yb,D6e,xt(Kgt)),dt(e,yb,F6e,xt(Wgt)),dt(e,yb,j6e,xt(Bue)),dt(e,yb,$6e,xt(q7e)),dt(e,yb,H6e,xt(XG))}function V5e(e,t,n,r){var s,o,h,d,v,x,_,L,P;if(o=new H0(e),T0(o,(zn(),Jc)),Ye(o,(pt(),bs),(wa(),tu)),s=0,t){for(h=new $c,Ye(h,(et(),Mi),t),Ye(o,Mi,t.i),Vs(h,(ht(),Dn)),rc(h,o),P=kd(t.e),x=P,_=0,L=x.length;_0)if(n-=r.length-t,n>=0){for(s.a+="0.";n>Ab.length;n-=Ab.length)cKe(s,Ab);qUe(s,Ab,_s(n)),Yr(s,r.substr(t))}else n=t-n,Yr(s,jl(r,t,_s(n))),s.a+=".",Yr(s,IM(r,_s(n)));else{for(Yr(s,r.substr(t));n<-Ab.length;n+=Ab.length)cKe(s,Ab);qUe(s,Ab,_s(-n))}return s.a}function U5e(e,t,n,r){var s,o,h,d,v,x,_,L,P;return v=da(new Pt(n.a,n.b),e),x=v.a*t.b-v.b*t.a,_=t.a*r.b-t.b*r.a,L=(v.a*r.b-v.b*r.a)/_,P=x/_,_==0?x==0?(s=Ni(new Pt(n.a,n.b),bd(new Pt(r.a,r.b),.5)),o=Hp(e,s),h=Hp(Ni(new Pt(e.a,e.b),t),s),d=b.Math.sqrt(r.a*r.a+r.b*r.b)*.5,o=0&&L<=1&&P>=0&&P<=1?Ni(new Pt(e.a,e.b),bd(new Pt(t.a,t.b),L)):null}function dvn(e,t,n){var r,s,o,h,d;if(r=u(K(e,(pt(),$le)),21),n.a>t.a&&(r.Hc((ty(),HO))?e.c.a+=(n.a-t.a)/2:r.Hc(zO)&&(e.c.a+=n.a-t.a)),n.b>t.b&&(r.Hc((ty(),qO))?e.c.b+=(n.b-t.b)/2:r.Hc(GO)&&(e.c.b+=n.b-t.b)),u(K(e,(et(),eu)),21).Hc((mo(),Th))&&(n.a>t.a||n.b>t.b))for(d=new C(e.a);d.at.a&&(r.Hc((ty(),HO))?e.c.a+=(n.a-t.a)/2:r.Hc(zO)&&(e.c.a+=n.a-t.a)),n.b>t.b&&(r.Hc((ty(),qO))?e.c.b+=(n.b-t.b)/2:r.Hc(GO)&&(e.c.b+=n.b-t.b)),u(K(e,(et(),eu)),21).Hc((mo(),Th))&&(n.a>t.a||n.b>t.b))for(h=new C(e.a);h.at&&(s=0,o+=_.b+n,L.c[L.c.length]=_,_=new Lwe(o,n),r=new wie(0,_.f,_,n),q$(_,r),s=0),r.b.c.length==0||v.f>=r.o&&v.f<=r.f||r.a*.5<=v.f&&r.a*1.5>=v.f?zye(r,v):(h=new wie(r.s+r.r+n,_.f,_,n),q$(_,h),zye(h,v)),s=v.i+v.g;return L.c[L.c.length]=_,L}function b4(e){var t,n,r,s,o,h,d,v;if(!e.a){if(e.o=null,v=new F$e(e),t=new vp,n=XS,d=n.a.zc(e,n),d==null){for(h=new rr(jo(e));h.e!=h.i.gc();)o=u(pr(h),26),fs(v,b4(o));n.a.Bc(e)!=null,n.a.gc()==0}for(s=(!e.s&&(e.s=new at(ju,e,21,17)),new rr(e.s));s.e!=s.i.gc();)r=u(pr(s),170),we(r,322)&&Br(t,u(r,34));Km(t),e.k=new zWe(e,(u(Te(He((Rp(),En).o),7),18),t.i),t.g),fs(v,e.k),Km(v),e.a=new B3((u(Te(He(En.o),4),18),v.i),v.g),dl(e).b&=-2}return e.a}function vvn(e,t,n,r,s,o,h){var d,v,x,_,L,P;return L=!1,v=$ot(n.q,t.f+t.b-n.q.f),P=s-(n.q.e+v-h),P=(xn(o,e.c.length),u(e.c[o],200)).e,_=(d=dC(r,P,!1),d.a),_>t.b&&!x)?!1:((x||_<=t.b)&&(x&&_>t.b?(n.d=_,fD(n,qst(n,_))):(ust(n.q,v),n.c=!0),fD(r,s-(n.s+n.r)),KD(r,n.q.e+n.q.d,t.f),q$(t,r),e.c.length>o&&(JD((xn(o,e.c.length),u(e.c[o],200)),r),(xn(o,e.c.length),u(e.c[o],200)).a.c.length==0&&Eg(e,o)),L=!0),L)}function W5e(e,t,n,r){var s,o,h,d,v,x,_;if(_=pu(e.e.Tg(),t),s=0,o=u(e.g,119),v=null,ho(),u(t,66).Oj()){for(d=0;de.o.a&&(_=(v-e.o.a)/2,d.b=b.Math.max(d.b,_),d.c=b.Math.max(d.c,_))}}function mvn(e){var t,n,r,s,o,h,d,v;for(o=new uQe,rWt(o,(W6(),Fyt)),r=(s=aie(e,Me(mt,Qe,2,0,6,1)),new c6(new Al(new lte(e,s).b)));r.b0?e.i:0)>t&&v>0&&(o=0,h+=v+e.i,s=b.Math.max(s,P),r+=v+e.i,v=0,P=0,n&&(++L,it(e.n,new o$(e.s,h,e.i))),d=0),P+=x.g+(d>0?e.i:0),v=b.Math.max(v,x.f),n&&T3e(u(St(e.n,L),211),x),o+=x.g+(d>0?e.i:0),++d;return s=b.Math.max(s,P),r+=v,n&&(e.r=s,e.d=r,A3e(e.j)),new fh(e.s,e.t,s,r)}function Hc(e,t,n,r,s){Ud();var o,h,d,v,x,_,L,P,z;if(Wve(e,"src"),Wve(n,"dest"),P=pl(e),v=pl(n),bve((P.i&4)!=0,"srcType is not an array"),bve((v.i&4)!=0,"destType is not an array"),L=P.c,h=v.c,bve(L.i&1?L==h:(h.i&1)==0,"Array types don't match"),z=e.length,x=n.length,t<0||r<0||s<0||t+s>z||r+s>x)throw J(new cpe);if(!(L.i&1)&&P!=v)if(_=tb(e),o=tb(n),je(e)===je(n)&&tr;)cs(o,d,_[--t]);else for(d=r+s;r0&&O4e(e,t,n,r,s,!0)}function pae(){pae=pe,P0t=ie(re(Lr,1),Jr,25,15,[$a,1162261467,wC,1220703125,362797056,1977326743,wC,387420489,Lz,214358881,429981696,815730721,1475789056,170859375,268435456,410338673,612220032,893871739,128e7,1801088541,113379904,148035889,191102976,244140625,308915776,387420489,481890304,594823321,729e6,887503681,wC,1291467969,1544804416,1838265625,60466176]),B0t=ie(re(Lr,1),Jr,25,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 yvn(e){var t,n,r,s,o,h,d,v;for(s=new C(e.b);s.a=e.b.length?(o[s++]=h.b[r++],o[s++]=h.b[r++]):r>=h.b.length?(o[s++]=e.b[n++],o[s++]=e.b[n++]):h.b[r]0?e.i:0)),++t;for(Ion(e.n,v),e.d=n,e.r=r,e.g=0,e.f=0,e.e=0,e.o=gs,e.p=gs,o=new C(e.b);o.a0&&(s=(!e.n&&(e.n=new at(Jo,e,1,7)),u(Te(e.n,0),137)).a,!s||Yr(Yr((t.a+=' "',t),s),'"'))),n=(!e.b&&(e.b=new wn(mr,e,4,7)),!(e.b.i<=1&&(!e.c&&(e.c=new wn(mr,e,5,8)),e.c.i<=1))),n?t.a+=" [":t.a+=" ",Yr(t,rbe(new ste,new rr(e.b))),n&&(t.a+="]"),t.a+=Ioe,n&&(t.a+="["),Yr(t,rbe(new ste,new rr(e.c))),n&&(t.a+="]"),t.a)}function bae(e,t){var n,r,s,o,h,d,v;if(e.a){if(d=e.a.ne(),v=null,d!=null?t.a+=""+d:(h=e.a.Dj(),h!=null&&(o=pd(h,Nu(91)),o!=-1?(v=h.substr(o),t.a+=""+jl(h==null?Pu:(Sn(h),h),0,o)):t.a+=""+h)),e.d&&e.d.i!=0){for(s=!0,t.a+="<",r=new rr(e.d);r.e!=r.i.gc();)n=u(pr(r),87),s?s=!1:t.a+=io,bae(n,t);t.a+=">"}v!=null&&(t.a+=""+v)}else e.e?(d=e.e.zb,d!=null&&(t.a+=""+d)):(t.a+="?",e.b?(t.a+=" super ",bae(e.b,t)):e.f&&(t.a+=" extends ",bae(e.f,t)))}function Evn(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt,bt,zt,Ut,In;for(Ve=e.c,nt=t.c,n=Yo(Ve.a,e,0),r=Yo(nt.a,t,0),Ee=u(Yv(e,(vo(),ul)).Kc().Pb(),11),Ut=u(Yv(e,hu).Kc().Pb(),11),Ne=u(Yv(t,ul).Kc().Pb(),11),In=u(Yv(t,hu).Kc().Pb(),11),le=kd(Ee.e),bt=kd(Ut.g),Ce=kd(Ne.e),zt=kd(In.g),ey(e,r,nt),h=Ce,_=0,q=h.length;__?new X2((Jf(),jy),n,t,x-_):x>0&&_>0&&(new X2((Jf(),jy),t,n,0),new X2(jy,n,t,0))),h)}function Put(e,t){var n,r,s,o,h,d;for(h=new ob(new dg(e.f.b).a);h.b;){if(o=$v(h),s=u(o.cd(),594),t==1){if(s.gf()!=(wo(),X0)&&s.gf()!=Y0)continue}else if(s.gf()!=(wo(),Xh)&&s.gf()!=Df)continue;switch(r=u(u(o.dd(),46).b,81),d=u(u(o.dd(),46).a,189),n=d.c,s.gf().g){case 2:r.g.c=e.e.a,r.g.b=b.Math.max(1,r.g.b+n);break;case 1:r.g.c=r.g.c+n,r.g.b=b.Math.max(1,r.g.b-n);break;case 4:r.g.d=e.e.b,r.g.a=b.Math.max(1,r.g.a+n);break;case 3:r.g.d=r.g.d+n,r.g.a=b.Math.max(1,r.g.a-n)}}}function Tvn(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W;for(d=Me(Lr,Jr,25,t.b.c.length,15,1),x=Me(Zue,tt,267,t.b.c.length,0,1),v=Me(h0,Bg,10,t.b.c.length,0,1),L=e.a,P=0,z=L.length;P0&&v[r]&&(q=j3(e.b,v[r],s)),W=b.Math.max(W,s.c.c.b+q);for(o=new C(_.e);o.a1)throw J(new Ln(eO));v||(o=Jd(t,r.Kc().Pb()),h.Fc(o))}return iye(e,T4e(e,t,n),h)}function Svn(e,t){var n,r,s,o;for(lin(t.b.j),ms(Cu(new vn(null,new mn(t.d,16)),new FX),new jX),o=new C(t.d);o.ae.o.b||(n=ac(e,$n),d=t.d+t.a+(n.gc()-1)*h,d>e.o.b)))}function mae(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q;if(h=e.e,v=t.e,h==0)return t;if(v==0)return e;if(o=e.d,d=t.d,o+d==2)return n=qs(e.a[0],yo),r=qs(t.a[0],yo),h==v?(_=Ua(n,r),q=Or(_),z=Or(Nm(_,32)),z==0?new Tg(h,q):new z3(h,2,ie(re(Lr,1),Jr,25,15,[q,z]))):WD(h<0?Wp(r,n):Wp(n,r));if(h==v)P=h,L=o>=d?Pre(e.a,o,t.a,d):Pre(t.a,d,e.a,o);else{if(s=o!=d?o>d?1:-1:mye(e.a,t.a,o),s==0)return Qp(),K7;s==1?(P=h,L=Ore(e.a,o,t.a,d)):(P=v,L=Ore(t.a,d,e.a,o))}return x=new z3(P,L.length,L),E_(x),x}function yae(e,t,n,r,s,o,h){var d,v,x,_,L,P,z;return L=It(Mt(K(t,(pt(),HTe)))),P=null,o==(vo(),ul)&&r.c.i==n?P=r.c:o==hu&&r.d.i==n&&(P=r.d),x=h,!x||!L||P?(_=(ht(),uc),P?_=P.j:R3(u(K(n,bs),98))&&(_=o==ul?Dn:$n),v=Dvn(e,t,n,o,_,r),d=Dre((Ya(n),r)),o==ul?(Va(d,u(St(v.j,0),11)),ba(d,s)):(Va(d,s),ba(d,u(St(v.j,0),11))),x=new ert(r,d,v,u(K(v,(et(),Mi)),11),o,!P)):(it(x.e,r),z=b.Math.max(Ue(ft(K(x.d,Hg))),Ue(ft(K(r,Hg)))),Ye(x.d,Hg,z)),sn(e.a,r,new mj(x.d,t,o)),x}function wz(e,t){var n,r,s,o,h,d,v,x,_,L;if(_=null,e.d&&(_=u(Uc(e.d,t),138)),!_){if(o=e.a.Mh(),L=o.i,!e.d||MT(e.d)!=L){for(v=new Mr,e.d&&P_(v,e.d),x=v.f.c+v.g.c,d=x;d0?(z=(q-1)*n,d&&(z+=r),_&&(z+=r),z=e.b[s+1])s+=2;else if(n0)for(r=new Uu(u(Ii(e.a,o),21)),hn(),aa(r,new Di(t)),s=new Ea(o.b,0);s.bVe)?(v=2,h=Ei):v==0?(v=1,h=bt):(v=0,h=bt)):(z=bt>=h||h-bt0?1:yv(isNaN(r),isNaN(0)))>=0^(Ef(Md),(b.Math.abs(d)<=Md||d==0||isNaN(d)&&isNaN(0)?0:d<0?-1:d>0?1:yv(isNaN(d),isNaN(0)))>=0)?b.Math.max(d,r):(Ef(Md),(b.Math.abs(r)<=Md||r==0||isNaN(r)&&isNaN(0)?0:r<0?-1:r>0?1:yv(isNaN(r),isNaN(0)))>0?b.Math.sqrt(d*d+r*r):-b.Math.sqrt(d*d+r*r))}function pb(e,t){var n,r,s,o,h,d;if(t){if(!e.a&&(e.a=new oF),e.e==2){aF(e.a,t);return}if(t.e==1){for(s=0;s=so?To(n,Hye(r)):b8(n,r&Ss),h=new cre(10,null,0),wZt(e.a,h,d-1)):(n=(h.bm().length+o,new ST),To(n,h.bm())),t.e==0?(r=t._l(),r>=so?To(n,Hye(r)):b8(n,r&Ss)):To(n,t.bm()),u(h,521).b=n.a}}function Gut(e){var t,n,r,s,o;return e.g!=null?e.g:e.a<32?(e.g=nyn(Ou(e.f),_s(e.e)),e.g):(s=Lae((!e.c&&(e.c=FD(e.f)),e.c),0),e.e==0?s:(t=(!e.c&&(e.c=FD(e.f)),e.c).e<0?2:1,n=s.length,r=-e.e+n-t,o=new Tp,o.a+=""+s,e.e>0&&r>=-6?r>=0?rD(o,n-_s(e.e),String.fromCharCode(46)):(o.a=jl(o.a,0,t-1)+"0."+IM(o.a,t-1),rD(o,t+1,jh(Ab,0,-_s(r)-1))):(n-t>=1&&(rD(o,t,String.fromCharCode(46)),++n),rD(o,n,String.fromCharCode(69)),r>0&&rD(o,++n,String.fromCharCode(43)),rD(o,++n,""+d_(Ou(r)))),e.g=o.a,e.g))}function qvn(e,t,n){var r,s,o,h,d,v,x,_,L,P,z,q,W,X;if(!n.dc()){for(d=0,P=0,r=n.Kc(),q=u(r.Pb(),19).a;d1&&(v=x.mg(v,e.a,d));return v.c.length==1?u(St(v,v.c.length-1),220):v.c.length==2?Ovn((xn(0,v.c.length),u(v.c[0],220)),(xn(1,v.c.length),u(v.c[1],220)),h,o):null}function qut(e){var t,n,r,s,o,h;for(Mu(e.a,new bL),n=new C(e.a);n.a=b.Math.abs(r.b)?(r.b=0,o.d+o.a>h.d&&o.dh.c&&o.c0){if(t=new O2e(e.i,e.g),n=e.i,o=n<100?null:new _p(n),e.ij())for(r=0;r0){for(d=e.g,x=e.i,A_(e),o=x<100?null:new _p(x),r=0;r>13|(e.m&15)<<9,s=e.m>>4&8191,o=e.m>>17|(e.h&255)<<5,h=(e.h&1048320)>>8,d=t.l&8191,v=t.l>>13|(t.m&15)<<9,x=t.m>>4&8191,_=t.m>>17|(t.h&255)<<5,L=(t.h&1048320)>>8,zt=n*d,Ut=r*d,In=s*d,Rn=o*d,dr=h*d,v!=0&&(Ut+=n*v,In+=r*v,Rn+=s*v,dr+=o*v),x!=0&&(In+=n*x,Rn+=r*x,dr+=s*x),_!=0&&(Rn+=n*_,dr+=r*_),L!=0&&(dr+=n*L),z=zt&ml,q=(Ut&511)<<13,P=z+q,X=zt>>22,le=Ut>>9,Ce=(In&262143)<<4,Ee=(Rn&31)<<17,W=X+le+Ce+Ee,Ve=In>>18,nt=Rn>>5,bt=(dr&4095)<<8,Ne=Ve+nt+bt,W+=P>>22,P&=ml,Ne+=W>>22,W&=ml,Ne&=V0,fu(P,W,Ne)}function Vut(e){var t,n,r,s,o,h,d;if(d=u(St(e.j,0),11),d.g.c.length!=0&&d.e.c.length!=0)throw J(new Wo("Interactive layout does not support NORTH/SOUTH ports with incoming _and_ outgoing edges."));if(d.g.c.length!=0){for(o=gs,n=new C(d.g);n.a4)if(e.wj(t)){if(e.rk()){if(s=u(t,49),r=s.Ug(),v=r==e.e&&(e.Dk()?s.Og(s.Vg(),e.zk())==e.Ak():-1-s.Vg()==e.aj()),e.Ek()&&!v&&!r&&s.Zg()){for(o=0;o0&&(x=e.n.a/o);break;case 2:case 4:s=e.i.o.b,s>0&&(x=e.n.b/s)}Ye(e,(et(),Ew),x)}if(v=e.o,h=e.a,r)h.a=r.a,h.b=r.b,e.d=!0;else if(t!=X1&&t!=w2&&d!=uc)switch(d.g){case 1:h.a=v.a/2;break;case 2:h.a=v.a,h.b=v.b/2;break;case 3:h.a=v.a/2,h.b=v.b;break;case 4:h.b=v.b/2}else h.a=v.a/2,h.b=v.b/2}function pC(e){var t,n,r,s,o,h,d,v,x,_;if(e.ej())if(_=e.Vi(),v=e.fj(),_>0)if(t=new Vme(e.Gi()),n=_,o=n<100?null:new _p(n),FM(e,n,t.g),s=n==1?e.Zi(4,Te(t,0),null,0,v):e.Zi(6,t,null,-1,v),e.bj()){for(r=new rr(t);r.e!=r.i.gc();)o=e.dj(pr(r),o);o?(o.Ei(s),o.Fi()):e.$i(s)}else o?(o.Ei(s),o.Fi()):e.$i(s);else FM(e,e.Vi(),e.Wi()),e.$i(e.Zi(6,(hn(),bo),null,-1,v));else if(e.bj())if(_=e.Vi(),_>0){for(d=e.Wi(),x=_,FM(e,_,d),o=x<100?null:new _p(x),r=0;re.d[h.p]&&(n+=Gwe(e.b,o)*u(v.b,19).a,$p(e.a,ct(o)));for(;!TT(e.a);)yme(e.b,u(I6(e.a),19).a)}return n}function nwn(e,t,n,r){var s,o,h,d,v,x,_,L,P,z,q,W,X;for(L=new Io(u(Ft(e,(XH(),lSe)),8)),L.a=b.Math.max(L.a-n.b-n.c,0),L.b=b.Math.max(L.b-n.d-n.a,0),s=ft(Ft(e,oSe)),(s==null||(Sn(s),s<=0))&&(s=1.3),d=new st,q=new rr((!e.a&&(e.a=new at(hs,e,10,11)),e.a));q.e!=q.i.gc();)z=u(pr(q),33),h=new yUe(z),d.c[d.c.length]=h;switch(P=u(Ft(e,Xhe),311),P.g){case 3:X=Tbn(d,t,L.a,L.b,(x=r,Sn(s),x));break;case 1:X=Xbn(d,t,L.a,L.b,(_=r,Sn(s),_));break;default:X=swn(d,t,L.a,L.b,(v=r,Sn(s),v))}o=new H$(X),W=Sae(o,t,n,L.a,L.b,r,(Sn(s),s)),sw(e,W.a,W.b,!1,!0)}function rwn(e,t){var n,r,s,o;n=t.b,o=new Uu(n.j),s=0,r=n.j,r.c=Me(Yn,yt,1,0,5,1),Av(u(rb(e.b,(ht(),An),(qv(),mw)),15),n),s=XD(o,s,new SX,r),Av(u(rb(e.b,An,u2),15),n),s=XD(o,s,new D9,r),Av(u(rb(e.b,An,ww),15),n),Av(u(rb(e.b,$n,mw),15),n),Av(u(rb(e.b,$n,u2),15),n),s=XD(o,s,new wB,r),Av(u(rb(e.b,$n,ww),15),n),Av(u(rb(e.b,xr,mw),15),n),s=XD(o,s,new mB,r),Av(u(rb(e.b,xr,u2),15),n),s=XD(o,s,new yB,r),Av(u(rb(e.b,xr,ww),15),n),Av(u(rb(e.b,Dn,mw),15),n),s=XD(o,s,new MX,r),Av(u(rb(e.b,Dn,u2),15),n),Av(u(rb(e.b,Dn,ww),15),n)}function iwn(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W;for(kr(t,"Layer size calculation",1),_=gs,x=Ds,s=!1,d=new C(e.b);d.a.5?le-=h*2*(q-.5):q<.5&&(le+=o*2*(.5-q)),s=d.d.b,leX.a-W-_&&(le=X.a-W-_),d.n.a=t+le}}function swn(e,t,n,r,s){var o,h,d,v,x,_,L,P,z,q,W,X;for(d=Me(pa,Ao,25,e.c.length,15,1),P=new $j(new GB),I3e(P,e),x=0,W=new st;P.b.c.length!=0;)if(h=u(P.b.c.length==0?null:St(P.b,0),157),x>1&&Wu(h)*Dl(h)/2>d[0]){for(o=0;od[o];)++o;q=new Zd(W,0,o+1),L=new H$(q),_=Wu(h)/Dl(h),v=Sae(L,t,new g6,n,r,s,_),Ni(Zf(L.e),v),S8(l7(P,L)),z=new Zd(W,o+1,W.c.length),I3e(P,z),W.c=Me(Yn,yt,1,0,5,1),x=0,mKe(d,d.length,0)}else X=P.b.c.length==0?null:St(P.b,0),X!=null&&iie(P,0),x>0&&(d[x]=d[x-1]),d[x]+=Wu(h)*Dl(h),++x,W.c[W.c.length]=h;return W}function awn(e){var t,n,r,s,o;if(r=u(K(e,(pt(),vu)),163),r==(mh(),l2)){for(n=new cr(fr(Xo(e).a.Kc(),new V));Vr(n);)if(t=u(Pr(n),17),!MZe(t))throw J(new M3(Poe+QD(e)+"' 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(r==Ly){for(o=new cr(fr(js(e).a.Kc(),new V));Vr(o);)if(s=u(Pr(o),17),!MZe(s))throw J(new M3(Poe+QD(e)+"' has its layer constraint set to LAST_SEPARATE, but has at least one outgoing edge. LAST_SEPARATE nodes must not have outgoing edges."))}}function own(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q;for(kr(t,"Label dummy removal",1),r=Ue(ft(K(e,(pt(),Ok)))),s=Ue(ft(K(e,Ry))),x=u(K(e,Zl),103),v=new C(e.b);v.a0&&Zst(e,d,L);for(s=new C(L);s.a>19&&(t=U8(t),v=!v),h=agn(t),o=!1,s=!1,r=!1,e.h==MI&&e.m==0&&e.l==0)if(s=!0,o=!0,h==-1)e=hVe((D8(),B8e)),r=!0,v=!v;else return d=Y4e(e,h),v&&gie(d),n&&(s2=fu(0,0,0)),d;else e.h>>19&&(o=!0,e=U8(e),r=!0,v=!v);return h!=-1?Wsn(e,h,v,o,n):$3e(e,t)<0?(n&&(o?s2=U8(e):s2=fu(e.l,e.m,e.h)),fu(0,0,0)):Q2n(r?e:fu(e.l,e.m,e.h),t,v,o,s,n)}function mz(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q;if(e.e&&e.c.ct.f||t.g>e.f)){for(n=0,r=0,h=e.w.a.ec().Kc();h.Ob();)s=u(h.Pb(),11),Cie(sc(ie(re(na,1),Qe,8,0,[s.i.n,s.n,s.a])).b,t.g,t.f)&&++n;for(d=e.r.a.ec().Kc();d.Ob();)s=u(d.Pb(),11),Cie(sc(ie(re(na,1),Qe,8,0,[s.i.n,s.n,s.a])).b,t.g,t.f)&&--n;for(v=t.w.a.ec().Kc();v.Ob();)s=u(v.Pb(),11),Cie(sc(ie(re(na,1),Qe,8,0,[s.i.n,s.n,s.a])).b,e.g,e.f)&&++r;for(o=t.r.a.ec().Kc();o.Ob();)s=u(o.Pb(),11),Cie(sc(ie(re(na,1),Qe,8,0,[s.i.n,s.n,s.a])).b,e.g,e.f)&&--r;n=0)return s=bon(e,t.substr(1,h-1)),_=t.substr(h+1,v-(h+1)),hyn(e,_,s)}else{if(n=-1,H8e==null&&(H8e=new RegExp("\\d")),H8e.test(String.fromCharCode(d))&&(n=Wbe(t,Nu(46),v-1),n>=0)){r=u(Ire(e,Eet(e,t.substr(1,n-1)),!1),58),x=0;try{x=Wl(t.substr(n+1),$a,Ei)}catch(P){throw P=ts(P),we(P,127)?(o=P,J(new D$(o))):J(P)}if(x=0)return n;switch(Dv(Po(e,n))){case 2:{if(an("",Ag(e,n.Hj()).ne())){if(v=QM(Po(e,n)),d=m8(Po(e,n)),_=n5e(e,t,v,d),_)return _;for(s=L5e(e,t),h=0,L=s.gc();h1)throw J(new Ln(eO));for(_=pu(e.e.Tg(),t),r=u(e.g,119),h=0;h1,x=new N1(P.b);nc(x.a)||nc(x.b);)v=u(nc(x.a)?Y(x.a):Y(x.b),17),L=v.c==P?v.d:v.c,b.Math.abs(sc(ie(re(na,1),Qe,8,0,[L.i.n,L.n,L.a])).b-h.b)>1&&lpn(e,v,h,o,P)}}function mwn(e){var t,n,r,s,o,h;if(s=new Ea(e.e,0),r=new Ea(e.a,0),e.d)for(n=0;npce;){for(o=t,h=0;b.Math.abs(t-o)0),s.a.Xb(s.c=--s.b),Bbn(e,e.b-h,o,r,s),Qn(s.b0),r.a.Xb(r.c=--r.b)}if(!e.d)for(n=0;n0?(e.f[_.p]=z/(_.e.c.length+_.g.c.length),e.c=b.Math.min(e.c,e.f[_.p]),e.b=b.Math.max(e.b,e.f[_.p])):d&&(e.f[_.p]=z)}}function kwn(e){e.b=null,e.bb=null,e.fb=null,e.qb=null,e.a=null,e.c=null,e.d=null,e.e=null,e.f=null,e.n=null,e.M=null,e.L=null,e.Q=null,e.R=null,e.K=null,e.db=null,e.eb=null,e.g=null,e.i=null,e.j=null,e.k=null,e.gb=null,e.o=null,e.p=null,e.q=null,e.r=null,e.$=null,e.ib=null,e.S=null,e.T=null,e.t=null,e.s=null,e.u=null,e.v=null,e.w=null,e.B=null,e.A=null,e.C=null,e.D=null,e.F=null,e.G=null,e.H=null,e.I=null,e.J=null,e.P=null,e.Z=null,e.U=null,e.V=null,e.W=null,e.X=null,e.Y=null,e._=null,e.ab=null,e.cb=null,e.hb=null,e.nb=null,e.lb=null,e.mb=null,e.ob=null,e.pb=null,e.jb=null,e.kb=null,e.N=!1,e.O=!1}function xwn(e,t,n){var r,s,o,h;for(kr(n,"Graph transformation ("+e.a+")",1),h=Pv(t.a),o=new C(t.b);o.a0&&(e.a=v+(z-1)*o,t.c.b+=e.a,t.f.b+=e.a)),q.a.gc()!=0&&(P=new Hne(1,o),z=t6e(P,t,q,W,t.f.b+v-t.c.b),z>0&&(t.f.b+=v+(z-1)*o))}function x7(e,t){var n,r,s,o;o=e.F,t==null?(e.F=null,Y8(e,null)):(e.F=(Sn(t),t),r=pd(t,Nu(60)),r!=-1?(s=t.substr(0,r),pd(t,Nu(46))==-1&&!an(s,sk)&&!an(s,HC)&&!an(s,mG)&&!an(s,zC)&&!an(s,GC)&&!an(s,qC)&&!an(s,VC)&&!an(s,UC)&&(s=Odt),n=cj(t,Nu(62)),n!=-1&&(s+=""+t.substr(n+1)),Y8(e,s)):(s=t,pd(t,Nu(46))==-1&&(r=pd(t,Nu(91)),r!=-1&&(s=t.substr(0,r)),!an(s,sk)&&!an(s,HC)&&!an(s,mG)&&!an(s,zC)&&!an(s,GC)&&!an(s,qC)&&!an(s,VC)&&!an(s,UC)?(s=Odt,r!=-1&&(s+=""+t.substr(r))):s=t),Y8(e,s),s==t&&(e.F=e.D))),e.Db&4&&!(e.Db&1)&&_i(e,new oa(e,1,5,o,t))}function Twn(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee;if(W=t.b.c.length,!(W<3)){for(z=Me(Lr,Jr,25,W,15,1),L=0,_=new C(t.b);_.a<_.c.c.length;)x=u(Y(_),29),z[L++]=x.a.c.length;for(P=new Ea(t.b,2),r=1;rh)&&Gs(e.b,u(X.b,17));++d}o=h}}}function Z5e(e,t){var n;if(t==null||an(t,Pu)||t.length==0&&e.k!=(Ng(),Pk))return null;switch(e.k.g){case 1:return AH(t,j7)?(Mn(),U7):AH(t,Mce)?(Mn(),Sb):null;case 2:try{return ct(Wl(t,$a,Ei))}catch(r){if(r=ts(r),we(r,127))return null;throw J(r)}case 4:try{return ry(t)}catch(r){if(r=ts(r),we(r,127))return null;throw J(r)}case 3:return t;case 5:return Dnt(e),Rat(e,t);case 6:return Dnt(e),N0n(e,e.a,t);case 7:try{return n=Udn(e),n.Jf(t),n}catch(r){if(r=ts(r),we(r,32))return null;throw J(r)}default:throw J(new Wo("Invalid type set for this layout option."))}}function _wn(e){M_();var t,n,r,s,o,h,d;for(d=new aHe,n=new C(e);n.a=d.b.c)&&(d.b=t),(!d.c||t.c<=d.c.c)&&(d.d=d.c,d.c=t),(!d.e||t.d>=d.e.d)&&(d.e=t),(!d.f||t.d<=d.f.d)&&(d.f=t);return r=new IH((V8(),vw)),sD(e,jpt,new Al(ie(re(dO,1),yt,369,0,[r]))),h=new IH(_y),sD(e,Fpt,new Al(ie(re(dO,1),yt,369,0,[h]))),s=new IH(Ty),sD(e,Rpt,new Al(ie(re(dO,1),yt,369,0,[s]))),o=new IH(O4),sD(e,Bpt,new Al(ie(re(dO,1),yt,369,0,[o]))),Use(r.c,vw),Use(s.c,Ty),Use(o.c,O4),Use(h.c,_y),d.a.c=Me(Yn,yt,1,0,5,1),Rs(d.a,r.c),Rs(d.a,nb(s.c)),Rs(d.a,o.c),Rs(d.a,nb(h.c)),d}function J5e(e){var t;switch(e.d){case 1:{if(e.hj())return e.o!=-2;break}case 2:{if(e.hj())return e.o==-2;break}case 3:case 5:case 4:case 6:case 7:return e.o>-2;default:return!1}switch(t=e.gj(),e.p){case 0:return t!=null&&It(Mt(t))!=XT(e.k,0);case 1:return t!=null&&u(t,217).a!=Or(e.k)<<24>>24;case 2:return t!=null&&u(t,172).a!=(Or(e.k)&Ss);case 6:return t!=null&&XT(u(t,162).a,e.k);case 5:return t!=null&&u(t,19).a!=Or(e.k);case 7:return t!=null&&u(t,184).a!=Or(e.k)<<16>>16;case 3:return t!=null&&Ue(ft(t))!=e.j;case 4:return t!=null&&u(t,155).a!=e.j;default:return t==null?e.n!=null:!Ci(t,e.n)}}function xI(e,t,n){var r,s,o,h;return e.Fk()&&e.Ek()&&(h=One(e,u(n,56)),je(h)!==je(n))?(e.Oi(t),e.Ui(t,EJe(e,t,h)),e.rk()&&(o=(s=u(n,49),e.Dk()?e.Bk()?s.ih(e.b,go(u(gn(Su(e.b),e.aj()),18)).n,u(gn(Su(e.b),e.aj()).Yj(),26).Bj(),null):s.ih(e.b,Ji(s.Tg(),go(u(gn(Su(e.b),e.aj()),18))),null,null):s.ih(e.b,-1-e.aj(),null,null)),!u(h,49).eh()&&(o=(r=u(h,49),e.Dk()?e.Bk()?r.gh(e.b,go(u(gn(Su(e.b),e.aj()),18)).n,u(gn(Su(e.b),e.aj()).Yj(),26).Bj(),o):r.gh(e.b,Ji(r.Tg(),go(u(gn(Su(e.b),e.aj()),18))),null,o):r.gh(e.b,-1-e.aj(),null,o))),o&&o.Fi()),Ll(e.b)&&e.$i(e.Zi(9,n,h,t,!1)),h):n}function Yut(e,t,n){var r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne;for(_=Ue(ft(K(e,(pt(),Sw)))),r=Ue(ft(K(e,ZTe))),P=new rl,Ye(P,Sw,_+r),x=t,le=x.d,W=x.c.i,Ce=x.d.i,X=F2e(W.c),Ee=F2e(Ce.c),s=new st,L=X;L<=Ee;L++)d=new H0(e),T0(d,(zn(),ca)),Ye(d,(et(),Mi),x),Ye(d,bs,(wa(),tu)),Ye(d,eV,P),z=u(St(e.b,L),29),L==X?ey(d,z.a.c.length-n,z):No(d,z),Ne=Ue(ft(K(x,Hg))),Ne<0&&(Ne=0,Ye(x,Hg,Ne)),d.o.b=Ne,q=b.Math.floor(Ne/2),h=new $c,Vs(h,(ht(),Dn)),rc(h,d),h.n.b=q,v=new $c,Vs(v,$n),rc(v,d),v.n.b=q,ba(x,h),o=new Iv,Ho(o,x),Ye(o,Fo,null),Va(o,v),ba(o,le),Aln(d,x,o),s.c[s.c.length]=o,x=o;return s}function Eae(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee;for(v=u(Og(e,(ht(),Dn)).Kc().Pb(),11).e,z=u(Og(e,$n).Kc().Pb(),11).g,d=v.c.length,Ee=D1(u(St(e.j,0),11));d-- >0;){for(W=(xn(0,v.c.length),u(v.c[0],17)),s=(xn(0,z.c.length),u(z.c[0],17)),Ce=s.d.e,o=Yo(Ce,s,0),Itn(W,s.d,o),Va(s,null),ba(s,null),q=W.a,t&&ci(q,new Io(Ee)),r=ii(s.a,0);r.b!=r.d.c;)n=u(ri(r),8),ci(q,new Io(n));for(le=W.b,P=new C(s.b);P.a0&&(h=b.Math.max(h,Ett(e.C.b+r.d.b,s))),_=r,L=s,P=o;e.C&&e.C.c>0&&(z=P+e.C.c,x&&(z+=_.d.c),h=b.Math.max(h,(S1(),Ef(z1),b.Math.abs(L-1)<=z1||L==1||isNaN(L)&&isNaN(1)?0:z/(1-L)))),n.n.b=0,n.a.a=h}function Qut(e,t){var n,r,s,o,h,d,v,x,_,L,P,z;if(n=u(_o(e.b,t),124),v=u(u(Ii(e.r,t),21),84),v.dc()){n.n.d=0,n.n.a=0;return}for(x=e.u.Hc((ol(),Z0)),h=0,e.A.Hc((Bl(),Hb))&&Mct(e,t),d=v.Kc(),_=null,P=0,L=0;d.Ob();)r=u(d.Pb(),111),o=Ue(ft(r.b.We((uj(),WG)))),s=r.b.rf().b,_?(z=L+_.d.a+e.w+r.d.d,h=b.Math.max(h,(S1(),Ef(z1),b.Math.abs(P-o)<=z1||P==o||isNaN(P)&&isNaN(o)?0:z/(o-P)))):e.C&&e.C.d>0&&(h=b.Math.max(h,Ett(e.C.d+r.d.d,o))),_=r,P=o,L=s;e.C&&e.C.a>0&&(z=L+e.C.a,x&&(z+=_.d.a),h=b.Math.max(h,(S1(),Ef(z1),b.Math.abs(P-1)<=z1||P==1||isNaN(P)&&isNaN(1)?0:z/(1-P)))),n.n.d=0,n.a.b=h}function Zut(e,t,n){var r,s,o,h,d,v;for(this.g=e,d=t.d.length,v=n.d.length,this.d=Me(h0,Bg,10,d+v,0,1),h=0;h0?Xre(this,this.f/this.a):A1(t.g,t.d[0]).a!=null&&A1(n.g,n.d[0]).a!=null?Xre(this,(Ue(A1(t.g,t.d[0]).a)+Ue(A1(n.g,n.d[0]).a))/2):A1(t.g,t.d[0]).a!=null?Xre(this,A1(t.g,t.d[0]).a):A1(n.g,n.d[0]).a!=null&&Xre(this,A1(n.g,n.d[0]).a)}function Cwn(e,t){var n,r,s,o,h,d,v,x,_,L;for(e.a=new iYe(tsn(RS)),r=new C(t.a);r.a=1&&(X-h>0&&L>=0?(v.n.a+=W,v.n.b+=o*h):X-h<0&&_>=0&&(v.n.a+=W*X,v.n.b+=o));e.o.a=t.a,e.o.b=t.b,Ye(e,(pt(),Ib),(Bl(),r=u(Qf(qS),9),new hh(r,u(wf(r,r.length),9),0)))}function Mwn(e,t,n,r,s,o){var h;if(!(t==null||!$ie(t,OAe,NAe)))throw J(new Ln("invalid scheme: "+t));if(!e&&!(n!=null&&pd(n,Nu(35))==-1&&n.length>0&&(zr(0,n.length),n.charCodeAt(0)!=47)))throw J(new Ln("invalid opaquePart: "+n));if(e&&!(t!=null&&gM(ZV,t.toLowerCase()))&&!(n==null||!$ie(n,KS,YS)))throw J(new Ln(ydt+n));if(e&&t!=null&&gM(ZV,t.toLowerCase())&&!Ehn(n))throw J(new Ln(ydt+n));if(!Son(r))throw J(new Ln("invalid device: "+r));if(!yan(s))throw h=s==null?"invalid segments: null":"invalid segment: "+ban(s),J(new Ln(h));if(!(o==null||pd(o,Nu(35))==-1))throw J(new Ln("invalid query: "+o))}function Dwn(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le;for(kr(t,"Calculate Graph Size",1),t.n&&e&&yf(t,kf(e),(Pl(),nh)),d=O7,v=O7,o=Exe,h=Exe,L=new rr((!e.a&&(e.a=new at(hs,e,10,11)),e.a));L.e!=L.i.gc();)x=u(pr(L),33),q=x.i,W=x.j,le=x.g,r=x.f,s=u(Ft(x,(bi(),WO)),142),d=b.Math.min(d,q-s.b),v=b.Math.min(v,W-s.d),o=b.Math.max(o,q+le+s.c),h=b.Math.max(h,W+r+s.a);for(z=u(Ft(e,(bi(),Fb)),116),P=new Pt(d-z.b,v-z.d),_=new rr((!e.a&&(e.a=new at(hs,e,10,11)),e.a));_.e!=_.i.gc();)x=u(pr(_),33),Du(x,x.i-P.a),Iu(x,x.j-P.b);X=o-d+(z.b+z.c),n=h-v+(z.d+z.a),zv(e,X),Hv(e,n),t.n&&e&&yf(t,kf(e),(Pl(),nh))}function tlt(e){var t,n,r,s,o,h,d,v,x,_;for(r=new st,h=new C(e.e.a);h.a0){OH(e,n,0),n.a+=String.fromCharCode(r),s=bcn(t,o),OH(e,n,s),o+=s-1;continue}r==39?o+11)for(W=Me(Lr,Jr,25,e.b.b.c.length,15,1),L=0,x=new C(e.b.b);x.a=d&&s<=v)d<=s&&o<=v?(n[_++]=s,n[_++]=o,r+=2):d<=s?(n[_++]=s,n[_++]=v,e.b[r]=v+1,h+=2):o<=v?(n[_++]=d,n[_++]=o,r+=2):(n[_++]=d,n[_++]=v,e.b[r]=v+1);else if(vJp)&&d<10);$pe(e.c,new dp),nlt(e),yZt(e.c),Awn(e.f)}function Pwn(e,t,n){var r,s,o,h,d,v,x,_,L,P,z,q,W,X;if(It(Mt(K(n,(pt(),Oy)))))for(d=new C(n.j);d.a=2){for(v=ii(n,0),h=u(ri(v),8),d=u(ri(v),8);d.a0&&ND(x,!0,(wo(),Df)),d.k==(zn(),Ls)&&SYe(x),Si(e.f,d,t)}}function jwn(e,t,n){var r,s,o,h,d,v,x,_,L,P;switch(kr(n,"Node promotion heuristic",1),e.g=t,Vmn(e),e.q=u(K(t,(pt(),Wle)),260),_=u(K(e.g,FTe),19).a,o=new JP,e.q.g){case 2:case 1:k7(e,o);break;case 3:for(e.q=(f4(),oV),k7(e,o),v=0,d=new C(e.a);d.ae.j&&(e.q=LO,k7(e,o));break;case 4:for(e.q=(f4(),oV),k7(e,o),x=0,s=new C(e.b);s.ae.k&&(e.q=MO,k7(e,o));break;case 6:P=_s(b.Math.ceil(e.f.length*_/100)),k7(e,new yp(P));break;case 5:L=_s(b.Math.ceil(e.d*_/100)),k7(e,new Xf(L));break;default:k7(e,o)}Ipn(e,t),ur(n)}function ilt(e,t,n){var r,s,o,h;this.j=e,this.e=r4e(e),this.o=this.j.e,this.i=!!this.o,this.p=this.i?u(St(n,Ya(this.o).p),214):null,s=u(K(e,(et(),eu)),21),this.g=s.Hc((mo(),Th)),this.b=new st,this.d=new Crt(this.e),h=u(K(this.j,Lk),230),this.q=vsn(t,h,this.e),this.k=new _Xe(this),o=O1(ie(re(o2t,1),yt,225,0,[this,this.d,this.k,this.q])),t==(Gv(),IO)&&!It(Mt(K(e,(pt(),My))))?(r=new s4e(this.e),o.c[o.c.length]=r,this.c=new Nwe(r,h,u(this.q,402))):t==IO&&It(Mt(K(e,(pt(),My))))?(r=new s4e(this.e),o.c[o.c.length]=r,this.c=new utt(r,h,u(this.q,402))):this.c=new sqe(t,this),it(o,this.c),jut(o,this.e),this.s=kyn(this.k)}function $wn(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne;for(L=u(sj((h=ii(new Ep(t).a.d,0),new f6(h))),86),q=L?u(K(L,(Tc(),The)),86):null,s=1;L&&q;){for(v=0,Ne=0,n=L,r=q,d=0;d=e.i?(++e.i,it(e.a,ct(1)),it(e.b,_)):(r=e.c[t.p][1],gh(e.a,x,ct(u(St(e.a,x),19).a+1-r)),gh(e.b,x,Ue(ft(St(e.b,x)))+_-r*e.e)),(e.q==(f4(),LO)&&(u(St(e.a,x),19).a>e.j||u(St(e.a,x-1),19).a>e.j)||e.q==MO&&(Ue(ft(St(e.b,x)))>e.k||Ue(ft(St(e.b,x-1)))>e.k))&&(v=!1),h=new cr(fr(Xo(t).a.Kc(),new V));Vr(h);)o=u(Pr(h),17),d=o.c.i,e.f[d.p]==x&&(L=slt(e,d),s=s+u(L.a,19).a,v=v&&It(Mt(L.b)));return e.f[t.p]=x,s=s+e.c[t.p][0],new xa(ct(s),(Mn(),!!v))}function t6e(e,t,n,r,s){var o,h,d,v,x,_,L,P,z,q,W,X,le;for(L=new Mr,h=new st,Sat(e,n,e.d.fg(),h,L),Sat(e,r,e.d.gg(),h,L),e.b=.2*(W=bot(ic(new vn(null,new mn(h,16)),new GQ)),X=bot(ic(new vn(null,new mn(h,16)),new qQ)),b.Math.min(W,X)),o=0,d=0;d=2&&(le=Fot(h,!0,P),!e.e&&(e.e=new $je(e)),wcn(e.e,le,h,e.b)),wst(h,P),nmn(h),z=-1,_=new C(h);_.a<_.c.c.length;)x=u(Y(_),112),!(b.Math.abs(x.s-x.c)d)}function zwn(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W;for(n=u(K(e,(pt(),bs)),98),h=e.f,o=e.d,d=h.a+o.b+o.c,v=0-o.d-e.c.b,_=h.b+o.d+o.a-e.c.b,x=new st,L=new st,s=new C(t);s.a0),u(_.a.Xb(_.c=--_.b),17));o!=r&&_.b>0;)e.a[o.p]=!0,e.a[r.p]=!0,o=(Qn(_.b>0),u(_.a.Xb(_.c=--_.b),17));_.b>0&&Ol(_)}}function ult(e,t,n){var r,s,o,h,d,v,x,_,L;if(e.a!=t.Aj())throw J(new Ln($7+t.ne()+dw));if(r=Ag((Yu(),Oa),t).$k(),r)return r.Aj().Nh().Ih(r,n);if(h=Ag(Oa,t).al(),h){if(n==null)return null;if(d=u(n,15),d.dc())return"";for(L=new bg,o=d.Kc();o.Ob();)s=o.Pb(),To(L,h.Aj().Nh().Ih(h,s)),L.a+=" ";return qte(L,L.a.length-1)}if(_=Ag(Oa,t).bl(),!_.dc()){for(x=_.Kc();x.Ob();)if(v=u(x.Pb(),148),v.wj(n))try{if(L=v.Aj().Nh().Ih(v,n),L!=null)return L}catch(P){if(P=ts(P),!we(P,102))throw J(P)}throw J(new Ln("Invalid value: '"+n+"' for datatype :"+t.ne()))}return u(t,834).Fj(),n==null?null:we(n,172)?""+u(n,172).a:pl(n)==FG?PVe(WS[0],u(n,199)):Qo(n)}function Kwn(e){var t,n,r,s,o,h,d,v,x,_;for(x=new as,d=new as,o=new C(e);o.a-1){for(s=ii(d,0);s.b!=s.d.c;)r=u(ri(s),128),r.v=h;for(;d.b!=0;)for(r=u(vse(d,0),128),n=new C(r.i);n.a0&&(n+=v.n.a+v.o.a/2,++L),q=new C(v.j);q.a0&&(n/=L),le=Me(pa,Ao,25,r.a.c.length,15,1),d=0,x=new C(r.a);x.a=d&&s<=v)d<=s&&o<=v?r+=2:d<=s?(e.b[r]=v+1,h+=2):o<=v?(n[_++]=s,n[_++]=d-1,r+=2):(n[_++]=s,n[_++]=d-1,e.b[r]=v+1,h+=2);else if(v0?s-=864e5:s+=864e5,v=new Sbe(Ua(Ou(t.q.getTime()),s))),_=new xm,x=e.a.length,o=0;o=97&&r<=122||r>=65&&r<=90){for(h=o+1;h=x)throw J(new Ln("Missing trailing '"));h+10&&n.c==0&&(!t&&(t=new st),t.c[t.c.length]=n);if(t)for(;t.c.length!=0;){if(n=u(Eg(t,0),233),n.b&&n.b.c.length>0){for(o=(!n.b&&(n.b=new st),new C(n.b));o.aYo(e,n,0))return new xa(s,n)}else if(Ue(A1(s.g,s.d[0]).a)>Ue(A1(n.g,n.d[0]).a))return new xa(s,n)}for(d=(!n.e&&(n.e=new st),n.e).Kc();d.Ob();)h=u(d.Pb(),233),v=(!h.b&&(h.b=new st),h.b),jm(0,v.c.length),RT(v.c,0,n),h.c==v.c.length&&(t.c[t.c.length]=h)}return null}function glt(e,t){var n,r,s,o,h,d,v,x,_;if(e==null)return Pu;if(v=t.a.zc(e,t),v!=null)return"[...]";for(n=new ib(io,"[","]"),s=e,o=0,h=s.length;o=14&&_<=16))?t.a._b(r)?(n.a?Yr(n.a,n.b):n.a=new Fl(n.d),ZT(n.a,"[...]")):(d=tb(r),x=new l_(t),O0(n,glt(d,x))):we(r,177)?O0(n,V1n(u(r,177))):we(r,190)?O0(n,Nhn(u(r,190))):we(r,195)?O0(n,qfn(u(r,195))):we(r,2012)?O0(n,Phn(u(r,2012))):we(r,48)?O0(n,q1n(u(r,48))):we(r,364)?O0(n,idn(u(r,364))):we(r,832)?O0(n,G1n(u(r,832))):we(r,104)&&O0(n,z1n(u(r,104))):O0(n,r==null?Pu:Qo(r));return n.a?n.e.length==0?n.a.a:n.a.a+(""+n.e):n.c}function plt(e,t,n,r){var s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee;for(d=d4(t,!1,!1),le=iI(d),r&&(le=BD(le)),Ee=Ue(ft(Ft(t,(K_(),Rue)))),X=(Qn(le.b!=0),u(le.a.a.c,8)),L=u(s1(le,1),8),le.b>2?(_=new st,Rs(_,new Zd(le,1,le.b)),o=Klt(_,Ee+e.a),Ce=new zse(o),Ho(Ce,t),n.c[n.c.length]=Ce):r?Ce=u(er(e.b,n0(t)),266):Ce=u(er(e.b,Kp(t)),266),v=n0(t),r&&(v=Kp(t)),h=l1n(X,v),x=Ee+e.a,h.a?(x+=b.Math.abs(X.b-L.b),W=new Pt(L.a,(L.b+X.b)/2)):(x+=b.Math.abs(X.a-L.a),W=new Pt((L.a+X.a)/2,L.b)),r?Si(e.d,t,new C3e(Ce,h,W,x)):Si(e.c,t,new C3e(Ce,h,W,x)),Si(e.b,t,Ce),q=(!t.n&&(t.n=new at(Jo,t,1,7)),t.n),z=new rr(q);z.e!=z.i.gc();)P=u(pr(z),137),s=pI(e,P,!0,0,0),n.c[n.c.length]=s}function nmn(e){var t,n,r,s,o,h,d,v,x,_;for(x=new st,d=new st,h=new C(e);h.a-1){for(o=new C(d);o.a0)&&(qR(v,b.Math.min(v.o,s.o-1)),hT(v,v.i-1),v.i==0&&(d.c[d.c.length]=v))}}function E7(e,t,n){var r,s,o,h,d,v,x;if(x=e.c,!t&&(t=FAe),e.c=t,e.Db&4&&!(e.Db&1)&&(v=new oa(e,1,2,x,e.c),n?n.Ei(v):n=v),x!=t){if(we(e.Cb,284))e.Db>>16==-10?n=u(e.Cb,284).nk(t,n):e.Db>>16==-15&&(!t&&(t=(on(),Z1)),!x&&(x=(on(),Z1)),e.Cb.nh()&&(v=new N0(e.Cb,1,13,x,t,Dg(gl(u(e.Cb,59)),e),!1),n?n.Ei(v):n=v));else if(we(e.Cb,88))e.Db>>16==-23&&(we(t,88)||(t=(on(),sf)),we(x,88)||(x=(on(),sf)),e.Cb.nh()&&(v=new N0(e.Cb,1,10,x,t,Dg(jc(u(e.Cb,26)),e),!1),n?n.Ei(v):n=v));else if(we(e.Cb,444))for(d=u(e.Cb,836),h=(!d.b&&(d.b=new rF(new Kee)),d.b),o=(r=new ob(new dg(h.a).a),new iF(r));o.a.b;)s=u($v(o.a).cd(),87),n=E7(s,nz(s,d),n)}return n}function rmn(e,t){var n,r,s,o,h,d,v,x,_,L,P;for(h=It(Mt(Ft(e,(pt(),Oy)))),P=u(Ft(e,Py),21),v=!1,x=!1,L=new rr((!e.c&&(e.c=new at(xl,e,9,9)),e.c));L.e!=L.i.gc()&&(!v||!x);){for(o=u(pr(L),118),d=0,s=Pp(B1(ie(re(q1,1),yt,20,0,[(!o.d&&(o.d=new wn(ra,o,8,5)),o.d),(!o.e&&(o.e=new wn(ra,o,7,4)),o.e)])));Vr(s)&&(r=u(Pr(s),79),_=h&&ew(r)&&It(Mt(Ft(r,Db))),n=Uut((!r.b&&(r.b=new wn(mr,r,4,7)),r.b),o)?e==us(zo(u(Te((!r.c&&(r.c=new wn(mr,r,5,8)),r.c),0),82))):e==us(zo(u(Te((!r.b&&(r.b=new wn(mr,r,4,7)),r.b),0),82))),!((_||n)&&(++d,d>1))););(d>0||P.Hc((ol(),Z0))&&(!o.n&&(o.n=new at(Jo,o,1,7)),o.n).i>0)&&(v=!0),d>1&&(x=!0)}v&&t.Fc((mo(),Th)),x&&t.Fc((mo(),oS))}function blt(e){var t,n,r,s,o,h,d,v,x,_,L,P;if(P=u(Ft(e,(bi(),Rb)),21),P.dc())return null;if(d=0,h=0,P.Hc((Bl(),tN))){for(_=u(Ft(e,BS),98),r=2,n=2,s=2,o=2,t=us(e)?u(Ft(us(e),Mw),103):u(Ft(e,Mw),103),x=new rr((!e.c&&(e.c=new at(xl,e,9,9)),e.c));x.e!=x.i.gc();)if(v=u(pr(x),118),L=u(Ft(v,t5),61),L==(ht(),uc)&&(L=$5e(v,t),So(v,t5,L)),_==(wa(),tu))switch(L.g){case 1:r=b.Math.max(r,v.i+v.g);break;case 2:n=b.Math.max(n,v.j+v.f);break;case 3:s=b.Math.max(s,v.i+v.g);break;case 4:o=b.Math.max(o,v.j+v.f)}else switch(L.g){case 1:r+=v.g+2;break;case 2:n+=v.f+2;break;case 3:s+=v.g+2;break;case 4:o+=v.f+2}d=b.Math.max(r,s),h=b.Math.max(n,o)}return sw(e,d,h,!0,!0)}function Tae(e,t,n,r,s){var o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne;for(Ce=u(zl(j$(Vi(new vn(null,new mn(t.d,16)),new Gx(n)),new iM(n)),eb(new vt,new Dt,new Hn,ie(re(yl,1),tt,132,0,[(F1(),Ql)]))),15),L=Ei,_=$a,v=new C(t.b.j);v.a0,x?x&&(P=le.p,h?++P:--P,L=u(St(le.c.a,P),10),r=ont(L),z=!(Kse(r,nt,n[0])||RKe(r,nt,n[0]))):z=!0),q=!1,Ve=t.D.i,Ve&&Ve.c&&d.e&&(_=h&&Ve.p>0||!h&&Ve.p0&&(t.a+=io),yz(u(pr(d),160),t);for(t.a+=Ioe,v=new _6((!r.c&&(r.c=new wn(mr,r,5,8)),r.c));v.e!=v.i.gc();)v.e>0&&(t.a+=io),yz(u(pr(v),160),t);t.a+=")"}}function umn(e,t,n){var r,s,o,h,d,v,x,_,L,P,z;if(o=u(K(e,(et(),Mi)),79),!!o){for(r=e.a,s=new Io(n),Ni(s,Jln(e)),z8(e.d.i,e.c.i)?(P=e.c,L=sc(ie(re(na,1),Qe,8,0,[P.n,P.a])),da(L,n)):L=D1(e.c),ks(r,L,r.a,r.a.a),z=D1(e.d),K(e,Rle)!=null&&Ni(z,u(K(e,Rle),8)),ks(r,z,r.c.b,r.c),Um(r,s),h=d4(o,!0,!0),W$(h,u(Te((!o.b&&(o.b=new wn(mr,o,4,7)),o.b),0),82)),K$(h,u(Te((!o.c&&(o.c=new wn(mr,o,5,8)),o.c),0),82)),mI(r,h),_=new C(e.b);_.a<_.c.c.length;)x=u(Y(_),70),d=u(K(x,Mi),137),zv(d,x.o.a),Hv(d,x.o.b),C1(d,x.n.a+s.a,x.n.b+s.b),So(d,(U6(),nle),Mt(K(x,nle)));v=u(K(e,(pt(),Fo)),74),v?(Um(v,s),So(o,Fo,v)):So(o,Fo,null),t==($0(),jk)?So(o,K0,jk):So(o,K0,null)}}function lmn(e,t,n,r){var s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce;for(z=t.c.length,P=0,L=new C(e.b);L.a=0){for(v=null,d=new Ea(_.a,x+1);d.bh?1:yv(isNaN(0),isNaN(h)))<0&&(Ef(Md),(b.Math.abs(h-1)<=Md||h==1||isNaN(h)&&isNaN(1)?0:h<1?-1:h>1?1:yv(isNaN(h),isNaN(1)))<0)&&(Ef(Md),(b.Math.abs(0-d)<=Md||d==0||isNaN(0)&&isNaN(d)?0:0d?1:yv(isNaN(0),isNaN(d)))<0)&&(Ef(Md),(b.Math.abs(d-1)<=Md||d==1||isNaN(d)&&isNaN(1)?0:d<1?-1:d>1?1:yv(isNaN(d),isNaN(1)))<0)),o)}function hmn(e){var t,n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt;for(L=new iwe(new Se(e));L.b!=L.c.a.d;)for(_=mJe(L),d=u(_.d,56),t=u(_.e,56),h=d.Tg(),W=0,Ne=(h.i==null&&xd(h),h.i).length;W=0&&W=x.c.c.length?_=Fwe((zn(),Hs),ca):_=Fwe((zn(),ca),ca),_*=2,o=n.a.g,n.a.g=b.Math.max(o,o+(_-o)),h=n.b.g,n.b.g=b.Math.max(h,h+(_-h)),s=t}}function gmn(e,t,n,r,s){var o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve;for(Ve=PWe(e),_=new st,d=e.c.length,L=d-1,P=d+1;Ve.a.c!=0;){for(;n.b!=0;)Ee=(Qn(n.b!=0),u(bh(n,n.a.a),112)),k_(Ve.a,Ee)!=null,Ee.g=L--,H5e(Ee,t,n,r);for(;t.b!=0;)Ne=(Qn(t.b!=0),u(bh(t,t.a.a),112)),k_(Ve.a,Ne)!=null,Ne.g=P++,H5e(Ne,t,n,r);for(x=$a,le=(h=new o_(new i_(new m(Ve.a).a).b),new g(h));wM(le.a.a);){if(X=(o=dj(le.a),u(o.cd(),112)),!r&&X.b>0&&X.a<=0){_.c=Me(Yn,yt,1,0,5,1),_.c[_.c.length]=X;break}W=X.i-X.d,W>=x&&(W>x&&(_.c=Me(Yn,yt,1,0,5,1),x=W),_.c[_.c.length]=X)}_.c.length!=0&&(v=u(St(_,BH(s,_.c.length)),112),k_(Ve.a,v)!=null,v.g=P++,H5e(v,t,n,r),_.c=Me(Yn,yt,1,0,5,1))}for(Ce=e.c.length+1,q=new C(e);q.a0&&(P.d+=_.n.d,P.d+=_.d),P.a>0&&(P.a+=_.n.a,P.a+=_.d),P.b>0&&(P.b+=_.n.b,P.b+=_.d),P.c>0&&(P.c+=_.n.c,P.c+=_.d),P}function wlt(e,t,n){var r,s,o,h,d,v,x,_,L,P,z,q;for(P=n.d,L=n.c,o=new Pt(n.f.a+n.d.b+n.d.c,n.f.b+n.d.d+n.d.a),h=o.b,x=new C(e.a);x.a0&&(e.c[t.c.p][t.p].d+=vl(e.i,24)*NI*.07000000029802322-.03500000014901161,e.c[t.c.p][t.p].a=e.c[t.c.p][t.p].d/e.c[t.c.p][t.p].b)}}function xmn(e){var t,n,r,s,o,h,d,v,x,_,L,P,z,q,W,X;for(q=new C(e);q.ar.d,r.d=b.Math.max(r.d,t),d&&n&&(r.d=b.Math.max(r.d,r.a),r.a=r.d+s);break;case 3:n=t>r.a,r.a=b.Math.max(r.a,t),d&&n&&(r.a=b.Math.max(r.a,r.d),r.d=r.a+s);break;case 2:n=t>r.c,r.c=b.Math.max(r.c,t),d&&n&&(r.c=b.Math.max(r.b,r.c),r.b=r.c+s);break;case 4:n=t>r.b,r.b=b.Math.max(r.b,t),d&&n&&(r.b=b.Math.max(r.b,r.c),r.c=r.b+s)}}}function Cmn(e){var t,n,r,s,o,h,d,v,x,_,L;for(x=new C(e);x.a0||_.j==Dn&&_.e.c.length-_.g.c.length<0)){t=!1;break}for(s=new C(_.g);s.a=x&&Ve>=X&&(P+=q.n.b+W.n.b+W.a.b-Ne,++d));if(n)for(h=new C(Ce.e);h.a=x&&Ve>=X&&(P+=q.n.b+W.n.b+W.a.b-Ne,++d))}d>0&&(nt+=P/d,++z)}z>0?(t.a=s*nt/z,t.g=z):(t.a=0,t.g=0)}function Amn(e,t){var n,r,s,o,h,d,v,x,_,L,P;for(s=new C(e.a.b);s.aDs||t.o==Pb&&_0&&Du(le,Ne*nt),Ve>0&&Iu(le,Ve*bt);for(B_(e.b,new sm),t=new st,d=new ob(new dg(e.c).a);d.b;)h=$v(d),r=u(h.cd(),79),n=u(h.dd(),395).a,s=d4(r,!1,!1),L=mst(n0(r),iI(s),n),mI(L,s),Ee=Dst(r),Ee&&Yo(t,Ee,0)==-1&&(t.c[t.c.length]=Ee,PYe(Ee,(Qn(L.b!=0),u(L.a.a.c,8)),n));for(X=new ob(new dg(e.d).a);X.b;)W=$v(X),r=u(W.cd(),79),n=u(W.dd(),395).a,s=d4(r,!1,!1),L=mst(Kp(r),BD(iI(s)),n),L=BD(L),mI(L,s),Ee=Ist(r),Ee&&Yo(t,Ee,0)==-1&&(t.c[t.c.length]=Ee,PYe(Ee,(Qn(L.b!=0),u(L.c.b.c,8)),n))}function klt(e,t,n,r){var s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt,bt;if(n.c.length!=0){for(z=new st,P=new C(n);P.a1)for(z=new Y5e(q,Ee,r),Da(Ee,new fqe(e,z)),h.c[h.c.length]=z,L=Ee.a.ec().Kc();L.Ob();)_=u(L.Pb(),46),Au(o,_.b);if(d.a.gc()>1)for(z=new Y5e(q,d,r),Da(d,new dqe(e,z)),h.c[h.c.length]=z,L=d.a.ec().Kc();L.Ob();)_=u(L.Pb(),46),Au(o,_.b)}}function Elt(e){wv(e,new gb(gF(gv(hv(dv(fv(new lg,Dd),"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 tZ),Dd))),dt(e,Dd,iG,xt(qmt)),dt(e,Dd,py,xt(Vmt)),dt(e,Dd,E4,xt($mt)),dt(e,Dd,gk,xt(Hmt)),dt(e,Dd,dk,xt(zmt)),dt(e,Dd,P7,xt(jmt)),dt(e,Dd,CC,xt(aCe)),dt(e,Dd,B7,xt(Gmt)),dt(e,Dd,yce,xt(Ohe)),dt(e,Dd,mce,xt(Nhe)),dt(e,Dd,Lxe,xt(oCe)),dt(e,Dd,_xe,xt(kV)),dt(e,Dd,Cxe,xt(xV)),dt(e,Dd,Sxe,xt(BO)),dt(e,Dd,Axe,xt(cCe))}function i6e(e){var t;if(this.r=hJt(new ka,new Qi),this.b=new V_(u(Nr(ao),290)),this.p=new V_(u(Nr(ao),290)),this.i=new V_(u(Nr(Ogt),290)),this.e=e,this.o=new Io(e.rf()),this.D=e.Df()||It(Mt(e.We((bi(),UO)))),this.A=u(e.We((bi(),Rb)),21),this.B=u(e.We(p2),21),this.q=u(e.We(BS),98),this.u=u(e.We(Hy),21),!wfn(this.u))throw J(new M3("Invalid port label placement: "+this.u));if(this.v=It(Mt(e.We($Se))),this.j=u(e.We(J4),21),!z0n(this.j))throw J(new M3("Invalid node label placement: "+this.j));this.n=u(Q_(e,SSe),116),this.k=Ue(ft(Q_(e,RV))),this.d=Ue(ft(Q_(e,qSe))),this.w=Ue(ft(Q_(e,YSe))),this.s=Ue(ft(Q_(e,VSe))),this.t=Ue(ft(Q_(e,USe))),this.C=u(Q_(e,WSe),142),this.c=2*this.d,t=!this.B.Hc((wl(),nN)),this.f=new W_(0,t,0),this.g=new W_(1,t,0),Zee(this.f,(n1(),lu),this.g)}function Rmn(e,t,n,r,s){var o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt,bt,zt,Ut,In;for(Ee=0,q=0,z=0,P=1,Ce=new rr((!e.a&&(e.a=new at(hs,e,10,11)),e.a));Ce.e!=Ce.i.gc();)X=u(pr(Ce),33),P+=I0(new cr(fr(z0(X).a.Kc(),new V))),zt=X.g,q=b.Math.max(q,zt),L=X.f,z=b.Math.max(z,L),Ee+=zt*L;for(W=(!e.a&&(e.a=new at(hs,e,10,11)),e.a).i,h=Ee+2*r*r*P*W,o=b.Math.sqrt(h),v=b.Math.max(o*n,q),d=b.Math.max(o/n,z),le=new rr((!e.a&&(e.a=new at(hs,e,10,11)),e.a));le.e!=le.i.gc();)X=u(pr(le),33),Ut=s.b+(vl(t,26)*mC+vl(t,27)*yC)*(v-X.g),In=s.b+(vl(t,26)*mC+vl(t,27)*yC)*(d-X.f),Du(X,Ut),Iu(X,In);for(bt=v+(s.b+s.c),nt=d+(s.d+s.a),Ve=new rr((!e.a&&(e.a=new at(hs,e,10,11)),e.a));Ve.e!=Ve.i.gc();)for(Ne=u(pr(Ve),33),_=new cr(fr(z0(Ne).a.Kc(),new V));Vr(_);)x=u(Pr(_),79),iC(x)||Fyn(x,t,bt,nt);bt+=s.b+s.c,nt+=s.d+s.a,sw(e,bt,nt,!1,!0)}function xz(e){var t,n,r,s,o,h,d,v,x,_,L;if(e==null)throw J(new gd(Pu));if(x=e,o=e.length,v=!1,o>0&&(t=(zr(0,e.length),e.charCodeAt(0)),(t==45||t==43)&&(e=e.substr(1),--o,v=t==45)),o==0)throw J(new gd(cw+x+'"'));for(;e.length>0&&(zr(0,e.length),e.charCodeAt(0)==48);)e=e.substr(1),--o;if(o>(hut(),O0t)[10])throw J(new gd(cw+x+'"'));for(s=0;s0&&(L=-parseInt(e.substr(0,r),10),e=e.substr(r),o-=r,n=!1);o>=h;){if(r=parseInt(e.substr(0,h),10),e=e.substr(h),o-=h,n)n=!1;else{if(Mc(L,d)<0)throw J(new gd(cw+x+'"'));L=ja(L,_)}L=Wp(L,r)}if(Mc(L,0)>0)throw J(new gd(cw+x+'"'));if(!v&&(L=M8(L),Mc(L,0)<0))throw J(new gd(cw+x+'"'));return L}function s6e(e,t){ZWe();var n,r,s,o,h,d,v;if(this.a=new Y2e(this),this.b=e,this.c=t,this.f=Bne(Po((Yu(),Oa),t)),this.f.dc())if((d=q3e(Oa,e))==t)for(this.e=!0,this.d=new st,this.f=new xx,this.f.Fc(_b),u(wz(wD(Oa,Gl(e)),""),26)==e&&this.f.Fc(f_(Oa,Gl(e))),s=iae(Oa,e).Kc();s.Ob();)switch(r=u(s.Pb(),170),Dv(Po(Oa,r))){case 4:{this.d.Fc(r);break}case 5:{this.f.Gc(Bne(Po(Oa,r)));break}}else if(ho(),u(t,66).Oj())for(this.e=!0,this.f=null,this.d=new st,h=0,v=(e.i==null&&xd(e),e.i).length;h=0&&h0&&(u(_o(e.b,t),124).a.b=n)}function Fmn(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le;for(kr(t,"Comment pre-processing",1),n=0,v=new C(e.a);v.a0&&(v=(zr(0,t.length),t.charCodeAt(0)),v!=64)){if(v==37&&(L=t.lastIndexOf("%"),x=!1,L!=0&&(L==P-1||(x=(zr(L+1,t.length),t.charCodeAt(L+1)==46))))){if(h=t.substr(1,L-1),Ee=an("%",h)?null:o6e(h),r=0,x)try{r=Wl(t.substr(L+2),$a,Ei)}catch(Ne){throw Ne=ts(Ne),we(Ne,127)?(d=Ne,J(new D$(d))):J(Ne)}for(X=Hme(e.Wg());X.Ob();)if(q=aH(X),we(q,510)&&(s=u(q,590),Ce=s.d,(Ee==null?Ce==null:an(Ee,Ce))&&r--==0))return s;return null}if(_=t.lastIndexOf("."),z=_==-1?t:t.substr(0,_),n=0,_!=-1)try{n=Wl(t.substr(_+1),$a,Ei)}catch(Ne){if(Ne=ts(Ne),we(Ne,127))z=t;else throw J(Ne)}for(z=an("%",z)?null:o6e(z),W=Hme(e.Wg());W.Ob();)if(q=aH(W),we(q,191)&&(o=u(q,191),le=o.ne(),(z==null?le==null:an(z,le))&&n--==0))return o;return null}return Kut(e,t)}function Hmn(e){var t,n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt,bt,zt,Ut,In,Rn;for(nt=new st,q=new C(e.b);q.a=t.length)return{done:!0};var s=t[r++];return{value:[s,n.get(s)],done:!1}}}},Upn()||(e.prototype.createObject=function(){return{}},e.prototype.get=function(t){return this.obj[":"+t]},e.prototype.set=function(t,n){this.obj[":"+t]=n},e.prototype[coe]=function(t){delete this.obj[":"+t]},e.prototype.keys=function(){var t=[];for(var n in this.obj)n.charCodeAt(0)==58&&t.push(n.substring(1));return t}),e}function Gmn(e){j5e();var t,n,r,s,o,h,d,v,x,_,L,P,z,q,W,X;if(e==null)return null;if(L=e.length*8,L==0)return"";for(d=L%24,z=L/24|0,P=d!=0?z+1:z,o=null,o=Me(Sh,Td,25,P*4,15,1),x=0,_=0,t=0,n=0,r=0,h=0,s=0,v=0;v>24,x=(t&3)<<24>>24,q=t&-128?(t>>2^192)<<24>>24:t>>2<<24>>24,W=n&-128?(n>>4^240)<<24>>24:n>>4<<24>>24,X=r&-128?(r>>6^252)<<24>>24:r>>6<<24>>24,o[h++]=Zg[q],o[h++]=Zg[W|x<<4],o[h++]=Zg[_<<2|X],o[h++]=Zg[r&63];return d==8?(t=e[s],x=(t&3)<<24>>24,q=t&-128?(t>>2^192)<<24>>24:t>>2<<24>>24,o[h++]=Zg[q],o[h++]=Zg[x<<4],o[h++]=61,o[h++]=61):d==16&&(t=e[s],n=e[s+1],_=(n&15)<<24>>24,x=(t&3)<<24>>24,q=t&-128?(t>>2^192)<<24>>24:t>>2<<24>>24,W=n&-128?(n>>4^240)<<24>>24:n>>4<<24>>24,o[h++]=Zg[q],o[h++]=Zg[W|x<<4],o[h++]=Zg[_<<2],o[h++]=61),jh(o,0,o.length)}function qmn(e,t){var n,r,s,o,h,d,v;if(e.e==0&&e.p>0&&(e.p=-(e.p-1)),e.p>$a&&$we(t,e.p-e2),h=t.q.getDate(),tD(t,1),e.k>=0&&Cen(t,e.k),e.c>=0?tD(t,e.c):e.k>=0?(v=new oye(t.q.getFullYear()-e2,t.q.getMonth(),35),r=35-v.q.getDate(),tD(t,b.Math.min(r,h))):tD(t,h),e.f<0&&(e.f=t.q.getHours()),e.b>0&&e.f<12&&(e.f+=12),RWt(t,e.f==24&&e.g?0:e.f),e.j>=0&&Rnn(t,e.j),e.n>=0&&trn(t,e.n),e.i>=0&&Qqe(t,Ua(ja(eI(Ou(t.q.getTime()),Pg),Pg),e.i)),e.a&&(s=new kF,$we(s,s.q.getFullYear()-e2-80),fte(Ou(t.q.getTime()),Ou(s.q.getTime()))&&$we(t,s.q.getFullYear()-e2+100)),e.d>=0){if(e.c==-1)n=(7+e.d-t.q.getDay())%7,n>3&&(n-=7),d=t.q.getMonth(),tD(t,t.q.getDate()+n),t.q.getMonth()!=d&&tD(t,t.q.getDate()+(n>0?-7:7));else if(t.q.getDay()!=e.d)return!1}return e.o>$a&&(o=t.q.getTimezoneOffset(),Qqe(t,Ua(Ou(t.q.getTime()),(e.o-o)*60*Pg))),!0}function Clt(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne;if(s=K(t,(et(),Mi)),!!we(s,239)){for(q=u(s,33),W=t.e,P=new Io(t.c),o=t.d,P.a+=o.b,P.b+=o.d,Ne=u(Ft(q,(pt(),Jq)),174),Vu(Ne,(wl(),$V))&&(z=u(Ft(q,qTe),116),jge(z,o.a),wee(z,o.d),$ge(z,o.b),Vge(z,o.c)),n=new st,_=new C(t.a);_.a<_.c.c.length;)for(v=u(Y(_),10),we(K(v,Mi),239)?Xmn(v,P):we(K(v,Mi),186)&&!W&&(r=u(K(v,Mi),118),Ce=vut(t,v,r.g,r.f),C1(r,Ce.a,Ce.b)),le=new C(v.j);le.a0&&it(e.p,_),it(e.o,_);t-=r,z=v+t,x+=t*e.e,gh(e.a,d,ct(z)),gh(e.b,d,x),e.j=b.Math.max(e.j,z),e.k=b.Math.max(e.k,x),e.d+=t,t+=W}}function ht(){ht=pe;var e;uc=new MM(EC,0),An=new MM(Oz,1),$n=new MM(woe,2),xr=new MM(moe,3),Dn=new MM(yoe,4),Q1=(hn(),new Kx((e=u(Qf(ao),9),new hh(e,u(wf(e,e.length),9),0)))),Bf=Sg(Ui(An,ie(re(ao,1),Dc,61,0,[]))),_h=Sg(Ui($n,ie(re(ao,1),Dc,61,0,[]))),eh=Sg(Ui(xr,ie(re(ao,1),Dc,61,0,[]))),Jh=Sg(Ui(Dn,ie(re(ao,1),Dc,61,0,[]))),Ru=Sg(Ui(An,ie(re(ao,1),Dc,61,0,[xr]))),wu=Sg(Ui($n,ie(re(ao,1),Dc,61,0,[Dn]))),Rf=Sg(Ui(An,ie(re(ao,1),Dc,61,0,[Dn]))),ll=Sg(Ui(An,ie(re(ao,1),Dc,61,0,[$n]))),th=Sg(Ui(xr,ie(re(ao,1),Dc,61,0,[Dn]))),Ch=Sg(Ui($n,ie(re(ao,1),Dc,61,0,[xr]))),hl=Sg(Ui(An,ie(re(ao,1),Dc,61,0,[$n,Dn]))),Bu=Sg(Ui($n,ie(re(ao,1),Dc,61,0,[xr,Dn]))),Fu=Sg(Ui(An,ie(re(ao,1),Dc,61,0,[xr,Dn]))),Ju=Sg(Ui(An,ie(re(ao,1),Dc,61,0,[$n,xr]))),nu=Sg(Ui(An,ie(re(ao,1),Dc,61,0,[$n,xr,Dn])))}function Mlt(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee;if(t.b!=0){for(z=new as,d=null,q=null,r=_s(b.Math.floor(b.Math.log(t.b)*b.Math.LOG10E)+1),v=0,Ee=ii(t,0);Ee.b!=Ee.d.c;)for(le=u(ri(Ee),86),je(q)!==je(K(le,(Tc(),AS)))&&(q=Hr(K(le,AS)),v=0),q!=null?d=q+YXe(v++,r):d=YXe(v++,r),Ye(le,AS,d),X=(s=ii(new Ep(le).a.d,0),new f6(s));vF(X.a);)W=u(ri(X.a),188).c,ks(z,W,z.c.b,z.c),Ye(W,AS,d);for(P=new Mr,h=0;h=v){Qn(le.b>0),le.a.Xb(le.c=--le.b);break}else W.a>x&&(s?(Rs(s.b,W.b),s.a=b.Math.max(s.a,W.a),Ol(le)):(it(W.b,L),W.c=b.Math.min(W.c,x),W.a=b.Math.max(W.a,v),s=W));s||(s=new dHe,s.c=x,s.a=v,Dm(le,s),it(s.b,L))}for(d=t.b,_=0,X=new C(r);X.ad?1:0:(e.b&&(e.b._b(o)&&(s=u(e.b.xc(o),19).a),e.b._b(v)&&(d=u(e.b.xc(v),19).a)),sd?1:0)):t.e.c.length!=0&&n.g.c.length!=0?1:-1}function Kmn(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt,bt;for(kr(t,yft,1),W=new st,nt=new st,x=new C(e.b);x.a0&&(Ee-=z),X5e(h,Ee),_=0,P=new C(h.a);P.a0),d.a.Xb(d.c=--d.b)),v=.4*r*_,!o&&d.bt.d.c){if(z=e.c[t.a.d],X=e.c[L.a.d],z==X)continue;Cf(bf(pf(vf(gf(new Nh,1),100),z),X))}}}}}function o6e(e){kae();var t,n,r,s,o,h,d,v;if(e==null)return null;if(s=pd(e,Nu(37)),s<0)return e;for(v=new Fl(e.substr(0,s)),t=Me(el,A4,25,4,15,1),d=0,r=0,h=e.length;ss+2&&die((zr(s+1,e.length),e.charCodeAt(s+1)),DAe,IAe)&&die((zr(s+2,e.length),e.charCodeAt(s+2)),DAe,IAe))if(n=kQt((zr(s+1,e.length),e.charCodeAt(s+1)),(zr(s+2,e.length),e.charCodeAt(s+2))),s+=2,r>0?(n&192)==128?t[d++]=n<<24>>24:r=0:n>=128&&((n&224)==192?(t[d++]=n<<24>>24,r=2):(n&240)==224?(t[d++]=n<<24>>24,r=3):(n&248)==240&&(t[d++]=n<<24>>24,r=4)),r>0){if(d==r){switch(d){case 2:{Bp(v,((t[0]&31)<<6|t[1]&63)&Ss);break}case 3:{Bp(v,((t[0]&15)<<12|(t[1]&63)<<6|t[2]&63)&Ss);break}}d=0,r=0}}else{for(o=0;o0){if(h+r>e.length)return!1;d=ZH(e.substr(0,h+r),t)}else d=ZH(e,t);switch(o){case 71:return d=u4(e,h,ie(re(mt,1),Qe,2,6,[fht,dht]),t),s.e=d,!0;case 77:return Ppn(e,t,s,d,h);case 76:return Bpn(e,t,s,d,h);case 69:return S1n(e,t,h,s);case 99:return A1n(e,t,h,s);case 97:return d=u4(e,h,ie(re(mt,1),Qe,2,6,["AM","PM"]),t),s.b=d,!0;case 121:return Rpn(e,t,h,d,n,s);case 100:return d<=0?!1:(s.c=d,!0);case 83:return d<0?!1:Hon(d,h,t[0],s);case 104:d==12&&(d=0);case 75:case 72:return d<0?!1:(s.f=d,s.g=!1,!0);case 107:return d<0?!1:(s.f=d,s.g=!0,!0);case 109:return d<0?!1:(s.j=d,!0);case 115:return d<0?!1:(s.n=d,!0);case 90:if(hnt&&(q.c=nt-q.b),it(h.d,new Lne(q,Rye(h,q))),Ce=t==An?b.Math.max(Ce,W.b+x.b.rf().b):b.Math.min(Ce,W.b));for(Ce+=t==An?e.t:-e.t,Ee=Jye((h.e=Ce,h)),Ee>0&&(u(_o(e.b,t),124).a.b=Ee),_=P.Kc();_.Ob();)x=u(_.Pb(),111),!(!x.c||x.c.d.c.length<=0)&&(q=x.c.i,q.c-=x.e.a,q.d-=x.e.b)}function tyn(e){var t,n,r,s,o,h,d,v,x,_,L,P,z;for(t=new Mr,v=new rr(e);v.e!=v.i.gc();){for(d=u(pr(v),33),n=new Ys,Si(jue,d,n),z=new Rc,s=u(zl(new vn(null,new Sv(new cr(fr(hI(d).a.Kc(),new V)))),yKe(z,eb(new vt,new Dt,new Hn,ie(re(yl,1),tt,132,0,[(F1(),Ql)])))),83),Vet(n,u(s.xc((Mn(),!0)),14),new _t),r=u(zl(Vi(u(s.xc(!1),15).Lc(),new hp),eb(new vt,new Dt,new Hn,ie(re(yl,1),tt,132,0,[Ql]))),15),h=r.Kc();h.Ob();)o=u(h.Pb(),79),P=Dst(o),P&&(x=u(hc($o(t.f,P)),21),x||(x=Qot(P),gu(t.f,P,x)),no(n,x));for(s=u(zl(new vn(null,new Sv(new cr(fr(z0(d).a.Kc(),new V)))),yKe(z,eb(new vt,new Dt,new Hn,ie(re(yl,1),tt,132,0,[Ql])))),83),Vet(n,u(s.xc(!0),14),new Gt),r=u(zl(Vi(u(s.xc(!1),15).Lc(),new ff),eb(new vt,new Dt,new Hn,ie(re(yl,1),tt,132,0,[Ql]))),15),L=r.Kc();L.Ob();)_=u(L.Pb(),79),P=Ist(_),P&&(x=u(hc($o(t.f,P)),21),x||(x=Qot(P),gu(t.f,P,x)),no(n,x))}}function nyn(e,t){pae();var n,r,s,o,h,d,v,x,_,L,P,z,q,W;if(v=Mc(e,0)<0,v&&(e=M8(e)),Mc(e,0)==0)switch(t){case 0:return"0";case 1:return L7;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:return z=new Tp,t<0?z.a+="0E+":z.a+="0E",z.a+=t==$a?"2147483648":""+-t,z.a}_=18,L=Me(Sh,Td,25,_+1,15,1),n=_,W=e;do x=W,W=eI(W,10),L[--n]=Or(Ua(48,Wp(x,ja(W,10))))&Ss;while(Mc(W,0)!=0);if(s=Wp(Wp(Wp(_,n),t),1),t==0)return v&&(L[--n]=45),jh(L,n,_-n);if(t>0&&Mc(s,-6)>=0){if(Mc(s,0)>=0){for(o=n+Or(s),d=_-1;d>=o;d--)L[d+1]=L[d];return L[++o]=46,v&&(L[--n]=45),jh(L,n,_-n+1)}for(h=2;fte(h,Ua(M8(s),1));h++)L[--n]=48;return L[--n]=46,L[--n]=48,v&&(L[--n]=45),jh(L,n,_-n)}return q=n+1,r=_,P=new xm,v&&(P.a+="-"),r-q>=1?(Bp(P,L[n]),P.a+=".",P.a+=jh(L,n+1,_-n-1)):P.a+=jh(L,n,_-n),P.a+="E",Mc(s,0)>0&&(P.a+="+"),P.a+=""+d_(s),P.a}function ryn(e,t,n){var r,s,o,h,d,v,x,_,L,P,z;if(e.e.a.$b(),e.f.a.$b(),e.c.c=Me(Yn,yt,1,0,5,1),e.i.c=Me(Yn,yt,1,0,5,1),e.g.a.$b(),t)for(h=new C(t.a);h.a=1&&(Ve-x>0&&q>=0?(Du(L,L.i+Ne),Iu(L,L.j+v*x)):Ve-x<0&&z>=0&&(Du(L,L.i+Ne*Ve),Iu(L,L.j+v)));return So(e,(bi(),Rb),(Bl(),o=u(Qf(qS),9),new hh(o,u(wf(o,o.length),9),0))),new Pt(nt,_)}function Olt(e){var t,n,r,s,o,h,d,v,x,_,L,P,z,q;if(z=us(zo(u(Te((!e.b&&(e.b=new wn(mr,e,4,7)),e.b),0),82))),q=us(zo(u(Te((!e.c&&(e.c=new wn(mr,e,5,8)),e.c),0),82))),L=z==q,d=new Fa,t=u(Ft(e,(hH(),rAe)),74),t&&t.b>=2){if((!e.a&&(e.a=new at(os,e,6,6)),e.a).i==0)n=(pv(),s=new ld,s),Br((!e.a&&(e.a=new at(os,e,6,6)),e.a),n);else if((!e.a&&(e.a=new at(os,e,6,6)),e.a).i>1)for(P=new _6((!e.a&&(e.a=new at(os,e,6,6)),e.a));P.e!=P.i.gc();)J_(P);mI(t,u(Te((!e.a&&(e.a=new at(os,e,6,6)),e.a),0),202))}if(L)for(r=new rr((!e.a&&(e.a=new at(os,e,6,6)),e.a));r.e!=r.i.gc();)for(n=u(pr(r),202),x=new rr((!n.a&&(n.a=new Bs(ef,n,5)),n.a));x.e!=x.i.gc();)v=u(pr(x),469),d.a=b.Math.max(d.a,v.a),d.b=b.Math.max(d.b,v.b);for(h=new rr((!e.n&&(e.n=new at(Jo,e,1,7)),e.n));h.e!=h.i.gc();)o=u(pr(h),137),_=u(Ft(o,FS),8),_&&C1(o,_.a,_.b),L&&(d.a=b.Math.max(d.a,o.i+o.g),d.b=b.Math.max(d.b,o.j+o.f));return d}function iyn(e,t,n){var r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt,bt,zt;for(Ee=t.c.length,s=new p4(e.a,n,null,null),zt=Me(pa,Ao,25,Ee,15,1),W=Me(pa,Ao,25,Ee,15,1),q=Me(pa,Ao,25,Ee,15,1),X=0,d=0;dzt[v]&&(X=v),L=new C(e.a.b);L.az&&(o&&(q2(nt,P),q2(zt,ct(x.b-1))),ki=n.b,Ws+=P+t,P=0,_=b.Math.max(_,n.b+n.c+dr)),Du(d,ki),Iu(d,Ws),_=b.Math.max(_,ki+dr+n.c),P=b.Math.max(P,L),ki+=dr+t;if(_=b.Math.max(_,r),Rn=Ws+P+n.a,RnSd,Ut=b.Math.abs(P.b-q.b)>Sd,(!n&&zt&&Ut||n&&(zt||Ut))&&ci(X.a,Ne)),no(X.a,r),r.b==0?P=Ne:P=(Qn(r.b!=0),u(r.c.b.c,8)),xsn(z,L,W),xtt(s)==bt&&(Ya(bt.i)!=s.a&&(W=new Fa,_4e(W,Ya(bt.i),Ce)),Ye(X,Rle,W)),Ufn(z,X,Ce),_.a.zc(z,_);Va(X,Ve),ba(X,bt)}for(x=_.a.ec().Kc();x.Ob();)v=u(x.Pb(),17),Va(v,null),ba(v,null);ur(t)}function Nlt(e){var t,n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne;if(e.gc()==1)return u(e.Xb(0),231);if(e.gc()<=0)return new k$;for(s=e.Kc();s.Ob();){for(n=u(s.Pb(),231),q=0,_=Ei,L=Ei,v=$a,x=$a,z=new C(n.e);z.ad&&(Ee=0,Ne+=h+le,h=0),q2n(W,n,Ee,Ne),t=b.Math.max(t,Ee+X.a),h=b.Math.max(h,X.b),Ee+=X.a+le;return W}function Plt(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q;switch(_=new Gu,e.a.g){case 3:P=u(K(t.e,(et(),Mb)),15),z=u(K(t.j,Mb),15),q=u(K(t.f,Mb),15),n=u(K(t.e,q4),15),r=u(K(t.j,q4),15),s=u(K(t.f,q4),15),h=new st,Rs(h,P),z.Jc(new XX),Rs(h,we(z,152)?H6(u(z,152)):we(z,131)?u(z,131).a:we(z,54)?new lv(z):new Em(z)),Rs(h,q),o=new st,Rs(o,n),Rs(o,we(r,152)?H6(u(r,152)):we(r,131)?u(r,131).a:we(r,54)?new lv(r):new Em(r)),Rs(o,s),Ye(t.f,Mb,h),Ye(t.f,q4,o),Ye(t.f,z9e,t.f),Ye(t.e,Mb,null),Ye(t.e,q4,null),Ye(t.j,Mb,null),Ye(t.j,q4,null);break;case 1:no(_,t.e.a),ci(_,t.i.n),no(_,nb(t.j.a)),ci(_,t.a.n),no(_,t.f.a);break;default:no(_,t.e.a),no(_,nb(t.j.a)),no(_,t.f.a)}Rh(t.f.a),no(t.f.a,_),Va(t.f,t.e.c),d=u(K(t.e,(pt(),Fo)),74),x=u(K(t.j,Fo),74),v=u(K(t.f,Fo),74),(d||x||v)&&(L=new Gu,Kve(L,v),Kve(L,x),Kve(L,d),Ye(t.f,Fo,L)),Va(t.j,null),ba(t.j,null),Va(t.e,null),ba(t.e,null),No(t.a,null),No(t.i,null),t.g&&Plt(e,t.g)}function cyn(e){j5e();var t,n,r,s,o,h,d,v,x,_,L,P,z,q,W,X;if(e==null||(o=O$(e),q=Yan(o),q%4!=0))return null;if(W=q/4|0,W==0)return Me(el,A4,25,0,15,1);for(L=null,t=0,n=0,r=0,s=0,h=0,d=0,v=0,x=0,z=0,P=0,_=0,L=Me(el,A4,25,W*3,15,1);z>4)<<24>>24,L[P++]=((n&15)<<4|r>>2&15)<<24>>24,L[P++]=(r<<6|s)<<24>>24}return!fM(h=o[_++])||!fM(d=o[_++])?null:(t=J1[h],n=J1[d],v=o[_++],x=o[_++],J1[v]==-1||J1[x]==-1?v==61&&x==61?n&15?null:(X=Me(el,A4,25,z*3+1,15,1),Hc(L,0,X,0,z*3),X[P]=(t<<2|n>>4)<<24>>24,X):v!=61&&x==61?(r=J1[v],r&3?null:(X=Me(el,A4,25,z*3+2,15,1),Hc(L,0,X,0,z*3),X[P++]=(t<<2|n>>4)<<24>>24,X[P]=((n&15)<<4|r>>2&15)<<24>>24,X)):null:(r=J1[v],s=J1[x],L[P++]=(t<<2|n>>4)<<24>>24,L[P++]=((n&15)<<4|r>>2&15)<<24>>24,L[P++]=(r<<6|s)<<24>>24,L))}function uyn(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve;for(kr(t,yft,1),q=u(K(e,(pt(),K0)),218),s=new C(e.b);s.a=2){for(W=!0,P=new C(o.j),n=u(Y(P),11),z=null;P.a0&&(s=u(St(X.c.a,nt-1),10),h=e.i[s.p],zt=b.Math.ceil(j3(e.n,s,X)),o=Ve.a.e-X.d.d-(h.a.e+s.o.b+s.d.a)-zt),x=gs,nt0&&bt.a.e.e-bt.a.a-(bt.b.e.e-bt.b.a)<0,q=Ee.a.e.e-Ee.a.a-(Ee.b.e.e-Ee.b.a)<0&&bt.a.e.e-bt.a.a-(bt.b.e.e-bt.b.a)>0,z=Ee.a.e.e+Ee.b.abt.b.e.e+bt.a.a,Ne=0,!W&&!q&&(P?o+L>0?Ne=L:x-r>0&&(Ne=r):z&&(o+d>0?Ne=d:x-Ce>0&&(Ne=Ce))),Ve.a.e+=Ne,Ve.b&&(Ve.d.e+=Ne),!1))}function Rlt(e,t,n){var r,s,o,h,d,v,x,_,L,P;if(r=new fh(t.qf().a,t.qf().b,t.rf().a,t.rf().b),s=new T6,e.c)for(h=new C(t.wf());h.ax&&(r.a+=$Ve(Me(Sh,Td,25,-x,15,1))),r.a+="Is",pd(v,Nu(32))>=0)for(s=0;s=r.o.b/2}else Ce=!L;Ce?(le=u(K(r,(et(),Mk)),15),le?P?o=le:(s=u(K(r,_k),15),s?le.gc()<=s.gc()?o=le:o=s:(o=new st,Ye(r,_k,o))):(o=new st,Ye(r,Mk,o))):(s=u(K(r,(et(),_k)),15),s?L?o=s:(le=u(K(r,Mk),15),le?s.gc()<=le.gc()?o=s:o=le:(o=new st,Ye(r,Mk,o))):(o=new st,Ye(r,_k,o))),o.Fc(e),Ye(e,(et(),Bq),n),t.d==n?(ba(t,null),n.e.c.length+n.g.c.length==0&&rc(n,null),ran(n)):(Va(t,null),n.e.c.length+n.g.c.length==0&&rc(n,null)),Rh(t.a)}function dyn(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt,bt,zt,Ut,In,Rn,dr,ki;for(Ce=new Ea(e.b,0),_=t.Kc(),q=0,x=u(_.Pb(),19).a,Ve=0,n=new Ys,bt=new C0;Ce.b=e.a&&(r=Zbn(e,Ce),_=b.Math.max(_,r.b),Ne=b.Math.max(Ne,r.d),it(d,new xa(Ce,r)));for(zt=new st,x=0;x<_;++x)Om(zt,0,(Qn(X.b>0),X.a.Xb(X.c=--X.b),Ut=new Bh(e.b),Dm(X,Ut),Qn(X.b0?(x=0,X&&(x+=d),x+=(Ut-1)*h,Ee&&(x+=d),zt&&Ee&&(x=b.Math.max(x,Qgn(Ee,h,Ce,bt))),x0){for(P=_<100?null:new _p(_),x=new Vme(t),q=x.g,le=Me(Lr,Jr,25,_,15,1),r=0,Ne=new jv(_),s=0;s=0;)if(z!=null?Ci(z,q[v]):je(z)===je(q[v])){le.length<=r&&(X=le,le=Me(Lr,Jr,25,2*le.length,15,1),Hc(X,0,le,0,r)),le[r++]=s,Br(Ne,q[v]);break e}if(z=z,je(z)===je(d))break}}if(x=Ne,q=Ne.g,_=r,r>le.length&&(X=le,le=Me(Lr,Jr,25,r,15,1),Hc(X,0,le,0,r)),r>0){for(Ee=!0,o=0;o=0;)J6(e,le[h]);if(r!=_){for(s=_;--s>=r;)J6(x,s);X=le,le=Me(Lr,Jr,25,r,15,1),Hc(X,0,le,0,r)}t=x}}}else for(t=Yun(e,t),s=e.i;--s>=0;)t.Hc(e.g[s])&&(J6(e,s),Ee=!0);if(Ee){if(le!=null){for(n=t.gc(),L=n==1?x_(e,4,t.Kc().Pb(),null,le[0],W):x_(e,6,t,le,le[0],W),P=n<100?null:new _p(n),s=t.Kc();s.Ob();)z=s.Pb(),P=Ybe(e,u(z,72),P);P?(P.Ei(L),P.Fi()):_i(e.e,L)}else{for(P=cYt(t.gc()),s=t.Kc();s.Ob();)z=s.Pb(),P=Ybe(e,u(z,72),P);P&&P.Fi()}return!0}else return!1}function wyn(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee;for(n=new hit(t),n.a||tbn(t),x=n2n(t),v=new Nv,X=new sct,W=new C(t.a);W.a0||n.o==K1&&s0?(L=u(St(P.c.a,h-1),10),zt=j3(e.b,P,L),X=P.n.b-P.d.d-(L.n.b+L.o.b+L.d.a+zt)):X=P.n.b-P.d.d,x=b.Math.min(X,x),hh?w7(e,t,n):w7(e,n,t),sh?1:0}return r=u(K(t,(et(),Nc)),19).a,o=u(K(n,Nc),19).a,r>o?w7(e,t,n):w7(e,n,t),ro?1:0}function c6e(e,t,n,r){var s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce;if(It(Mt(Ft(t,(bi(),PV)))))return hn(),hn(),bo;if(x=(!t.a&&(t.a=new at(hs,t,10,11)),t.a).i!=0,L=adn(t),_=!L.dc(),x||_){if(s=u(Ft(t,xE),149),!s)throw J(new M3("Resolved algorithm is not set; apply a LayoutAlgorithmResolver before computing layout."));if(Ce=D2e(s,(g7(),KV)),Urt(t),!x&&_&&!Ce)return hn(),hn(),bo;if(v=new st,je(Ft(t,Q4))===je((F0(),Wg))&&(D2e(s,UV)||D2e(s,VV)))for(z=Act(e,t),q=new as,no(q,(!t.a&&(t.a=new at(hs,t,10,11)),t.a));q.b!=0;)P=u(q.b==0?null:(Qn(q.b!=0),bh(q,q.a.a)),33),Urt(P),le=je(Ft(P,Q4))===je(jS),le||J2(P,PS)&&!Vwe(s,Ft(P,xE))?(d=c6e(e,P,n,r),Rs(v,d),So(P,Q4,jS),Vct(P)):no(q,(!P.a&&(P.a=new at(hs,P,10,11)),P.a));else for(z=(!t.a&&(t.a=new at(hs,t,10,11)),t.a).i,h=new rr((!t.a&&(t.a=new at(hs,t,10,11)),t.a));h.e!=h.i.gc();)o=u(pr(h),33),d=c6e(e,o,n,r),Rs(v,d),Vct(o);for(X=new C(v);X.a=0?z=Y6(d):z=zD(Y6(d)),e.Ye(gE,z)),x=new Fa,P=!1,e.Xe(Cw)?(ybe(x,u(e.We(Cw),8)),P=!0):WWt(x,h.a/2,h.b/2),z.g){case 4:Ye(_,vu,(mh(),l2)),Ye(_,Fq,(sb(),F4)),_.o.b=h.b,W<0&&(_.o.a=-W),Vs(L,(ht(),$n)),P||(x.a=h.a),x.a-=h.a;break;case 2:Ye(_,vu,(mh(),Ly)),Ye(_,Fq,(sb(),aE)),_.o.b=h.b,W<0&&(_.o.a=-W),Vs(L,(ht(),Dn)),P||(x.a=0);break;case 1:Ye(_,Lb,(P0(),$4)),_.o.a=h.a,W<0&&(_.o.b=-W),Vs(L,(ht(),xr)),P||(x.b=h.b),x.b-=h.b;break;case 3:Ye(_,Lb,(P0(),Tk)),_.o.a=h.a,W<0&&(_.o.b=-W),Vs(L,(ht(),An)),P||(x.b=0)}if(ybe(L.n,x),Ye(_,Cw,x),t==$b||t==p0||t==tu){if(q=0,t==$b&&e.Xe(zg))switch(z.g){case 1:case 2:q=u(e.We(zg),19).a;break;case 3:case 4:q=-u(e.We(zg),19).a}else switch(z.g){case 4:case 2:q=o.b,t==p0&&(q/=s.b);break;case 1:case 3:q=o.a,t==p0&&(q/=s.a)}Ye(_,Ew,q)}return Ye(_,vc,z),_}function kyn(e){var t,n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt,bt,zt,Ut;if(n=Ue(ft(K(e.a.j,(pt(),xTe)))),n<-1||!e.a.i||A6(u(K(e.a.o,bs),98))||ac(e.a.o,(ht(),$n)).gc()<2&&ac(e.a.o,Dn).gc()<2)return!0;if(e.a.c.Rf())return!1;for(Ve=0,Ne=0,Ee=new st,v=e.a.e,x=0,_=v.length;x<_;++x){for(d=v[x],P=d,z=0,W=P.length;z=n}function xyn(){qpe();function e(r){var s=this;this.dispatch=function(o){var h=o.data;switch(h.cmd){case"algorithms":var d=Zye((hn(),new T(new E1(x2.b))));r.postMessage({id:h.id,data:d});break;case"categories":var v=Zye((hn(),new T(new E1(x2.c))));r.postMessage({id:h.id,data:v});break;case"options":var x=Zye((hn(),new T(new E1(x2.d))));r.postMessage({id:h.id,data:x});break;case"register":Lwn(h.algorithms),r.postMessage({id:h.id});break;case"layout":uvn(h.graph,h.layoutOptions||{},h.options||{}),r.postMessage({id:h.id,data:h.graph});break}},this.saveDispatch=function(o){try{s.dispatch(o)}catch(h){r.postMessage({id:o.data.id,error:h})}}}function t(r){var s=this;this.dispatcher=new e({postMessage:function(o){s.onmessage({data:o})}}),this.postMessage=function(o){setTimeout(function(){s.dispatcher.saveDispatch({data:o})},0)}}if(typeof document===foe&&typeof self!==foe){var n=new e(self);self.onmessage=n.saveDispatch}else typeof p!==foe&&p.exports&&(Object.defineProperty(w,"__esModule",{value:!0}),p.exports={default:t,Worker:t})}function Eyn(e){e.N||(e.N=!0,e.b=gc(e,0),ls(e.b,0),ls(e.b,1),ls(e.b,2),e.bb=gc(e,1),ls(e.bb,0),ls(e.bb,1),e.fb=gc(e,2),ls(e.fb,3),ls(e.fb,4),zi(e.fb,5),e.qb=gc(e,3),ls(e.qb,0),zi(e.qb,1),zi(e.qb,2),ls(e.qb,3),ls(e.qb,4),zi(e.qb,5),ls(e.qb,6),e.a=di(e,4),e.c=di(e,5),e.d=di(e,6),e.e=di(e,7),e.f=di(e,8),e.g=di(e,9),e.i=di(e,10),e.j=di(e,11),e.k=di(e,12),e.n=di(e,13),e.o=di(e,14),e.p=di(e,15),e.q=di(e,16),e.s=di(e,17),e.r=di(e,18),e.t=di(e,19),e.u=di(e,20),e.v=di(e,21),e.w=di(e,22),e.B=di(e,23),e.A=di(e,24),e.C=di(e,25),e.D=di(e,26),e.F=di(e,27),e.G=di(e,28),e.H=di(e,29),e.J=di(e,30),e.I=di(e,31),e.K=di(e,32),e.M=di(e,33),e.L=di(e,34),e.P=di(e,35),e.Q=di(e,36),e.R=di(e,37),e.S=di(e,38),e.T=di(e,39),e.U=di(e,40),e.V=di(e,41),e.X=di(e,42),e.W=di(e,43),e.Y=di(e,44),e.Z=di(e,45),e.$=di(e,46),e._=di(e,47),e.ab=di(e,48),e.cb=di(e,49),e.db=di(e,50),e.eb=di(e,51),e.gb=di(e,52),e.hb=di(e,53),e.ib=di(e,54),e.jb=di(e,55),e.kb=di(e,56),e.lb=di(e,57),e.mb=di(e,58),e.nb=di(e,59),e.ob=di(e,60),e.pb=di(e,61))}function Tyn(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne;if(Ce=0,t.f.a==0)for(X=new C(e);X.ax&&(xn(x,t.c.length),u(t.c[x],200)).a.c.length==0;)Au(t,(xn(x,t.c.length),t.c[x]));if(!v){--o;continue}if(lbn(t,_,s,v,P,n,x,r)){L=!0;continue}if(P){if(vvn(t,_,s,v,n,x,r)){L=!0;continue}else if(_ye(_,s)){s.c=!0,L=!0;continue}}else if(_ye(_,s)){s.c=!0,L=!0;continue}if(L)continue}if(_ye(_,s)){s.c=!0,L=!0,v&&(v.k=!1);continue}else $H(s.q)}return L}function Sae(e,t,n,r,s,o,h){var d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt,bt,zt,Ut,In,Rn,dr,ki,Ws;for(W=0,In=0,x=new C(e.b);x.aW&&(o&&(q2(nt,z),q2(zt,ct(_.b-1)),it(e.d,q),d.c=Me(Yn,yt,1,0,5,1)),ki=n.b,Ws+=z+t,z=0,L=b.Math.max(L,n.b+n.c+dr)),d.c[d.c.length]=v,iit(v,ki,Ws),L=b.Math.max(L,ki+dr+n.c),z=b.Math.max(z,P),ki+=dr+t,q=v;if(Rs(e.a,d),it(e.d,u(St(d,d.c.length-1),157)),L=b.Math.max(L,r),Rn=Ws+z+n.a,Rn1&&(h=b.Math.min(h,b.Math.abs(u(s1(d.a,1),8).b-_.b)))));else for(W=new C(t.j);W.as&&(o=P.a-s,h=Ei,r.c=Me(Yn,yt,1,0,5,1),s=P.a),P.a>=s&&(r.c[r.c.length]=d,d.a.b>1&&(h=b.Math.min(h,b.Math.abs(u(s1(d.a,d.a.b-2),8).b-P.b)))));if(r.c.length!=0&&o>t.o.a/2&&h>t.o.b/2){for(z=new $c,rc(z,t),Vs(z,(ht(),An)),z.n.a=t.o.a/2,le=new $c,rc(le,t),Vs(le,xr),le.n.a=t.o.a/2,le.n.b=t.o.b,v=new C(r);v.a=x.b?Va(d,le):Va(d,z)):(x=u(yQt(d.a),8),X=d.a.b==0?D1(d.c):u(fj(d.a),8),X.b>=x.b?ba(d,le):ba(d,z)),L=u(K(d,(pt(),Fo)),74),L&&Xm(L,x,!0);t.n.a=s-t.o.a/2}}function Lyn(e,t,n){var r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt,bt,zt,Ut,In,Rn,dr,ki,Ws,rh,af;if(In=null,dr=t,Rn=GQe(e,jQe(n),dr),I_(Rn,D0(dr,Id)),ki=u(K3(e.g,tk(M0(dr,Bce))),33),P=M0(dr,"sourcePort"),r=null,P&&(r=tk(P)),Ws=u(K3(e.j,r),118),!ki)throw d=i7(dr),q="An edge must have a source node (edge id: '"+d,W=q+z7,J(new dd(W));if(Ws&&!md(L1(Ws),ki))throw v=D0(dr,Id),X="The source port of an edge must be a port of the edge's source node (edge id: '"+v,le=X+z7,J(new dd(le));if(zt=(!Rn.b&&(Rn.b=new wn(mr,Rn,4,7)),Rn.b),o=null,Ws?o=Ws:o=ki,Br(zt,o),rh=u(K3(e.g,tk(M0(dr,o8e))),33),z=M0(dr,"targetPort"),s=null,z&&(s=tk(z)),af=u(K3(e.j,s),118),!rh)throw L=i7(dr),Ce="An edge must have a target node (edge id: '"+L,Ee=Ce+z7,J(new dd(Ee));if(af&&!md(L1(af),rh))throw x=D0(dr,Id),Ne="The target port of an edge must be a port of the edge's target node (edge id: '"+x,Ve=Ne+z7,J(new dd(Ve));if(Ut=(!Rn.c&&(Rn.c=new wn(mr,Rn,5,8)),Rn.c),h=null,af?h=af:h=rh,Br(Ut,h),(!Rn.b&&(Rn.b=new wn(mr,Rn,4,7)),Rn.b).i==0||(!Rn.c&&(Rn.c=new wn(mr,Rn,5,8)),Rn.c).i==0)throw _=D0(dr,Id),nt=R1t+_,bt=nt+z7,J(new dd(bt));return KH(dr,Rn),m0n(dr,Rn),In=pie(e,dr,Rn),In}function zlt(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt,bt,zt,Ut,In;return L=Ibn(_u(e,(ht(),Q1)),t),q=s4(_u(e,Bf),t),Ne=s4(_u(e,eh),t),zt=HH(_u(e,Jh),t),P=HH(_u(e,_h),t),Ce=s4(_u(e,Rf),t),W=s4(_u(e,ll),t),nt=s4(_u(e,th),t),Ve=s4(_u(e,Ch),t),Ut=HH(_u(e,wu),t),le=s4(_u(e,Ru),t),Ee=s4(_u(e,hl),t),bt=s4(_u(e,Bu),t),In=HH(_u(e,Fu),t),z=HH(_u(e,Ju),t),X=s4(_u(e,nu),t),n=Q3(ie(re(pa,1),Ao,25,15,[Ce.a,zt.a,nt.a,In.a])),r=Q3(ie(re(pa,1),Ao,25,15,[q.a,L.a,Ne.a,X.a])),s=le.a,o=Q3(ie(re(pa,1),Ao,25,15,[W.a,P.a,Ve.a,z.a])),x=Q3(ie(re(pa,1),Ao,25,15,[Ce.b,q.b,W.b,Ee.b])),v=Q3(ie(re(pa,1),Ao,25,15,[zt.b,L.b,P.b,X.b])),_=Ut.b,d=Q3(ie(re(pa,1),Ao,25,15,[nt.b,Ne.b,Ve.b,bt.b])),_g(_u(e,Q1),n+s,x+_),_g(_u(e,nu),n+s,x+_),_g(_u(e,Bf),n+s,0),_g(_u(e,eh),n+s,x+_+v),_g(_u(e,Jh),0,x+_),_g(_u(e,_h),n+s+r,x+_),_g(_u(e,ll),n+s+r,0),_g(_u(e,th),0,x+_+v),_g(_u(e,Ch),n+s+r,x+_+v),_g(_u(e,wu),0,x),_g(_u(e,Ru),n,0),_g(_u(e,Bu),0,x+_+v),_g(_u(e,Ju),n+s+r,0),h=new Fa,h.a=Q3(ie(re(pa,1),Ao,25,15,[n+r+s+o,Ut.a,Ee.a,bt.a])),h.b=Q3(ie(re(pa,1),Ao,25,15,[x+v+_+d,le.b,In.b,z.b])),h}function Myn(e){var t,n,r,s,o,h,d,v,x,_,L,P,z,q,W,X;for(W=new st,P=new C(e.d.b);P.as.d.d+s.d.a?_.f.d=!0:(_.f.d=!0,_.f.a=!0))),r.b!=r.d.c&&(t=n);_&&(o=u(er(e.f,h.d.i),57),t.bo.d.d+o.d.a?_.f.d=!0:(_.f.d=!0,_.f.a=!0))}for(d=new cr(fr(Xo(z).a.Kc(),new V));Vr(d);)h=u(Pr(d),17),h.a.b!=0&&(t=u(fj(h.a),8),h.d.j==(ht(),An)&&(X=new hC(t,new Pt(t.a,s.d.d),s,h),X.f.a=!0,X.a=h.d,W.c[W.c.length]=X),h.d.j==xr&&(X=new hC(t,new Pt(t.a,s.d.d+s.d.a),s,h),X.f.d=!0,X.a=h.d,W.c[W.c.length]=X))}return W}function Dyn(e,t,n){var r,s,o,h,d,v,x,_,L;if(kr(n,"Network simplex node placement",1),e.e=t,e.n=u(K(t,(et(),G4)),304),Kvn(e),Ahn(e),ms(ic(new vn(null,new mn(e.e.b,16)),new hQ),new Oje(e)),ms(Vi(ic(Vi(ic(new vn(null,new mn(e.e.b,16)),new N9),new kQ),new xQ),new EQ),new Ije(e)),It(Mt(K(e.e,(pt(),gS))))&&(h=Kc(n,1),kr(h,"Straight Edges Pre-Processing",1),dmn(e),ur(h)),uun(e.f),o=u(K(t,vS),19).a*e.f.a.c.length,sae(Rpe(Fpe(bne(e.f),o),!1),Kc(n,1)),e.d.a.gc()!=0){for(h=Kc(n,1),kr(h,"Flexible Where Space Processing",1),d=u(Tv(Fj(Cu(new vn(null,new mn(e.f.a,16)),new fQ),new sQ)),19).a,v=u(Tv(Rj(Cu(new vn(null,new mn(e.f.a,16)),new dQ),new aQ)),19).a,x=v-d,_=Ev(new z2,e.f),L=Ev(new z2,e.f),Cf(bf(pf(gf(vf(new Nh,2e4),x),_),L)),ms(Vi(Vi(Rne(e.i),new gQ),new pQ),new MYe(d,_,x,L)),s=e.d.a.ec().Kc();s.Ob();)r=u(s.Pb(),213),r.g=1;sae(Rpe(Fpe(bne(e.f),o),!1),Kc(h,1)),ur(h)}It(Mt(K(t,gS)))&&(h=Kc(n,1),kr(h,"Straight Edges Post-Processing",1),w1n(e),ur(h)),Qwn(e),e.e=null,e.f=null,e.i=null,e.c=null,sl(e.k),e.j=null,e.a=null,e.o=null,e.d.a.$b(),ur(n)}function Iyn(e,t,n){var r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve;for(d=new C(e.a.b);d.a0)if(r=L.gc(),x=_s(b.Math.floor((r+1)/2))-1,s=_s(b.Math.ceil((r+1)/2))-1,t.o==K1)for(_=s;_>=x;_--)t.a[Ne.p]==Ne&&(W=u(L.Xb(_),46),q=u(W.a,10),!_0(n,W.b)&&z>e.b.e[q.p]&&(t.a[q.p]=Ne,t.g[Ne.p]=t.g[q.p],t.a[Ne.p]=t.g[Ne.p],t.f[t.g[Ne.p].p]=(Mn(),!!(It(t.f[t.g[Ne.p].p])&Ne.k==(zn(),ca))),z=e.b.e[q.p]));else for(_=x;_<=s;_++)t.a[Ne.p]==Ne&&(le=u(L.Xb(_),46),X=u(le.a,10),!_0(n,le.b)&&z=q&&(Ce>q&&(z.c=Me(Yn,yt,1,0,5,1),q=Ce),z.c[z.c.length]=h);z.c.length!=0&&(P=u(St(z,BH(t,z.c.length)),128),Rn.a.Bc(P)!=null,P.s=W++,s5e(P,Ut,nt),z.c=Me(Yn,yt,1,0,5,1))}for(Ne=e.c.length+1,d=new C(e);d.aIn.s&&(Ol(n),Au(In.i,r),r.c>0&&(r.a=In,it(In.t,r),r.b=bt,it(bt.i,r)))}function u6e(e){var t,n,r,s,o;switch(t=e.c,t){case 11:return e.Ml();case 12:return e.Ol();case 14:return e.Ql();case 15:return e.Tl();case 16:return e.Rl();case 17:return e.Ul();case 21:return mi(e),yi(),yi(),nA;case 10:switch(e.a){case 65:return e.yl();case 90:return e.Dl();case 122:return e.Kl();case 98:return e.El();case 66:return e.zl();case 60:return e.Jl();case 62:return e.Hl()}}switch(o=Syn(e),t=e.c,t){case 3:return e.Zl(o);case 4:return e.Xl(o);case 5:return e.Yl(o);case 0:if(e.a==123&&e.d=48&&t<=57){for(r=t-48;s=48&&t<=57;)if(r=r*10+t-48,r<0)throw J(new $r(Ur((jr(),d8e))))}else throw J(new $r(Ur((jr(),hdt))));if(n=r,t==44){if(s>=e.j)throw J(new $r(Ur((jr(),ddt))));if((t=Ma(e.i,s++))>=48&&t<=57){for(n=t-48;s=48&&t<=57;)if(n=n*10+t-48,n<0)throw J(new $r(Ur((jr(),d8e))));if(r>n)throw J(new $r(Ur((jr(),gdt))))}else n=-1}if(t!=125)throw J(new $r(Ur((jr(),fdt))));e.sl(s)?(o=(yi(),yi(),new $m(9,o)),e.d=s+1):(o=(yi(),yi(),new $m(3,o)),e.d=s),o.dm(r),o.cm(n),mi(e)}}return o}function Glt(e,t,n,r,s){var o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt,bt,zt,Ut,In,Rn;for(W=new su(t.b),Ne=new su(t.b),P=new su(t.b),zt=new su(t.b),X=new su(t.b),bt=ii(t,0);bt.b!=bt.d.c;)for(Ve=u(ri(bt),11),d=new C(Ve.g);d.a0,le=Ve.g.c.length>0,x&&le?P.c[P.c.length]=Ve:x?W.c[W.c.length]=Ve:le&&(Ne.c[Ne.c.length]=Ve);for(q=new C(W);q.a1)for(q=new _6((!e.a&&(e.a=new at(os,e,6,6)),e.a));q.e!=q.i.gc();)J_(q);for(h=u(Te((!e.a&&(e.a=new at(os,e,6,6)),e.a),0),202),X=ki,ki>Ve+Ne?X=Ve+Ne:kint+W?le=nt+W:WsVe-Ne&&Xnt-W&&leki+dr?zt=ki+dr:VeWs+bt?Ut=Ws+bt:ntki-dr&&ztWs-bt&&Utn&&(P=n-1),z=pN+vl(t,24)*NI*L-L/2,z<0?z=1:z>r&&(z=r-1),s=(pv(),v=new pp,v),z$(s,P),G$(s,z),Br((!h.a&&(h.a=new Bs(ef,h,5)),h.a),s)}function pt(){pt=pe,Xle=(bi(),c3t),QTe=u3t,SO=zSe,Mf=l3t,Ok=GSe,Sw=h3t,Ry=qSe,bE=VSe,vE=USe,Qle=RV,Aw=jb,Zle=f3t,bS=YSe,eV=Fk,CO=(f6e(),svt),V4=avt,Nb=ovt,U4=cvt,Vvt=new fo(BV,ct(0)),pE=nvt,XTe=rvt,Ik=ivt,s_e=Mvt,ZTe=hvt,JTe=gvt,ehe=kvt,e_e=vvt,t_e=mvt,tV=Nvt,the=Dvt,r_e=Cvt,n_e=Tvt,i_e=Avt,_w=Xbt,pS=Qbt,Vle=gbt,ATe=bbt,VTe=new kv(12),qTe=new fo(Fb,VTe),_Te=($0(),_E),K0=new fo(wSe,_Te),Ny=new fo(kl,0),Uvt=new fo(ufe,ct(1)),Hq=new fo(Bk,N7),Ob=PV,bs=BS,gE=t5,Fvt=VO,Bd=Jyt,Iy=Q4,Wvt=new fo(lfe,(Mn(),!0)),Oy=UO,Db=nfe,Ib=Rb,Jq=p2,Yle=NV,TTe=(wo(),f0),Zl=new fo(Mw,TTe),Tw=J4,Qq=SSe,Py=Hy,qvt=cfe,KTe=$Se,WTe=(n4(),ZO),new fo(PSe,WTe),Hvt=ife,zvt=sfe,Gvt=afe,$vt=rfe,Jle=lvt,jTe=Fbt,Wle=Rbt,vS=uvt,vu=Mbt,Dy=abt,dS=sbt,My=U2t,kTe=W2t,Hle=Q2t,_O=K2t,zle=rbt,$Te=jbt,HTe=$bt,NTe=Tbt,Zq=evt,Kle=Gbt,Ule=mbt,GTe=Kbt,STe=fbt,qle=dbt,$le=IV,zTe=Hbt,Gq=j2t,wTe=F2t,zq=R2t,DTe=xbt,MTe=kbt,ITe=Ebt,fE=e5,Fo=Z4,Hg=ySe,Rd=tfe,Gle=efe,xTe=J2t,zg=ofe,fS=n3t,Kq=r3t,Cw=RSe,UTe=i3t,dE=s3t,BTe=Ibt,RTe=Nbt,By=Rk,Fle=B2t,FTe=Bbt,Wq=ubt,Uq=cbt,Xq=WO,PTe=Sbt,gS=Vbt,AO=WSe,ETe=obt,YTe=tvt,CTe=lbt,jvt=Lbt,Rvt=tbt,OTe=TSe,Yq=Dbt,Vq=nbt,h2=V2t,yTe=G2t,qq=H2t,mTe=z2t,jle=q2t,Dk=$2t,LTe=ybt}function Lae(e,t){pae();var n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt,bt,zt,Ut,In,Rn,dr,ki;if(zt=e.e,q=e.d,s=e.a,zt==0)switch(t){case 0:return"0";case 1:return L7;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:return nt=new Tp,t<0?nt.a+="0E+":nt.a+="0E",nt.a+=-t,nt.a}if(Ee=q*10+1+7,Ne=Me(Sh,Td,25,Ee+1,15,1),n=Ee,q==1)if(d=s[0],d<0){ki=qs(d,yo);do W=ki,ki=eI(ki,10),Ne[--n]=48+Or(Wp(W,ja(ki,10)))&Ss;while(Mc(ki,0)!=0)}else{ki=d;do W=ki,ki=ki/10|0,Ne[--n]=48+(W-ki*10)&Ss;while(ki!=0)}else{In=Me(Lr,Jr,25,q,15,1),dr=q,Hc(s,0,In,0,dr);e:for(;;){for(bt=0,x=dr-1;x>=0;x--)Rn=Ua(A0(bt,32),qs(In[x],yo)),le=Ghn(Rn),In[x]=Or(le),bt=Or(Np(le,32));Ce=Or(bt),X=n;do Ne[--n]=48+Ce%10&Ss;while((Ce=Ce/10|0)!=0&&n!=0);for(r=9-X+n,v=0;v0;v++)Ne[--n]=48;for(L=dr-1;In[L]==0;L--)if(L==0)break e;dr=L+1}for(;Ne[n]==48;)++n}if(z=zt<0,h=Ee-n-t-1,t==0)return z&&(Ne[--n]=45),jh(Ne,n,Ee-n);if(t>0&&h>=-6){if(h>=0){for(_=n+h,P=Ee-1;P>=_;P--)Ne[P+1]=Ne[P];return Ne[++_]=46,z&&(Ne[--n]=45),jh(Ne,n,Ee-n+1)}for(L=2;L<-h+1;L++)Ne[--n]=48;return Ne[--n]=46,Ne[--n]=48,z&&(Ne[--n]=45),jh(Ne,n,Ee-n)}return Ut=n+1,o=Ee,Ve=new xm,z&&(Ve.a+="-"),o-Ut>=1?(Bp(Ve,Ne[n]),Ve.a+=".",Ve.a+=jh(Ne,n+1,Ee-n-1)):Ve.a+=jh(Ne,n,Ee-n),Ve.a+="E",h>0&&(Ve.a+="+"),Ve.a+=""+h,Ve.a}function Ult(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt;switch(e.c=t,e.g=new Mr,n=(Tm(),new ym(e.c)),r=new nr(n),Uye(r),Ee=Hr(Ft(e.c,(nI(),HCe))),v=u(Ft(e.c,Vhe),316),Ve=u(Ft(e.c,Uhe),429),h=u(Ft(e.c,FCe),482),Ne=u(Ft(e.c,qhe),430),e.j=Ue(ft(Ft(e.c,Eyt))),d=e.a,v.g){case 0:d=e.a;break;case 1:d=e.b;break;case 2:d=e.i;break;case 3:d=e.e;break;case 4:d=e.f;break;default:throw J(new Ln(lG+(v.f!=null?v.f:""+v.g)))}if(e.d=new gXe(d,Ve,h),Ye(e.d,(H8(),JC),Mt(Ft(e.c,kyt))),e.d.c=It(Mt(Ft(e.c,jCe))),Jj(e.c).i==0)return e.d;for(L=new rr(Jj(e.c));L.e!=L.i.gc();){for(_=u(pr(L),33),z=_.g/2,P=_.f/2,nt=new Pt(_.i+z,_.j+P);Il(e.g,nt);)Lm(nt,(b.Math.random()-.5)*Sd,(b.Math.random()-.5)*Sd);W=u(Ft(_,(bi(),WO)),142),X=new DXe(nt,new fh(nt.a-z-e.j/2-W.b,nt.b-P-e.j/2-W.d,_.g+e.j+(W.b+W.c),_.f+e.j+(W.d+W.a))),it(e.d.i,X),Si(e.g,nt,new xa(X,_))}switch(Ne.g){case 0:if(Ee==null)e.d.d=u(St(e.d.i,0),65);else for(Ce=new C(e.d.i);Ce.a1&&ks(_,le,_.c.b,_.c),F$(s)));le=Ce}return _}function jyn(e,t,n){var r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt,bt,zt,Ut,In,Rn,dr,ki,Ws,rh,af,ed;for(kr(n,"Greedy cycle removal",1),Ee=t.a,ed=Ee.c.length,e.a=Me(Lr,Jr,25,ed,15,1),e.c=Me(Lr,Jr,25,ed,15,1),e.b=Me(Lr,Jr,25,ed,15,1),x=0,le=new C(Ee);le.a0?dr+1:1);for(h=new C(nt.g);h.a0?dr+1:1)}e.c[x]==0?ci(e.e,W):e.a[x]==0&&ci(e.f,W),++x}for(q=-1,z=1,L=new st,e.d=u(K(t,(et(),Lk)),230);ed>0;){for(;e.e.b!=0;)Ws=u(mne(e.e),10),e.b[Ws.p]=q--,I5e(e,Ws),--ed;for(;e.f.b!=0;)rh=u(mne(e.f),10),e.b[rh.p]=z++,I5e(e,rh),--ed;if(ed>0){for(P=$a,Ce=new C(Ee);Ce.a=P&&(Ne>P&&(L.c=Me(Yn,yt,1,0,5,1),P=Ne),L.c[L.c.length]=W));_=e.Zf(L),e.b[_.p]=z++,I5e(e,_),--ed}}for(ki=Ee.c.length+1,x=0;xe.b[af]&&(iw(r,!0),Ye(t,yO,(Mn(),!0)));e.a=null,e.c=null,e.b=null,Rh(e.f),Rh(e.e),ur(n)}function Klt(e,t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le;for(r=new st,d=new st,X=t/2,z=e.gc(),s=u(e.Xb(0),8),le=u(e.Xb(1),8),q=Gse(s.a,s.b,le.a,le.b,X),it(r,(xn(0,q.c.length),u(q.c[0],8))),it(d,(xn(1,q.c.length),u(q.c[1],8))),x=2;x=0;v--)ci(n,(xn(v,h.c.length),u(h.c[v],8)));return n}function $yn(e){var t,n,r,s,o,h,d,v,x,_,L,P,z;if(h=!0,L=null,r=null,s=null,t=!1,z=e4t,x=null,o=null,d=0,v=Yie(e,d,OAe,NAe),v=0&&an(e.substr(d,2),"//")?(d+=2,v=Yie(e,d,KS,YS),r=e.substr(d,v-d),d=v):L!=null&&(d==e.length||(zr(d,e.length),e.charCodeAt(d)!=47))&&(h=!1,v=lbe(e,Nu(35),d),v==-1&&(v=e.length),r=e.substr(d,v-d),d=v);if(!n&&d0&&Ma(_,_.length-1)==58&&(s=_,d=v)),d=e.j){e.a=-1,e.c=1;return}if(t=Ma(e.i,e.d++),e.a=t,e.b==1){switch(t){case 92:if(r=10,e.d>=e.j)throw J(new $r(Ur((jr(),vG))));e.a=Ma(e.i,e.d++);break;case 45:(e.e&512)==512&&e.d=e.j||Ma(e.i,e.d)!=63)break;if(++e.d>=e.j)throw J(new $r(Ur((jr(),Wce))));switch(t=Ma(e.i,e.d++),t){case 58:r=13;break;case 61:r=14;break;case 33:r=15;break;case 91:r=19;break;case 62:r=18;break;case 60:if(e.d>=e.j)throw J(new $r(Ur((jr(),Wce))));if(t=Ma(e.i,e.d++),t==61)r=16;else if(t==33)r=17;else throw J(new $r(Ur((jr(),W1t))));break;case 35:for(;e.d=e.j)throw J(new $r(Ur((jr(),vG))));e.a=Ma(e.i,e.d++);break;default:r=0}e.c=r}function zyn(e){var t,n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt,bt,zt,Ut,In,Rn,dr;if(bt=u(K(e,(pt(),bs)),98),bt!=(wa(),X1)&&bt!=w2){for(q=e.b,z=q.c.length,_=new su((ql(z+2,Nae),R$(Ua(Ua(5,z+2),(z+2)/10|0)))),W=new su((ql(z+2,Nae),R$(Ua(Ua(5,z+2),(z+2)/10|0)))),it(_,new Mr),it(_,new Mr),it(W,new st),it(W,new st),nt=new st,t=0;t=Ve||!ucn(le,r))&&(r=HXe(t,_)),No(le,r),o=new cr(fr(Xo(le).a.Kc(),new V));Vr(o);)s=u(Pr(o),17),!e.a[s.p]&&(W=s.c.i,--e.e[W.p],e.e[W.p]==0&&S8(l7(z,W)));for(x=_.c.length-1;x>=0;--x)it(t.b,(xn(x,_.c.length),u(_.c[x],29)));t.a.c=Me(Yn,yt,1,0,5,1),ur(n)}function Ylt(e){var t,n,r,s,o,h,d,v,x;for(e.b=1,mi(e),t=null,e.c==0&&e.a==94?(mi(e),t=(yi(),yi(),new Hl(4)),Yc(t,0,q7),d=new Hl(4)):d=(yi(),yi(),new Hl(4)),s=!0;(x=e.c)!=1;){if(x==0&&e.a==93&&!s){t&&(bC(t,d),d=t);break}if(n=e.a,r=!1,x==10)switch(n){case 100:case 68:case 119:case 87:case 115:case 83:ly(d,m7(n)),r=!0;break;case 105:case 73:case 99:case 67:n=(ly(d,m7(n)),-1),n<0&&(r=!0);break;case 112:case 80:if(v=$4e(e,n),!v)throw J(new $r(Ur((jr(),Kce))));ly(d,v),r=!0;break;default:n=y5e(e)}else if(x==24&&!s){if(t&&(bC(t,d),d=t),o=Ylt(e),bC(d,o),e.c!=0||e.a!=93)throw J(new $r(Ur((jr(),rdt))));break}if(mi(e),!r){if(x==0){if(n==91)throw J(new $r(Ur((jr(),h8e))));if(n==93)throw J(new $r(Ur((jr(),f8e))));if(n==45&&!s&&e.a!=93)throw J(new $r(Ur((jr(),Yce))))}if(e.c!=0||e.a!=45||n==45&&s)Yc(d,n,n);else{if(mi(e),(x=e.c)==1)throw J(new $r(Ur((jr(),wG))));if(x==0&&e.a==93)Yc(d,n,n),Yc(d,45,45);else{if(x==0&&e.a==93||x==24)throw J(new $r(Ur((jr(),Yce))));if(h=e.a,x==0){if(h==91)throw J(new $r(Ur((jr(),h8e))));if(h==93)throw J(new $r(Ur((jr(),f8e))));if(h==45)throw J(new $r(Ur((jr(),Yce))))}else x==10&&(h=y5e(e));if(mi(e),n>h)throw J(new $r(Ur((jr(),adt))));Yc(d,n,h)}}}s=!1}if(e.c==1)throw J(new $r(Ur((jr(),wG))));return l4(d),gC(d),e.b=0,mi(e),d}function qyn(e){Rr(e.c,Zr,ie(re(mt,1),Qe,2,6,[Ha,"http://www.w3.org/2001/XMLSchema#decimal"])),Rr(e.d,Zr,ie(re(mt,1),Qe,2,6,[Ha,"http://www.w3.org/2001/XMLSchema#integer"])),Rr(e.e,Zr,ie(re(mt,1),Qe,2,6,[Ha,"http://www.w3.org/2001/XMLSchema#boolean"])),Rr(e.f,Zr,ie(re(mt,1),Qe,2,6,[Ha,"EBoolean",gi,"EBoolean:Object"])),Rr(e.i,Zr,ie(re(mt,1),Qe,2,6,[Ha,"http://www.w3.org/2001/XMLSchema#byte"])),Rr(e.g,Zr,ie(re(mt,1),Qe,2,6,[Ha,"http://www.w3.org/2001/XMLSchema#hexBinary"])),Rr(e.j,Zr,ie(re(mt,1),Qe,2,6,[Ha,"EByte",gi,"EByte:Object"])),Rr(e.n,Zr,ie(re(mt,1),Qe,2,6,[Ha,"EChar",gi,"EChar:Object"])),Rr(e.t,Zr,ie(re(mt,1),Qe,2,6,[Ha,"http://www.w3.org/2001/XMLSchema#double"])),Rr(e.u,Zr,ie(re(mt,1),Qe,2,6,[Ha,"EDouble",gi,"EDouble:Object"])),Rr(e.F,Zr,ie(re(mt,1),Qe,2,6,[Ha,"http://www.w3.org/2001/XMLSchema#float"])),Rr(e.G,Zr,ie(re(mt,1),Qe,2,6,[Ha,"EFloat",gi,"EFloat:Object"])),Rr(e.I,Zr,ie(re(mt,1),Qe,2,6,[Ha,"http://www.w3.org/2001/XMLSchema#int"])),Rr(e.J,Zr,ie(re(mt,1),Qe,2,6,[Ha,"EInt",gi,"EInt:Object"])),Rr(e.N,Zr,ie(re(mt,1),Qe,2,6,[Ha,"http://www.w3.org/2001/XMLSchema#long"])),Rr(e.O,Zr,ie(re(mt,1),Qe,2,6,[Ha,"ELong",gi,"ELong:Object"])),Rr(e.Z,Zr,ie(re(mt,1),Qe,2,6,[Ha,"http://www.w3.org/2001/XMLSchema#short"])),Rr(e.$,Zr,ie(re(mt,1),Qe,2,6,[Ha,"EShort",gi,"EShort:Object"])),Rr(e._,Zr,ie(re(mt,1),Qe,2,6,[Ha,"http://www.w3.org/2001/XMLSchema#string"]))}function Vyn(e){var t,n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt,bt,zt,Ut,In,Rn,dr;if(e.c.length==1)return xn(0,e.c.length),u(e.c[0],135);if(e.c.length<=0)return new E$;for(v=new C(e);v.aL&&(Rn=0,dr+=_+bt,_=0),tgn(Ve,h,Rn,dr),t=b.Math.max(t,Rn+nt.a),_=b.Math.max(_,nt.b),Rn+=nt.a+bt;for(Ne=new Mr,n=new Mr,Ut=new C(e);Ut.aqse(o))&&(L=o);for(!L&&(L=(xn(0,X.c.length),u(X.c[0],180))),W=new C(t.b);W.a=-1900?1:0,n>=4?Yr(e,ie(re(mt,1),Qe,2,6,[fht,dht])[d]):Yr(e,ie(re(mt,1),Qe,2,6,["BC","AD"])[d]);break;case 121:jcn(e,n,r);break;case 77:G2n(e,n,r);break;case 107:v=s.q.getHours(),v==0?e0(e,24,n):e0(e,v,n);break;case 83:lgn(e,n,s);break;case 69:_=r.q.getDay(),n==5?Yr(e,ie(re(mt,1),Qe,2,6,["S","M","T","W","T","F","S"])[_]):n==4?Yr(e,ie(re(mt,1),Qe,2,6,[Kae,Yae,Xae,Qae,Zae,Jae,eoe])[_]):Yr(e,ie(re(mt,1),Qe,2,6,["Sun","Mon","Tue","Wed","Thu","Fri","Sat"])[_]);break;case 97:s.q.getHours()>=12&&s.q.getHours()<24?Yr(e,ie(re(mt,1),Qe,2,6,["AM","PM"])[1]):Yr(e,ie(re(mt,1),Qe,2,6,["AM","PM"])[0]);break;case 104:L=s.q.getHours()%12,L==0?e0(e,12,n):e0(e,L,n);break;case 75:P=s.q.getHours()%12,e0(e,P,n);break;case 72:z=s.q.getHours(),e0(e,z,n);break;case 99:q=r.q.getDay(),n==5?Yr(e,ie(re(mt,1),Qe,2,6,["S","M","T","W","T","F","S"])[q]):n==4?Yr(e,ie(re(mt,1),Qe,2,6,[Kae,Yae,Xae,Qae,Zae,Jae,eoe])[q]):n==3?Yr(e,ie(re(mt,1),Qe,2,6,["Sun","Mon","Tue","Wed","Thu","Fri","Sat"])[q]):e0(e,q,1);break;case 76:W=r.q.getMonth(),n==5?Yr(e,ie(re(mt,1),Qe,2,6,["J","F","M","A","M","J","J","A","S","O","N","D"])[W]):n==4?Yr(e,ie(re(mt,1),Qe,2,6,[Rae,Fae,jae,$ae,ak,Hae,zae,Gae,qae,Vae,Uae,Wae])[W]):n==3?Yr(e,ie(re(mt,1),Qe,2,6,["Jan","Feb","Mar","Apr",ak,"Jun","Jul","Aug","Sep","Oct","Nov","Dec"])[W]):e0(e,W+1,n);break;case 81:X=r.q.getMonth()/3|0,n<4?Yr(e,ie(re(mt,1),Qe,2,6,["Q1","Q2","Q3","Q4"])[X]):Yr(e,ie(re(mt,1),Qe,2,6,["1st quarter","2nd quarter","3rd quarter","4th quarter"])[X]);break;case 100:le=r.q.getDate(),e0(e,le,n);break;case 109:x=s.q.getMinutes(),e0(e,x,n);break;case 115:h=s.q.getSeconds(),e0(e,h,n);break;case 122:n<4?Yr(e,o.c[0]):Yr(e,o.c[1]);break;case 118:Yr(e,o.b);break;case 90:n<3?Yr(e,J1n(o)):n==3?Yr(e,ndn(o)):Yr(e,rdn(o.a));break;default:return!1}return!0}function h6e(e,t,n,r){var s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt,bt,zt,Ut,In,Rn,dr,ki;if(Bct(t),v=u(Te((!t.b&&(t.b=new wn(mr,t,4,7)),t.b),0),82),_=u(Te((!t.c&&(t.c=new wn(mr,t,5,8)),t.c),0),82),d=zo(v),x=zo(_),h=(!t.a&&(t.a=new at(os,t,6,6)),t.a).i==0?null:u(Te((!t.a&&(t.a=new at(os,t,6,6)),t.a),0),202),bt=u(er(e.a,d),10),Rn=u(er(e.a,x),10),zt=null,dr=null,we(v,186)&&(nt=u(er(e.a,v),299),we(nt,11)?zt=u(nt,11):we(nt,10)&&(bt=u(nt,10),zt=u(St(bt.j,0),11))),we(_,186)&&(In=u(er(e.a,_),299),we(In,11)?dr=u(In,11):we(In,10)&&(Rn=u(In,10),dr=u(St(Rn.j,0),11))),!bt||!Rn)throw J(new CT("The source or the target of edge "+t+" 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."));for(W=new Iv,Ho(W,t),Ye(W,(et(),Mi),t),Ye(W,(pt(),Fo),null),z=u(K(r,eu),21),bt==Rn&&z.Fc((mo(),cS)),zt||(Ve=(vo(),hu),Ut=null,h&&R3(u(K(bt,bs),98))&&(Ut=new Pt(h.j,h.k),qQe(Ut,nD(t)),yZe(Ut,n),Vm(x,d)&&(Ve=ul,Ni(Ut,bt.n))),zt=Nut(bt,Ut,Ve,r)),dr||(Ve=(vo(),ul),ki=null,h&&R3(u(K(Rn,bs),98))&&(ki=new Pt(h.b,h.c),qQe(ki,nD(t)),yZe(ki,n)),dr=Nut(Rn,ki,Ve,Ya(Rn))),Va(W,zt),ba(W,dr),(zt.e.c.length>1||zt.g.c.length>1||dr.e.c.length>1||dr.g.c.length>1)&&z.Fc((mo(),oS)),P=new rr((!t.n&&(t.n=new at(Jo,t,1,7)),t.n));P.e!=P.i.gc();)if(L=u(pr(P),137),!It(Mt(Ft(L,Ob)))&&L.a)switch(X=Mie(L),it(W.b,X),u(K(X,Rd),272).g){case 1:case 2:z.Fc((mo(),cE));break;case 0:z.Fc((mo(),oE)),Ye(X,Rd,(P1(),EE))}if(o=u(K(r,dS),314),le=u(K(r,Zq),315),s=o==(V6(),vO)||le==(X_(),ohe),h&&(!h.a&&(h.a=new Bs(ef,h,5)),h.a).i!=0&&s){for(Ce=iI(h),q=new Gu,Ne=ii(Ce,0);Ne.b!=Ne.d.c;)Ee=u(ri(Ne),8),ci(q,new Io(Ee));Ye(W,R9e,q)}return W}function Yyn(e){e.gb||(e.gb=!0,e.b=gc(e,0),ls(e.b,18),zi(e.b,19),e.a=gc(e,1),ls(e.a,1),zi(e.a,2),zi(e.a,3),zi(e.a,4),zi(e.a,5),e.o=gc(e,2),ls(e.o,8),ls(e.o,9),zi(e.o,10),zi(e.o,11),zi(e.o,12),zi(e.o,13),zi(e.o,14),zi(e.o,15),zi(e.o,16),zi(e.o,17),zi(e.o,18),zi(e.o,19),zi(e.o,20),zi(e.o,21),zi(e.o,22),zi(e.o,23),Bo(e.o),Bo(e.o),Bo(e.o),Bo(e.o),Bo(e.o),Bo(e.o),Bo(e.o),Bo(e.o),Bo(e.o),Bo(e.o),e.p=gc(e,3),ls(e.p,2),ls(e.p,3),ls(e.p,4),ls(e.p,5),zi(e.p,6),zi(e.p,7),Bo(e.p),Bo(e.p),e.q=gc(e,4),ls(e.q,8),e.v=gc(e,5),zi(e.v,9),Bo(e.v),Bo(e.v),Bo(e.v),e.w=gc(e,6),ls(e.w,2),ls(e.w,3),ls(e.w,4),zi(e.w,5),e.B=gc(e,7),zi(e.B,1),Bo(e.B),Bo(e.B),Bo(e.B),e.Q=gc(e,8),zi(e.Q,0),Bo(e.Q),e.R=gc(e,9),ls(e.R,1),e.S=gc(e,10),Bo(e.S),Bo(e.S),Bo(e.S),Bo(e.S),Bo(e.S),Bo(e.S),Bo(e.S),Bo(e.S),Bo(e.S),Bo(e.S),Bo(e.S),Bo(e.S),Bo(e.S),Bo(e.S),Bo(e.S),e.T=gc(e,11),zi(e.T,10),zi(e.T,11),zi(e.T,12),zi(e.T,13),zi(e.T,14),Bo(e.T),Bo(e.T),e.U=gc(e,12),ls(e.U,2),ls(e.U,3),zi(e.U,4),zi(e.U,5),zi(e.U,6),zi(e.U,7),Bo(e.U),e.V=gc(e,13),zi(e.V,10),e.W=gc(e,14),ls(e.W,18),ls(e.W,19),ls(e.W,20),zi(e.W,21),zi(e.W,22),zi(e.W,23),e.bb=gc(e,15),ls(e.bb,10),ls(e.bb,11),ls(e.bb,12),ls(e.bb,13),ls(e.bb,14),ls(e.bb,15),ls(e.bb,16),zi(e.bb,17),Bo(e.bb),Bo(e.bb),e.eb=gc(e,16),ls(e.eb,2),ls(e.eb,3),ls(e.eb,4),ls(e.eb,5),ls(e.eb,6),ls(e.eb,7),zi(e.eb,8),zi(e.eb,9),e.ab=gc(e,17),ls(e.ab,0),ls(e.ab,1),e.H=gc(e,18),zi(e.H,0),zi(e.H,1),zi(e.H,2),zi(e.H,3),zi(e.H,4),zi(e.H,5),Bo(e.H),e.db=gc(e,19),zi(e.db,2),e.c=di(e,20),e.d=di(e,21),e.e=di(e,22),e.f=di(e,23),e.i=di(e,24),e.g=di(e,25),e.j=di(e,26),e.k=di(e,27),e.n=di(e,28),e.r=di(e,29),e.s=di(e,30),e.t=di(e,31),e.u=di(e,32),e.fb=di(e,33),e.A=di(e,34),e.C=di(e,35),e.D=di(e,36),e.F=di(e,37),e.G=di(e,38),e.I=di(e,39),e.J=di(e,40),e.L=di(e,41),e.M=di(e,42),e.N=di(e,43),e.O=di(e,44),e.P=di(e,45),e.X=di(e,46),e.Y=di(e,47),e.Z=di(e,48),e.$=di(e,49),e._=di(e,50),e.cb=di(e,51),e.K=di(e,52))}function bi(){bi=pe;var e,t;PS=new Zi(n1t),xE=new Zi(r1t),dSe=(t0(),Yhe),Jyt=new dn(Zke,dSe),Bk=new dn(fk,null),e3t=new Zi(Uxe),pSe=(ty(),Ui(Zhe,ie(re(Jhe,1),tt,291,0,[Qhe]))),IV=new dn(rG,pSe),VO=new dn(WI,(Mn(),!1)),bSe=(wo(),f0),Mw=new dn(txe,bSe),mSe=($0(),hfe),wSe=new dn(VI,mSe),xSe=new dn(uG,!1),ESe=(F0(),FV),Q4=new dn(nG,ESe),OSe=new kv(12),Fb=new dn(uw,OSe),OV=new dn(jI,!1),TSe=new dn(fce,!1),KO=new dn(CC,!1),FSe=(wa(),w2),BS=new dn(Doe,FSe),Rk=new Zi(iG),BV=new Zi(FI),ufe=new Zi(Fz),lfe=new Zi(_C),_Se=new Gu,Z4=new dn(lxe,_Se),n3t=new dn(dxe,!1),r3t=new dn(gxe,!1),CSe=new yT,WO=new dn(bxe,CSe),PV=new dn(Xke,!1),o3t=new dn(i1t,1),new dn(s1t,!0),ct(0),new dn(a1t,ct(100)),new dn(o1t,!1),ct(0),new dn(c1t,ct(4e3)),ct(0),new dn(u1t,ct(400)),new dn(l1t,!1),new dn(h1t,!1),new dn(f1t,!0),new dn(d1t,!1),gSe=(EH(),pfe),t3t=new dn(Vxe,gSe),c3t=new dn(Fke,10),u3t=new dn(jke,10),zSe=new dn(_oe,20),l3t=new dn($ke,10),GSe=new dn(Moe,2),h3t=new dn(Hke,10),qSe=new dn(zke,0),RV=new dn(Vke,5),VSe=new dn(Gke,1),USe=new dn(qke,1),jb=new dn(py,20),f3t=new dn(Uke,10),YSe=new dn(Wke,10),Fk=new Zi(Kke),KSe=new bVe,WSe=new dn(vxe,KSe),s3t=new Zi(hce),NSe=!1,i3t=new dn(lce,NSe),ASe=new kv(5),SSe=new dn(nxe,ASe),LSe=(sy(),t=u(Qf(xo),9),new hh(t,u(wf(t,t.length),9),0)),J4=new dn(P7,LSe),BSe=(n4(),v2),PSe=new dn(sxe,BSe),ife=new Zi(axe),sfe=new Zi(oxe),afe=new Zi(cxe),rfe=new Zi(uxe),MSe=(e=u(Qf(qS),9),new hh(e,u(wf(e,e.length),9),0)),Rb=new dn(E4,MSe),ISe=rn((wl(),SE)),p2=new dn(dk,ISe),DSe=new Pt(0,0),e5=new dn(gk,DSe),NV=new dn(uce,!1),vSe=(P1(),EE),tfe=new dn(hxe,vSe),efe=new dn(jz,!1),ct(1),new dn(g1t,null),RSe=new Zi(pxe),ofe=new Zi(fxe),HSe=(ht(),uc),t5=new dn(Qke,HSe),kl=new Zi(Yke),jSe=(ol(),rn(m2)),Hy=new dn(B7,jSe),cfe=new dn(rxe,!1),$Se=new dn(ixe,!0),UO=new dn(Jke,!1),nfe=new dn(exe,!1),ySe=new dn(Coe,1),kSe=(YH(),dfe),new dn(p1t,kSe),a3t=!0}function et(){et=pe;var e,t;Mi=new Zi(K6e),O9e=new Zi("coordinateOrigin"),Ple=new Zi("processors"),I9e=new zs("compoundNode",(Mn(),!1)),kO=new zs("insideConnections",!1),R9e=new Zi("originalBendpoints"),F9e=new Zi("originalDummyNodePosition"),j9e=new Zi("originalLabelEdge"),EO=new Zi("representedLabels"),uS=new Zi("endLabels"),Ck=new Zi("endLabel.origin"),Ak=new zs("labelSide",(Ul(),QO)),H4=new zs("maxEdgeThickness",0),W1=new zs("reversed",!1),Lk=new Zi(Qht),l1=new zs("longEdgeSource",null),Yh=new zs("longEdgeTarget",null),Ay=new zs("longEdgeHasLabelDummies",!1),xO=new zs("longEdgeBeforeLabelDummy",!1),Fq=new zs("edgeConstraint",(sb(),wle)),xw=new Zi("inLayerLayoutUnit"),Lb=new zs("inLayerConstraint",(P0(),mO)),Sk=new zs("inLayerSuccessorConstraint",new st),B9e=new zs("inLayerSuccessorConstraintBetweenNonDummies",!1),cl=new Zi("portDummy"),Rq=new zs("crossingHint",ct(0)),eu=new zs("graphProperties",(t=u(Qf(_le),9),new hh(t,u(wf(t,t.length),9),0))),vc=new zs("externalPortSide",(ht(),uc)),P9e=new zs("externalPortSize",new Fa),Mle=new Zi("externalPortReplacedDummies"),jq=new Zi("externalPortReplacedDummy"),Sy=new zs("externalPortConnections",(e=u(Qf(ao),9),new hh(e,u(wf(e,e.length),9),0))),Ew=new zs(Ght,0),D9e=new Zi("barycenterAssociates"),Mk=new Zi("TopSideComments"),_k=new Zi("BottomSideComments"),Bq=new Zi("CommentConnectionPort"),Ile=new zs("inputCollect",!1),Nle=new zs("outputCollect",!1),yO=new zs("cyclic",!1),N9e=new Zi("crossHierarchyMap"),Rle=new Zi("targetOffset"),new zs("splineLabelSize",new Fa),G4=new Zi("spacings"),$q=new zs("partitionConstraint",!1),yw=new Zi("breakingPoint.info"),z9e=new Zi("splines.survivingEdge"),Mb=new Zi("splines.route.start"),q4=new Zi("splines.edgeChain"),H9e=new Zi("originalPortConstraints"),lE=new Zi("selfLoopHolder"),hE=new Zi("splines.nsPortY"),Nc=new Zi("modelOrder"),Ole=new Zi("longEdgeTargetNode"),kw=new zs(Tft,!1),z4=new zs(Tft,!1),Dle=new Zi("layerConstraints.hiddenNodes"),$9e=new Zi("layerConstraints.opposidePort"),Ble=new Zi("targetNode.modelOrder")}function f6e(){f6e=pe,J9e=(ED(),Lq),obt=new dn(nke,J9e),mbt=new dn(rke,(Mn(),!1)),sTe=(b$(),Lle),Tbt=new dn(Gz,sTe),jbt=new dn(ike,!1),$bt=new dn(ske,!0),B2t=new dn(ake,!1),dTe=(mD(),lhe),tvt=new dn(oke,dTe),ct(1),uvt=new dn(cke,ct(7)),lvt=new dn(uke,!1),ybt=new dn(lke,!1),Z9e=(db(),ble),abt=new dn(Roe,Z9e),cTe=(WH(),rhe),Fbt=new dn(GI,cTe),aTe=(mh(),TO),Mbt=new dn(hke,aTe),ct(-1),Lbt=new dn(fke,ct(-1)),ct(-1),Dbt=new dn(dke,ct(-1)),ct(-1),Ibt=new dn(Foe,ct(4)),ct(-1),Nbt=new dn(joe,ct(2)),oTe=(f4(),aV),Rbt=new dn($oe,oTe),ct(0),Bbt=new dn(Hoe,ct(0)),Sbt=new dn(zoe,ct(Ei)),Q9e=(V6(),Ek),sbt=new dn(MC,Q9e),U2t=new dn(gke,!1),J2t=new dn(Goe,.1),rbt=new dn(qoe,!1),ct(-1),tbt=new dn(pke,ct(-1)),ct(-1),nbt=new dn(bke,ct(-1)),ct(0),W2t=new dn(vke,ct(40)),X9e=(q8(),Sle),Q2t=new dn(Voe,X9e),Y9e=wO,K2t=new dn(qz,Y9e),fTe=(X_(),wS),evt=new dn(T4,fTe),Vbt=new Zi(Vz),uTe=(pD(),Dq),Hbt=new dn(Uoe,uTe),lTe=(tI(),Iq),Gbt=new dn(Woe,lTe),Kbt=new dn(Koe,.3),Xbt=new Zi(Yoe),hTe=(Zm(),sV),Qbt=new dn(Xoe,hTe),nTe=(iH(),fhe),fbt=new dn(wke,nTe),rTe=(uD(),dhe),dbt=new dn(mke,rTe),iTe=(Q8(),kS),gbt=new dn(Uz,iTe),bbt=new dn(Wz,.2),lbt=new dn(Qoe,2),svt=new dn(yke,null),ovt=new dn(kke,10),avt=new dn(xke,10),cvt=new dn(Eke,20),ct(0),nvt=new dn(Tke,ct(0)),ct(0),rvt=new dn(_ke,ct(0)),ct(0),ivt=new dn(Cke,ct(0)),R2t=new dn(Zoe,!1),V9e=(h7(),aS),j2t=new dn(Ske,V9e),q9e=(S$(),gle),F2t=new dn(Ake,q9e),xbt=new dn(Kz,!1),ct(0),kbt=new dn(Joe,ct(16)),ct(0),Ebt=new dn(ece,ct(5)),bTe=(uH(),bhe),Mvt=new dn(W0,bTe),hvt=new dn(Yz,10),gvt=new dn(Xz,1),pTe=(V$(),Aq),kvt=new dn(DC,pTe),vvt=new Zi(tce),gTe=ct(1),ct(0),mvt=new dn(nce,gTe),vTe=(nH(),phe),Nvt=new dn(Qz,vTe),Dvt=new Zi(Zz),Cvt=new dn(Jz,!0),Tvt=new dn(eG,2),Avt=new dn(rce,!0),tTe=(QH(),Mq),ubt=new dn(Lke,tTe),eTe=(ek(),iE),cbt=new dn(Mke,eTe),K9e=(R0(),f2),V2t=new dn(tG,K9e),q2t=new dn(Dke,!1),U9e=(Uv(),N4),$2t=new dn(ice,U9e),W9e=(j_(),ihe),G2t=new dn(Ike,W9e),H2t=new dn(sce,0),z2t=new dn(ace,0),Cbt=vle,_bt=vO,Obt=rV,Pbt=rV,Abt=nhe,ebt=(F0(),Wg),ibt=Ek,Z2t=Ek,Y2t=Ek,X2t=Wg,Ubt=mS,Wbt=wS,zbt=wS,qbt=wS,Ybt=che,Jbt=mS,Zbt=mS,pbt=($0(),jk),vbt=jk,wbt=kS,hbt=YO,fvt=wE,dvt=Fy,pvt=wE,bvt=Fy,xvt=wE,Evt=Fy,wvt=ple,yvt=Aq,Pvt=wE,Bvt=Fy,Ivt=wE,Ovt=Fy,Svt=Fy,_vt=Fy,Lvt=Fy}function po(){po=pe,MEe=new Cs("DIRECTION_PREPROCESSOR",0),SEe=new Cs("COMMENT_PREPROCESSOR",1),tS=new Cs("EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER",2),ele=new Cs("INTERACTIVE_EXTERNAL_PORT_POSITIONER",3),YEe=new Cs("PARTITION_PREPROCESSOR",4),uq=new Cs("LABEL_DUMMY_INSERTER",5),mq=new Cs("SELF_LOOP_PREPROCESSOR",6),eE=new Cs("LAYER_CONSTRAINT_PREPROCESSOR",7),WEe=new Cs("PARTITION_MIDPROCESSOR",8),FEe=new Cs("HIGH_DEGREE_NODE_LAYER_PROCESSOR",9),VEe=new Cs("NODE_PROMOTION",10),J7=new Cs("LAYER_CONSTRAINT_POSTPROCESSOR",11),KEe=new Cs("PARTITION_POSTPROCESSOR",12),PEe=new Cs("HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR",13),XEe=new Cs("SEMI_INTERACTIVE_CROSSMIN_PROCESSOR",14),kEe=new Cs("BREAKING_POINT_INSERTER",15),dq=new Cs("LONG_EDGE_SPLITTER",16),tle=new Cs("PORT_SIDE_PROCESSOR",17),oq=new Cs("INVERTED_PORT_PROCESSOR",18),bq=new Cs("PORT_LIST_SORTER",19),ZEe=new Cs("SORT_BY_INPUT_ORDER_OF_MODEL",20),pq=new Cs("NORTH_SOUTH_PORT_PREPROCESSOR",21),xEe=new Cs("BREAKING_POINT_PROCESSOR",22),UEe=new Cs(bft,23),JEe=new Cs(vft,24),vq=new Cs("SELF_LOOP_PORT_RESTORER",25),QEe=new Cs("SINGLE_EDGE_GRAPH_WRAPPER",26),cq=new Cs("IN_LAYER_CONSTRAINT_PROCESSOR",27),IEe=new Cs("END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR",28),GEe=new Cs("LABEL_AND_NODE_SIZE_PROCESSOR",29),zEe=new Cs("INNERMOST_NODE_MARGIN_CALCULATOR",30),yq=new Cs("SELF_LOOP_ROUTER",31),_Ee=new Cs("COMMENT_NODE_MARGIN_CALCULATOR",32),aq=new Cs("END_LABEL_PREPROCESSOR",33),hq=new Cs("LABEL_DUMMY_SWITCHER",34),TEe=new Cs("CENTER_LABEL_MANAGEMENT_PROCESSOR",35),Z7=new Cs("LABEL_SIDE_SELECTOR",36),$Ee=new Cs("HYPEREDGE_DUMMY_MERGER",37),BEe=new Cs("HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR",38),qEe=new Cs("LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR",39),nS=new Cs("HIERARCHICAL_PORT_POSITION_PROCESSOR",40),AEe=new Cs("CONSTRAINTS_POSTPROCESSOR",41),CEe=new Cs("COMMENT_POSTPROCESSOR",42),HEe=new Cs("HYPERNODE_PROCESSOR",43),REe=new Cs("HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER",44),fq=new Cs("LONG_EDGE_JOINER",45),wq=new Cs("SELF_LOOP_POSTPROCESSOR",46),EEe=new Cs("BREAKING_POINT_REMOVER",47),gq=new Cs("NORTH_SOUTH_PORT_POSTPROCESSOR",48),jEe=new Cs("HORIZONTAL_COMPACTOR",49),lq=new Cs("LABEL_DUMMY_REMOVER",50),OEe=new Cs("FINAL_SPLINE_BENDPOINTS_CALCULATOR",51),DEe=new Cs("END_LABEL_SORTER",52),pO=new Cs("REVERSED_EDGE_RESTORER",53),sq=new Cs("END_LABEL_POSTPROCESSOR",54),NEe=new Cs("HIERARCHICAL_NODE_RESIZER",55),LEe=new Cs("DIRECTION_POSTPROCESSOR",56)}function Xyn(e,t,n){var r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt,bt,zt,Ut,In,Rn,dr,ki,Ws,rh,af,ed,aU,pN,rA,bN,IE,Dfe,Q4t,Ife,Jg,Bw,OE,vN,wN,Vk,Ofe,iA,Z4t,gLe,Rw,sA,Nfe,Uk,aA,Qy,oA,Pfe,J4t;for(gLe=0,ki=t,af=0,pN=ki.length;af0&&(e.a[Jg.p]=gLe++)}for(aA=0,Ws=n,ed=0,rA=Ws.length;ed0;){for(Jg=(Qn(wN.b>0),u(wN.a.Xb(wN.c=--wN.b),11)),vN=0,d=new C(Jg.e);d.a0&&(Jg.j==(ht(),An)?(e.a[Jg.p]=aA,++aA):(e.a[Jg.p]=aA+bN+Dfe,++Dfe))}aA+=Dfe}for(OE=new Mr,q=new C0,dr=t,rh=0,aU=dr.length;rhx.b&&(x.b=Vk)):Jg.i.c==Z4t&&(Vkx.c&&(x.c=Vk));for(L8(W,0,W.length,null),Uk=Me(Lr,Jr,25,W.length,15,1),r=Me(Lr,Jr,25,aA+1,15,1),le=0;le0;)bt%2>0&&(s+=Pfe[bt+1]),bt=(bt-1)/2|0,++Pfe[bt];for(Ut=Me(_wt,yt,362,W.length*2,0,1),Ne=0;Ne'?":an(W1t,e)?"'(?<' or '(? toIndex: ",_6e=", toIndex: ",C6e="Index: ",S6e=", Size: ",M7="org.eclipse.elk.alg.common",ji={62:1},_ht="org.eclipse.elk.alg.common.compaction",Cht="Scanline/EventHandler",o0="org.eclipse.elk.alg.common.compaction.oned",Sht="CNode belongs to another CGroup.",Aht="ISpacingsHandler/1",doe="The ",goe=" instance has been finished already.",Lht="The direction ",Mht=" is not supported by the CGraph instance.",Dht="OneDimensionalCompactor",Iht="OneDimensionalCompactor/lambda$0$Type",Oht="Quadruplet",Nht="ScanlineConstraintCalculator",Pht="ScanlineConstraintCalculator/ConstraintsScanlineHandler",Bht="ScanlineConstraintCalculator/ConstraintsScanlineHandler/lambda$0$Type",Rht="ScanlineConstraintCalculator/Timestamp",Fht="ScanlineConstraintCalculator/lambda$0$Type",_d={169:1,45:1},poe="org.eclipse.elk.alg.common.compaction.options",cc="org.eclipse.elk.core.data",A6e="org.eclipse.elk.polyomino.traversalStrategy",L6e="org.eclipse.elk.polyomino.lowLevelSort",M6e="org.eclipse.elk.polyomino.highLevelSort",D6e="org.eclipse.elk.polyomino.fill",zh={130:1},boe="polyomino",xC="org.eclipse.elk.alg.common.networksimplex",c0={177:1,3:1,4:1},jht="org.eclipse.elk.alg.common.nodespacing",wb="org.eclipse.elk.alg.common.nodespacing.cellsystem",D7="CENTER",$ht={212:1,326:1},I6e={3:1,4:1,5:1,595:1},uk="LEFT",lk="RIGHT",O6e="Vertical alignment cannot be null",N6e="BOTTOM",Iz="org.eclipse.elk.alg.common.nodespacing.internal",EC="UNDEFINED",z1=.01,PI="org.eclipse.elk.alg.common.nodespacing.internal.algorithm",Hht="LabelPlacer/lambda$0$Type",zht="LabelPlacer/lambda$1$Type",Ght="portRatioOrPosition",I7="org.eclipse.elk.alg.common.overlaps",voe="DOWN",Cd="org.eclipse.elk.alg.common.polyomino",Oz="NORTH",woe="EAST",moe="SOUTH",yoe="WEST",Nz="org.eclipse.elk.alg.common.polyomino.structures",P6e="Direction",koe="Grid is only of size ",xoe=". Requested point (",Eoe=") is out of bounds.",Pz=" Given center based coordinates were (",BI="org.eclipse.elk.graph.properties",qht="IPropertyHolder",B6e={3:1,94:1,134:1},hk="org.eclipse.elk.alg.common.spore",Vht="org.eclipse.elk.alg.common.utils",mb={209:1},k4="org.eclipse.elk.core",Uht="Connected Components Compaction",Wht="org.eclipse.elk.alg.disco",Bz="org.eclipse.elk.alg.disco.graph",Toe="org.eclipse.elk.alg.disco.options",R6e="CompactionStrategy",F6e="org.eclipse.elk.disco.componentCompaction.strategy",j6e="org.eclipse.elk.disco.componentCompaction.componentLayoutAlgorithm",$6e="org.eclipse.elk.disco.debug.discoGraph",H6e="org.eclipse.elk.disco.debug.discoPolys",Kht="componentCompaction",yb="org.eclipse.elk.disco",_oe="org.eclipse.elk.spacing.componentComponent",Coe="org.eclipse.elk.edge.thickness",fk="org.eclipse.elk.aspectRatio",uw="org.eclipse.elk.padding",x4="org.eclipse.elk.alg.disco.transform",Soe=1.5707963267948966,O7=17976931348623157e292,gy={3:1,4:1,5:1,192:1},z6e={3:1,6:1,4:1,5:1,106:1,120:1},G6e="org.eclipse.elk.alg.force",q6e="ComponentsProcessor",Yht="ComponentsProcessor/1",RI="org.eclipse.elk.alg.force.graph",Xht="Component Layout",V6e="org.eclipse.elk.alg.force.model",Rz="org.eclipse.elk.force.model",U6e="org.eclipse.elk.force.iterations",W6e="org.eclipse.elk.force.repulsivePower",Aoe="org.eclipse.elk.force.temperature",Sd=.001,Loe="org.eclipse.elk.force.repulsion",TC="org.eclipse.elk.alg.force.options",N7=1.600000023841858,Yl="org.eclipse.elk.force",FI="org.eclipse.elk.priority",py="org.eclipse.elk.spacing.nodeNode",Moe="org.eclipse.elk.spacing.edgeLabel",Fz="org.eclipse.elk.randomSeed",_C="org.eclipse.elk.separateConnectedComponents",jI="org.eclipse.elk.interactive",Doe="org.eclipse.elk.portConstraints",jz="org.eclipse.elk.edgeLabels.inline",CC="org.eclipse.elk.omitNodeMicroLayout",dk="org.eclipse.elk.nodeSize.options",E4="org.eclipse.elk.nodeSize.constraints",P7="org.eclipse.elk.nodeLabels.placement",B7="org.eclipse.elk.portLabels.placement",K6e="origin",Qht="random",Zht="boundingBox.upLeft",Jht="boundingBox.lowRight",Y6e="org.eclipse.elk.stress.fixed",X6e="org.eclipse.elk.stress.desiredEdgeLength",Q6e="org.eclipse.elk.stress.dimension",Z6e="org.eclipse.elk.stress.epsilon",J6e="org.eclipse.elk.stress.iterationLimit",t2="org.eclipse.elk.stress",eft="ELK Stress",gk="org.eclipse.elk.nodeSize.minimum",$z="org.eclipse.elk.alg.force.stress",tft="Layered layout",pk="org.eclipse.elk.alg.layered",$I="org.eclipse.elk.alg.layered.compaction.components",SC="org.eclipse.elk.alg.layered.compaction.oned",Hz="org.eclipse.elk.alg.layered.compaction.oned.algs",kb="org.eclipse.elk.alg.layered.compaction.recthull",Ad="org.eclipse.elk.alg.layered.components",U0="NONE",Dc={3:1,6:1,4:1,9:1,5:1,122:1},nft={3:1,6:1,4:1,5:1,141:1,106:1,120:1},zz="org.eclipse.elk.alg.layered.compound",ps={51:1},uu="org.eclipse.elk.alg.layered.graph",Ioe=" -> ",rft="Not supported by LGraph",eke="Port side is undefined",Ooe={3:1,6:1,4:1,5:1,474:1,141:1,106:1,120:1},Bg={3:1,6:1,4:1,5:1,141:1,193:1,203:1,106:1,120:1},ift={3:1,6:1,4:1,5:1,141:1,1943:1,203:1,106:1,120:1},sft=`([{"' \r -`,aft=`)]}"' \r -`,oft="The given string contains parts that cannot be parsed as numbers.",HI="org.eclipse.elk.core.math",cft={3:1,4:1,142:1,207:1,414:1},uft={3:1,4:1,116:1,207:1,414:1},qn="org.eclipse.elk.layered",Rg="org.eclipse.elk.alg.layered.graph.transform",lft="ElkGraphImporter",hft="ElkGraphImporter/lambda$0$Type",fft="ElkGraphImporter/lambda$1$Type",dft="ElkGraphImporter/lambda$2$Type",gft="ElkGraphImporter/lambda$4$Type",pft="Node margin calculation",Pn="org.eclipse.elk.alg.layered.intermediate",bft="ONE_SIDED_GREEDY_SWITCH",vft="TWO_SIDED_GREEDY_SWITCH",Noe="No implementation is available for the layout processor ",tke="IntermediateProcessorStrategy",Poe="Node '",wft="FIRST_SEPARATE",mft="LAST_SEPARATE",yft="Odd port side processing",Is="org.eclipse.elk.alg.layered.intermediate.compaction",AC="org.eclipse.elk.alg.layered.intermediate.greedyswitch",u0="org.eclipse.elk.alg.layered.p3order.counting",zI={225:1},bk="org.eclipse.elk.alg.layered.intermediate.loops",Xl="org.eclipse.elk.alg.layered.intermediate.loops.ordering",n2="org.eclipse.elk.alg.layered.intermediate.loops.routing",LC="org.eclipse.elk.alg.layered.intermediate.preserveorder",Ld="org.eclipse.elk.alg.layered.intermediate.wrapping",Ic="org.eclipse.elk.alg.layered.options",Boe="INTERACTIVE",kft="DEPTH_FIRST",xft="EDGE_LENGTH",Eft="SELF_LOOPS",Tft="firstTryWithInitialOrder",nke="org.eclipse.elk.layered.directionCongruency",rke="org.eclipse.elk.layered.feedbackEdges",Gz="org.eclipse.elk.layered.interactiveReferencePoint",ike="org.eclipse.elk.layered.mergeEdges",ske="org.eclipse.elk.layered.mergeHierarchyEdges",ake="org.eclipse.elk.layered.allowNonFlowPortsToSwitchSides",oke="org.eclipse.elk.layered.portSortingStrategy",cke="org.eclipse.elk.layered.thoroughness",uke="org.eclipse.elk.layered.unnecessaryBendpoints",lke="org.eclipse.elk.layered.generatePositionAndLayerIds",Roe="org.eclipse.elk.layered.cycleBreaking.strategy",GI="org.eclipse.elk.layered.layering.strategy",hke="org.eclipse.elk.layered.layering.layerConstraint",fke="org.eclipse.elk.layered.layering.layerChoiceConstraint",dke="org.eclipse.elk.layered.layering.layerId",Foe="org.eclipse.elk.layered.layering.minWidth.upperBoundOnWidth",joe="org.eclipse.elk.layered.layering.minWidth.upperLayerEstimationScalingFactor",$oe="org.eclipse.elk.layered.layering.nodePromotion.strategy",Hoe="org.eclipse.elk.layered.layering.nodePromotion.maxIterations",zoe="org.eclipse.elk.layered.layering.coffmanGraham.layerBound",MC="org.eclipse.elk.layered.crossingMinimization.strategy",gke="org.eclipse.elk.layered.crossingMinimization.forceNodeModelOrder",Goe="org.eclipse.elk.layered.crossingMinimization.hierarchicalSweepiness",qoe="org.eclipse.elk.layered.crossingMinimization.semiInteractive",pke="org.eclipse.elk.layered.crossingMinimization.positionChoiceConstraint",bke="org.eclipse.elk.layered.crossingMinimization.positionId",vke="org.eclipse.elk.layered.crossingMinimization.greedySwitch.activationThreshold",Voe="org.eclipse.elk.layered.crossingMinimization.greedySwitch.type",qz="org.eclipse.elk.layered.crossingMinimization.greedySwitchHierarchical.type",T4="org.eclipse.elk.layered.nodePlacement.strategy",Vz="org.eclipse.elk.layered.nodePlacement.favorStraightEdges",Uoe="org.eclipse.elk.layered.nodePlacement.bk.edgeStraightening",Woe="org.eclipse.elk.layered.nodePlacement.bk.fixedAlignment",Koe="org.eclipse.elk.layered.nodePlacement.linearSegments.deflectionDampening",Yoe="org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility",Xoe="org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility.default",wke="org.eclipse.elk.layered.edgeRouting.selfLoopDistribution",mke="org.eclipse.elk.layered.edgeRouting.selfLoopOrdering",Uz="org.eclipse.elk.layered.edgeRouting.splines.mode",Wz="org.eclipse.elk.layered.edgeRouting.splines.sloppy.layerSpacingFactor",Qoe="org.eclipse.elk.layered.edgeRouting.polyline.slopedEdgeZoneWidth",yke="org.eclipse.elk.layered.spacing.baseValue",kke="org.eclipse.elk.layered.spacing.edgeNodeBetweenLayers",xke="org.eclipse.elk.layered.spacing.edgeEdgeBetweenLayers",Eke="org.eclipse.elk.layered.spacing.nodeNodeBetweenLayers",Tke="org.eclipse.elk.layered.priority.direction",_ke="org.eclipse.elk.layered.priority.shortness",Cke="org.eclipse.elk.layered.priority.straightness",Zoe="org.eclipse.elk.layered.compaction.connectedComponents",Ske="org.eclipse.elk.layered.compaction.postCompaction.strategy",Ake="org.eclipse.elk.layered.compaction.postCompaction.constraints",Kz="org.eclipse.elk.layered.highDegreeNodes.treatment",Joe="org.eclipse.elk.layered.highDegreeNodes.threshold",ece="org.eclipse.elk.layered.highDegreeNodes.treeHeight",W0="org.eclipse.elk.layered.wrapping.strategy",Yz="org.eclipse.elk.layered.wrapping.additionalEdgeSpacing",Xz="org.eclipse.elk.layered.wrapping.correctionFactor",DC="org.eclipse.elk.layered.wrapping.cutting.strategy",tce="org.eclipse.elk.layered.wrapping.cutting.cuts",nce="org.eclipse.elk.layered.wrapping.cutting.msd.freedom",Qz="org.eclipse.elk.layered.wrapping.validify.strategy",Zz="org.eclipse.elk.layered.wrapping.validify.forbiddenIndices",Jz="org.eclipse.elk.layered.wrapping.multiEdge.improveCuts",eG="org.eclipse.elk.layered.wrapping.multiEdge.distancePenalty",rce="org.eclipse.elk.layered.wrapping.multiEdge.improveWrappedEdges",Lke="org.eclipse.elk.layered.edgeLabels.sideSelection",Mke="org.eclipse.elk.layered.edgeLabels.centerLabelPlacementStrategy",tG="org.eclipse.elk.layered.considerModelOrder.strategy",Dke="org.eclipse.elk.layered.considerModelOrder.noModelOrder",ice="org.eclipse.elk.layered.considerModelOrder.components",Ike="org.eclipse.elk.layered.considerModelOrder.longEdgeStrategy",sce="org.eclipse.elk.layered.considerModelOrder.crossingCounterNodeInfluence",ace="org.eclipse.elk.layered.considerModelOrder.crossingCounterPortInfluence",oce="layering",_ft="layering.minWidth",Cft="layering.nodePromotion",qI="crossingMinimization",nG="org.eclipse.elk.hierarchyHandling",Sft="crossingMinimization.greedySwitch",Aft="nodePlacement",Lft="nodePlacement.bk",Mft="edgeRouting",VI="org.eclipse.elk.edgeRouting",G1="spacing",Oke="priority",Nke="compaction",Dft="compaction.postCompaction",Ift="Specifies whether and how post-process compaction is applied.",Pke="highDegreeNodes",Bke="wrapping",Oft="wrapping.cutting",Nft="wrapping.validify",Rke="wrapping.multiEdge",cce="edgeLabels",UI="considerModelOrder",Fke="org.eclipse.elk.spacing.commentComment",jke="org.eclipse.elk.spacing.commentNode",$ke="org.eclipse.elk.spacing.edgeEdge",Hke="org.eclipse.elk.spacing.edgeNode",zke="org.eclipse.elk.spacing.labelLabel",Gke="org.eclipse.elk.spacing.labelPortHorizontal",qke="org.eclipse.elk.spacing.labelPortVertical",Vke="org.eclipse.elk.spacing.labelNode",Uke="org.eclipse.elk.spacing.nodeSelfLoop",Wke="org.eclipse.elk.spacing.portPort",Kke="org.eclipse.elk.spacing.individual",Yke="org.eclipse.elk.port.borderOffset",Xke="org.eclipse.elk.noLayout",Qke="org.eclipse.elk.port.side",WI="org.eclipse.elk.debugMode",Zke="org.eclipse.elk.alignment",Jke="org.eclipse.elk.insideSelfLoops.activate",exe="org.eclipse.elk.insideSelfLoops.yo",uce="org.eclipse.elk.nodeSize.fixedGraphSize",txe="org.eclipse.elk.direction",nxe="org.eclipse.elk.nodeLabels.padding",rxe="org.eclipse.elk.portLabels.nextToPortIfPossible",ixe="org.eclipse.elk.portLabels.treatAsGroup",sxe="org.eclipse.elk.portAlignment.default",axe="org.eclipse.elk.portAlignment.north",oxe="org.eclipse.elk.portAlignment.south",cxe="org.eclipse.elk.portAlignment.west",uxe="org.eclipse.elk.portAlignment.east",rG="org.eclipse.elk.contentAlignment",lxe="org.eclipse.elk.junctionPoints",hxe="org.eclipse.elk.edgeLabels.placement",fxe="org.eclipse.elk.port.index",dxe="org.eclipse.elk.commentBox",gxe="org.eclipse.elk.hypernode",pxe="org.eclipse.elk.port.anchor",lce="org.eclipse.elk.partitioning.activate",hce="org.eclipse.elk.partitioning.partition",iG="org.eclipse.elk.position",bxe="org.eclipse.elk.margins",vxe="org.eclipse.elk.spacing.portsSurrounding",fce="org.eclipse.elk.interactiveLayout",Oc="org.eclipse.elk.core.util",wxe={3:1,4:1,5:1,593:1},Pft="NETWORK_SIMPLEX",Qc={123:1,51:1},sG="org.eclipse.elk.alg.layered.p1cycles",by="org.eclipse.elk.alg.layered.p2layers",mxe={402:1,225:1},Bft={832:1,3:1,4:1},Qu="org.eclipse.elk.alg.layered.p3order",ko="org.eclipse.elk.alg.layered.p4nodes",Rft={3:1,4:1,5:1,840:1},Md=1e-5,r2="org.eclipse.elk.alg.layered.p4nodes.bk",dce="org.eclipse.elk.alg.layered.p5edges",o1="org.eclipse.elk.alg.layered.p5edges.orthogonal",gce="org.eclipse.elk.alg.layered.p5edges.orthogonal.direction",pce=1e-6,vy="org.eclipse.elk.alg.layered.p5edges.splines",bce=.09999999999999998,aG=1e-8,Fft=4.71238898038469,jft=3.141592653589793,IC="org.eclipse.elk.alg.mrtree",OC="org.eclipse.elk.alg.mrtree.graph",vk="org.eclipse.elk.alg.mrtree.intermediate",$ft="Set neighbors in level",Hft="DESCENDANTS",yxe="org.eclipse.elk.mrtree.weighting",kxe="org.eclipse.elk.mrtree.searchOrder",oG="org.eclipse.elk.alg.mrtree.options",Fg="org.eclipse.elk.mrtree",zft="org.eclipse.elk.tree",xxe="org.eclipse.elk.alg.radial",_4=6.283185307179586,Exe=5e-324,Gft="org.eclipse.elk.alg.radial.intermediate",vce="org.eclipse.elk.alg.radial.intermediate.compaction",qft={3:1,4:1,5:1,106:1},Txe="org.eclipse.elk.alg.radial.intermediate.optimization",wce="No implementation is available for the layout option ",NC="org.eclipse.elk.alg.radial.options",_xe="org.eclipse.elk.radial.orderId",Cxe="org.eclipse.elk.radial.radius",mce="org.eclipse.elk.radial.compactor",yce="org.eclipse.elk.radial.compactionStepSize",Sxe="org.eclipse.elk.radial.sorter",Axe="org.eclipse.elk.radial.wedgeCriteria",Lxe="org.eclipse.elk.radial.optimizationCriteria",Dd="org.eclipse.elk.radial",Vft="org.eclipse.elk.alg.radial.p1position.wedge",Mxe="org.eclipse.elk.alg.radial.sorting",Uft=5.497787143782138,Wft=3.9269908169872414,Kft=2.356194490192345,Yft="org.eclipse.elk.alg.rectpacking",cG="org.eclipse.elk.alg.rectpacking.firstiteration",kce="org.eclipse.elk.alg.rectpacking.options",Dxe="org.eclipse.elk.rectpacking.optimizationGoal",Ixe="org.eclipse.elk.rectpacking.lastPlaceShift",Oxe="org.eclipse.elk.rectpacking.currentPosition",Nxe="org.eclipse.elk.rectpacking.desiredPosition",Pxe="org.eclipse.elk.rectpacking.onlyFirstIteration",Bxe="org.eclipse.elk.rectpacking.rowCompaction",xce="org.eclipse.elk.rectpacking.expandToAspectRatio",Rxe="org.eclipse.elk.rectpacking.targetWidth",uG="org.eclipse.elk.expandNodes",Gh="org.eclipse.elk.rectpacking",KI="org.eclipse.elk.alg.rectpacking.util",lG="No implementation available for ",wy="org.eclipse.elk.alg.spore",my="org.eclipse.elk.alg.spore.options",lw="org.eclipse.elk.sporeCompaction",Ece="org.eclipse.elk.underlyingLayoutAlgorithm",Fxe="org.eclipse.elk.processingOrder.treeConstruction",jxe="org.eclipse.elk.processingOrder.spanningTreeCostFunction",Tce="org.eclipse.elk.processingOrder.preferredRoot",_ce="org.eclipse.elk.processingOrder.rootSelection",Cce="org.eclipse.elk.structure.structureExtractionStrategy",$xe="org.eclipse.elk.compaction.compactionStrategy",Hxe="org.eclipse.elk.compaction.orthogonal",zxe="org.eclipse.elk.overlapRemoval.maxIterations",Gxe="org.eclipse.elk.overlapRemoval.runScanline",Sce="processingOrder",Xft="overlapRemoval",R7="org.eclipse.elk.sporeOverlap",Qft="org.eclipse.elk.alg.spore.p1structure",Ace="org.eclipse.elk.alg.spore.p2processingorder",Lce="org.eclipse.elk.alg.spore.p3execution",Zft="Invalid index: ",F7="org.eclipse.elk.core.alg",C4={331:1},yy={288:1},Jft="Make sure its type is registered with the ",qxe=" utility class.",j7="true",Mce="false",e1t="Couldn't clone property '",hw=.05,qh="org.eclipse.elk.core.options",t1t=1.2999999523162842,fw="org.eclipse.elk.box",Vxe="org.eclipse.elk.box.packingMode",n1t="org.eclipse.elk.algorithm",r1t="org.eclipse.elk.resolvedAlgorithm",Uxe="org.eclipse.elk.bendPoints",t3n="org.eclipse.elk.labelManager",i1t="org.eclipse.elk.scaleFactor",s1t="org.eclipse.elk.animate",a1t="org.eclipse.elk.animTimeFactor",o1t="org.eclipse.elk.layoutAncestors",c1t="org.eclipse.elk.maxAnimTime",u1t="org.eclipse.elk.minAnimTime",l1t="org.eclipse.elk.progressBar",h1t="org.eclipse.elk.validateGraph",f1t="org.eclipse.elk.validateOptions",d1t="org.eclipse.elk.zoomToFit",n3n="org.eclipse.elk.font.name",g1t="org.eclipse.elk.font.size",p1t="org.eclipse.elk.edge.type",b1t="partitioning",v1t="nodeLabels",hG="portAlignment",Dce="nodeSize",Ice="port",Wxe="portLabels",w1t="insideSelfLoops",PC="org.eclipse.elk.fixed",fG="org.eclipse.elk.random",m1t="port must have a parent node to calculate the port side",y1t="The edge needs to have exactly one edge section. Found: ",BC="org.eclipse.elk.core.util.adapters",kh="org.eclipse.emf.ecore",S4="org.eclipse.elk.graph",k1t="EMapPropertyHolder",x1t="ElkBendPoint",E1t="ElkGraphElement",T1t="ElkConnectableShape",Kxe="ElkEdge",_1t="ElkEdgeSection",C1t="EModelElement",S1t="ENamedElement",Yxe="ElkLabel",Xxe="ElkNode",Qxe="ElkPort",A1t={92:1,90:1},wk="org.eclipse.emf.common.notify.impl",i2="The feature '",RC="' is not a valid changeable feature",L1t="Expecting null",Oce="' is not a valid feature",M1t="The feature ID",D1t=" is not a valid feature ID",_c=32768,I1t={105:1,92:1,90:1,56:1,49:1,97:1},Tn="org.eclipse.emf.ecore.impl",xb="org.eclipse.elk.graph.impl",FC="Recursive containment not allowed for ",$7="The datatype '",dw="' is not a valid classifier",Nce="The value '",A4={190:1,3:1,4:1},Pce="The class '",H7="http://www.eclipse.org/elk/ElkGraph",Sf=1024,Zxe="property",jC="value",Bce="source",O1t="properties",N1t="identifier",Rce="height",Fce="width",jce="parent",$ce="text",Hce="children",P1t="hierarchical",Jxe="sources",zce="targets",e8e="sections",dG="bendPoints",t8e="outgoingShape",n8e="incomingShape",r8e="outgoingSections",i8e="incomingSections",Qa="org.eclipse.emf.common.util",s8e="Severe implementation error in the Json to ElkGraph importer.",Id="id",Ia="org.eclipse.elk.graph.json",a8e="Unhandled parameter types: ",B1t="startPoint",R1t="An edge must have at least one source and one target (edge id: '",z7="').",F1t="Referenced edge section does not exist: ",j1t=" (edge id: '",o8e="target",$1t="sourcePoint",H1t="targetPoint",gG="group",gi="name",z1t="connectableShape cannot be null",G1t="edge cannot be null",Gce="Passed edge is not 'simple'.",pG="org.eclipse.elk.graph.util",YI="The 'no duplicates' constraint is violated",qce="targetIndex=",Eb=", size=",Vce="sourceIndex=",Od={3:1,4:1,20:1,28:1,52:1,14:1,15:1,54:1,67:1,63:1,58:1},Uce={3:1,4:1,20:1,28:1,52:1,14:1,47:1,15:1,54:1,67:1,63:1,58:1,588:1},bG="logging",q1t="measureExecutionTime",V1t="parser.parse.1",U1t="parser.parse.2",vG="parser.next.1",Wce="parser.next.2",W1t="parser.next.3",K1t="parser.next.4",Tb="parser.factor.1",c8e="parser.factor.2",Y1t="parser.factor.3",X1t="parser.factor.4",Q1t="parser.factor.5",Z1t="parser.factor.6",J1t="parser.atom.1",edt="parser.atom.2",tdt="parser.atom.3",u8e="parser.atom.4",Kce="parser.atom.5",l8e="parser.cc.1",wG="parser.cc.2",ndt="parser.cc.3",rdt="parser.cc.5",h8e="parser.cc.6",f8e="parser.cc.7",Yce="parser.cc.8",idt="parser.ope.1",sdt="parser.ope.2",adt="parser.ope.3",jg="parser.descape.1",odt="parser.descape.2",cdt="parser.descape.3",udt="parser.descape.4",ldt="parser.descape.5",xh="parser.process.1",hdt="parser.quantifier.1",fdt="parser.quantifier.2",ddt="parser.quantifier.3",gdt="parser.quantifier.4",d8e="parser.quantifier.5",pdt="org.eclipse.emf.common.notify",g8e={415:1,672:1},bdt={3:1,4:1,20:1,28:1,52:1,14:1,15:1,67:1,58:1},XI={366:1,143:1},$C="index=",Xce={3:1,4:1,5:1,126:1},vdt={3:1,4:1,20:1,28:1,52:1,14:1,15:1,54:1,67:1,58:1},p8e={3:1,6:1,4:1,5:1,192:1},wdt={3:1,4:1,5:1,165:1,367:1},mdt=";/?:@&=+$,",ydt="invalid authority: ",kdt="EAnnotation",xdt="ETypedElement",Edt="EStructuralFeature",Tdt="EAttribute",_dt="EClassifier",Cdt="EEnumLiteral",Sdt="EGenericType",Adt="EOperation",Ldt="EParameter",Mdt="EReference",Ddt="ETypeParameter",Wi="org.eclipse.emf.ecore.util",Qce={76:1},b8e={3:1,20:1,14:1,15:1,58:1,589:1,76:1,69:1,95:1},Idt="org.eclipse.emf.ecore.util.FeatureMap$Entry",Zu=8192,ky=2048,HC="byte",mG="char",zC="double",GC="float",qC="int",VC="long",UC="short",Odt="java.lang.Object",L4={3:1,4:1,5:1,247:1},v8e={3:1,4:1,5:1,673:1},Ndt={3:1,4:1,20:1,28:1,52:1,14:1,15:1,54:1,67:1,63:1,58:1,69:1},Zo={3:1,4:1,20:1,28:1,52:1,14:1,15:1,54:1,67:1,63:1,58:1,76:1,69:1,95:1},QI="mixed",Zr="http:///org/eclipse/emf/ecore/util/ExtendedMetaData",Vh="kind",Pdt={3:1,4:1,5:1,674:1},w8e={3:1,4:1,20:1,28:1,52:1,14:1,15:1,67:1,58:1,76:1,69:1,95:1},yG={20:1,28:1,52:1,14:1,15:1,58:1,69:1},kG={47:1,125:1,279:1},xG={72:1,332:1},EG="The value of type '",TG="' must be of type '",M4=1316,Uh="http://www.eclipse.org/emf/2002/Ecore",_G=-32768,gw="constraints",Ha="baseType",Bdt="getEStructuralFeature",Rdt="getFeatureID",WC="feature",Fdt="getOperationID",m8e="operation",jdt="defaultValue",$dt="eTypeParameters",Hdt="isInstance",zdt="getEEnumLiteral",Gdt="eContainingClass",li={55:1},qdt={3:1,4:1,5:1,119:1},Vdt="org.eclipse.emf.ecore.resource",Udt={92:1,90:1,591:1,1935:1},Zce="org.eclipse.emf.ecore.resource.impl",y8e="unspecified",ZI="simple",CG="attribute",Wdt="attributeWildcard",SG="element",Jce="elementWildcard",c1="collapse",eue="itemType",AG="namespace",JI="##targetNamespace",Wh="whiteSpace",k8e="wildcards",_b="http://www.eclipse.org/emf/2003/XMLType",tue="##any",G7="uninitialized",eO="The multiplicity constraint is violated",LG="org.eclipse.emf.ecore.xml.type",Kdt="ProcessingInstruction",Ydt="SimpleAnyType",Xdt="XMLTypeDocumentRoot",As="org.eclipse.emf.ecore.xml.type.impl",tO="INF",Qdt="processing",Zdt="ENTITIES_._base",x8e="minLength",E8e="ENTITY",MG="NCName",Jdt="IDREFS_._base",T8e="integer",nue="token",rue="pattern",e0t="[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*",_8e="\\i\\c*",t0t="[\\i-[:]][\\c-[:]]*",n0t="nonPositiveInteger",nO="maxInclusive",C8e="NMTOKEN",r0t="NMTOKENS_._base",S8e="nonNegativeInteger",rO="minInclusive",i0t="normalizedString",s0t="unsignedByte",a0t="unsignedInt",o0t="18446744073709551615",c0t="unsignedShort",u0t="processingInstruction",$g="org.eclipse.emf.ecore.xml.type.internal",q7=1114111,l0t="Internal Error: shorthands: \\u",KC="xml:isDigit",iue="xml:isWord",sue="xml:isSpace",aue="xml:isNameChar",oue="xml:isInitialNameChar",h0t="09٠٩۰۹०९০৯੦੯૦૯୦୯௧௯౦౯೦೯൦൯๐๙໐໙༠༩",f0t="AZazÀÖØöøıĴľŁňŊžƀǃǍǰǴǵǺȗɐʨʻˁΆΆΈΊΌΌΎΡΣώϐϖϚϚϜϜϞϞϠϠϢϳЁЌЎяёќўҁҐӄӇӈӋӌӐӫӮӵӸӹԱՖՙՙաֆאתװײءغفيٱڷںھۀێېۓەەۥۦअहऽऽक़ॡঅঌএঐওনপরললশহড়ঢ়য়ৡৰৱਅਊਏਐਓਨਪਰਲਲ਼ਵਸ਼ਸਹਖ਼ੜਫ਼ਫ਼ੲੴઅઋઍઍએઑઓનપરલળવહઽઽૠૠଅଌଏଐଓନପରଲଳଶହଽଽଡ଼ଢ଼ୟୡஅஊஎஐஒகஙசஜஜஞடணதநபமவஷஹఅఌఎఐఒనపళవహౠౡಅಌಎಐಒನಪಳವಹೞೞೠೡഅഌഎഐഒനപഹൠൡกฮะะาำเๅກຂຄຄງຈຊຊຍຍດທນຟມຣລລວວສຫອຮະະາຳຽຽເໄཀཇཉཀྵႠჅაჶᄀᄀᄂᄃᄅᄇᄉᄉᄋᄌᄎᄒᄼᄼᄾᄾᅀᅀᅌᅌᅎᅎᅐᅐᅔᅕᅙᅙᅟᅡᅣᅣᅥᅥᅧᅧᅩᅩᅭᅮᅲᅳᅵᅵᆞᆞᆨᆨᆫᆫᆮᆯᆷᆸᆺᆺᆼᇂᇫᇫᇰᇰᇹᇹḀẛẠỹἀἕἘἝἠὅὈὍὐὗὙὙὛὛὝὝὟώᾀᾴᾶᾼιιῂῄῆῌῐΐῖΊῠῬῲῴῶῼΩΩKÅ℮℮ↀↂ〇〇〡〩ぁゔァヺㄅㄬ一龥가힣",d0t="Private Use",cue="ASSIGNED",uue="\0€ÿĀſƀɏɐʯʰ˿̀ͯͰϿЀӿ԰֏֐׿؀ۿ܀ݏހ޿ऀॿঀ৿਀੿઀૿଀୿஀௿ఀ౿ಀ೿ഀൿ඀෿฀๿຀໿ༀ࿿က႟Ⴀჿᄀᇿሀ፿Ꭰ᏿᐀ᙿ ᚟ᚠ᛿ក៿᠀᢯Ḁỿἀ῿ ⁰₟₠⃏⃐⃿℀⅏⅐↏←⇿∀⋿⌀⏿␀␿⑀⑟①⓿─╿▀▟■◿☀⛿✀➿⠀⣿⺀⻿⼀⿟⿰⿿ 〿぀ゟ゠ヿ㄀ㄯ㄰㆏㆐㆟ㆠㆿ㈀㋿㌀㏿㐀䶵一鿿ꀀ꒏꒐꓏가힣豈﫿ffﭏﭐ﷿︠︯︰﹏﹐﹯ﹰ﻾\uFEFF\uFEFF＀￯",A8e="UNASSIGNED",V7={3:1,117:1},g0t="org.eclipse.emf.ecore.xml.type.util",DG={3:1,4:1,5:1,368:1},L8e="org.eclipse.xtext.xbase.lib",p0t="Cannot add elements to a Range",b0t="Cannot set elements in a Range",v0t="Cannot remove elements from a Range",IG="locale",OG="default",NG="user.agent",l,PG,lue;b.goog=b.goog||{},b.goog.global=b.goog.global||b,Afn(),M(1,null,{},S),l.Fb=function(t){return lVe(this,t)},l.Gb=function(){return this.gm},l.Hb=function(){return xv(this)},l.Ib=function(){var t;return Cp(pl(this))+"@"+(t=Xi(this)>>>0,t.toString(16))},l.equals=function(e){return this.Fb(e)},l.hashCode=function(){return this.Hb()},l.toString=function(){return this.Ib()};var w0t,m0t,y0t;M(290,1,{290:1,2026:1},aye),l.le=function(t){var n;return n=new aye,n.i=4,t>1?n.c=SXe(this,t-1):n.c=this,n},l.me=function(){return S0(this),this.b},l.ne=function(){return Cp(this)},l.oe=function(){return S0(this),this.k},l.pe=function(){return(this.i&4)!=0},l.qe=function(){return(this.i&1)!=0},l.Ib=function(){return kme(this)},l.i=0;var Yn=O(oc,"Object",1),M8e=O(oc,"Class",290);M(1998,1,_I),O(CI,"Optional",1998),M(1170,1998,_I,N),l.Fb=function(t){return t===this},l.Hb=function(){return 2040732332},l.Ib=function(){return"Optional.absent()"},l.Jb=function(t){return Nr(t),kT(),hue};var hue;O(CI,"Absent",1170),M(628,1,{},ste),O(CI,"Joiner",628);var r3n=ss(CI,"Predicate");M(582,1,{169:1,582:1,3:1,45:1},aT),l.Mb=function(t){return pnt(this,t)},l.Lb=function(t){return pnt(this,t)},l.Fb=function(t){var n;return we(t,582)?(n=u(t,582),J4e(this.a,n.a)):!1},l.Hb=function(){return hye(this.a)+306654252},l.Ib=function(){return g1n(this.a)},O(CI,"Predicates/AndPredicate",582),M(408,1998,{408:1,3:1},Bx),l.Fb=function(t){var n;return we(t,408)?(n=u(t,408),Ci(this.a,n.a)):!1},l.Hb=function(){return 1502476572+Xi(this.a)},l.Ib=function(){return tht+this.a+")"},l.Jb=function(t){return new Bx(Zj(t.Kb(this.a),"the Function passed to Optional.transform() must not return null."))},O(CI,"Present",408),M(198,1,T7),l.Nb=function(t){La(this,t)},l.Qb=function(){eze()},O(qt,"UnmodifiableIterator",198),M(1978,198,_7),l.Qb=function(){eze()},l.Rb=function(t){throw J(new Fr)},l.Wb=function(t){throw J(new Fr)},O(qt,"UnmodifiableListIterator",1978),M(386,1978,_7),l.Ob=function(){return this.c0},l.Pb=function(){if(this.c>=this.d)throw J(new xc);return this.Xb(this.c++)},l.Tb=function(){return this.c},l.Ub=function(){if(this.c<=0)throw J(new xc);return this.Xb(--this.c)},l.Vb=function(){return this.c-1},l.c=0,l.d=0,O(qt,"AbstractIndexedListIterator",386),M(699,198,T7),l.Ob=function(){return nie(this)},l.Pb=function(){return pme(this)},l.e=1,O(qt,"AbstractIterator",699),M(1986,1,{224:1}),l.Zb=function(){var t;return t=this.f,t||(this.f=this.ac())},l.Fb=function(t){return yie(this,t)},l.Hb=function(){return Xi(this.Zb())},l.dc=function(){return this.gc()==0},l.ec=function(){return D6(this)},l.Ib=function(){return Qo(this.Zb())},O(qt,"AbstractMultimap",1986),M(726,1986,bb),l.$b=function(){U$(this)},l._b=function(t){return mze(this,t)},l.ac=function(){return new Jx(this,this.c)},l.ic=function(t){return this.hc()},l.bc=function(){return new H3(this,this.c)},l.jc=function(){return this.mc(this.hc())},l.kc=function(){return new RHe(this)},l.lc=function(){return Sse(this.c.vc().Nc(),new R,64,this.d)},l.cc=function(t){return Ii(this,t)},l.fc=function(t){return jD(this,t)},l.gc=function(){return this.d},l.mc=function(t){return hn(),new T(t)},l.nc=function(){return new BHe(this)},l.oc=function(){return Sse(this.c.Cc().Nc(),new B,64,this.d)},l.pc=function(t,n){return new C$(this,t,n,null)},l.d=0,O(qt,"AbstractMapBasedMultimap",726),M(1631,726,bb),l.hc=function(){return new su(this.a)},l.jc=function(){return hn(),hn(),bo},l.cc=function(t){return u(Ii(this,t),15)},l.fc=function(t){return u(jD(this,t),15)},l.Zb=function(){return B6(this)},l.Fb=function(t){return yie(this,t)},l.qc=function(t){return u(Ii(this,t),15)},l.rc=function(t){return u(jD(this,t),15)},l.mc=function(t){return ZM(u(t,15))},l.pc=function(t,n){return IQe(this,t,u(n,15),null)},O(qt,"AbstractListMultimap",1631),M(732,1,ga),l.Nb=function(t){La(this,t)},l.Ob=function(){return this.c.Ob()||this.e.Ob()},l.Pb=function(){var t;return this.e.Ob()||(t=u(this.c.Pb(),42),this.b=t.cd(),this.a=u(t.dd(),14),this.e=this.a.Kc()),this.sc(this.b,this.e.Pb())},l.Qb=function(){this.e.Qb(),this.a.dc()&&this.c.Qb(),--this.d.d},O(qt,"AbstractMapBasedMultimap/Itr",732),M(1099,732,ga,BHe),l.sc=function(t,n){return n},O(qt,"AbstractMapBasedMultimap/1",1099),M(1100,1,{},B),l.Kb=function(t){return u(t,14).Nc()},O(qt,"AbstractMapBasedMultimap/1methodref$spliterator$Type",1100),M(1101,732,ga,RHe),l.sc=function(t,n){return new vv(t,n)},O(qt,"AbstractMapBasedMultimap/2",1101);var D8e=ss(wr,"Map");M(1967,1,ow),l.wc=function(t){B_(this,t)},l.yc=function(t,n,r){return Rie(this,t,n,r)},l.$b=function(){this.vc().$b()},l.tc=function(t){return lse(this,t)},l._b=function(t){return!!n4e(this,t,!1)},l.uc=function(t){var n,r,s;for(r=this.vc().Kc();r.Ob();)if(n=u(r.Pb(),42),s=n.dd(),je(t)===je(s)||t!=null&&Ci(t,s))return!0;return!1},l.Fb=function(t){var n,r,s;if(t===this)return!0;if(!we(t,83)||(s=u(t,83),this.gc()!=s.gc()))return!1;for(r=s.vc().Kc();r.Ob();)if(n=u(r.Pb(),42),!this.tc(n))return!1;return!0},l.xc=function(t){return hc(n4e(this,t,!1))},l.Hb=function(){return tye(this.vc())},l.dc=function(){return this.gc()==0},l.ec=function(){return new vm(this)},l.zc=function(t,n){throw J(new pg("Put not supported on this map"))},l.Ac=function(t){P_(this,t)},l.Bc=function(t){return hc(n4e(this,t,!0))},l.gc=function(){return this.vc().gc()},l.Ib=function(){return vst(this)},l.Cc=function(){return new E1(this)},O(wr,"AbstractMap",1967),M(1987,1967,ow),l.bc=function(){return new mF(this)},l.vc=function(){return DKe(this)},l.ec=function(){var t;return t=this.g,t||(this.g=this.bc())},l.Cc=function(){var t;return t=this.i,t||(this.i=new hGe(this))},O(qt,"Maps/ViewCachingAbstractMap",1987),M(389,1987,ow,Jx),l.xc=function(t){return Xrn(this,t)},l.Bc=function(t){return fan(this,t)},l.$b=function(){this.d==this.e.c?this.e.$b():Aj(new Eve(this))},l._b=function(t){return Knt(this.d,t)},l.Ec=function(){return new Rx(this)},l.Dc=function(){return this.Ec()},l.Fb=function(t){return this===t||Ci(this.d,t)},l.Hb=function(){return Xi(this.d)},l.ec=function(){return this.e.ec()},l.gc=function(){return this.d.gc()},l.Ib=function(){return Qo(this.d)},O(qt,"AbstractMapBasedMultimap/AsMap",389);var q1=ss(oc,"Iterable");M(28,1,hy),l.Jc=function(t){Da(this,t)},l.Lc=function(){return this.Oc()},l.Nc=function(){return new mn(this,0)},l.Oc=function(){return new vn(null,this.Nc())},l.Fc=function(t){throw J(new pg("Add not supported on this collection"))},l.Gc=function(t){return no(this,t)},l.$b=function(){cwe(this)},l.Hc=function(t){return Xm(this,t,!1)},l.Ic=function(t){return MD(this,t)},l.dc=function(){return this.gc()==0},l.Mc=function(t){return Xm(this,t,!0)},l.Pc=function(){return Bve(this)},l.Qc=function(t){return YD(this,t)},l.Ib=function(){return Yp(this)},O(wr,"AbstractCollection",28);var Kh=ss(wr,"Set");M(H1,28,Xu),l.Nc=function(){return new mn(this,1)},l.Fb=function(t){return Hrt(this,t)},l.Hb=function(){return tye(this)},O(wr,"AbstractSet",H1),M(1970,H1,Xu),O(qt,"Sets/ImprovedAbstractSet",1970),M(1971,1970,Xu),l.$b=function(){this.Rc().$b()},l.Hc=function(t){return xrt(this,t)},l.dc=function(){return this.Rc().dc()},l.Mc=function(t){var n;return this.Hc(t)?(n=u(t,42),this.Rc().ec().Mc(n.cd())):!1},l.gc=function(){return this.Rc().gc()},O(qt,"Maps/EntrySet",1971),M(1097,1971,Xu,Rx),l.Hc=function(t){return Mye(this.a.d.vc(),t)},l.Kc=function(){return new Eve(this.a)},l.Rc=function(){return this.a},l.Mc=function(t){var n;return Mye(this.a.d.vc(),t)?(n=u(t,42),Bnn(this.a.e,n.cd()),!0):!1},l.Nc=function(){return qM(this.a.d.vc().Nc(),new $R(this.a))},O(qt,"AbstractMapBasedMultimap/AsMap/AsMapEntries",1097),M(1098,1,{},$R),l.Kb=function(t){return kZe(this.a,u(t,42))},O(qt,"AbstractMapBasedMultimap/AsMap/AsMapEntries/0methodref$wrapEntry$Type",1098),M(730,1,ga,Eve),l.Nb=function(t){La(this,t)},l.Pb=function(){var t;return t=u(this.b.Pb(),42),this.a=u(t.dd(),14),kZe(this.c,t)},l.Ob=function(){return this.b.Ob()},l.Qb=function(){X3(!!this.a),this.b.Qb(),this.c.e.d-=this.a.gc(),this.a.$b(),this.a=null},O(qt,"AbstractMapBasedMultimap/AsMap/AsMapIterator",730),M(532,1970,Xu,mF),l.$b=function(){this.b.$b()},l.Hc=function(t){return this.b._b(t)},l.Jc=function(t){Nr(t),this.b.wc(new dee(t))},l.dc=function(){return this.b.dc()},l.Kc=function(){return new xT(this.b.vc().Kc())},l.Mc=function(t){return this.b._b(t)?(this.b.Bc(t),!0):!1},l.gc=function(){return this.b.gc()},O(qt,"Maps/KeySet",532),M(318,532,Xu,H3),l.$b=function(){var t;Aj((t=this.b.vc().Kc(),new Ype(this,t)))},l.Ic=function(t){return this.b.ec().Ic(t)},l.Fb=function(t){return this===t||Ci(this.b.ec(),t)},l.Hb=function(){return Xi(this.b.ec())},l.Kc=function(){var t;return t=this.b.vc().Kc(),new Ype(this,t)},l.Mc=function(t){var n,r;return r=0,n=u(this.b.Bc(t),14),n&&(r=n.gc(),n.$b(),this.a.d-=r),r>0},l.Nc=function(){return this.b.ec().Nc()},O(qt,"AbstractMapBasedMultimap/KeySet",318),M(731,1,ga,Ype),l.Nb=function(t){La(this,t)},l.Ob=function(){return this.c.Ob()},l.Pb=function(){return this.a=u(this.c.Pb(),42),this.a.cd()},l.Qb=function(){var t;X3(!!this.a),t=u(this.a.dd(),14),this.c.Qb(),this.b.a.d-=t.gc(),t.$b(),this.a=null},O(qt,"AbstractMapBasedMultimap/KeySet/1",731),M(491,389,{83:1,161:1},RM),l.bc=function(){return this.Sc()},l.ec=function(){return this.Tc()},l.Sc=function(){return new dM(this.c,this.Uc())},l.Tc=function(){var t;return t=this.b,t||(this.b=this.Sc())},l.Uc=function(){return u(this.d,161)},O(qt,"AbstractMapBasedMultimap/SortedAsMap",491),M(542,491,nht,pj),l.bc=function(){return new Zx(this.a,u(u(this.d,161),171))},l.Sc=function(){return new Zx(this.a,u(u(this.d,161),171))},l.ec=function(){var t;return t=this.b,u(t||(this.b=new Zx(this.a,u(u(this.d,161),171))),271)},l.Tc=function(){var t;return t=this.b,u(t||(this.b=new Zx(this.a,u(u(this.d,161),171))),271)},l.Uc=function(){return u(u(this.d,161),171)},O(qt,"AbstractMapBasedMultimap/NavigableAsMap",542),M(490,318,rht,dM),l.Nc=function(){return this.b.ec().Nc()},O(qt,"AbstractMapBasedMultimap/SortedKeySet",490),M(388,490,g6e,Zx),O(qt,"AbstractMapBasedMultimap/NavigableKeySet",388),M(541,28,hy,C$),l.Fc=function(t){var n,r;return bl(this),r=this.d.dc(),n=this.d.Fc(t),n&&(++this.f.d,r&&HM(this)),n},l.Gc=function(t){var n,r,s;return t.dc()?!1:(s=(bl(this),this.d.gc()),n=this.d.Gc(t),n&&(r=this.d.gc(),this.f.d+=r-s,s==0&&HM(this)),n)},l.$b=function(){var t;t=(bl(this),this.d.gc()),t!=0&&(this.d.$b(),this.f.d-=t,Oj(this))},l.Hc=function(t){return bl(this),this.d.Hc(t)},l.Ic=function(t){return bl(this),this.d.Ic(t)},l.Fb=function(t){return t===this?!0:(bl(this),Ci(this.d,t))},l.Hb=function(){return bl(this),Xi(this.d)},l.Kc=function(){return bl(this),new uve(this)},l.Mc=function(t){var n;return bl(this),n=this.d.Mc(t),n&&(--this.f.d,Oj(this)),n},l.gc=function(){return Yqe(this)},l.Nc=function(){return bl(this),this.d.Nc()},l.Ib=function(){return bl(this),Qo(this.d)},O(qt,"AbstractMapBasedMultimap/WrappedCollection",541);var Eh=ss(wr,"List");M(728,541,{20:1,28:1,14:1,15:1},Fve),l.ad=function(t){Y3(this,t)},l.Nc=function(){return bl(this),this.d.Nc()},l.Vc=function(t,n){var r;bl(this),r=this.d.dc(),u(this.d,15).Vc(t,n),++this.a.d,r&&HM(this)},l.Wc=function(t,n){var r,s,o;return n.dc()?!1:(o=(bl(this),this.d.gc()),r=u(this.d,15).Wc(t,n),r&&(s=this.d.gc(),this.a.d+=s-o,o==0&&HM(this)),r)},l.Xb=function(t){return bl(this),u(this.d,15).Xb(t)},l.Xc=function(t){return bl(this),u(this.d,15).Xc(t)},l.Yc=function(){return bl(this),new AVe(this)},l.Zc=function(t){return bl(this),new HYe(this,t)},l.$c=function(t){var n;return bl(this),n=u(this.d,15).$c(t),--this.a.d,Oj(this),n},l._c=function(t,n){return bl(this),u(this.d,15)._c(t,n)},l.bd=function(t,n){return bl(this),IQe(this.a,this.e,u(this.d,15).bd(t,n),this.b?this.b:this)},O(qt,"AbstractMapBasedMultimap/WrappedList",728),M(1096,728,{20:1,28:1,14:1,15:1,54:1},wUe),O(qt,"AbstractMapBasedMultimap/RandomAccessWrappedList",1096),M(620,1,ga,uve),l.Nb=function(t){La(this,t)},l.Ob=function(){return y8(this),this.b.Ob()},l.Pb=function(){return y8(this),this.b.Pb()},l.Qb=function(){tUe(this)},O(qt,"AbstractMapBasedMultimap/WrappedCollection/WrappedIterator",620),M(729,620,r0,AVe,HYe),l.Qb=function(){tUe(this)},l.Rb=function(t){var n;n=Yqe(this.a)==0,(y8(this),u(this.b,125)).Rb(t),++this.a.a.d,n&&HM(this.a)},l.Sb=function(){return(y8(this),u(this.b,125)).Sb()},l.Tb=function(){return(y8(this),u(this.b,125)).Tb()},l.Ub=function(){return(y8(this),u(this.b,125)).Ub()},l.Vb=function(){return(y8(this),u(this.b,125)).Vb()},l.Wb=function(t){(y8(this),u(this.b,125)).Wb(t)},O(qt,"AbstractMapBasedMultimap/WrappedList/WrappedListIterator",729),M(727,541,rht,Mbe),l.Nc=function(){return bl(this),this.d.Nc()},O(qt,"AbstractMapBasedMultimap/WrappedSortedSet",727),M(1095,727,g6e,yVe),O(qt,"AbstractMapBasedMultimap/WrappedNavigableSet",1095),M(1094,541,Xu,IUe),l.Nc=function(){return bl(this),this.d.Nc()},O(qt,"AbstractMapBasedMultimap/WrappedSet",1094),M(1103,1,{},R),l.Kb=function(t){return znn(u(t,42))},O(qt,"AbstractMapBasedMultimap/lambda$1$Type",1103),M(1102,1,{},eee),l.Kb=function(t){return new vv(this.a,t)},O(qt,"AbstractMapBasedMultimap/lambda$2$Type",1102);var Cb=ss(wr,"Map/Entry");M(345,1,_z),l.Fb=function(t){var n;return we(t,42)?(n=u(t,42),md(this.cd(),n.cd())&&md(this.dd(),n.dd())):!1},l.Hb=function(){var t,n;return t=this.cd(),n=this.dd(),(t==null?0:Xi(t))^(n==null?0:Xi(n))},l.ed=function(t){throw J(new Fr)},l.Ib=function(){return this.cd()+"="+this.dd()},O(qt,iht,345),M(1988,28,hy),l.$b=function(){this.fd().$b()},l.Hc=function(t){var n;return we(t,42)?(n=u(t,42),xtn(this.fd(),n.cd(),n.dd())):!1},l.Mc=function(t){var n;return we(t,42)?(n=u(t,42),fQe(this.fd(),n.cd(),n.dd())):!1},l.gc=function(){return this.fd().d},O(qt,"Multimaps/Entries",1988),M(733,1988,hy,XL),l.Kc=function(){return this.a.kc()},l.fd=function(){return this.a},l.Nc=function(){return this.a.lc()},O(qt,"AbstractMultimap/Entries",733),M(734,733,Xu,_pe),l.Nc=function(){return this.a.lc()},l.Fb=function(t){return y4e(this,t)},l.Hb=function(){return ptt(this)},O(qt,"AbstractMultimap/EntrySet",734),M(735,28,hy,T3),l.$b=function(){this.a.$b()},l.Hc=function(t){return aan(this.a,t)},l.Kc=function(){return this.a.nc()},l.gc=function(){return this.a.d},l.Nc=function(){return this.a.oc()},O(qt,"AbstractMultimap/Values",735),M(1989,28,{835:1,20:1,28:1,14:1}),l.Jc=function(t){Nr(t),G3(this).Jc(new fee(t))},l.Nc=function(){var t;return t=G3(this).Nc(),Sse(t,new ve,64|t.qd()&1296,this.a.d)},l.Fc=function(t){return Npe(),!0},l.Gc=function(t){return Nr(this),Nr(t),we(t,543)?Stn(u(t,835)):!t.dc()&&Wre(this,t.Kc())},l.Hc=function(t){var n;return n=u(Ym(B6(this.a),t),14),(n?n.gc():0)>0},l.Fb=function(t){return y0n(this,t)},l.Hb=function(){return Xi(G3(this))},l.dc=function(){return G3(this).dc()},l.Mc=function(t){return Nat(this,t,1)>0},l.Ib=function(){return Qo(G3(this))},O(qt,"AbstractMultiset",1989),M(1991,1970,Xu),l.$b=function(){U$(this.a.a)},l.Hc=function(t){var n,r;return we(t,492)?(r=u(t,416),u(r.a.dd(),14).gc()<=0?!1:(n=zXe(this.a,r.a.cd()),n==u(r.a.dd(),14).gc())):!1},l.Mc=function(t){var n,r,s,o;return we(t,492)&&(r=u(t,416),n=r.a.cd(),s=u(r.a.dd(),14).gc(),s!=0)?(o=this.a,cdn(o,n,s)):!1},O(qt,"Multisets/EntrySet",1991),M(1109,1991,Xu,QL),l.Kc=function(){return new VHe(DKe(B6(this.a.a)).Kc())},l.gc=function(){return B6(this.a.a).gc()},O(qt,"AbstractMultiset/EntrySet",1109),M(619,726,bb),l.hc=function(){return this.gd()},l.jc=function(){return this.hd()},l.cc=function(t){return this.jd(t)},l.fc=function(t){return this.kd(t)},l.Zb=function(){var t;return t=this.f,t||(this.f=this.ac())},l.hd=function(){return hn(),hn(),HG},l.Fb=function(t){return yie(this,t)},l.jd=function(t){return u(Ii(this,t),21)},l.kd=function(t){return u(jD(this,t),21)},l.mc=function(t){return hn(),new Kx(u(t,21))},l.pc=function(t,n){return new IUe(this,t,u(n,21))},O(qt,"AbstractSetMultimap",619),M(1657,619,bb),l.hc=function(){return new Sp(this.b)},l.gd=function(){return new Sp(this.b)},l.jc=function(){return Jve(new Sp(this.b))},l.hd=function(){return Jve(new Sp(this.b))},l.cc=function(t){return u(u(Ii(this,t),21),84)},l.jd=function(t){return u(u(Ii(this,t),21),84)},l.fc=function(t){return u(u(jD(this,t),21),84)},l.kd=function(t){return u(u(jD(this,t),21),84)},l.mc=function(t){return we(t,271)?Jve(u(t,271)):(hn(),new ube(u(t,84)))},l.Zb=function(){var t;return t=this.f,t||(this.f=we(this.c,171)?new pj(this,u(this.c,171)):we(this.c,161)?new RM(this,u(this.c,161)):new Jx(this,this.c))},l.pc=function(t,n){return we(n,271)?new yVe(this,t,u(n,271)):new Mbe(this,t,u(n,84))},O(qt,"AbstractSortedSetMultimap",1657),M(1658,1657,bb),l.Zb=function(){var t;return t=this.f,u(u(t||(this.f=we(this.c,171)?new pj(this,u(this.c,171)):we(this.c,161)?new RM(this,u(this.c,161)):new Jx(this,this.c)),161),171)},l.ec=function(){var t;return t=this.i,u(u(t||(this.i=we(this.c,171)?new Zx(this,u(this.c,171)):we(this.c,161)?new dM(this,u(this.c,161)):new H3(this,this.c)),84),271)},l.bc=function(){return we(this.c,171)?new Zx(this,u(this.c,171)):we(this.c,161)?new dM(this,u(this.c,161)):new H3(this,this.c)},O(qt,"AbstractSortedKeySortedSetMultimap",1658),M(2010,1,{1947:1}),l.Fb=function(t){return Qln(this,t)},l.Hb=function(){var t;return tye((t=this.g,t||(this.g=new oT(this))))},l.Ib=function(){var t;return vst((t=this.f,t||(this.f=new tbe(this))))},O(qt,"AbstractTable",2010),M(665,H1,Xu,oT),l.$b=function(){tze()},l.Hc=function(t){var n,r;return we(t,468)?(n=u(t,682),r=u(Ym(eYe(this.a),Mp(n.c.e,n.b)),83),!!r&&Mye(r.vc(),new vv(Mp(n.c.c,n.a),G6(n.c,n.b,n.a)))):!1},l.Kc=function(){return PJt(this.a)},l.Mc=function(t){var n,r;return we(t,468)?(n=u(t,682),r=u(Ym(eYe(this.a),Mp(n.c.e,n.b)),83),!!r&&Oan(r.vc(),new vv(Mp(n.c.c,n.a),G6(n.c,n.b,n.a)))):!1},l.gc=function(){return fKe(this.a)},l.Nc=function(){return Mtn(this.a)},O(qt,"AbstractTable/CellSet",665),M(1928,28,hy,tee),l.$b=function(){tze()},l.Hc=function(t){return zhn(this.a,t)},l.Kc=function(){return BJt(this.a)},l.gc=function(){return fKe(this.a)},l.Nc=function(){return pQe(this.a)},O(qt,"AbstractTable/Values",1928),M(1632,1631,bb),O(qt,"ArrayListMultimapGwtSerializationDependencies",1632),M(513,1632,bb,ite,Twe),l.hc=function(){return new su(this.a)},l.a=0,O(qt,"ArrayListMultimap",513),M(664,2010,{664:1,1947:1,3:1},qat),O(qt,"ArrayTable",664),M(1924,386,_7,YVe),l.Xb=function(t){return new sye(this.a,t)},O(qt,"ArrayTable/1",1924),M(1925,1,{},jR),l.ld=function(t){return new sye(this.a,t)},O(qt,"ArrayTable/1methodref$getCell$Type",1925),M(2011,1,{682:1}),l.Fb=function(t){var n;return t===this?!0:we(t,468)?(n=u(t,682),md(Mp(this.c.e,this.b),Mp(n.c.e,n.b))&&md(Mp(this.c.c,this.a),Mp(n.c.c,n.a))&&md(G6(this.c,this.b,this.a),G6(n.c,n.b,n.a))):!1},l.Hb=function(){return fH(ie(re(Yn,1),yt,1,5,[Mp(this.c.e,this.b),Mp(this.c.c,this.a),G6(this.c,this.b,this.a)]))},l.Ib=function(){return"("+Mp(this.c.e,this.b)+","+Mp(this.c.c,this.a)+")="+G6(this.c,this.b,this.a)},O(qt,"Tables/AbstractCell",2011),M(468,2011,{468:1,682:1},sye),l.a=0,l.b=0,l.d=0,O(qt,"ArrayTable/2",468),M(1927,1,{},r6),l.ld=function(t){return CJe(this.a,t)},O(qt,"ArrayTable/2methodref$getValue$Type",1927),M(1926,386,_7,XVe),l.Xb=function(t){return CJe(this.a,t)},O(qt,"ArrayTable/3",1926),M(1979,1967,ow),l.$b=function(){Aj(this.kc())},l.vc=function(){return new s6(this)},l.lc=function(){return new AYe(this.kc(),this.gc())},O(qt,"Maps/IteratorBasedAbstractMap",1979),M(828,1979,ow),l.$b=function(){throw J(new Fr)},l._b=function(t){return yze(this.c,t)},l.kc=function(){return new QVe(this,this.c.b.c.gc())},l.lc=function(){return Ene(this.c.b.c.gc(),16,new iv(this))},l.xc=function(t){var n;return n=u(c_(this.c,t),19),n?this.nd(n.a):null},l.dc=function(){return this.c.b.c.dc()},l.ec=function(){return Dne(this.c)},l.zc=function(t,n){var r;if(r=u(c_(this.c,t),19),!r)throw J(new Ln(this.md()+" "+t+" not in "+Dne(this.c)));return this.od(r.a,n)},l.Bc=function(t){throw J(new Fr)},l.gc=function(){return this.c.b.c.gc()},O(qt,"ArrayTable/ArrayMap",828),M(1923,1,{},iv),l.ld=function(t){return nYe(this.a,t)},O(qt,"ArrayTable/ArrayMap/0methodref$getEntry$Type",1923),M(1921,345,_z,eGe),l.cd=function(){return QWt(this.a,this.b)},l.dd=function(){return this.a.nd(this.b)},l.ed=function(t){return this.a.od(this.b,t)},l.b=0,O(qt,"ArrayTable/ArrayMap/1",1921),M(1922,386,_7,QVe),l.Xb=function(t){return nYe(this.a,t)},O(qt,"ArrayTable/ArrayMap/2",1922),M(1920,828,ow,GKe),l.md=function(){return"Column"},l.nd=function(t){return G6(this.b,this.a,t)},l.od=function(t,n){return ent(this.b,this.a,t,n)},l.a=0,O(qt,"ArrayTable/Row",1920),M(829,828,ow,tbe),l.nd=function(t){return new GKe(this.a,t)},l.zc=function(t,n){return u(n,83),NVt()},l.od=function(t,n){return u(n,83),PVt()},l.md=function(){return"Row"},O(qt,"ArrayTable/RowMap",829),M(1120,1,Hh,tGe),l.qd=function(){return this.a.qd()&-262},l.rd=function(){return this.a.rd()},l.Nb=function(t){this.a.Nb(new Xze(t,this.b))},l.sd=function(t){return this.a.sd(new Yze(t,this.b))},O(qt,"CollectSpliterators/1",1120),M(1121,1,Un,Yze),l.td=function(t){this.a.td(this.b.Kb(t))},O(qt,"CollectSpliterators/1/lambda$0$Type",1121),M(1122,1,Un,Xze),l.td=function(t){this.a.td(this.b.Kb(t))},O(qt,"CollectSpliterators/1/lambda$1$Type",1122),M(1123,1,Hh,CQe),l.qd=function(){return this.a},l.rd=function(){return this.d&&(this.b=MVe(this.b,this.d.rd())),MVe(this.b,0)},l.Nb=function(t){this.d&&(this.d.Nb(t),this.d=null),this.c.Nb(new Kze(this.e,t)),this.b=0},l.sd=function(t){for(;;){if(this.d&&this.d.sd(t))return XT(this.b,Cz)&&(this.b=Wp(this.b,1)),!0;if(this.d=null,!this.c.sd(new Qze(this,this.e)))return!1}},l.a=0,l.b=0,O(qt,"CollectSpliterators/1FlatMapSpliterator",1123),M(1124,1,Un,Qze),l.td=function(t){eYt(this.a,this.b,t)},O(qt,"CollectSpliterators/1FlatMapSpliterator/lambda$0$Type",1124),M(1125,1,Un,Kze),l.td=function(t){FWt(this.b,this.a,t)},O(qt,"CollectSpliterators/1FlatMapSpliterator/lambda$1$Type",1125),M(1117,1,Hh,cWe),l.qd=function(){return 16464|this.b},l.rd=function(){return this.a.rd()},l.Nb=function(t){this.a.xe(new Jze(t,this.c))},l.sd=function(t){return this.a.ye(new Zze(t,this.c))},l.b=0,O(qt,"CollectSpliterators/1WithCharacteristics",1117),M(1118,1,SI,Zze),l.ud=function(t){this.a.td(this.b.ld(t))},O(qt,"CollectSpliterators/1WithCharacteristics/lambda$0$Type",1118),M(1119,1,SI,Jze),l.ud=function(t){this.a.td(this.b.ld(t))},O(qt,"CollectSpliterators/1WithCharacteristics/lambda$1$Type",1119),M(245,1,Iae),l.wd=function(t){return this.vd(u(t,245))},l.vd=function(t){var n;return t==(Yee(),due)?1:t==(Xee(),fue)?-1:(n=(_j(),CD(this.a,t.a)),n!=0?n:we(this,519)==we(t,519)?0:we(this,519)?1:-1)},l.zd=function(){return this.a},l.Fb=function(t){return c3e(this,t)},O(qt,"Cut",245),M(1761,245,Iae,ize),l.vd=function(t){return t==this?0:1},l.xd=function(t){throw J(new ope)},l.yd=function(t){t.a+="+∞)"},l.zd=function(){throw J(new Wo(aht))},l.Hb=function(){return Ud(),v3e(this)},l.Ad=function(t){return!1},l.Ib=function(){return"+∞"};var fue;O(qt,"Cut/AboveAll",1761),M(519,245,{245:1,519:1,3:1,35:1},nUe),l.xd=function(t){Ec((t.a+="(",t),this.a)},l.yd=function(t){Bp(Ec(t,this.a),93)},l.Hb=function(){return~Xi(this.a)},l.Ad=function(t){return _j(),CD(this.a,t)<0},l.Ib=function(){return"/"+this.a+"\\"},O(qt,"Cut/AboveValue",519),M(1760,245,Iae,sze),l.vd=function(t){return t==this?0:-1},l.xd=function(t){t.a+="(-∞"},l.yd=function(t){throw J(new ope)},l.zd=function(){throw J(new Wo(aht))},l.Hb=function(){return Ud(),v3e(this)},l.Ad=function(t){return!0},l.Ib=function(){return"-∞"};var due;O(qt,"Cut/BelowAll",1760),M(1762,245,Iae,rUe),l.xd=function(t){Ec((t.a+="[",t),this.a)},l.yd=function(t){Bp(Ec(t,this.a),41)},l.Hb=function(){return Xi(this.a)},l.Ad=function(t){return _j(),CD(this.a,t)<=0},l.Ib=function(){return"\\"+this.a+"/"},O(qt,"Cut/BelowValue",1762),M(537,1,i0),l.Jc=function(t){Da(this,t)},l.Ib=function(){return uon(u(Zj(this,"use Optional.orNull() instead of Optional.or(null)"),20).Kc())},O(qt,"FluentIterable",537),M(433,537,i0,JT),l.Kc=function(){return new cr(fr(this.a.Kc(),new V))},O(qt,"FluentIterable/2",433),M(1046,537,i0,oVe),l.Kc=function(){return Pp(this)},O(qt,"FluentIterable/3",1046),M(708,386,_7,nbe),l.Xb=function(t){return this.a[t].Kc()},O(qt,"FluentIterable/3/1",708),M(1972,1,{}),l.Ib=function(){return Qo(this.Bd().b)},O(qt,"ForwardingObject",1972),M(1973,1972,oht),l.Bd=function(){return this.Cd()},l.Jc=function(t){Da(this,t)},l.Lc=function(){return this.Oc()},l.Nc=function(){return new mn(this,0)},l.Oc=function(){return new vn(null,this.Nc())},l.Fc=function(t){return this.Cd(),Tze()},l.Gc=function(t){return this.Cd(),_ze()},l.$b=function(){this.Cd(),Cze()},l.Hc=function(t){return this.Cd().Hc(t)},l.Ic=function(t){return this.Cd().Ic(t)},l.dc=function(){return this.Cd().b.dc()},l.Kc=function(){return this.Cd().Kc()},l.Mc=function(t){return this.Cd(),Sze()},l.gc=function(){return this.Cd().b.gc()},l.Pc=function(){return this.Cd().Pc()},l.Qc=function(t){return this.Cd().Qc(t)},O(qt,"ForwardingCollection",1973),M(1980,28,p6e),l.Kc=function(){return this.Ed()},l.Fc=function(t){throw J(new Fr)},l.Gc=function(t){throw J(new Fr)},l.$b=function(){throw J(new Fr)},l.Hc=function(t){return t!=null&&Xm(this,t,!1)},l.Dd=function(){switch(this.gc()){case 0:return Rm(),Rm(),gue;case 1:return Rm(),new Tne(Nr(this.Ed().Pb()));default:return new qKe(this,this.Pc())}},l.Mc=function(t){throw J(new Fr)},O(qt,"ImmutableCollection",1980),M(712,1980,p6e,spe),l.Kc=function(){return q6(this.a.Kc())},l.Hc=function(t){return t!=null&&this.a.Hc(t)},l.Ic=function(t){return this.a.Ic(t)},l.dc=function(){return this.a.dc()},l.Ed=function(){return q6(this.a.Kc())},l.gc=function(){return this.a.gc()},l.Pc=function(){return this.a.Pc()},l.Qc=function(t){return this.a.Qc(t)},l.Ib=function(){return Qo(this.a)},O(qt,"ForwardingImmutableCollection",712),M(152,1980,vC),l.Kc=function(){return this.Ed()},l.Yc=function(){return this.Fd(0)},l.Zc=function(t){return this.Fd(t)},l.ad=function(t){Y3(this,t)},l.Nc=function(){return new mn(this,16)},l.bd=function(t,n){return this.Gd(t,n)},l.Vc=function(t,n){throw J(new Fr)},l.Wc=function(t,n){throw J(new Fr)},l.Fb=function(t){return i0n(this,t)},l.Hb=function(){return psn(this)},l.Xc=function(t){return t==null?-1:Aun(this,t)},l.Ed=function(){return this.Fd(0)},l.Fd=function(t){return vbe(this,t)},l.$c=function(t){throw J(new Fr)},l._c=function(t,n){throw J(new Fr)},l.Gd=function(t,n){var r;return pH((r=new fGe(this),new Zd(r,t,n)))};var gue;O(qt,"ImmutableList",152),M(2006,152,vC),l.Kc=function(){return q6(this.Hd().Kc())},l.bd=function(t,n){return pH(this.Hd().bd(t,n))},l.Hc=function(t){return t!=null&&this.Hd().Hc(t)},l.Ic=function(t){return this.Hd().Ic(t)},l.Fb=function(t){return Ci(this.Hd(),t)},l.Xb=function(t){return Mp(this,t)},l.Hb=function(){return Xi(this.Hd())},l.Xc=function(t){return this.Hd().Xc(t)},l.dc=function(){return this.Hd().dc()},l.Ed=function(){return q6(this.Hd().Kc())},l.gc=function(){return this.Hd().gc()},l.Gd=function(t,n){return pH(this.Hd().bd(t,n))},l.Pc=function(){return this.Hd().Qc(Me(Yn,yt,1,this.Hd().gc(),5,1))},l.Qc=function(t){return this.Hd().Qc(t)},l.Ib=function(){return Qo(this.Hd())},O(qt,"ForwardingImmutableList",2006),M(714,1,C7),l.vc=function(){return Cv(this)},l.wc=function(t){B_(this,t)},l.ec=function(){return Dne(this)},l.yc=function(t,n,r){return Rie(this,t,n,r)},l.Cc=function(){return this.Ld()},l.$b=function(){throw J(new Fr)},l._b=function(t){return this.xc(t)!=null},l.uc=function(t){return this.Ld().Hc(t)},l.Jd=function(){return new Y$e(this)},l.Kd=function(){return new X$e(this)},l.Fb=function(t){return oan(this,t)},l.Hb=function(){return Cv(this).Hb()},l.dc=function(){return this.gc()==0},l.zc=function(t,n){return BVt()},l.Bc=function(t){throw J(new Fr)},l.Ib=function(){return jfn(this)},l.Ld=function(){return this.e?this.e:this.e=this.Kd()},l.c=null,l.d=null,l.e=null;var k0t;O(qt,"ImmutableMap",714),M(715,714,C7),l._b=function(t){return yze(this,t)},l.uc=function(t){return bGe(this.b,t)},l.Id=function(){return Wnt(new uT(this))},l.Jd=function(){return Wnt(TYe(this.b))},l.Kd=function(){return wd(),new spe(EYe(this.b))},l.Fb=function(t){return vGe(this.b,t)},l.xc=function(t){return c_(this,t)},l.Hb=function(){return Xi(this.b.c)},l.dc=function(){return this.b.c.dc()},l.gc=function(){return this.b.c.gc()},l.Ib=function(){return Qo(this.b.c)},O(qt,"ForwardingImmutableMap",715),M(1974,1973,Oae),l.Bd=function(){return this.Md()},l.Cd=function(){return this.Md()},l.Nc=function(){return new mn(this,1)},l.Fb=function(t){return t===this||this.Md().Fb(t)},l.Hb=function(){return this.Md().Hb()},O(qt,"ForwardingSet",1974),M(1069,1974,Oae,uT),l.Bd=function(){return w8(this.a.b)},l.Cd=function(){return w8(this.a.b)},l.Hc=function(t){if(we(t,42)&&u(t,42).cd()==null)return!1;try{return pGe(w8(this.a.b),t)}catch(n){if(n=ts(n),we(n,205))return!1;throw J(n)}},l.Md=function(){return w8(this.a.b)},l.Qc=function(t){var n;return n=sXe(w8(this.a.b),t),w8(this.a.b).b.gc()=0?"+":"")+(r/60|0),n=ZF(b.Math.abs(r)%60),(Sst(),R0t)[this.q.getDay()]+" "+F0t[this.q.getMonth()]+" "+ZF(this.q.getDate())+" "+ZF(this.q.getHours())+":"+ZF(this.q.getMinutes())+":"+ZF(this.q.getSeconds())+" GMT"+t+n+" "+this.q.getFullYear()};var FG=O(wr,"Date",199);M(1915,199,bht,est),l.a=!1,l.b=0,l.c=0,l.d=0,l.e=0,l.f=0,l.g=!1,l.i=0,l.j=0,l.k=0,l.n=0,l.o=0,l.p=0,O("com.google.gwt.i18n.shared.impl","DateRecord",1915),M(1966,1,{}),l.fe=function(){return null},l.ge=function(){return null},l.he=function(){return null},l.ie=function(){return null},l.je=function(){return null},O(ok,"JSONValue",1966),M(216,1966,{216:1},hg,a6),l.Fb=function(t){return we(t,216)?Swe(this.a,u(t,216).a):!1},l.ee=function(){return iVt},l.Hb=function(){return gwe(this.a)},l.fe=function(){return this},l.Ib=function(){var t,n,r;for(r=new Fl("["),n=0,t=this.a.length;n0&&(r.a+=","),Ec(r,Gm(this,n));return r.a+="]",r.a},O(ok,"JSONArray",216),M(483,1966,{483:1},jx),l.ee=function(){return sVt},l.ge=function(){return this},l.Ib=function(){return Mn(),""+this.a},l.a=!1;var A0t,L0t;O(ok,"JSONBoolean",483),M(985,60,q0,UHe),O(ok,"JSONException",985),M(1023,1966,{},Ae),l.ee=function(){return lVt},l.Ib=function(){return Pu};var M0t;O(ok,"JSONNull",1023),M(258,1966,{258:1},lT),l.Fb=function(t){return we(t,258)?this.a==u(t,258).a:!1},l.ee=function(){return aVt},l.Hb=function(){return i8(this.a)},l.he=function(){return this},l.Ib=function(){return this.a+""},l.a=0,O(ok,"JSONNumber",258),M(183,1966,{183:1},p6,$x),l.Fb=function(t){return we(t,183)?Swe(this.a,u(t,183).a):!1},l.ee=function(){return oVt},l.Hb=function(){return gwe(this.a)},l.ie=function(){return this},l.Ib=function(){var t,n,r,s,o,h,d;for(d=new Fl("{"),t=!0,h=aie(this,Me(mt,Qe,2,0,6,1)),r=h,s=0,o=r.length;s=0?":"+this.c:"")+")"},l.c=0;var K8e=O(oc,"StackTraceElement",310);y0t={3:1,475:1,35:1,2:1};var mt=O(oc,b6e,2);M(107,418,{475:1},bg,ST,Ph),O(oc,"StringBuffer",107),M(100,418,{475:1},Tp,xm,Fl),O(oc,"StringBuilder",100),M(687,73,noe,Bpe),O(oc,"StringIndexOutOfBoundsException",687),M(2043,1,{});var Y8e;M(844,1,{},Bt),l.Kb=function(t){return u(t,78).e},O(oc,"Throwable/lambda$0$Type",844),M(41,60,{3:1,102:1,60:1,78:1,41:1},Fr,pg),O(oc,"UnsupportedOperationException",41),M(240,236,{3:1,35:1,236:1,240:1},kD,Vpe),l.wd=function(t){return out(this,u(t,240))},l.ke=function(){return ry(Gut(this))},l.Fb=function(t){var n;return this===t?!0:we(t,240)?(n=u(t,240),this.e==n.e&&out(this,n)==0):!1},l.Hb=function(){var t;return this.b!=0?this.b:this.a<54?(t=Ou(this.f),this.b=Or(qs(t,-1)),this.b=33*this.b+Or(qs(Np(t,32),-1)),this.b=17*this.b+_s(this.e),this.b):(this.b=17*Hnt(this.c)+_s(this.e),this.b)},l.Ib=function(){return Gut(this)},l.a=0,l.b=0,l.d=0,l.e=0,l.f=0;var N0t,Ab,X8e,Q8e,Z8e,J8e,e7e,t7e,xue=O("java.math","BigDecimal",240);M(91,236,{3:1,35:1,236:1,91:1},b3e,Tg,z3,Z3e,qrt,Ip),l.wd=function(t){return jrt(this,u(t,91))},l.ke=function(){return ry(Lae(this,0))},l.Fb=function(t){return Yye(this,t)},l.Hb=function(){return Hnt(this)},l.Ib=function(){return Lae(this,0)},l.b=-2,l.c=0,l.d=0,l.e=0;var Eue,jG,n7e,Tue,$G,K7,D4=O("java.math","BigInteger",91),P0t,B0t,yk,QC;M(488,1967,ow),l.$b=function(){sl(this)},l._b=function(t){return Il(this,t)},l.uc=function(t){return _nt(this,t,this.g)||_nt(this,t,this.f)},l.vc=function(){return new dg(this)},l.xc=function(t){return er(this,t)},l.zc=function(t,n){return Si(this,t,n)},l.Bc=function(t){return z6(this,t)},l.gc=function(){return MT(this)},O(wr,"AbstractHashMap",488),M(261,H1,Xu,dg),l.$b=function(){this.a.$b()},l.Hc=function(t){return kQe(this,t)},l.Kc=function(){return new ob(this.a)},l.Mc=function(t){var n;return kQe(this,t)?(n=u(t,42).cd(),this.a.Bc(n),!0):!1},l.gc=function(){return this.a.gc()},O(wr,"AbstractHashMap/EntrySet",261),M(262,1,ga,ob),l.Nb=function(t){La(this,t)},l.Pb=function(){return $v(this)},l.Ob=function(){return this.b},l.Qb=function(){wJe(this)},l.b=!1,O(wr,"AbstractHashMap/EntrySetIterator",262),M(417,1,ga,c6),l.Nb=function(t){La(this,t)},l.Ob=function(){return wM(this)},l.Pb=function(){return GYe(this)},l.Qb=function(){Ol(this)},l.b=0,l.c=-1,O(wr,"AbstractList/IteratorImpl",417),M(96,417,r0,Ea),l.Qb=function(){Ol(this)},l.Rb=function(t){Dm(this,t)},l.Sb=function(){return this.b>0},l.Tb=function(){return this.b},l.Ub=function(){return Qn(this.b>0),this.a.Xb(this.c=--this.b)},l.Vb=function(){return this.b-1},l.Wb=function(t){Am(this.c!=-1),this.a._c(this.c,t)},O(wr,"AbstractList/ListIteratorImpl",96),M(219,52,A7,Zd),l.Vc=function(t,n){jm(t,this.b),this.c.Vc(this.a+t,n),++this.b},l.Xb=function(t){return xn(t,this.b),this.c.Xb(this.a+t)},l.$c=function(t){var n;return xn(t,this.b),n=this.c.$c(this.a+t),--this.b,n},l._c=function(t,n){return xn(t,this.b),this.c._c(this.a+t,n)},l.gc=function(){return this.b},l.a=0,l.b=0,O(wr,"AbstractList/SubList",219),M(384,H1,Xu,vm),l.$b=function(){this.a.$b()},l.Hc=function(t){return this.a._b(t)},l.Kc=function(){var t;return t=this.a.vc().Kc(),new nM(t)},l.Mc=function(t){return this.a._b(t)?(this.a.Bc(t),!0):!1},l.gc=function(){return this.a.gc()},O(wr,"AbstractMap/1",384),M(691,1,ga,nM),l.Nb=function(t){La(this,t)},l.Ob=function(){return this.a.Ob()},l.Pb=function(){var t;return t=u(this.a.Pb(),42),t.cd()},l.Qb=function(){this.a.Qb()},O(wr,"AbstractMap/1/1",691),M(226,28,hy,E1),l.$b=function(){this.a.$b()},l.Hc=function(t){return this.a.uc(t)},l.Kc=function(){var t;return t=this.a.vc().Kc(),new T1(t)},l.gc=function(){return this.a.gc()},O(wr,"AbstractMap/2",226),M(294,1,ga,T1),l.Nb=function(t){La(this,t)},l.Ob=function(){return this.a.Ob()},l.Pb=function(){var t;return t=u(this.a.Pb(),42),t.dd()},l.Qb=function(){this.a.Qb()},O(wr,"AbstractMap/2/1",294),M(484,1,{484:1,42:1}),l.Fb=function(t){var n;return we(t,42)?(n=u(t,42),Vc(this.d,n.cd())&&Vc(this.e,n.dd())):!1},l.cd=function(){return this.d},l.dd=function(){return this.e},l.Hb=function(){return F3(this.d)^F3(this.e)},l.ed=function(t){return Rbe(this,t)},l.Ib=function(){return this.d+"="+this.e},O(wr,"AbstractMap/AbstractEntry",484),M(383,484,{484:1,383:1,42:1},OF),O(wr,"AbstractMap/SimpleEntry",383),M(1984,1,aoe),l.Fb=function(t){var n;return we(t,42)?(n=u(t,42),Vc(this.cd(),n.cd())&&Vc(this.dd(),n.dd())):!1},l.Hb=function(){return F3(this.cd())^F3(this.dd())},l.Ib=function(){return this.cd()+"="+this.dd()},O(wr,iht,1984),M(1992,1967,nht),l.tc=function(t){return LZe(this,t)},l._b=function(t){return fne(this,t)},l.vc=function(){return new k(this)},l.xc=function(t){var n;return n=t,hc(bye(this,n))},l.ec=function(){return new m(this)},O(wr,"AbstractNavigableMap",1992),M(739,H1,Xu,k),l.Hc=function(t){return we(t,42)&&LZe(this.b,u(t,42))},l.Kc=function(){return new o_(this.b)},l.Mc=function(t){var n;return we(t,42)?(n=u(t,42),bJe(this.b,n)):!1},l.gc=function(){return this.b.c},O(wr,"AbstractNavigableMap/EntrySet",739),M(493,H1,g6e,m),l.Nc=function(){return new DF(this)},l.$b=function(){ET(this.a)},l.Hc=function(t){return fne(this.a,t)},l.Kc=function(){var t;return t=new o_(new i_(this.a).b),new g(t)},l.Mc=function(t){return fne(this.a,t)?(k_(this.a,t),!0):!1},l.gc=function(){return this.a.c},O(wr,"AbstractNavigableMap/NavigableKeySet",493),M(494,1,ga,g),l.Nb=function(t){La(this,t)},l.Ob=function(){return wM(this.a.a)},l.Pb=function(){var t;return t=dj(this.a),t.cd()},l.Qb=function(){mWe(this.a)},O(wr,"AbstractNavigableMap/NavigableKeySet/1",494),M(2004,28,hy),l.Fc=function(t){return S8(l7(this,t)),!0},l.Gc=function(t){return Sn(t),kj(t!=this,"Can't add a queue to itself"),no(this,t)},l.$b=function(){for(;Kre(this)!=null;);},O(wr,"AbstractQueue",2004),M(302,28,{4:1,20:1,28:1,14:1},L3,UXe),l.Fc=function(t){return Pwe(this,t),!0},l.$b=function(){Hwe(this)},l.Hc=function(t){return Ktt(new y_(this),t)},l.dc=function(){return TT(this)},l.Kc=function(){return new y_(this)},l.Mc=function(t){return yen(new y_(this),t)},l.gc=function(){return this.c-this.b&this.a.length-1},l.Nc=function(){return new mn(this,272)},l.Qc=function(t){var n;return n=this.c-this.b&this.a.length-1,t.lengthn&&cs(t,n,null),t},l.b=0,l.c=0,O(wr,"ArrayDeque",302),M(446,1,ga,y_),l.Nb=function(t){La(this,t)},l.Ob=function(){return this.a!=this.b},l.Pb=function(){return gH(this)},l.Qb=function(){Uet(this)},l.a=0,l.b=0,l.c=-1,O(wr,"ArrayDeque/IteratorImpl",446),M(12,52,mht,st,su,Uu),l.Vc=function(t,n){Om(this,t,n)},l.Fc=function(t){return it(this,t)},l.Wc=function(t,n){return xye(this,t,n)},l.Gc=function(t){return Rs(this,t)},l.$b=function(){this.c=Me(Yn,yt,1,0,5,1)},l.Hc=function(t){return Yo(this,t,0)!=-1},l.Jc=function(t){Mu(this,t)},l.Xb=function(t){return St(this,t)},l.Xc=function(t){return Yo(this,t,0)},l.dc=function(){return this.c.length==0},l.Kc=function(){return new C(this)},l.$c=function(t){return Eg(this,t)},l.Mc=function(t){return Au(this,t)},l.Ud=function(t,n){VXe(this,t,n)},l._c=function(t,n){return gh(this,t,n)},l.gc=function(){return this.c.length},l.ad=function(t){aa(this,t)},l.Pc=function(){return tne(this)},l.Qc=function(t){return j1(this,t)};var i3n=O(wr,"ArrayList",12);M(7,1,ga,C),l.Nb=function(t){La(this,t)},l.Ob=function(){return nc(this)},l.Pb=function(){return Y(this)},l.Qb=function(){b_(this)},l.a=0,l.b=-1,O(wr,"ArrayList/1",7),M(2013,b.Function,{},he),l.te=function(t,n){return Fs(t,n)},M(154,52,yht,Al),l.Hc=function(t){return Ket(this,t)!=-1},l.Jc=function(t){var n,r,s,o;for(Sn(t),r=this.a,s=0,o=r.length;s>>0,t.toString(16)))},l.f=0,l.i=Ds;var VG=O(o0,"CNode",57);M(814,1,{},bpe),O(o0,"CNode/CNodeBuilder",814);var Z0t;M(1525,1,{},Er),l.Oe=function(t,n){return 0},l.Pe=function(t,n){return 0},O(o0,Aht,1525),M(1790,1,{},br),l.Le=function(t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W,X;for(_=gs,s=new C(t.a.b);s.as.d.c||s.d.c==h.d.c&&s.d.b0?t+this.n.d+this.n.a:0},l.Se=function(){var t,n,r,s,o;if(o=0,this.e)this.b?o=this.b.a:this.a[1][1]&&(o=this.a[1][1].Se());else if(this.g)o=qye(this,wse(this,null,!0));else for(n=(n1(),ie(re(Ey,1),tt,232,0,[pc,lu,bc])),r=0,s=n.length;r0?o+this.n.b+this.n.c:0},l.Te=function(){var t,n,r,s,o;if(this.g)for(t=wse(this,null,!1),r=(n1(),ie(re(Ey,1),tt,232,0,[pc,lu,bc])),s=0,o=r.length;s0&&(s[0]+=this.d,r-=s[0]),s[2]>0&&(s[2]+=this.d,r-=s[2]),this.c.a=b.Math.max(0,r),this.c.d=n.d+t.d+(this.c.a-r)/2,s[1]=b.Math.max(s[1],r),Kwe(this,lu,n.d+t.d+s[0]-(s[1]-r)/2,s)},l.b=null,l.d=0,l.e=!1,l.f=!1,l.g=!1;var Due=0,UG=0;O(wb,"GridContainerCell",1473),M(461,22,{3:1,35:1,22:1,461:1},pte);var a2,Nd,Af,cgt=Gr(wb,"HorizontalLabelAlignment",461,Wr,Pen,mYt),ugt;M(306,212,{212:1,306:1},fXe,yet,uXe),l.Re=function(){return XWe(this)},l.Se=function(){return kve(this)},l.a=0,l.c=!1;var g3n=O(wb,"LabelCell",306);M(244,326,{212:1,326:1,244:1},W_),l.Re=function(){return oI(this)},l.Se=function(){return cI(this)},l.Te=function(){uae(this)},l.Ue=function(){lae(this)},l.b=0,l.c=0,l.d=!1,O(wb,"StripContainerCell",244),M(1626,1,vi,Ms),l.Mb=function(t){return IVt(u(t,212))},O(wb,"StripContainerCell/lambda$0$Type",1626),M(1627,1,{},Pa),l.Fe=function(t){return u(t,212).Se()},O(wb,"StripContainerCell/lambda$1$Type",1627),M(1628,1,vi,Ta),l.Mb=function(t){return OVt(u(t,212))},O(wb,"StripContainerCell/lambda$2$Type",1628),M(1629,1,{},_a),l.Fe=function(t){return u(t,212).Re()},O(wb,"StripContainerCell/lambda$3$Type",1629),M(462,22,{3:1,35:1,22:1,462:1},bte);var Lf,o2,u1,lgt=Gr(wb,"VerticalLabelAlignment",462,Wr,Ben,yYt),hgt;M(789,1,{},i6e),l.c=0,l.d=0,l.k=0,l.s=0,l.t=0,l.v=!1,l.w=0,l.D=!1,O(Iz,"NodeContext",789),M(1471,1,ji,ka),l.ue=function(t,n){return fVe(u(t,61),u(n,61))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Iz,"NodeContext/0methodref$comparePortSides$Type",1471),M(1472,1,ji,Qi),l.ue=function(t,n){return afn(u(t,111),u(n,111))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Iz,"NodeContext/1methodref$comparePortContexts$Type",1472),M(159,22,{3:1,35:1,22:1,159:1},vh);var fgt,dgt,ggt,pgt,bgt,vgt,wgt,mgt,ygt,kgt,xgt,Egt,Tgt,_gt,Cgt,Sgt,Agt,Lgt,Mgt,Dgt,Igt,Iue,Ogt=Gr(Iz,"NodeLabelLocation",159,Wr,Xie,kYt),Ngt;M(111,1,{111:1},Wat),l.a=!1,O(Iz,"PortContext",111),M(1476,1,Un,ea),l.td=function(t){Dze(u(t,306))},O(PI,Hht,1476),M(1477,1,vi,Ca),l.Mb=function(t){return!!u(t,111).c},O(PI,zht,1477),M(1478,1,Un,Sa),l.td=function(t){Dze(u(t,111).c)},O(PI,"LabelPlacer/lambda$2$Type",1478);var F7e;M(1475,1,Un,cg),l.td=function(t){Mm(),fVt(u(t,111))},O(PI,"NodeLabelAndSizeUtilities/lambda$0$Type",1475),M(790,1,Un,eve),l.td=function(t){TUt(this.b,this.c,this.a,u(t,181))},l.a=!1,l.c=!1,O(PI,"NodeLabelCellCreator/lambda$0$Type",790),M(1474,1,Un,fn),l.td=function(t){pVt(this.a,u(t,181))},O(PI,"PortContextCreator/lambda$0$Type",1474);var WG;M(1829,1,{},Gc),O(I7,"GreedyRectangleStripOverlapRemover",1829),M(1830,1,ji,Ka),l.ue=function(t,n){return nKt(u(t,222),u(n,222))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(I7,"GreedyRectangleStripOverlapRemover/0methodref$compareByYCoordinate$Type",1830),M(1786,1,{},uHe),l.a=5,l.e=0,O(I7,"RectangleStripOverlapRemover",1786),M(1787,1,ji,Es),l.ue=function(t,n){return rKt(u(t,222),u(n,222))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(I7,"RectangleStripOverlapRemover/0methodref$compareLeftRectangleBorders$Type",1787),M(1789,1,ji,lp),l.ue=function(t,n){return SZt(u(t,222),u(n,222))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(I7,"RectangleStripOverlapRemover/1methodref$compareRightRectangleBorders$Type",1789),M(406,22,{3:1,35:1,22:1,406:1},BF);var iO,Oue,Nue,sO,Pgt=Gr(I7,"RectangleStripOverlapRemover/OverlapRemovalDirection",406,Wr,Ptn,xYt),Bgt;M(222,1,{222:1},Lne),O(I7,"RectangleStripOverlapRemover/RectangleNode",222),M(1788,1,Un,vr),l.td=function(t){Dun(this.a,u(t,222))},O(I7,"RectangleStripOverlapRemover/lambda$1$Type",1788),M(1304,1,ji,sd),l.ue=function(t,n){return Rvn(u(t,167),u(n,167))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Cd,"PolyominoCompactor/CornerCasesGreaterThanRestComparator",1304),M(1307,1,{},sh),l.Kb=function(t){return u(t,324).a},O(Cd,"PolyominoCompactor/CornerCasesGreaterThanRestComparator/lambda$0$Type",1307),M(1308,1,vi,Ai),l.Mb=function(t){return u(t,323).a},O(Cd,"PolyominoCompactor/CornerCasesGreaterThanRestComparator/lambda$1$Type",1308),M(1309,1,vi,nn),l.Mb=function(t){return u(t,323).a},O(Cd,"PolyominoCompactor/CornerCasesGreaterThanRestComparator/lambda$2$Type",1309),M(1302,1,ji,Tr),l.ue=function(t,n){return v2n(u(t,167),u(n,167))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Cd,"PolyominoCompactor/MinNumOfExtensionDirectionsComparator",1302),M(1305,1,{},Dh),l.Kb=function(t){return u(t,324).a},O(Cd,"PolyominoCompactor/MinNumOfExtensionDirectionsComparator/lambda$0$Type",1305),M(767,1,ji,ai),l.ue=function(t,n){return msn(u(t,167),u(n,167))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Cd,"PolyominoCompactor/MinNumOfExtensionsComparator",767),M(1300,1,ji,Ns),l.ue=function(t,n){return Ain(u(t,321),u(n,321))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Cd,"PolyominoCompactor/MinPerimeterComparator",1300),M(1301,1,ji,mc),l.ue=function(t,n){return iun(u(t,321),u(n,321))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Cd,"PolyominoCompactor/MinPerimeterComparatorWithShape",1301),M(1303,1,ji,yu),l.ue=function(t,n){return $2n(u(t,167),u(n,167))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Cd,"PolyominoCompactor/SingleExtensionSideGreaterThanRestComparator",1303),M(1306,1,{},Mo),l.Kb=function(t){return u(t,324).a},O(Cd,"PolyominoCompactor/SingleExtensionSideGreaterThanRestComparator/lambda$0$Type",1306),M(777,1,{},o2e),l.Ce=function(t,n){return Dtn(this,u(t,46),u(n,167))},O(Cd,"SuccessorCombination",777),M(644,1,{},ku),l.Ce=function(t,n){var r;return ydn((r=u(t,46),u(n,167),r))},O(Cd,"SuccessorJitter",644),M(643,1,{},Ih),l.Ce=function(t,n){var r;return cpn((r=u(t,46),u(n,167),r))},O(Cd,"SuccessorLineByLine",643),M(568,1,{},qf),l.Ce=function(t,n){var r;return k0n((r=u(t,46),u(n,167),r))},O(Cd,"SuccessorManhattan",568),M(1356,1,{},lx),l.Ce=function(t,n){var r;return Ign((r=u(t,46),u(n,167),r))},O(Cd,"SuccessorMaxNormWindingInMathPosSense",1356),M(400,1,{},gr),l.Ce=function(t,n){return Yve(this,t,n)},l.c=!1,l.d=!1,l.e=!1,l.f=!1,O(Cd,"SuccessorQuadrantsGeneric",400),M(1357,1,{},ad),l.Kb=function(t){return u(t,324).a},O(Cd,"SuccessorQuadrantsGeneric/lambda$0$Type",1357),M(323,22,{3:1,35:1,22:1,323:1},PF),l.a=!1;var aO,oO,cO,uO,Rgt=Gr(Nz,P6e,323,Wr,Ftn,EYt),Fgt;M(1298,1,{}),l.Ib=function(){var t,n,r,s,o,h;for(r=" ",t=ct(0),o=0;o=0?"b"+t+"["+Sre(this.a)+"]":"b["+Sre(this.a)+"]"):"b_"+xv(this)},O(RI,"FBendpoint",559),M(282,134,{3:1,282:1,94:1,134:1},UUe),l.Ib=function(){return Sre(this)},O(RI,"FEdge",282),M(231,134,{3:1,231:1,94:1,134:1},k$);var b3n=O(RI,"FGraph",231);M(447,357,{3:1,447:1,357:1,94:1,134:1},YQe),l.Ib=function(){return this.b==null||this.b.length==0?"l["+Sre(this.a)+"]":"l_"+this.b},O(RI,"FLabel",447),M(144,357,{3:1,144:1,357:1,94:1,134:1},sYe),l.Ib=function(){return Cwe(this)},l.b=0,O(RI,"FNode",144),M(2003,1,{}),l.bf=function(t){R5e(this,t)},l.cf=function(){Mit(this)},l.d=0,O(V6e,"AbstractForceModel",2003),M(631,2003,{631:1},$tt),l.af=function(t,n){var r,s,o,h,d;return Cat(this.f,t,n),o=da(fc(n.d),t.d),d=b.Math.sqrt(o.a*o.a+o.b*o.b),s=b.Math.max(0,d-w_(t.e)/2-w_(n.e)/2),r=bnt(this.e,t,n),r>0?h=-TZt(s,this.c)*r:h=bKt(s,this.b)*u(K(t,(a1(),Q7)),19).a,bd(o,h/d),o},l.bf=function(t){R5e(this,t),this.a=u(K(t,(a1(),JG)),19).a,this.c=Ue(ft(K(t,eq))),this.b=Ue(ft(K(t,Hue)))},l.df=function(t){return t0&&(h-=AVt(s,this.a)*r),bd(o,h*this.b/d),o},l.bf=function(t){var n,r,s,o,h,d,v;for(R5e(this,t),this.b=Ue(ft(K(t,(a1(),zue)))),this.c=this.b/u(K(t,JG),19).a,s=t.e.c.length,h=0,o=0,v=new C(t.e);v.a0},l.a=0,l.b=0,l.c=0,O(V6e,"FruchtermanReingoldModel",632),M(849,1,zh,DJ),l.Qe=function(t){en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Rz),""),"Force Model"),"Determines the model for force calculation."),W7e),(Ng(),vs)),K7e),rn((i1(),Fn))))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,U6e),""),"Iterations"),"The number of iterations on the force model."),ct(300)),Cc),Za),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,W6e),""),"Repulsive Power"),"Determines how many bend points are added to the edge; such bend points are regarded as repelling particles in the force model"),ct(0)),Cc),Za),rn(Fd)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Aoe),""),"FR Temperature"),"The temperature is used as a scaling factor for particle displacements."),Sd),qo),ma),rn(Fn)))),va(t,Aoe,Rz,ipt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Loe),""),"Eades Repulsion"),"Factor for repulsive forces in Eades' model."),5),qo),ma),rn(Fn)))),va(t,Loe,Rz,tpt),Slt((new rT,t))};var Zgt,Jgt,W7e,ept,tpt,npt,rpt,ipt;O(TC,"ForceMetaDataProvider",849),M(424,22,{3:1,35:1,22:1,424:1},h2e);var $ue,ZG,K7e=Gr(TC,"ForceModelStrategy",424,Wr,len,CYt),spt;M(988,1,zh,rT),l.Qe=function(t){Slt(t)};var apt,opt,Y7e,JG,X7e,cpt,upt,lpt,Q7e,hpt,Z7e,J7e,fpt,Q7,dpt,Hue,eEe,gpt,ppt,eq,zue;O(TC,"ForceOptions",988),M(989,1,{},N5),l.$e=function(){var t;return t=new dpe,t},l._e=function(t){},O(TC,"ForceOptions/ForceFactory",989);var fO,eS,kk,tq;M(850,1,zh,IJ),l.Qe=function(t){en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Y6e),""),"Fixed Position"),"Prevent that the node is moved by the layout algorithm."),(Mn(),!1)),(Ng(),za)),Us),rn((i1(),ua))))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,X6e),""),"Desired Edge Length"),"Either specified for parent nodes or for individual edges, where the latter takes higher precedence."),100),qo),ma),Ui(Fn,ie(re(Ug,1),tt,175,0,[Fd]))))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Q6e),""),"Layout Dimension"),"Dimensions that are permitted to be altered during layout."),tEe),vs),cEe),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Z6e),""),"Stress Epsilon"),"Termination criterion for the iterative process."),Sd),qo),ma),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,J6e),""),"Iteration Limit"),"Maximum number of performed iterations. Takes higher precedence than 'epsilon'."),ct(Ei)),Cc),Za),rn(Fn)))),hlt((new OJ,t))};var bpt,vpt,tEe,wpt,mpt,ypt;O(TC,"StressMetaDataProvider",850),M(992,1,zh,OJ),l.Qe=function(t){hlt(t)};var nq,nEe,rEe,iEe,sEe,aEe,kpt,xpt,Ept,Tpt,oEe,_pt;O(TC,"StressOptions",992),M(993,1,{},ah),l.$e=function(){var t;return t=new WUe,t},l._e=function(t){},O(TC,"StressOptions/StressFactory",993),M(1128,209,mb,WUe),l.Ze=function(t,n){var r,s,o,h,d;for(kr(n,eft,1),It(Mt(Ft(t,(ZD(),sEe))))?It(Mt(Ft(t,oEe)))||i$((r=new sr((Tm(),new ym(t))),r)):Iot(new dpe,t,Kc(n,1)),o=cnt(t),s=kut(this.a,o),d=s.Kc();d.Ob();)h=u(d.Pb(),231),!(h.e.c.length<=1)&&(Pvn(this.b,h),d0n(this.b),Mu(h.d,new od));o=Nlt(s),Dlt(o),ur(n)},O($z,"StressLayoutProvider",1128),M(1129,1,Un,od),l.td=function(t){q5e(u(t,447))},O($z,"StressLayoutProvider/lambda$0$Type",1129),M(990,1,{},nHe),l.c=0,l.e=0,l.g=0,O($z,"StressMajorization",990),M(379,22,{3:1,35:1,22:1,379:1},vte);var Gue,que,Vue,cEe=Gr($z,"StressMajorization/Dimension",379,Wr,Fen,SYt),Cpt;M(991,1,ji,Li),l.ue=function(t,n){return rYt(this.a,u(t,144),u(n,144))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O($z,"StressMajorization/lambda$0$Type",991),M(1229,1,{},cQe),O(pk,"ElkLayered",1229),M(1230,1,Un,P5),l.td=function(t){gdn(u(t,37))},O(pk,"ElkLayered/lambda$0$Type",1230),M(1231,1,Un,wi),l.td=function(t){iYt(this.a,u(t,37))},O(pk,"ElkLayered/lambda$1$Type",1231),M(1263,1,{},NVe);var Spt,Apt,Lpt;O(pk,"GraphConfigurator",1263),M(759,1,Un,Ts),l.td=function(t){Fst(this.a,u(t,10))},O(pk,"GraphConfigurator/lambda$0$Type",759),M(760,1,{},B5),l.Kb=function(t){return H3e(),new vn(null,new mn(u(t,29).a,16))},O(pk,"GraphConfigurator/lambda$1$Type",760),M(761,1,Un,Yi),l.td=function(t){Fst(this.a,u(t,10))},O(pk,"GraphConfigurator/lambda$2$Type",761),M(1127,209,mb,sHe),l.Ze=function(t,n){var r;r=nvn(new hHe,t),je(Ft(t,(pt(),Iy)))===je((F0(),Wg))?Non(this.a,r,n):Mdn(this.a,r,n),Clt(new PJ,r)},O(pk,"LayeredLayoutProvider",1127),M(356,22,{3:1,35:1,22:1,356:1},yM);var Pd,c2,bu,Zc,Go,uEe=Gr(pk,"LayeredPhases",356,Wr,knn,AYt),Mpt;M(1651,1,{},Yet),l.i=0;var Dpt;O($I,"ComponentsToCGraphTransformer",1651);var Ipt;M(1652,1,{},y9),l.ef=function(t,n){return b.Math.min(t.a!=null?Ue(t.a):t.c.i,n.a!=null?Ue(n.a):n.c.i)},l.ff=function(t,n){return b.Math.min(t.a!=null?Ue(t.a):t.c.i,n.a!=null?Ue(n.a):n.c.i)},O($I,"ComponentsToCGraphTransformer/1",1652),M(81,1,{81:1}),l.i=0,l.k=!0,l.o=Ds;var Uue=O(SC,"CNode",81);M(460,81,{460:1,81:1},fbe,d3e),l.Ib=function(){return""},O($I,"ComponentsToCGraphTransformer/CRectNode",460),M(1623,1,{},vL);var Wue,Kue;O($I,"OneDimensionalComponentsCompaction",1623),M(1624,1,{},v1),l.Kb=function(t){return Len(u(t,46))},l.Fb=function(t){return this===t},O($I,"OneDimensionalComponentsCompaction/lambda$0$Type",1624),M(1625,1,{},dp),l.Kb=function(t){return zon(u(t,46))},l.Fb=function(t){return this===t},O($I,"OneDimensionalComponentsCompaction/lambda$1$Type",1625),M(1654,1,{},iYe),O(SC,"CGraph",1654),M(189,1,{189:1},Wie),l.b=0,l.c=0,l.e=0,l.g=!0,l.i=Ds,O(SC,"CGroup",189),M(1653,1,{},om),l.ef=function(t,n){return b.Math.max(t.a!=null?Ue(t.a):t.c.i,n.a!=null?Ue(n.a):n.c.i)},l.ff=function(t,n){return b.Math.max(t.a!=null?Ue(t.a):t.c.i,n.a!=null?Ue(n.a):n.c.i)},O(SC,Aht,1653),M(1655,1,{},jat),l.d=!1;var Opt,Yue=O(SC,Dht,1655);M(1656,1,{},yc),l.Kb=function(t){return Zpe(),Mn(),u(u(t,46).a,81).d.e!=0},l.Fb=function(t){return this===t},O(SC,Iht,1656),M(823,1,{},xve),l.a=!1,l.b=!1,l.c=!1,l.d=!1,O(SC,Oht,823),M(1825,1,{},xKe),O(Hz,Nht,1825);var dO=ss(kb,Cht);M(1826,1,{369:1},JYe),l.Ke=function(t){Epn(this,u(t,466))},O(Hz,Pht,1826),M(1827,1,ji,hx),l.ue=function(t,n){return EJt(u(t,81),u(n,81))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Hz,Bht,1827),M(466,1,{466:1},d2e),l.a=!1,O(Hz,Rht,466),M(1828,1,ji,Vo),l.ue=function(t,n){return Pln(u(t,466),u(n,466))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Hz,Fht,1828),M(140,1,{140:1},r8,vve),l.Fb=function(t){var n;return t==null||v3n!=pl(t)?!1:(n=u(t,140),Vc(this.c,n.c)&&Vc(this.d,n.d))},l.Hb=function(){return fH(ie(re(Yn,1),yt,1,5,[this.c,this.d]))},l.Ib=function(){return"("+this.c+io+this.d+(this.a?"cx":"")+this.b+")"},l.a=!0,l.c=0,l.d=0;var v3n=O(kb,"Point",140);M(405,22,{3:1,35:1,22:1,405:1},RF);var vw,Ty,O4,_y,Npt=Gr(kb,"Point/Quadrant",405,Wr,jtn,LYt),Ppt;M(1642,1,{},aHe),l.b=null,l.c=null,l.d=null,l.e=null,l.f=null;var Bpt,Rpt,Fpt,jpt,$pt;O(kb,"RectilinearConvexHull",1642),M(574,1,{369:1},IH),l.Ke=function(t){xrn(this,u(t,140))},l.b=0;var lEe;O(kb,"RectilinearConvexHull/MaximalElementsEventHandler",574),M(1644,1,ji,am),l.ue=function(t,n){return fJt(ft(t),ft(n))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(kb,"RectilinearConvexHull/MaximalElementsEventHandler/lambda$0$Type",1644),M(1643,1,{369:1},vet),l.Ke=function(t){Bgn(this,u(t,140))},l.a=0,l.b=null,l.c=null,l.d=null,l.e=null,O(kb,"RectilinearConvexHull/RectangleEventHandler",1643),M(1645,1,ji,ev),l.ue=function(t,n){return ptn(u(t,140),u(n,140))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(kb,"RectilinearConvexHull/lambda$0$Type",1645),M(1646,1,ji,cd),l.ue=function(t,n){return btn(u(t,140),u(n,140))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(kb,"RectilinearConvexHull/lambda$1$Type",1646),M(1647,1,ji,fx),l.ue=function(t,n){return wtn(u(t,140),u(n,140))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(kb,"RectilinearConvexHull/lambda$2$Type",1647),M(1648,1,ji,oh),l.ue=function(t,n){return vtn(u(t,140),u(n,140))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(kb,"RectilinearConvexHull/lambda$3$Type",1648),M(1649,1,ji,QK),l.ue=function(t,n){return yfn(u(t,140),u(n,140))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(kb,"RectilinearConvexHull/lambda$4$Type",1649),M(1650,1,{},MXe),O(kb,"Scanline",1650),M(2005,1,{}),O(Ad,"AbstractGraphPlacer",2005),M(325,1,{325:1},xUe),l.mf=function(t){return this.nf(t)?(sn(this.b,u(K(t,(et(),Sy)),21),t),!0):!1},l.nf=function(t){var n,r,s,o;for(n=u(K(t,(et(),Sy)),21),o=u(Ii($i,n),21),s=o.Kc();s.Ob();)if(r=u(s.Pb(),21),!u(Ii(this.b,r),15).dc())return!1;return!0};var $i;O(Ad,"ComponentGroup",325),M(765,2005,{},vpe),l.of=function(t){var n,r;for(r=new C(this.a);r.aq&&(nt=0,bt+=z+o,z=0),le=d.c,cC(d,nt+le.a,bt+le.b),Zf(le),r=b.Math.max(r,nt+Ee.a),z=b.Math.max(z,Ee.b),nt+=Ee.a+o;if(n.f.a=r,n.f.b=bt+z,It(Mt(K(h,zq)))){for(s=new k9,l6e(s,t,o),P=t.Kc();P.Ob();)L=u(P.Pb(),37),Ni(Zf(L.c),s.e);Ni(Zf(n.f),s.a)}lme(n,t)},O(Ad,"SimpleRowGraphPlacer",1291),M(1292,1,ji,Vf),l.ue=function(t,n){return wsn(u(t,37),u(n,37))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Ad,"SimpleRowGraphPlacer/1",1292);var zpt;M(1262,1,_d,cm),l.Lb=function(t){var n;return n=u(K(u(t,243).b,(pt(),Fo)),74),!!n&&n.b!=0},l.Fb=function(t){return this===t},l.Mb=function(t){var n;return n=u(K(u(t,243).b,(pt(),Fo)),74),!!n&&n.b!=0},O(zz,"CompoundGraphPostprocessor/1",1262),M(1261,1,ps,fHe),l.pf=function(t,n){dit(this,u(t,37),n)},O(zz,"CompoundGraphPreprocessor",1261),M(441,1,{441:1},ert),l.c=!1,O(zz,"CompoundGraphPreprocessor/ExternalPort",441),M(243,1,{243:1},mj),l.Ib=function(){return nne(this.c)+":"+Pat(this.b)},O(zz,"CrossHierarchyEdge",243),M(763,1,ji,Di),l.ue=function(t,n){return oln(this,u(t,243),u(n,243))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(zz,"CrossHierarchyEdgeComparator",763),M(299,134,{3:1,299:1,94:1,134:1}),l.p=0,O(uu,"LGraphElement",299),M(17,299,{3:1,17:1,299:1,94:1,134:1},Iv),l.Ib=function(){return Pat(this)};var Que=O(uu,"LEdge",17);M(37,299,{3:1,20:1,37:1,299:1,94:1,134:1},Ime),l.Jc=function(t){Da(this,t)},l.Kc=function(){return new C(this.b)},l.Ib=function(){return this.b.c.length==0?"G-unlayered"+Yp(this.a):this.a.c.length==0?"G-layered"+Yp(this.b):"G[layerless"+Yp(this.a)+", layers"+Yp(this.b)+"]"};var Gpt=O(uu,"LGraph",37),qpt;M(657,1,{}),l.qf=function(){return this.e.n},l.We=function(t){return K(this.e,t)},l.rf=function(){return this.e.o},l.sf=function(){return this.e.p},l.Xe=function(t){return ta(this.e,t)},l.tf=function(t){this.e.n.a=t.a,this.e.n.b=t.b},l.uf=function(t){this.e.o.a=t.a,this.e.o.b=t.b},l.vf=function(t){this.e.p=t},O(uu,"LGraphAdapters/AbstractLShapeAdapter",657),M(577,1,{839:1},es),l.wf=function(){var t,n;if(!this.b)for(this.b=Wd(this.a.b.c.length),n=new C(this.a.b);n.a0&&$nt((zr(n-1,t.length),t.charCodeAt(n-1)),aft);)--n;if(h> ",t),zH(r)),Yr(Ec((t.a+="[",t),r.i),"]")),t.a},l.c=!0,l.d=!1;var pEe,bEe,vEe,wEe,mEe,yEe,Upt=O(uu,"LPort",11);M(397,1,i0,sa),l.Jc=function(t){Da(this,t)},l.Kc=function(){var t;return t=new C(this.a.e),new Ks(t)},O(uu,"LPort/1",397),M(1290,1,ga,Ks),l.Nb=function(t){La(this,t)},l.Pb=function(){return u(Y(this.a),17).c},l.Ob=function(){return nc(this.a)},l.Qb=function(){b_(this.a)},O(uu,"LPort/1/1",1290),M(359,1,i0,Ar),l.Jc=function(t){Da(this,t)},l.Kc=function(){var t;return t=new C(this.a.g),new We(t)},O(uu,"LPort/2",359),M(762,1,ga,We),l.Nb=function(t){La(this,t)},l.Pb=function(){return u(Y(this.a),17).d},l.Ob=function(){return nc(this.a)},l.Qb=function(){b_(this.a)},O(uu,"LPort/2/1",762),M(1283,1,i0,JGe),l.Jc=function(t){Da(this,t)},l.Kc=function(){return new N1(this)},O(uu,"LPort/CombineIter",1283),M(201,1,ga,N1),l.Nb=function(t){La(this,t)},l.Qb=function(){Eze()},l.Ob=function(){return s_(this)},l.Pb=function(){return nc(this.a)?Y(this.a):Y(this.b)},O(uu,"LPort/CombineIter/1",201),M(1285,1,_d,gp),l.Lb=function(t){return NKe(t)},l.Fb=function(t){return this===t},l.Mb=function(t){return Ku(),u(t,11).e.c.length!=0},O(uu,"LPort/lambda$0$Type",1285),M(1284,1,_d,um),l.Lb=function(t){return PKe(t)},l.Fb=function(t){return this===t},l.Mb=function(t){return Ku(),u(t,11).g.c.length!=0},O(uu,"LPort/lambda$1$Type",1284),M(1286,1,_d,JK),l.Lb=function(t){return Ku(),u(t,11).j==(ht(),An)},l.Fb=function(t){return this===t},l.Mb=function(t){return Ku(),u(t,11).j==(ht(),An)},O(uu,"LPort/lambda$2$Type",1286),M(1287,1,_d,R2),l.Lb=function(t){return Ku(),u(t,11).j==(ht(),$n)},l.Fb=function(t){return this===t},l.Mb=function(t){return Ku(),u(t,11).j==(ht(),$n)},O(uu,"LPort/lambda$3$Type",1287),M(1288,1,_d,eY),l.Lb=function(t){return Ku(),u(t,11).j==(ht(),xr)},l.Fb=function(t){return this===t},l.Mb=function(t){return Ku(),u(t,11).j==(ht(),xr)},O(uu,"LPort/lambda$4$Type",1288),M(1289,1,_d,tY),l.Lb=function(t){return Ku(),u(t,11).j==(ht(),Dn)},l.Fb=function(t){return this===t},l.Mb=function(t){return Ku(),u(t,11).j==(ht(),Dn)},O(uu,"LPort/lambda$5$Type",1289),M(29,299,{3:1,20:1,299:1,29:1,94:1,134:1},Bh),l.Jc=function(t){Da(this,t)},l.Kc=function(){return new C(this.a)},l.Ib=function(){return"L_"+Yo(this.b.b,this,0)+Yp(this.a)},O(uu,"Layer",29),M(1342,1,{},hHe),O(Rg,lft,1342),M(1346,1,{},R5),l.Kb=function(t){return zo(u(t,82))},O(Rg,"ElkGraphImporter/0methodref$connectableShapeToNode$Type",1346),M(1349,1,{},x9),l.Kb=function(t){return zo(u(t,82))},O(Rg,"ElkGraphImporter/1methodref$connectableShapeToNode$Type",1349),M(1343,1,Un,On),l.td=function(t){Yat(this.a,u(t,118))},O(Rg,hft,1343),M(1344,1,Un,Ir),l.td=function(t){Yat(this.a,u(t,118))},O(Rg,fft,1344),M(1345,1,{},VP),l.Kb=function(t){return new vn(null,new mn(oJt(u(t,79)),16))},O(Rg,dft,1345),M(1347,1,vi,ar),l.Mb=function(t){return cWt(this.a,u(t,33))},O(Rg,gft,1347),M(1348,1,{},dx),l.Kb=function(t){return new vn(null,new mn(cJt(u(t,79)),16))},O(Rg,"ElkGraphImporter/lambda$5$Type",1348),M(1350,1,vi,or),l.Mb=function(t){return uWt(this.a,u(t,33))},O(Rg,"ElkGraphImporter/lambda$7$Type",1350),M(1351,1,vi,nY),l.Mb=function(t){return _Jt(u(t,79))},O(Rg,"ElkGraphImporter/lambda$8$Type",1351),M(1278,1,{},PJ);var Wpt;O(Rg,"ElkGraphLayoutTransferrer",1278),M(1279,1,vi,qa),l.Mb=function(t){return QKt(this.a,u(t,17))},O(Rg,"ElkGraphLayoutTransferrer/lambda$0$Type",1279),M(1280,1,Un,qr),l.td=function(t){bM(),it(this.a,u(t,17))},O(Rg,"ElkGraphLayoutTransferrer/lambda$1$Type",1280),M(1281,1,vi,is),l.Mb=function(t){return BKt(this.a,u(t,17))},O(Rg,"ElkGraphLayoutTransferrer/lambda$2$Type",1281),M(1282,1,Un,Uo),l.td=function(t){bM(),it(this.a,u(t,17))},O(Rg,"ElkGraphLayoutTransferrer/lambda$3$Type",1282),M(1485,1,ps,gx),l.pf=function(t,n){Fin(u(t,37),n)},O(Pn,"CommentNodeMarginCalculator",1485),M(1486,1,{},rY),l.Kb=function(t){return new vn(null,new mn(u(t,29).a,16))},O(Pn,"CommentNodeMarginCalculator/lambda$0$Type",1486),M(1487,1,Un,iY),l.td=function(t){wvn(u(t,10))},O(Pn,"CommentNodeMarginCalculator/lambda$1$Type",1487),M(1488,1,ps,sY),l.pf=function(t,n){Dpn(u(t,37),n)},O(Pn,"CommentPostprocessor",1488),M(1489,1,ps,aY),l.pf=function(t,n){Fmn(u(t,37),n)},O(Pn,"CommentPreprocessor",1489),M(1490,1,ps,oY),l.pf=function(t,n){egn(u(t,37),n)},O(Pn,"ConstraintsPostprocessor",1490),M(1491,1,ps,cY),l.pf=function(t,n){osn(u(t,37),n)},O(Pn,"EdgeAndLayerConstraintEdgeReverser",1491),M(1492,1,ps,uY),l.pf=function(t,n){Yon(u(t,37),n)},O(Pn,"EndLabelPostprocessor",1492),M(1493,1,{},lY),l.Kb=function(t){return new vn(null,new mn(u(t,29).a,16))},O(Pn,"EndLabelPostprocessor/lambda$0$Type",1493),M(1494,1,vi,hY),l.Mb=function(t){return GJt(u(t,10))},O(Pn,"EndLabelPostprocessor/lambda$1$Type",1494),M(1495,1,Un,fY),l.td=function(t){Bln(u(t,10))},O(Pn,"EndLabelPostprocessor/lambda$2$Type",1495),M(1496,1,ps,dY),l.pf=function(t,n){_1n(u(t,37),n)},O(Pn,"EndLabelPreprocessor",1496),M(1497,1,{},mL),l.Kb=function(t){return new vn(null,new mn(u(t,29).a,16))},O(Pn,"EndLabelPreprocessor/lambda$0$Type",1497),M(1498,1,Un,_We),l.td=function(t){_Ut(this.a,this.b,this.c,u(t,10))},l.a=0,l.b=0,l.c=!1,O(Pn,"EndLabelPreprocessor/lambda$1$Type",1498),M(1499,1,vi,gY),l.Mb=function(t){return je(K(u(t,70),(pt(),Rd)))===je((P1(),TE))},O(Pn,"EndLabelPreprocessor/lambda$2$Type",1499),M(1500,1,Un,qc),l.td=function(t){ci(this.a,u(t,70))},O(Pn,"EndLabelPreprocessor/lambda$3$Type",1500),M(1501,1,vi,pY),l.Mb=function(t){return je(K(u(t,70),(pt(),Rd)))===je((P1(),zy))},O(Pn,"EndLabelPreprocessor/lambda$4$Type",1501),M(1502,1,Un,uo),l.td=function(t){ci(this.a,u(t,70))},O(Pn,"EndLabelPreprocessor/lambda$5$Type",1502),M(1551,1,ps,NJ),l.pf=function(t,n){ron(u(t,37),n)};var Kpt;O(Pn,"EndLabelSorter",1551),M(1552,1,ji,E9),l.ue=function(t,n){return Ocn(u(t,456),u(n,456))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Pn,"EndLabelSorter/1",1552),M(456,1,{456:1},VYe),O(Pn,"EndLabelSorter/LabelGroup",456),M(1553,1,{},UP),l.Kb=function(t){return vM(),new vn(null,new mn(u(t,29).a,16))},O(Pn,"EndLabelSorter/lambda$0$Type",1553),M(1554,1,vi,F5),l.Mb=function(t){return vM(),u(t,10).k==(zn(),Hs)},O(Pn,"EndLabelSorter/lambda$1$Type",1554),M(1555,1,Un,bY),l.td=function(t){Bfn(u(t,10))},O(Pn,"EndLabelSorter/lambda$2$Type",1555),M(1556,1,vi,vY),l.Mb=function(t){return vM(),je(K(u(t,70),(pt(),Rd)))===je((P1(),zy))},O(Pn,"EndLabelSorter/lambda$3$Type",1556),M(1557,1,vi,wY),l.Mb=function(t){return vM(),je(K(u(t,70),(pt(),Rd)))===je((P1(),TE))},O(Pn,"EndLabelSorter/lambda$4$Type",1557),M(1503,1,ps,mY),l.pf=function(t,n){Lvn(this,u(t,37))},l.b=0,l.c=0,O(Pn,"FinalSplineBendpointsCalculator",1503),M(1504,1,{},yY),l.Kb=function(t){return new vn(null,new mn(u(t,29).a,16))},O(Pn,"FinalSplineBendpointsCalculator/lambda$0$Type",1504),M(1505,1,{},T9),l.Kb=function(t){return new vn(null,new Sv(new cr(fr(js(u(t,10)).a.Kc(),new V))))},O(Pn,"FinalSplineBendpointsCalculator/lambda$1$Type",1505),M(1506,1,vi,yL),l.Mb=function(t){return!to(u(t,17))},O(Pn,"FinalSplineBendpointsCalculator/lambda$2$Type",1506),M(1507,1,vi,WP),l.Mb=function(t){return ta(u(t,17),(et(),Mb))},O(Pn,"FinalSplineBendpointsCalculator/lambda$3$Type",1507),M(1508,1,Un,Lc),l.td=function(t){z2n(this.a,u(t,128))},O(Pn,"FinalSplineBendpointsCalculator/lambda$4$Type",1508),M(1509,1,Un,v3),l.td=function(t){Nse(u(t,17).a)},O(Pn,"FinalSplineBendpointsCalculator/lambda$5$Type",1509),M(792,1,ps,Ra),l.pf=function(t,n){xwn(this,u(t,37),n)},O(Pn,"GraphTransformer",792),M(511,22,{3:1,35:1,22:1,511:1},f2e);var Jue,gO,Ypt=Gr(Pn,"GraphTransformer/Mode",511,Wr,hen,GXt),Xpt;M(1510,1,ps,w3),l.pf=function(t,n){Zgn(u(t,37),n)},O(Pn,"HierarchicalNodeResizingProcessor",1510),M(1511,1,ps,kY),l.pf=function(t,n){Oin(u(t,37),n)},O(Pn,"HierarchicalPortConstraintProcessor",1511),M(1512,1,ji,df),l.ue=function(t,n){return qcn(u(t,10),u(n,10))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Pn,"HierarchicalPortConstraintProcessor/NodeComparator",1512),M(1513,1,ps,j5),l.pf=function(t,n){Jbn(u(t,37),n)},O(Pn,"HierarchicalPortDummySizeProcessor",1513),M(1514,1,ps,xY),l.pf=function(t,n){Xpn(this,u(t,37),n)},l.a=0,O(Pn,"HierarchicalPortOrthogonalEdgeRouter",1514),M(1515,1,ji,px),l.ue=function(t,n){return tKt(u(t,10),u(n,10))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Pn,"HierarchicalPortOrthogonalEdgeRouter/1",1515),M(1516,1,ji,zd),l.ue=function(t,n){return prn(u(t,10),u(n,10))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Pn,"HierarchicalPortOrthogonalEdgeRouter/2",1516),M(1517,1,ps,EY),l.pf=function(t,n){kfn(u(t,37),n)},O(Pn,"HierarchicalPortPositionProcessor",1517),M(1518,1,ps,BJ),l.pf=function(t,n){byn(this,u(t,37))},l.a=0,l.c=0;var rq,iq;O(Pn,"HighDegreeNodeLayeringProcessor",1518),M(571,1,{571:1},TY),l.b=-1,l.d=-1,O(Pn,"HighDegreeNodeLayeringProcessor/HighDegreeNodeInformation",571),M(1519,1,{},_Y),l.Kb=function(t){return GM(),Xo(u(t,10))},l.Fb=function(t){return this===t},O(Pn,"HighDegreeNodeLayeringProcessor/lambda$0$Type",1519),M(1520,1,{},CY),l.Kb=function(t){return GM(),js(u(t,10))},l.Fb=function(t){return this===t},O(Pn,"HighDegreeNodeLayeringProcessor/lambda$1$Type",1520),M(1526,1,ps,_9),l.pf=function(t,n){Sbn(this,u(t,37),n)},O(Pn,"HyperedgeDummyMerger",1526),M(793,1,{},nve),l.a=!1,l.b=!1,l.c=!1,O(Pn,"HyperedgeDummyMerger/MergeState",793),M(1527,1,{},kL),l.Kb=function(t){return new vn(null,new mn(u(t,29).a,16))},O(Pn,"HyperedgeDummyMerger/lambda$0$Type",1527),M(1528,1,{},KP),l.Kb=function(t){return new vn(null,new mn(u(t,10).j,16))},O(Pn,"HyperedgeDummyMerger/lambda$1$Type",1528),M(1529,1,Un,xL),l.td=function(t){u(t,11).p=-1},O(Pn,"HyperedgeDummyMerger/lambda$2$Type",1529),M(1530,1,ps,$5),l.pf=function(t,n){_bn(u(t,37),n)},O(Pn,"HypernodesProcessor",1530),M(1531,1,ps,SY),l.pf=function(t,n){Cbn(u(t,37),n)},O(Pn,"InLayerConstraintProcessor",1531),M(1532,1,ps,YP),l.pf=function(t,n){nsn(u(t,37),n)},O(Pn,"InnermostNodeMarginCalculator",1532),M(1533,1,ps,XP),l.pf=function(t,n){Omn(this,u(t,37))},l.a=Ds,l.b=Ds,l.c=gs,l.d=gs;var w3n=O(Pn,"InteractiveExternalPortPositioner",1533);M(1534,1,{},AY),l.Kb=function(t){return u(t,17).d.i},l.Fb=function(t){return this===t},O(Pn,"InteractiveExternalPortPositioner/lambda$0$Type",1534),M(1535,1,{},lo),l.Kb=function(t){return iKt(this.a,ft(t))},l.Fb=function(t){return this===t},O(Pn,"InteractiveExternalPortPositioner/lambda$1$Type",1535),M(1536,1,{},LY),l.Kb=function(t){return u(t,17).c.i},l.Fb=function(t){return this===t},O(Pn,"InteractiveExternalPortPositioner/lambda$2$Type",1536),M(1537,1,{},Sl),l.Kb=function(t){return sKt(this.a,ft(t))},l.Fb=function(t){return this===t},O(Pn,"InteractiveExternalPortPositioner/lambda$3$Type",1537),M(1538,1,{},Yf),l.Kb=function(t){return KKt(this.a,ft(t))},l.Fb=function(t){return this===t},O(Pn,"InteractiveExternalPortPositioner/lambda$4$Type",1538),M(1539,1,{},mp),l.Kb=function(t){return YKt(this.a,ft(t))},l.Fb=function(t){return this===t},O(Pn,"InteractiveExternalPortPositioner/lambda$5$Type",1539),M(77,22,{3:1,35:1,22:1,77:1,234:1},Cs),l.Kf=function(){switch(this.g){case 15:return new VX;case 22:return new UX;case 47:return new YX;case 28:case 35:return new m3;case 32:return new gx;case 42:return new sY;case 1:return new aY;case 41:return new oY;case 56:return new Ra((j8(),gO));case 0:return new Ra((j8(),Jue));case 2:return new cY;case 54:return new uY;case 33:return new dY;case 51:return new mY;case 55:return new w3;case 13:return new kY;case 38:return new j5;case 44:return new xY;case 40:return new EY;case 9:return new BJ;case 49:return new hUe;case 37:return new _9;case 43:return new $5;case 27:return new SY;case 30:return new YP;case 3:return new XP;case 18:return new DY;case 29:return new IY;case 5:return new _R;case 50:return new MY;case 34:return new RJ;case 36:return new bx;case 52:return new NJ;case 11:return new lm;case 7:return new jJ;case 39:return new vx;case 45:return new BY;case 16:return new C9;case 10:return new ud;case 48:return new TL;case 21:return new wx;case 23:return new ete((Gv(),xS));case 8:return new eB;case 12:return new CL;case 4:return new FY;case 19:return new iT;case 17:return new GY;case 53:return new qY;case 6:return new oB;case 25:return new pHe;case 46:return new KY;case 31:return new YUe;case 14:return new AL;case 26:return new ZX;case 20:return new nX;case 24:return new ete((Gv(),cV));default:throw J(new Ln(Noe+(this.f!=null?this.f:""+this.g)))}};var kEe,xEe,EEe,TEe,_Ee,CEe,SEe,AEe,LEe,MEe,tS,sq,aq,DEe,IEe,OEe,NEe,PEe,BEe,REe,nS,FEe,jEe,$Ee,HEe,zEe,ele,oq,cq,GEe,uq,lq,hq,Z7,J7,eE,qEe,fq,dq,VEe,gq,pq,UEe,WEe,KEe,YEe,bq,tle,pO,vq,wq,mq,yq,XEe,QEe,ZEe,JEe,m3n=Gr(Pn,tke,77,Wr,Hot,zXt),Qpt;M(1540,1,ps,DY),l.pf=function(t,n){Pmn(u(t,37),n)},O(Pn,"InvertedPortProcessor",1540),M(1541,1,ps,IY),l.pf=function(t,n){P2n(u(t,37),n)},O(Pn,"LabelAndNodeSizeProcessor",1541),M(1542,1,vi,OY),l.Mb=function(t){return u(t,10).k==(zn(),Hs)},O(Pn,"LabelAndNodeSizeProcessor/lambda$0$Type",1542),M(1543,1,vi,Gd),l.Mb=function(t){return u(t,10).k==(zn(),Ls)},O(Pn,"LabelAndNodeSizeProcessor/lambda$1$Type",1543),M(1544,1,Un,CWe),l.td=function(t){CUt(this.b,this.a,this.c,u(t,10))},l.a=!1,l.c=!1,O(Pn,"LabelAndNodeSizeProcessor/lambda$2$Type",1544),M(1545,1,ps,_R),l.pf=function(t,n){smn(u(t,37),n)};var Zpt;O(Pn,"LabelDummyInserter",1545),M(1546,1,_d,tv),l.Lb=function(t){return je(K(u(t,70),(pt(),Rd)))===je((P1(),EE))},l.Fb=function(t){return this===t},l.Mb=function(t){return je(K(u(t,70),(pt(),Rd)))===je((P1(),EE))},O(Pn,"LabelDummyInserter/1",1546),M(1547,1,ps,MY),l.pf=function(t,n){own(u(t,37),n)},O(Pn,"LabelDummyRemover",1547),M(1548,1,vi,NY),l.Mb=function(t){return It(Mt(K(u(t,70),(pt(),Gle))))},O(Pn,"LabelDummyRemover/lambda$0$Type",1548),M(1359,1,ps,RJ),l.pf=function(t,n){Bwn(this,u(t,37),n)},l.a=null;var nle;O(Pn,"LabelDummySwitcher",1359),M(286,1,{286:1},jct),l.c=0,l.d=null,l.f=0,O(Pn,"LabelDummySwitcher/LabelDummyInfo",286),M(1360,1,{},QP),l.Kb=function(t){return U6(),new vn(null,new mn(u(t,29).a,16))},O(Pn,"LabelDummySwitcher/lambda$0$Type",1360),M(1361,1,vi,ZP),l.Mb=function(t){return U6(),u(t,10).k==(zn(),Rl)},O(Pn,"LabelDummySwitcher/lambda$1$Type",1361),M(1362,1,{},gg),l.Kb=function(t){return RKt(this.a,u(t,10))},O(Pn,"LabelDummySwitcher/lambda$2$Type",1362),M(1363,1,Un,fd),l.td=function(t){BZt(this.a,u(t,286))},O(Pn,"LabelDummySwitcher/lambda$3$Type",1363),M(1364,1,ji,PY),l.ue=function(t,n){return lZt(u(t,286),u(n,286))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Pn,"LabelDummySwitcher/lambda$4$Type",1364),M(791,1,ps,m3),l.pf=function(t,n){Wnn(u(t,37),n)},O(Pn,"LabelManagementProcessor",791),M(1549,1,ps,bx),l.pf=function(t,n){wpn(u(t,37),n)},O(Pn,"LabelSideSelector",1549),M(1550,1,vi,EL),l.Mb=function(t){return It(Mt(K(u(t,70),(pt(),Gle))))},O(Pn,"LabelSideSelector/lambda$0$Type",1550),M(1558,1,ps,lm),l.pf=function(t,n){evn(u(t,37),n)},O(Pn,"LayerConstraintPostprocessor",1558),M(1559,1,ps,jJ),l.pf=function(t,n){g0n(u(t,37),n)};var e9e;O(Pn,"LayerConstraintPreprocessor",1559),M(360,22,{3:1,35:1,22:1,360:1},FF);var bO,kq,xq,rle,Jpt=Gr(Pn,"LayerConstraintPreprocessor/HiddenNodeConnections",360,Wr,$tn,OYt),e2t;M(1560,1,ps,vx),l.pf=function(t,n){iwn(u(t,37),n)},O(Pn,"LayerSizeAndGraphHeightCalculator",1560),M(1561,1,ps,BY),l.pf=function(t,n){ogn(u(t,37),n)},O(Pn,"LongEdgeJoiner",1561),M(1562,1,ps,C9),l.pf=function(t,n){jvn(u(t,37),n)},O(Pn,"LongEdgeSplitter",1562),M(1563,1,ps,ud),l.pf=function(t,n){jwn(this,u(t,37),n)},l.d=0,l.e=0,l.i=0,l.j=0,l.k=0,l.n=0,O(Pn,"NodePromotion",1563),M(1564,1,{},JP),l.Kb=function(t){return u(t,46),Mn(),!0},l.Fb=function(t){return this===t},O(Pn,"NodePromotion/lambda$0$Type",1564),M(1565,1,{},yp),l.Kb=function(t){return rJt(this.a,u(t,46))},l.Fb=function(t){return this===t},l.a=0,O(Pn,"NodePromotion/lambda$1$Type",1565),M(1566,1,{},Xf),l.Kb=function(t){return iJt(this.a,u(t,46))},l.Fb=function(t){return this===t},l.a=0,O(Pn,"NodePromotion/lambda$2$Type",1566),M(1567,1,ps,TL),l.pf=function(t,n){uyn(u(t,37),n)},O(Pn,"NorthSouthPortPostprocessor",1567),M(1568,1,ps,wx),l.pf=function(t,n){Kmn(u(t,37),n)},O(Pn,"NorthSouthPortPreprocessor",1568),M(1569,1,ji,_L),l.ue=function(t,n){return Esn(u(t,11),u(n,11))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Pn,"NorthSouthPortPreprocessor/lambda$0$Type",1569),M(1570,1,ps,eB),l.pf=function(t,n){hbn(u(t,37),n)},O(Pn,"PartitionMidprocessor",1570),M(1571,1,vi,RY),l.Mb=function(t){return ta(u(t,10),(pt(),dE))},O(Pn,"PartitionMidprocessor/lambda$0$Type",1571),M(1572,1,Un,ov),l.td=function(t){CJt(this.a,u(t,10))},O(Pn,"PartitionMidprocessor/lambda$1$Type",1572),M(1573,1,ps,CL),l.pf=function(t,n){Sgn(u(t,37),n)},O(Pn,"PartitionPostprocessor",1573),M(1574,1,ps,FY),l.pf=function(t,n){Rdn(u(t,37),n)},O(Pn,"PartitionPreprocessor",1574),M(1575,1,vi,jY),l.Mb=function(t){return ta(u(t,10),(pt(),dE))},O(Pn,"PartitionPreprocessor/lambda$0$Type",1575),M(1576,1,{},tB),l.Kb=function(t){return new vn(null,new Sv(new cr(fr(js(u(t,10)).a.Kc(),new V))))},O(Pn,"PartitionPreprocessor/lambda$1$Type",1576),M(1577,1,vi,H5),l.Mb=function(t){return Mcn(u(t,17))},O(Pn,"PartitionPreprocessor/lambda$2$Type",1577),M(1578,1,Un,nB),l.td=function(t){Osn(u(t,17))},O(Pn,"PartitionPreprocessor/lambda$3$Type",1578),M(1579,1,ps,iT),l.pf=function(t,n){Y2n(u(t,37),n)};var t9e,t2t,n2t,r2t,n9e,r9e;O(Pn,"PortListSorter",1579),M(1580,1,{},z5),l.Kb=function(t){return X8(),u(t,11).e},O(Pn,"PortListSorter/lambda$0$Type",1580),M(1581,1,{},$Y),l.Kb=function(t){return X8(),u(t,11).g},O(Pn,"PortListSorter/lambda$1$Type",1581),M(1582,1,ji,SL),l.ue=function(t,n){return QQe(u(t,11),u(n,11))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Pn,"PortListSorter/lambda$2$Type",1582),M(1583,1,ji,HY),l.ue=function(t,n){return eln(u(t,11),u(n,11))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Pn,"PortListSorter/lambda$3$Type",1583),M(1584,1,ji,zY),l.ue=function(t,n){return cut(u(t,11),u(n,11))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Pn,"PortListSorter/lambda$4$Type",1584),M(1585,1,ps,GY),l.pf=function(t,n){c0n(u(t,37),n)},O(Pn,"PortSideProcessor",1585),M(1586,1,ps,qY),l.pf=function(t,n){u2n(u(t,37),n)},O(Pn,"ReversedEdgeRestorer",1586),M(1591,1,ps,pHe),l.pf=function(t,n){Fun(this,u(t,37),n)},O(Pn,"SelfLoopPortRestorer",1591),M(1592,1,{},rB),l.Kb=function(t){return new vn(null,new mn(u(t,29).a,16))},O(Pn,"SelfLoopPortRestorer/lambda$0$Type",1592),M(1593,1,vi,VY),l.Mb=function(t){return u(t,10).k==(zn(),Hs)},O(Pn,"SelfLoopPortRestorer/lambda$1$Type",1593),M(1594,1,vi,UY),l.Mb=function(t){return ta(u(t,10),(et(),lE))},O(Pn,"SelfLoopPortRestorer/lambda$2$Type",1594),M(1595,1,{},WY),l.Kb=function(t){return u(K(u(t,10),(et(),lE)),403)},O(Pn,"SelfLoopPortRestorer/lambda$3$Type",1595),M(1596,1,Un,mm),l.td=function(t){Wfn(this.a,u(t,403))},O(Pn,"SelfLoopPortRestorer/lambda$4$Type",1596),M(794,1,Un,iB),l.td=function(t){c1n(u(t,101))},O(Pn,"SelfLoopPortRestorer/lambda$5$Type",794),M(1597,1,ps,KY),l.pf=function(t,n){Wcn(u(t,37),n)},O(Pn,"SelfLoopPostProcessor",1597),M(1598,1,{},YY),l.Kb=function(t){return new vn(null,new mn(u(t,29).a,16))},O(Pn,"SelfLoopPostProcessor/lambda$0$Type",1598),M(1599,1,vi,XY),l.Mb=function(t){return u(t,10).k==(zn(),Hs)},O(Pn,"SelfLoopPostProcessor/lambda$1$Type",1599),M(1600,1,vi,sB),l.Mb=function(t){return ta(u(t,10),(et(),lE))},O(Pn,"SelfLoopPostProcessor/lambda$2$Type",1600),M(1601,1,Un,QY),l.td=function(t){ehn(u(t,10))},O(Pn,"SelfLoopPostProcessor/lambda$3$Type",1601),M(1602,1,{},ZY),l.Kb=function(t){return new vn(null,new mn(u(t,101).f,1))},O(Pn,"SelfLoopPostProcessor/lambda$4$Type",1602),M(1603,1,Un,l6),l.td=function(t){Gtn(this.a,u(t,409))},O(Pn,"SelfLoopPostProcessor/lambda$5$Type",1603),M(1604,1,vi,aB),l.Mb=function(t){return!!u(t,101).i},O(Pn,"SelfLoopPostProcessor/lambda$6$Type",1604),M(1605,1,Un,S3),l.td=function(t){SVt(this.a,u(t,101))},O(Pn,"SelfLoopPostProcessor/lambda$7$Type",1605),M(1587,1,ps,oB),l.pf=function(t,n){$0n(u(t,37),n)},O(Pn,"SelfLoopPreProcessor",1587),M(1588,1,{},cB),l.Kb=function(t){return new vn(null,new mn(u(t,101).f,1))},O(Pn,"SelfLoopPreProcessor/lambda$0$Type",1588),M(1589,1,{},JY),l.Kb=function(t){return u(t,409).a},O(Pn,"SelfLoopPreProcessor/lambda$1$Type",1589),M(1590,1,Un,eX),l.td=function(t){IWt(u(t,17))},O(Pn,"SelfLoopPreProcessor/lambda$2$Type",1590),M(1606,1,ps,YUe),l.pf=function(t,n){Rfn(this,u(t,37),n)},O(Pn,"SelfLoopRouter",1606),M(1607,1,{},mx),l.Kb=function(t){return new vn(null,new mn(u(t,29).a,16))},O(Pn,"SelfLoopRouter/lambda$0$Type",1607),M(1608,1,vi,G5),l.Mb=function(t){return u(t,10).k==(zn(),Hs)},O(Pn,"SelfLoopRouter/lambda$1$Type",1608),M(1609,1,vi,S9),l.Mb=function(t){return ta(u(t,10),(et(),lE))},O(Pn,"SelfLoopRouter/lambda$2$Type",1609),M(1610,1,{},tX),l.Kb=function(t){return u(K(u(t,10),(et(),lE)),403)},O(Pn,"SelfLoopRouter/lambda$3$Type",1610),M(1611,1,Un,VGe),l.td=function(t){vJt(this.a,this.b,u(t,403))},O(Pn,"SelfLoopRouter/lambda$4$Type",1611),M(1612,1,ps,AL),l.pf=function(t,n){apn(u(t,37),n)},O(Pn,"SemiInteractiveCrossMinProcessor",1612),M(1613,1,vi,A9),l.Mb=function(t){return u(t,10).k==(zn(),Hs)},O(Pn,"SemiInteractiveCrossMinProcessor/lambda$0$Type",1613),M(1614,1,vi,LL),l.Mb=function(t){return hKe(u(t,10))._b((pt(),By))},O(Pn,"SemiInteractiveCrossMinProcessor/lambda$1$Type",1614),M(1615,1,ji,uB),l.ue=function(t,n){return Pin(u(t,10),u(n,10))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Pn,"SemiInteractiveCrossMinProcessor/lambda$2$Type",1615),M(1616,1,{},lB),l.Ce=function(t,n){return NJt(u(t,10),u(n,10))},O(Pn,"SemiInteractiveCrossMinProcessor/lambda$3$Type",1616),M(1618,1,ps,nX),l.pf=function(t,n){tvn(u(t,37),n)},O(Pn,"SortByInputModelProcessor",1618),M(1619,1,vi,rX),l.Mb=function(t){return u(t,11).g.c.length!=0},O(Pn,"SortByInputModelProcessor/lambda$0$Type",1619),M(1620,1,Un,h6),l.td=function(t){d1n(this.a,u(t,11))},O(Pn,"SortByInputModelProcessor/lambda$1$Type",1620),M(1693,803,{},ctt),l.Me=function(t){var n,r,s,o;switch(this.c=t,this.a.g){case 2:n=new st,ms(Vi(new vn(null,new mn(this.c.a.b,16)),new gB),new XGe(this,n)),sI(this,new fB),Mu(n,new sX),n.c=Me(Yn,yt,1,0,5,1),ms(Vi(new vn(null,new mn(this.c.a.b,16)),new aX),new A3(n)),sI(this,new oX),Mu(n,new cX),n.c=Me(Yn,yt,1,0,5,1),r=LVe(ktt(Kj(new vn(null,new mn(this.c.a.b,16)),new qd(this))),new uX),ms(new vn(null,new mn(this.c.a.a,16)),new WGe(r,n)),sI(this,new lX),Mu(n,new iX),n.c=Me(Yn,yt,1,0,5,1);break;case 3:s=new st,sI(this,new hB),o=LVe(ktt(Kj(new vn(null,new mn(this.c.a.b,16)),new gT(this))),new dB),ms(Vi(new vn(null,new mn(this.c.a.b,16)),new hX),new YGe(o,s)),sI(this,new fX),Mu(s,new dX),s.c=Me(Yn,yt,1,0,5,1);break;default:throw J(new eHe)}},l.b=0,O(Is,"EdgeAwareScanlineConstraintCalculation",1693),M(1694,1,_d,hB),l.Lb=function(t){return we(u(t,57).g,145)},l.Fb=function(t){return this===t},l.Mb=function(t){return we(u(t,57).g,145)},O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$0$Type",1694),M(1695,1,{},gT),l.Fe=function(t){return U1n(this.a,u(t,57))},O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$1$Type",1695),M(1703,1,Az,UGe),l.Vd=function(){Z_(this.a,this.b,-1)},l.b=0,O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$10$Type",1703),M(1705,1,_d,fB),l.Lb=function(t){return we(u(t,57).g,145)},l.Fb=function(t){return this===t},l.Mb=function(t){return we(u(t,57).g,145)},O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$11$Type",1705),M(1706,1,Un,sX),l.td=function(t){u(t,365).Vd()},O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$12$Type",1706),M(1707,1,vi,aX),l.Mb=function(t){return we(u(t,57).g,10)},O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$13$Type",1707),M(1709,1,Un,A3),l.td=function(t){mon(this.a,u(t,57))},O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$14$Type",1709),M(1708,1,Az,eqe),l.Vd=function(){Z_(this.b,this.a,-1)},l.a=0,O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$15$Type",1708),M(1710,1,_d,oX),l.Lb=function(t){return we(u(t,57).g,10)},l.Fb=function(t){return this===t},l.Mb=function(t){return we(u(t,57).g,10)},O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$16$Type",1710),M(1711,1,Un,cX),l.td=function(t){u(t,365).Vd()},O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$17$Type",1711),M(1712,1,{},qd),l.Fe=function(t){return W1n(this.a,u(t,57))},O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$18$Type",1712),M(1713,1,{},uX),l.De=function(){return 0},O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$19$Type",1713),M(1696,1,{},dB),l.De=function(){return 0},O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$2$Type",1696),M(1715,1,Un,WGe),l.td=function(t){eZt(this.a,this.b,u(t,307))},l.a=0,O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$20$Type",1715),M(1714,1,Az,KGe),l.Vd=function(){wot(this.a,this.b,-1)},l.b=0,O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$21$Type",1714),M(1716,1,_d,lX),l.Lb=function(t){return u(t,57),!0},l.Fb=function(t){return this===t},l.Mb=function(t){return u(t,57),!0},O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$22$Type",1716),M(1717,1,Un,iX),l.td=function(t){u(t,365).Vd()},O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$23$Type",1717),M(1697,1,vi,hX),l.Mb=function(t){return we(u(t,57).g,10)},O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$3$Type",1697),M(1699,1,Un,YGe),l.td=function(t){tZt(this.a,this.b,u(t,57))},l.a=0,O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$4$Type",1699),M(1698,1,Az,tqe),l.Vd=function(){Z_(this.b,this.a,-1)},l.a=0,O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$5$Type",1698),M(1700,1,_d,fX),l.Lb=function(t){return u(t,57),!0},l.Fb=function(t){return this===t},l.Mb=function(t){return u(t,57),!0},O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$6$Type",1700),M(1701,1,Un,dX),l.td=function(t){u(t,365).Vd()},O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$7$Type",1701),M(1702,1,vi,gB),l.Mb=function(t){return we(u(t,57).g,145)},O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$8$Type",1702),M(1704,1,Un,XGe),l.td=function(t){Zrn(this.a,this.b,u(t,57))},O(Is,"EdgeAwareScanlineConstraintCalculation/lambda$9$Type",1704),M(1521,1,ps,hUe),l.pf=function(t,n){Uvn(this,u(t,37),n)};var i2t;O(Is,"HorizontalGraphCompactor",1521),M(1522,1,{},_1),l.Oe=function(t,n){var r,s,o;return mme(t,n)||(r=U3(t),s=U3(n),r&&r.k==(zn(),Ls)||s&&s.k==(zn(),Ls))?0:(o=u(K(this.a.a,(et(),G4)),304),aKt(o,r?r.k:(zn(),ca),s?s.k:(zn(),ca)))},l.Pe=function(t,n){var r,s,o;return mme(t,n)?1:(r=U3(t),s=U3(n),o=u(K(this.a.a,(et(),G4)),304),gbe(o,r?r.k:(zn(),ca),s?s.k:(zn(),ca)))},O(Is,"HorizontalGraphCompactor/1",1522),M(1523,1,{},L9),l.Ne=function(t,n){return IT(),t.a.i==0},O(Is,"HorizontalGraphCompactor/lambda$0$Type",1523),M(1524,1,{},Vd),l.Ne=function(t,n){return MJt(this.a,t,n)},O(Is,"HorizontalGraphCompactor/lambda$1$Type",1524),M(1664,1,{},VJe);var s2t,a2t;O(Is,"LGraphToCGraphTransformer",1664),M(1672,1,vi,gX),l.Mb=function(t){return t!=null},O(Is,"LGraphToCGraphTransformer/0methodref$nonNull$Type",1672),M(1665,1,{},pX),l.Kb=function(t){return mf(),Qo(K(u(u(t,57).g,10),(et(),Mi)))},O(Is,"LGraphToCGraphTransformer/lambda$0$Type",1665),M(1666,1,{},pB),l.Kb=function(t){return mf(),Xnt(u(u(t,57).g,145))},O(Is,"LGraphToCGraphTransformer/lambda$1$Type",1666),M(1675,1,vi,bX),l.Mb=function(t){return mf(),we(u(t,57).g,10)},O(Is,"LGraphToCGraphTransformer/lambda$10$Type",1675),M(1676,1,Un,vX),l.td=function(t){LJt(u(t,57))},O(Is,"LGraphToCGraphTransformer/lambda$11$Type",1676),M(1677,1,vi,wX),l.Mb=function(t){return mf(),we(u(t,57).g,145)},O(Is,"LGraphToCGraphTransformer/lambda$12$Type",1677),M(1681,1,Un,mX),l.td=function(t){Nan(u(t,57))},O(Is,"LGraphToCGraphTransformer/lambda$13$Type",1681),M(1678,1,Un,pT),l.td=function(t){iWt(this.a,u(t,8))},l.a=0,O(Is,"LGraphToCGraphTransformer/lambda$14$Type",1678),M(1679,1,Un,$2),l.td=function(t){aWt(this.a,u(t,110))},l.a=0,O(Is,"LGraphToCGraphTransformer/lambda$15$Type",1679),M(1680,1,Un,QR),l.td=function(t){sWt(this.a,u(t,8))},l.a=0,O(Is,"LGraphToCGraphTransformer/lambda$16$Type",1680),M(1682,1,{},yX),l.Kb=function(t){return mf(),new vn(null,new Sv(new cr(fr(js(u(t,10)).a.Kc(),new V))))},O(Is,"LGraphToCGraphTransformer/lambda$17$Type",1682),M(1683,1,vi,kX),l.Mb=function(t){return mf(),to(u(t,17))},O(Is,"LGraphToCGraphTransformer/lambda$18$Type",1683),M(1684,1,Un,Dee),l.td=function(t){$rn(this.a,u(t,17))},O(Is,"LGraphToCGraphTransformer/lambda$19$Type",1684),M(1668,1,Un,Iee),l.td=function(t){ytn(this.a,u(t,145))},O(Is,"LGraphToCGraphTransformer/lambda$2$Type",1668),M(1685,1,{},bB),l.Kb=function(t){return mf(),new vn(null,new mn(u(t,29).a,16))},O(Is,"LGraphToCGraphTransformer/lambda$20$Type",1685),M(1686,1,{},xX),l.Kb=function(t){return mf(),new vn(null,new Sv(new cr(fr(js(u(t,10)).a.Kc(),new V))))},O(Is,"LGraphToCGraphTransformer/lambda$21$Type",1686),M(1687,1,{},vB),l.Kb=function(t){return mf(),u(K(u(t,17),(et(),Mb)),15)},O(Is,"LGraphToCGraphTransformer/lambda$22$Type",1687),M(1688,1,vi,EX),l.Mb=function(t){return cKt(u(t,15))},O(Is,"LGraphToCGraphTransformer/lambda$23$Type",1688),M(1689,1,Un,Oee),l.td=function(t){R1n(this.a,u(t,15))},O(Is,"LGraphToCGraphTransformer/lambda$24$Type",1689),M(1667,1,Un,QGe),l.td=function(t){onn(this.a,this.b,u(t,145))},O(Is,"LGraphToCGraphTransformer/lambda$3$Type",1667),M(1669,1,{},TX),l.Kb=function(t){return mf(),new vn(null,new mn(u(t,29).a,16))},O(Is,"LGraphToCGraphTransformer/lambda$4$Type",1669),M(1670,1,{},_X),l.Kb=function(t){return mf(),new vn(null,new Sv(new cr(fr(js(u(t,10)).a.Kc(),new V))))},O(Is,"LGraphToCGraphTransformer/lambda$5$Type",1670),M(1671,1,{},M9),l.Kb=function(t){return mf(),u(K(u(t,17),(et(),Mb)),15)},O(Is,"LGraphToCGraphTransformer/lambda$6$Type",1671),M(1673,1,Un,Nee),l.td=function(t){pdn(this.a,u(t,15))},O(Is,"LGraphToCGraphTransformer/lambda$8$Type",1673),M(1674,1,Un,ZGe),l.td=function(t){AWt(this.a,this.b,u(t,145))},O(Is,"LGraphToCGraphTransformer/lambda$9$Type",1674),M(1663,1,{},CX),l.Le=function(t){var n,r,s,o,h;for(this.a=t,this.d=new Gee,this.c=Me(R7e,yt,121,this.a.a.a.c.length,0,1),this.b=0,r=new C(this.a.a.a);r.a=X&&(it(h,ct(L)),Ee=b.Math.max(Ee,Ne[L-1]-P),v+=W,le+=Ne[L-1]-le,P=Ne[L-1],W=x[L]),W=b.Math.max(W,x[L]),++L;v+=W}q=b.Math.min(1/Ee,1/n.b/v),q>s&&(s=q,r=h)}return r},l.Wf=function(){return!1},O(Ld,"MSDCutIndexHeuristic",802),M(1617,1,ps,ZX),l.pf=function(t,n){Wbn(u(t,37),n)},O(Ld,"SingleEdgeGraphWrapper",1617),M(227,22,{3:1,35:1,22:1,227:1},jT);var B4,rE,iE,Cy,rS,R4,sE=Gr(Ic,"CenterEdgeLabelPlacementStrategy",227,Wr,irn,BYt),w2t;M(422,22,{3:1,35:1,22:1,422:1},g2e);var s9e,gle,a9e=Gr(Ic,"ConstraintCalculationStrategy",422,Wr,KJt,RYt),m2t;M(314,22,{3:1,35:1,22:1,314:1,246:1,234:1},yte),l.Kf=function(){return Lat(this)},l.Xf=function(){return Lat(this)};var vO,Ek,o9e,c9e=Gr(Ic,"CrossingMinimizationStrategy",314,Wr,$en,FYt),y2t;M(337,22,{3:1,35:1,22:1,337:1},kte);var u9e,ple,Aq,l9e=Gr(Ic,"CuttingStrategy",337,Wr,Hen,HYt),k2t;M(335,22,{3:1,35:1,22:1,335:1,246:1,234:1},xM),l.Kf=function(){return pot(this)},l.Xf=function(){return pot(this)};var h9e,ble,iS,vle,sS,f9e=Gr(Ic,"CycleBreakingStrategy",335,Wr,Mnn,zYt),x2t;M(419,22,{3:1,35:1,22:1,419:1},p2e);var Lq,d9e,g9e=Gr(Ic,"DirectionCongruency",419,Wr,WJt,GYt),E2t;M(450,22,{3:1,35:1,22:1,450:1},xte);var aE,wle,F4,T2t=Gr(Ic,"EdgeConstraint",450,Wr,zen,qYt),_2t;M(276,22,{3:1,35:1,22:1,276:1},$T);var mle,yle,kle,xle,Mq,Ele,p9e=Gr(Ic,"EdgeLabelSideSelection",276,Wr,crn,VYt),C2t;M(479,22,{3:1,35:1,22:1,479:1},b2e);var Dq,b9e,v9e=Gr(Ic,"EdgeStraighteningStrategy",479,Wr,UJt,UYt),S2t;M(274,22,{3:1,35:1,22:1,274:1},HT);var Tle,w9e,m9e,Iq,y9e,k9e,x9e=Gr(Ic,"FixedAlignment",274,Wr,arn,WYt),A2t;M(275,22,{3:1,35:1,22:1,275:1},zT);var E9e,T9e,_9e,C9e,aS,S9e,A9e=Gr(Ic,"GraphCompactionStrategy",275,Wr,srn,KYt),L2t;M(256,22,{3:1,35:1,22:1,256:1},_m);var oE,Oq,cE,Th,oS,Nq,uE,j4,Pq,cS,_le=Gr(Ic,"GraphProperties",256,Wr,Win,YYt),M2t;M(292,22,{3:1,35:1,22:1,292:1},Ete);var wO,Cle,Sle,Ale=Gr(Ic,"GreedySwitchType",292,Wr,Ven,XYt),D2t;M(303,22,{3:1,35:1,22:1,303:1},Tte);var Tk,mO,$4,I2t=Gr(Ic,"InLayerConstraint",303,Wr,qen,QYt),O2t;M(420,22,{3:1,35:1,22:1,420:1},v2e);var Lle,L9e,M9e=Gr(Ic,"InteractiveReferencePoint",420,Wr,YJt,ZYt),N2t,D9e,_k,yw,Bq,I9e,O9e,Rq,N9e,yO,Fq,uS,Ck,Sy,Mle,jq,vc,P9e,kw,eu,Dle,Ile,kO,Lb,xw,Sk,B9e,Ak,xO,Ay,l1,Yh,Ole,H4,Nc,Mi,R9e,F9e,j9e,$9e,H9e,Nle,$q,cl,Ew,Ple,Lk,EO,W1,z4,lE,G4,q4,hE,Mb,z9e,Ble,Rle,Mk;M(163,22,{3:1,35:1,22:1,163:1},TM);var lS,l2,hS,Ly,TO,G9e=Gr(Ic,"LayerConstraint",163,Wr,Onn,JYt),P2t;M(848,1,zh,VJ),l.Qe=function(t){en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,nke),""),"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."),J9e),(Ng(),vs)),g9e),rn((i1(),Fn))))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,rke),""),"Feedback Edges"),"Whether feedback edges should be highlighted by routing around the nodes."),(Mn(),!1)),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Gz),""),"Interactive Reference Point"),"Determines which point of a node is considered by interactive layout phases."),sTe),vs),M9e),rn(Fn)))),va(t,Gz,Roe,Cbt),va(t,Gz,MC,_bt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,ike),""),"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."),!1),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,ske),""),"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."),!0),za),Us),rn(Fn)))),en(t,new Vt(sUt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,ake),""),"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."),!1),za),Us),rn(Bb)),ie(re(mt,1),Qe,2,6,["org.eclipse.elk.layered.northOrSouthPort"])))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,oke),""),"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."),dTe),vs),k_e),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,cke),""),"Thoroughness"),"How much effort should be spent to produce a nice layout."),ct(7)),Cc),Za),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,uke),""),"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."),!1),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,lke),""),"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."),!1),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Roe),"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)."),Z9e),vs),f9e),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,GI),oce),"Node Layering Strategy"),"Strategy for node layering."),cTe),vs),u_e),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,hke),oce),"Layer Constraint"),"Determines a constraint on the placement of the node regarding the layering."),aTe),vs),G9e),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,fke),oce),"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."),ct(-1)),Cc),Za),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,dke),oce),"Layer ID"),"Layer identifier that was calculated by ELK Layered for a node. This is only generated if interactiveLayot or generatePositionAndLayerIds is set."),ct(-1)),Cc),Za),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Foe),_ft),"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."),ct(4)),Cc),Za),rn(Fn)))),va(t,Foe,GI,Obt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,joe),_ft),"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."),ct(2)),Cc),Za),rn(Fn)))),va(t,joe,GI,Pbt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,$oe),Cft),"Node Promotion Strategy"),"Reduces number of dummy nodes after layering phase (if possible)."),oTe),vs),w_e),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Hoe),Cft),"Max Node Promotion Iterations"),"Limits the number of iterations for node promotion."),ct(0)),Cc),Za),rn(Fn)))),va(t,Hoe,$oe,null),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,zoe),"layering.coffmanGraham"),"Layer Bound"),"The maximum number of nodes allowed per layer."),ct(Ei)),Cc),Za),rn(Fn)))),va(t,zoe,GI,Abt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,MC),qI),"Crossing Minimization Strategy"),"Strategy for crossing minimization."),Q9e),vs),c9e),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,gke),qI),"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."),!1),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Goe),qI),"Hierarchical Sweepiness"),"How likely it is to use cross-hierarchy (1) vs bottom-up (-1)."),.1),qo),ma),rn(Fn)))),va(t,Goe,nG,ebt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,qoe),qI),"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."),!1),za),Us),rn(Fn)))),va(t,qoe,MC,ibt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,pke),qI),"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."),ct(-1)),Cc),Za),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,bke),qI),"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."),ct(-1)),Cc),Za),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,vke),Sft),"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."),ct(40)),Cc),Za),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Voe),Sft),"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."),X9e),vs),Ale),rn(Fn)))),va(t,Voe,MC,Z2t),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,qz),"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."),Y9e),vs),Ale),rn(Fn)))),va(t,qz,MC,Y2t),va(t,qz,nG,X2t),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,T4),Aft),"Node Placement Strategy"),"Strategy for node placement."),fTe),vs),d_e),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,Vz),Aft),"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."),za),Us),rn(Fn)))),va(t,Vz,T4,Ubt),va(t,Vz,T4,Wbt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Uoe),Lft),"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."),uTe),vs),v9e),rn(Fn)))),va(t,Uoe,T4,zbt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Woe),Lft),"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."),lTe),vs),x9e),rn(Fn)))),va(t,Woe,T4,qbt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Koe),"nodePlacement.linearSegments"),"Linear Segments Deflection Dampening"),"Dampens the movement of nodes to keep the diagram from getting too large."),.3),qo),ma),rn(Fn)))),va(t,Koe,T4,Ybt),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,Yoe),"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."),vs),ahe),rn(ua)))),va(t,Yoe,T4,Jbt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Xoe),"nodePlacement.networkSimplex.nodeFlexibility"),"Node Flexibility Default"),"Default value of the 'nodeFlexibility' option for the children of a hierarchical node."),hTe),vs),ahe),rn(Fn)))),va(t,Xoe,T4,Zbt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,wke),Mft),"Self-Loop Distribution"),"Alter the distribution of the loops around the node. It only takes effect for PortConstraints.FREE."),nTe),vs),T_e),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,mke),Mft),"Self-Loop Ordering"),"Alter the ordering of the loops they can either be stacked or sequenced. It only takes effect for PortConstraints.FREE."),rTe),vs),__e),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Uz),"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."),iTe),vs),S_e),rn(Fn)))),va(t,Uz,VI,pbt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Wz),"edgeRouting.splines.sloppy"),"Sloppy Spline Layer Spacing Factor"),"Spacing factor for routing area between layers when using sloppy spline routing."),.2),qo),ma),rn(Fn)))),va(t,Wz,VI,vbt),va(t,Wz,Uz,wbt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Qoe),"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),qo),ma),rn(Fn)))),va(t,Qoe,VI,hbt),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,yke),G1),"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."),qo),ma),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,kke),G1),"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),qo),ma),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,xke),G1),"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),qo),ma),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Eke),G1),"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),qo),ma),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Tke),Oke),"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."),ct(0)),Cc),Za),rn(Fd)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,_ke),Oke),"Shortness Priority"),"Defines how important it is to keep an edge as short as possible. This option is evaluated during the layering phase."),ct(0)),Cc),Za),rn(Fd)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Cke),Oke),"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."),ct(0)),Cc),Za),rn(Fd)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Zoe),Nke),Uht),"Tries to further compact components (disconnected sub-graphs)."),!1),za),Us),rn(Fn)))),va(t,Zoe,_C,!0),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Ske),Dft),"Post Compaction Strategy"),Ift),V9e),vs),A9e),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Ake),Dft),"Post Compaction Constraint Calculation"),Ift),q9e),vs),a9e),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Kz),Pke),"High Degree Node Treatment"),"Makes room around high degree nodes to place leafs and trees."),!1),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Joe),Pke),"High Degree Node Threshold"),"Whether a node is considered to have a high degree."),ct(16)),Cc),Za),rn(Fn)))),va(t,Joe,Kz,!0),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,ece),Pke),"High Degree Node Maximum Tree Height"),"Maximum height of a subtree connected to a high degree node to be moved to separate layers."),ct(5)),Cc),Za),rn(Fn)))),va(t,ece,Kz,!0),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,W0),Bke),"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'."),bTe),vs),D_e),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Yz),Bke),"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),qo),ma),rn(Fn)))),va(t,Yz,W0,fvt),va(t,Yz,W0,dvt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Xz),Bke),"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),qo),ma),rn(Fn)))),va(t,Xz,W0,pvt),va(t,Xz,W0,bvt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,DC),Oft),"Cutting Strategy"),"The strategy by which the layer indexes are determined at which the layering crumbles into chunks."),pTe),vs),l9e),rn(Fn)))),va(t,DC,W0,xvt),va(t,DC,W0,Evt),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,tce),Oft),"Manually Specified Cuts"),"Allows the user to specify her own cuts for a certain graph."),Y1),Eh),rn(Fn)))),va(t,tce,DC,wvt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,nce),"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."),gTe),Cc),Za),rn(Fn)))),va(t,nce,DC,yvt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Qz),Nft),"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."),vTe),vs),M_e),rn(Fn)))),va(t,Qz,W0,Pvt),va(t,Qz,W0,Bvt),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,Zz),Nft),"Valid Indices for Wrapping"),null),Y1),Eh),rn(Fn)))),va(t,Zz,W0,Ivt),va(t,Zz,W0,Ovt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Jz),Rke),"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."),!0),za),Us),rn(Fn)))),va(t,Jz,W0,Svt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,eG),Rke),"Distance Penalty When Improving Cuts"),null),2),qo),ma),rn(Fn)))),va(t,eG,W0,_vt),va(t,eG,Jz,!0),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,rce),Rke),"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."),!0),za),Us),rn(Fn)))),va(t,rce,W0,Lvt),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Lke),cce),"Edge Label Side Selection"),"Method to decide on edge label sides."),tTe),vs),p9e),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Mke),cce),"Edge Center Label Placement Strategy"),"Determines in which layer center labels of long edges should be placed."),eTe),vs),sE),Ui(Fn,ie(re(Ug,1),tt,175,0,[Vg]))))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,tG),UI),"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."),K9e),vs),y_e),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Dke),UI),"No Model Order"),"Set on a node to not set a model order for this node even though it is a real node."),!1),za),Us),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,ice),UI),"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."),U9e),vs),fEe),rn(Fn)))),va(t,ice,_C,null),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Ike),UI),"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."),W9e),vs),h_e),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,sce),UI),"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),qo),ma),rn(Fn)))),va(t,sce,tG,null),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,ace),UI),"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),qo),ma),rn(Fn)))),va(t,ace,tG,null),Qlt((new SR,t))};var B2t,R2t,F2t,q9e,j2t,V9e,$2t,U9e,H2t,z2t,G2t,W9e,q2t,V2t,K9e,U2t,W2t,K2t,Y9e,Y2t,X2t,Q2t,X9e,Z2t,J2t,ebt,tbt,nbt,rbt,ibt,sbt,Q9e,abt,Z9e,obt,J9e,cbt,eTe,ubt,tTe,lbt,hbt,fbt,nTe,dbt,rTe,gbt,iTe,pbt,bbt,vbt,wbt,mbt,ybt,kbt,xbt,Ebt,Tbt,sTe,_bt,Cbt,Sbt,Abt,Lbt,Mbt,aTe,Dbt,Ibt,Obt,Nbt,Pbt,Bbt,Rbt,oTe,Fbt,cTe,jbt,$bt,Hbt,uTe,zbt,Gbt,lTe,qbt,Vbt,Ubt,Wbt,Kbt,Ybt,Xbt,Qbt,hTe,Zbt,Jbt,evt,fTe,tvt,dTe,nvt,rvt,ivt,svt,avt,ovt,cvt,uvt,lvt,hvt,fvt,dvt,gvt,pvt,bvt,vvt,wvt,mvt,gTe,yvt,kvt,pTe,xvt,Evt,Tvt,_vt,Cvt,Svt,Avt,Lvt,Mvt,bTe,Dvt,Ivt,Ovt,Nvt,vTe,Pvt,Bvt;O(Ic,"LayeredMetaDataProvider",848),M(986,1,zh,SR),l.Qe=function(t){Qlt(t)};var Bd,Fle,Hq,fS,zq,wTe,Gq,Dk,qq,mTe,yTe,jle,h2,$le,My,kTe,_O,Hle,xTe,Rvt,Vq,zle,dS,Dy,Fvt,Zl,ETe,TTe,Uq,Gle,Rd,Wq,K0,_Te,CTe,STe,qle,Vle,ATe,Hg,Ule,LTe,Iy,MTe,DTe,ITe,Kq,Oy,Db,OTe,NTe,Fo,PTe,jvt,vu,Yq,BTe,RTe,FTe,Wle,jTe,Xq,$Te,HTe,Qq,Tw,zTe,Kle,gS,GTe,_w,pS,Zq,Ib,Yle,fE,Jq,Ob,qTe,VTe,UTe,dE,WTe,$vt,Hvt,zvt,Gvt,Cw,Ny,bs,zg,qvt,Py,KTe,gE,YTe,By,Vvt,pE,XTe,Ik,Uvt,Wvt,CO,Xle,QTe,SO,Mf,V4,Ok,Sw,Nb,eV,Ry,Qle,bE,vE,Aw,U4,Zle,AO,bS,vS,Jle,ZTe,JTe,e_e,t_e,ehe,n_e,r_e,i_e,s_e,the,tV;O(Ic,"LayeredOptions",986),M(987,1,{},eQ),l.$e=function(){var t;return t=new sHe,t},l._e=function(t){},O(Ic,"LayeredOptions/LayeredFactory",987),M(1372,1,{}),l.a=0;var Kvt;O(Oc,"ElkSpacings/AbstractSpacingsBuilder",1372),M(779,1372,{},Kye);var nV,Yvt;O(Ic,"LayeredSpacings/LayeredSpacingsBuilder",779),M(313,22,{3:1,35:1,22:1,313:1,246:1,234:1},GT),l.Kf=function(){return Mot(this)},l.Xf=function(){return Mot(this)};var nhe,a_e,o_e,rV,rhe,c_e,u_e=Gr(Ic,"LayeringStrategy",313,Wr,orn,eXt),Xvt;M(378,22,{3:1,35:1,22:1,378:1},_te);var ihe,l_e,iV,h_e=Gr(Ic,"LongEdgeOrderingStrategy",378,Wr,jen,tXt),Qvt;M(197,22,{3:1,35:1,22:1,197:1},$F);var W4,K4,sV,she,ahe=Gr(Ic,"NodeFlexibility",197,Wr,Utn,nXt),Zvt;M(315,22,{3:1,35:1,22:1,315:1,246:1,234:1},EM),l.Kf=function(){return got(this)},l.Xf=function(){return got(this)};var wS,ohe,che,mS,f_e,d_e=Gr(Ic,"NodePlacementStrategy",315,Wr,Lnn,cXt),Jvt;M(260,22,{3:1,35:1,22:1,260:1},k6);var g_e,LO,p_e,b_e,MO,v_e,aV,oV,w_e=Gr(Ic,"NodePromotionStrategy",260,Wr,ain,iXt),ewt;M(339,22,{3:1,35:1,22:1,339:1},Cte);var m_e,f2,uhe,y_e=Gr(Ic,"OrderingStrategy",339,Wr,Wen,sXt),twt;M(421,22,{3:1,35:1,22:1,421:1},w2e);var lhe,hhe,k_e=Gr(Ic,"PortSortingStrategy",421,Wr,XJt,aXt),nwt;M(452,22,{3:1,35:1,22:1,452:1},Ste);var ul,hu,yS,rwt=Gr(Ic,"PortType",452,Wr,Uen,rXt),iwt;M(375,22,{3:1,35:1,22:1,375:1},Ate);var x_e,fhe,E_e,T_e=Gr(Ic,"SelfLoopDistributionStrategy",375,Wr,Ken,oXt),swt;M(376,22,{3:1,35:1,22:1,376:1},m2e);var DO,dhe,__e=Gr(Ic,"SelfLoopOrderingStrategy",376,Wr,VJt,uXt),awt;M(304,1,{304:1},Jut),O(Ic,"Spacings",304),M(336,22,{3:1,35:1,22:1,336:1},Lte);var ghe,C_e,kS,S_e=Gr(Ic,"SplineRoutingMode",336,Wr,Xen,lXt),owt;M(338,22,{3:1,35:1,22:1,338:1},Mte);var phe,A_e,L_e,M_e=Gr(Ic,"ValidifyStrategy",338,Wr,Qen,hXt),cwt;M(377,22,{3:1,35:1,22:1,377:1},Dte);var Fy,bhe,wE,D_e=Gr(Ic,"WrappingStrategy",377,Wr,Yen,fXt),uwt;M(1383,1,Qc,KJ),l.Yf=function(t){return u(t,37),lwt},l.pf=function(t,n){Hvn(this,u(t,37),n)};var lwt;O(sG,"DepthFirstCycleBreaker",1383),M(782,1,Qc,Ive),l.Yf=function(t){return u(t,37),hwt},l.pf=function(t,n){jyn(this,u(t,37),n)},l.Zf=function(t){return u(St(t,BH(this.d,t.c.length)),10)};var hwt;O(sG,"GreedyCycleBreaker",782),M(1386,782,Qc,Fqe),l.Zf=function(t){var n,r,s,o;for(o=null,n=Ei,s=new C(t);s.a1&&(It(Mt(K(Ya((xn(0,t.c.length),u(t.c[0],10))),(pt(),My))))?Tot(t,this.d,u(this,660)):(hn(),aa(t,this.d)),qtt(this.e,t))},l.Sf=function(t,n,r,s){var o,h,d,v,x,_,L;for(n!=dKe(r,t.length)&&(h=t[n-(r?1:-1)],rme(this.f,h,r?(vo(),hu):(vo(),ul))),o=t[n][0],L=!s||o.k==(zn(),Ls),_=O1(t[n]),this.ag(_,L,!1,r),d=0,x=new C(_);x.a"),t0?hre(this.a,t[n-1],t[n]):!r&&n1&&(It(Mt(K(Ya((xn(0,t.c.length),u(t.c[0],10))),(pt(),My))))?Tot(t,this.d,this):(hn(),aa(t,this.d)),It(Mt(K(Ya((xn(0,t.c.length),u(t.c[0],10))),My)))||qtt(this.e,t))},O(Qu,"ModelOrderBarycenterHeuristic",660),M(1803,1,ji,xje),l.ue=function(t,n){return t1n(this.a,u(t,10),u(n,10))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Qu,"ModelOrderBarycenterHeuristic/lambda$0$Type",1803),M(1403,1,Qc,ZJ),l.Yf=function(t){var n;return u(t,37),n=JF(Twt),xi(n,(ro(),bu),(po(),bq)),n},l.pf=function(t,n){$Jt((u(t,37),n))};var Twt;O(Qu,"NoCrossingMinimizer",1403),M(796,402,mxe,zpe),l.$f=function(t,n,r){var s,o,h,d,v,x,_,L,P,z,q;switch(P=this.g,r.g){case 1:{for(o=0,h=0,L=new C(t.j);L.a1&&(o.j==(ht(),$n)?this.b[t]=!0:o.j==Dn&&t>0&&(this.b[t-1]=!0))},l.f=0,O(u0,"AllCrossingsCounter",1798),M(587,1,{},Z$),l.b=0,l.d=0,O(u0,"BinaryIndexedTree",587),M(524,1,{},zM);var N_e,uV;O(u0,"CrossingsCounter",524),M(1906,1,ji,Eje),l.ue=function(t,n){return GQt(this.a,u(t,11),u(n,11))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(u0,"CrossingsCounter/lambda$0$Type",1906),M(1907,1,ji,Tje),l.ue=function(t,n){return qQt(this.a,u(t,11),u(n,11))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(u0,"CrossingsCounter/lambda$1$Type",1907),M(1908,1,ji,_je),l.ue=function(t,n){return VQt(this.a,u(t,11),u(n,11))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(u0,"CrossingsCounter/lambda$2$Type",1908),M(1909,1,ji,Cje),l.ue=function(t,n){return UQt(this.a,u(t,11),u(n,11))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(u0,"CrossingsCounter/lambda$3$Type",1909),M(1910,1,Un,Sje),l.td=function(t){Srn(this.a,u(t,11))},O(u0,"CrossingsCounter/lambda$4$Type",1910),M(1911,1,vi,Aje),l.Mb=function(t){return HUt(this.a,u(t,11))},O(u0,"CrossingsCounter/lambda$5$Type",1911),M(1912,1,Un,Lje),l.td=function(t){Nqe(this,t)},O(u0,"CrossingsCounter/lambda$6$Type",1912),M(1913,1,Un,aqe),l.td=function(t){var n;h8(),$p(this.b,(n=this.a,u(t,11),n))},O(u0,"CrossingsCounter/lambda$7$Type",1913),M(826,1,_d,IB),l.Lb=function(t){return h8(),ta(u(t,11),(et(),cl))},l.Fb=function(t){return this===t},l.Mb=function(t){return h8(),ta(u(t,11),(et(),cl))},O(u0,"CrossingsCounter/lambda$8$Type",826),M(1905,1,{},Mje),O(u0,"HyperedgeCrossingsCounter",1905),M(467,1,{35:1,467:1},XUe),l.wd=function(t){return Tcn(this,u(t,467))},l.b=0,l.c=0,l.e=0,l.f=0;var y3n=O(u0,"HyperedgeCrossingsCounter/Hyperedge",467);M(362,1,{35:1,362:1},Xj),l.wd=function(t){return x0n(this,u(t,362))},l.b=0,l.c=0;var _wt=O(u0,"HyperedgeCrossingsCounter/HyperedgeCorner",362);M(523,22,{3:1,35:1,22:1,523:1},y2e);var ES,TS,Cwt=Gr(u0,"HyperedgeCrossingsCounter/HyperedgeCorner/Type",523,Wr,QJt,gXt),Swt;M(1405,1,Qc,WJ),l.Yf=function(t){return u(K(u(t,37),(et(),eu)),21).Hc((mo(),Th))?Awt:null},l.pf=function(t,n){Gln(this,u(t,37),n)};var Awt;O(ko,"InteractiveNodePlacer",1405),M(1406,1,Qc,UJ),l.Yf=function(t){return u(K(u(t,37),(et(),eu)),21).Hc((mo(),Th))?Lwt:null},l.pf=function(t,n){Sun(this,u(t,37),n)};var Lwt,lV,hV;O(ko,"LinearSegmentsNodePlacer",1406),M(257,1,{35:1,257:1},wpe),l.wd=function(t){return JVt(this,u(t,257))},l.Fb=function(t){var n;return we(t,257)?(n=u(t,257),this.b==n.b):!1},l.Hb=function(){return this.b},l.Ib=function(){return"ls"+Yp(this.e)},l.a=0,l.b=0,l.c=-1,l.d=-1,l.g=0;var Mwt=O(ko,"LinearSegmentsNodePlacer/LinearSegment",257);M(1408,1,Qc,EKe),l.Yf=function(t){return u(K(u(t,37),(et(),eu)),21).Hc((mo(),Th))?Dwt:null},l.pf=function(t,n){Dyn(this,u(t,37),n)},l.b=0,l.g=0;var Dwt;O(ko,"NetworkSimplexPlacer",1408),M(1427,1,ji,sQ),l.ue=function(t,n){return Tu(u(t,19).a,u(n,19).a)},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(ko,"NetworkSimplexPlacer/0methodref$compare$Type",1427),M(1429,1,ji,aQ),l.ue=function(t,n){return Tu(u(t,19).a,u(n,19).a)},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(ko,"NetworkSimplexPlacer/1methodref$compare$Type",1429),M(649,1,{649:1},oqe);var k3n=O(ko,"NetworkSimplexPlacer/EdgeRep",649);M(401,1,{401:1},lwe),l.b=!1;var x3n=O(ko,"NetworkSimplexPlacer/NodeRep",401);M(508,12,{3:1,4:1,20:1,28:1,52:1,12:1,14:1,15:1,54:1,508:1},bHe),O(ko,"NetworkSimplexPlacer/Path",508),M(1409,1,{},oQ),l.Kb=function(t){return u(t,17).d.i.k},O(ko,"NetworkSimplexPlacer/Path/lambda$0$Type",1409),M(1410,1,vi,cQ),l.Mb=function(t){return u(t,267)==(zn(),ca)},O(ko,"NetworkSimplexPlacer/Path/lambda$1$Type",1410),M(1411,1,{},uQ),l.Kb=function(t){return u(t,17).d.i},O(ko,"NetworkSimplexPlacer/Path/lambda$2$Type",1411),M(1412,1,vi,Dje),l.Mb=function(t){return NUe(krt(u(t,10)))},O(ko,"NetworkSimplexPlacer/Path/lambda$3$Type",1412),M(1413,1,vi,lQ),l.Mb=function(t){return IQt(u(t,11))},O(ko,"NetworkSimplexPlacer/lambda$0$Type",1413),M(1414,1,Un,cqe),l.td=function(t){LWt(this.a,this.b,u(t,11))},O(ko,"NetworkSimplexPlacer/lambda$1$Type",1414),M(1423,1,Un,Ije),l.td=function(t){Y1n(this.a,u(t,17))},O(ko,"NetworkSimplexPlacer/lambda$10$Type",1423),M(1424,1,{},hQ),l.Kb=function(t){return $l(),new vn(null,new mn(u(t,29).a,16))},O(ko,"NetworkSimplexPlacer/lambda$11$Type",1424),M(1425,1,Un,Oje),l.td=function(t){Vpn(this.a,u(t,10))},O(ko,"NetworkSimplexPlacer/lambda$12$Type",1425),M(1426,1,{},fQ),l.Kb=function(t){return $l(),ct(u(t,121).e)},O(ko,"NetworkSimplexPlacer/lambda$13$Type",1426),M(1428,1,{},dQ),l.Kb=function(t){return $l(),ct(u(t,121).e)},O(ko,"NetworkSimplexPlacer/lambda$15$Type",1428),M(1430,1,vi,gQ),l.Mb=function(t){return $l(),u(t,401).c.k==(zn(),Hs)},O(ko,"NetworkSimplexPlacer/lambda$17$Type",1430),M(1431,1,vi,pQ),l.Mb=function(t){return $l(),u(t,401).c.j.c.length>1},O(ko,"NetworkSimplexPlacer/lambda$18$Type",1431),M(1432,1,Un,MYe),l.td=function(t){Pon(this.c,this.b,this.d,this.a,u(t,401))},l.c=0,l.d=0,O(ko,"NetworkSimplexPlacer/lambda$19$Type",1432),M(1415,1,{},bQ),l.Kb=function(t){return $l(),new vn(null,new mn(u(t,29).a,16))},O(ko,"NetworkSimplexPlacer/lambda$2$Type",1415),M(1433,1,Un,Nje),l.td=function(t){SWt(this.a,u(t,11))},l.a=0,O(ko,"NetworkSimplexPlacer/lambda$20$Type",1433),M(1434,1,{},V5),l.Kb=function(t){return $l(),new vn(null,new mn(u(t,29).a,16))},O(ko,"NetworkSimplexPlacer/lambda$21$Type",1434),M(1435,1,Un,Pje),l.td=function(t){zWt(this.a,u(t,10))},O(ko,"NetworkSimplexPlacer/lambda$22$Type",1435),M(1436,1,vi,OB),l.Mb=function(t){return NUe(t)},O(ko,"NetworkSimplexPlacer/lambda$23$Type",1436),M(1437,1,{},vQ),l.Kb=function(t){return $l(),new vn(null,new mn(u(t,29).a,16))},O(ko,"NetworkSimplexPlacer/lambda$24$Type",1437),M(1438,1,vi,Bje),l.Mb=function(t){return KUt(this.a,u(t,10))},O(ko,"NetworkSimplexPlacer/lambda$25$Type",1438),M(1439,1,Un,uqe),l.td=function(t){v1n(this.a,this.b,u(t,10))},O(ko,"NetworkSimplexPlacer/lambda$26$Type",1439),M(1440,1,vi,wQ),l.Mb=function(t){return $l(),!to(u(t,17))},O(ko,"NetworkSimplexPlacer/lambda$27$Type",1440),M(1441,1,vi,mQ),l.Mb=function(t){return $l(),!to(u(t,17))},O(ko,"NetworkSimplexPlacer/lambda$28$Type",1441),M(1442,1,{},Rje),l.Ce=function(t,n){return jWt(this.a,u(t,29),u(n,29))},O(ko,"NetworkSimplexPlacer/lambda$29$Type",1442),M(1416,1,{},NB),l.Kb=function(t){return $l(),new vn(null,new Sv(new cr(fr(js(u(t,10)).a.Kc(),new V))))},O(ko,"NetworkSimplexPlacer/lambda$3$Type",1416),M(1417,1,vi,yQ),l.Mb=function(t){return $l(),Ctn(u(t,17))},O(ko,"NetworkSimplexPlacer/lambda$4$Type",1417),M(1418,1,Un,Fje),l.td=function(t){qbn(this.a,u(t,17))},O(ko,"NetworkSimplexPlacer/lambda$5$Type",1418),M(1419,1,{},N9),l.Kb=function(t){return $l(),new vn(null,new mn(u(t,29).a,16))},O(ko,"NetworkSimplexPlacer/lambda$6$Type",1419),M(1420,1,vi,kQ),l.Mb=function(t){return $l(),u(t,10).k==(zn(),Hs)},O(ko,"NetworkSimplexPlacer/lambda$7$Type",1420),M(1421,1,{},xQ),l.Kb=function(t){return $l(),new vn(null,new Sv(new cr(fr(j0(u(t,10)).a.Kc(),new V))))},O(ko,"NetworkSimplexPlacer/lambda$8$Type",1421),M(1422,1,vi,EQ),l.Mb=function(t){return $l(),CQt(u(t,17))},O(ko,"NetworkSimplexPlacer/lambda$9$Type",1422),M(1404,1,Qc,sT),l.Yf=function(t){return u(K(u(t,37),(et(),eu)),21).Hc((mo(),Th))?Iwt:null},l.pf=function(t,n){_vn(u(t,37),n)};var Iwt;O(ko,"SimpleNodePlacer",1404),M(180,1,{180:1},p4),l.Ib=function(){var t;return t="",this.c==(yd(),Lw)?t+=lk:this.c==Gg&&(t+=uk),this.o==(M1(),Pb)?t+=voe:this.o==K1?t+="UP":t+="BALANCED",t},O(r2,"BKAlignedLayout",180),M(516,22,{3:1,35:1,22:1,516:1},x2e);var Gg,Lw,Owt=Gr(r2,"BKAlignedLayout/HDirection",516,Wr,JJt,pXt),Nwt;M(515,22,{3:1,35:1,22:1,515:1},k2e);var Pb,K1,Pwt=Gr(r2,"BKAlignedLayout/VDirection",515,Wr,een,bXt),Bwt;M(1634,1,{},lqe),O(r2,"BKAligner",1634),M(1637,1,{},Vit),O(r2,"BKCompactor",1637),M(654,1,{654:1},TQ),l.a=0,O(r2,"BKCompactor/ClassEdge",654),M(458,1,{458:1},gHe),l.a=null,l.b=0,O(r2,"BKCompactor/ClassNode",458),M(1407,1,Qc,Bqe),l.Yf=function(t){return u(K(u(t,37),(et(),eu)),21).Hc((mo(),Th))?Rwt:null},l.pf=function(t,n){Uyn(this,u(t,37),n)},l.d=!1;var Rwt;O(r2,"BKNodePlacer",1407),M(1635,1,{},_Q),l.d=0,O(r2,"NeighborhoodInformation",1635),M(1636,1,ji,jje),l.ue=function(t,n){return Jrn(this,u(t,46),u(n,46))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(r2,"NeighborhoodInformation/NeighborComparator",1636),M(808,1,{}),O(r2,"ThresholdStrategy",808),M(1763,808,{},mHe),l.bg=function(t,n,r){return this.a.o==(M1(),K1)?gs:Ds},l.cg=function(){},O(r2,"ThresholdStrategy/NullThresholdStrategy",1763),M(579,1,{579:1},hqe),l.c=!1,l.d=!1,O(r2,"ThresholdStrategy/Postprocessable",579),M(1764,808,{},yHe),l.bg=function(t,n,r){var s,o,h;return o=n==r,s=this.a.a[r.p]==n,o||s?(h=t,this.a.c==(yd(),Lw)?(o&&(h=vae(this,n,!0)),!isNaN(h)&&!isFinite(h)&&s&&(h=vae(this,r,!1))):(o&&(h=vae(this,n,!0)),!isNaN(h)&&!isFinite(h)&&s&&(h=vae(this,r,!1))),h):t},l.cg=function(){for(var t,n,r,s,o;this.d.b!=0;)o=u(ben(this.d),579),s=fut(this,o),s.a&&(t=s.a,r=It(this.a.f[this.a.g[o.b.p].p]),!(!r&&!to(t)&&t.c.i.c==t.d.i.c)&&(n=mot(this,o),n||nWt(this.e,o)));for(;this.e.a.c.length!=0;)mot(this,u(Lnt(this.e),579))},O(r2,"ThresholdStrategy/SimpleThresholdStrategy",1764),M(635,1,{635:1,246:1,234:1},CQ),l.Kf=function(){return jtt(this)},l.Xf=function(){return jtt(this)};var vhe;O(dce,"EdgeRouterFactory",635),M(1458,1,Qc,hd),l.Yf=function(t){return Tpn(u(t,37))},l.pf=function(t,n){Ivn(u(t,37),n)};var Fwt,jwt,$wt,Hwt,zwt,P_e,Gwt,qwt;O(dce,"OrthogonalEdgeRouter",1458),M(1451,1,Qc,Rqe),l.Yf=function(t){return Kln(u(t,37))},l.pf=function(t,n){Zmn(this,u(t,37),n)};var Vwt,Uwt,Wwt,Kwt,OO,Ywt;O(dce,"PolylineEdgeRouter",1451),M(1452,1,_d,SQ),l.Lb=function(t){return Qme(u(t,10))},l.Fb=function(t){return this===t},l.Mb=function(t){return Qme(u(t,10))},O(dce,"PolylineEdgeRouter/1",1452),M(1809,1,vi,AQ),l.Mb=function(t){return u(t,129).c==(Jf(),d2)},O(o1,"HyperEdgeCycleDetector/lambda$0$Type",1809),M(1810,1,{},LQ),l.Ge=function(t){return u(t,129).d},O(o1,"HyperEdgeCycleDetector/lambda$1$Type",1810),M(1811,1,vi,MQ),l.Mb=function(t){return u(t,129).c==(Jf(),d2)},O(o1,"HyperEdgeCycleDetector/lambda$2$Type",1811),M(1812,1,{},U5),l.Ge=function(t){return u(t,129).d},O(o1,"HyperEdgeCycleDetector/lambda$3$Type",1812),M(1813,1,{},DQ),l.Ge=function(t){return u(t,129).d},O(o1,"HyperEdgeCycleDetector/lambda$4$Type",1813),M(1814,1,{},IQ),l.Ge=function(t){return u(t,129).d},O(o1,"HyperEdgeCycleDetector/lambda$5$Type",1814),M(112,1,{35:1,112:1},AD),l.wd=function(t){return eUt(this,u(t,112))},l.Fb=function(t){var n;return we(t,112)?(n=u(t,112),this.g==n.g):!1},l.Hb=function(){return this.g},l.Ib=function(){var t,n,r,s;for(t=new Fl("{"),s=new C(this.n);s.a"+this.b+" ("+hKt(this.c)+")"},l.d=0,O(o1,"HyperEdgeSegmentDependency",129),M(520,22,{3:1,35:1,22:1,520:1},E2e);var d2,jy,Xwt=Gr(o1,"HyperEdgeSegmentDependency/DependencyType",520,Wr,ZJt,vXt),Qwt;M(1815,1,{},$je),O(o1,"HyperEdgeSegmentSplitter",1815),M(1816,1,{},vze),l.a=0,l.b=0,O(o1,"HyperEdgeSegmentSplitter/AreaRating",1816),M(329,1,{329:1},vne),l.a=0,l.b=0,l.c=0,O(o1,"HyperEdgeSegmentSplitter/FreeArea",329),M(1817,1,ji,jQ),l.ue=function(t,n){return oYt(u(t,112),u(n,112))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(o1,"HyperEdgeSegmentSplitter/lambda$0$Type",1817),M(1818,1,Un,DYe),l.td=function(t){fnn(this.a,this.d,this.c,this.b,u(t,112))},l.b=0,O(o1,"HyperEdgeSegmentSplitter/lambda$1$Type",1818),M(1819,1,{},$Q),l.Kb=function(t){return new vn(null,new mn(u(t,112).e,16))},O(o1,"HyperEdgeSegmentSplitter/lambda$2$Type",1819),M(1820,1,{},HQ),l.Kb=function(t){return new vn(null,new mn(u(t,112).j,16))},O(o1,"HyperEdgeSegmentSplitter/lambda$3$Type",1820),M(1821,1,{},zQ),l.Fe=function(t){return Ue(ft(t))},O(o1,"HyperEdgeSegmentSplitter/lambda$4$Type",1821),M(655,1,{},Hne),l.a=0,l.b=0,l.c=0,O(o1,"OrthogonalRoutingGenerator",655),M(1638,1,{},GQ),l.Kb=function(t){return new vn(null,new mn(u(t,112).e,16))},O(o1,"OrthogonalRoutingGenerator/lambda$0$Type",1638),M(1639,1,{},qQ),l.Kb=function(t){return new vn(null,new mn(u(t,112).j,16))},O(o1,"OrthogonalRoutingGenerator/lambda$1$Type",1639),M(661,1,{}),O(gce,"BaseRoutingDirectionStrategy",661),M(1807,661,{},kHe),l.dg=function(t,n,r){var s,o,h,d,v,x,_,L,P,z,q,W,X;if(!(t.r&&!t.q))for(L=n+t.o*r,_=new C(t.n);_.a<_.c.c.length;)for(x=u(Y(_),11),P=sc(ie(re(na,1),Qe,8,0,[x.i.n,x.n,x.a])).a,v=new C(x.g);v.aSd&&(h=L,o=t,s=new Pt(P,h),ci(d.a,s),rw(this,d,o,s,!1),z=t.r,z&&(q=Ue(ft(s1(z.e,0))),s=new Pt(q,h),ci(d.a,s),rw(this,d,o,s,!1),h=n+z.o*r,o=z,s=new Pt(q,h),ci(d.a,s),rw(this,d,o,s,!1)),s=new Pt(X,h),ci(d.a,s),rw(this,d,o,s,!1)))},l.eg=function(t){return t.i.n.a+t.n.a+t.a.a},l.fg=function(){return ht(),xr},l.gg=function(){return ht(),An},O(gce,"NorthToSouthRoutingStrategy",1807),M(1808,661,{},xHe),l.dg=function(t,n,r){var s,o,h,d,v,x,_,L,P,z,q,W,X;if(!(t.r&&!t.q))for(L=n-t.o*r,_=new C(t.n);_.a<_.c.c.length;)for(x=u(Y(_),11),P=sc(ie(re(na,1),Qe,8,0,[x.i.n,x.n,x.a])).a,v=new C(x.g);v.aSd&&(h=L,o=t,s=new Pt(P,h),ci(d.a,s),rw(this,d,o,s,!1),z=t.r,z&&(q=Ue(ft(s1(z.e,0))),s=new Pt(q,h),ci(d.a,s),rw(this,d,o,s,!1),h=n-z.o*r,o=z,s=new Pt(q,h),ci(d.a,s),rw(this,d,o,s,!1)),s=new Pt(X,h),ci(d.a,s),rw(this,d,o,s,!1)))},l.eg=function(t){return t.i.n.a+t.n.a+t.a.a},l.fg=function(){return ht(),An},l.gg=function(){return ht(),xr},O(gce,"SouthToNorthRoutingStrategy",1808),M(1806,661,{},EHe),l.dg=function(t,n,r){var s,o,h,d,v,x,_,L,P,z,q,W,X;if(!(t.r&&!t.q))for(L=n+t.o*r,_=new C(t.n);_.a<_.c.c.length;)for(x=u(Y(_),11),P=sc(ie(re(na,1),Qe,8,0,[x.i.n,x.n,x.a])).b,v=new C(x.g);v.aSd&&(h=L,o=t,s=new Pt(h,P),ci(d.a,s),rw(this,d,o,s,!0),z=t.r,z&&(q=Ue(ft(s1(z.e,0))),s=new Pt(h,q),ci(d.a,s),rw(this,d,o,s,!0),h=n+z.o*r,o=z,s=new Pt(h,q),ci(d.a,s),rw(this,d,o,s,!0)),s=new Pt(h,X),ci(d.a,s),rw(this,d,o,s,!0)))},l.eg=function(t){return t.i.n.b+t.n.b+t.a.b},l.fg=function(){return ht(),$n},l.gg=function(){return ht(),Dn},O(gce,"WestToEastRoutingStrategy",1806),M(813,1,{},G5e),l.Ib=function(){return Yp(this.a)},l.b=0,l.c=!1,l.d=!1,l.f=0,O(vy,"NubSpline",813),M(407,1,{407:1},Kot,hXe),O(vy,"NubSpline/PolarCP",407),M(1453,1,Qc,Rit),l.Yf=function(t){return Rhn(u(t,37))},l.pf=function(t,n){vyn(this,u(t,37),n)};var Zwt,Jwt,emt,tmt,nmt;O(vy,"SplineEdgeRouter",1453),M(268,1,{268:1},x$),l.Ib=function(){return this.a+" ->("+this.c+") "+this.b},l.c=0,O(vy,"SplineEdgeRouter/Dependency",268),M(455,22,{3:1,35:1,22:1,455:1},T2e);var g2,Y4,rmt=Gr(vy,"SplineEdgeRouter/SideToProcess",455,Wr,ten,wXt),imt;M(1454,1,vi,FQ),l.Mb=function(t){return aC(),!u(t,128).o},O(vy,"SplineEdgeRouter/lambda$0$Type",1454),M(1455,1,{},RQ),l.Ge=function(t){return aC(),u(t,128).v+1},O(vy,"SplineEdgeRouter/lambda$1$Type",1455),M(1456,1,Un,fqe),l.td=function(t){AQt(this.a,this.b,u(t,46))},O(vy,"SplineEdgeRouter/lambda$2$Type",1456),M(1457,1,Un,dqe),l.td=function(t){LQt(this.a,this.b,u(t,46))},O(vy,"SplineEdgeRouter/lambda$3$Type",1457),M(128,1,{35:1,128:1},hat,Y5e),l.wd=function(t){return tUt(this,u(t,128))},l.b=0,l.e=!1,l.f=0,l.g=0,l.j=!1,l.k=!1,l.n=0,l.o=!1,l.p=!1,l.q=!1,l.s=0,l.u=0,l.v=0,l.F=0,O(vy,"SplineSegment",128),M(459,1,{459:1},P9),l.a=0,l.b=!1,l.c=!1,l.d=!1,l.e=!1,l.f=0,O(vy,"SplineSegment/EdgeInformation",459),M(1234,1,{},OQ),O(IC,q6e,1234),M(1235,1,ji,NQ),l.ue=function(t,n){return hdn(u(t,135),u(n,135))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(IC,Yht,1235),M(1233,1,{},Oze),O(IC,"MrTree",1233),M(393,22,{3:1,35:1,22:1,393:1,246:1,234:1},HF),l.Kf=function(){return Bat(this)},l.Xf=function(){return Bat(this)};var fV,_S,NO,CS,B_e=Gr(IC,"TreeLayoutPhases",393,Wr,Wtn,mXt),smt;M(1130,209,mb,JUe),l.Ze=function(t,n){var r,s,o,h,d,v,x;for(It(Mt(Ft(t,(nw(),z_e))))||i$((r=new sr((Tm(),new ym(t))),r)),d=(v=new E$,Ho(v,t),Ye(v,(Tc(),LS),t),x=new Mr,nbn(t,v,x),mbn(t,v,x),v),h=fbn(this.a,d),o=new C(h);o.a"+h$(this.c):"e_"+Xi(this)},O(OC,"TEdge",188),M(135,134,{3:1,135:1,94:1,134:1},E$),l.Ib=function(){var t,n,r,s,o;for(o=null,s=ii(this.b,0);s.b!=s.d.c;)r=u(ri(s),86),o+=(r.c==null||r.c.length==0?"n_"+r.g:"n_"+r.c)+` -`;for(n=ii(this.a,0);n.b!=n.d.c;)t=u(ri(n),188),o+=(t.b&&t.c?h$(t.b)+"->"+h$(t.c):"e_"+Xi(t))+` -`;return o};var E3n=O(OC,"TGraph",135);M(633,502,{3:1,502:1,633:1,94:1,134:1}),O(OC,"TShape",633),M(86,633,{3:1,502:1,86:1,633:1,94:1,134:1},vie),l.Ib=function(){return h$(this)};var T3n=O(OC,"TNode",86);M(255,1,i0,Ep),l.Jc=function(t){Da(this,t)},l.Kc=function(){var t;return t=ii(this.a.d,0),new f6(t)},O(OC,"TNode/2",255),M(358,1,ga,f6),l.Nb=function(t){La(this,t)},l.Pb=function(){return u(ri(this.a),188).c},l.Ob=function(){return vF(this.a)},l.Qb=function(){F$(this.a)},O(OC,"TNode/2/1",358),M(1840,1,ps,ZUe),l.pf=function(t,n){Pbn(this,u(t,135),n)},O(vk,"FanProcessor",1840),M(327,22,{3:1,35:1,22:1,327:1,234:1},qT),l.Kf=function(){switch(this.g){case 0:return new FHe;case 1:return new ZUe;case 2:return new W5;case 3:return new VQ;case 4:return new WQ;case 5:return new IL;default:throw J(new Ln(Noe+(this.f!=null?this.f:""+this.g)))}};var whe,mhe,yhe,khe,xhe,dV,amt=Gr(vk,tke,327,Wr,urn,yXt),omt;M(1843,1,ps,VQ),l.pf=function(t,n){v0n(this,u(t,135),n)},l.a=0,O(vk,"LevelHeightProcessor",1843),M(1844,1,i0,UQ),l.Jc=function(t){Da(this,t)},l.Kc=function(){return hn(),e8(),Y7},O(vk,"LevelHeightProcessor/1",1844),M(1841,1,ps,W5),l.pf=function(t,n){T1n(this,u(t,135),n)},l.a=0,O(vk,"NeighborsProcessor",1841),M(1842,1,i0,PB),l.Jc=function(t){Da(this,t)},l.Kc=function(){return hn(),e8(),Y7},O(vk,"NeighborsProcessor/1",1842),M(1845,1,ps,WQ),l.pf=function(t,n){b0n(this,u(t,135),n)},l.a=0,O(vk,"NodePositionProcessor",1845),M(1839,1,ps,FHe),l.pf=function(t,n){zvn(this,u(t,135))},O(vk,"RootProcessor",1839),M(1846,1,ps,IL),l.pf=function(t,n){Qan(u(t,135))},O(vk,"Untreeifyer",1846);var PO,SS,cmt,Ehe,gV,AS,The,pV,bV,mE,LS,vV,qg,R_e,umt,_he,$y,Che,F_e;M(851,1,zh,E3),l.Qe=function(t){en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,yxe),""),"Weighting of Nodes"),"Which weighting to use when computing a node order."),$_e),(Ng(),vs)),W_e),rn((i1(),Fn))))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,kxe),""),"Search Order"),"Which search order to use when computing a spanning tree."),j_e),vs),Y_e),rn(Fn)))),clt((new WL,t))};var lmt,j_e,hmt,$_e;O(oG,"MrTreeMetaDataProvider",851),M(994,1,zh,WL),l.Qe=function(t){clt(t)};var fmt,H_e,dmt,gmt,pmt,bmt,z_e,vmt,G_e,wmt,wV,q_e,mmt,V_e,ymt;O(oG,"MrTreeOptions",994),M(995,1,{},KQ),l.$e=function(){var t;return t=new JUe,t},l._e=function(t){},O(oG,"MrTreeOptions/MrtreeFactory",995),M(480,22,{3:1,35:1,22:1,480:1},_2e);var She,U_e,W_e=Gr(oG,"OrderWeighting",480,Wr,ren,kXt),kmt;M(425,22,{3:1,35:1,22:1,425:1},C2e);var K_e,Ahe,Y_e=Gr(oG,"TreeifyingOrder",425,Wr,nen,EXt),xmt;M(1459,1,Qc,UL),l.Yf=function(t){return u(t,135),Emt},l.pf=function(t,n){Xin(this,u(t,135),n)};var Emt;O("org.eclipse.elk.alg.mrtree.p1treeify","DFSTreeifyer",1459),M(1460,1,Qc,XJ),l.Yf=function(t){return u(t,135),Tmt},l.pf=function(t,n){N1n(this,u(t,135),n)};var Tmt;O("org.eclipse.elk.alg.mrtree.p2order","NodeOrderer",1460),M(1461,1,Qc,YJ),l.Yf=function(t){return u(t,135),_mt},l.pf=function(t,n){Qpn(this,u(t,135),n)},l.a=0;var _mt;O("org.eclipse.elk.alg.mrtree.p3place","NodePlacer",1461),M(1462,1,Qc,LR),l.Yf=function(t){return u(t,135),Cmt},l.pf=function(t,n){Eln(u(t,135),n)};var Cmt;O("org.eclipse.elk.alg.mrtree.p4route","EdgeRouter",1462);var MS;M(495,22,{3:1,35:1,22:1,495:1,246:1,234:1},S2e),l.Kf=function(){return grt(this)},l.Xf=function(){return grt(this)};var mV,yE,X_e=Gr(xxe,"RadialLayoutPhases",495,Wr,ien,xXt),Smt;M(1131,209,mb,Ize),l.Ze=function(t,n){var r,s,o,h,d,v;if(r=vat(this,t),kr(n,"Radial layout",r.c.length),It(Mt(Ft(t,(Jm(),aCe))))||i$((s=new sr((Tm(),new ym(t))),s)),v=$hn(t),So(t,(a_(),MS),v),!v)throw J(new Ln("The given graph is not a tree!"));for(o=Ue(ft(Ft(t,xV))),o==0&&(o=Dat(t)),So(t,xV,o),d=new C(vat(this,t));d.a0&&jnt((zr(n-1,t.length),t.charCodeAt(n-1)),aft);)--n;if(s>=n)throw J(new Ln("The given string does not contain any numbers."));if(o=cy(t.substr(s,n-s),`,|;|\r| -`),o.length!=2)throw J(new Ln("Exactly two numbers are expected, "+o.length+" were found."));try{this.a=ry(ny(o[0])),this.b=ry(ny(o[1]))}catch(h){throw h=ts(h),we(h,127)?(r=h,J(new Ln(oft+r))):J(h)}},l.Ib=function(){return"("+this.a+","+this.b+")"},l.a=0,l.b=0;var na=O(HI,"KVector",8);M(74,68,{3:1,4:1,20:1,28:1,52:1,14:1,68:1,15:1,74:1,414:1},Gu,pF,kUe),l.Pc=function(){return uan(this)},l.Jf=function(t){var n,r,s,o,h,d;s=cy(t,`,|;|\\(|\\)|\\[|\\]|\\{|\\}| | | -`),Rh(this);try{for(r=0,h=0,o=0,d=0;r0&&(h%2==0?o=ry(s[r]):d=ry(s[r]),h>0&&h%2!=0&&ci(this,new Pt(o,d)),++h),++r}catch(v){throw v=ts(v),we(v,127)?(n=v,J(new Ln("The given string does not match the expected format for vectors."+n))):J(v)}},l.Ib=function(){var t,n,r;for(t=new Fl("("),n=ii(this,0);n.b!=n.d.c;)r=u(ri(n),8),Yr(t,r.a+","+r.b),n.b!=n.d.c&&(t.a+="; ");return(t.a+=")",t).a};var sSe=O(HI,"KVectorChain",74);M(248,22,{3:1,35:1,22:1,248:1},VT);var Yhe,LV,MV,jO,$O,DV,aSe=Gr(qh,"Alignment",248,Wr,rrn,$Xt),Uyt;M(979,1,zh,JJ),l.Qe=function(t){rut(t)};var oSe,Xhe,Wyt,cSe,uSe,Kyt,lSe,Yyt,Xyt,hSe,fSe,Qyt;O(qh,"BoxLayouterOptions",979),M(980,1,{},MZ),l.$e=function(){var t;return t=new BZ,t},l._e=function(t){},O(qh,"BoxLayouterOptions/BoxFactory",980),M(291,22,{3:1,35:1,22:1,291:1},UT);var HO,Qhe,zO,GO,qO,Zhe,Jhe=Gr(qh,"ContentAlignment",291,Wr,nrn,HXt),Zyt;M(684,1,zh,wp),l.Qe=function(t){en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,n1t),""),"Layout Algorithm"),"Select a specific layout algorithm."),(Ng(),kE)),mt),rn((i1(),Fn))))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,r1t),""),"Resolved Layout Algorithm"),"Meta data associated with the selected algorithm."),Y1),S3n),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Zke),""),"Alignment"),"Alignment of the selected node relative to other nodes; the exact meaning depends on the used algorithm."),dSe),vs),aSe),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,fk),""),"Aspect Ratio"),"The desired aspect ratio of the drawing, that is the quotient of width by height."),qo),ma),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,Uxe),""),"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."),Y1),sSe),rn(Fd)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,rG),""),"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."),pSe),Pk),Jhe),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,WI),""),"Debug Mode"),"Whether additional debug information shall be generated."),(Mn(),!1)),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,txe),""),P6e),"Overall direction of edges: horizontal (right / left) or vertical (down / up)."),bSe),vs),RS),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,VI),""),"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."),mSe),vs),ffe),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,uG),""),"Expand Nodes"),"If active, nodes are expanded to fill the area of their parent."),!1),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,nG),""),"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`."),ESe),vs),cAe),Ui(Fn,ie(re(Ug,1),tt,175,0,[ua]))))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,uw),""),"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."),OSe),Y1),gEe),Ui(Fn,ie(re(Ug,1),tt,175,0,[ua]))))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,jI),""),"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."),!1),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,fce),""),"interactive Layout"),"Whether the graph should be changeable interactively and by setting constraints"),!1),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,CC),""),"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."),!1),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Doe),""),"Port Constraints"),"Defines constraints of the position of the ports of a node."),FSe),vs),hAe),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,iG),""),"Position"),"The position of a node, port, or label. This is used by the 'Fixed Layout' algorithm to specify a pre-defined position."),Y1),na),Ui(ua,ie(re(Ug,1),tt,175,0,[Bb,Vg]))))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,FI),""),"Priority"),"Defines the priority of an object; its meaning depends on the specific layout algorithm and the context where it is used."),Cc),Za),Ui(ua,ie(re(Ug,1),tt,175,0,[Fd]))))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,Fz),""),"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)."),Cc),Za),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,_C),""),"Separate Connected Components"),"Whether each connected component should be processed separately."),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,lxe),""),"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."),_Se),Y1),sSe),rn(Fd)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,dxe),""),"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."),!1),za),Us),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,gxe),""),"Hypernode"),"Whether the node should be handled as a hypernode."),!1),za),Us),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,t3n),""),"Label Manager"),"Label managers can shorten labels upon a layout algorithm's request."),Y1),I3n),Ui(Fn,ie(re(Ug,1),tt,175,0,[Vg]))))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,bxe),""),"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."),CSe),Y1),dEe),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Xke),""),"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."),!1),za),Us),Ui(ua,ie(re(Ug,1),tt,175,0,[Fd,Bb,Vg]))))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,i1t),""),"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),qo),ma),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,s1t),""),"Animate"),"Whether the shift from the old layout to the new computed layout shall be animated."),!0),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,a1t),""),"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'."),ct(100)),Cc),Za),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,o1t),""),"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."),!1),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,c1t),""),"Maximal Animation Time"),"The maximal time for animations, in milliseconds."),ct(4e3)),Cc),Za),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,u1t),""),"Minimal Animation Time"),"The minimal time for animations, in milliseconds."),ct(400)),Cc),Za),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,l1t),""),"Progress Bar"),"Whether a progress bar shall be displayed during layout computations."),!1),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,h1t),""),"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."),!1),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,f1t),""),"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."),!0),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,d1t),""),"Zoom to Fit"),"Whether the zoom level shall be set to view the whole diagram after layout."),!1),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Vxe),"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."),gSe),vs),vAe),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Fke),G1),"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),qo),ma),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,jke),G1),"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),qo),ma),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,_oe),G1),"Components Spacing"),"Spacing to be preserved between pairs of connected components. This option is only relevant if 'separateConnectedComponents' is activated."),20),qo),ma),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,$ke),G1),"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),qo),ma),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Moe),G1),"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),qo),ma),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Hke),G1),"Edge Node Spacing"),"Spacing to be preserved between nodes and edges."),10),qo),ma),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,zke),G1),"Label Spacing"),"Determines the amount of space to be left between two labels of the same graph element."),0),qo),ma),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Vke),G1),"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),qo),ma),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Gke),G1),"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),qo),ma),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,qke),G1),"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),qo),ma),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,py),G1),"Node Spacing"),"The minimal distance to be preserved between each two nodes."),20),qo),ma),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Uke),G1),"Node Self Loop Spacing"),"Spacing to be preserved between a node and its self loops."),10),qo),ma),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Wke),G1),"Port Spacing"),"Spacing between pairs of ports of the same node."),10),qo),ma),Ui(Fn,ie(re(Ug,1),tt,175,0,[ua]))))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,Kke),G1),"Individual Spacing"),"Allows to specify individual spacing values for graph elements that shall be different from the value specified for the element's parent."),Y1),O3t),Ui(ua,ie(re(Ug,1),tt,175,0,[Fd,Bb,Vg]))))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,vxe),G1),"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."),KSe),Y1),dEe),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,hce),b1t),"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)."),Cc),Za),Ui(Fn,ie(re(Ug,1),tt,175,0,[ua]))))),va(t,hce,lce,a3t),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,lce),b1t),"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."),NSe),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,nxe),v1t),"Node Label Padding"),"Define padding for node labels that are placed inside of a node."),ASe),Y1),gEe),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,P7),v1t),"Node Label Placement"),"Hints for where node labels are to be placed; if empty, the node label's position is not modified."),LSe),Pk),xo),Ui(ua,ie(re(Ug,1),tt,175,0,[Vg]))))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,sxe),hG),"Port Alignment"),"Defines the default port distribution for a node. May be overridden for each side individually."),BSe),vs),HS),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,axe),hG),"Port Alignment (North)"),"Defines how ports on the northern side are placed, overriding the node's general port alignment."),vs),HS),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,oxe),hG),"Port Alignment (South)"),"Defines how ports on the southern side are placed, overriding the node's general port alignment."),vs),HS),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,cxe),hG),"Port Alignment (West)"),"Defines how ports on the western side are placed, overriding the node's general port alignment."),vs),HS),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,uxe),hG),"Port Alignment (East)"),"Defines how ports on the eastern side are placed, overriding the node's general port alignment."),vs),HS),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,E4),Dce),"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."),MSe),Pk),qS),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,dk),Dce),"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."),ISe),Pk),dAe),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,gk),Dce),"Node Size Minimum"),"The minimal size to which a node can be reduced."),DSe),Y1),na),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,uce),Dce),"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."),!1),za),Us),rn(Fn)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,hxe),cce),"Edge Label Placement"),"Gives a hint on where to put edge labels."),vSe),vs),XSe),rn(Vg)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,jz),cce),"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."),!1),za),Us),rn(Vg)))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,n3n),"font"),"Font Name"),"Font name used for a label."),kE),mt),rn(Vg)))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,g1t),"font"),"Font Size"),"Font size used for a label."),Cc),Za),rn(Vg)))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,pxe),Ice),"Port Anchor Offset"),"The offset to the port position where connections shall be attached."),Y1),na),rn(Bb)))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,fxe),Ice),"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."),Cc),Za),rn(Bb)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Qke),Ice),"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."),HSe),vs),ao),rn(Bb)))),en(t,new Vt(Zt(Qt(Jt(Wt(Xt(Kt(Yt(new Ht,Yke),Ice),"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."),qo),ma),rn(Bb)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,B7),Wxe),"Port Label Placement"),"Decides on a placement method for port labels; if empty, the node label's position is not modified."),jSe),Pk),jV),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,rxe),Wxe),"Port Labels Next to Port"),"Use 'portLabels.placement': NEXT_TO_PORT_OF_POSSIBLE."),!1),za),Us),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,ixe),Wxe),"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."),!0),za),Us),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Jke),w1t),"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."),!1),za),Us),rn(ua)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,exe),w1t),"Inside Self Loop"),"Whether a self loop should be routed inside a node instead of around that node."),!1),za),Us),rn(Fd)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,Coe),"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),qo),ma),rn(Fd)))),en(t,new Vt(Zt(Qt(Jt(pn(Wt(Xt(Kt(Yt(new Ht,p1t),"edge"),"Edge Type"),"The type of an edge. This is usually used for UML class diagrams, where associations must be handled differently from generalizations."),kSe),vs),nAe),rn(Fd)))),NT(t,new R6(AT(Xx(Yx(new hm,qn),"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.'))),NT(t,new R6(AT(Xx(Yx(new hm,"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.`))),NT(t,new R6(AT(Xx(Yx(new hm,Yl),"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."))),NT(t,new R6(AT(Xx(Yx(new hm,"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."))),NT(t,new R6(AT(Xx(Yx(new hm,zft),"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."))),NT(t,new R6(AT(Xx(Yx(new hm,"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."))),NT(t,new R6(AT(Xx(Yx(new hm,Dd),"Radial"),"Radial layout algorithms usually position the nodes of the graph on concentric circles."))),zct((new PR,t)),rut((new JJ,t)),wct((new BR,t))};var PS,Jyt,dSe,Bk,e3t,t3t,gSe,n3t,IV,pSe,VO,Mw,bSe,efe,tfe,vSe,wSe,mSe,ySe,kSe,xSe,Q4,ESe,r3t,UO,nfe,OV,TSe,Z4,_Se,WO,CSe,SSe,ASe,J4,LSe,Rb,MSe,NV,e5,DSe,p2,ISe,PV,KO,Fb,OSe,i3t,NSe,s3t,a3t,PSe,BSe,rfe,ife,sfe,afe,RSe,kl,BS,FSe,ofe,cfe,Hy,jSe,$Se,t5,HSe,Rk,BV,ufe,xE,o3t,lfe,c3t,u3t,zSe,l3t,GSe,h3t,Fk,qSe,RV,VSe,USe,jb,f3t,WSe,KSe,YSe;O(qh,"CoreOptions",684),M(103,22,{3:1,35:1,22:1,103:1},AM);var Y0,Xh,Df,f0,X0,RS=Gr(qh,P6e,103,Wr,_nn,qXt),d3t;M(272,22,{3:1,35:1,22:1,272:1},Fte);var EE,zy,TE,XSe=Gr(qh,"EdgeLabelPlacement",272,Wr,stn,VXt),g3t;M(218,22,{3:1,35:1,22:1,218:1},GF);var _E,YO,jk,hfe,ffe=Gr(qh,"EdgeRouting",218,Wr,Qtn,UXt),p3t;M(312,22,{3:1,35:1,22:1,312:1},WT);var QSe,ZSe,JSe,eAe,dfe,tAe,nAe=Gr(qh,"EdgeType",312,Wr,hrn,WXt),b3t;M(977,1,zh,PR),l.Qe=function(t){zct(t)};var rAe,iAe,sAe,aAe,v3t,oAe,FS;O(qh,"FixedLayouterOptions",977),M(978,1,{},BL),l.$e=function(){var t;return t=new NZ,t},l._e=function(t){},O(qh,"FixedLayouterOptions/FixedFactory",978),M(334,22,{3:1,35:1,22:1,334:1},jte);var Wg,FV,jS,cAe=Gr(qh,"HierarchyHandling",334,Wr,itn,KXt),w3t;M(285,22,{3:1,35:1,22:1,285:1},qF);var d0,b2,XO,QO,m3t=Gr(qh,"LabelSide",285,Wr,Xtn,YXt),y3t;M(93,22,{3:1,35:1,22:1,93:1},N3);var Q0,If,Qh,Of,Jl,Nf,Zh,g0,Pf,xo=Gr(qh,"NodeLabelPlacement",93,Wr,gin,XXt),k3t;M(249,22,{3:1,35:1,22:1,249:1},LM);var uAe,$S,v2,lAe,ZO,HS=Gr(qh,"PortAlignment",249,Wr,Cnn,QXt),x3t;M(98,22,{3:1,35:1,22:1,98:1},KT);var $b,tu,p0,CE,X1,w2,hAe=Gr(qh,"PortConstraints",98,Wr,Knn,ZXt),E3t;M(273,22,{3:1,35:1,22:1,273:1},YT);var zS,GS,Z0,JO,m2,$k,jV=Gr(qh,"PortLabelPlacement",273,Wr,lrn,JXt),T3t;M(61,22,{3:1,35:1,22:1,61:1},MM);var $n,An,_h,Ch,Bu,wu,Q1,Bf,ll,Ju,nu,hl,Ru,Fu,Rf,eh,th,Jh,xr,uc,Dn,ao=Gr(qh,"PortSide",61,Wr,xnn,nQt),_3t;M(981,1,zh,BR),l.Qe=function(t){wct(t)};var C3t,S3t,fAe,A3t,L3t;O(qh,"RandomLayouterOptions",981),M(982,1,{},$Z),l.$e=function(){var t;return t=new zZ,t},l._e=function(t){},O(qh,"RandomLayouterOptions/RandomFactory",982),M(374,22,{3:1,35:1,22:1,374:1},VF);var Gy,eN,tN,Hb,qS=Gr(qh,"SizeConstraint",374,Wr,Ytn,eQt),M3t;M(259,22,{3:1,35:1,22:1,259:1},P3);var nN,$V,SE,gfe,rN,VS,HV,zV,GV,dAe=Gr(qh,"SizeOptions",259,Wr,kin,tQt),D3t;M(370,1,{1949:1},Ux),l.b=!1,l.c=0,l.d=-1,l.e=null,l.f=null,l.g=-1,l.j=!1,l.k=!1,l.n=!1,l.o=0,l.q=0,l.r=0,O(Oc,"BasicProgressMonitor",370),M(972,209,mb,BZ),l.Ze=function(t,n){var r,s,o,h,d,v,x,_,L;switch(kr(n,"Box layout",2),o=uM(ft(Ft(t,(XH(),Qyt)))),h=u(Ft(t,Xyt),116),r=It(Mt(Ft(t,cSe))),s=It(Mt(Ft(t,uSe))),u(Ft(t,Xhe),311).g){case 0:d=(v=new Uu((!t.a&&(t.a=new at(hs,t,10,11)),t.a)),hn(),aa(v,new Zje(s)),v),x=A4e(t),_=ft(Ft(t,oSe)),(_==null||(Sn(_),_<=0))&&(_=1.3),L=ayn(d,o,h,x.a,x.b,r,(Sn(_),_)),sw(t,L.a,L.b,!1,!0);break;default:nwn(t,o,h,r)}ur(n)},O(Oc,"BoxLayoutProvider",972),M(973,1,ji,Zje),l.ue=function(t,n){return Tgn(this,u(t,33),u(n,33))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},l.a=!1,O(Oc,"BoxLayoutProvider/1",973),M(157,1,{157:1},H$,yUe),l.Ib=function(){return this.c?S5e(this.c):Yp(this.b)},O(Oc,"BoxLayoutProvider/Group",157),M(311,22,{3:1,35:1,22:1,311:1},UF);var gAe,pAe,bAe,pfe,vAe=Gr(Oc,"BoxLayoutProvider/PackingMode",311,Wr,Ztn,rQt),I3t;M(974,1,ji,RZ),l.ue=function(t,n){return SJt(u(t,157),u(n,157))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Oc,"BoxLayoutProvider/lambda$0$Type",974),M(975,1,ji,GB),l.ue=function(t,n){return yJt(u(t,157),u(n,157))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Oc,"BoxLayoutProvider/lambda$1$Type",975),M(976,1,ji,FZ),l.ue=function(t,n){return kJt(u(t,157),u(n,157))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(Oc,"BoxLayoutProvider/lambda$2$Type",976),M(1365,1,{831:1},jZ),l.qg=function(t,n){return SF(),!we(n,160)||Mze((W6(),u(t,160)),n)},O(Oc,"ElkSpacings/AbstractSpacingsBuilder/lambda$0$Type",1365),M(1366,1,Un,Jje),l.td=function(t){han(this.a,u(t,146))},O(Oc,"ElkSpacings/AbstractSpacingsBuilder/lambda$1$Type",1366),M(1367,1,Un,PZ),l.td=function(t){u(t,94),SF()},O(Oc,"ElkSpacings/AbstractSpacingsBuilder/lambda$2$Type",1367),M(1371,1,Un,e$e),l.td=function(t){Bin(this.a,u(t,94))},O(Oc,"ElkSpacings/AbstractSpacingsBuilder/lambda$3$Type",1371),M(1369,1,vi,bqe),l.Mb=function(t){return Qsn(this.a,this.b,u(t,146))},O(Oc,"ElkSpacings/AbstractSpacingsBuilder/lambda$4$Type",1369),M(1368,1,vi,vqe),l.Mb=function(t){return gKt(this.a,this.b,u(t,831))},O(Oc,"ElkSpacings/AbstractSpacingsBuilder/lambda$5$Type",1368),M(1370,1,Un,wqe),l.td=function(t){gZt(this.a,this.b,u(t,146))},O(Oc,"ElkSpacings/AbstractSpacingsBuilder/lambda$6$Type",1370),M(935,1,{},OZ),l.Kb=function(t){return wVe(t)},l.Fb=function(t){return this===t},O(Oc,"ElkUtil/lambda$0$Type",935),M(936,1,Un,mqe),l.td=function(t){Cdn(this.a,this.b,u(t,79))},l.a=0,l.b=0,O(Oc,"ElkUtil/lambda$1$Type",936),M(937,1,Un,yqe),l.td=function(t){CVt(this.a,this.b,u(t,202))},l.a=0,l.b=0,O(Oc,"ElkUtil/lambda$2$Type",937),M(938,1,Un,kqe),l.td=function(t){vWt(this.a,this.b,u(t,137))},l.a=0,l.b=0,O(Oc,"ElkUtil/lambda$3$Type",938),M(939,1,Un,t$e),l.td=function(t){MQt(this.a,u(t,469))},O(Oc,"ElkUtil/lambda$4$Type",939),M(342,1,{35:1,342:1},nVt),l.wd=function(t){return VWt(this,u(t,236))},l.Fb=function(t){var n;return we(t,342)?(n=u(t,342),this.a==n.a):!1},l.Hb=function(){return _s(this.a)},l.Ib=function(){return this.a+" (exclusive)"},l.a=0,O(Oc,"ExclusiveBounds/ExclusiveLowerBound",342),M(1138,209,mb,NZ),l.Ze=function(t,n){var r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce,Ee,Ne,Ve,nt,bt,zt,Ut;for(kr(n,"Fixed Layout",1),h=u(Ft(t,(bi(),wSe)),218),P=0,z=0,Ee=new rr((!t.a&&(t.a=new at(hs,t,10,11)),t.a));Ee.e!=Ee.i.gc();){for(le=u(pr(Ee),33),Ut=u(Ft(le,(hH(),FS)),8),Ut&&(C1(le,Ut.a,Ut.b),u(Ft(le,iAe),174).Hc((Bl(),Gy))&&(q=u(Ft(le,aAe),8),q.a>0&&q.b>0&&sw(le,q.a,q.b,!0,!0))),P=b.Math.max(P,le.i+le.g),z=b.Math.max(z,le.j+le.f),_=new rr((!le.n&&(le.n=new at(Jo,le,1,7)),le.n));_.e!=_.i.gc();)v=u(pr(_),137),Ut=u(Ft(v,FS),8),Ut&&C1(v,Ut.a,Ut.b),P=b.Math.max(P,le.i+v.i+v.g),z=b.Math.max(z,le.j+v.j+v.f);for(nt=new rr((!le.c&&(le.c=new at(xl,le,9,9)),le.c));nt.e!=nt.i.gc();)for(Ve=u(pr(nt),118),Ut=u(Ft(Ve,FS),8),Ut&&C1(Ve,Ut.a,Ut.b),bt=le.i+Ve.i,zt=le.j+Ve.j,P=b.Math.max(P,bt+Ve.g),z=b.Math.max(z,zt+Ve.f),x=new rr((!Ve.n&&(Ve.n=new at(Jo,Ve,1,7)),Ve.n));x.e!=x.i.gc();)v=u(pr(x),137),Ut=u(Ft(v,FS),8),Ut&&C1(v,Ut.a,Ut.b),P=b.Math.max(P,bt+v.i+v.g),z=b.Math.max(z,zt+v.j+v.f);for(o=new cr(fr(z0(le).a.Kc(),new V));Vr(o);)r=u(Pr(o),79),L=Olt(r),P=b.Math.max(P,L.a),z=b.Math.max(z,L.b);for(s=new cr(fr(hI(le).a.Kc(),new V));Vr(s);)r=u(Pr(s),79),us(n0(r))!=t&&(L=Olt(r),P=b.Math.max(P,L.a),z=b.Math.max(z,L.b))}if(h==($0(),_E))for(Ce=new rr((!t.a&&(t.a=new at(hs,t,10,11)),t.a));Ce.e!=Ce.i.gc();)for(le=u(pr(Ce),33),s=new cr(fr(z0(le).a.Kc(),new V));Vr(s);)r=u(Pr(s),79),d=Ebn(r),d.b==0?So(r,Z4,null):So(r,Z4,d);It(Mt(Ft(t,(hH(),sAe))))||(Ne=u(Ft(t,v3t),116),X=P+Ne.b+Ne.c,W=z+Ne.d+Ne.a,sw(t,X,W,!0,!0)),ur(n)},O(Oc,"FixedLayoutProvider",1138),M(373,134,{3:1,414:1,373:1,94:1,134:1},rl,KJe),l.Jf=function(t){var n,r,s,o,h,d,v,x,_;if(t)try{for(x=cy(t,";,;"),h=x,d=0,v=h.length;d>16&Ss|n^s<<16},l.Kc=function(){return new n$e(this)},l.Ib=function(){return this.a==null&&this.b==null?"pair(null,null)":this.a==null?"pair(null,"+Qo(this.b)+")":this.b==null?"pair("+Qo(this.a)+",null)":"pair("+Qo(this.a)+","+Qo(this.b)+")"},O(Oc,"Pair",46),M(983,1,ga,n$e),l.Nb=function(t){La(this,t)},l.Ob=function(){return!this.c&&(!this.b&&this.a.a!=null||this.a.b!=null)},l.Pb=function(){if(!this.c&&!this.b&&this.a.a!=null)return this.b=!0,this.a.a;if(!this.c&&this.a.b!=null)return this.c=!0,this.a.b;throw J(new xc)},l.Qb=function(){throw this.c&&this.a.b!=null?this.a.b=null:this.b&&this.a.a!=null&&(this.a.a=null),J(new zu)},l.b=!1,l.c=!1,O(Oc,"Pair/1",983),M(448,1,{448:1},IYe),l.Fb=function(t){return Vc(this.a,u(t,448).a)&&Vc(this.c,u(t,448).c)&&Vc(this.d,u(t,448).d)&&Vc(this.b,u(t,448).b)},l.Hb=function(){return fH(ie(re(Yn,1),yt,1,5,[this.a,this.c,this.d,this.b]))},l.Ib=function(){return"("+this.a+io+this.c+io+this.d+io+this.b+")"},O(Oc,"Quadruple",448),M(1126,209,mb,zZ),l.Ze=function(t,n){var r,s,o,h,d;if(kr(n,"Random Layout",1),(!t.a&&(t.a=new at(hs,t,10,11)),t.a).i==0){ur(n);return}h=u(Ft(t,(i3e(),A3t)),19),h&&h.a!=0?o=new m$(h.a):o=new Fie,r=uM(ft(Ft(t,C3t))),d=uM(ft(Ft(t,L3t))),s=u(Ft(t,S3t),116),Rmn(t,o,r,d,s),ur(n)},O(Oc,"RandomLayoutProvider",1126);var B3t;M(553,1,{}),l.qf=function(){return new Pt(this.f.i,this.f.j)},l.We=function(t){return iXe(t,(bi(),kl))?Ft(this.f,R3t):Ft(this.f,t)},l.rf=function(){return new Pt(this.f.g,this.f.f)},l.sf=function(){return this.g},l.Xe=function(t){return J2(this.f,t)},l.tf=function(t){Du(this.f,t.a),Iu(this.f,t.b)},l.uf=function(t){zv(this.f,t.a),Hv(this.f,t.b)},l.vf=function(t){this.g=t},l.g=0;var R3t;O(BC,"ElkGraphAdapters/AbstractElkGraphElementAdapter",553),M(554,1,{839:1},tF),l.wf=function(){var t,n;if(!this.b)for(this.b=p$(Wj(this.a).i),n=new rr(Wj(this.a));n.e!=n.i.gc();)t=u(pr(n),137),it(this.b,new tte(t));return this.b},l.b=null,O(BC,"ElkGraphAdapters/ElkEdgeAdapter",554),M(301,553,{},ym),l.xf=function(){return Nit(this)},l.a=null,O(BC,"ElkGraphAdapters/ElkGraphAdapter",301),M(630,553,{181:1},tte),O(BC,"ElkGraphAdapters/ElkLabelAdapter",630),M(629,553,{680:1},ene),l.wf=function(){return jun(this)},l.Af=function(){var t;return t=u(Ft(this.f,(bi(),WO)),142),!t&&(t=new yT),t},l.Cf=function(){return $un(this)},l.Ef=function(t){var n;n=new pne(t),So(this.f,(bi(),WO),n)},l.Ff=function(t){So(this.f,(bi(),Fb),new Jbe(t))},l.yf=function(){return this.d},l.zf=function(){var t,n;if(!this.a)for(this.a=new st,n=new cr(fr(hI(u(this.f,33)).a.Kc(),new V));Vr(n);)t=u(Pr(n),79),it(this.a,new tF(t));return this.a},l.Bf=function(){var t,n;if(!this.c)for(this.c=new st,n=new cr(fr(z0(u(this.f,33)).a.Kc(),new V));Vr(n);)t=u(Pr(n),79),it(this.c,new tF(t));return this.c},l.Df=function(){return Jj(u(this.f,33)).i!=0||It(Mt(u(this.f,33).We((bi(),UO))))},l.Gf=function(){Mrn(this,(Tm(),B3t))},l.a=null,l.b=null,l.c=null,l.d=null,l.e=null,O(BC,"ElkGraphAdapters/ElkNodeAdapter",629),M(1266,553,{838:1},D$e),l.wf=function(){return Kun(this)},l.zf=function(){var t,n;if(!this.a)for(this.a=Wd(u(this.f,118).xg().i),n=new rr(u(this.f,118).xg());n.e!=n.i.gc();)t=u(pr(n),79),it(this.a,new tF(t));return this.a},l.Bf=function(){var t,n;if(!this.c)for(this.c=Wd(u(this.f,118).yg().i),n=new rr(u(this.f,118).yg());n.e!=n.i.gc();)t=u(pr(n),79),it(this.c,new tF(t));return this.c},l.Hf=function(){return u(u(this.f,118).We((bi(),t5)),61)},l.If=function(){var t,n,r,s,o,h,d,v;for(s=L1(u(this.f,118)),r=new rr(u(this.f,118).yg());r.e!=r.i.gc();)for(t=u(pr(r),79),v=new rr((!t.c&&(t.c=new wn(mr,t,5,8)),t.c));v.e!=v.i.gc();){if(d=u(pr(v),82),Vm(zo(d),s))return!0;if(zo(d)==s&&It(Mt(Ft(t,(bi(),nfe)))))return!0}for(n=new rr(u(this.f,118).xg());n.e!=n.i.gc();)for(t=u(pr(n),79),h=new rr((!t.b&&(t.b=new wn(mr,t,4,7)),t.b));h.e!=h.i.gc();)if(o=u(pr(h),82),Vm(zo(o),s))return!0;return!1},l.a=null,l.b=null,l.c=null,O(BC,"ElkGraphAdapters/ElkPortAdapter",1266),M(1267,1,ji,GZ),l.ue=function(t,n){return b2n(u(t,118),u(n,118))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(BC,"ElkGraphAdapters/PortComparator",1267);var y2=ss(kh,"EObject"),AE=ss(S4,k1t),ef=ss(S4,x1t),iN=ss(S4,E1t),sN=ss(S4,"ElkShape"),mr=ss(S4,T1t),ra=ss(S4,Kxe),os=ss(S4,_1t),aN=ss(kh,C1t),US=ss(kh,"EFactory"),F3t,bfe=ss(kh,S1t),h1=ss(kh,"EPackage"),la,j3t,$3t,kAe,qV,H3t,xAe,EAe,TAe,k2,z3t,G3t,Jo=ss(S4,Yxe),hs=ss(S4,Xxe),xl=ss(S4,Qxe);M(90,1,A1t),l.Jg=function(){return this.Kg(),null},l.Kg=function(){return null},l.Lg=function(){return this.Kg(),!1},l.Mg=function(){return!1},l.Ng=function(t){_i(this,t)},O(wk,"BasicNotifierImpl",90),M(97,90,I1t),l.nh=function(){return Ll(this)},l.Og=function(t,n){return t},l.Pg=function(){throw J(new Fr)},l.Qg=function(t){var n;return n=go(u(gn(this.Tg(),this.Vg()),18)),this.eh().ih(this,n.n,n.f,t)},l.Rg=function(t,n){throw J(new Fr)},l.Sg=function(t,n,r){return Kl(this,t,n,r)},l.Tg=function(){var t;return this.Pg()&&(t=this.Pg().ck(),t)?t:this.zh()},l.Ug=function(){return Hse(this)},l.Vg=function(){throw J(new Fr)},l.Wg=function(){var t,n;return n=this.ph().dk(),!n&&this.Pg().ik(n=(PT(),t=bwe(xd(this.Tg())),t==null?Tfe:new OM(this,t))),n},l.Xg=function(t,n){return t},l.Yg=function(t){var n;return n=t.Gj(),n?t.aj():Ji(this.Tg(),t)},l.Zg=function(){var t;return t=this.Pg(),t?t.fk():null},l.$g=function(){return this.Pg()?this.Pg().ck():null},l._g=function(t,n,r){return NH(this,t,n,r)},l.ah=function(t){return A8(this,t)},l.bh=function(t,n){return Ire(this,t,n)},l.dh=function(){var t;return t=this.Pg(),!!t&&t.gk()},l.eh=function(){throw J(new Fr)},l.fh=function(){return SH(this)},l.gh=function(t,n,r,s){return Q6(this,t,n,s)},l.hh=function(t,n,r){var s;return s=u(gn(this.Tg(),n),66),s.Nj().Qj(this,this.yh(),n-this.Ah(),t,r)},l.ih=function(t,n,r,s){return r$(this,t,n,s)},l.jh=function(t,n,r){var s;return s=u(gn(this.Tg(),n),66),s.Nj().Rj(this,this.yh(),n-this.Ah(),t,r)},l.kh=function(){return!!this.Pg()&&!!this.Pg().ek()},l.lh=function(t){return Zie(this,t)},l.mh=function(t){return kXe(this,t)},l.oh=function(t){return Kut(this,t)},l.ph=function(){throw J(new Fr)},l.qh=function(){return this.Pg()?this.Pg().ek():null},l.rh=function(){return SH(this)},l.sh=function(t,n){Bse(this,t,n)},l.th=function(t){this.ph().hk(t)},l.uh=function(t){this.ph().kk(t)},l.vh=function(t){this.ph().jk(t)},l.wh=function(t,n){var r,s,o,h;return h=this.Zg(),h&&t&&(n=Xa(h.Vk(),this,n),h.Zk(this)),s=this.eh(),s&&(rae(this,this.eh(),this.Vg()).Bb&so?(o=s.fh(),o&&(t?!h&&o.Zk(this):o.Yk(this))):(n=(r=this.Vg(),r>=0?this.Qg(n):this.eh().ih(this,-1-r,null,n)),n=this.Sg(null,-1,n))),this.uh(t),n},l.xh=function(t){var n,r,s,o,h,d,v,x;if(r=this.Tg(),h=Ji(r,t),n=this.Ah(),h>=n)return u(t,66).Nj().Uj(this,this.yh(),h-n);if(h<=-1)if(d=v4((Yu(),Oa),r,t),d){if(ho(),u(d,66).Oj()||(d=F6(Po(Oa,d))),o=(s=this.Yg(d),u(s>=0?this._g(s,!0,!0):tw(this,d,!0),153)),x=d.Zj(),x>1||x==-1)return u(u(o,215).hl(t,!1),76)}else throw J(new Ln(i2+t.ne()+Oce));else if(t.$j())return s=this.Yg(t),u(s>=0?this._g(s,!1,!0):tw(this,t,!1),76);return v=new Hqe(this,t),v},l.yh=function(){return vme(this)},l.zh=function(){return(Rp(),En).S},l.Ah=function(){return Jn(this.zh())},l.Bh=function(t){Dse(this,t)},l.Ib=function(){return _f(this)},O(Tn,"BasicEObjectImpl",97);var q3t;M(114,97,{105:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1}),l.Ch=function(t){var n;return n=wme(this),n[t]},l.Dh=function(t,n){var r;r=wme(this),cs(r,t,n)},l.Eh=function(t){var n;n=wme(this),cs(n,t,null)},l.Jg=function(){return u(_n(this,4),126)},l.Kg=function(){throw J(new Fr)},l.Lg=function(){return(this.Db&4)!=0},l.Pg=function(){throw J(new Fr)},l.Fh=function(t){X6(this,2,t)},l.Rg=function(t,n){this.Db=n<<16|this.Db&255,this.Fh(t)},l.Tg=function(){return Su(this)},l.Vg=function(){return this.Db>>16},l.Wg=function(){var t,n;return PT(),n=bwe(xd((t=u(_n(this,16),26),t||this.zh()))),n==null?Tfe:new OM(this,n)},l.Mg=function(){return(this.Db&1)==0},l.Zg=function(){return u(_n(this,128),1935)},l.$g=function(){return u(_n(this,16),26)},l.dh=function(){return(this.Db&32)!=0},l.eh=function(){return u(_n(this,2),49)},l.kh=function(){return(this.Db&64)!=0},l.ph=function(){throw J(new Fr)},l.qh=function(){return u(_n(this,64),281)},l.th=function(t){X6(this,16,t)},l.uh=function(t){X6(this,128,t)},l.vh=function(t){X6(this,64,t)},l.yh=function(){return du(this)},l.Db=0,O(Tn,"MinimalEObjectImpl",114),M(115,114,{105:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1}),l.Fh=function(t){this.Cb=t},l.eh=function(){return this.Cb},O(Tn,"MinimalEObjectImpl/Container",115),M(1985,115,{105:1,413:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1}),l._g=function(t,n,r){return L3e(this,t,n,r)},l.jh=function(t,n,r){return v4e(this,t,n,r)},l.lh=function(t){return Awe(this,t)},l.sh=function(t,n){gye(this,t,n)},l.zh=function(){return cu(),G3t},l.Bh=function(t){rye(this,t)},l.Ve=function(){return tit(this)},l.We=function(t){return Ft(this,t)},l.Xe=function(t){return J2(this,t)},l.Ye=function(t,n){return So(this,t,n)},O(xb,"EMapPropertyHolderImpl",1985),M(567,115,{105:1,469:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1},pp),l._g=function(t,n,r){switch(t){case 0:return this.a;case 1:return this.b}return NH(this,t,n,r)},l.lh=function(t){switch(t){case 0:return this.a!=0;case 1:return this.b!=0}return Zie(this,t)},l.sh=function(t,n){switch(t){case 0:z$(this,Ue(ft(n)));return;case 1:G$(this,Ue(ft(n)));return}Bse(this,t,n)},l.zh=function(){return cu(),j3t},l.Bh=function(t){switch(t){case 0:z$(this,0);return;case 1:G$(this,0);return}Dse(this,t)},l.Ib=function(){var t;return this.Db&64?_f(this):(t=new Ph(_f(this)),t.a+=" (x: ",I3(t,this.a),t.a+=", y: ",I3(t,this.b),t.a+=")",t.a)},l.a=0,l.b=0,O(xb,"ElkBendPointImpl",567),M(723,1985,{105:1,413:1,160:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1}),l._g=function(t,n,r){return Oye(this,t,n,r)},l.hh=function(t,n,r){return _se(this,t,n,r)},l.jh=function(t,n,r){return uie(this,t,n,r)},l.lh=function(t){return Yme(this,t)},l.sh=function(t,n){K3e(this,t,n)},l.zh=function(){return cu(),H3t},l.Bh=function(t){Lye(this,t)},l.zg=function(){return this.k},l.Ag=function(){return Wj(this)},l.Ib=function(){return Bie(this)},l.k=null,O(xb,"ElkGraphElementImpl",723),M(724,723,{105:1,413:1,160:1,470:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1}),l._g=function(t,n,r){return Gye(this,t,n,r)},l.lh=function(t){return Xye(this,t)},l.sh=function(t,n){Y3e(this,t,n)},l.zh=function(){return cu(),z3t},l.Bh=function(t){t3e(this,t)},l.Bg=function(){return this.f},l.Cg=function(){return this.g},l.Dg=function(){return this.i},l.Eg=function(){return this.j},l.Fg=function(t,n){ej(this,t,n)},l.Gg=function(t,n){C1(this,t,n)},l.Hg=function(t){Du(this,t)},l.Ig=function(t){Iu(this,t)},l.Ib=function(){return Mse(this)},l.f=0,l.g=0,l.i=0,l.j=0,O(xb,"ElkShapeImpl",724),M(725,724,{105:1,413:1,82:1,160:1,470:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1}),l._g=function(t,n,r){return E3e(this,t,n,r)},l.hh=function(t,n,r){return z3e(this,t,n,r)},l.jh=function(t,n,r){return G3e(this,t,n,r)},l.lh=function(t){return fye(this,t)},l.sh=function(t,n){Z4e(this,t,n)},l.zh=function(){return cu(),$3t},l.Bh=function(t){p3e(this,t)},l.xg=function(){return!this.d&&(this.d=new wn(ra,this,8,5)),this.d},l.yg=function(){return!this.e&&(this.e=new wn(ra,this,7,4)),this.e},O(xb,"ElkConnectableShapeImpl",725),M(352,723,{105:1,413:1,79:1,160:1,352:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1},rv),l.Qg=function(t){return F3e(this,t)},l._g=function(t,n,r){switch(t){case 3:return nD(this);case 4:return!this.b&&(this.b=new wn(mr,this,4,7)),this.b;case 5:return!this.c&&(this.c=new wn(mr,this,5,8)),this.c;case 6:return!this.a&&(this.a=new at(os,this,6,6)),this.a;case 7:return Mn(),!this.b&&(this.b=new wn(mr,this,4,7)),!(this.b.i<=1&&(!this.c&&(this.c=new wn(mr,this,5,8)),this.c.i<=1));case 8:return Mn(),!!iC(this);case 9:return Mn(),!!ew(this);case 10:return Mn(),!this.b&&(this.b=new wn(mr,this,4,7)),this.b.i!=0&&(!this.c&&(this.c=new wn(mr,this,5,8)),this.c.i!=0)}return Oye(this,t,n,r)},l.hh=function(t,n,r){var s;switch(n){case 3:return this.Cb&&(r=(s=this.Db>>16,s>=0?F3e(this,r):this.Cb.ih(this,-1-s,null,r))),Dbe(this,u(t,33),r);case 4:return!this.b&&(this.b=new wn(mr,this,4,7)),ou(this.b,t,r);case 5:return!this.c&&(this.c=new wn(mr,this,5,8)),ou(this.c,t,r);case 6:return!this.a&&(this.a=new at(os,this,6,6)),ou(this.a,t,r)}return _se(this,t,n,r)},l.jh=function(t,n,r){switch(n){case 3:return Dbe(this,null,r);case 4:return!this.b&&(this.b=new wn(mr,this,4,7)),Xa(this.b,t,r);case 5:return!this.c&&(this.c=new wn(mr,this,5,8)),Xa(this.c,t,r);case 6:return!this.a&&(this.a=new at(os,this,6,6)),Xa(this.a,t,r)}return uie(this,t,n,r)},l.lh=function(t){switch(t){case 3:return!!nD(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 wn(mr,this,4,7)),!(this.b.i<=1&&(!this.c&&(this.c=new wn(mr,this,5,8)),this.c.i<=1));case 8:return iC(this);case 9:return ew(this);case 10:return!this.b&&(this.b=new wn(mr,this,4,7)),this.b.i!=0&&(!this.c&&(this.c=new wn(mr,this,5,8)),this.c.i!=0)}return Yme(this,t)},l.sh=function(t,n){switch(t){case 3:Wse(this,u(n,33));return;case 4:!this.b&&(this.b=new wn(mr,this,4,7)),_r(this.b),!this.b&&(this.b=new wn(mr,this,4,7)),fs(this.b,u(n,14));return;case 5:!this.c&&(this.c=new wn(mr,this,5,8)),_r(this.c),!this.c&&(this.c=new wn(mr,this,5,8)),fs(this.c,u(n,14));return;case 6:!this.a&&(this.a=new at(os,this,6,6)),_r(this.a),!this.a&&(this.a=new at(os,this,6,6)),fs(this.a,u(n,14));return}K3e(this,t,n)},l.zh=function(){return cu(),kAe},l.Bh=function(t){switch(t){case 3:Wse(this,null);return;case 4:!this.b&&(this.b=new wn(mr,this,4,7)),_r(this.b);return;case 5:!this.c&&(this.c=new wn(mr,this,5,8)),_r(this.c);return;case 6:!this.a&&(this.a=new at(os,this,6,6)),_r(this.a);return}Lye(this,t)},l.Ib=function(){return Out(this)},O(xb,"ElkEdgeImpl",352),M(439,1985,{105:1,413:1,202:1,439:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1},ld),l.Qg=function(t){return N3e(this,t)},l._g=function(t,n,r){switch(t){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 Bs(ef,this,5)),this.a;case 6:return wXe(this);case 7:return n?rse(this):this.i;case 8:return n?nse(this):this.f;case 9:return!this.g&&(this.g=new wn(os,this,9,10)),this.g;case 10:return!this.e&&(this.e=new wn(os,this,10,9)),this.e;case 11:return this.d}return L3e(this,t,n,r)},l.hh=function(t,n,r){var s,o,h;switch(n){case 6:return this.Cb&&(r=(o=this.Db>>16,o>=0?N3e(this,r):this.Cb.ih(this,-1-o,null,r))),Ibe(this,u(t,79),r);case 9:return!this.g&&(this.g=new wn(os,this,9,10)),ou(this.g,t,r);case 10:return!this.e&&(this.e=new wn(os,this,10,9)),ou(this.e,t,r)}return h=u(gn((s=u(_n(this,16),26),s||(cu(),qV)),n),66),h.Nj().Qj(this,du(this),n-Jn((cu(),qV)),t,r)},l.jh=function(t,n,r){switch(n){case 5:return!this.a&&(this.a=new Bs(ef,this,5)),Xa(this.a,t,r);case 6:return Ibe(this,null,r);case 9:return!this.g&&(this.g=new wn(os,this,9,10)),Xa(this.g,t,r);case 10:return!this.e&&(this.e=new wn(os,this,10,9)),Xa(this.e,t,r)}return v4e(this,t,n,r)},l.lh=function(t){switch(t){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!!wXe(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 Awe(this,t)},l.sh=function(t,n){switch(t){case 1:N8(this,Ue(ft(n)));return;case 2:B8(this,Ue(ft(n)));return;case 3:O8(this,Ue(ft(n)));return;case 4:P8(this,Ue(ft(n)));return;case 5:!this.a&&(this.a=new Bs(ef,this,5)),_r(this.a),!this.a&&(this.a=new Bs(ef,this,5)),fs(this.a,u(n,14));return;case 6:Not(this,u(n,79));return;case 7:K$(this,u(n,82));return;case 8:W$(this,u(n,82));return;case 9:!this.g&&(this.g=new wn(os,this,9,10)),_r(this.g),!this.g&&(this.g=new wn(os,this,9,10)),fs(this.g,u(n,14));return;case 10:!this.e&&(this.e=new wn(os,this,10,9)),_r(this.e),!this.e&&(this.e=new wn(os,this,10,9)),fs(this.e,u(n,14));return;case 11:$me(this,Hr(n));return}gye(this,t,n)},l.zh=function(){return cu(),qV},l.Bh=function(t){switch(t){case 1:N8(this,0);return;case 2:B8(this,0);return;case 3:O8(this,0);return;case 4:P8(this,0);return;case 5:!this.a&&(this.a=new Bs(ef,this,5)),_r(this.a);return;case 6:Not(this,null);return;case 7:K$(this,null);return;case 8:W$(this,null);return;case 9:!this.g&&(this.g=new wn(os,this,9,10)),_r(this.g);return;case 10:!this.e&&(this.e=new wn(os,this,10,9)),_r(this.e);return;case 11:$me(this,null);return}rye(this,t)},l.Ib=function(){return Zat(this)},l.b=0,l.c=0,l.d=null,l.j=0,l.k=0,O(xb,"ElkEdgeSectionImpl",439),M(150,115,{105:1,92:1,90:1,147:1,56:1,108:1,49:1,97:1,150:1,114:1,115:1}),l._g=function(t,n,r){var s;return t==0?(!this.Ab&&(this.Ab=new at(ti,this,0,3)),this.Ab):ph(this,t-Jn(this.zh()),gn((s=u(_n(this,16),26),s||this.zh()),t),n,r)},l.hh=function(t,n,r){var s,o;return n==0?(!this.Ab&&(this.Ab=new at(ti,this,0,3)),ou(this.Ab,t,r)):(o=u(gn((s=u(_n(this,16),26),s||this.zh()),n),66),o.Nj().Qj(this,du(this),n-Jn(this.zh()),t,r))},l.jh=function(t,n,r){var s,o;return n==0?(!this.Ab&&(this.Ab=new at(ti,this,0,3)),Xa(this.Ab,t,r)):(o=u(gn((s=u(_n(this,16),26),s||this.zh()),n),66),o.Nj().Rj(this,du(this),n-Jn(this.zh()),t,r))},l.lh=function(t){var n;return t==0?!!this.Ab&&this.Ab.i!=0:dh(this,t-Jn(this.zh()),gn((n=u(_n(this,16),26),n||this.zh()),t))},l.oh=function(t){return a6e(this,t)},l.sh=function(t,n){var r;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab),!this.Ab&&(this.Ab=new at(ti,this,0,3)),fs(this.Ab,u(n,14));return}yh(this,t-Jn(this.zh()),gn((r=u(_n(this,16),26),r||this.zh()),t),n)},l.uh=function(t){X6(this,128,t)},l.zh=function(){return on(),c4t},l.Bh=function(t){var n;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab);return}wh(this,t-Jn(this.zh()),gn((n=u(_n(this,16),26),n||this.zh()),t))},l.Gh=function(){this.Bb|=1},l.Hh=function(t){return uC(this,t)},l.Bb=0,O(Tn,"EModelElementImpl",150),M(704,150,{105:1,92:1,90:1,471:1,147:1,56:1,108:1,49:1,97:1,150:1,114:1,115:1},RR),l.Ih=function(t,n){return ult(this,t,n)},l.Jh=function(t){var n,r,s,o,h;if(this.a!=Gl(t)||t.Bb&256)throw J(new Ln(Pce+t.zb+dw));for(s=jo(t);jc(s.a).i!=0;){if(r=u(xI(s,0,(n=u(Te(jc(s.a),0),87),h=n.c,we(h,88)?u(h,26):(on(),sf))),26),Jv(r))return o=Gl(r).Nh().Jh(r),u(o,49).th(t),o;s=jo(r)}return(t.D!=null?t.D:t.B)=="java.util.Map$Entry"?new nKe(t):new wve(t)},l.Kh=function(t,n){return aw(this,t,n)},l._g=function(t,n,r){var s;switch(t){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),this.Ab;case 1:return this.a}return ph(this,t-Jn((on(),_2)),gn((s=u(_n(this,16),26),s||_2),t),n,r)},l.hh=function(t,n,r){var s,o;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),ou(this.Ab,t,r);case 1:return this.a&&(r=u(this.a,49).ih(this,4,h1,r)),Sye(this,u(t,235),r)}return o=u(gn((s=u(_n(this,16),26),s||(on(),_2)),n),66),o.Nj().Qj(this,du(this),n-Jn((on(),_2)),t,r)},l.jh=function(t,n,r){var s,o;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),Xa(this.Ab,t,r);case 1:return Sye(this,null,r)}return o=u(gn((s=u(_n(this,16),26),s||(on(),_2)),n),66),o.Nj().Rj(this,du(this),n-Jn((on(),_2)),t,r)},l.lh=function(t){var n;switch(t){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return!!this.a}return dh(this,t-Jn((on(),_2)),gn((n=u(_n(this,16),26),n||_2),t))},l.sh=function(t,n){var r;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab),!this.Ab&&(this.Ab=new at(ti,this,0,3)),fs(this.Ab,u(n,14));return;case 1:Nst(this,u(n,235));return}yh(this,t-Jn((on(),_2)),gn((r=u(_n(this,16),26),r||_2),t),n)},l.zh=function(){return on(),_2},l.Bh=function(t){var n;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab);return;case 1:Nst(this,null);return}wh(this,t-Jn((on(),_2)),gn((n=u(_n(this,16),26),n||_2),t))};var WS,_Ae,V3t;O(Tn,"EFactoryImpl",704),M(Sf,704,{105:1,2014:1,92:1,90:1,471:1,147:1,56:1,108:1,49:1,97:1,150:1,114:1,115:1},Y5),l.Ih=function(t,n){switch(t.yj()){case 12:return u(n,146).tg();case 13:return Qo(n);default:throw J(new Ln($7+t.ne()+dw))}},l.Jh=function(t){var n,r,s,o,h,d,v,x;switch(t.G==-1&&(t.G=(n=Gl(t),n?Dg(n.Mh(),t):-1)),t.G){case 4:return h=new j9,h;case 6:return d=new kpe,d;case 7:return v=new xpe,v;case 8:return s=new rv,s;case 9:return r=new pp,r;case 10:return o=new ld,o;case 11:return x=new qB,x;default:throw J(new Ln(Pce+t.zb+dw))}},l.Kh=function(t,n){switch(t.yj()){case 13:case 12:return null;default:throw J(new Ln($7+t.ne()+dw))}},O(xb,"ElkGraphFactoryImpl",Sf),M(438,150,{105:1,92:1,90:1,147:1,191:1,56:1,108:1,49:1,97:1,150:1,114:1,115:1}),l.Wg=function(){var t,n;return n=(t=u(_n(this,16),26),bwe(xd(t||this.zh()))),n==null?(PT(),PT(),Tfe):new EUe(this,n)},l._g=function(t,n,r){var s;switch(t){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),this.Ab;case 1:return this.ne()}return ph(this,t-Jn(this.zh()),gn((s=u(_n(this,16),26),s||this.zh()),t),n,r)},l.lh=function(t){var n;switch(t){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null}return dh(this,t-Jn(this.zh()),gn((n=u(_n(this,16),26),n||this.zh()),t))},l.sh=function(t,n){var r;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab),!this.Ab&&(this.Ab=new at(ti,this,0,3)),fs(this.Ab,u(n,14));return;case 1:this.Lh(Hr(n));return}yh(this,t-Jn(this.zh()),gn((r=u(_n(this,16),26),r||this.zh()),t),n)},l.zh=function(){return on(),u4t},l.Bh=function(t){var n;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab);return;case 1:this.Lh(null);return}wh(this,t-Jn(this.zh()),gn((n=u(_n(this,16),26),n||this.zh()),t))},l.ne=function(){return this.zb},l.Lh=function(t){au(this,t)},l.Ib=function(){return $_(this)},l.zb=null,O(Tn,"ENamedElementImpl",438),M(179,438,{105:1,92:1,90:1,147:1,191:1,56:1,235:1,108:1,49:1,97:1,150:1,179:1,114:1,115:1,675:1},rXe),l.Qg=function(t){return Kit(this,t)},l._g=function(t,n,r){var s;switch(t){case 0:return!this.Ab&&(this.Ab=new at(ti,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 Pm(this,f1,this)),this.rb;case 6:return!this.vb&&(this.vb=new S6(h1,this,6,7)),this.vb;case 7:return n?this.Db>>16==7?u(this.Cb,235):null:mXe(this)}return ph(this,t-Jn((on(),Qg)),gn((s=u(_n(this,16),26),s||Qg),t),n,r)},l.hh=function(t,n,r){var s,o,h;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),ou(this.Ab,t,r);case 4:return this.sb&&(r=u(this.sb,49).ih(this,1,US,r)),Dye(this,u(t,471),r);case 5:return!this.rb&&(this.rb=new Pm(this,f1,this)),ou(this.rb,t,r);case 6:return!this.vb&&(this.vb=new S6(h1,this,6,7)),ou(this.vb,t,r);case 7:return this.Cb&&(r=(o=this.Db>>16,o>=0?Kit(this,r):this.Cb.ih(this,-1-o,null,r))),Kl(this,t,7,r)}return h=u(gn((s=u(_n(this,16),26),s||(on(),Qg)),n),66),h.Nj().Qj(this,du(this),n-Jn((on(),Qg)),t,r)},l.jh=function(t,n,r){var s,o;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),Xa(this.Ab,t,r);case 4:return Dye(this,null,r);case 5:return!this.rb&&(this.rb=new Pm(this,f1,this)),Xa(this.rb,t,r);case 6:return!this.vb&&(this.vb=new S6(h1,this,6,7)),Xa(this.vb,t,r);case 7:return Kl(this,null,7,r)}return o=u(gn((s=u(_n(this,16),26),s||(on(),Qg)),n),66),o.Nj().Rj(this,du(this),n-Jn((on(),Qg)),t,r)},l.lh=function(t){var n;switch(t){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!!mXe(this)}return dh(this,t-Jn((on(),Qg)),gn((n=u(_n(this,16),26),n||Qg),t))},l.oh=function(t){var n;return n=Fgn(this,t),n||a6e(this,t)},l.sh=function(t,n){var r;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab),!this.Ab&&(this.Ab=new at(ti,this,0,3)),fs(this.Ab,u(n,14));return;case 1:au(this,Hr(n));return;case 2:tH(this,Hr(n));return;case 3:eH(this,Hr(n));return;case 4:Lse(this,u(n,471));return;case 5:!this.rb&&(this.rb=new Pm(this,f1,this)),_r(this.rb),!this.rb&&(this.rb=new Pm(this,f1,this)),fs(this.rb,u(n,14));return;case 6:!this.vb&&(this.vb=new S6(h1,this,6,7)),_r(this.vb),!this.vb&&(this.vb=new S6(h1,this,6,7)),fs(this.vb,u(n,14));return}yh(this,t-Jn((on(),Qg)),gn((r=u(_n(this,16),26),r||Qg),t),n)},l.vh=function(t){var n,r;if(t&&this.rb)for(r=new rr(this.rb);r.e!=r.i.gc();)n=pr(r),we(n,351)&&(u(n,351).w=null);X6(this,64,t)},l.zh=function(){return on(),Qg},l.Bh=function(t){var n;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab);return;case 1:au(this,null);return;case 2:tH(this,null);return;case 3:eH(this,null);return;case 4:Lse(this,null);return;case 5:!this.rb&&(this.rb=new Pm(this,f1,this)),_r(this.rb);return;case 6:!this.vb&&(this.vb=new S6(h1,this,6,7)),_r(this.vb);return}wh(this,t-Jn((on(),Qg)),gn((n=u(_n(this,16),26),n||Qg),t))},l.Gh=function(){bse(this)},l.Mh=function(){return!this.rb&&(this.rb=new Pm(this,f1,this)),this.rb},l.Nh=function(){return this.sb},l.Oh=function(){return this.ub},l.Ph=function(){return this.xb},l.Qh=function(){return this.yb},l.Rh=function(t){this.ub=t},l.Ib=function(){var t;return this.Db&64?$_(this):(t=new Ph($_(this)),t.a+=" (nsURI: ",To(t,this.yb),t.a+=", nsPrefix: ",To(t,this.xb),t.a+=")",t.a)},l.xb=null,l.yb=null,O(Tn,"EPackageImpl",179),M(555,179,{105:1,2016:1,555:1,92:1,90:1,147:1,191:1,56:1,235:1,108:1,49:1,97:1,150:1,179:1,114:1,115:1,675:1},oot),l.q=!1,l.r=!1;var U3t=!1;O(xb,"ElkGraphPackageImpl",555),M(354,724,{105:1,413:1,160:1,137:1,470:1,354:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1},j9),l.Qg=function(t){return P3e(this,t)},l._g=function(t,n,r){switch(t){case 7:return yXe(this);case 8:return this.a}return Gye(this,t,n,r)},l.hh=function(t,n,r){var s;switch(n){case 7:return this.Cb&&(r=(s=this.Db>>16,s>=0?P3e(this,r):this.Cb.ih(this,-1-s,null,r))),Ove(this,u(t,160),r)}return _se(this,t,n,r)},l.jh=function(t,n,r){return n==7?Ove(this,null,r):uie(this,t,n,r)},l.lh=function(t){switch(t){case 7:return!!yXe(this);case 8:return!an("",this.a)}return Xye(this,t)},l.sh=function(t,n){switch(t){case 7:f5e(this,u(n,160));return;case 8:Ome(this,Hr(n));return}Y3e(this,t,n)},l.zh=function(){return cu(),xAe},l.Bh=function(t){switch(t){case 7:f5e(this,null);return;case 8:Ome(this,"");return}t3e(this,t)},l.Ib=function(){return Kst(this)},l.a="",O(xb,"ElkLabelImpl",354),M(239,725,{105:1,413:1,82:1,160:1,33:1,470:1,239:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1},kpe),l.Qg=function(t){return j3e(this,t)},l._g=function(t,n,r){switch(t){case 9:return!this.c&&(this.c=new at(xl,this,9,9)),this.c;case 10:return!this.a&&(this.a=new at(hs,this,10,11)),this.a;case 11:return us(this);case 12:return!this.b&&(this.b=new at(ra,this,12,3)),this.b;case 13:return Mn(),!this.a&&(this.a=new at(hs,this,10,11)),this.a.i>0}return E3e(this,t,n,r)},l.hh=function(t,n,r){var s;switch(n){case 9:return!this.c&&(this.c=new at(xl,this,9,9)),ou(this.c,t,r);case 10:return!this.a&&(this.a=new at(hs,this,10,11)),ou(this.a,t,r);case 11:return this.Cb&&(r=(s=this.Db>>16,s>=0?j3e(this,r):this.Cb.ih(this,-1-s,null,r))),Hbe(this,u(t,33),r);case 12:return!this.b&&(this.b=new at(ra,this,12,3)),ou(this.b,t,r)}return z3e(this,t,n,r)},l.jh=function(t,n,r){switch(n){case 9:return!this.c&&(this.c=new at(xl,this,9,9)),Xa(this.c,t,r);case 10:return!this.a&&(this.a=new at(hs,this,10,11)),Xa(this.a,t,r);case 11:return Hbe(this,null,r);case 12:return!this.b&&(this.b=new at(ra,this,12,3)),Xa(this.b,t,r)}return G3e(this,t,n,r)},l.lh=function(t){switch(t){case 9:return!!this.c&&this.c.i!=0;case 10:return!!this.a&&this.a.i!=0;case 11:return!!us(this);case 12:return!!this.b&&this.b.i!=0;case 13:return!this.a&&(this.a=new at(hs,this,10,11)),this.a.i>0}return fye(this,t)},l.sh=function(t,n){switch(t){case 9:!this.c&&(this.c=new at(xl,this,9,9)),_r(this.c),!this.c&&(this.c=new at(xl,this,9,9)),fs(this.c,u(n,14));return;case 10:!this.a&&(this.a=new at(hs,this,10,11)),_r(this.a),!this.a&&(this.a=new at(hs,this,10,11)),fs(this.a,u(n,14));return;case 11:u5e(this,u(n,33));return;case 12:!this.b&&(this.b=new at(ra,this,12,3)),_r(this.b),!this.b&&(this.b=new at(ra,this,12,3)),fs(this.b,u(n,14));return}Z4e(this,t,n)},l.zh=function(){return cu(),EAe},l.Bh=function(t){switch(t){case 9:!this.c&&(this.c=new at(xl,this,9,9)),_r(this.c);return;case 10:!this.a&&(this.a=new at(hs,this,10,11)),_r(this.a);return;case 11:u5e(this,null);return;case 12:!this.b&&(this.b=new at(ra,this,12,3)),_r(this.b);return}p3e(this,t)},l.Ib=function(){return S5e(this)},O(xb,"ElkNodeImpl",239),M(186,725,{105:1,413:1,82:1,160:1,118:1,470:1,186:1,94:1,92:1,90:1,56:1,108:1,49:1,97:1,114:1,115:1},xpe),l.Qg=function(t){return B3e(this,t)},l._g=function(t,n,r){return t==9?L1(this):E3e(this,t,n,r)},l.hh=function(t,n,r){var s;switch(n){case 9:return this.Cb&&(r=(s=this.Db>>16,s>=0?B3e(this,r):this.Cb.ih(this,-1-s,null,r))),Obe(this,u(t,33),r)}return z3e(this,t,n,r)},l.jh=function(t,n,r){return n==9?Obe(this,null,r):G3e(this,t,n,r)},l.lh=function(t){return t==9?!!L1(this):fye(this,t)},l.sh=function(t,n){switch(t){case 9:c5e(this,u(n,33));return}Z4e(this,t,n)},l.zh=function(){return cu(),TAe},l.Bh=function(t){switch(t){case 9:c5e(this,null);return}p3e(this,t)},l.Ib=function(){return Nct(this)},O(xb,"ElkPortImpl",186);var W3t=ss(Qa,"BasicEMap/Entry");M(1092,115,{105:1,42:1,92:1,90:1,133:1,56:1,108:1,49:1,97:1,114:1,115:1},qB),l.Fb=function(t){return this===t},l.cd=function(){return this.b},l.Hb=function(){return xv(this)},l.Uh=function(t){Nme(this,u(t,146))},l._g=function(t,n,r){switch(t){case 0:return this.b;case 1:return this.c}return NH(this,t,n,r)},l.lh=function(t){switch(t){case 0:return!!this.b;case 1:return this.c!=null}return Zie(this,t)},l.sh=function(t,n){switch(t){case 0:Nme(this,u(n,146));return;case 1:Rme(this,n);return}Bse(this,t,n)},l.zh=function(){return cu(),k2},l.Bh=function(t){switch(t){case 0:Nme(this,null);return;case 1:Rme(this,null);return}Dse(this,t)},l.Sh=function(){var t;return this.a==-1&&(t=this.b,this.a=t?Xi(t):0),this.a},l.dd=function(){return this.c},l.Th=function(t){this.a=t},l.ed=function(t){var n;return n=this.c,Rme(this,t),n},l.Ib=function(){var t;return this.Db&64?_f(this):(t=new Tp,Yr(Yr(Yr(t,this.b?this.b.tg():Pu),Ioe),r_(this.c)),t.a)},l.a=-1,l.c=null;var Dw=O(xb,"ElkPropertyToValueMapEntryImpl",1092);M(984,1,{},VB),O(Ia,"JsonAdapter",984),M(210,60,q0,dd),O(Ia,"JsonImportException",210),M(857,1,{},Yit),O(Ia,"JsonImporter",857),M(891,1,{},xqe),O(Ia,"JsonImporter/lambda$0$Type",891),M(892,1,{},Eqe),O(Ia,"JsonImporter/lambda$1$Type",892),M(900,1,{},r$e),O(Ia,"JsonImporter/lambda$10$Type",900),M(902,1,{},Tqe),O(Ia,"JsonImporter/lambda$11$Type",902),M(903,1,{},_qe),O(Ia,"JsonImporter/lambda$12$Type",903),M(909,1,{},RYe),O(Ia,"JsonImporter/lambda$13$Type",909),M(908,1,{},BYe),O(Ia,"JsonImporter/lambda$14$Type",908),M(904,1,{},Cqe),O(Ia,"JsonImporter/lambda$15$Type",904),M(905,1,{},Sqe),O(Ia,"JsonImporter/lambda$16$Type",905),M(906,1,{},Aqe),O(Ia,"JsonImporter/lambda$17$Type",906),M(907,1,{},Lqe),O(Ia,"JsonImporter/lambda$18$Type",907),M(912,1,{},i$e),O(Ia,"JsonImporter/lambda$19$Type",912),M(893,1,{},s$e),O(Ia,"JsonImporter/lambda$2$Type",893),M(910,1,{},a$e),O(Ia,"JsonImporter/lambda$20$Type",910),M(911,1,{},o$e),O(Ia,"JsonImporter/lambda$21$Type",911),M(915,1,{},c$e),O(Ia,"JsonImporter/lambda$22$Type",915),M(913,1,{},u$e),O(Ia,"JsonImporter/lambda$23$Type",913),M(914,1,{},l$e),O(Ia,"JsonImporter/lambda$24$Type",914),M(917,1,{},h$e),O(Ia,"JsonImporter/lambda$25$Type",917),M(916,1,{},f$e),O(Ia,"JsonImporter/lambda$26$Type",916),M(918,1,Un,Mqe),l.td=function(t){drn(this.b,this.a,Hr(t))},O(Ia,"JsonImporter/lambda$27$Type",918),M(919,1,Un,Dqe),l.td=function(t){grn(this.b,this.a,Hr(t))},O(Ia,"JsonImporter/lambda$28$Type",919),M(920,1,{},Iqe),O(Ia,"JsonImporter/lambda$29$Type",920),M(896,1,{},d$e),O(Ia,"JsonImporter/lambda$3$Type",896),M(921,1,{},Oqe),O(Ia,"JsonImporter/lambda$30$Type",921),M(922,1,{},g$e),O(Ia,"JsonImporter/lambda$31$Type",922),M(923,1,{},p$e),O(Ia,"JsonImporter/lambda$32$Type",923),M(924,1,{},b$e),O(Ia,"JsonImporter/lambda$33$Type",924),M(925,1,{},v$e),O(Ia,"JsonImporter/lambda$34$Type",925),M(859,1,{},w$e),O(Ia,"JsonImporter/lambda$35$Type",859),M(929,1,{},AWe),O(Ia,"JsonImporter/lambda$36$Type",929),M(926,1,Un,m$e),l.td=function(t){vnn(this.a,u(t,469))},O(Ia,"JsonImporter/lambda$37$Type",926),M(927,1,Un,jqe),l.td=function(t){VUt(this.a,this.b,u(t,202))},O(Ia,"JsonImporter/lambda$38$Type",927),M(928,1,Un,$qe),l.td=function(t){UUt(this.a,this.b,u(t,202))},O(Ia,"JsonImporter/lambda$39$Type",928),M(894,1,{},y$e),O(Ia,"JsonImporter/lambda$4$Type",894),M(930,1,Un,k$e),l.td=function(t){wnn(this.a,u(t,8))},O(Ia,"JsonImporter/lambda$40$Type",930),M(895,1,{},x$e),O(Ia,"JsonImporter/lambda$5$Type",895),M(899,1,{},E$e),O(Ia,"JsonImporter/lambda$6$Type",899),M(897,1,{},T$e),O(Ia,"JsonImporter/lambda$7$Type",897),M(898,1,{},_$e),O(Ia,"JsonImporter/lambda$8$Type",898),M(901,1,{},C$e),O(Ia,"JsonImporter/lambda$9$Type",901),M(948,1,Un,S$e),l.td=function(t){O6(this.a,new Bm(Hr(t)))},O(Ia,"JsonMetaDataConverter/lambda$0$Type",948),M(949,1,Un,A$e),l.td=function(t){NZt(this.a,u(t,237))},O(Ia,"JsonMetaDataConverter/lambda$1$Type",949),M(950,1,Un,L$e),l.td=function(t){Den(this.a,u(t,149))},O(Ia,"JsonMetaDataConverter/lambda$2$Type",950),M(951,1,Un,M$e),l.td=function(t){PZt(this.a,u(t,175))},O(Ia,"JsonMetaDataConverter/lambda$3$Type",951),M(237,22,{3:1,35:1,22:1,237:1},E6);var VV,UV,vfe,WV,KV,YV,wfe,mfe,XV=Gr(BI,"GraphFeature",237,Wr,rin,sQt),K3t;M(13,1,{35:1,146:1},Zi,zs,dn,fo),l.wd=function(t){return qWt(this,u(t,146))},l.Fb=function(t){return iXe(this,t)},l.wg=function(){return xt(this)},l.tg=function(){return this.b},l.Hb=function(){return Ig(this.b)},l.Ib=function(){return this.b},O(BI,"Property",13),M(818,1,ji,epe),l.ue=function(t,n){return con(this,u(t,94),u(n,94))},l.Fb=function(t){return this===t},l.ve=function(){return new ue(this)},O(BI,"PropertyHolderComparator",818),M(695,1,ga,tpe),l.Nb=function(t){La(this,t)},l.Pb=function(){return wrn(this)},l.Qb=function(){Eze()},l.Ob=function(){return!!this.a},O(pG,"ElkGraphUtil/AncestorIterator",695);var CAe=ss(Qa,"EList");M(67,52,{20:1,28:1,52:1,14:1,15:1,67:1,58:1}),l.Vc=function(t,n){G_(this,t,n)},l.Fc=function(t){return Br(this,t)},l.Wc=function(t,n){return iye(this,t,n)},l.Gc=function(t){return fs(this,t)},l.Zh=function(){return new C6(this)},l.$h=function(){return new NM(this)},l._h=function(t){return _D(this,t)},l.ai=function(){return!0},l.bi=function(t,n){},l.ci=function(){},l.di=function(t,n){Nre(this,t,n)},l.ei=function(t,n,r){},l.fi=function(t,n){},l.gi=function(t,n,r){},l.Fb=function(t){return yct(this,t)},l.Hb=function(){return Jme(this)},l.hi=function(){return!1},l.Kc=function(){return new rr(this)},l.Yc=function(){return new _6(this)},l.Zc=function(t){var n;if(n=this.gc(),t<0||t>n)throw J(new Im(t,n));return new jne(this,t)},l.ji=function(t,n){this.ii(t,this.Xc(n))},l.Mc=function(t){return N$(this,t)},l.li=function(t,n){return n},l._c=function(t,n){return r4(this,t,n)},l.Ib=function(){return Vye(this)},l.ni=function(){return!0},l.oi=function(t,n){return K8(this,n)},O(Qa,"AbstractEList",67),M(63,67,Od,X5,jv,Vme),l.Vh=function(t,n){return Cse(this,t,n)},l.Wh=function(t){return xit(this,t)},l.Xh=function(t,n){$D(this,t,n)},l.Yh=function(t){cD(this,t)},l.pi=function(t){return fme(this,t)},l.$b=function(){A_(this)},l.Hc=function(t){return u7(this,t)},l.Xb=function(t){return Te(this,t)},l.qi=function(t){var n,r,s;++this.j,r=this.g==null?0:this.g.length,t>r&&(s=this.g,n=r+(r/2|0)+4,n=0?(this.$c(n),!0):!1},l.mi=function(t,n){return this.Ui(t,this.oi(t,n))},l.gc=function(){return this.Vi()},l.Pc=function(){return this.Wi()},l.Qc=function(t){return this.Xi(t)},l.Ib=function(){return this.Yi()},O(Qa,"DelegatingEList",1995),M(1996,1995,bdt),l.Vh=function(t,n){return B5e(this,t,n)},l.Wh=function(t){return this.Vh(this.Vi(),t)},l.Xh=function(t,n){sot(this,t,n)},l.Yh=function(t){Xat(this,t)},l.ai=function(){return!this.bj()},l.$b=function(){pC(this)},l.Zi=function(t,n,r,s,o){return new aXe(this,t,n,r,s,o)},l.$i=function(t){_i(this.Ai(),t)},l._i=function(){return null},l.aj=function(){return-1},l.Ai=function(){return null},l.bj=function(){return!1},l.cj=function(t,n){return n},l.dj=function(t,n){return n},l.ej=function(){return!1},l.fj=function(){return!this.Ri()},l.ii=function(t,n){var r,s;return this.ej()?(s=this.fj(),r=g4e(this,t,n),this.$i(this.Zi(7,ct(n),r,t,s)),r):g4e(this,t,n)},l.$c=function(t){var n,r,s,o;return this.ej()?(r=null,s=this.fj(),n=this.Zi(4,o=Sj(this,t),null,t,s),this.bj()&&o?(r=this.dj(o,r),r?(r.Ei(n),r.Fi()):this.$i(n)):r?(r.Ei(n),r.Fi()):this.$i(n),o):(o=Sj(this,t),this.bj()&&o&&(r=this.dj(o,null),r&&r.Fi()),o)},l.mi=function(t,n){return dut(this,t,n)},O(wk,"DelegatingNotifyingListImpl",1996),M(143,1,XI),l.Ei=function(t){return t4e(this,t)},l.Fi=function(){Gre(this)},l.xi=function(){return this.d},l._i=function(){return null},l.gj=function(){return null},l.yi=function(t){return-1},l.zi=function(){return Jot(this)},l.Ai=function(){return null},l.Bi=function(){return v5e(this)},l.Ci=function(){return this.o<0?this.o<-2?-2-this.o-1:-1:this.o},l.hj=function(){return!1},l.Di=function(t){var n,r,s,o,h,d,v,x,_,L,P;switch(this.d){case 1:case 2:switch(o=t.xi(),o){case 1:case 2:if(h=t.Ai(),je(h)===je(this.Ai())&&this.yi(null)==t.yi(null))return this.g=t.zi(),t.xi()==1&&(this.d=1),!0}case 4:{switch(o=t.xi(),o){case 4:{if(h=t.Ai(),je(h)===je(this.Ai())&&this.yi(null)==t.yi(null))return _=J5e(this),x=this.o<0?this.o<-2?-2-this.o-1:-1:this.o,d=t.Ci(),this.d=6,P=new jv(2),x<=d?(Br(P,this.n),Br(P,t.Bi()),this.g=ie(re(Lr,1),Jr,25,15,[this.o=x,d+1])):(Br(P,t.Bi()),Br(P,this.n),this.g=ie(re(Lr,1),Jr,25,15,[this.o=d,x])),this.n=P,_||(this.o=-2-this.o-1),!0;break}}break}case 6:{switch(o=t.xi(),o){case 4:{if(h=t.Ai(),je(h)===je(this.Ai())&&this.yi(null)==t.yi(null)){for(_=J5e(this),d=t.Ci(),L=u(this.g,48),s=Me(Lr,Jr,25,L.length+1,15,1),n=0;n>>0,n.toString(16))),s.a+=" (eventType: ",this.d){case 1:{s.a+="SET";break}case 2:{s.a+="UNSET";break}case 3:{s.a+="ADD";break}case 5:{s.a+="ADD_MANY";break}case 4:{s.a+="REMOVE";break}case 6:{s.a+="REMOVE_MANY";break}case 7:{s.a+="MOVE";break}case 8:{s.a+="REMOVING_ADAPTER";break}case 9:{s.a+="RESOLVE";break}default:{cte(s,this.d);break}}if(Hct(this)&&(s.a+=", touch: true"),s.a+=", position: ",cte(s,this.o<0?this.o<-2?-2-this.o-1:-1:this.o),s.a+=", notifier: ",QT(s,this.Ai()),s.a+=", feature: ",QT(s,this._i()),s.a+=", oldValue: ",QT(s,v5e(this)),s.a+=", newValue: ",this.d==6&&we(this.g,48)){for(r=u(this.g,48),s.a+="[",t=0;t10?((!this.b||this.c.j!=this.a)&&(this.b=new l_(this),this.a=this.j),_0(this.b,t)):u7(this,t)},l.ni=function(){return!0},l.a=0,O(Qa,"AbstractEList/1",953),M(295,73,noe,Im),O(Qa,"AbstractEList/BasicIndexOutOfBoundsException",295),M(40,1,ga,rr),l.Nb=function(t){La(this,t)},l.mj=function(){if(this.i.j!=this.f)throw J(new uh)},l.nj=function(){return pr(this)},l.Ob=function(){return this.e!=this.i.gc()},l.Pb=function(){return this.nj()},l.Qb=function(){J_(this)},l.e=0,l.f=0,l.g=-1,O(Qa,"AbstractEList/EIterator",40),M(278,40,r0,_6,jne),l.Qb=function(){J_(this)},l.Rb=function(t){Trt(this,t)},l.oj=function(){var t;try{return t=this.d.Xb(--this.e),this.mj(),this.g=this.e,t}catch(n){throw n=ts(n),we(n,73)?(this.mj(),J(new xc)):J(n)}},l.pj=function(t){_it(this,t)},l.Sb=function(){return this.e!=0},l.Tb=function(){return this.e},l.Ub=function(){return this.oj()},l.Vb=function(){return this.e-1},l.Wb=function(t){this.pj(t)},O(Qa,"AbstractEList/EListIterator",278),M(341,40,ga,C6),l.nj=function(){return Jie(this)},l.Qb=function(){throw J(new Fr)},O(Qa,"AbstractEList/NonResolvingEIterator",341),M(385,278,r0,NM,Kbe),l.Rb=function(t){throw J(new Fr)},l.nj=function(){var t;try{return t=this.c.ki(this.e),this.mj(),this.g=this.e++,t}catch(n){throw n=ts(n),we(n,73)?(this.mj(),J(new xc)):J(n)}},l.oj=function(){var t;try{return t=this.c.ki(--this.e),this.mj(),this.g=this.e,t}catch(n){throw n=ts(n),we(n,73)?(this.mj(),J(new xc)):J(n)}},l.Qb=function(){throw J(new Fr)},l.Wb=function(t){throw J(new Fr)},O(Qa,"AbstractEList/NonResolvingEListIterator",385),M(1982,67,vdt),l.Vh=function(t,n){var r,s,o,h,d,v,x,_,L,P,z;if(o=n.gc(),o!=0){for(_=u(_n(this.a,4),126),L=_==null?0:_.length,z=L+o,s=kie(this,z),P=L-t,P>0&&Hc(_,t,s,t+o,P),x=n.Kc(),d=0;dr)throw J(new Im(t,r));return new vYe(this,t)},l.$b=function(){var t,n;++this.j,t=u(_n(this.a,4),126),n=t==null?0:t.length,s7(this,null),Nre(this,n,t)},l.Hc=function(t){var n,r,s,o,h;if(n=u(_n(this.a,4),126),n!=null){if(t!=null){for(s=n,o=0,h=s.length;o=r)throw J(new Im(t,r));return n[t]},l.Xc=function(t){var n,r,s;if(n=u(_n(this.a,4),126),n!=null){if(t!=null){for(r=0,s=n.length;rr)throw J(new Im(t,r));return new bYe(this,t)},l.ii=function(t,n){var r,s,o;if(r=Irt(this),o=r==null?0:r.length,t>=o)throw J(new Do(qce+t+Eb+o));if(n>=o)throw J(new Do(Vce+n+Eb+o));return s=r[n],t!=n&&(t0&&Hc(t,0,n,0,r),n},l.Qc=function(t){var n,r,s;return n=u(_n(this.a,4),126),s=n==null?0:n.length,s>0&&(t.lengths&&cs(t,s,null),t};var Y3t;O(Qa,"ArrayDelegatingEList",1982),M(1038,40,ga,CZe),l.mj=function(){if(this.b.j!=this.f||je(u(_n(this.b.a,4),126))!==je(this.a))throw J(new uh)},l.Qb=function(){J_(this),this.a=u(_n(this.b.a,4),126)},O(Qa,"ArrayDelegatingEList/EIterator",1038),M(706,278,r0,$Ke,bYe),l.mj=function(){if(this.b.j!=this.f||je(u(_n(this.b.a,4),126))!==je(this.a))throw J(new uh)},l.pj=function(t){_it(this,t),this.a=u(_n(this.b.a,4),126)},l.Qb=function(){J_(this),this.a=u(_n(this.b.a,4),126)},O(Qa,"ArrayDelegatingEList/EListIterator",706),M(1039,341,ga,SZe),l.mj=function(){if(this.b.j!=this.f||je(u(_n(this.b.a,4),126))!==je(this.a))throw J(new uh)},O(Qa,"ArrayDelegatingEList/NonResolvingEIterator",1039),M(707,385,r0,HKe,vYe),l.mj=function(){if(this.b.j!=this.f||je(u(_n(this.b.a,4),126))!==je(this.a))throw J(new uh)},O(Qa,"ArrayDelegatingEList/NonResolvingEListIterator",707),M(606,295,noe,zte),O(Qa,"BasicEList/BasicIndexOutOfBoundsException",606),M(696,63,Od,O2e),l.Vc=function(t,n){throw J(new Fr)},l.Fc=function(t){throw J(new Fr)},l.Wc=function(t,n){throw J(new Fr)},l.Gc=function(t){throw J(new Fr)},l.$b=function(){throw J(new Fr)},l.qi=function(t){throw J(new Fr)},l.Kc=function(){return this.Zh()},l.Yc=function(){return this.$h()},l.Zc=function(t){return this._h(t)},l.ii=function(t,n){throw J(new Fr)},l.ji=function(t,n){throw J(new Fr)},l.$c=function(t){throw J(new Fr)},l.Mc=function(t){throw J(new Fr)},l._c=function(t,n){throw J(new Fr)},O(Qa,"BasicEList/UnmodifiableEList",696),M(705,1,{3:1,20:1,14:1,15:1,58:1,589:1}),l.Vc=function(t,n){NWt(this,t,u(n,42))},l.Fc=function(t){return yKt(this,u(t,42))},l.Jc=function(t){Da(this,t)},l.Xb=function(t){return u(Te(this.c,t),133)},l.ii=function(t,n){return u(this.c.ii(t,n),42)},l.ji=function(t,n){PWt(this,t,u(n,42))},l.Lc=function(){return new vn(null,new mn(this,16))},l.$c=function(t){return u(this.c.$c(t),42)},l._c=function(t,n){return AZt(this,t,u(n,42))},l.ad=function(t){Y3(this,t)},l.Nc=function(){return new mn(this,16)},l.Oc=function(){return new vn(null,new mn(this,16))},l.Wc=function(t,n){return this.c.Wc(t,n)},l.Gc=function(t){return this.c.Gc(t)},l.$b=function(){this.c.$b()},l.Hc=function(t){return this.c.Hc(t)},l.Ic=function(t){return MD(this.c,t)},l.qj=function(){var t,n,r;if(this.d==null){for(this.d=Me(SAe,p8e,63,2*this.f+1,0,1),r=this.e,this.f=0,n=this.c.Kc();n.e!=n.i.gc();)t=u(n.nj(),133),RH(this,t);this.e=r}},l.Fb=function(t){return fWe(this,t)},l.Hb=function(){return Jme(this.c)},l.Xc=function(t){return this.c.Xc(t)},l.rj=function(){this.c=new I$e(this)},l.dc=function(){return this.f==0},l.Kc=function(){return this.c.Kc()},l.Yc=function(){return this.c.Yc()},l.Zc=function(t){return this.c.Zc(t)},l.sj=function(){return hD(this)},l.tj=function(t,n,r){return new LWe(t,n,r)},l.uj=function(){return new bp},l.Mc=function(t){return Wet(this,t)},l.gc=function(){return this.f},l.bd=function(t,n){return new Zd(this.c,t,n)},l.Pc=function(){return this.c.Pc()},l.Qc=function(t){return this.c.Qc(t)},l.Ib=function(){return Vye(this.c)},l.e=0,l.f=0,O(Qa,"BasicEMap",705),M(1033,63,Od,I$e),l.bi=function(t,n){vVt(this,u(n,133))},l.ei=function(t,n,r){var s;++(s=this,u(n,133),s).a.e},l.fi=function(t,n){wVt(this,u(n,133))},l.gi=function(t,n,r){oKt(this,u(n,133),u(r,133))},l.di=function(t,n){Rtt(this.a)},O(Qa,"BasicEMap/1",1033),M(1034,63,Od,bp),l.ri=function(t){return Me(L3n,wdt,612,t,0,1)},O(Qa,"BasicEMap/2",1034),M(1035,H1,Xu,O$e),l.$b=function(){this.a.c.$b()},l.Hc=function(t){return qie(this.a,t)},l.Kc=function(){return this.a.f==0?(u8(),uN.a):new gze(this.a)},l.Mc=function(t){var n;return n=this.a.f,CH(this.a,t),this.a.f!=n},l.gc=function(){return this.a.f},O(Qa,"BasicEMap/3",1035),M(1036,28,hy,N$e),l.$b=function(){this.a.c.$b()},l.Hc=function(t){return kct(this.a,t)},l.Kc=function(){return this.a.f==0?(u8(),uN.a):new pze(this.a)},l.gc=function(){return this.a.f},O(Qa,"BasicEMap/4",1036),M(1037,H1,Xu,P$e),l.$b=function(){this.a.c.$b()},l.Hc=function(t){var n,r,s,o,h,d,v,x,_;if(this.a.f>0&&we(t,42)&&(this.a.qj(),x=u(t,42),v=x.cd(),o=v==null?0:Xi(v),h=Nbe(this.a,o),n=this.a.d[h],n)){for(r=u(n.g,367),_=n.i,d=0;d<_;++d)if(s=r[d],s.Sh()==o&&s.Fb(x))return!0}return!1},l.Kc=function(){return this.a.f==0?(u8(),uN.a):new tre(this.a)},l.Mc=function(t){return dot(this,t)},l.gc=function(){return this.a.f},O(Qa,"BasicEMap/5",1037),M(613,1,ga,tre),l.Nb=function(t){La(this,t)},l.Ob=function(){return this.b!=-1},l.Pb=function(){var t;if(this.f.e!=this.c)throw J(new uh);if(this.b==-1)throw J(new xc);return this.d=this.a,this.e=this.b,tst(this),t=u(this.f.d[this.d].g[this.e],133),this.vj(t)},l.Qb=function(){if(this.f.e!=this.c)throw J(new uh);if(this.e==-1)throw J(new zu);this.f.c.Mc(Te(this.f.d[this.d],this.e)),this.c=this.f.e,this.e=-1,this.a==this.d&&this.b!=-1&&--this.b},l.vj=function(t){return t},l.a=0,l.b=-1,l.c=0,l.d=0,l.e=0,O(Qa,"BasicEMap/BasicEMapIterator",613),M(1031,613,ga,gze),l.vj=function(t){return t.cd()},O(Qa,"BasicEMap/BasicEMapKeyIterator",1031),M(1032,613,ga,pze),l.vj=function(t){return t.dd()},O(Qa,"BasicEMap/BasicEMapValueIterator",1032),M(1030,1,ow,B$e),l.wc=function(t){B_(this,t)},l.yc=function(t,n,r){return Rie(this,t,n,r)},l.$b=function(){this.a.c.$b()},l._b=function(t){return Kqe(this,t)},l.uc=function(t){return kct(this.a,t)},l.vc=function(){return Xnn(this.a)},l.Fb=function(t){return fWe(this.a,t)},l.xc=function(t){return r1(this.a,t)},l.Hb=function(){return Jme(this.a.c)},l.dc=function(){return this.a.f==0},l.ec=function(){return Qnn(this.a)},l.zc=function(t,n){return qH(this.a,t,n)},l.Bc=function(t){return CH(this.a,t)},l.gc=function(){return this.a.f},l.Ib=function(){return Vye(this.a.c)},l.Cc=function(){return Ynn(this.a)},O(Qa,"BasicEMap/DelegatingMap",1030),M(612,1,{42:1,133:1,612:1},LWe),l.Fb=function(t){var n;return we(t,42)?(n=u(t,42),(this.b!=null?Ci(this.b,n.cd()):je(this.b)===je(n.cd()))&&(this.c!=null?Ci(this.c,n.dd()):je(this.c)===je(n.dd()))):!1},l.Sh=function(){return this.a},l.cd=function(){return this.b},l.dd=function(){return this.c},l.Hb=function(){return this.a^(this.c==null?0:Xi(this.c))},l.Th=function(t){this.a=t},l.Uh=function(t){throw J(new H2)},l.ed=function(t){var n;return n=this.c,this.c=t,n},l.Ib=function(){return this.b+"->"+this.c},l.a=0;var L3n=O(Qa,"BasicEMap/EntryImpl",612);M(536,1,{},kx),O(Qa,"BasicEMap/View",536);var uN;M(768,1,{}),l.Fb=function(t){return J4e((hn(),bo),t)},l.Hb=function(){return hye((hn(),bo))},l.Ib=function(){return Yp((hn(),bo))},O(Qa,"ECollections/BasicEmptyUnmodifiableEList",768),M(1312,1,r0,UB),l.Nb=function(t){La(this,t)},l.Rb=function(t){throw J(new Fr)},l.Ob=function(){return!1},l.Sb=function(){return!1},l.Pb=function(){throw J(new xc)},l.Tb=function(){return 0},l.Ub=function(){throw J(new xc)},l.Vb=function(){return-1},l.Qb=function(){throw J(new Fr)},l.Wb=function(t){throw J(new Fr)},O(Qa,"ECollections/BasicEmptyUnmodifiableEList/1",1312),M(1310,768,{20:1,14:1,15:1,58:1},_He),l.Vc=function(t,n){Bze()},l.Fc=function(t){return Rze()},l.Wc=function(t,n){return Fze()},l.Gc=function(t){return jze()},l.$b=function(){$ze()},l.Hc=function(t){return!1},l.Ic=function(t){return!1},l.Jc=function(t){Da(this,t)},l.Xb=function(t){return B2e((hn(),t)),null},l.Xc=function(t){return-1},l.dc=function(){return!0},l.Kc=function(){return this.a},l.Yc=function(){return this.a},l.Zc=function(t){return this.a},l.ii=function(t,n){return Hze()},l.ji=function(t,n){zze()},l.Lc=function(){return new vn(null,new mn(this,16))},l.$c=function(t){return Gze()},l.Mc=function(t){return qze()},l._c=function(t,n){return Vze()},l.gc=function(){return 0},l.ad=function(t){Y3(this,t)},l.Nc=function(){return new mn(this,16)},l.Oc=function(){return new vn(null,new mn(this,16))},l.bd=function(t,n){return hn(),new Zd(bo,t,n)},l.Pc=function(){return Bve((hn(),bo))},l.Qc=function(t){return hn(),YD(bo,t)},O(Qa,"ECollections/EmptyUnmodifiableEList",1310),M(1311,768,{20:1,14:1,15:1,58:1,589:1},CHe),l.Vc=function(t,n){Bze()},l.Fc=function(t){return Rze()},l.Wc=function(t,n){return Fze()},l.Gc=function(t){return jze()},l.$b=function(){$ze()},l.Hc=function(t){return!1},l.Ic=function(t){return!1},l.Jc=function(t){Da(this,t)},l.Xb=function(t){return B2e((hn(),t)),null},l.Xc=function(t){return-1},l.dc=function(){return!0},l.Kc=function(){return this.a},l.Yc=function(){return this.a},l.Zc=function(t){return this.a},l.ii=function(t,n){return Hze()},l.ji=function(t,n){zze()},l.Lc=function(){return new vn(null,new mn(this,16))},l.$c=function(t){return Gze()},l.Mc=function(t){return qze()},l._c=function(t,n){return Vze()},l.gc=function(){return 0},l.ad=function(t){Y3(this,t)},l.Nc=function(){return new mn(this,16)},l.Oc=function(){return new vn(null,new mn(this,16))},l.bd=function(t,n){return hn(),new Zd(bo,t,n)},l.Pc=function(){return Bve((hn(),bo))},l.Qc=function(t){return hn(),YD(bo,t)},l.sj=function(){return hn(),hn(),l0},O(Qa,"ECollections/EmptyUnmodifiableEMap",1311);var LAe=ss(Qa,"Enumerator"),QV;M(281,1,{281:1},Zse),l.Fb=function(t){var n;return this===t?!0:we(t,281)?(n=u(t,281),this.f==n.f&&YQt(this.i,n.i)&&_ne(this.a,this.f&256?n.f&256?n.a:null:n.f&256?null:n.a)&&_ne(this.d,n.d)&&_ne(this.g,n.g)&&_ne(this.e,n.e)&&Gcn(this,n)):!1},l.Hb=function(){return this.f},l.Ib=function(){return Zct(this)},l.f=0;var X3t=0,Q3t=0,Z3t=0,J3t=0,MAe=0,DAe=0,IAe=0,OAe=0,NAe=0,e4t,KS=0,YS=0,t4t=0,n4t=0,ZV,PAe;O(Qa,"URI",281),M(1091,43,y4,SHe),l.zc=function(t,n){return u(Oo(this,Hr(t),u(n,281)),281)},O(Qa,"URI/URICache",1091),M(497,63,Od,xx,Lj),l.hi=function(){return!0},O(Qa,"UniqueEList",497),M(581,60,q0,D$),O(Qa,"WrappedException",581);var ti=ss(kh,kdt),qy=ss(kh,xdt),ju=ss(kh,Edt),Vy=ss(kh,Tdt),f1=ss(kh,_dt),tf=ss(kh,"EClass"),xfe=ss(kh,"EDataType"),r4t;M(1183,43,y4,AHe),l.xc=function(t){return fa(t)?Uc(this,t):hc($o(this.f,t))},O(kh,"EDataType/Internal/ConversionDelegate/Factory/Registry/Impl",1183);var JV=ss(kh,"EEnum"),J0=ss(kh,Cdt),Eo=ss(kh,Sdt),nf=ss(kh,Adt),rf,Iw=ss(kh,Ldt),Uy=ss(kh,Mdt);M(1029,1,{},qZ),l.Ib=function(){return"NIL"},O(kh,"EStructuralFeature/Internal/DynamicValueHolder/1",1029);var i4t;M(1028,43,y4,LHe),l.xc=function(t){return fa(t)?Uc(this,t):hc($o(this.f,t))},O(kh,"EStructuralFeature/Internal/SettingDelegate/Factory/Registry/Impl",1028);var mu=ss(kh,Ddt),Hk=ss(kh,"EValidator/PatternMatcher"),BAe,RAe,En,Kg,Wy,E2,s4t,a4t,o4t,T2,Yg,_2,Ow,Z1,c4t,u4t,sf,Xg,l4t,Qg,Ky,n5,oo,h4t,f4t,Nw,eU=ss(Wi,"FeatureMap/Entry");M(535,1,{72:1},KF),l.ak=function(){return this.a},l.dd=function(){return this.b},O(Tn,"BasicEObjectImpl/1",535),M(1027,1,Qce,Hqe),l.Wj=function(t){return Ire(this.a,this.b,t)},l.fj=function(){return kXe(this.a,this.b)},l.Wb=function(t){wwe(this.a,this.b,t)},l.Xj=function(){VZt(this.a,this.b)},O(Tn,"BasicEObjectImpl/4",1027),M(1983,1,{108:1}),l.bk=function(t){this.e=t==0?d4t:Me(Yn,yt,1,t,5,1)},l.Ch=function(t){return this.e[t]},l.Dh=function(t,n){this.e[t]=n},l.Eh=function(t){this.e[t]=null},l.ck=function(){return this.c},l.dk=function(){throw J(new Fr)},l.ek=function(){throw J(new Fr)},l.fk=function(){return this.d},l.gk=function(){return this.e!=null},l.hk=function(t){this.c=t},l.ik=function(t){throw J(new Fr)},l.jk=function(t){throw J(new Fr)},l.kk=function(t){this.d=t};var d4t;O(Tn,"BasicEObjectImpl/EPropertiesHolderBaseImpl",1983),M(185,1983,{108:1},ch),l.dk=function(){return this.a},l.ek=function(){return this.b},l.ik=function(t){this.a=t},l.jk=function(t){this.b=t},O(Tn,"BasicEObjectImpl/EPropertiesHolderImpl",185),M(506,97,I1t,Ex),l.Kg=function(){return this.f},l.Pg=function(){return this.k},l.Rg=function(t,n){this.g=t,this.i=n},l.Tg=function(){return this.j&2?this.ph().ck():this.zh()},l.Vg=function(){return this.i},l.Mg=function(){return(this.j&1)!=0},l.eh=function(){return this.g},l.kh=function(){return(this.j&4)!=0},l.ph=function(){return!this.k&&(this.k=new ch),this.k},l.th=function(t){this.ph().hk(t),t?this.j|=2:this.j&=-3},l.vh=function(t){this.ph().jk(t),t?this.j|=4:this.j&=-5},l.zh=function(){return(Rp(),En).S},l.i=0,l.j=1,O(Tn,"EObjectImpl",506),M(780,506,{105:1,92:1,90:1,56:1,108:1,49:1,97:1},wve),l.Ch=function(t){return this.e[t]},l.Dh=function(t,n){this.e[t]=n},l.Eh=function(t){this.e[t]=null},l.Tg=function(){return this.d},l.Yg=function(t){return Ji(this.d,t)},l.$g=function(){return this.d},l.dh=function(){return this.e!=null},l.ph=function(){return!this.k&&(this.k=new WB),this.k},l.th=function(t){this.d=t},l.yh=function(){var t;return this.e==null&&(t=Jn(this.d),this.e=t==0?g4t:Me(Yn,yt,1,t,5,1)),this},l.Ah=function(){return 0};var g4t;O(Tn,"DynamicEObjectImpl",780),M(1376,780,{105:1,42:1,92:1,90:1,133:1,56:1,108:1,49:1,97:1},nKe),l.Fb=function(t){return this===t},l.Hb=function(){return xv(this)},l.th=function(t){this.d=t,this.b=dI(t,"key"),this.c=dI(t,jC)},l.Sh=function(){var t;return this.a==-1&&(t=qre(this,this.b),this.a=t==null?0:Xi(t)),this.a},l.cd=function(){return qre(this,this.b)},l.dd=function(){return qre(this,this.c)},l.Th=function(t){this.a=t},l.Uh=function(t){wwe(this,this.b,t)},l.ed=function(t){var n;return n=qre(this,this.c),wwe(this,this.c,t),n},l.a=0,O(Tn,"DynamicEObjectImpl/BasicEMapEntry",1376),M(1377,1,{108:1},WB),l.bk=function(t){throw J(new Fr)},l.Ch=function(t){throw J(new Fr)},l.Dh=function(t,n){throw J(new Fr)},l.Eh=function(t){throw J(new Fr)},l.ck=function(){throw J(new Fr)},l.dk=function(){return this.a},l.ek=function(){return this.b},l.fk=function(){return this.c},l.gk=function(){throw J(new Fr)},l.hk=function(t){throw J(new Fr)},l.ik=function(t){this.a=t},l.jk=function(t){this.b=t},l.kk=function(t){this.c=t},O(Tn,"DynamicEObjectImpl/DynamicEPropertiesHolderImpl",1377),M(510,150,{105:1,92:1,90:1,590:1,147:1,56:1,108:1,49:1,97:1,510:1,150:1,114:1,115:1},KB),l.Qg=function(t){return R3e(this,t)},l._g=function(t,n,r){var s;switch(t){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),this.Ab;case 1:return this.d;case 2:return r?(!this.b&&(this.b=new Ml((on(),oo),wc,this)),this.b):(!this.b&&(this.b=new Ml((on(),oo),wc,this)),hD(this.b));case 3:return CXe(this);case 4:return!this.a&&(this.a=new Bs(y2,this,4)),this.a;case 5:return!this.c&&(this.c=new $3(y2,this,5)),this.c}return ph(this,t-Jn((on(),Kg)),gn((s=u(_n(this,16),26),s||Kg),t),n,r)},l.hh=function(t,n,r){var s,o,h;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),ou(this.Ab,t,r);case 3:return this.Cb&&(r=(o=this.Db>>16,o>=0?R3e(this,r):this.Cb.ih(this,-1-o,null,r))),Nve(this,u(t,147),r)}return h=u(gn((s=u(_n(this,16),26),s||(on(),Kg)),n),66),h.Nj().Qj(this,du(this),n-Jn((on(),Kg)),t,r)},l.jh=function(t,n,r){var s,o;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),Xa(this.Ab,t,r);case 2:return!this.b&&(this.b=new Ml((on(),oo),wc,this)),vj(this.b,t,r);case 3:return Nve(this,null,r);case 4:return!this.a&&(this.a=new Bs(y2,this,4)),Xa(this.a,t,r)}return o=u(gn((s=u(_n(this,16),26),s||(on(),Kg)),n),66),o.Nj().Rj(this,du(this),n-Jn((on(),Kg)),t,r)},l.lh=function(t){var n;switch(t){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!!CXe(this);case 4:return!!this.a&&this.a.i!=0;case 5:return!!this.c&&this.c.i!=0}return dh(this,t-Jn((on(),Kg)),gn((n=u(_n(this,16),26),n||Kg),t))},l.sh=function(t,n){var r;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab),!this.Ab&&(this.Ab=new at(ti,this,0,3)),fs(this.Ab,u(n,14));return;case 1:NQt(this,Hr(n));return;case 2:!this.b&&(this.b=new Ml((on(),oo),wc,this)),sH(this.b,n);return;case 3:zot(this,u(n,147));return;case 4:!this.a&&(this.a=new Bs(y2,this,4)),_r(this.a),!this.a&&(this.a=new Bs(y2,this,4)),fs(this.a,u(n,14));return;case 5:!this.c&&(this.c=new $3(y2,this,5)),_r(this.c),!this.c&&(this.c=new $3(y2,this,5)),fs(this.c,u(n,14));return}yh(this,t-Jn((on(),Kg)),gn((r=u(_n(this,16),26),r||Kg),t),n)},l.zh=function(){return on(),Kg},l.Bh=function(t){var n;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab);return;case 1:Fme(this,null);return;case 2:!this.b&&(this.b=new Ml((on(),oo),wc,this)),this.b.c.$b();return;case 3:zot(this,null);return;case 4:!this.a&&(this.a=new Bs(y2,this,4)),_r(this.a);return;case 5:!this.c&&(this.c=new $3(y2,this,5)),_r(this.c);return}wh(this,t-Jn((on(),Kg)),gn((n=u(_n(this,16),26),n||Kg),t))},l.Ib=function(){return rrt(this)},l.d=null,O(Tn,"EAnnotationImpl",510),M(151,705,b8e,Nl),l.Xh=function(t,n){bWt(this,t,u(n,42))},l.lk=function(t,n){return lYt(this,u(t,42),n)},l.pi=function(t){return u(u(this.c,69).pi(t),133)},l.Zh=function(){return u(this.c,69).Zh()},l.$h=function(){return u(this.c,69).$h()},l._h=function(t){return u(this.c,69)._h(t)},l.mk=function(t,n){return vj(this,t,n)},l.Wj=function(t){return u(this.c,76).Wj(t)},l.rj=function(){},l.fj=function(){return u(this.c,76).fj()},l.tj=function(t,n,r){var s;return s=u(Gl(this.b).Nh().Jh(this.b),133),s.Th(t),s.Uh(n),s.ed(r),s},l.uj=function(){return new rpe(this)},l.Wb=function(t){sH(this,t)},l.Xj=function(){u(this.c,76).Xj()},O(Wi,"EcoreEMap",151),M(158,151,b8e,Ml),l.qj=function(){var t,n,r,s,o,h;if(this.d==null){for(h=Me(SAe,p8e,63,2*this.f+1,0,1),r=this.c.Kc();r.e!=r.i.gc();)n=u(r.nj(),133),s=n.Sh(),o=(s&Ei)%h.length,t=h[o],!t&&(t=h[o]=new rpe(this)),t.Fc(n);this.d=h}},O(Tn,"EAnnotationImpl/1",158),M(284,438,{105:1,92:1,90:1,147:1,191:1,56:1,108:1,472:1,49:1,97:1,150:1,284:1,114:1,115:1}),l._g=function(t,n,r){var s,o;switch(t){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),this.Ab;case 1:return this.zb;case 2:return Mn(),!!(this.Bb&256);case 3:return Mn(),!!(this.Bb&512);case 4:return ct(this.s);case 5:return ct(this.t);case 6:return Mn(),!!this.$j();case 7:return Mn(),o=this.s,o>=1;case 8:return n?$h(this):this.r;case 9:return this.q}return ph(this,t-Jn(this.zh()),gn((s=u(_n(this,16),26),s||this.zh()),t),n,r)},l.jh=function(t,n,r){var s,o;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),Xa(this.Ab,t,r);case 9:return zne(this,r)}return o=u(gn((s=u(_n(this,16),26),s||this.zh()),n),66),o.Nj().Rj(this,du(this),n-Jn(this.zh()),t,r)},l.lh=function(t){var n,r;switch(t){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.$j();case 7:return r=this.s,r>=1;case 8:return!!this.r&&!this.q.e&&Mv(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&Mv(this.q).i==0)}return dh(this,t-Jn(this.zh()),gn((n=u(_n(this,16),26),n||this.zh()),t))},l.sh=function(t,n){var r,s;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab),!this.Ab&&(this.Ab=new at(ti,this,0,3)),fs(this.Ab,u(n,14));return;case 1:this.Lh(Hr(n));return;case 2:Lg(this,It(Mt(n)));return;case 3:Mg(this,It(Mt(n)));return;case 4:Cg(this,u(n,19).a);return;case 5:this.ok(u(n,19).a);return;case 8:cb(this,u(n,138));return;case 9:s=$1(this,u(n,87),null),s&&s.Fi();return}yh(this,t-Jn(this.zh()),gn((r=u(_n(this,16),26),r||this.zh()),t),n)},l.zh=function(){return on(),f4t},l.Bh=function(t){var n,r;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab);return;case 1:this.Lh(null);return;case 2:Lg(this,!0);return;case 3:Mg(this,!0);return;case 4:Cg(this,0);return;case 5:this.ok(1);return;case 8:cb(this,null);return;case 9:r=$1(this,null,null),r&&r.Fi();return}wh(this,t-Jn(this.zh()),gn((n=u(_n(this,16),26),n||this.zh()),t))},l.Gh=function(){$h(this),this.Bb|=1},l.Yj=function(){return $h(this)},l.Zj=function(){return this.t},l.$j=function(){var t;return t=this.t,t>1||t==-1},l.hi=function(){return(this.Bb&512)!=0},l.nk=function(t,n){return Iye(this,t,n)},l.ok=function(t){Wm(this,t)},l.Ib=function(){return G4e(this)},l.s=0,l.t=1,O(Tn,"ETypedElementImpl",284),M(449,284,{105:1,92:1,90:1,147:1,191:1,56:1,170:1,66:1,108:1,472:1,49:1,97:1,150:1,449:1,284:1,114:1,115:1,677:1}),l.Qg=function(t){return jit(this,t)},l._g=function(t,n,r){var s,o;switch(t){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),this.Ab;case 1:return this.zb;case 2:return Mn(),!!(this.Bb&256);case 3:return Mn(),!!(this.Bb&512);case 4:return ct(this.s);case 5:return ct(this.t);case 6:return Mn(),!!this.$j();case 7:return Mn(),o=this.s,o>=1;case 8:return n?$h(this):this.r;case 9:return this.q;case 10:return Mn(),!!(this.Bb&Sf);case 11:return Mn(),!!(this.Bb&ky);case 12:return Mn(),!!(this.Bb&dy);case 13:return this.j;case 14:return b7(this);case 15:return Mn(),!!(this.Bb&Zu);case 16:return Mn(),!!(this.Bb&Ed);case 17:return Fm(this)}return ph(this,t-Jn(this.zh()),gn((s=u(_n(this,16),26),s||this.zh()),t),n,r)},l.hh=function(t,n,r){var s,o,h;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),ou(this.Ab,t,r);case 17:return this.Cb&&(r=(o=this.Db>>16,o>=0?jit(this,r):this.Cb.ih(this,-1-o,null,r))),Kl(this,t,17,r)}return h=u(gn((s=u(_n(this,16),26),s||this.zh()),n),66),h.Nj().Qj(this,du(this),n-Jn(this.zh()),t,r)},l.jh=function(t,n,r){var s,o;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),Xa(this.Ab,t,r);case 9:return zne(this,r);case 17:return Kl(this,null,17,r)}return o=u(gn((s=u(_n(this,16),26),s||this.zh()),n),66),o.Nj().Rj(this,du(this),n-Jn(this.zh()),t,r)},l.lh=function(t){var n,r;switch(t){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.$j();case 7:return r=this.s,r>=1;case 8:return!!this.r&&!this.q.e&&Mv(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&Mv(this.q).i==0);case 10:return(this.Bb&Sf)==0;case 11:return(this.Bb&ky)!=0;case 12:return(this.Bb&dy)!=0;case 13:return this.j!=null;case 14:return b7(this)!=null;case 15:return(this.Bb&Zu)!=0;case 16:return(this.Bb&Ed)!=0;case 17:return!!Fm(this)}return dh(this,t-Jn(this.zh()),gn((n=u(_n(this,16),26),n||this.zh()),t))},l.sh=function(t,n){var r,s;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab),!this.Ab&&(this.Ab=new at(ti,this,0,3)),fs(this.Ab,u(n,14));return;case 1:bre(this,Hr(n));return;case 2:Lg(this,It(Mt(n)));return;case 3:Mg(this,It(Mt(n)));return;case 4:Cg(this,u(n,19).a);return;case 5:this.ok(u(n,19).a);return;case 8:cb(this,u(n,138));return;case 9:s=$1(this,u(n,87),null),s&&s.Fi();return;case 10:J8(this,It(Mt(n)));return;case 11:n7(this,It(Mt(n)));return;case 12:e7(this,It(Mt(n)));return;case 13:N2e(this,Hr(n));return;case 15:t7(this,It(Mt(n)));return;case 16:r7(this,It(Mt(n)));return}yh(this,t-Jn(this.zh()),gn((r=u(_n(this,16),26),r||this.zh()),t),n)},l.zh=function(){return on(),h4t},l.Bh=function(t){var n,r;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab);return;case 1:we(this.Cb,88)&&iy(dl(u(this.Cb,88)),4),au(this,null);return;case 2:Lg(this,!0);return;case 3:Mg(this,!0);return;case 4:Cg(this,0);return;case 5:this.ok(1);return;case 8:cb(this,null);return;case 9:r=$1(this,null,null),r&&r.Fi();return;case 10:J8(this,!0);return;case 11:n7(this,!1);return;case 12:e7(this,!1);return;case 13:this.i=null,X$(this,null);return;case 15:t7(this,!1);return;case 16:r7(this,!1);return}wh(this,t-Jn(this.zh()),gn((n=u(_n(this,16),26),n||this.zh()),t))},l.Gh=function(){m8(Po((Yu(),Oa),this)),$h(this),this.Bb|=1},l.Gj=function(){return this.f},l.zj=function(){return b7(this)},l.Hj=function(){return Fm(this)},l.Lj=function(){return null},l.pk=function(){return this.k},l.aj=function(){return this.n},l.Mj=function(){return UH(this)},l.Nj=function(){var t,n,r,s,o,h,d,v,x;return this.p||(r=Fm(this),(r.i==null&&xd(r),r.i).length,s=this.Lj(),s&&Jn(Fm(s)),o=$h(this),d=o.Bj(),t=d?d.i&1?d==El?Us:d==Lr?Za:d==Xy?W7:d==pa?ma:d==S2?pw:d==a5?bw:d==el?mk:XC:d:null,n=b7(this),v=o.zj(),gon(this),this.Bb&Ed&&((h=q3e((Yu(),Oa),r))&&h!=this||(h=F6(Po(Oa,this))))?this.p=new Gqe(this,h):this.$j()?this.rk()?s?this.Bb&Zu?t?this.sk()?this.p=new K2(47,t,this,s):this.p=new K2(5,t,this,s):this.sk()?this.p=new Q2(46,this,s):this.p=new Q2(4,this,s):t?this.sk()?this.p=new K2(49,t,this,s):this.p=new K2(7,t,this,s):this.sk()?this.p=new Q2(48,this,s):this.p=new Q2(6,this,s):this.Bb&Zu?t?t==Cb?this.p=new yg(50,W3t,this):this.sk()?this.p=new yg(43,t,this):this.p=new yg(1,t,this):this.sk()?this.p=new xg(42,this):this.p=new xg(0,this):t?t==Cb?this.p=new yg(41,W3t,this):this.sk()?this.p=new yg(45,t,this):this.p=new yg(3,t,this):this.sk()?this.p=new xg(44,this):this.p=new xg(2,this):we(o,148)?t==eU?this.p=new xg(40,this):this.Bb&512?this.Bb&Zu?t?this.p=new yg(9,t,this):this.p=new xg(8,this):t?this.p=new yg(11,t,this):this.p=new xg(10,this):this.Bb&Zu?t?this.p=new yg(13,t,this):this.p=new xg(12,this):t?this.p=new yg(15,t,this):this.p=new xg(14,this):s?(x=s.t,x>1||x==-1?this.sk()?this.Bb&Zu?t?this.p=new K2(25,t,this,s):this.p=new Q2(24,this,s):t?this.p=new K2(27,t,this,s):this.p=new Q2(26,this,s):this.Bb&Zu?t?this.p=new K2(29,t,this,s):this.p=new Q2(28,this,s):t?this.p=new K2(31,t,this,s):this.p=new Q2(30,this,s):this.sk()?this.Bb&Zu?t?this.p=new K2(33,t,this,s):this.p=new Q2(32,this,s):t?this.p=new K2(35,t,this,s):this.p=new Q2(34,this,s):this.Bb&Zu?t?this.p=new K2(37,t,this,s):this.p=new Q2(36,this,s):t?this.p=new K2(39,t,this,s):this.p=new Q2(38,this,s)):this.sk()?this.Bb&Zu?t?this.p=new yg(17,t,this):this.p=new xg(16,this):t?this.p=new yg(19,t,this):this.p=new xg(18,this):this.Bb&Zu?t?this.p=new yg(21,t,this):this.p=new xg(20,this):t?this.p=new yg(23,t,this):this.p=new xg(22,this):this.qk()?this.sk()?this.p=new MWe(u(o,26),this,s):this.p=new vwe(u(o,26),this,s):we(o,148)?t==eU?this.p=new xg(40,this):this.Bb&Zu?t?this.p=new AKe(n,v,this,(Gie(),d==Lr?qAe:d==El?jAe:d==S2?VAe:d==Xy?GAe:d==pa?zAe:d==a5?UAe:d==el?$Ae:d==Sh?HAe:_fe)):this.p=new $Ye(u(o,148),n,v,this):t?this.p=new SKe(n,v,this,(Gie(),d==Lr?qAe:d==El?jAe:d==S2?VAe:d==Xy?GAe:d==pa?zAe:d==a5?UAe:d==el?$Ae:d==Sh?HAe:_fe)):this.p=new jYe(u(o,148),n,v,this):this.rk()?s?this.Bb&Zu?this.sk()?this.p=new IWe(u(o,26),this,s):this.p=new cve(u(o,26),this,s):this.sk()?this.p=new DWe(u(o,26),this,s):this.p=new wne(u(o,26),this,s):this.Bb&Zu?this.sk()?this.p=new SUe(u(o,26),this):this.p=new xbe(u(o,26),this):this.sk()?this.p=new CUe(u(o,26),this):this.p=new ine(u(o,26),this):this.sk()?s?this.Bb&Zu?this.p=new OWe(u(o,26),this,s):this.p=new ave(u(o,26),this,s):this.Bb&Zu?this.p=new AUe(u(o,26),this):this.p=new Ebe(u(o,26),this):s?this.Bb&Zu?this.p=new NWe(u(o,26),this,s):this.p=new ove(u(o,26),this,s):this.Bb&Zu?this.p=new LUe(u(o,26),this):this.p=new Mj(u(o,26),this)),this.p},l.Ij=function(){return(this.Bb&Sf)!=0},l.qk=function(){return!1},l.rk=function(){return!1},l.Jj=function(){return(this.Bb&Ed)!=0},l.Oj=function(){return Ure(this)},l.sk=function(){return!1},l.Kj=function(){return(this.Bb&Zu)!=0},l.tk=function(t){this.k=t},l.Lh=function(t){bre(this,t)},l.Ib=function(){return lz(this)},l.e=!1,l.n=0,O(Tn,"EStructuralFeatureImpl",449),M(322,449,{105:1,92:1,90:1,34:1,147:1,191:1,56:1,170:1,66:1,108:1,472:1,49:1,97:1,322:1,150:1,449:1,284:1,114:1,115:1,677:1},Vee),l._g=function(t,n,r){var s,o;switch(t){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),this.Ab;case 1:return this.zb;case 2:return Mn(),!!(this.Bb&256);case 3:return Mn(),!!(this.Bb&512);case 4:return ct(this.s);case 5:return ct(this.t);case 6:return Mn(),!!j4e(this);case 7:return Mn(),o=this.s,o>=1;case 8:return n?$h(this):this.r;case 9:return this.q;case 10:return Mn(),!!(this.Bb&Sf);case 11:return Mn(),!!(this.Bb&ky);case 12:return Mn(),!!(this.Bb&dy);case 13:return this.j;case 14:return b7(this);case 15:return Mn(),!!(this.Bb&Zu);case 16:return Mn(),!!(this.Bb&Ed);case 17:return Fm(this);case 18:return Mn(),!!(this.Bb&_c);case 19:return n?lie(this):$Ze(this)}return ph(this,t-Jn((on(),Wy)),gn((s=u(_n(this,16),26),s||Wy),t),n,r)},l.lh=function(t){var n,r;switch(t){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 j4e(this);case 7:return r=this.s,r>=1;case 8:return!!this.r&&!this.q.e&&Mv(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&Mv(this.q).i==0);case 10:return(this.Bb&Sf)==0;case 11:return(this.Bb&ky)!=0;case 12:return(this.Bb&dy)!=0;case 13:return this.j!=null;case 14:return b7(this)!=null;case 15:return(this.Bb&Zu)!=0;case 16:return(this.Bb&Ed)!=0;case 17:return!!Fm(this);case 18:return(this.Bb&_c)!=0;case 19:return!!$Ze(this)}return dh(this,t-Jn((on(),Wy)),gn((n=u(_n(this,16),26),n||Wy),t))},l.sh=function(t,n){var r,s;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab),!this.Ab&&(this.Ab=new at(ti,this,0,3)),fs(this.Ab,u(n,14));return;case 1:bre(this,Hr(n));return;case 2:Lg(this,It(Mt(n)));return;case 3:Mg(this,It(Mt(n)));return;case 4:Cg(this,u(n,19).a);return;case 5:wze(this,u(n,19).a);return;case 8:cb(this,u(n,138));return;case 9:s=$1(this,u(n,87),null),s&&s.Fi();return;case 10:J8(this,It(Mt(n)));return;case 11:n7(this,It(Mt(n)));return;case 12:e7(this,It(Mt(n)));return;case 13:N2e(this,Hr(n));return;case 15:t7(this,It(Mt(n)));return;case 16:r7(this,It(Mt(n)));return;case 18:Pie(this,It(Mt(n)));return}yh(this,t-Jn((on(),Wy)),gn((r=u(_n(this,16),26),r||Wy),t),n)},l.zh=function(){return on(),Wy},l.Bh=function(t){var n,r;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab);return;case 1:we(this.Cb,88)&&iy(dl(u(this.Cb,88)),4),au(this,null);return;case 2:Lg(this,!0);return;case 3:Mg(this,!0);return;case 4:Cg(this,0);return;case 5:this.b=0,Wm(this,1);return;case 8:cb(this,null);return;case 9:r=$1(this,null,null),r&&r.Fi();return;case 10:J8(this,!0);return;case 11:n7(this,!1);return;case 12:e7(this,!1);return;case 13:this.i=null,X$(this,null);return;case 15:t7(this,!1);return;case 16:r7(this,!1);return;case 18:Pie(this,!1);return}wh(this,t-Jn((on(),Wy)),gn((n=u(_n(this,16),26),n||Wy),t))},l.Gh=function(){lie(this),m8(Po((Yu(),Oa),this)),$h(this),this.Bb|=1},l.$j=function(){return j4e(this)},l.nk=function(t,n){return this.b=0,this.a=null,Iye(this,t,n)},l.ok=function(t){wze(this,t)},l.Ib=function(){var t;return this.Db&64?lz(this):(t=new Ph(lz(this)),t.a+=" (iD: ",vg(t,(this.Bb&_c)!=0),t.a+=")",t.a)},l.b=0,O(Tn,"EAttributeImpl",322),M(351,438,{105:1,92:1,90:1,138:1,147:1,191:1,56:1,108:1,49:1,97:1,351:1,150:1,114:1,115:1,676:1}),l.uk=function(t){return t.Tg()==this},l.Qg=function(t){return pse(this,t)},l.Rg=function(t,n){this.w=null,this.Db=n<<16|this.Db&255,this.Cb=t},l._g=function(t,n,r){var s;switch(t){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.D!=null?this.D:this.B;case 3:return Jv(this);case 4:return this.zj();case 5:return this.F;case 6:return n?Gl(this):x8(this);case 7:return!this.A&&(this.A=new qu(mu,this,7)),this.A}return ph(this,t-Jn(this.zh()),gn((s=u(_n(this,16),26),s||this.zh()),t),n,r)},l.hh=function(t,n,r){var s,o,h;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),ou(this.Ab,t,r);case 6:return this.Cb&&(r=(o=this.Db>>16,o>=0?pse(this,r):this.Cb.ih(this,-1-o,null,r))),Kl(this,t,6,r)}return h=u(gn((s=u(_n(this,16),26),s||this.zh()),n),66),h.Nj().Qj(this,du(this),n-Jn(this.zh()),t,r)},l.jh=function(t,n,r){var s,o;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),Xa(this.Ab,t,r);case 6:return Kl(this,null,6,r);case 7:return!this.A&&(this.A=new qu(mu,this,7)),Xa(this.A,t,r)}return o=u(gn((s=u(_n(this,16),26),s||this.zh()),n),66),o.Nj().Rj(this,du(this),n-Jn(this.zh()),t,r)},l.lh=function(t){var n;switch(t){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!!Jv(this);case 4:return this.zj()!=null;case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!x8(this);case 7:return!!this.A&&this.A.i!=0}return dh(this,t-Jn(this.zh()),gn((n=u(_n(this,16),26),n||this.zh()),t))},l.sh=function(t,n){var r;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab),!this.Ab&&(this.Ab=new at(ti,this,0,3)),fs(this.Ab,u(n,14));return;case 1:l$(this,Hr(n));return;case 2:Vte(this,Hr(n));return;case 5:x7(this,Hr(n));return;case 7:!this.A&&(this.A=new qu(mu,this,7)),_r(this.A),!this.A&&(this.A=new qu(mu,this,7)),fs(this.A,u(n,14));return}yh(this,t-Jn(this.zh()),gn((r=u(_n(this,16),26),r||this.zh()),t),n)},l.zh=function(){return on(),s4t},l.Bh=function(t){var n;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab);return;case 1:we(this.Cb,179)&&(u(this.Cb,179).tb=null),au(this,null);return;case 2:Y8(this,null),R8(this,this.D);return;case 5:x7(this,null);return;case 7:!this.A&&(this.A=new qu(mu,this,7)),_r(this.A);return}wh(this,t-Jn(this.zh()),gn((n=u(_n(this,16),26),n||this.zh()),t))},l.yj=function(){var t;return this.G==-1&&(this.G=(t=Gl(this),t?Dg(t.Mh(),this):-1)),this.G},l.zj=function(){return null},l.Aj=function(){return Gl(this)},l.vk=function(){return this.v},l.Bj=function(){return Jv(this)},l.Cj=function(){return this.D!=null?this.D:this.B},l.Dj=function(){return this.F},l.wj=function(t){return oae(this,t)},l.wk=function(t){this.v=t},l.xk=function(t){wtt(this,t)},l.yk=function(t){this.C=t},l.Lh=function(t){l$(this,t)},l.Ib=function(){return xH(this)},l.C=null,l.D=null,l.G=-1,O(Tn,"EClassifierImpl",351),M(88,351,{105:1,92:1,90:1,26:1,138:1,147:1,191:1,56:1,108:1,49:1,97:1,88:1,351:1,150:1,473:1,114:1,115:1,676:1},YL),l.uk=function(t){return XKt(this,t.Tg())},l._g=function(t,n,r){var s;switch(t){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.D!=null?this.D:this.B;case 3:return Jv(this);case 4:return null;case 5:return this.F;case 6:return n?Gl(this):x8(this);case 7:return!this.A&&(this.A=new qu(mu,this,7)),this.A;case 8:return Mn(),!!(this.Bb&256);case 9:return Mn(),!!(this.Bb&512);case 10:return jo(this);case 11:return!this.q&&(this.q=new at(nf,this,11,10)),this.q;case 12:return b4(this);case 13:return fC(this);case 14:return fC(this),this.r;case 15:return b4(this),this.k;case 16:return L4e(this);case 17:return fae(this);case 18:return xd(this);case 19:return rz(this);case 20:return b4(this),this.o;case 21:return!this.s&&(this.s=new at(ju,this,21,17)),this.s;case 22:return jc(this);case 23:return Qse(this)}return ph(this,t-Jn((on(),E2)),gn((s=u(_n(this,16),26),s||E2),t),n,r)},l.hh=function(t,n,r){var s,o,h;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),ou(this.Ab,t,r);case 6:return this.Cb&&(r=(o=this.Db>>16,o>=0?pse(this,r):this.Cb.ih(this,-1-o,null,r))),Kl(this,t,6,r);case 11:return!this.q&&(this.q=new at(nf,this,11,10)),ou(this.q,t,r);case 21:return!this.s&&(this.s=new at(ju,this,21,17)),ou(this.s,t,r)}return h=u(gn((s=u(_n(this,16),26),s||(on(),E2)),n),66),h.Nj().Qj(this,du(this),n-Jn((on(),E2)),t,r)},l.jh=function(t,n,r){var s,o;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),Xa(this.Ab,t,r);case 6:return Kl(this,null,6,r);case 7:return!this.A&&(this.A=new qu(mu,this,7)),Xa(this.A,t,r);case 11:return!this.q&&(this.q=new at(nf,this,11,10)),Xa(this.q,t,r);case 21:return!this.s&&(this.s=new at(ju,this,21,17)),Xa(this.s,t,r);case 22:return Xa(jc(this),t,r)}return o=u(gn((s=u(_n(this,16),26),s||(on(),E2)),n),66),o.Nj().Rj(this,du(this),n-Jn((on(),E2)),t,r)},l.lh=function(t){var n;switch(t){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!!Jv(this);case 4:return!1;case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!x8(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&&jc(this.u.a).i!=0&&!(this.n&&ise(this.n));case 11:return!!this.q&&this.q.i!=0;case 12:return b4(this).i!=0;case 13:return fC(this).i!=0;case 14:return fC(this),this.r.i!=0;case 15:return b4(this),this.k.i!=0;case 16:return L4e(this).i!=0;case 17:return fae(this).i!=0;case 18:return xd(this).i!=0;case 19:return rz(this).i!=0;case 20:return b4(this),!!this.o;case 21:return!!this.s&&this.s.i!=0;case 22:return!!this.n&&ise(this.n);case 23:return Qse(this).i!=0}return dh(this,t-Jn((on(),E2)),gn((n=u(_n(this,16),26),n||E2),t))},l.oh=function(t){var n;return n=this.i==null||this.q&&this.q.i!=0?null:dI(this,t),n||a6e(this,t)},l.sh=function(t,n){var r;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab),!this.Ab&&(this.Ab=new at(ti,this,0,3)),fs(this.Ab,u(n,14));return;case 1:l$(this,Hr(n));return;case 2:Vte(this,Hr(n));return;case 5:x7(this,Hr(n));return;case 7:!this.A&&(this.A=new qu(mu,this,7)),_r(this.A),!this.A&&(this.A=new qu(mu,this,7)),fs(this.A,u(n,14));return;case 8:Nye(this,It(Mt(n)));return;case 9:Pye(this,It(Mt(n)));return;case 10:pC(jo(this)),fs(jo(this),u(n,14));return;case 11:!this.q&&(this.q=new at(nf,this,11,10)),_r(this.q),!this.q&&(this.q=new at(nf,this,11,10)),fs(this.q,u(n,14));return;case 21:!this.s&&(this.s=new at(ju,this,21,17)),_r(this.s),!this.s&&(this.s=new at(ju,this,21,17)),fs(this.s,u(n,14));return;case 22:_r(jc(this)),fs(jc(this),u(n,14));return}yh(this,t-Jn((on(),E2)),gn((r=u(_n(this,16),26),r||E2),t),n)},l.zh=function(){return on(),E2},l.Bh=function(t){var n;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab);return;case 1:we(this.Cb,179)&&(u(this.Cb,179).tb=null),au(this,null);return;case 2:Y8(this,null),R8(this,this.D);return;case 5:x7(this,null);return;case 7:!this.A&&(this.A=new qu(mu,this,7)),_r(this.A);return;case 8:Nye(this,!1);return;case 9:Pye(this,!1);return;case 10:this.u&&pC(this.u);return;case 11:!this.q&&(this.q=new at(nf,this,11,10)),_r(this.q);return;case 21:!this.s&&(this.s=new at(ju,this,21,17)),_r(this.s);return;case 22:this.n&&_r(this.n);return}wh(this,t-Jn((on(),E2)),gn((n=u(_n(this,16),26),n||E2),t))},l.Gh=function(){var t,n;if(b4(this),fC(this),L4e(this),fae(this),xd(this),rz(this),Qse(this),A_(dQt(dl(this))),this.s)for(t=0,n=this.s.i;t=0;--n)Te(this,n);return r3e(this,t)},l.Xj=function(){_r(this)},l.oi=function(t,n){return Het(this,t,n)},O(Wi,"EcoreEList",622),M(496,622,Zo,UM),l.ai=function(){return!1},l.aj=function(){return this.c},l.bj=function(){return!1},l.Fk=function(){return!0},l.hi=function(){return!0},l.li=function(t,n){return n},l.ni=function(){return!1},l.c=0,O(Wi,"EObjectEList",496),M(85,496,Zo,Bs),l.bj=function(){return!0},l.Dk=function(){return!1},l.rk=function(){return!0},O(Wi,"EObjectContainmentEList",85),M(545,85,Zo,aj),l.ci=function(){this.b=!0},l.fj=function(){return this.b},l.Xj=function(){var t;_r(this),Ll(this.e)?(t=this.b,this.b=!1,_i(this.e,new xf(this.e,2,this.c,t,!1))):this.b=!1},l.b=!1,O(Wi,"EObjectContainmentEList/Unsettable",545),M(1140,545,Zo,_Ke),l.ii=function(t,n){var r,s;return r=u(q_(this,t,n),87),Ll(this.e)&&Vx(this,new dD(this.a,7,(on(),a4t),ct(n),(s=r.c,we(s,88)?u(s,26):sf),t)),r},l.jj=function(t,n){return tcn(this,u(t,87),n)},l.kj=function(t,n){return ecn(this,u(t,87),n)},l.lj=function(t,n,r){return nhn(this,u(t,87),u(n,87),r)},l.Zi=function(t,n,r,s,o){switch(t){case 3:return x_(this,t,n,r,s,this.i>1);case 5:return x_(this,t,n,r,s,this.i-u(r,15).gc()>0);default:return new N0(this.e,t,this.c,n,r,s,!0)}},l.ij=function(){return!0},l.fj=function(){return ise(this)},l.Xj=function(){_r(this)},O(Tn,"EClassImpl/1",1140),M(1154,1153,g8e),l.ui=function(t){var n,r,s,o,h,d,v;if(r=t.xi(),r!=8){if(s=Fcn(t),s==0)switch(r){case 1:case 9:{v=t.Bi(),v!=null&&(n=dl(u(v,473)),!n.c&&(n.c=new gm),N$(n.c,t.Ai())),d=t.zi(),d!=null&&(o=u(d,473),o.Bb&1||(n=dl(o),!n.c&&(n.c=new gm),Br(n.c,u(t.Ai(),26))));break}case 3:{d=t.zi(),d!=null&&(o=u(d,473),o.Bb&1||(n=dl(o),!n.c&&(n.c=new gm),Br(n.c,u(t.Ai(),26))));break}case 5:{if(d=t.zi(),d!=null)for(h=u(d,14).Kc();h.Ob();)o=u(h.Pb(),473),o.Bb&1||(n=dl(o),!n.c&&(n.c=new gm),Br(n.c,u(t.Ai(),26)));break}case 4:{v=t.Bi(),v!=null&&(o=u(v,473),o.Bb&1||(n=dl(o),!n.c&&(n.c=new gm),N$(n.c,t.Ai())));break}case 6:{if(v=t.Bi(),v!=null)for(h=u(v,14).Kc();h.Ob();)o=u(h.Pb(),473),o.Bb&1||(n=dl(o),!n.c&&(n.c=new gm),N$(n.c,t.Ai()));break}}this.Hk(s)}},l.Hk=function(t){Cct(this,t)},l.b=63,O(Tn,"ESuperAdapter",1154),M(1155,1154,g8e,R$e),l.Hk=function(t){iy(this,t)},O(Tn,"EClassImpl/10",1155),M(1144,696,Zo),l.Vh=function(t,n){return Cse(this,t,n)},l.Wh=function(t){return xit(this,t)},l.Xh=function(t,n){$D(this,t,n)},l.Yh=function(t){cD(this,t)},l.pi=function(t){return fme(this,t)},l.mi=function(t,n){return Vre(this,t,n)},l.lk=function(t,n){throw J(new Fr)},l.Zh=function(){return new C6(this)},l.$h=function(){return new NM(this)},l._h=function(t){return _D(this,t)},l.mk=function(t,n){throw J(new Fr)},l.Wj=function(t){return this},l.fj=function(){return this.i!=0},l.Wb=function(t){throw J(new Fr)},l.Xj=function(){throw J(new Fr)},O(Wi,"EcoreEList/UnmodifiableEList",1144),M(319,1144,Zo,B3),l.ni=function(){return!1},O(Wi,"EcoreEList/UnmodifiableEList/FastCompare",319),M(1147,319,Zo,lnt),l.Xc=function(t){var n,r,s;if(we(t,170)&&(n=u(t,170),r=n.aj(),r!=-1)){for(s=this.i;r4)if(this.wj(t)){if(this.rk()){if(s=u(t,49),r=s.Ug(),v=r==this.b&&(this.Dk()?s.Og(s.Vg(),u(gn(Su(this.b),this.aj()).Yj(),26).Bj())==go(u(gn(Su(this.b),this.aj()),18)).n:-1-s.Vg()==this.aj()),this.Ek()&&!v&&!r&&s.Zg()){for(o=0;o1||s==-1)):!1},l.Dk=function(){var t,n,r;return n=gn(Su(this.b),this.aj()),we(n,99)?(t=u(n,18),r=go(t),!!r):!1},l.Ek=function(){var t,n;return n=gn(Su(this.b),this.aj()),we(n,99)?(t=u(n,18),(t.Bb&so)!=0):!1},l.Xc=function(t){var n,r,s,o;if(s=this.Qi(t),s>=0)return s;if(this.Fk()){for(r=0,o=this.Vi();r=0;--t)xI(this,t,this.Oi(t));return this.Wi()},l.Qc=function(t){var n;if(this.Ek())for(n=this.Vi()-1;n>=0;--n)xI(this,n,this.Oi(n));return this.Xi(t)},l.Xj=function(){pC(this)},l.oi=function(t,n){return EJe(this,t,n)},O(Wi,"DelegatingEcoreEList",742),M(1150,742,w8e,$Ue),l.Hi=function(t,n){TKt(this,t,u(n,26))},l.Ii=function(t){wWt(this,u(t,26))},l.Oi=function(t){var n,r;return n=u(Te(jc(this.a),t),87),r=n.c,we(r,88)?u(r,26):(on(),sf)},l.Ti=function(t){var n,r;return n=u(ay(jc(this.a),t),87),r=n.c,we(r,88)?u(r,26):(on(),sf)},l.Ui=function(t,n){return _un(this,t,u(n,26))},l.ai=function(){return!1},l.Zi=function(t,n,r,s,o){return null},l.Ji=function(){return new j$e(this)},l.Ki=function(){_r(jc(this.a))},l.Li=function(t){return trt(this,t)},l.Mi=function(t){var n,r;for(r=t.Kc();r.Ob();)if(n=r.Pb(),!trt(this,n))return!1;return!0},l.Ni=function(t){var n,r,s;if(we(t,15)&&(s=u(t,15),s.gc()==jc(this.a).i)){for(n=s.Kc(),r=new rr(this);n.Ob();)if(je(n.Pb())!==je(pr(r)))return!1;return!0}return!1},l.Pi=function(){var t,n,r,s,o;for(r=1,n=new rr(jc(this.a));n.e!=n.i.gc();)t=u(pr(n),87),s=(o=t.c,we(o,88)?u(o,26):(on(),sf)),r=31*r+(s?xv(s):0);return r},l.Qi=function(t){var n,r,s,o;for(s=0,r=new rr(jc(this.a));r.e!=r.i.gc();){if(n=u(pr(r),87),je(t)===je((o=n.c,we(o,88)?u(o,26):(on(),sf))))return s;++s}return-1},l.Ri=function(){return jc(this.a).i==0},l.Si=function(){return null},l.Vi=function(){return jc(this.a).i},l.Wi=function(){var t,n,r,s,o,h;for(h=jc(this.a).i,o=Me(Yn,yt,1,h,5,1),r=0,n=new rr(jc(this.a));n.e!=n.i.gc();)t=u(pr(n),87),o[r++]=(s=t.c,we(s,88)?u(s,26):(on(),sf));return o},l.Xi=function(t){var n,r,s,o,h,d,v;for(v=jc(this.a).i,t.lengthv&&cs(t,v,null),s=0,r=new rr(jc(this.a));r.e!=r.i.gc();)n=u(pr(r),87),h=(d=n.c,we(d,88)?u(d,26):(on(),sf)),cs(t,s++,h);return t},l.Yi=function(){var t,n,r,s,o;for(o=new bg,o.a+="[",t=jc(this.a),n=0,s=jc(this.a).i;n>16,o>=0?pse(this,r):this.Cb.ih(this,-1-o,null,r))),Kl(this,t,6,r);case 9:return!this.a&&(this.a=new at(J0,this,9,5)),ou(this.a,t,r)}return h=u(gn((s=u(_n(this,16),26),s||(on(),T2)),n),66),h.Nj().Qj(this,du(this),n-Jn((on(),T2)),t,r)},l.jh=function(t,n,r){var s,o;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),Xa(this.Ab,t,r);case 6:return Kl(this,null,6,r);case 7:return!this.A&&(this.A=new qu(mu,this,7)),Xa(this.A,t,r);case 9:return!this.a&&(this.a=new at(J0,this,9,5)),Xa(this.a,t,r)}return o=u(gn((s=u(_n(this,16),26),s||(on(),T2)),n),66),o.Nj().Rj(this,du(this),n-Jn((on(),T2)),t,r)},l.lh=function(t){var n;switch(t){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!!Jv(this);case 4:return!!yye(this);case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!x8(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 dh(this,t-Jn((on(),T2)),gn((n=u(_n(this,16),26),n||T2),t))},l.sh=function(t,n){var r;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab),!this.Ab&&(this.Ab=new at(ti,this,0,3)),fs(this.Ab,u(n,14));return;case 1:l$(this,Hr(n));return;case 2:Vte(this,Hr(n));return;case 5:x7(this,Hr(n));return;case 7:!this.A&&(this.A=new qu(mu,this,7)),_r(this.A),!this.A&&(this.A=new qu(mu,this,7)),fs(this.A,u(n,14));return;case 8:bH(this,It(Mt(n)));return;case 9:!this.a&&(this.a=new at(J0,this,9,5)),_r(this.a),!this.a&&(this.a=new at(J0,this,9,5)),fs(this.a,u(n,14));return}yh(this,t-Jn((on(),T2)),gn((r=u(_n(this,16),26),r||T2),t),n)},l.zh=function(){return on(),T2},l.Bh=function(t){var n;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab);return;case 1:we(this.Cb,179)&&(u(this.Cb,179).tb=null),au(this,null);return;case 2:Y8(this,null),R8(this,this.D);return;case 5:x7(this,null);return;case 7:!this.A&&(this.A=new qu(mu,this,7)),_r(this.A);return;case 8:bH(this,!0);return;case 9:!this.a&&(this.a=new at(J0,this,9,5)),_r(this.a);return}wh(this,t-Jn((on(),T2)),gn((n=u(_n(this,16),26),n||T2),t))},l.Gh=function(){var t,n;if(this.a)for(t=0,n=this.a.i;t>16==5?u(this.Cb,671):null}return ph(this,t-Jn((on(),Yg)),gn((s=u(_n(this,16),26),s||Yg),t),n,r)},l.hh=function(t,n,r){var s,o,h;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),ou(this.Ab,t,r);case 5:return this.Cb&&(r=(o=this.Db>>16,o>=0?Wit(this,r):this.Cb.ih(this,-1-o,null,r))),Kl(this,t,5,r)}return h=u(gn((s=u(_n(this,16),26),s||(on(),Yg)),n),66),h.Nj().Qj(this,du(this),n-Jn((on(),Yg)),t,r)},l.jh=function(t,n,r){var s,o;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),Xa(this.Ab,t,r);case 5:return Kl(this,null,5,r)}return o=u(gn((s=u(_n(this,16),26),s||(on(),Yg)),n),66),o.Nj().Rj(this,du(this),n-Jn((on(),Yg)),t,r)},l.lh=function(t){var n;switch(t){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&&u(this.Cb,671))}return dh(this,t-Jn((on(),Yg)),gn((n=u(_n(this,16),26),n||Yg),t))},l.sh=function(t,n){var r;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab),!this.Ab&&(this.Ab=new at(ti,this,0,3)),fs(this.Ab,u(n,14));return;case 1:au(this,Hr(n));return;case 2:Qre(this,u(n,19).a);return;case 3:zat(this,u(n,1940));return;case 4:Jre(this,Hr(n));return}yh(this,t-Jn((on(),Yg)),gn((r=u(_n(this,16),26),r||Yg),t),n)},l.zh=function(){return on(),Yg},l.Bh=function(t){var n;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab);return;case 1:au(this,null);return;case 2:Qre(this,0);return;case 3:zat(this,null);return;case 4:Jre(this,null);return}wh(this,t-Jn((on(),Yg)),gn((n=u(_n(this,16),26),n||Yg),t))},l.Ib=function(){var t;return t=this.c,t??this.zb},l.b=null,l.c=null,l.d=0,O(Tn,"EEnumLiteralImpl",573);var M3n=ss(Tn,"EFactoryImpl/InternalEDateTimeFormat");M(489,1,{2015:1},aM),O(Tn,"EFactoryImpl/1ClientInternalEDateTimeFormat",489),M(241,115,{105:1,92:1,90:1,87:1,56:1,108:1,49:1,97:1,241:1,114:1,115:1},uv),l.Sg=function(t,n,r){var s;return r=Kl(this,t,n,r),this.e&&we(t,170)&&(s=nz(this,this.e),s!=this.c&&(r=E7(this,s,r))),r},l._g=function(t,n,r){var s;switch(t){case 0:return this.f;case 1:return!this.d&&(this.d=new Bs(Eo,this,1)),this.d;case 2:return n?dz(this):this.c;case 3:return this.b;case 4:return this.e;case 5:return n?ose(this):this.a}return ph(this,t-Jn((on(),Ow)),gn((s=u(_n(this,16),26),s||Ow),t),n,r)},l.jh=function(t,n,r){var s,o;switch(n){case 0:return Vnt(this,null,r);case 1:return!this.d&&(this.d=new Bs(Eo,this,1)),Xa(this.d,t,r);case 3:return qnt(this,null,r)}return o=u(gn((s=u(_n(this,16),26),s||(on(),Ow)),n),66),o.Nj().Rj(this,du(this),n-Jn((on(),Ow)),t,r)},l.lh=function(t){var n;switch(t){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 dh(this,t-Jn((on(),Ow)),gn((n=u(_n(this,16),26),n||Ow),t))},l.sh=function(t,n){var r;switch(t){case 0:hst(this,u(n,87));return;case 1:!this.d&&(this.d=new Bs(Eo,this,1)),_r(this.d),!this.d&&(this.d=new Bs(Eo,this,1)),fs(this.d,u(n,14));return;case 3:J3e(this,u(n,87));return;case 4:b4e(this,u(n,836));return;case 5:I8(this,u(n,138));return}yh(this,t-Jn((on(),Ow)),gn((r=u(_n(this,16),26),r||Ow),t),n)},l.zh=function(){return on(),Ow},l.Bh=function(t){var n;switch(t){case 0:hst(this,null);return;case 1:!this.d&&(this.d=new Bs(Eo,this,1)),_r(this.d);return;case 3:J3e(this,null);return;case 4:b4e(this,null);return;case 5:I8(this,null);return}wh(this,t-Jn((on(),Ow)),gn((n=u(_n(this,16),26),n||Ow),t))},l.Ib=function(){var t;return t=new Fl(_f(this)),t.a+=" (expression: ",bae(this,t),t.a+=")",t.a};var FAe;O(Tn,"EGenericTypeImpl",241),M(1969,1964,yG),l.Xh=function(t,n){RUe(this,t,n)},l.lk=function(t,n){return RUe(this,this.gc(),t),n},l.pi=function(t){return s1(this.Gi(),t)},l.Zh=function(){return this.$h()},l.Gi=function(){return new G$e(this)},l.$h=function(){return this._h(0)},l._h=function(t){return this.Gi().Zc(t)},l.mk=function(t,n){return Xm(this,t,!0),n},l.ii=function(t,n){var r,s;return s=vse(this,n),r=this.Zc(t),r.Rb(s),s},l.ji=function(t,n){var r;Xm(this,n,!0),r=this.Zc(t),r.Rb(n)},O(Wi,"AbstractSequentialInternalEList",1969),M(486,1969,yG,OM),l.pi=function(t){return s1(this.Gi(),t)},l.Zh=function(){return this.b==null?(wg(),wg(),lN):this.Jk()},l.Gi=function(){return new cVe(this.a,this.b)},l.$h=function(){return this.b==null?(wg(),wg(),lN):this.Jk()},l._h=function(t){var n,r;if(this.b==null){if(t<0||t>1)throw J(new Do($C+t+", size=0"));return wg(),wg(),lN}for(r=this.Jk(),n=0;n0;)if(n=this.c[--this.d],(!this.e||n.Gj()!=AE||n.aj()!=0)&&(!this.Mk()||this.b.mh(n))){if(h=this.b.bh(n,this.Lk()),this.f=(ho(),u(n,66).Oj()),this.f||n.$j()){if(this.Lk()?(s=u(h,15),this.k=s):(s=u(h,69),this.k=this.j=s),we(this.k,54)?(this.o=this.k.gc(),this.n=this.o):this.p=this.j?this.j._h(this.k.gc()):this.k.Zc(this.k.gc()),this.p?rat(this,this.p):pat(this))return o=this.p?this.p.Ub():this.j?this.j.pi(--this.n):this.k.Xb(--this.n),this.f?(t=u(o,72),t.ak(),r=t.dd(),this.i=r):(r=o,this.i=r),this.g=-3,!0}else if(h!=null)return this.k=null,this.p=null,r=h,this.i=r,this.g=-2,!0}return this.k=null,this.p=null,this.g=-1,!1}else return o=this.p?this.p.Ub():this.j?this.j.pi(--this.n):this.k.Xb(--this.n),this.f?(t=u(o,72),t.ak(),r=t.dd(),this.i=r):(r=o,this.i=r),this.g=-3,!0}},l.Pb=function(){return aH(this)},l.Tb=function(){return this.a},l.Ub=function(){var t;if(this.g<-1||this.Sb())return--this.a,this.g=0,t=this.i,this.Sb(),t;throw J(new xc)},l.Vb=function(){return this.a-1},l.Qb=function(){throw J(new Fr)},l.Lk=function(){return!1},l.Wb=function(t){throw J(new Fr)},l.Mk=function(){return!0},l.a=0,l.d=0,l.f=!1,l.g=0,l.n=0,l.o=0;var lN;O(Wi,"EContentsEList/FeatureIteratorImpl",279),M(697,279,kG,kbe),l.Lk=function(){return!0},O(Wi,"EContentsEList/ResolvingFeatureIteratorImpl",697),M(1157,697,kG,_Ue),l.Mk=function(){return!1},O(Tn,"ENamedElementImpl/1/1",1157),M(1158,279,kG,TUe),l.Mk=function(){return!1},O(Tn,"ENamedElementImpl/1/2",1158),M(36,143,XI,Hm,Tre,oa,jre,N0,xf,_me,JXe,Cme,eQe,Xwe,tQe,Lme,nQe,Qwe,rQe,Sme,iQe,p_,dD,nre,Ame,sQe,Zwe,aQe),l._i=function(){return ume(this)},l.gj=function(){var t;return t=ume(this),t?t.zj():null},l.yi=function(t){return this.b==-1&&this.a&&(this.b=this.c.Xg(this.a.aj(),this.a.Gj())),this.c.Og(this.b,t)},l.Ai=function(){return this.c},l.hj=function(){var t;return t=ume(this),t?t.Kj():!1},l.b=-1,O(Tn,"ENotificationImpl",36),M(399,284,{105:1,92:1,90:1,147:1,191:1,56:1,59:1,108:1,472:1,49:1,97:1,150:1,399:1,284:1,114:1,115:1},Uee),l.Qg=function(t){return Xit(this,t)},l._g=function(t,n,r){var s,o,h;switch(t){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),this.Ab;case 1:return this.zb;case 2:return Mn(),!!(this.Bb&256);case 3:return Mn(),!!(this.Bb&512);case 4:return ct(this.s);case 5:return ct(this.t);case 6:return Mn(),h=this.t,h>1||h==-1;case 7:return Mn(),o=this.s,o>=1;case 8:return n?$h(this):this.r;case 9:return this.q;case 10:return this.Db>>16==10?u(this.Cb,26):null;case 11:return!this.d&&(this.d=new qu(mu,this,11)),this.d;case 12:return!this.c&&(this.c=new at(Iw,this,12,10)),this.c;case 13:return!this.a&&(this.a=new jM(this,this)),this.a;case 14:return gl(this)}return ph(this,t-Jn((on(),Xg)),gn((s=u(_n(this,16),26),s||Xg),t),n,r)},l.hh=function(t,n,r){var s,o,h;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),ou(this.Ab,t,r);case 10:return this.Cb&&(r=(o=this.Db>>16,o>=0?Xit(this,r):this.Cb.ih(this,-1-o,null,r))),Kl(this,t,10,r);case 12:return!this.c&&(this.c=new at(Iw,this,12,10)),ou(this.c,t,r)}return h=u(gn((s=u(_n(this,16),26),s||(on(),Xg)),n),66),h.Nj().Qj(this,du(this),n-Jn((on(),Xg)),t,r)},l.jh=function(t,n,r){var s,o;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),Xa(this.Ab,t,r);case 9:return zne(this,r);case 10:return Kl(this,null,10,r);case 11:return!this.d&&(this.d=new qu(mu,this,11)),Xa(this.d,t,r);case 12:return!this.c&&(this.c=new at(Iw,this,12,10)),Xa(this.c,t,r);case 14:return Xa(gl(this),t,r)}return o=u(gn((s=u(_n(this,16),26),s||(on(),Xg)),n),66),o.Nj().Rj(this,du(this),n-Jn((on(),Xg)),t,r)},l.lh=function(t){var n,r,s;switch(t){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 s=this.t,s>1||s==-1;case 7:return r=this.s,r>=1;case 8:return!!this.r&&!this.q.e&&Mv(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&Mv(this.q).i==0);case 10:return!!(this.Db>>16==10&&u(this.Cb,26));case 11:return!!this.d&&this.d.i!=0;case 12:return!!this.c&&this.c.i!=0;case 13:return!!this.a&&gl(this.a.a).i!=0&&!(this.b&&sse(this.b));case 14:return!!this.b&&sse(this.b)}return dh(this,t-Jn((on(),Xg)),gn((n=u(_n(this,16),26),n||Xg),t))},l.sh=function(t,n){var r,s;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab),!this.Ab&&(this.Ab=new at(ti,this,0,3)),fs(this.Ab,u(n,14));return;case 1:au(this,Hr(n));return;case 2:Lg(this,It(Mt(n)));return;case 3:Mg(this,It(Mt(n)));return;case 4:Cg(this,u(n,19).a);return;case 5:Wm(this,u(n,19).a);return;case 8:cb(this,u(n,138));return;case 9:s=$1(this,u(n,87),null),s&&s.Fi();return;case 11:!this.d&&(this.d=new qu(mu,this,11)),_r(this.d),!this.d&&(this.d=new qu(mu,this,11)),fs(this.d,u(n,14));return;case 12:!this.c&&(this.c=new at(Iw,this,12,10)),_r(this.c),!this.c&&(this.c=new at(Iw,this,12,10)),fs(this.c,u(n,14));return;case 13:!this.a&&(this.a=new jM(this,this)),pC(this.a),!this.a&&(this.a=new jM(this,this)),fs(this.a,u(n,14));return;case 14:_r(gl(this)),fs(gl(this),u(n,14));return}yh(this,t-Jn((on(),Xg)),gn((r=u(_n(this,16),26),r||Xg),t),n)},l.zh=function(){return on(),Xg},l.Bh=function(t){var n,r;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab);return;case 1:au(this,null);return;case 2:Lg(this,!0);return;case 3:Mg(this,!0);return;case 4:Cg(this,0);return;case 5:Wm(this,1);return;case 8:cb(this,null);return;case 9:r=$1(this,null,null),r&&r.Fi();return;case 11:!this.d&&(this.d=new qu(mu,this,11)),_r(this.d);return;case 12:!this.c&&(this.c=new at(Iw,this,12,10)),_r(this.c);return;case 13:this.a&&pC(this.a);return;case 14:this.b&&_r(this.b);return}wh(this,t-Jn((on(),Xg)),gn((n=u(_n(this,16),26),n||Xg),t))},l.Gh=function(){var t,n;if(this.c)for(t=0,n=this.c.i;tv&&cs(t,v,null),s=0,r=new rr(gl(this.a));r.e!=r.i.gc();)n=u(pr(r),87),h=(d=n.c,d||(on(),Z1)),cs(t,s++,h);return t},l.Yi=function(){var t,n,r,s,o;for(o=new bg,o.a+="[",t=gl(this.a),n=0,s=gl(this.a).i;n1);case 5:return x_(this,t,n,r,s,this.i-u(r,15).gc()>0);default:return new N0(this.e,t,this.c,n,r,s,!0)}},l.ij=function(){return!0},l.fj=function(){return sse(this)},l.Xj=function(){_r(this)},O(Tn,"EOperationImpl/2",1341),M(498,1,{1938:1,498:1},zqe),O(Tn,"EPackageImpl/1",498),M(16,85,Zo,at),l.zk=function(){return this.d},l.Ak=function(){return this.b},l.Dk=function(){return!0},l.b=0,O(Wi,"EObjectContainmentWithInverseEList",16),M(353,16,Zo,S6),l.Ek=function(){return!0},l.li=function(t,n){return rk(this,t,u(n,56))},O(Wi,"EObjectContainmentWithInverseEList/Resolving",353),M(298,353,Zo,Pm),l.ci=function(){this.a.tb=null},O(Tn,"EPackageImpl/2",298),M(1228,1,{},YB),O(Tn,"EPackageImpl/3",1228),M(718,43,y4,Epe),l._b=function(t){return fa(t)?rre(this,t):!!$o(this.f,t)},O(Tn,"EPackageRegistryImpl",718),M(509,284,{105:1,92:1,90:1,147:1,191:1,56:1,2017:1,108:1,472:1,49:1,97:1,150:1,509:1,284:1,114:1,115:1},Wee),l.Qg=function(t){return Qit(this,t)},l._g=function(t,n,r){var s,o,h;switch(t){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),this.Ab;case 1:return this.zb;case 2:return Mn(),!!(this.Bb&256);case 3:return Mn(),!!(this.Bb&512);case 4:return ct(this.s);case 5:return ct(this.t);case 6:return Mn(),h=this.t,h>1||h==-1;case 7:return Mn(),o=this.s,o>=1;case 8:return n?$h(this):this.r;case 9:return this.q;case 10:return this.Db>>16==10?u(this.Cb,59):null}return ph(this,t-Jn((on(),Ky)),gn((s=u(_n(this,16),26),s||Ky),t),n,r)},l.hh=function(t,n,r){var s,o,h;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),ou(this.Ab,t,r);case 10:return this.Cb&&(r=(o=this.Db>>16,o>=0?Qit(this,r):this.Cb.ih(this,-1-o,null,r))),Kl(this,t,10,r)}return h=u(gn((s=u(_n(this,16),26),s||(on(),Ky)),n),66),h.Nj().Qj(this,du(this),n-Jn((on(),Ky)),t,r)},l.jh=function(t,n,r){var s,o;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),Xa(this.Ab,t,r);case 9:return zne(this,r);case 10:return Kl(this,null,10,r)}return o=u(gn((s=u(_n(this,16),26),s||(on(),Ky)),n),66),o.Nj().Rj(this,du(this),n-Jn((on(),Ky)),t,r)},l.lh=function(t){var n,r,s;switch(t){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 s=this.t,s>1||s==-1;case 7:return r=this.s,r>=1;case 8:return!!this.r&&!this.q.e&&Mv(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&Mv(this.q).i==0);case 10:return!!(this.Db>>16==10&&u(this.Cb,59))}return dh(this,t-Jn((on(),Ky)),gn((n=u(_n(this,16),26),n||Ky),t))},l.zh=function(){return on(),Ky},O(Tn,"EParameterImpl",509),M(99,449,{105:1,92:1,90:1,147:1,191:1,56:1,18:1,170:1,66:1,108:1,472:1,49:1,97:1,150:1,99:1,449:1,284:1,114:1,115:1,677:1},Cbe),l._g=function(t,n,r){var s,o,h,d;switch(t){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),this.Ab;case 1:return this.zb;case 2:return Mn(),!!(this.Bb&256);case 3:return Mn(),!!(this.Bb&512);case 4:return ct(this.s);case 5:return ct(this.t);case 6:return Mn(),d=this.t,d>1||d==-1;case 7:return Mn(),o=this.s,o>=1;case 8:return n?$h(this):this.r;case 9:return this.q;case 10:return Mn(),!!(this.Bb&Sf);case 11:return Mn(),!!(this.Bb&ky);case 12:return Mn(),!!(this.Bb&dy);case 13:return this.j;case 14:return b7(this);case 15:return Mn(),!!(this.Bb&Zu);case 16:return Mn(),!!(this.Bb&Ed);case 17:return Fm(this);case 18:return Mn(),!!(this.Bb&_c);case 19:return Mn(),h=go(this),!!(h&&h.Bb&_c);case 20:return Mn(),!!(this.Bb&so);case 21:return n?go(this):this.b;case 22:return n?uye(this):AZe(this);case 23:return!this.a&&(this.a=new $3(Vy,this,23)),this.a}return ph(this,t-Jn((on(),n5)),gn((s=u(_n(this,16),26),s||n5),t),n,r)},l.lh=function(t){var n,r,s,o;switch(t){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 o=this.t,o>1||o==-1;case 7:return r=this.s,r>=1;case 8:return!!this.r&&!this.q.e&&Mv(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&Mv(this.q).i==0);case 10:return(this.Bb&Sf)==0;case 11:return(this.Bb&ky)!=0;case 12:return(this.Bb&dy)!=0;case 13:return this.j!=null;case 14:return b7(this)!=null;case 15:return(this.Bb&Zu)!=0;case 16:return(this.Bb&Ed)!=0;case 17:return!!Fm(this);case 18:return(this.Bb&_c)!=0;case 19:return s=go(this),!!s&&(s.Bb&_c)!=0;case 20:return(this.Bb&so)==0;case 21:return!!this.b;case 22:return!!AZe(this);case 23:return!!this.a&&this.a.i!=0}return dh(this,t-Jn((on(),n5)),gn((n=u(_n(this,16),26),n||n5),t))},l.sh=function(t,n){var r,s;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab),!this.Ab&&(this.Ab=new at(ti,this,0,3)),fs(this.Ab,u(n,14));return;case 1:bre(this,Hr(n));return;case 2:Lg(this,It(Mt(n)));return;case 3:Mg(this,It(Mt(n)));return;case 4:Cg(this,u(n,19).a);return;case 5:Wm(this,u(n,19).a);return;case 8:cb(this,u(n,138));return;case 9:s=$1(this,u(n,87),null),s&&s.Fi();return;case 10:J8(this,It(Mt(n)));return;case 11:n7(this,It(Mt(n)));return;case 12:e7(this,It(Mt(n)));return;case 13:N2e(this,Hr(n));return;case 15:t7(this,It(Mt(n)));return;case 16:r7(this,It(Mt(n)));return;case 18:Men(this,It(Mt(n)));return;case 20:$ye(this,It(Mt(n)));return;case 21:jme(this,u(n,18));return;case 23:!this.a&&(this.a=new $3(Vy,this,23)),_r(this.a),!this.a&&(this.a=new $3(Vy,this,23)),fs(this.a,u(n,14));return}yh(this,t-Jn((on(),n5)),gn((r=u(_n(this,16),26),r||n5),t),n)},l.zh=function(){return on(),n5},l.Bh=function(t){var n,r;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab);return;case 1:we(this.Cb,88)&&iy(dl(u(this.Cb,88)),4),au(this,null);return;case 2:Lg(this,!0);return;case 3:Mg(this,!0);return;case 4:Cg(this,0);return;case 5:Wm(this,1);return;case 8:cb(this,null);return;case 9:r=$1(this,null,null),r&&r.Fi();return;case 10:J8(this,!0);return;case 11:n7(this,!1);return;case 12:e7(this,!1);return;case 13:this.i=null,X$(this,null);return;case 15:t7(this,!1);return;case 16:r7(this,!1);return;case 18:jye(this,!1),we(this.Cb,88)&&iy(dl(u(this.Cb,88)),2);return;case 20:$ye(this,!0);return;case 21:jme(this,null);return;case 23:!this.a&&(this.a=new $3(Vy,this,23)),_r(this.a);return}wh(this,t-Jn((on(),n5)),gn((n=u(_n(this,16),26),n||n5),t))},l.Gh=function(){uye(this),m8(Po((Yu(),Oa),this)),$h(this),this.Bb|=1},l.Lj=function(){return go(this)},l.qk=function(){var t;return t=go(this),!!t&&(t.Bb&_c)!=0},l.rk=function(){return(this.Bb&_c)!=0},l.sk=function(){return(this.Bb&so)!=0},l.nk=function(t,n){return this.c=null,Iye(this,t,n)},l.Ib=function(){var t;return this.Db&64?lz(this):(t=new Ph(lz(this)),t.a+=" (containment: ",vg(t,(this.Bb&_c)!=0),t.a+=", resolveProxies: ",vg(t,(this.Bb&so)!=0),t.a+=")",t.a)},O(Tn,"EReferenceImpl",99),M(548,115,{105:1,42:1,92:1,90:1,133:1,56:1,108:1,49:1,97:1,548:1,114:1,115:1},UZ),l.Fb=function(t){return this===t},l.cd=function(){return this.b},l.dd=function(){return this.c},l.Hb=function(){return xv(this)},l.Uh=function(t){PQt(this,Hr(t))},l.ed=function(t){return EQt(this,Hr(t))},l._g=function(t,n,r){var s;switch(t){case 0:return this.b;case 1:return this.c}return ph(this,t-Jn((on(),oo)),gn((s=u(_n(this,16),26),s||oo),t),n,r)},l.lh=function(t){var n;switch(t){case 0:return this.b!=null;case 1:return this.c!=null}return dh(this,t-Jn((on(),oo)),gn((n=u(_n(this,16),26),n||oo),t))},l.sh=function(t,n){var r;switch(t){case 0:BQt(this,Hr(n));return;case 1:Bme(this,Hr(n));return}yh(this,t-Jn((on(),oo)),gn((r=u(_n(this,16),26),r||oo),t),n)},l.zh=function(){return on(),oo},l.Bh=function(t){var n;switch(t){case 0:Pme(this,null);return;case 1:Bme(this,null);return}wh(this,t-Jn((on(),oo)),gn((n=u(_n(this,16),26),n||oo),t))},l.Sh=function(){var t;return this.a==-1&&(t=this.b,this.a=t==null?0:Ig(t)),this.a},l.Th=function(t){this.a=t},l.Ib=function(){var t;return this.Db&64?_f(this):(t=new Ph(_f(this)),t.a+=" (key: ",To(t,this.b),t.a+=", value: ",To(t,this.c),t.a+=")",t.a)},l.a=-1,l.b=null,l.c=null;var wc=O(Tn,"EStringToStringMapEntryImpl",548),b4t=ss(Wi,"FeatureMap/Entry/Internal");M(565,1,xG),l.Ok=function(t){return this.Pk(u(t,49))},l.Pk=function(t){return this.Ok(t)},l.Fb=function(t){var n,r;return this===t?!0:we(t,72)?(n=u(t,72),n.ak()==this.c?(r=this.dd(),r==null?n.dd()==null:Ci(r,n.dd())):!1):!1},l.ak=function(){return this.c},l.Hb=function(){var t;return t=this.dd(),Xi(this.c)^(t==null?0:Xi(t))},l.Ib=function(){var t,n;return t=this.c,n=Gl(t.Hj()).Ph(),t.ne(),(n!=null&&n.length!=0?n+":"+t.ne():t.ne())+"="+this.dd()},O(Tn,"EStructuralFeatureImpl/BasicFeatureMapEntry",565),M(776,565,xG,Pbe),l.Pk=function(t){return new Pbe(this.c,t)},l.dd=function(){return this.a},l.Qk=function(t,n,r){return Zin(this,t,this.a,n,r)},l.Rk=function(t,n,r){return Jin(this,t,this.a,n,r)},O(Tn,"EStructuralFeatureImpl/ContainmentUpdatingFeatureMapEntry",776),M(1314,1,{},Gqe),l.Pj=function(t,n,r,s,o){var h;return h=u(A8(t,this.b),215),h.nl(this.a).Wj(s)},l.Qj=function(t,n,r,s,o){var h;return h=u(A8(t,this.b),215),h.el(this.a,s,o)},l.Rj=function(t,n,r,s,o){var h;return h=u(A8(t,this.b),215),h.fl(this.a,s,o)},l.Sj=function(t,n,r){var s;return s=u(A8(t,this.b),215),s.nl(this.a).fj()},l.Tj=function(t,n,r,s){var o;o=u(A8(t,this.b),215),o.nl(this.a).Wb(s)},l.Uj=function(t,n,r){return u(A8(t,this.b),215).nl(this.a)},l.Vj=function(t,n,r){var s;s=u(A8(t,this.b),215),s.nl(this.a).Xj()},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateFeatureMapDelegator",1314),M(89,1,{},yg,K2,xg,Q2),l.Pj=function(t,n,r,s,o){var h;if(h=n.Ch(r),h==null&&n.Dh(r,h=Ez(this,t)),!o)switch(this.e){case 50:case 41:return u(h,589).sj();case 40:return u(h,215).kl()}return h},l.Qj=function(t,n,r,s,o){var h,d;return d=n.Ch(r),d==null&&n.Dh(r,d=Ez(this,t)),h=u(d,69).lk(s,o),h},l.Rj=function(t,n,r,s,o){var h;return h=n.Ch(r),h!=null&&(o=u(h,69).mk(s,o)),o},l.Sj=function(t,n,r){var s;return s=n.Ch(r),s!=null&&u(s,76).fj()},l.Tj=function(t,n,r,s){var o;o=u(n.Ch(r),76),!o&&n.Dh(r,o=Ez(this,t)),o.Wb(s)},l.Uj=function(t,n,r){var s,o;return o=n.Ch(r),o==null&&n.Dh(r,o=Ez(this,t)),we(o,76)?u(o,76):(s=u(n.Ch(r),15),new z$e(s))},l.Vj=function(t,n,r){var s;s=u(n.Ch(r),76),!s&&n.Dh(r,s=Ez(this,t)),s.Xj()},l.b=0,l.e=0,O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateMany",89),M(504,1,{}),l.Qj=function(t,n,r,s,o){throw J(new Fr)},l.Rj=function(t,n,r,s,o){throw J(new Fr)},l.Uj=function(t,n,r){return new FYe(this,t,n,r)};var b0;O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingle",504),M(1331,1,Qce,FYe),l.Wj=function(t){return this.a.Pj(this.c,this.d,this.b,t,!0)},l.fj=function(){return this.a.Sj(this.c,this.d,this.b)},l.Wb=function(t){this.a.Tj(this.c,this.d,this.b,t)},l.Xj=function(){this.a.Vj(this.c,this.d,this.b)},l.b=0,O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingle/1",1331),M(769,504,{},vwe),l.Pj=function(t,n,r,s,o){return rae(t,t.eh(),t.Vg())==this.b?this.sk()&&s?Hse(t):t.eh():null},l.Qj=function(t,n,r,s,o){var h,d;return t.eh()&&(o=(h=t.Vg(),h>=0?t.Qg(o):t.eh().ih(t,-1-h,null,o))),d=Ji(t.Tg(),this.e),t.Sg(s,d,o)},l.Rj=function(t,n,r,s,o){var h;return h=Ji(t.Tg(),this.e),t.Sg(null,h,o)},l.Sj=function(t,n,r){var s;return s=Ji(t.Tg(),this.e),!!t.eh()&&t.Vg()==s},l.Tj=function(t,n,r,s){var o,h,d,v,x;if(s!=null&&!oae(this.a,s))throw J(new Wx(EG+(we(s,56)?Q3e(u(s,56).Tg()):kme(pl(s)))+TG+this.a+"'"));if(o=t.eh(),d=Ji(t.Tg(),this.e),je(s)!==je(o)||t.Vg()!=d&&s!=null){if(o7(t,u(s,56)))throw J(new Ln(FC+t.Ib()));x=null,o&&(x=(h=t.Vg(),h>=0?t.Qg(x):t.eh().ih(t,-1-h,null,x))),v=u(s,49),v&&(x=v.gh(t,Ji(v.Tg(),this.b),null,x)),x=t.Sg(v,d,x),x&&x.Fi()}else t.Lg()&&t.Mg()&&_i(t,new oa(t,1,d,s,s))},l.Vj=function(t,n,r){var s,o,h,d;s=t.eh(),s?(d=(o=t.Vg(),o>=0?t.Qg(null):t.eh().ih(t,-1-o,null,null)),h=Ji(t.Tg(),this.e),d=t.Sg(null,h,d),d&&d.Fi()):t.Lg()&&t.Mg()&&_i(t,new p_(t,1,this.e,null,null))},l.sk=function(){return!1},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleContainer",769),M(1315,769,{},MWe),l.sk=function(){return!0},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleContainerResolving",1315),M(563,504,{}),l.Pj=function(t,n,r,s,o){var h;return h=n.Ch(r),h==null?this.b:je(h)===je(b0)?null:h},l.Sj=function(t,n,r){var s;return s=n.Ch(r),s!=null&&(je(s)===je(b0)||!Ci(s,this.b))},l.Tj=function(t,n,r,s){var o,h;t.Lg()&&t.Mg()?(o=(h=n.Ch(r),h==null?this.b:je(h)===je(b0)?null:h),s==null?this.c!=null?(n.Dh(r,null),s=this.b):this.b!=null?n.Dh(r,b0):n.Dh(r,null):(this.Sk(s),n.Dh(r,s)),_i(t,this.d.Tk(t,1,this.e,o,s))):s==null?this.c!=null?n.Dh(r,null):this.b!=null?n.Dh(r,b0):n.Dh(r,null):(this.Sk(s),n.Dh(r,s))},l.Vj=function(t,n,r){var s,o;t.Lg()&&t.Mg()?(s=(o=n.Ch(r),o==null?this.b:je(o)===je(b0)?null:o),n.Eh(r),_i(t,this.d.Tk(t,1,this.e,s,this.b))):n.Eh(r)},l.Sk=function(t){throw J(new Z$e)},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData",563),M(M4,1,{},XB),l.Tk=function(t,n,r,s,o){return new p_(t,n,r,s,o)},l.Uk=function(t,n,r,s,o,h){return new nre(t,n,r,s,o,h)};var jAe,$Ae,HAe,zAe,GAe,qAe,VAe,_fe,UAe;O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator",M4),M(1332,M4,{},QB),l.Tk=function(t,n,r,s,o){return new Zwe(t,n,r,It(Mt(s)),It(Mt(o)))},l.Uk=function(t,n,r,s,o,h){return new aQe(t,n,r,It(Mt(s)),It(Mt(o)),h)},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/1",1332),M(1333,M4,{},ZB),l.Tk=function(t,n,r,s,o){return new _me(t,n,r,u(s,217).a,u(o,217).a)},l.Uk=function(t,n,r,s,o,h){return new JXe(t,n,r,u(s,217).a,u(o,217).a,h)},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/2",1333),M(1334,M4,{},_x),l.Tk=function(t,n,r,s,o){return new Cme(t,n,r,u(s,172).a,u(o,172).a)},l.Uk=function(t,n,r,s,o,h){return new eQe(t,n,r,u(s,172).a,u(o,172).a,h)},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/3",1334),M(1335,M4,{},JB),l.Tk=function(t,n,r,s,o){return new Xwe(t,n,r,Ue(ft(s)),Ue(ft(o)))},l.Uk=function(t,n,r,s,o,h){return new tQe(t,n,r,Ue(ft(s)),Ue(ft(o)),h)},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/4",1335),M(1336,M4,{},eR),l.Tk=function(t,n,r,s,o){return new Lme(t,n,r,u(s,155).a,u(o,155).a)},l.Uk=function(t,n,r,s,o,h){return new nQe(t,n,r,u(s,155).a,u(o,155).a,h)},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/5",1336),M(1337,M4,{},WZ),l.Tk=function(t,n,r,s,o){return new Qwe(t,n,r,u(s,19).a,u(o,19).a)},l.Uk=function(t,n,r,s,o,h){return new rQe(t,n,r,u(s,19).a,u(o,19).a,h)},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/6",1337),M(1338,M4,{},Cx),l.Tk=function(t,n,r,s,o){return new Sme(t,n,r,u(s,162).a,u(o,162).a)},l.Uk=function(t,n,r,s,o,h){return new iQe(t,n,r,u(s,162).a,u(o,162).a,h)},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/7",1338),M(1339,M4,{},Sx),l.Tk=function(t,n,r,s,o){return new Ame(t,n,r,u(s,184).a,u(o,184).a)},l.Uk=function(t,n,r,s,o,h){return new sQe(t,n,r,u(s,184).a,u(o,184).a,h)},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/8",1339),M(1317,563,{},jYe),l.Sk=function(t){if(!this.a.wj(t))throw J(new Wx(EG+pl(t)+TG+this.a+"'"))},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataDynamic",1317),M(1318,563,{},SKe),l.Sk=function(t){},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataStatic",1318),M(770,563,{}),l.Sj=function(t,n,r){var s;return s=n.Ch(r),s!=null},l.Tj=function(t,n,r,s){var o,h;t.Lg()&&t.Mg()?(o=!0,h=n.Ch(r),h==null?(o=!1,h=this.b):je(h)===je(b0)&&(h=null),s==null?this.c!=null?(n.Dh(r,null),s=this.b):n.Dh(r,b0):(this.Sk(s),n.Dh(r,s)),_i(t,this.d.Uk(t,1,this.e,h,s,!o))):s==null?this.c!=null?n.Dh(r,null):n.Dh(r,b0):(this.Sk(s),n.Dh(r,s))},l.Vj=function(t,n,r){var s,o;t.Lg()&&t.Mg()?(s=!0,o=n.Ch(r),o==null?(s=!1,o=this.b):je(o)===je(b0)&&(o=null),n.Eh(r),_i(t,this.d.Uk(t,2,this.e,o,this.b,s))):n.Eh(r)},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettable",770),M(1319,770,{},$Ye),l.Sk=function(t){if(!this.a.wj(t))throw J(new Wx(EG+pl(t)+TG+this.a+"'"))},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableDynamic",1319),M(1320,770,{},AKe),l.Sk=function(t){},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableStatic",1320),M(398,504,{},Mj),l.Pj=function(t,n,r,s,o){var h,d,v,x,_;if(_=n.Ch(r),this.Kj()&&je(_)===je(b0))return null;if(this.sk()&&s&&_!=null){if(v=u(_,49),v.kh()&&(x=Up(t,v),v!=x)){if(!oae(this.a,x))throw J(new Wx(EG+pl(x)+TG+this.a+"'"));n.Dh(r,_=x),this.rk()&&(h=u(x,49),d=v.ih(t,this.b?Ji(v.Tg(),this.b):-1-Ji(t.Tg(),this.e),null,null),!h.eh()&&(d=h.gh(t,this.b?Ji(h.Tg(),this.b):-1-Ji(t.Tg(),this.e),null,d)),d&&d.Fi()),t.Lg()&&t.Mg()&&_i(t,new p_(t,9,this.e,v,x))}return _}else return _},l.Qj=function(t,n,r,s,o){var h,d;return d=n.Ch(r),je(d)===je(b0)&&(d=null),n.Dh(r,s),this.bj()?je(d)!==je(s)&&d!=null&&(h=u(d,49),o=h.ih(t,Ji(h.Tg(),this.b),null,o)):this.rk()&&d!=null&&(o=u(d,49).ih(t,-1-Ji(t.Tg(),this.e),null,o)),t.Lg()&&t.Mg()&&(!o&&(o=new _p(4)),o.Ei(new p_(t,1,this.e,d,s))),o},l.Rj=function(t,n,r,s,o){var h;return h=n.Ch(r),je(h)===je(b0)&&(h=null),n.Eh(r),t.Lg()&&t.Mg()&&(!o&&(o=new _p(4)),this.Kj()?o.Ei(new p_(t,2,this.e,h,null)):o.Ei(new p_(t,1,this.e,h,null))),o},l.Sj=function(t,n,r){var s;return s=n.Ch(r),s!=null},l.Tj=function(t,n,r,s){var o,h,d,v,x;if(s!=null&&!oae(this.a,s))throw J(new Wx(EG+(we(s,56)?Q3e(u(s,56).Tg()):kme(pl(s)))+TG+this.a+"'"));x=n.Ch(r),v=x!=null,this.Kj()&&je(x)===je(b0)&&(x=null),d=null,this.bj()?je(x)!==je(s)&&(x!=null&&(o=u(x,49),d=o.ih(t,Ji(o.Tg(),this.b),null,d)),s!=null&&(o=u(s,49),d=o.gh(t,Ji(o.Tg(),this.b),null,d))):this.rk()&&je(x)!==je(s)&&(x!=null&&(d=u(x,49).ih(t,-1-Ji(t.Tg(),this.e),null,d)),s!=null&&(d=u(s,49).gh(t,-1-Ji(t.Tg(),this.e),null,d))),s==null&&this.Kj()?n.Dh(r,b0):n.Dh(r,s),t.Lg()&&t.Mg()?(h=new nre(t,1,this.e,x,s,this.Kj()&&!v),d?(d.Ei(h),d.Fi()):_i(t,h)):d&&d.Fi()},l.Vj=function(t,n,r){var s,o,h,d,v;v=n.Ch(r),d=v!=null,this.Kj()&&je(v)===je(b0)&&(v=null),h=null,v!=null&&(this.bj()?(s=u(v,49),h=s.ih(t,Ji(s.Tg(),this.b),null,h)):this.rk()&&(h=u(v,49).ih(t,-1-Ji(t.Tg(),this.e),null,h))),n.Eh(r),t.Lg()&&t.Mg()?(o=new nre(t,this.Kj()?2:1,this.e,v,null,d),h?(h.Ei(o),h.Fi()):_i(t,o)):h&&h.Fi()},l.bj=function(){return!1},l.rk=function(){return!1},l.sk=function(){return!1},l.Kj=function(){return!1},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObject",398),M(564,398,{},ine),l.rk=function(){return!0},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainment",564),M(1323,564,{},CUe),l.sk=function(){return!0},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentResolving",1323),M(772,564,{},xbe),l.Kj=function(){return!0},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettable",772),M(1325,772,{},SUe),l.sk=function(){return!0},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettableResolving",1325),M(640,564,{},wne),l.bj=function(){return!0},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverse",640),M(1324,640,{},DWe),l.sk=function(){return!0},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseResolving",1324),M(773,640,{},cve),l.Kj=function(){return!0},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettable",773),M(1326,773,{},IWe),l.sk=function(){return!0},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettableResolving",1326),M(641,398,{},Ebe),l.sk=function(){return!0},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolving",641),M(1327,641,{},AUe),l.Kj=function(){return!0},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingUnsettable",1327),M(774,641,{},ave),l.bj=function(){return!0},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverse",774),M(1328,774,{},OWe),l.Kj=function(){return!0},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverseUnsettable",1328),M(1321,398,{},LUe),l.Kj=function(){return!0},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectUnsettable",1321),M(771,398,{},ove),l.bj=function(){return!0},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverse",771),M(1322,771,{},NWe),l.Kj=function(){return!0},O(Tn,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverseUnsettable",1322),M(775,565,xG,rwe),l.Pk=function(t){return new rwe(this.a,this.c,t)},l.dd=function(){return this.b},l.Qk=function(t,n,r){return Jnn(this,t,this.b,r)},l.Rk=function(t,n,r){return ern(this,t,this.b,r)},O(Tn,"EStructuralFeatureImpl/InverseUpdatingFeatureMapEntry",775),M(1329,1,Qce,z$e),l.Wj=function(t){return this.a},l.fj=function(){return we(this.a,95)?u(this.a,95).fj():!this.a.dc()},l.Wb=function(t){this.a.$b(),this.a.Gc(u(t,15))},l.Xj=function(){we(this.a,95)?u(this.a,95).Xj():this.a.$b()},O(Tn,"EStructuralFeatureImpl/SettingMany",1329),M(1330,565,xG,KQe),l.Ok=function(t){return new one((Fi(),JS),this.b.Ih(this.a,t))},l.dd=function(){return null},l.Qk=function(t,n,r){return r},l.Rk=function(t,n,r){return r},O(Tn,"EStructuralFeatureImpl/SimpleContentFeatureMapEntry",1330),M(642,565,xG,one),l.Ok=function(t){return new one(this.c,t)},l.dd=function(){return this.a},l.Qk=function(t,n,r){return r},l.Rk=function(t,n,r){return r},O(Tn,"EStructuralFeatureImpl/SimpleFeatureMapEntry",642),M(391,497,Od,gm),l.ri=function(t){return Me(tf,yt,26,t,0,1)},l.ni=function(){return!1},O(Tn,"ESuperAdapter/1",391),M(444,438,{105:1,92:1,90:1,147:1,191:1,56:1,108:1,836:1,49:1,97:1,150:1,444:1,114:1,115:1},RL),l._g=function(t,n,r){var s;switch(t){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),this.Ab;case 1:return this.zb;case 2:return!this.a&&(this.a=new h_(this,Eo,this)),this.a}return ph(this,t-Jn((on(),Nw)),gn((s=u(_n(this,16),26),s||Nw),t),n,r)},l.jh=function(t,n,r){var s,o;switch(n){case 0:return!this.Ab&&(this.Ab=new at(ti,this,0,3)),Xa(this.Ab,t,r);case 2:return!this.a&&(this.a=new h_(this,Eo,this)),Xa(this.a,t,r)}return o=u(gn((s=u(_n(this,16),26),s||(on(),Nw)),n),66),o.Nj().Rj(this,du(this),n-Jn((on(),Nw)),t,r)},l.lh=function(t){var n;switch(t){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 dh(this,t-Jn((on(),Nw)),gn((n=u(_n(this,16),26),n||Nw),t))},l.sh=function(t,n){var r;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab),!this.Ab&&(this.Ab=new at(ti,this,0,3)),fs(this.Ab,u(n,14));return;case 1:au(this,Hr(n));return;case 2:!this.a&&(this.a=new h_(this,Eo,this)),_r(this.a),!this.a&&(this.a=new h_(this,Eo,this)),fs(this.a,u(n,14));return}yh(this,t-Jn((on(),Nw)),gn((r=u(_n(this,16),26),r||Nw),t),n)},l.zh=function(){return on(),Nw},l.Bh=function(t){var n;switch(t){case 0:!this.Ab&&(this.Ab=new at(ti,this,0,3)),_r(this.Ab);return;case 1:au(this,null);return;case 2:!this.a&&(this.a=new h_(this,Eo,this)),_r(this.a);return}wh(this,t-Jn((on(),Nw)),gn((n=u(_n(this,16),26),n||Nw),t))},O(Tn,"ETypeParameterImpl",444),M(445,85,Zo,h_),l.cj=function(t,n){return efn(this,u(t,87),n)},l.dj=function(t,n){return tfn(this,u(t,87),n)},O(Tn,"ETypeParameterImpl/1",445),M(634,43,y4,Kee),l.ec=function(){return new rF(this)},O(Tn,"ETypeParameterImpl/2",634),M(556,H1,Xu,rF),l.Fc=function(t){return tWe(this,u(t,87))},l.Gc=function(t){var n,r,s;for(s=!1,r=t.Kc();r.Ob();)n=u(r.Pb(),87),Si(this.a,n,"")==null&&(s=!0);return s},l.$b=function(){sl(this.a)},l.Hc=function(t){return Il(this.a,t)},l.Kc=function(){var t;return t=new ob(new dg(this.a).a),new iF(t)},l.Mc=function(t){return HZe(this,t)},l.gc=function(){return MT(this.a)},O(Tn,"ETypeParameterImpl/2/1",556),M(557,1,ga,iF),l.Nb=function(t){La(this,t)},l.Pb=function(){return u($v(this.a).cd(),87)},l.Ob=function(){return this.a.b},l.Qb=function(){wJe(this.a)},O(Tn,"ETypeParameterImpl/2/1/1",557),M(1276,43,y4,IHe),l._b=function(t){return fa(t)?rre(this,t):!!$o(this.f,t)},l.xc=function(t){var n,r;return n=fa(t)?Uc(this,t):hc($o(this.f,t)),we(n,837)?(r=u(n,837),n=r._j(),Si(this,u(t,235),n),n):n??(t==null?(hte(),w4t):null)},O(Tn,"EValidatorRegistryImpl",1276),M(1313,704,{105:1,92:1,90:1,471:1,147:1,56:1,108:1,1941:1,49:1,97:1,150:1,114:1,115:1},KZ),l.Ih=function(t,n){switch(t.yj()){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 n==null?null:Qo(n);case 25:return cin(n);case 27:return _rn(n);case 28:return Crn(n);case 29:return n==null?null:PVe(WS[0],u(n,199));case 41:return n==null?"":Cp(u(n,290));case 42:return Qo(n);case 50:return Hr(n);default:throw J(new Ln($7+t.ne()+dw))}},l.Jh=function(t){var n,r,s,o,h,d,v,x,_,L,P,z,q,W,X,le;switch(t.G==-1&&(t.G=(z=Gl(t),z?Dg(z.Mh(),t):-1)),t.G){case 0:return r=new Vee,r;case 1:return n=new KB,n;case 2:return s=new YL,s;case 4:return o=new sF,o;case 5:return h=new DHe,h;case 6:return d=new tHe,d;case 7:return v=new RR,v;case 10:return _=new Ex,_;case 11:return L=new Uee,L;case 12:return P=new rXe,P;case 13:return q=new Wee,q;case 14:return W=new Cbe,W;case 17:return X=new UZ,X;case 18:return x=new uv,x;case 19:return le=new RL,le;default:throw J(new Ln(Pce+t.zb+dw))}},l.Kh=function(t,n){switch(t.yj()){case 20:return n==null?null:new Vpe(n);case 21:return n==null?null:new Ip(n);case 23:case 22:return n==null?null:dcn(n);case 26:case 24:return n==null?null:xD(Wl(n,-128,127)<<24>>24);case 25:return T0n(n);case 27:return Xun(n);case 28:return Qun(n);case 29:return mfn(n);case 32:case 31:return n==null?null:ry(n);case 38:case 37:return n==null?null:new hpe(n);case 40:case 39:return n==null?null:ct(Wl(n,$a,Ei));case 41:return null;case 42:return n==null,null;case 44:case 43:return n==null?null:lb(xz(n));case 49:case 48:return n==null?null:Z8(Wl(n,_G,32767)<<16>>16);case 50:return n;default:throw J(new Ln($7+t.ne()+dw))}},O(Tn,"EcoreFactoryImpl",1313),M(547,179,{105:1,92:1,90:1,147:1,191:1,56:1,235:1,108:1,1939:1,49:1,97:1,150:1,179:1,547:1,114:1,115:1,675:1},yYe),l.gb=!1,l.hb=!1;var WAe,v4t=!1;O(Tn,"EcorePackageImpl",547),M(1184,1,{837:1},YZ),l._j=function(){return sUe(),m4t},O(Tn,"EcorePackageImpl/1",1184),M(1193,1,li,XZ),l.wj=function(t){return we(t,147)},l.xj=function(t){return Me(aN,yt,147,t,0,1)},O(Tn,"EcorePackageImpl/10",1193),M(1194,1,li,QZ),l.wj=function(t){return we(t,191)},l.xj=function(t){return Me(bfe,yt,191,t,0,1)},O(Tn,"EcorePackageImpl/11",1194),M(1195,1,li,ZZ),l.wj=function(t){return we(t,56)},l.xj=function(t){return Me(y2,yt,56,t,0,1)},O(Tn,"EcorePackageImpl/12",1195),M(1196,1,li,JZ),l.wj=function(t){return we(t,399)},l.xj=function(t){return Me(nf,v8e,59,t,0,1)},O(Tn,"EcorePackageImpl/13",1196),M(1197,1,li,eJ),l.wj=function(t){return we(t,235)},l.xj=function(t){return Me(h1,yt,235,t,0,1)},O(Tn,"EcorePackageImpl/14",1197),M(1198,1,li,tJ),l.wj=function(t){return we(t,509)},l.xj=function(t){return Me(Iw,yt,2017,t,0,1)},O(Tn,"EcorePackageImpl/15",1198),M(1199,1,li,tR),l.wj=function(t){return we(t,99)},l.xj=function(t){return Me(Uy,L4,18,t,0,1)},O(Tn,"EcorePackageImpl/16",1199),M(1200,1,li,nJ),l.wj=function(t){return we(t,170)},l.xj=function(t){return Me(ju,L4,170,t,0,1)},O(Tn,"EcorePackageImpl/17",1200),M(1201,1,li,rJ),l.wj=function(t){return we(t,472)},l.xj=function(t){return Me(qy,yt,472,t,0,1)},O(Tn,"EcorePackageImpl/18",1201),M(1202,1,li,iJ),l.wj=function(t){return we(t,548)},l.xj=function(t){return Me(wc,wdt,548,t,0,1)},O(Tn,"EcorePackageImpl/19",1202),M(1185,1,li,nR),l.wj=function(t){return we(t,322)},l.xj=function(t){return Me(Vy,L4,34,t,0,1)},O(Tn,"EcorePackageImpl/2",1185),M(1203,1,li,Ax),l.wj=function(t){return we(t,241)},l.xj=function(t){return Me(Eo,Pdt,87,t,0,1)},O(Tn,"EcorePackageImpl/20",1203),M(1204,1,li,z9),l.wj=function(t){return we(t,444)},l.xj=function(t){return Me(mu,yt,836,t,0,1)},O(Tn,"EcorePackageImpl/21",1204),M(1205,1,li,rR),l.wj=function(t){return Cm(t)},l.xj=function(t){return Me(Us,Qe,476,t,8,1)},O(Tn,"EcorePackageImpl/22",1205),M(1206,1,li,sJ),l.wj=function(t){return we(t,190)},l.xj=function(t){return Me(el,Qe,190,t,0,2)},O(Tn,"EcorePackageImpl/23",1206),M(1207,1,li,iR),l.wj=function(t){return we(t,217)},l.xj=function(t){return Me(mk,Qe,217,t,0,1)},O(Tn,"EcorePackageImpl/24",1207),M(1208,1,li,sR),l.wj=function(t){return we(t,172)},l.xj=function(t){return Me(XC,Qe,172,t,0,1)},O(Tn,"EcorePackageImpl/25",1208),M(1209,1,li,aJ),l.wj=function(t){return we(t,199)},l.xj=function(t){return Me(FG,Qe,199,t,0,1)},O(Tn,"EcorePackageImpl/26",1209),M(1210,1,li,G9),l.wj=function(t){return!1},l.xj=function(t){return Me(hLe,yt,2110,t,0,1)},O(Tn,"EcorePackageImpl/27",1210),M(1211,1,li,pm),l.wj=function(t){return Sm(t)},l.xj=function(t){return Me(ma,Qe,333,t,7,1)},O(Tn,"EcorePackageImpl/28",1211),M(1212,1,li,aR),l.wj=function(t){return we(t,58)},l.xj=function(t){return Me(CAe,gy,58,t,0,1)},O(Tn,"EcorePackageImpl/29",1212),M(1186,1,li,oR),l.wj=function(t){return we(t,510)},l.xj=function(t){return Me(ti,{3:1,4:1,5:1,1934:1},590,t,0,1)},O(Tn,"EcorePackageImpl/3",1186),M(1213,1,li,oJ),l.wj=function(t){return we(t,573)},l.xj=function(t){return Me(LAe,yt,1940,t,0,1)},O(Tn,"EcorePackageImpl/30",1213),M(1214,1,li,cJ),l.wj=function(t){return we(t,153)},l.xj=function(t){return Me(ZAe,gy,153,t,0,1)},O(Tn,"EcorePackageImpl/31",1214),M(1215,1,li,q9),l.wj=function(t){return we(t,72)},l.xj=function(t){return Me(eU,qdt,72,t,0,1)},O(Tn,"EcorePackageImpl/32",1215),M(1216,1,li,cR),l.wj=function(t){return we(t,155)},l.xj=function(t){return Me(W7,Qe,155,t,0,1)},O(Tn,"EcorePackageImpl/33",1216),M(1217,1,li,uR),l.wj=function(t){return we(t,19)},l.xj=function(t){return Me(Za,Qe,19,t,0,1)},O(Tn,"EcorePackageImpl/34",1217),M(1218,1,li,kc),l.wj=function(t){return we(t,290)},l.xj=function(t){return Me(M8e,yt,290,t,0,1)},O(Tn,"EcorePackageImpl/35",1218),M(1219,1,li,uJ),l.wj=function(t){return we(t,162)},l.xj=function(t){return Me(pw,Qe,162,t,0,1)},O(Tn,"EcorePackageImpl/36",1219),M(1220,1,li,lR),l.wj=function(t){return we(t,83)},l.xj=function(t){return Me(D8e,yt,83,t,0,1)},O(Tn,"EcorePackageImpl/37",1220),M(1221,1,li,V9),l.wj=function(t){return we(t,591)},l.xj=function(t){return Me(KAe,yt,591,t,0,1)},O(Tn,"EcorePackageImpl/38",1221),M(1222,1,li,lJ),l.wj=function(t){return!1},l.xj=function(t){return Me(fLe,yt,2111,t,0,1)},O(Tn,"EcorePackageImpl/39",1222),M(1187,1,li,hJ),l.wj=function(t){return we(t,88)},l.xj=function(t){return Me(tf,yt,26,t,0,1)},O(Tn,"EcorePackageImpl/4",1187),M(1223,1,li,U9),l.wj=function(t){return we(t,184)},l.xj=function(t){return Me(bw,Qe,184,t,0,1)},O(Tn,"EcorePackageImpl/40",1223),M(1224,1,li,hR),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(Tn,"EcorePackageImpl/41",1224),M(1225,1,li,W9),l.wj=function(t){return we(t,588)},l.xj=function(t){return Me(AAe,yt,588,t,0,1)},O(Tn,"EcorePackageImpl/42",1225),M(1226,1,li,K9),l.wj=function(t){return!1},l.xj=function(t){return Me(dLe,Qe,2112,t,0,1)},O(Tn,"EcorePackageImpl/43",1226),M(1227,1,li,Uf),l.wj=function(t){return we(t,42)},l.xj=function(t){return Me(Cb,Sz,42,t,0,1)},O(Tn,"EcorePackageImpl/44",1227),M(1188,1,li,FL),l.wj=function(t){return we(t,138)},l.xj=function(t){return Me(f1,yt,138,t,0,1)},O(Tn,"EcorePackageImpl/5",1188),M(1189,1,li,jL),l.wj=function(t){return we(t,148)},l.xj=function(t){return Me(xfe,yt,148,t,0,1)},O(Tn,"EcorePackageImpl/6",1189),M(1190,1,li,J5),l.wj=function(t){return we(t,457)},l.xj=function(t){return Me(JV,yt,671,t,0,1)},O(Tn,"EcorePackageImpl/7",1190),M(1191,1,li,fJ),l.wj=function(t){return we(t,573)},l.xj=function(t){return Me(J0,yt,678,t,0,1)},O(Tn,"EcorePackageImpl/8",1191),M(1192,1,li,dJ),l.wj=function(t){return we(t,471)},l.xj=function(t){return Me(US,yt,471,t,0,1)},O(Tn,"EcorePackageImpl/9",1192),M(1025,1982,vdt,XHe),l.bi=function(t,n){jan(this,u(n,415))},l.fi=function(t,n){fat(this,t,u(n,415))},O(Tn,"MinimalEObjectImpl/1ArrayDelegatingAdapterList",1025),M(1026,143,XI,hYe),l.Ai=function(){return this.a.a},O(Tn,"MinimalEObjectImpl/1ArrayDelegatingAdapterList/1",1026),M(1053,1052,{},SVe),O("org.eclipse.emf.ecore.plugin","EcorePlugin",1053);var KAe=ss(Vdt,"Resource");M(781,1378,Udt),l.Yk=function(t){},l.Zk=function(t){},l.Vk=function(){return!this.a&&(this.a=new $ee(this)),this.a},l.Wk=function(t){var n,r,s,o,h;if(s=t.length,s>0)if(zr(0,t.length),t.charCodeAt(0)==47){for(h=new su(4),o=1,n=1;n0&&(t=t.substr(0,r)));return odn(this,t)},l.Xk=function(){return this.c},l.Ib=function(){var t;return Cp(this.gm)+"@"+(t=Xi(this)>>>0,t.toString(16))+" uri='"+this.d+"'"},l.b=!1,O(Zce,"ResourceImpl",781),M(1379,781,Udt,q$e),O(Zce,"BinaryResourceImpl",1379),M(1169,694,Uce),l.si=function(t){return we(t,56)?zJt(this,u(t,56)):we(t,591)?new rr(u(t,591).Vk()):je(t)===je(this.f)?u(t,14).Kc():(u8(),uN.a)},l.Ob=function(){return z4e(this)},l.a=!1,O(Wi,"EcoreUtil/ContentTreeIterator",1169),M(1380,1169,Uce,zKe),l.si=function(t){return je(t)===je(this.f)?u(t,15).Kc():new _Qe(u(t,56))},O(Zce,"ResourceImpl/5",1380),M(648,1994,Ndt,$ee),l.Hc=function(t){return this.i<=4?u7(this,t):we(t,49)&&u(t,49).Zg()==this.a},l.bi=function(t,n){t==this.i-1&&(this.a.b||(this.a.b=!0))},l.di=function(t,n){t==0?this.a.b||(this.a.b=!0):Nre(this,t,n)},l.fi=function(t,n){},l.gi=function(t,n,r){},l.aj=function(){return 2},l.Ai=function(){return this.a},l.bj=function(){return!0},l.cj=function(t,n){var r;return r=u(t,49),n=r.wh(this.a,n),n},l.dj=function(t,n){var r;return r=u(t,49),r.wh(null,n)},l.ej=function(){return!1},l.hi=function(){return!0},l.ri=function(t){return Me(y2,yt,56,t,0,1)},l.ni=function(){return!1},O(Zce,"ResourceImpl/ContentsEList",648),M(957,1964,A7,G$e),l.Zc=function(t){return this.a._h(t)},l.gc=function(){return this.a.gc()},O(Wi,"AbstractSequentialInternalEList/1",957);var YAe,XAe,Oa,QAe;M(624,1,{},qWe);var tU,nU;O(Wi,"BasicExtendedMetaData",624),M(1160,1,{},qqe),l.$k=function(){return null},l._k=function(){return this.a==-2&&fg(this,gfn(this.d,this.b)),this.a},l.al=function(){return null},l.bl=function(){return hn(),hn(),bo},l.ne=function(){return this.c==G7&&_3(this,Grt(this.d,this.b)),this.c},l.cl=function(){return 0},l.a=-2,l.c=G7,O(Wi,"BasicExtendedMetaData/EClassExtendedMetaDataImpl",1160),M(1161,1,{},hQe),l.$k=function(){return this.a==(C8(),tU)&&Qge(this,Mgn(this.f,this.b)),this.a},l._k=function(){return 0},l.al=function(){return this.c==(C8(),tU)&&Eee(this,Dgn(this.f,this.b)),this.c},l.bl=function(){return!this.d&&Tee(this,M2n(this.f,this.b)),this.d},l.ne=function(){return this.e==G7&&UR(this,Grt(this.f,this.b)),this.e},l.cl=function(){return this.g==-2&&WR(this,Ohn(this.f,this.b)),this.g},l.e=G7,l.g=-2,O(Wi,"BasicExtendedMetaData/EDataTypeExtendedMetaDataImpl",1161),M(1159,1,{},Uqe),l.b=!1,l.c=!1,O(Wi,"BasicExtendedMetaData/EPackageExtendedMetaDataImpl",1159),M(1162,1,{},lQe),l.c=-2,l.e=G7,l.f=G7,O(Wi,"BasicExtendedMetaData/EStructuralFeatureExtendedMetaDataImpl",1162),M(585,622,Zo,xj),l.aj=function(){return this.c},l.Fk=function(){return!1},l.li=function(t,n){return n},l.c=0,O(Wi,"EDataTypeEList",585);var ZAe=ss(Wi,"FeatureMap");M(75,585,{3:1,4:1,20:1,28:1,52:1,14:1,15:1,54:1,67:1,63:1,58:1,76:1,153:1,215:1,1937:1,69:1,95:1},ds),l.Vc=function(t,n){Cgn(this,t,u(n,72))},l.Fc=function(t){return V0n(this,u(t,72))},l.Yh=function(t){DZt(this,u(t,72))},l.cj=function(t,n){return hYt(this,u(t,72),n)},l.dj=function(t,n){return Ybe(this,u(t,72),n)},l.ii=function(t,n){return K2n(this,t,n)},l.li=function(t,n){return Swn(this,t,u(n,72))},l._c=function(t,n){return bpn(this,t,u(n,72))},l.jj=function(t,n){return fYt(this,u(t,72),n)},l.kj=function(t,n){return pWe(this,u(t,72),n)},l.lj=function(t,n,r){return bhn(this,u(t,72),u(n,72),r)},l.oi=function(t,n){return Tse(this,t,u(n,72))},l.dl=function(t,n){return M5e(this,t,n)},l.Wc=function(t,n){var r,s,o,h,d,v,x,_,L;for(_=new jv(n.gc()),o=n.Kc();o.Ob();)if(s=u(o.Pb(),72),h=s.ak(),G0(this.e,h))(!h.hi()||!v$(this,h,s.dd())&&!u7(_,s))&&Br(_,s);else{for(L=pu(this.e.Tg(),h),r=u(this.g,119),d=!0,v=0;v=0;)if(n=t[this.c],this.k.rl(n.ak()))return this.j=this.f?n:n.dd(),this.i=-2,!0;return this.i=-1,this.g=-1,!1},O(Wi,"BasicFeatureMap/FeatureEIterator",410),M(662,410,r0,Gte),l.Lk=function(){return!0},O(Wi,"BasicFeatureMap/ResolvingFeatureEIterator",662),M(955,486,yG,RVe),l.Gi=function(){return this},O(Wi,"EContentsEList/1",955),M(956,486,yG,cVe),l.Lk=function(){return!1},O(Wi,"EContentsEList/2",956),M(954,279,kG,FVe),l.Nk=function(t){},l.Ob=function(){return!1},l.Sb=function(){return!1},O(Wi,"EContentsEList/FeatureIteratorImpl/1",954),M(825,585,Zo,ebe),l.ci=function(){this.a=!0},l.fj=function(){return this.a},l.Xj=function(){var t;_r(this),Ll(this.e)?(t=this.a,this.a=!1,_i(this.e,new xf(this.e,2,this.c,t,!1))):this.a=!1},l.a=!1,O(Wi,"EDataTypeEList/Unsettable",825),M(1849,585,Zo,UVe),l.hi=function(){return!0},O(Wi,"EDataTypeUniqueEList",1849),M(1850,825,Zo,WVe),l.hi=function(){return!0},O(Wi,"EDataTypeUniqueEList/Unsettable",1850),M(139,85,Zo,qu),l.Ek=function(){return!0},l.li=function(t,n){return rk(this,t,u(n,56))},O(Wi,"EObjectContainmentEList/Resolving",139),M(1163,545,Zo,VVe),l.Ek=function(){return!0},l.li=function(t,n){return rk(this,t,u(n,56))},O(Wi,"EObjectContainmentEList/Unsettable/Resolving",1163),M(748,16,Zo,zbe),l.ci=function(){this.a=!0},l.fj=function(){return this.a},l.Xj=function(){var t;_r(this),Ll(this.e)?(t=this.a,this.a=!1,_i(this.e,new xf(this.e,2,this.c,t,!1))):this.a=!1},l.a=!1,O(Wi,"EObjectContainmentWithInverseEList/Unsettable",748),M(1173,748,Zo,nWe),l.Ek=function(){return!0},l.li=function(t,n){return rk(this,t,u(n,56))},O(Wi,"EObjectContainmentWithInverseEList/Unsettable/Resolving",1173),M(743,496,Zo,J2e),l.ci=function(){this.a=!0},l.fj=function(){return this.a},l.Xj=function(){var t;_r(this),Ll(this.e)?(t=this.a,this.a=!1,_i(this.e,new xf(this.e,2,this.c,t,!1))):this.a=!1},l.a=!1,O(Wi,"EObjectEList/Unsettable",743),M(328,496,Zo,$3),l.Ek=function(){return!0},l.li=function(t,n){return rk(this,t,u(n,56))},O(Wi,"EObjectResolvingEList",328),M(1641,743,Zo,KVe),l.Ek=function(){return!0},l.li=function(t,n){return rk(this,t,u(n,56))},O(Wi,"EObjectResolvingEList/Unsettable",1641),M(1381,1,{},gJ);var w4t;O(Wi,"EObjectValidator",1381),M(546,496,Zo,Hj),l.zk=function(){return this.d},l.Ak=function(){return this.b},l.bj=function(){return!0},l.Dk=function(){return!0},l.b=0,O(Wi,"EObjectWithInverseEList",546),M(1176,546,Zo,rWe),l.Ck=function(){return!0},O(Wi,"EObjectWithInverseEList/ManyInverse",1176),M(625,546,Zo,une),l.ci=function(){this.a=!0},l.fj=function(){return this.a},l.Xj=function(){var t;_r(this),Ll(this.e)?(t=this.a,this.a=!1,_i(this.e,new xf(this.e,2,this.c,t,!1))):this.a=!1},l.a=!1,O(Wi,"EObjectWithInverseEList/Unsettable",625),M(1175,625,Zo,iWe),l.Ck=function(){return!0},O(Wi,"EObjectWithInverseEList/Unsettable/ManyInverse",1175),M(749,546,Zo,Gbe),l.Ek=function(){return!0},l.li=function(t,n){return rk(this,t,u(n,56))},O(Wi,"EObjectWithInverseResolvingEList",749),M(31,749,Zo,wn),l.Ck=function(){return!0},O(Wi,"EObjectWithInverseResolvingEList/ManyInverse",31),M(750,625,Zo,qbe),l.Ek=function(){return!0},l.li=function(t,n){return rk(this,t,u(n,56))},O(Wi,"EObjectWithInverseResolvingEList/Unsettable",750),M(1174,750,Zo,sWe),l.Ck=function(){return!0},O(Wi,"EObjectWithInverseResolvingEList/Unsettable/ManyInverse",1174),M(1164,622,Zo),l.ai=function(){return(this.b&1792)==0},l.ci=function(){this.b|=1},l.Bk=function(){return(this.b&4)!=0},l.bj=function(){return(this.b&40)!=0},l.Ck=function(){return(this.b&16)!=0},l.Dk=function(){return(this.b&8)!=0},l.Ek=function(){return(this.b&ky)!=0},l.rk=function(){return(this.b&32)!=0},l.Fk=function(){return(this.b&Sf)!=0},l.wj=function(t){return this.d?$Qe(this.d,t):this.ak().Yj().wj(t)},l.fj=function(){return this.b&2?(this.b&1)!=0:this.i!=0},l.hi=function(){return(this.b&128)!=0},l.Xj=function(){var t;_r(this),this.b&2&&(Ll(this.e)?(t=(this.b&1)!=0,this.b&=-2,Vx(this,new xf(this.e,2,Ji(this.e.Tg(),this.ak()),t,!1))):this.b&=-2)},l.ni=function(){return(this.b&1536)==0},l.b=0,O(Wi,"EcoreEList/Generic",1164),M(1165,1164,Zo,YYe),l.ak=function(){return this.a},O(Wi,"EcoreEList/Dynamic",1165),M(747,63,Od,rpe),l.ri=function(t){return TD(this.a.a,t)},O(Wi,"EcoreEMap/1",747),M(746,85,Zo,zve),l.bi=function(t,n){RH(this.b,u(n,133))},l.di=function(t,n){Rtt(this.b)},l.ei=function(t,n,r){var s;++(s=this.b,u(n,133),s).e},l.fi=function(t,n){Oie(this.b,u(n,133))},l.gi=function(t,n,r){Oie(this.b,u(r,133)),je(r)===je(n)&&u(r,133).Th(yWt(u(n,133).cd())),RH(this.b,u(n,133))},O(Wi,"EcoreEMap/DelegateEObjectContainmentEList",746),M(1171,151,b8e,Xet),O(Wi,"EcoreEMap/Unsettable",1171),M(1172,746,Zo,aWe),l.ci=function(){this.a=!0},l.fj=function(){return this.a},l.Xj=function(){var t;_r(this),Ll(this.e)?(t=this.a,this.a=!1,_i(this.e,new xf(this.e,2,this.c,t,!1))):this.a=!1},l.a=!1,O(Wi,"EcoreEMap/Unsettable/UnsettableDelegateEObjectContainmentEList",1172),M(1168,228,y4,ZKe),l.a=!1,l.b=!1,O(Wi,"EcoreUtil/Copier",1168),M(745,1,ga,_Qe),l.Nb=function(t){La(this,t)},l.Ob=function(){return Ert(this)},l.Pb=function(){var t;return Ert(this),t=this.b,this.b=null,t},l.Qb=function(){this.a.Qb()},O(Wi,"EcoreUtil/ProperContentIterator",745),M(1382,1381,{},FR);var m4t;O(Wi,"EcoreValidator",1382);var y4t;ss(Wi,"FeatureMapUtil/Validator"),M(1260,1,{1942:1},pJ),l.rl=function(t){return!0},O(Wi,"FeatureMapUtil/1",1260),M(757,1,{1942:1},s6e),l.rl=function(t){var n;return this.c==t?!0:(n=Mt(er(this.a,t)),n==null?h2n(this,t)?(OZe(this.a,t,(Mn(),U7)),!0):(OZe(this.a,t,(Mn(),Sb)),!1):n==(Mn(),U7))},l.e=!1;var Cfe;O(Wi,"FeatureMapUtil/BasicValidator",757),M(758,43,y4,Y2e),O(Wi,"FeatureMapUtil/BasicValidator/Cache",758),M(501,52,{20:1,28:1,52:1,14:1,15:1,58:1,76:1,69:1,95:1},DM),l.Vc=function(t,n){Zot(this.c,this.b,t,n)},l.Fc=function(t){return M5e(this.c,this.b,t)},l.Wc=function(t,n){return Cvn(this.c,this.b,t,n)},l.Gc=function(t){return t_(this,t)},l.Xh=function(t,n){Wrn(this.c,this.b,t,n)},l.lk=function(t,n){return T5e(this.c,this.b,t,n)},l.pi=function(t){return bz(this.c,this.b,t,!1)},l.Zh=function(){return mVe(this.c,this.b)},l.$h=function(){return oWt(this.c,this.b)},l._h=function(t){return Znn(this.c,this.b,t)},l.mk=function(t,n){return FUe(this,t,n)},l.$b=function(){d6(this)},l.Hc=function(t){return v$(this.c,this.b,t)},l.Ic=function(t){return Qin(this.c,this.b,t)},l.Xb=function(t){return bz(this.c,this.b,t,!0)},l.Wj=function(t){return this},l.Xc=function(t){return unn(this.c,this.b,t)},l.dc=function(){return YF(this)},l.fj=function(){return!qD(this.c,this.b)},l.Kc=function(){return Prn(this.c,this.b)},l.Yc=function(){return Brn(this.c,this.b)},l.Zc=function(t){return Kan(this.c,this.b,t)},l.ii=function(t,n){return but(this.c,this.b,t,n)},l.ji=function(t,n){Unn(this.c,this.b,t,n)},l.$c=function(t){return Yst(this.c,this.b,t)},l.Mc=function(t){return I2n(this.c,this.b,t)},l._c=function(t,n){return xut(this.c,this.b,t,n)},l.Wb=function(t){JH(this.c,this.b),t_(this,u(t,15))},l.gc=function(){return oon(this.c,this.b)},l.Pc=function(){return atn(this.c,this.b)},l.Qc=function(t){return lnn(this.c,this.b,t)},l.Ib=function(){var t,n;for(n=new bg,n.a+="[",t=mVe(this.c,this.b);Eie(t);)To(n,r_(PH(t))),Eie(t)&&(n.a+=io);return n.a+="]",n.a},l.Xj=function(){JH(this.c,this.b)},O(Wi,"FeatureMapUtil/FeatureEList",501),M(627,36,XI,_re),l.yi=function(t){return z_(this,t)},l.Di=function(t){var n,r,s,o,h,d,v;switch(this.d){case 1:case 2:{if(h=t.Ai(),je(h)===je(this.c)&&z_(this,null)==t.yi(null))return this.g=t.zi(),t.xi()==1&&(this.d=1),!0;break}case 3:{switch(o=t.xi(),o){case 3:{if(h=t.Ai(),je(h)===je(this.c)&&z_(this,null)==t.yi(null))return this.d=5,n=new jv(2),Br(n,this.g),Br(n,t.zi()),this.g=n,!0;break}}break}case 5:{switch(o=t.xi(),o){case 3:{if(h=t.Ai(),je(h)===je(this.c)&&z_(this,null)==t.yi(null))return r=u(this.g,14),r.Fc(t.zi()),!0;break}}break}case 4:{switch(o=t.xi(),o){case 3:{if(h=t.Ai(),je(h)===je(this.c)&&z_(this,null)==t.yi(null))return this.d=1,this.g=t.zi(),!0;break}case 4:{if(h=t.Ai(),je(h)===je(this.c)&&z_(this,null)==t.yi(null))return this.d=6,v=new jv(2),Br(v,this.n),Br(v,t.Bi()),this.n=v,d=ie(re(Lr,1),Jr,25,15,[this.o,t.Ci()]),this.g=d,!0;break}}break}case 6:{switch(o=t.xi(),o){case 4:{if(h=t.Ai(),je(h)===je(this.c)&&z_(this,null)==t.yi(null))return r=u(this.n,14),r.Fc(t.Bi()),d=u(this.g,48),s=Me(Lr,Jr,25,d.length+1,15,1),Hc(d,0,s,0,d.length),s[d.length]=t.Ci(),this.g=s,!0;break}}break}}return!1},O(Wi,"FeatureMapUtil/FeatureENotificationImpl",627),M(552,501,{20:1,28:1,52:1,14:1,15:1,58:1,76:1,153:1,215:1,1937:1,69:1,95:1},Cj),l.dl=function(t,n){return M5e(this.c,t,n)},l.el=function(t,n,r){return T5e(this.c,t,n,r)},l.fl=function(t,n,r){return W5e(this.c,t,n,r)},l.gl=function(){return this},l.hl=function(t,n){return kI(this.c,t,n)},l.il=function(t){return u(bz(this.c,this.b,t,!1),72).ak()},l.jl=function(t){return u(bz(this.c,this.b,t,!1),72).dd()},l.kl=function(){return this.a},l.ll=function(t){return!qD(this.c,t)},l.ml=function(t,n){vz(this.c,t,n)},l.nl=function(t){return rtt(this.c,t)},l.ol=function(t){Sit(this.c,t)},O(Wi,"FeatureMapUtil/FeatureFeatureMap",552),M(1259,1,Qce,Wqe),l.Wj=function(t){return bz(this.b,this.a,-1,t)},l.fj=function(){return!qD(this.b,this.a)},l.Wb=function(t){vz(this.b,this.a,t)},l.Xj=function(){JH(this.b,this.a)},O(Wi,"FeatureMapUtil/FeatureValue",1259);var zk,Sfe,Afe,Gk,k4t,hN=ss(LG,"AnyType");M(666,60,q0,nte),O(LG,"InvalidDatatypeValueException",666);var rU=ss(LG,Kdt),fN=ss(LG,Ydt),JAe=ss(LG,Xdt),x4t,Sc,eLe,zb,E4t,T4t,_4t,C4t,S4t,A4t,L4t,M4t,D4t,I4t,O4t,r5,N4t,i5,QS,P4t,Pw,dN,gN,B4t,ZS,JS;M(830,506,{105:1,92:1,90:1,56:1,49:1,97:1,843:1},Tpe),l._g=function(t,n,r){switch(t){case 0:return r?(!this.c&&(this.c=new ds(this,0)),this.c):(!this.c&&(this.c=new ds(this,0)),this.c.b);case 1:return r?(!this.c&&(this.c=new ds(this,0)),u(Wc(this.c,(Fi(),zb)),153)):(!this.c&&(this.c=new ds(this,0)),u(u(Wc(this.c,(Fi(),zb)),153),215)).kl();case 2:return r?(!this.b&&(this.b=new ds(this,2)),this.b):(!this.b&&(this.b=new ds(this,2)),this.b.b)}return ph(this,t-Jn(this.zh()),gn(this.j&2?(!this.k&&(this.k=new ch),this.k).ck():this.zh(),t),n,r)},l.jh=function(t,n,r){var s;switch(n){case 0:return!this.c&&(this.c=new ds(this,0)),vI(this.c,t,r);case 1:return(!this.c&&(this.c=new ds(this,0)),u(u(Wc(this.c,(Fi(),zb)),153),69)).mk(t,r);case 2:return!this.b&&(this.b=new ds(this,2)),vI(this.b,t,r)}return s=u(gn(this.j&2?(!this.k&&(this.k=new ch),this.k).ck():this.zh(),n),66),s.Nj().Rj(this,vme(this),n-Jn(this.zh()),t,r)},l.lh=function(t){switch(t){case 0:return!!this.c&&this.c.i!=0;case 1:return!(!this.c&&(this.c=new ds(this,0)),u(Wc(this.c,(Fi(),zb)),153)).dc();case 2:return!!this.b&&this.b.i!=0}return dh(this,t-Jn(this.zh()),gn(this.j&2?(!this.k&&(this.k=new ch),this.k).ck():this.zh(),t))},l.sh=function(t,n){switch(t){case 0:!this.c&&(this.c=new ds(this,0)),XM(this.c,n);return;case 1:(!this.c&&(this.c=new ds(this,0)),u(u(Wc(this.c,(Fi(),zb)),153),215)).Wb(n);return;case 2:!this.b&&(this.b=new ds(this,2)),XM(this.b,n);return}yh(this,t-Jn(this.zh()),gn(this.j&2?(!this.k&&(this.k=new ch),this.k).ck():this.zh(),t),n)},l.zh=function(){return Fi(),eLe},l.Bh=function(t){switch(t){case 0:!this.c&&(this.c=new ds(this,0)),_r(this.c);return;case 1:(!this.c&&(this.c=new ds(this,0)),u(Wc(this.c,(Fi(),zb)),153)).$b();return;case 2:!this.b&&(this.b=new ds(this,2)),_r(this.b);return}wh(this,t-Jn(this.zh()),gn(this.j&2?(!this.k&&(this.k=new ch),this.k).ck():this.zh(),t))},l.Ib=function(){var t;return this.j&4?_f(this):(t=new Ph(_f(this)),t.a+=" (mixed: ",QT(t,this.c),t.a+=", anyAttribute: ",QT(t,this.b),t.a+=")",t.a)},O(As,"AnyTypeImpl",830),M(667,506,{105:1,92:1,90:1,56:1,49:1,97:1,2021:1,667:1},fR),l._g=function(t,n,r){switch(t){case 0:return this.a;case 1:return this.b}return ph(this,t-Jn((Fi(),r5)),gn(this.j&2?(!this.k&&(this.k=new ch),this.k).ck():r5,t),n,r)},l.lh=function(t){switch(t){case 0:return this.a!=null;case 1:return this.b!=null}return dh(this,t-Jn((Fi(),r5)),gn(this.j&2?(!this.k&&(this.k=new ch),this.k).ck():r5,t))},l.sh=function(t,n){switch(t){case 0:Aee(this,Hr(n));return;case 1:Jge(this,Hr(n));return}yh(this,t-Jn((Fi(),r5)),gn(this.j&2?(!this.k&&(this.k=new ch),this.k).ck():r5,t),n)},l.zh=function(){return Fi(),r5},l.Bh=function(t){switch(t){case 0:this.a=null;return;case 1:this.b=null;return}wh(this,t-Jn((Fi(),r5)),gn(this.j&2?(!this.k&&(this.k=new ch),this.k).ck():r5,t))},l.Ib=function(){var t;return this.j&4?_f(this):(t=new Ph(_f(this)),t.a+=" (data: ",To(t,this.a),t.a+=", target: ",To(t,this.b),t.a+=")",t.a)},l.a=null,l.b=null,O(As,"ProcessingInstructionImpl",667),M(668,830,{105:1,92:1,90:1,56:1,49:1,97:1,843:1,2022:1,668:1},NHe),l._g=function(t,n,r){switch(t){case 0:return r?(!this.c&&(this.c=new ds(this,0)),this.c):(!this.c&&(this.c=new ds(this,0)),this.c.b);case 1:return r?(!this.c&&(this.c=new ds(this,0)),u(Wc(this.c,(Fi(),zb)),153)):(!this.c&&(this.c=new ds(this,0)),u(u(Wc(this.c,(Fi(),zb)),153),215)).kl();case 2:return r?(!this.b&&(this.b=new ds(this,2)),this.b):(!this.b&&(this.b=new ds(this,2)),this.b.b);case 3:return!this.c&&(this.c=new ds(this,0)),Hr(kI(this.c,(Fi(),QS),!0));case 4:return Vbe(this.a,(!this.c&&(this.c=new ds(this,0)),Hr(kI(this.c,(Fi(),QS),!0))));case 5:return this.a}return ph(this,t-Jn((Fi(),i5)),gn(this.j&2?(!this.k&&(this.k=new ch),this.k).ck():i5,t),n,r)},l.lh=function(t){switch(t){case 0:return!!this.c&&this.c.i!=0;case 1:return!(!this.c&&(this.c=new ds(this,0)),u(Wc(this.c,(Fi(),zb)),153)).dc();case 2:return!!this.b&&this.b.i!=0;case 3:return!this.c&&(this.c=new ds(this,0)),Hr(kI(this.c,(Fi(),QS),!0))!=null;case 4:return Vbe(this.a,(!this.c&&(this.c=new ds(this,0)),Hr(kI(this.c,(Fi(),QS),!0))))!=null;case 5:return!!this.a}return dh(this,t-Jn((Fi(),i5)),gn(this.j&2?(!this.k&&(this.k=new ch),this.k).ck():i5,t))},l.sh=function(t,n){switch(t){case 0:!this.c&&(this.c=new ds(this,0)),XM(this.c,n);return;case 1:(!this.c&&(this.c=new ds(this,0)),u(u(Wc(this.c,(Fi(),zb)),153),215)).Wb(n);return;case 2:!this.b&&(this.b=new ds(this,2)),XM(this.b,n);return;case 3:Mwe(this,Hr(n));return;case 4:Mwe(this,Ube(this.a,n));return;case 5:Ac(this,u(n,148));return}yh(this,t-Jn((Fi(),i5)),gn(this.j&2?(!this.k&&(this.k=new ch),this.k).ck():i5,t),n)},l.zh=function(){return Fi(),i5},l.Bh=function(t){switch(t){case 0:!this.c&&(this.c=new ds(this,0)),_r(this.c);return;case 1:(!this.c&&(this.c=new ds(this,0)),u(Wc(this.c,(Fi(),zb)),153)).$b();return;case 2:!this.b&&(this.b=new ds(this,2)),_r(this.b);return;case 3:!this.c&&(this.c=new ds(this,0)),vz(this.c,(Fi(),QS),null);return;case 4:Mwe(this,Ube(this.a,null));return;case 5:this.a=null;return}wh(this,t-Jn((Fi(),i5)),gn(this.j&2?(!this.k&&(this.k=new ch),this.k).ck():i5,t))},O(As,"SimpleAnyTypeImpl",668),M(669,506,{105:1,92:1,90:1,56:1,49:1,97:1,2023:1,669:1},OHe),l._g=function(t,n,r){switch(t){case 0:return r?(!this.a&&(this.a=new ds(this,0)),this.a):(!this.a&&(this.a=new ds(this,0)),this.a.b);case 1:return r?(!this.b&&(this.b=new Nl((on(),oo),wc,this,1)),this.b):(!this.b&&(this.b=new Nl((on(),oo),wc,this,1)),hD(this.b));case 2:return r?(!this.c&&(this.c=new Nl((on(),oo),wc,this,2)),this.c):(!this.c&&(this.c=new Nl((on(),oo),wc,this,2)),hD(this.c));case 3:return!this.a&&(this.a=new ds(this,0)),Wc(this.a,(Fi(),dN));case 4:return!this.a&&(this.a=new ds(this,0)),Wc(this.a,(Fi(),gN));case 5:return!this.a&&(this.a=new ds(this,0)),Wc(this.a,(Fi(),ZS));case 6:return!this.a&&(this.a=new ds(this,0)),Wc(this.a,(Fi(),JS))}return ph(this,t-Jn((Fi(),Pw)),gn(this.j&2?(!this.k&&(this.k=new ch),this.k).ck():Pw,t),n,r)},l.jh=function(t,n,r){var s;switch(n){case 0:return!this.a&&(this.a=new ds(this,0)),vI(this.a,t,r);case 1:return!this.b&&(this.b=new Nl((on(),oo),wc,this,1)),vj(this.b,t,r);case 2:return!this.c&&(this.c=new Nl((on(),oo),wc,this,2)),vj(this.c,t,r);case 5:return!this.a&&(this.a=new ds(this,0)),FUe(Wc(this.a,(Fi(),ZS)),t,r)}return s=u(gn(this.j&2?(!this.k&&(this.k=new ch),this.k).ck():(Fi(),Pw),n),66),s.Nj().Rj(this,vme(this),n-Jn((Fi(),Pw)),t,r)},l.lh=function(t){switch(t){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 ds(this,0)),!YF(Wc(this.a,(Fi(),dN)));case 4:return!this.a&&(this.a=new ds(this,0)),!YF(Wc(this.a,(Fi(),gN)));case 5:return!this.a&&(this.a=new ds(this,0)),!YF(Wc(this.a,(Fi(),ZS)));case 6:return!this.a&&(this.a=new ds(this,0)),!YF(Wc(this.a,(Fi(),JS)))}return dh(this,t-Jn((Fi(),Pw)),gn(this.j&2?(!this.k&&(this.k=new ch),this.k).ck():Pw,t))},l.sh=function(t,n){switch(t){case 0:!this.a&&(this.a=new ds(this,0)),XM(this.a,n);return;case 1:!this.b&&(this.b=new Nl((on(),oo),wc,this,1)),sH(this.b,n);return;case 2:!this.c&&(this.c=new Nl((on(),oo),wc,this,2)),sH(this.c,n);return;case 3:!this.a&&(this.a=new ds(this,0)),d6(Wc(this.a,(Fi(),dN))),!this.a&&(this.a=new ds(this,0)),t_(Wc(this.a,dN),u(n,14));return;case 4:!this.a&&(this.a=new ds(this,0)),d6(Wc(this.a,(Fi(),gN))),!this.a&&(this.a=new ds(this,0)),t_(Wc(this.a,gN),u(n,14));return;case 5:!this.a&&(this.a=new ds(this,0)),d6(Wc(this.a,(Fi(),ZS))),!this.a&&(this.a=new ds(this,0)),t_(Wc(this.a,ZS),u(n,14));return;case 6:!this.a&&(this.a=new ds(this,0)),d6(Wc(this.a,(Fi(),JS))),!this.a&&(this.a=new ds(this,0)),t_(Wc(this.a,JS),u(n,14));return}yh(this,t-Jn((Fi(),Pw)),gn(this.j&2?(!this.k&&(this.k=new ch),this.k).ck():Pw,t),n)},l.zh=function(){return Fi(),Pw},l.Bh=function(t){switch(t){case 0:!this.a&&(this.a=new ds(this,0)),_r(this.a);return;case 1:!this.b&&(this.b=new Nl((on(),oo),wc,this,1)),this.b.c.$b();return;case 2:!this.c&&(this.c=new Nl((on(),oo),wc,this,2)),this.c.c.$b();return;case 3:!this.a&&(this.a=new ds(this,0)),d6(Wc(this.a,(Fi(),dN)));return;case 4:!this.a&&(this.a=new ds(this,0)),d6(Wc(this.a,(Fi(),gN)));return;case 5:!this.a&&(this.a=new ds(this,0)),d6(Wc(this.a,(Fi(),ZS)));return;case 6:!this.a&&(this.a=new ds(this,0)),d6(Wc(this.a,(Fi(),JS)));return}wh(this,t-Jn((Fi(),Pw)),gn(this.j&2?(!this.k&&(this.k=new ch),this.k).ck():Pw,t))},l.Ib=function(){var t;return this.j&4?_f(this):(t=new Ph(_f(this)),t.a+=" (mixed: ",QT(t,this.a),t.a+=")",t.a)},O(As,"XMLTypeDocumentRootImpl",669),M(1919,704,{105:1,92:1,90:1,471:1,147:1,56:1,108:1,49:1,97:1,150:1,114:1,115:1,2024:1},bm),l.Ih=function(t,n){switch(t.yj()){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 n==null?null:Qo(n);case 19:case 28:case 29:case 35:case 38:case 39:case 41:case 46:case 52:case 54:case 5:return Hr(n);case 6:return _Kt(u(n,190));case 12:case 47:case 49:case 11:return ult(this,t,n);case 13:return n==null?null:fvn(u(n,240));case 15:case 14:return n==null?null:xZt(Ue(ft(n)));case 17:return fst((Fi(),n));case 18:return fst(n);case 21:case 20:return n==null?null:EZt(u(n,155).a);case 27:return CKt(u(n,190));case 30:return Ait((Fi(),u(n,15)));case 31:return Ait(u(n,15));case 40:return AKt((Fi(),n));case 42:return dst((Fi(),n));case 43:return dst(n);case 59:case 48:return SKt((Fi(),n));default:throw J(new Ln($7+t.ne()+dw))}},l.Jh=function(t){var n,r,s,o,h;switch(t.G==-1&&(t.G=(r=Gl(t),r?Dg(r.Mh(),t):-1)),t.G){case 0:return n=new Tpe,n;case 1:return s=new fR,s;case 2:return o=new NHe,o;case 3:return h=new OHe,h;default:throw J(new Ln(Pce+t.zb+dw))}},l.Kh=function(t,n){var r,s,o,h,d,v,x,_,L,P,z,q,W,X,le,Ce;switch(t.yj()){case 5:case 52:case 4:return n;case 6:return zcn(n);case 8:case 7:return n==null?null:Lhn(n);case 9:return n==null?null:xD(Wl((s=Xc(n,!0),s.length>0&&(zr(0,s.length),s.charCodeAt(0)==43)?s.substr(1):s),-128,127)<<24>>24);case 10:return n==null?null:xD(Wl((o=Xc(n,!0),o.length>0&&(zr(0,o.length),o.charCodeAt(0)==43)?o.substr(1):o),-128,127)<<24>>24);case 11:return Hr(aw(this,(Fi(),_4t),n));case 12:return Hr(aw(this,(Fi(),C4t),n));case 13:return n==null?null:new Vpe(Xc(n,!0));case 15:case 14:return X0n(n);case 16:return Hr(aw(this,(Fi(),S4t),n));case 17:return Nrt((Fi(),n));case 18:return Nrt(n);case 28:case 29:case 35:case 38:case 39:case 41:case 54:case 19:return Xc(n,!0);case 21:case 20:return sgn(n);case 22:return Hr(aw(this,(Fi(),A4t),n));case 23:return Hr(aw(this,(Fi(),L4t),n));case 24:return Hr(aw(this,(Fi(),M4t),n));case 25:return Hr(aw(this,(Fi(),D4t),n));case 26:return Hr(aw(this,(Fi(),I4t),n));case 27:return Rcn(n);case 30:return Prt((Fi(),n));case 31:return Prt(n);case 32:return n==null?null:ct(Wl((L=Xc(n,!0),L.length>0&&(zr(0,L.length),L.charCodeAt(0)==43)?L.substr(1):L),$a,Ei));case 33:return n==null?null:new Ip((P=Xc(n,!0),P.length>0&&(zr(0,P.length),P.charCodeAt(0)==43)?P.substr(1):P));case 34:return n==null?null:ct(Wl((z=Xc(n,!0),z.length>0&&(zr(0,z.length),z.charCodeAt(0)==43)?z.substr(1):z),$a,Ei));case 36:return n==null?null:lb(xz((q=Xc(n,!0),q.length>0&&(zr(0,q.length),q.charCodeAt(0)==43)?q.substr(1):q)));case 37:return n==null?null:lb(xz((W=Xc(n,!0),W.length>0&&(zr(0,W.length),W.charCodeAt(0)==43)?W.substr(1):W)));case 40:return Jon((Fi(),n));case 42:return Brt((Fi(),n));case 43:return Brt(n);case 44:return n==null?null:new Ip((X=Xc(n,!0),X.length>0&&(zr(0,X.length),X.charCodeAt(0)==43)?X.substr(1):X));case 45:return n==null?null:new Ip((le=Xc(n,!0),le.length>0&&(zr(0,le.length),le.charCodeAt(0)==43)?le.substr(1):le));case 46:return Xc(n,!1);case 47:return Hr(aw(this,(Fi(),O4t),n));case 59:case 48:return Zon((Fi(),n));case 49:return Hr(aw(this,(Fi(),N4t),n));case 50:return n==null?null:Z8(Wl((Ce=Xc(n,!0),Ce.length>0&&(zr(0,Ce.length),Ce.charCodeAt(0)==43)?Ce.substr(1):Ce),_G,32767)<<16>>16);case 51:return n==null?null:Z8(Wl((h=Xc(n,!0),h.length>0&&(zr(0,h.length),h.charCodeAt(0)==43)?h.substr(1):h),_G,32767)<<16>>16);case 53:return Hr(aw(this,(Fi(),P4t),n));case 55:return n==null?null:Z8(Wl((d=Xc(n,!0),d.length>0&&(zr(0,d.length),d.charCodeAt(0)==43)?d.substr(1):d),_G,32767)<<16>>16);case 56:return n==null?null:Z8(Wl((v=Xc(n,!0),v.length>0&&(zr(0,v.length),v.charCodeAt(0)==43)?v.substr(1):v),_G,32767)<<16>>16);case 57:return n==null?null:lb(xz((x=Xc(n,!0),x.length>0&&(zr(0,x.length),x.charCodeAt(0)==43)?x.substr(1):x)));case 58:return n==null?null:lb(xz((_=Xc(n,!0),_.length>0&&(zr(0,_.length),_.charCodeAt(0)==43)?_.substr(1):_)));case 60:return n==null?null:ct(Wl((r=Xc(n,!0),r.length>0&&(zr(0,r.length),r.charCodeAt(0)==43)?r.substr(1):r),$a,Ei));case 61:return n==null?null:ct(Wl(Xc(n,!0),$a,Ei));default:throw J(new Ln($7+t.ne()+dw))}};var R4t,tLe,F4t,nLe;O(As,"XMLTypeFactoryImpl",1919),M(586,179,{105:1,92:1,90:1,147:1,191:1,56:1,235:1,108:1,49:1,97:1,150:1,179:1,114:1,115:1,675:1,1945:1,586:1},mYe),l.N=!1,l.O=!1;var j4t=!1;O(As,"XMLTypePackageImpl",586),M(1852,1,{837:1},e6),l._j=function(){return F5e(),K4t},O(As,"XMLTypePackageImpl/1",1852),M(1861,1,li,w1),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/10",1861),M(1862,1,li,dR),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/11",1862),M(1863,1,li,gR),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/12",1863),M(1864,1,li,pR),l.wj=function(t){return Sm(t)},l.xj=function(t){return Me(ma,Qe,333,t,7,1)},O(As,"XMLTypePackageImpl/13",1864),M(1865,1,li,bR),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/14",1865),M(1866,1,li,vR),l.wj=function(t){return we(t,15)},l.xj=function(t){return Me(Eh,gy,15,t,0,1)},O(As,"XMLTypePackageImpl/15",1866),M(1867,1,li,wR),l.wj=function(t){return we(t,15)},l.xj=function(t){return Me(Eh,gy,15,t,0,1)},O(As,"XMLTypePackageImpl/16",1867),M(1868,1,li,Wf),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/17",1868),M(1869,1,li,xu),l.wj=function(t){return we(t,155)},l.xj=function(t){return Me(W7,Qe,155,t,0,1)},O(As,"XMLTypePackageImpl/18",1869),M(1870,1,li,bJ),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/19",1870),M(1853,1,li,vJ),l.wj=function(t){return we(t,843)},l.xj=function(t){return Me(hN,yt,843,t,0,1)},O(As,"XMLTypePackageImpl/2",1853),M(1871,1,li,wJ),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/20",1871),M(1872,1,li,Eu),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/21",1872),M(1873,1,li,Y9),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/22",1873),M(1874,1,li,mR),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/23",1874),M(1875,1,li,yR),l.wj=function(t){return we(t,190)},l.xj=function(t){return Me(el,Qe,190,t,0,2)},O(As,"XMLTypePackageImpl/24",1875),M(1876,1,li,t6),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/25",1876),M(1877,1,li,mJ),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/26",1877),M(1878,1,li,Lx),l.wj=function(t){return we(t,15)},l.xj=function(t){return Me(Eh,gy,15,t,0,1)},O(As,"XMLTypePackageImpl/27",1878),M(1879,1,li,yJ),l.wj=function(t){return we(t,15)},l.xj=function(t){return Me(Eh,gy,15,t,0,1)},O(As,"XMLTypePackageImpl/28",1879),M(1880,1,li,kR),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/29",1880),M(1854,1,li,kJ),l.wj=function(t){return we(t,667)},l.xj=function(t){return Me(rU,yt,2021,t,0,1)},O(As,"XMLTypePackageImpl/3",1854),M(1881,1,li,xJ),l.wj=function(t){return we(t,19)},l.xj=function(t){return Me(Za,Qe,19,t,0,1)},O(As,"XMLTypePackageImpl/30",1881),M(1882,1,li,X9),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/31",1882),M(1883,1,li,xR),l.wj=function(t){return we(t,162)},l.xj=function(t){return Me(pw,Qe,162,t,0,1)},O(As,"XMLTypePackageImpl/32",1883),M(1884,1,li,$L),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/33",1884),M(1885,1,li,Q9),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/34",1885),M(1886,1,li,EJ),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/35",1886),M(1887,1,li,TJ),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/36",1887),M(1888,1,li,HL),l.wj=function(t){return we(t,15)},l.xj=function(t){return Me(Eh,gy,15,t,0,1)},O(As,"XMLTypePackageImpl/37",1888),M(1889,1,li,Z9),l.wj=function(t){return we(t,15)},l.xj=function(t){return Me(Eh,gy,15,t,0,1)},O(As,"XMLTypePackageImpl/38",1889),M(1890,1,li,m1),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/39",1890),M(1855,1,li,Mx),l.wj=function(t){return we(t,668)},l.xj=function(t){return Me(fN,yt,2022,t,0,1)},O(As,"XMLTypePackageImpl/4",1855),M(1891,1,li,_J),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/40",1891),M(1892,1,li,Dx),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/41",1892),M(1893,1,li,zL),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/42",1893),M(1894,1,li,j2),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/43",1894),M(1895,1,li,J9),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/44",1895),M(1896,1,li,GL),l.wj=function(t){return we(t,184)},l.xj=function(t){return Me(bw,Qe,184,t,0,1)},O(As,"XMLTypePackageImpl/45",1896),M(1897,1,li,Kf),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/46",1897),M(1898,1,li,eT),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/47",1898),M(1899,1,li,y1),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/48",1899),M(e2,1,li,k1),l.wj=function(t){return we(t,184)},l.xj=function(t){return Me(bw,Qe,184,t,0,1)},O(As,"XMLTypePackageImpl/49",e2),M(1856,1,li,CJ),l.wj=function(t){return we(t,669)},l.xj=function(t){return Me(JAe,yt,2023,t,0,1)},O(As,"XMLTypePackageImpl/5",1856),M(1901,1,li,SJ),l.wj=function(t){return we(t,162)},l.xj=function(t){return Me(pw,Qe,162,t,0,1)},O(As,"XMLTypePackageImpl/50",1901),M(1902,1,li,x3),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/51",1902),M(1903,1,li,Ix),l.wj=function(t){return we(t,19)},l.xj=function(t){return Me(Za,Qe,19,t,0,1)},O(As,"XMLTypePackageImpl/52",1903),M(1857,1,li,Ox),l.wj=function(t){return fa(t)},l.xj=function(t){return Me(mt,Qe,2,t,6,1)},O(As,"XMLTypePackageImpl/6",1857),M(1858,1,li,tT),l.wj=function(t){return we(t,190)},l.xj=function(t){return Me(el,Qe,190,t,0,2)},O(As,"XMLTypePackageImpl/7",1858),M(1859,1,li,AJ),l.wj=function(t){return Cm(t)},l.xj=function(t){return Me(Us,Qe,476,t,8,1)},O(As,"XMLTypePackageImpl/8",1859),M(1860,1,li,n6),l.wj=function(t){return we(t,217)},l.xj=function(t){return Me(mk,Qe,217,t,0,1)},O(As,"XMLTypePackageImpl/9",1860);var J1,Zg,eA,iU,fe;M(50,60,q0,$r),O($g,"RegEx/ParseException",50),M(820,1,{},qL),l.sl=function(t){return tr*16)throw J(new $r(Ur((jr(),odt))));r=r*16+o}while(!0);if(this.a!=125)throw J(new $r(Ur((jr(),cdt))));if(r>q7)throw J(new $r(Ur((jr(),udt))));t=r}else{if(o=0,this.c!=0||(o=fb(this.a))<0)throw J(new $r(Ur((jr(),jg))));if(r=o,mi(this),this.c!=0||(o=fb(this.a))<0)throw J(new $r(Ur((jr(),jg))));r=r*16+o,t=r}break;case 117:if(s=0,mi(this),this.c!=0||(s=fb(this.a))<0)throw J(new $r(Ur((jr(),jg))));if(n=s,mi(this),this.c!=0||(s=fb(this.a))<0)throw J(new $r(Ur((jr(),jg))));if(n=n*16+s,mi(this),this.c!=0||(s=fb(this.a))<0)throw J(new $r(Ur((jr(),jg))));if(n=n*16+s,mi(this),this.c!=0||(s=fb(this.a))<0)throw J(new $r(Ur((jr(),jg))));n=n*16+s,t=n;break;case 118:if(mi(this),this.c!=0||(s=fb(this.a))<0)throw J(new $r(Ur((jr(),jg))));if(n=s,mi(this),this.c!=0||(s=fb(this.a))<0)throw J(new $r(Ur((jr(),jg))));if(n=n*16+s,mi(this),this.c!=0||(s=fb(this.a))<0)throw J(new $r(Ur((jr(),jg))));if(n=n*16+s,mi(this),this.c!=0||(s=fb(this.a))<0)throw J(new $r(Ur((jr(),jg))));if(n=n*16+s,mi(this),this.c!=0||(s=fb(this.a))<0)throw J(new $r(Ur((jr(),jg))));if(n=n*16+s,mi(this),this.c!=0||(s=fb(this.a))<0)throw J(new $r(Ur((jr(),jg))));if(n=n*16+s,n>q7)throw J(new $r(Ur((jr(),"parser.descappe.4"))));t=n;break;case 65:case 90:case 122:throw J(new $r(Ur((jr(),ldt))))}return t},l.ul=function(t){var n,r;switch(t){case 100:r=(this.e&32)==32?Zp("Nd",!0):(yi(),sU);break;case 68:r=(this.e&32)==32?Zp("Nd",!1):(yi(),cLe);break;case 119:r=(this.e&32)==32?Zp("IsWord",!0):(yi(),DE);break;case 87:r=(this.e&32)==32?Zp("IsWord",!1):(yi(),lLe);break;case 115:r=(this.e&32)==32?Zp("IsSpace",!0):(yi(),qk);break;case 83:r=(this.e&32)==32?Zp("IsSpace",!1):(yi(),uLe);break;default:throw J(new tc((n=t,l0t+n.toString(16))))}return r},l.vl=function(t){var n,r,s,o,h,d,v,x,_,L,P,z;for(this.b=1,mi(this),n=null,this.c==0&&this.a==94?(mi(this),t?L=(yi(),yi(),new Hl(5)):(n=(yi(),yi(),new Hl(4)),Yc(n,0,q7),L=new Hl(4))):L=(yi(),yi(),new Hl(4)),o=!0;(z=this.c)!=1&&!(z==0&&this.a==93&&!o);){if(o=!1,r=this.a,s=!1,z==10)switch(r){case 100:case 68:case 119:case 87:case 115:case 83:ly(L,this.ul(r)),s=!0;break;case 105:case 73:case 99:case 67:r=this.Ll(L,r),r<0&&(s=!0);break;case 112:case 80:if(P=$4e(this,r),!P)throw J(new $r(Ur((jr(),Kce))));ly(L,P),s=!0;break;default:r=this.tl()}else if(z==20){if(d=o8(this.i,58,this.d),d<0)throw J(new $r(Ur((jr(),l8e))));if(v=!0,Ma(this.i,this.d)==94&&(++this.d,v=!1),h=jl(this.i,this.d,d),x=yJe(h,v,(this.e&512)==512),!x)throw J(new $r(Ur((jr(),ndt))));if(ly(L,x),s=!0,d+1>=this.j||Ma(this.i,d+1)!=93)throw J(new $r(Ur((jr(),l8e))));this.d=d+2}if(mi(this),!s)if(this.c!=0||this.a!=45)Yc(L,r,r);else{if(mi(this),(z=this.c)==1)throw J(new $r(Ur((jr(),wG))));z==0&&this.a==93?(Yc(L,r,r),Yc(L,45,45)):(_=this.a,z==10&&(_=this.tl()),mi(this),Yc(L,r,_))}(this.e&Sf)==Sf&&this.c==0&&this.a==44&&mi(this)}if(this.c==1)throw J(new $r(Ur((jr(),wG))));return n&&(bC(n,L),L=n),l4(L),gC(L),this.b=0,mi(this),L},l.wl=function(){var t,n,r,s;for(r=this.vl(!1);(s=this.c)!=7;)if(t=this.a,s==0&&(t==45||t==38)||s==4){if(mi(this),this.c!=9)throw J(new $r(Ur((jr(),idt))));if(n=this.vl(!1),s==4)ly(r,n);else if(t==45)bC(r,n);else if(t==38)rlt(r,n);else throw J(new tc("ASSERT"))}else throw J(new $r(Ur((jr(),sdt))));return mi(this),r},l.xl=function(){var t,n;return t=this.a-48,n=(yi(),yi(),new cre(12,null,t)),!this.g&&(this.g=new oF),aF(this.g,new ipe(t)),mi(this),n},l.yl=function(){return mi(this),yi(),z4t},l.zl=function(){return mi(this),yi(),H4t},l.Al=function(){throw J(new $r(Ur((jr(),xh))))},l.Bl=function(){throw J(new $r(Ur((jr(),xh))))},l.Cl=function(){return mi(this),ean()},l.Dl=function(){return mi(this),yi(),q4t},l.El=function(){return mi(this),yi(),U4t},l.Fl=function(){var t;if(this.d>=this.j||((t=Ma(this.i,this.d++))&65504)!=64)throw J(new $r(Ur((jr(),J1t))));return mi(this),yi(),yi(),new Yd(0,t-64)},l.Gl=function(){return mi(this),Rbn()},l.Hl=function(){return mi(this),yi(),W4t},l.Il=function(){var t;return t=(yi(),yi(),new Yd(0,105)),mi(this),t},l.Jl=function(){return mi(this),yi(),V4t},l.Kl=function(){return mi(this),yi(),G4t},l.Ll=function(t,n){return this.tl()},l.Ml=function(){return mi(this),yi(),aLe},l.Nl=function(){var t,n,r,s,o;if(this.d+1>=this.j)throw J(new $r(Ur((jr(),X1t))));if(s=-1,n=null,t=Ma(this.i,this.d),49<=t&&t<=57){if(s=t-48,!this.g&&(this.g=new oF),aF(this.g,new ipe(s)),++this.d,Ma(this.i,this.d)!=41)throw J(new $r(Ur((jr(),Tb))));++this.d}else switch(t==63&&--this.d,mi(this),n=u6e(this),n.e){case 20:case 21:case 22:case 23:break;case 8:if(this.c!=7)throw J(new $r(Ur((jr(),Tb))));break;default:throw J(new $r(Ur((jr(),Q1t))))}if(mi(this),o=Xv(this),r=null,o.e==2){if(o.em()!=2)throw J(new $r(Ur((jr(),Z1t))));r=o.am(1),o=o.am(0)}if(this.c!=7)throw J(new $r(Ur((jr(),Tb))));return mi(this),yi(),yi(),new ZJe(s,n,o,r)},l.Ol=function(){return mi(this),yi(),oLe},l.Pl=function(){var t;if(mi(this),t=zj(24,Xv(this)),this.c!=7)throw J(new $r(Ur((jr(),Tb))));return mi(this),t},l.Ql=function(){var t;if(mi(this),t=zj(20,Xv(this)),this.c!=7)throw J(new $r(Ur((jr(),Tb))));return mi(this),t},l.Rl=function(){var t;if(mi(this),t=zj(22,Xv(this)),this.c!=7)throw J(new $r(Ur((jr(),Tb))));return mi(this),t},l.Sl=function(){var t,n,r,s,o;for(t=0,r=0,n=-1;this.d=this.j)throw J(new $r(Ur((jr(),c8e))));if(n==45){for(++this.d;this.d=this.j)throw J(new $r(Ur((jr(),c8e))))}if(n==58){if(++this.d,mi(this),s=rYe(Xv(this),t,r),this.c!=7)throw J(new $r(Ur((jr(),Tb))));mi(this)}else if(n==41)++this.d,mi(this),s=rYe(Xv(this),t,r);else throw J(new $r(Ur((jr(),Y1t))));return s},l.Tl=function(){var t;if(mi(this),t=zj(21,Xv(this)),this.c!=7)throw J(new $r(Ur((jr(),Tb))));return mi(this),t},l.Ul=function(){var t;if(mi(this),t=zj(23,Xv(this)),this.c!=7)throw J(new $r(Ur((jr(),Tb))));return mi(this),t},l.Vl=function(){var t,n;if(mi(this),t=this.f++,n=Pne(Xv(this),t),this.c!=7)throw J(new $r(Ur((jr(),Tb))));return mi(this),n},l.Wl=function(){var t;if(mi(this),t=Pne(Xv(this),0),this.c!=7)throw J(new $r(Ur((jr(),Tb))));return mi(this),t},l.Xl=function(t){return mi(this),this.c==5?(mi(this),Ij(t,(yi(),yi(),new $m(9,t)))):Ij(t,(yi(),yi(),new $m(3,t)))},l.Yl=function(t){var n;return mi(this),n=(yi(),yi(),new e_(2)),this.c==5?(mi(this),pb(n,nA),pb(n,t)):(pb(n,t),pb(n,nA)),n},l.Zl=function(t){return mi(this),this.c==5?(mi(this),yi(),yi(),new $m(9,t)):(yi(),yi(),new $m(3,t))},l.a=0,l.b=0,l.c=0,l.d=0,l.e=0,l.f=1,l.g=null,l.j=0,O($g,"RegEx/RegexParser",820),M(1824,820,{},PHe),l.sl=function(t){return!1},l.tl=function(){return y5e(this)},l.ul=function(t){return m7(t)},l.vl=function(t){return Ylt(this)},l.wl=function(){throw J(new $r(Ur((jr(),xh))))},l.xl=function(){throw J(new $r(Ur((jr(),xh))))},l.yl=function(){throw J(new $r(Ur((jr(),xh))))},l.zl=function(){throw J(new $r(Ur((jr(),xh))))},l.Al=function(){return mi(this),m7(67)},l.Bl=function(){return mi(this),m7(73)},l.Cl=function(){throw J(new $r(Ur((jr(),xh))))},l.Dl=function(){throw J(new $r(Ur((jr(),xh))))},l.El=function(){throw J(new $r(Ur((jr(),xh))))},l.Fl=function(){return mi(this),m7(99)},l.Gl=function(){throw J(new $r(Ur((jr(),xh))))},l.Hl=function(){throw J(new $r(Ur((jr(),xh))))},l.Il=function(){return mi(this),m7(105)},l.Jl=function(){throw J(new $r(Ur((jr(),xh))))},l.Kl=function(){throw J(new $r(Ur((jr(),xh))))},l.Ll=function(t,n){return ly(t,m7(n)),-1},l.Ml=function(){return mi(this),yi(),yi(),new Yd(0,94)},l.Nl=function(){throw J(new $r(Ur((jr(),xh))))},l.Ol=function(){return mi(this),yi(),yi(),new Yd(0,36)},l.Pl=function(){throw J(new $r(Ur((jr(),xh))))},l.Ql=function(){throw J(new $r(Ur((jr(),xh))))},l.Rl=function(){throw J(new $r(Ur((jr(),xh))))},l.Sl=function(){throw J(new $r(Ur((jr(),xh))))},l.Tl=function(){throw J(new $r(Ur((jr(),xh))))},l.Ul=function(){throw J(new $r(Ur((jr(),xh))))},l.Vl=function(){var t;if(mi(this),t=Pne(Xv(this),0),this.c!=7)throw J(new $r(Ur((jr(),Tb))));return mi(this),t},l.Wl=function(){throw J(new $r(Ur((jr(),xh))))},l.Xl=function(t){return mi(this),Ij(t,(yi(),yi(),new $m(3,t)))},l.Yl=function(t){var n;return mi(this),n=(yi(),yi(),new e_(2)),pb(n,t),pb(n,nA),n},l.Zl=function(t){return mi(this),yi(),yi(),new $m(3,t)};var s5=null,LE=null;O($g,"RegEx/ParserForXMLSchema",1824),M(117,1,V7,cv),l.$l=function(t){throw J(new tc("Not supported."))},l._l=function(){return-1},l.am=function(t){return null},l.bm=function(){return null},l.cm=function(t){},l.dm=function(t){},l.em=function(){return 0},l.Ib=function(){return this.fm(0)},l.fm=function(t){return this.e==11?".":""},l.e=0;var rLe,ME,tA,$4t,iLe,Yy=null,sU,Lfe=null,sLe,nA,Mfe=null,aLe,oLe,cLe,uLe,lLe,H4t,qk,z4t,G4t,q4t,V4t,DE,U4t,W4t,D3n=O($g,"RegEx/Token",117);M(136,117,{3:1,136:1,117:1},Hl),l.fm=function(t){var n,r,s;if(this.e==4)if(this==sLe)r=".";else if(this==sU)r="\\d";else if(this==DE)r="\\w";else if(this==qk)r="\\s";else{for(s=new bg,s.a+="[",n=0;n0&&(s.a+=","),this.b[n]===this.b[n+1]?To(s,yI(this.b[n])):(To(s,yI(this.b[n])),s.a+="-",To(s,yI(this.b[n+1])));s.a+="]",r=s.a}else if(this==cLe)r="\\D";else if(this==lLe)r="\\W";else if(this==uLe)r="\\S";else{for(s=new bg,s.a+="[^",n=0;n0&&(s.a+=","),this.b[n]===this.b[n+1]?To(s,yI(this.b[n])):(To(s,yI(this.b[n])),s.a+="-",To(s,yI(this.b[n+1])));s.a+="]",r=s.a}return r},l.a=!1,l.c=!1,O($g,"RegEx/RangeToken",136),M(584,1,{584:1},ipe),l.a=0,O($g,"RegEx/RegexParser/ReferencePosition",584),M(583,1,{3:1,583:1},Uze),l.Fb=function(t){var n;return t==null||!we(t,583)?!1:(n=u(t,583),an(this.b,n.b)&&this.a==n.a)},l.Hb=function(){return Ig(this.b+"/"+g5e(this.a))},l.Ib=function(){return this.c.fm(this.a)},l.a=0,O($g,"RegEx/RegularExpression",583),M(223,117,V7,Yd),l._l=function(){return this.a},l.fm=function(t){var n,r,s;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:s="\\"+cne(this.a&Ss);break;case 12:s="\\f";break;case 10:s="\\n";break;case 13:s="\\r";break;case 9:s="\\t";break;case 27:s="\\e";break;default:this.a>=so?(r=(n=this.a>>>0,"0"+n.toString(16)),s="\\v"+jl(r,r.length-6,r.length)):s=""+cne(this.a&Ss)}break;case 8:this==aLe||this==oLe?s=""+cne(this.a&Ss):s="\\"+cne(this.a&Ss);break;default:s=null}return s},l.a=0,O($g,"RegEx/Token/CharToken",223),M(309,117,V7,$m),l.am=function(t){return this.a},l.cm=function(t){this.b=t},l.dm=function(t){this.c=t},l.em=function(){return 1},l.fm=function(t){var n;if(this.e==3)if(this.c<0&&this.b<0)n=this.a.fm(t)+"*";else if(this.c==this.b)n=this.a.fm(t)+"{"+this.c+"}";else if(this.c>=0&&this.b>=0)n=this.a.fm(t)+"{"+this.c+","+this.b+"}";else if(this.c>=0&&this.b<0)n=this.a.fm(t)+"{"+this.c+",}";else throw J(new tc("Token#toString(): CLOSURE "+this.c+io+this.b));else if(this.c<0&&this.b<0)n=this.a.fm(t)+"*?";else if(this.c==this.b)n=this.a.fm(t)+"{"+this.c+"}?";else if(this.c>=0&&this.b>=0)n=this.a.fm(t)+"{"+this.c+","+this.b+"}?";else if(this.c>=0&&this.b<0)n=this.a.fm(t)+"{"+this.c+",}?";else throw J(new tc("Token#toString(): NONGREEDYCLOSURE "+this.c+io+this.b));return n},l.b=0,l.c=0,O($g,"RegEx/Token/ClosureToken",309),M(821,117,V7,Xve),l.am=function(t){return t==0?this.a:this.b},l.em=function(){return 2},l.fm=function(t){var n;return this.b.e==3&&this.b.am(0)==this.a?n=this.a.fm(t)+"+":this.b.e==9&&this.b.am(0)==this.a?n=this.a.fm(t)+"+?":n=this.a.fm(t)+(""+this.b.fm(t)),n},O($g,"RegEx/Token/ConcatToken",821),M(1822,117,V7,ZJe),l.am=function(t){if(t==0)return this.d;if(t==1)return this.b;throw J(new tc("Internal Error: "+t))},l.em=function(){return this.b?2:1},l.fm=function(t){var n;return this.c>0?n="(?("+this.c+")":this.a.e==8?n="(?("+this.a+")":n="(?"+this.a,this.b?n+=this.d+"|"+this.b+")":n+=this.d+")",n},l.c=0,O($g,"RegEx/Token/ConditionToken",1822),M(1823,117,V7,ZXe),l.am=function(t){return this.b},l.em=function(){return 1},l.fm=function(t){return"(?"+(this.a==0?"":g5e(this.a))+(this.c==0?"":g5e(this.c))+":"+this.b.fm(t)+")"},l.a=0,l.c=0,O($g,"RegEx/Token/ModifierToken",1823),M(822,117,V7,nwe),l.am=function(t){return this.a},l.em=function(){return 1},l.fm=function(t){var n;switch(n=null,this.e){case 6:this.b==0?n="(?:"+this.a.fm(t)+")":n="("+this.a.fm(t)+")";break;case 20:n="(?="+this.a.fm(t)+")";break;case 21:n="(?!"+this.a.fm(t)+")";break;case 22:n="(?<="+this.a.fm(t)+")";break;case 23:n="(?"+this.a.fm(t)+")"}return n},l.b=0,O($g,"RegEx/Token/ParenToken",822),M(521,117,{3:1,117:1,521:1},cre),l.bm=function(){return this.b},l.fm=function(t){return this.e==12?"\\"+this.a:Vdn(this.b)},l.a=0,O($g,"RegEx/Token/StringToken",521),M(465,117,V7,e_),l.$l=function(t){pb(this,t)},l.am=function(t){return u(Lv(this.a,t),117)},l.em=function(){return this.a?this.a.a.c.length:0},l.fm=function(t){var n,r,s,o,h;if(this.e==1){if(this.a.a.c.length==2)n=u(Lv(this.a,0),117),r=u(Lv(this.a,1),117),r.e==3&&r.am(0)==n?o=n.fm(t)+"+":r.e==9&&r.am(0)==n?o=n.fm(t)+"+?":o=n.fm(t)+(""+r.fm(t));else{for(h=new bg,s=0;s=this.c.b:this.a<=this.c.b},l.Sb=function(){return this.b>0},l.Tb=function(){return this.b},l.Vb=function(){return this.b-1},l.Qb=function(){throw J(new pg(v0t))},l.a=0,l.b=0,O(L8e,"ExclusiveRange/RangeIterator",254);var Sh=v8(mG,"C"),Lr=v8(qC,"I"),El=v8(sk,"Z"),S2=v8(VC,"J"),el=v8(HC,"B"),pa=v8(zC,"D"),Xy=v8(GC,"F"),a5=v8(UC,"S"),I3n=ss("org.eclipse.elk.core.labels","ILabelManager"),hLe=ss(Qa,"DiagnosticChain"),fLe=ss(Vdt,"ResourceSet"),dLe=O(Qa,"InvocationTargetException",null),Y4t=(fF(),Enn),X4t=X4t=fhn;win(hVt),qin("permProps",[[[IG,OG],[NG,"gecko1_8"]],[[IG,OG],[NG,"ie10"]],[[IG,OG],[NG,"ie8"]],[[IG,OG],[NG,"ie9"]],[[IG,OG],[NG,"safari"]]]),X4t(null,"elk",null)}).call(this)}).call(this,typeof Wk<"u"?Wk:typeof self<"u"?self:typeof window<"u"?window:{})},{}],3:[function(f,p,w){function y(B,R){if(!(B instanceof R))throw new TypeError("Cannot call a class as a function")}function b(B,R){if(!B)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:B}function E(B,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);B.prototype=Object.create(R&&R.prototype,{constructor:{value:B,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(B,R):B.__proto__=R)}var S=f("./elk-api.js").default,N=function(B){E(R,B);function R(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};y(this,R);var $=Object.assign({},j),V=!1;try{f.resolve("web-worker"),V=!0}catch{}if(j.workerUrl)if(V){var Q=f("web-worker");$.workerFactory=function(se){return new Q(se)}}else console.warn(`Web worker requested but 'web-worker' package not installed. -Consider installing the package or pass your own 'workerFactory' to ELK's constructor. -... Falling back to non-web worker version.`);if(!$.workerFactory){var oe=f("./elk-worker.min.js"),ce=oe.Worker;$.workerFactory=function(se){return new ce(se)}}return b(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,$))}return R}(S);Object.defineProperty(p.exports,"__esModule",{value:!0}),p.exports=N,N.default=N},{"./elk-api.js":1,"./elk-worker.min.js":2,"web-worker":4}],4:[function(f,p,w){p.exports=Worker},{}]},{},[3])(3)})})(qGt);const VGt=xLe(Mge),HFe=new VGt;let Zb={};const UGt={};let O5={};const WGt=async function(i,a,f,p,w,y,b){const S=f.select(`[id="${a}"]`).insert("g").attr("class","nodes"),N=Object.keys(i);return await Promise.all(N.map(async function(B){const R=i[B];let j="default";R.classes.length>0&&(j=R.classes.join(" ")),j=j+" flowchart-label";const $=Yw(R.styles);let V=R.text!==void 0?R.text:R.id;const Q={width:0,height:0},oe=[{id:R.id+"-west",layoutOptions:{"port.side":"WEST"}},{id:R.id+"-east",layoutOptions:{"port.side":"EAST"}},{id:R.id+"-south",layoutOptions:{"port.side":"SOUTH"}},{id:R.id+"-north",layoutOptions:{"port.side":"NORTH"}}];let ce=0,se="",ge={};switch(R.type){case"round":ce=5,se="rect";break;case"square":se="rect";break;case"diamond":se="question",ge={portConstraints:"FIXED_SIDE"};break;case"hexagon":se="hexagon";break;case"odd":se="rect_left_inv_arrow";break;case"lean_right":se="lean_right";break;case"lean_left":se="lean_left";break;case"trapezoid":se="trapezoid";break;case"inv_trapezoid":se="inv_trapezoid";break;case"odd_right":se="rect_left_inv_arrow";break;case"circle":se="circle";break;case"ellipse":se="ellipse";break;case"stadium":se="stadium";break;case"subroutine":se="subroutine";break;case"cylinder":se="cylinder";break;case"group":se="rect";break;case"doublecircle":se="doublecircle";break;default:se="rect"}const ye={labelStyle:$.labelStyle,shape:se,labelText:V,labelType:R.labelType,rx:ce,ry:ce,class:j,style:$.style,id:R.id,link:R.link,linkTarget:R.linkTarget,tooltip:w.db.getTooltip(R.id)||"",domId:w.db.lookUpDomId(R.id),haveCallback:R.haveCallback,width:R.type==="group"?500:void 0,dir:R.dir,type:R.type,props:R.props,padding:Tt().flowchart.padding};let ke,Ae;if(ye.type!=="group")Ae=await KBe(S,ye,R.dir),ke=Ae.node().getBBox();else{p.createElementNS("http://www.w3.org/2000/svg","text");const{shapeSvg:ve,bbox:te}=await jd(S,ye,void 0,!0);Q.width=te.width,Q.wrappingWidth=Tt().flowchart.wrappingWidth,Q.height=te.height,Q.labelNode=ve.node(),ye.labelData=Q}const de={id:R.id,ports:R.type==="diamond"?oe:[],layoutOptions:ge,labelText:V,labelData:Q,domId:w.db.lookUpDomId(R.id),width:ke==null?void 0:ke.width,height:ke==null?void 0:ke.height,type:R.type,el:Ae,parent:y.parentById[R.id]};O5[ye.id]=de})),b},zFe=(i,a,f)=>{const p={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"}}};return p.TD=p.TB,Fe.info("abc88",f,a,i),p[f][a][i]},GFe=(i,a,f)=>{if(Fe.info("getNextPort abc88",{node:i,edgeDirection:a,graphDirection:f}),!Zb[i])switch(f){case"TB":case"TD":Zb[i]={inPosition:"north",outPosition:"south"};break;case"BT":Zb[i]={inPosition:"south",outPosition:"north"};break;case"RL":Zb[i]={inPosition:"east",outPosition:"west"};break;case"LR":Zb[i]={inPosition:"west",outPosition:"east"};break}const p=a==="in"?Zb[i].inPosition:Zb[i].outPosition;return a==="in"?Zb[i].inPosition=zFe(Zb[i].inPosition,a,f):Zb[i].outPosition=zFe(Zb[i].outPosition,a,f),p},KGt=(i,a)=>{let f=i.start,p=i.end;const w=f,y=p,b=O5[f],E=O5[p];return!b||!E?{source:f,target:p}:(b.type==="diamond"&&(f=`${f}-${GFe(f,"out",a)}`),E.type==="diamond"&&(p=`${p}-${GFe(p,"in",a)}`),{source:f,target:p,sourceId:w,targetId:y})},YGt=function(i,a,f,p){Fe.info("abc78 edges = ",i);const w=p.insert("g").attr("class","edgeLabels");let y={},b=a.db.getDirection(),E,S;if(i.defaultStyle!==void 0){const N=Yw(i.defaultStyle);E=N.style,S=N.labelStyle}return i.forEach(function(N){var B="L-"+N.start+"-"+N.end;y[B]===void 0?(y[B]=0,Fe.info("abc78 new entry",B,y[B])):(y[B]++,Fe.info("abc78 new entry",B,y[B]));let R=B+"-"+y[B];Fe.info("abc78 new link id to be used is",B,R,y[B]);var j="LS-"+N.start,$="LE-"+N.end;const V={style:"",labelStyle:""};switch(V.minlen=N.length||1,N.type==="arrow_open"?V.arrowhead="none":V.arrowhead="normal",V.arrowTypeStart="arrow_open",V.arrowTypeEnd="arrow_open",N.type){case"double_arrow_cross":V.arrowTypeStart="arrow_cross";case"arrow_cross":V.arrowTypeEnd="arrow_cross";break;case"double_arrow_point":V.arrowTypeStart="arrow_point";case"arrow_point":V.arrowTypeEnd="arrow_point";break;case"double_arrow_circle":V.arrowTypeStart="arrow_circle";case"arrow_circle":V.arrowTypeEnd="arrow_circle";break}let Q="",oe="";switch(N.stroke){case"normal":Q="fill:none;",E!==void 0&&(Q=E),S!==void 0&&(oe=S),V.thickness="normal",V.pattern="solid";break;case"dotted":V.thickness="normal",V.pattern="dotted",V.style="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":V.thickness="thick",V.pattern="solid",V.style="stroke-width: 3.5px;fill:none;";break}if(N.style!==void 0){const Ae=Yw(N.style);Q=Ae.style,oe=Ae.labelStyle}V.style=V.style+=Q,V.labelStyle=V.labelStyle+=oe,N.interpolate!==void 0?V.curve=Ub(N.interpolate,ng):i.defaultInterpolate!==void 0?V.curve=Ub(i.defaultInterpolate,ng):V.curve=Ub(UGt.curve,ng),N.text===void 0?N.style!==void 0&&(V.arrowheadStyle="fill: #333"):(V.arrowheadStyle="fill: #333",V.labelpos="c"),V.labelType=N.labelType,V.label=N.text.replace(Wa.lineBreakRegex,` -`),N.style===void 0&&(V.style=V.style||"stroke: #333; stroke-width: 1.5px;fill:none;"),V.labelStyle=V.labelStyle.replace("color:","fill:"),V.id=R,V.classes="flowchart-link "+j+" "+$;const ce=QBe(w,V),{source:se,target:ge,sourceId:ye,targetId:ke}=KGt(N,b);Fe.debug("abc78 source and target",se,ge),f.edges.push({id:"e"+N.start+N.end,sources:[se],targets:[ge],sourceId:ye,targetId:ke,labelEl:ce,labels:[{width:V.width,height:V.height,orgWidth:V.width,orgHeight:V.height,text:V.label,layoutOptions:{"edgeLabels.inline":"true","edgeLabels.placement":"CENTER"}}],edgeData:V})}),f},XGt=function(i,a,f,p){let w="";switch(p&&(w=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,w=w.replace(/\(/g,"\\("),w=w.replace(/\)/g,"\\)")),a.arrowTypeStart){case"arrow_cross":i.attr("marker-start","url("+w+"#"+f+"-crossStart)");break;case"arrow_point":i.attr("marker-start","url("+w+"#"+f+"-pointStart)");break;case"arrow_barb":i.attr("marker-start","url("+w+"#"+f+"-barbStart)");break;case"arrow_circle":i.attr("marker-start","url("+w+"#"+f+"-circleStart)");break;case"aggregation":i.attr("marker-start","url("+w+"#"+f+"-aggregationStart)");break;case"extension":i.attr("marker-start","url("+w+"#"+f+"-extensionStart)");break;case"composition":i.attr("marker-start","url("+w+"#"+f+"-compositionStart)");break;case"dependency":i.attr("marker-start","url("+w+"#"+f+"-dependencyStart)");break;case"lollipop":i.attr("marker-start","url("+w+"#"+f+"-lollipopStart)");break}switch(a.arrowTypeEnd){case"arrow_cross":i.attr("marker-end","url("+w+"#"+f+"-crossEnd)");break;case"arrow_point":i.attr("marker-end","url("+w+"#"+f+"-pointEnd)");break;case"arrow_barb":i.attr("marker-end","url("+w+"#"+f+"-barbEnd)");break;case"arrow_circle":i.attr("marker-end","url("+w+"#"+f+"-circleEnd)");break;case"aggregation":i.attr("marker-end","url("+w+"#"+f+"-aggregationEnd)");break;case"extension":i.attr("marker-end","url("+w+"#"+f+"-extensionEnd)");break;case"composition":i.attr("marker-end","url("+w+"#"+f+"-compositionEnd)");break;case"dependency":i.attr("marker-end","url("+w+"#"+f+"-dependencyEnd)");break;case"lollipop":i.attr("marker-end","url("+w+"#"+f+"-lollipopEnd)");break}},QGt=function(i,a){Fe.info("Extracting classes"),a.db.clear("ver-2");try{return a.parse(i),a.db.getClasses()}catch{return{}}},ZGt=function(i){const a={parentById:{},childrenById:{}},f=i.getSubGraphs();return Fe.info("Subgraphs - ",f),f.forEach(function(p){p.nodes.forEach(function(w){a.parentById[w]=p.id,a.childrenById[p.id]===void 0&&(a.childrenById[p.id]=[]),a.childrenById[p.id].push(w)})}),f.forEach(function(p){p.id,a.parentById[p.id]!==void 0&&a.parentById[p.id]}),a},JGt=function(i,a,f){const p=GGt(i,a,f);if(p===void 0||p==="root")return{x:0,y:0};const w=O5[p].offset;return{x:w.posX,y:w.posY}},eqt=function(i,a,f,p,w){const y=JGt(a.sourceId,a.targetId,w),b=a.sections[0].startPoint,E=a.sections[0].endPoint,N=(a.sections[0].bendPoints?a.sections[0].bendPoints:[]).map(oe=>[oe.x+y.x,oe.y+y.y]),B=[[b.x+y.x,b.y+y.y],...N,[E.x+y.x,E.y+y.y]],R=WE().curve(ng),j=i.insert("path").attr("d",R(B)).attr("class","path").attr("fill","none"),$=i.insert("g").attr("class","edgeLabel"),V=Cr($.node().appendChild(a.labelEl)),Q=V.node().firstChild.getBoundingClientRect();V.attr("width",Q.width),V.attr("height",Q.height),$.attr("transform",`translate(${a.labels[0].x+y.x}, ${a.labels[0].y+y.y})`),XGt(j,f,p.type,p.arrowMarkerAbsolute)},qFe=(i,a)=>{i.forEach(f=>{f.children||(f.children=[]);const p=a.childrenById[f.id];p&&p.forEach(w=>{f.children.push(O5[w])}),qFe(f.children,a)})},tqt=async function(i,a,f,p){var de;p.db.clear(),O5={},Zb={},p.db.setGen("gen-2"),p.parser.parse(i);const w=Cr("body").append("div").attr("style","height:400px").attr("id","cy");let y={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.direction":"DOWN"},children:[],edges:[]};switch(Fe.info("Drawing flowchart using v3 renderer",HFe),p.db.getDirection()){case"BT":y.layoutOptions["elk.direction"]="UP";break;case"TB":y.layoutOptions["elk.direction"]="DOWN";break;case"LR":y.layoutOptions["elk.direction"]="RIGHT";break;case"RL":y.layoutOptions["elk.direction"]="LEFT";break}const{securityLevel:E,flowchart:S}=Tt();let N;E==="sandbox"&&(N=Cr("#i"+a));const B=Cr(E==="sandbox"?N.nodes()[0].contentDocument.body:"body"),R=E==="sandbox"?N.nodes()[0].contentDocument:document,j=B.select(`[id="${a}"]`);vBe(j,["point","circle","cross"],p.type,p.arrowMarkerAbsolute);const V=p.db.getVertices();let Q;const oe=p.db.getSubGraphs();Fe.info("Subgraphs - ",oe);for(let ve=oe.length-1;ve>=0;ve--)Q=oe[ve],p.db.addVertex(Q.id,{text:Q.title,type:Q.labelType},"group",void 0,Q.classes,Q.dir);const ce=j.insert("g").attr("class","subgraphs"),se=ZGt(p.db);y=await WGt(V,a,B,R,p,se,y);const ge=j.insert("g").attr("class","edges edgePath"),ye=p.db.getEdges();y=YGt(ye,p,y,j),Object.keys(O5).forEach(ve=>{const te=O5[ve];te.parent||y.children.push(te),se.childrenById[ve]!==void 0&&(te.labels=[{text:te.labelText,layoutOptions:{"nodeLabels.placement":"[H_CENTER, V_TOP, INSIDE]"},width:te.labelData.width,height:te.labelData.height}],delete te.x,delete te.y,delete te.width,delete te.height)}),qFe(y.children,se),Fe.info("after layout",JSON.stringify(y,null,2));const Ae=await HFe.layout(y);VFe(0,0,Ae.children,j,ce,p,0),Fe.info("after layout",Ae),(de=Ae.edges)==null||de.map(ve=>{eqt(ge,ve,ve.edgeData,p,se)}),YE({},j,S.diagramPadding,S.useMaxWidth),w.remove()},VFe=(i,a,f,p,w,y,b)=>{f.forEach(function(E){if(E)if(O5[E.id].offset={posX:E.x+i,posY:E.y+a,x:i,y:a,depth:b,width:E.width,height:E.height},E.type==="group"){const S=w.insert("g").attr("class","subgraph");S.insert("rect").attr("class","subgraph subgraph-lvl-"+b%5+" node").attr("x",E.x+i).attr("y",E.y+a).attr("width",E.width).attr("height",E.height);const N=S.insert("g").attr("class","label"),B=Tt().flowchart.htmlLabels?E.labelData.width/2:0;N.attr("transform",`translate(${E.labels[0].x+i+E.x+B}, ${E.labels[0].y+a+E.y+3})`),N.node().appendChild(E.labelData.labelNode),Fe.info("Id (UGH)= ",E.type,E.labels)}else Fe.info("Id (UGH)= ",E.id),E.el.attr("transform",`translate(${E.x+i+E.width/2}, ${E.y+a+E.height/2})`)}),f.forEach(function(E){E&&E.type==="group"&&VFe(i+E.x,a+E.y,E.children,p,w,y,b+1)})},nqt={getClasses:QGt,draw:tqt},rqt=i=>{let a="";for(let f=0;f<5;f++)a+=` - .subgraph-lvl-${f} { - fill: ${i[`surface${f}`]}; - stroke: ${i[`surfacePeer${f}`]}; - } - `;return a},iqt=Object.freeze(Object.defineProperty({__proto__:null,diagram:{db:hMt,renderer:nqt,parser:Dde,styles:i=>`.label { - font-family: ${i.fontFamily}; - color: ${i.nodeTextColor||i.textColor}; - } - .cluster-label text { - fill: ${i.titleColor}; - } - .cluster-label span { - color: ${i.titleColor}; - } - - .label text,span { - fill: ${i.nodeTextColor||i.textColor}; - color: ${i.nodeTextColor||i.textColor}; - } - - .node rect, - .node circle, - .node ellipse, - .node polygon, - .node path { - fill: ${i.mainBkg}; - stroke: ${i.nodeBorder}; - stroke-width: 1px; - } - - .node .label { - text-align: center; - } - .node.clickable { - cursor: pointer; - } - - .arrowheadPath { - fill: ${i.arrowheadColor}; - } - - .edgePath .path { - stroke: ${i.lineColor}; - stroke-width: 2.0px; - } - - .flowchart-link { - stroke: ${i.lineColor}; - fill: none; - } - - .edgeLabel { - background-color: ${i.edgeLabelBackground}; - rect { - opacity: 0.85; - background-color: ${i.edgeLabelBackground}; - fill: ${i.edgeLabelBackground}; + ${t.actor5?`fill: ${t.actor5}`:""}; + } +`,"getStyles"),hde=DUe});var cP,RUe,pde,mde,NUe,MUe,dde,IUe,OUe,gde,PUe,Hg,yde=R(()=>{"use strict";Zt();Qy();cP=o(function(t,e){return yd(t,e)},"drawRect"),RUe=o(function(t,e){let n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(u){let h=bl().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);u.append("path").attr("class","mouth").attr("d",h).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}o(a,"smile");function s(u){let h=bl().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);u.append("path").attr("class","mouth").attr("d",h).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}o(s,"sad");function l(u){u.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return o(l,"ambivalent"),e.score>3?a(i):e.score<3?s(i):l(i),n},"drawFace"),pde=o(function(t,e){let r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),mde=o(function(t,e){return TW(t,e)},"drawText"),NUe=o(function(t,e){function r(i,a,s,l,u){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+l-u)+" "+(i+s-u*1.2)+","+(a+l)+" "+i+","+(a+l)}o(r,"genPoints");let n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,mde(t,e)},"drawLabel"),MUe=o(function(t,e,r){let n=t.append("g"),i=wl();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width*e.taskCount+r.diagramMarginX*(e.taskCount-1),i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,cP(n,i),gde(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),dde=-1,IUe=o(function(t,e,r){let n=e.x+r.width/2,i=t.append("g");dde++;let a=300+5*30;i.append("line").attr("id","task"+dde).attr("x1",n).attr("y1",e.y).attr("x2",n).attr("y2",a).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),RUe(i,{cx:n,cy:300+(5-e.score)*30,score:e.score});let s=wl();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=r.width,s.height=r.height,s.class="task task-type-"+e.num,s.rx=3,s.ry=3,cP(i,s);let l=e.x+14;e.people.forEach(u=>{let h=e.actors[u].color,f={cx:l,cy:e.y,r:7,fill:h,stroke:"#000",title:u,pos:e.actors[u].position};pde(i,f),l+=10}),gde(r)(e.task,i,s.x,s.y,s.width,s.height,{class:"task"},r,e.colour)},"drawTask"),OUe=o(function(t,e){j3(t,e)},"drawBackgroundRect"),gde=function(){function t(i,a,s,l,u,h,f,d){let p=a.append("text").attr("x",s+u/2).attr("y",l+h/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(p,f)}o(t,"byText");function e(i,a,s,l,u,h,f,d,p){let{taskFontSize:m,taskFontFamily:g}=d,y=i.split(//gi);for(let v=0;v{let i=Xu[n].color,a={cx:20,cy:r,r:7,fill:i,stroke:"#000",pos:Xu[n].position};Hg.drawCircle(t,a);let s={x:40,y:r+7,fill:"#666",text:n,textMargin:e.boxTextMargin|5};Hg.drawText(t,s),r+=20})}var BUe,Xu,JE,I0,zUe,Zo,uP,vde,GUe,hP,xde=R(()=>{"use strict";Zt();yde();_t();Yn();BUe=o(function(t){Object.keys(t).forEach(function(r){JE[r]=t[r]})},"setConf"),Xu={};o(FUe,"drawActorLegend");JE=de().journey,I0=JE.leftMargin,zUe=o(function(t,e,r,n){let i=de().journey,a=de().securityLevel,s;a==="sandbox"&&(s=$e("#i"+e));let l=a==="sandbox"?$e(s.nodes()[0].contentDocument.body):$e("body");Zo.init();let u=l.select("#"+e);Hg.initGraphics(u);let h=n.db.getTasks(),f=n.db.getDiagramTitle(),d=n.db.getActors();for(let x in Xu)delete Xu[x];let p=0;d.forEach(x=>{Xu[x]={color:i.actorColours[p%i.actorColours.length],position:p},p++}),FUe(u),Zo.insert(0,0,I0,Object.keys(Xu).length*50),GUe(u,h,0);let m=Zo.getBounds();f&&u.append("text").text(f).attr("x",I0).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);let g=m.stopy-m.starty+2*i.diagramMarginY,y=I0+m.stopx+2*i.diagramMarginX;Sr(u,g,y,i.useMaxWidth),u.append("line").attr("x1",I0).attr("y1",i.height*4).attr("x2",y-I0-4).attr("y2",i.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");let v=f?70:0;u.attr("viewBox",`${m.startx} -25 ${y} ${g+v}`),u.attr("preserveAspectRatio","xMinYMin meet"),u.attr("height",g+v+25)},"draw"),Zo={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:o(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:o(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:o(function(t,e,r,n){let i=de().journey,a=this,s=0;function l(u){return o(function(f){s++;let d=a.sequenceItems.length-s+1;a.updateVal(f,"starty",e-d*i.boxMargin,Math.min),a.updateVal(f,"stopy",n+d*i.boxMargin,Math.max),a.updateVal(Zo.data,"startx",t-d*i.boxMargin,Math.min),a.updateVal(Zo.data,"stopx",r+d*i.boxMargin,Math.max),u!=="activation"&&(a.updateVal(f,"startx",t-d*i.boxMargin,Math.min),a.updateVal(f,"stopx",r+d*i.boxMargin,Math.max),a.updateVal(Zo.data,"starty",e-d*i.boxMargin,Math.min),a.updateVal(Zo.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}o(l,"updateFn"),this.sequenceItems.forEach(l())},"updateBounds"),insert:o(function(t,e,r,n){let i=Math.min(t,r),a=Math.max(t,r),s=Math.min(e,n),l=Math.max(e,n);this.updateVal(Zo.data,"startx",i,Math.min),this.updateVal(Zo.data,"starty",s,Math.min),this.updateVal(Zo.data,"stopx",a,Math.max),this.updateVal(Zo.data,"stopy",l,Math.max),this.updateBounds(i,s,a,l)},"insert"),bumpVerticalPos:o(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:o(function(){return this.verticalPos},"getVerticalPos"),getBounds:o(function(){return this.data},"getBounds")},uP=JE.sectionFills,vde=JE.sectionColours,GUe=o(function(t,e,r){let n=de().journey,i="",a=n.height*2+n.diagramMarginY,s=r+a,l=0,u="#CCC",h="black",f=0;for(let[d,p]of e.entries()){if(i!==p.section){u=uP[l%uP.length],f=l%uP.length,h=vde[l%vde.length];let g=0,y=p.section;for(let x=d;x(Xu[y]&&(g[y]=Xu[y]),g),{});p.x=d*n.taskMargin+d*n.width+I0,p.y=s,p.width=n.diagramMarginX,p.height=n.diagramMarginY,p.colour=h,p.fill=u,p.num=f,p.actors=m,Hg.drawTask(t,p,n),Zo.insert(p.x,p.y,p.x+p.width+n.taskMargin,300+5*30)}},"drawTasks"),hP={setConf:BUe,draw:zUe}});var bde={};hr(bde,{diagram:()=>$Ue});var $Ue,wde=R(()=>{"use strict";lde();ude();fde();xde();$Ue={parser:ode,db:lP,renderer:hP,styles:hde,init:o(t=>{hP.setConf(t.journey),lP.clear()},"init")}});var dP,_de,Lde=R(()=>{"use strict";dP=function(){var t=o(function(p,m,g,y){for(g=g||{},y=p.length;y--;g[p[y]]=m);return g},"o"),e=[6,8,10,11,12,14,16,17,20,21],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],l=[1,16],u=[1,17],h={trace:o(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:o(function(m,g,y,v,x,b,w){var S=b.length-1;switch(x){case 1:return b[S-1];case 2:this.$=[];break;case 3:b[S-1].push(b[S]),this.$=b[S-1];break;case 4:case 5:this.$=b[S];break;case 6:case 7:this.$=[];break;case 8:v.getCommonDb().setDiagramTitle(b[S].substr(6)),this.$=b[S].substr(6);break;case 9:this.$=b[S].trim(),v.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=b[S].trim(),v.getCommonDb().setAccDescription(this.$);break;case 12:v.addSection(b[S].substr(8)),this.$=b[S].substr(8);break;case 15:v.addTask(b[S],0,""),this.$=b[S];break;case 16:v.addEvent(b[S].substr(2)),this.$=b[S];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:a,17:s,18:14,19:15,20:l,21:u},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:18,11:r,12:n,14:i,16:a,17:s,18:14,19:15,20:l,21:u},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,19]},{15:[1,20]},t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,4]),t(e,[2,9]),t(e,[2,10])],defaultActions:{},parseError:o(function(m,g){if(g.recoverable)this.trace(m);else{var y=new Error(m);throw y.hash=g,y}},"parseError"),parse:o(function(m){var g=this,y=[0],v=[],x=[null],b=[],w=this.table,S="",T=0,E=0,_=0,A=2,L=1,M=b.slice.call(arguments,1),N=Object.create(this.lexer),k={yy:{}};for(var I in this.yy)Object.prototype.hasOwnProperty.call(this.yy,I)&&(k.yy[I]=this.yy[I]);N.setInput(m,k.yy),k.yy.lexer=N,k.yy.parser=this,typeof N.yylloc>"u"&&(N.yylloc={});var C=N.yylloc;b.push(C);var O=N.options&&N.options.ranges;typeof k.yy.parseError=="function"?this.parseError=k.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function D(q){y.length=y.length-2*q,x.length=x.length-q,b.length=b.length-q}o(D,"popStack");function P(){var q;return q=v.pop()||N.lex()||L,typeof q!="number"&&(q instanceof Array&&(v=q,q=v.pop()),q=g.symbols_[q]||q),q}o(P,"lex");for(var F,B,$,z,Y,Q,X={},ie,j,J,Z;;){if($=y[y.length-1],this.defaultActions[$]?z=this.defaultActions[$]:((F===null||typeof F>"u")&&(F=P()),z=w[$]&&w[$][F]),typeof z>"u"||!z.length||!z[0]){var H="";Z=[];for(ie in w[$])this.terminals_[ie]&&ie>A&&Z.push("'"+this.terminals_[ie]+"'");N.showPosition?H="Parse error on line "+(T+1)+`: +`+N.showPosition()+` +Expecting `+Z.join(", ")+", got '"+(this.terminals_[F]||F)+"'":H="Parse error on line "+(T+1)+": Unexpected "+(F==L?"end of input":"'"+(this.terminals_[F]||F)+"'"),this.parseError(H,{text:N.match,token:this.terminals_[F]||F,line:N.yylineno,loc:C,expected:Z})}if(z[0]instanceof Array&&z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+F);switch(z[0]){case 1:y.push(F),x.push(N.yytext),b.push(N.yylloc),y.push(z[1]),F=null,B?(F=B,B=null):(E=N.yyleng,S=N.yytext,T=N.yylineno,C=N.yylloc,_>0&&_--);break;case 2:if(j=this.productions_[z[1]][1],X.$=x[x.length-j],X._$={first_line:b[b.length-(j||1)].first_line,last_line:b[b.length-1].last_line,first_column:b[b.length-(j||1)].first_column,last_column:b[b.length-1].last_column},O&&(X._$.range=[b[b.length-(j||1)].range[0],b[b.length-1].range[1]]),Q=this.performAction.apply(X,[S,E,T,k.yy,z[1],x,b].concat(M)),typeof Q<"u")return Q;j&&(y=y.slice(0,-1*j*2),x=x.slice(0,-1*j),b=b.slice(0,-1*j)),y.push(this.productions_[z[1]][0]),x.push(X.$),b.push(X._$),J=w[y[y.length-2]][y[y.length-1]],y.push(J);break;case 3:return!0}}return!0},"parse")},f=function(){var p={EOF:1,parseError:o(function(g,y){if(this.yy.parser)this.yy.parser.parseError(g,y);else throw new Error(g)},"parseError"),setInput:o(function(m,g){return this.yy=g||this.yy||{},this._input=m,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var g=m.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),m},"input"),unput:o(function(m){var g=m.length,y=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var v=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),y.length-1&&(this.yylineno-=y.length-1);var x=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:y?(y.length===v.length?this.yylloc.first_column:0)+v[v.length-y.length].length-y[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(m){this.unput(this.match.slice(m))},"less"),pastInput:o(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var m=this.pastInput(),g=new Array(m.length+1).join("-");return m+this.upcomingInput()+` +`+g+"^"},"showPosition"),test_match:o(function(m,g){var y,v,x;if(this.options.backtrack_lexer&&(x={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},this.options.ranges&&(x.yylloc.range=this.yylloc.range.slice(0))),v=m[0].match(/(?:\r\n?|\n).*/g),v&&(this.yylineno+=v.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:v?v[v.length-1].length-v[v.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+m[0].length},this.yytext+=m[0],this.match+=m[0],this.matches=m,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(m[0].length),this.matched+=m[0],y=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),y)return y;if(this._backtrack){for(var b in x)this[b]=x[b];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var m,g,y,v;this._more||(this.yytext="",this.match="");for(var x=this._currentRules(),b=0;bg[0].length)){if(g=y,v=b,this.options.backtrack_lexer){if(m=this.test_match(y,x[b]),m!==!1)return m;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(m=this.test_match(g,x[v]),m!==!1?m:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var g=this.next();return g||this.lex()},"lex"),begin:o(function(g){this.conditionStack.push(g)},"begin"),popState:o(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:o(function(g){this.begin(g)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(g,y,v,x){var b=x;switch(v){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:return this.begin("acc_title"),12;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.begin("acc_descr"),14;break;case 10:return this.popState(),"acc_descr_value";break;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"}},"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:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18],inclusive:!0}}};return p}();h.lexer=f;function d(){this.yy={}}return o(d,"Parser"),d.prototype=h,h.Parser=d,new d}();dP.parser=dP;_de=dP});var mP={};hr(mP,{addEvent:()=>Fde,addSection:()=>Ide,addTask:()=>Bde,addTaskOrg:()=>zde,clear:()=>Mde,default:()=>KUe,getCommonDb:()=>Nde,getSections:()=>Ode,getTasks:()=>Pde});var Yg,Rde,pP,e6,Wg,Nde,Mde,Ide,Ode,Pde,Bde,Fde,zde,Dde,KUe,Gde=R(()=>{"use strict";bi();Yg="",Rde=0,pP=[],e6=[],Wg=[],Nde=o(()=>ly,"getCommonDb"),Mde=o(function(){pP.length=0,e6.length=0,Yg="",Wg.length=0,vr()},"clear"),Ide=o(function(t){Yg=t,pP.push(t)},"addSection"),Ode=o(function(){return pP},"getSections"),Pde=o(function(){let t=Dde(),e=100,r=0;for(;!t&&rr.id===Rde-1).events.push(t)},"addEvent"),zde=o(function(t){let e={section:Yg,type:Yg,description:t,task:t,classes:[]};e6.push(e)},"addTaskOrg"),Dde=o(function(){let t=o(function(r){return Wg[r].processed},"compileTask"),e=!0;for(let[r,n]of Wg.entries())t(r),e=e&&n.processed;return e},"compileTasks"),KUe={clear:Mde,getCommonDb:Nde,addSection:Ide,getSections:Ode,getTasks:Pde,addTask:Bde,addTaskOrg:zde,addEvent:Fde}});function Hde(t,e){t.each(function(){var r=$e(this),n=r.text().split(/(\s+|
    )/).reverse(),i,a=[],s=1.1,l=r.attr("y"),u=parseFloat(r.attr("dy")),h=r.text(null).append("tspan").attr("x",0).attr("y",l).attr("dy",u+"em");for(let f=0;fe||i==="
    ")&&(a.pop(),h.text(a.join(" ").trim()),i==="
    "?a=[""]:a=[i],h=r.append("tspan").attr("x",0).attr("y",l).attr("dy",s+"em").text(i))})}var QUe,t6,ZUe,JUe,Vde,eHe,tHe,$de,rHe,nHe,iHe,gP,Ude,aHe,sHe,oHe,lHe,xf,Yde=R(()=>{"use strict";Zt();QUe=12,t6=o(function(t,e){let r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.class!==void 0&&r.attr("class",e.class),r},"drawRect"),ZUe=o(function(t,e){let n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(u){let h=bl().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);u.append("path").attr("class","mouth").attr("d",h).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}o(a,"smile");function s(u){let h=bl().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);u.append("path").attr("class","mouth").attr("d",h).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}o(s,"sad");function l(u){u.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return o(l,"ambivalent"),e.score>3?a(i):e.score<3?s(i):l(i),n},"drawFace"),JUe=o(function(t,e){let r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),Vde=o(function(t,e){let r=e.text.replace(//gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class!==void 0&&n.attr("class",e.class);let i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),eHe=o(function(t,e){function r(i,a,s,l,u){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+l-u)+" "+(i+s-u*1.2)+","+(a+l)+" "+i+","+(a+l)}o(r,"genPoints");let n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,Vde(t,e)},"drawLabel"),tHe=o(function(t,e,r){let n=t.append("g"),i=gP();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width,i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,t6(n,i),Ude(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),$de=-1,rHe=o(function(t,e,r){let n=e.x+r.width/2,i=t.append("g");$de++;let a=300+5*30;i.append("line").attr("id","task"+$de).attr("x1",n).attr("y1",e.y).attr("x2",n).attr("y2",a).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),ZUe(i,{cx:n,cy:300+(5-e.score)*30,score:e.score});let s=gP();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=r.width,s.height=r.height,s.class="task task-type-"+e.num,s.rx=3,s.ry=3,t6(i,s),Ude(r)(e.task,i,s.x,s.y,s.width,s.height,{class:"task"},r,e.colour)},"drawTask"),nHe=o(function(t,e){t6(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),iHe=o(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),gP=o(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Ude=function(){function t(i,a,s,l,u,h,f,d){let p=a.append("text").attr("x",s+u/2).attr("y",l+h/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(p,f)}o(t,"byText");function e(i,a,s,l,u,h,f,d,p){let{taskFontSize:m,taskFontFamily:g}=d,y=i.split(//gi);for(let v=0;v{"use strict";Zt();Yde();ut();_t();Yn();cHe=o(function(t,e,r,n){let i=de(),a=i.leftMargin??50;V.debug("timeline",n.db);let s=i.securityLevel,l;s==="sandbox"&&(l=$e("#i"+e));let h=(s==="sandbox"?$e(l.nodes()[0].contentDocument.body):$e("body")).select("#"+e);h.append("g");let f=n.db.getTasks(),d=n.db.getCommonDb().getDiagramTitle();V.debug("task",f),xf.initGraphics(h);let p=n.db.getSections();V.debug("sections",p);let m=0,g=0,y=0,v=0,x=50+a,b=50;v=50;let w=0,S=!0;p.forEach(function(L){let M={number:w,descr:L,section:w,width:150,padding:20,maxHeight:m},N=xf.getVirtualNodeHeight(h,M,i);V.debug("sectionHeight before draw",N),m=Math.max(m,N+20)});let T=0,E=0;V.debug("tasks.length",f.length);for(let[L,M]of f.entries()){let N={number:L,descr:M,section:M.section,width:150,padding:20,maxHeight:g},k=xf.getVirtualNodeHeight(h,N,i);V.debug("taskHeight before draw",k),g=Math.max(g,k+20),T=Math.max(T,M.events.length);let I=0;for(let C of M.events){let O={descr:C,section:M.section,number:M.section,width:150,padding:20,maxHeight:50};I+=xf.getVirtualNodeHeight(h,O,i)}E=Math.max(E,I)}V.debug("maxSectionHeight before draw",m),V.debug("maxTaskHeight before draw",g),p&&p.length>0?p.forEach(L=>{let M=f.filter(C=>C.section===L),N={number:w,descr:L,section:w,width:200*Math.max(M.length,1)-50,padding:20,maxHeight:m};V.debug("sectionNode",N);let k=h.append("g"),I=xf.drawNode(k,N,w,i);V.debug("sectionNode output",I),k.attr("transform",`translate(${x}, ${v})`),b+=m+50,M.length>0&&Wde(h,M,w,x,b,g,i,T,E,m,!1),x+=200*Math.max(M.length,1),b=v,w++}):(S=!1,Wde(h,f,w,x,b,g,i,T,E,m,!0));let _=h.node().getBBox();V.debug("bounds",_),d&&h.append("text").text(d).attr("x",_.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),y=S?m+g+150:g+100,h.append("g").attr("class","lineWrapper").append("line").attr("x1",a).attr("y1",y).attr("x2",_.width+3*a).attr("y2",y).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),Lo(void 0,h,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},"draw"),Wde=o(function(t,e,r,n,i,a,s,l,u,h,f){for(let d of e){let p={descr:d.task,section:r,number:r,width:150,padding:20,maxHeight:a};V.debug("taskNode",p);let m=t.append("g").attr("class","taskWrapper"),y=xf.drawNode(m,p,r,s).height;if(V.debug("taskHeight after draw",y),m.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,y),d.events){let v=t.append("g").attr("class","lineWrapper"),x=a;i+=100,x=x+uHe(t,d.events,r,n,i,s),i-=100,v.append("line").attr("x1",n+190/2).attr("y1",i+a).attr("x2",n+190/2).attr("y2",i+a+(f?a:h)+u+120).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}n=n+200,f&&!s.timeline?.disableMulticolor&&r++}i=i-10},"drawTasks"),uHe=o(function(t,e,r,n,i,a){let s=0,l=i;i=i+100;for(let u of e){let h={descr:u,section:r,number:r,width:150,padding:20,maxHeight:50};V.debug("eventNode",h);let f=t.append("g").attr("class","eventWrapper"),p=xf.drawNode(f,h,r,a).height;s=s+p,f.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,s},"drawEvents"),qde={setConf:o(()=>{},"setConf"),draw:cHe}});var hHe,fHe,jde,Kde=R(()=>{"use strict";al();hHe=o(t=>{let e="";for(let r=0;r"u"&&(ee.yylloc={});var gt=ee.yylloc;Ae.push(gt);var pe=ee.options&&ee.options.ranges;typeof rt.yy.parseError=="function"?this.parseError=rt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Et(){var vt;return vt=ye.pop()||ee.lex()||he,typeof vt!="number"&&(vt instanceof Array&&(ye=vt,vt=ye.pop()),vt=se.symbols_[vt]||vt),vt}for(var wt,jt,At,Bt,cn={},Nn,Ot,oi,kt;;){if(jt=ge[ge.length-1],this.defaultActions[jt]?At=this.defaultActions[jt]:((wt===null||typeof wt>"u")&&(wt=Et()),At=de[jt]&&de[jt][wt]),typeof At>"u"||!At.length||!At[0]){var Dt="";kt=[];for(Nn in de[jt])this.terminals_[Nn]&&Nn>De&&kt.push("'"+this.terminals_[Nn]+"'");ee.showPosition?Dt="Parse error on line "+(te+1)+`: -`+ee.showPosition()+` -Expecting `+kt.join(", ")+", got '"+(this.terminals_[wt]||wt)+"'":Dt="Parse error on line "+(te+1)+": Unexpected "+(wt==he?"end of input":"'"+(this.terminals_[wt]||wt)+"'"),this.parseError(Dt,{text:ee.match,token:this.terminals_[wt]||wt,line:ee.yylineno,loc:gt,expected:kt})}if(At[0]instanceof Array&&At.length>1)throw new Error("Parse Error: multiple actions possible at state: "+jt+", token: "+wt);switch(At[0]){case 1:ge.push(wt),ke.push(ee.yytext),Ae.push(ee.yylloc),ge.push(At[1]),wt=null,xe=ee.yyleng,ve=ee.yytext,te=ee.yylineno,gt=ee.yylloc;break;case 2:if(Ot=this.productions_[At[1]][1],cn.$=ke[ke.length-Ot],cn._$={first_line:Ae[Ae.length-(Ot||1)].first_line,last_line:Ae[Ae.length-1].last_line,first_column:Ae[Ae.length-(Ot||1)].first_column,last_column:Ae[Ae.length-1].last_column},pe&&(cn._$.range=[Ae[Ae.length-(Ot||1)].range[0],Ae[Ae.length-1].range[1]]),Bt=this.performAction.apply(cn,[ve,xe,te,rt.yy,At[1],ke,Ae].concat(Ie)),typeof Bt<"u")return Bt;Ot&&(ge=ge.slice(0,-1*Ot*2),ke=ke.slice(0,-1*Ot),Ae=Ae.slice(0,-1*Ot)),ge.push(this.productions_[At[1]][0]),ke.push(cn.$),Ae.push(cn._$),oi=de[ge[ge.length-2]][ge[ge.length-1]],ge.push(oi);break;case 3:return!0}}return!0}},V=function(){var oe={EOF:1,parseError:function(se,ge){if(this.yy.parser)this.yy.parser.parseError(se,ge);else throw new Error(se)},setInput:function(ce,se){return this.yy=se||this.yy||{},this._input=ce,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var ce=this._input[0];this.yytext+=ce,this.yyleng++,this.offset++,this.match+=ce,this.matched+=ce;var se=ce.match(/(?:\r\n?|\n).*/g);return se?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ce},unput:function(ce){var se=ce.length,ge=ce.split(/(?:\r\n?|\n)/g);this._input=ce+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-se),this.offset-=se;var ye=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),ge.length-1&&(this.yylineno-=ge.length-1);var ke=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:ge?(ge.length===ye.length?this.yylloc.first_column:0)+ye[ye.length-ge.length].length-ge[0].length:this.yylloc.first_column-se},this.options.ranges&&(this.yylloc.range=[ke[0],ke[0]+this.yyleng-se]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(ce){this.unput(this.match.slice(ce))},pastInput:function(){var ce=this.matched.substr(0,this.matched.length-this.match.length);return(ce.length>20?"...":"")+ce.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var ce=this.match;return ce.length<20&&(ce+=this._input.substr(0,20-ce.length)),(ce.substr(0,20)+(ce.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var ce=this.pastInput(),se=new Array(ce.length+1).join("-");return ce+this.upcomingInput()+` -`+se+"^"},test_match:function(ce,se){var ge,ye,ke;if(this.options.backtrack_lexer&&(ke={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},this.options.ranges&&(ke.yylloc.range=this.yylloc.range.slice(0))),ye=ce[0].match(/(?:\r\n?|\n).*/g),ye&&(this.yylineno+=ye.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ye?ye[ye.length-1].length-ye[ye.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+ce[0].length},this.yytext+=ce[0],this.match+=ce[0],this.matches=ce,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(ce[0].length),this.matched+=ce[0],ge=this.performAction.call(this,this.yy,this,se,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ge)return ge;if(this._backtrack){for(var Ae in ke)this[Ae]=ke[Ae];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var ce,se,ge,ye;this._more||(this.yytext="",this.match="");for(var ke=this._currentRules(),Ae=0;Aese[0].length)){if(se=ge,ye=Ae,this.options.backtrack_lexer){if(ce=this.test_match(ge,ke[Ae]),ce!==!1)return ce;if(this._backtrack){se=!1;continue}else return!1}else if(!this.options.flex)break}return se?(ce=this.test_match(se,ke[ye]),ce!==!1?ce:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var se=this.next();return se||this.lex()},begin:function(se){this.conditionStack.push(se)},popState:function(){var se=this.conditionStack.length-1;return se>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(se){return se=this.conditionStack.length-1-Math.abs(se||0),se>=0?this.conditionStack[se]:"INITIAL"},pushState:function(se){this.begin(se)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(se,ge,ye,ke){switch(ye){case 0:return this.begin("open_directive"),28;case 1:return this.begin("type_directive"),29;case 2:return this.popState(),this.begin("arg_directive"),15;case 3:return this.popState(),this.popState(),31;case 4:return 30;case 5:break;case 6:break;case 7:return 11;case 8:break;case 9:break;case 10:return 4;case 11:return 17;case 12:return this.begin("acc_title"),18;case 13:return this.popState(),"acc_title_value";case 14:return this.begin("acc_descr"),20;case 15:return this.popState(),"acc_descr_value";case 16:this.begin("acc_descr_multiline");break;case 17:this.popState();break;case 18:return"acc_descr_multiline_value";case 19:return 23;case 20:return 27;case 21:return 26;case 22:return 6;case 23:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\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:{open_directive:{rules:[1],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},acc_descr_multiline:{rules:[17,18],inclusive:!1},acc_descr:{rules:[15],inclusive:!1},acc_title:{rules:[13],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,9,10,11,12,14,16,19,20,21,22,23],inclusive:!0}}};return oe}();$.lexer=V;function Q(){this.yy={}}return Q.prototype=$,$.Parser=Q,new Q}();Dge.parser=Dge;const sqt=Dge;let gL="",UFe=0;const Ige=[],WK=[],pL=[],WFe=()=>kIe,KFe=(i,a,f)=>{rde(globalThis,i,a,f)},YFe=function(){Ige.length=0,WK.length=0,gL="",pL.length=0,rp()},XFe=function(i){gL=i,Ige.push(i)},QFe=function(){return Ige},ZFe=function(){let i=nje();const a=100;let f=0;for(;!i&&ff.id===UFe-1).events.push(i)},tje=function(i){const a={section:gL,type:gL,description:i,task:i,classes:[]};WK.push(a)},nje=function(){const i=function(f){return pL[f].processed};let a=!0;for(const[f,p]of pL.entries())i(f),a=a&&p.processed;return a},aqt=Object.freeze(Object.defineProperty({__proto__:null,addEvent:eje,addSection:XFe,addTask:JFe,addTaskOrg:tje,clear:YFe,default:{clear:YFe,getCommonDb:WFe,addSection:XFe,getSections:QFe,getTasks:ZFe,addTask:JFe,addTaskOrg:tje,addEvent:eje,parseDirective:KFe},getCommonDb:WFe,getSections:QFe,getTasks:ZFe,parseDirective:KFe},Symbol.toStringTag,{value:"Module"})),oqt=12,KK=function(i,a){const f=i.append("rect");return f.attr("x",a.x),f.attr("y",a.y),f.attr("fill",a.fill),f.attr("stroke",a.stroke),f.attr("width",a.width),f.attr("height",a.height),f.attr("rx",a.rx),f.attr("ry",a.ry),a.class!==void 0&&f.attr("class",a.class),f},cqt=function(i,a){const p=i.append("circle").attr("cx",a.cx).attr("cy",a.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),w=i.append("g");w.append("circle").attr("cx",a.cx-15/3).attr("cy",a.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),w.append("circle").attr("cx",a.cx+15/3).attr("cy",a.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function y(S){const N=CA().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);S.append("path").attr("class","mouth").attr("d",N).attr("transform","translate("+a.cx+","+(a.cy+2)+")")}function b(S){const N=CA().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);S.append("path").attr("class","mouth").attr("d",N).attr("transform","translate("+a.cx+","+(a.cy+7)+")")}function E(S){S.append("line").attr("class","mouth").attr("stroke",2).attr("x1",a.cx-5).attr("y1",a.cy+7).attr("x2",a.cx+5).attr("y2",a.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return a.score>3?y(w):a.score<3?b(w):E(w),p},uqt=function(i,a){const f=i.append("circle");return f.attr("cx",a.cx),f.attr("cy",a.cy),f.attr("class","actor-"+a.pos),f.attr("fill",a.fill),f.attr("stroke",a.stroke),f.attr("r",a.r),f.class!==void 0&&f.attr("class",f.class),a.title!==void 0&&f.append("title").text(a.title),f},rje=function(i,a){const f=a.text.replace(//gi," "),p=i.append("text");p.attr("x",a.x),p.attr("y",a.y),p.attr("class","legend"),p.style("text-anchor",a.anchor),a.class!==void 0&&p.attr("class",a.class);const w=p.append("tspan");return w.attr("x",a.x+a.textMargin*2),w.text(f),p},lqt=function(i,a){function f(w,y,b,E,S){return w+","+y+" "+(w+b)+","+y+" "+(w+b)+","+(y+E-S)+" "+(w+b-S*1.2)+","+(y+E)+" "+w+","+(y+E)}const p=i.append("polygon");p.attr("points",f(a.x,a.y,50,20,7)),p.attr("class","labelBox"),a.y=a.y+a.labelMargin,a.x=a.x+.5*a.labelMargin,rje(i,a)},hqt=function(i,a,f){const p=i.append("g"),w=Oge();w.x=a.x,w.y=a.y,w.fill=a.fill,w.width=f.width,w.height=f.height,w.class="journey-section section-type-"+a.num,w.rx=3,w.ry=3,KK(p,w),sje(f)(a.text,p,w.x,w.y,w.width,w.height,{class:"journey-section section-type-"+a.num},f,a.colour)};let ije=-1;const fqt=function(i,a,f){const p=a.x+f.width/2,w=i.append("g");ije++;const y=300+5*30;w.append("line").attr("id","task"+ije).attr("x1",p).attr("y1",a.y).attr("x2",p).attr("y2",y).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),cqt(w,{cx:p,cy:300+(5-a.score)*30,score:a.score});const b=Oge();b.x=a.x,b.y=a.y,b.fill=a.fill,b.width=f.width,b.height=f.height,b.class="task task-type-"+a.num,b.rx=3,b.ry=3,KK(w,b),a.x+14,sje(f)(a.task,w,b.x,b.y,b.width,b.height,{class:"task"},f,a.colour)},dqt=function(i,a){KK(i,{x:a.startx,y:a.starty,width:a.stopx-a.startx,height:a.stopy-a.starty,fill:a.fill,class:"rect"}).lower()},gqt=function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},Oge=function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},sje=function(){function i(w,y,b,E,S,N,B,R){const j=y.append("text").attr("x",b+S/2).attr("y",E+N/2+5).style("font-color",R).style("text-anchor","middle").text(w);p(j,B)}function a(w,y,b,E,S,N,B,R,j){const{taskFontSize:$,taskFontFamily:V}=R,Q=w.split(//gi);for(let oe=0;oe)/).reverse(),w,y=[],b=1.1,E=f.attr("y"),S=parseFloat(f.attr("dy")),N=f.text(null).append("tspan").attr("x",0).attr("y",E).attr("dy",S+"em");for(let B=0;Ba||w==="
    ")&&(y.pop(),N.text(y.join(" ").trim()),w==="
    "?y=[""]:y=[w],N=f.append("tspan").attr("x",0).attr("y",E).attr("dy",b+"em").text(w))})}const bqt=function(i,a,f,p){const w=f%oqt-1,y=i.append("g");a.section=w,y.attr("class",(a.class?a.class+" ":"")+"timeline-node "+("section-"+w));const b=y.append("g"),E=y.append("g"),N=E.append("text").text(a.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(aje,a.width).node().getBBox(),B=p.fontSize&&p.fontSize.replace?p.fontSize.replace("px",""):p.fontSize;return a.height=N.height+B*1.1*.5+a.padding,a.height=Math.max(a.height,a.maxHeight),a.width=a.width+2*a.padding,E.attr("transform","translate("+a.width/2+", "+a.padding/2+")"),wqt(b,a,w),a},vqt=function(i,a,f){const p=i.append("g"),y=p.append("text").text(a.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(aje,a.width).node().getBBox(),b=f.fontSize&&f.fontSize.replace?f.fontSize.replace("px",""):f.fontSize;return p.remove(),y.height+b*1.1*.5+a.padding},wqt=function(i,a,f){i.append("path").attr("id","node-"+a.id).attr("class","node-bkg node-"+a.type).attr("d",`M0 ${a.height-5} v${-a.height+2*5} q0,-5 5,-5 h${a.width-2*5} q5,0 5,5 v${a.height-5} H0 Z`),i.append("line").attr("class","node-line-"+f).attr("x1",0).attr("y1",a.height).attr("x2",a.width).attr("y2",a.height)},v9={drawRect:KK,drawCircle:uqt,drawSection:hqt,drawText:rje,drawLabel:lqt,drawTask:fqt,drawBackgroundRect:dqt,getTextObj:gqt,getNoteRect:Oge,initGraphics:pqt,drawNode:bqt,getVirtualNodeHeight:vqt},mqt=function(i,a,f,p){var te,xe,De,he;const w=Tt(),y=w.leftMargin??50;(xe=(te=p.db).clear)==null||xe.call(te),p.parser.parse(i+` -`),Fe.debug("timeline",p.db);const b=w.securityLevel;let E;b==="sandbox"&&(E=Cr("#i"+a));const N=Cr(b==="sandbox"?E.nodes()[0].contentDocument.body:"body").select("#"+a);N.append("g");const B=p.db.getTasks(),R=p.db.getCommonDb().getDiagramTitle();Fe.debug("task",B),v9.initGraphics(N);const j=p.db.getSections();Fe.debug("sections",j);let $=0,V=0,Q=0,oe=0,ce=50+y,se=50;oe=50;let ge=0,ye=!0;j.forEach(function(Ie){const ee={number:ge,descr:Ie,section:ge,width:150,padding:20,maxHeight:$},rt=v9.getVirtualNodeHeight(N,ee,w);Fe.debug("sectionHeight before draw",rt),$=Math.max($,rt+20)});let ke=0,Ae=0;Fe.debug("tasks.length",B.length);for(const[Ie,ee]of B.entries()){const rt={number:Ie,descr:ee,section:ee.section,width:150,padding:20,maxHeight:V},me=v9.getVirtualNodeHeight(N,rt,w);Fe.debug("taskHeight before draw",me),V=Math.max(V,me+20),ke=Math.max(ke,ee.events.length);let gt=0;for(let pe=0;pe0?j.forEach(Ie=>{const ee=B.filter(pe=>pe.section===Ie),rt={number:ge,descr:Ie,section:ge,width:200*Math.max(ee.length,1)-50,padding:20,maxHeight:$};Fe.debug("sectionNode",rt);const me=N.append("g"),gt=v9.drawNode(me,rt,ge,w);Fe.debug("sectionNode output",gt),me.attr("transform",`translate(${ce}, ${oe})`),se+=$+50,ee.length>0&&oje(N,ee,ge,ce,se,V,w,ke,Ae,$,!1),ce+=200*Math.max(ee.length,1),se=oe,ge++}):(ye=!1,oje(N,B,ge,ce,se,V,w,ke,Ae,$,!0));const de=N.node().getBBox();Fe.debug("bounds",de),R&&N.append("text").text(R).attr("x",de.width/2-y).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),Q=ye?$+V+150:V+100,N.append("g").attr("class","lineWrapper").append("line").attr("x1",y).attr("y1",Q).attr("x2",de.width+3*y).attr("y2",Q).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),YE(void 0,N,((De=w.timeline)==null?void 0:De.padding)??50,((he=w.timeline)==null?void 0:he.useMaxWidth)??!1)},oje=function(i,a,f,p,w,y,b,E,S,N,B){var R;for(const j of a){const $={descr:j.task,section:f,number:f,width:150,padding:20,maxHeight:y};Fe.debug("taskNode",$);const V=i.append("g").attr("class","taskWrapper"),oe=v9.drawNode(V,$,f,b).height;if(Fe.debug("taskHeight after draw",oe),V.attr("transform",`translate(${p}, ${w})`),y=Math.max(y,oe),j.events){const ce=i.append("g").attr("class","lineWrapper");let se=y;w+=100,se=se+yqt(i,j.events,f,p,w,b),w-=100,ce.append("line").attr("x1",p+190/2).attr("y1",w+y).attr("x2",p+190/2).attr("y2",w+y+(B?y:N)+S+120).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}p=p+200,B&&!((R=b.timeline)!=null&&R.disableMulticolor)&&f++}w=w-10},yqt=function(i,a,f,p,w,y){let b=0;const E=w;w=w+100;for(const S of a){const N={descr:S,section:f,number:f,width:150,padding:20,maxHeight:50};Fe.debug("eventNode",N);const B=i.append("g").attr("class","eventWrapper"),j=v9.drawNode(B,N,f,y).height;b=b+j,B.attr("transform",`translate(${p}, ${w})`),w=w+10+j}return w=E,b},kqt={setConf:()=>{},draw:mqt},xqt=i=>{let a="";for(let f=0;f` .edge { stroke-width: 3; } - ${xqt(i)} + ${hHe(t)} .section-root rect, .section-root path, .section-root circle { - fill: ${i.git0}; + fill: ${t.git0}; } .section-root text { - fill: ${i.gitBranchLabel0}; + fill: ${t.gitBranchLabel0}; } .icon-container { height:100%; @@ -1510,78 +1822,69 @@ Expecting `+kt.join(", ")+", got '"+(this.terminals_[wt]||wt)+"'":Dt="Parse erro .eventWrapper { filter: brightness(120%); } -`}},Symbol.toStringTag,{value:"Module"}));var Nge=function(){var i=function(ye,ke,Ae,de){for(Ae=Ae||{},de=ye.length;de--;Ae[ye[de]]=ke);return Ae},a=[1,4],f=[1,13],p=[1,12],w=[1,15],y=[1,16],b=[1,20],E=[1,19],S=[6,7,8],N=[1,26],B=[1,24],R=[1,25],j=[6,7,11],$=[1,6,13,15,16,19,22],V=[1,33],Q=[1,34],oe=[1,6,7,11,13,15,16,19,22],ce={trace:function(){},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(ke,Ae,de,ve,te,xe,De){var he=xe.length-1;switch(te){case 6:case 7:return ve;case 8:ve.getLogger().trace("Stop NL ");break;case 9:ve.getLogger().trace("Stop EOF ");break;case 11:ve.getLogger().trace("Stop NL2 ");break;case 12:ve.getLogger().trace("Stop EOF2 ");break;case 15:ve.getLogger().info("Node: ",xe[he].id),ve.addNode(xe[he-1].length,xe[he].id,xe[he].descr,xe[he].type);break;case 16:ve.getLogger().trace("Icon: ",xe[he]),ve.decorateNode({icon:xe[he]});break;case 17:case 21:ve.decorateNode({class:xe[he]});break;case 18:ve.getLogger().trace("SPACELIST");break;case 19:ve.getLogger().trace("Node: ",xe[he].id),ve.addNode(0,xe[he].id,xe[he].descr,xe[he].type);break;case 20:ve.decorateNode({icon:xe[he]});break;case 25:ve.getLogger().trace("node found ..",xe[he-2]),this.$={id:xe[he-1],descr:xe[he-1],type:ve.getType(xe[he-2],xe[he])};break;case 26:this.$={id:xe[he],descr:xe[he],type:ve.nodeType.DEFAULT};break;case 27:ve.getLogger().trace("node found ..",xe[he-3]),this.$={id:xe[he-3],descr:xe[he-1],type:ve.getType(xe[he-2],xe[he])};break}},table:[{3:1,4:2,5:3,6:[1,5],8:a},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:a},{6:f,7:[1,10],9:9,12:11,13:p,14:14,15:w,16:y,17:17,18:18,19:b,22:E},i(S,[2,3]),{1:[2,2]},i(S,[2,4]),i(S,[2,5]),{1:[2,6],6:f,12:21,13:p,14:14,15:w,16:y,17:17,18:18,19:b,22:E},{6:f,9:22,12:11,13:p,14:14,15:w,16:y,17:17,18:18,19:b,22:E},{6:N,7:B,10:23,11:R},i(j,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:b,22:E}),i(j,[2,18]),i(j,[2,19]),i(j,[2,20]),i(j,[2,21]),i(j,[2,23]),i(j,[2,24]),i(j,[2,26],{19:[1,30]}),{20:[1,31]},{6:N,7:B,10:32,11:R},{1:[2,7],6:f,12:21,13:p,14:14,15:w,16:y,17:17,18:18,19:b,22:E},i($,[2,14],{7:V,11:Q}),i(oe,[2,8]),i(oe,[2,9]),i(oe,[2,10]),i(j,[2,15]),i(j,[2,16]),i(j,[2,17]),{20:[1,35]},{21:[1,36]},i($,[2,13],{7:V,11:Q}),i(oe,[2,11]),i(oe,[2,12]),{21:[1,37]},i(j,[2,25]),i(j,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:function(ke,Ae){if(Ae.recoverable)this.trace(ke);else{var de=new Error(ke);throw de.hash=Ae,de}},parse:function(ke){var Ae=this,de=[0],ve=[],te=[null],xe=[],De=this.table,he="",Ie=0,ee=0,rt=2,me=1,gt=xe.slice.call(arguments,1),pe=Object.create(this.lexer),Et={yy:{}};for(var wt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,wt)&&(Et.yy[wt]=this.yy[wt]);pe.setInput(ke,Et.yy),Et.yy.lexer=pe,Et.yy.parser=this,typeof pe.yylloc>"u"&&(pe.yylloc={});var jt=pe.yylloc;xe.push(jt);var At=pe.options&&pe.options.ranges;typeof Et.yy.parseError=="function"?this.parseError=Et.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Bt(){var Lt;return Lt=ve.pop()||pe.lex()||me,typeof Lt!="number"&&(Lt instanceof Array&&(ve=Lt,Lt=ve.pop()),Lt=Ae.symbols_[Lt]||Lt),Lt}for(var cn,Nn,Ot,oi,kt={},Dt,vt,Nt,ze;;){if(Nn=de[de.length-1],this.defaultActions[Nn]?Ot=this.defaultActions[Nn]:((cn===null||typeof cn>"u")&&(cn=Bt()),Ot=De[Nn]&&De[Nn][cn]),typeof Ot>"u"||!Ot.length||!Ot[0]){var Xe="";ze=[];for(Dt in De[Nn])this.terminals_[Dt]&&Dt>rt&&ze.push("'"+this.terminals_[Dt]+"'");pe.showPosition?Xe="Parse error on line "+(Ie+1)+`: -`+pe.showPosition()+` -Expecting `+ze.join(", ")+", got '"+(this.terminals_[cn]||cn)+"'":Xe="Parse error on line "+(Ie+1)+": Unexpected "+(cn==me?"end of input":"'"+(this.terminals_[cn]||cn)+"'"),this.parseError(Xe,{text:pe.match,token:this.terminals_[cn]||cn,line:pe.yylineno,loc:jt,expected:ze})}if(Ot[0]instanceof Array&&Ot.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Nn+", token: "+cn);switch(Ot[0]){case 1:de.push(cn),te.push(pe.yytext),xe.push(pe.yylloc),de.push(Ot[1]),cn=null,ee=pe.yyleng,he=pe.yytext,Ie=pe.yylineno,jt=pe.yylloc;break;case 2:if(vt=this.productions_[Ot[1]][1],kt.$=te[te.length-vt],kt._$={first_line:xe[xe.length-(vt||1)].first_line,last_line:xe[xe.length-1].last_line,first_column:xe[xe.length-(vt||1)].first_column,last_column:xe[xe.length-1].last_column},At&&(kt._$.range=[xe[xe.length-(vt||1)].range[0],xe[xe.length-1].range[1]]),oi=this.performAction.apply(kt,[he,ee,Ie,Et.yy,Ot[1],te,xe].concat(gt)),typeof oi<"u")return oi;vt&&(de=de.slice(0,-1*vt*2),te=te.slice(0,-1*vt),xe=xe.slice(0,-1*vt)),de.push(this.productions_[Ot[1]][0]),te.push(kt.$),xe.push(kt._$),Nt=De[de[de.length-2]][de[de.length-1]],de.push(Nt);break;case 3:return!0}}return!0}},se=function(){var ye={EOF:1,parseError:function(Ae,de){if(this.yy.parser)this.yy.parser.parseError(Ae,de);else throw new Error(Ae)},setInput:function(ke,Ae){return this.yy=Ae||this.yy||{},this._input=ke,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var ke=this._input[0];this.yytext+=ke,this.yyleng++,this.offset++,this.match+=ke,this.matched+=ke;var Ae=ke.match(/(?:\r\n?|\n).*/g);return Ae?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ke},unput:function(ke){var Ae=ke.length,de=ke.split(/(?:\r\n?|\n)/g);this._input=ke+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ae),this.offset-=Ae;var ve=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),de.length-1&&(this.yylineno-=de.length-1);var te=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:de?(de.length===ve.length?this.yylloc.first_column:0)+ve[ve.length-de.length].length-de[0].length:this.yylloc.first_column-Ae},this.options.ranges&&(this.yylloc.range=[te[0],te[0]+this.yyleng-Ae]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(ke){this.unput(this.match.slice(ke))},pastInput:function(){var ke=this.matched.substr(0,this.matched.length-this.match.length);return(ke.length>20?"...":"")+ke.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var ke=this.match;return ke.length<20&&(ke+=this._input.substr(0,20-ke.length)),(ke.substr(0,20)+(ke.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var ke=this.pastInput(),Ae=new Array(ke.length+1).join("-");return ke+this.upcomingInput()+` -`+Ae+"^"},test_match:function(ke,Ae){var de,ve,te;if(this.options.backtrack_lexer&&(te={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},this.options.ranges&&(te.yylloc.range=this.yylloc.range.slice(0))),ve=ke[0].match(/(?:\r\n?|\n).*/g),ve&&(this.yylineno+=ve.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ve?ve[ve.length-1].length-ve[ve.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+ke[0].length},this.yytext+=ke[0],this.match+=ke[0],this.matches=ke,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(ke[0].length),this.matched+=ke[0],de=this.performAction.call(this,this.yy,this,Ae,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),de)return de;if(this._backtrack){for(var xe in te)this[xe]=te[xe];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var ke,Ae,de,ve;this._more||(this.yytext="",this.match="");for(var te=this._currentRules(),xe=0;xeAe[0].length)){if(Ae=de,ve=xe,this.options.backtrack_lexer){if(ke=this.test_match(de,te[xe]),ke!==!1)return ke;if(this._backtrack){Ae=!1;continue}else return!1}else if(!this.options.flex)break}return Ae?(ke=this.test_match(Ae,te[ve]),ke!==!1?ke:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var Ae=this.next();return Ae||this.lex()},begin:function(Ae){this.conditionStack.push(Ae)},popState:function(){var Ae=this.conditionStack.length-1;return Ae>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(Ae){return Ae=this.conditionStack.length-1-Math.abs(Ae||0),Ae>=0?this.conditionStack[Ae]:"INITIAL"},pushState:function(Ae){this.begin(Ae)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(Ae,de,ve,te){switch(ve){case 0:return Ae.getLogger().trace("Found comment",de.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:Ae.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return Ae.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:Ae.getLogger().trace("end icon"),this.popState();break;case 10:return Ae.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return Ae.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return Ae.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return Ae.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),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:Ae.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return Ae.getLogger().trace("description:",de.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),Ae.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),Ae.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),Ae.getLogger().trace("node end ...",de.yytext),"NODE_DEND";case 30:return this.popState(),Ae.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),Ae.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),Ae.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),Ae.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),Ae.getLogger().trace("node end (("),"NODE_DEND";case 35:return Ae.getLogger().trace("Long description:",de.yytext),20;case 36:return Ae.getLogger().trace("Long description:",de.yytext),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:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return ye}();ce.lexer=se;function ge(){this.yy={}}return ge.prototype=ce,ce.Parser=ge,new ge}();Nge.parser=Nge;const Tqt=Nge,zP=i=>ep(i,Tt());let Jb=[],cje=0,Pge={};const _qt=()=>{Jb=[],cje=0,Pge={}},Cqt=function(i){for(let a=Jb.length-1;a>=0;a--)if(Jb[a].levelJb.length>0?Jb[0]:null,Aqt=(i,a,f,p)=>{Fe.info("addNode",i,a,f,p);const w=Tt(),y={id:cje++,nodeId:zP(a),level:i,descr:zP(f),type:p,children:[],width:Tt().mindmap.maxNodeWidth};switch(y.type){case nl.ROUNDED_RECT:y.padding=2*w.mindmap.padding;break;case nl.RECT:y.padding=2*w.mindmap.padding;break;case nl.HEXAGON:y.padding=2*w.mindmap.padding;break;default:y.padding=w.mindmap.padding}const b=Cqt(i);if(b)b.children.push(y),Jb.push(y);else if(Jb.length===0)Jb.push(y);else{let E=new Error('There can be only one root. No parent could be found for ("'+y.descr+'")');throw E.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+'"']},E}},nl={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Lqt=(i,a)=>{switch(Fe.debug("In get type",i,a),i){case"[":return nl.RECT;case"(":return a===")"?nl.ROUNDED_RECT:nl.CLOUD;case"((":return nl.CIRCLE;case")":return nl.CLOUD;case"))":return nl.BANG;case"{{":return nl.HEXAGON;default:return nl.DEFAULT}},uje=(i,a)=>{Pge[i]=a},Mqt=i=>{const a=Jb[Jb.length-1];i&&i.icon&&(a.icon=zP(i.icon)),i&&i.class&&(a.class=zP(i.class))},w9=i=>{switch(i){case nl.DEFAULT:return"no-border";case nl.RECT:return"rect";case nl.ROUNDED_RECT:return"rounded-rect";case nl.CIRCLE:return"circle";case nl.CLOUD:return"cloud";case nl.BANG:return"bang";case nl.HEXAGON:return"hexgon";default:return"no-border"}};let lje;const Dqt=i=>{lje=i},Iqt=()=>Fe,Oqt=i=>Jb[i],Bge=i=>Pge[i],Nqt=Object.freeze(Object.defineProperty({__proto__:null,addNode:Aqt,clear:_qt,decorateNode:Mqt,getElementById:Bge,getLogger:Iqt,getMindmap:Sqt,getNodeById:Oqt,getType:Lqt,nodeType:nl,get parseError(){return lje},sanitizeText:zP,setElementForId:uje,setErrorHandler:Dqt,type2Str:w9},Symbol.toStringTag,{value:"Module"})),hje=12,Pqt=function(i,a,f){i.append("path").attr("id","node-"+a.id).attr("class","node-bkg node-"+w9(a.type)).attr("d",`M0 ${a.height-5} v${-a.height+2*5} q0,-5 5,-5 h${a.width-2*5} q5,0 5,5 v${a.height-5} H0 Z`),i.append("line").attr("class","node-line-"+f).attr("x1",0).attr("y1",a.height).attr("x2",a.width).attr("y2",a.height)},Bqt=function(i,a){i.append("rect").attr("id","node-"+a.id).attr("class","node-bkg node-"+w9(a.type)).attr("height",a.height).attr("width",a.width)},Rqt=function(i,a){const f=a.width,p=a.height,w=.15*f,y=.25*f,b=.35*f,E=.2*f;i.append("path").attr("id","node-"+a.id).attr("class","node-bkg node-"+w9(a.type)).attr("d",`M0 0 a${w},${w} 0 0,1 ${f*.25},${-1*f*.1} - a${b},${b} 1 0,1 ${f*.4},${-1*f*.1} - a${y},${y} 1 0,1 ${f*.35},${1*f*.2} - - a${w},${w} 1 0,1 ${f*.15},${1*p*.35} - a${E},${E} 1 0,1 ${-1*f*.15},${1*p*.65} - - a${y},${w} 1 0,1 ${-1*f*.25},${f*.15} - a${b},${b} 1 0,1 ${-1*f*.5},0 - a${w},${w} 1 0,1 ${-1*f*.25},${-1*f*.15} - - a${w},${w} 1 0,1 ${-1*f*.1},${-1*p*.35} - a${E},${E} 1 0,1 ${f*.1},${-1*p*.65} - - H0 V0 Z`)},Fqt=function(i,a){const f=a.width,p=a.height,w=.15*f;i.append("path").attr("id","node-"+a.id).attr("class","node-bkg node-"+w9(a.type)).attr("d",`M0 0 a${w},${w} 1 0,0 ${f*.25},${-1*p*.1} - a${w},${w} 1 0,0 ${f*.25},0 - a${w},${w} 1 0,0 ${f*.25},0 - a${w},${w} 1 0,0 ${f*.25},${1*p*.1} - - a${w},${w} 1 0,0 ${f*.15},${1*p*.33} - a${w*.8},${w*.8} 1 0,0 0,${1*p*.34} - a${w},${w} 1 0,0 ${-1*f*.15},${1*p*.33} - - a${w},${w} 1 0,0 ${-1*f*.25},${p*.15} - a${w},${w} 1 0,0 ${-1*f*.25},0 - a${w},${w} 1 0,0 ${-1*f*.25},0 - a${w},${w} 1 0,0 ${-1*f*.25},${-1*p*.15} - - a${w},${w} 1 0,0 ${-1*f*.1},${-1*p*.33} - a${w*.8},${w*.8} 1 0,0 0,${-1*p*.34} - a${w},${w} 1 0,0 ${f*.1},${-1*p*.33} - - H0 V0 Z`)},jqt=function(i,a){i.append("circle").attr("id","node-"+a.id).attr("class","node-bkg node-"+w9(a.type)).attr("r",a.width/2)};function $qt(i,a,f,p,w){return i.insert("polygon",":first-child").attr("points",p.map(function(y){return y.x+","+y.y}).join(" ")).attr("transform","translate("+(w.width-a)/2+", "+f+")")}const Hqt=function(i,a){const f=a.height,w=f/4,y=a.width-a.padding+2*w,b=[{x:w,y:0},{x:y-w,y:0},{x:y,y:-f/2},{x:y-w,y:-f},{x:w,y:-f},{x:0,y:-f/2}];$qt(i,y,f,b,a)},zqt=function(i,a){i.append("rect").attr("id","node-"+a.id).attr("class","node-bkg node-"+w9(a.type)).attr("height",a.height).attr("rx",a.padding).attr("ry",a.padding).attr("width",a.width)},fje={drawNode:function(i,a,f,p){const w=p.htmlLabels,y=f%(hje-1),b=i.append("g");a.section=y;let E="section-"+y;y<0&&(E+=" section-root"),b.attr("class",(a.class?a.class+" ":"")+"mindmap-node "+E);const S=b.append("g"),N=b.append("g"),B=a.descr.replace(/()/g,` -`);dK(N,B,{useHtmlLabels:w,width:a.width,classes:"mindmap-node-label"}),w||N.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");const R=N.node().getBBox(),j=p.fontSize.replace?p.fontSize.replace("px",""):p.fontSize;if(a.height=R.height+j*1.1*.5+a.padding,a.width=R.width+2*a.padding,a.icon)if(a.type===nl.CIRCLE)a.height+=50,a.width+=50,b.append("foreignObject").attr("height","50px").attr("width",a.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+y+" "+a.icon),N.attr("transform","translate("+a.width/2+", "+(a.height/2-1.5*a.padding)+")");else{a.width+=50;const $=a.height;a.height=Math.max($,60);const V=Math.abs(a.height-$);b.append("foreignObject").attr("width","60px").attr("height",a.height).attr("style","text-align: center;margin-top:"+V/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+y+" "+a.icon),N.attr("transform","translate("+(25+a.width/2)+", "+(V/2+a.padding/2)+")")}else if(w){const $=(a.width-R.width)/2,V=(a.height-R.height)/2;N.attr("transform","translate("+$+", "+V+")")}else{const $=a.width/2,V=a.padding/2;N.attr("transform","translate("+$+", "+V+")")}switch(a.type){case nl.DEFAULT:Pqt(S,a,y);break;case nl.ROUNDED_RECT:zqt(S,a);break;case nl.RECT:Bqt(S,a);break;case nl.CIRCLE:S.attr("transform","translate("+a.width/2+", "+ +a.height/2+")"),jqt(S,a);break;case nl.CLOUD:Rqt(S,a);break;case nl.BANG:Fqt(S,a);break;case nl.HEXAGON:Hqt(S,a);break}return uje(a.id,b),a.height},positionNode:function(i){const a=Bge(i.id),f=i.x||0,p=i.y||0;a.attr("transform","translate("+f+","+p+")")},drawEdge:function(a,f,p,w,y){const b=y%(hje-1),E=p.x+p.width/2,S=p.y+p.height/2,N=f.x+f.width/2,B=f.y+f.height/2,R=N>E?E+Math.abs(E-N)/2:E-Math.abs(E-N)/2,j=B>S?S+Math.abs(S-B)/2:S-Math.abs(S-B)/2,$=N>E?Math.abs(E-R)/2+E:-Math.abs(E-R)/2+E,V=B>S?Math.abs(S-j)/2+S:-Math.abs(S-j)/2+S;a.append("path").attr("d",p.direction==="TB"||p.direction==="BT"?`M${E},${S} Q${E},${V} ${R},${j} T${N},${B}`:`M${E},${S} Q${$},${S} ${R},${j} T${N},${B}`).attr("class","edge section-edge-"+b+" edge-depth-"+w)}};var Rge={},Gqt={get exports(){return Rge},set exports(i){Rge=i}};(function(i,a){(function(f,p){i.exports=p()})(Wk,function(){function f(m){return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},f(m)}function p(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function w(m,g){for(var k=0;km.length)&&(g=m.length);for(var k=0,T=new Array(g);k"u"?null:window,V=$?$.navigator:null;$&&$.document;var Q=f(""),oe=f({}),ce=f(function(){}),se=typeof HTMLElement>"u"?"undefined":f(HTMLElement),ge=function(g){return g&&g.instanceString&&ke(g.instanceString)?g.instanceString():null},ye=function(g){return g!=null&&f(g)==Q},ke=function(g){return g!=null&&f(g)===ce},Ae=function(g){return!he(g)&&(Array.isArray?Array.isArray(g):g!=null&&g instanceof Array)},de=function(g){return g!=null&&f(g)===oe&&!Ae(g)&&g.constructor===Object},ve=function(g){return g!=null&&f(g)===oe},te=function(g){return g!=null&&f(g)===f(1)&&!isNaN(g)},xe=function(g){return te(g)&&Math.floor(g)===g},De=function(g){if(se!=="undefined")return g!=null&&g instanceof HTMLElement},he=function(g){return Ie(g)||ee(g)},Ie=function(g){return ge(g)==="collection"&&g._private.single},ee=function(g){return ge(g)==="collection"&&!g._private.single},rt=function(g){return ge(g)==="core"},me=function(g){return ge(g)==="stylesheet"},gt=function(g){return ge(g)==="event"},pe=function(g){return g==null?!0:!!(g===""||g.match(/^\s+$/))},Et=function(g){return typeof HTMLElement>"u"?!1:g instanceof HTMLElement},wt=function(g){return de(g)&&te(g.x1)&&te(g.x2)&&te(g.y1)&&te(g.y2)},jt=function(g){return ve(g)&&ke(g.then)},At=function(){return V&&V.userAgent.match(/msie|trident|edge/i)},Bt=function(g,k){k||(k=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var D=[],I=0;Ik?1:0},Bn=function(g,k){return-1*Ge(g,k)},Oe=Object.assign!=null?Object.assign.bind(Object):function(m){for(var g=arguments,k=1;k1&&(_e-=1),_e<1/6?ae+(ue-ae)*6*_e:_e<1/2?ue:_e<2/3?ae+(ue-ae)*(2/3-_e)*6:ae}var U=new RegExp("^"+Nt+"$").exec(g);if(U){if(T=parseInt(U[1]),T<0?T=(360- -1*T%360)%360:T>360&&(T=T%360),T/=360,A=parseFloat(U[2]),A<0||A>100||(A=A/100,D=parseFloat(U[3]),D<0||D>100)||(D=D/100,I=U[4],I!==void 0&&(I=parseFloat(I),I<0||I>1)))return;if(A===0)F=H=C=Math.round(D*255);else{var Z=D<.5?D*(1+A):D+A-D*A,ne=2*D-Z;F=Math.round(255*G(ne,Z,T+1/3)),H=Math.round(255*G(ne,Z,T)),C=Math.round(255*G(ne,Z,T-1/3))}k=[F,H,C,I]}return k},hi=function(g){var k,T=new RegExp("^"+Dt+"$").exec(g);if(T){k=[];for(var A=[],D=1;D<=3;D++){var I=T[D];if(I[I.length-1]==="%"&&(A[D]=!0),I=parseFloat(I),A[D]&&(I=I/100*255),I<0||I>255)return;k.push(Math.floor(I))}var F=A[1]||A[2]||A[3],H=A[1]&&A[2]&&A[3];if(F&&!H)return;var C=T[4];if(C!==void 0){if(C=parseFloat(C),C<0||C>1)return;k.push(C)}}return k},Sr=function(g){return Xn[g.toLowerCase()]},Zn=function(g){return(Ae(g)?g:null)||Sr(g)||Ri(g)||hi(g)||tn(g)},Xn={transparent:[0,0,0,0],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]},ir=function(g){for(var k=g.map,T=g.keys,A=T.length,D=0;D=g||Re<0||U&&Ze>=D}function be(){var qe=Er();if(_e(qe))return Se(qe);F=setTimeout(be,ue(qe))}function Se(qe){return F=void 0,Z&&T?ne(qe):(T=A=void 0,I)}function Le(){F!==void 0&&clearTimeout(F),C=0,T=H=A=F=void 0}function Be(){return F===void 0?I:Se(Er())}function Ke(){var qe=Er(),Re=_e(qe);if(T=arguments,A=this,H=qe,Re){if(F===void 0)return ae(H);if(U)return clearTimeout(F),F=setTimeout(be,g),ne(H)}return F===void 0&&(F=setTimeout(be,g)),I}return Ke.cancel=Le,Ke.flush=Be,Ke}var im=bL,ug=$?$.performance:null,rs=ug&&ug.now?function(){return ug.now()}:function(){return Date.now()},Ps=function(){if($){if($.requestAnimationFrame)return function(m){$.requestAnimationFrame(m)};if($.mozRequestAnimationFrame)return function(m){$.mozRequestAnimationFrame(m)};if($.webkitRequestAnimationFrame)return function(m){$.webkitRequestAnimationFrame(m)};if($.msRequestAnimationFrame)return function(m){$.msRequestAnimationFrame(m)}}return function(m){m&&setTimeout(function(){m(rs())},1e3/60)}}(),Aa=function(g){return Ps(g)},pi=rs,Rc=9261,_t=65599,hp=5381,Gt=function(g){for(var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Rc,T=k,A;A=g.next(),!A.done;)T=T*_t+A.value|0;return T},ff=function(g){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Rc;return k*_t+g|0},sm=function(g){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hp;return(k<<5)+k+g|0},m9=function(g,k){return g*2097152+k},fp=function(g){return g[0]*2097152+g[1]},N5=function(g,k){return[ff(g[0],k[0]),sm(g[1],k[1])]},ah=function(g,k){var T={value:0,done:!1},A=0,D=g.length,I={next:function(){return A=0&&!(g[A]===k&&(g.splice(A,1),T));A--);},wL=function(g){g.splice(0,g.length)},qP=function(g,k){for(var T=0;T"u"?"undefined":f(Set))!==eY?Set:tY,x9=function(g,k){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(g===void 0||k===void 0||!rt(g)){yc("An element must have a core reference and parameters set");return}var A=k.group;if(A==null&&(k.data&&k.data.source!=null&&k.data.target!=null?A="edges":A="nodes"),A!=="nodes"&&A!=="edges"){yc("An element must be of type `nodes` or `edges`; you specified `"+A+"`");return}this.length=1,this[0]=this;var D=this._private={cy:g,single:!0,data:k.data||{},position:k.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:A,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!k.selected,selectable:k.selectable===void 0?!0:!!k.selectable,locked:!!k.locked,grabbed:!1,grabbable:k.grabbable===void 0?!0:!!k.grabbable,pannable:k.pannable===void 0?A==="edges":!!k.pannable,active:!1,classes:new R5,animation:{current:[],queue:[]},rscratch:{},scratch:k.scratch||{},edges:[],children:[],parent:k.parent&&k.parent.isNode()?k.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(D.position.x==null&&(D.position.x=0),D.position.y==null&&(D.position.y=0),k.renderedPosition){var I=k.renderedPosition,F=g.pan(),H=g.zoom();D.position={x:(I.x-F.x)/H,y:(I.y-F.y)/H}}var C=[];Ae(k.classes)?C=k.classes:ye(k.classes)&&(C=k.classes.split(/\s+/));for(var G=0,U=C.length;GSe?1:0},G=function(be,Se,Le,Be,Ke){var qe;if(Le==null&&(Le=0),Ke==null&&(Ke=T),Le<0)throw new Error("lo must be non-negative");for(Be==null&&(Be=be.length);Leot;0<=ot?$e++:$e--)Ze.push($e);return Ze}.apply(this).reverse(),Re=[],Be=0,Ke=qe.length;Beut;0<=ut?++Ze:--Ze)Je.push(I(be,Le));return Je},ue=function(be,Se,Le,Be){var Ke,qe,Re;for(Be==null&&(Be=T),Ke=be[Le];Le>Se;){if(Re=Le-1>>1,qe=be[Re],Be(Ke,qe)<0){be[Le]=qe,Le=Re;continue}break}return be[Le]=Ke},_e=function(be,Se,Le){var Be,Ke,qe,Re,Ze;for(Le==null&&(Le=T),Ke=be.length,Ze=Se,qe=be[Se],Be=2*Se+1;Be0;){var qe=Se.pop(),Re=_e(qe),Ze=qe.id();if(Z[Ze]=Re,Re!==1/0)for(var $e=qe.neighborhood().intersect(ae),ot=0;ot<$e.length;ot++){var ut=$e[ot],Je=ut.id(),Ct=Ke(qe,ut),lt=Re+Ct.dist;lt<_e(ut)&&(be(ut,lt),U[Je]={node:qe,edge:Ct.edge})}}return{distanceTo:function(Rt){var $t=ye(Rt)?ae.filter(Rt)[0]:Rt[0];return Z[$t.id()]},pathTo:function(Rt){var $t=ye(Rt)?ae.filter(Rt)[0]:Rt[0],bn=[],Cn=$t,Kn=Cn.id();if($t.length>0)for(bn.unshift($t);U[Kn];){var kn=U[Kn];bn.unshift(kn.edge),bn.unshift(kn.node),Cn=kn.node,Kn=Cn.id()}return F.spawn(bn)}}}},sY={kruskal:function(g){g=g||function(Le){return 1};for(var k=this.byGroup(),T=k.nodes,A=k.edges,D=T.length,I=new Array(D),F=T,H=function(Be){for(var Ke=0;Ke0;){if(Ke(),Re++,Be===G){for(var Ze=[],$e=D,ot=G,ut=be[ot];Ze.unshift($e),ut!=null&&Ze.unshift(ut),$e=_e[ot],$e!=null;)ot=$e.id(),ut=be[ot];return{found:!0,distance:U[Be],path:this.spawn(Ze),steps:Re}}ne[Be]=!0;for(var Je=Le._private.edges,Ct=0;Ctut&&(ae[ot]=ut,Se[ot]=$e,Le[ot]=Ke),!D){var Je=$e*G+Ze;!D&&ae[Je]>ut&&(ae[Je]=ut,Se[Je]=Ze,Le[Je]=Ke)}}}for(var Ct=0;Ct1&&arguments[1]!==void 0?arguments[1]:I,eo=Le(Di),sa=[],Ks=eo;;){if(Ks==null)return k.spawn();var Ar=Se(Ks),We=Ar.edge,On=Ar.pred;if(sa.unshift(Ks[0]),Ks.same(es)&&sa.length>0)break;We!=null&&sa.unshift(We),Ks=On}return H.spawn(sa)},qe=0;qe=0;G--){var U=C[G],Z=U[1],ne=U[2];(k[Z]===F&&k[ne]===H||k[Z]===H&&k[ne]===F)&&C.splice(G,1)}for(var ae=0;aeA;){var D=Math.floor(Math.random()*k.length);k=dY(D,g,k),T--}return k},gY={kargerStein:function(){var g=this,k=this.byGroup(),T=k.nodes,A=k.edges;A.unmergeBy(function(bn){return bn.isLoop()});var D=T.length,I=A.length,F=Math.ceil(Math.pow(Math.log(D)/Math.LN2,2)),H=Math.floor(D/fY);if(D<2){yc("At least 2 nodes are required for Karger-Stein algorithm");return}for(var C=[],G=0;G1&&arguments[1]!==void 0?arguments[1]:0,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g.length,A=1/0,D=k;D1&&arguments[1]!==void 0?arguments[1]:0,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g.length,A=-1/0,D=k;D1&&arguments[1]!==void 0?arguments[1]:0,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g.length,A=0,D=0,I=k;I1&&arguments[1]!==void 0?arguments[1]:0,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g.length,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,D=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,I=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;A?g=g.slice(k,T):(T0&&g.splice(0,k));for(var F=0,H=g.length-1;H>=0;H--){var C=g[H];I?isFinite(C)||(g[H]=-1/0,F++):g.splice(H,1)}D&&g.sort(function(Z,ne){return Z-ne});var G=g.length,U=Math.floor(G/2);return G%2!==0?g[U+1+F]:(g[U-1+F]+g[U+F])/2},yY=function(g){return Math.PI*g/180},T9=function(g,k){return Math.atan2(k,g)-Math.PI/2},yL=Math.log2||function(m){return Math.log(m)/Math.log(2)},WP=function(g){return g>0?1:g<0?-1:0},v3=function(g,k){return Math.sqrt(w3(g,k))},w3=function(g,k){var T=k.x-g.x,A=k.y-g.y;return T*T+A*A},kY=function(g){for(var k=g.length,T=0,A=0;A=g.x1&&g.y2>=g.y1)return{x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2,w:g.x2-g.x1,h:g.y2-g.y1};if(g.w!=null&&g.h!=null&&g.w>=0&&g.h>=0)return{x1:g.x1,y1:g.y1,x2:g.x1+g.w,y2:g.y1+g.h,w:g.w,h:g.h}}},EY=function(g){return{x1:g.x1,x2:g.x2,w:g.w,y1:g.y1,y2:g.y2,h:g.h}},TY=function(g){g.x1=1/0,g.y1=1/0,g.x2=-1/0,g.y2=-1/0,g.w=0,g.h=0},_Y=function(g,k){g.x1=Math.min(g.x1,k.x1),g.x2=Math.max(g.x2,k.x2),g.w=g.x2-g.x1,g.y1=Math.min(g.y1,k.y1),g.y2=Math.max(g.y2,k.y2),g.h=g.y2-g.y1},CY=function(g,k,T){g.x1=Math.min(g.x1,k),g.x2=Math.max(g.x2,k),g.w=g.x2-g.x1,g.y1=Math.min(g.y1,T),g.y2=Math.max(g.y2,T),g.h=g.y2-g.y1},_9=function(g){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return g.x1-=k,g.x2+=k,g.y1-=k,g.y2+=k,g.w=g.x2-g.x1,g.h=g.y2-g.y1,g},kL=function(g){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],T,A,D,I;if(k.length===1)T=A=D=I=k[0];else if(k.length===2)T=D=k[0],I=A=k[1];else if(k.length===4){var F=E(k,4);T=F[0],A=F[1],D=F[2],I=F[3]}return g.x1-=I,g.x2+=A,g.y1-=T,g.y2+=D,g.w=g.x2-g.x1,g.h=g.y2-g.y1,g},KP=function(g,k){g.x1=k.x1,g.y1=k.y1,g.x2=k.x2,g.y2=k.y2,g.w=g.x2-g.x1,g.h=g.y2-g.y1},xL=function(g,k){return!(g.x1>k.x2||k.x1>g.x2||g.x2k.y2||k.y1>g.y2)},$5=function(g,k,T){return g.x1<=k&&k<=g.x2&&g.y1<=T&&T<=g.y2},SY=function(g,k){return $5(g,k.x,k.y)},YP=function(g,k){return $5(g,k.x1,k.y1)&&$5(g,k.x2,k.y2)},XP=function(g,k,T,A,D,I,F){var H=wx(D,I),C=D/2,G=I/2,U;{var Z=T-C+H-F,ne=A-G-F,ae=T+C-H+F,ue=ne;if(U=lm(g,k,T,A,Z,ne,ae,ue,!1),U.length>0)return U}{var _e=T+C+F,be=A-G+H-F,Se=_e,Le=A+G-H+F;if(U=lm(g,k,T,A,_e,be,Se,Le,!1),U.length>0)return U}{var Be=T-C+H-F,Ke=A+G+F,qe=T+C-H+F,Re=Ke;if(U=lm(g,k,T,A,Be,Ke,qe,Re,!1),U.length>0)return U}{var Ze=T-C-F,$e=A-G+H-F,ot=Ze,ut=A+G-H+F;if(U=lm(g,k,T,A,Ze,$e,ot,ut,!1),U.length>0)return U}var Je;{var Ct=T-C+H,lt=A-G+H;if(Je=bx(g,k,T,A,Ct,lt,H+F),Je.length>0&&Je[0]<=Ct&&Je[1]<=lt)return[Je[0],Je[1]]}{var un=T+C-H,Rt=A-G+H;if(Je=bx(g,k,T,A,un,Rt,H+F),Je.length>0&&Je[0]>=un&&Je[1]<=Rt)return[Je[0],Je[1]]}{var $t=T+C-H,bn=A+G-H;if(Je=bx(g,k,T,A,$t,bn,H+F),Je.length>0&&Je[0]>=$t&&Je[1]>=bn)return[Je[0],Je[1]]}{var Cn=T-C+H,Kn=A+G-H;if(Je=bx(g,k,T,A,Cn,Kn,H+F),Je.length>0&&Je[0]<=Cn&&Je[1]>=Kn)return[Je[0],Je[1]]}return[]},AY=function(g,k,T,A,D,I,F){var H=F,C=Math.min(T,D),G=Math.max(T,D),U=Math.min(A,I),Z=Math.max(A,I);return C-H<=g&&g<=G+H&&U-H<=k&&k<=Z+H},LY=function(g,k,T,A,D,I,F,H,C){var G={x1:Math.min(T,F,D)-C,x2:Math.max(T,F,D)+C,y1:Math.min(A,H,I)-C,y2:Math.max(A,H,I)+C};return!(gG.x2||kG.y2)},MY=function(g,k,T,A){T-=A;var D=k*k-4*g*T;if(D<0)return[];var I=Math.sqrt(D),F=2*g,H=(-k+I)/F,C=(-k-I)/F;return[H,C]},DY=function(g,k,T,A,D){var I=1e-5;g===0&&(g=I),k/=g,T/=g,A/=g;var F,H,C,G,U,Z,ne,ae;if(H=(3*T-k*k)/9,C=-(27*A)+k*(9*T-2*(k*k)),C/=54,F=H*H*H+C*C,D[1]=0,ne=k/3,F>0){U=C+Math.sqrt(F),U=U<0?-Math.pow(-U,1/3):Math.pow(U,1/3),Z=C-Math.sqrt(F),Z=Z<0?-Math.pow(-Z,1/3):Math.pow(Z,1/3),D[0]=-ne+U+Z,ne+=(U+Z)/2,D[4]=D[2]=-ne,ne=Math.sqrt(3)*(-Z+U)/2,D[3]=ne,D[5]=-ne;return}if(D[5]=D[3]=0,F===0){ae=C<0?-Math.pow(-C,1/3):Math.pow(C,1/3),D[0]=-ne+2*ae,D[4]=D[2]=-(ae+ne);return}H=-H,G=H*H*H,G=Math.acos(C/Math.sqrt(G)),ae=2*Math.sqrt(H),D[0]=-ne+ae*Math.cos(G/3),D[2]=-ne+ae*Math.cos((G+2*Math.PI)/3),D[4]=-ne+ae*Math.cos((G+4*Math.PI)/3)},IY=function(g,k,T,A,D,I,F,H){var C=1*T*T-4*T*D+2*T*F+4*D*D-4*D*F+F*F+A*A-4*A*I+2*A*H+4*I*I-4*I*H+H*H,G=1*9*T*D-3*T*T-3*T*F-6*D*D+3*D*F+9*A*I-3*A*A-3*A*H-6*I*I+3*I*H,U=1*3*T*T-6*T*D+T*F-T*g+2*D*D+2*D*g-F*g+3*A*A-6*A*I+A*H-A*k+2*I*I+2*I*k-H*k,Z=1*T*D-T*T+T*g-D*g+A*I-A*A+A*k-I*k,ne=[];DY(C,G,U,Z,ne);for(var ae=1e-7,ue=[],_e=0;_e<6;_e+=2)Math.abs(ne[_e+1])=0&&ne[_e]<=1&&ue.push(ne[_e]);ue.push(1),ue.push(0);for(var be=-1,Se,Le,Be,Ke=0;Ke=0?BeC?(g-D)*(g-D)+(k-I)*(k-I):G-Z},Gd=function(g,k,T){for(var A,D,I,F,H,C=0,G=0;G=g&&g>=I||A<=g&&g<=I)H=(g-A)/(I-A)*(F-D)+D,H>k&&C++;else continue;return C%2!==0},tv=function(g,k,T,A,D,I,F,H,C){var G=new Array(T.length),U;H[0]!=null?(U=Math.atan(H[1]/H[0]),H[0]<0?U=U+Math.PI/2:U=-U-Math.PI/2):U=H;for(var Z=Math.cos(-U),ne=Math.sin(-U),ae=0;ae0){var _e=ZP(G,-C);ue=QP(_e)}else ue=G;return Gd(g,k,ue)},NY=function(g,k,T,A,D,I,F){for(var H=new Array(T.length),C=I/2,G=F/2,U=_L(I,F),Z=U*U,ne=0;ne=0&&_e<=1&&Se.push(_e),be>=0&&be<=1&&Se.push(be),Se.length===0)return[];var Le=Se[0]*H[0]+g,Be=Se[0]*H[1]+k;if(Se.length>1){if(Se[0]==Se[1])return[Le,Be];var Ke=Se[1]*H[0]+g,qe=Se[1]*H[1]+k;return[Le,Be,Ke,qe]}else return[Le,Be]},EL=function(g,k,T){return k<=g&&g<=T||T<=g&&g<=k?g:g<=k&&k<=T||T<=k&&k<=g?k:T},lm=function(g,k,T,A,D,I,F,H,C){var G=g-D,U=T-g,Z=F-D,ne=k-I,ae=A-k,ue=H-I,_e=Z*ne-ue*G,be=U*ne-ae*G,Se=ue*U-Z*ae;if(Se!==0){var Le=_e/Se,Be=be/Se,Ke=.001,qe=0-Ke,Re=1+Ke;return qe<=Le&&Le<=Re&&qe<=Be&&Be<=Re?[g+Le*U,k+Le*ae]:C?[g+Le*U,k+Le*ae]:[]}else return _e===0||be===0?EL(g,T,F)===F?[F,H]:EL(g,T,D)===D?[D,I]:EL(D,F,T)===T?[T,A]:[]:[]},vx=function(g,k,T,A,D,I,F,H){var C=[],G,U=new Array(T.length),Z=!0;I==null&&(Z=!1);var ne;if(Z){for(var ae=0;ae0){var ue=ZP(U,-H);ne=QP(ue)}else ne=U}else ne=T;for(var _e,be,Se,Le,Be=0;Be2){for(var Rt=[C[0],C[1]],$t=Math.pow(Rt[0]-g,2)+Math.pow(Rt[1]-k,2),bn=1;bnG&&(G=Be)},get:function(Le){return C[Le]}},Z=0;Z0?Rt=un.edgesTo(lt)[0]:Rt=lt.edgesTo(un)[0];var $t=A(Rt);lt=lt.id(),Ze[lt]>Ze[Je]+$t&&(Ze[lt]=Ze[Je]+$t,$e.nodes.indexOf(lt)<0?$e.push(lt):$e.updateItem(lt),Re[lt]=0,qe[lt]=[]),Ze[lt]==Ze[Je]+$t&&(Re[lt]=Re[lt]+Re[Je],qe[lt].push(Je))}else for(var bn=0;bn0;){for(var Wn=Ke.pop(),sr=0;sr0&&F.push(T[H]);F.length!==0&&D.push(A.collection(F))}return D},YY=function(g,k){for(var T=0;T5&&arguments[5]!==void 0?arguments[5]:ZY,F=A,H,C,G=0;G=2?mx(g,k,T,0,cB,JY):mx(g,k,T,0,oB)},squaredEuclidean:function(g,k,T){return mx(g,k,T,0,cB)},manhattan:function(g,k,T){return mx(g,k,T,0,oB)},max:function(g,k,T){return mx(g,k,T,-1/0,eX)}};G5["squared-euclidean"]=G5.squaredEuclidean,G5.squaredeuclidean=G5.squaredEuclidean;function S9(m,g,k,T,A,D){var I;return ke(m)?I=m:I=G5[m]||G5.euclidean,g===0&&ke(m)?I(A,D):I(g,k,T,A,D)}var tX=Vf({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),AL=function(g){return tX(g)},A9=function(g,k,T,A,D){var I=D!=="kMedoids",F=I?function(U){return T[U]}:function(U){return A[U](T)},H=function(Z){return A[Z](k)},C=T,G=k;return S9(g,A.length,F,H,C,G)},LL=function(g,k,T){for(var A=T.length,D=new Array(A),I=new Array(A),F=new Array(k),H=null,C=0;CT)return!1}return!0},iX=function(g,k,T){for(var A=0;AF&&(F=k[C][G],H=G);D[H].push(g[C])}for(var U=0;U=D.threshold||D.mode==="dendrogram"&&g.length===1)return!1;var ae=k[I],ue=k[A[I]],_e;D.mode==="dendrogram"?_e={left:ae,right:ue,key:ae.key}:_e={value:ae.value.concat(ue.value),key:ae.key},g[ae.index]=_e,g.splice(ue.index,1),k[ae.key]=_e;for(var be=0;beT[ue.key][Se.key]&&(H=T[ue.key][Se.key])):D.linkage==="max"?(H=T[ae.key][Se.key],T[ae.key][Se.key]0&&A.push(D);return A},bB=function(g,k,T){for(var A=[],D=0;DF&&(I=C,F=k[D*g+C])}I>0&&A.push(I)}for(var G=0;GC&&(H=G,C=U)}T[D]=I[H]}return A=bB(g,k,T),A},vB=function(g){for(var k=this.cy(),T=this.nodes(),A=wX(g),D={},I=0;I=ut?(Je=ut,ut=lt,Ct=un):lt>Je&&(Je=lt);for(var Rt=0;Rt0?1:0;Re[$e%A.minIterations*F+Wn]=sr,kn+=sr}if(kn>0&&($e>=A.minIterations-1||$e==A.maxIterations-1)){for(var yr=0,hr=0;hr1||qe>1)&&(F=!0),U[Le]=[],Se.outgoers().forEach(function(Ze){Ze.isEdge()&&U[Le].push(Ze.id())})}else Z[Le]=[void 0,Se.target().id()]}):I.forEach(function(Se){var Le=Se.id();if(Se.isNode()){var Be=Se.degree(!0);Be%2&&(H?C?F=!0:C=Le:H=Le),U[Le]=[],Se.connectedEdges().forEach(function(Ke){return U[Le].push(Ke.id())})}else Z[Le]=[Se.source().id(),Se.target().id()]});var ne={found:!1,trail:void 0};if(F)return ne;if(C&&H)if(D){if(G&&C!=G)return ne;G=C}else{if(G&&C!=G&&H!=G)return ne;G||(G=C)}else G||(G=I[0].id());var ae=function(Le){for(var Be=Le,Ke=[Le],qe,Re,Ze;U[Be].length;)qe=U[Be].shift(),Re=Z[qe][0],Ze=Z[qe][1],Be!=Ze?(U[Ze]=U[Ze].filter(function($e){return $e!=qe}),Be=Ze):!D&&Be!=Re&&(U[Re]=U[Re].filter(function($e){return $e!=qe}),Be=Re),Ke.unshift(qe),Ke.unshift(Be);return Ke},ue=[],_e=[];for(_e=ae(G);_e.length!=1;)U[_e[0]].length==0?(ue.unshift(I.getElementById(_e.shift())),ue.unshift(I.getElementById(_e.shift()))):_e=ae(_e.shift()).concat(_e);ue.unshift(I.getElementById(_e.shift()));for(var be in U)if(U[be].length)return ne;return ne.found=!0,ne.trail=this.spawn(ue,!0),ne}},M9=function(){var g=this,k={},T=0,A=0,D=[],I=[],F={},H=function(Z,ne){for(var ae=I.length-1,ue=[],_e=g.spawn();I[ae].x!=Z||I[ae].y!=ne;)ue.push(I.pop().edge),ae--;ue.push(I.pop().edge),ue.forEach(function(be){var Se=be.connectedNodes().intersection(g);_e.merge(be),Se.forEach(function(Le){var Be=Le.id(),Ke=Le.connectedEdges().intersection(g);_e.merge(Le),k[Be].cutVertex?_e.merge(Ke.filter(function(qe){return qe.isLoop()})):_e.merge(Ke)})}),D.push(_e)},C=function U(Z,ne,ae){Z===ae&&(A+=1),k[ne]={id:T,low:T++,cutVertex:!1};var ue=g.getElementById(ne).connectedEdges().intersection(g);if(ue.size()===0)D.push(g.spawn(g.getElementById(ne)));else{var _e,be,Se,Le;ue.forEach(function(Be){_e=Be.source().id(),be=Be.target().id(),Se=_e===ne?be:_e,Se!==ae&&(Le=Be.id(),F[Le]||(F[Le]=!0,I.push({x:ne,y:Se,edge:Be})),Se in k?k[ne].low=Math.min(k[ne].low,k[Se].id):(U(Z,Se,ne),k[ne].low=Math.min(k[ne].low,k[Se].low),k[ne].id<=k[Se].low&&(k[ne].cutVertex=!0,H(ne,Se))))})}};g.forEach(function(U){if(U.isNode()){var Z=U.id();Z in k||(A=0,C(Z,Z),k[Z].cutVertex=A>1)}});var G=Object.keys(k).filter(function(U){return k[U].cutVertex}).map(function(U){return g.getElementById(U)});return{cut:g.spawn(G),components:D}},CX={hopcroftTarjanBiconnected:M9,htbc:M9,htb:M9,hopcroftTarjanBiconnectedComponents:M9},D9=function(){var g=this,k={},T=0,A=[],D=[],I=g.spawn(g),F=function H(C){D.push(C),k[C]={index:T,low:T++,explored:!1};var G=g.getElementById(C).connectedEdges().intersection(g);if(G.forEach(function(ue){var _e=ue.target().id();_e!==C&&(_e in k||H(_e),k[_e].explored||(k[C].low=Math.min(k[C].low,k[_e].low)))}),k[C].index===k[C].low){for(var U=g.spawn();;){var Z=D.pop();if(U.merge(g.getElementById(Z)),k[Z].low=k[C].index,k[Z].explored=!0,Z===C)break}var ne=U.edgesWith(U),ae=U.merge(ne);A.push(ae),I=I.difference(ae)}};return g.forEach(function(H){if(H.isNode()){var C=H.id();C in k||F(C)}}),{cut:I,components:A}},SX={tarjanStronglyConnected:D9,tsc:D9,tscc:D9,tarjanStronglyConnectedComponents:D9},wB={};[dx,iY,sY,oY,uY,hY,gY,jY,H5,z5,SL,QY,lX,bX,EX,_X,CX,SX].forEach(function(m){Oe(wB,m)});/*! -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 mB=0,yB=1,kB=2,nv=function m(g){if(!(this instanceof m))return new m(g);this.id="Thenable/1.0.7",this.state=mB,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof g=="function"&&g.call(this,this.fulfill.bind(this),this.reject.bind(this))};nv.prototype={fulfill:function(g){return xB(this,yB,"fulfillValue",g)},reject:function(g){return xB(this,kB,"rejectReason",g)},then:function(g,k){var T=this,A=new nv;return T.onFulfilled.push(_B(g,A,"fulfill")),T.onRejected.push(_B(k,A,"reject")),EB(T),A.proxy}};var xB=function(g,k,T,A){return g.state===mB&&(g.state=k,g[T]=A,EB(g)),g},EB=function(g){g.state===yB?TB(g,"onFulfilled",g.fulfillValue):g.state===kB&&TB(g,"onRejected",g.rejectReason)},TB=function(g,k,T){if(g[k].length!==0){var A=g[k];g[k]=[];var D=function(){for(var F=0;F0}},clearQueue:function(){return function(){var k=this,T=k.length!==void 0,A=T?k:[k],D=this._private.cy||this;if(!D.styleEnabled())return this;for(var I=0;I-1}var AQ=SQ;function LQ(m,g){var k=this.__data__,T=N9(k,m);return T<0?(++this.size,k.push([m,g])):k[T][1]=g,this}var MQ=LQ;function U5(m){var g=-1,k=m==null?0:m.length;for(this.clear();++g-1&&m%1==0&&m0&&this.spawn(A).updateStyle().emit("class"),k},addClass:function(g){return this.toggleClass(g,!0)},hasClass:function(g){var k=this[0];return k!=null&&k._private.classes.has(g)},toggleClass:function(g,k){Ae(g)||(g=g.match(/\S+/g)||[]);for(var T=this,A=k===void 0,D=[],I=0,F=T.length;I0&&this.spawn(D).updateStyle().emit("class"),T},removeClass:function(g){return this.toggleClass(g,!1)},flashClass:function(g,k){var T=this;if(k==null)k=250;else if(k===0)return T;return T.addClass(g),setTimeout(function(){T.removeClass(g)},k),T}};F9.className=F9.classNames=F9.classes;var lc={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:kt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};lc.variable="(?:[\\w-.]|(?:\\\\"+lc.metaChar+"))+",lc.className="(?:[\\w-]|(?:\\\\"+lc.metaChar+"))+",lc.value=lc.string+"|"+lc.number,lc.id=lc.variable,function(){var m,g,k;for(m=lc.comparatorOp.split("|"),k=0;k=0)&&g!=="="&&(lc.comparatorOp+="|\\!"+g)}();var iu=function(){return{checks:[]}},Ki={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},PL=[{selector:":selected",matches:function(g){return g.selected()}},{selector:":unselected",matches:function(g){return!g.selected()}},{selector:":selectable",matches:function(g){return g.selectable()}},{selector:":unselectable",matches:function(g){return!g.selectable()}},{selector:":locked",matches:function(g){return g.locked()}},{selector:":unlocked",matches:function(g){return!g.locked()}},{selector:":visible",matches:function(g){return g.visible()}},{selector:":hidden",matches:function(g){return!g.visible()}},{selector:":transparent",matches:function(g){return g.transparent()}},{selector:":grabbed",matches:function(g){return g.grabbed()}},{selector:":free",matches:function(g){return!g.grabbed()}},{selector:":removed",matches:function(g){return g.removed()}},{selector:":inside",matches:function(g){return!g.removed()}},{selector:":grabbable",matches:function(g){return g.grabbable()}},{selector:":ungrabbable",matches:function(g){return!g.grabbable()}},{selector:":animated",matches:function(g){return g.animated()}},{selector:":unanimated",matches:function(g){return!g.animated()}},{selector:":parent",matches:function(g){return g.isParent()}},{selector:":childless",matches:function(g){return g.isChildless()}},{selector:":child",matches:function(g){return g.isChild()}},{selector:":orphan",matches:function(g){return g.isOrphan()}},{selector:":nonorphan",matches:function(g){return g.isChild()}},{selector:":compound",matches:function(g){return g.isNode()?g.isParent():g.source().isParent()||g.target().isParent()}},{selector:":loop",matches:function(g){return g.isLoop()}},{selector:":simple",matches:function(g){return g.isSimple()}},{selector:":active",matches:function(g){return g.active()}},{selector:":inactive",matches:function(g){return!g.active()}},{selector:":backgrounding",matches:function(g){return g.backgrounding()}},{selector:":nonbackgrounding",matches:function(g){return!g.backgrounding()}}].sort(function(m,g){return Bn(m.selector,g.selector)}),MZ=function(){for(var m={},g,k=0;k0&&G.edgeCount>0)return Vo("The selector `"+g+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(G.edgeCount>1)return Vo("The selector `"+g+"` is invalid because it uses multiple edge selectors"),!1;G.edgeCount===1&&Vo("The selector `"+g+"` 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!0},BZ=function(){if(this.toStringCache!=null)return this.toStringCache;for(var g=function(G){return G??""},k=function(G){return ye(G)?'"'+G+'"':g(G)},T=function(G){return" "+G+" "},A=function(G,U){var Z=G.type,ne=G.value;switch(Z){case Ki.GROUP:{var ae=g(ne);return ae.substring(0,ae.length-1)}case Ki.DATA_COMPARE:{var ue=G.field,_e=G.operator;return"["+ue+T(g(_e))+k(ne)+"]"}case Ki.DATA_BOOL:{var be=G.operator,Se=G.field;return"["+g(be)+Se+"]"}case Ki.DATA_EXIST:{var Le=G.field;return"["+Le+"]"}case Ki.META_COMPARE:{var Be=G.operator,Ke=G.field;return"[["+Ke+T(g(Be))+k(ne)+"]]"}case Ki.STATE:return ne;case Ki.ID:return"#"+ne;case Ki.CLASS:return"."+ne;case Ki.PARENT:case Ki.CHILD:return D(G.parent,U)+T(">")+D(G.child,U);case Ki.ANCESTOR:case Ki.DESCENDANT:return D(G.ancestor,U)+" "+D(G.descendant,U);case Ki.COMPOUND_SPLIT:{var qe=D(G.left,U),Re=D(G.subject,U),Ze=D(G.right,U);return qe+(qe.length>0?" ":"")+Re+Ze}case Ki.TRUE:return""}},D=function(G,U){return G.checks.reduce(function(Z,ne,ae){return Z+(U===G&&ae===0?"$":"")+A(ne,U)},"")},I="",F=0;F1&&F=0&&(k=k.replace("!",""),U=!0),k.indexOf("@")>=0&&(k=k.replace("@",""),G=!0),(D||F||G)&&(H=!D&&!I?"":""+g,C=""+T),G&&(g=H=H.toLowerCase(),T=C=C.toLowerCase()),k){case"*=":A=H.indexOf(C)>=0;break;case"$=":A=H.indexOf(C,H.length-C.length)>=0;break;case"^=":A=H.indexOf(C)===0;break;case"=":A=g===T;break;case">":Z=!0,A=g>T;break;case">=":Z=!0,A=g>=T;break;case"<":Z=!0,A=g0;){var G=A.shift();g(G),D.add(G.id()),F&&T(A,D,G)}return m}function kx(m,g,k){if(k.isParent())for(var T=k._private.children,A=0;A1&&arguments[1]!==void 0?arguments[1]:!0;return j9(this,m,g,kx)};function qB(m,g,k){if(k.isChild()){var T=k._private.parent;g.has(T.id())||m.push(T)}}Y5.forEachUp=function(m){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return j9(this,m,g,qB)};function qZ(m,g,k){qB(m,g,k),kx(m,g,k)}Y5.forEachUpAndDown=function(m){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return j9(this,m,g,qZ)},Y5.ancestors=Y5.parents;var xx,VB;xx=VB={data:Fc.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Fc.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Fc.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Fc.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Fc.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Fc.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var g=this[0];if(g)return g._private.data.id}},xx.attr=xx.data,xx.removeAttr=xx.removeData;var VZ=VB,$9={};function X5(m){return function(g){var k=this;if(g===void 0&&(g=!0),k.length!==0)if(k.isNode()&&!k.removed()){for(var T=0,A=k[0],D=A._private.edges,I=0;Ig}),minIndegree:Q5("indegree",function(m,g){return mg}),minOutdegree:Q5("outdegree",function(m,g){return mg})}),Oe($9,{totalDegree:function(g){for(var k=0,T=this.nodes(),A=0;A0,Z=U;U&&(G=G[0]);var ne=Z?G.position():{x:0,y:0};k!==void 0?C.position(g,k+ne[g]):D!==void 0&&C.position({x:D.x+ne.x,y:D.y+ne.y})}else{var ae=T.position(),ue=F?T.parent():null,_e=ue&&ue.length>0,be=_e;_e&&(ue=ue[0]);var Se=be?ue.position():{x:0,y:0};return D={x:ae.x-Se.x,y:ae.y-Se.y},g===void 0?D:D[g]}else if(!I)return;return this}},bp.modelPosition=bp.point=bp.position,bp.modelPositions=bp.points=bp.positions,bp.renderedPoint=bp.renderedPosition,bp.relativePoint=bp.relativePosition;var KB=UB,Z5,F2;Z5=F2={},F2.renderedBoundingBox=function(m){var g=this.boundingBox(m),k=this.cy(),T=k.zoom(),A=k.pan(),D=g.x1*T+A.x,I=g.x2*T+A.x,F=g.y1*T+A.y,H=g.y2*T+A.y;return{x1:D,x2:I,y1:F,y2:H,w:I-D,h:H-F}},F2.dirtyCompoundBoundsCache=function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,g=this.cy();return!g.styleEnabled()||!g.hasCompoundNodes()?this:(this.forEachUp(function(k){if(k.isParent()){var T=k._private;T.compoundBoundsClean=!1,T.bbCache=null,m||k.emitAndNotify("bounds")}}),this)},F2.updateCompoundBounds=function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,g=this.cy();if(!g.styleEnabled()||!g.hasCompoundNodes())return this;if(!m&&g.batching())return this;function k(I){if(!I.isParent())return;var F=I._private,H=I.children(),C=I.pstyle("compound-sizing-wrt-labels").value==="include",G={width:{val:I.pstyle("min-width").pfValue,left:I.pstyle("min-width-bias-left"),right:I.pstyle("min-width-bias-right")},height:{val:I.pstyle("min-height").pfValue,top:I.pstyle("min-height-bias-top"),bottom:I.pstyle("min-height-bias-bottom")}},U=H.boundingBox({includeLabels:C,includeOverlays:!1,useCache:!1}),Z=F.position;(U.w===0||U.h===0)&&(U={w:I.pstyle("width").pfValue,h:I.pstyle("height").pfValue},U.x1=Z.x-U.w/2,U.x2=Z.x+U.w/2,U.y1=Z.y-U.h/2,U.y2=Z.y+U.h/2);function ne($e,ot,ut){var Je=0,Ct=0,lt=ot+ut;return $e>0&<>0&&(Je=ot/lt*$e,Ct=ut/lt*$e),{biasDiff:Je,biasComplementDiff:Ct}}function ae($e,ot,ut,Je){if(ut.units==="%")switch(Je){case"width":return $e>0?ut.pfValue*$e:0;case"height":return ot>0?ut.pfValue*ot:0;case"average":return $e>0&&ot>0?ut.pfValue*($e+ot)/2:0;case"min":return $e>0&&ot>0?$e>ot?ut.pfValue*ot:ut.pfValue*$e:0;case"max":return $e>0&&ot>0?$e>ot?ut.pfValue*$e:ut.pfValue*ot:0;default:return 0}else return ut.units==="px"?ut.pfValue:0}var ue=G.width.left.value;G.width.left.units==="px"&&G.width.val>0&&(ue=ue*100/G.width.val);var _e=G.width.right.value;G.width.right.units==="px"&&G.width.val>0&&(_e=_e*100/G.width.val);var be=G.height.top.value;G.height.top.units==="px"&&G.height.val>0&&(be=be*100/G.height.val);var Se=G.height.bottom.value;G.height.bottom.units==="px"&&G.height.val>0&&(Se=Se*100/G.height.val);var Le=ne(G.width.val-U.w,ue,_e),Be=Le.biasDiff,Ke=Le.biasComplementDiff,qe=ne(G.height.val-U.h,be,Se),Re=qe.biasDiff,Ze=qe.biasComplementDiff;F.autoPadding=ae(U.w,U.h,I.pstyle("padding"),I.pstyle("padding-relative-to").value),F.autoWidth=Math.max(U.w,G.width.val),Z.x=(-Be+U.x1+U.x2+Ke)/2,F.autoHeight=Math.max(U.h,G.height.val),Z.y=(-Re+U.y1+U.y2+Ze)/2}for(var T=0;Tg.x2?A:g.x2,g.y1=Tg.y2?D:g.y2,g.w=g.x2-g.x1,g.h=g.y2-g.y1)},k3=function(g,k){return k==null?g:vp(g,k.x1,k.y1,k.x2,k.y2)},Tx=function(g,k,T){return gp(g,k,T)},H9=function(g,k,T){if(!k.cy().headless()){var A=k._private,D=A.rstyle,I=D.arrowWidth/2,F=k.pstyle(T+"-arrow-shape").value,H,C;if(F!=="none"){T==="source"?(H=D.srcX,C=D.srcY):T==="target"?(H=D.tgtX,C=D.tgtY):(H=D.midX,C=D.midY);var G=A.arrowBounds=A.arrowBounds||{},U=G[T]=G[T]||{};U.x1=H-I,U.y1=C-I,U.x2=H+I,U.y2=C+I,U.w=U.x2-U.x1,U.h=U.y2-U.y1,_9(U,1),vp(g,U.x1,U.y1,U.x2,U.y2)}}},YB=function(g,k,T){if(!k.cy().headless()){var A;T?A=T+"-":A="";var D=k._private,I=D.rstyle,F=k.pstyle(A+"label").strValue;if(F){var H=k.pstyle("text-halign"),C=k.pstyle("text-valign"),G=Tx(I,"labelWidth",T),U=Tx(I,"labelHeight",T),Z=Tx(I,"labelX",T),ne=Tx(I,"labelY",T),ae=k.pstyle(A+"text-margin-x").pfValue,ue=k.pstyle(A+"text-margin-y").pfValue,_e=k.isEdge(),be=k.pstyle(A+"text-rotation"),Se=k.pstyle("text-outline-width").pfValue,Le=k.pstyle("text-border-width").pfValue,Be=Le/2,Ke=k.pstyle("text-background-padding").pfValue,qe=2,Re=U,Ze=G,$e=Ze/2,ot=Re/2,ut,Je,Ct,lt;if(_e)ut=Z-$e,Je=Z+$e,Ct=ne-ot,lt=ne+ot;else{switch(H.value){case"left":ut=Z-Ze,Je=Z;break;case"center":ut=Z-$e,Je=Z+$e;break;case"right":ut=Z,Je=Z+Ze;break}switch(C.value){case"top":Ct=ne-Re,lt=ne;break;case"center":Ct=ne-ot,lt=ne+ot;break;case"bottom":Ct=ne,lt=ne+Re;break}}ut+=ae-Math.max(Se,Be)-Ke-qe,Je+=ae+Math.max(Se,Be)+Ke+qe,Ct+=ue-Math.max(Se,Be)-Ke-qe,lt+=ue+Math.max(Se,Be)+Ke+qe;var un=T||"main",Rt=D.labelBounds,$t=Rt[un]=Rt[un]||{};$t.x1=ut,$t.y1=Ct,$t.x2=Je,$t.y2=lt,$t.w=Je-ut,$t.h=lt-Ct;var bn=_e&&be.strValue==="autorotate",Cn=be.pfValue!=null&&be.pfValue!==0;if(bn||Cn){var Kn=bn?Tx(D.rstyle,"labelAngle",T):be.pfValue,kn=Math.cos(Kn),Wn=Math.sin(Kn),sr=(ut+Je)/2,yr=(Ct+lt)/2;if(!_e){switch(H.value){case"left":sr=Je;break;case"right":sr=ut;break}switch(C.value){case"top":yr=lt;break;case"bottom":yr=Ct;break}}var hr=function(Ba,Li){return Ba=Ba-sr,Li=Li-yr,{x:Ba*kn-Li*Wn+sr,y:Ba*Wn+Li*kn+yr}},nr=hr(ut,Ct),fn=hr(ut,lt),vr=hr(Je,Ct),gr=hr(Je,lt);ut=Math.min(nr.x,fn.x,vr.x,gr.x),Je=Math.max(nr.x,fn.x,vr.x,gr.x),Ct=Math.min(nr.y,fn.y,vr.y,gr.y),lt=Math.max(nr.y,fn.y,vr.y,gr.y)}var ni=un+"Rot",Ti=Rt[ni]=Rt[ni]||{};Ti.x1=ut,Ti.y1=Ct,Ti.x2=Je,Ti.y2=lt,Ti.w=Je-ut,Ti.h=lt-Ct,vp(g,ut,Ct,Je,lt),vp(D.labelBounds.all,ut,Ct,Je,lt)}return g}},UZ=function(g,k){var T=g._private.cy,A=T.styleEnabled(),D=T.headless(),I=zd(),F=g._private,H=g.isNode(),C=g.isEdge(),G,U,Z,ne,ae,ue,_e=F.rstyle,be=H&&A?g.pstyle("bounds-expansion").pfValue:[0],Se=function(Ts){return Ts.pstyle("display").value!=="none"},Le=!A||Se(g)&&(!C||Se(g.source())&&Se(g.target()));if(Le){var Be=0,Ke=0;A&&k.includeOverlays&&(Be=g.pstyle("overlay-opacity").value,Be!==0&&(Ke=g.pstyle("overlay-padding").value));var qe=0,Re=0;A&&k.includeUnderlays&&(qe=g.pstyle("underlay-opacity").value,qe!==0&&(Re=g.pstyle("underlay-padding").value));var Ze=Math.max(Ke,Re),$e=0,ot=0;if(A&&($e=g.pstyle("width").pfValue,ot=$e/2),H&&k.includeNodes){var ut=g.position();ae=ut.x,ue=ut.y;var Je=g.outerWidth(),Ct=Je/2,lt=g.outerHeight(),un=lt/2;G=ae-Ct,U=ae+Ct,Z=ue-un,ne=ue+un,vp(I,G,Z,U,ne)}else if(C&&k.includeEdges)if(A&&!D){var Rt=g.pstyle("curve-style").strValue;if(G=Math.min(_e.srcX,_e.midX,_e.tgtX),U=Math.max(_e.srcX,_e.midX,_e.tgtX),Z=Math.min(_e.srcY,_e.midY,_e.tgtY),ne=Math.max(_e.srcY,_e.midY,_e.tgtY),G-=ot,U+=ot,Z-=ot,ne+=ot,vp(I,G,Z,U,ne),Rt==="haystack"){var $t=_e.haystackPts;if($t&&$t.length===2){if(G=$t[0].x,Z=$t[0].y,U=$t[1].x,ne=$t[1].y,G>U){var bn=G;G=U,U=bn}if(Z>ne){var Cn=Z;Z=ne,ne=Cn}vp(I,G-ot,Z-ot,U+ot,ne+ot)}}else if(Rt==="bezier"||Rt==="unbundled-bezier"||Rt==="segments"||Rt==="taxi"){var Kn;switch(Rt){case"bezier":case"unbundled-bezier":Kn=_e.bezierPts;break;case"segments":case"taxi":Kn=_e.linePts;break}if(Kn!=null)for(var kn=0;knU){var fn=G;G=U,U=fn}if(Z>ne){var vr=Z;Z=ne,ne=vr}G-=ot,U+=ot,Z-=ot,ne+=ot,vp(I,G,Z,U,ne)}if(A&&k.includeEdges&&C&&(H9(I,g,"mid-source"),H9(I,g,"mid-target"),H9(I,g,"source"),H9(I,g,"target")),A){var gr=g.pstyle("ghost").value==="yes";if(gr){var ni=g.pstyle("ghost-offset-x").pfValue,Ti=g.pstyle("ghost-offset-y").pfValue;vp(I,I.x1+ni,I.y1+Ti,I.x2+ni,I.y2+Ti)}}var ia=F.bodyBounds=F.bodyBounds||{};KP(ia,I),kL(ia,be),_9(ia,1),A&&(G=I.x1,U=I.x2,Z=I.y1,ne=I.y2,vp(I,G-Ze,Z-Ze,U+Ze,ne+Ze));var Ba=F.overlayBounds=F.overlayBounds||{};KP(Ba,I),kL(Ba,be),_9(Ba,1);var Li=F.labelBounds=F.labelBounds||{};Li.all!=null?TY(Li.all):Li.all=zd(),A&&k.includeLabels&&(k.includeMainLabels&&YB(I,g,null),C&&(k.includeSourceLabels&&YB(I,g,"source"),k.includeTargetLabels&&YB(I,g,"target")))}return I.x1=E0(I.x1),I.y1=E0(I.y1),I.x2=E0(I.x2),I.y2=E0(I.y2),I.w=E0(I.x2-I.x1),I.h=E0(I.y2-I.y1),I.w>0&&I.h>0&&Le&&(kL(I,be),_9(I,1)),I},XB=function(g){var k=0,T=function(I){return(I?1:0)<0&&arguments[0]!==void 0?arguments[0]:aJ,g=arguments.length>1?arguments[1]:void 0,k=0;k=0;F--)I(F);return this},pm.removeAllListeners=function(){return this.removeListener("*")},pm.emit=pm.trigger=function(m,g,k){var T=this.listeners,A=T.length;return this.emitting++,Ae(g)||(g=[g]),oJ(this,function(D,I){k!=null&&(T=[{event:I.event,type:I.type,namespace:I.namespace,callback:k}],A=T.length);for(var F=function(G){var U=T[G];if(U.type===I.type&&(!U.namespace||U.namespace===I.namespace||U.namespace===sJ)&&D.eventMatches(D.context,U,I)){var Z=[I];g!=null&&qP(Z,g),D.beforeEmit(D.context,U,I),U.conf&&U.conf.one&&(D.listeners=D.listeners.filter(function(ue){return ue!==U}));var ne=D.callbackContext(D.context,U,I),ae=U.callback.apply(ne,Z);D.afterEmit(D.context,U,I),ae===!1&&(I.stopPropagation(),I.preventDefault())}},H=0;H1&&!I){var F=this.length-1,H=this[F],C=H._private.data.id;this[F]=void 0,this[g]=H,D.set(C,{ele:H,index:g})}return this.length--,this},unmergeOne:function(g){g=g[0];var k=this._private,T=g._private.data.id,A=k.map,D=A.get(T);if(!D)return this;var I=D.index;return this.unmergeAt(I),this},unmerge:function(g){var k=this._private.cy;if(!g)return this;if(g&&ye(g)){var T=g;g=k.mutableElements().filter(T)}for(var A=0;A=0;k--){var T=this[k];g(T)&&this.unmergeAt(k)}return this},map:function(g,k){for(var T=[],A=this,D=0;DT&&(T=H,A=F)}return{value:T,ele:A}},min:function(g,k){for(var T=1/0,A,D=this,I=0;I=0&&D"u"?"undefined":f(Symbol))!=g&&f(Symbol.iterator)!=g;k&&(V9[Symbol.iterator]=function(){var T=this,A={value:void 0,done:!1},D=0,I=this.length;return b({next:function(){return D1&&arguments[1]!==void 0?arguments[1]:!0,T=this[0],A=T.cy();if(A.styleEnabled()&&T){this.cleanStyle();var D=T._private.style[g];return D??(k?A.style().getDefaultProperty(g):null)}},numericStyle:function(g){var k=this[0];if(k.cy().styleEnabled()&&k){var T=k.pstyle(g);return T.pfValue!==void 0?T.pfValue:T.value}},numericStyleUnits:function(g){var k=this[0];if(k.cy().styleEnabled()&&k)return k.pstyle(g).units},renderedStyle:function(g){var k=this.cy();if(!k.styleEnabled())return this;var T=this[0];if(T)return k.style().getRenderedStyle(T,g)},style:function(g,k){var T=this.cy();if(!T.styleEnabled())return this;var A=!1,D=T.style();if(de(g)){var I=g;D.applyBypass(this,I,A),this.emitAndNotify("style")}else if(ye(g))if(k===void 0){var F=this[0];return F?D.getStylePropertyValue(F,g):void 0}else D.applyBypass(this,g,k,A),this.emitAndNotify("style");else if(g===void 0){var H=this[0];return H?D.getRawStyle(H):void 0}return this},removeStyle:function(g){var k=this.cy();if(!k.styleEnabled())return this;var T=!1,A=k.style(),D=this;if(g===void 0)for(var I=0;I0&&g.push(G[0]),g.push(F[0])}return this.spawn(g,!0).filter(m)},"neighborhood"),closedNeighborhood:function(g){return this.neighborhood().add(this).filter(g)},openNeighborhood:function(g){return this.neighborhood(g)}}),w1.neighbourhood=w1.neighborhood,w1.closedNeighbourhood=w1.closedNeighborhood,w1.openNeighbourhood=w1.openNeighborhood,Oe(w1,{source:ld(function(g){var k=this[0],T;return k&&(T=k._private.source||k.cy().collection()),T&&g?T.filter(g):T},"source"),target:ld(function(g){var k=this[0],T;return k&&(T=k._private.target||k.cy().collection()),T&&g?T.filter(g):T},"target"),sources:bR({attr:"source"}),targets:bR({attr:"target"})});function bR(m){return function(k){for(var T=[],A=0;A0);return I},component:function(){var g=this[0];return g.cy().mutableElements().components(g)[0]}}),w1.componentsOf=w1.components;var Wf=function(g,k){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(g===void 0){yc("A collection must have a reference to the core");return}var D=new R2,I=!1;if(!k)k=[];else if(k.length>0&&de(k[0])&&!Ie(k[0])){I=!0;for(var F=[],H=new R5,C=0,G=k.length;C0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,k=this,T=k.cy(),A=T._private,D=[],I=[],F,H=0,C=k.length;H0){for(var Cn=F.length===k.length?k:new Wf(T,F),Kn=0;Kn0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,k=this,T=[],A={},D=k._private.cy;function I(lt){for(var un=lt._private.edges,Rt=0;Rt0&&(m?ut.emitAndNotify("remove"):g&&ut.emit("remove"));for(var Je=0;Je0?Je=lt:ut=lt;while(Math.abs(Ct)>I&&++un=D?Se(ot,un):Rt===0?un:Be(ot,ut,ut+C)}var qe=!1;function Re(){qe=!0,(m!==g||k!==T)&&Le()}var Ze=function(ut){return qe||Re(),m===g&&k===T?ut:ut===0?0:ut===1?1:_e(Ke(ut),g,T)};Ze.getControlPoints=function(){return[{x:m,y:g},{x:k,y:T}]};var $e="generateBezier("+[m,g,k,T]+")";return Ze.toString=function(){return $e},Ze}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var wJ=function(){function m(T){return-T.tension*T.x-T.friction*T.v}function g(T,A,D){var I={x:T.x+D.dx*A,v:T.v+D.dv*A,tension:T.tension,friction:T.friction};return{dx:I.v,dv:m(I)}}function k(T,A){var D={dx:T.v,dv:m(T)},I=g(T,A*.5,D),F=g(T,A*.5,I),H=g(T,A,F),C=1/6*(D.dx+2*(I.dx+F.dx)+H.dx),G=1/6*(D.dv+2*(I.dv+F.dv)+H.dv);return T.x=T.x+C*A,T.v=T.v+G*A,T}return function T(A,D,I){var F={x:-1,v:0,tension:null,friction:null},H=[0],C=0,G=1/1e4,U=16/1e3,Z,ne,ae;for(A=parseFloat(A)||500,D=parseFloat(D)||20,I=I||null,F.tension=A,F.friction=D,Z=I!==null,Z?(C=T(A,D),ne=C/I*U):ne=U;ae=k(ae||F,ne),H.push(1+ae.x),C+=16,Math.abs(ae.x)>G&&Math.abs(ae.v)>G;);return Z?function(ue){return H[ue*(H.length-1)|0]}:C}}(),Eu=function(g,k,T,A){var D=vJ(g,k,T,A);return function(I,F,H){return I+(F-I)*D(H)}},Y9={linear:function(g,k,T){return g+(k-g)*T},ease:Eu(.25,.1,.25,1),"ease-in":Eu(.42,0,1,1),"ease-out":Eu(0,0,.58,1),"ease-in-out":Eu(.42,0,.58,1),"ease-in-sine":Eu(.47,0,.745,.715),"ease-out-sine":Eu(.39,.575,.565,1),"ease-in-out-sine":Eu(.445,.05,.55,.95),"ease-in-quad":Eu(.55,.085,.68,.53),"ease-out-quad":Eu(.25,.46,.45,.94),"ease-in-out-quad":Eu(.455,.03,.515,.955),"ease-in-cubic":Eu(.55,.055,.675,.19),"ease-out-cubic":Eu(.215,.61,.355,1),"ease-in-out-cubic":Eu(.645,.045,.355,1),"ease-in-quart":Eu(.895,.03,.685,.22),"ease-out-quart":Eu(.165,.84,.44,1),"ease-in-out-quart":Eu(.77,0,.175,1),"ease-in-quint":Eu(.755,.05,.855,.06),"ease-out-quint":Eu(.23,1,.32,1),"ease-in-out-quint":Eu(.86,0,.07,1),"ease-in-expo":Eu(.95,.05,.795,.035),"ease-out-expo":Eu(.19,1,.22,1),"ease-in-out-expo":Eu(1,0,0,1),"ease-in-circ":Eu(.6,.04,.98,.335),"ease-out-circ":Eu(.075,.82,.165,1),"ease-in-out-circ":Eu(.785,.135,.15,.86),spring:function(g,k,T){if(T===0)return Y9.linear;var A=wJ(g,k,T);return function(D,I,F){return D+(I-D)*A(F)}},"cubic-bezier":Eu};function mR(m,g,k,T,A){if(T===1||g===k)return k;var D=A(g,k,T);return m==null||((m.roundValue||m.color)&&(D=Math.round(D)),m.min!==void 0&&(D=Math.max(D,m.min)),m.max!==void 0&&(D=Math.min(D,m.max))),D}function yR(m,g){return m.pfValue!=null||m.value!=null?m.pfValue!=null&&(g==null||g.type.units!=="%")?m.pfValue:m.value:m}function t6(m,g,k,T,A){var D=A!=null?A.type:null;k<0?k=0:k>1&&(k=1);var I=yR(m,A),F=yR(g,A);if(te(I)&&te(F))return mR(D,I,F,k,T);if(Ae(I)&&Ae(F)){for(var H=[],C=0;C0?(ne==="spring"&&ae.push(I.duration),I.easingImpl=Y9[ne].apply(null,ae)):I.easingImpl=Y9[ne]}var ue=I.easingImpl,_e;if(I.duration===0?_e=1:_e=(k-H)/I.duration,I.applying&&(_e=I.progress),_e<0?_e=0:_e>1&&(_e=1),I.delay==null){var be=I.startPosition,Se=I.position;if(Se&&A&&!m.locked()){var Le={};Lx(be.x,Se.x)&&(Le.x=t6(be.x,Se.x,_e,ue)),Lx(be.y,Se.y)&&(Le.y=t6(be.y,Se.y,_e,ue)),m.position(Le)}var Be=I.startPan,Ke=I.pan,qe=D.pan,Re=Ke!=null&&T;Re&&(Lx(Be.x,Ke.x)&&(qe.x=t6(Be.x,Ke.x,_e,ue)),Lx(Be.y,Ke.y)&&(qe.y=t6(Be.y,Ke.y,_e,ue)),m.emit("pan"));var Ze=I.startZoom,$e=I.zoom,ot=$e!=null&&T;ot&&(Lx(Ze,$e)&&(D.zoom=px(D.minZoom,t6(Ze,$e,_e,ue),D.maxZoom)),m.emit("zoom")),(Re||ot)&&m.emit("viewport");var ut=I.style;if(ut&&ut.length>0&&A){for(var Je=0;Je=0;Re--){var Ze=qe[Re];Ze()}qe.splice(0,qe.length)},Se=ne.length-1;Se>=0;Se--){var Le=ne[Se],Be=Le._private;if(Be.stopped){ne.splice(Se,1),Be.hooked=!1,Be.playing=!1,Be.started=!1,be(Be.frames);continue}!Be.playing&&!Be.applying||(Be.playing&&Be.applying&&(Be.applying=!1),Be.started||yJ(G,Le,m),mJ(G,Le,m,U),Be.applying&&(Be.applying=!1),be(Be.frames),Be.step!=null&&Be.step(m),Le.completed()&&(ne.splice(Se,1),Be.hooked=!1,Be.playing=!1,Be.started=!1,be(Be.completes)),ue=!0)}return!U&&ne.length===0&&ae.length===0&&T.push(G),ue}for(var D=!1,I=0;I0?g.notify("draw",k):g.notify("draw")),k.unmerge(T),g.emit("step")}var kJ={animate:Fc.animate(),animation:Fc.animation(),animated:Fc.animated(),clearQueue:Fc.clearQueue(),delay:Fc.delay(),delayAnimation:Fc.delayAnimation(),stop:Fc.stop(),addToAnimationPool:function(g){var k=this;k.styleEnabled()&&k._private.aniEles.merge(g)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var g=this;if(g._private.animationsRunning=!0,!g.styleEnabled())return;function k(){g._private.animationsRunning&&Aa(function(D){kR(D,g),k()})}var T=g.renderer();T&&T.beforeRender?T.beforeRender(function(D,I){kR(I,g)},T.beforeRenderPriorities.animations):k()}},xJ={qualifierCompare:function(g,k){return g==null||k==null?g==null&&k==null:g.sameText(k)},eventMatches:function(g,k,T){var A=k.qualifier;return A!=null?g!==T.target&&Ie(T.target)&&A.matches(T.target):!0},addEventFields:function(g,k){k.cy=g,k.target=g},callbackContext:function(g,k,T){return k.qualifier!=null?T.target:g}},X9=function(g){return ye(g)?new dm(g):g},xR={createEmitter:function(){var g=this._private;return g.emitter||(g.emitter=new G9(xJ,this)),this},emitter:function(){return this._private.emitter},on:function(g,k,T){return this.emitter().on(g,X9(k),T),this},removeListener:function(g,k,T){return this.emitter().removeListener(g,X9(k),T),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(g,k,T){return this.emitter().one(g,X9(k),T),this},once:function(g,k,T){return this.emitter().one(g,X9(k),T),this},emit:function(g,k){return this.emitter().emit(g,k),this},emitAndNotify:function(g,k){return this.emit(g),this.notify(g,k),this}};Fc.eventAliasesOn(xR);var $L={png:function(g){var k=this._private.renderer;return g=g||{},k.png(g)},jpg:function(g){var k=this._private.renderer;return g=g||{},g.bg=g.bg||"#fff",k.jpg(g)}};$L.jpeg=$L.jpg;var Q9={layout:function(g){var k=this;if(g==null){yc("Layout options must be specified to make a layout");return}if(g.name==null){yc("A `name` must be specified to make a layout");return}var T=g.name,A=k.extension("layout",T);if(A==null){yc("No such layout `"+T+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var D;ye(g.eles)?D=k.$(g.eles):D=g.eles!=null?g.eles:k.$();var I=new A(Oe({},g,{cy:k,eles:D}));return I}};Q9.createLayout=Q9.makeLayout=Q9.layout;var EJ={notify:function(g,k){var T=this._private;if(this.batching()){T.batchNotifications=T.batchNotifications||{};var A=T.batchNotifications[g]=T.batchNotifications[g]||this.collection();k!=null&&A.merge(k);return}if(T.notificationsEnabled){var D=this.renderer();this.destroyed()||!D||D.notify(g,k)}},notifications:function(g){var k=this._private;return g===void 0?k.notificationsEnabled:(k.notificationsEnabled=!!g,this)},noNotifications:function(g){this.notifications(!1),g(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var g=this._private;return g.batchCount==null&&(g.batchCount=0),g.batchCount===0&&(g.batchStyleEles=this.collection(),g.batchNotifications={}),g.batchCount++,this},endBatch:function(){var g=this._private;if(g.batchCount===0)return this;if(g.batchCount--,g.batchCount===0){g.batchStyleEles.updateStyle();var k=this.renderer();Object.keys(g.batchNotifications).forEach(function(T){var A=g.batchNotifications[T];A.empty()?k.notify(T):k.notify(T,A)})}return this},batch:function(g){return this.startBatch(),g(),this.endBatch(),this},batchData:function(g){var k=this;return this.batch(function(){for(var T=Object.keys(g),A=0;A0;)k.removeChild(k.childNodes[0]);g._private.renderer=null,g.mutableElements().forEach(function(T){var A=T._private;A.rscratch={},A.rstyle={},A.animation.current=[],A.animation.queue=[]})},onRender:function(g){return this.on("render",g)},offRender:function(g){return this.off("render",g)}};HL.invalidateDimensions=HL.resize;var Z9={collection:function(g,k){return ye(g)?this.$(g):he(g)?g.collection():Ae(g)?(k||(k={}),new Wf(this,g,k.unique,k.removed)):new Wf(this)},nodes:function(g){var k=this.$(function(T){return T.isNode()});return g?k.filter(g):k},edges:function(g){var k=this.$(function(T){return T.isEdge()});return g?k.filter(g):k},$:function(g){var k=this._private.elements;return g?k.filter(g):k.spawnSelf()},mutableElements:function(){return this._private.elements}};Z9.elements=Z9.filter=Z9.$;var m1={},Mx="t",_J="f";m1.apply=function(m){for(var g=this,k=g._private,T=k.cy,A=T.collection(),D=0;D0;if(Z||U&&ne){var ae=void 0;Z&&ne||Z?ae=C.properties:ne&&(ae=C.mappedProperties);for(var ue=0;ue1&&(Be=1),F.color){var qe=T.valueMin[0],Re=T.valueMax[0],Ze=T.valueMin[1],$e=T.valueMax[1],ot=T.valueMin[2],ut=T.valueMax[2],Je=T.valueMin[3]==null?1:T.valueMin[3],Ct=T.valueMax[3]==null?1:T.valueMax[3],lt=[Math.round(qe+(Re-qe)*Be),Math.round(Ze+($e-Ze)*Be),Math.round(ot+(ut-ot)*Be),Math.round(Je+(Ct-Je)*Be)];D={bypass:T.bypass,name:T.name,value:lt,strValue:"rgb("+lt[0]+", "+lt[1]+", "+lt[2]+")"}}else if(F.number){var un=T.valueMin+(T.valueMax-T.valueMin)*Be;D=this.parse(T.name,un,T.bypass,Z)}else return!1;if(!D)return ue(),!1;D.mapping=T,T=D;break}case I.data:{for(var Rt=T.field.split("."),$t=U.data,bn=0;bn0&&D>0){for(var F={},H=!1,C=0;C0?m.delayAnimation(I).play().promise().then(Le):Le()}).then(function(){return m.animation({style:F,duration:D,easing:m.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){k.removeBypasses(m,A),m.emitAndNotify("style"),T.transitioning=!1})}else T.transitioning&&(this.removeBypasses(m,A),m.emitAndNotify("style"),T.transitioning=!1)},m1.checkTrigger=function(m,g,k,T,A,D){var I=this.properties[g],F=A(I);F!=null&&F(k,T)&&D(I)},m1.checkZOrderTrigger=function(m,g,k,T){var A=this;this.checkTrigger(m,g,k,T,function(D){return D.triggersZOrder},function(){A._private.cy.notify("zorder",m)})},m1.checkBoundsTrigger=function(m,g,k,T){this.checkTrigger(m,g,k,T,function(A){return A.triggersBounds},function(A){m.dirtyCompoundBoundsCache(),m.dirtyBoundingBoxCache(),A.triggersBoundsOfParallelBeziers&&(g==="curve-style"&&(k==="bezier"||T==="bezier")||g==="display"&&(k==="none"||T==="none"))&&m.parallelEdges().forEach(function(D){D.isBundledBezier()&&D.dirtyBoundingBoxCache()})})},m1.checkTriggers=function(m,g,k,T){m.dirtyStyleCache(),this.checkZOrderTrigger(m,g,k,T),this.checkBoundsTrigger(m,g,k,T)};var Dx={};Dx.applyBypass=function(m,g,k,T){var A=this,D=[],I=!0;if(g==="*"||g==="**"){if(k!==void 0)for(var F=0;FA.length?T=T.substr(A.length):T=""}function H(){D.length>I.length?D=D.substr(I.length):D=""}for(;;){var C=T.match(/^\s*$/);if(C)break;var G=T.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!G){Vo("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+T);break}A=G[0];var U=G[1];if(U!=="core"){var Z=new dm(U);if(Z.invalid){Vo("Skipping parsing of block: Invalid selector found in string stylesheet: "+U),F();continue}}var ne=G[2],ae=!1;D=ne;for(var ue=[];;){var _e=D.match(/^\s*$/);if(_e)break;var be=D.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!be){Vo("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+ne),ae=!0;break}I=be[0];var Se=be[1],Le=be[2],Be=g.properties[Se];if(!Be){Vo("Skipping property: Invalid property name in: "+I),H();continue}var Ke=k.parse(Se,Le);if(!Ke){Vo("Skipping property: Invalid property definition in: "+I),H();continue}ue.push({name:Se,val:Le}),H()}if(ae){F();break}k.selector(U);for(var qe=0;qe=7&&g[0]==="d"&&(G=new RegExp(F.data.regex).exec(g))){if(k)return!1;var Z=F.data;return{name:m,value:G,strValue:""+g,mapped:Z,field:G[1],bypass:k}}else if(g.length>=10&&g[0]==="m"&&(U=new RegExp(F.mapData.regex).exec(g))){if(k||C.multiple)return!1;var ne=F.mapData;if(!(C.color||C.number))return!1;var ae=this.parse(m,U[4]);if(!ae||ae.mapped)return!1;var ue=this.parse(m,U[5]);if(!ue||ue.mapped)return!1;if(ae.pfValue===ue.pfValue||ae.strValue===ue.strValue)return Vo("`"+m+": "+g+"` is not a valid mapper because the output range is zero; converting to `"+m+": "+ae.strValue+"`"),this.parse(m,ae.strValue);if(C.color){var _e=ae.value,be=ue.value,Se=_e[0]===be[0]&&_e[1]===be[1]&&_e[2]===be[2]&&(_e[3]===be[3]||(_e[3]==null||_e[3]===1)&&(be[3]==null||be[3]===1));if(Se)return!1}return{name:m,value:U,strValue:""+g,mapped:ne,field:U[1],fieldMin:parseFloat(U[2]),fieldMax:parseFloat(U[3]),valueMin:ae.value,valueMax:ue.value,bypass:k}}}if(C.multiple&&T!=="multiple"){var Le;if(H?Le=g.split(/\s+/):Ae(g)?Le=g:Le=[g],C.evenMultiple&&Le.length%2!==0)return null;for(var Be=[],Ke=[],qe=[],Re="",Ze=!1,$e=0;$e0?" ":"")+ot.strValue}return C.validate&&!C.validate(Be,Ke)?null:C.singleEnum&&Ze?Be.length===1&&ye(Be[0])?{name:m,value:Be[0],strValue:Be[0],bypass:k}:null:{name:m,value:Be,pfValue:qe,strValue:Re,bypass:k,units:Ke}}var ut=function(){for(var gr=0;grC.max||C.strictMax&&g===C.max))return null;var Rt={name:m,value:g,strValue:""+g+(Je||""),units:Je,bypass:k};return C.unitless||Je!=="px"&&Je!=="em"?Rt.pfValue=g:Rt.pfValue=Je==="px"||!Je?g:this.getEmSizeInPixels()*g,(Je==="ms"||Je==="s")&&(Rt.pfValue=Je==="ms"?g:1e3*g),(Je==="deg"||Je==="rad")&&(Rt.pfValue=Je==="rad"?g:yY(g)),Je==="%"&&(Rt.pfValue=g/100),Rt}else if(C.propList){var $t=[],bn=""+g;if(bn!=="none"){for(var Cn=bn.split(/\s*,\s*|\s+/),Kn=0;Kn0&&F>0&&!isNaN(T.w)&&!isNaN(T.h)&&T.w>0&&T.h>0){H=Math.min((I-2*k)/T.w,(F-2*k)/T.h),H=H>this._private.maxZoom?this._private.maxZoom:H,H=H=T.minZoom&&(T.maxZoom=k),this},minZoom:function(g){return g===void 0?this._private.minZoom:this.zoomRange({min:g})},maxZoom:function(g){return g===void 0?this._private.maxZoom:this.zoomRange({max:g})},getZoomedViewport:function(g){var k=this._private,T=k.pan,A=k.zoom,D,I,F=!1;if(k.zoomingEnabled||(F=!0),te(g)?I=g:de(g)&&(I=g.level,g.position!=null?D=E9(g.position,A,T):g.renderedPosition!=null&&(D=g.renderedPosition),D!=null&&!k.panningEnabled&&(F=!0)),I=I>k.maxZoom?k.maxZoom:I,I=Ik.maxZoom||!k.zoomingEnabled?I=!0:(k.zoom=H,D.push("zoom"))}if(A&&(!I||!g.cancelOnFailedZoom)&&k.panningEnabled){var C=g.pan;te(C.x)&&(k.pan.x=C.x,F=!1),te(C.y)&&(k.pan.y=C.y,F=!1),F||D.push("pan")}return D.length>0&&(D.push("viewport"),this.emit(D.join(" ")),this.notify("viewport")),this},center:function(g){var k=this.getCenterPan(g);return k&&(this._private.pan=k,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(g,k){if(this._private.panningEnabled){if(ye(g)){var T=g;g=this.mutableElements().filter(T)}else he(g)||(g=this.mutableElements());if(g.length!==0){var A=g.boundingBox(),D=this.width(),I=this.height();k=k===void 0?this._private.zoom:k;var F={x:(D-k*(A.x1+A.x2))/2,y:(I-k*(A.y1+A.y2))/2};return F}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var g=this._private,k=g.container;return g.sizeCache=g.sizeCache||(k?function(){var T=$.getComputedStyle(k),A=function(I){return parseFloat(T.getPropertyValue(I))};return{width:k.clientWidth-A("padding-left")-A("padding-right"),height:k.clientHeight-A("padding-top")-A("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var g=this._private.pan,k=this._private.zoom,T=this.renderedExtent(),A={x1:(T.x1-g.x)/k,x2:(T.x2-g.x)/k,y1:(T.y1-g.y)/k,y2:(T.y2-g.y)/k};return A.w=A.x2-A.x1,A.h=A.y2-A.y1,A},renderedExtent:function(){var g=this.width(),k=this.height();return{x1:0,y1:0,x2:g,y2:k,w:g,h:k}},multiClickDebounceTime:function(g){if(g)this._private.multiClickDebounceTime=g;else return this._private.multiClickDebounceTime;return this}};x3.centre=x3.center,x3.autolockNodes=x3.autolock,x3.autoungrabifyNodes=x3.autoungrabify;var Ix={data:Fc.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Fc.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Fc.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Fc.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Ix.attr=Ix.data,Ix.removeAttr=Ix.removeData;var Ox=function(g){var k=this;g=Oe({},g);var T=g.container;T&&!De(T)&&De(T[0])&&(T=T[0]);var A=T?T._cyreg:null;A=A||{},A&&A.cy&&(A.cy.destroy(),A={});var D=A.readies=A.readies||[];T&&(T._cyreg=A),A.cy=k;var I=$!==void 0&&T!==void 0&&!g.headless,F=g;F.layout=Oe({name:I?"grid":"null"},F.layout),F.renderer=Oe({name:I?"canvas":"null"},F.renderer);var H=function(ae,ue,_e){return ue!==void 0?ue:_e!==void 0?_e:ae},C=this._private={container:T,ready:!1,options:F,elements:new Wf(this),listeners:[],aniEles:new Wf(this),data:F.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:H(!0,F.zoomingEnabled),userZoomingEnabled:H(!0,F.userZoomingEnabled),panningEnabled:H(!0,F.panningEnabled),userPanningEnabled:H(!0,F.userPanningEnabled),boxSelectionEnabled:H(!0,F.boxSelectionEnabled),autolock:H(!1,F.autolock,F.autolockNodes),autoungrabify:H(!1,F.autoungrabify,F.autoungrabifyNodes),autounselectify:H(!1,F.autounselectify),styleEnabled:F.styleEnabled===void 0?I:F.styleEnabled,zoom:te(F.zoom)?F.zoom:1,pan:{x:de(F.pan)&&te(F.pan.x)?F.pan.x:0,y:de(F.pan)&&te(F.pan.y)?F.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:H(250,F.multiClickDebounceTime)};this.createEmitter(),this.selectionType(F.selectionType),this.zoomRange({min:F.minZoom,max:F.maxZoom});var G=function(ae,ue){var _e=ae.some(jt);if(_e)return q5.all(ae).then(ue);ue(ae)};C.styleEnabled&&k.setStyle([]);var U=Oe({},F,F.renderer);k.initRenderer(U);var Z=function(ae,ue,_e){k.notifications(!1);var be=k.mutableElements();be.length>0&&be.remove(),ae!=null&&(de(ae)||Ae(ae))&&k.add(ae),k.one("layoutready",function(Le){k.notifications(!0),k.emit(Le),k.one("load",ue),k.emitAndNotify("load")}).one("layoutstop",function(){k.one("done",_e),k.emit("done")});var Se=Oe({},k._private.options.layout);Se.eles=k.elements(),k.layout(Se).run()};G([F.style,F.elements],function(ne){var ae=ne[0],ue=ne[1];C.styleEnabled&&k.style().append(ae),Z(ue,function(){k.startAnimationLoop(),C.ready=!0,ke(F.ready)&&k.on("ready",F.ready);for(var _e=0;_e0,H=zd(g.boundingBox?g.boundingBox:{x1:0,y1:0,w:k.width(),h:k.height()}),C;if(he(g.roots))C=g.roots;else if(Ae(g.roots)){for(var G=[],U=0;U0;){var un=lt(),Rt=ot(un,Je);if(Rt)un.outgoers().filter(function(Li){return Li.isNode()&&T.has(Li)}).forEach(Ct);else if(Rt===null){Vo("Detected double maximal shift for node `"+un.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}$e();var $t=0;if(g.avoidOverlap)for(var bn=0;bn0&&be[0].length<=3?Ks/2:0),On=2*Math.PI/be[Yi].length*Di;return Yi===0&&be[0].length===1&&(We=1),{x:Ti.x+We*Math.cos(On),y:Ti.y+We*Math.sin(On)}}else{var Ar={x:Ti.x+(Di+1-(es+1)/2)*eo,y:(Yi+1)*sa};return Ar}};return T.nodes().layoutPositions(this,g,Ba),this};var LJ={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(g,k){return!0},ready:void 0,stop:void 0,transform:function(g,k){return k}};function nT(m){this.options=Oe({},LJ,m)}nT.prototype.run=function(){var m=this.options,g=m,k=m.cy,T=g.eles,A=g.counterclockwise!==void 0?!g.counterclockwise:g.clockwise,D=T.nodes().not(":parent");g.sort&&(D=D.sort(g.sort));for(var I=zd(g.boundingBox?g.boundingBox:{x1:0,y1:0,w:k.width(),h:k.height()}),F={x:I.x1+I.w/2,y:I.y1+I.h/2},H=g.sweep===void 0?2*Math.PI-2*Math.PI/D.length:g.sweep,C=H/Math.max(1,D.length-1),G,U=0,Z=0;Z1&&g.avoidOverlap){U*=1.75;var be=Math.cos(C)-Math.cos(0),Se=Math.sin(C)-Math.sin(0),Le=Math.sqrt(U*U/(be*be+Se*Se));G=Math.max(Le,G)}var Be=function(qe,Re){var Ze=g.startAngle+Re*C*(A?1:-1),$e=G*Math.cos(Ze),ot=G*Math.sin(Ze),ut={x:F.x+$e,y:F.y+ot};return ut};return T.nodes().layoutPositions(this,g,Be),this};var MJ={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(g){return g.degree()},levelWidth:function(g){return g.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(g,k){return!0},ready:void 0,stop:void 0,transform:function(g,k){return k}};function TR(m){this.options=Oe({},MJ,m)}TR.prototype.run=function(){for(var m=this.options,g=m,k=g.counterclockwise!==void 0?!g.counterclockwise:g.clockwise,T=m.cy,A=g.eles,D=A.nodes().not(":parent"),I=zd(g.boundingBox?g.boundingBox:{x1:0,y1:0,w:T.width(),h:T.height()}),F={x:I.x1+I.w/2,y:I.y1+I.h/2},H=[],C=0,G=0;G0){var Ke=Math.abs(Se[0].value-Be.value);Ke>=_e&&(Se=[],be.push(Se))}Se.push(Be)}var qe=C+g.minNodeSpacing;if(!g.avoidOverlap){var Re=be.length>0&&be[0].length>1,Ze=Math.min(I.w,I.h)/2-qe,$e=Ze/(be.length+Re?1:0);qe=Math.min(qe,$e)}for(var ot=0,ut=0;ut1&&g.avoidOverlap){var un=Math.cos(lt)-Math.cos(0),Rt=Math.sin(lt)-Math.sin(0),$t=Math.sqrt(qe*qe/(un*un+Rt*Rt));ot=Math.max($t,ot)}Je.r=ot,ot+=qe}if(g.equidistant){for(var bn=0,Cn=0,Kn=0;Kn=m.numIter||(FJ(T,m),T.temperature=T.temperature*m.coolingFactor,T.temperature=m.animationThreshold&&D(),Aa(U)}};G()}else{for(;C;)C=I(H),H++;SR(T,m),F()}return this},rT.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},rT.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var IJ=function(g,k,T){for(var A=T.eles.edges(),D=T.eles.nodes(),I={isCompound:g.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:D.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:A.size(),temperature:T.initialTemp,clientWidth:g.width(),clientHeight:g.width(),boundingBox:zd(T.boundingBox?T.boundingBox:{x1:0,y1:0,w:g.width(),h:g.height()})},F=T.eles.components(),H={},C=0;C0){I.graphSet.push(Re);for(var C=0;CA.count?0:A.graph},NJ=function m(g,k,T,A){var D=A.graphSet[T];if(-10)var U=A.nodeOverlap*G,Z=Math.sqrt(F*F+H*H),ne=U*F/Z,ae=U*H/Z;else var ue=iT(g,F,H),_e=iT(k,-1*F,-1*H),be=_e.x-ue.x,Se=_e.y-ue.y,Le=be*be+Se*Se,Z=Math.sqrt(Le),U=(g.nodeRepulsion+k.nodeRepulsion)/Le,ne=U*be/Z,ae=U*Se/Z;g.isLocked||(g.offsetX-=ne,g.offsetY-=ae),k.isLocked||(k.offsetX+=ne,k.offsetY+=ae)}},HJ=function(g,k,T,A){if(T>0)var D=g.maxX-k.minX;else var D=k.maxX-g.minX;if(A>0)var I=g.maxY-k.minY;else var I=k.maxY-g.minY;return D>=0&&I>=0?Math.sqrt(D*D+I*I):0},iT=function(g,k,T){var A=g.positionX,D=g.positionY,I=g.height||1,F=g.width||1,H=T/k,C=I/F,G={};return k===0&&0T?(G.x=A,G.y=D+I/2,G):0k&&-1*C<=H&&H<=C?(G.x=A-F/2,G.y=D-F*T/2/k,G):0=C)?(G.x=A+I*k/2/T,G.y=D+I/2,G):(0>T&&(H<=-1*C||H>=C)&&(G.x=A-I*k/2/T,G.y=D-I/2),G)},zJ=function(g,k){for(var T=0;TT){var _e=k.gravity*ne/ue,be=k.gravity*ae/ue;Z.offsetX+=_e,Z.offsetY+=be}}}}},qJ=function(g,k){var T=[],A=0,D=-1;for(T.push.apply(T,g.graphSet[0]),D+=g.graphSet[0].length;A<=D;){var I=T[A++],F=g.idToIndex[I],H=g.layoutNodes[F],C=H.children;if(0T)var D={x:T*g/A,y:T*k/A};else var D={x:g,y:k};return D},WJ=function m(g,k){var T=g.parentId;if(T!=null){var A=k.layoutNodes[k.idToIndex[T]],D=!1;if((A.maxX==null||g.maxX+A.padRight>A.maxX)&&(A.maxX=g.maxX+A.padRight,D=!0),(A.minX==null||g.minX-A.padLeftA.maxY)&&(A.maxY=g.maxY+A.padBottom,D=!0),(A.minY==null||g.minY-A.padTopbe&&(ae+=_e+k.componentSpacing,ne=0,ue=0,_e=0)}}},KJ={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(g){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(g,k){return!0},ready:void 0,stop:void 0,transform:function(g,k){return k}};function AR(m){this.options=Oe({},KJ,m)}AR.prototype.run=function(){var m=this.options,g=m,k=m.cy,T=g.eles,A=T.nodes().not(":parent");g.sort&&(A=A.sort(g.sort));var D=zd(g.boundingBox?g.boundingBox:{x1:0,y1:0,w:k.width(),h:k.height()});if(D.h===0||D.w===0)T.nodes().layoutPositions(this,g,function(sr){return{x:D.x1,y:D.y1}});else{var I=A.size(),F=Math.sqrt(I*D.h/D.w),H=Math.round(F),C=Math.round(D.w/D.h*F),G=function(yr){if(yr==null)return Math.min(H,C);var hr=Math.min(H,C);hr==H?H=yr:C=yr},U=function(yr){if(yr==null)return Math.max(H,C);var hr=Math.max(H,C);hr==H?H=yr:C=yr},Z=g.rows,ne=g.cols!=null?g.cols:g.columns;if(Z!=null&&ne!=null)H=Z,C=ne;else if(Z!=null&&ne==null)H=Z,C=Math.ceil(I/H);else if(Z==null&&ne!=null)C=ne,H=Math.ceil(I/C);else if(C*H>I){var ae=G(),ue=U();(ae-1)*ue>=I?G(ae-1):(ue-1)*ae>=I&&U(ue-1)}else for(;C*H=I?U(be+1):G(_e+1)}var Se=D.w/C,Le=D.h/H;if(g.condense&&(Se=0,Le=0),g.avoidOverlap)for(var Be=0;Be=C&&(un=0,lt++)},$t={},bn=0;bn(un=OY(m,g,Rt[$t],Rt[$t+1],Rt[$t+2],Rt[$t+3])))return _e(Re,un),!0}else if($e.edgeType==="bezier"||$e.edgeType==="multibezier"||$e.edgeType==="self"||$e.edgeType==="compound"){for(var Rt=$e.allpts,$t=0;$t+5<$e.allpts.length;$t+=4)if(LY(m,g,Rt[$t],Rt[$t+1],Rt[$t+2],Rt[$t+3],Rt[$t+4],Rt[$t+5],lt)&&Ct>(un=IY(m,g,Rt[$t],Rt[$t+1],Rt[$t+2],Rt[$t+3],Rt[$t+4],Rt[$t+5])))return _e(Re,un),!0}for(var bn=bn||Ze.source,Cn=Cn||Ze.target,Kn=A.getArrowWidth(ot,ut),kn=[{name:"source",x:$e.arrowStartX,y:$e.arrowStartY,angle:$e.srcArrowAngle},{name:"target",x:$e.arrowEndX,y:$e.arrowEndY,angle:$e.tgtArrowAngle},{name:"mid-source",x:$e.midX,y:$e.midY,angle:$e.midsrcArrowAngle},{name:"mid-target",x:$e.midX,y:$e.midY,angle:$e.midtgtArrowAngle}],$t=0;$t0&&(be(bn),be(Cn))}function Le(Re,Ze,$e){return gp(Re,Ze,$e)}function Be(Re,Ze){var $e=Re._private,ot=Z,ut;Ze?ut=Ze+"-":ut="",Re.boundingBox();var Je=$e.labelBounds[Ze||"main"],Ct=Re.pstyle(ut+"label").value,lt=Re.pstyle("text-events").strValue==="yes";if(!(!lt||!Ct)){var un=Le($e.rscratch,"labelX",Ze),Rt=Le($e.rscratch,"labelY",Ze),$t=Le($e.rscratch,"labelAngle",Ze),bn=Re.pstyle(ut+"text-margin-x").pfValue,Cn=Re.pstyle(ut+"text-margin-y").pfValue,Kn=Je.x1-ot-bn,kn=Je.x2+ot-bn,Wn=Je.y1-ot-Cn,sr=Je.y2+ot-Cn;if($t){var yr=Math.cos($t),hr=Math.sin($t),nr=function(Ba,Li){return Ba=Ba-un,Li=Li-Rt,{x:Ba*yr-Li*hr+un,y:Ba*hr+Li*yr+Rt}},fn=nr(Kn,Wn),vr=nr(Kn,sr),gr=nr(kn,Wn),ni=nr(kn,sr),Ti=[fn.x+bn,fn.y+Cn,gr.x+bn,gr.y+Cn,ni.x+bn,ni.y+Cn,vr.x+bn,vr.y+Cn];if(Gd(m,g,Ti))return _e(Re),!0}else if($5(Je,m,g))return _e(Re),!0}}for(var Ke=I.length-1;Ke>=0;Ke--){var qe=I[Ke];qe.isNode()?be(qe)||Be(qe):Se(qe)||Be(qe)||Be(qe,"source")||Be(qe,"target")}return F},E3.getAllInBox=function(m,g,k,T){var A=this.getCachedZSortedEles().interactive,D=[],I=Math.min(m,k),F=Math.max(m,k),H=Math.min(g,T),C=Math.max(g,T);m=I,k=F,g=H,T=C;for(var G=zd({x1:m,y1:g,x2:k,y2:T}),U=0;U0?Math.max(is-Uo,0):Math.min(is+Uo,0)},Ct=Je(ot,Ze),lt=Je(ut,$e),un=!1;Se===C?be=Math.abs(Ct)>Math.abs(lt)?A:T:Se===H||Se===F?(be=T,un=!0):(Se===D||Se===I)&&(be=A,un=!0);var Rt=be===T,$t=Rt?lt:Ct,bn=Rt?ut:ot,Cn=WP(bn),Kn=!1;!(un&&(Be||qe))&&(Se===F&&bn<0||Se===H&&bn>0||Se===D&&bn>0||Se===I&&bn<0)&&(Cn*=-1,$t=Cn*Math.abs($t),Kn=!0);var kn;if(Be){var Wn=Ke<0?1+Ke:Ke;kn=Wn*$t}else{var sr=Ke<0?$t:0;kn=sr+Ke*Cn}var yr=function(is){return Math.abs(is)=Math.abs($t)},hr=yr(kn),nr=yr(Math.abs($t)-Math.abs(kn)),fn=hr||nr;if(fn&&!Kn)if(Rt){var vr=Math.abs(bn)<=Z/2,gr=Math.abs(ot)<=ne/2;if(vr){var ni=(G.x1+G.x2)/2,Ti=G.y1,ia=G.y2;k.segpts=[ni,Ti,ni,ia]}else if(gr){var Ba=(G.y1+G.y2)/2,Li=G.x1,wi=G.x2;k.segpts=[Li,Ba,wi,Ba]}else k.segpts=[G.x1,G.y2]}else{var Ts=Math.abs(bn)<=U/2,Yi=Math.abs(ut)<=ae/2;if(Ts){var Di=(G.y1+G.y2)/2,es=G.x1,eo=G.x2;k.segpts=[es,Di,eo,Di]}else if(Yi){var sa=(G.x1+G.x2)/2,Ks=G.y1,Ar=G.y2;k.segpts=[sa,Ks,sa,Ar]}else k.segpts=[G.x2,G.y1]}else if(Rt){var We=G.y1+kn+(_e?Z/2*Cn:0),On=G.x1,Ir=G.x2;k.segpts=[On,We,Ir,We]}else{var ar=G.x1+kn+(_e?U/2*Cn:0),or=G.y1,qa=G.y2;k.segpts=[ar,or,ar,qa]}},hd.tryToCorrectInvalidPoints=function(m,g){var k=m._private.rscratch;if(k.edgeType==="bezier"){var T=g.srcPos,A=g.tgtPos,D=g.srcW,I=g.srcH,F=g.tgtW,H=g.tgtH,C=g.srcShape,G=g.tgtShape,U=!te(k.startX)||!te(k.startY),Z=!te(k.arrowStartX)||!te(k.arrowStartY),ne=!te(k.endX)||!te(k.endY),ae=!te(k.arrowEndX)||!te(k.arrowEndY),ue=3,_e=this.getArrowWidth(m.pstyle("width").pfValue,m.pstyle("arrow-scale").value)*this.arrowShapeWidth,be=ue*_e,Se=v3({x:k.ctrlpts[0],y:k.ctrlpts[1]},{x:k.startX,y:k.startY}),Le=Selt.poolIndex()){var un=Ct;Ct=lt,lt=un}var Rt=$e.srcPos=Ct.position(),$t=$e.tgtPos=lt.position(),bn=$e.srcW=Ct.outerWidth(),Cn=$e.srcH=Ct.outerHeight(),Kn=$e.tgtW=lt.outerWidth(),kn=$e.tgtH=lt.outerHeight(),Wn=$e.srcShape=k.nodeShapes[g.getNodeShape(Ct)],sr=$e.tgtShape=k.nodeShapes[g.getNodeShape(lt)];$e.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var yr=0;yr<$e.eles.length;yr++){var hr=$e.eles[yr],nr=hr[0]._private.rscratch,fn=hr.pstyle("curve-style").value,vr=fn==="unbundled-bezier"||fn==="segments"||fn==="taxi",gr=!Ct.same(hr.source());if(!$e.calculatedIntersection&&Ct!==lt&&($e.hasBezier||$e.hasUnbundled)){$e.calculatedIntersection=!0;var ni=Wn.intersectLine(Rt.x,Rt.y,bn,Cn,$t.x,$t.y,0),Ti=$e.srcIntn=ni,ia=sr.intersectLine($t.x,$t.y,Kn,kn,Rt.x,Rt.y,0),Ba=$e.tgtIntn=ia,Li=$e.intersectionPts={x1:ni[0],x2:ia[0],y1:ni[1],y2:ia[1]},wi=$e.posPts={x1:Rt.x,x2:$t.x,y1:Rt.y,y2:$t.y},Ts=ia[1]-ni[1],Yi=ia[0]-ni[0],Di=Math.sqrt(Yi*Yi+Ts*Ts),es=$e.vector={x:Yi,y:Ts},eo=$e.vectorNorm={x:es.x/Di,y:es.y/Di},sa={x:-eo.y,y:eo.x};$e.nodesOverlap=!te(Di)||sr.checkPoint(ni[0],ni[1],0,Kn,kn,$t.x,$t.y)||Wn.checkPoint(ia[0],ia[1],0,bn,Cn,Rt.x,Rt.y),$e.vectorNormInverse=sa,ot={nodesOverlap:$e.nodesOverlap,dirCounts:$e.dirCounts,calculatedIntersection:!0,hasBezier:$e.hasBezier,hasUnbundled:$e.hasUnbundled,eles:$e.eles,srcPos:$t,tgtPos:Rt,srcW:Kn,srcH:kn,tgtW:bn,tgtH:Cn,srcIntn:Ba,tgtIntn:Ti,srcShape:sr,tgtShape:Wn,posPts:{x1:wi.x2,y1:wi.y2,x2:wi.x1,y2:wi.y1},intersectionPts:{x1:Li.x2,y1:Li.y2,x2:Li.x1,y2:Li.y1},vector:{x:-es.x,y:-es.y},vectorNorm:{x:-eo.x,y:-eo.y},vectorNormInverse:{x:-sa.x,y:-sa.y}}}var Ks=gr?ot:$e;nr.nodesOverlap=Ks.nodesOverlap,nr.srcIntn=Ks.srcIntn,nr.tgtIntn=Ks.tgtIntn,A&&(Ct.isParent()||Ct.isChild()||lt.isParent()||lt.isChild())&&(Ct.parents().anySame(lt)||lt.parents().anySame(Ct)||Ct.same(lt)&&Ct.isParent())?g.findCompoundLoopPoints(hr,Ks,yr,vr):Ct===lt?g.findLoopPoints(hr,Ks,yr,vr):fn==="segments"?g.findSegmentsPoints(hr,Ks):fn==="taxi"?g.findTaxiPoints(hr,Ks):fn==="straight"||!vr&&$e.eles.length%2===1&&yr===Math.floor($e.eles.length/2)?g.findStraightEdgePoints(hr):g.findBezierPoints(hr,Ks,yr,vr,gr),g.findEndpoints(hr),g.tryToCorrectInvalidPoints(hr,Ks),g.checkForInvalidEdgeWarning(hr),g.storeAllpts(hr),g.storeEdgeProjections(hr),g.calculateArrowAngles(hr),g.recalculateEdgeLabelProjections(hr),g.calculateLabelAngles(hr)}},Ke=0;Ke0){var vr=D,gr=w3(vr,F5(k)),ni=w3(vr,F5(fn)),Ti=gr;if(ni2){var ia=w3(vr,{x:fn[2],y:fn[3]});ia0){var On=I,Ir=w3(On,F5(k)),ar=w3(On,F5(We)),or=Ir;if(ar2){var qa=w3(On,{x:We[2],y:We[3]});qa=ae||Re){_e={cp:Be,segment:qe};break}}if(_e)break}var Ze=_e.cp,$e=_e.segment,ot=(ae-be)/$e.length,ut=$e.t1-$e.t0,Je=ne?$e.t0+ut*ot:$e.t1-ut*ot;Je=px(0,Je,1),g=j5(Ze.p0,Ze.p1,Ze.p2,Je),Z=RR(Ze.p0,Ze.p1,Ze.p2,Je);break}case"straight":case"segments":case"haystack":{for(var Ct=0,lt,un,Rt,$t,bn=T.allpts.length,Cn=0;Cn+3=ae));Cn+=2);var Kn=ae-un,kn=Kn/lt;kn=px(0,kn,1),g=xY(Rt,$t,kn),Z=BR(Rt,$t);break}}I("labelX",U,g.x),I("labelY",U,g.y),I("labelAutoAngle",U,Z)}};C("source"),C("target"),this.applyLabelDimensions(m)}},wp.applyLabelDimensions=function(m){this.applyPrefixedLabelDimensions(m),m.isEdge()&&(this.applyPrefixedLabelDimensions(m,"source"),this.applyPrefixedLabelDimensions(m,"target"))},wp.applyPrefixedLabelDimensions=function(m,g){var k=m._private,T=this.getLabelText(m,g),A=this.calculateLabelDimensions(m,T),D=m.pstyle("line-height").pfValue,I=m.pstyle("text-wrap").strValue,F=gp(k.rscratch,"labelWrapCachedLines",g)||[],H=I!=="wrap"?1:Math.max(F.length,1),C=A.height/H,G=C*D,U=A.width,Z=A.height+(H-1)*(D-1)*C;um(k.rstyle,"labelWidth",g,U),um(k.rscratch,"labelWidth",g,U),um(k.rstyle,"labelHeight",g,Z),um(k.rscratch,"labelHeight",g,Z),um(k.rscratch,"labelLineHeight",g,G)},wp.getLabelText=function(m,g){var k=m._private,T=g?g+"-":"",A=m.pstyle(T+"label").strValue,D=m.pstyle("text-transform").value,I=function(Kn,kn){return kn?(um(k.rscratch,Kn,g,kn),kn):gp(k.rscratch,Kn,g)};if(!A)return"";D=="none"||(D=="uppercase"?A=A.toUpperCase():D=="lowercase"&&(A=A.toLowerCase()));var F=m.pstyle("text-wrap").value;if(F==="wrap"){var H=I("labelKey");if(H!=null&&I("labelWrapKey")===H)return I("labelWrapCachedText");for(var C="​",G=A.split(` -`),U=m.pstyle("text-max-width").pfValue,Z=m.pstyle("text-overflow-wrap").value,ne=Z==="anywhere",ae=[],ue=/[\s\u200b]+/,_e=ne?"":" ",be=0;beU){for(var qe=Se.split(ue),Re="",Ze=0;ZeCt)break;lt+=A[$t],$t===A.length-1&&(Rt=!0)}return Rt||(lt+=un),lt}return A},wp.getLabelJustification=function(m){var g=m.pstyle("text-justification").strValue,k=m.pstyle("text-halign").strValue;if(g==="auto")if(m.isNode())switch(k){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return g},wp.calculateLabelDimensions=function(m,g){var k=this,T=od(g,m._private.labelDimsKey),A=k.labelDimCache||(k.labelDimCache=[]),D=A[T];if(D!=null)return D;var I=0,F=m.pstyle("font-style").strValue,H=m.pstyle("font-size").pfValue,C=m.pstyle("font-family").strValue,G=m.pstyle("font-weight").strValue,U=this.labelCalcCanvas,Z=this.labelCalcCanvasContext;if(!U){U=this.labelCalcCanvas=document.createElement("canvas"),Z=this.labelCalcCanvasContext=U.getContext("2d");var ne=U.style;ne.position="absolute",ne.left="-9999px",ne.top="-9999px",ne.zIndex="-1",ne.visibility="hidden",ne.pointerEvents="none"}Z.font="".concat(F," ").concat(G," ").concat(H,"px ").concat(C);for(var ae=0,ue=0,_e=g.split(` -`),be=0;be<_e.length;be++){var Se=_e[be],Le=Z.measureText(Se),Be=Math.ceil(Le.width),Ke=H;ae=Math.max(Be,ae),ue+=Ke}return ae+=I,ue+=I,A[T]={width:ae,height:ue}},wp.calculateLabelAngle=function(m,g){var k=m._private,T=k.rscratch,A=m.isEdge(),D=g?g+"-":"",I=m.pstyle(D+"text-rotation"),F=I.strValue;return F==="none"?0:A&&F==="autorotate"?T.labelAutoAngle:F==="autorotate"?0:I.pfValue},wp.calculateLabelAngles=function(m){var g=this,k=m.isEdge(),T=m._private,A=T.rscratch;A.labelAngle=g.calculateLabelAngle(m),k&&(A.sourceLabelAngle=g.calculateLabelAngle(m,"source"),A.targetLabelAngle=g.calculateLabelAngle(m,"target"))};var ch={},YL=28,FR=!1;ch.getNodeShape=function(m){var g=this,k=m.pstyle("shape").value;if(k==="cutrectangle"&&(m.width()1&&arguments[1]!==void 0?arguments[1]:!0;if(g.merge(I),F)for(var H=0;H=m.desktopTapThreshold2}var ov=T(We);Yf&&(m.hoverData.tapholdCancelled=!0);var mm=function(){var $2=m.hoverData.dragDelta=m.hoverData.dragDelta||[];$2.length===0?($2.push(lo[0]),$2.push(lo[1])):($2[0]+=lo[0],$2[1]+=lo[1])};Ir=!0,k(uo,["mousemove","vmousemove","tapdrag"],We,{x:qr[0],y:qr[1]});var l6=function(){m.data.bgActivePosistion=void 0,m.hoverData.selecting||ar.emit({originalEvent:We,type:"boxstart",position:{x:qr[0],y:qr[1]}}),qc[4]=1,m.hoverData.selecting=!0,m.redrawHint("select",!0),m.redraw()};if(m.hoverData.which===3){if(Yf){var S3={originalEvent:We,type:"cxtdrag",position:{x:qr[0],y:qr[1]}};Ra?Ra.emit(S3):ar.emit(S3),m.hoverData.cxtDragged=!0,(!m.hoverData.cxtOver||uo!==m.hoverData.cxtOver)&&(m.hoverData.cxtOver&&m.hoverData.cxtOver.emit({originalEvent:We,type:"cxtdragout",position:{x:qr[0],y:qr[1]}}),m.hoverData.cxtOver=uo,uo&&uo.emit({originalEvent:We,type:"cxtdragover",position:{x:qr[0],y:qr[1]}}))}}else if(m.hoverData.dragging){if(Ir=!0,ar.panningEnabled()&&ar.userPanningEnabled()){var h6;if(m.hoverData.justStartedPan){var gT=m.hoverData.mdownPos;h6={x:(qr[0]-gT[0])*or,y:(qr[1]-gT[1])*or},m.hoverData.justStartedPan=!1}else h6={x:lo[0]*or,y:lo[1]*or};ar.panBy(h6),ar.emit("dragpan"),m.hoverData.dragged=!0}qr=m.projectIntoViewport(We.clientX,We.clientY)}else if(qc[4]==1&&(Ra==null||Ra.pannable())){if(Yf){if(!m.hoverData.dragging&&ar.boxSelectionEnabled()&&(ov||!ar.panningEnabled()||!ar.userPanningEnabled()))l6();else if(!m.hoverData.selecting&&ar.panningEnabled()&&ar.userPanningEnabled()){var A3=A(Ra,m.hoverData.downs);A3&&(m.hoverData.dragging=!0,m.hoverData.justStartedPan=!0,qc[4]=0,m.data.bgActivePosistion=F5(is),m.redrawHint("select",!0),m.redraw())}Ra&&Ra.pannable()&&Ra.active()&&Ra.unactivate()}}else{if(Ra&&Ra.pannable()&&Ra.active()&&Ra.unactivate(),(!Ra||!Ra.grabbed())&&uo!=Lc&&(Lc&&k(Lc,["mouseout","tapdragout"],We,{x:qr[0],y:qr[1]}),uo&&k(uo,["mouseover","tapdragover"],We,{x:qr[0],y:qr[1]}),m.hoverData.last=uo),Ra)if(Yf){if(ar.boxSelectionEnabled()&&ov)Ra&&Ra.grabbed()&&(ue(Sl),Ra.emit("freeon"),Sl.emit("free"),m.dragData.didDrag&&(Ra.emit("dragfreeon"),Sl.emit("dragfree"))),l6();else if(Ra&&Ra.grabbed()&&m.nodeIsDraggable(Ra)){var qd=!m.dragData.didDrag;qd&&m.redrawHint("eles",!0),m.dragData.didDrag=!0,m.hoverData.draggingEles||ne(Sl,{inDragLayer:!0});var _1={x:0,y:0};if(te(lo[0])&&te(lo[1])&&(_1.x+=lo[0],_1.y+=lo[1],qd)){var Vd=m.hoverData.dragDelta;Vd&&te(Vd[0])&&te(Vd[1])&&(_1.x+=Vd[0],_1.y+=Vd[1])}m.hoverData.draggingEles=!0,Sl.silentShift(_1).emit("position drag"),m.redrawHint("drag",!0),m.redraw()}}else mm();Ir=!0}if(qc[2]=qr[0],qc[3]=qr[1],Ir)return We.stopPropagation&&We.stopPropagation(),We.preventDefault&&We.preventDefault(),!1}},!1);var $e,ot,ut;m.registerBinding(window,"mouseup",function(We){var On=m.hoverData.capture;if(On){m.hoverData.capture=!1;var Ir=m.cy,ar=m.projectIntoViewport(We.clientX,We.clientY),or=m.selection,qa=m.findNearestElement(ar[0],ar[1],!0,!1),qr=m.dragData.possibleDragElements,is=m.hoverData.down,Uo=T(We);if(m.data.bgActivePosistion&&(m.redrawHint("select",!0),m.redraw()),m.hoverData.tapholdCancelled=!0,m.data.bgActivePosistion=void 0,is&&is.unactivate(),m.hoverData.which===3){var qc={originalEvent:We,type:"cxttapend",position:{x:ar[0],y:ar[1]}};if(is?is.emit(qc):Ir.emit(qc),!m.hoverData.cxtDragged){var uo={originalEvent:We,type:"cxttap",position:{x:ar[0],y:ar[1]}};is?is.emit(uo):Ir.emit(uo)}m.hoverData.cxtDragged=!1,m.hoverData.which=null}else if(m.hoverData.which===1){if(k(qa,["mouseup","tapend","vmouseup"],We,{x:ar[0],y:ar[1]}),!m.dragData.didDrag&&!m.hoverData.dragged&&!m.hoverData.selecting&&!m.hoverData.isOverThresholdDrag&&(k(is,["click","tap","vclick"],We,{x:ar[0],y:ar[1]}),ot=!1,We.timeStamp-ut<=Ir.multiClickDebounceTime()?($e&&clearTimeout($e),ot=!0,ut=null,k(is,["dblclick","dbltap","vdblclick"],We,{x:ar[0],y:ar[1]})):($e=setTimeout(function(){ot||k(is,["oneclick","onetap","voneclick"],We,{x:ar[0],y:ar[1]})},Ir.multiClickDebounceTime()),ut=We.timeStamp)),is==null&&!m.dragData.didDrag&&!m.hoverData.selecting&&!m.hoverData.dragged&&!T(We)&&(Ir.$(g).unselect(["tapunselect"]),qr.length>0&&m.redrawHint("eles",!0),m.dragData.possibleDragElements=qr=Ir.collection()),qa==is&&!m.dragData.didDrag&&!m.hoverData.selecting&&qa!=null&&qa._private.selectable&&(m.hoverData.dragging||(Ir.selectionType()==="additive"||Uo?qa.selected()?qa.unselect(["tapunselect"]):qa.select(["tapselect"]):Uo||(Ir.$(g).unmerge(qa).unselect(["tapunselect"]),qa.select(["tapselect"]))),m.redrawHint("eles",!0)),m.hoverData.selecting){var Lc=Ir.collection(m.getAllInBox(or[0],or[1],or[2],or[3]));m.redrawHint("select",!0),Lc.length>0&&m.redrawHint("eles",!0),Ir.emit({type:"boxend",originalEvent:We,position:{x:ar[0],y:ar[1]}});var Ra=function(Yf){return Yf.selectable()&&!Yf.selected()};Ir.selectionType()==="additive"||Uo||Ir.$(g).unmerge(Lc).unselect(),Lc.emit("box").stdFilter(Ra).select().emit("boxselect"),m.redraw()}if(m.hoverData.dragging&&(m.hoverData.dragging=!1,m.redrawHint("select",!0),m.redrawHint("eles",!0),m.redraw()),!or[4]){m.redrawHint("drag",!0),m.redrawHint("eles",!0);var lo=is&&is.grabbed();ue(qr),lo&&(is.emit("freeon"),qr.emit("free"),m.dragData.didDrag&&(is.emit("dragfreeon"),qr.emit("dragfree")))}}or[4]=0,m.hoverData.down=null,m.hoverData.cxtStarted=!1,m.hoverData.draggingEles=!1,m.hoverData.selecting=!1,m.hoverData.isOverThresholdDrag=!1,m.dragData.didDrag=!1,m.hoverData.dragged=!1,m.hoverData.dragDelta=[],m.hoverData.mdownPos=null,m.hoverData.mdownGPos=null}},!1);var Je=function(We){if(!m.scrollingPage){var On=m.cy,Ir=On.zoom(),ar=On.pan(),or=m.projectIntoViewport(We.clientX,We.clientY),qa=[or[0]*Ir+ar.x,or[1]*Ir+ar.y];if(m.hoverData.draggingEles||m.hoverData.dragging||m.hoverData.cxtStarted||Re()){We.preventDefault();return}if(On.panningEnabled()&&On.userPanningEnabled()&&On.zoomingEnabled()&&On.userZoomingEnabled()){We.preventDefault(),m.data.wheelZooming=!0,clearTimeout(m.data.wheelTimeout),m.data.wheelTimeout=setTimeout(function(){m.data.wheelZooming=!1,m.redrawHint("eles",!0),m.redraw()},150);var qr;We.deltaY!=null?qr=We.deltaY/-250:We.wheelDeltaY!=null?qr=We.wheelDeltaY/1e3:qr=We.wheelDelta/1e3,qr=qr*m.wheelSensitivity;var is=We.deltaMode===1;is&&(qr*=33);var Uo=On.zoom()*Math.pow(10,qr);We.type==="gesturechange"&&(Uo=m.gestureStartZoom*We.scale),On.zoom({level:Uo,renderedPosition:{x:qa[0],y:qa[1]}}),On.emit(We.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};m.registerBinding(m.container,"wheel",Je,!0),m.registerBinding(window,"scroll",function(We){m.scrollingPage=!0,clearTimeout(m.scrollingPageTimeout),m.scrollingPageTimeout=setTimeout(function(){m.scrollingPage=!1},250)},!0),m.registerBinding(m.container,"gesturestart",function(We){m.gestureStartZoom=m.cy.zoom(),m.hasTouchStarted||We.preventDefault()},!0),m.registerBinding(m.container,"gesturechange",function(Ar){m.hasTouchStarted||Je(Ar)},!0),m.registerBinding(m.container,"mouseout",function(We){var On=m.projectIntoViewport(We.clientX,We.clientY);m.cy.emit({originalEvent:We,type:"mouseout",position:{x:On[0],y:On[1]}})},!1),m.registerBinding(m.container,"mouseover",function(We){var On=m.projectIntoViewport(We.clientX,We.clientY);m.cy.emit({originalEvent:We,type:"mouseover",position:{x:On[0],y:On[1]}})},!1);var Ct,lt,un,Rt,$t,bn,Cn,Kn,kn,Wn,sr,yr,hr,nr=function(We,On,Ir,ar){return Math.sqrt((Ir-We)*(Ir-We)+(ar-On)*(ar-On))},fn=function(We,On,Ir,ar){return(Ir-We)*(Ir-We)+(ar-On)*(ar-On)},vr;m.registerBinding(m.container,"touchstart",vr=function(We){if(m.hasTouchStarted=!0,!!Ze(We)){be(),m.touchData.capture=!0,m.data.bgActivePosistion=void 0;var On=m.cy,Ir=m.touchData.now,ar=m.touchData.earlier;if(We.touches[0]){var or=m.projectIntoViewport(We.touches[0].clientX,We.touches[0].clientY);Ir[0]=or[0],Ir[1]=or[1]}if(We.touches[1]){var or=m.projectIntoViewport(We.touches[1].clientX,We.touches[1].clientY);Ir[2]=or[0],Ir[3]=or[1]}if(We.touches[2]){var or=m.projectIntoViewport(We.touches[2].clientX,We.touches[2].clientY);Ir[4]=or[0],Ir[5]=or[1]}if(We.touches[1]){m.touchData.singleTouchMoved=!0,ue(m.dragData.touchDragEles);var qa=m.findContainerClientCoords();kn=qa[0],Wn=qa[1],sr=qa[2],yr=qa[3],Ct=We.touches[0].clientX-kn,lt=We.touches[0].clientY-Wn,un=We.touches[1].clientX-kn,Rt=We.touches[1].clientY-Wn,hr=0<=Ct&&Ct<=sr&&0<=un&&un<=sr&&0<=lt&<<=yr&&0<=Rt&&Rt<=yr;var qr=On.pan(),is=On.zoom();$t=nr(Ct,lt,un,Rt),bn=fn(Ct,lt,un,Rt),Cn=[(Ct+un)/2,(lt+Rt)/2],Kn=[(Cn[0]-qr.x)/is,(Cn[1]-qr.y)/is];var Uo=200,qc=Uo*Uo;if(bn=1){for(var yp=m.touchData.startPosition=[],Xf=0;Xf=m.touchTapThreshold2}if(On&&m.touchData.cxt){We.preventDefault();var yp=We.touches[0].clientX-kn,Xf=We.touches[0].clientY-Wn,gg=We.touches[1].clientX-kn,fd=We.touches[1].clientY-Wn,ov=fn(yp,Xf,gg,fd),mm=ov/bn,l6=150,S3=l6*l6,h6=1.5,gT=h6*h6;if(mm>=gT||ov>=S3){m.touchData.cxt=!1,m.data.bgActivePosistion=void 0,m.redrawHint("select",!0);var A3={originalEvent:We,type:"cxttapend",position:{x:or[0],y:or[1]}};m.touchData.start?(m.touchData.start.unactivate().emit(A3),m.touchData.start=null):ar.emit(A3)}}if(On&&m.touchData.cxt){var A3={originalEvent:We,type:"cxtdrag",position:{x:or[0],y:or[1]}};m.data.bgActivePosistion=void 0,m.redrawHint("select",!0),m.touchData.start?m.touchData.start.emit(A3):ar.emit(A3),m.touchData.start&&(m.touchData.start._private.grabbed=!1),m.touchData.cxtDragged=!0;var qd=m.findNearestElement(or[0],or[1],!0,!0);(!m.touchData.cxtOver||qd!==m.touchData.cxtOver)&&(m.touchData.cxtOver&&m.touchData.cxtOver.emit({originalEvent:We,type:"cxtdragout",position:{x:or[0],y:or[1]}}),m.touchData.cxtOver=qd,qd&&qd.emit({originalEvent:We,type:"cxtdragover",position:{x:or[0],y:or[1]}}))}else if(On&&We.touches[2]&&ar.boxSelectionEnabled())We.preventDefault(),m.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,m.touchData.selecting||ar.emit({originalEvent:We,type:"boxstart",position:{x:or[0],y:or[1]}}),m.touchData.selecting=!0,m.touchData.didSelect=!0,Ir[4]=1,!Ir||Ir.length===0||Ir[0]===void 0?(Ir[0]=(or[0]+or[2]+or[4])/3,Ir[1]=(or[1]+or[3]+or[5])/3,Ir[2]=(or[0]+or[2]+or[4])/3+1,Ir[3]=(or[1]+or[3]+or[5])/3+1):(Ir[2]=(or[0]+or[2]+or[4])/3,Ir[3]=(or[1]+or[3]+or[5])/3),m.redrawHint("select",!0),m.redraw();else if(On&&We.touches[1]&&!m.touchData.didSelect&&ar.zoomingEnabled()&&ar.panningEnabled()&&ar.userZoomingEnabled()&&ar.userPanningEnabled()){We.preventDefault(),m.data.bgActivePosistion=void 0,m.redrawHint("select",!0);var _1=m.dragData.touchDragEles;if(_1){m.redrawHint("drag",!0);for(var Vd=0;Vd<_1.length;Vd++){var pT=_1[Vd]._private;pT.grabbed=!1,pT.rscratch.inDragLayer=!1}}var $2=m.touchData.start,yp=We.touches[0].clientX-kn,Xf=We.touches[0].clientY-Wn,gg=We.touches[1].clientX-kn,fd=We.touches[1].clientY-Wn,QR=nr(yp,Xf,gg,fd),Dee=QR/$t;if(hr){var Iee=yp-Ct,Oee=Xf-lt,Nee=gg-un,Pee=fd-Rt,Bee=(Iee+Nee)/2,Ree=(Oee+Pee)/2,Gx=ar.zoom(),iM=Gx*Dee,bT=ar.pan(),ZR=Kn[0]*Gx+bT.x,JR=Kn[1]*Gx+bT.y,Fee={x:-iM/Gx*(ZR-bT.x-Bee)+ZR,y:-iM/Gx*(JR-bT.y-Ree)+JR};if($2&&$2.active()){var _1=m.dragData.touchDragEles;ue(_1),m.redrawHint("drag",!0),m.redrawHint("eles",!0),$2.unactivate().emit("freeon"),_1.emit("free"),m.dragData.didDrag&&($2.emit("dragfreeon"),_1.emit("dragfree"))}ar.viewport({zoom:iM,pan:Fee,cancelOnFailedZoom:!0}),ar.emit("pinchzoom"),$t=QR,Ct=yp,lt=Xf,un=gg,Rt=fd,m.pinching=!0}if(We.touches[0]){var is=m.projectIntoViewport(We.touches[0].clientX,We.touches[0].clientY);or[0]=is[0],or[1]=is[1]}if(We.touches[1]){var is=m.projectIntoViewport(We.touches[1].clientX,We.touches[1].clientY);or[2]=is[0],or[3]=is[1]}if(We.touches[2]){var is=m.projectIntoViewport(We.touches[2].clientX,We.touches[2].clientY);or[4]=is[0],or[5]=is[1]}}else if(We.touches[0]&&!m.touchData.didSelect){var kp=m.touchData.start,sM=m.touchData.last,qd;if(!m.hoverData.draggingEles&&!m.swipePanning&&(qd=m.findNearestElement(or[0],or[1],!0,!0)),On&&kp!=null&&We.preventDefault(),On&&kp!=null&&m.nodeIsDraggable(kp))if(qc){var _1=m.dragData.touchDragEles,eF=!m.dragData.didDrag;eF&&ne(_1,{inDragLayer:!0}),m.dragData.didDrag=!0;var qx={x:0,y:0};if(te(uo[0])&&te(uo[1])&&(qx.x+=uo[0],qx.y+=uo[1],eF)){m.redrawHint("eles",!0);var xp=m.touchData.dragDelta;xp&&te(xp[0])&&te(xp[1])&&(qx.x+=xp[0],qx.y+=xp[1])}m.hoverData.draggingEles=!0,_1.silentShift(qx).emit("position drag"),m.redrawHint("drag",!0),m.touchData.startPosition[0]==qa[0]&&m.touchData.startPosition[1]==qa[1]&&m.redrawHint("eles",!0),m.redraw()}else{var xp=m.touchData.dragDelta=m.touchData.dragDelta||[];xp.length===0?(xp.push(uo[0]),xp.push(uo[1])):(xp[0]+=uo[0],xp[1]+=uo[1])}if(k(kp||qd,["touchmove","tapdrag","vmousemove"],We,{x:or[0],y:or[1]}),(!kp||!kp.grabbed())&&qd!=sM&&(sM&&sM.emit({originalEvent:We,type:"tapdragout",position:{x:or[0],y:or[1]}}),qd&&qd.emit({originalEvent:We,type:"tapdragover",position:{x:or[0],y:or[1]}})),m.touchData.last=qd,On)for(var Vd=0;Vd0&&!m.hoverData.draggingEles&&!m.swipePanning&&m.data.bgActivePosistion!=null&&(m.data.bgActivePosistion=void 0,m.redrawHint("select",!0),m.redraw())}},!1);var ni;m.registerBinding(window,"touchcancel",ni=function(We){var On=m.touchData.start;m.touchData.capture=!1,On&&On.unactivate()});var Ti,ia,Ba,Li;if(m.registerBinding(window,"touchend",Ti=function(We){var On=m.touchData.start,Ir=m.touchData.capture;if(Ir)We.touches.length===0&&(m.touchData.capture=!1),We.preventDefault();else return;var ar=m.selection;m.swipePanning=!1,m.hoverData.draggingEles=!1;var or=m.cy,qa=or.zoom(),qr=m.touchData.now,is=m.touchData.earlier;if(We.touches[0]){var Uo=m.projectIntoViewport(We.touches[0].clientX,We.touches[0].clientY);qr[0]=Uo[0],qr[1]=Uo[1]}if(We.touches[1]){var Uo=m.projectIntoViewport(We.touches[1].clientX,We.touches[1].clientY);qr[2]=Uo[0],qr[3]=Uo[1]}if(We.touches[2]){var Uo=m.projectIntoViewport(We.touches[2].clientX,We.touches[2].clientY);qr[4]=Uo[0],qr[5]=Uo[1]}On&&On.unactivate();var qc;if(m.touchData.cxt){if(qc={originalEvent:We,type:"cxttapend",position:{x:qr[0],y:qr[1]}},On?On.emit(qc):or.emit(qc),!m.touchData.cxtDragged){var uo={originalEvent:We,type:"cxttap",position:{x:qr[0],y:qr[1]}};On?On.emit(uo):or.emit(uo)}m.touchData.start&&(m.touchData.start._private.grabbed=!1),m.touchData.cxt=!1,m.touchData.start=null,m.redraw();return}if(!We.touches[2]&&or.boxSelectionEnabled()&&m.touchData.selecting){m.touchData.selecting=!1;var Lc=or.collection(m.getAllInBox(ar[0],ar[1],ar[2],ar[3]));ar[0]=void 0,ar[1]=void 0,ar[2]=void 0,ar[3]=void 0,ar[4]=0,m.redrawHint("select",!0),or.emit({type:"boxend",originalEvent:We,position:{x:qr[0],y:qr[1]}});var Ra=function(S3){return S3.selectable()&&!S3.selected()};Lc.emit("box").stdFilter(Ra).select().emit("boxselect"),Lc.nonempty()&&m.redrawHint("eles",!0),m.redraw()}if(On!=null&&On.unactivate(),We.touches[2])m.data.bgActivePosistion=void 0,m.redrawHint("select",!0);else if(!We.touches[1]){if(!We.touches[0]){if(!We.touches[0]){m.data.bgActivePosistion=void 0,m.redrawHint("select",!0);var lo=m.dragData.touchDragEles;if(On!=null){var Sl=On._private.grabbed;ue(lo),m.redrawHint("drag",!0),m.redrawHint("eles",!0),Sl&&(On.emit("freeon"),lo.emit("free"),m.dragData.didDrag&&(On.emit("dragfreeon"),lo.emit("dragfree"))),k(On,["touchend","tapend","vmouseup","tapdragout"],We,{x:qr[0],y:qr[1]}),On.unactivate(),m.touchData.start=null}else{var Yf=m.findNearestElement(qr[0],qr[1],!0,!0);k(Yf,["touchend","tapend","vmouseup","tapdragout"],We,{x:qr[0],y:qr[1]})}var mp=m.touchData.startPosition[0]-qr[0],yp=mp*mp,Xf=m.touchData.startPosition[1]-qr[1],gg=Xf*Xf,fd=yp+gg,ov=fd*qa*qa;m.touchData.singleTouchMoved||(On||or.$(":selected").unselect(["tapunselect"]),k(On,["tap","vclick"],We,{x:qr[0],y:qr[1]}),ia=!1,We.timeStamp-Li<=or.multiClickDebounceTime()?(Ba&&clearTimeout(Ba),ia=!0,Li=null,k(On,["dbltap","vdblclick"],We,{x:qr[0],y:qr[1]})):(Ba=setTimeout(function(){ia||k(On,["onetap","voneclick"],We,{x:qr[0],y:qr[1]})},or.multiClickDebounceTime()),Li=We.timeStamp)),On!=null&&!m.dragData.didDrag&&On._private.selectable&&ov"u"){var wi=[],Ts=function(We){return{clientX:We.clientX,clientY:We.clientY,force:1,identifier:We.pointerId,pageX:We.pageX,pageY:We.pageY,radiusX:We.width/2,radiusY:We.height/2,screenX:We.screenX,screenY:We.screenY,target:We.target}},Yi=function(We){return{event:We,touch:Ts(We)}},Di=function(We){wi.push(Yi(We))},es=function(We){for(var On=0;On0)return kn[0]}return null},ne=Object.keys(U),ae=0;ae0?Z:XP(D,I,g,k,T,A,F)},checkPoint:function(g,k,T,A,D,I,F){var H=wx(A,D),C=2*H;if(tv(g,k,this.points,I,F,A,D-C,[0,-1],T)||tv(g,k,this.points,I,F,A-C,D,[0,-1],T))return!0;var G=A/2+2*T,U=D/2+2*T,Z=[I-G,F-U,I-G,F,I+G,F,I+G,F-U];return!!(Gd(g,k,Z)||m3(g,k,C,C,I+A/2-H,F+D/2-H,T)||m3(g,k,C,C,I-A/2+H,F+D/2-H,T))}}},iv.registerNodeShapes=function(){var m=this.nodeShapes={},g=this;this.generateEllipse(),this.generatePolygon("triangle",ud(3,0)),this.generateRoundPolygon("round-triangle",ud(3,0)),this.generatePolygon("rectangle",ud(4,0)),m.square=m.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var k=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",k),this.generateRoundPolygon("round-diamond",k)}this.generatePolygon("pentagon",ud(5,0)),this.generateRoundPolygon("round-pentagon",ud(5,0)),this.generatePolygon("hexagon",ud(6,0)),this.generateRoundPolygon("round-hexagon",ud(6,0)),this.generatePolygon("heptagon",ud(7,0)),this.generateRoundPolygon("round-heptagon",ud(7,0)),this.generatePolygon("octagon",ud(8,0)),this.generateRoundPolygon("round-octagon",ud(8,0));var T=new Array(20);{var A=TL(5,0),D=TL(5,Math.PI/5),I=.5*(3-Math.sqrt(5));I*=1.57;for(var F=0;F=g.deqFastCost*Be)break}else if(C){if(Se>=g.deqCost*ne||Se>=g.deqAvgCost*Z)break}else if(Le>=g.deqNoDrawCost*QL)break;var Ke=g.deq(T,_e,ue);if(Ke.length>0)for(var qe=0;qe0&&(g.onDeqd(T,ae),!C&&g.shouldRedraw(T,ae,_e,ue)&&D())},F=g.priority||om;A.beforeRender(I,F(T))}}}},tee=function(){function m(g){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:am;p(this,m),this.idsByKey=new R2,this.keyForId=new R2,this.cachesByLvl=new R2,this.lvls=[],this.getKey=g,this.doesEleInvalidateKey=k}return y(m,[{key:"getIdsFor",value:function(k){k==null&&yc("Can not get id list for null key");var T=this.idsByKey,A=this.idsByKey.get(k);return A||(A=new R5,T.set(k,A)),A}},{key:"addIdForKey",value:function(k,T){k!=null&&this.getIdsFor(k).add(T)}},{key:"deleteIdForKey",value:function(k,T){k!=null&&this.getIdsFor(k).delete(T)}},{key:"getNumberOfIdsForKey",value:function(k){return k==null?0:this.getIdsFor(k).size}},{key:"updateKeyMappingFor",value:function(k){var T=k.id(),A=this.keyForId.get(T),D=this.getKey(k);this.deleteIdForKey(A,T),this.addIdForKey(D,T),this.keyForId.set(T,D)}},{key:"deleteKeyMappingFor",value:function(k){var T=k.id(),A=this.keyForId.get(T);this.deleteIdForKey(A,T),this.keyForId.delete(T)}},{key:"keyHasChangedFor",value:function(k){var T=k.id(),A=this.keyForId.get(T),D=this.getKey(k);return A!==D}},{key:"isInvalid",value:function(k){return this.keyHasChangedFor(k)||this.doesEleInvalidateKey(k)}},{key:"getCachesAt",value:function(k){var T=this.cachesByLvl,A=this.lvls,D=T.get(k);return D||(D=new R2,T.set(k,D),A.push(k)),D}},{key:"getCache",value:function(k,T){return this.getCachesAt(T).get(k)}},{key:"get",value:function(k,T){var A=this.getKey(k),D=this.getCache(A,T);return D!=null&&this.updateKeyMappingFor(k),D}},{key:"getForCachedKey",value:function(k,T){var A=this.keyForId.get(k.id()),D=this.getCache(A,T);return D}},{key:"hasCache",value:function(k,T){return this.getCachesAt(T).has(k)}},{key:"has",value:function(k,T){var A=this.getKey(k);return this.hasCache(A,T)}},{key:"setCache",value:function(k,T,A){A.key=k,this.getCachesAt(T).set(k,A)}},{key:"set",value:function(k,T,A){var D=this.getKey(k);this.setCache(D,T,A),this.updateKeyMappingFor(k)}},{key:"deleteCache",value:function(k,T){this.getCachesAt(T).delete(k)}},{key:"delete",value:function(k,T){var A=this.getKey(k);this.deleteCache(A,T)}},{key:"invalidateKey",value:function(k){var T=this;this.lvls.forEach(function(A){return T.deleteCache(k,A)})}},{key:"invalidate",value:function(k){var T=k.id(),A=this.keyForId.get(T);this.deleteKeyMappingFor(k);var D=this.doesEleInvalidateKey(k);return D&&this.invalidateKey(A),D||this.getNumberOfIdsForKey(A)===0}}]),m}(),cT=25,uT=50,i6=-4,ZL=3,JL=7.99,nee=8,ree=1024,iee=1024,HR=1024,see=.2,aee=.8,oee=10,cee=.15,uee=.1,lee=.9,hee=.9,fee=100,dee=1,s6={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},gee=Vf({getKey:null,doesEleInvalidateKey:am,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:cd,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Fx=function(g,k){var T=this;T.renderer=g,T.onDequeues=[];var A=gee(k);Oe(T,A),T.lookup=new tee(A.getKey,A.doesEleInvalidateKey),T.setupDequeueing()},Oh=Fx.prototype;Oh.reasons=s6,Oh.getTextureQueue=function(m){var g=this;return g.eleImgCaches=g.eleImgCaches||{},g.eleImgCaches[m]=g.eleImgCaches[m]||[]},Oh.getRetiredTextureQueue=function(m){var g=this,k=g.eleImgCaches.retired=g.eleImgCaches.retired||{},T=k[m]=k[m]||[];return T},Oh.getElementQueue=function(){var m=this,g=m.eleCacheQueue=m.eleCacheQueue||new gx(function(k,T){return T.reqs-k.reqs});return g},Oh.getElementKeyToQueue=function(){var m=this,g=m.eleKeyToCacheQueue=m.eleKeyToCacheQueue||{};return g},Oh.getElement=function(m,g,k,T,A){var D=this,I=this.renderer,F=I.cy.zoom(),H=this.lookup;if(!g||g.w===0||g.h===0||isNaN(g.w)||isNaN(g.h)||!m.visible()||m.removed()||!D.allowEdgeTxrCaching&&m.isEdge()||!D.allowParentTxrCaching&&m.isParent())return null;if(T==null&&(T=Math.ceil(yL(F*k))),T=JL||T>ZL)return null;var C=Math.pow(2,T),G=g.h*C,U=g.w*C,Z=I.eleTextBiggerThanMin(m,C);if(!this.isVisible(m,Z))return null;var ne=H.get(m,T);if(ne&&ne.invalidated&&(ne.invalidated=!1,ne.texture.invalidatedWidth-=ne.width),ne)return ne;var ae;if(G<=cT?ae=cT:G<=uT?ae=uT:ae=Math.ceil(G/uT)*uT,G>HR||U>iee)return null;var ue=D.getTextureQueue(ae),_e=ue[ue.length-2],be=function(){return D.recycleTexture(ae,U)||D.addTexture(ae,U)};_e||(_e=ue[ue.length-1]),_e||(_e=be()),_e.width-_e.usedWidthT;ut--)$e=D.getElement(m,g,k,ut,s6.downscale);ot()}else return D.queueElement(m,qe.level-1),qe;else{var Je;if(!Le&&!Be&&!Ke)for(var Ct=T-1;Ct>=i6;Ct--){var lt=H.get(m,Ct);if(lt){Je=lt;break}}if(Se(Je))return D.queueElement(m,T),Je;_e.context.translate(_e.usedWidth,0),_e.context.scale(C,C),this.drawElement(_e.context,m,g,Z,!1),_e.context.scale(1/C,1/C),_e.context.translate(-_e.usedWidth,0)}return ne={x:_e.usedWidth,texture:_e,level:T,scale:C,width:U,height:G,scaledLabelShown:Z},_e.usedWidth+=Math.ceil(U+nee),_e.eleCaches.push(ne),H.set(m,T,ne),D.checkTextureFullness(_e),ne},Oh.invalidateElements=function(m){for(var g=0;g=see*m.width&&this.retireTexture(m)},Oh.checkTextureFullness=function(m){var g=this,k=g.getTextureQueue(m.height);m.usedWidth/m.width>aee&&m.fullnessChecks>=oee?cm(k,m):m.fullnessChecks++},Oh.retireTexture=function(m){var g=this,k=m.height,T=g.getTextureQueue(k),A=this.lookup;cm(T,m),m.retired=!0;for(var D=m.eleCaches,I=0;I=g)return I.retired=!1,I.usedWidth=0,I.invalidatedWidth=0,I.fullnessChecks=0,wL(I.eleCaches),I.context.setTransform(1,0,0,1,0,0),I.context.clearRect(0,0,I.width,I.height),cm(A,I),T.push(I),I}},Oh.queueElement=function(m,g){var k=this,T=k.getElementQueue(),A=k.getElementKeyToQueue(),D=this.getKey(m),I=A[D];if(I)I.level=Math.max(I.level,g),I.eles.merge(m),I.reqs++,T.updateItem(I);else{var F={eles:m.spawn().merge(m),level:g,reqs:1,key:D};T.push(F),A[D]=F}},Oh.dequeue=function(m){for(var g=this,k=g.getElementQueue(),T=g.getElementKeyToQueue(),A=[],D=g.lookup,I=0;I0;I++){var F=k.pop(),H=F.key,C=F.eles[0],G=D.hasCache(C,F.level);if(T[H]=null,G)continue;A.push(F);var U=g.getBoundingBox(C);g.getElement(C,U,m,F.level,s6.dequeue)}return A},Oh.removeFromQueue=function(m){var g=this,k=g.getElementQueue(),T=g.getElementKeyToQueue(),A=this.getKey(m),D=T[A];D!=null&&(D.eles.length===1?(D.reqs=dp,k.updateItem(D),k.pop(),T[A]=null):D.eles.unmerge(m))},Oh.onDequeue=function(m){this.onDequeues.push(m)},Oh.offDequeue=function(m){cm(this.onDequeues,m)},Oh.setupDequeueing=oT.setupDequeueing({deqRedrawThreshold:fee,deqCost:cee,deqAvgCost:uee,deqNoDrawCost:lee,deqFastCost:hee,deq:function(g,k,T){return g.dequeue(k,T)},onDeqd:function(g,k){for(var T=0;T=lT||k>jx)return null}T.validateLayersElesOrdering(k,m);var H=T.layersByLevel,C=Math.pow(2,k),G=H[k]=H[k]||[],U,Z=T.levelIsComplete(k,m),ne,ae=function(){var ot=function(un){if(T.validateLayersElesOrdering(un,m),T.levelIsComplete(un,m))return ne=H[un],!0},ut=function(un){if(!ne)for(var Rt=k+un;a6<=Rt&&Rt<=jx&&!ot(Rt);Rt+=un);};ut(1),ut(-1);for(var Je=G.length-1;Je>=0;Je--){var Ct=G[Je];Ct.invalid&&cm(G,Ct)}};if(!Z)ae();else return G;var ue=function(){if(!U){U=zd();for(var ot=0;otGge)return null;var Ct=T.makeLayer(U,k);if(ut!=null){var lt=G.indexOf(ut)+1;G.splice(lt,0,Ct)}else(ot.insert===void 0||ot.insert)&&G.unshift(Ct);return Ct};if(T.skipping&&!F)return null;for(var be=null,Se=m.length/pee,Le=!F,Be=0;Be=Se||!YP(be.bb,Ke.boundingBox()))&&(be=_e({insert:!0,after:be}),!be))return null;ne||Le?T.queueLayer(be,Ke):T.drawEleInLayer(be,Ke,k,g),be.eles.push(Ke),Re[k]=be}return ne||(Le?null:G)},x1.getEleLevelForLayerLevel=function(m,g){return m},x1.drawEleInLayer=function(m,g,k,T){var A=this,D=this.renderer,I=m.context,F=g.boundingBox();F.w===0||F.h===0||!g.visible()||(k=A.getEleLevelForLayerLevel(k,T),D.setImgSmoothing(I,!1),D.drawCachedElement(I,g,null,null,k,qge),D.setImgSmoothing(I,!0))},x1.levelIsComplete=function(m,g){var k=this,T=k.layersByLevel[m];if(!T||T.length===0)return!1;for(var A=0,D=0;D0||I.invalid)return!1;A+=I.eles.length}return A===g.length},x1.validateLayersElesOrdering=function(m,g){var k=this.layersByLevel[m];if(k)for(var T=0;T0){g=!0;break}}return g},x1.invalidateElements=function(m){var g=this;m.length!==0&&(g.lastInvalidationTime=pi(),!(m.length===0||!g.haveLayers())&&g.updateElementsInLayers(m,function(T,A,D){g.invalidateLayer(T)}))},x1.invalidateLayer=function(m){if(this.lastInvalidationTime=pi(),!m.invalid){var g=m.level,k=m.eles,T=this.layersByLevel[g];cm(T,m),m.elesQueue=[],m.invalid=!0,m.replacement&&(m.replacement.invalid=!0);for(var A=0;A3&&arguments[3]!==void 0?arguments[3]:!0,A=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,D=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,I=this,F=g._private.rscratch;if(!(D&&!g.visible())&&!(F.badLine||F.allpts==null||isNaN(F.allpts[0]))){var H;k&&(H=k,m.translate(-H.x1,-H.y1));var C=D?g.pstyle("opacity").value:1,G=D?g.pstyle("line-opacity").value:1,U=g.pstyle("curve-style").value,Z=g.pstyle("line-style").value,ne=g.pstyle("width").pfValue,ae=g.pstyle("line-cap").value,ue=C*G,_e=C*G,be=function(){var Je=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ue;U==="straight-triangle"?(I.eleStrokeStyle(m,g,Je),I.drawEdgeTrianglePath(g,m,F.allpts)):(m.lineWidth=ne,m.lineCap=ae,I.eleStrokeStyle(m,g,Je),I.drawEdgePath(g,m,F.allpts,Z),m.lineCap="butt")},Se=function(){A&&I.drawEdgeOverlay(m,g)},Le=function(){A&&I.drawEdgeUnderlay(m,g)},Be=function(){var Je=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_e;I.drawArrowheads(m,g,Je)},Ke=function(){I.drawElementText(m,g,null,T)};m.lineJoin="round";var qe=g.pstyle("ghost").value==="yes";if(qe){var Re=g.pstyle("ghost-offset-x").pfValue,Ze=g.pstyle("ghost-offset-y").pfValue,$e=g.pstyle("ghost-opacity").value,ot=ue*$e;m.translate(Re,Ze),be(ot),Be(ot),m.translate(-Re,-Ze)}Le(),be(),Be(),Se(),Ke(),k&&m.translate(H.x1,H.y1)}};var kee=function(g){if(!["overlay","underlay"].includes(g))throw new Error("Invalid state");return function(k,T){if(T.visible()){var A=T.pstyle("".concat(g,"-opacity")).value;if(A!==0){var D=this,I=D.usePaths(),F=T._private.rscratch,H=T.pstyle("".concat(g,"-padding")).pfValue,C=2*H,G=T.pstyle("".concat(g,"-color")).value;k.lineWidth=C,F.edgeType==="self"&&!I?k.lineCap="butt":k.lineCap="round",D.colorStrokeStyle(k,G[0],G[1],G[2],A),D.drawEdgePath(T,k,F.allpts,"solid")}}}};av.drawEdgeOverlay=kee("overlay"),av.drawEdgeUnderlay=kee("underlay"),av.drawEdgePath=function(m,g,k,T){var A=m._private.rscratch,D=g,I,F=!1,H=this.usePaths(),C=m.pstyle("line-dash-pattern").pfValue,G=m.pstyle("line-dash-offset").pfValue;if(H){var U=k.join("$"),Z=A.pathCacheKey&&A.pathCacheKey===U;Z?(I=g=A.pathCache,F=!0):(I=g=new Path2D,A.pathCacheKey=U,A.pathCache=I)}if(D.setLineDash)switch(T){case"dotted":D.setLineDash([1,1]);break;case"dashed":D.setLineDash(C),D.lineDashOffset=G;break;case"solid":D.setLineDash([]);break}if(!F&&!A.badLine)switch(g.beginPath&&g.beginPath(),g.moveTo(k[0],k[1]),A.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var ne=2;ne+35&&arguments[5]!==void 0?arguments[5]:!0,I=this;if(T==null){if(D&&!I.eleTextBiggerThanMin(g))return}else if(T===!1)return;if(g.isNode()){var F=g.pstyle("label");if(!F||!F.value)return;var H=I.getLabelJustification(g);m.textAlign=H,m.textBaseline="bottom"}else{var C=g.element()._private.rscratch.badLine,G=g.pstyle("label"),U=g.pstyle("source-label"),Z=g.pstyle("target-label");if(C||(!G||!G.value)&&(!U||!U.value)&&(!Z||!Z.value))return;m.textAlign="center",m.textBaseline="bottom"}var ne=!k,ae;k&&(ae=k,m.translate(-ae.x1,-ae.y1)),A==null?(I.drawText(m,g,null,ne,D),g.isEdge()&&(I.drawText(m,g,"source",ne,D),I.drawText(m,g,"target",ne,D))):I.drawText(m,g,A,ne,D),k&&m.translate(ae.x1,ae.y1)},o6.getFontCache=function(m){var g;this.fontCaches=this.fontCaches||[];for(var k=0;k2&&arguments[2]!==void 0?arguments[2]:!0,T=g.pstyle("font-style").strValue,A=g.pstyle("font-size").pfValue+"px",D=g.pstyle("font-family").strValue,I=g.pstyle("font-weight").strValue,F=k?g.effectiveOpacity()*g.pstyle("text-opacity").value:1,H=g.pstyle("text-outline-opacity").value*F,C=g.pstyle("color").value,G=g.pstyle("text-outline-color").value;m.font=T+" "+I+" "+A+" "+D,m.lineJoin="round",this.colorFillStyle(m,C[0],C[1],C[2],F),this.colorStrokeStyle(m,G[0],G[1],G[2],H)};function Xge(m,g,k,T,A){var D=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5;m.beginPath(),m.moveTo(g+D,k),m.lineTo(g+T-D,k),m.quadraticCurveTo(g+T,k,g+T,k+D),m.lineTo(g+T,k+A-D),m.quadraticCurveTo(g+T,k+A,g+T-D,k+A),m.lineTo(g+D,k+A),m.quadraticCurveTo(g,k+A,g,k+A-D),m.lineTo(g,k+D),m.quadraticCurveTo(g,k,g+D,k),m.closePath(),m.fill()}o6.getTextAngle=function(m,g){var k,T=m._private,A=T.rscratch,D=g?g+"-":"",I=m.pstyle(D+"text-rotation"),F=gp(A,"labelAngle",g);return I.strValue==="autorotate"?k=m.isEdge()?F:0:I.strValue==="none"?k=0:k=I.pfValue,k},o6.drawText=function(m,g,k){var T=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,A=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,D=g._private,I=D.rscratch,F=A?g.effectiveOpacity():1;if(!(A&&(F===0||g.pstyle("text-opacity").value===0))){k==="main"&&(k=null);var H=gp(I,"labelX",k),C=gp(I,"labelY",k),G,U,Z=this.getLabelText(g,k);if(Z!=null&&Z!==""&&!isNaN(H)&&!isNaN(C)){this.setupTextStyle(m,g,A);var ne=k?k+"-":"",ae=gp(I,"labelWidth",k),ue=gp(I,"labelHeight",k),_e=g.pstyle(ne+"text-margin-x").pfValue,be=g.pstyle(ne+"text-margin-y").pfValue,Se=g.isEdge(),Le=g.pstyle("text-halign").value,Be=g.pstyle("text-valign").value;Se&&(Le="center",Be="center"),H+=_e,C+=be;var Ke;switch(T?Ke=this.getTextAngle(g,k):Ke=0,Ke!==0&&(G=H,U=C,m.translate(G,U),m.rotate(Ke),H=0,C=0),Be){case"top":break;case"center":C+=ue/2;break;case"bottom":C+=ue;break}var qe=g.pstyle("text-background-opacity").value,Re=g.pstyle("text-border-opacity").value,Ze=g.pstyle("text-border-width").pfValue,$e=g.pstyle("text-background-padding").pfValue;if(qe>0||Ze>0&&Re>0){var ot=H-$e;switch(Le){case"left":ot-=ae;break;case"center":ot-=ae/2;break}var ut=C-ue-$e,Je=ae+2*$e,Ct=ue+2*$e;if(qe>0){var lt=m.fillStyle,un=g.pstyle("text-background-color").value;m.fillStyle="rgba("+un[0]+","+un[1]+","+un[2]+","+qe*F+")";var Rt=g.pstyle("text-background-shape").strValue;Rt.indexOf("round")===0?Xge(m,ot,ut,Je,Ct,2):m.fillRect(ot,ut,Je,Ct),m.fillStyle=lt}if(Ze>0&&Re>0){var $t=m.strokeStyle,bn=m.lineWidth,Cn=g.pstyle("text-border-color").value,Kn=g.pstyle("text-border-style").value;if(m.strokeStyle="rgba("+Cn[0]+","+Cn[1]+","+Cn[2]+","+Re*F+")",m.lineWidth=Ze,m.setLineDash)switch(Kn){case"dotted":m.setLineDash([1,1]);break;case"dashed":m.setLineDash([4,2]);break;case"double":m.lineWidth=Ze/4,m.setLineDash([]);break;case"solid":m.setLineDash([]);break}if(m.strokeRect(ot,ut,Je,Ct),Kn==="double"){var kn=Ze/2;m.strokeRect(ot+kn,ut+kn,Je-kn*2,Ct-kn*2)}m.setLineDash&&m.setLineDash([]),m.lineWidth=bn,m.strokeStyle=$t}}var Wn=2*g.pstyle("text-outline-width").pfValue;if(Wn>0&&(m.lineWidth=Wn),g.pstyle("text-wrap").value==="wrap"){var sr=gp(I,"labelWrapCachedLines",k),yr=gp(I,"labelLineHeight",k),hr=ae/2,nr=this.getLabelJustification(g);switch(nr==="auto"||(Le==="left"?nr==="left"?H+=-ae:nr==="center"&&(H+=-hr):Le==="center"?nr==="left"?H+=-hr:nr==="right"&&(H+=hr):Le==="right"&&(nr==="center"?H+=hr:nr==="right"&&(H+=ae))),Be){case"top":C-=(sr.length-1)*yr;break;case"center":case"bottom":C-=(sr.length-1)*yr;break}for(var fn=0;fn0&&m.strokeText(sr[fn],H,C),m.fillText(sr[fn],H,C),C+=yr}else Wn>0&&m.strokeText(Z,H,C),m.fillText(Z,H,C);Ke!==0&&(m.rotate(-Ke),m.translate(-G,-U))}}};var Hx={};Hx.drawNode=function(m,g,k){var T=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,A=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,D=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,I=this,F,H,C=g._private,G=C.rscratch,U=g.position();if(!(!te(U.x)||!te(U.y))&&!(D&&!g.visible())){var Z=D?g.effectiveOpacity():1,ne=I.usePaths(),ae,ue=!1,_e=g.padding();F=g.width()+2*_e,H=g.height()+2*_e;var be;k&&(be=k,m.translate(-be.x1,-be.y1));for(var Se=g.pstyle("background-image"),Le=Se.value,Be=new Array(Le.length),Ke=new Array(Le.length),qe=0,Re=0;Re0&&arguments[0]!==void 0?arguments[0]:Ct;I.eleFillStyle(m,g,Di)},bn=function(){var Di=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Rt;I.colorStrokeStyle(m,lt[0],lt[1],lt[2],Di)},Cn=g.pstyle("shape").strValue,Kn=g.pstyle("shape-polygon-points").pfValue;if(ne){m.translate(U.x,U.y);var kn=I.nodePathCache=I.nodePathCache||[],Wn=P5(Cn==="polygon"?Cn+","+Kn.join(","):Cn,""+H,""+F),sr=kn[Wn];sr!=null?(ae=sr,ue=!0,G.pathCache=ae):(ae=new Path2D,kn[Wn]=G.pathCache=ae)}var yr=function(){if(!ue){var Di=U;ne&&(Di={x:0,y:0}),I.nodeShapes[I.getNodeShape(g)].draw(ae||m,Di.x,Di.y,F,H)}ne?m.fill(ae):m.fill()},hr=function(){for(var Di=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Z,es=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,eo=C.backgrounding,sa=0,Ks=0;Ks0&&arguments[0]!==void 0?arguments[0]:!1,es=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Z;I.hasPie(g)&&(I.drawPie(m,g,es),Di&&(ne||I.nodeShapes[I.getNodeShape(g)].draw(m,U.x,U.y,F,H)))},fn=function(){var Di=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Z,es=(ut>0?ut:-ut)*Di,eo=ut>0?0:255;ut!==0&&(I.colorFillStyle(m,eo,eo,eo,es),ne?m.fill(ae):m.fill())},vr=function(){if(Je>0){if(m.lineWidth=Je,m.lineCap="butt",m.setLineDash)switch(un){case"dotted":m.setLineDash([1,1]);break;case"dashed":m.setLineDash([4,2]);break;case"solid":case"double":m.setLineDash([]);break}if(ne?m.stroke(ae):m.stroke(),un==="double"){m.lineWidth=Je/3;var Di=m.globalCompositeOperation;m.globalCompositeOperation="destination-out",ne?m.stroke(ae):m.stroke(),m.globalCompositeOperation=Di}m.setLineDash&&m.setLineDash([])}},gr=function(){A&&I.drawNodeOverlay(m,g,U,F,H)},ni=function(){A&&I.drawNodeUnderlay(m,g,U,F,H)},Ti=function(){I.drawElementText(m,g,null,T)},ia=g.pstyle("ghost").value==="yes";if(ia){var Ba=g.pstyle("ghost-offset-x").pfValue,Li=g.pstyle("ghost-offset-y").pfValue,wi=g.pstyle("ghost-opacity").value,Ts=wi*Z;m.translate(Ba,Li),$t(wi*Ct),yr(),hr(Ts,!0),bn(wi*Rt),vr(),nr(ut!==0||Je!==0),hr(Ts,!1),fn(Ts),m.translate(-Ba,-Li)}ne&&m.translate(-U.x,-U.y),ni(),ne&&m.translate(U.x,U.y),$t(),yr(),hr(Z,!0),bn(),vr(),nr(ut!==0||Je!==0),hr(Z,!1),fn(),ne&&m.translate(-U.x,-U.y),Ti(),gr(),k&&m.translate(be.x1,be.y1)}};var xee=function(g){if(!["overlay","underlay"].includes(g))throw new Error("Invalid state");return function(k,T,A,D,I){var F=this;if(T.visible()){var H=T.pstyle("".concat(g,"-padding")).pfValue,C=T.pstyle("".concat(g,"-opacity")).value,G=T.pstyle("".concat(g,"-color")).value,U=T.pstyle("".concat(g,"-shape")).value;if(C>0){if(A=A||T.position(),D==null||I==null){var Z=T.padding();D=T.width()+2*Z,I=T.height()+2*Z}F.colorFillStyle(k,G[0],G[1],G[2],C),F.nodeShapes[U].draw(k,A.x,A.y,D+H*2,I+H*2),k.fill()}}}};Hx.drawNodeOverlay=xee("overlay"),Hx.drawNodeUnderlay=xee("underlay"),Hx.hasPie=function(m){return m=m[0],m._private.hasPie},Hx.drawPie=function(m,g,k,T){g=g[0],T=T||g.position();var A=g.cy().style(),D=g.pstyle("pie-size"),I=T.x,F=T.y,H=g.width(),C=g.height(),G=Math.min(H,C)/2,U=0,Z=this.usePaths();Z&&(I=0,F=0),D.units==="%"?G=G*D.pfValue:D.pfValue!==void 0&&(G=D.pfValue/2);for(var ne=1;ne<=A.pieBackgroundN;ne++){var ae=g.pstyle("pie-"+ne+"-background-size").value,ue=g.pstyle("pie-"+ne+"-background-color").value,_e=g.pstyle("pie-"+ne+"-background-opacity").value*k,be=ae/100;be+U>1&&(be=1-U);var Se=1.5*Math.PI+2*Math.PI*U,Le=2*Math.PI*be,Be=Se+Le;ae===0||U>=1||U+be>1||(m.beginPath(),m.moveTo(I,F),m.arc(I,F,G,Se,Be),m.closePath(),this.colorFillStyle(m,ue[0],ue[1],ue[2],_e),m.fill(),U+=be)}};var fg={},Qge=100;fg.getPixelRatio=function(){var m=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var g=m.backingStorePixelRatio||m.webkitBackingStorePixelRatio||m.mozBackingStorePixelRatio||m.msBackingStorePixelRatio||m.oBackingStorePixelRatio||m.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/g},fg.paintCache=function(m){for(var g=this.paintCaches=this.paintCaches||[],k=!0,T,A=0;AI.minMbLowQualFrames&&(I.motionBlurPxRatio=I.mbPxRBlurry)),I.clearingMotionBlur&&(I.motionBlurPxRatio=1),I.textureDrawLastFrame&&!U&&(G[I.NODE]=!0,G[I.SELECT_BOX]=!0);var Se=H.style(),Le=H.zoom(),Be=A!==void 0?A:Le,Ke=H.pan(),qe={x:Ke.x,y:Ke.y},Re={zoom:Le,pan:{x:Ke.x,y:Ke.y}},Ze=I.prevViewport,$e=Ze===void 0||Re.zoom!==Ze.zoom||Re.pan.x!==Ze.pan.x||Re.pan.y!==Ze.pan.y;!$e&&!(ue&&!ae)&&(I.motionBlurPxRatio=1),D&&(qe=D),Be*=F,qe.x*=F,qe.y*=F;var ot=I.getCachedZSortedEles();function ut(Li,wi,Ts,Yi,Di){var es=Li.globalCompositeOperation;Li.globalCompositeOperation="destination-out",I.colorFillStyle(Li,255,255,255,I.motionBlurTransparency),Li.fillRect(wi,Ts,Yi,Di),Li.globalCompositeOperation=es}function Je(Li,wi){var Ts,Yi,Di,es;!I.clearingMotionBlur&&(Li===C.bufferContexts[I.MOTIONBLUR_BUFFER_NODE]||Li===C.bufferContexts[I.MOTIONBLUR_BUFFER_DRAG])?(Ts={x:Ke.x*ne,y:Ke.y*ne},Yi=Le*ne,Di=I.canvasWidth*ne,es=I.canvasHeight*ne):(Ts=qe,Yi=Be,Di=I.canvasWidth,es=I.canvasHeight),Li.setTransform(1,0,0,1,0,0),wi==="motionBlur"?ut(Li,0,0,Di,es):!g&&(wi===void 0||wi)&&Li.clearRect(0,0,Di,es),k||(Li.translate(Ts.x,Ts.y),Li.scale(Yi,Yi)),D&&Li.translate(D.x,D.y),A&&Li.scale(A,A)}if(U||(I.textureDrawLastFrame=!1),U){if(I.textureDrawLastFrame=!0,!I.textureCache){I.textureCache={},I.textureCache.bb=H.mutableElements().boundingBox(),I.textureCache.texture=I.data.bufferCanvases[I.TEXTURE_BUFFER];var Ct=I.data.bufferContexts[I.TEXTURE_BUFFER];Ct.setTransform(1,0,0,1,0,0),Ct.clearRect(0,0,I.canvasWidth*I.textureMult,I.canvasHeight*I.textureMult),I.render({forcedContext:Ct,drawOnlyNodeLayer:!0,forcedPxRatio:F*I.textureMult});var Re=I.textureCache.viewport={zoom:H.zoom(),pan:H.pan(),width:I.canvasWidth,height:I.canvasHeight};Re.mpan={x:(0-Re.pan.x)/Re.zoom,y:(0-Re.pan.y)/Re.zoom}}G[I.DRAG]=!1,G[I.NODE]=!1;var lt=C.contexts[I.NODE],un=I.textureCache.texture,Re=I.textureCache.viewport;lt.setTransform(1,0,0,1,0,0),Z?ut(lt,0,0,Re.width,Re.height):lt.clearRect(0,0,Re.width,Re.height);var Rt=Se.core("outside-texture-bg-color").value,$t=Se.core("outside-texture-bg-opacity").value;I.colorFillStyle(lt,Rt[0],Rt[1],Rt[2],$t),lt.fillRect(0,0,Re.width,Re.height);var Le=H.zoom();Je(lt,!1),lt.clearRect(Re.mpan.x,Re.mpan.y,Re.width/Re.zoom/F,Re.height/Re.zoom/F),lt.drawImage(un,Re.mpan.x,Re.mpan.y,Re.width/Re.zoom/F,Re.height/Re.zoom/F)}else I.textureOnViewport&&!g&&(I.textureCache=null);var bn=H.extent(),Cn=I.pinching||I.hoverData.dragging||I.swipePanning||I.data.wheelZooming||I.hoverData.draggingEles||I.cy.animated(),Kn=I.hideEdgesOnViewport&&Cn,kn=[];if(kn[I.NODE]=!G[I.NODE]&&Z&&!I.clearedForMotionBlur[I.NODE]||I.clearingMotionBlur,kn[I.NODE]&&(I.clearedForMotionBlur[I.NODE]=!0),kn[I.DRAG]=!G[I.DRAG]&&Z&&!I.clearedForMotionBlur[I.DRAG]||I.clearingMotionBlur,kn[I.DRAG]&&(I.clearedForMotionBlur[I.DRAG]=!0),G[I.NODE]||k||T||kn[I.NODE]){var Wn=Z&&!kn[I.NODE]&&ne!==1,lt=g||(Wn?I.data.bufferContexts[I.MOTIONBLUR_BUFFER_NODE]:C.contexts[I.NODE]),sr=Z&&!Wn?"motionBlur":void 0;Je(lt,sr),Kn?I.drawCachedNodes(lt,ot.nondrag,F,bn):I.drawLayeredElements(lt,ot.nondrag,F,bn),I.debug&&I.drawDebugPoints(lt,ot.nondrag),!k&&!Z&&(G[I.NODE]=!1)}if(!T&&(G[I.DRAG]||k||kn[I.DRAG])){var Wn=Z&&!kn[I.DRAG]&&ne!==1,lt=g||(Wn?I.data.bufferContexts[I.MOTIONBLUR_BUFFER_DRAG]:C.contexts[I.DRAG]);Je(lt,Z&&!Wn?"motionBlur":void 0),Kn?I.drawCachedNodes(lt,ot.drag,F,bn):I.drawCachedElements(lt,ot.drag,F,bn),I.debug&&I.drawDebugPoints(lt,ot.drag),!k&&!Z&&(G[I.DRAG]=!1)}if(I.showFps||!T&&G[I.SELECT_BOX]&&!k){var lt=g||C.contexts[I.SELECT_BOX];if(Je(lt),I.selection[4]==1&&(I.hoverData.selecting||I.touchData.selecting)){var Le=I.cy.zoom(),yr=Se.core("selection-box-border-width").value/Le;lt.lineWidth=yr,lt.fillStyle="rgba("+Se.core("selection-box-color").value[0]+","+Se.core("selection-box-color").value[1]+","+Se.core("selection-box-color").value[2]+","+Se.core("selection-box-opacity").value+")",lt.fillRect(I.selection[0],I.selection[1],I.selection[2]-I.selection[0],I.selection[3]-I.selection[1]),yr>0&&(lt.strokeStyle="rgba("+Se.core("selection-box-border-color").value[0]+","+Se.core("selection-box-border-color").value[1]+","+Se.core("selection-box-border-color").value[2]+","+Se.core("selection-box-opacity").value+")",lt.strokeRect(I.selection[0],I.selection[1],I.selection[2]-I.selection[0],I.selection[3]-I.selection[1]))}if(C.bgActivePosistion&&!I.hoverData.selecting){var Le=I.cy.zoom(),hr=C.bgActivePosistion;lt.fillStyle="rgba("+Se.core("active-bg-color").value[0]+","+Se.core("active-bg-color").value[1]+","+Se.core("active-bg-color").value[2]+","+Se.core("active-bg-opacity").value+")",lt.beginPath(),lt.arc(hr.x,hr.y,Se.core("active-bg-size").pfValue/Le,0,2*Math.PI),lt.fill()}var nr=I.lastRedrawTime;if(I.showFps&&nr){nr=Math.round(nr);var fn=Math.round(1e3/nr);lt.setTransform(1,0,0,1,0,0),lt.fillStyle="rgba(255, 0, 0, 0.75)",lt.strokeStyle="rgba(255, 0, 0, 0.75)",lt.lineWidth=1,lt.fillText("1 frame = "+nr+" ms = "+fn+" fps",0,20);var vr=60;lt.strokeRect(0,30,250,20),lt.fillRect(0,30,250*Math.min(fn/vr,1),20)}k||(G[I.SELECT_BOX]=!1)}if(Z&&ne!==1){var gr=C.contexts[I.NODE],ni=I.data.bufferCanvases[I.MOTIONBLUR_BUFFER_NODE],Ti=C.contexts[I.DRAG],ia=I.data.bufferCanvases[I.MOTIONBLUR_BUFFER_DRAG],Ba=function(wi,Ts,Yi){wi.setTransform(1,0,0,1,0,0),Yi||!be?wi.clearRect(0,0,I.canvasWidth,I.canvasHeight):ut(wi,0,0,I.canvasWidth,I.canvasHeight);var Di=ne;wi.drawImage(Ts,0,0,I.canvasWidth*Di,I.canvasHeight*Di,0,0,I.canvasWidth,I.canvasHeight)};(G[I.NODE]||kn[I.NODE])&&(Ba(gr,ni,kn[I.NODE]),G[I.NODE]=!1),(G[I.DRAG]||kn[I.DRAG])&&(Ba(Ti,ia,kn[I.DRAG]),G[I.DRAG]=!1)}I.prevViewport=Re,I.clearingMotionBlur&&(I.clearingMotionBlur=!1,I.motionBlurCleared=!0,I.motionBlur=!0),Z&&(I.motionBlurTimeout=setTimeout(function(){I.motionBlurTimeout=null,I.clearedForMotionBlur[I.NODE]=!1,I.clearedForMotionBlur[I.DRAG]=!1,I.motionBlur=!1,I.clearingMotionBlur=!U,I.mbFrames=0,G[I.NODE]=!0,G[I.DRAG]=!0,I.redraw()},Qge)),g||H.emit("render")};var _3={};_3.drawPolygonPath=function(m,g,k,T,A,D){var I=T/2,F=A/2;m.beginPath&&m.beginPath(),m.moveTo(g+I*D[0],k+F*D[1]);for(var H=1;H0&&I>0){ne.clearRect(0,0,D,I),ne.globalCompositeOperation="source-over";var ae=this.getCachedZSortedEles();if(m.full)ne.translate(-T.x1*C,-T.y1*C),ne.scale(C,C),this.drawElements(ne,ae),ne.scale(1/C,1/C),ne.translate(T.x1*C,T.y1*C);else{var ue=g.pan(),_e={x:ue.x*C,y:ue.y*C};C*=g.zoom(),ne.translate(_e.x,_e.y),ne.scale(C,C),this.drawElements(ne,ae),ne.scale(1/C,1/C),ne.translate(-_e.x,-_e.y)}m.bg&&(ne.globalCompositeOperation="destination-over",ne.fillStyle=m.bg,ne.rect(0,0,D,I),ne.fill())}return Z};function Zge(m,g){for(var k=atob(m),T=new ArrayBuffer(k.length),A=new Uint8Array(T),D=0;D"u"?"undefined":f(OffscreenCanvas))!=="undefined"?k=new OffscreenCanvas(m,g):(k=document.createElement("canvas"),k.width=m,k.height=g),k},[T0,sv,av,fT,o6,Hx,fg,_3,dT,Aee].forEach(function(m){Oe(Ac,m)});var c6=[{name:"null",impl:DR},{name:"base",impl:XL},{name:"canvas",impl:Jge}],dg=[{type:"layout",extensions:ZJ},{type:"renderer",extensions:c6}],vm={},nM={};function E1(m,g,k){var T=k,A=function(Ze){Vo("Can not register `"+g+"` for `"+m+"` since `"+Ze+"` already exists in the prototype and can not be overridden")};if(m==="core"){if(Ox.prototype[g])return A(g);Ox.prototype[g]=k}else if(m==="collection"){if(Wf.prototype[g])return A(g);Wf.prototype[g]=k}else if(m==="layout"){for(var D=function(Ze){this.options=Ze,k.call(this,Ze),de(this._private)||(this._private={}),this._private.cy=Ze.cy,this._private.listeners=[],this.createEmitter()},I=D.prototype=Object.create(k.prototype),F=[],H=0;HV&&(this.rect.x-=(this.labelWidth-V)/2,this.setWidth(this.labelWidth)),this.labelHeight>Q&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-Q)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-Q),this.setHeight(this.labelHeight))}}},R.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==b.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},R.prototype.transform=function($){var V=this.rect.x;V>S.WORLD_BOUNDARY?V=S.WORLD_BOUNDARY:V<-S.WORLD_BOUNDARY&&(V=-S.WORLD_BOUNDARY);var Q=this.rect.y;Q>S.WORLD_BOUNDARY?Q=S.WORLD_BOUNDARY:Q<-S.WORLD_BOUNDARY&&(Q=-S.WORLD_BOUNDARY);var oe=new B(V,Q),ce=$.inverseTransformPoint(oe);this.setLocation(ce.x,ce.y)},R.prototype.getLeft=function(){return this.rect.x},R.prototype.getRight=function(){return this.rect.x+this.rect.width},R.prototype.getTop=function(){return this.rect.y},R.prototype.getBottom=function(){return this.rect.y+this.rect.height},R.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},f.exports=R},function(f,p,w){function y(b,E){b==null&&E==null?(this.x=0,this.y=0):(this.x=b,this.y=E)}y.prototype.getX=function(){return this.x},y.prototype.getY=function(){return this.y},y.prototype.setX=function(b){this.x=b},y.prototype.setY=function(b){this.y=b},y.prototype.getDifference=function(b){return new DimensionD(this.x-b.x,this.y-b.y)},y.prototype.getCopy=function(){return new y(this.x,this.y)},y.prototype.translate=function(b){return this.x+=b.width,this.y+=b.height,this},f.exports=y},function(f,p,w){var y=w(2),b=w(10),E=w(0),S=w(6),N=w(3),B=w(1),R=w(13),j=w(12),$=w(11);function V(oe,ce,se){y.call(this,se),this.estimatedSize=b.MIN_VALUE,this.margin=E.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=oe,ce!=null&&ce instanceof S?this.graphManager=ce:ce!=null&&ce instanceof Layout&&(this.graphManager=ce.graphManager)}V.prototype=Object.create(y.prototype);for(var Q in y)V[Q]=y[Q];V.prototype.getNodes=function(){return this.nodes},V.prototype.getEdges=function(){return this.edges},V.prototype.getGraphManager=function(){return this.graphManager},V.prototype.getParent=function(){return this.parent},V.prototype.getLeft=function(){return this.left},V.prototype.getRight=function(){return this.right},V.prototype.getTop=function(){return this.top},V.prototype.getBottom=function(){return this.bottom},V.prototype.isConnected=function(){return this.isConnected},V.prototype.add=function(oe,ce,se){if(ce==null&&se==null){var ge=oe;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(ge)>-1)throw"Node already in graph!";return ge.owner=this,this.getNodes().push(ge),ge}else{var ye=oe;if(!(this.getNodes().indexOf(ce)>-1&&this.getNodes().indexOf(se)>-1))throw"Source or target not in graph!";if(!(ce.owner==se.owner&&ce.owner==this))throw"Both owners must be this graph!";return ce.owner!=se.owner?null:(ye.source=ce,ye.target=se,ye.isInterGraph=!1,this.getEdges().push(ye),ce.edges.push(ye),se!=ce&&se.edges.push(ye),ye)}},V.prototype.remove=function(oe){var ce=oe;if(oe instanceof N){if(ce==null)throw"Node is null!";if(!(ce.owner!=null&&ce.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var se=ce.edges.slice(),ge,ye=se.length,ke=0;ke-1&&ve>-1))throw"Source and/or target doesn't know this edge!";ge.source.edges.splice(de,1),ge.target!=ge.source&&ge.target.edges.splice(ve,1);var Ae=ge.source.owner.getEdges().indexOf(ge);if(Ae==-1)throw"Not in owner's edge list!";ge.source.owner.getEdges().splice(Ae,1)}},V.prototype.updateLeftTop=function(){for(var oe=b.MAX_VALUE,ce=b.MAX_VALUE,se,ge,ye,ke=this.getNodes(),Ae=ke.length,de=0;dese&&(oe=se),ce>ge&&(ce=ge)}return oe==b.MAX_VALUE?null:(ke[0].getParent().paddingLeft!=null?ye=ke[0].getParent().paddingLeft:ye=this.margin,this.left=ce-ye,this.top=oe-ye,new j(this.left,this.top))},V.prototype.updateBounds=function(oe){for(var ce=b.MAX_VALUE,se=-b.MAX_VALUE,ge=b.MAX_VALUE,ye=-b.MAX_VALUE,ke,Ae,de,ve,te,xe=this.nodes,De=xe.length,he=0;heke&&(ce=ke),sede&&(ge=de),yeke&&(ce=ke),sede&&(ge=de),ye=this.nodes.length){var De=0;se.forEach(function(he){he.owner==oe&&De++}),De==this.nodes.length&&(this.isConnected=!0)}},f.exports=V},function(f,p,w){var y,b=w(1);function E(S){y=w(5),this.layout=S,this.graphs=[],this.edges=[]}E.prototype.addRoot=function(){var S=this.layout.newGraph(),N=this.layout.newNode(null),B=this.add(S,N);return this.setRootGraph(B),this.rootGraph},E.prototype.add=function(S,N,B,R,j){if(B==null&&R==null&&j==null){if(S==null)throw"Graph is null!";if(N==null)throw"Parent node is null!";if(this.graphs.indexOf(S)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(S),S.parent!=null)throw"Already has a parent!";if(N.child!=null)throw"Already has a child!";return S.parent=N,N.child=S,S}else{j=B,R=N,B=S;var $=R.getOwner(),V=j.getOwner();if(!($!=null&&$.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(V!=null&&V.getGraphManager()==this))throw"Target not in this graph mgr!";if($==V)return B.isInterGraph=!1,$.add(B,R,j);if(B.isInterGraph=!0,B.source=R,B.target=j,this.edges.indexOf(B)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(B),!(B.source!=null&&B.target!=null))throw"Edge source and/or target is null!";if(!(B.source.edges.indexOf(B)==-1&&B.target.edges.indexOf(B)==-1))throw"Edge already in source and/or target incidency list!";return B.source.edges.push(B),B.target.edges.push(B),B}},E.prototype.remove=function(S){if(S instanceof y){var N=S;if(N.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(N==this.rootGraph||N.parent!=null&&N.parent.graphManager==this))throw"Invalid parent node!";var B=[];B=B.concat(N.getEdges());for(var R,j=B.length,$=0;$=S.getRight()?N[0]+=Math.min(S.getX()-E.getX(),E.getRight()-S.getRight()):S.getX()<=E.getX()&&S.getRight()>=E.getRight()&&(N[0]+=Math.min(E.getX()-S.getX(),S.getRight()-E.getRight())),E.getY()<=S.getY()&&E.getBottom()>=S.getBottom()?N[1]+=Math.min(S.getY()-E.getY(),E.getBottom()-S.getBottom()):S.getY()<=E.getY()&&S.getBottom()>=E.getBottom()&&(N[1]+=Math.min(E.getY()-S.getY(),S.getBottom()-E.getBottom()));var j=Math.abs((S.getCenterY()-E.getCenterY())/(S.getCenterX()-E.getCenterX()));S.getCenterY()===E.getCenterY()&&S.getCenterX()===E.getCenterX()&&(j=1);var $=j*N[0],V=N[1]/j;N[0]$)return N[0]=B,N[1]=Q,N[2]=j,N[3]=xe,!1;if(R<$)return N[0]=B,N[1]=se,N[2]=j,N[3]=de,!1}else if(R===$){if(B>j)return N[0]=V,N[1]=R,N[2]=ve,N[3]=$,!1;if(Bj?(N[0]=ce,N[1]=se,ee=!0):(N[0]=oe,N[1]=Q,ee=!0):me===pe&&(B>j?(N[0]=V,N[1]=Q,ee=!0):(N[0]=ge,N[1]=se,ee=!0)),-gt===pe?j>B?(N[2]=te,N[3]=xe,rt=!0):(N[2]=ve,N[3]=de,rt=!0):gt===pe&&(j>B?(N[2]=Ae,N[3]=de,rt=!0):(N[2]=De,N[3]=xe,rt=!0)),ee&&rt)return!1;if(B>j?R>$?(Et=this.getCardinalDirection(me,pe,4),wt=this.getCardinalDirection(gt,pe,2)):(Et=this.getCardinalDirection(-me,pe,3),wt=this.getCardinalDirection(-gt,pe,1)):R>$?(Et=this.getCardinalDirection(-me,pe,1),wt=this.getCardinalDirection(-gt,pe,3)):(Et=this.getCardinalDirection(me,pe,2),wt=this.getCardinalDirection(gt,pe,4)),!ee)switch(Et){case 1:At=Q,jt=B+-ke/pe,N[0]=jt,N[1]=At;break;case 2:jt=ge,At=R+ye*pe,N[0]=jt,N[1]=At;break;case 3:At=se,jt=B+ke/pe,N[0]=jt,N[1]=At;break;case 4:jt=ce,At=R+-ye*pe,N[0]=jt,N[1]=At;break}if(!rt)switch(wt){case 1:cn=de,Bt=j+-Ie/pe,N[2]=Bt,N[3]=cn;break;case 2:Bt=De,cn=$+he*pe,N[2]=Bt,N[3]=cn;break;case 3:cn=xe,Bt=j+Ie/pe,N[2]=Bt,N[3]=cn;break;case 4:Bt=te,cn=$+-he*pe,N[2]=Bt,N[3]=cn;break}}return!1},b.getCardinalDirection=function(E,S,N){return E>S?N:1+N%4},b.getIntersection=function(E,S,N,B){if(B==null)return this.getIntersection2(E,S,N);var R=E.x,j=E.y,$=S.x,V=S.y,Q=N.x,oe=N.y,ce=B.x,se=B.y,ge=void 0,ye=void 0,ke=void 0,Ae=void 0,de=void 0,ve=void 0,te=void 0,xe=void 0,De=void 0;return ke=V-j,de=R-$,te=$*j-R*V,Ae=se-oe,ve=Q-ce,xe=ce*oe-Q*se,De=ke*ve-Ae*de,De===0?null:(ge=(de*xe-ve*te)/De,ye=(Ae*te-ke*xe)/De,new y(ge,ye))},b.angleOfVector=function(E,S,N,B){var R=void 0;return E!==N?(R=Math.atan((B-S)/(N-E)),N0?1:b<0?-1:0},y.floor=function(b){return b<0?Math.ceil(b):Math.floor(b)},y.ceil=function(b){return b<0?Math.floor(b):Math.ceil(b)},f.exports=y},function(f,p,w){function y(){}y.MAX_VALUE=2147483647,y.MIN_VALUE=-2147483648,f.exports=y},function(f,p,w){var y=function(){function R(j,$){for(var V=0;V<$.length;V++){var Q=$[V];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(j,Q.key,Q)}}return function(j,$,V){return $&&R(j.prototype,$),V&&R(j,V),j}}();function b(R,j){if(!(R instanceof j))throw new TypeError("Cannot call a class as a function")}var E=function(j){return{value:j,next:null,prev:null}},S=function(j,$,V,Q){return j!==null?j.next=$:Q.head=$,V!==null?V.prev=$:Q.tail=$,$.prev=j,$.next=V,Q.length++,$},N=function(j,$){var V=j.prev,Q=j.next;return V!==null?V.next=Q:$.head=Q,Q!==null?Q.prev=V:$.tail=V,j.prev=j.next=null,$.length--,j},B=function(){function R(j){var $=this;b(this,R),this.length=0,this.head=null,this.tail=null,j!=null&&j.forEach(function(V){return $.push(V)})}return y(R,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function($,V){return S(V.prev,E($),V,this)}},{key:"insertAfter",value:function($,V){return S(V,E($),V.next,this)}},{key:"insertNodeBefore",value:function($,V){return S(V.prev,$,V,this)}},{key:"insertNodeAfter",value:function($,V){return S(V,$,V.next,this)}},{key:"push",value:function($){return S(this.tail,E($),null,this)}},{key:"unshift",value:function($){return S(null,E($),this.head,this)}},{key:"remove",value:function($){return N($,this)}},{key:"pop",value:function(){return N(this.tail,this).value}},{key:"popNode",value:function(){return N(this.tail,this)}},{key:"shift",value:function(){return N(this.head,this).value}},{key:"shiftNode",value:function(){return N(this.head,this)}},{key:"get_object_at",value:function($){if($<=this.length()){for(var V=1,Q=this.head;V<$;)Q=Q.next,V++;return Q.value}}},{key:"set_object_at",value:function($,V){if($<=this.length()){for(var Q=1,oe=this.head;Q<$;)oe=oe.next,Q++;oe.value=V}}}]),R}();f.exports=B},function(f,p,w){function y(b,E,S){this.x=null,this.y=null,b==null&&E==null&&S==null?(this.x=0,this.y=0):typeof b=="number"&&typeof E=="number"&&S==null?(this.x=b,this.y=E):b.constructor.name=="Point"&&E==null&&S==null&&(S=b,this.x=S.x,this.y=S.y)}y.prototype.getX=function(){return this.x},y.prototype.getY=function(){return this.y},y.prototype.getLocation=function(){return new y(this.x,this.y)},y.prototype.setLocation=function(b,E,S){b.constructor.name=="Point"&&E==null&&S==null?(S=b,this.setLocation(S.x,S.y)):typeof b=="number"&&typeof E=="number"&&S==null&&(parseInt(b)==b&&parseInt(E)==E?this.move(b,E):(this.x=Math.floor(b+.5),this.y=Math.floor(E+.5)))},y.prototype.move=function(b,E){this.x=b,this.y=E},y.prototype.translate=function(b,E){this.x+=b,this.y+=E},y.prototype.equals=function(b){if(b.constructor.name=="Point"){var E=b;return this.x==E.x&&this.y==E.y}return this==b},y.prototype.toString=function(){return new y().constructor.name+"[x="+this.x+",y="+this.y+"]"},f.exports=y},function(f,p,w){function y(b,E,S,N){this.x=0,this.y=0,this.width=0,this.height=0,b!=null&&E!=null&&S!=null&&N!=null&&(this.x=b,this.y=E,this.width=S,this.height=N)}y.prototype.getX=function(){return this.x},y.prototype.setX=function(b){this.x=b},y.prototype.getY=function(){return this.y},y.prototype.setY=function(b){this.y=b},y.prototype.getWidth=function(){return this.width},y.prototype.setWidth=function(b){this.width=b},y.prototype.getHeight=function(){return this.height},y.prototype.setHeight=function(b){this.height=b},y.prototype.getRight=function(){return this.x+this.width},y.prototype.getBottom=function(){return this.y+this.height},y.prototype.intersects=function(b){return!(this.getRight()"u"?"undefined":y(E);return E==null||S!="object"&&S!="function"},f.exports=b},function(f,p,w){function y(Q){if(Array.isArray(Q)){for(var oe=0,ce=Array(Q.length);oe0&&oe;){for(ke.push(de[0]);ke.length>0&&oe;){var ve=ke[0];ke.splice(0,1),ye.add(ve);for(var te=ve.getEdges(),ge=0;ge-1&&de.splice(Ie,1)}ye=new Set,Ae=new Map}}return Q},V.prototype.createDummyNodesForBendpoints=function(Q){for(var oe=[],ce=Q.source,se=this.graphManager.calcLowestCommonAncestor(Q.source,Q.target),ge=0;ge0){for(var se=this.edgeToDummyNodes.get(ce),ge=0;ge=0&&oe.splice(xe,1);var De=Ae.getNeighborsList();De.forEach(function(ee){if(ce.indexOf(ee)<0){var rt=se.get(ee),me=rt-1;me==1&&ve.push(ee),se.set(ee,me)}})}ce=ce.concat(ve),(oe.length==1||oe.length==2)&&(ge=!0,ye=oe[0])}return ye},V.prototype.setGraphManager=function(Q){this.graphManager=Q},f.exports=V},function(f,p,w){function y(){}y.seed=1,y.x=0,y.nextDouble=function(){return y.x=Math.sin(y.seed++)*1e4,y.x-Math.floor(y.x)},f.exports=y},function(f,p,w){var y=w(4);function b(E,S){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}b.prototype.getWorldOrgX=function(){return this.lworldOrgX},b.prototype.setWorldOrgX=function(E){this.lworldOrgX=E},b.prototype.getWorldOrgY=function(){return this.lworldOrgY},b.prototype.setWorldOrgY=function(E){this.lworldOrgY=E},b.prototype.getWorldExtX=function(){return this.lworldExtX},b.prototype.setWorldExtX=function(E){this.lworldExtX=E},b.prototype.getWorldExtY=function(){return this.lworldExtY},b.prototype.setWorldExtY=function(E){this.lworldExtY=E},b.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},b.prototype.setDeviceOrgX=function(E){this.ldeviceOrgX=E},b.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},b.prototype.setDeviceOrgY=function(E){this.ldeviceOrgY=E},b.prototype.getDeviceExtX=function(){return this.ldeviceExtX},b.prototype.setDeviceExtX=function(E){this.ldeviceExtX=E},b.prototype.getDeviceExtY=function(){return this.ldeviceExtY},b.prototype.setDeviceExtY=function(E){this.ldeviceExtY=E},b.prototype.transformX=function(E){var S=0,N=this.lworldExtX;return N!=0&&(S=this.ldeviceOrgX+(E-this.lworldOrgX)*this.ldeviceExtX/N),S},b.prototype.transformY=function(E){var S=0,N=this.lworldExtY;return N!=0&&(S=this.ldeviceOrgY+(E-this.lworldOrgY)*this.ldeviceExtY/N),S},b.prototype.inverseTransformX=function(E){var S=0,N=this.ldeviceExtX;return N!=0&&(S=this.lworldOrgX+(E-this.ldeviceOrgX)*this.lworldExtX/N),S},b.prototype.inverseTransformY=function(E){var S=0,N=this.ldeviceExtY;return N!=0&&(S=this.lworldOrgY+(E-this.ldeviceOrgY)*this.lworldExtY/N),S},b.prototype.inverseTransformPoint=function(E){var S=new y(this.inverseTransformX(E.x),this.inverseTransformY(E.y));return S},f.exports=b},function(f,p,w){function y($){if(Array.isArray($)){for(var V=0,Q=Array($.length);V<$.length;V++)Q[V]=$[V];return Q}else return Array.from($)}var b=w(15),E=w(7),S=w(0),N=w(8),B=w(9);function R(){b.call(this),this.useSmartIdealEdgeLengthCalculation=E.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=E.DEFAULT_EDGE_LENGTH,this.springConstant=E.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=E.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=E.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=E.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=E.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=E.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*E.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=E.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=E.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=E.MAX_ITERATIONS}R.prototype=Object.create(b.prototype);for(var j in b)R[j]=b[j];R.prototype.initParameters=function(){b.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=E.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},R.prototype.calcIdealEdgeLengths=function(){for(var $,V,Q,oe,ce,se,ge=this.getGraphManager().getAllEdges(),ye=0;yeE.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*E.COOLING_ADAPTATION_FACTOR,this.coolingFactor-($-E.ADAPTATION_LOWER_NODE_LIMIT)/(E.ADAPTATION_UPPER_NODE_LIMIT-E.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-E.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=E.MAX_NODE_DISPLACEMENT_INCREMENTAL):($>E.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(E.COOLING_ADAPTATION_FACTOR,1-($-E.ADAPTATION_LOWER_NODE_LIMIT)/(E.ADAPTATION_UPPER_NODE_LIMIT-E.ADAPTATION_LOWER_NODE_LIMIT)*(1-E.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=E.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},R.prototype.calcSpringForces=function(){for(var $=this.getAllEdges(),V,Q=0;Q<$.length;Q++)V=$[Q],this.calcSpringForce(V,V.idealLength)},R.prototype.calcRepulsionForces=function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Q,oe,ce,se,ge=this.getAllNodes(),ye;if(this.useFRGridVariant)for(this.totalIterations%E.GRID_CALCULATION_CHECK_PERIOD==1&&$&&this.updateGrid(),ye=new Set,Q=0;Qke||ye>ke)&&($.gravitationForceX=-this.gravityConstant*ce,$.gravitationForceY=-this.gravityConstant*se)):(ke=V.getEstimatedSize()*this.compoundGravityRangeFactor,(ge>ke||ye>ke)&&($.gravitationForceX=-this.gravityConstant*ce*this.compoundGravityConstant,$.gravitationForceY=-this.gravityConstant*se*this.compoundGravityConstant))},R.prototype.isConverged=function(){var $,V=!1;return this.totalIterations>this.maxIterations/3&&(V=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),$=this.totalDisplacement=ge.length||ke>=ge[0].length)){for(var Ae=0;AeR}}]),N}();f.exports=S},function(f,p,w){var y=function(){function S(N,B){for(var R=0;R2&&arguments[2]!==void 0?arguments[2]:1,j=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,$=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;b(this,S),this.sequence1=N,this.sequence2=B,this.match_score=R,this.mismatch_penalty=j,this.gap_penalty=$,this.iMax=N.length+1,this.jMax=B.length+1,this.grid=new Array(this.iMax);for(var V=0;V=0;N--){var B=this.listeners[N];B.event===E&&B.callback===S&&this.listeners.splice(N,1)}},b.emit=function(E,S){for(var N=0;NB.coolingFactor*B.maxNodeDisplacement&&(this.displacementX=B.coolingFactor*B.maxNodeDisplacement*E.sign(this.displacementX)),Math.abs(this.displacementY)>B.coolingFactor*B.maxNodeDisplacement&&(this.displacementY=B.coolingFactor*B.maxNodeDisplacement*E.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),B.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},S.prototype.propogateDisplacementToChildren=function(B,R){for(var j=this.getChild().getNodes(),$,V=0;V0)this.positionNodesRadially(de);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var ve=new Set(this.getAllNodes()),te=this.nodesWithGravity.filter(function(xe){return ve.has(xe)});this.graphManager.setAllNodesToApplyGravitation(te),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},ke.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%j.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var de=new Set(this.getAllNodes()),ve=this.nodesWithGravity.filter(function(De){return de.has(De)});this.graphManager.setAllNodesToApplyGravitation(ve),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=j.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=j.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var te=!this.isTreeGrowing&&!this.isGrowthFinished,xe=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(te,xe),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},ke.prototype.getPositionsData=function(){for(var de=this.graphManager.getAllNodes(),ve={},te=0;te1){var ee;for(ee=0;eexe&&(xe=Math.floor(Ie.y)),he=Math.floor(Ie.x+R.DEFAULT_COMPONENT_SEPERATION)}this.transform(new Q($.WORLD_CENTER_X-Ie.x/2,$.WORLD_CENTER_Y-Ie.y/2))},ke.radialLayout=function(de,ve,te){var xe=Math.max(this.maxDiagonalInTree(de),R.DEFAULT_RADIAL_SEPARATION);ke.branchRadialLayout(ve,null,0,359,0,xe);var De=ge.calculateBounds(de),he=new ye;he.setDeviceOrgX(De.getMinX()),he.setDeviceOrgY(De.getMinY()),he.setWorldOrgX(te.x),he.setWorldOrgY(te.y);for(var Ie=0;Ie1;){var cn=Bt[0];Bt.splice(0,1);var Nn=pe.indexOf(cn);Nn>=0&&pe.splice(Nn,1),jt--,Et--}ve!=null?At=(pe.indexOf(Bt[0])+1)%jt:At=0;for(var Ot=Math.abs(xe-te)/Et,oi=At;wt!=Et;oi=++oi%jt){var kt=pe[oi].getOtherEnd(de);if(kt!=ve){var Dt=(te+wt*Ot)%360,vt=(Dt+Ot)%360;ke.branchRadialLayout(kt,de,Dt,vt,De+he,he),wt++}}},ke.maxDiagonalInTree=function(de){for(var ve=ce.MIN_VALUE,te=0;teve&&(ve=De)}return ve},ke.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},ke.prototype.groupZeroDegreeMembers=function(){var de=this,ve={};this.memberGroups={},this.idToDummyNode={};for(var te=[],xe=this.graphManager.getAllNodes(),De=0;De"u"&&(ve[ee]=[]),ve[ee]=ve[ee].concat(he)}Object.keys(ve).forEach(function(rt){if(ve[rt].length>1){var me="DummyCompound_"+rt;de.memberGroups[me]=ve[rt];var gt=ve[rt][0].getParent(),pe=new N(de.graphManager);pe.id=me,pe.paddingLeft=gt.paddingLeft||0,pe.paddingRight=gt.paddingRight||0,pe.paddingBottom=gt.paddingBottom||0,pe.paddingTop=gt.paddingTop||0,de.idToDummyNode[me]=pe;var Et=de.getGraphManager().add(de.newGraph(),pe),wt=gt.getChild();wt.add(pe);for(var jt=0;jt=0;de--){var ve=this.compoundOrder[de],te=ve.id,xe=ve.paddingLeft,De=ve.paddingTop;this.adjustLocations(this.tiledMemberPack[te],ve.rect.x,ve.rect.y,xe,De)}},ke.prototype.repopulateZeroDegreeMembers=function(){var de=this,ve=this.tiledZeroDegreePack;Object.keys(ve).forEach(function(te){var xe=de.idToDummyNode[te],De=xe.paddingLeft,he=xe.paddingTop;de.adjustLocations(ve[te],xe.rect.x,xe.rect.y,De,he)})},ke.prototype.getToBeTiled=function(de){var ve=de.id;if(this.toBeTiled[ve]!=null)return this.toBeTiled[ve];var te=de.getChild();if(te==null)return this.toBeTiled[ve]=!1,!1;for(var xe=te.getNodes(),De=0;De0)return this.toBeTiled[ve]=!1,!1;if(he.getChild()==null){this.toBeTiled[he.id]=!1;continue}if(!this.getToBeTiled(he))return this.toBeTiled[ve]=!1,!1}return this.toBeTiled[ve]=!0,!0},ke.prototype.getNodeDegree=function(de){de.id;for(var ve=de.getEdges(),te=0,xe=0;xert&&(rt=gt.rect.height)}te+=rt+de.verticalPadding}},ke.prototype.tileCompoundMembers=function(de,ve){var te=this;this.tiledMemberPack=[],Object.keys(de).forEach(function(xe){var De=ve[xe];te.tiledMemberPack[xe]=te.tileNodes(de[xe],De.paddingLeft+De.paddingRight),De.rect.width=te.tiledMemberPack[xe].width,De.rect.height=te.tiledMemberPack[xe].height})},ke.prototype.tileNodes=function(de,ve){var te=R.TILING_PADDING_VERTICAL,xe=R.TILING_PADDING_HORIZONTAL,De={rows:[],rowWidth:[],rowHeight:[],width:0,height:ve,verticalPadding:te,horizontalPadding:xe};de.sort(function(ee,rt){return ee.rect.width*ee.rect.height>rt.rect.width*rt.rect.height?-1:ee.rect.width*ee.rect.height0&&(Ie+=de.horizontalPadding),de.rowWidth[te]=Ie,de.width0&&(ee+=de.verticalPadding);var rt=0;ee>de.rowHeight[te]&&(rt=de.rowHeight[te],de.rowHeight[te]=ee,rt=de.rowHeight[te]-rt),de.height+=rt,de.rows[te].push(ve)},ke.prototype.getShortestRowIndex=function(de){for(var ve=-1,te=Number.MAX_VALUE,xe=0;xete&&(ve=xe,te=de.rowWidth[xe]);return ve},ke.prototype.canAddHorizontal=function(de,ve,te){var xe=this.getShortestRowIndex(de);if(xe<0)return!0;var De=de.rowWidth[xe];if(De+de.horizontalPadding+ve<=de.width)return!0;var he=0;de.rowHeight[xe]0&&(he=te+de.verticalPadding-de.rowHeight[xe]);var Ie;de.width-De>=ve+de.horizontalPadding?Ie=(de.height+he)/(De+ve+de.horizontalPadding):Ie=(de.height+he)/de.width,he=te+de.verticalPadding;var ee;return de.widthhe&&ve!=te){xe.splice(-1,1),de.rows[te].push(De),de.rowWidth[ve]=de.rowWidth[ve]-he,de.rowWidth[te]=de.rowWidth[te]+he,de.width=de.rowWidth[instance.getLongestRowIndex(de)];for(var Ie=Number.MIN_VALUE,ee=0;eeIe&&(Ie=xe[ee].height);ve>0&&(Ie+=de.verticalPadding);var rt=de.rowHeight[ve]+de.rowHeight[te];de.rowHeight[ve]=Ie,de.rowHeight[te]0)for(var wt=De;wt<=he;wt++)Et[0]+=this.grid[wt][Ie-1].length+this.grid[wt][Ie].length-1;if(he0)for(var wt=Ie;wt<=ee;wt++)Et[3]+=this.grid[De-1][wt].length+this.grid[De][wt].length-1;for(var jt=ce.MAX_VALUE,At,Bt,cn=0;cn0){var ee;ee=ye.getGraphManager().add(ye.newGraph(),te),this.processChildrenList(ee,ve,ye)}}},Q.prototype.stop=function(){return this.stopped=!0,this};var ce=function(ge){ge("layout","cose-bilkent",Q)};typeof cytoscape<"u"&&ce(cytoscape),p.exports=ce}])})})(qqt);const Yqt=xLe(Fge);dje.use(Yqt);function bje(i,a,f,p){fje.drawNode(i,a,f,p),a.children&&a.children.forEach((w,y)=>{bje(i,w,f<0?y:f,p)})}function Xqt(i,a){a.edges().map((f,p)=>{const w=f.data();if(f[0]._private.bodyBounds){const y=f[0]._private.rscratch;Fe.trace("Edge: ",p,w),i.insert("path").attr("d",`M ${y.startX},${y.startY} L ${y.midX},${y.midY} L${y.endX},${y.endY} `).attr("class","edge section-edge-"+w.section+" edge-depth-"+w.depth)}})}function vje(i,a,f,p){a.add({group:"nodes",data:{id:i.id,labelText:i.descr,height:i.height,width:i.width,level:p,nodeId:i.id,padding:i.padding,type:i.type},position:{x:i.x,y:i.y}}),i.children&&i.children.forEach(w=>{vje(w,a,f,p+1),a.add({group:"edges",data:{id:`${i.id}_${w.id}`,source:i.id,target:w.id,depth:p,section:w.section}})})}function Qqt(i,a){return new Promise(f=>{const p=Cr("body").append("div").attr("id","cy").attr("style","display:none"),w=dje({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});p.remove(),vje(i,w,a,0),w.nodes().forEach(function(y){y.layoutDimensions=()=>{const b=y.data();return{w:b.width,h:b.height}}}),w.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),w.ready(y=>{Fe.info("Ready",y),f(w)})})}function Zqt(i){i.nodes().map((a,f)=>{const p=a.data();p.x=a.position().x,p.y=a.position().y,fje.positionNode(p);const w=Bge(p.nodeId);Fe.info("Id:",f,"Position: (",a.position().x,", ",a.position().y,")",p),w.attr("transform",`translate(${a.position().x-p.width/2}, ${a.position().y-p.height/2})`),w.attr("attr",`apa-${f})`)})}const Jqt={draw:async(i,a,f,p)=>{const w=Tt();w.htmlLabels=!1,p.db.clear(),p.parser.parse(i),Fe.debug(`Rendering mindmap diagram -`+i,p.parser);const y=Tt().securityLevel;let b;y==="sandbox"&&(b=Cr("#i"+a));const S=Cr(y==="sandbox"?b.nodes()[0].contentDocument.body:"body").select("#"+a);S.append("g");const N=p.db.getMindmap(),B=S.append("g");B.attr("class","mindmap-edges");const R=S.append("g");R.attr("class","mindmap-nodes"),bje(R,N,-1,w);const j=await Qqt(N,w);Xqt(B,j),Zqt(j),YE(void 0,S,w.mindmap.padding,w.mindmap.useMaxWidth)}},eVt=i=>{let a="";for(let f=0;fdHe});var dHe,Zde=R(()=>{"use strict";Lde();Gde();Xde();Kde();dHe={db:mP,renderer:qde,parser:_de,styles:jde}});var yP,t0e,r0e=R(()=>{"use strict";yP=function(){var t=o(function(S,T,E,_){for(E=E||{},_=S.length;_--;E[S[_]]=T);return E},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],l=[1,19],u=[6,7,8],h=[1,26],f=[1,24],d=[1,25],p=[6,7,11],m=[1,6,13,15,16,19,22],g=[1,33],y=[1,34],v=[1,6,7,11,13,15,16,19,22],x={trace:o(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:o(function(T,E,_,A,L,M,N){var k=M.length-1;switch(L){case 6:case 7:return A;case 8:A.getLogger().trace("Stop NL ");break;case 9:A.getLogger().trace("Stop EOF ");break;case 11:A.getLogger().trace("Stop NL2 ");break;case 12:A.getLogger().trace("Stop EOF2 ");break;case 15:A.getLogger().info("Node: ",M[k].id),A.addNode(M[k-1].length,M[k].id,M[k].descr,M[k].type);break;case 16:A.getLogger().trace("Icon: ",M[k]),A.decorateNode({icon:M[k]});break;case 17:case 21:A.decorateNode({class:M[k]});break;case 18:A.getLogger().trace("SPACELIST");break;case 19:A.getLogger().trace("Node: ",M[k].id),A.addNode(0,M[k].id,M[k].descr,M[k].type);break;case 20:A.decorateNode({icon:M[k]});break;case 25:A.getLogger().trace("node found ..",M[k-2]),this.$={id:M[k-1],descr:M[k-1],type:A.getType(M[k-2],M[k])};break;case 26:this.$={id:M[k],descr:M[k],type:A.nodeType.DEFAULT};break;case 27:A.getLogger().trace("node found ..",M[k-3]),this.$={id:M[k-3],descr:M[k-1],type:A.getType(M[k-2],M[k])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:l},t(u,[2,3]),{1:[2,2]},t(u,[2,4]),t(u,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:l},{6:r,9:22,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:l},{6:h,7:f,10:23,11:d},t(p,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:l}),t(p,[2,18]),t(p,[2,19]),t(p,[2,20]),t(p,[2,21]),t(p,[2,23]),t(p,[2,24]),t(p,[2,26],{19:[1,30]}),{20:[1,31]},{6:h,7:f,10:32,11:d},{1:[2,7],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:l},t(m,[2,14],{7:g,11:y}),t(v,[2,8]),t(v,[2,9]),t(v,[2,10]),t(p,[2,15]),t(p,[2,16]),t(p,[2,17]),{20:[1,35]},{21:[1,36]},t(m,[2,13],{7:g,11:y}),t(v,[2,11]),t(v,[2,12]),{21:[1,37]},t(p,[2,25]),t(p,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(T,E){if(E.recoverable)this.trace(T);else{var _=new Error(T);throw _.hash=E,_}},"parseError"),parse:o(function(T){var E=this,_=[0],A=[],L=[null],M=[],N=this.table,k="",I=0,C=0,O=0,D=2,P=1,F=M.slice.call(arguments,1),B=Object.create(this.lexer),$={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&($.yy[z]=this.yy[z]);B.setInput(T,$.yy),$.yy.lexer=B,$.yy.parser=this,typeof B.yylloc>"u"&&(B.yylloc={});var Y=B.yylloc;M.push(Y);var Q=B.options&&B.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function X(ke){_.length=_.length-2*ke,L.length=L.length-ke,M.length=M.length-ke}o(X,"popStack");function ie(){var ke;return ke=A.pop()||B.lex()||P,typeof ke!="number"&&(ke instanceof Array&&(A=ke,ke=A.pop()),ke=E.symbols_[ke]||ke),ke}o(ie,"lex");for(var j,J,Z,H,q,K,se={},ce,ue,te,De;;){if(Z=_[_.length-1],this.defaultActions[Z]?H=this.defaultActions[Z]:((j===null||typeof j>"u")&&(j=ie()),H=N[Z]&&N[Z][j]),typeof H>"u"||!H.length||!H[0]){var oe="";De=[];for(ce in N[Z])this.terminals_[ce]&&ce>D&&De.push("'"+this.terminals_[ce]+"'");B.showPosition?oe="Parse error on line "+(I+1)+`: +`+B.showPosition()+` +Expecting `+De.join(", ")+", got '"+(this.terminals_[j]||j)+"'":oe="Parse error on line "+(I+1)+": Unexpected "+(j==P?"end of input":"'"+(this.terminals_[j]||j)+"'"),this.parseError(oe,{text:B.match,token:this.terminals_[j]||j,line:B.yylineno,loc:Y,expected:De})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+j);switch(H[0]){case 1:_.push(j),L.push(B.yytext),M.push(B.yylloc),_.push(H[1]),j=null,J?(j=J,J=null):(C=B.yyleng,k=B.yytext,I=B.yylineno,Y=B.yylloc,O>0&&O--);break;case 2:if(ue=this.productions_[H[1]][1],se.$=L[L.length-ue],se._$={first_line:M[M.length-(ue||1)].first_line,last_line:M[M.length-1].last_line,first_column:M[M.length-(ue||1)].first_column,last_column:M[M.length-1].last_column},Q&&(se._$.range=[M[M.length-(ue||1)].range[0],M[M.length-1].range[1]]),K=this.performAction.apply(se,[k,C,I,$.yy,H[1],L,M].concat(F)),typeof K<"u")return K;ue&&(_=_.slice(0,-1*ue*2),L=L.slice(0,-1*ue),M=M.slice(0,-1*ue)),_.push(this.productions_[H[1]][0]),L.push(se.$),M.push(se._$),te=N[_[_.length-2]][_[_.length-1]],_.push(te);break;case 3:return!0}}return!0},"parse")},b=function(){var S={EOF:1,parseError:o(function(E,_){if(this.yy.parser)this.yy.parser.parseError(E,_);else throw new Error(E)},"parseError"),setInput:o(function(T,E){return this.yy=E||this.yy||{},this._input=T,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var T=this._input[0];this.yytext+=T,this.yyleng++,this.offset++,this.match+=T,this.matched+=T;var E=T.match(/(?:\r\n?|\n).*/g);return E?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),T},"input"),unput:o(function(T){var E=T.length,_=T.split(/(?:\r\n?|\n)/g);this._input=T+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-E),this.offset-=E;var A=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),_.length-1&&(this.yylineno-=_.length-1);var L=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:_?(_.length===A.length?this.yylloc.first_column:0)+A[A.length-_.length].length-_[0].length:this.yylloc.first_column-E},this.options.ranges&&(this.yylloc.range=[L[0],L[0]+this.yyleng-E]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(T){this.unput(this.match.slice(T))},"less"),pastInput:o(function(){var T=this.matched.substr(0,this.matched.length-this.match.length);return(T.length>20?"...":"")+T.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var T=this.match;return T.length<20&&(T+=this._input.substr(0,20-T.length)),(T.substr(0,20)+(T.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var T=this.pastInput(),E=new Array(T.length+1).join("-");return T+this.upcomingInput()+` +`+E+"^"},"showPosition"),test_match:o(function(T,E){var _,A,L;if(this.options.backtrack_lexer&&(L={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},this.options.ranges&&(L.yylloc.range=this.yylloc.range.slice(0))),A=T[0].match(/(?:\r\n?|\n).*/g),A&&(this.yylineno+=A.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:A?A[A.length-1].length-A[A.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+T[0].length},this.yytext+=T[0],this.match+=T[0],this.matches=T,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(T[0].length),this.matched+=T[0],_=this.performAction.call(this,this.yy,this,E,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),_)return _;if(this._backtrack){for(var M in L)this[M]=L[M];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var T,E,_,A;this._more||(this.yytext="",this.match="");for(var L=this._currentRules(),M=0;ME[0].length)){if(E=_,A=M,this.options.backtrack_lexer){if(T=this.test_match(_,L[M]),T!==!1)return T;if(this._backtrack){E=!1;continue}else return!1}else if(!this.options.flex)break}return E?(T=this.test_match(E,L[A]),T!==!1?T:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var E=this.next();return E||this.lex()},"lex"),begin:o(function(E){this.conditionStack.push(E)},"begin"),popState:o(function(){var E=this.conditionStack.length-1;return E>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(E){return E=this.conditionStack.length-1-Math.abs(E||0),E>=0?this.conditionStack[E]:"INITIAL"},"topState"),pushState:o(function(E){this.begin(E)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(E,_,A,L){var M=L;switch(A){case 0:return E.getLogger().trace("Found comment",_.yytext),6;break;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;break;case 4:this.popState();break;case 5:E.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return E.getLogger().trace("SPACELINE"),6;break;case 7:return 7;case 8:return 15;case 9:E.getLogger().trace("end icon"),this.popState();break;case 10:return E.getLogger().trace("Exploding node"),this.begin("NODE"),19;break;case 11:return E.getLogger().trace("Cloud"),this.begin("NODE"),19;break;case 12:return E.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;break;case 13:return E.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;break;case 14:return this.begin("NODE"),19;break;case 15:return this.begin("NODE"),19;break;case 16:return this.begin("NODE"),19;break;case 17:return this.begin("NODE"),19;break;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:E.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return E.getLogger().trace("description:",_.yytext),"NODE_DESCR";break;case 26:this.popState();break;case 27:return this.popState(),E.getLogger().trace("node end ))"),"NODE_DEND";break;case 28:return this.popState(),E.getLogger().trace("node end )"),"NODE_DEND";break;case 29:return this.popState(),E.getLogger().trace("node end ...",_.yytext),"NODE_DEND";break;case 30:return this.popState(),E.getLogger().trace("node end (("),"NODE_DEND";break;case 31:return this.popState(),E.getLogger().trace("node end (-"),"NODE_DEND";break;case 32:return this.popState(),E.getLogger().trace("node end (-"),"NODE_DEND";break;case 33:return this.popState(),E.getLogger().trace("node end (("),"NODE_DEND";break;case 34:return this.popState(),E.getLogger().trace("node end (("),"NODE_DEND";break;case 35:return E.getLogger().trace("Long description:",_.yytext),20;break;case 36:return E.getLogger().trace("Long description:",_.yytext),20;break}},"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:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return S}();x.lexer=b;function w(){this.yy={}}return o(w,"Parser"),w.prototype=x,x.Parser=w,new w}();yP.parser=yP;t0e=yP});var Gl,n0e,vP,yHe,vHe,xHe,bHe,$i,wHe,THe,kHe,EHe,CHe,SHe,AHe,i0e,a0e=R(()=>{"use strict";_t();rr();ut();sl();Gl=[],n0e=0,vP={},yHe=o(()=>{Gl=[],n0e=0,vP={}},"clear"),vHe=o(function(t){for(let e=Gl.length-1;e>=0;e--)if(Gl[e].levelGl.length>0?Gl[0]:null,"getMindmap"),bHe=o((t,e,r,n)=>{V.info("addNode",t,e,r,n);let i=de(),a=i.mindmap?.padding??mr.mindmap.padding;switch(n){case $i.ROUNDED_RECT:case $i.RECT:case $i.HEXAGON:a*=2}let s={id:n0e++,nodeId:qr(e,i),level:t,descr:qr(r,i),type:n,children:[],width:i.mindmap?.maxNodeWidth??mr.mindmap.maxNodeWidth,padding:a},l=vHe(t);if(l)l.children.push(s),Gl.push(s);else if(Gl.length===0)Gl.push(s);else throw new Error('There can be only one root. No parent could be found for ("'+s.descr+'")')},"addNode"),$i={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},wHe=o((t,e)=>{switch(V.debug("In get type",t,e),t){case"[":return $i.RECT;case"(":return e===")"?$i.ROUNDED_RECT:$i.CLOUD;case"((":return $i.CIRCLE;case")":return $i.CLOUD;case"))":return $i.BANG;case"{{":return $i.HEXAGON;default:return $i.DEFAULT}},"getType"),THe=o((t,e)=>{vP[t]=e},"setElementForId"),kHe=o(t=>{if(!t)return;let e=de(),r=Gl[Gl.length-1];t.icon&&(r.icon=qr(t.icon,e)),t.class&&(r.class=qr(t.class,e))},"decorateNode"),EHe=o(t=>{switch(t){case $i.DEFAULT:return"no-border";case $i.RECT:return"rect";case $i.ROUNDED_RECT:return"rounded-rect";case $i.CIRCLE:return"circle";case $i.CLOUD:return"cloud";case $i.BANG:return"bang";case $i.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),CHe=o(()=>V,"getLogger"),SHe=o(t=>vP[t],"getElementById"),AHe={clear:yHe,addNode:bHe,getMindmap:xHe,nodeType:$i,getType:wHe,setElementForId:THe,decorateNode:kHe,type2Str:EHe,getLogger:CHe,getElementById:SHe},i0e=AHe});function Hi(t){"@babel/helpers - typeof";return Hi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hi(t)}function XP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s0e(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},"n"),e:o(function(u){throw u},"e"),f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,l;return{s:o(function(){r=r.call(t)},"s"),n:o(function(){var u=r.next();return a=u.done,u},"n"),e:o(function(u){s=!0,l=u},"e"),f:o(function(){try{!a&&r.return!=null&&r.return()}finally{if(s)throw l}},"f")}}function eYe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function tYe(t,e){return e={exports:{}},t(e,e.exports),e.exports}function lYe(t){for(var e=t.length;e--&&oYe.test(t.charAt(e)););return e}function hYe(t){return t&&t.slice(0,cYe(t)+1).replace(uYe,"")}function gYe(t){var e=pYe.call(t,_x),r=t[_x];try{t[_x]=void 0;var n=!0}catch{}var i=mYe.call(t);return n&&(e?t[_x]=r:delete t[_x]),i}function bYe(t){return xYe.call(t)}function EYe(t){return t==null?t===void 0?kYe:TYe:u0e&&u0e in Object(t)?yYe(t):wYe(t)}function CYe(t){return t!=null&&typeof t=="object"}function _Ye(t){return typeof t=="symbol"||SYe(t)&&Rpe(t)==AYe}function MYe(t){if(typeof t=="number")return t;if(Jx(t))return h0e;if(V0(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=V0(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=fYe(t);var r=DYe.test(t);return r||RYe.test(t)?NYe(t.slice(2),r?2:8):LYe.test(t)?h0e:+t}function BYe(t,e,r){var n,i,a,s,l,u,h=0,f=!1,d=!1,p=!0;if(typeof t!="function")throw new TypeError(IYe);e=f0e(e)||0,V0(r)&&(f=!!r.leading,d="maxWait"in r,a=d?OYe(f0e(r.maxWait)||0,e):a,p="trailing"in r?!!r.trailing:p);function m(E){var _=n,A=i;return n=i=void 0,h=E,s=t.apply(A,_),s}o(m,"invokeFunc");function g(E){return h=E,l=setTimeout(x,e),f?m(E):s}o(g,"leadingEdge");function y(E){var _=E-u,A=E-h,L=e-_;return d?PYe(L,a-A):L}o(y,"remainingWait");function v(E){var _=E-u,A=E-h;return u===void 0||_>=e||_<0||d&&A>=a}o(v,"shouldInvoke");function x(){var E=xP();if(v(E))return b(E);l=setTimeout(x,y(E))}o(x,"timerExpired");function b(E){return l=void 0,p&&n?m(E):(n=i=void 0,s)}o(b,"trailingEdge");function w(){l!==void 0&&clearTimeout(l),h=0,n=u=i=l=void 0}o(w,"cancel");function S(){return l===void 0?s:b(xP())}o(S,"flush");function T(){var E=xP(),_=v(E);if(n=arguments,i=this,u=E,_){if(l===void 0)return g(u);if(d)return clearTimeout(l),l=setTimeout(x,e),m(u)}return l===void 0&&(l=setTimeout(x,e)),s}return o(T,"debounced"),T.cancel=w,T.flush=S,T}function z6(t,e,r,n,i,a){var s;return jn(t)?s=t:s=o1[t]||o1.euclidean,e===0&&jn(t)?s(i,a):s(e,r,n,i,a)}function Lqe(t,e){if(G6(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Jx(t)?!0:_qe.test(t)||!Aqe.test(t)||e!=null&&t in Object(e)}function Oqe(t){if(!V0(t))return!1;var e=Rpe(t);return e==Nqe||e==Mqe||e==Rqe||e==Iqe}function Fqe(t){return!!N0e&&N0e in t}function Vqe(t){if(t!=null){try{return $qe.call(t)}catch{}try{return t+""}catch{}}return""}function Qqe(t){if(!V0(t)||zqe(t))return!1;var e=Pqe(t)?Kqe:Yqe;return e.test(Uqe(t))}function Jqe(t,e){return t?.[e]}function tXe(t,e){var r=eXe(t,e);return Zqe(r)?r:void 0}function nXe(){this.__data__=Wx?Wx(null):{},this.size=0}function aXe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function uXe(t){var e=this.__data__;if(Wx){var r=e[t];return r===oXe?void 0:r}return cXe.call(e,t)?e[t]:void 0}function pXe(t){var e=this.__data__;return Wx?e[t]!==void 0:dXe.call(e,t)}function yXe(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Wx&&e===void 0?gXe:e,this}function h1(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1}function RXe(t,e){var r=this.__data__,n=$6(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function f1(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1&&t%1==0&&t0;){var f=i.shift();e(f),a.add(f.id()),l&&n(i,a,f)}return t}function ume(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i0&&arguments[0]!==void 0?arguments[0]:mKe,e=arguments.length>1?arguments[1]:void 0,r=0;r0?k=C:N=C;while(Math.abs(I)>s&&++O=a?b(M,O):D===0?O:S(M,N,N+h)}o(T,"getTForX");var E=!1;function _(){E=!0,(t!==e||r!==n)&&w()}o(_,"precompute");var A=o(function(N){return E||_(),t===e&&r===n?N:N===0?0:N===1?1:v(T(N),e,n)},"f");A.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var L="generateBezier("+[t,e,r,n]+")";return A.toString=function(){return L},A}function Q0e(t,e,r,n,i){if(n===1||e===r)return r;var a=i(e,r,n);return t==null||((t.roundValue||t.color)&&(a=Math.round(a)),t.min!==void 0&&(a=Math.max(a,t.min)),t.max!==void 0&&(a=Math.min(a,t.max))),a}function Z0e(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function jg(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var s=Z0e(t,i),l=Z0e(e,i);if(ft(s)&&ft(l))return Q0e(a,s,l,r,n);if(vn(s)&&vn(l)){for(var u=[],h=0;h0?(m==="spring"&&g.push(s.duration),s.easingImpl=v6[m].apply(null,g)):s.easingImpl=v6[m]}var y=s.easingImpl,v;if(s.duration===0?v=1:v=(r-u)/s.duration,s.applying&&(v=s.progress),v<0?v=0:v>1&&(v=1),s.delay==null){var x=s.startPosition,b=s.position;if(b&&i&&!t.locked()){var w={};Nx(x.x,b.x)&&(w.x=jg(x.x,b.x,v,y)),Nx(x.y,b.y)&&(w.y=jg(x.y,b.y,v,y)),t.position(w)}var S=s.startPan,T=s.pan,E=a.pan,_=T!=null&&n;_&&(Nx(S.x,T.x)&&(E.x=jg(S.x,T.x,v,y)),Nx(S.y,T.y)&&(E.y=jg(S.y,T.y,v,y)),t.emit("pan"));var A=s.startZoom,L=s.zoom,M=L!=null&&n;M&&(Nx(A,L)&&(a.zoom=Hx(a.minZoom,jg(A,L,v,y),a.maxZoom)),t.emit("zoom")),(_||M)&&t.emit("viewport");var N=s.style;if(N&&N.length>0&&i){for(var k=0;k=0;_--){var A=E[_];A()}E.splice(0,E.length)},"callbacks"),b=m.length-1;b>=0;b--){var w=m[b],S=w._private;if(S.stopped){m.splice(b,1),S.hooked=!1,S.playing=!1,S.started=!1,x(S.frames);continue}!S.playing&&!S.applying||(S.playing&&S.applying&&(S.applying=!1),S.started||LKe(f,w,t),_Ke(f,w,t,d),S.applying&&(S.applying=!1),x(S.frames),S.step!=null&&S.step(t),w.completed()&&(m.splice(b,1),S.hooked=!1,S.playing=!1,S.started=!1,x(S.completes)),y=!0)}return!d&&m.length===0&&g.length===0&&n.push(f),y}o(i,"stepOne");for(var a=!1,s=0;s0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}function Ame(t){this.options=Wt({},BKe,FKe,t)}function _me(t){this.options=Wt({},zKe,t)}function Lme(t){this.options=Wt({},GKe,t)}function j6(t){this.options=Wt({},$Ke,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),n=r.filter(function(i){var a=i.source().data("id"),s=i.target().data("id"),l=e.some(function(h){return h.data("id")===a}),u=e.some(function(h){return h.data("id")===s});return!l||!u});this.options.eles=this.options.eles.not(n)}function Rme(t){this.options=Wt({},iQe,t)}function dB(t){this.options=Wt({},aQe,t)}function Nme(t){this.options=Wt({},sQe,t)}function Mme(t){this.options=Wt({},oQe,t)}function Ime(t){this.options=t,this.notifications=0}function Bme(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function mB(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(uQe(t,e,r,n,i),{cx:GP,cy:$P,radius:z0,startX:Ome,startY:Pme,stopX:VP,stopY:UP,startAngle:Gc.ang+Math.PI/2*G0,endAngle:Jo.ang-Math.PI/2*G0,counterClockwise:w6})}function Fme(t){var e=[];if(t!=null){for(var r=0;r5&&arguments[5]!==void 0?arguments[5]:5,s=arguments.length>6?arguments[6]:void 0;t.beginPath(),t.moveTo(e+a,r),t.lineTo(e+n-a,r),t.quadraticCurveTo(e+n,r,e+n,r+a),t.lineTo(e+n,r+i-a),t.quadraticCurveTo(e+n,r+i,e+n-a,r+i),t.lineTo(e+a,r+i),t.quadraticCurveTo(e,r+i,e,r+i-a),t.lineTo(e,r+a),t.quadraticCurveTo(e,r,e+a,r),t.closePath(),s?t.stroke():t.fill()}function ZQe(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a{"use strict";o(Hi,"_typeof");o(XP,"_classCallCheck");o(s0e,"_defineProperties");o(jP,"_createClass");o(bpe,"_defineProperty$1");o($l,"_slicedToArray");o(_He,"_arrayWithHoles");o(LHe,"_iterableToArrayLimit");o(wpe,"_unsupportedIterableToArray");o(o0e,"_arrayLikeToArray");o(DHe,"_nonIterableRest");o(Tpe,"_createForOfIteratorHelper");Vi=typeof window>"u"?null:window,l0e=Vi?Vi.navigator:null;Vi&&Vi.document;RHe=Hi(""),kpe=Hi({}),NHe=Hi(function(){}),MHe=typeof HTMLElement>"u"?"undefined":Hi(HTMLElement),Qx=o(function(e){return e&&e.instanceString&&jn(e.instanceString)?e.instanceString():null},"instanceStr"),zt=o(function(e){return e!=null&&Hi(e)==RHe},"string"),jn=o(function(e){return e!=null&&Hi(e)===NHe},"fn"),vn=o(function(e){return!xo(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},"array"),Mr=o(function(e){return e!=null&&Hi(e)===kpe&&!vn(e)&&e.constructor===Object},"plainObject"),IHe=o(function(e){return e!=null&&Hi(e)===kpe},"object"),ft=o(function(e){return e!=null&&Hi(e)===Hi(1)&&!isNaN(e)},"number"),OHe=o(function(e){return ft(e)&&Math.floor(e)===e},"integer"),k6=o(function(e){if(MHe!=="undefined")return e!=null&&e instanceof HTMLElement},"htmlElement"),xo=o(function(e){return Zx(e)||Epe(e)},"elementOrCollection"),Zx=o(function(e){return Qx(e)==="collection"&&e._private.single},"element"),Epe=o(function(e){return Qx(e)==="collection"&&!e._private.single},"collection"),KP=o(function(e){return Qx(e)==="core"},"core"),Cpe=o(function(e){return Qx(e)==="stylesheet"},"stylesheet"),PHe=o(function(e){return Qx(e)==="event"},"event"),Sf=o(function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},"emptyString"),BHe=o(function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},"domElement"),FHe=o(function(e){return Mr(e)&&ft(e.x1)&&ft(e.x2)&&ft(e.y1)&&ft(e.y2)},"boundingBox"),zHe=o(function(e){return IHe(e)&&jn(e.then)},"promise"),GHe=o(function(){return l0e&&l0e.userAgent.match(/msie|trident|edge/i)},"ms"),Gx=o(function(e,r){r||(r=o(function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],s=0;sr?1:0},"ascending"),qHe=o(function(e,r){return-1*Ape(e,r)},"descending"),Wt=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r1&&(v-=1),v<1/6?g+(y-g)*6*v:v<1/2?y:v<2/3?g+(y-g)*(2/3-v)*6:g}o(f,"hue2rgb");var d=new RegExp("^"+UHe+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,i=parseFloat(d[2]),i<0||i>100||(i=i/100,a=parseFloat(d[3]),a<0||a>100)||(a=a/100,s=d[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(i===0)l=u=h=Math.round(a*255);else{var p=a<.5?a*(1+i):a+i-a*i,m=2*a-p;l=Math.round(255*f(m,p,n+1/3)),u=Math.round(255*f(m,p,n)),h=Math.round(255*f(m,p,n-1/3))}r=[l,u,h,s]}return r},"hsl2tuple"),KHe=o(function(e){var r,n=new RegExp("^"+$He+"$").exec(e);if(n){r=[];for(var i=[],a=1;a<=3;a++){var s=n[a];if(s[s.length-1]==="%"&&(i[a]=!0),s=parseFloat(s),i[a]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var l=i[1]||i[2]||i[3],u=i[1]&&i[2]&&i[3];if(l&&!u)return;var h=n[4];if(h!==void 0){if(h=parseFloat(h),h<0||h>1)return;r.push(h)}}return r},"rgb2tuple"),QHe=o(function(e){return JHe[e.toLowerCase()]},"colorname2tuple"),ZHe=o(function(e){return(vn(e)?e:null)||QHe(e)||XHe(e)||KHe(e)||jHe(e)},"color2tuple"),JHe={transparent:[0,0,0,0],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]},_pe=o(function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a1&&arguments[1]!==void 0?arguments[1]:Zg,n=r,i;i=e.next(),!i.done;)n=n*Mpe+i.value|0;return n},"hashIterableInts"),$x=o(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Zg;return r*Mpe+e|0},"hashInt"),Vx=o(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ix;return(r<<5)+r+e|0},"hashIntAlt"),zYe=o(function(e,r){return e*2097152+r},"combineHashes"),bf=o(function(e){return e[0]*2097152+e[1]},"combineHashesArray"),r6=o(function(e,r){return[$x(e[0],r[0]),Vx(e[1],r[1])]},"hashArrays"),GYe=o(function(e,r){var n={value:0,done:!1},i=0,a=e.length,s={next:o(function(){return i=0&&!(e[i]===r&&(e.splice(i,1),n));i--);},"removeFromArray"),eB=o(function(e){e.splice(0,e.length)},"clearArray"),qYe=o(function(e,r){for(var n=0;n"u"?"undefined":Hi(Set))!==jYe?Set:KYe,B6=o(function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!KP(e)){oi("An element must have a core reference and parameters set");return}var i=r.group;if(i==null&&(r.data&&r.data.source!=null&&r.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){oi("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var a=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?i==="edges":!!r.pannable,active:!1,classes:new c1,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(a.position.x==null&&(a.position.x=0),a.position.y==null&&(a.position.y=0),r.renderedPosition){var s=r.renderedPosition,l=e.pan(),u=e.zoom();a.position={x:(s.x-l.x)/u,y:(s.y-l.y)/u}}var h=[];vn(r.classes)?h=r.classes:zt(r.classes)&&(h=r.classes.split(/\s+/));for(var f=0,d=h.length;fb?1:0},"defaultCmp"),f=o(function(x,b,w,S,T){var E;if(w==null&&(w=0),T==null&&(T=n),w<0)throw new Error("lo must be non-negative");for(S==null&&(S=x.length);wM;0<=M?L++:L--)A.push(L);return A}.apply(this).reverse(),_=[],S=0,T=E.length;SN;0<=N?++A:--A)k.push(s(x,w));return k},"nsmallest"),y=o(function(x,b,w,S){var T,E,_;for(S==null&&(S=n),T=x[w];w>b;){if(_=w-1>>1,E=x[_],S(T,E)<0){x[w]=E,w=_;continue}break}return x[w]=T},"_siftdown"),v=o(function(x,b,w){var S,T,E,_,A;for(w==null&&(w=n),T=x.length,A=b,E=x[b],S=2*b+1;S0;){var E=b.pop(),_=v(E),A=E.id();if(p[A]=_,_!==1/0)for(var L=E.neighborhood().intersect(g),M=0;M0)for(F.unshift(P);d[$];){var z=d[$];F.unshift(z.edge),F.unshift(z.node),B=z.node,$=B.id()}return l.spawn(F)},"pathTo")}},"dijkstra")},eWe={kruskal:o(function(e){e=e||function(w){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,a=n.length,s=new Array(a),l=n,u=o(function(S){for(var T=0;T0;){if(T(),_++,S===f){for(var A=[],L=a,M=f,N=x[M];A.unshift(L),N!=null&&A.unshift(N),L=v[M],L!=null;)M=L.id(),N=x[M];return{found:!0,distance:d[S],path:this.spawn(A),steps:_}}m[S]=!0;for(var k=w._private.edges,I=0;IN&&(g[M]=N,b[M]=L,w[M]=T),!a){var k=L*f+A;!a&&g[k]>N&&(g[k]=N,b[k]=A,w[k]=T)}}}for(var I=0;I1&&arguments[1]!==void 0?arguments[1]:s,Se=w(ke),Ue=[],Pe=Se;;){if(Pe==null)return r.spawn();var _e=b(Pe),me=_e.edge,W=_e.pred;if(Ue.unshift(Pe[0]),Pe.same(Ie)&&Ue.length>0)break;me!=null&&Ue.unshift(me),Pe=W}return u.spawn(Ue)},"pathTo"),E=0;E=0;f--){var d=h[f],p=d[1],m=d[2];(r[p]===l&&r[m]===u||r[p]===u&&r[m]===l)&&h.splice(f,1)}for(var g=0;gi;){var a=Math.floor(Math.random()*r.length);r=lWe(a,e,r),n--}return r},"contractUntil"),cWe={kargerStein:o(function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(F){return F.isLoop()});var a=n.length,s=i.length,l=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),u=Math.floor(a/oWe);if(a<2){oi("At least 2 nodes are required for Karger-Stein algorithm");return}for(var h=[],f=0;f1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,a=0,s=r;s1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(r,n):(n0&&e.splice(0,r));for(var l=0,u=e.length-1;u>=0;u--){var h=e[u];s?isFinite(h)||(e[u]=-1/0,l++):e.splice(u,1)}a&&e.sort(function(p,m){return p-m});var f=e.length,d=Math.floor(f/2);return f%2!==0?e[d+1+l]:(e[d-1+l]+e[d+l])/2},"median"),mWe=o(function(e){return Math.PI*e/180},"deg2rad"),n6=o(function(e,r){return Math.atan2(r,e)-Math.PI/2},"getAngleFromDisp"),tB=Math.log2||function(t){return Math.log(t)/Math.log(2)},$pe=o(function(e){return e>0?1:e<0?-1:0},"signum"),H0=o(function(e,r){return Math.sqrt(B0(e,r))},"dist"),B0=o(function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},"sqdist"),gWe=o(function(e){for(var r=e.length,n=0,i=0;i=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},"makeBoundingBox"),vWe=o(function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},"copyBoundingBox"),xWe=o(function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},"clearBoundingBox"),bWe=o(function(e,r,n){return{x1:e.x1+r,x2:e.x2+r,y1:e.y1+n,y2:e.y2+n,w:e.w,h:e.h}},"shiftBoundingBox"),Vpe=o(function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},"updateBoundingBox"),wWe=o(function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},"expandBoundingBoxByPoint"),p6=o(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},"expandBoundingBox"),m6=o(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,a,s;if(r.length===1)n=i=a=s=r[0];else if(r.length===2)n=a=r[0],s=i=r[1];else if(r.length===4){var l=$l(r,4);n=l[0],i=l[1],a=l[2],s=l[3]}return e.x1-=s,e.x2+=i,e.y1-=n,e.y2+=a,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},"expandBoundingBoxSides"),g0e=o(function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},"assignBoundingBox"),rB=o(function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},"boundingBoxesIntersect"),s1=o(function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},"inBoundingBox"),TWe=o(function(e,r){return s1(e,r.x,r.y)},"pointInBoundingBox"),Upe=o(function(e,r){return s1(e,r.x1,r.y1)&&s1(e,r.x2,r.y2)},"boundingBoxInBoundingBox"),Hpe=o(function(e,r,n,i,a,s,l){var u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",h=u==="auto"?Y0(a,s):u,f=a/2,d=s/2;h=Math.min(h,f,d);var p=h!==f,m=h!==d,g;if(p){var y=n-f+h-l,v=i-d-l,x=n+f-h+l,b=v;if(g=kf(e,r,n,i,y,v,x,b,!1),g.length>0)return g}if(m){var w=n+f+l,S=i-d+h-l,T=w,E=i+d-h+l;if(g=kf(e,r,n,i,w,S,T,E,!1),g.length>0)return g}if(p){var _=n-f+h-l,A=i+d+l,L=n+f-h+l,M=A;if(g=kf(e,r,n,i,_,A,L,M,!1),g.length>0)return g}if(m){var N=n-f-l,k=i-d+h-l,I=N,C=i+d-h+l;if(g=kf(e,r,n,i,N,k,I,C,!1),g.length>0)return g}var O;{var D=n-f+h,P=i-d+h;if(O=Ox(e,r,n,i,D,P,h+l),O.length>0&&O[0]<=D&&O[1]<=P)return[O[0],O[1]]}{var F=n+f-h,B=i-d+h;if(O=Ox(e,r,n,i,F,B,h+l),O.length>0&&O[0]>=F&&O[1]<=B)return[O[0],O[1]]}{var $=n+f-h,z=i+d-h;if(O=Ox(e,r,n,i,$,z,h+l),O.length>0&&O[0]>=$&&O[1]>=z)return[O[0],O[1]]}{var Y=n-f+h,Q=i+d-h;if(O=Ox(e,r,n,i,Y,Q,h+l),O.length>0&&O[0]<=Y&&O[1]>=Q)return[O[0],O[1]]}return[]},"roundRectangleIntersectLine"),kWe=o(function(e,r,n,i,a,s,l){var u=l,h=Math.min(n,a),f=Math.max(n,a),d=Math.min(i,s),p=Math.max(i,s);return h-u<=e&&e<=f+u&&d-u<=r&&r<=p+u},"inLineVicinity"),EWe=o(function(e,r,n,i,a,s,l,u,h){var f={x1:Math.min(n,l,a)-h,x2:Math.max(n,l,a)+h,y1:Math.min(i,u,s)-h,y2:Math.max(i,u,s)+h};return!(ef.x2||rf.y2)},"inBezierVicinity"),CWe=o(function(e,r,n,i){n-=i;var a=r*r-4*e*n;if(a<0)return[];var s=Math.sqrt(a),l=2*e,u=(-r+s)/l,h=(-r-s)/l;return[u,h]},"solveQuadratic"),SWe=o(function(e,r,n,i,a){var s=1e-5;e===0&&(e=s),r/=e,n/=e,i/=e;var l,u,h,f,d,p,m,g;if(u=(3*n-r*r)/9,h=-(27*i)+r*(9*n-2*(r*r)),h/=54,l=u*u*u+h*h,a[1]=0,m=r/3,l>0){d=h+Math.sqrt(l),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),p=h-Math.sqrt(l),p=p<0?-Math.pow(-p,1/3):Math.pow(p,1/3),a[0]=-m+d+p,m+=(d+p)/2,a[4]=a[2]=-m,m=Math.sqrt(3)*(-p+d)/2,a[3]=m,a[5]=-m;return}if(a[5]=a[3]=0,l===0){g=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),a[0]=-m+2*g,a[4]=a[2]=-(g+m);return}u=-u,f=u*u*u,f=Math.acos(h/Math.sqrt(f)),g=2*Math.sqrt(u),a[0]=-m+g*Math.cos(f/3),a[2]=-m+g*Math.cos((f+2*Math.PI)/3),a[4]=-m+g*Math.cos((f+4*Math.PI)/3)},"solveCubic"),AWe=o(function(e,r,n,i,a,s,l,u){var h=1*n*n-4*n*a+2*n*l+4*a*a-4*a*l+l*l+i*i-4*i*s+2*i*u+4*s*s-4*s*u+u*u,f=1*9*n*a-3*n*n-3*n*l-6*a*a+3*a*l+9*i*s-3*i*i-3*i*u-6*s*s+3*s*u,d=1*3*n*n-6*n*a+n*l-n*e+2*a*a+2*a*e-l*e+3*i*i-6*i*s+i*u-i*r+2*s*s+2*s*r-u*r,p=1*n*a-n*n+n*e-a*e+i*s-i*i+i*r-s*r,m=[];SWe(h,f,d,p,m);for(var g=1e-7,y=[],v=0;v<6;v+=2)Math.abs(m[v+1])=0&&m[v]<=1&&y.push(m[v]);y.push(1),y.push(0);for(var x=-1,b,w,S,T=0;T=0?Sh?(e-a)*(e-a)+(r-s)*(r-s):f-p},"sqdistToFiniteLine"),zs=o(function(e,r,n){for(var i,a,s,l,u,h=0,f=0;f=e&&e>=s||i<=e&&e<=s)u=(e-i)/(s-i)*(l-a)+a,u>r&&h++;else continue;return h%2!==0},"pointInsidePolygonPoints"),Qu=o(function(e,r,n,i,a,s,l,u,h){var f=new Array(n.length),d;u[0]!=null?(d=Math.atan(u[1]/u[0]),u[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=u;for(var p=Math.cos(-d),m=Math.sin(-d),g=0;g0){var v=A6(f,-h);y=S6(v)}else y=f;return zs(e,r,y)},"pointInsidePolygon"),LWe=o(function(e,r,n,i,a,s,l,u){for(var h=new Array(n.length*2),f=0;f=0&&v<=1&&b.push(v),x>=0&&x<=1&&b.push(x),b.length===0)return[];var w=b[0]*u[0]+e,S=b[0]*u[1]+r;if(b.length>1){if(b[0]==b[1])return[w,S];var T=b[1]*u[0]+e,E=b[1]*u[1]+r;return[w,S,T,E]}else return[w,S]},"intersectLineCircle"),TP=o(function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},"midOfThree"),kf=o(function(e,r,n,i,a,s,l,u,h){var f=e-a,d=n-e,p=l-a,m=r-s,g=i-r,y=u-s,v=p*m-y*f,x=d*m-g*f,b=y*d-p*g;if(b!==0){var w=v/b,S=x/b,T=.001,E=0-T,_=1+T;return E<=w&&w<=_&&E<=S&&S<=_?[e+w*d,r+w*g]:h?[e+w*d,r+w*g]:[]}else return v===0||x===0?TP(e,n,l)===l?[l,u]:TP(e,n,a)===a?[a,s]:TP(a,l,n)===n?[n,i]:[]:[]},"finiteLinesIntersect"),Yx=o(function(e,r,n,i,a,s,l,u){var h=[],f,d=new Array(n.length),p=!0;s==null&&(p=!1);var m;if(p){for(var g=0;g0){var y=A6(d,-u);m=S6(y)}else m=d}else m=n;for(var v,x,b,w,S=0;S2){for(var g=[f[0],f[1]],y=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),v=1;vf&&(f=S)},"set"),get:o(function(w){return h[w]},"get")},p=0;p0?D=O.edgesTo(C)[0]:D=C.edgesTo(O)[0];var P=i(D);C=C.id(),A[C]>A[k]+P&&(A[C]=A[k]+P,L.nodes.indexOf(C)<0?L.push(C):L.updateItem(C),_[C]=0,E[C]=[]),A[C]==A[k]+P&&(_[C]=_[C]+_[k],E[C].push(k))}else for(var F=0;F0;){for(var Y=T.pop(),Q=0;Q0&&l.push(n[u]);l.length!==0&&a.push(i.collection(l))}return a},"assign"),YWe=o(function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:XWe,l=i,u,h,f=0;f=2?Lx(e,r,n,0,w0e,jWe):Lx(e,r,n,0,b0e)},"euclidean"),squaredEuclidean:o(function(e,r,n){return Lx(e,r,n,0,w0e)},"squaredEuclidean"),manhattan:o(function(e,r,n){return Lx(e,r,n,0,b0e)},"manhattan"),max:o(function(e,r,n){return Lx(e,r,n,-1/0,KWe)},"max")};o1["squared-euclidean"]=o1.squaredEuclidean;o1.squaredeuclidean=o1.squaredEuclidean;o(z6,"clusteringDistance");QWe=Sa({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),iB=o(function(e){return QWe(e)},"setOptions"),_6=o(function(e,r,n,i,a){var s=a!=="kMedoids",l=s?function(d){return n[d]}:function(d){return i[d](n)},u=o(function(p){return i[p](r)},"getQ"),h=n,f=r;return z6(e,i.length,l,u,h,f)},"getDist"),kP=o(function(e,r,n){for(var i=n.length,a=new Array(i),s=new Array(i),l=new Array(r),u=null,h=0;hn)return!1}return!0},"haveMatricesConverged"),eqe=o(function(e,r,n){for(var i=0;il&&(l=r[h][f],u=f);a[u].push(e[h])}for(var d=0;d=a.threshold||a.mode==="dendrogram"&&e.length===1)return!1;var g=r[s],y=r[i[s]],v;a.mode==="dendrogram"?v={left:g,right:y,key:g.key}:v={value:g.value.concat(y.value),key:g.key},e[g.index]=v,e.splice(y.index,1),r[g.key]=v;for(var x=0;xn[y.key][b.key]&&(u=n[y.key][b.key])):a.linkage==="max"?(u=n[g.key][b.key],n[g.key][b.key]0&&i.push(a);return i},"findExemplars"),A0e=o(function(e,r,n){for(var i=[],a=0;al&&(s=h,l=r[a*e+h])}s>0&&i.push(s)}for(var f=0;fh&&(u=f,h=d)}n[a]=s[u]}return i=A0e(e,r,n),i},"assign"),_0e=o(function(e){for(var r=this.cy(),n=this.nodes(),i=pqe(e),a={},s=0;s=N?(k=N,N=C,I=O):C>k&&(k=C);for(var D=0;D0?1:0;_[L%i.minIterations*l+Y]=Q,z+=Q}if(z>0&&(L>=i.minIterations-1||L==i.maxIterations-1)){for(var X=0,ie=0;ie1||E>1)&&(l=!0),d[w]=[],b.outgoers().forEach(function(A){A.isEdge()&&d[w].push(A.id())})}else p[w]=[void 0,b.target().id()]}):s.forEach(function(b){var w=b.id();if(b.isNode()){var S=b.degree(!0);S%2&&(u?h?l=!0:h=w:u=w),d[w]=[],b.connectedEdges().forEach(function(T){return d[w].push(T.id())})}else p[w]=[b.source().id(),b.target().id()]});var m={found:!1,trail:void 0};if(l)return m;if(h&&u)if(a){if(f&&h!=f)return m;f=h}else{if(f&&h!=f&&u!=f)return m;f||(f=h)}else f||(f=s[0].id());var g=o(function(w){for(var S=w,T=[w],E,_,A;d[S].length;)E=d[S].shift(),_=p[E][0],A=p[E][1],S!=A?(d[A]=d[A].filter(function(L){return L!=E}),S=A):!a&&S!=_&&(d[_]=d[_].filter(function(L){return L!=E}),S=_),T.unshift(E),T.unshift(S);return T},"walk"),y=[],v=[];for(v=g(f);v.length!=1;)d[v[0]].length==0?(y.unshift(s.getElementById(v.shift())),y.unshift(s.getElementById(v.shift()))):v=g(v.shift()).concat(v);y.unshift(s.getElementById(v.shift()));for(var x in d)if(d[x].length)return m;return m.found=!0,m.trail=this.spawn(y,!0),m},"hierholzer")},s6=o(function(){var e=this,r={},n=0,i=0,a=[],s=[],l={},u=o(function(p,m){for(var g=s.length-1,y=[],v=e.spawn();s[g].x!=p||s[g].y!=m;)y.push(s.pop().edge),g--;y.push(s.pop().edge),y.forEach(function(x){var b=x.connectedNodes().intersection(e);v.merge(x),b.forEach(function(w){var S=w.id(),T=w.connectedEdges().intersection(e);v.merge(w),r[S].cutVertex?v.merge(T.filter(function(E){return E.isLoop()})):v.merge(T)})}),a.push(v)},"buildComponent"),h=o(function d(p,m,g){p===g&&(i+=1),r[m]={id:n,low:n++,cutVertex:!1};var y=e.getElementById(m).connectedEdges().intersection(e);if(y.size()===0)a.push(e.spawn(e.getElementById(m)));else{var v,x,b,w;y.forEach(function(S){v=S.source().id(),x=S.target().id(),b=v===m?x:v,b!==g&&(w=S.id(),l[w]||(l[w]=!0,s.push({x:m,y:b,edge:S})),b in r?r[m].low=Math.min(r[m].low,r[b].id):(d(p,b,m),r[m].low=Math.min(r[m].low,r[b].low),r[m].id<=r[b].low&&(r[m].cutVertex=!0,u(m,b))))})}},"biconnectedSearch");e.forEach(function(d){if(d.isNode()){var p=d.id();p in r||(i=0,h(p,p),r[p].cutVertex=i>1)}});var f=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(f),components:a}},"hopcroftTarjanBiconnected"),Tqe={hopcroftTarjanBiconnected:s6,htbc:s6,htb:s6,hopcroftTarjanBiconnectedComponents:s6},o6=o(function(){var e=this,r={},n=0,i=[],a=[],s=e.spawn(e),l=o(function u(h){a.push(h),r[h]={index:n,low:n++,explored:!1};var f=e.getElementById(h).connectedEdges().intersection(e);if(f.forEach(function(y){var v=y.target().id();v!==h&&(v in r||u(v),r[v].explored||(r[h].low=Math.min(r[h].low,r[v].low)))}),r[h].index===r[h].low){for(var d=e.spawn();;){var p=a.pop();if(d.merge(e.getElementById(p)),r[p].low=r[h].index,r[p].explored=!0,p===h)break}var m=d.edgesWith(d),g=d.merge(m);i.push(g),s=s.difference(g)}},"stronglyConnectedSearch");return e.forEach(function(u){if(u.isNode()){var h=u.id();h in r||l(h)}}),{cut:s,components:i}},"tarjanStronglyConnected"),kqe={tarjanStronglyConnected:o6,tsc:o6,tscc:o6,tarjanStronglyConnectedComponents:o6},Qpe={};[Ux,JYe,eWe,rWe,iWe,sWe,cWe,IWe,r1,n1,IP,qWe,sqe,fqe,xqe,wqe,Tqe,kqe].forEach(function(t){Wt(Qpe,t)});Zpe=0,Jpe=1,eme=2,Zu=o(function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=Zpe,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))},"api");Zu.prototype={fulfill:o(function(e){return L0e(this,Jpe,"fulfillValue",e)},"fulfill"),reject:o(function(e){return L0e(this,eme,"rejectReason",e)},"reject"),then:o(function(e,r){var n=this,i=new Zu;return n.onFulfilled.push(R0e(e,i,"fulfill")),n.onRejected.push(R0e(r,i,"reject")),tme(n),i.proxy},"then")};L0e=o(function(e,r,n,i){return e.state===Zpe&&(e.state=r,e[n]=i,tme(e)),e},"deliver"),tme=o(function(e){e.state===Jpe?D0e(e,"onFulfilled",e.fulfillValue):e.state===eme&&D0e(e,"onRejected",e.rejectReason)},"execute"),D0e=o(function(e,r,n){if(e[r].length!==0){var i=e[r];e[r]=[];var a=o(function(){for(var l=0;l0},"animatedImpl")},"animated"),clearQueue:o(function(){return o(function(){var r=this,n=r.length!==void 0,i=n?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var s=0;s0&&this.spawn(i).updateStyle().emit("class"),r},"classes"),addClass:o(function(e){return this.toggleClass(e,!0)},"addClass"),hasClass:o(function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},"hasClass"),toggleClass:o(function(e,r){vn(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,a=[],s=0,l=n.length;s0&&this.spawn(a).updateStyle().emit("class"),n},"toggleClass"),removeClass:o(function(e){return this.toggleClass(e,!1)},"removeClass"),flashClass:o(function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n},"flashClass")};g6.className=g6.classNames=g6.classes;Nr={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Ui,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Nr.variable="(?:[\\w-.]|(?:\\\\"+Nr.metaChar+"))+";Nr.className="(?:[\\w-]|(?:\\\\"+Nr.metaChar+"))+";Nr.value=Nr.string+"|"+Nr.number;Nr.id=Nr.variable;(function(){var t,e,r;for(t=Nr.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(Nr.comparatorOp+="|\\!"+e)})();un=o(function(){return{checks:[]}},"newQuery"),Ct={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},PP=[{selector:":selected",matches:o(function(e){return e.selected()},"matches")},{selector:":unselected",matches:o(function(e){return!e.selected()},"matches")},{selector:":selectable",matches:o(function(e){return e.selectable()},"matches")},{selector:":unselectable",matches:o(function(e){return!e.selectable()},"matches")},{selector:":locked",matches:o(function(e){return e.locked()},"matches")},{selector:":unlocked",matches:o(function(e){return!e.locked()},"matches")},{selector:":visible",matches:o(function(e){return e.visible()},"matches")},{selector:":hidden",matches:o(function(e){return!e.visible()},"matches")},{selector:":transparent",matches:o(function(e){return e.transparent()},"matches")},{selector:":grabbed",matches:o(function(e){return e.grabbed()},"matches")},{selector:":free",matches:o(function(e){return!e.grabbed()},"matches")},{selector:":removed",matches:o(function(e){return e.removed()},"matches")},{selector:":inside",matches:o(function(e){return!e.removed()},"matches")},{selector:":grabbable",matches:o(function(e){return e.grabbable()},"matches")},{selector:":ungrabbable",matches:o(function(e){return!e.grabbable()},"matches")},{selector:":animated",matches:o(function(e){return e.animated()},"matches")},{selector:":unanimated",matches:o(function(e){return!e.animated()},"matches")},{selector:":parent",matches:o(function(e){return e.isParent()},"matches")},{selector:":childless",matches:o(function(e){return e.isChildless()},"matches")},{selector:":child",matches:o(function(e){return e.isChild()},"matches")},{selector:":orphan",matches:o(function(e){return e.isOrphan()},"matches")},{selector:":nonorphan",matches:o(function(e){return e.isChild()},"matches")},{selector:":compound",matches:o(function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()},"matches")},{selector:":loop",matches:o(function(e){return e.isLoop()},"matches")},{selector:":simple",matches:o(function(e){return e.isSimple()},"matches")},{selector:":active",matches:o(function(e){return e.active()},"matches")},{selector:":inactive",matches:o(function(e){return!e.active()},"matches")},{selector:":backgrounding",matches:o(function(e){return e.backgrounding()},"matches")},{selector:":nonbackgrounding",matches:o(function(e){return!e.backgrounding()},"matches")}].sort(function(t,e){return qHe(t.selector,e.selector)}),Pje=function(){for(var t={},e,r=0;r0&&f.edgeCount>0)return tn("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(f.edgeCount>1)return tn("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;f.edgeCount===1&&tn("The selector `"+e+"` 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!0},"parse"),Vje=o(function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=o(function(f){return f??""},"clean"),r=o(function(f){return zt(f)?'"'+f+'"':e(f)},"cleanVal"),n=o(function(f){return" "+f+" "},"space"),i=o(function(f,d){var p=f.type,m=f.value;switch(p){case Ct.GROUP:{var g=e(m);return g.substring(0,g.length-1)}case Ct.DATA_COMPARE:{var y=f.field,v=f.operator;return"["+y+n(e(v))+r(m)+"]"}case Ct.DATA_BOOL:{var x=f.operator,b=f.field;return"["+e(x)+b+"]"}case Ct.DATA_EXIST:{var w=f.field;return"["+w+"]"}case Ct.META_COMPARE:{var S=f.operator,T=f.field;return"[["+T+n(e(S))+r(m)+"]]"}case Ct.STATE:return m;case Ct.ID:return"#"+m;case Ct.CLASS:return"."+m;case Ct.PARENT:case Ct.CHILD:return a(f.parent,d)+n(">")+a(f.child,d);case Ct.ANCESTOR:case Ct.DESCENDANT:return a(f.ancestor,d)+" "+a(f.descendant,d);case Ct.COMPOUND_SPLIT:{var E=a(f.left,d),_=a(f.subject,d),A=a(f.right,d);return E+(E.length>0?" ":"")+_+A}case Ct.TRUE:return""}},"checkToString"),a=o(function(f,d){return f.checks.reduce(function(p,m,g){return p+(d===f&&g===0?"$":"")+i(m,d)},"")},"queryToString"),s="",l=0;l1&&l=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),f=!0),(a||l||f)&&(u=!a&&!s?"":""+e,h=""+n),f&&(e=u=u.toLowerCase(),n=h=h.toLowerCase()),r){case"*=":i=u.indexOf(h)>=0;break;case"$=":i=u.indexOf(h,u.length-h.length)>=0;break;case"^=":i=u.indexOf(h)===0;break;case"=":i=e===n;break;case">":p=!0,i=e>n;break;case">=":p=!0,i=e>=n;break;case"<":p=!0,i=e1&&arguments[1]!==void 0?arguments[1]:!0;return cB(this,t,e,ume)};o(hme,"addParent");l1.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return cB(this,t,e,hme)};o(Kje,"addParentAndChildren");l1.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return cB(this,t,e,Kje)};l1.ancestors=l1.parents;qx=fme={data:en.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:en.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:en.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:en.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:en.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:en.removeData({field:"rscratch",triggerEvent:!1}),id:o(function(){var e=this[0];if(e)return e._private.data.id},"id")};qx.attr=qx.data;qx.removeAttr=qx.removeData;Qje=fme,U6={};o(CP,"defineDegreeFunction");Wt(U6,{degree:CP(function(t,e){return e.source().same(e.target())?2:1}),indegree:CP(function(t,e){return e.target().same(t)?1:0}),outdegree:CP(function(t,e){return e.source().same(t)?1:0})});o(Xg,"defineDegreeBoundsFunction");Wt(U6,{minDegree:Xg("degree",function(t,e){return te}),minIndegree:Xg("indegree",function(t,e){return te}),minOutdegree:Xg("outdegree",function(t,e){return te})});Wt(U6,{totalDegree:o(function(e){for(var r=0,n=this.nodes(),i=0;i0,p=d;d&&(f=f[0]);var m=p?f.position():{x:0,y:0};r!==void 0?h.position(e,r+m[e]):a!==void 0&&h.position({x:a.x+m.x,y:a.y+m.y})}else{var g=n.position(),y=l?n.parent():null,v=y&&y.length>0,x=v;v&&(y=y[0]);var b=x?y.position():{x:0,y:0};return a={x:g.x-b.x,y:g.y-b.y},e===void 0?a:a[e]}else if(!s)return;return this},"relativePosition")};Hl.modelPosition=Hl.point=Hl.position;Hl.modelPositions=Hl.points=Hl.positions;Hl.renderedPoint=Hl.renderedPosition;Hl.relativePoint=Hl.relativePosition;Zje=dme;i1=Rf={};Rf.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),a=e.x1*n+i.x,s=e.x2*n+i.x,l=e.y1*n+i.y,u=e.y2*n+i.y;return{x1:a,x2:s,y1:l,y2:u,w:s-a,h:u-l}};Rf.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)};Rf.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var l=s._private,u=s.children(),h=s.pstyle("compound-sizing-wrt-labels").value==="include",f={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},d=u.boundingBox({includeLabels:h,includeOverlays:!1,useCache:!1}),p=l.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=p.x-d.w/2,d.x2=p.x+d.w/2,d.y1=p.y-d.h/2,d.y2=p.y+d.h/2);function m(L,M,N){var k=0,I=0,C=M+N;return L>0&&C>0&&(k=M/C*L,I=N/C*L),{biasDiff:k,biasComplementDiff:I}}o(m,"computeBiasValues");function g(L,M,N,k){if(N.units==="%")switch(k){case"width":return L>0?N.pfValue*L:0;case"height":return M>0?N.pfValue*M:0;case"average":return L>0&&M>0?N.pfValue*(L+M)/2:0;case"min":return L>0&&M>0?L>M?N.pfValue*M:N.pfValue*L:0;case"max":return L>0&&M>0?L>M?N.pfValue*L:N.pfValue*M:0;default:return 0}else return N.units==="px"?N.pfValue:0}o(g,"computePaddingValues");var y=f.width.left.value;f.width.left.units==="px"&&f.width.val>0&&(y=y*100/f.width.val);var v=f.width.right.value;f.width.right.units==="px"&&f.width.val>0&&(v=v*100/f.width.val);var x=f.height.top.value;f.height.top.units==="px"&&f.height.val>0&&(x=x*100/f.height.val);var b=f.height.bottom.value;f.height.bottom.units==="px"&&f.height.val>0&&(b=b*100/f.height.val);var w=m(f.width.val-d.w,y,v),S=w.biasDiff,T=w.biasComplementDiff,E=m(f.height.val-d.h,x,b),_=E.biasDiff,A=E.biasComplementDiff;l.autoPadding=g(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),l.autoWidth=Math.max(d.w,f.width.val),p.x=(-S+d.x1+d.x2+T)/2,l.autoHeight=Math.max(d.h,f.height.val),p.y=(-_+d.y1+d.y2+A)/2}o(r,"update");for(var n=0;ne.x2?i:e.x2,e.y1=ne.y2?a:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},"updateBounds"),F0=o(function(e,r){return r==null?e:Vl(e,r.x1,r.y1,r.x2,r.y2)},"updateBoundsFromBox"),Dx=o(function(e,r,n){return Ul(e,r,n)},"prefixedProperty"),l6=o(function(e,r,n){if(!r.cy().headless()){var i=r._private,a=i.rstyle,s=a.arrowWidth/2,l=r.pstyle(n+"-arrow-shape").value,u,h;if(l!=="none"){n==="source"?(u=a.srcX,h=a.srcY):n==="target"?(u=a.tgtX,h=a.tgtY):(u=a.midX,h=a.midY);var f=i.arrowBounds=i.arrowBounds||{},d=f[n]=f[n]||{};d.x1=u-s,d.y1=h-s,d.x2=u+s,d.y2=h+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,p6(d,1),Vl(e,d.x1,d.y1,d.x2,d.y2)}}},"updateBoundsFromArrow"),SP=o(function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var a=r._private,s=a.rstyle,l=r.pstyle(i+"label").strValue;if(l){var u=r.pstyle("text-halign"),h=r.pstyle("text-valign"),f=Dx(s,"labelWidth",n),d=Dx(s,"labelHeight",n),p=Dx(s,"labelX",n),m=Dx(s,"labelY",n),g=r.pstyle(i+"text-margin-x").pfValue,y=r.pstyle(i+"text-margin-y").pfValue,v=r.isEdge(),x=r.pstyle(i+"text-rotation"),b=r.pstyle("text-outline-width").pfValue,w=r.pstyle("text-border-width").pfValue,S=w/2,T=r.pstyle("text-background-padding").pfValue,E=2,_=d,A=f,L=A/2,M=_/2,N,k,I,C;if(v)N=p-L,k=p+L,I=m-M,C=m+M;else{switch(u.value){case"left":N=p-A,k=p;break;case"center":N=p-L,k=p+L;break;case"right":N=p,k=p+A;break}switch(h.value){case"top":I=m-_,C=m;break;case"center":I=m-M,C=m+M;break;case"bottom":I=m,C=m+_;break}}N+=g-Math.max(b,S)-T-E,k+=g+Math.max(b,S)+T+E,I+=y-Math.max(b,S)-T-E,C+=y+Math.max(b,S)+T+E;var O=n||"main",D=a.labelBounds,P=D[O]=D[O]||{};P.x1=N,P.y1=I,P.x2=k,P.y2=C,P.w=k-N,P.h=C-I;var F=v&&x.strValue==="autorotate",B=x.pfValue!=null&&x.pfValue!==0;if(F||B){var $=F?Dx(a.rstyle,"labelAngle",n):x.pfValue,z=Math.cos($),Y=Math.sin($),Q=(N+k)/2,X=(I+C)/2;if(!v){switch(u.value){case"left":Q=k;break;case"right":Q=N;break}switch(h.value){case"top":X=C;break;case"bottom":X=I;break}}var ie=o(function(ce,ue){return ce=ce-Q,ue=ue-X,{x:ce*z-ue*Y+Q,y:ce*Y+ue*z+X}},"rotate"),j=ie(N,I),J=ie(N,C),Z=ie(k,I),H=ie(k,C);N=Math.min(j.x,J.x,Z.x,H.x),k=Math.max(j.x,J.x,Z.x,H.x),I=Math.min(j.y,J.y,Z.y,H.y),C=Math.max(j.y,J.y,Z.y,H.y)}var q=O+"Rot",K=D[q]=D[q]||{};K.x1=N,K.y1=I,K.x2=k,K.y2=C,K.w=k-N,K.h=C-I,Vl(e,N,I,k,C),Vl(a.labelBounds.all,N,I,k,C)}return e}},"updateBoundsFromLabel"),Jje=o(function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,i=r.pstyle("outline-width").value;if(n>0&&i>0){var a=r.pstyle("outline-offset").value,s=r.pstyle("shape").value,l=i+a,u=(e.w+l*2)/e.w,h=(e.h+l*2)/e.h,f=0,d=0;["diamond","pentagon","round-triangle"].includes(s)?(u=(e.w+l*2.4)/e.w,d=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(s)?u=(e.w+l*2.4)/e.w:s==="star"?(u=(e.w+l*2.8)/e.w,h=(e.h+l*2.6)/e.h,d=-l/3.8):s==="triangle"?(u=(e.w+l*2.8)/e.w,h=(e.h+l*2.4)/e.h,d=-l/1.4):s==="vee"&&(u=(e.w+l*4.4)/e.w,h=(e.h+l*3.8)/e.h,d=-l*.5);var p=e.h*h-e.h,m=e.w*u-e.w;if(m6(e,[Math.ceil(p/2),Math.ceil(m/2)]),f!=0||d!==0){var g=bWe(e,f,d);Vpe(e,g)}}}},"updateBoundsFromOutline"),eKe=o(function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=Gs(),l=e._private,u=e.isNode(),h=e.isEdge(),f,d,p,m,g,y,v=l.rstyle,x=u&&i?e.pstyle("bounds-expansion").pfValue:[0],b=o(function(De){return De.pstyle("display").value!=="none"},"isDisplayed"),w=!i||b(e)&&(!h||b(e.source())&&b(e.target()));if(w){var S=0,T=0;i&&r.includeOverlays&&(S=e.pstyle("overlay-opacity").value,S!==0&&(T=e.pstyle("overlay-padding").value));var E=0,_=0;i&&r.includeUnderlays&&(E=e.pstyle("underlay-opacity").value,E!==0&&(_=e.pstyle("underlay-padding").value));var A=Math.max(T,_),L=0,M=0;if(i&&(L=e.pstyle("width").pfValue,M=L/2),u&&r.includeNodes){var N=e.position();g=N.x,y=N.y;var k=e.outerWidth(),I=k/2,C=e.outerHeight(),O=C/2;f=g-I,d=g+I,p=y-O,m=y+O,Vl(s,f,p,d,m),i&&r.includeOutlines&&Jje(s,e)}else if(h&&r.includeEdges)if(i&&!a){var D=e.pstyle("curve-style").strValue;if(f=Math.min(v.srcX,v.midX,v.tgtX),d=Math.max(v.srcX,v.midX,v.tgtX),p=Math.min(v.srcY,v.midY,v.tgtY),m=Math.max(v.srcY,v.midY,v.tgtY),f-=M,d+=M,p-=M,m+=M,Vl(s,f,p,d,m),D==="haystack"){var P=v.haystackPts;if(P&&P.length===2){if(f=P[0].x,p=P[0].y,d=P[1].x,m=P[1].y,f>d){var F=f;f=d,d=F}if(p>m){var B=p;p=m,m=B}Vl(s,f-M,p-M,d+M,m+M)}}else if(D==="bezier"||D==="unbundled-bezier"||D.endsWith("segments")||D.endsWith("taxi")){var $;switch(D){case"bezier":case"unbundled-bezier":$=v.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":$=v.linePts;break}if($!=null)for(var z=0;z<$.length;z++){var Y=$[z];f=Y.x-M,d=Y.x+M,p=Y.y-M,m=Y.y+M,Vl(s,f,p,d,m)}}}else{var Q=e.source(),X=Q.position(),ie=e.target(),j=ie.position();if(f=X.x,d=j.x,p=X.y,m=j.y,f>d){var J=f;f=d,d=J}if(p>m){var Z=p;p=m,m=Z}f-=M,d+=M,p-=M,m+=M,Vl(s,f,p,d,m)}if(i&&r.includeEdges&&h&&(l6(s,e,"mid-source"),l6(s,e,"mid-target"),l6(s,e,"source"),l6(s,e,"target")),i){var H=e.pstyle("ghost").value==="yes";if(H){var q=e.pstyle("ghost-offset-x").pfValue,K=e.pstyle("ghost-offset-y").pfValue;Vl(s,s.x1+q,s.y1+K,s.x2+q,s.y2+K)}}var se=l.bodyBounds=l.bodyBounds||{};g0e(se,s),m6(se,x),p6(se,1),i&&(f=s.x1,d=s.x2,p=s.y1,m=s.y2,Vl(s,f-A,p-A,d+A,m+A));var ce=l.overlayBounds=l.overlayBounds||{};g0e(ce,s),m6(ce,x),p6(ce,1);var ue=l.labelBounds=l.labelBounds||{};ue.all!=null?xWe(ue.all):ue.all=Gs(),i&&r.includeLabels&&(r.includeMainLabels&&SP(s,e,null),h&&(r.includeSourceLabels&&SP(s,e,"source"),r.includeTargetLabels&&SP(s,e,"target")))}return s.x1=el(s.x1),s.y1=el(s.y1),s.x2=el(s.x2),s.y2=el(s.y2),s.w=el(s.x2-s.x1),s.h=el(s.y2-s.y1),s.w>0&&s.h>0&&w&&(m6(s,x),p6(s,1)),s},"boundingBoxImpl"),mme=o(function(e){var r=0,n=o(function(s){return(s?1:0)<=0;l--)s(l);return this};Df.removeAllListeners=function(){return this.removeListener("*")};Df.emit=Df.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,vn(e)||(e=[e]),gKe(this,function(a,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],i=n.length);for(var l=o(function(f){var d=n[f];if(d.type===s.type&&(!d.namespace||d.namespace===s.namespace||d.namespace===pKe)&&a.eventMatches(a.context,d,s)){var p=[s];e!=null&&qYe(p,e),a.beforeEmit(a.context,d,s),d.conf&&d.conf.one&&(a.listeners=a.listeners.filter(function(y){return y!==d}));var m=a.callbackContext(a.context,d,s),g=d.callback.apply(m,p);a.afterEmit(a.context,d,s),g===!1&&(s.stopPropagation(),s.preventDefault())}},"_loop2"),u=0;u1&&!s){var l=this.length-1,u=this[l],h=u._private.data.id;this[l]=void 0,this[e]=u,a.set(h,{ele:u,index:e})}return this.length--,this},"unmergeAt"),unmergeOne:o(function(e){e=e[0];var r=this._private,n=e._private.data.id,i=r.map,a=i.get(n);if(!a)return this;var s=a.index;return this.unmergeAt(s),this},"unmergeOne"),unmerge:o(function(e){var r=this._private.cy;if(!e)return this;if(e&&zt(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=0;i=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},"unmergeBy"),map:o(function(e,r){for(var n=[],i=this,a=0;an&&(n=u,i=l)}return{value:n,ele:i}},"max"),min:o(function(e,r){for(var n=1/0,i,a=this,s=0;s=0&&a"u"?"undefined":Hi(Symbol))!=e&&Hi(Symbol.iterator)!=e;r&&(L6[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return bpe({next:o(function(){return a1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],i=n.cy();if(i.styleEnabled()&&n){this.cleanStyle();var a=n._private.style[e];return a??(r?i.style().getDefaultProperty(e):null)}},"parsedStyle"),numericStyle:o(function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},"numericStyle"),numericStyleUnits:o(function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},"numericStyleUnits"),renderedStyle:o(function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},"renderedStyle"),style:o(function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,a=n.style();if(Mr(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(zt(e))if(r===void 0){var l=this[0];return l?a.getStylePropertyValue(l,e):void 0}else a.applyBypass(this,e,r,i),this.emitAndNotify("style");else if(e===void 0){var u=this[0];return u?a.getRawStyle(u):void 0}return this},"style"),removeStyle:o(function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,i=r.style(),a=this;if(e===void 0)for(var s=0;s0&&e.push(f[0]),e.push(l[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:o(function(e){return this.neighborhood().add(this).filter(e)},"closedNeighborhood"),openNeighborhood:o(function(e){return this.neighborhood(e)},"openNeighborhood")});Fa.neighbourhood=Fa.neighborhood;Fa.closedNeighbourhood=Fa.closedNeighborhood;Fa.openNeighbourhood=Fa.openNeighborhood;Wt(Fa,{source:tl(o(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"sourceImpl"),"source"),target:tl(o(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"targetImpl"),"target"),sources:X0e({attr:"source"}),targets:X0e({attr:"target"})});o(X0e,"defineSourceFunction");Wt(Fa,{edgesWith:tl(j0e(),"edgesWith"),edgesTo:tl(j0e({thisIsSrc:!0}),"edgesTo")});o(j0e,"defineEdgesWithFunction");Wt(Fa,{connectedEdges:tl(function(t){for(var e=[],r=this,n=0;n0);return s},"components"),component:o(function(){var e=this[0];return e.cy().mutableElements().components(e)[0]},"component")});Fa.componentsOf=Fa.components;Ca=o(function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){oi("A collection must have a reference to the core");return}var a=new Vc,s=!1;if(!r)r=[];else if(r.length>0&&Mr(r[0])&&!Zx(r[0])){s=!0;for(var l=[],u=new c1,h=0,f=r.length;h0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),i=n._private,a=[],s=[],l,u=0,h=r.length;u0){for(var B=l.length===r.length?r:new Ca(n,l),$=0;$0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],i={},a=r._private.cy;function s(C){for(var O=C._private.edges,D=0;D0&&(t?N.emitAndNotify("remove"):e&&N.emit("remove"));for(var k=0;kf&&Math.abs(g.v)>f;);return p?function(y){return u[y*(u.length-1)|0]}:h},"springRK4Factory")}(),Ln=o(function(e,r,n,i){var a=SKe(e,r,n,i);return function(s,l,u){return s+(l-s)*a(u)}},"cubicBezier"),v6={linear:o(function(e,r,n){return e+(r-e)*n},"linear"),ease:Ln(.25,.1,.25,1),"ease-in":Ln(.42,0,1,1),"ease-out":Ln(0,0,.58,1),"ease-in-out":Ln(.42,0,.58,1),"ease-in-sine":Ln(.47,0,.745,.715),"ease-out-sine":Ln(.39,.575,.565,1),"ease-in-out-sine":Ln(.445,.05,.55,.95),"ease-in-quad":Ln(.55,.085,.68,.53),"ease-out-quad":Ln(.25,.46,.45,.94),"ease-in-out-quad":Ln(.455,.03,.515,.955),"ease-in-cubic":Ln(.55,.055,.675,.19),"ease-out-cubic":Ln(.215,.61,.355,1),"ease-in-out-cubic":Ln(.645,.045,.355,1),"ease-in-quart":Ln(.895,.03,.685,.22),"ease-out-quart":Ln(.165,.84,.44,1),"ease-in-out-quart":Ln(.77,0,.175,1),"ease-in-quint":Ln(.755,.05,.855,.06),"ease-out-quint":Ln(.23,1,.32,1),"ease-in-out-quint":Ln(.86,0,.07,1),"ease-in-expo":Ln(.95,.05,.795,.035),"ease-out-expo":Ln(.19,1,.22,1),"ease-in-out-expo":Ln(1,0,0,1),"ease-in-circ":Ln(.6,.04,.98,.335),"ease-out-circ":Ln(.075,.82,.165,1),"ease-in-out-circ":Ln(.785,.135,.15,.86),spring:o(function(e,r,n){if(n===0)return v6.linear;var i=AKe(e,r,n);return function(a,s,l){return a+(s-a)*i(l)}},"spring"),"cubic-bezier":Ln};o(Q0e,"getEasedValue");o(Z0e,"getValue");o(jg,"ease");o(_Ke,"step$1");o(Nx,"valid");o(LKe,"startAnimation");o(J0e,"stepAll");DKe={animate:en.animate(),animation:en.animation(),animated:en.animated(),clearQueue:en.clearQueue(),delay:en.delay(),delayAnimation:en.delayAnimation(),stop:en.stop(),addToAnimationPool:o(function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},"addToAnimationPool"),stopAnimationLoop:o(function(){this._private.animationsRunning=!1},"stopAnimationLoop"),startAnimationLoop:o(function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&E6(o(function(a){J0e(a,e),r()},"animationStep"))}o(r,"headlessStep");var n=e.renderer();n&&n.beforeRender?n.beforeRender(o(function(a,s){J0e(s,e)},"rendererAnimationStep"),n.beforeRenderPriorities.animations):r()},"startAnimationLoop")},RKe={qualifierCompare:o(function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},"qualifierCompare"),eventMatches:o(function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&Zx(n.target)&&i.matches(n.target):!0},"eventMatches"),addEventFields:o(function(e,r){r.cy=e,r.target=e},"addEventFields"),callbackContext:o(function(e,r,n){return r.qualifier!=null?n.target:e},"callbackContext")},h6=o(function(e){return zt(e)?new _f(e):e},"argSelector"),Sme={createEmitter:o(function(){var e=this._private;return e.emitter||(e.emitter=new H6(RKe,this)),this},"createEmitter"),emitter:o(function(){return this._private.emitter},"emitter"),on:o(function(e,r,n){return this.emitter().on(e,h6(r),n),this},"on"),removeListener:o(function(e,r,n){return this.emitter().removeListener(e,h6(r),n),this},"removeListener"),removeAllListeners:o(function(){return this.emitter().removeAllListeners(),this},"removeAllListeners"),one:o(function(e,r,n){return this.emitter().one(e,h6(r),n),this},"one"),once:o(function(e,r,n){return this.emitter().one(e,h6(r),n),this},"once"),emit:o(function(e,r){return this.emitter().emit(e,r),this},"emit"),emitAndNotify:o(function(e,r){return this.emit(e),this.notify(e,r),this},"emitAndNotify")};en.eventAliasesOn(Sme);FP={png:o(function(e){var r=this._private.renderer;return e=e||{},r.png(e)},"png"),jpg:o(function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)},"jpg")};FP.jpeg=FP.jpg;x6={layout:o(function(e){var r=this;if(e==null){oi("Layout options must be specified to make a layout");return}if(e.name==null){oi("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){oi("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;zt(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var s=new i(Wt({},e,{cy:r,eles:a}));return s},"layout")};x6.createLayout=x6.makeLayout=x6.layout;NKe={notify:o(function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&i.merge(r);return}if(n.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(e,r)}},"notify"),notifications:o(function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},"notifications"),noNotifications:o(function(e){this.notifications(!1),e(),this.notifications(!0)},"noNotifications"),batching:o(function(){return this._private.batchCount>0},"batching"),startBatch:o(function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},"startBatch"),endBatch:o(function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var i=e.batchNotifications[n];i.empty()?r.notify(n):r.notify(n,i)})}return this},"endBatch"),batch:o(function(e){return this.startBatch(),e(),this.endBatch(),this},"batch"),batchData:o(function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},"destroyRenderer"),onRender:o(function(e){return this.on("render",e)},"onRender"),offRender:o(function(e){return this.off("render",e)},"offRender")};zP.invalidateDimensions=zP.resize;b6={collection:o(function(e,r){return zt(e)?this.$(e):xo(e)?e.collection():vn(e)?(r||(r={}),new Ca(this,e,r.unique,r.removed)):new Ca(this)},"collection"),nodes:o(function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},"nodes"),edges:o(function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},"edges"),$:o(function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},"$"),mutableElements:o(function(){return this._private.elements},"mutableElements")};b6.elements=b6.filter=b6.$;Ga={},Fx="t",IKe="f";Ga.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),a=0;a0;if(p||d&&m){var g=void 0;p&&m||p?g=h.properties:m&&(g=h.mappedProperties);for(var y=0;y1&&(S=1),l.color){var E=n.valueMin[0],_=n.valueMax[0],A=n.valueMin[1],L=n.valueMax[1],M=n.valueMin[2],N=n.valueMax[2],k=n.valueMin[3]==null?1:n.valueMin[3],I=n.valueMax[3]==null?1:n.valueMax[3],C=[Math.round(E+(_-E)*S),Math.round(A+(L-A)*S),Math.round(M+(N-M)*S),Math.round(k+(I-k)*S)];a={bypass:n.bypass,name:n.name,value:C,strValue:"rgb("+C[0]+", "+C[1]+", "+C[2]+")"}}else if(l.number){var O=n.valueMin+(n.valueMax-n.valueMin)*S;a=this.parse(n.name,O,n.bypass,p)}else return!1;if(!a)return y(),!1;a.mapping=n,n=a;break}case s.data:{for(var D=n.field.split("."),P=d.data,F=0;F0&&a>0){for(var l={},u=!1,h=0;h0?t.delayAnimation(s).play().promise().then(w):w()}).then(function(){return t.animation({style:l,duration:a,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1)};Ga.checkTrigger=function(t,e,r,n,i,a){var s=this.properties[e],l=i(s);l!=null&&l(r,n)&&a(s)};Ga.checkZOrderTrigger=function(t,e,r,n){var i=this;this.checkTrigger(t,e,r,n,function(a){return a.triggersZOrder},function(){i._private.cy.notify("zorder",t)})};Ga.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache(),i.triggersBoundsOfParallelBeziers&&e==="curve-style"&&(r==="bezier"||n==="bezier")&&t.parallelEdges().forEach(function(a){a.isBundledBezier()&&a.dirtyBoundingBoxCache()}),i.triggersBoundsOfConnectedEdges&&e==="display"&&(r==="none"||n==="none")&&t.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};Ga.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n)};rb={};rb.applyBypass=function(t,e,r,n){var i=this,a=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var l=0;li.length?n=n.substr(i.length):n=""}o(l,"removeSelAndBlockFromRemaining");function u(){a.length>s.length?a=a.substr(s.length):a=""}for(o(u,"removePropAndValFromRem");;){var h=n.match(/^\s*$/);if(h)break;var f=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!f){tn("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=f[0];var d=f[1];if(d!=="core"){var p=new _f(d);if(p.invalid){tn("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),l();continue}}var m=f[2],g=!1;a=m;for(var y=[];;){var v=a.match(/^\s*$/);if(v)break;var x=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!x){tn("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+m),g=!0;break}s=x[0];var b=x[1],w=x[2],S=e.properties[b];if(!S){tn("Skipping property: Invalid property name in: "+s),u();continue}var T=r.parse(b,w);if(!T){tn("Skipping property: Invalid property definition in: "+s),u();continue}y.push({name:b,val:w}),u()}if(g){l();break}r.selector(d);for(var E=0;E=7&&e[0]==="d"&&(f=new RegExp(l.data.regex).exec(e))){if(r)return!1;var p=l.data;return{name:t,value:f,strValue:""+e,mapped:p,field:f[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(l.mapData.regex).exec(e))){if(r||h.multiple)return!1;var m=l.mapData;if(!(h.color||h.number))return!1;var g=this.parse(t,d[4]);if(!g||g.mapped)return!1;var y=this.parse(t,d[5]);if(!y||y.mapped)return!1;if(g.pfValue===y.pfValue||g.strValue===y.strValue)return tn("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+g.strValue+"`"),this.parse(t,g.strValue);if(h.color){var v=g.value,x=y.value,b=v[0]===x[0]&&v[1]===x[1]&&v[2]===x[2]&&(v[3]===x[3]||(v[3]==null||v[3]===1)&&(x[3]==null||x[3]===1));if(b)return!1}return{name:t,value:d,strValue:""+e,mapped:m,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:g.value,valueMax:y.value,bypass:r}}}if(h.multiple&&n!=="multiple"){var w;if(u?w=e.split(/\s+/):vn(e)?w=e:w=[e],h.evenMultiple&&w.length%2!==0)return null;for(var S=[],T=[],E=[],_="",A=!1,L=0;L0?" ":"")+M.strValue}return h.validate&&!h.validate(S,T)?null:h.singleEnum&&A?S.length===1&&zt(S[0])?{name:t,value:S[0],strValue:S[0],bypass:r}:null:{name:t,value:S,pfValue:E,strValue:_,bypass:r,units:T}}var N=o(function(){for(var H=0;Hh.max||h.strictMax&&e===h.max))return null;var D={name:t,value:e,strValue:""+e+(k||""),units:k,bypass:r};return h.unitless||k!=="px"&&k!=="em"?D.pfValue=e:D.pfValue=k==="px"||!k?e:this.getEmSizeInPixels()*e,(k==="ms"||k==="s")&&(D.pfValue=k==="ms"?e:1e3*e),(k==="deg"||k==="rad")&&(D.pfValue=k==="rad"?e:mWe(e)),k==="%"&&(D.pfValue=e/100),D}else if(h.propList){var P=[],F=""+e;if(F!=="none"){for(var B=F.split(/\s*,\s*|\s+/),$=0;$0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){u=Math.min((s-2*r)/n.w,(l-2*r)/n.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u=n.minZoom&&(n.maxZoom=r),this},"zoomRange"),minZoom:o(function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},"minZoom"),maxZoom:o(function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},"maxZoom"),getZoomedViewport:o(function(e){var r=this._private,n=r.pan,i=r.zoom,a,s,l=!1;if(r.zoomingEnabled||(l=!0),ft(e)?s=e:Mr(e)&&(s=e.level,e.position!=null?a=F6(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!r.panningEnabled&&(l=!0)),s=s>r.maxZoom?r.maxZoom:s,s=sr.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=u,a.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var h=e.pan;ft(h.x)&&(r.pan.x=h.x,l=!1),ft(h.y)&&(r.pan.y=h.y,l=!1),l||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},"viewport"),center:o(function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},"center"),getCenterPan:o(function(e,r){if(this._private.panningEnabled){if(zt(e)){var n=e;e=this.mutableElements().filter(n)}else xo(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),a=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var l={x:(a-r*(i.x1+i.x2))/2,y:(s-r*(i.y1+i.y2))/2};return l}}},"getCenterPan"),reset:o(function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},"reset"),invalidateSize:o(function(){this._private.sizeCache=null},"invalidateSize"),size:o(function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?function(){var i=n.window().getComputedStyle(r),a=o(function(l){return parseFloat(i.getPropertyValue(l))},"val");return{width:r.clientWidth-a("padding-left")-a("padding-right"),height:r.clientHeight-a("padding-top")-a("padding-bottom")}}():{width:1,height:1})},"size"),width:o(function(){return this.size().width},"width"),height:o(function(){return this.size().height},"height"),extent:o(function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},"extent"),renderedExtent:o(function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},"renderedExtent"),multiClickDebounceTime:o(function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this},"multiClickDebounceTime")};q0.centre=q0.center;q0.autolockNodes=q0.autolock;q0.autoungrabifyNodes=q0.autoungrabify;jx={data:en.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:en.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:en.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:en.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};jx.attr=jx.data;jx.removeAttr=jx.removeData;Kx=o(function(e){var r=this;e=Wt({},e);var n=e.container;n&&!k6(n)&&k6(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var a=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=r;var s=Vi!==void 0&&n!==void 0&&!e.headless,l=e;l.layout=Wt({name:s?"grid":"null"},l.layout),l.renderer=Wt({name:s?"canvas":"null"},l.renderer);var u=o(function(g,y,v){return y!==void 0?y:v!==void 0?v:g},"defVal"),h=this._private={container:n,ready:!1,options:l,elements:new Ca(this),listeners:[],aniEles:new Ca(this),data:l.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,l.zoomingEnabled),userZoomingEnabled:u(!0,l.userZoomingEnabled),panningEnabled:u(!0,l.panningEnabled),userPanningEnabled:u(!0,l.userPanningEnabled),boxSelectionEnabled:u(!0,l.boxSelectionEnabled),autolock:u(!1,l.autolock,l.autolockNodes),autoungrabify:u(!1,l.autoungrabify,l.autoungrabifyNodes),autounselectify:u(!1,l.autounselectify),styleEnabled:l.styleEnabled===void 0?s:l.styleEnabled,zoom:ft(l.zoom)?l.zoom:1,pan:{x:Mr(l.pan)&&ft(l.pan.x)?l.pan.x:0,y:Mr(l.pan)&&ft(l.pan.y)?l.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,l.multiClickDebounceTime)};this.createEmitter(),this.selectionType(l.selectionType),this.zoomRange({min:l.minZoom,max:l.maxZoom});var f=o(function(g,y){var v=g.some(zHe);if(v)return u1.all(g).then(y);y(g)},"loadExtData");h.styleEnabled&&r.setStyle([]);var d=Wt({},l,l.renderer);r.initRenderer(d);var p=o(function(g,y,v){r.notifications(!1);var x=r.mutableElements();x.length>0&&x.remove(),g!=null&&(Mr(g)||vn(g))&&r.add(g),r.one("layoutready",function(w){r.notifications(!0),r.emit(w),r.one("load",y),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",v),r.emit("done")});var b=Wt({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()},"setElesAndLayout");f([l.style,l.elements],function(m){var g=m[0],y=m[1];h.styleEnabled&&r.style().append(g),p(y,function(){r.startAnimationLoop(),h.ready=!0,jn(l.ready)&&r.on("ready",l.ready);for(var v=0;v0,u=Gs(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),h;if(xo(e.roots))h=e.roots;else if(vn(e.roots)){for(var f=[],d=0;d0;){var O=C(),D=M(O,k);if(D)O.outgoers().filter(function(ue){return ue.isNode()&&n.has(ue)}).forEach(I);else if(D===null){tn("Detected double maximal shift for node `"+O.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}L();var P=0;if(e.avoidOverlap)for(var F=0;F0&&x[0].length<=3?Pe/2:0),W=2*Math.PI/x[oe].length*ke;return oe===0&&x[0].length===1&&(me=1),{x:K.x+me*Math.cos(W),y:K.y+me*Math.sin(W)}}else{var _e={x:K.x+(ke+1-(Ie+1)/2)*Se,y:(oe+1)*Ue};return _e}},"getPosition");return n.nodes().layoutPositions(this,e,ce),this};zKe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o(function(e,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:o(function(e,r){return r},"transform")};o(_me,"CircleLayout");_me.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var s=Gs(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},u=e.sweep===void 0?2*Math.PI-2*Math.PI/a.length:e.sweep,h=u/Math.max(1,a.length-1),f,d=0,p=0;p1&&e.avoidOverlap){d*=1.75;var x=Math.cos(h)-Math.cos(0),b=Math.sin(h)-Math.sin(0),w=Math.sqrt(d*d/(x*x+b*b));f=Math.max(w,f)}var S=o(function(E,_){var A=e.startAngle+_*h*(i?1:-1),L=f*Math.cos(A),M=f*Math.sin(A),N={x:l.x+L,y:l.y+M};return N},"getPos");return n.nodes().layoutPositions(this,e,S),this};GKe={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:o(function(e){return e.degree()},"concentric"),levelWidth:o(function(e){return e.maxDegree()/4},"levelWidth"),animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o(function(e,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:o(function(e,r){return r},"transform")};o(Lme,"ConcentricLayout");Lme.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,i=e.eles,a=i.nodes().not(":parent"),s=Gs(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},u=[],h=0,f=0;f0){var T=Math.abs(b[0].value-S.value);T>=v&&(b=[],x.push(b))}b.push(S)}var E=h+e.minNodeSpacing;if(!e.avoidOverlap){var _=x.length>0&&x[0].length>1,A=Math.min(s.w,s.h)/2-E,L=A/(x.length+_?1:0);E=Math.min(E,L)}for(var M=0,N=0;N1&&e.avoidOverlap){var O=Math.cos(C)-Math.cos(0),D=Math.sin(C)-Math.sin(0),P=Math.sqrt(E*E/(O*O+D*D));M=Math.max(P,M)}k.r=M,M+=E}if(e.equidistant){for(var F=0,B=0,$=0;$=t.numIter||(XKe(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&a(),E6(d)}},"frame");f()}else{for(;h;)h=s(u),u++;rpe(n,t),l()}return this};j6.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};j6.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};VKe=o(function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=Gs(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),l={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},u=n.eles.components(),h={},f=0;f0){l.graphSet.push(A);for(var f=0;fi.count?0:i.graph},"findLCA"),HKe=o(function t(e,r,n,i){var a=i.graphSet[n];if(-10)var d=i.nodeOverlap*f,p=Math.sqrt(l*l+u*u),m=d*l/p,g=d*u/p;else var y=R6(e,l,u),v=R6(r,-1*l,-1*u),x=v.x-y.x,b=v.y-y.y,w=x*x+b*b,p=Math.sqrt(w),d=(e.nodeRepulsion+r.nodeRepulsion)/w,m=d*x/p,g=d*b/p;e.isLocked||(e.offsetX-=m,e.offsetY-=g),r.isLocked||(r.offsetX+=m,r.offsetY+=g)}},"nodeRepulsion"),QKe=o(function(e,r,n,i){if(n>0)var a=e.maxX-r.minX;else var a=r.maxX-e.minX;if(i>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return a>=0&&s>=0?Math.sqrt(a*a+s*s):0},"nodesOverlap"),R6=o(function(e,r,n){var i=e.positionX,a=e.positionY,s=e.height||1,l=e.width||1,u=n/r,h=s/l,f={};return r===0&&0n?(f.x=i,f.y=a+s/2,f):0r&&-1*h<=u&&u<=h?(f.x=i-l/2,f.y=a-l*n/2/r,f):0=h)?(f.x=i+s*r/2/n,f.y=a+s/2,f):(0>n&&(u<=-1*h||u>=h)&&(f.x=i-s*r/2/n,f.y=a-s/2),f)},"findClippingPoint"),ZKe=o(function(e,r){for(var n=0;nn){var v=r.gravity*m/y,x=r.gravity*g/y;p.offsetX+=v,p.offsetY+=x}}}}},"calculateGravityForces"),eQe=o(function(e,r){var n=[],i=0,a=-1;for(n.push.apply(n,e.graphSet[0]),a+=e.graphSet[0].length;i<=a;){var s=n[i++],l=e.idToIndex[s],u=e.layoutNodes[l],h=u.children;if(0n)var a={x:n*e/i,y:n*r/i};else var a={x:e,y:r};return a},"limitForce"),nQe=o(function t(e,r){var n=e.parentId;if(n!=null){var i=r.layoutNodes[r.idToIndex[n]],a=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,a=!0),(i.minX==null||e.minX-i.padLefti.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(i.minY==null||e.minY-i.padTopx&&(g+=v+r.componentSpacing,m=0,y=0,v=0)}}},"separateComponents"),iQe={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:o(function(e){},"position"),sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o(function(e,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:o(function(e,r){return r},"transform")};o(Rme,"GridLayout");Rme.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=Gs(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(a.h===0||a.w===0)n.nodes().layoutPositions(this,e,function(Q){return{x:a.x1,y:a.y1}});else{var s=i.size(),l=Math.sqrt(s*a.h/a.w),u=Math.round(l),h=Math.round(a.w/a.h*l),f=o(function(X){if(X==null)return Math.min(u,h);var ie=Math.min(u,h);ie==u?u=X:h=X},"small"),d=o(function(X){if(X==null)return Math.max(u,h);var ie=Math.max(u,h);ie==u?u=X:h=X},"large"),p=e.rows,m=e.cols!=null?e.cols:e.columns;if(p!=null&&m!=null)u=p,h=m;else if(p!=null&&m==null)u=p,h=Math.ceil(s/u);else if(p==null&&m!=null)h=m,u=Math.ceil(s/h);else if(h*u>s){var g=f(),y=d();(g-1)*y>=s?f(g-1):(y-1)*g>=s&&d(y-1)}else for(;h*u=s?d(x+1):f(v+1)}var b=a.w/h,w=a.h/u;if(e.condense&&(b=0,w=0),e.avoidOverlap)for(var S=0;S=h&&(O=0,C++)},"moveToNextCell"),P={},F=0;F(O=_We(t,e,D[P],D[P+1],D[P+2],D[P+3])))return v(_,O),!0}else if(L.edgeType==="bezier"||L.edgeType==="multibezier"||L.edgeType==="self"||L.edgeType==="compound"){for(var D=L.allpts,P=0;P+5(O=AWe(t,e,D[P],D[P+1],D[P+2],D[P+3],D[P+4],D[P+5])))return v(_,O),!0}for(var F=F||A.source,B=B||A.target,$=i.getArrowWidth(M,N),z=[{name:"source",x:L.arrowStartX,y:L.arrowStartY,angle:L.srcArrowAngle},{name:"target",x:L.arrowEndX,y:L.arrowEndY,angle:L.tgtArrowAngle},{name:"mid-source",x:L.midX,y:L.midY,angle:L.midsrcArrowAngle},{name:"mid-target",x:L.midX,y:L.midY,angle:L.midtgtArrowAngle}],P=0;P0&&(x(F),x(B))}o(b,"checkEdge");function w(_,A,L){return Ul(_,A,L)}o(w,"preprop");function S(_,A){var L=_._private,M=p,N;A?N=A+"-":N="",_.boundingBox();var k=L.labelBounds[A||"main"],I=_.pstyle(N+"label").value,C=_.pstyle("text-events").strValue==="yes";if(!(!C||!I)){var O=w(L.rscratch,"labelX",A),D=w(L.rscratch,"labelY",A),P=w(L.rscratch,"labelAngle",A),F=_.pstyle(N+"text-margin-x").pfValue,B=_.pstyle(N+"text-margin-y").pfValue,$=k.x1-M-F,z=k.x2+M-F,Y=k.y1-M-B,Q=k.y2+M-B;if(P){var X=Math.cos(P),ie=Math.sin(P),j=o(function(ce,ue){return ce=ce-O,ue=ue-D,{x:ce*X-ue*ie+O,y:ce*ie+ue*X+D}},"rotate"),J=j($,Y),Z=j($,Q),H=j(z,Y),q=j(z,Q),K=[J.x+F,J.y+B,H.x+F,H.y+B,q.x+F,q.y+B,Z.x+F,Z.y+B];if(zs(t,e,K))return v(_),!0}else if(s1(k,t,e))return v(_),!0}}o(S,"checkLabel");for(var T=s.length-1;T>=0;T--){var E=s[T];E.isNode()?x(E)||S(E):b(E)||S(E)||S(E,"source")||S(E,"target")}return l};j0.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,a=[],s=Math.min(t,r),l=Math.max(t,r),u=Math.min(e,n),h=Math.max(e,n);t=s,r=l,e=u,n=h;for(var f=Gs({x1:t,y1:e,x2:r,y2:n}),d=0;d0?-(Math.PI-e.ang):Math.PI+e.ang},"invertVec"),uQe=o(function(e,r,n,i,a){if(e!==ope?lpe(r,e,Gc):cQe(Jo,Gc),lpe(r,n,Jo),ape=Gc.nx*Jo.ny-Gc.ny*Jo.nx,spe=Gc.nx*Jo.nx-Gc.ny*-Jo.ny,ju=Math.asin(Math.max(-1,Math.min(1,ape))),Math.abs(ju)<1e-6){GP=r.x,$P=r.y,z0=Qg=0;return}G0=1,w6=!1,spe<0?ju<0?ju=Math.PI+ju:(ju=Math.PI-ju,G0=-1,w6=!0):ju>0&&(G0=-1,w6=!0),r.radius!==void 0?Qg=r.radius:Qg=i,O0=ju/2,f6=Math.min(Gc.len/2,Jo.len/2),a?(zc=Math.abs(Math.cos(O0)*Qg/Math.sin(O0)),zc>f6?(zc=f6,z0=Math.abs(zc*Math.sin(O0)/Math.cos(O0))):z0=Qg):(zc=Math.min(f6,Qg),z0=Math.abs(zc*Math.sin(O0)/Math.cos(O0))),VP=r.x+Jo.nx*zc,UP=r.y+Jo.ny*zc,GP=VP-Jo.ny*z0*G0,$P=UP+Jo.nx*z0*G0,Ome=r.x+Gc.nx*zc,Pme=r.y+Gc.ny*zc,ope=r},"calcCornerArc");o(Bme,"drawPreparedRoundCorner");o(mB,"getRoundCorner");$a={};$a.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,s=t.pstyle("source-endpoint"),l=t.pstyle("target-endpoint"),u=s.units!=null&&l.units!=null,h=o(function(T,E,_,A){var L=A-E,M=_-T,N=Math.sqrt(M*M+L*L);return{x:-L/N,y:M/N}},"recalcVectorNormInverse"),f=t.pstyle("edge-distances").value;switch(f){case"node-position":a=r;break;case"intersection":a=n;break;case"endpoints":{if(u){var d=this.manualEndptToPx(t.source()[0],s),p=$l(d,2),m=p[0],g=p[1],y=this.manualEndptToPx(t.target()[0],l),v=$l(y,2),x=v[0],b=v[1],w={x1:m,y1:g,x2:x,y2:b};i=h(m,g,x,b),a=w}else tn("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),a=n;break}}return{midptPts:a,vectorNormInverse:i}};$a.findHaystackPoints=function(t){for(var e=0;e0?Math.max(Te-Ce,0):Math.min(Te+Ce,0)},"subDWH"),I=k(M,A),C=k(N,L),O=!1;b===h?x=Math.abs(I)>Math.abs(C)?i:n:b===u||b===l?(x=n,O=!0):(b===a||b===s)&&(x=i,O=!0);var D=x===n,P=D?C:I,F=D?N:M,B=$pe(F),$=!1;!(O&&(S||E))&&(b===l&&F<0||b===u&&F>0||b===a&&F>0||b===s&&F<0)&&(B*=-1,P=B*Math.abs(P),$=!0);var z;if(S){var Y=T<0?1+T:T;z=Y*P}else{var Q=T<0?P:0;z=Q+T*B}var X=o(function(Te){return Math.abs(Te)<_||Math.abs(Te)>=Math.abs(P)},"getIsTooClose"),ie=X(z),j=X(Math.abs(P)-Math.abs(z)),J=ie||j;if(J&&!$)if(D){var Z=Math.abs(F)<=p/2,H=Math.abs(M)<=m/2;if(Z){var q=(f.x1+f.x2)/2,K=f.y1,se=f.y2;r.segpts=[q,K,q,se]}else if(H){var ce=(f.y1+f.y2)/2,ue=f.x1,te=f.x2;r.segpts=[ue,ce,te,ce]}else r.segpts=[f.x1,f.y2]}else{var De=Math.abs(F)<=d/2,oe=Math.abs(N)<=g/2;if(De){var ke=(f.y1+f.y2)/2,Ie=f.x1,Se=f.x2;r.segpts=[Ie,ke,Se,ke]}else if(oe){var Ue=(f.x1+f.x2)/2,Pe=f.y1,_e=f.y2;r.segpts=[Ue,Pe,Ue,_e]}else r.segpts=[f.x2,f.y1]}else if(D){var me=f.y1+z+(v?p/2*B:0),W=f.x1,fe=f.x2;r.segpts=[W,me,fe,me]}else{var ge=f.x1+z+(v?d/2*B:0),re=f.y1,he=f.y2;r.segpts=[ge,re,ge,he]}if(r.isRound){var ne=t.pstyle("taxi-radius").value,ae=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(ne),r.isArcRadius=new Array(r.segpts.length/2).fill(ae)}};$a.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,a=e.srcW,s=e.srcH,l=e.tgtW,u=e.tgtH,h=e.srcShape,f=e.tgtShape,d=e.srcCornerRadius,p=e.tgtCornerRadius,m=e.srcRs,g=e.tgtRs,y=!ft(r.startX)||!ft(r.startY),v=!ft(r.arrowStartX)||!ft(r.arrowStartY),x=!ft(r.endX)||!ft(r.endY),b=!ft(r.arrowEndX)||!ft(r.arrowEndY),w=3,S=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,T=w*S,E=H0({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),_=EC.poolIndex()){var O=I;I=C,C=O}var D=L.srcPos=I.position(),P=L.tgtPos=C.position(),F=L.srcW=I.outerWidth(),B=L.srcH=I.outerHeight(),$=L.tgtW=C.outerWidth(),z=L.tgtH=C.outerHeight(),Y=L.srcShape=r.nodeShapes[e.getNodeShape(I)],Q=L.tgtShape=r.nodeShapes[e.getNodeShape(C)],X=L.srcCornerRadius=I.pstyle("corner-radius").value==="auto"?"auto":I.pstyle("corner-radius").pfValue,ie=L.tgtCornerRadius=C.pstyle("corner-radius").value==="auto"?"auto":C.pstyle("corner-radius").pfValue,j=L.tgtRs=C._private.rscratch,J=L.srcRs=I._private.rscratch;L.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var Z=0;Z0){var se=a,ce=B0(se,Jg(r)),ue=B0(se,Jg(K)),te=ce;if(ue2){var De=B0(se,{x:K[2],y:K[3]});De0){var he=s,ne=B0(he,Jg(r)),ae=B0(he,Jg(re)),we=ne;if(ae2){var Te=B0(he,{x:re[2],y:re[3]});Te=g||_){v={cp:S,segment:E};break}}if(v)break}var A=v.cp,L=v.segment,M=(g-x)/L.length,N=L.t1-L.t0,k=m?L.t0+N*M:L.t1-N*M;k=Hx(0,k,1),e=t1(A.p0,A.p1,A.p2,k),p=fQe(A.p0,A.p1,A.p2,k);break}case"straight":case"segments":case"haystack":{for(var I=0,C,O,D,P,F=n.allpts.length,B=0;B+3=g));B+=2);var $=g-O,z=$/C;z=Hx(0,z,1),e=yWe(D,P,z),p=Gme(D,P);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,p)}},"calculateEndProjection");h("source"),h("target"),this.applyLabelDimensions(t)}};Hc.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};Hc.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=this.calculateLabelDimensions(t,n),a=t.pstyle("line-height").pfValue,s=t.pstyle("text-wrap").strValue,l=Ul(r.rscratch,"labelWrapCachedLines",e)||[],u=s!=="wrap"?1:Math.max(l.length,1),h=i.height/u,f=h*a,d=i.width,p=i.height+(u-1)*(a-1)*h;Tf(r.rstyle,"labelWidth",e,d),Tf(r.rscratch,"labelWidth",e,d),Tf(r.rstyle,"labelHeight",e,p),Tf(r.rscratch,"labelHeight",e,p),Tf(r.rscratch,"labelLineHeight",e,f)};Hc.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,s=o(function(Q,X){return X?(Tf(r.rscratch,Q,e,X),X):Ul(r.rscratch,Q,e)},"rscratch");if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var l=t.pstyle("text-wrap").value;if(l==="wrap"){var u=s("labelKey");if(u!=null&&s("labelWrapKey")===u)return s("labelWrapCachedText");for(var h="\u200B",f=i.split(` +`),d=t.pstyle("text-max-width").pfValue,p=t.pstyle("text-overflow-wrap").value,m=p==="anywhere",g=[],y=/[\s\u200b]+|$/g,v=0;vd){var T=x.matchAll(y),E="",_=0,A=Tpe(T),L;try{for(A.s();!(L=A.n()).done;){var M=L.value,N=M[0],k=x.substring(_,M.index);_=M.index+N.length;var I=E.length===0?k:E+k+N,C=this.calculateLabelDimensions(t,I),O=C.width;O<=d?E+=k+N:(E&&g.push(E),E=k+N)}}catch(Y){A.e(Y)}finally{A.f()}E.match(/^[\s\u200b]+$/)||g.push(E)}else g.push(x)}s("labelWrapCachedLines",g),i=s("labelWrapCachedText",g.join(` +`)),s("labelWrapKey",u)}else if(l==="ellipsis"){var D=t.pstyle("text-max-width").pfValue,P="",F="\u2026",B=!1;if(this.calculateLabelDimensions(t,i).widthD)break;P+=i[$],$===i.length-1&&(B=!0)}return B||(P+=F),P}return i};Hc.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(r){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};Hc.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),i=n.document,a=U0(e,t._private.labelDimsKey),s=r.labelDimCache||(r.labelDimCache=[]),l=s[a];if(l!=null)return l;var u=0,h=t.pstyle("font-style").strValue,f=t.pstyle("font-size").pfValue,d=t.pstyle("font-family").strValue,p=t.pstyle("font-weight").strValue,m=this.labelCalcCanvas,g=this.labelCalcCanvasContext;if(!m){m=this.labelCalcCanvas=i.createElement("canvas"),g=this.labelCalcCanvasContext=m.getContext("2d");var y=m.style;y.position="absolute",y.left="-9999px",y.top="-9999px",y.zIndex="-1",y.visibility="hidden",y.pointerEvents="none"}g.font="".concat(h," ").concat(p," ").concat(f,"px ").concat(d);for(var v=0,x=0,b=e.split(` +`),w=0;w1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),l)for(var u=0;u=t.desktopTapThreshold2}var Je=i(W);ze&&(t.hoverData.tapholdCancelled=!0);var Ve=o(function(){var St=t.hoverData.dragDelta=t.hoverData.dragDelta||[];St.length===0?(St.push(ye[0]),St.push(ye[1])):(St[0]+=ye[0],St[1]+=ye[1])},"updateDragDelta");ge=!0,n(Ae,["mousemove","vmousemove","tapdrag"],W,{x:ae[0],y:ae[1]});var je=o(function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||re.emit({originalEvent:W,type:"boxstart",position:{x:ae[0],y:ae[1]}}),Ce[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()},"goIntoBoxMode");if(t.hoverData.which===3){if(ze){var kt={originalEvent:W,type:"cxtdrag",position:{x:ae[0],y:ae[1]}};Me?Me.emit(kt):re.emit(kt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||Ae!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:W,type:"cxtdragout",position:{x:ae[0],y:ae[1]}}),t.hoverData.cxtOver=Ae,Ae&&Ae.emit({originalEvent:W,type:"cxtdragover",position:{x:ae[0],y:ae[1]}}))}}else if(t.hoverData.dragging){if(ge=!0,re.panningEnabled()&&re.userPanningEnabled()){var at;if(t.hoverData.justStartedPan){var xt=t.hoverData.mdownPos;at={x:(ae[0]-xt[0])*he,y:(ae[1]-xt[1])*he},t.hoverData.justStartedPan=!1}else at={x:ye[0]*he,y:ye[1]*he};re.panBy(at),re.emit("dragpan"),t.hoverData.dragged=!0}ae=t.projectIntoViewport(W.clientX,W.clientY)}else if(Ce[4]==1&&(Me==null||Me.pannable())){if(ze){if(!t.hoverData.dragging&&re.boxSelectionEnabled()&&(Je||!re.panningEnabled()||!re.userPanningEnabled()))je();else if(!t.hoverData.selecting&&re.panningEnabled()&&re.userPanningEnabled()){var it=a(Me,t.hoverData.downs);it&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Ce[4]=0,t.data.bgActivePosistion=Jg(we),t.redrawHint("select",!0),t.redraw())}Me&&Me.pannable()&&Me.active()&&Me.unactivate()}}else{if(Me&&Me.pannable()&&Me.active()&&Me.unactivate(),(!Me||!Me.grabbed())&&Ae!=Ge&&(Ge&&n(Ge,["mouseout","tapdragout"],W,{x:ae[0],y:ae[1]}),Ae&&n(Ae,["mouseover","tapdragover"],W,{x:ae[0],y:ae[1]}),t.hoverData.last=Ae),Me)if(ze){if(re.boxSelectionEnabled()&&Je)Me&&Me.grabbed()&&(v(He),Me.emit("freeon"),He.emit("free"),t.dragData.didDrag&&(Me.emit("dragfreeon"),He.emit("dragfree"))),je();else if(Me&&Me.grabbed()&&t.nodeIsDraggable(Me)){var dt=!t.dragData.didDrag;dt&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||g(He,{inDragLayer:!0});var lt={x:0,y:0};if(ft(ye[0])&&ft(ye[1])&&(lt.x+=ye[0],lt.y+=ye[1],dt)){var It=t.hoverData.dragDelta;It&&ft(It[0])&&ft(It[1])&&(lt.x+=It[0],lt.y+=It[1])}t.hoverData.draggingEles=!0,He.silentShift(lt).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else Ve();ge=!0}if(Ce[2]=ae[0],Ce[3]=ae[1],ge)return W.stopPropagation&&W.stopPropagation(),W.preventDefault&&W.preventDefault(),!1}},"mousemoveHandler"),!1);var M,N,k;t.registerBinding(e,"mouseup",o(function(W){if(!(t.hoverData.which===1&&W.which!==1&&t.hoverData.capture)){var fe=t.hoverData.capture;if(fe){t.hoverData.capture=!1;var ge=t.cy,re=t.projectIntoViewport(W.clientX,W.clientY),he=t.selection,ne=t.findNearestElement(re[0],re[1],!0,!1),ae=t.dragData.possibleDragElements,we=t.hoverData.down,Te=i(W);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,we&&we.unactivate(),t.hoverData.which===3){var Ce={originalEvent:W,type:"cxttapend",position:{x:re[0],y:re[1]}};if(we?we.emit(Ce):ge.emit(Ce),!t.hoverData.cxtDragged){var Ae={originalEvent:W,type:"cxttap",position:{x:re[0],y:re[1]}};we?we.emit(Ae):ge.emit(Ae)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(n(ne,["mouseup","tapend","vmouseup"],W,{x:re[0],y:re[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(n(we,["click","tap","vclick"],W,{x:re[0],y:re[1]}),N=!1,W.timeStamp-k<=ge.multiClickDebounceTime()?(M&&clearTimeout(M),N=!0,k=null,n(we,["dblclick","dbltap","vdblclick"],W,{x:re[0],y:re[1]})):(M=setTimeout(function(){N||n(we,["oneclick","onetap","voneclick"],W,{x:re[0],y:re[1]})},ge.multiClickDebounceTime()),k=W.timeStamp)),we==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!i(W)&&(ge.$(r).unselect(["tapunselect"]),ae.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=ae=ge.collection()),ne==we&&!t.dragData.didDrag&&!t.hoverData.selecting&&ne!=null&&ne._private.selectable&&(t.hoverData.dragging||(ge.selectionType()==="additive"||Te?ne.selected()?ne.unselect(["tapunselect"]):ne.select(["tapselect"]):Te||(ge.$(r).unmerge(ne).unselect(["tapunselect"]),ne.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Ge=ge.collection(t.getAllInBox(he[0],he[1],he[2],he[3]));t.redrawHint("select",!0),Ge.length>0&&t.redrawHint("eles",!0),ge.emit({type:"boxend",originalEvent:W,position:{x:re[0],y:re[1]}});var Me=o(function(ze){return ze.selectable()&&!ze.selected()},"eleWouldBeSelected");ge.selectionType()==="additive"||Te||ge.$(r).unmerge(Ge).unselect(),Ge.emit("box").stdFilter(Me).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!he[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var ye=we&&we.grabbed();v(ae),ye&&(we.emit("freeon"),ae.emit("free"),t.dragData.didDrag&&(we.emit("dragfreeon"),ae.emit("dragfree")))}}he[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null}}},"mouseupHandler"),!1);var I=o(function(W){if(!t.scrollingPage){var fe=t.cy,ge=fe.zoom(),re=fe.pan(),he=t.projectIntoViewport(W.clientX,W.clientY),ne=[he[0]*ge+re.x,he[1]*ge+re.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||A()){W.preventDefault();return}if(fe.panningEnabled()&&fe.userPanningEnabled()&&fe.zoomingEnabled()&&fe.userZoomingEnabled()){W.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var ae;W.deltaY!=null?ae=W.deltaY/-250:W.wheelDeltaY!=null?ae=W.wheelDeltaY/1e3:ae=W.wheelDelta/1e3,ae=ae*t.wheelSensitivity;var we=W.deltaMode===1;we&&(ae*=33);var Te=fe.zoom()*Math.pow(10,ae);W.type==="gesturechange"&&(Te=t.gestureStartZoom*W.scale),fe.zoom({level:Te,renderedPosition:{x:ne[0],y:ne[1]}}),fe.emit(W.type==="gesturechange"?"pinchzoom":"scrollzoom")}}},"wheelHandler");t.registerBinding(t.container,"wheel",I,!0),t.registerBinding(e,"scroll",o(function(W){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},"scrollHandler"),!0),t.registerBinding(t.container,"gesturestart",o(function(W){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||W.preventDefault()},"gestureStartHandler"),!0),t.registerBinding(t.container,"gesturechange",function(me){t.hasTouchStarted||I(me)},!0),t.registerBinding(t.container,"mouseout",o(function(W){var fe=t.projectIntoViewport(W.clientX,W.clientY);t.cy.emit({originalEvent:W,type:"mouseout",position:{x:fe[0],y:fe[1]}})},"mouseOutHandler"),!1),t.registerBinding(t.container,"mouseover",o(function(W){var fe=t.projectIntoViewport(W.clientX,W.clientY);t.cy.emit({originalEvent:W,type:"mouseover",position:{x:fe[0],y:fe[1]}})},"mouseOverHandler"),!1);var C,O,D,P,F,B,$,z,Y,Q,X,ie,j,J=o(function(W,fe,ge,re){return Math.sqrt((ge-W)*(ge-W)+(re-fe)*(re-fe))},"distance"),Z=o(function(W,fe,ge,re){return(ge-W)*(ge-W)+(re-fe)*(re-fe)},"distanceSq"),H;t.registerBinding(t.container,"touchstart",H=o(function(W){if(t.hasTouchStarted=!0,!!L(W)){b(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var fe=t.cy,ge=t.touchData.now,re=t.touchData.earlier;if(W.touches[0]){var he=t.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);ge[0]=he[0],ge[1]=he[1]}if(W.touches[1]){var he=t.projectIntoViewport(W.touches[1].clientX,W.touches[1].clientY);ge[2]=he[0],ge[3]=he[1]}if(W.touches[2]){var he=t.projectIntoViewport(W.touches[2].clientX,W.touches[2].clientY);ge[4]=he[0],ge[5]=he[1]}if(W.touches[1]){t.touchData.singleTouchMoved=!0,v(t.dragData.touchDragEles);var ne=t.findContainerClientCoords();Y=ne[0],Q=ne[1],X=ne[2],ie=ne[3],C=W.touches[0].clientX-Y,O=W.touches[0].clientY-Q,D=W.touches[1].clientX-Y,P=W.touches[1].clientY-Q,j=0<=C&&C<=X&&0<=D&&D<=X&&0<=O&&O<=ie&&0<=P&&P<=ie;var ae=fe.pan(),we=fe.zoom();F=J(C,O,D,P),B=Z(C,O,D,P),$=[(C+D)/2,(O+P)/2],z=[($[0]-ae.x)/we,($[1]-ae.y)/we];var Te=200,Ce=Te*Te;if(B=1){for(var gt=t.touchData.startPosition=[null,null,null,null,null,null],yt=0;yt=t.touchTapThreshold2}if(fe&&t.touchData.cxt){W.preventDefault();var gt=W.touches[0].clientX-Y,yt=W.touches[0].clientY-Q,tt=W.touches[1].clientX-Y,Ye=W.touches[1].clientY-Q,Je=Z(gt,yt,tt,Ye),Ve=Je/B,je=150,kt=je*je,at=1.5,xt=at*at;if(Ve>=xt||Je>=kt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var it={originalEvent:W,type:"cxttapend",position:{x:he[0],y:he[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(it),t.touchData.start=null):re.emit(it)}}if(fe&&t.touchData.cxt){var it={originalEvent:W,type:"cxtdrag",position:{x:he[0],y:he[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(it):re.emit(it),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var dt=t.findNearestElement(he[0],he[1],!0,!0);(!t.touchData.cxtOver||dt!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:W,type:"cxtdragout",position:{x:he[0],y:he[1]}}),t.touchData.cxtOver=dt,dt&&dt.emit({originalEvent:W,type:"cxtdragover",position:{x:he[0],y:he[1]}}))}else if(fe&&W.touches[2]&&re.boxSelectionEnabled())W.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||re.emit({originalEvent:W,type:"boxstart",position:{x:he[0],y:he[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,ge[4]=1,!ge||ge.length===0||ge[0]===void 0?(ge[0]=(he[0]+he[2]+he[4])/3,ge[1]=(he[1]+he[3]+he[5])/3,ge[2]=(he[0]+he[2]+he[4])/3+1,ge[3]=(he[1]+he[3]+he[5])/3+1):(ge[2]=(he[0]+he[2]+he[4])/3,ge[3]=(he[1]+he[3]+he[5])/3),t.redrawHint("select",!0),t.redraw();else if(fe&&W.touches[1]&&!t.touchData.didSelect&&re.zoomingEnabled()&&re.panningEnabled()&&re.userZoomingEnabled()&&re.userPanningEnabled()){W.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var lt=t.dragData.touchDragEles;if(lt){t.redrawHint("drag",!0);for(var It=0;It0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},"touchmoveHandler"),!1);var K;t.registerBinding(e,"touchcancel",K=o(function(W){var fe=t.touchData.start;t.touchData.capture=!1,fe&&fe.unactivate()},"touchcancelHandler"));var se,ce,ue,te;if(t.registerBinding(e,"touchend",se=o(function(W){var fe=t.touchData.start,ge=t.touchData.capture;if(ge)W.touches.length===0&&(t.touchData.capture=!1),W.preventDefault();else return;var re=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var he=t.cy,ne=he.zoom(),ae=t.touchData.now,we=t.touchData.earlier;if(W.touches[0]){var Te=t.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);ae[0]=Te[0],ae[1]=Te[1]}if(W.touches[1]){var Te=t.projectIntoViewport(W.touches[1].clientX,W.touches[1].clientY);ae[2]=Te[0],ae[3]=Te[1]}if(W.touches[2]){var Te=t.projectIntoViewport(W.touches[2].clientX,W.touches[2].clientY);ae[4]=Te[0],ae[5]=Te[1]}fe&&fe.unactivate();var Ce;if(t.touchData.cxt){if(Ce={originalEvent:W,type:"cxttapend",position:{x:ae[0],y:ae[1]}},fe?fe.emit(Ce):he.emit(Ce),!t.touchData.cxtDragged){var Ae={originalEvent:W,type:"cxttap",position:{x:ae[0],y:ae[1]}};fe?fe.emit(Ae):he.emit(Ae)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!W.touches[2]&&he.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Ge=he.collection(t.getAllInBox(re[0],re[1],re[2],re[3]));re[0]=void 0,re[1]=void 0,re[2]=void 0,re[3]=void 0,re[4]=0,t.redrawHint("select",!0),he.emit({type:"boxend",originalEvent:W,position:{x:ae[0],y:ae[1]}});var Me=o(function(kt){return kt.selectable()&&!kt.selected()},"eleWouldBeSelected");Ge.emit("box").stdFilter(Me).select().emit("boxselect"),Ge.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(fe?.unactivate(),W.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!W.touches[1]){if(!W.touches[0]){if(!W.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var ye=t.dragData.touchDragEles;if(fe!=null){var He=fe._private.grabbed;v(ye),t.redrawHint("drag",!0),t.redrawHint("eles",!0),He&&(fe.emit("freeon"),ye.emit("free"),t.dragData.didDrag&&(fe.emit("dragfreeon"),ye.emit("dragfree"))),n(fe,["touchend","tapend","vmouseup","tapdragout"],W,{x:ae[0],y:ae[1]}),fe.unactivate(),t.touchData.start=null}else{var ze=t.findNearestElement(ae[0],ae[1],!0,!0);n(ze,["touchend","tapend","vmouseup","tapdragout"],W,{x:ae[0],y:ae[1]})}var Ze=t.touchData.startPosition[0]-ae[0],gt=Ze*Ze,yt=t.touchData.startPosition[1]-ae[1],tt=yt*yt,Ye=gt+tt,Je=Ye*ne*ne;t.touchData.singleTouchMoved||(fe||he.$(":selected").unselect(["tapunselect"]),n(fe,["tap","vclick"],W,{x:ae[0],y:ae[1]}),ce=!1,W.timeStamp-te<=he.multiClickDebounceTime()?(ue&&clearTimeout(ue),ce=!0,te=null,n(fe,["dbltap","vdblclick"],W,{x:ae[0],y:ae[1]})):(ue=setTimeout(function(){ce||n(fe,["onetap","voneclick"],W,{x:ae[0],y:ae[1]})},he.multiClickDebounceTime()),te=W.timeStamp)),fe!=null&&!t.dragData.didDrag&&fe._private.selectable&&Je"u"){var De=[],oe=o(function(W){return{clientX:W.clientX,clientY:W.clientY,force:1,identifier:W.pointerId,pageX:W.pageX,pageY:W.pageY,radiusX:W.width/2,radiusY:W.height/2,screenX:W.screenX,screenY:W.screenY,target:W.target}},"makeTouch"),ke=o(function(W){return{event:W,touch:oe(W)}},"makePointer"),Ie=o(function(W){De.push(ke(W))},"addPointer"),Se=o(function(W){for(var fe=0;fe0)return Y[0]}return null},"getCurveT"),g=Object.keys(p),y=0;y0?m:Hpe(a,s,e,r,n,i,l,u)},"intersectLine"),checkPoint:o(function(e,r,n,i,a,s,l,u){u=u==="auto"?Y0(i,a):u;var h=2*u;if(Qu(e,r,this.points,s,l,i,a-h,[0,-1],n)||Qu(e,r,this.points,s,l,i-h,a,[0,-1],n))return!0;var f=i/2+2*n,d=a/2+2*n,p=[s-f,l-d,s-f,l,s+f,l,s+f,l-d];return!!(zs(e,r,p)||$0(e,r,h,h,s+i/2-u,l+a/2-u,n)||$0(e,r,h,h,s-i/2+u,l+a/2-u,n))},"checkPoint")}};Ju.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",ls(3,0)),this.generateRoundPolygon("round-triangle",ls(3,0)),this.generatePolygon("rectangle",ls(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",ls(5,0)),this.generateRoundPolygon("round-pentagon",ls(5,0)),this.generatePolygon("hexagon",ls(6,0)),this.generateRoundPolygon("round-hexagon",ls(6,0)),this.generatePolygon("heptagon",ls(7,0)),this.generateRoundPolygon("round-heptagon",ls(7,0)),this.generatePolygon("octagon",ls(8,0)),this.generateRoundPolygon("round-octagon",ls(8,0));var n=new Array(20);{var i=NP(5,0),a=NP(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var l=0;l=e.deqFastCost*S)break}else if(h){if(b>=e.deqCost*m||b>=e.deqAvgCost*p)break}else if(w>=e.deqNoDrawCost*LP)break;var T=e.deq(n,v,y);if(T.length>0)for(var E=0;E0&&(e.onDeqd(n,g),!h&&e.shouldRedraw(n,g,v,y)&&a())},"dequeue"),l=e.priority||JP;i.beforeRender(s,l(n))}},"setupDequeueingImpl")},"setupDequeueing")},pQe=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:C6;XP(this,t),this.idsByKey=new Vc,this.keyForId=new Vc,this.cachesByLvl=new Vc,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return o(t,"ElementTextureCacheLookup"),jP(t,[{key:"getIdsFor",value:o(function(r){r==null&&oi("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new c1,n.set(r,i)),i},"getIdsFor")},{key:"addIdForKey",value:o(function(r,n){r!=null&&this.getIdsFor(r).add(n)},"addIdForKey")},{key:"deleteIdForKey",value:o(function(r,n){r!=null&&this.getIdsFor(r).delete(n)},"deleteIdForKey")},{key:"getNumberOfIdsForKey",value:o(function(r){return r==null?0:this.getIdsFor(r).size},"getNumberOfIdsForKey")},{key:"updateKeyMappingFor",value:o(function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(a,n),this.keyForId.set(n,a)},"updateKeyMappingFor")},{key:"deleteKeyMappingFor",value:o(function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)},"deleteKeyMappingFor")},{key:"keyHasChangedFor",value:o(function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);return i!==a},"keyHasChangedFor")},{key:"isInvalid",value:o(function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)},"isInvalid")},{key:"getCachesAt",value:o(function(r){var n=this.cachesByLvl,i=this.lvls,a=n.get(r);return a||(a=new Vc,n.set(r,a),i.push(r)),a},"getCachesAt")},{key:"getCache",value:o(function(r,n){return this.getCachesAt(n).get(r)},"getCache")},{key:"get",value:o(function(r,n){var i=this.getKey(r),a=this.getCache(i,n);return a!=null&&this.updateKeyMappingFor(r),a},"get")},{key:"getForCachedKey",value:o(function(r,n){var i=this.keyForId.get(r.id()),a=this.getCache(i,n);return a},"getForCachedKey")},{key:"hasCache",value:o(function(r,n){return this.getCachesAt(n).has(r)},"hasCache")},{key:"has",value:o(function(r,n){var i=this.getKey(r);return this.hasCache(i,n)},"has")},{key:"setCache",value:o(function(r,n,i){i.key=r,this.getCachesAt(n).set(r,i)},"setCache")},{key:"set",value:o(function(r,n,i){var a=this.getKey(r);this.setCache(a,n,i),this.updateKeyMappingFor(r)},"set")},{key:"deleteCache",value:o(function(r,n){this.getCachesAt(n).delete(r)},"deleteCache")},{key:"delete",value:o(function(r,n){var i=this.getKey(r);this.deleteCache(i,n)},"_delete")},{key:"invalidateKey",value:o(function(r){var n=this;this.lvls.forEach(function(i){return n.deleteCache(r,i)})},"invalidateKey")},{key:"invalidate",value:o(function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(r);var a=this.doesEleInvalidateKey(r);return a&&this.invalidateKey(i),a||this.getNumberOfIdsForKey(i)===0},"invalidate")}]),t}(),fpe=25,d6=50,T6=-4,HP=3,mQe=7.99,gQe=8,yQe=1024,vQe=1024,xQe=1024,bQe=.2,wQe=.8,TQe=10,kQe=.15,EQe=.1,CQe=.9,SQe=.9,AQe=100,_Qe=1,e1={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},LQe=Sa({getKey:null,doesEleInvalidateKey:C6,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Ppe,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Bx=o(function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=LQe(r);Wt(n,i),n.lookup=new pQe(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},"ElementTextureCache"),Yi=Bx.prototype;Yi.reasons=e1;Yi.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};Yi.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};Yi.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new eb(function(r,n){return n.reqs-r.reqs});return e};Yi.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};Yi.getElement=function(t,e,r,n,i){var a=this,s=this.renderer,l=s.cy.zoom(),u=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!a.allowEdgeTxrCaching&&t.isEdge()||!a.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(tB(l*r))),n=mQe||n>HP)return null;var h=Math.pow(2,n),f=e.h*h,d=e.w*h,p=s.eleTextBiggerThanMin(t,h);if(!this.isVisible(t,p))return null;var m=u.get(t,n);if(m&&m.invalidated&&(m.invalidated=!1,m.texture.invalidatedWidth-=m.width),m)return m;var g;if(f<=fpe?g=fpe:f<=d6?g=d6:g=Math.ceil(f/d6)*d6,f>xQe||d>vQe)return null;var y=a.getTextureQueue(g),v=y[y.length-2],x=o(function(){return a.recycleTexture(g,d)||a.addTexture(g,d)},"addNewTxr");v||(v=y[y.length-1]),v||(v=x()),v.width-v.usedWidthn;N--)L=a.getElement(t,e,r,N,e1.downscale);M()}else return a.queueElement(t,E.level-1),E;else{var k;if(!w&&!S&&!T)for(var I=n-1;I>=T6;I--){var C=u.get(t,I);if(C){k=C;break}}if(b(k))return a.queueElement(t,n),k;v.context.translate(v.usedWidth,0),v.context.scale(h,h),this.drawElement(v.context,t,e,p,!1),v.context.scale(1/h,1/h),v.context.translate(-v.usedWidth,0)}return m={x:v.usedWidth,texture:v,level:n,scale:h,width:d,height:f,scaledLabelShown:p},v.usedWidth+=Math.ceil(d+gQe),v.eleCaches.push(m),u.set(t,n,m),a.checkTextureFullness(v),m};Yi.invalidateElements=function(t){for(var e=0;e=bQe*t.width&&this.retireTexture(t)};Yi.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>wQe&&t.fullnessChecks>=TQe?Af(r,t):t.fullnessChecks++};Yi.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;Af(n,t),t.retired=!0;for(var a=t.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,eB(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Af(i,s),n.push(s),s}};Yi.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),a=this.getKey(t),s=i[a];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var l={eles:t.spawn().merge(t),level:e,reqs:1,key:a};n.push(l),i[a]=l}};Yi.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s<_Qe&&r.size()>0;s++){var l=r.pop(),u=l.key,h=l.eles[0],f=a.hasCache(h,l.level);if(n[u]=null,f)continue;i.push(l);var d=e.getBoundingBox(h);e.getElement(h,d,t,l.level,e1.dequeue)}return i};Yi.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(t),a=n[i];a!=null&&(a.eles.length===1?(a.reqs=ZP,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))};Yi.onDequeue=function(t){this.onDequeues.push(t)};Yi.offDequeue=function(t){Af(this.onDequeues,t)};Yi.setupDequeueing=Yme.setupDequeueing({deqRedrawThreshold:AQe,deqCost:kQe,deqAvgCost:EQe,deqNoDrawCost:CQe,deqFastCost:SQe,deq:o(function(e,r,n){return e.dequeue(r,n)},"deq"),onDeqd:o(function(e,r){for(var n=0;n=RQe||r>M6)return null}n.validateLayersElesOrdering(r,t);var u=n.layersByLevel,h=Math.pow(2,r),f=u[r]=u[r]||[],d,p=n.levelIsComplete(r,t),m,g=o(function(){var M=o(function(O){if(n.validateLayersElesOrdering(O,t),n.levelIsComplete(O,t))return m=u[O],!0},"canUseAsTmpLvl"),N=o(function(O){if(!m)for(var D=r+O;zx<=D&&D<=M6&&!M(D);D+=O);},"checkLvls");N(1),N(-1);for(var k=f.length-1;k>=0;k--){var I=f[k];I.invalid&&Af(f,I)}},"checkTempLevels");if(!p)g();else return f;var y=o(function(){if(!d){d=Gs();for(var M=0;MzQe)return null;var I=n.makeLayer(d,r);if(N!=null){var C=f.indexOf(N)+1;f.splice(C,0,I)}else(M.insert===void 0||M.insert)&&f.unshift(I);return I},"makeLayer");if(n.skipping&&!l)return null;for(var x=null,b=t.length/DQe,w=!l,S=0;S=b||!Upe(x.bb,T.boundingBox()))&&(x=v({insert:!0,after:x}),!x))return null;m||w?n.queueLayer(x,T):n.drawEleInLayer(x,T,r,e),x.eles.push(T),_[r]=x}return m||(w?null:f)};Aa.getEleLevelForLayerLevel=function(t,e){return t};Aa.drawEleInLayer=function(t,e,r,n){var i=this,a=this.renderer,s=t.context,l=e.boundingBox();l.w===0||l.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),a.setImgSmoothing(s,!1),a.drawCachedElement(s,e,null,null,r,GQe),a.setImgSmoothing(s,!0))};Aa.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var i=0,a=0;a0||s.invalid)return!1;i+=s.eles.length}return i===e.length};Aa.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e};Aa.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Ku(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,o(function(n,i,a){e.invalidateLayer(n)},"invalAssocLayers")))};Aa.invalidateLayer=function(t){if(this.lastInvalidationTime=Ku(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];Af(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,l=e._private.rscratch;if(!(a&&!e.visible())&&!(l.badLine||l.allpts==null||isNaN(l.allpts[0]))){var u;r&&(u=r,t.translate(-u.x1,-u.y1));var h=a?e.pstyle("opacity").value:1,f=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,p=e.pstyle("line-style").value,m=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,y=e.pstyle("line-outline-width").value,v=e.pstyle("line-outline-color").value,x=h*f,b=h*f,w=o(function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x;d==="straight-triangle"?(s.eleStrokeStyle(t,e,O),s.drawEdgeTrianglePath(e,t,l.allpts)):(t.lineWidth=m,t.lineCap=g,s.eleStrokeStyle(t,e,O),s.drawEdgePath(e,t,l.allpts,p),t.lineCap="butt")},"drawLine"),S=o(function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x;if(t.lineWidth=m+y,t.lineCap=g,y>0)s.colorStrokeStyle(t,v[0],v[1],v[2],O);else{t.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,t,l.allpts):(s.drawEdgePath(e,t,l.allpts,p),t.lineCap="butt")},"drawLineOutline"),T=o(function(){i&&s.drawEdgeOverlay(t,e)},"drawOverlay"),E=o(function(){i&&s.drawEdgeUnderlay(t,e)},"drawUnderlay"),_=o(function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;s.drawArrowheads(t,e,O)},"drawArrows"),A=o(function(){s.drawElementText(t,e,null,n)},"drawText");t.lineJoin="round";var L=e.pstyle("ghost").value==="yes";if(L){var M=e.pstyle("ghost-offset-x").pfValue,N=e.pstyle("ghost-offset-y").pfValue,k=e.pstyle("ghost-opacity").value,I=x*k;t.translate(M,N),w(I),_(I),t.translate(-M,-N)}else S();E(),w(),_(),T(),A(),r&&t.translate(u.x1,u.y1)}};Xme=o(function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var a=this,s=a.usePaths(),l=n._private.rscratch,u=n.pstyle("".concat(e,"-padding")).pfValue,h=2*u,f=n.pstyle("".concat(e,"-color")).value;r.lineWidth=h,l.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,f[0],f[1],f[2],i),a.drawEdgePath(n,r,l.allpts,"solid")}}}},"drawEdgeOverlayUnderlay");eh.drawEdgeOverlay=Xme("overlay");eh.drawEdgeUnderlay=Xme("underlay");eh.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,a=e,s,l=!1,u=this.usePaths(),h=t.pstyle("line-dash-pattern").pfValue,f=t.pstyle("line-dash-offset").pfValue;if(u){var d=r.join("$"),p=i.pathCacheKey&&i.pathCacheKey===d;p?(s=e=i.pathCache,l=!0):(s=e=new Path2D,i.pathCacheKey=d,i.pathCache=s)}if(a.setLineDash)switch(n){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(h),a.lineDashOffset=f;break;case"solid":a.setLineDash([]);break}if(!l&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var m=2;m+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(a&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var l=e.pstyle("label");if(!l||!l.value)return;var u=s.getLabelJustification(e);t.textAlign=u,t.textBaseline="bottom"}else{var h=e.element()._private.rscratch.badLine,f=e.pstyle("label"),d=e.pstyle("source-label"),p=e.pstyle("target-label");if(h||(!f||!f.value)&&(!d||!d.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var m=!r,g;r&&(g=r,t.translate(-g.x1,-g.y1)),i==null?(s.drawText(t,e,null,m,a),e.isEdge()&&(s.drawText(t,e,"source",m,a),s.drawText(t,e,"target",m,a))):s.drawText(t,e,i,m,a),r&&t.translate(g.x1,g.y1)};K0.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,l=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,u=e.pstyle("text-outline-opacity").value*l,h=e.pstyle("color").value,f=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,h[0],h[1],h[2],l),this.colorStrokeStyle(t,f[0],f[1],f[2],u)};o(RP,"roundRect");K0.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,a=e?e+"-":"",s=t.pstyle(a+"text-rotation"),l=Ul(i,"labelAngle",e);return s.strValue==="autorotate"?r=t.isEdge()?l:0:s.strValue==="none"?r=0:r=s.pfValue,r};K0.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=e._private,s=a.rscratch,l=i?e.effectiveOpacity():1;if(!(i&&(l===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var u=Ul(s,"labelX",r),h=Ul(s,"labelY",r),f,d,p=this.getLabelText(e,r);if(p!=null&&p!==""&&!isNaN(u)&&!isNaN(h)){this.setupTextStyle(t,e,i);var m=r?r+"-":"",g=Ul(s,"labelWidth",r),y=Ul(s,"labelHeight",r),v=e.pstyle(m+"text-margin-x").pfValue,x=e.pstyle(m+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,S=e.pstyle("text-valign").value;b&&(w="center",S="center"),u+=v,h+=x;var T;switch(n?T=this.getTextAngle(e,r):T=0,T!==0&&(f=u,d=h,t.translate(f,d),t.rotate(T),u=0,h=0),S){case"top":break;case"center":h+=y/2;break;case"bottom":h+=y;break}var E=e.pstyle("text-background-opacity").value,_=e.pstyle("text-border-opacity").value,A=e.pstyle("text-border-width").pfValue,L=e.pstyle("text-background-padding").pfValue,M=e.pstyle("text-background-shape").strValue,N=M.indexOf("round")===0,k=2;if(E>0||A>0&&_>0){var I=u-L;switch(w){case"left":I-=g;break;case"center":I-=g/2;break}var C=h-y-L,O=g+2*L,D=y+2*L;if(E>0){var P=t.fillStyle,F=e.pstyle("text-background-color").value;t.fillStyle="rgba("+F[0]+","+F[1]+","+F[2]+","+E*l+")",N?RP(t,I,C,O,D,k):t.fillRect(I,C,O,D),t.fillStyle=P}if(A>0&&_>0){var B=t.strokeStyle,$=t.lineWidth,z=e.pstyle("text-border-color").value,Y=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+z[0]+","+z[1]+","+z[2]+","+_*l+")",t.lineWidth=A,t.setLineDash)switch(Y){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=A/4,t.setLineDash([]);break;case"solid":t.setLineDash([]);break}if(N?RP(t,I,C,O,D,k,"stroke"):t.strokeRect(I,C,O,D),Y==="double"){var Q=A/2;N?RP(t,I+Q,C+Q,O-Q*2,D-Q*2,k,"stroke"):t.strokeRect(I+Q,C+Q,O-Q*2,D-Q*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=$,t.strokeStyle=B}}var X=2*e.pstyle("text-outline-width").pfValue;if(X>0&&(t.lineWidth=X),e.pstyle("text-wrap").value==="wrap"){var ie=Ul(s,"labelWrapCachedLines",r),j=Ul(s,"labelLineHeight",r),J=g/2,Z=this.getLabelJustification(e);switch(Z==="auto"||(w==="left"?Z==="left"?u+=-g:Z==="center"&&(u+=-J):w==="center"?Z==="left"?u+=-J:Z==="right"&&(u+=J):w==="right"&&(Z==="center"?u+=J:Z==="right"&&(u+=g))),S){case"top":h-=(ie.length-1)*j;break;case"center":case"bottom":h-=(ie.length-1)*j;break}for(var H=0;H0&&t.strokeText(ie[H],u,h),t.fillText(ie[H],u,h),h+=j}else X>0&&t.strokeText(p,u,h),t.fillText(p,u,h);T!==0&&(t.rotate(-T),t.translate(-f,-d))}}};v1={};v1.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,l,u,h=e._private,f=h.rscratch,d=e.position();if(!(!ft(d.x)||!ft(d.y))&&!(a&&!e.visible())){var p=a?e.effectiveOpacity():1,m=s.usePaths(),g,y=!1,v=e.padding();l=e.width()+2*v,u=e.height()+2*v;var x;r&&(x=r,t.translate(-x.x1,-x.y1));for(var b=e.pstyle("background-image"),w=b.value,S=new Array(w.length),T=new Array(w.length),E=0,_=0;_0&&arguments[0]!==void 0?arguments[0]:I;s.eleFillStyle(t,e,ne)},"setupShapeColor"),H=o(function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:z;s.colorStrokeStyle(t,C[0],C[1],C[2],ne)},"setupBorderColor"),q=o(function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ie;s.colorStrokeStyle(t,Q[0],Q[1],Q[2],ne)},"setupOutlineColor"),K=o(function(ne,ae,we,Te){var Ce=s.nodePathCache=s.nodePathCache||[],Ae=Ope(we==="polygon"?we+","+Te.join(","):we,""+ae,""+ne,""+J),Ge=Ce[Ae],Me,ye=!1;return Ge!=null?(Me=Ge,ye=!0,f.pathCache=Me):(Me=new Path2D,Ce[Ae]=f.pathCache=Me),{path:Me,cacheHit:ye}},"getPath"),se=e.pstyle("shape").strValue,ce=e.pstyle("shape-polygon-points").pfValue;if(m){t.translate(d.x,d.y);var ue=K(l,u,se,ce);g=ue.path,y=ue.cacheHit}var te=o(function(){if(!y){var ne=d;m&&(ne={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(g||t,ne.x,ne.y,l,u,J,f)}m?t.fill(g):t.fill()},"drawShape"),De=o(function(){for(var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,we=h.backgrounding,Te=0,Ce=0;Ce0&&arguments[0]!==void 0?arguments[0]:!1,ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p;s.hasPie(e)&&(s.drawPie(t,e,ae),ne&&(m||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,l,u,J,f)))},"drawPie"),ke=o(function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,ae=(N>0?N:-N)*ne,we=N>0?0:255;N!==0&&(s.colorFillStyle(t,we,we,we,ae),m?t.fill(g):t.fill())},"darken"),Ie=o(function(){if(k>0){if(t.lineWidth=k,t.lineCap=P,t.lineJoin=D,t.setLineDash)switch(O){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(B),t.lineDashOffset=$;break;case"solid":case"double":t.setLineDash([]);break}if(F!=="center"){if(t.save(),t.lineWidth*=2,F==="inside")m?t.clip(g):t.clip();else{var ne=new Path2D;ne.rect(-l/2-k,-u/2-k,l+2*k,u+2*k),ne.addPath(g),t.clip(ne,"evenodd")}m?t.stroke(g):t.stroke(),t.restore()}else m?t.stroke(g):t.stroke();if(O==="double"){t.lineWidth=k/3;var ae=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",m?t.stroke(g):t.stroke(),t.globalCompositeOperation=ae}t.setLineDash&&t.setLineDash([])}},"drawBorder"),Se=o(function(){if(Y>0){if(t.lineWidth=Y,t.lineCap="butt",t.setLineDash)switch(X){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var ne=d;m&&(ne={x:0,y:0});var ae=s.getNodeShape(e),we=k;F==="inside"&&(we=0),F==="outside"&&(we*=2);var Te=(l+we+(Y+j))/l,Ce=(u+we+(Y+j))/u,Ae=l*Te,Ge=u*Ce,Me=s.nodeShapes[ae].points,ye;if(m){var He=K(Ae,Ge,ae,Me);ye=He.path}if(ae==="ellipse")s.drawEllipsePath(ye||t,ne.x,ne.y,Ae,Ge);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ae)){var ze=0,Ze=0,gt=0;ae==="round-diamond"?ze=(we+j+Y)*1.4:ae==="round-heptagon"?(ze=(we+j+Y)*1.075,gt=-(we/2+j+Y)/35):ae==="round-hexagon"?ze=(we+j+Y)*1.12:ae==="round-pentagon"?(ze=(we+j+Y)*1.13,gt=-(we/2+j+Y)/15):ae==="round-tag"?(ze=(we+j+Y)*1.12,Ze=(we/2+Y+j)*.07):ae==="round-triangle"&&(ze=(we+j+Y)*(Math.PI/2),gt=-(we+j/2+Y)/Math.PI),ze!==0&&(Te=(l+ze)/l,Ae=l*Te,["round-hexagon","round-tag"].includes(ae)||(Ce=(u+ze)/u,Ge=u*Ce)),J=J==="auto"?Wpe(Ae,Ge):J;for(var yt=Ae/2,tt=Ge/2,Ye=J+(we+Y+j)/2,Je=new Array(Me.length/2),Ve=new Array(Me.length/2),je=0;je0){if(i=i||n.position(),a==null||s==null){var m=n.padding();a=n.width()+2*m,s=n.height()+2*m}l.colorFillStyle(r,f[0],f[1],f[2],h),l.nodeShapes[d].draw(r,i.x,i.y,a+u*2,s+u*2,p),r.fill()}}}},"drawNodeOverlayUnderlay");v1.drawNodeOverlay=jme("overlay");v1.drawNodeUnderlay=jme("underlay");v1.hasPie=function(t){return t=t[0],t._private.hasPie};v1.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=n.x,l=n.y,u=e.width(),h=e.height(),f=Math.min(u,h)/2,d=0,p=this.usePaths();p&&(s=0,l=0),a.units==="%"?f=f*a.pfValue:a.pfValue!==void 0&&(f=a.pfValue/2);for(var m=1;m<=i.pieBackgroundN;m++){var g=e.pstyle("pie-"+m+"-background-size").value,y=e.pstyle("pie-"+m+"-background-color").value,v=e.pstyle("pie-"+m+"-background-opacity").value*r,x=g/100;x+d>1&&(x=1-d);var b=1.5*Math.PI+2*Math.PI*d,w=2*Math.PI*x,S=b+w;g===0||d>=1||d+x>1||(t.beginPath(),t.moveTo(s,l),t.arc(s,l,f,b,S),t.closePath(),this.colorFillStyle(t,y[0],y[1],y[2],v),t.fill(),d+=x)}};bo={},QQe=100;bo.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};bo.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,i=0;is.minMbLowQualFrames&&(s.motionBlurPxRatio=s.mbPxRBlurry)),s.clearingMotionBlur&&(s.motionBlurPxRatio=1),s.textureDrawLastFrame&&!d&&(f[s.NODE]=!0,f[s.SELECT_BOX]=!0);var b=u.style(),w=u.zoom(),S=i!==void 0?i:w,T=u.pan(),E={x:T.x,y:T.y},_={zoom:w,pan:{x:T.x,y:T.y}},A=s.prevViewport,L=A===void 0||_.zoom!==A.zoom||_.pan.x!==A.pan.x||_.pan.y!==A.pan.y;!L&&!(y&&!g)&&(s.motionBlurPxRatio=1),a&&(E=a),S*=l,E.x*=l,E.y*=l;var M=s.getCachedZSortedEles();function N(ue,te,De,oe,ke){var Ie=ue.globalCompositeOperation;ue.globalCompositeOperation="destination-out",s.colorFillStyle(ue,255,255,255,s.motionBlurTransparency),ue.fillRect(te,De,oe,ke),ue.globalCompositeOperation=Ie}o(N,"mbclear");function k(ue,te){var De,oe,ke,Ie;!s.clearingMotionBlur&&(ue===h.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]||ue===h.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG])?(De={x:T.x*m,y:T.y*m},oe=w*m,ke=s.canvasWidth*m,Ie=s.canvasHeight*m):(De=E,oe=S,ke=s.canvasWidth,Ie=s.canvasHeight),ue.setTransform(1,0,0,1,0,0),te==="motionBlur"?N(ue,0,0,ke,Ie):!e&&(te===void 0||te)&&ue.clearRect(0,0,ke,Ie),r||(ue.translate(De.x,De.y),ue.scale(oe,oe)),a&&ue.translate(a.x,a.y),i&&ue.scale(i,i)}if(o(k,"setContextTransform"),d||(s.textureDrawLastFrame=!1),d){if(s.textureDrawLastFrame=!0,!s.textureCache){s.textureCache={},s.textureCache.bb=u.mutableElements().boundingBox(),s.textureCache.texture=s.data.bufferCanvases[s.TEXTURE_BUFFER];var I=s.data.bufferContexts[s.TEXTURE_BUFFER];I.setTransform(1,0,0,1,0,0),I.clearRect(0,0,s.canvasWidth*s.textureMult,s.canvasHeight*s.textureMult),s.render({forcedContext:I,drawOnlyNodeLayer:!0,forcedPxRatio:l*s.textureMult});var _=s.textureCache.viewport={zoom:u.zoom(),pan:u.pan(),width:s.canvasWidth,height:s.canvasHeight};_.mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}f[s.DRAG]=!1,f[s.NODE]=!1;var C=h.contexts[s.NODE],O=s.textureCache.texture,_=s.textureCache.viewport;C.setTransform(1,0,0,1,0,0),p?N(C,0,0,_.width,_.height):C.clearRect(0,0,_.width,_.height);var D=b.core("outside-texture-bg-color").value,P=b.core("outside-texture-bg-opacity").value;s.colorFillStyle(C,D[0],D[1],D[2],P),C.fillRect(0,0,_.width,_.height);var w=u.zoom();k(C,!1),C.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/l,_.height/_.zoom/l),C.drawImage(O,_.mpan.x,_.mpan.y,_.width/_.zoom/l,_.height/_.zoom/l)}else s.textureOnViewport&&!e&&(s.textureCache=null);var F=u.extent(),B=s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming||s.hoverData.draggingEles||s.cy.animated(),$=s.hideEdgesOnViewport&&B,z=[];if(z[s.NODE]=!f[s.NODE]&&p&&!s.clearedForMotionBlur[s.NODE]||s.clearingMotionBlur,z[s.NODE]&&(s.clearedForMotionBlur[s.NODE]=!0),z[s.DRAG]=!f[s.DRAG]&&p&&!s.clearedForMotionBlur[s.DRAG]||s.clearingMotionBlur,z[s.DRAG]&&(s.clearedForMotionBlur[s.DRAG]=!0),f[s.NODE]||r||n||z[s.NODE]){var Y=p&&!z[s.NODE]&&m!==1,C=e||(Y?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]:h.contexts[s.NODE]),Q=p&&!Y?"motionBlur":void 0;k(C,Q),$?s.drawCachedNodes(C,M.nondrag,l,F):s.drawLayeredElements(C,M.nondrag,l,F),s.debug&&s.drawDebugPoints(C,M.nondrag),!r&&!p&&(f[s.NODE]=!1)}if(!n&&(f[s.DRAG]||r||z[s.DRAG])){var Y=p&&!z[s.DRAG]&&m!==1,C=e||(Y?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG]:h.contexts[s.DRAG]);k(C,p&&!Y?"motionBlur":void 0),$?s.drawCachedNodes(C,M.drag,l,F):s.drawCachedElements(C,M.drag,l,F),s.debug&&s.drawDebugPoints(C,M.drag),!r&&!p&&(f[s.DRAG]=!1)}if(s.showFps||!n&&f[s.SELECT_BOX]&&!r){var C=e||h.contexts[s.SELECT_BOX];if(k(C),s.selection[4]==1&&(s.hoverData.selecting||s.touchData.selecting)){var w=s.cy.zoom(),X=b.core("selection-box-border-width").value/w;C.lineWidth=X,C.fillStyle="rgba("+b.core("selection-box-color").value[0]+","+b.core("selection-box-color").value[1]+","+b.core("selection-box-color").value[2]+","+b.core("selection-box-opacity").value+")",C.fillRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]),X>0&&(C.strokeStyle="rgba("+b.core("selection-box-border-color").value[0]+","+b.core("selection-box-border-color").value[1]+","+b.core("selection-box-border-color").value[2]+","+b.core("selection-box-opacity").value+")",C.strokeRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]))}if(h.bgActivePosistion&&!s.hoverData.selecting){var w=s.cy.zoom(),ie=h.bgActivePosistion;C.fillStyle="rgba("+b.core("active-bg-color").value[0]+","+b.core("active-bg-color").value[1]+","+b.core("active-bg-color").value[2]+","+b.core("active-bg-opacity").value+")",C.beginPath(),C.arc(ie.x,ie.y,b.core("active-bg-size").pfValue/w,0,2*Math.PI),C.fill()}var j=s.lastRedrawTime;if(s.showFps&&j){j=Math.round(j);var J=Math.round(1e3/j);C.setTransform(1,0,0,1,0,0),C.fillStyle="rgba(255, 0, 0, 0.75)",C.strokeStyle="rgba(255, 0, 0, 0.75)",C.lineWidth=1,C.fillText("1 frame = "+j+" ms = "+J+" fps",0,20);var Z=60;C.strokeRect(0,30,250,20),C.fillRect(0,30,250*Math.min(J/Z,1),20)}r||(f[s.SELECT_BOX]=!1)}if(p&&m!==1){var H=h.contexts[s.NODE],q=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_NODE],K=h.contexts[s.DRAG],se=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_DRAG],ce=o(function(te,De,oe){te.setTransform(1,0,0,1,0,0),oe||!x?te.clearRect(0,0,s.canvasWidth,s.canvasHeight):N(te,0,0,s.canvasWidth,s.canvasHeight);var ke=m;te.drawImage(De,0,0,s.canvasWidth*ke,s.canvasHeight*ke,0,0,s.canvasWidth,s.canvasHeight)},"drawMotionBlur");(f[s.NODE]||z[s.NODE])&&(ce(H,q,z[s.NODE]),f[s.NODE]=!1),(f[s.DRAG]||z[s.DRAG])&&(ce(K,se,z[s.DRAG]),f[s.DRAG]=!1)}s.prevViewport=_,s.clearingMotionBlur&&(s.clearingMotionBlur=!1,s.motionBlurCleared=!0,s.motionBlur=!0),p&&(s.motionBlurTimeout=setTimeout(function(){s.motionBlurTimeout=null,s.clearedForMotionBlur[s.NODE]=!1,s.clearedForMotionBlur[s.DRAG]=!1,s.motionBlur=!1,s.clearingMotionBlur=!d,s.mbFrames=0,f[s.NODE]=!0,f[s.DRAG]=!0,s.redraw()},QQe)),e||u.emit("render")};Nf={};Nf.drawPolygonPath=function(t,e,r,n,i,a){var s=n/2,l=i/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*a[0],r+l*a[1]);for(var u=1;u0&&s>0){m.clearRect(0,0,a,s),m.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(t.full)m.translate(-n.x1*h,-n.y1*h),m.scale(h,h),this.drawElements(m,g),m.scale(1/h,1/h),m.translate(n.x1*h,n.y1*h);else{var y=e.pan(),v={x:y.x*h,y:y.y*h};h*=e.zoom(),m.translate(v.x,v.y),m.scale(h,h),this.drawElements(m,g),m.scale(1/h,1/h),m.translate(-v.x,-v.y)}t.bg&&(m.globalCompositeOperation="destination-over",m.fillStyle=t.bg,m.rect(0,0,a,s),m.fill())}return p};o(ZQe,"b64ToBlob");o(xpe,"b64UriToB64");o(Qme,"output");ab.png=function(t){return Qme(t,this.bufferCanvasImage(t),"image/png")};ab.jpg=function(t){return Qme(t,this.bufferCanvasImage(t),"image/jpeg")};Zme={};Zme.nodeShapeImpl=function(t,e,r,n,i,a,s,l){switch(t){case"ellipse":return this.drawEllipsePath(e,r,n,i,a);case"polygon":return this.drawPolygonPath(e,r,n,i,a,s);case"round-polygon":return this.drawRoundPolygonPath(e,r,n,i,a,s,l);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,n,i,a,l);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,n,i,a,s,l);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,n,i,a,l);case"barrel":return this.drawBarrelPath(e,r,n,i,a)}};JQe=Jme,Yr=Jme.prototype;Yr.CANVAS_LAYERS=3;Yr.SELECT_BOX=0;Yr.DRAG=1;Yr.NODE=2;Yr.BUFFER_COUNT=3;Yr.TEXTURE_BUFFER=0;Yr.MOTIONBLUR_BUFFER_NODE=1;Yr.MOTIONBLUR_BUFFER_DRAG=2;o(Jme,"CanvasRenderer");Yr.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[Yr.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[Yr.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[Yr.SELECT_BOX]=e;break}};eZe=typeof Path2D<"u";Yr.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t};Yr.usePaths=function(){return eZe&&this.pathsEnabled};Yr.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)};Yr.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled};Yr.makeOffscreenCanvas=function(t,e){var r;if((typeof OffscreenCanvas>"u"?"undefined":Hi(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),i=n.document;r=i.createElement("canvas"),r.width=t,r.height=e}return r};[qme,Yc,eh,yB,K0,v1,bo,Nf,ab,Zme].forEach(function(t){Wt(Yr,t)});tZe=[{name:"null",impl:Ime},{name:"base",impl:Hme},{name:"canvas",impl:JQe}],rZe=[{type:"layout",extensions:lQe},{type:"renderer",extensions:tZe}],ege={},tge={};o(rge,"setExtension");o(nge,"getExtension");o(nZe,"setModule");o(iZe,"getModule");qP=o(function(){if(arguments.length===2)return nge.apply(null,arguments);if(arguments.length===3)return rge.apply(null,arguments);if(arguments.length===4)return iZe.apply(null,arguments);if(arguments.length===5)return nZe.apply(null,arguments);oi("Invalid extension access syntax")},"extension");Kx.prototype.extension=qP;rZe.forEach(function(t){t.extensions.forEach(function(e){rge(t.type,e.name,e.impl)})});ige=o(function t(){if(!(this instanceof t))return new t;this.length=0},"Stylesheet"),X0=ige.prototype;X0.instanceString=function(){return"stylesheet"};X0.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this};X0.css=function(t,e){var r=this.length-1;if(zt(t))this[r].properties.push({name:t,value:e});else if(Mr(t))for(var n=t,i=Object.keys(n),a=0;a{"use strict";o(function(e,r){typeof sb=="object"&&typeof xB=="object"?xB.exports=r():typeof define=="function"&&define.amd?define([],r):typeof sb=="object"?sb.layoutBase=r():e.layoutBase=r()},"webpackUniversalModuleDefinition")(sb,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return o(r,"__webpack_require__"),r.m=t,r.c=e,r.i=function(n){return n},r.d=function(n,i,a){r.o(n,i)||Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:a})},r.n=function(n){var i=n&&n.__esModule?o(function(){return n.default},"getDefault"):o(function(){return n},"getModuleExports");return r.d(i,"a",i),i},r.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},r.p="",r(r.s=26)}([function(t,e,r){"use strict";function n(){}o(n,"LayoutConstants"),n.QUALITY=1,n.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,n.DEFAULT_INCREMENTAL=!1,n.DEFAULT_ANIMATION_ON_LAYOUT=!0,n.DEFAULT_ANIMATION_DURING_LAYOUT=!1,n.DEFAULT_ANIMATION_PERIOD=50,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,n.DEFAULT_GRAPH_MARGIN=15,n.NODE_DIMENSIONS_INCLUDE_LABELS=!1,n.SIMPLE_NODE_SIZE=40,n.SIMPLE_NODE_HALF_SIZE=n.SIMPLE_NODE_SIZE/2,n.EMPTY_COMPOUND_NODE_SIZE=40,n.MIN_EDGE_LENGTH=1,n.WORLD_BOUNDARY=1e6,n.INITIAL_WORLD_BOUNDARY=n.WORLD_BOUNDARY/1e3,n.WORLD_CENTER_X=1200,n.WORLD_CENTER_Y=900,t.exports=n},function(t,e,r){"use strict";var n=r(2),i=r(8),a=r(9);function s(u,h,f){n.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=u,this.target=h}o(s,"LEdge"),s.prototype=Object.create(n.prototype);for(var l in n)s[l]=n[l];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(u){if(this.source===u)return this.target;if(this.target===u)return this.source;throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(u,h){for(var f=this.getOtherEnd(u),d=h.getGraphManager().getRoot();;){if(f.getOwner()==h)return f;if(f.getOwner()==d)break;f=f.getOwner().getParent()}return null},s.prototype.updateLength=function(){var u=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),u),this.isOverlapingSourceAndTarget||(this.lengthX=u[0]-u[2],this.lengthY=u[1]-u[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},s.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=s},function(t,e,r){"use strict";function n(i){this.vGraphObject=i}o(n,"LGraphObject"),t.exports=n},function(t,e,r){"use strict";var n=r(2),i=r(10),a=r(13),s=r(0),l=r(16),u=r(4);function h(d,p,m,g){m==null&&g==null&&(g=p),n.call(this,g),d.graphManager!=null&&(d=d.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=g,this.edges=[],this.graphManager=d,m!=null&&p!=null?this.rect=new a(p.x,p.y,m.width,m.height):this.rect=new a}o(h,"LNode"),h.prototype=Object.create(n.prototype);for(var f in n)h[f]=n[f];h.prototype.getEdges=function(){return this.edges},h.prototype.getChild=function(){return this.child},h.prototype.getOwner=function(){return this.owner},h.prototype.getWidth=function(){return this.rect.width},h.prototype.setWidth=function(d){this.rect.width=d},h.prototype.getHeight=function(){return this.rect.height},h.prototype.setHeight=function(d){this.rect.height=d},h.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},h.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},h.prototype.getCenter=function(){return new u(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},h.prototype.getLocation=function(){return new u(this.rect.x,this.rect.y)},h.prototype.getRect=function(){return this.rect},h.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},h.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},h.prototype.setRect=function(d,p){this.rect.x=d.x,this.rect.y=d.y,this.rect.width=p.width,this.rect.height=p.height},h.prototype.setCenter=function(d,p){this.rect.x=d-this.rect.width/2,this.rect.y=p-this.rect.height/2},h.prototype.setLocation=function(d,p){this.rect.x=d,this.rect.y=p},h.prototype.moveBy=function(d,p){this.rect.x+=d,this.rect.y+=p},h.prototype.getEdgeListToNode=function(d){var p=[],m,g=this;return g.edges.forEach(function(y){if(y.target==d){if(y.source!=g)throw"Incorrect edge source!";p.push(y)}}),p},h.prototype.getEdgesBetween=function(d){var p=[],m,g=this;return g.edges.forEach(function(y){if(!(y.source==g||y.target==g))throw"Incorrect edge source and/or target";(y.target==d||y.source==d)&&p.push(y)}),p},h.prototype.getNeighborsList=function(){var d=new Set,p=this;return p.edges.forEach(function(m){if(m.source==p)d.add(m.target);else{if(m.target!=p)throw"Incorrect incidency!";d.add(m.source)}}),d},h.prototype.withChildren=function(){var d=new Set,p,m;if(d.add(this),this.child!=null)for(var g=this.child.getNodes(),y=0;yp&&(this.rect.x-=(this.labelWidth-p)/2,this.setWidth(this.labelWidth)),this.labelHeight>m&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-m)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-m),this.setHeight(this.labelHeight))}}},h.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},h.prototype.transform=function(d){var p=this.rect.x;p>s.WORLD_BOUNDARY?p=s.WORLD_BOUNDARY:p<-s.WORLD_BOUNDARY&&(p=-s.WORLD_BOUNDARY);var m=this.rect.y;m>s.WORLD_BOUNDARY?m=s.WORLD_BOUNDARY:m<-s.WORLD_BOUNDARY&&(m=-s.WORLD_BOUNDARY);var g=new u(p,m),y=d.inverseTransformPoint(g);this.setLocation(y.x,y.y)},h.prototype.getLeft=function(){return this.rect.x},h.prototype.getRight=function(){return this.rect.x+this.rect.width},h.prototype.getTop=function(){return this.rect.y},h.prototype.getBottom=function(){return this.rect.y+this.rect.height},h.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},t.exports=h},function(t,e,r){"use strict";function n(i,a){i==null&&a==null?(this.x=0,this.y=0):(this.x=i,this.y=a)}o(n,"PointD"),n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(i){this.x=i},n.prototype.setY=function(i){this.y=i},n.prototype.getDifference=function(i){return new DimensionD(this.x-i.x,this.y-i.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(i){return this.x+=i.width,this.y+=i.height,this},t.exports=n},function(t,e,r){"use strict";var n=r(2),i=r(10),a=r(0),s=r(6),l=r(3),u=r(1),h=r(13),f=r(12),d=r(11);function p(g,y,v){n.call(this,v),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=g,y!=null&&y instanceof s?this.graphManager=y:y!=null&&y instanceof Layout&&(this.graphManager=y.graphManager)}o(p,"LGraph"),p.prototype=Object.create(n.prototype);for(var m in n)p[m]=n[m];p.prototype.getNodes=function(){return this.nodes},p.prototype.getEdges=function(){return this.edges},p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getParent=function(){return this.parent},p.prototype.getLeft=function(){return this.left},p.prototype.getRight=function(){return this.right},p.prototype.getTop=function(){return this.top},p.prototype.getBottom=function(){return this.bottom},p.prototype.isConnected=function(){return this.isConnected},p.prototype.add=function(g,y,v){if(y==null&&v==null){var x=g;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(x)>-1)throw"Node already in graph!";return x.owner=this,this.getNodes().push(x),x}else{var b=g;if(!(this.getNodes().indexOf(y)>-1&&this.getNodes().indexOf(v)>-1))throw"Source or target not in graph!";if(!(y.owner==v.owner&&y.owner==this))throw"Both owners must be this graph!";return y.owner!=v.owner?null:(b.source=y,b.target=v,b.isInterGraph=!1,this.getEdges().push(b),y.edges.push(b),v!=y&&v.edges.push(b),b)}},p.prototype.remove=function(g){var y=g;if(g instanceof l){if(y==null)throw"Node is null!";if(!(y.owner!=null&&y.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var v=y.edges.slice(),x,b=v.length,w=0;w-1&&E>-1))throw"Source and/or target doesn't know this edge!";x.source.edges.splice(T,1),x.target!=x.source&&x.target.edges.splice(E,1);var S=x.source.owner.getEdges().indexOf(x);if(S==-1)throw"Not in owner's edge list!";x.source.owner.getEdges().splice(S,1)}},p.prototype.updateLeftTop=function(){for(var g=i.MAX_VALUE,y=i.MAX_VALUE,v,x,b,w=this.getNodes(),S=w.length,T=0;Tv&&(g=v),y>x&&(y=x)}return g==i.MAX_VALUE?null:(w[0].getParent().paddingLeft!=null?b=w[0].getParent().paddingLeft:b=this.margin,this.left=y-b,this.top=g-b,new f(this.left,this.top))},p.prototype.updateBounds=function(g){for(var y=i.MAX_VALUE,v=-i.MAX_VALUE,x=i.MAX_VALUE,b=-i.MAX_VALUE,w,S,T,E,_,A=this.nodes,L=A.length,M=0;Mw&&(y=w),vT&&(x=T),bw&&(y=w),vT&&(x=T),b=this.nodes.length){var L=0;v.forEach(function(M){M.owner==g&&L++}),L==this.nodes.length&&(this.isConnected=!0)}},t.exports=p},function(t,e,r){"use strict";var n,i=r(1);function a(s){n=r(5),this.layout=s,this.graphs=[],this.edges=[]}o(a,"LGraphManager"),a.prototype.addRoot=function(){var s=this.layout.newGraph(),l=this.layout.newNode(null),u=this.add(s,l);return this.setRootGraph(u),this.rootGraph},a.prototype.add=function(s,l,u,h,f){if(u==null&&h==null&&f==null){if(s==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(s)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(s),s.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return s.parent=l,l.child=s,s}else{f=u,h=l,u=s;var d=h.getOwner(),p=f.getOwner();if(!(d!=null&&d.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(p!=null&&p.getGraphManager()==this))throw"Target not in this graph mgr!";if(d==p)return u.isInterGraph=!1,d.add(u,h,f);if(u.isInterGraph=!0,u.source=h,u.target=f,this.edges.indexOf(u)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(u),!(u.source!=null&&u.target!=null))throw"Edge source and/or target is null!";if(!(u.source.edges.indexOf(u)==-1&&u.target.edges.indexOf(u)==-1))throw"Edge already in source and/or target incidency list!";return u.source.edges.push(u),u.target.edges.push(u),u}},a.prototype.remove=function(s){if(s instanceof n){var l=s;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var u=[];u=u.concat(l.getEdges());for(var h,f=u.length,d=0;d=s.getRight()?l[0]+=Math.min(s.getX()-a.getX(),a.getRight()-s.getRight()):s.getX()<=a.getX()&&s.getRight()>=a.getRight()&&(l[0]+=Math.min(a.getX()-s.getX(),s.getRight()-a.getRight())),a.getY()<=s.getY()&&a.getBottom()>=s.getBottom()?l[1]+=Math.min(s.getY()-a.getY(),a.getBottom()-s.getBottom()):s.getY()<=a.getY()&&s.getBottom()>=a.getBottom()&&(l[1]+=Math.min(a.getY()-s.getY(),s.getBottom()-a.getBottom()));var f=Math.abs((s.getCenterY()-a.getCenterY())/(s.getCenterX()-a.getCenterX()));s.getCenterY()===a.getCenterY()&&s.getCenterX()===a.getCenterX()&&(f=1);var d=f*l[0],p=l[1]/f;l[0]d)return l[0]=u,l[1]=m,l[2]=f,l[3]=A,!1;if(hf)return l[0]=p,l[1]=h,l[2]=E,l[3]=d,!1;if(uf?(l[0]=y,l[1]=v,k=!0):(l[0]=g,l[1]=m,k=!0):C===D&&(u>f?(l[0]=p,l[1]=m,k=!0):(l[0]=x,l[1]=v,k=!0)),-O===D?f>u?(l[2]=_,l[3]=A,I=!0):(l[2]=E,l[3]=T,I=!0):O===D&&(f>u?(l[2]=S,l[3]=T,I=!0):(l[2]=L,l[3]=A,I=!0)),k&&I)return!1;if(u>f?h>d?(P=this.getCardinalDirection(C,D,4),F=this.getCardinalDirection(O,D,2)):(P=this.getCardinalDirection(-C,D,3),F=this.getCardinalDirection(-O,D,1)):h>d?(P=this.getCardinalDirection(-C,D,1),F=this.getCardinalDirection(-O,D,3)):(P=this.getCardinalDirection(C,D,2),F=this.getCardinalDirection(O,D,4)),!k)switch(P){case 1:$=m,B=u+-w/D,l[0]=B,l[1]=$;break;case 2:B=x,$=h+b*D,l[0]=B,l[1]=$;break;case 3:$=v,B=u+w/D,l[0]=B,l[1]=$;break;case 4:B=y,$=h+-b*D,l[0]=B,l[1]=$;break}if(!I)switch(F){case 1:Y=T,z=f+-N/D,l[2]=z,l[3]=Y;break;case 2:z=L,Y=d+M*D,l[2]=z,l[3]=Y;break;case 3:Y=A,z=f+N/D,l[2]=z,l[3]=Y;break;case 4:z=_,Y=d+-M*D,l[2]=z,l[3]=Y;break}}return!1},i.getCardinalDirection=function(a,s,l){return a>s?l:1+l%4},i.getIntersection=function(a,s,l,u){if(u==null)return this.getIntersection2(a,s,l);var h=a.x,f=a.y,d=s.x,p=s.y,m=l.x,g=l.y,y=u.x,v=u.y,x=void 0,b=void 0,w=void 0,S=void 0,T=void 0,E=void 0,_=void 0,A=void 0,L=void 0;return w=p-f,T=h-d,_=d*f-h*p,S=v-g,E=m-y,A=y*g-m*v,L=w*E-S*T,L===0?null:(x=(T*A-E*_)/L,b=(S*_-w*A)/L,new n(x,b))},i.angleOfVector=function(a,s,l,u){var h=void 0;return a!==l?(h=Math.atan((u-s)/(l-a)),l0?1:i<0?-1:0},n.floor=function(i){return i<0?Math.ceil(i):Math.floor(i)},n.ceil=function(i){return i<0?Math.floor(i):Math.ceil(i)},t.exports=n},function(t,e,r){"use strict";function n(){}o(n,"Integer"),n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,t.exports=n},function(t,e,r){"use strict";var n=function(){function h(f,d){for(var p=0;p"u"?"undefined":n(a);return a==null||s!="object"&&s!="function"},t.exports=i},function(t,e,r){"use strict";function n(m){if(Array.isArray(m)){for(var g=0,y=Array(m.length);g0&&g;){for(w.push(T[0]);w.length>0&&g;){var E=w[0];w.splice(0,1),b.add(E);for(var _=E.getEdges(),x=0;x<_.length;x++){var A=_[x].getOtherEnd(E);if(S.get(E)!=A)if(!b.has(A))w.push(A),S.set(A,E);else{g=!1;break}}}if(!g)m=[];else{var L=[].concat(n(b));m.push(L);for(var x=0;x-1&&T.splice(N,1)}b=new Set,S=new Map}}return m},p.prototype.createDummyNodesForBendpoints=function(m){for(var g=[],y=m.source,v=this.graphManager.calcLowestCommonAncestor(m.source,m.target),x=0;x0){for(var v=this.edgeToDummyNodes.get(y),x=0;x=0&&g.splice(A,1);var L=S.getNeighborsList();L.forEach(function(k){if(y.indexOf(k)<0){var I=v.get(k),C=I-1;C==1&&E.push(k),v.set(k,C)}})}y=y.concat(E),(g.length==1||g.length==2)&&(x=!0,b=g[0])}return b},p.prototype.setGraphManager=function(m){this.graphManager=m},t.exports=p},function(t,e,r){"use strict";function n(){}o(n,"RandomSeed"),n.seed=1,n.x=0,n.nextDouble=function(){return n.x=Math.sin(n.seed++)*1e4,n.x-Math.floor(n.x)},t.exports=n},function(t,e,r){"use strict";var n=r(4);function i(a,s){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}o(i,"Transform"),i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(a){this.lworldExtX=a},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(a){this.lworldExtY=a},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},i.prototype.transformX=function(a){var s=0,l=this.lworldExtX;return l!=0&&(s=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/l),s},i.prototype.transformY=function(a){var s=0,l=this.lworldExtY;return l!=0&&(s=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/l),s},i.prototype.inverseTransformX=function(a){var s=0,l=this.ldeviceExtX;return l!=0&&(s=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/l),s},i.prototype.inverseTransformY=function(a){var s=0,l=this.ldeviceExtY;return l!=0&&(s=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/l),s},i.prototype.inverseTransformPoint=function(a){var s=new n(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return s},t.exports=i},function(t,e,r){"use strict";function n(d){if(Array.isArray(d)){for(var p=0,m=Array(d.length);pa.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(d-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(d>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(d-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var d=this.getAllEdges(),p,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,g,y,v,x=this.getAllNodes(),b;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&d&&this.updateGrid(),b=new Set,m=0;mw||b>w)&&(d.gravitationForceX=-this.gravityConstant*y,d.gravitationForceY=-this.gravityConstant*v)):(w=p.getEstimatedSize()*this.compoundGravityRangeFactor,(x>w||b>w)&&(d.gravitationForceX=-this.gravityConstant*y*this.compoundGravityConstant,d.gravitationForceY=-this.gravityConstant*v*this.compoundGravityConstant))},h.prototype.isConverged=function(){var d,p=!1;return this.totalIterations>this.maxIterations/3&&(p=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),d=this.totalDisplacement=x.length||w>=x[0].length)){for(var S=0;Sh},"_defaultCompareFunction")}]),l}();t.exports=s},function(t,e,r){"use strict";var n=function(){function s(l,u){for(var h=0;h2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;i(this,s),this.sequence1=l,this.sequence2=u,this.match_score=h,this.mismatch_penalty=f,this.gap_penalty=d,this.iMax=l.length+1,this.jMax=u.length+1,this.grid=new Array(this.iMax);for(var p=0;p=0;l--){var u=this.listeners[l];u.event===a&&u.callback===s&&this.listeners.splice(l,1)}},i.emit=function(a,s){for(var l=0;l{"use strict";o(function(e,r){typeof ob=="object"&&typeof wB=="object"?wB.exports=r(bB()):typeof define=="function"&&define.amd?define(["layout-base"],r):typeof ob=="object"?ob.coseBase=r(bB()):e.coseBase=r(e.layoutBase)},"webpackUniversalModuleDefinition")(ob,function(t){return function(e){var r={};function n(i){if(r[i])return r[i].exports;var a=r[i]={i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return o(n,"__webpack_require__"),n.m=e,n.c=r,n.i=function(i){return i},n.d=function(i,a,s){n.o(i,a)||Object.defineProperty(i,a,{configurable:!1,enumerable:!0,get:s})},n.n=function(i){var a=i&&i.__esModule?o(function(){return i.default},"getDefault"):o(function(){return i},"getModuleExports");return n.d(a,"a",a),a},n.o=function(i,a){return Object.prototype.hasOwnProperty.call(i,a)},n.p="",n(n.s=7)}([function(e,r){e.exports=t},function(e,r,n){"use strict";var i=n(0).FDLayoutConstants;function a(){}o(a,"CoSEConstants");for(var s in i)a[s]=i[s];a.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,a.DEFAULT_RADIAL_SEPARATION=i.DEFAULT_EDGE_LENGTH,a.DEFAULT_COMPONENT_SEPERATION=60,a.TILE=!0,a.TILING_PADDING_VERTICAL=10,a.TILING_PADDING_HORIZONTAL=10,a.TREE_REDUCTION_ON_INCREMENTAL=!1,e.exports=a},function(e,r,n){"use strict";var i=n(0).FDLayoutEdge;function a(l,u,h){i.call(this,l,u,h)}o(a,"CoSEEdge"),a.prototype=Object.create(i.prototype);for(var s in i)a[s]=i[s];e.exports=a},function(e,r,n){"use strict";var i=n(0).LGraph;function a(l,u,h){i.call(this,l,u,h)}o(a,"CoSEGraph"),a.prototype=Object.create(i.prototype);for(var s in i)a[s]=i[s];e.exports=a},function(e,r,n){"use strict";var i=n(0).LGraphManager;function a(l){i.call(this,l)}o(a,"CoSEGraphManager"),a.prototype=Object.create(i.prototype);for(var s in i)a[s]=i[s];e.exports=a},function(e,r,n){"use strict";var i=n(0).FDLayoutNode,a=n(0).IMath;function s(u,h,f,d){i.call(this,u,h,f,d)}o(s,"CoSENode"),s.prototype=Object.create(i.prototype);for(var l in i)s[l]=i[l];s.prototype.move=function(){var u=this.graphManager.getLayout();this.displacementX=u.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=u.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>u.coolingFactor*u.maxNodeDisplacement&&(this.displacementX=u.coolingFactor*u.maxNodeDisplacement*a.sign(this.displacementX)),Math.abs(this.displacementY)>u.coolingFactor*u.maxNodeDisplacement&&(this.displacementY=u.coolingFactor*u.maxNodeDisplacement*a.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),u.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},s.prototype.propogateDisplacementToChildren=function(u,h){for(var f=this.getChild().getNodes(),d,p=0;p0)this.positionNodesRadially(T);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),_=this.nodesWithGravity.filter(function(A){return E.has(A)});this.graphManager.setAllNodesToApplyGravitation(_),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},w.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var T=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(L){return T.has(L)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var _=!this.isTreeGrowing&&!this.isGrowthFinished,A=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(_,A),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},w.prototype.getPositionsData=function(){for(var T=this.graphManager.getAllNodes(),E={},_=0;_1){var k;for(k=0;kA&&(A=Math.floor(N.y)),M=Math.floor(N.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(d.WORLD_CENTER_X-N.x/2,d.WORLD_CENTER_Y-N.y/2))},w.radialLayout=function(T,E,_){var A=Math.max(this.maxDiagonalInTree(T),h.DEFAULT_RADIAL_SEPARATION);w.branchRadialLayout(E,null,0,359,0,A);var L=x.calculateBounds(T),M=new b;M.setDeviceOrgX(L.getMinX()),M.setDeviceOrgY(L.getMinY()),M.setWorldOrgX(_.x),M.setWorldOrgY(_.y);for(var N=0;N1;){var Q=Y[0];Y.splice(0,1);var X=P.indexOf(Q);X>=0&&P.splice(X,1),$--,F--}E!=null?z=(P.indexOf(Y[0])+1)%$:z=0;for(var ie=Math.abs(A-_)/F,j=z;B!=F;j=++j%$){var J=P[j].getOtherEnd(T);if(J!=E){var Z=(_+B*ie)%360,H=(Z+ie)%360;w.branchRadialLayout(J,T,Z,H,L+M,M),B++}}},w.maxDiagonalInTree=function(T){for(var E=y.MIN_VALUE,_=0;_E&&(E=L)}return E},w.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},w.prototype.groupZeroDegreeMembers=function(){var T=this,E={};this.memberGroups={},this.idToDummyNode={};for(var _=[],A=this.graphManager.getAllNodes(),L=0;L"u"&&(E[k]=[]),E[k]=E[k].concat(M)}Object.keys(E).forEach(function(I){if(E[I].length>1){var C="DummyCompound_"+I;T.memberGroups[C]=E[I];var O=E[I][0].getParent(),D=new l(T.graphManager);D.id=C,D.paddingLeft=O.paddingLeft||0,D.paddingRight=O.paddingRight||0,D.paddingBottom=O.paddingBottom||0,D.paddingTop=O.paddingTop||0,T.idToDummyNode[C]=D;var P=T.getGraphManager().add(T.newGraph(),D),F=O.getChild();F.add(D);for(var B=0;B=0;T--){var E=this.compoundOrder[T],_=E.id,A=E.paddingLeft,L=E.paddingTop;this.adjustLocations(this.tiledMemberPack[_],E.rect.x,E.rect.y,A,L)}},w.prototype.repopulateZeroDegreeMembers=function(){var T=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(_){var A=T.idToDummyNode[_],L=A.paddingLeft,M=A.paddingTop;T.adjustLocations(E[_],A.rect.x,A.rect.y,L,M)})},w.prototype.getToBeTiled=function(T){var E=T.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var _=T.getChild();if(_==null)return this.toBeTiled[E]=!1,!1;for(var A=_.getNodes(),L=0;L0)return this.toBeTiled[E]=!1,!1;if(M.getChild()==null){this.toBeTiled[M.id]=!1;continue}if(!this.getToBeTiled(M))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},w.prototype.getNodeDegree=function(T){for(var E=T.id,_=T.getEdges(),A=0,L=0;L<_.length;L++){var M=_[L];M.getSource().id!==M.getTarget().id&&(A=A+1)}return A},w.prototype.getNodeDegreeWithChildren=function(T){var E=this.getNodeDegree(T);if(T.getChild()==null)return E;for(var _=T.getChild().getNodes(),A=0;A<_.length;A++){var L=_[A];E+=this.getNodeDegreeWithChildren(L)}return E},w.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},w.prototype.fillCompexOrderByDFS=function(T){for(var E=0;EI&&(I=O.rect.height)}_+=I+T.verticalPadding}},w.prototype.tileCompoundMembers=function(T,E){var _=this;this.tiledMemberPack=[],Object.keys(T).forEach(function(A){var L=E[A];_.tiledMemberPack[A]=_.tileNodes(T[A],L.paddingLeft+L.paddingRight),L.rect.width=_.tiledMemberPack[A].width,L.rect.height=_.tiledMemberPack[A].height})},w.prototype.tileNodes=function(T,E){var _=h.TILING_PADDING_VERTICAL,A=h.TILING_PADDING_HORIZONTAL,L={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:_,horizontalPadding:A};T.sort(function(k,I){return k.rect.width*k.rect.height>I.rect.width*I.rect.height?-1:k.rect.width*k.rect.height0&&(N+=T.horizontalPadding),T.rowWidth[_]=N,T.width0&&(k+=T.verticalPadding);var I=0;k>T.rowHeight[_]&&(I=T.rowHeight[_],T.rowHeight[_]=k,I=T.rowHeight[_]-I),T.height+=I,T.rows[_].push(E)},w.prototype.getShortestRowIndex=function(T){for(var E=-1,_=Number.MAX_VALUE,A=0;A_&&(E=A,_=T.rowWidth[A]);return E},w.prototype.canAddHorizontal=function(T,E,_){var A=this.getShortestRowIndex(T);if(A<0)return!0;var L=T.rowWidth[A];if(L+T.horizontalPadding+E<=T.width)return!0;var M=0;T.rowHeight[A]<_&&A>0&&(M=_+T.verticalPadding-T.rowHeight[A]);var N;T.width-L>=E+T.horizontalPadding?N=(T.height+M)/(L+E+T.horizontalPadding):N=(T.height+M)/T.width,M=_+T.verticalPadding;var k;return T.widthM&&E!=_){A.splice(-1,1),T.rows[_].push(L),T.rowWidth[E]=T.rowWidth[E]-M,T.rowWidth[_]=T.rowWidth[_]+M,T.width=T.rowWidth[instance.getLongestRowIndex(T)];for(var N=Number.MIN_VALUE,k=0;kN&&(N=A[k].height);E>0&&(N+=T.verticalPadding);var I=T.rowHeight[E]+T.rowHeight[_];T.rowHeight[E]=N,T.rowHeight[_]0)for(var F=L;F<=M;F++)P[0]+=this.grid[F][N-1].length+this.grid[F][N].length-1;if(M0)for(var F=N;F<=k;F++)P[3]+=this.grid[L-1][F].length+this.grid[L][F].length-1;for(var B=y.MAX_VALUE,$,z,Y=0;Y{"use strict";o(function(e,r){typeof lb=="object"&&typeof kB=="object"?kB.exports=r(TB()):typeof define=="function"&&define.amd?define(["cose-base"],r):typeof lb=="object"?lb.cytoscapeCoseBilkent=r(TB()):e.cytoscapeCoseBilkent=r(e.coseBase)},"webpackUniversalModuleDefinition")(lb,function(t){return function(e){var r={};function n(i){if(r[i])return r[i].exports;var a=r[i]={i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return o(n,"__webpack_require__"),n.m=e,n.c=r,n.i=function(i){return i},n.d=function(i,a,s){n.o(i,a)||Object.defineProperty(i,a,{configurable:!1,enumerable:!0,get:s})},n.n=function(i){var a=i&&i.__esModule?o(function(){return i.default},"getDefault"):o(function(){return i},"getModuleExports");return n.d(a,"a",a),a},n.o=function(i,a){return Object.prototype.hasOwnProperty.call(i,a)},n.p="",n(n.s=1)}([function(e,r){e.exports=t},function(e,r,n){"use strict";var i=n(0).layoutBase.LayoutConstants,a=n(0).layoutBase.FDLayoutConstants,s=n(0).CoSEConstants,l=n(0).CoSELayout,u=n(0).CoSENode,h=n(0).layoutBase.PointD,f=n(0).layoutBase.DimensionD,d={ready:o(function(){},"ready"),stop:o(function(){},"stop"),quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function p(v,x){var b={};for(var w in v)b[w]=v[w];for(var w in x)b[w]=x[w];return b}o(p,"extend");function m(v){this.options=p(d,v),g(this.options)}o(m,"_CoSELayout");var g=o(function(x){x.nodeRepulsion!=null&&(s.DEFAULT_REPULSION_STRENGTH=a.DEFAULT_REPULSION_STRENGTH=x.nodeRepulsion),x.idealEdgeLength!=null&&(s.DEFAULT_EDGE_LENGTH=a.DEFAULT_EDGE_LENGTH=x.idealEdgeLength),x.edgeElasticity!=null&&(s.DEFAULT_SPRING_STRENGTH=a.DEFAULT_SPRING_STRENGTH=x.edgeElasticity),x.nestingFactor!=null&&(s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=x.nestingFactor),x.gravity!=null&&(s.DEFAULT_GRAVITY_STRENGTH=a.DEFAULT_GRAVITY_STRENGTH=x.gravity),x.numIter!=null&&(s.MAX_ITERATIONS=a.MAX_ITERATIONS=x.numIter),x.gravityRange!=null&&(s.DEFAULT_GRAVITY_RANGE_FACTOR=a.DEFAULT_GRAVITY_RANGE_FACTOR=x.gravityRange),x.gravityCompound!=null&&(s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=x.gravityCompound),x.gravityRangeCompound!=null&&(s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=x.gravityRangeCompound),x.initialEnergyOnIncremental!=null&&(s.DEFAULT_COOLING_FACTOR_INCREMENTAL=a.DEFAULT_COOLING_FACTOR_INCREMENTAL=x.initialEnergyOnIncremental),x.quality=="draft"?i.QUALITY=0:x.quality=="proof"?i.QUALITY=2:i.QUALITY=1,s.NODE_DIMENSIONS_INCLUDE_LABELS=a.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=x.nodeDimensionsIncludeLabels,s.DEFAULT_INCREMENTAL=a.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=!x.randomize,s.ANIMATE=a.ANIMATE=i.ANIMATE=x.animate,s.TILE=x.tile,s.TILING_PADDING_VERTICAL=typeof x.tilingPaddingVertical=="function"?x.tilingPaddingVertical.call():x.tilingPaddingVertical,s.TILING_PADDING_HORIZONTAL=typeof x.tilingPaddingHorizontal=="function"?x.tilingPaddingHorizontal.call():x.tilingPaddingHorizontal},"getUserOptions");m.prototype.run=function(){var v,x,b=this.options,w=this.idToLNode={},S=this.layout=new l,T=this;T.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var E=S.newGraphManager();this.gm=E;var _=this.options.eles.nodes(),A=this.options.eles.edges();this.root=E.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(_),S);for(var L=0;L0){var k;k=b.getGraphManager().add(b.newGraph(),_),this.processChildrenList(k,E,b)}}},m.prototype.stop=function(){return this.stopped=!0,this};var y=o(function(x){x("layout","cose-bilkent",m)},"register");typeof cytoscape<"u"&&y(cytoscape),e.exports=y}])})});function fZe(t,e,r,n,i){return t.insert("polygon",":first-child").attr("points",n.map(function(a){return a.x+","+a.y}).join(" ")).attr("transform","translate("+(i.width-e)/2+", "+r+")")}var sZe,oZe,lZe,cZe,uZe,hZe,dZe,pZe,sge,oge,lge=R(()=>{"use strict";Al();xr();sZe=12,oZe=o(function(t,e,r,n){e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 ${r.height-5} v${-r.height+2*5} q0,-5 5,-5 h${r.width-2*5} q5,0 5,5 v${r.height-5} H0 Z`),e.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",r.height).attr("x2",r.width).attr("y2",r.height)},"defaultBkg"),lZe=o(function(t,e,r){e.append("rect").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("height",r.height).attr("width",r.width)},"rectBkg"),cZe=o(function(t,e,r){let n=r.width,i=r.height,a=.15*n,s=.25*n,l=.35*n,u=.2*n;e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 0 a${a},${a} 0 0,1 ${n*.25},${-1*n*.1} + a${l},${l} 1 0,1 ${n*.4},${-1*n*.1} + a${s},${s} 1 0,1 ${n*.35},${1*n*.2} + + a${a},${a} 1 0,1 ${n*.15},${1*i*.35} + a${u},${u} 1 0,1 ${-1*n*.15},${1*i*.65} + + a${s},${a} 1 0,1 ${-1*n*.25},${n*.15} + a${l},${l} 1 0,1 ${-1*n*.5},0 + a${a},${a} 1 0,1 ${-1*n*.25},${-1*n*.15} + + a${a},${a} 1 0,1 ${-1*n*.1},${-1*i*.35} + a${u},${u} 1 0,1 ${n*.1},${-1*i*.65} + + H0 V0 Z`)},"cloudBkg"),uZe=o(function(t,e,r){let n=r.width,i=r.height,a=.15*n;e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 0 a${a},${a} 1 0,0 ${n*.25},${-1*i*.1} + a${a},${a} 1 0,0 ${n*.25},0 + a${a},${a} 1 0,0 ${n*.25},0 + a${a},${a} 1 0,0 ${n*.25},${1*i*.1} + + a${a},${a} 1 0,0 ${n*.15},${1*i*.33} + a${a*.8},${a*.8} 1 0,0 0,${1*i*.34} + a${a},${a} 1 0,0 ${-1*n*.15},${1*i*.33} + + a${a},${a} 1 0,0 ${-1*n*.25},${i*.15} + a${a},${a} 1 0,0 ${-1*n*.25},0 + a${a},${a} 1 0,0 ${-1*n*.25},0 + a${a},${a} 1 0,0 ${-1*n*.25},${-1*i*.15} + + a${a},${a} 1 0,0 ${-1*n*.1},${-1*i*.33} + a${a*.8},${a*.8} 1 0,0 0,${-1*i*.34} + a${a},${a} 1 0,0 ${n*.1},${-1*i*.33} + + H0 V0 Z`)},"bangBkg"),hZe=o(function(t,e,r){e.append("circle").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("r",r.width/2)},"circleBkg");o(fZe,"insertPolygonShape");dZe=o(function(t,e,r){let n=r.height,a=n/4,s=r.width-r.padding+2*a,l=[{x:a,y:0},{x:s-a,y:0},{x:s,y:-n/2},{x:s-a,y:-n},{x:a,y:-n},{x:0,y:-n/2}];fZe(e,s,n,l,r)},"hexagonBkg"),pZe=o(function(t,e,r){e.append("rect").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("height",r.height).attr("rx",r.padding).attr("ry",r.padding).attr("width",r.width)},"roundedRectBkg"),sge=o(async function(t,e,r,n,i){let a=i.htmlLabels,s=n%(sZe-1),l=e.append("g");r.section=s;let u="section-"+s;s<0&&(u+=" section-root"),l.attr("class",(r.class?r.class+" ":"")+"mindmap-node "+u);let h=l.append("g"),f=l.append("g"),d=r.descr.replace(/()/g,` +`);await ta(f,d,{useHtmlLabels:a,width:r.width,classes:"mindmap-node-label"},i),a||f.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");let p=f.node().getBBox(),[m]=mc(i.fontSize);if(r.height=p.height+m*1.1*.5+r.padding,r.width=p.width+2*r.padding,r.icon)if(r.type===t.nodeType.CIRCLE)r.height+=50,r.width+=50,l.append("foreignObject").attr("height","50px").attr("width",r.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+s+" "+r.icon),f.attr("transform","translate("+r.width/2+", "+(r.height/2-1.5*r.padding)+")");else{r.width+=50;let g=r.height;r.height=Math.max(g,60);let y=Math.abs(r.height-g);l.append("foreignObject").attr("width","60px").attr("height",r.height).attr("style","text-align: center;margin-top:"+y/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+s+" "+r.icon),f.attr("transform","translate("+(25+r.width/2)+", "+(y/2+r.padding/2)+")")}else if(a){let g=(r.width-p.width)/2,y=(r.height-p.height)/2;f.attr("transform","translate("+g+", "+y+")")}else{let g=r.width/2,y=r.padding/2;f.attr("transform","translate("+g+", "+y+")")}switch(r.type){case t.nodeType.DEFAULT:oZe(t,h,r,s);break;case t.nodeType.ROUNDED_RECT:pZe(t,h,r,s);break;case t.nodeType.RECT:lZe(t,h,r,s);break;case t.nodeType.CIRCLE:h.attr("transform","translate("+r.width/2+", "+ +r.height/2+")"),hZe(t,h,r,s);break;case t.nodeType.CLOUD:cZe(t,h,r,s);break;case t.nodeType.BANG:uZe(t,h,r,s);break;case t.nodeType.HEXAGON:dZe(t,h,r,s);break}return t.setElementForId(r.id,l),r.height},"drawNode"),oge=o(function(t,e){let r=t.getElementById(e.id),n=e.x||0,i=e.y||0;r.attr("transform","translate("+n+","+i+")")},"positionNode")});async function uge(t,e,r,n,i){await sge(t,e,r,n,i),r.children&&await Promise.all(r.children.map((a,s)=>uge(t,e,a,n<0?s:n,i)))}function mZe(t,e){e.edges().map((r,n)=>{let i=r.data();if(r[0]._private.bodyBounds){let a=r[0]._private.rscratch;V.trace("Edge: ",n,i),t.insert("path").attr("d",`M ${a.startX},${a.startY} L ${a.midX},${a.midY} L${a.endX},${a.endY} `).attr("class","edge section-edge-"+i.section+" edge-depth-"+i.depth)}})}function hge(t,e,r,n){e.add({group:"nodes",data:{id:t.id.toString(),labelText:t.descr,height:t.height,width:t.width,level:n,nodeId:t.id,padding:t.padding,type:t.type},position:{x:t.x,y:t.y}}),t.children&&t.children.forEach(i=>{hge(i,e,r,n+1),e.add({group:"edges",data:{id:`${t.id}_${i.id}`,source:t.id,target:i.id,depth:n,section:i.section}})})}function gZe(t,e){return new Promise(r=>{let n=$e("body").append("div").attr("id","cy").attr("style","display:none"),i=rl({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});n.remove(),hge(t,i,e,0),i.nodes().forEach(function(a){a.layoutDimensions=()=>{let s=a.data();return{w:s.width,h:s.height}}}),i.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),i.ready(a=>{V.info("Ready",a),r(i)})})}function yZe(t,e){e.nodes().map((r,n)=>{let i=r.data();i.x=r.position().x,i.y=r.position().y,oge(t,i);let a=t.getElementById(i.nodeId);V.info("Id:",n,"Position: (",r.position().x,", ",r.position().y,")",i),a.attr("transform",`translate(${r.position().x-i.width/2}, ${r.position().y-i.height/2})`),a.attr("attr",`apa-${n})`)})}var cge,vZe,fge,dge=R(()=>{"use strict";vB();cge=Xi(age(),1);Zt();_t();ut();pf();Yn();lge();sl();rl.use(cge.default);o(uge,"drawNodes");o(mZe,"drawEdges");o(hge,"addNodes");o(gZe,"layoutMindmap");o(yZe,"positionNodes");vZe=o(async(t,e,r,n)=>{V.debug(`Rendering mindmap diagram +`+t);let i=n.db,a=i.getMindmap();if(!a)return;let s=de();s.htmlLabels=!1;let l=Ps(e),u=l.append("g");u.attr("class","mindmap-edges");let h=l.append("g");h.attr("class","mindmap-nodes"),await uge(i,h,a,-1,s);let f=await gZe(a,s);mZe(u,f),yZe(i,f),Lo(void 0,l,s.mindmap?.padding??mr.mindmap.padding,s.mindmap?.useMaxWidth??mr.mindmap.useMaxWidth)},"draw"),fge={draw:vZe}});var xZe,bZe,pge,mge=R(()=>{"use strict";al();xZe=o(t=>{let e="";for(let r=0;r` + `}return e},"genSections"),bZe=o(t=>` .edge { stroke-width: 3; } - ${eVt(i)} + ${xZe(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { - fill: ${i.git0}; + fill: ${t.git0}; } .section-root text { - fill: ${i.gitBranchLabel0}; + fill: ${t.gitBranchLabel0}; } .icon-container { height:100%; @@ -1618,4 +1921,266 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) dominant-baseline: middle; text-align: center; } -`}},Symbol.toStringTag,{value:"Module"}));return O2}); +`,"getStyles"),pge=bZe});var gge={};hr(gge,{diagram:()=>wZe});var wZe,yge=R(()=>{"use strict";r0e();a0e();dge();mge();wZe={db:i0e,renderer:fge,parser:t0e,styles:pge}});var EB,cb,bge=R(()=>{"use strict";EB=function(){var t=o(function(l,u,h,f){for(h=h||{},f=l.length;f--;h[l[f]]=u);return h},"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:o(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:o(function(u,h,f,d,p,m,g){var y=m.length-1;switch(p){case 7:let v=d.findOrCreateNode(m[y-4].trim().replaceAll('""','"')),x=d.findOrCreateNode(m[y-2].trim().replaceAll('""','"')),b=parseFloat(m[y].trim());d.addLink(v,x,b);break;case 8:case 9:case 11:this.$=m[y];break;case 10:this.$=m[y-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:e,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(n,[2,8]),t(n,[2,9]),{19:[1,16]},t(n,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:r},{15:18,16:7,17:8,18:e,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(n,[2,10]),{15:21,16:7,17:8,18:e,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:o(function(u,h){if(h.recoverable)this.trace(u);else{var f=new Error(u);throw f.hash=h,f}},"parseError"),parse:o(function(u){var h=this,f=[0],d=[],p=[null],m=[],g=this.table,y="",v=0,x=0,b=0,w=2,S=1,T=m.slice.call(arguments,1),E=Object.create(this.lexer),_={yy:{}};for(var A in this.yy)Object.prototype.hasOwnProperty.call(this.yy,A)&&(_.yy[A]=this.yy[A]);E.setInput(u,_.yy),_.yy.lexer=E,_.yy.parser=this,typeof E.yylloc>"u"&&(E.yylloc={});var L=E.yylloc;m.push(L);var M=E.options&&E.options.ranges;typeof _.yy.parseError=="function"?this.parseError=_.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function N(ie){f.length=f.length-2*ie,p.length=p.length-ie,m.length=m.length-ie}o(N,"popStack");function k(){var ie;return ie=d.pop()||E.lex()||S,typeof ie!="number"&&(ie instanceof Array&&(d=ie,ie=d.pop()),ie=h.symbols_[ie]||ie),ie}o(k,"lex");for(var I,C,O,D,P,F,B={},$,z,Y,Q;;){if(O=f[f.length-1],this.defaultActions[O]?D=this.defaultActions[O]:((I===null||typeof I>"u")&&(I=k()),D=g[O]&&g[O][I]),typeof D>"u"||!D.length||!D[0]){var X="";Q=[];for($ in g[O])this.terminals_[$]&&$>w&&Q.push("'"+this.terminals_[$]+"'");E.showPosition?X="Parse error on line "+(v+1)+`: +`+E.showPosition()+` +Expecting `+Q.join(", ")+", got '"+(this.terminals_[I]||I)+"'":X="Parse error on line "+(v+1)+": Unexpected "+(I==S?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(X,{text:E.match,token:this.terminals_[I]||I,line:E.yylineno,loc:L,expected:Q})}if(D[0]instanceof Array&&D.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+I);switch(D[0]){case 1:f.push(I),p.push(E.yytext),m.push(E.yylloc),f.push(D[1]),I=null,C?(I=C,C=null):(x=E.yyleng,y=E.yytext,v=E.yylineno,L=E.yylloc,b>0&&b--);break;case 2:if(z=this.productions_[D[1]][1],B.$=p[p.length-z],B._$={first_line:m[m.length-(z||1)].first_line,last_line:m[m.length-1].last_line,first_column:m[m.length-(z||1)].first_column,last_column:m[m.length-1].last_column},M&&(B._$.range=[m[m.length-(z||1)].range[0],m[m.length-1].range[1]]),F=this.performAction.apply(B,[y,x,v,_.yy,D[1],p,m].concat(T)),typeof F<"u")return F;z&&(f=f.slice(0,-1*z*2),p=p.slice(0,-1*z),m=m.slice(0,-1*z)),f.push(this.productions_[D[1]][0]),p.push(B.$),m.push(B._$),Y=g[f[f.length-2]][f[f.length-1]],f.push(Y);break;case 3:return!0}}return!0},"parse")},a=function(){var l={EOF:1,parseError:o(function(h,f){if(this.yy.parser)this.yy.parser.parseError(h,f);else throw new Error(h)},"parseError"),setInput:o(function(u,h){return this.yy=h||this.yy||{},this._input=u,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var u=this._input[0];this.yytext+=u,this.yyleng++,this.offset++,this.match+=u,this.matched+=u;var h=u.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),u},"input"),unput:o(function(u){var h=u.length,f=u.split(/(?:\r\n?|\n)/g);this._input=u+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var d=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),f.length-1&&(this.yylineno-=f.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:f?(f.length===d.length?this.yylloc.first_column:0)+d[d.length-f.length].length-f[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(u){this.unput(this.match.slice(u))},"less"),pastInput:o(function(){var u=this.matched.substr(0,this.matched.length-this.match.length);return(u.length>20?"...":"")+u.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var u=this.match;return u.length<20&&(u+=this._input.substr(0,20-u.length)),(u.substr(0,20)+(u.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var u=this.pastInput(),h=new Array(u.length+1).join("-");return u+this.upcomingInput()+` +`+h+"^"},"showPosition"),test_match:o(function(u,h){var f,d,p;if(this.options.backtrack_lexer&&(p={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},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),d=u[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+u[0].length},this.yytext+=u[0],this.match+=u[0],this.matches=u,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(u[0].length),this.matched+=u[0],f=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)return f;if(this._backtrack){for(var m in p)this[m]=p[m];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var u,h,f,d;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),m=0;mh[0].length)){if(h=f,d=m,this.options.backtrack_lexer){if(u=this.test_match(f,p[m]),u!==!1)return u;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(u=this.test_match(h,p[d]),u!==!1?u:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var h=this.next();return h||this.lex()},"lex"),begin:o(function(h){this.conditionStack.push(h)},"begin"),popState:o(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:o(function(h){this.begin(h)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(h,f,d,p){var m=p;switch(d){case 0:return this.pushState("csv"),4;break;case 1:return 10;case 2:return 5;case 3:return 12;case 4:return this.pushState("escaped_text"),18;break;case 5:return 20;case 6:return this.popState("escaped_text"),18;break;case 7:return 19}},"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:!1},escaped_text:{rules:[6,7],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return l}();i.lexer=a;function s(){this.yy={}}return o(s,"Parser"),s.prototype=i,i.Parser=s,new s}();EB.parser=EB;cb=EB});var J6,eC,Z6,CZe,CB,SZe,SB,AZe,_Ze,LZe,DZe,wge,Tge=R(()=>{"use strict";_t();rr();bi();J6=[],eC=[],Z6=new Map,CZe=o(()=>{J6=[],eC=[],Z6=new Map,vr()},"clear"),CB=class{constructor(e,r,n=0){this.source=e;this.target=r;this.value=n}static{o(this,"SankeyLink")}},SZe=o((t,e,r)=>{J6.push(new CB(t,e,r))},"addLink"),SB=class{constructor(e){this.ID=e}static{o(this,"SankeyNode")}},AZe=o(t=>{t=We.sanitizeText(t,de());let e=Z6.get(t);return e===void 0&&(e=new SB(t),Z6.set(t,e),eC.push(e)),e},"findOrCreateNode"),_Ze=o(()=>eC,"getNodes"),LZe=o(()=>J6,"getLinks"),DZe=o(()=>({nodes:eC.map(t=>({id:t.ID})),links:J6.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),wge={nodesMap:Z6,getConfig:o(()=>de().sankey,"getConfig"),getNodes:_Ze,getLinks:LZe,getGraph:DZe,addLink:SZe,findOrCreateNode:AZe,getAccTitle:Ar,setAccTitle:kr,getAccDescription:Lr,setAccDescription:_r,getDiagramTitle:Xr,setDiagramTitle:nn,clear:CZe}});function ub(t,e){let r;if(e===void 0)for(let n of t)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}var kge=R(()=>{"use strict";o(ub,"max")});function x1(t,e){let r;if(e===void 0)for(let n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}var Ege=R(()=>{"use strict";o(x1,"min")});function b1(t,e){let r=0;if(e===void 0)for(let n of t)(n=+n)&&(r+=n);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&(r+=i)}return r}var Cge=R(()=>{"use strict";o(b1,"sum")});var AB=R(()=>{"use strict";kge();Ege();Cge()});function RZe(t){return t.target.depth}function _B(t){return t.depth}function LB(t,e){return e-1-t.height}function hb(t,e){return t.sourceLinks.length?t.depth:e-1}function DB(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?x1(t.sourceLinks,RZe)-1:0}var RB=R(()=>{"use strict";AB();o(RZe,"targetDepth");o(_B,"left");o(LB,"right");o(hb,"justify");o(DB,"center")});function w1(t){return function(){return t}}var Sge=R(()=>{"use strict";o(w1,"constant")});function Age(t,e){return tC(t.source,e.source)||t.index-e.index}function _ge(t,e){return tC(t.target,e.target)||t.index-e.index}function tC(t,e){return t.y0-e.y0}function NB(t){return t.value}function NZe(t){return t.index}function MZe(t){return t.nodes}function IZe(t){return t.links}function Lge(t,e){let r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function Dge({nodes:t}){for(let e of t){let r=e.y0,n=r;for(let i of e.sourceLinks)i.y0=r+i.width/2,r+=i.width;for(let i of e.targetLinks)i.y1=n+i.width/2,n+=i.width}}function rC(){let t=0,e=0,r=1,n=1,i=24,a=8,s,l=NZe,u=hb,h,f,d=MZe,p=IZe,m=6;function g(){let O={nodes:d.apply(null,arguments),links:p.apply(null,arguments)};return y(O),v(O),x(O),b(O),T(O),Dge(O),O}o(g,"sankey"),g.update=function(O){return Dge(O),O},g.nodeId=function(O){return arguments.length?(l=typeof O=="function"?O:w1(O),g):l},g.nodeAlign=function(O){return arguments.length?(u=typeof O=="function"?O:w1(O),g):u},g.nodeSort=function(O){return arguments.length?(h=O,g):h},g.nodeWidth=function(O){return arguments.length?(i=+O,g):i},g.nodePadding=function(O){return arguments.length?(a=s=+O,g):a},g.nodes=function(O){return arguments.length?(d=typeof O=="function"?O:w1(O),g):d},g.links=function(O){return arguments.length?(p=typeof O=="function"?O:w1(O),g):p},g.linkSort=function(O){return arguments.length?(f=O,g):f},g.size=function(O){return arguments.length?(t=e=0,r=+O[0],n=+O[1],g):[r-t,n-e]},g.extent=function(O){return arguments.length?(t=+O[0][0],r=+O[1][0],e=+O[0][1],n=+O[1][1],g):[[t,e],[r,n]]},g.iterations=function(O){return arguments.length?(m=+O,g):m};function y({nodes:O,links:D}){for(let[F,B]of O.entries())B.index=F,B.sourceLinks=[],B.targetLinks=[];let P=new Map(O.map((F,B)=>[l(F,B,O),F]));for(let[F,B]of D.entries()){B.index=F;let{source:$,target:z}=B;typeof $!="object"&&($=B.source=Lge(P,$)),typeof z!="object"&&(z=B.target=Lge(P,z)),$.sourceLinks.push(B),z.targetLinks.push(B)}if(f!=null)for(let{sourceLinks:F,targetLinks:B}of O)F.sort(f),B.sort(f)}o(y,"computeNodeLinks");function v({nodes:O}){for(let D of O)D.value=D.fixedValue===void 0?Math.max(b1(D.sourceLinks,NB),b1(D.targetLinks,NB)):D.fixedValue}o(v,"computeNodeValues");function x({nodes:O}){let D=O.length,P=new Set(O),F=new Set,B=0;for(;P.size;){for(let $ of P){$.depth=B;for(let{target:z}of $.sourceLinks)F.add(z)}if(++B>D)throw new Error("circular link");P=F,F=new Set}}o(x,"computeNodeDepths");function b({nodes:O}){let D=O.length,P=new Set(O),F=new Set,B=0;for(;P.size;){for(let $ of P){$.height=B;for(let{source:z}of $.targetLinks)F.add(z)}if(++B>D)throw new Error("circular link");P=F,F=new Set}}o(b,"computeNodeHeights");function w({nodes:O}){let D=ub(O,B=>B.depth)+1,P=(r-t-i)/(D-1),F=new Array(D);for(let B of O){let $=Math.max(0,Math.min(D-1,Math.floor(u.call(null,B,D))));B.layer=$,B.x0=t+$*P,B.x1=B.x0+i,F[$]?F[$].push(B):F[$]=[B]}if(h)for(let B of F)B.sort(h);return F}o(w,"computeNodeLayers");function S(O){let D=x1(O,P=>(n-e-(P.length-1)*s)/b1(P,NB));for(let P of O){let F=e;for(let B of P){B.y0=F,B.y1=F+B.value*D,F=B.y1+s;for(let $ of B.sourceLinks)$.width=$.value*D}F=(n-F+s)/(P.length+1);for(let B=0;BP.length)-1)),S(D);for(let P=0;P0))continue;let X=(Y/Q-z.y0)*D;z.y0+=X,z.y1+=X,N(z)}h===void 0&&$.sort(tC),A($,P)}}o(E,"relaxLeftToRight");function _(O,D,P){for(let F=O.length,B=F-2;B>=0;--B){let $=O[B];for(let z of $){let Y=0,Q=0;for(let{target:ie,value:j}of z.sourceLinks){let J=j*(ie.layer-z.layer);Y+=C(z,ie)*J,Q+=J}if(!(Q>0))continue;let X=(Y/Q-z.y0)*D;z.y0+=X,z.y1+=X,N(z)}h===void 0&&$.sort(tC),A($,P)}}o(_,"relaxRightToLeft");function A(O,D){let P=O.length>>1,F=O[P];M(O,F.y0-s,P-1,D),L(O,F.y1+s,P+1,D),M(O,n,O.length-1,D),L(O,e,0,D)}o(A,"resolveCollisions");function L(O,D,P,F){for(;P1e-6&&(B.y0+=$,B.y1+=$),D=B.y1+s}}o(L,"resolveCollisionsTopToBottom");function M(O,D,P,F){for(;P>=0;--P){let B=O[P],$=(B.y1-D)*F;$>1e-6&&(B.y0-=$,B.y1-=$),D=B.y0-s}}o(M,"resolveCollisionsBottomToTop");function N({sourceLinks:O,targetLinks:D}){if(f===void 0){for(let{source:{sourceLinks:P}}of D)P.sort(_ge);for(let{target:{targetLinks:P}}of O)P.sort(Age)}}o(N,"reorderNodeLinks");function k(O){if(f===void 0)for(let{sourceLinks:D,targetLinks:P}of O)D.sort(_ge),P.sort(Age)}o(k,"reorderLinks");function I(O,D){let P=O.y0-(O.sourceLinks.length-1)*s/2;for(let{target:F,width:B}of O.sourceLinks){if(F===D)break;P+=B+s}for(let{source:F,width:B}of D.targetLinks){if(F===O)break;P-=B}return P}o(I,"targetTop");function C(O,D){let P=D.y0-(D.targetLinks.length-1)*s/2;for(let{source:F,width:B}of D.targetLinks){if(F===O)break;P+=B+s}for(let{target:F,width:B}of O.sourceLinks){if(F===D)break;P-=B}return P}return o(C,"sourceTop"),g}var Rge=R(()=>{"use strict";AB();RB();Sge();o(Age,"ascendingSourceBreadth");o(_ge,"ascendingTargetBreadth");o(tC,"ascendingBreadth");o(NB,"value");o(NZe,"defaultId");o(MZe,"defaultNodes");o(IZe,"defaultLinks");o(Lge,"find");o(Dge,"computeLinkBreadths");o(rC,"Sankey")});function OB(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Nge(){return new OB}var MB,IB,Q0,OZe,PB,Mge=R(()=>{"use strict";MB=Math.PI,IB=2*MB,Q0=1e-6,OZe=IB-Q0;o(OB,"Path");o(Nge,"path");OB.prototype=Nge.prototype={constructor:OB,moveTo:o(function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},"moveTo"),closePath:o(function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},"closePath"),lineTo:o(function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},"lineTo"),quadraticCurveTo:o(function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},"quadraticCurveTo"),bezierCurveTo:o(function(t,e,r,n,i,a){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},"bezierCurveTo"),arcTo:o(function(t,e,r,n,i){t=+t,e=+e,r=+r,n=+n,i=+i;var a=this._x1,s=this._y1,l=r-t,u=n-e,h=a-t,f=s-e,d=h*h+f*f;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(d>Q0)if(!(Math.abs(f*l-u*h)>Q0)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var p=r-a,m=n-s,g=l*l+u*u,y=p*p+m*m,v=Math.sqrt(g),x=Math.sqrt(d),b=i*Math.tan((MB-Math.acos((g+d-y)/(2*v*x)))/2),w=b/x,S=b/v;Math.abs(w-1)>Q0&&(this._+="L"+(t+w*h)+","+(e+w*f)),this._+="A"+i+","+i+",0,0,"+ +(f*p>h*m)+","+(this._x1=t+S*l)+","+(this._y1=e+S*u)}},"arcTo"),arc:o(function(t,e,r,n,i,a){t=+t,e=+e,r=+r,a=!!a;var s=r*Math.cos(n),l=r*Math.sin(n),u=t+s,h=e+l,f=1^a,d=a?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+u+","+h:(Math.abs(this._x1-u)>Q0||Math.abs(this._y1-h)>Q0)&&(this._+="L"+u+","+h),r&&(d<0&&(d=d%IB+IB),d>OZe?this._+="A"+r+","+r+",0,1,"+f+","+(t-s)+","+(e-l)+"A"+r+","+r+",0,1,"+f+","+(this._x1=u)+","+(this._y1=h):d>Q0&&(this._+="A"+r+","+r+",0,"+ +(d>=MB)+","+f+","+(this._x1=t+r*Math.cos(i))+","+(this._y1=e+r*Math.sin(i))))},"arc"),rect:o(function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},"rect"),toString:o(function(){return this._},"toString")};PB=Nge});var Ige=R(()=>{"use strict";Mge()});function nC(t){return o(function(){return t},"constant")}var Oge=R(()=>{"use strict";o(nC,"default")});function Pge(t){return t[0]}function Bge(t){return t[1]}var Fge=R(()=>{"use strict";o(Pge,"x");o(Bge,"y")});var zge,Gge=R(()=>{"use strict";zge=Array.prototype.slice});function PZe(t){return t.source}function BZe(t){return t.target}function FZe(t){var e=PZe,r=BZe,n=Pge,i=Bge,a=null;function s(){var l,u=zge.call(arguments),h=e.apply(this,u),f=r.apply(this,u);if(a||(a=l=PB()),t(a,+n.apply(this,(u[0]=h,u)),+i.apply(this,u),+n.apply(this,(u[0]=f,u)),+i.apply(this,u)),l)return a=null,l+""||null}return o(s,"link"),s.source=function(l){return arguments.length?(e=l,s):e},s.target=function(l){return arguments.length?(r=l,s):r},s.x=function(l){return arguments.length?(n=typeof l=="function"?l:nC(+l),s):n},s.y=function(l){return arguments.length?(i=typeof l=="function"?l:nC(+l),s):i},s.context=function(l){return arguments.length?(a=l??null,s):a},s}function zZe(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function BB(){return FZe(zZe)}var $ge=R(()=>{"use strict";Ige();Gge();Oge();Fge();o(PZe,"linkSource");o(BZe,"linkTarget");o(FZe,"link");o(zZe,"curveHorizontal");o(BB,"linkHorizontal")});var Vge=R(()=>{"use strict";$ge()});function GZe(t){return[t.source.x1,t.y0]}function $Ze(t){return[t.target.x0,t.y1]}function iC(){return BB().source(GZe).target($Ze)}var Uge=R(()=>{"use strict";Vge();o(GZe,"horizontalSource");o($Ze,"horizontalTarget");o(iC,"default")});var Hge=R(()=>{"use strict";Rge();RB();Uge()});var fb,Yge=R(()=>{"use strict";fb=class t{static{o(this,"Uid")}static{this.count=0}static next(e){return new t(e+ ++t.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}}});var VZe,UZe,Wge,qge=R(()=>{"use strict";_t();Zt();Hge();Yn();Yge();VZe={left:_B,right:LB,center:DB,justify:hb},UZe=o(function(t,e,r,n){let{securityLevel:i,sankey:a}=de(),s=_4.sankey,l;i==="sandbox"&&(l=$e("#i"+e));let u=i==="sandbox"?$e(l.nodes()[0].contentDocument.body):$e("body"),h=i==="sandbox"?u.select(`[id="${e}"]`):$e(`[id="${e}"]`),f=a?.width??s.width,d=a?.height??s.width,p=a?.useMaxWidth??s.useMaxWidth,m=a?.nodeAlignment??s.nodeAlignment,g=a?.prefix??s.prefix,y=a?.suffix??s.suffix,v=a?.showValues??s.showValues,x=n.db.getGraph(),b=VZe[m];rC().nodeId(M=>M.id).nodeWidth(10).nodePadding(10+(v?15:0)).nodeAlign(b).extent([[0,0],[f,d]])(x);let T=pu(Z8);h.append("g").attr("class","nodes").selectAll(".node").data(x.nodes).join("g").attr("class","node").attr("id",M=>(M.uid=fb.next("node-")).id).attr("transform",function(M){return"translate("+M.x0+","+M.y0+")"}).attr("x",M=>M.x0).attr("y",M=>M.y0).append("rect").attr("height",M=>M.y1-M.y0).attr("width",M=>M.x1-M.x0).attr("fill",M=>T(M.id));let E=o(({id:M,value:N})=>v?`${M} +${g}${Math.round(N*100)/100}${y}`:M,"getText");h.append("g").attr("class","node-labels").attr("font-family","sans-serif").attr("font-size",14).selectAll("text").data(x.nodes).join("text").attr("x",M=>M.x0(M.y1+M.y0)/2).attr("dy",`${v?"0":"0.35"}em`).attr("text-anchor",M=>M.x0(N.uid=fb.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",N=>N.source.x1).attr("x2",N=>N.target.x0);M.append("stop").attr("offset","0%").attr("stop-color",N=>T(N.source.id)),M.append("stop").attr("offset","100%").attr("stop-color",N=>T(N.target.id))}let L;switch(A){case"gradient":L=o(M=>M.uid,"coloring");break;case"source":L=o(M=>T(M.source.id),"coloring");break;case"target":L=o(M=>T(M.target.id),"coloring");break;default:L=A}_.append("path").attr("d",iC()).attr("stroke",L).attr("stroke-width",M=>Math.max(1,M.width)),Lo(void 0,h,0,p)},"draw"),Wge={draw:UZe}});var Xge,jge=R(()=>{"use strict";Xge=o(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` +`).trim(),"prepareTextForParsing")});var Kge={};hr(Kge,{diagram:()=>YZe});var HZe,YZe,Qge=R(()=>{"use strict";bge();Tge();qge();jge();HZe=cb.parse.bind(cb);cb.parse=t=>HZe(Xge(t));YZe={parser:cb,db:wge,renderer:Wge}});var e1e,FB,jZe,KZe,QZe,ZZe,JZe,Mf,zB=R(()=>{"use strict";qs();sl();xr();bi();e1e={packet:[]},FB=structuredClone(e1e),jZe=mr.packet,KZe=o(()=>{let t=Ts({...jZe,...Or().packet});return t.showBits&&(t.paddingY+=10),t},"getConfig"),QZe=o(()=>FB.packet,"getPacket"),ZZe=o(t=>{t.length>0&&FB.packet.push(t)},"pushWord"),JZe=o(()=>{vr(),FB=structuredClone(e1e)},"clear"),Mf={pushWord:ZZe,getPacket:QZe,getConfig:KZe,clear:JZe,setAccTitle:kr,getAccTitle:Ar,setDiagramTitle:nn,getDiagramTitle:Xr,getAccDescription:Lr,setAccDescription:_r}});var eJe,tJe,rJe,t1e,r1e=R(()=>{"use strict";Lg();ut();sx();zB();eJe=1e4,tJe=o(t=>{cf(t,Mf);let e=-1,r=[],n=1,{bitsPerRow:i}=Mf.getConfig();for(let{start:a,end:s,label:l}of t.blocks){if(s&&s{if(t.end===void 0&&(t.end=t.start),t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);return t.end+1<=e*r?[t,void 0]:[{start:t.start,end:e*r-1,label:t.label},{start:e*r,end:t.end,label:t.label}]},"getNextFittingBlock"),t1e={parse:o(async t=>{let e=await Fl("packet",t);V.debug(e),tJe(e)},"parse")}});var nJe,iJe,n1e,i1e=R(()=>{"use strict";pf();Yn();nJe=o((t,e,r,n)=>{let i=n.db,a=i.getConfig(),{rowHeight:s,paddingY:l,bitWidth:u,bitsPerRow:h}=a,f=i.getPacket(),d=i.getDiagramTitle(),p=s+l,m=p*(f.length+1)-(d?0:s),g=u*h+2,y=Ps(e);y.attr("viewbox",`0 0 ${g} ${m}`),Sr(y,m,g,a.useMaxWidth);for(let[v,x]of f.entries())iJe(y,x,v,a);y.append("text").text(d).attr("x",g/2).attr("y",m-p/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),iJe=o((t,e,r,{rowHeight:n,paddingX:i,paddingY:a,bitWidth:s,bitsPerRow:l,showBits:u})=>{let h=t.append("g"),f=r*(n+a)+a;for(let d of e){let p=d.start%l*s+1,m=(d.end-d.start+1)*s-i;if(h.append("rect").attr("x",p).attr("y",f).attr("width",m).attr("height",n).attr("class","packetBlock"),h.append("text").attr("x",p+m/2).attr("y",f+n/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(d.label),!u)continue;let g=d.end===d.start,y=f-2;h.append("text").attr("x",p+(g?m/2:0)).attr("y",y).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",g?"middle":"start").text(d.start),g||h.append("text").attr("x",p+m).attr("y",y).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(d.end)}},"drawWord"),n1e={draw:nJe}});var aJe,a1e,s1e=R(()=>{"use strict";xr();aJe={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},a1e=o(({packet:t}={})=>{let e=Ts(aJe,t);return` + .packetByte { + font-size: ${e.byteFontSize}; + } + .packetByte.start { + fill: ${e.startByteColor}; + } + .packetByte.end { + fill: ${e.endByteColor}; + } + .packetLabel { + fill: ${e.labelColor}; + font-size: ${e.labelFontSize}; + } + .packetTitle { + fill: ${e.titleColor}; + font-size: ${e.titleFontSize}; + } + .packetBlock { + stroke: ${e.blockStrokeColor}; + stroke-width: ${e.blockStrokeWidth}; + fill: ${e.blockFillColor}; + } + `},"styles")});var o1e={};hr(o1e,{diagram:()=>sJe});var sJe,l1e=R(()=>{"use strict";zB();r1e();i1e();s1e();sJe={parser:t1e,db:Mf,renderer:n1e,styles:a1e}});var GB,h1e,f1e=R(()=>{"use strict";GB=function(){var t=o(function(w,S,T,E){for(T=T||{},E=w.length;E--;T[w[E]]=S);return T},"o"),e=[1,7],r=[1,13],n=[1,14],i=[1,15],a=[1,19],s=[1,16],l=[1,17],u=[1,18],h=[8,30],f=[8,21,28,29,30,31,32,40,44,47],d=[1,23],p=[1,24],m=[8,15,16,21,28,29,30,31,32,40,44,47],g=[8,15,16,21,27,28,29,30,31,32,40,44,47],y=[1,49],v={trace:o(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:o(function(S,T,E,_,A,L,M){var N=L.length-1;switch(A){case 4:_.getLogger().debug("Rule: separator (NL) ");break;case 5:_.getLogger().debug("Rule: separator (Space) ");break;case 6:_.getLogger().debug("Rule: separator (EOF) ");break;case 7:_.getLogger().debug("Rule: hierarchy: ",L[N-1]),_.setHierarchy(L[N-1]);break;case 8:_.getLogger().debug("Stop NL ");break;case 9:_.getLogger().debug("Stop EOF ");break;case 10:_.getLogger().debug("Stop NL2 ");break;case 11:_.getLogger().debug("Stop EOF2 ");break;case 12:_.getLogger().debug("Rule: statement: ",L[N]),typeof L[N].length=="number"?this.$=L[N]:this.$=[L[N]];break;case 13:_.getLogger().debug("Rule: statement #2: ",L[N-1]),this.$=[L[N-1]].concat(L[N]);break;case 14:_.getLogger().debug("Rule: link: ",L[N],S),this.$={edgeTypeStr:L[N],label:""};break;case 15:_.getLogger().debug("Rule: LABEL link: ",L[N-3],L[N-1],L[N]),this.$={edgeTypeStr:L[N],label:L[N-1]};break;case 18:let k=parseInt(L[N]),I=_.generateId();this.$={id:I,type:"space",label:"",width:k,children:[]};break;case 23:_.getLogger().debug("Rule: (nodeStatement link node) ",L[N-2],L[N-1],L[N]," typestr: ",L[N-1].edgeTypeStr);let C=_.edgeStrToEdgeData(L[N-1].edgeTypeStr);this.$=[{id:L[N-2].id,label:L[N-2].label,type:L[N-2].type,directions:L[N-2].directions},{id:L[N-2].id+"-"+L[N].id,start:L[N-2].id,end:L[N].id,label:L[N-1].label,type:"edge",directions:L[N].directions,arrowTypeEnd:C,arrowTypeStart:"arrow_open"},{id:L[N].id,label:L[N].label,type:_.typeStr2Type(L[N].typeStr),directions:L[N].directions}];break;case 24:_.getLogger().debug("Rule: nodeStatement (abc88 node size) ",L[N-1],L[N]),this.$={id:L[N-1].id,label:L[N-1].label,type:_.typeStr2Type(L[N-1].typeStr),directions:L[N-1].directions,widthInColumns:parseInt(L[N],10)};break;case 25:_.getLogger().debug("Rule: nodeStatement (node) ",L[N]),this.$={id:L[N].id,label:L[N].label,type:_.typeStr2Type(L[N].typeStr),directions:L[N].directions,widthInColumns:1};break;case 26:_.getLogger().debug("APA123",this?this:"na"),_.getLogger().debug("COLUMNS: ",L[N]),this.$={type:"column-setting",columns:L[N]==="auto"?-1:parseInt(L[N])};break;case 27:_.getLogger().debug("Rule: id-block statement : ",L[N-2],L[N-1]);let O=_.generateId();this.$={...L[N-2],type:"composite",children:L[N-1]};break;case 28:_.getLogger().debug("Rule: blockStatement : ",L[N-2],L[N-1],L[N]);let D=_.generateId();this.$={id:D,type:"composite",label:"",children:L[N-1]};break;case 29:_.getLogger().debug("Rule: node (NODE_ID separator): ",L[N]),this.$={id:L[N]};break;case 30:_.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",L[N-1],L[N]),this.$={id:L[N-1],label:L[N].label,typeStr:L[N].typeStr,directions:L[N].directions};break;case 31:_.getLogger().debug("Rule: dirList: ",L[N]),this.$=[L[N]];break;case 32:_.getLogger().debug("Rule: dirList: ",L[N-1],L[N]),this.$=[L[N-1]].concat(L[N]);break;case 33:_.getLogger().debug("Rule: nodeShapeNLabel: ",L[N-2],L[N-1],L[N]),this.$={typeStr:L[N-2]+L[N],label:L[N-1]};break;case 34:_.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",L[N-3],L[N-2]," #3:",L[N-1],L[N]),this.$={typeStr:L[N-3]+L[N],label:L[N-2],directions:L[N-1]};break;case 35:case 36:this.$={type:"classDef",id:L[N-1].trim(),css:L[N].trim()};break;case 37:this.$={type:"applyClass",id:L[N-1].trim(),styleClass:L[N].trim()};break;case 38:this.$={type:"applyStyles",id:L[N-1].trim(),stylesStr:L[N].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:r,29:n,31:i,32:a,40:s,44:l,47:u},{8:[1,20]},t(h,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:e,28:r,29:n,31:i,32:a,40:s,44:l,47:u}),t(f,[2,16],{14:22,15:d,16:p}),t(f,[2,17]),t(f,[2,18]),t(f,[2,19]),t(f,[2,20]),t(f,[2,21]),t(f,[2,22]),t(m,[2,25],{27:[1,25]}),t(f,[2,26]),{19:26,26:12,32:a},{11:27,13:4,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:r,29:n,31:i,32:a,40:s,44:l,47:u},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},t(g,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},t(h,[2,13]),{26:35,32:a},{32:[2,14]},{17:[1,36]},t(m,[2,24]),{11:37,13:4,14:22,15:d,16:p,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:r,29:n,31:i,32:a,40:s,44:l,47:u},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},t(g,[2,30]),{18:[1,43]},{18:[1,44]},t(m,[2,23]),{18:[1,45]},{30:[1,46]},t(f,[2,28]),t(f,[2,35]),t(f,[2,36]),t(f,[2,37]),t(f,[2,38]),{37:[1,47]},{34:48,35:y},{15:[1,50]},t(f,[2,27]),t(g,[2,33]),{39:[1,51]},{34:52,35:y,39:[2,31]},{32:[2,15]},t(g,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:o(function(S,T){if(T.recoverable)this.trace(S);else{var E=new Error(S);throw E.hash=T,E}},"parseError"),parse:o(function(S){var T=this,E=[0],_=[],A=[null],L=[],M=this.table,N="",k=0,I=0,C=0,O=2,D=1,P=L.slice.call(arguments,1),F=Object.create(this.lexer),B={yy:{}};for(var $ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,$)&&(B.yy[$]=this.yy[$]);F.setInput(S,B.yy),B.yy.lexer=F,B.yy.parser=this,typeof F.yylloc>"u"&&(F.yylloc={});var z=F.yylloc;L.push(z);var Y=F.options&&F.options.ranges;typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Q(oe){E.length=E.length-2*oe,A.length=A.length-oe,L.length=L.length-oe}o(Q,"popStack");function X(){var oe;return oe=_.pop()||F.lex()||D,typeof oe!="number"&&(oe instanceof Array&&(_=oe,oe=_.pop()),oe=T.symbols_[oe]||oe),oe}o(X,"lex");for(var ie,j,J,Z,H,q,K={},se,ce,ue,te;;){if(J=E[E.length-1],this.defaultActions[J]?Z=this.defaultActions[J]:((ie===null||typeof ie>"u")&&(ie=X()),Z=M[J]&&M[J][ie]),typeof Z>"u"||!Z.length||!Z[0]){var De="";te=[];for(se in M[J])this.terminals_[se]&&se>O&&te.push("'"+this.terminals_[se]+"'");F.showPosition?De="Parse error on line "+(k+1)+`: +`+F.showPosition()+` +Expecting `+te.join(", ")+", got '"+(this.terminals_[ie]||ie)+"'":De="Parse error on line "+(k+1)+": Unexpected "+(ie==D?"end of input":"'"+(this.terminals_[ie]||ie)+"'"),this.parseError(De,{text:F.match,token:this.terminals_[ie]||ie,line:F.yylineno,loc:z,expected:te})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+J+", token: "+ie);switch(Z[0]){case 1:E.push(ie),A.push(F.yytext),L.push(F.yylloc),E.push(Z[1]),ie=null,j?(ie=j,j=null):(I=F.yyleng,N=F.yytext,k=F.yylineno,z=F.yylloc,C>0&&C--);break;case 2:if(ce=this.productions_[Z[1]][1],K.$=A[A.length-ce],K._$={first_line:L[L.length-(ce||1)].first_line,last_line:L[L.length-1].last_line,first_column:L[L.length-(ce||1)].first_column,last_column:L[L.length-1].last_column},Y&&(K._$.range=[L[L.length-(ce||1)].range[0],L[L.length-1].range[1]]),q=this.performAction.apply(K,[N,I,k,B.yy,Z[1],A,L].concat(P)),typeof q<"u")return q;ce&&(E=E.slice(0,-1*ce*2),A=A.slice(0,-1*ce),L=L.slice(0,-1*ce)),E.push(this.productions_[Z[1]][0]),A.push(K.$),L.push(K._$),ue=M[E[E.length-2]][E[E.length-1]],E.push(ue);break;case 3:return!0}}return!0},"parse")},x=function(){var w={EOF:1,parseError:o(function(T,E){if(this.yy.parser)this.yy.parser.parseError(T,E);else throw new Error(T)},"parseError"),setInput:o(function(S,T){return this.yy=T||this.yy||{},this._input=S,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var S=this._input[0];this.yytext+=S,this.yyleng++,this.offset++,this.match+=S,this.matched+=S;var T=S.match(/(?:\r\n?|\n).*/g);return T?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),S},"input"),unput:o(function(S){var T=S.length,E=S.split(/(?:\r\n?|\n)/g);this._input=S+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-T),this.offset-=T;var _=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),E.length-1&&(this.yylineno-=E.length-1);var A=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===_.length?this.yylloc.first_column:0)+_[_.length-E.length].length-E[0].length:this.yylloc.first_column-T},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-T]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;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). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(S){this.unput(this.match.slice(S))},"less"),pastInput:o(function(){var S=this.matched.substr(0,this.matched.length-this.match.length);return(S.length>20?"...":"")+S.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var S=this.match;return S.length<20&&(S+=this._input.substr(0,20-S.length)),(S.substr(0,20)+(S.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var S=this.pastInput(),T=new Array(S.length+1).join("-");return S+this.upcomingInput()+` +`+T+"^"},"showPosition"),test_match:o(function(S,T){var E,_,A;if(this.options.backtrack_lexer&&(A={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},this.options.ranges&&(A.yylloc.range=this.yylloc.range.slice(0))),_=S[0].match(/(?:\r\n?|\n).*/g),_&&(this.yylineno+=_.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+S[0].length},this.yytext+=S[0],this.match+=S[0],this.matches=S,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(S[0].length),this.matched+=S[0],E=this.performAction.call(this,this.yy,this,T,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),E)return E;if(this._backtrack){for(var L in A)this[L]=A[L];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var S,T,E,_;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),L=0;LT[0].length)){if(T=E,_=L,this.options.backtrack_lexer){if(S=this.test_match(E,A[L]),S!==!1)return S;if(this._backtrack){T=!1;continue}else return!1}else if(!this.options.flex)break}return T?(S=this.test_match(T,A[_]),S!==!1?S:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var T=this.next();return T||this.lex()},"lex"),begin:o(function(T){this.conditionStack.push(T)},"begin"),popState:o(function(){var T=this.conditionStack.length-1;return T>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(T){return T=this.conditionStack.length-1-Math.abs(T||0),T>=0?this.conditionStack[T]:"INITIAL"},"topState"),pushState:o(function(T){this.begin(T)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:o(function(T,E,_,A){var L=A;switch(_){case 0:return 10;case 1:return T.getLogger().debug("Found space-block"),31;break;case 2:return T.getLogger().debug("Found nl-block"),31;break;case 3:return T.getLogger().debug("Found space-block"),29;break;case 4:T.getLogger().debug(".",E.yytext);break;case 5:T.getLogger().debug("_",E.yytext);break;case 6:return 5;case 7:return E.yytext=-1,28;break;case 8:return E.yytext=E.yytext.replace(/columns\s+/,""),T.getLogger().debug("COLUMNS (LEX)",E.yytext),28;break;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:T.getLogger().debug("LEX: POPPING STR:",E.yytext),this.popState();break;case 14:return T.getLogger().debug("LEX: STR end:",E.yytext),"STR";break;case 15:return E.yytext=E.yytext.replace(/space\:/,""),T.getLogger().debug("SPACE NUM (LEX)",E.yytext),21;break;case 16:return E.yytext="1",T.getLogger().debug("COLUMNS (LEX)",E.yytext),21;break;case 17:return 43;case 18:return"LINKSTYLE";case 19:return"INTERPOLATE";case 20:return this.pushState("CLASSDEF"),40;break;case 21:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";break;case 22:return this.popState(),this.pushState("CLASSDEFID"),41;break;case 23:return this.popState(),42;break;case 24:return this.pushState("CLASS"),44;break;case 25:return this.popState(),this.pushState("CLASS_STYLE"),45;break;case 26:return this.popState(),46;break;case 27:return this.pushState("STYLE_STMNT"),47;break;case 28:return this.popState(),this.pushState("STYLE_DEFINITION"),48;break;case 29:return this.popState(),49;break;case 30:return this.pushState("acc_title"),"acc_title";break;case 31:return this.popState(),"acc_title_value";break;case 32:return this.pushState("acc_descr"),"acc_descr";break;case 33:return this.popState(),"acc_descr_value";break;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:return this.popState(),T.getLogger().debug("Lex: (("),"NODE_DEND";break;case 39:return this.popState(),T.getLogger().debug("Lex: (("),"NODE_DEND";break;case 40:return this.popState(),T.getLogger().debug("Lex: ))"),"NODE_DEND";break;case 41:return this.popState(),T.getLogger().debug("Lex: (("),"NODE_DEND";break;case 42:return this.popState(),T.getLogger().debug("Lex: (("),"NODE_DEND";break;case 43:return this.popState(),T.getLogger().debug("Lex: (-"),"NODE_DEND";break;case 44:return this.popState(),T.getLogger().debug("Lex: -)"),"NODE_DEND";break;case 45:return this.popState(),T.getLogger().debug("Lex: (("),"NODE_DEND";break;case 46:return this.popState(),T.getLogger().debug("Lex: ]]"),"NODE_DEND";break;case 47:return this.popState(),T.getLogger().debug("Lex: ("),"NODE_DEND";break;case 48:return this.popState(),T.getLogger().debug("Lex: ])"),"NODE_DEND";break;case 49:return this.popState(),T.getLogger().debug("Lex: /]"),"NODE_DEND";break;case 50:return this.popState(),T.getLogger().debug("Lex: /]"),"NODE_DEND";break;case 51:return this.popState(),T.getLogger().debug("Lex: )]"),"NODE_DEND";break;case 52:return this.popState(),T.getLogger().debug("Lex: )"),"NODE_DEND";break;case 53:return this.popState(),T.getLogger().debug("Lex: ]>"),"NODE_DEND";break;case 54:return this.popState(),T.getLogger().debug("Lex: ]"),"NODE_DEND";break;case 55:return T.getLogger().debug("Lexa: -)"),this.pushState("NODE"),36;break;case 56:return T.getLogger().debug("Lexa: (-"),this.pushState("NODE"),36;break;case 57:return T.getLogger().debug("Lexa: ))"),this.pushState("NODE"),36;break;case 58:return T.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;break;case 59:return T.getLogger().debug("Lex: ((("),this.pushState("NODE"),36;break;case 60:return T.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;break;case 61:return T.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;break;case 62:return T.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;break;case 63:return T.getLogger().debug("Lexc: >"),this.pushState("NODE"),36;break;case 64:return T.getLogger().debug("Lexa: (["),this.pushState("NODE"),36;break;case 65:return T.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;break;case 66:return this.pushState("NODE"),36;break;case 67:return this.pushState("NODE"),36;break;case 68:return this.pushState("NODE"),36;break;case 69:return this.pushState("NODE"),36;break;case 70:return this.pushState("NODE"),36;break;case 71:return this.pushState("NODE"),36;break;case 72:return this.pushState("NODE"),36;break;case 73:return T.getLogger().debug("Lexa: ["),this.pushState("NODE"),36;break;case 74:return this.pushState("BLOCK_ARROW"),T.getLogger().debug("LEX ARR START"),38;break;case 75:return T.getLogger().debug("Lex: NODE_ID",E.yytext),32;break;case 76:return T.getLogger().debug("Lex: EOF",E.yytext),8;break;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:T.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 82:T.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 83:return T.getLogger().debug("LEX: NODE_DESCR:",E.yytext),"NODE_DESCR";break;case 84:T.getLogger().debug("LEX POPPING"),this.popState();break;case 85:T.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 86:return E.yytext=E.yytext.replace(/^,\s*/,""),T.getLogger().debug("Lex (right): dir:",E.yytext),"DIR";break;case 87:return E.yytext=E.yytext.replace(/^,\s*/,""),T.getLogger().debug("Lex (left):",E.yytext),"DIR";break;case 88:return E.yytext=E.yytext.replace(/^,\s*/,""),T.getLogger().debug("Lex (x):",E.yytext),"DIR";break;case 89:return E.yytext=E.yytext.replace(/^,\s*/,""),T.getLogger().debug("Lex (y):",E.yytext),"DIR";break;case 90:return E.yytext=E.yytext.replace(/^,\s*/,""),T.getLogger().debug("Lex (up):",E.yytext),"DIR";break;case 91:return E.yytext=E.yytext.replace(/^,\s*/,""),T.getLogger().debug("Lex (down):",E.yytext),"DIR";break;case 92:return E.yytext="]>",T.getLogger().debug("Lex (ARROW_DIR end):",E.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";break;case 93:return T.getLogger().debug("Lex: LINK","#"+E.yytext+"#"),15;break;case 94:return T.getLogger().debug("Lex: LINK",E.yytext),15;break;case 95:return T.getLogger().debug("Lex: LINK",E.yytext),15;break;case 96:return T.getLogger().debug("Lex: LINK",E.yytext),15;break;case 97:return T.getLogger().debug("Lex: START_LINK",E.yytext),this.pushState("LLABEL"),16;break;case 98:return T.getLogger().debug("Lex: START_LINK",E.yytext),this.pushState("LLABEL"),16;break;case 99:return T.getLogger().debug("Lex: START_LINK",E.yytext),this.pushState("LLABEL"),16;break;case 100:this.pushState("md_string");break;case 101:return T.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";break;case 102:return this.popState(),T.getLogger().debug("Lex: LINK","#"+E.yytext+"#"),15;break;case 103:return this.popState(),T.getLogger().debug("Lex: LINK",E.yytext),15;break;case 104:return this.popState(),T.getLogger().debug("Lex: LINK",E.yytext),15;break;case 105:return T.getLogger().debug("Lex: COLON",E.yytext),E.yytext=E.yytext.slice(1),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:!1},STYLE_STMNT:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[23],inclusive:!1},CLASSDEF:{rules:[21,22],inclusive:!1},CLASS_STYLE:{rules:[26],inclusive:!1},CLASS:{rules:[25],inclusive:!1},LLABEL:{rules:[100,101,102,103,104],inclusive:!1},ARROW_DIR:{rules:[86,87,88,89,90,91,92],inclusive:!1},BLOCK_ARROW:{rules:[77,82,85],inclusive:!1},NODE:{rules:[38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,78,81],inclusive:!1},md_string:{rules:[10,11,79,80],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[13,14,83,84],inclusive:!1},acc_descr_multiline:{rules:[35,36],inclusive:!1},acc_descr:{rules:[33],inclusive:!1},acc_title:{rules:[31],inclusive:!1},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:!0}}};return w}();v.lexer=x;function b(){this.yy={}}return o(b,"Parser"),b.prototype=v,v.Parser=b,new b}();GB.parser=GB;h1e=GB});function gJe(t){switch(V.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return V.debug("we have a round"),"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 yJe(t){switch(V.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}function vJe(t){switch(t.trim()){case"--x":return"arrow_cross";case"--o":return"arrow_circle";default:return"arrow_point"}}var Yl,VB,$B,d1e,p1e,cJe,g1e,uJe,aC,hJe,fJe,dJe,pJe,y1e,UB,db,mJe,m1e,xJe,bJe,wJe,TJe,kJe,EJe,CJe,SJe,AJe,_Je,LJe,v1e,x1e=R(()=>{"use strict";gL();qs();_t();ut();rr();bi();Yl=new Map,VB=[],$B=new Map,d1e="color",p1e="fill",cJe="bgFill",g1e=",",uJe=de(),aC=new Map,hJe=o(t=>We.sanitizeText(t,uJe),"sanitizeText"),fJe=o(function(t,e=""){let r=aC.get(t);r||(r={id:t,styles:[],textStyles:[]},aC.set(t,r)),e?.split(g1e).forEach(n=>{let i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(d1e).exec(n)){let s=i.replace(p1e,cJe).replace(d1e,p1e);r.textStyles.push(s)}r.styles.push(i)})},"addStyleClass"),dJe=o(function(t,e=""){let r=Yl.get(t);e!=null&&(r.styles=e.split(g1e))},"addStyle2Node"),pJe=o(function(t,e){t.split(",").forEach(function(r){let n=Yl.get(r);if(n===void 0){let i=r.trim();n={id:i,type:"na",children:[]},Yl.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),y1e=o((t,e)=>{let r=t.flat(),n=[];for(let i of r){if(i.label&&(i.label=hJe(i.label)),i.type==="classDef"){fJe(i.id,i.css);continue}if(i.type==="applyClass"){pJe(i.id,i?.styleClass??"");continue}if(i.type==="applyStyles"){i?.stylesStr&&dJe(i.id,i?.stylesStr);continue}if(i.type==="column-setting")e.columns=i.columns??-1;else if(i.type==="edge"){let a=($B.get(i.id)??0)+1;$B.set(i.id,a),i.id=a+"-"+i.id,VB.push(i)}else{i.label||(i.type==="composite"?i.label="":i.label=i.id);let a=Yl.get(i.id);if(a===void 0?Yl.set(i.id,i):(i.type!=="na"&&(a.type=i.type),i.label!==i.id&&(a.label=i.label)),i.children&&y1e(i.children,i),i.type==="space"){let s=i.width??1;for(let l=0;l{V.debug("Clear called"),vr(),db={id:"root",type:"composite",children:[],columns:-1},Yl=new Map([["root",db]]),UB=[],aC=new Map,VB=[],$B=new Map},"clear");o(gJe,"typeStr2Type");o(yJe,"edgeTypeStr2Type");o(vJe,"edgeStrToEdgeData");m1e=0,xJe=o(()=>(m1e++,"id-"+Math.random().toString(36).substr(2,12)+"-"+m1e),"generateId"),bJe=o(t=>{db.children=t,y1e(t,db),UB=db.children},"setHierarchy"),wJe=o(t=>{let e=Yl.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),TJe=o(()=>[...Yl.values()],"getBlocksFlat"),kJe=o(()=>UB||[],"getBlocks"),EJe=o(()=>VB,"getEdges"),CJe=o(t=>Yl.get(t),"getBlock"),SJe=o(t=>{Yl.set(t.id,t)},"setBlock"),AJe=o(()=>console,"getLogger"),_Je=o(function(){return aC},"getClasses"),LJe={getConfig:o(()=>Or().block,"getConfig"),typeStr2Type:gJe,edgeTypeStr2Type:yJe,edgeStrToEdgeData:vJe,getLogger:AJe,getBlocksFlat:TJe,getBlocks:kJe,getEdges:EJe,setHierarchy:bJe,getBlock:CJe,setBlock:SJe,getColumns:wJe,getClasses:_Je,clear:mJe,generateId:xJe},v1e=LJe});var sC,DJe,b1e,w1e=R(()=>{"use strict";al();sC=o((t,e)=>{let r=X1,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ws(n,i,a,e)},"fade"),DJe=o(t=>`.label { + font-family: ${t.fontFamily}; + color: ${t.nodeTextColor||t.textColor}; + } + .cluster-label text { + fill: ${t.titleColor}; + } + .cluster-label span,p { + color: ${t.titleColor}; + } + + + + .label text,span,p { + fill: ${t.nodeTextColor||t.textColor}; + color: ${t.nodeTextColor||t.textColor}; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${t.mainBkg}; + stroke: ${t.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: ${t.arrowheadColor}; + } + + .edgePath .path { + stroke: ${t.lineColor}; + stroke-width: 2.0px; + } + + .flowchart-link { + stroke: ${t.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${t.edgeLabelBackground}; + rect { + opacity: 0.5; + background-color: ${t.edgeLabelBackground}; + fill: ${t.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${sC(t.edgeLabelBackground,.5)}; + // background-color: + } + + .node .cluster { + // fill: ${sC(t.mainBkg,.5)}; + fill: ${sC(t.clusterBkg,.5)}; + stroke: ${sC(t.clusterBorder,.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: ${t.titleColor}; + } + + .cluster span,p { + color: ${t.titleColor}; + } + /* .cluster div { + color: ${t.titleColor}; + } */ + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${t.fontFamily}; + font-size: 12px; + background: ${t.tertiaryColor}; + border: 1px solid ${t.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${t.textColor}; + } +`,"getStyles"),b1e=DJe});function RJe(t,e){if(t===0||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(t===1)return{px:0,py:e};let r=e%t,n=Math.floor(e/t);return{px:r,py:n}}function HB(t,e,r=0,n=0){V.debug("setBlockSizes abc95 (start)",t.id,t?.size?.x,"block width =",t?.size,"sieblingWidth",r),t?.size?.width||(t.size={width:r,height:n,x:0,y:0});let i=0,a=0;if(t.children?.length>0){for(let m of t.children)HB(m,e);let s=NJe(t);i=s.width,a=s.height,V.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",i,a);for(let m of t.children)m.size&&(V.debug(`abc95 Setting size of children of ${t.id} id=${m.id} ${i} ${a} ${JSON.stringify(m.size)}`),m.size.width=i*(m.widthInColumns??1)+mi*((m.widthInColumns??1)-1),m.size.height=a,m.size.x=0,m.size.y=0,V.debug(`abc95 updating size of ${t.id} children child:${m.id} maxWidth:${i} maxHeight:${a}`));for(let m of t.children)HB(m,e,i,a);let l=t.columns??-1,u=0;for(let m of t.children)u+=m.widthInColumns??1;let h=t.children.length;l>0&&l0?Math.min(t.children.length,l):t.children.length;if(m>0){let g=(d-m*mi-mi)/m;V.debug("abc95 (growing to fit) width",t.id,d,t.size?.width,g);for(let y of t.children)y.size&&(y.size.width=g)}}t.size={width:d,height:p,x:0,y:0}}V.debug("setBlockSizes abc94 (done)",t.id,t?.size?.x,t?.size?.width,t?.size?.y,t?.size?.height)}function T1e(t,e){V.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`);let r=t.columns??-1;if(V.debug("layoutBlocks columns abc95",t.id,"=>",r,t),t.children&&t.children.length>0){let n=t?.children[0]?.size?.width??0,i=t.children.length*n+(t.children.length-1)*mi;V.debug("widthOfChildren 88",i,"posX");let a=0;V.debug("abc91 block?.size?.x",t.id,t?.size?.x);let s=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-mi,l=0;for(let u of t.children){let h=t;if(!u.size)continue;let{width:f,height:d}=u.size,{px:p,py:m}=RJe(r,a);if(m!=l&&(l=m,s=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-mi,V.debug("New row in layout for block",t.id," and child ",u.id,l)),V.debug(`abc89 layout blocks (child) id: ${u.id} Pos: ${a} (px, py) ${p},${m} (${h?.size?.x},${h?.size?.y}) parent: ${h.id} width: ${f}${mi}`),h.size){let g=f/2;u.size.x=s+mi+g,V.debug(`abc91 layout blocks (calc) px, pyid:${u.id} startingPos=X${s} new startingPosX${u.size.x} ${g} padding=${mi} width=${f} halfWidth=${g} => x:${u.size.x} y:${u.size.y} ${u.widthInColumns} (width * (child?.w || 1)) / 2 ${f*(u?.widthInColumns??1)/2}`),s=u.size.x+g,u.size.y=h.size.y-h.size.height/2+m*(d+mi)+d/2+mi,V.debug(`abc88 layout blocks (calc) px, pyid:${u.id}startingPosX${s}${mi}${g}=>x:${u.size.x}y:${u.size.y}${u.widthInColumns}(width * (child?.w || 1)) / 2${f*(u?.widthInColumns??1)/2}`)}u.children&&T1e(u,e),a+=u?.widthInColumns??1,V.debug("abc88 columnsPos",u,a)}}V.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`)}function k1e(t,{minX:e,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&t.id!=="root"){let{x:a,y:s,width:l,height:u}=t.size;a-l/2n&&(n=a+l/2),s+u/2>i&&(i=s+u/2)}if(t.children)for(let a of t.children)({minX:e,minY:r,maxX:n,maxY:i}=k1e(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}function E1e(t){let e=t.getBlock("root");if(!e)return;HB(e,t,0,0),T1e(e,t),V.debug("getBlocks",JSON.stringify(e,null,2));let{minX:r,minY:n,maxX:i,maxY:a}=k1e(e),s=a-n,l=i-r;return{x:r,y:n,width:l,height:s}}var mi,NJe,C1e=R(()=>{"use strict";ut();_t();mi=de()?.block?.padding??8;o(RJe,"calculateBlockPosition");NJe=o(t=>{let e=0,r=0;for(let n of t.children){let{width:i,height:a,x:s,y:l}=n.size??{width:0,height:0,x:0,y:0};V.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",s,"y:",l,n.type),n.type!=="space"&&(i>e&&(e=i/(t.widthInColumns??1)),a>r&&(r=a))}return{width:e,height:r}},"getMaxChildSize");o(HB,"setBlockSizes");o(T1e,"layoutBlocks");o(k1e,"findBounds");o(E1e,"layout")});function S1e(t,e,r=!1){let n=t,i="default";(n?.classes?.length||0)>0&&(i=(n?.classes??[]).join(" ")),i=i+" flowchart-label";let a=0,s="",l;switch(n.type){case"round":a=5,s="rect";break;case"composite":a=0,s="composite",l=0;break;case"square":s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":s="rect_left_inv_arrow";break;case"lean_right":s="lean_right";break;case"lean_left":s="lean_left";break;case"trapezoid":s="trapezoid";break;case"inv_trapezoid":s="inv_trapezoid";break;case"rect_left_inv_arrow":s="rect_left_inv_arrow";break;case"circle":s="circle";break;case"ellipse":s="ellipse";break;case"stadium":s="stadium";break;case"subroutine":s="subroutine";break;case"cylinder":s="cylinder";break;case"group":s="rect";break;case"doublecircle":s="doublecircle";break;default:s="rect"}let u=lm(n?.styles??[]),h=n.label,f=n.size??{width:0,height:0,x:0,y:0};return{labelStyle:u.labelStyle,shape:s,labelText:h,rx:a,ry:a,class:i,style:u.style,id:n.id,directions:n.directions,width:f.width,height:f.height,x:f.x,y:f.y,positioned:r,intersect:void 0,type:n.type,padding:l??Or()?.block?.padding??0}}async function MJe(t,e,r){let n=S1e(e,r,!1);if(n.type==="group")return;let i=await pm(t,n),a=i.node().getBBox(),s=r.getBlock(n.id);s.size={width:a.width,height:a.height,x:0,y:0,node:i},r.setBlock(s),i.remove()}async function IJe(t,e,r){let n=S1e(e,r,!0);r.getBlock(n.id).type!=="space"&&(await pm(t,n),e.intersect=n?.intersect,wv(n))}async function YB(t,e,r,n){for(let i of e)await n(t,i,r),i.children&&await YB(t,i.children,r,n)}async function A1e(t,e,r){await YB(t,e,r,MJe)}async function _1e(t,e,r){await YB(t,e,r,IJe)}async function L1e(t,e,r,n,i){let a=new lr({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(let s of r)s.size&&a.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(let s of e)if(s.start&&s.end){let l=n.getBlock(s.start),u=n.getBlock(s.end);if(l?.size&&u?.size){let h=l.size,f=u.size,d=[{x:h.x,y:h.y},{x:h.x+(f.x-h.x)/2,y:h.y+(f.y-h.y)/2},{x:f.x,y:f.y}];PE(t,{v:s.start,w:s.end,name:s.id},{...s,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",a,i),s.label&&(await IE(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),OE({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}var D1e=R(()=>{"use strict";ya();qs();DO();M5();xr();o(S1e,"getNodeFromBlock");o(MJe,"calculateBlockSize");o(IJe,"insertBlockPositioned");o(YB,"performOperations");o(A1e,"calculateBlockSizes");o(_1e,"insertBlocks");o(L1e,"insertEdges")});var OJe,PJe,R1e,N1e=R(()=>{"use strict";Zt();qs();LO();ut();Yn();C1e();D1e();OJe=o(function(t,e){return e.db.getClasses()},"getClasses"),PJe=o(async function(t,e,r,n){let{securityLevel:i,block:a}=Or(),s=n.db,l;i==="sandbox"&&(l=$e("#i"+e));let u=i==="sandbox"?$e(l.nodes()[0].contentDocument.body):$e("body"),h=i==="sandbox"?u.select(`[id="${e}"]`):$e(`[id="${e}"]`);LE(h,["point","circle","cross"],n.type,e);let d=s.getBlocks(),p=s.getBlocksFlat(),m=s.getEdges(),g=h.insert("g").attr("class","block");await A1e(g,d,s);let y=E1e(s);if(await _1e(g,d,s),await L1e(g,m,p,s,e),y){let v=y,x=Math.max(1,Math.round(.125*(v.width/v.height))),b=v.height+x+10,w=v.width+10,{useMaxWidth:S}=a;Sr(h,b,w,!!S),V.debug("Here Bounds",y,v),h.attr("viewBox",`${v.x-5} ${v.y-5} ${v.width+10} ${v.height+10}`)}},"draw"),R1e={draw:PJe,getClasses:OJe}});var M1e={};hr(M1e,{diagram:()=>BJe});var BJe,I1e=R(()=>{"use strict";f1e();x1e();w1e();N1e();BJe={parser:h1e,db:v1e,renderer:R1e,styles:b1e}});var WB,qB,pb,B1e,XB,cs,Wc,oC,F1e,$Je,mb,z1e,G1e,$1e,V1e,lC,If,cC=R(()=>{"use strict";WB={L:"left",R:"right",T:"top",B:"bottom"},qB={L:o(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:o(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:o(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:o(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},pb={L:o((t,e)=>t-e+2,"L"),R:o((t,e)=>t-2,"R"),T:o((t,e)=>t-e+2,"T"),B:o((t,e)=>t-2,"B")},B1e=o(function(t){return cs(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),XB=o(function(t){let e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),cs=o(function(t){let e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),Wc=o(function(t){let e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),oC=o(function(t,e){let r=cs(t)&&Wc(e),n=Wc(t)&&cs(e);return r||n},"isArchitectureDirectionXY"),F1e=o(function(t){let e=t[0],r=t[1],n=cs(e)&&Wc(r),i=Wc(e)&&cs(r);return n||i},"isArchitecturePairXY"),$Je=o(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),mb=o(function(t,e){let r=`${t}${e}`;return $Je(r)?r:void 0},"getArchitectureDirectionPair"),z1e=o(function([t,e],r){let n=r[0],i=r[1];return cs(n)?Wc(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:cs(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),G1e=o(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),$1e=o(function(t){return t.type==="service"},"isArchitectureService"),V1e=o(function(t){return t.type==="junction"},"isArchitectureJunction"),lC=o(t=>t.data(),"edgeData"),If=o(t=>t.data(),"nodeData")});function Ci(t){let e=de().architecture;return e?.[t]?e[t]:U1e[t]}var U1e,nr,VJe,UJe,HJe,YJe,WJe,qJe,XJe,jJe,KJe,QJe,ZJe,JJe,eet,tet,Z0,gb=R(()=>{"use strict";sl();_t();Jk();bi();cC();U1e=mr.architecture,nr=new uf(()=>({nodes:{},groups:{},edges:[],registeredIds:{},config:U1e,dataStructures:void 0,elements:{}})),VJe=o(()=>{nr.reset(),vr()},"clear"),UJe=o(function({id:t,icon:e,in:r,title:n,iconText:i}){if(nr.records.registeredIds[t]!==void 0)throw new Error(`The service id [${t}] is already in use by another ${nr.records.registeredIds[t]}`);if(r!==void 0){if(t===r)throw new Error(`The service [${t}] cannot be placed within itself`);if(nr.records.registeredIds[r]===void 0)throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if(nr.records.registeredIds[r]==="node")throw new Error(`The service [${t}]'s parent is not a group`)}nr.records.registeredIds[t]="node",nr.records.nodes[t]={id:t,type:"service",icon:e,iconText:i,title:n,edges:[],in:r}},"addService"),HJe=o(()=>Object.values(nr.records.nodes).filter($1e),"getServices"),YJe=o(function({id:t,in:e}){nr.records.registeredIds[t]="node",nr.records.nodes[t]={id:t,type:"junction",edges:[],in:e}},"addJunction"),WJe=o(()=>Object.values(nr.records.nodes).filter(V1e),"getJunctions"),qJe=o(()=>Object.values(nr.records.nodes),"getNodes"),XJe=o(t=>nr.records.nodes[t],"getNode"),jJe=o(function({id:t,icon:e,in:r,title:n}){if(nr.records.registeredIds[t]!==void 0)throw new Error(`The group id [${t}] is already in use by another ${nr.records.registeredIds[t]}`);if(r!==void 0){if(t===r)throw new Error(`The group [${t}] cannot be placed within itself`);if(nr.records.registeredIds[r]===void 0)throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if(nr.records.registeredIds[r]==="node")throw new Error(`The group [${t}]'s parent is not a group`)}nr.records.registeredIds[t]="group",nr.records.groups[t]={id:t,icon:e,title:n,in:r}},"addGroup"),KJe=o(()=>Object.values(nr.records.groups),"getGroups"),QJe=o(function({lhsId:t,rhsId:e,lhsDir:r,rhsDir:n,lhsInto:i,rhsInto:a,lhsGroup:s,rhsGroup:l,title:u}){if(!XB(r))throw new Error(`Invalid direction given for left hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${r}`);if(!XB(n))throw new Error(`Invalid direction given for right hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${n}`);if(nr.records.nodes[t]===void 0&&nr.records.groups[t]===void 0)throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(nr.records.nodes[e]===void 0&&nr.records.groups[t]===void 0)throw new Error(`The right-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);let h=nr.records.nodes[t].in,f=nr.records.nodes[e].in;if(s&&h&&f&&h==f)throw new Error(`The left-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(l&&h&&f&&h==f)throw new Error(`The right-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let d={lhsId:t,lhsDir:r,lhsInto:i,lhsGroup:s,rhsId:e,rhsDir:n,rhsInto:a,rhsGroup:l,title:u};nr.records.edges.push(d),nr.records.nodes[t]&&nr.records.nodes[e]&&(nr.records.nodes[t].edges.push(nr.records.edges[nr.records.edges.length-1]),nr.records.nodes[e].edges.push(nr.records.edges[nr.records.edges.length-1]))},"addEdge"),ZJe=o(()=>nr.records.edges,"getEdges"),JJe=o(()=>{if(nr.records.dataStructures===void 0){let t=Object.entries(nr.records.nodes).reduce((s,[l,u])=>(s[l]=u.edges.reduce((h,f)=>{if(f.lhsId===l){let d=mb(f.lhsDir,f.rhsDir);d&&(h[d]=f.rhsId)}else{let d=mb(f.rhsDir,f.lhsDir);d&&(h[d]=f.lhsId)}return h},{}),s),{}),e=Object.keys(t)[0],r={[e]:1},n=Object.keys(t).reduce((s,l)=>l===e?s:{...s,[l]:1},{}),i=o(s=>{let l={[s]:[0,0]},u=[s];for(;u.length>0;){let h=u.shift();if(h){r[h]=1,delete n[h];let f=t[h],[d,p]=l[h];Object.entries(f).forEach(([m,g])=>{r[g]||(l[g]=z1e([d,p],m),u.push(g))})}}return l},"BFS"),a=[i(e)];for(;Object.keys(n).length>0;)a.push(i(Object.keys(n)[0]));nr.records.dataStructures={adjList:t,spatialMaps:a}}return nr.records.dataStructures},"getDataStructures"),eet=o((t,e)=>{nr.records.elements[t]=e},"setElementForId"),tet=o(t=>nr.records.elements[t],"getElementById"),Z0={clear:VJe,setDiagramTitle:nn,getDiagramTitle:Xr,setAccTitle:kr,getAccTitle:Ar,setAccDescription:_r,getAccDescription:Lr,addService:UJe,getServices:HJe,addJunction:YJe,getJunctions:WJe,getNodes:qJe,getNode:XJe,addGroup:jJe,getGroups:KJe,addEdge:QJe,getEdges:ZJe,setElementForId:eet,getElementById:tet,getDataStructures:JJe};o(Ci,"getConfigField")});var ret,H1e,Y1e=R(()=>{"use strict";Lg();ut();sx();gb();ret=o((t,e)=>{cf(t,e),t.groups.map(e.addGroup),t.services.map(r=>e.addService({...r,type:"service"})),t.junctions.map(r=>e.addJunction({...r,type:"junction"})),t.edges.map(e.addEdge)},"populateDb"),H1e={parse:o(async t=>{let e=await Fl("architecture",t);V.debug(e),ret(e,Z0)},"parse")}});var net,W1e,q1e=R(()=>{"use strict";net=o(t=>` + .edge { + stroke-width: ${t.archEdgeWidth}; + stroke: ${t.archEdgeColor}; + fill: none; + } + + .arrow { + fill: ${t.archEdgeArrowColor}; + } + + .node-bkg { + fill: none; + stroke: ${t.archGroupBorderColor}; + stroke-width: ${t.archGroupBorderWidth}; + stroke-dasharray: 8; + } + .node-icon-text { + display: flex; + align-items: center; + } + + .node-icon-text > div { + color: #fff; + margin: 1px; + height: fit-content; + text-align: center; + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + } +`,"getStyles"),W1e=net});var KB=gi((yb,jB)=>{"use strict";o(function(e,r){typeof yb=="object"&&typeof jB=="object"?jB.exports=r():typeof define=="function"&&define.amd?define([],r):typeof yb=="object"?yb.layoutBase=r():e.layoutBase=r()},"webpackUniversalModuleDefinition")(yb,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return o(r,"__webpack_require__"),r.m=t,r.c=e,r.i=function(n){return n},r.d=function(n,i,a){r.o(n,i)||Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:a})},r.n=function(n){var i=n&&n.__esModule?o(function(){return n.default},"getDefault"):o(function(){return n},"getModuleExports");return r.d(i,"a",i),i},r.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},r.p="",r(r.s=28)}([function(t,e,r){"use strict";function n(){}o(n,"LayoutConstants"),n.QUALITY=1,n.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,n.DEFAULT_INCREMENTAL=!1,n.DEFAULT_ANIMATION_ON_LAYOUT=!0,n.DEFAULT_ANIMATION_DURING_LAYOUT=!1,n.DEFAULT_ANIMATION_PERIOD=50,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,n.DEFAULT_GRAPH_MARGIN=15,n.NODE_DIMENSIONS_INCLUDE_LABELS=!1,n.SIMPLE_NODE_SIZE=40,n.SIMPLE_NODE_HALF_SIZE=n.SIMPLE_NODE_SIZE/2,n.EMPTY_COMPOUND_NODE_SIZE=40,n.MIN_EDGE_LENGTH=1,n.WORLD_BOUNDARY=1e6,n.INITIAL_WORLD_BOUNDARY=n.WORLD_BOUNDARY/1e3,n.WORLD_CENTER_X=1200,n.WORLD_CENTER_Y=900,t.exports=n},function(t,e,r){"use strict";var n=r(2),i=r(8),a=r(9);function s(u,h,f){n.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=u,this.target=h}o(s,"LEdge"),s.prototype=Object.create(n.prototype);for(var l in n)s[l]=n[l];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(u){if(this.source===u)return this.target;if(this.target===u)return this.source;throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(u,h){for(var f=this.getOtherEnd(u),d=h.getGraphManager().getRoot();;){if(f.getOwner()==h)return f;if(f.getOwner()==d)break;f=f.getOwner().getParent()}return null},s.prototype.updateLength=function(){var u=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),u),this.isOverlapingSourceAndTarget||(this.lengthX=u[0]-u[2],this.lengthY=u[1]-u[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},s.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=s},function(t,e,r){"use strict";function n(i){this.vGraphObject=i}o(n,"LGraphObject"),t.exports=n},function(t,e,r){"use strict";var n=r(2),i=r(10),a=r(13),s=r(0),l=r(16),u=r(5);function h(d,p,m,g){m==null&&g==null&&(g=p),n.call(this,g),d.graphManager!=null&&(d=d.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=g,this.edges=[],this.graphManager=d,m!=null&&p!=null?this.rect=new a(p.x,p.y,m.width,m.height):this.rect=new a}o(h,"LNode"),h.prototype=Object.create(n.prototype);for(var f in n)h[f]=n[f];h.prototype.getEdges=function(){return this.edges},h.prototype.getChild=function(){return this.child},h.prototype.getOwner=function(){return this.owner},h.prototype.getWidth=function(){return this.rect.width},h.prototype.setWidth=function(d){this.rect.width=d},h.prototype.getHeight=function(){return this.rect.height},h.prototype.setHeight=function(d){this.rect.height=d},h.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},h.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},h.prototype.getCenter=function(){return new u(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},h.prototype.getLocation=function(){return new u(this.rect.x,this.rect.y)},h.prototype.getRect=function(){return this.rect},h.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},h.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},h.prototype.setRect=function(d,p){this.rect.x=d.x,this.rect.y=d.y,this.rect.width=p.width,this.rect.height=p.height},h.prototype.setCenter=function(d,p){this.rect.x=d-this.rect.width/2,this.rect.y=p-this.rect.height/2},h.prototype.setLocation=function(d,p){this.rect.x=d,this.rect.y=p},h.prototype.moveBy=function(d,p){this.rect.x+=d,this.rect.y+=p},h.prototype.getEdgeListToNode=function(d){var p=[],m,g=this;return g.edges.forEach(function(y){if(y.target==d){if(y.source!=g)throw"Incorrect edge source!";p.push(y)}}),p},h.prototype.getEdgesBetween=function(d){var p=[],m,g=this;return g.edges.forEach(function(y){if(!(y.source==g||y.target==g))throw"Incorrect edge source and/or target";(y.target==d||y.source==d)&&p.push(y)}),p},h.prototype.getNeighborsList=function(){var d=new Set,p=this;return p.edges.forEach(function(m){if(m.source==p)d.add(m.target);else{if(m.target!=p)throw"Incorrect incidency!";d.add(m.source)}}),d},h.prototype.withChildren=function(){var d=new Set,p,m;if(d.add(this),this.child!=null)for(var g=this.child.getNodes(),y=0;yp?(this.rect.x-=(this.labelWidth-p)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(p+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(m+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>m?(this.rect.y-=(this.labelHeight-m)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(m+this.labelHeight))}}},h.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},h.prototype.transform=function(d){var p=this.rect.x;p>s.WORLD_BOUNDARY?p=s.WORLD_BOUNDARY:p<-s.WORLD_BOUNDARY&&(p=-s.WORLD_BOUNDARY);var m=this.rect.y;m>s.WORLD_BOUNDARY?m=s.WORLD_BOUNDARY:m<-s.WORLD_BOUNDARY&&(m=-s.WORLD_BOUNDARY);var g=new u(p,m),y=d.inverseTransformPoint(g);this.setLocation(y.x,y.y)},h.prototype.getLeft=function(){return this.rect.x},h.prototype.getRight=function(){return this.rect.x+this.rect.width},h.prototype.getTop=function(){return this.rect.y},h.prototype.getBottom=function(){return this.rect.y+this.rect.height},h.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},t.exports=h},function(t,e,r){"use strict";var n=r(0);function i(){}o(i,"FDLayoutConstants");for(var a in n)i[a]=n[a];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=i.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=i},function(t,e,r){"use strict";function n(i,a){i==null&&a==null?(this.x=0,this.y=0):(this.x=i,this.y=a)}o(n,"PointD"),n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(i){this.x=i},n.prototype.setY=function(i){this.y=i},n.prototype.getDifference=function(i){return new DimensionD(this.x-i.x,this.y-i.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(i){return this.x+=i.width,this.y+=i.height,this},t.exports=n},function(t,e,r){"use strict";var n=r(2),i=r(10),a=r(0),s=r(7),l=r(3),u=r(1),h=r(13),f=r(12),d=r(11);function p(g,y,v){n.call(this,v),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=g,y!=null&&y instanceof s?this.graphManager=y:y!=null&&y instanceof Layout&&(this.graphManager=y.graphManager)}o(p,"LGraph"),p.prototype=Object.create(n.prototype);for(var m in n)p[m]=n[m];p.prototype.getNodes=function(){return this.nodes},p.prototype.getEdges=function(){return this.edges},p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getParent=function(){return this.parent},p.prototype.getLeft=function(){return this.left},p.prototype.getRight=function(){return this.right},p.prototype.getTop=function(){return this.top},p.prototype.getBottom=function(){return this.bottom},p.prototype.isConnected=function(){return this.isConnected},p.prototype.add=function(g,y,v){if(y==null&&v==null){var x=g;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(x)>-1)throw"Node already in graph!";return x.owner=this,this.getNodes().push(x),x}else{var b=g;if(!(this.getNodes().indexOf(y)>-1&&this.getNodes().indexOf(v)>-1))throw"Source or target not in graph!";if(!(y.owner==v.owner&&y.owner==this))throw"Both owners must be this graph!";return y.owner!=v.owner?null:(b.source=y,b.target=v,b.isInterGraph=!1,this.getEdges().push(b),y.edges.push(b),v!=y&&v.edges.push(b),b)}},p.prototype.remove=function(g){var y=g;if(g instanceof l){if(y==null)throw"Node is null!";if(!(y.owner!=null&&y.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var v=y.edges.slice(),x,b=v.length,w=0;w-1&&E>-1))throw"Source and/or target doesn't know this edge!";x.source.edges.splice(T,1),x.target!=x.source&&x.target.edges.splice(E,1);var S=x.source.owner.getEdges().indexOf(x);if(S==-1)throw"Not in owner's edge list!";x.source.owner.getEdges().splice(S,1)}},p.prototype.updateLeftTop=function(){for(var g=i.MAX_VALUE,y=i.MAX_VALUE,v,x,b,w=this.getNodes(),S=w.length,T=0;Tv&&(g=v),y>x&&(y=x)}return g==i.MAX_VALUE?null:(w[0].getParent().paddingLeft!=null?b=w[0].getParent().paddingLeft:b=this.margin,this.left=y-b,this.top=g-b,new f(this.left,this.top))},p.prototype.updateBounds=function(g){for(var y=i.MAX_VALUE,v=-i.MAX_VALUE,x=i.MAX_VALUE,b=-i.MAX_VALUE,w,S,T,E,_,A=this.nodes,L=A.length,M=0;Mw&&(y=w),vT&&(x=T),bw&&(y=w),vT&&(x=T),b=this.nodes.length){var L=0;v.forEach(function(M){M.owner==g&&L++}),L==this.nodes.length&&(this.isConnected=!0)}},t.exports=p},function(t,e,r){"use strict";var n,i=r(1);function a(s){n=r(6),this.layout=s,this.graphs=[],this.edges=[]}o(a,"LGraphManager"),a.prototype.addRoot=function(){var s=this.layout.newGraph(),l=this.layout.newNode(null),u=this.add(s,l);return this.setRootGraph(u),this.rootGraph},a.prototype.add=function(s,l,u,h,f){if(u==null&&h==null&&f==null){if(s==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(s)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(s),s.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return s.parent=l,l.child=s,s}else{f=u,h=l,u=s;var d=h.getOwner(),p=f.getOwner();if(!(d!=null&&d.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(p!=null&&p.getGraphManager()==this))throw"Target not in this graph mgr!";if(d==p)return u.isInterGraph=!1,d.add(u,h,f);if(u.isInterGraph=!0,u.source=h,u.target=f,this.edges.indexOf(u)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(u),!(u.source!=null&&u.target!=null))throw"Edge source and/or target is null!";if(!(u.source.edges.indexOf(u)==-1&&u.target.edges.indexOf(u)==-1))throw"Edge already in source and/or target incidency list!";return u.source.edges.push(u),u.target.edges.push(u),u}},a.prototype.remove=function(s){if(s instanceof n){var l=s;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var u=[];u=u.concat(l.getEdges());for(var h,f=u.length,d=0;d=s.getRight()?l[0]+=Math.min(s.getX()-a.getX(),a.getRight()-s.getRight()):s.getX()<=a.getX()&&s.getRight()>=a.getRight()&&(l[0]+=Math.min(a.getX()-s.getX(),s.getRight()-a.getRight())),a.getY()<=s.getY()&&a.getBottom()>=s.getBottom()?l[1]+=Math.min(s.getY()-a.getY(),a.getBottom()-s.getBottom()):s.getY()<=a.getY()&&s.getBottom()>=a.getBottom()&&(l[1]+=Math.min(a.getY()-s.getY(),s.getBottom()-a.getBottom()));var f=Math.abs((s.getCenterY()-a.getCenterY())/(s.getCenterX()-a.getCenterX()));s.getCenterY()===a.getCenterY()&&s.getCenterX()===a.getCenterX()&&(f=1);var d=f*l[0],p=l[1]/f;l[0]d)return l[0]=u,l[1]=m,l[2]=f,l[3]=A,!1;if(hf)return l[0]=p,l[1]=h,l[2]=E,l[3]=d,!1;if(uf?(l[0]=y,l[1]=v,k=!0):(l[0]=g,l[1]=m,k=!0):C===D&&(u>f?(l[0]=p,l[1]=m,k=!0):(l[0]=x,l[1]=v,k=!0)),-O===D?f>u?(l[2]=_,l[3]=A,I=!0):(l[2]=E,l[3]=T,I=!0):O===D&&(f>u?(l[2]=S,l[3]=T,I=!0):(l[2]=L,l[3]=A,I=!0)),k&&I)return!1;if(u>f?h>d?(P=this.getCardinalDirection(C,D,4),F=this.getCardinalDirection(O,D,2)):(P=this.getCardinalDirection(-C,D,3),F=this.getCardinalDirection(-O,D,1)):h>d?(P=this.getCardinalDirection(-C,D,1),F=this.getCardinalDirection(-O,D,3)):(P=this.getCardinalDirection(C,D,2),F=this.getCardinalDirection(O,D,4)),!k)switch(P){case 1:$=m,B=u+-w/D,l[0]=B,l[1]=$;break;case 2:B=x,$=h+b*D,l[0]=B,l[1]=$;break;case 3:$=v,B=u+w/D,l[0]=B,l[1]=$;break;case 4:B=y,$=h+-b*D,l[0]=B,l[1]=$;break}if(!I)switch(F){case 1:Y=T,z=f+-N/D,l[2]=z,l[3]=Y;break;case 2:z=L,Y=d+M*D,l[2]=z,l[3]=Y;break;case 3:Y=A,z=f+N/D,l[2]=z,l[3]=Y;break;case 4:z=_,Y=d+-M*D,l[2]=z,l[3]=Y;break}}return!1},i.getCardinalDirection=function(a,s,l){return a>s?l:1+l%4},i.getIntersection=function(a,s,l,u){if(u==null)return this.getIntersection2(a,s,l);var h=a.x,f=a.y,d=s.x,p=s.y,m=l.x,g=l.y,y=u.x,v=u.y,x=void 0,b=void 0,w=void 0,S=void 0,T=void 0,E=void 0,_=void 0,A=void 0,L=void 0;return w=p-f,T=h-d,_=d*f-h*p,S=v-g,E=m-y,A=y*g-m*v,L=w*E-S*T,L===0?null:(x=(T*A-E*_)/L,b=(S*_-w*A)/L,new n(x,b))},i.angleOfVector=function(a,s,l,u){var h=void 0;return a!==l?(h=Math.atan((u-s)/(l-a)),l=0){var v=(-m+Math.sqrt(m*m-4*p*g))/(2*p),x=(-m-Math.sqrt(m*m-4*p*g))/(2*p),b=null;return v>=0&&v<=1?[v]:x>=0&&x<=1?[x]:b}else return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,t.exports=i},function(t,e,r){"use strict";function n(){}o(n,"IMath"),n.sign=function(i){return i>0?1:i<0?-1:0},n.floor=function(i){return i<0?Math.ceil(i):Math.floor(i)},n.ceil=function(i){return i<0?Math.floor(i):Math.ceil(i)},t.exports=n},function(t,e,r){"use strict";function n(){}o(n,"Integer"),n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,t.exports=n},function(t,e,r){"use strict";var n=function(){function h(f,d){for(var p=0;p"u"?"undefined":n(a);return a==null||s!="object"&&s!="function"},t.exports=i},function(t,e,r){"use strict";function n(m){if(Array.isArray(m)){for(var g=0,y=Array(m.length);g0&&g;){for(w.push(T[0]);w.length>0&&g;){var E=w[0];w.splice(0,1),b.add(E);for(var _=E.getEdges(),x=0;x<_.length;x++){var A=_[x].getOtherEnd(E);if(S.get(E)!=A)if(!b.has(A))w.push(A),S.set(A,E);else{g=!1;break}}}if(!g)m=[];else{var L=[].concat(n(b));m.push(L);for(var x=0;x-1&&T.splice(N,1)}b=new Set,S=new Map}}return m},p.prototype.createDummyNodesForBendpoints=function(m){for(var g=[],y=m.source,v=this.graphManager.calcLowestCommonAncestor(m.source,m.target),x=0;x0){for(var v=this.edgeToDummyNodes.get(y),x=0;x=0&&g.splice(A,1);var L=S.getNeighborsList();L.forEach(function(k){if(y.indexOf(k)<0){var I=v.get(k),C=I-1;C==1&&E.push(k),v.set(k,C)}})}y=y.concat(E),(g.length==1||g.length==2)&&(x=!0,b=g[0])}return b},p.prototype.setGraphManager=function(m){this.graphManager=m},t.exports=p},function(t,e,r){"use strict";function n(){}o(n,"RandomSeed"),n.seed=1,n.x=0,n.nextDouble=function(){return n.x=Math.sin(n.seed++)*1e4,n.x-Math.floor(n.x)},t.exports=n},function(t,e,r){"use strict";var n=r(5);function i(a,s){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}o(i,"Transform"),i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(a){this.lworldExtX=a},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(a){this.lworldExtY=a},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},i.prototype.transformX=function(a){var s=0,l=this.lworldExtX;return l!=0&&(s=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/l),s},i.prototype.transformY=function(a){var s=0,l=this.lworldExtY;return l!=0&&(s=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/l),s},i.prototype.inverseTransformX=function(a){var s=0,l=this.ldeviceExtX;return l!=0&&(s=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/l),s},i.prototype.inverseTransformY=function(a){var s=0,l=this.ldeviceExtY;return l!=0&&(s=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/l),s},i.prototype.inverseTransformPoint=function(a){var s=new n(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return s},t.exports=i},function(t,e,r){"use strict";function n(d){if(Array.isArray(d)){for(var p=0,m=Array(d.length);pa.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(d-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(d>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(d-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var d=this.getAllEdges(),p,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,g,y,v,x=this.getAllNodes(),b;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&d&&this.updateGrid(),b=new Set,m=0;mw||b>w)&&(d.gravitationForceX=-this.gravityConstant*y,d.gravitationForceY=-this.gravityConstant*v)):(w=p.getEstimatedSize()*this.compoundGravityRangeFactor,(x>w||b>w)&&(d.gravitationForceX=-this.gravityConstant*y*this.compoundGravityConstant,d.gravitationForceY=-this.gravityConstant*v*this.compoundGravityConstant))},h.prototype.isConverged=function(){var d,p=!1;return this.totalIterations>this.maxIterations/3&&(p=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),d=this.totalDisplacement=x.length||w>=x[0].length)){for(var S=0;Sh},"_defaultCompareFunction")}]),l}();t.exports=s},function(t,e,r){"use strict";function n(){}o(n,"SVD"),n.svd=function(i){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=i.length,this.n=i[0].length;var a=Math.min(this.m,this.n);this.s=function(it){for(var dt=[];it-- >0;)dt.push(0);return dt}(Math.min(this.m+1,this.n)),this.U=function(it){var dt=o(function lt(It){if(It.length==0)return 0;for(var mt=[],St=0;St0;)dt.push(0);return dt}(this.n),l=function(it){for(var dt=[];it-- >0;)dt.push(0);return dt}(this.m),u=!0,h=!0,f=Math.min(this.m-1,this.n),d=Math.max(0,Math.min(this.n-2,this.m)),p=0;p=0;D--)if(this.s[D]!==0){for(var P=D+1;P=0;X--){if(function(it,dt){return it&&dt}(X0;){var ue=void 0,te=void 0;for(ue=I-2;ue>=-1&&ue!==-1;ue--)if(Math.abs(s[ue])<=ce+se*(Math.abs(this.s[ue])+Math.abs(this.s[ue+1]))){s[ue]=0;break}if(ue===I-2)te=4;else{var De=void 0;for(De=I-1;De>=ue&&De!==ue;De--){var oe=(De!==I?Math.abs(s[De]):0)+(De!==ue+1?Math.abs(s[De-1]):0);if(Math.abs(this.s[De])<=ce+se*oe){this.s[De]=0;break}}De===ue?te=3:De===I-1?te=1:(te=2,ue=De)}switch(ue++,te){case 1:{var ke=s[I-2];s[I-2]=0;for(var Ie=I-2;Ie>=ue;Ie--){var Se=n.hypot(this.s[Ie],ke),Ue=this.s[Ie]/Se,Pe=ke/Se;if(this.s[Ie]=Se,Ie!==ue&&(ke=-Pe*s[Ie-1],s[Ie-1]=Ue*s[Ie-1]),h)for(var _e=0;_e=this.s[ue+1]);){var je=this.s[ue];if(this.s[ue]=this.s[ue+1],this.s[ue+1]=je,h&&ueMath.abs(a)?(s=a/i,s=Math.abs(i)*Math.sqrt(1+s*s)):a!=0?(s=i/a,s=Math.abs(a)*Math.sqrt(1+s*s)):s=0,s},t.exports=n},function(t,e,r){"use strict";var n=function(){function s(l,u){for(var h=0;h2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;i(this,s),this.sequence1=l,this.sequence2=u,this.match_score=h,this.mismatch_penalty=f,this.gap_penalty=d,this.iMax=l.length+1,this.jMax=u.length+1,this.grid=new Array(this.iMax);for(var p=0;p=0;l--){var u=this.listeners[l];u.event===a&&u.callback===s&&this.listeners.splice(l,1)}},i.emit=function(a,s){for(var l=0;l{"use strict";o(function(e,r){typeof vb=="object"&&typeof QB=="object"?QB.exports=r(KB()):typeof define=="function"&&define.amd?define(["layout-base"],r):typeof vb=="object"?vb.coseBase=r(KB()):e.coseBase=r(e.layoutBase)},"webpackUniversalModuleDefinition")(vb,function(t){return(()=>{"use strict";var e={45:(a,s,l)=>{var u={};u.layoutBase=l(551),u.CoSEConstants=l(806),u.CoSEEdge=l(767),u.CoSEGraph=l(880),u.CoSEGraphManager=l(578),u.CoSELayout=l(765),u.CoSENode=l(991),u.ConstraintHandler=l(902),a.exports=u},806:(a,s,l)=>{var u=l(551).FDLayoutConstants;function h(){}o(h,"CoSEConstants");for(var f in u)h[f]=u[f];h.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,h.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH,h.DEFAULT_COMPONENT_SEPERATION=60,h.TILE=!0,h.TILING_PADDING_VERTICAL=10,h.TILING_PADDING_HORIZONTAL=10,h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!0,h.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,h.TREE_REDUCTION_ON_INCREMENTAL=!0,h.PURE_INCREMENTAL=h.DEFAULT_INCREMENTAL,a.exports=h},767:(a,s,l)=>{var u=l(551).FDLayoutEdge;function h(d,p,m){u.call(this,d,p,m)}o(h,"CoSEEdge"),h.prototype=Object.create(u.prototype);for(var f in u)h[f]=u[f];a.exports=h},880:(a,s,l)=>{var u=l(551).LGraph;function h(d,p,m){u.call(this,d,p,m)}o(h,"CoSEGraph"),h.prototype=Object.create(u.prototype);for(var f in u)h[f]=u[f];a.exports=h},578:(a,s,l)=>{var u=l(551).LGraphManager;function h(d){u.call(this,d)}o(h,"CoSEGraphManager"),h.prototype=Object.create(u.prototype);for(var f in u)h[f]=u[f];a.exports=h},765:(a,s,l)=>{var u=l(551).FDLayout,h=l(578),f=l(880),d=l(991),p=l(767),m=l(806),g=l(902),y=l(551).FDLayoutConstants,v=l(551).LayoutConstants,x=l(551).Point,b=l(551).PointD,w=l(551).DimensionD,S=l(551).Layout,T=l(551).Integer,E=l(551).IGeometry,_=l(551).LGraph,A=l(551).Transform,L=l(551).LinkedList;function M(){u.call(this),this.toBeTiled={},this.constraints={}}o(M,"CoSELayout"),M.prototype=Object.create(u.prototype);for(var N in u)M[N]=u[N];M.prototype.newGraphManager=function(){var k=new h(this);return this.graphManager=k,k},M.prototype.newGraph=function(k){return new f(null,this.graphManager,k)},M.prototype.newNode=function(k){return new d(this.graphManager,k)},M.prototype.newEdge=function(k){return new p(null,null,k)},M.prototype.initParameters=function(){u.prototype.initParameters.call(this,arguments),this.isSubLayout||(m.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=m.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=m.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=y.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=y.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){u.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/y.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){var k=v.DEFAULT_CREATE_BENDS_AS_NEEDED;return k&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes()),C=this.nodesWithGravity.filter(function(P){return I.has(P)});this.graphManager.setAllNodesToApplyGravitation(C)}}else{var k=this.getFlatForest();if(k.length>0)this.positionNodesRadially(k);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes()),C=this.nodesWithGravity.filter(function(O){return I.has(O)});this.graphManager.setAllNodesToApplyGravitation(C),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(g.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%y.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var k=new Set(this.getAllNodes()),I=this.nodesWithGravity.filter(function(D){return k.has(D)});this.graphManager.setAllNodesToApplyGravitation(I),this.graphManager.updateBounds(),this.updateGrid(),m.PURE_INCREMENTAL?this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),m.PURE_INCREMENTAL?this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var C=!this.isTreeGrowing&&!this.isGrowthFinished,O=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(C,O),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var k=this.graphManager.getAllNodes(),I={},C=0;C0&&this.updateDisplacements();for(var C=0;C0&&(O.fixedNodeWeight=P)}}if(this.constraints.relativePlacementConstraint){var F=new Map,B=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(J){k.fixedNodesOnHorizontal.add(J),k.fixedNodesOnVertical.add(J)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var $=this.constraints.alignmentConstraint.vertical,C=0;C<$.length;C++)this.dummyToNodeForVerticalAlignment.set("dummy"+C,[]),$[C].forEach(function(Z){F.set(Z,"dummy"+C),k.dummyToNodeForVerticalAlignment.get("dummy"+C).push(Z),k.fixedNodeSet.has(Z)&&k.fixedNodesOnHorizontal.add("dummy"+C)});if(this.constraints.alignmentConstraint.horizontal)for(var z=this.constraints.alignmentConstraint.horizontal,C=0;C=2*J.length/3;q--)Z=Math.floor(Math.random()*(q+1)),H=J[q],J[q]=J[Z],J[Z]=H;return J},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(J){if(J.left){var Z=F.has(J.left)?F.get(J.left):J.left,H=F.has(J.right)?F.get(J.right):J.right;k.nodesInRelativeHorizontal.includes(Z)||(k.nodesInRelativeHorizontal.push(Z),k.nodeToRelativeConstraintMapHorizontal.set(Z,[]),k.dummyToNodeForVerticalAlignment.has(Z)?k.nodeToTempPositionMapHorizontal.set(Z,k.idToNodeMap.get(k.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):k.nodeToTempPositionMapHorizontal.set(Z,k.idToNodeMap.get(Z).getCenterX())),k.nodesInRelativeHorizontal.includes(H)||(k.nodesInRelativeHorizontal.push(H),k.nodeToRelativeConstraintMapHorizontal.set(H,[]),k.dummyToNodeForVerticalAlignment.has(H)?k.nodeToTempPositionMapHorizontal.set(H,k.idToNodeMap.get(k.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):k.nodeToTempPositionMapHorizontal.set(H,k.idToNodeMap.get(H).getCenterX())),k.nodeToRelativeConstraintMapHorizontal.get(Z).push({right:H,gap:J.gap}),k.nodeToRelativeConstraintMapHorizontal.get(H).push({left:Z,gap:J.gap})}else{var q=B.has(J.top)?B.get(J.top):J.top,K=B.has(J.bottom)?B.get(J.bottom):J.bottom;k.nodesInRelativeVertical.includes(q)||(k.nodesInRelativeVertical.push(q),k.nodeToRelativeConstraintMapVertical.set(q,[]),k.dummyToNodeForHorizontalAlignment.has(q)?k.nodeToTempPositionMapVertical.set(q,k.idToNodeMap.get(k.dummyToNodeForHorizontalAlignment.get(q)[0]).getCenterY()):k.nodeToTempPositionMapVertical.set(q,k.idToNodeMap.get(q).getCenterY())),k.nodesInRelativeVertical.includes(K)||(k.nodesInRelativeVertical.push(K),k.nodeToRelativeConstraintMapVertical.set(K,[]),k.dummyToNodeForHorizontalAlignment.has(K)?k.nodeToTempPositionMapVertical.set(K,k.idToNodeMap.get(k.dummyToNodeForHorizontalAlignment.get(K)[0]).getCenterY()):k.nodeToTempPositionMapVertical.set(K,k.idToNodeMap.get(K).getCenterY())),k.nodeToRelativeConstraintMapVertical.get(q).push({bottom:K,gap:J.gap}),k.nodeToRelativeConstraintMapVertical.get(K).push({top:q,gap:J.gap})}});else{var Y=new Map,Q=new Map;this.constraints.relativePlacementConstraint.forEach(function(J){if(J.left){var Z=F.has(J.left)?F.get(J.left):J.left,H=F.has(J.right)?F.get(J.right):J.right;Y.has(Z)?Y.get(Z).push(H):Y.set(Z,[H]),Y.has(H)?Y.get(H).push(Z):Y.set(H,[Z])}else{var q=B.has(J.top)?B.get(J.top):J.top,K=B.has(J.bottom)?B.get(J.bottom):J.bottom;Q.has(q)?Q.get(q).push(K):Q.set(q,[K]),Q.has(K)?Q.get(K).push(q):Q.set(K,[q])}});var X=o(function(Z,H){var q=[],K=[],se=new L,ce=new Set,ue=0;return Z.forEach(function(te,De){if(!ce.has(De)){q[ue]=[],K[ue]=!1;var oe=De;for(se.push(oe),ce.add(oe),q[ue].push(oe);se.length!=0;){oe=se.shift(),H.has(oe)&&(K[ue]=!0);var ke=Z.get(oe);ke.forEach(function(Ie){ce.has(Ie)||(se.push(Ie),ce.add(Ie),q[ue].push(Ie))})}ue++}}),{components:q,isFixed:K}},"constructComponents"),ie=X(Y,k.fixedNodesOnHorizontal);this.componentsOnHorizontal=ie.components,this.fixedComponentsOnHorizontal=ie.isFixed;var j=X(Q,k.fixedNodesOnVertical);this.componentsOnVertical=j.components,this.fixedComponentsOnVertical=j.isFixed}}},M.prototype.updateDisplacements=function(){var k=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(j){var J=k.idToNodeMap.get(j.nodeId);J.displacementX=0,J.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var I=this.constraints.alignmentConstraint.vertical,C=0;C1){var B;for(B=0;BO&&(O=Math.floor(F.y)),P=Math.floor(F.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new b(v.WORLD_CENTER_X-F.x/2,v.WORLD_CENTER_Y-F.y/2))},M.radialLayout=function(k,I,C){var O=Math.max(this.maxDiagonalInTree(k),m.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(I,null,0,359,0,O);var D=_.calculateBounds(k),P=new A;P.setDeviceOrgX(D.getMinX()),P.setDeviceOrgY(D.getMinY()),P.setWorldOrgX(C.x),P.setWorldOrgY(C.y);for(var F=0;F1;){var q=H[0];H.splice(0,1);var K=X.indexOf(q);K>=0&&X.splice(K,1),J--,ie--}I!=null?Z=(X.indexOf(H[0])+1)%J:Z=0;for(var se=Math.abs(O-C)/ie,ce=Z;j!=ie;ce=++ce%J){var ue=X[ce].getOtherEnd(k);if(ue!=I){var te=(C+j*se)%360,De=(te+se)%360;M.branchRadialLayout(ue,k,te,De,D+P,P),j++}}},M.maxDiagonalInTree=function(k){for(var I=T.MIN_VALUE,C=0;CI&&(I=D)}return I},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var k=this,I={};this.memberGroups={},this.idToDummyNode={};for(var C=[],O=this.graphManager.getAllNodes(),D=0;D"u"&&(I[B]=[]),I[B]=I[B].concat(P)}Object.keys(I).forEach(function($){if(I[$].length>1){var z="DummyCompound_"+$;k.memberGroups[z]=I[$];var Y=I[$][0].getParent(),Q=new d(k.graphManager);Q.id=z,Q.paddingLeft=Y.paddingLeft||0,Q.paddingRight=Y.paddingRight||0,Q.paddingBottom=Y.paddingBottom||0,Q.paddingTop=Y.paddingTop||0,k.idToDummyNode[z]=Q;var X=k.getGraphManager().add(k.newGraph(),Q),ie=Y.getChild();ie.add(Q);for(var j=0;jD?(O.rect.x-=(O.labelWidth-D)/2,O.setWidth(O.labelWidth),O.labelMarginLeft=(O.labelWidth-D)/2):O.labelPosHorizontal=="right"&&O.setWidth(D+O.labelWidth)),O.labelHeight&&(O.labelPosVertical=="top"?(O.rect.y-=O.labelHeight,O.setHeight(P+O.labelHeight),O.labelMarginTop=O.labelHeight):O.labelPosVertical=="center"&&O.labelHeight>P?(O.rect.y-=(O.labelHeight-P)/2,O.setHeight(O.labelHeight),O.labelMarginTop=(O.labelHeight-P)/2):O.labelPosVertical=="bottom"&&O.setHeight(P+O.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var k=this.compoundOrder.length-1;k>=0;k--){var I=this.compoundOrder[k],C=I.id,O=I.paddingLeft,D=I.paddingTop,P=I.labelMarginLeft,F=I.labelMarginTop;this.adjustLocations(this.tiledMemberPack[C],I.rect.x,I.rect.y,O,D,P,F)}},M.prototype.repopulateZeroDegreeMembers=function(){var k=this,I=this.tiledZeroDegreePack;Object.keys(I).forEach(function(C){var O=k.idToDummyNode[C],D=O.paddingLeft,P=O.paddingTop,F=O.labelMarginLeft,B=O.labelMarginTop;k.adjustLocations(I[C],O.rect.x,O.rect.y,D,P,F,B)})},M.prototype.getToBeTiled=function(k){var I=k.id;if(this.toBeTiled[I]!=null)return this.toBeTiled[I];var C=k.getChild();if(C==null)return this.toBeTiled[I]=!1,!1;for(var O=C.getNodes(),D=0;D0)return this.toBeTiled[I]=!1,!1;if(P.getChild()==null){this.toBeTiled[P.id]=!1;continue}if(!this.getToBeTiled(P))return this.toBeTiled[I]=!1,!1}return this.toBeTiled[I]=!0,!0},M.prototype.getNodeDegree=function(k){for(var I=k.id,C=k.getEdges(),O=0,D=0;DY&&(Y=X.rect.height)}C+=Y+k.verticalPadding}},M.prototype.tileCompoundMembers=function(k,I){var C=this;this.tiledMemberPack=[],Object.keys(k).forEach(function(O){var D=I[O];if(C.tiledMemberPack[O]=C.tileNodes(k[O],D.paddingLeft+D.paddingRight),D.rect.width=C.tiledMemberPack[O].width,D.rect.height=C.tiledMemberPack[O].height,D.setCenter(C.tiledMemberPack[O].centerX,C.tiledMemberPack[O].centerY),D.labelMarginLeft=0,D.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var P=D.rect.width,F=D.rect.height;D.labelWidth&&(D.labelPosHorizontal=="left"?(D.rect.x-=D.labelWidth,D.setWidth(P+D.labelWidth),D.labelMarginLeft=D.labelWidth):D.labelPosHorizontal=="center"&&D.labelWidth>P?(D.rect.x-=(D.labelWidth-P)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-P)/2):D.labelPosHorizontal=="right"&&D.setWidth(P+D.labelWidth)),D.labelHeight&&(D.labelPosVertical=="top"?(D.rect.y-=D.labelHeight,D.setHeight(F+D.labelHeight),D.labelMarginTop=D.labelHeight):D.labelPosVertical=="center"&&D.labelHeight>F?(D.rect.y-=(D.labelHeight-F)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-F)/2):D.labelPosVertical=="bottom"&&D.setHeight(F+D.labelHeight))}})},M.prototype.tileNodes=function(k,I){var C=this.tileNodesByFavoringDim(k,I,!0),O=this.tileNodesByFavoringDim(k,I,!1),D=this.getOrgRatio(C),P=this.getOrgRatio(O),F;return PB&&(B=j.getWidth())});var $=P/D,z=F/D,Y=Math.pow(C-O,2)+4*($+O)*(z+C)*D,Q=(O-C+Math.sqrt(Y))/(2*($+O)),X;I?(X=Math.ceil(Q),X==Q&&X++):X=Math.floor(Q);var ie=X*($+O)-O;return B>ie&&(ie=B),ie+=O*2,ie},M.prototype.tileNodesByFavoringDim=function(k,I,C){var O=m.TILING_PADDING_VERTICAL,D=m.TILING_PADDING_HORIZONTAL,P=m.TILING_COMPARE_BY,F={rows:[],rowWidth:[],rowHeight:[],width:0,height:I,verticalPadding:O,horizontalPadding:D,centerX:0,centerY:0};P&&(F.idealRowWidth=this.calcIdealRowWidth(k,C));var B=o(function(J){return J.rect.width*J.rect.height},"getNodeArea"),$=o(function(J,Z){return B(Z)-B(J)},"areaCompareFcn");k.sort(function(j,J){var Z=$;return F.idealRowWidth?(Z=P,Z(j.id,J.id)):Z(j,J)});for(var z=0,Y=0,Q=0;Q0&&(F+=k.horizontalPadding),k.rowWidth[C]=F,k.width0&&(B+=k.verticalPadding);var $=0;B>k.rowHeight[C]&&($=k.rowHeight[C],k.rowHeight[C]=B,$=k.rowHeight[C]-$),k.height+=$,k.rows[C].push(I)},M.prototype.getShortestRowIndex=function(k){for(var I=-1,C=Number.MAX_VALUE,O=0;OC&&(I=O,C=k.rowWidth[O]);return I},M.prototype.canAddHorizontal=function(k,I,C){if(k.idealRowWidth){var O=k.rows.length-1,D=k.rowWidth[O];return D+I+k.horizontalPadding<=k.idealRowWidth}var P=this.getShortestRowIndex(k);if(P<0)return!0;var F=k.rowWidth[P];if(F+k.horizontalPadding+I<=k.width)return!0;var B=0;k.rowHeight[P]0&&(B=C+k.verticalPadding-k.rowHeight[P]);var $;k.width-F>=I+k.horizontalPadding?$=(k.height+B)/(F+I+k.horizontalPadding):$=(k.height+B)/k.width,B=C+k.verticalPadding;var z;return k.widthP&&I!=C){O.splice(-1,1),k.rows[C].push(D),k.rowWidth[I]=k.rowWidth[I]-P,k.rowWidth[C]=k.rowWidth[C]+P,k.width=k.rowWidth[instance.getLongestRowIndex(k)];for(var F=Number.MIN_VALUE,B=0;BF&&(F=O[B].height);I>0&&(F+=k.verticalPadding);var $=k.rowHeight[I]+k.rowHeight[C];k.rowHeight[I]=F,k.rowHeight[C]0)for(var ie=D;ie<=P;ie++)X[0]+=this.grid[ie][F-1].length+this.grid[ie][F].length-1;if(P0)for(var ie=F;ie<=B;ie++)X[3]+=this.grid[D-1][ie].length+this.grid[D][ie].length-1;for(var j=T.MAX_VALUE,J,Z,H=0;H{var u=l(551).FDLayoutNode,h=l(551).IMath;function f(p,m,g,y){u.call(this,p,m,g,y)}o(f,"CoSENode"),f.prototype=Object.create(u.prototype);for(var d in u)f[d]=u[d];f.prototype.calculateDisplacement=function(){var p=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=p.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=p.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=p.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=p.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>p.coolingFactor*p.maxNodeDisplacement&&(this.displacementX=p.coolingFactor*p.maxNodeDisplacement*h.sign(this.displacementX)),Math.abs(this.displacementY)>p.coolingFactor*p.maxNodeDisplacement&&(this.displacementY=p.coolingFactor*p.maxNodeDisplacement*h.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(p,m){for(var g=this.getChild().getNodes(),y,v=0;v{function u(g){if(Array.isArray(g)){for(var y=0,v=Array(g.length);y0){var Je=0;Ye.forEach(function(je){we=="horizontal"?(ye.set(je,x.has(je)?b[x.get(je)]:Ce.get(je)),Je+=ye.get(je)):(ye.set(je,x.has(je)?w[x.get(je)]:Ce.get(je)),Je+=ye.get(je))}),Je=Je/Ye.length,tt.forEach(function(je){Te.has(je)||ye.set(je,Je)})}else{var Ve=0;tt.forEach(function(je){we=="horizontal"?Ve+=x.has(je)?b[x.get(je)]:Ce.get(je):Ve+=x.has(je)?w[x.get(je)]:Ce.get(je)}),Ve=Ve/tt.length,tt.forEach(function(je){ye.set(je,Ve)})}});for(var Ze=o(function(){var Ye=ze.shift(),Je=ae.get(Ye);Je.forEach(function(Ve){if(ye.get(Ve.id)je&&(je=mt),Stkt&&(kt=St)}}catch(Qn){xt=!0,it=Qn}finally{try{!at&&dt.return&&dt.return()}finally{if(xt)throw it}}var gr=(Je+je)/2-(Ve+kt)/2,xn=!0,jt=!1,rn=void 0;try{for(var Er=tt[Symbol.iterator](),Kn;!(xn=(Kn=Er.next()).done);xn=!0){var hn=Kn.value;ye.set(hn,ye.get(hn)+gr)}}catch(Qn){jt=!0,rn=Qn}finally{try{!xn&&Er.return&&Er.return()}finally{if(jt)throw rn}}})}return ye},"findAppropriatePositionForRelativePlacement"),N=o(function(ae){var we=0,Te=0,Ce=0,Ae=0;if(ae.forEach(function(He){He.left?b[x.get(He.left)]-b[x.get(He.right)]>=0?we++:Te++:w[x.get(He.top)]-w[x.get(He.bottom)]>=0?Ce++:Ae++}),we>Te&&Ce>Ae)for(var Ge=0;GeTe)for(var Me=0;MeAe)for(var ye=0;ye1)y.fixedNodeConstraint.forEach(function(ne,ae){O[ae]=[ne.position.x,ne.position.y],D[ae]=[b[x.get(ne.nodeId)],w[x.get(ne.nodeId)]]}),P=!0;else if(y.alignmentConstraint)(function(){var ne=0;if(y.alignmentConstraint.vertical){for(var ae=y.alignmentConstraint.vertical,we=o(function(ye){var He=new Set;ae[ye].forEach(function(gt){He.add(gt)});var ze=new Set([].concat(u(He)).filter(function(gt){return B.has(gt)})),Ze=void 0;ze.size>0?Ze=b[x.get(ze.values().next().value)]:Ze=L(He).x,ae[ye].forEach(function(gt){O[ne]=[Ze,w[x.get(gt)]],D[ne]=[b[x.get(gt)],w[x.get(gt)]],ne++})},"_loop2"),Te=0;Te0?Ze=b[x.get(ze.values().next().value)]:Ze=L(He).y,Ce[ye].forEach(function(gt){O[ne]=[b[x.get(gt)],Ze],D[ne]=[b[x.get(gt)],w[x.get(gt)]],ne++})},"_loop3"),Ge=0;GeQ&&(Q=Y[ie].length,X=ie);if(Q0){var Ue={x:0,y:0};y.fixedNodeConstraint.forEach(function(ne,ae){var we={x:b[x.get(ne.nodeId)],y:w[x.get(ne.nodeId)]},Te=ne.position,Ce=A(Te,we);Ue.x+=Ce.x,Ue.y+=Ce.y}),Ue.x/=y.fixedNodeConstraint.length,Ue.y/=y.fixedNodeConstraint.length,b.forEach(function(ne,ae){b[ae]+=Ue.x}),w.forEach(function(ne,ae){w[ae]+=Ue.y}),y.fixedNodeConstraint.forEach(function(ne){b[x.get(ne.nodeId)]=ne.position.x,w[x.get(ne.nodeId)]=ne.position.y})}if(y.alignmentConstraint){if(y.alignmentConstraint.vertical)for(var Pe=y.alignmentConstraint.vertical,_e=o(function(ae){var we=new Set;Pe[ae].forEach(function(Ae){we.add(Ae)});var Te=new Set([].concat(u(we)).filter(function(Ae){return B.has(Ae)})),Ce=void 0;Te.size>0?Ce=b[x.get(Te.values().next().value)]:Ce=L(we).x,we.forEach(function(Ae){B.has(Ae)||(b[x.get(Ae)]=Ce)})},"_loop4"),me=0;me0?Ce=w[x.get(Te.values().next().value)]:Ce=L(we).y,we.forEach(function(Ae){B.has(Ae)||(w[x.get(Ae)]=Ce)})},"_loop5"),ge=0;ge{a.exports=t}},r={};function n(a){var s=r[a];if(s!==void 0)return s.exports;var l=r[a]={exports:{}};return e[a](l,l.exports,n),l.exports}o(n,"__webpack_require__");var i=n(45);return i})()})});var X1e=gi((xb,JB)=>{"use strict";o(function(e,r){typeof xb=="object"&&typeof JB=="object"?JB.exports=r(ZB()):typeof define=="function"&&define.amd?define(["cose-base"],r):typeof xb=="object"?xb.cytoscapeFcose=r(ZB()):e.cytoscapeFcose=r(e.coseBase)},"webpackUniversalModuleDefinition")(xb,function(t){return(()=>{"use strict";var e={658:a=>{a.exports=Object.assign!=null?Object.assign.bind(Object):function(s){for(var l=arguments.length,u=Array(l>1?l-1:0),h=1;h{var u=function(){function d(p,m){var g=[],y=!0,v=!1,x=void 0;try{for(var b=p[Symbol.iterator](),w;!(y=(w=b.next()).done)&&(g.push(w.value),!(m&&g.length===m));y=!0);}catch(S){v=!0,x=S}finally{try{!y&&b.return&&b.return()}finally{if(v)throw x}}return g}return o(d,"sliceIterator"),function(p,m){if(Array.isArray(p))return p;if(Symbol.iterator in Object(p))return d(p,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=l(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(d){for(var p={},m=0;m0&&P.merge(z)});for(var F=0;F1){w=x[0],S=w.connectedEdges().length,x.forEach(function(D){D.connectedEdges().length0&&g.set("dummy"+(g.size+1),_),A},f.relocateComponent=function(d,p,m){if(!m.fixedNodeConstraint){var g=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,v=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var b=!0,w=!1,S=void 0;try{for(var T=p.nodeIndexes[Symbol.iterator](),E;!(b=(E=T.next()).done);b=!0){var _=E.value,A=u(_,2),L=A[0],M=A[1],N=m.cy.getElementById(L);if(N){var k=N.boundingBox(),I=p.xCoords[M]-k.w/2,C=p.xCoords[M]+k.w/2,O=p.yCoords[M]-k.h/2,D=p.yCoords[M]+k.h/2;Iy&&(y=C),Ox&&(x=D)}}}catch(z){w=!0,S=z}finally{try{!b&&T.return&&T.return()}finally{if(w)throw S}}var P=d.x-(y+g)/2,F=d.y-(x+v)/2;p.xCoords=p.xCoords.map(function(z){return z+P}),p.yCoords=p.yCoords.map(function(z){return z+F})}else{Object.keys(p).forEach(function(z){var Y=p[z],Q=Y.getRect().x,X=Y.getRect().x+Y.getRect().width,ie=Y.getRect().y,j=Y.getRect().y+Y.getRect().height;Qy&&(y=X),iex&&(x=j)});var B=d.x-(y+g)/2,$=d.y-(x+v)/2;Object.keys(p).forEach(function(z){var Y=p[z];Y.setCenter(Y.getCenterX()+B,Y.getCenterY()+$)})}}},f.calcBoundingBox=function(d,p,m,g){for(var y=Number.MAX_SAFE_INTEGER,v=Number.MIN_SAFE_INTEGER,x=Number.MAX_SAFE_INTEGER,b=Number.MIN_SAFE_INTEGER,w=void 0,S=void 0,T=void 0,E=void 0,_=d.descendants().not(":parent"),A=_.length,L=0;Lw&&(y=w),vT&&(x=T),b{var u=l(548),h=l(140).CoSELayout,f=l(140).CoSENode,d=l(140).layoutBase.PointD,p=l(140).layoutBase.DimensionD,m=l(140).layoutBase.LayoutConstants,g=l(140).layoutBase.FDLayoutConstants,y=l(140).CoSEConstants,v=o(function(b,w){var S=b.cy,T=b.eles,E=T.nodes(),_=T.edges(),A=void 0,L=void 0,M=void 0,N={};b.randomize&&(A=w.nodeIndexes,L=w.xCoords,M=w.yCoords);var k=o(function(z){return typeof z=="function"},"isFn"),I=o(function(z,Y){return k(z)?z(Y):z},"optFn"),C=u.calcParentsWithoutChildren(S,T),O=o(function $(z,Y,Q,X){for(var ie=Y.length,j=0;j0){var se=void 0;se=Q.getGraphManager().add(Q.newGraph(),H),$(se,Z,Q,X)}}},"processChildrenList"),D=o(function(z,Y,Q){for(var X=0,ie=0,j=0;j0?y.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=X/ie:k(b.idealEdgeLength)?y.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=50:y.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=b.idealEdgeLength,y.MIN_REPULSION_DIST=g.MIN_REPULSION_DIST=g.DEFAULT_EDGE_LENGTH/10,y.DEFAULT_RADIAL_SEPARATION=g.DEFAULT_EDGE_LENGTH)},"processEdges"),P=o(function(z,Y){Y.fixedNodeConstraint&&(z.constraints.fixedNodeConstraint=Y.fixedNodeConstraint),Y.alignmentConstraint&&(z.constraints.alignmentConstraint=Y.alignmentConstraint),Y.relativePlacementConstraint&&(z.constraints.relativePlacementConstraint=Y.relativePlacementConstraint)},"processConstraints");b.nestingFactor!=null&&(y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=b.nestingFactor),b.gravity!=null&&(y.DEFAULT_GRAVITY_STRENGTH=g.DEFAULT_GRAVITY_STRENGTH=b.gravity),b.numIter!=null&&(y.MAX_ITERATIONS=g.MAX_ITERATIONS=b.numIter),b.gravityRange!=null&&(y.DEFAULT_GRAVITY_RANGE_FACTOR=g.DEFAULT_GRAVITY_RANGE_FACTOR=b.gravityRange),b.gravityCompound!=null&&(y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH=b.gravityCompound),b.gravityRangeCompound!=null&&(y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=b.gravityRangeCompound),b.initialEnergyOnIncremental!=null&&(y.DEFAULT_COOLING_FACTOR_INCREMENTAL=g.DEFAULT_COOLING_FACTOR_INCREMENTAL=b.initialEnergyOnIncremental),b.tilingCompareBy!=null&&(y.TILING_COMPARE_BY=b.tilingCompareBy),b.quality=="proof"?m.QUALITY=2:m.QUALITY=0,y.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=b.nodeDimensionsIncludeLabels,y.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!b.randomize,y.ANIMATE=g.ANIMATE=m.ANIMATE=b.animate,y.TILE=b.tile,y.TILING_PADDING_VERTICAL=typeof b.tilingPaddingVertical=="function"?b.tilingPaddingVertical.call():b.tilingPaddingVertical,y.TILING_PADDING_HORIZONTAL=typeof b.tilingPaddingHorizontal=="function"?b.tilingPaddingHorizontal.call():b.tilingPaddingHorizontal,y.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,y.PURE_INCREMENTAL=!b.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=b.uniformNodeDimensions,b.step=="transformed"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,y.ENFORCE_CONSTRAINTS=!1,y.APPLY_LAYOUT=!1),b.step=="enforced"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!0,y.APPLY_LAYOUT=!1),b.step=="cose"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!1,y.APPLY_LAYOUT=!0),b.step=="all"&&(b.randomize?y.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!0,y.APPLY_LAYOUT=!0),b.fixedNodeConstraint||b.alignmentConstraint||b.relativePlacementConstraint?y.TREE_REDUCTION_ON_INCREMENTAL=!1:y.TREE_REDUCTION_ON_INCREMENTAL=!0;var F=new h,B=F.newGraphManager();return O(B.addRoot(),u.getTopMostNodes(E),F,b),D(F,B,_),P(F,b),F.runLayout(),N},"coseLayout");a.exports={coseLayout:v}},212:(a,s,l)=>{var u=function(){function b(w,S){for(var T=0;T0)if(D){var B=d.getTopMostNodes(T.eles.nodes());if(k=d.connectComponents(E,T.eles,B),k.forEach(function(oe){var ke=oe.boundingBox();I.push({x:ke.x1+ke.w/2,y:ke.y1+ke.h/2})}),T.randomize&&k.forEach(function(oe){T.eles=oe,A.push(m(T))}),T.quality=="default"||T.quality=="proof"){var $=E.collection();if(T.tile){var z=new Map,Y=[],Q=[],X=0,ie={nodeIndexes:z,xCoords:Y,yCoords:Q},j=[];if(k.forEach(function(oe,ke){oe.edges().length==0&&(oe.nodes().forEach(function(Ie,Se){$.merge(oe.nodes()[Se]),Ie.isParent()||(ie.nodeIndexes.set(oe.nodes()[Se].id(),X++),ie.xCoords.push(oe.nodes()[0].position().x),ie.yCoords.push(oe.nodes()[0].position().y))}),j.push(ke))}),$.length>1){var J=$.boundingBox();I.push({x:J.x1+J.w/2,y:J.y1+J.h/2}),k.push($),A.push(ie);for(var Z=j.length-1;Z>=0;Z--)k.splice(j[Z],1),A.splice(j[Z],1),I.splice(j[Z],1)}}k.forEach(function(oe,ke){T.eles=oe,N.push(y(T,A[ke])),d.relocateComponent(I[ke],N[ke],T)})}else k.forEach(function(oe,ke){d.relocateComponent(I[ke],A[ke],T)});var H=new Set;if(k.length>1){var q=[],K=_.filter(function(oe){return oe.css("display")=="none"});k.forEach(function(oe,ke){var Ie=void 0;if(T.quality=="draft"&&(Ie=A[ke].nodeIndexes),oe.nodes().not(K).length>0){var Se={};Se.edges=[],Se.nodes=[];var Ue=void 0;oe.nodes().not(K).forEach(function(Pe){if(T.quality=="draft")if(!Pe.isParent())Ue=Ie.get(Pe.id()),Se.nodes.push({x:A[ke].xCoords[Ue]-Pe.boundingbox().w/2,y:A[ke].yCoords[Ue]-Pe.boundingbox().h/2,width:Pe.boundingbox().w,height:Pe.boundingbox().h});else{var _e=d.calcBoundingBox(Pe,A[ke].xCoords,A[ke].yCoords,Ie);Se.nodes.push({x:_e.topLeftX,y:_e.topLeftY,width:_e.width,height:_e.height})}else N[ke][Pe.id()]&&Se.nodes.push({x:N[ke][Pe.id()].getLeft(),y:N[ke][Pe.id()].getTop(),width:N[ke][Pe.id()].getWidth(),height:N[ke][Pe.id()].getHeight()})}),oe.edges().forEach(function(Pe){var _e=Pe.source(),me=Pe.target();if(_e.css("display")!="none"&&me.css("display")!="none")if(T.quality=="draft"){var W=Ie.get(_e.id()),fe=Ie.get(me.id()),ge=[],re=[];if(_e.isParent()){var he=d.calcBoundingBox(_e,A[ke].xCoords,A[ke].yCoords,Ie);ge.push(he.topLeftX+he.width/2),ge.push(he.topLeftY+he.height/2)}else ge.push(A[ke].xCoords[W]),ge.push(A[ke].yCoords[W]);if(me.isParent()){var ne=d.calcBoundingBox(me,A[ke].xCoords,A[ke].yCoords,Ie);re.push(ne.topLeftX+ne.width/2),re.push(ne.topLeftY+ne.height/2)}else re.push(A[ke].xCoords[fe]),re.push(A[ke].yCoords[fe]);Se.edges.push({startX:ge[0],startY:ge[1],endX:re[0],endY:re[1]})}else N[ke][_e.id()]&&N[ke][me.id()]&&Se.edges.push({startX:N[ke][_e.id()].getCenterX(),startY:N[ke][_e.id()].getCenterY(),endX:N[ke][me.id()].getCenterX(),endY:N[ke][me.id()].getCenterY()})}),Se.nodes.length>0&&(q.push(Se),H.add(ke))}});var se=O.packComponents(q,T.randomize).shifts;if(T.quality=="draft")A.forEach(function(oe,ke){var Ie=oe.xCoords.map(function(Ue){return Ue+se[ke].dx}),Se=oe.yCoords.map(function(Ue){return Ue+se[ke].dy});oe.xCoords=Ie,oe.yCoords=Se});else{var ce=0;H.forEach(function(oe){Object.keys(N[oe]).forEach(function(ke){var Ie=N[oe][ke];Ie.setCenter(Ie.getCenterX()+se[ce].dx,Ie.getCenterY()+se[ce].dy)}),ce++})}}}else{var P=T.eles.boundingBox();if(I.push({x:P.x1+P.w/2,y:P.y1+P.h/2}),T.randomize){var F=m(T);A.push(F)}T.quality=="default"||T.quality=="proof"?(N.push(y(T,A[0])),d.relocateComponent(I[0],N[0],T)):d.relocateComponent(I[0],A[0],T)}var ue=o(function(ke,Ie){if(T.quality=="default"||T.quality=="proof"){typeof ke=="number"&&(ke=Ie);var Se=void 0,Ue=void 0,Pe=ke.data("id");return N.forEach(function(me){Pe in me&&(Se={x:me[Pe].getRect().getCenterX(),y:me[Pe].getRect().getCenterY()},Ue=me[Pe])}),T.nodeDimensionsIncludeLabels&&(Ue.labelWidth&&(Ue.labelPosHorizontal=="left"?Se.x+=Ue.labelWidth/2:Ue.labelPosHorizontal=="right"&&(Se.x-=Ue.labelWidth/2)),Ue.labelHeight&&(Ue.labelPosVertical=="top"?Se.y+=Ue.labelHeight/2:Ue.labelPosVertical=="bottom"&&(Se.y-=Ue.labelHeight/2))),Se==null&&(Se={x:ke.position("x"),y:ke.position("y")}),{x:Se.x,y:Se.y}}else{var _e=void 0;return A.forEach(function(me){var W=me.nodeIndexes.get(ke.id());W!=null&&(_e={x:me.xCoords[W],y:me.yCoords[W]})}),_e==null&&(_e={x:ke.position("x"),y:ke.position("y")}),{x:_e.x,y:_e.y}}},"getPositions");if(T.quality=="default"||T.quality=="proof"||T.randomize){var te=d.calcParentsWithoutChildren(E,_),De=_.filter(function(oe){return oe.css("display")=="none"});T.eles=_.not(De),_.nodes().not(":parent").not(De).layoutPositions(S,T,ue),te.length>0&&te.forEach(function(oe){oe.position(ue(oe))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")},"run")}]),b}();a.exports=x},657:(a,s,l)=>{var u=l(548),h=l(140).layoutBase.Matrix,f=l(140).layoutBase.SVD,d=o(function(m){var g=m.cy,y=m.eles,v=y.nodes(),x=y.nodes(":parent"),b=new Map,w=new Map,S=new Map,T=[],E=[],_=[],A=[],L=[],M=[],N=[],k=[],I=void 0,C=void 0,O=1e8,D=1e-9,P=m.piTol,F=m.samplingType,B=m.nodeSeparation,$=void 0,z=o(function(){for(var we=0,Te=0,Ce=!1;Te<$;){we=Math.floor(Math.random()*C),Ce=!1;for(var Ae=0;Ae=Ge;){ye=Ae[Ge++];for(var tt=T[ye],Ye=0;YeZe&&(Ze=L[Ve],gt=Ve)}return gt},"BFS"),Q=o(function(we){var Te=void 0;if(we){Te=Math.floor(Math.random()*C),I=Te;for(var Ae=0;Ae=1)break;Ze=ze}for(var tt=0;tt=1)break;Ze=ze}for(var Je=0;Je0&&(Te.isParent()?T[we].push(S.get(Te.id())):T[we].push(Te.id()))})});var te=o(function(we){var Te=w.get(we),Ce=void 0;b.get(we).forEach(function(Ae){g.getElementById(Ae).isParent()?Ce=S.get(Ae):Ce=Ae,T[Te].push(Ce),T[w.get(Ce)].push(we)})},"_loop"),De=!0,oe=!1,ke=void 0;try{for(var Ie=b.keys()[Symbol.iterator](),Se;!(De=(Se=Ie.next()).done);De=!0){var Ue=Se.value;te(Ue)}}catch(ae){oe=!0,ke=ae}finally{try{!De&&Ie.return&&Ie.return()}finally{if(oe)throw ke}}C=w.size;var Pe=void 0;if(C>2){$=C{var u=l(212),h=o(function(d){d&&d("layout","fcose",u)},"register");typeof cytoscape<"u"&&h(cytoscape),a.exports=h},140:a=>{a.exports=t}},r={};function n(a){var s=r[a];if(s!==void 0)return s.exports;var l=r[a]={exports:{}};return e[a](l,l.exports,n),l.exports}o(n,"__webpack_require__");var i=n(579);return i})()})});var T1,J0,eF=R(()=>{"use strict";V1();T1=o(t=>`${t}`,"wrapIcon"),J0={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:T1('')},server:{body:T1('')},disk:{body:T1('')},internet:{body:T1('')},cloud:{body:T1('')},unknown:FC,blank:{body:T1("")}}}});var j1e,K1e,Q1e,Z1e,J1e=R(()=>{"use strict";V1();_t();Al();gb();eF();cC();j1e=o(async function(t,e){let r=Ci("padding"),n=Ci("iconSize"),i=n/2,a=n/6,s=a/2;await Promise.all(e.edges().map(async l=>{let{source:u,sourceDir:h,sourceArrow:f,sourceGroup:d,target:p,targetDir:m,targetArrow:g,targetGroup:y,label:v}=lC(l),{x,y:b}=l[0].sourceEndpoint(),{x:w,y:S}=l[0].midpoint(),{x:T,y:E}=l[0].targetEndpoint(),_=r+4;if(d&&(cs(h)?x+=h==="L"?-_:_:b+=h==="T"?-_:_+18),y&&(cs(m)?T+=m==="L"?-_:_:E+=m==="T"?-_:_+18),!d&&Z0.getNode(u)?.type==="junction"&&(cs(h)?x+=h==="L"?i:-i:b+=h==="T"?i:-i),!y&&Z0.getNode(p)?.type==="junction"&&(cs(m)?T+=m==="L"?i:-i:E+=m==="T"?i:-i),l[0]._private.rscratch){let A=t.insert("g");if(A.insert("path").attr("d",`M ${x},${b} L ${w},${S} L${T},${E} `).attr("class","edge"),f){let L=cs(h)?pb[h](x,a):x-s,M=Wc(h)?pb[h](b,a):b-s;A.insert("polygon").attr("points",qB[h](a)).attr("transform",`translate(${L},${M})`).attr("class","arrow")}if(g){let L=cs(m)?pb[m](T,a):T-s,M=Wc(m)?pb[m](E,a):E-s;A.insert("polygon").attr("points",qB[m](a)).attr("transform",`translate(${L},${M})`).attr("class","arrow")}if(v){let L=oC(h,m)?"XY":cs(h)?"X":"Y",M=0;L==="X"?M=Math.abs(x-T):L==="Y"?M=Math.abs(b-E)/1.5:M=Math.abs(x-T)/2;let N=A.append("g");if(await ta(N,v,{useHtmlLabels:!1,width:M,classes:"architecture-service-label"},de()),N.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),L==="X")N.attr("transform","translate("+w+", "+S+")");else if(L==="Y")N.attr("transform","translate("+w+", "+S+") rotate(-90)");else if(L==="XY"){let k=mb(h,m);if(k&&F1e(k)){let I=N.node().getBoundingClientRect(),[C,O]=G1e(k);N.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*C*O*45})`);let D=N.node().getBoundingClientRect();N.attr("transform",` + translate(${w}, ${S-I.height/2}) + translate(${C*D.width/2}, ${O*D.height/2}) + rotate(${-1*C*O*45}, 0, ${I.height/2}) + `)}}}}}))},"drawEdges"),K1e=o(async function(t,e){let n=Ci("padding")*.75,i=Ci("fontSize"),s=Ci("iconSize")/2;await Promise.all(e.nodes().map(async l=>{let u=If(l);if(u.type==="group"){let{h,w:f,x1:d,y1:p}=l.boundingBox();t.append("rect").attr("x",d+s).attr("y",p+s).attr("width",f).attr("height",h).attr("class","node-bkg");let m=t.append("g"),g=d,y=p;if(u.icon){let v=m.append("g");v.html(`${await zb(u.icon,{height:n,width:n,fallbackPrefix:J0.prefix})}`),v.attr("transform","translate("+(g+s+1)+", "+(y+s+1)+")"),g+=n,y+=i/2-1-2}if(u.label){let v=m.append("g");await ta(v,u.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},de()),v.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),v.attr("transform","translate("+(g+s+4)+", "+(y+s+2)+")")}}}))},"drawGroups"),Q1e=o(async function(t,e,r){for(let n of r){let i=e.append("g"),a=Ci("iconSize");if(n.title){let h=i.append("g");await ta(h,n.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},de()),h.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),h.attr("transform","translate("+a/2+", "+a+")")}let s=i.append("g");if(n.icon)s.html(`${await zb(n.icon,{height:a,width:a,fallbackPrefix:J0.prefix})}`);else if(n.iconText){s.html(`${await zb("blank",{height:a,width:a,fallbackPrefix:J0.prefix})}`);let d=s.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(n.iconText),p=parseInt(window.getComputedStyle(d.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;d.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/p)};`)}else s.append("path").attr("class","node-bkg").attr("id","node-"+n.id).attr("d",`M0 ${a} v${-a} q0,-5 5,-5 h${a} q5,0 5,5 v${a} H0 Z`);i.attr("class","architecture-service");let{width:l,height:u}=i._groups[0][0].getBBox();n.width=l,n.height=u,t.setElementForId(n.id,i)}return 0},"drawServices"),Z1e=o(function(t,e,r){r.forEach(n=>{let i=e.append("g"),a=Ci("iconSize");i.append("g").append("rect").attr("id","node-"+n.id).attr("fill-opacity","0").attr("width",a).attr("height",a),i.attr("class","architecture-junction");let{width:l,height:u}=i._groups[0][0].getBBox();i.width=l,i.height=u,t.setElementForId(n.id,i)})},"drawJunctions")});function iet(t,e){t.forEach(r=>{e.add({group:"nodes",data:{type:"service",id:r.id,icon:r.icon,label:r.title,parent:r.in,width:Ci("iconSize"),height:Ci("iconSize")},classes:"node-service"})})}function aet(t,e){t.forEach(r=>{e.add({group:"nodes",data:{type:"junction",id:r.id,parent:r.in,width:Ci("iconSize"),height:Ci("iconSize")},classes:"node-junction"})})}function set(t,e){e.nodes().map(r=>{let n=If(r);if(n.type==="group")return;n.x=r.position().x,n.y=r.position().y,t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}function oet(t,e){t.forEach(r=>{e.add({group:"nodes",data:{type:"group",id:r.id,icon:r.icon,label:r.title,parent:r.in},classes:"node-group"})})}function cet(t,e){t.forEach(r=>{let{lhsId:n,rhsId:i,lhsInto:a,lhsGroup:s,rhsInto:l,lhsDir:u,rhsDir:h,rhsGroup:f,title:d}=r,p=oC(r.lhsDir,r.rhsDir)?"segments":"straight",m={id:`${n}-${i}`,label:d,source:n,sourceDir:u,sourceArrow:a,sourceGroup:s,sourceEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%",target:i,targetDir:h,targetArrow:l,targetGroup:f,targetEndpoint:h==="L"?"0 50%":h==="R"?"100% 50%":h==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:m,classes:p})})}function uet(t){let e=t.map(i=>{let a={},s={};return Object.entries(i).forEach(([l,[u,h]])=>{a[h]||(a[h]=[]),s[u]||(s[u]=[]),a[h].push(l),s[u].push(l)}),{horiz:Object.values(a).filter(l=>l.length>1),vert:Object.values(s).filter(l=>l.length>1)}}),[r,n]=e.reduce(([i,a],{horiz:s,vert:l})=>[[...i,...s],[...a,...l]],[[],[]]);return{horizontal:r,vertical:n}}function het(t){let e=[],r=o(i=>`${i[0]},${i[1]}`,"posToStr"),n=o(i=>i.split(",").map(a=>parseInt(a)),"strToPos");return t.forEach(i=>{let a=Object.fromEntries(Object.entries(i).map(([h,f])=>[r(f),h])),s=[r([0,0])],l={},u={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;s.length>0;){let h=s.shift();if(h){l[h]=1;let f=a[h];if(f){let d=n(h);Object.entries(u).forEach(([p,m])=>{let g=r([d[0]+m[0],d[1]+m[1]]),y=a[g];y&&!l[g]&&(s.push(g),e.push({[WB[p]]:y,[WB[B1e(p)]]:f,gap:1.5*Ci("iconSize")}))})}}}}),e}function fet(t,e,r,n,{spatialMaps:i}){return new Promise(a=>{let s=$e("body").append("div").attr("id","cy").attr("style","display:none"),l=rl({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${Ci("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${Ci("padding")}px`}}]});s.remove(),oet(r,l),iet(t,l),aet(e,l),cet(n,l);let u=uet(i),h=het(i),f=l.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(d){let[p,m]=d.connectedNodes(),{parent:g}=If(p),{parent:y}=If(m);return g===y?1.5*Ci("iconSize"):.5*Ci("iconSize")},edgeElasticity(d){let[p,m]=d.connectedNodes(),{parent:g}=If(p),{parent:y}=If(m);return g===y?.45:.001},alignmentConstraint:u,relativePlacementConstraint:h});f.one("layoutstop",()=>{function d(p,m,g,y){let v,x,{x:b,y:w}=p,{x:S,y:T}=m;x=(y-w+(b-g)*(w-T)/(b-S))/Math.sqrt(1+Math.pow((w-T)/(b-S),2)),v=Math.sqrt(Math.pow(y-w,2)+Math.pow(g-b,2)-Math.pow(x,2));let E=Math.sqrt(Math.pow(S-b,2)+Math.pow(T-w,2));v=v/E;let _=(S-b)*(y-w)-(T-w)*(g-b);switch(!0){case _>=0:_=1;break;case _<0:_=-1;break}let A=(S-b)*(g-b)+(T-w)*(y-w);switch(!0){case A>=0:A=1;break;case A<0:A=-1;break}return x=Math.abs(x)*_,v=v*A,{distances:x,weights:v}}o(d,"getSegmentWeights"),l.startBatch();for(let p of Object.values(l.edges()))if(p.data?.()){let{x:m,y:g}=p.source().position(),{x:y,y:v}=p.target().position();if(m!==y&&g!==v){let x=p.sourceEndpoint(),b=p.targetEndpoint(),{sourceDir:w}=lC(p),[S,T]=Wc(w)?[x.x,b.y]:[b.x,x.y],{weights:E,distances:_}=d(x,b,S,T);p.style("segment-distances",_),p.style("segment-weights",E)}}l.endBatch(),f.run()}),f.run(),l.ready(d=>{V.info("Ready",d),a(l)})})}var eye,det,tye,rye=R(()=>{"use strict";V1();vB();eye=Xi(X1e(),1);Zt();ut();pf();Yn();gb();eF();cC();J1e();Fb([{name:J0.prefix,icons:J0}]);rl.use(eye.default);o(iet,"addServices");o(aet,"addJunctions");o(set,"positionNodes");o(oet,"addGroups");o(cet,"addEdges");o(uet,"getAlignments");o(het,"getRelativeConstraints");o(fet,"layoutArchitecture");det=o(async(t,e,r,n)=>{let i=n.db,a=i.getServices(),s=i.getJunctions(),l=i.getGroups(),u=i.getEdges(),h=i.getDataStructures(),f=Ps(e),d=f.append("g");d.attr("class","architecture-edges");let p=f.append("g");p.attr("class","architecture-services");let m=f.append("g");m.attr("class","architecture-groups"),await Q1e(i,p,a),Z1e(i,p,s);let g=await fet(a,s,l,u,h);await j1e(d,g),await K1e(m,g),set(i,g),Lo(void 0,f,Ci("padding"),Ci("useMaxWidth"))},"draw"),tye={draw:det}});var nye={};hr(nye,{diagram:()=>pet});var pet,iye=R(()=>{"use strict";Y1e();gb();q1e();rye();pet={parser:H1e,db:Z0,renderer:tye,styles:W1e}});var knt={};hr(knt,{default:()=>Tnt});V1();zC();Hf();var BX="c4",mCe=o(t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),gCe=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(PX(),OX));return{id:BX,diagram:t}},"loader"),yCe={id:BX,detector:mCe,loader:gCe},FX=yCe;var Zre="flowchart",SNe=o((t,e)=>e?.flowchart?.defaultRenderer==="dagre-wrapper"||e?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(t),"detector"),ANe=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(uT(),cT));return{id:Zre,diagram:t}},"loader"),_Ne={id:Zre,detector:SNe,loader:ANe},Jre=_Ne;var ene="flowchart-v2",LNe=o((t,e)=>e?.flowchart?.defaultRenderer==="dagre-d3"?!1:(e?.flowchart?.defaultRenderer==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&e?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(t)),"detector"),DNe=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(uT(),cT));return{id:ene,diagram:t}},"loader"),RNe={id:ene,detector:LNe,loader:DNe},tne=RNe;var Dne="er",sMe=o(t=>/^\s*erDiagram/.test(t),"detector"),oMe=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(Lne(),_ne));return{id:Dne,diagram:t}},"loader"),lMe={id:Dne,detector:sMe,loader:oMe},Rne=lMe;var $le="gitGraph",NBe=o(t=>/^\s*gitGraph/.test(t),"detector"),MBe=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(Gle(),zle));return{id:$le,diagram:t}},"loader"),IBe={id:$le,detector:NBe,loader:MBe},Vle=IBe;var vce="gantt",wFe=o(t=>/^\s*gantt/.test(t),"detector"),TFe=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(yce(),gce));return{id:vce,diagram:t}},"loader"),kFe={id:vce,detector:wFe,loader:TFe},xce=kFe;var _ce="info",LFe=o(t=>/^\s*info/.test(t),"detector"),DFe=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(Ace(),Sce));return{id:_ce,diagram:t}},"loader"),Lce={id:_ce,detector:LFe,loader:DFe};var zce="pie",UFe=o(t=>/^\s*pie/.test(t),"detector"),HFe=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(Fce(),Bce));return{id:zce,diagram:t}},"loader"),Gce={id:zce,detector:UFe,loader:HFe};var Jce="quadrantChart",lze=o(t=>/^\s*quadrantChart/.test(t),"detector"),cze=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(Zce(),Qce));return{id:Jce,diagram:t}},"loader"),uze={id:Jce,detector:lze,loader:cze},eue=uze;var Aue="xychart",Sze=o(t=>/^\s*xychart-beta/.test(t),"detector"),Aze=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(Sue(),Cue));return{id:Aue,diagram:t}},"loader"),_ze={id:Aue,detector:Sze,loader:Aze},_ue=_ze;var Hue="requirement",rGe=o(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),nGe=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(Uue(),Vue));return{id:Hue,diagram:t}},"loader"),iGe={id:Hue,detector:rGe,loader:nGe},Yue=iGe;var vhe="sequence",o$e=o(t=>/^\s*sequenceDiagram/.test(t),"detector"),l$e=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(yhe(),ghe));return{id:vhe,diagram:t}},"loader"),c$e={id:vhe,detector:o$e,loader:l$e},xhe=c$e;var Ihe="class",U$e=o((t,e)=>e?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t),"detector"),H$e=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(Mhe(),Nhe));return{id:Ihe,diagram:t}},"loader"),Y$e={id:Ihe,detector:U$e,loader:H$e},Ohe=Y$e;var cfe="classDiagram",vVe=o((t,e)=>/^\s*classDiagram/.test(t)&&e?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t),"detector"),xVe=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(lfe(),ofe));return{id:cfe,diagram:t}},"loader"),bVe={id:cfe,detector:vVe,loader:xVe},ufe=bVe;var tde="state",mUe=o((t,e)=>e?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t),"detector"),gUe=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(ede(),Jfe));return{id:tde,diagram:t}},"loader"),yUe={id:tde,detector:mUe,loader:gUe},rde=yUe;var ade="stateDiagram",xUe=o((t,e)=>!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&e?.state?.defaultRenderer==="dagre-wrapper"),"detector"),bUe=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(ide(),nde));return{id:ade,diagram:t}},"loader"),wUe={id:ade,detector:xUe,loader:bUe},sde=wUe;var Tde="journey",VUe=o(t=>/^\s*journey/.test(t),"detector"),UUe=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(wde(),bde));return{id:Tde,diagram:t}},"loader"),HUe={id:Tde,detector:VUe,loader:UUe},kde=HUe;ut();pf();Yn();var YUe=o((t,e,r)=>{V.debug(`rendering svg for syntax error +`);let n=Ps(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),Sr(n,100,512,!0),i.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"),i.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"),i.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"),i.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"),i.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"),i.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"),i.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"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),fP={draw:YUe},Ede=fP;var WUe={db:{},renderer:fP,parser:{parse:o(()=>{},"parse")}},Cde=WUe;var Sde="flowchart-elk",qUe=o((t,e={})=>/^\s*flowchart-elk/.test(t)||/^\s*flowchart|graph/.test(t)&&e?.flowchart?.defaultRenderer==="elk"?(e.layout="elk",!0):!1,"detector"),XUe=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(uT(),cT));return{id:Sde,diagram:t}},"loader"),jUe={id:Sde,detector:qUe,loader:XUe},Ade=jUe;var Jde="timeline",pHe=o(t=>/^\s*timeline/.test(t),"detector"),mHe=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(Zde(),Qde));return{id:Jde,diagram:t}},"loader"),gHe={id:Jde,detector:pHe,loader:mHe},e0e=gHe;var vge="mindmap",TZe=o(t=>/^\s*mindmap/.test(t),"detector"),kZe=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(yge(),gge));return{id:vge,diagram:t}},"loader"),EZe={id:vge,detector:TZe,loader:kZe},xge=EZe;var Zge="sankey",WZe=o(t=>/^\s*sankey-beta/.test(t),"detector"),qZe=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(Qge(),Kge));return{id:Zge,diagram:t}},"loader"),XZe={id:Zge,detector:WZe,loader:qZe},Jge=XZe;var c1e="packet",oJe=o(t=>/^\s*packet-beta/.test(t),"detector"),lJe=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(l1e(),o1e));return{id:c1e,diagram:t}},"loader"),u1e={id:c1e,detector:oJe,loader:lJe};var O1e="block",FJe=o(t=>/^\s*block-beta/.test(t),"detector"),zJe=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(I1e(),M1e));return{id:O1e,diagram:t}},"loader"),GJe={id:O1e,detector:FJe,loader:zJe},P1e=GJe;var aye="architecture",met=o(t=>/^\s*architecture/.test(t),"detector"),get=o(async()=>{let{diagram:t}=await Promise.resolve().then(()=>(iye(),nye));return{id:aye,diagram:t}},"loader"),yet={id:aye,detector:met,loader:get},sye=yet;Hf();_t();var oye=!1,k1=o(()=>{oye||(oye=!0,Jf("error",Cde,t=>t.toLowerCase().trim()==="error"),Jf("---",{db:{clear:o(()=>{},"clear")},styles:{},renderer:{draw:o(()=>{},"draw")},parser:{parse:o(()=>{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:o(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),Ub(FX,ufe,Ohe,Rne,xce,Lce,Gce,Yue,xhe,Ade,tne,Jre,xge,e0e,Vle,sde,rde,kde,eue,Jge,u1e,_ue,P1e,sye))},"addDiagrams");ut();Hf();_t();var lye=o(async()=>{V.debug("Loading registered diagrams");let e=(await Promise.allSettled(Object.entries(Uf).map(async([r,{detector:n,loader:i}])=>{if(i)try{cy(r)}catch{try{let{diagram:a,id:s}=await i();Jf(s,a,n)}catch(a){throw V.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Uf[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){V.error(`Failed to load ${e.length} external diagrams`);for(let r of e)V.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams");ut();Zt();var uC="comm",hC="rule",fC="decl";var cye="@import";var uye="@keyframes";var hye="@layer";var tF=Math.abs,bb=String.fromCharCode;function dC(t){return t.trim()}o(dC,"trim");function wb(t,e,r){return t.replace(e,r)}o(wb,"replace");function fye(t,e,r){return t.indexOf(e,r)}o(fye,"indexof");function ep(t,e){return t.charCodeAt(e)|0}o(ep,"charat");function Of(t,e,r){return t.slice(e,r)}o(Of,"substr");function wo(t){return t.length}o(wo,"strlen");function dye(t){return t.length}o(dye,"sizeof");function E1(t,e){return e.push(t),t}o(E1,"append");var pC=1,C1=1,pye=0,nl=0,Si=0,A1="";function mC(t,e,r,n,i,a,s,l){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:pC,column:C1,length:s,return:"",siblings:l}}o(mC,"node");function mye(){return Si}o(mye,"char");function gye(){return Si=nl>0?ep(A1,--nl):0,C1--,Si===10&&(C1=1,pC--),Si}o(gye,"prev");function il(){return Si=nl2||S1(Si)>3?"":" "}o(xye,"whitespace");function bye(t,e){for(;--e&&il()&&!(Si<48||Si>102||Si>57&&Si<65||Si>70&&Si<97););return gC(t,Tb()+(e<6&&th()==32&&il()==32))}o(bye,"escaping");function rF(t){for(;il();)switch(Si){case t:return nl;case 34:case 39:t!==34&&t!==39&&rF(Si);break;case 40:t===41&&rF(t);break;case 92:il();break}return nl}o(rF,"delimiter");function wye(t,e){for(;il()&&t+Si!==57;)if(t+Si===84&&th()===47)break;return"/*"+gC(e,nl-1)+"*"+bb(t===47?t:il())}o(wye,"commenter");function Tye(t){for(;!S1(th());)il();return gC(t,nl)}o(Tye,"identifier");function Cye(t){return vye(vC("",null,null,null,[""],t=yye(t),0,[0],t))}o(Cye,"compile");function vC(t,e,r,n,i,a,s,l,u){for(var h=0,f=0,d=s,p=0,m=0,g=0,y=1,v=1,x=1,b=0,w="",S=i,T=a,E=n,_=w;v;)switch(g=b,b=il()){case 40:if(g!=108&&ep(_,d-1)==58){fye(_+=wb(yC(b),"&","&\f"),"&\f",tF(h?l[h-1]:0))!=-1&&(x=-1);break}case 34:case 39:case 91:_+=yC(b);break;case 9:case 10:case 13:case 32:_+=xye(g);break;case 92:_+=bye(Tb()-1,7);continue;case 47:switch(th()){case 42:case 47:E1(vet(wye(il(),Tb()),e,r,u),u),(S1(g||1)==5||S1(th()||1)==5)&&wo(_)&&Of(_,-1,void 0)!==" "&&(_+=" ");break;default:_+="/"}break;case 123*y:l[h++]=wo(_)*x;case 125*y:case 59:case 0:switch(b){case 0:case 125:v=0;case 59+f:x==-1&&(_=wb(_,/\f/g,"")),m>0&&(wo(_)-d||y===0&&g===47)&&E1(m>32?Eye(_+";",n,r,d-1,u):Eye(wb(_," ","")+";",n,r,d-2,u),u);break;case 59:_+=";";default:if(E1(E=kye(_,e,r,h,f,i,l,w,S=[],T=[],d,a),a),b===123)if(f===0)vC(_,e,E,E,S,a,d,l,T);else switch(p===99&&ep(_,3)===110?100:p){case 100:case 108:case 109:case 115:vC(t,E,E,n&&E1(kye(t,E,E,0,0,i,l,w,i,S=[],d,T),T),i,T,d,l,n?S:T);break;default:vC(_,E,E,E,[""],T,0,l,T)}}h=f=m=0,y=x=1,w=_="",d=s;break;case 58:d=1+wo(_),m=g;default:if(y<1){if(b==123)--y;else if(b==125&&y++==0&&gye()==125)continue}switch(_+=bb(b),b*y){case 38:x=f>0?1:(_+="\f",-1);break;case 44:l[h++]=(wo(_)-1)*x,x=1;break;case 64:th()===45&&(_+=yC(il())),p=th(),f=d=wo(w=_+=Tye(Tb())),b++;break;case 45:g===45&&wo(_)==2&&(y=0)}}return a}o(vC,"parse");function kye(t,e,r,n,i,a,s,l,u,h,f,d){for(var p=i-1,m=i===0?a:[""],g=dye(m),y=0,v=0,x=0;y0?m[b]+" "+w:wb(w,/&\f/g,m[b])))&&(u[x++]=S);return mC(t,e,r,i===0?hC:l,u,h,f,d)}o(kye,"ruleset");function vet(t,e,r,n){return mC(t,e,r,uC,bb(mye()),Of(t,2,-2),0,n)}o(vet,"comment");function Eye(t,e,r,n,i){return mC(t,e,r,fC,Of(t,0,n),Of(t,n+1,-1),n,i)}o(Eye,"declaration");function xC(t,e){for(var r="",n=0;n{Lye.forEach(t=>{t()}),Lye=[]},"attachFunctions");ut();var Rye=o(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");Vb();function qye(t){return typeof t>"u"||t===null}o(qye,"isNothing");function bet(t){return typeof t=="object"&&t!==null}o(bet,"isObject");function wet(t){return Array.isArray(t)?t:qye(t)?[]:[t]}o(wet,"toArray");function Tet(t,e){var r,n,i,a;if(e)for(a=Object.keys(e),r=0,n=a.length;rl&&(a=" ... ",e=n-l+a.length),r-n>l&&(s=" ...",r=n+l-s.length),{str:a+t.slice(e,r).replace(/\t/g,"\u2192")+s,pos:n-e+a.length}}o(nF,"getLine");function iF(t,e){return Wi.repeat(" ",e-t.length)+t}o(iF,"padStart");function Net(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],a,s=-1;a=r.exec(t.buffer);)i.push(a.index),n.push(a.index+a[0].length),t.position<=a.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var l="",u,h,f=Math.min(t.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+f+3);for(u=1;u<=e.linesBefore&&!(s-u<0);u++)h=nF(t.buffer,n[s-u],i[s-u],t.position-(n[s]-n[s-u]),d),l=Wi.repeat(" ",e.indent)+iF((t.line-u+1).toString(),f)+" | "+h.str+` +`+l;for(h=nF(t.buffer,n[s],i[s],t.position,d),l+=Wi.repeat(" ",e.indent)+iF((t.line+1).toString(),f)+" | "+h.str+` +`,l+=Wi.repeat("-",e.indent+f+3+h.pos)+`^ +`,u=1;u<=e.linesAfter&&!(s+u>=i.length);u++)h=nF(t.buffer,n[s+u],i[s+u],t.position-(n[s]-n[s+u]),d),l+=Wi.repeat(" ",e.indent)+iF((t.line+u+1).toString(),f)+" | "+h.str+` +`;return l.replace(/\n$/,"")}o(Net,"makeSnippet");var Met=Net,Iet=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Oet=["scalar","sequence","mapping"];function Pet(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}o(Pet,"compileStyleAliases");function Bet(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(Iet.indexOf(r)===-1)throw new $s('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=Pet(e.styleAliases||null),Oet.indexOf(this.kind)===-1)throw new $s('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}o(Bet,"Type$1");var Va=Bet;function Nye(t,e){var r=[];return t[e].forEach(function(n){var i=r.length;r.forEach(function(a,s){a.tag===n.tag&&a.kind===n.kind&&a.multi===n.multi&&(i=s)}),r[i]=n}),r}o(Nye,"compileList");function Fet(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function n(i){i.multi?(t.multi[i.kind].push(i),t.multi.fallback.push(i)):t[i.kind][i.tag]=t.fallback[i.tag]=i}for(o(n,"collectType"),e=0,r=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:o(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:o(function(t){return t.toString(10)},"decimal"),hexadecimal:o(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),att=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function stt(t){return!(t===null||!att.test(t)||t[t.length-1]==="_")}o(stt,"resolveYamlFloat");function ott(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}o(ott,"constructYamlFloat");var ltt=/^[-+]?[0-9]+e/;function ctt(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Wi.isNegativeZero(t))return"-0.0";return r=t.toString(10),ltt.test(r)?r.replace("e",".e"):r}o(ctt,"representYamlFloat");function utt(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||Wi.isNegativeZero(t))}o(utt,"isFloat");var htt=new Va("tag:yaml.org,2002:float",{kind:"scalar",resolve:stt,construct:ott,predicate:utt,represent:ctt,defaultStyle:"lowercase"}),jye=Uet.extend({implicit:[qet,Qet,itt,htt]}),ftt=jye,Kye=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Qye=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 dtt(t){return t===null?!1:Kye.exec(t)!==null||Qye.exec(t)!==null}o(dtt,"resolveYamlTimestamp");function ptt(t){var e,r,n,i,a,s,l,u=0,h=null,f,d,p;if(e=Kye.exec(t),e===null&&(e=Qye.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(a=+e[4],s=+e[5],l=+e[6],e[7]){for(u=e[7].slice(0,3);u.length<3;)u+="0";u=+u}return e[9]&&(f=+e[10],d=+(e[11]||0),h=(f*60+d)*6e4,e[9]==="-"&&(h=-h)),p=new Date(Date.UTC(r,n,i,a,s,l,u)),h&&p.setTime(p.getTime()-h),p}o(ptt,"constructYamlTimestamp");function mtt(t){return t.toISOString()}o(mtt,"representYamlTimestamp");var gtt=new Va("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:dtt,construct:ptt,instanceOf:Date,represent:mtt});function ytt(t){return t==="<<"||t===null}o(ytt,"resolveYamlMerge");var vtt=new Va("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ytt}),hF=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function xtt(t){if(t===null)return!1;var e,r,n=0,i=t.length,a=hF;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}o(xtt,"resolveYamlBinary");function btt(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=hF,s=0,l=[];for(e=0;e>16&255),l.push(s>>8&255),l.push(s&255)),s=s<<6|a.indexOf(n.charAt(e));return r=i%4*6,r===0?(l.push(s>>16&255),l.push(s>>8&255),l.push(s&255)):r===18?(l.push(s>>10&255),l.push(s>>2&255)):r===12&&l.push(s>>4&255),new Uint8Array(l)}o(btt,"constructYamlBinary");function wtt(t){var e="",r=0,n,i,a=t.length,s=hF;for(n=0;n>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]),r=(r<<8)+t[n];return i=a%3,i===0?(e+=s[r>>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]):i===2?(e+=s[r>>10&63],e+=s[r>>4&63],e+=s[r<<2&63],e+=s[64]):i===1&&(e+=s[r>>2&63],e+=s[r<<4&63],e+=s[64],e+=s[64]),e}o(wtt,"representYamlBinary");function Ttt(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}o(Ttt,"isBinary");var ktt=new Va("tag:yaml.org,2002:binary",{kind:"scalar",resolve:xtt,construct:btt,predicate:Ttt,represent:wtt}),Ett=Object.prototype.hasOwnProperty,Ctt=Object.prototype.toString;function Stt(t){if(t===null)return!0;var e=[],r,n,i,a,s,l=t;for(r=0,n=l.length;r>10)+55296,(t-65536&1023)+56320)}o(Htt,"charFromCodepoint");var nve=new Array(256),ive=new Array(256);for(tp=0;tp<256;tp++)nve[tp]=Oye(tp)?1:0,ive[tp]=Oye(tp);var tp;function Ytt(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Zye,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}o(Ytt,"State$1");function ave(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=Met(r),new $s(e,r)}o(ave,"generateError");function Gt(t,e){throw ave(t,e)}o(Gt,"throwError");function TC(t,e){t.onWarning&&t.onWarning.call(null,ave(t,e))}o(TC,"throwWarning");var Pye={YAML:o(function(e,r,n){var i,a,s;e.version!==null&&Gt(e,"duplication of %YAML directive"),n.length!==1&&Gt(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&Gt(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&Gt(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&TC(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:o(function(e,r,n){var i,a;n.length!==2&&Gt(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],tve.test(i)||Gt(e,"ill-formed tag handle (first argument) of the TAG directive"),Bf.call(e.tagMap,i)&&Gt(e,'there is a previously declared suffix for "'+i+'" tag handle'),rve.test(a)||Gt(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{Gt(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a},"handleTagDirective")};function Pf(t,e,r,n){var i,a,s,l;if(e1&&(t.result+=Wi.repeat(` +`,e-1))}o(dF,"writeFoldedLines");function Wtt(t,e,r){var n,i,a,s,l,u,h,f,d=t.kind,p=t.result,m;if(m=t.input.charCodeAt(t.position),Vs(m)||D1(m)||m===35||m===38||m===42||m===33||m===124||m===62||m===39||m===34||m===37||m===64||m===96||(m===63||m===45)&&(i=t.input.charCodeAt(t.position+1),Vs(i)||r&&D1(i)))return!1;for(t.kind="scalar",t.result="",a=s=t.position,l=!1;m!==0;){if(m===58){if(i=t.input.charCodeAt(t.position+1),Vs(i)||r&&D1(i))break}else if(m===35){if(n=t.input.charCodeAt(t.position-1),Vs(n))break}else{if(t.position===t.lineStart&&CC(t)||r&&D1(m))break;if(qc(m))if(u=t.line,h=t.lineStart,f=t.lineIndent,Ai(t,!1,-1),t.lineIndent>=e){l=!0,m=t.input.charCodeAt(t.position);continue}else{t.position=s,t.line=u,t.lineStart=h,t.lineIndent=f;break}}l&&(Pf(t,a,s,!1),dF(t,t.line-u),a=s=t.position,l=!1),rp(m)||(s=t.position+1),m=t.input.charCodeAt(++t.position)}return Pf(t,a,s,!1),t.result?!0:(t.kind=d,t.result=p,!1)}o(Wtt,"readPlainScalar");function qtt(t,e){var r,n,i;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(Pf(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,i=t.position;else return!0;else qc(r)?(Pf(t,n,i,!0),dF(t,Ai(t,!1,e)),n=i=t.position):t.position===t.lineStart&&CC(t)?Gt(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Gt(t,"unexpected end of the stream within a single quoted scalar")}o(qtt,"readSingleQuotedScalar");function Xtt(t,e){var r,n,i,a,s,l;if(l=t.input.charCodeAt(t.position),l!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(l=t.input.charCodeAt(t.position))!==0;){if(l===34)return Pf(t,r,t.position,!0),t.position++,!0;if(l===92){if(Pf(t,r,t.position,!0),l=t.input.charCodeAt(++t.position),qc(l))Ai(t,!1,e);else if(l<256&&nve[l])t.result+=ive[l],t.position++;else if((s=Vtt(l))>0){for(i=s,a=0;i>0;i--)l=t.input.charCodeAt(++t.position),(s=$tt(l))>=0?a=(a<<4)+s:Gt(t,"expected hexadecimal character");t.result+=Htt(a),t.position++}else Gt(t,"unknown escape sequence");r=n=t.position}else qc(l)?(Pf(t,r,n,!0),dF(t,Ai(t,!1,e)),r=n=t.position):t.position===t.lineStart&&CC(t)?Gt(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}Gt(t,"unexpected end of the stream within a double quoted scalar")}o(Xtt,"readDoubleQuotedScalar");function jtt(t,e){var r=!0,n,i,a,s=t.tag,l,u=t.anchor,h,f,d,p,m,g=Object.create(null),y,v,x,b;if(b=t.input.charCodeAt(t.position),b===91)f=93,m=!1,l=[];else if(b===123)f=125,m=!0,l={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=l),b=t.input.charCodeAt(++t.position);b!==0;){if(Ai(t,!0,e),b=t.input.charCodeAt(t.position),b===f)return t.position++,t.tag=s,t.anchor=u,t.kind=m?"mapping":"sequence",t.result=l,!0;r?b===44&&Gt(t,"expected the node content, but found ','"):Gt(t,"missed comma between flow collection entries"),v=y=x=null,d=p=!1,b===63&&(h=t.input.charCodeAt(t.position+1),Vs(h)&&(d=p=!0,t.position++,Ai(t,!0,e))),n=t.line,i=t.lineStart,a=t.position,N1(t,e,bC,!1,!0),v=t.tag,y=t.result,Ai(t,!0,e),b=t.input.charCodeAt(t.position),(p||t.line===n)&&b===58&&(d=!0,b=t.input.charCodeAt(++t.position),Ai(t,!0,e),N1(t,e,bC,!1,!0),x=t.result),m?R1(t,l,g,v,y,x,n,i,a):d?l.push(R1(t,null,g,v,y,x,n,i,a)):l.push(y),Ai(t,!0,e),b=t.input.charCodeAt(t.position),b===44?(r=!0,b=t.input.charCodeAt(++t.position)):r=!1}Gt(t,"unexpected end of the stream within a flow collection")}o(jtt,"readFlowCollection");function Ktt(t,e){var r,n,i=aF,a=!1,s=!1,l=e,u=0,h=!1,f,d;if(d=t.input.charCodeAt(t.position),d===124)n=!1;else if(d===62)n=!0;else return!1;for(t.kind="scalar",t.result="";d!==0;)if(d=t.input.charCodeAt(++t.position),d===43||d===45)aF===i?i=d===43?Mye:Btt:Gt(t,"repeat of a chomping mode identifier");else if((f=Utt(d))>=0)f===0?Gt(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?Gt(t,"repeat of an indentation width identifier"):(l=e+f-1,s=!0);else break;if(rp(d)){do d=t.input.charCodeAt(++t.position);while(rp(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!qc(d)&&d!==0)}for(;d!==0;){for(fF(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!s||t.lineIndentl&&(l=t.lineIndent),qc(d)){u++;continue}if(t.lineIndente)&&u!==0)Gt(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(v&&(s=t.line,l=t.lineStart,u=t.position),N1(t,e,wC,!0,i)&&(v?g=t.result:y=t.result),v||(R1(t,d,p,m,g,y,s,l,u),m=g=y=null),Ai(t,!0,-1),b=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&b!==0)Gt(t,"bad indentation of a mapping entry");else if(t.lineIndente?u=1:t.lineIndent===e?u=0:t.lineIndente?u=1:t.lineIndent===e?u=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),d=0,p=t.implicitTypes.length;d"),t.result!==null&&g.kind!==t.kind&&Gt(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):Gt(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||f}o(N1,"composeNode");function trt(t){var e=t.position,r,n,i,a=!1,s;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(s=t.input.charCodeAt(t.position))!==0&&(Ai(t,!0,-1),s=t.input.charCodeAt(t.position),!(t.lineIndent>0||s!==37));){for(a=!0,s=t.input.charCodeAt(++t.position),r=t.position;s!==0&&!Vs(s);)s=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&Gt(t,"directive name must not be less than one character in length");s!==0;){for(;rp(s);)s=t.input.charCodeAt(++t.position);if(s===35){do s=t.input.charCodeAt(++t.position);while(s!==0&&!qc(s));break}if(qc(s))break;for(r=t.position;s!==0&&!Vs(s);)s=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}s!==0&&fF(t),Bf.call(Pye,n)?Pye[n](t,n,i):TC(t,'unknown document directive "'+n+'"')}if(Ai(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Ai(t,!0,-1)):a&&Gt(t,"directives end mark is expected"),N1(t,t.lineIndent-1,wC,!1,!0),Ai(t,!0,-1),t.checkLineBreaks&&ztt.test(t.input.slice(e,t.position))&&TC(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&CC(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Ai(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=sve(t,r);if(typeof e!="function")return n;for(var i=0,a=n.length;i=55296&&r<=56319&&e+1=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}o(kb,"codePointAt");function mve(t){var e=/^\n* /;return e.test(t)}o(mve,"needIndentIndicator");var gve=1,cF=2,yve=3,vve=4,L1=5;function Rrt(t,e,r,n,i,a,s,l){var u,h=0,f=null,d=!1,p=!1,m=n!==-1,g=-1,y=Lrt(kb(t,0))&&Drt(kb(t,t.length-1));if(e||s)for(u=0;u=65536?u+=2:u++){if(h=kb(t,u),!Ab(h))return L1;y=y&&$ye(h,f,l),f=h}else{for(u=0;u=65536?u+=2:u++){if(h=kb(t,u),h===Cb)d=!0,m&&(p=p||u-g-1>n&&t[g+1]!==" ",g=u);else if(!Ab(h))return L1;y=y&&$ye(h,f,l),f=h}p=p||m&&u-g-1>n&&t[g+1]!==" "}return!d&&!p?y&&!s&&!i(t)?gve:a===Sb?L1:cF:r>9&&mve(t)?L1:s?a===Sb?L1:cF:p?vve:yve}o(Rrt,"chooseScalarStyle");function Nrt(t,e,r,n,i){t.dump=function(){if(e.length===0)return t.quotingType===Sb?'""':"''";if(!t.noCompatMode&&(Trt.indexOf(e)!==-1||krt.test(e)))return t.quotingType===Sb?'"'+e+'"':"'"+e+"'";var a=t.indent*Math.max(1,r),s=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),l=n||t.flowLevel>-1&&r>=t.flowLevel;function u(h){return _rt(t,h)}switch(o(u,"testAmbiguity"),Rrt(e,l,t.indent,s,u,t.quotingType,t.forceQuotes&&!n,i)){case gve:return e;case cF:return"'"+e.replace(/'/g,"''")+"'";case yve:return"|"+Vye(e,t.indent)+Uye(zye(e,a));case vve:return">"+Vye(e,t.indent)+Uye(zye(Mrt(e,s),a));case L1:return'"'+Irt(e)+'"';default:throw new $s("impossible error: invalid scalar style")}}()}o(Nrt,"writeScalar");function Vye(t,e){var r=mve(t)?String(e):"",n=t[t.length-1]===` +`,i=n&&(t[t.length-2]===` +`||t===` +`),a=i?"+":n?"":"-";return r+a+` +`}o(Vye,"blockHeader");function Uye(t){return t[t.length-1]===` +`?t.slice(0,-1):t}o(Uye,"dropEndingNewline");function Mrt(t,e){for(var r=/(\n+)([^\n]*)/g,n=function(){var h=t.indexOf(` +`);return h=h!==-1?h:t.length,r.lastIndex=h,Hye(t.slice(0,h),e)}(),i=t[0]===` +`||t[0]===" ",a,s;s=r.exec(t);){var l=s[1],u=s[2];a=u[0]===" ",n+=l+(!i&&!a&&u!==""?` +`:"")+Hye(u,e),i=a}return n}o(Mrt,"foldString");function Hye(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,i=0,a,s=0,l=0,u="";n=r.exec(t);)l=n.index,l-i>e&&(a=s>i?s:l,u+=` +`+t.slice(i,a),i=a+1),s=l;return u+=` +`,t.length-i>e&&s>i?u+=t.slice(i,s)+` +`+t.slice(s+1):u+=t.slice(i),u.slice(1)}o(Hye,"foldLine");function Irt(t){for(var e="",r=0,n,i=0;i=65536?i+=2:i++)r=kb(t,i),n=Ua[r],!n&&Ab(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||Crt(r);return e}o(Irt,"escapeString");function Ort(t,e,r){var n="",i=t.tag,a,s,l;for(a=0,s=r.length;a"u"&&rh(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}o(Ort,"writeFlowSequence");function Yye(t,e,r,n){var i="",a=t.tag,s,l,u;for(s=0,l=r.length;s"u"&&rh(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=lF(t,e)),t.dump&&Cb===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=a,t.dump=i||"[]"}o(Yye,"writeBlockSequence");function Prt(t,e,r){var n="",i=t.tag,a=Object.keys(r),s,l,u,h,f;for(s=0,l=a.length;s1024&&(f+="? "),f+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),rh(t,e,h,!1,!1)&&(f+=t.dump,n+=f));t.tag=i,t.dump="{"+n+"}"}o(Prt,"writeFlowMapping");function Brt(t,e,r,n){var i="",a=t.tag,s=Object.keys(r),l,u,h,f,d,p;if(t.sortKeys===!0)s.sort();else if(typeof t.sortKeys=="function")s.sort(t.sortKeys);else if(t.sortKeys)throw new $s("sortKeys must be a boolean or a function");for(l=0,u=s.length;l1024,d&&(t.dump&&Cb===t.dump.charCodeAt(0)?p+="?":p+="? "),p+=t.dump,d&&(p+=lF(t,e)),rh(t,e+1,f,!0,d)&&(t.dump&&Cb===t.dump.charCodeAt(0)?p+=":":p+=": ",p+=t.dump,i+=p));t.tag=a,t.dump=i||"{}"}o(Brt,"writeBlockMapping");function Wye(t,e,r){var n,i,a,s,l,u;for(i=r?t.explicitTypes:t.implicitTypes,a=0,s=i.length;a tag resolver accepts not "'+u+'" style');t.dump=n}return!0}return!1}o(Wye,"detectType");function rh(t,e,r,n,i,a,s){t.tag=null,t.dump=r,Wye(t,r,!1)||Wye(t,r,!0);var l=lve.call(t.dump),u=n,h;n&&(n=t.flowLevel<0||t.flowLevel>e);var f=l==="[object Object]"||l==="[object Array]",d,p;if(f&&(d=t.duplicates.indexOf(r),p=d!==-1),(t.tag!==null&&t.tag!=="?"||p||t.indent!==2&&e>0)&&(i=!1),p&&t.usedDuplicates[d])t.dump="*ref_"+d;else{if(f&&p&&!t.usedDuplicates[d]&&(t.usedDuplicates[d]=!0),l==="[object Object]")n&&Object.keys(t.dump).length!==0?(Brt(t,e,t.dump,i),p&&(t.dump="&ref_"+d+t.dump)):(Prt(t,e,t.dump),p&&(t.dump="&ref_"+d+" "+t.dump));else if(l==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!s&&e>0?Yye(t,e-1,t.dump,i):Yye(t,e,t.dump,i),p&&(t.dump="&ref_"+d+t.dump)):(Ort(t,e,t.dump),p&&(t.dump="&ref_"+d+" "+t.dump));else if(l==="[object String]")t.tag!=="?"&&Nrt(t,t.dump,e,a,u);else{if(l==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new $s("unacceptable kind of an object to dump "+l)}t.tag!==null&&t.tag!=="?"&&(h=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?h="!"+h:h.slice(0,18)==="tag:yaml.org,2002:"?h="!!"+h.slice(18):h="!<"+h+">",t.dump=h+" "+t.dump)}return!0}o(rh,"writeNode");function Frt(t,e){var r=[],n=[],i,a;for(uF(t,r,n),i=0,a=n.length;it.replace(/\r\n?/g,` +`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),Hrt=o(t=>{let{text:e,metadata:r}=wve(t),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:e}},"processFrontmatter"),Yrt=o(t=>{let e=Lt.detectInit(t)??{},r=Lt.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:n})=>n==="wrap"):r?.type==="wrap"&&(e.wrap=!0),{text:EX(t),directive:e}},"processDirectives");function gF(t){let e=Urt(t),r=Hrt(e),n=Yrt(r.text),i=Ts(r.config,n.directive);return t=Rye(n.text),{code:t,title:r.title,config:i}}o(gF,"preprocessDiagram");Z7();Kb();xr();function Tve(t){let e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}o(Tve,"toBase64");var Wrt=5e4,qrt="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",Xrt="sandbox",jrt="loose",Krt="http://www.w3.org/2000/svg",Qrt="http://www.w3.org/1999/xlink",Zrt="http://www.w3.org/1999/xhtml",Jrt="100%",ent="100%",tnt="border:0;margin:0;",rnt="margin:0",nnt="allow-top-navigation-by-user-activation allow-popups",int='The "iframe" tag is not supported by your browser.',ant=["foreignobject"],snt=["dominant-baseline"];function Ave(t){let e=gF(t);return Q1(),jz(e.config??{}),e}o(Ave,"processAndSetConfigs");async function ont(t,e){k1();try{let{code:r,config:n}=Ave(t);return{diagramType:(await _ve(r)).type,config:n}}catch(r){if(e?.suppressErrors)return!1;throw r}}o(ont,"parse");var kve=o((t,e,r=[])=>` +.${t} ${e} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),lnt=o((t,e=new Map)=>{let r="";if(t.themeCSS!==void 0&&(r+=` +${t.themeCSS}`),t.fontFamily!==void 0&&(r+=` +:root { --mermaid-font-family: ${t.fontFamily}}`),t.altFontFamily!==void 0&&(r+=` +:root { --mermaid-alt-font-family: ${t.altFontFamily}}`),e instanceof Map){let s=t.htmlLabels??t.flowchart?.htmlLabels?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{Qt(l.styles)||s.forEach(u=>{r+=kve(l.id,u,l.styles)}),Qt(l.textStyles)||(r+=kve(l.id,"tspan",(l?.textStyles||[]).map(u=>u.replace("color","fill"))))})}return r},"createCssStyles"),cnt=o((t,e,r,n)=>{let i=lnt(t,r),a=D$(e,i,t.themeVariables);return xC(Cye(`${n}{${a}}`),Sye)},"createUserStyles"),unt=o((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=to(n),n=n.replace(/
    /g,"
    "),n},"cleanUpSvgCode"),hnt=o((t="",e)=>{let r=e?.viewBox?.baseVal?.height?e.viewBox.baseVal.height+"px":ent,n=Tve(`${t}`);return``},"putIntoIFrame"),Eve=o((t,e,r,n,i)=>{let a=t.append("div");a.attr("id",r),n&&a.attr("style",n);let s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns",Krt);return i&&s.attr("xmlns:xlink",i),s.append("g"),t},"appendDivSvgG");function Cve(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}o(Cve,"sandboxedIframe");var fnt=o((t,e,r,n)=>{t.getElementById(e)?.remove(),t.getElementById(r)?.remove(),t.getElementById(n)?.remove()},"removeExistingElements"),dnt=o(async function(t,e,r){k1();let n=Ave(e);e=n.code;let i=Or();V.debug(i),e.length>(i?.maxTextSize??Wrt)&&(e=qrt);let a="#"+t,s="i"+t,l="#"+s,u="d"+t,h="#"+u,f=o(()=>{let I=$e(p?l:h).node();I&&"remove"in I&&I.remove()},"removeTempElements"),d=$e("body"),p=i.securityLevel===Xrt,m=i.securityLevel===jrt,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),p){let k=Cve($e(r),s);d=$e(k.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=$e(r);Eve(d,t,u,`font-family: ${g}`,Qrt)}else{if(fnt(document,t,u,s),p){let k=Cve($e("body"),s);d=$e(k.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=$e("body");Eve(d,t,u)}let y,v;try{y=await _1.fromText(e,{title:n.title})}catch(k){if(i.suppressErrorRendering)throw f(),k;y=await _1.fromText("error"),v=k}let x=d.select(h).node(),b=y.type,w=x.firstChild,S=w.firstChild,T=y.renderer.getClasses?.(e,y),E=cnt(i,b,T,a),_=document.createElement("style");_.innerHTML=E,w.insertBefore(_,S);try{await y.renderer.draw(e,t,fx,y)}catch(k){throw i.suppressErrorRendering?f():Ede.draw(e,t,fx),k}let A=d.select(`${h} svg`),L=y.db.getAccTitle?.(),M=y.db.getAccDescription?.();mnt(b,A,L,M),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",Zrt);let N=d.select(h).node().innerHTML;if(V.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),N=unt(N,p,yr(i.arrowMarkerAbsolute)),p){let k=d.select(h+" svg").node();N=hnt(N,k)}else m||(N=Sve.default.sanitize(N,{ADD_TAGS:ant,ADD_ATTR:snt}));if(Dye(),v)throw v;return f(),{diagramType:b,svg:N,bindFunctions:y.db.bindFunctions}},"render");function pnt(t={}){let e=On({},t);e?.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),Wz(e),e?.theme&&e.theme in Co?e.themeVariables=Co[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=Co.default.getThemeVariables(e.themeVariables));let r=typeof e=="object"?n7(e):i7();$1(r.logLevel),k1()}o(pnt,"initialize");var _ve=o((t,e={})=>{let{code:r}=gF(t);return _1.fromText(r,e)},"getDiagramFromText");function mnt(t,e,r,n){Aye(e,t),_ye(e,r,n,e.attr("id"))}o(mnt,"addA11yInfo");var Ff=Object.freeze({render:dnt,parse:ont,getDiagramFromText:_ve,initialize:pnt,getConfig:Or,setConfig:Zb,getSiteConfig:i7,updateSiteConfig:qz,reset:o(()=>{Q1()},"reset"),globalReset:o(()=>{Q1(uh)},"globalReset"),defaultConfig:uh});$1(Or().logLevel);Q1(Or());oT();xr();var gnt=o((t,e,r)=>{V.warn(t),r9(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),Lve=o(async function(t={querySelector:".mermaid"}){try{await ynt(t)}catch(e){if(r9(e)&&V.error(e.str),nh.parseError&&nh.parseError(e),!t.suppressErrors)throw V.error("Use the suppressErrors option to suppress these errors"),e}},"run"),ynt=o(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){let n=Ff.getConfig();V.debug(`${t?"":"No "}Callback function found`);let i;if(r)i=r;else if(e)i=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");V.debug(`Found ${i.length} diagrams`),n?.startOnLoad!==void 0&&(V.debug("Start On Load: "+n?.startOnLoad),Ff.updateSiteConfig({startOnLoad:n?.startOnLoad}));let a=new Lt.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed),s,l=[];for(let u of Array.from(i)){V.info("Rendering diagram: "+u.id);if(u.getAttribute("data-processed"))continue;u.setAttribute("data-processed","true");let h=`mermaid-${a.next()}`;s=u.innerHTML,s=Gb(Lt.entityDecode(s)).trim().replace(//gi,"
    ");let f=Lt.detectInit(s);f&&V.debug("Detected early reinit: ",f);try{let{svg:d,bindFunctions:p}=await Mve(h,s,u);u.innerHTML=d,t&&await t(h),p&&p(u)}catch(d){gnt(d,l,nh.parseError)}}if(l.length>0)throw l[0]},"runThrowsErrors"),Dve=o(function(t){Ff.initialize(t)},"initialize"),vnt=o(async function(t,e,r){V.warn("mermaid.init is deprecated. Please use run instead."),t&&Dve(t);let n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await Lve(n)},"init"),xnt=o(async(t,{lazyLoad:e=!0}={})=>{k1(),Ub(...t),e===!1&&await lye()},"registerExternalDiagrams"),Rve=o(function(){if(nh.startOnLoad){let{startOnLoad:t}=Ff.getConfig();t&&nh.run().catch(e=>V.error("Mermaid failed to initialize",e))}},"contentLoaded");if(typeof document<"u"){window.addEventListener("load",Rve,!1)}var bnt=o(function(t){nh.parseError=t},"setParseErrorHandler"),SC=[],yF=!1,Nve=o(async()=>{if(!yF){for(yF=!0;SC.length>0;){let t=SC.shift();if(t)try{await t()}catch(e){V.error("Error executing queue",e)}}yF=!1}},"executeQueue"),wnt=o(async(t,e)=>new Promise((r,n)=>{let i=o(()=>new Promise((a,s)=>{Ff.parse(t,e).then(l=>{a(l),r(l)},l=>{V.error("Error parsing",l),nh.parseError?.(l),s(l),n(l)})}),"performCall");SC.push(i),Nve().catch(n)}),"parse"),Mve=o((t,e,r)=>new Promise((n,i)=>{let a=o(()=>new Promise((s,l)=>{Ff.render(t,e,r).then(u=>{s(u),n(u)},u=>{V.error("Error parsing",u),nh.parseError?.(u),l(u),i(u)})}),"performCall");SC.push(a),Nve().catch(i)}),"render"),nh={startOnLoad:!0,mermaidAPI:Ff,parse:wnt,render:Mve,init:vnt,run:Lve,registerExternalDiagrams:xnt,registerLayoutLoaders:gD,initialize:Dve,parseError:void 0,contentLoaded:Rve,setParseErrorHandler:bnt,detectType:lp,registerIconPacks:Fb},Tnt=nh;return $ve(knt);})(); +/*! 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;