import { C as be, E as k, L as Pe } from "./index-BkvhKQ1q.js";
import { s as Te, t as h, p as xe, L as Ve, b as we, f as ye, G as ve, a as Xe, E as ke, e as K, k as $e } from "./lib-z0CN9MOd.js";
import { cssLanguage as J, css as _e } from "./index-B2Pa34_t.js";
import { typescriptLanguage as qe, jsxLanguage as Ce, tsxLanguage as Qe, javascriptLanguage as M, javascript as Ae } from "./index-DPgfsQ1e.js";
const Ye = 54, Me = 1, Re = 55, Ee = 2, Ze = 56, Be = 3, z = 4, ze = 5, v = 6, ee = 7, te = 8, ae = 9, le = 10, We = 11, De = 12, Ne = 13, $ = 57, Ge = 14, W = 58, re = 20, Ie = 22, ne = 23, je = 24, A = 26, se = 27, Ue = 28, Le = 31, Fe = 34, He = 36, Ke = 37, Je = 0, et = 1, tt = {
  area: !0,
  base: !0,
  br: !0,
  col: !0,
  command: !0,
  embed: !0,
  frame: !0,
  hr: !0,
  img: !0,
  input: !0,
  keygen: !0,
  link: !0,
  meta: !0,
  param: !0,
  source: !0,
  track: !0,
  wbr: !0,
  menuitem: !0
}, at = {
  dd: !0,
  li: !0,
  optgroup: !0,
  option: !0,
  p: !0,
  rp: !0,
  rt: !0,
  tbody: !0,
  td: !0,
  tfoot: !0,
  th: !0,
  tr: !0
}, D = {
  dd: { dd: !0, dt: !0 },
  dt: { dd: !0, dt: !0 },
  li: { li: !0 },
  option: { option: !0, optgroup: !0 },
  optgroup: { optgroup: !0 },
  p: {
    address: !0,
    article: !0,
    aside: !0,
    blockquote: !0,
    dir: !0,
    div: !0,
    dl: !0,
    fieldset: !0,
    footer: !0,
    form: !0,
    h1: !0,
    h2: !0,
    h3: !0,
    h4: !0,
    h5: !0,
    h6: !0,
    header: !0,
    hgroup: !0,
    hr: !0,
    menu: !0,
    nav: !0,
    ol: !0,
    p: !0,
    pre: !0,
    section: !0,
    table: !0,
    ul: !0
  },
  rp: { rp: !0, rt: !0 },
  rt: { rp: !0, rt: !0 },
  tbody: { tbody: !0, tfoot: !0 },
  td: { td: !0, th: !0 },
  tfoot: { tbody: !0 },
  th: { td: !0, th: !0 },
  thead: { tbody: !0, tfoot: !0 },
  tr: { tr: !0 }
};
function lt(e) {
  return e == 45 || e == 46 || e == 58 || e >= 65 && e <= 90 || e == 95 || e >= 97 && e <= 122 || e >= 161;
}
function oe(e) {
  return e == 9 || e == 10 || e == 13 || e == 32;
}
let N = null, G = null, I = 0;
function Y(e, a) {
  let r = e.pos + a;
  if (I == r && G == e)
    return N;
  let l = e.peek(a);
  for (; oe(l); )
    l = e.peek(++a);
  let t = "";
  for (; lt(l); )
    t += String.fromCharCode(l), l = e.peek(++a);
  return G = e, I = r, N = t ? t.toLowerCase() : l == rt || l == nt ? void 0 : null;
}
const ue = 60, X = 62, R = 47, rt = 63, nt = 33, st = 45;
function j(e, a) {
  this.name = e, this.parent = a, this.hash = a ? a.hash : 0;
  for (let r = 0; r < e.length; r++)
    this.hash += (this.hash << 4) + e.charCodeAt(r) + (e.charCodeAt(r) << 8);
}
const ot = [v, le, ee, te, ae], ut = new be({
  start: null,
  shift(e, a, r, l) {
    return ot.indexOf(a) > -1 ? new j(Y(l, 1) || "", e) : e;
  },
  reduce(e, a) {
    return a == re && e ? e.parent : e;
  },
  reuse(e, a, r, l) {
    let t = a.type.id;
    return t == v || t == He ? new j(Y(l, 1) || "", e) : e;
  },
  hash(e) {
    return e ? e.hash : 0;
  },
  strict: !1
}), Ot = new k((e, a) => {
  if (e.next != ue) {
    e.next < 0 && a.context && e.acceptToken($);
    return;
  }
  e.advance();
  let r = e.next == R;
  r && e.advance();
  let l = Y(e, 0);
  if (l === void 0)
    return;
  if (!l)
    return e.acceptToken(r ? Ge : v);
  let t = a.context ? a.context.name : null;
  if (r) {
    if (l == t)
      return e.acceptToken(We);
    if (t && at[t])
      return e.acceptToken($, -2);
    if (a.dialectEnabled(Je))
      return e.acceptToken(De);
    for (let s = a.context; s; s = s.parent)
      if (s.name == l)
        return;
    e.acceptToken(Ne);
  } else {
    if (l == "script")
      return e.acceptToken(ee);
    if (l == "style")
      return e.acceptToken(te);
    if (l == "textarea")
      return e.acceptToken(ae);
    if (tt.hasOwnProperty(l))
      return e.acceptToken(le);
    t && D[t] && D[t][l] ? e.acceptToken($, -1) : e.acceptToken(v);
  }
}, { contextual: !0 }), it = new k((e) => {
  for (let a = 0, r = 0; ; r++) {
    if (e.next < 0) {
      r && e.acceptToken(W);
      break;
    }
    if (e.next == st)
      a++;
    else if (e.next == X && a >= 2) {
      r >= 3 && e.acceptToken(W, -2);
      break;
    } else
      a = 0;
    e.advance();
  }
});
function ct(e) {
  for (; e; e = e.parent)
    if (e.name == "svg" || e.name == "math")
      return !0;
  return !1;
}
const dt = new k((e, a) => {
  if (e.next == R && e.peek(1) == X) {
    let r = a.dialectEnabled(et) || ct(a.context);
    e.acceptToken(r ? ze : z, 2);
  } else
    e.next == X && e.acceptToken(z, 1);
});
function E(e, a, r) {
  let l = 2 + e.length;
  return new k((t) => {
    for (let s = 0, o = 0, u = 0; ; u++) {
      if (t.next < 0) {
        u && t.acceptToken(a);
        break;
      }
      if (s == 0 && t.next == ue || s == 1 && t.next == R || s >= 2 && s < l && t.next == e.charCodeAt(s - 2))
        s++, o++;
      else if ((s == 2 || s == l) && oe(t.next))
        o++;
      else if (s == l && t.next == X) {
        u > o ? t.acceptToken(a, -o) : t.acceptToken(r, -(o - 2));
        break;
      } else if ((t.next == 10 || t.next == 13) && u) {
        t.acceptToken(a, 1);
        break;
      } else
        s = o = 0;
      t.advance();
    }
  });
}
const pt = E("script", Ye, Me), mt = E("style", Re, Ee), ft = E("textarea", Ze, Be), St = Te({
  "Text RawText": h.content,
  "StartTag StartCloseTag SelfClosingEndTag EndTag": h.angleBracket,
  TagName: h.tagName,
  "MismatchedCloseTag/TagName": [h.tagName, h.invalid],
  AttributeName: h.attributeName,
  "AttributeValue UnquotedAttributeValue": h.attributeValue,
  Is: h.definitionOperator,
  "EntityReference CharacterReference": h.character,
  Comment: h.blockComment,
  ProcessingInst: h.processingInstruction,
  D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ndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",
  maxTerm: 67,
  context: ut,
  nodeProps: [
    ["closedBy", -10, 1, 2, 3, 7, 8, 9, 10, 11, 12, 13, "EndTag", 6, "EndTag SelfClosingEndTag", -4, 21, 30, 33, 36, "CloseTag"],
    ["openedBy", 4, "StartTag StartCloseTag", 5, "StartTag", -4, 29, 32, 35, 37, "OpenTag"],
    ["group", -9, 14, 17, 18, 19, 20, 39, 40, 41, 42, "Entity", 16, "Entity TextContent", -3, 28, 31, 34, "TextContent Entity"],
    ["isolate", -11, 21, 29, 30, 32, 33, 35, 36, 37, 38, 41, 42, "ltr", -3, 26, 27, 39, ""]
  ],
  propSources: [St],
  skippedNodes: [0],
  repeatNodeCount: 9,
  tokenData: "!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|c`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&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e, a) {
  let r = /* @__PURE__ */ Object.create(null);
  for (let l of e.getChildren(ne)) {
    let t = l.getChild(je), s = l.getChild(A) || l.getChild(se);
    t && (r[a.read(t.from, t.to)] = s ? s.type.id == A ? a.read(s.from + 1, s.to - 1) : a.read(s.from, s.to) : "");
  }
  return r;
}
function U(e, a) {
  let r = e.getChild(Ie);
  return r ? a.read(r.from, r.to) : " ";
}
function _(e, a, r) {
  let l;
  for (let t of r)
    if (!t.attrs || t.attrs(l || (l = Oe(e.node.parent.firstChild, a))))
      return { parser: t.parser };
  return null;
}
function ie(e = [], a = []) {
  let r = [], l = [], t = [], s = [];
  for (let u of e)
    (u.tag == "script" ? r : u.tag == "style" ? l : u.tag == "textarea" ? t : s).push(u);
  let o = a.length ? /* @__PURE__ */ Object.create(null) : null;
  for (let u of a)
    (o[u.name] || (o[u.name] = [])).push(u);
  return xe((u, O) => {
    let f = u.type.id;
    if (f == Ue)
      return _(u, O, r);
    if (f == Le)
      return _(u, O, l);
    if (f == Fe)
      return _(u, O, t);
    if (f == re && s.length) {
      let p = u.node, d = p.firstChild, m = d && U(d, O), c;
      if (m) {
        for (let i of s)
          if (i.tag == m && (!i.attrs || i.attrs(c || (c = Oe(p, O))))) {
            let g = p.lastChild, b = g.type.id == Ke ? g.from : p.to;
            if (b > d.to)
              return { parser: i.parser, overlay: [{ from: d.to, to: b }] };
          }
      }
    }
    if (o && f == ne) {
      let p = u.node, d;
      if (d = p.firstChild) {
        let m = o[O.read(d.from, d.to)];
        if (m)
          for (let c of m) {
            if (c.tagName && c.tagName != U(p.parent, O))
              continue;
            let i = p.lastChild;
            if (i.type.id == A) {
              let g = i.from + 1, b = i.lastChild, P = i.to - (b && b.isError ? 0 : 1);
              if (P > g)
                return { parser: c.parser, overlay: [{ from: g, to: P }] };
            } else if (i.type.id == se)
              return { parser: c.parser, overlay: [{ from: i.from, to: i.to }] };
          }
      }
    }
    return null;
  });
}
const V = ["_blank", "_self", "_top", "_parent"], q = ["ascii", "utf-8", "utf-16", "latin1", "latin1"], C = ["get", "post", "put", "delete"], Q = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], S = ["true", "false"], n = {}, ht = {
  a: {
    attrs: {
      href: null,
      ping: null,
      type: null,
      media: null,
      target: V,
      hreflang: null
    }
  },
  abbr: n,
  address: n,
  area: {
    attrs: {
      alt: null,
      coords: null,
      href: null,
      target: null,
      ping: null,
      media: null,
      hreflang: null,
      type: null,
      shape: ["default", "rect", "circle", "poly"]
    }
  },
  article: n,
  aside: n,
  audio: {
    attrs: {
      src: null,
      mediagroup: null,
      crossorigin: ["anonymous", "use-credentials"],
      preload: ["none", "metadata", "auto"],
      autoplay: ["autoplay"],
      loop: ["loop"],
      controls: ["controls"]
    }
  },
  b: n,
  base: { attrs: { href: null, target: V } },
  bdi: n,
  bdo: n,
  blockquote: { attrs: { cite: null } },
  body: n,
  br: n,
  button: {
    attrs: {
      form: null,
      formaction: null,
      name: null,
      value: null,
      autofocus: ["autofocus"],
      disabled: ["autofocus"],
      formenctype: Q,
      formmethod: C,
      formnovalidate: ["novalidate"],
      formtarget: V,
      type: ["submit", "reset", "button"]
    }
  },
  canvas: { attrs: { width: null, height: null } },
  caption: n,
  center: n,
  cite: n,
  code: n,
  col: { attrs: { span: null } },
  colgroup: { attrs: { span: null } },
  command: {
    attrs: {
      type: ["command", "checkbox", "radio"],
      label: null,
      icon: null,
      radiogroup: null,
      command: null,
      title: null,
      disabled: ["disabled"],
      checked: ["checked"]
    }
  },
  data: { attrs: { value: null } },
  datagrid: { attrs: { disabled: ["disabled"], multiple: ["multiple"] } },
  datalist: { attrs: { data: null } },
  dd: n,
  del: { attrs: { cite: null, datetime: null } },
  details: { attrs: { open: ["open"] } },
  dfn: n,
  div: n,
  dl: n,
  dt: n,
  em: n,
  embed: { attrs: { src: null, type: null, width: null, height: null } },
  eventsource: { attrs: { src: null } },
  fieldset: { attrs: { disabled: ["disabled"], form: null, name: null } },
  figcaption: n,
  figure: n,
  footer: n,
  form: {
    attrs: {
      action: null,
      name: null,
      "accept-charset": q,
      autocomplete: ["on", "off"],
      enctype: Q,
      method: C,
      novalidate: ["novalidate"],
      target: V
    }
  },
  h1: n,
  h2: n,
  h3: n,
  h4: n,
  h5: n,
  h6: n,
  head: {
    children: ["title", "base", "link", "style", "meta", "script", "noscript", "command"]
  },
  header: n,
  hgroup: n,
  hr: n,
  html: {
    attrs: { manifest: null }
  },
  i: n,
  iframe: {
    attrs: {
      src: null,
      srcdoc: null,
      name: null,
      width: null,
      height: null,
      sandbox: ["allow-top-navigation", "allow-same-origin", "allow-forms", "allow-scripts"],
      seamless: ["seamless"]
    }
  },
  img: {
    attrs: {
      alt: null,
      src: null,
      ismap: null,
      usemap: null,
      width: null,
      height: null,
      crossorigin: ["anonymous", "use-credentials"]
    }
  },
  input: {
    attrs: {
      alt: null,
      dirname: null,
      form: null,
      formaction: null,
      height: null,
      list: null,
      max: null,
      maxlength: null,
      min: null,
      name: null,
      pattern: null,
      placeholder: null,
      size: null,
      src: null,
      step: null,
      value: null,
      width: null,
      accept: ["audio/*", "video/*", "image/*"],
      autocomplete: ["on", "off"],
      autofocus: ["autofocus"],
      checked: ["checked"],
      disabled: ["disabled"],
      formenctype: Q,
      formmethod: C,
      formnovalidate: ["novalidate"],
      formtarget: V,
      multiple: ["multiple"],
      readonly: ["readonly"],
      required: ["required"],
      type: [
        "hidden",
        "text",
        "search",
        "tel",
        "url",
        "email",
        "password",
        "datetime",
        "date",
        "month",
        "week",
        "time",
        "datetime-local",
        "number",
        "range",
        "color",
        "checkbox",
        "radio",
        "file",
        "submit",
        "image",
        "reset",
        "button"
      ]
    }
  },
  ins: { attrs: { cite: null, datetime: null } },
  kbd: n,
  keygen: {
    attrs: {
      challenge: null,
      form: null,
      name: null,
      autofocus: ["autofocus"],
      disabled: ["disabled"],
      keytype: ["RSA"]
    }
  },
  label: { attrs: { for: null, form: null } },
  legend: n,
  li: { attrs: { value: null } },
  link: {
    attrs: {
      href: null,
      type: null,
      hreflang: null,
      media: null,
      sizes: ["all", "16x16", "16x16 32x32", "16x16 32x32 64x64"]
    }
  },
  map: { attrs: { name: null } },
  mark: n,
  menu: { attrs: { label: null, type: ["list", "context", "toolbar"] } },
  meta: {
    attrs: {
      content: null,
      charset: q,
      name: ["viewport", "application-name", "author", "description", "generator", "keywords"],
      "http-equiv": ["content-language", "content-type", "default-style", "refresh"]
    }
  },
  meter: { attrs: { value: null, min: null, low: null, high: null, max: null, optimum: null } },
  nav: n,
  noscript: n,
  object: {
    attrs: {
      data: null,
      type: null,
      name: null,
      usemap: null,
      form: null,
      width: null,
      height: null,
      typemustmatch: ["typemustmatch"]
    }
  },
  ol: {
    attrs: { reversed: ["reversed"], start: null, type: ["1", "a", "A", "i", "I"] },
    children: ["li", "script", "template", "ul", "ol"]
  },
  optgroup: { attrs: { disabled: ["disabled"], label: null } },
  option: { attrs: { disabled: ["disabled"], label: null, selected: ["selected"], value: null } },
  output: { attrs: { for: null, form: null, name: null } },
  p: n,
  param: { attrs: { name: null, value: null } },
  pre: n,
  progress: { attrs: { value: null, max: null } },
  q: { attrs: { cite: null } },
  rp: n,
  rt: n,
  ruby: n,
  samp: n,
  script: {
    attrs: {
      type: ["text/javascript"],
      src: null,
      async: ["async"],
      defer: ["defer"],
      charset: q
    }
  },
  section: n,
  select: {
    attrs: {
      form: null,
      name: null,
      size: null,
      autofocus: ["autofocus"],
      disabled: ["disabled"],
      multiple: ["multiple"]
    }
  },
  slot: { attrs: { name: null } },
  small: n,
  source: { attrs: { src: null, type: null, media: null } },
  span: n,
  strong: n,
  style: {
    attrs: {
      type: ["text/css"],
      media: null,
      scoped: null
    }
  },
  sub: n,
  summary: n,
  sup: n,
  table: n,
  tbody: n,
  td: { attrs: { colspan: null, rowspan: null, headers: null } },
  template: n,
  textarea: {
    attrs: {
      dirname: null,
      form: null,
      maxlength: null,
      name: null,
      placeholder: null,
      rows: null,
      cols: null,
      autofocus: ["autofocus"],
      disabled: ["disabled"],
      readonly: ["readonly"],
      required: ["required"],
      wrap: ["soft", "hard"]
    }
  },
  tfoot: n,
  th: { attrs: { colspan: null, rowspan: null, headers: null, scope: ["row", "col", "rowgroup", "colgroup"] } },
  thead: n,
  time: { attrs: { datetime: null } },
  title: n,
  tr: n,
  track: {
    attrs: {
      src: null,
      label: null,
      default: null,
      kind: ["subtitles", "captions", "descriptions", "chapters", "metadata"],
      srclang: null
    }
  },
  ul: { children: ["li", "script", "template", "ul", "ol"] },
  var: n,
  video: {
    attrs: {
      src: null,
      poster: null,
      width: null,
      height: null,
      crossorigin: ["anonymous", "use-credentials"],
      preload: ["auto", "metadata", "none"],
      autoplay: ["autoplay"],
      mediagroup: ["movie"],
      muted: ["muted"],
      controls: ["controls"]
    }
  },
  wbr: n
}, ce = {
  accesskey: null,
  class: null,
  contenteditable: S,
  contextmenu: null,
  dir: ["ltr", "rtl", "auto"],
  draggable: ["true", "false", "auto"],
  dropzone: ["copy", "move", "link", "string:", "file:"],
  hidden: ["hidden"],
  id: null,
  inert: ["inert"],
  itemid: null,
  itemprop: null,
  itemref: null,
  itemscope: ["itemscope"],
  itemtype: null,
  lang: ["ar", "bn", "de", "en-GB", "en-US", "es", "fr", "hi", "id", "ja", "pa", "pt", "ru", "tr", "zh"],
  spellcheck: S,
  autocorrect: S,
  autocapitalize: S,
  style: null,
  tabindex: null,
  title: null,
  translate: ["yes", "no"],
  rel: ["stylesheet", "alternate", "author", "bookmark", "help", "license", "next", "nofollow", "noreferrer", "prefetch", "prev", "search", "tag"],
  role: /* @__PURE__ */ "alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),
  "aria-activedescendant": null,
  "aria-atomic": S,
  "aria-autocomplete": ["inline", "list", "both", "none"],
  "aria-busy": S,
  "aria-checked": ["true", "false", "mixed", "undefined"],
  "aria-controls": null,
  "aria-describedby": null,
  "aria-disabled": S,
  "aria-dropeffect": null,
  "aria-expanded": ["true", "false", "undefined"],
  "aria-flowto": null,
  "aria-grabbed": ["true", "false", "undefined"],
  "aria-haspopup": S,
  "aria-hidden": S,
  "aria-invalid": ["true", "false", "grammar", "spelling"],
  "aria-label": null,
  "aria-labelledby": null,
  "aria-level": null,
  "aria-live": ["off", "polite", "assertive"],
  "aria-multiline": S,
  "aria-multiselectable": S,
  "aria-owns": null,
  "aria-posinset": null,
  "aria-pressed": ["true", "false", "mixed", "undefined"],
  "aria-readonly": S,
  "aria-relevant": null,
  "aria-required": S,
  "aria-selected": ["true", "false", "undefined"],
  "aria-setsize": null,
  "aria-sort": ["ascending", "descending", "none", "other"],
  "aria-valuemax": null,
  "aria-valuemin": null,
  "aria-valuenow": null,
  "aria-valuetext": null
}, de = /* @__PURE__ */ "beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map((e) => "on" + e);
for (let e of de)
  ce[e] = null;
