import { jsx as l } from "react/jsx-runtime";
import C from "react";
import o from "./components/base-calendar/BaseCalendar.js";
const p = C.memo(
  ({
    mode: s = "single",
    fromYear: n = (/* @__PURE__ */ new Date()).getFullYear() - 100,
    toYear: t = (/* @__PURE__ */ new Date()).getFullYear() + 10,
    captionLayout: e = "label",
    ...a
  }) => {
    const d = Math.min(n, t), r = Math.max(n, t);
    if (s === "single") {
      const { value: g, onChange: b, numberOfMonths: w = 1, defaultMonth: D, disableDate: c, ...v } = a;
      return /* @__PURE__ */ l(
        o,
        {
          mode: "single",
          required: !0,
          selected: g,
          onSelect: b,
          numberOfMonths: w,
          defaultMonth: D,
          disabled: c,
          captionLayout: e,
          startMonth: e === "dropdown" ? new Date(d, 0) : void 0,
          endMonth: e === "dropdown" ? new Date(r, 11) : void 0,
          ...v
        },
        "jtl-calendar-single"
      );
    }
    const { value: h, onChange: m, numberOfMonths: i = 1, defaultMonth: u, disableDate: f, ...M } = a;
    return /* @__PURE__ */ l(
      o,
      {
        mode: "range",
        required: !0,
        selected: h,
        onSelect: m,
        numberOfMonths: i,
        defaultMonth: u,
        disabled: f,
        captionLayout: e,
        startMonth: e === "dropdown" ? new Date(d, 0) : void 0,
        endMonth: e === "dropdown" ? new Date(r, 11) : void 0,
        ...M
      },
      "jtl-calendar-range"
    );
  }
);
p.displayName = "Calendar";
export {
  p as default
};
//# sourceMappingURL=Calendar.js.map
