import { generate } from '@ant-design/colors';
import { defaultPresetColors } from '../seed.mjs';
import genColorMapToken from '../shared/genColorMapToken.mjs';
import derivative$1 from '../default/index.mjs';
import { generateColorPalettes, generateNeutralColorPalettes } from './colors.mjs';

const derivative = (token, mapToken) => {
  const colorPalettes = Object.keys(defaultPresetColors).map((colorKey) => {
    const colors = generate(token[colorKey], { theme: "dark" });
    return new Array(10).fill(1).reduce((prev, _, i) => {
      prev[`${colorKey}-${i + 1}`] = colors[i];
      return prev;
    }, {});
  }).reduce((prev, cur) => {
    prev = {
      ...prev,
      ...cur
    };
    return prev;
  }, {});
  const mergedMapToken = mapToken != null ? mapToken : derivative$1(token);
  return {
    ...mergedMapToken,
    // Dark tokens
    ...colorPalettes,
    // Colors
    ...genColorMapToken(token, {
      generateColorPalettes,
      generateNeutralColorPalettes
    })
  };
};

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