var __defProp = Object.defineProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __publicField = (obj, key, value) => { __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; import moment from "moment-mini"; import { sanitizeUrl } from "@braintree/sanitize-url"; import { select, curveBasis, curveBasisClosed, curveBasisOpen, curveLinear, curveLinearClosed, curveMonotoneX, curveMonotoneY, curveNatural, curveStep, curveStepAfter, curveStepBefore, line, selectAll, scaleTime, min, max, scaleLinear, interpolateHcl, axisBottom, timeFormat, axisTop, scaleOrdinal, pie, arc } from "d3"; import DOMPurify from "dompurify"; import { adjust, invert, darken, lighten, rgba } from "khroma"; import { serialize, compile, stringify } from "stylis"; import dagre from "dagre"; import graphlib from "graphlib"; import { v4 } from "uuid"; import dagreD3 from "dagre-d3"; 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 = moment().format("ss.SSS"); return `%c${time} : ${level} : `; }; const getRows = (s) => { if (!s) return [""]; const str = breakToPlaceholder(s).replace(/\\n/g, "#br#"); return str.split("#br#"); }; const removeScript = (txt) => { return DOMPurify.sanitize(txt); }; 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, ">"); text = text.replace(/=/g, "="); text = placeholderToBreak(text); } } return text; }; const sanitizeText$5 = (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)); } return text; }; const sanitizeTextOrArray = (a, config2) => { if (typeof a === "string") return sanitizeText$5(a, config2); return a.flat().map((x) => sanitizeText$5(x, config2)); }; const lineBreakRegex = //gi; const hasBreaks = (text) => { return lineBreakRegex.test(text); }; const splitBreaks = (text) => { return text.split(lineBreakRegex); }; const placeholderToBreak = (s) => { return s.replace(/#br#/g, "
"); }; const breakToPlaceholder = (s) => { return s.replace(lineBreakRegex, "#br#"); }; const getUrl = (useAbsolute) => { let url = ""; if (useAbsolute) { url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; url = url.replaceAll(/\(/g, "\\("); url = url.replaceAll(/\)/g, "\\)"); } return url; }; const evaluate = (val) => val === false || ["false", "null", "0"].includes(String(val).trim().toLowerCase()) ? false : true; const parseGenericTypes = function(text) { let cleanedText = text; if (text.indexOf("~") !== -1) { cleanedText = cleanedText.replace(/~([^~].*)/, "<$1"); cleanedText = cleanedText.replace(/~([^~]*)$/, ">$1"); return parseGenericTypes(cleanedText); } else { return cleanedText; } }; const common = { getRows, sanitizeText: sanitizeText$5, sanitizeTextOrArray, hasBreaks, splitBreaks, lineBreakRegex, removeScript, getUrl, evaluate }; const mkBorder = (col, darkMode) => darkMode ? adjust(col, { s: -40, l: 10 }) : adjust(col, { s: -40, l: -10 }); const oldAttributeBackgroundColorOdd = "#ffffff"; const oldAttributeBackgroundColorEven = "#f2f2f2"; class Theme$4 { constructor() { this.background = "#f4f4f4"; this.darkMode = false; this.primaryColor = "#fff4dd"; this.noteBkgColor = "#fff5ad"; this.noteTextColor = "#333"; this.THEME_COLOR_LIMIT = 12; this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; this.fontSize = "16px"; } updateColors() { this.primaryTextColor = this.primaryTextColor || (this.darkMode ? "#eee" : "#333"); this.secondaryColor = this.secondaryColor || adjust(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.textColor = this.textColor || this.primaryTextColor; 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; } 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.pieOpacity = this.pieOpacity || "0.7"; this.requirementBackground = this.requirementBackground || this.primaryColor; this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; 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; }; class Theme$3 { 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.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 = "calculated"; this.personBkg = "calculated"; this.labelColor = "calculated"; this.errorBkgColor = "#a44141"; this.errorTextColor = "#ddd"; } updateColors() { 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); } 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.pieOpacity = this.pieOpacity || "0.7"; this.classText = this.primaryTextColor; this.requirementBackground = this.requirementBackground || this.primaryColor; this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; 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.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; }; class Theme$2 { 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 = "calculated"; this.personBkg = "calculated"; this.labelColor = "black"; this.errorBkgColor = "#552222"; this.errorTextColor = "#552222"; this.updateColors(); } updateColors() { this.cScale0 = this.cScale0 || this.primaryColor; this.cScale1 = this.cScale1 || this.secondaryColor; this.cScale2 = this.cScale2 || this.tertiaryColor; this.cScale3 = this.cScale3 || adjust(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["cScalePeer" + 1] = this["cScalePeer" + 1] || darken(this.secondaryColor, 45); this["cScalePeer" + 2] = this["cScalePeer" + 2] || 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 }); } 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 || this.secondaryColor; this.pie3 = this.pie3 || adjust(this.tertiaryColor, { l: -40 }); this.pie4 = this.pie4 || adjust(this.primaryColor, { l: -10 }); this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -30 }); this.pie6 = this.pie6 || adjust(this.tertiaryColor, { l: -20 }); this.pie7 = this.pie7 || adjust(this.primaryColor, { h: 60, l: -20 }); this.pie8 = this.pie8 || adjust(this.primaryColor, { h: -60, l: -40 }); this.pie9 = this.pie9 || adjust(this.primaryColor, { h: 120, l: -40 }); this.pie10 = this.pie10 || adjust(this.primaryColor, { h: 60, l: -40 }); this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -90, l: -40 }); this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -30 }); this.pieTitleTextSize = this.pieTitleTextSize || "25px"; this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; this.pieSectionTextSize = this.pieSectionTextSize || "17px"; this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; this.pieLegendTextSize = this.pieLegendTextSize || "17px"; this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; this.pieStrokeColor = this.pieStrokeColor || "black"; this.pieStrokeWidth = this.pieStrokeWidth || "2px"; this.pieOpacity = this.pieOpacity || "0.7"; this.requirementBackground = this.requirementBackground || this.primaryColor; this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; this.relationColor = this.relationColor || this.lineColor; this.relationLabelBackground = this.relationLabelBackground || this.labelBackground; this.relationLabelColor = this.relationLabelColor || this.actorTextColor; this.git0 = this.git0 || this.primaryColor; this.git1 = this.git1 || this.secondaryColor; this.git2 = this.git2 || this.tertiaryColor; this.git3 = this.git3 || adjust(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 || darken(invert(this.git0), 25); 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 || 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$2 = (userOverrides) => { const theme2 = new Theme$2(); theme2.calculate(userOverrides); return theme2; }; class Theme$1 { constructor() { this.background = "#f4f4f4"; this.primaryColor = "#cde498"; this.secondaryColor = "#cdffb2"; this.background = "white"; this.mainBkg = "#cde498"; this.secondBkg = "#cdffb2"; this.lineColor = "green"; this.border1 = "#13540c"; this.border2 = "#6eaa49"; this.arrowheadColor = "green"; this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; this.fontSize = "16px"; this.tertiaryColor = lighten("#cde498", 10); this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode); this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode); this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode); this.primaryTextColor = invert(this.primaryColor); this.secondaryTextColor = invert(this.secondaryColor); this.tertiaryTextColor = invert(this.primaryColor); this.lineColor = invert(this.background); this.textColor = invert(this.background); this.THEME_COLOR_LIMIT = 12; this.nodeBkg = "calculated"; this.nodeBorder = "calculated"; this.clusterBkg = "calculated"; this.clusterBorder = "calculated"; this.defaultLinkColor = "calculated"; this.titleColor = "#333"; this.edgeLabelBackground = "#e8e8e8"; this.actorBorder = "calculated"; this.actorBkg = "calculated"; this.actorTextColor = "black"; this.actorLineColor = "grey"; this.signalColor = "#333"; this.signalTextColor = "#333"; this.labelBoxBkgColor = "calculated"; this.labelBoxBorderColor = "#326932"; this.labelTextColor = "calculated"; this.loopTextColor = "calculated"; this.noteBorderColor = "calculated"; this.noteBkgColor = "#fff5ad"; this.noteTextColor = "calculated"; this.activationBorderColor = "#666"; this.activationBkgColor = "#f4f4f4"; this.sequenceNumberColor = "white"; this.sectionBkgColor = "#6eaa49"; this.altSectionBkgColor = "white"; this.sectionBkgColor2 = "#6eaa49"; this.excludeBkgColor = "#eeeeee"; this.taskBorderColor = "calculated"; this.taskBkgColor = "#487e3a"; this.taskTextLightColor = "white"; this.taskTextColor = "calculated"; this.taskTextDarkColor = "black"; this.taskTextOutsideColor = "calculated"; this.taskTextClickableColor = "#003163"; this.activeTaskBorderColor = "calculated"; this.activeTaskBkgColor = "calculated"; this.gridColor = "lightgrey"; this.doneTaskBkgColor = "lightgrey"; this.doneTaskBorderColor = "grey"; this.critBorderColor = "#ff8888"; this.critBkgColor = "red"; this.todayLineColor = "red"; this.personBorder = "calculated"; this.personBkg = "calculated"; this.labelColor = "black"; this.errorBkgColor = "#552222"; this.errorTextColor = "#552222"; } updateColors() { 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["cScalePeer" + 1] = this["cScalePeer" + 1] || darken(this.secondaryColor, 45); this["cScalePeer" + 2] = this["cScalePeer" + 2] || 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 }); } this.scaleLabelColor = this.scaleLabelColor !== "calculated" && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor; for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) { this["cScaleLabel" + i] = this["cScaleLabel" + i] || this.scaleLabelColor; } this.nodeBkg = this.mainBkg; this.nodeBorder = this.border1; this.clusterBkg = this.secondBkg; this.clusterBorder = this.border2; this.defaultLinkColor = this.lineColor; this.actorBorder = darken(this.mainBkg, 20); this.actorBkg = this.mainBkg; this.labelBoxBkgColor = this.actorBkg; this.labelTextColor = this.actorTextColor; this.loopTextColor = this.actorTextColor; this.noteBorderColor = this.border2; this.noteTextColor = this.actorTextColor; this.taskBorderColor = this.border1; this.taskTextColor = this.taskTextLightColor; this.taskTextOutsideColor = this.taskTextDarkColor; this.activeTaskBorderColor = this.taskBorderColor; this.activeTaskBkgColor = this.mainBkg; this.transitionColor = this.transitionColor || this.lineColor; this.transitionLabelColor = this.transitionLabelColor || this.textColor; this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; this.stateBkg = this.stateBkg || this.mainBkg; this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; this.altBackground = this.altBackground || "#f0f0f0"; this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; this.compositeBorder = this.compositeBorder || this.nodeBorder; this.innerEndBackground = this.primaryBorderColor; this.specialStateColor = this.lineColor; this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; this.transitionColor = this.transitionColor || this.lineColor; this.classText = this.primaryTextColor; this.fillType0 = this.primaryColor; this.fillType1 = this.secondaryColor; this.fillType2 = adjust(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 || this.secondaryColor; this.pie3 = this.pie3 || this.tertiaryColor; this.pie4 = this.pie4 || adjust(this.primaryColor, { l: -30 }); this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -30 }); this.pie6 = this.pie6 || adjust(this.tertiaryColor, { h: 40, l: -40 }); 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: -50 }); this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -60, l: -50 }); this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -50 }); this.pieTitleTextSize = this.pieTitleTextSize || "25px"; this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; this.pieSectionTextSize = this.pieSectionTextSize || "17px"; this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; this.pieLegendTextSize = this.pieLegendTextSize || "17px"; this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; this.pieStrokeColor = this.pieStrokeColor || "black"; this.pieStrokeWidth = this.pieStrokeWidth || "2px"; this.pieOpacity = this.pieOpacity || "0.7"; this.requirementBackground = this.requirementBackground || this.primaryColor; this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; this.relationColor = this.relationColor || this.lineColor; this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground; this.relationLabelColor = this.relationLabelColor || this.actorTextColor; this.git0 = this.git0 || this.primaryColor; this.git1 = this.git1 || this.secondaryColor; this.git2 = this.git2 || this.tertiaryColor; this.git3 = this.git3 || adjust(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.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$1 = (userOverrides) => { const theme2 = new Theme$1(); theme2.calculate(userOverrides); return theme2; }; class Theme { constructor() { this.primaryColor = "#eee"; this.contrast = "#707070"; this.secondaryColor = lighten(this.contrast, 55); this.background = "#ffffff"; 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.mainBkg = "#eee"; this.secondBkg = "calculated"; this.lineColor = "#666"; this.border1 = "#999"; this.border2 = "calculated"; this.note = "#ffa"; this.text = "#333"; this.critical = "#d42"; this.done = "#bbb"; this.arrowheadColor = "#333333"; this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; this.fontSize = "16px"; this.THEME_COLOR_LIMIT = 12; this.nodeBkg = "calculated"; this.nodeBorder = "calculated"; this.clusterBkg = "calculated"; this.clusterBorder = "calculated"; this.defaultLinkColor = "calculated"; this.titleColor = "calculated"; this.edgeLabelBackground = "white"; this.actorBorder = "calculated"; this.actorBkg = "calculated"; this.actorTextColor = "calculated"; this.actorLineColor = "calculated"; this.signalColor = "calculated"; this.signalTextColor = "calculated"; this.labelBoxBkgColor = "calculated"; this.labelBoxBorderColor = "calculated"; this.labelTextColor = "calculated"; this.loopTextColor = "calculated"; this.noteBorderColor = "calculated"; this.noteBkgColor = "calculated"; this.noteTextColor = "calculated"; this.activationBorderColor = "#666"; this.activationBkgColor = "#f4f4f4"; this.sequenceNumberColor = "white"; this.sectionBkgColor = "calculated"; this.altSectionBkgColor = "white"; this.sectionBkgColor2 = "calculated"; this.excludeBkgColor = "#eeeeee"; this.taskBorderColor = "calculated"; this.taskBkgColor = "calculated"; this.taskTextLightColor = "white"; this.taskTextColor = "calculated"; this.taskTextDarkColor = "calculated"; this.taskTextOutsideColor = "calculated"; this.taskTextClickableColor = "#003163"; this.activeTaskBorderColor = "calculated"; this.activeTaskBkgColor = "calculated"; this.gridColor = "calculated"; this.doneTaskBkgColor = "calculated"; this.doneTaskBorderColor = "calculated"; this.critBkgColor = "calculated"; this.critBorderColor = "calculated"; this.todayLineColor = "calculated"; this.personBorder = "calculated"; this.personBkg = "calculated"; this.labelColor = "black"; this.errorBkgColor = "#552222"; this.errorTextColor = "#552222"; } updateColors() { this.secondBkg = lighten(this.contrast, 55); this.border2 = this.contrast; this.cScale0 = this.cScale0 || "#555"; this.cScale1 = this.cScale1 || "#F4F4F4"; this.cScale2 = this.cScale2 || "#555"; this.cScale3 = this.cScale3 || "#BBB"; this.cScale4 = this.cScale4 || "#777"; this.cScale5 = this.cScale5 || "#999"; this.cScale6 = this.cScale6 || "#DDD"; this.cScale7 = this.cScale7 || "#FFF"; this.cScale8 = this.cScale8 || "#DDD"; this.cScale9 = this.cScale9 || "#BBB"; this.cScale10 = this.cScale10 || "#999"; this.cScale11 = this.cScale11 || "#777"; for (let 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.darkMode ? "black" : this.labelTextColor); this["cScaleLabel0"] = this["cScaleLabel0"] || this.cScale1; this["cScaleLabel2"] = this["cScaleLabel2"] || this.cScale1; for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) { this["cScaleLabel" + i] = this["cScaleLabel" + i] || this.scaleLabelColor; } this.nodeBkg = this.mainBkg; this.nodeBorder = this.border1; this.clusterBkg = this.secondBkg; this.clusterBorder = this.border2; this.defaultLinkColor = this.lineColor; this.titleColor = this.text; this.actorBorder = lighten(this.border1, 23); this.actorBkg = this.mainBkg; this.actorTextColor = this.text; this.actorLineColor = this.lineColor; this.signalColor = this.text; this.signalTextColor = this.text; this.labelBoxBkgColor = this.actorBkg; this.labelBoxBorderColor = this.actorBorder; this.labelTextColor = this.text; this.loopTextColor = this.text; this.noteBorderColor = "#999"; this.noteBkgColor = "#666"; this.noteTextColor = "#fff"; this.sectionBkgColor = lighten(this.contrast, 30); this.sectionBkgColor2 = lighten(this.contrast, 30); this.taskBorderColor = darken(this.contrast, 10); this.taskBkgColor = this.contrast; this.taskTextColor = this.taskTextLightColor; this.taskTextDarkColor = this.text; this.taskTextOutsideColor = this.taskTextDarkColor; this.activeTaskBorderColor = this.taskBorderColor; this.activeTaskBkgColor = this.mainBkg; this.gridColor = lighten(this.border1, 30); this.doneTaskBkgColor = this.done; this.doneTaskBorderColor = this.lineColor; this.critBkgColor = this.critical; this.critBorderColor = darken(this.critBkgColor, 10); this.todayLineColor = this.critBkgColor; this.transitionColor = this.transitionColor || "#000"; this.transitionLabelColor = this.transitionLabelColor || this.textColor; this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; this.stateBkg = this.stateBkg || this.mainBkg; this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; this.altBackground = this.altBackground || "#f4f4f4"; this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; this.stateBorder = this.stateBorder || "#000"; this.innerEndBackground = this.primaryBorderColor; this.specialStateColor = "#222"; this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; this.classText = this.primaryTextColor; this.fillType0 = this.primaryColor; this.fillType1 = this.secondaryColor; this.fillType2 = adjust(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 }); for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) { this["pie" + i] = this["cScale" + i]; } this.pie12 = this.pie0; this.pieTitleTextSize = this.pieTitleTextSize || "25px"; this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; this.pieSectionTextSize = this.pieSectionTextSize || "17px"; this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; this.pieLegendTextSize = this.pieLegendTextSize || "17px"; this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; this.pieStrokeColor = this.pieStrokeColor || "black"; this.pieStrokeWidth = this.pieStrokeWidth || "2px"; this.pieOpacity = this.pieOpacity || "0.7"; this.requirementBackground = this.requirementBackground || this.primaryColor; this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; this.relationColor = this.relationColor || this.lineColor; this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground; this.relationLabelColor = this.relationLabelColor || this.actorTextColor; this.git0 = darken(this.pie1, 25) || this.primaryColor; this.git1 = this.pie2 || this.secondaryColor; this.git2 = this.pie3 || this.tertiaryColor; this.git3 = this.pie4 || adjust(this.primaryColor, { h: -30 }); this.git4 = this.pie5 || adjust(this.primaryColor, { h: -60 }); this.git5 = this.pie6 || adjust(this.primaryColor, { h: -90 }); this.git6 = this.pie7 || adjust(this.primaryColor, { h: 60 }); this.git7 = this.pie8 || adjust(this.primaryColor, { h: 120 }); 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.labelTextColor; this.gitBranchLabel0 = this.branchLabelColor; this.gitBranchLabel1 = "white"; this.gitBranchLabel2 = this.branchLabelColor; this.gitBranchLabel3 = "white"; this.gitBranchLabel4 = this.branchLabelColor; this.gitBranchLabel5 = this.branchLabelColor; this.gitBranchLabel6 = this.branchLabelColor; this.gitBranchLabel7 = this.branchLabelColor; this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; this.tagLabelFontSize = this.tagLabelFontSize || "10px"; this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; this.commitLabelFontSize = this.commitLabelFontSize || "10px"; this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd; this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven; } calculate(overrides) { if (typeof overrides !== "object") { this.updateColors(); return; } const keys = Object.keys(overrides); keys.forEach((k) => { this[k] = overrides[k]; }); this.updateColors(); keys.forEach((k) => { this[k] = overrides[k]; }); } } const getThemeVariables = (userOverrides) => { const theme2 = new Theme(); theme2.calculate(userOverrides); return theme2; }; const theme = { base: { getThemeVariables: getThemeVariables$4 }, dark: { getThemeVariables: getThemeVariables$3 }, default: { getThemeVariables: getThemeVariables$2 }, forest: { getThemeVariables: getThemeVariables$1 }, neutral: { getThemeVariables } }; const config$1 = { theme: "default", themeVariables: theme["default"].getThemeVariables(), themeCSS: void 0, maxTextSize: 5e4, darkMode: false, fontFamily: '"trebuchet ms", verdana, arial, sans-serif;', logLevel: 5, securityLevel: "strict", startOnLoad: true, arrowMarkerAbsolute: false, secure: ["secure", "securityLevel", "startOnLoad", "maxTextSize"], lazyLoadedDiagrams: [], deterministicIds: false, deterministicIDSeed: void 0, flowchart: { diagramPadding: 8, htmlLabels: true, nodeSpacing: 50, rankSpacing: 50, curve: "basis", padding: 15, useMaxWidth: true, defaultRenderer: "dagre-wrapper" }, sequence: { hideUnusedParticipants: false, activationWidth: 10, diagramMarginX: 50, diagramMarginY: 10, actorMargin: 50, width: 150, height: 65, boxMargin: 10, boxTextMargin: 5, noteMargin: 10, messageMargin: 35, messageAlign: "center", mirrorActors: true, forceMenus: false, bottomMarginAdj: 1, useMaxWidth: true, rightAngles: false, showSequenceNumbers: false, actorFontSize: 14, actorFontFamily: '"Open Sans", sans-serif', actorFontWeight: 400, noteFontSize: 14, noteFontFamily: '"trebuchet ms", verdana, arial, sans-serif', noteFontWeight: 400, noteAlign: "center", messageFontSize: 16, messageFontFamily: '"trebuchet ms", verdana, arial, sans-serif', messageFontWeight: 400, wrap: false, wrapPadding: 10, labelBoxWidth: 50, labelBoxHeight: 20, messageFont: function() { return { fontFamily: this.messageFontFamily, fontSize: this.messageFontSize, fontWeight: this.messageFontWeight }; }, noteFont: function() { return { fontFamily: this.noteFontFamily, fontSize: this.noteFontSize, fontWeight: this.noteFontWeight }; }, actorFont: function() { return { fontFamily: this.actorFontFamily, fontSize: this.actorFontSize, fontWeight: this.actorFontWeight }; } }, gantt: { titleTopMargin: 25, barHeight: 20, barGap: 4, topPadding: 50, rightPadding: 75, leftPadding: 75, gridLineStartPadding: 35, fontSize: 11, sectionFontSize: 11, numberSectionStyles: 4, axisFormat: "%Y-%m-%d", useMaxWidth: true, topAxis: false, useWidth: void 0 }, journey: { diagramMarginX: 50, diagramMarginY: 10, leftMargin: 150, width: 150, height: 50, boxMargin: 10, boxTextMargin: 5, noteMargin: 10, messageMargin: 35, messageAlign: "center", bottomMarginAdj: 1, useMaxWidth: true, rightAngles: false, taskFontSize: 14, taskFontFamily: '"Open Sans", sans-serif', taskMargin: 50, activationWidth: 10, textPlacement: "fo", actorColours: ["#8FBC8F", "#7CFC00", "#00FFFF", "#20B2AA", "#B0E0E6", "#FFFFE0"], sectionFills: ["#191970", "#8B008B", "#4B0082", "#2F4F4F", "#800000", "#8B4513", "#00008B"], sectionColours: ["#fff"] }, class: { arrowMarkerAbsolute: false, dividerMargin: 10, padding: 5, textHeight: 10, useMaxWidth: true, defaultRenderer: "dagre-wrapper" }, state: { dividerMargin: 10, sizeUnit: 5, padding: 8, textHeight: 10, titleShift: -15, noteMargin: 10, forkWidth: 70, forkHeight: 7, miniPadding: 2, fontSizeFactor: 5.02, fontSize: 24, labelHeight: 16, edgeLengthFactor: "20", compositTitleSize: 35, radius: 5, useMaxWidth: true, defaultRenderer: "dagre-wrapper" }, er: { diagramPadding: 20, layoutDirection: "TB", minEntityWidth: 100, minEntityHeight: 75, entityPadding: 15, stroke: "gray", fill: "honeydew", fontSize: 12, useMaxWidth: true }, pie: { useWidth: void 0, useMaxWidth: true }, requirement: { useWidth: void 0, useMaxWidth: true, rect_fill: "#f9f9f9", text_color: "#333", rect_border_size: "0.5px", rect_border_color: "#bbb", rect_min_width: 200, rect_min_height: 200, fontSize: 14, rect_padding: 10, line_height: 20 }, gitGraph: { diagramPadding: 8, nodeLabel: { width: 75, height: 100, x: -25, y: 0 }, mainBranchName: "main", mainBranchOrder: 0, showCommitLabel: true, showBranches: true, rotateCommitLabel: true }, c4: { useWidth: void 0, diagramMarginX: 50, diagramMarginY: 10, c4ShapeMargin: 50, c4ShapePadding: 20, width: 216, height: 60, boxMargin: 10, useMaxWidth: true, c4ShapeInRow: 4, nextLinePaddingX: 0, c4BoundaryInRow: 2, personFontSize: 14, personFontFamily: '"Open Sans", sans-serif', personFontWeight: "normal", external_personFontSize: 14, external_personFontFamily: '"Open Sans", sans-serif', external_personFontWeight: "normal", systemFontSize: 14, systemFontFamily: '"Open Sans", sans-serif', systemFontWeight: "normal", external_systemFontSize: 14, external_systemFontFamily: '"Open Sans", sans-serif', external_systemFontWeight: "normal", system_dbFontSize: 14, system_dbFontFamily: '"Open Sans", sans-serif', system_dbFontWeight: "normal", external_system_dbFontSize: 14, external_system_dbFontFamily: '"Open Sans", sans-serif', external_system_dbFontWeight: "normal", system_queueFontSize: 14, system_queueFontFamily: '"Open Sans", sans-serif', system_queueFontWeight: "normal", external_system_queueFontSize: 14, external_system_queueFontFamily: '"Open Sans", sans-serif', external_system_queueFontWeight: "normal", boundaryFontSize: 14, boundaryFontFamily: '"Open Sans", sans-serif', boundaryFontWeight: "normal", messageFontSize: 12, messageFontFamily: '"Open Sans", sans-serif', messageFontWeight: "normal", containerFontSize: 14, containerFontFamily: '"Open Sans", sans-serif', containerFontWeight: "normal", external_containerFontSize: 14, external_containerFontFamily: '"Open Sans", sans-serif', external_containerFontWeight: "normal", container_dbFontSize: 14, container_dbFontFamily: '"Open Sans", sans-serif', container_dbFontWeight: "normal", external_container_dbFontSize: 14, external_container_dbFontFamily: '"Open Sans", sans-serif', external_container_dbFontWeight: "normal", container_queueFontSize: 14, container_queueFontFamily: '"Open Sans", sans-serif', container_queueFontWeight: "normal", external_container_queueFontSize: 14, external_container_queueFontFamily: '"Open Sans", sans-serif', external_container_queueFontWeight: "normal", componentFontSize: 14, componentFontFamily: '"Open Sans", sans-serif', componentFontWeight: "normal", external_componentFontSize: 14, external_componentFontFamily: '"Open Sans", sans-serif', external_componentFontWeight: "normal", component_dbFontSize: 14, component_dbFontFamily: '"Open Sans", sans-serif', component_dbFontWeight: "normal", external_component_dbFontSize: 14, external_component_dbFontFamily: '"Open Sans", sans-serif', external_component_dbFontWeight: "normal", component_queueFontSize: 14, component_queueFontFamily: '"Open Sans", sans-serif', component_queueFontWeight: "normal", external_component_queueFontSize: 14, external_component_queueFontFamily: '"Open Sans", sans-serif', external_component_queueFontWeight: "normal", wrap: true, wrapPadding: 10, personFont: function() { return { fontFamily: this.personFontFamily, fontSize: this.personFontSize, fontWeight: this.personFontWeight }; }, external_personFont: function() { return { fontFamily: this.external_personFontFamily, fontSize: this.external_personFontSize, fontWeight: this.external_personFontWeight }; }, systemFont: function() { return { fontFamily: this.systemFontFamily, fontSize: this.systemFontSize, fontWeight: this.systemFontWeight }; }, external_systemFont: function() { return { fontFamily: this.external_systemFontFamily, fontSize: this.external_systemFontSize, fontWeight: this.external_systemFontWeight }; }, system_dbFont: function() { return { fontFamily: this.system_dbFontFamily, fontSize: this.system_dbFontSize, fontWeight: this.system_dbFontWeight }; }, external_system_dbFont: function() { return { fontFamily: this.external_system_dbFontFamily, fontSize: this.external_system_dbFontSize, fontWeight: this.external_system_dbFontWeight }; }, system_queueFont: function() { return { fontFamily: this.system_queueFontFamily, fontSize: this.system_queueFontSize, fontWeight: this.system_queueFontWeight }; }, external_system_queueFont: function() { return { fontFamily: this.external_system_queueFontFamily, fontSize: this.external_system_queueFontSize, fontWeight: this.external_system_queueFontWeight }; }, containerFont: function() { return { fontFamily: this.containerFontFamily, fontSize: this.containerFontSize, fontWeight: this.containerFontWeight }; }, external_containerFont: function() { return { fontFamily: this.external_containerFontFamily, fontSize: this.external_containerFontSize, fontWeight: this.external_containerFontWeight }; }, container_dbFont: function() { return { fontFamily: this.container_dbFontFamily, fontSize: this.container_dbFontSize, fontWeight: this.container_dbFontWeight }; }, external_container_dbFont: function() { return { fontFamily: this.external_container_dbFontFamily, fontSize: this.external_container_dbFontSize, fontWeight: this.external_container_dbFontWeight }; }, container_queueFont: function() { return { fontFamily: this.container_queueFontFamily, fontSize: this.container_queueFontSize, fontWeight: this.container_queueFontWeight }; }, external_container_queueFont: function() { return { fontFamily: this.external_container_queueFontFamily, fontSize: this.external_container_queueFontSize, fontWeight: this.external_container_queueFontWeight }; }, componentFont: function() { return { fontFamily: this.componentFontFamily, fontSize: this.componentFontSize, fontWeight: this.componentFontWeight }; }, external_componentFont: function() { return { fontFamily: this.external_componentFontFamily, fontSize: this.external_componentFontSize, fontWeight: this.external_componentFontWeight }; }, component_dbFont: function() { return { fontFamily: this.component_dbFontFamily, fontSize: this.component_dbFontSize, fontWeight: this.component_dbFontWeight }; }, external_component_dbFont: function() { return { fontFamily: this.external_component_dbFontFamily, fontSize: this.external_component_dbFontSize, fontWeight: this.external_component_dbFontWeight }; }, component_queueFont: function() { return { fontFamily: this.component_queueFontFamily, fontSize: this.component_queueFontSize, fontWeight: this.component_queueFontWeight }; }, external_component_queueFont: function() { return { fontFamily: this.external_component_queueFontFamily, fontSize: this.external_component_queueFontSize, fontWeight: this.external_component_queueFontWeight }; }, boundaryFont: function() { return { fontFamily: this.boundaryFontFamily, fontSize: this.boundaryFontSize, fontWeight: this.boundaryFontWeight }; }, messageFont: function() { return { fontFamily: this.messageFontFamily, fontSize: this.messageFontSize, fontWeight: this.messageFontWeight }; }, person_bg_color: "#08427B", person_border_color: "#073B6F", external_person_bg_color: "#686868", external_person_border_color: "#8A8A8A", system_bg_color: "#1168BD", system_border_color: "#3C7FC0", system_db_bg_color: "#1168BD", system_db_border_color: "#3C7FC0", system_queue_bg_color: "#1168BD", system_queue_border_color: "#3C7FC0", external_system_bg_color: "#999999", external_system_border_color: "#8A8A8A", external_system_db_bg_color: "#999999", external_system_db_border_color: "#8A8A8A", external_system_queue_bg_color: "#999999", external_system_queue_border_color: "#8A8A8A", container_bg_color: "#438DD5", container_border_color: "#3C7FC0", container_db_bg_color: "#438DD5", container_db_border_color: "#3C7FC0", container_queue_bg_color: "#438DD5", container_queue_border_color: "#3C7FC0", external_container_bg_color: "#B3B3B3", external_container_border_color: "#A6A6A6", external_container_db_bg_color: "#B3B3B3", external_container_db_border_color: "#A6A6A6", external_container_queue_bg_color: "#B3B3B3", external_container_queue_border_color: "#A6A6A6", component_bg_color: "#85BBF0", component_border_color: "#78A8D8", component_db_bg_color: "#85BBF0", component_db_border_color: "#78A8D8", component_queue_bg_color: "#85BBF0", component_queue_border_color: "#78A8D8", external_component_bg_color: "#CCCCCC", external_component_border_color: "#BFBFBF", external_component_db_bg_color: "#CCCCCC", external_component_db_border_color: "#BFBFBF", external_component_queue_bg_color: "#CCCCCC", external_component_queue_border_color: "#BFBFBF" }, mindmap: { useMaxWidth: true, padding: 10, maxNodeWidth: 200 }, fontSize: 16 }; if (config$1.class) config$1.class.arrowMarkerAbsolute = config$1.arrowMarkerAbsolute; if (config$1.gitGraph) config$1.gitGraph.arrowMarkerAbsolute = config$1.arrowMarkerAbsolute; const keyify = (obj, prefix = "") => Object.keys(obj).reduce((res, el) => { if (Array.isArray(obj[el])) { return res; } else if (typeof obj[el] === "object" && obj[el] !== null) { return [...res, prefix + el, ...keyify(obj[el], "")]; } return [...res, prefix + el]; }, []); const configKeys = keyify(config$1, ""); const directive$1 = /[%]{2}[{]\s*(?:(?:(\w+)\s*:|(\w+))\s*(?:(?:(\w+))|((?:(?![}][%]{2}).|\r?\n)*))?\s*)(?:[}][%]{2})?/gi; const anyComment = /\s*%%.*\n/gm; const detectors = {}; const detectType = function(text, config2) { text = text.replace(directive$1, "").replace(anyComment, "\n"); for (const [key, { detector }] of Object.entries(detectors)) { const diagram = detector(text, config2); if (diagram) { return key; } } throw new Error(`No diagram type detected for text: ${text}`); }; const addDetector = (key, detector, loader) => { if (detectors[key]) { throw new Error(`Detector with key ${key} already exists`); } detectors[key] = { detector, loader }; log$1.debug(`Detector with key ${key} added${loader ? " with loader" : ""}`); }; const getDiagramLoader = (key) => detectors[key].loader; const assignWithDepth = function(dst, src, config2) { const { depth, clobber } = Object.assign({ depth: 2, clobber: false }, config2); if (Array.isArray(src) && !Array.isArray(dst)) { src.forEach((s) => assignWithDepth(dst, s, config2)); return dst; } else if (Array.isArray(src) && Array.isArray(dst)) { src.forEach((s) => { if (dst.indexOf(s) === -1) { dst.push(s); } }); return dst; } if (typeof dst === "undefined" || depth <= 0) { if (dst !== void 0 && dst !== null && typeof dst === "object" && typeof src === "object") { return Object.assign(dst, src); } else { return src; } } if (typeof src !== "undefined" && typeof dst === "object" && typeof src === "object") { Object.keys(src).forEach((key) => { if (typeof src[key] === "object" && (dst[key] === void 0 || typeof dst[key] === "object")) { if (dst[key] === void 0) { dst[key] = Array.isArray(src[key]) ? [] : {}; } dst[key] = assignWithDepth(dst[key], src[key], { depth: depth - 1, clobber }); } else if (clobber || typeof dst[key] !== "object" && typeof src[key] !== "object") { dst[key] = src[key]; } }); } return dst; }; var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; var freeGlobal$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; var _freeGlobal = freeGlobal$1; var freeGlobal = _freeGlobal; var freeSelf = typeof self == "object" && self && self.Object === Object && self; var root$3 = freeGlobal || freeSelf || Function("return this")(); var _root = root$3; var root$2 = _root; var Symbol$3 = root$2.Symbol; var _Symbol = Symbol$3; var Symbol$2 = _Symbol; var objectProto$4 = Object.prototype; var hasOwnProperty$3 = objectProto$4.hasOwnProperty; var nativeObjectToString$1 = objectProto$4.toString; var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0; function getRawTag$1(value) { var isOwn = hasOwnProperty$3.call(value, symToStringTag$1), tag = value[symToStringTag$1]; try { value[symToStringTag$1] = void 0; var unmasked = true; } catch (e) { } var result = nativeObjectToString$1.call(value); if (unmasked) { if (isOwn) { value[symToStringTag$1] = tag; } else { delete value[symToStringTag$1]; } } return result; } var _getRawTag = getRawTag$1; var objectProto$3 = Object.prototype; var nativeObjectToString = objectProto$3.toString; function objectToString$1(value) { return nativeObjectToString.call(value); } var _objectToString = objectToString$1; var Symbol$1 = _Symbol, getRawTag = _getRawTag, objectToString = _objectToString; var nullTag = "[object Null]", undefinedTag = "[object Undefined]"; var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0; function baseGetTag$1(value) { if (value == null) { return value === void 0 ? undefinedTag : nullTag; } return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); } var _baseGetTag = baseGetTag$1; function isObject$2(value) { var type2 = typeof value; return value != null && (type2 == "object" || type2 == "function"); } var isObject_1 = isObject$2; var baseGetTag = _baseGetTag, isObject$1 = isObject_1; var asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]"; function isFunction$1(value) { if (!isObject$1(value)) { return false; } var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } var isFunction_1 = isFunction$1; var root$1 = _root; var coreJsData$1 = root$1["__core-js_shared__"]; var _coreJsData = coreJsData$1; var coreJsData = _coreJsData; var maskSrcKey = function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); return uid ? "Symbol(src)_1." + uid : ""; }(); function isMasked$1(func) { return !!maskSrcKey && maskSrcKey in func; } var _isMasked = isMasked$1; var funcProto$1 = Function.prototype; var funcToString$1 = funcProto$1.toString; function toSource$1(func) { if (func != null) { try { return funcToString$1.call(func); } catch (e) { } try { return func + ""; } catch (e) { } } return ""; } var _toSource = toSource$1; var isFunction = isFunction_1, isMasked = _isMasked, isObject = isObject_1, toSource = _toSource; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reIsHostCtor = /^\[object .+?Constructor\]$/; var funcProto = Function.prototype, objectProto$2 = Object.prototype; var funcToString = funcProto.toString; var hasOwnProperty$2 = objectProto$2.hasOwnProperty; var reIsNative = RegExp( "^" + funcToString.call(hasOwnProperty$2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function baseIsNative$1(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } var _baseIsNative = baseIsNative$1; function getValue$1(object, key) { return object == null ? void 0 : object[key]; } var _getValue = getValue$1; var baseIsNative = _baseIsNative, getValue = _getValue; function getNative$2(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : void 0; } var _getNative = getNative$2; var getNative$1 = _getNative; var nativeCreate$4 = getNative$1(Object, "create"); var _nativeCreate = nativeCreate$4; var nativeCreate$3 = _nativeCreate; function hashClear$1() { this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {}; this.size = 0; } var _hashClear = hashClear$1; function hashDelete$1(key) { var result = this.has(key) && delete this.__data__[key]; this.size -= result ? 1 : 0; return result; } var _hashDelete = hashDelete$1; var nativeCreate$2 = _nativeCreate; var HASH_UNDEFINED$1 = "__lodash_hash_undefined__"; var objectProto$1 = Object.prototype; var hasOwnProperty$1 = objectProto$1.hasOwnProperty; function hashGet$1(key) { var data = this.__data__; if (nativeCreate$2) { var result = data[key]; return result === HASH_UNDEFINED$1 ? void 0 : result; } return hasOwnProperty$1.call(data, key) ? data[key] : void 0; } var _hashGet = hashGet$1; var nativeCreate$1 = _nativeCreate; var objectProto = Object.prototype; var hasOwnProperty = objectProto.hasOwnProperty; function hashHas$1(key) { var data = this.__data__; return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty.call(data, key); } var _hashHas = hashHas$1; var nativeCreate = _nativeCreate; var HASH_UNDEFINED = "__lodash_hash_undefined__"; function hashSet$1(key, value) { var data = this.__data__; this.size += this.has(key) ? 0 : 1; data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value; return this; } var _hashSet = hashSet$1; var hashClear = _hashClear, hashDelete = _hashDelete, hashGet = _hashGet, hashHas = _hashHas, hashSet = _hashSet; function Hash$1(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } Hash$1.prototype.clear = hashClear; Hash$1.prototype["delete"] = hashDelete; Hash$1.prototype.get = hashGet; Hash$1.prototype.has = hashHas; Hash$1.prototype.set = hashSet; var _Hash = Hash$1; function listCacheClear$1() { this.__data__ = []; this.size = 0; } var _listCacheClear = listCacheClear$1; function eq$1(value, other) { return value === other || value !== value && other !== other; } var eq_1 = eq$1; var eq = eq_1; function assocIndexOf$4(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } var _assocIndexOf = assocIndexOf$4; var assocIndexOf$3 = _assocIndexOf; var arrayProto = Array.prototype; var splice = arrayProto.splice; function listCacheDelete$1(key) { var data = this.__data__, index = assocIndexOf$3(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } --this.size; return true; } var _listCacheDelete = listCacheDelete$1; var assocIndexOf$2 = _assocIndexOf; function listCacheGet$1(key) { var data = this.__data__, index = assocIndexOf$2(data, key); return index < 0 ? void 0 : data[index][1]; } var _listCacheGet = listCacheGet$1; var assocIndexOf$1 = _assocIndexOf; function listCacheHas$1(key) { return assocIndexOf$1(this.__data__, key) > -1; } var _listCacheHas = listCacheHas$1; var assocIndexOf = _assocIndexOf; function listCacheSet$1(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { ++this.size; data.push([key, value]); } else { data[index][1] = value; } return this; } var _listCacheSet = listCacheSet$1; var listCacheClear = _listCacheClear, listCacheDelete = _listCacheDelete, listCacheGet = _listCacheGet, listCacheHas = _listCacheHas, listCacheSet = _listCacheSet; function ListCache$1(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } ListCache$1.prototype.clear = listCacheClear; ListCache$1.prototype["delete"] = listCacheDelete; ListCache$1.prototype.get = listCacheGet; ListCache$1.prototype.has = listCacheHas; ListCache$1.prototype.set = listCacheSet; var _ListCache = ListCache$1; var getNative = _getNative, root = _root; var Map$2 = getNative(root, "Map"); var _Map = Map$2; var Hash = _Hash, ListCache = _ListCache, Map$1 = _Map; function mapCacheClear$1() { this.size = 0; this.__data__ = { "hash": new Hash(), "map": new (Map$1 || ListCache)(), "string": new Hash() }; } var _mapCacheClear = mapCacheClear$1; function isKeyable$1(value) { var type2 = typeof value; return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value !== "__proto__" : value === null; } var _isKeyable = isKeyable$1; var isKeyable = _isKeyable; function getMapData$4(map, key) { var data = map.__data__; return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; } var _getMapData = getMapData$4; var getMapData$3 = _getMapData; function mapCacheDelete$1(key) { var result = getMapData$3(this, key)["delete"](key); this.size -= result ? 1 : 0; return result; } var _mapCacheDelete = mapCacheDelete$1; var getMapData$2 = _getMapData; function mapCacheGet$1(key) { return getMapData$2(this, key).get(key); } var _mapCacheGet = mapCacheGet$1; var getMapData$1 = _getMapData; function mapCacheHas$1(key) { return getMapData$1(this, key).has(key); } var _mapCacheHas = mapCacheHas$1; var getMapData = _getMapData; function mapCacheSet$1(key, value) { var data = getMapData(this, key), size = data.size; data.set(key, value); this.size += data.size == size ? 0 : 1; return this; } var _mapCacheSet = mapCacheSet$1; var mapCacheClear = _mapCacheClear, mapCacheDelete = _mapCacheDelete, mapCacheGet = _mapCacheGet, mapCacheHas = _mapCacheHas, mapCacheSet = _mapCacheSet; function MapCache$1(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } MapCache$1.prototype.clear = mapCacheClear; MapCache$1.prototype["delete"] = mapCacheDelete; MapCache$1.prototype.get = mapCacheGet; MapCache$1.prototype.has = mapCacheHas; MapCache$1.prototype.set = mapCacheSet; var _MapCache = MapCache$1; var MapCache = _MapCache; var FUNC_ERROR_TEXT = "Expected a function"; function memoize(func, resolver) { if (typeof func != "function" || resolver != null && typeof resolver != "function") { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); memoized.cache = cache.set(key, result) || cache; return result; }; memoized.cache = new (memoize.Cache || MapCache)(); return memoized; } memoize.Cache = MapCache; var memoize_1 = memoize; const d3CurveTypes = { curveBasis, curveBasisClosed, curveBasisOpen, curveLinear, curveLinearClosed, curveMonotoneX, curveMonotoneY, curveNatural, curveStep, curveStepAfter, curveStepBefore }; const directive = /[%]{2}[{]\s*(?:(?:(\w+)\s*:|(\w+))\s*(?:(?:(\w+))|((?:(?![}][%]{2}).|\r?\n)*))?\s*)(?:[}][%]{2})?/gi; const directiveWithoutOpen = /\s*(?:(?:(\w+)(?=:):|(\w+))\s*(?:(?:(\w+))|((?:(?![}][%]{2}).|\r?\n)*))?\s*)(?:[}][%]{2})?/gi; const detectInit = function(text, config2) { const inits = detectDirective(text, /(?:init\b)|(?:initialize\b)/); let results = {}; if (Array.isArray(inits)) { const args = inits.map((init2) => init2.args); directiveSanitizer(args); results = assignWithDepth(results, [...args]); } else { results = inits.args; } if (results) { let type2 = detectType(text, config2); ["config"].forEach((prop) => { if (typeof results[prop] !== "undefined") { if (type2 === "flowchart-v2") { type2 = "flowchart"; } results[type2] = results[prop]; delete results[prop]; } }); } return results; }; const detectDirective = function(text, type2 = null) { try { const commentWithoutDirectives = new RegExp( `[%]{2}(?![{]${directiveWithoutOpen.source})(?=[}][%]{2}).* `, "ig" ); text = text.trim().replace(commentWithoutDirectives, "").replace(/'/gm, '"'); log$1.debug( `Detecting diagram directive${type2 !== null ? " type:" + type2 : ""} based on the text:${text}` ); let match; const result = []; while ((match = directive.exec(text)) !== null) { if (match.index === directive.lastIndex) { directive.lastIndex++; } if (match && !type2 || type2 && match[1] && match[1].match(type2) || type2 && match[2] && match[2].match(type2)) { const type22 = match[1] ? match[1] : match[2]; const args = match[3] ? match[3].trim() : match[4] ? JSON.parse(match[4].trim()) : null; result.push({ type: type22, args }); } } if (result.length === 0) { result.push({ type: text, args: null }); } return result.length === 1 ? result[0] : result; } catch (error) { log$1.error( `ERROR: ${error.message} - Unable to parse directive ${type2 !== null ? " type:" + type2 : ""} based on the text:${text}` ); return { type: null, args: null }; } }; const isSubstringInArray = function(str, arr) { for (let i = 0; i < arr.length; i++) { if (arr[i].match(str)) return i; } return -1; }; const interpolateToCurve = (interpolate, defaultCurve) => { if (!interpolate) { return defaultCurve; } const curveName = `curve${interpolate.charAt(0).toUpperCase() + interpolate.slice(1)}`; return d3CurveTypes[curveName] || defaultCurve; }; const formatUrl = (linkStr, config2) => { const url = linkStr.trim(); if (url) { if (config2.securityLevel !== "loose") { return sanitizeUrl(url); } return url; } }; const runFunc = (functionName, ...params) => { const arrPaths = functionName.split("."); const len = arrPaths.length - 1; const fnName = arrPaths[len]; let obj = window; for (let i = 0; i < len; i++) { obj = obj[arrPaths[i]]; if (!obj) return; } obj[fnName](...params); }; const distance = (p1, p2) => p1 && p2 ? Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)) : 0; const traverseEdge = (points) => { let prevPoint; let totalDistance2 = 0; points.forEach((point2) => { totalDistance2 += distance(point2, prevPoint); prevPoint = point2; }); let remainingDistance = totalDistance2 / 2; let center = void 0; prevPoint = void 0; points.forEach((point2) => { if (prevPoint && !center) { const vectorDistance = distance(point2, prevPoint); if (vectorDistance < remainingDistance) { remainingDistance -= vectorDistance; } else { const distanceRatio = remainingDistance / vectorDistance; if (distanceRatio <= 0) center = prevPoint; if (distanceRatio >= 1) center = { x: point2.x, y: point2.y }; if (distanceRatio > 0 && distanceRatio < 1) { center = { x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point2.x, y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point2.y }; } } } prevPoint = point2; }); return center; }; const calcLabelPosition = (points) => { if (points.length === 1) { return points[0]; } return traverseEdge(points); }; const calcCardinalityPosition = (isRelationTypePresent, points, initialPosition) => { let prevPoint; log$1.info("our points", points); if (points[0] !== initialPosition) { points = points.reverse(); } points.forEach((point2) => { totalDistance += distance(point2, prevPoint); prevPoint = point2; }); const distanceToCardinalityPoint = 25; let remainingDistance = distanceToCardinalityPoint; let center; prevPoint = void 0; points.forEach((point2) => { if (prevPoint && !center) { const vectorDistance = distance(point2, prevPoint); if (vectorDistance < remainingDistance) { remainingDistance -= vectorDistance; } else { const distanceRatio = remainingDistance / vectorDistance; if (distanceRatio <= 0) center = prevPoint; if (distanceRatio >= 1) center = { x: point2.x, y: point2.y }; if (distanceRatio > 0 && distanceRatio < 1) { center = { x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point2.x, y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point2.y }; } } } prevPoint = point2; }); const d = isRelationTypePresent ? 10 : 5; const angle = Math.atan2(points[0].y - center.y, points[0].x - center.x); const cardinalityPosition = { x: 0, y: 0 }; cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2; cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2; return cardinalityPosition; }; const calcTerminalLabelPosition = (terminalMarkerSize, position, _points) => { let points = JSON.parse(JSON.stringify(_points)); let prevPoint; log$1.info("our points", points); if (position !== "start_left" && position !== "start_right") { points = points.reverse(); } points.forEach((point2) => { prevPoint = point2; }); const distanceToCardinalityPoint = 25 + terminalMarkerSize; let remainingDistance = distanceToCardinalityPoint; let center; prevPoint = void 0; points.forEach((point2) => { if (prevPoint && !center) { const vectorDistance = distance(point2, prevPoint); if (vectorDistance < remainingDistance) { remainingDistance -= vectorDistance; } else { const distanceRatio = remainingDistance / vectorDistance; if (distanceRatio <= 0) center = prevPoint; if (distanceRatio >= 1) center = { x: point2.x, y: point2.y }; if (distanceRatio > 0 && distanceRatio < 1) { center = { x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point2.x, y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point2.y }; } } } prevPoint = point2; }); const d = 10 + terminalMarkerSize * 0.5; const angle = Math.atan2(points[0].y - center.y, points[0].x - center.x); const cardinalityPosition = { x: 0, y: 0 }; cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2; cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2; if (position === "start_left") { cardinalityPosition.x = Math.sin(angle + Math.PI) * d + (points[0].x + center.x) / 2; cardinalityPosition.y = -Math.cos(angle + Math.PI) * d + (points[0].y + center.y) / 2; } if (position === "end_right") { cardinalityPosition.x = Math.sin(angle - Math.PI) * d + (points[0].x + center.x) / 2 - 5; cardinalityPosition.y = -Math.cos(angle - Math.PI) * d + (points[0].y + center.y) / 2 - 5; } if (position === "end_left") { cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2 - 5; cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2 - 5; } return cardinalityPosition; }; const getStylesFromArray = (arr) => { let style = ""; let labelStyle = ""; for (let i = 0; i < arr.length; i++) { if (typeof arr[i] !== "undefined") { if (arr[i].startsWith("color:") || arr[i].startsWith("text-align:")) { labelStyle = labelStyle + arr[i] + ";"; } else { style = style + arr[i] + ";"; } } } return { style, labelStyle }; }; let cnt$1 = 0; const generateId$1 = () => { cnt$1++; return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt$1; }; function makeid(length) { let result = ""; const characters = "0123456789abcdef"; const charactersLength = characters.length; for (let i = 0; i < length; i++) { result += characters.charAt(Math.floor(Math.random() * charactersLength)); } return result; } const random = (options2) => { return makeid(options2.length); }; const getTextObj$3 = function() { return { x: 0, y: 0, fill: void 0, anchor: "start", style: "#666", width: 100, height: 100, textMargin: 0, rx: 0, ry: 0, valign: void 0 }; }; const drawSimpleText = function(elem, textData) { const nText = textData.text.replace(common.lineBreakRegex, " "); const textElem = elem.append("text"); textElem.attr("x", textData.x); textElem.attr("y", textData.y); textElem.style("text-anchor", textData.anchor); textElem.style("font-family", textData.fontFamily); textElem.style("font-size", textData.fontSize); textElem.style("font-weight", textData.fontWeight); textElem.attr("fill", textData.fill); if (typeof textData.class !== "undefined") { textElem.attr("class", textData.class); } const span = textElem.append("tspan"); span.attr("x", textData.x + textData.textMargin * 2); span.attr("fill", textData.fill); span.text(nText); return textElem; }; const wrapLabel = memoize_1( (label, maxWidth, config2) => { if (!label) { return label; } config2 = Object.assign( { fontSize: 12, fontWeight: 400, fontFamily: "Arial", joinWith: "
" }, config2 ); if (common.lineBreakRegex.test(label)) { return label; } const words = label.split(" "); const completedLines = []; let nextLine = ""; words.forEach((word, index) => { const wordLength = calculateTextWidth(`${word} `, config2); const nextLineLength = calculateTextWidth(nextLine, config2); if (wordLength > maxWidth) { const { hyphenatedStrings, remainingWord } = breakString(word, maxWidth, "-", config2); completedLines.push(nextLine, ...hyphenatedStrings); nextLine = remainingWord; } else if (nextLineLength + wordLength >= maxWidth) { completedLines.push(nextLine); nextLine = word; } else { nextLine = [nextLine, word].filter(Boolean).join(" "); } const currentWord = index + 1; const isLastWord = currentWord === words.length; if (isLastWord) { completedLines.push(nextLine); } }); return completedLines.filter((line2) => line2 !== "").join(config2.joinWith); }, (label, maxWidth, config2) => `${label}${maxWidth}${config2.fontSize}${config2.fontWeight}${config2.fontFamily}${config2.joinWith}` ); const breakString = memoize_1( (word, maxWidth, hyphenCharacter = "-", config2) => { config2 = Object.assign( { fontSize: 12, fontWeight: 400, fontFamily: "Arial", margin: 0 }, config2 ); const characters = word.split(""); const lines = []; let currentLine = ""; characters.forEach((character, index) => { const nextLine = `${currentLine}${character}`; const lineWidth = calculateTextWidth(nextLine, config2); if (lineWidth >= maxWidth) { const currentCharacter = index + 1; const isLastLine = characters.length === currentCharacter; const hyphenatedNextLine = `${nextLine}${hyphenCharacter}`; lines.push(isLastLine ? nextLine : hyphenatedNextLine); currentLine = ""; } else { currentLine = nextLine; } }); return { hyphenatedStrings: lines, remainingWord: currentLine }; }, (word, maxWidth, hyphenCharacter = "-", config2) => `${word}${maxWidth}${hyphenCharacter}${config2.fontSize}${config2.fontWeight}${config2.fontFamily}` ); const calculateTextHeight = function(text, config2) { config2 = Object.assign( { fontSize: 12, fontWeight: 400, fontFamily: "Arial", margin: 15 }, config2 ); return calculateTextDimensions(text, config2).height; }; const calculateTextWidth = function(text, config2) { config2 = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: "Arial" }, config2); return calculateTextDimensions(text, config2).width; }; const calculateTextDimensions = memoize_1( function(text, config2) { config2 = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: "Arial" }, config2); const { fontSize, fontFamily, fontWeight } = config2; if (!text) { return { width: 0, height: 0 }; } const fontFamilies = ["sans-serif", fontFamily]; const lines = text.split(common.lineBreakRegex); const dims = []; const body = select("body"); if (!body.remove) { return { width: 0, height: 0, lineHeight: 0 }; } const g = body.append("svg"); for (const fontFamily2 of fontFamilies) { let cheight = 0; const dim = { width: 0, height: 0, lineHeight: 0 }; for (const line2 of lines) { const textObj = getTextObj$3(); textObj.text = line2; const textElem = drawSimpleText(g, textObj).style("font-size", fontSize).style("font-weight", fontWeight).style("font-family", fontFamily2); const bBox = (textElem._groups || textElem)[0][0].getBBox(); dim.width = Math.round(Math.max(dim.width, bBox.width)); cheight = Math.round(bBox.height); dim.height += cheight; dim.lineHeight = Math.round(Math.max(dim.lineHeight, cheight)); } dims.push(dim); } g.remove(); const index = isNaN(dims[1].height) || isNaN(dims[1].width) || isNaN(dims[1].lineHeight) || dims[0].height > dims[1].height && dims[0].width > dims[1].width && dims[0].lineHeight > dims[1].lineHeight ? 0 : 1; return dims[index]; }, (text, config2) => `${text}${config2.fontSize}${config2.fontWeight}${config2.fontFamily}` ); const initIdGenerator = class iterator { constructor(deterministic, seed) { this.deterministic = deterministic; this.seed = seed; this.count = seed ? seed.length : 0; } next() { if (!this.deterministic) return Date.now(); return this.count++; } }; let decoder; const entityDecode = function(html) { decoder = decoder || document.createElement("div"); html = escape(html).replace(/%26/g, "&").replace(/%23/g, "#").replace(/%3B/g, ";"); decoder.innerHTML = html; return unescape(decoder.textContent); }; const directiveSanitizer = (args) => { log$1.debug("directiveSanitizer called with", args); if (typeof args === "object") { if (args.length) { args.forEach((arg) => directiveSanitizer(arg)); } else { Object.keys(args).forEach((key) => { log$1.debug("Checking key", key); if (key.indexOf("__") === 0) { log$1.debug("sanitize deleting __ option", key); delete args[key]; } if (key.indexOf("proto") >= 0) { log$1.debug("sanitize deleting proto option", key); delete args[key]; } if (key.indexOf("constr") >= 0) { log$1.debug("sanitize deleting constr option", key); delete args[key]; } if (key.indexOf("themeCSS") >= 0) { log$1.debug("sanitizing themeCss option"); args[key] = sanitizeCss(args[key]); } if (key.indexOf("fontFamily") >= 0) { log$1.debug("sanitizing fontFamily option"); args[key] = sanitizeCss(args[key]); } if (key.indexOf("altFontFamily") >= 0) { log$1.debug("sanitizing altFontFamily option"); args[key] = sanitizeCss(args[key]); } if (configKeys.indexOf(key) < 0) { log$1.debug("sanitize deleting option", key); delete args[key]; } else { if (typeof args[key] === "object") { log$1.debug("sanitize deleting object", key); directiveSanitizer(args[key]); } } }); } } if (args.themeVariables) { const kArr = Object.keys(args.themeVariables); for (let i = 0; i < kArr.length; i++) { const k = kArr[i]; const val = args.themeVariables[k]; if (val && val.match && !val.match(/^[a-zA-Z0-9#,";()%. ]+$/)) { args.themeVariables[k] = ""; } } } log$1.debug("After sanitization", args); }; const sanitizeCss = (str) => { let startCnt2 = 0; let endCnt = 0; for (let i = 0; i < str.length; i++) { if (startCnt2 < endCnt) { return "{ /* ERROR: Unbalanced CSS */ }"; } if (str[i] === "{") { startCnt2++; } else if (str[i] === "}") { endCnt++; } } if (startCnt2 !== endCnt) { return "{ /* ERROR: Unbalanced CSS */ }"; } return str; }; function isDetailedError(error) { return "str" in error; } function getErrorMessage(error) { if (error instanceof Error) return error.message; return String(error); } const utils = { assignWithDepth, wrapLabel, calculateTextHeight, calculateTextWidth, calculateTextDimensions, detectInit, detectDirective, isSubstringInArray, interpolateToCurve, calcLabelPosition, calcCardinalityPosition, calcTerminalLabelPosition, formatUrl, getStylesFromArray, generateId: generateId$1, random, runFunc, entityDecode, initIdGenerator, directiveSanitizer, sanitizeCss }; const name = "mermaid"; const version$1 = "9.2.0-rc9"; const description$1 = "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs."; const main = "./dist/mermaid.core.mjs"; const module = "./dist/mermaid.core.mjs"; const types = "./dist/mermaid.d.ts"; const type = "module"; const exports = { ".": { require: "./dist/mermaid.min.js", "import": "./dist/mermaid.core.mjs", types: "./dist/mermaid.d.ts" }, "./*": "./*" }; const keywords = [ "diagram", "markdown", "flowchart", "sequence diagram", "gantt", "class diagram", "git graph" ]; const scripts = { clean: "rimraf dist", "build:code": "node .esbuild/esbuild.cjs", "build:types": "tsc -p ./tsconfig.json --emitDeclarationOnly", "build:watch": "yarn build:code --watch", "build:esbuild": 'concurrently "yarn build:code" "yarn build:types"', build: "yarn clean; yarn build:esbuild", dev: "node .esbuild/serve.cjs", "docs:build": "ts-node-esm src/docs.mts", "docs:verify": "yarn docs:build --verify", "todo-postbuild": "documentation build src/mermaidAPI.ts src/config.ts src/defaultConfig.ts --shallow -f md --markdown-toc false > src/docs/Setup.md && prettier --write src/docs/Setup.md", release: "yarn build", lint: "eslint --cache --ignore-path .gitignore . && yarn lint:jison && prettier --check .", "lint:fix": "eslint --fix --ignore-path .gitignore . && prettier --write .", "lint:jison": "ts-node-esm src/jison/lint.mts", cypress: "cypress run", "cypress:open": "cypress open", e2e: "start-server-and-test dev http://localhost:9000/ cypress", "todo-prepare": 'concurrently "husky install" "yarn build"', "pre-commit": "lint-staged" }; const repository = { type: "git", url: "https://github.com/mermaid-js/mermaid" }; const author = "Knut Sveidqvist"; const license = "MIT"; const standard = { ignore: [ "**/parser/*.js", "dist/**/*.js", "cypress/**/*.js" ], globals: [ "page" ] }; const dependencies = { "@braintree/sanitize-url": "^6.0.0", d3: "^7.0.0", dagre: "^0.8.5", "dagre-d3": "^0.6.4", dompurify: "2.4.0", "fast-clone": "^1.5.13", graphlib: "^2.1.8", khroma: "^2.0.0", lodash: "^4.17.21", "moment-mini": "^2.24.0", "non-layered-tidy-tree-layout": "^2.0.2", stylis: "^4.1.2", uuid: "^9.0.0" }; const devDependencies = { "@applitools/eyes-cypress": "^3.25.7", "@commitlint/cli": "^17.1.2", "@commitlint/config-conventional": "^17.0.0", "@types/d3": "^7.4.0", "@types/dompurify": "^2.3.4", "@types/eslint": "^8.4.6", "@types/express": "^4.17.13", "@types/jsdom": "^20.0.0", "@types/lodash": "^4.14.185", "@types/prettier": "^2.7.0", "@types/stylis": "^4.0.2", "@types/uuid": "^8.3.4", "@typescript-eslint/eslint-plugin": "^5.37.0", "@typescript-eslint/parser": "^5.37.0", concurrently: "^7.4.0", coveralls: "^3.1.1", cypress: "^10.0.0", "cypress-image-snapshot": "^4.0.1", documentation: "13.2.0", esbuild: "^0.15.8", eslint: "^8.23.1", "eslint-config-prettier": "^8.5.0", "eslint-plugin-cypress": "^2.12.1", "eslint-plugin-html": "^7.1.0", "eslint-plugin-jest": "^27.0.4", "eslint-plugin-jsdoc": "^39.3.6", "eslint-plugin-json": "^3.1.0", "eslint-plugin-markdown": "^3.0.0", express: "^4.18.1", globby: "^13.1.2", husky: "^8.0.0", "identity-obj-proxy": "^3.0.0", jison: "^0.4.18", "js-base64": "3.7.2", jsdom: "^20.0.0", "lint-staged": "^13.0.0", moment: "^2.23.0", "path-browserify": "^1.0.1", prettier: "^2.7.1", "prettier-plugin-jsdoc": "^0.4.2", remark: "^14.0.2", rimraf: "^3.0.2", "start-server-and-test": "^1.12.6", "ts-node": "^10.9.1", typescript: "^4.8.3", "unist-util-flatmap": "^1.0.0" }; const resolutions = { d3: "^7.0.0" }; const files = [ "dist" ]; const sideEffects = [ "**/*.css", "**/*.scss" ]; const pkg = { name, version: version$1, description: description$1, main, module, types, type, exports, keywords, scripts, repository, author, license, standard, dependencies, devDependencies, resolutions, files, sideEffects }; const defaultConfig = Object.freeze(config$1); let siteConfig = assignWithDepth({}, defaultConfig); let configFromInitialize; let directives = []; let currentConfig = assignWithDepth({}, defaultConfig); const updateCurrentConfig = (siteCfg, _directives) => { let cfg = assignWithDepth({}, siteCfg); let sumOfDirectives = {}; for (let i = 0; i < _directives.length; i++) { const d = _directives[i]; sanitize(d); sumOfDirectives = assignWithDepth(sumOfDirectives, d); } cfg = assignWithDepth(cfg, sumOfDirectives); if (sumOfDirectives.theme && sumOfDirectives.theme in theme) { const tmpConfigFromInitialize = assignWithDepth({}, configFromInitialize); const themeVariables = assignWithDepth( tmpConfigFromInitialize.themeVariables || {}, sumOfDirectives.themeVariables ); if (cfg.theme && cfg.theme in theme) { cfg.themeVariables = theme[cfg.theme].getThemeVariables(themeVariables); } } currentConfig = cfg; return cfg; }; const setSiteConfig = (conf2) => { siteConfig = assignWithDepth({}, defaultConfig); siteConfig = assignWithDepth(siteConfig, conf2); if (conf2.theme && theme[conf2.theme]) { siteConfig.themeVariables = theme[conf2.theme].getThemeVariables(conf2.themeVariables); } currentConfig = updateCurrentConfig(siteConfig, directives); return siteConfig; }; const saveConfigFromInitialize = (conf2) => { configFromInitialize = assignWithDepth({}, conf2); }; const updateSiteConfig = (conf2) => { siteConfig = assignWithDepth(siteConfig, conf2); updateCurrentConfig(siteConfig, directives); return siteConfig; }; const getSiteConfig = () => { return assignWithDepth({}, siteConfig); }; const setConfig = (conf2) => { assignWithDepth(currentConfig, conf2); return getConfig$1(); }; const getConfig$1 = () => { return assignWithDepth({}, currentConfig); }; const sanitize = (options2) => { var _a; ["secure", ...(_a = siteConfig.secure) != null ? _a : []].forEach((key) => { if (typeof options2[key] !== "undefined") { log$1.debug(`Denied attempt to modify a secure key ${key}`, options2[key]); delete options2[key]; } }); Object.keys(options2).forEach((key) => { if (key.indexOf("__") === 0) { delete options2[key]; } }); Object.keys(options2).forEach((key) => { if (typeof options2[key] === "string") { if (options2[key].indexOf("<") > -1 || options2[key].indexOf(">") > -1 || options2[key].indexOf("url(data:") > -1) { delete options2[key]; } } if (typeof options2[key] === "object") { sanitize(options2[key]); } }); }; const addDirective = (directive2) => { if (directive2.fontFamily) { if (!directive2.themeVariables) { directive2.themeVariables = { fontFamily: directive2.fontFamily }; } else { if (!directive2.themeVariables.fontFamily) { directive2.themeVariables = { fontFamily: directive2.fontFamily }; } } } directives.push(directive2); updateCurrentConfig(siteConfig, directives); }; const reset = (config2 = siteConfig) => { directives = []; updateCurrentConfig(config2, directives); }; const d3Attrs = function(d3Elem, attrs) { for (let attr of attrs) { d3Elem.attr(attr[0], attr[1]); } }; const calculateSvgSizeAttrs = function(height2, width2, useMaxWidth) { let attrs = /* @__PURE__ */ new Map(); if (useMaxWidth) { attrs.set("width", "100%"); attrs.set("style", `max-width: ${width2}px;`); } else { attrs.set("width", width2); } return attrs; }; const configureSvgSize = function(svgElem, height2, width2, useMaxWidth) { const attrs = calculateSvgSizeAttrs(height2, width2, useMaxWidth); d3Attrs(svgElem, attrs); }; const setupGraphViewbox$1 = function(graph, svgElem, padding2, useMaxWidth) { const svgBounds = svgElem.node().getBBox(); const sWidth = svgBounds.width; const sHeight = svgBounds.height; log$1.info(`SVG bounds: ${sWidth}x${sHeight}`, svgBounds); let width2 = 0; let height2 = 0; log$1.info(`Graph bounds: ${width2}x${height2}`, graph); width2 = sWidth + padding2 * 2; height2 = sHeight + padding2 * 2; log$1.info(`Calculated bounds: ${width2}x${height2}`); configureSvgSize(svgElem, height2, width2, useMaxWidth); const vBox = `${svgBounds.x - padding2} ${svgBounds.y - padding2} ${svgBounds.width + 2 * padding2} ${svgBounds.height + 2 * padding2}`; svgElem.attr("viewBox", vBox); }; const getStyles$d = (options2) => `g.classGroup text { fill: ${options2.nodeBorder}; fill: ${options2.classText}; stroke: none; font-family: ${options2.fontFamily}; font-size: 10px; .title { font-weight: bolder; } } .nodeLabel, .edgeLabel { color: ${options2.classText}; } .edgeLabel .label rect { fill: ${options2.mainBkg}; } .label text { fill: ${options2.classText}; } .edgeLabel .label span { background: ${options2.mainBkg}; } .classTitle { font-weight: bolder; } .node rect, .node circle, .node ellipse, .node polygon, .node path { fill: ${options2.mainBkg}; stroke: ${options2.nodeBorder}; stroke-width: 1px; } .divider { stroke: ${options2.nodeBorder}; stroke: 1; } g.clickable { cursor: pointer; } g.classGroup rect { fill: ${options2.mainBkg}; stroke: ${options2.nodeBorder}; } g.classGroup line { stroke: ${options2.nodeBorder}; stroke-width: 1; } .classLabel .box { stroke: none; stroke-width: 0; fill: ${options2.mainBkg}; opacity: 0.5; } .classLabel .label { fill: ${options2.nodeBorder}; font-size: 10px; } .relation { stroke: ${options2.lineColor}; stroke-width: 1; fill: none; } .dashed-line{ stroke-dasharray: 3; } #compositionStart, .composition { fill: ${options2.lineColor} !important; stroke: ${options2.lineColor} !important; stroke-width: 1; } #compositionEnd, .composition { fill: ${options2.lineColor} !important; stroke: ${options2.lineColor} !important; stroke-width: 1; } #dependencyStart, .dependency { fill: ${options2.lineColor} !important; stroke: ${options2.lineColor} !important; stroke-width: 1; } #dependencyStart, .dependency { fill: ${options2.lineColor} !important; stroke: ${options2.lineColor} !important; stroke-width: 1; } #extensionStart, .extension { fill: ${options2.lineColor} !important; stroke: ${options2.lineColor} !important; stroke-width: 1; } #extensionEnd, .extension { fill: ${options2.lineColor} !important; stroke: ${options2.lineColor} !important; stroke-width: 1; } #aggregationStart, .aggregation { fill: ${options2.mainBkg} !important; stroke: ${options2.lineColor} !important; stroke-width: 1; } #aggregationEnd, .aggregation { fill: ${options2.mainBkg} !important; stroke: ${options2.lineColor} !important; stroke-width: 1; } #lollipopStart, .lollipop { fill: ${options2.mainBkg} !important; stroke: ${options2.lineColor} !important; stroke-width: 1; } #lollipopEnd, .lollipop { fill: ${options2.mainBkg} !important; stroke: ${options2.lineColor} !important; stroke-width: 1; } .edgeTerminals { font-size: 11px; } `; const getStyles$c = (options2) => ` .entityBox { fill: ${options2.mainBkg}; stroke: ${options2.nodeBorder}; } .attributeBoxOdd { fill: ${options2.attributeBackgroundColorOdd}; stroke: ${options2.nodeBorder}; } .attributeBoxEven { fill: ${options2.attributeBackgroundColorEven}; stroke: ${options2.nodeBorder}; } .relationshipLabelBox { fill: ${options2.tertiaryColor}; opacity: 0.7; background-color: ${options2.tertiaryColor}; rect { opacity: 0.5; } } .relationshipLine { stroke: ${options2.lineColor}; } `; const getStyles$b = () => ``; const getStyles$a = (options2) => `.label { font-family: ${options2.fontFamily}; color: ${options2.nodeTextColor || options2.textColor}; } .cluster-label text { fill: ${options2.titleColor}; } .cluster-label span { color: ${options2.titleColor}; } .label text,span { fill: ${options2.nodeTextColor || options2.textColor}; color: ${options2.nodeTextColor || options2.textColor}; } .node rect, .node circle, .node ellipse, .node polygon, .node path { fill: ${options2.mainBkg}; stroke: ${options2.nodeBorder}; stroke-width: 1px; } .node .label { text-align: center; } .node.clickable { cursor: pointer; } .arrowheadPath { fill: ${options2.arrowheadColor}; } .edgePath .path { stroke: ${options2.lineColor}; stroke-width: 2.0px; } .flowchart-link { stroke: ${options2.lineColor}; fill: none; } .edgeLabel { background-color: ${options2.edgeLabelBackground}; rect { opacity: 0.5; background-color: ${options2.edgeLabelBackground}; fill: ${options2.edgeLabelBackground}; } text-align: center; } .cluster rect { fill: ${options2.clusterBkg}; stroke: ${options2.clusterBorder}; stroke-width: 1px; } .cluster text { fill: ${options2.titleColor}; } .cluster span { color: ${options2.titleColor}; } /* .cluster div { color: ${options2.titleColor}; } */ div.mermaidTooltip { position: absolute; text-align: center; max-width: 200px; padding: 2px; font-family: ${options2.fontFamily}; font-size: 12px; background: ${options2.tertiaryColor}; border: 1px solid ${options2.border2}; border-radius: 2px; pointer-events: none; z-index: 100; } `; const getStyles$9 = (options2) => ` .mermaid-main-font { font-family: "trebuchet ms", verdana, arial, sans-serif; font-family: var(--mermaid-font-family); } .exclude-range { fill: ${options2.excludeBkgColor}; } .section { stroke: none; opacity: 0.2; } .section0 { fill: ${options2.sectionBkgColor}; } .section2 { fill: ${options2.sectionBkgColor2}; } .section1, .section3 { fill: ${options2.altSectionBkgColor}; opacity: 0.2; } .sectionTitle0 { fill: ${options2.titleColor}; } .sectionTitle1 { fill: ${options2.titleColor}; } .sectionTitle2 { fill: ${options2.titleColor}; } .sectionTitle3 { fill: ${options2.titleColor}; } .sectionTitle { text-anchor: start; // font-size: ${options2.ganttFontSize}; // text-height: 14px; font-family: 'trebuchet ms', verdana, arial, sans-serif; font-family: var(--mermaid-font-family); } /* Grid and axis */ .grid .tick { stroke: ${options2.gridColor}; opacity: 0.8; shape-rendering: crispEdges; text { font-family: ${options2.fontFamily}; fill: ${options2.textColor}; } } .grid path { stroke-width: 0; } /* Today line */ .today { fill: none; stroke: ${options2.todayLineColor}; stroke-width: 2px; } /* Task styling */ /* Default task */ .task { stroke-width: 2; } .taskText { text-anchor: middle; font-family: 'trebuchet ms', verdana, arial, sans-serif; font-family: var(--mermaid-font-family); } // .taskText:not([font-size]) { // font-size: ${options2.ganttFontSize}; // } .taskTextOutsideRight { fill: ${options2.taskTextDarkColor}; text-anchor: start; // font-size: ${options2.ganttFontSize}; font-family: 'trebuchet ms', verdana, arial, sans-serif; font-family: var(--mermaid-font-family); } .taskTextOutsideLeft { fill: ${options2.taskTextDarkColor}; text-anchor: end; // font-size: ${options2.ganttFontSize}; } /* Special case clickable */ .task.clickable { cursor: pointer; } .taskText.clickable { cursor: pointer; fill: ${options2.taskTextClickableColor} !important; font-weight: bold; } .taskTextOutsideLeft.clickable { cursor: pointer; fill: ${options2.taskTextClickableColor} !important; font-weight: bold; } .taskTextOutsideRight.clickable { cursor: pointer; fill: ${options2.taskTextClickableColor} !important; font-weight: bold; } /* Specific task settings for the sections*/ .taskText0, .taskText1, .taskText2, .taskText3 { fill: ${options2.taskTextColor}; } .task0, .task1, .task2, .task3 { fill: ${options2.taskBkgColor}; stroke: ${options2.taskBorderColor}; } .taskTextOutside0, .taskTextOutside2 { fill: ${options2.taskTextOutsideColor}; } .taskTextOutside1, .taskTextOutside3 { fill: ${options2.taskTextOutsideColor}; } /* Active task */ .active0, .active1, .active2, .active3 { fill: ${options2.activeTaskBkgColor}; stroke: ${options2.activeTaskBorderColor}; } .activeText0, .activeText1, .activeText2, .activeText3 { fill: ${options2.taskTextDarkColor} !important; } /* Completed task */ .done0, .done1, .done2, .done3 { stroke: ${options2.doneTaskBorderColor}; fill: ${options2.doneTaskBkgColor}; stroke-width: 2; } .doneText0, .doneText1, .doneText2, .doneText3 { fill: ${options2.taskTextDarkColor} !important; } /* Tasks on the critical line */ .crit0, .crit1, .crit2, .crit3 { stroke: ${options2.critBorderColor}; fill: ${options2.critBkgColor}; stroke-width: 2; } .activeCrit0, .activeCrit1, .activeCrit2, .activeCrit3 { stroke: ${options2.critBorderColor}; fill: ${options2.activeTaskBkgColor}; stroke-width: 2; } .doneCrit0, .doneCrit1, .doneCrit2, .doneCrit3 { stroke: ${options2.critBorderColor}; fill: ${options2.doneTaskBkgColor}; stroke-width: 2; cursor: pointer; shape-rendering: crispEdges; } .milestone { transform: rotate(45deg) scale(0.8,0.8); } .milestoneText { font-style: italic; } .doneCritText0, .doneCritText1, .doneCritText2, .doneCritText3 { fill: ${options2.taskTextDarkColor} !important; } .activeCritText0, .activeCritText1, .activeCritText2, .activeCritText3 { fill: ${options2.taskTextDarkColor} !important; } .titleText { text-anchor: middle; font-size: 18px; fill: ${options2.textColor} ; font-family: 'trebuchet ms', verdana, arial, sans-serif; font-family: var(--mermaid-font-family); } `; const getStyles$8 = () => ``; const getStyles$7 = (options2) => ` .pieCircle{ stroke: ${options2.pieStrokeColor}; stroke-width : ${options2.pieStrokeWidth}; opacity : ${options2.pieOpacity}; } .pieTitleText { text-anchor: middle; font-size: ${options2.pieTitleTextSize}; fill: ${options2.pieTitleTextColor}; font-family: ${options2.fontFamily}; } .slice { font-family: ${options2.fontFamily}; fill: ${options2.pieSectionTextColor}; font-size:${options2.pieSectionTextSize}; // fill: white; } .legend text { fill: ${options2.pieLegendTextColor}; font-family: ${options2.fontFamily}; font-size: ${options2.pieLegendTextSize}; } `; const getStyles$6 = (options2) => ` marker { fill: ${options2.relationColor}; stroke: ${options2.relationColor}; } marker.cross { stroke: ${options2.lineColor}; } svg { font-family: ${options2.fontFamily}; font-size: ${options2.fontSize}; } .reqBox { fill: ${options2.requirementBackground}; fill-opacity: 100%; stroke: ${options2.requirementBorderColor}; stroke-width: ${options2.requirementBorderSize}; } .reqTitle, .reqLabel{ fill: ${options2.requirementTextColor}; } .reqLabelBox { fill: ${options2.relationLabelBackground}; fill-opacity: 100%; } .req-title-line { stroke: ${options2.requirementBorderColor}; stroke-width: ${options2.requirementBorderSize}; } .relationshipLine { stroke: ${options2.relationColor}; stroke-width: 1; } .relationshipLabel { fill: ${options2.relationLabelColor}; } `; const getStyles$5 = (options2) => `.actor { stroke: ${options2.actorBorder}; fill: ${options2.actorBkg}; } text.actor > tspan { fill: ${options2.actorTextColor}; stroke: none; } .actor-line { stroke: ${options2.actorLineColor}; } .messageLine0 { stroke-width: 1.5; stroke-dasharray: none; stroke: ${options2.signalColor}; } .messageLine1 { stroke-width: 1.5; stroke-dasharray: 2, 2; stroke: ${options2.signalColor}; } #arrowhead path { fill: ${options2.signalColor}; stroke: ${options2.signalColor}; } .sequenceNumber { fill: ${options2.sequenceNumberColor}; } #sequencenumber { fill: ${options2.signalColor}; } #crosshead path { fill: ${options2.signalColor}; stroke: ${options2.signalColor}; } .messageText { fill: ${options2.signalTextColor}; stroke: none; } .labelBox { stroke: ${options2.labelBoxBorderColor}; fill: ${options2.labelBoxBkgColor}; } .labelText, .labelText > tspan { fill: ${options2.labelTextColor}; stroke: none; } .loopText, .loopText > tspan { fill: ${options2.loopTextColor}; stroke: none; } .loopLine { stroke-width: 2px; stroke-dasharray: 2, 2; stroke: ${options2.labelBoxBorderColor}; fill: ${options2.labelBoxBorderColor}; } .note { //stroke: #decc93; stroke: ${options2.noteBorderColor}; fill: ${options2.noteBkgColor}; } .noteText, .noteText > tspan { fill: ${options2.noteTextColor}; stroke: none; } .activation0 { fill: ${options2.activationBkgColor}; stroke: ${options2.activationBorderColor}; } .activation1 { fill: ${options2.activationBkgColor}; stroke: ${options2.activationBorderColor}; } .activation2 { fill: ${options2.activationBkgColor}; stroke: ${options2.activationBorderColor}; } .actorPopupMenu { position: absolute; } .actorPopupMenuPanel { position: absolute; fill: ${options2.actorBkg}; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4)); } .actor-man line { stroke: ${options2.actorBorder}; fill: ${options2.actorBkg}; } .actor-man circle, line { stroke: ${options2.actorBorder}; fill: ${options2.actorBkg}; stroke-width: 2px; } `; const getStyles$4 = (options2) => ` defs #statediagram-barbEnd { fill: ${options2.transitionColor}; stroke: ${options2.transitionColor}; } g.stateGroup text { fill: ${options2.nodeBorder}; stroke: none; font-size: 10px; } g.stateGroup text { fill: ${options2.textColor}; stroke: none; font-size: 10px; } g.stateGroup .state-title { font-weight: bolder; fill: ${options2.stateLabelColor}; } g.stateGroup rect { fill: ${options2.mainBkg}; stroke: ${options2.nodeBorder}; } g.stateGroup line { stroke: ${options2.lineColor}; stroke-width: 1; } .transition { stroke: ${options2.transitionColor}; stroke-width: 1; fill: none; } .stateGroup .composit { fill: ${options2.background}; border-bottom: 1px } .stateGroup .alt-composit { fill: #e0e0e0; border-bottom: 1px } .state-note { stroke: ${options2.noteBorderColor}; fill: ${options2.noteBkgColor}; text { fill: ${options2.noteTextColor}; stroke: none; font-size: 10px; } } .stateLabel .box { stroke: none; stroke-width: 0; fill: ${options2.mainBkg}; opacity: 0.5; } .edgeLabel .label rect { fill: ${options2.labelBackgroundColor}; opacity: 0.5; } .edgeLabel .label text { fill: ${options2.transitionLabelColor || options2.tertiaryTextColor}; } .label div .edgeLabel { color: ${options2.transitionLabelColor || options2.tertiaryTextColor}; } .stateLabel text { fill: ${options2.stateLabelColor}; font-size: 10px; font-weight: bold; } .node circle.state-start { fill: ${options2.specialStateColor}; stroke: ${options2.specialStateColor}; } .node .fork-join { fill: ${options2.specialStateColor}; stroke: ${options2.specialStateColor}; } .node circle.state-end { fill: ${options2.innerEndBackground}; stroke: ${options2.background}; stroke-width: 1.5 } .end-state-inner { fill: ${options2.compositeBackground || options2.background}; // stroke: ${options2.background}; stroke-width: 1.5 } .node rect { fill: ${options2.stateBkg || options2.mainBkg}; stroke: ${options2.stateBorder || options2.nodeBorder}; stroke-width: 1px; } .node polygon { fill: ${options2.mainBkg}; stroke: ${options2.stateBorder || options2.nodeBorder};; stroke-width: 1px; } #statediagram-barbEnd { fill: ${options2.lineColor}; } .statediagram-cluster rect { fill: ${options2.compositeTitleBackground}; stroke: ${options2.stateBorder || options2.nodeBorder}; stroke-width: 1px; } .cluster-label, .nodeLabel { color: ${options2.stateLabelColor}; } .statediagram-cluster rect.outer { rx: 5px; ry: 5px; } .statediagram-state .divider { stroke: ${options2.stateBorder || options2.nodeBorder}; } .statediagram-state .title-state { rx: 5px; ry: 5px; } .statediagram-cluster.statediagram-cluster .inner { fill: ${options2.compositeBackground || options2.background}; } .statediagram-cluster.statediagram-cluster-alt .inner { fill: ${options2.altBackground ? options2.altBackground : "#efefef"}; } .statediagram-cluster .inner { rx:0; ry:0; } .statediagram-state rect.basic { rx: 5px; ry: 5px; } .statediagram-state rect.divider { stroke-dasharray: 10,10; fill: ${options2.altBackground ? options2.altBackground : "#efefef"}; } .note-edge { stroke-dasharray: 5; } .statediagram-note rect { fill: ${options2.noteBkgColor}; stroke: ${options2.noteBorderColor}; stroke-width: 1px; rx: 0; ry: 0; } .statediagram-note rect { fill: ${options2.noteBkgColor}; stroke: ${options2.noteBorderColor}; stroke-width: 1px; rx: 0; ry: 0; } .statediagram-note text { fill: ${options2.noteTextColor}; } .statediagram-note .nodeLabel { color: ${options2.noteTextColor}; } .statediagram .edgeLabel { color: red; // ${options2.noteTextColor}; } #dependencyStart, #dependencyEnd { fill: ${options2.lineColor}; stroke: ${options2.lineColor}; stroke-width: 1; } `; const getStyles$3 = (options2) => `.label { font-family: 'trebuchet ms', verdana, arial, sans-serif; font-family: var(--mermaid-font-family); color: ${options2.textColor}; } .mouth { stroke: #666; } line { stroke: ${options2.textColor} } .legend { fill: ${options2.textColor}; } .label text { fill: #333; } .label { color: ${options2.textColor} } .face { ${options2.faceColor ? `fill: ${options2.faceColor}` : "fill: #FFF8DC"}; stroke: #999; } .node rect, .node circle, .node ellipse, .node polygon, .node path { fill: ${options2.mainBkg}; stroke: ${options2.nodeBorder}; stroke-width: 1px; } .node .label { text-align: center; } .node.clickable { cursor: pointer; } .arrowheadPath { fill: ${options2.arrowheadColor}; } .edgePath .path { stroke: ${options2.lineColor}; stroke-width: 1.5px; } .flowchart-link { stroke: ${options2.lineColor}; fill: none; } .edgeLabel { background-color: ${options2.edgeLabelBackground}; rect { opacity: 0.5; } text-align: center; } .cluster rect { } .cluster text { fill: ${options2.titleColor}; } div.mermaidTooltip { position: absolute; text-align: center; max-width: 200px; padding: 2px; font-family: 'trebuchet ms', verdana, arial, sans-serif; font-family: var(--mermaid-font-family); font-size: 12px; background: ${options2.tertiaryColor}; border: 1px solid ${options2.border2}; border-radius: 2px; pointer-events: none; z-index: 100; } .task-type-0, .section-type-0 { ${options2.fillType0 ? `fill: ${options2.fillType0}` : ""}; } .task-type-1, .section-type-1 { ${options2.fillType0 ? `fill: ${options2.fillType1}` : ""}; } .task-type-2, .section-type-2 { ${options2.fillType0 ? `fill: ${options2.fillType2}` : ""}; } .task-type-3, .section-type-3 { ${options2.fillType0 ? `fill: ${options2.fillType3}` : ""}; } .task-type-4, .section-type-4 { ${options2.fillType0 ? `fill: ${options2.fillType4}` : ""}; } .task-type-5, .section-type-5 { ${options2.fillType0 ? `fill: ${options2.fillType5}` : ""}; } .task-type-6, .section-type-6 { ${options2.fillType0 ? `fill: ${options2.fillType6}` : ""}; } .task-type-7, .section-type-7 { ${options2.fillType0 ? `fill: ${options2.fillType7}` : ""}; } .actor-0 { ${options2.actor0 ? `fill: ${options2.actor0}` : ""}; } .actor-1 { ${options2.actor1 ? `fill: ${options2.actor1}` : ""}; } .actor-2 { ${options2.actor2 ? `fill: ${options2.actor2}` : ""}; } .actor-3 { ${options2.actor3 ? `fill: ${options2.actor3}` : ""}; } .actor-4 { ${options2.actor4 ? `fill: ${options2.actor4}` : ""}; } .actor-5 { ${options2.actor5 ? `fill: ${options2.actor5}` : ""}; } `; const getStyles$2 = (options2) => `.person { stroke: ${options2.personBorder}; fill: ${options2.personBkg}; } `; const themes = { flowchart: getStyles$a, "flowchart-v2": getStyles$a, sequence: getStyles$5, gantt: getStyles$9, classDiagram: getStyles$d, "classDiagram-v2": getStyles$d, class: getStyles$d, stateDiagram: getStyles$4, state: getStyles$4, info: getStyles$8, pie: getStyles$7, er: getStyles$c, error: getStyles$b, journey: getStyles$3, requirement: getStyles$6, c4: getStyles$2 }; const getStyles$1 = (type2, userStyles, options2) => { let diagramStyles = ""; if (type2 in themes && themes[type2]) { diagramStyles = themes[type2](options2); } else { log$1.warn(`No theme found for ${type2}`); } return ` { font-family: ${options2.fontFamily}; font-size: ${options2.fontSize}; fill: ${options2.textColor} } /* Classes common for multiple diagrams */ .error-icon { fill: ${options2.errorBkgColor}; } .error-text { fill: ${options2.errorTextColor}; stroke: ${options2.errorTextColor}; } .edge-thickness-normal { stroke-width: 2px; } .edge-thickness-thick { stroke-width: 3.5px } .edge-pattern-solid { stroke-dasharray: 0; } .edge-pattern-dashed{ stroke-dasharray: 3; } .edge-pattern-dotted { stroke-dasharray: 2; } .marker { fill: ${options2.lineColor}; stroke: ${options2.lineColor}; } .marker.cross { stroke: ${options2.lineColor}; } svg { font-family: ${options2.fontFamily}; font-size: ${options2.fontSize}; } ${diagramStyles} ${userStyles} `; }; const addStylesForDiagram = (type2, diagramTheme) => { themes[type2] = diagramTheme; }; const log = log$1; const setLogLevel = setLogLevel$1; const getConfig = getConfig$1; const sanitizeText$4 = (text) => sanitizeText$5(text, getConfig()); const setupGraphViewbox = setupGraphViewbox$1; const diagrams = {}; const registerDiagram = (id, diagram, detector, callback) => { log.debug(`Registering diagram ${id}`); if (diagrams[id]) { log.warn(`Diagram ${id} already registered.`); } diagrams[id] = diagram; if (detector) { addDetector(id, detector); } addStylesForDiagram(id, diagram.styles); if (typeof callback !== "undefined") { callback(log, setLogLevel, getConfig, sanitizeText$4, setupGraphViewbox); } log.debug(`Registered diagram ${id}. ${Object.keys(diagrams).join(", ")} diagrams registered.`); }; const getDiagram = (name2) => { log.debug(`Getting diagram ${name2}. ${Object.keys(diagrams).join(", ")} diagrams registered.`); if (name2 in diagrams) { return diagrams[name2]; } throw new DiagramNotFoundError(name2); }; class DiagramNotFoundError extends Error { constructor(message2) { super(`Diagram ${message2} not found.`); } } var parser$b = function() { var o = function(k, v, o2, l) { for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ; return o2; }, $V0 = [1, 4], $V1 = [1, 7], $V2 = [1, 5], $V3 = [1, 9], $V4 = [1, 6], $V5 = [2, 6], $V6 = [1, 16], $V7 = [6, 8, 14, 20, 22, 24, 25, 27, 29, 32, 37, 40, 50, 54], $V8 = [8, 14, 20, 22, 24, 25, 27, 29, 32, 37, 40], $V9 = [8, 13, 14, 20, 22, 24, 25, 27, 29, 32, 37, 40], $Va = [1, 26], $Vb = [6, 8, 14, 50, 54], $Vc = [8, 14, 54], $Vd = [1, 65], $Ve = [1, 66], $Vf = [1, 67], $Vg = [8, 14, 33, 35, 42, 54]; var parser2 = { trace: function trace() { }, yy: {}, symbols_: { "error": 2, "start": 3, "eol": 4, "directive": 5, "GG": 6, "document": 7, "EOF": 8, ":": 9, "DIR": 10, "options": 11, "body": 12, "OPT": 13, "NL": 14, "line": 15, "statement": 16, "commitStatement": 17, "mergeStatement": 18, "cherryPickStatement": 19, "acc_title": 20, "acc_title_value": 21, "acc_descr": 22, "acc_descr_value": 23, "acc_descr_multiline_value": 24, "section": 25, "branchStatement": 26, "CHECKOUT": 27, "ID": 28, "BRANCH": 29, "ORDER": 30, "NUM": 31, "CHERRY_PICK": 32, "COMMIT_ID": 33, "STR": 34, "COMMIT_TAG": 35, "EMPTYSTR": 36, "MERGE": 37, "COMMIT_TYPE": 38, "commitType": 39, "COMMIT": 40, "commit_arg": 41, "COMMIT_MSG": 42, "NORMAL": 43, "REVERSE": 44, "HIGHLIGHT": 45, "openDirective": 46, "typeDirective": 47, "closeDirective": 48, "argDirective": 49, "open_directive": 50, "type_directive": 51, "arg_directive": 52, "close_directive": 53, ";": 54, "$accept": 0, "$end": 1 }, terminals_: { 2: "error", 6: "GG", 8: "EOF", 9: ":", 10: "DIR", 13: "OPT", 14: "NL", 20: "acc_title", 21: "acc_title_value", 22: "acc_descr", 23: "acc_descr_value", 24: "acc_descr_multiline_value", 25: "section", 27: "CHECKOUT", 28: "ID", 29: "BRANCH", 30: "ORDER", 31: "NUM", 32: "CHERRY_PICK", 33: "COMMIT_ID", 34: "STR", 35: "COMMIT_TAG", 36: "EMPTYSTR", 37: "MERGE", 38: "COMMIT_TYPE", 40: "COMMIT", 42: "COMMIT_MSG", 43: "NORMAL", 44: "REVERSE", 45: "HIGHLIGHT", 50: "open_directive", 51: "type_directive", 52: "arg_directive", 53: "close_directive", 54: ";" }, productions_: [0, [3, 2], [3, 2], [3, 3], [3, 4], [3, 5], [7, 0], [7, 2], [11, 2], [11, 1], [12, 0], [12, 2], [15, 2], [15, 1], [16, 1], [16, 1], [16, 1], [16, 2], [16, 2], [16, 1], [16, 1], [16, 1], [16, 2], [26, 2], [26, 4], [19, 3], [19, 5], [19, 5], [19, 5], [19, 5], [18, 2], [18, 4], [18, 4], [18, 4], [18, 6], [18, 6], [18, 6], [18, 6], [18, 6], [18, 6], [18, 8], [18, 8], [18, 8], [18, 8], [18, 8], [18, 8], [17, 2], [17, 3], [17, 3], [17, 5], [17, 5], [17, 3], [17, 5], [17, 5], [17, 5], [17, 5], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 3], [17, 5], [17, 5], [17, 5], [17, 5], [17, 5], [17, 5], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 7], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [17, 9], [41, 0], [41, 1], [39, 1], [39, 1], [39, 1], [5, 3], [5, 5], [46, 1], [47, 1], [49, 1], [48, 1], [4, 1], [4, 1], [4, 1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { var $0 = $$.length - 1; switch (yystate) { case 3: return $$[$0]; case 4: return $$[$0 - 1]; case 5: yy.setDirection($$[$0 - 3]); return $$[$0 - 1]; case 7: yy.setOptions($$[$0 - 1]); this.$ = $$[$0]; break; case 8: $$[$0 - 1] += $$[$0]; this.$ = $$[$0 - 1]; break; case 10: this.$ = []; break; case 11: $$[$0 - 1].push($$[$0]); this.$ = $$[$0 - 1]; break; case 12: this.$ = $$[$0 - 1]; break; case 17: this.$ = $$[$0].trim(); yy.setAccTitle(this.$); break; case 18: case 19: this.$ = $$[$0].trim(); yy.setAccDescription(this.$); break; case 20: yy.addSection($$[$0].substr(8)); this.$ = $$[$0].substr(8); break; case 22: yy.checkout($$[$0]); break; case 23: yy.branch($$[$0]); break; case 24: yy.branch($$[$0 - 2], $$[$0]); break; case 25: yy.cherryPick($$[$0], "", void 0); break; case 26: yy.cherryPick($$[$0 - 2], "", $$[$0]); break; case 27: case 29: yy.cherryPick($$[$0 - 2], "", ""); break; case 28: yy.cherryPick($$[$0], "", $$[$0 - 2]); break; case 30: yy.merge($$[$0], "", "", ""); break; case 31: yy.merge($$[$0 - 2], $$[$0], "", ""); break; case 32: yy.merge($$[$0 - 2], "", $$[$0], ""); break; case 33: yy.merge($$[$0 - 2], "", "", $$[$0]); break; case 34: yy.merge($$[$0 - 4], $$[$0], "", $$[$0 - 2]); break; case 35: yy.merge($$[$0 - 4], "", $$[$0], $$[$0 - 2]); break; case 36: yy.merge($$[$0 - 4], "", $$[$0 - 2], $$[$0]); break; case 37: yy.merge($$[$0 - 4], $$[$0 - 2], $$[$0], ""); break; case 38: yy.merge($$[$0 - 4], $$[$0 - 2], "", $$[$0]); break; case 39: yy.merge($$[$0 - 4], $$[$0], $$[$0 - 2], ""); break; case 40: yy.merge($$[$0 - 6], $$[$0 - 4], $$[$0 - 2], $$[$0]); break; case 41: yy.merge($$[$0 - 6], $$[$0], $$[$0 - 4], $$[$0 - 2]); break; case 42: yy.merge($$[$0 - 6], $$[$0 - 4], $$[$0], $$[$0 - 2]); break; case 43: yy.merge($$[$0 - 6], $$[$0 - 2], $$[$0 - 4], $$[$0]); break; case 44: yy.merge($$[$0 - 6], $$[$0], $$[$0 - 2], $$[$0 - 4]); break; case 45: yy.merge($$[$0 - 6], $$[$0 - 2], $$[$0], $$[$0 - 4]); break; case 46: yy.commit($$[$0]); break; case 47: yy.commit("", "", yy.commitType.NORMAL, $$[$0]); break; case 48: yy.commit("", "", $$[$0], ""); break; case 49: yy.commit("", "", $$[$0], $$[$0 - 2]); break; case 50: yy.commit("", "", $$[$0 - 2], $$[$0]); break; case 51: yy.commit("", $$[$0], yy.commitType.NORMAL, ""); break; case 52: yy.commit("", $$[$0 - 2], yy.commitType.NORMAL, $$[$0]); break; case 53: yy.commit("", $$[$0], yy.commitType.NORMAL, $$[$0 - 2]); break; case 54: yy.commit("", $$[$0 - 2], $$[$0], ""); break; case 55: yy.commit("", $$[$0], $$[$0 - 2], ""); break; case 56: yy.commit("", $$[$0 - 4], $$[$0 - 2], $$[$0]); break; case 57: yy.commit("", $$[$0 - 4], $$[$0], $$[$0 - 2]); break; case 58: yy.commit("", $$[$0 - 2], $$[$0 - 4], $$[$0]); break; case 59: yy.commit("", $$[$0], $$[$0 - 4], $$[$0 - 2]); break; case 60: yy.commit("", $$[$0], $$[$0 - 2], $$[$0 - 4]); break; case 61: yy.commit("", $$[$0 - 2], $$[$0], $$[$0 - 4]); break; case 62: yy.commit($$[$0], "", yy.commitType.NORMAL, ""); break; case 63: yy.commit($$[$0], "", yy.commitType.NORMAL, $$[$0 - 2]); break; case 64: yy.commit($$[$0 - 2], "", yy.commitType.NORMAL, $$[$0]); break; case 65: yy.commit($$[$0 - 2], "", $$[$0], ""); break; case 66: yy.commit($$[$0], "", $$[$0 - 2], ""); break; case 67: yy.commit($$[$0], $$[$0 - 2], yy.commitType.NORMAL, ""); break; case 68: yy.commit($$[$0 - 2], $$[$0], yy.commitType.NORMAL, ""); break; case 69: yy.commit($$[$0 - 4], "", $$[$0 - 2], $$[$0]); break; case 70: yy.commit($$[$0 - 4], "", $$[$0], $$[$0 - 2]); break; case 71: yy.commit($$[$0 - 2], "", $$[$0 - 4], $$[$0]); break; case 72: yy.commit($$[$0], "", $$[$0 - 4], $$[$0 - 2]); break; case 73: yy.commit($$[$0], "", $$[$0 - 2], $$[$0 - 4]); break; case 74: yy.commit($$[$0 - 2], "", $$[$0], $$[$0 - 4]); break; case 75: yy.commit($$[$0 - 4], $$[$0], $$[$0 - 2], ""); break; case 76: yy.commit($$[$0 - 4], $$[$0 - 2], $$[$0], ""); break; case 77: yy.commit($$[$0 - 2], $$[$0], $$[$0 - 4], ""); break; case 78: yy.commit($$[$0], $$[$0 - 2], $$[$0 - 4], ""); break; case 79: yy.commit($$[$0], $$[$0 - 4], $$[$0 - 2], ""); break; case 80: yy.commit($$[$0 - 2], $$[$0 - 4], $$[$0], ""); break; case 81: yy.commit($$[$0 - 4], $$[$0], yy.commitType.NORMAL, $$[$0 - 2]); break; case 82: yy.commit($$[$0 - 4], $$[$0 - 2], yy.commitType.NORMAL, $$[$0]); break; case 83: yy.commit($$[$0 - 2], $$[$0], yy.commitType.NORMAL, $$[$0 - 4]); break; case 84: yy.commit($$[$0], $$[$0 - 2], yy.commitType.NORMAL, $$[$0 - 4]); break; case 85: yy.commit($$[$0], $$[$0 - 4], yy.commitType.NORMAL, $$[$0 - 2]); break; case 86: yy.commit($$[$0 - 2], $$[$0 - 4], yy.commitType.NORMAL, $$[$0]); break; case 87: yy.commit($$[$0 - 6], $$[$0 - 4], $$[$0 - 2], $$[$0]); break; case 88: yy.commit($$[$0 - 6], $$[$0 - 4], $$[$0], $$[$0 - 2]); break; case 89: yy.commit($$[$0 - 6], $$[$0 - 2], $$[$0 - 4], $$[$0]); break; case 90: yy.commit($$[$0 - 6], $$[$0], $$[$0 - 4], $$[$0 - 2]); break; case 91: yy.commit($$[$0 - 6], $$[$0 - 2], $$[$0], $$[$0 - 4]); break; case 92: yy.commit($$[$0 - 6], $$[$0], $$[$0 - 2], $$[$0 - 4]); break; case 93: yy.commit($$[$0 - 4], $$[$0 - 6], $$[$0 - 2], $$[$0]); break; case 94: yy.commit($$[$0 - 4], $$[$0 - 6], $$[$0], $$[$0 - 2]); break; case 95: yy.commit($$[$0 - 2], $$[$0 - 6], $$[$0 - 4], $$[$0]); break; case 96: yy.commit($$[$0], $$[$0 - 6], $$[$0 - 4], $$[$0 - 2]); break; case 97: yy.commit($$[$0 - 2], $$[$0 - 6], $$[$0], $$[$0 - 4]); break; case 98: yy.commit($$[$0], $$[$0 - 6], $$[$0 - 2], $$[$0 - 4]); break; case 99: yy.commit($$[$0], $$[$0 - 4], $$[$0 - 2], $$[$0 - 6]); break; case 100: yy.commit($$[$0 - 2], $$[$0 - 4], $$[$0], $$[$0 - 6]); break; case 101: yy.commit($$[$0], $$[$0 - 2], $$[$0 - 4], $$[$0 - 6]); break; case 102: yy.commit($$[$0 - 2], $$[$0], $$[$0 - 4], $$[$0 - 6]); break; case 103: yy.commit($$[$0 - 4], $$[$0 - 2], $$[$0], $$[$0 - 6]); break; case 104: yy.commit($$[$0 - 4], $$[$0], $$[$0 - 2], $$[$0 - 6]); break; case 105: yy.commit($$[$0 - 2], $$[$0 - 4], $$[$0 - 6], $$[$0]); break; case 106: yy.commit($$[$0], $$[$0 - 4], $$[$0 - 6], $$[$0 - 2]); break; case 107: yy.commit($$[$0 - 2], $$[$0], $$[$0 - 6], $$[$0 - 4]); break; case 108: yy.commit($$[$0], $$[$0 - 2], $$[$0 - 6], $$[$0 - 4]); break; case 109: yy.commit($$[$0 - 4], $$[$0 - 2], $$[$0 - 6], $$[$0]); break; case 110: yy.commit($$[$0 - 4], $$[$0], $$[$0 - 6], $$[$0 - 2]); break; case 111: this.$ = ""; break; case 112: this.$ = $$[$0]; break; case 113: this.$ = yy.commitType.NORMAL; break; case 114: this.$ = yy.commitType.REVERSE; break; case 115: this.$ = yy.commitType.HIGHLIGHT; break; case 118: yy.parseDirective("%%{", "open_directive"); break; case 119: yy.parseDirective($$[$0], "type_directive"); break; case 120: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], "arg_directive"); break; case 121: yy.parseDirective("}%%", "close_directive", "gitGraph"); break; } }, table: [{ 3: 1, 4: 2, 5: 3, 6: $V0, 8: $V1, 14: $V2, 46: 8, 50: $V3, 54: $V4 }, { 1: [3] }, { 3: 10, 4: 2, 5: 3, 6: $V0, 8: $V1, 14: $V2, 46: 8, 50: $V3, 54: $V4 }, { 3: 11, 4: 2, 5: 3, 6: $V0, 8: $V1, 14: $V2, 46: 8, 50: $V3, 54: $V4 }, { 7: 12, 8: $V5, 9: [1, 13], 10: [1, 14], 11: 15, 14: $V6 }, o($V7, [2, 122]), o($V7, [2, 123]), o($V7, [2, 124]), { 47: 17, 51: [1, 18] }, { 51: [2, 118] }, { 1: [2, 1] }, { 1: [2, 2] }, { 8: [1, 19] }, { 7: 20, 8: $V5, 11: 15, 14: $V6 }, { 9: [1, 21] }, o($V8, [2, 10], { 12: 22, 13: [1, 23] }), o($V9, [2, 9]), { 9: [1, 25], 48: 24, 53: $Va }, o([9, 53], [2, 119]), { 1: [2, 3] }, { 8: [1, 27] }, { 7: 28, 8: $V5, 11: 15, 14: $V6 }, { 8: [2, 7], 14: [1, 31], 15: 29, 16: 30, 17: 32, 18: 33, 19: 34, 20: [1, 35], 22: [1, 36], 24: [1, 37], 25: [1, 38], 26: 39, 27: [1, 40], 29: [1, 44], 32: [1, 43], 37: [1, 42], 40: [1, 41] }, o($V9, [2, 8]), o($Vb, [2, 116]), { 49: 45, 52: [1, 46] }, o($Vb, [2, 121]), { 1: [2, 4] }, { 8: [1, 47] }, o($V8, [2, 11]), { 4: 48, 8: $V1, 14: $V2, 54: $V4 }, o($V8, [2, 13]), o($Vc, [2, 14]), o($Vc, [2, 15]), o($Vc, [2, 16]), { 21: [1, 49] }, { 23: [1, 50] }, o($Vc, [2, 19]), o($Vc, [2, 20]), o($Vc, [2, 21]), { 28: [1, 51] }, o($Vc, [2, 111], { 41: 52, 33: [1, 55], 34: [1, 57], 35: [1, 53], 38: [1, 54], 42: [1, 56] }), { 28: [1, 58] }, { 33: [1, 59], 35: [1, 60] }, { 28: [1, 61] }, { 48: 62, 53: $Va }, { 53: [2, 120] }, { 1: [2, 5] }, o($V8, [2, 12]), o($Vc, [2, 17]), o($Vc, [2, 18]), o($Vc, [2, 22]), o($Vc, [2, 46]), { 34: [1, 63] }, { 39: 64, 43: $Vd, 44: $Ve, 45: $Vf }, { 34: [1, 68] }, { 34: [1, 69] }, o($Vc, [2, 112]), o($Vc, [2, 30], { 33: [1, 70], 35: [1, 72], 38: [1, 71] }), { 34: [1, 73] }, { 34: [1, 74], 36: [1, 75] }, o($Vc, [2, 23], { 30: [1, 76] }), o($Vb, [2, 117]), o($Vc, [2, 47], { 33: [1, 78], 38: [1, 77], 42: [1, 79] }), o($Vc, [2, 48], { 33: [1, 81], 35: [1, 80], 42: [1, 82] }), o($Vg, [2, 113]), o($Vg, [2, 114]), o($Vg, [2, 115]), o($Vc, [2, 51], { 35: [1, 83], 38: [1, 84], 42: [1, 85] }), o($Vc, [2, 62], { 33: [1, 88], 35: [1, 86], 38: [1, 87] }), { 34: [1, 89] }, { 39: 90, 43: $Vd, 44: $Ve, 45: $Vf }, { 34: [1, 91] }, o($Vc, [2, 25], { 35: [1, 92] }), { 33: [1, 93] }, { 33: [1, 94] }, { 31: [1, 95] }, { 39: 96, 43: $Vd, 44: $Ve, 45: $Vf }, { 34: [1, 97] }, { 34: [1, 98] }, { 34: [1, 99] }, { 34: [1, 100] }, { 34: [1, 101] }, { 34: [1, 102] }, { 39: 103, 43: $Vd, 44: $Ve, 45: $Vf }, { 34: [1, 104] }, { 34: [1, 105] }, { 39: 106, 43: $Vd, 44: $Ve, 45: $Vf }, { 34: [1, 107] }, o($Vc, [2, 31], { 35: [1, 109], 38: [1, 108] }), o($Vc, [2, 32], { 33: [1, 111], 35: [1, 110] }), o($Vc, [2, 33], { 33: [1, 112], 38: [1, 113] }), { 34: [1, 114], 36: [1, 115] }, { 34: [1, 116] }, { 34: [1, 117] }, o($Vc, [2, 24]), o($Vc, [2, 49], { 33: [1, 118], 42: [1, 119] }), o($Vc, [2, 53], { 38: [1, 120], 42: [1, 121] }), o($Vc, [2, 63], { 33: [1, 123], 38: [1, 122] }), o($Vc, [2, 50], { 33: [1, 124], 42: [1, 125] }), o($Vc, [2, 55], { 35: [1, 126], 42: [1, 127] }), o($Vc, [2, 66], { 33: [1, 129], 35: [1, 128] }), o($Vc, [2, 52], { 38: [1, 130], 42: [1, 131] }), o($Vc, [2, 54], { 35: [1, 132], 42: [1, 133] }), o($Vc, [2, 67], { 35: [1, 135], 38: [1, 134] }), o($Vc, [2, 64], { 33: [1, 137], 38: [1, 136] }), o($Vc, [2, 65], { 33: [1, 139], 35: [1, 138] }), o($Vc, [2, 68], { 35: [1, 141], 38: [1, 140] }), { 39: 142, 43: $Vd, 44: $Ve, 45: $Vf }, { 34: [1, 143] }, { 34: [1, 144] }, { 34: [1, 145] }, { 34: [1, 146] }, { 39: 147, 43: $Vd, 44: $Ve, 45: $Vf }, o($Vc, [2, 26]), o($Vc, [2, 27]), o($Vc, [2, 28]), o($Vc, [2, 29]), { 34: [1, 148] }, { 34: [1, 149] }, { 39: 150, 43: $Vd, 44: $Ve, 45: $Vf }, { 34: [1, 151] }, { 39: 152, 43: $Vd, 44: $Ve, 45: $Vf }, { 34: [1, 153] }, { 34: [1, 154] }, { 34: [1, 155] }, { 34: [1, 156] }, { 34: [1, 157] }, { 34: [1, 158] }, { 34: [1, 159] }, { 39: 160, 43: $Vd, 44: $Ve, 45: $Vf }, { 34: [1, 161] }, { 34: [1, 162] }, { 34: [1, 163] }, { 39: 164, 43: $Vd, 44: $Ve, 45: $Vf }, { 34: [1, 165] }, { 39: 166, 43: $Vd, 44: $Ve, 45: $Vf }, { 34: [1, 167] }, { 34: [1, 168] }, { 34: [1, 169] }, { 39: 170, 43: $Vd, 44: $Ve, 45: $Vf }, { 34: [1, 171] }, o($Vc, [2, 37], { 35: [1, 172] }), o($Vc, [2, 38], { 38: [1, 173] }), o($Vc, [2, 36], { 33: [1, 174] }), o($Vc, [2, 39], { 35: [1, 175] }), o($Vc, [2, 34], { 38: [1, 176] }), o($Vc, [2, 35], { 33: [1, 177] }), o($Vc, [2, 60], { 42: [1, 178] }), o($Vc, [2, 73], { 33: [1, 179] }), o($Vc, [2, 61], { 42: [1, 180] }), o($Vc, [2, 84], { 38: [1, 181] }), o($Vc, [2, 74], { 33: [1, 182] }), o($Vc, [2, 83], { 38: [1, 183] }), o($Vc, [2, 59], { 42: [1, 184] }), o($Vc, [2, 72], { 33: [1, 185] }), o($Vc, [2, 58], { 42: [1, 186] }), o($Vc, [2, 78], { 35: [1, 187] }), o($Vc, [2, 71], { 33: [1, 188] }), o($Vc, [2, 77], { 35: [1, 189] }), o($Vc, [2, 57], { 42: [1, 190] }), o($Vc, [2, 85], { 38: [1, 191] }), o($Vc, [2, 56], { 42: [1, 192] }), o($Vc, [2, 79], { 35: [1, 193] }), o($Vc, [2, 80], { 35: [1, 194] }), o($Vc, [2, 86], { 38: [1, 195] }), o($Vc, [2, 70], { 33: [1, 196] }), o($Vc, [2, 81], { 38: [1, 197] }), o($Vc, [2, 69], { 33: [1, 198] }), o($Vc, [2, 75], { 35: [1, 199] }), o($Vc, [2, 76], { 35: [1, 200] }), o($Vc, [2, 82], { 38: [1, 201] }), { 34: [1, 202] }, { 39: 203, 43: $Vd, 44: $Ve, 45: $Vf }, { 34: [1, 204] }, { 34: [1, 205] }, { 39: 206, 43: $Vd, 44: $Ve, 45: $Vf }, { 34: [1, 207] }, { 34: [1, 208] }, { 34: [1, 209] }, { 34: [1, 210] }, { 39: 211, 43: $Vd, 44: $Ve, 45: $Vf }, { 34: [1, 212] }, { 39: 213, 43: $Vd, 44: $Ve, 45: $Vf }, { 34: [1, 214] }, { 34: [1, 215] }, { 34: [1, 216] }, { 34: [1, 217] }, { 34: [1, 218] }, { 34: [1, 219] }, { 34: [1, 220] }, { 39: 221, 43: $Vd, 44: $Ve, 45: $Vf }, { 34: [1, 222] }, { 34: [1, 223] }, { 34: [1, 224] }, { 39: 225, 43: $Vd, 44: $Ve, 45: $Vf }, { 34: [1, 226] }, { 39: 227, 43: $Vd, 44: $Ve, 45: $Vf }, { 34: [1, 228] }, { 34: [1, 229] }, { 34: [1, 230] }, { 39: 231, 43: $Vd, 44: $Ve, 45: $Vf }, o($Vc, [2, 40]), o($Vc, [2, 42]), o($Vc, [2, 41]), o($Vc, [2, 43]), o($Vc, [2, 45]), o($Vc, [2, 44]), o($Vc, [2, 101]), o($Vc, [2, 102]), o($Vc, [2, 99]), o($Vc, [2, 100]), o($Vc, [2, 104]), o($Vc, [2, 103]), o($Vc, [2, 108]), o($Vc, [2, 107]), o($Vc, [2, 106]), o($Vc, [2, 105]), o($Vc, [2, 110]), o($Vc, [2, 109]), o($Vc, [2, 98]), o($Vc, [2, 97]), o($Vc, [2, 96]), o($Vc, [2, 95]), o($Vc, [2, 93]), o($Vc, [2, 94]), o($Vc, [2, 92]), o($Vc, [2, 91]), o($Vc, [2, 90]), o($Vc, [2, 89]), o($Vc, [2, 87]), o($Vc, [2, 88])], defaultActions: { 9: [2, 118], 10: [2, 1], 11: [2, 2], 19: [2, 3], 27: [2, 4], 46: [2, 120], 47: [2, 5] }, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse2(input) { var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer2 = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer2.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer2; sharedState.yy.parser = this; if (typeof lexer2.yylloc == "undefined") { lexer2.yylloc = {}; } var yyloc = lexer2.yylloc; lstack.push(yyloc); var ranges = lexer2.options && lexer2.options.ranges; if (typeof sharedState.yy.parseError === "function") { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function lex() { var token; token = tstack.pop() || lexer2.lex() || EOF; if (typeof token !== "number") { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self2.symbols_[token] || token; } return token; } var symbol, state, action, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push("'" + this.terminals_[p] + "'"); } } if (lexer2.showPosition) { errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; } else { errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); } this.parseError(errStr, { text: lexer2.match, token: this.terminals_[symbol] || symbol, line: lexer2.yylineno, loc: yyloc, expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer2.yytext); lstack.push(lexer2.yylloc); stack.push(action[1]); symbol = null; { yyleng = lexer2.yyleng; yytext = lexer2.yytext; yylineno = lexer2.yylineno; yyloc = lexer2.yylloc; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== "undefined") { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; } }; var lexer = function() { var lexer2 = { EOF: 1, parseError: function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, setInput: function(input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; this.yylineno = this.yyleng = 0; this.yytext = this.matched = this.match = ""; this.conditionStack = ["INITIAL"]; this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; if (this.options.ranges) { this.yylloc.range = [0, 0]; } this.offset = 0; return this; }, input: function() { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, unput: function(ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); this.offset -= len; var oldLines = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1); this.matched = this.matched.substr(0, this.matched.length - 1); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, more: function() { this._more = true; return this; }, reject: function() { if (this.options.backtrack_lexer) { this._backtrack = true; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, less: function(n) { this.unput(this.match.slice(n)); }, pastInput: function() { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); }, upcomingInput: function() { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20 - next.length); } return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, ""); }, showPosition: function() { var pre = this.pastInput(); var c2 = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c2 + "^"; }, test_match: function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { backup = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { for (var k in backup) { this[k] = backup[k]; } return false; } return false; }, next: function() { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ""; this.match = ""; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; } else { return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } return false; } if (this._input === "") { return this.EOF; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, lex: function lex() { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, begin: function begin(condition) { this.conditionStack.push(condition); }, popState: function popState() { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, _currentRules: function _currentRules() { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, topState: function topState(n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, pushState: function pushState(condition) { this.begin(condition); }, stateStackSize: function stateStackSize() { return this.conditionStack.length; }, options: { "case-insensitive": true }, performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { switch ($avoiding_name_collisions) { case 0: this.begin("open_directive"); return 50; case 1: this.begin("type_directive"); return 51; case 2: this.popState(); this.begin("arg_directive"); return 9; case 3: this.popState(); this.popState(); return 53; case 4: return 52; case 5: this.begin("acc_title"); return 20; case 6: this.popState(); return "acc_title_value"; case 7: this.begin("acc_descr"); return 22; case 8: this.popState(); return "acc_descr_value"; case 9: this.begin("acc_descr_multiline"); break; case 10: this.popState(); break; case 11: return "acc_descr_multiline_value"; case 12: return 14; case 13: break; case 14: break; case 15: return 6; case 16: return 40; case 17: return 33; case 18: return 38; case 19: return 42; case 20: return 43; case 21: return 44; case 22: return 45; case 23: return 35; case 24: return 29; case 25: return 30; case 26: return 37; case 27: return 32; case 28: return 27; case 29: return 10; case 30: return 10; case 31: return 9; case 32: return "CARET"; case 33: this.begin("options"); break; case 34: this.popState(); break; case 35: return 13; case 36: return 36; case 37: this.begin("string"); break; case 38: this.popState(); break; case 39: return 34; case 40: return 31; case 41: return 28; case 42: return 8; } }, rules: [/^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:(\r?\n)+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:gitGraph\b)/i, /^(?:commit(?=\s|$))/i, /^(?:id:)/i, /^(?:type:)/i, /^(?:msg:)/i, /^(?:NORMAL\b)/i, /^(?:REVERSE\b)/i, /^(?:HIGHLIGHT\b)/i, /^(?:tag:)/i, /^(?:branch(?=\s|$))/i, /^(?:order:)/i, /^(?:merge(?=\s|$))/i, /^(?:cherry-pick(?=\s|$))/i, /^(?:checkout(?=\s|$))/i, /^(?:LR\b)/i, /^(?:BT\b)/i, /^(?::)/i, /^(?:\^)/i, /^(?:options\r?\n)/i, /^(?:[ \r\n\t]+end\b)/i, /^(?:[\s\S]+(?=[ \r\n\t]+end))/i, /^(?:["]["])/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[0-9]+(?=\s|$))/i, /^(?:\w([-\./\w]*[-\w])?)/i, /^(?:$)/i, /^(?:\s+)/i], conditions: { "acc_descr_multiline": { "rules": [10, 11], "inclusive": false }, "acc_descr": { "rules": [8], "inclusive": false }, "acc_title": { "rules": [6], "inclusive": false }, "close_directive": { "rules": [], "inclusive": false }, "arg_directive": { "rules": [3, 4], "inclusive": false }, "type_directive": { "rules": [2, 3], "inclusive": false }, "open_directive": { "rules": [1], "inclusive": false }, "options": { "rules": [34, 35], "inclusive": false }, "string": { "rules": [38, 39], "inclusive": false }, "INITIAL": { "rules": [0, 5, 7, 9, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 36, 37, 40, 41, 42, 43], "inclusive": true } } }; return lexer2; }(); parser2.lexer = lexer; function Parser() { this.yy = {}; } Parser.prototype = parser2; parser2.Parser = Parser; return new Parser(); }(); parser$b.parser = parser$b; const gitGraphDetector = (txt) => { return txt.match(/^\s*gitGraph/) !== null; }; let title$1 = ""; let diagramTitle = ""; let description = ""; const sanitizeText$3 = (txt) => sanitizeText$5(txt, getConfig$1()); const clear$g = function() { title$1 = ""; description = ""; diagramTitle = ""; }; const setAccTitle = function(txt) { title$1 = sanitizeText$3(txt).replace(/^\s+/g, ""); }; const getAccTitle = function() { return title$1 || diagramTitle; }; const setAccDescription = function(txt) { description = sanitizeText$3(txt).replace(/\n\s+/g, "\n"); }; const getAccDescription = function() { return description; }; const setDiagramTitle = function(txt) { diagramTitle = sanitizeText$3(txt); }; const getDiagramTitle = function() { return diagramTitle; }; let mainBranchName = getConfig$1().gitGraph.mainBranchName; let mainBranchOrder = getConfig$1().gitGraph.mainBranchOrder; let commits = {}; let head = null; let branchesConfig = {}; branchesConfig[mainBranchName] = { name: mainBranchName, order: mainBranchOrder }; let branches = {}; branches[mainBranchName] = head; let curBranch = mainBranchName; let direction$3 = "LR"; let seq = 0; function getId() { return random({ length: 7 }); } const parseDirective$b = function(statement, context, type2) { mermaidAPI.parseDirective(this, statement, context, type2); }; function uniqBy(list, fn) { const recordMap = /* @__PURE__ */ Object.create(null); return list.reduce((out, item) => { const key = fn(item); if (!recordMap[key]) { recordMap[key] = true; out.push(item); } return out; }, []); } const setDirection$3 = function(dir) { direction$3 = dir; }; let options = {}; const setOptions = function(rawOptString) { log$1.debug("options str", rawOptString); rawOptString = rawOptString && rawOptString.trim(); rawOptString = rawOptString || "{}"; try { options = JSON.parse(rawOptString); } catch (e) { log$1.error("error while parsing gitGraph options", e.message); } }; const getOptions = function() { return options; }; const commit = function(msg, id, type2, tag) { log$1.debug("Entering commit:", msg, id, type2, tag); id = common.sanitizeText(id, getConfig$1()); msg = common.sanitizeText(msg, getConfig$1()); tag = common.sanitizeText(tag, getConfig$1()); const commit2 = { id: id ? id : seq + "-" + getId(), message: msg, seq: seq++, type: type2 ? type2 : commitType$1.NORMAL, tag: tag ? tag : "", parents: head == null ? [] : [head.id], branch: curBranch }; head = commit2; commits[commit2.id] = commit2; branches[curBranch] = commit2.id; log$1.debug("in pushCommit " + commit2.id); }; const branch = function(name2, order) { name2 = common.sanitizeText(name2, getConfig$1()); if (typeof branches[name2] === "undefined") { branches[name2] = head != null ? head.id : null; branchesConfig[name2] = { name: name2, order: order ? parseInt(order, 10) : null }; checkout(name2); log$1.debug("in createBranch"); } else { let error = new Error( 'Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ' + name2 + '")' ); error.hash = { text: "branch " + name2, token: "branch " + name2, line: "1", loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, expected: ['"checkout ' + name2 + '"'] }; throw error; } }; const merge = function(otherBranch, custom_id, override_type, custom_tag) { otherBranch = common.sanitizeText(otherBranch, getConfig$1()); custom_id = common.sanitizeText(custom_id, getConfig$1()); const currentCommit = commits[branches[curBranch]]; const otherCommit = commits[branches[otherBranch]]; if (curBranch === otherBranch) { let error = new Error('Incorrect usage of "merge". Cannot merge a branch to itself'); error.hash = { text: "merge " + otherBranch, token: "merge " + otherBranch, line: "1", loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, expected: ["branch abc"] }; throw error; } else if (typeof currentCommit === "undefined" || !currentCommit) { let error = new Error( 'Incorrect usage of "merge". Current branch (' + curBranch + ")has no commits" ); error.hash = { text: "merge " + otherBranch, token: "merge " + otherBranch, line: "1", loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, expected: ["commit"] }; throw error; } else if (typeof branches[otherBranch] === "undefined") { let error = new Error( 'Incorrect usage of "merge". Branch to be merged (' + otherBranch + ") does not exist" ); error.hash = { text: "merge " + otherBranch, token: "merge " + otherBranch, line: "1", loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, expected: ["branch " + otherBranch] }; throw error; } else if (typeof otherCommit === "undefined" || !otherCommit) { let error = new Error( 'Incorrect usage of "merge". Branch to be merged (' + otherBranch + ") has no commits" ); error.hash = { text: "merge " + otherBranch, token: "merge " + otherBranch, line: "1", loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, expected: ['"commit"'] }; throw error; } else if (currentCommit === otherCommit) { let error = new Error('Incorrect usage of "merge". Both branches have same head'); error.hash = { text: "merge " + otherBranch, token: "merge " + otherBranch, line: "1", loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, expected: ["branch abc"] }; throw error; } else if (custom_id && typeof commits[custom_id] !== "undefined") { let error = new Error( 'Incorrect usage of "merge". Commit with id:' + custom_id + " already exists, use different custom Id" ); error.hash = { text: "merge " + otherBranch + custom_id + override_type + custom_tag, token: "merge " + otherBranch + custom_id + override_type + custom_tag, line: "1", loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, expected: [ "merge " + otherBranch + " " + custom_id + "_UNIQUE " + override_type + " " + custom_tag ] }; throw error; } const commit2 = { id: custom_id ? custom_id : seq + "-" + getId(), message: "merged branch " + otherBranch + " into " + curBranch, seq: seq++, parents: [head == null ? null : head.id, branches[otherBranch]], branch: curBranch, type: commitType$1.MERGE, customType: override_type, customId: custom_id ? true : false, tag: custom_tag ? custom_tag : "" }; head = commit2; commits[commit2.id] = commit2; branches[curBranch] = commit2.id; log$1.debug(branches); log$1.debug("in mergeBranch"); }; const cherryPick = function(sourceId, targetId, tag) { log$1.debug("Entering cherryPick:", sourceId, targetId, tag); sourceId = common.sanitizeText(sourceId, getConfig$1()); targetId = common.sanitizeText(targetId, getConfig$1()); tag = common.sanitizeText(tag, getConfig$1()); if (!sourceId || typeof commits[sourceId] === "undefined") { let error = new Error( 'Incorrect usage of "cherryPick". Source commit id should exist and provided' ); error.hash = { text: "cherryPick " + sourceId + " " + targetId, token: "cherryPick " + sourceId + " " + targetId, line: "1", loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, expected: ["cherry-pick abc"] }; throw error; } let sourceCommit = commits[sourceId]; let sourceCommitBranch = sourceCommit.branch; if (sourceCommit.type === commitType$1.MERGE) { let error = new Error( 'Incorrect usage of "cherryPick". Source commit should not be a merge commit' ); error.hash = { text: "cherryPick " + sourceId + " " + targetId, token: "cherryPick " + sourceId + " " + targetId, line: "1", loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, expected: ["cherry-pick abc"] }; throw error; } if (!targetId || typeof commits[targetId] === "undefined") { if (sourceCommitBranch === curBranch) { let error = new Error( 'Incorrect usage of "cherryPick". Source commit is already on current branch' ); error.hash = { text: "cherryPick " + sourceId + " " + targetId, token: "cherryPick " + sourceId + " " + targetId, line: "1", loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, expected: ["cherry-pick abc"] }; throw error; } const currentCommit = commits[branches[curBranch]]; if (typeof currentCommit === "undefined" || !currentCommit) { let error = new Error( 'Incorrect usage of "cherry-pick". Current branch (' + curBranch + ")has no commits" ); error.hash = { text: "cherryPick " + sourceId + " " + targetId, token: "cherryPick " + sourceId + " " + targetId, line: "1", loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, expected: ["cherry-pick abc"] }; throw error; } const commit2 = { id: seq + "-" + getId(), message: "cherry-picked " + sourceCommit + " into " + curBranch, seq: seq++, parents: [head == null ? null : head.id, sourceCommit.id], branch: curBranch, type: commitType$1.CHERRY_PICK, tag: tag != null ? tag : "cherry-pick:" + sourceCommit.id }; head = commit2; commits[commit2.id] = commit2; branches[curBranch] = commit2.id; log$1.debug(branches); log$1.debug("in cherryPick"); } }; const checkout = function(branch2) { branch2 = common.sanitizeText(branch2, getConfig$1()); if (typeof branches[branch2] === "undefined") { let error = new Error( 'Trying to checkout branch which is not yet created. (Help try using "branch ' + branch2 + '")' ); error.hash = { text: "checkout " + branch2, token: "checkout " + branch2, line: "1", loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, expected: ['"branch ' + branch2 + '"'] }; throw error; } else { curBranch = branch2; const id = branches[curBranch]; head = commits[id]; } }; function upsert(arr, key, newval) { const index = arr.indexOf(key); if (index === -1) { arr.push(newval); } else { arr.splice(index, 1, newval); } } function prettyPrintCommitHistory(commitArr) { const commit2 = commitArr.reduce((out, commit3) => { if (out.seq > commit3.seq) return out; return commit3; }, commitArr[0]); let line2 = ""; commitArr.forEach(function(c2) { if (c2 === commit2) { line2 += " *"; } else { line2 += " |"; } }); const label = [line2, commit2.id, commit2.seq]; for (let branch2 in branches) { if (branches[branch2] === commit2.id) label.push(branch2); } log$1.debug(label.join(" ")); if (commit2.parents && commit2.parents.length == 2) { const newCommit = commits[commit2.parents[0]]; upsert(commitArr, commit2, newCommit); commitArr.push(commits[commit2.parents[1]]); } else if (commit2.parents.length == 0) { return; } else { const nextCommit = commits[commit2.parents]; upsert(commitArr, commit2, nextCommit); } commitArr = uniqBy(commitArr, (c2) => c2.id); prettyPrintCommitHistory(commitArr); } const prettyPrint = function() { log$1.debug(commits); const node = getCommitsArray()[0]; prettyPrintCommitHistory([node]); }; const clear$f = function() { commits = {}; head = null; let mainBranch = getConfig$1().gitGraph.mainBranchName; let mainBranchOrder2 = getConfig$1().gitGraph.mainBranchOrder; branches = {}; branches[mainBranch] = null; branchesConfig = {}; branchesConfig[mainBranch] = { name: mainBranch, order: mainBranchOrder2 }; curBranch = mainBranch; seq = 0; clear$g(); }; const getBranchesAsObjArray = function() { const branchesArray = Object.values(branchesConfig).map((branchConfig, i) => { if (branchConfig.order !== null) return branchConfig; return { ...branchConfig, order: parseFloat(`0.${i}`, 10) }; }).sort((a, b) => a.order - b.order).map(({ name: name2 }) => ({ name: name2 })); return branchesArray; }; const getBranches = function() { return branches; }; const getCommits = function() { return commits; }; const getCommitsArray = function() { const commitArr = Object.keys(commits).map(function(key) { return commits[key]; }); commitArr.forEach(function(o) { log$1.debug(o.id); }); commitArr.sort((a, b) => a.seq - b.seq); return commitArr; }; const getCurrentBranch = function() { return curBranch; }; const getDirection$3 = function() { return direction$3; }; const getHead = function() { return head; }; const commitType$1 = { NORMAL: 0, REVERSE: 1, HIGHLIGHT: 2, MERGE: 3, CHERRY_PICK: 4 }; const gitGraphDb = { parseDirective: parseDirective$b, getConfig: () => getConfig$1().gitGraph, setDirection: setDirection$3, setOptions, getOptions, commit, branch, merge, cherryPick, checkout, prettyPrint, clear: clear$f, getBranchesAsObjArray, getBranches, getCommits, getCommitsArray, getCurrentBranch, getDirection: getDirection$3, getHead, setAccTitle, getAccTitle, getAccDescription, setAccDescription, commitType: commitType$1 }; function addSVGAccessibilityFields(yy_parser, svg, id) { if (typeof svg.insert === "undefined") { return; } let title_string = yy_parser.getAccTitle(); let description2 = yy_parser.getAccDescription(); svg.attr("role", "img").attr("aria-labelledby", "chart-title-" + id + " chart-desc-" + id); svg.insert("desc", ":first-child").attr("id", "chart-desc-" + id).text(description2); svg.insert("title", ":first-child").attr("id", "chart-title-" + id).text(title_string); } let allCommitsDict = {}; const commitType = { NORMAL: 0, REVERSE: 1, HIGHLIGHT: 2, MERGE: 3, CHERRY_PICK: 4 }; const THEME_COLOR_LIMIT = 8; let branchPos = {}; let commitPos = {}; let lanes = []; let maxPos = 0; const clear$e = () => { branchPos = {}; commitPos = {}; allCommitsDict = {}; maxPos = 0; lanes = []; }; const drawText$3 = (txt) => { const svgLabel = document.createElementNS("http://www.w3.org/2000/svg", "text"); let rows = []; if (typeof txt === "string") { rows = txt.split(/\\n|\n|/gi); } else if (Array.isArray(txt)) { rows = txt; } else { rows = []; } for (let j = 0; j < rows.length; j++) { const tspan = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"); tspan.setAttribute("dy", "1em"); tspan.setAttribute("x", "0"); tspan.setAttribute("class", "row"); tspan.textContent = rows[j].trim(); svgLabel.appendChild(tspan); } return svgLabel; }; const drawCommits = (svg, commits2, modifyGraph) => { const gitGraphConfig = getConfig().gitGraph; const gBullets = svg.append("g").attr("class", "commit-bullets"); const gLabels = svg.append("g").attr("class", "commit-labels"); let pos = 0; const keys = Object.keys(commits2); const sortedKeys = keys.sort((a, b) => { return commits2[a].seq - commits2[b].seq; }); sortedKeys.forEach((key) => { const commit2 = commits2[key]; const y = branchPos[commit2.branch].pos; const x = pos + 10; if (modifyGraph) { let typeClass; let commitSymbolType = typeof commit2.customType !== "undefined" && commit2.customType !== "" ? commit2.customType : commit2.type; switch (commitSymbolType) { case commitType.NORMAL: typeClass = "commit-normal"; break; case commitType.REVERSE: typeClass = "commit-reverse"; break; case commitType.HIGHLIGHT: typeClass = "commit-highlight"; break; case commitType.MERGE: typeClass = "commit-merge"; break; case commitType.CHERRY_PICK: typeClass = "commit-cherry-pick"; break; default: typeClass = "commit-normal"; } if (commitSymbolType === commitType.HIGHLIGHT) { const circle2 = gBullets.append("rect"); circle2.attr("x", x - 10); circle2.attr("y", y - 10); circle2.attr("height", 20); circle2.attr("width", 20); circle2.attr( "class", `commit ${commit2.id} commit-highlight${branchPos[commit2.branch].index % THEME_COLOR_LIMIT} ${typeClass}-outer` ); gBullets.append("rect").attr("x", x - 6).attr("y", y - 6).attr("height", 12).attr("width", 12).attr( "class", `commit ${commit2.id} commit${branchPos[commit2.branch].index % THEME_COLOR_LIMIT} ${typeClass}-inner` ); } else if (commitSymbolType === commitType.CHERRY_PICK) { gBullets.append("circle").attr("cx", x).attr("cy", y).attr("r", 10).attr("class", `commit ${commit2.id} ${typeClass}`); gBullets.append("circle").attr("cx", x - 3).attr("cy", y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${commit2.id} ${typeClass}`); gBullets.append("circle").attr("cx", x + 3).attr("cy", y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${commit2.id} ${typeClass}`); gBullets.append("line").attr("x1", x + 3).attr("y1", y + 1).attr("x2", x).attr("y2", y - 5).attr("stroke", "#fff").attr("class", `commit ${commit2.id} ${typeClass}`); gBullets.append("line").attr("x1", x - 3).attr("y1", y + 1).attr("x2", x).attr("y2", y - 5).attr("stroke", "#fff").attr("class", `commit ${commit2.id} ${typeClass}`); } else { const circle2 = gBullets.append("circle"); circle2.attr("cx", x); circle2.attr("cy", y); circle2.attr("r", commit2.type === commitType.MERGE ? 9 : 10); circle2.attr( "class", `commit ${commit2.id} commit${branchPos[commit2.branch].index % THEME_COLOR_LIMIT}` ); if (commitSymbolType === commitType.MERGE) { const circle22 = gBullets.append("circle"); circle22.attr("cx", x); circle22.attr("cy", y); circle22.attr("r", 6); circle22.attr( "class", `commit ${typeClass} ${commit2.id} commit${branchPos[commit2.branch].index % THEME_COLOR_LIMIT}` ); } if (commitSymbolType === commitType.REVERSE) { const cross2 = gBullets.append("path"); cross2.attr("d", `M ${x - 5},${y - 5}L${x + 5},${y + 5}M${x - 5},${y + 5}L${x + 5},${y - 5}`).attr( "class", `commit ${typeClass} ${commit2.id} commit${branchPos[commit2.branch].index % THEME_COLOR_LIMIT}` ); } } } commitPos[commit2.id] = { x: pos + 10, y }; if (modifyGraph) { const px = 4; const py = 2; if (commit2.type !== commitType.CHERRY_PICK && (commit2.customId && commit2.type === commitType.MERGE || commit2.type !== commitType.MERGE) && gitGraphConfig.showCommitLabel) { const wrapper = gLabels.append("g"); const labelBkg = wrapper.insert("rect").attr("class", "commit-label-bkg"); const text = wrapper.append("text").attr("x", pos).attr("y", y + 25).attr("class", "commit-label").text(commit2.id); let bbox = text.node().getBBox(); labelBkg.attr("x", pos + 10 - bbox.width / 2 - py).attr("y", y + 13.5).attr("width", bbox.width + 2 * py).attr("height", bbox.height + 2 * py); text.attr("x", pos + 10 - bbox.width / 2); if (gitGraphConfig.rotateCommitLabel) { let r_x = -7.5 - (bbox.width + 10) / 25 * 9.5; let r_y = 10 + bbox.width / 25 * 8.5; wrapper.attr( "transform", "translate(" + r_x + ", " + r_y + ") rotate(" + -45 + ", " + pos + ", " + y + ")" ); } } if (commit2.tag) { const rect2 = gLabels.insert("polygon"); const hole = gLabels.append("circle"); const tag = gLabels.append("text").attr("y", y - 16).attr("class", "tag-label").text(commit2.tag); let tagBbox = tag.node().getBBox(); tag.attr("x", pos + 10 - tagBbox.width / 2); const h2 = tagBbox.height / 2; const ly = y - 19.2; rect2.attr("class", "tag-label-bkg").attr( "points", ` ${pos - tagBbox.width / 2 - px / 2},${ly + py} ${pos - tagBbox.width / 2 - px / 2},${ly - py} ${pos + 10 - tagBbox.width / 2 - px},${ly - h2 - py} ${pos + 10 + tagBbox.width / 2 + px},${ly - h2 - py} ${pos + 10 + tagBbox.width / 2 + px},${ly + h2 + py} ${pos + 10 - tagBbox.width / 2 - px},${ly + h2 + py}` ); hole.attr("cx", pos - tagBbox.width / 2 + px / 2).attr("cy", ly).attr("r", 1.5).attr("class", "tag-hole"); } } pos += 50; if (pos > maxPos) { maxPos = pos; } }); }; const hasOverlappingCommits = (commit1, commit2, allCommits) => { const keys = Object.keys(allCommits); const overlappingComits = keys.filter((key) => { return allCommits[key].branch === commit2.branch && allCommits[key].seq > commit1.seq && allCommits[key].seq < commit2.seq; }); return overlappingComits.length > 0; }; const findLane = (y1, y2, _depth) => { const depth = _depth || 0; const candidate = y1 + Math.abs(y1 - y2) / 2; if (depth > 5) { return candidate; } let ok = true; for (let i = 0; i < lanes.length; i++) { if (Math.abs(lanes[i] - candidate) < 10) { ok = false; } } if (ok) { lanes.push(candidate); return candidate; } const diff = Math.abs(y1 - y2); return findLane(y1, y2 - diff / 5, depth + 1); }; const drawArrow = (svg, commit1, commit2, allCommits) => { const p1 = commitPos[commit1.id]; const p2 = commitPos[commit2.id]; const overlappingCommits = hasOverlappingCommits(commit1, commit2, allCommits); let arc2 = ""; let arc22 = ""; let radius = 0; let offset = 0; let colorClassNum = branchPos[commit2.branch].index; let lineDef; if (overlappingCommits) { arc2 = "A 10 10, 0, 0, 0,"; arc22 = "A 10 10, 0, 0, 1,"; radius = 10; offset = 10; colorClassNum = branchPos[commit2.branch].index; const lineY = p1.y < p2.y ? findLane(p1.y, p2.y) : findLane(p2.y, p1.y); if (p1.y < p2.y) { lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${lineY - radius} ${arc2} ${p1.x + offset} ${lineY} L ${p2.x - radius} ${lineY} ${arc22} ${p2.x} ${lineY + offset} L ${p2.x} ${p2.y}`; } else { lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${lineY + radius} ${arc22} ${p1.x + offset} ${lineY} L ${p2.x - radius} ${lineY} ${arc2} ${p2.x} ${lineY - offset} L ${p2.x} ${p2.y}`; } } else { if (p1.y < p2.y) { arc2 = "A 20 20, 0, 0, 0,"; radius = 20; offset = 20; colorClassNum = branchPos[commit2.branch].index; lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${p2.y - radius} ${arc2} ${p1.x + offset} ${p2.y} L ${p2.x} ${p2.y}`; } if (p1.y > p2.y) { arc2 = "A 20 20, 0, 0, 0,"; radius = 20; offset = 20; colorClassNum = branchPos[commit1.branch].index; lineDef = `M ${p1.x} ${p1.y} L ${p2.x - radius} ${p1.y} ${arc2} ${p2.x} ${p1.y - offset} L ${p2.x} ${p2.y}`; } if (p1.y === p2.y) { colorClassNum = branchPos[commit1.branch].index; lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${p2.y - radius} ${arc2} ${p1.x + offset} ${p2.y} L ${p2.x} ${p2.y}`; } } svg.append("path").attr("d", lineDef).attr("class", "arrow arrow" + colorClassNum % THEME_COLOR_LIMIT); }; const drawArrows = (svg, commits2) => { const gArrows = svg.append("g").attr("class", "commit-arrows"); Object.keys(commits2).forEach((key) => { const commit2 = commits2[key]; if (commit2.parents && commit2.parents.length > 0) { commit2.parents.forEach((parent) => { drawArrow(gArrows, commits2[parent], commit2, commits2); }); } }); }; const drawBranches = (svg, branches2) => { const gitGraphConfig = getConfig().gitGraph; const g = svg.append("g"); branches2.forEach((branch2, index) => { const adjustIndexForTheme = index % THEME_COLOR_LIMIT; const pos = branchPos[branch2.name].pos; const line2 = g.append("line"); line2.attr("x1", 0); line2.attr("y1", pos); line2.attr("x2", maxPos); line2.attr("y2", pos); line2.attr("class", "branch branch" + adjustIndexForTheme); lanes.push(pos); let name2 = branch2.name; const labelElement = drawText$3(name2); const bkg = g.insert("rect"); const branchLabel = g.insert("g").attr("class", "branchLabel"); const label = branchLabel.insert("g").attr("class", "label branch-label" + adjustIndexForTheme); label.node().appendChild(labelElement); let bbox = labelElement.getBBox(); bkg.attr("class", "branchLabelBkg label" + adjustIndexForTheme).attr("rx", 4).attr("ry", 4).attr("x", -bbox.width - 4 - (gitGraphConfig.rotateCommitLabel === true ? 30 : 0)).attr("y", -bbox.height / 2 + 8).attr("width", bbox.width + 18).attr("height", bbox.height + 4); label.attr( "transform", "translate(" + (-bbox.width - 14 - (gitGraphConfig.rotateCommitLabel === true ? 30 : 0)) + ", " + (pos - bbox.height / 2 - 1) + ")" ); bkg.attr("transform", "translate(" + -19 + ", " + (pos - bbox.height / 2) + ")"); }); }; const draw$f = function(txt, id, ver, diagObj) { clear$e(); const conf2 = getConfig(); const gitGraphConfig = getConfig().gitGraph; log$1.debug("in gitgraph renderer", txt + "\n", "id:", id, ver); allCommitsDict = diagObj.db.getCommits(); const branches2 = diagObj.db.getBranchesAsObjArray(); let pos = 0; branches2.forEach((branch2, index) => { branchPos[branch2.name] = { pos, index }; pos += 50 + (gitGraphConfig.rotateCommitLabel ? 40 : 0); }); const diagram = select(`[id="${id}"]`); addSVGAccessibilityFields(diagObj.db, diagram, id); drawCommits(diagram, allCommitsDict, false); if (gitGraphConfig.showBranches) { drawBranches(diagram, branches2); } drawArrows(diagram, allCommitsDict); drawCommits(diagram, allCommitsDict, true); setupGraphViewbox(void 0, diagram, gitGraphConfig.diagramPadding, conf2.useMaxWidth); }; const gitGraphRenderer = { draw: draw$f }; const getStyles = (options2) => ` .commit-id, .commit-msg, .branch-label { fill: lightgrey; color: lightgrey; font-family: 'trebuchet ms', verdana, arial, sans-serif; font-family: var(--mermaid-font-family); } ${[0, 1, 2, 3, 4, 5, 6, 7].map( (i) => ` .branch-label${i} { fill: ${options2["gitBranchLabel" + i]}; } .commit${i} { stroke: ${options2["git" + i]}; fill: ${options2["git" + i]}; } .commit-highlight${i} { stroke: ${options2["gitInv" + i]}; fill: ${options2["gitInv" + i]}; } .label${i} { fill: ${options2["git" + i]}; } .arrow${i} { stroke: ${options2["git" + i]}; } ` ).join("\n")} .branch { stroke-width: 1; stroke: ${options2.lineColor}; stroke-dasharray: 2; } .commit-label { font-size: ${options2.commitLabelFontSize}; fill: ${options2.commitLabelColor};} .commit-label-bkg { font-size: ${options2.commitLabelFontSize}; fill: ${options2.commitLabelBackground}; opacity: 0.5; } .tag-label { font-size: ${options2.tagLabelFontSize}; fill: ${options2.tagLabelColor};} .tag-label-bkg { fill: ${options2.tagLabelBackground}; stroke: ${options2.tagLabelBorder}; } .tag-hole { fill: ${options2.textColor}; } .commit-merge { stroke: ${options2.primaryColor}; fill: ${options2.primaryColor}; } .commit-reverse { stroke: ${options2.primaryColor}; fill: ${options2.primaryColor}; stroke-width: 3; } .commit-highlight-outer { } .commit-highlight-inner { stroke: ${options2.primaryColor}; fill: ${options2.primaryColor}; } .arrow { stroke-width: 8; stroke-linecap: round; fill: none} } `; var parser$a = function() { var o = function(k, v, o2, l) { for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ; return o2; }, $V0 = [1, 6], $V1 = [1, 7], $V2 = [1, 8], $V3 = [1, 9], $V4 = [1, 16], $V5 = [1, 11], $V6 = [1, 12], $V7 = [1, 13], $V8 = [1, 14], $V9 = [1, 15], $Va = [1, 27], $Vb = [1, 33], $Vc = [1, 34], $Vd = [1, 35], $Ve = [1, 36], $Vf = [1, 37], $Vg = [1, 72], $Vh = [1, 73], $Vi = [1, 74], $Vj = [1, 75], $Vk = [1, 76], $Vl = [1, 77], $Vm = [1, 78], $Vn = [1, 38], $Vo = [1, 39], $Vp = [1, 40], $Vq = [1, 41], $Vr = [1, 42], $Vs = [1, 43], $Vt = [1, 44], $Vu = [1, 45], $Vv = [1, 46], $Vw = [1, 47], $Vx = [1, 48], $Vy = [1, 49], $Vz = [1, 50], $VA = [1, 51], $VB = [1, 52], $VC = [1, 53], $VD = [1, 54], $VE = [1, 55], $VF = [1, 56], $VG = [1, 57], $VH = [1, 59], $VI = [1, 60], $VJ = [1, 61], $VK = [1, 62], $VL = [1, 63], $VM = [1, 64], $VN = [1, 65], $VO = [1, 66], $VP = [1, 67], $VQ = [1, 68], $VR = [1, 69], $VS = [24, 52], $VT = [24, 44, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84], $VU = [15, 24, 44, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84], $VV = [1, 94], $VW = [1, 95], $VX = [1, 96], $VY = [1, 97], $VZ = [15, 24, 52], $V_ = [7, 8, 9, 10, 18, 22, 25, 26, 27, 28], $V$ = [15, 24, 43, 52], $V01 = [15, 24, 43, 52, 86, 87, 89, 90], $V11 = [15, 43], $V21 = [44, 46, 47, 48, 49, 50, 51, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84]; var parser2 = { trace: function trace() { }, yy: {}, symbols_: { "error": 2, "start": 3, "mermaidDoc": 4, "direction": 5, "directive": 6, "direction_tb": 7, "direction_bt": 8, "direction_rl": 9, "direction_lr": 10, "graphConfig": 11, "openDirective": 12, "typeDirective": 13, "closeDirective": 14, "NEWLINE": 15, ":": 16, "argDirective": 17, "open_directive": 18, "type_directive": 19, "arg_directive": 20, "close_directive": 21, "C4_CONTEXT": 22, "statements": 23, "EOF": 24, "C4_CONTAINER": 25, "C4_COMPONENT": 26, "C4_DYNAMIC": 27, "C4_DEPLOYMENT": 28, "otherStatements": 29, "diagramStatements": 30, "otherStatement": 31, "title": 32, "accDescription": 33, "acc_title": 34, "acc_title_value": 35, "acc_descr": 36, "acc_descr_value": 37, "acc_descr_multiline_value": 38, "boundaryStatement": 39, "boundaryStartStatement": 40, "boundaryStopStatement": 41, "boundaryStart": 42, "LBRACE": 43, "ENTERPRISE_BOUNDARY": 44, "attributes": 45, "SYSTEM_BOUNDARY": 46, "BOUNDARY": 47, "CONTAINER_BOUNDARY": 48, "NODE": 49, "NODE_L": 50, "NODE_R": 51, "RBRACE": 52, "diagramStatement": 53, "PERSON": 54, "PERSON_EXT": 55, "SYSTEM": 56, "SYSTEM_DB": 57, "SYSTEM_QUEUE": 58, "SYSTEM_EXT": 59, "SYSTEM_EXT_DB": 60, "SYSTEM_EXT_QUEUE": 61, "CONTAINER": 62, "CONTAINER_DB": 63, "CONTAINER_QUEUE": 64, "CONTAINER_EXT": 65, "CONTAINER_EXT_DB": 66, "CONTAINER_EXT_QUEUE": 67, "COMPONENT": 68, "COMPONENT_DB": 69, "COMPONENT_QUEUE": 70, "COMPONENT_EXT": 71, "COMPONENT_EXT_DB": 72, "COMPONENT_EXT_QUEUE": 73, "REL": 74, "BIREL": 75, "REL_U": 76, "REL_D": 77, "REL_L": 78, "REL_R": 79, "REL_B": 80, "REL_INDEX": 81, "UPDATE_EL_STYLE": 82, "UPDATE_REL_STYLE": 83, "UPDATE_LAYOUT_CONFIG": 84, "attribute": 85, "STR": 86, "STR_KEY": 87, "STR_VALUE": 88, "ATTRIBUTE": 89, "ATTRIBUTE_EMPTY": 90, "$accept": 0, "$end": 1 }, terminals_: { 2: "error", 7: "direction_tb", 8: "direction_bt", 9: "direction_rl", 10: "direction_lr", 15: "NEWLINE", 16: ":", 18: "open_directive", 19: "type_directive", 20: "arg_directive", 21: "close_directive", 22: "C4_CONTEXT", 24: "EOF", 25: "C4_CONTAINER", 26: "C4_COMPONENT", 27: "C4_DYNAMIC", 28: "C4_DEPLOYMENT", 32: "title", 33: "accDescription", 34: "acc_title", 35: "acc_title_value", 36: "acc_descr", 37: "acc_descr_value", 38: "acc_descr_multiline_value", 43: "LBRACE", 44: "ENTERPRISE_BOUNDARY", 46: "SYSTEM_BOUNDARY", 47: "BOUNDARY", 48: "CONTAINER_BOUNDARY", 49: "NODE", 50: "NODE_L", 51: "NODE_R", 52: "RBRACE", 54: "PERSON", 55: "PERSON_EXT", 56: "SYSTEM", 57: "SYSTEM_DB", 58: "SYSTEM_QUEUE", 59: "SYSTEM_EXT", 60: "SYSTEM_EXT_DB", 61: "SYSTEM_EXT_QUEUE", 62: "CONTAINER", 63: "CONTAINER_DB", 64: "CONTAINER_QUEUE", 65: "CONTAINER_EXT", 66: "CONTAINER_EXT_DB", 67: "CONTAINER_EXT_QUEUE", 68: "COMPONENT", 69: "COMPONENT_DB", 70: "COMPONENT_QUEUE", 71: "COMPONENT_EXT", 72: "COMPONENT_EXT_DB", 73: "COMPONENT_EXT_QUEUE", 74: "REL", 75: "BIREL", 76: "REL_U", 77: "REL_D", 78: "REL_L", 79: "REL_R", 80: "REL_B", 81: "REL_INDEX", 82: "UPDATE_EL_STYLE", 83: "UPDATE_REL_STYLE", 84: "UPDATE_LAYOUT_CONFIG", 86: "STR", 87: "STR_KEY", 88: "STR_VALUE", 89: "ATTRIBUTE", 90: "ATTRIBUTE_EMPTY" }, productions_: [0, [3, 1], [3, 1], [3, 2], [5, 1], [5, 1], [5, 1], [5, 1], [4, 1], [6, 4], [6, 6], [12, 1], [13, 1], [17, 1], [14, 1], [11, 4], [11, 4], [11, 4], [11, 4], [11, 4], [23, 1], [23, 1], [23, 2], [29, 1], [29, 2], [29, 3], [31, 1], [31, 1], [31, 2], [31, 2], [31, 1], [39, 3], [40, 3], [40, 3], [40, 4], [42, 2], [42, 2], [42, 2], [42, 2], [42, 2], [42, 2], [42, 2], [41, 1], [30, 1], [30, 2], [30, 3], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 1], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [53, 2], [45, 1], [45, 2], [85, 1], [85, 2], [85, 1], [85, 1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { var $0 = $$.length - 1; switch (yystate) { case 4: yy.setDirection("TB"); break; case 5: yy.setDirection("BT"); break; case 6: yy.setDirection("RL"); break; case 7: yy.setDirection("LR"); break; case 11: yy.parseDirective("%%{", "open_directive"); break; case 12: break; case 13: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], "arg_directive"); break; case 14: yy.parseDirective("}%%", "close_directive", "c4Context"); break; case 15: case 16: case 17: case 18: case 19: yy.setC4Type($$[$0 - 3]); break; case 26: yy.setTitle($$[$0].substring(6)); this.$ = $$[$0].substring(6); break; case 27: yy.setAccDescription($$[$0].substring(15)); this.$ = $$[$0].substring(15); break; case 28: this.$ = $$[$0].trim(); yy.setTitle(this.$); break; case 29: case 30: this.$ = $$[$0].trim(); yy.setAccDescription(this.$); break; case 35: case 36: $$[$0].splice(2, 0, "ENTERPRISE"); yy.addPersonOrSystemBoundary(...$$[$0]); this.$ = $$[$0]; break; case 37: yy.addPersonOrSystemBoundary(...$$[$0]); this.$ = $$[$0]; break; case 38: $$[$0].splice(2, 0, "CONTAINER"); yy.addContainerBoundary(...$$[$0]); this.$ = $$[$0]; break; case 39: yy.addDeploymentNode("node", ...$$[$0]); this.$ = $$[$0]; break; case 40: yy.addDeploymentNode("nodeL", ...$$[$0]); this.$ = $$[$0]; break; case 41: yy.addDeploymentNode("nodeR", ...$$[$0]); this.$ = $$[$0]; break; case 42: yy.popBoundaryParseStack(); break; case 46: yy.addPersonOrSystem("person", ...$$[$0]); this.$ = $$[$0]; break; case 47: yy.addPersonOrSystem("external_person", ...$$[$0]); this.$ = $$[$0]; break; case 48: yy.addPersonOrSystem("system", ...$$[$0]); this.$ = $$[$0]; break; case 49: yy.addPersonOrSystem("system_db", ...$$[$0]); this.$ = $$[$0]; break; case 50: yy.addPersonOrSystem("system_queue", ...$$[$0]); this.$ = $$[$0]; break; case 51: yy.addPersonOrSystem("external_system", ...$$[$0]); this.$ = $$[$0]; break; case 52: yy.addPersonOrSystem("external_system_db", ...$$[$0]); this.$ = $$[$0]; break; case 53: yy.addPersonOrSystem("external_system_queue", ...$$[$0]); this.$ = $$[$0]; break; case 54: yy.addContainer("container", ...$$[$0]); this.$ = $$[$0]; break; case 55: yy.addContainer("container_db", ...$$[$0]); this.$ = $$[$0]; break; case 56: yy.addContainer("container_queue", ...$$[$0]); this.$ = $$[$0]; break; case 57: yy.addContainer("external_container", ...$$[$0]); this.$ = $$[$0]; break; case 58: yy.addContainer("external_container_db", ...$$[$0]); this.$ = $$[$0]; break; case 59: yy.addContainer("external_container_queue", ...$$[$0]); this.$ = $$[$0]; break; case 60: yy.addComponent("component", ...$$[$0]); this.$ = $$[$0]; break; case 61: yy.addComponent("component_db", ...$$[$0]); this.$ = $$[$0]; break; case 62: yy.addComponent("component_queue", ...$$[$0]); this.$ = $$[$0]; break; case 63: yy.addComponent("external_component", ...$$[$0]); this.$ = $$[$0]; break; case 64: yy.addComponent("external_component_db", ...$$[$0]); this.$ = $$[$0]; break; case 65: yy.addComponent("external_component_queue", ...$$[$0]); this.$ = $$[$0]; break; case 67: yy.addRel("rel", ...$$[$0]); this.$ = $$[$0]; break; case 68: yy.addRel("birel", ...$$[$0]); this.$ = $$[$0]; break; case 69: yy.addRel("rel_u", ...$$[$0]); this.$ = $$[$0]; break; case 70: yy.addRel("rel_d", ...$$[$0]); this.$ = $$[$0]; break; case 71: yy.addRel("rel_l", ...$$[$0]); this.$ = $$[$0]; break; case 72: yy.addRel("rel_r", ...$$[$0]); this.$ = $$[$0]; break; case 73: yy.addRel("rel_b", ...$$[$0]); this.$ = $$[$0]; break; case 74: $$[$0].splice(0, 1); yy.addRel("rel", ...$$[$0]); this.$ = $$[$0]; break; case 75: yy.updateElStyle("update_el_style", ...$$[$0]); this.$ = $$[$0]; break; case 76: yy.updateRelStyle("update_rel_style", ...$$[$0]); this.$ = $$[$0]; break; case 77: yy.updateLayoutConfig("update_layout_config", ...$$[$0]); this.$ = $$[$0]; break; case 78: this.$ = [$$[$0]]; break; case 79: $$[$0].unshift($$[$0 - 1]); this.$ = $$[$0]; break; case 80: case 82: this.$ = $$[$0].trim(); break; case 81: let kv = {}; kv[$$[$0 - 1].trim()] = $$[$0].trim(); this.$ = kv; break; case 83: this.$ = ""; break; } }, table: [{ 3: 1, 4: 2, 5: 3, 6: 4, 7: $V0, 8: $V1, 9: $V2, 10: $V3, 11: 5, 12: 10, 18: $V4, 22: $V5, 25: $V6, 26: $V7, 27: $V8, 28: $V9 }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 3: 17, 4: 2, 5: 3, 6: 4, 7: $V0, 8: $V1, 9: $V2, 10: $V3, 11: 5, 12: 10, 18: $V4, 22: $V5, 25: $V6, 26: $V7, 27: $V8, 28: $V9 }, { 1: [2, 8] }, { 1: [2, 4] }, { 1: [2, 5] }, { 1: [2, 6] }, { 1: [2, 7] }, { 13: 18, 19: [1, 19] }, { 15: [1, 20] }, { 15: [1, 21] }, { 15: [1, 22] }, { 15: [1, 23] }, { 15: [1, 24] }, { 19: [2, 11] }, { 1: [2, 3] }, { 14: 25, 16: [1, 26], 21: $Va }, o([16, 21], [2, 12]), { 23: 28, 29: 29, 30: 30, 31: 31, 32: $Vb, 33: $Vc, 34: $Vd, 36: $Ve, 38: $Vf, 39: 58, 40: 70, 42: 71, 44: $Vg, 46: $Vh, 47: $Vi, 48: $Vj, 49: $Vk, 50: $Vl, 51: $Vm, 53: 32, 54: $Vn, 55: $Vo, 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 63: $Vw, 64: $Vx, 65: $Vy, 66: $Vz, 67: $VA, 68: $VB, 69: $VC, 70: $VD, 71: $VE, 72: $VF, 73: $VG, 74: $VH, 75: $VI, 76: $VJ, 77: $VK, 78: $VL, 79: $VM, 80: $VN, 81: $VO, 82: $VP, 83: $VQ, 84: $VR }, { 23: 79, 29: 29, 30: 30, 31: 31, 32: $Vb, 33: $Vc, 34: $Vd, 36: $Ve, 38: $Vf, 39: 58, 40: 70, 42: 71, 44: $Vg, 46: $Vh, 47: $Vi, 48: $Vj, 49: $Vk, 50: $Vl, 51: $Vm, 53: 32, 54: $Vn, 55: $Vo, 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 63: $Vw, 64: $Vx, 65: $Vy, 66: $Vz, 67: $VA, 68: $VB, 69: $VC, 70: $VD, 71: $VE, 72: $VF, 73: $VG, 74: $VH, 75: $VI, 76: $VJ, 77: $VK, 78: $VL, 79: $VM, 80: $VN, 81: $VO, 82: $VP, 83: $VQ, 84: $VR }, { 23: 80, 29: 29, 30: 30, 31: 31, 32: $Vb, 33: $Vc, 34: $Vd, 36: $Ve, 38: $Vf, 39: 58, 40: 70, 42: 71, 44: $Vg, 46: $Vh, 47: $Vi, 48: $Vj, 49: $Vk, 50: $Vl, 51: $Vm, 53: 32, 54: $Vn, 55: $Vo, 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 63: $Vw, 64: $Vx, 65: $Vy, 66: $Vz, 67: $VA, 68: $VB, 69: $VC, 70: $VD, 71: $VE, 72: $VF, 73: $VG, 74: $VH, 75: $VI, 76: $VJ, 77: $VK, 78: $VL, 79: $VM, 80: $VN, 81: $VO, 82: $VP, 83: $VQ, 84: $VR }, { 23: 81, 29: 29, 30: 30, 31: 31, 32: $Vb, 33: $Vc, 34: $Vd, 36: $Ve, 38: $Vf, 39: 58, 40: 70, 42: 71, 44: $Vg, 46: $Vh, 47: $Vi, 48: $Vj, 49: $Vk, 50: $Vl, 51: $Vm, 53: 32, 54: $Vn, 55: $Vo, 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 63: $Vw, 64: $Vx, 65: $Vy, 66: $Vz, 67: $VA, 68: $VB, 69: $VC, 70: $VD, 71: $VE, 72: $VF, 73: $VG, 74: $VH, 75: $VI, 76: $VJ, 77: $VK, 78: $VL, 79: $VM, 80: $VN, 81: $VO, 82: $VP, 83: $VQ, 84: $VR }, { 23: 82, 29: 29, 30: 30, 31: 31, 32: $Vb, 33: $Vc, 34: $Vd, 36: $Ve, 38: $Vf, 39: 58, 40: 70, 42: 71, 44: $Vg, 46: $Vh, 47: $Vi, 48: $Vj, 49: $Vk, 50: $Vl, 51: $Vm, 53: 32, 54: $Vn, 55: $Vo, 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 63: $Vw, 64: $Vx, 65: $Vy, 66: $Vz, 67: $VA, 68: $VB, 69: $VC, 70: $VD, 71: $VE, 72: $VF, 73: $VG, 74: $VH, 75: $VI, 76: $VJ, 77: $VK, 78: $VL, 79: $VM, 80: $VN, 81: $VO, 82: $VP, 83: $VQ, 84: $VR }, { 15: [1, 83] }, { 17: 84, 20: [1, 85] }, { 15: [2, 14] }, { 24: [1, 86] }, o($VS, [2, 20], { 53: 32, 39: 58, 40: 70, 42: 71, 30: 87, 44: $Vg, 46: $Vh, 47: $Vi, 48: $Vj, 49: $Vk, 50: $Vl, 51: $Vm, 54: $Vn, 55: $Vo, 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 63: $Vw, 64: $Vx, 65: $Vy, 66: $Vz, 67: $VA, 68: $VB, 69: $VC, 70: $VD, 71: $VE, 72: $VF, 73: $VG, 74: $VH, 75: $VI, 76: $VJ, 77: $VK, 78: $VL, 79: $VM, 80: $VN, 81: $VO, 82: $VP, 83: $VQ, 84: $VR }), o($VS, [2, 21]), o($VT, [2, 23], { 15: [1, 88] }), o($VS, [2, 43], { 15: [1, 89] }), o($VU, [2, 26]), o($VU, [2, 27]), { 35: [1, 90] }, { 37: [1, 91] }, o($VU, [2, 30]), { 45: 92, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 98, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 99, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 100, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 101, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 102, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 103, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 104, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 105, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 106, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 107, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 108, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 109, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 110, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 111, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 112, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 113, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 114, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 115, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 116, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, o($VZ, [2, 66]), { 45: 117, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 118, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 119, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 120, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 121, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 122, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 123, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 124, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 125, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 126, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 127, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 30: 128, 39: 58, 40: 70, 42: 71, 44: $Vg, 46: $Vh, 47: $Vi, 48: $Vj, 49: $Vk, 50: $Vl, 51: $Vm, 53: 32, 54: $Vn, 55: $Vo, 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 63: $Vw, 64: $Vx, 65: $Vy, 66: $Vz, 67: $VA, 68: $VB, 69: $VC, 70: $VD, 71: $VE, 72: $VF, 73: $VG, 74: $VH, 75: $VI, 76: $VJ, 77: $VK, 78: $VL, 79: $VM, 80: $VN, 81: $VO, 82: $VP, 83: $VQ, 84: $VR }, { 15: [1, 130], 43: [1, 129] }, { 45: 131, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 132, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 133, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 134, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 135, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 136, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 45: 137, 85: 93, 86: $VV, 87: $VW, 89: $VX, 90: $VY }, { 24: [1, 138] }, { 24: [1, 139] }, { 24: [1, 140] }, { 24: [1, 141] }, o($V_, [2, 9]), { 14: 142, 21: $Va }, { 21: [2, 13] }, { 1: [2, 15] }, o($VS, [2, 22]), o($VT, [2, 24], { 31: 31, 29: 143, 32: $Vb, 33: $Vc, 34: $Vd, 36: $Ve, 38: $Vf }), o($VS, [2, 44], { 29: 29, 30: 30, 31: 31, 53: 32, 39: 58, 40: 70, 42: 71, 23: 144, 32: $Vb, 33: $Vc, 34: $Vd, 36: $Ve, 38: $Vf, 44: $Vg, 46: $Vh, 47: $Vi, 48: $Vj, 49: $Vk, 50: $Vl, 51: $Vm, 54: $Vn, 55: $Vo, 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 63: $Vw, 64: $Vx, 65: $Vy, 66: $Vz, 67: $VA, 68: $VB, 69: $VC, 70: $VD, 71: $VE, 72: $VF, 73: $VG, 74: $VH, 75: $VI, 76: $VJ, 77: $VK, 78: $VL, 79: $VM, 80: $VN, 81: $VO, 82: $VP, 83: $VQ, 84: $VR }), o($VU, [2, 28]), o($VU, [2, 29]), o($VZ, [2, 46]), o($V$, [2, 78], { 85: 93, 45: 145, 86: $VV, 87: $VW, 89: $VX, 90: $VY }), o($V01, [2, 80]), { 88: [1, 146] }, o($V01, [2, 82]), o($V01, [2, 83]), o($VZ, [2, 47]), o($VZ, [2, 48]), o($VZ, [2, 49]), o($VZ, [2, 50]), o($VZ, [2, 51]), o($VZ, [2, 52]), o($VZ, [2, 53]), o($VZ, [2, 54]), o($VZ, [2, 55]), o($VZ, [2, 56]), o($VZ, [2, 57]), o($VZ, [2, 58]), o($VZ, [2, 59]), o($VZ, [2, 60]), o($VZ, [2, 61]), o($VZ, [2, 62]), o($VZ, [2, 63]), o($VZ, [2, 64]), o($VZ, [2, 65]), o($VZ, [2, 67]), o($VZ, [2, 68]), o($VZ, [2, 69]), o($VZ, [2, 70]), o($VZ, [2, 71]), o($VZ, [2, 72]), o($VZ, [2, 73]), o($VZ, [2, 74]), o($VZ, [2, 75]), o($VZ, [2, 76]), o($VZ, [2, 77]), { 41: 147, 52: [1, 148] }, { 15: [1, 149] }, { 43: [1, 150] }, o($V11, [2, 35]), o($V11, [2, 36]), o($V11, [2, 37]), o($V11, [2, 38]), o($V11, [2, 39]), o($V11, [2, 40]), o($V11, [2, 41]), { 1: [2, 16] }, { 1: [2, 17] }, { 1: [2, 18] }, { 1: [2, 19] }, { 15: [1, 151] }, o($VT, [2, 25]), o($VS, [2, 45]), o($V$, [2, 79]), o($V01, [2, 81]), o($VZ, [2, 31]), o($VZ, [2, 42]), o($V21, [2, 32]), o($V21, [2, 33], { 15: [1, 152] }), o($V_, [2, 10]), o($V21, [2, 34])], defaultActions: { 2: [2, 1], 3: [2, 2], 5: [2, 8], 6: [2, 4], 7: [2, 5], 8: [2, 6], 9: [2, 7], 16: [2, 11], 17: [2, 3], 27: [2, 14], 85: [2, 13], 86: [2, 15], 138: [2, 16], 139: [2, 17], 140: [2, 18], 141: [2, 19] }, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse2(input) { var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer2 = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer2.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer2; sharedState.yy.parser = this; if (typeof lexer2.yylloc == "undefined") { lexer2.yylloc = {}; } var yyloc = lexer2.yylloc; lstack.push(yyloc); var ranges = lexer2.options && lexer2.options.ranges; if (typeof sharedState.yy.parseError === "function") { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function lex() { var token; token = tstack.pop() || lexer2.lex() || EOF; if (typeof token !== "number") { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self2.symbols_[token] || token; } return token; } var symbol, state, action, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push("'" + this.terminals_[p] + "'"); } } if (lexer2.showPosition) { errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; } else { errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); } this.parseError(errStr, { text: lexer2.match, token: this.terminals_[symbol] || symbol, line: lexer2.yylineno, loc: yyloc, expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer2.yytext); lstack.push(lexer2.yylloc); stack.push(action[1]); symbol = null; { yyleng = lexer2.yyleng; yytext = lexer2.yytext; yylineno = lexer2.yylineno; yyloc = lexer2.yylloc; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== "undefined") { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; } }; var lexer = function() { var lexer2 = { EOF: 1, parseError: function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, setInput: function(input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; this.yylineno = this.yyleng = 0; this.yytext = this.matched = this.match = ""; this.conditionStack = ["INITIAL"]; this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; if (this.options.ranges) { this.yylloc.range = [0, 0]; } this.offset = 0; return this; }, input: function() { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, unput: function(ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); this.offset -= len; var oldLines = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1); this.matched = this.matched.substr(0, this.matched.length - 1); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, more: function() { this._more = true; return this; }, reject: function() { if (this.options.backtrack_lexer) { this._backtrack = true; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, less: function(n) { this.unput(this.match.slice(n)); }, pastInput: function() { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); }, upcomingInput: function() { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20 - next.length); } return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, ""); }, showPosition: function() { var pre = this.pastInput(); var c2 = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c2 + "^"; }, test_match: function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { backup = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { for (var k in backup) { this[k] = backup[k]; } return false; } return false; }, next: function() { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ""; this.match = ""; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; } else { return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } return false; } if (this._input === "") { return this.EOF; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, lex: function lex() { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, begin: function begin(condition) { this.conditionStack.push(condition); }, popState: function popState() { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, _currentRules: function _currentRules() { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, topState: function topState(n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, pushState: function pushState(condition) { this.begin(condition); }, stateStackSize: function stateStackSize() { return this.conditionStack.length; }, options: {}, performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { switch ($avoiding_name_collisions) { case 0: this.begin("open_directive"); return 18; case 1: return 7; case 2: return 8; case 3: return 9; case 4: return 10; case 5: this.begin("type_directive"); return 19; case 6: this.popState(); this.begin("arg_directive"); return 16; case 7: this.popState(); this.popState(); return 21; case 8: return 20; case 9: return 32; case 10: return 33; case 11: this.begin("acc_title"); return 34; case 12: this.popState(); return "acc_title_value"; case 13: this.begin("acc_descr"); return 36; case 14: this.popState(); return "acc_descr_value"; case 15: this.begin("acc_descr_multiline"); break; case 16: this.popState(); break; case 17: return "acc_descr_multiline_value"; case 18: break; case 19: c; break; case 20: return 15; case 21: break; case 22: return 22; case 23: return 25; case 24: return 26; case 25: return 27; case 26: return 28; case 27: this.begin("person_ext"); return 55; case 28: this.begin("person"); return 54; case 29: this.begin("system_ext_queue"); return 61; case 30: this.begin("system_ext_db"); return 60; case 31: this.begin("system_ext"); return 59; case 32: this.begin("system_queue"); return 58; case 33: this.begin("system_db"); return 57; case 34: this.begin("system"); return 56; case 35: this.begin("boundary"); return 47; case 36: this.begin("enterprise_boundary"); return 44; case 37: this.begin("system_boundary"); return 46; case 38: this.begin("container_ext_queue"); return 67; case 39: this.begin("container_ext_db"); return 66; case 40: this.begin("container_ext"); return 65; case 41: this.begin("container_queue"); return 64; case 42: this.begin("container_db"); return 63; case 43: this.begin("container"); return 62; case 44: this.begin("container_boundary"); return 48; case 45: this.begin("component_ext_queue"); return 73; case 46: this.begin("component_ext_db"); return 72; case 47: this.begin("component_ext"); return 71; case 48: this.begin("component_queue"); return 70; case 49: this.begin("component_db"); return 69; case 50: this.begin("component"); return 68; case 51: this.begin("node"); return 49; case 52: this.begin("node"); return 49; case 53: this.begin("node_l"); return 50; case 54: this.begin("node_r"); return 51; case 55: this.begin("rel"); return 74; case 56: this.begin("birel"); return 75; case 57: this.begin("rel_u"); return 76; case 58: this.begin("rel_u"); return 76; case 59: this.begin("rel_d"); return 77; case 60: this.begin("rel_d"); return 77; case 61: this.begin("rel_l"); return 78; case 62: this.begin("rel_l"); return 78; case 63: this.begin("rel_r"); return 79; case 64: this.begin("rel_r"); return 79; case 65: this.begin("rel_b"); return 80; case 66: this.begin("rel_index"); return 81; case 67: this.begin("update_el_style"); return 82; case 68: this.begin("update_rel_style"); return 83; case 69: this.begin("update_layout_config"); return 84; case 70: return "EOF_IN_STRUCT"; case 71: this.begin("attribute"); return "ATTRIBUTE_EMPTY"; case 72: this.begin("attribute"); break; case 73: this.popState(); this.popState(); break; case 74: return 90; case 75: break; case 76: return 90; case 77: this.begin("string"); break; case 78: this.popState(); break; case 79: return "STR"; case 80: this.begin("string_kv"); break; case 81: this.begin("string_kv_key"); return "STR_KEY"; case 82: this.popState(); this.begin("string_kv_value"); break; case 83: return "STR_VALUE"; case 84: this.popState(); this.popState(); break; case 85: return "STR"; case 86: return "LBRACE"; case 87: return "RBRACE"; case 88: return "SPACE"; case 89: return "EOL"; case 90: return 24; } }, rules: [/^(?:%%\{)/, /^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:((?:(?!\}%%)[^:.])*))/, /^(?::)/, /^(?:\}%%)/, /^(?:((?:(?!\}%%).|\n)*))/, /^(?:title\s[^#\n;]+)/, /^(?:accDescription\s[^#\n;]+)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, /^(?:%%[^\n]*(\r?\n)*)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:C4Context\b)/, /^(?:C4Container\b)/, /^(?:C4Component\b)/, /^(?:C4Dynamic\b)/, /^(?:C4Deployment\b)/, /^(?:Person_Ext\b)/, /^(?:Person\b)/, /^(?:SystemQueue_Ext\b)/, /^(?:SystemDb_Ext\b)/, /^(?:System_Ext\b)/, /^(?:SystemQueue\b)/, /^(?:SystemDb\b)/, /^(?:System\b)/, /^(?:Boundary\b)/, /^(?:Enterprise_Boundary\b)/, /^(?:System_Boundary\b)/, /^(?:ContainerQueue_Ext\b)/, /^(?:ContainerDb_Ext\b)/, /^(?:Container_Ext\b)/, /^(?:ContainerQueue\b)/, /^(?:ContainerDb\b)/, /^(?:Container\b)/, /^(?:Container_Boundary\b)/, /^(?:ComponentQueue_Ext\b)/, /^(?:ComponentDb_Ext\b)/, /^(?:Component_Ext\b)/, /^(?:ComponentQueue\b)/, /^(?:ComponentDb\b)/, /^(?:Component\b)/, /^(?:Deployment_Node\b)/, /^(?:Node\b)/, /^(?:Node_L\b)/, /^(?:Node_R\b)/, /^(?:Rel\b)/, /^(?:BiRel\b)/, /^(?:Rel_Up\b)/, /^(?:Rel_U\b)/, /^(?:Rel_Down\b)/, /^(?:Rel_D\b)/, /^(?:Rel_Left\b)/, /^(?:Rel_L\b)/, /^(?:Rel_Right\b)/, /^(?:Rel_R\b)/, /^(?:Rel_Back\b)/, /^(?:RelIndex\b)/, /^(?:UpdateElementStyle\b)/, /^(?:UpdateRelStyle\b)/, /^(?:UpdateLayoutConfig\b)/, /^(?:$)/, /^(?:[(][ ]*[,])/, /^(?:[(])/, /^(?:[)])/, /^(?:,,)/, /^(?:,)/, /^(?:[ ]*["]["])/, /^(?:[ ]*["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:[ ]*[\$])/, /^(?:[^=]*)/, /^(?:[=][ ]*["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:[^,]+)/, /^(?:\{)/, /^(?:\})/, /^(?:[\s]+)/, /^(?:[\n\r]+)/, /^(?:$)/], conditions: { "acc_descr_multiline": { "rules": [16, 17], "inclusive": false }, "acc_descr": { "rules": [14], "inclusive": false }, "acc_title": { "rules": [12], "inclusive": false }, "close_directive": { "rules": [], "inclusive": false }, "arg_directive": { "rules": [7, 8], "inclusive": false }, "type_directive": { "rules": [6, 7], "inclusive": false }, "open_directive": { "rules": [5], "inclusive": false }, "string_kv_value": { "rules": [83, 84], "inclusive": false }, "string_kv_key": { "rules": [82], "inclusive": false }, "string_kv": { "rules": [81], "inclusive": false }, "string": { "rules": [78, 79], "inclusive": false }, "attribute": { "rules": [73, 74, 75, 76, 77, 80, 85], "inclusive": false }, "update_layout_config": { "rules": [70, 71, 72, 73], "inclusive": false }, "update_rel_style": { "rules": [70, 71, 72, 73], "inclusive": false }, "update_el_style": { "rules": [70, 71, 72, 73], "inclusive": false }, "rel_b": { "rules": [70, 71, 72, 73], "inclusive": false }, "rel_r": { "rules": [70, 71, 72, 73], "inclusive": false }, "rel_l": { "rules": [70, 71, 72, 73], "inclusive": false }, "rel_d": { "rules": [70, 71, 72, 73], "inclusive": false }, "rel_u": { "rules": [70, 71, 72, 73], "inclusive": false }, "rel_bi": { "rules": [], "inclusive": false }, "rel": { "rules": [70, 71, 72, 73], "inclusive": false }, "node_r": { "rules": [70, 71, 72, 73], "inclusive": false }, "node_l": { "rules": [70, 71, 72, 73], "inclusive": false }, "node": { "rules": [70, 71, 72, 73], "inclusive": false }, "index": { "rules": [], "inclusive": false }, "rel_index": { "rules": [70, 71, 72, 73], "inclusive": false }, "component_ext_queue": { "rules": [], "inclusive": false }, "component_ext_db": { "rules": [70, 71, 72, 73], "inclusive": false }, "component_ext": { "rules": [70, 71, 72, 73], "inclusive": false }, "component_queue": { "rules": [70, 71, 72, 73], "inclusive": false }, "component_db": { "rules": [70, 71, 72, 73], "inclusive": false }, "component": { "rules": [70, 71, 72, 73], "inclusive": false }, "container_boundary": { "rules": [70, 71, 72, 73], "inclusive": false }, "container_ext_queue": { "rules": [], "inclusive": false }, "container_ext_db": { "rules": [70, 71, 72, 73], "inclusive": false }, "container_ext": { "rules": [70, 71, 72, 73], "inclusive": false }, "container_queue": { "rules": [70, 71, 72, 73], "inclusive": false }, "container_db": { "rules": [70, 71, 72, 73], "inclusive": false }, "container": { "rules": [70, 71, 72, 73], "inclusive": false }, "birel": { "rules": [70, 71, 72, 73], "inclusive": false }, "system_boundary": { "rules": [70, 71, 72, 73], "inclusive": false }, "enterprise_boundary": { "rules": [70, 71, 72, 73], "inclusive": false }, "boundary": { "rules": [70, 71, 72, 73], "inclusive": false }, "system_ext_queue": { "rules": [70, 71, 72, 73], "inclusive": false }, "system_ext_db": { "rules": [70, 71, 72, 73], "inclusive": false }, "system_ext": { "rules": [70, 71, 72, 73], "inclusive": false }, "system_queue": { "rules": [70, 71, 72, 73], "inclusive": false }, "system_db": { "rules": [70, 71, 72, 73], "inclusive": false }, "system": { "rules": [70, 71, 72, 73], "inclusive": false }, "person_ext": { "rules": [70, 71, 72, 73], "inclusive": false }, "person": { "rules": [70, 71, 72, 73], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 9, 10, 11, 13, 15, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 86, 87, 88, 89, 90], "inclusive": true } } }; return lexer2; }(); parser2.lexer = lexer; function Parser() { this.yy = {}; } Parser.prototype = parser2; parser2.Parser = Parser; return new Parser(); }(); parser$a.parser = parser$a; const c4Detector = (txt) => { return txt.match(/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/) !== null; }; let c4ShapeArray = []; let boundaryParseStack = [""]; let currentBoundaryParse = "global"; let parentBoundaryParse = ""; let boundarys = [ { alias: "global", label: { text: "global" }, type: { text: "global" }, tags: null, link: null, parentBoundary: "" } ]; let rels = []; let title = ""; let wrapEnabled$1 = false; let c4ShapeInRow$1 = 4; let c4BoundaryInRow$1 = 2; var c4Type; const getC4Type = function() { return c4Type; }; const setC4Type = function(c4TypeParam) { let sanitizedText = sanitizeText$5(c4TypeParam, getConfig$1()); c4Type = sanitizedText; }; const parseDirective$a = function(statement, context, type2) { mermaidAPI.parseDirective(this, statement, context, type2); }; const addRel = function(type2, from, to, label, techn, descr, sprite, tags2, link) { if (type2 === void 0 || type2 === null || from === void 0 || from === null || to === void 0 || to === null || label === void 0 || label === null) return; let rel = {}; const old = rels.find((rel2) => rel2.from === from && rel2.to === to); if (old) { rel = old; } else { rels.push(rel); } rel.type = type2; rel.from = from; rel.to = to; rel.label = { text: label }; if (techn === void 0 || techn === null) { rel.techn = { text: "" }; } else { if (typeof techn === "object") { let [key, value] = Object.entries(techn)[0]; rel[key] = { text: value }; } else { rel.techn = { text: techn }; } } if (descr === void 0 || descr === null) { rel.descr = { text: "" }; } else { if (typeof descr === "object") { let [key, value] = Object.entries(descr)[0]; rel[key] = { text: value }; } else { rel.descr = { text: descr }; } } if (typeof sprite === "object") { let [key, value] = Object.entries(sprite)[0]; rel[key] = value; } else { rel.sprite = sprite; } if (typeof tags2 === "object") { let [key, value] = Object.entries(tags2)[0]; rel[key] = value; } else { rel.tags = tags2; } if (typeof link === "object") { let [key, value] = Object.entries(link)[0]; rel[key] = value; } else { rel.link = link; } rel.wrap = autoWrap$1(); }; const addPersonOrSystem = function(typeC4Shape, alias, label, descr, sprite, tags2, link) { if (alias === null || label === null) return; let personOrSystem = {}; const old = c4ShapeArray.find((personOrSystem2) => personOrSystem2.alias === alias); if (old && alias === old.alias) { personOrSystem = old; } else { personOrSystem.alias = alias; c4ShapeArray.push(personOrSystem); } if (label === void 0 || label === null) { personOrSystem.label = { text: "" }; } else { personOrSystem.label = { text: label }; } if (descr === void 0 || descr === null) { personOrSystem.descr = { text: "" }; } else { if (typeof descr === "object") { let [key, value] = Object.entries(descr)[0]; personOrSystem[key] = { text: value }; } else { personOrSystem.descr = { text: descr }; } } if (typeof sprite === "object") { let [key, value] = Object.entries(sprite)[0]; personOrSystem[key] = value; } else { personOrSystem.sprite = sprite; } if (typeof tags2 === "object") { let [key, value] = Object.entries(tags2)[0]; personOrSystem[key] = value; } else { personOrSystem.tags = tags2; } if (typeof link === "object") { let [key, value] = Object.entries(link)[0]; personOrSystem[key] = value; } else { personOrSystem.link = link; } personOrSystem.typeC4Shape = { text: typeC4Shape }; personOrSystem.parentBoundary = currentBoundaryParse; personOrSystem.wrap = autoWrap$1(); }; const addContainer = function(typeC4Shape, alias, label, techn, descr, sprite, tags2, link) { if (alias === null || label === null) return; let container = {}; const old = c4ShapeArray.find((container2) => container2.alias === alias); if (old && alias === old.alias) { container = old; } else { container.alias = alias; c4ShapeArray.push(container); } if (label === void 0 || label === null) { container.label = { text: "" }; } else { container.label = { text: label }; } if (techn === void 0 || techn === null) { container.techn = { text: "" }; } else { if (typeof techn === "object") { let [key, value] = Object.entries(techn)[0]; container[key] = { text: value }; } else { container.techn = { text: techn }; } } if (descr === void 0 || descr === null) { container.descr = { text: "" }; } else { if (typeof descr === "object") { let [key, value] = Object.entries(descr)[0]; container[key] = { text: value }; } else { container.descr = { text: descr }; } } if (typeof sprite === "object") { let [key, value] = Object.entries(sprite)[0]; container[key] = value; } else { container.sprite = sprite; } if (typeof tags2 === "object") { let [key, value] = Object.entries(tags2)[0]; container[key] = value; } else { container.tags = tags2; } if (typeof link === "object") { let [key, value] = Object.entries(link)[0]; container[key] = value; } else { container.link = link; } container.wrap = autoWrap$1(); container.typeC4Shape = { text: typeC4Shape }; container.parentBoundary = currentBoundaryParse; }; const addComponent = function(typeC4Shape, alias, label, techn, descr, sprite, tags2, link) { if (alias === null || label === null) return; let component = {}; const old = c4ShapeArray.find((component2) => component2.alias === alias); if (old && alias === old.alias) { component = old; } else { component.alias = alias; c4ShapeArray.push(component); } if (label === void 0 || label === null) { component.label = { text: "" }; } else { component.label = { text: label }; } if (techn === void 0 || techn === null) { component.techn = { text: "" }; } else { if (typeof techn === "object") { let [key, value] = Object.entries(techn)[0]; component[key] = { text: value }; } else { component.techn = { text: techn }; } } if (descr === void 0 || descr === null) { component.descr = { text: "" }; } else { if (typeof descr === "object") { let [key, value] = Object.entries(descr)[0]; component[key] = { text: value }; } else { component.descr = { text: descr }; } } if (typeof sprite === "object") { let [key, value] = Object.entries(sprite)[0]; component[key] = value; } else { component.sprite = sprite; } if (typeof tags2 === "object") { let [key, value] = Object.entries(tags2)[0]; component[key] = value; } else { component.tags = tags2; } if (typeof link === "object") { let [key, value] = Object.entries(link)[0]; component[key] = value; } else { component.link = link; } component.wrap = autoWrap$1(); component.typeC4Shape = { text: typeC4Shape }; component.parentBoundary = currentBoundaryParse; }; const addPersonOrSystemBoundary = function(alias, label, type2, tags2, link) { if (alias === null || label === null) return; let boundary = {}; const old = boundarys.find((boundary2) => boundary2.alias === alias); if (old && alias === old.alias) { boundary = old; } else { boundary.alias = alias; boundarys.push(boundary); } if (label === void 0 || label === null) { boundary.label = { text: "" }; } else { boundary.label = { text: label }; } if (type2 === void 0 || type2 === null) { boundary.type = { text: "system" }; } else { if (typeof type2 === "object") { let [key, value] = Object.entries(type2)[0]; boundary[key] = { text: value }; } else { boundary.type = { text: type2 }; } } if (typeof tags2 === "object") { let [key, value] = Object.entries(tags2)[0]; boundary[key] = value; } else { boundary.tags = tags2; } if (typeof link === "object") { let [key, value] = Object.entries(link)[0]; boundary[key] = value; } else { boundary.link = link; } boundary.parentBoundary = currentBoundaryParse; boundary.wrap = autoWrap$1(); parentBoundaryParse = currentBoundaryParse; currentBoundaryParse = alias; boundaryParseStack.push(parentBoundaryParse); }; const addContainerBoundary = function(alias, label, type2, tags2, link) { if (alias === null || label === null) return; let boundary = {}; const old = boundarys.find((boundary2) => boundary2.alias === alias); if (old && alias === old.alias) { boundary = old; } else { boundary.alias = alias; boundarys.push(boundary); } if (label === void 0 || label === null) { boundary.label = { text: "" }; } else { boundary.label = { text: label }; } if (type2 === void 0 || type2 === null) { boundary.type = { text: "container" }; } else { if (typeof type2 === "object") { let [key, value] = Object.entries(type2)[0]; boundary[key] = { text: value }; } else { boundary.type = { text: type2 }; } } if (typeof tags2 === "object") { let [key, value] = Object.entries(tags2)[0]; boundary[key] = value; } else { boundary.tags = tags2; } if (typeof link === "object") { let [key, value] = Object.entries(link)[0]; boundary[key] = value; } else { boundary.link = link; } boundary.parentBoundary = currentBoundaryParse; boundary.wrap = autoWrap$1(); parentBoundaryParse = currentBoundaryParse; currentBoundaryParse = alias; boundaryParseStack.push(parentBoundaryParse); }; const addDeploymentNode = function(nodeType, alias, label, type2, descr, sprite, tags2, link) { if (alias === null || label === null) return; let boundary = {}; const old = boundarys.find((boundary2) => boundary2.alias === alias); if (old && alias === old.alias) { boundary = old; } else { boundary.alias = alias; boundarys.push(boundary); } if (label === void 0 || label === null) { boundary.label = { text: "" }; } else { boundary.label = { text: label }; } if (type2 === void 0 || type2 === null) { boundary.type = { text: "node" }; } else { if (typeof type2 === "object") { let [key, value] = Object.entries(type2)[0]; boundary[key] = { text: value }; } else { boundary.type = { text: type2 }; } } if (descr === void 0 || descr === null) { boundary.descr = { text: "" }; } else { if (typeof descr === "object") { let [key, value] = Object.entries(descr)[0]; boundary[key] = { text: value }; } else { boundary.descr = { text: descr }; } } if (typeof tags2 === "object") { let [key, value] = Object.entries(tags2)[0]; boundary[key] = value; } else { boundary.tags = tags2; } if (typeof link === "object") { let [key, value] = Object.entries(link)[0]; boundary[key] = value; } else { boundary.link = link; } boundary.nodeType = nodeType; boundary.parentBoundary = currentBoundaryParse; boundary.wrap = autoWrap$1(); parentBoundaryParse = currentBoundaryParse; currentBoundaryParse = alias; boundaryParseStack.push(parentBoundaryParse); }; const popBoundaryParseStack = function() { currentBoundaryParse = parentBoundaryParse; boundaryParseStack.pop(); parentBoundaryParse = boundaryParseStack.pop(); boundaryParseStack.push(parentBoundaryParse); }; const updateElStyle = function(typeC4Shape, elementName, bgColor, fontColor, borderColor, shadowing, shape, sprite, techn, legendText, legendSprite) { let old = c4ShapeArray.find((element) => element.alias === elementName); if (old === void 0) { old = boundarys.find((element) => element.alias === elementName); if (old === void 0) { return; } } if (bgColor !== void 0 && bgColor !== null) { if (typeof bgColor === "object") { let [key, value] = Object.entries(bgColor)[0]; old[key] = value; } else { old.bgColor = bgColor; } } if (fontColor !== void 0 && fontColor !== null) { if (typeof fontColor === "object") { let [key, value] = Object.entries(fontColor)[0]; old[key] = value; } else { old.fontColor = fontColor; } } if (borderColor !== void 0 && borderColor !== null) { if (typeof borderColor === "object") { let [key, value] = Object.entries(borderColor)[0]; old[key] = value; } else { old.borderColor = borderColor; } } if (shadowing !== void 0 && shadowing !== null) { if (typeof shadowing === "object") { let [key, value] = Object.entries(shadowing)[0]; old[key] = value; } else { old.shadowing = shadowing; } } if (shape !== void 0 && shape !== null) { if (typeof shape === "object") { let [key, value] = Object.entries(shape)[0]; old[key] = value; } else { old.shape = shape; } } if (sprite !== void 0 && sprite !== null) { if (typeof sprite === "object") { let [key, value] = Object.entries(sprite)[0]; old[key] = value; } else { old.sprite = sprite; } } if (techn !== void 0 && techn !== null) { if (typeof techn === "object") { let [key, value] = Object.entries(techn)[0]; old[key] = value; } else { old.techn = techn; } } if (legendText !== void 0 && legendText !== null) { if (typeof legendText === "object") { let [key, value] = Object.entries(legendText)[0]; old[key] = value; } else { old.legendText = legendText; } } if (legendSprite !== void 0 && legendSprite !== null) { if (typeof legendSprite === "object") { let [key, value] = Object.entries(legendSprite)[0]; old[key] = value; } else { old.legendSprite = legendSprite; } } }; const updateRelStyle = function(typeC4Shape, from, to, textColor, lineColor, offsetX, offsetY) { const old = rels.find((rel) => rel.from === from && rel.to === to); if (old === void 0) { return; } if (textColor !== void 0 && textColor !== null) { if (typeof textColor === "object") { let [key, value] = Object.entries(textColor)[0]; old[key] = value; } else { old.textColor = textColor; } } if (lineColor !== void 0 && lineColor !== null) { if (typeof lineColor === "object") { let [key, value] = Object.entries(lineColor)[0]; old[key] = value; } else { old.lineColor = lineColor; } } if (offsetX !== void 0 && offsetX !== null) { if (typeof offsetX === "object") { let [key, value] = Object.entries(offsetX)[0]; old[key] = parseInt(value); } else { old.offsetX = parseInt(offsetX); } } if (offsetY !== void 0 && offsetY !== null) { if (typeof offsetY === "object") { let [key, value] = Object.entries(offsetY)[0]; old[key] = parseInt(value); } else { old.offsetY = parseInt(offsetY); } } }; const updateLayoutConfig = function(typeC4Shape, c4ShapeInRowParam, c4BoundaryInRowParam) { let c4ShapeInRowValue = c4ShapeInRow$1; let c4BoundaryInRowValue = c4BoundaryInRow$1; if (typeof c4ShapeInRowParam === "object") { const value = Object.values(c4ShapeInRowParam)[0]; c4ShapeInRowValue = parseInt(value); } else { c4ShapeInRowValue = parseInt(c4ShapeInRowParam); } if (typeof c4BoundaryInRowParam === "object") { const value = Object.values(c4BoundaryInRowParam)[0]; c4BoundaryInRowValue = parseInt(value); } else { c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam); } if (c4ShapeInRowValue >= 1) c4ShapeInRow$1 = c4ShapeInRowValue; if (c4BoundaryInRowValue >= 1) c4BoundaryInRow$1 = c4BoundaryInRowValue; }; const getC4ShapeInRow = function() { return c4ShapeInRow$1; }; const getC4BoundaryInRow = function() { return c4BoundaryInRow$1; }; const getCurrentBoundaryParse = function() { return currentBoundaryParse; }; const getParentBoundaryParse = function() { return parentBoundaryParse; }; const getC4ShapeArray = function(parentBoundary) { if (parentBoundary === void 0 || parentBoundary === null) return c4ShapeArray; else return c4ShapeArray.filter((personOrSystem) => { return personOrSystem.parentBoundary === parentBoundary; }); }; const getC4Shape = function(alias) { return c4ShapeArray.find((personOrSystem) => personOrSystem.alias === alias); }; const getC4ShapeKeys = function(parentBoundary) { return Object.keys(getC4ShapeArray(parentBoundary)); }; const getBoundarys = function(parentBoundary) { if (parentBoundary === void 0 || parentBoundary === null) return boundarys; else return boundarys.filter((boundary) => boundary.parentBoundary === parentBoundary); }; const getRels = function() { return rels; }; const getTitle = function() { return title; }; const setWrap$1 = function(wrapSetting) { wrapEnabled$1 = wrapSetting; }; const autoWrap$1 = function() { return wrapEnabled$1; }; const clear$d = function() { c4ShapeArray = []; boundarys = [ { alias: "global", label: { text: "global" }, type: { text: "global" }, tags: null, link: null, parentBoundary: "" } ]; parentBoundaryParse = ""; currentBoundaryParse = "global"; boundaryParseStack = [""]; rels = []; boundaryParseStack = [""]; title = ""; wrapEnabled$1 = false; c4ShapeInRow$1 = 4; c4BoundaryInRow$1 = 2; }; const LINETYPE$1 = { SOLID: 0, DOTTED: 1, NOTE: 2, SOLID_CROSS: 3, DOTTED_CROSS: 4, SOLID_OPEN: 5, DOTTED_OPEN: 6, LOOP_START: 10, LOOP_END: 11, ALT_START: 12, ALT_ELSE: 13, ALT_END: 14, OPT_START: 15, OPT_END: 16, ACTIVE_START: 17, ACTIVE_END: 18, PAR_START: 19, PAR_AND: 20, PAR_END: 21, RECT_START: 22, RECT_END: 23, SOLID_POINT: 24, DOTTED_POINT: 25 }; const ARROWTYPE$1 = { FILLED: 0, OPEN: 1 }; const PLACEMENT$1 = { LEFTOF: 0, RIGHTOF: 1, OVER: 2 }; const setTitle = function(txt) { let sanitizedText = sanitizeText$5(txt, getConfig$1()); title = sanitizedText; }; const c4Db = { addPersonOrSystem, addPersonOrSystemBoundary, addContainer, addContainerBoundary, addComponent, addDeploymentNode, popBoundaryParseStack, addRel, updateElStyle, updateRelStyle, updateLayoutConfig, autoWrap: autoWrap$1, setWrap: setWrap$1, getC4ShapeArray, getC4Shape, getC4ShapeKeys, getBoundarys, getCurrentBoundaryParse, getParentBoundaryParse, getRels, getTitle, getC4Type, getC4ShapeInRow, getC4BoundaryInRow, setAccTitle, getAccTitle, getAccDescription, setAccDescription, parseDirective: parseDirective$a, getConfig: () => getConfig$1().c4, clear: clear$d, LINETYPE: LINETYPE$1, ARROWTYPE: ARROWTYPE$1, PLACEMENT: PLACEMENT$1, setTitle, setC4Type }; const drawRect$2 = function(elem, rectData) { const rectElem = elem.append("rect"); rectElem.attr("x", rectData.x); rectElem.attr("y", rectData.y); rectElem.attr("fill", rectData.fill); rectElem.attr("stroke", rectData.stroke); rectElem.attr("width", rectData.width); rectElem.attr("height", rectData.height); rectElem.attr("rx", rectData.rx); rectElem.attr("ry", rectData.ry); if (rectData.attrs !== "undefined" && rectData.attrs !== null) { for (let attrKey in rectData.attrs) rectElem.attr(attrKey, rectData.attrs[attrKey]); } if (rectData.class !== "undefined") { rectElem.attr("class", rectData.class); } return rectElem; }; const drawImage$1 = function(elem, width2, height2, x, y, link) { const imageElem = elem.append("image"); imageElem.attr("width", width2); imageElem.attr("height", height2); imageElem.attr("x", x); imageElem.attr("y", y); let sanitizedLink = link.startsWith("data:image/png;base64") ? link : sanitizeUrl(link); imageElem.attr("xlink:href", sanitizedLink); }; const drawEmbeddedImage$1 = function(elem, x, y, link) { const imageElem = elem.append("use"); imageElem.attr("x", x); imageElem.attr("y", y); var sanitizedLink = sanitizeUrl(link); imageElem.attr("xlink:href", "#" + sanitizedLink); }; const drawText$2 = function(elem, textData) { let prevTextHeight = 0, textHeight = 0; const lines = textData.text.split(common.lineBreakRegex); let textElems = []; let dy = 0; let yfunc = () => textData.y; if (typeof textData.valign !== "undefined" && typeof textData.textMargin !== "undefined" && textData.textMargin > 0) { switch (textData.valign) { case "top": case "start": yfunc = () => Math.round(textData.y + textData.textMargin); break; case "middle": case "center": yfunc = () => Math.round(textData.y + (prevTextHeight + textHeight + textData.textMargin) / 2); break; case "bottom": case "end": yfunc = () => Math.round( textData.y + (prevTextHeight + textHeight + 2 * textData.textMargin) - textData.textMargin ); break; } } if (typeof textData.anchor !== "undefined" && typeof textData.textMargin !== "undefined" && typeof textData.width !== "undefined") { switch (textData.anchor) { case "left": case "start": textData.x = Math.round(textData.x + textData.textMargin); textData.anchor = "start"; textData.dominantBaseline = "text-after-edge"; textData.alignmentBaseline = "middle"; break; case "middle": case "center": textData.x = Math.round(textData.x + textData.width / 2); textData.anchor = "middle"; textData.dominantBaseline = "middle"; textData.alignmentBaseline = "middle"; break; case "right": case "end": textData.x = Math.round(textData.x + textData.width - textData.textMargin); textData.anchor = "end"; textData.dominantBaseline = "text-before-edge"; textData.alignmentBaseline = "middle"; break; } } for (let i = 0; i < lines.length; i++) { let line2 = lines[i]; if (typeof textData.textMargin !== "undefined" && textData.textMargin === 0 && typeof textData.fontSize !== "undefined") { dy = i * textData.fontSize; } const textElem = elem.append("text"); textElem.attr("x", textData.x); textElem.attr("y", yfunc()); if (typeof textData.anchor !== "undefined") { textElem.attr("text-anchor", textData.anchor).attr("dominant-baseline", textData.dominantBaseline).attr("alignment-baseline", textData.alignmentBaseline); } if (typeof textData.fontFamily !== "undefined") { textElem.style("font-family", textData.fontFamily); } if (typeof textData.fontSize !== "undefined") { textElem.style("font-size", textData.fontSize); } if (typeof textData.fontWeight !== "undefined") { textElem.style("font-weight", textData.fontWeight); } if (typeof textData.fill !== "undefined") { textElem.attr("fill", textData.fill); } if (typeof textData.class !== "undefined") { textElem.attr("class", textData.class); } if (typeof textData.dy !== "undefined") { textElem.attr("dy", textData.dy); } else if (dy !== 0) { textElem.attr("dy", dy); } if (textData.tspan) { const span = textElem.append("tspan"); span.attr("x", textData.x); if (typeof textData.fill !== "undefined") { span.attr("fill", textData.fill); } span.text(line2); } else { textElem.text(line2); } if (typeof textData.valign !== "undefined" && typeof textData.textMargin !== "undefined" && textData.textMargin > 0) { textHeight += (textElem._groups || textElem)[0][0].getBBox().height; prevTextHeight = textHeight; } textElems.push(textElem); } return textElems; }; const drawLabel$2 = function(elem, txtObject) { function genPoints(x, y, width2, height2, cut) { return x + "," + y + " " + (x + width2) + "," + y + " " + (x + width2) + "," + (y + height2 - cut) + " " + (x + width2 - cut * 1.2) + "," + (y + height2) + " " + x + "," + (y + height2); } const polygon = elem.append("polygon"); polygon.attr("points", genPoints(txtObject.x, txtObject.y, txtObject.width, txtObject.height, 7)); polygon.attr("class", "labelBox"); txtObject.y = txtObject.y + txtObject.height / 2; drawText$2(elem, txtObject); return polygon; }; const drawRels$1 = (elem, rels2, conf2) => { const relsElem = elem.append("g"); let i = 0; for (let rel of rels2) { let textColor = rel.textColor ? rel.textColor : "#444444"; let strokeColor = rel.lineColor ? rel.lineColor : "#444444"; let offsetX = rel.offsetX ? parseInt(rel.offsetX) : 0; let offsetY = rel.offsetY ? parseInt(rel.offsetY) : 0; let url = ""; if (i === 0) { let line2 = relsElem.append("line"); line2.attr("x1", rel.startPoint.x); line2.attr("y1", rel.startPoint.y); line2.attr("x2", rel.endPoint.x); line2.attr("y2", rel.endPoint.y); line2.attr("stroke-width", "1"); line2.attr("stroke", strokeColor); line2.style("fill", "none"); if (rel.type !== "rel_b") line2.attr("marker-end", "url(" + url + "#arrowhead)"); if (rel.type === "birel" || rel.type === "rel_b") line2.attr("marker-start", "url(" + url + "#arrowend)"); i = -1; } else { let line2 = relsElem.append("path"); line2.attr("fill", "none").attr("stroke-width", "1").attr("stroke", strokeColor).attr( "d", "Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx", rel.startPoint.x).replaceAll("starty", rel.startPoint.y).replaceAll( "controlx", rel.startPoint.x + (rel.endPoint.x - rel.startPoint.x) / 2 - (rel.endPoint.x - rel.startPoint.x) / 4 ).replaceAll("controly", rel.startPoint.y + (rel.endPoint.y - rel.startPoint.y) / 2).replaceAll("stopx", rel.endPoint.x).replaceAll("stopy", rel.endPoint.y) ); if (rel.type !== "rel_b") line2.attr("marker-end", "url(" + url + "#arrowhead)"); if (rel.type === "birel" || rel.type === "rel_b") line2.attr("marker-start", "url(" + url + "#arrowend)"); } let messageConf = conf2.messageFont(); _drawTextCandidateFunc$2(conf2)( rel.label.text, relsElem, Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX, Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + offsetY, rel.label.width, rel.label.height, { fill: textColor }, messageConf ); if (rel.techn && rel.techn.text !== "") { messageConf = conf2.messageFont(); _drawTextCandidateFunc$2(conf2)( "[" + rel.techn.text + "]", relsElem, Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX, Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + conf2.messageFontSize + 5 + offsetY, Math.max(rel.label.width, rel.techn.width), rel.techn.height, { fill: textColor, "font-style": "italic" }, messageConf ); } } }; const drawBoundary$1 = function(elem, boundary, conf2) { const boundaryElem = elem.append("g"); let fillColor = boundary.bgColor ? boundary.bgColor : "none"; let strokeColor = boundary.borderColor ? boundary.borderColor : "#444444"; let fontColor = boundary.fontColor ? boundary.fontColor : "black"; let attrsValue = { "stroke-width": 1, "stroke-dasharray": "7.0,7.0" }; if (boundary.nodeType) attrsValue = { "stroke-width": 1 }; let rectData = { x: boundary.x, y: boundary.y, fill: fillColor, stroke: strokeColor, width: boundary.width, height: boundary.height, rx: 2.5, ry: 2.5, attrs: attrsValue }; drawRect$2(boundaryElem, rectData); let boundaryConf = conf2.boundaryFont(); boundaryConf.fontWeight = "bold"; boundaryConf.fontSize = boundaryConf.fontSize + 2; boundaryConf.fontColor = fontColor; _drawTextCandidateFunc$2(conf2)( boundary.label.text, boundaryElem, boundary.x, boundary.y + boundary.label.Y, boundary.width, boundary.height, { fill: "#444444" }, boundaryConf ); if (boundary.type && boundary.type.text !== "") { boundaryConf = conf2.boundaryFont(); boundaryConf.fontColor = fontColor; _drawTextCandidateFunc$2(conf2)( boundary.type.text, boundaryElem, boundary.x, boundary.y + boundary.type.Y, boundary.width, boundary.height, { fill: "#444444" }, boundaryConf ); } if (boundary.descr && boundary.descr.text !== "") { boundaryConf = conf2.boundaryFont(); boundaryConf.fontSize = boundaryConf.fontSize - 2; boundaryConf.fontColor = fontColor; _drawTextCandidateFunc$2(conf2)( boundary.descr.text, boundaryElem, boundary.x, boundary.y + boundary.descr.Y, boundary.width, boundary.height, { fill: "#444444" }, boundaryConf ); } }; const drawC4Shape = function(elem, c4Shape, conf2) { let fillColor = c4Shape.bgColor ? c4Shape.bgColor : conf2[c4Shape.typeC4Shape.text + "_bg_color"]; let strokeColor = c4Shape.borderColor ? c4Shape.borderColor : conf2[c4Shape.typeC4Shape.text + "_border_color"]; let fontColor = c4Shape.fontColor ? c4Shape.fontColor : "#FFFFFF"; let personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII="; switch (c4Shape.typeC4Shape.text) { case "person": personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII="; break; case "external_person": personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII="; break; } const c4ShapeElem = elem.append("g"); c4ShapeElem.attr("class", "person-man"); const rect2 = getNoteRect$2(); switch (c4Shape.typeC4Shape.text) { case "person": case "external_person": case "system": case "external_system": case "container": case "external_container": case "component": case "external_component": rect2.x = c4Shape.x; rect2.y = c4Shape.y; rect2.fill = fillColor; rect2.width = c4Shape.width; rect2.height = c4Shape.height; rect2.style = "stroke:" + strokeColor + ";stroke-width:0.5;"; rect2.rx = 2.5; rect2.ry = 2.5; drawRect$2(c4ShapeElem, rect2); break; case "system_db": case "external_system_db": case "container_db": case "external_container_db": case "component_db": case "external_component_db": c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr( "d", "Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.width / 2).replaceAll("height", c4Shape.height) ); c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr( "d", "Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.width / 2) ); break; case "system_queue": case "external_system_queue": case "container_queue": case "external_container_queue": case "component_queue": case "external_component_queue": c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr( "d", "Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("width", c4Shape.width).replaceAll("half", c4Shape.height / 2) ); c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr( "d", "Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx", c4Shape.x + c4Shape.width).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.height / 2) ); break; } let c4ShapeFontConf = getC4ShapeFont(conf2, c4Shape.typeC4Shape.text); c4ShapeElem.append("text").attr("fill", fontColor).attr("font-family", c4ShapeFontConf.fontFamily).attr("font-size", c4ShapeFontConf.fontSize - 2).attr("font-style", "italic").attr("lengthAdjust", "spacing").attr("textLength", c4Shape.typeC4Shape.width).attr("x", c4Shape.x + c4Shape.width / 2 - c4Shape.typeC4Shape.width / 2).attr("y", c4Shape.y + c4Shape.typeC4Shape.Y).text("<<" + c4Shape.typeC4Shape.text + ">>"); switch (c4Shape.typeC4Shape.text) { case "person": case "external_person": drawImage$1( c4ShapeElem, 48, 48, c4Shape.x + c4Shape.width / 2 - 24, c4Shape.y + c4Shape.image.Y, personImg ); break; } let textFontConf = conf2[c4Shape.typeC4Shape.text + "Font"](); textFontConf.fontWeight = "bold"; textFontConf.fontSize = textFontConf.fontSize + 2; textFontConf.fontColor = fontColor; _drawTextCandidateFunc$2(conf2)( c4Shape.label.text, c4ShapeElem, c4Shape.x, c4Shape.y + c4Shape.label.Y, c4Shape.width, c4Shape.height, { fill: fontColor }, textFontConf ); textFontConf = conf2[c4Shape.typeC4Shape.text + "Font"](); textFontConf.fontColor = fontColor; if (c4Shape.thchn && c4Shape.thchn.text !== "") { _drawTextCandidateFunc$2(conf2)( c4Shape.thchn.text, c4ShapeElem, c4Shape.x, c4Shape.y + c4Shape.thchn.Y, c4Shape.width, c4Shape.height, { fill: fontColor, "font-style": "italic" }, textFontConf ); } else if (c4Shape.type && c4Shape.type.text !== "") { _drawTextCandidateFunc$2(conf2)( c4Shape.type.text, c4ShapeElem, c4Shape.x, c4Shape.y + c4Shape.type.Y, c4Shape.width, c4Shape.height, { fill: fontColor, "font-style": "italic" }, textFontConf ); } if (c4Shape.descr && c4Shape.descr.text !== "") { textFontConf = conf2.personFont(); textFontConf.fontColor = fontColor; _drawTextCandidateFunc$2(conf2)( c4Shape.descr.text, c4ShapeElem, c4Shape.x, c4Shape.y + c4Shape.descr.Y, c4Shape.width, c4Shape.height, { fill: fontColor }, textFontConf ); } return c4Shape.height; }; const insertDatabaseIcon$1 = function(elem) { elem.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr( "d", "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z" ); }; const insertComputerIcon$1 = function(elem) { elem.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr( "d", "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z" ); }; const insertClockIcon$1 = function(elem) { elem.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr( "d", "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z" ); }; const insertArrowHead$1 = function(elem) { elem.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z"); }; const insertArrowEnd = function(elem) { elem.append("defs").append("marker").attr("id", "arrowend").attr("refX", 1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 10 0 L 0 5 L 10 10 z"); }; const insertArrowFilledHead$1 = function(elem) { elem.append("defs").append("marker").attr("id", "filled-head").attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); }; const insertDynamicNumber = function(elem) { elem.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6); }; const insertArrowCrossHead$1 = function(elem) { const defs = elem.append("defs"); const marker = defs.append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 16).attr("refY", 4); marker.append("path").attr("fill", "black").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 9,2 V 6 L16,4 Z"); marker.append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 0,1 L 6,7 M 6,1 L 0,7"); }; const getTextObj$2 = function() { return { x: 0, y: 0, fill: void 0, anchor: void 0, style: "#666", width: void 0, height: void 0, textMargin: 0, rx: 0, ry: 0, tspan: true, valign: void 0 }; }; const getNoteRect$2 = function() { return { x: 0, y: 0, fill: "#EDF2AE", stroke: "#666", width: 100, anchor: "start", height: 100, rx: 0, ry: 0 }; }; const getC4ShapeFont = (cnf, typeC4Shape) => { return { fontFamily: cnf[typeC4Shape + "FontFamily"], fontSize: cnf[typeC4Shape + "FontSize"], fontWeight: cnf[typeC4Shape + "FontWeight"] }; }; const _drawTextCandidateFunc$2 = function() { function byText(content, g, x, y, width2, height2, textAttrs) { const text = g.append("text").attr("x", x + width2 / 2).attr("y", y + height2 / 2 + 5).style("text-anchor", "middle").text(content); _setTextAttrs(text, textAttrs); } function byTspan(content, g, x, y, width2, height2, textAttrs, conf2) { const { fontSize, fontFamily, fontWeight } = conf2; const lines = content.split(common.lineBreakRegex); for (let i = 0; i < lines.length; i++) { const dy = i * fontSize - fontSize * (lines.length - 1) / 2; const text = g.append("text").attr("x", x + width2 / 2).attr("y", y).style("text-anchor", "middle").attr("dominant-baseline", "middle").style("font-size", fontSize).style("font-weight", fontWeight).style("font-family", fontFamily); text.append("tspan").attr("dy", dy).text(lines[i]).attr("alignment-baseline", "mathematical"); _setTextAttrs(text, textAttrs); } } function byFo(content, g, x, y, width2, height2, textAttrs, conf2) { const s = g.append("switch"); const f = s.append("foreignObject").attr("x", x).attr("y", y).attr("width", width2).attr("height", height2); const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%"); text.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content); byTspan(content, s, x, y, width2, height2, textAttrs, conf2); _setTextAttrs(text, textAttrs); } function _setTextAttrs(toText, fromTextAttrsDict) { for (const key in fromTextAttrsDict) { if (fromTextAttrsDict.hasOwnProperty(key)) { toText.attr(key, fromTextAttrsDict[key]); } } } return function(conf2) { return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan; }; }(); const svgDraw$3 = { drawRect: drawRect$2, drawText: drawText$2, drawLabel: drawLabel$2, drawBoundary: drawBoundary$1, drawC4Shape, drawRels: drawRels$1, drawImage: drawImage$1, drawEmbeddedImage: drawEmbeddedImage$1, insertArrowHead: insertArrowHead$1, insertArrowEnd, insertArrowFilledHead: insertArrowFilledHead$1, insertDynamicNumber, insertArrowCrossHead: insertArrowCrossHead$1, insertDatabaseIcon: insertDatabaseIcon$1, insertComputerIcon: insertComputerIcon$1, insertClockIcon: insertClockIcon$1, getTextObj: getTextObj$2, getNoteRect: getNoteRect$2, sanitizeUrl }; let globalBoundaryMaxX = 0, globalBoundaryMaxY = 0; let c4ShapeInRow = 4; let c4BoundaryInRow = 2; parser$a.yy = c4Db; let conf$a = {}; class Bounds { constructor(diagObj) { this.name = ""; this.data = {}; this.data.startx = void 0; this.data.stopx = void 0; this.data.starty = void 0; this.data.stopy = void 0; this.data.widthLimit = void 0; this.nextData = {}; this.nextData.startx = void 0; this.nextData.stopx = void 0; this.nextData.starty = void 0; this.nextData.stopy = void 0; this.nextData.cnt = 0; setConf$a(diagObj.db.getConfig()); } setData(startx, stopx, starty, stopy) { this.nextData.startx = this.data.startx = startx; this.nextData.stopx = this.data.stopx = stopx; this.nextData.starty = this.data.starty = starty; this.nextData.stopy = this.data.stopy = stopy; } updateVal(obj, key, val, fun) { if (typeof obj[key] === "undefined") { obj[key] = val; } else { obj[key] = fun(val, obj[key]); } } insert(c4Shape) { this.nextData.cnt = this.nextData.cnt + 1; let _startx = this.nextData.startx === this.nextData.stopx ? this.nextData.stopx + c4Shape.margin : this.nextData.stopx + c4Shape.margin * 2; let _stopx = _startx + c4Shape.width; let _starty = this.nextData.starty + c4Shape.margin * 2; let _stopy = _starty + c4Shape.height; if (_startx >= this.data.widthLimit || _stopx >= this.data.widthLimit || this.nextData.cnt > c4ShapeInRow) { _startx = this.nextData.startx + c4Shape.margin + conf$a.nextLinePaddingX; _starty = this.nextData.stopy + c4Shape.margin * 2; this.nextData.stopx = _stopx = _startx + c4Shape.width; this.nextData.starty = this.nextData.stopy; this.nextData.stopy = _stopy = _starty + c4Shape.height; this.nextData.cnt = 1; } c4Shape.x = _startx; c4Shape.y = _starty; this.updateVal(this.data, "startx", _startx, Math.min); this.updateVal(this.data, "starty", _starty, Math.min); this.updateVal(this.data, "stopx", _stopx, Math.max); this.updateVal(this.data, "stopy", _stopy, Math.max); this.updateVal(this.nextData, "startx", _startx, Math.min); this.updateVal(this.nextData, "starty", _starty, Math.min); this.updateVal(this.nextData, "stopx", _stopx, Math.max); this.updateVal(this.nextData, "stopy", _stopy, Math.max); } init(diagObj) { this.name = ""; this.data = { startx: void 0, stopx: void 0, starty: void 0, stopy: void 0, widthLimit: void 0 }; this.nextData = { startx: void 0, stopx: void 0, starty: void 0, stopy: void 0, cnt: 0 }; setConf$a(diagObj.db.getConfig()); } bumpLastMargin(margin) { this.data.stopx += margin; this.data.stopy += margin; } } const setConf$a = function(cnf) { assignWithDepth(conf$a, cnf); if (cnf.fontFamily) { conf$a.personFontFamily = conf$a.systemFontFamily = conf$a.messageFontFamily = cnf.fontFamily; } if (cnf.fontSize) { conf$a.personFontSize = conf$a.systemFontSize = conf$a.messageFontSize = cnf.fontSize; } if (cnf.fontWeight) { conf$a.personFontWeight = conf$a.systemFontWeight = conf$a.messageFontWeight = cnf.fontWeight; } }; const c4ShapeFont = (cnf, typeC4Shape) => { return { fontFamily: cnf[typeC4Shape + "FontFamily"], fontSize: cnf[typeC4Shape + "FontSize"], fontWeight: cnf[typeC4Shape + "FontWeight"] }; }; const boundaryFont = (cnf) => { return { fontFamily: cnf.boundaryFontFamily, fontSize: cnf.boundaryFontSize, fontWeight: cnf.boundaryFontWeight }; }; const messageFont$1 = (cnf) => { return { fontFamily: cnf.messageFontFamily, fontSize: cnf.messageFontSize, fontWeight: cnf.messageFontWeight }; }; function calcC4ShapeTextWH(textType, c4Shape, c4ShapeTextWrap, textConf, textLimitWidth) { if (!c4Shape[textType].width) { if (c4ShapeTextWrap) { c4Shape[textType].text = wrapLabel(c4Shape[textType].text, textLimitWidth, textConf); c4Shape[textType].textLines = c4Shape[textType].text.split(common.lineBreakRegex).length; c4Shape[textType].width = textLimitWidth; c4Shape[textType].height = calculateTextHeight(c4Shape[textType].text, textConf); } else { let lines = c4Shape[textType].text.split(common.lineBreakRegex); c4Shape[textType].textLines = lines.length; let lineHeight = 0; c4Shape[textType].height = 0; c4Shape[textType].width = 0; for (let i = 0; i < lines.length; i++) { c4Shape[textType].width = Math.max( calculateTextWidth(lines[i], textConf), c4Shape[textType].width ); lineHeight = calculateTextHeight(lines[i], textConf); c4Shape[textType].height = c4Shape[textType].height + lineHeight; } } } } const drawBoundary = function(diagram, boundary, bounds2) { boundary.x = bounds2.data.startx; boundary.y = bounds2.data.starty; boundary.width = bounds2.data.stopx - bounds2.data.startx; boundary.height = bounds2.data.stopy - bounds2.data.starty; boundary.label.y = conf$a.c4ShapeMargin - 35; let boundaryTextWrap = boundary.wrap && conf$a.wrap; let boundaryLabelConf = boundaryFont(conf$a); boundaryLabelConf.fontSize = boundaryLabelConf.fontSize + 2; boundaryLabelConf.fontWeight = "bold"; let textLimitWidth = calculateTextWidth(boundary.label.text, boundaryLabelConf); calcC4ShapeTextWH("label", boundary, boundaryTextWrap, boundaryLabelConf, textLimitWidth); svgDraw$3.drawBoundary(diagram, boundary, conf$a); }; const drawC4ShapeArray = function(currentBounds, diagram, c4ShapeArray2, c4ShapeKeys) { let Y = 0; for (let i = 0; i < c4ShapeKeys.length; i++) { Y = 0; const c4Shape = c4ShapeArray2[c4ShapeKeys[i]]; let c4ShapeTypeConf = c4ShapeFont(conf$a, c4Shape.typeC4Shape.text); c4ShapeTypeConf.fontSize = c4ShapeTypeConf.fontSize - 2; c4Shape.typeC4Shape.width = calculateTextWidth( "<<" + c4Shape.typeC4Shape.text + ">>", c4ShapeTypeConf ); c4Shape.typeC4Shape.height = c4ShapeTypeConf.fontSize + 2; c4Shape.typeC4Shape.Y = conf$a.c4ShapePadding; Y = c4Shape.typeC4Shape.Y + c4Shape.typeC4Shape.height - 4; c4Shape.image = { width: 0, height: 0, Y: 0 }; switch (c4Shape.typeC4Shape.text) { case "person": case "external_person": c4Shape.image.width = 48; c4Shape.image.height = 48; c4Shape.image.Y = Y; Y = c4Shape.image.Y + c4Shape.image.height; break; } if (c4Shape.sprite) { c4Shape.image.width = 48; c4Shape.image.height = 48; c4Shape.image.Y = Y; Y = c4Shape.image.Y + c4Shape.image.height; } let c4ShapeTextWrap = c4Shape.wrap && conf$a.wrap; let textLimitWidth = conf$a.width - conf$a.c4ShapePadding * 2; let c4ShapeLabelConf = c4ShapeFont(conf$a, c4Shape.typeC4Shape.text); c4ShapeLabelConf.fontSize = c4ShapeLabelConf.fontSize + 2; c4ShapeLabelConf.fontWeight = "bold"; calcC4ShapeTextWH("label", c4Shape, c4ShapeTextWrap, c4ShapeLabelConf, textLimitWidth); c4Shape["label"].Y = Y + 8; Y = c4Shape["label"].Y + c4Shape["label"].height; if (c4Shape.type && c4Shape.type.text !== "") { c4Shape.type.text = "[" + c4Shape.type.text + "]"; let c4ShapeTypeConf2 = c4ShapeFont(conf$a, c4Shape.typeC4Shape.text); calcC4ShapeTextWH("type", c4Shape, c4ShapeTextWrap, c4ShapeTypeConf2, textLimitWidth); c4Shape["type"].Y = Y + 5; Y = c4Shape["type"].Y + c4Shape["type"].height; } else if (c4Shape.techn && c4Shape.techn.text !== "") { c4Shape.techn.text = "[" + c4Shape.techn.text + "]"; let c4ShapeTechnConf = c4ShapeFont(conf$a, c4Shape.techn.text); calcC4ShapeTextWH("techn", c4Shape, c4ShapeTextWrap, c4ShapeTechnConf, textLimitWidth); c4Shape["techn"].Y = Y + 5; Y = c4Shape["techn"].Y + c4Shape["techn"].height; } let rectHeight = Y; let rectWidth = c4Shape.label.width; if (c4Shape.descr && c4Shape.descr.text !== "") { let c4ShapeDescrConf = c4ShapeFont(conf$a, c4Shape.typeC4Shape.text); calcC4ShapeTextWH("descr", c4Shape, c4ShapeTextWrap, c4ShapeDescrConf, textLimitWidth); c4Shape["descr"].Y = Y + 20; Y = c4Shape["descr"].Y + c4Shape["descr"].height; rectWidth = Math.max(c4Shape.label.width, c4Shape.descr.width); rectHeight = Y - c4Shape["descr"].textLines * 5; } rectWidth = rectWidth + conf$a.c4ShapePadding; c4Shape.width = Math.max(c4Shape.width || conf$a.width, rectWidth, conf$a.width); c4Shape.height = Math.max(c4Shape.height || conf$a.height, rectHeight, conf$a.height); c4Shape.margin = c4Shape.margin || conf$a.c4ShapeMargin; currentBounds.insert(c4Shape); svgDraw$3.drawC4Shape(diagram, c4Shape, conf$a); } currentBounds.bumpLastMargin(conf$a.c4ShapeMargin); }; class Point { constructor(x, y) { this.x = x; this.y = y; } } let getIntersectPoint = function(fromNode, endPoint) { let x1 = fromNode.x; let y1 = fromNode.y; let x2 = endPoint.x; let y2 = endPoint.y; let fromCenterX = x1 + fromNode.width / 2; let fromCenterY = y1 + fromNode.height / 2; let dx = Math.abs(x1 - x2); let dy = Math.abs(y1 - y2); let tanDYX = dy / dx; let fromDYX = fromNode.height / fromNode.width; let returnPoint = null; if (y1 == y2 && x1 < x2) { returnPoint = new Point(x1 + fromNode.width, fromCenterY); } else if (y1 == y2 && x1 > x2) { returnPoint = new Point(x1, fromCenterY); } else if (x1 == x2 && y1 < y2) { returnPoint = new Point(fromCenterX, y1 + fromNode.height); } else if (x1 == x2 && y1 > y2) { returnPoint = new Point(fromCenterX, y1); } if (x1 > x2 && y1 < y2) { if (fromDYX >= tanDYX) { returnPoint = new Point(x1, fromCenterY + tanDYX * fromNode.width / 2); } else { returnPoint = new Point( fromCenterX - dx / dy * fromNode.height / 2, y1 + fromNode.height ); } } else if (x1 < x2 && y1 < y2) { if (fromDYX >= tanDYX) { returnPoint = new Point(x1 + fromNode.width, fromCenterY + tanDYX * fromNode.width / 2); } else { returnPoint = new Point( fromCenterX + dx / dy * fromNode.height / 2, y1 + fromNode.height ); } } else if (x1 < x2 && y1 > y2) { if (fromDYX >= tanDYX) { returnPoint = new Point(x1 + fromNode.width, fromCenterY - tanDYX * fromNode.width / 2); } else { returnPoint = new Point(fromCenterX + fromNode.height / 2 * dx / dy, y1); } } else if (x1 > x2 && y1 > y2) { if (fromDYX >= tanDYX) { returnPoint = new Point(x1, fromCenterY - fromNode.width / 2 * tanDYX); } else { returnPoint = new Point(fromCenterX - fromNode.height / 2 * dx / dy, y1); } } return returnPoint; }; let getIntersectPoints = function(fromNode, endNode) { let endIntersectPoint = { x: 0, y: 0 }; endIntersectPoint.x = endNode.x + endNode.width / 2; endIntersectPoint.y = endNode.y + endNode.height / 2; let startPoint = getIntersectPoint(fromNode, endIntersectPoint); endIntersectPoint.x = fromNode.x + fromNode.width / 2; endIntersectPoint.y = fromNode.y + fromNode.height / 2; let endPoint = getIntersectPoint(endNode, endIntersectPoint); return { startPoint, endPoint }; }; const drawRels = function(diagram, rels2, getC4ShapeObj, diagObj) { let i = 0; for (let rel of rels2) { i = i + 1; let relTextWrap = rel.wrap && conf$a.wrap; let relConf = messageFont$1(conf$a); let diagramType = diagObj.db.getC4Type(); if (diagramType === "C4Dynamic") rel.label.text = i + ": " + rel.label.text; let textLimitWidth = calculateTextWidth(rel.label.text, relConf); calcC4ShapeTextWH("label", rel, relTextWrap, relConf, textLimitWidth); if (rel.techn && rel.techn.text !== "") { textLimitWidth = calculateTextWidth(rel.techn.text, relConf); calcC4ShapeTextWH("techn", rel, relTextWrap, relConf, textLimitWidth); } if (rel.descr && rel.descr.text !== "") { textLimitWidth = calculateTextWidth(rel.descr.text, relConf); calcC4ShapeTextWH("descr", rel, relTextWrap, relConf, textLimitWidth); } let fromNode = getC4ShapeObj(rel.from); let endNode = getC4ShapeObj(rel.to); let points = getIntersectPoints(fromNode, endNode); rel.startPoint = points.startPoint; rel.endPoint = points.endPoint; } svgDraw$3.drawRels(diagram, rels2, conf$a); }; function drawInsideBoundary(diagram, parentBoundaryAlias, parentBounds, currentBoundarys, diagObj) { let currentBounds = new Bounds(diagObj); currentBounds.data.widthLimit = parentBounds.data.widthLimit / Math.min(c4BoundaryInRow, currentBoundarys.length); for (let i = 0; i < currentBoundarys.length; i++) { let currentBoundary = currentBoundarys[i]; let Y = 0; currentBoundary.image = { width: 0, height: 0, Y: 0 }; if (currentBoundary.sprite) { currentBoundary.image.width = 48; currentBoundary.image.height = 48; currentBoundary.image.Y = Y; Y = currentBoundary.image.Y + currentBoundary.image.height; } let currentBoundaryTextWrap = currentBoundary.wrap && conf$a.wrap; let currentBoundaryLabelConf = boundaryFont(conf$a); currentBoundaryLabelConf.fontSize = currentBoundaryLabelConf.fontSize + 2; currentBoundaryLabelConf.fontWeight = "bold"; calcC4ShapeTextWH( "label", currentBoundary, currentBoundaryTextWrap, currentBoundaryLabelConf, currentBounds.data.widthLimit ); currentBoundary["label"].Y = Y + 8; Y = currentBoundary["label"].Y + currentBoundary["label"].height; if (currentBoundary.type && currentBoundary.type.text !== "") { currentBoundary.type.text = "[" + currentBoundary.type.text + "]"; let currentBoundaryTypeConf = boundaryFont(conf$a); calcC4ShapeTextWH( "type", currentBoundary, currentBoundaryTextWrap, currentBoundaryTypeConf, currentBounds.data.widthLimit ); currentBoundary["type"].Y = Y + 5; Y = currentBoundary["type"].Y + currentBoundary["type"].height; } if (currentBoundary.descr && currentBoundary.descr.text !== "") { let currentBoundaryDescrConf = boundaryFont(conf$a); currentBoundaryDescrConf.fontSize = currentBoundaryDescrConf.fontSize - 2; calcC4ShapeTextWH( "descr", currentBoundary, currentBoundaryTextWrap, currentBoundaryDescrConf, currentBounds.data.widthLimit ); currentBoundary["descr"].Y = Y + 20; Y = currentBoundary["descr"].Y + currentBoundary["descr"].height; } if (i == 0 || i % c4BoundaryInRow === 0) { let _x = parentBounds.data.startx + conf$a.diagramMarginX; let _y = parentBounds.data.stopy + conf$a.diagramMarginY + Y; currentBounds.setData(_x, _x, _y, _y); } else { let _x = currentBounds.data.stopx !== currentBounds.data.startx ? currentBounds.data.stopx + conf$a.diagramMarginX : currentBounds.data.startx; let _y = currentBounds.data.starty; currentBounds.setData(_x, _x, _y, _y); } currentBounds.name = currentBoundary.alias; let currentPersonOrSystemArray = diagObj.db.getC4ShapeArray(currentBoundary.alias); let currentPersonOrSystemKeys = diagObj.db.getC4ShapeKeys(currentBoundary.alias); if (currentPersonOrSystemKeys.length > 0) { drawC4ShapeArray( currentBounds, diagram, currentPersonOrSystemArray, currentPersonOrSystemKeys ); } parentBoundaryAlias = currentBoundary.alias; let nextCurrentBoundarys = diagObj.db.getBoundarys(parentBoundaryAlias); if (nextCurrentBoundarys.length > 0) { drawInsideBoundary( diagram, parentBoundaryAlias, currentBounds, nextCurrentBoundarys, diagObj ); } if (currentBoundary.alias !== "global") drawBoundary(diagram, currentBoundary, currentBounds); parentBounds.data.stopy = Math.max( currentBounds.data.stopy + conf$a.c4ShapeMargin, parentBounds.data.stopy ); parentBounds.data.stopx = Math.max( currentBounds.data.stopx + conf$a.c4ShapeMargin, parentBounds.data.stopx ); globalBoundaryMaxX = Math.max(globalBoundaryMaxX, parentBounds.data.stopx); globalBoundaryMaxY = Math.max(globalBoundaryMaxY, parentBounds.data.stopy); } } const draw$e = function(_text, id, _version, diagObj) { conf$a = getConfig$1().c4; const securityLevel = getConfig$1().securityLevel; let sandboxElement; if (securityLevel === "sandbox") { sandboxElement = select("#i" + id); } const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); let db = diagObj.db; diagObj.db.setWrap(conf$a.wrap); c4ShapeInRow = db.getC4ShapeInRow(); c4BoundaryInRow = db.getC4BoundaryInRow(); log$1.debug(`C:${JSON.stringify(conf$a, null, 2)}`); const diagram = securityLevel === "sandbox" ? root2.select(`[id="${id}"]`) : select(`[id="${id}"]`); svgDraw$3.insertComputerIcon(diagram); svgDraw$3.insertDatabaseIcon(diagram); svgDraw$3.insertClockIcon(diagram); let screenBounds = new Bounds(diagObj); screenBounds.setData( conf$a.diagramMarginX, conf$a.diagramMarginX, conf$a.diagramMarginY, conf$a.diagramMarginY ); screenBounds.data.widthLimit = screen.availWidth; globalBoundaryMaxX = conf$a.diagramMarginX; globalBoundaryMaxY = conf$a.diagramMarginY; const title2 = diagObj.db.getTitle(); let currentBoundarys = diagObj.db.getBoundarys(""); drawInsideBoundary(diagram, "", screenBounds, currentBoundarys, diagObj); svgDraw$3.insertArrowHead(diagram); svgDraw$3.insertArrowEnd(diagram); svgDraw$3.insertArrowCrossHead(diagram); svgDraw$3.insertArrowFilledHead(diagram); drawRels(diagram, diagObj.db.getRels(), diagObj.db.getC4Shape, diagObj); screenBounds.data.stopx = globalBoundaryMaxX; screenBounds.data.stopy = globalBoundaryMaxY; const box = screenBounds.data; let boxHeight = box.stopy - box.starty; let height2 = boxHeight + 2 * conf$a.diagramMarginY; let boxWidth = box.stopx - box.startx; const width2 = boxWidth + 2 * conf$a.diagramMarginX; if (title2) { diagram.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 4 * conf$a.diagramMarginX).attr("y", box.starty + conf$a.diagramMarginY); } configureSvgSize(diagram, height2, width2, conf$a.useMaxWidth); const extraVertForTitle = title2 ? 60 : 0; diagram.attr( "viewBox", box.startx - conf$a.diagramMarginX + " -" + (conf$a.diagramMarginY + extraVertForTitle) + " " + width2 + " " + (height2 + extraVertForTitle) ); addSVGAccessibilityFields(parser$a.yy, diagram, id); log$1.debug(`models:`, box); }; const c4Renderer = { drawPersonOrSystemArray: drawC4ShapeArray, drawBoundary, setConf: setConf$a, draw: draw$e }; var parser$9 = function() { var o = function(k, v, o2, l) { for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ; return o2; }, $V0 = [1, 3], $V1 = [1, 7], $V2 = [1, 8], $V3 = [1, 9], $V4 = [1, 10], $V5 = [1, 13], $V6 = [1, 12], $V7 = [1, 16, 25], $V8 = [1, 20], $V9 = [1, 31], $Va = [1, 32], $Vb = [1, 33], $Vc = [1, 35], $Vd = [1, 38], $Ve = [1, 36], $Vf = [1, 37], $Vg = [1, 39], $Vh = [1, 40], $Vi = [1, 41], $Vj = [1, 42], $Vk = [1, 45], $Vl = [1, 46], $Vm = [1, 47], $Vn = [1, 48], $Vo = [16, 25], $Vp = [1, 62], $Vq = [1, 63], $Vr = [1, 64], $Vs = [1, 65], $Vt = [1, 66], $Vu = [1, 67], $Vv = [1, 68], $Vw = [16, 25, 32, 44, 45, 53, 56, 57, 58, 59, 60, 61, 62, 67, 69], $Vx = [16, 25, 30, 32, 44, 45, 49, 53, 56, 57, 58, 59, 60, 61, 62, 67, 69, 84, 85, 86, 87], $Vy = [5, 8, 9, 10, 11, 16, 19, 23, 25], $Vz = [53, 84, 85, 86, 87], $VA = [53, 61, 62, 84, 85, 86, 87], $VB = [53, 56, 57, 58, 59, 60, 84, 85, 86, 87], $VC = [16, 25, 32], $VD = [1, 100]; var parser2 = { trace: function trace() { }, yy: {}, symbols_: { "error": 2, "start": 3, "mermaidDoc": 4, "statments": 5, "direction": 6, "directive": 7, "direction_tb": 8, "direction_bt": 9, "direction_rl": 10, "direction_lr": 11, "graphConfig": 12, "openDirective": 13, "typeDirective": 14, "closeDirective": 15, "NEWLINE": 16, ":": 17, "argDirective": 18, "open_directive": 19, "type_directive": 20, "arg_directive": 21, "close_directive": 22, "CLASS_DIAGRAM": 23, "statements": 24, "EOF": 25, "statement": 26, "className": 27, "alphaNumToken": 28, "classLiteralName": 29, "GENERICTYPE": 30, "relationStatement": 31, "LABEL": 32, "classStatement": 33, "methodStatement": 34, "annotationStatement": 35, "clickStatement": 36, "cssClassStatement": 37, "acc_title": 38, "acc_title_value": 39, "acc_descr": 40, "acc_descr_value": 41, "acc_descr_multiline_value": 42, "CLASS": 43, "STYLE_SEPARATOR": 44, "STRUCT_START": 45, "members": 46, "STRUCT_STOP": 47, "ANNOTATION_START": 48, "ANNOTATION_END": 49, "MEMBER": 50, "SEPARATOR": 51, "relation": 52, "STR": 53, "relationType": 54, "lineType": 55, "AGGREGATION": 56, "EXTENSION": 57, "COMPOSITION": 58, "DEPENDENCY": 59, "LOLLIPOP": 60, "LINE": 61, "DOTTED_LINE": 62, "CALLBACK": 63, "LINK": 64, "LINK_TARGET": 65, "CLICK": 66, "CALLBACK_NAME": 67, "CALLBACK_ARGS": 68, "HREF": 69, "CSSCLASS": 70, "commentToken": 71, "textToken": 72, "graphCodeTokens": 73, "textNoTagsToken": 74, "TAGSTART": 75, "TAGEND": 76, "==": 77, "--": 78, "PCT": 79, "DEFAULT": 80, "SPACE": 81, "MINUS": 82, "keywords": 83, "UNICODE_TEXT": 84, "NUM": 85, "ALPHA": 86, "BQUOTE_STR": 87, "$accept": 0, "$end": 1 }, terminals_: { 2: "error", 5: "statments", 8: "direction_tb", 9: "direction_bt", 10: "direction_rl", 11: "direction_lr", 16: "NEWLINE", 17: ":", 19: "open_directive", 20: "type_directive", 21: "arg_directive", 22: "close_directive", 23: "CLASS_DIAGRAM", 25: "EOF", 30: "GENERICTYPE", 32: "LABEL", 38: "acc_title", 39: "acc_title_value", 40: "acc_descr", 41: "acc_descr_value", 42: "acc_descr_multiline_value", 43: "CLASS", 44: "STYLE_SEPARATOR", 45: "STRUCT_START", 47: "STRUCT_STOP", 48: "ANNOTATION_START", 49: "ANNOTATION_END", 50: "MEMBER", 51: "SEPARATOR", 53: "STR", 56: "AGGREGATION", 57: "EXTENSION", 58: "COMPOSITION", 59: "DEPENDENCY", 60: "LOLLIPOP", 61: "LINE", 62: "DOTTED_LINE", 63: "CALLBACK", 64: "LINK", 65: "LINK_TARGET", 66: "CLICK", 67: "CALLBACK_NAME", 68: "CALLBACK_ARGS", 69: "HREF", 70: "CSSCLASS", 73: "graphCodeTokens", 75: "TAGSTART", 76: "TAGEND", 77: "==", 78: "--", 79: "PCT", 80: "DEFAULT", 81: "SPACE", 82: "MINUS", 83: "keywords", 84: "UNICODE_TEXT", 85: "NUM", 86: "ALPHA", 87: "BQUOTE_STR" }, productions_: [0, [3, 1], [3, 1], [3, 1], [3, 2], [6, 1], [6, 1], [6, 1], [6, 1], [4, 1], [7, 4], [7, 6], [13, 1], [14, 1], [18, 1], [15, 1], [12, 4], [24, 1], [24, 2], [24, 3], [27, 1], [27, 1], [27, 2], [27, 2], [27, 2], [26, 1], [26, 2], [26, 1], [26, 1], [26, 1], [26, 1], [26, 1], [26, 1], [26, 1], [26, 2], [26, 2], [26, 1], [33, 2], [33, 4], [33, 5], [33, 7], [35, 4], [46, 1], [46, 2], [34, 1], [34, 2], [34, 1], [34, 1], [31, 3], [31, 4], [31, 4], [31, 5], [52, 3], [52, 2], [52, 2], [52, 1], [54, 1], [54, 1], [54, 1], [54, 1], [54, 1], [55, 1], [55, 1], [36, 3], [36, 4], [36, 3], [36, 4], [36, 4], [36, 5], [36, 3], [36, 4], [36, 4], [36, 5], [36, 3], [36, 4], [36, 4], [36, 5], [37, 3], [71, 1], [71, 1], [72, 1], [72, 1], [72, 1], [72, 1], [72, 1], [72, 1], [72, 1], [74, 1], [74, 1], [74, 1], [74, 1], [28, 1], [28, 1], [28, 1], [29, 1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { var $0 = $$.length - 1; switch (yystate) { case 5: yy.setDirection("TB"); break; case 6: yy.setDirection("BT"); break; case 7: yy.setDirection("RL"); break; case 8: yy.setDirection("LR"); break; case 12: yy.parseDirective("%%{", "open_directive"); break; case 13: yy.parseDirective($$[$0], "type_directive"); break; case 14: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], "arg_directive"); break; case 15: yy.parseDirective("}%%", "close_directive", "class"); break; case 20: case 21: this.$ = $$[$0]; break; case 22: this.$ = $$[$0 - 1] + $$[$0]; break; case 23: case 24: this.$ = $$[$0 - 1] + "~" + $$[$0]; break; case 25: yy.addRelation($$[$0]); break; case 26: $$[$0 - 1].title = yy.cleanupLabel($$[$0]); yy.addRelation($$[$0 - 1]); break; case 34: this.$ = $$[$0].trim(); yy.setAccTitle(this.$); break; case 35: case 36: this.$ = $$[$0].trim(); yy.setAccDescription(this.$); break; case 37: yy.addClass($$[$0]); break; case 38: yy.addClass($$[$0 - 2]); yy.setCssClass($$[$0 - 2], $$[$0]); break; case 39: yy.addClass($$[$0 - 3]); yy.addMembers($$[$0 - 3], $$[$0 - 1]); break; case 40: yy.addClass($$[$0 - 5]); yy.setCssClass($$[$0 - 5], $$[$0 - 3]); yy.addMembers($$[$0 - 5], $$[$0 - 1]); break; case 41: yy.addAnnotation($$[$0], $$[$0 - 2]); break; case 42: this.$ = [$$[$0]]; break; case 43: $$[$0].push($$[$0 - 1]); this.$ = $$[$0]; break; case 44: break; case 45: yy.addMember($$[$0 - 1], yy.cleanupLabel($$[$0])); break; case 46: break; case 47: break; case 48: this.$ = { "id1": $$[$0 - 2], "id2": $$[$0], relation: $$[$0 - 1], relationTitle1: "none", relationTitle2: "none" }; break; case 49: this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 1], relationTitle1: $$[$0 - 2], relationTitle2: "none" }; break; case 50: this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: "none", relationTitle2: $$[$0 - 1] }; break; case 51: this.$ = { id1: $$[$0 - 4], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: $$[$0 - 3], relationTitle2: $$[$0 - 1] }; break; case 52: this.$ = { type1: $$[$0 - 2], type2: $$[$0], lineType: $$[$0 - 1] }; break; case 53: this.$ = { type1: "none", type2: $$[$0], lineType: $$[$0 - 1] }; break; case 54: this.$ = { type1: $$[$0 - 1], type2: "none", lineType: $$[$0] }; break; case 55: this.$ = { type1: "none", type2: "none", lineType: $$[$0] }; break; case 56: this.$ = yy.relationType.AGGREGATION; break; case 57: this.$ = yy.relationType.EXTENSION; break; case 58: this.$ = yy.relationType.COMPOSITION; break; case 59: this.$ = yy.relationType.DEPENDENCY; break; case 60: this.$ = yy.relationType.LOLLIPOP; break; case 61: this.$ = yy.lineType.LINE; break; case 62: this.$ = yy.lineType.DOTTED_LINE; break; case 63: case 69: this.$ = $$[$0 - 2]; yy.setClickEvent($$[$0 - 1], $$[$0]); break; case 64: case 70: this.$ = $$[$0 - 3]; yy.setClickEvent($$[$0 - 2], $$[$0 - 1]); yy.setTooltip($$[$0 - 2], $$[$0]); break; case 65: case 73: this.$ = $$[$0 - 2]; yy.setLink($$[$0 - 1], $$[$0]); break; case 66: this.$ = $$[$0 - 3]; yy.setLink($$[$0 - 2], $$[$0 - 1], $$[$0]); break; case 67: case 75: this.$ = $$[$0 - 3]; yy.setLink($$[$0 - 2], $$[$0 - 1]); yy.setTooltip($$[$0 - 2], $$[$0]); break; case 68: case 76: this.$ = $$[$0 - 4]; yy.setLink($$[$0 - 3], $$[$0 - 2], $$[$0]); yy.setTooltip($$[$0 - 3], $$[$0 - 1]); break; case 71: this.$ = $$[$0 - 3]; yy.setClickEvent($$[$0 - 2], $$[$0 - 1], $$[$0]); break; case 72: this.$ = $$[$0 - 4]; yy.setClickEvent($$[$0 - 3], $$[$0 - 2], $$[$0 - 1]); yy.setTooltip($$[$0 - 3], $$[$0]); break; case 74: this.$ = $$[$0 - 3]; yy.setLink($$[$0 - 2], $$[$0 - 1], $$[$0]); break; case 77: yy.setCssClass($$[$0 - 1], $$[$0]); break; } }, table: [{ 3: 1, 4: 2, 5: $V0, 6: 4, 7: 5, 8: $V1, 9: $V2, 10: $V3, 11: $V4, 12: 6, 13: 11, 19: $V5, 23: $V6 }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3] }, { 3: 14, 4: 2, 5: $V0, 6: 4, 7: 5, 8: $V1, 9: $V2, 10: $V3, 11: $V4, 12: 6, 13: 11, 19: $V5, 23: $V6 }, { 1: [2, 9] }, o($V7, [2, 5]), o($V7, [2, 6]), o($V7, [2, 7]), o($V7, [2, 8]), { 14: 15, 20: [1, 16] }, { 16: [1, 17] }, { 20: [2, 12] }, { 1: [2, 4] }, { 15: 18, 17: [1, 19], 22: $V8 }, o([17, 22], [2, 13]), { 6: 30, 7: 29, 8: $V1, 9: $V2, 10: $V3, 11: $V4, 13: 11, 19: $V5, 24: 21, 26: 22, 27: 34, 28: 43, 29: 44, 31: 23, 33: 24, 34: 25, 35: 26, 36: 27, 37: 28, 38: $V9, 40: $Va, 42: $Vb, 43: $Vc, 48: $Vd, 50: $Ve, 51: $Vf, 63: $Vg, 64: $Vh, 66: $Vi, 70: $Vj, 84: $Vk, 85: $Vl, 86: $Vm, 87: $Vn }, { 16: [1, 49] }, { 18: 50, 21: [1, 51] }, { 16: [2, 15] }, { 25: [1, 52] }, { 16: [1, 53], 25: [2, 17] }, o($Vo, [2, 25], { 32: [1, 54] }), o($Vo, [2, 27]), o($Vo, [2, 28]), o($Vo, [2, 29]), o($Vo, [2, 30]), o($Vo, [2, 31]), o($Vo, [2, 32]), o($Vo, [2, 33]), { 39: [1, 55] }, { 41: [1, 56] }, o($Vo, [2, 36]), o($Vo, [2, 44], { 52: 57, 54: 60, 55: 61, 32: [1, 59], 53: [1, 58], 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv }), { 27: 69, 28: 43, 29: 44, 84: $Vk, 85: $Vl, 86: $Vm, 87: $Vn }, o($Vo, [2, 46]), o($Vo, [2, 47]), { 28: 70, 84: $Vk, 85: $Vl, 86: $Vm }, { 27: 71, 28: 43, 29: 44, 84: $Vk, 85: $Vl, 86: $Vm, 87: $Vn }, { 27: 72, 28: 43, 29: 44, 84: $Vk, 85: $Vl, 86: $Vm, 87: $Vn }, { 27: 73, 28: 43, 29: 44, 84: $Vk, 85: $Vl, 86: $Vm, 87: $Vn }, { 53: [1, 74] }, o($Vw, [2, 20], { 28: 43, 29: 44, 27: 75, 30: [1, 76], 84: $Vk, 85: $Vl, 86: $Vm, 87: $Vn }), o($Vw, [2, 21], { 30: [1, 77] }), o($Vx, [2, 91]), o($Vx, [2, 92]), o($Vx, [2, 93]), o([16, 25, 30, 32, 44, 45, 53, 56, 57, 58, 59, 60, 61, 62, 67, 69], [2, 94]), o($Vy, [2, 10]), { 15: 78, 22: $V8 }, { 22: [2, 14] }, { 1: [2, 16] }, { 6: 30, 7: 29, 8: $V1, 9: $V2, 10: $V3, 11: $V4, 13: 11, 19: $V5, 24: 79, 25: [2, 18], 26: 22, 27: 34, 28: 43, 29: 44, 31: 23, 33: 24, 34: 25, 35: 26, 36: 27, 37: 28, 38: $V9, 40: $Va, 42: $Vb, 43: $Vc, 48: $Vd, 50: $Ve, 51: $Vf, 63: $Vg, 64: $Vh, 66: $Vi, 70: $Vj, 84: $Vk, 85: $Vl, 86: $Vm, 87: $Vn }, o($Vo, [2, 26]), o($Vo, [2, 34]), o($Vo, [2, 35]), { 27: 80, 28: 43, 29: 44, 53: [1, 81], 84: $Vk, 85: $Vl, 86: $Vm, 87: $Vn }, { 52: 82, 54: 60, 55: 61, 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv }, o($Vo, [2, 45]), { 55: 83, 61: $Vu, 62: $Vv }, o($Vz, [2, 55], { 54: 84, 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt }), o($VA, [2, 56]), o($VA, [2, 57]), o($VA, [2, 58]), o($VA, [2, 59]), o($VA, [2, 60]), o($VB, [2, 61]), o($VB, [2, 62]), o($Vo, [2, 37], { 44: [1, 85], 45: [1, 86] }), { 49: [1, 87] }, { 53: [1, 88] }, { 53: [1, 89] }, { 67: [1, 90], 69: [1, 91] }, { 28: 92, 84: $Vk, 85: $Vl, 86: $Vm }, o($Vw, [2, 22]), o($Vw, [2, 23]), o($Vw, [2, 24]), { 16: [1, 93] }, { 25: [2, 19] }, o($VC, [2, 48]), { 27: 94, 28: 43, 29: 44, 84: $Vk, 85: $Vl, 86: $Vm, 87: $Vn }, { 27: 95, 28: 43, 29: 44, 53: [1, 96], 84: $Vk, 85: $Vl, 86: $Vm, 87: $Vn }, o($Vz, [2, 54], { 54: 97, 56: $Vp, 57: $Vq, 58: $Vr, 59: $Vs, 60: $Vt }), o($Vz, [2, 53]), { 28: 98, 84: $Vk, 85: $Vl, 86: $Vm }, { 46: 99, 50: $VD }, { 27: 101, 28: 43, 29: 44, 84: $Vk, 85: $Vl, 86: $Vm, 87: $Vn }, o($Vo, [2, 63], { 53: [1, 102] }), o($Vo, [2, 65], { 53: [1, 104], 65: [1, 103] }), o($Vo, [2, 69], { 53: [1, 105], 68: [1, 106] }), o($Vo, [2, 73], { 53: [1, 108], 65: [1, 107] }), o($Vo, [2, 77]), o($Vy, [2, 11]), o($VC, [2, 50]), o($VC, [2, 49]), { 27: 109, 28: 43, 29: 44, 84: $Vk, 85: $Vl, 86: $Vm, 87: $Vn }, o($Vz, [2, 52]), o($Vo, [2, 38], { 45: [1, 110] }), { 47: [1, 111] }, { 46: 112, 47: [2, 42], 50: $VD }, o($Vo, [2, 41]), o($Vo, [2, 64]), o($Vo, [2, 66]), o($Vo, [2, 67], { 65: [1, 113] }), o($Vo, [2, 70]), o($Vo, [2, 71], { 53: [1, 114] }), o($Vo, [2, 74]), o($Vo, [2, 75], { 65: [1, 115] }), o($VC, [2, 51]), { 46: 116, 50: $VD }, o($Vo, [2, 39]), { 47: [2, 43] }, o($Vo, [2, 68]), o($Vo, [2, 72]), o($Vo, [2, 76]), { 47: [1, 117] }, o($Vo, [2, 40])], defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 3], 6: [2, 9], 13: [2, 12], 14: [2, 4], 20: [2, 15], 51: [2, 14], 52: [2, 16], 79: [2, 19], 112: [2, 43] }, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse2(input) { var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer2 = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer2.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer2; sharedState.yy.parser = this; if (typeof lexer2.yylloc == "undefined") { lexer2.yylloc = {}; } var yyloc = lexer2.yylloc; lstack.push(yyloc); var ranges = lexer2.options && lexer2.options.ranges; if (typeof sharedState.yy.parseError === "function") { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function lex() { var token; token = tstack.pop() || lexer2.lex() || EOF; if (typeof token !== "number") { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self2.symbols_[token] || token; } return token; } var symbol, state, action, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push("'" + this.terminals_[p] + "'"); } } if (lexer2.showPosition) { errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; } else { errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); } this.parseError(errStr, { text: lexer2.match, token: this.terminals_[symbol] || symbol, line: lexer2.yylineno, loc: yyloc, expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer2.yytext); lstack.push(lexer2.yylloc); stack.push(action[1]); symbol = null; { yyleng = lexer2.yyleng; yytext = lexer2.yytext; yylineno = lexer2.yylineno; yyloc = lexer2.yylloc; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== "undefined") { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; } }; var lexer = function() { var lexer2 = { EOF: 1, parseError: function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, setInput: function(input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; this.yylineno = this.yyleng = 0; this.yytext = this.matched = this.match = ""; this.conditionStack = ["INITIAL"]; this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; if (this.options.ranges) { this.yylloc.range = [0, 0]; } this.offset = 0; return this; }, input: function() { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, unput: function(ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); this.offset -= len; var oldLines = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1); this.matched = this.matched.substr(0, this.matched.length - 1); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, more: function() { this._more = true; return this; }, reject: function() { if (this.options.backtrack_lexer) { this._backtrack = true; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, less: function(n) { this.unput(this.match.slice(n)); }, pastInput: function() { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); }, upcomingInput: function() { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20 - next.length); } return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, ""); }, showPosition: function() { var pre = this.pastInput(); var c2 = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c2 + "^"; }, test_match: function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { backup = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { for (var k in backup) { this[k] = backup[k]; } return false; } return false; }, next: function() { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ""; this.match = ""; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; } else { return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } return false; } if (this._input === "") { return this.EOF; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, lex: function lex() { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, begin: function begin(condition) { this.conditionStack.push(condition); }, popState: function popState() { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, _currentRules: function _currentRules() { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, topState: function topState(n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, pushState: function pushState(condition) { this.begin(condition); }, stateStackSize: function stateStackSize() { return this.conditionStack.length; }, options: {}, performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { switch ($avoiding_name_collisions) { case 0: this.begin("open_directive"); return 19; case 1: return 8; case 2: return 9; case 3: return 10; case 4: return 11; case 5: this.begin("type_directive"); return 20; case 6: this.popState(); this.begin("arg_directive"); return 17; case 7: this.popState(); this.popState(); return 22; case 8: return 21; case 9: break; case 10: break; case 11: this.begin("acc_title"); return 38; case 12: this.popState(); return "acc_title_value"; case 13: this.begin("acc_descr"); return 40; case 14: this.popState(); return "acc_descr_value"; case 15: this.begin("acc_descr_multiline"); break; case 16: this.popState(); break; case 17: return "acc_descr_multiline_value"; case 18: return 16; case 19: break; case 20: return 23; case 21: return 23; case 22: this.begin("struct"); return 45; case 23: return "EDGE_STATE"; case 24: return "EOF_IN_STRUCT"; case 25: return "OPEN_IN_STRUCT"; case 26: this.popState(); return 47; case 27: break; case 28: return "MEMBER"; case 29: return 43; case 30: return 70; case 31: return 63; case 32: return 64; case 33: return 66; case 34: return 48; case 35: return 49; case 36: this.begin("generic"); break; case 37: this.popState(); break; case 38: return "GENERICTYPE"; case 39: this.begin("string"); break; case 40: this.popState(); break; case 41: return "STR"; case 42: this.begin("bqstring"); break; case 43: this.popState(); break; case 44: return "BQUOTE_STR"; case 45: this.begin("href"); break; case 46: this.popState(); break; case 47: return 69; case 48: this.begin("callback_name"); break; case 49: this.popState(); break; case 50: this.popState(); this.begin("callback_args"); break; case 51: return 67; case 52: this.popState(); break; case 53: return 68; case 54: return 65; case 55: return 65; case 56: return 65; case 57: return 65; case 58: return 57; case 59: return 57; case 60: return 59; case 61: return 59; case 62: return 58; case 63: return 56; case 64: return 60; case 65: return 61; case 66: return 62; case 67: return 32; case 68: return 44; case 69: return 82; case 70: return "DOT"; case 71: return "PLUS"; case 72: return 79; case 73: return "EQUALS"; case 74: return "EQUALS"; case 75: return 86; case 76: return "PUNCTUATION"; case 77: return 85; case 78: return 84; case 79: return 81; case 80: return 25; } }, rules: [/^(?:%%\{)/, /^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:((?:(?!\}%%)[^:.])*))/, /^(?::)/, /^(?:\}%%)/, /^(?:((?:(?!\}%%).|\n)*))/, /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, /^(?:%%[^\n]*(\r?\n)*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:classDiagram-v2\b)/, /^(?:classDiagram\b)/, /^(?:[{])/, /^(?:\[\*\])/, /^(?:$)/, /^(?:[{])/, /^(?:[}])/, /^(?:[\n])/, /^(?:[^{}\n]*)/, /^(?:class\b)/, /^(?:cssClass\b)/, /^(?:callback\b)/, /^(?:link\b)/, /^(?:click\b)/, /^(?:<<)/, /^(?:>>)/, /^(?:[~])/, /^(?:[~])/, /^(?:[^~]*)/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:[`])/, /^(?:[`])/, /^(?:[^`]+)/, /^(?:href[\s]+["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:call[\s]+)/, /^(?:\([\s]*\))/, /^(?:\()/, /^(?:[^(]*)/, /^(?:\))/, /^(?:[^)]*)/, /^(?:_self\b)/, /^(?:_blank\b)/, /^(?:_parent\b)/, /^(?:_top\b)/, /^(?:\s*<\|)/, /^(?:\s*\|>)/, /^(?:\s*>)/, /^(?:\s*<)/, /^(?:\s*\*)/, /^(?:\s*o\b)/, /^(?:\s*\(\))/, /^(?:--)/, /^(?:\.\.)/, /^(?::{1}[^:\n;]+)/, /^(?::{3})/, /^(?:-)/, /^(?:\.)/, /^(?:\+)/, /^(?:%)/, /^(?:=)/, /^(?:=)/, /^(?:\w+)/, /^(?:[!"#$%&'*+,-.`?\\/])/, /^(?:[0-9]+)/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\s)/, /^(?:$)/], conditions: { "acc_descr_multiline": { "rules": [16, 17], "inclusive": false }, "acc_descr": { "rules": [14], "inclusive": false }, "acc_title": { "rules": [12], "inclusive": false }, "arg_directive": { "rules": [7, 8], "inclusive": false }, "type_directive": { "rules": [6, 7], "inclusive": false }, "open_directive": { "rules": [5], "inclusive": false }, "callback_args": { "rules": [52, 53], "inclusive": false }, "callback_name": { "rules": [49, 50, 51], "inclusive": false }, "href": { "rules": [46, 47], "inclusive": false }, "struct": { "rules": [23, 24, 25, 26, 27, 28], "inclusive": false }, "generic": { "rules": [37, 38], "inclusive": false }, "bqstring": { "rules": [43, 44], "inclusive": false }, "string": { "rules": [40, 41], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 9, 10, 11, 13, 15, 18, 19, 20, 21, 22, 23, 29, 30, 31, 32, 33, 34, 35, 36, 39, 42, 45, 48, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80], "inclusive": true } } }; return lexer2; }(); parser2.lexer = lexer; function Parser() { this.yy = {}; } Parser.prototype = parser2; parser2.Parser = Parser; return new Parser(); }(); parser$9.parser = parser$9; const classDetector = (txt, config2) => { var _a; if (((_a = config2 == null ? void 0 : config2.class) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper") return false; return txt.match(/^\s*classDiagram/) !== null; }; const classDetectorV2 = (txt, config2) => { var _a; if (txt.match(/^\s*classDiagram/) !== null && ((_a = config2 == null ? void 0 : config2.class) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper") return true; return txt.match(/^\s*classDiagram-v2/) !== null; }; const MERMAID_DOM_ID_PREFIX$1 = "classid-"; let relations$1 = []; let classes$2 = {}; let classCounter = 0; let funs$2 = []; const sanitizeText$2 = (txt) => common.sanitizeText(txt, getConfig$1()); const parseDirective$9 = function(statement, context, type2) { mermaidAPI.parseDirective(this, statement, context, type2); }; const splitClassNameAndType = function(id) { let genericType = ""; let className = id; if (id.indexOf("~") > 0) { let split = id.split("~"); className = split[0]; genericType = common.sanitizeText(split[1], getConfig$1()); } return { className, type: genericType }; }; const addClass$1 = function(id) { let classId = splitClassNameAndType(id); if (typeof classes$2[classId.className] !== "undefined") return; classes$2[classId.className] = { id: classId.className, type: classId.type, cssClasses: [], methods: [], members: [], annotations: [], domId: MERMAID_DOM_ID_PREFIX$1 + classId.className + "-" + classCounter }; classCounter++; }; const lookUpDomId$1 = function(id) { const classKeys = Object.keys(classes$2); for (let i = 0; i < classKeys.length; i++) { if (classes$2[classKeys[i]].id === id) { return classes$2[classKeys[i]].domId; } } }; const clear$c = function() { relations$1 = []; classes$2 = {}; funs$2 = []; funs$2.push(setupToolTips$1); clear$g(); }; const getClass = function(id) { return classes$2[id]; }; const getClasses$5 = function() { return classes$2; }; const getRelations$1 = function() { return relations$1; }; const addRelation$1 = function(relation) { log$1.debug("Adding relation: " + JSON.stringify(relation)); addClass$1(relation.id1); addClass$1(relation.id2); relation.id1 = splitClassNameAndType(relation.id1).className; relation.id2 = splitClassNameAndType(relation.id2).className; relation.relationTitle1 = common.sanitizeText( relation.relationTitle1.trim(), getConfig$1() ); relation.relationTitle2 = common.sanitizeText( relation.relationTitle2.trim(), getConfig$1() ); relations$1.push(relation); }; const addAnnotation = function(className, annotation) { const validatedClassName = splitClassNameAndType(className).className; classes$2[validatedClassName].annotations.push(annotation); }; const addMember = function(className, member) { const validatedClassName = splitClassNameAndType(className).className; const theClass = classes$2[validatedClassName]; if (typeof member === "string") { const memberString = member.trim(); if (memberString.startsWith("<<") && memberString.endsWith(">>")) { theClass.annotations.push(sanitizeText$2(memberString.substring(2, memberString.length - 2))); } else if (memberString.indexOf(")") > 0) { theClass.methods.push(sanitizeText$2(memberString)); } else if (memberString) { theClass.members.push(sanitizeText$2(memberString)); } } }; const addMembers = function(className, members) { if (Array.isArray(members)) { members.reverse(); members.forEach((member) => addMember(className, member)); } }; const cleanupLabel$1 = function(label) { if (label.substring(0, 1) === ":") { return common.sanitizeText(label.substr(1).trim(), getConfig$1()); } else { return sanitizeText$2(label.trim()); } }; const setCssClass = function(ids, className) { ids.split(",").forEach(function(_id) { let id = _id; if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX$1 + id; if (typeof classes$2[id] !== "undefined") { classes$2[id].cssClasses.push(className); } }); }; const setTooltip$1 = function(ids, tooltip) { const config2 = getConfig$1(); ids.split(",").forEach(function(id) { if (typeof tooltip !== "undefined") { classes$2[id].tooltip = common.sanitizeText(tooltip, config2); } }); }; const getTooltip$1 = function(id) { return classes$2[id].tooltip; }; const setLink$2 = function(ids, linkStr, target) { const config2 = getConfig$1(); ids.split(",").forEach(function(_id) { let id = _id; if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX$1 + id; if (typeof classes$2[id] !== "undefined") { classes$2[id].link = utils.formatUrl(linkStr, config2); if (config2.securityLevel === "sandbox") { classes$2[id].linkTarget = "_top"; } else if (typeof target === "string") { classes$2[id].linkTarget = sanitizeText$2(target); } else { classes$2[id].linkTarget = "_blank"; } } }); setCssClass(ids, "clickable"); }; const setClickEvent$2 = function(ids, functionName, functionArgs) { ids.split(",").forEach(function(id) { setClickFunc(id, functionName, functionArgs); classes$2[id].haveCallback = true; }); setCssClass(ids, "clickable"); }; const setClickFunc = function(domId, functionName, functionArgs) { const config2 = getConfig$1(); let id = domId; let elemId = lookUpDomId$1(id); if (config2.securityLevel !== "loose") { return; } if (typeof functionName === "undefined") { return; } if (typeof classes$2[id] !== "undefined") { let argList = []; if (typeof functionArgs === "string") { argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); for (let i = 0; i < argList.length; i++) { let item = argList[i].trim(); if (item.charAt(0) === '"' && item.charAt(item.length - 1) === '"') { item = item.substr(1, item.length - 2); } argList[i] = item; } } if (argList.length === 0) { argList.push(elemId); } funs$2.push(function() { const elem = document.querySelector(`[id="${elemId}"]`); if (elem !== null) { elem.addEventListener( "click", function() { utils.runFunc(functionName, ...argList); }, false ); } }); } }; const bindFunctions$2 = function(element) { funs$2.forEach(function(fun) { fun(element); }); }; const lineType$1 = { LINE: 0, DOTTED_LINE: 1 }; const relationType$1 = { AGGREGATION: 0, EXTENSION: 1, COMPOSITION: 2, DEPENDENCY: 3, LOLLIPOP: 4 }; const setupToolTips$1 = function(element) { let tooltipElem = select(".mermaidTooltip"); if ((tooltipElem._groups || tooltipElem)[0][0] === null) { tooltipElem = select("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0); } const svg = select(element).select("svg"); const nodes = svg.selectAll("g.node"); nodes.on("mouseover", function() { const el = select(this); const title2 = el.attr("title"); if (title2 === null) { return; } const rect2 = this.getBoundingClientRect(); tooltipElem.transition().duration(200).style("opacity", ".9"); tooltipElem.text(el.attr("title")).style("left", window.scrollX + rect2.left + (rect2.right - rect2.left) / 2 + "px").style("top", window.scrollY + rect2.top - 14 + document.body.scrollTop + "px"); tooltipElem.html(tooltipElem.html().replace(/<br\/>/g, "
")); el.classed("hover", true); }).on("mouseout", function() { tooltipElem.transition().duration(500).style("opacity", 0); const el = select(this); el.classed("hover", false); }); }; funs$2.push(setupToolTips$1); let direction$2 = "TB"; const getDirection$2 = () => direction$2; const setDirection$2 = (dir) => { direction$2 = dir; }; const classDb = { parseDirective: parseDirective$9, setAccTitle, getAccTitle, getAccDescription, setAccDescription, getConfig: () => getConfig$1().class, addClass: addClass$1, bindFunctions: bindFunctions$2, clear: clear$c, getClass, getClasses: getClasses$5, addAnnotation, getRelations: getRelations$1, addRelation: addRelation$1, getDirection: getDirection$2, setDirection: setDirection$2, addMember, addMembers, cleanupLabel: cleanupLabel$1, lineType: lineType$1, relationType: relationType$1, setClickEvent: setClickEvent$2, setCssClass, setLink: setLink$2, getTooltip: getTooltip$1, setTooltip: setTooltip$1, lookUpDomId: lookUpDomId$1 }; let edgeCount$1 = 0; const drawEdge$1 = function(elem, path, relation, conf2, diagObj) { const getRelationType = function(type2) { switch (type2) { case diagObj.db.relationType.AGGREGATION: return "aggregation"; case diagObj.db.EXTENSION: return "extension"; case diagObj.db.COMPOSITION: return "composition"; case diagObj.db.DEPENDENCY: return "dependency"; case diagObj.db.LOLLIPOP: return "lollipop"; } }; path.points = path.points.filter((p) => !Number.isNaN(p.y)); const lineData = path.points; const lineFunction = line().x(function(d) { return d.x; }).y(function(d) { return d.y; }).curve(curveBasis); const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", "edge" + edgeCount$1).attr("class", "relation"); let url = ""; if (conf2.arrowMarkerAbsolute) { url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; url = url.replace(/\(/g, "\\("); url = url.replace(/\)/g, "\\)"); } if (relation.relation.lineType == 1) { svgPath.attr("class", "relation dashed-line"); } if (relation.relation.type1 !== "none") { svgPath.attr( "marker-start", "url(" + url + "#" + getRelationType(relation.relation.type1) + "Start)" ); } if (relation.relation.type2 !== "none") { svgPath.attr( "marker-end", "url(" + url + "#" + getRelationType(relation.relation.type2) + "End)" ); } let x, y; const l = path.points.length; let labelPosition = utils.calcLabelPosition(path.points); x = labelPosition.x; y = labelPosition.y; let p1_card_x, p1_card_y; let p2_card_x, p2_card_y; if (l % 2 !== 0 && l > 1) { let cardinality_1_point = utils.calcCardinalityPosition( relation.relation.type1 !== "none", path.points, path.points[0] ); let cardinality_2_point = utils.calcCardinalityPosition( relation.relation.type2 !== "none", path.points, path.points[l - 1] ); log$1.debug("cardinality_1_point " + JSON.stringify(cardinality_1_point)); log$1.debug("cardinality_2_point " + JSON.stringify(cardinality_2_point)); p1_card_x = cardinality_1_point.x; p1_card_y = cardinality_1_point.y; p2_card_x = cardinality_2_point.x; p2_card_y = cardinality_2_point.y; } if (typeof relation.title !== "undefined") { const g = elem.append("g").attr("class", "classLabel"); const label = g.append("text").attr("class", "label").attr("x", x).attr("y", y).attr("fill", "red").attr("text-anchor", "middle").text(relation.title); window.label = label; const bounds2 = label.node().getBBox(); g.insert("rect", ":first-child").attr("class", "box").attr("x", bounds2.x - conf2.padding / 2).attr("y", bounds2.y - conf2.padding / 2).attr("width", bounds2.width + conf2.padding).attr("height", bounds2.height + conf2.padding); } log$1.info("Rendering relation " + JSON.stringify(relation)); if (typeof relation.relationTitle1 !== "undefined" && relation.relationTitle1 !== "none") { const g = elem.append("g").attr("class", "cardinality"); g.append("text").attr("class", "type1").attr("x", p1_card_x).attr("y", p1_card_y).attr("fill", "black").attr("font-size", "6").text(relation.relationTitle1); } if (typeof relation.relationTitle2 !== "undefined" && relation.relationTitle2 !== "none") { const g = elem.append("g").attr("class", "cardinality"); g.append("text").attr("class", "type2").attr("x", p2_card_x).attr("y", p2_card_y).attr("fill", "black").attr("font-size", "6").text(relation.relationTitle2); } edgeCount$1++; }; const drawClass = function(elem, classDef, conf2, diagObj) { log$1.debug("Rendering class ", classDef, conf2); const id = classDef.id; const classInfo = { id, label: classDef.id, width: 0, height: 0 }; const g = elem.append("g").attr("id", diagObj.db.lookUpDomId(id)).attr("class", "classGroup"); let title2; if (classDef.link) { title2 = g.append("svg:a").attr("xlink:href", classDef.link).attr("target", classDef.linkTarget).append("text").attr("y", conf2.textHeight + conf2.padding).attr("x", 0); } else { title2 = g.append("text").attr("y", conf2.textHeight + conf2.padding).attr("x", 0); } let isFirst = true; classDef.annotations.forEach(function(member) { const titleText2 = title2.append("tspan").text("\xAB" + member + "\xBB"); if (!isFirst) titleText2.attr("dy", conf2.textHeight); isFirst = false; }); let classTitleString = classDef.id; if (classDef.type !== void 0 && classDef.type !== "") { classTitleString += "<" + classDef.type + ">"; } const classTitle = title2.append("tspan").text(classTitleString).attr("class", "title"); if (!isFirst) classTitle.attr("dy", conf2.textHeight); const titleHeight = title2.node().getBBox().height; const membersLine = g.append("line").attr("x1", 0).attr("y1", conf2.padding + titleHeight + conf2.dividerMargin / 2).attr("y2", conf2.padding + titleHeight + conf2.dividerMargin / 2); const members = g.append("text").attr("x", conf2.padding).attr("y", titleHeight + conf2.dividerMargin + conf2.textHeight).attr("fill", "white").attr("class", "classText"); isFirst = true; classDef.members.forEach(function(member) { addTspan(members, member, isFirst, conf2); isFirst = false; }); const membersBox = members.node().getBBox(); const methodsLine = g.append("line").attr("x1", 0).attr("y1", conf2.padding + titleHeight + conf2.dividerMargin + membersBox.height).attr("y2", conf2.padding + titleHeight + conf2.dividerMargin + membersBox.height); const methods = g.append("text").attr("x", conf2.padding).attr("y", titleHeight + 2 * conf2.dividerMargin + membersBox.height + conf2.textHeight).attr("fill", "white").attr("class", "classText"); isFirst = true; classDef.methods.forEach(function(method) { addTspan(methods, method, isFirst, conf2); isFirst = false; }); const classBox = g.node().getBBox(); var cssClassStr = " "; if (classDef.cssClasses.length > 0) { cssClassStr = cssClassStr + classDef.cssClasses.join(" "); } const rect2 = g.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", classBox.width + 2 * conf2.padding).attr("height", classBox.height + conf2.padding + 0.5 * conf2.dividerMargin).attr("class", cssClassStr); const rectWidth = rect2.node().getBBox().width; title2.node().childNodes.forEach(function(x) { x.setAttribute("x", (rectWidth - x.getBBox().width) / 2); }); if (classDef.tooltip) { title2.insert("title").text(classDef.tooltip); } membersLine.attr("x2", rectWidth); methodsLine.attr("x2", rectWidth); classInfo.width = rectWidth; classInfo.height = classBox.height + conf2.padding + 0.5 * conf2.dividerMargin; return classInfo; }; const parseMember = function(text) { const fieldRegEx = /^(\+|-|~|#)?(\w+)(~\w+~|\[\])?\s+(\w+) *(\*|\$)?$/; const methodRegEx = /^([+|\-|~|#])?(\w+) *\( *(.*)\) *(\*|\$)? *(\w*[~|[\]]*\s*\w*~?)$/; let fieldMatch = text.match(fieldRegEx); let methodMatch = text.match(methodRegEx); if (fieldMatch && !methodMatch) { return buildFieldDisplay(fieldMatch); } else if (methodMatch) { return buildMethodDisplay(methodMatch); } else { return buildLegacyDisplay(text); } }; const buildFieldDisplay = function(parsedText) { let cssStyle = ""; let displayText = ""; try { let visibility = parsedText[1] ? parsedText[1].trim() : ""; let fieldType = parsedText[2] ? parsedText[2].trim() : ""; let genericType = parsedText[3] ? parseGenericTypes(parsedText[3].trim()) : ""; let fieldName = parsedText[4] ? parsedText[4].trim() : ""; let classifier = parsedText[5] ? parsedText[5].trim() : ""; displayText = visibility + fieldType + genericType + " " + fieldName; cssStyle = parseClassifier(classifier); } catch (err) { displayText = parsedText; } return { displayText, cssStyle }; }; const buildMethodDisplay = function(parsedText) { let cssStyle = ""; let displayText = ""; try { let visibility = parsedText[1] ? parsedText[1].trim() : ""; let methodName = parsedText[2] ? parsedText[2].trim() : ""; let parameters = parsedText[3] ? parseGenericTypes(parsedText[3].trim()) : ""; let classifier = parsedText[4] ? parsedText[4].trim() : ""; let returnType = parsedText[5] ? " : " + parseGenericTypes(parsedText[5]).trim() : ""; displayText = visibility + methodName + "(" + parameters + ")" + returnType; cssStyle = parseClassifier(classifier); } catch (err) { displayText = parsedText; } return { displayText, cssStyle }; }; const buildLegacyDisplay = function(text) { let displayText = ""; let cssStyle = ""; let returnType = ""; let methodStart = text.indexOf("("); let methodEnd = text.indexOf(")"); if (methodStart > 1 && methodEnd > methodStart && methodEnd <= text.length) { let visibility = ""; let methodName = ""; let firstChar = text.substring(0, 1); if (firstChar.match(/\w/)) { methodName = text.substring(0, methodStart).trim(); } else { if (firstChar.match(/\+|-|~|#/)) { visibility = firstChar; } methodName = text.substring(1, methodStart).trim(); } const parameters = text.substring(methodStart + 1, methodEnd); text.substring(methodEnd + 1, 1); cssStyle = parseClassifier(text.substring(methodEnd + 1, methodEnd + 2)); displayText = visibility + methodName + "(" + parseGenericTypes(parameters.trim()) + ")"; if (methodEnd < text.length) { returnType = text.substring(methodEnd + 2).trim(); if (returnType !== "") { returnType = " : " + parseGenericTypes(returnType); displayText += returnType; } } } else { displayText = parseGenericTypes(text); } return { displayText, cssStyle }; }; const addTspan = function(textEl, txt, isFirst, conf2) { let member = parseMember(txt); const tSpan = textEl.append("tspan").attr("x", conf2.padding).text(member.displayText); if (member.cssStyle !== "") { tSpan.attr("style", member.cssStyle); } if (!isFirst) { tSpan.attr("dy", conf2.textHeight); } }; const parseClassifier = function(classifier) { switch (classifier) { case "*": return "font-style:italic;"; case "$": return "text-decoration:underline;"; default: return ""; } }; const svgDraw$2 = { drawClass, drawEdge: drawEdge$1, parseMember }; let idCache = {}; const padding = 20; const getGraphId = function(label) { const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label); if (foundEntry) { return foundEntry[0]; } }; const insertMarkers$3 = function(elem) { elem.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"); elem.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"); elem.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); elem.append("defs").append("marker").attr("id", "compositionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); elem.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); elem.append("defs").append("marker").attr("id", "aggregationEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); elem.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"); elem.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); }; const draw$d = function(text, id, _version, diagObj) { const conf2 = getConfig$1().class; idCache = {}; log$1.info("Rendering diagram " + text); const securityLevel = getConfig$1().securityLevel; let sandboxElement; if (securityLevel === "sandbox") { sandboxElement = select("#i" + id); } const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); const diagram = root2.select(`[id='${id}']`); insertMarkers$3(diagram); const g = new graphlib.Graph({ multigraph: true }); g.setGraph({ isMultiGraph: true }); g.setDefaultEdgeLabel(function() { return {}; }); const classes2 = diagObj.db.getClasses(); const keys = Object.keys(classes2); for (let i = 0; i < keys.length; i++) { const classDef = classes2[keys[i]]; const node = svgDraw$2.drawClass(diagram, classDef, conf2, diagObj); idCache[node.id] = node; g.setNode(node.id, node); log$1.info("Org height: " + node.height); } const relations2 = diagObj.db.getRelations(); relations2.forEach(function(relation) { log$1.info( "tjoho" + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation) ); g.setEdge( getGraphId(relation.id1), getGraphId(relation.id2), { relation }, relation.title || "DEFAULT" ); }); dagre.layout(g); g.nodes().forEach(function(v) { if (typeof v !== "undefined" && typeof g.node(v) !== "undefined") { log$1.debug("Node " + v + ": " + JSON.stringify(g.node(v))); root2.select("#" + diagObj.db.lookUpDomId(v)).attr( "transform", "translate(" + (g.node(v).x - g.node(v).width / 2) + "," + (g.node(v).y - g.node(v).height / 2) + " )" ); } }); g.edges().forEach(function(e) { if (typeof e !== "undefined" && typeof g.edge(e) !== "undefined") { log$1.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(g.edge(e))); svgDraw$2.drawEdge(diagram, g.edge(e), g.edge(e).relation, conf2, diagObj); } }); const svgBounds = diagram.node().getBBox(); const width2 = svgBounds.width + padding * 2; const height2 = svgBounds.height + padding * 2; configureSvgSize(diagram, height2, width2, conf2.useMaxWidth); const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width2} ${height2}`; log$1.debug(`viewBox ${vBox}`); diagram.attr("viewBox", vBox); addSVGAccessibilityFields(diagObj.db, diagram, id); }; const classRenderer = { draw: draw$d }; const insertMarkers$2 = (elem, markerArray, type2, id) => { markerArray.forEach((markerName) => { markers$1[markerName](elem, type2, id); }); }; const extension = (elem, type2, id) => { log$1.trace("Making markers for ", id); elem.append("defs").append("marker").attr("id", type2 + "-extensionStart").attr("class", "marker extension " + type2).attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"); elem.append("defs").append("marker").attr("id", type2 + "-extensionEnd").attr("class", "marker extension " + type2).attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"); }; const composition = (elem, type2) => { elem.append("defs").append("marker").attr("id", type2 + "-compositionStart").attr("class", "marker composition " + type2).attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); elem.append("defs").append("marker").attr("id", type2 + "-compositionEnd").attr("class", "marker composition " + type2).attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); }; const aggregation = (elem, type2) => { elem.append("defs").append("marker").attr("id", type2 + "-aggregationStart").attr("class", "marker aggregation " + type2).attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); elem.append("defs").append("marker").attr("id", type2 + "-aggregationEnd").attr("class", "marker aggregation " + type2).attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); }; const dependency = (elem, type2) => { elem.append("defs").append("marker").attr("id", type2 + "-dependencyStart").attr("class", "marker dependency " + type2).attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"); elem.append("defs").append("marker").attr("id", type2 + "-dependencyEnd").attr("class", "marker dependency " + type2).attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); }; const lollipop = (elem, type2) => { elem.append("defs").append("marker").attr("id", type2 + "-lollipopStart").attr("class", "marker lollipop " + type2).attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "white").attr("cx", 6).attr("cy", 7).attr("r", 6); }; const point = (elem, type2) => { elem.append("marker").attr("id", type2 + "-pointEnd").attr("class", "marker " + type2).attr("viewBox", "0 0 10 10").attr("refX", 10).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); elem.append("marker").attr("id", type2 + "-pointStart").attr("class", "marker " + type2).attr("viewBox", "0 0 10 10").attr("refX", 0).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); }; const circle$1 = (elem, type2) => { elem.append("marker").attr("id", type2 + "-circleEnd").attr("class", "marker " + type2).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); elem.append("marker").attr("id", type2 + "-circleStart").attr("class", "marker " + type2).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); }; const cross = (elem, type2) => { elem.append("marker").attr("id", type2 + "-crossEnd").attr("class", "marker cross " + type2).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"); elem.append("marker").attr("id", type2 + "-crossStart").attr("class", "marker cross " + type2).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"); }; const barb = (elem, type2) => { elem.append("defs").append("marker").attr("id", type2 + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z"); }; const markers$1 = { extension, composition, aggregation, dependency, lollipop, point, circle: circle$1, cross, barb }; function applyStyle$1(dom, styleFn) { if (styleFn) { dom.attr("style", styleFn); } } function addHtmlLabel$1(node) { const fo = select(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")); const div = fo.append("xhtml:div"); const label = node.label; const labelClass = node.isNode ? "nodeLabel" : "edgeLabel"; div.html( '" + label + "" ); applyStyle$1(div, node.labelStyle); div.style("display", "inline-block"); div.style("white-space", "nowrap"); div.attr("xmlns", "http://www.w3.org/1999/xhtml"); return fo.node(); } const createLabel = (_vertexText, style, isTitle, isNode) => { let vertexText = _vertexText || ""; if (typeof vertexText === "object") vertexText = vertexText[0]; if (evaluate(getConfig$1().flowchart.htmlLabels)) { vertexText = vertexText.replace(/\\n|\n/g, "
"); log$1.info("vertexText" + vertexText); const node = { isNode, label: decodeEntities(vertexText).replace( /fa[lrsb]?:fa-[\w-]+/g, (s) => `` ), labelStyle: style.replace("fill:", "color:") }; let vertexNode = addHtmlLabel$1(node); return vertexNode; } else { const svgLabel = document.createElementNS("http://www.w3.org/2000/svg", "text"); svgLabel.setAttribute("style", style.replace("color:", "fill:")); let rows = []; if (typeof vertexText === "string") { rows = vertexText.split(/\\n|\n|/gi); } else if (Array.isArray(vertexText)) { rows = vertexText; } else { rows = []; } for (let j = 0; j < rows.length; j++) { const tspan = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"); tspan.setAttribute("dy", "1em"); tspan.setAttribute("x", "0"); if (isTitle) { tspan.setAttribute("class", "title-row"); } else { tspan.setAttribute("class", "row"); } tspan.textContent = rows[j].trim(); svgLabel.appendChild(tspan); } return svgLabel; } }; const labelHelper = (parent, node, _classes, isNode) => { let classes2; if (!_classes) { classes2 = "node default"; } else { classes2 = _classes; } const shapeSvg = parent.insert("g").attr("class", classes2).attr("id", node.domId || node.id); const label = shapeSvg.insert("g").attr("class", "label").attr("style", node.labelStyle); let labelText; if (typeof node.labelText === "undefined") { labelText = ""; } else { labelText = typeof node.labelText === "string" ? node.labelText : node.labelText[0]; } const text = label.node().appendChild( createLabel( sanitizeText$5(decodeEntities(labelText), getConfig$1()), node.labelStyle, false, isNode ) ); let bbox = text.getBBox(); if (evaluate(getConfig$1().flowchart.htmlLabels)) { const div = text.children[0]; const dv = select(text); bbox = div.getBoundingClientRect(); dv.attr("width", bbox.width); dv.attr("height", bbox.height); } const halfPadding = node.padding / 2; label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")"); return { shapeSvg, bbox, halfPadding, label }; }; const updateNodeBounds = (node, element) => { const bbox = element.node().getBBox(); node.width = bbox.width; node.height = bbox.height; }; function insertPolygonShape$1(parent, w2, h, points) { return parent.insert("polygon", ":first-child").attr( "points", points.map(function(d) { return d.x + "," + d.y; }).join(" ") ).attr("class", "label-container").attr("transform", "translate(" + -w2 / 2 + "," + h / 2 + ")"); } let clusterDb = {}; let decendants = {}; let parents = {}; const clear$b = () => { decendants = {}; parents = {}; clusterDb = {}; }; const isDecendant = (id, ancenstorId) => { log$1.trace( "In isDecendant", ancenstorId, " ", id, " = ", decendants[ancenstorId].indexOf(id) >= 0 ); if (decendants[ancenstorId].indexOf(id) >= 0) return true; return false; }; const edgeInCluster = (edge, clusterId) => { log$1.info("Decendants of ", clusterId, " is ", decendants[clusterId]); log$1.info("Edge is ", edge); if (edge.v === clusterId) return false; if (edge.w === clusterId) return false; if (!decendants[clusterId]) { log$1.debug("Tilt, ", clusterId, ",not in decendants"); return false; } if (decendants[clusterId].indexOf(edge.v) >= 0) return true; if (isDecendant(edge.v, clusterId)) return true; if (isDecendant(edge.w, clusterId)) return true; if (decendants[clusterId].indexOf(edge.w) >= 0) return true; return false; }; const copy = (clusterId, graph, newGraph, rootId) => { log$1.warn( "Copying children of ", clusterId, "root", rootId, "data", graph.node(clusterId), rootId ); const nodes = graph.children(clusterId) || []; if (clusterId !== rootId) { nodes.push(clusterId); } log$1.warn("Copying (nodes) clusterId", clusterId, "nodes", nodes); nodes.forEach((node) => { if (graph.children(node).length > 0) { copy(node, graph, newGraph, rootId); } else { const data = graph.node(node); log$1.info("cp ", node, " to ", rootId, " with parent ", clusterId); newGraph.setNode(node, data); if (rootId !== graph.parent(node)) { log$1.warn("Setting parent", node, graph.parent(node)); newGraph.setParent(node, graph.parent(node)); } if (clusterId !== rootId && node !== clusterId) { log$1.debug("Setting parent", node, clusterId); newGraph.setParent(node, clusterId); } else { log$1.info("In copy ", clusterId, "root", rootId, "data", graph.node(clusterId), rootId); log$1.debug( "Not Setting parent for node=", node, "cluster!==rootId", clusterId !== rootId, "node!==clusterId", node !== clusterId ); } const edges2 = graph.edges(node); log$1.debug("Copying Edges", edges2); edges2.forEach((edge) => { log$1.info("Edge", edge); const data2 = graph.edge(edge.v, edge.w, edge.name); log$1.info("Edge data", data2, rootId); try { if (edgeInCluster(edge, rootId)) { log$1.info("Copying as ", edge.v, edge.w, data2, edge.name); newGraph.setEdge(edge.v, edge.w, data2, edge.name); log$1.info("newGraph edges ", newGraph.edges(), newGraph.edge(newGraph.edges()[0])); } else { log$1.info( "Skipping copy of edge ", edge.v, "-->", edge.w, " rootId: ", rootId, " clusterId:", clusterId ); } } catch (e) { log$1.error(e); } }); } log$1.debug("Removing node", node); graph.removeNode(node); }); }; const extractDecendants = (id, graph) => { const children = graph.children(id); let res = [].concat(children); for (let i = 0; i < children.length; i++) { parents[children[i]] = id; res = res.concat(extractDecendants(children[i], graph)); } return res; }; const findNonClusterChild = (id, graph) => { log$1.trace("Searching", id); const children = graph.children(id); log$1.trace("Searching children of id ", id, children); if (children.length < 1) { log$1.trace("This is a valid node", id); return id; } for (let i = 0; i < children.length; i++) { const _id = findNonClusterChild(children[i], graph); if (_id) { log$1.trace("Found replacement for", id, " => ", _id); return _id; } } }; const getAnchorId = (id) => { if (!clusterDb[id]) { return id; } if (!clusterDb[id].externalConnections) { return id; } if (clusterDb[id]) { return clusterDb[id].id; } return id; }; const adjustClustersAndEdges = (graph, depth) => { if (!graph || depth > 10) { log$1.debug("Opting out, no graph "); return; } else { log$1.debug("Opting in, graph "); } graph.nodes().forEach(function(id) { const children = graph.children(id); if (children.length > 0) { log$1.warn( "Cluster identified", id, " Replacement id in edges: ", findNonClusterChild(id, graph) ); decendants[id] = extractDecendants(id, graph); clusterDb[id] = { id: findNonClusterChild(id, graph), clusterData: graph.node(id) }; } }); graph.nodes().forEach(function(id) { const children = graph.children(id); const edges2 = graph.edges(); if (children.length > 0) { log$1.debug("Cluster identified", id, decendants); edges2.forEach((edge) => { if (edge.v !== id && edge.w !== id) { const d1 = isDecendant(edge.v, id); const d2 = isDecendant(edge.w, id); if (d1 ^ d2) { log$1.warn("Edge: ", edge, " leaves cluster ", id); log$1.warn("Decendants of XXX ", id, ": ", decendants[id]); clusterDb[id].externalConnections = true; } } }); } else { log$1.debug("Not a cluster ", id, decendants); } }); graph.edges().forEach(function(e) { const edge = graph.edge(e); log$1.warn("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(e)); log$1.warn("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(graph.edge(e))); let v = e.v; let w2 = e.w; log$1.warn( "Fix XXX", clusterDb, "ids:", e.v, e.w, "Translateing: ", clusterDb[e.v], " --- ", clusterDb[e.w] ); if (clusterDb[e.v] && clusterDb[e.w] && clusterDb[e.v] === clusterDb[e.w]) { log$1.warn("Fixing and trixing link to self - removing XXX", e.v, e.w, e.name); log$1.warn("Fixing and trixing - removing XXX", e.v, e.w, e.name); v = getAnchorId(e.v); w2 = getAnchorId(e.w); graph.removeEdge(e.v, e.w, e.name); const specialId = e.w + "---" + e.v; graph.setNode(specialId, { domId: specialId, id: specialId, labelStyle: "", labelText: edge.label, padding: 0, shape: "labelRect", style: "" }); const edge1 = JSON.parse(JSON.stringify(edge)); const edge2 = JSON.parse(JSON.stringify(edge)); edge1.label = ""; edge1.arrowTypeEnd = "none"; edge2.label = ""; edge1.fromCluster = e.v; edge2.toCluster = e.v; graph.setEdge(v, specialId, edge1, e.name + "-cyclic-special"); graph.setEdge(specialId, w2, edge2, e.name + "-cyclic-special"); } else if (clusterDb[e.v] || clusterDb[e.w]) { log$1.warn("Fixing and trixing - removing XXX", e.v, e.w, e.name); v = getAnchorId(e.v); w2 = getAnchorId(e.w); graph.removeEdge(e.v, e.w, e.name); if (v !== e.v) edge.fromCluster = e.v; if (w2 !== e.w) edge.toCluster = e.w; log$1.warn("Fix Replacing with XXX", v, w2, e.name); graph.setEdge(v, w2, edge, e.name); } }); log$1.warn("Adjusted Graph", graphlib.json.write(graph)); extractor(graph, 0); log$1.trace(clusterDb); }; const extractor = (graph, depth) => { log$1.warn("extractor - ", depth, graphlib.json.write(graph), graph.children("D")); if (depth > 10) { log$1.error("Bailing out"); return; } let nodes = graph.nodes(); let hasChildren = false; for (let i = 0; i < nodes.length; i++) { const node = nodes[i]; const children = graph.children(node); hasChildren = hasChildren || children.length > 0; } if (!hasChildren) { log$1.debug("Done, no node has children", graph.nodes()); return; } log$1.debug("Nodes = ", nodes, depth); for (let i = 0; i < nodes.length; i++) { const node = nodes[i]; log$1.debug( "Extracting node", node, clusterDb, clusterDb[node] && !clusterDb[node].externalConnections, !graph.parent(node), graph.node(node), graph.children("D"), " Depth ", depth ); if (!clusterDb[node]) { log$1.debug("Not a cluster", node, depth); } else if (!clusterDb[node].externalConnections && graph.children(node) && graph.children(node).length > 0) { log$1.warn( "Cluster without external connections, without a parent and with children", node, depth ); const graphSettings = graph.graph(); let dir = graphSettings.rankdir === "TB" ? "LR" : "TB"; if (clusterDb[node]) { if (clusterDb[node].clusterData && clusterDb[node].clusterData.dir) { dir = clusterDb[node].clusterData.dir; log$1.warn("Fixing dir", clusterDb[node].clusterData.dir, dir); } } const clusterGraph = new graphlib.Graph({ multigraph: true, compound: true }).setGraph({ rankdir: dir, nodesep: 50, ranksep: 50, marginx: 8, marginy: 8 }).setDefaultEdgeLabel(function() { return {}; }); log$1.warn("Old graph before copy", graphlib.json.write(graph)); copy(node, graph, clusterGraph, node); graph.setNode(node, { clusterNode: true, id: node, clusterData: clusterDb[node].clusterData, labelText: clusterDb[node].labelText, graph: clusterGraph }); log$1.warn("New graph after copy node: (", node, ")", graphlib.json.write(clusterGraph)); log$1.debug("Old graph after copy", graphlib.json.write(graph)); } else { log$1.warn( "Cluster ** ", node, " **not meeting the criteria !externalConnections:", !clusterDb[node].externalConnections, " no parent: ", !graph.parent(node), " children ", graph.children(node) && graph.children(node).length > 0, graph.children("D"), depth ); log$1.debug(clusterDb); } } nodes = graph.nodes(); log$1.warn("New list of nodes", nodes); for (let i = 0; i < nodes.length; i++) { const node = nodes[i]; const data = graph.node(node); log$1.warn(" Now next level", node, data); if (data.clusterNode) { extractor(data.graph, depth + 1); } } }; const sorter = (graph, nodes) => { if (nodes.length === 0) return []; let result = Object.assign(nodes); nodes.forEach((node) => { const children = graph.children(node); const sorted = sorter(graph, children); result = result.concat(sorted); }); return result; }; const sortNodesByHierarchy = (graph) => sorter(graph, graph.children()); function intersectNode(node, point2) { return node.intersect(point2); } function intersectEllipse(node, rx, ry, point2) { var cx = node.x; var cy = node.y; var px = cx - point2.x; var py = cy - point2.y; var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px); var dx = Math.abs(rx * ry * px / det); if (point2.x < cx) { dx = -dx; } var dy = Math.abs(rx * ry * py / det); if (point2.y < cy) { dy = -dy; } return { x: cx + dx, y: cy + dy }; } function intersectCircle(node, rx, point2) { return intersectEllipse(node, rx, rx, point2); } function intersectLine(p1, p2, q1, q2) { var a1, a2, b1, b2, c1, c2; var r1, r2, r3, r4; var denom, offset, num; var x, y; a1 = p2.y - p1.y; b1 = p1.x - p2.x; c1 = p2.x * p1.y - p1.x * p2.y; r3 = a1 * q1.x + b1 * q1.y + c1; r4 = a1 * q2.x + b1 * q2.y + c1; if (r3 !== 0 && r4 !== 0 && sameSign(r3, r4)) { return; } a2 = q2.y - q1.y; b2 = q1.x - q2.x; c2 = q2.x * q1.y - q1.x * q2.y; r1 = a2 * p1.x + b2 * p1.y + c2; r2 = a2 * p2.x + b2 * p2.y + c2; if (r1 !== 0 && r2 !== 0 && sameSign(r1, r2)) { return; } denom = a1 * b2 - a2 * b1; if (denom === 0) { return; } offset = Math.abs(denom / 2); num = b1 * c2 - b2 * c1; x = num < 0 ? (num - offset) / denom : (num + offset) / denom; num = a2 * c1 - a1 * c2; y = num < 0 ? (num - offset) / denom : (num + offset) / denom; return { x, y }; } function sameSign(r1, r2) { return r1 * r2 > 0; } function intersectPolygon(node, polyPoints, point2) { var x1 = node.x; var y1 = node.y; var intersections = []; var minX = Number.POSITIVE_INFINITY; var minY = Number.POSITIVE_INFINITY; if (typeof polyPoints.forEach === "function") { polyPoints.forEach(function(entry) { minX = Math.min(minX, entry.x); minY = Math.min(minY, entry.y); }); } else { minX = Math.min(minX, polyPoints.x); minY = Math.min(minY, polyPoints.y); } var left = x1 - node.width / 2 - minX; var top = y1 - node.height / 2 - minY; for (var i = 0; i < polyPoints.length; i++) { var p1 = polyPoints[i]; var p2 = polyPoints[i < polyPoints.length - 1 ? i + 1 : 0]; var intersect2 = intersectLine( node, point2, { x: left + p1.x, y: top + p1.y }, { x: left + p2.x, y: top + p2.y } ); if (intersect2) { intersections.push(intersect2); } } if (!intersections.length) { return node; } if (intersections.length > 1) { intersections.sort(function(p, q) { var pdx = p.x - point2.x; var pdy = p.y - point2.y; var distp = Math.sqrt(pdx * pdx + pdy * pdy); var qdx = q.x - point2.x; var qdy = q.y - point2.y; var distq = Math.sqrt(qdx * qdx + qdy * qdy); return distp < distq ? -1 : distp === distq ? 0 : 1; }); } return intersections[0]; } const intersectRect = (node, point2) => { var x = node.x; var y = node.y; var dx = point2.x - x; var dy = point2.y - y; var w2 = node.width / 2; var h = node.height / 2; var sx, sy; if (Math.abs(dy) * w2 > Math.abs(dx) * h) { if (dy < 0) { h = -h; } sx = dy === 0 ? 0 : h * dx / dy; sy = h; } else { if (dx < 0) { w2 = -w2; } sx = w2; sy = dx === 0 ? 0 : w2 * dy / dx; } return { x: x + sx, y: y + sy }; }; const intersect = { node: intersectNode, circle: intersectCircle, ellipse: intersectEllipse, polygon: intersectPolygon, rect: intersectRect }; const note = (parent, node) => { const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, "node " + node.classes, true); log$1.info("Classes = ", node.classes); const rect2 = shapeSvg.insert("rect", ":first-child"); rect2.attr("rx", node.rx).attr("ry", node.ry).attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).attr("width", bbox.width + node.padding).attr("height", bbox.height + node.padding); updateNodeBounds(node, rect2); node.intersect = function(point2) { return intersect.rect(node, point2); }; return shapeSvg; }; const question$1 = (parent, node) => { const { shapeSvg, bbox } = labelHelper(parent, node, void 0, true); const w2 = bbox.width + node.padding; const h = bbox.height + node.padding; const s = w2 + h; const points = [ { x: s / 2, y: 0 }, { x: s, y: -s / 2 }, { x: s / 2, y: -s }, { x: 0, y: -s / 2 } ]; log$1.info("Question main (Circle)"); const questionElem = insertPolygonShape$1(shapeSvg, s, s, points); questionElem.attr("style", node.style); updateNodeBounds(node, questionElem); node.intersect = function(point2) { log$1.warn("Intersect called"); return intersect.polygon(node, points, point2); }; return shapeSvg; }; const choice = (parent, node) => { const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node.domId || node.id); const s = 28; const points = [ { x: 0, y: s / 2 }, { x: s / 2, y: 0 }, { x: 0, y: -s / 2 }, { x: -s / 2, y: 0 } ]; const choice2 = shapeSvg.insert("polygon", ":first-child").attr( "points", points.map(function(d) { return d.x + "," + d.y; }).join(" ") ); choice2.attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28); node.width = 28; node.height = 28; node.intersect = function(point2) { return intersect.circle(node, 14, point2); }; return shapeSvg; }; const hexagon$1 = (parent, node) => { const { shapeSvg, bbox } = labelHelper(parent, node, void 0, true); const f = 4; const h = bbox.height + node.padding; const m = h / f; const w2 = bbox.width + 2 * m + node.padding; const points = [ { x: m, y: 0 }, { x: w2 - m, y: 0 }, { x: w2, y: -h / 2 }, { x: w2 - m, y: -h }, { x: m, y: -h }, { x: 0, y: -h / 2 } ]; const hex = insertPolygonShape$1(shapeSvg, w2, h, points); hex.attr("style", node.style); updateNodeBounds(node, hex); node.intersect = function(point2) { return intersect.polygon(node, points, point2); }; return shapeSvg; }; const rect_left_inv_arrow$1 = (parent, node) => { const { shapeSvg, bbox } = labelHelper(parent, node, void 0, true); const w2 = bbox.width + node.padding; const h = bbox.height + node.padding; const points = [ { x: -h / 2, y: 0 }, { x: w2, y: 0 }, { x: w2, y: -h }, { x: -h / 2, y: -h }, { x: 0, y: -h / 2 } ]; const el = insertPolygonShape$1(shapeSvg, w2, h, points); el.attr("style", node.style); node.width = w2 + h; node.height = h; node.intersect = function(point2) { return intersect.polygon(node, points, point2); }; return shapeSvg; }; const lean_right$1 = (parent, node) => { const { shapeSvg, bbox } = labelHelper(parent, node, void 0, true); const w2 = bbox.width + node.padding; const h = bbox.height + node.padding; const points = [ { x: -2 * h / 6, y: 0 }, { x: w2 - h / 6, y: 0 }, { x: w2 + 2 * h / 6, y: -h }, { x: h / 6, y: -h } ]; const el = insertPolygonShape$1(shapeSvg, w2, h, points); el.attr("style", node.style); updateNodeBounds(node, el); node.intersect = function(point2) { return intersect.polygon(node, points, point2); }; return shapeSvg; }; const lean_left$1 = (parent, node) => { const { shapeSvg, bbox } = labelHelper(parent, node, void 0, true); const w2 = bbox.width + node.padding; const h = bbox.height + node.padding; const points = [ { x: 2 * h / 6, y: 0 }, { x: w2 + h / 6, y: 0 }, { x: w2 - 2 * h / 6, y: -h }, { x: -h / 6, y: -h } ]; const el = insertPolygonShape$1(shapeSvg, w2, h, points); el.attr("style", node.style); updateNodeBounds(node, el); node.intersect = function(point2) { return intersect.polygon(node, points, point2); }; return shapeSvg; }; const trapezoid$1 = (parent, node) => { const { shapeSvg, bbox } = labelHelper(parent, node, void 0, true); const w2 = bbox.width + node.padding; const h = bbox.height + node.padding; const points = [ { x: -2 * h / 6, y: 0 }, { x: w2 + 2 * h / 6, y: 0 }, { x: w2 - h / 6, y: -h }, { x: h / 6, y: -h } ]; const el = insertPolygonShape$1(shapeSvg, w2, h, points); el.attr("style", node.style); updateNodeBounds(node, el); node.intersect = function(point2) { return intersect.polygon(node, points, point2); }; return shapeSvg; }; const inv_trapezoid$1 = (parent, node) => { const { shapeSvg, bbox } = labelHelper(parent, node, void 0, true); const w2 = bbox.width + node.padding; const h = bbox.height + node.padding; const points = [ { x: h / 6, y: 0 }, { x: w2 - h / 6, y: 0 }, { x: w2 + 2 * h / 6, y: -h }, { x: -2 * h / 6, y: -h } ]; const el = insertPolygonShape$1(shapeSvg, w2, h, points); el.attr("style", node.style); updateNodeBounds(node, el); node.intersect = function(point2) { return intersect.polygon(node, points, point2); }; return shapeSvg; }; const rect_right_inv_arrow$1 = (parent, node) => { const { shapeSvg, bbox } = labelHelper(parent, node, void 0, true); const w2 = bbox.width + node.padding; const h = bbox.height + node.padding; const points = [ { x: 0, y: 0 }, { x: w2 + h / 2, y: 0 }, { x: w2, y: -h / 2 }, { x: w2 + h / 2, y: -h }, { x: 0, y: -h } ]; const el = insertPolygonShape$1(shapeSvg, w2, h, points); el.attr("style", node.style); updateNodeBounds(node, el); node.intersect = function(point2) { return intersect.polygon(node, points, point2); }; return shapeSvg; }; const cylinder$1 = (parent, node) => { const { shapeSvg, bbox } = labelHelper(parent, node, void 0, true); const w2 = bbox.width + node.padding; const rx = w2 / 2; const ry = rx / (2.5 + w2 / 50); const h = bbox.height + ry + node.padding; const shape = "M 0," + ry + " a " + rx + "," + ry + " 0,0,0 " + w2 + " 0 a " + rx + "," + ry + " 0,0,0 " + -w2 + " 0 l 0," + h + " a " + rx + "," + ry + " 0,0,0 " + w2 + " 0 l 0," + -h; const el = shapeSvg.attr("label-offset-y", ry).insert("path", ":first-child").attr("style", node.style).attr("d", shape).attr("transform", "translate(" + -w2 / 2 + "," + -(h / 2 + ry) + ")"); updateNodeBounds(node, el); node.intersect = function(point2) { const pos = intersect.rect(node, point2); const x = pos.x - node.x; if (rx != 0 && (Math.abs(x) < node.width / 2 || Math.abs(x) == node.width / 2 && Math.abs(pos.y - node.y) > node.height / 2 - ry)) { let y = ry * ry * (1 - x * x / (rx * rx)); if (y != 0) y = Math.sqrt(y); y = ry - y; if (point2.y - node.y > 0) y = -y; pos.y += y; } return pos; }; return shapeSvg; }; const rect$1 = (parent, node) => { const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, "node " + node.classes, true); log$1.trace("Classes = ", node.classes); const rect2 = shapeSvg.insert("rect", ":first-child"); const totalWidth = bbox.width + node.padding; const totalHeight = bbox.height + node.padding; rect2.attr("class", "basic label-container").attr("style", node.style).attr("rx", node.rx).attr("ry", node.ry).attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).attr("width", totalWidth).attr("height", totalHeight); if (node.props) { const propKeys = new Set(Object.keys(node.props)); if (node.props.borders) { applyNodePropertyBorders(rect2, node.props.borders, totalWidth, totalHeight); propKeys.delete("borders"); } propKeys.forEach((propKey) => { log$1.warn(`Unknown node property ${propKey}`); }); } updateNodeBounds(node, rect2); node.intersect = function(point2) { return intersect.rect(node, point2); }; return shapeSvg; }; const labelRect = (parent, node) => { const { shapeSvg } = labelHelper(parent, node, "label", true); log$1.trace("Classes = ", node.classes); const rect2 = shapeSvg.insert("rect", ":first-child"); const totalWidth = 0; const totalHeight = 0; rect2.attr("width", totalWidth).attr("height", totalHeight); shapeSvg.attr("class", "label edgeLabel"); if (node.props) { const propKeys = new Set(Object.keys(node.props)); if (node.props.borders) { applyNodePropertyBorders(rect2, node.props.borders, totalWidth, totalHeight); propKeys.delete("borders"); } propKeys.forEach((propKey) => { log$1.warn(`Unknown node property ${propKey}`); }); } updateNodeBounds(node, rect2); node.intersect = function(point2) { return intersect.rect(node, point2); }; return shapeSvg; }; function applyNodePropertyBorders(rect2, borders, totalWidth, totalHeight) { const strokeDashArray = []; const addBorder = (length) => { strokeDashArray.push(length); strokeDashArray.push(0); }; const skipBorder = (length) => { strokeDashArray.push(0); strokeDashArray.push(length); }; if (borders.includes("t")) { log$1.debug("add top border"); addBorder(totalWidth); } else { skipBorder(totalWidth); } if (borders.includes("r")) { log$1.debug("add right border"); addBorder(totalHeight); } else { skipBorder(totalHeight); } if (borders.includes("b")) { log$1.debug("add bottom border"); addBorder(totalWidth); } else { skipBorder(totalWidth); } if (borders.includes("l")) { log$1.debug("add left border"); addBorder(totalHeight); } else { skipBorder(totalHeight); } rect2.attr("stroke-dasharray", strokeDashArray.join(" ")); } const rectWithTitle = (parent, node) => { let classes2; if (!node.classes) { classes2 = "node default"; } else { classes2 = "node " + node.classes; } const shapeSvg = parent.insert("g").attr("class", classes2).attr("id", node.domId || node.id); const rect2 = shapeSvg.insert("rect", ":first-child"); const innerLine = shapeSvg.insert("line"); const label = shapeSvg.insert("g").attr("class", "label"); const text2 = node.labelText.flat ? node.labelText.flat() : node.labelText; let title2 = ""; if (typeof text2 === "object") { title2 = text2[0]; } else { title2 = text2; } log$1.info("Label text abc79", title2, text2, typeof text2 === "object"); const text = label.node().appendChild(createLabel(title2, node.labelStyle, true, true)); let bbox = { width: 0, height: 0 }; if (evaluate(getConfig$1().flowchart.htmlLabels)) { const div = text.children[0]; const dv = select(text); bbox = div.getBoundingClientRect(); dv.attr("width", bbox.width); dv.attr("height", bbox.height); } log$1.info("Text 2", text2); const textRows = text2.slice(1, text2.length); let titleBox = text.getBBox(); const descr = label.node().appendChild( createLabel(textRows.join ? textRows.join("
") : textRows, node.labelStyle, true, true) ); if (evaluate(getConfig$1().flowchart.htmlLabels)) { const div = descr.children[0]; const dv = select(descr); bbox = div.getBoundingClientRect(); dv.attr("width", bbox.width); dv.attr("height", bbox.height); } const halfPadding = node.padding / 2; select(descr).attr( "transform", "translate( " + (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + ", " + (titleBox.height + halfPadding + 5) + ")" ); select(text).attr( "transform", "translate( " + (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + ", " + 0 + ")" ); bbox = label.node().getBBox(); label.attr( "transform", "translate(" + -bbox.width / 2 + ", " + (-bbox.height / 2 - halfPadding + 3) + ")" ); rect2.attr("class", "outer title-state").attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).attr("width", bbox.width + node.padding).attr("height", bbox.height + node.padding); innerLine.attr("class", "divider").attr("x1", -bbox.width / 2 - halfPadding).attr("x2", bbox.width / 2 + halfPadding).attr("y1", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding).attr("y2", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding); updateNodeBounds(node, rect2); node.intersect = function(point2) { return intersect.rect(node, point2); }; return shapeSvg; }; const stadium$1 = (parent, node) => { const { shapeSvg, bbox } = labelHelper(parent, node, void 0, true); const h = bbox.height + node.padding; const w2 = bbox.width + h / 4 + node.padding; const rect2 = shapeSvg.insert("rect", ":first-child").attr("style", node.style).attr("rx", h / 2).attr("ry", h / 2).attr("x", -w2 / 2).attr("y", -h / 2).attr("width", w2).attr("height", h); updateNodeBounds(node, rect2); node.intersect = function(point2) { return intersect.rect(node, point2); }; return shapeSvg; }; const circle = (parent, node) => { const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, void 0, true); const circle2 = shapeSvg.insert("circle", ":first-child"); circle2.attr("style", node.style).attr("rx", node.rx).attr("ry", node.ry).attr("r", bbox.width / 2 + halfPadding).attr("width", bbox.width + node.padding).attr("height", bbox.height + node.padding); log$1.info("Circle main"); updateNodeBounds(node, circle2); node.intersect = function(point2) { log$1.info("Circle intersect", node, bbox.width / 2 + halfPadding, point2); return intersect.circle(node, bbox.width / 2 + halfPadding, point2); }; return shapeSvg; }; const doublecircle = (parent, node) => { const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, void 0, true); const gap = 5; const circleGroup = shapeSvg.insert("g", ":first-child"); const outerCircle = circleGroup.insert("circle"); const innerCircle = circleGroup.insert("circle"); outerCircle.attr("style", node.style).attr("rx", node.rx).attr("ry", node.ry).attr("r", bbox.width / 2 + halfPadding + gap).attr("width", bbox.width + node.padding + gap * 2).attr("height", bbox.height + node.padding + gap * 2); innerCircle.attr("style", node.style).attr("rx", node.rx).attr("ry", node.ry).attr("r", bbox.width / 2 + halfPadding).attr("width", bbox.width + node.padding).attr("height", bbox.height + node.padding); log$1.info("DoubleCircle main"); updateNodeBounds(node, outerCircle); node.intersect = function(point2) { log$1.info("DoubleCircle intersect", node, bbox.width / 2 + halfPadding + gap, point2); return intersect.circle(node, bbox.width / 2 + halfPadding + gap, point2); }; return shapeSvg; }; const subroutine$1 = (parent, node) => { const { shapeSvg, bbox } = labelHelper(parent, node, void 0, true); const w2 = bbox.width + node.padding; const h = bbox.height + node.padding; const points = [ { x: 0, y: 0 }, { x: w2, y: 0 }, { x: w2, y: -h }, { x: 0, y: -h }, { x: 0, y: 0 }, { x: -8, y: 0 }, { x: w2 + 8, y: 0 }, { x: w2 + 8, y: -h }, { x: -8, y: -h }, { x: -8, y: 0 } ]; const el = insertPolygonShape$1(shapeSvg, w2, h, points); el.attr("style", node.style); updateNodeBounds(node, el); node.intersect = function(point2) { return intersect.polygon(node, points, point2); }; return shapeSvg; }; const start = (parent, node) => { const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node.domId || node.id); const circle2 = shapeSvg.insert("circle", ":first-child"); circle2.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14); updateNodeBounds(node, circle2); node.intersect = function(point2) { return intersect.circle(node, 7, point2); }; return shapeSvg; }; const forkJoin = (parent, node, dir) => { const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node.domId || node.id); let width2 = 70; let height2 = 10; if (dir === "LR") { width2 = 10; height2 = 70; } const shape = shapeSvg.append("rect").attr("x", -1 * width2 / 2).attr("y", -1 * height2 / 2).attr("width", width2).attr("height", height2).attr("class", "fork-join"); updateNodeBounds(node, shape); node.height = node.height + node.padding / 2; node.width = node.width + node.padding / 2; node.intersect = function(point2) { return intersect.rect(node, point2); }; return shapeSvg; }; const end = (parent, node) => { const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node.domId || node.id); const innerCircle = shapeSvg.insert("circle", ":first-child"); const circle2 = shapeSvg.insert("circle", ":first-child"); circle2.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14); innerCircle.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10); updateNodeBounds(node, circle2); node.intersect = function(point2) { return intersect.circle(node, 7, point2); }; return shapeSvg; }; const class_box = (parent, node) => { const halfPadding = node.padding / 2; const rowPadding = 4; const lineHeight = 8; let classes2; if (!node.classes) { classes2 = "node default"; } else { classes2 = "node " + node.classes; } const shapeSvg = parent.insert("g").attr("class", classes2).attr("id", node.domId || node.id); const rect2 = shapeSvg.insert("rect", ":first-child"); const topLine = shapeSvg.insert("line"); const bottomLine = shapeSvg.insert("line"); let maxWidth = 0; let maxHeight = rowPadding; const labelContainer = shapeSvg.insert("g").attr("class", "label"); let verticalPos = 0; const hasInterface = node.classData.annotations && node.classData.annotations[0]; const interfaceLabelText = node.classData.annotations[0] ? "\xAB" + node.classData.annotations[0] + "\xBB" : ""; const interfaceLabel = labelContainer.node().appendChild(createLabel(interfaceLabelText, node.labelStyle, true, true)); let interfaceBBox = interfaceLabel.getBBox(); if (evaluate(getConfig$1().flowchart.htmlLabels)) { const div = interfaceLabel.children[0]; const dv = select(interfaceLabel); interfaceBBox = div.getBoundingClientRect(); dv.attr("width", interfaceBBox.width); dv.attr("height", interfaceBBox.height); } if (node.classData.annotations[0]) { maxHeight += interfaceBBox.height + rowPadding; maxWidth += interfaceBBox.width; } let classTitleString = node.classData.id; if (node.classData.type !== void 0 && node.classData.type !== "") { if (getConfig$1().flowchart.htmlLabels) { classTitleString += "<" + node.classData.type + ">"; } else { classTitleString += "<" + node.classData.type + ">"; } } const classTitleLabel = labelContainer.node().appendChild(createLabel(classTitleString, node.labelStyle, true, true)); select(classTitleLabel).attr("class", "classTitle"); let classTitleBBox = classTitleLabel.getBBox(); if (evaluate(getConfig$1().flowchart.htmlLabels)) { const div = classTitleLabel.children[0]; const dv = select(classTitleLabel); classTitleBBox = div.getBoundingClientRect(); dv.attr("width", classTitleBBox.width); dv.attr("height", classTitleBBox.height); } maxHeight += classTitleBBox.height + rowPadding; if (classTitleBBox.width > maxWidth) { maxWidth = classTitleBBox.width; } const classAttributes = []; node.classData.members.forEach((str) => { const parsedInfo = parseMember(str); let parsedText = parsedInfo.displayText; if (getConfig$1().flowchart.htmlLabels) { parsedText = parsedText.replace(//g, ">"); } const lbl = labelContainer.node().appendChild( createLabel( parsedText, parsedInfo.cssStyle ? parsedInfo.cssStyle : node.labelStyle, true, true ) ); let bbox = lbl.getBBox(); if (evaluate(getConfig$1().flowchart.htmlLabels)) { const div = lbl.children[0]; const dv = select(lbl); bbox = div.getBoundingClientRect(); dv.attr("width", bbox.width); dv.attr("height", bbox.height); } if (bbox.width > maxWidth) { maxWidth = bbox.width; } maxHeight += bbox.height + rowPadding; classAttributes.push(lbl); }); maxHeight += lineHeight; const classMethods = []; node.classData.methods.forEach((str) => { const parsedInfo = parseMember(str); let displayText = parsedInfo.displayText; if (getConfig$1().flowchart.htmlLabels) { displayText = displayText.replace(//g, ">"); } const lbl = labelContainer.node().appendChild( createLabel( displayText, parsedInfo.cssStyle ? parsedInfo.cssStyle : node.labelStyle, true, true ) ); let bbox = lbl.getBBox(); if (evaluate(getConfig$1().flowchart.htmlLabels)) { const div = lbl.children[0]; const dv = select(lbl); bbox = div.getBoundingClientRect(); dv.attr("width", bbox.width); dv.attr("height", bbox.height); } if (bbox.width > maxWidth) { maxWidth = bbox.width; } maxHeight += bbox.height + rowPadding; classMethods.push(lbl); }); maxHeight += lineHeight; if (hasInterface) { let diffX2 = (maxWidth - interfaceBBox.width) / 2; select(interfaceLabel).attr( "transform", "translate( " + (-1 * maxWidth / 2 + diffX2) + ", " + -1 * maxHeight / 2 + ")" ); verticalPos = interfaceBBox.height + rowPadding; } let diffX = (maxWidth - classTitleBBox.width) / 2; select(classTitleLabel).attr( "transform", "translate( " + (-1 * maxWidth / 2 + diffX) + ", " + (-1 * maxHeight / 2 + verticalPos) + ")" ); verticalPos += classTitleBBox.height + rowPadding; topLine.attr("class", "divider").attr("x1", -maxWidth / 2 - halfPadding).attr("x2", maxWidth / 2 + halfPadding).attr("y1", -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr("y2", -maxHeight / 2 - halfPadding + lineHeight + verticalPos); verticalPos += lineHeight; classAttributes.forEach((lbl) => { select(lbl).attr( "transform", "translate( " + -maxWidth / 2 + ", " + (-1 * maxHeight / 2 + verticalPos + lineHeight / 2) + ")" ); verticalPos += classTitleBBox.height + rowPadding; }); verticalPos += lineHeight; bottomLine.attr("class", "divider").attr("x1", -maxWidth / 2 - halfPadding).attr("x2", maxWidth / 2 + halfPadding).attr("y1", -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr("y2", -maxHeight / 2 - halfPadding + lineHeight + verticalPos); verticalPos += lineHeight; classMethods.forEach((lbl) => { select(lbl).attr( "transform", "translate( " + -maxWidth / 2 + ", " + (-1 * maxHeight / 2 + verticalPos) + ")" ); verticalPos += classTitleBBox.height + rowPadding; }); rect2.attr("class", "outer title-state").attr("x", -maxWidth / 2 - halfPadding).attr("y", -(maxHeight / 2) - halfPadding).attr("width", maxWidth + node.padding).attr("height", maxHeight + node.padding); updateNodeBounds(node, rect2); node.intersect = function(point2) { return intersect.rect(node, point2); }; return shapeSvg; }; const shapes$1 = { question: question$1, rect: rect$1, labelRect, rectWithTitle, choice, circle, doublecircle, stadium: stadium$1, hexagon: hexagon$1, rect_left_inv_arrow: rect_left_inv_arrow$1, lean_right: lean_right$1, lean_left: lean_left$1, trapezoid: trapezoid$1, inv_trapezoid: inv_trapezoid$1, rect_right_inv_arrow: rect_right_inv_arrow$1, cylinder: cylinder$1, start, end, note, subroutine: subroutine$1, fork: forkJoin, join: forkJoin, class_box }; let nodeElems = {}; const insertNode = (elem, node, dir) => { let newEl; let el; if (node.link) { let target; if (getConfig$1().securityLevel === "sandbox") { target = "_top"; } else if (node.linkTarget) { target = node.linkTarget || "_blank"; } newEl = elem.insert("svg:a").attr("xlink:href", node.link).attr("target", target); el = shapes$1[node.shape](newEl, node, dir); } else { el = shapes$1[node.shape](elem, node, dir); newEl = el; } if (node.tooltip) { el.attr("title", node.tooltip); } if (node.class) { el.attr("class", "node default " + node.class); } nodeElems[node.id] = newEl; if (node.haveCallback) { nodeElems[node.id].attr("class", nodeElems[node.id].attr("class") + " clickable"); } }; const setNodeElem = (elem, node) => { nodeElems[node.id] = elem; }; const clear$a = () => { nodeElems = {}; }; const positionNode = (node) => { const el = nodeElems[node.id]; log$1.trace( "Transforming node", node.diff, node, "translate(" + (node.x - node.width / 2 - 5) + ", " + node.width / 2 + ")" ); const padding2 = 8; const diff = node.diff || 0; if (node.clusterNode) { el.attr( "transform", "translate(" + (node.x + diff - node.width / 2) + ", " + (node.y - node.height / 2 - padding2) + ")" ); } else { el.attr("transform", "translate(" + node.x + ", " + node.y + ")"); } return diff; }; const rect = (parent, node) => { log$1.trace("Creating subgraph rect for ", node.id, node); const shapeSvg = parent.insert("g").attr("class", "cluster" + (node.class ? " " + node.class : "")).attr("id", node.id); const rect2 = shapeSvg.insert("rect", ":first-child"); const label = shapeSvg.insert("g").attr("class", "cluster-label"); const text = label.node().appendChild(createLabel(node.labelText, node.labelStyle, void 0, true)); let bbox = text.getBBox(); if (evaluate(getConfig$1().flowchart.htmlLabels)) { const div = text.children[0]; const dv = select(text); bbox = div.getBoundingClientRect(); dv.attr("width", bbox.width); dv.attr("height", bbox.height); } const padding2 = 0 * node.padding; const halfPadding = padding2 / 2; const width2 = node.width <= bbox.width + padding2 ? bbox.width + padding2 : node.width; if (node.width <= bbox.width + padding2) { node.diff = (bbox.width - node.width) / 2 - node.padding / 2; } else { node.diff = -node.padding / 2; } log$1.trace("Data ", node, JSON.stringify(node)); rect2.attr("style", node.style).attr("rx", node.rx).attr("ry", node.ry).attr("x", node.x - width2 / 2).attr("y", node.y - node.height / 2 - halfPadding).attr("width", width2).attr("height", node.height + padding2); label.attr( "transform", "translate(" + (node.x - bbox.width / 2) + ", " + (node.y - node.height / 2 + node.padding / 3) + ")" ); const rectBox = rect2.node().getBBox(); node.width = rectBox.width; node.height = rectBox.height; node.intersect = function(point2) { return intersectRect(node, point2); }; return shapeSvg; }; const noteGroup = (parent, node) => { const shapeSvg = parent.insert("g").attr("class", "note-cluster").attr("id", node.id); const rect2 = shapeSvg.insert("rect", ":first-child"); const padding2 = 0 * node.padding; const halfPadding = padding2 / 2; rect2.attr("rx", node.rx).attr("ry", node.ry).attr("x", node.x - node.width / 2 - halfPadding).attr("y", node.y - node.height / 2 - halfPadding).attr("width", node.width + padding2).attr("height", node.height + padding2).attr("fill", "none"); const rectBox = rect2.node().getBBox(); node.width = rectBox.width; node.height = rectBox.height; node.intersect = function(point2) { return intersectRect(node, point2); }; return shapeSvg; }; const roundedWithTitle = (parent, node) => { const shapeSvg = parent.insert("g").attr("class", node.classes).attr("id", node.id); const rect2 = shapeSvg.insert("rect", ":first-child"); const label = shapeSvg.insert("g").attr("class", "cluster-label"); const innerRect = shapeSvg.append("rect"); const text = label.node().appendChild(createLabel(node.labelText, node.labelStyle, void 0, true)); let bbox = text.getBBox(); if (evaluate(getConfig$1().flowchart.htmlLabels)) { const div = text.children[0]; const dv = select(text); bbox = div.getBoundingClientRect(); dv.attr("width", bbox.width); dv.attr("height", bbox.height); } bbox = text.getBBox(); const padding2 = 0 * node.padding; const halfPadding = padding2 / 2; const width2 = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width; if (node.width <= bbox.width + node.padding) { node.diff = (bbox.width + node.padding * 0 - node.width) / 2; } else { node.diff = -node.padding / 2; } rect2.attr("class", "outer").attr("x", node.x - width2 / 2 - halfPadding).attr("y", node.y - node.height / 2 - halfPadding).attr("width", width2 + padding2).attr("height", node.height + padding2); innerRect.attr("class", "inner").attr("x", node.x - width2 / 2 - halfPadding).attr("y", node.y - node.height / 2 - halfPadding + bbox.height - 1).attr("width", width2 + padding2).attr("height", node.height + padding2 - bbox.height - 3); label.attr( "transform", "translate(" + (node.x - bbox.width / 2) + ", " + (node.y - node.height / 2 - node.padding / 3 + (evaluate(getConfig$1().flowchart.htmlLabels) ? 5 : 3)) + ")" ); const rectBox = rect2.node().getBBox(); node.height = rectBox.height; node.intersect = function(point2) { return intersectRect(node, point2); }; return shapeSvg; }; const divider = (parent, node) => { const shapeSvg = parent.insert("g").attr("class", node.classes).attr("id", node.id); const rect2 = shapeSvg.insert("rect", ":first-child"); const padding2 = 0 * node.padding; const halfPadding = padding2 / 2; rect2.attr("class", "divider").attr("x", node.x - node.width / 2 - halfPadding).attr("y", node.y - node.height / 2).attr("width", node.width + padding2).attr("height", node.height + padding2); const rectBox = rect2.node().getBBox(); node.width = rectBox.width; node.height = rectBox.height; node.diff = -node.padding / 2; node.intersect = function(point2) { return intersectRect(node, point2); }; return shapeSvg; }; const shapes = { rect, roundedWithTitle, noteGroup, divider }; let clusterElems = {}; const insertCluster = (elem, node) => { log$1.trace("Inserting cluster"); const shape = node.shape || "rect"; clusterElems[node.id] = shapes[shape](elem, node); }; const clear$9 = () => { clusterElems = {}; }; let edgeLabels = {}; let terminalLabels = {}; const clear$8 = () => { edgeLabels = {}; terminalLabels = {}; }; const insertEdgeLabel = (elem, edge) => { const labelElement = createLabel(edge.label, edge.labelStyle); const edgeLabel = elem.insert("g").attr("class", "edgeLabel"); const label = edgeLabel.insert("g").attr("class", "label"); label.node().appendChild(labelElement); let bbox = labelElement.getBBox(); if (evaluate(getConfig$1().flowchart.htmlLabels)) { const div = labelElement.children[0]; const dv = select(labelElement); bbox = div.getBoundingClientRect(); dv.attr("width", bbox.width); dv.attr("height", bbox.height); } label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")"); edgeLabels[edge.id] = edgeLabel; edge.width = bbox.width; edge.height = bbox.height; let fo; if (edge.startLabelLeft) { const startLabelElement = createLabel(edge.startLabelLeft, edge.labelStyle); const startEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals"); const inner = startEdgeLabelLeft.insert("g").attr("class", "inner"); fo = inner.node().appendChild(startLabelElement); const slBox = startLabelElement.getBBox(); inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")"); if (!terminalLabels[edge.id]) { terminalLabels[edge.id] = {}; } terminalLabels[edge.id].startLeft = startEdgeLabelLeft; setTerminalWidth(fo, edge.startLabelLeft); } if (edge.startLabelRight) { const startLabelElement = createLabel(edge.startLabelRight, edge.labelStyle); const startEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals"); const inner = startEdgeLabelRight.insert("g").attr("class", "inner"); fo = startEdgeLabelRight.node().appendChild(startLabelElement); inner.node().appendChild(startLabelElement); const slBox = startLabelElement.getBBox(); inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")"); if (!terminalLabels[edge.id]) { terminalLabels[edge.id] = {}; } terminalLabels[edge.id].startRight = startEdgeLabelRight; setTerminalWidth(fo, edge.startLabelRight); } if (edge.endLabelLeft) { const endLabelElement = createLabel(edge.endLabelLeft, edge.labelStyle); const endEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals"); const inner = endEdgeLabelLeft.insert("g").attr("class", "inner"); fo = inner.node().appendChild(endLabelElement); const slBox = endLabelElement.getBBox(); inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")"); endEdgeLabelLeft.node().appendChild(endLabelElement); if (!terminalLabels[edge.id]) { terminalLabels[edge.id] = {}; } terminalLabels[edge.id].endLeft = endEdgeLabelLeft; setTerminalWidth(fo, edge.endLabelLeft); } if (edge.endLabelRight) { const endLabelElement = createLabel(edge.endLabelRight, edge.labelStyle); const endEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals"); const inner = endEdgeLabelRight.insert("g").attr("class", "inner"); fo = inner.node().appendChild(endLabelElement); const slBox = endLabelElement.getBBox(); inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")"); endEdgeLabelRight.node().appendChild(endLabelElement); if (!terminalLabels[edge.id]) { terminalLabels[edge.id] = {}; } terminalLabels[edge.id].endRight = endEdgeLabelRight; setTerminalWidth(fo, edge.endLabelRight); } }; function setTerminalWidth(fo, value) { if (getConfig$1().flowchart.htmlLabels && fo) { fo.style.width = value.length * 9 + "px"; fo.style.height = "12px"; } } const positionEdgeLabel = (edge, paths) => { log$1.info("Moving label abc78 ", edge.id, edge.label, edgeLabels[edge.id]); let path = paths.updatedPath ? paths.updatedPath : paths.originalPath; if (edge.label) { const el = edgeLabels[edge.id]; let x = edge.x; let y = edge.y; if (path) { const pos = utils.calcLabelPosition(path); log$1.info("Moving label from (", x, ",", y, ") to (", pos.x, ",", pos.y, ") abc78"); } el.attr("transform", "translate(" + x + ", " + y + ")"); } if (edge.startLabelLeft) { const el = terminalLabels[edge.id].startLeft; let x = edge.x; let y = edge.y; if (path) { const pos = utils.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, "start_left", path); x = pos.x; y = pos.y; } el.attr("transform", "translate(" + x + ", " + y + ")"); } if (edge.startLabelRight) { const el = terminalLabels[edge.id].startRight; let x = edge.x; let y = edge.y; if (path) { const pos = utils.calcTerminalLabelPosition( edge.arrowTypeStart ? 10 : 0, "start_right", path ); x = pos.x; y = pos.y; } el.attr("transform", "translate(" + x + ", " + y + ")"); } if (edge.endLabelLeft) { const el = terminalLabels[edge.id].endLeft; let x = edge.x; let y = edge.y; if (path) { const pos = utils.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_left", path); x = pos.x; y = pos.y; } el.attr("transform", "translate(" + x + ", " + y + ")"); } if (edge.endLabelRight) { const el = terminalLabels[edge.id].endRight; let x = edge.x; let y = edge.y; if (path) { const pos = utils.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_right", path); x = pos.x; y = pos.y; } el.attr("transform", "translate(" + x + ", " + y + ")"); } }; const outsideNode = (node, point2) => { const x = node.x; const y = node.y; const dx = Math.abs(point2.x - x); const dy = Math.abs(point2.y - y); const w2 = node.width / 2; const h = node.height / 2; if (dx >= w2 || dy >= h) { return true; } return false; }; const intersection = (node, outsidePoint, insidePoint) => { log$1.warn(`intersection calc abc89: outsidePoint: ${JSON.stringify(outsidePoint)} insidePoint : ${JSON.stringify(insidePoint)} node : x:${node.x} y:${node.y} w:${node.width} h:${node.height}`); const x = node.x; const y = node.y; const dx = Math.abs(x - insidePoint.x); const w2 = node.width / 2; let r = insidePoint.x < outsidePoint.x ? w2 - dx : w2 + dx; const h = node.height / 2; const Q = Math.abs(outsidePoint.y - insidePoint.y); const R = Math.abs(outsidePoint.x - insidePoint.x); if (Math.abs(y - outsidePoint.y) * w2 > Math.abs(x - outsidePoint.x) * h) { let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y; r = R * q / Q; const res = { x: insidePoint.x < outsidePoint.x ? insidePoint.x + r : insidePoint.x - R + r, y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q - q : insidePoint.y - Q + q }; if (r === 0) { res.x = outsidePoint.x; res.y = outsidePoint.y; } if (R === 0) { res.x = outsidePoint.x; } if (Q === 0) { res.y = outsidePoint.y; } log$1.warn(`abc89 topp/bott calc, Q ${Q}, q ${q}, R ${R}, r ${r}`, res); return res; } else { if (insidePoint.x < outsidePoint.x) { r = outsidePoint.x - w2 - x; } else { r = x - w2 - outsidePoint.x; } let q = Q * r / R; let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x - R + r; let _y = insidePoint.y < outsidePoint.y ? insidePoint.y + q : insidePoint.y - q; log$1.warn(`sides calc abc89, Q ${Q}, q ${q}, R ${R}, r ${r}`, { _x, _y }); if (r === 0) { _x = outsidePoint.x; _y = outsidePoint.y; } if (R === 0) { _x = outsidePoint.x; } if (Q === 0) { _y = outsidePoint.y; } return { x: _x, y: _y }; } }; const cutPathAtIntersect = (_points, boundryNode) => { log$1.warn("abc88 cutPathAtIntersect", _points, boundryNode); let points = []; let lastPointOutside = _points[0]; let isInside = false; _points.forEach((point2) => { log$1.info("abc88 checking point", point2, boundryNode); if (!outsideNode(boundryNode, point2) && !isInside) { const inter = intersection(boundryNode, lastPointOutside, point2); log$1.warn("abc88 inside", point2, lastPointOutside, inter); log$1.warn("abc88 intersection", inter); let pointPresent = false; points.forEach((p) => { pointPresent = pointPresent || p.x === inter.x && p.y === inter.y; }); if (!points.find((e) => e.x === inter.x && e.y === inter.y)) { points.push(inter); } else { log$1.warn("abc88 no intersect", inter, points); } isInside = true; } else { log$1.warn("abc88 outside", point2, lastPointOutside); lastPointOutside = point2; if (!isInside) points.push(point2); } }); log$1.warn("abc88 returning points", points); return points; }; const insertEdge = function(elem, e, edge, clusterDb2, diagramType, graph) { let points = edge.points; let pointsHasChanged = false; const tail = graph.node(e.v); var head2 = graph.node(e.w); log$1.info("abc88 InsertEdge: ", edge); if (head2.intersect && tail.intersect) { points = points.slice(1, edge.points.length - 1); points.unshift(tail.intersect(points[0])); log$1.info( "Last point", points[points.length - 1], head2, head2.intersect(points[points.length - 1]) ); points.push(head2.intersect(points[points.length - 1])); } if (edge.toCluster) { log$1.info("to cluster abc88", clusterDb2[edge.toCluster]); points = cutPathAtIntersect(edge.points, clusterDb2[edge.toCluster].node); pointsHasChanged = true; } if (edge.fromCluster) { log$1.info("from cluster abc88", clusterDb2[edge.fromCluster]); points = cutPathAtIntersect(points.reverse(), clusterDb2[edge.fromCluster].node).reverse(); pointsHasChanged = true; } const lineData = points.filter((p) => !Number.isNaN(p.y)); let curve; if (diagramType === "graph" || diagramType === "flowchart") { curve = edge.curve || curveBasis; } else { curve = curveBasis; } const lineFunction = line().x(function(d) { return d.x; }).y(function(d) { return d.y; }).curve(curve); let strokeClasses; switch (edge.thickness) { case "normal": strokeClasses = "edge-thickness-normal"; break; case "thick": strokeClasses = "edge-thickness-thick"; break; case "invisible": strokeClasses = "edge-thickness-thick"; break; default: strokeClasses = ""; } switch (edge.pattern) { case "solid": strokeClasses += " edge-pattern-solid"; break; case "dotted": strokeClasses += " edge-pattern-dotted"; break; case "dashed": strokeClasses += " edge-pattern-dashed"; break; } const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", edge.id).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "")).attr("style", edge.style); let url = ""; if (getConfig$1().flowchart.arrowMarkerAbsolute || getConfig$1().state.arrowMarkerAbsolute) { url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; url = url.replace(/\(/g, "\\("); url = url.replace(/\)/g, "\\)"); } log$1.info("arrowTypeStart", edge.arrowTypeStart); log$1.info("arrowTypeEnd", edge.arrowTypeEnd); switch (edge.arrowTypeStart) { case "arrow_cross": svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-crossStart)"); break; case "arrow_point": svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-pointStart)"); break; case "arrow_barb": svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-barbStart)"); break; case "arrow_circle": svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-circleStart)"); break; case "aggregation": svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-aggregationStart)"); break; case "extension": svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-extensionStart)"); break; case "composition": svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-compositionStart)"); break; case "dependency": svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-dependencyStart)"); break; case "lollipop": svgPath.attr("marker-start", "url(" + url + "#" + diagramType + "-lollipopStart)"); break; } switch (edge.arrowTypeEnd) { case "arrow_cross": svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-crossEnd)"); break; case "arrow_point": svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-pointEnd)"); break; case "arrow_barb": svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-barbEnd)"); break; case "arrow_circle": svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-circleEnd)"); break; case "aggregation": svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-aggregationEnd)"); break; case "extension": svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-extensionEnd)"); break; case "composition": svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-compositionEnd)"); break; case "dependency": svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-dependencyEnd)"); break; case "lollipop": svgPath.attr("marker-end", "url(" + url + "#" + diagramType + "-lollipopEnd)"); break; } let paths = {}; if (pointsHasChanged) { paths.updatedPath = points; } paths.originalPath = edge.points; return paths; }; const recursiveRender = (_elem, graph, diagramtype, parentCluster) => { log$1.info("Graph in recursive render: XXX", graphlib.json.write(graph), parentCluster); const dir = graph.graph().rankdir; log$1.trace("Dir in recursive render - dir:", dir); const elem = _elem.insert("g").attr("class", "root"); if (!graph.nodes()) { log$1.info("No nodes found for", graph); } else { log$1.info("Recursive render XXX", graph.nodes()); } if (graph.edges().length > 0) { log$1.trace("Recursive edges", graph.edge(graph.edges()[0])); } const clusters = elem.insert("g").attr("class", "clusters"); const edgePaths = elem.insert("g").attr("class", "edgePaths"); const edgeLabels2 = elem.insert("g").attr("class", "edgeLabels"); const nodes = elem.insert("g").attr("class", "nodes"); graph.nodes().forEach(function(v) { const node = graph.node(v); if (typeof parentCluster !== "undefined") { const data = JSON.parse(JSON.stringify(parentCluster.clusterData)); log$1.info("Setting data for cluster XXX (", v, ") ", data, parentCluster); graph.setNode(parentCluster.id, data); if (!graph.parent(v)) { log$1.trace("Setting parent", v, parentCluster.id); graph.setParent(v, parentCluster.id, data); } } log$1.info("(Insert) Node XXX" + v + ": " + JSON.stringify(graph.node(v))); if (node && node.clusterNode) { log$1.info("Cluster identified", v, node.width, graph.node(v)); const o = recursiveRender(nodes, node.graph, diagramtype, graph.node(v)); const newEl = o.elem; updateNodeBounds(node, newEl); node.diff = o.diff || 0; log$1.info("Node bounds (abc123)", v, node, node.width, node.x, node.y); setNodeElem(newEl, node); log$1.warn("Recursive render complete ", newEl, node); } else { if (graph.children(v).length > 0) { log$1.info("Cluster - the non recursive path XXX", v, node.id, node, graph); log$1.info(findNonClusterChild(node.id, graph)); clusterDb[node.id] = { id: findNonClusterChild(node.id, graph), node }; } else { log$1.info("Node - the non recursive path", v, node.id, node); insertNode(nodes, graph.node(v), dir); } } }); graph.edges().forEach(function(e) { const edge = graph.edge(e.v, e.w, e.name); log$1.info("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(e)); log$1.info("Edge " + e.v + " -> " + e.w + ": ", e, " ", JSON.stringify(graph.edge(e))); log$1.info("Fix", clusterDb, "ids:", e.v, e.w, "Translateing: ", clusterDb[e.v], clusterDb[e.w]); insertEdgeLabel(edgeLabels2, edge); }); graph.edges().forEach(function(e) { log$1.info("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(e)); }); log$1.info("#############################################"); log$1.info("### Layout ###"); log$1.info("#############################################"); log$1.info(graph); dagre.layout(graph); log$1.info("Graph after layout:", graphlib.json.write(graph)); let diff = 0; sortNodesByHierarchy(graph).forEach(function(v) { const node = graph.node(v); log$1.info("Position " + v + ": " + JSON.stringify(graph.node(v))); log$1.info( "Position " + v + ": (" + node.x, "," + node.y, ") width: ", node.width, " height: ", node.height ); if (node && node.clusterNode) { positionNode(node); } else { if (graph.children(v).length > 0) { insertCluster(clusters, node); clusterDb[node.id].node = node; } else { positionNode(node); } } }); graph.edges().forEach(function(e) { const edge = graph.edge(e); log$1.info("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(edge), edge); const paths = insertEdge(edgePaths, e, edge, clusterDb, diagramtype, graph); positionEdgeLabel(edge, paths); }); graph.nodes().forEach(function(v) { const n = graph.node(v); log$1.info(v, n.type, n.diff); if (n.type === "group") { diff = n.diff; } }); return { elem, diff }; }; const render$1 = (elem, graph, markers2, diagramtype, id) => { insertMarkers$2(elem, markers2, diagramtype, id); clear$a(); clear$8(); clear$9(); clear$b(); log$1.warn("Graph at first:", graphlib.json.write(graph)); adjustClustersAndEdges(graph); log$1.warn("Graph after:", graphlib.json.write(graph)); recursiveRender(elem, graph, diagramtype); }; const sanitizeText$1 = (txt) => common.sanitizeText(txt, getConfig$1()); const addClasses = function(classes2, g, _id, diagObj) { const keys = Object.keys(classes2); log$1.info("keys:", keys); log$1.info(classes2); keys.forEach(function(id) { const vertex = classes2[id]; let cssClassStr = ""; if (vertex.cssClasses.length > 0) { cssClassStr = cssClassStr + " " + vertex.cssClasses.join(" "); } const styles = { labelStyle: "" }; let vertexText = vertex.text !== void 0 ? vertex.text : vertex.id; let radious = 0; let _shape = ""; switch (vertex.type) { case "class": _shape = "class_box"; break; default: _shape = "class_box"; } g.setNode(vertex.id, { labelStyle: styles.labelStyle, shape: _shape, labelText: sanitizeText$1(vertexText), classData: vertex, rx: radious, ry: radious, class: cssClassStr, style: styles.style, id: vertex.id, domId: vertex.domId, tooltip: diagObj.db.getTooltip(vertex.id) || "", haveCallback: vertex.haveCallback, link: vertex.link, width: vertex.type === "group" ? 500 : void 0, type: vertex.type, padding: getConfig$1().flowchart.padding }); log$1.info("setNode", { labelStyle: styles.labelStyle, shape: _shape, labelText: vertexText, rx: radious, ry: radious, class: cssClassStr, style: styles.style, id: vertex.id, width: vertex.type === "group" ? 500 : void 0, type: vertex.type, padding: getConfig$1().flowchart.padding }); }); }; const addRelations = function(relations2, g) { const conf2 = getConfig$1().flowchart; let cnt2 = 0; relations2.forEach(function(edge) { cnt2++; const edgeData = {}; edgeData.classes = "relation"; edgeData.pattern = edge.relation.lineType == 1 ? "dashed" : "solid"; edgeData.id = "id" + cnt2; if (edge.type === "arrow_open") { edgeData.arrowhead = "none"; } else { edgeData.arrowhead = "normal"; } log$1.info(edgeData, edge); edgeData.startLabelRight = edge.relationTitle1 === "none" ? "" : edge.relationTitle1; edgeData.endLabelLeft = edge.relationTitle2 === "none" ? "" : edge.relationTitle2; edgeData.arrowTypeStart = getArrowMarker(edge.relation.type1); edgeData.arrowTypeEnd = getArrowMarker(edge.relation.type2); let style = ""; let labelStyle = ""; if (typeof edge.style !== "undefined") { const styles = getStylesFromArray(edge.style); style = styles.style; labelStyle = styles.labelStyle; } else { style = "fill:none"; } edgeData.style = style; edgeData.labelStyle = labelStyle; if (typeof edge.interpolate !== "undefined") { edgeData.curve = interpolateToCurve(edge.interpolate, curveLinear); } else if (typeof relations2.defaultInterpolate !== "undefined") { edgeData.curve = interpolateToCurve(relations2.defaultInterpolate, curveLinear); } else { edgeData.curve = interpolateToCurve(conf2.curve, curveLinear); } edge.text = edge.title; if (typeof edge.text === "undefined") { if (typeof edge.style !== "undefined") { edgeData.arrowheadStyle = "fill: #333"; } } else { edgeData.arrowheadStyle = "fill: #333"; edgeData.labelpos = "c"; if (getConfig$1().flowchart.htmlLabels) { edgeData.labelType = "html"; edgeData.label = '' + edge.text + ""; } else { edgeData.labelType = "text"; edgeData.label = edge.text.replace(common.lineBreakRegex, "\n"); if (typeof edge.style === "undefined") { edgeData.style = edgeData.style || "stroke: #333; stroke-width: 1.5px;fill:none"; } edgeData.labelStyle = edgeData.labelStyle.replace("color:", "fill:"); } } g.setEdge(edge.id1, edge.id2, edgeData, cnt2); }); }; const setConf$9 = function(cnf) { const keys = Object.keys(cnf); keys.forEach(function(key) { cnf[key]; }); }; const draw$c = function(text, id, _version, diagObj) { log$1.info("Drawing class - ", id); const conf2 = getConfig$1().flowchart; const securityLevel = getConfig$1().securityLevel; log$1.info("config:", conf2); const nodeSpacing = conf2.nodeSpacing || 50; const rankSpacing = conf2.rankSpacing || 50; const g = new graphlib.Graph({ multigraph: true, compound: true }).setGraph({ rankdir: diagObj.db.getDirection(), nodesep: nodeSpacing, ranksep: rankSpacing, marginx: 8, marginy: 8 }).setDefaultEdgeLabel(function() { return {}; }); const classes2 = diagObj.db.getClasses(); const relations2 = diagObj.db.getRelations(); log$1.info(relations2); addClasses(classes2, g, id, diagObj); addRelations(relations2, g); let sandboxElement; if (securityLevel === "sandbox") { sandboxElement = select("#i" + id); } const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); const svg = root2.select(`[id="${id}"]`); const element = root2.select("#" + id + " g"); render$1( element, g, ["aggregation", "extension", "composition", "dependency", "lollipop"], "classDiagram", id ); setupGraphViewbox$1(g, svg, conf2.diagramPadding, conf2.useMaxWidth); if (!conf2.htmlLabels) { const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; const labels = doc.querySelectorAll('[id="' + id + '"] .edgeLabel .label'); for (let k = 0; k < labels.length; k++) { const label = labels[k]; const dim = label.getBBox(); const rect2 = doc.createElementNS("http://www.w3.org/2000/svg", "rect"); rect2.setAttribute("rx", 0); rect2.setAttribute("ry", 0); rect2.setAttribute("width", dim.width); rect2.setAttribute("height", dim.height); label.insertBefore(rect2, label.firstChild); } } addSVGAccessibilityFields(diagObj.db, svg, id); }; function getArrowMarker(type2) { let marker; switch (type2) { case 0: marker = "aggregation"; break; case 1: marker = "extension"; break; case 2: marker = "composition"; break; case 3: marker = "dependency"; break; case 4: marker = "lollipop"; break; default: marker = "none"; } return marker; } const classRendererV2 = { setConf: setConf$9, draw: draw$c }; var parser$8 = function() { var o = function(k, v, o2, l) { for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ; return o2; }, $V0 = [1, 2], $V1 = [1, 5], $V2 = [6, 9, 11, 23, 25, 27, 29, 30, 31, 49], $V3 = [1, 17], $V4 = [1, 18], $V5 = [1, 19], $V6 = [1, 20], $V7 = [1, 21], $V8 = [1, 22], $V9 = [1, 25], $Va = [1, 30], $Vb = [1, 31], $Vc = [1, 32], $Vd = [1, 33], $Ve = [6, 9, 11, 15, 20, 23, 25, 27, 29, 30, 31, 42, 43, 44, 45, 49], $Vf = [1, 45], $Vg = [30, 31, 46, 47], $Vh = [4, 6, 9, 11, 23, 25, 27, 29, 30, 31, 49], $Vi = [42, 43, 44, 45], $Vj = [22, 37], $Vk = [1, 64]; var parser2 = { trace: function trace() { }, yy: {}, symbols_: { "error": 2, "start": 3, "ER_DIAGRAM": 4, "document": 5, "EOF": 6, "directive": 7, "line": 8, "SPACE": 9, "statement": 10, "NEWLINE": 11, "openDirective": 12, "typeDirective": 13, "closeDirective": 14, ":": 15, "argDirective": 16, "entityName": 17, "relSpec": 18, "role": 19, "BLOCK_START": 20, "attributes": 21, "BLOCK_STOP": 22, "title": 23, "title_value": 24, "acc_title": 25, "acc_title_value": 26, "acc_descr": 27, "acc_descr_value": 28, "acc_descr_multiline_value": 29, "ALPHANUM": 30, "ENTITY_NAME": 31, "attribute": 32, "attributeType": 33, "attributeName": 34, "attributeKeyType": 35, "attributeComment": 36, "ATTRIBUTE_WORD": 37, "ATTRIBUTE_KEY": 38, "COMMENT": 39, "cardinality": 40, "relType": 41, "ZERO_OR_ONE": 42, "ZERO_OR_MORE": 43, "ONE_OR_MORE": 44, "ONLY_ONE": 45, "NON_IDENTIFYING": 46, "IDENTIFYING": 47, "WORD": 48, "open_directive": 49, "type_directive": 50, "arg_directive": 51, "close_directive": 52, "$accept": 0, "$end": 1 }, terminals_: { 2: "error", 4: "ER_DIAGRAM", 6: "EOF", 9: "SPACE", 11: "NEWLINE", 15: ":", 20: "BLOCK_START", 22: "BLOCK_STOP", 23: "title", 24: "title_value", 25: "acc_title", 26: "acc_title_value", 27: "acc_descr", 28: "acc_descr_value", 29: "acc_descr_multiline_value", 30: "ALPHANUM", 31: "ENTITY_NAME", 37: "ATTRIBUTE_WORD", 38: "ATTRIBUTE_KEY", 39: "COMMENT", 42: "ZERO_OR_ONE", 43: "ZERO_OR_MORE", 44: "ONE_OR_MORE", 45: "ONLY_ONE", 46: "NON_IDENTIFYING", 47: "IDENTIFYING", 48: "WORD", 49: "open_directive", 50: "type_directive", 51: "arg_directive", 52: "close_directive" }, productions_: [0, [3, 3], [3, 2], [5, 0], [5, 2], [8, 2], [8, 1], [8, 1], [8, 1], [7, 4], [7, 6], [10, 1], [10, 5], [10, 4], [10, 3], [10, 1], [10, 2], [10, 2], [10, 2], [10, 1], [17, 1], [17, 1], [21, 1], [21, 2], [32, 2], [32, 3], [32, 3], [32, 4], [33, 1], [34, 1], [35, 1], [36, 1], [18, 3], [40, 1], [40, 1], [40, 1], [40, 1], [41, 1], [41, 1], [19, 1], [19, 1], [19, 1], [12, 1], [13, 1], [16, 1], [14, 1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { var $0 = $$.length - 1; switch (yystate) { case 1: break; case 3: this.$ = []; break; case 4: $$[$0 - 1].push($$[$0]); this.$ = $$[$0 - 1]; break; case 5: case 6: this.$ = $$[$0]; break; case 7: case 8: this.$ = []; break; case 12: yy.addEntity($$[$0 - 4]); yy.addEntity($$[$0 - 2]); yy.addRelationship($$[$0 - 4], $$[$0], $$[$0 - 2], $$[$0 - 3]); break; case 13: yy.addEntity($$[$0 - 3]); yy.addAttributes($$[$0 - 3], $$[$0 - 1]); break; case 14: yy.addEntity($$[$0 - 2]); break; case 15: yy.addEntity($$[$0]); break; case 16: case 17: this.$ = $$[$0].trim(); yy.setAccTitle(this.$); break; case 18: case 19: this.$ = $$[$0].trim(); yy.setAccDescription(this.$); break; case 20: case 41: this.$ = $$[$0]; break; case 21: case 39: case 40: this.$ = $$[$0].replace(/"/g, ""); break; case 22: this.$ = [$$[$0]]; break; case 23: $$[$0].push($$[$0 - 1]); this.$ = $$[$0]; break; case 24: this.$ = { attributeType: $$[$0 - 1], attributeName: $$[$0] }; break; case 25: this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeKeyType: $$[$0] }; break; case 26: this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeComment: $$[$0] }; break; case 27: this.$ = { attributeType: $$[$0 - 3], attributeName: $$[$0 - 2], attributeKeyType: $$[$0 - 1], attributeComment: $$[$0] }; break; case 28: case 29: case 30: this.$ = $$[$0]; break; case 31: this.$ = $$[$0].replace(/"/g, ""); break; case 32: this.$ = { cardA: $$[$0], relType: $$[$0 - 1], cardB: $$[$0 - 2] }; break; case 33: this.$ = yy.Cardinality.ZERO_OR_ONE; break; case 34: this.$ = yy.Cardinality.ZERO_OR_MORE; break; case 35: this.$ = yy.Cardinality.ONE_OR_MORE; break; case 36: this.$ = yy.Cardinality.ONLY_ONE; break; case 37: this.$ = yy.Identification.NON_IDENTIFYING; break; case 38: this.$ = yy.Identification.IDENTIFYING; break; case 42: yy.parseDirective("%%{", "open_directive"); break; case 43: yy.parseDirective($$[$0], "type_directive"); break; case 44: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], "arg_directive"); break; case 45: yy.parseDirective("}%%", "close_directive", "er"); break; } }, table: [{ 3: 1, 4: $V0, 7: 3, 12: 4, 49: $V1 }, { 1: [3] }, o($V2, [2, 3], { 5: 6 }), { 3: 7, 4: $V0, 7: 3, 12: 4, 49: $V1 }, { 13: 8, 50: [1, 9] }, { 50: [2, 42] }, { 6: [1, 10], 7: 15, 8: 11, 9: [1, 12], 10: 13, 11: [1, 14], 12: 4, 17: 16, 23: $V3, 25: $V4, 27: $V5, 29: $V6, 30: $V7, 31: $V8, 49: $V1 }, { 1: [2, 2] }, { 14: 23, 15: [1, 24], 52: $V9 }, o([15, 52], [2, 43]), o($V2, [2, 8], { 1: [2, 1] }), o($V2, [2, 4]), { 7: 15, 10: 26, 12: 4, 17: 16, 23: $V3, 25: $V4, 27: $V5, 29: $V6, 30: $V7, 31: $V8, 49: $V1 }, o($V2, [2, 6]), o($V2, [2, 7]), o($V2, [2, 11]), o($V2, [2, 15], { 18: 27, 40: 29, 20: [1, 28], 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd }), { 24: [1, 34] }, { 26: [1, 35] }, { 28: [1, 36] }, o($V2, [2, 19]), o($Ve, [2, 20]), o($Ve, [2, 21]), { 11: [1, 37] }, { 16: 38, 51: [1, 39] }, { 11: [2, 45] }, o($V2, [2, 5]), { 17: 40, 30: $V7, 31: $V8 }, { 21: 41, 22: [1, 42], 32: 43, 33: 44, 37: $Vf }, { 41: 46, 46: [1, 47], 47: [1, 48] }, o($Vg, [2, 33]), o($Vg, [2, 34]), o($Vg, [2, 35]), o($Vg, [2, 36]), o($V2, [2, 16]), o($V2, [2, 17]), o($V2, [2, 18]), o($Vh, [2, 9]), { 14: 49, 52: $V9 }, { 52: [2, 44] }, { 15: [1, 50] }, { 22: [1, 51] }, o($V2, [2, 14]), { 21: 52, 22: [2, 22], 32: 43, 33: 44, 37: $Vf }, { 34: 53, 37: [1, 54] }, { 37: [2, 28] }, { 40: 55, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd }, o($Vi, [2, 37]), o($Vi, [2, 38]), { 11: [1, 56] }, { 19: 57, 30: [1, 60], 31: [1, 59], 48: [1, 58] }, o($V2, [2, 13]), { 22: [2, 23] }, o($Vj, [2, 24], { 35: 61, 36: 62, 38: [1, 63], 39: $Vk }), o([22, 37, 38, 39], [2, 29]), o([30, 31], [2, 32]), o($Vh, [2, 10]), o($V2, [2, 12]), o($V2, [2, 39]), o($V2, [2, 40]), o($V2, [2, 41]), o($Vj, [2, 25], { 36: 65, 39: $Vk }), o($Vj, [2, 26]), o([22, 37, 39], [2, 30]), o($Vj, [2, 31]), o($Vj, [2, 27])], defaultActions: { 5: [2, 42], 7: [2, 2], 25: [2, 45], 39: [2, 44], 45: [2, 28], 52: [2, 23] }, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse2(input) { var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer2 = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer2.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer2; sharedState.yy.parser = this; if (typeof lexer2.yylloc == "undefined") { lexer2.yylloc = {}; } var yyloc = lexer2.yylloc; lstack.push(yyloc); var ranges = lexer2.options && lexer2.options.ranges; if (typeof sharedState.yy.parseError === "function") { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function lex() { var token; token = tstack.pop() || lexer2.lex() || EOF; if (typeof token !== "number") { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self2.symbols_[token] || token; } return token; } var symbol, state, action, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push("'" + this.terminals_[p] + "'"); } } if (lexer2.showPosition) { errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; } else { errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); } this.parseError(errStr, { text: lexer2.match, token: this.terminals_[symbol] || symbol, line: lexer2.yylineno, loc: yyloc, expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer2.yytext); lstack.push(lexer2.yylloc); stack.push(action[1]); symbol = null; { yyleng = lexer2.yyleng; yytext = lexer2.yytext; yylineno = lexer2.yylineno; yyloc = lexer2.yylloc; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== "undefined") { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; } }; var lexer = function() { var lexer2 = { EOF: 1, parseError: function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, setInput: function(input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; this.yylineno = this.yyleng = 0; this.yytext = this.matched = this.match = ""; this.conditionStack = ["INITIAL"]; this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; if (this.options.ranges) { this.yylloc.range = [0, 0]; } this.offset = 0; return this; }, input: function() { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, unput: function(ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); this.offset -= len; var oldLines = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1); this.matched = this.matched.substr(0, this.matched.length - 1); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, more: function() { this._more = true; return this; }, reject: function() { if (this.options.backtrack_lexer) { this._backtrack = true; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, less: function(n) { this.unput(this.match.slice(n)); }, pastInput: function() { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); }, upcomingInput: function() { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20 - next.length); } return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, ""); }, showPosition: function() { var pre = this.pastInput(); var c2 = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c2 + "^"; }, test_match: function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { backup = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { for (var k in backup) { this[k] = backup[k]; } return false; } return false; }, next: function() { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ""; this.match = ""; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; } else { return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } return false; } if (this._input === "") { return this.EOF; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, lex: function lex() { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, begin: function begin(condition) { this.conditionStack.push(condition); }, popState: function popState() { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, _currentRules: function _currentRules() { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, topState: function topState(n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, pushState: function pushState(condition) { this.begin(condition); }, stateStackSize: function stateStackSize() { return this.conditionStack.length; }, options: { "case-insensitive": true }, performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { switch ($avoiding_name_collisions) { case 0: this.begin("acc_title"); return 25; case 1: this.popState(); return "acc_title_value"; case 2: this.begin("acc_descr"); return 27; case 3: this.popState(); return "acc_descr_value"; case 4: this.begin("acc_descr_multiline"); break; case 5: this.popState(); break; case 6: return "acc_descr_multiline_value"; case 7: this.begin("open_directive"); return 49; case 8: this.begin("type_directive"); return 50; case 9: this.popState(); this.begin("arg_directive"); return 15; case 10: this.popState(); this.popState(); return 52; case 11: return 51; case 12: break; case 13: break; case 14: return 11; case 15: break; case 16: return 9; case 17: return 31; case 18: return 48; case 19: return 4; case 20: this.begin("block"); return 20; case 21: break; case 22: return 38; case 23: return 37; case 24: return 37; case 25: return 39; case 26: break; case 27: this.popState(); return 22; case 28: return yy_.yytext[0]; case 29: return 42; case 30: return 43; case 31: return 44; case 32: return 45; case 33: return 42; case 34: return 43; case 35: return 44; case 36: return 46; case 37: return 47; case 38: return 46; case 39: return 46; case 40: return 30; case 41: return yy_.yytext[0]; case 42: return 6; } }, rules: [/^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:[\s]+)/i, /^(?:"[^"%\r\n\v\b\\]+")/i, /^(?:"[^"]*")/i, /^(?:erDiagram\b)/i, /^(?:\{)/i, /^(?:\s+)/i, /^(?:\b((?:PK)|(?:FK))\b)/i, /^(?:(.*?)[~](.*?)*[~])/i, /^(?:[A-Za-z][A-Za-z0-9\-_\[\]]*)/i, /^(?:"[^"]*")/i, /^(?:[\n]+)/i, /^(?:\})/i, /^(?:.)/i, /^(?:\|o\b)/i, /^(?:\}o\b)/i, /^(?:\}\|)/i, /^(?:\|\|)/i, /^(?:o\|)/i, /^(?:o\{)/i, /^(?:\|\{)/i, /^(?:\.\.)/i, /^(?:--)/i, /^(?:\.-)/i, /^(?:-\.)/i, /^(?:[A-Za-z][A-Za-z0-9\-_]*)/i, /^(?:.)/i, /^(?:$)/i], conditions: { "acc_descr_multiline": { "rules": [5, 6], "inclusive": false }, "acc_descr": { "rules": [3], "inclusive": false }, "acc_title": { "rules": [1], "inclusive": false }, "open_directive": { "rules": [8], "inclusive": false }, "type_directive": { "rules": [9, 10], "inclusive": false }, "arg_directive": { "rules": [10, 11], "inclusive": false }, "block": { "rules": [21, 22, 23, 24, 25, 26, 27, 28], "inclusive": false }, "INITIAL": { "rules": [0, 2, 4, 7, 12, 13, 14, 15, 16, 17, 18, 19, 20, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42], "inclusive": true } } }; return lexer2; }(); parser2.lexer = lexer; function Parser() { this.yy = {}; } Parser.prototype = parser2; parser2.Parser = Parser; return new Parser(); }(); parser$8.parser = parser$8; const erDetector = (txt) => { return txt.match(/^\s*erDiagram/) !== null; }; let entities = {}; let relationships = []; const Cardinality = { ZERO_OR_ONE: "ZERO_OR_ONE", ZERO_OR_MORE: "ZERO_OR_MORE", ONE_OR_MORE: "ONE_OR_MORE", ONLY_ONE: "ONLY_ONE" }; const Identification = { NON_IDENTIFYING: "NON_IDENTIFYING", IDENTIFYING: "IDENTIFYING" }; const parseDirective$8 = function(statement, context, type2) { mermaidAPI.parseDirective(this, statement, context, type2); }; const addEntity = function(name2) { if (typeof entities[name2] === "undefined") { entities[name2] = { attributes: [] }; log$1.info("Added new entity :", name2); } return entities[name2]; }; const getEntities = () => entities; const addAttributes = function(entityName, attribs) { let entity = addEntity(entityName); let i; for (i = attribs.length - 1; i >= 0; i--) { entity.attributes.push(attribs[i]); log$1.debug("Added attribute ", attribs[i].attributeName); } }; const addRelationship$1 = function(entA, rolA, entB, rSpec) { let rel = { entityA: entA, roleA: rolA, entityB: entB, relSpec: rSpec }; relationships.push(rel); log$1.debug("Added new relationship :", rel); }; const getRelationships$1 = () => relationships; const clear$7 = function() { entities = {}; relationships = []; clear$g(); }; const erDb = { Cardinality, Identification, parseDirective: parseDirective$8, getConfig: () => getConfig$1().er, addEntity, addAttributes, getEntities, addRelationship: addRelationship$1, getRelationships: getRelationships$1, clear: clear$7, setAccTitle, getAccTitle, setAccDescription, getAccDescription }; const ERMarkers = { ONLY_ONE_START: "ONLY_ONE_START", ONLY_ONE_END: "ONLY_ONE_END", ZERO_OR_ONE_START: "ZERO_OR_ONE_START", ZERO_OR_ONE_END: "ZERO_OR_ONE_END", ONE_OR_MORE_START: "ONE_OR_MORE_START", ONE_OR_MORE_END: "ONE_OR_MORE_END", ZERO_OR_MORE_START: "ZERO_OR_MORE_START", ZERO_OR_MORE_END: "ZERO_OR_MORE_END" }; const insertMarkers$1 = function(elem, conf2) { let marker; elem.append("defs").append("marker").attr("id", ERMarkers.ONLY_ONE_START).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M9,0 L9,18 M15,0 L15,18"); elem.append("defs").append("marker").attr("id", ERMarkers.ONLY_ONE_END).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M3,0 L3,18 M9,0 L9,18"); marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_ONE_START).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto"); marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 21).attr("cy", 9).attr("r", 6); marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M9,0 L9,18"); marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_ONE_END).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto"); marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 9).attr("r", 6); marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M21,0 L21,18"); elem.append("defs").append("marker").attr("id", ERMarkers.ONE_OR_MORE_START).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"); elem.append("defs").append("marker").attr("id", ERMarkers.ONE_OR_MORE_END).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18"); marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_MORE_START).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto"); marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 48).attr("cy", 18).attr("r", 6); marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18"); marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_MORE_END).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto"); marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6); marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18"); return; }; const erMarkers = { ERMarkers, insertMarkers: insertMarkers$1 }; const BAD_ID_CHARS_REGEXP = /[^A-Za-z0-9]([\W])*/g; let conf$9 = {}; let entityNameIds = /* @__PURE__ */ new Map(); const setConf$8 = function(cnf) { const keys = Object.keys(cnf); for (let i = 0; i < keys.length; i++) { conf$9[keys[i]] = cnf[keys[i]]; } }; const drawAttributes = (groupNode, entityTextNode, attributes) => { const heightPadding = conf$9.entityPadding / 3; const widthPadding = conf$9.entityPadding / 3; const attrFontSize = conf$9.fontSize * 0.85; const labelBBox = entityTextNode.node().getBBox(); const attributeNodes = []; let hasKeyType = false; let hasComment = false; let maxTypeWidth = 0; let maxNameWidth = 0; let maxKeyWidth = 0; let maxCommentWidth = 0; let cumulativeHeight = labelBBox.height + heightPadding * 2; let attrNum = 1; attributes.forEach((item) => { if (item.attributeKeyType !== void 0) { hasKeyType = true; } if (item.attributeComment !== void 0) { hasComment = true; } }); attributes.forEach((item) => { const attrPrefix = `${entityTextNode.node().id}-attr-${attrNum}`; let nodeHeight = 0; const attributeType = parseGenericTypes(item.attributeType); const typeNode = groupNode.append("text").attr("class", "er entityLabel").attr("id", `${attrPrefix}-type`).attr("x", 0).attr("y", 0).attr("dominant-baseline", "middle").attr("text-anchor", "left").attr( "style", "font-family: " + getConfig$1().fontFamily + "; font-size: " + attrFontSize + "px" ).text(attributeType); const nameNode = groupNode.append("text").attr("class", "er entityLabel").attr("id", `${attrPrefix}-name`).attr("x", 0).attr("y", 0).attr("dominant-baseline", "middle").attr("text-anchor", "left").attr( "style", "font-family: " + getConfig$1().fontFamily + "; font-size: " + attrFontSize + "px" ).text(item.attributeName); const attributeNode = {}; attributeNode.tn = typeNode; attributeNode.nn = nameNode; const typeBBox = typeNode.node().getBBox(); const nameBBox = nameNode.node().getBBox(); maxTypeWidth = Math.max(maxTypeWidth, typeBBox.width); maxNameWidth = Math.max(maxNameWidth, nameBBox.width); nodeHeight = Math.max(typeBBox.height, nameBBox.height); if (hasKeyType) { const keyTypeNode = groupNode.append("text").attr("class", "er entityLabel").attr("id", `${attrPrefix}-key`).attr("x", 0).attr("y", 0).attr("dominant-baseline", "middle").attr("text-anchor", "left").attr( "style", "font-family: " + getConfig$1().fontFamily + "; font-size: " + attrFontSize + "px" ).text(item.attributeKeyType || ""); attributeNode.kn = keyTypeNode; const keyTypeBBox = keyTypeNode.node().getBBox(); maxKeyWidth = Math.max(maxKeyWidth, keyTypeBBox.width); nodeHeight = Math.max(nodeHeight, keyTypeBBox.height); } if (hasComment) { const commentNode = groupNode.append("text").attr("class", "er entityLabel").attr("id", `${attrPrefix}-comment`).attr("x", 0).attr("y", 0).attr("dominant-baseline", "middle").attr("text-anchor", "left").attr( "style", "font-family: " + getConfig$1().fontFamily + "; font-size: " + attrFontSize + "px" ).text(item.attributeComment || ""); attributeNode.cn = commentNode; const commentNodeBBox = commentNode.node().getBBox(); maxCommentWidth = Math.max(maxCommentWidth, commentNodeBBox.width); nodeHeight = Math.max(nodeHeight, commentNodeBBox.height); } attributeNode.height = nodeHeight; attributeNodes.push(attributeNode); cumulativeHeight += nodeHeight + heightPadding * 2; attrNum += 1; }); let widthPaddingFactor = 4; if (hasKeyType) { widthPaddingFactor += 2; } if (hasComment) { widthPaddingFactor += 2; } const maxWidth = maxTypeWidth + maxNameWidth + maxKeyWidth + maxCommentWidth; const bBox = { width: Math.max( conf$9.minEntityWidth, Math.max( labelBBox.width + conf$9.entityPadding * 2, maxWidth + widthPadding * widthPaddingFactor ) ), height: attributes.length > 0 ? cumulativeHeight : Math.max(conf$9.minEntityHeight, labelBBox.height + conf$9.entityPadding * 2) }; if (attributes.length > 0) { const spareColumnWidth = Math.max( 0, (bBox.width - maxWidth - widthPadding * widthPaddingFactor) / (widthPaddingFactor / 2) ); entityTextNode.attr( "transform", "translate(" + bBox.width / 2 + "," + (heightPadding + labelBBox.height / 2) + ")" ); let heightOffset = labelBBox.height + heightPadding * 2; let attribStyle = "attributeBoxOdd"; attributeNodes.forEach((attributeNode) => { const alignY = heightOffset + heightPadding + attributeNode.height / 2; attributeNode.tn.attr("transform", "translate(" + widthPadding + "," + alignY + ")"); const typeRect = groupNode.insert("rect", "#" + attributeNode.tn.node().id).attr("class", `er ${attribStyle}`).attr("fill", conf$9.fill).attr("fill-opacity", "100%").attr("stroke", conf$9.stroke).attr("x", 0).attr("y", heightOffset).attr("width", maxTypeWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2); const nameXOffset = parseFloat(typeRect.attr("x")) + parseFloat(typeRect.attr("width")); attributeNode.nn.attr( "transform", "translate(" + (nameXOffset + widthPadding) + "," + alignY + ")" ); const nameRect = groupNode.insert("rect", "#" + attributeNode.nn.node().id).attr("class", `er ${attribStyle}`).attr("fill", conf$9.fill).attr("fill-opacity", "100%").attr("stroke", conf$9.stroke).attr("x", nameXOffset).attr("y", heightOffset).attr("width", maxNameWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2); let keyTypeAndCommentXOffset = parseFloat(nameRect.attr("x")) + parseFloat(nameRect.attr("width")); if (hasKeyType) { attributeNode.kn.attr( "transform", "translate(" + (keyTypeAndCommentXOffset + widthPadding) + "," + alignY + ")" ); const keyTypeRect = groupNode.insert("rect", "#" + attributeNode.kn.node().id).attr("class", `er ${attribStyle}`).attr("fill", conf$9.fill).attr("fill-opacity", "100%").attr("stroke", conf$9.stroke).attr("x", keyTypeAndCommentXOffset).attr("y", heightOffset).attr("width", maxKeyWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2); keyTypeAndCommentXOffset = parseFloat(keyTypeRect.attr("x")) + parseFloat(keyTypeRect.attr("width")); } if (hasComment) { attributeNode.cn.attr( "transform", "translate(" + (keyTypeAndCommentXOffset + widthPadding) + "," + alignY + ")" ); groupNode.insert("rect", "#" + attributeNode.cn.node().id).attr("class", `er ${attribStyle}`).attr("fill", conf$9.fill).attr("fill-opacity", "100%").attr("stroke", conf$9.stroke).attr("x", keyTypeAndCommentXOffset).attr("y", heightOffset).attr("width", maxCommentWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2); } heightOffset += attributeNode.height + heightPadding * 2; attribStyle = attribStyle === "attributeBoxOdd" ? "attributeBoxEven" : "attributeBoxOdd"; }); } else { bBox.height = Math.max(conf$9.minEntityHeight, cumulativeHeight); entityTextNode.attr("transform", "translate(" + bBox.width / 2 + "," + bBox.height / 2 + ")"); } return bBox; }; const drawEntities = function(svgNode, entities2, graph) { const keys = Object.keys(entities2); let firstOne; keys.forEach(function(entityName) { const entityId = generateId(entityName, "entity"); entityNameIds.set(entityName, entityId); const groupNode = svgNode.append("g").attr("id", entityId); firstOne = firstOne === void 0 ? entityId : firstOne; const textId = "text-" + entityId; const textNode = groupNode.append("text").attr("class", "er entityLabel").attr("id", textId).attr("x", 0).attr("y", 0).attr("dominant-baseline", "middle").attr("text-anchor", "middle").attr( "style", "font-family: " + getConfig$1().fontFamily + "; font-size: " + conf$9.fontSize + "px" ).text(entityName); const { width: entityWidth, height: entityHeight } = drawAttributes( groupNode, textNode, entities2[entityName].attributes ); const rectNode = groupNode.insert("rect", "#" + textId).attr("class", "er entityBox").attr("fill", conf$9.fill).attr("fill-opacity", "100%").attr("stroke", conf$9.stroke).attr("x", 0).attr("y", 0).attr("width", entityWidth).attr("height", entityHeight); const rectBBox = rectNode.node().getBBox(); graph.setNode(entityId, { width: rectBBox.width, height: rectBBox.height, shape: "rect", id: entityId }); }); return firstOne; }; const adjustEntities$1 = function(svgNode, graph) { graph.nodes().forEach(function(v) { if (typeof v !== "undefined" && typeof graph.node(v) !== "undefined") { svgNode.select("#" + v).attr( "transform", "translate(" + (graph.node(v).x - graph.node(v).width / 2) + "," + (graph.node(v).y - graph.node(v).height / 2) + " )" ); } }); }; const getEdgeName = function(rel) { return (rel.entityA + rel.roleA + rel.entityB).replace(/\s/g, ""); }; const addRelationships$1 = function(relationships2, g) { relationships2.forEach(function(r) { g.setEdge( entityNameIds.get(r.entityA), entityNameIds.get(r.entityB), { relationship: r }, getEdgeName(r) ); }); return relationships2; }; let relCnt$1 = 0; const drawRelationshipFromLayout$1 = function(svg, rel, g, insert, diagObj) { relCnt$1++; const edge = g.edge( entityNameIds.get(rel.entityA), entityNameIds.get(rel.entityB), getEdgeName(rel) ); const lineFunction = line().x(function(d) { return d.x; }).y(function(d) { return d.y; }).curve(curveBasis); const svgPath = svg.insert("path", "#" + insert).attr("class", "er relationshipLine").attr("d", lineFunction(edge.points)).attr("stroke", conf$9.stroke).attr("fill", "none"); if (rel.relSpec.relType === diagObj.db.Identification.NON_IDENTIFYING) { svgPath.attr("stroke-dasharray", "8,8"); } let url = ""; if (conf$9.arrowMarkerAbsolute) { url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; url = url.replace(/\(/g, "\\("); url = url.replace(/\)/g, "\\)"); } switch (rel.relSpec.cardA) { case diagObj.db.Cardinality.ZERO_OR_ONE: svgPath.attr("marker-end", "url(" + url + "#" + erMarkers.ERMarkers.ZERO_OR_ONE_END + ")"); break; case diagObj.db.Cardinality.ZERO_OR_MORE: svgPath.attr("marker-end", "url(" + url + "#" + erMarkers.ERMarkers.ZERO_OR_MORE_END + ")"); break; case diagObj.db.Cardinality.ONE_OR_MORE: svgPath.attr("marker-end", "url(" + url + "#" + erMarkers.ERMarkers.ONE_OR_MORE_END + ")"); break; case diagObj.db.Cardinality.ONLY_ONE: svgPath.attr("marker-end", "url(" + url + "#" + erMarkers.ERMarkers.ONLY_ONE_END + ")"); break; } switch (rel.relSpec.cardB) { case diagObj.db.Cardinality.ZERO_OR_ONE: svgPath.attr( "marker-start", "url(" + url + "#" + erMarkers.ERMarkers.ZERO_OR_ONE_START + ")" ); break; case diagObj.db.Cardinality.ZERO_OR_MORE: svgPath.attr( "marker-start", "url(" + url + "#" + erMarkers.ERMarkers.ZERO_OR_MORE_START + ")" ); break; case diagObj.db.Cardinality.ONE_OR_MORE: svgPath.attr( "marker-start", "url(" + url + "#" + erMarkers.ERMarkers.ONE_OR_MORE_START + ")" ); break; case diagObj.db.Cardinality.ONLY_ONE: svgPath.attr("marker-start", "url(" + url + "#" + erMarkers.ERMarkers.ONLY_ONE_START + ")"); break; } const len = svgPath.node().getTotalLength(); const labelPoint = svgPath.node().getPointAtLength(len * 0.5); const labelId = "rel" + relCnt$1; const labelNode = svg.append("text").attr("class", "er relationshipLabel").attr("id", labelId).attr("x", labelPoint.x).attr("y", labelPoint.y).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr( "style", "font-family: " + getConfig$1().fontFamily + "; font-size: " + conf$9.fontSize + "px" ).text(rel.roleA); const labelBBox = labelNode.node().getBBox(); svg.insert("rect", "#" + labelId).attr("class", "er relationshipLabelBox").attr("x", labelPoint.x - labelBBox.width / 2).attr("y", labelPoint.y - labelBBox.height / 2).attr("width", labelBBox.width).attr("height", labelBBox.height).attr("fill", "white").attr("fill-opacity", "85%"); }; const draw$b = function(text, id, _version, diagObj) { conf$9 = getConfig$1().er; log$1.info("Drawing ER diagram"); const securityLevel = getConfig$1().securityLevel; let sandboxElement; if (securityLevel === "sandbox") { sandboxElement = select("#i" + id); } const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); const svg = root2.select(`[id='${id}']`); erMarkers.insertMarkers(svg, conf$9); let g; g = new graphlib.Graph({ multigraph: true, directed: true, compound: false }).setGraph({ rankdir: conf$9.layoutDirection, marginx: 20, marginy: 20, nodesep: 100, edgesep: 100, ranksep: 100 }).setDefaultEdgeLabel(function() { return {}; }); const firstEntity = drawEntities(svg, diagObj.db.getEntities(), g); const relationships2 = addRelationships$1(diagObj.db.getRelationships(), g); dagre.layout(g); adjustEntities$1(svg, g); relationships2.forEach(function(rel) { drawRelationshipFromLayout$1(svg, rel, g, firstEntity, diagObj); }); const padding2 = conf$9.diagramPadding; const svgBounds = svg.node().getBBox(); const width2 = svgBounds.width + padding2 * 2; const height2 = svgBounds.height + padding2 * 2; configureSvgSize(svg, height2, width2, conf$9.useMaxWidth); svg.attr("viewBox", `${svgBounds.x - padding2} ${svgBounds.y - padding2} ${width2} ${height2}`); addSVGAccessibilityFields(diagObj.db, svg, id); }; function generateId(str = "", prefix = "") { const simplifiedStr = str.replace(BAD_ID_CHARS_REGEXP, ""); return `${strWithHyphen(prefix)}${strWithHyphen(simplifiedStr)}${v4()}`; } function strWithHyphen(str = "") { return str.length > 0 ? `${str}-` : ""; } const erRenderer = { setConf: setConf$8, draw: draw$b }; var parser$7 = function() { var o = function(k, v, o2, l) { for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ; return o2; }, $V0 = [1, 9], $V1 = [1, 7], $V2 = [1, 6], $V3 = [1, 8], $V4 = [1, 20, 21, 22, 23, 38, 44, 46, 48, 52, 66, 67, 86, 87, 88, 89, 90, 91, 95, 105, 106, 109, 111, 112, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], $V5 = [2, 10], $V6 = [1, 20], $V7 = [1, 21], $V8 = [1, 22], $V9 = [1, 23], $Va = [1, 30], $Vb = [1, 32], $Vc = [1, 33], $Vd = [1, 34], $Ve = [1, 62], $Vf = [1, 48], $Vg = [1, 52], $Vh = [1, 36], $Vi = [1, 37], $Vj = [1, 38], $Vk = [1, 39], $Vl = [1, 40], $Vm = [1, 56], $Vn = [1, 63], $Vo = [1, 51], $Vp = [1, 53], $Vq = [1, 55], $Vr = [1, 59], $Vs = [1, 60], $Vt = [1, 41], $Vu = [1, 42], $Vv = [1, 43], $Vw = [1, 44], $Vx = [1, 61], $Vy = [1, 50], $Vz = [1, 54], $VA = [1, 57], $VB = [1, 58], $VC = [1, 49], $VD = [1, 66], $VE = [1, 71], $VF = [1, 20, 21, 22, 23, 38, 42, 44, 46, 48, 52, 66, 67, 86, 87, 88, 89, 90, 91, 95, 105, 106, 109, 111, 112, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], $VG = [1, 75], $VH = [1, 74], $VI = [1, 76], $VJ = [20, 21, 23, 81, 82], $VK = [1, 99], $VL = [1, 104], $VM = [1, 107], $VN = [1, 108], $VO = [1, 101], $VP = [1, 106], $VQ = [1, 109], $VR = [1, 102], $VS = [1, 114], $VT = [1, 113], $VU = [1, 103], $VV = [1, 105], $VW = [1, 110], $VX = [1, 111], $VY = [1, 112], $VZ = [1, 115], $V_ = [20, 21, 22, 23, 81, 82], $V$ = [20, 21, 22, 23, 53, 81, 82], $V01 = [20, 21, 22, 23, 40, 52, 53, 55, 57, 59, 61, 63, 65, 66, 67, 69, 71, 73, 74, 76, 81, 82, 91, 95, 105, 106, 109, 111, 112, 122, 123, 124, 125, 126, 127], $V11 = [20, 21, 23], $V21 = [20, 21, 23, 52, 66, 67, 81, 82, 91, 95, 105, 106, 109, 111, 112, 122, 123, 124, 125, 126, 127], $V31 = [1, 12, 20, 21, 22, 23, 24, 38, 42, 44, 46, 48, 52, 66, 67, 86, 87, 88, 89, 90, 91, 95, 105, 106, 109, 111, 112, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], $V41 = [52, 66, 67, 91, 95, 105, 106, 109, 111, 112, 122, 123, 124, 125, 126, 127], $V51 = [1, 149], $V61 = [1, 157], $V71 = [1, 158], $V81 = [1, 159], $V91 = [1, 160], $Va1 = [1, 144], $Vb1 = [1, 145], $Vc1 = [1, 141], $Vd1 = [1, 152], $Ve1 = [1, 153], $Vf1 = [1, 154], $Vg1 = [1, 155], $Vh1 = [1, 156], $Vi1 = [1, 161], $Vj1 = [1, 162], $Vk1 = [1, 147], $Vl1 = [1, 150], $Vm1 = [1, 146], $Vn1 = [1, 143], $Vo1 = [20, 21, 22, 23, 38, 42, 44, 46, 48, 52, 66, 67, 86, 87, 88, 89, 90, 91, 95, 105, 106, 109, 111, 112, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], $Vp1 = [1, 165], $Vq1 = [20, 21, 22, 23, 26, 52, 66, 67, 91, 105, 106, 109, 111, 112, 122, 123, 124, 125, 126, 127], $Vr1 = [20, 21, 22, 23, 24, 26, 38, 40, 41, 42, 52, 56, 58, 60, 62, 64, 66, 67, 68, 70, 72, 73, 75, 77, 81, 82, 86, 87, 88, 89, 90, 91, 92, 95, 105, 106, 109, 111, 112, 113, 114, 122, 123, 124, 125, 126, 127], $Vs1 = [12, 21, 22, 24], $Vt1 = [22, 106], $Vu1 = [1, 250], $Vv1 = [1, 245], $Vw1 = [1, 246], $Vx1 = [1, 254], $Vy1 = [1, 251], $Vz1 = [1, 248], $VA1 = [1, 247], $VB1 = [1, 249], $VC1 = [1, 252], $VD1 = [1, 253], $VE1 = [1, 255], $VF1 = [1, 273], $VG1 = [20, 21, 23, 106], $VH1 = [20, 21, 22, 23, 66, 67, 86, 102, 105, 106, 109, 110, 111, 112, 113]; var parser2 = { trace: function trace() { }, yy: {}, symbols_: { "error": 2, "start": 3, "mermaidDoc": 4, "directive": 5, "openDirective": 6, "typeDirective": 7, "closeDirective": 8, "separator": 9, ":": 10, "argDirective": 11, "open_directive": 12, "type_directive": 13, "arg_directive": 14, "close_directive": 15, "graphConfig": 16, "document": 17, "line": 18, "statement": 19, "SEMI": 20, "NEWLINE": 21, "SPACE": 22, "EOF": 23, "GRAPH": 24, "NODIR": 25, "DIR": 26, "FirstStmtSeperator": 27, "ending": 28, "endToken": 29, "spaceList": 30, "spaceListNewline": 31, "verticeStatement": 32, "styleStatement": 33, "linkStyleStatement": 34, "classDefStatement": 35, "classStatement": 36, "clickStatement": 37, "subgraph": 38, "text": 39, "SQS": 40, "SQE": 41, "end": 42, "direction": 43, "acc_title": 44, "acc_title_value": 45, "acc_descr": 46, "acc_descr_value": 47, "acc_descr_multiline_value": 48, "link": 49, "node": 50, "vertex": 51, "AMP": 52, "STYLE_SEPARATOR": 53, "idString": 54, "DOUBLECIRCLESTART": 55, "DOUBLECIRCLEEND": 56, "PS": 57, "PE": 58, "(-": 59, "-)": 60, "STADIUMSTART": 61, "STADIUMEND": 62, "SUBROUTINESTART": 63, "SUBROUTINEEND": 64, "VERTEX_WITH_PROPS_START": 65, "ALPHA": 66, "COLON": 67, "PIPE": 68, "CYLINDERSTART": 69, "CYLINDEREND": 70, "DIAMOND_START": 71, "DIAMOND_STOP": 72, "TAGEND": 73, "TRAPSTART": 74, "TRAPEND": 75, "INVTRAPSTART": 76, "INVTRAPEND": 77, "linkStatement": 78, "arrowText": 79, "TESTSTR": 80, "START_LINK": 81, "LINK": 82, "textToken": 83, "STR": 84, "keywords": 85, "STYLE": 86, "LINKSTYLE": 87, "CLASSDEF": 88, "CLASS": 89, "CLICK": 90, "DOWN": 91, "UP": 92, "textNoTags": 93, "textNoTagsToken": 94, "DEFAULT": 95, "stylesOpt": 96, "alphaNum": 97, "CALLBACKNAME": 98, "CALLBACKARGS": 99, "HREF": 100, "LINK_TARGET": 101, "HEX": 102, "numList": 103, "INTERPOLATE": 104, "NUM": 105, "COMMA": 106, "style": 107, "styleComponent": 108, "MINUS": 109, "UNIT": 110, "BRKT": 111, "DOT": 112, "PCT": 113, "TAGSTART": 114, "alphaNumToken": 115, "idStringToken": 116, "alphaNumStatement": 117, "direction_tb": 118, "direction_bt": 119, "direction_rl": 120, "direction_lr": 121, "PUNCTUATION": 122, "UNICODE_TEXT": 123, "PLUS": 124, "EQUALS": 125, "MULT": 126, "UNDERSCORE": 127, "graphCodeTokens": 128, "ARROW_CROSS": 129, "ARROW_POINT": 130, "ARROW_CIRCLE": 131, "ARROW_OPEN": 132, "QUOTE": 133, "$accept": 0, "$end": 1 }, terminals_: { 2: "error", 10: ":", 12: "open_directive", 13: "type_directive", 14: "arg_directive", 15: "close_directive", 20: "SEMI", 21: "NEWLINE", 22: "SPACE", 23: "EOF", 24: "GRAPH", 25: "NODIR", 26: "DIR", 38: "subgraph", 40: "SQS", 41: "SQE", 42: "end", 44: "acc_title", 45: "acc_title_value", 46: "acc_descr", 47: "acc_descr_value", 48: "acc_descr_multiline_value", 52: "AMP", 53: "STYLE_SEPARATOR", 55: "DOUBLECIRCLESTART", 56: "DOUBLECIRCLEEND", 57: "PS", 58: "PE", 59: "(-", 60: "-)", 61: "STADIUMSTART", 62: "STADIUMEND", 63: "SUBROUTINESTART", 64: "SUBROUTINEEND", 65: "VERTEX_WITH_PROPS_START", 66: "ALPHA", 67: "COLON", 68: "PIPE", 69: "CYLINDERSTART", 70: "CYLINDEREND", 71: "DIAMOND_START", 72: "DIAMOND_STOP", 73: "TAGEND", 74: "TRAPSTART", 75: "TRAPEND", 76: "INVTRAPSTART", 77: "INVTRAPEND", 80: "TESTSTR", 81: "START_LINK", 82: "LINK", 84: "STR", 86: "STYLE", 87: "LINKSTYLE", 88: "CLASSDEF", 89: "CLASS", 90: "CLICK", 91: "DOWN", 92: "UP", 95: "DEFAULT", 98: "CALLBACKNAME", 99: "CALLBACKARGS", 100: "HREF", 101: "LINK_TARGET", 102: "HEX", 104: "INTERPOLATE", 105: "NUM", 106: "COMMA", 109: "MINUS", 110: "UNIT", 111: "BRKT", 112: "DOT", 113: "PCT", 114: "TAGSTART", 118: "direction_tb", 119: "direction_bt", 120: "direction_rl", 121: "direction_lr", 122: "PUNCTUATION", 123: "UNICODE_TEXT", 124: "PLUS", 125: "EQUALS", 126: "MULT", 127: "UNDERSCORE", 129: "ARROW_CROSS", 130: "ARROW_POINT", 131: "ARROW_CIRCLE", 132: "ARROW_OPEN", 133: "QUOTE" }, productions_: [0, [3, 1], [3, 2], [5, 4], [5, 6], [6, 1], [7, 1], [11, 1], [8, 1], [4, 2], [17, 0], [17, 2], [18, 1], [18, 1], [18, 1], [18, 1], [18, 1], [16, 2], [16, 2], [16, 2], [16, 3], [28, 2], [28, 1], [29, 1], [29, 1], [29, 1], [27, 1], [27, 1], [27, 2], [31, 2], [31, 2], [31, 1], [31, 1], [30, 2], [30, 1], [19, 2], [19, 2], [19, 2], [19, 2], [19, 2], [19, 2], [19, 9], [19, 6], [19, 4], [19, 1], [19, 2], [19, 2], [19, 1], [9, 1], [9, 1], [9, 1], [32, 3], [32, 4], [32, 2], [32, 1], [50, 1], [50, 5], [50, 3], [51, 4], [51, 4], [51, 6], [51, 4], [51, 4], [51, 4], [51, 8], [51, 4], [51, 4], [51, 4], [51, 6], [51, 4], [51, 4], [51, 4], [51, 4], [51, 4], [51, 1], [49, 2], [49, 3], [49, 3], [49, 1], [49, 3], [78, 1], [79, 3], [39, 1], [39, 2], [39, 1], [85, 1], [85, 1], [85, 1], [85, 1], [85, 1], [85, 1], [85, 1], [85, 1], [85, 1], [85, 1], [85, 1], [93, 1], [93, 2], [35, 5], [35, 5], [36, 5], [37, 2], [37, 4], [37, 3], [37, 5], [37, 2], [37, 4], [37, 4], [37, 6], [37, 2], [37, 4], [37, 2], [37, 4], [37, 4], [37, 6], [33, 5], [33, 5], [34, 5], [34, 5], [34, 9], [34, 9], [34, 7], [34, 7], [103, 1], [103, 3], [96, 1], [96, 3], [107, 1], [107, 2], [108, 1], [108, 1], [108, 1], [108, 1], [108, 1], [108, 1], [108, 1], [108, 1], [108, 1], [108, 1], [108, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [94, 1], [94, 1], [94, 1], [94, 1], [54, 1], [54, 2], [97, 1], [97, 2], [117, 1], [117, 1], [117, 1], [117, 1], [43, 1], [43, 1], [43, 1], [43, 1], [115, 1], [115, 1], [115, 1], [115, 1], [115, 1], [115, 1], [115, 1], [115, 1], [115, 1], [115, 1], [115, 1], [115, 1], [115, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1], [128, 1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { var $0 = $$.length - 1; switch (yystate) { case 5: yy.parseDirective("%%{", "open_directive"); break; case 6: yy.parseDirective($$[$0], "type_directive"); break; case 7: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], "arg_directive"); break; case 8: yy.parseDirective("}%%", "close_directive", "flowchart"); break; case 10: this.$ = []; break; case 11: if (!Array.isArray($$[$0]) || $$[$0].length > 0) { $$[$0 - 1].push($$[$0]); } this.$ = $$[$0 - 1]; break; case 12: case 82: case 84: case 96: case 152: case 154: case 155: this.$ = $$[$0]; break; case 19: yy.setDirection("TB"); this.$ = "TB"; break; case 20: yy.setDirection($$[$0 - 1]); this.$ = $$[$0 - 1]; break; case 35: this.$ = $$[$0 - 1].nodes; break; case 36: case 37: case 38: case 39: case 40: this.$ = []; break; case 41: this.$ = yy.addSubGraph($$[$0 - 6], $$[$0 - 1], $$[$0 - 4]); break; case 42: this.$ = yy.addSubGraph($$[$0 - 3], $$[$0 - 1], $$[$0 - 3]); break; case 43: this.$ = yy.addSubGraph(void 0, $$[$0 - 1], void 0); break; case 45: this.$ = $$[$0].trim(); yy.setAccTitle(this.$); break; case 46: case 47: this.$ = $$[$0].trim(); yy.setAccDescription(this.$); break; case 51: yy.addLink($$[$0 - 2].stmt, $$[$0], $$[$0 - 1]); this.$ = { stmt: $$[$0], nodes: $$[$0].concat($$[$0 - 2].nodes) }; break; case 52: yy.addLink($$[$0 - 3].stmt, $$[$0 - 1], $$[$0 - 2]); this.$ = { stmt: $$[$0 - 1], nodes: $$[$0 - 1].concat($$[$0 - 3].nodes) }; break; case 53: this.$ = { stmt: $$[$0 - 1], nodes: $$[$0 - 1] }; break; case 54: this.$ = { stmt: $$[$0], nodes: $$[$0] }; break; case 55: this.$ = [$$[$0]]; break; case 56: this.$ = $$[$0 - 4].concat($$[$0]); break; case 57: this.$ = [$$[$0 - 2]]; yy.setClass($$[$0 - 2], $$[$0]); break; case 58: this.$ = $$[$0 - 3]; yy.addVertex($$[$0 - 3], $$[$0 - 1], "square"); break; case 59: this.$ = $$[$0 - 3]; yy.addVertex($$[$0 - 3], $$[$0 - 1], "doublecircle"); break; case 60: this.$ = $$[$0 - 5]; yy.addVertex($$[$0 - 5], $$[$0 - 2], "circle"); break; case 61: this.$ = $$[$0 - 3]; yy.addVertex($$[$0 - 3], $$[$0 - 1], "ellipse"); break; case 62: this.$ = $$[$0 - 3]; yy.addVertex($$[$0 - 3], $$[$0 - 1], "stadium"); break; case 63: this.$ = $$[$0 - 3]; yy.addVertex($$[$0 - 3], $$[$0 - 1], "subroutine"); break; case 64: this.$ = $$[$0 - 7]; yy.addVertex($$[$0 - 7], $$[$0 - 1], "rect", void 0, void 0, void 0, Object.fromEntries([[$$[$0 - 5], $$[$0 - 3]]])); break; case 65: this.$ = $$[$0 - 3]; yy.addVertex($$[$0 - 3], $$[$0 - 1], "cylinder"); break; case 66: this.$ = $$[$0 - 3]; yy.addVertex($$[$0 - 3], $$[$0 - 1], "round"); break; case 67: this.$ = $$[$0 - 3]; yy.addVertex($$[$0 - 3], $$[$0 - 1], "diamond"); break; case 68: this.$ = $$[$0 - 5]; yy.addVertex($$[$0 - 5], $$[$0 - 2], "hexagon"); break; case 69: this.$ = $$[$0 - 3]; yy.addVertex($$[$0 - 3], $$[$0 - 1], "odd"); break; case 70: this.$ = $$[$0 - 3]; yy.addVertex($$[$0 - 3], $$[$0 - 1], "trapezoid"); break; case 71: this.$ = $$[$0 - 3]; yy.addVertex($$[$0 - 3], $$[$0 - 1], "inv_trapezoid"); break; case 72: this.$ = $$[$0 - 3]; yy.addVertex($$[$0 - 3], $$[$0 - 1], "lean_right"); break; case 73: this.$ = $$[$0 - 3]; yy.addVertex($$[$0 - 3], $$[$0 - 1], "lean_left"); break; case 74: this.$ = $$[$0]; yy.addVertex($$[$0]); break; case 75: $$[$0 - 1].text = $$[$0]; this.$ = $$[$0 - 1]; break; case 76: case 77: $$[$0 - 2].text = $$[$0 - 1]; this.$ = $$[$0 - 2]; break; case 78: this.$ = $$[$0]; break; case 79: var inf = yy.destructLink($$[$0], $$[$0 - 2]); this.$ = { "type": inf.type, "stroke": inf.stroke, "length": inf.length, "text": $$[$0 - 1] }; break; case 80: var inf = yy.destructLink($$[$0]); this.$ = { "type": inf.type, "stroke": inf.stroke, "length": inf.length }; break; case 81: this.$ = $$[$0 - 1]; break; case 83: case 97: case 153: this.$ = $$[$0 - 1] + "" + $$[$0]; break; case 98: case 99: this.$ = $$[$0 - 4]; yy.addClass($$[$0 - 2], $$[$0]); break; case 100: this.$ = $$[$0 - 4]; yy.setClass($$[$0 - 2], $$[$0]); break; case 101: case 109: this.$ = $$[$0 - 1]; yy.setClickEvent($$[$0 - 1], $$[$0]); break; case 102: case 110: this.$ = $$[$0 - 3]; yy.setClickEvent($$[$0 - 3], $$[$0 - 2]); yy.setTooltip($$[$0 - 3], $$[$0]); break; case 103: this.$ = $$[$0 - 2]; yy.setClickEvent($$[$0 - 2], $$[$0 - 1], $$[$0]); break; case 104: this.$ = $$[$0 - 4]; yy.setClickEvent($$[$0 - 4], $$[$0 - 3], $$[$0 - 2]); yy.setTooltip($$[$0 - 4], $$[$0]); break; case 105: case 111: this.$ = $$[$0 - 1]; yy.setLink($$[$0 - 1], $$[$0]); break; case 106: case 112: this.$ = $$[$0 - 3]; yy.setLink($$[$0 - 3], $$[$0 - 2]); yy.setTooltip($$[$0 - 3], $$[$0]); break; case 107: case 113: this.$ = $$[$0 - 3]; yy.setLink($$[$0 - 3], $$[$0 - 2], $$[$0]); break; case 108: case 114: this.$ = $$[$0 - 5]; yy.setLink($$[$0 - 5], $$[$0 - 4], $$[$0]); yy.setTooltip($$[$0 - 5], $$[$0 - 2]); break; case 115: this.$ = $$[$0 - 4]; yy.addVertex($$[$0 - 2], void 0, void 0, $$[$0]); break; case 116: case 118: this.$ = $$[$0 - 4]; yy.updateLink($$[$0 - 2], $$[$0]); break; case 117: this.$ = $$[$0 - 4]; yy.updateLink([$$[$0 - 2]], $$[$0]); break; case 119: this.$ = $$[$0 - 8]; yy.updateLinkInterpolate([$$[$0 - 6]], $$[$0 - 2]); yy.updateLink([$$[$0 - 6]], $$[$0]); break; case 120: this.$ = $$[$0 - 8]; yy.updateLinkInterpolate($$[$0 - 6], $$[$0 - 2]); yy.updateLink($$[$0 - 6], $$[$0]); break; case 121: this.$ = $$[$0 - 6]; yy.updateLinkInterpolate([$$[$0 - 4]], $$[$0]); break; case 122: this.$ = $$[$0 - 6]; yy.updateLinkInterpolate($$[$0 - 4], $$[$0]); break; case 123: case 125: this.$ = [$$[$0]]; break; case 124: case 126: $$[$0 - 2].push($$[$0]); this.$ = $$[$0 - 2]; break; case 128: this.$ = $$[$0 - 1] + $$[$0]; break; case 150: this.$ = $$[$0]; break; case 151: this.$ = $$[$0 - 1] + "" + $$[$0]; break; case 156: this.$ = "v"; break; case 157: this.$ = "-"; break; case 158: this.$ = { stmt: "dir", value: "TB" }; break; case 159: this.$ = { stmt: "dir", value: "BT" }; break; case 160: this.$ = { stmt: "dir", value: "RL" }; break; case 161: this.$ = { stmt: "dir", value: "LR" }; break; } }, table: [{ 3: 1, 4: 2, 5: 3, 6: 5, 12: $V0, 16: 4, 21: $V1, 22: $V2, 24: $V3 }, { 1: [3] }, { 1: [2, 1] }, { 3: 10, 4: 2, 5: 3, 6: 5, 12: $V0, 16: 4, 21: $V1, 22: $V2, 24: $V3 }, o($V4, $V5, { 17: 11 }), { 7: 12, 13: [1, 13] }, { 16: 14, 21: $V1, 22: $V2, 24: $V3 }, { 16: 15, 21: $V1, 22: $V2, 24: $V3 }, { 25: [1, 16], 26: [1, 17] }, { 13: [2, 5] }, { 1: [2, 2] }, { 1: [2, 9], 18: 18, 19: 19, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 32: 24, 33: 25, 34: 26, 35: 27, 36: 28, 37: 29, 38: $Va, 43: 31, 44: $Vb, 46: $Vc, 48: $Vd, 50: 35, 51: 45, 52: $Ve, 54: 46, 66: $Vf, 67: $Vg, 86: $Vh, 87: $Vi, 88: $Vj, 89: $Vk, 90: $Vl, 91: $Vm, 95: $Vn, 105: $Vo, 106: $Vp, 109: $Vq, 111: $Vr, 112: $Vs, 116: 47, 118: $Vt, 119: $Vu, 120: $Vv, 121: $Vw, 122: $Vx, 123: $Vy, 124: $Vz, 125: $VA, 126: $VB, 127: $VC }, { 8: 64, 10: [1, 65], 15: $VD }, o([10, 15], [2, 6]), o($V4, [2, 17]), o($V4, [2, 18]), o($V4, [2, 19]), { 20: [1, 68], 21: [1, 69], 22: $VE, 27: 67, 30: 70 }, o($VF, [2, 11]), o($VF, [2, 12]), o($VF, [2, 13]), o($VF, [2, 14]), o($VF, [2, 15]), o($VF, [2, 16]), { 9: 72, 20: $VG, 21: $VH, 23: $VI, 49: 73, 78: 77, 81: [1, 78], 82: [1, 79] }, { 9: 80, 20: $VG, 21: $VH, 23: $VI }, { 9: 81, 20: $VG, 21: $VH, 23: $VI }, { 9: 82, 20: $VG, 21: $VH, 23: $VI }, { 9: 83, 20: $VG, 21: $VH, 23: $VI }, { 9: 84, 20: $VG, 21: $VH, 23: $VI }, { 9: 86, 20: $VG, 21: $VH, 22: [1, 85], 23: $VI }, o($VF, [2, 44]), { 45: [1, 87] }, { 47: [1, 88] }, o($VF, [2, 47]), o($VJ, [2, 54], { 30: 89, 22: $VE }), { 22: [1, 90] }, { 22: [1, 91] }, { 22: [1, 92] }, { 22: [1, 93] }, { 26: $VK, 52: $VL, 66: $VM, 67: $VN, 84: [1, 97], 91: $VO, 97: 96, 98: [1, 94], 100: [1, 95], 105: $VP, 106: $VQ, 109: $VR, 111: $VS, 112: $VT, 115: 100, 117: 98, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, o($VF, [2, 158]), o($VF, [2, 159]), o($VF, [2, 160]), o($VF, [2, 161]), o($V_, [2, 55], { 53: [1, 116] }), o($V$, [2, 74], { 116: 129, 40: [1, 117], 52: $Ve, 55: [1, 118], 57: [1, 119], 59: [1, 120], 61: [1, 121], 63: [1, 122], 65: [1, 123], 66: $Vf, 67: $Vg, 69: [1, 124], 71: [1, 125], 73: [1, 126], 74: [1, 127], 76: [1, 128], 91: $Vm, 95: $Vn, 105: $Vo, 106: $Vp, 109: $Vq, 111: $Vr, 112: $Vs, 122: $Vx, 123: $Vy, 124: $Vz, 125: $VA, 126: $VB, 127: $VC }), o($V01, [2, 150]), o($V01, [2, 175]), o($V01, [2, 176]), o($V01, [2, 177]), o($V01, [2, 178]), o($V01, [2, 179]), o($V01, [2, 180]), o($V01, [2, 181]), o($V01, [2, 182]), o($V01, [2, 183]), o($V01, [2, 184]), o($V01, [2, 185]), o($V01, [2, 186]), o($V01, [2, 187]), o($V01, [2, 188]), o($V01, [2, 189]), o($V01, [2, 190]), { 9: 130, 20: $VG, 21: $VH, 23: $VI }, { 11: 131, 14: [1, 132] }, o($V11, [2, 8]), o($V4, [2, 20]), o($V4, [2, 26]), o($V4, [2, 27]), { 21: [1, 133] }, o($V21, [2, 34], { 30: 134, 22: $VE }), o($VF, [2, 35]), { 50: 135, 51: 45, 52: $Ve, 54: 46, 66: $Vf, 67: $Vg, 91: $Vm, 95: $Vn, 105: $Vo, 106: $Vp, 109: $Vq, 111: $Vr, 112: $Vs, 116: 47, 122: $Vx, 123: $Vy, 124: $Vz, 125: $VA, 126: $VB, 127: $VC }, o($V31, [2, 48]), o($V31, [2, 49]), o($V31, [2, 50]), o($V41, [2, 78], { 79: 136, 68: [1, 138], 80: [1, 137] }), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 139, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, o([52, 66, 67, 68, 80, 91, 95, 105, 106, 109, 111, 112, 122, 123, 124, 125, 126, 127], [2, 80]), o($VF, [2, 36]), o($VF, [2, 37]), o($VF, [2, 38]), o($VF, [2, 39]), o($VF, [2, 40]), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 163, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, o($Vo1, $V5, { 17: 164 }), o($VF, [2, 45]), o($VF, [2, 46]), o($VJ, [2, 53], { 52: $Vp1 }), { 26: $VK, 52: $VL, 66: $VM, 67: $VN, 91: $VO, 97: 166, 102: [1, 167], 105: $VP, 106: $VQ, 109: $VR, 111: $VS, 112: $VT, 115: 100, 117: 98, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 95: [1, 168], 103: 169, 105: [1, 170] }, { 26: $VK, 52: $VL, 66: $VM, 67: $VN, 91: $VO, 95: [1, 171], 97: 172, 105: $VP, 106: $VQ, 109: $VR, 111: $VS, 112: $VT, 115: 100, 117: 98, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 26: $VK, 52: $VL, 66: $VM, 67: $VN, 91: $VO, 97: 173, 105: $VP, 106: $VQ, 109: $VR, 111: $VS, 112: $VT, 115: 100, 117: 98, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, o($V11, [2, 101], { 22: [1, 174], 99: [1, 175] }), o($V11, [2, 105], { 22: [1, 176] }), o($V11, [2, 109], { 115: 100, 117: 178, 22: [1, 177], 26: $VK, 52: $VL, 66: $VM, 67: $VN, 91: $VO, 105: $VP, 106: $VQ, 109: $VR, 111: $VS, 112: $VT, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }), o($V11, [2, 111], { 22: [1, 179] }), o($Vq1, [2, 152]), o($Vq1, [2, 154]), o($Vq1, [2, 155]), o($Vq1, [2, 156]), o($Vq1, [2, 157]), o($Vr1, [2, 162]), o($Vr1, [2, 163]), o($Vr1, [2, 164]), o($Vr1, [2, 165]), o($Vr1, [2, 166]), o($Vr1, [2, 167]), o($Vr1, [2, 168]), o($Vr1, [2, 169]), o($Vr1, [2, 170]), o($Vr1, [2, 171]), o($Vr1, [2, 172]), o($Vr1, [2, 173]), o($Vr1, [2, 174]), { 52: $Ve, 54: 180, 66: $Vf, 67: $Vg, 91: $Vm, 95: $Vn, 105: $Vo, 106: $Vp, 109: $Vq, 111: $Vr, 112: $Vs, 116: 47, 122: $Vx, 123: $Vy, 124: $Vz, 125: $VA, 126: $VB, 127: $VC }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 181, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 182, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 184, 42: $V91, 52: $VL, 57: [1, 183], 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 185, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 186, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 187, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 66: [1, 188] }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 189, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 190, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 71: [1, 191], 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 192, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 193, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 194, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, o($V01, [2, 151]), o($Vs1, [2, 3]), { 8: 195, 15: $VD }, { 15: [2, 7] }, o($V4, [2, 28]), o($V21, [2, 33]), o($VJ, [2, 51], { 30: 196, 22: $VE }), o($V41, [2, 75], { 22: [1, 197] }), { 22: [1, 198] }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 199, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 82: [1, 200], 83: 201, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, o($Vr1, [2, 82]), o($Vr1, [2, 84]), o($Vr1, [2, 140]), o($Vr1, [2, 141]), o($Vr1, [2, 142]), o($Vr1, [2, 143]), o($Vr1, [2, 144]), o($Vr1, [2, 145]), o($Vr1, [2, 146]), o($Vr1, [2, 147]), o($Vr1, [2, 148]), o($Vr1, [2, 149]), o($Vr1, [2, 85]), o($Vr1, [2, 86]), o($Vr1, [2, 87]), o($Vr1, [2, 88]), o($Vr1, [2, 89]), o($Vr1, [2, 90]), o($Vr1, [2, 91]), o($Vr1, [2, 92]), o($Vr1, [2, 93]), o($Vr1, [2, 94]), o($Vr1, [2, 95]), { 9: 203, 20: $VG, 21: $VH, 22: $V51, 23: $VI, 24: $V61, 26: $V71, 38: $V81, 40: [1, 202], 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 201, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 18: 18, 19: 19, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 32: 24, 33: 25, 34: 26, 35: 27, 36: 28, 37: 29, 38: $Va, 42: [1, 204], 43: 31, 44: $Vb, 46: $Vc, 48: $Vd, 50: 35, 51: 45, 52: $Ve, 54: 46, 66: $Vf, 67: $Vg, 86: $Vh, 87: $Vi, 88: $Vj, 89: $Vk, 90: $Vl, 91: $Vm, 95: $Vn, 105: $Vo, 106: $Vp, 109: $Vq, 111: $Vr, 112: $Vs, 116: 47, 118: $Vt, 119: $Vu, 120: $Vv, 121: $Vw, 122: $Vx, 123: $Vy, 124: $Vz, 125: $VA, 126: $VB, 127: $VC }, { 22: $VE, 30: 205 }, { 22: [1, 206], 26: $VK, 52: $VL, 66: $VM, 67: $VN, 91: $VO, 105: $VP, 106: $VQ, 109: $VR, 111: $VS, 112: $VT, 115: 100, 117: 178, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: [1, 207] }, { 22: [1, 208] }, { 22: [1, 209], 106: [1, 210] }, o($Vt1, [2, 123]), { 22: [1, 211] }, { 22: [1, 212], 26: $VK, 52: $VL, 66: $VM, 67: $VN, 91: $VO, 105: $VP, 106: $VQ, 109: $VR, 111: $VS, 112: $VT, 115: 100, 117: 178, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: [1, 213], 26: $VK, 52: $VL, 66: $VM, 67: $VN, 91: $VO, 105: $VP, 106: $VQ, 109: $VR, 111: $VS, 112: $VT, 115: 100, 117: 178, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 84: [1, 214] }, o($V11, [2, 103], { 22: [1, 215] }), { 84: [1, 216], 101: [1, 217] }, { 84: [1, 218] }, o($Vq1, [2, 153]), { 84: [1, 219], 101: [1, 220] }, o($V_, [2, 57], { 116: 129, 52: $Ve, 66: $Vf, 67: $Vg, 91: $Vm, 95: $Vn, 105: $Vo, 106: $Vp, 109: $Vq, 111: $Vr, 112: $Vs, 122: $Vx, 123: $Vy, 124: $Vz, 125: $VA, 126: $VB, 127: $VC }), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 41: [1, 221], 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 201, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 56: [1, 222], 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 201, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 223, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 58: [1, 224], 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 201, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 60: [1, 225], 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 201, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 62: [1, 226], 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 201, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 64: [1, 227], 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 201, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 67: [1, 228] }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 70: [1, 229], 73: $Va1, 81: $Vb1, 83: 201, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 72: [1, 230], 73: $Va1, 81: $Vb1, 83: 201, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 231, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 41: [1, 232], 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 201, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 75: [1, 233], 77: [1, 234], 81: $Vb1, 83: 201, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 75: [1, 236], 77: [1, 235], 81: $Vb1, 83: 201, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 9: 237, 20: $VG, 21: $VH, 23: $VI }, o($VJ, [2, 52], { 52: $Vp1 }), o($V41, [2, 77]), o($V41, [2, 76]), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 68: [1, 238], 73: $Va1, 81: $Vb1, 83: 201, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, o($V41, [2, 79]), o($Vr1, [2, 83]), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 239, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, o($Vo1, $V5, { 17: 240 }), o($VF, [2, 43]), { 51: 241, 52: $Ve, 54: 46, 66: $Vf, 67: $Vg, 91: $Vm, 95: $Vn, 105: $Vo, 106: $Vp, 109: $Vq, 111: $Vr, 112: $Vs, 116: 47, 122: $Vx, 123: $Vy, 124: $Vz, 125: $VA, 126: $VB, 127: $VC }, { 22: $Vu1, 66: $Vv1, 67: $Vw1, 86: $Vx1, 96: 242, 102: $Vy1, 105: $Vz1, 107: 243, 108: 244, 109: $VA1, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1 }, { 22: $Vu1, 66: $Vv1, 67: $Vw1, 86: $Vx1, 96: 256, 102: $Vy1, 105: $Vz1, 107: 243, 108: 244, 109: $VA1, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1 }, { 22: $Vu1, 66: $Vv1, 67: $Vw1, 86: $Vx1, 96: 257, 102: $Vy1, 104: [1, 258], 105: $Vz1, 107: 243, 108: 244, 109: $VA1, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1 }, { 22: $Vu1, 66: $Vv1, 67: $Vw1, 86: $Vx1, 96: 259, 102: $Vy1, 104: [1, 260], 105: $Vz1, 107: 243, 108: 244, 109: $VA1, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1 }, { 105: [1, 261] }, { 22: $Vu1, 66: $Vv1, 67: $Vw1, 86: $Vx1, 96: 262, 102: $Vy1, 105: $Vz1, 107: 243, 108: 244, 109: $VA1, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1 }, { 22: $Vu1, 66: $Vv1, 67: $Vw1, 86: $Vx1, 96: 263, 102: $Vy1, 105: $Vz1, 107: 243, 108: 244, 109: $VA1, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1 }, { 26: $VK, 52: $VL, 66: $VM, 67: $VN, 91: $VO, 97: 264, 105: $VP, 106: $VQ, 109: $VR, 111: $VS, 112: $VT, 115: 100, 117: 98, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, o($V11, [2, 102]), { 84: [1, 265] }, o($V11, [2, 106], { 22: [1, 266] }), o($V11, [2, 107]), o($V11, [2, 110]), o($V11, [2, 112], { 22: [1, 267] }), o($V11, [2, 113]), o($V$, [2, 58]), o($V$, [2, 59]), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 58: [1, 268], 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 201, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, o($V$, [2, 66]), o($V$, [2, 61]), o($V$, [2, 62]), o($V$, [2, 63]), { 66: [1, 269] }, o($V$, [2, 65]), o($V$, [2, 67]), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 72: [1, 270], 73: $Va1, 81: $Vb1, 83: 201, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, o($V$, [2, 69]), o($V$, [2, 70]), o($V$, [2, 72]), o($V$, [2, 71]), o($V$, [2, 73]), o($Vs1, [2, 4]), o([22, 52, 66, 67, 91, 95, 105, 106, 109, 111, 112, 122, 123, 124, 125, 126, 127], [2, 81]), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 41: [1, 271], 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 201, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 18: 18, 19: 19, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 32: 24, 33: 25, 34: 26, 35: 27, 36: 28, 37: 29, 38: $Va, 42: [1, 272], 43: 31, 44: $Vb, 46: $Vc, 48: $Vd, 50: 35, 51: 45, 52: $Ve, 54: 46, 66: $Vf, 67: $Vg, 86: $Vh, 87: $Vi, 88: $Vj, 89: $Vk, 90: $Vl, 91: $Vm, 95: $Vn, 105: $Vo, 106: $Vp, 109: $Vq, 111: $Vr, 112: $Vs, 116: 47, 118: $Vt, 119: $Vu, 120: $Vv, 121: $Vw, 122: $Vx, 123: $Vy, 124: $Vz, 125: $VA, 126: $VB, 127: $VC }, o($V_, [2, 56]), o($V11, [2, 115], { 106: $VF1 }), o($VG1, [2, 125], { 108: 274, 22: $Vu1, 66: $Vv1, 67: $Vw1, 86: $Vx1, 102: $Vy1, 105: $Vz1, 109: $VA1, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1 }), o($VH1, [2, 127]), o($VH1, [2, 129]), o($VH1, [2, 130]), o($VH1, [2, 131]), o($VH1, [2, 132]), o($VH1, [2, 133]), o($VH1, [2, 134]), o($VH1, [2, 135]), o($VH1, [2, 136]), o($VH1, [2, 137]), o($VH1, [2, 138]), o($VH1, [2, 139]), o($V11, [2, 116], { 106: $VF1 }), o($V11, [2, 117], { 106: $VF1 }), { 22: [1, 275] }, o($V11, [2, 118], { 106: $VF1 }), { 22: [1, 276] }, o($Vt1, [2, 124]), o($V11, [2, 98], { 106: $VF1 }), o($V11, [2, 99], { 106: $VF1 }), o($V11, [2, 100], { 115: 100, 117: 178, 26: $VK, 52: $VL, 66: $VM, 67: $VN, 91: $VO, 105: $VP, 106: $VQ, 109: $VR, 111: $VS, 112: $VT, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }), o($V11, [2, 104]), { 101: [1, 277] }, { 101: [1, 278] }, { 58: [1, 279] }, { 68: [1, 280] }, { 72: [1, 281] }, { 9: 282, 20: $VG, 21: $VH, 23: $VI }, o($VF, [2, 42]), { 22: $Vu1, 66: $Vv1, 67: $Vw1, 86: $Vx1, 102: $Vy1, 105: $Vz1, 107: 283, 108: 244, 109: $VA1, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1 }, o($VH1, [2, 128]), { 26: $VK, 52: $VL, 66: $VM, 67: $VN, 91: $VO, 97: 284, 105: $VP, 106: $VQ, 109: $VR, 111: $VS, 112: $VT, 115: 100, 117: 98, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 26: $VK, 52: $VL, 66: $VM, 67: $VN, 91: $VO, 97: 285, 105: $VP, 106: $VQ, 109: $VR, 111: $VS, 112: $VT, 115: 100, 117: 98, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, o($V11, [2, 108]), o($V11, [2, 114]), o($V$, [2, 60]), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 39: 286, 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 140, 84: $Vc1, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, o($V$, [2, 68]), o($Vo1, $V5, { 17: 287 }), o($VG1, [2, 126], { 108: 274, 22: $Vu1, 66: $Vv1, 67: $Vw1, 86: $Vx1, 102: $Vy1, 105: $Vz1, 109: $VA1, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1 }), o($V11, [2, 121], { 115: 100, 117: 178, 22: [1, 288], 26: $VK, 52: $VL, 66: $VM, 67: $VN, 91: $VO, 105: $VP, 106: $VQ, 109: $VR, 111: $VS, 112: $VT, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }), o($V11, [2, 122], { 115: 100, 117: 178, 22: [1, 289], 26: $VK, 52: $VL, 66: $VM, 67: $VN, 91: $VO, 105: $VP, 106: $VQ, 109: $VR, 111: $VS, 112: $VT, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }), { 22: $V51, 24: $V61, 26: $V71, 38: $V81, 41: [1, 290], 42: $V91, 52: $VL, 66: $VM, 67: $VN, 73: $Va1, 81: $Vb1, 83: 201, 85: 151, 86: $Vd1, 87: $Ve1, 88: $Vf1, 89: $Vg1, 90: $Vh1, 91: $Vi1, 92: $Vj1, 94: 142, 95: $Vk1, 105: $VP, 106: $VQ, 109: $Vl1, 111: $VS, 112: $VT, 113: $Vm1, 114: $Vn1, 115: 148, 122: $VU, 123: $VV, 124: $VW, 125: $VX, 126: $VY, 127: $VZ }, { 18: 18, 19: 19, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 32: 24, 33: 25, 34: 26, 35: 27, 36: 28, 37: 29, 38: $Va, 42: [1, 291], 43: 31, 44: $Vb, 46: $Vc, 48: $Vd, 50: 35, 51: 45, 52: $Ve, 54: 46, 66: $Vf, 67: $Vg, 86: $Vh, 87: $Vi, 88: $Vj, 89: $Vk, 90: $Vl, 91: $Vm, 95: $Vn, 105: $Vo, 106: $Vp, 109: $Vq, 111: $Vr, 112: $Vs, 116: 47, 118: $Vt, 119: $Vu, 120: $Vv, 121: $Vw, 122: $Vx, 123: $Vy, 124: $Vz, 125: $VA, 126: $VB, 127: $VC }, { 22: $Vu1, 66: $Vv1, 67: $Vw1, 86: $Vx1, 96: 292, 102: $Vy1, 105: $Vz1, 107: 243, 108: 244, 109: $VA1, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1 }, { 22: $Vu1, 66: $Vv1, 67: $Vw1, 86: $Vx1, 96: 293, 102: $Vy1, 105: $Vz1, 107: 243, 108: 244, 109: $VA1, 110: $VB1, 111: $VC1, 112: $VD1, 113: $VE1 }, o($V$, [2, 64]), o($VF, [2, 41]), o($V11, [2, 119], { 106: $VF1 }), o($V11, [2, 120], { 106: $VF1 })], defaultActions: { 2: [2, 1], 9: [2, 5], 10: [2, 2], 132: [2, 7] }, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse2(input) { var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer2 = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer2.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer2; sharedState.yy.parser = this; if (typeof lexer2.yylloc == "undefined") { lexer2.yylloc = {}; } var yyloc = lexer2.yylloc; lstack.push(yyloc); var ranges = lexer2.options && lexer2.options.ranges; if (typeof sharedState.yy.parseError === "function") { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function lex() { var token; token = tstack.pop() || lexer2.lex() || EOF; if (typeof token !== "number") { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self2.symbols_[token] || token; } return token; } var symbol, state, action, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push("'" + this.terminals_[p] + "'"); } } if (lexer2.showPosition) { errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; } else { errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); } this.parseError(errStr, { text: lexer2.match, token: this.terminals_[symbol] || symbol, line: lexer2.yylineno, loc: yyloc, expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer2.yytext); lstack.push(lexer2.yylloc); stack.push(action[1]); symbol = null; { yyleng = lexer2.yyleng; yytext = lexer2.yytext; yylineno = lexer2.yylineno; yyloc = lexer2.yylloc; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== "undefined") { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; } }; var lexer = function() { var lexer2 = { EOF: 1, parseError: function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, setInput: function(input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; this.yylineno = this.yyleng = 0; this.yytext = this.matched = this.match = ""; this.conditionStack = ["INITIAL"]; this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; if (this.options.ranges) { this.yylloc.range = [0, 0]; } this.offset = 0; return this; }, input: function() { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, unput: function(ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); this.offset -= len; var oldLines = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1); this.matched = this.matched.substr(0, this.matched.length - 1); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, more: function() { this._more = true; return this; }, reject: function() { if (this.options.backtrack_lexer) { this._backtrack = true; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, less: function(n) { this.unput(this.match.slice(n)); }, pastInput: function() { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); }, upcomingInput: function() { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20 - next.length); } return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, ""); }, showPosition: function() { var pre = this.pastInput(); var c2 = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c2 + "^"; }, test_match: function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { backup = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { for (var k in backup) { this[k] = backup[k]; } return false; } return false; }, next: function() { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ""; this.match = ""; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; } else { return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } return false; } if (this._input === "") { return this.EOF; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, lex: function lex() { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, begin: function begin(condition) { this.conditionStack.push(condition); }, popState: function popState() { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, _currentRules: function _currentRules() { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, topState: function topState(n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, pushState: function pushState(condition) { this.begin(condition); }, stateStackSize: function stateStackSize() { return this.conditionStack.length; }, options: {}, performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { switch ($avoiding_name_collisions) { case 0: this.begin("open_directive"); return 12; case 1: this.begin("type_directive"); return 13; case 2: this.popState(); this.begin("arg_directive"); return 10; case 3: this.popState(); this.popState(); return 15; case 4: return 14; case 5: break; case 6: break; case 7: this.begin("acc_title"); return 44; case 8: this.popState(); return "acc_title_value"; case 9: this.begin("acc_descr"); return 46; case 10: this.popState(); return "acc_descr_value"; case 11: this.begin("acc_descr_multiline"); break; case 12: this.popState(); break; case 13: return "acc_descr_multiline_value"; case 14: this.begin("string"); break; case 15: this.popState(); break; case 16: return "STR"; case 17: return 86; case 18: return 95; case 19: return 87; case 20: return 104; case 21: return 88; case 22: return 89; case 23: this.begin("href"); break; case 24: this.popState(); break; case 25: return 100; case 26: this.begin("callbackname"); break; case 27: this.popState(); break; case 28: this.popState(); this.begin("callbackargs"); break; case 29: return 98; case 30: this.popState(); break; case 31: return 99; case 32: this.begin("click"); break; case 33: this.popState(); break; case 34: return 90; case 35: if (yy.lex.firstGraph()) { this.begin("dir"); } return 24; case 36: if (yy.lex.firstGraph()) { this.begin("dir"); } return 24; case 37: return 38; case 38: return 42; case 39: return 101; case 40: return 101; case 41: return 101; case 42: return 101; case 43: this.popState(); return 25; case 44: this.popState(); return 26; case 45: this.popState(); return 26; case 46: this.popState(); return 26; case 47: this.popState(); return 26; case 48: this.popState(); return 26; case 49: this.popState(); return 26; case 50: this.popState(); return 26; case 51: this.popState(); return 26; case 52: this.popState(); return 26; case 53: this.popState(); return 26; case 54: return 118; case 55: return 119; case 56: return 120; case 57: return 121; case 58: return 105; case 59: return 111; case 60: return 53; case 61: return 67; case 62: return 52; case 63: return 20; case 64: return 106; case 65: return 126; case 66: return 82; case 67: return 82; case 68: return 82; case 69: return 82; case 70: return 81; case 71: return 81; case 72: return 81; case 73: return 59; case 74: return 60; case 75: return 61; case 76: return 62; case 77: return 63; case 78: return 64; case 79: return 65; case 80: return 69; case 81: return 70; case 82: return 55; case 83: return 56; case 84: return 109; case 85: return 112; case 86: return 127; case 87: return 124; case 88: return 113; case 89: return 125; case 90: return 125; case 91: return 114; case 92: return 73; case 93: return 92; case 94: return "SEP"; case 95: return 91; case 96: return 66; case 97: return 75; case 98: return 74; case 99: return 77; case 100: return 76; case 101: return 122; case 102: return 123; case 103: return 68; case 104: return 57; case 105: return 58; case 106: return 40; case 107: return 41; case 108: return 71; case 109: return 72; case 110: return 133; case 111: return 21; case 112: return 22; case 113: return 23; } }, rules: [/^(?:%%\{)/, /^(?:((?:(?!\}%%)[^:.])*))/, /^(?::)/, /^(?:\}%%)/, /^(?:((?:(?!\}%%).|\n)*))/, /^(?:%%(?!\{)[^\n]*)/, /^(?:[^\}]%%[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:style\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\b)/, /^(?:class\b)/, /^(?:href[\s]+["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:call[\s]+)/, /^(?:\([\s]*\))/, /^(?:\()/, /^(?:[^(]*)/, /^(?:\))/, /^(?:[^)]*)/, /^(?:click[\s]+)/, /^(?:[\s\n])/, /^(?:[^\s\n]*)/, /^(?:graph\b)/, /^(?:flowchart\b)/, /^(?:subgraph\b)/, /^(?:end\b\s*)/, /^(?:_self\b)/, /^(?:_blank\b)/, /^(?:_parent\b)/, /^(?:_top\b)/, /^(?:(\r?\n)*\s*\n)/, /^(?:\s*LR\b)/, /^(?:\s*RL\b)/, /^(?:\s*TB\b)/, /^(?:\s*BT\b)/, /^(?:\s*TD\b)/, /^(?:\s*BR\b)/, /^(?:\s*<)/, /^(?:\s*>)/, /^(?:\s*\^)/, /^(?:\s*v\b)/, /^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:[0-9]+)/, /^(?:#)/, /^(?::::)/, /^(?::)/, /^(?:&)/, /^(?:;)/, /^(?:,)/, /^(?:\*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\[)/, /^(?:\]\))/, /^(?:\[\[)/, /^(?:\]\])/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\])/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:-)/, /^(?:\.)/, /^(?:[\_])/, /^(?:\+)/, /^(?:%)/, /^(?:=)/, /^(?:=)/, /^(?:<)/, /^(?:>)/, /^(?:\^)/, /^(?:\\\|)/, /^(?:v\b)/, /^(?:[A-Za-z]+)/, /^(?:\\\])/, /^(?:\[\/)/, /^(?:\/\])/, /^(?:\[\\)/, /^(?:[!"#$%&'*+,-.`?\\_/])/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\|)/, /^(?:\()/, /^(?:\))/, /^(?:\[)/, /^(?:\])/, /^(?:\{)/, /^(?:\})/, /^(?:")/, /^(?:(\r?\n)+)/, /^(?:\s)/, /^(?:$)/], conditions: { "close_directive": { "rules": [], "inclusive": false }, "arg_directive": { "rules": [3, 4], "inclusive": false }, "type_directive": { "rules": [2, 3], "inclusive": false }, "open_directive": { "rules": [1], "inclusive": false }, "callbackargs": { "rules": [30, 31], "inclusive": false }, "callbackname": { "rules": [27, 28, 29], "inclusive": false }, "href": { "rules": [24, 25], "inclusive": false }, "click": { "rules": [33, 34], "inclusive": false }, "vertex": { "rules": [], "inclusive": false }, "dir": { "rules": [43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53], "inclusive": false }, "acc_descr_multiline": { "rules": [12, 13], "inclusive": false }, "acc_descr": { "rules": [10], "inclusive": false }, "acc_title": { "rules": [8], "inclusive": false }, "string": { "rules": [15, 16], "inclusive": false }, "INITIAL": { "rules": [0, 5, 6, 7, 9, 11, 14, 17, 18, 19, 20, 21, 22, 23, 26, 32, 35, 36, 37, 38, 39, 40, 41, 42, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113], "inclusive": true } } }; return lexer2; }(); parser2.lexer = lexer; function Parser() { this.yy = {}; } Parser.prototype = parser2; parser2.Parser = Parser; return new Parser(); }(); parser$7.parser = parser$7; const flowDetector = (txt, config2) => { var _a; if (((_a = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper") return false; return txt.match(/^\s*graph/) !== null; }; const flowDetectorV2 = (txt, config2) => { var _a; if (((_a = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper" && txt.match(/^\s*graph/) !== null) return true; return txt.match(/^\s*flowchart/) !== null; }; const MERMAID_DOM_ID_PREFIX = "flowchart-"; let vertexCounter = 0; let config = getConfig$1(); let vertices = {}; let edges = []; let classes$1 = []; let subGraphs = []; let subGraphLookup = {}; let tooltips = {}; let subCount = 0; let firstGraphFlag = true; let direction$1; let version; let funs$1 = []; const sanitizeText = (txt) => common.sanitizeText(txt, config); const parseDirective$7 = function(statement, context, type2) { mermaidAPI.parseDirective(this, statement, context, type2); }; const lookUpDomId = function(id) { const veritceKeys = Object.keys(vertices); for (let i = 0; i < veritceKeys.length; i++) { if (vertices[veritceKeys[i]].id === id) { return vertices[veritceKeys[i]].domId; } } return id; }; const addVertex = function(_id, text, type2, style, classes2, dir, props = {}) { let txt; let id = _id; if (typeof id === "undefined") { return; } if (id.trim().length === 0) { return; } if (typeof vertices[id] === "undefined") { vertices[id] = { id, domId: MERMAID_DOM_ID_PREFIX + id + "-" + vertexCounter, styles: [], classes: [] }; } vertexCounter++; if (typeof text !== "undefined") { config = getConfig$1(); txt = sanitizeText(text.trim()); if (txt[0] === '"' && txt[txt.length - 1] === '"') { txt = txt.substring(1, txt.length - 1); } vertices[id].text = txt; } else { if (typeof vertices[id].text === "undefined") { vertices[id].text = _id; } } if (typeof type2 !== "undefined") { vertices[id].type = type2; } if (typeof style !== "undefined") { if (style !== null) { style.forEach(function(s) { vertices[id].styles.push(s); }); } } if (typeof classes2 !== "undefined") { if (classes2 !== null) { classes2.forEach(function(s) { vertices[id].classes.push(s); }); } } if (typeof dir !== "undefined") { vertices[id].dir = dir; } vertices[id].props = props; }; const addSingleLink = function(_start, _end, type2, linktext) { let start2 = _start; let end2 = _end; const edge = { start: start2, end: end2, type: void 0, text: "" }; linktext = type2.text; if (typeof linktext !== "undefined") { edge.text = sanitizeText(linktext.trim()); if (edge.text[0] === '"' && edge.text[edge.text.length - 1] === '"') { edge.text = edge.text.substring(1, edge.text.length - 1); } } if (typeof type2 !== "undefined") { edge.type = type2.type; edge.stroke = type2.stroke; edge.length = type2.length; } edges.push(edge); }; const addLink = function(_start, _end, type2, linktext) { let i, j; for (i = 0; i < _start.length; i++) { for (j = 0; j < _end.length; j++) { addSingleLink(_start[i], _end[j], type2, linktext); } } }; const updateLinkInterpolate = function(positions, interp) { positions.forEach(function(pos) { if (pos === "default") { edges.defaultInterpolate = interp; } else { edges[pos].interpolate = interp; } }); }; const updateLink = function(positions, style) { positions.forEach(function(pos) { if (pos === "default") { edges.defaultStyle = style; } else { if (utils.isSubstringInArray("fill", style) === -1) { style.push("fill:none"); } edges[pos].style = style; } }); }; const addClass = function(id, style) { if (typeof classes$1[id] === "undefined") { classes$1[id] = { id, styles: [], textStyles: [] }; } if (typeof style !== "undefined") { if (style !== null) { style.forEach(function(s) { if (s.match("color")) { const newStyle1 = s.replace("fill", "bgFill"); const newStyle2 = newStyle1.replace("color", "fill"); classes$1[id].textStyles.push(newStyle2); } classes$1[id].styles.push(s); }); } } }; const setDirection$1 = function(dir) { direction$1 = dir; if (direction$1.match(/.*/)) { direction$1 = "LR"; } if (direction$1.match(/.*v/)) { direction$1 = "TB"; } }; const setClass$1 = function(ids, className) { ids.split(",").forEach(function(_id) { let id = _id; if (typeof vertices[id] !== "undefined") { vertices[id].classes.push(className); } if (typeof subGraphLookup[id] !== "undefined") { subGraphLookup[id].classes.push(className); } }); }; const setTooltip = function(ids, tooltip) { ids.split(",").forEach(function(id) { if (typeof tooltip !== "undefined") { tooltips[version === "gen-1" ? lookUpDomId(id) : id] = sanitizeText(tooltip); } }); }; const setClickFun$1 = function(id, functionName, functionArgs) { let domId = lookUpDomId(id); if (getConfig$1().securityLevel !== "loose") { return; } if (typeof functionName === "undefined") { return; } let argList = []; if (typeof functionArgs === "string") { argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); for (let i = 0; i < argList.length; i++) { let item = argList[i].trim(); if (item.charAt(0) === '"' && item.charAt(item.length - 1) === '"') { item = item.substr(1, item.length - 2); } argList[i] = item; } } if (argList.length === 0) { argList.push(id); } if (typeof vertices[id] !== "undefined") { vertices[id].haveCallback = true; funs$1.push(function() { const elem = document.querySelector(`[id="${domId}"]`); if (elem !== null) { elem.addEventListener( "click", function() { utils.runFunc(functionName, ...argList); }, false ); } }); } }; const setLink$1 = function(ids, linkStr, target) { ids.split(",").forEach(function(id) { if (typeof vertices[id] !== "undefined") { vertices[id].link = utils.formatUrl(linkStr, config); vertices[id].linkTarget = target; } }); setClass$1(ids, "clickable"); }; const getTooltip = function(id) { return tooltips[id]; }; const setClickEvent$1 = function(ids, functionName, functionArgs) { ids.split(",").forEach(function(id) { setClickFun$1(id, functionName, functionArgs); }); setClass$1(ids, "clickable"); }; const bindFunctions$1 = function(element) { funs$1.forEach(function(fun) { fun(element); }); }; const getDirection$1 = function() { return direction$1.trim(); }; const getVertices = function() { return vertices; }; const getEdges = function() { return edges; }; const getClasses$4 = function() { return classes$1; }; const setupToolTips = function(element) { let tooltipElem = select(".mermaidTooltip"); if ((tooltipElem._groups || tooltipElem)[0][0] === null) { tooltipElem = select("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0); } const svg = select(element).select("svg"); const nodes = svg.selectAll("g.node"); nodes.on("mouseover", function() { const el = select(this); const title2 = el.attr("title"); if (title2 === null) { return; } const rect2 = this.getBoundingClientRect(); tooltipElem.transition().duration(200).style("opacity", ".9"); tooltipElem.text(el.attr("title")).style("left", window.scrollX + rect2.left + (rect2.right - rect2.left) / 2 + "px").style("top", window.scrollY + rect2.top - 14 + document.body.scrollTop + "px"); tooltipElem.html(tooltipElem.html().replace(/<br\/>/g, "
")); el.classed("hover", true); }).on("mouseout", function() { tooltipElem.transition().duration(500).style("opacity", 0); const el = select(this); el.classed("hover", false); }); }; funs$1.push(setupToolTips); const clear$6 = function(ver = "gen-1") { vertices = {}; classes$1 = {}; edges = []; funs$1 = [setupToolTips]; subGraphs = []; subGraphLookup = {}; subCount = 0; tooltips = []; firstGraphFlag = true; version = ver; clear$g(); }; const setGen = (ver) => { version = ver || "gen-1"; }; const defaultStyle = function() { return "fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"; }; const addSubGraph = function(_id, list, _title) { let id = _id.trim(); let title2 = _title.trim(); if (id === title2 && title2.match(/\s/)) { id = void 0; } function uniq(a) { const prims = { boolean: {}, number: {}, string: {} }; const objs = []; let dir2; const nodeList2 = a.filter(function(item) { const type2 = typeof item; if (item.stmt && item.stmt === "dir") { dir2 = item.value; return false; } if (item.trim() === "") { return false; } if (type2 in prims) { return prims[type2].hasOwnProperty(item) ? false : prims[type2][item] = true; } else { return objs.indexOf(item) >= 0 ? false : objs.push(item); } }); return { nodeList: nodeList2, dir: dir2 }; } let nodeList = []; const { nodeList: nl, dir } = uniq(nodeList.concat.apply(nodeList, list)); nodeList = nl; if (version === "gen-1") { for (let i = 0; i < nodeList.length; i++) { nodeList[i] = lookUpDomId(nodeList[i]); } } id = id || "subGraph" + subCount; title2 = title2 || ""; title2 = sanitizeText(title2); subCount = subCount + 1; const subGraph = { id, nodes: nodeList, title: title2.trim(), classes: [], dir }; log$1.info("Adding", subGraph.id, subGraph.nodes, subGraph.dir); subGraph.nodes = makeUniq(subGraph, subGraphs).nodes; subGraphs.push(subGraph); subGraphLookup[id] = subGraph; return id; }; const getPosForId = function(id) { for (let i = 0; i < subGraphs.length; i++) { if (subGraphs[i].id === id) { return i; } } return -1; }; let secCount = -1; const posCrossRef = []; const indexNodes2 = function(id, pos) { const nodes = subGraphs[pos].nodes; secCount = secCount + 1; if (secCount > 2e3) { return; } posCrossRef[secCount] = pos; if (subGraphs[pos].id === id) { return { result: true, count: 0 }; } let count = 0; let posCount = 1; while (count < nodes.length) { const childPos = getPosForId(nodes[count]); if (childPos >= 0) { const res = indexNodes2(id, childPos); if (res.result) { return { result: true, count: posCount + res.count }; } else { posCount = posCount + res.count; } } count = count + 1; } return { result: false, count: posCount }; }; const getDepthFirstPos = function(pos) { return posCrossRef[pos]; }; const indexNodes = function() { secCount = -1; if (subGraphs.length > 0) { indexNodes2("none", subGraphs.length - 1); } }; const getSubGraphs = function() { return subGraphs; }; const firstGraph = () => { if (firstGraphFlag) { firstGraphFlag = false; return true; } return false; }; const destructStartLink = (_str) => { let str = _str.trim(); let type2 = "arrow_open"; switch (str[0]) { case "<": type2 = "arrow_point"; str = str.slice(1); break; case "x": type2 = "arrow_cross"; str = str.slice(1); break; case "o": type2 = "arrow_circle"; str = str.slice(1); break; } let stroke = "normal"; if (str.indexOf("=") !== -1) { stroke = "thick"; } if (str.indexOf(".") !== -1) { stroke = "dotted"; } return { type: type2, stroke }; }; const countChar = (char, str) => { const length = str.length; let count = 0; for (let i = 0; i < length; ++i) { if (str[i] === char) { ++count; } } return count; }; const destructEndLink = (_str) => { const str = _str.trim(); let line2 = str.slice(0, -1); let type2 = "arrow_open"; switch (str.slice(-1)) { case "x": type2 = "arrow_cross"; if (str[0] === "x") { type2 = "double_" + type2; line2 = line2.slice(1); } break; case ">": type2 = "arrow_point"; if (str[0] === "<") { type2 = "double_" + type2; line2 = line2.slice(1); } break; case "o": type2 = "arrow_circle"; if (str[0] === "o") { type2 = "double_" + type2; line2 = line2.slice(1); } break; } let stroke = "normal"; let length = line2.length - 1; if (line2[0] === "=") { stroke = "thick"; } if (line2[0] === "~") { stroke = "invisible"; } let dots = countChar(".", line2); if (dots) { stroke = "dotted"; length = dots; } return { type: type2, stroke, length }; }; const destructLink = (_str, _startStr) => { const info2 = destructEndLink(_str); let startInfo; if (_startStr) { startInfo = destructStartLink(_startStr); if (startInfo.stroke !== info2.stroke) { return { type: "INVALID", stroke: "INVALID" }; } if (startInfo.type === "arrow_open") { startInfo.type = info2.type; } else { if (startInfo.type !== info2.type) return { type: "INVALID", stroke: "INVALID" }; startInfo.type = "double_" + startInfo.type; } if (startInfo.type === "double_arrow") { startInfo.type = "double_arrow_point"; } startInfo.length = info2.length; return startInfo; } return info2; }; const exists = (allSgs, _id) => { let res = false; allSgs.forEach((sg) => { const pos = sg.nodes.indexOf(_id); if (pos >= 0) { res = true; } }); return res; }; const makeUniq = (sg, allSubgraphs) => { const res = []; sg.nodes.forEach((_id, pos) => { if (!exists(allSubgraphs, _id)) { res.push(sg.nodes[pos]); } }); return { nodes: res }; }; const flowDb = { parseDirective: parseDirective$7, defaultConfig: () => defaultConfig.flowchart, setAccTitle, getAccTitle, getAccDescription, setAccDescription, addVertex, lookUpDomId, addLink, updateLinkInterpolate, updateLink, addClass, setDirection: setDirection$1, setClass: setClass$1, setTooltip, getTooltip, setClickEvent: setClickEvent$1, setLink: setLink$1, bindFunctions: bindFunctions$1, getDirection: getDirection$1, getVertices, getEdges, getClasses: getClasses$4, clear: clear$6, setGen, defaultStyle, addSubGraph, getDepthFirstPos, indexNodes, getSubGraphs, destructLink, lex: { firstGraph }, exists, makeUniq }; function commonjsRequire(path) { throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); } var identity_1; var hasRequiredIdentity; function requireIdentity() { if (hasRequiredIdentity) return identity_1; hasRequiredIdentity = 1; function identity(value) { return value; } identity_1 = identity; return identity_1; } var _apply; var hasRequired_apply; function require_apply() { if (hasRequired_apply) return _apply; hasRequired_apply = 1; function apply2(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } _apply = apply2; return _apply; } var _overRest; var hasRequired_overRest; function require_overRest() { if (hasRequired_overRest) return _overRest; hasRequired_overRest = 1; var apply2 = require_apply(); var nativeMax = Math.max; function overRest(func, start2, transform) { start2 = nativeMax(start2 === void 0 ? func.length - 1 : start2, 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start2, 0), array = Array(length); while (++index < length) { array[index] = args[start2 + index]; } index = -1; var otherArgs = Array(start2 + 1); while (++index < start2) { otherArgs[index] = args[index]; } otherArgs[start2] = transform(array); return apply2(func, this, otherArgs); }; } _overRest = overRest; return _overRest; } var constant_1; var hasRequiredConstant; function requireConstant() { if (hasRequiredConstant) return constant_1; hasRequiredConstant = 1; function constant(value) { return function() { return value; }; } constant_1 = constant; return constant_1; } var _defineProperty; var hasRequired_defineProperty; function require_defineProperty() { if (hasRequired_defineProperty) return _defineProperty; hasRequired_defineProperty = 1; var getNative2 = _getNative; var defineProperty = function() { try { var func = getNative2(Object, "defineProperty"); func({}, "", {}); return func; } catch (e) { } }(); _defineProperty = defineProperty; return _defineProperty; } var _baseSetToString; var hasRequired_baseSetToString; function require_baseSetToString() { if (hasRequired_baseSetToString) return _baseSetToString; hasRequired_baseSetToString = 1; var constant = requireConstant(), defineProperty = require_defineProperty(), identity = requireIdentity(); var baseSetToString = !defineProperty ? identity : function(func, string) { return defineProperty(func, "toString", { "configurable": true, "enumerable": false, "value": constant(string), "writable": true }); }; _baseSetToString = baseSetToString; return _baseSetToString; } var _shortOut; var hasRequired_shortOut; function require_shortOut() { if (hasRequired_shortOut) return _shortOut; hasRequired_shortOut = 1; var HOT_COUNT = 800, HOT_SPAN = 16; var nativeNow = Date.now; function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(void 0, arguments); }; } _shortOut = shortOut; return _shortOut; } var _setToString; var hasRequired_setToString; function require_setToString() { if (hasRequired_setToString) return _setToString; hasRequired_setToString = 1; var baseSetToString = require_baseSetToString(), shortOut = require_shortOut(); var setToString = shortOut(baseSetToString); _setToString = setToString; return _setToString; } var _baseRest; var hasRequired_baseRest; function require_baseRest() { if (hasRequired_baseRest) return _baseRest; hasRequired_baseRest = 1; var identity = requireIdentity(), overRest = require_overRest(), setToString = require_setToString(); function baseRest(func, start2) { return setToString(overRest(func, start2, identity), func + ""); } _baseRest = baseRest; return _baseRest; } var isLength_1; var hasRequiredIsLength; function requireIsLength() { if (hasRequiredIsLength) return isLength_1; hasRequiredIsLength = 1; var MAX_SAFE_INTEGER = 9007199254740991; function isLength(value) { return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } isLength_1 = isLength; return isLength_1; } var isArrayLike_1; var hasRequiredIsArrayLike; function requireIsArrayLike() { if (hasRequiredIsArrayLike) return isArrayLike_1; hasRequiredIsArrayLike = 1; var isFunction2 = isFunction_1, isLength = requireIsLength(); function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction2(value); } isArrayLike_1 = isArrayLike; return isArrayLike_1; } var _isIndex; var hasRequired_isIndex; function require_isIndex() { if (hasRequired_isIndex) return _isIndex; hasRequired_isIndex = 1; var MAX_SAFE_INTEGER = 9007199254740991; var reIsUint = /^(?:0|[1-9]\d*)$/; function isIndex(value, length) { var type2 = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type2 == "number" || type2 != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); } _isIndex = isIndex; return _isIndex; } var _isIterateeCall; var hasRequired_isIterateeCall; function require_isIterateeCall() { if (hasRequired_isIterateeCall) return _isIterateeCall; hasRequired_isIterateeCall = 1; var eq2 = eq_1, isArrayLike = requireIsArrayLike(), isIndex = require_isIndex(), isObject2 = isObject_1; function isIterateeCall(value, index, object) { if (!isObject2(object)) { return false; } var type2 = typeof index; if (type2 == "number" ? isArrayLike(object) && isIndex(index, object.length) : type2 == "string" && index in object) { return eq2(object[index], value); } return false; } _isIterateeCall = isIterateeCall; return _isIterateeCall; } var _baseTimes; var hasRequired_baseTimes; function require_baseTimes() { if (hasRequired_baseTimes) return _baseTimes; hasRequired_baseTimes = 1; function baseTimes(n, iteratee) { var index = -1, result = Array(n); while (++index < n) { result[index] = iteratee(index); } return result; } _baseTimes = baseTimes; return _baseTimes; } var isObjectLike_1; var hasRequiredIsObjectLike; function requireIsObjectLike() { if (hasRequiredIsObjectLike) return isObjectLike_1; hasRequiredIsObjectLike = 1; function isObjectLike(value) { return value != null && typeof value == "object"; } isObjectLike_1 = isObjectLike; return isObjectLike_1; } var _baseIsArguments; var hasRequired_baseIsArguments; function require_baseIsArguments() { if (hasRequired_baseIsArguments) return _baseIsArguments; hasRequired_baseIsArguments = 1; var baseGetTag2 = _baseGetTag, isObjectLike = requireIsObjectLike(); var argsTag = "[object Arguments]"; function baseIsArguments(value) { return isObjectLike(value) && baseGetTag2(value) == argsTag; } _baseIsArguments = baseIsArguments; return _baseIsArguments; } var isArguments_1; var hasRequiredIsArguments; function requireIsArguments() { if (hasRequiredIsArguments) return isArguments_1; hasRequiredIsArguments = 1; var baseIsArguments = require_baseIsArguments(), isObjectLike = requireIsObjectLike(); var objectProto2 = Object.prototype; var hasOwnProperty2 = objectProto2.hasOwnProperty; var propertyIsEnumerable = objectProto2.propertyIsEnumerable; var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty2.call(value, "callee") && !propertyIsEnumerable.call(value, "callee"); }; isArguments_1 = isArguments; return isArguments_1; } var isArray_1; var hasRequiredIsArray; function requireIsArray() { if (hasRequiredIsArray) return isArray_1; hasRequiredIsArray = 1; var isArray = Array.isArray; isArray_1 = isArray; return isArray_1; } var isBuffer = { exports: {} }; var stubFalse_1; var hasRequiredStubFalse; function requireStubFalse() { if (hasRequiredStubFalse) return stubFalse_1; hasRequiredStubFalse = 1; function stubFalse() { return false; } stubFalse_1 = stubFalse; return stubFalse_1; } var hasRequiredIsBuffer; function requireIsBuffer() { if (hasRequiredIsBuffer) return isBuffer.exports; hasRequiredIsBuffer = 1; (function(module2, exports2) { var root2 = _root, stubFalse = requireStubFalse(); var freeExports = exports2 && !exports2.nodeType && exports2; var freeModule = freeExports && true && module2 && !module2.nodeType && module2; var moduleExports = freeModule && freeModule.exports === freeExports; var Buffer2 = moduleExports ? root2.Buffer : void 0; var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0; var isBuffer2 = nativeIsBuffer || stubFalse; module2.exports = isBuffer2; })(isBuffer, isBuffer.exports); return isBuffer.exports; } var _baseIsTypedArray; var hasRequired_baseIsTypedArray; function require_baseIsTypedArray() { if (hasRequired_baseIsTypedArray) return _baseIsTypedArray; hasRequired_baseIsTypedArray = 1; var baseGetTag2 = _baseGetTag, isLength = requireIsLength(), isObjectLike = requireIsObjectLike(); var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag2 = "[object Function]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", weakMapTag = "[object WeakMap]"; var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]"; var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag2] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag2(value)]; } _baseIsTypedArray = baseIsTypedArray; return _baseIsTypedArray; } var _baseUnary; var hasRequired_baseUnary; function require_baseUnary() { if (hasRequired_baseUnary) return _baseUnary; hasRequired_baseUnary = 1; function baseUnary(func) { return function(value) { return func(value); }; } _baseUnary = baseUnary; return _baseUnary; } var _nodeUtil = { exports: {} }; var hasRequired_nodeUtil; function require_nodeUtil() { if (hasRequired_nodeUtil) return _nodeUtil.exports; hasRequired_nodeUtil = 1; (function(module2, exports2) { var freeGlobal2 = _freeGlobal; var freeExports = exports2 && !exports2.nodeType && exports2; var freeModule = freeExports && true && module2 && !module2.nodeType && module2; var moduleExports = freeModule && freeModule.exports === freeExports; var freeProcess = moduleExports && freeGlobal2.process; var nodeUtil = function() { try { var types2 = freeModule && freeModule.require && freeModule.require("util").types; if (types2) { return types2; } return freeProcess && freeProcess.binding && freeProcess.binding("util"); } catch (e) { } }(); module2.exports = nodeUtil; })(_nodeUtil, _nodeUtil.exports); return _nodeUtil.exports; } var isTypedArray_1; var hasRequiredIsTypedArray; function requireIsTypedArray() { if (hasRequiredIsTypedArray) return isTypedArray_1; hasRequiredIsTypedArray = 1; var baseIsTypedArray = require_baseIsTypedArray(), baseUnary = require_baseUnary(), nodeUtil = require_nodeUtil(); var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; isTypedArray_1 = isTypedArray; return isTypedArray_1; } var _arrayLikeKeys; var hasRequired_arrayLikeKeys; function require_arrayLikeKeys() { if (hasRequired_arrayLikeKeys) return _arrayLikeKeys; hasRequired_arrayLikeKeys = 1; var baseTimes = require_baseTimes(), isArguments = requireIsArguments(), isArray = requireIsArray(), isBuffer2 = requireIsBuffer(), isIndex = require_isIndex(), isTypedArray = requireIsTypedArray(); var objectProto2 = Object.prototype; var hasOwnProperty2 = objectProto2.hasOwnProperty; function arrayLikeKeys(value, inherited) { var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer2(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; for (var key in value) { if ((inherited || hasOwnProperty2.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) { result.push(key); } } return result; } _arrayLikeKeys = arrayLikeKeys; return _arrayLikeKeys; } var _isPrototype; var hasRequired_isPrototype; function require_isPrototype() { if (hasRequired_isPrototype) return _isPrototype; hasRequired_isPrototype = 1; var objectProto2 = Object.prototype; function isPrototype(value) { var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto2; return value === proto; } _isPrototype = isPrototype; return _isPrototype; } var _nativeKeysIn; var hasRequired_nativeKeysIn; function require_nativeKeysIn() { if (hasRequired_nativeKeysIn) return _nativeKeysIn; hasRequired_nativeKeysIn = 1; function nativeKeysIn(object) { var result = []; if (object != null) { for (var key in Object(object)) { result.push(key); } } return result; } _nativeKeysIn = nativeKeysIn; return _nativeKeysIn; } var _baseKeysIn; var hasRequired_baseKeysIn; function require_baseKeysIn() { if (hasRequired_baseKeysIn) return _baseKeysIn; hasRequired_baseKeysIn = 1; var isObject2 = isObject_1, isPrototype = require_isPrototype(), nativeKeysIn = require_nativeKeysIn(); var objectProto2 = Object.prototype; var hasOwnProperty2 = objectProto2.hasOwnProperty; function baseKeysIn(object) { if (!isObject2(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result = []; for (var key in object) { if (!(key == "constructor" && (isProto || !hasOwnProperty2.call(object, key)))) { result.push(key); } } return result; } _baseKeysIn = baseKeysIn; return _baseKeysIn; } var keysIn_1; var hasRequiredKeysIn; function requireKeysIn() { if (hasRequiredKeysIn) return keysIn_1; hasRequiredKeysIn = 1; var arrayLikeKeys = require_arrayLikeKeys(), baseKeysIn = require_baseKeysIn(), isArrayLike = requireIsArrayLike(); function keysIn(object) { return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } keysIn_1 = keysIn; return keysIn_1; } var defaults_1; var hasRequiredDefaults; function requireDefaults() { if (hasRequiredDefaults) return defaults_1; hasRequiredDefaults = 1; var baseRest = require_baseRest(), eq2 = eq_1, isIterateeCall = require_isIterateeCall(), keysIn = requireKeysIn(); var objectProto2 = Object.prototype; var hasOwnProperty2 = objectProto2.hasOwnProperty; var defaults = baseRest(function(object, sources) { object = Object(object); var index = -1; var length = sources.length; var guard = length > 2 ? sources[2] : void 0; if (guard && isIterateeCall(sources[0], sources[1], guard)) { length = 1; } while (++index < length) { var source = sources[index]; var props = keysIn(source); var propsIndex = -1; var propsLength = props.length; while (++propsIndex < propsLength) { var key = props[propsIndex]; var value = object[key]; if (value === void 0 || eq2(value, objectProto2[key]) && !hasOwnProperty2.call(object, key)) { object[key] = source[key]; } } } return object; }); defaults_1 = defaults; return defaults_1; } var each = { exports: {} }; var _arrayEach; var hasRequired_arrayEach; function require_arrayEach() { if (hasRequired_arrayEach) return _arrayEach; hasRequired_arrayEach = 1; function arrayEach(array, iteratee) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } _arrayEach = arrayEach; return _arrayEach; } var _createBaseFor; var hasRequired_createBaseFor; function require_createBaseFor() { if (hasRequired_createBaseFor) return _createBaseFor; hasRequired_createBaseFor = 1; function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; while (length--) { var key = props[fromRight ? length : ++index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } _createBaseFor = createBaseFor; return _createBaseFor; } var _baseFor; var hasRequired_baseFor; function require_baseFor() { if (hasRequired_baseFor) return _baseFor; hasRequired_baseFor = 1; var createBaseFor = require_createBaseFor(); var baseFor = createBaseFor(); _baseFor = baseFor; return _baseFor; } var _overArg; var hasRequired_overArg; function require_overArg() { if (hasRequired_overArg) return _overArg; hasRequired_overArg = 1; function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } _overArg = overArg; return _overArg; } var _nativeKeys; var hasRequired_nativeKeys; function require_nativeKeys() { if (hasRequired_nativeKeys) return _nativeKeys; hasRequired_nativeKeys = 1; var overArg = require_overArg(); var nativeKeys = overArg(Object.keys, Object); _nativeKeys = nativeKeys; return _nativeKeys; } var _baseKeys; var hasRequired_baseKeys; function require_baseKeys() { if (hasRequired_baseKeys) return _baseKeys; hasRequired_baseKeys = 1; var isPrototype = require_isPrototype(), nativeKeys = require_nativeKeys(); var objectProto2 = Object.prototype; var hasOwnProperty2 = objectProto2.hasOwnProperty; function baseKeys(object) { if (!isPrototype(object)) { return nativeKeys(object); } var result = []; for (var key in Object(object)) { if (hasOwnProperty2.call(object, key) && key != "constructor") { result.push(key); } } return result; } _baseKeys = baseKeys; return _baseKeys; } var keys_1; var hasRequiredKeys; function requireKeys() { if (hasRequiredKeys) return keys_1; hasRequiredKeys = 1; var arrayLikeKeys = require_arrayLikeKeys(), baseKeys = require_baseKeys(), isArrayLike = requireIsArrayLike(); function keys(object) { return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } keys_1 = keys; return keys_1; } var _baseForOwn; var hasRequired_baseForOwn; function require_baseForOwn() { if (hasRequired_baseForOwn) return _baseForOwn; hasRequired_baseForOwn = 1; var baseFor = require_baseFor(), keys = requireKeys(); function baseForOwn(object, iteratee) { return object && baseFor(object, iteratee, keys); } _baseForOwn = baseForOwn; return _baseForOwn; } var _createBaseEach; var hasRequired_createBaseEach; function require_createBaseEach() { if (hasRequired_createBaseEach) return _createBaseEach; hasRequired_createBaseEach = 1; var isArrayLike = requireIsArrayLike(); function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee) { if (collection == null) { return collection; } if (!isArrayLike(collection)) { return eachFunc(collection, iteratee); } var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection); while (fromRight ? index-- : ++index < length) { if (iteratee(iterable[index], index, iterable) === false) { break; } } return collection; }; } _createBaseEach = createBaseEach; return _createBaseEach; } var _baseEach; var hasRequired_baseEach; function require_baseEach() { if (hasRequired_baseEach) return _baseEach; hasRequired_baseEach = 1; var baseForOwn = require_baseForOwn(), createBaseEach = require_createBaseEach(); var baseEach = createBaseEach(baseForOwn); _baseEach = baseEach; return _baseEach; } var _castFunction; var hasRequired_castFunction; function require_castFunction() { if (hasRequired_castFunction) return _castFunction; hasRequired_castFunction = 1; var identity = requireIdentity(); function castFunction(value) { return typeof value == "function" ? value : identity; } _castFunction = castFunction; return _castFunction; } var forEach_1; var hasRequiredForEach; function requireForEach() { if (hasRequiredForEach) return forEach_1; hasRequiredForEach = 1; var arrayEach = require_arrayEach(), baseEach = require_baseEach(), castFunction = require_castFunction(), isArray = requireIsArray(); function forEach(collection, iteratee) { var func = isArray(collection) ? arrayEach : baseEach; return func(collection, castFunction(iteratee)); } forEach_1 = forEach; return forEach_1; } var hasRequiredEach; function requireEach() { if (hasRequiredEach) return each.exports; hasRequiredEach = 1; (function(module2) { module2.exports = requireForEach(); })(each); return each.exports; } var _getPrototype; var hasRequired_getPrototype; function require_getPrototype() { if (hasRequired_getPrototype) return _getPrototype; hasRequired_getPrototype = 1; var overArg = require_overArg(); var getPrototype = overArg(Object.getPrototypeOf, Object); _getPrototype = getPrototype; return _getPrototype; } var isPlainObject_1; var hasRequiredIsPlainObject; function requireIsPlainObject() { if (hasRequiredIsPlainObject) return isPlainObject_1; hasRequiredIsPlainObject = 1; var baseGetTag2 = _baseGetTag, getPrototype = require_getPrototype(), isObjectLike = requireIsObjectLike(); var objectTag = "[object Object]"; var funcProto2 = Function.prototype, objectProto2 = Object.prototype; var funcToString2 = funcProto2.toString; var hasOwnProperty2 = objectProto2.hasOwnProperty; var objectCtorString = funcToString2.call(Object); function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag2(value) != objectTag) { return false; } var proto = getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty2.call(proto, "constructor") && proto.constructor; return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString2.call(Ctor) == objectCtorString; } isPlainObject_1 = isPlainObject; return isPlainObject_1; } var isSymbol_1; var hasRequiredIsSymbol; function requireIsSymbol() { if (hasRequiredIsSymbol) return isSymbol_1; hasRequiredIsSymbol = 1; var baseGetTag2 = _baseGetTag, isObjectLike = requireIsObjectLike(); var symbolTag = "[object Symbol]"; function isSymbol(value) { return typeof value == "symbol" || isObjectLike(value) && baseGetTag2(value) == symbolTag; } isSymbol_1 = isSymbol; return isSymbol_1; } var _isKey; var hasRequired_isKey; function require_isKey() { if (hasRequired_isKey) return _isKey; hasRequired_isKey = 1; var isArray = requireIsArray(), isSymbol = requireIsSymbol(); var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/; function isKey(value, object) { if (isArray(value)) { return false; } var type2 = typeof value; if (type2 == "number" || type2 == "symbol" || type2 == "boolean" || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object); } _isKey = isKey; return _isKey; } var _memoizeCapped; var hasRequired_memoizeCapped; function require_memoizeCapped() { if (hasRequired_memoizeCapped) return _memoizeCapped; hasRequired_memoizeCapped = 1; var memoize2 = memoize_1; var MAX_MEMOIZE_SIZE = 500; function memoizeCapped(func) { var result = memoize2(func, function(key) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } return key; }); var cache = result.cache; return result; } _memoizeCapped = memoizeCapped; return _memoizeCapped; } var _stringToPath; var hasRequired_stringToPath; function require_stringToPath() { if (hasRequired_stringToPath) return _stringToPath; hasRequired_stringToPath = 1; var memoizeCapped = require_memoizeCapped(); var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; var reEscapeChar = /\\(\\)?/g; var stringToPath = memoizeCapped(function(string) { var result = []; if (string.charCodeAt(0) === 46) { result.push(""); } string.replace(rePropName, function(match, number, quote, subString) { result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match); }); return result; }); _stringToPath = stringToPath; return _stringToPath; } var _arrayMap; var hasRequired_arrayMap; function require_arrayMap() { if (hasRequired_arrayMap) return _arrayMap; hasRequired_arrayMap = 1; function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } _arrayMap = arrayMap; return _arrayMap; } var _baseToString; var hasRequired_baseToString; function require_baseToString() { if (hasRequired_baseToString) return _baseToString; hasRequired_baseToString = 1; var Symbol2 = _Symbol, arrayMap = require_arrayMap(), isArray = requireIsArray(), isSymbol = requireIsSymbol(); var INFINITY = 1 / 0; var symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolToString = symbolProto ? symbolProto.toString : void 0; function baseToString(value) { if (typeof value == "string") { return value; } if (isArray(value)) { return arrayMap(value, baseToString) + ""; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ""; } var result = value + ""; return result == "0" && 1 / value == -INFINITY ? "-0" : result; } _baseToString = baseToString; return _baseToString; } var toString_1; var hasRequiredToString; function requireToString() { if (hasRequiredToString) return toString_1; hasRequiredToString = 1; var baseToString = require_baseToString(); function toString(value) { return value == null ? "" : baseToString(value); } toString_1 = toString; return toString_1; } var _castPath; var hasRequired_castPath; function require_castPath() { if (hasRequired_castPath) return _castPath; hasRequired_castPath = 1; var isArray = requireIsArray(), isKey = require_isKey(), stringToPath = require_stringToPath(), toString = requireToString(); function castPath(value, object) { if (isArray(value)) { return value; } return isKey(value, object) ? [value] : stringToPath(toString(value)); } _castPath = castPath; return _castPath; } var _toKey; var hasRequired_toKey; function require_toKey() { if (hasRequired_toKey) return _toKey; hasRequired_toKey = 1; var isSymbol = requireIsSymbol(); var INFINITY = 1 / 0; function toKey(value) { if (typeof value == "string" || isSymbol(value)) { return value; } var result = value + ""; return result == "0" && 1 / value == -INFINITY ? "-0" : result; } _toKey = toKey; return _toKey; } var _baseGet; var hasRequired_baseGet; function require_baseGet() { if (hasRequired_baseGet) return _baseGet; hasRequired_baseGet = 1; var castPath = require_castPath(), toKey = require_toKey(); function baseGet(object, path) { path = castPath(path, object); var index = 0, length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } return index && index == length ? object : void 0; } _baseGet = baseGet; return _baseGet; } var _baseAssignValue; var hasRequired_baseAssignValue; function require_baseAssignValue() { if (hasRequired_baseAssignValue) return _baseAssignValue; hasRequired_baseAssignValue = 1; var defineProperty = require_defineProperty(); function baseAssignValue(object, key, value) { if (key == "__proto__" && defineProperty) { defineProperty(object, key, { "configurable": true, "enumerable": true, "value": value, "writable": true }); } else { object[key] = value; } } _baseAssignValue = baseAssignValue; return _baseAssignValue; } var _assignValue; var hasRequired_assignValue; function require_assignValue() { if (hasRequired_assignValue) return _assignValue; hasRequired_assignValue = 1; var baseAssignValue = require_baseAssignValue(), eq2 = eq_1; var objectProto2 = Object.prototype; var hasOwnProperty2 = objectProto2.hasOwnProperty; function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty2.call(object, key) && eq2(objValue, value)) || value === void 0 && !(key in object)) { baseAssignValue(object, key, value); } } _assignValue = assignValue; return _assignValue; } var _baseSet; var hasRequired_baseSet; function require_baseSet() { if (hasRequired_baseSet) return _baseSet; hasRequired_baseSet = 1; var assignValue = require_assignValue(), castPath = require_castPath(), isIndex = require_isIndex(), isObject2 = isObject_1, toKey = require_toKey(); function baseSet(object, path, value, customizer) { if (!isObject2(object)) { return object; } path = castPath(path, object); var index = -1, length = path.length, lastIndex = length - 1, nested = object; while (nested != null && ++index < length) { var key = toKey(path[index]), newValue = value; if (key === "__proto__" || key === "constructor" || key === "prototype") { return object; } if (index != lastIndex) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : void 0; if (newValue === void 0) { newValue = isObject2(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {}; } } assignValue(nested, key, newValue); nested = nested[key]; } return object; } _baseSet = baseSet; return _baseSet; } var _basePickBy; var hasRequired_basePickBy; function require_basePickBy() { if (hasRequired_basePickBy) return _basePickBy; hasRequired_basePickBy = 1; var baseGet = require_baseGet(), baseSet = require_baseSet(), castPath = require_castPath(); function basePickBy(object, paths, predicate) { var index = -1, length = paths.length, result = {}; while (++index < length) { var path = paths[index], value = baseGet(object, path); if (predicate(value, path)) { baseSet(result, castPath(path, object), value); } } return result; } _basePickBy = basePickBy; return _basePickBy; } var _baseHasIn; var hasRequired_baseHasIn; function require_baseHasIn() { if (hasRequired_baseHasIn) return _baseHasIn; hasRequired_baseHasIn = 1; function baseHasIn(object, key) { return object != null && key in Object(object); } _baseHasIn = baseHasIn; return _baseHasIn; } var _hasPath; var hasRequired_hasPath; function require_hasPath() { if (hasRequired_hasPath) return _hasPath; hasRequired_hasPath = 1; var castPath = require_castPath(), isArguments = requireIsArguments(), isArray = requireIsArray(), isIndex = require_isIndex(), isLength = requireIsLength(), toKey = require_toKey(); function hasPath(object, path, hasFunc) { path = castPath(path, object); var index = -1, length = path.length, result = false; while (++index < length) { var key = toKey(path[index]); if (!(result = object != null && hasFunc(object, key))) { break; } object = object[key]; } if (result || ++index != length) { return result; } length = object == null ? 0 : object.length; return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); } _hasPath = hasPath; return _hasPath; } var hasIn_1; var hasRequiredHasIn; function requireHasIn() { if (hasRequiredHasIn) return hasIn_1; hasRequiredHasIn = 1; var baseHasIn = require_baseHasIn(), hasPath = require_hasPath(); function hasIn(object, path) { return object != null && hasPath(object, path, baseHasIn); } hasIn_1 = hasIn; return hasIn_1; } var _basePick; var hasRequired_basePick; function require_basePick() { if (hasRequired_basePick) return _basePick; hasRequired_basePick = 1; var basePickBy = require_basePickBy(), hasIn = requireHasIn(); function basePick(object, paths) { return basePickBy(object, paths, function(value, path) { return hasIn(object, path); }); } _basePick = basePick; return _basePick; } var _arrayPush; var hasRequired_arrayPush; function require_arrayPush() { if (hasRequired_arrayPush) return _arrayPush; hasRequired_arrayPush = 1; function arrayPush(array, values) { var index = -1, length = values.length, offset = array.length; while (++index < length) { array[offset + index] = values[index]; } return array; } _arrayPush = arrayPush; return _arrayPush; } var _isFlattenable; var hasRequired_isFlattenable; function require_isFlattenable() { if (hasRequired_isFlattenable) return _isFlattenable; hasRequired_isFlattenable = 1; var Symbol2 = _Symbol, isArguments = requireIsArguments(), isArray = requireIsArray(); var spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : void 0; function isFlattenable(value) { return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); } _isFlattenable = isFlattenable; return _isFlattenable; } var _baseFlatten; var hasRequired_baseFlatten; function require_baseFlatten() { if (hasRequired_baseFlatten) return _baseFlatten; hasRequired_baseFlatten = 1; var arrayPush = require_arrayPush(), isFlattenable = require_isFlattenable(); function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, length = array.length; predicate || (predicate = isFlattenable); result || (result = []); while (++index < length) { var value = array[index]; if (depth > 0 && predicate(value)) { if (depth > 1) { baseFlatten(value, depth - 1, predicate, isStrict, result); } else { arrayPush(result, value); } } else if (!isStrict) { result[result.length] = value; } } return result; } _baseFlatten = baseFlatten; return _baseFlatten; } var flatten_1; var hasRequiredFlatten; function requireFlatten() { if (hasRequiredFlatten) return flatten_1; hasRequiredFlatten = 1; var baseFlatten = require_baseFlatten(); function flatten(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, 1) : []; } flatten_1 = flatten; return flatten_1; } var _flatRest; var hasRequired_flatRest; function require_flatRest() { if (hasRequired_flatRest) return _flatRest; hasRequired_flatRest = 1; var flatten = requireFlatten(), overRest = require_overRest(), setToString = require_setToString(); function flatRest(func) { return setToString(overRest(func, void 0, flatten), func + ""); } _flatRest = flatRest; return _flatRest; } var pick_1; var hasRequiredPick; function requirePick() { if (hasRequiredPick) return pick_1; hasRequiredPick = 1; var basePick = require_basePick(), flatRest = require_flatRest(); var pick = flatRest(function(object, paths) { return object == null ? {} : basePick(object, paths); }); pick_1 = pick; return pick_1; } var _baseHas; var hasRequired_baseHas; function require_baseHas() { if (hasRequired_baseHas) return _baseHas; hasRequired_baseHas = 1; var objectProto2 = Object.prototype; var hasOwnProperty2 = objectProto2.hasOwnProperty; function baseHas(object, key) { return object != null && hasOwnProperty2.call(object, key); } _baseHas = baseHas; return _baseHas; } var has_1; var hasRequiredHas; function requireHas() { if (hasRequiredHas) return has_1; hasRequiredHas = 1; var baseHas = require_baseHas(), hasPath = require_hasPath(); function has(object, path) { return object != null && hasPath(object, path, baseHas); } has_1 = has; return has_1; } var _baseRange; var hasRequired_baseRange; function require_baseRange() { if (hasRequired_baseRange) return _baseRange; hasRequired_baseRange = 1; var nativeCeil = Math.ceil, nativeMax = Math.max; function baseRange(start2, end2, step, fromRight) { var index = -1, length = nativeMax(nativeCeil((end2 - start2) / (step || 1)), 0), result = Array(length); while (length--) { result[fromRight ? length : ++index] = start2; start2 += step; } return result; } _baseRange = baseRange; return _baseRange; } var _trimmedEndIndex; var hasRequired_trimmedEndIndex; function require_trimmedEndIndex() { if (hasRequired_trimmedEndIndex) return _trimmedEndIndex; hasRequired_trimmedEndIndex = 1; var reWhitespace = /\s/; function trimmedEndIndex(string) { var index = string.length; while (index-- && reWhitespace.test(string.charAt(index))) { } return index; } _trimmedEndIndex = trimmedEndIndex; return _trimmedEndIndex; } var _baseTrim; var hasRequired_baseTrim; function require_baseTrim() { if (hasRequired_baseTrim) return _baseTrim; hasRequired_baseTrim = 1; var trimmedEndIndex = require_trimmedEndIndex(); var reTrimStart = /^\s+/; function baseTrim(string) { return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string; } _baseTrim = baseTrim; return _baseTrim; } var toNumber_1; var hasRequiredToNumber; function requireToNumber() { if (hasRequiredToNumber) return toNumber_1; hasRequiredToNumber = 1; var baseTrim = require_baseTrim(), isObject2 = isObject_1, isSymbol = requireIsSymbol(); var NAN = 0 / 0; var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; var reIsBinary = /^0b[01]+$/i; var reIsOctal = /^0o[0-7]+$/i; var freeParseInt = parseInt; function toNumber(value) { if (typeof value == "number") { return value; } if (isSymbol(value)) { return NAN; } if (isObject2(value)) { var other = typeof value.valueOf == "function" ? value.valueOf() : value; value = isObject2(other) ? other + "" : other; } if (typeof value != "string") { return value === 0 ? value : +value; } value = baseTrim(value); var isBinary = reIsBinary.test(value); return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; } toNumber_1 = toNumber; return toNumber_1; } var toFinite_1; var hasRequiredToFinite; function requireToFinite() { if (hasRequiredToFinite) return toFinite_1; hasRequiredToFinite = 1; var toNumber = requireToNumber(); var INFINITY = 1 / 0, MAX_INTEGER = 17976931348623157e292; function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { var sign = value < 0 ? -1 : 1; return sign * MAX_INTEGER; } return value === value ? value : 0; } toFinite_1 = toFinite; return toFinite_1; } var _createRange; var hasRequired_createRange; function require_createRange() { if (hasRequired_createRange) return _createRange; hasRequired_createRange = 1; var baseRange = require_baseRange(), isIterateeCall = require_isIterateeCall(), toFinite = requireToFinite(); function createRange(fromRight) { return function(start2, end2, step) { if (step && typeof step != "number" && isIterateeCall(start2, end2, step)) { end2 = step = void 0; } start2 = toFinite(start2); if (end2 === void 0) { end2 = start2; start2 = 0; } else { end2 = toFinite(end2); } step = step === void 0 ? start2 < end2 ? 1 : -1 : toFinite(step); return baseRange(start2, end2, step, fromRight); }; } _createRange = createRange; return _createRange; } var range_1; var hasRequiredRange; function requireRange() { if (hasRequiredRange) return range_1; hasRequiredRange = 1; var createRange = require_createRange(); var range = createRange(); range_1 = range; return range_1; } var uniqueId_1; var hasRequiredUniqueId; function requireUniqueId() { if (hasRequiredUniqueId) return uniqueId_1; hasRequiredUniqueId = 1; var toString = requireToString(); var idCounter = 0; function uniqueId(prefix) { var id = ++idCounter; return toString(prefix) + id; } uniqueId_1 = uniqueId; return uniqueId_1; } var lodash; if (typeof commonjsRequire === "function") { try { lodash = { defaults: requireDefaults(), each: requireEach(), isFunction: isFunction_1, isPlainObject: requireIsPlainObject(), pick: requirePick(), has: requireHas(), range: requireRange(), uniqueId: requireUniqueId() }; } catch (e) { } } if (!lodash) { lodash = window._; } var lodash_1 = lodash; var _ = lodash_1; var util$1 = { isSubgraph, edgeToId, applyStyle, applyClass, applyTransition }; function isSubgraph(g, v) { return !!g.children(v).length; } function edgeToId(e) { return escapeId(e.v) + ":" + escapeId(e.w) + ":" + escapeId(e.name); } var ID_DELIM = /:/g; function escapeId(str) { return str ? String(str).replace(ID_DELIM, "\\:") : ""; } function applyStyle(dom, styleFn) { if (styleFn) { dom.attr("style", styleFn); } } function applyClass(dom, classFn, otherClasses) { if (classFn) { dom.attr("class", classFn).attr("class", otherClasses + " " + dom.attr("class")); } } function applyTransition(selection, g) { var graph = g.graph(); if (_.isPlainObject(graph)) { var transition = graph.transition; if (_.isFunction(transition)) { return transition(selection); } } return selection; } var util = util$1; var addHtmlLabel_1 = addHtmlLabel; function addHtmlLabel(root2, node) { var fo = root2.append("foreignObject").attr("width", "100000"); var div = fo.append("xhtml:div"); div.attr("xmlns", "http://www.w3.org/1999/xhtml"); var label = node.label; switch (typeof label) { case "function": div.insert(label); break; case "object": div.insert(function() { return label; }); break; default: div.html(label); } util.applyStyle(div, node.labelStyle); div.style("display", "inline-block"); div.style("white-space", "nowrap"); var client = div.node().getBoundingClientRect(); fo.attr("width", client.width).attr("height", client.height); return fo; } function question(parent, bbox, node) { const w2 = bbox.width; const h = bbox.height; const s = (w2 + h) * 0.9; const points = [ { x: s / 2, y: 0 }, { x: s, y: -s / 2 }, { x: s / 2, y: -s }, { x: 0, y: -s / 2 } ]; const shapeSvg = insertPolygonShape(parent, s, s, points); node.intersect = function(point2) { return dagreD3.intersect.polygon(node, points, point2); }; return shapeSvg; } function hexagon(parent, bbox, node) { const f = 4; const h = bbox.height; const m = h / f; const w2 = bbox.width + 2 * m; const points = [ { x: m, y: 0 }, { x: w2 - m, y: 0 }, { x: w2, y: -h / 2 }, { x: w2 - m, y: -h }, { x: m, y: -h }, { x: 0, y: -h / 2 } ]; const shapeSvg = insertPolygonShape(parent, w2, h, points); node.intersect = function(point2) { return dagreD3.intersect.polygon(node, points, point2); }; return shapeSvg; } function rect_left_inv_arrow(parent, bbox, node) { const w2 = bbox.width; const h = bbox.height; const points = [ { x: -h / 2, y: 0 }, { x: w2, y: 0 }, { x: w2, y: -h }, { x: -h / 2, y: -h }, { x: 0, y: -h / 2 } ]; const shapeSvg = insertPolygonShape(parent, w2, h, points); node.intersect = function(point2) { return dagreD3.intersect.polygon(node, points, point2); }; return shapeSvg; } function lean_right(parent, bbox, node) { const w2 = bbox.width; const h = bbox.height; const points = [ { x: -2 * h / 6, y: 0 }, { x: w2 - h / 6, y: 0 }, { x: w2 + 2 * h / 6, y: -h }, { x: h / 6, y: -h } ]; const shapeSvg = insertPolygonShape(parent, w2, h, points); node.intersect = function(point2) { return dagreD3.intersect.polygon(node, points, point2); }; return shapeSvg; } function lean_left(parent, bbox, node) { const w2 = bbox.width; const h = bbox.height; const points = [ { x: 2 * h / 6, y: 0 }, { x: w2 + h / 6, y: 0 }, { x: w2 - 2 * h / 6, y: -h }, { x: -h / 6, y: -h } ]; const shapeSvg = insertPolygonShape(parent, w2, h, points); node.intersect = function(point2) { return dagreD3.intersect.polygon(node, points, point2); }; return shapeSvg; } function trapezoid(parent, bbox, node) { const w2 = bbox.width; const h = bbox.height; const points = [ { x: -2 * h / 6, y: 0 }, { x: w2 + 2 * h / 6, y: 0 }, { x: w2 - h / 6, y: -h }, { x: h / 6, y: -h } ]; const shapeSvg = insertPolygonShape(parent, w2, h, points); node.intersect = function(point2) { return dagreD3.intersect.polygon(node, points, point2); }; return shapeSvg; } function inv_trapezoid(parent, bbox, node) { const w2 = bbox.width; const h = bbox.height; const points = [ { x: h / 6, y: 0 }, { x: w2 - h / 6, y: 0 }, { x: w2 + 2 * h / 6, y: -h }, { x: -2 * h / 6, y: -h } ]; const shapeSvg = insertPolygonShape(parent, w2, h, points); node.intersect = function(point2) { return dagreD3.intersect.polygon(node, points, point2); }; return shapeSvg; } function rect_right_inv_arrow(parent, bbox, node) { const w2 = bbox.width; const h = bbox.height; const points = [ { x: 0, y: 0 }, { x: w2 + h / 2, y: 0 }, { x: w2, y: -h / 2 }, { x: w2 + h / 2, y: -h }, { x: 0, y: -h } ]; const shapeSvg = insertPolygonShape(parent, w2, h, points); node.intersect = function(point2) { return dagreD3.intersect.polygon(node, points, point2); }; return shapeSvg; } function stadium(parent, bbox, node) { const h = bbox.height; const w2 = bbox.width + h / 4; const shapeSvg = parent.insert("rect", ":first-child").attr("rx", h / 2).attr("ry", h / 2).attr("x", -w2 / 2).attr("y", -h / 2).attr("width", w2).attr("height", h); node.intersect = function(point2) { return dagreD3.intersect.rect(node, point2); }; return shapeSvg; } function subroutine(parent, bbox, node) { const w2 = bbox.width; const h = bbox.height; const points = [ { x: 0, y: 0 }, { x: w2, y: 0 }, { x: w2, y: -h }, { x: 0, y: -h }, { x: 0, y: 0 }, { x: -8, y: 0 }, { x: w2 + 8, y: 0 }, { x: w2 + 8, y: -h }, { x: -8, y: -h }, { x: -8, y: 0 } ]; const shapeSvg = insertPolygonShape(parent, w2, h, points); node.intersect = function(point2) { return dagreD3.intersect.polygon(node, points, point2); }; return shapeSvg; } function cylinder(parent, bbox, node) { const w2 = bbox.width; const rx = w2 / 2; const ry = rx / (2.5 + w2 / 50); const h = bbox.height + ry; const shape = "M 0," + ry + " a " + rx + "," + ry + " 0,0,0 " + w2 + " 0 a " + rx + "," + ry + " 0,0,0 " + -w2 + " 0 l 0," + h + " a " + rx + "," + ry + " 0,0,0 " + w2 + " 0 l 0," + -h; const shapeSvg = parent.attr("label-offset-y", ry).insert("path", ":first-child").attr("d", shape).attr("transform", "translate(" + -w2 / 2 + "," + -(h / 2 + ry) + ")"); node.intersect = function(point2) { const pos = dagreD3.intersect.rect(node, point2); const x = pos.x - node.x; if (rx != 0 && (Math.abs(x) < node.width / 2 || Math.abs(x) == node.width / 2 && Math.abs(pos.y - node.y) > node.height / 2 - ry)) { let y = ry * ry * (1 - x * x / (rx * rx)); if (y != 0) y = Math.sqrt(y); y = ry - y; if (point2.y - node.y > 0) y = -y; pos.y += y; } return pos; }; return shapeSvg; } function addToRender(render2) { render2.shapes().question = question; render2.shapes().hexagon = hexagon; render2.shapes().stadium = stadium; render2.shapes().subroutine = subroutine; render2.shapes().cylinder = cylinder; render2.shapes().rect_left_inv_arrow = rect_left_inv_arrow; render2.shapes().lean_right = lean_right; render2.shapes().lean_left = lean_left; render2.shapes().trapezoid = trapezoid; render2.shapes().inv_trapezoid = inv_trapezoid; render2.shapes().rect_right_inv_arrow = rect_right_inv_arrow; } function addToRenderV2(addShape) { addShape({ question }); addShape({ hexagon }); addShape({ stadium }); addShape({ subroutine }); addShape({ cylinder }); addShape({ rect_left_inv_arrow }); addShape({ lean_right }); addShape({ lean_left }); addShape({ trapezoid }); addShape({ inv_trapezoid }); addShape({ rect_right_inv_arrow }); } function insertPolygonShape(parent, w2, h, points) { return parent.insert("polygon", ":first-child").attr( "points", points.map(function(d) { return d.x + "," + d.y; }).join(" ") ).attr("transform", "translate(" + -w2 / 2 + "," + h / 2 + ")"); } const flowChartShapes = { addToRender, addToRenderV2 }; const conf$8 = {}; const setConf$7 = function(cnf) { const keys = Object.keys(cnf); for (let i = 0; i < keys.length; i++) { conf$8[keys[i]] = cnf[keys[i]]; } }; const addVertices$1 = function(vert, g, svgId, root2, _doc, diagObj) { const svg = !root2 ? select(`[id="${svgId}"]`) : root2.select(`[id="${svgId}"]`); const doc = !_doc ? document : _doc; const keys = Object.keys(vert); keys.forEach(function(id) { const vertex = vert[id]; let classStr = "default"; if (vertex.classes.length > 0) { classStr = vertex.classes.join(" "); } const styles = getStylesFromArray(vertex.styles); let vertexText = vertex.text !== void 0 ? vertex.text : vertex.id; let vertexNode; if (evaluate(getConfig$1().flowchart.htmlLabels)) { const node = { label: vertexText.replace( /fa[lrsb]?:fa-[\w-]+/g, (s) => `` ) }; vertexNode = addHtmlLabel_1(svg, node).node(); vertexNode.parentNode.removeChild(vertexNode); } else { const svgLabel = doc.createElementNS("http://www.w3.org/2000/svg", "text"); svgLabel.setAttribute("style", styles.labelStyle.replace("color:", "fill:")); const rows = vertexText.split(common.lineBreakRegex); for (let j = 0; j < rows.length; j++) { const tspan = doc.createElementNS("http://www.w3.org/2000/svg", "tspan"); tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"); tspan.setAttribute("dy", "1em"); tspan.setAttribute("x", "1"); tspan.textContent = rows[j]; svgLabel.appendChild(tspan); } vertexNode = svgLabel; } let radious = 0; let _shape = ""; switch (vertex.type) { case "round": radious = 5; _shape = "rect"; break; case "square": _shape = "rect"; break; case "diamond": _shape = "question"; break; case "hexagon": _shape = "hexagon"; break; case "odd": _shape = "rect_left_inv_arrow"; break; case "lean_right": _shape = "lean_right"; break; case "lean_left": _shape = "lean_left"; break; case "trapezoid": _shape = "trapezoid"; break; case "inv_trapezoid": _shape = "inv_trapezoid"; break; case "odd_right": _shape = "rect_left_inv_arrow"; break; case "circle": _shape = "circle"; break; case "ellipse": _shape = "ellipse"; break; case "stadium": _shape = "stadium"; break; case "subroutine": _shape = "subroutine"; break; case "cylinder": _shape = "cylinder"; break; case "group": _shape = "rect"; break; default: _shape = "rect"; } log$1.warn("Adding node", vertex.id, vertex.domId); g.setNode(diagObj.db.lookUpDomId(vertex.id), { labelType: "svg", labelStyle: styles.labelStyle, shape: _shape, label: vertexNode, rx: radious, ry: radious, class: classStr, style: styles.style, id: diagObj.db.lookUpDomId(vertex.id) }); }); }; const addEdges$1 = function(edges2, g, diagObj) { let cnt2 = 0; let defaultStyle2; let defaultLabelStyle; if (typeof edges2.defaultStyle !== "undefined") { const defaultStyles = getStylesFromArray(edges2.defaultStyle); defaultStyle2 = defaultStyles.style; defaultLabelStyle = defaultStyles.labelStyle; } edges2.forEach(function(edge) { cnt2++; var linkId = "L-" + edge.start + "-" + edge.end; var linkNameStart = "LS-" + edge.start; var linkNameEnd = "LE-" + edge.end; const edgeData = {}; if (edge.type === "arrow_open") { edgeData.arrowhead = "none"; } else { edgeData.arrowhead = "normal"; } let style = ""; let labelStyle = ""; if (typeof edge.style !== "undefined") { const styles = getStylesFromArray(edge.style); style = styles.style; labelStyle = styles.labelStyle; } else { switch (edge.stroke) { case "normal": style = "fill:none"; if (typeof defaultStyle2 !== "undefined") { style = defaultStyle2; } if (typeof defaultLabelStyle !== "undefined") { labelStyle = defaultLabelStyle; } break; case "dotted": style = "fill:none;stroke-width:2px;stroke-dasharray:3;"; break; case "thick": style = " stroke-width: 3.5px;fill:none"; break; } } edgeData.style = style; edgeData.labelStyle = labelStyle; if (typeof edge.interpolate !== "undefined") { edgeData.curve = interpolateToCurve(edge.interpolate, curveLinear); } else if (typeof edges2.defaultInterpolate !== "undefined") { edgeData.curve = interpolateToCurve(edges2.defaultInterpolate, curveLinear); } else { edgeData.curve = interpolateToCurve(conf$8.curve, curveLinear); } if (typeof edge.text === "undefined") { if (typeof edge.style !== "undefined") { edgeData.arrowheadStyle = "fill: #333"; } } else { edgeData.arrowheadStyle = "fill: #333"; edgeData.labelpos = "c"; if (evaluate(getConfig$1().flowchart.htmlLabels)) { edgeData.labelType = "html"; edgeData.label = `${edge.text.replace( /fa[lrsb]?:fa-[\w-]+/g, (s) => `` )}`; } else { edgeData.labelType = "text"; edgeData.label = edge.text.replace(common.lineBreakRegex, "\n"); if (typeof edge.style === "undefined") { edgeData.style = edgeData.style || "stroke: #333; stroke-width: 1.5px;fill:none"; } edgeData.labelStyle = edgeData.labelStyle.replace("color:", "fill:"); } } edgeData.id = linkId; edgeData.class = linkNameStart + " " + linkNameEnd; edgeData.minlen = edge.length || 1; g.setEdge(diagObj.db.lookUpDomId(edge.start), diagObj.db.lookUpDomId(edge.end), edgeData, cnt2); }); }; const getClasses$3 = function(text, diagObj) { log$1.info("Extracting classes"); diagObj.db.clear(); try { diagObj.parse(text); return diagObj.db.getClasses(); } catch (e) { return; } }; const draw$a = function(text, id, _version, diagObj) { log$1.info("Drawing flowchart"); diagObj.db.clear(); const { securityLevel, flowchart: conf2 } = getConfig$1(); let sandboxElement; if (securityLevel === "sandbox") { sandboxElement = select("#i" + id); } const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; try { diagObj.parser.parse(text); } catch (err) { log$1.debug("Parsing failed"); } let dir = diagObj.db.getDirection(); if (typeof dir === "undefined") { dir = "TD"; } const nodeSpacing = conf2.nodeSpacing || 50; const rankSpacing = conf2.rankSpacing || 50; const g = new graphlib.Graph({ multigraph: true, compound: true }).setGraph({ rankdir: dir, nodesep: nodeSpacing, ranksep: rankSpacing, marginx: 8, marginy: 8 }).setDefaultEdgeLabel(function() { return {}; }); let subG; const subGraphs2 = diagObj.db.getSubGraphs(); for (let i2 = subGraphs2.length - 1; i2 >= 0; i2--) { subG = subGraphs2[i2]; diagObj.db.addVertex(subG.id, subG.title, "group", void 0, subG.classes); } const vert = diagObj.db.getVertices(); log$1.warn("Get vertices", vert); const edges2 = diagObj.db.getEdges(); let i = 0; for (i = subGraphs2.length - 1; i >= 0; i--) { subG = subGraphs2[i]; selectAll("cluster").append("text"); for (let j = 0; j < subG.nodes.length; j++) { log$1.warn( "Setting subgraph", subG.nodes[j], diagObj.db.lookUpDomId(subG.nodes[j]), diagObj.db.lookUpDomId(subG.id) ); g.setParent(diagObj.db.lookUpDomId(subG.nodes[j]), diagObj.db.lookUpDomId(subG.id)); } } addVertices$1(vert, g, id, root2, doc, diagObj); addEdges$1(edges2, g, diagObj); const Render = dagreD3.render; const render2 = new Render(); flowChartShapes.addToRender(render2); render2.arrows().none = function normal(parent, id2, edge, type2) { const marker = parent.append("marker").attr("id", id2).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"); const path = marker.append("path").attr("d", "M 0 0 L 0 0 L 0 0 z"); dagreD3.util.applyStyle(path, edge[type2 + "Style"]); }; render2.arrows().normal = function normal(parent, id2) { const marker = parent.append("marker").attr("id", id2).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"); marker.append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowheadPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); }; const svg = root2.select(`[id="${id}"]`); addSVGAccessibilityFields(diagObj.db, svg, id); const element = root2.select("#" + id + " g"); render2(element, g); element.selectAll("g.node").attr("title", function() { return diagObj.db.getTooltip(this.id); }); diagObj.db.indexNodes("subGraph" + i); for (i = 0; i < subGraphs2.length; i++) { subG = subGraphs2[i]; if (subG.title !== "undefined") { const clusterRects = doc.querySelectorAll( "#" + id + ' [id="' + diagObj.db.lookUpDomId(subG.id) + '"] rect' ); const clusterEl = doc.querySelectorAll( "#" + id + ' [id="' + diagObj.db.lookUpDomId(subG.id) + '"]' ); const xPos = clusterRects[0].x.baseVal.value; const yPos = clusterRects[0].y.baseVal.value; const _width = clusterRects[0].width.baseVal.value; const cluster = select(clusterEl[0]); const te = cluster.select(".label"); te.attr("transform", `translate(${xPos + _width / 2}, ${yPos + 14})`); te.attr("id", id + "Text"); for (let j = 0; j < subG.classes.length; j++) { clusterEl[0].classList.add(subG.classes[j]); } } } if (!conf2.htmlLabels) { const labels = doc.querySelectorAll('[id="' + id + '"] .edgeLabel .label'); for (let k = 0; k < labels.length; k++) { const label = labels[k]; const dim = label.getBBox(); const rect2 = doc.createElementNS("http://www.w3.org/2000/svg", "rect"); rect2.setAttribute("rx", 0); rect2.setAttribute("ry", 0); rect2.setAttribute("width", dim.width); rect2.setAttribute("height", dim.height); label.insertBefore(rect2, label.firstChild); } } setupGraphViewbox$1(g, svg, conf2.diagramPadding, conf2.useMaxWidth); const keys = Object.keys(vert); keys.forEach(function(key) { const vertex = vert[key]; if (vertex.link) { const node = root2.select("#" + id + ' [id="' + diagObj.db.lookUpDomId(key) + '"]'); if (node) { const link = doc.createElementNS("http://www.w3.org/2000/svg", "a"); link.setAttributeNS("http://www.w3.org/2000/svg", "class", vertex.classes.join(" ")); link.setAttributeNS("http://www.w3.org/2000/svg", "href", vertex.link); link.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"); if (securityLevel === "sandbox") { link.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top"); } else if (vertex.linkTarget) { link.setAttributeNS("http://www.w3.org/2000/svg", "target", vertex.linkTarget); } const linkNode = node.insert(function() { return link; }, ":first-child"); const shape = node.select(".label-container"); if (shape) { linkNode.append(function() { return shape.node(); }); } const label = node.select(".label"); if (label) { linkNode.append(function() { return label.node(); }); } } } }); }; const flowRenderer = { setConf: setConf$7, addVertices: addVertices$1, addEdges: addEdges$1, getClasses: getClasses$3, draw: draw$a }; const conf$7 = {}; const setConf$6 = function(cnf) { const keys = Object.keys(cnf); for (let i = 0; i < keys.length; i++) { conf$7[keys[i]] = cnf[keys[i]]; } }; const addVertices = function(vert, g, svgId, root2, doc, diagObj) { const svg = root2.select(`[id="${svgId}"]`); const keys = Object.keys(vert); keys.forEach(function(id) { const vertex = vert[id]; let classStr = "default"; if (vertex.classes.length > 0) { classStr = vertex.classes.join(" "); } const styles = getStylesFromArray(vertex.styles); let vertexText = vertex.text !== void 0 ? vertex.text : vertex.id; let vertexNode; if (evaluate(getConfig$1().flowchart.htmlLabels)) { const node = { label: vertexText.replace( /fa[lrsb]?:fa-[\w-]+/g, (s) => `` ) }; vertexNode = addHtmlLabel_1(svg, node).node(); vertexNode.parentNode.removeChild(vertexNode); } else { const svgLabel = doc.createElementNS("http://www.w3.org/2000/svg", "text"); svgLabel.setAttribute("style", styles.labelStyle.replace("color:", "fill:")); const rows = vertexText.split(common.lineBreakRegex); for (let j = 0; j < rows.length; j++) { const tspan = doc.createElementNS("http://www.w3.org/2000/svg", "tspan"); tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"); tspan.setAttribute("dy", "1em"); tspan.setAttribute("x", "1"); tspan.textContent = rows[j]; svgLabel.appendChild(tspan); } vertexNode = svgLabel; } let radious = 0; let _shape = ""; switch (vertex.type) { case "round": radious = 5; _shape = "rect"; break; case "square": _shape = "rect"; break; case "diamond": _shape = "question"; break; case "hexagon": _shape = "hexagon"; break; case "odd": _shape = "rect_left_inv_arrow"; break; case "lean_right": _shape = "lean_right"; break; case "lean_left": _shape = "lean_left"; break; case "trapezoid": _shape = "trapezoid"; break; case "inv_trapezoid": _shape = "inv_trapezoid"; break; case "odd_right": _shape = "rect_left_inv_arrow"; break; case "circle": _shape = "circle"; break; case "ellipse": _shape = "ellipse"; break; case "stadium": _shape = "stadium"; break; case "subroutine": _shape = "subroutine"; break; case "cylinder": _shape = "cylinder"; break; case "group": _shape = "rect"; break; case "doublecircle": _shape = "doublecircle"; break; default: _shape = "rect"; } g.setNode(vertex.id, { labelStyle: styles.labelStyle, shape: _shape, labelText: vertexText, rx: radious, ry: radious, class: classStr, style: styles.style, id: vertex.id, link: vertex.link, linkTarget: vertex.linkTarget, tooltip: diagObj.db.getTooltip(vertex.id) || "", domId: diagObj.db.lookUpDomId(vertex.id), haveCallback: vertex.haveCallback, width: vertex.type === "group" ? 500 : void 0, dir: vertex.dir, type: vertex.type, props: vertex.props, padding: getConfig$1().flowchart.padding }); log$1.info("setNode", { labelStyle: styles.labelStyle, shape: _shape, labelText: vertexText, rx: radious, ry: radious, class: classStr, style: styles.style, id: vertex.id, domId: diagObj.db.lookUpDomId(vertex.id), width: vertex.type === "group" ? 500 : void 0, type: vertex.type, dir: vertex.dir, props: vertex.props, padding: getConfig$1().flowchart.padding }); }); }; const addEdges = function(edges2, g, diagObj) { log$1.info("abc78 edges = ", edges2); let cnt2 = 0; let linkIdCnt = {}; let defaultStyle2; let defaultLabelStyle; if (typeof edges2.defaultStyle !== "undefined") { const defaultStyles = getStylesFromArray(edges2.defaultStyle); defaultStyle2 = defaultStyles.style; defaultLabelStyle = defaultStyles.labelStyle; } edges2.forEach(function(edge) { cnt2++; var linkIdBase = "L-" + edge.start + "-" + edge.end; if (typeof linkIdCnt[linkIdBase] === "undefined") { linkIdCnt[linkIdBase] = 0; log$1.info("abc78 new entry", linkIdBase, linkIdCnt[linkIdBase]); } else { linkIdCnt[linkIdBase]++; log$1.info("abc78 new entry", linkIdBase, linkIdCnt[linkIdBase]); } let linkId = linkIdBase + "-" + linkIdCnt[linkIdBase]; log$1.info("abc78 new link id to be used is", linkIdBase, linkId, linkIdCnt[linkIdBase]); var linkNameStart = "LS-" + edge.start; var linkNameEnd = "LE-" + edge.end; const edgeData = { style: "", labelStyle: "" }; edgeData.minlen = edge.length || 1; if (edge.type === "arrow_open") { edgeData.arrowhead = "none"; } else { edgeData.arrowhead = "normal"; } edgeData.arrowTypeStart = "arrow_open"; edgeData.arrowTypeEnd = "arrow_open"; switch (edge.type) { case "double_arrow_cross": edgeData.arrowTypeStart = "arrow_cross"; case "arrow_cross": edgeData.arrowTypeEnd = "arrow_cross"; break; case "double_arrow_point": edgeData.arrowTypeStart = "arrow_point"; case "arrow_point": edgeData.arrowTypeEnd = "arrow_point"; break; case "double_arrow_circle": edgeData.arrowTypeStart = "arrow_circle"; case "arrow_circle": edgeData.arrowTypeEnd = "arrow_circle"; break; } let style = ""; let labelStyle = ""; switch (edge.stroke) { case "normal": style = "fill:none;"; if (typeof defaultStyle2 !== "undefined") { style = defaultStyle2; } if (typeof defaultLabelStyle !== "undefined") { labelStyle = defaultLabelStyle; } edgeData.thickness = "normal"; edgeData.pattern = "solid"; break; case "dotted": edgeData.thickness = "normal"; edgeData.pattern = "dotted"; edgeData.style = "fill:none;stroke-width:2px;stroke-dasharray:3;"; break; case "thick": edgeData.thickness = "thick"; edgeData.pattern = "solid"; edgeData.style = "stroke-width: 3.5px;fill:none;"; break; case "invisible": edgeData.thickness = "invisible"; edgeData.pattern = "solid"; edgeData.style = "stroke-width: 0;fill:none;"; break; } if (typeof edge.style !== "undefined") { const styles = getStylesFromArray(edge.style); style = styles.style; labelStyle = styles.labelStyle; } edgeData.style = edgeData.style += style; edgeData.labelStyle = edgeData.labelStyle += labelStyle; if (typeof edge.interpolate !== "undefined") { edgeData.curve = interpolateToCurve(edge.interpolate, curveLinear); } else if (typeof edges2.defaultInterpolate !== "undefined") { edgeData.curve = interpolateToCurve(edges2.defaultInterpolate, curveLinear); } else { edgeData.curve = interpolateToCurve(conf$7.curve, curveLinear); } if (typeof edge.text === "undefined") { if (typeof edge.style !== "undefined") { edgeData.arrowheadStyle = "fill: #333"; } } else { edgeData.arrowheadStyle = "fill: #333"; edgeData.labelpos = "c"; } edgeData.labelType = "text"; edgeData.label = edge.text.replace(common.lineBreakRegex, "\n"); if (typeof edge.style === "undefined") { edgeData.style = edgeData.style || "stroke: #333; stroke-width: 1.5px;fill:none;"; } edgeData.labelStyle = edgeData.labelStyle.replace("color:", "fill:"); edgeData.id = linkId; edgeData.classes = "flowchart-link " + linkNameStart + " " + linkNameEnd; g.setEdge(edge.start, edge.end, edgeData, cnt2); }); }; const getClasses$2 = function(text, diagObj) { log$1.info("Extracting classes"); diagObj.db.clear(); try { diagObj.parse(text); return diagObj.db.getClasses(); } catch (e) { return; } }; const draw$9 = function(text, id, _version, diagObj) { log$1.info("Drawing flowchart"); diagObj.db.clear(); flowDb.setGen("gen-2"); diagObj.parser.parse(text); let dir = diagObj.db.getDirection(); if (typeof dir === "undefined") { dir = "TD"; } const { securityLevel, flowchart: conf2 } = getConfig$1(); const nodeSpacing = conf2.nodeSpacing || 50; const rankSpacing = conf2.rankSpacing || 50; let sandboxElement; if (securityLevel === "sandbox") { sandboxElement = select("#i" + id); } const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; const g = new graphlib.Graph({ multigraph: true, compound: true }).setGraph({ rankdir: dir, nodesep: nodeSpacing, ranksep: rankSpacing, marginx: 0, marginy: 0 }).setDefaultEdgeLabel(function() { return {}; }); let subG; const subGraphs2 = diagObj.db.getSubGraphs(); log$1.info("Subgraphs - ", subGraphs2); for (let i2 = subGraphs2.length - 1; i2 >= 0; i2--) { subG = subGraphs2[i2]; log$1.info("Subgraph - ", subG); diagObj.db.addVertex(subG.id, subG.title, "group", void 0, subG.classes, subG.dir); } const vert = diagObj.db.getVertices(); const edges2 = diagObj.db.getEdges(); log$1.info(edges2); let i = 0; for (i = subGraphs2.length - 1; i >= 0; i--) { subG = subGraphs2[i]; selectAll("cluster").append("text"); for (let j = 0; j < subG.nodes.length; j++) { log$1.info("Setting up subgraphs", subG.nodes[j], subG.id); g.setParent(subG.nodes[j], subG.id); } } addVertices(vert, g, id, root2, doc, diagObj); addEdges(edges2, g); const svg = root2.select(`[id="${id}"]`); addSVGAccessibilityFields(diagObj.db, svg, id); const element = root2.select("#" + id + " g"); render$1(element, g, ["point", "circle", "cross"], "flowchart", id); setupGraphViewbox$1(g, svg, conf2.diagramPadding, conf2.useMaxWidth); diagObj.db.indexNodes("subGraph" + i); if (!conf2.htmlLabels) { const labels = doc.querySelectorAll('[id="' + id + '"] .edgeLabel .label'); for (let k = 0; k < labels.length; k++) { const label = labels[k]; const dim = label.getBBox(); const rect2 = doc.createElementNS("http://www.w3.org/2000/svg", "rect"); rect2.setAttribute("rx", 0); rect2.setAttribute("ry", 0); rect2.setAttribute("width", dim.width); rect2.setAttribute("height", dim.height); label.insertBefore(rect2, label.firstChild); } } const keys = Object.keys(vert); keys.forEach(function(key) { const vertex = vert[key]; if (vertex.link) { const node = select("#" + id + ' [id="' + key + '"]'); if (node) { const link = doc.createElementNS("http://www.w3.org/2000/svg", "a"); link.setAttributeNS("http://www.w3.org/2000/svg", "class", vertex.classes.join(" ")); link.setAttributeNS("http://www.w3.org/2000/svg", "href", vertex.link); link.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"); if (securityLevel === "sandbox") { link.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top"); } else if (vertex.linkTarget) { link.setAttributeNS("http://www.w3.org/2000/svg", "target", vertex.linkTarget); } const linkNode = node.insert(function() { return link; }, ":first-child"); const shape = node.select(".label-container"); if (shape) { linkNode.append(function() { return shape.node(); }); } const label = node.select(".label"); if (label) { linkNode.append(function() { return label.node(); }); } } } }); }; const flowRendererV2 = { setConf: setConf$6, addVertices, addEdges, getClasses: getClasses$2, draw: draw$9 }; var parser$6 = function() { var o = function(k, v, o2, l) { for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ; return o2; }, $V0 = [1, 3], $V1 = [1, 5], $V2 = [7, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 24, 25, 27, 34, 39], $V3 = [1, 15], $V4 = [1, 16], $V5 = [1, 17], $V6 = [1, 18], $V7 = [1, 19], $V8 = [1, 20], $V9 = [1, 21], $Va = [1, 22], $Vb = [1, 23], $Vc = [1, 24], $Vd = [1, 25], $Ve = [1, 26], $Vf = [1, 28], $Vg = [1, 30], $Vh = [1, 33], $Vi = [5, 7, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 24, 25, 27, 34, 39]; var parser2 = { trace: function trace() { }, yy: {}, symbols_: { "error": 2, "start": 3, "directive": 4, "gantt": 5, "document": 6, "EOF": 7, "line": 8, "SPACE": 9, "statement": 10, "NL": 11, "dateFormat": 12, "inclusiveEndDates": 13, "topAxis": 14, "axisFormat": 15, "excludes": 16, "includes": 17, "todayMarker": 18, "title": 19, "acc_title": 20, "acc_title_value": 21, "acc_descr": 22, "acc_descr_value": 23, "acc_descr_multiline_value": 24, "section": 25, "clickStatement": 26, "taskTxt": 27, "taskData": 28, "openDirective": 29, "typeDirective": 30, "closeDirective": 31, ":": 32, "argDirective": 33, "click": 34, "callbackname": 35, "callbackargs": 36, "href": 37, "clickStatementDebug": 38, "open_directive": 39, "type_directive": 40, "arg_directive": 41, "close_directive": 42, "$accept": 0, "$end": 1 }, terminals_: { 2: "error", 5: "gantt", 7: "EOF", 9: "SPACE", 11: "NL", 12: "dateFormat", 13: "inclusiveEndDates", 14: "topAxis", 15: "axisFormat", 16: "excludes", 17: "includes", 18: "todayMarker", 19: "title", 20: "acc_title", 21: "acc_title_value", 22: "acc_descr", 23: "acc_descr_value", 24: "acc_descr_multiline_value", 25: "section", 27: "taskTxt", 28: "taskData", 32: ":", 34: "click", 35: "callbackname", 36: "callbackargs", 37: "href", 39: "open_directive", 40: "type_directive", 41: "arg_directive", 42: "close_directive" }, productions_: [0, [3, 2], [3, 3], [6, 0], [6, 2], [8, 2], [8, 1], [8, 1], [8, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [10, 1], [10, 1], [10, 1], [10, 2], [10, 1], [4, 4], [4, 6], [26, 2], [26, 3], [26, 3], [26, 4], [26, 3], [26, 4], [26, 2], [38, 2], [38, 3], [38, 3], [38, 4], [38, 3], [38, 4], [38, 2], [29, 1], [30, 1], [33, 1], [31, 1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { var $0 = $$.length - 1; switch (yystate) { case 2: return $$[$0 - 1]; case 3: this.$ = []; break; case 4: $$[$0 - 1].push($$[$0]); this.$ = $$[$0 - 1]; break; case 5: case 6: this.$ = $$[$0]; break; case 7: case 8: this.$ = []; break; case 9: yy.setDateFormat($$[$0].substr(11)); this.$ = $$[$0].substr(11); break; case 10: yy.enableInclusiveEndDates(); this.$ = $$[$0].substr(18); break; case 11: yy.TopAxis(); this.$ = $$[$0].substr(8); break; case 12: yy.setAxisFormat($$[$0].substr(11)); this.$ = $$[$0].substr(11); break; case 13: yy.setExcludes($$[$0].substr(9)); this.$ = $$[$0].substr(9); break; case 14: yy.setIncludes($$[$0].substr(9)); this.$ = $$[$0].substr(9); break; case 15: yy.setTodayMarker($$[$0].substr(12)); this.$ = $$[$0].substr(12); break; case 16: yy.setDiagramTitle($$[$0].substr(6)); this.$ = $$[$0].substr(6); break; case 17: this.$ = $$[$0].trim(); yy.setAccTitle(this.$); break; case 18: case 19: this.$ = $$[$0].trim(); yy.setAccDescription(this.$); break; case 20: yy.addSection($$[$0].substr(8)); this.$ = $$[$0].substr(8); break; case 22: yy.addTask($$[$0 - 1], $$[$0]); this.$ = "task"; break; case 26: this.$ = $$[$0 - 1]; yy.setClickEvent($$[$0 - 1], $$[$0], null); break; case 27: this.$ = $$[$0 - 2]; yy.setClickEvent($$[$0 - 2], $$[$0 - 1], $$[$0]); break; case 28: this.$ = $$[$0 - 2]; yy.setClickEvent($$[$0 - 2], $$[$0 - 1], null); yy.setLink($$[$0 - 2], $$[$0]); break; case 29: this.$ = $$[$0 - 3]; yy.setClickEvent($$[$0 - 3], $$[$0 - 2], $$[$0 - 1]); yy.setLink($$[$0 - 3], $$[$0]); break; case 30: this.$ = $$[$0 - 2]; yy.setClickEvent($$[$0 - 2], $$[$0], null); yy.setLink($$[$0 - 2], $$[$0 - 1]); break; case 31: this.$ = $$[$0 - 3]; yy.setClickEvent($$[$0 - 3], $$[$0 - 1], $$[$0]); yy.setLink($$[$0 - 3], $$[$0 - 2]); break; case 32: this.$ = $$[$0 - 1]; yy.setLink($$[$0 - 1], $$[$0]); break; case 33: case 39: this.$ = $$[$0 - 1] + " " + $$[$0]; break; case 34: case 35: case 37: this.$ = $$[$0 - 2] + " " + $$[$0 - 1] + " " + $$[$0]; break; case 36: case 38: this.$ = $$[$0 - 3] + " " + $$[$0 - 2] + " " + $$[$0 - 1] + " " + $$[$0]; break; case 40: yy.parseDirective("%%{", "open_directive"); break; case 41: yy.parseDirective($$[$0], "type_directive"); break; case 42: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], "arg_directive"); break; case 43: yy.parseDirective("}%%", "close_directive", "gantt"); break; } }, table: [{ 3: 1, 4: 2, 5: $V0, 29: 4, 39: $V1 }, { 1: [3] }, { 3: 6, 4: 2, 5: $V0, 29: 4, 39: $V1 }, o($V2, [2, 3], { 6: 7 }), { 30: 8, 40: [1, 9] }, { 40: [2, 40] }, { 1: [2, 1] }, { 4: 29, 7: [1, 10], 8: 11, 9: [1, 12], 10: 13, 11: [1, 14], 12: $V3, 13: $V4, 14: $V5, 15: $V6, 16: $V7, 17: $V8, 18: $V9, 19: $Va, 20: $Vb, 22: $Vc, 24: $Vd, 25: $Ve, 26: 27, 27: $Vf, 29: 4, 34: $Vg, 39: $V1 }, { 31: 31, 32: [1, 32], 42: $Vh }, o([32, 42], [2, 41]), o($V2, [2, 8], { 1: [2, 2] }), o($V2, [2, 4]), { 4: 29, 10: 34, 12: $V3, 13: $V4, 14: $V5, 15: $V6, 16: $V7, 17: $V8, 18: $V9, 19: $Va, 20: $Vb, 22: $Vc, 24: $Vd, 25: $Ve, 26: 27, 27: $Vf, 29: 4, 34: $Vg, 39: $V1 }, o($V2, [2, 6]), o($V2, [2, 7]), o($V2, [2, 9]), o($V2, [2, 10]), o($V2, [2, 11]), o($V2, [2, 12]), o($V2, [2, 13]), o($V2, [2, 14]), o($V2, [2, 15]), o($V2, [2, 16]), { 21: [1, 35] }, { 23: [1, 36] }, o($V2, [2, 19]), o($V2, [2, 20]), o($V2, [2, 21]), { 28: [1, 37] }, o($V2, [2, 23]), { 35: [1, 38], 37: [1, 39] }, { 11: [1, 40] }, { 33: 41, 41: [1, 42] }, { 11: [2, 43] }, o($V2, [2, 5]), o($V2, [2, 17]), o($V2, [2, 18]), o($V2, [2, 22]), o($V2, [2, 26], { 36: [1, 43], 37: [1, 44] }), o($V2, [2, 32], { 35: [1, 45] }), o($Vi, [2, 24]), { 31: 46, 42: $Vh }, { 42: [2, 42] }, o($V2, [2, 27], { 37: [1, 47] }), o($V2, [2, 28]), o($V2, [2, 30], { 36: [1, 48] }), { 11: [1, 49] }, o($V2, [2, 29]), o($V2, [2, 31]), o($Vi, [2, 25])], defaultActions: { 5: [2, 40], 6: [2, 1], 33: [2, 43], 42: [2, 42] }, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse2(input) { var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer2 = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer2.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer2; sharedState.yy.parser = this; if (typeof lexer2.yylloc == "undefined") { lexer2.yylloc = {}; } var yyloc = lexer2.yylloc; lstack.push(yyloc); var ranges = lexer2.options && lexer2.options.ranges; if (typeof sharedState.yy.parseError === "function") { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function lex() { var token; token = tstack.pop() || lexer2.lex() || EOF; if (typeof token !== "number") { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self2.symbols_[token] || token; } return token; } var symbol, state, action, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push("'" + this.terminals_[p] + "'"); } } if (lexer2.showPosition) { errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; } else { errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); } this.parseError(errStr, { text: lexer2.match, token: this.terminals_[symbol] || symbol, line: lexer2.yylineno, loc: yyloc, expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer2.yytext); lstack.push(lexer2.yylloc); stack.push(action[1]); symbol = null; { yyleng = lexer2.yyleng; yytext = lexer2.yytext; yylineno = lexer2.yylineno; yyloc = lexer2.yylloc; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== "undefined") { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; } }; var lexer = function() { var lexer2 = { EOF: 1, parseError: function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, setInput: function(input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; this.yylineno = this.yyleng = 0; this.yytext = this.matched = this.match = ""; this.conditionStack = ["INITIAL"]; this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; if (this.options.ranges) { this.yylloc.range = [0, 0]; } this.offset = 0; return this; }, input: function() { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, unput: function(ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); this.offset -= len; var oldLines = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1); this.matched = this.matched.substr(0, this.matched.length - 1); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, more: function() { this._more = true; return this; }, reject: function() { if (this.options.backtrack_lexer) { this._backtrack = true; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, less: function(n) { this.unput(this.match.slice(n)); }, pastInput: function() { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); }, upcomingInput: function() { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20 - next.length); } return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, ""); }, showPosition: function() { var pre = this.pastInput(); var c2 = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c2 + "^"; }, test_match: function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { backup = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { for (var k in backup) { this[k] = backup[k]; } return false; } return false; }, next: function() { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ""; this.match = ""; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; } else { return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } return false; } if (this._input === "") { return this.EOF; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, lex: function lex() { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, begin: function begin(condition) { this.conditionStack.push(condition); }, popState: function popState() { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, _currentRules: function _currentRules() { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, topState: function topState(n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, pushState: function pushState(condition) { this.begin(condition); }, stateStackSize: function stateStackSize() { return this.conditionStack.length; }, options: { "case-insensitive": true }, performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { switch ($avoiding_name_collisions) { case 0: this.begin("open_directive"); return 39; case 1: this.begin("type_directive"); return 40; case 2: this.popState(); this.begin("arg_directive"); return 32; case 3: this.popState(); this.popState(); return 42; case 4: return 41; case 5: this.begin("acc_title"); return 20; case 6: this.popState(); return "acc_title_value"; case 7: this.begin("acc_descr"); return 22; case 8: this.popState(); return "acc_descr_value"; case 9: this.begin("acc_descr_multiline"); break; case 10: this.popState(); break; case 11: return "acc_descr_multiline_value"; case 12: break; case 13: break; case 14: break; case 15: return 11; case 16: break; case 17: break; case 18: break; case 19: this.begin("href"); break; case 20: this.popState(); break; case 21: return 37; case 22: this.begin("callbackname"); break; case 23: this.popState(); break; case 24: this.popState(); this.begin("callbackargs"); break; case 25: return 35; case 26: this.popState(); break; case 27: return 36; case 28: this.begin("click"); break; case 29: this.popState(); break; case 30: return 34; case 31: return 5; case 32: return 12; case 33: return 13; case 34: return 14; case 35: return 15; case 36: return 17; case 37: return 16; case 38: return 18; case 39: return "date"; case 40: return 19; case 41: return "accDescription"; case 42: return 25; case 43: return 27; case 44: return 28; case 45: return 32; case 46: return 7; case 47: return "INVALID"; } }, rules: [/^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:%%(?!\{)*[^\n]*)/i, /^(?:[^\}]%%*[^\n]*)/i, /^(?:%%*[^\n]*[\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:href[\s]+["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:call[\s]+)/i, /^(?:\([\s]*\))/i, /^(?:\()/i, /^(?:[^(]*)/i, /^(?:\))/i, /^(?:[^)]*)/i, /^(?:click[\s]+)/i, /^(?:[\s\n])/i, /^(?:[^\s\n]*)/i, /^(?:gantt\b)/i, /^(?:dateFormat\s[^#\n;]+)/i, /^(?:inclusiveEndDates\b)/i, /^(?:topAxis\b)/i, /^(?:axisFormat\s[^#\n;]+)/i, /^(?:includes\s[^#\n;]+)/i, /^(?:excludes\s[^#\n;]+)/i, /^(?:todayMarker\s[^\n;]+)/i, /^(?:\d\d\d\d-\d\d-\d\d\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:accDescription\s[^#\n;]+)/i, /^(?:section\s[^#:\n;]+)/i, /^(?:[^#:\n;]+)/i, /^(?::[^#\n;]+)/i, /^(?::)/i, /^(?:$)/i, /^(?:.)/i], conditions: { "acc_descr_multiline": { "rules": [10, 11], "inclusive": false }, "acc_descr": { "rules": [8], "inclusive": false }, "acc_title": { "rules": [6], "inclusive": false }, "close_directive": { "rules": [], "inclusive": false }, "arg_directive": { "rules": [3, 4], "inclusive": false }, "type_directive": { "rules": [2, 3], "inclusive": false }, "open_directive": { "rules": [1], "inclusive": false }, "callbackargs": { "rules": [26, 27], "inclusive": false }, "callbackname": { "rules": [23, 24, 25], "inclusive": false }, "href": { "rules": [20, 21], "inclusive": false }, "click": { "rules": [29, 30], "inclusive": false }, "INITIAL": { "rules": [0, 5, 7, 9, 12, 13, 14, 15, 16, 17, 18, 19, 22, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47], "inclusive": true } } }; return lexer2; }(); parser2.lexer = lexer; function Parser() { this.yy = {}; } Parser.prototype = parser2; parser2.Parser = Parser; return new Parser(); }(); parser$6.parser = parser$6; const ganttDetector = (txt) => { return txt.match(/^\s*gantt/) !== null; }; let dateFormat = ""; let axisFormat = ""; let todayMarker = ""; let includes = []; let excludes = []; let links = {}; let sections$2 = []; let tasks$1 = []; let currentSection$1 = ""; const tags = ["active", "done", "crit", "milestone"]; let funs = []; let inclusiveEndDates = false; let topAxis = false; let lastOrder = 0; const parseDirective$6 = function(statement, context, type2) { mermaidAPI.parseDirective(this, statement, context, type2); }; const clear$5 = function() { sections$2 = []; tasks$1 = []; currentSection$1 = ""; funs = []; taskCnt = 0; lastTask = void 0; lastTaskID = void 0; rawTasks$1 = []; dateFormat = ""; axisFormat = ""; todayMarker = ""; includes = []; excludes = []; inclusiveEndDates = false; topAxis = false; lastOrder = 0; links = {}; clear$g(); }; const setAxisFormat = function(txt) { axisFormat = txt; }; const getAxisFormat = function() { return axisFormat; }; const setTodayMarker = function(txt) { todayMarker = txt; }; const getTodayMarker = function() { return todayMarker; }; const setDateFormat = function(txt) { dateFormat = txt; }; const enableInclusiveEndDates = function() { inclusiveEndDates = true; }; const endDatesAreInclusive = function() { return inclusiveEndDates; }; const enableTopAxis = function() { topAxis = true; }; const topAxisEnabled = function() { return topAxis; }; const getDateFormat = function() { return dateFormat; }; const setIncludes = function(txt) { includes = txt.toLowerCase().split(/[\s,]+/); }; const getIncludes = function() { return includes; }; const setExcludes = function(txt) { excludes = txt.toLowerCase().split(/[\s,]+/); }; const getExcludes = function() { return excludes; }; const getLinks = function() { return links; }; const addSection$2 = function(txt) { currentSection$1 = txt; sections$2.push(txt); }; const getSections$2 = function() { return sections$2; }; const getTasks$1 = function() { let allItemsPricessed = compileTasks$1(); const maxDepth = 10; let iterationCount = 0; while (!allItemsPricessed && iterationCount < maxDepth) { allItemsPricessed = compileTasks$1(); iterationCount++; } tasks$1 = rawTasks$1; return tasks$1; }; const isInvalidDate = function(date, dateFormat2, excludes2, includes2) { if (includes2.indexOf(date.format(dateFormat2.trim())) >= 0) { return false; } if (date.isoWeekday() >= 6 && excludes2.indexOf("weekends") >= 0) { return true; } if (excludes2.indexOf(date.format("dddd").toLowerCase()) >= 0) { return true; } return excludes2.indexOf(date.format(dateFormat2.trim())) >= 0; }; const checkTaskDates = function(task, dateFormat2, excludes2, includes2) { if (!excludes2.length || task.manualEndTime) return; let startTime = moment(task.startTime, dateFormat2, true); startTime.add(1, "d"); let endTime = moment(task.endTime, dateFormat2, true); let renderEndTime = fixTaskDates(startTime, endTime, dateFormat2, excludes2, includes2); task.endTime = endTime.toDate(); task.renderEndTime = renderEndTime; }; const fixTaskDates = function(startTime, endTime, dateFormat2, excludes2, includes2) { let invalid = false; let renderEndTime = null; while (startTime <= endTime) { if (!invalid) { renderEndTime = endTime.toDate(); } invalid = isInvalidDate(startTime, dateFormat2, excludes2, includes2); if (invalid) { endTime.add(1, "d"); } startTime.add(1, "d"); } return renderEndTime; }; const getStartDate = function(prevTime, dateFormat2, str) { str = str.trim(); const re = /^after\s+([\d\w- ]+)/; const afterStatement = re.exec(str.trim()); if (afterStatement !== null) { let latestEndingTask = null; afterStatement[1].split(" ").forEach(function(id) { let task = findTaskById(id); if (typeof task !== "undefined") { if (!latestEndingTask) { latestEndingTask = task; } else { if (task.endTime > latestEndingTask.endTime) { latestEndingTask = task; } } } }); if (!latestEndingTask) { const dt = new Date(); dt.setHours(0, 0, 0, 0); return dt; } else { return latestEndingTask.endTime; } } let mDate = moment(str, dateFormat2.trim(), true); if (mDate.isValid()) { return mDate.toDate(); } else { log$1.debug("Invalid date:" + str); log$1.debug("With date format:" + dateFormat2.trim()); const d = new Date(str); if (typeof d === "undefined" || isNaN(d.getTime())) { throw new Error("Invalid date:" + str); } return d; } }; const parseDuration = function(str) { const statement = /^(\d+(?:\.\d+)?)([yMwdhms]|ms)$/.exec(str.trim()); if (statement !== null) { return moment.duration(Number.parseFloat(statement[1]), statement[2]); } return moment.duration.invalid(); }; const getEndDate = function(prevTime, dateFormat2, str, inclusive) { inclusive = inclusive || false; str = str.trim(); let mDate = moment(str, dateFormat2.trim(), true); if (mDate.isValid()) { if (inclusive) { mDate.add(1, "d"); } return mDate.toDate(); } const endTime = moment(prevTime); const duration = parseDuration(str); if (duration.isValid()) { endTime.add(duration); } return endTime.toDate(); }; let taskCnt = 0; const parseId = function(idStr) { if (typeof idStr === "undefined") { taskCnt = taskCnt + 1; return "task" + taskCnt; } return idStr; }; const compileData = function(prevTask, dataStr) { let ds; if (dataStr.substr(0, 1) === ":") { ds = dataStr.substr(1, dataStr.length); } else { ds = dataStr; } const data = ds.split(","); const task = {}; getTaskTags(data, task, tags); for (let i = 0; i < data.length; i++) { data[i] = data[i].trim(); } let endTimeData = ""; switch (data.length) { case 1: task.id = parseId(); task.startTime = prevTask.endTime; endTimeData = data[0]; break; case 2: task.id = parseId(); task.startTime = getStartDate(void 0, dateFormat, data[0]); endTimeData = data[1]; break; case 3: task.id = parseId(data[0]); task.startTime = getStartDate(void 0, dateFormat, data[1]); endTimeData = data[2]; break; } if (endTimeData) { task.endTime = getEndDate(task.startTime, dateFormat, endTimeData, inclusiveEndDates); task.manualEndTime = moment(endTimeData, "YYYY-MM-DD", true).isValid(); checkTaskDates(task, dateFormat, excludes, includes); } return task; }; const parseData = function(prevTaskId, dataStr) { let ds; if (dataStr.substr(0, 1) === ":") { ds = dataStr.substr(1, dataStr.length); } else { ds = dataStr; } const data = ds.split(","); const task = {}; getTaskTags(data, task, tags); for (let i = 0; i < data.length; i++) { data[i] = data[i].trim(); } switch (data.length) { case 1: task.id = parseId(); task.startTime = { type: "prevTaskEnd", id: prevTaskId }; task.endTime = { data: data[0] }; break; case 2: task.id = parseId(); task.startTime = { type: "getStartDate", startData: data[0] }; task.endTime = { data: data[1] }; break; case 3: task.id = parseId(data[0]); task.startTime = { type: "getStartDate", startData: data[1] }; task.endTime = { data: data[2] }; break; } return task; }; let lastTask; let lastTaskID; let rawTasks$1 = []; const taskDb = {}; const addTask$1 = function(descr, data) { const rawTask = { section: currentSection$1, type: currentSection$1, processed: false, manualEndTime: false, renderEndTime: null, raw: { data }, task: descr, classes: [] }; const taskInfo = parseData(lastTaskID, data); rawTask.raw.startTime = taskInfo.startTime; rawTask.raw.endTime = taskInfo.endTime; rawTask.id = taskInfo.id; rawTask.prevTaskId = lastTaskID; rawTask.active = taskInfo.active; rawTask.done = taskInfo.done; rawTask.crit = taskInfo.crit; rawTask.milestone = taskInfo.milestone; rawTask.order = lastOrder; lastOrder++; const pos = rawTasks$1.push(rawTask); lastTaskID = rawTask.id; taskDb[rawTask.id] = pos - 1; }; const findTaskById = function(id) { const pos = taskDb[id]; return rawTasks$1[pos]; }; const addTaskOrg$1 = function(descr, data) { const newTask = { section: currentSection$1, type: currentSection$1, description: descr, task: descr, classes: [] }; const taskInfo = compileData(lastTask, data); newTask.startTime = taskInfo.startTime; newTask.endTime = taskInfo.endTime; newTask.id = taskInfo.id; newTask.active = taskInfo.active; newTask.done = taskInfo.done; newTask.crit = taskInfo.crit; newTask.milestone = taskInfo.milestone; lastTask = newTask; tasks$1.push(newTask); }; const compileTasks$1 = function() { const compileTask = function(pos) { const task = rawTasks$1[pos]; let startTime = ""; switch (rawTasks$1[pos].raw.startTime.type) { case "prevTaskEnd": { const prevTask = findTaskById(task.prevTaskId); task.startTime = prevTask.endTime; break; } case "getStartDate": startTime = getStartDate(void 0, dateFormat, rawTasks$1[pos].raw.startTime.startData); if (startTime) { rawTasks$1[pos].startTime = startTime; } break; } if (rawTasks$1[pos].startTime) { rawTasks$1[pos].endTime = getEndDate( rawTasks$1[pos].startTime, dateFormat, rawTasks$1[pos].raw.endTime.data, inclusiveEndDates ); if (rawTasks$1[pos].endTime) { rawTasks$1[pos].processed = true; rawTasks$1[pos].manualEndTime = moment( rawTasks$1[pos].raw.endTime.data, "YYYY-MM-DD", true ).isValid(); checkTaskDates(rawTasks$1[pos], dateFormat, excludes, includes); } } return rawTasks$1[pos].processed; }; let allProcessed = true; for (let i = 0; i < rawTasks$1.length; i++) { compileTask(i); allProcessed = allProcessed && rawTasks$1[i].processed; } return allProcessed; }; const setLink = function(ids, _linkStr) { let linkStr = _linkStr; if (getConfig$1().securityLevel !== "loose") { linkStr = sanitizeUrl(_linkStr); } ids.split(",").forEach(function(id) { let rawTask = findTaskById(id); if (typeof rawTask !== "undefined") { pushFun(id, () => { window.open(linkStr, "_self"); }); links[id] = linkStr; } }); setClass(ids, "clickable"); }; const setClass = function(ids, className) { ids.split(",").forEach(function(id) { let rawTask = findTaskById(id); if (typeof rawTask !== "undefined") { rawTask.classes.push(className); } }); }; const setClickFun = function(id, functionName, functionArgs) { if (getConfig$1().securityLevel !== "loose") { return; } if (typeof functionName === "undefined") { return; } let argList = []; if (typeof functionArgs === "string") { argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); for (let i = 0; i < argList.length; i++) { let item = argList[i].trim(); if (item.charAt(0) === '"' && item.charAt(item.length - 1) === '"') { item = item.substr(1, item.length - 2); } argList[i] = item; } } if (argList.length === 0) { argList.push(id); } let rawTask = findTaskById(id); if (typeof rawTask !== "undefined") { pushFun(id, () => { utils.runFunc(functionName, ...argList); }); } }; const pushFun = function(id, callbackFunction) { funs.push(function() { const elem = document.querySelector(`[id="${id}"]`); if (elem !== null) { elem.addEventListener("click", function() { callbackFunction(); }); } }); funs.push(function() { const elem = document.querySelector(`[id="${id}-text"]`); if (elem !== null) { elem.addEventListener("click", function() { callbackFunction(); }); } }); }; const setClickEvent = function(ids, functionName, functionArgs) { ids.split(",").forEach(function(id) { setClickFun(id, functionName, functionArgs); }); setClass(ids, "clickable"); }; const bindFunctions = function(element) { funs.forEach(function(fun) { fun(element); }); }; const ganttDb = { parseDirective: parseDirective$6, getConfig: () => getConfig$1().gantt, clear: clear$5, setDateFormat, getDateFormat, enableInclusiveEndDates, endDatesAreInclusive, enableTopAxis, topAxisEnabled, setAxisFormat, getAxisFormat, setTodayMarker, getTodayMarker, setAccTitle, getAccTitle, setDiagramTitle, getDiagramTitle, setAccDescription, getAccDescription, addSection: addSection$2, getSections: getSections$2, getTasks: getTasks$1, addTask: addTask$1, findTaskById, addTaskOrg: addTaskOrg$1, setIncludes, getIncludes, setExcludes, getExcludes, setClickEvent, setLink, getLinks, bindFunctions, parseDuration, isInvalidDate }; function getTaskTags(data, task, tags2) { let matchFound = true; while (matchFound) { matchFound = false; tags2.forEach(function(t) { const pattern = "^\\s*" + t + "\\s*$"; const regex = new RegExp(pattern); if (data[0].match(regex)) { task[t] = true; data.shift(1); matchFound = true; } }); } } const setConf$5 = function() { log$1.debug("Something is calling, setConf, remove the call"); }; let w; const draw$8 = function(text, id, version2, diagObj) { const conf2 = getConfig$1().gantt; const securityLevel = getConfig$1().securityLevel; let sandboxElement; if (securityLevel === "sandbox") { sandboxElement = select("#i" + id); } const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; const elem = doc.getElementById(id); w = elem.parentElement.offsetWidth; if (typeof w === "undefined") { w = 1200; } if (typeof conf2.useWidth !== "undefined") { w = conf2.useWidth; } const taskArray = diagObj.db.getTasks(); const h = taskArray.length * (conf2.barHeight + conf2.barGap) + 2 * conf2.topPadding; elem.setAttribute("viewBox", "0 0 " + w + " " + h); const svg = root2.select(`[id="${id}"]`); const timeScale = scaleTime().domain([ min(taskArray, function(d) { return d.startTime; }), max(taskArray, function(d) { return d.endTime; }) ]).rangeRound([0, w - conf2.leftPadding - conf2.rightPadding]); let categories = []; for (let i = 0; i < taskArray.length; i++) { categories.push(taskArray[i].type); } const catsUnfiltered = categories; categories = checkUnique(categories); function taskCompare(a, b) { const taskA = a.startTime; const taskB = b.startTime; let result = 0; if (taskA > taskB) { result = 1; } else if (taskA < taskB) { result = -1; } return result; } taskArray.sort(taskCompare); makeGant(taskArray, w, h); configureSvgSize(svg, h, w, conf2.useMaxWidth); svg.append("text").text(diagObj.db.getDiagramTitle()).attr("x", w / 2).attr("y", conf2.titleTopMargin).attr("class", "titleText"); addSVGAccessibilityFields(diagObj.db, svg, id); function makeGant(tasks2, pageWidth, pageHeight) { const barHeight = conf2.barHeight; const gap = barHeight + conf2.barGap; const topPadding = conf2.topPadding; const leftPadding = conf2.leftPadding; const colorScale = scaleLinear().domain([0, categories.length]).range(["#00B9FA", "#F95002"]).interpolate(interpolateHcl); drawExcludeDays( gap, topPadding, leftPadding, pageWidth, pageHeight, tasks2, diagObj.db.getExcludes(), diagObj.db.getIncludes() ); makeGrid(leftPadding, topPadding, pageWidth, pageHeight); drawRects(tasks2, gap, topPadding, leftPadding, barHeight, colorScale, pageWidth); vertLabels(gap, topPadding); drawToday(leftPadding, topPadding, pageWidth, pageHeight); } function drawRects(theArray, theGap, theTopPad, theSidePad, theBarHeight, theColorScale, w2) { svg.append("g").selectAll("rect").data(theArray).enter().append("rect").attr("x", 0).attr("y", function(d, i) { i = d.order; return i * theGap + theTopPad - 2; }).attr("width", function() { return w2 - conf2.rightPadding / 2; }).attr("height", theGap).attr("class", function(d) { for (let i = 0; i < categories.length; i++) { if (d.type === categories[i]) { return "section section" + i % conf2.numberSectionStyles; } } return "section section0"; }); const rectangles = svg.append("g").selectAll("rect").data(theArray).enter(); const links2 = diagObj.db.getLinks(); rectangles.append("rect").attr("id", function(d) { return d.id; }).attr("rx", 3).attr("ry", 3).attr("x", function(d) { if (d.milestone) { return timeScale(d.startTime) + theSidePad + 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight; } return timeScale(d.startTime) + theSidePad; }).attr("y", function(d, i) { i = d.order; return i * theGap + theTopPad; }).attr("width", function(d) { if (d.milestone) { return theBarHeight; } return timeScale(d.renderEndTime || d.endTime) - timeScale(d.startTime); }).attr("height", theBarHeight).attr("transform-origin", function(d, i) { i = d.order; return (timeScale(d.startTime) + theSidePad + 0.5 * (timeScale(d.endTime) - timeScale(d.startTime))).toString() + "px " + (i * theGap + theTopPad + 0.5 * theBarHeight).toString() + "px"; }).attr("class", function(d) { const res = "task"; let classStr = ""; if (d.classes.length > 0) { classStr = d.classes.join(" "); } let secNum = 0; for (let i = 0; i < categories.length; i++) { if (d.type === categories[i]) { secNum = i % conf2.numberSectionStyles; } } let taskClass = ""; if (d.active) { if (d.crit) { taskClass += " activeCrit"; } else { taskClass = " active"; } } else if (d.done) { if (d.crit) { taskClass = " doneCrit"; } else { taskClass = " done"; } } else { if (d.crit) { taskClass += " crit"; } } if (taskClass.length === 0) { taskClass = " task"; } if (d.milestone) { taskClass = " milestone " + taskClass; } taskClass += secNum; taskClass += " " + classStr; return res + taskClass; }); rectangles.append("text").attr("id", function(d) { return d.id + "-text"; }).text(function(d) { return d.task; }).attr("font-size", conf2.fontSize).attr("x", function(d) { let startX = timeScale(d.startTime); let endX = timeScale(d.renderEndTime || d.endTime); if (d.milestone) { startX += 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight; } if (d.milestone) { endX = startX + theBarHeight; } const textWidth = this.getBBox().width; if (textWidth > endX - startX) { if (endX + textWidth + 1.5 * conf2.leftPadding > w2) { return startX + theSidePad - 5; } else { return endX + theSidePad + 5; } } else { return (endX - startX) / 2 + startX + theSidePad; } }).attr("y", function(d, i) { i = d.order; return i * theGap + conf2.barHeight / 2 + (conf2.fontSize / 2 - 2) + theTopPad; }).attr("text-height", theBarHeight).attr("class", function(d) { const startX = timeScale(d.startTime); let endX = timeScale(d.endTime); if (d.milestone) { endX = startX + theBarHeight; } const textWidth = this.getBBox().width; let classStr = ""; if (d.classes.length > 0) { classStr = d.classes.join(" "); } let secNum = 0; for (let i = 0; i < categories.length; i++) { if (d.type === categories[i]) { secNum = i % conf2.numberSectionStyles; } } let taskType = ""; if (d.active) { if (d.crit) { taskType = "activeCritText" + secNum; } else { taskType = "activeText" + secNum; } } if (d.done) { if (d.crit) { taskType = taskType + " doneCritText" + secNum; } else { taskType = taskType + " doneText" + secNum; } } else { if (d.crit) { taskType = taskType + " critText" + secNum; } } if (d.milestone) { taskType += " milestoneText"; } if (textWidth > endX - startX) { if (endX + textWidth + 1.5 * conf2.leftPadding > w2) { return classStr + " taskTextOutsideLeft taskTextOutside" + secNum + " " + taskType; } else { return classStr + " taskTextOutsideRight taskTextOutside" + secNum + " " + taskType + " width-" + textWidth; } } else { return classStr + " taskText taskText" + secNum + " " + taskType + " width-" + textWidth; } }); const securityLevel2 = getConfig$1().securityLevel; if (securityLevel2 === "sandbox") { let sandboxElement2; sandboxElement2 = select("#i" + id); const doc2 = sandboxElement2.nodes()[0].contentDocument; rectangles.filter(function(d) { return typeof links2[d.id] !== "undefined"; }).each(function(o) { var taskRect = doc2.querySelector("#" + o.id); var taskText = doc2.querySelector("#" + o.id + "-text"); const oldParent = taskRect.parentNode; var Link = doc2.createElement("a"); Link.setAttribute("xlink:href", links2[o.id]); Link.setAttribute("target", "_top"); oldParent.appendChild(Link); Link.appendChild(taskRect); Link.appendChild(taskText); }); } } function drawExcludeDays(theGap, theTopPad, theSidePad, w2, h2, tasks2, excludes2, includes2) { const minTime = tasks2.reduce( (min2, { startTime }) => min2 ? Math.min(min2, startTime) : startTime, 0 ); const maxTime = tasks2.reduce((max2, { endTime }) => max2 ? Math.max(max2, endTime) : endTime, 0); const dateFormat2 = diagObj.db.getDateFormat(); if (!minTime || !maxTime) return; const excludeRanges = []; let range = null; let d = moment(minTime); while (d.valueOf() <= maxTime) { if (diagObj.db.isInvalidDate(d, dateFormat2, excludes2, includes2)) { if (!range) { range = { start: d.clone(), end: d.clone() }; } else { range.end = d.clone(); } } else { if (range) { excludeRanges.push(range); range = null; } } d.add(1, "d"); } const rectangles = svg.append("g").selectAll("rect").data(excludeRanges).enter(); rectangles.append("rect").attr("id", function(d2) { return "exclude-" + d2.start.format("YYYY-MM-DD"); }).attr("x", function(d2) { return timeScale(d2.start) + theSidePad; }).attr("y", conf2.gridLineStartPadding).attr("width", function(d2) { const renderEnd = d2.end.clone().add(1, "day"); return timeScale(renderEnd) - timeScale(d2.start); }).attr("height", h2 - theTopPad - conf2.gridLineStartPadding).attr("transform-origin", function(d2, i) { return (timeScale(d2.start) + theSidePad + 0.5 * (timeScale(d2.end) - timeScale(d2.start))).toString() + "px " + (i * theGap + 0.5 * h2).toString() + "px"; }).attr("class", "exclude-range"); } function makeGrid(theSidePad, theTopPad, w2, h2) { let bottomXAxis = axisBottom(timeScale).tickSize(-h2 + theTopPad + conf2.gridLineStartPadding).tickFormat(timeFormat(diagObj.db.getAxisFormat() || conf2.axisFormat || "%Y-%m-%d")); svg.append("g").attr("class", "grid").attr("transform", "translate(" + theSidePad + ", " + (h2 - 50) + ")").call(bottomXAxis).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10).attr("dy", "1em"); if (diagObj.db.topAxisEnabled() || conf2.topAxis) { let topXAxis = axisTop(timeScale).tickSize(-h2 + theTopPad + conf2.gridLineStartPadding).tickFormat(timeFormat(diagObj.db.getAxisFormat() || conf2.axisFormat || "%Y-%m-%d")); svg.append("g").attr("class", "grid").attr("transform", "translate(" + theSidePad + ", " + theTopPad + ")").call(topXAxis).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10); } } function vertLabels(theGap, theTopPad) { const numOccurances = []; let prevGap = 0; for (let i = 0; i < categories.length; i++) { numOccurances[i] = [categories[i], getCount(categories[i], catsUnfiltered)]; } svg.append("g").selectAll("text").data(numOccurances).enter().append(function(d) { const rows = d[0].split(common.lineBreakRegex); const dy = -(rows.length - 1) / 2; const svgLabel = doc.createElementNS("http://www.w3.org/2000/svg", "text"); svgLabel.setAttribute("dy", dy + "em"); for (let j = 0; j < rows.length; j++) { const tspan = doc.createElementNS("http://www.w3.org/2000/svg", "tspan"); tspan.setAttribute("alignment-baseline", "central"); tspan.setAttribute("x", "10"); if (j > 0) tspan.setAttribute("dy", "1em"); tspan.textContent = rows[j]; svgLabel.appendChild(tspan); } return svgLabel; }).attr("x", 10).attr("y", function(d, i) { if (i > 0) { for (let j = 0; j < i; j++) { prevGap += numOccurances[i - 1][1]; return d[1] * theGap / 2 + prevGap * theGap + theTopPad; } } else { return d[1] * theGap / 2 + theTopPad; } }).attr("font-size", conf2.sectionFontSize).attr("font-size", conf2.sectionFontSize).attr("class", function(d) { for (let i = 0; i < categories.length; i++) { if (d[0] === categories[i]) { return "sectionTitle sectionTitle" + i % conf2.numberSectionStyles; } } return "sectionTitle"; }); } function drawToday(theSidePad, theTopPad, w2, h2) { const todayMarker2 = diagObj.db.getTodayMarker(); if (todayMarker2 === "off") { return; } const todayG = svg.append("g").attr("class", "today"); const today = new Date(); const todayLine = todayG.append("line"); todayLine.attr("x1", timeScale(today) + theSidePad).attr("x2", timeScale(today) + theSidePad).attr("y1", conf2.titleTopMargin).attr("y2", h2 - conf2.titleTopMargin).attr("class", "today"); if (todayMarker2 !== "") { todayLine.attr("style", todayMarker2.replace(/,/g, ";")); } } function checkUnique(arr) { const hash = {}; const result = []; for (let i = 0, l = arr.length; i < l; ++i) { if (!Object.prototype.hasOwnProperty.call(hash, arr[i])) { hash[arr[i]] = true; result.push(arr[i]); } } return result; } function getCounts(arr) { let i = arr.length; const obj = {}; while (i) { obj[arr[--i]] = (obj[arr[i]] || 0) + 1; } return obj; } function getCount(word, arr) { return getCounts(arr)[word] || 0; } }; const ganttRenderer = { setConf: setConf$5, draw: draw$8 }; var parser$5 = function() { var o = function(k, v, o2, l) { for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ; return o2; }, $V0 = [6, 9, 10]; var parser2 = { trace: function trace() { }, yy: {}, symbols_: { "error": 2, "start": 3, "info": 4, "document": 5, "EOF": 6, "line": 7, "statement": 8, "NL": 9, "showInfo": 10, "$accept": 0, "$end": 1 }, terminals_: { 2: "error", 4: "info", 6: "EOF", 9: "NL", 10: "showInfo" }, productions_: [0, [3, 3], [5, 0], [5, 2], [7, 1], [7, 1], [8, 1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { $$.length - 1; switch (yystate) { case 1: return yy; case 4: break; case 6: yy.setInfo(true); break; } }, table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: 6, 9: [1, 7], 10: [1, 8] }, { 1: [2, 1] }, o($V0, [2, 3]), o($V0, [2, 4]), o($V0, [2, 5]), o($V0, [2, 6])], defaultActions: { 4: [2, 1] }, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse2(input) { var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer2 = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer2.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer2; sharedState.yy.parser = this; if (typeof lexer2.yylloc == "undefined") { lexer2.yylloc = {}; } var yyloc = lexer2.yylloc; lstack.push(yyloc); var ranges = lexer2.options && lexer2.options.ranges; if (typeof sharedState.yy.parseError === "function") { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function lex() { var token; token = tstack.pop() || lexer2.lex() || EOF; if (typeof token !== "number") { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self2.symbols_[token] || token; } return token; } var symbol, state, action, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push("'" + this.terminals_[p] + "'"); } } if (lexer2.showPosition) { errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; } else { errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); } this.parseError(errStr, { text: lexer2.match, token: this.terminals_[symbol] || symbol, line: lexer2.yylineno, loc: yyloc, expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer2.yytext); lstack.push(lexer2.yylloc); stack.push(action[1]); symbol = null; { yyleng = lexer2.yyleng; yytext = lexer2.yytext; yylineno = lexer2.yylineno; yyloc = lexer2.yylloc; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== "undefined") { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; } }; var lexer = function() { var lexer2 = { EOF: 1, parseError: function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, setInput: function(input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; this.yylineno = this.yyleng = 0; this.yytext = this.matched = this.match = ""; this.conditionStack = ["INITIAL"]; this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; if (this.options.ranges) { this.yylloc.range = [0, 0]; } this.offset = 0; return this; }, input: function() { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, unput: function(ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); this.offset -= len; var oldLines = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1); this.matched = this.matched.substr(0, this.matched.length - 1); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, more: function() { this._more = true; return this; }, reject: function() { if (this.options.backtrack_lexer) { this._backtrack = true; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, less: function(n) { this.unput(this.match.slice(n)); }, pastInput: function() { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); }, upcomingInput: function() { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20 - next.length); } return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, ""); }, showPosition: function() { var pre = this.pastInput(); var c2 = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c2 + "^"; }, test_match: function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { backup = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { for (var k in backup) { this[k] = backup[k]; } return false; } return false; }, next: function() { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ""; this.match = ""; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; } else { return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } return false; } if (this._input === "") { return this.EOF; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, lex: function lex() { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, begin: function begin(condition) { this.conditionStack.push(condition); }, popState: function popState() { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, _currentRules: function _currentRules() { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, topState: function topState(n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, pushState: function pushState(condition) { this.begin(condition); }, stateStackSize: function stateStackSize() { return this.conditionStack.length; }, options: { "case-insensitive": true }, performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { switch ($avoiding_name_collisions) { case 0: return 4; case 1: return 9; case 2: return "space"; case 3: return 10; case 4: return 6; case 5: return "TXT"; } }, rules: [/^(?:info\b)/i, /^(?:[\s\n\r]+)/i, /^(?:[\s]+)/i, /^(?:showInfo\b)/i, /^(?:$)/i, /^(?:.)/i], conditions: { "INITIAL": { "rules": [0, 1, 2, 3, 4, 5], "inclusive": true } } }; return lexer2; }(); parser2.lexer = lexer; function Parser() { this.yy = {}; } Parser.prototype = parser2; parser2.Parser = Parser; return new Parser(); }(); parser$5.parser = parser$5; var message = ""; var info = false; const setMessage = (txt) => { log$1.debug("Setting message to: " + txt); message = txt; }; const getMessage = () => { return message; }; const setInfo = (inf) => { info = inf; }; const getInfo = () => { return info; }; const infoDb = { setMessage, getMessage, setInfo, getInfo, clear: clear$g }; const draw$7 = (text, id, version2, diagObj) => { try { log$1.debug("Rendering info diagram\n" + text); const securityLevel = getConfig$1().securityLevel; let sandboxElement; if (securityLevel === "sandbox") { sandboxElement = select("#i" + id); } const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); const svg = root2.select("#" + id); const g = svg.append("g"); g.append("text").attr("x", 100).attr("y", 40).attr("class", "version").attr("font-size", "32px").style("text-anchor", "middle").text("v " + version2); svg.attr("height", 100); svg.attr("width", 400); } catch (e) { log$1.error("Error while rendering info diagram"); log$1.error(e.message); } }; const infoRenderer = { draw: draw$7 }; const infoDetector = (txt) => { return txt.match(/^\s*info/) !== null; }; var parser$4 = function() { var o = function(k, v, o2, l) { for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ; return o2; }, $V0 = [1, 4], $V1 = [1, 5], $V2 = [1, 6], $V3 = [1, 7], $V4 = [1, 9], $V5 = [1, 11, 13, 15, 17, 19, 20, 26, 27, 28, 29], $V6 = [2, 5], $V7 = [1, 6, 11, 13, 15, 17, 19, 20, 26, 27, 28, 29], $V8 = [26, 27, 28], $V9 = [2, 8], $Va = [1, 18], $Vb = [1, 19], $Vc = [1, 20], $Vd = [1, 21], $Ve = [1, 22], $Vf = [1, 23], $Vg = [1, 28], $Vh = [6, 26, 27, 28, 29]; var parser2 = { trace: function trace() { }, yy: {}, symbols_: { "error": 2, "start": 3, "eol": 4, "directive": 5, "PIE": 6, "document": 7, "showData": 8, "line": 9, "statement": 10, "txt": 11, "value": 12, "title": 13, "title_value": 14, "acc_title": 15, "acc_title_value": 16, "acc_descr": 17, "acc_descr_value": 18, "acc_descr_multiline_value": 19, "section": 20, "openDirective": 21, "typeDirective": 22, "closeDirective": 23, ":": 24, "argDirective": 25, "NEWLINE": 26, ";": 27, "EOF": 28, "open_directive": 29, "type_directive": 30, "arg_directive": 31, "close_directive": 32, "$accept": 0, "$end": 1 }, terminals_: { 2: "error", 6: "PIE", 8: "showData", 11: "txt", 12: "value", 13: "title", 14: "title_value", 15: "acc_title", 16: "acc_title_value", 17: "acc_descr", 18: "acc_descr_value", 19: "acc_descr_multiline_value", 20: "section", 24: ":", 26: "NEWLINE", 27: ";", 28: "EOF", 29: "open_directive", 30: "type_directive", 31: "arg_directive", 32: "close_directive" }, productions_: [0, [3, 2], [3, 2], [3, 2], [3, 3], [7, 0], [7, 2], [9, 2], [10, 0], [10, 2], [10, 2], [10, 2], [10, 2], [10, 1], [10, 1], [10, 1], [5, 3], [5, 5], [4, 1], [4, 1], [4, 1], [21, 1], [22, 1], [25, 1], [23, 1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { var $0 = $$.length - 1; switch (yystate) { case 4: yy.setShowData(true); break; case 7: this.$ = $$[$0 - 1]; break; case 9: yy.addSection($$[$0 - 1], yy.cleanupValue($$[$0])); break; case 10: this.$ = $$[$0].trim(); yy.setDiagramTitle(this.$); break; case 11: this.$ = $$[$0].trim(); yy.setAccTitle(this.$); break; case 12: case 13: this.$ = $$[$0].trim(); yy.setAccDescription(this.$); break; case 14: yy.addSection($$[$0].substr(8)); this.$ = $$[$0].substr(8); break; case 21: yy.parseDirective("%%{", "open_directive"); break; case 22: yy.parseDirective($$[$0], "type_directive"); break; case 23: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], "arg_directive"); break; case 24: yy.parseDirective("}%%", "close_directive", "pie"); break; } }, table: [{ 3: 1, 4: 2, 5: 3, 6: $V0, 21: 8, 26: $V1, 27: $V2, 28: $V3, 29: $V4 }, { 1: [3] }, { 3: 10, 4: 2, 5: 3, 6: $V0, 21: 8, 26: $V1, 27: $V2, 28: $V3, 29: $V4 }, { 3: 11, 4: 2, 5: 3, 6: $V0, 21: 8, 26: $V1, 27: $V2, 28: $V3, 29: $V4 }, o($V5, $V6, { 7: 12, 8: [1, 13] }), o($V7, [2, 18]), o($V7, [2, 19]), o($V7, [2, 20]), { 22: 14, 30: [1, 15] }, { 30: [2, 21] }, { 1: [2, 1] }, { 1: [2, 2] }, o($V8, $V9, { 21: 8, 9: 16, 10: 17, 5: 24, 1: [2, 3], 11: $Va, 13: $Vb, 15: $Vc, 17: $Vd, 19: $Ve, 20: $Vf, 29: $V4 }), o($V5, $V6, { 7: 25 }), { 23: 26, 24: [1, 27], 32: $Vg }, o([24, 32], [2, 22]), o($V5, [2, 6]), { 4: 29, 26: $V1, 27: $V2, 28: $V3 }, { 12: [1, 30] }, { 14: [1, 31] }, { 16: [1, 32] }, { 18: [1, 33] }, o($V8, [2, 13]), o($V8, [2, 14]), o($V8, [2, 15]), o($V8, $V9, { 21: 8, 9: 16, 10: 17, 5: 24, 1: [2, 4], 11: $Va, 13: $Vb, 15: $Vc, 17: $Vd, 19: $Ve, 20: $Vf, 29: $V4 }), o($Vh, [2, 16]), { 25: 34, 31: [1, 35] }, o($Vh, [2, 24]), o($V5, [2, 7]), o($V8, [2, 9]), o($V8, [2, 10]), o($V8, [2, 11]), o($V8, [2, 12]), { 23: 36, 32: $Vg }, { 32: [2, 23] }, o($Vh, [2, 17])], defaultActions: { 9: [2, 21], 10: [2, 1], 11: [2, 2], 35: [2, 23] }, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse2(input) { var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer2 = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer2.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer2; sharedState.yy.parser = this; if (typeof lexer2.yylloc == "undefined") { lexer2.yylloc = {}; } var yyloc = lexer2.yylloc; lstack.push(yyloc); var ranges = lexer2.options && lexer2.options.ranges; if (typeof sharedState.yy.parseError === "function") { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function lex() { var token; token = tstack.pop() || lexer2.lex() || EOF; if (typeof token !== "number") { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self2.symbols_[token] || token; } return token; } var symbol, state, action, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push("'" + this.terminals_[p] + "'"); } } if (lexer2.showPosition) { errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; } else { errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); } this.parseError(errStr, { text: lexer2.match, token: this.terminals_[symbol] || symbol, line: lexer2.yylineno, loc: yyloc, expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer2.yytext); lstack.push(lexer2.yylloc); stack.push(action[1]); symbol = null; { yyleng = lexer2.yyleng; yytext = lexer2.yytext; yylineno = lexer2.yylineno; yyloc = lexer2.yylloc; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== "undefined") { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; } }; var lexer = function() { var lexer2 = { EOF: 1, parseError: function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, setInput: function(input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; this.yylineno = this.yyleng = 0; this.yytext = this.matched = this.match = ""; this.conditionStack = ["INITIAL"]; this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; if (this.options.ranges) { this.yylloc.range = [0, 0]; } this.offset = 0; return this; }, input: function() { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, unput: function(ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); this.offset -= len; var oldLines = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1); this.matched = this.matched.substr(0, this.matched.length - 1); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, more: function() { this._more = true; return this; }, reject: function() { if (this.options.backtrack_lexer) { this._backtrack = true; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, less: function(n) { this.unput(this.match.slice(n)); }, pastInput: function() { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); }, upcomingInput: function() { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20 - next.length); } return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, ""); }, showPosition: function() { var pre = this.pastInput(); var c2 = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c2 + "^"; }, test_match: function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { backup = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { for (var k in backup) { this[k] = backup[k]; } return false; } return false; }, next: function() { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ""; this.match = ""; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; } else { return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } return false; } if (this._input === "") { return this.EOF; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, lex: function lex() { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, begin: function begin(condition) { this.conditionStack.push(condition); }, popState: function popState() { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, _currentRules: function _currentRules() { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, topState: function topState(n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, pushState: function pushState(condition) { this.begin(condition); }, stateStackSize: function stateStackSize() { return this.conditionStack.length; }, options: { "case-insensitive": true }, performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { switch ($avoiding_name_collisions) { case 0: this.begin("open_directive"); return 29; case 1: this.begin("type_directive"); return 30; case 2: this.popState(); this.begin("arg_directive"); return 24; case 3: this.popState(); this.popState(); return 32; case 4: return 31; case 5: break; case 6: break; case 7: return 26; case 8: break; case 9: break; case 10: this.begin("title"); return 13; case 11: this.popState(); return "title_value"; case 12: this.begin("acc_title"); return 15; case 13: this.popState(); return "acc_title_value"; case 14: this.begin("acc_descr"); return 17; case 15: this.popState(); return "acc_descr_value"; case 16: this.begin("acc_descr_multiline"); break; case 17: this.popState(); break; case 18: return "acc_descr_multiline_value"; case 19: this.begin("string"); break; case 20: this.popState(); break; case 21: return "txt"; case 22: return 6; case 23: return 8; case 24: return "value"; case 25: return 28; } }, rules: [/^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:[\s]+)/i, /^(?:title\b)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:pie\b)/i, /^(?:showData\b)/i, /^(?::[\s]*[\d]+(?:\.[\d]+)?)/i, /^(?:$)/i], conditions: { "acc_descr_multiline": { "rules": [17, 18], "inclusive": false }, "acc_descr": { "rules": [15], "inclusive": false }, "acc_title": { "rules": [13], "inclusive": false }, "close_directive": { "rules": [], "inclusive": false }, "arg_directive": { "rules": [3, 4], "inclusive": false }, "type_directive": { "rules": [2, 3], "inclusive": false }, "open_directive": { "rules": [1], "inclusive": false }, "title": { "rules": [11], "inclusive": false }, "string": { "rules": [20, 21], "inclusive": false }, "INITIAL": { "rules": [0, 5, 6, 7, 8, 9, 10, 12, 14, 16, 19, 22, 23, 24, 25], "inclusive": true } } }; return lexer2; }(); parser2.lexer = lexer; function Parser() { this.yy = {}; } Parser.prototype = parser2; parser2.Parser = Parser; return new Parser(); }(); parser$4.parser = parser$4; const pieDetector = (txt) => { return txt.match(/^\s*pie/) !== null; }; let sections$1 = {}; let showData = false; const parseDirective$5 = function(statement, context, type2) { mermaidAPI.parseDirective(this, statement, context, type2); }; const addSection$1 = function(id, value) { id = common.sanitizeText(id, getConfig$1()); if (typeof sections$1[id] === "undefined") { sections$1[id] = value; log$1.debug("Added new section :", id); } }; const getSections$1 = () => sections$1; const setShowData = function(toggle) { showData = toggle; }; const getShowData = function() { return showData; }; const cleanupValue = function(value) { if (value.substring(0, 1) === ":") { value = value.substring(1).trim(); return Number(value.trim()); } else { return Number(value.trim()); } }; const clear$4 = function() { sections$1 = {}; showData = false; clear$g(); }; const pieDb = { parseDirective: parseDirective$5, getConfig: () => getConfig$1().pie, addSection: addSection$1, getSections: getSections$1, cleanupValue, clear: clear$4, setAccTitle, getAccTitle, setDiagramTitle, getDiagramTitle, setShowData, getShowData, getAccDescription, setAccDescription }; let conf$6 = getConfig$1(); let width; const height = 450; const draw$6 = (txt, id, _version, diagObj) => { try { conf$6 = getConfig$1(); log$1.debug("Rendering info diagram\n" + txt); const securityLevel = getConfig$1().securityLevel; let sandboxElement; if (securityLevel === "sandbox") { sandboxElement = select("#i" + id); } const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; diagObj.db.clear(); diagObj.parser.parse(txt); log$1.debug("Parsed info diagram"); const elem = doc.getElementById(id); width = elem.parentElement.offsetWidth; if (typeof width === "undefined") { width = 1200; } if (typeof conf$6.useWidth !== "undefined") { width = conf$6.useWidth; } if (typeof conf$6.pie.useWidth !== "undefined") { width = conf$6.pie.useWidth; } const diagram = root2.select("#" + id); configureSvgSize(diagram, height, width, conf$6.pie.useMaxWidth); addSVGAccessibilityFields(diagObj.db, diagram, id); elem.setAttribute("viewBox", "0 0 " + width + " " + height); var margin = 40; var legendRectSize = 18; var legendSpacing = 4; var radius = Math.min(width, height) / 2 - margin; var svg = diagram.append("g").attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); var data = diagObj.db.getSections(); var sum = 0; Object.keys(data).forEach(function(key) { sum += data[key]; }); const themeVariables = conf$6.themeVariables; var myGeneratedColors = [ themeVariables.pie1, themeVariables.pie2, themeVariables.pie3, themeVariables.pie4, themeVariables.pie5, themeVariables.pie6, themeVariables.pie7, themeVariables.pie8, themeVariables.pie9, themeVariables.pie10, themeVariables.pie11, themeVariables.pie12 ]; var color = scaleOrdinal().range(myGeneratedColors); var pie$1 = pie().value(function(d) { return d[1]; }); var dataReady = pie$1(Object.entries(data)); var arcGenerator = arc().innerRadius(0).outerRadius(radius); svg.selectAll("mySlices").data(dataReady).enter().append("path").attr("d", arcGenerator).attr("fill", function(d) { return color(d.data[0]); }).attr("class", "pieCircle"); svg.selectAll("mySlices").data(dataReady).enter().append("text").text(function(d) { return (d.data[1] / sum * 100).toFixed(0) + "%"; }).attr("transform", function(d) { return "translate(" + arcGenerator.centroid(d) + ")"; }).style("text-anchor", "middle").attr("class", "slice"); svg.append("text").text(diagObj.db.getDiagramTitle()).attr("x", 0).attr("y", -(height - 50) / 2).attr("class", "pieTitleText"); var legend = svg.selectAll(".legend").data(color.domain()).enter().append("g").attr("class", "legend").attr("transform", function(d, i) { var height2 = legendRectSize + legendSpacing; var offset = height2 * color.domain().length / 2; var horz = 12 * legendRectSize; var vert = i * height2 - offset; return "translate(" + horz + "," + vert + ")"; }); legend.append("rect").attr("width", legendRectSize).attr("height", legendRectSize).style("fill", color).style("stroke", color); legend.data(dataReady).append("text").attr("x", legendRectSize + legendSpacing).attr("y", legendRectSize - legendSpacing).text(function(d) { if (diagObj.db.getShowData() || conf$6.showData || conf$6.pie.showData) { return d.data[0] + " [" + d.data[1] + "]"; } else { return d.data[0]; } }); } catch (e) { log$1.error("Error while rendering info diagram"); log$1.error(e); } }; const pieRenderer = { draw: draw$6 }; var parser$3 = function() { var o = function(k, v, o2, l) { for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ; return o2; }, $V0 = [1, 3], $V1 = [1, 5], $V2 = [1, 6], $V3 = [1, 7], $V4 = [1, 8], $V5 = [5, 6, 8, 14, 16, 18, 19, 40, 41, 42, 43, 44, 45, 53, 71, 72], $V6 = [1, 22], $V7 = [2, 13], $V8 = [1, 26], $V9 = [1, 27], $Va = [1, 28], $Vb = [1, 29], $Vc = [1, 30], $Vd = [1, 31], $Ve = [1, 24], $Vf = [1, 32], $Vg = [1, 33], $Vh = [1, 36], $Vi = [71, 72], $Vj = [5, 8, 14, 16, 18, 19, 40, 41, 42, 43, 44, 45, 53, 60, 62, 71, 72], $Vk = [1, 56], $Vl = [1, 57], $Vm = [1, 58], $Vn = [1, 59], $Vo = [1, 60], $Vp = [1, 61], $Vq = [1, 62], $Vr = [62, 63], $Vs = [1, 74], $Vt = [1, 70], $Vu = [1, 71], $Vv = [1, 72], $Vw = [1, 73], $Vx = [1, 75], $Vy = [1, 79], $Vz = [1, 80], $VA = [1, 77], $VB = [1, 78], $VC = [5, 8, 14, 16, 18, 19, 40, 41, 42, 43, 44, 45, 53, 71, 72]; var parser2 = { trace: function trace() { }, yy: {}, symbols_: { "error": 2, "start": 3, "directive": 4, "NEWLINE": 5, "RD": 6, "diagram": 7, "EOF": 8, "openDirective": 9, "typeDirective": 10, "closeDirective": 11, ":": 12, "argDirective": 13, "acc_title": 14, "acc_title_value": 15, "acc_descr": 16, "acc_descr_value": 17, "acc_descr_multiline_value": 18, "open_directive": 19, "type_directive": 20, "arg_directive": 21, "close_directive": 22, "requirementDef": 23, "elementDef": 24, "relationshipDef": 25, "requirementType": 26, "requirementName": 27, "STRUCT_START": 28, "requirementBody": 29, "ID": 30, "COLONSEP": 31, "id": 32, "TEXT": 33, "text": 34, "RISK": 35, "riskLevel": 36, "VERIFYMTHD": 37, "verifyType": 38, "STRUCT_STOP": 39, "REQUIREMENT": 40, "FUNCTIONAL_REQUIREMENT": 41, "INTERFACE_REQUIREMENT": 42, "PERFORMANCE_REQUIREMENT": 43, "PHYSICAL_REQUIREMENT": 44, "DESIGN_CONSTRAINT": 45, "LOW_RISK": 46, "MED_RISK": 47, "HIGH_RISK": 48, "VERIFY_ANALYSIS": 49, "VERIFY_DEMONSTRATION": 50, "VERIFY_INSPECTION": 51, "VERIFY_TEST": 52, "ELEMENT": 53, "elementName": 54, "elementBody": 55, "TYPE": 56, "type": 57, "DOCREF": 58, "ref": 59, "END_ARROW_L": 60, "relationship": 61, "LINE": 62, "END_ARROW_R": 63, "CONTAINS": 64, "COPIES": 65, "DERIVES": 66, "SATISFIES": 67, "VERIFIES": 68, "REFINES": 69, "TRACES": 70, "unqString": 71, "qString": 72, "$accept": 0, "$end": 1 }, terminals_: { 2: "error", 5: "NEWLINE", 6: "RD", 8: "EOF", 12: ":", 14: "acc_title", 15: "acc_title_value", 16: "acc_descr", 17: "acc_descr_value", 18: "acc_descr_multiline_value", 19: "open_directive", 20: "type_directive", 21: "arg_directive", 22: "close_directive", 28: "STRUCT_START", 30: "ID", 31: "COLONSEP", 33: "TEXT", 35: "RISK", 37: "VERIFYMTHD", 39: "STRUCT_STOP", 40: "REQUIREMENT", 41: "FUNCTIONAL_REQUIREMENT", 42: "INTERFACE_REQUIREMENT", 43: "PERFORMANCE_REQUIREMENT", 44: "PHYSICAL_REQUIREMENT", 45: "DESIGN_CONSTRAINT", 46: "LOW_RISK", 47: "MED_RISK", 48: "HIGH_RISK", 49: "VERIFY_ANALYSIS", 50: "VERIFY_DEMONSTRATION", 51: "VERIFY_INSPECTION", 52: "VERIFY_TEST", 53: "ELEMENT", 56: "TYPE", 58: "DOCREF", 60: "END_ARROW_L", 62: "LINE", 63: "END_ARROW_R", 64: "CONTAINS", 65: "COPIES", 66: "DERIVES", 67: "SATISFIES", 68: "VERIFIES", 69: "REFINES", 70: "TRACES", 71: "unqString", 72: "qString" }, productions_: [0, [3, 3], [3, 2], [3, 4], [4, 3], [4, 5], [4, 2], [4, 2], [4, 1], [9, 1], [10, 1], [13, 1], [11, 1], [7, 0], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [23, 5], [29, 5], [29, 5], [29, 5], [29, 5], [29, 2], [29, 1], [26, 1], [26, 1], [26, 1], [26, 1], [26, 1], [26, 1], [36, 1], [36, 1], [36, 1], [38, 1], [38, 1], [38, 1], [38, 1], [24, 5], [55, 5], [55, 5], [55, 2], [55, 1], [25, 5], [25, 5], [61, 1], [61, 1], [61, 1], [61, 1], [61, 1], [61, 1], [61, 1], [27, 1], [27, 1], [32, 1], [32, 1], [34, 1], [34, 1], [54, 1], [54, 1], [57, 1], [57, 1], [59, 1], [59, 1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { var $0 = $$.length - 1; switch (yystate) { case 6: this.$ = $$[$0].trim(); yy.setAccTitle(this.$); break; case 7: case 8: this.$ = $$[$0].trim(); yy.setAccDescription(this.$); break; case 9: yy.parseDirective("%%{", "open_directive"); break; case 10: yy.parseDirective($$[$0], "type_directive"); break; case 11: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], "arg_directive"); break; case 12: yy.parseDirective("}%%", "close_directive", "pie"); break; case 13: this.$ = []; break; case 19: yy.addRequirement($$[$0 - 3], $$[$0 - 4]); break; case 20: yy.setNewReqId($$[$0 - 2]); break; case 21: yy.setNewReqText($$[$0 - 2]); break; case 22: yy.setNewReqRisk($$[$0 - 2]); break; case 23: yy.setNewReqVerifyMethod($$[$0 - 2]); break; case 26: this.$ = yy.RequirementType.REQUIREMENT; break; case 27: this.$ = yy.RequirementType.FUNCTIONAL_REQUIREMENT; break; case 28: this.$ = yy.RequirementType.INTERFACE_REQUIREMENT; break; case 29: this.$ = yy.RequirementType.PERFORMANCE_REQUIREMENT; break; case 30: this.$ = yy.RequirementType.PHYSICAL_REQUIREMENT; break; case 31: this.$ = yy.RequirementType.DESIGN_CONSTRAINT; break; case 32: this.$ = yy.RiskLevel.LOW_RISK; break; case 33: this.$ = yy.RiskLevel.MED_RISK; break; case 34: this.$ = yy.RiskLevel.HIGH_RISK; break; case 35: this.$ = yy.VerifyType.VERIFY_ANALYSIS; break; case 36: this.$ = yy.VerifyType.VERIFY_DEMONSTRATION; break; case 37: this.$ = yy.VerifyType.VERIFY_INSPECTION; break; case 38: this.$ = yy.VerifyType.VERIFY_TEST; break; case 39: yy.addElement($$[$0 - 3]); break; case 40: yy.setNewElementType($$[$0 - 2]); break; case 41: yy.setNewElementDocRef($$[$0 - 2]); break; case 44: yy.addRelationship($$[$0 - 2], $$[$0], $$[$0 - 4]); break; case 45: yy.addRelationship($$[$0 - 2], $$[$0 - 4], $$[$0]); break; case 46: this.$ = yy.Relationships.CONTAINS; break; case 47: this.$ = yy.Relationships.COPIES; break; case 48: this.$ = yy.Relationships.DERIVES; break; case 49: this.$ = yy.Relationships.SATISFIES; break; case 50: this.$ = yy.Relationships.VERIFIES; break; case 51: this.$ = yy.Relationships.REFINES; break; case 52: this.$ = yy.Relationships.TRACES; break; } }, table: [{ 3: 1, 4: 2, 6: $V0, 9: 4, 14: $V1, 16: $V2, 18: $V3, 19: $V4 }, { 1: [3] }, { 3: 10, 4: 2, 5: [1, 9], 6: $V0, 9: 4, 14: $V1, 16: $V2, 18: $V3, 19: $V4 }, { 5: [1, 11] }, { 10: 12, 20: [1, 13] }, { 15: [1, 14] }, { 17: [1, 15] }, o($V5, [2, 8]), { 20: [2, 9] }, { 3: 16, 4: 2, 6: $V0, 9: 4, 14: $V1, 16: $V2, 18: $V3, 19: $V4 }, { 1: [2, 2] }, { 4: 21, 5: $V6, 7: 17, 8: $V7, 9: 4, 14: $V1, 16: $V2, 18: $V3, 19: $V4, 23: 18, 24: 19, 25: 20, 26: 23, 32: 25, 40: $V8, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 53: $Ve, 71: $Vf, 72: $Vg }, { 11: 34, 12: [1, 35], 22: $Vh }, o([12, 22], [2, 10]), o($V5, [2, 6]), o($V5, [2, 7]), { 1: [2, 1] }, { 8: [1, 37] }, { 4: 21, 5: $V6, 7: 38, 8: $V7, 9: 4, 14: $V1, 16: $V2, 18: $V3, 19: $V4, 23: 18, 24: 19, 25: 20, 26: 23, 32: 25, 40: $V8, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 53: $Ve, 71: $Vf, 72: $Vg }, { 4: 21, 5: $V6, 7: 39, 8: $V7, 9: 4, 14: $V1, 16: $V2, 18: $V3, 19: $V4, 23: 18, 24: 19, 25: 20, 26: 23, 32: 25, 40: $V8, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 53: $Ve, 71: $Vf, 72: $Vg }, { 4: 21, 5: $V6, 7: 40, 8: $V7, 9: 4, 14: $V1, 16: $V2, 18: $V3, 19: $V4, 23: 18, 24: 19, 25: 20, 26: 23, 32: 25, 40: $V8, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 53: $Ve, 71: $Vf, 72: $Vg }, { 4: 21, 5: $V6, 7: 41, 8: $V7, 9: 4, 14: $V1, 16: $V2, 18: $V3, 19: $V4, 23: 18, 24: 19, 25: 20, 26: 23, 32: 25, 40: $V8, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 53: $Ve, 71: $Vf, 72: $Vg }, { 4: 21, 5: $V6, 7: 42, 8: $V7, 9: 4, 14: $V1, 16: $V2, 18: $V3, 19: $V4, 23: 18, 24: 19, 25: 20, 26: 23, 32: 25, 40: $V8, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 53: $Ve, 71: $Vf, 72: $Vg }, { 27: 43, 71: [1, 44], 72: [1, 45] }, { 54: 46, 71: [1, 47], 72: [1, 48] }, { 60: [1, 49], 62: [1, 50] }, o($Vi, [2, 26]), o($Vi, [2, 27]), o($Vi, [2, 28]), o($Vi, [2, 29]), o($Vi, [2, 30]), o($Vi, [2, 31]), o($Vj, [2, 55]), o($Vj, [2, 56]), o($V5, [2, 4]), { 13: 51, 21: [1, 52] }, o($V5, [2, 12]), { 1: [2, 3] }, { 8: [2, 14] }, { 8: [2, 15] }, { 8: [2, 16] }, { 8: [2, 17] }, { 8: [2, 18] }, { 28: [1, 53] }, { 28: [2, 53] }, { 28: [2, 54] }, { 28: [1, 54] }, { 28: [2, 59] }, { 28: [2, 60] }, { 61: 55, 64: $Vk, 65: $Vl, 66: $Vm, 67: $Vn, 68: $Vo, 69: $Vp, 70: $Vq }, { 61: 63, 64: $Vk, 65: $Vl, 66: $Vm, 67: $Vn, 68: $Vo, 69: $Vp, 70: $Vq }, { 11: 64, 22: $Vh }, { 22: [2, 11] }, { 5: [1, 65] }, { 5: [1, 66] }, { 62: [1, 67] }, o($Vr, [2, 46]), o($Vr, [2, 47]), o($Vr, [2, 48]), o($Vr, [2, 49]), o($Vr, [2, 50]), o($Vr, [2, 51]), o($Vr, [2, 52]), { 63: [1, 68] }, o($V5, [2, 5]), { 5: $Vs, 29: 69, 30: $Vt, 33: $Vu, 35: $Vv, 37: $Vw, 39: $Vx }, { 5: $Vy, 39: $Vz, 55: 76, 56: $VA, 58: $VB }, { 32: 81, 71: $Vf, 72: $Vg }, { 32: 82, 71: $Vf, 72: $Vg }, o($VC, [2, 19]), { 31: [1, 83] }, { 31: [1, 84] }, { 31: [1, 85] }, { 31: [1, 86] }, { 5: $Vs, 29: 87, 30: $Vt, 33: $Vu, 35: $Vv, 37: $Vw, 39: $Vx }, o($VC, [2, 25]), o($VC, [2, 39]), { 31: [1, 88] }, { 31: [1, 89] }, { 5: $Vy, 39: $Vz, 55: 90, 56: $VA, 58: $VB }, o($VC, [2, 43]), o($VC, [2, 44]), o($VC, [2, 45]), { 32: 91, 71: $Vf, 72: $Vg }, { 34: 92, 71: [1, 93], 72: [1, 94] }, { 36: 95, 46: [1, 96], 47: [1, 97], 48: [1, 98] }, { 38: 99, 49: [1, 100], 50: [1, 101], 51: [1, 102], 52: [1, 103] }, o($VC, [2, 24]), { 57: 104, 71: [1, 105], 72: [1, 106] }, { 59: 107, 71: [1, 108], 72: [1, 109] }, o($VC, [2, 42]), { 5: [1, 110] }, { 5: [1, 111] }, { 5: [2, 57] }, { 5: [2, 58] }, { 5: [1, 112] }, { 5: [2, 32] }, { 5: [2, 33] }, { 5: [2, 34] }, { 5: [1, 113] }, { 5: [2, 35] }, { 5: [2, 36] }, { 5: [2, 37] }, { 5: [2, 38] }, { 5: [1, 114] }, { 5: [2, 61] }, { 5: [2, 62] }, { 5: [1, 115] }, { 5: [2, 63] }, { 5: [2, 64] }, { 5: $Vs, 29: 116, 30: $Vt, 33: $Vu, 35: $Vv, 37: $Vw, 39: $Vx }, { 5: $Vs, 29: 117, 30: $Vt, 33: $Vu, 35: $Vv, 37: $Vw, 39: $Vx }, { 5: $Vs, 29: 118, 30: $Vt, 33: $Vu, 35: $Vv, 37: $Vw, 39: $Vx }, { 5: $Vs, 29: 119, 30: $Vt, 33: $Vu, 35: $Vv, 37: $Vw, 39: $Vx }, { 5: $Vy, 39: $Vz, 55: 120, 56: $VA, 58: $VB }, { 5: $Vy, 39: $Vz, 55: 121, 56: $VA, 58: $VB }, o($VC, [2, 20]), o($VC, [2, 21]), o($VC, [2, 22]), o($VC, [2, 23]), o($VC, [2, 40]), o($VC, [2, 41])], defaultActions: { 8: [2, 9], 10: [2, 2], 16: [2, 1], 37: [2, 3], 38: [2, 14], 39: [2, 15], 40: [2, 16], 41: [2, 17], 42: [2, 18], 44: [2, 53], 45: [2, 54], 47: [2, 59], 48: [2, 60], 52: [2, 11], 93: [2, 57], 94: [2, 58], 96: [2, 32], 97: [2, 33], 98: [2, 34], 100: [2, 35], 101: [2, 36], 102: [2, 37], 103: [2, 38], 105: [2, 61], 106: [2, 62], 108: [2, 63], 109: [2, 64] }, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse2(input) { var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer2 = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer2.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer2; sharedState.yy.parser = this; if (typeof lexer2.yylloc == "undefined") { lexer2.yylloc = {}; } var yyloc = lexer2.yylloc; lstack.push(yyloc); var ranges = lexer2.options && lexer2.options.ranges; if (typeof sharedState.yy.parseError === "function") { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function lex() { var token; token = tstack.pop() || lexer2.lex() || EOF; if (typeof token !== "number") { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self2.symbols_[token] || token; } return token; } var symbol, state, action, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push("'" + this.terminals_[p] + "'"); } } if (lexer2.showPosition) { errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; } else { errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); } this.parseError(errStr, { text: lexer2.match, token: this.terminals_[symbol] || symbol, line: lexer2.yylineno, loc: yyloc, expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer2.yytext); lstack.push(lexer2.yylloc); stack.push(action[1]); symbol = null; { yyleng = lexer2.yyleng; yytext = lexer2.yytext; yylineno = lexer2.yylineno; yyloc = lexer2.yylloc; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== "undefined") { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; } }; var lexer = function() { var lexer2 = { EOF: 1, parseError: function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, setInput: function(input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; this.yylineno = this.yyleng = 0; this.yytext = this.matched = this.match = ""; this.conditionStack = ["INITIAL"]; this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; if (this.options.ranges) { this.yylloc.range = [0, 0]; } this.offset = 0; return this; }, input: function() { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, unput: function(ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); this.offset -= len; var oldLines = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1); this.matched = this.matched.substr(0, this.matched.length - 1); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, more: function() { this._more = true; return this; }, reject: function() { if (this.options.backtrack_lexer) { this._backtrack = true; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, less: function(n) { this.unput(this.match.slice(n)); }, pastInput: function() { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); }, upcomingInput: function() { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20 - next.length); } return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, ""); }, showPosition: function() { var pre = this.pastInput(); var c2 = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c2 + "^"; }, test_match: function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { backup = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { for (var k in backup) { this[k] = backup[k]; } return false; } return false; }, next: function() { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ""; this.match = ""; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; } else { return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } return false; } if (this._input === "") { return this.EOF; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, lex: function lex() { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, begin: function begin(condition) { this.conditionStack.push(condition); }, popState: function popState() { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, _currentRules: function _currentRules() { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, topState: function topState(n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, pushState: function pushState(condition) { this.begin(condition); }, stateStackSize: function stateStackSize() { return this.conditionStack.length; }, options: { "case-insensitive": true }, performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { switch ($avoiding_name_collisions) { case 0: this.begin("open_directive"); return 19; case 1: this.begin("type_directive"); return 20; case 2: this.popState(); this.begin("arg_directive"); return 12; case 3: this.popState(); this.popState(); return 22; case 4: return 21; case 5: return "title"; case 6: this.begin("acc_title"); return 14; case 7: this.popState(); return "acc_title_value"; case 8: this.begin("acc_descr"); return 16; case 9: this.popState(); return "acc_descr_value"; case 10: this.begin("acc_descr_multiline"); break; case 11: this.popState(); break; case 12: return "acc_descr_multiline_value"; case 13: return 5; case 14: break; case 15: break; case 16: break; case 17: return 8; case 18: return 6; case 19: return 28; case 20: return 39; case 21: return 31; case 22: return 30; case 23: return 33; case 24: return 35; case 25: return 37; case 26: return 40; case 27: return 41; case 28: return 42; case 29: return 43; case 30: return 44; case 31: return 45; case 32: return 46; case 33: return 47; case 34: return 48; case 35: return 49; case 36: return 50; case 37: return 51; case 38: return 52; case 39: return 53; case 40: return 64; case 41: return 65; case 42: return 66; case 43: return 67; case 44: return 68; case 45: return 69; case 46: return 70; case 47: return 56; case 48: return 58; case 49: return 60; case 50: return 63; case 51: return 62; case 52: this.begin("string"); break; case 53: this.popState(); break; case 54: return "qString"; case 55: yy_.yytext = yy_.yytext.trim(); return 71; } }, rules: [/^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:title\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:(\r?\n)+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:$)/i, /^(?:requirementDiagram\b)/i, /^(?:\{)/i, /^(?:\})/i, /^(?::)/i, /^(?:id\b)/i, /^(?:text\b)/i, /^(?:risk\b)/i, /^(?:verifyMethod\b)/i, /^(?:requirement\b)/i, /^(?:functionalRequirement\b)/i, /^(?:interfaceRequirement\b)/i, /^(?:performanceRequirement\b)/i, /^(?:physicalRequirement\b)/i, /^(?:designConstraint\b)/i, /^(?:low\b)/i, /^(?:medium\b)/i, /^(?:high\b)/i, /^(?:analysis\b)/i, /^(?:demonstration\b)/i, /^(?:inspection\b)/i, /^(?:test\b)/i, /^(?:element\b)/i, /^(?:contains\b)/i, /^(?:copies\b)/i, /^(?:derives\b)/i, /^(?:satisfies\b)/i, /^(?:verifies\b)/i, /^(?:refines\b)/i, /^(?:traces\b)/i, /^(?:type\b)/i, /^(?:docref\b)/i, /^(?:<-)/i, /^(?:->)/i, /^(?:-)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[\w][^\r\n\{\<\>\-\=]*)/i], conditions: { "acc_descr_multiline": { "rules": [11, 12], "inclusive": false }, "acc_descr": { "rules": [9], "inclusive": false }, "acc_title": { "rules": [7], "inclusive": false }, "close_directive": { "rules": [], "inclusive": false }, "arg_directive": { "rules": [3, 4], "inclusive": false }, "type_directive": { "rules": [2, 3], "inclusive": false }, "open_directive": { "rules": [1], "inclusive": false }, "unqString": { "rules": [], "inclusive": false }, "token": { "rules": [], "inclusive": false }, "string": { "rules": [53, 54], "inclusive": false }, "INITIAL": { "rules": [0, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 55], "inclusive": true } } }; return lexer2; }(); parser2.lexer = lexer; function Parser() { this.yy = {}; } Parser.prototype = parser2; parser2.Parser = Parser; return new Parser(); }(); parser$3.parser = parser$3; const requirementDetector = (txt) => { return txt.match(/^\s*requirement(Diagram)?/) !== null; }; let relations = []; let latestRequirement = {}; let requirements = {}; let latestElement = {}; let elements = {}; const RequirementType = { REQUIREMENT: "Requirement", FUNCTIONAL_REQUIREMENT: "Functional Requirement", INTERFACE_REQUIREMENT: "Interface Requirement", PERFORMANCE_REQUIREMENT: "Performance Requirement", PHYSICAL_REQUIREMENT: "Physical Requirement", DESIGN_CONSTRAINT: "Design Constraint" }; const RiskLevel = { LOW_RISK: "Low", MED_RISK: "Medium", HIGH_RISK: "High" }; const VerifyType = { VERIFY_ANALYSIS: "Analysis", VERIFY_DEMONSTRATION: "Demonstration", VERIFY_INSPECTION: "Inspection", VERIFY_TEST: "Test" }; const Relationships = { CONTAINS: "contains", COPIES: "copies", DERIVES: "derives", SATISFIES: "satisfies", VERIFIES: "verifies", REFINES: "refines", TRACES: "traces" }; const parseDirective$4 = function(statement, context, type2) { mermaidAPI.parseDirective(this, statement, context, type2); }; const addRequirement = (name2, type2) => { if (typeof requirements[name2] === "undefined") { requirements[name2] = { name: name2, type: type2, id: latestRequirement.id, text: latestRequirement.text, risk: latestRequirement.risk, verifyMethod: latestRequirement.verifyMethod }; } latestRequirement = {}; return requirements[name2]; }; const getRequirements = () => requirements; const setNewReqId = (id) => { if (typeof latestRequirement != "undefined") { latestRequirement.id = id; } }; const setNewReqText = (text) => { if (typeof latestRequirement != "undefined") { latestRequirement.text = text; } }; const setNewReqRisk = (risk) => { if (typeof latestRequirement != "undefined") { latestRequirement.risk = risk; } }; const setNewReqVerifyMethod = (verifyMethod) => { if (typeof latestRequirement != "undefined") { latestRequirement.verifyMethod = verifyMethod; } }; const addElement = (name2) => { if (typeof elements[name2] === "undefined") { elements[name2] = { name: name2, type: latestElement.type, docRef: latestElement.docRef }; log$1.info("Added new requirement: ", name2); } latestElement = {}; return elements[name2]; }; const getElements = () => elements; const setNewElementType = (type2) => { if (typeof latestElement != "undefined") { latestElement.type = type2; } }; const setNewElementDocRef = (docRef) => { if (typeof latestElement != "undefined") { latestElement.docRef = docRef; } }; const addRelationship = (type2, src, dst) => { relations.push({ type: type2, src, dst }); }; const getRelationships = () => relations; const clear$3 = () => { relations = []; latestRequirement = {}; requirements = {}; latestElement = {}; elements = {}; clear$g(); }; const requirementDb = { RequirementType, RiskLevel, VerifyType, Relationships, parseDirective: parseDirective$4, getConfig: () => getConfig$1().req, addRequirement, getRequirements, setNewReqId, setNewReqText, setNewReqRisk, setNewReqVerifyMethod, setAccTitle, getAccTitle, setAccDescription, getAccDescription, addElement, getElements, setNewElementType, setNewElementDocRef, addRelationship, getRelationships, clear: clear$3 }; const ReqMarkers = { CONTAINS: "contains", ARROW: "arrow" }; const insertLineEndings = (parentNode, conf2) => { let containsNode = parentNode.append("defs").append("marker").attr("id", ReqMarkers.CONTAINS + "_line_ending").attr("refX", 0).attr("refY", conf2.line_height / 2).attr("markerWidth", conf2.line_height).attr("markerHeight", conf2.line_height).attr("orient", "auto").append("g"); containsNode.append("circle").attr("cx", conf2.line_height / 2).attr("cy", conf2.line_height / 2).attr("r", conf2.line_height / 2).attr("fill", "none"); containsNode.append("line").attr("x1", 0).attr("x2", conf2.line_height).attr("y1", conf2.line_height / 2).attr("y2", conf2.line_height / 2).attr("stroke-width", 1); containsNode.append("line").attr("y1", 0).attr("y2", conf2.line_height).attr("x1", conf2.line_height / 2).attr("x2", conf2.line_height / 2).attr("stroke-width", 1); parentNode.append("defs").append("marker").attr("id", ReqMarkers.ARROW + "_line_ending").attr("refX", conf2.line_height).attr("refY", 0.5 * conf2.line_height).attr("markerWidth", conf2.line_height).attr("markerHeight", conf2.line_height).attr("orient", "auto").append("path").attr( "d", `M0,0 L${conf2.line_height},${conf2.line_height / 2} M${conf2.line_height},${conf2.line_height / 2} L0,${conf2.line_height}` ).attr("stroke-width", 1); }; const markers = { ReqMarkers, insertLineEndings }; let conf$5 = {}; let relCnt = 0; const newRectNode = (parentNode, id) => { return parentNode.insert("rect", "#" + id).attr("class", "req reqBox").attr("x", 0).attr("y", 0).attr("width", conf$5.rect_min_width + "px").attr("height", conf$5.rect_min_height + "px"); }; const newTitleNode = (parentNode, id, txts) => { let x = conf$5.rect_min_width / 2; let title2 = parentNode.append("text").attr("class", "req reqLabel reqTitle").attr("id", id).attr("x", x).attr("y", conf$5.rect_padding).attr("dominant-baseline", "hanging"); let i = 0; txts.forEach((textStr) => { if (i == 0) { title2.append("tspan").attr("text-anchor", "middle").attr("x", conf$5.rect_min_width / 2).attr("dy", 0).text(textStr); } else { title2.append("tspan").attr("text-anchor", "middle").attr("x", conf$5.rect_min_width / 2).attr("dy", conf$5.line_height * 0.75).text(textStr); } i++; }); let yPadding = 1.5 * conf$5.rect_padding; let linePadding = i * conf$5.line_height * 0.75; let totalY = yPadding + linePadding; parentNode.append("line").attr("class", "req-title-line").attr("x1", "0").attr("x2", conf$5.rect_min_width).attr("y1", totalY).attr("y2", totalY); return { titleNode: title2, y: totalY }; }; const newBodyNode = (parentNode, id, txts, yStart) => { let body = parentNode.append("text").attr("class", "req reqLabel").attr("id", id).attr("x", conf$5.rect_padding).attr("y", yStart).attr("dominant-baseline", "hanging"); let currentRow = 0; const charLimit = 30; let wrappedTxts = []; txts.forEach((textStr) => { let currentTextLen = textStr.length; while (currentTextLen > charLimit && currentRow < 3) { let firstPart = textStr.substring(0, charLimit); textStr = textStr.substring(charLimit, textStr.length); currentTextLen = textStr.length; wrappedTxts[wrappedTxts.length] = firstPart; currentRow++; } if (currentRow == 3) { let lastStr = wrappedTxts[wrappedTxts.length - 1]; wrappedTxts[wrappedTxts.length - 1] = lastStr.substring(0, lastStr.length - 4) + "..."; } else { wrappedTxts[wrappedTxts.length] = textStr; } currentRow = 0; }); wrappedTxts.forEach((textStr) => { body.append("tspan").attr("x", conf$5.rect_padding).attr("dy", conf$5.line_height).text(textStr); }); return body; }; const addEdgeLabel = (parentNode, svgPath, conf2, txt) => { const len = svgPath.node().getTotalLength(); const labelPoint = svgPath.node().getPointAtLength(len * 0.5); const labelId = "rel" + relCnt; relCnt++; const labelNode = parentNode.append("text").attr("class", "req relationshipLabel").attr("id", labelId).attr("x", labelPoint.x).attr("y", labelPoint.y).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(txt); const labelBBox = labelNode.node().getBBox(); parentNode.insert("rect", "#" + labelId).attr("class", "req reqLabelBox").attr("x", labelPoint.x - labelBBox.width / 2).attr("y", labelPoint.y - labelBBox.height / 2).attr("width", labelBBox.width).attr("height", labelBBox.height).attr("fill", "white").attr("fill-opacity", "85%"); }; const drawRelationshipFromLayout = function(svg, rel, g, insert, diagObj) { const edge = g.edge(elementString(rel.src), elementString(rel.dst)); const lineFunction = line().x(function(d) { return d.x; }).y(function(d) { return d.y; }); const svgPath = svg.insert("path", "#" + insert).attr("class", "er relationshipLine").attr("d", lineFunction(edge.points)).attr("fill", "none"); if (rel.type == diagObj.db.Relationships.CONTAINS) { svgPath.attr( "marker-start", "url(" + common.getUrl(conf$5.arrowMarkerAbsolute) + "#" + rel.type + "_line_ending)" ); } else { svgPath.attr("stroke-dasharray", "10,7"); svgPath.attr( "marker-end", "url(" + common.getUrl(conf$5.arrowMarkerAbsolute) + "#" + markers.ReqMarkers.ARROW + "_line_ending)" ); } addEdgeLabel(svg, svgPath, conf$5, `<<${rel.type}>>`); return; }; const drawReqs = (reqs, graph, svgNode) => { Object.keys(reqs).forEach((reqName) => { let req = reqs[reqName]; reqName = elementString(reqName); log$1.info("Added new requirement: ", reqName); const groupNode = svgNode.append("g").attr("id", reqName); const textId = "req-" + reqName; const rectNode = newRectNode(groupNode, textId); let titleNodeInfo = newTitleNode(groupNode, reqName + "_title", [ `<<${req.type}>>`, `${req.name}` ]); newBodyNode( groupNode, reqName + "_body", [ `Id: ${req.id}`, `Text: ${req.text}`, `Risk: ${req.risk}`, `Verification: ${req.verifyMethod}` ], titleNodeInfo.y ); const rectBBox = rectNode.node().getBBox(); graph.setNode(reqName, { width: rectBBox.width, height: rectBBox.height, shape: "rect", id: reqName }); }); }; const drawElements = (els, graph, svgNode) => { Object.keys(els).forEach((elName) => { let el = els[elName]; const id = elementString(elName); const groupNode = svgNode.append("g").attr("id", id); const textId = "element-" + id; const rectNode = newRectNode(groupNode, textId); let titleNodeInfo = newTitleNode(groupNode, textId + "_title", [`<>`, `${elName}`]); newBodyNode( groupNode, textId + "_body", [`Type: ${el.type || "Not Specified"}`, `Doc Ref: ${el.docRef || "None"}`], titleNodeInfo.y ); const rectBBox = rectNode.node().getBBox(); graph.setNode(id, { width: rectBBox.width, height: rectBBox.height, shape: "rect", id }); }); }; const addRelationships = (relationships2, g) => { relationships2.forEach(function(r) { let src = elementString(r.src); let dst = elementString(r.dst); g.setEdge(src, dst, { relationship: r }); }); return relationships2; }; const adjustEntities = function(svgNode, graph) { graph.nodes().forEach(function(v) { if (typeof v !== "undefined" && typeof graph.node(v) !== "undefined") { svgNode.select("#" + v); svgNode.select("#" + v).attr( "transform", "translate(" + (graph.node(v).x - graph.node(v).width / 2) + "," + (graph.node(v).y - graph.node(v).height / 2) + " )" ); } }); return; }; const elementString = (str) => { return str.replace(/\s/g, "").replace(/\./g, "_"); }; const draw$5 = (text, id, _version, diagObj) => { conf$5 = getConfig$1().requirement; diagObj.db.clear(); diagObj.parser.parse(text); const securityLevel = conf$5.securityLevel; let sandboxElement; if (securityLevel === "sandbox") { sandboxElement = select("#i" + id); } const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); const svg = root2.select(`[id='${id}']`); markers.insertLineEndings(svg, conf$5); const g = new graphlib.Graph({ multigraph: false, compound: false, directed: true }).setGraph({ rankdir: conf$5.layoutDirection, marginx: 20, marginy: 20, nodesep: 100, edgesep: 100, ranksep: 100 }).setDefaultEdgeLabel(function() { return {}; }); let requirements2 = diagObj.db.getRequirements(); let elements2 = diagObj.db.getElements(); let relationships2 = diagObj.db.getRelationships(); drawReqs(requirements2, g, svg); drawElements(elements2, g, svg); addRelationships(relationships2, g); dagre.layout(g); adjustEntities(svg, g); relationships2.forEach(function(rel) { drawRelationshipFromLayout(svg, rel, g, id, diagObj); }); const padding2 = conf$5.rect_padding; const svgBounds = svg.node().getBBox(); const width2 = svgBounds.width + padding2 * 2; const height2 = svgBounds.height + padding2 * 2; configureSvgSize(svg, height2, width2, conf$5.useMaxWidth); svg.attr("viewBox", `${svgBounds.x - padding2} ${svgBounds.y - padding2} ${width2} ${height2}`); addSVGAccessibilityFields(diagObj.db, svg, id); }; const requirementRenderer = { draw: draw$5 }; var parser$2 = function() { var o = function(k, v, o2, l) { for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ; return o2; }, $V0 = [1, 2], $V1 = [1, 3], $V2 = [1, 5], $V3 = [1, 7], $V4 = [2, 5], $V5 = [1, 15], $V6 = [1, 17], $V7 = [1, 18], $V8 = [1, 19], $V9 = [1, 21], $Va = [1, 22], $Vb = [1, 23], $Vc = [1, 29], $Vd = [1, 30], $Ve = [1, 31], $Vf = [1, 32], $Vg = [1, 33], $Vh = [1, 34], $Vi = [1, 35], $Vj = [1, 36], $Vk = [1, 37], $Vl = [1, 38], $Vm = [1, 39], $Vn = [1, 40], $Vo = [1, 43], $Vp = [1, 44], $Vq = [1, 45], $Vr = [1, 46], $Vs = [1, 47], $Vt = [1, 48], $Vu = [1, 51], $Vv = [1, 4, 5, 16, 20, 22, 25, 26, 32, 33, 34, 36, 38, 39, 40, 41, 42, 43, 45, 47, 49, 50, 51, 52, 53, 58, 59, 60, 61, 69, 79], $Vw = [4, 5, 16, 20, 22, 25, 26, 32, 33, 34, 36, 38, 39, 40, 41, 42, 43, 45, 47, 49, 53, 58, 59, 60, 61, 69, 79], $Vx = [4, 5, 16, 20, 22, 25, 26, 32, 33, 34, 36, 38, 39, 40, 41, 42, 43, 45, 47, 49, 52, 53, 58, 59, 60, 61, 69, 79], $Vy = [4, 5, 16, 20, 22, 25, 26, 32, 33, 34, 36, 38, 39, 40, 41, 42, 43, 45, 47, 49, 51, 53, 58, 59, 60, 61, 69, 79], $Vz = [4, 5, 16, 20, 22, 25, 26, 32, 33, 34, 36, 38, 39, 40, 41, 42, 43, 45, 47, 49, 50, 53, 58, 59, 60, 61, 69, 79], $VA = [67, 68, 69], $VB = [1, 121], $VC = [1, 4, 5, 7, 16, 20, 22, 25, 26, 32, 33, 34, 36, 38, 39, 40, 41, 42, 43, 45, 47, 49, 50, 51, 52, 53, 58, 59, 60, 61, 69, 79]; var parser2 = { trace: function trace() { }, yy: {}, symbols_: { "error": 2, "start": 3, "SPACE": 4, "NEWLINE": 5, "directive": 6, "SD": 7, "document": 8, "line": 9, "statement": 10, "openDirective": 11, "typeDirective": 12, "closeDirective": 13, ":": 14, "argDirective": 15, "participant": 16, "actor": 17, "AS": 18, "restOfLine": 19, "participant_actor": 20, "signal": 21, "autonumber": 22, "NUM": 23, "off": 24, "activate": 25, "deactivate": 26, "note_statement": 27, "links_statement": 28, "link_statement": 29, "properties_statement": 30, "details_statement": 31, "title": 32, "legacy_title": 33, "acc_title": 34, "acc_title_value": 35, "acc_descr": 36, "acc_descr_value": 37, "acc_descr_multiline_value": 38, "loop": 39, "end": 40, "rect": 41, "opt": 42, "alt": 43, "else_sections": 44, "par": 45, "par_sections": 46, "critical": 47, "option_sections": 48, "break": 49, "option": 50, "and": 51, "else": 52, "note": 53, "placement": 54, "text2": 55, "over": 56, "actor_pair": 57, "links": 58, "link": 59, "properties": 60, "details": 61, "spaceList": 62, ",": 63, "left_of": 64, "right_of": 65, "signaltype": 66, "+": 67, "-": 68, "ACTOR": 69, "SOLID_OPEN_ARROW": 70, "DOTTED_OPEN_ARROW": 71, "SOLID_ARROW": 72, "DOTTED_ARROW": 73, "SOLID_CROSS": 74, "DOTTED_CROSS": 75, "SOLID_POINT": 76, "DOTTED_POINT": 77, "TXT": 78, "open_directive": 79, "type_directive": 80, "arg_directive": 81, "close_directive": 82, "$accept": 0, "$end": 1 }, terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 7: "SD", 14: ":", 16: "participant", 18: "AS", 19: "restOfLine", 20: "participant_actor", 22: "autonumber", 23: "NUM", 24: "off", 25: "activate", 26: "deactivate", 32: "title", 33: "legacy_title", 34: "acc_title", 35: "acc_title_value", 36: "acc_descr", 37: "acc_descr_value", 38: "acc_descr_multiline_value", 39: "loop", 40: "end", 41: "rect", 42: "opt", 43: "alt", 45: "par", 47: "critical", 49: "break", 50: "option", 51: "and", 52: "else", 53: "note", 56: "over", 58: "links", 59: "link", 60: "properties", 61: "details", 63: ",", 64: "left_of", 65: "right_of", 67: "+", 68: "-", 69: "ACTOR", 70: "SOLID_OPEN_ARROW", 71: "DOTTED_OPEN_ARROW", 72: "SOLID_ARROW", 73: "DOTTED_ARROW", 74: "SOLID_CROSS", 75: "DOTTED_CROSS", 76: "SOLID_POINT", 77: "DOTTED_POINT", 78: "TXT", 79: "open_directive", 80: "type_directive", 81: "arg_directive", 82: "close_directive" }, productions_: [0, [3, 2], [3, 2], [3, 2], [3, 2], [8, 0], [8, 2], [9, 2], [9, 1], [9, 1], [6, 4], [6, 6], [10, 5], [10, 3], [10, 5], [10, 3], [10, 2], [10, 4], [10, 3], [10, 3], [10, 2], [10, 3], [10, 3], [10, 2], [10, 2], [10, 2], [10, 2], [10, 2], [10, 1], [10, 1], [10, 2], [10, 2], [10, 1], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [10, 1], [48, 1], [48, 4], [46, 1], [46, 4], [44, 1], [44, 4], [27, 4], [27, 4], [28, 3], [29, 3], [30, 3], [31, 3], [62, 2], [62, 1], [57, 3], [57, 1], [54, 1], [54, 1], [21, 5], [21, 5], [21, 4], [17, 1], [66, 1], [66, 1], [66, 1], [66, 1], [66, 1], [66, 1], [66, 1], [66, 1], [55, 1], [11, 1], [12, 1], [15, 1], [13, 1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { var $0 = $$.length - 1; switch (yystate) { case 4: yy.apply($$[$0]); return $$[$0]; case 5: this.$ = []; break; case 6: $$[$0 - 1].push($$[$0]); this.$ = $$[$0 - 1]; break; case 7: case 8: this.$ = $$[$0]; break; case 9: this.$ = []; break; case 12: $$[$0 - 3].type = "addParticipant"; $$[$0 - 3].description = yy.parseMessage($$[$0 - 1]); this.$ = $$[$0 - 3]; break; case 13: $$[$0 - 1].type = "addParticipant"; this.$ = $$[$0 - 1]; break; case 14: $$[$0 - 3].type = "addActor"; $$[$0 - 3].description = yy.parseMessage($$[$0 - 1]); this.$ = $$[$0 - 3]; break; case 15: $$[$0 - 1].type = "addActor"; this.$ = $$[$0 - 1]; break; case 17: this.$ = { type: "sequenceIndex", sequenceIndex: Number($$[$0 - 2]), sequenceIndexStep: Number($$[$0 - 1]), sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER }; break; case 18: this.$ = { type: "sequenceIndex", sequenceIndex: Number($$[$0 - 1]), sequenceIndexStep: 1, sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER }; break; case 19: this.$ = { type: "sequenceIndex", sequenceVisible: false, signalType: yy.LINETYPE.AUTONUMBER }; break; case 20: this.$ = { type: "sequenceIndex", sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER }; break; case 21: this.$ = { type: "activeStart", signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] }; break; case 22: this.$ = { type: "activeEnd", signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 1] }; break; case 28: yy.setDiagramTitle($$[$0].substring(6)); this.$ = $$[$0].substring(6); break; case 29: yy.setDiagramTitle($$[$0].substring(7)); this.$ = $$[$0].substring(7); break; case 30: this.$ = $$[$0].trim(); yy.setAccTitle(this.$); break; case 31: case 32: this.$ = $$[$0].trim(); yy.setAccDescription(this.$); break; case 33: $$[$0 - 1].unshift({ type: "loopStart", loopText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.LOOP_START }); $$[$0 - 1].push({ type: "loopEnd", loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_END }); this.$ = $$[$0 - 1]; break; case 34: $$[$0 - 1].unshift({ type: "rectStart", color: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.RECT_START }); $$[$0 - 1].push({ type: "rectEnd", color: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.RECT_END }); this.$ = $$[$0 - 1]; break; case 35: $$[$0 - 1].unshift({ type: "optStart", optText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.OPT_START }); $$[$0 - 1].push({ type: "optEnd", optText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.OPT_END }); this.$ = $$[$0 - 1]; break; case 36: $$[$0 - 1].unshift({ type: "altStart", altText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.ALT_START }); $$[$0 - 1].push({ type: "altEnd", signalType: yy.LINETYPE.ALT_END }); this.$ = $$[$0 - 1]; break; case 37: $$[$0 - 1].unshift({ type: "parStart", parText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.PAR_START }); $$[$0 - 1].push({ type: "parEnd", signalType: yy.LINETYPE.PAR_END }); this.$ = $$[$0 - 1]; break; case 38: $$[$0 - 1].unshift({ type: "criticalStart", criticalText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.CRITICAL_START }); $$[$0 - 1].push({ type: "criticalEnd", signalType: yy.LINETYPE.CRITICAL_END }); this.$ = $$[$0 - 1]; break; case 39: $$[$0 - 1].unshift({ type: "breakStart", breakText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.BREAK_START }); $$[$0 - 1].push({ type: "breakEnd", optText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.BREAK_END }); this.$ = $$[$0 - 1]; break; case 42: this.$ = $$[$0 - 3].concat([{ type: "option", optionText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.CRITICAL_OPTION }, $$[$0]]); break; case 44: this.$ = $$[$0 - 3].concat([{ type: "and", parText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.PAR_AND }, $$[$0]]); break; case 46: this.$ = $$[$0 - 3].concat([{ type: "else", altText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.ALT_ELSE }, $$[$0]]); break; case 47: this.$ = [$$[$0 - 1], { type: "addNote", placement: $$[$0 - 2], actor: $$[$0 - 1].actor, text: $$[$0] }]; break; case 48: $$[$0 - 2] = [].concat($$[$0 - 1], $$[$0 - 1]).slice(0, 2); $$[$0 - 2][0] = $$[$0 - 2][0].actor; $$[$0 - 2][1] = $$[$0 - 2][1].actor; this.$ = [$$[$0 - 1], { type: "addNote", placement: yy.PLACEMENT.OVER, actor: $$[$0 - 2].slice(0, 2), text: $$[$0] }]; break; case 49: this.$ = [$$[$0 - 1], { type: "addLinks", actor: $$[$0 - 1].actor, text: $$[$0] }]; break; case 50: this.$ = [$$[$0 - 1], { type: "addALink", actor: $$[$0 - 1].actor, text: $$[$0] }]; break; case 51: this.$ = [$$[$0 - 1], { type: "addProperties", actor: $$[$0 - 1].actor, text: $$[$0] }]; break; case 52: this.$ = [$$[$0 - 1], { type: "addDetails", actor: $$[$0 - 1].actor, text: $$[$0] }]; break; case 55: this.$ = [$$[$0 - 2], $$[$0]]; break; case 56: this.$ = $$[$0]; break; case 57: this.$ = yy.PLACEMENT.LEFTOF; break; case 58: this.$ = yy.PLACEMENT.RIGHTOF; break; case 59: this.$ = [ $$[$0 - 4], $$[$0 - 1], { type: "addMessage", from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] }, { type: "activeStart", signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] } ]; break; case 60: this.$ = [ $$[$0 - 4], $$[$0 - 1], { type: "addMessage", from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] }, { type: "activeEnd", signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 4] } ]; break; case 61: this.$ = [$$[$0 - 3], $$[$0 - 1], { type: "addMessage", from: $$[$0 - 3].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 2], msg: $$[$0] }]; break; case 62: this.$ = { type: "addParticipant", actor: $$[$0] }; break; case 63: this.$ = yy.LINETYPE.SOLID_OPEN; break; case 64: this.$ = yy.LINETYPE.DOTTED_OPEN; break; case 65: this.$ = yy.LINETYPE.SOLID; break; case 66: this.$ = yy.LINETYPE.DOTTED; break; case 67: this.$ = yy.LINETYPE.SOLID_CROSS; break; case 68: this.$ = yy.LINETYPE.DOTTED_CROSS; break; case 69: this.$ = yy.LINETYPE.SOLID_POINT; break; case 70: this.$ = yy.LINETYPE.DOTTED_POINT; break; case 71: this.$ = yy.parseMessage($$[$0].trim().substring(1)); break; case 72: yy.parseDirective("%%{", "open_directive"); break; case 73: yy.parseDirective($$[$0], "type_directive"); break; case 74: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], "arg_directive"); break; case 75: yy.parseDirective("}%%", "close_directive", "sequence"); break; } }, table: [{ 3: 1, 4: $V0, 5: $V1, 6: 4, 7: $V2, 11: 6, 79: $V3 }, { 1: [3] }, { 3: 8, 4: $V0, 5: $V1, 6: 4, 7: $V2, 11: 6, 79: $V3 }, { 3: 9, 4: $V0, 5: $V1, 6: 4, 7: $V2, 11: 6, 79: $V3 }, { 3: 10, 4: $V0, 5: $V1, 6: 4, 7: $V2, 11: 6, 79: $V3 }, o([1, 4, 5, 16, 20, 22, 25, 26, 32, 33, 34, 36, 38, 39, 41, 42, 43, 45, 47, 49, 53, 58, 59, 60, 61, 69, 79], $V4, { 8: 11 }), { 12: 12, 80: [1, 13] }, { 80: [2, 72] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3] }, { 1: [2, 4], 4: $V5, 5: $V6, 6: 41, 9: 14, 10: 16, 11: 6, 16: $V7, 17: 42, 20: $V8, 21: 20, 22: $V9, 25: $Va, 26: $Vb, 27: 24, 28: 25, 29: 26, 30: 27, 31: 28, 32: $Vc, 33: $Vd, 34: $Ve, 36: $Vf, 38: $Vg, 39: $Vh, 41: $Vi, 42: $Vj, 43: $Vk, 45: $Vl, 47: $Vm, 49: $Vn, 53: $Vo, 58: $Vp, 59: $Vq, 60: $Vr, 61: $Vs, 69: $Vt, 79: $V3 }, { 13: 49, 14: [1, 50], 82: $Vu }, o([14, 82], [2, 73]), o($Vv, [2, 6]), { 6: 41, 10: 52, 11: 6, 16: $V7, 17: 42, 20: $V8, 21: 20, 22: $V9, 25: $Va, 26: $Vb, 27: 24, 28: 25, 29: 26, 30: 27, 31: 28, 32: $Vc, 33: $Vd, 34: $Ve, 36: $Vf, 38: $Vg, 39: $Vh, 41: $Vi, 42: $Vj, 43: $Vk, 45: $Vl, 47: $Vm, 49: $Vn, 53: $Vo, 58: $Vp, 59: $Vq, 60: $Vr, 61: $Vs, 69: $Vt, 79: $V3 }, o($Vv, [2, 8]), o($Vv, [2, 9]), { 17: 53, 69: $Vt }, { 17: 54, 69: $Vt }, { 5: [1, 55] }, { 5: [1, 58], 23: [1, 56], 24: [1, 57] }, { 17: 59, 69: $Vt }, { 17: 60, 69: $Vt }, { 5: [1, 61] }, { 5: [1, 62] }, { 5: [1, 63] }, { 5: [1, 64] }, { 5: [1, 65] }, o($Vv, [2, 28]), o($Vv, [2, 29]), { 35: [1, 66] }, { 37: [1, 67] }, o($Vv, [2, 32]), { 19: [1, 68] }, { 19: [1, 69] }, { 19: [1, 70] }, { 19: [1, 71] }, { 19: [1, 72] }, { 19: [1, 73] }, { 19: [1, 74] }, o($Vv, [2, 40]), { 66: 75, 70: [1, 76], 71: [1, 77], 72: [1, 78], 73: [1, 79], 74: [1, 80], 75: [1, 81], 76: [1, 82], 77: [1, 83] }, { 54: 84, 56: [1, 85], 64: [1, 86], 65: [1, 87] }, { 17: 88, 69: $Vt }, { 17: 89, 69: $Vt }, { 17: 90, 69: $Vt }, { 17: 91, 69: $Vt }, o([5, 18, 63, 70, 71, 72, 73, 74, 75, 76, 77, 78], [2, 62]), { 5: [1, 92] }, { 15: 93, 81: [1, 94] }, { 5: [2, 75] }, o($Vv, [2, 7]), { 5: [1, 96], 18: [1, 95] }, { 5: [1, 98], 18: [1, 97] }, o($Vv, [2, 16]), { 5: [1, 100], 23: [1, 99] }, { 5: [1, 101] }, o($Vv, [2, 20]), { 5: [1, 102] }, { 5: [1, 103] }, o($Vv, [2, 23]), o($Vv, [2, 24]), o($Vv, [2, 25]), o($Vv, [2, 26]), o($Vv, [2, 27]), o($Vv, [2, 30]), o($Vv, [2, 31]), o($Vw, $V4, { 8: 104 }), o($Vw, $V4, { 8: 105 }), o($Vw, $V4, { 8: 106 }), o($Vx, $V4, { 44: 107, 8: 108 }), o($Vy, $V4, { 46: 109, 8: 110 }), o($Vz, $V4, { 48: 111, 8: 112 }), o($Vw, $V4, { 8: 113 }), { 17: 116, 67: [1, 114], 68: [1, 115], 69: $Vt }, o($VA, [2, 63]), o($VA, [2, 64]), o($VA, [2, 65]), o($VA, [2, 66]), o($VA, [2, 67]), o($VA, [2, 68]), o($VA, [2, 69]), o($VA, [2, 70]), { 17: 117, 69: $Vt }, { 17: 119, 57: 118, 69: $Vt }, { 69: [2, 57] }, { 69: [2, 58] }, { 55: 120, 78: $VB }, { 55: 122, 78: $VB }, { 55: 123, 78: $VB }, { 55: 124, 78: $VB }, o($VC, [2, 10]), { 13: 125, 82: $Vu }, { 82: [2, 74] }, { 19: [1, 126] }, o($Vv, [2, 13]), { 19: [1, 127] }, o($Vv, [2, 15]), { 5: [1, 128] }, o($Vv, [2, 18]), o($Vv, [2, 19]), o($Vv, [2, 21]), o($Vv, [2, 22]), { 4: $V5, 5: $V6, 6: 41, 9: 14, 10: 16, 11: 6, 16: $V7, 17: 42, 20: $V8, 21: 20, 22: $V9, 25: $Va, 26: $Vb, 27: 24, 28: 25, 29: 26, 30: 27, 31: 28, 32: $Vc, 33: $Vd, 34: $Ve, 36: $Vf, 38: $Vg, 39: $Vh, 40: [1, 129], 41: $Vi, 42: $Vj, 43: $Vk, 45: $Vl, 47: $Vm, 49: $Vn, 53: $Vo, 58: $Vp, 59: $Vq, 60: $Vr, 61: $Vs, 69: $Vt, 79: $V3 }, { 4: $V5, 5: $V6, 6: 41, 9: 14, 10: 16, 11: 6, 16: $V7, 17: 42, 20: $V8, 21: 20, 22: $V9, 25: $Va, 26: $Vb, 27: 24, 28: 25, 29: 26, 30: 27, 31: 28, 32: $Vc, 33: $Vd, 34: $Ve, 36: $Vf, 38: $Vg, 39: $Vh, 40: [1, 130], 41: $Vi, 42: $Vj, 43: $Vk, 45: $Vl, 47: $Vm, 49: $Vn, 53: $Vo, 58: $Vp, 59: $Vq, 60: $Vr, 61: $Vs, 69: $Vt, 79: $V3 }, { 4: $V5, 5: $V6, 6: 41, 9: 14, 10: 16, 11: 6, 16: $V7, 17: 42, 20: $V8, 21: 20, 22: $V9, 25: $Va, 26: $Vb, 27: 24, 28: 25, 29: 26, 30: 27, 31: 28, 32: $Vc, 33: $Vd, 34: $Ve, 36: $Vf, 38: $Vg, 39: $Vh, 40: [1, 131], 41: $Vi, 42: $Vj, 43: $Vk, 45: $Vl, 47: $Vm, 49: $Vn, 53: $Vo, 58: $Vp, 59: $Vq, 60: $Vr, 61: $Vs, 69: $Vt, 79: $V3 }, { 40: [1, 132] }, { 4: $V5, 5: $V6, 6: 41, 9: 14, 10: 16, 11: 6, 16: $V7, 17: 42, 20: $V8, 21: 20, 22: $V9, 25: $Va, 26: $Vb, 27: 24, 28: 25, 29: 26, 30: 27, 31: 28, 32: $Vc, 33: $Vd, 34: $Ve, 36: $Vf, 38: $Vg, 39: $Vh, 40: [2, 45], 41: $Vi, 42: $Vj, 43: $Vk, 45: $Vl, 47: $Vm, 49: $Vn, 52: [1, 133], 53: $Vo, 58: $Vp, 59: $Vq, 60: $Vr, 61: $Vs, 69: $Vt, 79: $V3 }, { 40: [1, 134] }, { 4: $V5, 5: $V6, 6: 41, 9: 14, 10: 16, 11: 6, 16: $V7, 17: 42, 20: $V8, 21: 20, 22: $V9, 25: $Va, 26: $Vb, 27: 24, 28: 25, 29: 26, 30: 27, 31: 28, 32: $Vc, 33: $Vd, 34: $Ve, 36: $Vf, 38: $Vg, 39: $Vh, 40: [2, 43], 41: $Vi, 42: $Vj, 43: $Vk, 45: $Vl, 47: $Vm, 49: $Vn, 51: [1, 135], 53: $Vo, 58: $Vp, 59: $Vq, 60: $Vr, 61: $Vs, 69: $Vt, 79: $V3 }, { 40: [1, 136] }, { 4: $V5, 5: $V6, 6: 41, 9: 14, 10: 16, 11: 6, 16: $V7, 17: 42, 20: $V8, 21: 20, 22: $V9, 25: $Va, 26: $Vb, 27: 24, 28: 25, 29: 26, 30: 27, 31: 28, 32: $Vc, 33: $Vd, 34: $Ve, 36: $Vf, 38: $Vg, 39: $Vh, 40: [2, 41], 41: $Vi, 42: $Vj, 43: $Vk, 45: $Vl, 47: $Vm, 49: $Vn, 50: [1, 137], 53: $Vo, 58: $Vp, 59: $Vq, 60: $Vr, 61: $Vs, 69: $Vt, 79: $V3 }, { 4: $V5, 5: $V6, 6: 41, 9: 14, 10: 16, 11: 6, 16: $V7, 17: 42, 20: $V8, 21: 20, 22: $V9, 25: $Va, 26: $Vb, 27: 24, 28: 25, 29: 26, 30: 27, 31: 28, 32: $Vc, 33: $Vd, 34: $Ve, 36: $Vf, 38: $Vg, 39: $Vh, 40: [1, 138], 41: $Vi, 42: $Vj, 43: $Vk, 45: $Vl, 47: $Vm, 49: $Vn, 53: $Vo, 58: $Vp, 59: $Vq, 60: $Vr, 61: $Vs, 69: $Vt, 79: $V3 }, { 17: 139, 69: $Vt }, { 17: 140, 69: $Vt }, { 55: 141, 78: $VB }, { 55: 142, 78: $VB }, { 55: 143, 78: $VB }, { 63: [1, 144], 78: [2, 56] }, { 5: [2, 49] }, { 5: [2, 71] }, { 5: [2, 50] }, { 5: [2, 51] }, { 5: [2, 52] }, { 5: [1, 145] }, { 5: [1, 146] }, { 5: [1, 147] }, o($Vv, [2, 17]), o($Vv, [2, 33]), o($Vv, [2, 34]), o($Vv, [2, 35]), o($Vv, [2, 36]), { 19: [1, 148] }, o($Vv, [2, 37]), { 19: [1, 149] }, o($Vv, [2, 38]), { 19: [1, 150] }, o($Vv, [2, 39]), { 55: 151, 78: $VB }, { 55: 152, 78: $VB }, { 5: [2, 61] }, { 5: [2, 47] }, { 5: [2, 48] }, { 17: 153, 69: $Vt }, o($VC, [2, 11]), o($Vv, [2, 12]), o($Vv, [2, 14]), o($Vx, $V4, { 8: 108, 44: 154 }), o($Vy, $V4, { 8: 110, 46: 155 }), o($Vz, $V4, { 8: 112, 48: 156 }), { 5: [2, 59] }, { 5: [2, 60] }, { 78: [2, 55] }, { 40: [2, 46] }, { 40: [2, 44] }, { 40: [2, 42] }], defaultActions: { 7: [2, 72], 8: [2, 1], 9: [2, 2], 10: [2, 3], 51: [2, 75], 86: [2, 57], 87: [2, 58], 94: [2, 74], 120: [2, 49], 121: [2, 71], 122: [2, 50], 123: [2, 51], 124: [2, 52], 141: [2, 61], 142: [2, 47], 143: [2, 48], 151: [2, 59], 152: [2, 60], 153: [2, 55], 154: [2, 46], 155: [2, 44], 156: [2, 42] }, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse2(input) { var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer2 = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer2.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer2; sharedState.yy.parser = this; if (typeof lexer2.yylloc == "undefined") { lexer2.yylloc = {}; } var yyloc = lexer2.yylloc; lstack.push(yyloc); var ranges = lexer2.options && lexer2.options.ranges; if (typeof sharedState.yy.parseError === "function") { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function lex() { var token; token = tstack.pop() || lexer2.lex() || EOF; if (typeof token !== "number") { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self2.symbols_[token] || token; } return token; } var symbol, state, action, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push("'" + this.terminals_[p] + "'"); } } if (lexer2.showPosition) { errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; } else { errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); } this.parseError(errStr, { text: lexer2.match, token: this.terminals_[symbol] || symbol, line: lexer2.yylineno, loc: yyloc, expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer2.yytext); lstack.push(lexer2.yylloc); stack.push(action[1]); symbol = null; { yyleng = lexer2.yyleng; yytext = lexer2.yytext; yylineno = lexer2.yylineno; yyloc = lexer2.yylloc; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== "undefined") { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; } }; var lexer = function() { var lexer2 = { EOF: 1, parseError: function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, setInput: function(input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; this.yylineno = this.yyleng = 0; this.yytext = this.matched = this.match = ""; this.conditionStack = ["INITIAL"]; this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; if (this.options.ranges) { this.yylloc.range = [0, 0]; } this.offset = 0; return this; }, input: function() { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, unput: function(ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); this.offset -= len; var oldLines = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1); this.matched = this.matched.substr(0, this.matched.length - 1); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, more: function() { this._more = true; return this; }, reject: function() { if (this.options.backtrack_lexer) { this._backtrack = true; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, less: function(n) { this.unput(this.match.slice(n)); }, pastInput: function() { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); }, upcomingInput: function() { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20 - next.length); } return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, ""); }, showPosition: function() { var pre = this.pastInput(); var c2 = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c2 + "^"; }, test_match: function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { backup = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { for (var k in backup) { this[k] = backup[k]; } return false; } return false; }, next: function() { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ""; this.match = ""; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; } else { return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } return false; } if (this._input === "") { return this.EOF; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, lex: function lex() { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, begin: function begin(condition) { this.conditionStack.push(condition); }, popState: function popState() { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, _currentRules: function _currentRules() { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, topState: function topState(n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, pushState: function pushState(condition) { this.begin(condition); }, stateStackSize: function stateStackSize() { return this.conditionStack.length; }, options: { "case-insensitive": true }, performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { switch ($avoiding_name_collisions) { case 0: this.begin("open_directive"); return 79; case 1: this.begin("type_directive"); return 80; case 2: this.popState(); this.begin("arg_directive"); return 14; case 3: this.popState(); this.popState(); return 82; case 4: return 81; case 5: return 5; case 6: break; case 7: break; case 8: break; case 9: break; case 10: break; case 11: return 23; case 12: this.begin("ID"); return 16; case 13: this.begin("ID"); return 20; case 14: yy_.yytext = yy_.yytext.trim(); this.begin("ALIAS"); return 69; case 15: this.popState(); this.popState(); this.begin("LINE"); return 18; case 16: this.popState(); this.popState(); return 5; case 17: this.begin("LINE"); return 39; case 18: this.begin("LINE"); return 41; case 19: this.begin("LINE"); return 42; case 20: this.begin("LINE"); return 43; case 21: this.begin("LINE"); return 52; case 22: this.begin("LINE"); return 45; case 23: this.begin("LINE"); return 51; case 24: this.begin("LINE"); return 47; case 25: this.begin("LINE"); return 50; case 26: this.begin("LINE"); return 49; case 27: this.popState(); return 19; case 28: return 40; case 29: return 64; case 30: return 65; case 31: return 58; case 32: return 59; case 33: return 60; case 34: return 61; case 35: return 56; case 36: return 53; case 37: this.begin("ID"); return 25; case 38: this.begin("ID"); return 26; case 39: return 32; case 40: return 33; case 41: this.begin("acc_title"); return 34; case 42: this.popState(); return "acc_title_value"; case 43: this.begin("acc_descr"); return 36; case 44: this.popState(); return "acc_descr_value"; case 45: this.begin("acc_descr_multiline"); break; case 46: this.popState(); break; case 47: return "acc_descr_multiline_value"; case 48: return 7; case 49: return 22; case 50: return 24; case 51: return 63; case 52: return 5; case 53: yy_.yytext = yy_.yytext.trim(); return 69; case 54: return 72; case 55: return 73; case 56: return 70; case 57: return 71; case 58: return 74; case 59: return 75; case 60: return 76; case 61: return 77; case 62: return 78; case 63: return 67; case 64: return 68; case 65: return 5; case 66: return "INVALID"; } }, rules: [/^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \n]+))/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:[^\->:\n,;]+?([\-]*[^\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:rect\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:and\b)/i, /^(?:critical\b)/i, /^(?:option\b)/i, /^(?:break\b)/i, /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:links\b)/i, /^(?:link\b)/i, /^(?:properties\b)/i, /^(?:details\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:title:\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:sequenceDiagram\b)/i, /^(?:autonumber\b)/i, /^(?:off\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i, /^(?:->>)/i, /^(?:-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?:-[\)])/i, /^(?:--[\)])/i, /^(?::(?:(?:no)?wrap)?[^#\n;]+)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i], conditions: { "acc_descr_multiline": { "rules": [46, 47], "inclusive": false }, "acc_descr": { "rules": [44], "inclusive": false }, "acc_title": { "rules": [42], "inclusive": false }, "open_directive": { "rules": [1, 8], "inclusive": false }, "type_directive": { "rules": [2, 3, 8], "inclusive": false }, "arg_directive": { "rules": [3, 4, 8], "inclusive": false }, "ID": { "rules": [7, 8, 14], "inclusive": false }, "ALIAS": { "rules": [7, 8, 15, 16], "inclusive": false }, "LINE": { "rules": [7, 8, 27], "inclusive": false }, "INITIAL": { "rules": [0, 5, 6, 8, 9, 10, 11, 12, 13, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66], "inclusive": true } } }; return lexer2; }(); parser2.lexer = lexer; function Parser() { this.yy = {}; } Parser.prototype = parser2; parser2.Parser = Parser; return new Parser(); }(); parser$2.parser = parser$2; const sequenceDetector = (txt) => { return txt.match(/^\s*sequenceDiagram/) !== null; }; let prevActor = void 0; let actors$1 = {}; let messages = []; let sequenceNumbersEnabled = false; let wrapEnabled; const parseDirective$3 = function(statement, context, type2) { mermaidAPI.parseDirective(this, statement, context, type2); }; const addActor = function(id, name2, description2, type2) { const old = actors$1[id]; if (old && name2 === old.name && description2 == null) return; if (description2 == null || description2.text == null) { description2 = { text: name2, wrap: null, type: type2 }; } if (type2 == null || description2.text == null) { description2 = { text: name2, wrap: null, type: type2 }; } actors$1[id] = { name: name2, description: description2.text, wrap: description2.wrap === void 0 && autoWrap() || !!description2.wrap, prevActor, links: {}, properties: {}, actorCnt: null, rectData: null, type: type2 || "participant" }; if (prevActor && actors$1[prevActor]) { actors$1[prevActor].nextActor = id; } prevActor = id; }; const activationCount = (part) => { let i; let count = 0; for (i = 0; i < messages.length; i++) { if (messages[i].type === LINETYPE.ACTIVE_START) { if (messages[i].from.actor === part) { count++; } } if (messages[i].type === LINETYPE.ACTIVE_END) { if (messages[i].from.actor === part) { count--; } } } return count; }; const addMessage = function(idFrom, idTo, message2, answer) { messages.push({ from: idFrom, to: idTo, message: message2.text, wrap: message2.wrap === void 0 && autoWrap() || !!message2.wrap, answer }); }; const addSignal = function(idFrom, idTo, message2 = { text: void 0, wrap: void 0 }, messageType) { if (messageType === LINETYPE.ACTIVE_END) { const cnt2 = activationCount(idFrom.actor); if (cnt2 < 1) { let error = new Error("Trying to inactivate an inactive participant (" + idFrom.actor + ")"); error.hash = { text: "->>-", token: "->>-", line: "1", loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, expected: ["'ACTIVE_PARTICIPANT'"] }; throw error; } } messages.push({ from: idFrom, to: idTo, message: message2.text, wrap: message2.wrap === void 0 && autoWrap() || !!message2.wrap, type: messageType }); return true; }; const getMessages = function() { return messages; }; const getActors$1 = function() { return actors$1; }; const getActor = function(id) { return actors$1[id]; }; const getActorKeys = function() { return Object.keys(actors$1); }; const enableSequenceNumbers = function() { sequenceNumbersEnabled = true; }; const disableSequenceNumbers = function() { sequenceNumbersEnabled = false; }; const showSequenceNumbers = () => sequenceNumbersEnabled; const setWrap = function(wrapSetting) { wrapEnabled = wrapSetting; }; const autoWrap = () => { if (typeof wrapEnabled !== "undefined") { return wrapEnabled; } return getConfig$1().sequence.wrap; }; const clear$2 = function() { actors$1 = {}; messages = []; sequenceNumbersEnabled = false; clear$g(); }; const parseMessage = function(str) { const _str = str.trim(); const message2 = { text: _str.replace(/^[:]?(?:no)?wrap:/, "").trim(), wrap: _str.match(/^[:]?wrap:/) !== null ? true : _str.match(/^[:]?nowrap:/) !== null ? false : void 0 }; log$1.debug("parseMessage:", message2); return message2; }; const LINETYPE = { SOLID: 0, DOTTED: 1, NOTE: 2, SOLID_CROSS: 3, DOTTED_CROSS: 4, SOLID_OPEN: 5, DOTTED_OPEN: 6, LOOP_START: 10, LOOP_END: 11, ALT_START: 12, ALT_ELSE: 13, ALT_END: 14, OPT_START: 15, OPT_END: 16, ACTIVE_START: 17, ACTIVE_END: 18, PAR_START: 19, PAR_AND: 20, PAR_END: 21, RECT_START: 22, RECT_END: 23, SOLID_POINT: 24, DOTTED_POINT: 25, AUTONUMBER: 26, CRITICAL_START: 27, CRITICAL_OPTION: 28, CRITICAL_END: 29, BREAK_START: 30, BREAK_END: 31 }; const ARROWTYPE = { FILLED: 0, OPEN: 1 }; const PLACEMENT = { LEFTOF: 0, RIGHTOF: 1, OVER: 2 }; const addNote = function(actor, placement, message2) { ({ actor, placement, message: message2.text, wrap: message2.wrap === void 0 && autoWrap() || !!message2.wrap }); const actors2 = [].concat(actor, actor); messages.push({ from: actors2[0], to: actors2[1], message: message2.text, wrap: message2.wrap === void 0 && autoWrap() || !!message2.wrap, type: LINETYPE.NOTE, placement }); }; const addLinks = function(actorId, text) { const actor = getActor(actorId); try { let sanitizedText = sanitizeText$5(text.text, getConfig$1()); sanitizedText = sanitizedText.replace(/&/g, "&"); sanitizedText = sanitizedText.replace(/=/g, "="); const links2 = JSON.parse(sanitizedText); insertLinks(actor, links2); } catch (e) { log$1.error("error while parsing actor link text", e); } }; const addALink = function(actorId, text) { const actor = getActor(actorId); try { const links2 = {}; let sanitizedText = sanitizeText$5(text.text, getConfig$1()); var sep = sanitizedText.indexOf("@"); sanitizedText = sanitizedText.replace(/&/g, "&"); sanitizedText = sanitizedText.replace(/=/g, "="); var label = sanitizedText.slice(0, sep - 1).trim(); var link = sanitizedText.slice(sep + 1).trim(); links2[label] = link; insertLinks(actor, links2); } catch (e) { log$1.error("error while parsing actor link text", e); } }; function insertLinks(actor, links2) { if (actor.links == null) { actor.links = links2; } else { for (let key in links2) { actor.links[key] = links2[key]; } } } const addProperties = function(actorId, text) { const actor = getActor(actorId); try { let sanitizedText = sanitizeText$5(text.text, getConfig$1()); const properties = JSON.parse(sanitizedText); insertProperties(actor, properties); } catch (e) { log$1.error("error while parsing actor properties text", e); } }; function insertProperties(actor, properties) { if (actor.properties == null) { actor.properties = properties; } else { for (let key in properties) { actor.properties[key] = properties[key]; } } } const addDetails = function(actorId, text) { const actor = getActor(actorId); const elem = document.getElementById(text.text); try { const text2 = elem.innerHTML; const details = JSON.parse(text2); if (details["properties"]) { insertProperties(actor, details["properties"]); } if (details["links"]) { insertLinks(actor, details["links"]); } } catch (e) { log$1.error("error while parsing actor details text", e); } }; const getActorProperty = function(actor, key) { if (typeof actor !== "undefined" && typeof actor.properties !== "undefined") { return actor.properties[key]; } return void 0; }; const apply = function(param) { if (param instanceof Array) { param.forEach(function(item) { apply(item); }); } else { switch (param.type) { case "sequenceIndex": messages.push({ from: void 0, to: void 0, message: { start: param.sequenceIndex, step: param.sequenceIndexStep, visible: param.sequenceVisible }, wrap: false, type: param.signalType }); break; case "addParticipant": addActor(param.actor, param.actor, param.description, "participant"); break; case "addActor": addActor(param.actor, param.actor, param.description, "actor"); break; case "activeStart": addSignal(param.actor, void 0, void 0, param.signalType); break; case "activeEnd": addSignal(param.actor, void 0, void 0, param.signalType); break; case "addNote": addNote(param.actor, param.placement, param.text); break; case "addLinks": addLinks(param.actor, param.text); break; case "addALink": addALink(param.actor, param.text); break; case "addProperties": addProperties(param.actor, param.text); break; case "addDetails": addDetails(param.actor, param.text); break; case "addMessage": addSignal(param.from, param.to, param.msg, param.signalType); break; case "loopStart": addSignal(void 0, void 0, param.loopText, param.signalType); break; case "loopEnd": addSignal(void 0, void 0, void 0, param.signalType); break; case "rectStart": addSignal(void 0, void 0, param.color, param.signalType); break; case "rectEnd": addSignal(void 0, void 0, void 0, param.signalType); break; case "optStart": addSignal(void 0, void 0, param.optText, param.signalType); break; case "optEnd": addSignal(void 0, void 0, void 0, param.signalType); break; case "altStart": addSignal(void 0, void 0, param.altText, param.signalType); break; case "else": addSignal(void 0, void 0, param.altText, param.signalType); break; case "altEnd": addSignal(void 0, void 0, void 0, param.signalType); break; case "setAccTitle": setAccTitle(param.text); break; case "parStart": addSignal(void 0, void 0, param.parText, param.signalType); break; case "and": addSignal(void 0, void 0, param.parText, param.signalType); break; case "parEnd": addSignal(void 0, void 0, void 0, param.signalType); break; case "criticalStart": addSignal(void 0, void 0, param.criticalText, param.signalType); break; case "option": addSignal(void 0, void 0, param.optionText, param.signalType); break; case "criticalEnd": addSignal(void 0, void 0, void 0, param.signalType); break; case "breakStart": addSignal(void 0, void 0, param.breakText, param.signalType); break; case "breakEnd": addSignal(void 0, void 0, void 0, param.signalType); break; } } }; const sequenceDb = { addActor, addMessage, addSignal, addLinks, addDetails, addProperties, autoWrap, setWrap, enableSequenceNumbers, disableSequenceNumbers, showSequenceNumbers, getMessages, getActors: getActors$1, getActor, getActorKeys, getActorProperty, getAccTitle, getDiagramTitle, setDiagramTitle, parseDirective: parseDirective$3, getConfig: () => getConfig$1().sequence, clear: clear$2, parseMessage, LINETYPE, ARROWTYPE, PLACEMENT, addNote, setAccTitle, apply, setAccDescription, getAccDescription }; let interactionFunctions = []; const addFunction = (func) => { interactionFunctions.push(func); }; const attachFunctions = () => { interactionFunctions.forEach((f) => { f(); }); interactionFunctions = []; }; const drawRect$1 = function(elem, rectData) { const rectElem = elem.append("rect"); rectElem.attr("x", rectData.x); rectElem.attr("y", rectData.y); rectElem.attr("fill", rectData.fill); rectElem.attr("stroke", rectData.stroke); rectElem.attr("width", rectData.width); rectElem.attr("height", rectData.height); rectElem.attr("rx", rectData.rx); rectElem.attr("ry", rectData.ry); if (typeof rectData.class !== "undefined") { rectElem.attr("class", rectData.class); } return rectElem; }; const addPopupInteraction = (id, actorCnt2) => { addFunction(() => { const arr = document.querySelectorAll(id); if (arr.length === 0) return; arr[0].addEventListener("mouseover", function() { popupMenuUpFunc("actor" + actorCnt2 + "_popup"); }); arr[0].addEventListener("mouseout", function() { popupMenuDownFunc("actor" + actorCnt2 + "_popup"); }); }); }; const drawPopup = function(elem, actor, minMenuWidth, textAttrs, forceMenus) { if (actor.links === void 0 || actor.links === null || Object.keys(actor.links).length === 0) { return { height: 0, width: 0 }; } const links2 = actor.links; const actorCnt2 = actor.actorCnt; const rectData = actor.rectData; var displayValue = "none"; if (forceMenus) { displayValue = "block !important"; } const g = elem.append("g"); g.attr("id", "actor" + actorCnt2 + "_popup"); g.attr("class", "actorPopupMenu"); g.attr("display", displayValue); addPopupInteraction("#actor" + actorCnt2 + "_popup", actorCnt2); var actorClass = ""; if (typeof rectData.class !== "undefined") { actorClass = " " + rectData.class; } let menuWidth = rectData.width > minMenuWidth ? rectData.width : minMenuWidth; const rectElem = g.append("rect"); rectElem.attr("class", "actorPopupMenuPanel" + actorClass); rectElem.attr("x", rectData.x); rectElem.attr("y", rectData.height); rectElem.attr("fill", rectData.fill); rectElem.attr("stroke", rectData.stroke); rectElem.attr("width", menuWidth); rectElem.attr("height", rectData.height); rectElem.attr("rx", rectData.rx); rectElem.attr("ry", rectData.ry); if (links2 != null) { var linkY = 20; for (let key in links2) { var linkElem = g.append("a"); var sanitizedLink = sanitizeUrl(links2[key]); linkElem.attr("xlink:href", sanitizedLink); linkElem.attr("target", "_blank"); _drawMenuItemTextCandidateFunc(textAttrs)( key, linkElem, rectData.x + 10, rectData.height + linkY, menuWidth, 20, { class: "actor" }, textAttrs ); linkY += 30; } } rectElem.attr("height", linkY); return { height: rectData.height + linkY, width: menuWidth }; }; const drawImage = function(elem, x, y, link) { const imageElem = elem.append("image"); imageElem.attr("x", x); imageElem.attr("y", y); var sanitizedLink = sanitizeUrl(link); imageElem.attr("xlink:href", sanitizedLink); }; const drawEmbeddedImage = function(elem, x, y, link) { const imageElem = elem.append("use"); imageElem.attr("x", x); imageElem.attr("y", y); var sanitizedLink = sanitizeUrl(link); imageElem.attr("xlink:href", "#" + sanitizedLink); }; const popupMenu = function(popid) { return "var pu = document.getElementById('" + popid + "'); if (pu != null) { pu.style.display = 'block'; }"; }; const popdownMenu = function(popid) { return "var pu = document.getElementById('" + popid + "'); if (pu != null) { pu.style.display = 'none'; }"; }; const popupMenuUpFunc = function(popupId) { var pu = document.getElementById(popupId); if (pu != null) { pu.style.display = "block"; } }; const popupMenuDownFunc = function(popupId) { var pu = document.getElementById(popupId); if (pu != null) { pu.style.display = "none"; } }; const drawText$1 = function(elem, textData) { let prevTextHeight = 0, textHeight = 0; const lines = textData.text.split(common.lineBreakRegex); let textElems = []; let dy = 0; let yfunc = () => textData.y; if (typeof textData.valign !== "undefined" && typeof textData.textMargin !== "undefined" && textData.textMargin > 0) { switch (textData.valign) { case "top": case "start": yfunc = () => Math.round(textData.y + textData.textMargin); break; case "middle": case "center": yfunc = () => Math.round(textData.y + (prevTextHeight + textHeight + textData.textMargin) / 2); break; case "bottom": case "end": yfunc = () => Math.round( textData.y + (prevTextHeight + textHeight + 2 * textData.textMargin) - textData.textMargin ); break; } } if (typeof textData.anchor !== "undefined" && typeof textData.textMargin !== "undefined" && typeof textData.width !== "undefined") { switch (textData.anchor) { case "left": case "start": textData.x = Math.round(textData.x + textData.textMargin); textData.anchor = "start"; textData.dominantBaseline = "middle"; textData.alignmentBaseline = "middle"; break; case "middle": case "center": textData.x = Math.round(textData.x + textData.width / 2); textData.anchor = "middle"; textData.dominantBaseline = "middle"; textData.alignmentBaseline = "middle"; break; case "right": case "end": textData.x = Math.round(textData.x + textData.width - textData.textMargin); textData.anchor = "end"; textData.dominantBaseline = "middle"; textData.alignmentBaseline = "middle"; break; } } for (let i = 0; i < lines.length; i++) { let line2 = lines[i]; if (typeof textData.textMargin !== "undefined" && textData.textMargin === 0 && typeof textData.fontSize !== "undefined") { dy = i * textData.fontSize; } const textElem = elem.append("text"); textElem.attr("x", textData.x); textElem.attr("y", yfunc()); if (typeof textData.anchor !== "undefined") { textElem.attr("text-anchor", textData.anchor).attr("dominant-baseline", textData.dominantBaseline).attr("alignment-baseline", textData.alignmentBaseline); } if (typeof textData.fontFamily !== "undefined") { textElem.style("font-family", textData.fontFamily); } if (typeof textData.fontSize !== "undefined") { textElem.style("font-size", textData.fontSize); } if (typeof textData.fontWeight !== "undefined") { textElem.style("font-weight", textData.fontWeight); } if (typeof textData.fill !== "undefined") { textElem.attr("fill", textData.fill); } if (typeof textData.class !== "undefined") { textElem.attr("class", textData.class); } if (typeof textData.dy !== "undefined") { textElem.attr("dy", textData.dy); } else if (dy !== 0) { textElem.attr("dy", dy); } if (textData.tspan) { const span = textElem.append("tspan"); span.attr("x", textData.x); if (typeof textData.fill !== "undefined") { span.attr("fill", textData.fill); } span.text(line2); } else { textElem.text(line2); } if (typeof textData.valign !== "undefined" && typeof textData.textMargin !== "undefined" && textData.textMargin > 0) { textHeight += (textElem._groups || textElem)[0][0].getBBox().height; prevTextHeight = textHeight; } textElems.push(textElem); } return textElems; }; const drawLabel$1 = function(elem, txtObject) { function genPoints(x, y, width2, height2, cut) { return x + "," + y + " " + (x + width2) + "," + y + " " + (x + width2) + "," + (y + height2 - cut) + " " + (x + width2 - cut * 1.2) + "," + (y + height2) + " " + x + "," + (y + height2); } const polygon = elem.append("polygon"); polygon.attr("points", genPoints(txtObject.x, txtObject.y, txtObject.width, txtObject.height, 7)); polygon.attr("class", "labelBox"); txtObject.y = txtObject.y + txtObject.height / 2; drawText$1(elem, txtObject); return polygon; }; let actorCnt = -1; const fixLifeLineHeights = (diagram, bounds2) => { if (!diagram.selectAll) return; diagram.selectAll(".actor-line").attr("class", "200").attr("y2", bounds2 - 55); }; const drawActorTypeParticipant = function(elem, actor, conf2) { const center = actor.x + actor.width / 2; const boxpluslineGroup = elem.append("g"); var g = boxpluslineGroup; if (actor.y === 0) { actorCnt++; g.append("line").attr("id", "actor" + actorCnt).attr("x1", center).attr("y1", 5).attr("x2", center).attr("y2", 2e3).attr("class", "actor-line").attr("stroke-width", "0.5px").attr("stroke", "#999"); g = boxpluslineGroup.append("g"); actor.actorCnt = actorCnt; if (actor.links != null) { g.attr("id", "root-" + actorCnt); addPopupInteraction("#root-" + actorCnt, actorCnt); } } const rect2 = getNoteRect$1(); var cssclass = "actor"; if (actor.properties != null && actor.properties["class"]) { cssclass = actor.properties["class"]; } else { rect2.fill = "#eaeaea"; } rect2.x = actor.x; rect2.y = actor.y; rect2.width = actor.width; rect2.height = actor.height; rect2.class = cssclass; rect2.rx = 3; rect2.ry = 3; const rectElem = drawRect$1(g, rect2); actor.rectData = rect2; if (actor.properties != null && actor.properties["icon"]) { const iconSrc = actor.properties["icon"].trim(); if (iconSrc.charAt(0) === "@") { drawEmbeddedImage(g, rect2.x + rect2.width - 20, rect2.y + 10, iconSrc.substr(1)); } else { drawImage(g, rect2.x + rect2.width - 20, rect2.y + 10, iconSrc); } } _drawTextCandidateFunc$1(conf2)( actor.description, g, rect2.x, rect2.y, rect2.width, rect2.height, { class: "actor" }, conf2 ); let height2 = actor.height; if (rectElem.node) { const bounds2 = rectElem.node().getBBox(); actor.height = bounds2.height; height2 = bounds2.height; } return height2; }; const drawActorTypeActor = function(elem, actor, conf2) { const center = actor.x + actor.width / 2; if (actor.y === 0) { actorCnt++; elem.append("line").attr("id", "actor" + actorCnt).attr("x1", center).attr("y1", 80).attr("x2", center).attr("y2", 2e3).attr("class", "actor-line").attr("stroke-width", "0.5px").attr("stroke", "#999"); } const actElem = elem.append("g"); actElem.attr("class", "actor-man"); const rect2 = getNoteRect$1(); rect2.x = actor.x; rect2.y = actor.y; rect2.fill = "#eaeaea"; rect2.width = actor.width; rect2.height = actor.height; rect2.class = "actor"; rect2.rx = 3; rect2.ry = 3; actElem.append("line").attr("id", "actor-man-torso" + actorCnt).attr("x1", center).attr("y1", actor.y + 25).attr("x2", center).attr("y2", actor.y + 45); actElem.append("line").attr("id", "actor-man-arms" + actorCnt).attr("x1", center - 18).attr("y1", actor.y + 33).attr("x2", center + 18).attr("y2", actor.y + 33); actElem.append("line").attr("x1", center - 18).attr("y1", actor.y + 60).attr("x2", center).attr("y2", actor.y + 45); actElem.append("line").attr("x1", center).attr("y1", actor.y + 45).attr("x2", center + 16).attr("y2", actor.y + 60); const circle2 = actElem.append("circle"); circle2.attr("cx", actor.x + actor.width / 2); circle2.attr("cy", actor.y + 10); circle2.attr("r", 15); circle2.attr("width", actor.width); circle2.attr("height", actor.height); const bounds2 = actElem.node().getBBox(); actor.height = bounds2.height; _drawTextCandidateFunc$1(conf2)( actor.description, actElem, rect2.x, rect2.y + 35, rect2.width, rect2.height, { class: "actor" }, conf2 ); return actor.height; }; const drawActor = function(elem, actor, conf2) { switch (actor.type) { case "actor": return drawActorTypeActor(elem, actor, conf2); case "participant": return drawActorTypeParticipant(elem, actor, conf2); } }; const anchorElement = function(elem) { return elem.append("g"); }; const drawActivation = function(elem, bounds2, verticalPos, conf2, actorActivations2) { const rect2 = getNoteRect$1(); const g = bounds2.anchored; rect2.x = bounds2.startx; rect2.y = bounds2.starty; rect2.class = "activation" + actorActivations2 % 3; rect2.width = bounds2.stopx - bounds2.startx; rect2.height = verticalPos - bounds2.starty; drawRect$1(g, rect2); }; const drawLoop = function(elem, loopModel, labelText, conf2) { const { boxMargin, boxTextMargin, labelBoxHeight, labelBoxWidth, messageFontFamily: fontFamily, messageFontSize: fontSize, messageFontWeight: fontWeight } = conf2; const g = elem.append("g"); const drawLoopLine = function(startx, starty, stopx, stopy) { return g.append("line").attr("x1", startx).attr("y1", starty).attr("x2", stopx).attr("y2", stopy).attr("class", "loopLine"); }; drawLoopLine(loopModel.startx, loopModel.starty, loopModel.stopx, loopModel.starty); drawLoopLine(loopModel.stopx, loopModel.starty, loopModel.stopx, loopModel.stopy); drawLoopLine(loopModel.startx, loopModel.stopy, loopModel.stopx, loopModel.stopy); drawLoopLine(loopModel.startx, loopModel.starty, loopModel.startx, loopModel.stopy); if (typeof loopModel.sections !== "undefined") { loopModel.sections.forEach(function(item) { drawLoopLine(loopModel.startx, item.y, loopModel.stopx, item.y).style( "stroke-dasharray", "3, 3" ); }); } let txt = getTextObj$1(); txt.text = labelText; txt.x = loopModel.startx; txt.y = loopModel.starty; txt.fontFamily = fontFamily; txt.fontSize = fontSize; txt.fontWeight = fontWeight; txt.anchor = "middle"; txt.valign = "middle"; txt.tspan = false; txt.width = labelBoxWidth || 50; txt.height = labelBoxHeight || 20; txt.textMargin = boxTextMargin; txt.class = "labelText"; drawLabel$1(g, txt); txt = getTextObj$1(); txt.text = loopModel.title; txt.x = loopModel.startx + labelBoxWidth / 2 + (loopModel.stopx - loopModel.startx) / 2; txt.y = loopModel.starty + boxMargin + boxTextMargin; txt.anchor = "middle"; txt.valign = "middle"; txt.textMargin = boxTextMargin; txt.class = "loopText"; txt.fontFamily = fontFamily; txt.fontSize = fontSize; txt.fontWeight = fontWeight; txt.wrap = true; let textElem = drawText$1(g, txt); if (typeof loopModel.sectionTitles !== "undefined") { loopModel.sectionTitles.forEach(function(item, idx) { if (item.message) { txt.text = item.message; txt.x = loopModel.startx + (loopModel.stopx - loopModel.startx) / 2; txt.y = loopModel.sections[idx].y + boxMargin + boxTextMargin; txt.class = "loopText"; txt.anchor = "middle"; txt.valign = "middle"; txt.tspan = false; txt.fontFamily = fontFamily; txt.fontSize = fontSize; txt.fontWeight = fontWeight; txt.wrap = loopModel.wrap; textElem = drawText$1(g, txt); let sectionHeight = Math.round( textElem.map((te) => (te._groups || te)[0][0].getBBox().height).reduce((acc, curr) => acc + curr) ); loopModel.sections[idx].height += sectionHeight - (boxMargin + boxTextMargin); } }); } loopModel.height = Math.round(loopModel.stopy - loopModel.starty); return g; }; const drawBackgroundRect$1 = function(elem, bounds2) { const rectElem = drawRect$1(elem, { x: bounds2.startx, y: bounds2.starty, width: bounds2.stopx - bounds2.startx, height: bounds2.stopy - bounds2.starty, fill: bounds2.fill, class: "rect" }); rectElem.lower(); }; const insertDatabaseIcon = function(elem) { elem.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr( "d", "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z" ); }; const insertComputerIcon = function(elem) { elem.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr( "d", "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z" ); }; const insertClockIcon = function(elem) { elem.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr( "d", "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z" ); }; const insertArrowHead = function(elem) { elem.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z"); }; const insertArrowFilledHead = function(elem) { elem.append("defs").append("marker").attr("id", "filled-head").attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); }; const insertSequenceNumber = function(elem) { elem.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6); }; const insertArrowCrossHead = function(elem) { const defs = elem.append("defs"); const marker = defs.append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 16).attr("refY", 4); marker.append("path").attr("fill", "black").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 9,2 V 6 L16,4 Z"); marker.append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 0,1 L 6,7 M 6,1 L 0,7"); }; const getTextObj$1 = function() { return { x: 0, y: 0, fill: void 0, anchor: void 0, style: "#666", width: void 0, height: void 0, textMargin: 0, rx: 0, ry: 0, tspan: true, valign: void 0 }; }; const getNoteRect$1 = function() { return { x: 0, y: 0, fill: "#EDF2AE", stroke: "#666", width: 100, anchor: "start", height: 100, rx: 0, ry: 0 }; }; const _drawTextCandidateFunc$1 = function() { function byText(content, g, x, y, width2, height2, textAttrs) { const text = g.append("text").attr("x", x + width2 / 2).attr("y", y + height2 / 2 + 5).style("text-anchor", "middle").text(content); _setTextAttrs(text, textAttrs); } function byTspan(content, g, x, y, width2, height2, textAttrs, conf2) { const { actorFontSize, actorFontFamily, actorFontWeight } = conf2; let _actorFontSize = actorFontSize && actorFontSize.replace ? actorFontSize.replace("px", "") : actorFontSize; const lines = content.split(common.lineBreakRegex); for (let i = 0; i < lines.length; i++) { const dy = i * _actorFontSize - _actorFontSize * (lines.length - 1) / 2; const text = g.append("text").attr("x", x + width2 / 2).attr("y", y).style("text-anchor", "middle").style("font-size", actorFontSize).style("font-weight", actorFontWeight).style("font-family", actorFontFamily); text.append("tspan").attr("x", x + width2 / 2).attr("dy", dy).text(lines[i]); text.attr("y", y + height2 / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"); _setTextAttrs(text, textAttrs); } } function byFo(content, g, x, y, width2, height2, textAttrs, conf2) { const s = g.append("switch"); const f = s.append("foreignObject").attr("x", x).attr("y", y).attr("width", width2).attr("height", height2); const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%"); text.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content); byTspan(content, s, x, y, width2, height2, textAttrs, conf2); _setTextAttrs(text, textAttrs); } function _setTextAttrs(toText, fromTextAttrsDict) { for (const key in fromTextAttrsDict) { if (fromTextAttrsDict.hasOwnProperty(key)) { toText.attr(key, fromTextAttrsDict[key]); } } } return function(conf2) { return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan; }; }(); const _drawMenuItemTextCandidateFunc = function() { function byText(content, g, x, y, width2, height2, textAttrs) { const text = g.append("text").attr("x", x).attr("y", y).style("text-anchor", "start").text(content); _setTextAttrs(text, textAttrs); } function byTspan(content, g, x, y, width2, height2, textAttrs, conf2) { const { actorFontSize, actorFontFamily, actorFontWeight } = conf2; const lines = content.split(common.lineBreakRegex); for (let i = 0; i < lines.length; i++) { const dy = i * actorFontSize - actorFontSize * (lines.length - 1) / 2; const text = g.append("text").attr("x", x).attr("y", y).style("text-anchor", "start").style("font-size", actorFontSize).style("font-weight", actorFontWeight).style("font-family", actorFontFamily); text.append("tspan").attr("x", x).attr("dy", dy).text(lines[i]); text.attr("y", y + height2 / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"); _setTextAttrs(text, textAttrs); } } function byFo(content, g, x, y, width2, height2, textAttrs, conf2) { const s = g.append("switch"); const f = s.append("foreignObject").attr("x", x).attr("y", y).attr("width", width2).attr("height", height2); const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%"); text.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content); byTspan(content, s, x, y, width2, height2, textAttrs, conf2); _setTextAttrs(text, textAttrs); } function _setTextAttrs(toText, fromTextAttrsDict) { for (const key in fromTextAttrsDict) { if (fromTextAttrsDict.hasOwnProperty(key)) { toText.attr(key, fromTextAttrsDict[key]); } } } return function(conf2) { return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan; }; }(); const svgDraw$1 = { drawRect: drawRect$1, drawText: drawText$1, drawLabel: drawLabel$1, drawActor, drawPopup, drawImage, drawEmbeddedImage, anchorElement, drawActivation, drawLoop, drawBackgroundRect: drawBackgroundRect$1, insertArrowHead, insertArrowFilledHead, insertSequenceNumber, insertArrowCrossHead, insertDatabaseIcon, insertComputerIcon, insertClockIcon, getTextObj: getTextObj$1, getNoteRect: getNoteRect$1, popupMenu, popdownMenu, fixLifeLineHeights, sanitizeUrl }; let conf$4 = {}; const bounds$1 = { data: { startx: void 0, stopx: void 0, starty: void 0, stopy: void 0 }, verticalPos: 0, sequenceItems: [], activations: [], models: { getHeight: function() { return Math.max.apply( null, this.actors.length === 0 ? [0] : this.actors.map((actor) => actor.height || 0) ) + (this.loops.length === 0 ? 0 : this.loops.map((it) => it.height || 0).reduce((acc, h) => acc + h)) + (this.messages.length === 0 ? 0 : this.messages.map((it) => it.height || 0).reduce((acc, h) => acc + h)) + (this.notes.length === 0 ? 0 : this.notes.map((it) => it.height || 0).reduce((acc, h) => acc + h)); }, clear: function() { this.actors = []; this.loops = []; this.messages = []; this.notes = []; }, addActor: function(actorModel) { this.actors.push(actorModel); }, addLoop: function(loopModel) { this.loops.push(loopModel); }, addMessage: function(msgModel) { this.messages.push(msgModel); }, addNote: function(noteModel) { this.notes.push(noteModel); }, lastActor: function() { return this.actors[this.actors.length - 1]; }, lastLoop: function() { return this.loops[this.loops.length - 1]; }, lastMessage: function() { return this.messages[this.messages.length - 1]; }, lastNote: function() { return this.notes[this.notes.length - 1]; }, actors: [], loops: [], messages: [], notes: [] }, init: function() { this.sequenceItems = []; this.activations = []; this.models.clear(); this.data = { startx: void 0, stopx: void 0, starty: void 0, stopy: void 0 }; this.verticalPos = 0; setConf$4(getConfig$1()); }, updateVal: function(obj, key, val, fun) { if (typeof obj[key] === "undefined") { obj[key] = val; } else { obj[key] = fun(val, obj[key]); } }, updateBounds: function(startx, starty, stopx, stopy) { const _self = this; let cnt2 = 0; function updateFn(type2) { return function updateItemBounds(item) { cnt2++; const n = _self.sequenceItems.length - cnt2 + 1; _self.updateVal(item, "starty", starty - n * conf$4.boxMargin, Math.min); _self.updateVal(item, "stopy", stopy + n * conf$4.boxMargin, Math.max); _self.updateVal(bounds$1.data, "startx", startx - n * conf$4.boxMargin, Math.min); _self.updateVal(bounds$1.data, "stopx", stopx + n * conf$4.boxMargin, Math.max); if (!(type2 === "activation")) { _self.updateVal(item, "startx", startx - n * conf$4.boxMargin, Math.min); _self.updateVal(item, "stopx", stopx + n * conf$4.boxMargin, Math.max); _self.updateVal(bounds$1.data, "starty", starty - n * conf$4.boxMargin, Math.min); _self.updateVal(bounds$1.data, "stopy", stopy + n * conf$4.boxMargin, Math.max); } }; } this.sequenceItems.forEach(updateFn()); this.activations.forEach(updateFn("activation")); }, insert: function(startx, starty, stopx, stopy) { const _startx = Math.min(startx, stopx); const _stopx = Math.max(startx, stopx); const _starty = Math.min(starty, stopy); const _stopy = Math.max(starty, stopy); this.updateVal(bounds$1.data, "startx", _startx, Math.min); this.updateVal(bounds$1.data, "starty", _starty, Math.min); this.updateVal(bounds$1.data, "stopx", _stopx, Math.max); this.updateVal(bounds$1.data, "stopy", _stopy, Math.max); this.updateBounds(_startx, _starty, _stopx, _stopy); }, newActivation: function(message2, diagram, actors2) { const actorRect = actors2[message2.from.actor]; const stackedSize = actorActivations(message2.from.actor).length || 0; const x = actorRect.x + actorRect.width / 2 + (stackedSize - 1) * conf$4.activationWidth / 2; this.activations.push({ startx: x, starty: this.verticalPos + 2, stopx: x + conf$4.activationWidth, stopy: void 0, actor: message2.from.actor, anchored: svgDraw$1.anchorElement(diagram) }); }, endActivation: function(message2) { const lastActorActivationIdx = this.activations.map(function(activation) { return activation.actor; }).lastIndexOf(message2.from.actor); return this.activations.splice(lastActorActivationIdx, 1)[0]; }, createLoop: function(title2 = { message: void 0, wrap: false, width: void 0 }, fill) { return { startx: void 0, starty: this.verticalPos, stopx: void 0, stopy: void 0, title: title2.message, wrap: title2.wrap, width: title2.width, height: 0, fill }; }, newLoop: function(title2 = { message: void 0, wrap: false, width: void 0 }, fill) { this.sequenceItems.push(this.createLoop(title2, fill)); }, endLoop: function() { return this.sequenceItems.pop(); }, addSectionToLoop: function(message2) { const loop = this.sequenceItems.pop(); loop.sections = loop.sections || []; loop.sectionTitles = loop.sectionTitles || []; loop.sections.push({ y: bounds$1.getVerticalPos(), height: 0 }); loop.sectionTitles.push(message2); this.sequenceItems.push(loop); }, bumpVerticalPos: function(bump) { this.verticalPos = this.verticalPos + bump; this.data.stopy = this.verticalPos; }, getVerticalPos: function() { return this.verticalPos; }, getBounds: function() { return { bounds: this.data, models: this.models }; } }; const drawNote$1 = function(elem, noteModel) { bounds$1.bumpVerticalPos(conf$4.boxMargin); noteModel.height = conf$4.boxMargin; noteModel.starty = bounds$1.getVerticalPos(); const rect2 = svgDraw$1.getNoteRect(); rect2.x = noteModel.startx; rect2.y = noteModel.starty; rect2.width = noteModel.width || conf$4.width; rect2.class = "note"; const g = elem.append("g"); const rectElem = svgDraw$1.drawRect(g, rect2); const textObj = svgDraw$1.getTextObj(); textObj.x = noteModel.startx; textObj.y = noteModel.starty; textObj.width = rect2.width; textObj.dy = "1em"; textObj.text = noteModel.message; textObj.class = "noteText"; textObj.fontFamily = conf$4.noteFontFamily; textObj.fontSize = conf$4.noteFontSize; textObj.fontWeight = conf$4.noteFontWeight; textObj.anchor = conf$4.noteAlign; textObj.textMargin = conf$4.noteMargin; textObj.valign = "center"; const textElem = drawText$1(g, textObj); const textHeight = Math.round( textElem.map((te) => (te._groups || te)[0][0].getBBox().height).reduce((acc, curr) => acc + curr) ); rectElem.attr("height", textHeight + 2 * conf$4.noteMargin); noteModel.height += textHeight + 2 * conf$4.noteMargin; bounds$1.bumpVerticalPos(textHeight + 2 * conf$4.noteMargin); noteModel.stopy = noteModel.starty + textHeight + 2 * conf$4.noteMargin; noteModel.stopx = noteModel.startx + rect2.width; bounds$1.insert(noteModel.startx, noteModel.starty, noteModel.stopx, noteModel.stopy); bounds$1.models.addNote(noteModel); }; const messageFont = (cnf) => { return { fontFamily: cnf.messageFontFamily, fontSize: cnf.messageFontSize, fontWeight: cnf.messageFontWeight }; }; const noteFont = (cnf) => { return { fontFamily: cnf.noteFontFamily, fontSize: cnf.noteFontSize, fontWeight: cnf.noteFontWeight }; }; const actorFont = (cnf) => { return { fontFamily: cnf.actorFontFamily, fontSize: cnf.actorFontSize, fontWeight: cnf.actorFontWeight }; }; const boundMessage = function(diagram, msgModel) { bounds$1.bumpVerticalPos(10); const { startx, stopx, message: message2 } = msgModel; const lines = common.splitBreaks(message2).length; const textDims = utils.calculateTextDimensions(message2, messageFont(conf$4)); const lineHeight = textDims.height / lines; msgModel.height += lineHeight; bounds$1.bumpVerticalPos(lineHeight); let lineStarty; let totalOffset = textDims.height - 10; const textWidth = textDims.width; if (startx === stopx) { lineStarty = bounds$1.getVerticalPos() + totalOffset; if (!conf$4.rightAngles) { totalOffset += conf$4.boxMargin; lineStarty = bounds$1.getVerticalPos() + totalOffset; } totalOffset += 30; const dx = Math.max(textWidth / 2, conf$4.width / 2); bounds$1.insert( startx - dx, bounds$1.getVerticalPos() - 10 + totalOffset, stopx + dx, bounds$1.getVerticalPos() + 30 + totalOffset ); } else { totalOffset += conf$4.boxMargin; lineStarty = bounds$1.getVerticalPos() + totalOffset; bounds$1.insert(startx, lineStarty - 10, stopx, lineStarty); } bounds$1.bumpVerticalPos(totalOffset); msgModel.height += totalOffset; msgModel.stopy = msgModel.starty + msgModel.height; bounds$1.insert(msgModel.fromBounds, msgModel.starty, msgModel.toBounds, msgModel.stopy); return lineStarty; }; const drawMessage = function(diagram, msgModel, lineStarty, diagObj) { const { startx, stopx, starty, message: message2, type: type2, sequenceIndex, sequenceVisible } = msgModel; const textDims = utils.calculateTextDimensions(message2, messageFont(conf$4)); const textObj = svgDraw$1.getTextObj(); textObj.x = startx; textObj.y = starty + 10; textObj.width = stopx - startx; textObj.class = "messageText"; textObj.dy = "1em"; textObj.text = message2; textObj.fontFamily = conf$4.messageFontFamily; textObj.fontSize = conf$4.messageFontSize; textObj.fontWeight = conf$4.messageFontWeight; textObj.anchor = conf$4.messageAlign; textObj.valign = "center"; textObj.textMargin = conf$4.wrapPadding; textObj.tspan = false; drawText$1(diagram, textObj); const textWidth = textDims.width; let line2; if (startx === stopx) { if (conf$4.rightAngles) { line2 = diagram.append("path").attr( "d", `M ${startx},${lineStarty} H ${startx + Math.max(conf$4.width / 2, textWidth / 2)} V ${lineStarty + 25} H ${startx}` ); } else { line2 = diagram.append("path").attr( "d", "M " + startx + "," + lineStarty + " C " + (startx + 60) + "," + (lineStarty - 10) + " " + (startx + 60) + "," + (lineStarty + 30) + " " + startx + "," + (lineStarty + 20) ); } } else { line2 = diagram.append("line"); line2.attr("x1", startx); line2.attr("y1", lineStarty); line2.attr("x2", stopx); line2.attr("y2", lineStarty); } if (type2 === diagObj.db.LINETYPE.DOTTED || type2 === diagObj.db.LINETYPE.DOTTED_CROSS || type2 === diagObj.db.LINETYPE.DOTTED_POINT || type2 === diagObj.db.LINETYPE.DOTTED_OPEN) { line2.style("stroke-dasharray", "3, 3"); line2.attr("class", "messageLine1"); } else { line2.attr("class", "messageLine0"); } let url = ""; if (conf$4.arrowMarkerAbsolute) { url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; url = url.replace(/\(/g, "\\("); url = url.replace(/\)/g, "\\)"); } line2.attr("stroke-width", 2); line2.attr("stroke", "none"); line2.style("fill", "none"); if (type2 === diagObj.db.LINETYPE.SOLID || type2 === diagObj.db.LINETYPE.DOTTED) { line2.attr("marker-end", "url(" + url + "#arrowhead)"); } if (type2 === diagObj.db.LINETYPE.SOLID_POINT || type2 === diagObj.db.LINETYPE.DOTTED_POINT) { line2.attr("marker-end", "url(" + url + "#filled-head)"); } if (type2 === diagObj.db.LINETYPE.SOLID_CROSS || type2 === diagObj.db.LINETYPE.DOTTED_CROSS) { line2.attr("marker-end", "url(" + url + "#crosshead)"); } if (sequenceVisible || conf$4.showSequenceNumbers) { line2.attr("marker-start", "url(" + url + "#sequencenumber)"); diagram.append("text").attr("x", startx).attr("y", lineStarty + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(sequenceIndex); } }; const drawActors = function(diagram, actors2, actorKeys, verticalPos, configuration, messages2) { if (configuration.hideUnusedParticipants === true) { const newActors = /* @__PURE__ */ new Set(); messages2.forEach((message2) => { newActors.add(message2.from); newActors.add(message2.to); }); actorKeys = actorKeys.filter((actorKey) => newActors.has(actorKey)); } let prevWidth = 0; let prevMargin = 0; let maxHeight = 0; for (let i = 0; i < actorKeys.length; i++) { const actor = actors2[actorKeys[i]]; actor.width = actor.width || conf$4.width; actor.height = Math.max(actor.height || conf$4.height, conf$4.height); actor.margin = actor.margin || conf$4.actorMargin; actor.x = prevWidth + prevMargin; actor.y = verticalPos; const height2 = svgDraw$1.drawActor(diagram, actor, conf$4); maxHeight = Math.max(maxHeight, height2); bounds$1.insert(actor.x, verticalPos, actor.x + actor.width, actor.height); prevWidth += actor.width; prevMargin += actor.margin; bounds$1.models.addActor(actor); } bounds$1.bumpVerticalPos(maxHeight); }; const drawActorsPopup = function(diagram, actors2, actorKeys, doc) { let maxHeight = 0; let maxWidth = 0; for (let i = 0; i < actorKeys.length; i++) { const actor = actors2[actorKeys[i]]; const minMenuWidth = getRequiredPopupWidth(actor); const menuDimensions = svgDraw$1.drawPopup( diagram, actor, minMenuWidth, conf$4, conf$4.forceMenus, doc ); if (menuDimensions.height > maxHeight) { maxHeight = menuDimensions.height; } if (menuDimensions.width + actor.x > maxWidth) { maxWidth = menuDimensions.width + actor.x; } } return { maxHeight, maxWidth }; }; const setConf$4 = function(cnf) { assignWithDepth(conf$4, cnf); if (cnf.fontFamily) { conf$4.actorFontFamily = conf$4.noteFontFamily = conf$4.messageFontFamily = cnf.fontFamily; } if (cnf.fontSize) { conf$4.actorFontSize = conf$4.noteFontSize = conf$4.messageFontSize = cnf.fontSize; } if (cnf.fontWeight) { conf$4.actorFontWeight = conf$4.noteFontWeight = conf$4.messageFontWeight = cnf.fontWeight; } }; const actorActivations = function(actor) { return bounds$1.activations.filter(function(activation) { return activation.actor === actor; }); }; const activationBounds = function(actor, actors2) { const actorObj = actors2[actor]; const activations = actorActivations(actor); const left = activations.reduce(function(acc, activation) { return Math.min(acc, activation.startx); }, actorObj.x + actorObj.width / 2); const right = activations.reduce(function(acc, activation) { return Math.max(acc, activation.stopx); }, actorObj.x + actorObj.width / 2); return [left, right]; }; function adjustLoopHeightForWrap(loopWidths, msg, preMargin, postMargin, addLoopFn) { bounds$1.bumpVerticalPos(preMargin); let heightAdjust = postMargin; if (msg.id && msg.message && loopWidths[msg.id]) { const loopWidth = loopWidths[msg.id].width; const textConf = messageFont(conf$4); msg.message = utils.wrapLabel(`[${msg.message}]`, loopWidth - 2 * conf$4.wrapPadding, textConf); msg.width = loopWidth; msg.wrap = true; const textDims = utils.calculateTextDimensions(msg.message, textConf); const totalOffset = Math.max(textDims.height, conf$4.labelBoxHeight); heightAdjust = postMargin + totalOffset; log$1.debug(`${totalOffset} - ${msg.message}`); } addLoopFn(msg); bounds$1.bumpVerticalPos(heightAdjust); } const draw$4 = function(_text, id, _version, diagObj) { const { securityLevel, sequence } = getConfig$1(); conf$4 = sequence; let sandboxElement; if (securityLevel === "sandbox") { sandboxElement = select("#i" + id); } const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; bounds$1.init(); log$1.debug(diagObj.db); const diagram = securityLevel === "sandbox" ? root2.select(`[id="${id}"]`) : select(`[id="${id}"]`); const actors2 = diagObj.db.getActors(); const actorKeys = diagObj.db.getActorKeys(); const messages2 = diagObj.db.getMessages(); const title2 = diagObj.db.getDiagramTitle(); const maxMessageWidthPerActor = getMaxMessageWidthPerActor(actors2, messages2, diagObj); conf$4.height = calculateActorMargins(actors2, maxMessageWidthPerActor); svgDraw$1.insertComputerIcon(diagram); svgDraw$1.insertDatabaseIcon(diagram); svgDraw$1.insertClockIcon(diagram); drawActors(diagram, actors2, actorKeys, 0, conf$4, messages2); const loopWidths = calculateLoopBounds(messages2, actors2, maxMessageWidthPerActor, diagObj); svgDraw$1.insertArrowHead(diagram); svgDraw$1.insertArrowCrossHead(diagram); svgDraw$1.insertArrowFilledHead(diagram); svgDraw$1.insertSequenceNumber(diagram); function activeEnd(msg, verticalPos) { const activationData = bounds$1.endActivation(msg); if (activationData.starty + 18 > verticalPos) { activationData.starty = verticalPos - 6; verticalPos += 12; } svgDraw$1.drawActivation( diagram, activationData, verticalPos, conf$4, actorActivations(msg.from.actor).length ); bounds$1.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos); } let sequenceIndex = 1; let sequenceIndexStep = 1; const messagesToDraw = []; messages2.forEach(function(msg) { let loopModel, noteModel, msgModel; switch (msg.type) { case diagObj.db.LINETYPE.NOTE: noteModel = msg.noteModel; drawNote$1(diagram, noteModel); break; case diagObj.db.LINETYPE.ACTIVE_START: bounds$1.newActivation(msg, diagram, actors2); break; case diagObj.db.LINETYPE.ACTIVE_END: activeEnd(msg, bounds$1.getVerticalPos()); break; case diagObj.db.LINETYPE.LOOP_START: adjustLoopHeightForWrap( loopWidths, msg, conf$4.boxMargin, conf$4.boxMargin + conf$4.boxTextMargin, (message2) => bounds$1.newLoop(message2) ); break; case diagObj.db.LINETYPE.LOOP_END: loopModel = bounds$1.endLoop(); svgDraw$1.drawLoop(diagram, loopModel, "loop", conf$4); bounds$1.bumpVerticalPos(loopModel.stopy - bounds$1.getVerticalPos()); bounds$1.models.addLoop(loopModel); break; case diagObj.db.LINETYPE.RECT_START: adjustLoopHeightForWrap( loopWidths, msg, conf$4.boxMargin, conf$4.boxMargin, (message2) => bounds$1.newLoop(void 0, message2.message) ); break; case diagObj.db.LINETYPE.RECT_END: loopModel = bounds$1.endLoop(); svgDraw$1.drawBackgroundRect(diagram, loopModel); bounds$1.models.addLoop(loopModel); bounds$1.bumpVerticalPos(loopModel.stopy - bounds$1.getVerticalPos()); break; case diagObj.db.LINETYPE.OPT_START: adjustLoopHeightForWrap( loopWidths, msg, conf$4.boxMargin, conf$4.boxMargin + conf$4.boxTextMargin, (message2) => bounds$1.newLoop(message2) ); break; case diagObj.db.LINETYPE.OPT_END: loopModel = bounds$1.endLoop(); svgDraw$1.drawLoop(diagram, loopModel, "opt", conf$4); bounds$1.bumpVerticalPos(loopModel.stopy - bounds$1.getVerticalPos()); bounds$1.models.addLoop(loopModel); break; case diagObj.db.LINETYPE.ALT_START: adjustLoopHeightForWrap( loopWidths, msg, conf$4.boxMargin, conf$4.boxMargin + conf$4.boxTextMargin, (message2) => bounds$1.newLoop(message2) ); break; case diagObj.db.LINETYPE.ALT_ELSE: adjustLoopHeightForWrap( loopWidths, msg, conf$4.boxMargin + conf$4.boxTextMargin, conf$4.boxMargin, (message2) => bounds$1.addSectionToLoop(message2) ); break; case diagObj.db.LINETYPE.ALT_END: loopModel = bounds$1.endLoop(); svgDraw$1.drawLoop(diagram, loopModel, "alt", conf$4); bounds$1.bumpVerticalPos(loopModel.stopy - bounds$1.getVerticalPos()); bounds$1.models.addLoop(loopModel); break; case diagObj.db.LINETYPE.PAR_START: adjustLoopHeightForWrap( loopWidths, msg, conf$4.boxMargin, conf$4.boxMargin + conf$4.boxTextMargin, (message2) => bounds$1.newLoop(message2) ); break; case diagObj.db.LINETYPE.PAR_AND: adjustLoopHeightForWrap( loopWidths, msg, conf$4.boxMargin + conf$4.boxTextMargin, conf$4.boxMargin, (message2) => bounds$1.addSectionToLoop(message2) ); break; case diagObj.db.LINETYPE.PAR_END: loopModel = bounds$1.endLoop(); svgDraw$1.drawLoop(diagram, loopModel, "par", conf$4); bounds$1.bumpVerticalPos(loopModel.stopy - bounds$1.getVerticalPos()); bounds$1.models.addLoop(loopModel); break; case diagObj.db.LINETYPE.AUTONUMBER: sequenceIndex = msg.message.start || sequenceIndex; sequenceIndexStep = msg.message.step || sequenceIndexStep; if (msg.message.visible) diagObj.db.enableSequenceNumbers(); else diagObj.db.disableSequenceNumbers(); break; case diagObj.db.LINETYPE.CRITICAL_START: adjustLoopHeightForWrap( loopWidths, msg, conf$4.boxMargin, conf$4.boxMargin + conf$4.boxTextMargin, (message2) => bounds$1.newLoop(message2) ); break; case diagObj.db.LINETYPE.CRITICAL_OPTION: adjustLoopHeightForWrap( loopWidths, msg, conf$4.boxMargin + conf$4.boxTextMargin, conf$4.boxMargin, (message2) => bounds$1.addSectionToLoop(message2) ); break; case diagObj.db.LINETYPE.CRITICAL_END: loopModel = bounds$1.endLoop(); svgDraw$1.drawLoop(diagram, loopModel, "critical", conf$4); bounds$1.bumpVerticalPos(loopModel.stopy - bounds$1.getVerticalPos()); bounds$1.models.addLoop(loopModel); break; case diagObj.db.LINETYPE.BREAK_START: adjustLoopHeightForWrap( loopWidths, msg, conf$4.boxMargin, conf$4.boxMargin + conf$4.boxTextMargin, (message2) => bounds$1.newLoop(message2) ); break; case diagObj.db.LINETYPE.BREAK_END: loopModel = bounds$1.endLoop(); svgDraw$1.drawLoop(diagram, loopModel, "break", conf$4); bounds$1.bumpVerticalPos(loopModel.stopy - bounds$1.getVerticalPos()); bounds$1.models.addLoop(loopModel); break; default: try { msgModel = msg.msgModel; msgModel.starty = bounds$1.getVerticalPos(); msgModel.sequenceIndex = sequenceIndex; msgModel.sequenceVisible = diagObj.db.showSequenceNumbers(); const lineStarty = boundMessage(diagram, msgModel); messagesToDraw.push({ messageModel: msgModel, lineStarty }); bounds$1.models.addMessage(msgModel); } catch (e) { log$1.error("error while drawing message", e); } } if ([ diagObj.db.LINETYPE.SOLID_OPEN, diagObj.db.LINETYPE.DOTTED_OPEN, diagObj.db.LINETYPE.SOLID, diagObj.db.LINETYPE.DOTTED, diagObj.db.LINETYPE.SOLID_CROSS, diagObj.db.LINETYPE.DOTTED_CROSS, diagObj.db.LINETYPE.SOLID_POINT, diagObj.db.LINETYPE.DOTTED_POINT ].includes(msg.type)) { sequenceIndex = sequenceIndex + sequenceIndexStep; } }); messagesToDraw.forEach((e) => drawMessage(diagram, e.messageModel, e.lineStarty, diagObj)); if (conf$4.mirrorActors) { bounds$1.bumpVerticalPos(conf$4.boxMargin * 2); drawActors(diagram, actors2, actorKeys, bounds$1.getVerticalPos(), conf$4, messages2); bounds$1.bumpVerticalPos(conf$4.boxMargin); fixLifeLineHeights(diagram, bounds$1.getVerticalPos()); } const requiredBoxSize = drawActorsPopup(diagram, actors2, actorKeys, doc); const { bounds: box } = bounds$1.getBounds(); log$1.debug("For line height fix Querying: #" + id + " .actor-line"); const actorLines = selectAll("#" + id + " .actor-line"); actorLines.attr("y2", box.stopy); let boxHeight = box.stopy - box.starty; if (boxHeight < requiredBoxSize.maxHeight) { boxHeight = requiredBoxSize.maxHeight; } let height2 = boxHeight + 2 * conf$4.diagramMarginY; if (conf$4.mirrorActors) { height2 = height2 - conf$4.boxMargin + conf$4.bottomMarginAdj; } let boxWidth = box.stopx - box.startx; if (boxWidth < requiredBoxSize.maxWidth) { boxWidth = requiredBoxSize.maxWidth; } const width2 = boxWidth + 2 * conf$4.diagramMarginX; if (title2) { diagram.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 2 * conf$4.diagramMarginX).attr("y", -25); } configureSvgSize(diagram, height2, width2, conf$4.useMaxWidth); const extraVertForTitle = title2 ? 40 : 0; diagram.attr( "viewBox", box.startx - conf$4.diagramMarginX + " -" + (conf$4.diagramMarginY + extraVertForTitle) + " " + width2 + " " + (height2 + extraVertForTitle) ); addSVGAccessibilityFields(diagObj.db, diagram, id); log$1.debug(`models:`, bounds$1.models); }; const getMaxMessageWidthPerActor = function(actors2, messages2, diagObj) { const maxMessageWidthPerActor = {}; messages2.forEach(function(msg) { if (actors2[msg.to] && actors2[msg.from]) { const actor = actors2[msg.to]; if (msg.placement === diagObj.db.PLACEMENT.LEFTOF && !actor.prevActor) { return; } if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF && !actor.nextActor) { return; } const isNote = msg.placement !== void 0; const isMessage = !isNote; const textFont = isNote ? noteFont(conf$4) : messageFont(conf$4); const wrappedMessage = msg.wrap ? utils.wrapLabel(msg.message, conf$4.width - 2 * conf$4.wrapPadding, textFont) : msg.message; const messageDimensions = utils.calculateTextDimensions(wrappedMessage, textFont); const messageWidth = messageDimensions.width + 2 * conf$4.wrapPadding; if (isMessage && msg.from === actor.nextActor) { maxMessageWidthPerActor[msg.to] = Math.max( maxMessageWidthPerActor[msg.to] || 0, messageWidth ); } else if (isMessage && msg.from === actor.prevActor) { maxMessageWidthPerActor[msg.from] = Math.max( maxMessageWidthPerActor[msg.from] || 0, messageWidth ); } else if (isMessage && msg.from === msg.to) { maxMessageWidthPerActor[msg.from] = Math.max( maxMessageWidthPerActor[msg.from] || 0, messageWidth / 2 ); maxMessageWidthPerActor[msg.to] = Math.max( maxMessageWidthPerActor[msg.to] || 0, messageWidth / 2 ); } else if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF) { maxMessageWidthPerActor[msg.from] = Math.max( maxMessageWidthPerActor[msg.from] || 0, messageWidth ); } else if (msg.placement === diagObj.db.PLACEMENT.LEFTOF) { maxMessageWidthPerActor[actor.prevActor] = Math.max( maxMessageWidthPerActor[actor.prevActor] || 0, messageWidth ); } else if (msg.placement === diagObj.db.PLACEMENT.OVER) { if (actor.prevActor) { maxMessageWidthPerActor[actor.prevActor] = Math.max( maxMessageWidthPerActor[actor.prevActor] || 0, messageWidth / 2 ); } if (actor.nextActor) { maxMessageWidthPerActor[msg.from] = Math.max( maxMessageWidthPerActor[msg.from] || 0, messageWidth / 2 ); } } } }); log$1.debug("maxMessageWidthPerActor:", maxMessageWidthPerActor); return maxMessageWidthPerActor; }; const getRequiredPopupWidth = function(actor) { let requiredPopupWidth = 0; const textFont = actorFont(conf$4); for (const key in actor.links) { const labelDimensions = utils.calculateTextDimensions(key, textFont); const labelWidth = labelDimensions.width + 2 * conf$4.wrapPadding + 2 * conf$4.boxMargin; if (requiredPopupWidth < labelWidth) { requiredPopupWidth = labelWidth; } } return requiredPopupWidth; }; const calculateActorMargins = function(actors2, actorToMessageWidth) { let maxHeight = 0; Object.keys(actors2).forEach((prop) => { const actor = actors2[prop]; if (actor.wrap) { actor.description = utils.wrapLabel( actor.description, conf$4.width - 2 * conf$4.wrapPadding, actorFont(conf$4) ); } const actDims = utils.calculateTextDimensions(actor.description, actorFont(conf$4)); actor.width = actor.wrap ? conf$4.width : Math.max(conf$4.width, actDims.width + 2 * conf$4.wrapPadding); actor.height = actor.wrap ? Math.max(actDims.height, conf$4.height) : conf$4.height; maxHeight = Math.max(maxHeight, actor.height); }); for (const actorKey in actorToMessageWidth) { const actor = actors2[actorKey]; if (!actor) { continue; } const nextActor = actors2[actor.nextActor]; if (!nextActor) { continue; } const messageWidth = actorToMessageWidth[actorKey]; const actorWidth = messageWidth + conf$4.actorMargin - actor.width / 2 - nextActor.width / 2; actor.margin = Math.max(actorWidth, conf$4.actorMargin); } return Math.max(maxHeight, conf$4.height); }; const buildNoteModel = function(msg, actors2, diagObj) { const startx = actors2[msg.from].x; const stopx = actors2[msg.to].x; const shouldWrap = msg.wrap && msg.message; let textDimensions = utils.calculateTextDimensions( shouldWrap ? utils.wrapLabel(msg.message, conf$4.width, noteFont(conf$4)) : msg.message, noteFont(conf$4) ); const noteModel = { width: shouldWrap ? conf$4.width : Math.max(conf$4.width, textDimensions.width + 2 * conf$4.noteMargin), height: 0, startx: actors2[msg.from].x, stopx: 0, starty: 0, stopy: 0, message: msg.message }; if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF) { noteModel.width = shouldWrap ? Math.max(conf$4.width, textDimensions.width) : Math.max( actors2[msg.from].width / 2 + actors2[msg.to].width / 2, textDimensions.width + 2 * conf$4.noteMargin ); noteModel.startx = startx + (actors2[msg.from].width + conf$4.actorMargin) / 2; } else if (msg.placement === diagObj.db.PLACEMENT.LEFTOF) { noteModel.width = shouldWrap ? Math.max(conf$4.width, textDimensions.width + 2 * conf$4.noteMargin) : Math.max( actors2[msg.from].width / 2 + actors2[msg.to].width / 2, textDimensions.width + 2 * conf$4.noteMargin ); noteModel.startx = startx - noteModel.width + (actors2[msg.from].width - conf$4.actorMargin) / 2; } else if (msg.to === msg.from) { textDimensions = utils.calculateTextDimensions( shouldWrap ? utils.wrapLabel(msg.message, Math.max(conf$4.width, actors2[msg.from].width), noteFont(conf$4)) : msg.message, noteFont(conf$4) ); noteModel.width = shouldWrap ? Math.max(conf$4.width, actors2[msg.from].width) : Math.max(actors2[msg.from].width, conf$4.width, textDimensions.width + 2 * conf$4.noteMargin); noteModel.startx = startx + (actors2[msg.from].width - noteModel.width) / 2; } else { noteModel.width = Math.abs(startx + actors2[msg.from].width / 2 - (stopx + actors2[msg.to].width / 2)) + conf$4.actorMargin; noteModel.startx = startx < stopx ? startx + actors2[msg.from].width / 2 - conf$4.actorMargin / 2 : stopx + actors2[msg.to].width / 2 - conf$4.actorMargin / 2; } if (shouldWrap) { noteModel.message = utils.wrapLabel( msg.message, noteModel.width - 2 * conf$4.wrapPadding, noteFont(conf$4) ); } log$1.debug( `NM:[${noteModel.startx},${noteModel.stopx},${noteModel.starty},${noteModel.stopy}:${noteModel.width},${noteModel.height}=${msg.message}]` ); return noteModel; }; const buildMessageModel = function(msg, actors2, diagObj) { let process = false; if ([ diagObj.db.LINETYPE.SOLID_OPEN, diagObj.db.LINETYPE.DOTTED_OPEN, diagObj.db.LINETYPE.SOLID, diagObj.db.LINETYPE.DOTTED, diagObj.db.LINETYPE.SOLID_CROSS, diagObj.db.LINETYPE.DOTTED_CROSS, diagObj.db.LINETYPE.SOLID_POINT, diagObj.db.LINETYPE.DOTTED_POINT ].includes(msg.type)) { process = true; } if (!process) { return {}; } const fromBounds = activationBounds(msg.from, actors2); const toBounds = activationBounds(msg.to, actors2); const fromIdx = fromBounds[0] <= toBounds[0] ? 1 : 0; const toIdx = fromBounds[0] < toBounds[0] ? 0 : 1; const allBounds = fromBounds.concat(toBounds); const boundedWidth = Math.abs(toBounds[toIdx] - fromBounds[fromIdx]); if (msg.wrap && msg.message) { msg.message = utils.wrapLabel( msg.message, Math.max(boundedWidth + 2 * conf$4.wrapPadding, conf$4.width), messageFont(conf$4) ); } const msgDims = utils.calculateTextDimensions(msg.message, messageFont(conf$4)); return { width: Math.max( msg.wrap ? 0 : msgDims.width + 2 * conf$4.wrapPadding, boundedWidth + 2 * conf$4.wrapPadding, conf$4.width ), height: 0, startx: fromBounds[fromIdx], stopx: toBounds[toIdx], starty: 0, stopy: 0, message: msg.message, type: msg.type, wrap: msg.wrap, fromBounds: Math.min.apply(null, allBounds), toBounds: Math.max.apply(null, allBounds) }; }; const calculateLoopBounds = function(messages2, actors2, _maxWidthPerActor, diagObj) { const loops = {}; const stack = []; let current, noteModel, msgModel; messages2.forEach(function(msg) { msg.id = utils.random({ length: 10 }); switch (msg.type) { case diagObj.db.LINETYPE.LOOP_START: case diagObj.db.LINETYPE.ALT_START: case diagObj.db.LINETYPE.OPT_START: case diagObj.db.LINETYPE.PAR_START: case diagObj.db.LINETYPE.CRITICAL_START: case diagObj.db.LINETYPE.BREAK_START: stack.push({ id: msg.id, msg: msg.message, from: Number.MAX_SAFE_INTEGER, to: Number.MIN_SAFE_INTEGER, width: 0 }); break; case diagObj.db.LINETYPE.ALT_ELSE: case diagObj.db.LINETYPE.PAR_AND: case diagObj.db.LINETYPE.CRITICAL_OPTION: if (msg.message) { current = stack.pop(); loops[current.id] = current; loops[msg.id] = current; stack.push(current); } break; case diagObj.db.LINETYPE.LOOP_END: case diagObj.db.LINETYPE.ALT_END: case diagObj.db.LINETYPE.OPT_END: case diagObj.db.LINETYPE.PAR_END: case diagObj.db.LINETYPE.CRITICAL_END: case diagObj.db.LINETYPE.BREAK_END: current = stack.pop(); loops[current.id] = current; break; case diagObj.db.LINETYPE.ACTIVE_START: { const actorRect = actors2[msg.from ? msg.from.actor : msg.to.actor]; const stackedSize = actorActivations(msg.from ? msg.from.actor : msg.to.actor).length; const x = actorRect.x + actorRect.width / 2 + (stackedSize - 1) * conf$4.activationWidth / 2; const toAdd = { startx: x, stopx: x + conf$4.activationWidth, actor: msg.from.actor, enabled: true }; bounds$1.activations.push(toAdd); } break; case diagObj.db.LINETYPE.ACTIVE_END: { const lastActorActivationIdx = bounds$1.activations.map((a) => a.actor).lastIndexOf(msg.from.actor); delete bounds$1.activations.splice(lastActorActivationIdx, 1)[0]; } break; } const isNote = msg.placement !== void 0; if (isNote) { noteModel = buildNoteModel(msg, actors2, diagObj); msg.noteModel = noteModel; stack.forEach((stk) => { current = stk; current.from = Math.min(current.from, noteModel.startx); current.to = Math.max(current.to, noteModel.startx + noteModel.width); current.width = Math.max(current.width, Math.abs(current.from - current.to)) - conf$4.labelBoxWidth; }); } else { msgModel = buildMessageModel(msg, actors2, diagObj); msg.msgModel = msgModel; if (msgModel.startx && msgModel.stopx && stack.length > 0) { stack.forEach((stk) => { current = stk; if (msgModel.startx === msgModel.stopx) { const from = actors2[msg.from]; const to = actors2[msg.to]; current.from = Math.min( from.x - msgModel.width / 2, from.x - from.width / 2, current.from ); current.to = Math.max(to.x + msgModel.width / 2, to.x + from.width / 2, current.to); current.width = Math.max(current.width, Math.abs(current.to - current.from)) - conf$4.labelBoxWidth; } else { current.from = Math.min(msgModel.startx, current.from); current.to = Math.max(msgModel.stopx, current.to); current.width = Math.max(current.width, msgModel.width) - conf$4.labelBoxWidth; } }); } } }); bounds$1.activations = []; log$1.debug("Loop type widths:", loops); return loops; }; const sequenceRenderer = { bounds: bounds$1, drawActors, drawActorsPopup, setConf: setConf$4, draw: draw$4 }; var parser$1 = function() { var o = function(k, v, o2, l) { for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ; return o2; }, $V0 = [1, 2], $V1 = [1, 3], $V2 = [1, 5], $V3 = [1, 7], $V4 = [2, 5], $V5 = [1, 15], $V6 = [1, 17], $V7 = [1, 19], $V8 = [1, 20], $V9 = [1, 21], $Va = [1, 22], $Vb = [1, 33], $Vc = [1, 23], $Vd = [1, 24], $Ve = [1, 25], $Vf = [1, 26], $Vg = [1, 27], $Vh = [1, 30], $Vi = [1, 31], $Vj = [1, 32], $Vk = [1, 35], $Vl = [1, 36], $Vm = [1, 37], $Vn = [1, 38], $Vo = [1, 34], $Vp = [1, 41], $Vq = [1, 4, 5, 14, 15, 17, 19, 20, 22, 23, 24, 25, 26, 27, 31, 33, 35, 41, 42, 43, 44, 47, 50], $Vr = [1, 4, 5, 12, 13, 14, 15, 17, 19, 20, 22, 23, 24, 25, 26, 27, 31, 33, 35, 41, 42, 43, 44, 47, 50], $Vs = [1, 4, 5, 7, 14, 15, 17, 19, 20, 22, 23, 24, 25, 26, 27, 31, 33, 35, 41, 42, 43, 44, 47, 50], $Vt = [4, 5, 14, 15, 17, 19, 20, 22, 23, 24, 25, 26, 27, 31, 33, 35, 41, 42, 43, 44, 47, 50]; var parser2 = { trace: function trace() { }, yy: {}, symbols_: { "error": 2, "start": 3, "SPACE": 4, "NL": 5, "directive": 6, "SD": 7, "document": 8, "line": 9, "statement": 10, "idStatement": 11, "DESCR": 12, "-->": 13, "HIDE_EMPTY": 14, "scale": 15, "WIDTH": 16, "COMPOSIT_STATE": 17, "STRUCT_START": 18, "STRUCT_STOP": 19, "STATE_DESCR": 20, "AS": 21, "ID": 22, "FORK": 23, "JOIN": 24, "CHOICE": 25, "CONCURRENT": 26, "note": 27, "notePosition": 28, "NOTE_TEXT": 29, "direction": 30, "acc_title": 31, "acc_title_value": 32, "acc_descr": 33, "acc_descr_value": 34, "acc_descr_multiline_value": 35, "openDirective": 36, "typeDirective": 37, "closeDirective": 38, ":": 39, "argDirective": 40, "direction_tb": 41, "direction_bt": 42, "direction_rl": 43, "direction_lr": 44, "eol": 45, ";": 46, "EDGE_STATE": 47, "left_of": 48, "right_of": 49, "open_directive": 50, "type_directive": 51, "arg_directive": 52, "close_directive": 53, "$accept": 0, "$end": 1 }, terminals_: { 2: "error", 4: "SPACE", 5: "NL", 7: "SD", 12: "DESCR", 13: "-->", 14: "HIDE_EMPTY", 15: "scale", 16: "WIDTH", 17: "COMPOSIT_STATE", 18: "STRUCT_START", 19: "STRUCT_STOP", 20: "STATE_DESCR", 21: "AS", 22: "ID", 23: "FORK", 24: "JOIN", 25: "CHOICE", 26: "CONCURRENT", 27: "note", 29: "NOTE_TEXT", 31: "acc_title", 32: "acc_title_value", 33: "acc_descr", 34: "acc_descr_value", 35: "acc_descr_multiline_value", 39: ":", 41: "direction_tb", 42: "direction_bt", 43: "direction_rl", 44: "direction_lr", 46: ";", 47: "EDGE_STATE", 48: "left_of", 49: "right_of", 50: "open_directive", 51: "type_directive", 52: "arg_directive", 53: "close_directive" }, productions_: [0, [3, 2], [3, 2], [3, 2], [3, 2], [8, 0], [8, 2], [9, 2], [9, 1], [9, 1], [10, 1], [10, 2], [10, 3], [10, 4], [10, 1], [10, 2], [10, 1], [10, 4], [10, 3], [10, 6], [10, 1], [10, 1], [10, 1], [10, 1], [10, 4], [10, 4], [10, 1], [10, 1], [10, 2], [10, 2], [10, 1], [6, 3], [6, 5], [30, 1], [30, 1], [30, 1], [30, 1], [45, 1], [45, 1], [11, 1], [11, 1], [28, 1], [28, 1], [36, 1], [37, 1], [40, 1], [38, 1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { var $0 = $$.length - 1; switch (yystate) { case 4: yy.setRootDoc($$[$0]); return $$[$0]; case 5: this.$ = []; break; case 6: if ($$[$0] != "nl") { $$[$0 - 1].push($$[$0]); this.$ = $$[$0 - 1]; } break; case 7: case 8: this.$ = $$[$0]; break; case 9: this.$ = "nl"; break; case 10: this.$ = { stmt: "state", id: $$[$0], type: "default", description: "" }; break; case 11: this.$ = { stmt: "state", id: $$[$0 - 1], type: "default", description: yy.trimColon($$[$0]) }; break; case 12: this.$ = { stmt: "relation", state1: { stmt: "state", id: $$[$0 - 2], type: "default", description: "" }, state2: { stmt: "state", id: $$[$0], type: "default", description: "" } }; break; case 13: this.$ = { stmt: "relation", state1: { stmt: "state", id: $$[$0 - 3], type: "default", description: "" }, state2: { stmt: "state", id: $$[$0 - 1], type: "default", description: "" }, description: $$[$0].substr(1).trim() }; break; case 17: this.$ = { stmt: "state", id: $$[$0 - 3], type: "default", description: "", doc: $$[$0 - 1] }; break; case 18: var id = $$[$0]; var description2 = $$[$0 - 2].trim(); if ($$[$0].match(":")) { var parts = $$[$0].split(":"); id = parts[0]; description2 = [description2, parts[1]]; } this.$ = { stmt: "state", id, type: "default", description: description2 }; break; case 19: this.$ = { stmt: "state", id: $$[$0 - 3], type: "default", description: $$[$0 - 5], doc: $$[$0 - 1] }; break; case 20: this.$ = { stmt: "state", id: $$[$0], type: "fork" }; break; case 21: this.$ = { stmt: "state", id: $$[$0], type: "join" }; break; case 22: this.$ = { stmt: "state", id: $$[$0], type: "choice" }; break; case 23: this.$ = { stmt: "state", id: yy.getDividerId(), type: "divider" }; break; case 24: this.$ = { stmt: "state", id: $$[$0 - 1].trim(), note: { position: $$[$0 - 2].trim(), text: $$[$0].trim() } }; break; case 28: this.$ = $$[$0].trim(); yy.setAccTitle(this.$); break; case 29: case 30: this.$ = $$[$0].trim(); yy.setAccDescription(this.$); break; case 33: yy.setDirection("TB"); this.$ = { stmt: "dir", value: "TB" }; break; case 34: yy.setDirection("BT"); this.$ = { stmt: "dir", value: "BT" }; break; case 35: yy.setDirection("RL"); this.$ = { stmt: "dir", value: "RL" }; break; case 36: yy.setDirection("LR"); this.$ = { stmt: "dir", value: "LR" }; break; case 39: case 40: this.$ = $$[$0]; break; case 43: yy.parseDirective("%%{", "open_directive"); break; case 44: yy.parseDirective($$[$0], "type_directive"); break; case 45: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], "arg_directive"); break; case 46: yy.parseDirective("}%%", "close_directive", "state"); break; } }, table: [{ 3: 1, 4: $V0, 5: $V1, 6: 4, 7: $V2, 36: 6, 50: $V3 }, { 1: [3] }, { 3: 8, 4: $V0, 5: $V1, 6: 4, 7: $V2, 36: 6, 50: $V3 }, { 3: 9, 4: $V0, 5: $V1, 6: 4, 7: $V2, 36: 6, 50: $V3 }, { 3: 10, 4: $V0, 5: $V1, 6: 4, 7: $V2, 36: 6, 50: $V3 }, o([1, 4, 5, 14, 15, 17, 20, 22, 23, 24, 25, 26, 27, 31, 33, 35, 41, 42, 43, 44, 47, 50], $V4, { 8: 11 }), { 37: 12, 51: [1, 13] }, { 51: [2, 43] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3] }, { 1: [2, 4], 4: $V5, 5: $V6, 6: 28, 9: 14, 10: 16, 11: 18, 14: $V7, 15: $V8, 17: $V9, 20: $Va, 22: $Vb, 23: $Vc, 24: $Vd, 25: $Ve, 26: $Vf, 27: $Vg, 30: 29, 31: $Vh, 33: $Vi, 35: $Vj, 36: 6, 41: $Vk, 42: $Vl, 43: $Vm, 44: $Vn, 47: $Vo, 50: $V3 }, { 38: 39, 39: [1, 40], 53: $Vp }, o([39, 53], [2, 44]), o($Vq, [2, 6]), { 6: 28, 10: 42, 11: 18, 14: $V7, 15: $V8, 17: $V9, 20: $Va, 22: $Vb, 23: $Vc, 24: $Vd, 25: $Ve, 26: $Vf, 27: $Vg, 30: 29, 31: $Vh, 33: $Vi, 35: $Vj, 36: 6, 41: $Vk, 42: $Vl, 43: $Vm, 44: $Vn, 47: $Vo, 50: $V3 }, o($Vq, [2, 8]), o($Vq, [2, 9]), o($Vq, [2, 10], { 12: [1, 43], 13: [1, 44] }), o($Vq, [2, 14]), { 16: [1, 45] }, o($Vq, [2, 16], { 18: [1, 46] }), { 21: [1, 47] }, o($Vq, [2, 20]), o($Vq, [2, 21]), o($Vq, [2, 22]), o($Vq, [2, 23]), { 28: 48, 29: [1, 49], 48: [1, 50], 49: [1, 51] }, o($Vq, [2, 26]), o($Vq, [2, 27]), { 32: [1, 52] }, { 34: [1, 53] }, o($Vq, [2, 30]), o($Vr, [2, 39]), o($Vr, [2, 40]), o($Vq, [2, 33]), o($Vq, [2, 34]), o($Vq, [2, 35]), o($Vq, [2, 36]), o($Vs, [2, 31]), { 40: 54, 52: [1, 55] }, o($Vs, [2, 46]), o($Vq, [2, 7]), o($Vq, [2, 11]), { 11: 56, 22: $Vb, 47: $Vo }, o($Vq, [2, 15]), o($Vt, $V4, { 8: 57 }), { 22: [1, 58] }, { 22: [1, 59] }, { 21: [1, 60] }, { 22: [2, 41] }, { 22: [2, 42] }, o($Vq, [2, 28]), o($Vq, [2, 29]), { 38: 61, 53: $Vp }, { 53: [2, 45] }, o($Vq, [2, 12], { 12: [1, 62] }), { 4: $V5, 5: $V6, 6: 28, 9: 14, 10: 16, 11: 18, 14: $V7, 15: $V8, 17: $V9, 19: [1, 63], 20: $Va, 22: $Vb, 23: $Vc, 24: $Vd, 25: $Ve, 26: $Vf, 27: $Vg, 30: 29, 31: $Vh, 33: $Vi, 35: $Vj, 36: 6, 41: $Vk, 42: $Vl, 43: $Vm, 44: $Vn, 47: $Vo, 50: $V3 }, o($Vq, [2, 18], { 18: [1, 64] }), { 29: [1, 65] }, { 22: [1, 66] }, o($Vs, [2, 32]), o($Vq, [2, 13]), o($Vq, [2, 17]), o($Vt, $V4, { 8: 67 }), o($Vq, [2, 24]), o($Vq, [2, 25]), { 4: $V5, 5: $V6, 6: 28, 9: 14, 10: 16, 11: 18, 14: $V7, 15: $V8, 17: $V9, 19: [1, 68], 20: $Va, 22: $Vb, 23: $Vc, 24: $Vd, 25: $Ve, 26: $Vf, 27: $Vg, 30: 29, 31: $Vh, 33: $Vi, 35: $Vj, 36: 6, 41: $Vk, 42: $Vl, 43: $Vm, 44: $Vn, 47: $Vo, 50: $V3 }, o($Vq, [2, 19])], defaultActions: { 7: [2, 43], 8: [2, 1], 9: [2, 2], 10: [2, 3], 50: [2, 41], 51: [2, 42], 55: [2, 45] }, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse2(input) { var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer2 = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer2.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer2; sharedState.yy.parser = this; if (typeof lexer2.yylloc == "undefined") { lexer2.yylloc = {}; } var yyloc = lexer2.yylloc; lstack.push(yyloc); var ranges = lexer2.options && lexer2.options.ranges; if (typeof sharedState.yy.parseError === "function") { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function lex() { var token; token = tstack.pop() || lexer2.lex() || EOF; if (typeof token !== "number") { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self2.symbols_[token] || token; } return token; } var symbol, state, action, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push("'" + this.terminals_[p] + "'"); } } if (lexer2.showPosition) { errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; } else { errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); } this.parseError(errStr, { text: lexer2.match, token: this.terminals_[symbol] || symbol, line: lexer2.yylineno, loc: yyloc, expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer2.yytext); lstack.push(lexer2.yylloc); stack.push(action[1]); symbol = null; { yyleng = lexer2.yyleng; yytext = lexer2.yytext; yylineno = lexer2.yylineno; yyloc = lexer2.yylloc; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== "undefined") { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; } }; var lexer = function() { var lexer2 = { EOF: 1, parseError: function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, setInput: function(input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; this.yylineno = this.yyleng = 0; this.yytext = this.matched = this.match = ""; this.conditionStack = ["INITIAL"]; this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; if (this.options.ranges) { this.yylloc.range = [0, 0]; } this.offset = 0; return this; }, input: function() { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, unput: function(ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); this.offset -= len; var oldLines = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1); this.matched = this.matched.substr(0, this.matched.length - 1); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, more: function() { this._more = true; return this; }, reject: function() { if (this.options.backtrack_lexer) { this._backtrack = true; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, less: function(n) { this.unput(this.match.slice(n)); }, pastInput: function() { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); }, upcomingInput: function() { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20 - next.length); } return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, ""); }, showPosition: function() { var pre = this.pastInput(); var c2 = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c2 + "^"; }, test_match: function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { backup = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { for (var k in backup) { this[k] = backup[k]; } return false; } return false; }, next: function() { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ""; this.match = ""; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; } else { return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } return false; } if (this._input === "") { return this.EOF; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, lex: function lex() { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, begin: function begin(condition) { this.conditionStack.push(condition); }, popState: function popState() { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, _currentRules: function _currentRules() { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, topState: function topState(n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, pushState: function pushState(condition) { this.begin(condition); }, stateStackSize: function stateStackSize() { return this.conditionStack.length; }, options: { "case-insensitive": true }, performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { switch ($avoiding_name_collisions) { case 0: return 41; case 1: return 42; case 2: return 43; case 3: return 44; case 4: this.begin("open_directive"); return 50; case 5: this.begin("type_directive"); return 51; case 6: this.popState(); this.begin("arg_directive"); return 39; case 7: this.popState(); this.popState(); return 53; case 8: return 52; case 9: break; case 10: break; case 11: return 5; case 12: break; case 13: break; case 14: break; case 15: break; case 16: this.pushState("SCALE"); return 15; case 17: return 16; case 18: this.popState(); break; case 19: this.begin("acc_title"); return 31; case 20: this.popState(); return "acc_title_value"; case 21: this.begin("acc_descr"); return 33; case 22: this.popState(); return "acc_descr_value"; case 23: this.begin("acc_descr_multiline"); break; case 24: this.popState(); break; case 25: return "acc_descr_multiline_value"; case 26: this.pushState("STATE"); break; case 27: this.popState(); yy_.yytext = yy_.yytext.slice(0, -8).trim(); return 23; case 28: this.popState(); yy_.yytext = yy_.yytext.slice(0, -8).trim(); return 24; case 29: this.popState(); yy_.yytext = yy_.yytext.slice(0, -10).trim(); return 25; case 30: this.popState(); yy_.yytext = yy_.yytext.slice(0, -8).trim(); return 23; case 31: this.popState(); yy_.yytext = yy_.yytext.slice(0, -8).trim(); return 24; case 32: this.popState(); yy_.yytext = yy_.yytext.slice(0, -10).trim(); return 25; case 33: return 41; case 34: return 42; case 35: return 43; case 36: return 44; case 37: this.begin("STATE_STRING"); break; case 38: this.popState(); this.pushState("STATE_ID"); return "AS"; case 39: this.popState(); return "ID"; case 40: this.popState(); break; case 41: return "STATE_DESCR"; case 42: return 17; case 43: this.popState(); break; case 44: this.popState(); this.pushState("struct"); return 18; case 45: this.popState(); return 19; case 46: break; case 47: this.begin("NOTE"); return 27; case 48: this.popState(); this.pushState("NOTE_ID"); return 48; case 49: this.popState(); this.pushState("NOTE_ID"); return 49; case 50: this.popState(); this.pushState("FLOATING_NOTE"); break; case 51: this.popState(); this.pushState("FLOATING_NOTE_ID"); return "AS"; case 52: break; case 53: return "NOTE_TEXT"; case 54: this.popState(); return "ID"; case 55: this.popState(); this.pushState("NOTE_TEXT"); return 22; case 56: this.popState(); yy_.yytext = yy_.yytext.substr(2).trim(); return 29; case 57: this.popState(); yy_.yytext = yy_.yytext.slice(0, -8).trim(); return 29; case 58: return 7; case 59: return 7; case 60: return 14; case 61: return 47; case 62: return 22; case 63: yy_.yytext = yy_.yytext.trim(); return 12; case 64: return 13; case 65: return 26; case 66: return 5; case 67: return "INVALID"; } }, rules: [/^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:[\s]+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:scale\s+)/i, /^(?:\d+)/i, /^(?:\s+width\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:state\s+)/i, /^(?:.*<>)/i, /^(?:.*<>)/i, /^(?:.*<>)/i, /^(?:.*\[\[fork\]\])/i, /^(?:.*\[\[join\]\])/i, /^(?:.*\[\[choice\]\])/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:["])/i, /^(?:\s*as\s+)/i, /^(?:[^\n\{]*)/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[^\n\s\{]+)/i, /^(?:\n)/i, /^(?:\{)/i, /^(?:\})/i, /^(?:[\n])/i, /^(?:note\s+)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:")/i, /^(?:\s*as\s*)/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[^\n]*)/i, /^(?:\s*[^:\n\s\-]+)/i, /^(?:\s*:[^:\n;]+)/i, /^(?:[\s\S]*?end note\b)/i, /^(?:stateDiagram\s+)/i, /^(?:stateDiagram-v2\s+)/i, /^(?:hide empty description\b)/i, /^(?:\[\*\])/i, /^(?:[^:\n\s\-\{]+)/i, /^(?:\s*:[^:\n;]+)/i, /^(?:-->)/i, /^(?:--)/i, /^(?:$)/i, /^(?:.)/i], conditions: { "LINE": { "rules": [13, 14], "inclusive": false }, "close_directive": { "rules": [13, 14], "inclusive": false }, "arg_directive": { "rules": [7, 8, 13, 14], "inclusive": false }, "type_directive": { "rules": [6, 7, 13, 14], "inclusive": false }, "open_directive": { "rules": [5, 13, 14], "inclusive": false }, "struct": { "rules": [13, 14, 26, 33, 34, 35, 36, 45, 46, 47, 61, 62, 63, 64, 65], "inclusive": false }, "FLOATING_NOTE_ID": { "rules": [54], "inclusive": false }, "FLOATING_NOTE": { "rules": [51, 52, 53], "inclusive": false }, "NOTE_TEXT": { "rules": [56, 57], "inclusive": false }, "NOTE_ID": { "rules": [55], "inclusive": false }, "NOTE": { "rules": [48, 49, 50], "inclusive": false }, "acc_descr_multiline": { "rules": [24, 25], "inclusive": false }, "acc_descr": { "rules": [22], "inclusive": false }, "acc_title": { "rules": [20], "inclusive": false }, "SCALE": { "rules": [17, 18], "inclusive": false }, "ALIAS": { "rules": [], "inclusive": false }, "STATE_ID": { "rules": [39], "inclusive": false }, "STATE_STRING": { "rules": [40, 41], "inclusive": false }, "FORK_STATE": { "rules": [], "inclusive": false }, "STATE": { "rules": [13, 14, 27, 28, 29, 30, 31, 32, 37, 38, 42, 43, 44], "inclusive": false }, "ID": { "rules": [13, 14], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 9, 10, 11, 12, 14, 15, 16, 19, 21, 23, 26, 44, 47, 58, 59, 60, 61, 62, 63, 64, 66, 67], "inclusive": true } } }; return lexer2; }(); parser2.lexer = lexer; function Parser() { this.yy = {}; } Parser.prototype = parser2; parser2.Parser = Parser; return new Parser(); }(); parser$1.parser = parser$1; const stateDetector = (txt, config2) => { var _a; if (((_a = config2 == null ? void 0 : config2.state) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper") return false; return txt.match(/^\s*stateDiagram/) !== null; }; const stateDetectorV2 = (text, config2) => { var _a; if (text.match(/^\s*stateDiagram-v2/) !== null) return true; if (text.match(/^\s*stateDiagram/) && ((_a = config2 == null ? void 0 : config2.state) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper") return true; return false; }; const clone = (o) => JSON.parse(JSON.stringify(o)); let rootDoc = []; const parseDirective$2 = function(statement, context, type2) { mermaidAPI.parseDirective(this, statement, context, type2); }; const setRootDoc = (o) => { log$1.info("Setting root doc", o); rootDoc = o; }; const getRootDoc = () => rootDoc; const docTranslator = (parent, node, first) => { if (node.stmt === "relation") { docTranslator(parent, node.state1, true); docTranslator(parent, node.state2, false); } else { if (node.stmt === "state") { if (node.id === "[*]") { node.id = first ? parent.id + "_start" : parent.id + "_end"; node.start = first; } } if (node.doc) { const doc = []; let i = 0; let currentDoc = []; for (i = 0; i < node.doc.length; i++) { if (node.doc[i].type === "divider") { const newNode = clone(node.doc[i]); newNode.doc = clone(currentDoc); doc.push(newNode); currentDoc = []; } else { currentDoc.push(node.doc[i]); } } if (doc.length > 0 && currentDoc.length > 0) { const newNode = { stmt: "state", id: generateId$1(), type: "divider", doc: clone(currentDoc) }; doc.push(clone(newNode)); node.doc = doc; } node.doc.forEach((docNode) => docTranslator(node, docNode, true)); } } }; const getRootDocV2 = () => { docTranslator({ id: "root" }, { id: "root", doc: rootDoc }, true); return { id: "root", doc: rootDoc }; }; const extract = (_doc) => { let doc; if (_doc.doc) { doc = _doc.doc; } else { doc = _doc; } log$1.info(doc); clear$1(true); log$1.info("Extract", doc); doc.forEach((item) => { if (item.stmt === "state") { addState(item.id, item.type, item.doc, item.description, item.note); } if (item.stmt === "relation") { addRelation(item.state1.id, item.state2.id, item.description); } }); }; const newDoc = () => { return { relations: [], states: {}, documents: {} }; }; let documents = { root: newDoc() }; let currentDocument = documents.root; let startCnt = 0; const addState = function(id, type2, doc, descr, note2) { if (typeof currentDocument.states[id] === "undefined") { currentDocument.states[id] = { id, descriptions: [], type: type2, doc, note: note2 }; } else { if (!currentDocument.states[id].doc) { currentDocument.states[id].doc = doc; } if (!currentDocument.states[id].type) { currentDocument.states[id].type = type2; } } if (descr) { log$1.info("Adding state ", id, descr); if (typeof descr === "string") addDescription(id, descr.trim()); if (typeof descr === "object") { descr.forEach((des) => addDescription(id, des.trim())); } } if (note2) { currentDocument.states[id].note = note2; currentDocument.states[id].note.text = common.sanitizeText( currentDocument.states[id].note.text, getConfig$1() ); } }; const clear$1 = function(saveCommon) { documents = { root: newDoc() }; currentDocument = documents.root; currentDocument = documents.root; startCnt = 0; classes = []; if (!saveCommon) { clear$g(); } }; const getState = function(id) { return currentDocument.states[id]; }; const getStates = function() { return currentDocument.states; }; const logDocuments = function() { log$1.info("Documents = ", documents); }; const getRelations = function() { return currentDocument.relations; }; const addRelation = function(_id1, _id2, title2) { let id1 = _id1; let id2 = _id2; let type1 = "default"; let type2 = "default"; if (_id1 === "[*]") { startCnt++; id1 = "start" + startCnt; type1 = "start"; } if (_id2 === "[*]") { id2 = "end" + startCnt; type2 = "end"; } addState(id1, type1); addState(id2, type2); currentDocument.relations.push({ id1, id2, title: common.sanitizeText(title2, getConfig$1()) }); }; const addDescription = function(id, _descr) { const theState = currentDocument.states[id]; let descr = _descr; if (descr[0] === ":") { descr = descr.substr(1).trim(); } theState.descriptions.push(common.sanitizeText(descr, getConfig$1())); }; const cleanupLabel = function(label) { if (label.substring(0, 1) === ":") { return label.substr(2).trim(); } else { return label.trim(); } }; const lineType = { LINE: 0, DOTTED_LINE: 1 }; let dividerCnt = 0; const getDividerId = () => { dividerCnt++; return "divider-id-" + dividerCnt; }; let classes = []; const getClasses$1 = () => classes; let direction = "TB"; const getDirection = () => direction; const setDirection = (dir) => { direction = dir; }; const relationType = { AGGREGATION: 0, EXTENSION: 1, COMPOSITION: 2, DEPENDENCY: 3 }; const trimColon = (str) => str && str[0] === ":" ? str.substr(1).trim() : str.trim(); const stateDb = { parseDirective: parseDirective$2, getConfig: () => getConfig$1().state, addState, clear: clear$1, getState, getStates, getRelations, getClasses: getClasses$1, getDirection, addRelation, getDividerId, setDirection, cleanupLabel, lineType, relationType, logDocuments, getRootDoc, setRootDoc, getRootDocV2, extract, trimColon, getAccTitle, setAccTitle, getAccDescription, setAccDescription }; const drawStartState = (g) => g.append("circle").attr("class", "start-state").attr("r", getConfig$1().state.sizeUnit).attr("cx", getConfig$1().state.padding + getConfig$1().state.sizeUnit).attr("cy", getConfig$1().state.padding + getConfig$1().state.sizeUnit); const drawDivider = (g) => g.append("line").style("stroke", "grey").style("stroke-dasharray", "3").attr("x1", getConfig$1().state.textHeight).attr("class", "divider").attr("x2", getConfig$1().state.textHeight * 2).attr("y1", 0).attr("y2", 0); const drawSimpleState = (g, stateDef) => { const state = g.append("text").attr("x", 2 * getConfig$1().state.padding).attr("y", getConfig$1().state.textHeight + 2 * getConfig$1().state.padding).attr("font-size", getConfig$1().state.fontSize).attr("class", "state-title").text(stateDef.id); const classBox = state.node().getBBox(); g.insert("rect", ":first-child").attr("x", getConfig$1().state.padding).attr("y", getConfig$1().state.padding).attr("width", classBox.width + 2 * getConfig$1().state.padding).attr("height", classBox.height + 2 * getConfig$1().state.padding).attr("rx", getConfig$1().state.radius); return state; }; const drawDescrState = (g, stateDef) => { const addTspan2 = function(textEl, txt, isFirst2) { const tSpan = textEl.append("tspan").attr("x", 2 * getConfig$1().state.padding).text(txt); if (!isFirst2) { tSpan.attr("dy", getConfig$1().state.textHeight); } }; const title2 = g.append("text").attr("x", 2 * getConfig$1().state.padding).attr("y", getConfig$1().state.textHeight + 1.3 * getConfig$1().state.padding).attr("font-size", getConfig$1().state.fontSize).attr("class", "state-title").text(stateDef.descriptions[0]); const titleBox = title2.node().getBBox(); const titleHeight = titleBox.height; const description2 = g.append("text").attr("x", getConfig$1().state.padding).attr( "y", titleHeight + getConfig$1().state.padding * 0.4 + getConfig$1().state.dividerMargin + getConfig$1().state.textHeight ).attr("class", "state-description"); let isFirst = true; let isSecond = true; stateDef.descriptions.forEach(function(descr) { if (!isFirst) { addTspan2(description2, descr, isSecond); isSecond = false; } isFirst = false; }); const descrLine = g.append("line").attr("x1", getConfig$1().state.padding).attr("y1", getConfig$1().state.padding + titleHeight + getConfig$1().state.dividerMargin / 2).attr("y2", getConfig$1().state.padding + titleHeight + getConfig$1().state.dividerMargin / 2).attr("class", "descr-divider"); const descrBox = description2.node().getBBox(); const width2 = Math.max(descrBox.width, titleBox.width); descrLine.attr("x2", width2 + 3 * getConfig$1().state.padding); g.insert("rect", ":first-child").attr("x", getConfig$1().state.padding).attr("y", getConfig$1().state.padding).attr("width", width2 + 2 * getConfig$1().state.padding).attr("height", descrBox.height + titleHeight + 2 * getConfig$1().state.padding).attr("rx", getConfig$1().state.radius); return g; }; const addTitleAndBox = (g, stateDef, altBkg) => { const pad = getConfig$1().state.padding; const dblPad = 2 * getConfig$1().state.padding; const orgBox = g.node().getBBox(); const orgWidth = orgBox.width; const orgX = orgBox.x; const title2 = g.append("text").attr("x", 0).attr("y", getConfig$1().state.titleShift).attr("font-size", getConfig$1().state.fontSize).attr("class", "state-title").text(stateDef.id); const titleBox = title2.node().getBBox(); const titleWidth = titleBox.width + dblPad; let width2 = Math.max(titleWidth, orgWidth); if (width2 === orgWidth) { width2 = width2 + dblPad; } let startX; const graphBox = g.node().getBBox(); if (stateDef.doc) ; startX = orgX - pad; if (titleWidth > orgWidth) { startX = (orgWidth - width2) / 2 + pad; } if (Math.abs(orgX - graphBox.x) < pad) { if (titleWidth > orgWidth) { startX = orgX - (titleWidth - orgWidth) / 2; } } const lineY = 1 - getConfig$1().state.textHeight; g.insert("rect", ":first-child").attr("x", startX).attr("y", lineY).attr("class", altBkg ? "alt-composit" : "composit").attr("width", width2).attr( "height", graphBox.height + getConfig$1().state.textHeight + getConfig$1().state.titleShift + 1 ).attr("rx", "0"); title2.attr("x", startX + pad); if (titleWidth <= orgWidth) title2.attr("x", orgX + (width2 - dblPad) / 2 - titleWidth / 2 + pad); g.insert("rect", ":first-child").attr("x", startX).attr( "y", getConfig$1().state.titleShift - getConfig$1().state.textHeight - getConfig$1().state.padding ).attr("width", width2).attr("height", getConfig$1().state.textHeight * 3).attr("rx", getConfig$1().state.radius); g.insert("rect", ":first-child").attr("x", startX).attr( "y", getConfig$1().state.titleShift - getConfig$1().state.textHeight - getConfig$1().state.padding ).attr("width", width2).attr("height", graphBox.height + 3 + 2 * getConfig$1().state.textHeight).attr("rx", getConfig$1().state.radius); return g; }; const drawEndState = (g) => { g.append("circle").attr("class", "end-state-outer").attr("r", getConfig$1().state.sizeUnit + getConfig$1().state.miniPadding).attr( "cx", getConfig$1().state.padding + getConfig$1().state.sizeUnit + getConfig$1().state.miniPadding ).attr( "cy", getConfig$1().state.padding + getConfig$1().state.sizeUnit + getConfig$1().state.miniPadding ); return g.append("circle").attr("class", "end-state-inner").attr("r", getConfig$1().state.sizeUnit).attr("cx", getConfig$1().state.padding + getConfig$1().state.sizeUnit + 2).attr("cy", getConfig$1().state.padding + getConfig$1().state.sizeUnit + 2); }; const drawForkJoinState = (g, stateDef) => { let width2 = getConfig$1().state.forkWidth; let height2 = getConfig$1().state.forkHeight; if (stateDef.parentId) { let tmp = width2; width2 = height2; height2 = tmp; } return g.append("rect").style("stroke", "black").style("fill", "black").attr("width", width2).attr("height", height2).attr("x", getConfig$1().state.padding).attr("y", getConfig$1().state.padding); }; const _drawLongText = (_text, x, y, g) => { let textHeight = 0; const textElem = g.append("text"); textElem.style("text-anchor", "start"); textElem.attr("class", "noteText"); let text = _text.replace(/\r\n/g, "
"); text = text.replace(/\n/g, "
"); const lines = text.split(common.lineBreakRegex); let tHeight = 1.25 * getConfig$1().state.noteMargin; for (const line2 of lines) { const txt = line2.trim(); if (txt.length > 0) { const span = textElem.append("tspan"); span.text(txt); if (tHeight === 0) { const textBounds = span.node().getBBox(); tHeight += textBounds.height; } textHeight += tHeight; span.attr("x", x + getConfig$1().state.noteMargin); span.attr("y", y + textHeight + 1.25 * getConfig$1().state.noteMargin); } } return { textWidth: textElem.node().getBBox().width, textHeight }; }; const drawNote = (text, g) => { g.attr("class", "state-note"); const note2 = g.append("rect").attr("x", 0).attr("y", getConfig$1().state.padding); const rectElem = g.append("g"); const { textWidth, textHeight } = _drawLongText(text, 0, 0, rectElem); note2.attr("height", textHeight + 2 * getConfig$1().state.noteMargin); note2.attr("width", textWidth + getConfig$1().state.noteMargin * 2); return note2; }; const drawState = function(elem, stateDef) { const id = stateDef.id; const stateInfo = { id, label: stateDef.id, width: 0, height: 0 }; const g = elem.append("g").attr("id", id).attr("class", "stateGroup"); if (stateDef.type === "start") drawStartState(g); if (stateDef.type === "end") drawEndState(g); if (stateDef.type === "fork" || stateDef.type === "join") drawForkJoinState(g, stateDef); if (stateDef.type === "note") drawNote(stateDef.note.text, g); if (stateDef.type === "divider") drawDivider(g); if (stateDef.type === "default" && stateDef.descriptions.length === 0) drawSimpleState(g, stateDef); if (stateDef.type === "default" && stateDef.descriptions.length > 0) drawDescrState(g, stateDef); const stateBox = g.node().getBBox(); stateInfo.width = stateBox.width + 2 * getConfig$1().state.padding; stateInfo.height = stateBox.height + 2 * getConfig$1().state.padding; return stateInfo; }; let edgeCount = 0; const drawEdge = function(elem, path, relation) { const getRelationType = function(type2) { switch (type2) { case stateDb.relationType.AGGREGATION: return "aggregation"; case stateDb.relationType.EXTENSION: return "extension"; case stateDb.relationType.COMPOSITION: return "composition"; case stateDb.relationType.DEPENDENCY: return "dependency"; } }; path.points = path.points.filter((p) => !Number.isNaN(p.y)); const lineData = path.points; const lineFunction = line().x(function(d) { return d.x; }).y(function(d) { return d.y; }).curve(curveBasis); const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", "edge" + edgeCount).attr("class", "transition"); let url = ""; if (getConfig$1().state.arrowMarkerAbsolute) { url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; url = url.replace(/\(/g, "\\("); url = url.replace(/\)/g, "\\)"); } svgPath.attr( "marker-end", "url(" + url + "#" + getRelationType(stateDb.relationType.DEPENDENCY) + "End)" ); if (typeof relation.title !== "undefined") { const label = elem.append("g").attr("class", "stateLabel"); const { x, y } = utils.calcLabelPosition(path.points); const rows = common.getRows(relation.title); let titleHeight = 0; const titleRows = []; let maxWidth = 0; let minX = 0; for (let i = 0; i <= rows.length; i++) { const title2 = label.append("text").attr("text-anchor", "middle").text(rows[i]).attr("x", x).attr("y", y + titleHeight); const boundstmp = title2.node().getBBox(); maxWidth = Math.max(maxWidth, boundstmp.width); minX = Math.min(minX, boundstmp.x); log$1.info(boundstmp.x, x, y + titleHeight); if (titleHeight === 0) { const titleBox = title2.node().getBBox(); titleHeight = titleBox.height; log$1.info("Title height", titleHeight, y); } titleRows.push(title2); } let boxHeight = titleHeight * rows.length; if (rows.length > 1) { const heightAdj = (rows.length - 1) * titleHeight * 0.5; titleRows.forEach((title2, i) => title2.attr("y", y + i * titleHeight - heightAdj)); boxHeight = titleHeight * rows.length; } const bounds2 = label.node().getBBox(); label.insert("rect", ":first-child").attr("class", "box").attr("x", x - maxWidth / 2 - getConfig$1().state.padding / 2).attr("y", y - boxHeight / 2 - getConfig$1().state.padding / 2 - 3.5).attr("width", maxWidth + getConfig$1().state.padding).attr("height", boxHeight + getConfig$1().state.padding); log$1.info(bounds2); } edgeCount++; }; let conf$3; const transformationLog = {}; const setConf$3 = function() { }; const insertMarkers = function(elem) { elem.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z"); }; const draw$3 = function(text, id, _version, diagObj) { conf$3 = getConfig$1().state; const securityLevel = getConfig$1().securityLevel; let sandboxElement; if (securityLevel === "sandbox") { sandboxElement = select("#i" + id); } const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; log$1.debug("Rendering diagram " + text); const diagram = root2.select(`[id='${id}']`); insertMarkers(diagram); const graph = new graphlib.Graph({ multigraph: true, compound: true, rankdir: "RL" }); graph.setDefaultEdgeLabel(function() { return {}; }); const rootDoc2 = diagObj.db.getRootDoc(); renderDoc(rootDoc2, diagram, void 0, false, root2, doc, diagObj); const padding2 = conf$3.padding; const bounds2 = diagram.node().getBBox(); const width2 = bounds2.width + padding2 * 2; const height2 = bounds2.height + padding2 * 2; const svgWidth = width2 * 1.75; configureSvgSize(diagram, height2, svgWidth, conf$3.useMaxWidth); diagram.attr( "viewBox", `${bounds2.x - conf$3.padding} ${bounds2.y - conf$3.padding} ` + width2 + " " + height2 ); addSVGAccessibilityFields(diagObj.db, diagram, id); }; const getLabelWidth = (text) => { return text ? text.length * conf$3.fontSizeFactor : 1; }; const renderDoc = (doc, diagram, parentId, altBkg, root2, domDocument, diagObj) => { const graph = new graphlib.Graph({ compound: true, multigraph: true }); let i; let edgeFreeDoc = true; for (i = 0; i < doc.length; i++) { if (doc[i].stmt === "relation") { edgeFreeDoc = false; break; } } if (parentId) graph.setGraph({ rankdir: "LR", multigraph: true, compound: true, ranker: "tight-tree", ranksep: edgeFreeDoc ? 1 : conf$3.edgeLengthFactor, nodeSep: edgeFreeDoc ? 1 : 50, isMultiGraph: true }); else { graph.setGraph({ rankdir: "TB", multigraph: true, compound: true, ranksep: edgeFreeDoc ? 1 : conf$3.edgeLengthFactor, nodeSep: edgeFreeDoc ? 1 : 50, ranker: "tight-tree", isMultiGraph: true }); } graph.setDefaultEdgeLabel(function() { return {}; }); diagObj.db.extract(doc); const states = diagObj.db.getStates(); const relations2 = diagObj.db.getRelations(); const keys = Object.keys(states); for (let i2 = 0; i2 < keys.length; i2++) { const stateDef = states[keys[i2]]; if (parentId) { stateDef.parentId = parentId; } let node; if (stateDef.doc) { let sub = diagram.append("g").attr("id", stateDef.id).attr("class", "stateGroup"); node = renderDoc(stateDef.doc, sub, stateDef.id, !altBkg, root2, domDocument, diagObj); { sub = addTitleAndBox(sub, stateDef, altBkg); let boxBounds = sub.node().getBBox(); node.width = boxBounds.width; node.height = boxBounds.height + conf$3.padding / 2; transformationLog[stateDef.id] = { y: conf$3.compositTitleSize }; } } else { node = drawState(diagram, stateDef); } if (stateDef.note) { const noteDef = { descriptions: [], id: stateDef.id + "-note", note: stateDef.note, type: "note" }; const note2 = drawState(diagram, noteDef); if (stateDef.note.position === "left of") { graph.setNode(node.id + "-note", note2); graph.setNode(node.id, node); } else { graph.setNode(node.id, node); graph.setNode(node.id + "-note", note2); } graph.setParent(node.id, node.id + "-group"); graph.setParent(node.id + "-note", node.id + "-group"); } else { graph.setNode(node.id, node); } } log$1.debug("Count=", graph.nodeCount(), graph); let cnt2 = 0; relations2.forEach(function(relation) { cnt2++; log$1.debug("Setting edge", relation); graph.setEdge( relation.id1, relation.id2, { relation, width: getLabelWidth(relation.title), height: conf$3.labelHeight * common.getRows(relation.title).length, labelpos: "c" }, "id" + cnt2 ); }); dagre.layout(graph); log$1.debug("Graph after layout", graph.nodes()); const svgElem = diagram.node(); graph.nodes().forEach(function(v) { if (typeof v !== "undefined" && typeof graph.node(v) !== "undefined") { log$1.warn("Node " + v + ": " + JSON.stringify(graph.node(v))); root2.select("#" + svgElem.id + " #" + v).attr( "transform", "translate(" + (graph.node(v).x - graph.node(v).width / 2) + "," + (graph.node(v).y + (transformationLog[v] ? transformationLog[v].y : 0) - graph.node(v).height / 2) + " )" ); root2.select("#" + svgElem.id + " #" + v).attr("data-x-shift", graph.node(v).x - graph.node(v).width / 2); const dividers = domDocument.querySelectorAll("#" + svgElem.id + " #" + v + " .divider"); dividers.forEach((divider2) => { const parent = divider2.parentElement; let pWidth = 0; let pShift = 0; if (parent) { if (parent.parentElement) pWidth = parent.parentElement.getBBox().width; pShift = parseInt(parent.getAttribute("data-x-shift"), 10); if (Number.isNaN(pShift)) { pShift = 0; } } divider2.setAttribute("x1", 0 - pShift + 8); divider2.setAttribute("x2", pWidth - pShift - 8); }); } else { log$1.debug("No Node " + v + ": " + JSON.stringify(graph.node(v))); } }); let stateBox = svgElem.getBBox(); graph.edges().forEach(function(e) { if (typeof e !== "undefined" && typeof graph.edge(e) !== "undefined") { log$1.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(graph.edge(e))); drawEdge(diagram, graph.edge(e), graph.edge(e).relation); } }); stateBox = svgElem.getBBox(); const stateInfo = { id: parentId ? parentId : "root", label: parentId ? parentId : "root", width: 0, height: 0 }; stateInfo.width = stateBox.width + 2 * conf$3.padding; stateInfo.height = stateBox.height + 2 * conf$3.padding; log$1.debug("Doc rendered", stateInfo, graph); return stateInfo; }; const stateRenderer = { setConf: setConf$3, draw: draw$3 }; const conf$2 = {}; const setConf$2 = function(cnf) { const keys = Object.keys(cnf); for (let i = 0; i < keys.length; i++) { conf$2[keys[i]] = cnf[keys[i]]; } }; let nodeDb = {}; const getClasses = function(text, diag) { log$1.trace("Extracting classes"); diag.sb.clear(); diag.parser.parse(text); return diag.sb.getClasses(); }; const setupNode = (g, parent, node, altFlag) => { if (node.id !== "root") { let shape = "rect"; if (node.start === true) { shape = "start"; } if (node.start === false) { shape = "end"; } if (node.type !== "default") { shape = node.type; } if (!nodeDb[node.id]) { nodeDb[node.id] = { id: node.id, shape, description: common.sanitizeText(node.id, getConfig$1()), classes: "statediagram-state" }; } if (node.description) { if (Array.isArray(nodeDb[node.id].description)) { nodeDb[node.id].shape = "rectWithTitle"; nodeDb[node.id].description.push(node.description); } else { if (nodeDb[node.id].description.length > 0) { nodeDb[node.id].shape = "rectWithTitle"; if (nodeDb[node.id].description === node.id) { nodeDb[node.id].description = [node.description]; } else { nodeDb[node.id].description = [nodeDb[node.id].description, node.description]; } } else { nodeDb[node.id].shape = "rect"; nodeDb[node.id].description = node.description; } } nodeDb[node.id].description = common.sanitizeTextOrArray( nodeDb[node.id].description, getConfig$1() ); } if (nodeDb[node.id].description.length === 1 && nodeDb[node.id].shape === "rectWithTitle") { nodeDb[node.id].shape = "rect"; } if (!nodeDb[node.id].type && node.doc) { log$1.info("Setting cluster for ", node.id, getDir(node)); nodeDb[node.id].type = "group"; nodeDb[node.id].dir = getDir(node); nodeDb[node.id].shape = node.type === "divider" ? "divider" : "roundedWithTitle"; nodeDb[node.id].classes = nodeDb[node.id].classes + " " + (altFlag ? "statediagram-cluster statediagram-cluster-alt" : "statediagram-cluster"); } const nodeData = { labelStyle: "", shape: nodeDb[node.id].shape, labelText: nodeDb[node.id].description, classes: nodeDb[node.id].classes, style: "", id: node.id, dir: nodeDb[node.id].dir, domId: "state-" + node.id + "-" + cnt, type: nodeDb[node.id].type, padding: 15 }; if (node.note) { const noteData = { labelStyle: "", shape: "note", labelText: node.note.text, classes: "statediagram-note", style: "", id: node.id + "----note-" + cnt, domId: "state-" + node.id + "----note-" + cnt, type: nodeDb[node.id].type, padding: 15 }; const groupData = { labelStyle: "", shape: "noteGroup", labelText: node.note.text, classes: nodeDb[node.id].classes, style: "", id: node.id + "----parent", domId: "state-" + node.id + "----parent-" + cnt, type: "group", padding: 0 }; cnt++; g.setNode(node.id + "----parent", groupData); g.setNode(noteData.id, noteData); g.setNode(node.id, nodeData); g.setParent(node.id, node.id + "----parent"); g.setParent(noteData.id, node.id + "----parent"); let from = node.id; let to = noteData.id; if (node.note.position === "left of") { from = noteData.id; to = node.id; } g.setEdge(from, to, { arrowhead: "none", arrowType: "", style: "fill:none", labelStyle: "", classes: "transition note-edge", arrowheadStyle: "fill: #333", labelpos: "c", labelType: "text", thickness: "normal" }); } else { g.setNode(node.id, nodeData); } } if (parent) { if (parent.id !== "root") { log$1.trace("Setting node ", node.id, " to be child of its parent ", parent.id); g.setParent(node.id, parent.id); } } if (node.doc) { log$1.trace("Adding nodes children "); setupDoc(g, node, node.doc, !altFlag); } }; let cnt = 0; const setupDoc = (g, parent, doc, altFlag) => { log$1.trace("items", doc); doc.forEach((item) => { if (item.stmt === "state" || item.stmt === "default") { setupNode(g, parent, item, altFlag); } else if (item.stmt === "relation") { setupNode(g, parent, item.state1, altFlag); setupNode(g, parent, item.state2, altFlag); const edgeData = { id: "edge" + cnt, arrowhead: "normal", arrowTypeEnd: "arrow_barb", style: "fill:none", labelStyle: "", label: common.sanitizeText(item.description, getConfig$1()), arrowheadStyle: "fill: #333", labelpos: "c", labelType: "text", thickness: "normal", classes: "transition" }; let startId = item.state1.id; let endId = item.state2.id; g.setEdge(startId, endId, edgeData, cnt); cnt++; } }); }; const getDir = (nodes, defaultDir) => { let dir = defaultDir || "TB"; if (nodes.doc) { for (let i = 0; i < nodes.doc.length; i++) { const node = nodes.doc[i]; if (node.stmt === "dir") { dir = node.value; } } } return dir; }; const draw$2 = function(text, id, _version, diag) { log$1.info("Drawing state diagram (v2)", id); nodeDb = {}; diag.db.getDirection(); const { securityLevel, state: conf2 } = getConfig$1(); const nodeSpacing = conf2.nodeSpacing || 50; const rankSpacing = conf2.rankSpacing || 50; log$1.info(diag.db.getRootDocV2()); diag.db.extract(diag.db.getRootDocV2()); log$1.info(diag.db.getRootDocV2()); const g = new graphlib.Graph({ multigraph: true, compound: true }).setGraph({ rankdir: getDir(diag.db.getRootDocV2()), nodesep: nodeSpacing, ranksep: rankSpacing, marginx: 8, marginy: 8 }).setDefaultEdgeLabel(function() { return {}; }); setupNode(g, void 0, diag.db.getRootDocV2(), true); let sandboxElement; if (securityLevel === "sandbox") { sandboxElement = select("#i" + id); } const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); const svg = root2.select(`[id="${id}"]`); const element = root2.select("#" + id + " g"); render$1(element, g, ["barb"], "statediagram", id); const padding2 = 8; const bounds2 = svg.node().getBBox(); const width2 = bounds2.width + padding2 * 2; const height2 = bounds2.height + padding2 * 2; svg.attr("class", "statediagram"); const svgBounds = svg.node().getBBox(); configureSvgSize(svg, height2, width2, conf2.useMaxWidth); const vBox = `${svgBounds.x - padding2} ${svgBounds.y - padding2} ${width2} ${height2}`; log$1.debug(`viewBox ${vBox}`); svg.attr("viewBox", vBox); const labels = document.querySelectorAll('[id="' + id + '"] .edgeLabel .label'); for (let k = 0; k < labels.length; k++) { const label = labels[k]; const dim = label.getBBox(); const rect2 = document.createElementNS("http://www.w3.org/2000/svg", "rect"); rect2.setAttribute("rx", 0); rect2.setAttribute("ry", 0); rect2.setAttribute("width", dim.width); rect2.setAttribute("height", dim.height); label.insertBefore(rect2, label.firstChild); } addSVGAccessibilityFields(diag.db, svg, id); }; const stateRendererV2 = { setConf: setConf$2, getClasses, draw: draw$2 }; var parser = function() { var o = function(k, v, o2, l) { for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ; return o2; }, $V0 = [1, 2], $V1 = [1, 5], $V2 = [6, 9, 11, 17, 18, 20, 22, 23, 24, 26], $V3 = [1, 15], $V4 = [1, 16], $V5 = [1, 17], $V6 = [1, 18], $V7 = [1, 19], $V8 = [1, 20], $V9 = [1, 24], $Va = [4, 6, 9, 11, 17, 18, 20, 22, 23, 24, 26]; var parser2 = { trace: function trace() { }, yy: {}, symbols_: { "error": 2, "start": 3, "journey": 4, "document": 5, "EOF": 6, "directive": 7, "line": 8, "SPACE": 9, "statement": 10, "NEWLINE": 11, "openDirective": 12, "typeDirective": 13, "closeDirective": 14, ":": 15, "argDirective": 16, "title": 17, "acc_title": 18, "acc_title_value": 19, "acc_descr": 20, "acc_descr_value": 21, "acc_descr_multiline_value": 22, "section": 23, "taskName": 24, "taskData": 25, "open_directive": 26, "type_directive": 27, "arg_directive": 28, "close_directive": 29, "$accept": 0, "$end": 1 }, terminals_: { 2: "error", 4: "journey", 6: "EOF", 9: "SPACE", 11: "NEWLINE", 15: ":", 17: "title", 18: "acc_title", 19: "acc_title_value", 20: "acc_descr", 21: "acc_descr_value", 22: "acc_descr_multiline_value", 23: "section", 24: "taskName", 25: "taskData", 26: "open_directive", 27: "type_directive", 28: "arg_directive", 29: "close_directive" }, productions_: [0, [3, 3], [3, 2], [5, 0], [5, 2], [8, 2], [8, 1], [8, 1], [8, 1], [7, 4], [7, 6], [10, 1], [10, 2], [10, 2], [10, 1], [10, 1], [10, 2], [10, 1], [12, 1], [13, 1], [16, 1], [14, 1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { var $0 = $$.length - 1; switch (yystate) { case 1: return $$[$0 - 1]; case 3: this.$ = []; break; case 4: $$[$0 - 1].push($$[$0]); this.$ = $$[$0 - 1]; break; case 5: case 6: this.$ = $$[$0]; break; case 7: case 8: this.$ = []; break; case 11: yy.setDiagramTitle($$[$0].substr(6)); this.$ = $$[$0].substr(6); break; case 12: this.$ = $$[$0].trim(); yy.setAccTitle(this.$); break; case 13: case 14: this.$ = $$[$0].trim(); yy.setAccDescription(this.$); break; case 15: yy.addSection($$[$0].substr(8)); this.$ = $$[$0].substr(8); break; case 16: yy.addTask($$[$0 - 1], $$[$0]); this.$ = "task"; break; case 18: yy.parseDirective("%%{", "open_directive"); break; case 19: yy.parseDirective($$[$0], "type_directive"); break; case 20: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], "arg_directive"); break; case 21: yy.parseDirective("}%%", "close_directive", "journey"); break; } }, table: [{ 3: 1, 4: $V0, 7: 3, 12: 4, 26: $V1 }, { 1: [3] }, o($V2, [2, 3], { 5: 6 }), { 3: 7, 4: $V0, 7: 3, 12: 4, 26: $V1 }, { 13: 8, 27: [1, 9] }, { 27: [2, 18] }, { 6: [1, 10], 7: 21, 8: 11, 9: [1, 12], 10: 13, 11: [1, 14], 12: 4, 17: $V3, 18: $V4, 20: $V5, 22: $V6, 23: $V7, 24: $V8, 26: $V1 }, { 1: [2, 2] }, { 14: 22, 15: [1, 23], 29: $V9 }, o([15, 29], [2, 19]), o($V2, [2, 8], { 1: [2, 1] }), o($V2, [2, 4]), { 7: 21, 10: 25, 12: 4, 17: $V3, 18: $V4, 20: $V5, 22: $V6, 23: $V7, 24: $V8, 26: $V1 }, o($V2, [2, 6]), o($V2, [2, 7]), o($V2, [2, 11]), { 19: [1, 26] }, { 21: [1, 27] }, o($V2, [2, 14]), o($V2, [2, 15]), { 25: [1, 28] }, o($V2, [2, 17]), { 11: [1, 29] }, { 16: 30, 28: [1, 31] }, { 11: [2, 21] }, o($V2, [2, 5]), o($V2, [2, 12]), o($V2, [2, 13]), o($V2, [2, 16]), o($Va, [2, 9]), { 14: 32, 29: $V9 }, { 29: [2, 20] }, { 11: [1, 33] }, o($Va, [2, 10])], defaultActions: { 5: [2, 18], 7: [2, 2], 24: [2, 21], 31: [2, 20] }, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse2(input) { var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer2 = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer2.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer2; sharedState.yy.parser = this; if (typeof lexer2.yylloc == "undefined") { lexer2.yylloc = {}; } var yyloc = lexer2.yylloc; lstack.push(yyloc); var ranges = lexer2.options && lexer2.options.ranges; if (typeof sharedState.yy.parseError === "function") { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function lex() { var token; token = tstack.pop() || lexer2.lex() || EOF; if (typeof token !== "number") { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self2.symbols_[token] || token; } return token; } var symbol, state, action, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push("'" + this.terminals_[p] + "'"); } } if (lexer2.showPosition) { errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; } else { errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); } this.parseError(errStr, { text: lexer2.match, token: this.terminals_[symbol] || symbol, line: lexer2.yylineno, loc: yyloc, expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer2.yytext); lstack.push(lexer2.yylloc); stack.push(action[1]); symbol = null; { yyleng = lexer2.yyleng; yytext = lexer2.yytext; yylineno = lexer2.yylineno; yyloc = lexer2.yylloc; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== "undefined") { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; } }; var lexer = function() { var lexer2 = { EOF: 1, parseError: function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, setInput: function(input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; this.yylineno = this.yyleng = 0; this.yytext = this.matched = this.match = ""; this.conditionStack = ["INITIAL"]; this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; if (this.options.ranges) { this.yylloc.range = [0, 0]; } this.offset = 0; return this; }, input: function() { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, unput: function(ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); this.offset -= len; var oldLines = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1); this.matched = this.matched.substr(0, this.matched.length - 1); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, more: function() { this._more = true; return this; }, reject: function() { if (this.options.backtrack_lexer) { this._backtrack = true; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, less: function(n) { this.unput(this.match.slice(n)); }, pastInput: function() { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); }, upcomingInput: function() { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20 - next.length); } return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, ""); }, showPosition: function() { var pre = this.pastInput(); var c2 = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c2 + "^"; }, test_match: function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { backup = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { for (var k in backup) { this[k] = backup[k]; } return false; } return false; }, next: function() { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ""; this.match = ""; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; } else { return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } return false; } if (this._input === "") { return this.EOF; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, lex: function lex() { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, begin: function begin(condition) { this.conditionStack.push(condition); }, popState: function popState() { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, _currentRules: function _currentRules() { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, topState: function topState(n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, pushState: function pushState(condition) { this.begin(condition); }, stateStackSize: function stateStackSize() { return this.conditionStack.length; }, options: { "case-insensitive": true }, performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { switch ($avoiding_name_collisions) { case 0: this.begin("open_directive"); return 26; case 1: this.begin("type_directive"); return 27; case 2: this.popState(); this.begin("arg_directive"); return 15; case 3: this.popState(); this.popState(); return 29; case 4: return 28; case 5: break; case 6: break; case 7: return 11; case 8: break; case 9: break; case 10: return 4; case 11: return 17; case 12: this.begin("acc_title"); return 18; case 13: this.popState(); return "acc_title_value"; case 14: this.begin("acc_descr"); return 20; case 15: this.popState(); return "acc_descr_value"; case 16: this.begin("acc_descr_multiline"); break; case 17: this.popState(); break; case 18: return "acc_descr_multiline_value"; case 19: return 23; case 20: return 24; case 21: return 25; case 22: return 15; case 23: return 6; case 24: return "INVALID"; } }, rules: [/^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:journey\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:section\s[^#:\n;]+)/i, /^(?:[^#:\n;]+)/i, /^(?::[^#\n;]+)/i, /^(?::)/i, /^(?:$)/i, /^(?:.)/i], conditions: { "open_directive": { "rules": [1], "inclusive": false }, "type_directive": { "rules": [2, 3], "inclusive": false }, "arg_directive": { "rules": [3, 4], "inclusive": false }, "acc_descr_multiline": { "rules": [17, 18], "inclusive": false }, "acc_descr": { "rules": [15], "inclusive": false }, "acc_title": { "rules": [13], "inclusive": false }, "INITIAL": { "rules": [0, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 19, 20, 21, 22, 23, 24], "inclusive": true } } }; return lexer2; }(); parser2.lexer = lexer; function Parser() { this.yy = {}; } Parser.prototype = parser2; parser2.Parser = Parser; return new Parser(); }(); parser.parser = parser; const journeyDetector = (txt) => { return txt.match(/^\s*journey/) !== null; }; let currentSection = ""; const sections = []; const tasks = []; const rawTasks = []; const parseDirective$1 = function(statement, context, type2) { mermaidAPI.parseDirective(this, statement, context, type2); }; const clear = function() { sections.length = 0; tasks.length = 0; currentSection = ""; rawTasks.length = 0; clear$g(); }; const addSection = function(txt) { currentSection = txt; sections.push(txt); }; const getSections = function() { return sections; }; const getTasks = function() { let allItemsProcessed = compileTasks(); const maxDepth = 100; let iterationCount = 0; while (!allItemsProcessed && iterationCount < maxDepth) { allItemsProcessed = compileTasks(); iterationCount++; } tasks.push(...rawTasks); return tasks; }; const updateActors = function() { const tempActors = []; tasks.forEach((task) => { if (task.people) { tempActors.push(...task.people); } }); const unique = new Set(tempActors); return [...unique].sort(); }; const addTask = function(descr, taskData) { const pieces = taskData.substr(1).split(":"); let score = 0; let peeps = []; if (pieces.length === 1) { score = Number(pieces[0]); peeps = []; } else { score = Number(pieces[0]); peeps = pieces[1].split(","); } const peopleList = peeps.map((s) => s.trim()); const rawTask = { section: currentSection, type: currentSection, people: peopleList, task: descr, score }; rawTasks.push(rawTask); }; const addTaskOrg = function(descr) { const newTask = { section: currentSection, type: currentSection, description: descr, task: descr, classes: [] }; tasks.push(newTask); }; const compileTasks = function() { const compileTask = function(pos) { return rawTasks[pos].processed; }; let allProcessed = true; for (let i = 0; i < rawTasks.length; i++) { compileTask(i); allProcessed = allProcessed && rawTasks[i].processed; } return allProcessed; }; const getActors = function() { return updateActors(); }; const journeyDb = { parseDirective: parseDirective$1, getConfig: () => getConfig$1().journey, clear, setDiagramTitle, getDiagramTitle, setAccTitle, getAccTitle, setAccDescription, getAccDescription, addSection, getSections, getTasks, addTask, addTaskOrg, getActors }; const drawRect = function(elem, rectData) { const rectElem = elem.append("rect"); rectElem.attr("x", rectData.x); rectElem.attr("y", rectData.y); rectElem.attr("fill", rectData.fill); rectElem.attr("stroke", rectData.stroke); rectElem.attr("width", rectData.width); rectElem.attr("height", rectData.height); rectElem.attr("rx", rectData.rx); rectElem.attr("ry", rectData.ry); if (typeof rectData.class !== "undefined") { rectElem.attr("class", rectData.class); } return rectElem; }; const drawFace = function(element, faceData) { const radius = 15; const circleElement = element.append("circle").attr("cx", faceData.cx).attr("cy", faceData.cy).attr("class", "face").attr("r", radius).attr("stroke-width", 2).attr("overflow", "visible"); const face = element.append("g"); face.append("circle").attr("cx", faceData.cx - radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"); face.append("circle").attr("cx", faceData.cx + radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"); function smile(face2) { const arc$1 = arc().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2); face2.append("path").attr("class", "mouth").attr("d", arc$1).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 2) + ")"); } function sad(face2) { const arc$1 = arc().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2); face2.append("path").attr("class", "mouth").attr("d", arc$1).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 7) + ")"); } function ambivalent(face2) { face2.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", faceData.cx - 5).attr("y1", faceData.cy + 7).attr("x2", faceData.cx + 5).attr("y2", faceData.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666"); } if (faceData.score > 3) { smile(face); } else if (faceData.score < 3) { sad(face); } else { ambivalent(face); } return circleElement; }; const drawCircle = function(element, circleData) { const circleElement = element.append("circle"); circleElement.attr("cx", circleData.cx); circleElement.attr("cy", circleData.cy); circleElement.attr("class", "actor-" + circleData.pos); circleElement.attr("fill", circleData.fill); circleElement.attr("stroke", circleData.stroke); circleElement.attr("r", circleData.r); if (typeof circleElement.class !== "undefined") { circleElement.attr("class", circleElement.class); } if (typeof circleData.title !== "undefined") { circleElement.append("title").text(circleData.title); } return circleElement; }; const drawText = function(elem, textData) { const nText = textData.text.replace(//gi, " "); const textElem = elem.append("text"); textElem.attr("x", textData.x); textElem.attr("y", textData.y); textElem.attr("class", "legend"); textElem.style("text-anchor", textData.anchor); if (typeof textData.class !== "undefined") { textElem.attr("class", textData.class); } const span = textElem.append("tspan"); span.attr("x", textData.x + textData.textMargin * 2); span.text(nText); return textElem; }; const drawLabel = function(elem, txtObject) { function genPoints(x, y, width2, height2, cut) { return x + "," + y + " " + (x + width2) + "," + y + " " + (x + width2) + "," + (y + height2 - cut) + " " + (x + width2 - cut * 1.2) + "," + (y + height2) + " " + x + "," + (y + height2); } const polygon = elem.append("polygon"); polygon.attr("points", genPoints(txtObject.x, txtObject.y, 50, 20, 7)); polygon.attr("class", "labelBox"); txtObject.y = txtObject.y + txtObject.labelMargin; txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin; drawText(elem, txtObject); }; const drawSection = function(elem, section, conf2) { const g = elem.append("g"); const rect2 = getNoteRect(); rect2.x = section.x; rect2.y = section.y; rect2.fill = section.fill; rect2.width = conf2.width; rect2.height = conf2.height; rect2.class = "journey-section section-type-" + section.num; rect2.rx = 3; rect2.ry = 3; drawRect(g, rect2); _drawTextCandidateFunc(conf2)( section.text, g, rect2.x, rect2.y, rect2.width, rect2.height, { class: "journey-section section-type-" + section.num }, conf2, section.colour ); }; let taskCount = -1; const drawTask = function(elem, task, conf2) { const center = task.x + conf2.width / 2; const g = elem.append("g"); taskCount++; const maxHeight = 300 + 5 * 30; g.append("line").attr("id", "task" + taskCount).attr("x1", center).attr("y1", task.y).attr("x2", center).attr("y2", maxHeight).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666"); drawFace(g, { cx: center, cy: 300 + (5 - task.score) * 30, score: task.score }); const rect2 = getNoteRect(); rect2.x = task.x; rect2.y = task.y; rect2.fill = task.fill; rect2.width = conf2.width; rect2.height = conf2.height; rect2.class = "task task-type-" + task.num; rect2.rx = 3; rect2.ry = 3; drawRect(g, rect2); let xPos = task.x + 14; task.people.forEach((person) => { const colour = task.actors[person].color; const circle2 = { cx: xPos, cy: task.y, r: 7, fill: colour, stroke: "#000", title: person, pos: task.actors[person].position }; drawCircle(g, circle2); xPos += 10; }); _drawTextCandidateFunc(conf2)( task.task, g, rect2.x, rect2.y, rect2.width, rect2.height, { class: "task" }, conf2, task.colour ); }; const drawBackgroundRect = function(elem, bounds2) { const rectElem = drawRect(elem, { x: bounds2.startx, y: bounds2.starty, width: bounds2.stopx - bounds2.startx, height: bounds2.stopy - bounds2.starty, fill: bounds2.fill, class: "rect" }); rectElem.lower(); }; const getTextObj = function() { return { x: 0, y: 0, fill: void 0, "text-anchor": "start", width: 100, height: 100, textMargin: 0, rx: 0, ry: 0 }; }; const getNoteRect = function() { return { x: 0, y: 0, width: 100, anchor: "start", height: 100, rx: 0, ry: 0 }; }; const _drawTextCandidateFunc = function() { function byText(content, g, x, y, width2, height2, textAttrs, colour) { const text = g.append("text").attr("x", x + width2 / 2).attr("y", y + height2 / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content); _setTextAttrs(text, textAttrs); } function byTspan(content, g, x, y, width2, height2, textAttrs, conf2, colour) { const { taskFontSize, taskFontFamily } = conf2; const lines = content.split(//gi); for (let i = 0; i < lines.length; i++) { const dy = i * taskFontSize - taskFontSize * (lines.length - 1) / 2; const text = g.append("text").attr("x", x + width2 / 2).attr("y", y).attr("fill", colour).style("text-anchor", "middle").style("font-size", taskFontSize).style("font-family", taskFontFamily); text.append("tspan").attr("x", x + width2 / 2).attr("dy", dy).text(lines[i]); text.attr("y", y + height2 / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"); _setTextAttrs(text, textAttrs); } } function byFo(content, g, x, y, width2, height2, textAttrs, conf2) { const body = g.append("switch"); const f = body.append("foreignObject").attr("x", x).attr("y", y).attr("width", width2).attr("height", height2).attr("position", "fixed"); const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%"); text.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content); byTspan(content, body, x, y, width2, height2, textAttrs, conf2); _setTextAttrs(text, textAttrs); } function _setTextAttrs(toText, fromTextAttrsDict) { for (const key in fromTextAttrsDict) { if (key in fromTextAttrsDict) { toText.attr(key, fromTextAttrsDict[key]); } } } return function(conf2) { return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan; }; }(); const initGraphics = function(graphics) { graphics.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z"); }; const svgDraw = { drawRect, drawCircle, drawSection, drawText, drawLabel, drawTask, drawBackgroundRect, getTextObj, getNoteRect, initGraphics }; const setConf$1 = function(cnf) { const keys = Object.keys(cnf); keys.forEach(function(key) { conf$1[key] = cnf[key]; }); }; const actors = {}; function drawActorLegend(diagram) { const conf2 = getConfig$1().journey; let yPos = 60; Object.keys(actors).forEach((person) => { const colour = actors[person].color; const circleData = { cx: 20, cy: yPos, r: 7, fill: colour, stroke: "#000", pos: actors[person].position }; svgDraw.drawCircle(diagram, circleData); const labelData = { x: 40, y: yPos + 7, fill: "#666", text: person, textMargin: conf2.boxTextMargin | 5 }; svgDraw.drawText(diagram, labelData); yPos += 20; }); } const conf$1 = getConfig$1().journey; const LEFT_MARGIN = conf$1.leftMargin; const draw$1 = function(text, id, version2, diagObj) { const conf2 = getConfig$1().journey; diagObj.db.clear(); diagObj.parser.parse(text + "\n"); const securityLevel = getConfig$1().securityLevel; let sandboxElement; if (securityLevel === "sandbox") { sandboxElement = select("#i" + id); } const root2 = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body"); bounds.init(); const diagram = root2.select("#" + id); svgDraw.initGraphics(diagram); const tasks2 = diagObj.db.getTasks(); const title2 = diagObj.db.getDiagramTitle(); const actorNames = diagObj.db.getActors(); for (const member in actors) delete actors[member]; let actorPos = 0; actorNames.forEach((actorName) => { actors[actorName] = { color: conf2.actorColours[actorPos % conf2.actorColours.length], position: actorPos }; actorPos++; }); drawActorLegend(diagram); bounds.insert(0, 0, LEFT_MARGIN, Object.keys(actors).length * 50); drawTasks(diagram, tasks2, 0); const box = bounds.getBounds(); if (title2) { diagram.append("text").text(title2).attr("x", LEFT_MARGIN).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 25); } const height2 = box.stopy - box.starty + 2 * conf2.diagramMarginY; const width2 = LEFT_MARGIN + box.stopx + 2 * conf2.diagramMarginX; configureSvgSize(diagram, height2, width2, conf2.useMaxWidth); diagram.append("line").attr("x1", LEFT_MARGIN).attr("y1", conf2.height * 4).attr("x2", width2 - LEFT_MARGIN - 4).attr("y2", conf2.height * 4).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)"); const extraVertForTitle = title2 ? 70 : 0; diagram.attr("viewBox", `${box.startx} -25 ${width2} ${height2 + extraVertForTitle}`); diagram.attr("preserveAspectRatio", "xMinYMin meet"); diagram.attr("height", height2 + extraVertForTitle + 25); addSVGAccessibilityFields(diagObj.db, diagram, id); }; const bounds = { data: { startx: void 0, stopx: void 0, starty: void 0, stopy: void 0 }, verticalPos: 0, sequenceItems: [], init: function() { this.sequenceItems = []; this.data = { startx: void 0, stopx: void 0, starty: void 0, stopy: void 0 }; this.verticalPos = 0; }, updateVal: function(obj, key, val, fun) { if (typeof obj[key] === "undefined") { obj[key] = val; } else { obj[key] = fun(val, obj[key]); } }, updateBounds: function(startx, starty, stopx, stopy) { const conf2 = getConfig$1().journey; const _self = this; let cnt2 = 0; function updateFn(type2) { return function updateItemBounds(item) { cnt2++; const n = _self.sequenceItems.length - cnt2 + 1; _self.updateVal(item, "starty", starty - n * conf2.boxMargin, Math.min); _self.updateVal(item, "stopy", stopy + n * conf2.boxMargin, Math.max); _self.updateVal(bounds.data, "startx", startx - n * conf2.boxMargin, Math.min); _self.updateVal(bounds.data, "stopx", stopx + n * conf2.boxMargin, Math.max); if (!(type2 === "activation")) { _self.updateVal(item, "startx", startx - n * conf2.boxMargin, Math.min); _self.updateVal(item, "stopx", stopx + n * conf2.boxMargin, Math.max); _self.updateVal(bounds.data, "starty", starty - n * conf2.boxMargin, Math.min); _self.updateVal(bounds.data, "stopy", stopy + n * conf2.boxMargin, Math.max); } }; } this.sequenceItems.forEach(updateFn()); }, insert: function(startx, starty, stopx, stopy) { const _startx = Math.min(startx, stopx); const _stopx = Math.max(startx, stopx); const _starty = Math.min(starty, stopy); const _stopy = Math.max(starty, stopy); this.updateVal(bounds.data, "startx", _startx, Math.min); this.updateVal(bounds.data, "starty", _starty, Math.min); this.updateVal(bounds.data, "stopx", _stopx, Math.max); this.updateVal(bounds.data, "stopy", _stopy, Math.max); this.updateBounds(_startx, _starty, _stopx, _stopy); }, bumpVerticalPos: function(bump) { this.verticalPos = this.verticalPos + bump; this.data.stopy = this.verticalPos; }, getVerticalPos: function() { return this.verticalPos; }, getBounds: function() { return this.data; } }; const fills = conf$1.sectionFills; const textColours = conf$1.sectionColours; const drawTasks = function(diagram, tasks2, verticalPos) { const conf2 = getConfig$1().journey; let lastSection = ""; const sectionVHeight = conf2.height * 2 + conf2.diagramMarginY; const taskPos = verticalPos + sectionVHeight; let sectionNumber = 0; let fill = "#CCC"; let colour = "black"; let num = 0; for (let i = 0; i < tasks2.length; i++) { const task = tasks2[i]; if (lastSection !== task.section) { fill = fills[sectionNumber % fills.length]; num = sectionNumber % fills.length; colour = textColours[sectionNumber % textColours.length]; const section = { x: i * conf2.taskMargin + i * conf2.width + LEFT_MARGIN, y: 50, text: task.section, fill, num, colour }; svgDraw.drawSection(diagram, section, conf2); lastSection = task.section; sectionNumber++; } const taskActors = task.people.reduce((acc, actorName) => { if (actors[actorName]) { acc[actorName] = actors[actorName]; } return acc; }, {}); task.x = i * conf2.taskMargin + i * conf2.width + LEFT_MARGIN; task.y = taskPos; task.width = conf2.diagramMarginX; task.height = conf2.diagramMarginY; task.colour = colour; task.fill = fill; task.num = num; task.actors = taskActors; svgDraw.drawTask(diagram, task, conf2); bounds.insert(task.x, task.y, task.x + task.width + conf2.taskMargin, 300 + 5 * 30); } }; const journeyRenderer = { setConf: setConf$1, draw: draw$1 }; let conf = {}; const setConf = function(cnf) { conf = { ...conf, ...cnf }; }; const draw = (text, id, mermaidVersion) => { try { log$1.debug("Renering svg for syntax error\n"); const svg = select("#" + id); const g = svg.append("g"); g.append("path").attr("class", "error-icon").attr( "d", "m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z" ); g.append("path").attr("class", "error-icon").attr( "d", "m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z" ); g.append("path").attr("class", "error-icon").attr( "d", "m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z" ); g.append("path").attr("class", "error-icon").attr( "d", "m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z" ); g.append("path").attr("class", "error-icon").attr( "d", "m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z" ); g.append("path").attr("class", "error-icon").attr( "d", "m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z" ); g.append("text").attr("class", "error-text").attr("x", 1440).attr("y", 250).attr("font-size", "150px").style("text-anchor", "middle").text("Syntax error in graph"); g.append("text").attr("class", "error-text").attr("x", 1250).attr("y", 400).attr("font-size", "100px").style("text-anchor", "middle").text("mermaid version " + mermaidVersion); svg.attr("height", 100); svg.attr("width", 500); svg.attr("viewBox", "768 0 912 512"); } catch (e) { log$1.error("Error while rendering info diagram"); log$1.error(getErrorMessage(e)); } }; const errorRenderer = { setConf, draw }; let hasLoadedDiagrams = false; const addDiagrams = () => { if (hasLoadedDiagrams) { return; } hasLoadedDiagrams = true; registerDiagram( "error", { db: { clear: () => { } }, styles: getStyles$b, renderer: errorRenderer, parser: { parser: { yy: {} }, parse: () => { } }, init: () => { } }, (text) => text.toLowerCase().trim() === "error" ); registerDiagram( "c4", { parser: parser$a, db: c4Db, renderer: c4Renderer, styles: getStyles$2, init: (cnf) => { c4Renderer.setConf(cnf.c4); } }, c4Detector ); registerDiagram( "class", { parser: parser$9, db: classDb, renderer: classRenderer, styles: getStyles$d, init: (cnf) => { if (!cnf.class) { cnf.class = {}; } cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; classDb.clear(); } }, classDetector ); registerDiagram( "classDiagram", { parser: parser$9, db: classDb, renderer: classRendererV2, styles: getStyles$d, init: (cnf) => { if (!cnf.class) { cnf.class = {}; } cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; classDb.clear(); } }, classDetectorV2 ); registerDiagram( "er", { parser: parser$8, db: erDb, renderer: erRenderer, styles: getStyles$c }, erDetector ); registerDiagram( "gantt", { parser: parser$6, db: ganttDb, renderer: ganttRenderer, styles: getStyles$9 }, ganttDetector ); registerDiagram( "info", { parser: parser$5, db: infoDb, renderer: infoRenderer, styles: getStyles$8 }, infoDetector ); registerDiagram( "pie", { parser: parser$4, db: pieDb, renderer: pieRenderer, styles: getStyles$7 }, pieDetector ); registerDiagram( "requirement", { parser: parser$3, db: requirementDb, renderer: requirementRenderer, styles: getStyles$6 }, requirementDetector ); registerDiagram( "sequence", { parser: parser$2, db: sequenceDb, renderer: sequenceRenderer, styles: getStyles$5, init: (cnf) => { if (!cnf.sequence) { cnf.sequence = {}; } cnf.sequence.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; if ("sequenceDiagram" in cnf) { throw new Error( "`mermaid config.sequenceDiagram` has been renamed to `config.sequence`. Please update your mermaid config." ); } sequenceDb.setWrap(cnf.wrap); sequenceRenderer.setConf(cnf.sequence); } }, sequenceDetector ); registerDiagram( "state", { parser: parser$1, db: stateDb, renderer: stateRenderer, styles: getStyles$4, init: (cnf) => { if (!cnf.state) { cnf.state = {}; } cnf.state.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; stateDb.clear(); } }, stateDetector ); registerDiagram( "stateDiagram", { parser: parser$1, db: stateDb, renderer: stateRendererV2, styles: getStyles$4, init: (cnf) => { if (!cnf.state) { cnf.state = {}; } cnf.state.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; stateDb.clear(); } }, stateDetectorV2 ); registerDiagram( "journey", { parser, db: journeyDb, renderer: journeyRenderer, styles: getStyles$3, init: (cnf) => { journeyRenderer.setConf(cnf.journey); journeyDb.clear(); } }, journeyDetector ); registerDiagram( "flowchart", { parser: parser$7, db: flowDb, renderer: flowRendererV2, styles: getStyles$a, init: (cnf) => { if (!cnf.flowchart) { cnf.flowchart = {}; } cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; flowRenderer.setConf(cnf.flowchart); flowDb.clear(); flowDb.setGen("gen-1"); } }, flowDetector ); registerDiagram( "flowchart-v2", { parser: parser$7, db: flowDb, renderer: flowRendererV2, styles: getStyles$a, init: (cnf) => { if (!cnf.flowchart) { cnf.flowchart = {}; } cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; setConfig({ flowchart: { arrowMarkerAbsolute: cnf.arrowMarkerAbsolute } }); flowRendererV2.setConf(cnf.flowchart); flowDb.clear(); flowDb.setGen("gen-2"); } }, flowDetectorV2 ); registerDiagram( "gitGraph", { parser: parser$b, db: gitGraphDb, renderer: gitGraphRenderer, styles: getStyles }, gitGraphDetector ); }; class Diagram { constructor(txt, parseError) { __publicField(this, "type", "graph"); __publicField(this, "parser"); __publicField(this, "renderer"); __publicField(this, "db"); __publicField(this, "detectTypeFailed", false); var _a, _b; this.txt = txt; const cnf = getConfig$1(); this.txt = txt; try { this.type = detectType(txt, cnf); } catch (e) { this.handleError(e, parseError); this.type = "error"; this.detectTypeFailed = true; } const diagram = getDiagram(this.type); log$1.debug("Type " + this.type); this.db = diagram.db; (_b = (_a = this.db).clear) == null ? void 0 : _b.call(_a); this.renderer = diagram.renderer; this.parser = diagram.parser; this.parser.parser.yy = this.db; if (diagram.init) { diagram.init(cnf); log$1.debug("Initialized diagram " + this.type, cnf); } this.txt += "\n"; this.parse(this.txt, parseError); } parse(text, parseError) { if (this.detectTypeFailed) { return false; } try { text = text + "\n"; this.db.clear(); this.parser.parse(text); return true; } catch (error) { this.handleError(error, parseError); } return false; } handleError(error, parseError) { if (parseError) { if (isDetailedError(error)) { parseError(error.str, error.hash); } else { parseError(error); } } else { throw error; } } getParser() { return this.parser; } getType() { return this.type; } } const getDiagramFromText = (txt, parseError) => { const type2 = detectType(txt, getConfig$1()); try { getDiagram(type2); return new Diagram(txt, parseError); } catch (error) { if (!(error instanceof DiagramNotFoundError)) { log$1.error(error); throw error; } const loader = getDiagramLoader(type2); if (!loader) { throw new Error(`Loader for ${type2} not found.`); } return loader().then(({ diagram }) => { registerDiagram(type2, diagram, void 0, diagram.injectUtils); return new Diagram(txt, parseError); }); } }; function parse$1(text, parseError) { addDiagrams(); const diagram = new Diagram(text, parseError); return diagram.parse(text, parseError); } async function parseAsync$1(text, parseError) { addDiagrams(); const diagram = await getDiagramFromText(text, parseError); return diagram.parse(text, parseError); } const encodeEntities = function(text) { let txt = text; txt = txt.replace(/style.*:\S*#.*;/g, function(s) { const innerTxt = s.substring(0, s.length - 1); return innerTxt; }); txt = txt.replace(/classDef.*:\S*#.*;/g, function(s) { const innerTxt = s.substring(0, s.length - 1); return innerTxt; }); txt = txt.replace(/#\w+;/g, function(s) { const innerTxt = s.substring(1, s.length - 1); const isInt = /^\+?\d+$/.test(innerTxt); if (isInt) { return "\uFB02\xB0\xB0" + innerTxt + "\xB6\xDF"; } else { return "\uFB02\xB0" + innerTxt + "\xB6\xDF"; } }); return txt; }; const decodeEntities = function(text) { let txt = text; txt = txt.replace(/fl°°/g, function() { return "&#"; }); txt = txt.replace(/fl°/g, function() { return "&"; }); txt = txt.replace(/¶ß/g, function() { return ";"; }); return txt; }; const render = function(id, text, cb, container) { var _a; addDiagrams(); reset(); text = text.replace(/\r\n?/g, "\n"); const graphInit = utils.detectInit(text); if (graphInit) { directiveSanitizer(graphInit); addDirective(graphInit); } const cnf = getConfig$1(); log$1.debug(cnf); if (text.length > cnf.maxTextSize) { text = "graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa"; } let root2 = select("body"); if (typeof container !== "undefined") { if (container) { container.innerHTML = ""; } if (cnf.securityLevel === "sandbox") { const iframe = select(container).append("iframe").attr("id", "i" + id).attr("style", "width: 100%; height: 100%;").attr("sandbox", ""); root2 = select(iframe.nodes()[0].contentDocument.body); root2.node().style.margin = 0; } else { root2 = select(container); } root2.append("div").attr("id", "d" + id).attr("style", "font-family: " + cnf.fontFamily).append("svg").attr("id", id).attr("width", "100%").attr("xmlns", "http://www.w3.org/2000/svg").attr("xmlns:xlink", "http://www.w3.org/1999/xlink").append("g"); } else { const existingSvg = document.getElementById(id); if (existingSvg) { existingSvg.remove(); } let element2; if (cnf.securityLevel === "sandbox") { element2 = document.querySelector("#i" + id); } else { element2 = document.querySelector("#d" + id); } if (element2) { element2.remove(); } if (cnf.securityLevel === "sandbox") { const iframe = select("body").append("iframe").attr("id", "i" + id).attr("style", "width: 100%; height: 100%;").attr("sandbox", ""); root2 = select(iframe.nodes()[0].contentDocument.body); root2.node().style.margin = 0; } else { root2 = select("body"); } root2.append("div").attr("id", "d" + id).append("svg").attr("id", id).attr("width", "100%").attr("xmlns", "http://www.w3.org/2000/svg").append("g"); } text = encodeEntities(text); let diag; let parseEncounteredException; try { diag = getDiagramFromText(text); if ("then" in diag) { throw new Error("Diagram is a promise"); } } catch (error) { diag = new Diagram("error"); parseEncounteredException = error; } const element = root2.select("#d" + id).node(); const graphType = diag.type; const svg = element.firstChild; const firstChild = svg.firstChild; let userStyles = ""; if (cnf.themeCSS !== void 0) { userStyles += ` ${cnf.themeCSS}`; } if (cnf.fontFamily !== void 0) { userStyles += ` :root { --mermaid-font-family: ${cnf.fontFamily}}`; } if (cnf.altFontFamily !== void 0) { userStyles += ` :root { --mermaid-alt-font-family: ${cnf.altFontFamily}}`; } if (graphType === "flowchart" || graphType === "flowchart-v2" || graphType === "graph") { const classes2 = flowRenderer.getClasses(text, diag); const htmlLabels = cnf.htmlLabels || ((_a = cnf.flowchart) == null ? void 0 : _a.htmlLabels); for (const className in classes2) { if (htmlLabels) { userStyles += ` .${className} > * { ${classes2[className].styles.join( " !important; " )} !important; }`; userStyles += ` .${className} span { ${classes2[className].styles.join( " !important; " )} !important; }`; } else { userStyles += ` .${className} path { ${classes2[className].styles.join( " !important; " )} !important; }`; userStyles += ` .${className} rect { ${classes2[className].styles.join( " !important; " )} !important; }`; userStyles += ` .${className} polygon { ${classes2[className].styles.join( " !important; " )} !important; }`; userStyles += ` .${className} ellipse { ${classes2[className].styles.join( " !important; " )} !important; }`; userStyles += ` .${className} circle { ${classes2[className].styles.join( " !important; " )} !important; }`; if (classes2[className].textStyles) { userStyles += ` .${className} tspan { ${classes2[className].textStyles.join( " !important; " )} !important; }`; } } } } const stylis = (selector, styles) => serialize(compile(`${selector}{${styles}}`), stringify); const rules = stylis(`#${id}`, getStyles$1(graphType, userStyles, cnf.themeVariables)); const style1 = document.createElement("style"); style1.innerHTML = `#${id} ` + rules; svg.insertBefore(style1, firstChild); try { diag.renderer.draw(text, id, pkg.version, diag); } catch (e) { errorRenderer.draw(text, id, pkg.version); throw e; } root2.select(`[id="${id}"]`).selectAll("foreignobject > *").attr("xmlns", "http://www.w3.org/1999/xhtml"); let svgCode = root2.select("#d" + id).node().innerHTML; log$1.debug("cnf.arrowMarkerAbsolute", cnf.arrowMarkerAbsolute); if (!evaluate(cnf.arrowMarkerAbsolute) && cnf.securityLevel !== "sandbox") { svgCode = svgCode.replace(/marker-end="url\(.*?#/g, 'marker-end="url(#', "g"); } svgCode = decodeEntities(svgCode); svgCode = svgCode.replace(/
/g, "
"); if (cnf.securityLevel === "sandbox") { const svgEl = root2.select("#d" + id + " svg").node(); const width2 = "100%"; let height2 = "100%"; if (svgEl) { height2 = svgEl.viewBox.baseVal.height + "px"; } svgCode = ``; } else { if (cnf.securityLevel !== "loose") { svgCode = DOMPurify.sanitize(svgCode, { ADD_TAGS: ["foreignobject"], ADD_ATTR: ["dominant-baseline"] }); } } if (typeof cb !== "undefined") { switch (graphType) { case "flowchart": case "flowchart-v2": cb(svgCode, flowDb.bindFunctions); break; case "gantt": cb(svgCode, ganttDb.bindFunctions); break; case "class": case "classDiagram": cb(svgCode, classDb.bindFunctions); break; default: cb(svgCode); } } else { log$1.debug("CB = undefined!"); } attachFunctions(); const tmpElementSelector = cnf.securityLevel === "sandbox" ? "#i" + id : "#d" + id; const node = select(tmpElementSelector).node(); if (node && "remove" in node) { node.remove(); } if (parseEncounteredException) { throw parseEncounteredException; } return svgCode; }; const renderAsync$1 = async function(id, text, cb, container) { var _a; addDiagrams(); reset(); text = text.replace(/\r\n?/g, "\n"); const graphInit = utils.detectInit(text); if (graphInit) { directiveSanitizer(graphInit); addDirective(graphInit); } const cnf = getConfig$1(); log$1.debug(cnf); if (text.length > cnf.maxTextSize) { text = "graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa"; } let root2 = select("body"); if (typeof container !== "undefined") { if (container) { container.innerHTML = ""; } if (cnf.securityLevel === "sandbox") { const iframe = select(container).append("iframe").attr("id", "i" + id).attr("style", "width: 100%; height: 100%;").attr("sandbox", ""); root2 = select(iframe.nodes()[0].contentDocument.body); root2.node().style.margin = 0; } else { root2 = select(container); } root2.append("div").attr("id", "d" + id).attr("style", "font-family: " + cnf.fontFamily).append("svg").attr("id", id).attr("width", "100%").attr("xmlns", "http://www.w3.org/2000/svg").attr("xmlns:xlink", "http://www.w3.org/1999/xlink").append("g"); } else { const existingSvg = document.getElementById(id); if (existingSvg) { existingSvg.remove(); } let element2; if (cnf.securityLevel === "sandbox") { element2 = document.querySelector("#i" + id); } else { element2 = document.querySelector("#d" + id); } if (element2) { element2.remove(); } if (cnf.securityLevel === "sandbox") { const iframe = select("body").append("iframe").attr("id", "i" + id).attr("style", "width: 100%; height: 100%;").attr("sandbox", ""); root2 = select(iframe.nodes()[0].contentDocument.body); root2.node().style.margin = 0; } else { root2 = select("body"); } root2.append("div").attr("id", "d" + id).append("svg").attr("id", id).attr("width", "100%").attr("xmlns", "http://www.w3.org/2000/svg").append("g"); } text = encodeEntities(text); let diag; let parseEncounteredException; try { diag = await getDiagramFromText(text); } catch (error) { diag = new Diagram("error"); parseEncounteredException = error; } const element = root2.select("#d" + id).node(); const graphType = diag.type; const svg = element.firstChild; const firstChild = svg.firstChild; let userStyles = ""; if (cnf.themeCSS !== void 0) { userStyles += ` ${cnf.themeCSS}`; } if (cnf.fontFamily !== void 0) { userStyles += ` :root { --mermaid-font-family: ${cnf.fontFamily}}`; } if (cnf.altFontFamily !== void 0) { userStyles += ` :root { --mermaid-alt-font-family: ${cnf.altFontFamily}}`; } if (graphType === "flowchart" || graphType === "flowchart-v2" || graphType === "graph") { const classes2 = flowRenderer.getClasses(text, diag); const htmlLabels = cnf.htmlLabels || ((_a = cnf.flowchart) == null ? void 0 : _a.htmlLabels); for (const className in classes2) { if (htmlLabels) { userStyles += ` .${className} > * { ${classes2[className].styles.join( " !important; " )} !important; }`; userStyles += ` .${className} span { ${classes2[className].styles.join( " !important; " )} !important; }`; } else { userStyles += ` .${className} path { ${classes2[className].styles.join( " !important; " )} !important; }`; userStyles += ` .${className} rect { ${classes2[className].styles.join( " !important; " )} !important; }`; userStyles += ` .${className} polygon { ${classes2[className].styles.join( " !important; " )} !important; }`; userStyles += ` .${className} ellipse { ${classes2[className].styles.join( " !important; " )} !important; }`; userStyles += ` .${className} circle { ${classes2[className].styles.join( " !important; " )} !important; }`; if (classes2[className].textStyles) { userStyles += ` .${className} tspan { ${classes2[className].textStyles.join( " !important; " )} !important; }`; } } } } const stylis = (selector, styles) => serialize(compile(`${selector}{${styles}}`), stringify); const rules = stylis(`#${id}`, getStyles$1(graphType, userStyles, cnf.themeVariables)); const style1 = document.createElement("style"); style1.innerHTML = `#${id} ` + rules; svg.insertBefore(style1, firstChild); try { await diag.renderer.draw(text, id, pkg.version, diag); } catch (e) { errorRenderer.draw(text, id, pkg.version); throw e; } root2.select(`[id="${id}"]`).selectAll("foreignobject > *").attr("xmlns", "http://www.w3.org/1999/xhtml"); let svgCode = root2.select("#d" + id).node().innerHTML; log$1.debug("cnf.arrowMarkerAbsolute", cnf.arrowMarkerAbsolute); if (!evaluate(cnf.arrowMarkerAbsolute) && cnf.securityLevel !== "sandbox") { svgCode = svgCode.replace(/marker-end="url\(.*?#/g, 'marker-end="url(#', "g"); } svgCode = decodeEntities(svgCode); svgCode = svgCode.replace(/
/g, "
"); if (cnf.securityLevel === "sandbox") { const svgEl = root2.select("#d" + id + " svg").node(); const width2 = "100%"; let height2 = "100%"; if (svgEl) { height2 = svgEl.viewBox.baseVal.height + "px"; } svgCode = ``; } else { if (cnf.securityLevel !== "loose") { svgCode = DOMPurify.sanitize(svgCode, { ADD_TAGS: ["foreignobject"], ADD_ATTR: ["dominant-baseline"] }); } } if (typeof cb !== "undefined") { switch (graphType) { case "flowchart": case "flowchart-v2": cb(svgCode, flowDb.bindFunctions); break; case "gantt": cb(svgCode, ganttDb.bindFunctions); break; case "class": case "classDiagram": cb(svgCode, classDb.bindFunctions); break; default: cb(svgCode); } } else { log$1.debug("CB = undefined!"); } attachFunctions(); const tmpElementSelector = cnf.securityLevel === "sandbox" ? "#i" + id : "#d" + id; const node = select(tmpElementSelector).node(); if (node && "remove" in node) { node.remove(); } if (parseEncounteredException) { throw parseEncounteredException; } return svgCode; }; let currentDirective = {}; const parseDirective = function(p, statement, context, type2) { try { if (statement !== void 0) { statement = statement.trim(); switch (context) { case "open_directive": currentDirective = {}; break; case "type_directive": if (!currentDirective) throw new Error("currentDirective is undefined"); currentDirective.type = statement.toLowerCase(); break; case "arg_directive": if (!currentDirective) throw new Error("currentDirective is undefined"); currentDirective.args = JSON.parse(statement); break; case "close_directive": handleDirective(p, currentDirective, type2); currentDirective = void 0; break; } } } catch (error) { log$1.error( `Error while rendering sequenceDiagram directive: ${statement} jison context: ${context}` ); log$1.error(error.message); } }; const handleDirective = function(p, directive2, type2) { log$1.debug(`Directive type=${directive2.type} with args:`, directive2.args); switch (directive2.type) { case "init": case "initialize": { ["config"].forEach((prop) => { if (typeof directive2.args[prop] !== "undefined") { if (type2 === "flowchart-v2") { type2 = "flowchart"; } directive2.args[type2] = directive2.args[prop]; delete directive2.args[prop]; } }); log$1.debug("sanitize in handleDirective", directive2.args); directiveSanitizer(directive2.args); log$1.debug("sanitize in handleDirective (done)", directive2.args); addDirective(directive2.args); break; } case "wrap": case "nowrap": if (p && p["setWrap"]) { p.setWrap(directive2.type === "wrap"); } break; case "themeCss": log$1.warn("themeCss encountered"); break; default: log$1.warn( `Unhandled directive: source: '%%{${directive2.type}: ${JSON.stringify( directive2.args ? directive2.args : {} )}}%%`, directive2 ); break; } }; function initialize$1(options2 = {}) { if (options2.fontFamily) { if (!options2.themeVariables) { options2.themeVariables = {}; } options2.themeVariables.fontFamily = options2.fontFamily; } saveConfigFromInitialize(options2); if ((options2 == null ? void 0 : options2.theme) && options2.theme in theme) { options2.themeVariables = theme[options2.theme].getThemeVariables( options2.themeVariables ); } else if (options2) { options2.themeVariables = theme.default.getThemeVariables(options2.themeVariables); } const config2 = typeof options2 === "object" ? setSiteConfig(options2) : getSiteConfig(); setLogLevel$1(config2.logLevel); addDiagrams(); } const mermaidAPI = Object.freeze({ render, renderAsync: renderAsync$1, parse: parse$1, parseAsync: parseAsync$1, parseDirective, initialize: initialize$1, getConfig: getConfig$1, setConfig, getSiteConfig, updateSiteConfig, reset: () => { reset(); }, globalReset: () => { reset(defaultConfig); }, defaultConfig }); setLogLevel$1(getConfig$1().logLevel); reset(getConfig$1()); const init = async function(config2, nodes, callback) { try { await initThrowsErrors(config2, nodes, callback); } catch (e) { log$1.warn("Syntax Error rendering"); if (isDetailedError(e)) { log$1.warn(e.str); } if (mermaid.parseError) { mermaid.parseError(e); } } }; const handleError = (error, errors, parseError) => { log$1.warn(error); if (isDetailedError(error)) { if (parseError) { parseError(error.str, error.hash); } errors.push({ ...error, message: error.str, error }); } else { if (parseError) { parseError(error); } if (error instanceof Error) { errors.push({ str: error.message, message: error.message, hash: error.name, error }); } } }; const initThrowsErrors = async function(config2, nodes, callback) { const conf2 = mermaidAPI.getConfig(); if (config2) { mermaid.sequenceConfig = config2; } const errors = []; if ((conf2 == null ? void 0 : conf2.lazyLoadedDiagrams) && conf2.lazyLoadedDiagrams.length > 0) { const results = await Promise.allSettled( conf2.lazyLoadedDiagrams.map(async (diagram) => { const { id, detector, loadDiagram } = await import(diagram); addDetector(id, detector, loadDiagram); }) ); for (const result of results) { if (result.status == "rejected") { log$1.warn(`Failed to lazyLoadedDiagram due to `, result.reason); errors.push(result.reason); } } } log$1.debug(`${!callback ? "No " : ""}Callback function found`); let nodesToProcess; if (typeof nodes === "undefined") { nodesToProcess = document.querySelectorAll(".mermaid"); } else if (typeof nodes === "string") { nodesToProcess = document.querySelectorAll(nodes); } else if (nodes instanceof HTMLElement) { nodesToProcess = [nodes]; } else if (nodes instanceof NodeList) { nodesToProcess = nodes; } else { throw new Error("Invalid argument nodes for mermaid.init"); } log$1.debug(`Found ${nodesToProcess.length} diagrams`); if (typeof (config2 == null ? void 0 : config2.startOnLoad) !== "undefined") { log$1.debug("Start On Load: " + (config2 == null ? void 0 : config2.startOnLoad)); mermaidAPI.updateSiteConfig({ startOnLoad: config2 == null ? void 0 : config2.startOnLoad }); } const idGenerator = new utils.initIdGenerator(conf2.deterministicIds, conf2.deterministicIDSeed); let txt; for (const element of Array.from(nodesToProcess)) { log$1.info("Rendering diagram: " + element.id); /*! Check if previously processed */ if (element.getAttribute("data-processed")) { continue; } element.setAttribute("data-processed", "true"); const id = `mermaid-${idGenerator.next()}`; txt = element.innerHTML; txt = utils.entityDecode(txt).trim().replace(//gi, "
"); const init2 = utils.detectInit(txt); if (init2) { log$1.debug("Detected early reinit: ", init2); } try { mermaidAPI.render( id, txt, (svgCode, bindFunctions2) => { element.innerHTML = svgCode; if (typeof callback !== "undefined") { callback(id); } if (bindFunctions2) bindFunctions2(element); }, element ); } catch (error) { handleError(error, errors, mermaid.parseError); } } if (errors.length > 0) { throw errors[0]; } }; let lazyLoadingPromise = void 0; const registerLazyLoadedDiagrams = async (conf2) => { var _a; if (lazyLoadingPromise === void 0) { lazyLoadingPromise = Promise.allSettled( ((_a = conf2 == null ? void 0 : conf2.lazyLoadedDiagrams) != null ? _a : []).map(async (diagram) => { const { id, detector, loadDiagram } = await import(diagram); addDetector(id, detector, loadDiagram); }) ); } await lazyLoadingPromise; }; let loadingPromise = void 0; const loadExternalDiagrams = async (conf2) => { var _a, _b; if (loadingPromise === void 0) { log$1.debug(`Loading ${(_a = conf2 == null ? void 0 : conf2.lazyLoadedDiagrams) == null ? void 0 : _a.length} external diagrams`); loadingPromise = Promise.allSettled( ((_b = conf2 == null ? void 0 : conf2.lazyLoadedDiagrams) != null ? _b : []).map(async (url) => { const { id, detector, loadDiagram } = await import(url); const { diagram } = await loadDiagram(); registerDiagram(id, diagram, detector, diagram.injectUtils); }) ); } await loadingPromise; }; const initialize = function(config2) { mermaidAPI.initialize(config2); }; const initializeAsync = async function(config2) { if (config2.loadExternalDiagramsAtStartup) { await loadExternalDiagrams(config2); } else { await registerLazyLoadedDiagrams(config2); } mermaidAPI.initialize(config2); }; const contentLoaded = function() { if (mermaid.startOnLoad) { const { startOnLoad } = mermaidAPI.getConfig(); if (startOnLoad) { mermaid.init(); } } }; if (typeof document !== "undefined") { /*! * Wait for document loaded before starting the execution */ window.addEventListener("load", contentLoaded, false); } const setParseErrorHandler = function(newParseErrorHandler) { mermaid.parseError = newParseErrorHandler; }; const parse = (txt) => { return mermaidAPI.parse(txt, mermaid.parseError); }; const executionQueue = []; let executionQueueRunning = false; const executeQueue = async () => { if (executionQueueRunning) { return; } executionQueueRunning = true; while (executionQueue.length > 0) { const f = executionQueue.shift(); if (f) { try { await f(); } catch (e) { log$1.error("Error executing queue", e); } } } executionQueueRunning = false; }; const parseAsync = (txt) => { return new Promise((resolve, reject) => { const performCall = () => new Promise((res, rej) => { mermaidAPI.parseAsync(txt, mermaid.parseError).then( (r) => { res(r); resolve(r); }, (e) => { log$1.error("Error parsing", e); rej(e); reject(e); } ); }); executionQueue.push(performCall); executeQueue(); }); }; const renderAsync = (id, text, cb, container) => { return new Promise((resolve, reject) => { const performCall = () => new Promise((res, rej) => { mermaidAPI.renderAsync(id, text, cb, container).then( (r) => { res(r); resolve(r); }, (e) => { log$1.error("Error parsing", e); rej(e); reject(e); } ); }); executionQueue.push(performCall); executeQueue(); }); }; const mermaid = { startOnLoad: true, diagrams: {}, mermaidAPI, parse, parseAsync, render: mermaidAPI.render, renderAsync, init, initThrowsErrors, initialize, initializeAsync, parseError: void 0, contentLoaded, setParseErrorHandler }; export { mermaid as default }; //# sourceMappingURL=mermaid.core.mjs.map