import { commonjsGlobal as g, getDefaultExportFromCjs as C } from "../../../_virtual/_commonjsHelpers.mjs";
import { __module as D } from "../../../_virtual/objectSupport.mjs";
(function(E, A) {
  (function(k, c) {
    E.exports = c();
  })(g, function() {
    return function(k, c, f) {
      var e = c.prototype, w = function(t) {
        var n, o = t.date, i = t.utc, r = {};
        if (!((n = o) === null || n instanceof Date || n instanceof Array || e.$utils().u(n) || n.constructor.name !== "Object")) {
          if (!Object.keys(o).length)
            return /* @__PURE__ */ new Date();
          var u = i ? f.utc() : f();
          Object.keys(o).forEach(function(O) {
            var x, b;
            r[x = O, b = e.$utils().p(x), b === "date" ? "day" : b] = o[O];
          });
          var a = r.day || (r.year || r.month >= 0 ? 1 : u.date()), m = r.year || u.year(), h = r.month >= 0 ? r.month : r.year || r.day ? 0 : u.month(), j = r.hour || 0, l = r.minute || 0, y = r.second || 0, v = r.millisecond || 0;
          return i ? new Date(Date.UTC(m, h, a, j, l, y, v)) : new Date(m, h, a, j, l, y, v);
        }
        return o;
      }, S = e.parse;
      e.parse = function(t) {
        t.date = w.bind(this)(t), S.bind(this)(t);
      };
      var p = e.set, s = e.add, $ = e.subtract, d = function(t, n, o, i) {
        i === void 0 && (i = 1);
        var r = Object.keys(n), u = this;
        return r.forEach(function(a) {
          u = t.bind(u)(n[a] * i, a);
        }), u;
      };
      e.set = function(t, n) {
        return n = n === void 0 ? t : n, t.constructor.name === "Object" ? d.bind(this)(function(o, i) {
          return p.bind(this)(i, o);
        }, n, t) : p.bind(this)(t, n);
      }, e.add = function(t, n) {
        return t.constructor.name === "Object" ? d.bind(this)(s, t, n) : s.bind(this)(t, n);
      }, e.subtract = function(t, n) {
        return t.constructor.name === "Object" ? d.bind(this)(s, t, n, -1) : $.bind(this)(t, n);
      };
    };
  });
})(D);
var _ = D.exports;
const T = /* @__PURE__ */ C(_);
export {
  T as default
};
