import p from "./index-classCallCheck.js";
import f from "./index-createClass.js";
import u from "./index-assertThisInitialized.js";
import h from "./index-inherits.js";
import L from "./index-createSuper.js";
import l from "./index-defineProperty.js";
import { Parser as d } from "./index-Parser4.js";
import { numericPatterns as v } from "./index-constants4.js";
import { mapValue as s, parseNDigits as w, parseNumericPattern as b } from "./index-utils12.js";
var D = /* @__PURE__ */ (function(m) {
  h(o, m);
  var i = L(o);
  function o() {
    var n;
    p(this, o);
    for (var r = arguments.length, e = new Array(r), t = 0; t < r; t++)
      e[t] = arguments[t];
    return n = i.call.apply(i, [this].concat(e)), l(u(n), "priority", 110), l(u(n), "incompatibleTokens", ["Y", "R", "q", "Q", "M", "w", "I", "D", "i", "e", "c", "t", "T"]), n;
  }
  return f(o, [{
    key: "parse",
    value: function(r, e, t) {
      var a = function(c) {
        return c - 1;
      };
      switch (e) {
        // 1, 2, ..., 12
        case "L":
          return s(b(v.month, r), a);
        // 01, 02, ..., 12
        case "LL":
          return s(w(2, r), a);
        // 1st, 2nd, ..., 12th
        case "Lo":
          return s(t.ordinalNumber(r, {
            unit: "month"
          }), a);
        // Jan, Feb, ..., Dec
        case "LLL":
          return t.month(r, {
            width: "abbreviated",
            context: "standalone"
          }) || t.month(r, {
            width: "narrow",
            context: "standalone"
          });
        // J, F, ..., D
        case "LLLLL":
          return t.month(r, {
            width: "narrow",
            context: "standalone"
          });
        // January, February, ..., December
        case "LLLL":
        default:
          return t.month(r, {
            width: "wide",
            context: "standalone"
          }) || t.month(r, {
            width: "abbreviated",
            context: "standalone"
          }) || t.month(r, {
            width: "narrow",
            context: "standalone"
          });
      }
    }
  }, {
    key: "validate",
    value: function(r, e) {
      return e >= 0 && e <= 11;
    }
  }, {
    key: "set",
    value: function(r, e, t) {
      return r.setUTCMonth(t, 1), r.setUTCHours(0, 0, 0, 0), r;
    }
  }]), o;
})(d);
export {
  D as StandAloneMonthParser
};
