import C from "../date-picker-footer/DatePickerFooter.js";
import E from "../date-picker-input/DatePickerInput.js";
import I from "../date-picker-presets/DatePickerPresets.js";
import { jsx as r, jsxs as o } from "react/jsx-runtime";
import { memo as R } from "react";
import e from "../../../box/Box.js";
import { DATE_RANGE_PRESETS as _ } from "../../utils/dateRangePresetHelpers.js";
import j from "../../../calendar/Calendar.js";
import { d as y } from "../../../../de-DVQ9_7sl.js";
import { c as d } from "../../../../index-BtlgVD4m.js";
const B = R(
  ({
    header: n,
    hasInput: s,
    footer: a,
    dateFormat: c,
    calendarValue: i,
    defaultMonth: p,
    selectedPreset: l,
    individualPresetIndex: u,
    fromInputValue: b,
    toInputValue: g,
    disableDate: f,
    onPresetClick: v,
    onCalendarChange: h,
    onFromInputChange: x,
    onToInputChange: N,
    onFromInputBlur: P,
    onToInputBlur: D,
    onClear: m,
    onApply: t,
    captionLayout: k,
    fromYear: w,
    toYear: F
  }) => /* @__PURE__ */ r(e, { className: d("w-auto p-0", "border border-[var(--base-border)] rounded-md shadow-md", "bg-[var(--base-popover)]"), children: /* @__PURE__ */ o(e, { className: d("flex flex-col gap-[var(--spacing-2)] p-[var(--spacing-3)] rounded-md"), children: [
    n && /* @__PURE__ */ r(e, { children: n }),
    /* @__PURE__ */ o(e, { className: "flex gap-[var(--spacing-4)]", children: [
      /* @__PURE__ */ r(
        I,
        {
          presets: _,
          selectedPreset: l ?? u,
          onPresetClick: (T) => v(T)
        }
      ),
      /* @__PURE__ */ o(e, { className: "flex flex-col gap-[var(--spacing-2)]", children: [
        s && /* @__PURE__ */ r(
          E,
          {
            dateFormat: c,
            inputFromValue: b,
            inputToValue: g,
            onInputFromChange: x,
            onInputToChange: N,
            onInputFromBlur: P,
            onInputToBlur: D,
            autoFocus: s
          }
        ),
        /* @__PURE__ */ r(e, { className: "border border-[var(--base-border)] rounded-md bg-[var(--base-background)]", children: /* @__PURE__ */ r(e, { className: "[&_.rdp-root]:shadow-none [&_.rdp-root]:border-none", children: /* @__PURE__ */ r(
          j,
          {
            mode: "range",
            value: i,
            defaultMonth: p,
            onChange: h,
            numberOfMonths: 2,
            disableDate: f,
            locale: y,
            captionLayout: k,
            fromYear: w,
            toYear: F
          }
        ) }) })
      ] })
    ] }),
    a ? /* @__PURE__ */ r(
      e,
      {
        className: d(
          "border-t border-[var(--base-border)]",
          "bg-[var(--base-muted)]",
          "flex items-center justify-end gap-[var(--spacing-4)]",
          "-mx-3 -mb-3",
          "px-[var(--spacing-3)] py-[var(--spacing-2)]",
          "rounded-bl-[var(--border-radius-md)] rounded-br-[var(--border-radius-md)]"
        ),
        children: typeof a == "function" ? a({ onApply: t, onClear: m }) : a
      }
    ) : /* @__PURE__ */ r(C, { onClear: m, onApply: t })
  ] }) })
);
B.displayName = "DateRangePickerDropdown";
export {
  B as default
};
//# sourceMappingURL=DateRangePickerDropdown.js.map
