/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
require("../../../_virtual/_rolldown/runtime.cjs");
const require_variantConfigGuards = require("./variantConfigGuards.cjs");
const require_cartesianProduct = require("./cartesianProduct.cjs");
const require_getConfigComponentVariant = require("./getConfigComponentVariant.cjs");
let lodash_es = require("lodash-es");
//#region ../automated-config/dist/utils/getConfigVariantComponentStatesMatrix.js
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
function getConfigVariantComponentStates(config, variantKey, subComponentName) {
	const componentVariant = require_getConfigComponentVariant.getConfigComponentVariant(config, variantKey, subComponentName);
	if (!componentVariant || !require_variantConfigGuards.isVariantConfigWithComponentStates(componentVariant)) return null;
	return componentVariant?.componentStates ?? null;
}
function getConfigVariantComponentStatesMatrix(config, variantKey, subComponentName) {
	const componentStates = getConfigVariantComponentStates(config, variantKey, subComponentName);
	if (!componentStates) return null;
	return require_cartesianProduct.cartesianProduct((0, lodash_es.entries)(componentStates).map(([key, c]) => c.options.map((c) => ({ [key]: c })))).map((p) => Array.isArray(p) ? p.reduce((acc, curr) => ({
		...acc,
		...curr
	}), {}) : p);
}
//#endregion
exports.getConfigVariantComponentStates = getConfigVariantComponentStates;
exports.getConfigVariantComponentStatesMatrix = getConfigVariantComponentStatesMatrix;
