mermaid
Version:
Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.
1,005 lines • 238 kB
JavaScript
import { dedent } from "ts-dedent";
import dayjs from "dayjs";
import { sanitizeUrl } from "@braintree/sanitize-url";
import { select, curveBasis, curveBasisClosed, curveBasisOpen, curveBumpX, curveBumpY, curveBundle, curveCardinalClosed, curveCardinalOpen, curveCardinal, curveCatmullRomClosed, curveCatmullRomOpen, curveCatmullRom, curveLinear, curveLinearClosed, curveMonotoneX, curveMonotoneY, curveNatural, curveStep, curveStepAfter, curveStepBefore } from "d3";
import DOMPurify from "dompurify";
import { adjust, invert, darken, lighten, isDark, rgba } from "khroma";
import memoize from "lodash-es/memoize.js";
import merge$1 from "lodash-es/merge.js";
import { serialize, compile, stringify } from "stylis";
import isEmpty from "lodash-es/isEmpty.js";
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("FATAL"), "color: orange") : console.log.bind(console, "\x1B[35m", format("FATAL"));
}
if (numericLevel <= LEVELS.error) {
log$1.error = console.error ? console.error.bind(console, format("ERROR"), "color: orange") : console.log.bind(console, "\x1B[31m", format("ERROR"));
}
if (numericLevel <= LEVELS.warn) {
log$1.warn = console.warn ? console.warn.bind(console, format("WARN"), "color: orange") : console.log.bind(console, `\x1B[33m`, format("WARN"));
}
if (numericLevel <= LEVELS.info) {
log$1.info = console.info ? console.info.bind(console, format("INFO"), "color: lightblue") : console.log.bind(console, "\x1B[34m", format("INFO"));
}
if (numericLevel <= LEVELS.debug) {
log$1.debug = console.debug ? console.debug.bind(console, format("DEBUG"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", format("DEBUG"));
}
if (numericLevel <= LEVELS.trace) {
log$1.trace = console.debug ? console.debug.bind(console, format("TRACE"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", format("TRACE"));
}
};
const format = (level) => {
const time = dayjs().format("ss.SSS");
return `%c${time} : ${level} : `;
};
const lineBreakRegex = /<br\s*\/?>/gi;
const getRows = (s) => {
if (!s) {
return [""];
}
const str2 = breakToPlaceholder(s).replace(/\\n/g, "#br#");
return str2.split("#br#");
};
const setupDompurifyHooksIfNotSetup = (() => {
let setup = false;
return () => {
if (!setup) {
setupDompurifyHooks();
setup = true;
}
};
})();
function setupDompurifyHooks() {
const TEMPORARY_ATTRIBUTE = "data-temp-href-target";
DOMPurify.addHook("beforeSanitizeAttributes", (node) => {
if (node.tagName === "A" && node.hasAttribute("target")) {
node.setAttribute(TEMPORARY_ATTRIBUTE, node.getAttribute("target") || "");
}
});
DOMPurify.addHook("afterSanitizeAttributes", (node) => {
if (node.tagName === "A" && node.hasAttribute(TEMPORARY_ATTRIBUTE)) {
node.setAttribute("target", node.getAttribute(TEMPORARY_ATTRIBUTE) || "");
node.removeAttribute(TEMPORARY_ATTRIBUTE);
if (node.getAttribute("target") === "_blank") {
node.setAttribute("rel", "noopener");
}
}
});
}
const removeScript = (txt) => {
setupDompurifyHooksIfNotSetup();
const sanitizedText = DOMPurify.sanitize(txt);
return sanitizedText;
};
const sanitizeMore = (text, config2) => {
var _a;
if (((_a = config2.flowchart) == null ? void 0 : _a.htmlLabels) !== false) {
const level = config2.securityLevel;
if (level === "antiscript" || level === "strict") {
text = removeScript(text);
} else if (level !== "loose") {
text = breakToPlaceholder(text);
text = text.replace(/</g, "<").replace(/>/g, ">");
text = text.replace(/=/g, "=");
text = placeholderToBreak(text);
}
}
return text;
};
const sanitizeText$2 = (text, config2) => {
if (!text) {
return text;
}
if (config2.dompurifyConfig) {
text = DOMPurify.sanitize(sanitizeMore(text, config2), config2.dompurifyConfig).toString();
} else {
text = DOMPurify.sanitize(sanitizeMore(text, config2), {
FORBID_TAGS: ["style"]
}).toString();
}
return text;
};
const sanitizeTextOrArray = (a, config2) => {
if (typeof a === "string") {
return sanitizeText$2(a, config2);
}
return a.flat().map((x) => sanitizeText$2(x, config2));
};
const hasBreaks = (text) => {
return lineBreakRegex.test(text);
};
const splitBreaks = (text) => {
return text.split(lineBreakRegex);
};
const placeholderToBreak = (s) => {
return s.replace(/#br#/g, "<br/>");
};
const breakToPlaceholder = (s) => {
return s.replace(lineBreakRegex, "#br#");
};
const getUrl = (useAbsolute) => {
let url = "";
if (useAbsolute) {
url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
url = url.replaceAll(/\(/g, "\\(");
url = url.replaceAll(/\)/g, "\\)");
}
return url;
};
const evaluate = (val) => val === false || ["false", "null", "0"].includes(String(val).trim().toLowerCase()) ? false : true;
const getMax = function(...values) {
const newValues = values.filter((value) => {
return !isNaN(value);
});
return Math.max(...newValues);
};
const getMin = function(...values) {
const newValues = values.filter((value) => {
return !isNaN(value);
});
return Math.min(...newValues);
};
const parseGenericTypes = function(input) {
const inputSets = input.split(/(,)/);
const output = [];
for (let i = 0; i < inputSets.length; i++) {
let thisSet = inputSets[i];
if (thisSet === "," && i > 0 && i + 1 < inputSets.length) {
const previousSet = inputSets[i - 1];
const nextSet = inputSets[i + 1];
if (shouldCombineSets(previousSet, nextSet)) {
thisSet = previousSet + "," + nextSet;
i++;
output.pop();
}
}
output.push(processSet(thisSet));
}
return output.join("");
};
const countOccurrence = (string, substring) => {
return Math.max(0, string.split(substring).length - 1);
};
const shouldCombineSets = (previousSet, nextSet) => {
const prevCount = countOccurrence(previousSet, "~");
const nextCount = countOccurrence(nextSet, "~");
return prevCount === 1 && nextCount === 1;
};
const processSet = (input) => {
const tildeCount = countOccurrence(input, "~");
let hasStartingTilde = false;
if (tildeCount <= 1) {
return input;
}
if (tildeCount % 2 !== 0 && input.startsWith("~")) {
input = input.substring(1);
hasStartingTilde = true;
}
const chars = [...input];
let first = chars.indexOf("~");
let last = chars.lastIndexOf("~");
while (first !== -1 && last !== -1 && first !== last) {
chars[first] = "<";
chars[last] = ">";
first = chars.indexOf("~");
last = chars.lastIndexOf("~");
}
if (hasStartingTilde) {
chars.unshift("~");
}
return chars.join("");
};
const isMathMLSupported = () => window.MathMLElement !== void 0;
const katexRegex = /\$\$(.*)\$\$/g;
const hasKatex = (text) => {
var _a;
return (((_a = text.match(katexRegex)) == null ? void 0 : _a.length) ?? 0) > 0;
};
const calculateMathMLDimensions = async (text, config2) => {
text = await renderKatex(text, config2);
const divElem = document.createElement("div");
divElem.innerHTML = text;
divElem.id = "katex-temp";
divElem.style.visibility = "hidden";
divElem.style.position = "absolute";
divElem.style.top = "0";
const body = document.querySelector("body");
body == null ? void 0 : body.insertAdjacentElement("beforeend", divElem);
const dim = { width: divElem.clientWidth, height: divElem.clientHeight };
divElem.remove();
return dim;
};
const renderKatex = async (text, config2) => {
if (!hasKatex(text)) {
return text;
}
if (!isMathMLSupported() && !config2.legacyMathML) {
return text.replace(katexRegex, "MathML is unsupported in this environment.");
}
const { default: katex } = await import("katex");
return text.split(lineBreakRegex).map(
(line) => hasKatex(line) ? `
<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">
${line}
</div>
` : `<div>${line}</div>`
).join("").replace(
katexRegex,
(_, c) => katex.renderToString(c, {
throwOnError: true,
displayMode: true,
output: isMathMLSupported() ? "mathml" : "htmlAndMathml"
}).replace(/\n/g, " ").replace(/<annotation.*<\/annotation>/g, "")
);
};
const common$1 = {
getRows,
sanitizeText: sanitizeText$2,
sanitizeTextOrArray,
hasBreaks,
splitBreaks,
lineBreakRegex,
removeScript,
getUrl,
evaluate,
getMax,
getMin
};
const mkBorder = (col, darkMode) => darkMode ? adjust(col, { s: -40, l: 10 }) : adjust(col, { s: -40, l: -10 });
const oldAttributeBackgroundColorOdd = "#ffffff";
const oldAttributeBackgroundColorEven = "#f2f2f2";
let Theme$4 = class Theme {
constructor() {
this.background = "#f4f4f4";
this.primaryColor = "#fff4dd";
this.noteBkgColor = "#fff5ad";
this.noteTextColor = "#333";
this.THEME_COLOR_LIMIT = 12;
this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif';
this.fontSize = "16px";
}
updateColors() {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
this.primaryTextColor = this.primaryTextColor || (this.darkMode ? "#eee" : "#333");
this.secondaryColor = this.secondaryColor || adjust(this.primaryColor, { h: -120 });
this.tertiaryColor = this.tertiaryColor || adjust(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(this.secondaryColor);
this.tertiaryTextColor = this.tertiaryTextColor || invert(this.tertiaryColor);
this.lineColor = this.lineColor || invert(this.background);
this.arrowheadColor = this.arrowheadColor || invert(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(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(this.secondaryColor, 10);
this.activationBkgColor = this.activationBkgColor || this.secondaryColor;
this.sequenceNumberColor = this.sequenceNumberColor || invert(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(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(this.primaryColor, { h: 30 });
this.cScale4 = this.cScale4 || adjust(this.primaryColor, { h: 60 });
this.cScale5 = this.cScale5 || adjust(this.primaryColor, { h: 90 });
this.cScale6 = this.cScale6 || adjust(this.primaryColor, { h: 120 });
this.cScale7 = this.cScale7 || adjust(this.primaryColor, { h: 150 });
this.cScale8 = this.cScale8 || adjust(this.primaryColor, { h: 210, l: 150 });
this.cScale9 = this.cScale9 || adjust(this.primaryColor, { h: 270 });
this.cScale10 = this.cScale10 || adjust(this.primaryColor, { h: 300 });
this.cScale11 = this.cScale11 || adjust(this.primaryColor, { h: 330 });
if (this.darkMode) {
for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
this["cScale" + i] = darken(this["cScale" + i], 75);
}
} else {
for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
this["cScale" + i] = darken(this["cScale" + i], 25);
}
}
for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
this["cScaleInv" + i] = this["cScaleInv" + i] || invert(this["cScale" + i]);
}
for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
if (this.darkMode) {
this["cScalePeer" + i] = this["cScalePeer" + i] || lighten(this["cScale" + i], 10);
} else {
this["cScalePeer" + i] = this["cScalePeer" + i] || darken(this["cScale" + i], 10);
}
}
this.scaleLabelColor = this.scaleLabelColor || this.labelTextColor;
for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
this["cScaleLabel" + i] = this["cScaleLabel" + i] || this.scaleLabelColor;
}
const multiplier = this.darkMode ? -4 : -1;
for (let i = 0; i < 5; i++) {
this["surface" + i] = this["surface" + i] || adjust(this.mainBkg, { h: 180, s: -15, l: multiplier * (5 + i * 3) });
this["surfacePeer" + i] = this["surfacePeer" + i] || adjust(this.mainBkg, { h: 180, s: -15, l: multiplier * (8 + i * 3) });
}
this.classText = this.classText || this.textColor;
this.fillType0 = this.fillType0 || this.primaryColor;
this.fillType1 = this.fillType1 || this.secondaryColor;
this.fillType2 = this.fillType2 || adjust(this.primaryColor, { h: 64 });
this.fillType3 = this.fillType3 || adjust(this.secondaryColor, { h: 64 });
this.fillType4 = this.fillType4 || adjust(this.primaryColor, { h: -64 });
this.fillType5 = this.fillType5 || adjust(this.secondaryColor, { h: -64 });
this.fillType6 = this.fillType6 || adjust(this.primaryColor, { h: 128 });
this.fillType7 = this.fillType7 || adjust(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(this.primaryColor, { l: -10 });
this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -10 });
this.pie6 = this.pie6 || adjust(this.tertiaryColor, { l: -10 });
this.pie7 = this.pie7 || adjust(this.primaryColor, { h: 60, l: -10 });
this.pie8 = this.pie8 || adjust(this.primaryColor, { h: -60, l: -10 });
this.pie9 = this.pie9 || adjust(this.primaryColor, { h: 120, l: 0 });
this.pie10 = this.pie10 || adjust(this.primaryColor, { h: 60, l: -20 });
this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -60, l: -20 });
this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -10 });
this.pieTitleTextSize = this.pieTitleTextSize || "25px";
this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
this.pieSectionTextSize = this.pieSectionTextSize || "17px";
this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
this.pieLegendTextSize = this.pieLegendTextSize || "17px";
this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
this.pieStrokeColor = this.pieStrokeColor || "black";
this.pieStrokeWidth = this.pieStrokeWidth || "2px";
this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
this.pieOpacity = this.pieOpacity || "0.7";
this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
this.quadrant2Fill = this.quadrant2Fill || adjust(this.primaryColor, { r: 5, g: 5, b: 5 });
this.quadrant3Fill = this.quadrant3Fill || adjust(this.primaryColor, { r: 10, g: 10, b: 10 });
this.quadrant4Fill = this.quadrant4Fill || adjust(this.primaryColor, { r: 15, g: 15, b: 15 });
this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
this.quadrant2TextFill = this.quadrant2TextFill || adjust(this.primaryTextColor, { r: -5, g: -5, b: -5 });
this.quadrant3TextFill = this.quadrant3TextFill || adjust(this.primaryTextColor, { r: -10, g: -10, b: -10 });
this.quadrant4TextFill = this.quadrant4TextFill || adjust(this.primaryTextColor, { r: -15, g: -15, b: -15 });
this.quadrantPointFill = this.quadrantPointFill || isDark(this.quadrant1Fill) ? lighten(this.quadrant1Fill) : darken(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: ((_a = this.xyChart) == null ? void 0 : _a.backgroundColor) || this.background,
titleColor: ((_b = this.xyChart) == null ? void 0 : _b.titleColor) || this.primaryTextColor,
xAxisTitleColor: ((_c = this.xyChart) == null ? void 0 : _c.xAxisTitleColor) || this.primaryTextColor,
xAxisLabelColor: ((_d = this.xyChart) == null ? void 0 : _d.xAxisLabelColor) || this.primaryTextColor,
xAxisTickColor: ((_e = this.xyChart) == null ? void 0 : _e.xAxisTickColor) || this.primaryTextColor,
xAxisLineColor: ((_f = this.xyChart) == null ? void 0 : _f.xAxisLineColor) || this.primaryTextColor,
yAxisTitleColor: ((_g = this.xyChart) == null ? void 0 : _g.yAxisTitleColor) || this.primaryTextColor,
yAxisLabelColor: ((_h = this.xyChart) == null ? void 0 : _h.yAxisLabelColor) || this.primaryTextColor,
yAxisTickColor: ((_i = this.xyChart) == null ? void 0 : _i.yAxisTickColor) || this.primaryTextColor,
yAxisLineColor: ((_j = this.xyChart) == null ? void 0 : _j.yAxisLineColor) || this.primaryTextColor,
plotColorPalette: ((_k = this.xyChart) == null ? void 0 : _k.plotColorPalette) || "#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"
};
this.requirementBackground = this.requirementBackground || this.primaryColor;
this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
this.requirementBorderSize = this.requirementBorderSize || "1";
this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
this.relationColor = this.relationColor || this.lineColor;
this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? darken(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(this.primaryColor, { h: -30 });
this.git4 = this.git4 || adjust(this.primaryColor, { h: -60 });
this.git5 = this.git5 || adjust(this.primaryColor, { h: -90 });
this.git6 = this.git6 || adjust(this.primaryColor, { h: 60 });
this.git7 = this.git7 || adjust(this.primaryColor, { h: 120 });
if (this.darkMode) {
this.git0 = lighten(this.git0, 25);
this.git1 = lighten(this.git1, 25);
this.git2 = lighten(this.git2, 25);
this.git3 = lighten(this.git3, 25);
this.git4 = lighten(this.git4, 25);
this.git5 = lighten(this.git5, 25);
this.git6 = lighten(this.git6, 25);
this.git7 = lighten(this.git7, 25);
} else {
this.git0 = darken(this.git0, 25);
this.git1 = darken(this.git1, 25);
this.git2 = darken(this.git2, 25);
this.git3 = darken(this.git3, 25);
this.git4 = darken(this.git4, 25);
this.git5 = darken(this.git5, 25);
this.git6 = darken(this.git6, 25);
this.git7 = darken(this.git7, 25);
}
this.gitInv0 = this.gitInv0 || invert(this.git0);
this.gitInv1 = this.gitInv1 || invert(this.git1);
this.gitInv2 = this.gitInv2 || invert(this.git2);
this.gitInv3 = this.gitInv3 || invert(this.git3);
this.gitInv4 = this.gitInv4 || invert(this.git4);
this.gitInv5 = this.gitInv5 || invert(this.git5);
this.gitInv6 = this.gitInv6 || invert(this.git6);
this.gitInv7 = this.gitInv7 || invert(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 keys = Object.keys(overrides);
keys.forEach((k) => {
this[k] = overrides[k];
});
this.updateColors();
keys.forEach((k) => {
this[k] = overrides[k];
});
}
};
const getThemeVariables$4 = (userOverrides) => {
const theme2 = new Theme$4();
theme2.calculate(userOverrides);
return theme2;
};
let Theme$3 = class Theme2 {
constructor() {
this.background = "#333";
this.primaryColor = "#1f2020";
this.secondaryColor = lighten(this.primaryColor, 16);
this.tertiaryColor = adjust(this.primaryColor, { h: -160 });
this.primaryBorderColor = invert(this.background);
this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);
this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);
this.primaryTextColor = invert(this.primaryColor);
this.secondaryTextColor = invert(this.secondaryColor);
this.tertiaryTextColor = invert(this.tertiaryColor);
this.lineColor = invert(this.background);
this.textColor = invert(this.background);
this.mainBkg = "#1f2020";
this.secondBkg = "calculated";
this.mainContrastColor = "lightgrey";
this.darkTextColor = lighten(invert("#323D47"), 10);
this.lineColor = "calculated";
this.border1 = "#81B1DB";
this.border2 = rgba(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("#EAE8D9", 30);
this.altSectionBkgColor = "calculated";
this.sectionBkgColor2 = "#EAE8D9";
this.excludeBkgColor = darken(this.sectionBkgColor, 10);
this.taskBorderColor = rgba(255, 255, 255, 70);
this.taskBkgColor = "calculated";
this.taskTextColor = "calculated";
this.taskTextLightColor = "calculated";
this.taskTextOutsideColor = "calculated";
this.taskTextClickableColor = "#003163";
this.activeTaskBorderColor = rgba(255, 255, 255, 50);
this.activeTaskBkgColor = "#81B1DB";
this.gridColor = "calculated";
this.doneTaskBkgColor = "calculated";
this.doneTaskBorderColor = "grey";
this.critBorderColor = "#E83737";
this.critBkgColor = "#E83737";
this.taskTextDarkColor = "calculated";
this.todayLineColor = "#DB5757";
this.personBorder = this.primaryBorderColor;
this.personBkg = this.mainBkg;
this.labelColor = "calculated";
this.errorBkgColor = "#a44141";
this.errorTextColor = "#ddd";
}
updateColors() {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
this.secondBkg = lighten(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(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(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(this.primaryColor, { h: 64 });
this.fillType3 = adjust(this.secondaryColor, { h: 64 });
this.fillType4 = adjust(this.primaryColor, { h: -64 });
this.fillType5 = adjust(this.secondaryColor, { h: -64 });
this.fillType6 = adjust(this.primaryColor, { h: 128 });
this.fillType7 = adjust(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(this.primaryColor, { h: 30 });
this.cScale4 = this.cScale4 || adjust(this.primaryColor, { h: 60 });
this.cScale5 = this.cScale5 || adjust(this.primaryColor, { h: 90 });
this.cScale6 = this.cScale6 || adjust(this.primaryColor, { h: 120 });
this.cScale7 = this.cScale7 || adjust(this.primaryColor, { h: 150 });
this.cScale8 = this.cScale8 || adjust(this.primaryColor, { h: 210 });
this.cScale9 = this.cScale9 || adjust(this.primaryColor, { h: 270 });
this.cScale10 = this.cScale10 || adjust(this.primaryColor, { h: 300 });
this.cScale11 = this.cScale11 || adjust(this.primaryColor, { h: 330 });
for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
this["cScaleInv" + i] = this["cScaleInv" + i] || invert(this["cScale" + i]);
}
for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
this["cScalePeer" + i] = this["cScalePeer" + i] || lighten(this["cScale" + i], 10);
}
for (let i = 0; i < 5; i++) {
this["surface" + i] = this["surface" + i] || adjust(this.mainBkg, { h: 30, s: -30, l: -(-10 + i * 4) });
this["surfacePeer" + i] = this["surfacePeer" + i] || adjust(this.mainBkg, { h: 30, s: -30, l: -(-7 + i * 4) });
}
this.scaleLabelColor = this.scaleLabelColor || (this.darkMode ? "black" : this.labelTextColor);
for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
this["cScaleLabel" + i] = this["cScaleLabel" + i] || this.scaleLabelColor;
}
for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
this["pie" + i] = this["cScale" + i];
}
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(this.primaryColor, { r: 5, g: 5, b: 5 });
this.quadrant3Fill = this.quadrant3Fill || adjust(this.primaryColor, { r: 10, g: 10, b: 10 });
this.quadrant4Fill = this.quadrant4Fill || adjust(this.primaryColor, { r: 15, g: 15, b: 15 });
this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
this.quadrant2TextFill = this.quadrant2TextFill || adjust(this.primaryTextColor, { r: -5, g: -5, b: -5 });
this.quadrant3TextFill = this.quadrant3TextFill || adjust(this.primaryTextColor, { r: -10, g: -10, b: -10 });
this.quadrant4TextFill = this.quadrant4TextFill || adjust(this.primaryTextColor, { r: -15, g: -15, b: -15 });
this.quadrantPointFill = this.quadrantPointFill || isDark(this.quadrant1Fill) ? lighten(this.quadrant1Fill) : darken(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: ((_a = this.xyChart) == null ? void 0 : _a.backgroundColor) || this.background,
titleColor: ((_b = this.xyChart) == null ? void 0 : _b.titleColor) || this.primaryTextColor,
xAxisTitleColor: ((_c = this.xyChart) == null ? void 0 : _c.xAxisTitleColor) || this.primaryTextColor,
xAxisLabelColor: ((_d = this.xyChart) == null ? void 0 : _d.xAxisLabelColor) || this.primaryTextColor,
xAxisTickColor: ((_e = this.xyChart) == null ? void 0 : _e.xAxisTickColor) || this.primaryTextColor,
xAxisLineColor: ((_f = this.xyChart) == null ? void 0 : _f.xAxisLineColor) || this.primaryTextColor,
yAxisTitleColor: ((_g = this.xyChart) == null ? void 0 : _g.yAxisTitleColor) || this.primaryTextColor,
yAxisLabelColor: ((_h = this.xyChart) == null ? void 0 : _h.yAxisLabelColor) || this.primaryTextColor,
yAxisTickColor: ((_i = this.xyChart) == null ? void 0 : _i.yAxisTickColor) || this.primaryTextColor,
yAxisLineColor: ((_j = this.xyChart) == null ? void 0 : _j.yAxisLineColor) || this.primaryTextColor,
plotColorPalette: ((_k = this.xyChart) == null ? void 0 : _k.plotColorPalette) || "#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"
};
this.classText = this.primaryTextColor;
this.requirementBackground = this.requirementBackground || this.primaryColor;
this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
this.requirementBorderSize = this.requirementBorderSize || "1";
this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
this.relationColor = this.relationColor || this.lineColor;
this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? darken(this.secondaryColor, 30) : this.secondaryColor);
this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
this.git0 = lighten(this.secondaryColor, 20);
this.git1 = lighten(this.pie2 || this.secondaryColor, 20);
this.git2 = lighten(this.pie3 || this.tertiaryColor, 20);
this.git3 = lighten(this.pie4 || adjust(this.primaryColor, { h: -30 }), 20);
this.git4 = lighten(this.pie5 || adjust(this.primaryColor, { h: -60 }), 20);
this.git5 = lighten(this.pie6 || adjust(this.primaryColor, { h: -90 }), 10);
this.git6 = lighten(this.pie7 || adjust(this.primaryColor, { h: 60 }), 10);
this.git7 = lighten(this.pie8 || adjust(this.primaryColor, { h: 120 }), 20);
this.gitInv0 = this.gitInv0 || invert(this.git0);
this.gitInv1 = this.gitInv1 || invert(this.git1);
this.gitInv2 = this.gitInv2 || invert(this.git2);
this.gitInv3 = this.gitInv3 || invert(this.git3);
this.gitInv4 = this.gitInv4 || invert(this.git4);
this.gitInv5 = this.gitInv5 || invert(this.git5);
this.gitInv6 = this.gitInv6 || invert(this.git6);
this.gitInv7 = this.gitInv7 || invert(this.git7);
this.gitBranchLabel0 = this.gitBranchLabel0 || invert(this.labelTextColor);
this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor;
this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor;
this.gitBranchLabel3 = this.gitBranchLabel3 || invert(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(this.background, 12);
this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || lighten(this.background, 2);
}
calculate(overrides) {
if (typeof overrides !== "object") {
this.updateColors();
return;
}
const keys = Object.keys(overrides);
keys.forEach((k) => {
this[k] = overrides[k];
});
this.updateColors();
keys.forEach((k) => {
this[k] = overrides[k];
});
}
};
const getThemeVariables$3 = (userOverrides) => {
const theme2 = new Theme$3();
theme2.calculate(userOverrides);
return theme2;
};
let Theme$2 = class Theme3 {
constructor() {
this.background = "#f4f4f4";
this.primaryColor = "#ECECFF";
this.secondaryColor = adjust(this.primaryColor, { h: 120 });
this.secondaryColor = "#ffffde";
this.tertiaryColor = adjust(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(this.primaryColor);
this.secondaryTextColor = invert(this.secondaryColor);
this.tertiaryTextColor = invert(this.tertiaryColor);
this.lineColor = invert(this.background);
this.textColor = invert(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(102, 102, 255, 0.49);
this.altSectionBkgColor = "white";
this.sectionBkgColor2 = "#fff400";
this.taskBorderColor = "#534fbc";
this.taskBkgColor = "#8a90dd";
this.taskTextLightColor = "white";
this.taskTextColor = "calculated";
this.taskTextDarkColor = "black";
this.taskTextOutsideColor = "calculated";
this.taskTextClickableColor = "#003163";
this.activeTaskBorderColor = "#534fbc";
this.activeTaskBkgColor = "#bfc7ff";
this.gridColor = "lightgrey";
this.doneTaskBkgColor = "lightgrey";
this.doneTaskBorderColor = "grey";
this.critBorderColor = "#ff8888";
this.critBkgColor = "red";
this.todayLineColor = "red";
this.personBorder = this.primaryBorderColor;
this.personBkg = this.mainBkg;
this.labelColor = "black";
this.errorBkgColor = "#552222";
this.errorTextColor = "#552222";
this.updateColors();
}
updateColors() {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
this.cScale0 = this.cScale0 || this.primaryColor;
this.cScale1 = this.cScale1 || this.secondaryColor;
this.cScale2 = this.cScale2 || this.tertiaryColor;
this.cScale3 = this.cScale3 || adjust(this.primaryColor, { h: 30 });
this.cScale4 = this.cScale4 || adjust(this.primaryColor, { h: 60 });
this.cScale5 = this.cScale5 || adjust(this.primaryColor, { h: 90 });
this.cScale6 = this.cScale6 || adjust(this.primaryColor, { h: 120 });
this.cScale7 = this.cScale7 || adjust(this.primaryColor, { h: 150 });
this.cScale8 = this.cScale8 || adjust(this.primaryColor, { h: 210 });
this.cScale9 = this.cScale9 || adjust(this.primaryColor, { h: 270 });
this.cScale10 = this.cScale10 || adjust(this.primaryColor, { h: 300 });
this.cScale11 = this.cScale11 || adjust(this.primaryColor, { h: 330 });
this["cScalePeer1"] = this["cScalePeer1"] || darken(this.secondaryColor, 45);
this["cScalePeer2"] = this["cScalePeer2"] || darken(this.tertiaryColor, 40);
for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
this["cScale" + i] = darken(this["cScale" + i], 10);
this["cScalePeer" + i] = this["cScalePeer" + i] || darken(this["cScale" + i], 25);
}
for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
this["cScaleInv" + i] = this["cScaleInv" + i] || adjust(this["cScale" + i], { h: 180 });
}
for (let i = 0; i < 5; i++) {
this["surface" + i] = this["surface" + i] || adjust(this.mainBkg, { h: 30, l: -(5 + i * 5) });
this["surfacePeer" + i] = this["surfacePeer" + i] || adjust(this.mainBkg, { h: 30, l: -(7 + i * 5) });
}
this.scaleLabelColor = this.scaleLabelColor !== "calculated" && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor;
if (this.labelTextColor !== "calculated") {
this.cScaleLabel0 = this.cScaleLabel0 || invert(this.labelTextColor);
this.cScaleLabel3 = this.cScaleLabel3 || invert(this.labelTextColor);
for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
this["cScaleLabel" + i] = this["cScaleLabel" + i] || 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(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(this.primaryColor, { h: 64 });
this.fillType3 = adjust(this.secondaryColor, { h: 64 });
this.fillType4 = adjust(this.primaryColor, { h: -64 });
this.fillType5 = adjust(this.secondaryColor, { h: -64 });
this.fillType6 = adjust(this.primaryColor, { h: 128 });
this.fillType7 = adjust(this.secondaryColor, { h: 128 });
this.pie1 = this.pie1 || this.primaryColor;
this.pie2 = this.pie2 || thi