class w {
  constructor(a, r) {
    this.tags = Object.assign(Object.assign({}, ht), a), this.globalAttrs = Object.assign(Object.assign({}, ce), r), this.allTags = Object.keys(this.tags), this.globalAttrNames = Object.keys(this.globalAttrs);
  }
}
w.default = /* @__PURE__ */ new w();
function T(e, a, r = e.length) {
  if (!a)
    return "";
  let l = a.firstChild, t = l && l.getChild("TagName");
  return t ? e.sliceString(t.from, Math.min(t.to, r)) : "";
}
function x(e, a = !1) {
  for (; e; e = e.parent)
    if (e.name == "Element")
      if (a)
        a = !1;
      else
        return e;
  return null;
}
function pe(e, a, r) {
  let l = r.tags[T(e, x(a))];
  return (l == null ? void 0 : l.children) || r.allTags;
}
function Z(e, a) {
  let r = [];
  for (let l = x(a); l && !l.type.isTop; l = x(l.parent)) {
    let t = T(e, l);
    if (t && l.lastChild.name == "CloseTag")
      break;
    t && r.indexOf(t) < 0 && (a.name == "EndTag" || a.from >= l.firstChild.to) && r.push(t);
  }
  return r;
}
const me = /^[:\-\.\w\u00b7-\uffff]*$/;
function L(e, a, r, l, t) {
  let s = /\s*>/.test(e.sliceDoc(t, t + 5)) ? "" : ">", o = x(r, !0);
  return {
    from: l,
    to: t,
    options: pe(e.doc, o, a).map((u) => ({ label: u, type: "type" })).concat(Z(e.doc, r).map((u, O) => ({
      label: "/" + u,
      apply: "/" + u + s,
      type: "type",
      boost: 99 - O
    }))),
    validFor: /^\/?[:\-\.\w\u00b7-\uffff]*$/
  };
}
function F(e, a, r, l) {
  let t = /\s*>/.test(e.sliceDoc(l, l + 5)) ? "" : ">";
  return {
    from: r,
    to: l,
    options: Z(e.doc, a).map((s, o) => ({ label: s, apply: s + t, type: "type", boost: 99 - o })),
    validFor: me
  };
}
function bt(e, a, r, l) {
  let t = [], s = 0;
  for (let o of pe(e.doc, r, a))
    t.push({ label: "<" + o, type: "type" });
  for (let o of Z(e.doc, r))
    t.push({ label: "</" + o + ">", type: "type", boost: 99 - s++ });
  return { from: l, to: l, options: t, validFor: /^<\/?[:\-\.\w\u00b7-\uffff]*$/ };
}
function Pt(e, a, r, l, t) {
  let s = x(r), o = s ? a.tags[T(e.doc, s)] : null, u = o && o.attrs ? Object.keys(o.attrs) : [], O = o && o.globalAttrs === !1 ? u : u.length ? u.concat(a.globalAttrNames) : a.globalAttrNames;
  return {
    from: l,
    to: t,
    options: O.map((f) => ({ label: f, type: "property" })),
    validFor: me
  };
}
function Tt(e, a, r, l, t) {
  var s;
  let o = (s = r.parent) === null || s === void 0 ? void 0 : s.getChild("AttributeName"), u = [], O;
  if (o) {
    let f = e.sliceDoc(o.from, o.to), p = a.globalAttrs[f];
    if (!p) {
      let d = x(r), m = d ? a.tags[T(e.doc, d)] : null;
      p = (m == null ? void 0 : m.attrs) && m.attrs[f];
    }
    if (p) {
      let d = e.sliceDoc(l, t).toLowerCase(), m = '"', c = '"';
      /^['"]/.test(d) ? (O = d[0] == '"' ? /^[^"]*$/ : /^[^']*$/, m = "", c = e.sliceDoc(t, t + 1) == d[0] ? "" : d[0], d = d.slice(1), l++) : O = /^[^\s<>='"]*$/;
      for (let i of p)
        u.push({ label: i, apply: m + i + c, type: "constant" });
    }
  }
  return { from: l, to: t, options: u, validFor: O };
}
function fe(e, a) {
  let { state: r, pos: l } = a, t = K(r).resolveInner(l, -1), s = t.resolve(l);
  for (let o = l, u; s == t && (u = t.childBefore(o)); ) {
    let O = u.lastChild;
    if (!O || !O.type.isError || O.from < O.to)
      break;
    s = t = u, o = O.from;
  }
  return t.name == "TagName" ? t.parent && /CloseTag$/.test(t.parent.name) ? F(r, t, t.from, l) : L(r, e, t, t.from, l) : t.name == "StartTag" ? L(r, e, t, l, l) : t.name == "StartCloseTag" || t.name == "IncompleteCloseTag" ? F(r, t, l, l) : t.name == "OpenTag" || t.name == "SelfClosingTag" || t.name == "AttributeName" ? Pt(r, e, t, t.name == "AttributeName" ? t.from : l, l) : t.name == "Is" || t.name == "AttributeValue" || t.name == "UnquotedAttributeValue" ? Tt(r, e, t, t.name == "Is" ? l : t.from, l) : a.explicit && (s.name == "Element" || s.name == "Text" || s.name == "Document") ? bt(r, e, t, l) : null;
}
function $t(e) {
  return fe(w.default, e);
}
function xt(e) {
  let { extraTags: a, extraGlobalAttributes: r } = e, l = r || a ? new w(a, r) : w.default;
  return (t) => fe(l, t);
}
const Vt = /* @__PURE__ */ M.parser.configure({ top: "SingleExpression" }), Se = [
  {
    tag: "script",
    attrs: (e) => e.type == "text/typescript" || e.lang == "ts",
    parser: qe.parser
  },
  {
    tag: "script",
    attrs: (e) => e.type == "text/babel" || e.type == "text/jsx",
    parser: Ce.parser
  },
  {
    tag: "script",
    attrs: (e) => e.type == "text/typescript-jsx",
    parser: Qe.parser
  },
  {
    tag: "script",
    attrs(e) {
      return /^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type);
    },
    parser: Vt
  },
  {
    tag: "script",
    attrs(e) {
      return !e.type || /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type);
    },
    parser: M.parser
  },
  {
    tag: "style",
    attrs(e) {
      return (!e.lang || e.lang == "css") && (!e.type || /^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type));
    },
    parser: J.parser
  }
], ge = /* @__PURE__ */ [
  {
    name: "style",
    parser: /* @__PURE__ */ J.parser.configure({ top: "Styles" })
  }
].concat(/* @__PURE__ */ de.map((e) => ({ name: e, parser: M.parser }))), he = /* @__PURE__ */ Ve.define({
  name: "html",
  parser: /* @__PURE__ */ gt.configure({
    props: [
      /* @__PURE__ */ we.add({
        Element(e) {
          let a = /^(\s*)(<\/)?/.exec(e.textAfter);
          return e.node.to <= e.pos + a[0].length ? e.continue() : e.lineIndent(e.node.from) + (a[2] ? 0 : e.unit);
        },
        "OpenTag CloseTag SelfClosingTag"(e) {
          return e.column(e.node.from) + e.unit;
        },
        Document(e) {
          if (e.pos + /\s*/.exec(e.textAfter)[0].length < e.node.to)
            return e.continue();
          let a = null, r;
          for (let l = e.node; ; ) {
            let t = l.lastChild;
            if (!t || t.name != "Element" || t.to != l.to)
              break;
            a = l = t;
          }
          return a && !((r = a.lastChild) && (r.name == "CloseTag" || r.name == "SelfClosingTag")) ? e.lineIndent(a.from) + e.unit : null;
        }
      }),
      /* @__PURE__ */ ye.add({
        Element(e) {
          let a = e.firstChild, r = e.lastChild;
          return !a || a.name != "OpenTag" ? null : { from: a.to, to: r.name == "CloseTag" ? r.from : e.to };
        }
      }),
      /* @__PURE__ */ ve.add({
        "OpenTag CloseTag": (e) => e.getChild("TagName")
      })
    ]
  }),
  languageData: {
    commentTokens: { block: { open: "<!--", close: "-->" } },
    indentOnInput: /^\s*<\/\w+\W$/,
    wordChars: "-._"
  }
}), y = /* @__PURE__ */ he.configure({
  wrap: /* @__PURE__ */ ie(Se, ge)
});
function _t(e = {}) {
  let a = "", r;
  e.matchClosingTags === !1 && (a = "noMatch"), e.selfClosingTags === !0 && (a = (a ? a + " " : "") + "selfClosing"), (e.nestedLanguages && e.nestedLanguages.length || e.nestedAttributes && e.nestedAttributes.length) && (r = ie((e.nestedLanguages || []).concat(Se), (e.nestedAttributes || []).concat(ge)));
  let l = r ? he.configure({ wrap: r, dialect: a }) : a ? y.configure({ dialect: a }) : y;
  return new Xe(l, [
    y.data.of({ autocomplete: xt(e) }),
    e.autoCloseTags !== !1 ? wt : [],
    Ae().support,
    _e().support
  ]);
}
const H = /* @__PURE__ */ new Set(/* @__PURE__ */ "area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")), wt = /* @__PURE__ */ ke.inputHandler.of((e, a, r, l, t) => {
  if (e.composing || e.state.readOnly || a != r || l != ">" && l != "/" || !y.isActiveAt(e.state, a, -1))
    return !1;
  let s = t(), { state: o } = s, u = o.changeByRange((O) => {
    var f, p, d;
    let m = o.doc.sliceString(O.from - 1, O.to) == l, { head: c } = O, i = K(o).resolveInner(c - 1, -1), g;
    if ((i.name == "TagName" || i.name == "StartTag") && (i = i.parent), m && l == ">" && i.name == "OpenTag") {
      if (((p = (f = i.parent) === null || f === void 0 ? void 0 : f.lastChild) === null || p === void 0 ? void 0 : p.name) != "CloseTag" && (g = T(o.doc, i.parent, c)) && !H.has(g)) {
        let b = c + (o.doc.sliceString(c, c + 1) === ">" ? 1 : 0), P = `</${g}>`;
        return { range: O, changes: { from: c, to: b, insert: P } };
      }
    } else if (m && l == "/" && i.name == "IncompleteCloseTag") {
      let b = i.parent;
      if (i.from == c - 2 && ((d = b.lastChild) === null || d === void 0 ? void 0 : d.name) != "CloseTag" && (g = T(o.doc, b, c)) && !H.has(g)) {
        let P = c + (o.doc.sliceString(c, c + 1) === ">" ? 1 : 0), B = `${g}>`;
        return {
          range: $e.cursor(c + B.length, -1),
          changes: { from: c, to: P, insert: B }
        };
      }
    }
    return { range: O };
  });
  return u.changes.empty ? !1 : (e.dispatch([
    s,
    o.update(u, {
      userEvent: "input.complete",
      scrollIntoView: !0
    })
  ]), !0);
});
export {
  wt as autoCloseTags,
  _t as html,
  $t as htmlCompletionSource,
  xt as htmlCompletionSourceWith,
  y as htmlLanguage,
  he as htmlPlain
};
