import { buildHTMLStyles as c } from "../../html/utils/build-styles.es.js";
import { buildSVGPath as B } from "./path.es.js";
const b = [
  "offsetDistance",
  "offsetPath",
  "offsetRotate",
  "offsetAnchor"
];
function g(r, {
  attrX: e,
  attrY: s,
  attrScale: t,
  pathLength: d,
  pathSpacing: m = 1,
  pathOffset: l = 0,
  // This is object creation, which we try to avoid per-frame.
  ...a
}, u, x, n) {
  if (c(r, a, x), u) {
    r.style.viewBox && (r.attrs.viewBox = r.style.viewBox);
    return;
  }
  r.attrs = r.style, r.style = {};
  const { attrs: f, style: i } = r;
  f.transform && (i.transform = f.transform, delete f.transform), (i.transform || f.transformOrigin) && (i.transformOrigin = f.transformOrigin ?? "50% 50%", delete f.transformOrigin), i.transform && (i.transformBox = (n == null ? void 0 : n.transformBox) ?? "fill-box", delete f.transformBox);
  for (const o of b)
    f[o] !== void 0 && (i[o] = f[o], delete f[o]);
  e !== void 0 && (f.x = e), s !== void 0 && (f.y = s), t !== void 0 && (f.scale = t), d !== void 0 && B(f, d, m, l, !1);
}
export {
  g as buildSVGAttrs
};
//# sourceMappingURL=build-attrs.es.js.map
