"use client";
import { keys } from "../../../../core/utils/keys/keys.mjs";
import { rem } from "../../../../core/utils/units-converters/rem.mjs";
import { getBaseSize } from "../get-base-size/get-base-size.mjs";
import { isPrimitiveSize } from "../is-primitive-size/is-primitive-size.mjs";
import { isResponsiveSize } from "../is-responsive-size/is-responsive-size.mjs";
//#region packages/@mantine/core/src/components/AppShell/AppShellMediaStyles/assign-footer-variables/assign-footer-variables.ts
function assignFooterVariables({ baseStyles, minMediaStyles, footer, mode }) {
	const footerHeight = footer?.height;
	const collapsedFooterTransform = "translateY(var(--app-shell-footer-height))";
	const shouldOffset = mode === "static" ? true : footer?.offset ?? true;
	if (mode === "static" && footer) {
		baseStyles["--app-shell-footer-position"] = "sticky";
		baseStyles["--app-shell-footer-grid-column"] = "1 / -1";
		baseStyles["--app-shell-footer-grid-row"] = "3";
	}
	if (isPrimitiveSize(footerHeight)) {
		const baseSize = rem(getBaseSize(footerHeight));
		baseStyles["--app-shell-footer-height"] = baseSize;
		if (shouldOffset) baseStyles["--app-shell-footer-offset"] = baseSize;
	}
	if (isResponsiveSize(footerHeight)) {
		if (typeof footerHeight.base !== "undefined") {
			baseStyles["--app-shell-footer-height"] = rem(footerHeight.base);
			if (shouldOffset) baseStyles["--app-shell-footer-offset"] = rem(footerHeight.base);
		}
		keys(footerHeight).forEach((key) => {
			if (key !== "base") {
				minMediaStyles[key] = minMediaStyles[key] || {};
				minMediaStyles[key]["--app-shell-footer-height"] = rem(footerHeight[key]);
				if (shouldOffset) minMediaStyles[key]["--app-shell-footer-offset"] = rem(footerHeight[key]);
			}
		});
	}
	if (footer?.collapsed) {
		baseStyles["--app-shell-footer-transform"] = collapsedFooterTransform;
		if (mode === "fixed") baseStyles["--app-shell-footer-offset"] = "0px !important";
	}
}
//#endregion
export { assignFooterVariables };

//# sourceMappingURL=assign-footer-variables.mjs.map