import { jsx as e, Fragment as a } from "@emotion/react/jsx-runtime";
import { useState as b } from "react";
import { IntersectCard as w } from "./subcomponents/IntersectCard/IntersectCard.js";
const l = () => typeof window < "u" && "IntersectionObserver" in window && "IntersectionObserverEntry" in window && "intersectionRatio" in window.IntersectionObserverEntry.prototype;
function f(r) {
  const {
    children: t,
    enableIntersectionObserver: n = !0,
    threshold: i = 100,
    minHeight: o = 120,
    rowKey: s
  } = r, [c, d] = b(
    !(n && l())
  );
  return /* @__PURE__ */ e(a, { children: c ? (
    // Contenido real: se renderiza cuando es visible o cuando no se usa observer
    t
  ) : (
    // Placeholder: elemento centinela que detecta cuándo debe cargar el contenido
    /* @__PURE__ */ e(
      w,
      {
        setIsVisible: d,
        threshold: i,
        minHeight: o,
        rowKey: s
      }
    )
  ) });
}
export {
  f as LazyLoadCard
};
