import createBreakpoints from '../createBreakpoints/createBreakpoints.mjs';
import shape from './shape.mjs';
import createSpacing from './createSpacing.mjs';
import styleFunctionSx from '../styleFunctionSx/styleFunctionSx.mjs';
import defaultSxConfig from '../styleFunctionSx/defaultSxConfig.mjs';
import applyStyles from './applyStyles.mjs';
import deepmerge from '../../../utils/esm/deepmerge/deepmerge.mjs';
import cssContainerQueries from '../cssContainerQueries/cssContainerQueries.mjs';

function createTheme$1(options = {}, ...args) {
  const {
    breakpoints: breakpointsInput = {},
    palette: paletteInput = {},
    spacing: spacingInput,
    shape: shapeInput = {},
    ...other
  } = options;
  const breakpoints = createBreakpoints(breakpointsInput);
  const spacing = createSpacing(spacingInput);
  let muiTheme = deepmerge({
    breakpoints,
    direction: 'ltr',
    components: {},
    // Inject component definitions.
    palette: {
      mode: 'light',
      ...paletteInput
    },
    spacing,
    shape: {
      ...shape,
      ...shapeInput
    }
  }, other);
  muiTheme = cssContainerQueries(muiTheme);
  muiTheme.applyStyles = applyStyles;
  muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
  muiTheme.unstable_sxConfig = {
    ...defaultSxConfig,
    ...other?.unstable_sxConfig
  };
  muiTheme.unstable_sx = function sx(props) {
    return styleFunctionSx({
      sx: props,
      theme: this
    });
  };
  return muiTheme;
}

export { createTheme$1 as default };
//# sourceMappingURL=createTheme.mjs.map
