"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getGranularityReferenceValue = exports.timeFrameToDateGranularityMap = exports.dateGranularityToTimeFrameMap = exports.isStandardDateGranularity = exports.DateGranularity = exports.TimeFrames = void 0;
// eslint-disable-next-line import/prefer-default-export
var TimeFrames;
(function (TimeFrames) {
    TimeFrames["RAW"] = "RAW";
    TimeFrames["YEAR"] = "YEAR";
    TimeFrames["QUARTER"] = "QUARTER";
    TimeFrames["MONTH"] = "MONTH";
    TimeFrames["WEEK"] = "WEEK";
    TimeFrames["DAY"] = "DAY";
    TimeFrames["HOUR"] = "HOUR";
    TimeFrames["MINUTE"] = "MINUTE";
    TimeFrames["SECOND"] = "SECOND";
    TimeFrames["MILLISECOND"] = "MILLISECOND";
    TimeFrames["DAY_OF_WEEK_INDEX"] = "DAY_OF_WEEK_INDEX";
    TimeFrames["DAY_OF_MONTH_NUM"] = "DAY_OF_MONTH_NUM";
    TimeFrames["DAY_OF_YEAR_NUM"] = "DAY_OF_YEAR_NUM";
    TimeFrames["WEEK_NUM"] = "WEEK_NUM";
    TimeFrames["MONTH_NUM"] = "MONTH_NUM";
    TimeFrames["QUARTER_NUM"] = "QUARTER_NUM";
    TimeFrames["YEAR_NUM"] = "YEAR_NUM";
    TimeFrames["DAY_OF_WEEK_NAME"] = "DAY_OF_WEEK_NAME";
    TimeFrames["MONTH_NAME"] = "MONTH_NAME";
    TimeFrames["QUARTER_NAME"] = "QUARTER_NAME";
    TimeFrames["HOUR_OF_DAY_NUM"] = "HOUR_OF_DAY_NUM";
    TimeFrames["MINUTE_OF_HOUR_NUM"] = "MINUTE_OF_HOUR_NUM";
})(TimeFrames || (exports.TimeFrames = TimeFrames = {}));
var DateGranularity;
(function (DateGranularity) {
    DateGranularity["SECOND"] = "Second";
    DateGranularity["MINUTE"] = "Minute";
    DateGranularity["HOUR"] = "Hour";
    DateGranularity["DAY"] = "Day";
    DateGranularity["WEEK"] = "Week";
    DateGranularity["MONTH"] = "Month";
    DateGranularity["QUARTER"] = "Quarter";
    DateGranularity["YEAR"] = "Year";
})(DateGranularity || (exports.DateGranularity = DateGranularity = {}));
const isStandardDateGranularity = (value) => Object.values(DateGranularity).includes(value);
exports.isStandardDateGranularity = isStandardDateGranularity;
exports.dateGranularityToTimeFrameMap = {
    [DateGranularity.SECOND]: TimeFrames.SECOND,
    [DateGranularity.MINUTE]: TimeFrames.MINUTE,
    [DateGranularity.HOUR]: TimeFrames.HOUR,
    [DateGranularity.DAY]: TimeFrames.DAY,
    [DateGranularity.WEEK]: TimeFrames.WEEK,
    [DateGranularity.MONTH]: TimeFrames.MONTH,
    [DateGranularity.QUARTER]: TimeFrames.QUARTER,
    [DateGranularity.YEAR]: TimeFrames.YEAR,
};
exports.timeFrameToDateGranularityMap = {
    [TimeFrames.SECOND]: DateGranularity.SECOND,
    [TimeFrames.MINUTE]: DateGranularity.MINUTE,
    [TimeFrames.HOUR]: DateGranularity.HOUR,
    [TimeFrames.DAY]: DateGranularity.DAY,
    [TimeFrames.WEEK]: DateGranularity.WEEK,
    [TimeFrames.MONTH]: DateGranularity.MONTH,
    [TimeFrames.QUARTER]: DateGranularity.QUARTER,
    [TimeFrames.YEAR]: DateGranularity.YEAR,
};
/**
 * Single source of truth for the value used to reference a date zoom granularity across
 * surfaces (custom SQL parameters, chart labels). Lowercased so it reads the same everywhere.
 */
const getGranularityReferenceValue = (granularity) => granularity.toLowerCase();
exports.getGranularityReferenceValue = getGranularityReferenceValue;
//# sourceMappingURL=timeFrames.js.map