import s from "../shared/parsePixelSize.js";
const r = (i) => {
  if (typeof i == "number")
    return Number.isFinite(i) ? i : void 0;
  const t = i.trim();
  if (!t || typeof window > "u" || typeof document > "u")
    return;
  const o = s(t);
  if (o !== void 0)
    return o;
  const e = document.createElement("div");
  e.style.position = "absolute", e.style.visibility = "hidden", e.style.pointerEvents = "none", e.style.boxSizing = "border-box", e.style.width = t, e.style.height = "0", e.style.padding = "0", e.style.border = "0", document.body.appendChild(e);
  const n = e.getBoundingClientRect().width;
  return e.remove(), Number.isFinite(n) ? n : void 0;
}, d = (i) => i ? {
  multiCardsMaxWidth: i.cards !== void 0 ? r(i.cards) : void 0,
  singleCardMaxWidth: i.list !== void 0 ? r(i.list) : void 0
} : {}, m = (i, t, o) => {
  if (t === void 0)
    return i;
  const { multiCardsMaxWidth: e, singleCardMaxWidth: n } = d(o);
  return n !== void 0 && t < n ? "SINGLE_CARD" : e !== void 0 && t < e ? "MULTI_CARDS" : i;
};
export {
  m as resolveResponsiveViewType
};
//# sourceMappingURL=resolveResponsiveViewType.js.map
