import { computed } from 'vue';
import '../../../../utils/index.mjs';
import { warning } from '../../../../utils/log.mjs';

function usePresets(presets, legacyRanges) {
  return computed(() => {
    if (presets == null ? void 0 : presets.value)
      return presets.value;
    if (legacyRanges == null ? void 0 : legacyRanges.value) {
      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 [];
  });
}

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