import { f as d } from "./chunk-5PVQY5BW.js";
import { n as i } from "./chunk-AGHRB4JF.js";
import { b as r, d as f } from "./chunk-ICPOFSXX.js";
var h = /* @__PURE__ */ i(({ flowchart: n }) => {
  const o = n?.subGraphTitleMargin?.top ?? 0, t = n?.subGraphTitleMargin?.bottom ?? 0;
  return {
    subGraphTitleTopMargin: o,
    subGraphTitleBottomMargin: t,
    subGraphTitleTotalMargin: o + t
  };
}, "getSubGraphTitleMargins");
async function c(n, o) {
  const t = n.getElementsByTagName("img");
  if (!t || t.length === 0) return;
  const l = o.replace(/<img[^>]*>/g, "").trim() === "";
  await Promise.all([...t].map((e) => new Promise((p) => {
    function a() {
      if (e.style.display = "flex", e.style.flexDirection = "column", l) {
        const m = r().fontSize ? r().fontSize : window.getComputedStyle(document.body).fontSize, g = 5, [u = f.fontSize] = d(m), s = u * g + "px";
        e.style.minWidth = s, e.style.maxWidth = s;
      } else e.style.width = "100%";
      p(e);
    }
    i(a, "setupImage"), setTimeout(() => {
      e.complete && a();
    }), e.addEventListener("error", a), e.addEventListener("load", a);
  })));
}
i(c, "configureLabelImages");
export {
  h as n,
  c as t
};

//# sourceMappingURL=chunk-ZZ45TVLE.js.map