import { _ as basis_default, a as monotoneX, i as natural_default, n as stepBefore, o as monotoneY, p as cardinal_default, r as step_default, t as stepAfter, u as catmullRom_default, v as linear_default } from "./step-CWipAYTY.js";
import { t as line_default } from "./line-C5s_12ee.js";
import { g as utils_default, v as bumpX, y as bumpY } from "./chunk-S3R3BYOJ-mQeCz5CE.js";
import { i as log, r as __name, t as select_default } from "./src-Bf2iLOlr.js";
import { b as getConfig2, h as evaluate } from "./chunk-ABZYJK2D-D0cLy8Bb.js";
import { n as markerOffsets, r as markerOffsets2, t as getLineFunctionsWithOffset } from "./chunk-HN2XXSSU-E3n-Ys7Z.js";
import { t as getSubGraphTitleMargins } from "./chunk-CVBHYZKI-B_c5YBcW.js";
import { i as styles2String, n as isLabelStyle } from "./chunk-ATLVNIR6-BXsEjlHF.js";
import { n as createText } from "./chunk-JA3XYJ7Z-D6c6cOBG.js";
import { d as at, r as createLabel_default } from "./chunk-JZLCHNYA-BvsPHJmL.js";
var addEdgeMarkers = /* @__PURE__ */ __name((t, o, s, c, l, u) => {
  o.arrowTypeStart && addEdgeMarker(t, "start", o.arrowTypeStart, s, c, l, u), o.arrowTypeEnd && addEdgeMarker(t, "end", o.arrowTypeEnd, s, c, l, u);
}, "addEdgeMarkers"), arrowTypesMap = {
  arrow_cross: {
    type: "cross",
    fill: false
  },
  arrow_point: {
    type: "point",
    fill: true
  },
  arrow_barb: {
    type: "barb",
    fill: true
  },
  arrow_circle: {
    type: "circle",
    fill: false
  },
  aggregation: {
    type: "aggregation",
    fill: false
  },
  extension: {
    type: "extension",
    fill: false
  },
  composition: {
    type: "composition",
    fill: true
  },
  dependency: {
    type: "dependency",
    fill: true
  },
  lollipop: {
    type: "lollipop",
    fill: false
  },
  only_one: {
    type: "onlyOne",
    fill: false
  },
  zero_or_one: {
    type: "zeroOrOne",
    fill: false
  },
  one_or_more: {
    type: "oneOrMore",
    fill: false
  },
  zero_or_more: {
    type: "zeroOrMore",
    fill: false
  },
  requirement_arrow: {
    type: "requirement_arrow",
    fill: false
  },
  requirement_contains: {
    type: "requirement_contains",
    fill: false
  }
}, addEdgeMarker = /* @__PURE__ */ __name((t, o, s, c, l, u, d) => {
  var _a;
  let f = arrowTypesMap[s];
  if (!f) {
    log.warn(`Unknown arrow type: ${s}`);
    return;
  }
  let p = `${l}_${u}-${f.type}${o === "start" ? "Start" : "End"}`;
  if (d && d.trim() !== "") {
    let s2 = `${p}_${d.replace(/[^\dA-Za-z]/g, "_")}`;
    if (!document.getElementById(s2)) {
      let t2 = document.getElementById(p);
      if (t2) {
        let o2 = t2.cloneNode(true);
        o2.id = s2, o2.querySelectorAll("path, circle, line").forEach((t3) => {
          t3.setAttribute("stroke", d), f.fill && t3.setAttribute("fill", d);
        }), (_a = t2.parentNode) == null ? void 0 : _a.appendChild(o2);
      }
    }
    t.attr(`marker-${o}`, `url(${c}#${s2})`);
  } else t.attr(`marker-${o}`, `url(${c}#${p})`);
}, "addEdgeMarker"), edgeLabels = /* @__PURE__ */ new Map(), terminalLabels = /* @__PURE__ */ new Map(), clear = /* @__PURE__ */ __name(() => {
  edgeLabels.clear(), terminalLabels.clear();
}, "clear"), getLabelStyles = /* @__PURE__ */ __name((t) => t ? t.reduce((t2, o) => t2 + ";" + o, "") : "", "getLabelStyles"), insertEdgeLabel = /* @__PURE__ */ __name(async (t, o) => {
  let s = evaluate(getConfig2().flowchart.htmlLabels), { labelStyles: c } = styles2String(o);
  o.labelStyle = c;
  let l = await createText(t, o.label, {
    style: o.labelStyle,
    useHtmlLabels: s,
    addSvgBackground: true,
    isNode: false
  });
  log.info("abc82", o, o.labelType);
  let u = t.insert("g").attr("class", "edgeLabel"), d = u.insert("g").attr("class", "label").attr("data-id", o.id);
  d.node().appendChild(l);
  let f = l.getBBox();
  if (s) {
    let t2 = l.children[0], o2 = select_default(l);
    f = t2.getBoundingClientRect(), o2.attr("width", f.width), o2.attr("height", f.height);
  }
  d.attr("transform", "translate(" + -f.width / 2 + ", " + -f.height / 2 + ")"), edgeLabels.set(o.id, u), o.width = f.width, o.height = f.height;
  let p;
  if (o.startLabelLeft) {
    let s2 = await createLabel_default(o.startLabelLeft, getLabelStyles(o.labelStyle)), c2 = t.insert("g").attr("class", "edgeTerminals"), l2 = c2.insert("g").attr("class", "inner");
    p = l2.node().appendChild(s2);
    let u2 = s2.getBBox();
    l2.attr("transform", "translate(" + -u2.width / 2 + ", " + -u2.height / 2 + ")"), terminalLabels.get(o.id) || terminalLabels.set(o.id, {}), terminalLabels.get(o.id).startLeft = c2, setTerminalWidth(p, o.startLabelLeft);
  }
  if (o.startLabelRight) {
    let s2 = await createLabel_default(o.startLabelRight, getLabelStyles(o.labelStyle)), c2 = t.insert("g").attr("class", "edgeTerminals"), l2 = c2.insert("g").attr("class", "inner");
    p = c2.node().appendChild(s2), l2.node().appendChild(s2);
    let u2 = s2.getBBox();
    l2.attr("transform", "translate(" + -u2.width / 2 + ", " + -u2.height / 2 + ")"), terminalLabels.get(o.id) || terminalLabels.set(o.id, {}), terminalLabels.get(o.id).startRight = c2, setTerminalWidth(p, o.startLabelRight);
  }
  if (o.endLabelLeft) {
    let s2 = await createLabel_default(o.endLabelLeft, getLabelStyles(o.labelStyle)), c2 = t.insert("g").attr("class", "edgeTerminals"), l2 = c2.insert("g").attr("class", "inner");
    p = l2.node().appendChild(s2);
    let u2 = s2.getBBox();
    l2.attr("transform", "translate(" + -u2.width / 2 + ", " + -u2.height / 2 + ")"), c2.node().appendChild(s2), terminalLabels.get(o.id) || terminalLabels.set(o.id, {}), terminalLabels.get(o.id).endLeft = c2, setTerminalWidth(p, o.endLabelLeft);
  }
  if (o.endLabelRight) {
    let s2 = await createLabel_default(o.endLabelRight, getLabelStyles(o.labelStyle)), c2 = t.insert("g").attr("class", "edgeTerminals"), l2 = c2.insert("g").attr("class", "inner");
    p = l2.node().appendChild(s2);
    let u2 = s2.getBBox();
    l2.attr("transform", "translate(" + -u2.width / 2 + ", " + -u2.height / 2 + ")"), c2.node().appendChild(s2), terminalLabels.get(o.id) || terminalLabels.set(o.id, {}), terminalLabels.get(o.id).endRight = c2, setTerminalWidth(p, o.endLabelRight);
  }
  return l;
}, "insertEdgeLabel");
function setTerminalWidth(t, o) {
  getConfig2().flowchart.htmlLabels && t && (t.style.width = o.length * 9 + "px", t.style.height = "12px");
}
__name(setTerminalWidth, "setTerminalWidth");
var positionEdgeLabel = /* @__PURE__ */ __name((t, o) => {
  log.debug("Moving label abc88 ", t.id, t.label, edgeLabels.get(t.id), o);
  let s = o.updatedPath ? o.updatedPath : o.originalPath, { subGraphTitleTotalMargin: c } = getSubGraphTitleMargins(getConfig2());
  if (t.label) {
    let l = edgeLabels.get(t.id), u = t.x, d = t.y;
    if (s) {
      let c2 = utils_default.calcLabelPosition(s);
      log.debug("Moving label " + t.label + " from (", u, ",", d, ") to (", c2.x, ",", c2.y, ") abc88"), o.updatedPath && (u = c2.x, d = c2.y);
    }
    l.attr("transform", `translate(${u}, ${d + c / 2})`);
  }
  if (t.startLabelLeft) {
    let o2 = terminalLabels.get(t.id).startLeft, c2 = t.x, l = t.y;
    if (s) {
      let o3 = utils_default.calcTerminalLabelPosition(t.arrowTypeStart ? 10 : 0, "start_left", s);
      c2 = o3.x, l = o3.y;
    }
    o2.attr("transform", `translate(${c2}, ${l})`);
  }
  if (t.startLabelRight) {
    let o2 = terminalLabels.get(t.id).startRight, c2 = t.x, l = t.y;
    if (s) {
      let o3 = utils_default.calcTerminalLabelPosition(t.arrowTypeStart ? 10 : 0, "start_right", s);
      c2 = o3.x, l = o3.y;
    }
    o2.attr("transform", `translate(${c2}, ${l})`);
  }
  if (t.endLabelLeft) {
    let o2 = terminalLabels.get(t.id).endLeft, c2 = t.x, l = t.y;
    if (s) {
      let o3 = utils_default.calcTerminalLabelPosition(t.arrowTypeEnd ? 10 : 0, "end_left", s);
      c2 = o3.x, l = o3.y;
    }
    o2.attr("transform", `translate(${c2}, ${l})`);
  }
  if (t.endLabelRight) {
    let o2 = terminalLabels.get(t.id).endRight, c2 = t.x, l = t.y;
    if (s) {
      let o3 = utils_default.calcTerminalLabelPosition(t.arrowTypeEnd ? 10 : 0, "end_right", s);
      c2 = o3.x, l = o3.y;
    }
    o2.attr("transform", `translate(${c2}, ${l})`);
  }
}, "positionEdgeLabel"), outsideNode = /* @__PURE__ */ __name((t, o) => {
  let s = t.x, c = t.y, l = Math.abs(o.x - s), u = Math.abs(o.y - c), d = t.width / 2, f = t.height / 2;
  return l >= d || u >= f;
}, "outsideNode"), intersection = /* @__PURE__ */ __name((t, o, s) => {
  log.debug(`intersection calc abc89:
  outsidePoint: ${JSON.stringify(o)}
  insidePoint : ${JSON.stringify(s)}
  node        : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);
  let c = t.x, l = t.y, u = Math.abs(c - s.x), d = t.width / 2, f = s.x < o.x ? d - u : d + u, p = t.height / 2, m = Math.abs(o.y - s.y), h = Math.abs(o.x - s.x);
  if (Math.abs(l - o.y) * d > Math.abs(c - o.x) * p) {
    let t2 = s.y < o.y ? o.y - p - l : l - p - o.y;
    f = h * t2 / m;
    let c2 = {
      x: s.x < o.x ? s.x + f : s.x - h + f,
      y: s.y < o.y ? s.y + m - t2 : s.y - m + t2
    };
    return f === 0 && (c2.x = o.x, c2.y = o.y), h === 0 && (c2.x = o.x), m === 0 && (c2.y = o.y), log.debug(`abc89 top/bottom calc, Q ${m}, q ${t2}, R ${h}, r ${f}`, c2), c2;
  } else {
    f = s.x < o.x ? o.x - d - c : c - d - o.x;
    let t2 = m * f / h, l2 = s.x < o.x ? s.x + h - f : s.x - h + f, u2 = s.y < o.y ? s.y + t2 : s.y - t2;
    return log.debug(`sides calc abc89, Q ${m}, q ${t2}, R ${h}, r ${f}`, {
      _x: l2,
      _y: u2
    }), f === 0 && (l2 = o.x, u2 = o.y), h === 0 && (l2 = o.x), m === 0 && (u2 = o.y), {
      x: l2,
      y: u2
    };
  }
}, "intersection"), cutPathAtIntersect = /* @__PURE__ */ __name((t, o) => {
  log.warn("abc88 cutPathAtIntersect", t, o);
  let s = [], c = t[0], l = false;
  return t.forEach((t2) => {
    if (log.info("abc88 checking point", t2, o), !outsideNode(o, t2) && !l) {
      let u = intersection(o, c, t2);
      log.debug("abc88 inside", t2, c, u), log.debug("abc88 intersection", u, o);
      let d = false;
      s.forEach((t3) => {
        d || (d = t3.x === u.x && t3.y === u.y);
      }), s.some((t3) => t3.x === u.x && t3.y === u.y) ? log.warn("abc88 no intersect", u, s) : s.push(u), l = true;
    } else log.warn("abc88 outside", t2, c), c = t2, l || s.push(t2);
  }), log.debug("returning points", s), s;
}, "cutPathAtIntersect");
function extractCornerPoints(t) {
  let o = [], s = [];
  for (let c = 1; c < t.length - 1; c++) {
    let l = t[c - 1], u = t[c], d = t[c + 1];
    (l.x === u.x && u.y === d.y && Math.abs(u.x - d.x) > 5 && Math.abs(u.y - l.y) > 5 || l.y === u.y && u.x === d.x && Math.abs(u.x - l.x) > 5 && Math.abs(u.y - d.y) > 5) && (o.push(u), s.push(c));
  }
  return {
    cornerPoints: o,
    cornerPointPositions: s
  };
}
__name(extractCornerPoints, "extractCornerPoints");
var findAdjacentPoint = /* @__PURE__ */ __name(function(t, o, s) {
  let c = o.x - t.x, l = o.y - t.y, u = s / Math.sqrt(c * c + l * l);
  return {
    x: o.x - u * c,
    y: o.y - u * l
  };
}, "findAdjacentPoint"), fixCorners = /* @__PURE__ */ __name(function(t) {
  let { cornerPointPositions: o } = extractCornerPoints(t), s = [];
  for (let c = 0; c < t.length; c++) if (o.includes(c)) {
    let o2 = t[c - 1], l = t[c + 1], u = t[c], d = findAdjacentPoint(o2, u, 5), f = findAdjacentPoint(l, u, 5), p = f.x - d.x, m = f.y - d.y;
    s.push(d);
    let h = Math.sqrt(2) * 2, g = {
      x: u.x,
      y: u.y
    };
    Math.abs(l.x - o2.x) > 10 && Math.abs(l.y - o2.y) >= 10 ? (log.debug("Corner point fixing", Math.abs(l.x - o2.x), Math.abs(l.y - o2.y)), g = u.x === d.x ? {
      x: p < 0 ? d.x - 5 + h : d.x + 5 - h,
      y: m < 0 ? d.y - h : d.y + h
    } : {
      x: p < 0 ? d.x - h : d.x + h,
      y: m < 0 ? d.y - 5 + h : d.y + 5 - h
    }) : log.debug("Corner point skipping fixing", Math.abs(l.x - o2.x), Math.abs(l.y - o2.y)), s.push(g, f);
  } else s.push(t[c]);
  return s;
}, "fixCorners"), generateDashArray = /* @__PURE__ */ __name((t, o, s) => {
  let c = t - o - s, l = Math.floor(c / 4);
  return `0 ${o} ${Array(l).fill("2 2").join(" ")} ${s}`;
}, "generateDashArray"), insertEdge = /* @__PURE__ */ __name(function(b, C, w, D, O, k, A, j = false) {
  var _a;
  let { handDrawnSeed: M } = getConfig2(), N = C.points, P = false, F = O;
  var I = k;
  let L = [];
  for (let t in C.cssCompiledStyles) isLabelStyle(t) || L.push(C.cssCompiledStyles[t]);
  log.debug("UIO intersect check", C.points, I.x, F.x), I.intersect && F.intersect && !j && (N = N.slice(1, C.points.length - 1), N.unshift(F.intersect(N[0])), log.debug("Last point UIO", C.start, "-->", C.end, N[N.length - 1], I, I.intersect(N[N.length - 1])), N.push(I.intersect(N[N.length - 1])));
  let R = btoa(JSON.stringify(N));
  C.toCluster && (log.info("to cluster abc88", w.get(C.toCluster)), N = cutPathAtIntersect(C.points, w.get(C.toCluster).node), P = true), C.fromCluster && (log.debug("from cluster abc88", w.get(C.fromCluster), JSON.stringify(N, null, 2)), N = cutPathAtIntersect(N.reverse(), w.get(C.fromCluster).node).reverse(), P = true);
  let z = N.filter((t) => !Number.isNaN(t.y));
  z = fixCorners(z);
  let B = basis_default;
  switch (B = linear_default, C.curve) {
    case "linear":
      B = linear_default;
      break;
    case "basis":
      B = basis_default;
      break;
    case "cardinal":
      B = cardinal_default;
      break;
    case "bumpX":
      B = bumpX;
      break;
    case "bumpY":
      B = bumpY;
      break;
    case "catmullRom":
      B = catmullRom_default;
      break;
    case "monotoneX":
      B = monotoneX;
      break;
    case "monotoneY":
      B = monotoneY;
      break;
    case "natural":
      B = natural_default;
      break;
    case "step":
      B = step_default;
      break;
    case "stepAfter":
      B = stepAfter;
      break;
    case "stepBefore":
      B = stepBefore;
      break;
    default:
      B = basis_default;
  }
  let { x: V, y: H } = getLineFunctionsWithOffset(C), U = line_default().x(V).y(H).curve(B), W;
  switch (C.thickness) {
    case "normal":
      W = "edge-thickness-normal";
      break;
    case "thick":
      W = "edge-thickness-thick";
      break;
    case "invisible":
      W = "edge-thickness-invisible";
      break;
    default:
      W = "edge-thickness-normal";
  }
  switch (C.pattern) {
    case "solid":
      W += " edge-pattern-solid";
      break;
    case "dotted":
      W += " edge-pattern-dotted";
      break;
    case "dashed":
      W += " edge-pattern-dashed";
      break;
    default:
      W += " edge-pattern-solid";
  }
  let G, K = C.curve === "rounded" ? generateRoundedPath(applyMarkerOffsetsToPoints(z, C), 5) : U(z), q = Array.isArray(C.style) ? C.style : [C.style], J = q.find((t) => t == null ? void 0 : t.startsWith("stroke:")), Y = false;
  if (C.look === "handDrawn") {
    let t = at.svg(b);
    Object.assign([], z);
    let o = t.path(K, {
      roughness: 0.3,
      seed: M
    });
    W += " transition", G = select_default(o).select("path").attr("id", C.id).attr("class", " " + W + (C.classes ? " " + C.classes : "")).attr("style", q ? q.reduce((t2, o2) => t2 + ";" + o2, "") : "");
    let s = G.attr("d");
    G.attr("d", s), b.node().appendChild(G.node());
  } else {
    let t = L.join(";"), o = q ? q.reduce((t2, o2) => t2 + o2 + ";", "") : "", s = "";
    C.animate && (s = " edge-animation-fast"), C.animation && (s = " edge-animation-" + C.animation);
    let c = (t ? t + ";" + o + ";" : o) + ";" + (q ? q.reduce((t2, o2) => t2 + ";" + o2, "") : "");
    G = b.append("path").attr("d", K).attr("id", C.id).attr("class", " " + W + (C.classes ? " " + C.classes : "") + (s ?? "")).attr("style", c), J = (_a = c.match(/stroke:([^;]+)/)) == null ? void 0 : _a[1], Y = C.animate === true || !!C.animation || t.includes("animation");
    let l = G.node(), u = typeof l.getTotalLength == "function" ? l.getTotalLength() : 0, d = markerOffsets2[C.arrowTypeStart] || 0, f = markerOffsets2[C.arrowTypeEnd] || 0;
    if (C.look === "neo" && !Y) {
      let t2 = `stroke-dasharray: ${C.pattern === "dotted" || C.pattern === "dashed" ? generateDashArray(u, d, f) : `0 ${d} ${u - d - f} ${f}`}; stroke-dashoffset: 0;`;
      G.attr("style", t2 + G.attr("style"));
    }
  }
  G.attr("data-edge", true), G.attr("data-et", "edge"), G.attr("data-id", C.id), G.attr("data-points", R), C.showPoints && z.forEach((t) => {
    b.append("circle").style("stroke", "red").style("fill", "red").attr("r", 1).attr("cx", t.x).attr("cy", t.y);
  });
  let X = "";
  (getConfig2().flowchart.arrowMarkerAbsolute || getConfig2().state.arrowMarkerAbsolute) && (X = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, X = X.replace(/\(/g, "\\(").replace(/\)/g, "\\)")), log.info("arrowTypeStart", C.arrowTypeStart), log.info("arrowTypeEnd", C.arrowTypeEnd), addEdgeMarkers(G, C, X, A, D, J);
  let Z = Math.floor(N.length / 2), Q = N[Z];
  utils_default.isLabelCoordinateInPath(Q, G.attr("d")) || (P = true);
  let $ = {};
  return P && ($.updatedPath = N), $.originalPath = C.points, $;
}, "insertEdge");
function generateRoundedPath(t, o) {
  if (t.length < 2) return "";
  let s = "", c = t.length, l = 1e-5;
  for (let u = 0; u < c; u++) {
    let d = t[u], f = t[u - 1], p = t[u + 1];
    if (u === 0) s += `M${d.x},${d.y}`;
    else if (u === c - 1) s += `L${d.x},${d.y}`;
    else {
      let t2 = d.x - f.x, c2 = d.y - f.y, u2 = p.x - d.x, m = p.y - d.y, h = Math.hypot(t2, c2), g = Math.hypot(u2, m);
      if (h < l || g < l) {
        s += `L${d.x},${d.y}`;
        continue;
      }
      let _ = t2 / h, v = c2 / h, y = u2 / g, b = m / g, x = _ * y + v * b, S = Math.max(-1, Math.min(1, x)), C = Math.acos(S);
      if (C < l || Math.abs(Math.PI - C) < l) {
        s += `L${d.x},${d.y}`;
        continue;
      }
      let w = Math.min(o / Math.sin(C / 2), h / 2, g / 2), T = d.x - _ * w, E = d.y - v * w, D = d.x + y * w, O = d.y + b * w;
      s += `L${T},${E}`, s += `Q${d.x},${d.y} ${D},${O}`;
    }
  }
  return s;
}
__name(generateRoundedPath, "generateRoundedPath");
function calculateDeltaAndAngle(t, o) {
  if (!t || !o) return {
    angle: 0,
    deltaX: 0,
    deltaY: 0
  };
  let s = o.x - t.x, c = o.y - t.y;
  return {
    angle: Math.atan2(c, s),
    deltaX: s,
    deltaY: c
  };
}
__name(calculateDeltaAndAngle, "calculateDeltaAndAngle");
function applyMarkerOffsetsToPoints(t, o) {
  let s = t.map((t2) => ({ ...t2 }));
  if (t.length >= 2 && markerOffsets[o.arrowTypeStart]) {
    let c2 = markerOffsets[o.arrowTypeStart], l = t[0], u = t[1], { angle: d } = calculateDeltaAndAngle(l, u), f = c2 * Math.cos(d), p = c2 * Math.sin(d);
    s[0].x = l.x + f, s[0].y = l.y + p;
  }
  let c = t.length;
  if (c >= 2 && markerOffsets[o.arrowTypeEnd]) {
    let l = markerOffsets[o.arrowTypeEnd], u = t[c - 1], d = t[c - 2], { angle: f } = calculateDeltaAndAngle(d, u), p = l * Math.cos(f), m = l * Math.sin(f);
    s[c - 1].x = u.x - p, s[c - 1].y = u.y - m;
  }
  return s;
}
__name(applyMarkerOffsetsToPoints, "applyMarkerOffsetsToPoints");
var insertMarkers = /* @__PURE__ */ __name((t, o, s, c) => {
  o.forEach((o2) => {
    markers[o2](t, s, c);
  });
}, "insertMarkers"), markers = {
  extension: /* @__PURE__ */ __name((t, o, s) => {
    log.trace("Making markers for ", s), t.append("defs").append("marker").attr("id", s + "_" + o + "-extensionStart").attr("class", "marker extension " + o).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), t.append("defs").append("marker").attr("id", s + "_" + o + "-extensionEnd").attr("class", "marker extension " + o).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
  }, "extension"),
  composition: /* @__PURE__ */ __name((t, o, s) => {
    t.append("defs").append("marker").attr("id", s + "_" + o + "-compositionStart").attr("class", "marker composition " + o).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), t.append("defs").append("marker").attr("id", s + "_" + o + "-compositionEnd").attr("class", "marker composition " + o).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
  }, "composition"),
  aggregation: /* @__PURE__ */ __name((t, o, s) => {
    t.append("defs").append("marker").attr("id", s + "_" + o + "-aggregationStart").attr("class", "marker aggregation " + o).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), t.append("defs").append("marker").attr("id", s + "_" + o + "-aggregationEnd").attr("class", "marker aggregation " + o).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
  }, "aggregation"),
  dependency: /* @__PURE__ */ __name((t, o, s) => {
    t.append("defs").append("marker").attr("id", s + "_" + o + "-dependencyStart").attr("class", "marker dependency " + o).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), t.append("defs").append("marker").attr("id", s + "_" + o + "-dependencyEnd").attr("class", "marker dependency " + o).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
  }, "dependency"),
  lollipop: /* @__PURE__ */ __name((t, o, s) => {
    t.append("defs").append("marker").attr("id", s + "_" + o + "-lollipopStart").attr("class", "marker lollipop " + o).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6), t.append("defs").append("marker").attr("id", s + "_" + o + "-lollipopEnd").attr("class", "marker lollipop " + o).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
  }, "lollipop"),
  point: /* @__PURE__ */ __name((t, o, s) => {
    t.append("marker").attr("id", s + "_" + o + "-pointEnd").attr("class", "marker " + o).attr("viewBox", "0 0 10 10").attr("refX", 5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), t.append("marker").attr("id", s + "_" + o + "-pointStart").attr("class", "marker " + o).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
  }, "point"),
  circle: /* @__PURE__ */ __name((t, o, s) => {
    t.append("marker").attr("id", s + "_" + o + "-circleEnd").attr("class", "marker " + o).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), t.append("marker").attr("id", s + "_" + o + "-circleStart").attr("class", "marker " + o).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
  }, "circle"),
  cross: /* @__PURE__ */ __name((t, o, s) => {
    t.append("marker").attr("id", s + "_" + o + "-crossEnd").attr("class", "marker cross " + o).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"), t.append("marker").attr("id", s + "_" + o + "-crossStart").attr("class", "marker cross " + o).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
  }, "cross"),
  barb: /* @__PURE__ */ __name((t, o, s) => {
    t.append("defs").append("marker").attr("id", s + "_" + o + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
  }, "barb"),
  only_one: /* @__PURE__ */ __name((t, o, s) => {
    t.append("defs").append("marker").attr("id", s + "_" + o + "-onlyOneStart").attr("class", "marker onlyOne " + o).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("d", "M9,0 L9,18 M15,0 L15,18"), t.append("defs").append("marker").attr("id", s + "_" + o + "-onlyOneEnd").attr("class", "marker onlyOne " + o).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("d", "M3,0 L3,18 M9,0 L9,18");
  }, "only_one"),
  zero_or_one: /* @__PURE__ */ __name((t, o, s) => {
    let c = t.append("defs").append("marker").attr("id", s + "_" + o + "-zeroOrOneStart").attr("class", "marker zeroOrOne " + o).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
    c.append("circle").attr("fill", "white").attr("cx", 21).attr("cy", 9).attr("r", 6), c.append("path").attr("d", "M9,0 L9,18");
    let l = t.append("defs").append("marker").attr("id", s + "_" + o + "-zeroOrOneEnd").attr("class", "marker zeroOrOne " + o).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
    l.append("circle").attr("fill", "white").attr("cx", 9).attr("cy", 9).attr("r", 6), l.append("path").attr("d", "M21,0 L21,18");
  }, "zero_or_one"),
  one_or_more: /* @__PURE__ */ __name((t, o, s) => {
    t.append("defs").append("marker").attr("id", s + "_" + o + "-oneOrMoreStart").attr("class", "marker oneOrMore " + o).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"), t.append("defs").append("marker").attr("id", s + "_" + o + "-oneOrMoreEnd").attr("class", "marker oneOrMore " + o).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18");
  }, "one_or_more"),
  zero_or_more: /* @__PURE__ */ __name((t, o, s) => {
    let c = t.append("defs").append("marker").attr("id", s + "_" + o + "-zeroOrMoreStart").attr("class", "marker zeroOrMore " + o).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
    c.append("circle").attr("fill", "white").attr("cx", 48).attr("cy", 18).attr("r", 6), c.append("path").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18");
    let l = t.append("defs").append("marker").attr("id", s + "_" + o + "-zeroOrMoreEnd").attr("class", "marker zeroOrMore " + o).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
    l.append("circle").attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6), l.append("path").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18");
  }, "zero_or_more"),
  requirement_arrow: /* @__PURE__ */ __name((t, o, s) => {
    t.append("defs").append("marker").attr("id", s + "_" + o + "-requirement_arrowEnd").attr("refX", 20).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").append("path").attr("d", "M0,0\n      L20,10\n      M20,10\n      L0,20");
  }, "requirement_arrow"),
  requirement_contains: /* @__PURE__ */ __name((t, o, s) => {
    let c = t.append("defs").append("marker").attr("id", s + "_" + o + "-requirement_containsStart").attr("refX", 0).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").append("g");
    c.append("circle").attr("cx", 10).attr("cy", 10).attr("r", 9).attr("fill", "none"), c.append("line").attr("x1", 1).attr("x2", 19).attr("y1", 10).attr("y2", 10), c.append("line").attr("y1", 1).attr("y2", 19).attr("x1", 10).attr("x2", 10);
  }, "requirement_contains")
}, markers_default = insertMarkers;
export {
  positionEdgeLabel as a,
  markers_default as i,
  insertEdge as n,
  insertEdgeLabel as r,
  clear as t
};
