UNPKG

@gk8/mermaid

Version:

Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.

860 lines 185 kB
function er(t) { for (var i = [], e = 1; e < arguments.length; e++) i[e - 1] = arguments[e]; var r = Array.from(typeof t == "string" ? [t] : t); r[r.length - 1] = r[r.length - 1].replace(/\r?\n([\t ]*)$/, ""); var o = r.reduce(function(a, h) { var u = h.match(/\n([\t ]+|(?!\s).)/g); return u ? a.concat(u.map(function(d) { var c, b; return (b = (c = d.match(/[\t ]/g)) === null || c === void 0 ? void 0 : c.length) !== null && b !== void 0 ? b : 0; })) : a; }, []); if (o.length) { var n = new RegExp(` [ ]{` + Math.min.apply(Math, o) + "}", "g"); r = r.map(function(a) { return a.replace(n, ` `); }); } r[0] = r[0].replace(/^\r?\n/, ""); var s = r[0]; return i.forEach(function(a, h) { var u = s.match(/(?:^|\n)( *)$/), d = u ? u[1] : "", c = a; typeof a == "string" && a.includes(` `) && (c = String(a).split(` `).map(function(b, g) { return g === 0 ? b : "" + d + b; }).join(` `)), s += c + r[h + 1]; }), s; } var rr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function or(t) { return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } var ie = { exports: {} }; (function(t, i) { (function(e, r) { t.exports = r(); })(rr, function() { var e = 1e3, r = 6e4, o = 36e5, n = "millisecond", s = "second", a = "minute", h = "hour", u = "day", d = "week", c = "month", b = "quarter", g = "year", L = "date", A = "Invalid Date", O = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, z = /\[([^\]]+)]|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, w = { 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(S) { var m = ["th", "st", "nd", "rd"], p = S % 100; return "[" + S + (m[(p - 20) % 10] || m[p] || m[0]) + "]"; } }, Bt = function(S, m, p) { var F = String(S); return !F || F.length >= m ? S : "" + Array(m + 1 - F.length).join(p) + S; }, fi = { s: Bt, z: function(S) { var m = -S.utcOffset(), p = Math.abs(m), F = Math.floor(p / 60), C = p % 60; return (m <= 0 ? "+" : "-") + Bt(F, 2, "0") + ":" + Bt(C, 2, "0"); }, m: function S(m, p) { if (m.date() < p.date()) return -S(p, m); var F = 12 * (p.year() - m.year()) + (p.month() - m.month()), C = m.clone().add(F, c), v = p - C < 0, _ = m.clone().add(F + (v ? -1 : 1), c); return +(-(F + (p - C) / (v ? C - _ : _ - C)) || 0); }, a: function(S) { return S < 0 ? Math.ceil(S) || 0 : Math.floor(S); }, p: function(S) { return { M: c, y: g, w: d, d: u, D: L, h, m: a, s, ms: n, Q: b }[S] || String(S || "").toLowerCase().replace(/s$/, ""); }, u: function(S) { return S === void 0; } }, St = "en", ht = {}; ht[St] = w; var gi = function(S) { return S instanceof Wt; }, Dt = function S(m, p, F) { var C; if (!m) return St; if (typeof m == "string") { var v = m.toLowerCase(); ht[v] && (C = v), p && (ht[v] = p, C = v); var _ = m.split("-"); if (!C && _.length > 1) return S(_[0]); } else { var M = m.name; ht[M] = m, C = M; } return !F && C && (St = C), C || !F && St; }, D = function(S, m) { if (gi(S)) return S.clone(); var p = typeof m == "object" ? m : {}; return p.date = S, p.args = arguments, new Wt(p); }, q = fi; q.l = Dt, q.i = gi, q.w = function(S, m) { return D(S, { locale: m.$L, utc: m.$u, x: m.$x, $offset: m.$offset }); }; var Wt = function() { function S(p) { this.$L = Dt(p.locale, null, !0), this.parse(p); } var m = S.prototype; return m.parse = function(p) { this.$d = function(F) { var C = F.date, v = F.utc; if (C === null) return /* @__PURE__ */ new Date(NaN); if (q.u(C)) return /* @__PURE__ */ new Date(); if (C instanceof Date) return new Date(C); if (typeof C == "string" && !/Z$/i.test(C)) { var _ = C.match(O); if (_) { var M = _[2] - 1 || 0, I = (_[7] || "0").substring(0, 3); return v ? new Date(Date.UTC(_[1], M, _[3] || 1, _[4] || 0, _[5] || 0, _[6] || 0, I)) : new Date(_[1], M, _[3] || 1, _[4] || 0, _[5] || 0, _[6] || 0, I); } } return new Date(C); }(p), this.$x = p.x || {}, this.init(); }, m.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(); }, m.$utils = function() { return q; }, m.isValid = function() { return this.$d.toString() !== A; }, m.isSame = function(p, F) { var C = D(p); return this.startOf(F) <= C && C <= this.endOf(F); }, m.isAfter = function(p, F) { return D(p) < this.startOf(F); }, m.isBefore = function(p, F) { return this.endOf(F) < D(p); }, m.$g = function(p, F, C) { return q.u(p) ? this[F] : this.set(C, p); }, m.unix = function() { return Math.floor(this.valueOf() / 1e3); }, m.valueOf = function() { return this.$d.getTime(); }, m.startOf = function(p, F) { var C = this, v = !!q.u(F) || F, _ = q.p(p), M = function(pt, Y) { var ot = q.w(C.$u ? Date.UTC(C.$y, Y, pt) : new Date(C.$y, Y, pt), C); return v ? ot : ot.endOf(u); }, I = function(pt, Y) { return q.w(C.toDate()[pt].apply(C.toDate("s"), (v ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(Y)), C); }, E = this.$W, W = this.$M, rt = this.$D, J = "set" + (this.$u ? "UTC" : ""); switch (_) { case g: return v ? M(1, 0) : M(31, 11); case c: return v ? M(1, W) : M(0, W + 1); case d: var Ft = this.$locale().weekStart || 0, _t = (E < Ft ? E + 7 : E) - Ft; return M(v ? rt - _t : rt + (6 - _t), W); case u: case L: return I(J + "Hours", 0); case h: return I(J + "Minutes", 1); case a: return I(J + "Seconds", 2); case s: return I(J + "Milliseconds", 3); default: return this.clone(); } }, m.endOf = function(p) { return this.startOf(p, !1); }, m.$set = function(p, F) { var C, v = q.p(p), _ = "set" + (this.$u ? "UTC" : ""), M = (C = {}, C[u] = _ + "Date", C[L] = _ + "Date", C[c] = _ + "Month", C[g] = _ + "FullYear", C[h] = _ + "Hours", C[a] = _ + "Minutes", C[s] = _ + "Seconds", C[n] = _ + "Milliseconds", C)[v], I = v === u ? this.$D + (F - this.$W) : F; if (v === c || v === g) { var E = this.clone().set(L, 1); E.$d[M](I), E.init(), this.$d = E.set(L, Math.min(this.$D, E.daysInMonth())).$d; } else M && this.$d[M](I); return this.init(), this; }, m.set = function(p, F) { return this.clone().$set(p, F); }, m.get = function(p) { return this[q.p(p)](); }, m.add = function(p, F) { var C, v = this; p = Number(p); var _ = q.p(F), M = function(W) { var rt = D(v); return q.w(rt.date(rt.date() + Math.round(W * p)), v); }; if (_ === c) return this.set(c, this.$M + p); if (_ === g) return this.set(g, this.$y + p); if (_ === u) return M(1); if (_ === d) return M(7); var I = (C = {}, C[a] = r, C[h] = o, C[s] = e, C)[_] || 1, E = this.$d.getTime() + p * I; return q.w(E, this); }, m.subtract = function(p, F) { return this.add(-1 * p, F); }, m.format = function(p) { var F = this, C = this.$locale(); if (!this.isValid()) return C.invalidDate || A; var v = p || "YYYY-MM-DDTHH:mm:ssZ", _ = q.z(this), M = this.$H, I = this.$m, E = this.$M, W = C.weekdays, rt = C.months, J = function(Y, ot, pi, Pt) { return Y && (Y[ot] || Y(F, v)) || pi[ot].slice(0, Pt); }, Ft = function(Y) { return q.s(M % 12 || 12, Y, "0"); }, _t = C.meridiem || function(Y, ot, pi) { var Pt = Y < 12 ? "AM" : "PM"; return pi ? Pt.toLowerCase() : Pt; }, pt = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: E + 1, MM: q.s(E + 1, 2, "0"), MMM: J(C.monthsShort, E, rt, 3), MMMM: J(rt, E), D: this.$D, DD: q.s(this.$D, 2, "0"), d: String(this.$W), dd: J(C.weekdaysMin, this.$W, W, 2), ddd: J(C.weekdaysShort, this.$W, W, 3), dddd: W[this.$W], H: String(M), HH: q.s(M, 2, "0"), h: Ft(1), hh: Ft(2), a: _t(M, I, !0), A: _t(M, I, !1), m: String(I), mm: q.s(I, 2, "0"), s: String(this.$s), ss: q.s(this.$s, 2, "0"), SSS: q.s(this.$ms, 3, "0"), Z: _ }; return v.replace(z, function(Y, ot) { return ot || pt[Y] || _.replace(":", ""); }); }, m.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); }, m.diff = function(p, F, C) { var v, _ = q.p(F), M = D(p), I = (M.utcOffset() - this.utcOffset()) * r, E = this - M, W = q.m(this, M); return W = (v = {}, v[g] = W / 12, v[c] = W, v[b] = W / 3, v[d] = (E - I) / 6048e5, v[u] = (E - I) / 864e5, v[h] = E / o, v[a] = E / r, v[s] = E / e, v)[_] || E, C ? W : q.a(W); }, m.daysInMonth = function() { return this.endOf(c).$D; }, m.$locale = function() { return ht[this.$L]; }, m.locale = function(p, F) { if (!p) return this.$L; var C = this.clone(), v = Dt(p, F, !0); return v && (C.$L = v), C; }, m.clone = function() { return q.w(this.$d, this); }, m.toDate = function() { return new Date(this.valueOf()); }, m.toJSON = function() { return this.isValid() ? this.toISOString() : null; }, m.toISOString = function() { return this.$d.toISOString(); }, m.toString = function() { return this.$d.toUTCString(); }, S; }(), Pi = Wt.prototype; return D.prototype = Pi, [["$ms", n], ["$s", s], ["$m", a], ["$H", h], ["$W", u], ["$M", c], ["$y", g], ["$D", L]].forEach(function(S) { Pi[S[1]] = function(m) { return this.$g(m, S[0], S[1]); }; }), D.extend = function(S, m) { return S.$i || (S(m, Wt, D), S.$i = !0), D; }, D.locale = Dt, D.isDayjs = gi, D.unix = function(S) { return D(1e3 * S); }, D.en = ht[St], D.Ls = ht, D.p = {}, D; }); })(ie); var nr = ie.exports; const sr = /* @__PURE__ */ or(nr), Q = { trace: 0, debug: 1, info: 2, warn: 3, error: 4, fatal: 5 }, y = { trace: (...t) => { }, debug: (...t) => { }, info: (...t) => { }, warn: (...t) => { }, error: (...t) => { }, fatal: (...t) => { } }, Li = function(t = "fatal") { let i = Q.fatal; typeof t == "string" ? (t = t.toLowerCase(), t in Q && (i = Q[t])) : typeof t == "number" && (i = t), y.trace = () => { }, y.debug = () => { }, y.info = () => { }, y.warn = () => { }, y.error = () => { }, y.fatal = () => { }, i <= Q.fatal && (y.fatal = console.error ? console.error.bind(console, G("FATAL"), "color: orange") : console.log.bind(console, "\x1B[35m", G("FATAL"))), i <= Q.error && (y.error = console.error ? console.error.bind(console, G("ERROR"), "color: orange") : console.log.bind(console, "\x1B[31m", G("ERROR"))), i <= Q.warn && (y.warn = console.warn ? console.warn.bind(console, G("WARN"), "color: orange") : console.log.bind(console, "\x1B[33m", G("WARN"))), i <= Q.info && (y.info = console.info ? console.info.bind(console, G("INFO"), "color: lightblue") : console.log.bind(console, "\x1B[34m", G("INFO"))), i <= Q.debug && (y.debug = console.debug ? console.debug.bind(console, G("DEBUG"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", G("DEBUG"))), i <= Q.trace && (y.trace = console.debug ? console.debug.bind(console, G("TRACE"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", G("TRACE"))); }, G = (t) => `%c${sr().format("ss.SSS")} : ${t} : `; var vi = {}; Object.defineProperty(vi, "__esModule", { value: !0 }); var ee = vi.sanitizeUrl = void 0, ar = /^([^\w]*)(javascript|data|vbscript)/im, lr = /&#(\w+)(^\w|;)?/g, hr = /&tab;/gi, cr = /[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim, ur = /^.+(:|&colon;)/gim, dr = [".", "/"]; function fr(t) { return dr.indexOf(t[0]) > -1; } function gr(t) { return t = t.replace(hr, "&#9;"), t.replace(lr, function(i, e) { return String.fromCharCode(e); }); } function pr(t) { var i = gr(t || "").replace(cr, "").trim(); if (!i) return "about:blank"; if (fr(i)) return i; var e = i.match(ur); if (!e) return i; var r = e[0]; return ar.test(r) ? "about:blank" : i; } ee = vi.sanitizeUrl = pr; const Bi = { sanitize: (t, i) => t }, ri = /<br\s*\/?>/gi, Cr = (t) => t ? oe(t).replace(/\\n/g, "#br#").split("#br#") : [""], re = (t) => Bi.sanitize(t), ji = (t, i) => { var e; if (((e = i.flowchart) == null ? void 0 : e.htmlLabels) !== !1) { const r = i.securityLevel; r === "antiscript" || r === "strict" ? t = re(t) : r !== "loose" && (t = oe(t), t = t.replace(/</g, "&lt;").replace(/>/g, "&gt;"), t = t.replace(/=/g, "&equals;"), t = xr(t)); } return t; }, Ot = (t, i) => t && (i.dompurifyConfig ? t = Bi.sanitize(ji(t, i), i.dompurifyConfig).toString() : t = Bi.sanitize(ji(t, i), { FORBID_TAGS: ["style"] }).toString(), t), mr = (t, i) => typeof t == "string" ? Ot(t, i) : t.flat().map((e) => Ot(e, i)), yr = (t) => ri.test(t), br = (t) => t.split(ri), xr = (t) => t.replace(/#br#/g, "<br/>"), oe = (t) => t.replace(ri, "#br#"), kr = (t) => { let i = ""; return t && (i = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, i = i.replaceAll(/\(/g, "\\("), i = i.replaceAll(/\)/g, "\\)")), i; }, Tr = (t) => !(t === !1 || ["false", "null", "0"].includes(String(t).trim().toLowerCase())), Br = function(...t) { const i = t.filter((e) => !isNaN(e)); return Math.max(...i); }, Sr = function(...t) { const i = t.filter((e) => !isNaN(e)); return Math.min(...i); }, wi = { getRows: Cr, sanitizeText: Ot, sanitizeTextOrArray: mr, hasBreaks: yr, splitBreaks: br, lineBreakRegex: ri, removeScript: re, getUrl: kr, evaluate: Tr, getMax: Br, getMin: Sr }, Ht = { /* 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: (t) => t >= 255 ? 255 : t < 0 ? 0 : t, g: (t) => t >= 255 ? 255 : t < 0 ? 0 : t, b: (t) => t >= 255 ? 255 : t < 0 ? 0 : t, h: (t) => t % 360, s: (t) => t >= 100 ? 100 : t < 0 ? 0 : t, l: (t) => t >= 100 ? 100 : t < 0 ? 0 : t, a: (t) => t >= 1 ? 1 : t < 0 ? 0 : t }, /* CONVERSION */ //SOURCE: https://planetcalc.com/7779 toLinear: (t) => { const i = t / 255; return t > 0.03928 ? Math.pow((i + 0.055) / 1.055, 2.4) : i / 12.92; }, //SOURCE: https://gist.github.com/mjackson/5311256 hue2rgb: (t, i, e) => (e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? t + (i - t) * 6 * e : e < 1 / 2 ? i : e < 2 / 3 ? t + (i - t) * (2 / 3 - e) * 6 : t), hsl2rgb: ({ h: t, s: i, l: e }, r) => { if (!i) return e * 2.55; t /= 360, i /= 100, e /= 100; const o = e < 0.5 ? e * (1 + i) : e + i - e * i, n = 2 * e - o; switch (r) { case "r": return Ht.hue2rgb(n, o, t + 1 / 3) * 255; case "g": return Ht.hue2rgb(n, o, t) * 255; case "b": return Ht.hue2rgb(n, o, t - 1 / 3) * 255; } }, rgb2hsl: ({ r: t, g: i, b: e }, r) => { t /= 255, i /= 255, e /= 255; const o = Math.max(t, i, e), n = Math.min(t, i, e), s = (o + n) / 2; if (r === "l") return s * 100; if (o === n) return 0; const a = o - n, h = s > 0.5 ? a / (2 - o - n) : a / (o + n); if (r === "s") return h * 100; switch (o) { case t: return ((i - e) / a + (i < e ? 6 : 0)) * 60; case i: return ((e - t) / a + 2) * 60; case e: return ((t - i) / a + 4) * 60; default: return -1; } } }, Fr = Ht, _r = { /* API */ clamp: (t, i, e) => i > e ? Math.min(i, Math.max(e, t)) : Math.min(e, Math.max(i, t)), round: (t) => Math.round(t * 1e10) / 1e10 }, Lr = _r, vr = { /* API */ dec2hex: (t) => { const i = Math.round(t).toString(16); return i.length > 1 ? i : `0${i}`; } }, wr = vr, Ar = { channel: Fr, lang: Lr, unit: wr }, B = Ar, st = {}; for (let t = 0; t <= 255; t++) st[t] = B.unit.dec2hex(t); const P = { ALL: 0, RGB: 1, HSL: 2 }; class Or { constructor() { this.type = P.ALL; } /* API */ get() { return this.type; } set(i) { if (this.type && this.type !== i) throw new Error("Cannot change both RGB and HSL channels at the same time"); this.type = i; } reset() { this.type = P.ALL; } is(i) { return this.type === i; } } const Mr = Or; class qr { /* CONSTRUCTOR */ constructor(i, e) { this.color = e, this.changed = !1, this.data = i, this.type = new Mr(); } /* API */ set(i, e) { return this.color = e, this.changed = !1, this.data = i, this.type.type = P.ALL, this; } /* HELPERS */ _ensureHSL() { const i = this.data, { h: e, s: r, l: o } = i; e === void 0 && (i.h = B.channel.rgb2hsl(i, "h")), r === void 0 && (i.s = B.channel.rgb2hsl(i, "s")), o === void 0 && (i.l = B.channel.rgb2hsl(i, "l")); } _ensureRGB() { const i = this.data, { r: e, g: r, b: o } = i; e === void 0 && (i.r = B.channel.hsl2rgb(i, "r")), r === void 0 && (i.g = B.channel.hsl2rgb(i, "g")), o === void 0 && (i.b = B.channel.hsl2rgb(i, "b")); } /* GETTERS */ get r() { const i = this.data, e = i.r; return !this.type.is(P.HSL) && e !== void 0 ? e : (this._ensureHSL(), B.channel.hsl2rgb(i, "r")); } get g() { const i = this.data, e = i.g; return !this.type.is(P.HSL) && e !== void 0 ? e : (this._ensureHSL(), B.channel.hsl2rgb(i, "g")); } get b() { const i = this.data, e = i.b; return !this.type.is(P.HSL) && e !== void 0 ? e : (this._ensureHSL(), B.channel.hsl2rgb(i, "b")); } get h() { const i = this.data, e = i.h; return !this.type.is(P.RGB) && e !== void 0 ? e : (this._ensureRGB(), B.channel.rgb2hsl(i, "h")); } get s() { const i = this.data, e = i.s; return !this.type.is(P.RGB) && e !== void 0 ? e : (this._ensureRGB(), B.channel.rgb2hsl(i, "s")); } get l() { const i = this.data, e = i.l; return !this.type.is(P.RGB) && e !== void 0 ? e : (this._ensureRGB(), B.channel.rgb2hsl(i, "l")); } get a() { return this.data.a; } /* SETTERS */ set r(i) { this.type.set(P.RGB), this.changed = !0, this.data.r = i; } set g(i) { this.type.set(P.RGB), this.changed = !0, this.data.g = i; } set b(i) { this.type.set(P.RGB), this.changed = !0, this.data.b = i; } set h(i) { this.type.set(P.HSL), this.changed = !0, this.data.h = i; } set s(i) { this.type.set(P.HSL), this.changed = !0, this.data.s = i; } set l(i) { this.type.set(P.HSL), this.changed = !0, this.data.l = i; } set a(i) { this.changed = !0, this.data.a = i; } } const Er = qr, Ir = new Er({ r: 0, g: 0, b: 0, a: 0 }, "transparent"), oi = Ir, ne = { /* VARIABLES */ re: /^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i, /* API */ parse: (t) => { if (t.charCodeAt(0) !== 35) return; const i = t.match(ne.re); if (!i) return; const e = i[1], r = parseInt(e, 16), o = e.length, n = o % 4 === 0, s = o > 4, a = s ? 1 : 17, h = s ? 8 : 4, u = n ? 0 : -1, d = s ? 255 : 15; return oi.set({ r: (r >> h * (u + 3) & d) * a, g: (r >> h * (u + 2) & d) * a, b: (r >> h * (u + 1) & d) * a, a: n ? (r & d) * a / 255 : 1 }, t); }, stringify: (t) => { const { r: i, g: e, b: r, a: o } = t; return o < 1 ? `#${st[Math.round(i)]}${st[Math.round(e)]}${st[Math.round(r)]}${st[Math.round(o * 255)]}` : `#${st[Math.round(i)]}${st[Math.round(e)]}${st[Math.round(r)]}`; } }, vt = ne, Yt = { /* 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: (t) => { const i = t.match(Yt.hueRe); if (i) { const [, e, r] = i; switch (r) { case "grad": return B.channel.clamp.h(parseFloat(e) * 0.9); case "rad": return B.channel.clamp.h(parseFloat(e) * 180 / Math.PI); case "turn": return B.channel.clamp.h(parseFloat(e) * 360); } } return B.channel.clamp.h(parseFloat(t)); }, /* API */ parse: (t) => { const i = t.charCodeAt(0); if (i !== 104 && i !== 72) return; const e = t.match(Yt.re); if (!e) return; const [, r, o, n, s, a] = e; return oi.set({ h: Yt._hue2deg(r), s: B.channel.clamp.s(parseFloat(o)), l: B.channel.clamp.l(parseFloat(n)), a: s ? B.channel.clamp.a(a ? parseFloat(s) / 100 : parseFloat(s)) : 1 }, t); }, stringify: (t) => { const { h: i, s: e, l: r, a: o } = t; return o < 1 ? `hsla(${B.lang.round(i)}, ${B.lang.round(e)}%, ${B.lang.round(r)}%, ${o})` : `hsl(${B.lang.round(i)}, ${B.lang.round(e)}%, ${B.lang.round(r)}%)`; } }, jt = Yt, Vt = { /* 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: (t) => { t = t.toLowerCase(); const i = Vt.colors[t]; if (i) return vt.parse(i); }, stringify: (t) => { const i = vt.stringify(t); for (const e in Vt.colors) if (Vt.colors[e] === i) return e; } }, Ri = Vt, se = { /* 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: (t) => { const i = t.charCodeAt(0); if (i !== 114 && i !== 82) return; const e = t.match(se.re); if (!e) return; const [, r, o, n, s, a, h, u, d] = e; return oi.set({ r: B.channel.clamp.r(o ? parseFloat(r) * 2.55 : parseFloat(r)), g: B.channel.clamp.g(s ? parseFloat(n) * 2.55 : parseFloat(n)), b: B.channel.clamp.b(h ? parseFloat(a) * 2.55 : parseFloat(a)), a: u ? B.channel.clamp.a(d ? parseFloat(u) / 100 : parseFloat(u)) : 1 }, t); }, stringify: (t) => { const { r: i, g: e, b: r, a: o } = t; return o < 1 ? `rgba(${B.lang.round(i)}, ${B.lang.round(e)}, ${B.lang.round(r)}, ${B.lang.round(o)})` : `rgb(${B.lang.round(i)}, ${B.lang.round(e)}, ${B.lang.round(r)})`; } }, Rt = se, $r = { /* VARIABLES */ format: { keyword: Ri, hex: vt, rgb: Rt, rgba: Rt, hsl: jt, hsla: jt }, /* API */ parse: (t) => { if (typeof t != "string") return t; const i = vt.parse(t) || Rt.parse(t) || jt.parse(t) || Ri.parse(t); if (i) return i; throw new Error(`Unsupported color format: "${t}"`); }, stringify: (t) => !t.changed && t.color ? t.color : t.type.is(P.HSL) || t.data.r === void 0 ? jt.stringify(t) : t.a < 1 || !Number.isInteger(t.r) || !Number.isInteger(t.g) || !Number.isInteger(t.b) ? Rt.stringify(t) : vt.stringify(t) }, Z = $r, zr = (t, i) => { const e = Z.parse(t); for (const r in i) e[r] = B.channel.clamp[r](i[r]); return Z.stringify(e); }, ae = zr, Dr = (t, i, e = 0, r = 1) => { if (typeof t != "number") return ae(t, { a: i }); const o = oi.set({ r: B.channel.clamp.r(t), g: B.channel.clamp.g(i), b: B.channel.clamp.b(e), a: B.channel.clamp.a(r) }); return Z.stringify(o); }, wt = Dr, Wr = (t) => { const { r: i, g: e, b: r } = Z.parse(t), o = 0.2126 * B.channel.toLinear(i) + 0.7152 * B.channel.toLinear(e) + 0.0722 * B.channel.toLinear(r); return B.lang.round(o); }, Pr = Wr, jr = (t) => Pr(t) >= 0.5, Rr = jr, Nr = (t) => !Rr(t), $t = Nr, Hr = (t, i, e) => { const r = Z.parse(t), o = r[i], n = B.channel.clamp[i](o + e); return o !== n && (r[i] = n), Z.stringify(r); }, le = Hr, Yr = (t, i) => le(t, "l", i), x = Yr, Vr = (t, i) => le(t, "l", -i), T = Vr, Ur = (t, i) => { const e = Z.parse(t), r = {}; for (const o in i) i[o] && (r[o] = e[o] + i[o]); return ae(t, r); }, l = Ur, Gr = (t, i, e = 50) => { const { r, g: o, b: n, a: s } = Z.parse(t), { r: a, g: h, b: u, a: d } = Z.parse(i), c = e / 100, b = c * 2 - 1, g = s - d, A = ((b * g === -1 ? b : (b + g) / (1 + b * g)) + 1) / 2, O = 1 - A, z = r * A + a * O, w = o * A + h * O, Bt = n * A + u * O, fi = s * c + d * (1 - c); return wt(z, w, Bt, fi); }, Xr = Gr, Kr = (t, i = 100) => { const e = Z.parse(t); return e.r = 255 - e.r, e.g = 255 - e.g, e.b = 255 - e.b, Xr(e, t, i); }, f = Kr, H = (t, i) => i ? l(t, { s: -40, l: 10 }) : l(t, { s: -40, l: -10 }), ni = "#ffffff", si = "#f2f2f2"; let Zr = 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 || l(this.primaryColor, { h: -120 }), this.tertiaryColor = this.tertiaryColor || l(this.primaryColor, { h: 180, l: 5 }), this.primaryBorderColor = this.primaryBorderColor || H(this.primaryColor, this.darkMode), this.secondaryBorderColor = this.secondaryBorderColor || H(this.secondaryColor, this.darkMode), this.tertiaryBorderColor = this.tertiaryBorderColor || H(this.tertiaryColor, this.darkMode), this.noteBorderColor = this.noteBorderColor || H(this.noteBkgColor, this.darkMode), this.noteBkgColor = this.noteBkgColor || "#fff5ad", this.noteTextColor = this.noteTextColor || "#333", this.secondaryTextColor = this.secondaryTextColor || f(this.secondaryColor), this.tertiaryTextColor = this.tertiaryTextColor || f(this.tertiaryColor), this.lineColor = this.lineColor || f(this.background), this.arrowheadColor = this.arrowheadColor || f(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 ? T(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 || T(this.secondaryColor, 10), this.activationBkgColor = this.activationBkgColor || this.secondaryColor, this.sequenceNumberColor = this.sequenceNumberColor || f(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 || x(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 || l(this.primaryColor, { h: 30 }), this.cScale4 = this.cScale4 || l(this.primaryColor, { h: 60 }), this.cScale5 = this.cScale5 || l(this.primaryColor, { h: 90 }), this.cScale6 = this.cScale6 || l(this.primaryColor, { h: 120 }), this.cScale7 = this.cScale7 || l(this.primaryColor, { h: 150 }), this.cScale8 = this.cScale8 || l(this.primaryColor, { h: 210, l: 150 }), this.cScale9 = this.cScale9 || l(this.primaryColor, { h: 270 }), this.cScale10 = this.cScale10 || l(this.primaryColor, { h: 300 }), this.cScale11 = this.cScale11 || l(this.primaryColor, { h: 330 }), this.darkMode) for (let e = 0; e < this.THEME_COLOR_LIMIT; e++) this["cScale" + e] = T(this["cScale" + e], 75); else for (let e = 0; e < this.THEME_COLOR_LIMIT; e++) this["cScale" + e] = T(this["cScale" + e], 25); for (let e = 0; e < this.THEME_COLOR_LIMIT; e++) this["cScaleInv" + e] = this["cScaleInv" + e] || f(this["cScale" + e]); for (let e = 0; e < this.THEME_COLOR_LIMIT; e++) this.darkMode ? this["cScalePeer" + e] = this["cScalePeer" + e] || x(this["cScale" + e], 10) : this["cScalePeer" + e] = this["cScalePeer" + e] || T(this["cScale" + e], 10); this.scaleLabelColor = this.scaleLabelColor || this.labelTextColor; for (let e = 0; e < this.THEME_COLOR_LIMIT; e++) this["cScaleLabel" + e] = this["cScaleLabel" + e] || this.scaleLabelColor; const i = this.darkMode ? -4 : -1; for (let e = 0; e < 5; e++) this["surface" + e] = this["surface" + e] || l(this.mainBkg, { h: 180, s: -15, l: i * (5 + e * 3) }), this["surfacePeer" + e] = this["surfacePeer" + e] || l(this.mainBkg, { h: 180, s: -15, l: i * (8 + e * 3) }); this.classText = this.classText || this.textColor, this.fillType0 = this.fillType0 || this.primaryColor, this.fillType1 = this.fillType1 || this.secondaryColor, this.fillType2 = this.fillType2 || l(this.primaryColor, { h: 64 }), this.fillType3 = this.fillType3 || l(this.secondaryColor, { h: 64 }), this.fillType4 = this.fillType4 || l(this.primaryColor, { h: -64 }), this.fillType5 = this.fillType5 || l(this.secondaryColor, { h: -64 }), this.fillType6 = this.fillType6 || l(this.primaryColor, { h: 128 }), this.fillType7 = this.fillType7 || l(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 || l(this.primaryColor, { l: -10 }), this.pie5 = this.pie5 || l(this.secondaryColor, { l: -10 }), this.pie6 = this.pie6 || l(this.tertiaryColor, { l: -10 }), this.pie7 = this.pie7 || l(this.primaryColor, { h: 60, l: -10 }), this.pie8 = this.pie8 || l(this.primaryColor, { h: -60, l: -10 }), this.pie9 = this.pie9 || l(this.primaryColor, { h: 120, l: 0 }), this.pie10 = this.pie10 || l(this.primaryColor, { h: 60, l: -20 }), this.pie11 = this.pie11 || l(this.primaryColor, { h: -60, l: -20 }), this.pie12 = this.pie12 || l(this.primaryColor, { h: 120, l: -10 }), this.pieTitleTextSize = this.pieTitleTextSize || "25px", this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor, this.pieSectionTextSize = this.pieSectionTextSize || "17px", this.pieSectionTextColor = this.pieSectionTextColor || this.textColor, this.pieLegendTextSize = this.pieLegendTextSize || "17px", this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor, this.pieStrokeColor = this.pieStrokeColor || "black", this.pieStrokeWidth = this.pieStrokeWidth || "2px", this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px", this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black", this.pieOpacity = this.pieOpacity || "0.7", this.quadrant1Fill = this.quadrant1Fill || this.primaryColor, this.quadrant2Fill = this.quadrant2Fill || l(this.primaryColor, { r: 5, g: 5, b: 5 }), this.quadrant3Fill = this.quadrant3Fill || l(this.primaryColor, { r: 10, g: 10, b: 10 }), this.quadrant4Fill = this.quadrant4Fill || l(this.primaryColor, { r: 15, g: 15, b: 15 }), this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor, this.quadrant2TextFill = this.quadrant2TextFill || l(this.primaryTextColor, { r: -5, g: -5, b: -5 }), this.quadrant3TextFill = this.quadrant3TextFill || l(this.primaryTextColor, { r: -10, g: -10, b: -10 }), this.quadrant4TextFill = this.quadrant4TextFill || l(this.primaryTextColor, { r: -15, g: -15, b: -15 }), this.quadrantPointFill = this.quadrantPointFill || $t(this.quadrant1Fill) ? x(this.quadrant1Fill) : T(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.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 ? T(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 || l(this.primaryColor, { h: -30 }), this.git4 = this.git4 || l(this.primaryColor, { h: -60 }), this.git5 = this.git5 || l(this.primaryColor, { h: -90 }), this.git6 = this.git6 || l(this.primaryColor, { h: 60 }), this.git7 = this.git7 || l(this.primaryColor, { h: 120 }), this.darkMode ? (this.git0 = x(this.git0, 25), this.git1 = x(this.git1, 25), this.git2 = x(this.git2, 25), this.git3 = x(this.git3, 25), this.git4 = x(this.git4, 25), this.git5 = x(this.git5, 25), this.git6 = x(this.git6, 25), this.git7 = x(this.git7, 25)) : (this.git0 = T(this.git0, 25), this.git1 = T(this.git1, 25), this.git2 = T(this.git2, 25), this.git3 = T(this.git3, 25), this.git4 = T(this.git4, 25), this.git5 = T(this.git5, 25), this.git6 = T(this.git6, 25), this.git7 = T(this.git7, 25)), this.gitInv0 = this.gitInv0 || f(this.git0), this.gitInv1 = this.gitInv1 || f(this.git1), this.gitInv2 = this.gitInv2 || f(this.git2), this.gitInv3 = this.gitInv3 || f(this.git3), this.gitInv4 = this.gitInv4 || f(this.git4), this.gitInv5 = this.gitInv5 || f(this.git5), this.gitInv6 = this.gitInv6 || f(this.git6), this.gitInv7 = this.gitInv7 || f(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 || ni, this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || si; } calculate(i) { if (typeof i != "object") { this.updateColors(); return; } const e = Object.keys(i); e.forEach((r) => { this[r] = i[r]; }), this.updateColors(), e.forEach((r) => { this[r] = i[r]; }); } }; const Jr = (t) => { const i = new Zr(); return i.calculate(t), i; }; let Qr = class { constructor() { this.background = "#333", this.primaryColor = "#1f2020", this.secondaryColor = x(this.primaryColor, 16), this.tertiaryColor = l(this.primaryColor, { h: -160 }), this.primaryBorderColor = f(this.background), this.secondaryBorderColor = H(this.secondaryColor, this.darkMode), this.tertiaryBorderColor = H(this.tertiaryColor, this.darkMode), this.primaryTextColor = f(this.primaryColor), this.secondaryTextColor = f(this.secondaryColor), this.tertiaryTextColor = f(this.tertiaryColor), this.lineColor = f(this.background), this.textColor = f(this.background), this.mainBkg = "#1f2020", this.secondBkg = "calculated", this.mainContrastColor = "lightgrey", this.darkTextColor = x(f("#323D47"), 10), this.lineColor = "calculated", this.border1 = "#81B1DB", this.border2 = wt(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 = T("#EAE8D9", 30), this.altSectionBkgColor = "calculated", this.sectionBkgColor2 = "#EAE8D9", this.excludeBkgColor = T(this.sectionBkgColor, 10), this.taskBorderColor = wt(255, 255, 255, 70), this.taskBkgColor = "calculated", this.taskTextColor = "calculated", this.taskTextLightColor = "calculated", this.taskTextOutsideColor = "calculated", this.taskTextClickableColor = "#003163", this.activeTaskBorderColor = wt(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 = x(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 = x(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 = x(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 = l(this.primaryColor, { h: 64 }), this.fillType3 = l(this.secondaryColor, { h: 64 }), this.fillType4 = l(this.primaryColor, { h: -64 }), this.fillType5 = l(this.secondaryColor, { h: -64 }), this.fillType6 = l(this.primaryColor, { h: 128 }), this.fillType7 = l(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 || l(this.primaryColor, { h: 30 }), this.cScale4 = this.cScale4 || l(this.primaryColor, { h: 60 }), this.cScale5 = this.cScale5 || l(this.primaryColor, { h: 90 }), this.cScale6 = this.cScale6 || l(this.primaryColor, { h: 120 }), this.cScale7 = this.cScale7 || l(this.primaryColor, { h: 150 }), this.cScale8 = this.cScale8 || l(this.primaryColor, { h: 210 }), this.cScale9 = this.cScale9 || l(this.primaryColor, { h: 270 }), this.cScale10 = this.cScale10 || l(this.primaryColor, { h: 300 }), this.cScale11 = this.cScale11 || l(this.primaryColor, { h: 3