import { getConfig2 as h } from "./chunk-ABZYJK2D.js";
import { __name as a } from "./chunk-AGHRB4JF.js";
var S = /* @__PURE__ */ a((t) => {
  const { handDrawnSeed: e } = h();
  return {
    fill: t,
    hachureAngle: 120,
    // angle of hachure,
    hachureGap: 4,
    fillWeight: 2,
    roughness: 0.7,
    stroke: t,
    seed: e
  };
}, "solidStateFill"), p = /* @__PURE__ */ a((t) => {
  const e = d([
    ...t.cssCompiledStyles || [],
    ...t.cssStyles || [],
    ...t.labelStyle || []
  ]);
  return { stylesMap: e, stylesArray: [...e] };
}, "compileStyles"), d = /* @__PURE__ */ a((t) => {
  const e = /* @__PURE__ */ new Map();
  return t.forEach((o) => {
    const [n, s] = o.split(":");
    e.set(n.trim(), s == null ? void 0 : s.trim());
  }), e;
}, "styles2Map"), f = /* @__PURE__ */ a((t) => t === "color" || t === "font-size" || t === "font-family" || t === "font-weight" || t === "font-style" || t === "text-decoration" || t === "text-align" || t === "text-transform" || t === "line-height" || t === "letter-spacing" || t === "word-spacing" || t === "text-shadow" || t === "text-overflow" || t === "white-space" || t === "word-wrap" || t === "word-break" || t === "overflow-wrap" || t === "hyphens", "isLabelStyle"), w = /* @__PURE__ */ a((t) => {
  const { stylesArray: e } = p(t), o = [], n = [], s = [], i = [];
  return e.forEach((r) => {
    const l = r[0];
    f(l) ? o.push(r.join(":") + " !important") : (n.push(r.join(":") + " !important"), l.includes("stroke") && s.push(r.join(":") + " !important"), l === "fill" && i.push(r.join(":") + " !important"));
  }), {
    labelStyles: o.join(";"),
    nodeStyles: n.join(";"),
    stylesArray: e,
    borderStyles: s,
    backgroundStyles: i
  };
}, "styles2String"), b = /* @__PURE__ */ a((t, e) => {
  var c;
  const { themeVariables: o, handDrawnSeed: n } = h(), { nodeBorder: s, mainBkg: i } = o, { stylesMap: r } = p(t);
  return Object.assign(
    {
      roughness: 0.7,
      fill: r.get("fill") || i,
      fillStyle: "hachure",
      // solid fill
      fillWeight: 4,
      hachureGap: 5.2,
      stroke: r.get("stroke") || s,
      seed: n,
      strokeWidth: ((c = r.get("stroke-width")) == null ? void 0 : c.replace("px", "")) || 1.3,
      fillLineDash: [0, 0],
      strokeLineDash: u(r.get("stroke-dasharray"))
    },
    e
  );
}, "userNodeOverrides"), u = /* @__PURE__ */ a((t) => {
  if (!t)
    return [0, 0];
  const e = t.trim().split(/\s+/).map(Number);
  if (e.length === 1) {
    const s = isNaN(e[0]) ? 0 : e[0];
    return [s, s];
  }
  const o = isNaN(e[0]) ? 0 : e[0], n = isNaN(e[1]) ? 0 : e[1];
  return [o, n];
}, "getStrokeDashArray");
export {
  p as compileStyles,
  f as isLabelStyle,
  S as solidStateFill,
  w as styles2String,
  b as userNodeOverrides
};
