"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "getFormattedDates", {
    enumerable: true,
    get: function() {
        return getFormattedDates;
    }
});
const _dateHelper = require("./dateHelper");
const _getOriginalDates = require("./getOriginalDates");
const _normalizeDates = require("./normalizeDates");
const getFormattedDates = ({ value, lang, format, includeEdgeDates, min, max })=>{
    const { formattedDate, isoDate, originalDate } = (0, _getOriginalDates.getOriginalDates)(value, lang, format);
    if (!originalDate) {
        const innerValue = format && ((0, _dateHelper.needFullMonth)(format) ? formattedDate : formattedDate.slice(0, format.length));
        return {
            formattedDate: innerValue || '',
            isoDate,
            originalDate
        };
    }
    const { normalizedDate, formattedNormalizedDate } = (0, _normalizeDates.normalizeDates)({
        originalDate,
        lang,
        format,
        includeEdgeDates,
        min,
        max
    });
    return {
        formattedDate: formattedNormalizedDate,
        isoDate: normalizedDate.toISOString(),
        originalDate: normalizedDate
    };
};
