import { jsx as c } from "@emotion/react/jsx-runtime";
import { useBase as u } from "@m4l/core";
import s from "qrcode.react";
const a = (r, e) => {
  if (isNaN(r))
    return 0;
  if (e === "px")
    return r;
  switch (e) {
    case "cm":
      return r * 37.8;
    case "mm":
      return r * 3.78;
    case "in":
      return r * 96;
    case "pt":
      return r * 1.33;
    case "pc":
      return r * 16;
    default:
      return 100;
  }
}, i = (r) => {
  const { url: e, size: t = 8, color: o } = r, { unitSize: n } = u();
  return /* @__PURE__ */ c(s, { value: e, size: a(t, n), fgColor: o, renderAs: "canvas" });
};
export {
  i as QRImageNode
};
