import createMixins from './createMixins.mjs';
import createPalette from './createPalette.mjs';
import createTypography from './createTypography.mjs';
import shadows from './shadows.mjs';
import createTransitions from './createTransitions.mjs';
import zIndex from './zIndex.mjs';
import { stringifyTheme } from './stringifyTheme.mjs';
import formatMuiErrorMessage from '../../utils/esm/formatMuiErrorMessage/formatMuiErrorMessage.mjs';
import createTheme from '../../system/esm/createTheme/createTheme.mjs';
import deepmerge from '../../utils/esm/deepmerge/deepmerge.mjs';
import defaultSxConfig from '../../system/esm/styleFunctionSx/defaultSxConfig.mjs';
import styleFunctionSx from '../../system/esm/styleFunctionSx/styleFunctionSx.mjs';

function createThemeNoVars(options = {}, ...args) {
  const {
    breakpoints: breakpointsInput,
    mixins: mixinsInput = {},
    spacing: spacingInput,
    palette: paletteInput = {},
    transitions: transitionsInput = {},
    typography: typographyInput = {},
    shape: shapeInput,
    ...other
  } = options;
  if (options.vars) {
    throw new Error(formatMuiErrorMessage(20));
  }
  const palette = createPalette(paletteInput);
  const systemTheme = createTheme(options);
  let muiTheme = deepmerge(systemTheme, {
    mixins: createMixins(systemTheme.breakpoints, mixinsInput),
    palette,
    // Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.
    shadows: shadows.slice(),
    typography: createTypography(palette, typographyInput),
    transitions: createTransitions(transitionsInput),
    zIndex: {
      ...zIndex
    }
  });
  muiTheme = deepmerge(muiTheme, other);
  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
    });
  };
  muiTheme.toRuntimeSource = stringifyTheme; // for Pigment CSS integration

  return muiTheme;
}

export { createThemeNoVars as default };
//# sourceMappingURL=createThemeNoVars.mjs.map
