import i from "./index-extends.js";
import { useUtils as m, useDefaultDates as l } from "./index-useUtils.js";
import { parseNonNullablePickerDate as u, parsePickerInputValue as p } from "./index-date-utils.js";
import d from "./index-useThemeProps.js";
const f = (e) => e.length === 1 && e[0] === "year", c = (e) => e.length === 2 && e.indexOf("month") !== -1 && e.indexOf("year") !== -1, D = (e, t) => f(e) ? {
  inputFormat: t.formats.year
} : c(e) ? {
  disableMaskedInput: !0,
  inputFormat: t.formats.monthAndYear
} : {
  inputFormat: t.formats.keyboardDate
};
function k(e, t) {
  var a;
  const n = m(), s = l(), r = d({
    props: e,
    name: t
  }), o = (a = r.views) != null ? a : ["year", "day"];
  return i({
    openTo: "day",
    disableFuture: !1,
    disablePast: !1
  }, D(o, n), r, {
    views: o,
    minDate: u(n, r.minDate, s.minDate),
    maxDate: u(n, r.maxDate, s.maxDate)
  });
}
const x = {
  emptyValue: null,
  getTodayValue: (e) => e.date(),
  parseInput: p,
  areValuesEqual: (e, t, a) => e.isEqual(t, a)
};
export {
  x as datePickerValueManager,
  c as isYearAndMonthViews,
  f as isYearOnlyView,
  k as useDatePickerDefaultizedProps
};
