import f from "./index-classCallCheck.js";
import m from "./index-createClass.js";
import n from "./index-assertThisInitialized.js";
import u from "./index-inherits.js";
import c from "./index-createSuper.js";
import s from "./index-defineProperty.js";
import { Parser as p } from "./index-Parser4.js";
import { dayPeriodEnumToHours as B } from "./index-utils12.js";
var T = /* @__PURE__ */ (function(d) {
  u(o, d);
  var a = c(o);
  function o() {
    var e;
    f(this, o);
    for (var t = arguments.length, i = new Array(t), r = 0; r < t; r++)
      i[r] = arguments[r];
    return e = a.call.apply(a, [this].concat(i)), s(n(e), "priority", 80), s(n(e), "incompatibleTokens", ["a", "b", "t", "T"]), e;
  }
  return m(o, [{
    key: "parse",
    value: function(t, i, r) {
      switch (i) {
        case "B":
        case "BB":
        case "BBB":
          return r.dayPeriod(t, {
            width: "abbreviated",
            context: "formatting"
          }) || r.dayPeriod(t, {
            width: "narrow",
            context: "formatting"
          });
        case "BBBBB":
          return r.dayPeriod(t, {
            width: "narrow",
            context: "formatting"
          });
        case "BBBB":
        default:
          return r.dayPeriod(t, {
            width: "wide",
            context: "formatting"
          }) || r.dayPeriod(t, {
            width: "abbreviated",
            context: "formatting"
          }) || r.dayPeriod(t, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
  }, {
    key: "set",
    value: function(t, i, r) {
      return t.setUTCHours(B(r), 0, 0, 0), t;
    }
  }]), o;
})(p);
export {
  T as DayPeriodParser
};
