import clsx from "clsx";
import { normalizeResponsiveValue } from "../css/atoms/sprinkles.css.mjs";
import { optimizeResponsiveArray } from "../components/Column/Column.mjs";
const resolveResponsiveProp = (value, mobileAtoms, tabletAtoms, desktopAtoms, wideAtoms) => {
  if (typeof value === "string" || typeof value === "number") {
    return mobileAtoms[value];
  }
  const normalized = normalizeResponsiveValue(value);
  const [mobile, tablet, desktop, wide] = optimizeResponsiveArray([
    normalized.mobile ?? null,
    normalized.tablet ?? null,
    normalized.desktop ?? null,
    normalized.wide ?? null
  ]);
  const mobileAtom = mobileAtoms[mobile];
  const tabletAtom = tabletAtoms[tablet];
  const desktopAtom = desktopAtoms[desktop];
  const wideAtom = wideAtoms[wide];
  return clsx(mobileAtom, tabletAtom, desktopAtom, wideAtom);
};
export {
  resolveResponsiveProp
};
