import u from "./index-classCallCheck.js";
import E from "./index-createClass.js";
import n from "./index-assertThisInitialized.js";
import m from "./index-inherits.js";
import p from "./index-createSuper.js";
import s from "./index-defineProperty.js";
import { Parser as d } from "./index-Parser4.js";
import w from "./index-setUTCDay.js";
var T = /* @__PURE__ */ (function(f) {
  m(a, f);
  var i = p(a);
  function a() {
    var e;
    u(this, a);
    for (var r = arguments.length, o = new Array(r), t = 0; t < r; t++)
      o[t] = arguments[t];
    return e = i.call.apply(i, [this].concat(o)), s(n(e), "priority", 90), s(n(e), "incompatibleTokens", ["D", "i", "e", "c", "t", "T"]), e;
  }
  return E(a, [{
    key: "parse",
    value: function(r, o, t) {
      switch (o) {
        // Tue
        case "E":
        case "EE":
        case "EEE":
          return t.day(r, {
            width: "abbreviated",
            context: "formatting"
          }) || t.day(r, {
            width: "short",
            context: "formatting"
          }) || t.day(r, {
            width: "narrow",
            context: "formatting"
          });
        // T
        case "EEEEE":
          return t.day(r, {
            width: "narrow",
            context: "formatting"
          });
        // Tu
        case "EEEEEE":
          return t.day(r, {
            width: "short",
            context: "formatting"
          }) || t.day(r, {
            width: "narrow",
            context: "formatting"
          });
        // Tuesday
        case "EEEE":
        default:
          return t.day(r, {
            width: "wide",
            context: "formatting"
          }) || t.day(r, {
            width: "abbreviated",
            context: "formatting"
          }) || t.day(r, {
            width: "short",
            context: "formatting"
          }) || t.day(r, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
  }, {
    key: "validate",
    value: function(r, o) {
      return o >= 0 && o <= 6;
    }
  }, {
    key: "set",
    value: function(r, o, t, c) {
      return r = w(r, t, c), r.setUTCHours(0, 0, 0, 0), r;
    }
  }]), a;
})(d);
export {
  T as DayParser
};
