import { useDown } from "../core/media.js";
import { vui } from "../core/vui.js";
import "../core/index.js";
import footerColumn_default from "./footerColumn.js";
import footerRow_default from "./footerRow.js";
import { jsx, jsxs } from "react/jsx-runtime";

//#region src/footer/footerColumns.tsx
/** Organizes sections with links into a single column. Different width per breakpoint. */
const FooterColumns = vui((props, ref) => {
	const { columns } = props;
	const downXs = useDown(460);
	const downMd = useDown("md");
	if (!columns) return null;
	if (downXs) return /* @__PURE__ */ jsx(footerRow_default, {
		ref,
		children: /* @__PURE__ */ jsx(footerColumn_default, {
			flex: "1 1 auto",
			sections: columns.flat(),
			textAlign: "center"
		}, "evenColumns")
	});
	if (downMd) {
		const columnsEven = columns.filter((_, index) => index % 2 === 0).flat();
		const columnsOdd = columns.filter((_, index) => index % 2 === 1).flat();
		return /* @__PURE__ */ jsxs(footerRow_default, {
			ref,
			children: [/* @__PURE__ */ jsx(footerColumn_default, { sections: columnsEven }, "evenColumns"), /* @__PURE__ */ jsx(footerColumn_default, { sections: columnsOdd }, "oddColumns")]
		});
	}
	return /* @__PURE__ */ jsx(footerRow_default, {
		ref,
		children: columns.map((sections, index) => /* @__PURE__ */ jsx(footerColumn_default, { sections }, index))
	});
});
FooterColumns.displayName = "Footer Mobile Column";
var footerColumns_default = FooterColumns;

//#endregion
export { footerColumns_default as default };
globalThis.__vuiVersion__ = "4.0.0-beta.1"
//# sourceMappingURL=footerColumns.js.map