import { _ as n, a9 as d, aa as g, l } from "./index-CMZig9xg.js";
var m = /* @__PURE__ */ n((e, t) => {
  let i;
  return t === "sandbox" && (i = d("#i" + e)), (t === "sandbox" ? d(i.nodes()[0].contentDocument.body) : d("body")).select(`[id="${e}"]`);
}, "getDiagramElement"), $ = /* @__PURE__ */ n((e, t, i, o) => {
  e.attr("class", i);
  const { width: a, height: s, x: h, y: c } = x(e, t);
  g(e, s, a, o);
  const r = u(h, c, a, s, t);
  e.attr("viewBox", r), l.debug(`viewBox configured: ${r} with padding: ${t}`);
}, "setupViewPortForSVG"), x = /* @__PURE__ */ n((e, t) => {
  var i;
  const o = ((i = e.node()) == null ? void 0 : i.getBBox()) || { width: 0, height: 0, x: 0, y: 0 };
  return {
    width: o.width + t * 2,
    height: o.height + t * 2,
    x: o.x,
    y: o.y
  };
}, "calculateDimensionsWithPadding"), u = /* @__PURE__ */ n((e, t, i, o, a) => `${e - a} ${t - a} ${i} ${o}`, "createViewBox");
export {
  $ as b,
  m as u
};
