"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const index$1 = require("../../node_modules/.pnpm/color@4.2.3/node_modules/color/index.js");
require("../store/modules/designStore/designStore.js");
const index = require("../settings/chartThemes/index.js");
const animationsClass = (animations) => {
  if (animations.length) {
    return `animate__animated  animate__${animations[0]}`;
  }
  return "";
};
const getFilterStyle = (styles) => {
  if (!styles || !styles.filterShow)
    return {};
  const { opacity, saturate, contrast, hueRotate, brightness } = styles;
  return {
    opacity,
    filter: `saturate(${saturate}) contrast(${contrast}) hue-rotate(${hueRotate}deg) brightness(${brightness})`
  };
};
const getTransformStyle = (styles) => {
  const { rotateZ, rotateX, rotateY, skewX, skewY } = styles;
  return {
    transform: `rotateZ(${rotateZ || 0}deg) rotateX(${rotateX || 0}deg) rotateY(${rotateY || 0}deg) skewX(${skewX || 0}deg) skewY(${skewY || 0}deg)`
  };
};
const getBlendModeStyle = (styles) => {
  if (!styles || !styles.filterShow)
    return {};
  const { blendMode } = styles;
  return {
    "mix-blend-mode": blendMode
  };
};
function alpha(color, alpha2 = 1) {
  return index$1.default(color).alpha(alpha2).toString();
}
function fade(color, fade2) {
  return index$1.default(color).fade(fade2).toString();
}
function lighten(color, concentration) {
  return index$1.default(color).lighten(concentration).toString();
}
function darken(color, concentration) {
  return index$1.default(color).darken(concentration).toString();
}
function hslToHexa(hslString) {
  const color = index$1.default(hslString);
  return color.hexa();
}
function hslToHex(hslString) {
  const color = index$1.default(hslString);
  return color.hex();
}
const colorCustomMerge = (customColor) => {
  const formateCustomColor = {};
  customColor == null ? void 0 : customColor.forEach((item) => {
    formateCustomColor[item.id] = {
      color: item.color,
      name: item.name
    };
  });
  return { ...formateCustomColor, ...index.chartColors };
};
const colorGradientCustomMerge = (customColor) => {
  const formateGradientCustomColor = {};
  customColor == null ? void 0 : customColor.forEach((item) => {
    formateGradientCustomColor[item.id] = [
      item.color[0],
      item.color[1],
      fade(item.color[0], 0.3),
      fade(item.color[0], 0.5),
      fade(item.color[1], 0.5)
    ];
  });
  return { ...formateGradientCustomColor, ...index.chartColorsSearch };
};
exports.alpha = alpha;
exports.animationsClass = animationsClass;
exports.colorCustomMerge = colorCustomMerge;
exports.colorGradientCustomMerge = colorGradientCustomMerge;
exports.darken = darken;
exports.fade = fade;
exports.getBlendModeStyle = getBlendModeStyle;
exports.getFilterStyle = getFilterStyle;
exports.getTransformStyle = getTransformStyle;
exports.hslToHex = hslToHex;
exports.hslToHexa = hslToHexa;
exports.lighten = lighten;
