import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import { defaultToken } from "../theme/token.js";
import { useMemo } from "react";
//#region src/plus/productSelect/hooks/useToken.ts
function useToken(customToken) {
	return useMemo(() => {
		return _objectSpread2(_objectSpread2(_objectSpread2({}, defaultToken), {}), customToken || {});
	}, [customToken]);
}
function genCSSVars(token) {
	const cssVars = {};
	Object.entries(token).forEach(([key, value]) => {
		const cssKey = `--ps-${key.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`)}`;
		cssVars[cssKey] = value;
	});
	return cssVars;
}
//#endregion
export { genCSSVars, useToken };
