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