import { g as wt } from "./_commonjsHelpers-ByX85dGu.js";
import { p as gt } from "./index-xuotMAFm.js";
var xt = {}, bt, $t;
function _t() {
  if ($t) return bt;
  $t = 1;
  const g = "\\\\/", y = `[^${g}]`, K = 0, L = "\\.", X = "\\+", i = "\\?", o = "\\/", l = "(?=.)", A = "[^/]", O = `(?:${o}|$)`, d = `(?:^|${o})`, B = `${L}{1,2}${O}`, P = `(?!${L})`, T = `(?!${d}${B})`, G = `(?!${L}{0,1}${O})`, ut = `(?!${B})`, Q = `[^.${o}]`, z = `${A}*?`, c = {
    DOT_LITERAL: L,
    PLUS_LITERAL: X,
    QMARK_LITERAL: i,
    SLASH_LITERAL: o,
    ONE_CHAR: l,
    QMARK: A,
    END_ANCHOR: O,
    DOTS_SLASH: B,
    NO_DOT: P,
    NO_DOTS: T,
    NO_DOT_SLASH: G,
    NO_DOTS_SLASH: ut,
    QMARK_NO_DOT: Q,
    STAR: z,
    START_ANCHOR: d,
    SEP: "/"
  }, r = {
    ...c,
    SLASH_LITERAL: `[${g}]`,
    QMARK: y,
    STAR: `${y}*?`,
    DOTS_SLASH: `${L}{1,2}(?:[${g}]|$)`,
    NO_DOT: `(?!${L})`,
    NO_DOTS: `(?!(?:^|[${g}])${L}{1,2}(?:[${g}]|$))`,
    NO_DOT_SLASH: `(?!${L}{0,1}(?:[${g}]|$))`,
    NO_DOTS_SLASH: `(?!${L}{1,2}(?:[${g}]|$))`,
    QMARK_NO_DOT: `[^.${g}]`,
    START_ANCHOR: `(?:^|[${g}])`,
    END_ANCHOR: `(?:[${g}]|$)`,
    SEP: "\\"
  }, p = {
    __proto__: null,
    alnum: "a-zA-Z0-9",
    alpha: "a-zA-Z",
    ascii: "\\x00-\\x7F",
    blank: " \\t",
    cntrl: "\\x00-\\x1F\\x7F",
    digit: "0-9",
    graph: "\\x21-\\x7E",
    lower: "a-z",
    print: "\\x20-\\x7E ",
    punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
    space: " \\t\\r\\n\\v\\f",
    upper: "A-Z",
    word: "A-Za-z0-9_",
    xdigit: "A-Fa-f0-9"
  };
  return bt = {
    DEFAULT_MAX_EXTGLOB_RECURSION: K,
    MAX_LENGTH: 1024 * 64,
    POSIX_REGEX_SOURCE: p,
    // regular expressions
    REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
    REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
    REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
    REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
    REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
    REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
    // Replace globs with equivalent patterns to reduce parsing time.
    REPLACEMENTS: {
      __proto__: null,
      "***": "*",
      "**/**": "**",
      "**/**/**": "**"
    },
    // Digits
    CHAR_0: 48,
    /* 0 */
    CHAR_9: 57,
    /* 9 */
    // Alphabet chars.
    CHAR_UPPERCASE_A: 65,
    /* A */
    CHAR_LOWERCASE_A: 97,
    /* a */
    CHAR_UPPERCASE_Z: 90,
    /* Z */
    CHAR_LOWERCASE_Z: 122,
    /* z */
    CHAR_LEFT_PARENTHESES: 40,
    /* ( */
    CHAR_RIGHT_PARENTHESES: 41,
    /* ) */
    CHAR_ASTERISK: 42,
    /* * */
    // Non-alphabetic chars.
    CHAR_AMPERSAND: 38,
    /* & */
    CHAR_AT: 64,
    /* @ */
    CHAR_BACKWARD_SLASH: 92,
    /* \ */
    CHAR_CARRIAGE_RETURN: 13,
    /* \r */
    CHAR_CIRCUMFLEX_ACCENT: 94,
    /* ^ */
    CHAR_COLON: 58,
    /* : */
    CHAR_COMMA: 44,
    /* , */
    CHAR_DOT: 46,
    /* . */
    CHAR_DOUBLE_QUOTE: 34,
    /* " */
    CHAR_EQUAL: 61,
    /* = */
    CHAR_EXCLAMATION_MARK: 33,
    /* ! */
    CHAR_FORM_FEED: 12,
    /* \f */
    CHAR_FORWARD_SLASH: 47,
    /* / */
    CHAR_GRAVE_ACCENT: 96,
    /* ` */
    CHAR_HASH: 35,
    /* # */
    CHAR_HYPHEN_MINUS: 45,
    /* - */
    CHAR_LEFT_ANGLE_BRACKET: 60,
    /* < */
    CHAR_LEFT_CURLY_BRACE: 123,
    /* { */
    CHAR_LEFT_SQUARE_BRACKET: 91,
    /* [ */
    CHAR_LINE_FEED: 10,
    /* \n */
    CHAR_NO_BREAK_SPACE: 160,
    /* \u00A0 */
    CHAR_PERCENT: 37,
    /* % */
    CHAR_PLUS: 43,
    /* + */
    CHAR_QUESTION_MARK: 63,
    /* ? */
    CHAR_RIGHT_ANGLE_BRACKET: 62,
    /* > */
    CHAR_RIGHT_CURLY_BRACE: 125,
    /* } */
    CHAR_RIGHT_SQUARE_BRACKET: 93,
    /* ] */
    CHAR_SEMICOLON: 59,
    /* ; */
    CHAR_SINGLE_QUOTE: 39,
    /* ' */
    CHAR_SPACE: 32,
    /*   */
    CHAR_TAB: 9,
    /* \t */
    CHAR_UNDERSCORE: 95,
    /* _ */
    CHAR_VERTICAL_LINE: 124,
    /* | */
    CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
    /* \uFEFF */
    /**
     * Create EXTGLOB_CHARS
     */
    extglobChars(f) {
      return {
        "!": { type: "negate", open: "(?:(?!(?:", close: `))${f.STAR})` },
        "?": { type: "qmark", open: "(?:", close: ")?" },
        "+": { type: "plus", open: "(?:", close: ")+" },
        "*": { type: "star", open: "(?:", close: ")*" },
        "@": { type: "at", open: "(?:", close: ")" }
      };
    },
    /**
     * Create GLOB_CHARS
     */
    globChars(f) {
      return f === !0 ? r : c;
    }
  }, bt;
}
var Ht;
function Et() {
  return Ht || (Ht = 1, (function(g) {
    const {
      REGEX_BACKSLASH: y,
      REGEX_REMOVE_BACKSLASH: K,
      REGEX_SPECIAL_CHARS: L,
      REGEX_SPECIAL_CHARS_GLOBAL: X
    } = /* @__PURE__ */ _t();
    g.isObject = (i) => i !== null && typeof i == "object" && !Array.isArray(i), g.hasRegexChars = (i) => L.test(i), g.isRegexChar = (i) => i.length === 1 && g.hasRegexChars(i), g.escapeRegex = (i) => i.replace(X, "\\$1"), g.toPosixSlashes = (i) => i.replace(y, "/"), g.isWindows = () => {
      if (typeof navigator < "u" && navigator.platform) {
        const i = navigator.platform.toLowerCase();
        return i === "win32" || i === "windows";
      }
      return typeof gt < "u" && gt.platform ? gt.platform === "win32" : !1;
    }, g.removeBackslashes = (i) => i.replace(K, (o) => o === "\\" ? "" : o), g.escapeLast = (i, o, l) => {
      const A = i.lastIndexOf(o, l);
      return A === -1 ? i : i[A - 1] === "\\" ? g.escapeLast(i, o, A - 1) : `${i.slice(0, A)}\\${i.slice(A)}`;
    }, g.removePrefix = (i, o = {}) => {
      let l = i;
      return l.startsWith("./") && (l = l.slice(2), o.prefix = "./"), l;
    }, g.wrapOutput = (i, o = {}, l = {}) => {
      const A = l.contains ? "" : "^", O = l.contains ? "" : "$";
      let d = `${A}(?:${i})${O}`;
      return o.negated === !0 && (d = `(?:^(?!${d}).*$)`), d;
    }, g.basename = (i, { windows: o } = {}) => {
      const l = i.split(o ? /[\\/]/ : "/"), A = l[l.length - 1];
      return A === "" ? l[l.length - 2] : A;
    };
  })(xt)), xt;
}
var dt, mt;
function kt() {
  if (mt) return dt;
  mt = 1;
  const g = /* @__PURE__ */ Et(), {
    CHAR_ASTERISK: y,
    /* * */
    CHAR_AT: K,
    /* @ */
    CHAR_BACKWARD_SLASH: L,
    /* \ */
    CHAR_COMMA: X,
    /* , */
    CHAR_DOT: i,
    /* . */
    CHAR_EXCLAMATION_MARK: o,
    /* ! */
    CHAR_FORWARD_SLASH: l,
    /* / */
    CHAR_LEFT_CURLY_BRACE: A,
    /* { */
    CHAR_LEFT_PARENTHESES: O,
    /* ( */
    CHAR_LEFT_SQUARE_BRACKET: d,
    /* [ */
    CHAR_PLUS: B,
    /* + */
    CHAR_QUESTION_MARK: P,
    /* ? */
    CHAR_RIGHT_CURLY_BRACE: T,
    /* } */
    CHAR_RIGHT_PARENTHESES: G,
    /* ) */
    CHAR_RIGHT_SQUARE_BRACKET: ut
    /* ] */
  } = /* @__PURE__ */ _t(), Q = (c) => c === l || c === L, z = (c) => {
    c.isPrefix !== !0 && (c.depth = c.isGlobstar ? 1 / 0 : 1);
  };
  return dt = (c, r) => {
    const p = r || {}, f = c.length - 1, R = p.parts === !0 || p.scanToEnd === !0, E = [], _ = [], ot = [];
    let q = c, D = -1, M = 0, W = 0, V = !1, Y = !1, k = !1, at = !1, it = !1, C = !1, j = !1, lt = !1, ft = !1, v = !1, Z = 0, st, h, t = { value: "", depth: 0, isGlob: !1 };
    const U = () => D >= f, et = () => q.charCodeAt(D + 1), F = () => (st = h, q.charCodeAt(++D));
    for (; D < f; ) {
      h = F();
      let I;
      if (h === L) {
        j = t.backslashes = !0, h = F(), h === A && (C = !0);
        continue;
      }
      if (C === !0 || h === A) {
        for (Z++; U() !== !0 && (h = F()); ) {
          if (h === L) {
            j = t.backslashes = !0, F();
            continue;
          }
          if (h === A) {
            Z++;
            continue;
          }
          if (C !== !0 && h === i && (h = F()) === i) {
            if (V = t.isBrace = !0, k = t.isGlob = !0, v = !0, R === !0)
              continue;
            break;
          }
          if (C !== !0 && h === X) {
            if (V = t.isBrace = !0, k = t.isGlob = !0, v = !0, R === !0)
              continue;
            break;
          }
          if (h === T && (Z--, Z === 0)) {
            C = !1, V = t.isBrace = !0, v = !0;
            break;
          }
        }
        if (R === !0)
          continue;
        break;
      }
      if (h === l) {
        if (E.push(D), _.push(t), t = { value: "", depth: 0, isGlob: !1 }, v === !0) continue;
        if (st === i && D === M + 1) {
          M += 2;
          continue;
        }
        W = D + 1;
        continue;
      }
      if (p.noext !== !0 && (h === B || h === K || h === y || h === P || h === o) === !0 && et() === O) {
        if (k = t.isGlob = !0, at = t.isExtglob = !0, v = !0, h === o && D === M && (ft = !0), R === !0) {
          for (; U() !== !0 && (h = F()); ) {
            if (h === L) {
              j = t.backslashes = !0, h = F();
              continue;
            }
            if (h === G) {
              k = t.isGlob = !0, v = !0;
              break;
            }
          }
          continue;
        }
        break;
      }
      if (h === y) {
        if (st === y && (it = t.isGlobstar = !0), k = t.isGlob = !0, v = !0, R === !0)
          continue;
        break;
      }
      if (h === P) {
        if (k = t.isGlob = !0, v = !0, R === !0)
          continue;
        break;
      }
      if (h === d) {
        for (; U() !== !0 && (I = F()); ) {
          if (I === L) {
            j = t.backslashes = !0, F();
            continue;
          }
          if (I === ut) {
            Y = t.isBracket = !0, k = t.isGlob = !0, v = !0;
            break;
          }
        }
        if (R === !0)
          continue;
        break;
      }
      if (p.nonegate !== !0 && h === o && D === M) {
        lt = t.negated = !0, M++;
        continue;
      }
      if (p.noparen !== !0 && h === O) {
        if (k = t.isGlob = !0, R === !0) {
          for (; U() !== !0 && (h = F()); ) {
            if (h === O) {
              j = t.backslashes = !0, h = F();
              continue;
            }
            if (h === G) {
              v = !0;
              break;
            }
          }
          continue;
        }
        break;
      }
      if (k === !0) {
        if (v = !0, R === !0)
          continue;
        break;
      }
    }
    p.noext === !0 && (at = !1, k = !1);
    let e = q, n = "", J = "";
    M > 0 && (n = q.slice(0, M), q = q.slice(M), W -= M), e && k === !0 && W > 0 ? (e = q.slice(0, W), J = q.slice(W)) : k === !0 ? (e = "", J = q) : e = q, e && e !== "" && e !== "/" && e !== q && Q(e.charCodeAt(e.length - 1)) && (e = e.slice(0, -1)), p.unescape === !0 && (J && (J = g.removeBackslashes(J)), e && j === !0 && (e = g.removeBackslashes(e)));
    const $ = {
      prefix: n,
      input: c,
      start: M,
      base: e,
      glob: J,
      isBrace: V,
      isBracket: Y,
      isGlob: k,
      isExtglob: at,
      isGlobstar: it,
      negated: lt,
      negatedExtglob: ft
    };
    if (p.tokens === !0 && ($.maxDepth = 0, Q(h) || _.push(t), $.tokens = _), p.parts === !0 || p.tokens === !0) {
      let I;
      for (let w = 0; w < E.length; w++) {
        const tt = I ? I + 1 : M, pt = E[w], ht = c.slice(tt, pt);
        p.tokens && (w === 0 && M !== 0 ? (_[w].isPrefix = !0, _[w].value = n) : _[w].value = ht, z(_[w]), $.maxDepth += _[w].depth), (w !== 0 || ht !== "") && ot.push(ht), I = pt;
      }
      if (I && I + 1 < c.length) {
        const w = c.slice(I + 1);
        ot.push(w), p.tokens && (_[_.length - 1].value = w, z(_[_.length - 1]), $.maxDepth += _[_.length - 1].depth);
      }
      $.slashes = E, $.parts = ot;
    }
    return $;
  }, dt;
}
var yt, Lt;
function It() {
  if (Lt) return yt;
  Lt = 1;
  const g = /* @__PURE__ */ _t(), y = /* @__PURE__ */ Et(), {
    MAX_LENGTH: K,
    POSIX_REGEX_SOURCE: L,
    REGEX_NON_SPECIAL_CHARS: X,
    REGEX_SPECIAL_CHARS_BACKREF: i,
    REPLACEMENTS: o
  } = g, l = (a, c) => {
    if (typeof c.expandRange == "function")
      return c.expandRange(...a, c);
    a.sort();
    const r = `[${a.join("-")}]`;
    try {
      new RegExp(r);
    } catch {
      return a.map((f) => y.escapeRegex(f)).join("..");
    }
    return r;
  }, A = (a, c) => `Missing ${a}: "${c}" - use "\\\\${c}" to match literal characters`, O = (a) => {
    const c = [];
    let r = 0, p = 0, f = 0, R = "", E = !1;
    for (const _ of a) {
      if (E === !0) {
        R += _, E = !1;
        continue;
      }
      if (_ === "\\") {
        R += _, E = !0;
        continue;
      }
      if (_ === '"') {
        f = f === 1 ? 0 : 1, R += _;
        continue;
      }
      if (f === 0) {
        if (_ === "[")
          r++;
        else if (_ === "]" && r > 0)
          r--;
        else if (r === 0) {
          if (_ === "(")
            p++;
          else if (_ === ")" && p > 0)
            p--;
          else if (_ === "|" && p === 0) {
            c.push(R), R = "";
            continue;
          }
        }
      }
      R += _;
    }
    return c.push(R), c;
  }, d = (a) => {
    let c = !1;
    for (const r of a) {
      if (c === !0) {
        c = !1;
        continue;
      }
      if (r === "\\") {
        c = !0;
        continue;
      }
      if (/[?*+@!()[\]{}]/.test(r))
        return !1;
    }
    return !0;
  }, B = (a) => {
    let c = a.trim(), r = !0;
    for (; r === !0; )
      r = !1, /^@\([^\\()[\]{}|]+\)$/.test(c) && (c = c.slice(2, -1), r = !0);
    if (d(c))
      return c.replace(/\\(.)/g, "$1");
  }, P = (a) => {
    const c = a.map(B).filter(Boolean);
    for (let r = 0; r < c.length; r++)
      for (let p = r + 1; p < c.length; p++) {
        const f = c[r], R = c[p], E = f[0];
        if (!(!E || f !== E.repeat(f.length) || R !== E.repeat(R.length)) && (f === R || f.startsWith(R) || R.startsWith(f)))
          return !0;
      }
    return !1;
  }, T = (a, c = !0) => {
    if (a[0] !== "+" && a[0] !== "*" || a[1] !== "(")
      return;
    let r = 0, p = 0, f = 0, R = !1;
    for (let E = 1; E < a.length; E++) {
      const _ = a[E];
      if (R === !0) {
        R = !1;
        continue;
      }
      if (_ === "\\") {
        R = !0;
        continue;
      }
      if (_ === '"') {
        f = f === 1 ? 0 : 1;
        continue;
      }
      if (f !== 1) {
        if (_ === "[") {
          r++;
          continue;
        }
        if (_ === "]" && r > 0) {
          r--;
          continue;
        }
        if (!(r > 0)) {
          if (_ === "(") {
            p++;
            continue;
          }
          if (_ === ")" && (p--, p === 0))
            return c === !0 && E !== a.length - 1 ? void 0 : {
              type: a[0],
              body: a.slice(2, E),
              end: E
            };
        }
      }
    }
  }, G = (a) => {
    let c = 0;
    const r = [];
    for (; c < a.length; ) {
      const f = T(a.slice(c), !1);
      if (!f || f.type !== "*")
        return;
      const R = O(f.body).map((_) => _.trim());
      if (R.length !== 1)
        return;
      const E = B(R[0]);
      if (!E || E.length !== 1)
        return;
      r.push(E), c += f.end + 1;
    }
    return r.length < 1 ? void 0 : `${r.length === 1 ? y.escapeRegex(r[0]) : `[${r.map((f) => y.escapeRegex(f)).join("")}]`}*`;
  }, ut = (a) => {
    let c = 0, r = a.trim(), p = T(r);
    for (; p; )
      c++, r = p.body.trim(), p = T(r);
    return c;
  }, Q = (a, c) => {
    if (c.maxExtglobRecursion === !1)
      return { risky: !1 };
    const r = typeof c.maxExtglobRecursion == "number" ? c.maxExtglobRecursion : g.DEFAULT_MAX_EXTGLOB_RECURSION, p = O(a).map((f) => f.trim());
    if (p.length > 1 && (p.some((f) => f === "") || p.some((f) => /^[*?]+$/.test(f)) || P(p)))
      return { risky: !0 };
    for (const f of p) {
      const R = G(f);
      if (R)
        return { risky: !0, safeOutput: R };
      if (ut(f) > r)
        return { risky: !0 };
    }
    return { risky: !1 };
  }, z = (a, c) => {
    if (typeof a != "string")
      throw new TypeError("Expected a string");
    a = o[a] || a;
    const r = { ...c }, p = typeof r.maxLength == "number" ? Math.min(K, r.maxLength) : K;
    let f = a.length;
    if (f > p)
      throw new SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${p}`);
    const R = { type: "bos", value: "", output: r.prepend || "" }, E = [R], _ = r.capture ? "" : "?:", ot = g.globChars(r.windows), q = g.extglobChars(ot), {
      DOT_LITERAL: D,
      PLUS_LITERAL: M,
      SLASH_LITERAL: W,
      ONE_CHAR: V,
      DOTS_SLASH: Y,
      NO_DOT: k,
      NO_DOT_SLASH: at,
      NO_DOTS_SLASH: it,
      QMARK: C,
      QMARK_NO_DOT: j,
      STAR: lt,
      START_ANCHOR: ft
    } = ot, v = (u) => `(${_}(?:(?!${ft}${u.dot ? Y : D}).)*?)`, Z = r.dot ? "" : k, st = r.dot ? C : j;
    let h = r.bash === !0 ? v(r) : lt;
    r.capture && (h = `(${h})`), typeof r.noext == "boolean" && (r.noextglob = r.noext);
    const t = {
      input: a,
      index: -1,
      start: 0,
      dot: r.dot === !0,
      consumed: "",
      output: "",
      prefix: "",
      backtrack: !1,
      negated: !1,
      brackets: 0,
      braces: 0,
      parens: 0,
      quotes: 0,
      globstar: !1,
      tokens: E
    };
    a = y.removePrefix(a, t), f = a.length;
    const U = [], et = [], F = [];
    let e = R, n;
    const J = () => t.index === f - 1, $ = t.peek = (u = 1) => a[t.index + u], I = t.advance = () => a[++t.index] || "", w = () => a.slice(t.index + 1), tt = (u = "", m = 0) => {
      t.consumed += u, t.index += m;
    }, pt = (u) => {
      t.output += u.output != null ? u.output : u.value, tt(u.value);
    }, ht = () => {
      let u = 1;
      for (; $() === "!" && ($(2) !== "(" || $(3) === "?"); )
        I(), t.start++, u++;
      return u % 2 === 0 ? !1 : (t.negated = !0, t.start++, !0);
    }, At = (u) => {
      t[u]++, F.push(u);
    }, ct = (u) => {
      t[u]--, F.pop();
    }, x = (u) => {
      if (e.type === "globstar") {
        const m = t.braces > 0 && (u.type === "comma" || u.type === "brace"), s = u.extglob === !0 || U.length && (u.type === "pipe" || u.type === "paren");
        u.type !== "slash" && u.type !== "paren" && !m && !s && (t.output = t.output.slice(0, -e.output.length), e.type = "star", e.value = "*", e.output = h, t.output += e.output);
      }
      if (U.length && u.type !== "paren" && (U[U.length - 1].inner += u.value), (u.value || u.output) && pt(u), e && e.type === "text" && u.type === "text") {
        e.output = (e.output || e.value) + u.value, e.value += u.value;
        return;
      }
      u.prev = e, E.push(u), e = u;
    }, Rt = (u, m) => {
      const s = { ...q[m], conditions: 1, inner: "" };
      s.prev = e, s.parens = t.parens, s.output = t.output, s.startIndex = t.index, s.tokensIndex = E.length;
      const b = (r.capture ? "(" : "") + s.open;
      At("parens"), x({ type: u, value: m, output: t.output ? "" : V }), x({ type: "paren", extglob: !0, value: I(), output: b }), U.push(s);
    }, vt = (u) => {
      const m = a.slice(u.startIndex, t.index + 1), s = a.slice(u.startIndex + 2, t.index), b = Q(s, r);
      if ((u.type === "plus" || u.type === "star") && b.risky) {
        const S = b.safeOutput ? (u.output ? "" : V) + (r.capture ? `(${b.safeOutput})` : b.safeOutput) : void 0, rt = E[u.tokensIndex];
        rt.type = "text", rt.value = m, rt.output = S || y.escapeRegex(m);
        for (let nt = u.tokensIndex + 1; nt < E.length; nt++)
          E[nt].value = "", E[nt].output = "", delete E[nt].suffix;
        t.output = u.output + rt.output, t.backtrack = !0, x({ type: "paren", extglob: !0, value: n, output: "" }), ct("parens");
        return;
      }
      let H = u.close + (r.capture ? ")" : ""), N;
      if (u.type === "negate") {
        let S = h;
        if (u.inner && u.inner.length > 1 && u.inner.includes("/") && (S = v(r)), (S !== h || J() || /^\)+$/.test(w())) && (H = u.close = `)$))${S}`), u.inner.includes("*") && (N = w()) && /^\.[^\\/.]+$/.test(N)) {
          const rt = z(N, { ...c, fastpaths: !1 }).output;
          H = u.close = `)${rt})${S})`;
        }
        u.prev.type === "bos" && (t.negatedExtglob = !0);
      }
      x({ type: "paren", extglob: !0, value: n, output: H }), ct("parens");
    };
    if (r.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(a)) {
      let u = !1, m = a.replace(i, (s, b, H, N, S, rt) => N === "\\" ? (u = !0, s) : N === "?" ? b ? b + N + (S ? C.repeat(S.length) : "") : rt === 0 ? st + (S ? C.repeat(S.length) : "") : C.repeat(H.length) : N === "." ? D.repeat(H.length) : N === "*" ? b ? b + N + (S ? h : "") : h : b ? s : `\\${s}`);
      return u === !0 && (r.unescape === !0 ? m = m.replace(/\\/g, "") : m = m.replace(/\\+/g, (s) => s.length % 2 === 0 ? "\\\\" : s ? "\\" : "")), m === a && r.contains === !0 ? (t.output = a, t) : (t.output = y.wrapOutput(m, t, c), t);
    }
    for (; !J(); ) {
      if (n = I(), n === "\0")
        continue;
      if (n === "\\") {
        const s = $();
        if (s === "/" && r.bash !== !0 || s === "." || s === ";")
          continue;
        if (!s) {
          n += "\\", x({ type: "text", value: n });
          continue;
        }
        const b = /^\\+/.exec(w());
        let H = 0;
        if (b && b[0].length > 2 && (H = b[0].length, t.index += H, H % 2 !== 0 && (n += "\\")), r.unescape === !0 ? n = I() : n += I(), t.brackets === 0) {
          x({ type: "text", value: n });
          continue;
        }
      }
      if (t.brackets > 0 && (n !== "]" || e.value === "[" || e.value === "[^")) {
        if (r.posix !== !1 && n === ":") {
          const s = e.value.slice(1);
          if (s.includes("[") && (e.posix = !0, s.includes(":"))) {
            const b = e.value.lastIndexOf("["), H = e.value.slice(0, b), N = e.value.slice(b + 2), S = L[N];
            if (S) {
              e.value = H + S, t.backtrack = !0, I(), !R.output && E.indexOf(e) === 1 && (R.output = V);
              continue;
            }
          }
        }
        (n === "[" && $() !== ":" || n === "-" && $() === "]") && (n = `\\${n}`), n === "]" && (e.value === "[" || e.value === "[^") && (n = `\\${n}`), r.posix === !0 && n === "!" && e.value === "[" && (n = "^"), e.value += n, pt({ value: n });
        continue;
      }
      if (t.quotes === 1 && n !== '"') {
        n = y.escapeRegex(n), e.value += n, pt({ value: n });
        continue;
      }
      if (n === '"') {
        t.quotes = t.quotes === 1 ? 0 : 1, r.keepQuotes === !0 && x({ type: "text", value: n });
        continue;
      }
      if (n === "(") {
        At("parens"), x({ type: "paren", value: n });
        continue;
      }
      if (n === ")") {
        if (t.parens === 0 && r.strictBrackets === !0)
          throw new SyntaxError(A("opening", "("));
        const s = U[U.length - 1];
        if (s && t.parens === s.parens + 1) {
          vt(U.pop());
          continue;
        }
        x({ type: "paren", value: n, output: t.parens ? ")" : "\\)" }), ct("parens");
        continue;
      }
      if (n === "[") {
        if (r.nobracket === !0 || !w().includes("]")) {
          if (r.nobracket !== !0 && r.strictBrackets === !0)
            throw new SyntaxError(A("closing", "]"));
          n = `\\${n}`;
        } else
          At("brackets");
        x({ type: "bracket", value: n });
        continue;
      }
      if (n === "]") {
        if (r.nobracket === !0 || e && e.type === "bracket" && e.value.length === 1) {
          x({ type: "text", value: n, output: `\\${n}` });
          continue;
        }
        if (t.brackets === 0) {
          if (r.strictBrackets === !0)
            throw new SyntaxError(A("opening", "["));
          x({ type: "text", value: n, output: `\\${n}` });
          continue;
        }
        ct("brackets");
        const s = e.value.slice(1);
        if (e.posix !== !0 && s[0] === "^" && !s.includes("/") && (n = `/${n}`), e.value += n, pt({ value: n }), r.literalBrackets === !1 || y.hasRegexChars(s))
          continue;
        const b = y.escapeRegex(e.value);
        if (t.output = t.output.slice(0, -e.value.length), r.literalBrackets === !0) {
          t.output += b, e.value = b;
          continue;
        }
        e.value = `(${_}${b}|${e.value})`, t.output += e.value;
        continue;
      }
      if (n === "{" && r.nobrace !== !0) {
        At("braces");
        const s = {
          type: "brace",
          value: n,
          output: "(",
          outputIndex: t.output.length,
          tokensIndex: t.tokens.length
        };
        et.push(s), x(s);
        continue;
      }
      if (n === "}") {
        const s = et[et.length - 1];
        if (r.nobrace === !0 || !s) {
          x({ type: "text", value: n, output: n });
          continue;
        }
        let b = ")";
        if (s.dots === !0) {
          const H = E.slice(), N = [];
          for (let S = H.length - 1; S >= 0 && (E.pop(), H[S].type !== "brace"); S--)
            H[S].type !== "dots" && N.unshift(H[S].value);
          b = l(N, r), t.backtrack = !0;
        }
        if (s.comma !== !0 && s.dots !== !0) {
          const H = t.output.slice(0, s.outputIndex), N = t.tokens.slice(s.tokensIndex);
          s.value = s.output = "\\{", n = b = "\\}", t.output = H;
          for (const S of N)
            t.output += S.output || S.value;
        }
        x({ type: "brace", value: n, output: b }), ct("braces"), et.pop();
        continue;
      }
      if (n === "|") {
        U.length > 0 && U[U.length - 1].conditions++, x({ type: "text", value: n });
        continue;
      }
      if (n === ",") {
        let s = n;
        const b = et[et.length - 1];
        b && F[F.length - 1] === "braces" && (b.comma = !0, s = "|"), x({ type: "comma", value: n, output: s });
        continue;
      }
      if (n === "/") {
        if (e.type === "dot" && t.index === t.start + 1) {
          t.start = t.index + 1, t.consumed = "", t.output = "", E.pop(), e = R;
          continue;
        }
        x({ type: "slash", value: n, output: W });
        continue;
      }
      if (n === ".") {
        if (t.braces > 0 && e.type === "dot") {
          e.value === "." && (e.output = D);
          const s = et[et.length - 1];
          e.type = "dots", e.output += n, e.value += n, s.dots = !0;
          continue;
        }
        if (t.braces + t.parens === 0 && e.type !== "bos" && e.type !== "slash") {
          x({ type: "text", value: n, output: D });
          continue;
        }
        x({ type: "dot", value: n, output: D });
        continue;
      }
      if (n === "?") {
        if (!(e && e.value === "(") && r.noextglob !== !0 && $() === "(" && $(2) !== "?") {
          Rt("qmark", n);
          continue;
        }
        if (e && e.type === "paren") {
          const b = $();
          let H = n;
          (e.value === "(" && !/[!=<:]/.test(b) || b === "<" && !/<([!=]|\w+>)/.test(w())) && (H = `\\${n}`), x({ type: "text", value: n, output: H });
          continue;
        }
        if (r.dot !== !0 && (e.type === "slash" || e.type === "bos")) {
          x({ type: "qmark", value: n, output: j });
          continue;
        }
        x({ type: "qmark", value: n, output: C });
        continue;
      }
      if (n === "!") {
        if (r.noextglob !== !0 && $() === "(" && ($(2) !== "?" || !/[!=<:]/.test($(3)))) {
          Rt("negate", n);
          continue;
        }
        if (r.nonegate !== !0 && t.index === 0) {
          ht();
          continue;
        }
      }
      if (n === "+") {
        if (r.noextglob !== !0 && $() === "(" && $(2) !== "?") {
          Rt("plus", n);
          continue;
        }
        if (e && e.value === "(" || r.regex === !1) {
          x({ type: "plus", value: n, output: M });
          continue;
        }
        if (e && (e.type === "bracket" || e.type === "paren" || e.type === "brace") || t.parens > 0) {
          x({ type: "plus", value: n });
          continue;
        }
        x({ type: "plus", value: M });
        continue;
      }
      if (n === "@") {
        if (r.noextglob !== !0 && $() === "(" && $(2) !== "?") {
          x({ type: "at", extglob: !0, value: n, output: "" });
          continue;
        }
        x({ type: "text", value: n });
        continue;
      }
      if (n !== "*") {
        (n === "$" || n === "^") && (n = `\\${n}`);
        const s = X.exec(w());
        s && (n += s[0], t.index += s[0].length), x({ type: "text", value: n });
        continue;
      }
      if (e && (e.type === "globstar" || e.star === !0)) {
        e.type = "star", e.star = !0, e.value += n, e.output = h, t.backtrack = !0, t.globstar = !0, tt(n);
        continue;
      }
      let u = w();
      if (r.noextglob !== !0 && /^\([^?]/.test(u)) {
        Rt("star", n);
        continue;
      }
      if (e.type === "star") {
        if (r.noglobstar === !0) {
          tt(n);
          continue;
        }
        const s = e.prev, b = s.prev, H = s.type === "slash" || s.type === "bos", N = b && (b.type === "star" || b.type === "globstar");
        if (r.bash === !0 && (!H || u[0] && u[0] !== "/")) {
          x({ type: "star", value: n, output: "" });
          continue;
        }
        const S = t.braces > 0 && (s.type === "comma" || s.type === "brace"), rt = U.length && (s.type === "pipe" || s.type === "paren");
        if (!H && s.type !== "paren" && !S && !rt) {
          x({ type: "star", value: n, output: "" });
          continue;
        }
        for (; u.slice(0, 3) === "/**"; ) {
          const nt = a[t.index + 4];
          if (nt && nt !== "/")
            break;
          u = u.slice(3), tt("/**", 3);
        }
        if (s.type === "bos" && J()) {
          e.type = "globstar", e.value += n, e.output = v(r), t.output = e.output, t.globstar = !0, tt(n);
          continue;
        }
        if (s.type === "slash" && s.prev.type !== "bos" && !N && J()) {
          t.output = t.output.slice(0, -(s.output + e.output).length), s.output = `(?:${s.output}`, e.type = "globstar", e.output = v(r) + (r.strictSlashes ? ")" : "|$)"), e.value += n, t.globstar = !0, t.output += s.output + e.output, tt(n);
          continue;
        }
        if (s.type === "slash" && s.prev.type !== "bos" && u[0] === "/") {
          const nt = u[1] !== void 0 ? "|$" : "";
          t.output = t.output.slice(0, -(s.output + e.output).length), s.output = `(?:${s.output}`, e.type = "globstar", e.output = `${v(r)}${W}|${W}${nt})`, e.value += n, t.output += s.output + e.output, t.globstar = !0, tt(n + I()), x({ type: "slash", value: "/", output: "" });
          continue;
        }
        if (s.type === "bos" && u[0] === "/") {
          e.type = "globstar", e.value += n, e.output = `(?:^|${W}|${v(r)}${W})`, t.output = e.output, t.globstar = !0, tt(n + I()), x({ type: "slash", value: "/", output: "" });
          continue;
        }
        t.output = t.output.slice(0, -e.output.length), e.type = "globstar", e.output = v(r), e.value += n, t.output += e.output, t.globstar = !0, tt(n);
        continue;
      }
      const m = { type: "star", value: n, output: h };
      if (r.bash === !0) {
        m.output = ".*?", (e.type === "bos" || e.type === "slash") && (m.output = Z + m.output), x(m);
        continue;
      }
      if (e && (e.type === "bracket" || e.type === "paren") && r.regex === !0) {
        m.output = n, x(m);
        continue;
      }
      (t.index === t.start || e.type === "slash" || e.type === "dot") && (e.type === "dot" ? (t.output += at, e.output += at) : r.dot === !0 ? (t.output += it, e.output += it) : (t.output += Z, e.output += Z), $() !== "*" && (t.output += V, e.output += V)), x(m);
    }
    for (; t.brackets > 0; ) {
      if (r.strictBrackets === !0) throw new SyntaxError(A("closing", "]"));
      t.output = y.escapeLast(t.output, "["), ct("brackets");
    }
    for (; t.parens > 0; ) {
      if (r.strictBrackets === !0) throw new SyntaxError(A("closing", ")"));
      t.output = y.escapeLast(t.output, "("), ct("parens");
    }
    for (; t.braces > 0; ) {
      if (r.strictBrackets === !0) throw new SyntaxError(A("closing", "}"));
      t.output = y.escapeLast(t.output, "{"), ct("braces");
    }
    if (r.strictSlashes !== !0 && (e.type === "star" || e.type === "bracket") && x({ type: "maybe_slash", value: "", output: `${W}?` }), t.backtrack === !0) {
      t.output = "";
      for (const u of t.tokens)
        t.output += u.output != null ? u.output : u.value, u.suffix && (t.output += u.suffix);
    }
    return t;
  };
  return z.fastpaths = (a, c) => {
    const r = { ...c }, p = typeof r.maxLength == "number" ? Math.min(K, r.maxLength) : K, f = a.length;
    if (f > p)
      throw new SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${p}`);
    a = o[a] || a;
    const {
      DOT_LITERAL: R,
      SLASH_LITERAL: E,
      ONE_CHAR: _,
      DOTS_SLASH: ot,
      NO_DOT: q,
      NO_DOTS: D,
      NO_DOTS_SLASH: M,
      STAR: W,
      START_ANCHOR: V
    } = g.globChars(r.windows), Y = r.dot ? D : q, k = r.dot ? M : q, at = r.capture ? "" : "?:", it = { negated: !1, prefix: "" };
    let C = r.bash === !0 ? ".*?" : W;
    r.capture && (C = `(${C})`);
    const j = (Z) => Z.noglobstar === !0 ? C : `(${at}(?:(?!${V}${Z.dot ? ot : R}).)*?)`, lt = (Z) => {
      switch (Z) {
        case "*":
          return `${Y}${_}${C}`;
        case ".*":
          return `${R}${_}${C}`;
        case "*.*":
          return `${Y}${C}${R}${_}${C}`;
        case "*/*":
          return `${Y}${C}${E}${_}${k}${C}`;
        case "**":
          return Y + j(r);
        case "**/*":
          return `(?:${Y}${j(r)}${E})?${k}${_}${C}`;
        case "**/*.*":
          return `(?:${Y}${j(r)}${E})?${k}${C}${R}${_}${C}`;
        case "**/.*":
          return `(?:${Y}${j(r)}${E})?${R}${_}${C}`;
        default: {
          const st = /^(.*?)\.(\w+)$/.exec(Z);
          if (!st) return;
          const h = lt(st[1]);
          return h ? h + R + st[2] : void 0;
        }
      }
    }, ft = y.removePrefix(a, it);
    let v = lt(ft);
    return v && r.strictSlashes !== !0 && (v += `${E}?`), v;
  }, yt = z, yt;
}
var St, Ot;
function Nt() {
  if (Ot) return St;
  Ot = 1;
  const g = /* @__PURE__ */ kt(), y = /* @__PURE__ */ It(), K = /* @__PURE__ */ Et(), L = /* @__PURE__ */ _t(), X = (o) => o && typeof o == "object" && !Array.isArray(o), i = (o, l, A = !1) => {
    if (Array.isArray(o)) {
      const Q = o.map((a) => i(a, l, A));
      return (a) => {
        for (const c of Q) {
          const r = c(a);
          if (r) return r;
        }
        return !1;
      };
    }
    const O = X(o) && o.tokens && o.input;
    if (o === "" || typeof o != "string" && !O)
      throw new TypeError("Expected pattern to be a non-empty string");
    const d = l || {}, B = d.windows, P = O ? i.compileRe(o, l) : i.makeRe(o, l, !1, !0), T = P.state;
    delete P.state;
    let G = () => !1;
    if (d.ignore) {
      const Q = { ...l, ignore: null, onMatch: null, onResult: null };
      G = i(d.ignore, Q, A);
    }
    const ut = (Q, z = !1) => {
      const { isMatch: a, match: c, output: r } = i.test(Q, P, l, { glob: o, posix: B }), p = { glob: o, state: T, regex: P, posix: B, input: Q, output: r, match: c, isMatch: a };
      return typeof d.onResult == "function" && d.onResult(p), a === !1 ? (p.isMatch = !1, z ? p : !1) : G(Q) ? (typeof d.onIgnore == "function" && d.onIgnore(p), p.isMatch = !1, z ? p : !1) : (typeof d.onMatch == "function" && d.onMatch(p), z ? p : !0);
    };
    return A && (ut.state = T), ut;
  };
  return i.test = (o, l, A, { glob: O, posix: d } = {}) => {
    if (typeof o != "string")
      throw new TypeError("Expected input to be a string");
    if (o === "")
      return { isMatch: !1, output: "" };
    const B = A || {}, P = B.format || (d ? K.toPosixSlashes : null);
    let T = o === O, G = T && P ? P(o) : o;
    return T === !1 && (G = P ? P(o) : o, T = G === O), (T === !1 || B.capture === !0) && (B.matchBase === !0 || B.basename === !0 ? T = i.matchBase(o, l, A, d) : T = l.exec(G)), { isMatch: !!T, match: T, output: G };
  }, i.matchBase = (o, l, A) => (l instanceof RegExp ? l : i.makeRe(l, A)).test(K.basename(o)), i.isMatch = (o, l, A) => i(l, A)(o), i.parse = (o, l) => Array.isArray(o) ? o.map((A) => i.parse(A, l)) : y(o, { ...l, fastpaths: !1 }), i.scan = (o, l) => g(o, l), i.compileRe = (o, l, A = !1, O = !1) => {
    if (A === !0)
      return o.output;
    const d = l || {}, B = d.contains ? "" : "^", P = d.contains ? "" : "$";
    let T = `${B}(?:${o.output})${P}`;
    o && o.negated === !0 && (T = `^(?!${T}).*$`);
    const G = i.toRegex(T, l);
    return O === !0 && (G.state = o), G;
  }, i.makeRe = (o, l = {}, A = !1, O = !1) => {
    if (!o || typeof o != "string")
      throw new TypeError("Expected a non-empty string");
    let d = { negated: !1, fastpaths: !0 };
    return l.fastpaths !== !1 && (o[0] === "." || o[0] === "*") && (d.output = y.fastpaths(o, l)), d.output || (d = y(o, l)), i.compileRe(d, l, A, O);
  }, i.toRegex = (o, l) => {
    try {
      const A = l || {};
      return new RegExp(o, A.flags || (A.nocase ? "i" : ""));
    } catch (A) {
      if (l && l.debug === !0) throw A;
      return /$^/;
    }
  }, i.constants = L, St = i, St;
}
var Ct, Tt;
function Bt() {
  if (Tt) return Ct;
  Tt = 1;
  const g = /* @__PURE__ */ Nt(), y = /* @__PURE__ */ Et();
  function K(L, X, i = !1) {
    return X && (X.windows === null || X.windows === void 0) && (X = { ...X, windows: y.isWindows() }), g(L, X, i);
  }
  return Object.assign(K, g), Ct = K, Ct;
}
var Pt = /* @__PURE__ */ Bt();
const Mt = /* @__PURE__ */ wt(Pt);
export {
  Mt as p
};
