import { __exports as d } from "./index-utils9.js";
import { __require as y } from "./index-classnames2.js";
import C from "./index-_virtual39.js";
import p from "./index-_virtual47.js";
import w from "./index-_virtual40.js";
import F from "./index-_virtual52.js";
import N from "./index-_virtual53.js";
import S from "./index-_virtual45.js";
import U from "./index-_virtual46.js";
var v;
function H() {
  if (v) return d;
  v = 1, Object.defineProperty(d, "__esModule", {
    value: !0
  }), d.calcFocusDate = M, d.findNextRangeIndex = x, d.getMonthDisplayRange = R, d.generateStyles = I;
  var D = f(y()), _ = f(C), g = f(p), h = f(w), $ = f(F), q = f(N), s = f(S), l = f(U);
  function f(e) {
    return e && e.__esModule ? e : { default: e };
  }
  function M(e, t) {
    var a = t.shownDate, r = t.date, u = t.months, o = t.ranges, i = t.focusedRange, O = t.displayMode, n;
    if (O === "dateRange") {
      var c = o[i[0]] || {};
      n = {
        start: c.startDate,
        end: c.endDate
      };
    } else
      n = {
        start: r,
        end: r
      };
    n.start = (0, l.default)(n.start || /* @__PURE__ */ new Date()), n.end = (0, s.default)(n.end || n.start);
    var m = n.start || n.end || a || /* @__PURE__ */ new Date();
    return e ? (0, g.default)(n.start, n.end) > u ? e : m : a || m;
  }
  function x(e) {
    var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : -1, a = e.findIndex(function(r, u) {
      return u > t && r.autoFocus !== !1 && !r.disabled;
    });
    return a !== -1 ? a : e.findIndex(function(r) {
      return r.autoFocus !== !1 && !r.disabled;
    });
  }
  function R(e, t, a) {
    var r = (0, l.default)(e, t), u = (0, s.default)(e, t), o = (0, q.default)(r, t), i = (0, $.default)(u, t);
    return a && (0, h.default)(i, o) <= 34 && (i = (0, _.default)(i, 7)), {
      start: o,
      end: i,
      startDateOfMonth: r,
      endDateOfMonth: u
    };
  }
  function I(e) {
    if (!e.length) return {};
    var t = e.filter(function(a) {
      return !!a;
    }).reduce(function(a, r) {
      return Object.keys(r).forEach(function(u) {
        a[u] = (0, D.default)(a[u], r[u]);
      }), a;
    }, {});
    return t;
  }
  return d;
}
export {
  H as __require
};
