'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
require('../../../../utils/index.cjs');
var log = require('../../../../utils/log.cjs');

function usePresets(presets, legacyRanges) {
  return vue.computed(() => {
    if (presets == null ? void 0 : presets.value)
      return presets.value;
    if (legacyRanges == null ? void 0 : legacyRanges.value) {
      log.warning(false, "`ranges` is deprecated. Please use `presets` instead.");
      const rangeLabels = Object.keys(legacyRanges.value);
      return rangeLabels.map((label) => {
        const range = legacyRanges.value[label];
        const newValues = typeof range === "function" ? range() : range;
        return {
          label,
          value: newValues
        };
      });
    }
    return [];
  });
}

exports.default = usePresets;
//# sourceMappingURL=usePresets.cjs.map
