import * as l from "react";
import { useRef as r } from "react";
const s = /* @__PURE__ */ new Set();
function u(e) {
  if (!s.has(e))
    throw new Promise((t) => {
      const n = new Image();
      n.src = e, n.onload = () => {
        s.add(e), t(null);
      };
    });
}
function c({
  altText: e,
  className: t,
  imageRef: n,
  src: a,
  width: m,
  height: o,
  maxWidth: i
}) {
  return u(a), /* @__PURE__ */ l.createElement(
    "img",
    {
      className: t || void 0,
      src: a,
      alt: e,
      ref: n,
      style: {
        height: o,
        maxWidth: i,
        width: m
      }
    }
  );
}
function g({
  src: e,
  altText: t,
  width: n,
  height: a,
  maxWidth: m
}) {
  const o = r(null);
  return /* @__PURE__ */ l.createElement("div", null, /* @__PURE__ */ l.createElement(c, { className: "", src: e, altText: t, imageRef: o, width: n, height: a, maxWidth: m }));
}
export {
  g as default
};
